@capgo/cli 4.26.12 → 4.26.14

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,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- "use strict";var QL=Object.create;var nl=Object.defineProperty;var eB=Object.getOwnPropertyDescriptor;var tB=Object.getOwnPropertyNames;var rB=Object.getPrototypeOf,nB=Object.prototype.hasOwnProperty;var ut=(t,e)=>()=>(t&&(e=t(t=0)),e);var y=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),mn=(t,e)=>{for(var r in e)nl(t,r,{get:e[r],enumerable:!0})},cw=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of tB(e))!nB.call(t,i)&&i!==r&&nl(t,i,{get:()=>e[i],enumerable:!(n=eB(e,i))||n.enumerable});return t};var ce=(t,e,r)=>(r=t!=null?QL(rB(t)):{},cw(e||!t||!t.__esModule?nl(r,"default",{value:t,enumerable:!0}):r,t)),ke=t=>cw(nl({},"__esModule",{value:!0}),t);var Na=y(Ep=>{var il=class extends Error{constructor(e,r,n){super(n),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=r,this.exitCode=e,this.nestedError=void 0}},_p=class extends il{constructor(e){super(1,"commander.invalidArgument",e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};Ep.CommanderError=il;Ep.InvalidArgumentError=_p});var ol=y(Sp=>{var{InvalidArgumentError:iB}=Na(),Cp=class{constructor(e,r){switch(this.description=r||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,e[0]){case"<":this.required=!0,this._name=e.slice(1,-1);break;case"[":this.required=!1,this._name=e.slice(1,-1);break;default:this.required=!0,this._name=e;break}this._name.length>3&&this._name.slice(-3)==="..."&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_concatValue(e,r){return r===this.defaultValue||!Array.isArray(r)?[e]:r.concat(e)}default(e,r){return this.defaultValue=e,this.defaultValueDescription=r,this}argParser(e){return this.parseArg=e,this}choices(e){return this.argChoices=e.slice(),this.parseArg=(r,n)=>{if(!this.argChoices.includes(r))throw new iB(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(r,n):r},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function oB(t){let e=t.name()+(t.variadic===!0?"...":"");return t.required?"<"+e+">":"["+e+"]"}Sp.Argument=Cp;Sp.humanReadableArgName=oB});var Fp=y(lw=>{var{humanReadableArgName:sB}=ol(),xp=class{constructor(){this.helpWidth=void 0,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}visibleCommands(e){let r=e.commands.filter(i=>!i._hidden),n=e._getHelpCommand();return n&&!n._hidden&&r.push(n),this.sortSubcommands&&r.sort((i,o)=>i.name().localeCompare(o.name())),r}compareOptions(e,r){let n=i=>i.short?i.short.replace(/^-/,""):i.long.replace(/^--/,"");return n(e).localeCompare(n(r))}visibleOptions(e){let r=e.options.filter(i=>!i.hidden),n=e._getHelpOption();if(n&&!n.hidden){let i=n.short&&e._findOption(n.short),o=n.long&&e._findOption(n.long);!i&&!o?r.push(n):n.long&&!o?r.push(e.createOption(n.long,n.description)):n.short&&!i&&r.push(e.createOption(n.short,n.description))}return this.sortOptions&&r.sort(this.compareOptions),r}visibleGlobalOptions(e){if(!this.showGlobalOptions)return[];let r=[];for(let n=e.parent;n;n=n.parent){let i=n.options.filter(o=>!o.hidden);r.push(...i)}return this.sortOptions&&r.sort(this.compareOptions),r}visibleArguments(e){return e._argsDescription&&e.registeredArguments.forEach(r=>{r.description=r.description||e._argsDescription[r.name()]||""}),e.registeredArguments.find(r=>r.description)?e.registeredArguments:[]}subcommandTerm(e){let r=e.registeredArguments.map(n=>sB(n)).join(" ");return e._name+(e._aliases[0]?"|"+e._aliases[0]:"")+(e.options.length?" [options]":"")+(r?" "+r:"")}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,r){return r.visibleCommands(e).reduce((n,i)=>Math.max(n,r.subcommandTerm(i).length),0)}longestOptionTermLength(e,r){return r.visibleOptions(e).reduce((n,i)=>Math.max(n,r.optionTerm(i).length),0)}longestGlobalOptionTermLength(e,r){return r.visibleGlobalOptions(e).reduce((n,i)=>Math.max(n,r.optionTerm(i).length),0)}longestArgumentTermLength(e,r){return r.visibleArguments(e).reduce((n,i)=>Math.max(n,r.argumentTerm(i).length),0)}commandUsage(e){let r=e._name;e._aliases[0]&&(r=r+"|"+e._aliases[0]);let n="";for(let i=e.parent;i;i=i.parent)n=i.name()+" "+n;return n+r+" "+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.summary()||e.description()}optionDescription(e){let r=[];return e.argChoices&&r.push(`choices: ${e.argChoices.map(n=>JSON.stringify(n)).join(", ")}`),e.defaultValue!==void 0&&(e.required||e.optional||e.isBoolean()&&typeof e.defaultValue=="boolean")&&r.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),e.presetArg!==void 0&&e.optional&&r.push(`preset: ${JSON.stringify(e.presetArg)}`),e.envVar!==void 0&&r.push(`env: ${e.envVar}`),r.length>0?`${e.description} (${r.join(", ")})`:e.description}argumentDescription(e){let r=[];if(e.argChoices&&r.push(`choices: ${e.argChoices.map(n=>JSON.stringify(n)).join(", ")}`),e.defaultValue!==void 0&&r.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),r.length>0){let n=`(${r.join(", ")})`;return e.description?`${e.description} ${n}`:n}return e.description}formatHelp(e,r){let n=r.padWidth(e,r),i=r.helpWidth||80,o=2,s=2;function a(p,v){if(v){let g=`${p.padEnd(n+s)}${v}`;return r.wrap(g,i-o,n+s)}return p}function u(p){return p.join(`
2
+ "use strict";var QL=Object.create;var tl=Object.defineProperty;var eB=Object.getOwnPropertyDescriptor;var tB=Object.getOwnPropertyNames;var rB=Object.getPrototypeOf,nB=Object.prototype.hasOwnProperty;var ut=(t,e)=>()=>(t&&(e=t(t=0)),e);var y=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),mn=(t,e)=>{for(var r in e)tl(t,r,{get:e[r],enumerable:!0})},cw=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of tB(e))!nB.call(t,i)&&i!==r&&tl(t,i,{get:()=>e[i],enumerable:!(n=eB(e,i))||n.enumerable});return t};var ce=(t,e,r)=>(r=t!=null?QL(rB(t)):{},cw(e||!t||!t.__esModule?tl(r,"default",{value:t,enumerable:!0}):r,t)),ke=t=>cw(tl({},"__esModule",{value:!0}),t);var Na=y(Ep=>{var rl=class extends Error{constructor(e,r,n){super(n),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=r,this.exitCode=e,this.nestedError=void 0}},_p=class extends rl{constructor(e){super(1,"commander.invalidArgument",e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};Ep.CommanderError=rl;Ep.InvalidArgumentError=_p});var nl=y(Sp=>{var{InvalidArgumentError:iB}=Na(),Cp=class{constructor(e,r){switch(this.description=r||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,e[0]){case"<":this.required=!0,this._name=e.slice(1,-1);break;case"[":this.required=!1,this._name=e.slice(1,-1);break;default:this.required=!0,this._name=e;break}this._name.length>3&&this._name.slice(-3)==="..."&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_concatValue(e,r){return r===this.defaultValue||!Array.isArray(r)?[e]:r.concat(e)}default(e,r){return this.defaultValue=e,this.defaultValueDescription=r,this}argParser(e){return this.parseArg=e,this}choices(e){return this.argChoices=e.slice(),this.parseArg=(r,n)=>{if(!this.argChoices.includes(r))throw new iB(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(r,n):r},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function oB(t){let e=t.name()+(t.variadic===!0?"...":"");return t.required?"<"+e+">":"["+e+"]"}Sp.Argument=Cp;Sp.humanReadableArgName=oB});var Fp=y(lw=>{var{humanReadableArgName:sB}=nl(),xp=class{constructor(){this.helpWidth=void 0,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}visibleCommands(e){let r=e.commands.filter(i=>!i._hidden),n=e._getHelpCommand();return n&&!n._hidden&&r.push(n),this.sortSubcommands&&r.sort((i,o)=>i.name().localeCompare(o.name())),r}compareOptions(e,r){let n=i=>i.short?i.short.replace(/^-/,""):i.long.replace(/^--/,"");return n(e).localeCompare(n(r))}visibleOptions(e){let r=e.options.filter(i=>!i.hidden),n=e._getHelpOption();if(n&&!n.hidden){let i=n.short&&e._findOption(n.short),o=n.long&&e._findOption(n.long);!i&&!o?r.push(n):n.long&&!o?r.push(e.createOption(n.long,n.description)):n.short&&!i&&r.push(e.createOption(n.short,n.description))}return this.sortOptions&&r.sort(this.compareOptions),r}visibleGlobalOptions(e){if(!this.showGlobalOptions)return[];let r=[];for(let n=e.parent;n;n=n.parent){let i=n.options.filter(o=>!o.hidden);r.push(...i)}return this.sortOptions&&r.sort(this.compareOptions),r}visibleArguments(e){return e._argsDescription&&e.registeredArguments.forEach(r=>{r.description=r.description||e._argsDescription[r.name()]||""}),e.registeredArguments.find(r=>r.description)?e.registeredArguments:[]}subcommandTerm(e){let r=e.registeredArguments.map(n=>sB(n)).join(" ");return e._name+(e._aliases[0]?"|"+e._aliases[0]:"")+(e.options.length?" [options]":"")+(r?" "+r:"")}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,r){return r.visibleCommands(e).reduce((n,i)=>Math.max(n,r.subcommandTerm(i).length),0)}longestOptionTermLength(e,r){return r.visibleOptions(e).reduce((n,i)=>Math.max(n,r.optionTerm(i).length),0)}longestGlobalOptionTermLength(e,r){return r.visibleGlobalOptions(e).reduce((n,i)=>Math.max(n,r.optionTerm(i).length),0)}longestArgumentTermLength(e,r){return r.visibleArguments(e).reduce((n,i)=>Math.max(n,r.argumentTerm(i).length),0)}commandUsage(e){let r=e._name;e._aliases[0]&&(r=r+"|"+e._aliases[0]);let n="";for(let i=e.parent;i;i=i.parent)n=i.name()+" "+n;return n+r+" "+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.summary()||e.description()}optionDescription(e){let r=[];return e.argChoices&&r.push(`choices: ${e.argChoices.map(n=>JSON.stringify(n)).join(", ")}`),e.defaultValue!==void 0&&(e.required||e.optional||e.isBoolean()&&typeof e.defaultValue=="boolean")&&r.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),e.presetArg!==void 0&&e.optional&&r.push(`preset: ${JSON.stringify(e.presetArg)}`),e.envVar!==void 0&&r.push(`env: ${e.envVar}`),r.length>0?`${e.description} (${r.join(", ")})`:e.description}argumentDescription(e){let r=[];if(e.argChoices&&r.push(`choices: ${e.argChoices.map(n=>JSON.stringify(n)).join(", ")}`),e.defaultValue!==void 0&&r.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),r.length>0){let n=`(${r.join(", ")})`;return e.description?`${e.description} ${n}`:n}return e.description}formatHelp(e,r){let n=r.padWidth(e,r),i=r.helpWidth||80,o=2,s=2;function a(p,v){if(v){let g=`${p.padEnd(n+s)}${v}`;return r.wrap(g,i-o,n+s)}return p}function u(p){return p.join(`
3
3
  `).replace(/^/gm," ".repeat(o))}let c=[`Usage: ${r.commandUsage(e)}`,""],l=r.commandDescription(e);l.length>0&&(c=c.concat([r.wrap(l,i,0),""]));let f=r.visibleArguments(e).map(p=>a(r.argumentTerm(p),r.argumentDescription(p)));f.length>0&&(c=c.concat(["Arguments:",u(f),""]));let h=r.visibleOptions(e).map(p=>a(r.optionTerm(p),r.optionDescription(p)));if(h.length>0&&(c=c.concat(["Options:",u(h),""])),this.showGlobalOptions){let p=r.visibleGlobalOptions(e).map(v=>a(r.optionTerm(v),r.optionDescription(v)));p.length>0&&(c=c.concat(["Global Options:",u(p),""]))}let d=r.visibleCommands(e).map(p=>a(r.subcommandTerm(p),r.subcommandDescription(p)));return d.length>0&&(c=c.concat(["Commands:",u(d),""])),c.join(`
4
4
  `)}padWidth(e,r){return Math.max(r.longestOptionTermLength(e,r),r.longestGlobalOptionTermLength(e,r),r.longestSubcommandTermLength(e,r),r.longestArgumentTermLength(e,r))}wrap(e,r,n,i=40){let o=" \\f\\t\\v\xA0\u1680\u2000-\u200A\u202F\u205F\u3000\uFEFF",s=new RegExp(`[\\n][${o}]+`);if(e.match(s))return e;let a=r-n;if(a<i)return e;let u=e.slice(0,n),c=e.slice(n).replace(`\r
5
5
  `,`
@@ -8,7 +8,7 @@
8
8
  `?"":(g>0?l:"")+v.trimEnd()).join(`
9
9
  `)}};lw.Help=xp});var Tp=y(kp=>{var{InvalidArgumentError:aB}=Na(),Op=class{constructor(e,r){this.flags=e,this.description=r||"",this.required=e.includes("<"),this.optional=e.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(e),this.mandatory=!1;let n=cB(e);this.short=n.shortFlag,this.long=n.longFlag,this.negate=!1,this.long&&(this.negate=this.long.startsWith("--no-")),this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0}default(e,r){return this.defaultValue=e,this.defaultValueDescription=r,this}preset(e){return this.presetArg=e,this}conflicts(e){return this.conflictsWith=this.conflictsWith.concat(e),this}implies(e){let r=e;return typeof e=="string"&&(r={[e]:!0}),this.implied=Object.assign(this.implied||{},r),this}env(e){return this.envVar=e,this}argParser(e){return this.parseArg=e,this}makeOptionMandatory(e=!0){return this.mandatory=!!e,this}hideHelp(e=!0){return this.hidden=!!e,this}_concatValue(e,r){return r===this.defaultValue||!Array.isArray(r)?[e]:r.concat(e)}choices(e){return this.argChoices=e.slice(),this.parseArg=(r,n)=>{if(!this.argChoices.includes(r))throw new aB(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(r,n):r},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return uB(this.name().replace(/^no-/,""))}is(e){return this.short===e||this.long===e}isBoolean(){return!this.required&&!this.optional&&!this.negate}},Ap=class{constructor(e){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,e.forEach(r=>{r.negate?this.negativeOptions.set(r.attributeName(),r):this.positiveOptions.set(r.attributeName(),r)}),this.negativeOptions.forEach((r,n)=>{this.positiveOptions.has(n)&&this.dualOptions.add(n)})}valueFromOption(e,r){let n=r.attributeName();if(!this.dualOptions.has(n))return!0;let i=this.negativeOptions.get(n).presetArg,o=i!==void 0?i:!1;return r.negate===(o===e)}};function uB(t){return t.split("-").reduce((e,r)=>e+r[0].toUpperCase()+r.slice(1))}function cB(t){let e,r,n=t.split(/[ |,]+/);return n.length>1&&!/^[[<]/.test(n[1])&&(e=n.shift()),r=n.shift(),!e&&/^-[^-]$/.test(r)&&(e=r,r=void 0),{shortFlag:e,longFlag:r}}kp.Option=Op;kp.DualOptions=Ap});var dw=y(fw=>{function lB(t,e){if(Math.abs(t.length-e.length)>3)return Math.max(t.length,e.length);let r=[];for(let n=0;n<=t.length;n++)r[n]=[n];for(let n=0;n<=e.length;n++)r[0][n]=n;for(let n=1;n<=e.length;n++)for(let i=1;i<=t.length;i++){let o=1;t[i-1]===e[n-1]?o=0:o=1,r[i][n]=Math.min(r[i-1][n]+1,r[i][n-1]+1,r[i-1][n-1]+o),i>1&&n>1&&t[i-1]===e[n-2]&&t[i-2]===e[n-1]&&(r[i][n]=Math.min(r[i][n],r[i-2][n-2]+1))}return r[t.length][e.length]}function fB(t,e){if(!e||e.length===0)return"";e=Array.from(new Set(e));let r=t.startsWith("--");r&&(t=t.slice(2),e=e.map(s=>s.slice(2)));let n=[],i=3,o=.4;return e.forEach(s=>{if(s.length<=1)return;let a=lB(t,s),u=Math.max(t.length,s.length);(u-a)/u>o&&(a<i?(i=a,n=[s]):a===i&&n.push(s))}),n.sort((s,a)=>s.localeCompare(a)),r&&(n=n.map(s=>`--${s}`)),n.length>1?`
10
10
  (Did you mean one of ${n.join(", ")}?)`:n.length===1?`
11
- (Did you mean ${n[0]}?)`:""}fw.suggestSimilar=fB});var yw=y(gw=>{var dB=require("node:events").EventEmitter,Pp=require("node:child_process"),gn=require("node:path"),Rp=require("node:fs"),We=require("node:process"),{Argument:hB,humanReadableArgName:pB}=ol(),{CommanderError:$p}=Na(),{Help:mB}=Fp(),{Option:hw,DualOptions:gB}=Tp(),{suggestSimilar:pw}=dw(),Ip=class t extends dB{constructor(e){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!0,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=e||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._outputConfiguration={writeOut:r=>We.stdout.write(r),writeErr:r=>We.stderr.write(r),getOutHelpWidth:()=>We.stdout.isTTY?We.stdout.columns:void 0,getErrHelpWidth:()=>We.stderr.isTTY?We.stderr.columns:void 0,outputError:(r,n)=>n(r)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={}}copyInheritedSettings(e){return this._outputConfiguration=e._outputConfiguration,this._helpOption=e._helpOption,this._helpCommand=e._helpCommand,this._helpConfiguration=e._helpConfiguration,this._exitCallback=e._exitCallback,this._storeOptionsAsProperties=e._storeOptionsAsProperties,this._combineFlagAndOptionalValue=e._combineFlagAndOptionalValue,this._allowExcessArguments=e._allowExcessArguments,this._enablePositionalOptions=e._enablePositionalOptions,this._showHelpAfterError=e._showHelpAfterError,this._showSuggestionAfterError=e._showSuggestionAfterError,this}_getCommandAndAncestors(){let e=[];for(let r=this;r;r=r.parent)e.push(r);return e}command(e,r,n){let i=r,o=n;typeof i=="object"&&i!==null&&(o=i,i=null),o=o||{};let[,s,a]=e.match(/([^ ]+) *(.*)/),u=this.createCommand(s);return i&&(u.description(i),u._executableHandler=!0),o.isDefault&&(this._defaultCommandName=u._name),u._hidden=!!(o.noHelp||o.hidden),u._executableFile=o.executableFile||null,a&&u.arguments(a),this._registerCommand(u),u.parent=this,u.copyInheritedSettings(this),i?this:u}createCommand(e){return new t(e)}createHelp(){return Object.assign(new mB,this.configureHelp())}configureHelp(e){return e===void 0?this._helpConfiguration:(this._helpConfiguration=e,this)}configureOutput(e){return e===void 0?this._outputConfiguration:(Object.assign(this._outputConfiguration,e),this)}showHelpAfterError(e=!0){return typeof e!="string"&&(e=!!e),this._showHelpAfterError=e,this}showSuggestionAfterError(e=!0){return this._showSuggestionAfterError=!!e,this}addCommand(e,r){if(!e._name)throw new Error(`Command passed to .addCommand() must have a name
11
+ (Did you mean ${n[0]}?)`:""}fw.suggestSimilar=fB});var yw=y(gw=>{var dB=require("node:events").EventEmitter,Pp=require("node:child_process"),gn=require("node:path"),Rp=require("node:fs"),We=require("node:process"),{Argument:hB,humanReadableArgName:pB}=nl(),{CommanderError:$p}=Na(),{Help:mB}=Fp(),{Option:hw,DualOptions:gB}=Tp(),{suggestSimilar:pw}=dw(),Ip=class t extends dB{constructor(e){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!0,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=e||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._outputConfiguration={writeOut:r=>We.stdout.write(r),writeErr:r=>We.stderr.write(r),getOutHelpWidth:()=>We.stdout.isTTY?We.stdout.columns:void 0,getErrHelpWidth:()=>We.stderr.isTTY?We.stderr.columns:void 0,outputError:(r,n)=>n(r)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={}}copyInheritedSettings(e){return this._outputConfiguration=e._outputConfiguration,this._helpOption=e._helpOption,this._helpCommand=e._helpCommand,this._helpConfiguration=e._helpConfiguration,this._exitCallback=e._exitCallback,this._storeOptionsAsProperties=e._storeOptionsAsProperties,this._combineFlagAndOptionalValue=e._combineFlagAndOptionalValue,this._allowExcessArguments=e._allowExcessArguments,this._enablePositionalOptions=e._enablePositionalOptions,this._showHelpAfterError=e._showHelpAfterError,this._showSuggestionAfterError=e._showSuggestionAfterError,this}_getCommandAndAncestors(){let e=[];for(let r=this;r;r=r.parent)e.push(r);return e}command(e,r,n){let i=r,o=n;typeof i=="object"&&i!==null&&(o=i,i=null),o=o||{};let[,s,a]=e.match(/([^ ]+) *(.*)/),u=this.createCommand(s);return i&&(u.description(i),u._executableHandler=!0),o.isDefault&&(this._defaultCommandName=u._name),u._hidden=!!(o.noHelp||o.hidden),u._executableFile=o.executableFile||null,a&&u.arguments(a),this._registerCommand(u),u.parent=this,u.copyInheritedSettings(this),i?this:u}createCommand(e){return new t(e)}createHelp(){return Object.assign(new mB,this.configureHelp())}configureHelp(e){return e===void 0?this._helpConfiguration:(this._helpConfiguration=e,this)}configureOutput(e){return e===void 0?this._outputConfiguration:(Object.assign(this._outputConfiguration,e),this)}showHelpAfterError(e=!0){return typeof e!="string"&&(e=!!e),this._showHelpAfterError=e,this}showSuggestionAfterError(e=!0){return this._showSuggestionAfterError=!!e,this}addCommand(e,r){if(!e._name)throw new Error(`Command passed to .addCommand() must have a name
12
12
  - specify the name in Command constructor or using .name()`);return r=r||{},r.isDefault&&(this._defaultCommandName=e._name),(r.noHelp||r.hidden)&&(e._hidden=!0),this._registerCommand(e),e.parent=this,e._checkForBrokenPassThrough(),this}createArgument(e,r){return new hB(e,r)}argument(e,r,n,i){let o=this.createArgument(e,r);return typeof n=="function"?o.default(i).argParser(n):o.default(n),this.addArgument(o),this}arguments(e){return e.trim().split(/ +/).forEach(r=>{this.argument(r)}),this}addArgument(e){let r=this.registeredArguments.slice(-1)[0];if(r&&r.variadic)throw new Error(`only the last argument can be variadic '${r.name()}'`);if(e.required&&e.defaultValue!==void 0&&e.parseArg===void 0)throw new Error(`a default value for a required argument is never used: '${e.name()}'`);return this.registeredArguments.push(e),this}helpCommand(e,r){if(typeof e=="boolean")return this._addImplicitHelpCommand=e,this;e=e??"help [command]";let[,n,i]=e.match(/([^ ]+) *(.*)/),o=r??"display help for command",s=this.createCommand(n);return s.helpOption(!1),i&&s.arguments(i),o&&s.description(o),this._addImplicitHelpCommand=!0,this._helpCommand=s,this}addHelpCommand(e,r){return typeof e!="object"?(this.helpCommand(e,r),this):(this._addImplicitHelpCommand=!0,this._helpCommand=e,this)}_getHelpCommand(){return this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"))?(this._helpCommand===void 0&&this.helpCommand(void 0,void 0),this._helpCommand):null}hook(e,r){let n=["preSubcommand","preAction","postAction"];if(!n.includes(e))throw new Error(`Unexpected value for event passed to hook : '${e}'.
13
13
  Expecting one of '${n.join("', '")}'`);return this._lifeCycleHooks[e]?this._lifeCycleHooks[e].push(r):this._lifeCycleHooks[e]=[r],this}exitOverride(e){return e?this._exitCallback=e:this._exitCallback=r=>{if(r.code!=="commander.executeSubCommandAsync")throw r},this}_exit(e,r,n){this._exitCallback&&this._exitCallback(new $p(e,r,n)),We.exit(e)}action(e){let r=n=>{let i=this.registeredArguments.length,o=n.slice(0,i);return this._storeOptionsAsProperties?o[i]=this:o[i]=this.opts(),o.push(this),e.apply(this,o)};return this._actionHandler=r,this}createOption(e,r){return new hw(e,r)}_callParseArg(e,r,n,i){try{return e.parseArg(r,n)}catch(o){if(o.code==="commander.invalidArgument"){let s=`${i} ${o.message}`;this.error(s,{exitCode:o.exitCode,code:o.code})}throw o}}_registerOption(e){let r=e.short&&this._findOption(e.short)||e.long&&this._findOption(e.long);if(r){let n=e.long&&this._findOption(e.long)?e.long:e.short;throw new Error(`Cannot add option '${e.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${n}'
14
14
  - already used by option '${r.flags}'`)}this.options.push(e)}_registerCommand(e){let r=i=>[i.name()].concat(i.aliases()),n=r(e).find(i=>this._findCommand(i));if(n){let i=r(this._findCommand(n)).join("|"),o=r(e).join("|");throw new Error(`cannot add command '${o}' as already have command '${i}'`)}this.commands.push(e)}addOption(e){this._registerOption(e);let r=e.name(),n=e.attributeName();if(e.negate){let o=e.long.replace(/^--no-/,"--");this._findOption(o)||this.setOptionValueWithSource(n,e.defaultValue===void 0?!0:e.defaultValue,"default")}else e.defaultValue!==void 0&&this.setOptionValueWithSource(n,e.defaultValue,"default");let i=(o,s,a)=>{o==null&&e.presetArg!==void 0&&(o=e.presetArg);let u=this.getOptionValue(n);o!==null&&e.parseArg?o=this._callParseArg(e,o,u,s):o!==null&&e.variadic&&(o=e._concatValue(o,u)),o==null&&(e.negate?o=!1:e.isBoolean()||e.optional?o=!0:o=""),this.setOptionValueWithSource(n,o,a)};return this.on("option:"+r,o=>{let s=`error: option '${e.flags}' argument '${o}' is invalid.`;i(o,s,"cli")}),e.envVar&&this.on("optionEnv:"+r,o=>{let s=`error: option '${e.flags}' value '${o}' from env '${e.envVar}' is invalid.`;i(o,s,"env")}),this}_optionEx(e,r,n,i,o){if(typeof r=="object"&&r instanceof hw)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");let s=this.createOption(r,n);if(s.makeOptionMandatory(!!e.mandatory),typeof i=="function")s.default(o).argParser(i);else if(i instanceof RegExp){let a=i;i=(u,c)=>{let l=a.exec(u);return l?l[0]:c},s.default(o).argParser(i)}else s.default(i);return this.addOption(s)}option(e,r,n,i){return this._optionEx({},e,r,n,i)}requiredOption(e,r,n,i){return this._optionEx({mandatory:!0},e,r,n,i)}combineFlagAndOptionalValue(e=!0){return this._combineFlagAndOptionalValue=!!e,this}allowUnknownOption(e=!0){return this._allowUnknownOption=!!e,this}allowExcessArguments(e=!0){return this._allowExcessArguments=!!e,this}enablePositionalOptions(e=!0){return this._enablePositionalOptions=!!e,this}passThroughOptions(e=!0){return this._passThroughOptions=!!e,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw new Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties(e=!0){if(this.options.length)throw new Error("call .storeOptionsAsProperties() before adding options");if(Object.keys(this._optionValues).length)throw new Error("call .storeOptionsAsProperties() before setting option values");return this._storeOptionsAsProperties=!!e,this}getOptionValue(e){return this._storeOptionsAsProperties?this[e]:this._optionValues[e]}setOptionValue(e,r){return this.setOptionValueWithSource(e,r,void 0)}setOptionValueWithSource(e,r,n){return this._storeOptionsAsProperties?this[e]=r:this._optionValues[e]=r,this._optionValueSources[e]=n,this}getOptionValueSource(e){return this._optionValueSources[e]}getOptionValueSourceWithGlobals(e){let r;return this._getCommandAndAncestors().forEach(n=>{n.getOptionValueSource(e)!==void 0&&(r=n.getOptionValueSource(e))}),r}_prepareUserArgs(e,r){if(e!==void 0&&!Array.isArray(e))throw new Error("first parameter to parse must be array or undefined");if(r=r||{},e===void 0&&r.from===void 0){We.versions?.electron&&(r.from="electron");let i=We.execArgv??[];(i.includes("-e")||i.includes("--eval")||i.includes("-p")||i.includes("--print"))&&(r.from="eval")}e===void 0&&(e=We.argv),this.rawArgs=e.slice();let n;switch(r.from){case void 0:case"node":this._scriptPath=e[1],n=e.slice(2);break;case"electron":We.defaultApp?(this._scriptPath=e[1],n=e.slice(2)):n=e.slice(1);break;case"user":n=e.slice(0);break;case"eval":n=e.slice(1);break;default:throw new Error(`unexpected parse option { from: '${r.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||"program",n}parse(e,r){let n=this._prepareUserArgs(e,r);return this._parseCommand([],n),this}async parseAsync(e,r){let n=this._prepareUserArgs(e,r);return await this._parseCommand([],n),this}_executeSubCommand(e,r){r=r.slice();let n=!1,i=[".js",".ts",".tsx",".mjs",".cjs"];function o(l,f){let h=gn.resolve(l,f);if(Rp.existsSync(h))return h;if(i.includes(gn.extname(f)))return;let d=i.find(p=>Rp.existsSync(`${h}${p}`));if(d)return`${h}${d}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let s=e._executableFile||`${this._name}-${e._name}`,a=this._executableDir||"";if(this._scriptPath){let l;try{l=Rp.realpathSync(this._scriptPath)}catch{l=this._scriptPath}a=gn.resolve(gn.dirname(l),a)}if(a){let l=o(a,s);if(!l&&!e._executableFile&&this._scriptPath){let f=gn.basename(this._scriptPath,gn.extname(this._scriptPath));f!==this._name&&(l=o(a,`${f}-${e._name}`))}s=l||s}n=i.includes(gn.extname(s));let u;We.platform!=="win32"?n?(r.unshift(s),r=mw(We.execArgv).concat(r),u=Pp.spawn(We.argv[0],r,{stdio:"inherit"})):u=Pp.spawn(s,r,{stdio:"inherit"}):(r.unshift(s),r=mw(We.execArgv).concat(r),u=Pp.spawn(We.execPath,r,{stdio:"inherit"})),u.killed||["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(f=>{We.on(f,()=>{u.killed===!1&&u.exitCode===null&&u.kill(f)})});let c=this._exitCallback;u.on("close",l=>{l=l??1,c?c(new $p(l,"commander.executeSubCommandAsync","(close)")):We.exit(l)}),u.on("error",l=>{if(l.code==="ENOENT"){let f=a?`searched for local subcommand relative to directory '${a}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",h=`'${s}' does not exist
@@ -20,70 +20,70 @@ Expecting one of '${n.join("', '")}'`);return this._lifeCycleHooks[e]?this._life
20
20
  `),this.outputHelp({error:!0}));let n=r||{},i=n.exitCode||1,o=n.code||"commander.error";this._exit(i,o,e)}_parseOptionsEnv(){this.options.forEach(e=>{if(e.envVar&&e.envVar in We.env){let r=e.attributeName();(this.getOptionValue(r)===void 0||["default","config","env"].includes(this.getOptionValueSource(r)))&&(e.required||e.optional?this.emit(`optionEnv:${e.name()}`,We.env[e.envVar]):this.emit(`optionEnv:${e.name()}`))}})}_parseOptionsImplied(){let e=new gB(this.options),r=n=>this.getOptionValue(n)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(n));this.options.filter(n=>n.implied!==void 0&&r(n.attributeName())&&e.valueFromOption(this.getOptionValue(n.attributeName()),n)).forEach(n=>{Object.keys(n.implied).filter(i=>!r(i)).forEach(i=>{this.setOptionValueWithSource(i,n.implied[i],"implied")})})}missingArgument(e){let r=`error: missing required argument '${e}'`;this.error(r,{code:"commander.missingArgument"})}optionMissingArgument(e){let r=`error: option '${e.flags}' argument missing`;this.error(r,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(e){let r=`error: required option '${e.flags}' not specified`;this.error(r,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(e,r){let n=s=>{let a=s.attributeName(),u=this.getOptionValue(a),c=this.options.find(f=>f.negate&&a===f.attributeName()),l=this.options.find(f=>!f.negate&&a===f.attributeName());return c&&(c.presetArg===void 0&&u===!1||c.presetArg!==void 0&&u===c.presetArg)?c:l||s},i=s=>{let a=n(s),u=a.attributeName();return this.getOptionValueSource(u)==="env"?`environment variable '${a.envVar}'`:`option '${a.flags}'`},o=`error: ${i(e)} cannot be used with ${i(r)}`;this.error(o,{code:"commander.conflictingOption"})}unknownOption(e){if(this._allowUnknownOption)return;let r="";if(e.startsWith("--")&&this._showSuggestionAfterError){let i=[],o=this;do{let s=o.createHelp().visibleOptions(o).filter(a=>a.long).map(a=>a.long);i=i.concat(s),o=o.parent}while(o&&!o._enablePositionalOptions);r=pw(e,i)}let n=`error: unknown option '${e}'${r}`;this.error(n,{code:"commander.unknownOption"})}_excessArguments(e){if(this._allowExcessArguments)return;let r=this.registeredArguments.length,n=r===1?"":"s",o=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${r} argument${n} but got ${e.length}.`;this.error(o,{code:"commander.excessArguments"})}unknownCommand(){let e=this.args[0],r="";if(this._showSuggestionAfterError){let i=[];this.createHelp().visibleCommands(this).forEach(o=>{i.push(o.name()),o.alias()&&i.push(o.alias())}),r=pw(e,i)}let n=`error: unknown command '${e}'${r}`;this.error(n,{code:"commander.unknownCommand"})}version(e,r,n){if(e===void 0)return this._version;this._version=e,r=r||"-V, --version",n=n||"output the version number";let i=this.createOption(r,n);return this._versionOptionName=i.attributeName(),this._registerOption(i),this.on("option:"+i.name(),()=>{this._outputConfiguration.writeOut(`${e}
21
21
  `),this._exit(0,"commander.version",e)}),this}description(e,r){return e===void 0&&r===void 0?this._description:(this._description=e,r&&(this._argsDescription=r),this)}summary(e){return e===void 0?this._summary:(this._summary=e,this)}alias(e){if(e===void 0)return this._aliases[0];let r=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(r=this.commands[this.commands.length-1]),e===r._name)throw new Error("Command alias can't be the same as its name");let n=this.parent?._findCommand(e);if(n){let i=[n.name()].concat(n.aliases()).join("|");throw new Error(`cannot add alias '${e}' to command '${this.name()}' as already have command '${i}'`)}return r._aliases.push(e),this}aliases(e){return e===void 0?this._aliases:(e.forEach(r=>this.alias(r)),this)}usage(e){if(e===void 0){if(this._usage)return this._usage;let r=this.registeredArguments.map(n=>pB(n));return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?r:[]).join(" ")}return this._usage=e,this}name(e){return e===void 0?this._name:(this._name=e,this)}nameFromFilename(e){return this._name=gn.basename(e,gn.extname(e)),this}executableDir(e){return e===void 0?this._executableDir:(this._executableDir=e,this)}helpInformation(e){let r=this.createHelp();return r.helpWidth===void 0&&(r.helpWidth=e&&e.error?this._outputConfiguration.getErrHelpWidth():this._outputConfiguration.getOutHelpWidth()),r.formatHelp(this,r)}_getHelpContext(e){e=e||{};let r={error:!!e.error},n;return r.error?n=i=>this._outputConfiguration.writeErr(i):n=i=>this._outputConfiguration.writeOut(i),r.write=e.write||n,r.command=this,r}outputHelp(e){let r;typeof e=="function"&&(r=e,e=void 0);let n=this._getHelpContext(e);this._getCommandAndAncestors().reverse().forEach(o=>o.emit("beforeAllHelp",n)),this.emit("beforeHelp",n);let i=this.helpInformation(n);if(r&&(i=r(i),typeof i!="string"&&!Buffer.isBuffer(i)))throw new Error("outputHelp callback must return a string or a Buffer");n.write(i),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit("afterHelp",n),this._getCommandAndAncestors().forEach(o=>o.emit("afterAllHelp",n))}helpOption(e,r){return typeof e=="boolean"?(e?this._helpOption=this._helpOption??void 0:this._helpOption=null,this):(e=e??"-h, --help",r=r??"display help for command",this._helpOption=this.createOption(e,r),this)}_getHelpOption(){return this._helpOption===void 0&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(e){return this._helpOption=e,this}help(e){this.outputHelp(e);let r=We.exitCode||0;r===0&&e&&typeof e!="function"&&e.error&&(r=1),this._exit(r,"commander.help","(outputHelp)")}addHelpText(e,r){let n=["beforeAll","before","after","afterAll"];if(!n.includes(e))throw new Error(`Unexpected value for position to addHelpText.
22
22
  Expecting one of '${n.join("', '")}'`);let i=`${e}Help`;return this.on(i,o=>{let s;typeof r=="function"?s=r({error:o.error,command:o.command}):s=r,s&&o.write(`${s}
23
- `)}),this}_outputHelpIfRequested(e){let r=this._getHelpOption();r&&e.find(i=>r.is(i))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function mw(t){return t.map(e=>{if(!e.startsWith("--inspect"))return e;let r,n="127.0.0.1",i="9229",o;return(o=e.match(/^(--inspect(-brk)?)$/))!==null?r=o[1]:(o=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(r=o[1],/^\d+$/.test(o[3])?i=o[3]:n=o[3]):(o=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(r=o[1],n=o[3],i=o[4]),r&&i!=="0"?`${r}=${n}:${parseInt(i)+1}`:e})}gw.Command=Ip});var ww=y(dr=>{var{Argument:Dw}=ol(),{Command:jp}=yw(),{CommanderError:yB,InvalidArgumentError:vw}=Na(),{Help:DB}=Fp(),{Option:bw}=Tp();dr.program=new jp;dr.createCommand=t=>new jp(t);dr.createOption=(t,e)=>new bw(t,e);dr.createArgument=(t,e)=>new Dw(t,e);dr.Command=jp;dr.Option=bw;dr.Argument=Dw;dr.Help=DB;dr.CommanderError=yB;dr.InvalidArgumentError=vw;dr.InvalidOptionArgumentError=vw});var Te=y((xce,Ew)=>{"use strict";var Np="\x1B",qe=`${Np}[`,bB="\x07",Lp={to(t,e){return e?`${qe}${e+1};${t+1}H`:`${qe}${t+1}G`},move(t,e){let r="";return t<0?r+=`${qe}${-t}D`:t>0&&(r+=`${qe}${t}C`),e<0?r+=`${qe}${-e}A`:e>0&&(r+=`${qe}${e}B`),r},up:(t=1)=>`${qe}${t}A`,down:(t=1)=>`${qe}${t}B`,forward:(t=1)=>`${qe}${t}C`,backward:(t=1)=>`${qe}${t}D`,nextLine:(t=1)=>`${qe}E`.repeat(t),prevLine:(t=1)=>`${qe}F`.repeat(t),left:`${qe}G`,hide:`${qe}?25l`,show:`${qe}?25h`,save:`${Np}7`,restore:`${Np}8`},wB={up:(t=1)=>`${qe}S`.repeat(t),down:(t=1)=>`${qe}T`.repeat(t)},_B={screen:`${qe}2J`,up:(t=1)=>`${qe}1J`.repeat(t),down:(t=1)=>`${qe}J`.repeat(t),line:`${qe}2K`,lineEnd:`${qe}K`,lineStart:`${qe}1K`,lines(t){let e="";for(let r=0;r<t;r++)e+=this.line+(r<t-1?Lp.up():"");return t&&(e+=Lp.left),e}};Ew.exports={cursor:Lp,scroll:wB,erase:_B,beep:bB}});var qp=y((Fce,Bp)=>{var al=process||{},Cw=al.argv||[],sl=al.env||{},EB=!(sl.NO_COLOR||Cw.includes("--no-color"))&&(!!sl.FORCE_COLOR||Cw.includes("--color")||al.platform==="win32"||(al.stdout||{}).isTTY&&sl.TERM!=="dumb"||!!sl.CI),CB=(t,e,r=t)=>n=>{let i=""+n,o=i.indexOf(e,t.length);return~o?t+SB(i,e,r,o)+e:t+i+e},SB=(t,e,r,n)=>{let i="",o=0;do i+=t.substring(o,n)+r,o=n+e.length,n=t.indexOf(e,o);while(~n);return i+t.substring(o)},Sw=(t=EB)=>{let e=t?CB:()=>String;return{isColorSupported:t,reset:e("\x1B[0m","\x1B[0m"),bold:e("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:e("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:e("\x1B[3m","\x1B[23m"),underline:e("\x1B[4m","\x1B[24m"),inverse:e("\x1B[7m","\x1B[27m"),hidden:e("\x1B[8m","\x1B[28m"),strikethrough:e("\x1B[9m","\x1B[29m"),black:e("\x1B[30m","\x1B[39m"),red:e("\x1B[31m","\x1B[39m"),green:e("\x1B[32m","\x1B[39m"),yellow:e("\x1B[33m","\x1B[39m"),blue:e("\x1B[34m","\x1B[39m"),magenta:e("\x1B[35m","\x1B[39m"),cyan:e("\x1B[36m","\x1B[39m"),white:e("\x1B[37m","\x1B[39m"),gray:e("\x1B[90m","\x1B[39m"),bgBlack:e("\x1B[40m","\x1B[49m"),bgRed:e("\x1B[41m","\x1B[49m"),bgGreen:e("\x1B[42m","\x1B[49m"),bgYellow:e("\x1B[43m","\x1B[49m"),bgBlue:e("\x1B[44m","\x1B[49m"),bgMagenta:e("\x1B[45m","\x1B[49m"),bgCyan:e("\x1B[46m","\x1B[49m"),bgWhite:e("\x1B[47m","\x1B[49m"),blackBright:e("\x1B[90m","\x1B[39m"),redBright:e("\x1B[91m","\x1B[39m"),greenBright:e("\x1B[92m","\x1B[39m"),yellowBright:e("\x1B[93m","\x1B[39m"),blueBright:e("\x1B[94m","\x1B[39m"),magentaBright:e("\x1B[95m","\x1B[39m"),cyanBright:e("\x1B[96m","\x1B[39m"),whiteBright:e("\x1B[97m","\x1B[39m"),bgBlackBright:e("\x1B[100m","\x1B[49m"),bgRedBright:e("\x1B[101m","\x1B[49m"),bgGreenBright:e("\x1B[102m","\x1B[49m"),bgYellowBright:e("\x1B[103m","\x1B[49m"),bgBlueBright:e("\x1B[104m","\x1B[49m"),bgMagentaBright:e("\x1B[105m","\x1B[49m"),bgCyanBright:e("\x1B[106m","\x1B[49m"),bgWhiteBright:e("\x1B[107m","\x1B[49m")}};Bp.exports=Sw();Bp.exports.createColors=Sw});var pl=y(qt=>{"use strict";Object.defineProperty(qt,"__esModule",{value:!0});qt.isNXMonorepo=qt.isMonorepo=qt.findPackageRelativePathInMonorepo=qt.findPackagePath=qt.findNXMonorepoRoot=qt.findMonorepoRoot=void 0;var qa=require("node:fs"),Wn=require("node:path");function hl(t){let e=(0,Wn.join)(t,"package.json"),r=(0,Wn.join)(t,"pnpm-workspace.yaml");if((0,qa.existsSync)(r)||(0,qa.existsSync)(e)&&JSON.parse((0,qa.readFileSync)(e,"utf-8")).workspaces)return t;let n=(0,Wn.dirname)(t);if(n===t)throw new Error("Monorepo root not found");return hl(n)}qt.findMonorepoRoot=hl;function Qp(t){let e=(0,Wn.join)(t,"nx.json");if((0,qa.existsSync)(e))return t;let r=(0,Wn.dirname)(t);if(r===t)throw new Error("Monorepo root not found");return Qp(r)}qt.findNXMonorepoRoot=Qp;function em(t,e,r){let n=(0,Wn.join)(e,"node_modules",t);if((0,qa.existsSync)(n))return n;if(e===r)return null;let i=(0,Wn.dirname)(e);return em(t,i,r)}qt.findPackagePath=em;function iq(t,e){let r=hl(e),n=em(t,e,r);return n?(0,Wn.relative)(e,n):null}qt.findPackageRelativePathInMonorepo=iq;function oq(t){try{return hl(t),!0}catch{return!1}}qt.isMonorepo=oq;function sq(t){try{return Qp(t),!0}catch{return!1}}qt.isNXMonorepo=sq});var xi={};mn(xi,{default:()=>aq});var aq,Fi=ut(()=>{aq={}});var Gw=y(jr=>{"use strict";var uq=jr&&jr.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),cq=jr&&jr.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),lq=jr&&jr.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&uq(e,t,r);return cq(e,t),e};Object.defineProperty(jr,"__esModule",{value:!0});jr.resolveFetch=void 0;var fq=t=>{let e;return t?e=t:typeof fetch>"u"?e=(...r)=>Promise.resolve().then(()=>lq((Fi(),ke(xi)))).then(({default:n})=>n(...r)):e=fetch,(...r)=>e(...r)};jr.resolveFetch=fq});var im=y(nr=>{"use strict";Object.defineProperty(nr,"__esModule",{value:!0});nr.FunctionRegion=nr.FunctionsHttpError=nr.FunctionsRelayError=nr.FunctionsFetchError=nr.FunctionsError=void 0;var Uo=class extends Error{constructor(e,r="FunctionsError",n){super(e),this.name=r,this.context=n}};nr.FunctionsError=Uo;var tm=class extends Uo{constructor(e){super("Failed to send a request to the Edge Function","FunctionsFetchError",e)}};nr.FunctionsFetchError=tm;var rm=class extends Uo{constructor(e){super("Relay Error invoking the Edge Function","FunctionsRelayError",e)}};nr.FunctionsRelayError=rm;var nm=class extends Uo{constructor(e){super("Edge Function returned a non-2xx status code","FunctionsHttpError",e)}};nr.FunctionsHttpError=nm;var dq;(function(t){t.Any="any",t.ApNortheast1="ap-northeast-1",t.ApNortheast2="ap-northeast-2",t.ApSouth1="ap-south-1",t.ApSoutheast1="ap-southeast-1",t.ApSoutheast2="ap-southeast-2",t.CaCentral1="ca-central-1",t.EuCentral1="eu-central-1",t.EuWest1="eu-west-1",t.EuWest2="eu-west-2",t.EuWest3="eu-west-3",t.SaEast1="sa-east-1",t.UsEast1="us-east-1",t.UsWest1="us-west-1",t.UsWest2="us-west-2"})(dq=nr.FunctionRegion||(nr.FunctionRegion={}))});var Ww=y(Vo=>{"use strict";var hq=Vo&&Vo.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(l){try{c(n.next(l))}catch(f){s(f)}}function u(l){try{c(n.throw(l))}catch(f){s(f)}}function c(l){l.done?o(l.value):i(l.value).then(a,u)}c((n=n.apply(t,e||[])).next())})};Object.defineProperty(Vo,"__esModule",{value:!0});Vo.FunctionsClient=void 0;var pq=Gw(),gl=im(),om=class{constructor(e,{headers:r={},customFetch:n,region:i=gl.FunctionRegion.Any}={}){this.url=e,this.headers=r,this.region=i,this.fetch=(0,pq.resolveFetch)(n)}setAuth(e){this.headers.Authorization=`Bearer ${e}`}invoke(e,r={}){var n;return hq(this,void 0,void 0,function*(){try{let{headers:i,method:o,body:s}=r,a={},{region:u}=r;u||(u=this.region),u&&u!=="any"&&(a["x-region"]=u);let c;s&&(i&&!Object.prototype.hasOwnProperty.call(i,"Content-Type")||!i)&&(typeof Blob<"u"&&s instanceof Blob||s instanceof ArrayBuffer?(a["Content-Type"]="application/octet-stream",c=s):typeof s=="string"?(a["Content-Type"]="text/plain",c=s):typeof FormData<"u"&&s instanceof FormData?c=s:(a["Content-Type"]="application/json",c=JSON.stringify(s)));let l=yield this.fetch(`${this.url}/${e}`,{method:o||"POST",headers:Object.assign(Object.assign(Object.assign({},a),this.headers),i),body:c}).catch(p=>{throw new gl.FunctionsFetchError(p)}),f=l.headers.get("x-relay-error");if(f&&f==="true")throw new gl.FunctionsRelayError(l);if(!l.ok)throw new gl.FunctionsHttpError(l);let h=((n=l.headers.get("Content-Type"))!==null&&n!==void 0?n:"text/plain").split(";")[0].trim(),d;return h==="application/json"?d=yield l.json():h==="application/octet-stream"?d=yield l.blob():h==="text/event-stream"?d=l:h==="multipart/form-data"?d=yield l.formData():d=yield l.text(),{data:d,error:null}}catch(i){return{data:null,error:i}}})}};Vo.FunctionsClient=om});var sm=y(Mt=>{"use strict";Object.defineProperty(Mt,"__esModule",{value:!0});Mt.FunctionRegion=Mt.FunctionsRelayError=Mt.FunctionsHttpError=Mt.FunctionsFetchError=Mt.FunctionsError=Mt.FunctionsClient=void 0;var mq=Ww();Object.defineProperty(Mt,"FunctionsClient",{enumerable:!0,get:function(){return mq.FunctionsClient}});var Ua=im();Object.defineProperty(Mt,"FunctionsError",{enumerable:!0,get:function(){return Ua.FunctionsError}});Object.defineProperty(Mt,"FunctionsFetchError",{enumerable:!0,get:function(){return Ua.FunctionsFetchError}});Object.defineProperty(Mt,"FunctionsHttpError",{enumerable:!0,get:function(){return Ua.FunctionsHttpError}});Object.defineProperty(Mt,"FunctionsRelayError",{enumerable:!0,get:function(){return Ua.FunctionsRelayError}});Object.defineProperty(Mt,"FunctionRegion",{enumerable:!0,get:function(){return Ua.FunctionRegion}})});var cm=y(um=>{"use strict";Object.defineProperty(um,"__esModule",{value:!0});var am=class extends Error{constructor(e){super(e.message),this.name="PostgrestError",this.details=e.details,this.hint=e.hint,this.code=e.code}};um.default=am});var fm=y(Va=>{"use strict";var Kw=Va&&Va.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Va,"__esModule",{value:!0});var gq=Kw((Fi(),ke(xi))),yq=Kw(cm()),lm=class{constructor(e){this.shouldThrowOnError=!1,this.method=e.method,this.url=e.url,this.headers=e.headers,this.schema=e.schema,this.body=e.body,this.shouldThrowOnError=e.shouldThrowOnError,this.signal=e.signal,this.isMaybeSingle=e.isMaybeSingle,e.fetch?this.fetch=e.fetch:typeof fetch>"u"?this.fetch=gq.default:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(e,r){return this.headers=Object.assign({},this.headers),this.headers[e]=r,this}then(e,r){this.schema===void 0||(["GET","HEAD"].includes(this.method)?this.headers["Accept-Profile"]=this.schema:this.headers["Content-Profile"]=this.schema),this.method!=="GET"&&this.method!=="HEAD"&&(this.headers["Content-Type"]="application/json");let n=this.fetch,i=n(this.url.toString(),{method:this.method,headers:this.headers,body:JSON.stringify(this.body),signal:this.signal}).then(async o=>{var s,a,u;let c=null,l=null,f=null,h=o.status,d=o.statusText;if(o.ok){if(this.method!=="HEAD"){let w=await o.text();w===""||(this.headers.Accept==="text/csv"||this.headers.Accept&&this.headers.Accept.includes("application/vnd.pgrst.plan+text")?l=w:l=JSON.parse(w))}let v=(s=this.headers.Prefer)===null||s===void 0?void 0:s.match(/count=(exact|planned|estimated)/),g=(a=o.headers.get("content-range"))===null||a===void 0?void 0:a.split("/");v&&g&&g.length>1&&(f=parseInt(g[1])),this.isMaybeSingle&&this.method==="GET"&&Array.isArray(l)&&(l.length>1?(c={code:"PGRST116",details:`Results contain ${l.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},l=null,f=null,h=406,d="Not Acceptable"):l.length===1?l=l[0]:l=null)}else{let v=await o.text();try{c=JSON.parse(v),Array.isArray(c)&&o.status===404&&(l=[],c=null,h=200,d="OK")}catch{o.status===404&&v===""?(h=204,d="No Content"):c={message:v}}if(c&&this.isMaybeSingle&&(!((u=c?.details)===null||u===void 0)&&u.includes("0 rows"))&&(c=null,h=200,d="OK"),c&&this.shouldThrowOnError)throw new yq.default(c)}return{error:c,data:l,count:f,status:h,statusText:d}});return this.shouldThrowOnError||(i=i.catch(o=>{var s,a,u;return{error:{message:`${(s=o?.name)!==null&&s!==void 0?s:"FetchError"}: ${o?.message}`,details:`${(a=o?.stack)!==null&&a!==void 0?a:""}`,hint:"",code:`${(u=o?.code)!==null&&u!==void 0?u:""}`},data:null,count:null,status:0,statusText:""}})),i.then(e,r)}};Va.default=lm});var hm=y(Ha=>{"use strict";var Dq=Ha&&Ha.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ha,"__esModule",{value:!0});var vq=Dq(fm()),dm=class extends vq.default{select(e){let r=!1,n=(e??"*").split("").map(i=>/\s/.test(i)&&!r?"":(i==='"'&&(r=!r),i)).join("");return this.url.searchParams.set("select",n),this.headers.Prefer&&(this.headers.Prefer+=","),this.headers.Prefer+="return=representation",this}order(e,{ascending:r=!0,nullsFirst:n,foreignTable:i,referencedTable:o=i}={}){let s=o?`${o}.order`:"order",a=this.url.searchParams.get(s);return this.url.searchParams.set(s,`${a?`${a},`:""}${e}.${r?"asc":"desc"}${n===void 0?"":n?".nullsfirst":".nullslast"}`),this}limit(e,{foreignTable:r,referencedTable:n=r}={}){let i=typeof n>"u"?"limit":`${n}.limit`;return this.url.searchParams.set(i,`${e}`),this}range(e,r,{foreignTable:n,referencedTable:i=n}={}){let o=typeof i>"u"?"offset":`${i}.offset`,s=typeof i>"u"?"limit":`${i}.limit`;return this.url.searchParams.set(o,`${e}`),this.url.searchParams.set(s,`${r-e+1}`),this}abortSignal(e){return this.signal=e,this}single(){return this.headers.Accept="application/vnd.pgrst.object+json",this}maybeSingle(){return this.method==="GET"?this.headers.Accept="application/json":this.headers.Accept="application/vnd.pgrst.object+json",this.isMaybeSingle=!0,this}csv(){return this.headers.Accept="text/csv",this}geojson(){return this.headers.Accept="application/geo+json",this}explain({analyze:e=!1,verbose:r=!1,settings:n=!1,buffers:i=!1,wal:o=!1,format:s="text"}={}){var a;let u=[e?"analyze":null,r?"verbose":null,n?"settings":null,i?"buffers":null,o?"wal":null].filter(Boolean).join("|"),c=(a=this.headers.Accept)!==null&&a!==void 0?a:"application/json";return this.headers.Accept=`application/vnd.pgrst.plan+${s}; for="${c}"; options=${u};`,s==="json"?this:this}rollback(){var e;return((e=this.headers.Prefer)!==null&&e!==void 0?e:"").trim().length>0?this.headers.Prefer+=",tx=rollback":this.headers.Prefer="tx=rollback",this}returns(){return this}};Ha.default=dm});var yl=y(za=>{"use strict";var bq=za&&za.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(za,"__esModule",{value:!0});var wq=bq(hm()),pm=class extends wq.default{eq(e,r){return this.url.searchParams.append(e,`eq.${r}`),this}neq(e,r){return this.url.searchParams.append(e,`neq.${r}`),this}gt(e,r){return this.url.searchParams.append(e,`gt.${r}`),this}gte(e,r){return this.url.searchParams.append(e,`gte.${r}`),this}lt(e,r){return this.url.searchParams.append(e,`lt.${r}`),this}lte(e,r){return this.url.searchParams.append(e,`lte.${r}`),this}like(e,r){return this.url.searchParams.append(e,`like.${r}`),this}likeAllOf(e,r){return this.url.searchParams.append(e,`like(all).{${r.join(",")}}`),this}likeAnyOf(e,r){return this.url.searchParams.append(e,`like(any).{${r.join(",")}}`),this}ilike(e,r){return this.url.searchParams.append(e,`ilike.${r}`),this}ilikeAllOf(e,r){return this.url.searchParams.append(e,`ilike(all).{${r.join(",")}}`),this}ilikeAnyOf(e,r){return this.url.searchParams.append(e,`ilike(any).{${r.join(",")}}`),this}is(e,r){return this.url.searchParams.append(e,`is.${r}`),this}in(e,r){let n=Array.from(new Set(r)).map(i=>typeof i=="string"&&new RegExp("[,()]").test(i)?`"${i}"`:`${i}`).join(",");return this.url.searchParams.append(e,`in.(${n})`),this}contains(e,r){return typeof r=="string"?this.url.searchParams.append(e,`cs.${r}`):Array.isArray(r)?this.url.searchParams.append(e,`cs.{${r.join(",")}}`):this.url.searchParams.append(e,`cs.${JSON.stringify(r)}`),this}containedBy(e,r){return typeof r=="string"?this.url.searchParams.append(e,`cd.${r}`):Array.isArray(r)?this.url.searchParams.append(e,`cd.{${r.join(",")}}`):this.url.searchParams.append(e,`cd.${JSON.stringify(r)}`),this}rangeGt(e,r){return this.url.searchParams.append(e,`sr.${r}`),this}rangeGte(e,r){return this.url.searchParams.append(e,`nxl.${r}`),this}rangeLt(e,r){return this.url.searchParams.append(e,`sl.${r}`),this}rangeLte(e,r){return this.url.searchParams.append(e,`nxr.${r}`),this}rangeAdjacent(e,r){return this.url.searchParams.append(e,`adj.${r}`),this}overlaps(e,r){return typeof r=="string"?this.url.searchParams.append(e,`ov.${r}`):this.url.searchParams.append(e,`ov.{${r.join(",")}}`),this}textSearch(e,r,{config:n,type:i}={}){let o="";i==="plain"?o="pl":i==="phrase"?o="ph":i==="websearch"&&(o="w");let s=n===void 0?"":`(${n})`;return this.url.searchParams.append(e,`${o}fts${s}.${r}`),this}match(e){return Object.entries(e).forEach(([r,n])=>{this.url.searchParams.append(r,`eq.${n}`)}),this}not(e,r,n){return this.url.searchParams.append(e,`not.${r}.${n}`),this}or(e,{foreignTable:r,referencedTable:n=r}={}){let i=n?`${n}.or`:"or";return this.url.searchParams.append(i,`(${e})`),this}filter(e,r,n){return this.url.searchParams.append(e,`${r}.${n}`),this}};za.default=pm});var gm=y(Wa=>{"use strict";var _q=Wa&&Wa.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Wa,"__esModule",{value:!0});var Ga=_q(yl()),mm=class{constructor(e,{headers:r={},schema:n,fetch:i}){this.url=e,this.headers=r,this.schema=n,this.fetch=i}select(e,{head:r=!1,count:n}={}){let i=r?"HEAD":"GET",o=!1,s=(e??"*").split("").map(a=>/\s/.test(a)&&!o?"":(a==='"'&&(o=!o),a)).join("");return this.url.searchParams.set("select",s),n&&(this.headers.Prefer=`count=${n}`),new Ga.default({method:i,url:this.url,headers:this.headers,schema:this.schema,fetch:this.fetch,allowEmpty:!1})}insert(e,{count:r,defaultToNull:n=!0}={}){let i="POST",o=[];if(this.headers.Prefer&&o.push(this.headers.Prefer),r&&o.push(`count=${r}`),n||o.push("missing=default"),this.headers.Prefer=o.join(","),Array.isArray(e)){let s=e.reduce((a,u)=>a.concat(Object.keys(u)),[]);if(s.length>0){let a=[...new Set(s)].map(u=>`"${u}"`);this.url.searchParams.set("columns",a.join(","))}}return new Ga.default({method:i,url:this.url,headers:this.headers,schema:this.schema,body:e,fetch:this.fetch,allowEmpty:!1})}upsert(e,{onConflict:r,ignoreDuplicates:n=!1,count:i,defaultToNull:o=!0}={}){let s="POST",a=[`resolution=${n?"ignore":"merge"}-duplicates`];if(r!==void 0&&this.url.searchParams.set("on_conflict",r),this.headers.Prefer&&a.push(this.headers.Prefer),i&&a.push(`count=${i}`),o||a.push("missing=default"),this.headers.Prefer=a.join(","),Array.isArray(e)){let u=e.reduce((c,l)=>c.concat(Object.keys(l)),[]);if(u.length>0){let c=[...new Set(u)].map(l=>`"${l}"`);this.url.searchParams.set("columns",c.join(","))}}return new Ga.default({method:s,url:this.url,headers:this.headers,schema:this.schema,body:e,fetch:this.fetch,allowEmpty:!1})}update(e,{count:r}={}){let n="PATCH",i=[];return this.headers.Prefer&&i.push(this.headers.Prefer),r&&i.push(`count=${r}`),this.headers.Prefer=i.join(","),new Ga.default({method:n,url:this.url,headers:this.headers,schema:this.schema,body:e,fetch:this.fetch,allowEmpty:!1})}delete({count:e}={}){let r="DELETE",n=[];return e&&n.push(`count=${e}`),this.headers.Prefer&&n.unshift(this.headers.Prefer),this.headers.Prefer=n.join(","),new Ga.default({method:r,url:this.url,headers:this.headers,schema:this.schema,fetch:this.fetch,allowEmpty:!1})}};Wa.default=mm});var Yw=y(Dl=>{"use strict";Object.defineProperty(Dl,"__esModule",{value:!0});Dl.version=void 0;Dl.version="0.0.0-automated"});var Jw=y(vl=>{"use strict";Object.defineProperty(vl,"__esModule",{value:!0});vl.DEFAULT_HEADERS=void 0;var Eq=Yw();vl.DEFAULT_HEADERS={"X-Client-Info":`postgrest-js/${Eq.version}`}});var Zw=y(Ka=>{"use strict";var Xw=Ka&&Ka.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ka,"__esModule",{value:!0});var Cq=Xw(gm()),Sq=Xw(yl()),xq=Jw(),ym=class t{constructor(e,{headers:r={},schema:n,fetch:i}={}){this.url=e,this.headers=Object.assign(Object.assign({},xq.DEFAULT_HEADERS),r),this.schemaName=n,this.fetch=i}from(e){let r=new URL(`${this.url}/${e}`);return new Cq.default(r,{headers:Object.assign({},this.headers),schema:this.schemaName,fetch:this.fetch})}schema(e){return new t(this.url,{headers:this.headers,schema:e,fetch:this.fetch})}rpc(e,r={},{head:n=!1,get:i=!1,count:o}={}){let s,a=new URL(`${this.url}/rpc/${e}`),u;n||i?(s=n?"HEAD":"GET",Object.entries(r).filter(([l,f])=>f!==void 0).map(([l,f])=>[l,Array.isArray(f)?`{${f.join(",")}}`:`${f}`]).forEach(([l,f])=>{a.searchParams.append(l,f)})):(s="POST",u=r);let c=Object.assign({},this.headers);return o&&(c.Prefer=`count=${o}`),new Sq.default({method:s,url:a,headers:c,schema:this.schemaName,body:u,fetch:this.fetch,allowEmpty:!1})}};Ka.default=ym});var o_=y(Dt=>{"use strict";var Ho=Dt&&Dt.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Dt,"__esModule",{value:!0});Dt.PostgrestError=Dt.PostgrestBuilder=Dt.PostgrestTransformBuilder=Dt.PostgrestFilterBuilder=Dt.PostgrestQueryBuilder=Dt.PostgrestClient=void 0;var Qw=Ho(Zw());Dt.PostgrestClient=Qw.default;var e_=Ho(gm());Dt.PostgrestQueryBuilder=e_.default;var t_=Ho(yl());Dt.PostgrestFilterBuilder=t_.default;var r_=Ho(hm());Dt.PostgrestTransformBuilder=r_.default;var n_=Ho(fm());Dt.PostgrestBuilder=n_.default;var i_=Ho(cm());Dt.PostgrestError=i_.default;Dt.default={PostgrestClient:Qw.default,PostgrestQueryBuilder:e_.default,PostgrestFilterBuilder:t_.default,PostgrestTransformBuilder:r_.default,PostgrestBuilder:n_.default,PostgrestError:i_.default}});var vm={};mn(vm,{RealtimeClient:()=>Dm});var Dm,bm=ut(()=>{Dm=class{constructor(){}connect(){}disconnect(){}}});var Ja=y(Nr=>{"use strict";Object.defineProperty(Nr,"__esModule",{value:!0});Nr.StorageUnknownError=Nr.StorageApiError=Nr.isStorageError=Nr.StorageError=void 0;var Ya=class extends Error{constructor(e){super(e),this.__isStorageError=!0,this.name="StorageError"}};Nr.StorageError=Ya;function Fq(t){return typeof t=="object"&&t!==null&&"__isStorageError"in t}Nr.isStorageError=Fq;var wm=class extends Ya{constructor(e,r){super(e),this.name="StorageApiError",this.status=r}toJSON(){return{name:this.name,message:this.message,status:this.status}}};Nr.StorageApiError=wm;var _m=class extends Ya{constructor(e,r){super(e),this.name="StorageUnknownError",this.originalError=r}};Nr.StorageUnknownError=_m});var bl=y(ct=>{"use strict";var Oq=ct&&ct.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),Aq=ct&&ct.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),s_=ct&&ct.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&Oq(e,t,r);return Aq(e,t),e},kq=ct&&ct.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(l){try{c(n.next(l))}catch(f){s(f)}}function u(l){try{c(n.throw(l))}catch(f){s(f)}}function c(l){l.done?o(l.value):i(l.value).then(a,u)}c((n=n.apply(t,e||[])).next())})};Object.defineProperty(ct,"__esModule",{value:!0});ct.recursiveToCamel=ct.resolveResponse=ct.resolveFetch=void 0;var Tq=t=>{let e;return t?e=t:typeof fetch>"u"?e=(...r)=>Promise.resolve().then(()=>s_((Fi(),ke(xi)))).then(({default:n})=>n(...r)):e=fetch,(...r)=>e(...r)};ct.resolveFetch=Tq;var Pq=()=>kq(void 0,void 0,void 0,function*(){return typeof Response>"u"?(yield Promise.resolve().then(()=>s_((Fi(),ke(xi))))).Response:Response});ct.resolveResponse=Pq;var Rq=t=>{if(Array.isArray(t))return t.map(r=>(0,ct.recursiveToCamel)(r));if(typeof t=="function"||t!==Object(t))return t;let e={};return Object.entries(t).forEach(([r,n])=>{let i=r.replace(/([-_][a-z])/gi,o=>o.toUpperCase().replace(/[-_]/g,""));e[i]=(0,ct.recursiveToCamel)(n)}),e};ct.recursiveToCamel=Rq});var Sm=y(Ut=>{"use strict";var Oi=Ut&&Ut.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(l){try{c(n.next(l))}catch(f){s(f)}}function u(l){try{c(n.throw(l))}catch(f){s(f)}}function c(l){l.done?o(l.value):i(l.value).then(a,u)}c((n=n.apply(t,e||[])).next())})};Object.defineProperty(Ut,"__esModule",{value:!0});Ut.remove=Ut.head=Ut.put=Ut.post=Ut.get=void 0;var Em=Ja(),$q=bl(),Cm=t=>t.msg||t.message||t.error_description||t.error||JSON.stringify(t),Iq=(t,e,r)=>Oi(void 0,void 0,void 0,function*(){let n=yield(0,$q.resolveResponse)();t instanceof n&&!r?.noResolveJson?t.json().then(i=>{e(new Em.StorageApiError(Cm(i),t.status||500))}).catch(i=>{e(new Em.StorageUnknownError(Cm(i),i))}):e(new Em.StorageUnknownError(Cm(t),t))}),jq=(t,e,r,n)=>{let i={method:t,headers:e?.headers||{}};return t==="GET"?i:(i.headers=Object.assign({"Content-Type":"application/json"},e?.headers),n&&(i.body=JSON.stringify(n)),Object.assign(Object.assign({},i),r))};function Xa(t,e,r,n,i,o){return Oi(this,void 0,void 0,function*(){return new Promise((s,a)=>{t(r,jq(e,n,i,o)).then(u=>{if(!u.ok)throw u;return n?.noResolveJson?u:u.json()}).then(u=>s(u)).catch(u=>Iq(u,a,n))})})}function Nq(t,e,r,n){return Oi(this,void 0,void 0,function*(){return Xa(t,"GET",e,r,n)})}Ut.get=Nq;function Lq(t,e,r,n,i){return Oi(this,void 0,void 0,function*(){return Xa(t,"POST",e,n,i,r)})}Ut.post=Lq;function Bq(t,e,r,n,i){return Oi(this,void 0,void 0,function*(){return Xa(t,"PUT",e,n,i,r)})}Ut.put=Bq;function qq(t,e,r,n){return Oi(this,void 0,void 0,function*(){return Xa(t,"HEAD",e,Object.assign(Object.assign({},r),{noResolveJson:!0}),n)})}Ut.head=qq;function Mq(t,e,r,n,i){return Oi(this,void 0,void 0,function*(){return Xa(t,"DELETE",e,n,i,r)})}Ut.remove=Mq});var c_=y(Za=>{"use strict";var Vt=Za&&Za.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(l){try{c(n.next(l))}catch(f){s(f)}}function u(l){try{c(n.throw(l))}catch(f){s(f)}}function c(l){l.done?o(l.value):i(l.value).then(a,u)}c((n=n.apply(t,e||[])).next())})};Object.defineProperty(Za,"__esModule",{value:!0});var Ht=Ja(),Lr=Sm(),a_=bl(),Uq={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},u_={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1},xm=class{constructor(e,r={},n,i){this.url=e,this.headers=r,this.bucketId=n,this.fetch=(0,a_.resolveFetch)(i)}uploadOrUpdate(e,r,n,i){return Vt(this,void 0,void 0,function*(){try{let o,s=Object.assign(Object.assign({},u_),i),a=Object.assign(Object.assign({},this.headers),e==="POST"&&{"x-upsert":String(s.upsert)}),u=s.metadata;typeof Blob<"u"&&n instanceof Blob?(o=new FormData,o.append("cacheControl",s.cacheControl),u&&o.append("metadata",this.encodeMetadata(u)),o.append("",n)):typeof FormData<"u"&&n instanceof FormData?(o=n,o.append("cacheControl",s.cacheControl),u&&o.append("metadata",this.encodeMetadata(u))):(o=n,a["cache-control"]=`max-age=${s.cacheControl}`,a["content-type"]=s.contentType,u&&(a["x-metadata"]=this.toBase64(this.encodeMetadata(u)))),i?.headers&&(a=Object.assign(Object.assign({},a),i.headers));let c=this._removeEmptyFolders(r),l=this._getFinalPath(c),f=yield this.fetch(`${this.url}/object/${l}`,Object.assign({method:e,body:o,headers:a},s?.duplex?{duplex:s.duplex}:{})),h=yield f.json();return f.ok?{data:{path:c,id:h.Id,fullPath:h.Key},error:null}:{data:null,error:h}}catch(o){if((0,Ht.isStorageError)(o))return{data:null,error:o};throw o}})}upload(e,r,n){return Vt(this,void 0,void 0,function*(){return this.uploadOrUpdate("POST",e,r,n)})}uploadToSignedUrl(e,r,n,i){return Vt(this,void 0,void 0,function*(){let o=this._removeEmptyFolders(e),s=this._getFinalPath(o),a=new URL(this.url+`/object/upload/sign/${s}`);a.searchParams.set("token",r);try{let u,c=Object.assign({upsert:u_.upsert},i),l=Object.assign(Object.assign({},this.headers),{"x-upsert":String(c.upsert)});typeof Blob<"u"&&n instanceof Blob?(u=new FormData,u.append("cacheControl",c.cacheControl),u.append("",n)):typeof FormData<"u"&&n instanceof FormData?(u=n,u.append("cacheControl",c.cacheControl)):(u=n,l["cache-control"]=`max-age=${c.cacheControl}`,l["content-type"]=c.contentType);let f=yield this.fetch(a.toString(),{method:"PUT",body:u,headers:l}),h=yield f.json();return f.ok?{data:{path:o,fullPath:h.Key},error:null}:{data:null,error:h}}catch(u){if((0,Ht.isStorageError)(u))return{data:null,error:u};throw u}})}createSignedUploadUrl(e,r){return Vt(this,void 0,void 0,function*(){try{let n=this._getFinalPath(e),i=Object.assign({},this.headers);r?.upsert&&(i["x-upsert"]="true");let o=yield(0,Lr.post)(this.fetch,`${this.url}/object/upload/sign/${n}`,{},{headers:i}),s=new URL(this.url+o.url),a=s.searchParams.get("token");if(!a)throw new Ht.StorageError("No token returned by API");return{data:{signedUrl:s.toString(),path:e,token:a},error:null}}catch(n){if((0,Ht.isStorageError)(n))return{data:null,error:n};throw n}})}update(e,r,n){return Vt(this,void 0,void 0,function*(){return this.uploadOrUpdate("PUT",e,r,n)})}move(e,r,n){return Vt(this,void 0,void 0,function*(){try{return{data:yield(0,Lr.post)(this.fetch,`${this.url}/object/move`,{bucketId:this.bucketId,sourceKey:e,destinationKey:r,destinationBucket:n?.destinationBucket},{headers:this.headers}),error:null}}catch(i){if((0,Ht.isStorageError)(i))return{data:null,error:i};throw i}})}copy(e,r,n){return Vt(this,void 0,void 0,function*(){try{return{data:{path:(yield(0,Lr.post)(this.fetch,`${this.url}/object/copy`,{bucketId:this.bucketId,sourceKey:e,destinationKey:r,destinationBucket:n?.destinationBucket},{headers:this.headers})).Key},error:null}}catch(i){if((0,Ht.isStorageError)(i))return{data:null,error:i};throw i}})}createSignedUrl(e,r,n){return Vt(this,void 0,void 0,function*(){try{let i=this._getFinalPath(e),o=yield(0,Lr.post)(this.fetch,`${this.url}/object/sign/${i}`,Object.assign({expiresIn:r},n?.transform?{transform:n.transform}:{}),{headers:this.headers}),s=n?.download?`&download=${n.download===!0?"":n.download}`:"";return o={signedUrl:encodeURI(`${this.url}${o.signedURL}${s}`)},{data:o,error:null}}catch(i){if((0,Ht.isStorageError)(i))return{data:null,error:i};throw i}})}createSignedUrls(e,r,n){return Vt(this,void 0,void 0,function*(){try{let i=yield(0,Lr.post)(this.fetch,`${this.url}/object/sign/${this.bucketId}`,{expiresIn:r,paths:e},{headers:this.headers}),o=n?.download?`&download=${n.download===!0?"":n.download}`:"";return{data:i.map(s=>Object.assign(Object.assign({},s),{signedUrl:s.signedURL?encodeURI(`${this.url}${s.signedURL}${o}`):null})),error:null}}catch(i){if((0,Ht.isStorageError)(i))return{data:null,error:i};throw i}})}download(e,r){return Vt(this,void 0,void 0,function*(){let i=typeof r?.transform<"u"?"render/image/authenticated":"object",o=this.transformOptsToQueryString(r?.transform||{}),s=o?`?${o}`:"";try{let a=this._getFinalPath(e);return{data:yield(yield(0,Lr.get)(this.fetch,`${this.url}/${i}/${a}${s}`,{headers:this.headers,noResolveJson:!0})).blob(),error:null}}catch(a){if((0,Ht.isStorageError)(a))return{data:null,error:a};throw a}})}info(e){return Vt(this,void 0,void 0,function*(){let r=this._getFinalPath(e);try{let n=yield(0,Lr.get)(this.fetch,`${this.url}/object/info/${r}`,{headers:this.headers});return{data:(0,a_.recursiveToCamel)(n),error:null}}catch(n){if((0,Ht.isStorageError)(n))return{data:null,error:n};throw n}})}exists(e){return Vt(this,void 0,void 0,function*(){let r=this._getFinalPath(e);try{return yield(0,Lr.head)(this.fetch,`${this.url}/object/${r}`,{headers:this.headers}),{data:!0,error:null}}catch(n){if((0,Ht.isStorageError)(n)&&n instanceof Ht.StorageUnknownError){let i=n.originalError;if([400,404].includes(i?.status))return{data:!1,error:n}}throw n}})}getPublicUrl(e,r){let n=this._getFinalPath(e),i=[],o=r?.download?`download=${r.download===!0?"":r.download}`:"";o!==""&&i.push(o);let a=typeof r?.transform<"u"?"render/image":"object",u=this.transformOptsToQueryString(r?.transform||{});u!==""&&i.push(u);let c=i.join("&");return c!==""&&(c=`?${c}`),{data:{publicUrl:encodeURI(`${this.url}/${a}/public/${n}${c}`)}}}remove(e){return Vt(this,void 0,void 0,function*(){try{return{data:yield(0,Lr.remove)(this.fetch,`${this.url}/object/${this.bucketId}`,{prefixes:e},{headers:this.headers}),error:null}}catch(r){if((0,Ht.isStorageError)(r))return{data:null,error:r};throw r}})}list(e,r,n){return Vt(this,void 0,void 0,function*(){try{let i=Object.assign(Object.assign(Object.assign({},Uq),r),{prefix:e||""});return{data:yield(0,Lr.post)(this.fetch,`${this.url}/object/list/${this.bucketId}`,i,{headers:this.headers},n),error:null}}catch(i){if((0,Ht.isStorageError)(i))return{data:null,error:i};throw i}})}encodeMetadata(e){return JSON.stringify(e)}toBase64(e){return typeof Buffer<"u"?Buffer.from(e).toString("base64"):btoa(e)}_getFinalPath(e){return`${this.bucketId}/${e}`}_removeEmptyFolders(e){return e.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")}transformOptsToQueryString(e){let r=[];return e.width&&r.push(`width=${e.width}`),e.height&&r.push(`height=${e.height}`),e.resize&&r.push(`resize=${e.resize}`),e.format&&r.push(`format=${e.format}`),e.quality&&r.push(`quality=${e.quality}`),r.join("&")}};Za.default=xm});var l_=y(wl=>{"use strict";Object.defineProperty(wl,"__esModule",{value:!0});wl.version=void 0;wl.version="2.7.1"});var f_=y(_l=>{"use strict";Object.defineProperty(_l,"__esModule",{value:!0});_l.DEFAULT_HEADERS=void 0;var Vq=l_();_l.DEFAULT_HEADERS={"X-Client-Info":`storage-js/${Vq.version}`}});var d_=y(Qa=>{"use strict";var zo=Qa&&Qa.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(l){try{c(n.next(l))}catch(f){s(f)}}function u(l){try{c(n.throw(l))}catch(f){s(f)}}function c(l){l.done?o(l.value):i(l.value).then(a,u)}c((n=n.apply(t,e||[])).next())})};Object.defineProperty(Qa,"__esModule",{value:!0});var Hq=f_(),Go=Ja(),Wo=Sm(),zq=bl(),Fm=class{constructor(e,r={},n){this.url=e,this.headers=Object.assign(Object.assign({},Hq.DEFAULT_HEADERS),r),this.fetch=(0,zq.resolveFetch)(n)}listBuckets(){return zo(this,void 0,void 0,function*(){try{return{data:yield(0,Wo.get)(this.fetch,`${this.url}/bucket`,{headers:this.headers}),error:null}}catch(e){if((0,Go.isStorageError)(e))return{data:null,error:e};throw e}})}getBucket(e){return zo(this,void 0,void 0,function*(){try{return{data:yield(0,Wo.get)(this.fetch,`${this.url}/bucket/${e}`,{headers:this.headers}),error:null}}catch(r){if((0,Go.isStorageError)(r))return{data:null,error:r};throw r}})}createBucket(e,r={public:!1}){return zo(this,void 0,void 0,function*(){try{return{data:yield(0,Wo.post)(this.fetch,`${this.url}/bucket`,{id:e,name:e,public:r.public,file_size_limit:r.fileSizeLimit,allowed_mime_types:r.allowedMimeTypes},{headers:this.headers}),error:null}}catch(n){if((0,Go.isStorageError)(n))return{data:null,error:n};throw n}})}updateBucket(e,r){return zo(this,void 0,void 0,function*(){try{return{data:yield(0,Wo.put)(this.fetch,`${this.url}/bucket/${e}`,{id:e,name:e,public:r.public,file_size_limit:r.fileSizeLimit,allowed_mime_types:r.allowedMimeTypes},{headers:this.headers}),error:null}}catch(n){if((0,Go.isStorageError)(n))return{data:null,error:n};throw n}})}emptyBucket(e){return zo(this,void 0,void 0,function*(){try{return{data:yield(0,Wo.post)(this.fetch,`${this.url}/bucket/${e}/empty`,{},{headers:this.headers}),error:null}}catch(r){if((0,Go.isStorageError)(r))return{data:null,error:r};throw r}})}deleteBucket(e){return zo(this,void 0,void 0,function*(){try{return{data:yield(0,Wo.remove)(this.fetch,`${this.url}/bucket/${e}`,{},{headers:this.headers}),error:null}}catch(r){if((0,Go.isStorageError)(r))return{data:null,error:r};throw r}})}};Qa.default=Fm});var p_=y(Ko=>{"use strict";var h_=Ko&&Ko.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ko,"__esModule",{value:!0});Ko.StorageClient=void 0;var Gq=h_(c_()),Wq=h_(d_()),Om=class extends Wq.default{constructor(e,r={},n){super(e,r,n)}from(e){return new Gq.default(this.url,this.headers,e,this.fetch)}};Ko.StorageClient=Om});var g_=y(m_=>{"use strict";Object.defineProperty(m_,"__esModule",{value:!0})});var D_=y(Br=>{"use strict";var Kq=Br&&Br.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),y_=Br&&Br.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Kq(e,t,r)};Object.defineProperty(Br,"__esModule",{value:!0});Br.StorageClient=void 0;var Yq=p_();Object.defineProperty(Br,"StorageClient",{enumerable:!0,get:function(){return Yq.StorageClient}});y_(g_(),Br);y_(Ja(),Br)});var v_=y(El=>{"use strict";Object.defineProperty(El,"__esModule",{value:!0});El.version=void 0;El.version="2.46.0"});var b_=y(ir=>{"use strict";Object.defineProperty(ir,"__esModule",{value:!0});ir.DEFAULT_REALTIME_OPTIONS=ir.DEFAULT_AUTH_OPTIONS=ir.DEFAULT_DB_OPTIONS=ir.DEFAULT_GLOBAL_OPTIONS=ir.DEFAULT_HEADERS=void 0;var Jq=v_(),eu="";typeof Deno<"u"?eu="deno":typeof document<"u"?eu="web":typeof navigator<"u"&&navigator.product==="ReactNative"?eu="react-native":eu="node";ir.DEFAULT_HEADERS={"X-Client-Info":`supabase-js-${eu}/${Jq.version}`};ir.DEFAULT_GLOBAL_OPTIONS={headers:ir.DEFAULT_HEADERS};ir.DEFAULT_DB_OPTIONS={schema:"public"};ir.DEFAULT_AUTH_OPTIONS={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"};ir.DEFAULT_REALTIME_OPTIONS={}});var __=y(lt=>{"use strict";var Xq=lt&&lt.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),Zq=lt&&lt.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Qq=lt&&lt.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&Xq(e,t,r);return Zq(e,t),e},eM=lt&&lt.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(l){try{c(n.next(l))}catch(f){s(f)}}function u(l){try{c(n.throw(l))}catch(f){s(f)}}function c(l){l.done?o(l.value):i(l.value).then(a,u)}c((n=n.apply(t,e||[])).next())})};Object.defineProperty(lt,"__esModule",{value:!0});lt.fetchWithAuth=lt.resolveHeadersConstructor=lt.resolveFetch=void 0;var w_=Qq((Fi(),ke(xi))),tM=t=>{let e;return t?e=t:typeof fetch>"u"?e=w_.default:e=fetch,(...r)=>e(...r)};lt.resolveFetch=tM;var rM=()=>typeof Headers>"u"?w_.Headers:Headers;lt.resolveHeadersConstructor=rM;var nM=(t,e,r)=>{let n=(0,lt.resolveFetch)(r),i=(0,lt.resolveHeadersConstructor)();return(o,s)=>eM(void 0,void 0,void 0,function*(){var a;let u=(a=yield e())!==null&&a!==void 0?a:t,c=new i(s?.headers);return c.has("apikey")||c.set("apikey",t),c.has("Authorization")||c.set("Authorization",`Bearer ${u}`),n(o,Object.assign(Object.assign({},s),{headers:c}))})};lt.fetchWithAuth=nM});var E_=y(mr=>{"use strict";var iM=mr&&mr.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(l){try{c(n.next(l))}catch(f){s(f)}}function u(l){try{c(n.throw(l))}catch(f){s(f)}}function c(l){l.done?o(l.value):i(l.value).then(a,u)}c((n=n.apply(t,e||[])).next())})};Object.defineProperty(mr,"__esModule",{value:!0});mr.applySettingDefaults=mr.isBrowser=mr.stripTrailingSlash=mr.uuid=void 0;function oM(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var e=Math.random()*16|0,r=t=="x"?e:e&3|8;return r.toString(16)})}mr.uuid=oM;function sM(t){return t.replace(/\/$/,"")}mr.stripTrailingSlash=sM;var aM=()=>typeof window<"u";mr.isBrowser=aM;function uM(t,e){let{db:r,auth:n,realtime:i,global:o}=t,{db:s,auth:a,realtime:u,global:c}=e,l={db:Object.assign(Object.assign({},s),r),auth:Object.assign(Object.assign({},a),n),realtime:Object.assign(Object.assign({},u),i),global:Object.assign(Object.assign({},c),o),accessToken:()=>iM(this,void 0,void 0,function*(){return""})};return t.accessToken?l.accessToken=t.accessToken:delete l.accessToken,l}mr.applySettingDefaults=uM});var Am=y(Cl=>{"use strict";Object.defineProperty(Cl,"__esModule",{value:!0});Cl.version=void 0;Cl.version="2.65.1"});var Sl=y(ft=>{"use strict";Object.defineProperty(ft,"__esModule",{value:!0});ft.API_VERSIONS=ft.API_VERSION_HEADER_NAME=ft.NETWORK_FAILURE=ft.EXPIRY_MARGIN=ft.DEFAULT_HEADERS=ft.AUDIENCE=ft.STORAGE_KEY=ft.GOTRUE_URL=void 0;var cM=Am();ft.GOTRUE_URL="http://localhost:9999";ft.STORAGE_KEY="supabase.auth.token";ft.AUDIENCE="";ft.DEFAULT_HEADERS={"X-Client-Info":`gotrue-js/${cM.version}`};ft.EXPIRY_MARGIN=10;ft.NETWORK_FAILURE={MAX_RETRIES:10,RETRY_INTERVAL:2};ft.API_VERSION_HEADER_NAME="X-Supabase-Api-Version";ft.API_VERSIONS={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}}});var Yo=y(te=>{"use strict";var lM=te&&te.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),fM=te&&te.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),dM=te&&te.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&lM(e,t,r);return fM(e,t),e};Object.defineProperty(te,"__esModule",{value:!0});te.parseResponseAPIVersion=te.getCodeChallengeAndMethod=te.generatePKCEChallenge=te.generatePKCEVerifier=te.retryable=te.sleep=te.decodeJWTPayload=te.Deferred=te.decodeBase64URL=te.removeItemAsync=te.getItemAsync=te.setItemAsync=te.looksLikeFetchResponse=te.resolveFetch=te.parseParametersFromURL=te.supportsLocalStorage=te.isBrowser=te.uuid=te.expiresAt=void 0;var hM=Sl();function pM(t){return Math.round(Date.now()/1e3)+t}te.expiresAt=pM;function mM(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){let e=Math.random()*16|0;return(t=="x"?e:e&3|8).toString(16)})}te.uuid=mM;var gM=()=>typeof document<"u";te.isBrowser=gM;var Ai={tested:!1,writable:!1},yM=()=>{if(!(0,te.isBrowser)())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(Ai.tested)return Ai.writable;let t=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(t,t),globalThis.localStorage.removeItem(t),Ai.tested=!0,Ai.writable=!0}catch{Ai.tested=!0,Ai.writable=!1}return Ai.writable};te.supportsLocalStorage=yM;function DM(t){let e={},r=new URL(t);if(r.hash&&r.hash[0]==="#")try{new URLSearchParams(r.hash.substring(1)).forEach((i,o)=>{e[o]=i})}catch{}return r.searchParams.forEach((n,i)=>{e[i]=n}),e}te.parseParametersFromURL=DM;var vM=t=>{let e;return t?e=t:typeof fetch>"u"?e=(...r)=>Promise.resolve().then(()=>dM((Fi(),ke(xi)))).then(({default:n})=>n(...r)):e=fetch,(...r)=>e(...r)};te.resolveFetch=vM;var bM=t=>typeof t=="object"&&t!==null&&"status"in t&&"ok"in t&&"json"in t&&typeof t.json=="function";te.looksLikeFetchResponse=bM;var wM=async(t,e,r)=>{await t.setItem(e,JSON.stringify(r))};te.setItemAsync=wM;var _M=async(t,e)=>{let r=await t.getItem(e);if(!r)return null;try{return JSON.parse(r)}catch{return r}};te.getItemAsync=_M;var EM=async(t,e)=>{await t.removeItem(e)};te.removeItemAsync=EM;function C_(t){let e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",r="",n,i,o,s,a,u,c,l=0;for(t=t.replace("-","+").replace("_","/");l<t.length;)s=e.indexOf(t.charAt(l++)),a=e.indexOf(t.charAt(l++)),u=e.indexOf(t.charAt(l++)),c=e.indexOf(t.charAt(l++)),n=s<<2|a>>4,i=(a&15)<<4|u>>2,o=(u&3)<<6|c,r=r+String.fromCharCode(n),u!=64&&i!=0&&(r=r+String.fromCharCode(i)),c!=64&&o!=0&&(r=r+String.fromCharCode(o));return r}te.decodeBase64URL=C_;var xl=class t{constructor(){this.promise=new t.promiseConstructor((e,r)=>{this.resolve=e,this.reject=r})}};te.Deferred=xl;xl.promiseConstructor=Promise;function CM(t){let e=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}=?$|[a-z0-9_-]{2}(==)?$)$/i,r=t.split(".");if(r.length!==3)throw new Error("JWT is not valid: not a JWT structure");if(!e.test(r[1]))throw new Error("JWT is not valid: payload is not in base64url format");let n=r[1];return JSON.parse(C_(n))}te.decodeJWTPayload=CM;async function SM(t){return await new Promise(e=>{setTimeout(()=>e(null),t)})}te.sleep=SM;function xM(t,e){return new Promise((n,i)=>{(async()=>{for(let o=0;o<1/0;o++)try{let s=await t(o);if(!e(o,null,s)){n(s);return}}catch(s){if(!e(o,s)){i(s);return}}})()})}te.retryable=xM;function FM(t){return("0"+t.toString(16)).substr(-2)}function S_(){let e=new Uint32Array(56);if(typeof crypto>"u"){let r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",n=r.length,i="";for(let o=0;o<56;o++)i+=r.charAt(Math.floor(Math.random()*n));return i}return crypto.getRandomValues(e),Array.from(e,FM).join("")}te.generatePKCEVerifier=S_;async function OM(t){let r=new TextEncoder().encode(t),n=await crypto.subtle.digest("SHA-256",r),i=new Uint8Array(n);return Array.from(i).map(o=>String.fromCharCode(o)).join("")}function AM(t){return btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function x_(t){if(!(typeof crypto<"u"&&typeof crypto.subtle<"u"&&typeof TextEncoder<"u"))return console.warn("WebCrypto API is not supported. Code challenge method will default to use plain instead of sha256."),t;let r=await OM(t);return AM(r)}te.generatePKCEChallenge=x_;async function kM(t,e,r=!1){let n=S_(),i=n;r&&(i+="/PASSWORD_RECOVERY"),await(0,te.setItemAsync)(t,`${e}-code-verifier`,i);let o=await x_(n);return[o,n===o?"plain":"s256"]}te.getCodeChallengeAndMethod=kM;var TM=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function PM(t){let e=t.headers.get(hM.API_VERSION_HEADER_NAME);if(!e||!e.match(TM))return null;try{return new Date(`${e}T00:00:00.0Z`)}catch{return null}}te.parseResponseAPIVersion=PM});var ru=y(he=>{"use strict";Object.defineProperty(he,"__esModule",{value:!0});he.isAuthWeakPasswordError=he.AuthWeakPasswordError=he.isAuthRetryableFetchError=he.AuthRetryableFetchError=he.AuthPKCEGrantCodeExchangeError=he.AuthImplicitGrantRedirectError=he.AuthInvalidCredentialsError=he.AuthInvalidTokenResponseError=he.isAuthSessionMissingError=he.AuthSessionMissingError=he.CustomAuthError=he.AuthUnknownError=he.isAuthApiError=he.AuthApiError=he.isAuthError=he.AuthError=void 0;var Jo=class extends Error{constructor(e,r,n){super(e),this.__isAuthError=!0,this.name="AuthError",this.status=r,this.code=n}};he.AuthError=Jo;function tu(t){return typeof t=="object"&&t!==null&&"__isAuthError"in t}he.isAuthError=tu;var km=class extends Jo{constructor(e,r,n){super(e,r,n),this.name="AuthApiError",this.status=r,this.code=n}};he.AuthApiError=km;function RM(t){return tu(t)&&t.name==="AuthApiError"}he.isAuthApiError=RM;var Tm=class extends Jo{constructor(e,r){super(e),this.name="AuthUnknownError",this.originalError=r}};he.AuthUnknownError=Tm;var qr=class extends Jo{constructor(e,r,n,i){super(e,n,i),this.name=r,this.status=n}};he.CustomAuthError=qr;var Pm=class extends qr{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}};he.AuthSessionMissingError=Pm;function $M(t){return tu(t)&&t.name==="AuthSessionMissingError"}he.isAuthSessionMissingError=$M;var Rm=class extends qr{constructor(){super("Auth session or user missing","AuthInvalidTokenResponseError",500,void 0)}};he.AuthInvalidTokenResponseError=Rm;var $m=class extends qr{constructor(e){super(e,"AuthInvalidCredentialsError",400,void 0)}};he.AuthInvalidCredentialsError=$m;var Im=class extends qr{constructor(e,r=null){super(e,"AuthImplicitGrantRedirectError",500,void 0),this.details=null,this.details=r}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}};he.AuthImplicitGrantRedirectError=Im;var jm=class extends qr{constructor(e,r=null){super(e,"AuthPKCEGrantCodeExchangeError",500,void 0),this.details=null,this.details=r}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}};he.AuthPKCEGrantCodeExchangeError=jm;var Nm=class extends qr{constructor(e,r){super(e,"AuthRetryableFetchError",r,void 0)}};he.AuthRetryableFetchError=Nm;function IM(t){return tu(t)&&t.name==="AuthRetryableFetchError"}he.isAuthRetryableFetchError=IM;var Lm=class extends qr{constructor(e,r,n){super(e,"AuthWeakPasswordError",r,"weak_password"),this.reasons=n}};he.AuthWeakPasswordError=Lm;function jM(t){return tu(t)&&t.name==="AuthWeakPasswordError"}he.isAuthWeakPasswordError=jM});var Mm=y(rt=>{"use strict";var NM=rt&&rt.__rest||function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r};Object.defineProperty(rt,"__esModule",{value:!0});rt._noResolveJsonResponse=rt._generateLinkResponse=rt._ssoResponse=rt._userResponse=rt._sessionResponsePassword=rt._sessionResponse=rt._request=rt.handleError=void 0;var Fl=Sl(),Bm=Yo(),Kn=ru(),ki=t=>t.msg||t.message||t.error_description||t.error||JSON.stringify(t),LM=[502,503,504];async function qm(t){var e;if(!(0,Bm.looksLikeFetchResponse)(t))throw new Kn.AuthRetryableFetchError(ki(t),0);if(LM.includes(t.status))throw new Kn.AuthRetryableFetchError(ki(t),t.status);let r;try{r=await t.json()}catch(o){throw new Kn.AuthUnknownError(ki(o),o)}let n,i=(0,Bm.parseResponseAPIVersion)(t);if(i&&i.getTime()>=Fl.API_VERSIONS["2024-01-01"].timestamp&&typeof r=="object"&&r&&typeof r.code=="string"?n=r.code:typeof r=="object"&&r&&typeof r.error_code=="string"&&(n=r.error_code),n){if(n==="weak_password")throw new Kn.AuthWeakPasswordError(ki(r),t.status,((e=r.weak_password)===null||e===void 0?void 0:e.reasons)||[]);if(n==="session_not_found")throw new Kn.AuthSessionMissingError}else if(typeof r=="object"&&r&&typeof r.weak_password=="object"&&r.weak_password&&Array.isArray(r.weak_password.reasons)&&r.weak_password.reasons.length&&r.weak_password.reasons.reduce((o,s)=>o&&typeof s=="string",!0))throw new Kn.AuthWeakPasswordError(ki(r),t.status,r.weak_password.reasons);throw new Kn.AuthApiError(ki(r),t.status||500,n)}rt.handleError=qm;var BM=(t,e,r,n)=>{let i={method:t,headers:e?.headers||{}};return t==="GET"?i:(i.headers=Object.assign({"Content-Type":"application/json;charset=UTF-8"},e?.headers),i.body=JSON.stringify(n),Object.assign(Object.assign({},i),r))};async function qM(t,e,r,n){var i;let o=Object.assign({},n?.headers);o[Fl.API_VERSION_HEADER_NAME]||(o[Fl.API_VERSION_HEADER_NAME]=Fl.API_VERSIONS["2024-01-01"].name),n?.jwt&&(o.Authorization=`Bearer ${n.jwt}`);let s=(i=n?.query)!==null&&i!==void 0?i:{};n?.redirectTo&&(s.redirect_to=n.redirectTo);let a=Object.keys(s).length?"?"+new URLSearchParams(s).toString():"",u=await MM(t,e,r+a,{headers:o,noResolveJson:n?.noResolveJson},{},n?.body);return n?.xform?n?.xform(u):{data:Object.assign({},u),error:null}}rt._request=qM;async function MM(t,e,r,n,i,o){let s=BM(e,n,i,o),a;try{a=await t(r,Object.assign({},s))}catch(u){throw console.error(u),new Kn.AuthRetryableFetchError(ki(u),0)}if(a.ok||await qm(a),n?.noResolveJson)return a;try{return await a.json()}catch(u){await qm(u)}}function F_(t){var e;let r=null;WM(t)&&(r=Object.assign({},t),t.expires_at||(r.expires_at=(0,Bm.expiresAt)(t.expires_in)));let n=(e=t.user)!==null&&e!==void 0?e:t;return{data:{session:r,user:n},error:null}}rt._sessionResponse=F_;function UM(t){let e=F_(t);return!e.error&&t.weak_password&&typeof t.weak_password=="object"&&Array.isArray(t.weak_password.reasons)&&t.weak_password.reasons.length&&t.weak_password.message&&typeof t.weak_password.message=="string"&&t.weak_password.reasons.reduce((r,n)=>r&&typeof n=="string",!0)&&(e.data.weak_password=t.weak_password),e}rt._sessionResponsePassword=UM;function VM(t){var e;return{data:{user:(e=t.user)!==null&&e!==void 0?e:t},error:null}}rt._userResponse=VM;function HM(t){return{data:t,error:null}}rt._ssoResponse=HM;function zM(t){let{action_link:e,email_otp:r,hashed_token:n,redirect_to:i,verification_type:o}=t,s=NM(t,["action_link","email_otp","hashed_token","redirect_to","verification_type"]),a={action_link:e,email_otp:r,hashed_token:n,redirect_to:i,verification_type:o},u=Object.assign({},s);return{data:{properties:a,user:u},error:null}}rt._generateLinkResponse=zM;function GM(t){return t}rt._noResolveJsonResponse=GM;function WM(t){return t.access_token&&t.refresh_token&&t.expires_in}});var Ol=y(nu=>{"use strict";var KM=nu&&nu.__rest||function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r};Object.defineProperty(nu,"__esModule",{value:!0});var vt=Mm(),YM=Yo(),Mr=ru(),Um=class{constructor({url:e="",headers:r={},fetch:n}){this.url=e,this.headers=r,this.fetch=(0,YM.resolveFetch)(n),this.mfa={listFactors:this._listFactors.bind(this),deleteFactor:this._deleteFactor.bind(this)}}async signOut(e,r="global"){try{return await(0,vt._request)(this.fetch,"POST",`${this.url}/logout?scope=${r}`,{headers:this.headers,jwt:e,noResolveJson:!0}),{data:null,error:null}}catch(n){if((0,Mr.isAuthError)(n))return{data:null,error:n};throw n}}async inviteUserByEmail(e,r={}){try{return await(0,vt._request)(this.fetch,"POST",`${this.url}/invite`,{body:{email:e,data:r.data},headers:this.headers,redirectTo:r.redirectTo,xform:vt._userResponse})}catch(n){if((0,Mr.isAuthError)(n))return{data:{user:null},error:n};throw n}}async generateLink(e){try{let{options:r}=e,n=KM(e,["options"]),i=Object.assign(Object.assign({},n),r);return"newEmail"in n&&(i.new_email=n?.newEmail,delete i.newEmail),await(0,vt._request)(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:i,headers:this.headers,xform:vt._generateLinkResponse,redirectTo:r?.redirectTo})}catch(r){if((0,Mr.isAuthError)(r))return{data:{properties:null,user:null},error:r};throw r}}async createUser(e){try{return await(0,vt._request)(this.fetch,"POST",`${this.url}/admin/users`,{body:e,headers:this.headers,xform:vt._userResponse})}catch(r){if((0,Mr.isAuthError)(r))return{data:{user:null},error:r};throw r}}async listUsers(e){var r,n,i,o,s,a,u;try{let c={nextPage:null,lastPage:0,total:0},l=await(0,vt._request)(this.fetch,"GET",`${this.url}/admin/users`,{headers:this.headers,noResolveJson:!0,query:{page:(n=(r=e?.page)===null||r===void 0?void 0:r.toString())!==null&&n!==void 0?n:"",per_page:(o=(i=e?.perPage)===null||i===void 0?void 0:i.toString())!==null&&o!==void 0?o:""},xform:vt._noResolveJsonResponse});if(l.error)throw l.error;let f=await l.json(),h=(s=l.headers.get("x-total-count"))!==null&&s!==void 0?s:0,d=(u=(a=l.headers.get("link"))===null||a===void 0?void 0:a.split(","))!==null&&u!==void 0?u:[];return d.length>0&&(d.forEach(p=>{let v=parseInt(p.split(";")[0].split("=")[1].substring(0,1)),g=JSON.parse(p.split(";")[1].split("=")[1]);c[`${g}Page`]=v}),c.total=parseInt(h)),{data:Object.assign(Object.assign({},f),c),error:null}}catch(c){if((0,Mr.isAuthError)(c))return{data:{users:[]},error:c};throw c}}async getUserById(e){try{return await(0,vt._request)(this.fetch,"GET",`${this.url}/admin/users/${e}`,{headers:this.headers,xform:vt._userResponse})}catch(r){if((0,Mr.isAuthError)(r))return{data:{user:null},error:r};throw r}}async updateUserById(e,r){try{return await(0,vt._request)(this.fetch,"PUT",`${this.url}/admin/users/${e}`,{body:r,headers:this.headers,xform:vt._userResponse})}catch(n){if((0,Mr.isAuthError)(n))return{data:{user:null},error:n};throw n}}async deleteUser(e,r=!1){try{return await(0,vt._request)(this.fetch,"DELETE",`${this.url}/admin/users/${e}`,{headers:this.headers,body:{should_soft_delete:r},xform:vt._userResponse})}catch(n){if((0,Mr.isAuthError)(n))return{data:{user:null},error:n};throw n}}async _listFactors(e){try{let{data:r,error:n}=await(0,vt._request)(this.fetch,"GET",`${this.url}/admin/users/${e.userId}/factors`,{headers:this.headers,xform:i=>({data:{factors:i},error:null})});return{data:r,error:n}}catch(r){if((0,Mr.isAuthError)(r))return{data:null,error:r};throw r}}async _deleteFactor(e){try{return{data:await(0,vt._request)(this.fetch,"DELETE",`${this.url}/admin/users/${e.userId}/factors/${e.id}`,{headers:this.headers}),error:null}}catch(r){if((0,Mr.isAuthError)(r))return{data:null,error:r};throw r}}};nu.default=Um});var O_=y(Xo=>{"use strict";Object.defineProperty(Xo,"__esModule",{value:!0});Xo.memoryLocalStorageAdapter=Xo.localStorageAdapter=void 0;var Vm=Yo();Xo.localStorageAdapter={getItem:t=>(0,Vm.supportsLocalStorage)()?globalThis.localStorage.getItem(t):null,setItem:(t,e)=>{(0,Vm.supportsLocalStorage)()&&globalThis.localStorage.setItem(t,e)},removeItem:t=>{(0,Vm.supportsLocalStorage)()&&globalThis.localStorage.removeItem(t)}};function JM(t={}){return{getItem:e=>t[e]||null,setItem:(e,r)=>{t[e]=r},removeItem:e=>{delete t[e]}}}Xo.memoryLocalStorageAdapter=JM});var A_=y(Al=>{"use strict";Object.defineProperty(Al,"__esModule",{value:!0});Al.polyfillGlobalThis=void 0;function XM(){if(typeof globalThis!="object")try{Object.defineProperty(Object.prototype,"__magic__",{get:function(){return this},configurable:!0}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__}catch{typeof self<"u"&&(self.globalThis=self)}}Al.polyfillGlobalThis=XM});var Hm=y(Et=>{"use strict";Object.defineProperty(Et,"__esModule",{value:!0});Et.navigatorLock=Et.NavigatorLockAcquireTimeoutError=Et.LockAcquireTimeoutError=Et.internals=void 0;var ZM=Yo();Et.internals={debug:!!(globalThis&&(0,ZM.supportsLocalStorage)()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug")==="true")};var kl=class extends Error{constructor(e){super(e),this.isAcquireTimeout=!0}};Et.LockAcquireTimeoutError=kl;var Tl=class extends kl{};Et.NavigatorLockAcquireTimeoutError=Tl;async function QM(t,e,r){Et.internals.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire lock",t,e);let n=new globalThis.AbortController;return e>0&&setTimeout(()=>{n.abort(),Et.internals.debug&&console.log("@supabase/gotrue-js: navigatorLock acquire timed out",t)},e),await globalThis.navigator.locks.request(t,e===0?{mode:"exclusive",ifAvailable:!0}:{mode:"exclusive",signal:n.signal},async i=>{if(i){Et.internals.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquired",t,i.name);try{return await r()}finally{Et.internals.debug&&console.log("@supabase/gotrue-js: navigatorLock: released",t,i.name)}}else{if(e===0)throw Et.internals.debug&&console.log("@supabase/gotrue-js: navigatorLock: not immediately available",t),new Tl(`Acquiring an exclusive Navigator LockManager lock "${t}" immediately failed`);if(Et.internals.debug)try{let o=await globalThis.navigator.locks.query();console.log("@supabase/gotrue-js: Navigator LockManager state",JSON.stringify(o,null," "))}catch(o){console.warn("@supabase/gotrue-js: Error when querying Navigator LockManager state",o)}return console.warn("@supabase/gotrue-js: Navigator LockManager returned a null lock when using #request without ifAvailable set to true, it appears this browser is not following the LockManager spec https://developer.mozilla.org/en-US/docs/Web/API/LockManager/request"),await r()}})}Et.navigatorLock=QM});var Gm=y(su=>{"use strict";var e4=su&&su.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(su,"__esModule",{value:!0});var t4=e4(Ol()),ou=Sl(),Z=ru(),ae=Mm(),fe=Yo(),zm=O_(),r4=A_(),n4=Am(),k_=Hm();(0,r4.polyfillGlobalThis)();var i4={url:ou.GOTRUE_URL,storageKey:ou.STORAGE_KEY,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:ou.DEFAULT_HEADERS,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1},iu=30*1e3,T_=3;async function P_(t,e,r){return await r()}var Pl=class t{constructor(e){var r,n;this.memoryStorage=null,this.stateChangeEmitters=new Map,this.autoRefreshTicker=null,this.visibilityChangedCallback=null,this.refreshingDeferred=null,this.initializePromise=null,this.detectSessionInUrl=!0,this.hasCustomAuthorizationHeader=!1,this.suppressGetSessionWarning=!1,this.lockAcquired=!1,this.pendingInLock=[],this.broadcastChannel=null,this.logger=console.log,this.instanceID=t.nextInstanceID,t.nextInstanceID+=1,this.instanceID>0&&(0,fe.isBrowser)()&&console.warn("Multiple GoTrueClient instances detected in the same browser context. It is not an error, but this should be avoided as it may produce undefined behavior when used concurrently under the same storage key.");let i=Object.assign(Object.assign({},i4),e);if(this.logDebugMessages=!!i.debug,typeof i.debug=="function"&&(this.logger=i.debug),this.persistSession=i.persistSession,this.storageKey=i.storageKey,this.autoRefreshToken=i.autoRefreshToken,this.admin=new t4.default({url:i.url,headers:i.headers,fetch:i.fetch}),this.url=i.url,this.headers=i.headers,this.fetch=(0,fe.resolveFetch)(i.fetch),this.lock=i.lock||P_,this.detectSessionInUrl=i.detectSessionInUrl,this.flowType=i.flowType,this.hasCustomAuthorizationHeader=i.hasCustomAuthorizationHeader,i.lock?this.lock=i.lock:(0,fe.isBrowser)()&&(!((r=globalThis?.navigator)===null||r===void 0)&&r.locks)?this.lock=k_.navigatorLock:this.lock=P_,this.mfa={verify:this._verify.bind(this),enroll:this._enroll.bind(this),unenroll:this._unenroll.bind(this),challenge:this._challenge.bind(this),listFactors:this._listFactors.bind(this),challengeAndVerify:this._challengeAndVerify.bind(this),getAuthenticatorAssuranceLevel:this._getAuthenticatorAssuranceLevel.bind(this)},this.persistSession?i.storage?this.storage=i.storage:(0,fe.supportsLocalStorage)()?this.storage=zm.localStorageAdapter:(this.memoryStorage={},this.storage=(0,zm.memoryLocalStorageAdapter)(this.memoryStorage)):(this.memoryStorage={},this.storage=(0,zm.memoryLocalStorageAdapter)(this.memoryStorage)),(0,fe.isBrowser)()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(o){console.error("Failed to create a new BroadcastChannel, multi-tab state changes will not be available",o)}(n=this.broadcastChannel)===null||n===void 0||n.addEventListener("message",async o=>{this._debug("received broadcast notification from other tab or client",o),await this._notifyAllSubscribers(o.data.event,o.data.session,!1)})}this.initialize()}_debug(...e){return this.logDebugMessages&&this.logger(`GoTrueClient@${this.instanceID} (${n4.version}) ${new Date().toISOString()}`,...e),this}async initialize(){return this.initializePromise?await this.initializePromise:(this.initializePromise=(async()=>await this._acquireLock(-1,async()=>await this._initialize()))(),await this.initializePromise)}async _initialize(){try{let e=(0,fe.isBrowser)()?await this._isPKCEFlow():!1;if(this._debug("#_initialize()","begin","is PKCE flow",e),e||this.detectSessionInUrl&&this._isImplicitGrantFlow()){let{data:r,error:n}=await this._getSessionFromURL(e);if(n)return this._debug("#_initialize()","error detecting session from URL",n),n?.code==="identity_already_exists"?{error:n}:(await this._removeSession(),{error:n});let{session:i,redirectType:o}=r;return this._debug("#_initialize()","detected session in URL",i,"redirect type",o),await this._saveSession(i),setTimeout(async()=>{o==="recovery"?await this._notifyAllSubscribers("PASSWORD_RECOVERY",i):await this._notifyAllSubscribers("SIGNED_IN",i)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(e){return(0,Z.isAuthError)(e)?{error:e}:{error:new Z.AuthUnknownError("Unexpected error during initialization",e)}}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(e){var r,n,i;try{let o=await(0,ae._request)(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{data:(n=(r=e?.options)===null||r===void 0?void 0:r.data)!==null&&n!==void 0?n:{},gotrue_meta_security:{captcha_token:(i=e?.options)===null||i===void 0?void 0:i.captchaToken}},xform:ae._sessionResponse}),{data:s,error:a}=o;if(a||!s)return{data:{user:null,session:null},error:a};let u=s.session,c=s.user;return s.session&&(await this._saveSession(s.session),await this._notifyAllSubscribers("SIGNED_IN",u)),{data:{user:c,session:u},error:null}}catch(o){if((0,Z.isAuthError)(o))return{data:{user:null,session:null},error:o};throw o}}async signUp(e){var r,n,i;try{let o;if("email"in e){let{email:l,password:f,options:h}=e,d=null,p=null;this.flowType==="pkce"&&([d,p]=await(0,fe.getCodeChallengeAndMethod)(this.storage,this.storageKey)),o=await(0,ae._request)(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:h?.emailRedirectTo,body:{email:l,password:f,data:(r=h?.data)!==null&&r!==void 0?r:{},gotrue_meta_security:{captcha_token:h?.captchaToken},code_challenge:d,code_challenge_method:p},xform:ae._sessionResponse})}else if("phone"in e){let{phone:l,password:f,options:h}=e;o=await(0,ae._request)(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:l,password:f,data:(n=h?.data)!==null&&n!==void 0?n:{},channel:(i=h?.channel)!==null&&i!==void 0?i:"sms",gotrue_meta_security:{captcha_token:h?.captchaToken}},xform:ae._sessionResponse})}else throw new Z.AuthInvalidCredentialsError("You must provide either an email or phone number and a password");let{data:s,error:a}=o;if(a||!s)return{data:{user:null,session:null},error:a};let u=s.session,c=s.user;return s.session&&(await this._saveSession(s.session),await this._notifyAllSubscribers("SIGNED_IN",u)),{data:{user:c,session:u},error:null}}catch(o){if((0,Z.isAuthError)(o))return{data:{user:null,session:null},error:o};throw o}}async signInWithPassword(e){try{let r;if("email"in e){let{email:o,password:s,options:a}=e;r=await(0,ae._request)(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:o,password:s,gotrue_meta_security:{captcha_token:a?.captchaToken}},xform:ae._sessionResponsePassword})}else if("phone"in e){let{phone:o,password:s,options:a}=e;r=await(0,ae._request)(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:o,password:s,gotrue_meta_security:{captcha_token:a?.captchaToken}},xform:ae._sessionResponsePassword})}else throw new Z.AuthInvalidCredentialsError("You must provide either an email or phone number and a password");let{data:n,error:i}=r;return i?{data:{user:null,session:null},error:i}:!n||!n.session||!n.user?{data:{user:null,session:null},error:new Z.AuthInvalidTokenResponseError}:(n.session&&(await this._saveSession(n.session),await this._notifyAllSubscribers("SIGNED_IN",n.session)),{data:Object.assign({user:n.user,session:n.session},n.weak_password?{weakPassword:n.weak_password}:null),error:i})}catch(r){if((0,Z.isAuthError)(r))return{data:{user:null,session:null},error:r};throw r}}async signInWithOAuth(e){var r,n,i,o;return await this._handleProviderSignIn(e.provider,{redirectTo:(r=e.options)===null||r===void 0?void 0:r.redirectTo,scopes:(n=e.options)===null||n===void 0?void 0:n.scopes,queryParams:(i=e.options)===null||i===void 0?void 0:i.queryParams,skipBrowserRedirect:(o=e.options)===null||o===void 0?void 0:o.skipBrowserRedirect})}async exchangeCodeForSession(e){return await this.initializePromise,this._acquireLock(-1,async()=>this._exchangeCodeForSession(e))}async _exchangeCodeForSession(e){let r=await(0,fe.getItemAsync)(this.storage,`${this.storageKey}-code-verifier`),[n,i]=(r??"").split("/");try{let{data:o,error:s}=await(0,ae._request)(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:e,code_verifier:n},xform:ae._sessionResponse});if(await(0,fe.removeItemAsync)(this.storage,`${this.storageKey}-code-verifier`),s)throw s;return!o||!o.session||!o.user?{data:{user:null,session:null,redirectType:null},error:new Z.AuthInvalidTokenResponseError}:(o.session&&(await this._saveSession(o.session),await this._notifyAllSubscribers("SIGNED_IN",o.session)),{data:Object.assign(Object.assign({},o),{redirectType:i??null}),error:s})}catch(o){if((0,Z.isAuthError)(o))return{data:{user:null,session:null,redirectType:null},error:o};throw o}}async signInWithIdToken(e){try{let{options:r,provider:n,token:i,access_token:o,nonce:s}=e,a=await(0,ae._request)(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:n,id_token:i,access_token:o,nonce:s,gotrue_meta_security:{captcha_token:r?.captchaToken}},xform:ae._sessionResponse}),{data:u,error:c}=a;return c?{data:{user:null,session:null},error:c}:!u||!u.session||!u.user?{data:{user:null,session:null},error:new Z.AuthInvalidTokenResponseError}:(u.session&&(await this._saveSession(u.session),await this._notifyAllSubscribers("SIGNED_IN",u.session)),{data:u,error:c})}catch(r){if((0,Z.isAuthError)(r))return{data:{user:null,session:null},error:r};throw r}}async signInWithOtp(e){var r,n,i,o,s;try{if("email"in e){let{email:a,options:u}=e,c=null,l=null;this.flowType==="pkce"&&([c,l]=await(0,fe.getCodeChallengeAndMethod)(this.storage,this.storageKey));let{error:f}=await(0,ae._request)(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:a,data:(r=u?.data)!==null&&r!==void 0?r:{},create_user:(n=u?.shouldCreateUser)!==null&&n!==void 0?n:!0,gotrue_meta_security:{captcha_token:u?.captchaToken},code_challenge:c,code_challenge_method:l},redirectTo:u?.emailRedirectTo});return{data:{user:null,session:null},error:f}}if("phone"in e){let{phone:a,options:u}=e,{data:c,error:l}=await(0,ae._request)(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:a,data:(i=u?.data)!==null&&i!==void 0?i:{},create_user:(o=u?.shouldCreateUser)!==null&&o!==void 0?o:!0,gotrue_meta_security:{captcha_token:u?.captchaToken},channel:(s=u?.channel)!==null&&s!==void 0?s:"sms"}});return{data:{user:null,session:null,messageId:c?.message_id},error:l}}throw new Z.AuthInvalidCredentialsError("You must provide either an email or phone number.")}catch(a){if((0,Z.isAuthError)(a))return{data:{user:null,session:null},error:a};throw a}}async verifyOtp(e){var r,n;try{let i,o;"options"in e&&(i=(r=e.options)===null||r===void 0?void 0:r.redirectTo,o=(n=e.options)===null||n===void 0?void 0:n.captchaToken);let{data:s,error:a}=await(0,ae._request)(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},e),{gotrue_meta_security:{captcha_token:o}}),redirectTo:i,xform:ae._sessionResponse});if(a)throw a;if(!s)throw new Error("An error occurred on token verification.");let u=s.session,c=s.user;return u?.access_token&&(await this._saveSession(u),await this._notifyAllSubscribers(e.type=="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",u)),{data:{user:c,session:u},error:null}}catch(i){if((0,Z.isAuthError)(i))return{data:{user:null,session:null},error:i};throw i}}async signInWithSSO(e){var r,n,i;try{let o=null,s=null;return this.flowType==="pkce"&&([o,s]=await(0,fe.getCodeChallengeAndMethod)(this.storage,this.storageKey)),await(0,ae._request)(this.fetch,"POST",`${this.url}/sso`,{body:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},"providerId"in e?{provider_id:e.providerId}:null),"domain"in e?{domain:e.domain}:null),{redirect_to:(n=(r=e.options)===null||r===void 0?void 0:r.redirectTo)!==null&&n!==void 0?n:void 0}),!((i=e?.options)===null||i===void 0)&&i.captchaToken?{gotrue_meta_security:{captcha_token:e.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:o,code_challenge_method:s}),headers:this.headers,xform:ae._ssoResponse})}catch(o){if((0,Z.isAuthError)(o))return{data:null,error:o};throw o}}async reauthenticate(){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._reauthenticate())}async _reauthenticate(){try{return await this._useSession(async e=>{let{data:{session:r},error:n}=e;if(n)throw n;if(!r)throw new Z.AuthSessionMissingError;let{error:i}=await(0,ae._request)(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:r.access_token});return{data:{user:null,session:null},error:i}})}catch(e){if((0,Z.isAuthError)(e))return{data:{user:null,session:null},error:e};throw e}}async resend(e){try{let r=`${this.url}/resend`;if("email"in e){let{email:n,type:i,options:o}=e,{error:s}=await(0,ae._request)(this.fetch,"POST",r,{headers:this.headers,body:{email:n,type:i,gotrue_meta_security:{captcha_token:o?.captchaToken}},redirectTo:o?.emailRedirectTo});return{data:{user:null,session:null},error:s}}else if("phone"in e){let{phone:n,type:i,options:o}=e,{data:s,error:a}=await(0,ae._request)(this.fetch,"POST",r,{headers:this.headers,body:{phone:n,type:i,gotrue_meta_security:{captcha_token:o?.captchaToken}}});return{data:{user:null,session:null,messageId:s?.message_id},error:a}}throw new Z.AuthInvalidCredentialsError("You must provide either an email or phone number and a type")}catch(r){if((0,Z.isAuthError)(r))return{data:{user:null,session:null},error:r};throw r}}async getSession(){return await this.initializePromise,await this._acquireLock(-1,async()=>this._useSession(async r=>r))}async _acquireLock(e,r){this._debug("#_acquireLock","begin",e);try{if(this.lockAcquired){let n=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),i=(async()=>(await n,await r()))();return this.pendingInLock.push((async()=>{try{await i}catch{}})()),i}return await this.lock(`lock:${this.storageKey}`,e,async()=>{this._debug("#_acquireLock","lock acquired for storage key",this.storageKey);try{this.lockAcquired=!0;let n=r();for(this.pendingInLock.push((async()=>{try{await n}catch{}})()),await n;this.pendingInLock.length;){let i=[...this.pendingInLock];await Promise.all(i),this.pendingInLock.splice(0,i.length)}return await n}finally{this._debug("#_acquireLock","lock released for storage key",this.storageKey),this.lockAcquired=!1}})}finally{this._debug("#_acquireLock","end")}}async _useSession(e){this._debug("#_useSession","begin");try{let r=await this.__loadSession();return await e(r)}finally{this._debug("#_useSession","end")}}async __loadSession(){this._debug("#__loadSession()","begin"),this.lockAcquired||this._debug("#__loadSession()","used outside of an acquired lock!",new Error().stack);try{let e=null,r=await(0,fe.getItemAsync)(this.storage,this.storageKey);if(this._debug("#getSession()","session from storage",r),r!==null&&(this._isValidSession(r)?e=r:(this._debug("#getSession()","session from storage is not valid"),await this._removeSession())),!e)return{data:{session:null},error:null};let n=e.expires_at?e.expires_at<=Date.now()/1e3:!1;if(this._debug("#__loadSession()",`session has${n?"":" not"} expired`,"expires_at",e.expires_at),!n){if(this.storage.isServer){let s=this.suppressGetSessionWarning;e=new Proxy(e,{get:(u,c,l)=>(!s&&c==="user"&&(console.warn("Using the user object as returned from supabase.auth.getSession() or from some supabase.auth.onAuthStateChange() events could be insecure! This value comes directly from the storage medium (usually cookies on the server) and many not be authentic. Use supabase.auth.getUser() instead which authenticates the data by contacting the Supabase Auth server."),s=!0,this.suppressGetSessionWarning=!0),Reflect.get(u,c,l))})}return{data:{session:e},error:null}}let{session:i,error:o}=await this._callRefreshToken(e.refresh_token);return o?{data:{session:null},error:o}:{data:{session:i},error:null}}finally{this._debug("#__loadSession()","end")}}async getUser(e){return e?await this._getUser(e):(await this.initializePromise,await this._acquireLock(-1,async()=>await this._getUser()))}async _getUser(e){try{return e?await(0,ae._request)(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:e,xform:ae._userResponse}):await this._useSession(async r=>{var n,i,o;let{data:s,error:a}=r;if(a)throw a;return!(!((n=s.session)===null||n===void 0)&&n.access_token)&&!this.hasCustomAuthorizationHeader?{data:{user:null},error:new Z.AuthSessionMissingError}:await(0,ae._request)(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:(o=(i=s.session)===null||i===void 0?void 0:i.access_token)!==null&&o!==void 0?o:void 0,xform:ae._userResponse})})}catch(r){if((0,Z.isAuthError)(r))return(0,Z.isAuthSessionMissingError)(r)&&(await this._removeSession(),await(0,fe.removeItemAsync)(this.storage,`${this.storageKey}-code-verifier`)),{data:{user:null},error:r};throw r}}async updateUser(e,r={}){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._updateUser(e,r))}async _updateUser(e,r={}){try{return await this._useSession(async n=>{let{data:i,error:o}=n;if(o)throw o;if(!i.session)throw new Z.AuthSessionMissingError;let s=i.session,a=null,u=null;this.flowType==="pkce"&&e.email!=null&&([a,u]=await(0,fe.getCodeChallengeAndMethod)(this.storage,this.storageKey));let{data:c,error:l}=await(0,ae._request)(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:r?.emailRedirectTo,body:Object.assign(Object.assign({},e),{code_challenge:a,code_challenge_method:u}),jwt:s.access_token,xform:ae._userResponse});if(l)throw l;return s.user=c.user,await this._saveSession(s),await this._notifyAllSubscribers("USER_UPDATED",s),{data:{user:s.user},error:null}})}catch(n){if((0,Z.isAuthError)(n))return{data:{user:null},error:n};throw n}}_decodeJWT(e){return(0,fe.decodeJWTPayload)(e)}async setSession(e){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._setSession(e))}async _setSession(e){try{if(!e.access_token||!e.refresh_token)throw new Z.AuthSessionMissingError;let r=Date.now()/1e3,n=r,i=!0,o=null,s=(0,fe.decodeJWTPayload)(e.access_token);if(s.exp&&(n=s.exp,i=n<=r),i){let{session:a,error:u}=await this._callRefreshToken(e.refresh_token);if(u)return{data:{user:null,session:null},error:u};if(!a)return{data:{user:null,session:null},error:null};o=a}else{let{data:a,error:u}=await this._getUser(e.access_token);if(u)throw u;o={access_token:e.access_token,refresh_token:e.refresh_token,user:a.user,token_type:"bearer",expires_in:n-r,expires_at:n},await this._saveSession(o),await this._notifyAllSubscribers("SIGNED_IN",o)}return{data:{user:o.user,session:o},error:null}}catch(r){if((0,Z.isAuthError)(r))return{data:{session:null,user:null},error:r};throw r}}async refreshSession(e){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._refreshSession(e))}async _refreshSession(e){try{return await this._useSession(async r=>{var n;if(!e){let{data:s,error:a}=r;if(a)throw a;e=(n=s.session)!==null&&n!==void 0?n:void 0}if(!e?.refresh_token)throw new Z.AuthSessionMissingError;let{session:i,error:o}=await this._callRefreshToken(e.refresh_token);return o?{data:{user:null,session:null},error:o}:i?{data:{user:i.user,session:i},error:null}:{data:{user:null,session:null},error:null}})}catch(r){if((0,Z.isAuthError)(r))return{data:{user:null,session:null},error:r};throw r}}async _getSessionFromURL(e){try{if(!(0,fe.isBrowser)())throw new Z.AuthImplicitGrantRedirectError("No browser detected.");if(this.flowType==="implicit"&&!this._isImplicitGrantFlow())throw new Z.AuthImplicitGrantRedirectError("Not a valid implicit grant flow url.");if(this.flowType=="pkce"&&!e)throw new Z.AuthPKCEGrantCodeExchangeError("Not a valid PKCE flow url.");let r=(0,fe.parseParametersFromURL)(window.location.href);if(e){if(!r.code)throw new Z.AuthPKCEGrantCodeExchangeError("No code detected.");let{data:x,error:D}=await this._exchangeCodeForSession(r.code);if(D)throw D;let C=new URL(window.location.href);return C.searchParams.delete("code"),window.history.replaceState(window.history.state,"",C.toString()),{data:{session:x.session,redirectType:null},error:null}}if(r.error||r.error_description||r.error_code)throw new Z.AuthImplicitGrantRedirectError(r.error_description||"Error in URL with unspecified error_description",{error:r.error||"unspecified_error",code:r.error_code||"unspecified_code"});let{provider_token:n,provider_refresh_token:i,access_token:o,refresh_token:s,expires_in:a,expires_at:u,token_type:c}=r;if(!o||!a||!s||!c)throw new Z.AuthImplicitGrantRedirectError("No session defined in URL");let l=Math.round(Date.now()/1e3),f=parseInt(a),h=l+f;u&&(h=parseInt(u));let d=h-l;d*1e3<=iu&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${d}s, should have been closer to ${f}s`);let p=h-f;l-p>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",p,h,l):l-p<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew",p,h,l);let{data:v,error:g}=await this._getUser(o);if(g)throw g;let w={provider_token:n,provider_refresh_token:i,access_token:o,expires_in:f,expires_at:h,refresh_token:s,token_type:c,user:v.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),{data:{session:w,redirectType:r.type},error:null}}catch(r){if((0,Z.isAuthError)(r))return{data:{session:null,redirectType:null},error:r};throw r}}_isImplicitGrantFlow(){let e=(0,fe.parseParametersFromURL)(window.location.href);return!!((0,fe.isBrowser)()&&(e.access_token||e.error_description))}async _isPKCEFlow(){let e=(0,fe.parseParametersFromURL)(window.location.href),r=await(0,fe.getItemAsync)(this.storage,`${this.storageKey}-code-verifier`);return!!(e.code&&r)}async signOut(e={scope:"global"}){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._signOut(e))}async _signOut({scope:e}={scope:"global"}){return await this._useSession(async r=>{var n;let{data:i,error:o}=r;if(o)return{error:o};let s=(n=i.session)===null||n===void 0?void 0:n.access_token;if(s){let{error:a}=await this.admin.signOut(s,e);if(a&&!((0,Z.isAuthApiError)(a)&&(a.status===404||a.status===401||a.status===403)))return{error:a}}return e!=="others"&&(await this._removeSession(),await(0,fe.removeItemAsync)(this.storage,`${this.storageKey}-code-verifier`)),{error:null}})}onAuthStateChange(e){let r=(0,fe.uuid)(),n={id:r,callback:e,unsubscribe:()=>{this._debug("#unsubscribe()","state change callback with id removed",r),this.stateChangeEmitters.delete(r)}};return this._debug("#onAuthStateChange()","registered callback with id",r),this.stateChangeEmitters.set(r,n),(async()=>(await this.initializePromise,await this._acquireLock(-1,async()=>{this._emitInitialSession(r)})))(),{data:{subscription:n}}}async _emitInitialSession(e){return await this._useSession(async r=>{var n,i;try{let{data:{session:o},error:s}=r;if(s)throw s;await((n=this.stateChangeEmitters.get(e))===null||n===void 0?void 0:n.callback("INITIAL_SESSION",o)),this._debug("INITIAL_SESSION","callback id",e,"session",o)}catch(o){await((i=this.stateChangeEmitters.get(e))===null||i===void 0?void 0:i.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",e,"error",o),console.error(o)}})}async resetPasswordForEmail(e,r={}){let n=null,i=null;this.flowType==="pkce"&&([n,i]=await(0,fe.getCodeChallengeAndMethod)(this.storage,this.storageKey,!0));try{return await(0,ae._request)(this.fetch,"POST",`${this.url}/recover`,{body:{email:e,code_challenge:n,code_challenge_method:i,gotrue_meta_security:{captcha_token:r.captchaToken}},headers:this.headers,redirectTo:r.redirectTo})}catch(o){if((0,Z.isAuthError)(o))return{data:null,error:o};throw o}}async getUserIdentities(){var e;try{let{data:r,error:n}=await this.getUser();if(n)throw n;return{data:{identities:(e=r.user.identities)!==null&&e!==void 0?e:[]},error:null}}catch(r){if((0,Z.isAuthError)(r))return{data:null,error:r};throw r}}async linkIdentity(e){var r;try{let{data:n,error:i}=await this._useSession(async o=>{var s,a,u,c,l;let{data:f,error:h}=o;if(h)throw h;let d=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,e.provider,{redirectTo:(s=e.options)===null||s===void 0?void 0:s.redirectTo,scopes:(a=e.options)===null||a===void 0?void 0:a.scopes,queryParams:(u=e.options)===null||u===void 0?void 0:u.queryParams,skipBrowserRedirect:!0});return await(0,ae._request)(this.fetch,"GET",d,{headers:this.headers,jwt:(l=(c=f.session)===null||c===void 0?void 0:c.access_token)!==null&&l!==void 0?l:void 0})});if(i)throw i;return(0,fe.isBrowser)()&&!(!((r=e.options)===null||r===void 0)&&r.skipBrowserRedirect)&&window.location.assign(n?.url),{data:{provider:e.provider,url:n?.url},error:null}}catch(n){if((0,Z.isAuthError)(n))return{data:{provider:e.provider,url:null},error:n};throw n}}async unlinkIdentity(e){try{return await this._useSession(async r=>{var n,i;let{data:o,error:s}=r;if(s)throw s;return await(0,ae._request)(this.fetch,"DELETE",`${this.url}/user/identities/${e.identity_id}`,{headers:this.headers,jwt:(i=(n=o.session)===null||n===void 0?void 0:n.access_token)!==null&&i!==void 0?i:void 0})})}catch(r){if((0,Z.isAuthError)(r))return{data:null,error:r};throw r}}async _refreshAccessToken(e){let r=`#_refreshAccessToken(${e.substring(0,5)}...)`;this._debug(r,"begin");try{let n=Date.now();return await(0,fe.retryable)(async i=>(i>0&&await(0,fe.sleep)(200*Math.pow(2,i-1)),this._debug(r,"refreshing attempt",i),await(0,ae._request)(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:e},headers:this.headers,xform:ae._sessionResponse})),(i,o)=>{let s=200*Math.pow(2,i);return o&&(0,Z.isAuthRetryableFetchError)(o)&&Date.now()+s-n<iu})}catch(n){if(this._debug(r,"error",n),(0,Z.isAuthError)(n))return{data:{session:null,user:null},error:n};throw n}finally{this._debug(r,"end")}}_isValidSession(e){return typeof e=="object"&&e!==null&&"access_token"in e&&"refresh_token"in e&&"expires_at"in e}async _handleProviderSignIn(e,r){let n=await this._getUrlForProvider(`${this.url}/authorize`,e,{redirectTo:r.redirectTo,scopes:r.scopes,queryParams:r.queryParams});return this._debug("#_handleProviderSignIn()","provider",e,"options",r,"url",n),(0,fe.isBrowser)()&&!r.skipBrowserRedirect&&window.location.assign(n),{data:{provider:e,url:n},error:null}}async _recoverAndRefresh(){var e;let r="#_recoverAndRefresh()";this._debug(r,"begin");try{let n=await(0,fe.getItemAsync)(this.storage,this.storageKey);if(this._debug(r,"session from storage",n),!this._isValidSession(n)){this._debug(r,"session is not valid"),n!==null&&await this._removeSession();return}let i=Math.round(Date.now()/1e3),o=((e=n.expires_at)!==null&&e!==void 0?e:1/0)<i+ou.EXPIRY_MARGIN;if(this._debug(r,`session has${o?"":" not"} expired with margin of ${ou.EXPIRY_MARGIN}s`),o){if(this.autoRefreshToken&&n.refresh_token){let{error:s}=await this._callRefreshToken(n.refresh_token);s&&(console.error(s),(0,Z.isAuthRetryableFetchError)(s)||(this._debug(r,"refresh failed with a non-retryable error, removing the session",s),await this._removeSession()))}}else await this._notifyAllSubscribers("SIGNED_IN",n)}catch(n){this._debug(r,"error",n),console.error(n);return}finally{this._debug(r,"end")}}async _callRefreshToken(e){var r,n;if(!e)throw new Z.AuthSessionMissingError;if(this.refreshingDeferred)return this.refreshingDeferred.promise;let i=`#_callRefreshToken(${e.substring(0,5)}...)`;this._debug(i,"begin");try{this.refreshingDeferred=new fe.Deferred;let{data:o,error:s}=await this._refreshAccessToken(e);if(s)throw s;if(!o.session)throw new Z.AuthSessionMissingError;await this._saveSession(o.session),await this._notifyAllSubscribers("TOKEN_REFRESHED",o.session);let a={session:o.session,error:null};return this.refreshingDeferred.resolve(a),a}catch(o){if(this._debug(i,"error",o),(0,Z.isAuthError)(o)){let s={session:null,error:o};return(0,Z.isAuthRetryableFetchError)(o)||await this._removeSession(),(r=this.refreshingDeferred)===null||r===void 0||r.resolve(s),s}throw(n=this.refreshingDeferred)===null||n===void 0||n.reject(o),o}finally{this.refreshingDeferred=null,this._debug(i,"end")}}async _notifyAllSubscribers(e,r,n=!0){let i=`#_notifyAllSubscribers(${e})`;this._debug(i,"begin",r,`broadcast = ${n}`);try{this.broadcastChannel&&n&&this.broadcastChannel.postMessage({event:e,session:r});let o=[],s=Array.from(this.stateChangeEmitters.values()).map(async a=>{try{await a.callback(e,r)}catch(u){o.push(u)}});if(await Promise.all(s),o.length>0){for(let a=0;a<o.length;a+=1)console.error(o[a]);throw o[0]}}finally{this._debug(i,"end")}}async _saveSession(e){this._debug("#_saveSession()",e),this.suppressGetSessionWarning=!0,await(0,fe.setItemAsync)(this.storage,this.storageKey,e)}async _removeSession(){this._debug("#_removeSession()"),await(0,fe.removeItemAsync)(this.storage,this.storageKey),await this._notifyAllSubscribers("SIGNED_OUT",null)}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()");let e=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{e&&(0,fe.isBrowser)()&&window?.removeEventListener&&window.removeEventListener("visibilitychange",e)}catch(r){console.error("removing visibilitychange callback failed",r)}}async _startAutoRefresh(){await this._stopAutoRefresh(),this._debug("#_startAutoRefresh()");let e=setInterval(()=>this._autoRefreshTokenTick(),iu);this.autoRefreshTicker=e,e&&typeof e=="object"&&typeof e.unref=="function"?e.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(e),setTimeout(async()=>{await this.initializePromise,await this._autoRefreshTokenTick()},0)}async _stopAutoRefresh(){this._debug("#_stopAutoRefresh()");let e=this.autoRefreshTicker;this.autoRefreshTicker=null,e&&clearInterval(e)}async startAutoRefresh(){this._removeVisibilityChangedCallback(),await this._startAutoRefresh()}async stopAutoRefresh(){this._removeVisibilityChangedCallback(),await this._stopAutoRefresh()}async _autoRefreshTokenTick(){this._debug("#_autoRefreshTokenTick()","begin");try{await this._acquireLock(0,async()=>{try{let e=Date.now();try{return await this._useSession(async r=>{let{data:{session:n}}=r;if(!n||!n.refresh_token||!n.expires_at){this._debug("#_autoRefreshTokenTick()","no session");return}let i=Math.floor((n.expires_at*1e3-e)/iu);this._debug("#_autoRefreshTokenTick()",`access token expires in ${i} ticks, a tick lasts ${iu}ms, refresh threshold is ${T_} ticks`),i<=T_&&await this._callRefreshToken(n.refresh_token)})}catch(r){console.error("Auto refresh tick failed with error. This is likely a transient error.",r)}}finally{this._debug("#_autoRefreshTokenTick()","end")}})}catch(e){if(e.isAcquireTimeout||e instanceof k_.LockAcquireTimeoutError)this._debug("auto refresh token tick lock not available");else throw e}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!(0,fe.isBrowser)()||!window?.addEventListener)return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>await this._onVisibilityChanged(!1),window?.addEventListener("visibilitychange",this.visibilityChangedCallback),await this._onVisibilityChanged(!0)}catch(e){console.error("_handleVisibilityChange",e)}}async _onVisibilityChanged(e){let r=`#_onVisibilityChanged(${e})`;this._debug(r,"visibilityState",document.visibilityState),document.visibilityState==="visible"?(this.autoRefreshToken&&this._startAutoRefresh(),e||(await this.initializePromise,await this._acquireLock(-1,async()=>{if(document.visibilityState!=="visible"){this._debug(r,"acquired the lock to recover the session, but the browser visibilityState is no longer visible, aborting");return}await this._recoverAndRefresh()}))):document.visibilityState==="hidden"&&this.autoRefreshToken&&this._stopAutoRefresh()}async _getUrlForProvider(e,r,n){let i=[`provider=${encodeURIComponent(r)}`];if(n?.redirectTo&&i.push(`redirect_to=${encodeURIComponent(n.redirectTo)}`),n?.scopes&&i.push(`scopes=${encodeURIComponent(n.scopes)}`),this.flowType==="pkce"){let[o,s]=await(0,fe.getCodeChallengeAndMethod)(this.storage,this.storageKey),a=new URLSearchParams({code_challenge:`${encodeURIComponent(o)}`,code_challenge_method:`${encodeURIComponent(s)}`});i.push(a.toString())}if(n?.queryParams){let o=new URLSearchParams(n.queryParams);i.push(o.toString())}return n?.skipBrowserRedirect&&i.push(`skip_http_redirect=${n.skipBrowserRedirect}`),`${e}?${i.join("&")}`}async _unenroll(e){try{return await this._useSession(async r=>{var n;let{data:i,error:o}=r;return o?{data:null,error:o}:await(0,ae._request)(this.fetch,"DELETE",`${this.url}/factors/${e.factorId}`,{headers:this.headers,jwt:(n=i?.session)===null||n===void 0?void 0:n.access_token})})}catch(r){if((0,Z.isAuthError)(r))return{data:null,error:r};throw r}}async _enroll(e){try{return await this._useSession(async r=>{var n,i;let{data:o,error:s}=r;if(s)return{data:null,error:s};let a=Object.assign({friendly_name:e.friendlyName,factor_type:e.factorType},e.factorType==="phone"?{phone:e.phone}:{issuer:e.issuer}),{data:u,error:c}=await(0,ae._request)(this.fetch,"POST",`${this.url}/factors`,{body:a,headers:this.headers,jwt:(n=o?.session)===null||n===void 0?void 0:n.access_token});return c?{data:null,error:c}:(e.factorType==="totp"&&(!((i=u?.totp)===null||i===void 0)&&i.qr_code)&&(u.totp.qr_code=`data:image/svg+xml;utf-8,${u.totp.qr_code}`),{data:u,error:null})})}catch(r){if((0,Z.isAuthError)(r))return{data:null,error:r};throw r}}async _verify(e){return this._acquireLock(-1,async()=>{try{return await this._useSession(async r=>{var n;let{data:i,error:o}=r;if(o)return{data:null,error:o};let{data:s,error:a}=await(0,ae._request)(this.fetch,"POST",`${this.url}/factors/${e.factorId}/verify`,{body:{code:e.code,challenge_id:e.challengeId},headers:this.headers,jwt:(n=i?.session)===null||n===void 0?void 0:n.access_token});return a?{data:null,error:a}:(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+s.expires_in},s)),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",s),{data:s,error:a})})}catch(r){if((0,Z.isAuthError)(r))return{data:null,error:r};throw r}})}async _challenge(e){return this._acquireLock(-1,async()=>{try{return await this._useSession(async r=>{var n;let{data:i,error:o}=r;return o?{data:null,error:o}:await(0,ae._request)(this.fetch,"POST",`${this.url}/factors/${e.factorId}/challenge`,{body:{channel:e.channel},headers:this.headers,jwt:(n=i?.session)===null||n===void 0?void 0:n.access_token})})}catch(r){if((0,Z.isAuthError)(r))return{data:null,error:r};throw r}})}async _challengeAndVerify(e){let{data:r,error:n}=await this._challenge({factorId:e.factorId});return n?{data:null,error:n}:await this._verify({factorId:e.factorId,challengeId:r.id,code:e.code})}async _listFactors(){let{data:{user:e},error:r}=await this.getUser();if(r)return{data:null,error:r};let n=e?.factors||[],i=n.filter(s=>s.factor_type==="totp"&&s.status==="verified"),o=n.filter(s=>s.factor_type==="phone"&&s.status==="verified");return{data:{all:n,totp:i,phone:o},error:null}}async _getAuthenticatorAssuranceLevel(){return this._acquireLock(-1,async()=>await this._useSession(async e=>{var r,n;let{data:{session:i},error:o}=e;if(o)return{data:null,error:o};if(!i)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};let s=this._decodeJWT(i.access_token),a=null;s.aal&&(a=s.aal);let u=a;((n=(r=i.user.factors)===null||r===void 0?void 0:r.filter(f=>f.status==="verified"))!==null&&n!==void 0?n:[]).length>0&&(u="aal2");let l=s.amr||[];return{data:{currentLevel:a,nextLevel:u,currentAuthenticationMethods:l},error:null}}))}};su.default=Pl;Pl.nextInstanceID=0});var R_=y(au=>{"use strict";var o4=au&&au.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(au,"__esModule",{value:!0});var s4=o4(Ol()),a4=s4.default;au.default=a4});var $_=y(uu=>{"use strict";var u4=uu&&uu.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(uu,"__esModule",{value:!0});var c4=u4(Gm()),l4=c4.default;uu.default=l4});var j_=y(I_=>{"use strict";Object.defineProperty(I_,"__esModule",{value:!0})});var Km=y(je=>{"use strict";var f4=je&&je.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),N_=je&&je.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&f4(e,t,r)},Rl=je&&je.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(je,"__esModule",{value:!0});je.lockInternals=je.NavigatorLockAcquireTimeoutError=je.navigatorLock=je.AuthClient=je.AuthAdminApi=je.GoTrueClient=je.GoTrueAdminApi=void 0;var d4=Rl(Ol());je.GoTrueAdminApi=d4.default;var h4=Rl(Gm());je.GoTrueClient=h4.default;var p4=Rl(R_());je.AuthAdminApi=p4.default;var m4=Rl($_());je.AuthClient=m4.default;N_(j_(),je);N_(ru(),je);var Wm=Hm();Object.defineProperty(je,"navigatorLock",{enumerable:!0,get:function(){return Wm.navigatorLock}});Object.defineProperty(je,"NavigatorLockAcquireTimeoutError",{enumerable:!0,get:function(){return Wm.NavigatorLockAcquireTimeoutError}});Object.defineProperty(je,"lockInternals",{enumerable:!0,get:function(){return Wm.internals}})});var L_=y($l=>{"use strict";Object.defineProperty($l,"__esModule",{value:!0});$l.SupabaseAuthClient=void 0;var g4=Km(),Ym=class extends g4.AuthClient{constructor(e){super(e)}};$l.SupabaseAuthClient=Ym});var Xm=y(cu=>{"use strict";var y4=cu&&cu.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(l){try{c(n.next(l))}catch(f){s(f)}}function u(l){try{c(n.throw(l))}catch(f){s(f)}}function c(l){l.done?o(l.value):i(l.value).then(a,u)}c((n=n.apply(t,e||[])).next())})};Object.defineProperty(cu,"__esModule",{value:!0});var D4=sm(),v4=o_(),b4=(bm(),ke(vm)),w4=D_(),Il=b_(),_4=__(),B_=E_(),E4=L_(),Jm=class{constructor(e,r,n){var i,o,s;if(this.supabaseUrl=e,this.supabaseKey=r,!e)throw new Error("supabaseUrl is required.");if(!r)throw new Error("supabaseKey is required.");let a=(0,B_.stripTrailingSlash)(e);this.realtimeUrl=`${a}/realtime/v1`.replace(/^http/i,"ws"),this.authUrl=`${a}/auth/v1`,this.storageUrl=`${a}/storage/v1`,this.functionsUrl=`${a}/functions/v1`;let u=`sb-${new URL(this.authUrl).hostname.split(".")[0]}-auth-token`,c={db:Il.DEFAULT_DB_OPTIONS,realtime:Il.DEFAULT_REALTIME_OPTIONS,auth:Object.assign(Object.assign({},Il.DEFAULT_AUTH_OPTIONS),{storageKey:u}),global:Il.DEFAULT_GLOBAL_OPTIONS},l=(0,B_.applySettingDefaults)(n??{},c);this.storageKey=(i=l.auth.storageKey)!==null&&i!==void 0?i:"",this.headers=(o=l.global.headers)!==null&&o!==void 0?o:{},l.accessToken?(this.accessToken=l.accessToken,this.auth=new Proxy({},{get:(f,h)=>{throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(h)} is not possible`)}})):this.auth=this._initSupabaseAuthClient((s=l.auth)!==null&&s!==void 0?s:{},this.headers,l.global.fetch),this.fetch=(0,_4.fetchWithAuth)(r,this._getAccessToken.bind(this),l.global.fetch),this.realtime=this._initRealtimeClient(Object.assign({headers:this.headers},l.realtime)),this.rest=new v4.PostgrestClient(`${a}/rest/v1`,{headers:this.headers,schema:l.db.schema,fetch:this.fetch}),l.accessToken||this._listenForAuthEvents()}get functions(){return new D4.FunctionsClient(this.functionsUrl,{headers:this.headers,customFetch:this.fetch})}get storage(){return new w4.StorageClient(this.storageUrl,this.headers,this.fetch)}from(e){return this.rest.from(e)}schema(e){return this.rest.schema(e)}rpc(e,r={},n={}){return this.rest.rpc(e,r,n)}channel(e,r={config:{}}){return this.realtime.channel(e,r)}getChannels(){return this.realtime.getChannels()}removeChannel(e){return this.realtime.removeChannel(e)}removeAllChannels(){return this.realtime.removeAllChannels()}_getAccessToken(){var e,r;return y4(this,void 0,void 0,function*(){if(this.accessToken)return yield this.accessToken();let{data:n}=yield this.auth.getSession();return(r=(e=n.session)===null||e===void 0?void 0:e.access_token)!==null&&r!==void 0?r:null})}_initSupabaseAuthClient({autoRefreshToken:e,persistSession:r,detectSessionInUrl:n,storage:i,storageKey:o,flowType:s,lock:a,debug:u},c,l){var f;let h={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new E4.SupabaseAuthClient({url:this.authUrl,headers:Object.assign(Object.assign({},h),c),storageKey:o,autoRefreshToken:e,persistSession:r,detectSessionInUrl:n,storage:i,flowType:s,lock:a,debug:u,fetch:l,hasCustomAuthorizationHeader:(f="Authorization"in this.headers)!==null&&f!==void 0?f:!1})}_initRealtimeClient(e){return new b4.RealtimeClient(this.realtimeUrl,Object.assign(Object.assign({},e),{params:Object.assign({apikey:this.supabaseKey},e?.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((r,n)=>{this._handleTokenChanged(r,"CLIENT",n?.access_token)})}_handleTokenChanged(e,r,n){(e==="TOKEN_REFRESHED"||e==="SIGNED_IN")&&this.changedAccessToken!==n?(this.realtime.setAuth(n??null),this.changedAccessToken=n):e==="SIGNED_OUT"&&(this.realtime.setAuth(this.supabaseKey),r=="STORAGE"&&this.auth.signOut(),this.changedAccessToken=void 0)}};cu.default=Jm});var U_=y(Ne=>{"use strict";var C4=Ne&&Ne.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),q_=Ne&&Ne.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&C4(e,t,r)},M_=Ne&&Ne.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ne,"__esModule",{value:!0});Ne.createClient=Ne.SupabaseClient=Ne.FunctionRegion=Ne.FunctionsError=Ne.FunctionsRelayError=Ne.FunctionsFetchError=Ne.FunctionsHttpError=void 0;var S4=M_(Xm());q_(Km(),Ne);var lu=sm();Object.defineProperty(Ne,"FunctionsHttpError",{enumerable:!0,get:function(){return lu.FunctionsHttpError}});Object.defineProperty(Ne,"FunctionsFetchError",{enumerable:!0,get:function(){return lu.FunctionsFetchError}});Object.defineProperty(Ne,"FunctionsRelayError",{enumerable:!0,get:function(){return lu.FunctionsRelayError}});Object.defineProperty(Ne,"FunctionsError",{enumerable:!0,get:function(){return lu.FunctionsError}});Object.defineProperty(Ne,"FunctionRegion",{enumerable:!0,get:function(){return lu.FunctionRegion}});q_((bm(),ke(vm)),Ne);var x4=Xm();Object.defineProperty(Ne,"SupabaseClient",{enumerable:!0,get:function(){return M_(x4).default}});var F4=(t,e,r)=>new S4.default(t,e,r);Ne.createClient=F4});var Zm=y((Nle,V_)=>{V_.exports=require("stream")});var Y_=y((Lle,K_)=>{"use strict";function H_(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function z_(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?H_(Object(r),!0).forEach(function(n){O4(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):H_(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function O4(t,e,r){return e=W_(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function A4(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function G_(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,W_(n.key),n)}}function k4(t,e,r){return e&&G_(t.prototype,e),r&&G_(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function W_(t){var e=T4(t,"string");return typeof e=="symbol"?e:String(e)}function T4(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var P4=require("buffer"),jl=P4.Buffer,R4=require("util"),Qm=R4.inspect,$4=Qm&&Qm.custom||"inspect";function I4(t,e,r){jl.prototype.copy.call(t,e,r)}K_.exports=function(){function t(){A4(this,t),this.head=null,this.tail=null,this.length=0}return k4(t,[{key:"push",value:function(r){var n={data:r,next:null};this.length>0?this.tail.next=n:this.head=n,this.tail=n,++this.length}},{key:"unshift",value:function(r){var n={data:r,next:this.head};this.length===0&&(this.tail=n),this.head=n,++this.length}},{key:"shift",value:function(){if(this.length!==0){var r=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,r}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(r){if(this.length===0)return"";for(var n=this.head,i=""+n.data;n=n.next;)i+=r+n.data;return i}},{key:"concat",value:function(r){if(this.length===0)return jl.alloc(0);for(var n=jl.allocUnsafe(r>>>0),i=this.head,o=0;i;)I4(i.data,n,o),o+=i.data.length,i=i.next;return n}},{key:"consume",value:function(r,n){var i;return r<this.head.data.length?(i=this.head.data.slice(0,r),this.head.data=this.head.data.slice(r)):r===this.head.data.length?i=this.shift():i=n?this._getString(r):this._getBuffer(r),i}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(r){var n=this.head,i=1,o=n.data;for(r-=o.length;n=n.next;){var s=n.data,a=r>s.length?s.length:r;if(a===s.length?o+=s:o+=s.slice(0,r),r-=a,r===0){a===s.length?(++i,n.next?this.head=n.next:this.head=this.tail=null):(this.head=n,n.data=s.slice(a));break}++i}return this.length-=i,o}},{key:"_getBuffer",value:function(r){var n=jl.allocUnsafe(r),i=this.head,o=1;for(i.data.copy(n),r-=i.data.length;i=i.next;){var s=i.data,a=r>s.length?s.length:r;if(s.copy(n,n.length-r,0,a),r-=a,r===0){a===s.length?(++o,i.next?this.head=i.next:this.head=this.tail=null):(this.head=i,i.data=s.slice(a));break}++o}return this.length-=o,n}},{key:$4,value:function(r,n){return Qm(this,z_(z_({},n),{},{depth:0,customInspect:!1}))}}]),t}()});var tg=y((Ble,X_)=>{"use strict";function j4(t,e){var r=this,n=this._readableState&&this._readableState.destroyed,i=this._writableState&&this._writableState.destroyed;return n||i?(e?e(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(eg,this,t)):process.nextTick(eg,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,function(o){!e&&o?r._writableState?r._writableState.errorEmitted?process.nextTick(Nl,r):(r._writableState.errorEmitted=!0,process.nextTick(J_,r,o)):process.nextTick(J_,r,o):e?(process.nextTick(Nl,r),e(o)):process.nextTick(Nl,r)}),this)}function J_(t,e){eg(t,e),Nl(t)}function Nl(t){t._writableState&&!t._writableState.emitClose||t._readableState&&!t._readableState.emitClose||t.emit("close")}function N4(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function eg(t,e){t.emit("error",e)}function L4(t,e){var r=t._readableState,n=t._writableState;r&&r.autoDestroy||n&&n.autoDestroy?t.destroy(e):t.emit("error",e)}X_.exports={destroy:j4,undestroy:N4,errorOrDestroy:L4}});var Yn=y((qle,eE)=>{"use strict";var Q_={};function gr(t,e,r){r||(r=Error);function n(o,s,a){return typeof e=="string"?e:e(o,s,a)}class i extends r{constructor(s,a,u){super(n(s,a,u))}}i.prototype.name=r.name,i.prototype.code=t,Q_[t]=i}function Z_(t,e){if(Array.isArray(t)){let r=t.length;return t=t.map(n=>String(n)),r>2?`one of ${e} ${t.slice(0,r-1).join(", ")}, or `+t[r-1]:r===2?`one of ${e} ${t[0]} or ${t[1]}`:`of ${e} ${t[0]}`}else return`of ${e} ${String(t)}`}function B4(t,e,r){return t.substr(!r||r<0?0:+r,e.length)===e}function q4(t,e,r){return(r===void 0||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}function M4(t,e,r){return typeof r!="number"&&(r=0),r+e.length>t.length?!1:t.indexOf(e,r)!==-1}gr("ERR_INVALID_OPT_VALUE",function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'},TypeError);gr("ERR_INVALID_ARG_TYPE",function(t,e,r){let n;typeof e=="string"&&B4(e,"not ")?(n="must not be",e=e.replace(/^not /,"")):n="must be";let i;if(q4(t," argument"))i=`The ${t} ${n} ${Z_(e,"type")}`;else{let o=M4(t,".")?"property":"argument";i=`The "${t}" ${o} ${n} ${Z_(e,"type")}`}return i+=`. Received type ${typeof r}`,i},TypeError);gr("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");gr("ERR_METHOD_NOT_IMPLEMENTED",function(t){return"The "+t+" method is not implemented"});gr("ERR_STREAM_PREMATURE_CLOSE","Premature close");gr("ERR_STREAM_DESTROYED",function(t){return"Cannot call "+t+" after a stream was destroyed"});gr("ERR_MULTIPLE_CALLBACK","Callback called multiple times");gr("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");gr("ERR_STREAM_WRITE_AFTER_END","write after end");gr("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);gr("ERR_UNKNOWN_ENCODING",function(t){return"Unknown encoding: "+t},TypeError);gr("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");eE.exports.codes=Q_});var rg=y((Mle,tE)=>{"use strict";var U4=Yn().codes.ERR_INVALID_OPT_VALUE;function V4(t,e,r){return t.highWaterMark!=null?t.highWaterMark:e?t[r]:null}function H4(t,e,r,n){var i=V4(e,n,r);if(i!=null){if(!(isFinite(i)&&Math.floor(i)===i)||i<0){var o=n?r:"highWaterMark";throw new U4(o,i)}return Math.floor(i)}return t.objectMode?16:16*1024}tE.exports={getHighWaterMark:H4}});var rE=y((Ule,ng)=>{typeof Object.create=="function"?ng.exports=function(e,r){r&&(e.super_=r,e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:ng.exports=function(e,r){if(r){e.super_=r;var n=function(){};n.prototype=r.prototype,e.prototype=new n,e.prototype.constructor=e}}});var Zo=y((Vle,og)=>{try{if(ig=require("util"),typeof ig.inherits!="function")throw"";og.exports=ig.inherits}catch{og.exports=rE()}var ig});var iE=y((Hle,nE)=>{nE.exports=require("util").deprecate});var ug=y((zle,lE)=>{"use strict";lE.exports=Ye;function sE(t){var e=this;this.next=null,this.entry=null,this.finish=function(){y5(e,t)}}var Qo;Ye.WritableState=du;var z4={deprecate:iE()},aE=Zm(),Bl=require("buffer").Buffer,G4=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function W4(t){return Bl.from(t)}function K4(t){return Bl.isBuffer(t)||t instanceof G4}var ag=tg(),Y4=rg(),J4=Y4.getHighWaterMark,Jn=Yn().codes,X4=Jn.ERR_INVALID_ARG_TYPE,Z4=Jn.ERR_METHOD_NOT_IMPLEMENTED,Q4=Jn.ERR_MULTIPLE_CALLBACK,e5=Jn.ERR_STREAM_CANNOT_PIPE,t5=Jn.ERR_STREAM_DESTROYED,r5=Jn.ERR_STREAM_NULL_VALUES,n5=Jn.ERR_STREAM_WRITE_AFTER_END,i5=Jn.ERR_UNKNOWN_ENCODING,es=ag.errorOrDestroy;Zo()(Ye,aE);function o5(){}function du(t,e,r){Qo=Qo||Ti(),t=t||{},typeof r!="boolean"&&(r=e instanceof Qo),this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=J4(this,t,"writableHighWaterMark",r),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var n=t.decodeStrings===!1;this.decodeStrings=!n,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(i){d5(e,i)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=t.emitClose!==!1,this.autoDestroy=!!t.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new sE(this)}du.prototype.getBuffer=function(){for(var e=this.bufferedRequest,r=[];e;)r.push(e),e=e.next;return r};(function(){try{Object.defineProperty(du.prototype,"buffer",{get:z4.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var Ll;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(Ll=Function.prototype[Symbol.hasInstance],Object.defineProperty(Ye,Symbol.hasInstance,{value:function(e){return Ll.call(this,e)?!0:this!==Ye?!1:e&&e._writableState instanceof du}})):Ll=function(e){return e instanceof this};function Ye(t){Qo=Qo||Ti();var e=this instanceof Qo;if(!e&&!Ll.call(Ye,this))return new Ye(t);this._writableState=new du(t,this,e),this.writable=!0,t&&(typeof t.write=="function"&&(this._write=t.write),typeof t.writev=="function"&&(this._writev=t.writev),typeof t.destroy=="function"&&(this._destroy=t.destroy),typeof t.final=="function"&&(this._final=t.final)),aE.call(this)}Ye.prototype.pipe=function(){es(this,new e5)};function s5(t,e){var r=new n5;es(t,r),process.nextTick(e,r)}function a5(t,e,r,n){var i;return r===null?i=new r5:typeof r!="string"&&!e.objectMode&&(i=new X4("chunk",["string","Buffer"],r)),i?(es(t,i),process.nextTick(n,i),!1):!0}Ye.prototype.write=function(t,e,r){var n=this._writableState,i=!1,o=!n.objectMode&&K4(t);return o&&!Bl.isBuffer(t)&&(t=W4(t)),typeof e=="function"&&(r=e,e=null),o?e="buffer":e||(e=n.defaultEncoding),typeof r!="function"&&(r=o5),n.ending?s5(this,r):(o||a5(this,n,t,r))&&(n.pendingcb++,i=c5(this,n,o,t,e,r)),i};Ye.prototype.cork=function(){this._writableState.corked++};Ye.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,!t.writing&&!t.corked&&!t.bufferProcessing&&t.bufferedRequest&&uE(this,t))};Ye.prototype.setDefaultEncoding=function(e){if(typeof e=="string"&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new i5(e);return this._writableState.defaultEncoding=e,this};Object.defineProperty(Ye.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function u5(t,e,r){return!t.objectMode&&t.decodeStrings!==!1&&typeof e=="string"&&(e=Bl.from(e,r)),e}Object.defineProperty(Ye.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function c5(t,e,r,n,i,o){if(!r){var s=u5(e,n,i);n!==s&&(r=!0,i="buffer",n=s)}var a=e.objectMode?1:n.length;e.length+=a;var u=e.length<e.highWaterMark;if(u||(e.needDrain=!0),e.writing||e.corked){var c=e.lastBufferedRequest;e.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:o,next:null},c?c.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1}else sg(t,e,!1,a,n,i,o);return u}function sg(t,e,r,n,i,o,s){e.writelen=n,e.writecb=s,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new t5("write")):r?t._writev(i,e.onwrite):t._write(i,o,e.onwrite),e.sync=!1}function l5(t,e,r,n,i){--e.pendingcb,r?(process.nextTick(i,n),process.nextTick(fu,t,e),t._writableState.errorEmitted=!0,es(t,n)):(i(n),t._writableState.errorEmitted=!0,es(t,n),fu(t,e))}function f5(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}function d5(t,e){var r=t._writableState,n=r.sync,i=r.writecb;if(typeof i!="function")throw new Q4;if(f5(r),e)l5(t,r,n,e,i);else{var o=cE(r)||t.destroyed;!o&&!r.corked&&!r.bufferProcessing&&r.bufferedRequest&&uE(t,r),n?process.nextTick(oE,t,r,o,i):oE(t,r,o,i)}}function oE(t,e,r,n){r||h5(t,e),e.pendingcb--,n(),fu(t,e)}function h5(t,e){e.length===0&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}function uE(t,e){e.bufferProcessing=!0;var r=e.bufferedRequest;if(t._writev&&r&&r.next){var n=e.bufferedRequestCount,i=new Array(n),o=e.corkedRequestsFree;o.entry=r;for(var s=0,a=!0;r;)i[s]=r,r.isBuf||(a=!1),r=r.next,s+=1;i.allBuffers=a,sg(t,e,!0,e.length,i,"",o.finish),e.pendingcb++,e.lastBufferedRequest=null,o.next?(e.corkedRequestsFree=o.next,o.next=null):e.corkedRequestsFree=new sE(e),e.bufferedRequestCount=0}else{for(;r;){var u=r.chunk,c=r.encoding,l=r.callback,f=e.objectMode?1:u.length;if(sg(t,e,!1,f,u,c,l),r=r.next,e.bufferedRequestCount--,e.writing)break}r===null&&(e.lastBufferedRequest=null)}e.bufferedRequest=r,e.bufferProcessing=!1}Ye.prototype._write=function(t,e,r){r(new Z4("_write()"))};Ye.prototype._writev=null;Ye.prototype.end=function(t,e,r){var n=this._writableState;return typeof t=="function"?(r=t,t=null,e=null):typeof e=="function"&&(r=e,e=null),t!=null&&this.write(t,e),n.corked&&(n.corked=1,this.uncork()),n.ending||g5(this,n,r),this};Object.defineProperty(Ye.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function cE(t){return t.ending&&t.length===0&&t.bufferedRequest===null&&!t.finished&&!t.writing}function p5(t,e){t._final(function(r){e.pendingcb--,r&&es(t,r),e.prefinished=!0,t.emit("prefinish"),fu(t,e)})}function m5(t,e){!e.prefinished&&!e.finalCalled&&(typeof t._final=="function"&&!e.destroyed?(e.pendingcb++,e.finalCalled=!0,process.nextTick(p5,t,e)):(e.prefinished=!0,t.emit("prefinish")))}function fu(t,e){var r=cE(e);if(r&&(m5(t,e),e.pendingcb===0&&(e.finished=!0,t.emit("finish"),e.autoDestroy))){var n=t._readableState;(!n||n.autoDestroy&&n.endEmitted)&&t.destroy()}return r}function g5(t,e,r){e.ending=!0,fu(t,e),r&&(e.finished?process.nextTick(r):t.once("finish",r)),e.ended=!0,t.writable=!1}function y5(t,e,r){var n=t.entry;for(t.entry=null;n;){var i=n.callback;e.pendingcb--,i(r),n=n.next}e.corkedRequestsFree.next=t}Object.defineProperty(Ye.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}});Ye.prototype.destroy=ag.destroy;Ye.prototype._undestroy=ag.undestroy;Ye.prototype._destroy=function(t,e){e(t)}});var Ti=y((Gle,dE)=>{"use strict";var D5=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};dE.exports=Ur;var fE=fg(),lg=ug();Zo()(Ur,fE);for(cg=D5(lg.prototype),ql=0;ql<cg.length;ql++)Ml=cg[ql],Ur.prototype[Ml]||(Ur.prototype[Ml]=lg.prototype[Ml]);var cg,Ml,ql;function Ur(t){if(!(this instanceof Ur))return new Ur(t);fE.call(this,t),lg.call(this,t),this.allowHalfOpen=!0,t&&(t.readable===!1&&(this.readable=!1),t.writable===!1&&(this.writable=!1),t.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",v5)))}Object.defineProperty(Ur.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});Object.defineProperty(Ur.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});Object.defineProperty(Ur.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function v5(){this._writableState.ended||process.nextTick(b5,this)}function b5(t){t.end()}Object.defineProperty(Ur.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(e){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=e,this._writableState.destroyed=e)}})});var mE=y((dg,pE)=>{var Ul=require("buffer"),Vr=Ul.Buffer;function hE(t,e){for(var r in t)e[r]=t[r]}Vr.from&&Vr.alloc&&Vr.allocUnsafe&&Vr.allocUnsafeSlow?pE.exports=Ul:(hE(Ul,dg),dg.Buffer=Pi);function Pi(t,e,r){return Vr(t,e,r)}Pi.prototype=Object.create(Vr.prototype);hE(Vr,Pi);Pi.from=function(t,e,r){if(typeof t=="number")throw new TypeError("Argument must not be a number");return Vr(t,e,r)};Pi.alloc=function(t,e,r){if(typeof t!="number")throw new TypeError("Argument must be a number");var n=Vr(t);return e!==void 0?typeof r=="string"?n.fill(e,r):n.fill(e):n.fill(0),n};Pi.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return Vr(t)};Pi.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return Ul.SlowBuffer(t)}});var mg=y(yE=>{"use strict";var pg=mE().Buffer,gE=pg.isEncoding||function(t){switch(t=""+t,t&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function w5(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}function _5(t){var e=w5(t);if(typeof e!="string"&&(pg.isEncoding===gE||!gE(t)))throw new Error("Unknown encoding: "+t);return e||t}yE.StringDecoder=hu;function hu(t){this.encoding=_5(t);var e;switch(this.encoding){case"utf16le":this.text=O5,this.end=A5,e=4;break;case"utf8":this.fillLast=S5,e=4;break;case"base64":this.text=k5,this.end=T5,e=3;break;default:this.write=P5,this.end=R5;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=pg.allocUnsafe(e)}hu.prototype.write=function(t){if(t.length===0)return"";var e,r;if(this.lastNeed){if(e=this.fillLast(t),e===void 0)return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<t.length?e?e+this.text(t,r):this.text(t,r):e||""};hu.prototype.end=F5;hu.prototype.text=x5;hu.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length};function hg(t){return t<=127?0:t>>5===6?2:t>>4===14?3:t>>3===30?4:t>>6===2?-1:-2}function E5(t,e,r){var n=e.length-1;if(n<r)return 0;var i=hg(e[n]);return i>=0?(i>0&&(t.lastNeed=i-1),i):--n<r||i===-2?0:(i=hg(e[n]),i>=0?(i>0&&(t.lastNeed=i-2),i):--n<r||i===-2?0:(i=hg(e[n]),i>=0?(i>0&&(i===2?i=0:t.lastNeed=i-3),i):0))}function C5(t,e,r){if((e[0]&192)!==128)return t.lastNeed=0,"\uFFFD";if(t.lastNeed>1&&e.length>1){if((e[1]&192)!==128)return t.lastNeed=1,"\uFFFD";if(t.lastNeed>2&&e.length>2&&(e[2]&192)!==128)return t.lastNeed=2,"\uFFFD"}}function S5(t){var e=this.lastTotal-this.lastNeed,r=C5(this,t,e);if(r!==void 0)return r;if(this.lastNeed<=t.length)return t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,e,0,t.length),this.lastNeed-=t.length}function x5(t,e){var r=E5(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var n=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,n),t.toString("utf8",e,n)}function F5(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"\uFFFD":e}function O5(t,e){if((t.length-e)%2===0){var r=t.toString("utf16le",e);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function A5(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function k5(t,e){var r=(t.length-e)%3;return r===0?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,r===1?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function T5(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function P5(t){return t.toString(this.encoding)}function R5(t){return t&&t.length?this.write(t):""}});var Vl=y((Kle,bE)=>{"use strict";var DE=Yn().codes.ERR_STREAM_PREMATURE_CLOSE;function $5(t){var e=!1;return function(){if(!e){e=!0;for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];t.apply(this,n)}}}function I5(){}function j5(t){return t.setHeader&&typeof t.abort=="function"}function vE(t,e,r){if(typeof e=="function")return vE(t,null,e);e||(e={}),r=$5(r||I5);var n=e.readable||e.readable!==!1&&t.readable,i=e.writable||e.writable!==!1&&t.writable,o=function(){t.writable||a()},s=t._writableState&&t._writableState.finished,a=function(){i=!1,s=!0,n||r.call(t)},u=t._readableState&&t._readableState.endEmitted,c=function(){n=!1,u=!0,i||r.call(t)},l=function(p){r.call(t,p)},f=function(){var p;if(n&&!u)return(!t._readableState||!t._readableState.ended)&&(p=new DE),r.call(t,p);if(i&&!s)return(!t._writableState||!t._writableState.ended)&&(p=new DE),r.call(t,p)},h=function(){t.req.on("finish",a)};return j5(t)?(t.on("complete",a),t.on("abort",f),t.req?h():t.on("request",h)):i&&!t._writableState&&(t.on("end",o),t.on("close",o)),t.on("end",c),t.on("finish",a),e.error!==!1&&t.on("error",l),t.on("close",f),function(){t.removeListener("complete",a),t.removeListener("abort",f),t.removeListener("request",h),t.req&&t.req.removeListener("finish",a),t.removeListener("end",o),t.removeListener("close",o),t.removeListener("finish",a),t.removeListener("end",c),t.removeListener("error",l),t.removeListener("close",f)}}bE.exports=vE});var _E=y((Yle,wE)=>{"use strict";var Hl;function Xn(t,e,r){return e=N5(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function N5(t){var e=L5(t,"string");return typeof e=="symbol"?e:String(e)}function L5(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var B5=Vl(),Zn=Symbol("lastResolve"),Ri=Symbol("lastReject"),pu=Symbol("error"),zl=Symbol("ended"),$i=Symbol("lastPromise"),gg=Symbol("handlePromise"),Ii=Symbol("stream");function Qn(t,e){return{value:t,done:e}}function q5(t){var e=t[Zn];if(e!==null){var r=t[Ii].read();r!==null&&(t[$i]=null,t[Zn]=null,t[Ri]=null,e(Qn(r,!1)))}}function M5(t){process.nextTick(q5,t)}function U5(t,e){return function(r,n){t.then(function(){if(e[zl]){r(Qn(void 0,!0));return}e[gg](r,n)},n)}}var V5=Object.getPrototypeOf(function(){}),H5=Object.setPrototypeOf((Hl={get stream(){return this[Ii]},next:function(){var e=this,r=this[pu];if(r!==null)return Promise.reject(r);if(this[zl])return Promise.resolve(Qn(void 0,!0));if(this[Ii].destroyed)return new Promise(function(s,a){process.nextTick(function(){e[pu]?a(e[pu]):s(Qn(void 0,!0))})});var n=this[$i],i;if(n)i=new Promise(U5(n,this));else{var o=this[Ii].read();if(o!==null)return Promise.resolve(Qn(o,!1));i=new Promise(this[gg])}return this[$i]=i,i}},Xn(Hl,Symbol.asyncIterator,function(){return this}),Xn(Hl,"return",function(){var e=this;return new Promise(function(r,n){e[Ii].destroy(null,function(i){if(i){n(i);return}r(Qn(void 0,!0))})})}),Hl),V5),z5=function(e){var r,n=Object.create(H5,(r={},Xn(r,Ii,{value:e,writable:!0}),Xn(r,Zn,{value:null,writable:!0}),Xn(r,Ri,{value:null,writable:!0}),Xn(r,pu,{value:null,writable:!0}),Xn(r,zl,{value:e._readableState.endEmitted,writable:!0}),Xn(r,gg,{value:function(o,s){var a=n[Ii].read();a?(n[$i]=null,n[Zn]=null,n[Ri]=null,o(Qn(a,!1))):(n[Zn]=o,n[Ri]=s)},writable:!0}),r));return n[$i]=null,B5(e,function(i){if(i&&i.code!=="ERR_STREAM_PREMATURE_CLOSE"){var o=n[Ri];o!==null&&(n[$i]=null,n[Zn]=null,n[Ri]=null,o(i)),n[pu]=i;return}var s=n[Zn];s!==null&&(n[$i]=null,n[Zn]=null,n[Ri]=null,s(Qn(void 0,!0))),n[zl]=!0}),e.on("readable",M5.bind(null,n)),n};wE.exports=z5});var xE=y((Jle,SE)=>{"use strict";function EE(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(c){r(c);return}a.done?e(u):Promise.resolve(u).then(n,i)}function G5(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function s(u){EE(o,n,i,s,a,"next",u)}function a(u){EE(o,n,i,s,a,"throw",u)}s(void 0)})}}function CE(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function W5(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?CE(Object(r),!0).forEach(function(n){K5(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):CE(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function K5(t,e,r){return e=Y5(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Y5(t){var e=J5(t,"string");return typeof e=="symbol"?e:String(e)}function J5(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var X5=Yn().codes.ERR_INVALID_ARG_TYPE;function Z5(t,e,r){var n;if(e&&typeof e.next=="function")n=e;else if(e&&e[Symbol.asyncIterator])n=e[Symbol.asyncIterator]();else if(e&&e[Symbol.iterator])n=e[Symbol.iterator]();else throw new X5("iterable",["Iterable"],e);var i=new t(W5({objectMode:!0},r)),o=!1;i._read=function(){o||(o=!0,s())};function s(){return a.apply(this,arguments)}function a(){return a=G5(function*(){try{var u=yield n.next(),c=u.value,l=u.done;l?i.push(null):i.push(yield c)?s():o=!1}catch(f){i.destroy(f)}}),a.apply(this,arguments)}return i}SE.exports=Z5});var fg=y((Zle,jE)=>{"use strict";jE.exports=ye;var ts;ye.ReadableState=kE;var Xle=require("events").EventEmitter,AE=function(e,r){return e.listeners(r).length},gu=Zm(),Gl=require("buffer").Buffer,Q5=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function eU(t){return Gl.from(t)}function tU(t){return Gl.isBuffer(t)||t instanceof Q5}var yg=require("util"),ue;yg&&yg.debuglog?ue=yg.debuglog("stream"):ue=function(){};var rU=Y_(),Cg=tg(),nU=rg(),iU=nU.getHighWaterMark,Wl=Yn().codes,oU=Wl.ERR_INVALID_ARG_TYPE,sU=Wl.ERR_STREAM_PUSH_AFTER_EOF,aU=Wl.ERR_METHOD_NOT_IMPLEMENTED,uU=Wl.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,rs,Dg,vg;Zo()(ye,gu);var mu=Cg.errorOrDestroy,bg=["error","close","destroy","pause","resume"];function cU(t,e,r){if(typeof t.prependListener=="function")return t.prependListener(e,r);!t._events||!t._events[e]?t.on(e,r):Array.isArray(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]}function kE(t,e,r){ts=ts||Ti(),t=t||{},typeof r!="boolean"&&(r=e instanceof ts),this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=iU(this,t,"readableHighWaterMark",r),this.buffer=new rU,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=t.emitClose!==!1,this.autoDestroy=!!t.autoDestroy,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(rs||(rs=mg().StringDecoder),this.decoder=new rs(t.encoding),this.encoding=t.encoding)}function ye(t){if(ts=ts||Ti(),!(this instanceof ye))return new ye(t);var e=this instanceof ts;this._readableState=new kE(t,this,e),this.readable=!0,t&&(typeof t.read=="function"&&(this._read=t.read),typeof t.destroy=="function"&&(this._destroy=t.destroy)),gu.call(this)}Object.defineProperty(ye.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}});ye.prototype.destroy=Cg.destroy;ye.prototype._undestroy=Cg.undestroy;ye.prototype._destroy=function(t,e){e(t)};ye.prototype.push=function(t,e){var r=this._readableState,n;return r.objectMode?n=!0:typeof t=="string"&&(e=e||r.defaultEncoding,e!==r.encoding&&(t=Gl.from(t,e),e=""),n=!0),TE(this,t,e,!1,n)};ye.prototype.unshift=function(t){return TE(this,t,null,!0,!1)};function TE(t,e,r,n,i){ue("readableAddChunk",e);var o=t._readableState;if(e===null)o.reading=!1,dU(t,o);else{var s;if(i||(s=lU(o,e)),s)mu(t,s);else if(o.objectMode||e&&e.length>0)if(typeof e!="string"&&!o.objectMode&&Object.getPrototypeOf(e)!==Gl.prototype&&(e=eU(e)),n)o.endEmitted?mu(t,new uU):wg(t,o,e,!0);else if(o.ended)mu(t,new sU);else{if(o.destroyed)return!1;o.reading=!1,o.decoder&&!r?(e=o.decoder.write(e),o.objectMode||e.length!==0?wg(t,o,e,!1):Eg(t,o)):wg(t,o,e,!1)}else n||(o.reading=!1,Eg(t,o))}return!o.ended&&(o.length<o.highWaterMark||o.length===0)}function wg(t,e,r,n){e.flowing&&e.length===0&&!e.sync?(e.awaitDrain=0,t.emit("data",r)):(e.length+=e.objectMode?1:r.length,n?e.buffer.unshift(r):e.buffer.push(r),e.needReadable&&Kl(t)),Eg(t,e)}function lU(t,e){var r;return!tU(e)&&typeof e!="string"&&e!==void 0&&!t.objectMode&&(r=new oU("chunk",["string","Buffer","Uint8Array"],e)),r}ye.prototype.isPaused=function(){return this._readableState.flowing===!1};ye.prototype.setEncoding=function(t){rs||(rs=mg().StringDecoder);var e=new rs(t);this._readableState.decoder=e,this._readableState.encoding=this._readableState.decoder.encoding;for(var r=this._readableState.buffer.head,n="";r!==null;)n+=e.write(r.data),r=r.next;return this._readableState.buffer.clear(),n!==""&&this._readableState.buffer.push(n),this._readableState.length=n.length,this};var FE=1073741824;function fU(t){return t>=FE?t=FE:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}function OE(t,e){return t<=0||e.length===0&&e.ended?0:e.objectMode?1:t!==t?e.flowing&&e.length?e.buffer.head.data.length:e.length:(t>e.highWaterMark&&(e.highWaterMark=fU(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}ye.prototype.read=function(t){ue("read",t),t=parseInt(t,10);var e=this._readableState,r=t;if(t!==0&&(e.emittedReadable=!1),t===0&&e.needReadable&&((e.highWaterMark!==0?e.length>=e.highWaterMark:e.length>0)||e.ended))return ue("read: emitReadable",e.length,e.ended),e.length===0&&e.ended?_g(this):Kl(this),null;if(t=OE(t,e),t===0&&e.ended)return e.length===0&&_g(this),null;var n=e.needReadable;ue("need readable",n),(e.length===0||e.length-t<e.highWaterMark)&&(n=!0,ue("length less than watermark",n)),e.ended||e.reading?(n=!1,ue("reading or ended",n)):n&&(ue("do read"),e.reading=!0,e.sync=!0,e.length===0&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1,e.reading||(t=OE(r,e)));var i;return t>0?i=$E(t,e):i=null,i===null?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.awaitDrain=0),e.length===0&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&_g(this)),i!==null&&this.emit("data",i),i};function dU(t,e){if(ue("onEofChunk"),!e.ended){if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,e.sync?Kl(t):(e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,PE(t)))}}function Kl(t){var e=t._readableState;ue("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(ue("emitReadable",e.flowing),e.emittedReadable=!0,process.nextTick(PE,t))}function PE(t){var e=t._readableState;ue("emitReadable_",e.destroyed,e.length,e.ended),!e.destroyed&&(e.length||e.ended)&&(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,Sg(t)}function Eg(t,e){e.readingMore||(e.readingMore=!0,process.nextTick(hU,t,e))}function hU(t,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&e.length===0);){var r=e.length;if(ue("maybeReadMore read 0"),t.read(0),r===e.length)break}e.readingMore=!1}ye.prototype._read=function(t){mu(this,new aU("_read()"))};ye.prototype.pipe=function(t,e){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=t;break;case 1:n.pipes=[n.pipes,t];break;default:n.pipes.push(t);break}n.pipesCount+=1,ue("pipe count=%d opts=%j",n.pipesCount,e);var i=(!e||e.end!==!1)&&t!==process.stdout&&t!==process.stderr,o=i?a:v;n.endEmitted?process.nextTick(o):r.once("end",o),t.on("unpipe",s);function s(g,w){ue("onunpipe"),g===r&&w&&w.hasUnpiped===!1&&(w.hasUnpiped=!0,l())}function a(){ue("onend"),t.end()}var u=pU(r);t.on("drain",u);var c=!1;function l(){ue("cleanup"),t.removeListener("close",d),t.removeListener("finish",p),t.removeListener("drain",u),t.removeListener("error",h),t.removeListener("unpipe",s),r.removeListener("end",a),r.removeListener("end",v),r.removeListener("data",f),c=!0,n.awaitDrain&&(!t._writableState||t._writableState.needDrain)&&u()}r.on("data",f);function f(g){ue("ondata");var w=t.write(g);ue("dest.write",w),w===!1&&((n.pipesCount===1&&n.pipes===t||n.pipesCount>1&&IE(n.pipes,t)!==-1)&&!c&&(ue("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function h(g){ue("onerror",g),v(),t.removeListener("error",h),AE(t,"error")===0&&mu(t,g)}cU(t,"error",h);function d(){t.removeListener("finish",p),v()}t.once("close",d);function p(){ue("onfinish"),t.removeListener("close",d),v()}t.once("finish",p);function v(){ue("unpipe"),r.unpipe(t)}return t.emit("pipe",r),n.flowing||(ue("pipe resume"),r.resume()),t};function pU(t){return function(){var r=t._readableState;ue("pipeOnDrain",r.awaitDrain),r.awaitDrain&&r.awaitDrain--,r.awaitDrain===0&&AE(t,"data")&&(r.flowing=!0,Sg(t))}}ye.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(e.pipesCount===0)return this;if(e.pipesCount===1)return t&&t!==e.pipes?this:(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r),this);if(!t){var n=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o<i;o++)n[o].emit("unpipe",this,{hasUnpiped:!1});return this}var s=IE(e.pipes,t);return s===-1?this:(e.pipes.splice(s,1),e.pipesCount-=1,e.pipesCount===1&&(e.pipes=e.pipes[0]),t.emit("unpipe",this,r),this)};ye.prototype.on=function(t,e){var r=gu.prototype.on.call(this,t,e),n=this._readableState;return t==="data"?(n.readableListening=this.listenerCount("readable")>0,n.flowing!==!1&&this.resume()):t==="readable"&&!n.endEmitted&&!n.readableListening&&(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,ue("on readable",n.length,n.reading),n.length?Kl(this):n.reading||process.nextTick(mU,this)),r};ye.prototype.addListener=ye.prototype.on;ye.prototype.removeListener=function(t,e){var r=gu.prototype.removeListener.call(this,t,e);return t==="readable"&&process.nextTick(RE,this),r};ye.prototype.removeAllListeners=function(t){var e=gu.prototype.removeAllListeners.apply(this,arguments);return(t==="readable"||t===void 0)&&process.nextTick(RE,this),e};function RE(t){var e=t._readableState;e.readableListening=t.listenerCount("readable")>0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}function mU(t){ue("readable nexttick read 0"),t.read(0)}ye.prototype.resume=function(){var t=this._readableState;return t.flowing||(ue("resume"),t.flowing=!t.readableListening,gU(this,t)),t.paused=!1,this};function gU(t,e){e.resumeScheduled||(e.resumeScheduled=!0,process.nextTick(yU,t,e))}function yU(t,e){ue("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),Sg(t),e.flowing&&!e.reading&&t.read(0)}ye.prototype.pause=function(){return ue("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(ue("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function Sg(t){var e=t._readableState;for(ue("flow",e.flowing);e.flowing&&t.read()!==null;);}ye.prototype.wrap=function(t){var e=this,r=this._readableState,n=!1;t.on("end",function(){if(ue("wrapped end"),r.decoder&&!r.ended){var s=r.decoder.end();s&&s.length&&e.push(s)}e.push(null)}),t.on("data",function(s){if(ue("wrapped data"),r.decoder&&(s=r.decoder.write(s)),!(r.objectMode&&s==null)&&!(!r.objectMode&&(!s||!s.length))){var a=e.push(s);a||(n=!0,t.pause())}});for(var i in t)this[i]===void 0&&typeof t[i]=="function"&&(this[i]=function(a){return function(){return t[a].apply(t,arguments)}}(i));for(var o=0;o<bg.length;o++)t.on(bg[o],this.emit.bind(this,bg[o]));return this._read=function(s){ue("wrapped _read",s),n&&(n=!1,t.resume())},this};typeof Symbol=="function"&&(ye.prototype[Symbol.asyncIterator]=function(){return Dg===void 0&&(Dg=_E()),Dg(this)});Object.defineProperty(ye.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}});Object.defineProperty(ye.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}});Object.defineProperty(ye.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}});ye._fromList=$E;Object.defineProperty(ye.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function $E(t,e){if(e.length===0)return null;var r;return e.objectMode?r=e.buffer.shift():!t||t>=e.length?(e.decoder?r=e.buffer.join(""):e.buffer.length===1?r=e.buffer.first():r=e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r}function _g(t){var e=t._readableState;ue("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,process.nextTick(DU,e,t))}function DU(t,e){if(ue("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&t.length===0&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var r=e._writableState;(!r||r.autoDestroy&&r.finished)&&e.destroy()}}typeof Symbol=="function"&&(ye.from=function(t,e){return vg===void 0&&(vg=xE()),vg(ye,t,e)});function IE(t,e){for(var r=0,n=t.length;r<n;r++)if(t[r]===e)return r;return-1}});var xg=y((Qle,LE)=>{"use strict";LE.exports=Dn;var Yl=Yn().codes,vU=Yl.ERR_METHOD_NOT_IMPLEMENTED,bU=Yl.ERR_MULTIPLE_CALLBACK,wU=Yl.ERR_TRANSFORM_ALREADY_TRANSFORMING,_U=Yl.ERR_TRANSFORM_WITH_LENGTH_0,Jl=Ti();Zo()(Dn,Jl);function EU(t,e){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(n===null)return this.emit("error",new bU);r.writechunk=null,r.writecb=null,e!=null&&this.push(e),n(t);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function Dn(t){if(!(this instanceof Dn))return new Dn(t);Jl.call(this,t),this._transformState={afterTransform:EU.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,t&&(typeof t.transform=="function"&&(this._transform=t.transform),typeof t.flush=="function"&&(this._flush=t.flush)),this.on("prefinish",CU)}function CU(){var t=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(e,r){NE(t,e,r)}):NE(this,null,null)}Dn.prototype.push=function(t,e){return this._transformState.needTransform=!1,Jl.prototype.push.call(this,t,e)};Dn.prototype._transform=function(t,e,r){r(new vU("_transform()"))};Dn.prototype._write=function(t,e,r){var n=this._transformState;if(n.writecb=r,n.writechunk=t,n.writeencoding=e,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}};Dn.prototype._read=function(t){var e=this._transformState;e.writechunk!==null&&!e.transforming?(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform)):e.needTransform=!0};Dn.prototype._destroy=function(t,e){Jl.prototype._destroy.call(this,t,function(r){e(r)})};function NE(t,e,r){if(e)return t.emit("error",e);if(r!=null&&t.push(r),t._writableState.length)throw new _U;if(t._transformState.transforming)throw new wU;return t.push(null)}});var ME=y((efe,qE)=>{"use strict";qE.exports=yu;var BE=xg();Zo()(yu,BE);function yu(t){if(!(this instanceof yu))return new yu(t);BE.call(this,t)}yu.prototype._transform=function(t,e,r){r(null,t)}});var GE=y((tfe,zE)=>{"use strict";var Fg;function SU(t){var e=!1;return function(){e||(e=!0,t.apply(void 0,arguments))}}var HE=Yn().codes,xU=HE.ERR_MISSING_ARGS,FU=HE.ERR_STREAM_DESTROYED;function UE(t){if(t)throw t}function OU(t){return t.setHeader&&typeof t.abort=="function"}function AU(t,e,r,n){n=SU(n);var i=!1;t.on("close",function(){i=!0}),Fg===void 0&&(Fg=Vl()),Fg(t,{readable:e,writable:r},function(s){if(s)return n(s);i=!0,n()});var o=!1;return function(s){if(!i&&!o){if(o=!0,OU(t))return t.abort();if(typeof t.destroy=="function")return t.destroy();n(s||new FU("pipe"))}}}function VE(t){t()}function kU(t,e){return t.pipe(e)}function TU(t){return!t.length||typeof t[t.length-1]!="function"?UE:t.pop()}function PU(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];var n=TU(e);if(Array.isArray(e[0])&&(e=e[0]),e.length<2)throw new xU("streams");var i,o=e.map(function(s,a){var u=a<e.length-1,c=a>0;return AU(s,u,c,function(l){i||(i=l),l&&o.forEach(VE),!u&&(o.forEach(VE),n(i))})});return e.reduce(kU)}zE.exports=PU});var WE=y((yr,vu)=>{var Du=require("stream");process.env.READABLE_STREAM==="disable"&&Du?(vu.exports=Du.Readable,Object.assign(vu.exports,Du),vu.exports.Stream=Du):(yr=vu.exports=fg(),yr.Stream=Du||yr,yr.Readable=yr,yr.Writable=ug(),yr.Duplex=Ti(),yr.Transform=xg(),yr.PassThrough=ME(),yr.finished=Vl(),yr.pipeline=GE())});var Ag=y(Og=>{var KE;(function(t){typeof DO_NOT_EXPORT_CRC>"u"?typeof Og=="object"?t(Og):typeof define=="function"&&define.amd?define(function(){var e={};return t(e),e}):t(KE={}):t(KE={})})(function(t){t.version="1.2.2";function e(){for(var F=0,L=new Array(256),S=0;S!=256;++S)F=S,F=F&1?-306674912^F>>>1:F>>>1,F=F&1?-306674912^F>>>1:F>>>1,F=F&1?-306674912^F>>>1:F>>>1,F=F&1?-306674912^F>>>1:F>>>1,F=F&1?-306674912^F>>>1:F>>>1,F=F&1?-306674912^F>>>1:F>>>1,F=F&1?-306674912^F>>>1:F>>>1,F=F&1?-306674912^F>>>1:F>>>1,L[S]=F;return typeof Int32Array<"u"?new Int32Array(L):L}var r=e();function n(F){var L=0,S=0,I=0,R=typeof Int32Array<"u"?new Int32Array(4096):new Array(4096);for(I=0;I!=256;++I)R[I]=F[I];for(I=0;I!=256;++I)for(S=F[I],L=256+I;L<4096;L+=256)S=R[L]=S>>>8^F[S&255];var B=[];for(I=1;I!=16;++I)B[I-1]=typeof Int32Array<"u"?R.subarray(I*256,I*256+256):R.slice(I*256,I*256+256);return B}var i=n(r),o=i[0],s=i[1],a=i[2],u=i[3],c=i[4],l=i[5],f=i[6],h=i[7],d=i[8],p=i[9],v=i[10],g=i[11],w=i[12],x=i[13],D=i[14];function C(F,L){for(var S=L^-1,I=0,R=F.length;I<R;)S=S>>>8^r[(S^F.charCodeAt(I++))&255];return~S}function k(F,L){for(var S=L^-1,I=F.length-15,R=0;R<I;)S=D[F[R++]^S&255]^x[F[R++]^S>>8&255]^w[F[R++]^S>>16&255]^g[F[R++]^S>>>24]^v[F[R++]]^p[F[R++]]^d[F[R++]]^h[F[R++]]^f[F[R++]]^l[F[R++]]^c[F[R++]]^u[F[R++]]^a[F[R++]]^s[F[R++]]^o[F[R++]]^r[F[R++]];for(I+=15;R<I;)S=S>>>8^r[(S^F[R++])&255];return~S}function $(F,L){for(var S=L^-1,I=0,R=F.length,B=0,q=0;I<R;)B=F.charCodeAt(I++),B<128?S=S>>>8^r[(S^B)&255]:B<2048?(S=S>>>8^r[(S^(192|B>>6&31))&255],S=S>>>8^r[(S^(128|B&63))&255]):B>=55296&&B<57344?(B=(B&1023)+64,q=F.charCodeAt(I++)&1023,S=S>>>8^r[(S^(240|B>>8&7))&255],S=S>>>8^r[(S^(128|B>>2&63))&255],S=S>>>8^r[(S^(128|q>>6&15|(B&3)<<4))&255],S=S>>>8^r[(S^(128|q&63))&255]):(S=S>>>8^r[(S^(224|B>>12&15))&255],S=S>>>8^r[(S^(128|B>>6&63))&255],S=S>>>8^r[(S^(128|B&63))&255]);return~S}t.table=r,t.bstr=C,t.buf=k,t.str=$})});var JE=y((nfe,YE)=>{"use strict";var{Transform:RU}=WE(),$U=Ag(),kg=class extends RU{constructor(e){super(e),this.checksum=Buffer.allocUnsafe(4),this.checksum.writeInt32BE(0,0),this.rawSize=0}_transform(e,r,n){e&&(this.checksum=$U.buf(e,this.checksum)>>>0,this.rawSize+=e.length),n(null,e)}digest(e){let r=Buffer.allocUnsafe(4);return r.writeUInt32BE(this.checksum>>>0,0),e?r.toString(e):r}hex(){return this.digest("hex").toUpperCase()}size(){return this.rawSize}};YE.exports=kg});var ZE=y((ife,XE)=>{"use strict";var{DeflateRaw:IU}=require("zlib"),jU=Ag(),Tg=class extends IU{constructor(e){super(e),this.checksum=Buffer.allocUnsafe(4),this.checksum.writeInt32BE(0,0),this.rawSize=0,this.compressedSize=0}push(e,r){return e&&(this.compressedSize+=e.length),super.push(e,r)}_transform(e,r,n){e&&(this.checksum=jU.buf(e,this.checksum)>>>0,this.rawSize+=e.length),super._transform(e,r,n)}digest(e){let r=Buffer.allocUnsafe(4);return r.writeUInt32BE(this.checksum>>>0,0),e?r.toString(e):r}hex(){return this.digest("hex").toUpperCase()}size(e=!1){return e?this.compressedSize:this.rawSize}};XE.exports=Tg});var eC=y((ofe,QE)=>{"use strict";QE.exports={CRC32Stream:JE(),DeflateCRC32Stream:ZE()}});var bu=y(ns=>{"use strict";Object.defineProperty(ns,"__esModule",{value:!0});ns.checksum=ns.checksumFile=void 0;var NU=require("fs"),LU=require("crypto"),rC=require("stream"),BU=require("util"),{CRC32Stream:qU}=eC(),tC=(0,BU.promisify)(rC.pipeline),MU=(t,e,r)=>nC(NU.createReadStream(t),e,r);ns.checksumFile=MU;async function nC(t,e,r="hex"){let n=VU(t);if(e==="crc32"){let o=new qU,s=tC(n,o);return o.resume(),await s,o.end(),Buffer.from(o.digest()).toString(r)}let i=(0,LU.createHash)(e);return await tC(n,i),i.end(),i.digest(r)}ns.checksum=nC;function UU(t){return t!=null&&typeof t=="object"&&typeof t.read=="function"&&typeof t.pipe=="function"}var VU=t=>UU(t)?t:new rC.Readable({read(){this.push(t),this.push(null)}})});var Pg=y((afe,iC)=>{iC.exports={LOCHDR:30,LOCSIG:67324752,LOCVER:4,LOCFLG:6,LOCHOW:8,LOCTIM:10,LOCCRC:14,LOCSIZ:18,LOCLEN:22,LOCNAM:26,LOCEXT:28,EXTSIG:134695760,EXTHDR:16,EXTCRC:4,EXTSIZ:8,EXTLEN:12,CENHDR:46,CENSIG:33639248,CENVEM:4,CENVER:6,CENFLG:8,CENHOW:10,CENTIM:12,CENCRC:16,CENSIZ:20,CENLEN:24,CENNAM:28,CENEXT:30,CENCOM:32,CENDSK:34,CENATT:36,CENATX:38,CENOFF:42,ENDHDR:22,ENDSIG:101010256,ENDSUB:8,ENDTOT:10,ENDSIZ:12,ENDOFF:16,ENDCOM:20,END64HDR:20,END64SIG:117853008,END64START:4,END64OFF:8,END64NUMDISKS:16,ZIP64SIG:101075792,ZIP64HDR:56,ZIP64LEAD:12,ZIP64SIZE:4,ZIP64VEM:12,ZIP64VER:14,ZIP64DSK:16,ZIP64DSKDIR:20,ZIP64SUB:24,ZIP64TOT:32,ZIP64SIZB:40,ZIP64OFF:48,ZIP64EXTRA:56,STORED:0,SHRUNK:1,REDUCED1:2,REDUCED2:3,REDUCED3:4,REDUCED4:5,IMPLODED:6,DEFLATED:8,ENHANCED_DEFLATED:9,PKWARE:10,BZIP2:12,LZMA:14,IBM_TERSE:18,IBM_LZ77:19,AES_ENCRYPT:99,FLG_ENC:1,FLG_COMP1:2,FLG_COMP2:4,FLG_DESC:8,FLG_ENH:16,FLG_PATCH:32,FLG_STR:64,FLG_EFS:2048,FLG_MSK:4096,FILE:2,BUFFER:1,NONE:0,EF_ID:0,EF_SIZE:2,ID_ZIP64:1,ID_AVINFO:7,ID_PFS:8,ID_OS2:9,ID_NTFS:10,ID_OPENVMS:12,ID_UNIX:13,ID_FORK:14,ID_PATCH:15,ID_X509_PKCS7:20,ID_X509_CERTID_F:21,ID_X509_CERTID_C:22,ID_STRONGENC:23,ID_RECORD_MGT:24,ID_X509_PKCS7_RL:25,ID_IBM1:101,ID_IBM2:102,ID_POSZIP:18064,EF_ZIP64_OR_32:4294967295,EF_ZIP64_OR_16:65535,EF_ZIP64_SUNCOMP:0,EF_ZIP64_SCOMP:8,EF_ZIP64_RHO:16,EF_ZIP64_DSN:24}});var Xl=y(sC=>{var oC={INVALID_LOC:"Invalid LOC header (bad signature)",INVALID_CEN:"Invalid CEN header (bad signature)",INVALID_END:"Invalid END header (bad signature)",DESCRIPTOR_NOT_EXIST:"No descriptor present",DESCRIPTOR_UNKNOWN:"Unknown descriptor format",DESCRIPTOR_FAULTY:"Descriptor data is malformed",NO_DATA:"Nothing to decompress",BAD_CRC:"CRC32 checksum failed {0}",FILE_IN_THE_WAY:"There is a file in the way: {0}",UNKNOWN_METHOD:"Invalid/unsupported compression method",AVAIL_DATA:"inflate::Available inflate data did not terminate",INVALID_DISTANCE:"inflate::Invalid literal/length or distance code in fixed or dynamic block",TO_MANY_CODES:"inflate::Dynamic block code description: too many length or distance codes",INVALID_REPEAT_LEN:"inflate::Dynamic block code description: repeat more than specified lengths",INVALID_REPEAT_FIRST:"inflate::Dynamic block code description: repeat lengths with no first length",INCOMPLETE_CODES:"inflate::Dynamic block code description: code lengths codes incomplete",INVALID_DYN_DISTANCE:"inflate::Dynamic block code description: invalid distance code lengths",INVALID_CODES_LEN:"inflate::Dynamic block code description: invalid literal/length code lengths",INVALID_STORE_BLOCK:"inflate::Stored block length did not match one's complement",INVALID_BLOCK_TYPE:"inflate::Invalid block type (type == 3)",CANT_EXTRACT_FILE:"Could not extract the file",CANT_OVERRIDE:"Target file already exists",DISK_ENTRY_TOO_LARGE:"Number of disk entries is too large",NO_ZIP:"No zip file was loaded",NO_ENTRY:"Entry doesn't exist",DIRECTORY_CONTENT_ERROR:"A directory cannot have content",FILE_NOT_FOUND:'File not found: "{0}"',NOT_IMPLEMENTED:"Not implemented",INVALID_FILENAME:"Invalid filename",INVALID_FORMAT:"Invalid or unsupported zip format. No END header found",INVALID_PASS_PARAM:"Incompatible password parameter",WRONG_PASSWORD:"Wrong Password",COMMENT_TOO_LONG:"Comment is too long",EXTRA_FIELD_PARSE_ERROR:"Extra field parsing error"};function HU(t){return function(...e){return e.length&&(t=t.replace(/\{(\d)\}/g,(r,n)=>e[n]||"")),new Error("ADM-ZIP: "+t)}}for(let t of Object.keys(oC))sC[t]=HU(oC[t])});var fC=y((cfe,lC)=>{var zU=require("fs"),at=require("path"),aC=Pg(),GU=Xl(),WU=typeof process=="object"&&process.platform==="win32",uC=t=>typeof t=="object"&&t!==null,cC=new Uint32Array(256).map((t,e)=>{for(let r=0;r<8;r++)e&1?e=3988292384^e>>>1:e>>>=1;return e>>>0});function Je(t){this.sep=at.sep,this.fs=zU,uC(t)&&uC(t.fs)&&typeof t.fs.statSync=="function"&&(this.fs=t.fs)}lC.exports=Je;Je.prototype.makeDir=function(t){let e=this;function r(n){let i=n.split(e.sep)[0];n.split(e.sep).forEach(function(o){if(!(!o||o.substr(-1,1)===":")){i+=e.sep+o;var s;try{s=e.fs.statSync(i)}catch{e.fs.mkdirSync(i)}if(s&&s.isFile())throw GU.FILE_IN_THE_WAY(`"${i}"`)}})}r(t)};Je.prototype.writeFileTo=function(t,e,r,n){let i=this;if(i.fs.existsSync(t)){if(!r)return!1;var o=i.fs.statSync(t);if(o.isDirectory())return!1}var s=at.dirname(t);i.fs.existsSync(s)||i.makeDir(s);var a;try{a=i.fs.openSync(t,"w",438)}catch{i.fs.chmodSync(t,438),a=i.fs.openSync(t,"w",438)}if(a)try{i.fs.writeSync(a,e,0,e.length,0)}finally{i.fs.closeSync(a)}return i.fs.chmodSync(t,n||438),!0};Je.prototype.writeFileToAsync=function(t,e,r,n,i){typeof n=="function"&&(i=n,n=void 0);let o=this;o.fs.exists(t,function(s){if(s&&!r)return i(!1);o.fs.stat(t,function(a,u){if(s&&u.isDirectory())return i(!1);var c=at.dirname(t);o.fs.exists(c,function(l){l||o.makeDir(c),o.fs.open(t,"w",438,function(f,h){f?o.fs.chmod(t,438,function(){o.fs.open(t,"w",438,function(d,p){o.fs.write(p,e,0,e.length,0,function(){o.fs.close(p,function(){o.fs.chmod(t,n||438,function(){i(!0)})})})})}):h?o.fs.write(h,e,0,e.length,0,function(){o.fs.close(h,function(){o.fs.chmod(t,n||438,function(){i(!0)})})}):o.fs.chmod(t,n||438,function(){i(!0)})})})})})};Je.prototype.findFiles=function(t){let e=this;function r(n,i,o){typeof i=="boolean"&&(o=i,i=void 0);let s=[];return e.fs.readdirSync(n).forEach(function(a){let u=at.join(n,a),c=e.fs.statSync(u);(!i||i.test(u))&&s.push(at.normalize(u)+(c.isDirectory()?e.sep:"")),c.isDirectory()&&o&&(s=s.concat(r(u,i,o)))}),s}return r(t,void 0,!0)};Je.prototype.findFilesAsync=function(t,e){let r=this,n=[];r.fs.readdir(t,function(i,o){if(i)return e(i);let s=o.length;if(!s)return e(null,n);o.forEach(function(a){a=at.join(t,a),r.fs.stat(a,function(u,c){if(u)return e(u);c&&(n.push(at.normalize(a)+(c.isDirectory()?r.sep:"")),c.isDirectory()?r.findFilesAsync(a,function(l,f){if(l)return e(l);n=n.concat(f),--s||e(null,n)}):--s||e(null,n))})})})};Je.prototype.getAttributes=function(){};Je.prototype.setAttributes=function(){};Je.crc32update=function(t,e){return cC[(t^e)&255]^t>>>8};Je.crc32=function(t){typeof t=="string"&&(t=Buffer.from(t,"utf8"));let e=t.length,r=-1;for(let n=0;n<e;)r=Je.crc32update(r,t[n++]);return~r>>>0};Je.methodToString=function(t){switch(t){case aC.STORED:return"STORED ("+t+")";case aC.DEFLATED:return"DEFLATED ("+t+")";default:return"UNSUPPORTED ("+t+")"}};Je.canonical=function(t){if(!t)return"";let e=at.posix.normalize("/"+t.split("\\").join("/"));return at.join(".",e)};Je.zipnamefix=function(t){if(!t)return"";let e=at.posix.normalize("/"+t.split("\\").join("/"));return at.posix.join(".",e)};Je.findLast=function(t,e){if(!Array.isArray(t))throw new TypeError("arr is not array");let r=t.length>>>0;for(let n=r-1;n>=0;n--)if(e(t[n],n,t))return t[n]};Je.sanitize=function(t,e){t=at.resolve(at.normalize(t));for(var r=e.split("/"),n=0,i=r.length;n<i;n++){var o=at.normalize(at.join(t,r.slice(n,i).join(at.sep)));if(o.indexOf(t)===0)return o}return at.normalize(at.join(t,at.basename(e)))};Je.toBuffer=function(e,r){return Buffer.isBuffer(e)?e:e instanceof Uint8Array?Buffer.from(e):typeof e=="string"?r(e):Buffer.alloc(0)};Je.readBigUInt64LE=function(t,e){var r=Buffer.from(t.slice(e,e+8));return r.swap64(),parseInt(`0x${r.toString("hex")}`)};Je.fromDOS2Date=function(t){return new Date((t>>25&127)+1980,Math.max((t>>21&15)-1,0),Math.max(t>>16&31,1),t>>11&31,t>>5&63,(t&31)<<1)};Je.fromDate2DOS=function(t){let e=0,r=0;return t.getFullYear()>1979&&(e=(t.getFullYear()-1980&127)<<9|t.getMonth()+1<<5|t.getDate(),r=t.getHours()<<11|t.getMinutes()<<5|t.getSeconds()>>1),e<<16|r};Je.isWin=WU;Je.crcTable=cC});var hC=y((lfe,dC)=>{var KU=require("path");dC.exports=function(t,{fs:e}){var r=t||"",n=o(),i=null;function o(){return{directory:!1,readonly:!1,hidden:!1,executable:!1,mtime:0,atime:0}}return r&&e.existsSync(r)?(i=e.statSync(r),n.directory=i.isDirectory(),n.mtime=i.mtime,n.atime=i.atime,n.executable=(73&i.mode)!==0,n.readonly=(128&i.mode)===0,n.hidden=KU.basename(r)[0]==="."):console.warn("Invalid path: "+r),{get directory(){return n.directory},get readOnly(){return n.readonly},get hidden(){return n.hidden},get mtime(){return n.mtime},get atime(){return n.atime},get executable(){return n.executable},decodeAttributes:function(){},encodeAttributes:function(){},toJSON:function(){return{path:r,isDirectory:n.directory,isReadOnly:n.readonly,isHidden:n.hidden,isExecutable:n.executable,mTime:n.mtime,aTime:n.atime}},toString:function(){return JSON.stringify(this.toJSON(),null," ")}}}});var mC=y((ffe,pC)=>{pC.exports={efs:!0,encode:t=>Buffer.from(t,"utf8"),decode:t=>t.toString("utf8")}});var os=y((dfe,is)=>{is.exports=fC();is.exports.Constants=Pg();is.exports.Errors=Xl();is.exports.FileAttr=hC();is.exports.decoder=mC()});var yC=y((hfe,gC)=>{var ei=os(),V=ei.Constants;gC.exports=function(){var t=20,e=10,r=0,n=0,i=0,o=0,s=0,a=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0;t|=ei.isWin?2560:768,r|=V.FLG_EFS;let v={extraLen:0},g=D=>Math.max(0,D)>>>0,w=D=>Math.max(0,D)&65535,x=D=>Math.max(0,D)&255;return i=ei.fromDate2DOS(new Date),{get made(){return t},set made(D){t=D},get version(){return e},set version(D){e=D},get flags(){return r},set flags(D){r=D},get flags_efs(){return(r&V.FLG_EFS)>0},set flags_efs(D){D?r|=V.FLG_EFS:r&=~V.FLG_EFS},get flags_desc(){return(r&V.FLG_DESC)>0},set flags_desc(D){D?r|=V.FLG_DESC:r&=~V.FLG_DESC},get method(){return n},set method(D){switch(D){case V.STORED:this.version=10;case V.DEFLATED:default:this.version=20}n=D},get time(){return ei.fromDOS2Date(this.timeval)},set time(D){this.timeval=ei.fromDate2DOS(D)},get timeval(){return i},set timeval(D){i=g(D)},get timeHighByte(){return x(i>>>8)},get crc(){return o},set crc(D){o=g(D)},get compressedSize(){return s},set compressedSize(D){s=g(D)},get size(){return a},set size(D){a=g(D)},get fileNameLength(){return u},set fileNameLength(D){u=D},get extraLength(){return c},set extraLength(D){c=D},get extraLocalLength(){return v.extraLen},set extraLocalLength(D){v.extraLen=D},get commentLength(){return l},set commentLength(D){l=D},get diskNumStart(){return f},set diskNumStart(D){f=g(D)},get inAttr(){return h},set inAttr(D){h=g(D)},get attr(){return d},set attr(D){d=g(D)},get fileAttr(){return(d||0)>>16&4095},get offset(){return p},set offset(D){p=g(D)},get encrypted(){return(r&V.FLG_ENC)===V.FLG_ENC},get centralHeaderSize(){return V.CENHDR+u+c+l},get realDataOffset(){return p+V.LOCHDR+v.fnameLen+v.extraLen},get localHeader(){return v},loadLocalHeaderFromBinary:function(D){var C=D.slice(p,p+V.LOCHDR);if(C.readUInt32LE(0)!==V.LOCSIG)throw ei.Errors.INVALID_LOC();v.version=C.readUInt16LE(V.LOCVER),v.flags=C.readUInt16LE(V.LOCFLG),v.method=C.readUInt16LE(V.LOCHOW),v.time=C.readUInt32LE(V.LOCTIM),v.crc=C.readUInt32LE(V.LOCCRC),v.compressedSize=C.readUInt32LE(V.LOCSIZ),v.size=C.readUInt32LE(V.LOCLEN),v.fnameLen=C.readUInt16LE(V.LOCNAM),v.extraLen=C.readUInt16LE(V.LOCEXT);let k=p+V.LOCHDR+v.fnameLen,$=k+v.extraLen;return D.slice(k,$)},loadFromBinary:function(D){if(D.length!==V.CENHDR||D.readUInt32LE(0)!==V.CENSIG)throw ei.Errors.INVALID_CEN();t=D.readUInt16LE(V.CENVEM),e=D.readUInt16LE(V.CENVER),r=D.readUInt16LE(V.CENFLG),n=D.readUInt16LE(V.CENHOW),i=D.readUInt32LE(V.CENTIM),o=D.readUInt32LE(V.CENCRC),s=D.readUInt32LE(V.CENSIZ),a=D.readUInt32LE(V.CENLEN),u=D.readUInt16LE(V.CENNAM),c=D.readUInt16LE(V.CENEXT),l=D.readUInt16LE(V.CENCOM),f=D.readUInt16LE(V.CENDSK),h=D.readUInt16LE(V.CENATT),d=D.readUInt32LE(V.CENATX),p=D.readUInt32LE(V.CENOFF)},localHeaderToBinary:function(){var D=Buffer.alloc(V.LOCHDR);return D.writeUInt32LE(V.LOCSIG,0),D.writeUInt16LE(e,V.LOCVER),D.writeUInt16LE(r,V.LOCFLG),D.writeUInt16LE(n,V.LOCHOW),D.writeUInt32LE(i,V.LOCTIM),D.writeUInt32LE(o,V.LOCCRC),D.writeUInt32LE(s,V.LOCSIZ),D.writeUInt32LE(a,V.LOCLEN),D.writeUInt16LE(u,V.LOCNAM),D.writeUInt16LE(v.extraLen,V.LOCEXT),D},centralHeaderToBinary:function(){var D=Buffer.alloc(V.CENHDR+u+c+l);return D.writeUInt32LE(V.CENSIG,0),D.writeUInt16LE(t,V.CENVEM),D.writeUInt16LE(e,V.CENVER),D.writeUInt16LE(r,V.CENFLG),D.writeUInt16LE(n,V.CENHOW),D.writeUInt32LE(i,V.CENTIM),D.writeUInt32LE(o,V.CENCRC),D.writeUInt32LE(s,V.CENSIZ),D.writeUInt32LE(a,V.CENLEN),D.writeUInt16LE(u,V.CENNAM),D.writeUInt16LE(c,V.CENEXT),D.writeUInt16LE(l,V.CENCOM),D.writeUInt16LE(f,V.CENDSK),D.writeUInt16LE(h,V.CENATT),D.writeUInt32LE(d,V.CENATX),D.writeUInt32LE(p,V.CENOFF),D},toJSON:function(){let D=function(C){return C+" bytes"};return{made:t,version:e,flags:r,method:ei.methodToString(n),time:this.time,crc:"0x"+o.toString(16).toUpperCase(),compressedSize:D(s),size:D(a),fileNameLength:D(u),extraLength:D(c),commentLength:D(l),diskNumStart:f,inAttr:h,attr:d,offset:p,centralHeaderSize:D(V.CENHDR+u+c+l)}},toString:function(){return JSON.stringify(this.toJSON(),null," ")}}}});var vC=y((pfe,DC)=>{var ss=os(),Me=ss.Constants;DC.exports=function(){var t=0,e=0,r=0,n=0,i=0;return{get diskEntries(){return t},set diskEntries(o){t=e=o},get totalEntries(){return e},set totalEntries(o){e=t=o},get size(){return r},set size(o){r=o},get offset(){return n},set offset(o){n=o},get commentLength(){return i},set commentLength(o){i=o},get mainHeaderSize(){return Me.ENDHDR+i},loadFromBinary:function(o){if((o.length!==Me.ENDHDR||o.readUInt32LE(0)!==Me.ENDSIG)&&(o.length<Me.ZIP64HDR||o.readUInt32LE(0)!==Me.ZIP64SIG))throw ss.Errors.INVALID_END();o.readUInt32LE(0)===Me.ENDSIG?(t=o.readUInt16LE(Me.ENDSUB),e=o.readUInt16LE(Me.ENDTOT),r=o.readUInt32LE(Me.ENDSIZ),n=o.readUInt32LE(Me.ENDOFF),i=o.readUInt16LE(Me.ENDCOM)):(t=ss.readBigUInt64LE(o,Me.ZIP64SUB),e=ss.readBigUInt64LE(o,Me.ZIP64TOT),r=ss.readBigUInt64LE(o,Me.ZIP64SIZE),n=ss.readBigUInt64LE(o,Me.ZIP64OFF),i=0)},toBinary:function(){var o=Buffer.alloc(Me.ENDHDR+i);return o.writeUInt32LE(Me.ENDSIG,0),o.writeUInt32LE(0,4),o.writeUInt16LE(t,Me.ENDSUB),o.writeUInt16LE(e,Me.ENDTOT),o.writeUInt32LE(r,Me.ENDSIZ),o.writeUInt32LE(n,Me.ENDOFF),o.writeUInt16LE(i,Me.ENDCOM),o.fill(" ",Me.ENDHDR),o},toJSON:function(){let o=function(s,a){let u=s.toString(16).toUpperCase();for(;u.length<a;)u="0"+u;return"0x"+u};return{diskEntries:t,totalEntries:e,size:r+" bytes",offset:o(n,4),commentLength:i}},toString:function(){return JSON.stringify(this.toJSON(),null," ")}}}});var $g=y(Rg=>{Rg.EntryHeader=yC();Rg.MainHeader=vC()});var wC=y((gfe,bC)=>{bC.exports=function(t){var e=require("zlib"),r={chunkSize:(parseInt(t.length/1024)+1)*1024};return{deflate:function(){return e.deflateRawSync(t,r)},deflateAsync:function(n){var i=e.createDeflateRaw(r),o=[],s=0;i.on("data",function(a){o.push(a),s+=a.length}),i.on("end",function(){var a=Buffer.alloc(s),u=0;a.fill(0);for(var c=0;c<o.length;c++){var l=o[c];l.copy(a,u),u+=l.length}n&&n(a)}),i.end(t)}}}});var EC=y((yfe,_C)=>{var YU=+(process.versions?process.versions.node:"").split(".")[0]||0;_C.exports=function(t,e){var r=require("zlib");let n=YU>=15&&e>0?{maxOutputLength:e}:{};return{inflate:function(){return r.inflateRawSync(t,n)},inflateAsync:function(i){var o=r.createInflateRaw(n),s=[],a=0;o.on("data",function(u){s.push(u),a+=u.length}),o.on("end",function(){var u=Buffer.alloc(a),c=0;u.fill(0);for(var l=0;l<s.length;l++){var f=s[l];f.copy(u,c),c+=f.length}i&&i(u)}),o.end(t)}}}});var OC=y((Dfe,FC)=>{"use strict";var{randomFillSync:CC}=require("crypto"),JU=Xl(),XU=new Uint32Array(256).map((t,e)=>{for(let r=0;r<8;r++)e&1?e=e>>>1^3988292384:e>>>=1;return e>>>0}),xC=(t,e)=>Math.imul(t,e)>>>0,SC=(t,e)=>XU[(t^e)&255]^t>>>8,wu=()=>typeof CC=="function"?CC(Buffer.alloc(12)):wu.node();wu.node=()=>{let t=Buffer.alloc(12),e=t.length;for(let r=0;r<e;r++)t[r]=Math.random()*256&255;return t};var Zl={genSalt:wu};function Ql(t){let e=Buffer.isBuffer(t)?t:Buffer.from(t);this.keys=new Uint32Array([305419896,591751049,878082192]);for(let r=0;r<e.length;r++)this.updateKeys(e[r])}Ql.prototype.updateKeys=function(t){let e=this.keys;return e[0]=SC(e[0],t),e[1]+=e[0]&255,e[1]=xC(e[1],134775813)+1,e[2]=SC(e[2],e[1]>>>24),t};Ql.prototype.next=function(){let t=(this.keys[2]|2)>>>0;return xC(t,t^1)>>8&255};function ZU(t){let e=new Ql(t);return function(r){let n=Buffer.alloc(r.length),i=0;for(let o of r)n[i++]=e.updateKeys(o^e.next());return n}}function QU(t){let e=new Ql(t);return function(r,n,i=0){n||(n=Buffer.alloc(r.length));for(let o of r){let s=e.next();n[i++]=o^s,e.updateKeys(o)}return n}}function e9(t,e,r){if(!t||!Buffer.isBuffer(t)||t.length<12)return Buffer.alloc(0);let n=ZU(r),i=n(t.slice(0,12)),o=(e.flags&8)===8?e.timeHighByte:e.crc>>>24;if(i[11]!==o)throw JU.WRONG_PASSWORD();return n(t.slice(12))}function t9(t){Buffer.isBuffer(t)&&t.length>=12?Zl.genSalt=function(){return t.slice(0,12)}:t==="node"?Zl.genSalt=wu.node:Zl.genSalt=wu}function r9(t,e,r,n=!1){t==null&&(t=Buffer.alloc(0)),Buffer.isBuffer(t)||(t=Buffer.from(t.toString()));let i=QU(r),o=Zl.genSalt();o[11]=e.crc>>>24&255,n&&(o[10]=e.crc>>>16&255);let s=Buffer.alloc(t.length+12);return i(o,s),i(t,s,12)}FC.exports={decrypt:e9,encrypt:r9,_salter:t9}});var AC=y(ef=>{ef.Deflater=wC();ef.Inflater=EC();ef.ZipCrypto=OC()});var jg=y((bfe,kC)=>{var we=os(),n9=$g(),Xe=we.Constants,Ig=AC();kC.exports=function(t,e){var r=new n9.EntryHeader,n=Buffer.alloc(0),i=Buffer.alloc(0),o=!1,s=null,a=Buffer.alloc(0),u=Buffer.alloc(0),c=!0;let l=t,f=typeof l.decoder=="object"?l.decoder:we.decoder;c=f.hasOwnProperty("efs")?f.efs:!1;function h(){return!e||!(e instanceof Uint8Array)?Buffer.alloc(0):(u=r.loadLocalHeaderFromBinary(e),e.slice(r.realDataOffset,r.realDataOffset+r.compressedSize))}function d(D){if(r.flags_desc){let C={},k=r.realDataOffset+r.compressedSize;if(e.readUInt32LE(k)==Xe.LOCSIG||e.readUInt32LE(k)==Xe.CENSIG)throw we.Errors.DESCRIPTOR_NOT_EXIST();if(e.readUInt32LE(k)==Xe.EXTSIG)C.crc=e.readUInt32LE(k+Xe.EXTCRC),C.compressedSize=e.readUInt32LE(k+Xe.EXTSIZ),C.size=e.readUInt32LE(k+Xe.EXTLEN);else if(e.readUInt16LE(k+12)===19280)C.crc=e.readUInt32LE(k+Xe.EXTCRC-4),C.compressedSize=e.readUInt32LE(k+Xe.EXTSIZ-4),C.size=e.readUInt32LE(k+Xe.EXTLEN-4);else throw we.Errors.DESCRIPTOR_UNKNOWN();if(C.compressedSize!==r.compressedSize||C.size!==r.size||C.crc!==r.crc)throw we.Errors.DESCRIPTOR_FAULTY();if(we.crc32(D)!==C.crc)return!1}else if(we.crc32(D)!==r.localHeader.crc)return!1;return!0}function p(D,C,k){if(typeof C>"u"&&typeof D=="string"&&(k=D,D=void 0),o)return D&&C&&C(Buffer.alloc(0),we.Errors.DIRECTORY_CONTENT_ERROR()),Buffer.alloc(0);var $=h();if($.length===0)return D&&C&&C($),$;if(r.encrypted){if(typeof k!="string"&&!Buffer.isBuffer(k))throw we.Errors.INVALID_PASS_PARAM();$=Ig.ZipCrypto.decrypt($,r,k)}var F=Buffer.alloc(r.size);switch(r.method){case we.Constants.STORED:if($.copy(F),d(F))return D&&C&&C(F),F;throw D&&C&&C(F,we.Errors.BAD_CRC()),we.Errors.BAD_CRC();case we.Constants.DEFLATED:var L=new Ig.Inflater($,r.size);if(D)L.inflateAsync(function(S){S.copy(S,0),C&&(d(S)?C(S):C(S,we.Errors.BAD_CRC()))});else{if(L.inflate(F).copy(F,0),!d(F))throw we.Errors.BAD_CRC(`"${f.decode(n)}"`);return F}break;default:throw D&&C&&C(Buffer.alloc(0),we.Errors.UNKNOWN_METHOD()),we.Errors.UNKNOWN_METHOD()}}function v(D,C){if((!s||!s.length)&&Buffer.isBuffer(e))return D&&C&&C(h()),h();if(s.length&&!o){var k;switch(r.method){case we.Constants.STORED:return r.compressedSize=r.size,k=Buffer.alloc(s.length),s.copy(k),D&&C&&C(k),k;default:case we.Constants.DEFLATED:var $=new Ig.Deflater(s);if(D)$.deflateAsync(function(L){k=Buffer.alloc(L.length),r.compressedSize=L.length,L.copy(k),C&&C(k)});else{var F=$.deflate();return r.compressedSize=F.length,F}$=null;break}}else if(D&&C)C(Buffer.alloc(0));else return Buffer.alloc(0)}function g(D,C){return(D.readUInt32LE(C+4)<<4)+D.readUInt32LE(C)}function w(D){try{for(var C=0,k,$,F;C+4<D.length;)k=D.readUInt16LE(C),C+=2,$=D.readUInt16LE(C),C+=2,F=D.slice(C,C+$),C+=$,Xe.ID_ZIP64===k&&x(F)}catch{throw we.Errors.EXTRA_FIELD_PARSE_ERROR()}}function x(D){var C,k,$,F;D.length>=Xe.EF_ZIP64_SCOMP&&(C=g(D,Xe.EF_ZIP64_SUNCOMP),r.size===Xe.EF_ZIP64_OR_32&&(r.size=C)),D.length>=Xe.EF_ZIP64_RHO&&(k=g(D,Xe.EF_ZIP64_SCOMP),r.compressedSize===Xe.EF_ZIP64_OR_32&&(r.compressedSize=k)),D.length>=Xe.EF_ZIP64_DSN&&($=g(D,Xe.EF_ZIP64_RHO),r.offset===Xe.EF_ZIP64_OR_32&&(r.offset=$)),D.length>=Xe.EF_ZIP64_DSN+4&&(F=D.readUInt32LE(Xe.EF_ZIP64_DSN),r.diskNumStart===Xe.EF_ZIP64_OR_16&&(r.diskNumStart=F))}return{get entryName(){return f.decode(n)},get rawEntryName(){return n},set entryName(D){n=we.toBuffer(D,f.encode);var C=n[n.length-1];o=C===47||C===92,r.fileNameLength=n.length},get efs(){return typeof c=="function"?c(this.entryName):c},get extra(){return a},set extra(D){a=D,r.extraLength=D.length,w(D)},get comment(){return f.decode(i)},set comment(D){if(i=we.toBuffer(D,f.encode),r.commentLength=i.length,i.length>65535)throw we.Errors.COMMENT_TOO_LONG()},get name(){var D=f.decode(n);return o?D.substr(D.length-1).split("/").pop():D.split("/").pop()},get isDirectory(){return o},getCompressedData:function(){return v(!1,null)},getCompressedDataAsync:function(D){v(!0,D)},setData:function(D){s=we.toBuffer(D,we.decoder.encode),!o&&s.length?(r.size=s.length,r.method=we.Constants.DEFLATED,r.crc=we.crc32(D),r.changed=!0):r.method=we.Constants.STORED},getData:function(D){return r.changed?s:p(!1,null,D)},getDataAsync:function(D,C){r.changed?D(s):p(!0,D,C)},set attr(D){r.attr=D},get attr(){return r.attr},set header(D){r.loadFromBinary(D)},get header(){return r},packCentralHeader:function(){r.flags_efs=this.efs,r.extraLength=a.length;var D=r.centralHeaderToBinary(),C=we.Constants.CENHDR;return n.copy(D,C),C+=n.length,a.copy(D,C),C+=r.extraLength,i.copy(D,C),D},packLocalHeader:function(){let D=0;r.flags_efs=this.efs,r.extraLocalLength=u.length;let C=r.localHeaderToBinary(),k=Buffer.alloc(C.length+n.length+r.extraLocalLength);return C.copy(k,D),D+=C.length,n.copy(k,D),D+=n.length,u.copy(k,D),D+=u.length,k},toJSON:function(){let D=function(C){return"<"+(C&&C.length+" bytes buffer"||"null")+">"};return{entryName:this.entryName,name:this.name,comment:this.comment,isDirectory:this.isDirectory,header:r.toJSON(),compressedData:D(e),data:D(s)}},toString:function(){return JSON.stringify(this.toJSON(),null," ")}}}});var RC=y((wfe,PC)=>{var TC=jg(),i9=$g(),bt=os();PC.exports=function(t,e){var r=[],n={},i=Buffer.alloc(0),o=new i9.MainHeader,s=!1,a=null;let u=new Set,c=e,{noSort:l,decoder:f}=c;t?p(c.readEntries):s=!0;function h(){let g=new Set;for(let w of Object.keys(n)){let x=w.split("/");if(x.pop(),!!x.length)for(let D=0;D<x.length;D++){let C=x.slice(0,D+1).join("/")+"/";g.add(C)}}for(let w of g)if(!(w in n)){let x=new TC(c);x.entryName=w,x.attr=16,x.temporary=!0,r.push(x),n[x.entryName]=x,u.add(x)}}function d(){if(s=!0,n={},o.diskEntries>(t.length-o.offset)/bt.Constants.CENHDR)throw bt.Errors.DISK_ENTRY_TOO_LARGE();r=new Array(o.diskEntries);for(var g=o.offset,w=0;w<r.length;w++){var x=g,D=new TC(c,t);D.header=t.slice(x,x+=bt.Constants.CENHDR),D.entryName=t.slice(x,x+=D.header.fileNameLength),D.header.extraLength&&(D.extra=t.slice(x,x+=D.header.extraLength)),D.header.commentLength&&(D.comment=t.slice(x,x+D.header.commentLength)),g+=D.header.centralHeaderSize,r[w]=D,n[D.entryName]=D}u.clear(),h()}function p(g){var w=t.length-bt.Constants.ENDHDR,x=Math.max(0,w-65535),D=x,C=t.length,k=-1,$=0;for((typeof c.trailingSpace=="boolean"?c.trailingSpace:!1)&&(x=0),w;w>=D;w--)if(t[w]===80){if(t.readUInt32LE(w)===bt.Constants.ENDSIG){k=w,$=w,C=w+bt.Constants.ENDHDR,D=w-bt.Constants.END64HDR;continue}if(t.readUInt32LE(w)===bt.Constants.END64SIG){D=x;continue}if(t.readUInt32LE(w)===bt.Constants.ZIP64SIG){k=w,C=w+bt.readBigUInt64LE(t,w+bt.Constants.ZIP64SIZE)+bt.Constants.ZIP64LEAD;break}}if(k==-1)throw bt.Errors.INVALID_FORMAT();o.loadFromBinary(t.slice(k,C)),o.commentLength&&(i=t.slice($+bt.Constants.ENDHDR)),g&&d()}function v(){r.length>1&&!l&&r.sort((g,w)=>g.entryName.toLowerCase().localeCompare(w.entryName.toLowerCase()))}return{get entries(){return s||d(),r.filter(g=>!u.has(g))},get comment(){return f.decode(i)},set comment(g){i=bt.toBuffer(g,f.encode),o.commentLength=i.length},getEntryCount:function(){return s?r.length:o.diskEntries},forEach:function(g){this.entries.forEach(g)},getEntry:function(g){return s||d(),n[g]||null},setEntry:function(g){s||d(),r.push(g),n[g.entryName]=g,o.totalEntries=r.length},deleteFile:function(g,w=!0){s||d();let x=n[g];this.getEntryChildren(x,w).map(C=>C.entryName).forEach(this.deleteEntry)},deleteEntry:function(g){s||d();let w=n[g],x=r.indexOf(w);x>=0&&(r.splice(x,1),delete n[g],o.totalEntries=r.length)},getEntryChildren:function(g,w=!0){if(s||d(),typeof g=="object")if(g.isDirectory&&w){let x=[],D=g.entryName;for(let C of r)C.entryName.startsWith(D)&&x.push(C);return x}else return[g];return[]},getChildCount:function(g){if(g&&g.isDirectory){let w=this.getEntryChildren(g);return w.includes(g)?w.length-1:w.length}return 0},compressToBuffer:function(){s||d(),v();let g=[],w=[],x=0,D=0;o.size=0,o.offset=0;let C=0;for(let F of this.entries){let L=F.getCompressedData();F.header.offset=D;let S=F.packLocalHeader(),I=S.length+L.length;D+=I,g.push(S),g.push(L);let R=F.packCentralHeader();w.push(R),o.size+=R.length,x+=I+R.length,C++}x+=o.mainHeaderSize,o.offset=D,o.totalEntries=C,D=0;let k=Buffer.alloc(x);for(let F of g)F.copy(k,D),D+=F.length;for(let F of w)F.copy(k,D),D+=F.length;let $=o.toBinary();return i&&i.copy($,bt.Constants.ENDHDR),$.copy(k,D),t=k,s=!1,k},toAsyncBuffer:function(g,w,x,D){try{s||d(),v();let C=[],k=[],$=0,F=0,L=0;o.size=0,o.offset=0;let S=function(I){if(I.length>0){let R=I.shift(),B=R.entryName+R.extra.toString();x&&x(B),R.getCompressedDataAsync(function(q){D&&D(B),R.header.offset=F;let K=R.packLocalHeader(),M=K.length+q.length;F+=M,C.push(K),C.push(q);let E=R.packCentralHeader();k.push(E),o.size+=E.length,$+=M+E.length,L++,S(I)})}else{$+=o.mainHeaderSize,o.offset=F,o.totalEntries=L,F=0;let R=Buffer.alloc($);C.forEach(function(q){q.copy(R,F),F+=q.length}),k.forEach(function(q){q.copy(R,F),F+=q.length});let B=o.toBinary();i&&i.copy(B,bt.Constants.ENDHDR),B.copy(R,F),t=R,s=!1,g(R)}};S(Array.from(this.entries))}catch(C){w(C)}}}}});var jC=y((_fe,IC)=>{var Ue=os(),Ze=require("path"),o9=jg(),s9=RC(),ji=(...t)=>Ue.findLast(t,e=>typeof e=="boolean"),$C=(...t)=>Ue.findLast(t,e=>typeof e=="string"),a9=(...t)=>Ue.findLast(t,e=>typeof e=="function"),u9={noSort:!1,readEntries:!1,method:Ue.Constants.NONE,fs:null};IC.exports=function(t,e){let r=null,n=Object.assign(Object.create(null),u9);t&&typeof t=="object"&&(t instanceof Uint8Array||(Object.assign(n,t),t=n.input?n.input:void 0,n.input&&delete n.input),Buffer.isBuffer(t)&&(r=t,n.method=Ue.Constants.BUFFER,t=void 0)),Object.assign(n,e);let i=new Ue(n);if((typeof n.decoder!="object"||typeof n.decoder.encode!="function"||typeof n.decoder.decode!="function")&&(n.decoder=Ue.decoder),t&&typeof t=="string")if(i.fs.existsSync(t))n.method=Ue.Constants.FILE,n.filename=t,r=i.fs.readFileSync(t);else throw Ue.Errors.INVALID_FILENAME();let o=new s9(r,n),{canonical:s,sanitize:a,zipnamefix:u}=Ue;function c(d){if(d&&o){var p;if(typeof d=="string"&&(p=o.getEntry(Ze.posix.normalize(d))),typeof d=="object"&&typeof d.entryName<"u"&&typeof d.header<"u"&&(p=o.getEntry(d.entryName)),p)return p}return null}function l(d){let{join:p,normalize:v,sep:g}=Ze.posix;return p(".",v(g+d.split("\\").join(g)+g))}function f(d){return d instanceof RegExp?function(p){return function(v){return p.test(v)}}(d):typeof d!="function"?()=>!0:d}let h=(d,p)=>{let v=p.slice(-1);return v=v===i.sep?i.sep:"",Ze.relative(d,p)+v};return{readFile:function(d,p){var v=c(d);return v&&v.getData(p)||null},childCount:function(d){let p=c(d);if(p)return o.getChildCount(p)},readFileAsync:function(d,p){var v=c(d);v?v.getDataAsync(p):p(null,"getEntry failed for:"+d)},readAsText:function(d,p){var v=c(d);if(v){var g=v.getData();if(g&&g.length)return g.toString(p||"utf8")}return""},readAsTextAsync:function(d,p,v){var g=c(d);g?g.getDataAsync(function(w,x){if(x){p(w,x);return}w&&w.length?p(w.toString(v||"utf8")):p("")}):p("")},deleteFile:function(d,p=!0){var v=c(d);v&&o.deleteFile(v.entryName,p)},deleteEntry:function(d){var p=c(d);p&&o.deleteEntry(p.entryName)},addZipComment:function(d){o.comment=d},getZipComment:function(){return o.comment||""},addZipEntryComment:function(d,p){var v=c(d);v&&(v.comment=p)},getZipEntryComment:function(d){var p=c(d);return p&&p.comment||""},updateFile:function(d,p){var v=c(d);v&&v.setData(p)},addLocalFile:function(d,p,v,g){if(i.fs.existsSync(d)){p=p?l(p):"";let w=Ze.win32.basename(Ze.win32.normalize(d));p+=v||w;let x=i.fs.statSync(d),D=x.isFile()?i.fs.readFileSync(d):Buffer.alloc(0);x.isDirectory()&&(p+=i.sep),this.addFile(p,D,g,x)}else throw Ue.Errors.FILE_NOT_FOUND(d)},addLocalFileAsync:function(d,p){d=typeof d=="object"?d:{localPath:d};let v=Ze.resolve(d.localPath),{comment:g}=d,{zipPath:w,zipName:x}=d,D=this;i.fs.stat(v,function(C,k){if(C)return p(C,!1);w=w?l(w):"";let $=Ze.win32.basename(Ze.win32.normalize(v));if(w+=x||$,k.isFile())i.fs.readFile(v,function(F,L){return F?p(F,!1):(D.addFile(w,L,g,k),setImmediate(p,void 0,!0))});else if(k.isDirectory())return w+=i.sep,D.addFile(w,Buffer.alloc(0),g,k),setImmediate(p,void 0,!0)})},addLocalFolder:function(d,p,v){if(v=f(v),p=p?l(p):"",d=Ze.normalize(d),i.fs.existsSync(d)){let g=i.findFiles(d),w=this;if(g.length)for(let x of g){let D=Ze.join(p,h(d,x));v(D)&&w.addLocalFile(x,Ze.dirname(D))}}else throw Ue.Errors.FILE_NOT_FOUND(d)},addLocalFolderAsync:function(d,p,v,g){g=f(g),v=v?l(v):"",d=Ze.normalize(d);var w=this;i.fs.open(d,"r",function(x){if(x&&x.code==="ENOENT")p(void 0,Ue.Errors.FILE_NOT_FOUND(d));else if(x)p(void 0,x);else{var D=i.findFiles(d),C=-1,k=function(){if(C+=1,C<D.length){var $=D[C],F=h(d,$).split("\\").join("/");F=F.normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/[^\x20-\x7E]/g,""),g(F)?i.fs.stat($,function(L,S){L&&p(void 0,L),S.isFile()?i.fs.readFile($,function(I,R){I?p(void 0,I):(w.addFile(v+F,R,"",S),k())}):(w.addFile(v+F+"/",Buffer.alloc(0),"",S),k())}):process.nextTick(()=>{k()})}else p(!0,void 0)};k()}})},addLocalFolderAsync2:function(d,p){let v=this;d=typeof d=="object"?d:{localPath:d},localPath=Ze.resolve(l(d.localPath));let{zipPath:g,filter:w,namefix:x}=d;w instanceof RegExp?w=function(k){return function($){return k.test($)}}(w):typeof w!="function"&&(w=function(){return!0}),g=g?l(g):"",x=="latin1"&&(x=k=>k.normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/[^\x20-\x7E]/g,"")),typeof x!="function"&&(x=k=>k);let D=k=>Ze.join(g,x(h(localPath,k))),C=k=>Ze.win32.basename(Ze.win32.normalize(x(k)));i.fs.open(localPath,"r",function(k){k&&k.code==="ENOENT"?p(void 0,Ue.Errors.FILE_NOT_FOUND(localPath)):k?p(void 0,k):i.findFilesAsync(localPath,function($,F){if($)return p($);F=F.filter(L=>w(D(L))),F.length||p(void 0,!1),setImmediate(F.reverse().reduce(function(L,S){return function(I,R){if(I||R===!1)return setImmediate(L,I,!1);v.addLocalFileAsync({localPath:S,zipPath:Ze.dirname(D(S)),zipName:C(S)},L)}},p))})})},addLocalFolderPromise:function(d,p){return new Promise((v,g)=>{this.addLocalFolderAsync2(Object.assign({localPath:d},p),(w,x)=>{w&&g(w),x&&v(this)})})},addFile:function(d,p,v,g){d=u(d);let w=c(d),x=w!=null;x||(w=new o9(n),w.entryName=d),w.comment=v||"";let D=typeof g=="object"&&g instanceof i.fs.Stats;D&&(w.header.time=g.mtime);var C=w.isDirectory?16:0;let k=w.isDirectory?16384:32768;return D?k|=4095&g.mode:typeof g=="number"?k|=4095&g:k|=w.isDirectory?493:420,C=(C|k<<16)>>>0,w.attr=C,w.setData(p),x||o.setEntry(w),w},getEntries:function(d){return o.password=d,o?o.entries:[]},getEntry:function(d){return c(d)},getEntryCount:function(){return o.getEntryCount()},forEach:function(d){return o.forEach(d)},extractEntryTo:function(d,p,v,g,w,x){g=ji(!1,g),w=ji(!1,w),v=ji(!0,v),x=$C(w,x);var D=c(d);if(!D)throw Ue.Errors.NO_ENTRY();var C=s(D.entryName),k=a(p,x&&!D.isDirectory?x:v?C:Ze.basename(C));if(D.isDirectory){var $=o.getEntryChildren(D);return $.forEach(function(S){if(S.isDirectory)return;var I=S.getData();if(!I)throw Ue.Errors.CANT_EXTRACT_FILE();var R=s(S.entryName),B=a(p,v?R:Ze.basename(R));let q=w?S.header.fileAttr:void 0;i.writeFileTo(B,I,g,q)}),!0}var F=D.getData(o.password);if(!F)throw Ue.Errors.CANT_EXTRACT_FILE();if(i.fs.existsSync(k)&&!g)throw Ue.Errors.CANT_OVERRIDE();let L=w?d.header.fileAttr:void 0;return i.writeFileTo(k,F,g,L),!0},test:function(d){if(!o)return!1;for(var p in o.entries)try{if(p.isDirectory)continue;var v=o.entries[p].getData(d);if(!v)return!1}catch{return!1}return!0},extractAllTo:function(d,p,v,g){if(v=ji(!1,v),g=$C(v,g),p=ji(!1,p),!o)throw Ue.Errors.NO_ZIP();o.entries.forEach(function(w){var x=a(d,s(w.entryName));if(w.isDirectory){i.makeDir(x);return}var D=w.getData(g);if(!D)throw Ue.Errors.CANT_EXTRACT_FILE();let C=v?w.header.fileAttr:void 0;i.writeFileTo(x,D,p,C);try{i.fs.utimesSync(x,w.header.time,w.header.time)}catch{throw Ue.Errors.CANT_EXTRACT_FILE()}})},extractAllToAsync:function(d,p,v,g){if(g=a9(p,v,g),v=ji(!1,v),p=ji(!1,p),!g)return new Promise((k,$)=>{this.extractAllToAsync(d,p,v,function(F){F?$(F):k(this)})});if(!o){g(Ue.Errors.NO_ZIP());return}d=Ze.resolve(d);let w=k=>a(d,Ze.normalize(s(k.entryName))),x=(k,$)=>new Error(k+': "'+$+'"'),D=[],C=[];o.entries.forEach(k=>{k.isDirectory?D.push(k):C.push(k)});for(let k of D){let $=w(k),F=v?k.header.fileAttr:void 0;try{i.makeDir($),F&&i.fs.chmodSync($,F),i.fs.utimesSync($,k.header.time,k.header.time)}catch{g(x("Unable to create folder",$))}}C.reverse().reduce(function(k,$){return function(F){if(F)k(F);else{let L=Ze.normalize(s($.entryName)),S=a(d,L);$.getDataAsync(function(I,R){if(R)k(R);else if(!I)k(Ue.Errors.CANT_EXTRACT_FILE());else{let B=v?$.header.fileAttr:void 0;i.writeFileToAsync(S,I,p,B,function(q){q||k(x("Unable to write file",S)),i.fs.utimes(S,$.header.time,$.header.time,function(K){K?k(x("Unable to set times",S)):k()})})}})}}},g)()},writeZip:function(d,p){if(arguments.length===1&&typeof d=="function"&&(p=d,d=""),!d&&n.filename&&(d=n.filename),!!d){var v=o.compressToBuffer();if(v){var g=i.writeFileTo(d,v,!0);typeof p=="function"&&p(g?null:new Error("failed"),"")}}},writeZipPromise:function(d,p){let{overwrite:v,perm:g}=Object.assign({overwrite:!0},p);return new Promise((w,x)=>{!d&&n.filename&&(d=n.filename),d||x("ADM-ZIP: ZIP File Name Missing"),this.toBufferPromise().then(D=>{let C=k=>k?w(k):x("ADM-ZIP: Wasn't able to write zip file");i.writeFileToAsync(d,D,v,g,C)},x)})},toBufferPromise:function(){return new Promise((d,p)=>{o.toAsyncBuffer(d,p)})},toBuffer:function(d,p,v,g){return typeof d=="function"?(o.toAsyncBuffer(d,p,v,g),null):o.compressToBuffer()}}}});var XC=y((Jfe,JC)=>{var YC={};JC.exports=YC;var KC={reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29],black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],gray:[90,39],grey:[90,39],brightRed:[91,39],brightGreen:[92,39],brightYellow:[93,39],brightBlue:[94,39],brightMagenta:[95,39],brightCyan:[96,39],brightWhite:[97,39],bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgGray:[100,49],bgGrey:[100,49],bgBrightRed:[101,49],bgBrightGreen:[102,49],bgBrightYellow:[103,49],bgBrightBlue:[104,49],bgBrightMagenta:[105,49],bgBrightCyan:[106,49],bgBrightWhite:[107,49],blackBG:[40,49],redBG:[41,49],greenBG:[42,49],yellowBG:[43,49],blueBG:[44,49],magentaBG:[45,49],cyanBG:[46,49],whiteBG:[47,49]};Object.keys(KC).forEach(function(t){var e=KC[t],r=YC[t]=[];r.open="\x1B["+e[0]+"m",r.close="\x1B["+e[1]+"m"})});var QC=y((Xfe,ZC)=>{"use strict";ZC.exports=function(t,e){e=e||process.argv;var r=e.indexOf("--"),n=/^-{1,2}/.test(t)?"":"--",i=e.indexOf(n+t);return i!==-1&&(r===-1?!0:i<r)}});var tS=y((Zfe,eS)=>{"use strict";var p9=require("os"),Ar=QC(),Tt=process.env,cs=void 0;Ar("no-color")||Ar("no-colors")||Ar("color=false")?cs=!1:(Ar("color")||Ar("colors")||Ar("color=true")||Ar("color=always"))&&(cs=!0);"FORCE_COLOR"in Tt&&(cs=Tt.FORCE_COLOR.length===0||parseInt(Tt.FORCE_COLOR,10)!==0);function m9(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}function g9(t){if(cs===!1)return 0;if(Ar("color=16m")||Ar("color=full")||Ar("color=truecolor"))return 3;if(Ar("color=256"))return 2;if(t&&!t.isTTY&&cs!==!0)return 0;var e=cs?1:0;if(process.platform==="win32"){var r=p9.release().split(".");return Number(process.versions.node.split(".")[0])>=8&&Number(r[0])>=10&&Number(r[2])>=10586?Number(r[2])>=14931?3:2:1}if("CI"in Tt)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some(function(i){return i in Tt})||Tt.CI_NAME==="codeship"?1:e;if("TEAMCITY_VERSION"in Tt)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Tt.TEAMCITY_VERSION)?1:0;if("TERM_PROGRAM"in Tt){var n=parseInt((Tt.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(Tt.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Hyper":return 3;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(Tt.TERM)?2:/^screen|^xterm|^vt100|^rxvt|color|ansi|cygwin|linux/i.test(Tt.TERM)||"COLORTERM"in Tt?1:(Tt.TERM==="dumb",e)}function Vg(t){var e=g9(t);return m9(e)}eS.exports={supportsColor:Vg,stdout:Vg(process.stdout),stderr:Vg(process.stderr)}});var nS=y((Qfe,rS)=>{rS.exports=function(e,r){var n="";e=e||"Run the trap, drop the bass",e=e.split("");var i={a:["@","\u0104","\u023A","\u0245","\u0394","\u039B","\u0414"],b:["\xDF","\u0181","\u0243","\u026E","\u03B2","\u0E3F"],c:["\xA9","\u023B","\u03FE"],d:["\xD0","\u018A","\u0500","\u0501","\u0502","\u0503"],e:["\xCB","\u0115","\u018E","\u0258","\u03A3","\u03BE","\u04BC","\u0A6C"],f:["\u04FA"],g:["\u0262"],h:["\u0126","\u0195","\u04A2","\u04BA","\u04C7","\u050A"],i:["\u0F0F"],j:["\u0134"],k:["\u0138","\u04A0","\u04C3","\u051E"],l:["\u0139"],m:["\u028D","\u04CD","\u04CE","\u0520","\u0521","\u0D69"],n:["\xD1","\u014B","\u019D","\u0376","\u03A0","\u048A"],o:["\xD8","\xF5","\xF8","\u01FE","\u0298","\u047A","\u05DD","\u06DD","\u0E4F"],p:["\u01F7","\u048E"],q:["\u09CD"],r:["\xAE","\u01A6","\u0210","\u024C","\u0280","\u042F"],s:["\xA7","\u03DE","\u03DF","\u03E8"],t:["\u0141","\u0166","\u0373"],u:["\u01B1","\u054D"],v:["\u05D8"],w:["\u0428","\u0460","\u047C","\u0D70"],x:["\u04B2","\u04FE","\u04FC","\u04FD"],y:["\xA5","\u04B0","\u04CB"],z:["\u01B5","\u0240"]};return e.forEach(function(o){o=o.toLowerCase();var s=i[o]||[" "],a=Math.floor(Math.random()*s.length);typeof i[o]<"u"?n+=i[o][a]:n+=o}),n}});var oS=y((ede,iS)=>{iS.exports=function(e,r){e=e||" he is here ";var n={up:["\u030D","\u030E","\u0304","\u0305","\u033F","\u0311","\u0306","\u0310","\u0352","\u0357","\u0351","\u0307","\u0308","\u030A","\u0342","\u0313","\u0308","\u034A","\u034B","\u034C","\u0303","\u0302","\u030C","\u0350","\u0300","\u0301","\u030B","\u030F","\u0312","\u0313","\u0314","\u033D","\u0309","\u0363","\u0364","\u0365","\u0366","\u0367","\u0368","\u0369","\u036A","\u036B","\u036C","\u036D","\u036E","\u036F","\u033E","\u035B","\u0346","\u031A"],down:["\u0316","\u0317","\u0318","\u0319","\u031C","\u031D","\u031E","\u031F","\u0320","\u0324","\u0325","\u0326","\u0329","\u032A","\u032B","\u032C","\u032D","\u032E","\u032F","\u0330","\u0331","\u0332","\u0333","\u0339","\u033A","\u033B","\u033C","\u0345","\u0347","\u0348","\u0349","\u034D","\u034E","\u0353","\u0354","\u0355","\u0356","\u0359","\u035A","\u0323"],mid:["\u0315","\u031B","\u0300","\u0301","\u0358","\u0321","\u0322","\u0327","\u0328","\u0334","\u0335","\u0336","\u035C","\u035D","\u035E","\u035F","\u0360","\u0362","\u0338","\u0337","\u0361"," \u0489"]},i=[].concat(n.up,n.down,n.mid);function o(u){var c=Math.floor(Math.random()*u);return c}function s(u){var c=!1;return i.filter(function(l){c=l===u}),c}function a(u,c){var l="",f,h;c=c||{},c.up=typeof c.up<"u"?c.up:!0,c.mid=typeof c.mid<"u"?c.mid:!0,c.down=typeof c.down<"u"?c.down:!0,c.size=typeof c.size<"u"?c.size:"maxi",u=u.split("");for(h in u)if(!s(h)){switch(l=l+u[h],f={up:0,down:0,mid:0},c.size){case"mini":f.up=o(8),f.mid=o(2),f.down=o(8);break;case"maxi":f.up=o(16)+3,f.mid=o(4)+1,f.down=o(64)+3;break;default:f.up=o(8)+1,f.mid=o(6)/2,f.down=o(8)+1;break}var d=["up","mid","down"];for(var p in d)for(var v=d[p],g=0;g<=f[v];g++)c[v]&&(l=l+n[v][o(n[v].length)])}return l}return a(e,r)}});var aS=y((tde,sS)=>{sS.exports=function(t){return function(e,r,n){if(e===" ")return e;switch(r%3){case 0:return t.red(e);case 1:return t.white(e);case 2:return t.blue(e)}}}});var cS=y((rde,uS)=>{uS.exports=function(t){return function(e,r,n){return r%2===0?e:t.inverse(e)}}});var fS=y((nde,lS)=>{lS.exports=function(t){var e=["red","yellow","green","blue","magenta"];return function(r,n,i){return r===" "?r:t[e[n++%e.length]](r)}}});var hS=y((ide,dS)=>{dS.exports=function(t){var e=["underline","inverse","grey","yellow","red","green","blue","white","cyan","magenta","brightYellow","brightRed","brightGreen","brightBlue","brightWhite","brightCyan","brightMagenta"];return function(r,n,i){return r===" "?r:t[e[Math.round(Math.random()*(e.length-2))]](r)}}});var vS=y((sde,DS)=>{var le={};DS.exports=le;le.themes={};var y9=require("util"),Ni=le.styles=XC(),mS=Object.defineProperties,D9=new RegExp(/[\r\n]+/g);le.supportsColor=tS().supportsColor;typeof le.enabled>"u"&&(le.enabled=le.supportsColor()!==!1);le.enable=function(){le.enabled=!0};le.disable=function(){le.enabled=!1};le.stripColors=le.strip=function(t){return(""+t).replace(/\x1B\[\d+m/g,"")};var ode=le.stylize=function(e,r){if(!le.enabled)return e+"";var n=Ni[r];return!n&&r in le?le[r](e):n.open+e+n.close},v9=/[|\\{}()[\]^$+*?.]/g,b9=function(t){if(typeof t!="string")throw new TypeError("Expected a string");return t.replace(v9,"\\$&")};function gS(t){var e=function r(){return _9.apply(r,arguments)};return e._styles=t,e.__proto__=w9,e}var yS=function(){var t={};return Ni.grey=Ni.gray,Object.keys(Ni).forEach(function(e){Ni[e].closeRe=new RegExp(b9(Ni[e].close),"g"),t[e]={get:function(){return gS(this._styles.concat(e))}}}),t}(),w9=mS(function(){},yS);function _9(){var t=Array.prototype.slice.call(arguments),e=t.map(function(s){return s!=null&&s.constructor===String?s:y9.inspect(s)}).join(" ");if(!le.enabled||!e)return e;for(var r=e.indexOf(`
24
- `)!=-1,n=this._styles,i=n.length;i--;){var o=Ni[n[i]];e=o.open+e.replace(o.closeRe,o.open)+o.close,r&&(e=e.replace(D9,function(s){return o.close+s+o.open}))}return e}le.setTheme=function(t){if(typeof t=="string"){console.log("colors.setTheme now only accepts an object, not a string. If you are trying to set a theme from a file, it is now your (the caller's) responsibility to require the file. The old syntax looked like colors.setTheme(__dirname + '/../themes/generic-logging.js'); The new syntax looks like colors.setTheme(require(__dirname + '/../themes/generic-logging.js'));");return}for(var e in t)(function(r){le[r]=function(n){if(typeof t[r]=="object"){var i=n;for(var o in t[r])i=le[t[r][o]](i);return i}return le[t[r]](n)}})(e)};function E9(){var t={};return Object.keys(yS).forEach(function(e){t[e]={get:function(){return gS([e])}}}),t}var C9=function(e,r){var n=r.split("");return n=n.map(e),n.join("")};le.trap=nS();le.zalgo=oS();le.maps={};le.maps.america=aS()(le);le.maps.zebra=cS()(le);le.maps.rainbow=fS()(le);le.maps.random=hS()(le);for(pS in le.maps)(function(t){le[t]=function(e){return C9(le.maps[t],e)}})(pS);var pS;mS(le,E9())});var wS=y((ade,bS)=>{var S9=vS();bS.exports=S9});var _S=y(Hg=>{"use strict";Hg.indent=function(e){return new Array(e+1).join(" ")};Hg.getMaxIndexLength=function(t){var e=0;return Object.getOwnPropertyNames(t).forEach(function(r){t[r]!==void 0&&(e=Math.max(e,r.length))}),e}});var ES=y((cde,x9)=>{x9.exports={author:"Rafael de Oleza <rafeca@gmail.com> (https://github.com/rafeca)",name:"prettyjson",description:"Package for formatting JSON data in a coloured YAML-style, perfect for CLI output",version:"1.2.5",homepage:"http://rafeca.com/prettyjson",keywords:["json","cli","formatting","colors"],repository:{type:"git",url:"https://github.com/rafeca/prettyjson.git"},bugs:{url:"https://github.com/rafeca/prettyjson/issues"},main:"./lib/prettyjson",files:["bin/prettyjson","lib/*.js"],license:"MIT",scripts:{test:"npm run jshint && mocha --reporter spec",testwin:"node ./node_modules/mocha/bin/mocha --reporter spec",jshint:"jshint lib/*.js test/*.js",coverage:"istanbul cover _mocha --report lcovonly -- -R spec",coveralls:"npm run coverage && cat ./coverage/lcov.info | coveralls && rm -rf ./coverage",changelog:"git log $(git describe --tags --abbrev=0)..HEAD --pretty='* %s' --first-parent"},bin:{prettyjson:"./bin/prettyjson"},dependencies:{colors:"1.4.0",minimist:"^1.2.0"},devDependencies:{coveralls:"^2.11.15",istanbul:"^0.4.5",jshint:"^2.9.4",mocha:"^3.1.2","mocha-lcov-reporter":"^1.2.0",should:"^11.1.1"}}});var CS=y(Cu=>{"use strict";var zr=wS(),ri=_S(),F9=/[^\w\s\n\r\v\t\.,]/i;Cu.version=ES().version;var zg=function(t,e){return t!==void 0||e.renderUndefined},sf=function(t,e,r){return!!(typeof t=="boolean"||typeof t=="number"||typeof t=="function"||t===null||t===void 0||t instanceof Date||typeof t=="string"&&t.indexOf(`
25
- `)===-1||r.inlineArrays&&!e&&Array.isArray(t)&&sf(t[0],!0,r))},O9=function(t,e){if(e.noColor)return t;if(typeof t=="string")return e.stringColor?zr[e.stringColor](t):t;var r=t+"";return t===!0?zr.green(r):t===!1?zr.red(r):t==null?zr.grey(r):typeof t=="number"?t>=0?zr[e.positiveNumberColor](r):zr[e.negativeNumberColor](r):typeof t=="function"?"function() {}":Array.isArray(t)?t.join(", "):r},Gg=function(t,e){return t.multilineStringColor===null||t.noColor?e:zr[t.multilineStringColor](e)},A9=function(t,e,r){var n=t.split(`
23
+ `)}),this}_outputHelpIfRequested(e){let r=this._getHelpOption();r&&e.find(i=>r.is(i))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function mw(t){return t.map(e=>{if(!e.startsWith("--inspect"))return e;let r,n="127.0.0.1",i="9229",o;return(o=e.match(/^(--inspect(-brk)?)$/))!==null?r=o[1]:(o=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(r=o[1],/^\d+$/.test(o[3])?i=o[3]:n=o[3]):(o=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(r=o[1],n=o[3],i=o[4]),r&&i!=="0"?`${r}=${n}:${parseInt(i)+1}`:e})}gw.Command=Ip});var ww=y(dr=>{var{Argument:Dw}=nl(),{Command:jp}=yw(),{CommanderError:yB,InvalidArgumentError:vw}=Na(),{Help:DB}=Fp(),{Option:bw}=Tp();dr.program=new jp;dr.createCommand=t=>new jp(t);dr.createOption=(t,e)=>new bw(t,e);dr.createArgument=(t,e)=>new Dw(t,e);dr.Command=jp;dr.Option=bw;dr.Argument=Dw;dr.Help=DB;dr.CommanderError=yB;dr.InvalidArgumentError=vw;dr.InvalidOptionArgumentError=vw});var Te=y((xce,Ew)=>{"use strict";var Np="\x1B",qe=`${Np}[`,bB="\x07",Lp={to(t,e){return e?`${qe}${e+1};${t+1}H`:`${qe}${t+1}G`},move(t,e){let r="";return t<0?r+=`${qe}${-t}D`:t>0&&(r+=`${qe}${t}C`),e<0?r+=`${qe}${-e}A`:e>0&&(r+=`${qe}${e}B`),r},up:(t=1)=>`${qe}${t}A`,down:(t=1)=>`${qe}${t}B`,forward:(t=1)=>`${qe}${t}C`,backward:(t=1)=>`${qe}${t}D`,nextLine:(t=1)=>`${qe}E`.repeat(t),prevLine:(t=1)=>`${qe}F`.repeat(t),left:`${qe}G`,hide:`${qe}?25l`,show:`${qe}?25h`,save:`${Np}7`,restore:`${Np}8`},wB={up:(t=1)=>`${qe}S`.repeat(t),down:(t=1)=>`${qe}T`.repeat(t)},_B={screen:`${qe}2J`,up:(t=1)=>`${qe}1J`.repeat(t),down:(t=1)=>`${qe}J`.repeat(t),line:`${qe}2K`,lineEnd:`${qe}K`,lineStart:`${qe}1K`,lines(t){let e="";for(let r=0;r<t;r++)e+=this.line+(r<t-1?Lp.up():"");return t&&(e+=Lp.left),e}};Ew.exports={cursor:Lp,scroll:wB,erase:_B,beep:bB}});var qp=y((Fce,Bp)=>{var ol=process||{},Cw=ol.argv||[],il=ol.env||{},EB=!(il.NO_COLOR||Cw.includes("--no-color"))&&(!!il.FORCE_COLOR||Cw.includes("--color")||ol.platform==="win32"||(ol.stdout||{}).isTTY&&il.TERM!=="dumb"||!!il.CI),CB=(t,e,r=t)=>n=>{let i=""+n,o=i.indexOf(e,t.length);return~o?t+SB(i,e,r,o)+e:t+i+e},SB=(t,e,r,n)=>{let i="",o=0;do i+=t.substring(o,n)+r,o=n+e.length,n=t.indexOf(e,o);while(~n);return i+t.substring(o)},Sw=(t=EB)=>{let e=t?CB:()=>String;return{isColorSupported:t,reset:e("\x1B[0m","\x1B[0m"),bold:e("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:e("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:e("\x1B[3m","\x1B[23m"),underline:e("\x1B[4m","\x1B[24m"),inverse:e("\x1B[7m","\x1B[27m"),hidden:e("\x1B[8m","\x1B[28m"),strikethrough:e("\x1B[9m","\x1B[29m"),black:e("\x1B[30m","\x1B[39m"),red:e("\x1B[31m","\x1B[39m"),green:e("\x1B[32m","\x1B[39m"),yellow:e("\x1B[33m","\x1B[39m"),blue:e("\x1B[34m","\x1B[39m"),magenta:e("\x1B[35m","\x1B[39m"),cyan:e("\x1B[36m","\x1B[39m"),white:e("\x1B[37m","\x1B[39m"),gray:e("\x1B[90m","\x1B[39m"),bgBlack:e("\x1B[40m","\x1B[49m"),bgRed:e("\x1B[41m","\x1B[49m"),bgGreen:e("\x1B[42m","\x1B[49m"),bgYellow:e("\x1B[43m","\x1B[49m"),bgBlue:e("\x1B[44m","\x1B[49m"),bgMagenta:e("\x1B[45m","\x1B[49m"),bgCyan:e("\x1B[46m","\x1B[49m"),bgWhite:e("\x1B[47m","\x1B[49m"),blackBright:e("\x1B[90m","\x1B[39m"),redBright:e("\x1B[91m","\x1B[39m"),greenBright:e("\x1B[92m","\x1B[39m"),yellowBright:e("\x1B[93m","\x1B[39m"),blueBright:e("\x1B[94m","\x1B[39m"),magentaBright:e("\x1B[95m","\x1B[39m"),cyanBright:e("\x1B[96m","\x1B[39m"),whiteBright:e("\x1B[97m","\x1B[39m"),bgBlackBright:e("\x1B[100m","\x1B[49m"),bgRedBright:e("\x1B[101m","\x1B[49m"),bgGreenBright:e("\x1B[102m","\x1B[49m"),bgYellowBright:e("\x1B[103m","\x1B[49m"),bgBlueBright:e("\x1B[104m","\x1B[49m"),bgMagentaBright:e("\x1B[105m","\x1B[49m"),bgCyanBright:e("\x1B[106m","\x1B[49m"),bgWhiteBright:e("\x1B[107m","\x1B[49m")}};Bp.exports=Sw();Bp.exports.createColors=Sw});var dl=y(qt=>{"use strict";Object.defineProperty(qt,"__esModule",{value:!0});qt.isNXMonorepo=qt.isMonorepo=qt.findPackageRelativePathInMonorepo=qt.findPackagePath=qt.findNXMonorepoRoot=qt.findMonorepoRoot=void 0;var qa=require("node:fs"),Wn=require("node:path");function fl(t){let e=(0,Wn.join)(t,"package.json"),r=(0,Wn.join)(t,"pnpm-workspace.yaml");if((0,qa.existsSync)(r)||(0,qa.existsSync)(e)&&JSON.parse((0,qa.readFileSync)(e,"utf-8")).workspaces)return t;let n=(0,Wn.dirname)(t);if(n===t)throw new Error("Monorepo root not found");return fl(n)}qt.findMonorepoRoot=fl;function Qp(t){let e=(0,Wn.join)(t,"nx.json");if((0,qa.existsSync)(e))return t;let r=(0,Wn.dirname)(t);if(r===t)throw new Error("Monorepo root not found");return Qp(r)}qt.findNXMonorepoRoot=Qp;function em(t,e,r){let n=(0,Wn.join)(e,"node_modules",t);if((0,qa.existsSync)(n))return n;if(e===r)return null;let i=(0,Wn.dirname)(e);return em(t,i,r)}qt.findPackagePath=em;function iq(t,e){let r=fl(e),n=em(t,e,r);return n?(0,Wn.relative)(e,n):null}qt.findPackageRelativePathInMonorepo=iq;function oq(t){try{return fl(t),!0}catch{return!1}}qt.isMonorepo=oq;function sq(t){try{return Qp(t),!0}catch{return!1}}qt.isNXMonorepo=sq});var Si={};mn(Si,{default:()=>aq});var aq,xi=ut(()=>{aq={}});var Gw=y(jr=>{"use strict";var uq=jr&&jr.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),cq=jr&&jr.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),lq=jr&&jr.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&uq(e,t,r);return cq(e,t),e};Object.defineProperty(jr,"__esModule",{value:!0});jr.resolveFetch=void 0;var fq=t=>{let e;return t?e=t:typeof fetch>"u"?e=(...r)=>Promise.resolve().then(()=>lq((xi(),ke(Si)))).then(({default:n})=>n(...r)):e=fetch,(...r)=>e(...r)};jr.resolveFetch=fq});var im=y(nr=>{"use strict";Object.defineProperty(nr,"__esModule",{value:!0});nr.FunctionRegion=nr.FunctionsHttpError=nr.FunctionsRelayError=nr.FunctionsFetchError=nr.FunctionsError=void 0;var Uo=class extends Error{constructor(e,r="FunctionsError",n){super(e),this.name=r,this.context=n}};nr.FunctionsError=Uo;var tm=class extends Uo{constructor(e){super("Failed to send a request to the Edge Function","FunctionsFetchError",e)}};nr.FunctionsFetchError=tm;var rm=class extends Uo{constructor(e){super("Relay Error invoking the Edge Function","FunctionsRelayError",e)}};nr.FunctionsRelayError=rm;var nm=class extends Uo{constructor(e){super("Edge Function returned a non-2xx status code","FunctionsHttpError",e)}};nr.FunctionsHttpError=nm;var dq;(function(t){t.Any="any",t.ApNortheast1="ap-northeast-1",t.ApNortheast2="ap-northeast-2",t.ApSouth1="ap-south-1",t.ApSoutheast1="ap-southeast-1",t.ApSoutheast2="ap-southeast-2",t.CaCentral1="ca-central-1",t.EuCentral1="eu-central-1",t.EuWest1="eu-west-1",t.EuWest2="eu-west-2",t.EuWest3="eu-west-3",t.SaEast1="sa-east-1",t.UsEast1="us-east-1",t.UsWest1="us-west-1",t.UsWest2="us-west-2"})(dq=nr.FunctionRegion||(nr.FunctionRegion={}))});var Ww=y(Vo=>{"use strict";var hq=Vo&&Vo.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(l){try{c(n.next(l))}catch(f){s(f)}}function u(l){try{c(n.throw(l))}catch(f){s(f)}}function c(l){l.done?o(l.value):i(l.value).then(a,u)}c((n=n.apply(t,e||[])).next())})};Object.defineProperty(Vo,"__esModule",{value:!0});Vo.FunctionsClient=void 0;var pq=Gw(),pl=im(),om=class{constructor(e,{headers:r={},customFetch:n,region:i=pl.FunctionRegion.Any}={}){this.url=e,this.headers=r,this.region=i,this.fetch=(0,pq.resolveFetch)(n)}setAuth(e){this.headers.Authorization=`Bearer ${e}`}invoke(e,r={}){var n;return hq(this,void 0,void 0,function*(){try{let{headers:i,method:o,body:s}=r,a={},{region:u}=r;u||(u=this.region),u&&u!=="any"&&(a["x-region"]=u);let c;s&&(i&&!Object.prototype.hasOwnProperty.call(i,"Content-Type")||!i)&&(typeof Blob<"u"&&s instanceof Blob||s instanceof ArrayBuffer?(a["Content-Type"]="application/octet-stream",c=s):typeof s=="string"?(a["Content-Type"]="text/plain",c=s):typeof FormData<"u"&&s instanceof FormData?c=s:(a["Content-Type"]="application/json",c=JSON.stringify(s)));let l=yield this.fetch(`${this.url}/${e}`,{method:o||"POST",headers:Object.assign(Object.assign(Object.assign({},a),this.headers),i),body:c}).catch(p=>{throw new pl.FunctionsFetchError(p)}),f=l.headers.get("x-relay-error");if(f&&f==="true")throw new pl.FunctionsRelayError(l);if(!l.ok)throw new pl.FunctionsHttpError(l);let h=((n=l.headers.get("Content-Type"))!==null&&n!==void 0?n:"text/plain").split(";")[0].trim(),d;return h==="application/json"?d=yield l.json():h==="application/octet-stream"?d=yield l.blob():h==="text/event-stream"?d=l:h==="multipart/form-data"?d=yield l.formData():d=yield l.text(),{data:d,error:null}}catch(i){return{data:null,error:i}}})}};Vo.FunctionsClient=om});var sm=y(Mt=>{"use strict";Object.defineProperty(Mt,"__esModule",{value:!0});Mt.FunctionRegion=Mt.FunctionsRelayError=Mt.FunctionsHttpError=Mt.FunctionsFetchError=Mt.FunctionsError=Mt.FunctionsClient=void 0;var mq=Ww();Object.defineProperty(Mt,"FunctionsClient",{enumerable:!0,get:function(){return mq.FunctionsClient}});var Ua=im();Object.defineProperty(Mt,"FunctionsError",{enumerable:!0,get:function(){return Ua.FunctionsError}});Object.defineProperty(Mt,"FunctionsFetchError",{enumerable:!0,get:function(){return Ua.FunctionsFetchError}});Object.defineProperty(Mt,"FunctionsHttpError",{enumerable:!0,get:function(){return Ua.FunctionsHttpError}});Object.defineProperty(Mt,"FunctionsRelayError",{enumerable:!0,get:function(){return Ua.FunctionsRelayError}});Object.defineProperty(Mt,"FunctionRegion",{enumerable:!0,get:function(){return Ua.FunctionRegion}})});var cm=y(um=>{"use strict";Object.defineProperty(um,"__esModule",{value:!0});var am=class extends Error{constructor(e){super(e.message),this.name="PostgrestError",this.details=e.details,this.hint=e.hint,this.code=e.code}};um.default=am});var fm=y(Va=>{"use strict";var Kw=Va&&Va.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Va,"__esModule",{value:!0});var gq=Kw((xi(),ke(Si))),yq=Kw(cm()),lm=class{constructor(e){this.shouldThrowOnError=!1,this.method=e.method,this.url=e.url,this.headers=e.headers,this.schema=e.schema,this.body=e.body,this.shouldThrowOnError=e.shouldThrowOnError,this.signal=e.signal,this.isMaybeSingle=e.isMaybeSingle,e.fetch?this.fetch=e.fetch:typeof fetch>"u"?this.fetch=gq.default:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(e,r){return this.headers=Object.assign({},this.headers),this.headers[e]=r,this}then(e,r){this.schema===void 0||(["GET","HEAD"].includes(this.method)?this.headers["Accept-Profile"]=this.schema:this.headers["Content-Profile"]=this.schema),this.method!=="GET"&&this.method!=="HEAD"&&(this.headers["Content-Type"]="application/json");let n=this.fetch,i=n(this.url.toString(),{method:this.method,headers:this.headers,body:JSON.stringify(this.body),signal:this.signal}).then(async o=>{var s,a,u;let c=null,l=null,f=null,h=o.status,d=o.statusText;if(o.ok){if(this.method!=="HEAD"){let w=await o.text();w===""||(this.headers.Accept==="text/csv"||this.headers.Accept&&this.headers.Accept.includes("application/vnd.pgrst.plan+text")?l=w:l=JSON.parse(w))}let v=(s=this.headers.Prefer)===null||s===void 0?void 0:s.match(/count=(exact|planned|estimated)/),g=(a=o.headers.get("content-range"))===null||a===void 0?void 0:a.split("/");v&&g&&g.length>1&&(f=parseInt(g[1])),this.isMaybeSingle&&this.method==="GET"&&Array.isArray(l)&&(l.length>1?(c={code:"PGRST116",details:`Results contain ${l.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},l=null,f=null,h=406,d="Not Acceptable"):l.length===1?l=l[0]:l=null)}else{let v=await o.text();try{c=JSON.parse(v),Array.isArray(c)&&o.status===404&&(l=[],c=null,h=200,d="OK")}catch{o.status===404&&v===""?(h=204,d="No Content"):c={message:v}}if(c&&this.isMaybeSingle&&(!((u=c?.details)===null||u===void 0)&&u.includes("0 rows"))&&(c=null,h=200,d="OK"),c&&this.shouldThrowOnError)throw new yq.default(c)}return{error:c,data:l,count:f,status:h,statusText:d}});return this.shouldThrowOnError||(i=i.catch(o=>{var s,a,u;return{error:{message:`${(s=o?.name)!==null&&s!==void 0?s:"FetchError"}: ${o?.message}`,details:`${(a=o?.stack)!==null&&a!==void 0?a:""}`,hint:"",code:`${(u=o?.code)!==null&&u!==void 0?u:""}`},data:null,count:null,status:0,statusText:""}})),i.then(e,r)}};Va.default=lm});var hm=y(Ha=>{"use strict";var Dq=Ha&&Ha.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ha,"__esModule",{value:!0});var vq=Dq(fm()),dm=class extends vq.default{select(e){let r=!1,n=(e??"*").split("").map(i=>/\s/.test(i)&&!r?"":(i==='"'&&(r=!r),i)).join("");return this.url.searchParams.set("select",n),this.headers.Prefer&&(this.headers.Prefer+=","),this.headers.Prefer+="return=representation",this}order(e,{ascending:r=!0,nullsFirst:n,foreignTable:i,referencedTable:o=i}={}){let s=o?`${o}.order`:"order",a=this.url.searchParams.get(s);return this.url.searchParams.set(s,`${a?`${a},`:""}${e}.${r?"asc":"desc"}${n===void 0?"":n?".nullsfirst":".nullslast"}`),this}limit(e,{foreignTable:r,referencedTable:n=r}={}){let i=typeof n>"u"?"limit":`${n}.limit`;return this.url.searchParams.set(i,`${e}`),this}range(e,r,{foreignTable:n,referencedTable:i=n}={}){let o=typeof i>"u"?"offset":`${i}.offset`,s=typeof i>"u"?"limit":`${i}.limit`;return this.url.searchParams.set(o,`${e}`),this.url.searchParams.set(s,`${r-e+1}`),this}abortSignal(e){return this.signal=e,this}single(){return this.headers.Accept="application/vnd.pgrst.object+json",this}maybeSingle(){return this.method==="GET"?this.headers.Accept="application/json":this.headers.Accept="application/vnd.pgrst.object+json",this.isMaybeSingle=!0,this}csv(){return this.headers.Accept="text/csv",this}geojson(){return this.headers.Accept="application/geo+json",this}explain({analyze:e=!1,verbose:r=!1,settings:n=!1,buffers:i=!1,wal:o=!1,format:s="text"}={}){var a;let u=[e?"analyze":null,r?"verbose":null,n?"settings":null,i?"buffers":null,o?"wal":null].filter(Boolean).join("|"),c=(a=this.headers.Accept)!==null&&a!==void 0?a:"application/json";return this.headers.Accept=`application/vnd.pgrst.plan+${s}; for="${c}"; options=${u};`,s==="json"?this:this}rollback(){var e;return((e=this.headers.Prefer)!==null&&e!==void 0?e:"").trim().length>0?this.headers.Prefer+=",tx=rollback":this.headers.Prefer="tx=rollback",this}returns(){return this}};Ha.default=dm});var ml=y(za=>{"use strict";var bq=za&&za.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(za,"__esModule",{value:!0});var wq=bq(hm()),pm=class extends wq.default{eq(e,r){return this.url.searchParams.append(e,`eq.${r}`),this}neq(e,r){return this.url.searchParams.append(e,`neq.${r}`),this}gt(e,r){return this.url.searchParams.append(e,`gt.${r}`),this}gte(e,r){return this.url.searchParams.append(e,`gte.${r}`),this}lt(e,r){return this.url.searchParams.append(e,`lt.${r}`),this}lte(e,r){return this.url.searchParams.append(e,`lte.${r}`),this}like(e,r){return this.url.searchParams.append(e,`like.${r}`),this}likeAllOf(e,r){return this.url.searchParams.append(e,`like(all).{${r.join(",")}}`),this}likeAnyOf(e,r){return this.url.searchParams.append(e,`like(any).{${r.join(",")}}`),this}ilike(e,r){return this.url.searchParams.append(e,`ilike.${r}`),this}ilikeAllOf(e,r){return this.url.searchParams.append(e,`ilike(all).{${r.join(",")}}`),this}ilikeAnyOf(e,r){return this.url.searchParams.append(e,`ilike(any).{${r.join(",")}}`),this}is(e,r){return this.url.searchParams.append(e,`is.${r}`),this}in(e,r){let n=Array.from(new Set(r)).map(i=>typeof i=="string"&&new RegExp("[,()]").test(i)?`"${i}"`:`${i}`).join(",");return this.url.searchParams.append(e,`in.(${n})`),this}contains(e,r){return typeof r=="string"?this.url.searchParams.append(e,`cs.${r}`):Array.isArray(r)?this.url.searchParams.append(e,`cs.{${r.join(",")}}`):this.url.searchParams.append(e,`cs.${JSON.stringify(r)}`),this}containedBy(e,r){return typeof r=="string"?this.url.searchParams.append(e,`cd.${r}`):Array.isArray(r)?this.url.searchParams.append(e,`cd.{${r.join(",")}}`):this.url.searchParams.append(e,`cd.${JSON.stringify(r)}`),this}rangeGt(e,r){return this.url.searchParams.append(e,`sr.${r}`),this}rangeGte(e,r){return this.url.searchParams.append(e,`nxl.${r}`),this}rangeLt(e,r){return this.url.searchParams.append(e,`sl.${r}`),this}rangeLte(e,r){return this.url.searchParams.append(e,`nxr.${r}`),this}rangeAdjacent(e,r){return this.url.searchParams.append(e,`adj.${r}`),this}overlaps(e,r){return typeof r=="string"?this.url.searchParams.append(e,`ov.${r}`):this.url.searchParams.append(e,`ov.{${r.join(",")}}`),this}textSearch(e,r,{config:n,type:i}={}){let o="";i==="plain"?o="pl":i==="phrase"?o="ph":i==="websearch"&&(o="w");let s=n===void 0?"":`(${n})`;return this.url.searchParams.append(e,`${o}fts${s}.${r}`),this}match(e){return Object.entries(e).forEach(([r,n])=>{this.url.searchParams.append(r,`eq.${n}`)}),this}not(e,r,n){return this.url.searchParams.append(e,`not.${r}.${n}`),this}or(e,{foreignTable:r,referencedTable:n=r}={}){let i=n?`${n}.or`:"or";return this.url.searchParams.append(i,`(${e})`),this}filter(e,r,n){return this.url.searchParams.append(e,`${r}.${n}`),this}};za.default=pm});var gm=y(Wa=>{"use strict";var _q=Wa&&Wa.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Wa,"__esModule",{value:!0});var Ga=_q(ml()),mm=class{constructor(e,{headers:r={},schema:n,fetch:i}){this.url=e,this.headers=r,this.schema=n,this.fetch=i}select(e,{head:r=!1,count:n}={}){let i=r?"HEAD":"GET",o=!1,s=(e??"*").split("").map(a=>/\s/.test(a)&&!o?"":(a==='"'&&(o=!o),a)).join("");return this.url.searchParams.set("select",s),n&&(this.headers.Prefer=`count=${n}`),new Ga.default({method:i,url:this.url,headers:this.headers,schema:this.schema,fetch:this.fetch,allowEmpty:!1})}insert(e,{count:r,defaultToNull:n=!0}={}){let i="POST",o=[];if(this.headers.Prefer&&o.push(this.headers.Prefer),r&&o.push(`count=${r}`),n||o.push("missing=default"),this.headers.Prefer=o.join(","),Array.isArray(e)){let s=e.reduce((a,u)=>a.concat(Object.keys(u)),[]);if(s.length>0){let a=[...new Set(s)].map(u=>`"${u}"`);this.url.searchParams.set("columns",a.join(","))}}return new Ga.default({method:i,url:this.url,headers:this.headers,schema:this.schema,body:e,fetch:this.fetch,allowEmpty:!1})}upsert(e,{onConflict:r,ignoreDuplicates:n=!1,count:i,defaultToNull:o=!0}={}){let s="POST",a=[`resolution=${n?"ignore":"merge"}-duplicates`];if(r!==void 0&&this.url.searchParams.set("on_conflict",r),this.headers.Prefer&&a.push(this.headers.Prefer),i&&a.push(`count=${i}`),o||a.push("missing=default"),this.headers.Prefer=a.join(","),Array.isArray(e)){let u=e.reduce((c,l)=>c.concat(Object.keys(l)),[]);if(u.length>0){let c=[...new Set(u)].map(l=>`"${l}"`);this.url.searchParams.set("columns",c.join(","))}}return new Ga.default({method:s,url:this.url,headers:this.headers,schema:this.schema,body:e,fetch:this.fetch,allowEmpty:!1})}update(e,{count:r}={}){let n="PATCH",i=[];return this.headers.Prefer&&i.push(this.headers.Prefer),r&&i.push(`count=${r}`),this.headers.Prefer=i.join(","),new Ga.default({method:n,url:this.url,headers:this.headers,schema:this.schema,body:e,fetch:this.fetch,allowEmpty:!1})}delete({count:e}={}){let r="DELETE",n=[];return e&&n.push(`count=${e}`),this.headers.Prefer&&n.unshift(this.headers.Prefer),this.headers.Prefer=n.join(","),new Ga.default({method:r,url:this.url,headers:this.headers,schema:this.schema,fetch:this.fetch,allowEmpty:!1})}};Wa.default=mm});var Yw=y(gl=>{"use strict";Object.defineProperty(gl,"__esModule",{value:!0});gl.version=void 0;gl.version="0.0.0-automated"});var Jw=y(yl=>{"use strict";Object.defineProperty(yl,"__esModule",{value:!0});yl.DEFAULT_HEADERS=void 0;var Eq=Yw();yl.DEFAULT_HEADERS={"X-Client-Info":`postgrest-js/${Eq.version}`}});var Zw=y(Ka=>{"use strict";var Xw=Ka&&Ka.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ka,"__esModule",{value:!0});var Cq=Xw(gm()),Sq=Xw(ml()),xq=Jw(),ym=class t{constructor(e,{headers:r={},schema:n,fetch:i}={}){this.url=e,this.headers=Object.assign(Object.assign({},xq.DEFAULT_HEADERS),r),this.schemaName=n,this.fetch=i}from(e){let r=new URL(`${this.url}/${e}`);return new Cq.default(r,{headers:Object.assign({},this.headers),schema:this.schemaName,fetch:this.fetch})}schema(e){return new t(this.url,{headers:this.headers,schema:e,fetch:this.fetch})}rpc(e,r={},{head:n=!1,get:i=!1,count:o}={}){let s,a=new URL(`${this.url}/rpc/${e}`),u;n||i?(s=n?"HEAD":"GET",Object.entries(r).filter(([l,f])=>f!==void 0).map(([l,f])=>[l,Array.isArray(f)?`{${f.join(",")}}`:`${f}`]).forEach(([l,f])=>{a.searchParams.append(l,f)})):(s="POST",u=r);let c=Object.assign({},this.headers);return o&&(c.Prefer=`count=${o}`),new Sq.default({method:s,url:a,headers:c,schema:this.schemaName,body:u,fetch:this.fetch,allowEmpty:!1})}};Ka.default=ym});var o_=y(Dt=>{"use strict";var Ho=Dt&&Dt.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Dt,"__esModule",{value:!0});Dt.PostgrestError=Dt.PostgrestBuilder=Dt.PostgrestTransformBuilder=Dt.PostgrestFilterBuilder=Dt.PostgrestQueryBuilder=Dt.PostgrestClient=void 0;var Qw=Ho(Zw());Dt.PostgrestClient=Qw.default;var e_=Ho(gm());Dt.PostgrestQueryBuilder=e_.default;var t_=Ho(ml());Dt.PostgrestFilterBuilder=t_.default;var r_=Ho(hm());Dt.PostgrestTransformBuilder=r_.default;var n_=Ho(fm());Dt.PostgrestBuilder=n_.default;var i_=Ho(cm());Dt.PostgrestError=i_.default;Dt.default={PostgrestClient:Qw.default,PostgrestQueryBuilder:e_.default,PostgrestFilterBuilder:t_.default,PostgrestTransformBuilder:r_.default,PostgrestBuilder:n_.default,PostgrestError:i_.default}});var vm={};mn(vm,{RealtimeClient:()=>Dm});var Dm,bm=ut(()=>{Dm=class{constructor(){}connect(){}disconnect(){}}});var Ja=y(Nr=>{"use strict";Object.defineProperty(Nr,"__esModule",{value:!0});Nr.StorageUnknownError=Nr.StorageApiError=Nr.isStorageError=Nr.StorageError=void 0;var Ya=class extends Error{constructor(e){super(e),this.__isStorageError=!0,this.name="StorageError"}};Nr.StorageError=Ya;function Fq(t){return typeof t=="object"&&t!==null&&"__isStorageError"in t}Nr.isStorageError=Fq;var wm=class extends Ya{constructor(e,r){super(e),this.name="StorageApiError",this.status=r}toJSON(){return{name:this.name,message:this.message,status:this.status}}};Nr.StorageApiError=wm;var _m=class extends Ya{constructor(e,r){super(e),this.name="StorageUnknownError",this.originalError=r}};Nr.StorageUnknownError=_m});var Dl=y(ct=>{"use strict";var Oq=ct&&ct.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),Aq=ct&&ct.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),s_=ct&&ct.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&Oq(e,t,r);return Aq(e,t),e},kq=ct&&ct.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(l){try{c(n.next(l))}catch(f){s(f)}}function u(l){try{c(n.throw(l))}catch(f){s(f)}}function c(l){l.done?o(l.value):i(l.value).then(a,u)}c((n=n.apply(t,e||[])).next())})};Object.defineProperty(ct,"__esModule",{value:!0});ct.recursiveToCamel=ct.resolveResponse=ct.resolveFetch=void 0;var Tq=t=>{let e;return t?e=t:typeof fetch>"u"?e=(...r)=>Promise.resolve().then(()=>s_((xi(),ke(Si)))).then(({default:n})=>n(...r)):e=fetch,(...r)=>e(...r)};ct.resolveFetch=Tq;var Pq=()=>kq(void 0,void 0,void 0,function*(){return typeof Response>"u"?(yield Promise.resolve().then(()=>s_((xi(),ke(Si))))).Response:Response});ct.resolveResponse=Pq;var Rq=t=>{if(Array.isArray(t))return t.map(r=>(0,ct.recursiveToCamel)(r));if(typeof t=="function"||t!==Object(t))return t;let e={};return Object.entries(t).forEach(([r,n])=>{let i=r.replace(/([-_][a-z])/gi,o=>o.toUpperCase().replace(/[-_]/g,""));e[i]=(0,ct.recursiveToCamel)(n)}),e};ct.recursiveToCamel=Rq});var Sm=y(Ut=>{"use strict";var Fi=Ut&&Ut.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(l){try{c(n.next(l))}catch(f){s(f)}}function u(l){try{c(n.throw(l))}catch(f){s(f)}}function c(l){l.done?o(l.value):i(l.value).then(a,u)}c((n=n.apply(t,e||[])).next())})};Object.defineProperty(Ut,"__esModule",{value:!0});Ut.remove=Ut.head=Ut.put=Ut.post=Ut.get=void 0;var Em=Ja(),$q=Dl(),Cm=t=>t.msg||t.message||t.error_description||t.error||JSON.stringify(t),Iq=(t,e,r)=>Fi(void 0,void 0,void 0,function*(){let n=yield(0,$q.resolveResponse)();t instanceof n&&!r?.noResolveJson?t.json().then(i=>{e(new Em.StorageApiError(Cm(i),t.status||500))}).catch(i=>{e(new Em.StorageUnknownError(Cm(i),i))}):e(new Em.StorageUnknownError(Cm(t),t))}),jq=(t,e,r,n)=>{let i={method:t,headers:e?.headers||{}};return t==="GET"?i:(i.headers=Object.assign({"Content-Type":"application/json"},e?.headers),n&&(i.body=JSON.stringify(n)),Object.assign(Object.assign({},i),r))};function Xa(t,e,r,n,i,o){return Fi(this,void 0,void 0,function*(){return new Promise((s,a)=>{t(r,jq(e,n,i,o)).then(u=>{if(!u.ok)throw u;return n?.noResolveJson?u:u.json()}).then(u=>s(u)).catch(u=>Iq(u,a,n))})})}function Nq(t,e,r,n){return Fi(this,void 0,void 0,function*(){return Xa(t,"GET",e,r,n)})}Ut.get=Nq;function Lq(t,e,r,n,i){return Fi(this,void 0,void 0,function*(){return Xa(t,"POST",e,n,i,r)})}Ut.post=Lq;function Bq(t,e,r,n,i){return Fi(this,void 0,void 0,function*(){return Xa(t,"PUT",e,n,i,r)})}Ut.put=Bq;function qq(t,e,r,n){return Fi(this,void 0,void 0,function*(){return Xa(t,"HEAD",e,Object.assign(Object.assign({},r),{noResolveJson:!0}),n)})}Ut.head=qq;function Mq(t,e,r,n,i){return Fi(this,void 0,void 0,function*(){return Xa(t,"DELETE",e,n,i,r)})}Ut.remove=Mq});var c_=y(Za=>{"use strict";var Vt=Za&&Za.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(l){try{c(n.next(l))}catch(f){s(f)}}function u(l){try{c(n.throw(l))}catch(f){s(f)}}function c(l){l.done?o(l.value):i(l.value).then(a,u)}c((n=n.apply(t,e||[])).next())})};Object.defineProperty(Za,"__esModule",{value:!0});var Ht=Ja(),Lr=Sm(),a_=Dl(),Uq={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},u_={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1},xm=class{constructor(e,r={},n,i){this.url=e,this.headers=r,this.bucketId=n,this.fetch=(0,a_.resolveFetch)(i)}uploadOrUpdate(e,r,n,i){return Vt(this,void 0,void 0,function*(){try{let o,s=Object.assign(Object.assign({},u_),i),a=Object.assign(Object.assign({},this.headers),e==="POST"&&{"x-upsert":String(s.upsert)}),u=s.metadata;typeof Blob<"u"&&n instanceof Blob?(o=new FormData,o.append("cacheControl",s.cacheControl),u&&o.append("metadata",this.encodeMetadata(u)),o.append("",n)):typeof FormData<"u"&&n instanceof FormData?(o=n,o.append("cacheControl",s.cacheControl),u&&o.append("metadata",this.encodeMetadata(u))):(o=n,a["cache-control"]=`max-age=${s.cacheControl}`,a["content-type"]=s.contentType,u&&(a["x-metadata"]=this.toBase64(this.encodeMetadata(u)))),i?.headers&&(a=Object.assign(Object.assign({},a),i.headers));let c=this._removeEmptyFolders(r),l=this._getFinalPath(c),f=yield this.fetch(`${this.url}/object/${l}`,Object.assign({method:e,body:o,headers:a},s?.duplex?{duplex:s.duplex}:{})),h=yield f.json();return f.ok?{data:{path:c,id:h.Id,fullPath:h.Key},error:null}:{data:null,error:h}}catch(o){if((0,Ht.isStorageError)(o))return{data:null,error:o};throw o}})}upload(e,r,n){return Vt(this,void 0,void 0,function*(){return this.uploadOrUpdate("POST",e,r,n)})}uploadToSignedUrl(e,r,n,i){return Vt(this,void 0,void 0,function*(){let o=this._removeEmptyFolders(e),s=this._getFinalPath(o),a=new URL(this.url+`/object/upload/sign/${s}`);a.searchParams.set("token",r);try{let u,c=Object.assign({upsert:u_.upsert},i),l=Object.assign(Object.assign({},this.headers),{"x-upsert":String(c.upsert)});typeof Blob<"u"&&n instanceof Blob?(u=new FormData,u.append("cacheControl",c.cacheControl),u.append("",n)):typeof FormData<"u"&&n instanceof FormData?(u=n,u.append("cacheControl",c.cacheControl)):(u=n,l["cache-control"]=`max-age=${c.cacheControl}`,l["content-type"]=c.contentType);let f=yield this.fetch(a.toString(),{method:"PUT",body:u,headers:l}),h=yield f.json();return f.ok?{data:{path:o,fullPath:h.Key},error:null}:{data:null,error:h}}catch(u){if((0,Ht.isStorageError)(u))return{data:null,error:u};throw u}})}createSignedUploadUrl(e,r){return Vt(this,void 0,void 0,function*(){try{let n=this._getFinalPath(e),i=Object.assign({},this.headers);r?.upsert&&(i["x-upsert"]="true");let o=yield(0,Lr.post)(this.fetch,`${this.url}/object/upload/sign/${n}`,{},{headers:i}),s=new URL(this.url+o.url),a=s.searchParams.get("token");if(!a)throw new Ht.StorageError("No token returned by API");return{data:{signedUrl:s.toString(),path:e,token:a},error:null}}catch(n){if((0,Ht.isStorageError)(n))return{data:null,error:n};throw n}})}update(e,r,n){return Vt(this,void 0,void 0,function*(){return this.uploadOrUpdate("PUT",e,r,n)})}move(e,r,n){return Vt(this,void 0,void 0,function*(){try{return{data:yield(0,Lr.post)(this.fetch,`${this.url}/object/move`,{bucketId:this.bucketId,sourceKey:e,destinationKey:r,destinationBucket:n?.destinationBucket},{headers:this.headers}),error:null}}catch(i){if((0,Ht.isStorageError)(i))return{data:null,error:i};throw i}})}copy(e,r,n){return Vt(this,void 0,void 0,function*(){try{return{data:{path:(yield(0,Lr.post)(this.fetch,`${this.url}/object/copy`,{bucketId:this.bucketId,sourceKey:e,destinationKey:r,destinationBucket:n?.destinationBucket},{headers:this.headers})).Key},error:null}}catch(i){if((0,Ht.isStorageError)(i))return{data:null,error:i};throw i}})}createSignedUrl(e,r,n){return Vt(this,void 0,void 0,function*(){try{let i=this._getFinalPath(e),o=yield(0,Lr.post)(this.fetch,`${this.url}/object/sign/${i}`,Object.assign({expiresIn:r},n?.transform?{transform:n.transform}:{}),{headers:this.headers}),s=n?.download?`&download=${n.download===!0?"":n.download}`:"";return o={signedUrl:encodeURI(`${this.url}${o.signedURL}${s}`)},{data:o,error:null}}catch(i){if((0,Ht.isStorageError)(i))return{data:null,error:i};throw i}})}createSignedUrls(e,r,n){return Vt(this,void 0,void 0,function*(){try{let i=yield(0,Lr.post)(this.fetch,`${this.url}/object/sign/${this.bucketId}`,{expiresIn:r,paths:e},{headers:this.headers}),o=n?.download?`&download=${n.download===!0?"":n.download}`:"";return{data:i.map(s=>Object.assign(Object.assign({},s),{signedUrl:s.signedURL?encodeURI(`${this.url}${s.signedURL}${o}`):null})),error:null}}catch(i){if((0,Ht.isStorageError)(i))return{data:null,error:i};throw i}})}download(e,r){return Vt(this,void 0,void 0,function*(){let i=typeof r?.transform<"u"?"render/image/authenticated":"object",o=this.transformOptsToQueryString(r?.transform||{}),s=o?`?${o}`:"";try{let a=this._getFinalPath(e);return{data:yield(yield(0,Lr.get)(this.fetch,`${this.url}/${i}/${a}${s}`,{headers:this.headers,noResolveJson:!0})).blob(),error:null}}catch(a){if((0,Ht.isStorageError)(a))return{data:null,error:a};throw a}})}info(e){return Vt(this,void 0,void 0,function*(){let r=this._getFinalPath(e);try{let n=yield(0,Lr.get)(this.fetch,`${this.url}/object/info/${r}`,{headers:this.headers});return{data:(0,a_.recursiveToCamel)(n),error:null}}catch(n){if((0,Ht.isStorageError)(n))return{data:null,error:n};throw n}})}exists(e){return Vt(this,void 0,void 0,function*(){let r=this._getFinalPath(e);try{return yield(0,Lr.head)(this.fetch,`${this.url}/object/${r}`,{headers:this.headers}),{data:!0,error:null}}catch(n){if((0,Ht.isStorageError)(n)&&n instanceof Ht.StorageUnknownError){let i=n.originalError;if([400,404].includes(i?.status))return{data:!1,error:n}}throw n}})}getPublicUrl(e,r){let n=this._getFinalPath(e),i=[],o=r?.download?`download=${r.download===!0?"":r.download}`:"";o!==""&&i.push(o);let a=typeof r?.transform<"u"?"render/image":"object",u=this.transformOptsToQueryString(r?.transform||{});u!==""&&i.push(u);let c=i.join("&");return c!==""&&(c=`?${c}`),{data:{publicUrl:encodeURI(`${this.url}/${a}/public/${n}${c}`)}}}remove(e){return Vt(this,void 0,void 0,function*(){try{return{data:yield(0,Lr.remove)(this.fetch,`${this.url}/object/${this.bucketId}`,{prefixes:e},{headers:this.headers}),error:null}}catch(r){if((0,Ht.isStorageError)(r))return{data:null,error:r};throw r}})}list(e,r,n){return Vt(this,void 0,void 0,function*(){try{let i=Object.assign(Object.assign(Object.assign({},Uq),r),{prefix:e||""});return{data:yield(0,Lr.post)(this.fetch,`${this.url}/object/list/${this.bucketId}`,i,{headers:this.headers},n),error:null}}catch(i){if((0,Ht.isStorageError)(i))return{data:null,error:i};throw i}})}encodeMetadata(e){return JSON.stringify(e)}toBase64(e){return typeof Buffer<"u"?Buffer.from(e).toString("base64"):btoa(e)}_getFinalPath(e){return`${this.bucketId}/${e}`}_removeEmptyFolders(e){return e.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")}transformOptsToQueryString(e){let r=[];return e.width&&r.push(`width=${e.width}`),e.height&&r.push(`height=${e.height}`),e.resize&&r.push(`resize=${e.resize}`),e.format&&r.push(`format=${e.format}`),e.quality&&r.push(`quality=${e.quality}`),r.join("&")}};Za.default=xm});var l_=y(vl=>{"use strict";Object.defineProperty(vl,"__esModule",{value:!0});vl.version=void 0;vl.version="2.7.1"});var f_=y(bl=>{"use strict";Object.defineProperty(bl,"__esModule",{value:!0});bl.DEFAULT_HEADERS=void 0;var Vq=l_();bl.DEFAULT_HEADERS={"X-Client-Info":`storage-js/${Vq.version}`}});var d_=y(Qa=>{"use strict";var zo=Qa&&Qa.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(l){try{c(n.next(l))}catch(f){s(f)}}function u(l){try{c(n.throw(l))}catch(f){s(f)}}function c(l){l.done?o(l.value):i(l.value).then(a,u)}c((n=n.apply(t,e||[])).next())})};Object.defineProperty(Qa,"__esModule",{value:!0});var Hq=f_(),Go=Ja(),Wo=Sm(),zq=Dl(),Fm=class{constructor(e,r={},n){this.url=e,this.headers=Object.assign(Object.assign({},Hq.DEFAULT_HEADERS),r),this.fetch=(0,zq.resolveFetch)(n)}listBuckets(){return zo(this,void 0,void 0,function*(){try{return{data:yield(0,Wo.get)(this.fetch,`${this.url}/bucket`,{headers:this.headers}),error:null}}catch(e){if((0,Go.isStorageError)(e))return{data:null,error:e};throw e}})}getBucket(e){return zo(this,void 0,void 0,function*(){try{return{data:yield(0,Wo.get)(this.fetch,`${this.url}/bucket/${e}`,{headers:this.headers}),error:null}}catch(r){if((0,Go.isStorageError)(r))return{data:null,error:r};throw r}})}createBucket(e,r={public:!1}){return zo(this,void 0,void 0,function*(){try{return{data:yield(0,Wo.post)(this.fetch,`${this.url}/bucket`,{id:e,name:e,public:r.public,file_size_limit:r.fileSizeLimit,allowed_mime_types:r.allowedMimeTypes},{headers:this.headers}),error:null}}catch(n){if((0,Go.isStorageError)(n))return{data:null,error:n};throw n}})}updateBucket(e,r){return zo(this,void 0,void 0,function*(){try{return{data:yield(0,Wo.put)(this.fetch,`${this.url}/bucket/${e}`,{id:e,name:e,public:r.public,file_size_limit:r.fileSizeLimit,allowed_mime_types:r.allowedMimeTypes},{headers:this.headers}),error:null}}catch(n){if((0,Go.isStorageError)(n))return{data:null,error:n};throw n}})}emptyBucket(e){return zo(this,void 0,void 0,function*(){try{return{data:yield(0,Wo.post)(this.fetch,`${this.url}/bucket/${e}/empty`,{},{headers:this.headers}),error:null}}catch(r){if((0,Go.isStorageError)(r))return{data:null,error:r};throw r}})}deleteBucket(e){return zo(this,void 0,void 0,function*(){try{return{data:yield(0,Wo.remove)(this.fetch,`${this.url}/bucket/${e}`,{},{headers:this.headers}),error:null}}catch(r){if((0,Go.isStorageError)(r))return{data:null,error:r};throw r}})}};Qa.default=Fm});var p_=y(Ko=>{"use strict";var h_=Ko&&Ko.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ko,"__esModule",{value:!0});Ko.StorageClient=void 0;var Gq=h_(c_()),Wq=h_(d_()),Om=class extends Wq.default{constructor(e,r={},n){super(e,r,n)}from(e){return new Gq.default(this.url,this.headers,e,this.fetch)}};Ko.StorageClient=Om});var g_=y(m_=>{"use strict";Object.defineProperty(m_,"__esModule",{value:!0})});var D_=y(Br=>{"use strict";var Kq=Br&&Br.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),y_=Br&&Br.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Kq(e,t,r)};Object.defineProperty(Br,"__esModule",{value:!0});Br.StorageClient=void 0;var Yq=p_();Object.defineProperty(Br,"StorageClient",{enumerable:!0,get:function(){return Yq.StorageClient}});y_(g_(),Br);y_(Ja(),Br)});var v_=y(wl=>{"use strict";Object.defineProperty(wl,"__esModule",{value:!0});wl.version=void 0;wl.version="2.46.0"});var b_=y(ir=>{"use strict";Object.defineProperty(ir,"__esModule",{value:!0});ir.DEFAULT_REALTIME_OPTIONS=ir.DEFAULT_AUTH_OPTIONS=ir.DEFAULT_DB_OPTIONS=ir.DEFAULT_GLOBAL_OPTIONS=ir.DEFAULT_HEADERS=void 0;var Jq=v_(),eu="";typeof Deno<"u"?eu="deno":typeof document<"u"?eu="web":typeof navigator<"u"&&navigator.product==="ReactNative"?eu="react-native":eu="node";ir.DEFAULT_HEADERS={"X-Client-Info":`supabase-js-${eu}/${Jq.version}`};ir.DEFAULT_GLOBAL_OPTIONS={headers:ir.DEFAULT_HEADERS};ir.DEFAULT_DB_OPTIONS={schema:"public"};ir.DEFAULT_AUTH_OPTIONS={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"};ir.DEFAULT_REALTIME_OPTIONS={}});var __=y(lt=>{"use strict";var Xq=lt&&lt.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),Zq=lt&&lt.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Qq=lt&&lt.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&Xq(e,t,r);return Zq(e,t),e},eM=lt&&lt.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(l){try{c(n.next(l))}catch(f){s(f)}}function u(l){try{c(n.throw(l))}catch(f){s(f)}}function c(l){l.done?o(l.value):i(l.value).then(a,u)}c((n=n.apply(t,e||[])).next())})};Object.defineProperty(lt,"__esModule",{value:!0});lt.fetchWithAuth=lt.resolveHeadersConstructor=lt.resolveFetch=void 0;var w_=Qq((xi(),ke(Si))),tM=t=>{let e;return t?e=t:typeof fetch>"u"?e=w_.default:e=fetch,(...r)=>e(...r)};lt.resolveFetch=tM;var rM=()=>typeof Headers>"u"?w_.Headers:Headers;lt.resolveHeadersConstructor=rM;var nM=(t,e,r)=>{let n=(0,lt.resolveFetch)(r),i=(0,lt.resolveHeadersConstructor)();return(o,s)=>eM(void 0,void 0,void 0,function*(){var a;let u=(a=yield e())!==null&&a!==void 0?a:t,c=new i(s?.headers);return c.has("apikey")||c.set("apikey",t),c.has("Authorization")||c.set("Authorization",`Bearer ${u}`),n(o,Object.assign(Object.assign({},s),{headers:c}))})};lt.fetchWithAuth=nM});var E_=y(mr=>{"use strict";var iM=mr&&mr.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(l){try{c(n.next(l))}catch(f){s(f)}}function u(l){try{c(n.throw(l))}catch(f){s(f)}}function c(l){l.done?o(l.value):i(l.value).then(a,u)}c((n=n.apply(t,e||[])).next())})};Object.defineProperty(mr,"__esModule",{value:!0});mr.applySettingDefaults=mr.isBrowser=mr.stripTrailingSlash=mr.uuid=void 0;function oM(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var e=Math.random()*16|0,r=t=="x"?e:e&3|8;return r.toString(16)})}mr.uuid=oM;function sM(t){return t.replace(/\/$/,"")}mr.stripTrailingSlash=sM;var aM=()=>typeof window<"u";mr.isBrowser=aM;function uM(t,e){let{db:r,auth:n,realtime:i,global:o}=t,{db:s,auth:a,realtime:u,global:c}=e,l={db:Object.assign(Object.assign({},s),r),auth:Object.assign(Object.assign({},a),n),realtime:Object.assign(Object.assign({},u),i),global:Object.assign(Object.assign({},c),o),accessToken:()=>iM(this,void 0,void 0,function*(){return""})};return t.accessToken?l.accessToken=t.accessToken:delete l.accessToken,l}mr.applySettingDefaults=uM});var Am=y(_l=>{"use strict";Object.defineProperty(_l,"__esModule",{value:!0});_l.version=void 0;_l.version="2.65.1"});var El=y(ft=>{"use strict";Object.defineProperty(ft,"__esModule",{value:!0});ft.API_VERSIONS=ft.API_VERSION_HEADER_NAME=ft.NETWORK_FAILURE=ft.EXPIRY_MARGIN=ft.DEFAULT_HEADERS=ft.AUDIENCE=ft.STORAGE_KEY=ft.GOTRUE_URL=void 0;var cM=Am();ft.GOTRUE_URL="http://localhost:9999";ft.STORAGE_KEY="supabase.auth.token";ft.AUDIENCE="";ft.DEFAULT_HEADERS={"X-Client-Info":`gotrue-js/${cM.version}`};ft.EXPIRY_MARGIN=10;ft.NETWORK_FAILURE={MAX_RETRIES:10,RETRY_INTERVAL:2};ft.API_VERSION_HEADER_NAME="X-Supabase-Api-Version";ft.API_VERSIONS={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}}});var Yo=y(te=>{"use strict";var lM=te&&te.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),fM=te&&te.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),dM=te&&te.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&lM(e,t,r);return fM(e,t),e};Object.defineProperty(te,"__esModule",{value:!0});te.parseResponseAPIVersion=te.getCodeChallengeAndMethod=te.generatePKCEChallenge=te.generatePKCEVerifier=te.retryable=te.sleep=te.decodeJWTPayload=te.Deferred=te.decodeBase64URL=te.removeItemAsync=te.getItemAsync=te.setItemAsync=te.looksLikeFetchResponse=te.resolveFetch=te.parseParametersFromURL=te.supportsLocalStorage=te.isBrowser=te.uuid=te.expiresAt=void 0;var hM=El();function pM(t){return Math.round(Date.now()/1e3)+t}te.expiresAt=pM;function mM(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){let e=Math.random()*16|0;return(t=="x"?e:e&3|8).toString(16)})}te.uuid=mM;var gM=()=>typeof document<"u";te.isBrowser=gM;var Oi={tested:!1,writable:!1},yM=()=>{if(!(0,te.isBrowser)())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(Oi.tested)return Oi.writable;let t=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(t,t),globalThis.localStorage.removeItem(t),Oi.tested=!0,Oi.writable=!0}catch{Oi.tested=!0,Oi.writable=!1}return Oi.writable};te.supportsLocalStorage=yM;function DM(t){let e={},r=new URL(t);if(r.hash&&r.hash[0]==="#")try{new URLSearchParams(r.hash.substring(1)).forEach((i,o)=>{e[o]=i})}catch{}return r.searchParams.forEach((n,i)=>{e[i]=n}),e}te.parseParametersFromURL=DM;var vM=t=>{let e;return t?e=t:typeof fetch>"u"?e=(...r)=>Promise.resolve().then(()=>dM((xi(),ke(Si)))).then(({default:n})=>n(...r)):e=fetch,(...r)=>e(...r)};te.resolveFetch=vM;var bM=t=>typeof t=="object"&&t!==null&&"status"in t&&"ok"in t&&"json"in t&&typeof t.json=="function";te.looksLikeFetchResponse=bM;var wM=async(t,e,r)=>{await t.setItem(e,JSON.stringify(r))};te.setItemAsync=wM;var _M=async(t,e)=>{let r=await t.getItem(e);if(!r)return null;try{return JSON.parse(r)}catch{return r}};te.getItemAsync=_M;var EM=async(t,e)=>{await t.removeItem(e)};te.removeItemAsync=EM;function C_(t){let e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",r="",n,i,o,s,a,u,c,l=0;for(t=t.replace("-","+").replace("_","/");l<t.length;)s=e.indexOf(t.charAt(l++)),a=e.indexOf(t.charAt(l++)),u=e.indexOf(t.charAt(l++)),c=e.indexOf(t.charAt(l++)),n=s<<2|a>>4,i=(a&15)<<4|u>>2,o=(u&3)<<6|c,r=r+String.fromCharCode(n),u!=64&&i!=0&&(r=r+String.fromCharCode(i)),c!=64&&o!=0&&(r=r+String.fromCharCode(o));return r}te.decodeBase64URL=C_;var Cl=class t{constructor(){this.promise=new t.promiseConstructor((e,r)=>{this.resolve=e,this.reject=r})}};te.Deferred=Cl;Cl.promiseConstructor=Promise;function CM(t){let e=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}=?$|[a-z0-9_-]{2}(==)?$)$/i,r=t.split(".");if(r.length!==3)throw new Error("JWT is not valid: not a JWT structure");if(!e.test(r[1]))throw new Error("JWT is not valid: payload is not in base64url format");let n=r[1];return JSON.parse(C_(n))}te.decodeJWTPayload=CM;async function SM(t){return await new Promise(e=>{setTimeout(()=>e(null),t)})}te.sleep=SM;function xM(t,e){return new Promise((n,i)=>{(async()=>{for(let o=0;o<1/0;o++)try{let s=await t(o);if(!e(o,null,s)){n(s);return}}catch(s){if(!e(o,s)){i(s);return}}})()})}te.retryable=xM;function FM(t){return("0"+t.toString(16)).substr(-2)}function S_(){let e=new Uint32Array(56);if(typeof crypto>"u"){let r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",n=r.length,i="";for(let o=0;o<56;o++)i+=r.charAt(Math.floor(Math.random()*n));return i}return crypto.getRandomValues(e),Array.from(e,FM).join("")}te.generatePKCEVerifier=S_;async function OM(t){let r=new TextEncoder().encode(t),n=await crypto.subtle.digest("SHA-256",r),i=new Uint8Array(n);return Array.from(i).map(o=>String.fromCharCode(o)).join("")}function AM(t){return btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function x_(t){if(!(typeof crypto<"u"&&typeof crypto.subtle<"u"&&typeof TextEncoder<"u"))return console.warn("WebCrypto API is not supported. Code challenge method will default to use plain instead of sha256."),t;let r=await OM(t);return AM(r)}te.generatePKCEChallenge=x_;async function kM(t,e,r=!1){let n=S_(),i=n;r&&(i+="/PASSWORD_RECOVERY"),await(0,te.setItemAsync)(t,`${e}-code-verifier`,i);let o=await x_(n);return[o,n===o?"plain":"s256"]}te.getCodeChallengeAndMethod=kM;var TM=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function PM(t){let e=t.headers.get(hM.API_VERSION_HEADER_NAME);if(!e||!e.match(TM))return null;try{return new Date(`${e}T00:00:00.0Z`)}catch{return null}}te.parseResponseAPIVersion=PM});var ru=y(he=>{"use strict";Object.defineProperty(he,"__esModule",{value:!0});he.isAuthWeakPasswordError=he.AuthWeakPasswordError=he.isAuthRetryableFetchError=he.AuthRetryableFetchError=he.AuthPKCEGrantCodeExchangeError=he.AuthImplicitGrantRedirectError=he.AuthInvalidCredentialsError=he.AuthInvalidTokenResponseError=he.isAuthSessionMissingError=he.AuthSessionMissingError=he.CustomAuthError=he.AuthUnknownError=he.isAuthApiError=he.AuthApiError=he.isAuthError=he.AuthError=void 0;var Jo=class extends Error{constructor(e,r,n){super(e),this.__isAuthError=!0,this.name="AuthError",this.status=r,this.code=n}};he.AuthError=Jo;function tu(t){return typeof t=="object"&&t!==null&&"__isAuthError"in t}he.isAuthError=tu;var km=class extends Jo{constructor(e,r,n){super(e,r,n),this.name="AuthApiError",this.status=r,this.code=n}};he.AuthApiError=km;function RM(t){return tu(t)&&t.name==="AuthApiError"}he.isAuthApiError=RM;var Tm=class extends Jo{constructor(e,r){super(e),this.name="AuthUnknownError",this.originalError=r}};he.AuthUnknownError=Tm;var qr=class extends Jo{constructor(e,r,n,i){super(e,n,i),this.name=r,this.status=n}};he.CustomAuthError=qr;var Pm=class extends qr{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}};he.AuthSessionMissingError=Pm;function $M(t){return tu(t)&&t.name==="AuthSessionMissingError"}he.isAuthSessionMissingError=$M;var Rm=class extends qr{constructor(){super("Auth session or user missing","AuthInvalidTokenResponseError",500,void 0)}};he.AuthInvalidTokenResponseError=Rm;var $m=class extends qr{constructor(e){super(e,"AuthInvalidCredentialsError",400,void 0)}};he.AuthInvalidCredentialsError=$m;var Im=class extends qr{constructor(e,r=null){super(e,"AuthImplicitGrantRedirectError",500,void 0),this.details=null,this.details=r}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}};he.AuthImplicitGrantRedirectError=Im;var jm=class extends qr{constructor(e,r=null){super(e,"AuthPKCEGrantCodeExchangeError",500,void 0),this.details=null,this.details=r}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}};he.AuthPKCEGrantCodeExchangeError=jm;var Nm=class extends qr{constructor(e,r){super(e,"AuthRetryableFetchError",r,void 0)}};he.AuthRetryableFetchError=Nm;function IM(t){return tu(t)&&t.name==="AuthRetryableFetchError"}he.isAuthRetryableFetchError=IM;var Lm=class extends qr{constructor(e,r,n){super(e,"AuthWeakPasswordError",r,"weak_password"),this.reasons=n}};he.AuthWeakPasswordError=Lm;function jM(t){return tu(t)&&t.name==="AuthWeakPasswordError"}he.isAuthWeakPasswordError=jM});var Mm=y(rt=>{"use strict";var NM=rt&&rt.__rest||function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r};Object.defineProperty(rt,"__esModule",{value:!0});rt._noResolveJsonResponse=rt._generateLinkResponse=rt._ssoResponse=rt._userResponse=rt._sessionResponsePassword=rt._sessionResponse=rt._request=rt.handleError=void 0;var Sl=El(),Bm=Yo(),Kn=ru(),Ai=t=>t.msg||t.message||t.error_description||t.error||JSON.stringify(t),LM=[502,503,504];async function qm(t){var e;if(!(0,Bm.looksLikeFetchResponse)(t))throw new Kn.AuthRetryableFetchError(Ai(t),0);if(LM.includes(t.status))throw new Kn.AuthRetryableFetchError(Ai(t),t.status);let r;try{r=await t.json()}catch(o){throw new Kn.AuthUnknownError(Ai(o),o)}let n,i=(0,Bm.parseResponseAPIVersion)(t);if(i&&i.getTime()>=Sl.API_VERSIONS["2024-01-01"].timestamp&&typeof r=="object"&&r&&typeof r.code=="string"?n=r.code:typeof r=="object"&&r&&typeof r.error_code=="string"&&(n=r.error_code),n){if(n==="weak_password")throw new Kn.AuthWeakPasswordError(Ai(r),t.status,((e=r.weak_password)===null||e===void 0?void 0:e.reasons)||[]);if(n==="session_not_found")throw new Kn.AuthSessionMissingError}else if(typeof r=="object"&&r&&typeof r.weak_password=="object"&&r.weak_password&&Array.isArray(r.weak_password.reasons)&&r.weak_password.reasons.length&&r.weak_password.reasons.reduce((o,s)=>o&&typeof s=="string",!0))throw new Kn.AuthWeakPasswordError(Ai(r),t.status,r.weak_password.reasons);throw new Kn.AuthApiError(Ai(r),t.status||500,n)}rt.handleError=qm;var BM=(t,e,r,n)=>{let i={method:t,headers:e?.headers||{}};return t==="GET"?i:(i.headers=Object.assign({"Content-Type":"application/json;charset=UTF-8"},e?.headers),i.body=JSON.stringify(n),Object.assign(Object.assign({},i),r))};async function qM(t,e,r,n){var i;let o=Object.assign({},n?.headers);o[Sl.API_VERSION_HEADER_NAME]||(o[Sl.API_VERSION_HEADER_NAME]=Sl.API_VERSIONS["2024-01-01"].name),n?.jwt&&(o.Authorization=`Bearer ${n.jwt}`);let s=(i=n?.query)!==null&&i!==void 0?i:{};n?.redirectTo&&(s.redirect_to=n.redirectTo);let a=Object.keys(s).length?"?"+new URLSearchParams(s).toString():"",u=await MM(t,e,r+a,{headers:o,noResolveJson:n?.noResolveJson},{},n?.body);return n?.xform?n?.xform(u):{data:Object.assign({},u),error:null}}rt._request=qM;async function MM(t,e,r,n,i,o){let s=BM(e,n,i,o),a;try{a=await t(r,Object.assign({},s))}catch(u){throw console.error(u),new Kn.AuthRetryableFetchError(Ai(u),0)}if(a.ok||await qm(a),n?.noResolveJson)return a;try{return await a.json()}catch(u){await qm(u)}}function F_(t){var e;let r=null;WM(t)&&(r=Object.assign({},t),t.expires_at||(r.expires_at=(0,Bm.expiresAt)(t.expires_in)));let n=(e=t.user)!==null&&e!==void 0?e:t;return{data:{session:r,user:n},error:null}}rt._sessionResponse=F_;function UM(t){let e=F_(t);return!e.error&&t.weak_password&&typeof t.weak_password=="object"&&Array.isArray(t.weak_password.reasons)&&t.weak_password.reasons.length&&t.weak_password.message&&typeof t.weak_password.message=="string"&&t.weak_password.reasons.reduce((r,n)=>r&&typeof n=="string",!0)&&(e.data.weak_password=t.weak_password),e}rt._sessionResponsePassword=UM;function VM(t){var e;return{data:{user:(e=t.user)!==null&&e!==void 0?e:t},error:null}}rt._userResponse=VM;function HM(t){return{data:t,error:null}}rt._ssoResponse=HM;function zM(t){let{action_link:e,email_otp:r,hashed_token:n,redirect_to:i,verification_type:o}=t,s=NM(t,["action_link","email_otp","hashed_token","redirect_to","verification_type"]),a={action_link:e,email_otp:r,hashed_token:n,redirect_to:i,verification_type:o},u=Object.assign({},s);return{data:{properties:a,user:u},error:null}}rt._generateLinkResponse=zM;function GM(t){return t}rt._noResolveJsonResponse=GM;function WM(t){return t.access_token&&t.refresh_token&&t.expires_in}});var xl=y(nu=>{"use strict";var KM=nu&&nu.__rest||function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r};Object.defineProperty(nu,"__esModule",{value:!0});var vt=Mm(),YM=Yo(),Mr=ru(),Um=class{constructor({url:e="",headers:r={},fetch:n}){this.url=e,this.headers=r,this.fetch=(0,YM.resolveFetch)(n),this.mfa={listFactors:this._listFactors.bind(this),deleteFactor:this._deleteFactor.bind(this)}}async signOut(e,r="global"){try{return await(0,vt._request)(this.fetch,"POST",`${this.url}/logout?scope=${r}`,{headers:this.headers,jwt:e,noResolveJson:!0}),{data:null,error:null}}catch(n){if((0,Mr.isAuthError)(n))return{data:null,error:n};throw n}}async inviteUserByEmail(e,r={}){try{return await(0,vt._request)(this.fetch,"POST",`${this.url}/invite`,{body:{email:e,data:r.data},headers:this.headers,redirectTo:r.redirectTo,xform:vt._userResponse})}catch(n){if((0,Mr.isAuthError)(n))return{data:{user:null},error:n};throw n}}async generateLink(e){try{let{options:r}=e,n=KM(e,["options"]),i=Object.assign(Object.assign({},n),r);return"newEmail"in n&&(i.new_email=n?.newEmail,delete i.newEmail),await(0,vt._request)(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:i,headers:this.headers,xform:vt._generateLinkResponse,redirectTo:r?.redirectTo})}catch(r){if((0,Mr.isAuthError)(r))return{data:{properties:null,user:null},error:r};throw r}}async createUser(e){try{return await(0,vt._request)(this.fetch,"POST",`${this.url}/admin/users`,{body:e,headers:this.headers,xform:vt._userResponse})}catch(r){if((0,Mr.isAuthError)(r))return{data:{user:null},error:r};throw r}}async listUsers(e){var r,n,i,o,s,a,u;try{let c={nextPage:null,lastPage:0,total:0},l=await(0,vt._request)(this.fetch,"GET",`${this.url}/admin/users`,{headers:this.headers,noResolveJson:!0,query:{page:(n=(r=e?.page)===null||r===void 0?void 0:r.toString())!==null&&n!==void 0?n:"",per_page:(o=(i=e?.perPage)===null||i===void 0?void 0:i.toString())!==null&&o!==void 0?o:""},xform:vt._noResolveJsonResponse});if(l.error)throw l.error;let f=await l.json(),h=(s=l.headers.get("x-total-count"))!==null&&s!==void 0?s:0,d=(u=(a=l.headers.get("link"))===null||a===void 0?void 0:a.split(","))!==null&&u!==void 0?u:[];return d.length>0&&(d.forEach(p=>{let v=parseInt(p.split(";")[0].split("=")[1].substring(0,1)),g=JSON.parse(p.split(";")[1].split("=")[1]);c[`${g}Page`]=v}),c.total=parseInt(h)),{data:Object.assign(Object.assign({},f),c),error:null}}catch(c){if((0,Mr.isAuthError)(c))return{data:{users:[]},error:c};throw c}}async getUserById(e){try{return await(0,vt._request)(this.fetch,"GET",`${this.url}/admin/users/${e}`,{headers:this.headers,xform:vt._userResponse})}catch(r){if((0,Mr.isAuthError)(r))return{data:{user:null},error:r};throw r}}async updateUserById(e,r){try{return await(0,vt._request)(this.fetch,"PUT",`${this.url}/admin/users/${e}`,{body:r,headers:this.headers,xform:vt._userResponse})}catch(n){if((0,Mr.isAuthError)(n))return{data:{user:null},error:n};throw n}}async deleteUser(e,r=!1){try{return await(0,vt._request)(this.fetch,"DELETE",`${this.url}/admin/users/${e}`,{headers:this.headers,body:{should_soft_delete:r},xform:vt._userResponse})}catch(n){if((0,Mr.isAuthError)(n))return{data:{user:null},error:n};throw n}}async _listFactors(e){try{let{data:r,error:n}=await(0,vt._request)(this.fetch,"GET",`${this.url}/admin/users/${e.userId}/factors`,{headers:this.headers,xform:i=>({data:{factors:i},error:null})});return{data:r,error:n}}catch(r){if((0,Mr.isAuthError)(r))return{data:null,error:r};throw r}}async _deleteFactor(e){try{return{data:await(0,vt._request)(this.fetch,"DELETE",`${this.url}/admin/users/${e.userId}/factors/${e.id}`,{headers:this.headers}),error:null}}catch(r){if((0,Mr.isAuthError)(r))return{data:null,error:r};throw r}}};nu.default=Um});var O_=y(Xo=>{"use strict";Object.defineProperty(Xo,"__esModule",{value:!0});Xo.memoryLocalStorageAdapter=Xo.localStorageAdapter=void 0;var Vm=Yo();Xo.localStorageAdapter={getItem:t=>(0,Vm.supportsLocalStorage)()?globalThis.localStorage.getItem(t):null,setItem:(t,e)=>{(0,Vm.supportsLocalStorage)()&&globalThis.localStorage.setItem(t,e)},removeItem:t=>{(0,Vm.supportsLocalStorage)()&&globalThis.localStorage.removeItem(t)}};function JM(t={}){return{getItem:e=>t[e]||null,setItem:(e,r)=>{t[e]=r},removeItem:e=>{delete t[e]}}}Xo.memoryLocalStorageAdapter=JM});var A_=y(Fl=>{"use strict";Object.defineProperty(Fl,"__esModule",{value:!0});Fl.polyfillGlobalThis=void 0;function XM(){if(typeof globalThis!="object")try{Object.defineProperty(Object.prototype,"__magic__",{get:function(){return this},configurable:!0}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__}catch{typeof self<"u"&&(self.globalThis=self)}}Fl.polyfillGlobalThis=XM});var Hm=y(Et=>{"use strict";Object.defineProperty(Et,"__esModule",{value:!0});Et.navigatorLock=Et.NavigatorLockAcquireTimeoutError=Et.LockAcquireTimeoutError=Et.internals=void 0;var ZM=Yo();Et.internals={debug:!!(globalThis&&(0,ZM.supportsLocalStorage)()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug")==="true")};var Ol=class extends Error{constructor(e){super(e),this.isAcquireTimeout=!0}};Et.LockAcquireTimeoutError=Ol;var Al=class extends Ol{};Et.NavigatorLockAcquireTimeoutError=Al;async function QM(t,e,r){Et.internals.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire lock",t,e);let n=new globalThis.AbortController;return e>0&&setTimeout(()=>{n.abort(),Et.internals.debug&&console.log("@supabase/gotrue-js: navigatorLock acquire timed out",t)},e),await globalThis.navigator.locks.request(t,e===0?{mode:"exclusive",ifAvailable:!0}:{mode:"exclusive",signal:n.signal},async i=>{if(i){Et.internals.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquired",t,i.name);try{return await r()}finally{Et.internals.debug&&console.log("@supabase/gotrue-js: navigatorLock: released",t,i.name)}}else{if(e===0)throw Et.internals.debug&&console.log("@supabase/gotrue-js: navigatorLock: not immediately available",t),new Al(`Acquiring an exclusive Navigator LockManager lock "${t}" immediately failed`);if(Et.internals.debug)try{let o=await globalThis.navigator.locks.query();console.log("@supabase/gotrue-js: Navigator LockManager state",JSON.stringify(o,null," "))}catch(o){console.warn("@supabase/gotrue-js: Error when querying Navigator LockManager state",o)}return console.warn("@supabase/gotrue-js: Navigator LockManager returned a null lock when using #request without ifAvailable set to true, it appears this browser is not following the LockManager spec https://developer.mozilla.org/en-US/docs/Web/API/LockManager/request"),await r()}})}Et.navigatorLock=QM});var Gm=y(su=>{"use strict";var e4=su&&su.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(su,"__esModule",{value:!0});var t4=e4(xl()),ou=El(),Z=ru(),ae=Mm(),fe=Yo(),zm=O_(),r4=A_(),n4=Am(),k_=Hm();(0,r4.polyfillGlobalThis)();var i4={url:ou.GOTRUE_URL,storageKey:ou.STORAGE_KEY,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:ou.DEFAULT_HEADERS,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1},iu=30*1e3,T_=3;async function P_(t,e,r){return await r()}var kl=class t{constructor(e){var r,n;this.memoryStorage=null,this.stateChangeEmitters=new Map,this.autoRefreshTicker=null,this.visibilityChangedCallback=null,this.refreshingDeferred=null,this.initializePromise=null,this.detectSessionInUrl=!0,this.hasCustomAuthorizationHeader=!1,this.suppressGetSessionWarning=!1,this.lockAcquired=!1,this.pendingInLock=[],this.broadcastChannel=null,this.logger=console.log,this.instanceID=t.nextInstanceID,t.nextInstanceID+=1,this.instanceID>0&&(0,fe.isBrowser)()&&console.warn("Multiple GoTrueClient instances detected in the same browser context. It is not an error, but this should be avoided as it may produce undefined behavior when used concurrently under the same storage key.");let i=Object.assign(Object.assign({},i4),e);if(this.logDebugMessages=!!i.debug,typeof i.debug=="function"&&(this.logger=i.debug),this.persistSession=i.persistSession,this.storageKey=i.storageKey,this.autoRefreshToken=i.autoRefreshToken,this.admin=new t4.default({url:i.url,headers:i.headers,fetch:i.fetch}),this.url=i.url,this.headers=i.headers,this.fetch=(0,fe.resolveFetch)(i.fetch),this.lock=i.lock||P_,this.detectSessionInUrl=i.detectSessionInUrl,this.flowType=i.flowType,this.hasCustomAuthorizationHeader=i.hasCustomAuthorizationHeader,i.lock?this.lock=i.lock:(0,fe.isBrowser)()&&(!((r=globalThis?.navigator)===null||r===void 0)&&r.locks)?this.lock=k_.navigatorLock:this.lock=P_,this.mfa={verify:this._verify.bind(this),enroll:this._enroll.bind(this),unenroll:this._unenroll.bind(this),challenge:this._challenge.bind(this),listFactors:this._listFactors.bind(this),challengeAndVerify:this._challengeAndVerify.bind(this),getAuthenticatorAssuranceLevel:this._getAuthenticatorAssuranceLevel.bind(this)},this.persistSession?i.storage?this.storage=i.storage:(0,fe.supportsLocalStorage)()?this.storage=zm.localStorageAdapter:(this.memoryStorage={},this.storage=(0,zm.memoryLocalStorageAdapter)(this.memoryStorage)):(this.memoryStorage={},this.storage=(0,zm.memoryLocalStorageAdapter)(this.memoryStorage)),(0,fe.isBrowser)()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(o){console.error("Failed to create a new BroadcastChannel, multi-tab state changes will not be available",o)}(n=this.broadcastChannel)===null||n===void 0||n.addEventListener("message",async o=>{this._debug("received broadcast notification from other tab or client",o),await this._notifyAllSubscribers(o.data.event,o.data.session,!1)})}this.initialize()}_debug(...e){return this.logDebugMessages&&this.logger(`GoTrueClient@${this.instanceID} (${n4.version}) ${new Date().toISOString()}`,...e),this}async initialize(){return this.initializePromise?await this.initializePromise:(this.initializePromise=(async()=>await this._acquireLock(-1,async()=>await this._initialize()))(),await this.initializePromise)}async _initialize(){try{let e=(0,fe.isBrowser)()?await this._isPKCEFlow():!1;if(this._debug("#_initialize()","begin","is PKCE flow",e),e||this.detectSessionInUrl&&this._isImplicitGrantFlow()){let{data:r,error:n}=await this._getSessionFromURL(e);if(n)return this._debug("#_initialize()","error detecting session from URL",n),n?.code==="identity_already_exists"?{error:n}:(await this._removeSession(),{error:n});let{session:i,redirectType:o}=r;return this._debug("#_initialize()","detected session in URL",i,"redirect type",o),await this._saveSession(i),setTimeout(async()=>{o==="recovery"?await this._notifyAllSubscribers("PASSWORD_RECOVERY",i):await this._notifyAllSubscribers("SIGNED_IN",i)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(e){return(0,Z.isAuthError)(e)?{error:e}:{error:new Z.AuthUnknownError("Unexpected error during initialization",e)}}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(e){var r,n,i;try{let o=await(0,ae._request)(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{data:(n=(r=e?.options)===null||r===void 0?void 0:r.data)!==null&&n!==void 0?n:{},gotrue_meta_security:{captcha_token:(i=e?.options)===null||i===void 0?void 0:i.captchaToken}},xform:ae._sessionResponse}),{data:s,error:a}=o;if(a||!s)return{data:{user:null,session:null},error:a};let u=s.session,c=s.user;return s.session&&(await this._saveSession(s.session),await this._notifyAllSubscribers("SIGNED_IN",u)),{data:{user:c,session:u},error:null}}catch(o){if((0,Z.isAuthError)(o))return{data:{user:null,session:null},error:o};throw o}}async signUp(e){var r,n,i;try{let o;if("email"in e){let{email:l,password:f,options:h}=e,d=null,p=null;this.flowType==="pkce"&&([d,p]=await(0,fe.getCodeChallengeAndMethod)(this.storage,this.storageKey)),o=await(0,ae._request)(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:h?.emailRedirectTo,body:{email:l,password:f,data:(r=h?.data)!==null&&r!==void 0?r:{},gotrue_meta_security:{captcha_token:h?.captchaToken},code_challenge:d,code_challenge_method:p},xform:ae._sessionResponse})}else if("phone"in e){let{phone:l,password:f,options:h}=e;o=await(0,ae._request)(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:l,password:f,data:(n=h?.data)!==null&&n!==void 0?n:{},channel:(i=h?.channel)!==null&&i!==void 0?i:"sms",gotrue_meta_security:{captcha_token:h?.captchaToken}},xform:ae._sessionResponse})}else throw new Z.AuthInvalidCredentialsError("You must provide either an email or phone number and a password");let{data:s,error:a}=o;if(a||!s)return{data:{user:null,session:null},error:a};let u=s.session,c=s.user;return s.session&&(await this._saveSession(s.session),await this._notifyAllSubscribers("SIGNED_IN",u)),{data:{user:c,session:u},error:null}}catch(o){if((0,Z.isAuthError)(o))return{data:{user:null,session:null},error:o};throw o}}async signInWithPassword(e){try{let r;if("email"in e){let{email:o,password:s,options:a}=e;r=await(0,ae._request)(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:o,password:s,gotrue_meta_security:{captcha_token:a?.captchaToken}},xform:ae._sessionResponsePassword})}else if("phone"in e){let{phone:o,password:s,options:a}=e;r=await(0,ae._request)(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:o,password:s,gotrue_meta_security:{captcha_token:a?.captchaToken}},xform:ae._sessionResponsePassword})}else throw new Z.AuthInvalidCredentialsError("You must provide either an email or phone number and a password");let{data:n,error:i}=r;return i?{data:{user:null,session:null},error:i}:!n||!n.session||!n.user?{data:{user:null,session:null},error:new Z.AuthInvalidTokenResponseError}:(n.session&&(await this._saveSession(n.session),await this._notifyAllSubscribers("SIGNED_IN",n.session)),{data:Object.assign({user:n.user,session:n.session},n.weak_password?{weakPassword:n.weak_password}:null),error:i})}catch(r){if((0,Z.isAuthError)(r))return{data:{user:null,session:null},error:r};throw r}}async signInWithOAuth(e){var r,n,i,o;return await this._handleProviderSignIn(e.provider,{redirectTo:(r=e.options)===null||r===void 0?void 0:r.redirectTo,scopes:(n=e.options)===null||n===void 0?void 0:n.scopes,queryParams:(i=e.options)===null||i===void 0?void 0:i.queryParams,skipBrowserRedirect:(o=e.options)===null||o===void 0?void 0:o.skipBrowserRedirect})}async exchangeCodeForSession(e){return await this.initializePromise,this._acquireLock(-1,async()=>this._exchangeCodeForSession(e))}async _exchangeCodeForSession(e){let r=await(0,fe.getItemAsync)(this.storage,`${this.storageKey}-code-verifier`),[n,i]=(r??"").split("/");try{let{data:o,error:s}=await(0,ae._request)(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:e,code_verifier:n},xform:ae._sessionResponse});if(await(0,fe.removeItemAsync)(this.storage,`${this.storageKey}-code-verifier`),s)throw s;return!o||!o.session||!o.user?{data:{user:null,session:null,redirectType:null},error:new Z.AuthInvalidTokenResponseError}:(o.session&&(await this._saveSession(o.session),await this._notifyAllSubscribers("SIGNED_IN",o.session)),{data:Object.assign(Object.assign({},o),{redirectType:i??null}),error:s})}catch(o){if((0,Z.isAuthError)(o))return{data:{user:null,session:null,redirectType:null},error:o};throw o}}async signInWithIdToken(e){try{let{options:r,provider:n,token:i,access_token:o,nonce:s}=e,a=await(0,ae._request)(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:n,id_token:i,access_token:o,nonce:s,gotrue_meta_security:{captcha_token:r?.captchaToken}},xform:ae._sessionResponse}),{data:u,error:c}=a;return c?{data:{user:null,session:null},error:c}:!u||!u.session||!u.user?{data:{user:null,session:null},error:new Z.AuthInvalidTokenResponseError}:(u.session&&(await this._saveSession(u.session),await this._notifyAllSubscribers("SIGNED_IN",u.session)),{data:u,error:c})}catch(r){if((0,Z.isAuthError)(r))return{data:{user:null,session:null},error:r};throw r}}async signInWithOtp(e){var r,n,i,o,s;try{if("email"in e){let{email:a,options:u}=e,c=null,l=null;this.flowType==="pkce"&&([c,l]=await(0,fe.getCodeChallengeAndMethod)(this.storage,this.storageKey));let{error:f}=await(0,ae._request)(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:a,data:(r=u?.data)!==null&&r!==void 0?r:{},create_user:(n=u?.shouldCreateUser)!==null&&n!==void 0?n:!0,gotrue_meta_security:{captcha_token:u?.captchaToken},code_challenge:c,code_challenge_method:l},redirectTo:u?.emailRedirectTo});return{data:{user:null,session:null},error:f}}if("phone"in e){let{phone:a,options:u}=e,{data:c,error:l}=await(0,ae._request)(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:a,data:(i=u?.data)!==null&&i!==void 0?i:{},create_user:(o=u?.shouldCreateUser)!==null&&o!==void 0?o:!0,gotrue_meta_security:{captcha_token:u?.captchaToken},channel:(s=u?.channel)!==null&&s!==void 0?s:"sms"}});return{data:{user:null,session:null,messageId:c?.message_id},error:l}}throw new Z.AuthInvalidCredentialsError("You must provide either an email or phone number.")}catch(a){if((0,Z.isAuthError)(a))return{data:{user:null,session:null},error:a};throw a}}async verifyOtp(e){var r,n;try{let i,o;"options"in e&&(i=(r=e.options)===null||r===void 0?void 0:r.redirectTo,o=(n=e.options)===null||n===void 0?void 0:n.captchaToken);let{data:s,error:a}=await(0,ae._request)(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},e),{gotrue_meta_security:{captcha_token:o}}),redirectTo:i,xform:ae._sessionResponse});if(a)throw a;if(!s)throw new Error("An error occurred on token verification.");let u=s.session,c=s.user;return u?.access_token&&(await this._saveSession(u),await this._notifyAllSubscribers(e.type=="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",u)),{data:{user:c,session:u},error:null}}catch(i){if((0,Z.isAuthError)(i))return{data:{user:null,session:null},error:i};throw i}}async signInWithSSO(e){var r,n,i;try{let o=null,s=null;return this.flowType==="pkce"&&([o,s]=await(0,fe.getCodeChallengeAndMethod)(this.storage,this.storageKey)),await(0,ae._request)(this.fetch,"POST",`${this.url}/sso`,{body:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},"providerId"in e?{provider_id:e.providerId}:null),"domain"in e?{domain:e.domain}:null),{redirect_to:(n=(r=e.options)===null||r===void 0?void 0:r.redirectTo)!==null&&n!==void 0?n:void 0}),!((i=e?.options)===null||i===void 0)&&i.captchaToken?{gotrue_meta_security:{captcha_token:e.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:o,code_challenge_method:s}),headers:this.headers,xform:ae._ssoResponse})}catch(o){if((0,Z.isAuthError)(o))return{data:null,error:o};throw o}}async reauthenticate(){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._reauthenticate())}async _reauthenticate(){try{return await this._useSession(async e=>{let{data:{session:r},error:n}=e;if(n)throw n;if(!r)throw new Z.AuthSessionMissingError;let{error:i}=await(0,ae._request)(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:r.access_token});return{data:{user:null,session:null},error:i}})}catch(e){if((0,Z.isAuthError)(e))return{data:{user:null,session:null},error:e};throw e}}async resend(e){try{let r=`${this.url}/resend`;if("email"in e){let{email:n,type:i,options:o}=e,{error:s}=await(0,ae._request)(this.fetch,"POST",r,{headers:this.headers,body:{email:n,type:i,gotrue_meta_security:{captcha_token:o?.captchaToken}},redirectTo:o?.emailRedirectTo});return{data:{user:null,session:null},error:s}}else if("phone"in e){let{phone:n,type:i,options:o}=e,{data:s,error:a}=await(0,ae._request)(this.fetch,"POST",r,{headers:this.headers,body:{phone:n,type:i,gotrue_meta_security:{captcha_token:o?.captchaToken}}});return{data:{user:null,session:null,messageId:s?.message_id},error:a}}throw new Z.AuthInvalidCredentialsError("You must provide either an email or phone number and a type")}catch(r){if((0,Z.isAuthError)(r))return{data:{user:null,session:null},error:r};throw r}}async getSession(){return await this.initializePromise,await this._acquireLock(-1,async()=>this._useSession(async r=>r))}async _acquireLock(e,r){this._debug("#_acquireLock","begin",e);try{if(this.lockAcquired){let n=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),i=(async()=>(await n,await r()))();return this.pendingInLock.push((async()=>{try{await i}catch{}})()),i}return await this.lock(`lock:${this.storageKey}`,e,async()=>{this._debug("#_acquireLock","lock acquired for storage key",this.storageKey);try{this.lockAcquired=!0;let n=r();for(this.pendingInLock.push((async()=>{try{await n}catch{}})()),await n;this.pendingInLock.length;){let i=[...this.pendingInLock];await Promise.all(i),this.pendingInLock.splice(0,i.length)}return await n}finally{this._debug("#_acquireLock","lock released for storage key",this.storageKey),this.lockAcquired=!1}})}finally{this._debug("#_acquireLock","end")}}async _useSession(e){this._debug("#_useSession","begin");try{let r=await this.__loadSession();return await e(r)}finally{this._debug("#_useSession","end")}}async __loadSession(){this._debug("#__loadSession()","begin"),this.lockAcquired||this._debug("#__loadSession()","used outside of an acquired lock!",new Error().stack);try{let e=null,r=await(0,fe.getItemAsync)(this.storage,this.storageKey);if(this._debug("#getSession()","session from storage",r),r!==null&&(this._isValidSession(r)?e=r:(this._debug("#getSession()","session from storage is not valid"),await this._removeSession())),!e)return{data:{session:null},error:null};let n=e.expires_at?e.expires_at<=Date.now()/1e3:!1;if(this._debug("#__loadSession()",`session has${n?"":" not"} expired`,"expires_at",e.expires_at),!n){if(this.storage.isServer){let s=this.suppressGetSessionWarning;e=new Proxy(e,{get:(u,c,l)=>(!s&&c==="user"&&(console.warn("Using the user object as returned from supabase.auth.getSession() or from some supabase.auth.onAuthStateChange() events could be insecure! This value comes directly from the storage medium (usually cookies on the server) and many not be authentic. Use supabase.auth.getUser() instead which authenticates the data by contacting the Supabase Auth server."),s=!0,this.suppressGetSessionWarning=!0),Reflect.get(u,c,l))})}return{data:{session:e},error:null}}let{session:i,error:o}=await this._callRefreshToken(e.refresh_token);return o?{data:{session:null},error:o}:{data:{session:i},error:null}}finally{this._debug("#__loadSession()","end")}}async getUser(e){return e?await this._getUser(e):(await this.initializePromise,await this._acquireLock(-1,async()=>await this._getUser()))}async _getUser(e){try{return e?await(0,ae._request)(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:e,xform:ae._userResponse}):await this._useSession(async r=>{var n,i,o;let{data:s,error:a}=r;if(a)throw a;return!(!((n=s.session)===null||n===void 0)&&n.access_token)&&!this.hasCustomAuthorizationHeader?{data:{user:null},error:new Z.AuthSessionMissingError}:await(0,ae._request)(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:(o=(i=s.session)===null||i===void 0?void 0:i.access_token)!==null&&o!==void 0?o:void 0,xform:ae._userResponse})})}catch(r){if((0,Z.isAuthError)(r))return(0,Z.isAuthSessionMissingError)(r)&&(await this._removeSession(),await(0,fe.removeItemAsync)(this.storage,`${this.storageKey}-code-verifier`)),{data:{user:null},error:r};throw r}}async updateUser(e,r={}){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._updateUser(e,r))}async _updateUser(e,r={}){try{return await this._useSession(async n=>{let{data:i,error:o}=n;if(o)throw o;if(!i.session)throw new Z.AuthSessionMissingError;let s=i.session,a=null,u=null;this.flowType==="pkce"&&e.email!=null&&([a,u]=await(0,fe.getCodeChallengeAndMethod)(this.storage,this.storageKey));let{data:c,error:l}=await(0,ae._request)(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:r?.emailRedirectTo,body:Object.assign(Object.assign({},e),{code_challenge:a,code_challenge_method:u}),jwt:s.access_token,xform:ae._userResponse});if(l)throw l;return s.user=c.user,await this._saveSession(s),await this._notifyAllSubscribers("USER_UPDATED",s),{data:{user:s.user},error:null}})}catch(n){if((0,Z.isAuthError)(n))return{data:{user:null},error:n};throw n}}_decodeJWT(e){return(0,fe.decodeJWTPayload)(e)}async setSession(e){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._setSession(e))}async _setSession(e){try{if(!e.access_token||!e.refresh_token)throw new Z.AuthSessionMissingError;let r=Date.now()/1e3,n=r,i=!0,o=null,s=(0,fe.decodeJWTPayload)(e.access_token);if(s.exp&&(n=s.exp,i=n<=r),i){let{session:a,error:u}=await this._callRefreshToken(e.refresh_token);if(u)return{data:{user:null,session:null},error:u};if(!a)return{data:{user:null,session:null},error:null};o=a}else{let{data:a,error:u}=await this._getUser(e.access_token);if(u)throw u;o={access_token:e.access_token,refresh_token:e.refresh_token,user:a.user,token_type:"bearer",expires_in:n-r,expires_at:n},await this._saveSession(o),await this._notifyAllSubscribers("SIGNED_IN",o)}return{data:{user:o.user,session:o},error:null}}catch(r){if((0,Z.isAuthError)(r))return{data:{session:null,user:null},error:r};throw r}}async refreshSession(e){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._refreshSession(e))}async _refreshSession(e){try{return await this._useSession(async r=>{var n;if(!e){let{data:s,error:a}=r;if(a)throw a;e=(n=s.session)!==null&&n!==void 0?n:void 0}if(!e?.refresh_token)throw new Z.AuthSessionMissingError;let{session:i,error:o}=await this._callRefreshToken(e.refresh_token);return o?{data:{user:null,session:null},error:o}:i?{data:{user:i.user,session:i},error:null}:{data:{user:null,session:null},error:null}})}catch(r){if((0,Z.isAuthError)(r))return{data:{user:null,session:null},error:r};throw r}}async _getSessionFromURL(e){try{if(!(0,fe.isBrowser)())throw new Z.AuthImplicitGrantRedirectError("No browser detected.");if(this.flowType==="implicit"&&!this._isImplicitGrantFlow())throw new Z.AuthImplicitGrantRedirectError("Not a valid implicit grant flow url.");if(this.flowType=="pkce"&&!e)throw new Z.AuthPKCEGrantCodeExchangeError("Not a valid PKCE flow url.");let r=(0,fe.parseParametersFromURL)(window.location.href);if(e){if(!r.code)throw new Z.AuthPKCEGrantCodeExchangeError("No code detected.");let{data:x,error:D}=await this._exchangeCodeForSession(r.code);if(D)throw D;let C=new URL(window.location.href);return C.searchParams.delete("code"),window.history.replaceState(window.history.state,"",C.toString()),{data:{session:x.session,redirectType:null},error:null}}if(r.error||r.error_description||r.error_code)throw new Z.AuthImplicitGrantRedirectError(r.error_description||"Error in URL with unspecified error_description",{error:r.error||"unspecified_error",code:r.error_code||"unspecified_code"});let{provider_token:n,provider_refresh_token:i,access_token:o,refresh_token:s,expires_in:a,expires_at:u,token_type:c}=r;if(!o||!a||!s||!c)throw new Z.AuthImplicitGrantRedirectError("No session defined in URL");let l=Math.round(Date.now()/1e3),f=parseInt(a),h=l+f;u&&(h=parseInt(u));let d=h-l;d*1e3<=iu&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${d}s, should have been closer to ${f}s`);let p=h-f;l-p>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",p,h,l):l-p<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew",p,h,l);let{data:v,error:g}=await this._getUser(o);if(g)throw g;let w={provider_token:n,provider_refresh_token:i,access_token:o,expires_in:f,expires_at:h,refresh_token:s,token_type:c,user:v.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),{data:{session:w,redirectType:r.type},error:null}}catch(r){if((0,Z.isAuthError)(r))return{data:{session:null,redirectType:null},error:r};throw r}}_isImplicitGrantFlow(){let e=(0,fe.parseParametersFromURL)(window.location.href);return!!((0,fe.isBrowser)()&&(e.access_token||e.error_description))}async _isPKCEFlow(){let e=(0,fe.parseParametersFromURL)(window.location.href),r=await(0,fe.getItemAsync)(this.storage,`${this.storageKey}-code-verifier`);return!!(e.code&&r)}async signOut(e={scope:"global"}){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._signOut(e))}async _signOut({scope:e}={scope:"global"}){return await this._useSession(async r=>{var n;let{data:i,error:o}=r;if(o)return{error:o};let s=(n=i.session)===null||n===void 0?void 0:n.access_token;if(s){let{error:a}=await this.admin.signOut(s,e);if(a&&!((0,Z.isAuthApiError)(a)&&(a.status===404||a.status===401||a.status===403)))return{error:a}}return e!=="others"&&(await this._removeSession(),await(0,fe.removeItemAsync)(this.storage,`${this.storageKey}-code-verifier`)),{error:null}})}onAuthStateChange(e){let r=(0,fe.uuid)(),n={id:r,callback:e,unsubscribe:()=>{this._debug("#unsubscribe()","state change callback with id removed",r),this.stateChangeEmitters.delete(r)}};return this._debug("#onAuthStateChange()","registered callback with id",r),this.stateChangeEmitters.set(r,n),(async()=>(await this.initializePromise,await this._acquireLock(-1,async()=>{this._emitInitialSession(r)})))(),{data:{subscription:n}}}async _emitInitialSession(e){return await this._useSession(async r=>{var n,i;try{let{data:{session:o},error:s}=r;if(s)throw s;await((n=this.stateChangeEmitters.get(e))===null||n===void 0?void 0:n.callback("INITIAL_SESSION",o)),this._debug("INITIAL_SESSION","callback id",e,"session",o)}catch(o){await((i=this.stateChangeEmitters.get(e))===null||i===void 0?void 0:i.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",e,"error",o),console.error(o)}})}async resetPasswordForEmail(e,r={}){let n=null,i=null;this.flowType==="pkce"&&([n,i]=await(0,fe.getCodeChallengeAndMethod)(this.storage,this.storageKey,!0));try{return await(0,ae._request)(this.fetch,"POST",`${this.url}/recover`,{body:{email:e,code_challenge:n,code_challenge_method:i,gotrue_meta_security:{captcha_token:r.captchaToken}},headers:this.headers,redirectTo:r.redirectTo})}catch(o){if((0,Z.isAuthError)(o))return{data:null,error:o};throw o}}async getUserIdentities(){var e;try{let{data:r,error:n}=await this.getUser();if(n)throw n;return{data:{identities:(e=r.user.identities)!==null&&e!==void 0?e:[]},error:null}}catch(r){if((0,Z.isAuthError)(r))return{data:null,error:r};throw r}}async linkIdentity(e){var r;try{let{data:n,error:i}=await this._useSession(async o=>{var s,a,u,c,l;let{data:f,error:h}=o;if(h)throw h;let d=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,e.provider,{redirectTo:(s=e.options)===null||s===void 0?void 0:s.redirectTo,scopes:(a=e.options)===null||a===void 0?void 0:a.scopes,queryParams:(u=e.options)===null||u===void 0?void 0:u.queryParams,skipBrowserRedirect:!0});return await(0,ae._request)(this.fetch,"GET",d,{headers:this.headers,jwt:(l=(c=f.session)===null||c===void 0?void 0:c.access_token)!==null&&l!==void 0?l:void 0})});if(i)throw i;return(0,fe.isBrowser)()&&!(!((r=e.options)===null||r===void 0)&&r.skipBrowserRedirect)&&window.location.assign(n?.url),{data:{provider:e.provider,url:n?.url},error:null}}catch(n){if((0,Z.isAuthError)(n))return{data:{provider:e.provider,url:null},error:n};throw n}}async unlinkIdentity(e){try{return await this._useSession(async r=>{var n,i;let{data:o,error:s}=r;if(s)throw s;return await(0,ae._request)(this.fetch,"DELETE",`${this.url}/user/identities/${e.identity_id}`,{headers:this.headers,jwt:(i=(n=o.session)===null||n===void 0?void 0:n.access_token)!==null&&i!==void 0?i:void 0})})}catch(r){if((0,Z.isAuthError)(r))return{data:null,error:r};throw r}}async _refreshAccessToken(e){let r=`#_refreshAccessToken(${e.substring(0,5)}...)`;this._debug(r,"begin");try{let n=Date.now();return await(0,fe.retryable)(async i=>(i>0&&await(0,fe.sleep)(200*Math.pow(2,i-1)),this._debug(r,"refreshing attempt",i),await(0,ae._request)(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:e},headers:this.headers,xform:ae._sessionResponse})),(i,o)=>{let s=200*Math.pow(2,i);return o&&(0,Z.isAuthRetryableFetchError)(o)&&Date.now()+s-n<iu})}catch(n){if(this._debug(r,"error",n),(0,Z.isAuthError)(n))return{data:{session:null,user:null},error:n};throw n}finally{this._debug(r,"end")}}_isValidSession(e){return typeof e=="object"&&e!==null&&"access_token"in e&&"refresh_token"in e&&"expires_at"in e}async _handleProviderSignIn(e,r){let n=await this._getUrlForProvider(`${this.url}/authorize`,e,{redirectTo:r.redirectTo,scopes:r.scopes,queryParams:r.queryParams});return this._debug("#_handleProviderSignIn()","provider",e,"options",r,"url",n),(0,fe.isBrowser)()&&!r.skipBrowserRedirect&&window.location.assign(n),{data:{provider:e,url:n},error:null}}async _recoverAndRefresh(){var e;let r="#_recoverAndRefresh()";this._debug(r,"begin");try{let n=await(0,fe.getItemAsync)(this.storage,this.storageKey);if(this._debug(r,"session from storage",n),!this._isValidSession(n)){this._debug(r,"session is not valid"),n!==null&&await this._removeSession();return}let i=Math.round(Date.now()/1e3),o=((e=n.expires_at)!==null&&e!==void 0?e:1/0)<i+ou.EXPIRY_MARGIN;if(this._debug(r,`session has${o?"":" not"} expired with margin of ${ou.EXPIRY_MARGIN}s`),o){if(this.autoRefreshToken&&n.refresh_token){let{error:s}=await this._callRefreshToken(n.refresh_token);s&&(console.error(s),(0,Z.isAuthRetryableFetchError)(s)||(this._debug(r,"refresh failed with a non-retryable error, removing the session",s),await this._removeSession()))}}else await this._notifyAllSubscribers("SIGNED_IN",n)}catch(n){this._debug(r,"error",n),console.error(n);return}finally{this._debug(r,"end")}}async _callRefreshToken(e){var r,n;if(!e)throw new Z.AuthSessionMissingError;if(this.refreshingDeferred)return this.refreshingDeferred.promise;let i=`#_callRefreshToken(${e.substring(0,5)}...)`;this._debug(i,"begin");try{this.refreshingDeferred=new fe.Deferred;let{data:o,error:s}=await this._refreshAccessToken(e);if(s)throw s;if(!o.session)throw new Z.AuthSessionMissingError;await this._saveSession(o.session),await this._notifyAllSubscribers("TOKEN_REFRESHED",o.session);let a={session:o.session,error:null};return this.refreshingDeferred.resolve(a),a}catch(o){if(this._debug(i,"error",o),(0,Z.isAuthError)(o)){let s={session:null,error:o};return(0,Z.isAuthRetryableFetchError)(o)||await this._removeSession(),(r=this.refreshingDeferred)===null||r===void 0||r.resolve(s),s}throw(n=this.refreshingDeferred)===null||n===void 0||n.reject(o),o}finally{this.refreshingDeferred=null,this._debug(i,"end")}}async _notifyAllSubscribers(e,r,n=!0){let i=`#_notifyAllSubscribers(${e})`;this._debug(i,"begin",r,`broadcast = ${n}`);try{this.broadcastChannel&&n&&this.broadcastChannel.postMessage({event:e,session:r});let o=[],s=Array.from(this.stateChangeEmitters.values()).map(async a=>{try{await a.callback(e,r)}catch(u){o.push(u)}});if(await Promise.all(s),o.length>0){for(let a=0;a<o.length;a+=1)console.error(o[a]);throw o[0]}}finally{this._debug(i,"end")}}async _saveSession(e){this._debug("#_saveSession()",e),this.suppressGetSessionWarning=!0,await(0,fe.setItemAsync)(this.storage,this.storageKey,e)}async _removeSession(){this._debug("#_removeSession()"),await(0,fe.removeItemAsync)(this.storage,this.storageKey),await this._notifyAllSubscribers("SIGNED_OUT",null)}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()");let e=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{e&&(0,fe.isBrowser)()&&window?.removeEventListener&&window.removeEventListener("visibilitychange",e)}catch(r){console.error("removing visibilitychange callback failed",r)}}async _startAutoRefresh(){await this._stopAutoRefresh(),this._debug("#_startAutoRefresh()");let e=setInterval(()=>this._autoRefreshTokenTick(),iu);this.autoRefreshTicker=e,e&&typeof e=="object"&&typeof e.unref=="function"?e.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(e),setTimeout(async()=>{await this.initializePromise,await this._autoRefreshTokenTick()},0)}async _stopAutoRefresh(){this._debug("#_stopAutoRefresh()");let e=this.autoRefreshTicker;this.autoRefreshTicker=null,e&&clearInterval(e)}async startAutoRefresh(){this._removeVisibilityChangedCallback(),await this._startAutoRefresh()}async stopAutoRefresh(){this._removeVisibilityChangedCallback(),await this._stopAutoRefresh()}async _autoRefreshTokenTick(){this._debug("#_autoRefreshTokenTick()","begin");try{await this._acquireLock(0,async()=>{try{let e=Date.now();try{return await this._useSession(async r=>{let{data:{session:n}}=r;if(!n||!n.refresh_token||!n.expires_at){this._debug("#_autoRefreshTokenTick()","no session");return}let i=Math.floor((n.expires_at*1e3-e)/iu);this._debug("#_autoRefreshTokenTick()",`access token expires in ${i} ticks, a tick lasts ${iu}ms, refresh threshold is ${T_} ticks`),i<=T_&&await this._callRefreshToken(n.refresh_token)})}catch(r){console.error("Auto refresh tick failed with error. This is likely a transient error.",r)}}finally{this._debug("#_autoRefreshTokenTick()","end")}})}catch(e){if(e.isAcquireTimeout||e instanceof k_.LockAcquireTimeoutError)this._debug("auto refresh token tick lock not available");else throw e}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!(0,fe.isBrowser)()||!window?.addEventListener)return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>await this._onVisibilityChanged(!1),window?.addEventListener("visibilitychange",this.visibilityChangedCallback),await this._onVisibilityChanged(!0)}catch(e){console.error("_handleVisibilityChange",e)}}async _onVisibilityChanged(e){let r=`#_onVisibilityChanged(${e})`;this._debug(r,"visibilityState",document.visibilityState),document.visibilityState==="visible"?(this.autoRefreshToken&&this._startAutoRefresh(),e||(await this.initializePromise,await this._acquireLock(-1,async()=>{if(document.visibilityState!=="visible"){this._debug(r,"acquired the lock to recover the session, but the browser visibilityState is no longer visible, aborting");return}await this._recoverAndRefresh()}))):document.visibilityState==="hidden"&&this.autoRefreshToken&&this._stopAutoRefresh()}async _getUrlForProvider(e,r,n){let i=[`provider=${encodeURIComponent(r)}`];if(n?.redirectTo&&i.push(`redirect_to=${encodeURIComponent(n.redirectTo)}`),n?.scopes&&i.push(`scopes=${encodeURIComponent(n.scopes)}`),this.flowType==="pkce"){let[o,s]=await(0,fe.getCodeChallengeAndMethod)(this.storage,this.storageKey),a=new URLSearchParams({code_challenge:`${encodeURIComponent(o)}`,code_challenge_method:`${encodeURIComponent(s)}`});i.push(a.toString())}if(n?.queryParams){let o=new URLSearchParams(n.queryParams);i.push(o.toString())}return n?.skipBrowserRedirect&&i.push(`skip_http_redirect=${n.skipBrowserRedirect}`),`${e}?${i.join("&")}`}async _unenroll(e){try{return await this._useSession(async r=>{var n;let{data:i,error:o}=r;return o?{data:null,error:o}:await(0,ae._request)(this.fetch,"DELETE",`${this.url}/factors/${e.factorId}`,{headers:this.headers,jwt:(n=i?.session)===null||n===void 0?void 0:n.access_token})})}catch(r){if((0,Z.isAuthError)(r))return{data:null,error:r};throw r}}async _enroll(e){try{return await this._useSession(async r=>{var n,i;let{data:o,error:s}=r;if(s)return{data:null,error:s};let a=Object.assign({friendly_name:e.friendlyName,factor_type:e.factorType},e.factorType==="phone"?{phone:e.phone}:{issuer:e.issuer}),{data:u,error:c}=await(0,ae._request)(this.fetch,"POST",`${this.url}/factors`,{body:a,headers:this.headers,jwt:(n=o?.session)===null||n===void 0?void 0:n.access_token});return c?{data:null,error:c}:(e.factorType==="totp"&&(!((i=u?.totp)===null||i===void 0)&&i.qr_code)&&(u.totp.qr_code=`data:image/svg+xml;utf-8,${u.totp.qr_code}`),{data:u,error:null})})}catch(r){if((0,Z.isAuthError)(r))return{data:null,error:r};throw r}}async _verify(e){return this._acquireLock(-1,async()=>{try{return await this._useSession(async r=>{var n;let{data:i,error:o}=r;if(o)return{data:null,error:o};let{data:s,error:a}=await(0,ae._request)(this.fetch,"POST",`${this.url}/factors/${e.factorId}/verify`,{body:{code:e.code,challenge_id:e.challengeId},headers:this.headers,jwt:(n=i?.session)===null||n===void 0?void 0:n.access_token});return a?{data:null,error:a}:(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+s.expires_in},s)),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",s),{data:s,error:a})})}catch(r){if((0,Z.isAuthError)(r))return{data:null,error:r};throw r}})}async _challenge(e){return this._acquireLock(-1,async()=>{try{return await this._useSession(async r=>{var n;let{data:i,error:o}=r;return o?{data:null,error:o}:await(0,ae._request)(this.fetch,"POST",`${this.url}/factors/${e.factorId}/challenge`,{body:{channel:e.channel},headers:this.headers,jwt:(n=i?.session)===null||n===void 0?void 0:n.access_token})})}catch(r){if((0,Z.isAuthError)(r))return{data:null,error:r};throw r}})}async _challengeAndVerify(e){let{data:r,error:n}=await this._challenge({factorId:e.factorId});return n?{data:null,error:n}:await this._verify({factorId:e.factorId,challengeId:r.id,code:e.code})}async _listFactors(){let{data:{user:e},error:r}=await this.getUser();if(r)return{data:null,error:r};let n=e?.factors||[],i=n.filter(s=>s.factor_type==="totp"&&s.status==="verified"),o=n.filter(s=>s.factor_type==="phone"&&s.status==="verified");return{data:{all:n,totp:i,phone:o},error:null}}async _getAuthenticatorAssuranceLevel(){return this._acquireLock(-1,async()=>await this._useSession(async e=>{var r,n;let{data:{session:i},error:o}=e;if(o)return{data:null,error:o};if(!i)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};let s=this._decodeJWT(i.access_token),a=null;s.aal&&(a=s.aal);let u=a;((n=(r=i.user.factors)===null||r===void 0?void 0:r.filter(f=>f.status==="verified"))!==null&&n!==void 0?n:[]).length>0&&(u="aal2");let l=s.amr||[];return{data:{currentLevel:a,nextLevel:u,currentAuthenticationMethods:l},error:null}}))}};su.default=kl;kl.nextInstanceID=0});var R_=y(au=>{"use strict";var o4=au&&au.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(au,"__esModule",{value:!0});var s4=o4(xl()),a4=s4.default;au.default=a4});var $_=y(uu=>{"use strict";var u4=uu&&uu.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(uu,"__esModule",{value:!0});var c4=u4(Gm()),l4=c4.default;uu.default=l4});var j_=y(I_=>{"use strict";Object.defineProperty(I_,"__esModule",{value:!0})});var Km=y(je=>{"use strict";var f4=je&&je.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),N_=je&&je.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&f4(e,t,r)},Tl=je&&je.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(je,"__esModule",{value:!0});je.lockInternals=je.NavigatorLockAcquireTimeoutError=je.navigatorLock=je.AuthClient=je.AuthAdminApi=je.GoTrueClient=je.GoTrueAdminApi=void 0;var d4=Tl(xl());je.GoTrueAdminApi=d4.default;var h4=Tl(Gm());je.GoTrueClient=h4.default;var p4=Tl(R_());je.AuthAdminApi=p4.default;var m4=Tl($_());je.AuthClient=m4.default;N_(j_(),je);N_(ru(),je);var Wm=Hm();Object.defineProperty(je,"navigatorLock",{enumerable:!0,get:function(){return Wm.navigatorLock}});Object.defineProperty(je,"NavigatorLockAcquireTimeoutError",{enumerable:!0,get:function(){return Wm.NavigatorLockAcquireTimeoutError}});Object.defineProperty(je,"lockInternals",{enumerable:!0,get:function(){return Wm.internals}})});var L_=y(Pl=>{"use strict";Object.defineProperty(Pl,"__esModule",{value:!0});Pl.SupabaseAuthClient=void 0;var g4=Km(),Ym=class extends g4.AuthClient{constructor(e){super(e)}};Pl.SupabaseAuthClient=Ym});var Xm=y(cu=>{"use strict";var y4=cu&&cu.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(l){try{c(n.next(l))}catch(f){s(f)}}function u(l){try{c(n.throw(l))}catch(f){s(f)}}function c(l){l.done?o(l.value):i(l.value).then(a,u)}c((n=n.apply(t,e||[])).next())})};Object.defineProperty(cu,"__esModule",{value:!0});var D4=sm(),v4=o_(),b4=(bm(),ke(vm)),w4=D_(),Rl=b_(),_4=__(),B_=E_(),E4=L_(),Jm=class{constructor(e,r,n){var i,o,s;if(this.supabaseUrl=e,this.supabaseKey=r,!e)throw new Error("supabaseUrl is required.");if(!r)throw new Error("supabaseKey is required.");let a=(0,B_.stripTrailingSlash)(e);this.realtimeUrl=`${a}/realtime/v1`.replace(/^http/i,"ws"),this.authUrl=`${a}/auth/v1`,this.storageUrl=`${a}/storage/v1`,this.functionsUrl=`${a}/functions/v1`;let u=`sb-${new URL(this.authUrl).hostname.split(".")[0]}-auth-token`,c={db:Rl.DEFAULT_DB_OPTIONS,realtime:Rl.DEFAULT_REALTIME_OPTIONS,auth:Object.assign(Object.assign({},Rl.DEFAULT_AUTH_OPTIONS),{storageKey:u}),global:Rl.DEFAULT_GLOBAL_OPTIONS},l=(0,B_.applySettingDefaults)(n??{},c);this.storageKey=(i=l.auth.storageKey)!==null&&i!==void 0?i:"",this.headers=(o=l.global.headers)!==null&&o!==void 0?o:{},l.accessToken?(this.accessToken=l.accessToken,this.auth=new Proxy({},{get:(f,h)=>{throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(h)} is not possible`)}})):this.auth=this._initSupabaseAuthClient((s=l.auth)!==null&&s!==void 0?s:{},this.headers,l.global.fetch),this.fetch=(0,_4.fetchWithAuth)(r,this._getAccessToken.bind(this),l.global.fetch),this.realtime=this._initRealtimeClient(Object.assign({headers:this.headers},l.realtime)),this.rest=new v4.PostgrestClient(`${a}/rest/v1`,{headers:this.headers,schema:l.db.schema,fetch:this.fetch}),l.accessToken||this._listenForAuthEvents()}get functions(){return new D4.FunctionsClient(this.functionsUrl,{headers:this.headers,customFetch:this.fetch})}get storage(){return new w4.StorageClient(this.storageUrl,this.headers,this.fetch)}from(e){return this.rest.from(e)}schema(e){return this.rest.schema(e)}rpc(e,r={},n={}){return this.rest.rpc(e,r,n)}channel(e,r={config:{}}){return this.realtime.channel(e,r)}getChannels(){return this.realtime.getChannels()}removeChannel(e){return this.realtime.removeChannel(e)}removeAllChannels(){return this.realtime.removeAllChannels()}_getAccessToken(){var e,r;return y4(this,void 0,void 0,function*(){if(this.accessToken)return yield this.accessToken();let{data:n}=yield this.auth.getSession();return(r=(e=n.session)===null||e===void 0?void 0:e.access_token)!==null&&r!==void 0?r:null})}_initSupabaseAuthClient({autoRefreshToken:e,persistSession:r,detectSessionInUrl:n,storage:i,storageKey:o,flowType:s,lock:a,debug:u},c,l){var f;let h={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new E4.SupabaseAuthClient({url:this.authUrl,headers:Object.assign(Object.assign({},h),c),storageKey:o,autoRefreshToken:e,persistSession:r,detectSessionInUrl:n,storage:i,flowType:s,lock:a,debug:u,fetch:l,hasCustomAuthorizationHeader:(f="Authorization"in this.headers)!==null&&f!==void 0?f:!1})}_initRealtimeClient(e){return new b4.RealtimeClient(this.realtimeUrl,Object.assign(Object.assign({},e),{params:Object.assign({apikey:this.supabaseKey},e?.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((r,n)=>{this._handleTokenChanged(r,"CLIENT",n?.access_token)})}_handleTokenChanged(e,r,n){(e==="TOKEN_REFRESHED"||e==="SIGNED_IN")&&this.changedAccessToken!==n?(this.realtime.setAuth(n??null),this.changedAccessToken=n):e==="SIGNED_OUT"&&(this.realtime.setAuth(this.supabaseKey),r=="STORAGE"&&this.auth.signOut(),this.changedAccessToken=void 0)}};cu.default=Jm});var U_=y(Ne=>{"use strict";var C4=Ne&&Ne.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),q_=Ne&&Ne.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&C4(e,t,r)},M_=Ne&&Ne.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ne,"__esModule",{value:!0});Ne.createClient=Ne.SupabaseClient=Ne.FunctionRegion=Ne.FunctionsError=Ne.FunctionsRelayError=Ne.FunctionsFetchError=Ne.FunctionsHttpError=void 0;var S4=M_(Xm());q_(Km(),Ne);var lu=sm();Object.defineProperty(Ne,"FunctionsHttpError",{enumerable:!0,get:function(){return lu.FunctionsHttpError}});Object.defineProperty(Ne,"FunctionsFetchError",{enumerable:!0,get:function(){return lu.FunctionsFetchError}});Object.defineProperty(Ne,"FunctionsRelayError",{enumerable:!0,get:function(){return lu.FunctionsRelayError}});Object.defineProperty(Ne,"FunctionsError",{enumerable:!0,get:function(){return lu.FunctionsError}});Object.defineProperty(Ne,"FunctionRegion",{enumerable:!0,get:function(){return lu.FunctionRegion}});q_((bm(),ke(vm)),Ne);var x4=Xm();Object.defineProperty(Ne,"SupabaseClient",{enumerable:!0,get:function(){return M_(x4).default}});var F4=(t,e,r)=>new S4.default(t,e,r);Ne.createClient=F4});var Zm=y((Nle,V_)=>{V_.exports=require("stream")});var Y_=y((Lle,K_)=>{"use strict";function H_(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function z_(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?H_(Object(r),!0).forEach(function(n){O4(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):H_(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function O4(t,e,r){return e=W_(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function A4(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function G_(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,W_(n.key),n)}}function k4(t,e,r){return e&&G_(t.prototype,e),r&&G_(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function W_(t){var e=T4(t,"string");return typeof e=="symbol"?e:String(e)}function T4(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var P4=require("buffer"),$l=P4.Buffer,R4=require("util"),Qm=R4.inspect,$4=Qm&&Qm.custom||"inspect";function I4(t,e,r){$l.prototype.copy.call(t,e,r)}K_.exports=function(){function t(){A4(this,t),this.head=null,this.tail=null,this.length=0}return k4(t,[{key:"push",value:function(r){var n={data:r,next:null};this.length>0?this.tail.next=n:this.head=n,this.tail=n,++this.length}},{key:"unshift",value:function(r){var n={data:r,next:this.head};this.length===0&&(this.tail=n),this.head=n,++this.length}},{key:"shift",value:function(){if(this.length!==0){var r=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,r}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(r){if(this.length===0)return"";for(var n=this.head,i=""+n.data;n=n.next;)i+=r+n.data;return i}},{key:"concat",value:function(r){if(this.length===0)return $l.alloc(0);for(var n=$l.allocUnsafe(r>>>0),i=this.head,o=0;i;)I4(i.data,n,o),o+=i.data.length,i=i.next;return n}},{key:"consume",value:function(r,n){var i;return r<this.head.data.length?(i=this.head.data.slice(0,r),this.head.data=this.head.data.slice(r)):r===this.head.data.length?i=this.shift():i=n?this._getString(r):this._getBuffer(r),i}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(r){var n=this.head,i=1,o=n.data;for(r-=o.length;n=n.next;){var s=n.data,a=r>s.length?s.length:r;if(a===s.length?o+=s:o+=s.slice(0,r),r-=a,r===0){a===s.length?(++i,n.next?this.head=n.next:this.head=this.tail=null):(this.head=n,n.data=s.slice(a));break}++i}return this.length-=i,o}},{key:"_getBuffer",value:function(r){var n=$l.allocUnsafe(r),i=this.head,o=1;for(i.data.copy(n),r-=i.data.length;i=i.next;){var s=i.data,a=r>s.length?s.length:r;if(s.copy(n,n.length-r,0,a),r-=a,r===0){a===s.length?(++o,i.next?this.head=i.next:this.head=this.tail=null):(this.head=i,i.data=s.slice(a));break}++o}return this.length-=o,n}},{key:$4,value:function(r,n){return Qm(this,z_(z_({},n),{},{depth:0,customInspect:!1}))}}]),t}()});var tg=y((Ble,X_)=>{"use strict";function j4(t,e){var r=this,n=this._readableState&&this._readableState.destroyed,i=this._writableState&&this._writableState.destroyed;return n||i?(e?e(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(eg,this,t)):process.nextTick(eg,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,function(o){!e&&o?r._writableState?r._writableState.errorEmitted?process.nextTick(Il,r):(r._writableState.errorEmitted=!0,process.nextTick(J_,r,o)):process.nextTick(J_,r,o):e?(process.nextTick(Il,r),e(o)):process.nextTick(Il,r)}),this)}function J_(t,e){eg(t,e),Il(t)}function Il(t){t._writableState&&!t._writableState.emitClose||t._readableState&&!t._readableState.emitClose||t.emit("close")}function N4(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function eg(t,e){t.emit("error",e)}function L4(t,e){var r=t._readableState,n=t._writableState;r&&r.autoDestroy||n&&n.autoDestroy?t.destroy(e):t.emit("error",e)}X_.exports={destroy:j4,undestroy:N4,errorOrDestroy:L4}});var Yn=y((qle,eE)=>{"use strict";var Q_={};function gr(t,e,r){r||(r=Error);function n(o,s,a){return typeof e=="string"?e:e(o,s,a)}class i extends r{constructor(s,a,u){super(n(s,a,u))}}i.prototype.name=r.name,i.prototype.code=t,Q_[t]=i}function Z_(t,e){if(Array.isArray(t)){let r=t.length;return t=t.map(n=>String(n)),r>2?`one of ${e} ${t.slice(0,r-1).join(", ")}, or `+t[r-1]:r===2?`one of ${e} ${t[0]} or ${t[1]}`:`of ${e} ${t[0]}`}else return`of ${e} ${String(t)}`}function B4(t,e,r){return t.substr(!r||r<0?0:+r,e.length)===e}function q4(t,e,r){return(r===void 0||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}function M4(t,e,r){return typeof r!="number"&&(r=0),r+e.length>t.length?!1:t.indexOf(e,r)!==-1}gr("ERR_INVALID_OPT_VALUE",function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'},TypeError);gr("ERR_INVALID_ARG_TYPE",function(t,e,r){let n;typeof e=="string"&&B4(e,"not ")?(n="must not be",e=e.replace(/^not /,"")):n="must be";let i;if(q4(t," argument"))i=`The ${t} ${n} ${Z_(e,"type")}`;else{let o=M4(t,".")?"property":"argument";i=`The "${t}" ${o} ${n} ${Z_(e,"type")}`}return i+=`. Received type ${typeof r}`,i},TypeError);gr("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");gr("ERR_METHOD_NOT_IMPLEMENTED",function(t){return"The "+t+" method is not implemented"});gr("ERR_STREAM_PREMATURE_CLOSE","Premature close");gr("ERR_STREAM_DESTROYED",function(t){return"Cannot call "+t+" after a stream was destroyed"});gr("ERR_MULTIPLE_CALLBACK","Callback called multiple times");gr("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");gr("ERR_STREAM_WRITE_AFTER_END","write after end");gr("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);gr("ERR_UNKNOWN_ENCODING",function(t){return"Unknown encoding: "+t},TypeError);gr("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");eE.exports.codes=Q_});var rg=y((Mle,tE)=>{"use strict";var U4=Yn().codes.ERR_INVALID_OPT_VALUE;function V4(t,e,r){return t.highWaterMark!=null?t.highWaterMark:e?t[r]:null}function H4(t,e,r,n){var i=V4(e,n,r);if(i!=null){if(!(isFinite(i)&&Math.floor(i)===i)||i<0){var o=n?r:"highWaterMark";throw new U4(o,i)}return Math.floor(i)}return t.objectMode?16:16*1024}tE.exports={getHighWaterMark:H4}});var rE=y((Ule,ng)=>{typeof Object.create=="function"?ng.exports=function(e,r){r&&(e.super_=r,e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:ng.exports=function(e,r){if(r){e.super_=r;var n=function(){};n.prototype=r.prototype,e.prototype=new n,e.prototype.constructor=e}}});var Zo=y((Vle,og)=>{try{if(ig=require("util"),typeof ig.inherits!="function")throw"";og.exports=ig.inherits}catch{og.exports=rE()}var ig});var iE=y((Hle,nE)=>{nE.exports=require("util").deprecate});var ug=y((zle,lE)=>{"use strict";lE.exports=Ye;function sE(t){var e=this;this.next=null,this.entry=null,this.finish=function(){y5(e,t)}}var Qo;Ye.WritableState=du;var z4={deprecate:iE()},aE=Zm(),Nl=require("buffer").Buffer,G4=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function W4(t){return Nl.from(t)}function K4(t){return Nl.isBuffer(t)||t instanceof G4}var ag=tg(),Y4=rg(),J4=Y4.getHighWaterMark,Jn=Yn().codes,X4=Jn.ERR_INVALID_ARG_TYPE,Z4=Jn.ERR_METHOD_NOT_IMPLEMENTED,Q4=Jn.ERR_MULTIPLE_CALLBACK,e5=Jn.ERR_STREAM_CANNOT_PIPE,t5=Jn.ERR_STREAM_DESTROYED,r5=Jn.ERR_STREAM_NULL_VALUES,n5=Jn.ERR_STREAM_WRITE_AFTER_END,i5=Jn.ERR_UNKNOWN_ENCODING,es=ag.errorOrDestroy;Zo()(Ye,aE);function o5(){}function du(t,e,r){Qo=Qo||ki(),t=t||{},typeof r!="boolean"&&(r=e instanceof Qo),this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=J4(this,t,"writableHighWaterMark",r),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var n=t.decodeStrings===!1;this.decodeStrings=!n,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(i){d5(e,i)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=t.emitClose!==!1,this.autoDestroy=!!t.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new sE(this)}du.prototype.getBuffer=function(){for(var e=this.bufferedRequest,r=[];e;)r.push(e),e=e.next;return r};(function(){try{Object.defineProperty(du.prototype,"buffer",{get:z4.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var jl;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(jl=Function.prototype[Symbol.hasInstance],Object.defineProperty(Ye,Symbol.hasInstance,{value:function(e){return jl.call(this,e)?!0:this!==Ye?!1:e&&e._writableState instanceof du}})):jl=function(e){return e instanceof this};function Ye(t){Qo=Qo||ki();var e=this instanceof Qo;if(!e&&!jl.call(Ye,this))return new Ye(t);this._writableState=new du(t,this,e),this.writable=!0,t&&(typeof t.write=="function"&&(this._write=t.write),typeof t.writev=="function"&&(this._writev=t.writev),typeof t.destroy=="function"&&(this._destroy=t.destroy),typeof t.final=="function"&&(this._final=t.final)),aE.call(this)}Ye.prototype.pipe=function(){es(this,new e5)};function s5(t,e){var r=new n5;es(t,r),process.nextTick(e,r)}function a5(t,e,r,n){var i;return r===null?i=new r5:typeof r!="string"&&!e.objectMode&&(i=new X4("chunk",["string","Buffer"],r)),i?(es(t,i),process.nextTick(n,i),!1):!0}Ye.prototype.write=function(t,e,r){var n=this._writableState,i=!1,o=!n.objectMode&&K4(t);return o&&!Nl.isBuffer(t)&&(t=W4(t)),typeof e=="function"&&(r=e,e=null),o?e="buffer":e||(e=n.defaultEncoding),typeof r!="function"&&(r=o5),n.ending?s5(this,r):(o||a5(this,n,t,r))&&(n.pendingcb++,i=c5(this,n,o,t,e,r)),i};Ye.prototype.cork=function(){this._writableState.corked++};Ye.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,!t.writing&&!t.corked&&!t.bufferProcessing&&t.bufferedRequest&&uE(this,t))};Ye.prototype.setDefaultEncoding=function(e){if(typeof e=="string"&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new i5(e);return this._writableState.defaultEncoding=e,this};Object.defineProperty(Ye.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function u5(t,e,r){return!t.objectMode&&t.decodeStrings!==!1&&typeof e=="string"&&(e=Nl.from(e,r)),e}Object.defineProperty(Ye.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function c5(t,e,r,n,i,o){if(!r){var s=u5(e,n,i);n!==s&&(r=!0,i="buffer",n=s)}var a=e.objectMode?1:n.length;e.length+=a;var u=e.length<e.highWaterMark;if(u||(e.needDrain=!0),e.writing||e.corked){var c=e.lastBufferedRequest;e.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:o,next:null},c?c.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1}else sg(t,e,!1,a,n,i,o);return u}function sg(t,e,r,n,i,o,s){e.writelen=n,e.writecb=s,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new t5("write")):r?t._writev(i,e.onwrite):t._write(i,o,e.onwrite),e.sync=!1}function l5(t,e,r,n,i){--e.pendingcb,r?(process.nextTick(i,n),process.nextTick(fu,t,e),t._writableState.errorEmitted=!0,es(t,n)):(i(n),t._writableState.errorEmitted=!0,es(t,n),fu(t,e))}function f5(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}function d5(t,e){var r=t._writableState,n=r.sync,i=r.writecb;if(typeof i!="function")throw new Q4;if(f5(r),e)l5(t,r,n,e,i);else{var o=cE(r)||t.destroyed;!o&&!r.corked&&!r.bufferProcessing&&r.bufferedRequest&&uE(t,r),n?process.nextTick(oE,t,r,o,i):oE(t,r,o,i)}}function oE(t,e,r,n){r||h5(t,e),e.pendingcb--,n(),fu(t,e)}function h5(t,e){e.length===0&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}function uE(t,e){e.bufferProcessing=!0;var r=e.bufferedRequest;if(t._writev&&r&&r.next){var n=e.bufferedRequestCount,i=new Array(n),o=e.corkedRequestsFree;o.entry=r;for(var s=0,a=!0;r;)i[s]=r,r.isBuf||(a=!1),r=r.next,s+=1;i.allBuffers=a,sg(t,e,!0,e.length,i,"",o.finish),e.pendingcb++,e.lastBufferedRequest=null,o.next?(e.corkedRequestsFree=o.next,o.next=null):e.corkedRequestsFree=new sE(e),e.bufferedRequestCount=0}else{for(;r;){var u=r.chunk,c=r.encoding,l=r.callback,f=e.objectMode?1:u.length;if(sg(t,e,!1,f,u,c,l),r=r.next,e.bufferedRequestCount--,e.writing)break}r===null&&(e.lastBufferedRequest=null)}e.bufferedRequest=r,e.bufferProcessing=!1}Ye.prototype._write=function(t,e,r){r(new Z4("_write()"))};Ye.prototype._writev=null;Ye.prototype.end=function(t,e,r){var n=this._writableState;return typeof t=="function"?(r=t,t=null,e=null):typeof e=="function"&&(r=e,e=null),t!=null&&this.write(t,e),n.corked&&(n.corked=1,this.uncork()),n.ending||g5(this,n,r),this};Object.defineProperty(Ye.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function cE(t){return t.ending&&t.length===0&&t.bufferedRequest===null&&!t.finished&&!t.writing}function p5(t,e){t._final(function(r){e.pendingcb--,r&&es(t,r),e.prefinished=!0,t.emit("prefinish"),fu(t,e)})}function m5(t,e){!e.prefinished&&!e.finalCalled&&(typeof t._final=="function"&&!e.destroyed?(e.pendingcb++,e.finalCalled=!0,process.nextTick(p5,t,e)):(e.prefinished=!0,t.emit("prefinish")))}function fu(t,e){var r=cE(e);if(r&&(m5(t,e),e.pendingcb===0&&(e.finished=!0,t.emit("finish"),e.autoDestroy))){var n=t._readableState;(!n||n.autoDestroy&&n.endEmitted)&&t.destroy()}return r}function g5(t,e,r){e.ending=!0,fu(t,e),r&&(e.finished?process.nextTick(r):t.once("finish",r)),e.ended=!0,t.writable=!1}function y5(t,e,r){var n=t.entry;for(t.entry=null;n;){var i=n.callback;e.pendingcb--,i(r),n=n.next}e.corkedRequestsFree.next=t}Object.defineProperty(Ye.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}});Ye.prototype.destroy=ag.destroy;Ye.prototype._undestroy=ag.undestroy;Ye.prototype._destroy=function(t,e){e(t)}});var ki=y((Gle,dE)=>{"use strict";var D5=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};dE.exports=Ur;var fE=fg(),lg=ug();Zo()(Ur,fE);for(cg=D5(lg.prototype),Ll=0;Ll<cg.length;Ll++)Bl=cg[Ll],Ur.prototype[Bl]||(Ur.prototype[Bl]=lg.prototype[Bl]);var cg,Bl,Ll;function Ur(t){if(!(this instanceof Ur))return new Ur(t);fE.call(this,t),lg.call(this,t),this.allowHalfOpen=!0,t&&(t.readable===!1&&(this.readable=!1),t.writable===!1&&(this.writable=!1),t.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",v5)))}Object.defineProperty(Ur.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});Object.defineProperty(Ur.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});Object.defineProperty(Ur.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function v5(){this._writableState.ended||process.nextTick(b5,this)}function b5(t){t.end()}Object.defineProperty(Ur.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(e){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=e,this._writableState.destroyed=e)}})});var mE=y((dg,pE)=>{var ql=require("buffer"),Vr=ql.Buffer;function hE(t,e){for(var r in t)e[r]=t[r]}Vr.from&&Vr.alloc&&Vr.allocUnsafe&&Vr.allocUnsafeSlow?pE.exports=ql:(hE(ql,dg),dg.Buffer=Ti);function Ti(t,e,r){return Vr(t,e,r)}Ti.prototype=Object.create(Vr.prototype);hE(Vr,Ti);Ti.from=function(t,e,r){if(typeof t=="number")throw new TypeError("Argument must not be a number");return Vr(t,e,r)};Ti.alloc=function(t,e,r){if(typeof t!="number")throw new TypeError("Argument must be a number");var n=Vr(t);return e!==void 0?typeof r=="string"?n.fill(e,r):n.fill(e):n.fill(0),n};Ti.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return Vr(t)};Ti.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return ql.SlowBuffer(t)}});var mg=y(yE=>{"use strict";var pg=mE().Buffer,gE=pg.isEncoding||function(t){switch(t=""+t,t&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function w5(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}function _5(t){var e=w5(t);if(typeof e!="string"&&(pg.isEncoding===gE||!gE(t)))throw new Error("Unknown encoding: "+t);return e||t}yE.StringDecoder=hu;function hu(t){this.encoding=_5(t);var e;switch(this.encoding){case"utf16le":this.text=O5,this.end=A5,e=4;break;case"utf8":this.fillLast=S5,e=4;break;case"base64":this.text=k5,this.end=T5,e=3;break;default:this.write=P5,this.end=R5;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=pg.allocUnsafe(e)}hu.prototype.write=function(t){if(t.length===0)return"";var e,r;if(this.lastNeed){if(e=this.fillLast(t),e===void 0)return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<t.length?e?e+this.text(t,r):this.text(t,r):e||""};hu.prototype.end=F5;hu.prototype.text=x5;hu.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length};function hg(t){return t<=127?0:t>>5===6?2:t>>4===14?3:t>>3===30?4:t>>6===2?-1:-2}function E5(t,e,r){var n=e.length-1;if(n<r)return 0;var i=hg(e[n]);return i>=0?(i>0&&(t.lastNeed=i-1),i):--n<r||i===-2?0:(i=hg(e[n]),i>=0?(i>0&&(t.lastNeed=i-2),i):--n<r||i===-2?0:(i=hg(e[n]),i>=0?(i>0&&(i===2?i=0:t.lastNeed=i-3),i):0))}function C5(t,e,r){if((e[0]&192)!==128)return t.lastNeed=0,"\uFFFD";if(t.lastNeed>1&&e.length>1){if((e[1]&192)!==128)return t.lastNeed=1,"\uFFFD";if(t.lastNeed>2&&e.length>2&&(e[2]&192)!==128)return t.lastNeed=2,"\uFFFD"}}function S5(t){var e=this.lastTotal-this.lastNeed,r=C5(this,t,e);if(r!==void 0)return r;if(this.lastNeed<=t.length)return t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,e,0,t.length),this.lastNeed-=t.length}function x5(t,e){var r=E5(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var n=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,n),t.toString("utf8",e,n)}function F5(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"\uFFFD":e}function O5(t,e){if((t.length-e)%2===0){var r=t.toString("utf16le",e);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function A5(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function k5(t,e){var r=(t.length-e)%3;return r===0?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,r===1?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function T5(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function P5(t){return t.toString(this.encoding)}function R5(t){return t&&t.length?this.write(t):""}});var Ml=y((Kle,bE)=>{"use strict";var DE=Yn().codes.ERR_STREAM_PREMATURE_CLOSE;function $5(t){var e=!1;return function(){if(!e){e=!0;for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];t.apply(this,n)}}}function I5(){}function j5(t){return t.setHeader&&typeof t.abort=="function"}function vE(t,e,r){if(typeof e=="function")return vE(t,null,e);e||(e={}),r=$5(r||I5);var n=e.readable||e.readable!==!1&&t.readable,i=e.writable||e.writable!==!1&&t.writable,o=function(){t.writable||a()},s=t._writableState&&t._writableState.finished,a=function(){i=!1,s=!0,n||r.call(t)},u=t._readableState&&t._readableState.endEmitted,c=function(){n=!1,u=!0,i||r.call(t)},l=function(p){r.call(t,p)},f=function(){var p;if(n&&!u)return(!t._readableState||!t._readableState.ended)&&(p=new DE),r.call(t,p);if(i&&!s)return(!t._writableState||!t._writableState.ended)&&(p=new DE),r.call(t,p)},h=function(){t.req.on("finish",a)};return j5(t)?(t.on("complete",a),t.on("abort",f),t.req?h():t.on("request",h)):i&&!t._writableState&&(t.on("end",o),t.on("close",o)),t.on("end",c),t.on("finish",a),e.error!==!1&&t.on("error",l),t.on("close",f),function(){t.removeListener("complete",a),t.removeListener("abort",f),t.removeListener("request",h),t.req&&t.req.removeListener("finish",a),t.removeListener("end",o),t.removeListener("close",o),t.removeListener("finish",a),t.removeListener("end",c),t.removeListener("error",l),t.removeListener("close",f)}}bE.exports=vE});var _E=y((Yle,wE)=>{"use strict";var Ul;function Xn(t,e,r){return e=N5(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function N5(t){var e=L5(t,"string");return typeof e=="symbol"?e:String(e)}function L5(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var B5=Ml(),Zn=Symbol("lastResolve"),Pi=Symbol("lastReject"),pu=Symbol("error"),Vl=Symbol("ended"),Ri=Symbol("lastPromise"),gg=Symbol("handlePromise"),$i=Symbol("stream");function Qn(t,e){return{value:t,done:e}}function q5(t){var e=t[Zn];if(e!==null){var r=t[$i].read();r!==null&&(t[Ri]=null,t[Zn]=null,t[Pi]=null,e(Qn(r,!1)))}}function M5(t){process.nextTick(q5,t)}function U5(t,e){return function(r,n){t.then(function(){if(e[Vl]){r(Qn(void 0,!0));return}e[gg](r,n)},n)}}var V5=Object.getPrototypeOf(function(){}),H5=Object.setPrototypeOf((Ul={get stream(){return this[$i]},next:function(){var e=this,r=this[pu];if(r!==null)return Promise.reject(r);if(this[Vl])return Promise.resolve(Qn(void 0,!0));if(this[$i].destroyed)return new Promise(function(s,a){process.nextTick(function(){e[pu]?a(e[pu]):s(Qn(void 0,!0))})});var n=this[Ri],i;if(n)i=new Promise(U5(n,this));else{var o=this[$i].read();if(o!==null)return Promise.resolve(Qn(o,!1));i=new Promise(this[gg])}return this[Ri]=i,i}},Xn(Ul,Symbol.asyncIterator,function(){return this}),Xn(Ul,"return",function(){var e=this;return new Promise(function(r,n){e[$i].destroy(null,function(i){if(i){n(i);return}r(Qn(void 0,!0))})})}),Ul),V5),z5=function(e){var r,n=Object.create(H5,(r={},Xn(r,$i,{value:e,writable:!0}),Xn(r,Zn,{value:null,writable:!0}),Xn(r,Pi,{value:null,writable:!0}),Xn(r,pu,{value:null,writable:!0}),Xn(r,Vl,{value:e._readableState.endEmitted,writable:!0}),Xn(r,gg,{value:function(o,s){var a=n[$i].read();a?(n[Ri]=null,n[Zn]=null,n[Pi]=null,o(Qn(a,!1))):(n[Zn]=o,n[Pi]=s)},writable:!0}),r));return n[Ri]=null,B5(e,function(i){if(i&&i.code!=="ERR_STREAM_PREMATURE_CLOSE"){var o=n[Pi];o!==null&&(n[Ri]=null,n[Zn]=null,n[Pi]=null,o(i)),n[pu]=i;return}var s=n[Zn];s!==null&&(n[Ri]=null,n[Zn]=null,n[Pi]=null,s(Qn(void 0,!0))),n[Vl]=!0}),e.on("readable",M5.bind(null,n)),n};wE.exports=z5});var xE=y((Jle,SE)=>{"use strict";function EE(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(c){r(c);return}a.done?e(u):Promise.resolve(u).then(n,i)}function G5(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function s(u){EE(o,n,i,s,a,"next",u)}function a(u){EE(o,n,i,s,a,"throw",u)}s(void 0)})}}function CE(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function W5(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?CE(Object(r),!0).forEach(function(n){K5(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):CE(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function K5(t,e,r){return e=Y5(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Y5(t){var e=J5(t,"string");return typeof e=="symbol"?e:String(e)}function J5(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var X5=Yn().codes.ERR_INVALID_ARG_TYPE;function Z5(t,e,r){var n;if(e&&typeof e.next=="function")n=e;else if(e&&e[Symbol.asyncIterator])n=e[Symbol.asyncIterator]();else if(e&&e[Symbol.iterator])n=e[Symbol.iterator]();else throw new X5("iterable",["Iterable"],e);var i=new t(W5({objectMode:!0},r)),o=!1;i._read=function(){o||(o=!0,s())};function s(){return a.apply(this,arguments)}function a(){return a=G5(function*(){try{var u=yield n.next(),c=u.value,l=u.done;l?i.push(null):i.push(yield c)?s():o=!1}catch(f){i.destroy(f)}}),a.apply(this,arguments)}return i}SE.exports=Z5});var fg=y((Zle,jE)=>{"use strict";jE.exports=ye;var ts;ye.ReadableState=kE;var Xle=require("events").EventEmitter,AE=function(e,r){return e.listeners(r).length},gu=Zm(),Hl=require("buffer").Buffer,Q5=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function eU(t){return Hl.from(t)}function tU(t){return Hl.isBuffer(t)||t instanceof Q5}var yg=require("util"),ue;yg&&yg.debuglog?ue=yg.debuglog("stream"):ue=function(){};var rU=Y_(),Cg=tg(),nU=rg(),iU=nU.getHighWaterMark,zl=Yn().codes,oU=zl.ERR_INVALID_ARG_TYPE,sU=zl.ERR_STREAM_PUSH_AFTER_EOF,aU=zl.ERR_METHOD_NOT_IMPLEMENTED,uU=zl.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,rs,Dg,vg;Zo()(ye,gu);var mu=Cg.errorOrDestroy,bg=["error","close","destroy","pause","resume"];function cU(t,e,r){if(typeof t.prependListener=="function")return t.prependListener(e,r);!t._events||!t._events[e]?t.on(e,r):Array.isArray(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]}function kE(t,e,r){ts=ts||ki(),t=t||{},typeof r!="boolean"&&(r=e instanceof ts),this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=iU(this,t,"readableHighWaterMark",r),this.buffer=new rU,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=t.emitClose!==!1,this.autoDestroy=!!t.autoDestroy,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(rs||(rs=mg().StringDecoder),this.decoder=new rs(t.encoding),this.encoding=t.encoding)}function ye(t){if(ts=ts||ki(),!(this instanceof ye))return new ye(t);var e=this instanceof ts;this._readableState=new kE(t,this,e),this.readable=!0,t&&(typeof t.read=="function"&&(this._read=t.read),typeof t.destroy=="function"&&(this._destroy=t.destroy)),gu.call(this)}Object.defineProperty(ye.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}});ye.prototype.destroy=Cg.destroy;ye.prototype._undestroy=Cg.undestroy;ye.prototype._destroy=function(t,e){e(t)};ye.prototype.push=function(t,e){var r=this._readableState,n;return r.objectMode?n=!0:typeof t=="string"&&(e=e||r.defaultEncoding,e!==r.encoding&&(t=Hl.from(t,e),e=""),n=!0),TE(this,t,e,!1,n)};ye.prototype.unshift=function(t){return TE(this,t,null,!0,!1)};function TE(t,e,r,n,i){ue("readableAddChunk",e);var o=t._readableState;if(e===null)o.reading=!1,dU(t,o);else{var s;if(i||(s=lU(o,e)),s)mu(t,s);else if(o.objectMode||e&&e.length>0)if(typeof e!="string"&&!o.objectMode&&Object.getPrototypeOf(e)!==Hl.prototype&&(e=eU(e)),n)o.endEmitted?mu(t,new uU):wg(t,o,e,!0);else if(o.ended)mu(t,new sU);else{if(o.destroyed)return!1;o.reading=!1,o.decoder&&!r?(e=o.decoder.write(e),o.objectMode||e.length!==0?wg(t,o,e,!1):Eg(t,o)):wg(t,o,e,!1)}else n||(o.reading=!1,Eg(t,o))}return!o.ended&&(o.length<o.highWaterMark||o.length===0)}function wg(t,e,r,n){e.flowing&&e.length===0&&!e.sync?(e.awaitDrain=0,t.emit("data",r)):(e.length+=e.objectMode?1:r.length,n?e.buffer.unshift(r):e.buffer.push(r),e.needReadable&&Gl(t)),Eg(t,e)}function lU(t,e){var r;return!tU(e)&&typeof e!="string"&&e!==void 0&&!t.objectMode&&(r=new oU("chunk",["string","Buffer","Uint8Array"],e)),r}ye.prototype.isPaused=function(){return this._readableState.flowing===!1};ye.prototype.setEncoding=function(t){rs||(rs=mg().StringDecoder);var e=new rs(t);this._readableState.decoder=e,this._readableState.encoding=this._readableState.decoder.encoding;for(var r=this._readableState.buffer.head,n="";r!==null;)n+=e.write(r.data),r=r.next;return this._readableState.buffer.clear(),n!==""&&this._readableState.buffer.push(n),this._readableState.length=n.length,this};var FE=1073741824;function fU(t){return t>=FE?t=FE:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}function OE(t,e){return t<=0||e.length===0&&e.ended?0:e.objectMode?1:t!==t?e.flowing&&e.length?e.buffer.head.data.length:e.length:(t>e.highWaterMark&&(e.highWaterMark=fU(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}ye.prototype.read=function(t){ue("read",t),t=parseInt(t,10);var e=this._readableState,r=t;if(t!==0&&(e.emittedReadable=!1),t===0&&e.needReadable&&((e.highWaterMark!==0?e.length>=e.highWaterMark:e.length>0)||e.ended))return ue("read: emitReadable",e.length,e.ended),e.length===0&&e.ended?_g(this):Gl(this),null;if(t=OE(t,e),t===0&&e.ended)return e.length===0&&_g(this),null;var n=e.needReadable;ue("need readable",n),(e.length===0||e.length-t<e.highWaterMark)&&(n=!0,ue("length less than watermark",n)),e.ended||e.reading?(n=!1,ue("reading or ended",n)):n&&(ue("do read"),e.reading=!0,e.sync=!0,e.length===0&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1,e.reading||(t=OE(r,e)));var i;return t>0?i=$E(t,e):i=null,i===null?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.awaitDrain=0),e.length===0&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&_g(this)),i!==null&&this.emit("data",i),i};function dU(t,e){if(ue("onEofChunk"),!e.ended){if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,e.sync?Gl(t):(e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,PE(t)))}}function Gl(t){var e=t._readableState;ue("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(ue("emitReadable",e.flowing),e.emittedReadable=!0,process.nextTick(PE,t))}function PE(t){var e=t._readableState;ue("emitReadable_",e.destroyed,e.length,e.ended),!e.destroyed&&(e.length||e.ended)&&(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,Sg(t)}function Eg(t,e){e.readingMore||(e.readingMore=!0,process.nextTick(hU,t,e))}function hU(t,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&e.length===0);){var r=e.length;if(ue("maybeReadMore read 0"),t.read(0),r===e.length)break}e.readingMore=!1}ye.prototype._read=function(t){mu(this,new aU("_read()"))};ye.prototype.pipe=function(t,e){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=t;break;case 1:n.pipes=[n.pipes,t];break;default:n.pipes.push(t);break}n.pipesCount+=1,ue("pipe count=%d opts=%j",n.pipesCount,e);var i=(!e||e.end!==!1)&&t!==process.stdout&&t!==process.stderr,o=i?a:v;n.endEmitted?process.nextTick(o):r.once("end",o),t.on("unpipe",s);function s(g,w){ue("onunpipe"),g===r&&w&&w.hasUnpiped===!1&&(w.hasUnpiped=!0,l())}function a(){ue("onend"),t.end()}var u=pU(r);t.on("drain",u);var c=!1;function l(){ue("cleanup"),t.removeListener("close",d),t.removeListener("finish",p),t.removeListener("drain",u),t.removeListener("error",h),t.removeListener("unpipe",s),r.removeListener("end",a),r.removeListener("end",v),r.removeListener("data",f),c=!0,n.awaitDrain&&(!t._writableState||t._writableState.needDrain)&&u()}r.on("data",f);function f(g){ue("ondata");var w=t.write(g);ue("dest.write",w),w===!1&&((n.pipesCount===1&&n.pipes===t||n.pipesCount>1&&IE(n.pipes,t)!==-1)&&!c&&(ue("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function h(g){ue("onerror",g),v(),t.removeListener("error",h),AE(t,"error")===0&&mu(t,g)}cU(t,"error",h);function d(){t.removeListener("finish",p),v()}t.once("close",d);function p(){ue("onfinish"),t.removeListener("close",d),v()}t.once("finish",p);function v(){ue("unpipe"),r.unpipe(t)}return t.emit("pipe",r),n.flowing||(ue("pipe resume"),r.resume()),t};function pU(t){return function(){var r=t._readableState;ue("pipeOnDrain",r.awaitDrain),r.awaitDrain&&r.awaitDrain--,r.awaitDrain===0&&AE(t,"data")&&(r.flowing=!0,Sg(t))}}ye.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(e.pipesCount===0)return this;if(e.pipesCount===1)return t&&t!==e.pipes?this:(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r),this);if(!t){var n=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o<i;o++)n[o].emit("unpipe",this,{hasUnpiped:!1});return this}var s=IE(e.pipes,t);return s===-1?this:(e.pipes.splice(s,1),e.pipesCount-=1,e.pipesCount===1&&(e.pipes=e.pipes[0]),t.emit("unpipe",this,r),this)};ye.prototype.on=function(t,e){var r=gu.prototype.on.call(this,t,e),n=this._readableState;return t==="data"?(n.readableListening=this.listenerCount("readable")>0,n.flowing!==!1&&this.resume()):t==="readable"&&!n.endEmitted&&!n.readableListening&&(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,ue("on readable",n.length,n.reading),n.length?Gl(this):n.reading||process.nextTick(mU,this)),r};ye.prototype.addListener=ye.prototype.on;ye.prototype.removeListener=function(t,e){var r=gu.prototype.removeListener.call(this,t,e);return t==="readable"&&process.nextTick(RE,this),r};ye.prototype.removeAllListeners=function(t){var e=gu.prototype.removeAllListeners.apply(this,arguments);return(t==="readable"||t===void 0)&&process.nextTick(RE,this),e};function RE(t){var e=t._readableState;e.readableListening=t.listenerCount("readable")>0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}function mU(t){ue("readable nexttick read 0"),t.read(0)}ye.prototype.resume=function(){var t=this._readableState;return t.flowing||(ue("resume"),t.flowing=!t.readableListening,gU(this,t)),t.paused=!1,this};function gU(t,e){e.resumeScheduled||(e.resumeScheduled=!0,process.nextTick(yU,t,e))}function yU(t,e){ue("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),Sg(t),e.flowing&&!e.reading&&t.read(0)}ye.prototype.pause=function(){return ue("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(ue("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function Sg(t){var e=t._readableState;for(ue("flow",e.flowing);e.flowing&&t.read()!==null;);}ye.prototype.wrap=function(t){var e=this,r=this._readableState,n=!1;t.on("end",function(){if(ue("wrapped end"),r.decoder&&!r.ended){var s=r.decoder.end();s&&s.length&&e.push(s)}e.push(null)}),t.on("data",function(s){if(ue("wrapped data"),r.decoder&&(s=r.decoder.write(s)),!(r.objectMode&&s==null)&&!(!r.objectMode&&(!s||!s.length))){var a=e.push(s);a||(n=!0,t.pause())}});for(var i in t)this[i]===void 0&&typeof t[i]=="function"&&(this[i]=function(a){return function(){return t[a].apply(t,arguments)}}(i));for(var o=0;o<bg.length;o++)t.on(bg[o],this.emit.bind(this,bg[o]));return this._read=function(s){ue("wrapped _read",s),n&&(n=!1,t.resume())},this};typeof Symbol=="function"&&(ye.prototype[Symbol.asyncIterator]=function(){return Dg===void 0&&(Dg=_E()),Dg(this)});Object.defineProperty(ye.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}});Object.defineProperty(ye.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}});Object.defineProperty(ye.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}});ye._fromList=$E;Object.defineProperty(ye.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function $E(t,e){if(e.length===0)return null;var r;return e.objectMode?r=e.buffer.shift():!t||t>=e.length?(e.decoder?r=e.buffer.join(""):e.buffer.length===1?r=e.buffer.first():r=e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r}function _g(t){var e=t._readableState;ue("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,process.nextTick(DU,e,t))}function DU(t,e){if(ue("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&t.length===0&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var r=e._writableState;(!r||r.autoDestroy&&r.finished)&&e.destroy()}}typeof Symbol=="function"&&(ye.from=function(t,e){return vg===void 0&&(vg=xE()),vg(ye,t,e)});function IE(t,e){for(var r=0,n=t.length;r<n;r++)if(t[r]===e)return r;return-1}});var xg=y((Qle,LE)=>{"use strict";LE.exports=Dn;var Wl=Yn().codes,vU=Wl.ERR_METHOD_NOT_IMPLEMENTED,bU=Wl.ERR_MULTIPLE_CALLBACK,wU=Wl.ERR_TRANSFORM_ALREADY_TRANSFORMING,_U=Wl.ERR_TRANSFORM_WITH_LENGTH_0,Kl=ki();Zo()(Dn,Kl);function EU(t,e){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(n===null)return this.emit("error",new bU);r.writechunk=null,r.writecb=null,e!=null&&this.push(e),n(t);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function Dn(t){if(!(this instanceof Dn))return new Dn(t);Kl.call(this,t),this._transformState={afterTransform:EU.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,t&&(typeof t.transform=="function"&&(this._transform=t.transform),typeof t.flush=="function"&&(this._flush=t.flush)),this.on("prefinish",CU)}function CU(){var t=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(e,r){NE(t,e,r)}):NE(this,null,null)}Dn.prototype.push=function(t,e){return this._transformState.needTransform=!1,Kl.prototype.push.call(this,t,e)};Dn.prototype._transform=function(t,e,r){r(new vU("_transform()"))};Dn.prototype._write=function(t,e,r){var n=this._transformState;if(n.writecb=r,n.writechunk=t,n.writeencoding=e,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}};Dn.prototype._read=function(t){var e=this._transformState;e.writechunk!==null&&!e.transforming?(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform)):e.needTransform=!0};Dn.prototype._destroy=function(t,e){Kl.prototype._destroy.call(this,t,function(r){e(r)})};function NE(t,e,r){if(e)return t.emit("error",e);if(r!=null&&t.push(r),t._writableState.length)throw new _U;if(t._transformState.transforming)throw new wU;return t.push(null)}});var ME=y((efe,qE)=>{"use strict";qE.exports=yu;var BE=xg();Zo()(yu,BE);function yu(t){if(!(this instanceof yu))return new yu(t);BE.call(this,t)}yu.prototype._transform=function(t,e,r){r(null,t)}});var GE=y((tfe,zE)=>{"use strict";var Fg;function SU(t){var e=!1;return function(){e||(e=!0,t.apply(void 0,arguments))}}var HE=Yn().codes,xU=HE.ERR_MISSING_ARGS,FU=HE.ERR_STREAM_DESTROYED;function UE(t){if(t)throw t}function OU(t){return t.setHeader&&typeof t.abort=="function"}function AU(t,e,r,n){n=SU(n);var i=!1;t.on("close",function(){i=!0}),Fg===void 0&&(Fg=Ml()),Fg(t,{readable:e,writable:r},function(s){if(s)return n(s);i=!0,n()});var o=!1;return function(s){if(!i&&!o){if(o=!0,OU(t))return t.abort();if(typeof t.destroy=="function")return t.destroy();n(s||new FU("pipe"))}}}function VE(t){t()}function kU(t,e){return t.pipe(e)}function TU(t){return!t.length||typeof t[t.length-1]!="function"?UE:t.pop()}function PU(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];var n=TU(e);if(Array.isArray(e[0])&&(e=e[0]),e.length<2)throw new xU("streams");var i,o=e.map(function(s,a){var u=a<e.length-1,c=a>0;return AU(s,u,c,function(l){i||(i=l),l&&o.forEach(VE),!u&&(o.forEach(VE),n(i))})});return e.reduce(kU)}zE.exports=PU});var WE=y((yr,vu)=>{var Du=require("stream");process.env.READABLE_STREAM==="disable"&&Du?(vu.exports=Du.Readable,Object.assign(vu.exports,Du),vu.exports.Stream=Du):(yr=vu.exports=fg(),yr.Stream=Du||yr,yr.Readable=yr,yr.Writable=ug(),yr.Duplex=ki(),yr.Transform=xg(),yr.PassThrough=ME(),yr.finished=Ml(),yr.pipeline=GE())});var Ag=y(Og=>{var KE;(function(t){typeof DO_NOT_EXPORT_CRC>"u"?typeof Og=="object"?t(Og):typeof define=="function"&&define.amd?define(function(){var e={};return t(e),e}):t(KE={}):t(KE={})})(function(t){t.version="1.2.2";function e(){for(var F=0,L=new Array(256),S=0;S!=256;++S)F=S,F=F&1?-306674912^F>>>1:F>>>1,F=F&1?-306674912^F>>>1:F>>>1,F=F&1?-306674912^F>>>1:F>>>1,F=F&1?-306674912^F>>>1:F>>>1,F=F&1?-306674912^F>>>1:F>>>1,F=F&1?-306674912^F>>>1:F>>>1,F=F&1?-306674912^F>>>1:F>>>1,F=F&1?-306674912^F>>>1:F>>>1,L[S]=F;return typeof Int32Array<"u"?new Int32Array(L):L}var r=e();function n(F){var L=0,S=0,I=0,R=typeof Int32Array<"u"?new Int32Array(4096):new Array(4096);for(I=0;I!=256;++I)R[I]=F[I];for(I=0;I!=256;++I)for(S=F[I],L=256+I;L<4096;L+=256)S=R[L]=S>>>8^F[S&255];var B=[];for(I=1;I!=16;++I)B[I-1]=typeof Int32Array<"u"?R.subarray(I*256,I*256+256):R.slice(I*256,I*256+256);return B}var i=n(r),o=i[0],s=i[1],a=i[2],u=i[3],c=i[4],l=i[5],f=i[6],h=i[7],d=i[8],p=i[9],v=i[10],g=i[11],w=i[12],x=i[13],D=i[14];function C(F,L){for(var S=L^-1,I=0,R=F.length;I<R;)S=S>>>8^r[(S^F.charCodeAt(I++))&255];return~S}function k(F,L){for(var S=L^-1,I=F.length-15,R=0;R<I;)S=D[F[R++]^S&255]^x[F[R++]^S>>8&255]^w[F[R++]^S>>16&255]^g[F[R++]^S>>>24]^v[F[R++]]^p[F[R++]]^d[F[R++]]^h[F[R++]]^f[F[R++]]^l[F[R++]]^c[F[R++]]^u[F[R++]]^a[F[R++]]^s[F[R++]]^o[F[R++]]^r[F[R++]];for(I+=15;R<I;)S=S>>>8^r[(S^F[R++])&255];return~S}function $(F,L){for(var S=L^-1,I=0,R=F.length,B=0,q=0;I<R;)B=F.charCodeAt(I++),B<128?S=S>>>8^r[(S^B)&255]:B<2048?(S=S>>>8^r[(S^(192|B>>6&31))&255],S=S>>>8^r[(S^(128|B&63))&255]):B>=55296&&B<57344?(B=(B&1023)+64,q=F.charCodeAt(I++)&1023,S=S>>>8^r[(S^(240|B>>8&7))&255],S=S>>>8^r[(S^(128|B>>2&63))&255],S=S>>>8^r[(S^(128|q>>6&15|(B&3)<<4))&255],S=S>>>8^r[(S^(128|q&63))&255]):(S=S>>>8^r[(S^(224|B>>12&15))&255],S=S>>>8^r[(S^(128|B>>6&63))&255],S=S>>>8^r[(S^(128|B&63))&255]);return~S}t.table=r,t.bstr=C,t.buf=k,t.str=$})});var JE=y((nfe,YE)=>{"use strict";var{Transform:RU}=WE(),$U=Ag(),kg=class extends RU{constructor(e){super(e),this.checksum=Buffer.allocUnsafe(4),this.checksum.writeInt32BE(0,0),this.rawSize=0}_transform(e,r,n){e&&(this.checksum=$U.buf(e,this.checksum)>>>0,this.rawSize+=e.length),n(null,e)}digest(e){let r=Buffer.allocUnsafe(4);return r.writeUInt32BE(this.checksum>>>0,0),e?r.toString(e):r}hex(){return this.digest("hex").toUpperCase()}size(){return this.rawSize}};YE.exports=kg});var ZE=y((ife,XE)=>{"use strict";var{DeflateRaw:IU}=require("zlib"),jU=Ag(),Tg=class extends IU{constructor(e){super(e),this.checksum=Buffer.allocUnsafe(4),this.checksum.writeInt32BE(0,0),this.rawSize=0,this.compressedSize=0}push(e,r){return e&&(this.compressedSize+=e.length),super.push(e,r)}_transform(e,r,n){e&&(this.checksum=jU.buf(e,this.checksum)>>>0,this.rawSize+=e.length),super._transform(e,r,n)}digest(e){let r=Buffer.allocUnsafe(4);return r.writeUInt32BE(this.checksum>>>0,0),e?r.toString(e):r}hex(){return this.digest("hex").toUpperCase()}size(e=!1){return e?this.compressedSize:this.rawSize}};XE.exports=Tg});var eC=y((ofe,QE)=>{"use strict";QE.exports={CRC32Stream:JE(),DeflateCRC32Stream:ZE()}});var bu=y(ns=>{"use strict";Object.defineProperty(ns,"__esModule",{value:!0});ns.checksum=ns.checksumFile=void 0;var NU=require("fs"),LU=require("crypto"),rC=require("stream"),BU=require("util"),{CRC32Stream:qU}=eC(),tC=(0,BU.promisify)(rC.pipeline),MU=(t,e,r)=>nC(NU.createReadStream(t),e,r);ns.checksumFile=MU;async function nC(t,e,r="hex"){let n=VU(t);if(e==="crc32"){let o=new qU,s=tC(n,o);return o.resume(),await s,o.end(),Buffer.from(o.digest()).toString(r)}let i=(0,LU.createHash)(e);return await tC(n,i),i.end(),i.digest(r)}ns.checksum=nC;function UU(t){return t!=null&&typeof t=="object"&&typeof t.read=="function"&&typeof t.pipe=="function"}var VU=t=>UU(t)?t:new rC.Readable({read(){this.push(t),this.push(null)}})});var Pg=y((afe,iC)=>{iC.exports={LOCHDR:30,LOCSIG:67324752,LOCVER:4,LOCFLG:6,LOCHOW:8,LOCTIM:10,LOCCRC:14,LOCSIZ:18,LOCLEN:22,LOCNAM:26,LOCEXT:28,EXTSIG:134695760,EXTHDR:16,EXTCRC:4,EXTSIZ:8,EXTLEN:12,CENHDR:46,CENSIG:33639248,CENVEM:4,CENVER:6,CENFLG:8,CENHOW:10,CENTIM:12,CENCRC:16,CENSIZ:20,CENLEN:24,CENNAM:28,CENEXT:30,CENCOM:32,CENDSK:34,CENATT:36,CENATX:38,CENOFF:42,ENDHDR:22,ENDSIG:101010256,ENDSUB:8,ENDTOT:10,ENDSIZ:12,ENDOFF:16,ENDCOM:20,END64HDR:20,END64SIG:117853008,END64START:4,END64OFF:8,END64NUMDISKS:16,ZIP64SIG:101075792,ZIP64HDR:56,ZIP64LEAD:12,ZIP64SIZE:4,ZIP64VEM:12,ZIP64VER:14,ZIP64DSK:16,ZIP64DSKDIR:20,ZIP64SUB:24,ZIP64TOT:32,ZIP64SIZB:40,ZIP64OFF:48,ZIP64EXTRA:56,STORED:0,SHRUNK:1,REDUCED1:2,REDUCED2:3,REDUCED3:4,REDUCED4:5,IMPLODED:6,DEFLATED:8,ENHANCED_DEFLATED:9,PKWARE:10,BZIP2:12,LZMA:14,IBM_TERSE:18,IBM_LZ77:19,AES_ENCRYPT:99,FLG_ENC:1,FLG_COMP1:2,FLG_COMP2:4,FLG_DESC:8,FLG_ENH:16,FLG_PATCH:32,FLG_STR:64,FLG_EFS:2048,FLG_MSK:4096,FILE:2,BUFFER:1,NONE:0,EF_ID:0,EF_SIZE:2,ID_ZIP64:1,ID_AVINFO:7,ID_PFS:8,ID_OS2:9,ID_NTFS:10,ID_OPENVMS:12,ID_UNIX:13,ID_FORK:14,ID_PATCH:15,ID_X509_PKCS7:20,ID_X509_CERTID_F:21,ID_X509_CERTID_C:22,ID_STRONGENC:23,ID_RECORD_MGT:24,ID_X509_PKCS7_RL:25,ID_IBM1:101,ID_IBM2:102,ID_POSZIP:18064,EF_ZIP64_OR_32:4294967295,EF_ZIP64_OR_16:65535,EF_ZIP64_SUNCOMP:0,EF_ZIP64_SCOMP:8,EF_ZIP64_RHO:16,EF_ZIP64_DSN:24}});var Yl=y(sC=>{var oC={INVALID_LOC:"Invalid LOC header (bad signature)",INVALID_CEN:"Invalid CEN header (bad signature)",INVALID_END:"Invalid END header (bad signature)",DESCRIPTOR_NOT_EXIST:"No descriptor present",DESCRIPTOR_UNKNOWN:"Unknown descriptor format",DESCRIPTOR_FAULTY:"Descriptor data is malformed",NO_DATA:"Nothing to decompress",BAD_CRC:"CRC32 checksum failed {0}",FILE_IN_THE_WAY:"There is a file in the way: {0}",UNKNOWN_METHOD:"Invalid/unsupported compression method",AVAIL_DATA:"inflate::Available inflate data did not terminate",INVALID_DISTANCE:"inflate::Invalid literal/length or distance code in fixed or dynamic block",TO_MANY_CODES:"inflate::Dynamic block code description: too many length or distance codes",INVALID_REPEAT_LEN:"inflate::Dynamic block code description: repeat more than specified lengths",INVALID_REPEAT_FIRST:"inflate::Dynamic block code description: repeat lengths with no first length",INCOMPLETE_CODES:"inflate::Dynamic block code description: code lengths codes incomplete",INVALID_DYN_DISTANCE:"inflate::Dynamic block code description: invalid distance code lengths",INVALID_CODES_LEN:"inflate::Dynamic block code description: invalid literal/length code lengths",INVALID_STORE_BLOCK:"inflate::Stored block length did not match one's complement",INVALID_BLOCK_TYPE:"inflate::Invalid block type (type == 3)",CANT_EXTRACT_FILE:"Could not extract the file",CANT_OVERRIDE:"Target file already exists",DISK_ENTRY_TOO_LARGE:"Number of disk entries is too large",NO_ZIP:"No zip file was loaded",NO_ENTRY:"Entry doesn't exist",DIRECTORY_CONTENT_ERROR:"A directory cannot have content",FILE_NOT_FOUND:'File not found: "{0}"',NOT_IMPLEMENTED:"Not implemented",INVALID_FILENAME:"Invalid filename",INVALID_FORMAT:"Invalid or unsupported zip format. No END header found",INVALID_PASS_PARAM:"Incompatible password parameter",WRONG_PASSWORD:"Wrong Password",COMMENT_TOO_LONG:"Comment is too long",EXTRA_FIELD_PARSE_ERROR:"Extra field parsing error"};function HU(t){return function(...e){return e.length&&(t=t.replace(/\{(\d)\}/g,(r,n)=>e[n]||"")),new Error("ADM-ZIP: "+t)}}for(let t of Object.keys(oC))sC[t]=HU(oC[t])});var fC=y((cfe,lC)=>{var zU=require("fs"),at=require("path"),aC=Pg(),GU=Yl(),WU=typeof process=="object"&&process.platform==="win32",uC=t=>typeof t=="object"&&t!==null,cC=new Uint32Array(256).map((t,e)=>{for(let r=0;r<8;r++)e&1?e=3988292384^e>>>1:e>>>=1;return e>>>0});function Je(t){this.sep=at.sep,this.fs=zU,uC(t)&&uC(t.fs)&&typeof t.fs.statSync=="function"&&(this.fs=t.fs)}lC.exports=Je;Je.prototype.makeDir=function(t){let e=this;function r(n){let i=n.split(e.sep)[0];n.split(e.sep).forEach(function(o){if(!(!o||o.substr(-1,1)===":")){i+=e.sep+o;var s;try{s=e.fs.statSync(i)}catch{e.fs.mkdirSync(i)}if(s&&s.isFile())throw GU.FILE_IN_THE_WAY(`"${i}"`)}})}r(t)};Je.prototype.writeFileTo=function(t,e,r,n){let i=this;if(i.fs.existsSync(t)){if(!r)return!1;var o=i.fs.statSync(t);if(o.isDirectory())return!1}var s=at.dirname(t);i.fs.existsSync(s)||i.makeDir(s);var a;try{a=i.fs.openSync(t,"w",438)}catch{i.fs.chmodSync(t,438),a=i.fs.openSync(t,"w",438)}if(a)try{i.fs.writeSync(a,e,0,e.length,0)}finally{i.fs.closeSync(a)}return i.fs.chmodSync(t,n||438),!0};Je.prototype.writeFileToAsync=function(t,e,r,n,i){typeof n=="function"&&(i=n,n=void 0);let o=this;o.fs.exists(t,function(s){if(s&&!r)return i(!1);o.fs.stat(t,function(a,u){if(s&&u.isDirectory())return i(!1);var c=at.dirname(t);o.fs.exists(c,function(l){l||o.makeDir(c),o.fs.open(t,"w",438,function(f,h){f?o.fs.chmod(t,438,function(){o.fs.open(t,"w",438,function(d,p){o.fs.write(p,e,0,e.length,0,function(){o.fs.close(p,function(){o.fs.chmod(t,n||438,function(){i(!0)})})})})}):h?o.fs.write(h,e,0,e.length,0,function(){o.fs.close(h,function(){o.fs.chmod(t,n||438,function(){i(!0)})})}):o.fs.chmod(t,n||438,function(){i(!0)})})})})})};Je.prototype.findFiles=function(t){let e=this;function r(n,i,o){typeof i=="boolean"&&(o=i,i=void 0);let s=[];return e.fs.readdirSync(n).forEach(function(a){let u=at.join(n,a),c=e.fs.statSync(u);(!i||i.test(u))&&s.push(at.normalize(u)+(c.isDirectory()?e.sep:"")),c.isDirectory()&&o&&(s=s.concat(r(u,i,o)))}),s}return r(t,void 0,!0)};Je.prototype.findFilesAsync=function(t,e){let r=this,n=[];r.fs.readdir(t,function(i,o){if(i)return e(i);let s=o.length;if(!s)return e(null,n);o.forEach(function(a){a=at.join(t,a),r.fs.stat(a,function(u,c){if(u)return e(u);c&&(n.push(at.normalize(a)+(c.isDirectory()?r.sep:"")),c.isDirectory()?r.findFilesAsync(a,function(l,f){if(l)return e(l);n=n.concat(f),--s||e(null,n)}):--s||e(null,n))})})})};Je.prototype.getAttributes=function(){};Je.prototype.setAttributes=function(){};Je.crc32update=function(t,e){return cC[(t^e)&255]^t>>>8};Je.crc32=function(t){typeof t=="string"&&(t=Buffer.from(t,"utf8"));let e=t.length,r=-1;for(let n=0;n<e;)r=Je.crc32update(r,t[n++]);return~r>>>0};Je.methodToString=function(t){switch(t){case aC.STORED:return"STORED ("+t+")";case aC.DEFLATED:return"DEFLATED ("+t+")";default:return"UNSUPPORTED ("+t+")"}};Je.canonical=function(t){if(!t)return"";let e=at.posix.normalize("/"+t.split("\\").join("/"));return at.join(".",e)};Je.zipnamefix=function(t){if(!t)return"";let e=at.posix.normalize("/"+t.split("\\").join("/"));return at.posix.join(".",e)};Je.findLast=function(t,e){if(!Array.isArray(t))throw new TypeError("arr is not array");let r=t.length>>>0;for(let n=r-1;n>=0;n--)if(e(t[n],n,t))return t[n]};Je.sanitize=function(t,e){t=at.resolve(at.normalize(t));for(var r=e.split("/"),n=0,i=r.length;n<i;n++){var o=at.normalize(at.join(t,r.slice(n,i).join(at.sep)));if(o.indexOf(t)===0)return o}return at.normalize(at.join(t,at.basename(e)))};Je.toBuffer=function(e,r){return Buffer.isBuffer(e)?e:e instanceof Uint8Array?Buffer.from(e):typeof e=="string"?r(e):Buffer.alloc(0)};Je.readBigUInt64LE=function(t,e){var r=Buffer.from(t.slice(e,e+8));return r.swap64(),parseInt(`0x${r.toString("hex")}`)};Je.fromDOS2Date=function(t){return new Date((t>>25&127)+1980,Math.max((t>>21&15)-1,0),Math.max(t>>16&31,1),t>>11&31,t>>5&63,(t&31)<<1)};Je.fromDate2DOS=function(t){let e=0,r=0;return t.getFullYear()>1979&&(e=(t.getFullYear()-1980&127)<<9|t.getMonth()+1<<5|t.getDate(),r=t.getHours()<<11|t.getMinutes()<<5|t.getSeconds()>>1),e<<16|r};Je.isWin=WU;Je.crcTable=cC});var hC=y((lfe,dC)=>{var KU=require("path");dC.exports=function(t,{fs:e}){var r=t||"",n=o(),i=null;function o(){return{directory:!1,readonly:!1,hidden:!1,executable:!1,mtime:0,atime:0}}return r&&e.existsSync(r)?(i=e.statSync(r),n.directory=i.isDirectory(),n.mtime=i.mtime,n.atime=i.atime,n.executable=(73&i.mode)!==0,n.readonly=(128&i.mode)===0,n.hidden=KU.basename(r)[0]==="."):console.warn("Invalid path: "+r),{get directory(){return n.directory},get readOnly(){return n.readonly},get hidden(){return n.hidden},get mtime(){return n.mtime},get atime(){return n.atime},get executable(){return n.executable},decodeAttributes:function(){},encodeAttributes:function(){},toJSON:function(){return{path:r,isDirectory:n.directory,isReadOnly:n.readonly,isHidden:n.hidden,isExecutable:n.executable,mTime:n.mtime,aTime:n.atime}},toString:function(){return JSON.stringify(this.toJSON(),null," ")}}}});var mC=y((ffe,pC)=>{pC.exports={efs:!0,encode:t=>Buffer.from(t,"utf8"),decode:t=>t.toString("utf8")}});var os=y((dfe,is)=>{is.exports=fC();is.exports.Constants=Pg();is.exports.Errors=Yl();is.exports.FileAttr=hC();is.exports.decoder=mC()});var yC=y((hfe,gC)=>{var ei=os(),V=ei.Constants;gC.exports=function(){var t=20,e=10,r=0,n=0,i=0,o=0,s=0,a=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0;t|=ei.isWin?2560:768,r|=V.FLG_EFS;let v={extraLen:0},g=D=>Math.max(0,D)>>>0,w=D=>Math.max(0,D)&65535,x=D=>Math.max(0,D)&255;return i=ei.fromDate2DOS(new Date),{get made(){return t},set made(D){t=D},get version(){return e},set version(D){e=D},get flags(){return r},set flags(D){r=D},get flags_efs(){return(r&V.FLG_EFS)>0},set flags_efs(D){D?r|=V.FLG_EFS:r&=~V.FLG_EFS},get flags_desc(){return(r&V.FLG_DESC)>0},set flags_desc(D){D?r|=V.FLG_DESC:r&=~V.FLG_DESC},get method(){return n},set method(D){switch(D){case V.STORED:this.version=10;case V.DEFLATED:default:this.version=20}n=D},get time(){return ei.fromDOS2Date(this.timeval)},set time(D){this.timeval=ei.fromDate2DOS(D)},get timeval(){return i},set timeval(D){i=g(D)},get timeHighByte(){return x(i>>>8)},get crc(){return o},set crc(D){o=g(D)},get compressedSize(){return s},set compressedSize(D){s=g(D)},get size(){return a},set size(D){a=g(D)},get fileNameLength(){return u},set fileNameLength(D){u=D},get extraLength(){return c},set extraLength(D){c=D},get extraLocalLength(){return v.extraLen},set extraLocalLength(D){v.extraLen=D},get commentLength(){return l},set commentLength(D){l=D},get diskNumStart(){return f},set diskNumStart(D){f=g(D)},get inAttr(){return h},set inAttr(D){h=g(D)},get attr(){return d},set attr(D){d=g(D)},get fileAttr(){return(d||0)>>16&4095},get offset(){return p},set offset(D){p=g(D)},get encrypted(){return(r&V.FLG_ENC)===V.FLG_ENC},get centralHeaderSize(){return V.CENHDR+u+c+l},get realDataOffset(){return p+V.LOCHDR+v.fnameLen+v.extraLen},get localHeader(){return v},loadLocalHeaderFromBinary:function(D){var C=D.slice(p,p+V.LOCHDR);if(C.readUInt32LE(0)!==V.LOCSIG)throw ei.Errors.INVALID_LOC();v.version=C.readUInt16LE(V.LOCVER),v.flags=C.readUInt16LE(V.LOCFLG),v.method=C.readUInt16LE(V.LOCHOW),v.time=C.readUInt32LE(V.LOCTIM),v.crc=C.readUInt32LE(V.LOCCRC),v.compressedSize=C.readUInt32LE(V.LOCSIZ),v.size=C.readUInt32LE(V.LOCLEN),v.fnameLen=C.readUInt16LE(V.LOCNAM),v.extraLen=C.readUInt16LE(V.LOCEXT);let k=p+V.LOCHDR+v.fnameLen,$=k+v.extraLen;return D.slice(k,$)},loadFromBinary:function(D){if(D.length!==V.CENHDR||D.readUInt32LE(0)!==V.CENSIG)throw ei.Errors.INVALID_CEN();t=D.readUInt16LE(V.CENVEM),e=D.readUInt16LE(V.CENVER),r=D.readUInt16LE(V.CENFLG),n=D.readUInt16LE(V.CENHOW),i=D.readUInt32LE(V.CENTIM),o=D.readUInt32LE(V.CENCRC),s=D.readUInt32LE(V.CENSIZ),a=D.readUInt32LE(V.CENLEN),u=D.readUInt16LE(V.CENNAM),c=D.readUInt16LE(V.CENEXT),l=D.readUInt16LE(V.CENCOM),f=D.readUInt16LE(V.CENDSK),h=D.readUInt16LE(V.CENATT),d=D.readUInt32LE(V.CENATX),p=D.readUInt32LE(V.CENOFF)},localHeaderToBinary:function(){var D=Buffer.alloc(V.LOCHDR);return D.writeUInt32LE(V.LOCSIG,0),D.writeUInt16LE(e,V.LOCVER),D.writeUInt16LE(r,V.LOCFLG),D.writeUInt16LE(n,V.LOCHOW),D.writeUInt32LE(i,V.LOCTIM),D.writeUInt32LE(o,V.LOCCRC),D.writeUInt32LE(s,V.LOCSIZ),D.writeUInt32LE(a,V.LOCLEN),D.writeUInt16LE(u,V.LOCNAM),D.writeUInt16LE(v.extraLen,V.LOCEXT),D},centralHeaderToBinary:function(){var D=Buffer.alloc(V.CENHDR+u+c+l);return D.writeUInt32LE(V.CENSIG,0),D.writeUInt16LE(t,V.CENVEM),D.writeUInt16LE(e,V.CENVER),D.writeUInt16LE(r,V.CENFLG),D.writeUInt16LE(n,V.CENHOW),D.writeUInt32LE(i,V.CENTIM),D.writeUInt32LE(o,V.CENCRC),D.writeUInt32LE(s,V.CENSIZ),D.writeUInt32LE(a,V.CENLEN),D.writeUInt16LE(u,V.CENNAM),D.writeUInt16LE(c,V.CENEXT),D.writeUInt16LE(l,V.CENCOM),D.writeUInt16LE(f,V.CENDSK),D.writeUInt16LE(h,V.CENATT),D.writeUInt32LE(d,V.CENATX),D.writeUInt32LE(p,V.CENOFF),D},toJSON:function(){let D=function(C){return C+" bytes"};return{made:t,version:e,flags:r,method:ei.methodToString(n),time:this.time,crc:"0x"+o.toString(16).toUpperCase(),compressedSize:D(s),size:D(a),fileNameLength:D(u),extraLength:D(c),commentLength:D(l),diskNumStart:f,inAttr:h,attr:d,offset:p,centralHeaderSize:D(V.CENHDR+u+c+l)}},toString:function(){return JSON.stringify(this.toJSON(),null," ")}}}});var vC=y((pfe,DC)=>{var ss=os(),Me=ss.Constants;DC.exports=function(){var t=0,e=0,r=0,n=0,i=0;return{get diskEntries(){return t},set diskEntries(o){t=e=o},get totalEntries(){return e},set totalEntries(o){e=t=o},get size(){return r},set size(o){r=o},get offset(){return n},set offset(o){n=o},get commentLength(){return i},set commentLength(o){i=o},get mainHeaderSize(){return Me.ENDHDR+i},loadFromBinary:function(o){if((o.length!==Me.ENDHDR||o.readUInt32LE(0)!==Me.ENDSIG)&&(o.length<Me.ZIP64HDR||o.readUInt32LE(0)!==Me.ZIP64SIG))throw ss.Errors.INVALID_END();o.readUInt32LE(0)===Me.ENDSIG?(t=o.readUInt16LE(Me.ENDSUB),e=o.readUInt16LE(Me.ENDTOT),r=o.readUInt32LE(Me.ENDSIZ),n=o.readUInt32LE(Me.ENDOFF),i=o.readUInt16LE(Me.ENDCOM)):(t=ss.readBigUInt64LE(o,Me.ZIP64SUB),e=ss.readBigUInt64LE(o,Me.ZIP64TOT),r=ss.readBigUInt64LE(o,Me.ZIP64SIZE),n=ss.readBigUInt64LE(o,Me.ZIP64OFF),i=0)},toBinary:function(){var o=Buffer.alloc(Me.ENDHDR+i);return o.writeUInt32LE(Me.ENDSIG,0),o.writeUInt32LE(0,4),o.writeUInt16LE(t,Me.ENDSUB),o.writeUInt16LE(e,Me.ENDTOT),o.writeUInt32LE(r,Me.ENDSIZ),o.writeUInt32LE(n,Me.ENDOFF),o.writeUInt16LE(i,Me.ENDCOM),o.fill(" ",Me.ENDHDR),o},toJSON:function(){let o=function(s,a){let u=s.toString(16).toUpperCase();for(;u.length<a;)u="0"+u;return"0x"+u};return{diskEntries:t,totalEntries:e,size:r+" bytes",offset:o(n,4),commentLength:i}},toString:function(){return JSON.stringify(this.toJSON(),null," ")}}}});var $g=y(Rg=>{Rg.EntryHeader=yC();Rg.MainHeader=vC()});var wC=y((gfe,bC)=>{bC.exports=function(t){var e=require("zlib"),r={chunkSize:(parseInt(t.length/1024)+1)*1024};return{deflate:function(){return e.deflateRawSync(t,r)},deflateAsync:function(n){var i=e.createDeflateRaw(r),o=[],s=0;i.on("data",function(a){o.push(a),s+=a.length}),i.on("end",function(){var a=Buffer.alloc(s),u=0;a.fill(0);for(var c=0;c<o.length;c++){var l=o[c];l.copy(a,u),u+=l.length}n&&n(a)}),i.end(t)}}}});var EC=y((yfe,_C)=>{var YU=+(process.versions?process.versions.node:"").split(".")[0]||0;_C.exports=function(t,e){var r=require("zlib");let n=YU>=15&&e>0?{maxOutputLength:e}:{};return{inflate:function(){return r.inflateRawSync(t,n)},inflateAsync:function(i){var o=r.createInflateRaw(n),s=[],a=0;o.on("data",function(u){s.push(u),a+=u.length}),o.on("end",function(){var u=Buffer.alloc(a),c=0;u.fill(0);for(var l=0;l<s.length;l++){var f=s[l];f.copy(u,c),c+=f.length}i&&i(u)}),o.end(t)}}}});var OC=y((Dfe,FC)=>{"use strict";var{randomFillSync:CC}=require("crypto"),JU=Yl(),XU=new Uint32Array(256).map((t,e)=>{for(let r=0;r<8;r++)e&1?e=e>>>1^3988292384:e>>>=1;return e>>>0}),xC=(t,e)=>Math.imul(t,e)>>>0,SC=(t,e)=>XU[(t^e)&255]^t>>>8,wu=()=>typeof CC=="function"?CC(Buffer.alloc(12)):wu.node();wu.node=()=>{let t=Buffer.alloc(12),e=t.length;for(let r=0;r<e;r++)t[r]=Math.random()*256&255;return t};var Jl={genSalt:wu};function Xl(t){let e=Buffer.isBuffer(t)?t:Buffer.from(t);this.keys=new Uint32Array([305419896,591751049,878082192]);for(let r=0;r<e.length;r++)this.updateKeys(e[r])}Xl.prototype.updateKeys=function(t){let e=this.keys;return e[0]=SC(e[0],t),e[1]+=e[0]&255,e[1]=xC(e[1],134775813)+1,e[2]=SC(e[2],e[1]>>>24),t};Xl.prototype.next=function(){let t=(this.keys[2]|2)>>>0;return xC(t,t^1)>>8&255};function ZU(t){let e=new Xl(t);return function(r){let n=Buffer.alloc(r.length),i=0;for(let o of r)n[i++]=e.updateKeys(o^e.next());return n}}function QU(t){let e=new Xl(t);return function(r,n,i=0){n||(n=Buffer.alloc(r.length));for(let o of r){let s=e.next();n[i++]=o^s,e.updateKeys(o)}return n}}function e9(t,e,r){if(!t||!Buffer.isBuffer(t)||t.length<12)return Buffer.alloc(0);let n=ZU(r),i=n(t.slice(0,12)),o=(e.flags&8)===8?e.timeHighByte:e.crc>>>24;if(i[11]!==o)throw JU.WRONG_PASSWORD();return n(t.slice(12))}function t9(t){Buffer.isBuffer(t)&&t.length>=12?Jl.genSalt=function(){return t.slice(0,12)}:t==="node"?Jl.genSalt=wu.node:Jl.genSalt=wu}function r9(t,e,r,n=!1){t==null&&(t=Buffer.alloc(0)),Buffer.isBuffer(t)||(t=Buffer.from(t.toString()));let i=QU(r),o=Jl.genSalt();o[11]=e.crc>>>24&255,n&&(o[10]=e.crc>>>16&255);let s=Buffer.alloc(t.length+12);return i(o,s),i(t,s,12)}FC.exports={decrypt:e9,encrypt:r9,_salter:t9}});var AC=y(Zl=>{Zl.Deflater=wC();Zl.Inflater=EC();Zl.ZipCrypto=OC()});var jg=y((bfe,kC)=>{var we=os(),n9=$g(),Xe=we.Constants,Ig=AC();kC.exports=function(t,e){var r=new n9.EntryHeader,n=Buffer.alloc(0),i=Buffer.alloc(0),o=!1,s=null,a=Buffer.alloc(0),u=Buffer.alloc(0),c=!0;let l=t,f=typeof l.decoder=="object"?l.decoder:we.decoder;c=f.hasOwnProperty("efs")?f.efs:!1;function h(){return!e||!(e instanceof Uint8Array)?Buffer.alloc(0):(u=r.loadLocalHeaderFromBinary(e),e.slice(r.realDataOffset,r.realDataOffset+r.compressedSize))}function d(D){if(r.flags_desc){let C={},k=r.realDataOffset+r.compressedSize;if(e.readUInt32LE(k)==Xe.LOCSIG||e.readUInt32LE(k)==Xe.CENSIG)throw we.Errors.DESCRIPTOR_NOT_EXIST();if(e.readUInt32LE(k)==Xe.EXTSIG)C.crc=e.readUInt32LE(k+Xe.EXTCRC),C.compressedSize=e.readUInt32LE(k+Xe.EXTSIZ),C.size=e.readUInt32LE(k+Xe.EXTLEN);else if(e.readUInt16LE(k+12)===19280)C.crc=e.readUInt32LE(k+Xe.EXTCRC-4),C.compressedSize=e.readUInt32LE(k+Xe.EXTSIZ-4),C.size=e.readUInt32LE(k+Xe.EXTLEN-4);else throw we.Errors.DESCRIPTOR_UNKNOWN();if(C.compressedSize!==r.compressedSize||C.size!==r.size||C.crc!==r.crc)throw we.Errors.DESCRIPTOR_FAULTY();if(we.crc32(D)!==C.crc)return!1}else if(we.crc32(D)!==r.localHeader.crc)return!1;return!0}function p(D,C,k){if(typeof C>"u"&&typeof D=="string"&&(k=D,D=void 0),o)return D&&C&&C(Buffer.alloc(0),we.Errors.DIRECTORY_CONTENT_ERROR()),Buffer.alloc(0);var $=h();if($.length===0)return D&&C&&C($),$;if(r.encrypted){if(typeof k!="string"&&!Buffer.isBuffer(k))throw we.Errors.INVALID_PASS_PARAM();$=Ig.ZipCrypto.decrypt($,r,k)}var F=Buffer.alloc(r.size);switch(r.method){case we.Constants.STORED:if($.copy(F),d(F))return D&&C&&C(F),F;throw D&&C&&C(F,we.Errors.BAD_CRC()),we.Errors.BAD_CRC();case we.Constants.DEFLATED:var L=new Ig.Inflater($,r.size);if(D)L.inflateAsync(function(S){S.copy(S,0),C&&(d(S)?C(S):C(S,we.Errors.BAD_CRC()))});else{if(L.inflate(F).copy(F,0),!d(F))throw we.Errors.BAD_CRC(`"${f.decode(n)}"`);return F}break;default:throw D&&C&&C(Buffer.alloc(0),we.Errors.UNKNOWN_METHOD()),we.Errors.UNKNOWN_METHOD()}}function v(D,C){if((!s||!s.length)&&Buffer.isBuffer(e))return D&&C&&C(h()),h();if(s.length&&!o){var k;switch(r.method){case we.Constants.STORED:return r.compressedSize=r.size,k=Buffer.alloc(s.length),s.copy(k),D&&C&&C(k),k;default:case we.Constants.DEFLATED:var $=new Ig.Deflater(s);if(D)$.deflateAsync(function(L){k=Buffer.alloc(L.length),r.compressedSize=L.length,L.copy(k),C&&C(k)});else{var F=$.deflate();return r.compressedSize=F.length,F}$=null;break}}else if(D&&C)C(Buffer.alloc(0));else return Buffer.alloc(0)}function g(D,C){return(D.readUInt32LE(C+4)<<4)+D.readUInt32LE(C)}function w(D){try{for(var C=0,k,$,F;C+4<D.length;)k=D.readUInt16LE(C),C+=2,$=D.readUInt16LE(C),C+=2,F=D.slice(C,C+$),C+=$,Xe.ID_ZIP64===k&&x(F)}catch{throw we.Errors.EXTRA_FIELD_PARSE_ERROR()}}function x(D){var C,k,$,F;D.length>=Xe.EF_ZIP64_SCOMP&&(C=g(D,Xe.EF_ZIP64_SUNCOMP),r.size===Xe.EF_ZIP64_OR_32&&(r.size=C)),D.length>=Xe.EF_ZIP64_RHO&&(k=g(D,Xe.EF_ZIP64_SCOMP),r.compressedSize===Xe.EF_ZIP64_OR_32&&(r.compressedSize=k)),D.length>=Xe.EF_ZIP64_DSN&&($=g(D,Xe.EF_ZIP64_RHO),r.offset===Xe.EF_ZIP64_OR_32&&(r.offset=$)),D.length>=Xe.EF_ZIP64_DSN+4&&(F=D.readUInt32LE(Xe.EF_ZIP64_DSN),r.diskNumStart===Xe.EF_ZIP64_OR_16&&(r.diskNumStart=F))}return{get entryName(){return f.decode(n)},get rawEntryName(){return n},set entryName(D){n=we.toBuffer(D,f.encode);var C=n[n.length-1];o=C===47||C===92,r.fileNameLength=n.length},get efs(){return typeof c=="function"?c(this.entryName):c},get extra(){return a},set extra(D){a=D,r.extraLength=D.length,w(D)},get comment(){return f.decode(i)},set comment(D){if(i=we.toBuffer(D,f.encode),r.commentLength=i.length,i.length>65535)throw we.Errors.COMMENT_TOO_LONG()},get name(){var D=f.decode(n);return o?D.substr(D.length-1).split("/").pop():D.split("/").pop()},get isDirectory(){return o},getCompressedData:function(){return v(!1,null)},getCompressedDataAsync:function(D){v(!0,D)},setData:function(D){s=we.toBuffer(D,we.decoder.encode),!o&&s.length?(r.size=s.length,r.method=we.Constants.DEFLATED,r.crc=we.crc32(D),r.changed=!0):r.method=we.Constants.STORED},getData:function(D){return r.changed?s:p(!1,null,D)},getDataAsync:function(D,C){r.changed?D(s):p(!0,D,C)},set attr(D){r.attr=D},get attr(){return r.attr},set header(D){r.loadFromBinary(D)},get header(){return r},packCentralHeader:function(){r.flags_efs=this.efs,r.extraLength=a.length;var D=r.centralHeaderToBinary(),C=we.Constants.CENHDR;return n.copy(D,C),C+=n.length,a.copy(D,C),C+=r.extraLength,i.copy(D,C),D},packLocalHeader:function(){let D=0;r.flags_efs=this.efs,r.extraLocalLength=u.length;let C=r.localHeaderToBinary(),k=Buffer.alloc(C.length+n.length+r.extraLocalLength);return C.copy(k,D),D+=C.length,n.copy(k,D),D+=n.length,u.copy(k,D),D+=u.length,k},toJSON:function(){let D=function(C){return"<"+(C&&C.length+" bytes buffer"||"null")+">"};return{entryName:this.entryName,name:this.name,comment:this.comment,isDirectory:this.isDirectory,header:r.toJSON(),compressedData:D(e),data:D(s)}},toString:function(){return JSON.stringify(this.toJSON(),null," ")}}}});var RC=y((wfe,PC)=>{var TC=jg(),i9=$g(),bt=os();PC.exports=function(t,e){var r=[],n={},i=Buffer.alloc(0),o=new i9.MainHeader,s=!1,a=null;let u=new Set,c=e,{noSort:l,decoder:f}=c;t?p(c.readEntries):s=!0;function h(){let g=new Set;for(let w of Object.keys(n)){let x=w.split("/");if(x.pop(),!!x.length)for(let D=0;D<x.length;D++){let C=x.slice(0,D+1).join("/")+"/";g.add(C)}}for(let w of g)if(!(w in n)){let x=new TC(c);x.entryName=w,x.attr=16,x.temporary=!0,r.push(x),n[x.entryName]=x,u.add(x)}}function d(){if(s=!0,n={},o.diskEntries>(t.length-o.offset)/bt.Constants.CENHDR)throw bt.Errors.DISK_ENTRY_TOO_LARGE();r=new Array(o.diskEntries);for(var g=o.offset,w=0;w<r.length;w++){var x=g,D=new TC(c,t);D.header=t.slice(x,x+=bt.Constants.CENHDR),D.entryName=t.slice(x,x+=D.header.fileNameLength),D.header.extraLength&&(D.extra=t.slice(x,x+=D.header.extraLength)),D.header.commentLength&&(D.comment=t.slice(x,x+D.header.commentLength)),g+=D.header.centralHeaderSize,r[w]=D,n[D.entryName]=D}u.clear(),h()}function p(g){var w=t.length-bt.Constants.ENDHDR,x=Math.max(0,w-65535),D=x,C=t.length,k=-1,$=0;for((typeof c.trailingSpace=="boolean"?c.trailingSpace:!1)&&(x=0),w;w>=D;w--)if(t[w]===80){if(t.readUInt32LE(w)===bt.Constants.ENDSIG){k=w,$=w,C=w+bt.Constants.ENDHDR,D=w-bt.Constants.END64HDR;continue}if(t.readUInt32LE(w)===bt.Constants.END64SIG){D=x;continue}if(t.readUInt32LE(w)===bt.Constants.ZIP64SIG){k=w,C=w+bt.readBigUInt64LE(t,w+bt.Constants.ZIP64SIZE)+bt.Constants.ZIP64LEAD;break}}if(k==-1)throw bt.Errors.INVALID_FORMAT();o.loadFromBinary(t.slice(k,C)),o.commentLength&&(i=t.slice($+bt.Constants.ENDHDR)),g&&d()}function v(){r.length>1&&!l&&r.sort((g,w)=>g.entryName.toLowerCase().localeCompare(w.entryName.toLowerCase()))}return{get entries(){return s||d(),r.filter(g=>!u.has(g))},get comment(){return f.decode(i)},set comment(g){i=bt.toBuffer(g,f.encode),o.commentLength=i.length},getEntryCount:function(){return s?r.length:o.diskEntries},forEach:function(g){this.entries.forEach(g)},getEntry:function(g){return s||d(),n[g]||null},setEntry:function(g){s||d(),r.push(g),n[g.entryName]=g,o.totalEntries=r.length},deleteFile:function(g,w=!0){s||d();let x=n[g];this.getEntryChildren(x,w).map(C=>C.entryName).forEach(this.deleteEntry)},deleteEntry:function(g){s||d();let w=n[g],x=r.indexOf(w);x>=0&&(r.splice(x,1),delete n[g],o.totalEntries=r.length)},getEntryChildren:function(g,w=!0){if(s||d(),typeof g=="object")if(g.isDirectory&&w){let x=[],D=g.entryName;for(let C of r)C.entryName.startsWith(D)&&x.push(C);return x}else return[g];return[]},getChildCount:function(g){if(g&&g.isDirectory){let w=this.getEntryChildren(g);return w.includes(g)?w.length-1:w.length}return 0},compressToBuffer:function(){s||d(),v();let g=[],w=[],x=0,D=0;o.size=0,o.offset=0;let C=0;for(let F of this.entries){let L=F.getCompressedData();F.header.offset=D;let S=F.packLocalHeader(),I=S.length+L.length;D+=I,g.push(S),g.push(L);let R=F.packCentralHeader();w.push(R),o.size+=R.length,x+=I+R.length,C++}x+=o.mainHeaderSize,o.offset=D,o.totalEntries=C,D=0;let k=Buffer.alloc(x);for(let F of g)F.copy(k,D),D+=F.length;for(let F of w)F.copy(k,D),D+=F.length;let $=o.toBinary();return i&&i.copy($,bt.Constants.ENDHDR),$.copy(k,D),t=k,s=!1,k},toAsyncBuffer:function(g,w,x,D){try{s||d(),v();let C=[],k=[],$=0,F=0,L=0;o.size=0,o.offset=0;let S=function(I){if(I.length>0){let R=I.shift(),B=R.entryName+R.extra.toString();x&&x(B),R.getCompressedDataAsync(function(q){D&&D(B),R.header.offset=F;let K=R.packLocalHeader(),M=K.length+q.length;F+=M,C.push(K),C.push(q);let E=R.packCentralHeader();k.push(E),o.size+=E.length,$+=M+E.length,L++,S(I)})}else{$+=o.mainHeaderSize,o.offset=F,o.totalEntries=L,F=0;let R=Buffer.alloc($);C.forEach(function(q){q.copy(R,F),F+=q.length}),k.forEach(function(q){q.copy(R,F),F+=q.length});let B=o.toBinary();i&&i.copy(B,bt.Constants.ENDHDR),B.copy(R,F),t=R,s=!1,g(R)}};S(Array.from(this.entries))}catch(C){w(C)}}}}});var jC=y((_fe,IC)=>{var Ue=os(),Ze=require("path"),o9=jg(),s9=RC(),Ii=(...t)=>Ue.findLast(t,e=>typeof e=="boolean"),$C=(...t)=>Ue.findLast(t,e=>typeof e=="string"),a9=(...t)=>Ue.findLast(t,e=>typeof e=="function"),u9={noSort:!1,readEntries:!1,method:Ue.Constants.NONE,fs:null};IC.exports=function(t,e){let r=null,n=Object.assign(Object.create(null),u9);t&&typeof t=="object"&&(t instanceof Uint8Array||(Object.assign(n,t),t=n.input?n.input:void 0,n.input&&delete n.input),Buffer.isBuffer(t)&&(r=t,n.method=Ue.Constants.BUFFER,t=void 0)),Object.assign(n,e);let i=new Ue(n);if((typeof n.decoder!="object"||typeof n.decoder.encode!="function"||typeof n.decoder.decode!="function")&&(n.decoder=Ue.decoder),t&&typeof t=="string")if(i.fs.existsSync(t))n.method=Ue.Constants.FILE,n.filename=t,r=i.fs.readFileSync(t);else throw Ue.Errors.INVALID_FILENAME();let o=new s9(r,n),{canonical:s,sanitize:a,zipnamefix:u}=Ue;function c(d){if(d&&o){var p;if(typeof d=="string"&&(p=o.getEntry(Ze.posix.normalize(d))),typeof d=="object"&&typeof d.entryName<"u"&&typeof d.header<"u"&&(p=o.getEntry(d.entryName)),p)return p}return null}function l(d){let{join:p,normalize:v,sep:g}=Ze.posix;return p(".",v(g+d.split("\\").join(g)+g))}function f(d){return d instanceof RegExp?function(p){return function(v){return p.test(v)}}(d):typeof d!="function"?()=>!0:d}let h=(d,p)=>{let v=p.slice(-1);return v=v===i.sep?i.sep:"",Ze.relative(d,p)+v};return{readFile:function(d,p){var v=c(d);return v&&v.getData(p)||null},childCount:function(d){let p=c(d);if(p)return o.getChildCount(p)},readFileAsync:function(d,p){var v=c(d);v?v.getDataAsync(p):p(null,"getEntry failed for:"+d)},readAsText:function(d,p){var v=c(d);if(v){var g=v.getData();if(g&&g.length)return g.toString(p||"utf8")}return""},readAsTextAsync:function(d,p,v){var g=c(d);g?g.getDataAsync(function(w,x){if(x){p(w,x);return}w&&w.length?p(w.toString(v||"utf8")):p("")}):p("")},deleteFile:function(d,p=!0){var v=c(d);v&&o.deleteFile(v.entryName,p)},deleteEntry:function(d){var p=c(d);p&&o.deleteEntry(p.entryName)},addZipComment:function(d){o.comment=d},getZipComment:function(){return o.comment||""},addZipEntryComment:function(d,p){var v=c(d);v&&(v.comment=p)},getZipEntryComment:function(d){var p=c(d);return p&&p.comment||""},updateFile:function(d,p){var v=c(d);v&&v.setData(p)},addLocalFile:function(d,p,v,g){if(i.fs.existsSync(d)){p=p?l(p):"";let w=Ze.win32.basename(Ze.win32.normalize(d));p+=v||w;let x=i.fs.statSync(d),D=x.isFile()?i.fs.readFileSync(d):Buffer.alloc(0);x.isDirectory()&&(p+=i.sep),this.addFile(p,D,g,x)}else throw Ue.Errors.FILE_NOT_FOUND(d)},addLocalFileAsync:function(d,p){d=typeof d=="object"?d:{localPath:d};let v=Ze.resolve(d.localPath),{comment:g}=d,{zipPath:w,zipName:x}=d,D=this;i.fs.stat(v,function(C,k){if(C)return p(C,!1);w=w?l(w):"";let $=Ze.win32.basename(Ze.win32.normalize(v));if(w+=x||$,k.isFile())i.fs.readFile(v,function(F,L){return F?p(F,!1):(D.addFile(w,L,g,k),setImmediate(p,void 0,!0))});else if(k.isDirectory())return w+=i.sep,D.addFile(w,Buffer.alloc(0),g,k),setImmediate(p,void 0,!0)})},addLocalFolder:function(d,p,v){if(v=f(v),p=p?l(p):"",d=Ze.normalize(d),i.fs.existsSync(d)){let g=i.findFiles(d),w=this;if(g.length)for(let x of g){let D=Ze.join(p,h(d,x));v(D)&&w.addLocalFile(x,Ze.dirname(D))}}else throw Ue.Errors.FILE_NOT_FOUND(d)},addLocalFolderAsync:function(d,p,v,g){g=f(g),v=v?l(v):"",d=Ze.normalize(d);var w=this;i.fs.open(d,"r",function(x){if(x&&x.code==="ENOENT")p(void 0,Ue.Errors.FILE_NOT_FOUND(d));else if(x)p(void 0,x);else{var D=i.findFiles(d),C=-1,k=function(){if(C+=1,C<D.length){var $=D[C],F=h(d,$).split("\\").join("/");F=F.normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/[^\x20-\x7E]/g,""),g(F)?i.fs.stat($,function(L,S){L&&p(void 0,L),S.isFile()?i.fs.readFile($,function(I,R){I?p(void 0,I):(w.addFile(v+F,R,"",S),k())}):(w.addFile(v+F+"/",Buffer.alloc(0),"",S),k())}):process.nextTick(()=>{k()})}else p(!0,void 0)};k()}})},addLocalFolderAsync2:function(d,p){let v=this;d=typeof d=="object"?d:{localPath:d},localPath=Ze.resolve(l(d.localPath));let{zipPath:g,filter:w,namefix:x}=d;w instanceof RegExp?w=function(k){return function($){return k.test($)}}(w):typeof w!="function"&&(w=function(){return!0}),g=g?l(g):"",x=="latin1"&&(x=k=>k.normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/[^\x20-\x7E]/g,"")),typeof x!="function"&&(x=k=>k);let D=k=>Ze.join(g,x(h(localPath,k))),C=k=>Ze.win32.basename(Ze.win32.normalize(x(k)));i.fs.open(localPath,"r",function(k){k&&k.code==="ENOENT"?p(void 0,Ue.Errors.FILE_NOT_FOUND(localPath)):k?p(void 0,k):i.findFilesAsync(localPath,function($,F){if($)return p($);F=F.filter(L=>w(D(L))),F.length||p(void 0,!1),setImmediate(F.reverse().reduce(function(L,S){return function(I,R){if(I||R===!1)return setImmediate(L,I,!1);v.addLocalFileAsync({localPath:S,zipPath:Ze.dirname(D(S)),zipName:C(S)},L)}},p))})})},addLocalFolderPromise:function(d,p){return new Promise((v,g)=>{this.addLocalFolderAsync2(Object.assign({localPath:d},p),(w,x)=>{w&&g(w),x&&v(this)})})},addFile:function(d,p,v,g){d=u(d);let w=c(d),x=w!=null;x||(w=new o9(n),w.entryName=d),w.comment=v||"";let D=typeof g=="object"&&g instanceof i.fs.Stats;D&&(w.header.time=g.mtime);var C=w.isDirectory?16:0;let k=w.isDirectory?16384:32768;return D?k|=4095&g.mode:typeof g=="number"?k|=4095&g:k|=w.isDirectory?493:420,C=(C|k<<16)>>>0,w.attr=C,w.setData(p),x||o.setEntry(w),w},getEntries:function(d){return o.password=d,o?o.entries:[]},getEntry:function(d){return c(d)},getEntryCount:function(){return o.getEntryCount()},forEach:function(d){return o.forEach(d)},extractEntryTo:function(d,p,v,g,w,x){g=Ii(!1,g),w=Ii(!1,w),v=Ii(!0,v),x=$C(w,x);var D=c(d);if(!D)throw Ue.Errors.NO_ENTRY();var C=s(D.entryName),k=a(p,x&&!D.isDirectory?x:v?C:Ze.basename(C));if(D.isDirectory){var $=o.getEntryChildren(D);return $.forEach(function(S){if(S.isDirectory)return;var I=S.getData();if(!I)throw Ue.Errors.CANT_EXTRACT_FILE();var R=s(S.entryName),B=a(p,v?R:Ze.basename(R));let q=w?S.header.fileAttr:void 0;i.writeFileTo(B,I,g,q)}),!0}var F=D.getData(o.password);if(!F)throw Ue.Errors.CANT_EXTRACT_FILE();if(i.fs.existsSync(k)&&!g)throw Ue.Errors.CANT_OVERRIDE();let L=w?d.header.fileAttr:void 0;return i.writeFileTo(k,F,g,L),!0},test:function(d){if(!o)return!1;for(var p in o.entries)try{if(p.isDirectory)continue;var v=o.entries[p].getData(d);if(!v)return!1}catch{return!1}return!0},extractAllTo:function(d,p,v,g){if(v=Ii(!1,v),g=$C(v,g),p=Ii(!1,p),!o)throw Ue.Errors.NO_ZIP();o.entries.forEach(function(w){var x=a(d,s(w.entryName));if(w.isDirectory){i.makeDir(x);return}var D=w.getData(g);if(!D)throw Ue.Errors.CANT_EXTRACT_FILE();let C=v?w.header.fileAttr:void 0;i.writeFileTo(x,D,p,C);try{i.fs.utimesSync(x,w.header.time,w.header.time)}catch{throw Ue.Errors.CANT_EXTRACT_FILE()}})},extractAllToAsync:function(d,p,v,g){if(g=a9(p,v,g),v=Ii(!1,v),p=Ii(!1,p),!g)return new Promise((k,$)=>{this.extractAllToAsync(d,p,v,function(F){F?$(F):k(this)})});if(!o){g(Ue.Errors.NO_ZIP());return}d=Ze.resolve(d);let w=k=>a(d,Ze.normalize(s(k.entryName))),x=(k,$)=>new Error(k+': "'+$+'"'),D=[],C=[];o.entries.forEach(k=>{k.isDirectory?D.push(k):C.push(k)});for(let k of D){let $=w(k),F=v?k.header.fileAttr:void 0;try{i.makeDir($),F&&i.fs.chmodSync($,F),i.fs.utimesSync($,k.header.time,k.header.time)}catch{g(x("Unable to create folder",$))}}C.reverse().reduce(function(k,$){return function(F){if(F)k(F);else{let L=Ze.normalize(s($.entryName)),S=a(d,L);$.getDataAsync(function(I,R){if(R)k(R);else if(!I)k(Ue.Errors.CANT_EXTRACT_FILE());else{let B=v?$.header.fileAttr:void 0;i.writeFileToAsync(S,I,p,B,function(q){q||k(x("Unable to write file",S)),i.fs.utimes(S,$.header.time,$.header.time,function(K){K?k(x("Unable to set times",S)):k()})})}})}}},g)()},writeZip:function(d,p){if(arguments.length===1&&typeof d=="function"&&(p=d,d=""),!d&&n.filename&&(d=n.filename),!!d){var v=o.compressToBuffer();if(v){var g=i.writeFileTo(d,v,!0);typeof p=="function"&&p(g?null:new Error("failed"),"")}}},writeZipPromise:function(d,p){let{overwrite:v,perm:g}=Object.assign({overwrite:!0},p);return new Promise((w,x)=>{!d&&n.filename&&(d=n.filename),d||x("ADM-ZIP: ZIP File Name Missing"),this.toBufferPromise().then(D=>{let C=k=>k?w(k):x("ADM-ZIP: Wasn't able to write zip file");i.writeFileToAsync(d,D,v,g,C)},x)})},toBufferPromise:function(){return new Promise((d,p)=>{o.toAsyncBuffer(d,p)})},toBuffer:function(d,p,v,g){return typeof d=="function"?(o.toAsyncBuffer(d,p,v,g),null):o.compressToBuffer()}}}});var XC=y((Jfe,JC)=>{var YC={};JC.exports=YC;var KC={reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29],black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],gray:[90,39],grey:[90,39],brightRed:[91,39],brightGreen:[92,39],brightYellow:[93,39],brightBlue:[94,39],brightMagenta:[95,39],brightCyan:[96,39],brightWhite:[97,39],bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgGray:[100,49],bgGrey:[100,49],bgBrightRed:[101,49],bgBrightGreen:[102,49],bgBrightYellow:[103,49],bgBrightBlue:[104,49],bgBrightMagenta:[105,49],bgBrightCyan:[106,49],bgBrightWhite:[107,49],blackBG:[40,49],redBG:[41,49],greenBG:[42,49],yellowBG:[43,49],blueBG:[44,49],magentaBG:[45,49],cyanBG:[46,49],whiteBG:[47,49]};Object.keys(KC).forEach(function(t){var e=KC[t],r=YC[t]=[];r.open="\x1B["+e[0]+"m",r.close="\x1B["+e[1]+"m"})});var QC=y((Xfe,ZC)=>{"use strict";ZC.exports=function(t,e){e=e||process.argv;var r=e.indexOf("--"),n=/^-{1,2}/.test(t)?"":"--",i=e.indexOf(n+t);return i!==-1&&(r===-1?!0:i<r)}});var tS=y((Zfe,eS)=>{"use strict";var p9=require("os"),Ar=QC(),Tt=process.env,cs=void 0;Ar("no-color")||Ar("no-colors")||Ar("color=false")?cs=!1:(Ar("color")||Ar("colors")||Ar("color=true")||Ar("color=always"))&&(cs=!0);"FORCE_COLOR"in Tt&&(cs=Tt.FORCE_COLOR.length===0||parseInt(Tt.FORCE_COLOR,10)!==0);function m9(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}function g9(t){if(cs===!1)return 0;if(Ar("color=16m")||Ar("color=full")||Ar("color=truecolor"))return 3;if(Ar("color=256"))return 2;if(t&&!t.isTTY&&cs!==!0)return 0;var e=cs?1:0;if(process.platform==="win32"){var r=p9.release().split(".");return Number(process.versions.node.split(".")[0])>=8&&Number(r[0])>=10&&Number(r[2])>=10586?Number(r[2])>=14931?3:2:1}if("CI"in Tt)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some(function(i){return i in Tt})||Tt.CI_NAME==="codeship"?1:e;if("TEAMCITY_VERSION"in Tt)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Tt.TEAMCITY_VERSION)?1:0;if("TERM_PROGRAM"in Tt){var n=parseInt((Tt.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(Tt.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Hyper":return 3;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(Tt.TERM)?2:/^screen|^xterm|^vt100|^rxvt|color|ansi|cygwin|linux/i.test(Tt.TERM)||"COLORTERM"in Tt?1:(Tt.TERM==="dumb",e)}function Vg(t){var e=g9(t);return m9(e)}eS.exports={supportsColor:Vg,stdout:Vg(process.stdout),stderr:Vg(process.stderr)}});var nS=y((Qfe,rS)=>{rS.exports=function(e,r){var n="";e=e||"Run the trap, drop the bass",e=e.split("");var i={a:["@","\u0104","\u023A","\u0245","\u0394","\u039B","\u0414"],b:["\xDF","\u0181","\u0243","\u026E","\u03B2","\u0E3F"],c:["\xA9","\u023B","\u03FE"],d:["\xD0","\u018A","\u0500","\u0501","\u0502","\u0503"],e:["\xCB","\u0115","\u018E","\u0258","\u03A3","\u03BE","\u04BC","\u0A6C"],f:["\u04FA"],g:["\u0262"],h:["\u0126","\u0195","\u04A2","\u04BA","\u04C7","\u050A"],i:["\u0F0F"],j:["\u0134"],k:["\u0138","\u04A0","\u04C3","\u051E"],l:["\u0139"],m:["\u028D","\u04CD","\u04CE","\u0520","\u0521","\u0D69"],n:["\xD1","\u014B","\u019D","\u0376","\u03A0","\u048A"],o:["\xD8","\xF5","\xF8","\u01FE","\u0298","\u047A","\u05DD","\u06DD","\u0E4F"],p:["\u01F7","\u048E"],q:["\u09CD"],r:["\xAE","\u01A6","\u0210","\u024C","\u0280","\u042F"],s:["\xA7","\u03DE","\u03DF","\u03E8"],t:["\u0141","\u0166","\u0373"],u:["\u01B1","\u054D"],v:["\u05D8"],w:["\u0428","\u0460","\u047C","\u0D70"],x:["\u04B2","\u04FE","\u04FC","\u04FD"],y:["\xA5","\u04B0","\u04CB"],z:["\u01B5","\u0240"]};return e.forEach(function(o){o=o.toLowerCase();var s=i[o]||[" "],a=Math.floor(Math.random()*s.length);typeof i[o]<"u"?n+=i[o][a]:n+=o}),n}});var oS=y((ede,iS)=>{iS.exports=function(e,r){e=e||" he is here ";var n={up:["\u030D","\u030E","\u0304","\u0305","\u033F","\u0311","\u0306","\u0310","\u0352","\u0357","\u0351","\u0307","\u0308","\u030A","\u0342","\u0313","\u0308","\u034A","\u034B","\u034C","\u0303","\u0302","\u030C","\u0350","\u0300","\u0301","\u030B","\u030F","\u0312","\u0313","\u0314","\u033D","\u0309","\u0363","\u0364","\u0365","\u0366","\u0367","\u0368","\u0369","\u036A","\u036B","\u036C","\u036D","\u036E","\u036F","\u033E","\u035B","\u0346","\u031A"],down:["\u0316","\u0317","\u0318","\u0319","\u031C","\u031D","\u031E","\u031F","\u0320","\u0324","\u0325","\u0326","\u0329","\u032A","\u032B","\u032C","\u032D","\u032E","\u032F","\u0330","\u0331","\u0332","\u0333","\u0339","\u033A","\u033B","\u033C","\u0345","\u0347","\u0348","\u0349","\u034D","\u034E","\u0353","\u0354","\u0355","\u0356","\u0359","\u035A","\u0323"],mid:["\u0315","\u031B","\u0300","\u0301","\u0358","\u0321","\u0322","\u0327","\u0328","\u0334","\u0335","\u0336","\u035C","\u035D","\u035E","\u035F","\u0360","\u0362","\u0338","\u0337","\u0361"," \u0489"]},i=[].concat(n.up,n.down,n.mid);function o(u){var c=Math.floor(Math.random()*u);return c}function s(u){var c=!1;return i.filter(function(l){c=l===u}),c}function a(u,c){var l="",f,h;c=c||{},c.up=typeof c.up<"u"?c.up:!0,c.mid=typeof c.mid<"u"?c.mid:!0,c.down=typeof c.down<"u"?c.down:!0,c.size=typeof c.size<"u"?c.size:"maxi",u=u.split("");for(h in u)if(!s(h)){switch(l=l+u[h],f={up:0,down:0,mid:0},c.size){case"mini":f.up=o(8),f.mid=o(2),f.down=o(8);break;case"maxi":f.up=o(16)+3,f.mid=o(4)+1,f.down=o(64)+3;break;default:f.up=o(8)+1,f.mid=o(6)/2,f.down=o(8)+1;break}var d=["up","mid","down"];for(var p in d)for(var v=d[p],g=0;g<=f[v];g++)c[v]&&(l=l+n[v][o(n[v].length)])}return l}return a(e,r)}});var aS=y((tde,sS)=>{sS.exports=function(t){return function(e,r,n){if(e===" ")return e;switch(r%3){case 0:return t.red(e);case 1:return t.white(e);case 2:return t.blue(e)}}}});var cS=y((rde,uS)=>{uS.exports=function(t){return function(e,r,n){return r%2===0?e:t.inverse(e)}}});var fS=y((nde,lS)=>{lS.exports=function(t){var e=["red","yellow","green","blue","magenta"];return function(r,n,i){return r===" "?r:t[e[n++%e.length]](r)}}});var hS=y((ide,dS)=>{dS.exports=function(t){var e=["underline","inverse","grey","yellow","red","green","blue","white","cyan","magenta","brightYellow","brightRed","brightGreen","brightBlue","brightWhite","brightCyan","brightMagenta"];return function(r,n,i){return r===" "?r:t[e[Math.round(Math.random()*(e.length-2))]](r)}}});var vS=y((sde,DS)=>{var le={};DS.exports=le;le.themes={};var y9=require("util"),ji=le.styles=XC(),mS=Object.defineProperties,D9=new RegExp(/[\r\n]+/g);le.supportsColor=tS().supportsColor;typeof le.enabled>"u"&&(le.enabled=le.supportsColor()!==!1);le.enable=function(){le.enabled=!0};le.disable=function(){le.enabled=!1};le.stripColors=le.strip=function(t){return(""+t).replace(/\x1B\[\d+m/g,"")};var ode=le.stylize=function(e,r){if(!le.enabled)return e+"";var n=ji[r];return!n&&r in le?le[r](e):n.open+e+n.close},v9=/[|\\{}()[\]^$+*?.]/g,b9=function(t){if(typeof t!="string")throw new TypeError("Expected a string");return t.replace(v9,"\\$&")};function gS(t){var e=function r(){return _9.apply(r,arguments)};return e._styles=t,e.__proto__=w9,e}var yS=function(){var t={};return ji.grey=ji.gray,Object.keys(ji).forEach(function(e){ji[e].closeRe=new RegExp(b9(ji[e].close),"g"),t[e]={get:function(){return gS(this._styles.concat(e))}}}),t}(),w9=mS(function(){},yS);function _9(){var t=Array.prototype.slice.call(arguments),e=t.map(function(s){return s!=null&&s.constructor===String?s:y9.inspect(s)}).join(" ");if(!le.enabled||!e)return e;for(var r=e.indexOf(`
24
+ `)!=-1,n=this._styles,i=n.length;i--;){var o=ji[n[i]];e=o.open+e.replace(o.closeRe,o.open)+o.close,r&&(e=e.replace(D9,function(s){return o.close+s+o.open}))}return e}le.setTheme=function(t){if(typeof t=="string"){console.log("colors.setTheme now only accepts an object, not a string. If you are trying to set a theme from a file, it is now your (the caller's) responsibility to require the file. The old syntax looked like colors.setTheme(__dirname + '/../themes/generic-logging.js'); The new syntax looks like colors.setTheme(require(__dirname + '/../themes/generic-logging.js'));");return}for(var e in t)(function(r){le[r]=function(n){if(typeof t[r]=="object"){var i=n;for(var o in t[r])i=le[t[r][o]](i);return i}return le[t[r]](n)}})(e)};function E9(){var t={};return Object.keys(yS).forEach(function(e){t[e]={get:function(){return gS([e])}}}),t}var C9=function(e,r){var n=r.split("");return n=n.map(e),n.join("")};le.trap=nS();le.zalgo=oS();le.maps={};le.maps.america=aS()(le);le.maps.zebra=cS()(le);le.maps.rainbow=fS()(le);le.maps.random=hS()(le);for(pS in le.maps)(function(t){le[t]=function(e){return C9(le.maps[t],e)}})(pS);var pS;mS(le,E9())});var wS=y((ade,bS)=>{var S9=vS();bS.exports=S9});var _S=y(Hg=>{"use strict";Hg.indent=function(e){return new Array(e+1).join(" ")};Hg.getMaxIndexLength=function(t){var e=0;return Object.getOwnPropertyNames(t).forEach(function(r){t[r]!==void 0&&(e=Math.max(e,r.length))}),e}});var ES=y((cde,x9)=>{x9.exports={author:"Rafael de Oleza <rafeca@gmail.com> (https://github.com/rafeca)",name:"prettyjson",description:"Package for formatting JSON data in a coloured YAML-style, perfect for CLI output",version:"1.2.5",homepage:"http://rafeca.com/prettyjson",keywords:["json","cli","formatting","colors"],repository:{type:"git",url:"https://github.com/rafeca/prettyjson.git"},bugs:{url:"https://github.com/rafeca/prettyjson/issues"},main:"./lib/prettyjson",files:["bin/prettyjson","lib/*.js"],license:"MIT",scripts:{test:"npm run jshint && mocha --reporter spec",testwin:"node ./node_modules/mocha/bin/mocha --reporter spec",jshint:"jshint lib/*.js test/*.js",coverage:"istanbul cover _mocha --report lcovonly -- -R spec",coveralls:"npm run coverage && cat ./coverage/lcov.info | coveralls && rm -rf ./coverage",changelog:"git log $(git describe --tags --abbrev=0)..HEAD --pretty='* %s' --first-parent"},bin:{prettyjson:"./bin/prettyjson"},dependencies:{colors:"1.4.0",minimist:"^1.2.0"},devDependencies:{coveralls:"^2.11.15",istanbul:"^0.4.5",jshint:"^2.9.4",mocha:"^3.1.2","mocha-lcov-reporter":"^1.2.0",should:"^11.1.1"}}});var CS=y(Cu=>{"use strict";var zr=wS(),ri=_S(),F9=/[^\w\s\n\r\v\t\.,]/i;Cu.version=ES().version;var zg=function(t,e){return t!==void 0||e.renderUndefined},nf=function(t,e,r){return!!(typeof t=="boolean"||typeof t=="number"||typeof t=="function"||t===null||t===void 0||t instanceof Date||typeof t=="string"&&t.indexOf(`
25
+ `)===-1||r.inlineArrays&&!e&&Array.isArray(t)&&nf(t[0],!0,r))},O9=function(t,e){if(e.noColor)return t;if(typeof t=="string")return e.stringColor?zr[e.stringColor](t):t;var r=t+"";return t===!0?zr.green(r):t===!1?zr.red(r):t==null?zr.grey(r):typeof t=="number"?t>=0?zr[e.positiveNumberColor](r):zr[e.negativeNumberColor](r):typeof t=="function"?"function() {}":Array.isArray(t)?t.join(", "):r},Gg=function(t,e){return t.multilineStringColor===null||t.noColor?e:zr[t.multilineStringColor](e)},A9=function(t,e,r){var n=t.split(`
26
26
  `);return n=n.map(function(i){return ri.indent(e)+Gg(r,i)}),n.join(`
27
- `)},ls=function(t,e,r){if(typeof t=="string"&&t.match(F9)&&e.escape&&(t=JSON.stringify(t)),!zg(t,e))return[];if(sf(t,!1,e))return[ri.indent(r)+O9(t,e)];if(typeof t=="string")return[ri.indent(r)+Gg(e,'"""'),A9(t,r+e.defaultIndentation,e),ri.indent(r)+Gg(e,'"""')];if(Array.isArray(t)){if(t.length===0)return[ri.indent(r)+e.emptyArrayMsg];var n=[];return t.forEach(function(a){if(zg(a,e)){var u="- ";e.noColor||(u=zr[e.dashColor](u)),u=ri.indent(r)+u,sf(a,!1,e)?(u+=ls(a,e,0)[0],n.push(u)):(n.push(u),n.push.apply(n,ls(a,e,r+e.defaultIndentation)))}}),n}if(t instanceof Error)return ls({message:t.message,stack:t.stack.split(`
28
- `)},e,r);var i=e.noAlign?0:ri.getMaxIndexLength(t),o,s=[];return Object.getOwnPropertyNames(t).forEach(function(a){if(zg(t[a],e))if(o=a+": ",e.noColor||(o=zr[e.keysColor](o)),o=ri.indent(r)+o,sf(t[a],!1,e)){var u=e.noAlign?0:i-a.length;o+=ls(t[a],e,u)[0],s.push(o)}else s.push(o),s.push.apply(s,ls(t[a],e,r+e.defaultIndentation))}),s};Cu.render=function(e,r,n){return n=n||0,r=r||{},r.emptyArrayMsg=r.emptyArrayMsg||"(empty array)",r.keysColor=r.keysColor||"green",r.dashColor=r.dashColor||"green",r.numberColor=r.numberColor||"blue",r.positiveNumberColor=r.positiveNumberColor||r.numberColor,r.negativeNumberColor=r.negativeNumberColor||r.numberColor,r.defaultIndentation=r.defaultIndentation||2,r.noColor=!!r.noColor,r.noAlign=!!r.noAlign,r.escape=!!r.escape,r.renderUndefined=!!r.renderUndefined,r.stringColor=r.stringColor||null,r.multilineStringColor=r.multilineStringColor||null,ls(e,r,n).join(`
27
+ `)},ls=function(t,e,r){if(typeof t=="string"&&t.match(F9)&&e.escape&&(t=JSON.stringify(t)),!zg(t,e))return[];if(nf(t,!1,e))return[ri.indent(r)+O9(t,e)];if(typeof t=="string")return[ri.indent(r)+Gg(e,'"""'),A9(t,r+e.defaultIndentation,e),ri.indent(r)+Gg(e,'"""')];if(Array.isArray(t)){if(t.length===0)return[ri.indent(r)+e.emptyArrayMsg];var n=[];return t.forEach(function(a){if(zg(a,e)){var u="- ";e.noColor||(u=zr[e.dashColor](u)),u=ri.indent(r)+u,nf(a,!1,e)?(u+=ls(a,e,0)[0],n.push(u)):(n.push(u),n.push.apply(n,ls(a,e,r+e.defaultIndentation)))}}),n}if(t instanceof Error)return ls({message:t.message,stack:t.stack.split(`
28
+ `)},e,r);var i=e.noAlign?0:ri.getMaxIndexLength(t),o,s=[];return Object.getOwnPropertyNames(t).forEach(function(a){if(zg(t[a],e))if(o=a+": ",e.noColor||(o=zr[e.keysColor](o)),o=ri.indent(r)+o,nf(t[a],!1,e)){var u=e.noAlign?0:i-a.length;o+=ls(t[a],e,u)[0],s.push(o)}else s.push(o),s.push.apply(s,ls(t[a],e,r+e.defaultIndentation))}),s};Cu.render=function(e,r,n){return n=n||0,r=r||{},r.emptyArrayMsg=r.emptyArrayMsg||"(empty array)",r.keysColor=r.keysColor||"green",r.dashColor=r.dashColor||"green",r.numberColor=r.numberColor||"blue",r.positiveNumberColor=r.positiveNumberColor||r.numberColor,r.negativeNumberColor=r.negativeNumberColor||r.numberColor,r.defaultIndentation=r.defaultIndentation||2,r.noColor=!!r.noColor,r.noAlign=!!r.noAlign,r.escape=!!r.escape,r.renderUndefined=!!r.renderUndefined,r.stringColor=r.stringColor||null,r.multilineStringColor=r.multilineStringColor||null,ls(e,r,n).join(`
29
29
  `)};Cu.renderString=function(e,r,n){var i="",o;if(typeof e!="string"||e==="")return"";if(e[0]!=="{"&&e[0]!=="["){var s;e.indexOf("{")===-1?s=e.indexOf("["):e.indexOf("[")===-1||e.indexOf("{")<e.indexOf("[")?s=e.indexOf("{"):s=e.indexOf("["),i+=e.substr(0,s)+`
30
- `,e=e.substr(s)}try{o=JSON.parse(e)}catch{return zr.red("Error:")+" Not valid JSON!"}return i+=Cu.render(o,r,n),i}});var Yg=y(af=>{"use strict";Object.defineProperty(af,"__esModule",{value:!0});af.default=void 0;function fs(t){"@babel/helpers - typeof";return fs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},fs(t)}function SS(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,T9(n.key),n)}}function k9(t,e,r){return e&&SS(t.prototype,e),r&&SS(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function T9(t){var e=P9(t,"string");return fs(e)=="symbol"?e:e+""}function P9(t,e){if(fs(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(fs(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function R9(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function $9(t,e,r){return e=xu(e),I9(t,Kg()?Reflect.construct(e,r||[],xu(t).constructor):e.apply(t,r))}function I9(t,e){if(e&&(fs(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return j9(t)}function j9(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function N9(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Su(t,e)}function Wg(t){var e=typeof Map=="function"?new Map:void 0;return Wg=function(n){if(n===null||!B9(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(typeof e<"u"){if(e.has(n))return e.get(n);e.set(n,i)}function i(){return L9(n,arguments,xu(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),Su(i,n)},Wg(t)}function L9(t,e,r){if(Kg())return Reflect.construct.apply(null,arguments);var n=[null];n.push.apply(n,e);var i=new(t.bind.apply(t,n));return r&&Su(i,r.prototype),i}function Kg(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Kg=function(){return!!t})()}function B9(t){try{return Function.toString.call(t).indexOf("[native code]")!==-1}catch{return typeof t=="function"}}function Su(t,e){return Su=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Su(t,e)}function xu(t){return xu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},xu(t)}var q9=function(t){function e(r){var n,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;if(R9(this,e),n=$9(this,e,[r]),n.originalRequest=o,n.originalResponse=s,n.causingError=i,i!=null&&(r+=", caused by ".concat(i.toString())),o!=null){var a=o.getHeader("X-Request-ID")||"n/a",u=o.getMethod(),c=o.getURL(),l=s?s.getStatus():"n/a",f=s?s.getBody()||"":"n/a";r+=", originated from request (method: ".concat(u,", url: ").concat(c,", response code: ").concat(l,", response text: ").concat(f,", request id: ").concat(a,")")}return n.message=r,n}return N9(e,t),k9(e)}(Wg(Error)),fde=af.default=q9});var Jg=y(uf=>{"use strict";Object.defineProperty(uf,"__esModule",{value:!0});uf.enableDebugLog=M9;uf.log=U9;var xS=!1;function M9(){xS=!0}function U9(t){xS&&console.log(t)}});var OS=y(cf=>{"use strict";Object.defineProperty(cf,"__esModule",{value:!0});cf.default=void 0;function Fu(t){"@babel/helpers - typeof";return Fu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Fu(t)}function V9(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function FS(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,z9(n.key),n)}}function H9(t,e,r){return e&&FS(t.prototype,e),r&&FS(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function z9(t){var e=G9(t,"string");return Fu(e)=="symbol"?e:e+""}function G9(t,e){if(Fu(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Fu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var pde=cf.default=function(){function t(){V9(this,t)}return H9(t,[{key:"listAllUploads",value:function(){return Promise.resolve([])}},{key:"findUploadsByFingerprint",value:function(r){return Promise.resolve([])}},{key:"removeUpload",value:function(r){return Promise.resolve()}},{key:"addUpload",value:function(r,n){return Promise.resolve(null)}}])}()});var AS=y((Xg,Zg)=>{(function(t,e){typeof Xg=="object"&&typeof Zg<"u"?Zg.exports=e():typeof define=="function"&&define.amd?define(e):function(){var r=t.Base64,n=e();n.noConflict=function(){return t.Base64=r,n},t.Meteor&&(Base64=n),t.Base64=n}()})(typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:Xg,function(){"use strict";var t="3.7.7",e=t,r=typeof Buffer=="function",n=typeof TextDecoder=="function"?new TextDecoder:void 0,i=typeof TextEncoder=="function"?new TextEncoder:void 0,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",s=Array.prototype.slice.call(o),a=function(T){var N={};return T.forEach(function(oe,se){return N[oe]=se}),N}(s),u=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,c=String.fromCharCode.bind(String),l=typeof Uint8Array.from=="function"?Uint8Array.from.bind(Uint8Array):function(T){return new Uint8Array(Array.prototype.slice.call(T,0))},f=function(T){return T.replace(/=/g,"").replace(/[+\/]/g,function(N){return N=="+"?"-":"_"})},h=function(T){return T.replace(/[^A-Za-z0-9\+\/]/g,"")},d=function(T){for(var N,oe,se,ve,pn="",wp=T.length%3,rl=0;rl<T.length;){if((oe=T.charCodeAt(rl++))>255||(se=T.charCodeAt(rl++))>255||(ve=T.charCodeAt(rl++))>255)throw new TypeError("invalid character found");N=oe<<16|se<<8|ve,pn+=s[N>>18&63]+s[N>>12&63]+s[N>>6&63]+s[N&63]}return wp?pn.slice(0,wp-3)+"===".substring(wp):pn},p=typeof btoa=="function"?function(T){return btoa(T)}:r?function(T){return Buffer.from(T,"binary").toString("base64")}:d,v=r?function(T){return Buffer.from(T).toString("base64")}:function(T){for(var N=4096,oe=[],se=0,ve=T.length;se<ve;se+=N)oe.push(c.apply(null,T.subarray(se,se+N)));return p(oe.join(""))},g=function(T,N){return N===void 0&&(N=!1),N?f(v(T)):v(T)},w=function(T){if(T.length<2){var N=T.charCodeAt(0);return N<128?T:N<2048?c(192|N>>>6)+c(128|N&63):c(224|N>>>12&15)+c(128|N>>>6&63)+c(128|N&63)}else{var N=65536+(T.charCodeAt(0)-55296)*1024+(T.charCodeAt(1)-56320);return c(240|N>>>18&7)+c(128|N>>>12&63)+c(128|N>>>6&63)+c(128|N&63)}},x=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,D=function(T){return T.replace(x,w)},C=r?function(T){return Buffer.from(T,"utf8").toString("base64")}:i?function(T){return v(i.encode(T))}:function(T){return p(D(T))},k=function(T,N){return N===void 0&&(N=!1),N?f(C(T)):C(T)},$=function(T){return k(T,!0)},F=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,L=function(T){switch(T.length){case 4:var N=(7&T.charCodeAt(0))<<18|(63&T.charCodeAt(1))<<12|(63&T.charCodeAt(2))<<6|63&T.charCodeAt(3),oe=N-65536;return c((oe>>>10)+55296)+c((oe&1023)+56320);case 3:return c((15&T.charCodeAt(0))<<12|(63&T.charCodeAt(1))<<6|63&T.charCodeAt(2));default:return c((31&T.charCodeAt(0))<<6|63&T.charCodeAt(1))}},S=function(T){return T.replace(F,L)},I=function(T){if(T=T.replace(/\s+/g,""),!u.test(T))throw new TypeError("malformed base64.");T+="==".slice(2-(T.length&3));for(var N,oe="",se,ve,pn=0;pn<T.length;)N=a[T.charAt(pn++)]<<18|a[T.charAt(pn++)]<<12|(se=a[T.charAt(pn++)])<<6|(ve=a[T.charAt(pn++)]),oe+=se===64?c(N>>16&255):ve===64?c(N>>16&255,N>>8&255):c(N>>16&255,N>>8&255,N&255);return oe},R=typeof atob=="function"?function(T){return atob(h(T))}:r?function(T){return Buffer.from(T,"base64").toString("binary")}:I,B=r?function(T){return l(Buffer.from(T,"base64"))}:function(T){return l(R(T).split("").map(function(N){return N.charCodeAt(0)}))},q=function(T){return B(M(T))},K=r?function(T){return Buffer.from(T,"base64").toString("utf8")}:n?function(T){return n.decode(B(T))}:function(T){return S(R(T))},M=function(T){return h(T.replace(/[-_]/g,function(N){return N=="-"?"+":"/"}))},E=function(T){return K(M(T))},b=function(T){if(typeof T!="string")return!1;var N=T.replace(/\s+/g,"").replace(/={0,2}$/,"");return!/[^\s0-9a-zA-Z\+/]/.test(N)||!/[^\s0-9a-zA-Z\-_]/.test(N)},_=function(T){return{value:T,enumerable:!1,writable:!0,configurable:!0}},O=function(){var T=function(N,oe){return Object.defineProperty(String.prototype,N,_(oe))};T("fromBase64",function(){return E(this)}),T("toBase64",function(N){return k(this,N)}),T("toBase64URI",function(){return k(this,!0)}),T("toBase64URL",function(){return k(this,!0)}),T("toUint8Array",function(){return q(this)})},j=function(){var T=function(N,oe){return Object.defineProperty(Uint8Array.prototype,N,_(oe))};T("toBase64",function(N){return g(this,N)}),T("toBase64URI",function(){return g(this,!0)}),T("toBase64URL",function(){return g(this,!0)})},P=function(){O(),j()},U={version:t,VERSION:e,atob:R,atobPolyfill:I,btoa:p,btoaPolyfill:d,fromBase64:E,toBase64:k,encode:k,encodeURI:$,encodeURL:$,utob:D,btou:S,decode:E,isValid:b,fromUint8Array:g,toUint8Array:q,extendString:O,extendUint8Array:j,extendBuiltins:P};return U.Base64={},Object.keys(U).forEach(function(T){return U.Base64[T]=U[T]}),U})});var TS=y((gde,kS)=>{"use strict";kS.exports=function(e,r){if(r=r.split(":")[0],e=+e,!e)return!1;switch(r){case"http":case"ws":return e!==80;case"https":case"wss":return e!==443;case"ftp":return e!==21;case"gopher":return e!==70;case"file":return!1}return e!==0}});var $S=y(Qg=>{"use strict";var W9=Object.prototype.hasOwnProperty,K9;function PS(t){try{return decodeURIComponent(t.replace(/\+/g," "))}catch{return null}}function RS(t){try{return encodeURIComponent(t)}catch{return null}}function Y9(t){for(var e=/([^=?#&]+)=?([^&]*)/g,r={},n;n=e.exec(t);){var i=PS(n[1]),o=PS(n[2]);i===null||o===null||i in r||(r[i]=o)}return r}function J9(t,e){e=e||"";var r=[],n,i;typeof e!="string"&&(e="?");for(i in t)if(W9.call(t,i)){if(n=t[i],!n&&(n===null||n===K9||isNaN(n))&&(n=""),i=RS(i),n=RS(n),i===null||n===null)continue;r.push(i+"="+n)}return r.length?e+r.join("&"):""}Qg.stringify=J9;Qg.parse=Y9});var US=y((Dde,MS)=>{"use strict";var jS=TS(),lf=$S(),X9=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,NS=/[\n\r\t]/g,Z9=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,LS=/:\d+$/,Q9=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i,e7=/^[a-zA-Z]:/;function ty(t){return(t||"").toString().replace(X9,"")}var ey=[["#","hash"],["?","query"],function(e,r){return Gr(r.protocol)?e.replace(/\\/g,"/"):e},["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d*)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],IS={hash:1,query:1};function BS(t){var e;typeof window<"u"?e=window:typeof global<"u"?e=global:typeof self<"u"?e=self:e={};var r=e.location||{};t=t||r;var n={},i=typeof t,o;if(t.protocol==="blob:")n=new Wr(unescape(t.pathname),{});else if(i==="string"){n=new Wr(t,{});for(o in IS)delete n[o]}else if(i==="object"){for(o in t)o in IS||(n[o]=t[o]);n.slashes===void 0&&(n.slashes=Z9.test(t.href))}return n}function Gr(t){return t==="file:"||t==="ftp:"||t==="http:"||t==="https:"||t==="ws:"||t==="wss:"}function qS(t,e){t=ty(t),t=t.replace(NS,""),e=e||{};var r=Q9.exec(t),n=r[1]?r[1].toLowerCase():"",i=!!r[2],o=!!r[3],s=0,a;return i?o?(a=r[2]+r[3]+r[4],s=r[2].length+r[3].length):(a=r[2]+r[4],s=r[2].length):o?(a=r[3]+r[4],s=r[3].length):a=r[4],n==="file:"?s>=2&&(a=a.slice(2)):Gr(n)?a=r[4]:n?i&&(a=a.slice(2)):s>=2&&Gr(e.protocol)&&(a=r[4]),{protocol:n,slashes:i||Gr(n),slashesCount:s,rest:a}}function t7(t,e){if(t==="")return e;for(var r=(e||"/").split("/").slice(0,-1).concat(t.split("/")),n=r.length,i=r[n-1],o=!1,s=0;n--;)r[n]==="."?r.splice(n,1):r[n]===".."?(r.splice(n,1),s++):s&&(n===0&&(o=!0),r.splice(n,1),s--);return o&&r.unshift(""),(i==="."||i==="..")&&r.push(""),r.join("/")}function Wr(t,e,r){if(t=ty(t),t=t.replace(NS,""),!(this instanceof Wr))return new Wr(t,e,r);var n,i,o,s,a,u,c=ey.slice(),l=typeof e,f=this,h=0;for(l!=="object"&&l!=="string"&&(r=e,e=null),r&&typeof r!="function"&&(r=lf.parse),e=BS(e),i=qS(t||"",e),n=!i.protocol&&!i.slashes,f.slashes=i.slashes||n&&e.slashes,f.protocol=i.protocol||e.protocol||"",t=i.rest,(i.protocol==="file:"&&(i.slashesCount!==2||e7.test(t))||!i.slashes&&(i.protocol||i.slashesCount<2||!Gr(f.protocol)))&&(c[3]=[/(.*)/,"pathname"]);h<c.length;h++){if(s=c[h],typeof s=="function"){t=s(t,f);continue}o=s[0],u=s[1],o!==o?f[u]=t:typeof o=="string"?(a=o==="@"?t.lastIndexOf(o):t.indexOf(o),~a&&(typeof s[2]=="number"?(f[u]=t.slice(0,a),t=t.slice(a+s[2])):(f[u]=t.slice(a),t=t.slice(0,a)))):(a=o.exec(t))&&(f[u]=a[1],t=t.slice(0,a.index)),f[u]=f[u]||n&&s[3]&&e[u]||"",s[4]&&(f[u]=f[u].toLowerCase())}r&&(f.query=r(f.query)),n&&e.slashes&&f.pathname.charAt(0)!=="/"&&(f.pathname!==""||e.pathname!=="")&&(f.pathname=t7(f.pathname,e.pathname)),f.pathname.charAt(0)!=="/"&&Gr(f.protocol)&&(f.pathname="/"+f.pathname),jS(f.port,f.protocol)||(f.host=f.hostname,f.port=""),f.username=f.password="",f.auth&&(a=f.auth.indexOf(":"),~a?(f.username=f.auth.slice(0,a),f.username=encodeURIComponent(decodeURIComponent(f.username)),f.password=f.auth.slice(a+1),f.password=encodeURIComponent(decodeURIComponent(f.password))):f.username=encodeURIComponent(decodeURIComponent(f.auth)),f.auth=f.password?f.username+":"+f.password:f.username),f.origin=f.protocol!=="file:"&&Gr(f.protocol)&&f.host?f.protocol+"//"+f.host:"null",f.href=f.toString()}function r7(t,e,r){var n=this;switch(t){case"query":typeof e=="string"&&e.length&&(e=(r||lf.parse)(e)),n[t]=e;break;case"port":n[t]=e,jS(e,n.protocol)?e&&(n.host=n.hostname+":"+e):(n.host=n.hostname,n[t]="");break;case"hostname":n[t]=e,n.port&&(e+=":"+n.port),n.host=e;break;case"host":n[t]=e,LS.test(e)?(e=e.split(":"),n.port=e.pop(),n.hostname=e.join(":")):(n.hostname=e,n.port="");break;case"protocol":n.protocol=e.toLowerCase(),n.slashes=!r;break;case"pathname":case"hash":if(e){var i=t==="pathname"?"/":"#";n[t]=e.charAt(0)!==i?i+e:e}else n[t]=e;break;case"username":case"password":n[t]=encodeURIComponent(e);break;case"auth":var o=e.indexOf(":");~o?(n.username=e.slice(0,o),n.username=encodeURIComponent(decodeURIComponent(n.username)),n.password=e.slice(o+1),n.password=encodeURIComponent(decodeURIComponent(n.password))):n.username=encodeURIComponent(decodeURIComponent(e))}for(var s=0;s<ey.length;s++){var a=ey[s];a[4]&&(n[a[1]]=n[a[1]].toLowerCase())}return n.auth=n.password?n.username+":"+n.password:n.username,n.origin=n.protocol!=="file:"&&Gr(n.protocol)&&n.host?n.protocol+"//"+n.host:"null",n.href=n.toString(),n}function n7(t){(!t||typeof t!="function")&&(t=lf.stringify);var e,r=this,n=r.host,i=r.protocol;i&&i.charAt(i.length-1)!==":"&&(i+=":");var o=i+(r.protocol&&r.slashes||Gr(r.protocol)?"//":"");return r.username?(o+=r.username,r.password&&(o+=":"+r.password),o+="@"):r.password?(o+=":"+r.password,o+="@"):r.protocol!=="file:"&&Gr(r.protocol)&&!n&&r.pathname!=="/"&&(o+="@"),(n[n.length-1]===":"||LS.test(r.hostname)&&!r.port)&&(n+=":"),o+=n+r.pathname,e=typeof r.query=="object"?t(r.query):r.query,e&&(o+=e.charAt(0)!=="?"?"?"+e:e),r.hash&&(o+=r.hash),o}Wr.prototype={set:r7,toString:n7};Wr.extractProtocol=qS;Wr.location=BS;Wr.trimLeft=ty;Wr.qs=lf;MS.exports=Wr});var VS=y(ry=>{"use strict";Object.defineProperty(ry,"__esModule",{value:!0});ry.default=i7;function i7(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var e=Math.random()*16|0,r=t==="x"?e:e&3|8;return r.toString(16)})}});var i1=y(hf=>{"use strict";Object.defineProperty(hf,"__esModule",{value:!0});hf.default=void 0;var o7=AS(),s7=sy(US()),ff=sy(Yg()),Li=Jg(),a7=sy(VS());function sy(t){return t&&t.__esModule?t:{default:t}}function ny(){"use strict";ny=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(E,b,_){E[b]=_.value},o=typeof Symbol=="function"?Symbol:{},s=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function c(E,b,_){return Object.defineProperty(E,b,{value:_,enumerable:!0,configurable:!0,writable:!0}),E[b]}try{c({},"")}catch{c=function(_,O,j){return _[O]=j}}function l(E,b,_,O){var j=b&&b.prototype instanceof w?b:w,P=Object.create(j.prototype),U=new K(O||[]);return i(P,"_invoke",{value:I(E,_,U)}),P}function f(E,b,_){try{return{type:"normal",arg:E.call(b,_)}}catch(O){return{type:"throw",arg:O}}}e.wrap=l;var h="suspendedStart",d="suspendedYield",p="executing",v="completed",g={};function w(){}function x(){}function D(){}var C={};c(C,s,function(){return this});var k=Object.getPrototypeOf,$=k&&k(k(M([])));$&&$!==r&&n.call($,s)&&(C=$);var F=D.prototype=w.prototype=Object.create(C);function L(E){["next","throw","return"].forEach(function(b){c(E,b,function(_){return this._invoke(b,_)})})}function S(E,b){function _(j,P,U,T){var N=f(E[j],E,P);if(N.type!=="throw"){var oe=N.arg,se=oe.value;return se&&Bi(se)=="object"&&n.call(se,"__await")?b.resolve(se.__await).then(function(ve){_("next",ve,U,T)},function(ve){_("throw",ve,U,T)}):b.resolve(se).then(function(ve){oe.value=ve,U(oe)},function(ve){return _("throw",ve,U,T)})}T(N.arg)}var O;i(this,"_invoke",{value:function(P,U){function T(){return new b(function(N,oe){_(P,U,N,oe)})}return O=O?O.then(T,T):T()}})}function I(E,b,_){var O=h;return function(j,P){if(O===p)throw Error("Generator is already running");if(O===v){if(j==="throw")throw P;return{value:t,done:!0}}for(_.method=j,_.arg=P;;){var U=_.delegate;if(U){var T=R(U,_);if(T){if(T===g)continue;return T}}if(_.method==="next")_.sent=_._sent=_.arg;else if(_.method==="throw"){if(O===h)throw O=v,_.arg;_.dispatchException(_.arg)}else _.method==="return"&&_.abrupt("return",_.arg);O=p;var N=f(E,b,_);if(N.type==="normal"){if(O=_.done?v:d,N.arg===g)continue;return{value:N.arg,done:_.done}}N.type==="throw"&&(O=v,_.method="throw",_.arg=N.arg)}}}function R(E,b){var _=b.method,O=E.iterator[_];if(O===t)return b.delegate=null,_==="throw"&&E.iterator.return&&(b.method="return",b.arg=t,R(E,b),b.method==="throw")||_!=="return"&&(b.method="throw",b.arg=new TypeError("The iterator does not provide a '"+_+"' method")),g;var j=f(O,E.iterator,b.arg);if(j.type==="throw")return b.method="throw",b.arg=j.arg,b.delegate=null,g;var P=j.arg;return P?P.done?(b[E.resultName]=P.value,b.next=E.nextLoc,b.method!=="return"&&(b.method="next",b.arg=t),b.delegate=null,g):P:(b.method="throw",b.arg=new TypeError("iterator result is not an object"),b.delegate=null,g)}function B(E){var b={tryLoc:E[0]};1 in E&&(b.catchLoc=E[1]),2 in E&&(b.finallyLoc=E[2],b.afterLoc=E[3]),this.tryEntries.push(b)}function q(E){var b=E.completion||{};b.type="normal",delete b.arg,E.completion=b}function K(E){this.tryEntries=[{tryLoc:"root"}],E.forEach(B,this),this.reset(!0)}function M(E){if(E||E===""){var b=E[s];if(b)return b.call(E);if(typeof E.next=="function")return E;if(!isNaN(E.length)){var _=-1,O=function j(){for(;++_<E.length;)if(n.call(E,_))return j.value=E[_],j.done=!1,j;return j.value=t,j.done=!0,j};return O.next=O}}throw new TypeError(Bi(E)+" is not iterable")}return x.prototype=D,i(F,"constructor",{value:D,configurable:!0}),i(D,"constructor",{value:x,configurable:!0}),x.displayName=c(D,u,"GeneratorFunction"),e.isGeneratorFunction=function(E){var b=typeof E=="function"&&E.constructor;return!!b&&(b===x||(b.displayName||b.name)==="GeneratorFunction")},e.mark=function(E){return Object.setPrototypeOf?Object.setPrototypeOf(E,D):(E.__proto__=D,c(E,u,"GeneratorFunction")),E.prototype=Object.create(F),E},e.awrap=function(E){return{__await:E}},L(S.prototype),c(S.prototype,a,function(){return this}),e.AsyncIterator=S,e.async=function(E,b,_,O,j){j===void 0&&(j=Promise);var P=new S(l(E,b,_,O),j);return e.isGeneratorFunction(b)?P:P.next().then(function(U){return U.done?U.value:P.next()})},L(F),c(F,u,"Generator"),c(F,s,function(){return this}),c(F,"toString",function(){return"[object Generator]"}),e.keys=function(E){var b=Object(E),_=[];for(var O in b)_.push(O);return _.reverse(),function j(){for(;_.length;){var P=_.pop();if(P in b)return j.value=P,j.done=!1,j}return j.done=!0,j}},e.values=M,K.prototype={constructor:K,reset:function(b){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(q),!b)for(var _ in this)_.charAt(0)==="t"&&n.call(this,_)&&!isNaN(+_.slice(1))&&(this[_]=t)},stop:function(){this.done=!0;var b=this.tryEntries[0].completion;if(b.type==="throw")throw b.arg;return this.rval},dispatchException:function(b){if(this.done)throw b;var _=this;function O(oe,se){return U.type="throw",U.arg=b,_.next=oe,se&&(_.method="next",_.arg=t),!!se}for(var j=this.tryEntries.length-1;j>=0;--j){var P=this.tryEntries[j],U=P.completion;if(P.tryLoc==="root")return O("end");if(P.tryLoc<=this.prev){var T=n.call(P,"catchLoc"),N=n.call(P,"finallyLoc");if(T&&N){if(this.prev<P.catchLoc)return O(P.catchLoc,!0);if(this.prev<P.finallyLoc)return O(P.finallyLoc)}else if(T){if(this.prev<P.catchLoc)return O(P.catchLoc,!0)}else{if(!N)throw Error("try statement without catch or finally");if(this.prev<P.finallyLoc)return O(P.finallyLoc)}}}},abrupt:function(b,_){for(var O=this.tryEntries.length-1;O>=0;--O){var j=this.tryEntries[O];if(j.tryLoc<=this.prev&&n.call(j,"finallyLoc")&&this.prev<j.finallyLoc){var P=j;break}}P&&(b==="break"||b==="continue")&&P.tryLoc<=_&&_<=P.finallyLoc&&(P=null);var U=P?P.completion:{};return U.type=b,U.arg=_,P?(this.method="next",this.next=P.finallyLoc,g):this.complete(U)},complete:function(b,_){if(b.type==="throw")throw b.arg;return b.type==="break"||b.type==="continue"?this.next=b.arg:b.type==="return"?(this.rval=this.arg=b.arg,this.method="return",this.next="end"):b.type==="normal"&&_&&(this.next=_),g},finish:function(b){for(var _=this.tryEntries.length-1;_>=0;--_){var O=this.tryEntries[_];if(O.finallyLoc===b)return this.complete(O.completion,O.afterLoc),q(O),g}},catch:function(b){for(var _=this.tryEntries.length-1;_>=0;--_){var O=this.tryEntries[_];if(O.tryLoc===b){var j=O.completion;if(j.type==="throw"){var P=j.arg;q(O)}return P}}throw Error("illegal catch attempt")},delegateYield:function(b,_,O){return this.delegate={iterator:M(b),resultName:_,nextLoc:O},this.method==="next"&&(this.arg=t),g}},e}function HS(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(c){r(c);return}a.done?e(u):Promise.resolve(u).then(n,i)}function u7(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function s(u){HS(o,n,i,s,a,"next",u)}function a(u){HS(o,n,i,s,a,"throw",u)}s(void 0)})}}function QS(t,e){return f7(t)||l7(t,e)||e1(t,e)||c7()}function c7(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
31
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function l7(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,o,s,a=[],u=!0,c=!1;try{if(o=(r=r.call(t)).next,e===0){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=o.call(r)).done)&&(a.push(n.value),a.length!==e);u=!0);}catch(l){c=!0,i=l}finally{try{if(!u&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(c)throw i}}return a}}function f7(t){if(Array.isArray(t))return t}function Bi(t){"@babel/helpers - typeof";return Bi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Bi(t)}function d7(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=e1(t))||e&&t&&typeof t.length=="number"){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(c){throw c},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
32
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,s=!1,a;return{s:function(){r=r.call(t)},n:function(){var c=r.next();return o=c.done,c},e:function(c){s=!0,a=c},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(s)throw a}}}}function e1(t,e){if(t){if(typeof t=="string")return zS(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return zS(t,e)}}function zS(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function GS(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function ds(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?GS(Object(r),!0).forEach(function(n){h7(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):GS(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function h7(t,e,r){return e=t1(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function p7(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function WS(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,t1(n.key),n)}}function m7(t,e,r){return e&&WS(t.prototype,e),r&&WS(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function t1(t){var e=g7(t,"string");return Bi(e)=="symbol"?e:e+""}function g7(t,e){if(Bi(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Bi(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var iy="tus-v1",df="ietf-draft-03",y7={endpoint:null,uploadUrl:null,metadata:{},metadataForPartialUploads:{},fingerprint:null,uploadSize:null,onProgress:null,onChunkComplete:null,onSuccess:null,onError:null,onUploadUrlAvailable:null,overridePatchMethod:!1,headers:{},addRequestId:!1,onBeforeRequest:null,onAfterResponse:null,onShouldRetry:n1,chunkSize:Number.POSITIVE_INFINITY,retryDelays:[0,1e3,3e3,5e3],parallelUploads:1,parallelUploadBoundaries:null,storeFingerprintForResuming:!0,removeFingerprintOnSuccess:!1,uploadLengthDeferred:!1,uploadDataDuringCreation:!1,urlStorage:null,fileReader:null,httpStack:null,protocol:iy},r1=function(){function t(e,r){p7(this,t),"resume"in r&&console.log("tus: The `resume` option has been removed in tus-js-client v2. Please use the URL storage API instead."),this.options=r,this.options.chunkSize=Number(this.options.chunkSize),this._urlStorage=this.options.urlStorage,this.file=e,this.url=null,this._req=null,this._fingerprint=null,this._urlStorageKey=null,this._offset=null,this._aborted=!1,this._size=null,this._source=null,this._retryAttempt=0,this._retryTimeout=null,this._offsetBeforeRetry=0,this._parallelUploads=null,this._parallelUploadUrls=null}return m7(t,[{key:"findPreviousUploads",value:function(){var r=this;return this.options.fingerprint(this.file,this.options).then(function(n){return r._urlStorage.findUploadsByFingerprint(n)})}},{key:"resumeFromPreviousUpload",value:function(r){this.url=r.uploadUrl||null,this._parallelUploadUrls=r.parallelUploadUrls||null,this._urlStorageKey=r.urlStorageKey}},{key:"start",value:function(){var r=this,n=this.file;if(!n){this._emitError(new Error("tus: no file or stream to upload provided"));return}if(![iy,df].includes(this.options.protocol)){this._emitError(new Error("tus: unsupported protocol ".concat(this.options.protocol)));return}if(!this.options.endpoint&&!this.options.uploadUrl&&!this.url){this._emitError(new Error("tus: neither an endpoint or an upload URL is provided"));return}var i=this.options.retryDelays;if(i!=null&&Object.prototype.toString.call(i)!=="[object Array]"){this._emitError(new Error("tus: the `retryDelays` option must either be an array or null"));return}if(this.options.parallelUploads>1)for(var o=0,s=["uploadUrl","uploadSize","uploadLengthDeferred"];o<s.length;o++){var a=s[o];if(this.options[a]){this._emitError(new Error("tus: cannot use the ".concat(a," option when parallelUploads is enabled")));return}}if(this.options.parallelUploadBoundaries){if(this.options.parallelUploads<=1){this._emitError(new Error("tus: cannot use the `parallelUploadBoundaries` option when `parallelUploads` is disabled"));return}if(this.options.parallelUploads!==this.options.parallelUploadBoundaries.length){this._emitError(new Error("tus: the `parallelUploadBoundaries` must have the same length as the value of `parallelUploads`"));return}}this.options.fingerprint(n,this.options).then(function(u){return u==null?(0,Li.log)("No fingerprint was calculated meaning that the upload cannot be stored in the URL storage."):(0,Li.log)("Calculated fingerprint: ".concat(u)),r._fingerprint=u,r._source?r._source:r.options.fileReader.openFile(n,r.options.chunkSize)}).then(function(u){if(r._source=u,r.options.uploadLengthDeferred)r._size=null;else if(r.options.uploadSize!=null){if(r._size=Number(r.options.uploadSize),Number.isNaN(r._size)){r._emitError(new Error("tus: cannot convert `uploadSize` option into a number"));return}}else if(r._size=r._source.size,r._size==null){r._emitError(new Error("tus: cannot automatically derive upload's size from input. Specify it manually using the `uploadSize` option or use the `uploadLengthDeferred` option"));return}r.options.parallelUploads>1||r._parallelUploadUrls!=null?r._startParallelUpload():r._startSingleUpload()}).catch(function(u){r._emitError(u)})}},{key:"_startParallelUpload",value:function(){var r,n=this,i=this._size,o=0;this._parallelUploads=[];var s=this._parallelUploadUrls!=null?this._parallelUploadUrls.length:this.options.parallelUploads,a=(r=this.options.parallelUploadBoundaries)!==null&&r!==void 0?r:v7(this._source.size,s);this._parallelUploadUrls&&a.forEach(function(l,f){l.uploadUrl=n._parallelUploadUrls[f]||null}),this._parallelUploadUrls=new Array(a.length);var u=a.map(function(l,f){var h=0;return n._source.slice(l.start,l.end).then(function(d){var p=d.value;return new Promise(function(v,g){var w=ds(ds({},n.options),{},{uploadUrl:l.uploadUrl||null,storeFingerprintForResuming:!1,removeFingerprintOnSuccess:!1,parallelUploads:1,parallelUploadBoundaries:null,metadata:n.options.metadataForPartialUploads,headers:ds(ds({},n.options.headers),{},{"Upload-Concat":"partial"}),onSuccess:v,onError:g,onProgress:function(C){o=o-h+C,h=C,n._emitProgress(o,i)},onUploadUrlAvailable:function(){n._parallelUploadUrls[f]=x.url,n._parallelUploadUrls.filter(function(C){return!!C}).length===a.length&&n._saveUploadInUrlStorage()}}),x=new t(p,w);x.start(),n._parallelUploads.push(x)})})}),c;Promise.all(u).then(function(){c=n._openRequest("POST",n.options.endpoint),c.setHeader("Upload-Concat","final;".concat(n._parallelUploadUrls.join(" ")));var l=KS(n.options.metadata);return l!==""&&c.setHeader("Upload-Metadata",l),n._sendRequest(c,null)}).then(function(l){if(!hs(l.getStatus(),200)){n._emitHttpError(c,l,"tus: unexpected response while creating upload");return}var f=l.getHeader("Location");if(f==null){n._emitHttpError(c,l,"tus: invalid or missing Location header");return}n.url=ZS(n.options.endpoint,f),(0,Li.log)("Created upload at ".concat(n.url)),n._emitSuccess(l)}).catch(function(l){n._emitError(l)})}},{key:"_startSingleUpload",value:function(){if(this._aborted=!1,this.url!=null){(0,Li.log)("Resuming upload from previous URL: ".concat(this.url)),this._resumeUpload();return}if(this.options.uploadUrl!=null){(0,Li.log)("Resuming upload from provided URL: ".concat(this.options.uploadUrl)),this.url=this.options.uploadUrl,this._resumeUpload();return}(0,Li.log)("Creating a new upload"),this._createUpload()}},{key:"abort",value:function(r){var n=this;if(this._parallelUploads!=null){var i=d7(this._parallelUploads),o;try{for(i.s();!(o=i.n()).done;){var s=o.value;s.abort(r)}}catch(a){i.e(a)}finally{i.f()}}return this._req!==null&&this._req.abort(),this._aborted=!0,this._retryTimeout!=null&&(clearTimeout(this._retryTimeout),this._retryTimeout=null),!r||this.url==null?Promise.resolve():t.terminate(this.url,this.options).then(function(){return n._removeFromUrlStorage()})}},{key:"_emitHttpError",value:function(r,n,i,o){this._emitError(new ff.default(i,o,r,n))}},{key:"_emitError",value:function(r){var n=this;if(!this._aborted){if(this.options.retryDelays!=null){var i=this._offset!=null&&this._offset>this._offsetBeforeRetry;if(i&&(this._retryAttempt=0),XS(r,this._retryAttempt,this.options)){var o=this.options.retryDelays[this._retryAttempt++];this._offsetBeforeRetry=this._offset,this._retryTimeout=setTimeout(function(){n.start()},o);return}}if(typeof this.options.onError=="function")this.options.onError(r);else throw r}}},{key:"_emitSuccess",value:function(r){this.options.removeFingerprintOnSuccess&&this._removeFromUrlStorage(),typeof this.options.onSuccess=="function"&&this.options.onSuccess({lastResponse:r})}},{key:"_emitProgress",value:function(r,n){typeof this.options.onProgress=="function"&&this.options.onProgress(r,n)}},{key:"_emitChunkComplete",value:function(r,n,i){typeof this.options.onChunkComplete=="function"&&this.options.onChunkComplete(r,n,i)}},{key:"_createUpload",value:function(){var r=this;if(!this.options.endpoint){this._emitError(new Error("tus: unable to create upload because no endpoint is provided"));return}var n=this._openRequest("POST",this.options.endpoint);this.options.uploadLengthDeferred?n.setHeader("Upload-Defer-Length","1"):n.setHeader("Upload-Length","".concat(this._size));var i=KS(this.options.metadata);i!==""&&n.setHeader("Upload-Metadata",i);var o;this.options.uploadDataDuringCreation&&!this.options.uploadLengthDeferred?(this._offset=0,o=this._addChunkToRequest(n)):(this.options.protocol===df&&n.setHeader("Upload-Complete","?0"),o=this._sendRequest(n,null)),o.then(function(s){if(!hs(s.getStatus(),200)){r._emitHttpError(n,s,"tus: unexpected response while creating upload");return}var a=s.getHeader("Location");if(a==null){r._emitHttpError(n,s,"tus: invalid or missing Location header");return}if(r.url=ZS(r.options.endpoint,a),(0,Li.log)("Created upload at ".concat(r.url)),typeof r.options.onUploadUrlAvailable=="function"&&r.options.onUploadUrlAvailable(),r._size===0){r._emitSuccess(s),r._source.close();return}r._saveUploadInUrlStorage().then(function(){r.options.uploadDataDuringCreation?r._handleUploadResponse(n,s):(r._offset=0,r._performUpload())})}).catch(function(s){r._emitHttpError(n,null,"tus: failed to create upload",s)})}},{key:"_resumeUpload",value:function(){var r=this,n=this._openRequest("HEAD",this.url),i=this._sendRequest(n,null);i.then(function(o){var s=o.getStatus();if(!hs(s,200)){if(s===423){r._emitHttpError(n,o,"tus: upload is currently locked; retry later");return}if(hs(s,400)&&r._removeFromUrlStorage(),!r.options.endpoint){r._emitHttpError(n,o,"tus: unable to resume upload (new upload cannot be created without an endpoint)");return}r.url=null,r._createUpload();return}var a=Number.parseInt(o.getHeader("Upload-Offset"),10);if(Number.isNaN(a)){r._emitHttpError(n,o,"tus: invalid or missing offset value");return}var u=Number.parseInt(o.getHeader("Upload-Length"),10);if(Number.isNaN(u)&&!r.options.uploadLengthDeferred&&r.options.protocol===iy){r._emitHttpError(n,o,"tus: invalid or missing length value");return}typeof r.options.onUploadUrlAvailable=="function"&&r.options.onUploadUrlAvailable(),r._saveUploadInUrlStorage().then(function(){if(a===u){r._emitProgress(u,u),r._emitSuccess(o);return}r._offset=a,r._performUpload()})}).catch(function(o){r._emitHttpError(n,null,"tus: failed to resume upload",o)})}},{key:"_performUpload",value:function(){var r=this;if(!this._aborted){var n;this.options.overridePatchMethod?(n=this._openRequest("POST",this.url),n.setHeader("X-HTTP-Method-Override","PATCH")):n=this._openRequest("PATCH",this.url),n.setHeader("Upload-Offset","".concat(this._offset));var i=this._addChunkToRequest(n);i.then(function(o){if(!hs(o.getStatus(),200)){r._emitHttpError(n,o,"tus: unexpected response while uploading chunk");return}r._handleUploadResponse(n,o)}).catch(function(o){r._aborted||r._emitHttpError(n,null,"tus: failed to upload chunk at offset ".concat(r._offset),o)})}}},{key:"_addChunkToRequest",value:function(r){var n=this,i=this._offset,o=this._offset+this.options.chunkSize;return r.setProgressHandler(function(s){n._emitProgress(i+s,n._size)}),r.setHeader("Content-Type","application/offset+octet-stream"),(o===Number.POSITIVE_INFINITY||o>this._size)&&!this.options.uploadLengthDeferred&&(o=this._size),this._source.slice(i,o).then(function(s){var a=s.value,u=s.done,c=a!=null&&a.size?a.size:0;n.options.uploadLengthDeferred&&u&&(n._size=n._offset+c,r.setHeader("Upload-Length","".concat(n._size)));var l=n._offset+c;return!n.options.uploadLengthDeferred&&u&&l!==n._size?Promise.reject(new Error("upload was configured with a size of ".concat(n._size," bytes, but the source is done after ").concat(l," bytes"))):a===null?n._sendRequest(r):(n.options.protocol===df&&r.setHeader("Upload-Complete",u?"?1":"?0"),n._emitProgress(n._offset,n._size),n._sendRequest(r,a))})}},{key:"_handleUploadResponse",value:function(r,n){var i=Number.parseInt(n.getHeader("Upload-Offset"),10);if(Number.isNaN(i)){this._emitHttpError(r,n,"tus: invalid or missing offset value");return}if(this._emitProgress(i,this._size),this._emitChunkComplete(i-this._offset,i,this._size),this._offset=i,i===this._size){this._emitSuccess(n),this._source.close();return}this._performUpload()}},{key:"_openRequest",value:function(r,n){var i=YS(r,n,this.options);return this._req=i,i}},{key:"_removeFromUrlStorage",value:function(){var r=this;this._urlStorageKey&&(this._urlStorage.removeUpload(this._urlStorageKey).catch(function(n){r._emitError(n)}),this._urlStorageKey=null)}},{key:"_saveUploadInUrlStorage",value:function(){var r=this;if(!this.options.storeFingerprintForResuming||!this._fingerprint||this._urlStorageKey!==null)return Promise.resolve();var n={size:this._size,metadata:this.options.metadata,creationTime:new Date().toString()};return this._parallelUploads?n.parallelUploadUrls=this._parallelUploadUrls:n.uploadUrl=this.url,this._urlStorage.addUpload(this._fingerprint,n).then(function(i){r._urlStorageKey=i})}},{key:"_sendRequest",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return JS(r,n,this.options)}}],[{key:"terminate",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=YS("DELETE",r,n);return JS(i,null,n).then(function(o){if(o.getStatus()!==204)throw new ff.default("tus: unexpected response while terminating upload",null,i,o)}).catch(function(o){if(o instanceof ff.default||(o=new ff.default("tus: failed to terminate upload",o,i,null)),!XS(o,0,n))throw o;var s=n.retryDelays[0],a=n.retryDelays.slice(1),u=ds(ds({},n),{},{retryDelays:a});return new Promise(function(c){return setTimeout(c,s)}).then(function(){return t.terminate(r,u)})})}}])}();function KS(t){return Object.entries(t).map(function(e){var r=QS(e,2),n=r[0],i=r[1];return"".concat(n," ").concat(o7.Base64.encode(String(i)))}).join(",")}function hs(t,e){return t>=e&&t<e+100}function YS(t,e,r){var n=r.httpStack.createRequest(t,e);r.protocol===df?n.setHeader("Upload-Draft-Interop-Version","5"):n.setHeader("Tus-Resumable","1.0.0");for(var i=r.headers||{},o=0,s=Object.entries(i);o<s.length;o++){var a=QS(s[o],2),u=a[0],c=a[1];n.setHeader(u,c)}if(r.addRequestId){var l=(0,a7.default)();n.setHeader("X-Request-ID",l)}return n}function JS(t,e,r){return oy.apply(this,arguments)}function oy(){return oy=u7(ny().mark(function t(e,r,n){var i;return ny().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:if(typeof n.onBeforeRequest!="function"){s.next=3;break}return s.next=3,n.onBeforeRequest(e);case 3:return s.next=5,e.send(r);case 5:if(i=s.sent,typeof n.onAfterResponse!="function"){s.next=9;break}return s.next=9,n.onAfterResponse(e,i);case 9:return s.abrupt("return",i);case 10:case"end":return s.stop()}},t)})),oy.apply(this,arguments)}function D7(){var t=!0;return typeof navigator<"u"&&navigator.onLine===!1&&(t=!1),t}function XS(t,e,r){return r.retryDelays==null||e>=r.retryDelays.length||t.originalRequest==null?!1:r&&typeof r.onShouldRetry=="function"?r.onShouldRetry(t,e,r):n1(t)}function n1(t){var e=t.originalResponse?t.originalResponse.getStatus():0;return(!hs(e,400)||e===409||e===423)&&D7()}function ZS(t,e){return new s7.default(e,t).toString()}function v7(t,e){for(var r=Math.floor(t/e),n=[],i=0;i<e;i++)n.push({start:r*i,end:r*(i+1)});return n[e-1].end=t,n}r1.defaultOptions=y7;var bde=hf.default=r1});var s1=y((_de,o1)=>{"use strict";var Kr=t=>t!==null&&typeof t=="object"&&typeof t.pipe=="function";Kr.writable=t=>Kr(t)&&t.writable!==!1&&typeof t._write=="function"&&typeof t._writableState=="object";Kr.readable=t=>Kr(t)&&t.readable!==!1&&typeof t._read=="function"&&typeof t._readableState=="object";Kr.duplex=t=>Kr.writable(t)&&Kr.readable(t);Kr.transform=t=>Kr.duplex(t)&&typeof t._transform=="function";o1.exports=Kr});var u1=y(pf=>{"use strict";Object.defineProperty(pf,"__esModule",{value:!0});pf.default=void 0;function Ou(t){"@babel/helpers - typeof";return Ou=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ou(t)}function b7(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a1(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,_7(n.key),n)}}function w7(t,e,r){return e&&a1(t.prototype,e),r&&a1(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function _7(t){var e=E7(t,"string");return Ou(e)=="symbol"?e:e+""}function E7(t,e){if(Ou(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Ou(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Ede=pf.default=function(){function t(e){b7(this,t),this._buffer=e,this.size=e.length}return w7(t,[{key:"slice",value:function(r,n){var i=this._buffer.slice(r,n);i.size=i.length;var o=n>=this.size;return Promise.resolve({value:i,done:o})}},{key:"close",value:function(){}}])}()});var d1=y(cy=>{"use strict";Object.defineProperty(cy,"__esModule",{value:!0});cy.default=A7;var f1=require("fs");function qi(t){"@babel/helpers - typeof";return qi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},qi(t)}function ay(){"use strict";ay=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(E,b,_){E[b]=_.value},o=typeof Symbol=="function"?Symbol:{},s=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function c(E,b,_){return Object.defineProperty(E,b,{value:_,enumerable:!0,configurable:!0,writable:!0}),E[b]}try{c({},"")}catch{c=function(_,O,j){return _[O]=j}}function l(E,b,_,O){var j=b&&b.prototype instanceof w?b:w,P=Object.create(j.prototype),U=new K(O||[]);return i(P,"_invoke",{value:I(E,_,U)}),P}function f(E,b,_){try{return{type:"normal",arg:E.call(b,_)}}catch(O){return{type:"throw",arg:O}}}e.wrap=l;var h="suspendedStart",d="suspendedYield",p="executing",v="completed",g={};function w(){}function x(){}function D(){}var C={};c(C,s,function(){return this});var k=Object.getPrototypeOf,$=k&&k(k(M([])));$&&$!==r&&n.call($,s)&&(C=$);var F=D.prototype=w.prototype=Object.create(C);function L(E){["next","throw","return"].forEach(function(b){c(E,b,function(_){return this._invoke(b,_)})})}function S(E,b){function _(j,P,U,T){var N=f(E[j],E,P);if(N.type!=="throw"){var oe=N.arg,se=oe.value;return se&&qi(se)=="object"&&n.call(se,"__await")?b.resolve(se.__await).then(function(ve){_("next",ve,U,T)},function(ve){_("throw",ve,U,T)}):b.resolve(se).then(function(ve){oe.value=ve,U(oe)},function(ve){return _("throw",ve,U,T)})}T(N.arg)}var O;i(this,"_invoke",{value:function(P,U){function T(){return new b(function(N,oe){_(P,U,N,oe)})}return O=O?O.then(T,T):T()}})}function I(E,b,_){var O=h;return function(j,P){if(O===p)throw Error("Generator is already running");if(O===v){if(j==="throw")throw P;return{value:t,done:!0}}for(_.method=j,_.arg=P;;){var U=_.delegate;if(U){var T=R(U,_);if(T){if(T===g)continue;return T}}if(_.method==="next")_.sent=_._sent=_.arg;else if(_.method==="throw"){if(O===h)throw O=v,_.arg;_.dispatchException(_.arg)}else _.method==="return"&&_.abrupt("return",_.arg);O=p;var N=f(E,b,_);if(N.type==="normal"){if(O=_.done?v:d,N.arg===g)continue;return{value:N.arg,done:_.done}}N.type==="throw"&&(O=v,_.method="throw",_.arg=N.arg)}}}function R(E,b){var _=b.method,O=E.iterator[_];if(O===t)return b.delegate=null,_==="throw"&&E.iterator.return&&(b.method="return",b.arg=t,R(E,b),b.method==="throw")||_!=="return"&&(b.method="throw",b.arg=new TypeError("The iterator does not provide a '"+_+"' method")),g;var j=f(O,E.iterator,b.arg);if(j.type==="throw")return b.method="throw",b.arg=j.arg,b.delegate=null,g;var P=j.arg;return P?P.done?(b[E.resultName]=P.value,b.next=E.nextLoc,b.method!=="return"&&(b.method="next",b.arg=t),b.delegate=null,g):P:(b.method="throw",b.arg=new TypeError("iterator result is not an object"),b.delegate=null,g)}function B(E){var b={tryLoc:E[0]};1 in E&&(b.catchLoc=E[1]),2 in E&&(b.finallyLoc=E[2],b.afterLoc=E[3]),this.tryEntries.push(b)}function q(E){var b=E.completion||{};b.type="normal",delete b.arg,E.completion=b}function K(E){this.tryEntries=[{tryLoc:"root"}],E.forEach(B,this),this.reset(!0)}function M(E){if(E||E===""){var b=E[s];if(b)return b.call(E);if(typeof E.next=="function")return E;if(!isNaN(E.length)){var _=-1,O=function j(){for(;++_<E.length;)if(n.call(E,_))return j.value=E[_],j.done=!1,j;return j.value=t,j.done=!0,j};return O.next=O}}throw new TypeError(qi(E)+" is not iterable")}return x.prototype=D,i(F,"constructor",{value:D,configurable:!0}),i(D,"constructor",{value:x,configurable:!0}),x.displayName=c(D,u,"GeneratorFunction"),e.isGeneratorFunction=function(E){var b=typeof E=="function"&&E.constructor;return!!b&&(b===x||(b.displayName||b.name)==="GeneratorFunction")},e.mark=function(E){return Object.setPrototypeOf?Object.setPrototypeOf(E,D):(E.__proto__=D,c(E,u,"GeneratorFunction")),E.prototype=Object.create(F),E},e.awrap=function(E){return{__await:E}},L(S.prototype),c(S.prototype,a,function(){return this}),e.AsyncIterator=S,e.async=function(E,b,_,O,j){j===void 0&&(j=Promise);var P=new S(l(E,b,_,O),j);return e.isGeneratorFunction(b)?P:P.next().then(function(U){return U.done?U.value:P.next()})},L(F),c(F,u,"Generator"),c(F,s,function(){return this}),c(F,"toString",function(){return"[object Generator]"}),e.keys=function(E){var b=Object(E),_=[];for(var O in b)_.push(O);return _.reverse(),function j(){for(;_.length;){var P=_.pop();if(P in b)return j.value=P,j.done=!1,j}return j.done=!0,j}},e.values=M,K.prototype={constructor:K,reset:function(b){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(q),!b)for(var _ in this)_.charAt(0)==="t"&&n.call(this,_)&&!isNaN(+_.slice(1))&&(this[_]=t)},stop:function(){this.done=!0;var b=this.tryEntries[0].completion;if(b.type==="throw")throw b.arg;return this.rval},dispatchException:function(b){if(this.done)throw b;var _=this;function O(oe,se){return U.type="throw",U.arg=b,_.next=oe,se&&(_.method="next",_.arg=t),!!se}for(var j=this.tryEntries.length-1;j>=0;--j){var P=this.tryEntries[j],U=P.completion;if(P.tryLoc==="root")return O("end");if(P.tryLoc<=this.prev){var T=n.call(P,"catchLoc"),N=n.call(P,"finallyLoc");if(T&&N){if(this.prev<P.catchLoc)return O(P.catchLoc,!0);if(this.prev<P.finallyLoc)return O(P.finallyLoc)}else if(T){if(this.prev<P.catchLoc)return O(P.catchLoc,!0)}else{if(!N)throw Error("try statement without catch or finally");if(this.prev<P.finallyLoc)return O(P.finallyLoc)}}}},abrupt:function(b,_){for(var O=this.tryEntries.length-1;O>=0;--O){var j=this.tryEntries[O];if(j.tryLoc<=this.prev&&n.call(j,"finallyLoc")&&this.prev<j.finallyLoc){var P=j;break}}P&&(b==="break"||b==="continue")&&P.tryLoc<=_&&_<=P.finallyLoc&&(P=null);var U=P?P.completion:{};return U.type=b,U.arg=_,P?(this.method="next",this.next=P.finallyLoc,g):this.complete(U)},complete:function(b,_){if(b.type==="throw")throw b.arg;return b.type==="break"||b.type==="continue"?this.next=b.arg:b.type==="return"?(this.rval=this.arg=b.arg,this.method="return",this.next="end"):b.type==="normal"&&_&&(this.next=_),g},finish:function(b){for(var _=this.tryEntries.length-1;_>=0;--_){var O=this.tryEntries[_];if(O.finallyLoc===b)return this.complete(O.completion,O.afterLoc),q(O),g}},catch:function(b){for(var _=this.tryEntries.length-1;_>=0;--_){var O=this.tryEntries[_];if(O.tryLoc===b){var j=O.completion;if(j.type==="throw"){var P=j.arg;q(O)}return P}}throw Error("illegal catch attempt")},delegateYield:function(b,_,O){return this.delegate={iterator:M(b),resultName:_,nextLoc:O},this.method==="next"&&(this.arg=t),g}},e}function C7(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function c1(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,x7(n.key),n)}}function S7(t,e,r){return e&&c1(t.prototype,e),r&&c1(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function x7(t){var e=F7(t,"string");return qi(e)=="symbol"?e:e+""}function F7(t,e){if(qi(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(qi(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function l1(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(c){r(c);return}a.done?e(u):Promise.resolve(u).then(n,i)}function O7(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function s(u){l1(o,n,i,s,a,"next",u)}function a(u){l1(o,n,i,s,a,"throw",u)}s(void 0)})}}function A7(t){return uy.apply(this,arguments)}function uy(){return uy=O7(ay().mark(function t(e){var r,n,i,o,s,a,u;return ay().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return n=e.path.toString(),l.next=3,f1.promises.stat(n);case 3:return i=l.sent,o=i.size,s=(r=e.start)!==null&&r!==void 0?r:0,a=Number.isFinite(e.end)?e.end+1:o,u=a-s,l.abrupt("return",new k7(e,n,u));case 9:case"end":return l.stop()}},t)})),uy.apply(this,arguments)}var k7=function(){function t(e,r,n){C7(this,t),this._stream=e,this._path=r,this.size=n}return S7(t,[{key:"slice",value:function(r,n){var i,o=(i=this._stream.start)!==null&&i!==void 0?i:0,s=(0,f1.createReadStream)(this._path,{start:o+r,end:o+n-1,autoClose:!0});s.size=Math.min(n-r,this.size);var a=s.size>=this.size;return Promise.resolve({value:s,done:a})}},{key:"close",value:function(){this._stream.destroy()}}])}()});var fy=y(mf=>{"use strict";Object.defineProperty(mf,"__esModule",{value:!0});mf.default=void 0;function Mi(t){"@babel/helpers - typeof";return Mi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Mi(t)}function Au(){"use strict";Au=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(E,b,_){E[b]=_.value},o=typeof Symbol=="function"?Symbol:{},s=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function c(E,b,_){return Object.defineProperty(E,b,{value:_,enumerable:!0,configurable:!0,writable:!0}),E[b]}try{c({},"")}catch{c=function(_,O,j){return _[O]=j}}function l(E,b,_,O){var j=b&&b.prototype instanceof w?b:w,P=Object.create(j.prototype),U=new K(O||[]);return i(P,"_invoke",{value:I(E,_,U)}),P}function f(E,b,_){try{return{type:"normal",arg:E.call(b,_)}}catch(O){return{type:"throw",arg:O}}}e.wrap=l;var h="suspendedStart",d="suspendedYield",p="executing",v="completed",g={};function w(){}function x(){}function D(){}var C={};c(C,s,function(){return this});var k=Object.getPrototypeOf,$=k&&k(k(M([])));$&&$!==r&&n.call($,s)&&(C=$);var F=D.prototype=w.prototype=Object.create(C);function L(E){["next","throw","return"].forEach(function(b){c(E,b,function(_){return this._invoke(b,_)})})}function S(E,b){function _(j,P,U,T){var N=f(E[j],E,P);if(N.type!=="throw"){var oe=N.arg,se=oe.value;return se&&Mi(se)=="object"&&n.call(se,"__await")?b.resolve(se.__await).then(function(ve){_("next",ve,U,T)},function(ve){_("throw",ve,U,T)}):b.resolve(se).then(function(ve){oe.value=ve,U(oe)},function(ve){return _("throw",ve,U,T)})}T(N.arg)}var O;i(this,"_invoke",{value:function(P,U){function T(){return new b(function(N,oe){_(P,U,N,oe)})}return O=O?O.then(T,T):T()}})}function I(E,b,_){var O=h;return function(j,P){if(O===p)throw Error("Generator is already running");if(O===v){if(j==="throw")throw P;return{value:t,done:!0}}for(_.method=j,_.arg=P;;){var U=_.delegate;if(U){var T=R(U,_);if(T){if(T===g)continue;return T}}if(_.method==="next")_.sent=_._sent=_.arg;else if(_.method==="throw"){if(O===h)throw O=v,_.arg;_.dispatchException(_.arg)}else _.method==="return"&&_.abrupt("return",_.arg);O=p;var N=f(E,b,_);if(N.type==="normal"){if(O=_.done?v:d,N.arg===g)continue;return{value:N.arg,done:_.done}}N.type==="throw"&&(O=v,_.method="throw",_.arg=N.arg)}}}function R(E,b){var _=b.method,O=E.iterator[_];if(O===t)return b.delegate=null,_==="throw"&&E.iterator.return&&(b.method="return",b.arg=t,R(E,b),b.method==="throw")||_!=="return"&&(b.method="throw",b.arg=new TypeError("The iterator does not provide a '"+_+"' method")),g;var j=f(O,E.iterator,b.arg);if(j.type==="throw")return b.method="throw",b.arg=j.arg,b.delegate=null,g;var P=j.arg;return P?P.done?(b[E.resultName]=P.value,b.next=E.nextLoc,b.method!=="return"&&(b.method="next",b.arg=t),b.delegate=null,g):P:(b.method="throw",b.arg=new TypeError("iterator result is not an object"),b.delegate=null,g)}function B(E){var b={tryLoc:E[0]};1 in E&&(b.catchLoc=E[1]),2 in E&&(b.finallyLoc=E[2],b.afterLoc=E[3]),this.tryEntries.push(b)}function q(E){var b=E.completion||{};b.type="normal",delete b.arg,E.completion=b}function K(E){this.tryEntries=[{tryLoc:"root"}],E.forEach(B,this),this.reset(!0)}function M(E){if(E||E===""){var b=E[s];if(b)return b.call(E);if(typeof E.next=="function")return E;if(!isNaN(E.length)){var _=-1,O=function j(){for(;++_<E.length;)if(n.call(E,_))return j.value=E[_],j.done=!1,j;return j.value=t,j.done=!0,j};return O.next=O}}throw new TypeError(Mi(E)+" is not iterable")}return x.prototype=D,i(F,"constructor",{value:D,configurable:!0}),i(D,"constructor",{value:x,configurable:!0}),x.displayName=c(D,u,"GeneratorFunction"),e.isGeneratorFunction=function(E){var b=typeof E=="function"&&E.constructor;return!!b&&(b===x||(b.displayName||b.name)==="GeneratorFunction")},e.mark=function(E){return Object.setPrototypeOf?Object.setPrototypeOf(E,D):(E.__proto__=D,c(E,u,"GeneratorFunction")),E.prototype=Object.create(F),E},e.awrap=function(E){return{__await:E}},L(S.prototype),c(S.prototype,a,function(){return this}),e.AsyncIterator=S,e.async=function(E,b,_,O,j){j===void 0&&(j=Promise);var P=new S(l(E,b,_,O),j);return e.isGeneratorFunction(b)?P:P.next().then(function(U){return U.done?U.value:P.next()})},L(F),c(F,u,"Generator"),c(F,s,function(){return this}),c(F,"toString",function(){return"[object Generator]"}),e.keys=function(E){var b=Object(E),_=[];for(var O in b)_.push(O);return _.reverse(),function j(){for(;_.length;){var P=_.pop();if(P in b)return j.value=P,j.done=!1,j}return j.done=!0,j}},e.values=M,K.prototype={constructor:K,reset:function(b){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(q),!b)for(var _ in this)_.charAt(0)==="t"&&n.call(this,_)&&!isNaN(+_.slice(1))&&(this[_]=t)},stop:function(){this.done=!0;var b=this.tryEntries[0].completion;if(b.type==="throw")throw b.arg;return this.rval},dispatchException:function(b){if(this.done)throw b;var _=this;function O(oe,se){return U.type="throw",U.arg=b,_.next=oe,se&&(_.method="next",_.arg=t),!!se}for(var j=this.tryEntries.length-1;j>=0;--j){var P=this.tryEntries[j],U=P.completion;if(P.tryLoc==="root")return O("end");if(P.tryLoc<=this.prev){var T=n.call(P,"catchLoc"),N=n.call(P,"finallyLoc");if(T&&N){if(this.prev<P.catchLoc)return O(P.catchLoc,!0);if(this.prev<P.finallyLoc)return O(P.finallyLoc)}else if(T){if(this.prev<P.catchLoc)return O(P.catchLoc,!0)}else{if(!N)throw Error("try statement without catch or finally");if(this.prev<P.finallyLoc)return O(P.finallyLoc)}}}},abrupt:function(b,_){for(var O=this.tryEntries.length-1;O>=0;--O){var j=this.tryEntries[O];if(j.tryLoc<=this.prev&&n.call(j,"finallyLoc")&&this.prev<j.finallyLoc){var P=j;break}}P&&(b==="break"||b==="continue")&&P.tryLoc<=_&&_<=P.finallyLoc&&(P=null);var U=P?P.completion:{};return U.type=b,U.arg=_,P?(this.method="next",this.next=P.finallyLoc,g):this.complete(U)},complete:function(b,_){if(b.type==="throw")throw b.arg;return b.type==="break"||b.type==="continue"?this.next=b.arg:b.type==="return"?(this.rval=this.arg=b.arg,this.method="return",this.next="end"):b.type==="normal"&&_&&(this.next=_),g},finish:function(b){for(var _=this.tryEntries.length-1;_>=0;--_){var O=this.tryEntries[_];if(O.finallyLoc===b)return this.complete(O.completion,O.afterLoc),q(O),g}},catch:function(b){for(var _=this.tryEntries.length-1;_>=0;--_){var O=this.tryEntries[_];if(O.tryLoc===b){var j=O.completion;if(j.type==="throw"){var P=j.arg;q(O)}return P}}throw Error("illegal catch attempt")},delegateYield:function(b,_,O){return this.delegate={iterator:M(b),resultName:_,nextLoc:O},this.method==="next"&&(this.arg=t),g}},e}function T7(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function h1(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,R7(n.key),n)}}function P7(t,e,r){return e&&h1(t.prototype,e),r&&h1(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function R7(t){var e=$7(t,"string");return Mi(e)=="symbol"?e:e+""}function $7(t,e){if(Mi(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Mi(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function p1(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(c){r(c);return}a.done?e(u):Promise.resolve(u).then(n,i)}function m1(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function s(u){p1(o,n,i,s,a,"next",u)}function a(u){p1(o,n,i,s,a,"throw",u)}s(void 0)})}}function I7(t,e){return ly.apply(this,arguments)}function ly(){return ly=m1(Au().mark(function t(e,r){return Au().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return i.abrupt("return",new Promise(function(o,s){var a=function(l){e.off("readable",u),s(l)},u=function c(){var l=e.read(r);l!==null&&(e.off("error",a),e.off("readable",c),o(l))};e.once("error",a),e.on("readable",u)}));case 1:case"end":return i.stop()}},t)})),ly.apply(this,arguments)}var xde=mf.default=function(){function t(e){var r=this;T7(this,t),this._stream=e,this.size=null,this._buf=Buffer.alloc(0),this._bufPos=0,this._ended=!1,this._error=null,e.pause(),e.on("end",function(){r._ended=!0}),e.on("error",function(n){r._error=n})}return P7(t,[{key:"slice",value:function(){var e=m1(Au().mark(function n(i,o){var s,a,u,c,l;return Au().wrap(function(h){for(;;)switch(h.prev=h.next){case 0:if(!(i<this._bufPos)){h.next=2;break}throw new Error("cannot slice from position which we already seeked away");case 2:if(!(i>this._bufPos+this._buf.length)){h.next=4;break}throw new Error("slice start is outside of buffer (currently not implemented)");case 4:if(!this._error){h.next=6;break}throw this._error;case 6:if(i<this._bufPos+this._buf.length?(a=i-this._bufPos,u=Math.min(this._buf.length,o-this._bufPos),s=this._buf.slice(a,u)):s=Buffer.alloc(0),!this._ended){h.next=10;break}return s.size=s.length,h.abrupt("return",{value:s,done:!0});case 10:if(c=o-i,!(c>s.length)){h.next=16;break}return h.next=14,I7(this._stream,c-s.length);case 14:l=h.sent,s=Buffer.concat([s,l]);case 16:return this._buf=s,this._bufPos=i,s.size=s.length,h.abrupt("return",{value:s,done:this._ended});case 20:case"end":return h.stop()}},n,this)}));function r(n,i){return e.apply(this,arguments)}return r}()},{key:"close",value:function(){this._stream.destroy()}}])}()});var y1=y(yf=>{"use strict";Object.defineProperty(yf,"__esModule",{value:!0});yf.default=void 0;var j7=require("fs"),N7=gf(s1()),L7=gf(u1()),B7=gf(d1()),q7=gf(fy());function gf(t){return t&&t.__esModule?t:{default:t}}function ku(t){"@babel/helpers - typeof";return ku=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ku(t)}function M7(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function g1(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,V7(n.key),n)}}function U7(t,e,r){return e&&g1(t.prototype,e),r&&g1(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function V7(t){var e=H7(t,"string");return ku(e)=="symbol"?e:e+""}function H7(t,e){if(ku(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(ku(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Ode=yf.default=function(){function t(){M7(this,t)}return U7(t,[{key:"openFile",value:function(r,n){return Buffer.isBuffer(r)?Promise.resolve(new L7.default(r)):r instanceof j7.ReadStream&&r.path!=null?(0,B7.default)(r):N7.default.readable(r)?(n=Number(n),Number.isFinite(n)?Promise.resolve(new q7.default(r)):Promise.reject(new Error("cannot create source for stream without a finite value for the `chunkSize` option; specify a chunkSize to control the memory consumption"))):Promise.reject(new Error("source object may only be an instance of Buffer or Readable in this environment"))}}])}()});var w1=y(dy=>{"use strict";Object.defineProperty(dy,"__esModule",{value:!0});dy.default=W7;var z7=require("crypto"),D1=b1(require("fs")),G7=b1(require("path"));function v1(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,r=new WeakMap;return(v1=function(n){return n?r:e})(t)}function b1(t,e){if(!e&&t&&t.__esModule)return t;if(t===null||typeof t!="object"&&typeof t!="function")return{default:t};var r=v1(e);if(r&&r.has(t))return r.get(t);var n={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in t)if(o!=="default"&&{}.hasOwnProperty.call(t,o)){var s=i?Object.getOwnPropertyDescriptor(t,o):null;s&&(s.get||s.set)?Object.defineProperty(n,o,s):n[o]=t[o]}return n.default=t,r&&r.set(t,n),n}function W7(t,e){if(Buffer.isBuffer(t)){var r=65536,n=t.slice(0,Math.min(r,t.length)),i=(0,z7.createHash)("md5").update(n).digest("hex"),o=["node-buffer",i,t.length,e.endpoint].join("-");return Promise.resolve(o)}return t instanceof D1.ReadStream&&t.path!=null?new Promise(function(s,a){var u=G7.resolve(t.path);D1.stat(t.path,function(c,l){if(c){a(c);return}var f=["node-file",u,l.size,l.mtime.getTime(),e.endpoint].join("-");s(f)})}):Promise.resolve(null)}});var x1=y((Tde,S1)=>{var C1="Expected a function",_1=NaN,K7="[object Symbol]",Y7=/^\s+|\s+$/g,J7=/^[-+]0x[0-9a-f]+$/i,X7=/^0b[01]+$/i,Z7=/^0o[0-7]+$/i,Q7=parseInt,eV=typeof global=="object"&&global&&global.Object===Object&&global,tV=typeof self=="object"&&self&&self.Object===Object&&self,rV=eV||tV||Function("return this")(),nV=Object.prototype,iV=nV.toString,oV=Math.max,sV=Math.min,hy=function(){return rV.Date.now()};function aV(t,e,r){var n,i,o,s,a,u,c=0,l=!1,f=!1,h=!0;if(typeof t!="function")throw new TypeError(C1);e=E1(e)||0,Df(r)&&(l=!!r.leading,f="maxWait"in r,o=f?oV(E1(r.maxWait)||0,e):o,h="trailing"in r?!!r.trailing:h);function d($){var F=n,L=i;return n=i=void 0,c=$,s=t.apply(L,F),s}function p($){return c=$,a=setTimeout(w,e),l?d($):s}function v($){var F=$-u,L=$-c,S=e-F;return f?sV(S,o-L):S}function g($){var F=$-u,L=$-c;return u===void 0||F>=e||F<0||f&&L>=o}function w(){var $=hy();if(g($))return x($);a=setTimeout(w,v($))}function x($){return a=void 0,h&&n?d($):(n=i=void 0,s)}function D(){a!==void 0&&clearTimeout(a),c=0,n=u=i=a=void 0}function C(){return a===void 0?s:x(hy())}function k(){var $=hy(),F=g($);if(n=arguments,i=this,u=$,F){if(a===void 0)return p(u);if(f)return a=setTimeout(w,e),d(u)}return a===void 0&&(a=setTimeout(w,e)),s}return k.cancel=D,k.flush=C,k}function uV(t,e,r){var n=!0,i=!0;if(typeof t!="function")throw new TypeError(C1);return Df(r)&&(n="leading"in r?!!r.leading:n,i="trailing"in r?!!r.trailing:i),aV(t,e,{leading:n,maxWait:e,trailing:i})}function Df(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function cV(t){return!!t&&typeof t=="object"}function lV(t){return typeof t=="symbol"||cV(t)&&iV.call(t)==K7}function E1(t){if(typeof t=="number")return t;if(lV(t))return _1;if(Df(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=Df(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=t.replace(Y7,"");var r=X7.test(t);return r||Z7.test(t)?Q7(t.slice(2),r?2:8):J7.test(t)?_1:+t}S1.exports=uV});var I1=y(_f=>{"use strict";Object.defineProperty(_f,"__esModule",{value:!0});_f.default=void 0;var fV=P1(require("http")),dV=P1(require("https")),A1=require("stream"),hV=require("url"),k1=pV(x1());function pV(t){return t&&t.__esModule?t:{default:t}}function T1(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,r=new WeakMap;return(T1=function(n){return n?r:e})(t)}function P1(t,e){if(!e&&t&&t.__esModule)return t;if(t===null||typeof t!="object"&&typeof t!="function")return{default:t};var r=T1(e);if(r&&r.has(t))return r.get(t);var n={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in t)if(o!=="default"&&{}.hasOwnProperty.call(t,o)){var s=i?Object.getOwnPropertyDescriptor(t,o):null;s&&(s.get||s.set)?Object.defineProperty(n,o,s):n[o]=t[o]}return n.default=t,r&&r.set(t,n),n}function mV(t,e,r){return e=vf(e),gV(t,R1()?Reflect.construct(e,r||[],vf(t).constructor):e.apply(t,r))}function gV(t,e){if(e&&(ps(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return yV(t)}function yV(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function R1(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(R1=function(){return!!t})()}function vf(t){return vf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},vf(t)}function DV(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&py(t,e)}function py(t,e){return py=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},py(t,e)}function F1(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Tu(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?F1(Object(r),!0).forEach(function(n){vV(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):F1(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function vV(t,e,r){return e=$1(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ps(t){"@babel/helpers - typeof";return ps=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ps(t)}function bf(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function O1(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,$1(n.key),n)}}function wf(t,e,r){return e&&O1(t.prototype,e),r&&O1(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function $1(t){var e=bV(t,"string");return ps(e)=="symbol"?e:e+""}function bV(t,e){if(ps(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(ps(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Pde=_f.default=function(){function t(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};bf(this,t),this._requestOptions=e}return wf(t,[{key:"createRequest",value:function(r,n){return new wV(r,n,this._requestOptions)}},{key:"getName",value:function(){return"NodeHttpStack"}}])}(),wV=function(){function t(e,r,n){bf(this,t),this._method=e,this._url=r,this._headers={},this._request=null,this._progressHandler=function(){},this._requestOptions=n||{}}return wf(t,[{key:"getMethod",value:function(){return this._method}},{key:"getURL",value:function(){return this._url}},{key:"setHeader",value:function(r,n){this._headers[r]=n}},{key:"getHeader",value:function(r){return this._headers[r]}},{key:"setProgressHandler",value:function(r){this._progressHandler=r}},{key:"send",value:function(){var r=this,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return new Promise(function(i,o){var s=Tu(Tu(Tu({},(0,hV.parse)(r._url)),r._requestOptions),{},{method:r._method,headers:Tu(Tu({},r._requestOptions.headers||{}),r._headers)});n!=null&&n.size&&(s.headers["Content-Length"]=n.size);var a=s.protocol==="https:"?dV:fV;r._request=a.request(s);var u=r._request;u.on("response",function(c){var l=[];c.on("data",function(f){l.push(f)}),c.on("end",function(){var f=Buffer.concat(l).toString("utf8");i(new _V(c,f))})}),u.on("error",function(c){o(c)}),n instanceof A1.Readable?n.pipe(new EV(r._progressHandler)).pipe(u):n instanceof Uint8Array?CV(u,n,r._progressHandler):u.end(n)})}},{key:"abort",value:function(){return this._request!==null&&this._request.abort(),Promise.resolve()}},{key:"getUnderlyingObject",value:function(){return this._request}}])}(),_V=function(){function t(e,r){bf(this,t),this._response=e,this._body=r}return wf(t,[{key:"getStatus",value:function(){return this._response.statusCode}},{key:"getHeader",value:function(r){return this._response.headers[r.toLowerCase()]}},{key:"getBody",value:function(){return this._body}},{key:"getUnderlyingObject",value:function(){return this._response}}])}(),EV=function(t){function e(r){var n;return bf(this,e),n=mV(this,e),n._onprogress=(0,k1.default)(r,100,{leading:!0,trailing:!1}),n._position=0,n}return DV(e,t),wf(e,[{key:"_transform",value:function(n,i,o){this._position+=n.length,this._onprogress(this._position),o(null,n)}}])}(A1.Transform),CV=function(e,r,n){n=(0,k1.default)(n,100,{leading:!0,trailing:!1});var i=0;function o(){var s=Math.min(e.writableHighWaterMark,r.length-i),a=r.subarray(i,i+s);i+=a.length;var u=e.write(a);u?i<r.length?o():e.end():(e.once("drain",o),n(i))}o()}});var j1=y(my=>{"use strict";my.expectReceive=function(t,e,r){var n;r.root(t,e,r),n=this.message,t.hasOwnProperty("expected")&&(n+=" Expected "+t.expected+"."),t.hasOwnProperty("received")&&(n+=" Received: "+t.received+"."),this.message=n};my.root=function(t,e,r){var n=this,i,o={stackLength:Error.stackTraceLimit,rootOnly:!0},s="",a=Error.stackTraceLimit,u;function c(){u[0]=n.toString(),n.stack=u.join(`
30
+ `,e=e.substr(s)}try{o=JSON.parse(e)}catch{return zr.red("Error:")+" Not valid JSON!"}return i+=Cu.render(o,r,n),i}});var Yg=y(of=>{"use strict";Object.defineProperty(of,"__esModule",{value:!0});of.default=void 0;function fs(t){"@babel/helpers - typeof";return fs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},fs(t)}function SS(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,T9(n.key),n)}}function k9(t,e,r){return e&&SS(t.prototype,e),r&&SS(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function T9(t){var e=P9(t,"string");return fs(e)=="symbol"?e:e+""}function P9(t,e){if(fs(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(fs(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function R9(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function $9(t,e,r){return e=xu(e),I9(t,Kg()?Reflect.construct(e,r||[],xu(t).constructor):e.apply(t,r))}function I9(t,e){if(e&&(fs(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return j9(t)}function j9(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function N9(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Su(t,e)}function Wg(t){var e=typeof Map=="function"?new Map:void 0;return Wg=function(n){if(n===null||!B9(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(typeof e<"u"){if(e.has(n))return e.get(n);e.set(n,i)}function i(){return L9(n,arguments,xu(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),Su(i,n)},Wg(t)}function L9(t,e,r){if(Kg())return Reflect.construct.apply(null,arguments);var n=[null];n.push.apply(n,e);var i=new(t.bind.apply(t,n));return r&&Su(i,r.prototype),i}function Kg(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Kg=function(){return!!t})()}function B9(t){try{return Function.toString.call(t).indexOf("[native code]")!==-1}catch{return typeof t=="function"}}function Su(t,e){return Su=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Su(t,e)}function xu(t){return xu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},xu(t)}var q9=function(t){function e(r){var n,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;if(R9(this,e),n=$9(this,e,[r]),n.originalRequest=o,n.originalResponse=s,n.causingError=i,i!=null&&(r+=", caused by ".concat(i.toString())),o!=null){var a=o.getHeader("X-Request-ID")||"n/a",u=o.getMethod(),c=o.getURL(),l=s?s.getStatus():"n/a",f=s?s.getBody()||"":"n/a";r+=", originated from request (method: ".concat(u,", url: ").concat(c,", response code: ").concat(l,", response text: ").concat(f,", request id: ").concat(a,")")}return n.message=r,n}return N9(e,t),k9(e)}(Wg(Error)),fde=of.default=q9});var Jg=y(sf=>{"use strict";Object.defineProperty(sf,"__esModule",{value:!0});sf.enableDebugLog=M9;sf.log=U9;var xS=!1;function M9(){xS=!0}function U9(t){xS&&console.log(t)}});var OS=y(af=>{"use strict";Object.defineProperty(af,"__esModule",{value:!0});af.default=void 0;function Fu(t){"@babel/helpers - typeof";return Fu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Fu(t)}function V9(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function FS(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,z9(n.key),n)}}function H9(t,e,r){return e&&FS(t.prototype,e),r&&FS(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function z9(t){var e=G9(t,"string");return Fu(e)=="symbol"?e:e+""}function G9(t,e){if(Fu(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Fu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var pde=af.default=function(){function t(){V9(this,t)}return H9(t,[{key:"listAllUploads",value:function(){return Promise.resolve([])}},{key:"findUploadsByFingerprint",value:function(r){return Promise.resolve([])}},{key:"removeUpload",value:function(r){return Promise.resolve()}},{key:"addUpload",value:function(r,n){return Promise.resolve(null)}}])}()});var AS=y((Xg,Zg)=>{(function(t,e){typeof Xg=="object"&&typeof Zg<"u"?Zg.exports=e():typeof define=="function"&&define.amd?define(e):function(){var r=t.Base64,n=e();n.noConflict=function(){return t.Base64=r,n},t.Meteor&&(Base64=n),t.Base64=n}()})(typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:Xg,function(){"use strict";var t="3.7.7",e=t,r=typeof Buffer=="function",n=typeof TextDecoder=="function"?new TextDecoder:void 0,i=typeof TextEncoder=="function"?new TextEncoder:void 0,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",s=Array.prototype.slice.call(o),a=function(T){var N={};return T.forEach(function(oe,se){return N[oe]=se}),N}(s),u=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,c=String.fromCharCode.bind(String),l=typeof Uint8Array.from=="function"?Uint8Array.from.bind(Uint8Array):function(T){return new Uint8Array(Array.prototype.slice.call(T,0))},f=function(T){return T.replace(/=/g,"").replace(/[+\/]/g,function(N){return N=="+"?"-":"_"})},h=function(T){return T.replace(/[^A-Za-z0-9\+\/]/g,"")},d=function(T){for(var N,oe,se,ve,pn="",wp=T.length%3,el=0;el<T.length;){if((oe=T.charCodeAt(el++))>255||(se=T.charCodeAt(el++))>255||(ve=T.charCodeAt(el++))>255)throw new TypeError("invalid character found");N=oe<<16|se<<8|ve,pn+=s[N>>18&63]+s[N>>12&63]+s[N>>6&63]+s[N&63]}return wp?pn.slice(0,wp-3)+"===".substring(wp):pn},p=typeof btoa=="function"?function(T){return btoa(T)}:r?function(T){return Buffer.from(T,"binary").toString("base64")}:d,v=r?function(T){return Buffer.from(T).toString("base64")}:function(T){for(var N=4096,oe=[],se=0,ve=T.length;se<ve;se+=N)oe.push(c.apply(null,T.subarray(se,se+N)));return p(oe.join(""))},g=function(T,N){return N===void 0&&(N=!1),N?f(v(T)):v(T)},w=function(T){if(T.length<2){var N=T.charCodeAt(0);return N<128?T:N<2048?c(192|N>>>6)+c(128|N&63):c(224|N>>>12&15)+c(128|N>>>6&63)+c(128|N&63)}else{var N=65536+(T.charCodeAt(0)-55296)*1024+(T.charCodeAt(1)-56320);return c(240|N>>>18&7)+c(128|N>>>12&63)+c(128|N>>>6&63)+c(128|N&63)}},x=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,D=function(T){return T.replace(x,w)},C=r?function(T){return Buffer.from(T,"utf8").toString("base64")}:i?function(T){return v(i.encode(T))}:function(T){return p(D(T))},k=function(T,N){return N===void 0&&(N=!1),N?f(C(T)):C(T)},$=function(T){return k(T,!0)},F=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,L=function(T){switch(T.length){case 4:var N=(7&T.charCodeAt(0))<<18|(63&T.charCodeAt(1))<<12|(63&T.charCodeAt(2))<<6|63&T.charCodeAt(3),oe=N-65536;return c((oe>>>10)+55296)+c((oe&1023)+56320);case 3:return c((15&T.charCodeAt(0))<<12|(63&T.charCodeAt(1))<<6|63&T.charCodeAt(2));default:return c((31&T.charCodeAt(0))<<6|63&T.charCodeAt(1))}},S=function(T){return T.replace(F,L)},I=function(T){if(T=T.replace(/\s+/g,""),!u.test(T))throw new TypeError("malformed base64.");T+="==".slice(2-(T.length&3));for(var N,oe="",se,ve,pn=0;pn<T.length;)N=a[T.charAt(pn++)]<<18|a[T.charAt(pn++)]<<12|(se=a[T.charAt(pn++)])<<6|(ve=a[T.charAt(pn++)]),oe+=se===64?c(N>>16&255):ve===64?c(N>>16&255,N>>8&255):c(N>>16&255,N>>8&255,N&255);return oe},R=typeof atob=="function"?function(T){return atob(h(T))}:r?function(T){return Buffer.from(T,"base64").toString("binary")}:I,B=r?function(T){return l(Buffer.from(T,"base64"))}:function(T){return l(R(T).split("").map(function(N){return N.charCodeAt(0)}))},q=function(T){return B(M(T))},K=r?function(T){return Buffer.from(T,"base64").toString("utf8")}:n?function(T){return n.decode(B(T))}:function(T){return S(R(T))},M=function(T){return h(T.replace(/[-_]/g,function(N){return N=="-"?"+":"/"}))},E=function(T){return K(M(T))},b=function(T){if(typeof T!="string")return!1;var N=T.replace(/\s+/g,"").replace(/={0,2}$/,"");return!/[^\s0-9a-zA-Z\+/]/.test(N)||!/[^\s0-9a-zA-Z\-_]/.test(N)},_=function(T){return{value:T,enumerable:!1,writable:!0,configurable:!0}},O=function(){var T=function(N,oe){return Object.defineProperty(String.prototype,N,_(oe))};T("fromBase64",function(){return E(this)}),T("toBase64",function(N){return k(this,N)}),T("toBase64URI",function(){return k(this,!0)}),T("toBase64URL",function(){return k(this,!0)}),T("toUint8Array",function(){return q(this)})},j=function(){var T=function(N,oe){return Object.defineProperty(Uint8Array.prototype,N,_(oe))};T("toBase64",function(N){return g(this,N)}),T("toBase64URI",function(){return g(this,!0)}),T("toBase64URL",function(){return g(this,!0)})},P=function(){O(),j()},U={version:t,VERSION:e,atob:R,atobPolyfill:I,btoa:p,btoaPolyfill:d,fromBase64:E,toBase64:k,encode:k,encodeURI:$,encodeURL:$,utob:D,btou:S,decode:E,isValid:b,fromUint8Array:g,toUint8Array:q,extendString:O,extendUint8Array:j,extendBuiltins:P};return U.Base64={},Object.keys(U).forEach(function(T){return U.Base64[T]=U[T]}),U})});var TS=y((gde,kS)=>{"use strict";kS.exports=function(e,r){if(r=r.split(":")[0],e=+e,!e)return!1;switch(r){case"http":case"ws":return e!==80;case"https":case"wss":return e!==443;case"ftp":return e!==21;case"gopher":return e!==70;case"file":return!1}return e!==0}});var $S=y(Qg=>{"use strict";var W9=Object.prototype.hasOwnProperty,K9;function PS(t){try{return decodeURIComponent(t.replace(/\+/g," "))}catch{return null}}function RS(t){try{return encodeURIComponent(t)}catch{return null}}function Y9(t){for(var e=/([^=?#&]+)=?([^&]*)/g,r={},n;n=e.exec(t);){var i=PS(n[1]),o=PS(n[2]);i===null||o===null||i in r||(r[i]=o)}return r}function J9(t,e){e=e||"";var r=[],n,i;typeof e!="string"&&(e="?");for(i in t)if(W9.call(t,i)){if(n=t[i],!n&&(n===null||n===K9||isNaN(n))&&(n=""),i=RS(i),n=RS(n),i===null||n===null)continue;r.push(i+"="+n)}return r.length?e+r.join("&"):""}Qg.stringify=J9;Qg.parse=Y9});var US=y((Dde,MS)=>{"use strict";var jS=TS(),uf=$S(),X9=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,NS=/[\n\r\t]/g,Z9=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,LS=/:\d+$/,Q9=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i,e7=/^[a-zA-Z]:/;function ty(t){return(t||"").toString().replace(X9,"")}var ey=[["#","hash"],["?","query"],function(e,r){return Gr(r.protocol)?e.replace(/\\/g,"/"):e},["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d*)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],IS={hash:1,query:1};function BS(t){var e;typeof window<"u"?e=window:typeof global<"u"?e=global:typeof self<"u"?e=self:e={};var r=e.location||{};t=t||r;var n={},i=typeof t,o;if(t.protocol==="blob:")n=new Wr(unescape(t.pathname),{});else if(i==="string"){n=new Wr(t,{});for(o in IS)delete n[o]}else if(i==="object"){for(o in t)o in IS||(n[o]=t[o]);n.slashes===void 0&&(n.slashes=Z9.test(t.href))}return n}function Gr(t){return t==="file:"||t==="ftp:"||t==="http:"||t==="https:"||t==="ws:"||t==="wss:"}function qS(t,e){t=ty(t),t=t.replace(NS,""),e=e||{};var r=Q9.exec(t),n=r[1]?r[1].toLowerCase():"",i=!!r[2],o=!!r[3],s=0,a;return i?o?(a=r[2]+r[3]+r[4],s=r[2].length+r[3].length):(a=r[2]+r[4],s=r[2].length):o?(a=r[3]+r[4],s=r[3].length):a=r[4],n==="file:"?s>=2&&(a=a.slice(2)):Gr(n)?a=r[4]:n?i&&(a=a.slice(2)):s>=2&&Gr(e.protocol)&&(a=r[4]),{protocol:n,slashes:i||Gr(n),slashesCount:s,rest:a}}function t7(t,e){if(t==="")return e;for(var r=(e||"/").split("/").slice(0,-1).concat(t.split("/")),n=r.length,i=r[n-1],o=!1,s=0;n--;)r[n]==="."?r.splice(n,1):r[n]===".."?(r.splice(n,1),s++):s&&(n===0&&(o=!0),r.splice(n,1),s--);return o&&r.unshift(""),(i==="."||i==="..")&&r.push(""),r.join("/")}function Wr(t,e,r){if(t=ty(t),t=t.replace(NS,""),!(this instanceof Wr))return new Wr(t,e,r);var n,i,o,s,a,u,c=ey.slice(),l=typeof e,f=this,h=0;for(l!=="object"&&l!=="string"&&(r=e,e=null),r&&typeof r!="function"&&(r=uf.parse),e=BS(e),i=qS(t||"",e),n=!i.protocol&&!i.slashes,f.slashes=i.slashes||n&&e.slashes,f.protocol=i.protocol||e.protocol||"",t=i.rest,(i.protocol==="file:"&&(i.slashesCount!==2||e7.test(t))||!i.slashes&&(i.protocol||i.slashesCount<2||!Gr(f.protocol)))&&(c[3]=[/(.*)/,"pathname"]);h<c.length;h++){if(s=c[h],typeof s=="function"){t=s(t,f);continue}o=s[0],u=s[1],o!==o?f[u]=t:typeof o=="string"?(a=o==="@"?t.lastIndexOf(o):t.indexOf(o),~a&&(typeof s[2]=="number"?(f[u]=t.slice(0,a),t=t.slice(a+s[2])):(f[u]=t.slice(a),t=t.slice(0,a)))):(a=o.exec(t))&&(f[u]=a[1],t=t.slice(0,a.index)),f[u]=f[u]||n&&s[3]&&e[u]||"",s[4]&&(f[u]=f[u].toLowerCase())}r&&(f.query=r(f.query)),n&&e.slashes&&f.pathname.charAt(0)!=="/"&&(f.pathname!==""||e.pathname!=="")&&(f.pathname=t7(f.pathname,e.pathname)),f.pathname.charAt(0)!=="/"&&Gr(f.protocol)&&(f.pathname="/"+f.pathname),jS(f.port,f.protocol)||(f.host=f.hostname,f.port=""),f.username=f.password="",f.auth&&(a=f.auth.indexOf(":"),~a?(f.username=f.auth.slice(0,a),f.username=encodeURIComponent(decodeURIComponent(f.username)),f.password=f.auth.slice(a+1),f.password=encodeURIComponent(decodeURIComponent(f.password))):f.username=encodeURIComponent(decodeURIComponent(f.auth)),f.auth=f.password?f.username+":"+f.password:f.username),f.origin=f.protocol!=="file:"&&Gr(f.protocol)&&f.host?f.protocol+"//"+f.host:"null",f.href=f.toString()}function r7(t,e,r){var n=this;switch(t){case"query":typeof e=="string"&&e.length&&(e=(r||uf.parse)(e)),n[t]=e;break;case"port":n[t]=e,jS(e,n.protocol)?e&&(n.host=n.hostname+":"+e):(n.host=n.hostname,n[t]="");break;case"hostname":n[t]=e,n.port&&(e+=":"+n.port),n.host=e;break;case"host":n[t]=e,LS.test(e)?(e=e.split(":"),n.port=e.pop(),n.hostname=e.join(":")):(n.hostname=e,n.port="");break;case"protocol":n.protocol=e.toLowerCase(),n.slashes=!r;break;case"pathname":case"hash":if(e){var i=t==="pathname"?"/":"#";n[t]=e.charAt(0)!==i?i+e:e}else n[t]=e;break;case"username":case"password":n[t]=encodeURIComponent(e);break;case"auth":var o=e.indexOf(":");~o?(n.username=e.slice(0,o),n.username=encodeURIComponent(decodeURIComponent(n.username)),n.password=e.slice(o+1),n.password=encodeURIComponent(decodeURIComponent(n.password))):n.username=encodeURIComponent(decodeURIComponent(e))}for(var s=0;s<ey.length;s++){var a=ey[s];a[4]&&(n[a[1]]=n[a[1]].toLowerCase())}return n.auth=n.password?n.username+":"+n.password:n.username,n.origin=n.protocol!=="file:"&&Gr(n.protocol)&&n.host?n.protocol+"//"+n.host:"null",n.href=n.toString(),n}function n7(t){(!t||typeof t!="function")&&(t=uf.stringify);var e,r=this,n=r.host,i=r.protocol;i&&i.charAt(i.length-1)!==":"&&(i+=":");var o=i+(r.protocol&&r.slashes||Gr(r.protocol)?"//":"");return r.username?(o+=r.username,r.password&&(o+=":"+r.password),o+="@"):r.password?(o+=":"+r.password,o+="@"):r.protocol!=="file:"&&Gr(r.protocol)&&!n&&r.pathname!=="/"&&(o+="@"),(n[n.length-1]===":"||LS.test(r.hostname)&&!r.port)&&(n+=":"),o+=n+r.pathname,e=typeof r.query=="object"?t(r.query):r.query,e&&(o+=e.charAt(0)!=="?"?"?"+e:e),r.hash&&(o+=r.hash),o}Wr.prototype={set:r7,toString:n7};Wr.extractProtocol=qS;Wr.location=BS;Wr.trimLeft=ty;Wr.qs=uf;MS.exports=Wr});var VS=y(ry=>{"use strict";Object.defineProperty(ry,"__esModule",{value:!0});ry.default=i7;function i7(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var e=Math.random()*16|0,r=t==="x"?e:e&3|8;return r.toString(16)})}});var i1=y(ff=>{"use strict";Object.defineProperty(ff,"__esModule",{value:!0});ff.default=void 0;var o7=AS(),s7=sy(US()),cf=sy(Yg()),Ni=Jg(),a7=sy(VS());function sy(t){return t&&t.__esModule?t:{default:t}}function ny(){"use strict";ny=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(E,b,_){E[b]=_.value},o=typeof Symbol=="function"?Symbol:{},s=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function c(E,b,_){return Object.defineProperty(E,b,{value:_,enumerable:!0,configurable:!0,writable:!0}),E[b]}try{c({},"")}catch{c=function(_,O,j){return _[O]=j}}function l(E,b,_,O){var j=b&&b.prototype instanceof w?b:w,P=Object.create(j.prototype),U=new K(O||[]);return i(P,"_invoke",{value:I(E,_,U)}),P}function f(E,b,_){try{return{type:"normal",arg:E.call(b,_)}}catch(O){return{type:"throw",arg:O}}}e.wrap=l;var h="suspendedStart",d="suspendedYield",p="executing",v="completed",g={};function w(){}function x(){}function D(){}var C={};c(C,s,function(){return this});var k=Object.getPrototypeOf,$=k&&k(k(M([])));$&&$!==r&&n.call($,s)&&(C=$);var F=D.prototype=w.prototype=Object.create(C);function L(E){["next","throw","return"].forEach(function(b){c(E,b,function(_){return this._invoke(b,_)})})}function S(E,b){function _(j,P,U,T){var N=f(E[j],E,P);if(N.type!=="throw"){var oe=N.arg,se=oe.value;return se&&Li(se)=="object"&&n.call(se,"__await")?b.resolve(se.__await).then(function(ve){_("next",ve,U,T)},function(ve){_("throw",ve,U,T)}):b.resolve(se).then(function(ve){oe.value=ve,U(oe)},function(ve){return _("throw",ve,U,T)})}T(N.arg)}var O;i(this,"_invoke",{value:function(P,U){function T(){return new b(function(N,oe){_(P,U,N,oe)})}return O=O?O.then(T,T):T()}})}function I(E,b,_){var O=h;return function(j,P){if(O===p)throw Error("Generator is already running");if(O===v){if(j==="throw")throw P;return{value:t,done:!0}}for(_.method=j,_.arg=P;;){var U=_.delegate;if(U){var T=R(U,_);if(T){if(T===g)continue;return T}}if(_.method==="next")_.sent=_._sent=_.arg;else if(_.method==="throw"){if(O===h)throw O=v,_.arg;_.dispatchException(_.arg)}else _.method==="return"&&_.abrupt("return",_.arg);O=p;var N=f(E,b,_);if(N.type==="normal"){if(O=_.done?v:d,N.arg===g)continue;return{value:N.arg,done:_.done}}N.type==="throw"&&(O=v,_.method="throw",_.arg=N.arg)}}}function R(E,b){var _=b.method,O=E.iterator[_];if(O===t)return b.delegate=null,_==="throw"&&E.iterator.return&&(b.method="return",b.arg=t,R(E,b),b.method==="throw")||_!=="return"&&(b.method="throw",b.arg=new TypeError("The iterator does not provide a '"+_+"' method")),g;var j=f(O,E.iterator,b.arg);if(j.type==="throw")return b.method="throw",b.arg=j.arg,b.delegate=null,g;var P=j.arg;return P?P.done?(b[E.resultName]=P.value,b.next=E.nextLoc,b.method!=="return"&&(b.method="next",b.arg=t),b.delegate=null,g):P:(b.method="throw",b.arg=new TypeError("iterator result is not an object"),b.delegate=null,g)}function B(E){var b={tryLoc:E[0]};1 in E&&(b.catchLoc=E[1]),2 in E&&(b.finallyLoc=E[2],b.afterLoc=E[3]),this.tryEntries.push(b)}function q(E){var b=E.completion||{};b.type="normal",delete b.arg,E.completion=b}function K(E){this.tryEntries=[{tryLoc:"root"}],E.forEach(B,this),this.reset(!0)}function M(E){if(E||E===""){var b=E[s];if(b)return b.call(E);if(typeof E.next=="function")return E;if(!isNaN(E.length)){var _=-1,O=function j(){for(;++_<E.length;)if(n.call(E,_))return j.value=E[_],j.done=!1,j;return j.value=t,j.done=!0,j};return O.next=O}}throw new TypeError(Li(E)+" is not iterable")}return x.prototype=D,i(F,"constructor",{value:D,configurable:!0}),i(D,"constructor",{value:x,configurable:!0}),x.displayName=c(D,u,"GeneratorFunction"),e.isGeneratorFunction=function(E){var b=typeof E=="function"&&E.constructor;return!!b&&(b===x||(b.displayName||b.name)==="GeneratorFunction")},e.mark=function(E){return Object.setPrototypeOf?Object.setPrototypeOf(E,D):(E.__proto__=D,c(E,u,"GeneratorFunction")),E.prototype=Object.create(F),E},e.awrap=function(E){return{__await:E}},L(S.prototype),c(S.prototype,a,function(){return this}),e.AsyncIterator=S,e.async=function(E,b,_,O,j){j===void 0&&(j=Promise);var P=new S(l(E,b,_,O),j);return e.isGeneratorFunction(b)?P:P.next().then(function(U){return U.done?U.value:P.next()})},L(F),c(F,u,"Generator"),c(F,s,function(){return this}),c(F,"toString",function(){return"[object Generator]"}),e.keys=function(E){var b=Object(E),_=[];for(var O in b)_.push(O);return _.reverse(),function j(){for(;_.length;){var P=_.pop();if(P in b)return j.value=P,j.done=!1,j}return j.done=!0,j}},e.values=M,K.prototype={constructor:K,reset:function(b){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(q),!b)for(var _ in this)_.charAt(0)==="t"&&n.call(this,_)&&!isNaN(+_.slice(1))&&(this[_]=t)},stop:function(){this.done=!0;var b=this.tryEntries[0].completion;if(b.type==="throw")throw b.arg;return this.rval},dispatchException:function(b){if(this.done)throw b;var _=this;function O(oe,se){return U.type="throw",U.arg=b,_.next=oe,se&&(_.method="next",_.arg=t),!!se}for(var j=this.tryEntries.length-1;j>=0;--j){var P=this.tryEntries[j],U=P.completion;if(P.tryLoc==="root")return O("end");if(P.tryLoc<=this.prev){var T=n.call(P,"catchLoc"),N=n.call(P,"finallyLoc");if(T&&N){if(this.prev<P.catchLoc)return O(P.catchLoc,!0);if(this.prev<P.finallyLoc)return O(P.finallyLoc)}else if(T){if(this.prev<P.catchLoc)return O(P.catchLoc,!0)}else{if(!N)throw Error("try statement without catch or finally");if(this.prev<P.finallyLoc)return O(P.finallyLoc)}}}},abrupt:function(b,_){for(var O=this.tryEntries.length-1;O>=0;--O){var j=this.tryEntries[O];if(j.tryLoc<=this.prev&&n.call(j,"finallyLoc")&&this.prev<j.finallyLoc){var P=j;break}}P&&(b==="break"||b==="continue")&&P.tryLoc<=_&&_<=P.finallyLoc&&(P=null);var U=P?P.completion:{};return U.type=b,U.arg=_,P?(this.method="next",this.next=P.finallyLoc,g):this.complete(U)},complete:function(b,_){if(b.type==="throw")throw b.arg;return b.type==="break"||b.type==="continue"?this.next=b.arg:b.type==="return"?(this.rval=this.arg=b.arg,this.method="return",this.next="end"):b.type==="normal"&&_&&(this.next=_),g},finish:function(b){for(var _=this.tryEntries.length-1;_>=0;--_){var O=this.tryEntries[_];if(O.finallyLoc===b)return this.complete(O.completion,O.afterLoc),q(O),g}},catch:function(b){for(var _=this.tryEntries.length-1;_>=0;--_){var O=this.tryEntries[_];if(O.tryLoc===b){var j=O.completion;if(j.type==="throw"){var P=j.arg;q(O)}return P}}throw Error("illegal catch attempt")},delegateYield:function(b,_,O){return this.delegate={iterator:M(b),resultName:_,nextLoc:O},this.method==="next"&&(this.arg=t),g}},e}function HS(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(c){r(c);return}a.done?e(u):Promise.resolve(u).then(n,i)}function u7(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function s(u){HS(o,n,i,s,a,"next",u)}function a(u){HS(o,n,i,s,a,"throw",u)}s(void 0)})}}function QS(t,e){return f7(t)||l7(t,e)||e1(t,e)||c7()}function c7(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
31
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function l7(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,o,s,a=[],u=!0,c=!1;try{if(o=(r=r.call(t)).next,e===0){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=o.call(r)).done)&&(a.push(n.value),a.length!==e);u=!0);}catch(l){c=!0,i=l}finally{try{if(!u&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(c)throw i}}return a}}function f7(t){if(Array.isArray(t))return t}function Li(t){"@babel/helpers - typeof";return Li=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Li(t)}function d7(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=e1(t))||e&&t&&typeof t.length=="number"){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(c){throw c},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
32
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,s=!1,a;return{s:function(){r=r.call(t)},n:function(){var c=r.next();return o=c.done,c},e:function(c){s=!0,a=c},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(s)throw a}}}}function e1(t,e){if(t){if(typeof t=="string")return zS(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return zS(t,e)}}function zS(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function GS(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function ds(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?GS(Object(r),!0).forEach(function(n){h7(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):GS(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function h7(t,e,r){return e=t1(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function p7(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function WS(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,t1(n.key),n)}}function m7(t,e,r){return e&&WS(t.prototype,e),r&&WS(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function t1(t){var e=g7(t,"string");return Li(e)=="symbol"?e:e+""}function g7(t,e){if(Li(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Li(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var iy="tus-v1",lf="ietf-draft-03",y7={endpoint:null,uploadUrl:null,metadata:{},metadataForPartialUploads:{},fingerprint:null,uploadSize:null,onProgress:null,onChunkComplete:null,onSuccess:null,onError:null,onUploadUrlAvailable:null,overridePatchMethod:!1,headers:{},addRequestId:!1,onBeforeRequest:null,onAfterResponse:null,onShouldRetry:n1,chunkSize:Number.POSITIVE_INFINITY,retryDelays:[0,1e3,3e3,5e3],parallelUploads:1,parallelUploadBoundaries:null,storeFingerprintForResuming:!0,removeFingerprintOnSuccess:!1,uploadLengthDeferred:!1,uploadDataDuringCreation:!1,urlStorage:null,fileReader:null,httpStack:null,protocol:iy},r1=function(){function t(e,r){p7(this,t),"resume"in r&&console.log("tus: The `resume` option has been removed in tus-js-client v2. Please use the URL storage API instead."),this.options=r,this.options.chunkSize=Number(this.options.chunkSize),this._urlStorage=this.options.urlStorage,this.file=e,this.url=null,this._req=null,this._fingerprint=null,this._urlStorageKey=null,this._offset=null,this._aborted=!1,this._size=null,this._source=null,this._retryAttempt=0,this._retryTimeout=null,this._offsetBeforeRetry=0,this._parallelUploads=null,this._parallelUploadUrls=null}return m7(t,[{key:"findPreviousUploads",value:function(){var r=this;return this.options.fingerprint(this.file,this.options).then(function(n){return r._urlStorage.findUploadsByFingerprint(n)})}},{key:"resumeFromPreviousUpload",value:function(r){this.url=r.uploadUrl||null,this._parallelUploadUrls=r.parallelUploadUrls||null,this._urlStorageKey=r.urlStorageKey}},{key:"start",value:function(){var r=this,n=this.file;if(!n){this._emitError(new Error("tus: no file or stream to upload provided"));return}if(![iy,lf].includes(this.options.protocol)){this._emitError(new Error("tus: unsupported protocol ".concat(this.options.protocol)));return}if(!this.options.endpoint&&!this.options.uploadUrl&&!this.url){this._emitError(new Error("tus: neither an endpoint or an upload URL is provided"));return}var i=this.options.retryDelays;if(i!=null&&Object.prototype.toString.call(i)!=="[object Array]"){this._emitError(new Error("tus: the `retryDelays` option must either be an array or null"));return}if(this.options.parallelUploads>1)for(var o=0,s=["uploadUrl","uploadSize","uploadLengthDeferred"];o<s.length;o++){var a=s[o];if(this.options[a]){this._emitError(new Error("tus: cannot use the ".concat(a," option when parallelUploads is enabled")));return}}if(this.options.parallelUploadBoundaries){if(this.options.parallelUploads<=1){this._emitError(new Error("tus: cannot use the `parallelUploadBoundaries` option when `parallelUploads` is disabled"));return}if(this.options.parallelUploads!==this.options.parallelUploadBoundaries.length){this._emitError(new Error("tus: the `parallelUploadBoundaries` must have the same length as the value of `parallelUploads`"));return}}this.options.fingerprint(n,this.options).then(function(u){return u==null?(0,Ni.log)("No fingerprint was calculated meaning that the upload cannot be stored in the URL storage."):(0,Ni.log)("Calculated fingerprint: ".concat(u)),r._fingerprint=u,r._source?r._source:r.options.fileReader.openFile(n,r.options.chunkSize)}).then(function(u){if(r._source=u,r.options.uploadLengthDeferred)r._size=null;else if(r.options.uploadSize!=null){if(r._size=Number(r.options.uploadSize),Number.isNaN(r._size)){r._emitError(new Error("tus: cannot convert `uploadSize` option into a number"));return}}else if(r._size=r._source.size,r._size==null){r._emitError(new Error("tus: cannot automatically derive upload's size from input. Specify it manually using the `uploadSize` option or use the `uploadLengthDeferred` option"));return}r.options.parallelUploads>1||r._parallelUploadUrls!=null?r._startParallelUpload():r._startSingleUpload()}).catch(function(u){r._emitError(u)})}},{key:"_startParallelUpload",value:function(){var r,n=this,i=this._size,o=0;this._parallelUploads=[];var s=this._parallelUploadUrls!=null?this._parallelUploadUrls.length:this.options.parallelUploads,a=(r=this.options.parallelUploadBoundaries)!==null&&r!==void 0?r:v7(this._source.size,s);this._parallelUploadUrls&&a.forEach(function(l,f){l.uploadUrl=n._parallelUploadUrls[f]||null}),this._parallelUploadUrls=new Array(a.length);var u=a.map(function(l,f){var h=0;return n._source.slice(l.start,l.end).then(function(d){var p=d.value;return new Promise(function(v,g){var w=ds(ds({},n.options),{},{uploadUrl:l.uploadUrl||null,storeFingerprintForResuming:!1,removeFingerprintOnSuccess:!1,parallelUploads:1,parallelUploadBoundaries:null,metadata:n.options.metadataForPartialUploads,headers:ds(ds({},n.options.headers),{},{"Upload-Concat":"partial"}),onSuccess:v,onError:g,onProgress:function(C){o=o-h+C,h=C,n._emitProgress(o,i)},onUploadUrlAvailable:function(){n._parallelUploadUrls[f]=x.url,n._parallelUploadUrls.filter(function(C){return!!C}).length===a.length&&n._saveUploadInUrlStorage()}}),x=new t(p,w);x.start(),n._parallelUploads.push(x)})})}),c;Promise.all(u).then(function(){c=n._openRequest("POST",n.options.endpoint),c.setHeader("Upload-Concat","final;".concat(n._parallelUploadUrls.join(" ")));var l=KS(n.options.metadata);return l!==""&&c.setHeader("Upload-Metadata",l),n._sendRequest(c,null)}).then(function(l){if(!hs(l.getStatus(),200)){n._emitHttpError(c,l,"tus: unexpected response while creating upload");return}var f=l.getHeader("Location");if(f==null){n._emitHttpError(c,l,"tus: invalid or missing Location header");return}n.url=ZS(n.options.endpoint,f),(0,Ni.log)("Created upload at ".concat(n.url)),n._emitSuccess(l)}).catch(function(l){n._emitError(l)})}},{key:"_startSingleUpload",value:function(){if(this._aborted=!1,this.url!=null){(0,Ni.log)("Resuming upload from previous URL: ".concat(this.url)),this._resumeUpload();return}if(this.options.uploadUrl!=null){(0,Ni.log)("Resuming upload from provided URL: ".concat(this.options.uploadUrl)),this.url=this.options.uploadUrl,this._resumeUpload();return}(0,Ni.log)("Creating a new upload"),this._createUpload()}},{key:"abort",value:function(r){var n=this;if(this._parallelUploads!=null){var i=d7(this._parallelUploads),o;try{for(i.s();!(o=i.n()).done;){var s=o.value;s.abort(r)}}catch(a){i.e(a)}finally{i.f()}}return this._req!==null&&this._req.abort(),this._aborted=!0,this._retryTimeout!=null&&(clearTimeout(this._retryTimeout),this._retryTimeout=null),!r||this.url==null?Promise.resolve():t.terminate(this.url,this.options).then(function(){return n._removeFromUrlStorage()})}},{key:"_emitHttpError",value:function(r,n,i,o){this._emitError(new cf.default(i,o,r,n))}},{key:"_emitError",value:function(r){var n=this;if(!this._aborted){if(this.options.retryDelays!=null){var i=this._offset!=null&&this._offset>this._offsetBeforeRetry;if(i&&(this._retryAttempt=0),XS(r,this._retryAttempt,this.options)){var o=this.options.retryDelays[this._retryAttempt++];this._offsetBeforeRetry=this._offset,this._retryTimeout=setTimeout(function(){n.start()},o);return}}if(typeof this.options.onError=="function")this.options.onError(r);else throw r}}},{key:"_emitSuccess",value:function(r){this.options.removeFingerprintOnSuccess&&this._removeFromUrlStorage(),typeof this.options.onSuccess=="function"&&this.options.onSuccess({lastResponse:r})}},{key:"_emitProgress",value:function(r,n){typeof this.options.onProgress=="function"&&this.options.onProgress(r,n)}},{key:"_emitChunkComplete",value:function(r,n,i){typeof this.options.onChunkComplete=="function"&&this.options.onChunkComplete(r,n,i)}},{key:"_createUpload",value:function(){var r=this;if(!this.options.endpoint){this._emitError(new Error("tus: unable to create upload because no endpoint is provided"));return}var n=this._openRequest("POST",this.options.endpoint);this.options.uploadLengthDeferred?n.setHeader("Upload-Defer-Length","1"):n.setHeader("Upload-Length","".concat(this._size));var i=KS(this.options.metadata);i!==""&&n.setHeader("Upload-Metadata",i);var o;this.options.uploadDataDuringCreation&&!this.options.uploadLengthDeferred?(this._offset=0,o=this._addChunkToRequest(n)):(this.options.protocol===lf&&n.setHeader("Upload-Complete","?0"),o=this._sendRequest(n,null)),o.then(function(s){if(!hs(s.getStatus(),200)){r._emitHttpError(n,s,"tus: unexpected response while creating upload");return}var a=s.getHeader("Location");if(a==null){r._emitHttpError(n,s,"tus: invalid or missing Location header");return}if(r.url=ZS(r.options.endpoint,a),(0,Ni.log)("Created upload at ".concat(r.url)),typeof r.options.onUploadUrlAvailable=="function"&&r.options.onUploadUrlAvailable(),r._size===0){r._emitSuccess(s),r._source.close();return}r._saveUploadInUrlStorage().then(function(){r.options.uploadDataDuringCreation?r._handleUploadResponse(n,s):(r._offset=0,r._performUpload())})}).catch(function(s){r._emitHttpError(n,null,"tus: failed to create upload",s)})}},{key:"_resumeUpload",value:function(){var r=this,n=this._openRequest("HEAD",this.url),i=this._sendRequest(n,null);i.then(function(o){var s=o.getStatus();if(!hs(s,200)){if(s===423){r._emitHttpError(n,o,"tus: upload is currently locked; retry later");return}if(hs(s,400)&&r._removeFromUrlStorage(),!r.options.endpoint){r._emitHttpError(n,o,"tus: unable to resume upload (new upload cannot be created without an endpoint)");return}r.url=null,r._createUpload();return}var a=Number.parseInt(o.getHeader("Upload-Offset"),10);if(Number.isNaN(a)){r._emitHttpError(n,o,"tus: invalid or missing offset value");return}var u=Number.parseInt(o.getHeader("Upload-Length"),10);if(Number.isNaN(u)&&!r.options.uploadLengthDeferred&&r.options.protocol===iy){r._emitHttpError(n,o,"tus: invalid or missing length value");return}typeof r.options.onUploadUrlAvailable=="function"&&r.options.onUploadUrlAvailable(),r._saveUploadInUrlStorage().then(function(){if(a===u){r._emitProgress(u,u),r._emitSuccess(o);return}r._offset=a,r._performUpload()})}).catch(function(o){r._emitHttpError(n,null,"tus: failed to resume upload",o)})}},{key:"_performUpload",value:function(){var r=this;if(!this._aborted){var n;this.options.overridePatchMethod?(n=this._openRequest("POST",this.url),n.setHeader("X-HTTP-Method-Override","PATCH")):n=this._openRequest("PATCH",this.url),n.setHeader("Upload-Offset","".concat(this._offset));var i=this._addChunkToRequest(n);i.then(function(o){if(!hs(o.getStatus(),200)){r._emitHttpError(n,o,"tus: unexpected response while uploading chunk");return}r._handleUploadResponse(n,o)}).catch(function(o){r._aborted||r._emitHttpError(n,null,"tus: failed to upload chunk at offset ".concat(r._offset),o)})}}},{key:"_addChunkToRequest",value:function(r){var n=this,i=this._offset,o=this._offset+this.options.chunkSize;return r.setProgressHandler(function(s){n._emitProgress(i+s,n._size)}),r.setHeader("Content-Type","application/offset+octet-stream"),(o===Number.POSITIVE_INFINITY||o>this._size)&&!this.options.uploadLengthDeferred&&(o=this._size),this._source.slice(i,o).then(function(s){var a=s.value,u=s.done,c=a!=null&&a.size?a.size:0;n.options.uploadLengthDeferred&&u&&(n._size=n._offset+c,r.setHeader("Upload-Length","".concat(n._size)));var l=n._offset+c;return!n.options.uploadLengthDeferred&&u&&l!==n._size?Promise.reject(new Error("upload was configured with a size of ".concat(n._size," bytes, but the source is done after ").concat(l," bytes"))):a===null?n._sendRequest(r):(n.options.protocol===lf&&r.setHeader("Upload-Complete",u?"?1":"?0"),n._emitProgress(n._offset,n._size),n._sendRequest(r,a))})}},{key:"_handleUploadResponse",value:function(r,n){var i=Number.parseInt(n.getHeader("Upload-Offset"),10);if(Number.isNaN(i)){this._emitHttpError(r,n,"tus: invalid or missing offset value");return}if(this._emitProgress(i,this._size),this._emitChunkComplete(i-this._offset,i,this._size),this._offset=i,i===this._size){this._emitSuccess(n),this._source.close();return}this._performUpload()}},{key:"_openRequest",value:function(r,n){var i=YS(r,n,this.options);return this._req=i,i}},{key:"_removeFromUrlStorage",value:function(){var r=this;this._urlStorageKey&&(this._urlStorage.removeUpload(this._urlStorageKey).catch(function(n){r._emitError(n)}),this._urlStorageKey=null)}},{key:"_saveUploadInUrlStorage",value:function(){var r=this;if(!this.options.storeFingerprintForResuming||!this._fingerprint||this._urlStorageKey!==null)return Promise.resolve();var n={size:this._size,metadata:this.options.metadata,creationTime:new Date().toString()};return this._parallelUploads?n.parallelUploadUrls=this._parallelUploadUrls:n.uploadUrl=this.url,this._urlStorage.addUpload(this._fingerprint,n).then(function(i){r._urlStorageKey=i})}},{key:"_sendRequest",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return JS(r,n,this.options)}}],[{key:"terminate",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=YS("DELETE",r,n);return JS(i,null,n).then(function(o){if(o.getStatus()!==204)throw new cf.default("tus: unexpected response while terminating upload",null,i,o)}).catch(function(o){if(o instanceof cf.default||(o=new cf.default("tus: failed to terminate upload",o,i,null)),!XS(o,0,n))throw o;var s=n.retryDelays[0],a=n.retryDelays.slice(1),u=ds(ds({},n),{},{retryDelays:a});return new Promise(function(c){return setTimeout(c,s)}).then(function(){return t.terminate(r,u)})})}}])}();function KS(t){return Object.entries(t).map(function(e){var r=QS(e,2),n=r[0],i=r[1];return"".concat(n," ").concat(o7.Base64.encode(String(i)))}).join(",")}function hs(t,e){return t>=e&&t<e+100}function YS(t,e,r){var n=r.httpStack.createRequest(t,e);r.protocol===lf?n.setHeader("Upload-Draft-Interop-Version","5"):n.setHeader("Tus-Resumable","1.0.0");for(var i=r.headers||{},o=0,s=Object.entries(i);o<s.length;o++){var a=QS(s[o],2),u=a[0],c=a[1];n.setHeader(u,c)}if(r.addRequestId){var l=(0,a7.default)();n.setHeader("X-Request-ID",l)}return n}function JS(t,e,r){return oy.apply(this,arguments)}function oy(){return oy=u7(ny().mark(function t(e,r,n){var i;return ny().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:if(typeof n.onBeforeRequest!="function"){s.next=3;break}return s.next=3,n.onBeforeRequest(e);case 3:return s.next=5,e.send(r);case 5:if(i=s.sent,typeof n.onAfterResponse!="function"){s.next=9;break}return s.next=9,n.onAfterResponse(e,i);case 9:return s.abrupt("return",i);case 10:case"end":return s.stop()}},t)})),oy.apply(this,arguments)}function D7(){var t=!0;return typeof navigator<"u"&&navigator.onLine===!1&&(t=!1),t}function XS(t,e,r){return r.retryDelays==null||e>=r.retryDelays.length||t.originalRequest==null?!1:r&&typeof r.onShouldRetry=="function"?r.onShouldRetry(t,e,r):n1(t)}function n1(t){var e=t.originalResponse?t.originalResponse.getStatus():0;return(!hs(e,400)||e===409||e===423)&&D7()}function ZS(t,e){return new s7.default(e,t).toString()}function v7(t,e){for(var r=Math.floor(t/e),n=[],i=0;i<e;i++)n.push({start:r*i,end:r*(i+1)});return n[e-1].end=t,n}r1.defaultOptions=y7;var bde=ff.default=r1});var s1=y((_de,o1)=>{"use strict";var Kr=t=>t!==null&&typeof t=="object"&&typeof t.pipe=="function";Kr.writable=t=>Kr(t)&&t.writable!==!1&&typeof t._write=="function"&&typeof t._writableState=="object";Kr.readable=t=>Kr(t)&&t.readable!==!1&&typeof t._read=="function"&&typeof t._readableState=="object";Kr.duplex=t=>Kr.writable(t)&&Kr.readable(t);Kr.transform=t=>Kr.duplex(t)&&typeof t._transform=="function";o1.exports=Kr});var u1=y(df=>{"use strict";Object.defineProperty(df,"__esModule",{value:!0});df.default=void 0;function Ou(t){"@babel/helpers - typeof";return Ou=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ou(t)}function b7(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a1(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,_7(n.key),n)}}function w7(t,e,r){return e&&a1(t.prototype,e),r&&a1(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function _7(t){var e=E7(t,"string");return Ou(e)=="symbol"?e:e+""}function E7(t,e){if(Ou(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Ou(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Ede=df.default=function(){function t(e){b7(this,t),this._buffer=e,this.size=e.length}return w7(t,[{key:"slice",value:function(r,n){var i=this._buffer.slice(r,n);i.size=i.length;var o=n>=this.size;return Promise.resolve({value:i,done:o})}},{key:"close",value:function(){}}])}()});var d1=y(cy=>{"use strict";Object.defineProperty(cy,"__esModule",{value:!0});cy.default=A7;var f1=require("fs");function Bi(t){"@babel/helpers - typeof";return Bi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Bi(t)}function ay(){"use strict";ay=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(E,b,_){E[b]=_.value},o=typeof Symbol=="function"?Symbol:{},s=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function c(E,b,_){return Object.defineProperty(E,b,{value:_,enumerable:!0,configurable:!0,writable:!0}),E[b]}try{c({},"")}catch{c=function(_,O,j){return _[O]=j}}function l(E,b,_,O){var j=b&&b.prototype instanceof w?b:w,P=Object.create(j.prototype),U=new K(O||[]);return i(P,"_invoke",{value:I(E,_,U)}),P}function f(E,b,_){try{return{type:"normal",arg:E.call(b,_)}}catch(O){return{type:"throw",arg:O}}}e.wrap=l;var h="suspendedStart",d="suspendedYield",p="executing",v="completed",g={};function w(){}function x(){}function D(){}var C={};c(C,s,function(){return this});var k=Object.getPrototypeOf,$=k&&k(k(M([])));$&&$!==r&&n.call($,s)&&(C=$);var F=D.prototype=w.prototype=Object.create(C);function L(E){["next","throw","return"].forEach(function(b){c(E,b,function(_){return this._invoke(b,_)})})}function S(E,b){function _(j,P,U,T){var N=f(E[j],E,P);if(N.type!=="throw"){var oe=N.arg,se=oe.value;return se&&Bi(se)=="object"&&n.call(se,"__await")?b.resolve(se.__await).then(function(ve){_("next",ve,U,T)},function(ve){_("throw",ve,U,T)}):b.resolve(se).then(function(ve){oe.value=ve,U(oe)},function(ve){return _("throw",ve,U,T)})}T(N.arg)}var O;i(this,"_invoke",{value:function(P,U){function T(){return new b(function(N,oe){_(P,U,N,oe)})}return O=O?O.then(T,T):T()}})}function I(E,b,_){var O=h;return function(j,P){if(O===p)throw Error("Generator is already running");if(O===v){if(j==="throw")throw P;return{value:t,done:!0}}for(_.method=j,_.arg=P;;){var U=_.delegate;if(U){var T=R(U,_);if(T){if(T===g)continue;return T}}if(_.method==="next")_.sent=_._sent=_.arg;else if(_.method==="throw"){if(O===h)throw O=v,_.arg;_.dispatchException(_.arg)}else _.method==="return"&&_.abrupt("return",_.arg);O=p;var N=f(E,b,_);if(N.type==="normal"){if(O=_.done?v:d,N.arg===g)continue;return{value:N.arg,done:_.done}}N.type==="throw"&&(O=v,_.method="throw",_.arg=N.arg)}}}function R(E,b){var _=b.method,O=E.iterator[_];if(O===t)return b.delegate=null,_==="throw"&&E.iterator.return&&(b.method="return",b.arg=t,R(E,b),b.method==="throw")||_!=="return"&&(b.method="throw",b.arg=new TypeError("The iterator does not provide a '"+_+"' method")),g;var j=f(O,E.iterator,b.arg);if(j.type==="throw")return b.method="throw",b.arg=j.arg,b.delegate=null,g;var P=j.arg;return P?P.done?(b[E.resultName]=P.value,b.next=E.nextLoc,b.method!=="return"&&(b.method="next",b.arg=t),b.delegate=null,g):P:(b.method="throw",b.arg=new TypeError("iterator result is not an object"),b.delegate=null,g)}function B(E){var b={tryLoc:E[0]};1 in E&&(b.catchLoc=E[1]),2 in E&&(b.finallyLoc=E[2],b.afterLoc=E[3]),this.tryEntries.push(b)}function q(E){var b=E.completion||{};b.type="normal",delete b.arg,E.completion=b}function K(E){this.tryEntries=[{tryLoc:"root"}],E.forEach(B,this),this.reset(!0)}function M(E){if(E||E===""){var b=E[s];if(b)return b.call(E);if(typeof E.next=="function")return E;if(!isNaN(E.length)){var _=-1,O=function j(){for(;++_<E.length;)if(n.call(E,_))return j.value=E[_],j.done=!1,j;return j.value=t,j.done=!0,j};return O.next=O}}throw new TypeError(Bi(E)+" is not iterable")}return x.prototype=D,i(F,"constructor",{value:D,configurable:!0}),i(D,"constructor",{value:x,configurable:!0}),x.displayName=c(D,u,"GeneratorFunction"),e.isGeneratorFunction=function(E){var b=typeof E=="function"&&E.constructor;return!!b&&(b===x||(b.displayName||b.name)==="GeneratorFunction")},e.mark=function(E){return Object.setPrototypeOf?Object.setPrototypeOf(E,D):(E.__proto__=D,c(E,u,"GeneratorFunction")),E.prototype=Object.create(F),E},e.awrap=function(E){return{__await:E}},L(S.prototype),c(S.prototype,a,function(){return this}),e.AsyncIterator=S,e.async=function(E,b,_,O,j){j===void 0&&(j=Promise);var P=new S(l(E,b,_,O),j);return e.isGeneratorFunction(b)?P:P.next().then(function(U){return U.done?U.value:P.next()})},L(F),c(F,u,"Generator"),c(F,s,function(){return this}),c(F,"toString",function(){return"[object Generator]"}),e.keys=function(E){var b=Object(E),_=[];for(var O in b)_.push(O);return _.reverse(),function j(){for(;_.length;){var P=_.pop();if(P in b)return j.value=P,j.done=!1,j}return j.done=!0,j}},e.values=M,K.prototype={constructor:K,reset:function(b){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(q),!b)for(var _ in this)_.charAt(0)==="t"&&n.call(this,_)&&!isNaN(+_.slice(1))&&(this[_]=t)},stop:function(){this.done=!0;var b=this.tryEntries[0].completion;if(b.type==="throw")throw b.arg;return this.rval},dispatchException:function(b){if(this.done)throw b;var _=this;function O(oe,se){return U.type="throw",U.arg=b,_.next=oe,se&&(_.method="next",_.arg=t),!!se}for(var j=this.tryEntries.length-1;j>=0;--j){var P=this.tryEntries[j],U=P.completion;if(P.tryLoc==="root")return O("end");if(P.tryLoc<=this.prev){var T=n.call(P,"catchLoc"),N=n.call(P,"finallyLoc");if(T&&N){if(this.prev<P.catchLoc)return O(P.catchLoc,!0);if(this.prev<P.finallyLoc)return O(P.finallyLoc)}else if(T){if(this.prev<P.catchLoc)return O(P.catchLoc,!0)}else{if(!N)throw Error("try statement without catch or finally");if(this.prev<P.finallyLoc)return O(P.finallyLoc)}}}},abrupt:function(b,_){for(var O=this.tryEntries.length-1;O>=0;--O){var j=this.tryEntries[O];if(j.tryLoc<=this.prev&&n.call(j,"finallyLoc")&&this.prev<j.finallyLoc){var P=j;break}}P&&(b==="break"||b==="continue")&&P.tryLoc<=_&&_<=P.finallyLoc&&(P=null);var U=P?P.completion:{};return U.type=b,U.arg=_,P?(this.method="next",this.next=P.finallyLoc,g):this.complete(U)},complete:function(b,_){if(b.type==="throw")throw b.arg;return b.type==="break"||b.type==="continue"?this.next=b.arg:b.type==="return"?(this.rval=this.arg=b.arg,this.method="return",this.next="end"):b.type==="normal"&&_&&(this.next=_),g},finish:function(b){for(var _=this.tryEntries.length-1;_>=0;--_){var O=this.tryEntries[_];if(O.finallyLoc===b)return this.complete(O.completion,O.afterLoc),q(O),g}},catch:function(b){for(var _=this.tryEntries.length-1;_>=0;--_){var O=this.tryEntries[_];if(O.tryLoc===b){var j=O.completion;if(j.type==="throw"){var P=j.arg;q(O)}return P}}throw Error("illegal catch attempt")},delegateYield:function(b,_,O){return this.delegate={iterator:M(b),resultName:_,nextLoc:O},this.method==="next"&&(this.arg=t),g}},e}function C7(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function c1(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,x7(n.key),n)}}function S7(t,e,r){return e&&c1(t.prototype,e),r&&c1(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function x7(t){var e=F7(t,"string");return Bi(e)=="symbol"?e:e+""}function F7(t,e){if(Bi(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Bi(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function l1(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(c){r(c);return}a.done?e(u):Promise.resolve(u).then(n,i)}function O7(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function s(u){l1(o,n,i,s,a,"next",u)}function a(u){l1(o,n,i,s,a,"throw",u)}s(void 0)})}}function A7(t){return uy.apply(this,arguments)}function uy(){return uy=O7(ay().mark(function t(e){var r,n,i,o,s,a,u;return ay().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return n=e.path.toString(),l.next=3,f1.promises.stat(n);case 3:return i=l.sent,o=i.size,s=(r=e.start)!==null&&r!==void 0?r:0,a=Number.isFinite(e.end)?e.end+1:o,u=a-s,l.abrupt("return",new k7(e,n,u));case 9:case"end":return l.stop()}},t)})),uy.apply(this,arguments)}var k7=function(){function t(e,r,n){C7(this,t),this._stream=e,this._path=r,this.size=n}return S7(t,[{key:"slice",value:function(r,n){var i,o=(i=this._stream.start)!==null&&i!==void 0?i:0,s=(0,f1.createReadStream)(this._path,{start:o+r,end:o+n-1,autoClose:!0});s.size=Math.min(n-r,this.size);var a=s.size>=this.size;return Promise.resolve({value:s,done:a})}},{key:"close",value:function(){this._stream.destroy()}}])}()});var fy=y(hf=>{"use strict";Object.defineProperty(hf,"__esModule",{value:!0});hf.default=void 0;function qi(t){"@babel/helpers - typeof";return qi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},qi(t)}function Au(){"use strict";Au=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(E,b,_){E[b]=_.value},o=typeof Symbol=="function"?Symbol:{},s=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function c(E,b,_){return Object.defineProperty(E,b,{value:_,enumerable:!0,configurable:!0,writable:!0}),E[b]}try{c({},"")}catch{c=function(_,O,j){return _[O]=j}}function l(E,b,_,O){var j=b&&b.prototype instanceof w?b:w,P=Object.create(j.prototype),U=new K(O||[]);return i(P,"_invoke",{value:I(E,_,U)}),P}function f(E,b,_){try{return{type:"normal",arg:E.call(b,_)}}catch(O){return{type:"throw",arg:O}}}e.wrap=l;var h="suspendedStart",d="suspendedYield",p="executing",v="completed",g={};function w(){}function x(){}function D(){}var C={};c(C,s,function(){return this});var k=Object.getPrototypeOf,$=k&&k(k(M([])));$&&$!==r&&n.call($,s)&&(C=$);var F=D.prototype=w.prototype=Object.create(C);function L(E){["next","throw","return"].forEach(function(b){c(E,b,function(_){return this._invoke(b,_)})})}function S(E,b){function _(j,P,U,T){var N=f(E[j],E,P);if(N.type!=="throw"){var oe=N.arg,se=oe.value;return se&&qi(se)=="object"&&n.call(se,"__await")?b.resolve(se.__await).then(function(ve){_("next",ve,U,T)},function(ve){_("throw",ve,U,T)}):b.resolve(se).then(function(ve){oe.value=ve,U(oe)},function(ve){return _("throw",ve,U,T)})}T(N.arg)}var O;i(this,"_invoke",{value:function(P,U){function T(){return new b(function(N,oe){_(P,U,N,oe)})}return O=O?O.then(T,T):T()}})}function I(E,b,_){var O=h;return function(j,P){if(O===p)throw Error("Generator is already running");if(O===v){if(j==="throw")throw P;return{value:t,done:!0}}for(_.method=j,_.arg=P;;){var U=_.delegate;if(U){var T=R(U,_);if(T){if(T===g)continue;return T}}if(_.method==="next")_.sent=_._sent=_.arg;else if(_.method==="throw"){if(O===h)throw O=v,_.arg;_.dispatchException(_.arg)}else _.method==="return"&&_.abrupt("return",_.arg);O=p;var N=f(E,b,_);if(N.type==="normal"){if(O=_.done?v:d,N.arg===g)continue;return{value:N.arg,done:_.done}}N.type==="throw"&&(O=v,_.method="throw",_.arg=N.arg)}}}function R(E,b){var _=b.method,O=E.iterator[_];if(O===t)return b.delegate=null,_==="throw"&&E.iterator.return&&(b.method="return",b.arg=t,R(E,b),b.method==="throw")||_!=="return"&&(b.method="throw",b.arg=new TypeError("The iterator does not provide a '"+_+"' method")),g;var j=f(O,E.iterator,b.arg);if(j.type==="throw")return b.method="throw",b.arg=j.arg,b.delegate=null,g;var P=j.arg;return P?P.done?(b[E.resultName]=P.value,b.next=E.nextLoc,b.method!=="return"&&(b.method="next",b.arg=t),b.delegate=null,g):P:(b.method="throw",b.arg=new TypeError("iterator result is not an object"),b.delegate=null,g)}function B(E){var b={tryLoc:E[0]};1 in E&&(b.catchLoc=E[1]),2 in E&&(b.finallyLoc=E[2],b.afterLoc=E[3]),this.tryEntries.push(b)}function q(E){var b=E.completion||{};b.type="normal",delete b.arg,E.completion=b}function K(E){this.tryEntries=[{tryLoc:"root"}],E.forEach(B,this),this.reset(!0)}function M(E){if(E||E===""){var b=E[s];if(b)return b.call(E);if(typeof E.next=="function")return E;if(!isNaN(E.length)){var _=-1,O=function j(){for(;++_<E.length;)if(n.call(E,_))return j.value=E[_],j.done=!1,j;return j.value=t,j.done=!0,j};return O.next=O}}throw new TypeError(qi(E)+" is not iterable")}return x.prototype=D,i(F,"constructor",{value:D,configurable:!0}),i(D,"constructor",{value:x,configurable:!0}),x.displayName=c(D,u,"GeneratorFunction"),e.isGeneratorFunction=function(E){var b=typeof E=="function"&&E.constructor;return!!b&&(b===x||(b.displayName||b.name)==="GeneratorFunction")},e.mark=function(E){return Object.setPrototypeOf?Object.setPrototypeOf(E,D):(E.__proto__=D,c(E,u,"GeneratorFunction")),E.prototype=Object.create(F),E},e.awrap=function(E){return{__await:E}},L(S.prototype),c(S.prototype,a,function(){return this}),e.AsyncIterator=S,e.async=function(E,b,_,O,j){j===void 0&&(j=Promise);var P=new S(l(E,b,_,O),j);return e.isGeneratorFunction(b)?P:P.next().then(function(U){return U.done?U.value:P.next()})},L(F),c(F,u,"Generator"),c(F,s,function(){return this}),c(F,"toString",function(){return"[object Generator]"}),e.keys=function(E){var b=Object(E),_=[];for(var O in b)_.push(O);return _.reverse(),function j(){for(;_.length;){var P=_.pop();if(P in b)return j.value=P,j.done=!1,j}return j.done=!0,j}},e.values=M,K.prototype={constructor:K,reset:function(b){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(q),!b)for(var _ in this)_.charAt(0)==="t"&&n.call(this,_)&&!isNaN(+_.slice(1))&&(this[_]=t)},stop:function(){this.done=!0;var b=this.tryEntries[0].completion;if(b.type==="throw")throw b.arg;return this.rval},dispatchException:function(b){if(this.done)throw b;var _=this;function O(oe,se){return U.type="throw",U.arg=b,_.next=oe,se&&(_.method="next",_.arg=t),!!se}for(var j=this.tryEntries.length-1;j>=0;--j){var P=this.tryEntries[j],U=P.completion;if(P.tryLoc==="root")return O("end");if(P.tryLoc<=this.prev){var T=n.call(P,"catchLoc"),N=n.call(P,"finallyLoc");if(T&&N){if(this.prev<P.catchLoc)return O(P.catchLoc,!0);if(this.prev<P.finallyLoc)return O(P.finallyLoc)}else if(T){if(this.prev<P.catchLoc)return O(P.catchLoc,!0)}else{if(!N)throw Error("try statement without catch or finally");if(this.prev<P.finallyLoc)return O(P.finallyLoc)}}}},abrupt:function(b,_){for(var O=this.tryEntries.length-1;O>=0;--O){var j=this.tryEntries[O];if(j.tryLoc<=this.prev&&n.call(j,"finallyLoc")&&this.prev<j.finallyLoc){var P=j;break}}P&&(b==="break"||b==="continue")&&P.tryLoc<=_&&_<=P.finallyLoc&&(P=null);var U=P?P.completion:{};return U.type=b,U.arg=_,P?(this.method="next",this.next=P.finallyLoc,g):this.complete(U)},complete:function(b,_){if(b.type==="throw")throw b.arg;return b.type==="break"||b.type==="continue"?this.next=b.arg:b.type==="return"?(this.rval=this.arg=b.arg,this.method="return",this.next="end"):b.type==="normal"&&_&&(this.next=_),g},finish:function(b){for(var _=this.tryEntries.length-1;_>=0;--_){var O=this.tryEntries[_];if(O.finallyLoc===b)return this.complete(O.completion,O.afterLoc),q(O),g}},catch:function(b){for(var _=this.tryEntries.length-1;_>=0;--_){var O=this.tryEntries[_];if(O.tryLoc===b){var j=O.completion;if(j.type==="throw"){var P=j.arg;q(O)}return P}}throw Error("illegal catch attempt")},delegateYield:function(b,_,O){return this.delegate={iterator:M(b),resultName:_,nextLoc:O},this.method==="next"&&(this.arg=t),g}},e}function T7(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function h1(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,R7(n.key),n)}}function P7(t,e,r){return e&&h1(t.prototype,e),r&&h1(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function R7(t){var e=$7(t,"string");return qi(e)=="symbol"?e:e+""}function $7(t,e){if(qi(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(qi(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function p1(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(c){r(c);return}a.done?e(u):Promise.resolve(u).then(n,i)}function m1(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function s(u){p1(o,n,i,s,a,"next",u)}function a(u){p1(o,n,i,s,a,"throw",u)}s(void 0)})}}function I7(t,e){return ly.apply(this,arguments)}function ly(){return ly=m1(Au().mark(function t(e,r){return Au().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return i.abrupt("return",new Promise(function(o,s){var a=function(l){e.off("readable",u),s(l)},u=function c(){var l=e.read(r);l!==null&&(e.off("error",a),e.off("readable",c),o(l))};e.once("error",a),e.on("readable",u)}));case 1:case"end":return i.stop()}},t)})),ly.apply(this,arguments)}var xde=hf.default=function(){function t(e){var r=this;T7(this,t),this._stream=e,this.size=null,this._buf=Buffer.alloc(0),this._bufPos=0,this._ended=!1,this._error=null,e.pause(),e.on("end",function(){r._ended=!0}),e.on("error",function(n){r._error=n})}return P7(t,[{key:"slice",value:function(){var e=m1(Au().mark(function n(i,o){var s,a,u,c,l;return Au().wrap(function(h){for(;;)switch(h.prev=h.next){case 0:if(!(i<this._bufPos)){h.next=2;break}throw new Error("cannot slice from position which we already seeked away");case 2:if(!(i>this._bufPos+this._buf.length)){h.next=4;break}throw new Error("slice start is outside of buffer (currently not implemented)");case 4:if(!this._error){h.next=6;break}throw this._error;case 6:if(i<this._bufPos+this._buf.length?(a=i-this._bufPos,u=Math.min(this._buf.length,o-this._bufPos),s=this._buf.slice(a,u)):s=Buffer.alloc(0),!this._ended){h.next=10;break}return s.size=s.length,h.abrupt("return",{value:s,done:!0});case 10:if(c=o-i,!(c>s.length)){h.next=16;break}return h.next=14,I7(this._stream,c-s.length);case 14:l=h.sent,s=Buffer.concat([s,l]);case 16:return this._buf=s,this._bufPos=i,s.size=s.length,h.abrupt("return",{value:s,done:this._ended});case 20:case"end":return h.stop()}},n,this)}));function r(n,i){return e.apply(this,arguments)}return r}()},{key:"close",value:function(){this._stream.destroy()}}])}()});var y1=y(mf=>{"use strict";Object.defineProperty(mf,"__esModule",{value:!0});mf.default=void 0;var j7=require("fs"),N7=pf(s1()),L7=pf(u1()),B7=pf(d1()),q7=pf(fy());function pf(t){return t&&t.__esModule?t:{default:t}}function ku(t){"@babel/helpers - typeof";return ku=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ku(t)}function M7(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function g1(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,V7(n.key),n)}}function U7(t,e,r){return e&&g1(t.prototype,e),r&&g1(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function V7(t){var e=H7(t,"string");return ku(e)=="symbol"?e:e+""}function H7(t,e){if(ku(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(ku(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Ode=mf.default=function(){function t(){M7(this,t)}return U7(t,[{key:"openFile",value:function(r,n){return Buffer.isBuffer(r)?Promise.resolve(new L7.default(r)):r instanceof j7.ReadStream&&r.path!=null?(0,B7.default)(r):N7.default.readable(r)?(n=Number(n),Number.isFinite(n)?Promise.resolve(new q7.default(r)):Promise.reject(new Error("cannot create source for stream without a finite value for the `chunkSize` option; specify a chunkSize to control the memory consumption"))):Promise.reject(new Error("source object may only be an instance of Buffer or Readable in this environment"))}}])}()});var w1=y(dy=>{"use strict";Object.defineProperty(dy,"__esModule",{value:!0});dy.default=W7;var z7=require("crypto"),D1=b1(require("fs")),G7=b1(require("path"));function v1(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,r=new WeakMap;return(v1=function(n){return n?r:e})(t)}function b1(t,e){if(!e&&t&&t.__esModule)return t;if(t===null||typeof t!="object"&&typeof t!="function")return{default:t};var r=v1(e);if(r&&r.has(t))return r.get(t);var n={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in t)if(o!=="default"&&{}.hasOwnProperty.call(t,o)){var s=i?Object.getOwnPropertyDescriptor(t,o):null;s&&(s.get||s.set)?Object.defineProperty(n,o,s):n[o]=t[o]}return n.default=t,r&&r.set(t,n),n}function W7(t,e){if(Buffer.isBuffer(t)){var r=65536,n=t.slice(0,Math.min(r,t.length)),i=(0,z7.createHash)("md5").update(n).digest("hex"),o=["node-buffer",i,t.length,e.endpoint].join("-");return Promise.resolve(o)}return t instanceof D1.ReadStream&&t.path!=null?new Promise(function(s,a){var u=G7.resolve(t.path);D1.stat(t.path,function(c,l){if(c){a(c);return}var f=["node-file",u,l.size,l.mtime.getTime(),e.endpoint].join("-");s(f)})}):Promise.resolve(null)}});var x1=y((Tde,S1)=>{var C1="Expected a function",_1=NaN,K7="[object Symbol]",Y7=/^\s+|\s+$/g,J7=/^[-+]0x[0-9a-f]+$/i,X7=/^0b[01]+$/i,Z7=/^0o[0-7]+$/i,Q7=parseInt,eV=typeof global=="object"&&global&&global.Object===Object&&global,tV=typeof self=="object"&&self&&self.Object===Object&&self,rV=eV||tV||Function("return this")(),nV=Object.prototype,iV=nV.toString,oV=Math.max,sV=Math.min,hy=function(){return rV.Date.now()};function aV(t,e,r){var n,i,o,s,a,u,c=0,l=!1,f=!1,h=!0;if(typeof t!="function")throw new TypeError(C1);e=E1(e)||0,gf(r)&&(l=!!r.leading,f="maxWait"in r,o=f?oV(E1(r.maxWait)||0,e):o,h="trailing"in r?!!r.trailing:h);function d($){var F=n,L=i;return n=i=void 0,c=$,s=t.apply(L,F),s}function p($){return c=$,a=setTimeout(w,e),l?d($):s}function v($){var F=$-u,L=$-c,S=e-F;return f?sV(S,o-L):S}function g($){var F=$-u,L=$-c;return u===void 0||F>=e||F<0||f&&L>=o}function w(){var $=hy();if(g($))return x($);a=setTimeout(w,v($))}function x($){return a=void 0,h&&n?d($):(n=i=void 0,s)}function D(){a!==void 0&&clearTimeout(a),c=0,n=u=i=a=void 0}function C(){return a===void 0?s:x(hy())}function k(){var $=hy(),F=g($);if(n=arguments,i=this,u=$,F){if(a===void 0)return p(u);if(f)return a=setTimeout(w,e),d(u)}return a===void 0&&(a=setTimeout(w,e)),s}return k.cancel=D,k.flush=C,k}function uV(t,e,r){var n=!0,i=!0;if(typeof t!="function")throw new TypeError(C1);return gf(r)&&(n="leading"in r?!!r.leading:n,i="trailing"in r?!!r.trailing:i),aV(t,e,{leading:n,maxWait:e,trailing:i})}function gf(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function cV(t){return!!t&&typeof t=="object"}function lV(t){return typeof t=="symbol"||cV(t)&&iV.call(t)==K7}function E1(t){if(typeof t=="number")return t;if(lV(t))return _1;if(gf(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=gf(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=t.replace(Y7,"");var r=X7.test(t);return r||Z7.test(t)?Q7(t.slice(2),r?2:8):J7.test(t)?_1:+t}S1.exports=uV});var I1=y(bf=>{"use strict";Object.defineProperty(bf,"__esModule",{value:!0});bf.default=void 0;var fV=P1(require("http")),dV=P1(require("https")),A1=require("stream"),hV=require("url"),k1=pV(x1());function pV(t){return t&&t.__esModule?t:{default:t}}function T1(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,r=new WeakMap;return(T1=function(n){return n?r:e})(t)}function P1(t,e){if(!e&&t&&t.__esModule)return t;if(t===null||typeof t!="object"&&typeof t!="function")return{default:t};var r=T1(e);if(r&&r.has(t))return r.get(t);var n={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in t)if(o!=="default"&&{}.hasOwnProperty.call(t,o)){var s=i?Object.getOwnPropertyDescriptor(t,o):null;s&&(s.get||s.set)?Object.defineProperty(n,o,s):n[o]=t[o]}return n.default=t,r&&r.set(t,n),n}function mV(t,e,r){return e=yf(e),gV(t,R1()?Reflect.construct(e,r||[],yf(t).constructor):e.apply(t,r))}function gV(t,e){if(e&&(ps(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return yV(t)}function yV(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function R1(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(R1=function(){return!!t})()}function yf(t){return yf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},yf(t)}function DV(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&py(t,e)}function py(t,e){return py=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},py(t,e)}function F1(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Tu(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?F1(Object(r),!0).forEach(function(n){vV(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):F1(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function vV(t,e,r){return e=$1(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ps(t){"@babel/helpers - typeof";return ps=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ps(t)}function Df(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function O1(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,$1(n.key),n)}}function vf(t,e,r){return e&&O1(t.prototype,e),r&&O1(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function $1(t){var e=bV(t,"string");return ps(e)=="symbol"?e:e+""}function bV(t,e){if(ps(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(ps(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Pde=bf.default=function(){function t(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Df(this,t),this._requestOptions=e}return vf(t,[{key:"createRequest",value:function(r,n){return new wV(r,n,this._requestOptions)}},{key:"getName",value:function(){return"NodeHttpStack"}}])}(),wV=function(){function t(e,r,n){Df(this,t),this._method=e,this._url=r,this._headers={},this._request=null,this._progressHandler=function(){},this._requestOptions=n||{}}return vf(t,[{key:"getMethod",value:function(){return this._method}},{key:"getURL",value:function(){return this._url}},{key:"setHeader",value:function(r,n){this._headers[r]=n}},{key:"getHeader",value:function(r){return this._headers[r]}},{key:"setProgressHandler",value:function(r){this._progressHandler=r}},{key:"send",value:function(){var r=this,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return new Promise(function(i,o){var s=Tu(Tu(Tu({},(0,hV.parse)(r._url)),r._requestOptions),{},{method:r._method,headers:Tu(Tu({},r._requestOptions.headers||{}),r._headers)});n!=null&&n.size&&(s.headers["Content-Length"]=n.size);var a=s.protocol==="https:"?dV:fV;r._request=a.request(s);var u=r._request;u.on("response",function(c){var l=[];c.on("data",function(f){l.push(f)}),c.on("end",function(){var f=Buffer.concat(l).toString("utf8");i(new _V(c,f))})}),u.on("error",function(c){o(c)}),n instanceof A1.Readable?n.pipe(new EV(r._progressHandler)).pipe(u):n instanceof Uint8Array?CV(u,n,r._progressHandler):u.end(n)})}},{key:"abort",value:function(){return this._request!==null&&this._request.abort(),Promise.resolve()}},{key:"getUnderlyingObject",value:function(){return this._request}}])}(),_V=function(){function t(e,r){Df(this,t),this._response=e,this._body=r}return vf(t,[{key:"getStatus",value:function(){return this._response.statusCode}},{key:"getHeader",value:function(r){return this._response.headers[r.toLowerCase()]}},{key:"getBody",value:function(){return this._body}},{key:"getUnderlyingObject",value:function(){return this._response}}])}(),EV=function(t){function e(r){var n;return Df(this,e),n=mV(this,e),n._onprogress=(0,k1.default)(r,100,{leading:!0,trailing:!1}),n._position=0,n}return DV(e,t),vf(e,[{key:"_transform",value:function(n,i,o){this._position+=n.length,this._onprogress(this._position),o(null,n)}}])}(A1.Transform),CV=function(e,r,n){n=(0,k1.default)(n,100,{leading:!0,trailing:!1});var i=0;function o(){var s=Math.min(e.writableHighWaterMark,r.length-i),a=r.subarray(i,i+s);i+=a.length;var u=e.write(a);u?i<r.length?o():e.end():(e.once("drain",o),n(i))}o()}});var j1=y(my=>{"use strict";my.expectReceive=function(t,e,r){var n;r.root(t,e,r),n=this.message,t.hasOwnProperty("expected")&&(n+=" Expected "+t.expected+"."),t.hasOwnProperty("received")&&(n+=" Received: "+t.received+"."),this.message=n};my.root=function(t,e,r){var n=this,i,o={stackLength:Error.stackTraceLimit,rootOnly:!0},s="",a=Error.stackTraceLimit,u;function c(){u[0]=n.toString(),n.stack=u.join(`
33
33
  `)}(!e||typeof e!="object")&&(e={}),e.hasOwnProperty("stackLength")&&typeof e.stackLength=="number"&&!isNaN(e.stackLength)&&e.stackLength>=0&&(o.stackLength=e.stackLength),e.hasOwnProperty("rootOnly")||(o.rootOnly=e.rootOnly),(!o.rootOnly||this.CustomError.parent===Error)&&(Object.keys(t).forEach(function(l){switch(l){case"code":i=t.code||void 0;break;case"message":s=t.message||"";break;default:n[l]=t[l]}}),Error.stackTraceLimit=o.stackLength+2,u=new Error().stack.split(`
34
34
  `),u.splice(0,3),u.unshift(""),Error.stackTraceLimit=a,this.stack=u.join(`
35
- `),Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,get:function(){return i},set:function(l){i=l,c()}}),Object.defineProperty(this,"message",{configurable:!0,enumerable:!0,get:function(){return s},set:function(l){s=l,c()}}),c())}});var B1=y((Ide,L1)=>{"use strict";L1.exports=Ui;Ui.factory=j1();var Dy=Ui("CustomError");Dy.order=Ui(Dy,{message:"Arguments out of order.",code:"EOARG"});function Ui(t,e,r,n){var i,o;return e=Ef(arguments,1,Error,N1,[gy,Cf]),r=Ef(arguments,2,{},gy,[Cf]),n=Ef(arguments,3,yy,Cf,[]),t=Ef(arguments,0,e===Error?"Error":e.prototype.CustomError.name,SV,[N1,gy,Cf]),o=e===Error,o&&n===yy&&(n=Ui.factory.root),i=function(s,a){var u,c,l,f,h,d;if(!(this instanceof i))return new i(s,a);for(delete this.constructor.name,Object.defineProperty(this.constructor,"name",{enumerable:!1,configurable:!0,value:t,writable:!1}),typeof s=="string"&&(s={message:s}),s||(s={}),c=this.CustomError.chain.slice(0).reverse().map(function(p){return p.properties}),c.push(s),c.unshift({}),d=Object.assign.apply(Object,c),u=this,l={},Object.keys(Ui.factory).forEach(function(p){l[p]=function(v,g){Ui.factory[p].call(u,v,g,l)}}),f=this.CustomError.chain.length-1;f>=0;f--)h=this.CustomError.chain[f],h.factory!==yy&&h.factory.call(this,d,a,l)},i.prototype=Object.create(e.prototype),i.prototype.constructor=i,i.prototype.name=t,i.prototype.CustomError={chain:o?[]:e.prototype.CustomError.chain.slice(0),factory:n,name:t,parent:e,properties:r},i.prototype.CustomError.chain.unshift(i.prototype.CustomError),i.prototype.toString=function(){var s=this.CustomError.chain[this.CustomError.chain.length-1].name;return this.code&&(s+=" "+this.code),this.message&&(s+=": "+this.message),s},i}function Ef(t,e,r,n,i){var o=-1,s=-1,a,u,c=e<t.length?e:t.length,l;for(a=0;a<=c;a++){if(l=t[a],o===-1)for(u=0;u<i.length;u++)i[u](l)&&(o=a);s===-1&&n(l)&&(s=a)}if(s!==-1&&o!==-1&&o<s)throw new Dy.order;return s!==-1?t[s]:r}function Cf(t){return typeof t=="function"&&t!==Error&&!t.prototype.CustomError}function SV(t){return typeof t=="string"}function N1(t){return typeof t=="function"&&(t===Error||t.prototype.CustomError)}function gy(t){return t&&typeof t=="object"}function yy(){}});var M1=y((jde,q1)=>{q1.exports=B1()});var G1=y((Vi,ms)=>{var xV=1/0,FV="[object Symbol]",Pu={function:!0,object:!0},OV=Pu[typeof Vi]&&Vi&&!Vi.nodeType?Vi:void 0,AV=Pu[typeof ms]&&ms&&!ms.nodeType?ms:void 0,kV=Sf(OV&&AV&&typeof global=="object"&&global),TV=Sf(Pu[typeof self]&&self),U1=Sf(Pu[typeof window]&&window),vy=Sf(Pu[typeof Vi]&&Vi),PV=kV||U1!==(vy&&vy.window)&&U1||TV||vy||Function("return this")();function Sf(t){return t&&t.Object===Object?t:null}var RV=Object.prototype,$V=RV.toString,V1=PV.Symbol,H1=V1?V1.prototype:void 0,z1=H1?H1.toString:void 0;function IV(t){if(typeof t=="string")return t;if(NV(t))return z1?z1.call(t):"";var e=t+"";return e=="0"&&1/t==-xV?"-0":e}function jV(t){return!!t&&typeof t=="object"}function NV(t){return typeof t=="symbol"||jV(t)&&$V.call(t)==FV}ms.exports=IV});var Q1=y((Hi,gs)=>{var LV=G1(),BV="Expected a function",K1="__lodash_hash_undefined__",qV="[object Function]",MV="[object GeneratorFunction]",UV=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]/g,VV=/[\\^$.*+?()[\]{}|]/g,HV=/\\(\\)?/g,zV=/^\[object .+?Constructor\]$/,$u={function:!0,object:!0},GV=$u[typeof Hi]&&Hi&&!Hi.nodeType?Hi:void 0,WV=$u[typeof gs]&&gs&&!gs.nodeType?gs:void 0,KV=xf(GV&&WV&&typeof global=="object"&&global),YV=xf($u[typeof self]&&self),W1=xf($u[typeof window]&&window),by=xf($u[typeof Hi]&&Hi),JV=KV||W1!==(by&&by.window)&&W1||YV||by||Function("return this")();function xf(t){return t&&t.Object===Object?t:null}function XV(t){var e=!1;if(t!=null&&typeof t.toString!="function")try{e=!!(t+"")}catch{}return e}var ZV=Array.prototype,Y1=Object.prototype,J1=Function.prototype.toString,wy=Y1.hasOwnProperty,QV=Y1.toString,eH=RegExp("^"+J1.call(wy).replace(VV,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),tH=ZV.splice,rH=X1(JV,"Map"),Ru=X1(Object,"create");function zi(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function nH(){this.__data__=Ru?Ru(null):{}}function iH(t){return this.has(t)&&delete this.__data__[t]}function oH(t){var e=this.__data__;if(Ru){var r=e[t];return r===K1?void 0:r}return wy.call(e,t)?e[t]:void 0}function sH(t){var e=this.__data__;return Ru?e[t]!==void 0:wy.call(e,t)}function aH(t,e){var r=this.__data__;return r[t]=Ru&&e===void 0?K1:e,this}zi.prototype.clear=nH;zi.prototype.delete=iH;zi.prototype.get=oH;zi.prototype.has=sH;zi.prototype.set=aH;function ys(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function uH(){this.__data__=[]}function cH(t){var e=this.__data__,r=Ff(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():tH.call(e,r,1),!0}function lH(t){var e=this.__data__,r=Ff(e,t);return r<0?void 0:e[r][1]}function fH(t){return Ff(this.__data__,t)>-1}function dH(t,e){var r=this.__data__,n=Ff(r,t);return n<0?r.push([t,e]):r[n][1]=e,this}ys.prototype.clear=uH;ys.prototype.delete=cH;ys.prototype.get=lH;ys.prototype.has=fH;ys.prototype.set=dH;function Gi(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function hH(){this.__data__={hash:new zi,map:new(rH||ys),string:new zi}}function pH(t){return Of(this,t).delete(t)}function mH(t){return Of(this,t).get(t)}function gH(t){return Of(this,t).has(t)}function yH(t,e){return Of(this,t).set(t,e),this}Gi.prototype.clear=hH;Gi.prototype.delete=pH;Gi.prototype.get=mH;Gi.prototype.has=gH;Gi.prototype.set=yH;function Ff(t,e){for(var r=t.length;r--;)if(wH(t[r][0],e))return r;return-1}function Of(t,e){var r=t.__data__;return DH(e)?r[typeof e=="string"?"string":"hash"]:r.map}function X1(t,e){var r=t[e];return EH(r)?r:void 0}function DH(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}var vH=_y(function(t){var e=[];return CH(t).replace(UV,function(r,n,i,o){e.push(i?o.replace(HV,"$1"):n||r)}),e});function bH(t){if(t!=null){try{return J1.call(t)}catch{}try{return t+""}catch{}}return""}function _y(t,e){if(typeof t!="function"||e&&typeof e!="function")throw new TypeError(BV);var r=function(){var n=arguments,i=e?e.apply(this,n):n[0],o=r.cache;if(o.has(i))return o.get(i);var s=t.apply(this,n);return r.cache=o.set(i,s),s};return r.cache=new(_y.Cache||Gi),r}_y.Cache=Gi;function wH(t,e){return t===e||t!==t&&e!==e}function _H(t){var e=Z1(t)?QV.call(t):"";return e==qV||e==MV}function Z1(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function EH(t){if(!Z1(t))return!1;var e=_H(t)||XV(t)?eH:zV;return e.test(bH(t))}function CH(t){return t==null?"":LV(t)}gs.exports=vH});var Ax=y((Wi,vs)=>{var SH=Q1(),xH=200,Ry="__lodash_hash_undefined__",Rf=1,bs=2,FH=1/0,ox=9007199254740991,Af="[object Arguments]",Sy="[object Array]",sx="[object Boolean]",ax="[object Date]",ux="[object Error]",cx="[object Function]",OH="[object GeneratorFunction]",Iu="[object Map]",lx="[object Number]",Ds="[object Object]",ex="[object Promise]",fx="[object RegExp]",ju="[object Set]",$y="[object String]",dx="[object Symbol]",xy="[object WeakMap]",hx="[object ArrayBuffer]",kf="[object DataView]",AH="[object Float32Array]",kH="[object Float64Array]",TH="[object Int8Array]",PH="[object Int16Array]",RH="[object Int32Array]",$H="[object Uint8Array]",IH="[object Uint8ClampedArray]",jH="[object Uint16Array]",NH="[object Uint32Array]",LH=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,BH=/^\w*$/,qH=/[\\^$.*+?()[\]{}|]/g,MH=/^\[object .+?Constructor\]$/,UH=/^(?:0|[1-9]\d*)$/,Re={};Re[AH]=Re[kH]=Re[TH]=Re[PH]=Re[RH]=Re[$H]=Re[IH]=Re[jH]=Re[NH]=!0;Re[Af]=Re[Sy]=Re[hx]=Re[sx]=Re[kf]=Re[ax]=Re[ux]=Re[cx]=Re[Iu]=Re[lx]=Re[Ds]=Re[fx]=Re[ju]=Re[$y]=Re[xy]=!1;var Lu={function:!0,object:!0},VH=Lu[typeof Wi]&&Wi&&!Wi.nodeType?Wi:void 0,HH=Lu[typeof vs]&&vs&&!vs.nodeType?vs:void 0,zH=$f(VH&&HH&&typeof global=="object"&&global),GH=$f(Lu[typeof self]&&self),tx=$f(Lu[typeof window]&&window),Ey=$f(Lu[typeof Wi]&&Wi),Ji=zH||tx!==(Ey&&Ey.window)&&tx||GH||Ey||Function("return this")();function WH(t,e){for(var r=-1,n=t.length,i=Array(n);++r<n;)i[r]=e(t[r],r,t);return i}function KH(t,e){for(var r=-1,n=t.length;++r<n;)if(e(t[r],r,t))return!0;return!1}function YH(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}function JH(t,e){return WH(e,function(r){return[r,t[r]]})}function $f(t){return t&&t.Object===Object?t:null}function Fy(t){var e=!1;if(t!=null&&typeof t.toString!="function")try{e=!!(t+"")}catch{}return e}function px(t){var e=-1,r=Array(t.size);return t.forEach(function(n,i){r[++e]=[i,n]}),r}function XH(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}function ZH(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=[n,n]}),r}var QH=Array.prototype,If=Object.prototype,mx=Function.prototype.toString,Ki=If.hasOwnProperty,Xi=If.toString,ez=RegExp("^"+mx.call(Ki).replace(qH,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),rx=Ji.Symbol,nx=Ji.Uint8Array,tz=If.propertyIsEnumerable,rz=QH.splice,nz=Object.getPrototypeOf,iz=Object.keys,Oy=ws(Ji,"DataView"),Tf=ws(Ji,"Map"),Ay=ws(Ji,"Promise"),ky=ws(Ji,"Set"),Ty=ws(Ji,"WeakMap"),Nu=ws(Object,"create"),oz=Qi(Oy),sz=Qi(Tf),az=Qi(Ay),uz=Qi(ky),cz=Qi(Ty),ix=rx?rx.prototype:void 0,Cy=ix?ix.valueOf:void 0;function Yi(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function lz(){this.__data__=Nu?Nu(null):{}}function fz(t){return this.has(t)&&delete this.__data__[t]}function dz(t){var e=this.__data__;if(Nu){var r=e[t];return r===Ry?void 0:r}return Ki.call(e,t)?e[t]:void 0}function hz(t){var e=this.__data__;return Nu?e[t]!==void 0:Ki.call(e,t)}function pz(t,e){var r=this.__data__;return r[t]=Nu&&e===void 0?Ry:e,this}Yi.prototype.clear=lz;Yi.prototype.delete=fz;Yi.prototype.get=dz;Yi.prototype.has=hz;Yi.prototype.set=pz;function wn(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function mz(){this.__data__=[]}function gz(t){var e=this.__data__,r=jf(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():rz.call(e,r,1),!0}function yz(t){var e=this.__data__,r=jf(e,t);return r<0?void 0:e[r][1]}function Dz(t){return jf(this.__data__,t)>-1}function vz(t,e){var r=this.__data__,n=jf(r,t);return n<0?r.push([t,e]):r[n][1]=e,this}wn.prototype.clear=mz;wn.prototype.delete=gz;wn.prototype.get=yz;wn.prototype.has=Dz;wn.prototype.set=vz;function Zi(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function bz(){this.__data__={hash:new Yi,map:new(Tf||wn),string:new Yi}}function wz(t){return Nf(this,t).delete(t)}function _z(t){return Nf(this,t).get(t)}function Ez(t){return Nf(this,t).has(t)}function Cz(t,e){return Nf(this,t).set(t,e),this}Zi.prototype.clear=bz;Zi.prototype.delete=wz;Zi.prototype.get=_z;Zi.prototype.has=Ez;Zi.prototype.set=Cz;function Pf(t){var e=-1,r=t?t.length:0;for(this.__data__=new Zi;++e<r;)this.add(t[e])}function Sz(t){return this.__data__.set(t,Ry),this}function xz(t){return this.__data__.has(t)}Pf.prototype.add=Pf.prototype.push=Sz;Pf.prototype.has=xz;function bn(t){this.__data__=new wn(t)}function Fz(){this.__data__=new wn}function Oz(t){return this.__data__.delete(t)}function Az(t){return this.__data__.get(t)}function kz(t){return this.__data__.has(t)}function Tz(t,e){var r=this.__data__;return r instanceof wn&&r.__data__.length==xH&&(r=this.__data__=new Zi(r.__data__)),r.set(t,e),this}bn.prototype.clear=Fz;bn.prototype.delete=Oz;bn.prototype.get=Az;bn.prototype.has=kz;bn.prototype.set=Tz;function jf(t,e){for(var r=t.length;r--;)if(Jz(t[r][0],e))return r;return-1}function gx(t,e){e=Lf(e,t)?[e]:vx(e);for(var r=0,n=e.length;t!=null&&r<n;)t=t[Bf(e[r++])];return r&&r==n?t:void 0}function yx(t,e){return Ki.call(t,e)||typeof t=="object"&&e in t&&zz(t)===null}function Pz(t,e){return e in Object(t)}function Iy(t,e,r,n,i){return t===e?!0:t==null||e==null||!Mf(t)&&!Bu(e)?t!==t&&e!==e:Rz(t,e,Iy,r,n,i)}function Rz(t,e,r,n,i,o){var s=ni(t),a=ni(e),u=Sy,c=Sy;s||(u=vn(t),u=u==Af?Ds:u),a||(c=vn(e),c=c==Af?Ds:c);var l=u==Ds&&!Fy(t),f=c==Ds&&!Fy(e),h=u==c;if(h&&!l)return o||(o=new bn),s||Qz(t)?bx(t,e,r,n,i,o):Mz(t,e,u,r,n,i,o);if(!(i&bs)){var d=l&&Ki.call(t,"__wrapped__"),p=f&&Ki.call(e,"__wrapped__");if(d||p){var v=d?t.value():t,g=p?e.value():e;return o||(o=new bn),r(v,g,n,i,o)}}return h?(o||(o=new bn),Uz(t,e,r,n,i,o)):!1}function $z(t,e,r,n){var i=r.length,o=i,s=!n;if(t==null)return!o;for(t=Object(t);i--;){var a=r[i];if(s&&a[2]?a[1]!==t[a[0]]:!(a[0]in t))return!1}for(;++i<o;){a=r[i];var u=a[0],c=t[u],l=a[1];if(s&&a[2]){if(c===void 0&&!(u in t))return!1}else{var f=new bn;if(n)var h=n(c,l,u,t,e,f);if(!(h===void 0?Iy(l,c,n,Rf|bs,f):h))return!1}}return!0}function Iz(t){return typeof t=="function"?t:t==null?nG:typeof t=="object"?ni(t)?Lz(t[0],t[1]):Nz(t):iG(t)}function jz(t){return iz(Object(t))}function Nz(t){var e=Hz(t);return e.length==1&&e[0][2]?Ex(e[0][0],e[0][1]):function(r){return r===t||$z(r,t,e)}}function Lz(t,e){return Lf(t)&&_x(e)?Ex(Bf(t),e):function(r){var n=eG(r,t);return n===void 0&&n===e?tG(r,t):Iy(e,n,void 0,Rf|bs)}}function Dx(t){return function(e){return e?.[t]}}function Bz(t){return function(e){return gx(e,t)}}function vx(t){return ni(t)?t:SH(t)}function qz(t){return function(e){var r=vn(e);return r==Iu?px(e):r==ju?ZH(e):JH(e,t(e))}}function bx(t,e,r,n,i,o){var s=i&bs,a=t.length,u=e.length;if(a!=u&&!(s&&u>a))return!1;var c=o.get(t);if(c)return c==e;var l=-1,f=!0,h=i&Rf?new Pf:void 0;for(o.set(t,e);++l<a;){var d=t[l],p=e[l];if(n)var v=s?n(p,d,l,e,t,o):n(d,p,l,t,e,o);if(v!==void 0){if(v)continue;f=!1;break}if(h){if(!KH(e,function(g,w){if(!h.has(w)&&(d===g||r(d,g,n,i,o)))return h.add(w)})){f=!1;break}}else if(!(d===p||r(d,p,n,i,o))){f=!1;break}}return o.delete(t),f}function Mz(t,e,r,n,i,o,s){switch(r){case kf:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case hx:return!(t.byteLength!=e.byteLength||!n(new nx(t),new nx(e)));case sx:case ax:return+t==+e;case ux:return t.name==e.name&&t.message==e.message;case lx:return t!=+t?e!=+e:t==+e;case fx:case $y:return t==e+"";case Iu:var a=px;case ju:var u=o&bs;if(a||(a=XH),t.size!=e.size&&!u)return!1;var c=s.get(t);return c?c==e:(o|=Rf,s.set(t,e),bx(a(t),a(e),n,i,o,s));case dx:if(Cy)return Cy.call(t)==Cy.call(e)}return!1}function Uz(t,e,r,n,i,o){var s=i&bs,a=Py(t),u=a.length,c=Py(e),l=c.length;if(u!=l&&!s)return!1;for(var f=u;f--;){var h=a[f];if(!(s?h in e:yx(e,h)))return!1}var d=o.get(t);if(d)return d==e;var p=!0;o.set(t,e);for(var v=s;++f<u;){h=a[f];var g=t[h],w=e[h];if(n)var x=s?n(w,g,h,e,t,o):n(g,w,h,t,e,o);if(!(x===void 0?g===w||r(g,w,n,i,o):x)){p=!1;break}v||(v=h=="constructor")}if(p&&!v){var D=t.constructor,C=e.constructor;D!=C&&"constructor"in t&&"constructor"in e&&!(typeof D=="function"&&D instanceof D&&typeof C=="function"&&C instanceof C)&&(p=!1)}return o.delete(t),p}var Vz=Dx("length");function Nf(t,e){var r=t.__data__;return Kz(e)?r[typeof e=="string"?"string":"hash"]:r.map}function Hz(t){for(var e=rG(t),r=e.length;r--;)e[r][2]=_x(e[r][1]);return e}function ws(t,e){var r=t[e];return Zz(r)?r:void 0}function zz(t){return nz(Object(t))}function vn(t){return Xi.call(t)}(Oy&&vn(new Oy(new ArrayBuffer(1)))!=kf||Tf&&vn(new Tf)!=Iu||Ay&&vn(Ay.resolve())!=ex||ky&&vn(new ky)!=ju||Ty&&vn(new Ty)!=xy)&&(vn=function(t){var e=Xi.call(t),r=e==Ds?t.constructor:void 0,n=r?Qi(r):void 0;if(n)switch(n){case oz:return kf;case sz:return Iu;case az:return ex;case uz:return ju;case cz:return xy}return e});function Gz(t,e,r){e=Lf(e,t)?[e]:vx(e);for(var n,i=-1,s=e.length;++i<s;){var o=Bf(e[i]);if(!(n=t!=null&&r(t,o)))break;t=t[o]}if(n)return n;var s=t?t.length:0;return!!s&&qf(s)&&wx(o,s)&&(ni(t)||Fx(t)||Cx(t))}function Wz(t){var e=t?t.length:void 0;return qf(e)&&(ni(t)||Fx(t)||Cx(t))?YH(e,String):null}function wx(t,e){return e=e??ox,!!e&&(typeof t=="number"||UH.test(t))&&t>-1&&t%1==0&&t<e}function Lf(t,e){if(ni(t))return!1;var r=typeof t;return r=="number"||r=="symbol"||r=="boolean"||t==null||Ox(t)?!0:BH.test(t)||!LH.test(t)||e!=null&&t in Object(e)}function Kz(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function Yz(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||If;return t===r}function _x(t){return t===t&&!Mf(t)}function Ex(t,e){return function(r){return r==null?!1:r[t]===e&&(e!==void 0||t in Object(r))}}function Bf(t){if(typeof t=="string"||Ox(t))return t;var e=t+"";return e=="0"&&1/t==-FH?"-0":e}function Qi(t){if(t!=null){try{return mx.call(t)}catch{}try{return t+""}catch{}}return""}function Jz(t,e){return t===e||t!==t&&e!==e}function Cx(t){return Xz(t)&&Ki.call(t,"callee")&&(!tz.call(t,"callee")||Xi.call(t)==Af)}var ni=Array.isArray;function Sx(t){return t!=null&&qf(Vz(t))&&!xx(t)}function Xz(t){return Bu(t)&&Sx(t)}function xx(t){var e=Mf(t)?Xi.call(t):"";return e==cx||e==OH}function qf(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=ox}function Mf(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function Bu(t){return!!t&&typeof t=="object"}function Zz(t){if(!Mf(t))return!1;var e=xx(t)||Fy(t)?ez:MH;return e.test(Qi(t))}function Fx(t){return typeof t=="string"||!ni(t)&&Bu(t)&&Xi.call(t)==$y}function Ox(t){return typeof t=="symbol"||Bu(t)&&Xi.call(t)==dx}function Qz(t){return Bu(t)&&qf(t.length)&&!!Re[Xi.call(t)]}function eG(t,e,r){var n=t==null?void 0:gx(t,e);return n===void 0?r:n}function tG(t,e){return t!=null&&Gz(t,e,Pz)}function Py(t){var e=Yz(t);if(!(e||Sx(t)))return jz(t);var r=Wz(t),n=!!r,i=r||[],o=i.length;for(var s in t)yx(t,s)&&!(n&&(s=="length"||wx(s,o)))&&!(e&&s=="constructor")&&i.push(s);return i}var rG=qz(Py);function nG(t){return t}function iG(t){return Lf(t)?Dx(Bf(t)):Bz(t)}vs.exports=Iz});var $x=y((eo,_s)=>{var oG=1/0,sG="[object Function]",aG="[object GeneratorFunction]",uG=/[\\^$.*+?()[\]{}|]/g,cG=/^\[object .+?Constructor\]$/,qu={function:!0,object:!0},lG=qu[typeof eo]&&eo&&!eo.nodeType?eo:void 0,fG=qu[typeof _s]&&_s&&!_s.nodeType?_s:void 0,dG=Uf(lG&&fG&&typeof global=="object"&&global),hG=Uf(qu[typeof self]&&self),kx=Uf(qu[typeof window]&&window),jy=Uf(qu[typeof eo]&&eo),pG=dG||kx!==(jy&&jy.window)&&kx||hG||jy||Function("return this")();function Uf(t){return t&&t.Object===Object?t:null}function mG(t){var e=!1;if(t!=null&&typeof t.toString!="function")try{e=!!(t+"")}catch{}return e}function gG(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}var Tx=Object.prototype,Px=Function.prototype.toString,yG=Tx.hasOwnProperty,DG=Tx.toString,vG=RegExp("^"+Px.call(yG).replace(uG,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ny=wG(pG,"Set"),bG=Ny&&1/gG(new Ny([,-0]))[1]==oG?function(t){return new Ny(t)}:SG;function wG(t,e){var r=t[e];return CG(r)?r:void 0}function _G(t){if(t!=null){try{return Px.call(t)}catch{}try{return t+""}catch{}}return""}function EG(t){var e=Rx(t)?DG.call(t):"";return e==sG||e==aG}function Rx(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function CG(t){if(!Rx(t))return!1;var e=EG(t)||mG(t)?vG:cG;return e.test(_G(t))}function SG(){}_s.exports=bG});var jx=y((to,Es)=>{var Mu={function:!0,object:!0},xG=Mu[typeof to]&&to&&!to.nodeType?to:void 0,FG=Mu[typeof Es]&&Es&&!Es.nodeType?Es:void 0,OG=Vf(xG&&FG&&typeof global=="object"&&global),AG=Vf(Mu[typeof self]&&self),Ix=Vf(Mu[typeof window]&&window),Ly=Vf(Mu[typeof to]&&to),kG=OG||Ix!==(Ly&&Ly.window)&&Ix||AG||Ly||Function("return this")();function Vf(t){return t&&t.Object===Object?t:null}Es.exports=kG});var Ux=y((Nde,Mx)=>{var TG=$x(),PG=jx(),RG=200,By="__lodash_hash_undefined__",$G="[object Function]",IG="[object GeneratorFunction]",jG=/[\\^$.*+?()[\]{}|]/g,NG=/^\[object .+?Constructor\]$/;function LG(t,e){return!!t.length&&qG(t,e,0)>-1}function BG(t,e,r){for(var n=-1,i=t.length;++n<i;)if(r(e,t[n]))return!0;return!1}function qG(t,e,r){if(e!==e)return UG(t,r);for(var n=r-1,i=t.length;++n<i;)if(t[n]===e)return n;return-1}function MG(t,e){return t.has(e)}function UG(t,e,r){for(var n=t.length,i=e+(r?0:-1);r?i--:++i<n;){var o=t[i];if(o!==o)return i}return-1}function VG(t){var e=!1;if(t!=null&&typeof t.toString!="function")try{e=!!(t+"")}catch{}return e}function HG(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}var zG=Array.prototype,Nx=Object.prototype,Lx=Function.prototype.toString,qy=Nx.hasOwnProperty,GG=Nx.toString,WG=RegExp("^"+Lx.call(qy).replace(jG,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),KG=zG.splice,YG=Bx(PG,"Map"),Uu=Bx(Object,"create");function ro(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function JG(){this.__data__=Uu?Uu(null):{}}function XG(t){return this.has(t)&&delete this.__data__[t]}function ZG(t){var e=this.__data__;if(Uu){var r=e[t];return r===By?void 0:r}return qy.call(e,t)?e[t]:void 0}function QG(t){var e=this.__data__;return Uu?e[t]!==void 0:qy.call(e,t)}function eW(t,e){var r=this.__data__;return r[t]=Uu&&e===void 0?By:e,this}ro.prototype.clear=JG;ro.prototype.delete=XG;ro.prototype.get=ZG;ro.prototype.has=QG;ro.prototype.set=eW;function Cs(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function tW(){this.__data__=[]}function rW(t){var e=this.__data__,r=zf(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():KG.call(e,r,1),!0}function nW(t){var e=this.__data__,r=zf(e,t);return r<0?void 0:e[r][1]}function iW(t){return zf(this.__data__,t)>-1}function oW(t,e){var r=this.__data__,n=zf(r,t);return n<0?r.push([t,e]):r[n][1]=e,this}Cs.prototype.clear=tW;Cs.prototype.delete=rW;Cs.prototype.get=nW;Cs.prototype.has=iW;Cs.prototype.set=oW;function Ss(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function sW(){this.__data__={hash:new ro,map:new(YG||Cs),string:new ro}}function aW(t){return Gf(this,t).delete(t)}function uW(t){return Gf(this,t).get(t)}function cW(t){return Gf(this,t).has(t)}function lW(t,e){return Gf(this,t).set(t,e),this}Ss.prototype.clear=sW;Ss.prototype.delete=aW;Ss.prototype.get=uW;Ss.prototype.has=cW;Ss.prototype.set=lW;function Hf(t){var e=-1,r=t?t.length:0;for(this.__data__=new Ss;++e<r;)this.add(t[e])}function fW(t){return this.__data__.set(t,By),this}function dW(t){return this.__data__.has(t)}Hf.prototype.add=Hf.prototype.push=fW;Hf.prototype.has=dW;function zf(t,e){for(var r=t.length;r--;)if(gW(t[r][0],e))return r;return-1}function hW(t,e,r){var n=-1,i=LG,o=t.length,s=!0,a=[],u=a;if(r)s=!1,i=BG;else if(o>=RG){var c=e?null:TG(t);if(c)return HG(c);s=!1,i=MG,u=new Hf}else u=e?[]:a;e:for(;++n<o;){var l=t[n],f=e?e(l):l;if(l=r||l!==0?l:0,s&&f===f){for(var h=u.length;h--;)if(u[h]===f)continue e;e&&u.push(f),a.push(l)}else i(u,f,r)||(u!==a&&u.push(f),a.push(l))}return a}function Gf(t,e){var r=t.__data__;return pW(e)?r[typeof e=="string"?"string":"hash"]:r.map}function Bx(t,e){var r=t[e];return DW(r)?r:void 0}function pW(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function mW(t){if(t!=null){try{return Lx.call(t)}catch{}try{return t+""}catch{}}return""}function gW(t,e){return t===e||t!==t&&e!==e}function yW(t){var e=qx(t)?GG.call(t):"";return e==$G||e==IG}function qx(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function DW(t){if(!qx(t))return!1;var e=yW(t)||VG(t)?WG:NG;return e.test(mW(t))}Mx.exports=hW});var Hx=y((Lde,Vx)=>{var vW=Ax(),bW=Ux();function wW(t,e){return t&&t.length?bW(t,vW(e)):[]}Vx.exports=wW});var Gx=y((Bde,zx)=>{"use strict";var _W=M1(),EW=Hx(),CW=_W("MultiError");zx.exports=My;function My(t){if(!(this instanceof My))return new My(t);if(t=Array.isArray(t)?t:[t],t=EW(t,function(r){return r.stack}),t.length===1)return t[0];var e=new CW({message:t.map(function(r){return r.message}).join("; "),errors:t.reduce(function(r,n){return r.concat(n.errors||n)},[])});return e.__defineGetter__("stack",function(){return t.map(function(r){return r.stack}).join(`
35
+ `),Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,get:function(){return i},set:function(l){i=l,c()}}),Object.defineProperty(this,"message",{configurable:!0,enumerable:!0,get:function(){return s},set:function(l){s=l,c()}}),c())}});var B1=y((Ide,L1)=>{"use strict";L1.exports=Mi;Mi.factory=j1();var Dy=Mi("CustomError");Dy.order=Mi(Dy,{message:"Arguments out of order.",code:"EOARG"});function Mi(t,e,r,n){var i,o;return e=wf(arguments,1,Error,N1,[gy,_f]),r=wf(arguments,2,{},gy,[_f]),n=wf(arguments,3,yy,_f,[]),t=wf(arguments,0,e===Error?"Error":e.prototype.CustomError.name,SV,[N1,gy,_f]),o=e===Error,o&&n===yy&&(n=Mi.factory.root),i=function(s,a){var u,c,l,f,h,d;if(!(this instanceof i))return new i(s,a);for(delete this.constructor.name,Object.defineProperty(this.constructor,"name",{enumerable:!1,configurable:!0,value:t,writable:!1}),typeof s=="string"&&(s={message:s}),s||(s={}),c=this.CustomError.chain.slice(0).reverse().map(function(p){return p.properties}),c.push(s),c.unshift({}),d=Object.assign.apply(Object,c),u=this,l={},Object.keys(Mi.factory).forEach(function(p){l[p]=function(v,g){Mi.factory[p].call(u,v,g,l)}}),f=this.CustomError.chain.length-1;f>=0;f--)h=this.CustomError.chain[f],h.factory!==yy&&h.factory.call(this,d,a,l)},i.prototype=Object.create(e.prototype),i.prototype.constructor=i,i.prototype.name=t,i.prototype.CustomError={chain:o?[]:e.prototype.CustomError.chain.slice(0),factory:n,name:t,parent:e,properties:r},i.prototype.CustomError.chain.unshift(i.prototype.CustomError),i.prototype.toString=function(){var s=this.CustomError.chain[this.CustomError.chain.length-1].name;return this.code&&(s+=" "+this.code),this.message&&(s+=": "+this.message),s},i}function wf(t,e,r,n,i){var o=-1,s=-1,a,u,c=e<t.length?e:t.length,l;for(a=0;a<=c;a++){if(l=t[a],o===-1)for(u=0;u<i.length;u++)i[u](l)&&(o=a);s===-1&&n(l)&&(s=a)}if(s!==-1&&o!==-1&&o<s)throw new Dy.order;return s!==-1?t[s]:r}function _f(t){return typeof t=="function"&&t!==Error&&!t.prototype.CustomError}function SV(t){return typeof t=="string"}function N1(t){return typeof t=="function"&&(t===Error||t.prototype.CustomError)}function gy(t){return t&&typeof t=="object"}function yy(){}});var M1=y((jde,q1)=>{q1.exports=B1()});var G1=y((Ui,ms)=>{var xV=1/0,FV="[object Symbol]",Pu={function:!0,object:!0},OV=Pu[typeof Ui]&&Ui&&!Ui.nodeType?Ui:void 0,AV=Pu[typeof ms]&&ms&&!ms.nodeType?ms:void 0,kV=Ef(OV&&AV&&typeof global=="object"&&global),TV=Ef(Pu[typeof self]&&self),U1=Ef(Pu[typeof window]&&window),vy=Ef(Pu[typeof Ui]&&Ui),PV=kV||U1!==(vy&&vy.window)&&U1||TV||vy||Function("return this")();function Ef(t){return t&&t.Object===Object?t:null}var RV=Object.prototype,$V=RV.toString,V1=PV.Symbol,H1=V1?V1.prototype:void 0,z1=H1?H1.toString:void 0;function IV(t){if(typeof t=="string")return t;if(NV(t))return z1?z1.call(t):"";var e=t+"";return e=="0"&&1/t==-xV?"-0":e}function jV(t){return!!t&&typeof t=="object"}function NV(t){return typeof t=="symbol"||jV(t)&&$V.call(t)==FV}ms.exports=IV});var Q1=y((Vi,gs)=>{var LV=G1(),BV="Expected a function",K1="__lodash_hash_undefined__",qV="[object Function]",MV="[object GeneratorFunction]",UV=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]/g,VV=/[\\^$.*+?()[\]{}|]/g,HV=/\\(\\)?/g,zV=/^\[object .+?Constructor\]$/,$u={function:!0,object:!0},GV=$u[typeof Vi]&&Vi&&!Vi.nodeType?Vi:void 0,WV=$u[typeof gs]&&gs&&!gs.nodeType?gs:void 0,KV=Cf(GV&&WV&&typeof global=="object"&&global),YV=Cf($u[typeof self]&&self),W1=Cf($u[typeof window]&&window),by=Cf($u[typeof Vi]&&Vi),JV=KV||W1!==(by&&by.window)&&W1||YV||by||Function("return this")();function Cf(t){return t&&t.Object===Object?t:null}function XV(t){var e=!1;if(t!=null&&typeof t.toString!="function")try{e=!!(t+"")}catch{}return e}var ZV=Array.prototype,Y1=Object.prototype,J1=Function.prototype.toString,wy=Y1.hasOwnProperty,QV=Y1.toString,eH=RegExp("^"+J1.call(wy).replace(VV,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),tH=ZV.splice,rH=X1(JV,"Map"),Ru=X1(Object,"create");function Hi(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function nH(){this.__data__=Ru?Ru(null):{}}function iH(t){return this.has(t)&&delete this.__data__[t]}function oH(t){var e=this.__data__;if(Ru){var r=e[t];return r===K1?void 0:r}return wy.call(e,t)?e[t]:void 0}function sH(t){var e=this.__data__;return Ru?e[t]!==void 0:wy.call(e,t)}function aH(t,e){var r=this.__data__;return r[t]=Ru&&e===void 0?K1:e,this}Hi.prototype.clear=nH;Hi.prototype.delete=iH;Hi.prototype.get=oH;Hi.prototype.has=sH;Hi.prototype.set=aH;function ys(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function uH(){this.__data__=[]}function cH(t){var e=this.__data__,r=Sf(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():tH.call(e,r,1),!0}function lH(t){var e=this.__data__,r=Sf(e,t);return r<0?void 0:e[r][1]}function fH(t){return Sf(this.__data__,t)>-1}function dH(t,e){var r=this.__data__,n=Sf(r,t);return n<0?r.push([t,e]):r[n][1]=e,this}ys.prototype.clear=uH;ys.prototype.delete=cH;ys.prototype.get=lH;ys.prototype.has=fH;ys.prototype.set=dH;function zi(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function hH(){this.__data__={hash:new Hi,map:new(rH||ys),string:new Hi}}function pH(t){return xf(this,t).delete(t)}function mH(t){return xf(this,t).get(t)}function gH(t){return xf(this,t).has(t)}function yH(t,e){return xf(this,t).set(t,e),this}zi.prototype.clear=hH;zi.prototype.delete=pH;zi.prototype.get=mH;zi.prototype.has=gH;zi.prototype.set=yH;function Sf(t,e){for(var r=t.length;r--;)if(wH(t[r][0],e))return r;return-1}function xf(t,e){var r=t.__data__;return DH(e)?r[typeof e=="string"?"string":"hash"]:r.map}function X1(t,e){var r=t[e];return EH(r)?r:void 0}function DH(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}var vH=_y(function(t){var e=[];return CH(t).replace(UV,function(r,n,i,o){e.push(i?o.replace(HV,"$1"):n||r)}),e});function bH(t){if(t!=null){try{return J1.call(t)}catch{}try{return t+""}catch{}}return""}function _y(t,e){if(typeof t!="function"||e&&typeof e!="function")throw new TypeError(BV);var r=function(){var n=arguments,i=e?e.apply(this,n):n[0],o=r.cache;if(o.has(i))return o.get(i);var s=t.apply(this,n);return r.cache=o.set(i,s),s};return r.cache=new(_y.Cache||zi),r}_y.Cache=zi;function wH(t,e){return t===e||t!==t&&e!==e}function _H(t){var e=Z1(t)?QV.call(t):"";return e==qV||e==MV}function Z1(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function EH(t){if(!Z1(t))return!1;var e=_H(t)||XV(t)?eH:zV;return e.test(bH(t))}function CH(t){return t==null?"":LV(t)}gs.exports=vH});var Ax=y((Gi,vs)=>{var SH=Q1(),xH=200,Ry="__lodash_hash_undefined__",Tf=1,bs=2,FH=1/0,ox=9007199254740991,Ff="[object Arguments]",Sy="[object Array]",sx="[object Boolean]",ax="[object Date]",ux="[object Error]",cx="[object Function]",OH="[object GeneratorFunction]",Iu="[object Map]",lx="[object Number]",Ds="[object Object]",ex="[object Promise]",fx="[object RegExp]",ju="[object Set]",$y="[object String]",dx="[object Symbol]",xy="[object WeakMap]",hx="[object ArrayBuffer]",Of="[object DataView]",AH="[object Float32Array]",kH="[object Float64Array]",TH="[object Int8Array]",PH="[object Int16Array]",RH="[object Int32Array]",$H="[object Uint8Array]",IH="[object Uint8ClampedArray]",jH="[object Uint16Array]",NH="[object Uint32Array]",LH=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,BH=/^\w*$/,qH=/[\\^$.*+?()[\]{}|]/g,MH=/^\[object .+?Constructor\]$/,UH=/^(?:0|[1-9]\d*)$/,Re={};Re[AH]=Re[kH]=Re[TH]=Re[PH]=Re[RH]=Re[$H]=Re[IH]=Re[jH]=Re[NH]=!0;Re[Ff]=Re[Sy]=Re[hx]=Re[sx]=Re[Of]=Re[ax]=Re[ux]=Re[cx]=Re[Iu]=Re[lx]=Re[Ds]=Re[fx]=Re[ju]=Re[$y]=Re[xy]=!1;var Lu={function:!0,object:!0},VH=Lu[typeof Gi]&&Gi&&!Gi.nodeType?Gi:void 0,HH=Lu[typeof vs]&&vs&&!vs.nodeType?vs:void 0,zH=Pf(VH&&HH&&typeof global=="object"&&global),GH=Pf(Lu[typeof self]&&self),tx=Pf(Lu[typeof window]&&window),Ey=Pf(Lu[typeof Gi]&&Gi),Yi=zH||tx!==(Ey&&Ey.window)&&tx||GH||Ey||Function("return this")();function WH(t,e){for(var r=-1,n=t.length,i=Array(n);++r<n;)i[r]=e(t[r],r,t);return i}function KH(t,e){for(var r=-1,n=t.length;++r<n;)if(e(t[r],r,t))return!0;return!1}function YH(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}function JH(t,e){return WH(e,function(r){return[r,t[r]]})}function Pf(t){return t&&t.Object===Object?t:null}function Fy(t){var e=!1;if(t!=null&&typeof t.toString!="function")try{e=!!(t+"")}catch{}return e}function px(t){var e=-1,r=Array(t.size);return t.forEach(function(n,i){r[++e]=[i,n]}),r}function XH(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}function ZH(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=[n,n]}),r}var QH=Array.prototype,Rf=Object.prototype,mx=Function.prototype.toString,Wi=Rf.hasOwnProperty,Ji=Rf.toString,ez=RegExp("^"+mx.call(Wi).replace(qH,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),rx=Yi.Symbol,nx=Yi.Uint8Array,tz=Rf.propertyIsEnumerable,rz=QH.splice,nz=Object.getPrototypeOf,iz=Object.keys,Oy=ws(Yi,"DataView"),Af=ws(Yi,"Map"),Ay=ws(Yi,"Promise"),ky=ws(Yi,"Set"),Ty=ws(Yi,"WeakMap"),Nu=ws(Object,"create"),oz=Zi(Oy),sz=Zi(Af),az=Zi(Ay),uz=Zi(ky),cz=Zi(Ty),ix=rx?rx.prototype:void 0,Cy=ix?ix.valueOf:void 0;function Ki(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function lz(){this.__data__=Nu?Nu(null):{}}function fz(t){return this.has(t)&&delete this.__data__[t]}function dz(t){var e=this.__data__;if(Nu){var r=e[t];return r===Ry?void 0:r}return Wi.call(e,t)?e[t]:void 0}function hz(t){var e=this.__data__;return Nu?e[t]!==void 0:Wi.call(e,t)}function pz(t,e){var r=this.__data__;return r[t]=Nu&&e===void 0?Ry:e,this}Ki.prototype.clear=lz;Ki.prototype.delete=fz;Ki.prototype.get=dz;Ki.prototype.has=hz;Ki.prototype.set=pz;function wn(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function mz(){this.__data__=[]}function gz(t){var e=this.__data__,r=$f(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():rz.call(e,r,1),!0}function yz(t){var e=this.__data__,r=$f(e,t);return r<0?void 0:e[r][1]}function Dz(t){return $f(this.__data__,t)>-1}function vz(t,e){var r=this.__data__,n=$f(r,t);return n<0?r.push([t,e]):r[n][1]=e,this}wn.prototype.clear=mz;wn.prototype.delete=gz;wn.prototype.get=yz;wn.prototype.has=Dz;wn.prototype.set=vz;function Xi(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function bz(){this.__data__={hash:new Ki,map:new(Af||wn),string:new Ki}}function wz(t){return If(this,t).delete(t)}function _z(t){return If(this,t).get(t)}function Ez(t){return If(this,t).has(t)}function Cz(t,e){return If(this,t).set(t,e),this}Xi.prototype.clear=bz;Xi.prototype.delete=wz;Xi.prototype.get=_z;Xi.prototype.has=Ez;Xi.prototype.set=Cz;function kf(t){var e=-1,r=t?t.length:0;for(this.__data__=new Xi;++e<r;)this.add(t[e])}function Sz(t){return this.__data__.set(t,Ry),this}function xz(t){return this.__data__.has(t)}kf.prototype.add=kf.prototype.push=Sz;kf.prototype.has=xz;function bn(t){this.__data__=new wn(t)}function Fz(){this.__data__=new wn}function Oz(t){return this.__data__.delete(t)}function Az(t){return this.__data__.get(t)}function kz(t){return this.__data__.has(t)}function Tz(t,e){var r=this.__data__;return r instanceof wn&&r.__data__.length==xH&&(r=this.__data__=new Xi(r.__data__)),r.set(t,e),this}bn.prototype.clear=Fz;bn.prototype.delete=Oz;bn.prototype.get=Az;bn.prototype.has=kz;bn.prototype.set=Tz;function $f(t,e){for(var r=t.length;r--;)if(Jz(t[r][0],e))return r;return-1}function gx(t,e){e=jf(e,t)?[e]:vx(e);for(var r=0,n=e.length;t!=null&&r<n;)t=t[Nf(e[r++])];return r&&r==n?t:void 0}function yx(t,e){return Wi.call(t,e)||typeof t=="object"&&e in t&&zz(t)===null}function Pz(t,e){return e in Object(t)}function Iy(t,e,r,n,i){return t===e?!0:t==null||e==null||!Bf(t)&&!Bu(e)?t!==t&&e!==e:Rz(t,e,Iy,r,n,i)}function Rz(t,e,r,n,i,o){var s=ni(t),a=ni(e),u=Sy,c=Sy;s||(u=vn(t),u=u==Ff?Ds:u),a||(c=vn(e),c=c==Ff?Ds:c);var l=u==Ds&&!Fy(t),f=c==Ds&&!Fy(e),h=u==c;if(h&&!l)return o||(o=new bn),s||Qz(t)?bx(t,e,r,n,i,o):Mz(t,e,u,r,n,i,o);if(!(i&bs)){var d=l&&Wi.call(t,"__wrapped__"),p=f&&Wi.call(e,"__wrapped__");if(d||p){var v=d?t.value():t,g=p?e.value():e;return o||(o=new bn),r(v,g,n,i,o)}}return h?(o||(o=new bn),Uz(t,e,r,n,i,o)):!1}function $z(t,e,r,n){var i=r.length,o=i,s=!n;if(t==null)return!o;for(t=Object(t);i--;){var a=r[i];if(s&&a[2]?a[1]!==t[a[0]]:!(a[0]in t))return!1}for(;++i<o;){a=r[i];var u=a[0],c=t[u],l=a[1];if(s&&a[2]){if(c===void 0&&!(u in t))return!1}else{var f=new bn;if(n)var h=n(c,l,u,t,e,f);if(!(h===void 0?Iy(l,c,n,Tf|bs,f):h))return!1}}return!0}function Iz(t){return typeof t=="function"?t:t==null?nG:typeof t=="object"?ni(t)?Lz(t[0],t[1]):Nz(t):iG(t)}function jz(t){return iz(Object(t))}function Nz(t){var e=Hz(t);return e.length==1&&e[0][2]?Ex(e[0][0],e[0][1]):function(r){return r===t||$z(r,t,e)}}function Lz(t,e){return jf(t)&&_x(e)?Ex(Nf(t),e):function(r){var n=eG(r,t);return n===void 0&&n===e?tG(r,t):Iy(e,n,void 0,Tf|bs)}}function Dx(t){return function(e){return e?.[t]}}function Bz(t){return function(e){return gx(e,t)}}function vx(t){return ni(t)?t:SH(t)}function qz(t){return function(e){var r=vn(e);return r==Iu?px(e):r==ju?ZH(e):JH(e,t(e))}}function bx(t,e,r,n,i,o){var s=i&bs,a=t.length,u=e.length;if(a!=u&&!(s&&u>a))return!1;var c=o.get(t);if(c)return c==e;var l=-1,f=!0,h=i&Tf?new kf:void 0;for(o.set(t,e);++l<a;){var d=t[l],p=e[l];if(n)var v=s?n(p,d,l,e,t,o):n(d,p,l,t,e,o);if(v!==void 0){if(v)continue;f=!1;break}if(h){if(!KH(e,function(g,w){if(!h.has(w)&&(d===g||r(d,g,n,i,o)))return h.add(w)})){f=!1;break}}else if(!(d===p||r(d,p,n,i,o))){f=!1;break}}return o.delete(t),f}function Mz(t,e,r,n,i,o,s){switch(r){case Of:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case hx:return!(t.byteLength!=e.byteLength||!n(new nx(t),new nx(e)));case sx:case ax:return+t==+e;case ux:return t.name==e.name&&t.message==e.message;case lx:return t!=+t?e!=+e:t==+e;case fx:case $y:return t==e+"";case Iu:var a=px;case ju:var u=o&bs;if(a||(a=XH),t.size!=e.size&&!u)return!1;var c=s.get(t);return c?c==e:(o|=Tf,s.set(t,e),bx(a(t),a(e),n,i,o,s));case dx:if(Cy)return Cy.call(t)==Cy.call(e)}return!1}function Uz(t,e,r,n,i,o){var s=i&bs,a=Py(t),u=a.length,c=Py(e),l=c.length;if(u!=l&&!s)return!1;for(var f=u;f--;){var h=a[f];if(!(s?h in e:yx(e,h)))return!1}var d=o.get(t);if(d)return d==e;var p=!0;o.set(t,e);for(var v=s;++f<u;){h=a[f];var g=t[h],w=e[h];if(n)var x=s?n(w,g,h,e,t,o):n(g,w,h,t,e,o);if(!(x===void 0?g===w||r(g,w,n,i,o):x)){p=!1;break}v||(v=h=="constructor")}if(p&&!v){var D=t.constructor,C=e.constructor;D!=C&&"constructor"in t&&"constructor"in e&&!(typeof D=="function"&&D instanceof D&&typeof C=="function"&&C instanceof C)&&(p=!1)}return o.delete(t),p}var Vz=Dx("length");function If(t,e){var r=t.__data__;return Kz(e)?r[typeof e=="string"?"string":"hash"]:r.map}function Hz(t){for(var e=rG(t),r=e.length;r--;)e[r][2]=_x(e[r][1]);return e}function ws(t,e){var r=t[e];return Zz(r)?r:void 0}function zz(t){return nz(Object(t))}function vn(t){return Ji.call(t)}(Oy&&vn(new Oy(new ArrayBuffer(1)))!=Of||Af&&vn(new Af)!=Iu||Ay&&vn(Ay.resolve())!=ex||ky&&vn(new ky)!=ju||Ty&&vn(new Ty)!=xy)&&(vn=function(t){var e=Ji.call(t),r=e==Ds?t.constructor:void 0,n=r?Zi(r):void 0;if(n)switch(n){case oz:return Of;case sz:return Iu;case az:return ex;case uz:return ju;case cz:return xy}return e});function Gz(t,e,r){e=jf(e,t)?[e]:vx(e);for(var n,i=-1,s=e.length;++i<s;){var o=Nf(e[i]);if(!(n=t!=null&&r(t,o)))break;t=t[o]}if(n)return n;var s=t?t.length:0;return!!s&&Lf(s)&&wx(o,s)&&(ni(t)||Fx(t)||Cx(t))}function Wz(t){var e=t?t.length:void 0;return Lf(e)&&(ni(t)||Fx(t)||Cx(t))?YH(e,String):null}function wx(t,e){return e=e??ox,!!e&&(typeof t=="number"||UH.test(t))&&t>-1&&t%1==0&&t<e}function jf(t,e){if(ni(t))return!1;var r=typeof t;return r=="number"||r=="symbol"||r=="boolean"||t==null||Ox(t)?!0:BH.test(t)||!LH.test(t)||e!=null&&t in Object(e)}function Kz(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function Yz(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||Rf;return t===r}function _x(t){return t===t&&!Bf(t)}function Ex(t,e){return function(r){return r==null?!1:r[t]===e&&(e!==void 0||t in Object(r))}}function Nf(t){if(typeof t=="string"||Ox(t))return t;var e=t+"";return e=="0"&&1/t==-FH?"-0":e}function Zi(t){if(t!=null){try{return mx.call(t)}catch{}try{return t+""}catch{}}return""}function Jz(t,e){return t===e||t!==t&&e!==e}function Cx(t){return Xz(t)&&Wi.call(t,"callee")&&(!tz.call(t,"callee")||Ji.call(t)==Ff)}var ni=Array.isArray;function Sx(t){return t!=null&&Lf(Vz(t))&&!xx(t)}function Xz(t){return Bu(t)&&Sx(t)}function xx(t){var e=Bf(t)?Ji.call(t):"";return e==cx||e==OH}function Lf(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=ox}function Bf(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function Bu(t){return!!t&&typeof t=="object"}function Zz(t){if(!Bf(t))return!1;var e=xx(t)||Fy(t)?ez:MH;return e.test(Zi(t))}function Fx(t){return typeof t=="string"||!ni(t)&&Bu(t)&&Ji.call(t)==$y}function Ox(t){return typeof t=="symbol"||Bu(t)&&Ji.call(t)==dx}function Qz(t){return Bu(t)&&Lf(t.length)&&!!Re[Ji.call(t)]}function eG(t,e,r){var n=t==null?void 0:gx(t,e);return n===void 0?r:n}function tG(t,e){return t!=null&&Gz(t,e,Pz)}function Py(t){var e=Yz(t);if(!(e||Sx(t)))return jz(t);var r=Wz(t),n=!!r,i=r||[],o=i.length;for(var s in t)yx(t,s)&&!(n&&(s=="length"||wx(s,o)))&&!(e&&s=="constructor")&&i.push(s);return i}var rG=qz(Py);function nG(t){return t}function iG(t){return jf(t)?Dx(Nf(t)):Bz(t)}vs.exports=Iz});var $x=y((Qi,_s)=>{var oG=1/0,sG="[object Function]",aG="[object GeneratorFunction]",uG=/[\\^$.*+?()[\]{}|]/g,cG=/^\[object .+?Constructor\]$/,qu={function:!0,object:!0},lG=qu[typeof Qi]&&Qi&&!Qi.nodeType?Qi:void 0,fG=qu[typeof _s]&&_s&&!_s.nodeType?_s:void 0,dG=qf(lG&&fG&&typeof global=="object"&&global),hG=qf(qu[typeof self]&&self),kx=qf(qu[typeof window]&&window),jy=qf(qu[typeof Qi]&&Qi),pG=dG||kx!==(jy&&jy.window)&&kx||hG||jy||Function("return this")();function qf(t){return t&&t.Object===Object?t:null}function mG(t){var e=!1;if(t!=null&&typeof t.toString!="function")try{e=!!(t+"")}catch{}return e}function gG(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}var Tx=Object.prototype,Px=Function.prototype.toString,yG=Tx.hasOwnProperty,DG=Tx.toString,vG=RegExp("^"+Px.call(yG).replace(uG,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ny=wG(pG,"Set"),bG=Ny&&1/gG(new Ny([,-0]))[1]==oG?function(t){return new Ny(t)}:SG;function wG(t,e){var r=t[e];return CG(r)?r:void 0}function _G(t){if(t!=null){try{return Px.call(t)}catch{}try{return t+""}catch{}}return""}function EG(t){var e=Rx(t)?DG.call(t):"";return e==sG||e==aG}function Rx(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function CG(t){if(!Rx(t))return!1;var e=EG(t)||mG(t)?vG:cG;return e.test(_G(t))}function SG(){}_s.exports=bG});var jx=y((eo,Es)=>{var Mu={function:!0,object:!0},xG=Mu[typeof eo]&&eo&&!eo.nodeType?eo:void 0,FG=Mu[typeof Es]&&Es&&!Es.nodeType?Es:void 0,OG=Mf(xG&&FG&&typeof global=="object"&&global),AG=Mf(Mu[typeof self]&&self),Ix=Mf(Mu[typeof window]&&window),Ly=Mf(Mu[typeof eo]&&eo),kG=OG||Ix!==(Ly&&Ly.window)&&Ix||AG||Ly||Function("return this")();function Mf(t){return t&&t.Object===Object?t:null}Es.exports=kG});var Ux=y((Nde,Mx)=>{var TG=$x(),PG=jx(),RG=200,By="__lodash_hash_undefined__",$G="[object Function]",IG="[object GeneratorFunction]",jG=/[\\^$.*+?()[\]{}|]/g,NG=/^\[object .+?Constructor\]$/;function LG(t,e){return!!t.length&&qG(t,e,0)>-1}function BG(t,e,r){for(var n=-1,i=t.length;++n<i;)if(r(e,t[n]))return!0;return!1}function qG(t,e,r){if(e!==e)return UG(t,r);for(var n=r-1,i=t.length;++n<i;)if(t[n]===e)return n;return-1}function MG(t,e){return t.has(e)}function UG(t,e,r){for(var n=t.length,i=e+(r?0:-1);r?i--:++i<n;){var o=t[i];if(o!==o)return i}return-1}function VG(t){var e=!1;if(t!=null&&typeof t.toString!="function")try{e=!!(t+"")}catch{}return e}function HG(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}var zG=Array.prototype,Nx=Object.prototype,Lx=Function.prototype.toString,qy=Nx.hasOwnProperty,GG=Nx.toString,WG=RegExp("^"+Lx.call(qy).replace(jG,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),KG=zG.splice,YG=Bx(PG,"Map"),Uu=Bx(Object,"create");function to(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function JG(){this.__data__=Uu?Uu(null):{}}function XG(t){return this.has(t)&&delete this.__data__[t]}function ZG(t){var e=this.__data__;if(Uu){var r=e[t];return r===By?void 0:r}return qy.call(e,t)?e[t]:void 0}function QG(t){var e=this.__data__;return Uu?e[t]!==void 0:qy.call(e,t)}function eW(t,e){var r=this.__data__;return r[t]=Uu&&e===void 0?By:e,this}to.prototype.clear=JG;to.prototype.delete=XG;to.prototype.get=ZG;to.prototype.has=QG;to.prototype.set=eW;function Cs(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function tW(){this.__data__=[]}function rW(t){var e=this.__data__,r=Vf(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():KG.call(e,r,1),!0}function nW(t){var e=this.__data__,r=Vf(e,t);return r<0?void 0:e[r][1]}function iW(t){return Vf(this.__data__,t)>-1}function oW(t,e){var r=this.__data__,n=Vf(r,t);return n<0?r.push([t,e]):r[n][1]=e,this}Cs.prototype.clear=tW;Cs.prototype.delete=rW;Cs.prototype.get=nW;Cs.prototype.has=iW;Cs.prototype.set=oW;function Ss(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function sW(){this.__data__={hash:new to,map:new(YG||Cs),string:new to}}function aW(t){return Hf(this,t).delete(t)}function uW(t){return Hf(this,t).get(t)}function cW(t){return Hf(this,t).has(t)}function lW(t,e){return Hf(this,t).set(t,e),this}Ss.prototype.clear=sW;Ss.prototype.delete=aW;Ss.prototype.get=uW;Ss.prototype.has=cW;Ss.prototype.set=lW;function Uf(t){var e=-1,r=t?t.length:0;for(this.__data__=new Ss;++e<r;)this.add(t[e])}function fW(t){return this.__data__.set(t,By),this}function dW(t){return this.__data__.has(t)}Uf.prototype.add=Uf.prototype.push=fW;Uf.prototype.has=dW;function Vf(t,e){for(var r=t.length;r--;)if(gW(t[r][0],e))return r;return-1}function hW(t,e,r){var n=-1,i=LG,o=t.length,s=!0,a=[],u=a;if(r)s=!1,i=BG;else if(o>=RG){var c=e?null:TG(t);if(c)return HG(c);s=!1,i=MG,u=new Uf}else u=e?[]:a;e:for(;++n<o;){var l=t[n],f=e?e(l):l;if(l=r||l!==0?l:0,s&&f===f){for(var h=u.length;h--;)if(u[h]===f)continue e;e&&u.push(f),a.push(l)}else i(u,f,r)||(u!==a&&u.push(f),a.push(l))}return a}function Hf(t,e){var r=t.__data__;return pW(e)?r[typeof e=="string"?"string":"hash"]:r.map}function Bx(t,e){var r=t[e];return DW(r)?r:void 0}function pW(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function mW(t){if(t!=null){try{return Lx.call(t)}catch{}try{return t+""}catch{}}return""}function gW(t,e){return t===e||t!==t&&e!==e}function yW(t){var e=qx(t)?GG.call(t):"";return e==$G||e==IG}function qx(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function DW(t){if(!qx(t))return!1;var e=yW(t)||VG(t)?WG:NG;return e.test(mW(t))}Mx.exports=hW});var Hx=y((Lde,Vx)=>{var vW=Ax(),bW=Ux();function wW(t,e){return t&&t.length?bW(t,vW(e)):[]}Vx.exports=wW});var Gx=y((Bde,zx)=>{"use strict";var _W=M1(),EW=Hx(),CW=_W("MultiError");zx.exports=My;function My(t){if(!(this instanceof My))return new My(t);if(t=Array.isArray(t)?t:[t],t=EW(t,function(r){return r.stack}),t.length===1)return t[0];var e=new CW({message:t.map(function(r){return r.message}).join("; "),errors:t.reduce(function(r,n){return r.concat(n.errors||n)},[])});return e.__defineGetter__("stack",function(){return t.map(function(r){return r.stack}).join(`
36
36
 
37
37
  `)}),e.__defineSetter__("stack",function(r){return[r].concat(e.stack).join(`
38
38
 
39
- `)}),e}});var Kx=y((qde,Wx)=>{var ii=require("constants"),SW=process.cwd,Wf=null,xW=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return Wf||(Wf=SW.call(process)),Wf};try{process.cwd()}catch{}typeof process.chdir=="function"&&(Uy=process.chdir,process.chdir=function(t){Wf=null,Uy.call(process,t)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,Uy));var Uy;Wx.exports=FW;function FW(t){ii.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&e(t),t.lutimes||r(t),t.chown=o(t.chown),t.fchown=o(t.fchown),t.lchown=o(t.lchown),t.chmod=n(t.chmod),t.fchmod=n(t.fchmod),t.lchmod=n(t.lchmod),t.chownSync=s(t.chownSync),t.fchownSync=s(t.fchownSync),t.lchownSync=s(t.lchownSync),t.chmodSync=i(t.chmodSync),t.fchmodSync=i(t.fchmodSync),t.lchmodSync=i(t.lchmodSync),t.stat=a(t.stat),t.fstat=a(t.fstat),t.lstat=a(t.lstat),t.statSync=u(t.statSync),t.fstatSync=u(t.fstatSync),t.lstatSync=u(t.lstatSync),t.chmod&&!t.lchmod&&(t.lchmod=function(l,f,h){h&&process.nextTick(h)},t.lchmodSync=function(){}),t.chown&&!t.lchown&&(t.lchown=function(l,f,h,d){d&&process.nextTick(d)},t.lchownSync=function(){}),xW==="win32"&&(t.rename=typeof t.rename!="function"?t.rename:function(l){function f(h,d,p){var v=Date.now(),g=0;l(h,d,function w(x){if(x&&(x.code==="EACCES"||x.code==="EPERM"||x.code==="EBUSY")&&Date.now()-v<6e4){setTimeout(function(){t.stat(d,function(D,C){D&&D.code==="ENOENT"?l(h,d,w):p(x)})},g),g<100&&(g+=10);return}p&&p(x)})}return Object.setPrototypeOf&&Object.setPrototypeOf(f,l),f}(t.rename)),t.read=typeof t.read!="function"?t.read:function(l){function f(h,d,p,v,g,w){var x;if(w&&typeof w=="function"){var D=0;x=function(C,k,$){if(C&&C.code==="EAGAIN"&&D<10)return D++,l.call(t,h,d,p,v,g,x);w.apply(this,arguments)}}return l.call(t,h,d,p,v,g,x)}return Object.setPrototypeOf&&Object.setPrototypeOf(f,l),f}(t.read),t.readSync=typeof t.readSync!="function"?t.readSync:function(l){return function(f,h,d,p,v){for(var g=0;;)try{return l.call(t,f,h,d,p,v)}catch(w){if(w.code==="EAGAIN"&&g<10){g++;continue}throw w}}}(t.readSync);function e(l){l.lchmod=function(f,h,d){l.open(f,ii.O_WRONLY|ii.O_SYMLINK,h,function(p,v){if(p){d&&d(p);return}l.fchmod(v,h,function(g){l.close(v,function(w){d&&d(g||w)})})})},l.lchmodSync=function(f,h){var d=l.openSync(f,ii.O_WRONLY|ii.O_SYMLINK,h),p=!0,v;try{v=l.fchmodSync(d,h),p=!1}finally{if(p)try{l.closeSync(d)}catch{}else l.closeSync(d)}return v}}function r(l){ii.hasOwnProperty("O_SYMLINK")&&l.futimes?(l.lutimes=function(f,h,d,p){l.open(f,ii.O_SYMLINK,function(v,g){if(v){p&&p(v);return}l.futimes(g,h,d,function(w){l.close(g,function(x){p&&p(w||x)})})})},l.lutimesSync=function(f,h,d){var p=l.openSync(f,ii.O_SYMLINK),v,g=!0;try{v=l.futimesSync(p,h,d),g=!1}finally{if(g)try{l.closeSync(p)}catch{}else l.closeSync(p)}return v}):l.futimes&&(l.lutimes=function(f,h,d,p){p&&process.nextTick(p)},l.lutimesSync=function(){})}function n(l){return l&&function(f,h,d){return l.call(t,f,h,function(p){c(p)&&(p=null),d&&d.apply(this,arguments)})}}function i(l){return l&&function(f,h){try{return l.call(t,f,h)}catch(d){if(!c(d))throw d}}}function o(l){return l&&function(f,h,d,p){return l.call(t,f,h,d,function(v){c(v)&&(v=null),p&&p.apply(this,arguments)})}}function s(l){return l&&function(f,h,d){try{return l.call(t,f,h,d)}catch(p){if(!c(p))throw p}}}function a(l){return l&&function(f,h,d){typeof h=="function"&&(d=h,h=null);function p(v,g){g&&(g.uid<0&&(g.uid+=4294967296),g.gid<0&&(g.gid+=4294967296)),d&&d.apply(this,arguments)}return h?l.call(t,f,h,p):l.call(t,f,p)}}function u(l){return l&&function(f,h){var d=h?l.call(t,f,h):l.call(t,f);return d&&(d.uid<0&&(d.uid+=4294967296),d.gid<0&&(d.gid+=4294967296)),d}}function c(l){if(!l||l.code==="ENOSYS")return!0;var f=!process.getuid||process.getuid()!==0;return!!(f&&(l.code==="EINVAL"||l.code==="EPERM"))}}});var Xx=y((Mde,Jx)=>{var Yx=require("stream").Stream;Jx.exports=OW;function OW(t){return{ReadStream:e,WriteStream:r};function e(n,i){if(!(this instanceof e))return new e(n,i);Yx.call(this);var o=this;this.path=n,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=64*1024,i=i||{};for(var s=Object.keys(i),a=0,u=s.length;a<u;a++){var c=s[a];this[c]=i[c]}if(this.encoding&&this.setEncoding(this.encoding),this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.end===void 0)this.end=1/0;else if(typeof this.end!="number")throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}if(this.fd!==null){process.nextTick(function(){o._read()});return}t.open(this.path,this.flags,this.mode,function(l,f){if(l){o.emit("error",l),o.readable=!1;return}o.fd=f,o.emit("open",f),o._read()})}function r(n,i){if(!(this instanceof r))return new r(n,i);Yx.call(this),this.path=n,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,i=i||{};for(var o=Object.keys(i),s=0,a=o.length;s<a;s++){var u=o[s];this[u]=i[u]}if(this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start}this.busy=!1,this._queue=[],this.fd===null&&(this._open=t.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}});var Qx=y((Ude,Zx)=>{"use strict";Zx.exports=kW;var AW=Object.getPrototypeOf||function(t){return t.__proto__};function kW(t){if(t===null||typeof t!="object")return t;if(t instanceof Object)var e={__proto__:AW(t)};else var e=Object.create(null);return Object.getOwnPropertyNames(t).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}});var dt=y((Vde,zy)=>{var Ve=require("fs"),TW=Kx(),PW=Xx(),RW=Qx(),Kf=require("util"),wt,Jf;typeof Symbol=="function"&&typeof Symbol.for=="function"?(wt=Symbol.for("graceful-fs.queue"),Jf=Symbol.for("graceful-fs.previous")):(wt="___graceful-fs.queue",Jf="___graceful-fs.previous");function $W(){}function rF(t,e){Object.defineProperty(t,wt,{get:function(){return e}})}var no=$W;Kf.debuglog?no=Kf.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(no=function(){var t=Kf.format.apply(Kf,arguments);t="GFS4: "+t.split(/\n/).join(`
40
- GFS4: `),console.error(t)});Ve[wt]||(eF=global[wt]||[],rF(Ve,eF),Ve.close=function(t){function e(r,n){return t.call(Ve,r,function(i){i||tF(),typeof n=="function"&&n.apply(this,arguments)})}return Object.defineProperty(e,Jf,{value:t}),e}(Ve.close),Ve.closeSync=function(t){function e(r){t.apply(Ve,arguments),tF()}return Object.defineProperty(e,Jf,{value:t}),e}(Ve.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){no(Ve[wt]),require("assert").equal(Ve[wt].length,0)}));var eF;global[wt]||rF(global,Ve[wt]);zy.exports=Vy(RW(Ve));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!Ve.__patched&&(zy.exports=Vy(Ve),Ve.__patched=!0);function Vy(t){TW(t),t.gracefulify=Vy,t.createReadStream=k,t.createWriteStream=$;var e=t.readFile;t.readFile=r;function r(S,I,R){return typeof I=="function"&&(R=I,I=null),B(S,I,R);function B(q,K,M,E){return e(q,K,function(b){b&&(b.code==="EMFILE"||b.code==="ENFILE")?xs([B,[q,K,M],b,E||Date.now(),Date.now()]):typeof M=="function"&&M.apply(this,arguments)})}}var n=t.writeFile;t.writeFile=i;function i(S,I,R,B){return typeof R=="function"&&(B=R,R=null),q(S,I,R,B);function q(K,M,E,b,_){return n(K,M,E,function(O){O&&(O.code==="EMFILE"||O.code==="ENFILE")?xs([q,[K,M,E,b],O,_||Date.now(),Date.now()]):typeof b=="function"&&b.apply(this,arguments)})}}var o=t.appendFile;o&&(t.appendFile=s);function s(S,I,R,B){return typeof R=="function"&&(B=R,R=null),q(S,I,R,B);function q(K,M,E,b,_){return o(K,M,E,function(O){O&&(O.code==="EMFILE"||O.code==="ENFILE")?xs([q,[K,M,E,b],O,_||Date.now(),Date.now()]):typeof b=="function"&&b.apply(this,arguments)})}}var a=t.copyFile;a&&(t.copyFile=u);function u(S,I,R,B){return typeof R=="function"&&(B=R,R=0),q(S,I,R,B);function q(K,M,E,b,_){return a(K,M,E,function(O){O&&(O.code==="EMFILE"||O.code==="ENFILE")?xs([q,[K,M,E,b],O,_||Date.now(),Date.now()]):typeof b=="function"&&b.apply(this,arguments)})}}var c=t.readdir;t.readdir=f;var l=/^v[0-5]\./;function f(S,I,R){typeof I=="function"&&(R=I,I=null);var B=l.test(process.version)?function(M,E,b,_){return c(M,q(M,E,b,_))}:function(M,E,b,_){return c(M,E,q(M,E,b,_))};return B(S,I,R);function q(K,M,E,b){return function(_,O){_&&(_.code==="EMFILE"||_.code==="ENFILE")?xs([B,[K,M,E],_,b||Date.now(),Date.now()]):(O&&O.sort&&O.sort(),typeof E=="function"&&E.call(this,_,O))}}}if(process.version.substr(0,4)==="v0.8"){var h=PW(t);w=h.ReadStream,D=h.WriteStream}var d=t.ReadStream;d&&(w.prototype=Object.create(d.prototype),w.prototype.open=x);var p=t.WriteStream;p&&(D.prototype=Object.create(p.prototype),D.prototype.open=C),Object.defineProperty(t,"ReadStream",{get:function(){return w},set:function(S){w=S},enumerable:!0,configurable:!0}),Object.defineProperty(t,"WriteStream",{get:function(){return D},set:function(S){D=S},enumerable:!0,configurable:!0});var v=w;Object.defineProperty(t,"FileReadStream",{get:function(){return v},set:function(S){v=S},enumerable:!0,configurable:!0});var g=D;Object.defineProperty(t,"FileWriteStream",{get:function(){return g},set:function(S){g=S},enumerable:!0,configurable:!0});function w(S,I){return this instanceof w?(d.apply(this,arguments),this):w.apply(Object.create(w.prototype),arguments)}function x(){var S=this;L(S.path,S.flags,S.mode,function(I,R){I?(S.autoClose&&S.destroy(),S.emit("error",I)):(S.fd=R,S.emit("open",R),S.read())})}function D(S,I){return this instanceof D?(p.apply(this,arguments),this):D.apply(Object.create(D.prototype),arguments)}function C(){var S=this;L(S.path,S.flags,S.mode,function(I,R){I?(S.destroy(),S.emit("error",I)):(S.fd=R,S.emit("open",R))})}function k(S,I){return new t.ReadStream(S,I)}function $(S,I){return new t.WriteStream(S,I)}var F=t.open;t.open=L;function L(S,I,R,B){return typeof R=="function"&&(B=R,R=null),q(S,I,R,B);function q(K,M,E,b,_){return F(K,M,E,function(O,j){O&&(O.code==="EMFILE"||O.code==="ENFILE")?xs([q,[K,M,E,b],O,_||Date.now(),Date.now()]):typeof b=="function"&&b.apply(this,arguments)})}}return t}function xs(t){no("ENQUEUE",t[0].name,t[1]),Ve[wt].push(t),Hy()}var Yf;function tF(){for(var t=Date.now(),e=0;e<Ve[wt].length;++e)Ve[wt][e].length>2&&(Ve[wt][e][3]=t,Ve[wt][e][4]=t);Hy()}function Hy(){if(clearTimeout(Yf),Yf=void 0,Ve[wt].length!==0){var t=Ve[wt].shift(),e=t[0],r=t[1],n=t[2],i=t[3],o=t[4];if(i===void 0)no("RETRY",e.name,r),e.apply(null,r);else if(Date.now()-i>=6e4){no("TIMEOUT",e.name,r);var s=r.pop();typeof s=="function"&&s.call(null,n)}else{var a=Date.now()-o,u=Math.max(o-i,1),c=Math.min(u*1.2,100);a>=c?(no("RETRY",e.name,r),e.apply(null,r.concat([i]))):Ve[wt].push(t)}Yf===void 0&&(Yf=setTimeout(Hy,0))}}});var iF=y((Hde,nF)=>{function Dr(t,e){typeof e=="boolean"&&(e={forever:e}),this._originalTimeouts=JSON.parse(JSON.stringify(t)),this._timeouts=t,this._options=e||{},this._maxRetryTime=e&&e.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}nF.exports=Dr;Dr.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts};Dr.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timeouts=[],this._cachedTimeouts=null};Dr.prototype.retry=function(t){if(this._timeout&&clearTimeout(this._timeout),!t)return!1;var e=new Date().getTime();if(t&&e-this._operationStart>=this._maxRetryTime)return this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(t);var r=this._timeouts.shift();if(r===void 0)if(this._cachedTimeouts)this._errors.splice(this._errors.length-1,this._errors.length),this._timeouts=this._cachedTimeouts.slice(0),r=this._timeouts.shift();else return!1;var n=this,i=setTimeout(function(){n._attempts++,n._operationTimeoutCb&&(n._timeout=setTimeout(function(){n._operationTimeoutCb(n._attempts)},n._operationTimeout),n._options.unref&&n._timeout.unref()),n._fn(n._attempts)},r);return this._options.unref&&i.unref(),!0};Dr.prototype.attempt=function(t,e){this._fn=t,e&&(e.timeout&&(this._operationTimeout=e.timeout),e.cb&&(this._operationTimeoutCb=e.cb));var r=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){r._operationTimeoutCb()},r._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)};Dr.prototype.try=function(t){console.log("Using RetryOperation.try() is deprecated"),this.attempt(t)};Dr.prototype.start=function(t){console.log("Using RetryOperation.start() is deprecated"),this.attempt(t)};Dr.prototype.start=Dr.prototype.try;Dr.prototype.errors=function(){return this._errors};Dr.prototype.attempts=function(){return this._attempts};Dr.prototype.mainError=function(){if(this._errors.length===0)return null;for(var t={},e=null,r=0,n=0;n<this._errors.length;n++){var i=this._errors[n],o=i.message,s=(t[o]||0)+1;t[o]=s,s>=r&&(e=i,r=s)}return e}});var oF=y(io=>{var IW=iF();io.operation=function(t){var e=io.timeouts(t);return new IW(e,{forever:t&&t.forever,unref:t&&t.unref,maxRetryTime:t&&t.maxRetryTime})};io.timeouts=function(t){if(t instanceof Array)return[].concat(t);var e={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var r in t)e[r]=t[r];if(e.minTimeout>e.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var n=[],i=0;i<e.retries;i++)n.push(this.createTimeout(i,e));return t&&t.forever&&!n.length&&n.push(this.createTimeout(i,e)),n.sort(function(o,s){return o-s}),n};io.createTimeout=function(t,e){var r=e.randomize?Math.random()+1:1,n=Math.round(r*e.minTimeout*Math.pow(e.factor,t));return n=Math.min(n,e.maxTimeout),n};io.wrap=function(t,e,r){if(e instanceof Array&&(r=e,e=null),!r){r=[];for(var n in t)typeof t[n]=="function"&&r.push(n)}for(var i=0;i<r.length;i++){var o=r[i],s=t[o];t[o]=function(u){var c=io.operation(e),l=Array.prototype.slice.call(arguments,1),f=l.pop();l.push(function(h){c.retry(h)||(h&&(arguments[0]=c.mainError()),f.apply(this,arguments))}),c.attempt(function(){u.apply(t,l)})}.bind(t,s),t[o].options=e}}});var aF=y((Gde,sF)=>{sF.exports=oF()});var uF=y((Wde,Xf)=>{Xf.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];process.platform!=="win32"&&Xf.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&Xf.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")});var Ky=y((Kde,As)=>{var Le=global.process,oo=function(t){return t&&typeof t=="object"&&typeof t.removeListener=="function"&&typeof t.emit=="function"&&typeof t.reallyExit=="function"&&typeof t.listeners=="function"&&typeof t.kill=="function"&&typeof t.pid=="number"&&typeof t.on=="function"};oo(Le)?(cF=require("assert"),Fs=uF(),lF=/^win/i.test(Le.platform),Vu=require("events"),typeof Vu!="function"&&(Vu=Vu.EventEmitter),Le.__signal_exit_emitter__?ht=Le.__signal_exit_emitter__:(ht=Le.__signal_exit_emitter__=new Vu,ht.count=0,ht.emitted={}),ht.infinite||(ht.setMaxListeners(1/0),ht.infinite=!0),As.exports=function(t,e){if(!oo(global.process))return function(){};cF.equal(typeof t,"function","a callback must be provided for exit handler"),Os===!1&&Gy();var r="exit";e&&e.alwaysLast&&(r="afterexit");var n=function(){ht.removeListener(r,t),ht.listeners("exit").length===0&&ht.listeners("afterexit").length===0&&Zf()};return ht.on(r,t),n},Zf=function(){!Os||!oo(global.process)||(Os=!1,Fs.forEach(function(e){try{Le.removeListener(e,Qf[e])}catch{}}),Le.emit=ed,Le.reallyExit=Wy,ht.count-=1)},As.exports.unload=Zf,so=function(e,r,n){ht.emitted[e]||(ht.emitted[e]=!0,ht.emit(e,r,n))},Qf={},Fs.forEach(function(t){Qf[t]=function(){if(oo(global.process)){var r=Le.listeners(t);r.length===ht.count&&(Zf(),so("exit",null,t),so("afterexit",null,t),lF&&t==="SIGHUP"&&(t="SIGINT"),Le.kill(Le.pid,t))}}}),As.exports.signals=function(){return Fs},Os=!1,Gy=function(){Os||!oo(global.process)||(Os=!0,ht.count+=1,Fs=Fs.filter(function(e){try{return Le.on(e,Qf[e]),!0}catch{return!1}}),Le.emit=dF,Le.reallyExit=fF)},As.exports.load=Gy,Wy=Le.reallyExit,fF=function(e){oo(global.process)&&(Le.exitCode=e||0,so("exit",Le.exitCode,null),so("afterexit",Le.exitCode,null),Wy.call(Le,Le.exitCode))},ed=Le.emit,dF=function(e,r){if(e==="exit"&&oo(global.process)){r!==void 0&&(Le.exitCode=r);var n=ed.apply(this,arguments);return so("exit",Le.exitCode,null),so("afterexit",Le.exitCode,null),n}else return ed.apply(this,arguments)}):As.exports=function(){return function(){}};var cF,Fs,lF,Vu,ht,Zf,so,Qf,Os,Gy,Wy,fF,ed,dF});var pF=y((Yde,Yy)=>{"use strict";var hF=Symbol();function jW(t,e,r){let n=e[hF];if(n)return e.stat(t,(o,s)=>{if(o)return r(o);r(null,s.mtime,n)});let i=new Date(Math.ceil(Date.now()/1e3)*1e3+5);e.utimes(t,i,i,o=>{if(o)return r(o);e.stat(t,(s,a)=>{if(s)return r(s);let u=a.mtime.getTime()%1e3===0?"s":"ms";Object.defineProperty(e,hF,{value:u}),r(null,a.mtime,u)})})}function NW(t){let e=Date.now();return t==="s"&&(e=Math.ceil(e/1e3)*1e3),new Date(e)}Yy.exports.probe=jW;Yy.exports.getMtime=NW});var vF=y((Jde,zu)=>{"use strict";var LW=require("path"),Zy=dt(),BW=aF(),qW=Ky(),mF=pF(),_n={};function Hu(t,e){return e.lockfilePath||`${t}.lock`}function Qy(t,e,r){if(!e.realpath)return r(null,LW.resolve(t));e.fs.realpath(t,r)}function Xy(t,e,r){let n=Hu(t,e);e.fs.mkdir(n,i=>{if(!i)return mF.probe(n,e.fs,(o,s,a)=>{if(o)return e.fs.rmdir(n,()=>{}),r(o);r(null,s,a)});if(i.code!=="EEXIST")return r(i);if(e.stale<=0)return r(Object.assign(new Error("Lock file is already being held"),{code:"ELOCKED",file:t}));e.fs.stat(n,(o,s)=>{if(o)return o.code==="ENOENT"?Xy(t,{...e,stale:0},r):r(o);if(!gF(s,e))return r(Object.assign(new Error("Lock file is already being held"),{code:"ELOCKED",file:t}));yF(t,e,a=>{if(a)return r(a);Xy(t,{...e,stale:0},r)})})})}function gF(t,e){return t.mtime.getTime()<Date.now()-e.stale}function yF(t,e,r){e.fs.rmdir(Hu(t,e),n=>{if(n&&n.code!=="ENOENT")return r(n);r()})}function td(t,e){let r=_n[t];r.updateTimeout||(r.updateDelay=r.updateDelay||e.update,r.updateTimeout=setTimeout(()=>{r.updateTimeout=null,e.fs.stat(r.lockfilePath,(n,i)=>{let o=r.lastUpdate+e.stale<Date.now();if(n)return n.code==="ENOENT"||o?Jy(t,r,Object.assign(n,{code:"ECOMPROMISED"})):(r.updateDelay=1e3,td(t,e));if(!(r.mtime.getTime()===i.mtime.getTime()))return Jy(t,r,Object.assign(new Error("Unable to update lock within the stale threshold"),{code:"ECOMPROMISED"}));let a=mF.getMtime(r.mtimePrecision);e.fs.utimes(r.lockfilePath,a,a,u=>{let c=r.lastUpdate+e.stale<Date.now();if(!r.released){if(u)return u.code==="ENOENT"||c?Jy(t,r,Object.assign(u,{code:"ECOMPROMISED"})):(r.updateDelay=1e3,td(t,e));r.mtime=a,r.lastUpdate=Date.now(),r.updateDelay=null,td(t,e)}})})},r.updateDelay),r.updateTimeout.unref&&r.updateTimeout.unref())}function Jy(t,e,r){e.released=!0,e.updateTimeout&&clearTimeout(e.updateTimeout),_n[t]===e&&delete _n[t],e.options.onCompromised(r)}function MW(t,e,r){e={stale:1e4,update:null,realpath:!0,retries:0,fs:Zy,onCompromised:n=>{throw n},...e},e.retries=e.retries||0,e.retries=typeof e.retries=="number"?{retries:e.retries}:e.retries,e.stale=Math.max(e.stale||0,2e3),e.update=e.update==null?e.stale/2:e.update||0,e.update=Math.max(Math.min(e.update,e.stale/2),1e3),Qy(t,e,(n,i)=>{if(n)return r(n);let o=BW.operation(e.retries);o.attempt(()=>{Xy(i,e,(s,a,u)=>{if(o.retry(s))return;if(s)return r(o.mainError());let c=_n[i]={lockfilePath:Hu(i,e),mtime:a,mtimePrecision:u,options:e,lastUpdate:Date.now()};td(i,e),r(null,l=>{if(c.released)return l&&l(Object.assign(new Error("Lock is already released"),{code:"ERELEASED"}));DF(i,{...e,realpath:!1},l)})})})})}function DF(t,e,r){e={fs:Zy,realpath:!0,...e},Qy(t,e,(n,i)=>{if(n)return r(n);let o=_n[i];if(!o)return r(Object.assign(new Error("Lock is not acquired/owned by you"),{code:"ENOTACQUIRED"}));o.updateTimeout&&clearTimeout(o.updateTimeout),o.released=!0,delete _n[i],yF(i,e,r)})}function UW(t,e,r){e={stale:1e4,realpath:!0,fs:Zy,...e},e.stale=Math.max(e.stale||0,2e3),Qy(t,e,(n,i)=>{if(n)return r(n);e.fs.stat(Hu(i,e),(o,s)=>o?o.code==="ENOENT"?r(null,!1):r(o):r(null,!gF(s,e)))})}function VW(){return _n}qW(()=>{for(let t in _n){let e=_n[t].options;try{e.fs.rmdirSync(Hu(t,e))}catch{}}});zu.exports.lock=MW;zu.exports.unlock=DF;zu.exports.check=UW;zu.exports.getLocks=VW});var wF=y((Xde,bF)=>{"use strict";var HW=dt();function zW(t){let e=["mkdir","realpath","stat","rmdir","utimes"],r={...t};return e.forEach(n=>{r[n]=(...i)=>{let o=i.pop(),s;try{s=t[`${n}Sync`](...i)}catch(a){return o(a)}o(null,s)}}),r}function GW(t){return(...e)=>new Promise((r,n)=>{e.push((i,o)=>{i?n(i):r(o)}),t(...e)})}function WW(t){return(...e)=>{let r,n;if(e.push((i,o)=>{r=i,n=o}),t(...e),r)throw r;return n}}function KW(t){if(t={...t},t.fs=zW(t.fs||HW),typeof t.retries=="number"&&t.retries>0||t.retries&&typeof t.retries.retries=="number"&&t.retries.retries>0)throw Object.assign(new Error("Cannot use retries with the sync api"),{code:"ESYNC"});return t}bF.exports={toPromise:GW,toSync:WW,toSyncOptions:KW}});var EF=y((Zde,oi)=>{"use strict";var ks=vF(),{toPromise:rd,toSync:nd,toSyncOptions:eD}=wF();async function _F(t,e){let r=await rd(ks.lock)(t,e);return rd(r)}function YW(t,e){let r=nd(ks.lock)(t,eD(e));return nd(r)}function JW(t,e){return rd(ks.unlock)(t,e)}function XW(t,e){return nd(ks.unlock)(t,eD(e))}function ZW(t,e){return rd(ks.check)(t,e)}function QW(t,e){return nd(ks.check)(t,eD(e))}oi.exports=_F;oi.exports.lock=_F;oi.exports.unlock=JW;oi.exports.lockSync=YW;oi.exports.unlockSync=XW;oi.exports.check=ZW;oi.exports.checkSync=QW});var OF=y(Ts=>{"use strict";Object.defineProperty(Ts,"__esModule",{value:!0});Ts.canStoreURLs=Ts.FileUrlStorage=void 0;var CF=require("fs"),eK=rK(Gx()),SF=tK(EF());function FF(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,r=new WeakMap;return(FF=function(n){return n?r:e})(t)}function tK(t,e){if(!e&&t&&t.__esModule)return t;if(t===null||typeof t!="object"&&typeof t!="function")return{default:t};var r=FF(e);if(r&&r.has(t))return r.get(t);var n={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in t)if(o!=="default"&&{}.hasOwnProperty.call(t,o)){var s=i?Object.getOwnPropertyDescriptor(t,o):null;s&&(s.get||s.set)?Object.defineProperty(n,o,s):n[o]=t[o]}return n.default=t,r&&r.set(t,n),n}function rK(t){return t&&t.__esModule?t:{default:t}}function Gu(t){"@babel/helpers - typeof";return Gu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Gu(t)}function nK(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function xF(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,oK(n.key),n)}}function iK(t,e,r){return e&&xF(t.prototype,e),r&&xF(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function oK(t){var e=sK(t,"string");return Gu(e)=="symbol"?e:e+""}function sK(t,e){if(Gu(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Gu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Qde=Ts.canStoreURLs=!0,ehe=Ts.FileUrlStorage=function(){function t(e){nK(this,t),this.path=e}return iK(t,[{key:"findAllUploads",value:function(){var r=this;return new Promise(function(n,i){r._getItems("tus::",function(o,s){o?i(o):n(s)})})}},{key:"findUploadsByFingerprint",value:function(r){var n=this;return new Promise(function(i,o){n._getItems("tus::".concat(r),function(s,a){s?o(s):i(a)})})}},{key:"removeUpload",value:function(r){var n=this;return new Promise(function(i,o){n._removeItem(r,function(s){s?o(s):i()})})}},{key:"addUpload",value:function(r,n){var i=this,o=Math.round(Math.random()*1e12),s="tus::".concat(r,"::").concat(o);return new Promise(function(a,u){i._setItem(s,n,function(c){c?u(c):a(s)})})}},{key:"_setItem",value:function(r,n,i){var o=this;SF.lock(this.path,this._lockfileOptions()).then(function(s){i=o._releaseAndCb(s,i),o._getData(function(a,u){if(a){i(a);return}u[r]=n,o._writeData(u,function(c){return i(c)})})}).catch(i)}},{key:"_getItems",value:function(r,n){this._getData(function(i,o){if(i){n(i);return}var s=Object.keys(o).filter(function(a){return a.startsWith(r)}).map(function(a){var u=o[a];return u.urlStorageKey=a,u});n(null,s)})}},{key:"_removeItem",value:function(r,n){var i=this;SF.lock(this.path,this._lockfileOptions()).then(function(o){n=i._releaseAndCb(o,n),i._getData(function(s,a){if(s){n(s);return}delete a[r],i._writeData(a,function(u){return n(u)})})}).catch(n)}},{key:"_lockfileOptions",value:function(){return{realpath:!1,retries:{retries:5,minTimeout:20}}}},{key:"_releaseAndCb",value:function(r,n){return function(i){if(i){r().then(function(){return n(i)}).catch(function(o){return n((0,eK.default)([i,o]))});return}r().then(n).catch(n)}}},{key:"_writeData",value:function(r,n){var i={encoding:"utf8",mode:432,flag:"w"};(0,CF.writeFile)(this.path,JSON.stringify(r),i,function(o){return n(o)})}},{key:"_getData",value:function(r){(0,CF.readFile)(this.path,"utf8",function(n,i){if(n){n.code==="ENOENT"?r(null,{}):r(n);return}try{i=i.trim().length?JSON.parse(i):{}}catch(o){r(o);return}r(null,i)})}}])}()});var nD=y(zt=>{"use strict";Object.defineProperty(zt,"__esModule",{value:!0});Object.defineProperty(zt,"DefaultHttpStack",{enumerable:!0,get:function(){return PF.default}});Object.defineProperty(zt,"DetailedError",{enumerable:!0,get:function(){return aK.default}});Object.defineProperty(zt,"FileUrlStorage",{enumerable:!0,get:function(){return RF.FileUrlStorage}});Object.defineProperty(zt,"StreamSource",{enumerable:!0,get:function(){return dK.default}});zt.Upload=void 0;Object.defineProperty(zt,"canStoreURLs",{enumerable:!0,get:function(){return RF.canStoreURLs}});zt.defaultOptions=void 0;Object.defineProperty(zt,"enableDebugLog",{enumerable:!0,get:function(){return uK.enableDebugLog}});zt.isSupported=void 0;var aK=ao(Yg()),uK=Jg(),cK=ao(OS()),tD=ao(i1()),lK=ao(y1()),fK=ao(w1()),PF=ao(I1()),dK=ao(fy()),RF=OF();function ao(t){return t&&t.__esModule?t:{default:t}}function Rs(t){"@babel/helpers - typeof";return Rs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Rs(t)}function hK(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function AF(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,IF(n.key),n)}}function pK(t,e,r){return e&&AF(t.prototype,e),r&&AF(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function mK(t,e,r){return e=id(e),gK(t,$F()?Reflect.construct(e,r||[],id(t).constructor):e.apply(t,r))}function gK(t,e){if(e&&(Rs(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return yK(t)}function yK(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function $F(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return($F=function(){return!!t})()}function id(t){return id=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},id(t)}function DK(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&rD(t,e)}function rD(t,e){return rD=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},rD(t,e)}function kF(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Ps(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?kF(Object(r),!0).forEach(function(n){vK(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):kF(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function vK(t,e,r){return e=IF(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function IF(t){var e=bK(t,"string");return Rs(e)=="symbol"?e:e+""}function bK(t,e){if(Rs(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Rs(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var TF=zt.defaultOptions=Ps(Ps({},tD.default.defaultOptions),{},{httpStack:new PF.default,fileReader:new lK.default,urlStorage:new cK.default,fingerprint:fK.default}),rhe=zt.Upload=function(t){function e(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return hK(this,e),n=Ps(Ps({},TF),n),mK(this,e,[r,n])}return DK(e,t),pK(e,null,[{key:"terminate",value:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return i=Ps(Ps({},TF),i),tD.default.terminate(n,i)}}])}(tD.default),nhe=zt.isSupported=!0});var En={};mn(En,{__addDisposableResource:()=>r2,__assign:()=>od,__asyncDelegator:()=>KF,__asyncGenerator:()=>WF,__asyncValues:()=>YF,__await:()=>$s,__awaiter:()=>MF,__classPrivateFieldGet:()=>QF,__classPrivateFieldIn:()=>t2,__classPrivateFieldSet:()=>e2,__createBinding:()=>ad,__decorate:()=>LF,__disposeResources:()=>n2,__esDecorate:()=>wK,__exportStar:()=>VF,__extends:()=>jF,__generator:()=>UF,__importDefault:()=>ZF,__importStar:()=>XF,__makeTemplateObject:()=>JF,__metadata:()=>qF,__param:()=>BF,__propKey:()=>EK,__read:()=>oD,__rest:()=>NF,__runInitializers:()=>_K,__setFunctionName:()=>CK,__spread:()=>HF,__spreadArray:()=>GF,__spreadArrays:()=>zF,__values:()=>sd,default:()=>FK});function jF(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");iD(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}function NF(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}function LF(t,e,r,n){var i=arguments.length,o=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,r,o):s(e,r))||o);return i>3&&o&&Object.defineProperty(e,r,o),o}function BF(t,e){return function(r,n){e(r,n,t)}}function wK(t,e,r,n,i,o){function s(w){if(w!==void 0&&typeof w!="function")throw new TypeError("Function expected");return w}for(var a=n.kind,u=a==="getter"?"get":a==="setter"?"set":"value",c=!e&&t?n.static?t:t.prototype:null,l=e||(c?Object.getOwnPropertyDescriptor(c,n.name):{}),f,h=!1,d=r.length-1;d>=0;d--){var p={};for(var v in n)p[v]=v==="access"?{}:n[v];for(var v in n.access)p.access[v]=n.access[v];p.addInitializer=function(w){if(h)throw new TypeError("Cannot add initializers after decoration has completed");o.push(s(w||null))};var g=(0,r[d])(a==="accessor"?{get:l.get,set:l.set}:l[u],p);if(a==="accessor"){if(g===void 0)continue;if(g===null||typeof g!="object")throw new TypeError("Object expected");(f=s(g.get))&&(l.get=f),(f=s(g.set))&&(l.set=f),(f=s(g.init))&&i.unshift(f)}else(f=s(g))&&(a==="field"?i.unshift(f):l[u]=f)}c&&Object.defineProperty(c,n.name,l),h=!0}function _K(t,e,r){for(var n=arguments.length>2,i=0;i<e.length;i++)r=n?e[i].call(t,r):e[i].call(t);return n?r:void 0}function EK(t){return typeof t=="symbol"?t:"".concat(t)}function CK(t,e,r){return typeof e=="symbol"&&(e=e.description?"[".concat(e.description,"]"):""),Object.defineProperty(t,"name",{configurable:!0,value:r?"".concat(r," ",e):e})}function qF(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function MF(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(l){try{c(n.next(l))}catch(f){s(f)}}function u(l){try{c(n.throw(l))}catch(f){s(f)}}function c(l){l.done?o(l.value):i(l.value).then(a,u)}c((n=n.apply(t,e||[])).next())})}function UF(t,e){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,s=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(c){return function(l){return u([c,l])}}function u(c){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,c[0]&&(r=0)),r;)try{if(n=1,i&&(o=c[0]&2?i.return:c[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,c[1])).done)return o;switch(i=0,o&&(c=[c[0]&2,o.value]),c[0]){case 0:case 1:o=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,i=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]<o[3])){r.label=c[1];break}if(c[0]===6&&r.label<o[1]){r.label=o[1],o=c;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(c);break}o[2]&&r.ops.pop(),r.trys.pop();continue}c=e.call(t,r)}catch(l){c=[6,l],i=0}finally{n=o=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function VF(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&ad(e,t,r)}function sd(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function oD(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,o=[],s;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(a){s={error:a}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return o}function HF(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(oD(arguments[e]));return t}function zF(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var n=Array(t),i=0,e=0;e<r;e++)for(var o=arguments[e],s=0,a=o.length;s<a;s++,i++)n[i]=o[s];return n}function GF(t,e,r){if(r||arguments.length===2)for(var n=0,i=e.length,o;n<i;n++)(o||!(n in e))&&(o||(o=Array.prototype.slice.call(e,0,n)),o[n]=e[n]);return t.concat(o||Array.prototype.slice.call(e))}function $s(t){return this instanceof $s?(this.v=t,this):new $s(t)}function WF(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(t,e||[]),i,o=[];return i=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),a("next"),a("throw"),a("return",s),i[Symbol.asyncIterator]=function(){return this},i;function s(d){return function(p){return Promise.resolve(p).then(d,f)}}function a(d,p){n[d]&&(i[d]=function(v){return new Promise(function(g,w){o.push([d,v,g,w])>1||u(d,v)})},p&&(i[d]=p(i[d])))}function u(d,p){try{c(n[d](p))}catch(v){h(o[0][3],v)}}function c(d){d.value instanceof $s?Promise.resolve(d.value.v).then(l,f):h(o[0][2],d)}function l(d){u("next",d)}function f(d){u("throw",d)}function h(d,p){d(p),o.shift(),o.length&&u(o[0][0],o[0][1])}}function KF(t){var e,r;return e={},n("next"),n("throw",function(i){throw i}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(i,o){e[i]=t[i]?function(s){return(r=!r)?{value:$s(t[i](s)),done:!1}:o?o(s):s}:o}}function YF(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof sd=="function"?sd(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(o){r[o]=t[o]&&function(s){return new Promise(function(a,u){s=t[o](s),i(a,u,s.done,s.value)})}}function i(o,s,a,u){Promise.resolve(u).then(function(c){o({value:c,done:a})},s)}}function JF(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function XF(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&ad(e,t,r);return SK(e,t),e}function ZF(t){return t&&t.__esModule?t:{default:t}}function QF(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)}function e2(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r}function t2(t,e){if(e===null||typeof e!="object"&&typeof e!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof t=="function"?e===t:t.has(e)}function r2(t,e,r){if(e!=null){if(typeof e!="object"&&typeof e!="function")throw new TypeError("Object expected.");var n,i;if(r){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");n=e[Symbol.asyncDispose]}if(n===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");n=e[Symbol.dispose],r&&(i=n)}if(typeof n!="function")throw new TypeError("Object not disposable.");i&&(n=function(){try{i.call(this)}catch(o){return Promise.reject(o)}}),t.stack.push({value:e,dispose:n,async:r})}else r&&t.stack.push({async:!0});return e}function n2(t){function e(o){t.error=t.hasError?new xK(o,t.error,"An error was suppressed during disposal."):o,t.hasError=!0}var r,n=0;function i(){for(;r=t.stack.pop();)try{if(!r.async&&n===1)return n=0,t.stack.push(r),Promise.resolve().then(i);if(r.dispose){var o=r.dispose.call(r.value);if(r.async)return n|=2,Promise.resolve(o).then(i,function(s){return e(s),i()})}else n|=1}catch(s){e(s)}if(n===1)return t.hasError?Promise.reject(t.error):Promise.resolve();if(t.hasError)throw t.error}return i()}var iD,od,ad,SK,xK,FK,Cn=ut(()=>{iD=function(t,e){return iD=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])},iD(t,e)};od=function(){return od=Object.assign||function(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},od.apply(this,arguments)};ad=Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]};SK=Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e};xK=typeof SuppressedError=="function"?SuppressedError:function(t,e,r){var n=new Error(r);return n.name="SuppressedError",n.error=t,n.suppressed=e,n};FK={__extends:jF,__assign:od,__rest:NF,__decorate:LF,__param:BF,__metadata:qF,__awaiter:MF,__generator:UF,__createBinding:ad,__exportStar:VF,__values:sd,__read:oD,__spread:HF,__spreadArrays:zF,__spreadArray:GF,__await:$s,__asyncGenerator:WF,__asyncDelegator:KF,__asyncValues:YF,__makeTemplateObject:JF,__importStar:XF,__importDefault:ZF,__classPrivateFieldGet:QF,__classPrivateFieldSet:e2,__classPrivateFieldIn:t2,__addDisposableResource:r2,__disposeResources:n2}});var x2={};mn(x2,{__addDisposableResource:()=>C2,__assign:()=>ud,__asyncDelegator:()=>g2,__asyncGenerator:()=>m2,__asyncValues:()=>y2,__await:()=>Is,__awaiter:()=>c2,__classPrivateFieldGet:()=>w2,__classPrivateFieldIn:()=>E2,__classPrivateFieldSet:()=>_2,__createBinding:()=>ld,__decorate:()=>s2,__disposeResources:()=>S2,__esDecorate:()=>OK,__exportStar:()=>f2,__extends:()=>i2,__generator:()=>l2,__importDefault:()=>b2,__importStar:()=>v2,__makeTemplateObject:()=>D2,__metadata:()=>u2,__param:()=>a2,__propKey:()=>kK,__read:()=>aD,__rest:()=>o2,__runInitializers:()=>AK,__setFunctionName:()=>TK,__spread:()=>d2,__spreadArray:()=>p2,__spreadArrays:()=>h2,__values:()=>cd,default:()=>$K});function i2(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");sD(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}function o2(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}function s2(t,e,r,n){var i=arguments.length,o=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,r,o):s(e,r))||o);return i>3&&o&&Object.defineProperty(e,r,o),o}function a2(t,e){return function(r,n){e(r,n,t)}}function OK(t,e,r,n,i,o){function s(w){if(w!==void 0&&typeof w!="function")throw new TypeError("Function expected");return w}for(var a=n.kind,u=a==="getter"?"get":a==="setter"?"set":"value",c=!e&&t?n.static?t:t.prototype:null,l=e||(c?Object.getOwnPropertyDescriptor(c,n.name):{}),f,h=!1,d=r.length-1;d>=0;d--){var p={};for(var v in n)p[v]=v==="access"?{}:n[v];for(var v in n.access)p.access[v]=n.access[v];p.addInitializer=function(w){if(h)throw new TypeError("Cannot add initializers after decoration has completed");o.push(s(w||null))};var g=(0,r[d])(a==="accessor"?{get:l.get,set:l.set}:l[u],p);if(a==="accessor"){if(g===void 0)continue;if(g===null||typeof g!="object")throw new TypeError("Object expected");(f=s(g.get))&&(l.get=f),(f=s(g.set))&&(l.set=f),(f=s(g.init))&&i.unshift(f)}else(f=s(g))&&(a==="field"?i.unshift(f):l[u]=f)}c&&Object.defineProperty(c,n.name,l),h=!0}function AK(t,e,r){for(var n=arguments.length>2,i=0;i<e.length;i++)r=n?e[i].call(t,r):e[i].call(t);return n?r:void 0}function kK(t){return typeof t=="symbol"?t:"".concat(t)}function TK(t,e,r){return typeof e=="symbol"&&(e=e.description?"[".concat(e.description,"]"):""),Object.defineProperty(t,"name",{configurable:!0,value:r?"".concat(r," ",e):e})}function u2(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function c2(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(l){try{c(n.next(l))}catch(f){s(f)}}function u(l){try{c(n.throw(l))}catch(f){s(f)}}function c(l){l.done?o(l.value):i(l.value).then(a,u)}c((n=n.apply(t,e||[])).next())})}function l2(t,e){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(c){return function(l){return u([c,l])}}function u(c){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,c[0]&&(r=0)),r;)try{if(n=1,i&&(o=c[0]&2?i.return:c[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,c[1])).done)return o;switch(i=0,o&&(c=[c[0]&2,o.value]),c[0]){case 0:case 1:o=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,i=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]<o[3])){r.label=c[1];break}if(c[0]===6&&r.label<o[1]){r.label=o[1],o=c;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(c);break}o[2]&&r.ops.pop(),r.trys.pop();continue}c=e.call(t,r)}catch(l){c=[6,l],i=0}finally{n=o=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function f2(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&ld(e,t,r)}function cd(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function aD(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,o=[],s;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(a){s={error:a}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return o}function d2(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(aD(arguments[e]));return t}function h2(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var n=Array(t),i=0,e=0;e<r;e++)for(var o=arguments[e],s=0,a=o.length;s<a;s++,i++)n[i]=o[s];return n}function p2(t,e,r){if(r||arguments.length===2)for(var n=0,i=e.length,o;n<i;n++)(o||!(n in e))&&(o||(o=Array.prototype.slice.call(e,0,n)),o[n]=e[n]);return t.concat(o||Array.prototype.slice.call(e))}function Is(t){return this instanceof Is?(this.v=t,this):new Is(t)}function m2(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(t,e||[]),i,o=[];return i={},s("next"),s("throw"),s("return"),i[Symbol.asyncIterator]=function(){return this},i;function s(h){n[h]&&(i[h]=function(d){return new Promise(function(p,v){o.push([h,d,p,v])>1||a(h,d)})})}function a(h,d){try{u(n[h](d))}catch(p){f(o[0][3],p)}}function u(h){h.value instanceof Is?Promise.resolve(h.value.v).then(c,l):f(o[0][2],h)}function c(h){a("next",h)}function l(h){a("throw",h)}function f(h,d){h(d),o.shift(),o.length&&a(o[0][0],o[0][1])}}function g2(t){var e,r;return e={},n("next"),n("throw",function(i){throw i}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(i,o){e[i]=t[i]?function(s){return(r=!r)?{value:Is(t[i](s)),done:!1}:o?o(s):s}:o}}function y2(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof cd=="function"?cd(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(o){r[o]=t[o]&&function(s){return new Promise(function(a,u){s=t[o](s),i(a,u,s.done,s.value)})}}function i(o,s,a,u){Promise.resolve(u).then(function(c){o({value:c,done:a})},s)}}function D2(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function v2(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&ld(e,t,r);return PK(e,t),e}function b2(t){return t&&t.__esModule?t:{default:t}}function w2(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)}function _2(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r}function E2(t,e){if(e===null||typeof e!="object"&&typeof e!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof t=="function"?e===t:t.has(e)}function C2(t,e,r){if(e!=null){if(typeof e!="object"&&typeof e!="function")throw new TypeError("Object expected.");var n;if(r){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");n=e[Symbol.asyncDispose]}if(n===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");n=e[Symbol.dispose]}if(typeof n!="function")throw new TypeError("Object not disposable.");t.stack.push({value:e,dispose:n,async:r})}else r&&t.stack.push({async:!0});return e}function S2(t){function e(n){t.error=t.hasError?new RK(n,t.error,"An error was suppressed during disposal."):n,t.hasError=!0}function r(){for(;t.stack.length;){var n=t.stack.pop();try{var i=n.dispose&&n.dispose.call(n.value);if(n.async)return Promise.resolve(i).then(r,function(o){return e(o),r()})}catch(o){e(o)}}if(t.hasError)throw t.error}return r()}var sD,ud,ld,PK,RK,$K,F2=ut(()=>{sD=function(t,e){return sD=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])},sD(t,e)};ud=function(){return ud=Object.assign||function(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},ud.apply(this,arguments)};ld=Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]};PK=Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e};RK=typeof SuppressedError=="function"?SuppressedError:function(t,e,r){var n=new Error(r);return n.name="SuppressedError",n.error=t,n.suppressed=e,n};$K={__extends:i2,__assign:ud,__rest:o2,__decorate:s2,__param:a2,__metadata:u2,__awaiter:c2,__generator:l2,__createBinding:ld,__exportStar:f2,__values:cd,__read:aD,__spread:d2,__spreadArrays:h2,__spreadArray:p2,__await:Is,__asyncGenerator:m2,__asyncDelegator:g2,__asyncValues:y2,__makeTemplateObject:D2,__importStar:v2,__importDefault:b2,__classPrivateFieldGet:w2,__classPrivateFieldSet:_2,__classPrivateFieldIn:E2,__addDisposableResource:C2,__disposeResources:S2}});var Gt=y(uD=>{"use strict";uD.fromCallback=function(t){return Object.defineProperty(function(...e){if(typeof e[e.length-1]=="function")t.apply(this,e);else return new Promise((r,n)=>{e.push((i,o)=>i!=null?n(i):r(o)),t.apply(this,e)})},"name",{value:t.name})};uD.fromPromise=function(t){return Object.defineProperty(function(...e){let r=e[e.length-1];if(typeof r!="function")return t.apply(this,e);e.pop(),t.apply(this,e).then(n=>r(null,n),r)},"name",{value:t.name})}});var Wu=y(si=>{"use strict";var O2=Gt().fromCallback,Pt=dt(),IK=["access","appendFile","chmod","chown","close","copyFile","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","lchmod","lchown","link","lstat","mkdir","mkdtemp","open","opendir","readdir","readFile","readlink","realpath","rename","rm","rmdir","stat","symlink","truncate","unlink","utimes","writeFile"].filter(t=>typeof Pt[t]=="function");Object.keys(Pt).forEach(t=>{t!=="promises"&&(si[t]=Pt[t])});IK.forEach(t=>{si[t]=O2(Pt[t])});si.exists=function(t,e){return typeof e=="function"?Pt.exists(t,e):new Promise(r=>Pt.exists(t,r))};si.read=function(t,e,r,n,i,o){return typeof o=="function"?Pt.read(t,e,r,n,i,o):new Promise((s,a)=>{Pt.read(t,e,r,n,i,(u,c,l)=>{if(u)return a(u);s({bytesRead:c,buffer:l})})})};si.write=function(t,e,...r){return typeof r[r.length-1]=="function"?Pt.write(t,e,...r):new Promise((n,i)=>{Pt.write(t,e,...r,(o,s,a)=>{if(o)return i(o);n({bytesWritten:s,buffer:a})})})};typeof Pt.writev=="function"&&(si.writev=function(t,e,...r){return typeof r[r.length-1]=="function"?Pt.writev(t,e,...r):new Promise((n,i)=>{Pt.writev(t,e,...r,(o,s,a)=>{if(o)return i(o);n({bytesWritten:s,buffers:a})})})});typeof Pt.realpath.native=="function"&&(si.realpath.native=O2(Pt.realpath.native))});var cD=y((ahe,A2)=>{A2.exports=t=>{let e=process.versions.node.split(".").map(r=>parseInt(r,10));return t=t.split(".").map(r=>parseInt(r,10)),e[0]>t[0]||e[0]===t[0]&&(e[1]>t[1]||e[1]===t[1]&&e[2]>=t[2])}});var $2=y((uhe,lD)=>{"use strict";var js=Wu(),Sn=require("path"),jK=cD(),k2=jK("10.12.0"),T2=t=>{if(process.platform==="win32"&&/[<>:"|?*]/.test(t.replace(Sn.parse(t).root,""))){let r=new Error(`Path contains invalid characters: ${t}`);throw r.code="EINVAL",r}},P2=t=>{let e={mode:511};return typeof t=="number"&&(t={mode:t}),{...e,...t}},R2=t=>{let e=new Error(`operation not permitted, mkdir '${t}'`);return e.code="EPERM",e.errno=-4048,e.path=t,e.syscall="mkdir",e};lD.exports.makeDir=async(t,e)=>{if(T2(t),e=P2(e),k2){let n=Sn.resolve(t);return js.mkdir(n,{mode:e.mode,recursive:!0})}let r=async n=>{try{await js.mkdir(n,e.mode)}catch(i){if(i.code==="EPERM")throw i;if(i.code==="ENOENT"){if(Sn.dirname(n)===n)throw R2(n);if(i.message.includes("null bytes"))throw i;return await r(Sn.dirname(n)),r(n)}try{if(!(await js.stat(n)).isDirectory())throw new Error("The path is not a directory")}catch{throw i}}};return r(Sn.resolve(t))};lD.exports.makeDirSync=(t,e)=>{if(T2(t),e=P2(e),k2){let n=Sn.resolve(t);return js.mkdirSync(n,{mode:e.mode,recursive:!0})}let r=n=>{try{js.mkdirSync(n,e.mode)}catch(i){if(i.code==="EPERM")throw i;if(i.code==="ENOENT"){if(Sn.dirname(n)===n)throw R2(n);if(i.message.includes("null bytes"))throw i;return r(Sn.dirname(n)),r(n)}try{if(!js.statSync(n).isDirectory())throw new Error("The path is not a directory")}catch{throw i}}};return r(Sn.resolve(t))}});var kr=y((che,I2)=>{"use strict";var NK=Gt().fromPromise,{makeDir:LK,makeDirSync:fD}=$2(),dD=NK(LK);I2.exports={mkdirs:dD,mkdirsSync:fD,mkdirp:dD,mkdirpSync:fD,ensureDir:dD,ensureDirSync:fD}});var hD=y((lhe,j2)=>{"use strict";var Ns=dt();function BK(t,e,r,n){Ns.open(t,"r+",(i,o)=>{if(i)return n(i);Ns.futimes(o,e,r,s=>{Ns.close(o,a=>{n&&n(s||a)})})})}function qK(t,e,r){let n=Ns.openSync(t,"r+");return Ns.futimesSync(n,e,r),Ns.closeSync(n)}j2.exports={utimesMillis:BK,utimesMillisSync:qK}});var Ku=y((fhe,q2)=>{"use strict";var Ls=Wu(),Wt=require("path"),MK=require("util"),UK=cD(),fd=UK("10.5.0"),N2=t=>fd?Ls.stat(t,{bigint:!0}):Ls.stat(t),pD=t=>fd?Ls.statSync(t,{bigint:!0}):Ls.statSync(t);function VK(t,e){return Promise.all([N2(t),N2(e).catch(r=>{if(r.code==="ENOENT")return null;throw r})]).then(([r,n])=>({srcStat:r,destStat:n}))}function HK(t,e){let r,n=pD(t);try{r=pD(e)}catch(i){if(i.code==="ENOENT")return{srcStat:n,destStat:null};throw i}return{srcStat:n,destStat:r}}function zK(t,e,r,n){MK.callbackify(VK)(t,e,(i,o)=>{if(i)return n(i);let{srcStat:s,destStat:a}=o;return a&&dd(s,a)?n(new Error("Source and destination must not be the same.")):s.isDirectory()&&mD(t,e)?n(new Error(hd(t,e,r))):n(null,{srcStat:s,destStat:a})})}function GK(t,e,r){let{srcStat:n,destStat:i}=HK(t,e);if(i&&dd(n,i))throw new Error("Source and destination must not be the same.");if(n.isDirectory()&&mD(t,e))throw new Error(hd(t,e,r));return{srcStat:n,destStat:i}}function L2(t,e,r,n,i){let o=Wt.resolve(Wt.dirname(t)),s=Wt.resolve(Wt.dirname(r));if(s===o||s===Wt.parse(s).root)return i();let a=(u,c)=>u?u.code==="ENOENT"?i():i(u):dd(e,c)?i(new Error(hd(t,r,n))):L2(t,e,s,n,i);fd?Ls.stat(s,{bigint:!0},a):Ls.stat(s,a)}function B2(t,e,r,n){let i=Wt.resolve(Wt.dirname(t)),o=Wt.resolve(Wt.dirname(r));if(o===i||o===Wt.parse(o).root)return;let s;try{s=pD(o)}catch(a){if(a.code==="ENOENT")return;throw a}if(dd(e,s))throw new Error(hd(t,r,n));return B2(t,e,o,n)}function dd(t,e){return!!(e.ino&&e.dev&&e.ino===t.ino&&e.dev===t.dev&&(fd||e.ino<Number.MAX_SAFE_INTEGER||e.size===t.size&&e.mode===t.mode&&e.nlink===t.nlink&&e.atimeMs===t.atimeMs&&e.mtimeMs===t.mtimeMs&&e.ctimeMs===t.ctimeMs&&e.birthtimeMs===t.birthtimeMs))}function mD(t,e){let r=Wt.resolve(t).split(Wt.sep).filter(i=>i),n=Wt.resolve(e).split(Wt.sep).filter(i=>i);return r.reduce((i,o,s)=>i&&n[s]===o,!0)}function hd(t,e,r){return`Cannot ${r} '${t}' to a subdirectory of itself, '${e}'.`}q2.exports={checkPaths:zK,checkPathsSync:GK,checkParentPaths:L2,checkParentPathsSync:B2,isSrcSubdir:mD}});var z2=y((dhe,H2)=>{"use strict";var Ct=dt(),Yu=require("path"),WK=kr().mkdirsSync,KK=hD().utimesMillisSync,Ju=Ku();function YK(t,e,r){typeof r=="function"&&(r={filter:r}),r=r||{},r.clobber="clobber"in r?!!r.clobber:!0,r.overwrite="overwrite"in r?!!r.overwrite:r.clobber,r.preserveTimestamps&&process.arch==="ia32"&&console.warn(`fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;
39
+ `)}),e}});var Kx=y((qde,Wx)=>{var ii=require("constants"),SW=process.cwd,zf=null,xW=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return zf||(zf=SW.call(process)),zf};try{process.cwd()}catch{}typeof process.chdir=="function"&&(Uy=process.chdir,process.chdir=function(t){zf=null,Uy.call(process,t)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,Uy));var Uy;Wx.exports=FW;function FW(t){ii.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&e(t),t.lutimes||r(t),t.chown=o(t.chown),t.fchown=o(t.fchown),t.lchown=o(t.lchown),t.chmod=n(t.chmod),t.fchmod=n(t.fchmod),t.lchmod=n(t.lchmod),t.chownSync=s(t.chownSync),t.fchownSync=s(t.fchownSync),t.lchownSync=s(t.lchownSync),t.chmodSync=i(t.chmodSync),t.fchmodSync=i(t.fchmodSync),t.lchmodSync=i(t.lchmodSync),t.stat=a(t.stat),t.fstat=a(t.fstat),t.lstat=a(t.lstat),t.statSync=u(t.statSync),t.fstatSync=u(t.fstatSync),t.lstatSync=u(t.lstatSync),t.chmod&&!t.lchmod&&(t.lchmod=function(l,f,h){h&&process.nextTick(h)},t.lchmodSync=function(){}),t.chown&&!t.lchown&&(t.lchown=function(l,f,h,d){d&&process.nextTick(d)},t.lchownSync=function(){}),xW==="win32"&&(t.rename=typeof t.rename!="function"?t.rename:function(l){function f(h,d,p){var v=Date.now(),g=0;l(h,d,function w(x){if(x&&(x.code==="EACCES"||x.code==="EPERM"||x.code==="EBUSY")&&Date.now()-v<6e4){setTimeout(function(){t.stat(d,function(D,C){D&&D.code==="ENOENT"?l(h,d,w):p(x)})},g),g<100&&(g+=10);return}p&&p(x)})}return Object.setPrototypeOf&&Object.setPrototypeOf(f,l),f}(t.rename)),t.read=typeof t.read!="function"?t.read:function(l){function f(h,d,p,v,g,w){var x;if(w&&typeof w=="function"){var D=0;x=function(C,k,$){if(C&&C.code==="EAGAIN"&&D<10)return D++,l.call(t,h,d,p,v,g,x);w.apply(this,arguments)}}return l.call(t,h,d,p,v,g,x)}return Object.setPrototypeOf&&Object.setPrototypeOf(f,l),f}(t.read),t.readSync=typeof t.readSync!="function"?t.readSync:function(l){return function(f,h,d,p,v){for(var g=0;;)try{return l.call(t,f,h,d,p,v)}catch(w){if(w.code==="EAGAIN"&&g<10){g++;continue}throw w}}}(t.readSync);function e(l){l.lchmod=function(f,h,d){l.open(f,ii.O_WRONLY|ii.O_SYMLINK,h,function(p,v){if(p){d&&d(p);return}l.fchmod(v,h,function(g){l.close(v,function(w){d&&d(g||w)})})})},l.lchmodSync=function(f,h){var d=l.openSync(f,ii.O_WRONLY|ii.O_SYMLINK,h),p=!0,v;try{v=l.fchmodSync(d,h),p=!1}finally{if(p)try{l.closeSync(d)}catch{}else l.closeSync(d)}return v}}function r(l){ii.hasOwnProperty("O_SYMLINK")&&l.futimes?(l.lutimes=function(f,h,d,p){l.open(f,ii.O_SYMLINK,function(v,g){if(v){p&&p(v);return}l.futimes(g,h,d,function(w){l.close(g,function(x){p&&p(w||x)})})})},l.lutimesSync=function(f,h,d){var p=l.openSync(f,ii.O_SYMLINK),v,g=!0;try{v=l.futimesSync(p,h,d),g=!1}finally{if(g)try{l.closeSync(p)}catch{}else l.closeSync(p)}return v}):l.futimes&&(l.lutimes=function(f,h,d,p){p&&process.nextTick(p)},l.lutimesSync=function(){})}function n(l){return l&&function(f,h,d){return l.call(t,f,h,function(p){c(p)&&(p=null),d&&d.apply(this,arguments)})}}function i(l){return l&&function(f,h){try{return l.call(t,f,h)}catch(d){if(!c(d))throw d}}}function o(l){return l&&function(f,h,d,p){return l.call(t,f,h,d,function(v){c(v)&&(v=null),p&&p.apply(this,arguments)})}}function s(l){return l&&function(f,h,d){try{return l.call(t,f,h,d)}catch(p){if(!c(p))throw p}}}function a(l){return l&&function(f,h,d){typeof h=="function"&&(d=h,h=null);function p(v,g){g&&(g.uid<0&&(g.uid+=4294967296),g.gid<0&&(g.gid+=4294967296)),d&&d.apply(this,arguments)}return h?l.call(t,f,h,p):l.call(t,f,p)}}function u(l){return l&&function(f,h){var d=h?l.call(t,f,h):l.call(t,f);return d&&(d.uid<0&&(d.uid+=4294967296),d.gid<0&&(d.gid+=4294967296)),d}}function c(l){if(!l||l.code==="ENOSYS")return!0;var f=!process.getuid||process.getuid()!==0;return!!(f&&(l.code==="EINVAL"||l.code==="EPERM"))}}});var Xx=y((Mde,Jx)=>{var Yx=require("stream").Stream;Jx.exports=OW;function OW(t){return{ReadStream:e,WriteStream:r};function e(n,i){if(!(this instanceof e))return new e(n,i);Yx.call(this);var o=this;this.path=n,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=64*1024,i=i||{};for(var s=Object.keys(i),a=0,u=s.length;a<u;a++){var c=s[a];this[c]=i[c]}if(this.encoding&&this.setEncoding(this.encoding),this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.end===void 0)this.end=1/0;else if(typeof this.end!="number")throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}if(this.fd!==null){process.nextTick(function(){o._read()});return}t.open(this.path,this.flags,this.mode,function(l,f){if(l){o.emit("error",l),o.readable=!1;return}o.fd=f,o.emit("open",f),o._read()})}function r(n,i){if(!(this instanceof r))return new r(n,i);Yx.call(this),this.path=n,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,i=i||{};for(var o=Object.keys(i),s=0,a=o.length;s<a;s++){var u=o[s];this[u]=i[u]}if(this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start}this.busy=!1,this._queue=[],this.fd===null&&(this._open=t.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}});var Qx=y((Ude,Zx)=>{"use strict";Zx.exports=kW;var AW=Object.getPrototypeOf||function(t){return t.__proto__};function kW(t){if(t===null||typeof t!="object")return t;if(t instanceof Object)var e={__proto__:AW(t)};else var e=Object.create(null);return Object.getOwnPropertyNames(t).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}});var dt=y((Vde,zy)=>{var Ve=require("fs"),TW=Kx(),PW=Xx(),RW=Qx(),Gf=require("util"),wt,Kf;typeof Symbol=="function"&&typeof Symbol.for=="function"?(wt=Symbol.for("graceful-fs.queue"),Kf=Symbol.for("graceful-fs.previous")):(wt="___graceful-fs.queue",Kf="___graceful-fs.previous");function $W(){}function rF(t,e){Object.defineProperty(t,wt,{get:function(){return e}})}var ro=$W;Gf.debuglog?ro=Gf.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(ro=function(){var t=Gf.format.apply(Gf,arguments);t="GFS4: "+t.split(/\n/).join(`
40
+ GFS4: `),console.error(t)});Ve[wt]||(eF=global[wt]||[],rF(Ve,eF),Ve.close=function(t){function e(r,n){return t.call(Ve,r,function(i){i||tF(),typeof n=="function"&&n.apply(this,arguments)})}return Object.defineProperty(e,Kf,{value:t}),e}(Ve.close),Ve.closeSync=function(t){function e(r){t.apply(Ve,arguments),tF()}return Object.defineProperty(e,Kf,{value:t}),e}(Ve.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){ro(Ve[wt]),require("assert").equal(Ve[wt].length,0)}));var eF;global[wt]||rF(global,Ve[wt]);zy.exports=Vy(RW(Ve));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!Ve.__patched&&(zy.exports=Vy(Ve),Ve.__patched=!0);function Vy(t){TW(t),t.gracefulify=Vy,t.createReadStream=k,t.createWriteStream=$;var e=t.readFile;t.readFile=r;function r(S,I,R){return typeof I=="function"&&(R=I,I=null),B(S,I,R);function B(q,K,M,E){return e(q,K,function(b){b&&(b.code==="EMFILE"||b.code==="ENFILE")?xs([B,[q,K,M],b,E||Date.now(),Date.now()]):typeof M=="function"&&M.apply(this,arguments)})}}var n=t.writeFile;t.writeFile=i;function i(S,I,R,B){return typeof R=="function"&&(B=R,R=null),q(S,I,R,B);function q(K,M,E,b,_){return n(K,M,E,function(O){O&&(O.code==="EMFILE"||O.code==="ENFILE")?xs([q,[K,M,E,b],O,_||Date.now(),Date.now()]):typeof b=="function"&&b.apply(this,arguments)})}}var o=t.appendFile;o&&(t.appendFile=s);function s(S,I,R,B){return typeof R=="function"&&(B=R,R=null),q(S,I,R,B);function q(K,M,E,b,_){return o(K,M,E,function(O){O&&(O.code==="EMFILE"||O.code==="ENFILE")?xs([q,[K,M,E,b],O,_||Date.now(),Date.now()]):typeof b=="function"&&b.apply(this,arguments)})}}var a=t.copyFile;a&&(t.copyFile=u);function u(S,I,R,B){return typeof R=="function"&&(B=R,R=0),q(S,I,R,B);function q(K,M,E,b,_){return a(K,M,E,function(O){O&&(O.code==="EMFILE"||O.code==="ENFILE")?xs([q,[K,M,E,b],O,_||Date.now(),Date.now()]):typeof b=="function"&&b.apply(this,arguments)})}}var c=t.readdir;t.readdir=f;var l=/^v[0-5]\./;function f(S,I,R){typeof I=="function"&&(R=I,I=null);var B=l.test(process.version)?function(M,E,b,_){return c(M,q(M,E,b,_))}:function(M,E,b,_){return c(M,E,q(M,E,b,_))};return B(S,I,R);function q(K,M,E,b){return function(_,O){_&&(_.code==="EMFILE"||_.code==="ENFILE")?xs([B,[K,M,E],_,b||Date.now(),Date.now()]):(O&&O.sort&&O.sort(),typeof E=="function"&&E.call(this,_,O))}}}if(process.version.substr(0,4)==="v0.8"){var h=PW(t);w=h.ReadStream,D=h.WriteStream}var d=t.ReadStream;d&&(w.prototype=Object.create(d.prototype),w.prototype.open=x);var p=t.WriteStream;p&&(D.prototype=Object.create(p.prototype),D.prototype.open=C),Object.defineProperty(t,"ReadStream",{get:function(){return w},set:function(S){w=S},enumerable:!0,configurable:!0}),Object.defineProperty(t,"WriteStream",{get:function(){return D},set:function(S){D=S},enumerable:!0,configurable:!0});var v=w;Object.defineProperty(t,"FileReadStream",{get:function(){return v},set:function(S){v=S},enumerable:!0,configurable:!0});var g=D;Object.defineProperty(t,"FileWriteStream",{get:function(){return g},set:function(S){g=S},enumerable:!0,configurable:!0});function w(S,I){return this instanceof w?(d.apply(this,arguments),this):w.apply(Object.create(w.prototype),arguments)}function x(){var S=this;L(S.path,S.flags,S.mode,function(I,R){I?(S.autoClose&&S.destroy(),S.emit("error",I)):(S.fd=R,S.emit("open",R),S.read())})}function D(S,I){return this instanceof D?(p.apply(this,arguments),this):D.apply(Object.create(D.prototype),arguments)}function C(){var S=this;L(S.path,S.flags,S.mode,function(I,R){I?(S.destroy(),S.emit("error",I)):(S.fd=R,S.emit("open",R))})}function k(S,I){return new t.ReadStream(S,I)}function $(S,I){return new t.WriteStream(S,I)}var F=t.open;t.open=L;function L(S,I,R,B){return typeof R=="function"&&(B=R,R=null),q(S,I,R,B);function q(K,M,E,b,_){return F(K,M,E,function(O,j){O&&(O.code==="EMFILE"||O.code==="ENFILE")?xs([q,[K,M,E,b],O,_||Date.now(),Date.now()]):typeof b=="function"&&b.apply(this,arguments)})}}return t}function xs(t){ro("ENQUEUE",t[0].name,t[1]),Ve[wt].push(t),Hy()}var Wf;function tF(){for(var t=Date.now(),e=0;e<Ve[wt].length;++e)Ve[wt][e].length>2&&(Ve[wt][e][3]=t,Ve[wt][e][4]=t);Hy()}function Hy(){if(clearTimeout(Wf),Wf=void 0,Ve[wt].length!==0){var t=Ve[wt].shift(),e=t[0],r=t[1],n=t[2],i=t[3],o=t[4];if(i===void 0)ro("RETRY",e.name,r),e.apply(null,r);else if(Date.now()-i>=6e4){ro("TIMEOUT",e.name,r);var s=r.pop();typeof s=="function"&&s.call(null,n)}else{var a=Date.now()-o,u=Math.max(o-i,1),c=Math.min(u*1.2,100);a>=c?(ro("RETRY",e.name,r),e.apply(null,r.concat([i]))):Ve[wt].push(t)}Wf===void 0&&(Wf=setTimeout(Hy,0))}}});var iF=y((Hde,nF)=>{function Dr(t,e){typeof e=="boolean"&&(e={forever:e}),this._originalTimeouts=JSON.parse(JSON.stringify(t)),this._timeouts=t,this._options=e||{},this._maxRetryTime=e&&e.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}nF.exports=Dr;Dr.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts};Dr.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timeouts=[],this._cachedTimeouts=null};Dr.prototype.retry=function(t){if(this._timeout&&clearTimeout(this._timeout),!t)return!1;var e=new Date().getTime();if(t&&e-this._operationStart>=this._maxRetryTime)return this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(t);var r=this._timeouts.shift();if(r===void 0)if(this._cachedTimeouts)this._errors.splice(this._errors.length-1,this._errors.length),this._timeouts=this._cachedTimeouts.slice(0),r=this._timeouts.shift();else return!1;var n=this,i=setTimeout(function(){n._attempts++,n._operationTimeoutCb&&(n._timeout=setTimeout(function(){n._operationTimeoutCb(n._attempts)},n._operationTimeout),n._options.unref&&n._timeout.unref()),n._fn(n._attempts)},r);return this._options.unref&&i.unref(),!0};Dr.prototype.attempt=function(t,e){this._fn=t,e&&(e.timeout&&(this._operationTimeout=e.timeout),e.cb&&(this._operationTimeoutCb=e.cb));var r=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){r._operationTimeoutCb()},r._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)};Dr.prototype.try=function(t){console.log("Using RetryOperation.try() is deprecated"),this.attempt(t)};Dr.prototype.start=function(t){console.log("Using RetryOperation.start() is deprecated"),this.attempt(t)};Dr.prototype.start=Dr.prototype.try;Dr.prototype.errors=function(){return this._errors};Dr.prototype.attempts=function(){return this._attempts};Dr.prototype.mainError=function(){if(this._errors.length===0)return null;for(var t={},e=null,r=0,n=0;n<this._errors.length;n++){var i=this._errors[n],o=i.message,s=(t[o]||0)+1;t[o]=s,s>=r&&(e=i,r=s)}return e}});var oF=y(no=>{var IW=iF();no.operation=function(t){var e=no.timeouts(t);return new IW(e,{forever:t&&t.forever,unref:t&&t.unref,maxRetryTime:t&&t.maxRetryTime})};no.timeouts=function(t){if(t instanceof Array)return[].concat(t);var e={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var r in t)e[r]=t[r];if(e.minTimeout>e.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var n=[],i=0;i<e.retries;i++)n.push(this.createTimeout(i,e));return t&&t.forever&&!n.length&&n.push(this.createTimeout(i,e)),n.sort(function(o,s){return o-s}),n};no.createTimeout=function(t,e){var r=e.randomize?Math.random()+1:1,n=Math.round(r*e.minTimeout*Math.pow(e.factor,t));return n=Math.min(n,e.maxTimeout),n};no.wrap=function(t,e,r){if(e instanceof Array&&(r=e,e=null),!r){r=[];for(var n in t)typeof t[n]=="function"&&r.push(n)}for(var i=0;i<r.length;i++){var o=r[i],s=t[o];t[o]=function(u){var c=no.operation(e),l=Array.prototype.slice.call(arguments,1),f=l.pop();l.push(function(h){c.retry(h)||(h&&(arguments[0]=c.mainError()),f.apply(this,arguments))}),c.attempt(function(){u.apply(t,l)})}.bind(t,s),t[o].options=e}}});var aF=y((Gde,sF)=>{sF.exports=oF()});var uF=y((Wde,Yf)=>{Yf.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];process.platform!=="win32"&&Yf.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&Yf.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")});var Ky=y((Kde,As)=>{var Le=global.process,io=function(t){return t&&typeof t=="object"&&typeof t.removeListener=="function"&&typeof t.emit=="function"&&typeof t.reallyExit=="function"&&typeof t.listeners=="function"&&typeof t.kill=="function"&&typeof t.pid=="number"&&typeof t.on=="function"};io(Le)?(cF=require("assert"),Fs=uF(),lF=/^win/i.test(Le.platform),Vu=require("events"),typeof Vu!="function"&&(Vu=Vu.EventEmitter),Le.__signal_exit_emitter__?ht=Le.__signal_exit_emitter__:(ht=Le.__signal_exit_emitter__=new Vu,ht.count=0,ht.emitted={}),ht.infinite||(ht.setMaxListeners(1/0),ht.infinite=!0),As.exports=function(t,e){if(!io(global.process))return function(){};cF.equal(typeof t,"function","a callback must be provided for exit handler"),Os===!1&&Gy();var r="exit";e&&e.alwaysLast&&(r="afterexit");var n=function(){ht.removeListener(r,t),ht.listeners("exit").length===0&&ht.listeners("afterexit").length===0&&Jf()};return ht.on(r,t),n},Jf=function(){!Os||!io(global.process)||(Os=!1,Fs.forEach(function(e){try{Le.removeListener(e,Xf[e])}catch{}}),Le.emit=Zf,Le.reallyExit=Wy,ht.count-=1)},As.exports.unload=Jf,oo=function(e,r,n){ht.emitted[e]||(ht.emitted[e]=!0,ht.emit(e,r,n))},Xf={},Fs.forEach(function(t){Xf[t]=function(){if(io(global.process)){var r=Le.listeners(t);r.length===ht.count&&(Jf(),oo("exit",null,t),oo("afterexit",null,t),lF&&t==="SIGHUP"&&(t="SIGINT"),Le.kill(Le.pid,t))}}}),As.exports.signals=function(){return Fs},Os=!1,Gy=function(){Os||!io(global.process)||(Os=!0,ht.count+=1,Fs=Fs.filter(function(e){try{return Le.on(e,Xf[e]),!0}catch{return!1}}),Le.emit=dF,Le.reallyExit=fF)},As.exports.load=Gy,Wy=Le.reallyExit,fF=function(e){io(global.process)&&(Le.exitCode=e||0,oo("exit",Le.exitCode,null),oo("afterexit",Le.exitCode,null),Wy.call(Le,Le.exitCode))},Zf=Le.emit,dF=function(e,r){if(e==="exit"&&io(global.process)){r!==void 0&&(Le.exitCode=r);var n=Zf.apply(this,arguments);return oo("exit",Le.exitCode,null),oo("afterexit",Le.exitCode,null),n}else return Zf.apply(this,arguments)}):As.exports=function(){return function(){}};var cF,Fs,lF,Vu,ht,Jf,oo,Xf,Os,Gy,Wy,fF,Zf,dF});var pF=y((Yde,Yy)=>{"use strict";var hF=Symbol();function jW(t,e,r){let n=e[hF];if(n)return e.stat(t,(o,s)=>{if(o)return r(o);r(null,s.mtime,n)});let i=new Date(Math.ceil(Date.now()/1e3)*1e3+5);e.utimes(t,i,i,o=>{if(o)return r(o);e.stat(t,(s,a)=>{if(s)return r(s);let u=a.mtime.getTime()%1e3===0?"s":"ms";Object.defineProperty(e,hF,{value:u}),r(null,a.mtime,u)})})}function NW(t){let e=Date.now();return t==="s"&&(e=Math.ceil(e/1e3)*1e3),new Date(e)}Yy.exports.probe=jW;Yy.exports.getMtime=NW});var vF=y((Jde,zu)=>{"use strict";var LW=require("path"),Zy=dt(),BW=aF(),qW=Ky(),mF=pF(),_n={};function Hu(t,e){return e.lockfilePath||`${t}.lock`}function Qy(t,e,r){if(!e.realpath)return r(null,LW.resolve(t));e.fs.realpath(t,r)}function Xy(t,e,r){let n=Hu(t,e);e.fs.mkdir(n,i=>{if(!i)return mF.probe(n,e.fs,(o,s,a)=>{if(o)return e.fs.rmdir(n,()=>{}),r(o);r(null,s,a)});if(i.code!=="EEXIST")return r(i);if(e.stale<=0)return r(Object.assign(new Error("Lock file is already being held"),{code:"ELOCKED",file:t}));e.fs.stat(n,(o,s)=>{if(o)return o.code==="ENOENT"?Xy(t,{...e,stale:0},r):r(o);if(!gF(s,e))return r(Object.assign(new Error("Lock file is already being held"),{code:"ELOCKED",file:t}));yF(t,e,a=>{if(a)return r(a);Xy(t,{...e,stale:0},r)})})})}function gF(t,e){return t.mtime.getTime()<Date.now()-e.stale}function yF(t,e,r){e.fs.rmdir(Hu(t,e),n=>{if(n&&n.code!=="ENOENT")return r(n);r()})}function Qf(t,e){let r=_n[t];r.updateTimeout||(r.updateDelay=r.updateDelay||e.update,r.updateTimeout=setTimeout(()=>{r.updateTimeout=null,e.fs.stat(r.lockfilePath,(n,i)=>{let o=r.lastUpdate+e.stale<Date.now();if(n)return n.code==="ENOENT"||o?Jy(t,r,Object.assign(n,{code:"ECOMPROMISED"})):(r.updateDelay=1e3,Qf(t,e));if(!(r.mtime.getTime()===i.mtime.getTime()))return Jy(t,r,Object.assign(new Error("Unable to update lock within the stale threshold"),{code:"ECOMPROMISED"}));let a=mF.getMtime(r.mtimePrecision);e.fs.utimes(r.lockfilePath,a,a,u=>{let c=r.lastUpdate+e.stale<Date.now();if(!r.released){if(u)return u.code==="ENOENT"||c?Jy(t,r,Object.assign(u,{code:"ECOMPROMISED"})):(r.updateDelay=1e3,Qf(t,e));r.mtime=a,r.lastUpdate=Date.now(),r.updateDelay=null,Qf(t,e)}})})},r.updateDelay),r.updateTimeout.unref&&r.updateTimeout.unref())}function Jy(t,e,r){e.released=!0,e.updateTimeout&&clearTimeout(e.updateTimeout),_n[t]===e&&delete _n[t],e.options.onCompromised(r)}function MW(t,e,r){e={stale:1e4,update:null,realpath:!0,retries:0,fs:Zy,onCompromised:n=>{throw n},...e},e.retries=e.retries||0,e.retries=typeof e.retries=="number"?{retries:e.retries}:e.retries,e.stale=Math.max(e.stale||0,2e3),e.update=e.update==null?e.stale/2:e.update||0,e.update=Math.max(Math.min(e.update,e.stale/2),1e3),Qy(t,e,(n,i)=>{if(n)return r(n);let o=BW.operation(e.retries);o.attempt(()=>{Xy(i,e,(s,a,u)=>{if(o.retry(s))return;if(s)return r(o.mainError());let c=_n[i]={lockfilePath:Hu(i,e),mtime:a,mtimePrecision:u,options:e,lastUpdate:Date.now()};Qf(i,e),r(null,l=>{if(c.released)return l&&l(Object.assign(new Error("Lock is already released"),{code:"ERELEASED"}));DF(i,{...e,realpath:!1},l)})})})})}function DF(t,e,r){e={fs:Zy,realpath:!0,...e},Qy(t,e,(n,i)=>{if(n)return r(n);let o=_n[i];if(!o)return r(Object.assign(new Error("Lock is not acquired/owned by you"),{code:"ENOTACQUIRED"}));o.updateTimeout&&clearTimeout(o.updateTimeout),o.released=!0,delete _n[i],yF(i,e,r)})}function UW(t,e,r){e={stale:1e4,realpath:!0,fs:Zy,...e},e.stale=Math.max(e.stale||0,2e3),Qy(t,e,(n,i)=>{if(n)return r(n);e.fs.stat(Hu(i,e),(o,s)=>o?o.code==="ENOENT"?r(null,!1):r(o):r(null,!gF(s,e)))})}function VW(){return _n}qW(()=>{for(let t in _n){let e=_n[t].options;try{e.fs.rmdirSync(Hu(t,e))}catch{}}});zu.exports.lock=MW;zu.exports.unlock=DF;zu.exports.check=UW;zu.exports.getLocks=VW});var wF=y((Xde,bF)=>{"use strict";var HW=dt();function zW(t){let e=["mkdir","realpath","stat","rmdir","utimes"],r={...t};return e.forEach(n=>{r[n]=(...i)=>{let o=i.pop(),s;try{s=t[`${n}Sync`](...i)}catch(a){return o(a)}o(null,s)}}),r}function GW(t){return(...e)=>new Promise((r,n)=>{e.push((i,o)=>{i?n(i):r(o)}),t(...e)})}function WW(t){return(...e)=>{let r,n;if(e.push((i,o)=>{r=i,n=o}),t(...e),r)throw r;return n}}function KW(t){if(t={...t},t.fs=zW(t.fs||HW),typeof t.retries=="number"&&t.retries>0||t.retries&&typeof t.retries.retries=="number"&&t.retries.retries>0)throw Object.assign(new Error("Cannot use retries with the sync api"),{code:"ESYNC"});return t}bF.exports={toPromise:GW,toSync:WW,toSyncOptions:KW}});var EF=y((Zde,oi)=>{"use strict";var ks=vF(),{toPromise:ed,toSync:td,toSyncOptions:eD}=wF();async function _F(t,e){let r=await ed(ks.lock)(t,e);return ed(r)}function YW(t,e){let r=td(ks.lock)(t,eD(e));return td(r)}function JW(t,e){return ed(ks.unlock)(t,e)}function XW(t,e){return td(ks.unlock)(t,eD(e))}function ZW(t,e){return ed(ks.check)(t,e)}function QW(t,e){return td(ks.check)(t,eD(e))}oi.exports=_F;oi.exports.lock=_F;oi.exports.unlock=JW;oi.exports.lockSync=YW;oi.exports.unlockSync=XW;oi.exports.check=ZW;oi.exports.checkSync=QW});var OF=y(Ts=>{"use strict";Object.defineProperty(Ts,"__esModule",{value:!0});Ts.canStoreURLs=Ts.FileUrlStorage=void 0;var CF=require("fs"),eK=rK(Gx()),SF=tK(EF());function FF(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,r=new WeakMap;return(FF=function(n){return n?r:e})(t)}function tK(t,e){if(!e&&t&&t.__esModule)return t;if(t===null||typeof t!="object"&&typeof t!="function")return{default:t};var r=FF(e);if(r&&r.has(t))return r.get(t);var n={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in t)if(o!=="default"&&{}.hasOwnProperty.call(t,o)){var s=i?Object.getOwnPropertyDescriptor(t,o):null;s&&(s.get||s.set)?Object.defineProperty(n,o,s):n[o]=t[o]}return n.default=t,r&&r.set(t,n),n}function rK(t){return t&&t.__esModule?t:{default:t}}function Gu(t){"@babel/helpers - typeof";return Gu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Gu(t)}function nK(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function xF(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,oK(n.key),n)}}function iK(t,e,r){return e&&xF(t.prototype,e),r&&xF(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function oK(t){var e=sK(t,"string");return Gu(e)=="symbol"?e:e+""}function sK(t,e){if(Gu(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Gu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Qde=Ts.canStoreURLs=!0,ehe=Ts.FileUrlStorage=function(){function t(e){nK(this,t),this.path=e}return iK(t,[{key:"findAllUploads",value:function(){var r=this;return new Promise(function(n,i){r._getItems("tus::",function(o,s){o?i(o):n(s)})})}},{key:"findUploadsByFingerprint",value:function(r){var n=this;return new Promise(function(i,o){n._getItems("tus::".concat(r),function(s,a){s?o(s):i(a)})})}},{key:"removeUpload",value:function(r){var n=this;return new Promise(function(i,o){n._removeItem(r,function(s){s?o(s):i()})})}},{key:"addUpload",value:function(r,n){var i=this,o=Math.round(Math.random()*1e12),s="tus::".concat(r,"::").concat(o);return new Promise(function(a,u){i._setItem(s,n,function(c){c?u(c):a(s)})})}},{key:"_setItem",value:function(r,n,i){var o=this;SF.lock(this.path,this._lockfileOptions()).then(function(s){i=o._releaseAndCb(s,i),o._getData(function(a,u){if(a){i(a);return}u[r]=n,o._writeData(u,function(c){return i(c)})})}).catch(i)}},{key:"_getItems",value:function(r,n){this._getData(function(i,o){if(i){n(i);return}var s=Object.keys(o).filter(function(a){return a.startsWith(r)}).map(function(a){var u=o[a];return u.urlStorageKey=a,u});n(null,s)})}},{key:"_removeItem",value:function(r,n){var i=this;SF.lock(this.path,this._lockfileOptions()).then(function(o){n=i._releaseAndCb(o,n),i._getData(function(s,a){if(s){n(s);return}delete a[r],i._writeData(a,function(u){return n(u)})})}).catch(n)}},{key:"_lockfileOptions",value:function(){return{realpath:!1,retries:{retries:5,minTimeout:20}}}},{key:"_releaseAndCb",value:function(r,n){return function(i){if(i){r().then(function(){return n(i)}).catch(function(o){return n((0,eK.default)([i,o]))});return}r().then(n).catch(n)}}},{key:"_writeData",value:function(r,n){var i={encoding:"utf8",mode:432,flag:"w"};(0,CF.writeFile)(this.path,JSON.stringify(r),i,function(o){return n(o)})}},{key:"_getData",value:function(r){(0,CF.readFile)(this.path,"utf8",function(n,i){if(n){n.code==="ENOENT"?r(null,{}):r(n);return}try{i=i.trim().length?JSON.parse(i):{}}catch(o){r(o);return}r(null,i)})}}])}()});var nD=y(zt=>{"use strict";Object.defineProperty(zt,"__esModule",{value:!0});Object.defineProperty(zt,"DefaultHttpStack",{enumerable:!0,get:function(){return PF.default}});Object.defineProperty(zt,"DetailedError",{enumerable:!0,get:function(){return aK.default}});Object.defineProperty(zt,"FileUrlStorage",{enumerable:!0,get:function(){return RF.FileUrlStorage}});Object.defineProperty(zt,"StreamSource",{enumerable:!0,get:function(){return dK.default}});zt.Upload=void 0;Object.defineProperty(zt,"canStoreURLs",{enumerable:!0,get:function(){return RF.canStoreURLs}});zt.defaultOptions=void 0;Object.defineProperty(zt,"enableDebugLog",{enumerable:!0,get:function(){return uK.enableDebugLog}});zt.isSupported=void 0;var aK=so(Yg()),uK=Jg(),cK=so(OS()),tD=so(i1()),lK=so(y1()),fK=so(w1()),PF=so(I1()),dK=so(fy()),RF=OF();function so(t){return t&&t.__esModule?t:{default:t}}function Rs(t){"@babel/helpers - typeof";return Rs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Rs(t)}function hK(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function AF(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,IF(n.key),n)}}function pK(t,e,r){return e&&AF(t.prototype,e),r&&AF(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function mK(t,e,r){return e=rd(e),gK(t,$F()?Reflect.construct(e,r||[],rd(t).constructor):e.apply(t,r))}function gK(t,e){if(e&&(Rs(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return yK(t)}function yK(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function $F(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return($F=function(){return!!t})()}function rd(t){return rd=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},rd(t)}function DK(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&rD(t,e)}function rD(t,e){return rD=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},rD(t,e)}function kF(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Ps(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?kF(Object(r),!0).forEach(function(n){vK(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):kF(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function vK(t,e,r){return e=IF(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function IF(t){var e=bK(t,"string");return Rs(e)=="symbol"?e:e+""}function bK(t,e){if(Rs(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Rs(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var TF=zt.defaultOptions=Ps(Ps({},tD.default.defaultOptions),{},{httpStack:new PF.default,fileReader:new lK.default,urlStorage:new cK.default,fingerprint:fK.default}),rhe=zt.Upload=function(t){function e(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return hK(this,e),n=Ps(Ps({},TF),n),mK(this,e,[r,n])}return DK(e,t),pK(e,null,[{key:"terminate",value:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return i=Ps(Ps({},TF),i),tD.default.terminate(n,i)}}])}(tD.default),nhe=zt.isSupported=!0});var En={};mn(En,{__addDisposableResource:()=>r2,__assign:()=>nd,__asyncDelegator:()=>KF,__asyncGenerator:()=>WF,__asyncValues:()=>YF,__await:()=>$s,__awaiter:()=>MF,__classPrivateFieldGet:()=>QF,__classPrivateFieldIn:()=>t2,__classPrivateFieldSet:()=>e2,__createBinding:()=>od,__decorate:()=>LF,__disposeResources:()=>n2,__esDecorate:()=>wK,__exportStar:()=>VF,__extends:()=>jF,__generator:()=>UF,__importDefault:()=>ZF,__importStar:()=>XF,__makeTemplateObject:()=>JF,__metadata:()=>qF,__param:()=>BF,__propKey:()=>EK,__read:()=>oD,__rest:()=>NF,__runInitializers:()=>_K,__setFunctionName:()=>CK,__spread:()=>HF,__spreadArray:()=>GF,__spreadArrays:()=>zF,__values:()=>id,default:()=>FK});function jF(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");iD(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}function NF(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}function LF(t,e,r,n){var i=arguments.length,o=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,r,o):s(e,r))||o);return i>3&&o&&Object.defineProperty(e,r,o),o}function BF(t,e){return function(r,n){e(r,n,t)}}function wK(t,e,r,n,i,o){function s(w){if(w!==void 0&&typeof w!="function")throw new TypeError("Function expected");return w}for(var a=n.kind,u=a==="getter"?"get":a==="setter"?"set":"value",c=!e&&t?n.static?t:t.prototype:null,l=e||(c?Object.getOwnPropertyDescriptor(c,n.name):{}),f,h=!1,d=r.length-1;d>=0;d--){var p={};for(var v in n)p[v]=v==="access"?{}:n[v];for(var v in n.access)p.access[v]=n.access[v];p.addInitializer=function(w){if(h)throw new TypeError("Cannot add initializers after decoration has completed");o.push(s(w||null))};var g=(0,r[d])(a==="accessor"?{get:l.get,set:l.set}:l[u],p);if(a==="accessor"){if(g===void 0)continue;if(g===null||typeof g!="object")throw new TypeError("Object expected");(f=s(g.get))&&(l.get=f),(f=s(g.set))&&(l.set=f),(f=s(g.init))&&i.unshift(f)}else(f=s(g))&&(a==="field"?i.unshift(f):l[u]=f)}c&&Object.defineProperty(c,n.name,l),h=!0}function _K(t,e,r){for(var n=arguments.length>2,i=0;i<e.length;i++)r=n?e[i].call(t,r):e[i].call(t);return n?r:void 0}function EK(t){return typeof t=="symbol"?t:"".concat(t)}function CK(t,e,r){return typeof e=="symbol"&&(e=e.description?"[".concat(e.description,"]"):""),Object.defineProperty(t,"name",{configurable:!0,value:r?"".concat(r," ",e):e})}function qF(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function MF(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(l){try{c(n.next(l))}catch(f){s(f)}}function u(l){try{c(n.throw(l))}catch(f){s(f)}}function c(l){l.done?o(l.value):i(l.value).then(a,u)}c((n=n.apply(t,e||[])).next())})}function UF(t,e){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,s=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(c){return function(l){return u([c,l])}}function u(c){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,c[0]&&(r=0)),r;)try{if(n=1,i&&(o=c[0]&2?i.return:c[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,c[1])).done)return o;switch(i=0,o&&(c=[c[0]&2,o.value]),c[0]){case 0:case 1:o=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,i=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]<o[3])){r.label=c[1];break}if(c[0]===6&&r.label<o[1]){r.label=o[1],o=c;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(c);break}o[2]&&r.ops.pop(),r.trys.pop();continue}c=e.call(t,r)}catch(l){c=[6,l],i=0}finally{n=o=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function VF(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&od(e,t,r)}function id(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function oD(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,o=[],s;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(a){s={error:a}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return o}function HF(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(oD(arguments[e]));return t}function zF(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var n=Array(t),i=0,e=0;e<r;e++)for(var o=arguments[e],s=0,a=o.length;s<a;s++,i++)n[i]=o[s];return n}function GF(t,e,r){if(r||arguments.length===2)for(var n=0,i=e.length,o;n<i;n++)(o||!(n in e))&&(o||(o=Array.prototype.slice.call(e,0,n)),o[n]=e[n]);return t.concat(o||Array.prototype.slice.call(e))}function $s(t){return this instanceof $s?(this.v=t,this):new $s(t)}function WF(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(t,e||[]),i,o=[];return i=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),a("next"),a("throw"),a("return",s),i[Symbol.asyncIterator]=function(){return this},i;function s(d){return function(p){return Promise.resolve(p).then(d,f)}}function a(d,p){n[d]&&(i[d]=function(v){return new Promise(function(g,w){o.push([d,v,g,w])>1||u(d,v)})},p&&(i[d]=p(i[d])))}function u(d,p){try{c(n[d](p))}catch(v){h(o[0][3],v)}}function c(d){d.value instanceof $s?Promise.resolve(d.value.v).then(l,f):h(o[0][2],d)}function l(d){u("next",d)}function f(d){u("throw",d)}function h(d,p){d(p),o.shift(),o.length&&u(o[0][0],o[0][1])}}function KF(t){var e,r;return e={},n("next"),n("throw",function(i){throw i}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(i,o){e[i]=t[i]?function(s){return(r=!r)?{value:$s(t[i](s)),done:!1}:o?o(s):s}:o}}function YF(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof id=="function"?id(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(o){r[o]=t[o]&&function(s){return new Promise(function(a,u){s=t[o](s),i(a,u,s.done,s.value)})}}function i(o,s,a,u){Promise.resolve(u).then(function(c){o({value:c,done:a})},s)}}function JF(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function XF(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&od(e,t,r);return SK(e,t),e}function ZF(t){return t&&t.__esModule?t:{default:t}}function QF(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)}function e2(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r}function t2(t,e){if(e===null||typeof e!="object"&&typeof e!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof t=="function"?e===t:t.has(e)}function r2(t,e,r){if(e!=null){if(typeof e!="object"&&typeof e!="function")throw new TypeError("Object expected.");var n,i;if(r){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");n=e[Symbol.asyncDispose]}if(n===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");n=e[Symbol.dispose],r&&(i=n)}if(typeof n!="function")throw new TypeError("Object not disposable.");i&&(n=function(){try{i.call(this)}catch(o){return Promise.reject(o)}}),t.stack.push({value:e,dispose:n,async:r})}else r&&t.stack.push({async:!0});return e}function n2(t){function e(o){t.error=t.hasError?new xK(o,t.error,"An error was suppressed during disposal."):o,t.hasError=!0}var r,n=0;function i(){for(;r=t.stack.pop();)try{if(!r.async&&n===1)return n=0,t.stack.push(r),Promise.resolve().then(i);if(r.dispose){var o=r.dispose.call(r.value);if(r.async)return n|=2,Promise.resolve(o).then(i,function(s){return e(s),i()})}else n|=1}catch(s){e(s)}if(n===1)return t.hasError?Promise.reject(t.error):Promise.resolve();if(t.hasError)throw t.error}return i()}var iD,nd,od,SK,xK,FK,Cn=ut(()=>{iD=function(t,e){return iD=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])},iD(t,e)};nd=function(){return nd=Object.assign||function(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},nd.apply(this,arguments)};od=Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]};SK=Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e};xK=typeof SuppressedError=="function"?SuppressedError:function(t,e,r){var n=new Error(r);return n.name="SuppressedError",n.error=t,n.suppressed=e,n};FK={__extends:jF,__assign:nd,__rest:NF,__decorate:LF,__param:BF,__metadata:qF,__awaiter:MF,__generator:UF,__createBinding:od,__exportStar:VF,__values:id,__read:oD,__spread:HF,__spreadArrays:zF,__spreadArray:GF,__await:$s,__asyncGenerator:WF,__asyncDelegator:KF,__asyncValues:YF,__makeTemplateObject:JF,__importStar:XF,__importDefault:ZF,__classPrivateFieldGet:QF,__classPrivateFieldSet:e2,__classPrivateFieldIn:t2,__addDisposableResource:r2,__disposeResources:n2}});var x2={};mn(x2,{__addDisposableResource:()=>C2,__assign:()=>sd,__asyncDelegator:()=>g2,__asyncGenerator:()=>m2,__asyncValues:()=>y2,__await:()=>Is,__awaiter:()=>c2,__classPrivateFieldGet:()=>w2,__classPrivateFieldIn:()=>E2,__classPrivateFieldSet:()=>_2,__createBinding:()=>ud,__decorate:()=>s2,__disposeResources:()=>S2,__esDecorate:()=>OK,__exportStar:()=>f2,__extends:()=>i2,__generator:()=>l2,__importDefault:()=>b2,__importStar:()=>v2,__makeTemplateObject:()=>D2,__metadata:()=>u2,__param:()=>a2,__propKey:()=>kK,__read:()=>aD,__rest:()=>o2,__runInitializers:()=>AK,__setFunctionName:()=>TK,__spread:()=>d2,__spreadArray:()=>p2,__spreadArrays:()=>h2,__values:()=>ad,default:()=>$K});function i2(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");sD(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}function o2(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}function s2(t,e,r,n){var i=arguments.length,o=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,r,o):s(e,r))||o);return i>3&&o&&Object.defineProperty(e,r,o),o}function a2(t,e){return function(r,n){e(r,n,t)}}function OK(t,e,r,n,i,o){function s(w){if(w!==void 0&&typeof w!="function")throw new TypeError("Function expected");return w}for(var a=n.kind,u=a==="getter"?"get":a==="setter"?"set":"value",c=!e&&t?n.static?t:t.prototype:null,l=e||(c?Object.getOwnPropertyDescriptor(c,n.name):{}),f,h=!1,d=r.length-1;d>=0;d--){var p={};for(var v in n)p[v]=v==="access"?{}:n[v];for(var v in n.access)p.access[v]=n.access[v];p.addInitializer=function(w){if(h)throw new TypeError("Cannot add initializers after decoration has completed");o.push(s(w||null))};var g=(0,r[d])(a==="accessor"?{get:l.get,set:l.set}:l[u],p);if(a==="accessor"){if(g===void 0)continue;if(g===null||typeof g!="object")throw new TypeError("Object expected");(f=s(g.get))&&(l.get=f),(f=s(g.set))&&(l.set=f),(f=s(g.init))&&i.unshift(f)}else(f=s(g))&&(a==="field"?i.unshift(f):l[u]=f)}c&&Object.defineProperty(c,n.name,l),h=!0}function AK(t,e,r){for(var n=arguments.length>2,i=0;i<e.length;i++)r=n?e[i].call(t,r):e[i].call(t);return n?r:void 0}function kK(t){return typeof t=="symbol"?t:"".concat(t)}function TK(t,e,r){return typeof e=="symbol"&&(e=e.description?"[".concat(e.description,"]"):""),Object.defineProperty(t,"name",{configurable:!0,value:r?"".concat(r," ",e):e})}function u2(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function c2(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(l){try{c(n.next(l))}catch(f){s(f)}}function u(l){try{c(n.throw(l))}catch(f){s(f)}}function c(l){l.done?o(l.value):i(l.value).then(a,u)}c((n=n.apply(t,e||[])).next())})}function l2(t,e){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(c){return function(l){return u([c,l])}}function u(c){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,c[0]&&(r=0)),r;)try{if(n=1,i&&(o=c[0]&2?i.return:c[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,c[1])).done)return o;switch(i=0,o&&(c=[c[0]&2,o.value]),c[0]){case 0:case 1:o=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,i=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]<o[3])){r.label=c[1];break}if(c[0]===6&&r.label<o[1]){r.label=o[1],o=c;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(c);break}o[2]&&r.ops.pop(),r.trys.pop();continue}c=e.call(t,r)}catch(l){c=[6,l],i=0}finally{n=o=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function f2(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&ud(e,t,r)}function ad(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function aD(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,o=[],s;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(a){s={error:a}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return o}function d2(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(aD(arguments[e]));return t}function h2(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var n=Array(t),i=0,e=0;e<r;e++)for(var o=arguments[e],s=0,a=o.length;s<a;s++,i++)n[i]=o[s];return n}function p2(t,e,r){if(r||arguments.length===2)for(var n=0,i=e.length,o;n<i;n++)(o||!(n in e))&&(o||(o=Array.prototype.slice.call(e,0,n)),o[n]=e[n]);return t.concat(o||Array.prototype.slice.call(e))}function Is(t){return this instanceof Is?(this.v=t,this):new Is(t)}function m2(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(t,e||[]),i,o=[];return i={},s("next"),s("throw"),s("return"),i[Symbol.asyncIterator]=function(){return this},i;function s(h){n[h]&&(i[h]=function(d){return new Promise(function(p,v){o.push([h,d,p,v])>1||a(h,d)})})}function a(h,d){try{u(n[h](d))}catch(p){f(o[0][3],p)}}function u(h){h.value instanceof Is?Promise.resolve(h.value.v).then(c,l):f(o[0][2],h)}function c(h){a("next",h)}function l(h){a("throw",h)}function f(h,d){h(d),o.shift(),o.length&&a(o[0][0],o[0][1])}}function g2(t){var e,r;return e={},n("next"),n("throw",function(i){throw i}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(i,o){e[i]=t[i]?function(s){return(r=!r)?{value:Is(t[i](s)),done:!1}:o?o(s):s}:o}}function y2(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof ad=="function"?ad(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(o){r[o]=t[o]&&function(s){return new Promise(function(a,u){s=t[o](s),i(a,u,s.done,s.value)})}}function i(o,s,a,u){Promise.resolve(u).then(function(c){o({value:c,done:a})},s)}}function D2(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function v2(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&ud(e,t,r);return PK(e,t),e}function b2(t){return t&&t.__esModule?t:{default:t}}function w2(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)}function _2(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r}function E2(t,e){if(e===null||typeof e!="object"&&typeof e!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof t=="function"?e===t:t.has(e)}function C2(t,e,r){if(e!=null){if(typeof e!="object"&&typeof e!="function")throw new TypeError("Object expected.");var n;if(r){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");n=e[Symbol.asyncDispose]}if(n===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");n=e[Symbol.dispose]}if(typeof n!="function")throw new TypeError("Object not disposable.");t.stack.push({value:e,dispose:n,async:r})}else r&&t.stack.push({async:!0});return e}function S2(t){function e(n){t.error=t.hasError?new RK(n,t.error,"An error was suppressed during disposal."):n,t.hasError=!0}function r(){for(;t.stack.length;){var n=t.stack.pop();try{var i=n.dispose&&n.dispose.call(n.value);if(n.async)return Promise.resolve(i).then(r,function(o){return e(o),r()})}catch(o){e(o)}}if(t.hasError)throw t.error}return r()}var sD,sd,ud,PK,RK,$K,F2=ut(()=>{sD=function(t,e){return sD=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])},sD(t,e)};sd=function(){return sd=Object.assign||function(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},sd.apply(this,arguments)};ud=Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]};PK=Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e};RK=typeof SuppressedError=="function"?SuppressedError:function(t,e,r){var n=new Error(r);return n.name="SuppressedError",n.error=t,n.suppressed=e,n};$K={__extends:i2,__assign:sd,__rest:o2,__decorate:s2,__param:a2,__metadata:u2,__awaiter:c2,__generator:l2,__createBinding:ud,__exportStar:f2,__values:ad,__read:aD,__spread:d2,__spreadArrays:h2,__spreadArray:p2,__await:Is,__asyncGenerator:m2,__asyncDelegator:g2,__asyncValues:y2,__makeTemplateObject:D2,__importStar:v2,__importDefault:b2,__classPrivateFieldGet:w2,__classPrivateFieldSet:_2,__classPrivateFieldIn:E2,__addDisposableResource:C2,__disposeResources:S2}});var Gt=y(uD=>{"use strict";uD.fromCallback=function(t){return Object.defineProperty(function(...e){if(typeof e[e.length-1]=="function")t.apply(this,e);else return new Promise((r,n)=>{e.push((i,o)=>i!=null?n(i):r(o)),t.apply(this,e)})},"name",{value:t.name})};uD.fromPromise=function(t){return Object.defineProperty(function(...e){let r=e[e.length-1];if(typeof r!="function")return t.apply(this,e);e.pop(),t.apply(this,e).then(n=>r(null,n),r)},"name",{value:t.name})}});var Wu=y(si=>{"use strict";var O2=Gt().fromCallback,Pt=dt(),IK=["access","appendFile","chmod","chown","close","copyFile","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","lchmod","lchown","link","lstat","mkdir","mkdtemp","open","opendir","readdir","readFile","readlink","realpath","rename","rm","rmdir","stat","symlink","truncate","unlink","utimes","writeFile"].filter(t=>typeof Pt[t]=="function");Object.keys(Pt).forEach(t=>{t!=="promises"&&(si[t]=Pt[t])});IK.forEach(t=>{si[t]=O2(Pt[t])});si.exists=function(t,e){return typeof e=="function"?Pt.exists(t,e):new Promise(r=>Pt.exists(t,r))};si.read=function(t,e,r,n,i,o){return typeof o=="function"?Pt.read(t,e,r,n,i,o):new Promise((s,a)=>{Pt.read(t,e,r,n,i,(u,c,l)=>{if(u)return a(u);s({bytesRead:c,buffer:l})})})};si.write=function(t,e,...r){return typeof r[r.length-1]=="function"?Pt.write(t,e,...r):new Promise((n,i)=>{Pt.write(t,e,...r,(o,s,a)=>{if(o)return i(o);n({bytesWritten:s,buffer:a})})})};typeof Pt.writev=="function"&&(si.writev=function(t,e,...r){return typeof r[r.length-1]=="function"?Pt.writev(t,e,...r):new Promise((n,i)=>{Pt.writev(t,e,...r,(o,s,a)=>{if(o)return i(o);n({bytesWritten:s,buffers:a})})})});typeof Pt.realpath.native=="function"&&(si.realpath.native=O2(Pt.realpath.native))});var cD=y((ahe,A2)=>{A2.exports=t=>{let e=process.versions.node.split(".").map(r=>parseInt(r,10));return t=t.split(".").map(r=>parseInt(r,10)),e[0]>t[0]||e[0]===t[0]&&(e[1]>t[1]||e[1]===t[1]&&e[2]>=t[2])}});var $2=y((uhe,lD)=>{"use strict";var js=Wu(),Sn=require("path"),jK=cD(),k2=jK("10.12.0"),T2=t=>{if(process.platform==="win32"&&/[<>:"|?*]/.test(t.replace(Sn.parse(t).root,""))){let r=new Error(`Path contains invalid characters: ${t}`);throw r.code="EINVAL",r}},P2=t=>{let e={mode:511};return typeof t=="number"&&(t={mode:t}),{...e,...t}},R2=t=>{let e=new Error(`operation not permitted, mkdir '${t}'`);return e.code="EPERM",e.errno=-4048,e.path=t,e.syscall="mkdir",e};lD.exports.makeDir=async(t,e)=>{if(T2(t),e=P2(e),k2){let n=Sn.resolve(t);return js.mkdir(n,{mode:e.mode,recursive:!0})}let r=async n=>{try{await js.mkdir(n,e.mode)}catch(i){if(i.code==="EPERM")throw i;if(i.code==="ENOENT"){if(Sn.dirname(n)===n)throw R2(n);if(i.message.includes("null bytes"))throw i;return await r(Sn.dirname(n)),r(n)}try{if(!(await js.stat(n)).isDirectory())throw new Error("The path is not a directory")}catch{throw i}}};return r(Sn.resolve(t))};lD.exports.makeDirSync=(t,e)=>{if(T2(t),e=P2(e),k2){let n=Sn.resolve(t);return js.mkdirSync(n,{mode:e.mode,recursive:!0})}let r=n=>{try{js.mkdirSync(n,e.mode)}catch(i){if(i.code==="EPERM")throw i;if(i.code==="ENOENT"){if(Sn.dirname(n)===n)throw R2(n);if(i.message.includes("null bytes"))throw i;return r(Sn.dirname(n)),r(n)}try{if(!js.statSync(n).isDirectory())throw new Error("The path is not a directory")}catch{throw i}}};return r(Sn.resolve(t))}});var kr=y((che,I2)=>{"use strict";var NK=Gt().fromPromise,{makeDir:LK,makeDirSync:fD}=$2(),dD=NK(LK);I2.exports={mkdirs:dD,mkdirsSync:fD,mkdirp:dD,mkdirpSync:fD,ensureDir:dD,ensureDirSync:fD}});var hD=y((lhe,j2)=>{"use strict";var Ns=dt();function BK(t,e,r,n){Ns.open(t,"r+",(i,o)=>{if(i)return n(i);Ns.futimes(o,e,r,s=>{Ns.close(o,a=>{n&&n(s||a)})})})}function qK(t,e,r){let n=Ns.openSync(t,"r+");return Ns.futimesSync(n,e,r),Ns.closeSync(n)}j2.exports={utimesMillis:BK,utimesMillisSync:qK}});var Ku=y((fhe,q2)=>{"use strict";var Ls=Wu(),Wt=require("path"),MK=require("util"),UK=cD(),cd=UK("10.5.0"),N2=t=>cd?Ls.stat(t,{bigint:!0}):Ls.stat(t),pD=t=>cd?Ls.statSync(t,{bigint:!0}):Ls.statSync(t);function VK(t,e){return Promise.all([N2(t),N2(e).catch(r=>{if(r.code==="ENOENT")return null;throw r})]).then(([r,n])=>({srcStat:r,destStat:n}))}function HK(t,e){let r,n=pD(t);try{r=pD(e)}catch(i){if(i.code==="ENOENT")return{srcStat:n,destStat:null};throw i}return{srcStat:n,destStat:r}}function zK(t,e,r,n){MK.callbackify(VK)(t,e,(i,o)=>{if(i)return n(i);let{srcStat:s,destStat:a}=o;return a&&ld(s,a)?n(new Error("Source and destination must not be the same.")):s.isDirectory()&&mD(t,e)?n(new Error(fd(t,e,r))):n(null,{srcStat:s,destStat:a})})}function GK(t,e,r){let{srcStat:n,destStat:i}=HK(t,e);if(i&&ld(n,i))throw new Error("Source and destination must not be the same.");if(n.isDirectory()&&mD(t,e))throw new Error(fd(t,e,r));return{srcStat:n,destStat:i}}function L2(t,e,r,n,i){let o=Wt.resolve(Wt.dirname(t)),s=Wt.resolve(Wt.dirname(r));if(s===o||s===Wt.parse(s).root)return i();let a=(u,c)=>u?u.code==="ENOENT"?i():i(u):ld(e,c)?i(new Error(fd(t,r,n))):L2(t,e,s,n,i);cd?Ls.stat(s,{bigint:!0},a):Ls.stat(s,a)}function B2(t,e,r,n){let i=Wt.resolve(Wt.dirname(t)),o=Wt.resolve(Wt.dirname(r));if(o===i||o===Wt.parse(o).root)return;let s;try{s=pD(o)}catch(a){if(a.code==="ENOENT")return;throw a}if(ld(e,s))throw new Error(fd(t,r,n));return B2(t,e,o,n)}function ld(t,e){return!!(e.ino&&e.dev&&e.ino===t.ino&&e.dev===t.dev&&(cd||e.ino<Number.MAX_SAFE_INTEGER||e.size===t.size&&e.mode===t.mode&&e.nlink===t.nlink&&e.atimeMs===t.atimeMs&&e.mtimeMs===t.mtimeMs&&e.ctimeMs===t.ctimeMs&&e.birthtimeMs===t.birthtimeMs))}function mD(t,e){let r=Wt.resolve(t).split(Wt.sep).filter(i=>i),n=Wt.resolve(e).split(Wt.sep).filter(i=>i);return r.reduce((i,o,s)=>i&&n[s]===o,!0)}function fd(t,e,r){return`Cannot ${r} '${t}' to a subdirectory of itself, '${e}'.`}q2.exports={checkPaths:zK,checkPathsSync:GK,checkParentPaths:L2,checkParentPathsSync:B2,isSrcSubdir:mD}});var z2=y((dhe,H2)=>{"use strict";var Ct=dt(),Yu=require("path"),WK=kr().mkdirsSync,KK=hD().utimesMillisSync,Ju=Ku();function YK(t,e,r){typeof r=="function"&&(r={filter:r}),r=r||{},r.clobber="clobber"in r?!!r.clobber:!0,r.overwrite="overwrite"in r?!!r.overwrite:r.clobber,r.preserveTimestamps&&process.arch==="ia32"&&console.warn(`fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;
41
41
 
42
42
  see https://github.com/jprichardson/node-fs-extra/issues/269`);let{srcStat:n,destStat:i}=Ju.checkPathsSync(t,e,"copy");return Ju.checkParentPathsSync(t,n,e,"copy"),JK(i,t,e,r)}function JK(t,e,r,n){if(n.filter&&!n.filter(e,r))return;let i=Yu.dirname(r);return Ct.existsSync(i)||WK(i),M2(t,e,r,n)}function M2(t,e,r,n){if(!(n.filter&&!n.filter(e,r)))return XK(t,e,r,n)}function XK(t,e,r,n){let o=(n.dereference?Ct.statSync:Ct.lstatSync)(e);if(o.isDirectory())return iY(o,t,e,r,n);if(o.isFile()||o.isCharacterDevice()||o.isBlockDevice())return ZK(o,t,e,r,n);if(o.isSymbolicLink())return aY(t,e,r,n)}function ZK(t,e,r,n,i){return e?QK(t,r,n,i):U2(t,r,n,i)}function QK(t,e,r,n){if(n.overwrite)return Ct.unlinkSync(r),U2(t,e,r,n);if(n.errorOnExist)throw new Error(`'${r}' already exists`)}function U2(t,e,r,n){return Ct.copyFileSync(e,r),n.preserveTimestamps&&eY(t.mode,e,r),gD(r,t.mode)}function eY(t,e,r){return tY(t)&&rY(r,t),nY(e,r)}function tY(t){return(t&128)===0}function rY(t,e){return gD(t,e|128)}function gD(t,e){return Ct.chmodSync(t,e)}function nY(t,e){let r=Ct.statSync(t);return KK(e,r.atime,r.mtime)}function iY(t,e,r,n,i){if(!e)return oY(t.mode,r,n,i);if(e&&!e.isDirectory())throw new Error(`Cannot overwrite non-directory '${n}' with directory '${r}'.`);return V2(r,n,i)}function oY(t,e,r,n){return Ct.mkdirSync(r),V2(e,r,n),gD(r,t)}function V2(t,e,r){Ct.readdirSync(t).forEach(n=>sY(n,t,e,r))}function sY(t,e,r,n){let i=Yu.join(e,t),o=Yu.join(r,t),{destStat:s}=Ju.checkPathsSync(i,o,"copy");return M2(s,i,o,n)}function aY(t,e,r,n){let i=Ct.readlinkSync(e);if(n.dereference&&(i=Yu.resolve(process.cwd(),i)),t){let o;try{o=Ct.readlinkSync(r)}catch(s){if(s.code==="EINVAL"||s.code==="UNKNOWN")return Ct.symlinkSync(i,r);throw s}if(n.dereference&&(o=Yu.resolve(process.cwd(),o)),Ju.isSrcSubdir(i,o))throw new Error(`Cannot copy '${i}' to a subdirectory of itself, '${o}'.`);if(Ct.statSync(r).isDirectory()&&Ju.isSrcSubdir(o,i))throw new Error(`Cannot overwrite '${o}' with '${i}'.`);return uY(i,r)}else return Ct.symlinkSync(i,r)}function uY(t,e){return Ct.unlinkSync(e),Ct.symlinkSync(t,e)}H2.exports=YK});var yD=y((hhe,G2)=>{"use strict";G2.exports={copySync:z2()}});var ai=y((phe,K2)=>{"use strict";var cY=Gt().fromPromise,W2=Wu();function lY(t){return W2.access(t).then(()=>!0).catch(()=>!1)}K2.exports={pathExists:cY(lY),pathExistsSync:W2.existsSync}});var nO=y((mhe,rO)=>{"use strict";var Kt=dt(),Xu=require("path"),fY=kr().mkdirs,dY=ai().pathExists,hY=hD().utimesMillis,Zu=Ku();function pY(t,e,r,n){typeof r=="function"&&!n?(n=r,r={}):typeof r=="function"&&(r={filter:r}),n=n||function(){},r=r||{},r.clobber="clobber"in r?!!r.clobber:!0,r.overwrite="overwrite"in r?!!r.overwrite:r.clobber,r.preserveTimestamps&&process.arch==="ia32"&&console.warn(`fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;
43
43
 
44
- see https://github.com/jprichardson/node-fs-extra/issues/269`),Zu.checkPaths(t,e,"copy",(i,o)=>{if(i)return n(i);let{srcStat:s,destStat:a}=o;Zu.checkParentPaths(t,s,e,"copy",u=>u?n(u):r.filter?Z2(Y2,a,t,e,r,n):Y2(a,t,e,r,n))})}function Y2(t,e,r,n,i){let o=Xu.dirname(r);dY(o,(s,a)=>{if(s)return i(s);if(a)return DD(t,e,r,n,i);fY(o,u=>u?i(u):DD(t,e,r,n,i))})}function Z2(t,e,r,n,i,o){Promise.resolve(i.filter(r,n)).then(s=>s?t(e,r,n,i,o):o(),s=>o(s))}function DD(t,e,r,n,i){return n.filter?Z2(J2,t,e,r,n,i):J2(t,e,r,n,i)}function J2(t,e,r,n,i){(n.dereference?Kt.stat:Kt.lstat)(e,(s,a)=>{if(s)return i(s);if(a.isDirectory())return wY(a,t,e,r,n,i);if(a.isFile()||a.isCharacterDevice()||a.isBlockDevice())return mY(a,t,e,r,n,i);if(a.isSymbolicLink())return CY(t,e,r,n,i)})}function mY(t,e,r,n,i,o){return e?gY(t,r,n,i,o):Q2(t,r,n,i,o)}function gY(t,e,r,n,i){if(n.overwrite)Kt.unlink(r,o=>o?i(o):Q2(t,e,r,n,i));else return n.errorOnExist?i(new Error(`'${r}' already exists`)):i()}function Q2(t,e,r,n,i){Kt.copyFile(e,r,o=>o?i(o):n.preserveTimestamps?yY(t.mode,e,r,i):pd(r,t.mode,i))}function yY(t,e,r,n){return DY(t)?vY(r,t,i=>i?n(i):X2(t,e,r,n)):X2(t,e,r,n)}function DY(t){return(t&128)===0}function vY(t,e,r){return pd(t,e|128,r)}function X2(t,e,r,n){bY(e,r,i=>i?n(i):pd(r,t,n))}function pd(t,e,r){return Kt.chmod(t,e,r)}function bY(t,e,r){Kt.stat(t,(n,i)=>n?r(n):hY(e,i.atime,i.mtime,r))}function wY(t,e,r,n,i,o){return e?e&&!e.isDirectory()?o(new Error(`Cannot overwrite non-directory '${n}' with directory '${r}'.`)):eO(r,n,i,o):_Y(t.mode,r,n,i,o)}function _Y(t,e,r,n,i){Kt.mkdir(r,o=>{if(o)return i(o);eO(e,r,n,s=>s?i(s):pd(r,t,i))})}function eO(t,e,r,n){Kt.readdir(t,(i,o)=>i?n(i):tO(o,t,e,r,n))}function tO(t,e,r,n,i){let o=t.pop();return o?EY(t,o,e,r,n,i):i()}function EY(t,e,r,n,i,o){let s=Xu.join(r,e),a=Xu.join(n,e);Zu.checkPaths(s,a,"copy",(u,c)=>{if(u)return o(u);let{destStat:l}=c;DD(l,s,a,i,f=>f?o(f):tO(t,r,n,i,o))})}function CY(t,e,r,n,i){Kt.readlink(e,(o,s)=>{if(o)return i(o);if(n.dereference&&(s=Xu.resolve(process.cwd(),s)),t)Kt.readlink(r,(a,u)=>a?a.code==="EINVAL"||a.code==="UNKNOWN"?Kt.symlink(s,r,i):i(a):(n.dereference&&(u=Xu.resolve(process.cwd(),u)),Zu.isSrcSubdir(s,u)?i(new Error(`Cannot copy '${s}' to a subdirectory of itself, '${u}'.`)):t.isDirectory()&&Zu.isSrcSubdir(u,s)?i(new Error(`Cannot overwrite '${u}' with '${s}'.`)):SY(s,r,i)));else return Kt.symlink(s,r,i)})}function SY(t,e,r){Kt.unlink(e,n=>n?r(n):Kt.symlink(t,e,r))}rO.exports=pY});var vD=y((ghe,iO)=>{"use strict";var xY=Gt().fromCallback;iO.exports={copy:xY(nO())}});var hO=y((yhe,dO)=>{"use strict";var oO=dt(),cO=require("path"),xe=require("assert"),Qu=process.platform==="win32";function lO(t){["unlink","chmod","stat","lstat","rmdir","readdir"].forEach(r=>{t[r]=t[r]||oO[r],r=r+"Sync",t[r]=t[r]||oO[r]}),t.maxBusyTries=t.maxBusyTries||3}function bD(t,e,r){let n=0;typeof e=="function"&&(r=e,e={}),xe(t,"rimraf: missing path"),xe.strictEqual(typeof t,"string","rimraf: path should be a string"),xe.strictEqual(typeof r,"function","rimraf: callback function required"),xe(e,"rimraf: invalid options argument provided"),xe.strictEqual(typeof e,"object","rimraf: options should be object"),lO(e),sO(t,e,function i(o){if(o){if((o.code==="EBUSY"||o.code==="ENOTEMPTY"||o.code==="EPERM")&&n<e.maxBusyTries){n++;let s=n*100;return setTimeout(()=>sO(t,e,i),s)}o.code==="ENOENT"&&(o=null)}r(o)})}function sO(t,e,r){xe(t),xe(e),xe(typeof r=="function"),e.lstat(t,(n,i)=>{if(n&&n.code==="ENOENT")return r(null);if(n&&n.code==="EPERM"&&Qu)return aO(t,e,n,r);if(i&&i.isDirectory())return md(t,e,n,r);e.unlink(t,o=>{if(o){if(o.code==="ENOENT")return r(null);if(o.code==="EPERM")return Qu?aO(t,e,o,r):md(t,e,o,r);if(o.code==="EISDIR")return md(t,e,o,r)}return r(o)})})}function aO(t,e,r,n){xe(t),xe(e),xe(typeof n=="function"),e.chmod(t,438,i=>{i?n(i.code==="ENOENT"?null:r):e.stat(t,(o,s)=>{o?n(o.code==="ENOENT"?null:r):s.isDirectory()?md(t,e,r,n):e.unlink(t,n)})})}function uO(t,e,r){let n;xe(t),xe(e);try{e.chmodSync(t,438)}catch(i){if(i.code==="ENOENT")return;throw r}try{n=e.statSync(t)}catch(i){if(i.code==="ENOENT")return;throw r}n.isDirectory()?gd(t,e,r):e.unlinkSync(t)}function md(t,e,r,n){xe(t),xe(e),xe(typeof n=="function"),e.rmdir(t,i=>{i&&(i.code==="ENOTEMPTY"||i.code==="EEXIST"||i.code==="EPERM")?FY(t,e,n):i&&i.code==="ENOTDIR"?n(r):n(i)})}function FY(t,e,r){xe(t),xe(e),xe(typeof r=="function"),e.readdir(t,(n,i)=>{if(n)return r(n);let o=i.length,s;if(o===0)return e.rmdir(t,r);i.forEach(a=>{bD(cO.join(t,a),e,u=>{if(!s){if(u)return r(s=u);--o===0&&e.rmdir(t,r)}})})})}function fO(t,e){let r;e=e||{},lO(e),xe(t,"rimraf: missing path"),xe.strictEqual(typeof t,"string","rimraf: path should be a string"),xe(e,"rimraf: missing options"),xe.strictEqual(typeof e,"object","rimraf: options should be object");try{r=e.lstatSync(t)}catch(n){if(n.code==="ENOENT")return;n.code==="EPERM"&&Qu&&uO(t,e,n)}try{r&&r.isDirectory()?gd(t,e,null):e.unlinkSync(t)}catch(n){if(n.code==="ENOENT")return;if(n.code==="EPERM")return Qu?uO(t,e,n):gd(t,e,n);if(n.code!=="EISDIR")throw n;gd(t,e,n)}}function gd(t,e,r){xe(t),xe(e);try{e.rmdirSync(t)}catch(n){if(n.code==="ENOTDIR")throw r;if(n.code==="ENOTEMPTY"||n.code==="EEXIST"||n.code==="EPERM")OY(t,e);else if(n.code!=="ENOENT")throw n}}function OY(t,e){if(xe(t),xe(e),e.readdirSync(t).forEach(r=>fO(cO.join(t,r),e)),Qu){let r=Date.now();do try{return e.rmdirSync(t,e)}catch{}while(Date.now()-r<500)}else return e.rmdirSync(t,e)}dO.exports=bD;bD.sync=fO});var ec=y((Dhe,mO)=>{"use strict";var AY=Gt().fromCallback,pO=hO();mO.exports={remove:AY(pO),removeSync:pO.sync}});var EO=y((vhe,_O)=>{"use strict";var kY=Gt().fromCallback,DO=dt(),vO=require("path"),bO=kr(),wO=ec(),gO=kY(function(e,r){r=r||function(){},DO.readdir(e,(n,i)=>{if(n)return bO.mkdirs(e,r);i=i.map(s=>vO.join(e,s)),o();function o(){let s=i.pop();if(!s)return r();wO.remove(s,a=>{if(a)return r(a);o()})}})});function yO(t){let e;try{e=DO.readdirSync(t)}catch{return bO.mkdirsSync(t)}e.forEach(r=>{r=vO.join(t,r),wO.removeSync(r)})}_O.exports={emptyDirSync:yO,emptydirSync:yO,emptyDir:gO,emptydir:gO}});var FO=y((bhe,xO)=>{"use strict";var TY=Gt().fromCallback,CO=require("path"),ui=dt(),SO=kr();function PY(t,e){function r(){ui.writeFile(t,"",n=>{if(n)return e(n);e()})}ui.stat(t,(n,i)=>{if(!n&&i.isFile())return e();let o=CO.dirname(t);ui.stat(o,(s,a)=>{if(s)return s.code==="ENOENT"?SO.mkdirs(o,u=>{if(u)return e(u);r()}):e(s);a.isDirectory()?r():ui.readdir(o,u=>{if(u)return e(u)})})})}function RY(t){let e;try{e=ui.statSync(t)}catch{}if(e&&e.isFile())return;let r=CO.dirname(t);try{ui.statSync(r).isDirectory()||ui.readdirSync(r)}catch(n){if(n&&n.code==="ENOENT")SO.mkdirsSync(r);else throw n}ui.writeFileSync(t,"")}xO.exports={createFile:TY(PY),createFileSync:RY}});var PO=y((whe,TO)=>{"use strict";var $Y=Gt().fromCallback,AO=require("path"),uo=dt(),kO=kr(),OO=ai().pathExists;function IY(t,e,r){function n(i,o){uo.link(i,o,s=>{if(s)return r(s);r(null)})}OO(e,(i,o)=>{if(i)return r(i);if(o)return r(null);uo.lstat(t,s=>{if(s)return s.message=s.message.replace("lstat","ensureLink"),r(s);let a=AO.dirname(e);OO(a,(u,c)=>{if(u)return r(u);if(c)return n(t,e);kO.mkdirs(a,l=>{if(l)return r(l);n(t,e)})})})})}function jY(t,e){if(uo.existsSync(e))return;try{uo.lstatSync(t)}catch(o){throw o.message=o.message.replace("lstat","ensureLink"),o}let n=AO.dirname(e);return uo.existsSync(n)||kO.mkdirsSync(n),uo.linkSync(t,e)}TO.exports={createLink:$Y(IY),createLinkSync:jY}});var $O=y((_he,RO)=>{"use strict";var ci=require("path"),tc=dt(),NY=ai().pathExists;function LY(t,e,r){if(ci.isAbsolute(t))return tc.lstat(t,n=>n?(n.message=n.message.replace("lstat","ensureSymlink"),r(n)):r(null,{toCwd:t,toDst:t}));{let n=ci.dirname(e),i=ci.join(n,t);return NY(i,(o,s)=>o?r(o):s?r(null,{toCwd:i,toDst:t}):tc.lstat(t,a=>a?(a.message=a.message.replace("lstat","ensureSymlink"),r(a)):r(null,{toCwd:t,toDst:ci.relative(n,t)})))}}function BY(t,e){let r;if(ci.isAbsolute(t)){if(r=tc.existsSync(t),!r)throw new Error("absolute srcpath does not exist");return{toCwd:t,toDst:t}}else{let n=ci.dirname(e),i=ci.join(n,t);if(r=tc.existsSync(i),r)return{toCwd:i,toDst:t};if(r=tc.existsSync(t),!r)throw new Error("relative srcpath does not exist");return{toCwd:t,toDst:ci.relative(n,t)}}}RO.exports={symlinkPaths:LY,symlinkPathsSync:BY}});var NO=y((Ehe,jO)=>{"use strict";var IO=dt();function qY(t,e,r){if(r=typeof e=="function"?e:r,e=typeof e=="function"?!1:e,e)return r(null,e);IO.lstat(t,(n,i)=>{if(n)return r(null,"file");e=i&&i.isDirectory()?"dir":"file",r(null,e)})}function MY(t,e){let r;if(e)return e;try{r=IO.lstatSync(t)}catch{return"file"}return r&&r.isDirectory()?"dir":"file"}jO.exports={symlinkType:qY,symlinkTypeSync:MY}});var HO=y((Che,VO)=>{"use strict";var UY=Gt().fromCallback,BO=require("path"),Bs=dt(),qO=kr(),VY=qO.mkdirs,HY=qO.mkdirsSync,MO=$O(),zY=MO.symlinkPaths,GY=MO.symlinkPathsSync,UO=NO(),WY=UO.symlinkType,KY=UO.symlinkTypeSync,LO=ai().pathExists;function YY(t,e,r,n){n=typeof r=="function"?r:n,r=typeof r=="function"?!1:r,LO(e,(i,o)=>{if(i)return n(i);if(o)return n(null);zY(t,e,(s,a)=>{if(s)return n(s);t=a.toDst,WY(a.toCwd,r,(u,c)=>{if(u)return n(u);let l=BO.dirname(e);LO(l,(f,h)=>{if(f)return n(f);if(h)return Bs.symlink(t,e,c,n);VY(l,d=>{if(d)return n(d);Bs.symlink(t,e,c,n)})})})})})}function JY(t,e,r){if(Bs.existsSync(e))return;let i=GY(t,e);t=i.toDst,r=KY(i.toCwd,r);let o=BO.dirname(e);return Bs.existsSync(o)||HY(o),Bs.symlinkSync(t,e,r)}VO.exports={createSymlink:UY(YY),createSymlinkSync:JY}});var GO=y((She,zO)=>{"use strict";var yd=FO(),Dd=PO(),vd=HO();zO.exports={createFile:yd.createFile,createFileSync:yd.createFileSync,ensureFile:yd.createFile,ensureFileSync:yd.createFileSync,createLink:Dd.createLink,createLinkSync:Dd.createLinkSync,ensureLink:Dd.createLink,ensureLinkSync:Dd.createLinkSync,createSymlink:vd.createSymlink,createSymlinkSync:vd.createSymlinkSync,ensureSymlink:vd.createSymlink,ensureSymlinkSync:vd.createSymlinkSync}});var bd=y((xhe,WO)=>{function XY(t,{EOL:e=`
45
- `,finalEOL:r=!0,replacer:n=null,spaces:i}={}){let o=r?e:"";return JSON.stringify(t,n,i).replace(/\n/g,e)+o}function ZY(t){return Buffer.isBuffer(t)&&(t=t.toString("utf8")),t.replace(/^\uFEFF/,"")}WO.exports={stringify:XY,stripBom:ZY}});var XO=y((Fhe,JO)=>{var qs;try{qs=dt()}catch{qs=require("fs")}var wd=Gt(),{stringify:KO,stripBom:YO}=bd();async function QY(t,e={}){typeof e=="string"&&(e={encoding:e});let r=e.fs||qs,n="throws"in e?e.throws:!0,i=await wd.fromCallback(r.readFile)(t,e);i=YO(i);let o;try{o=JSON.parse(i,e?e.reviver:null)}catch(s){if(n)throw s.message=`${t}: ${s.message}`,s;return null}return o}var eJ=wd.fromPromise(QY);function tJ(t,e={}){typeof e=="string"&&(e={encoding:e});let r=e.fs||qs,n="throws"in e?e.throws:!0;try{let i=r.readFileSync(t,e);return i=YO(i),JSON.parse(i,e.reviver)}catch(i){if(n)throw i.message=`${t}: ${i.message}`,i;return null}}async function rJ(t,e,r={}){let n=r.fs||qs,i=KO(e,r);await wd.fromCallback(n.writeFile)(t,i,r)}var nJ=wd.fromPromise(rJ);function iJ(t,e,r={}){let n=r.fs||qs,i=KO(e,r);return n.writeFileSync(t,i,r)}var oJ={readFile:eJ,readFileSync:tJ,writeFile:nJ,writeFileSync:iJ};JO.exports=oJ});var QO=y((Ohe,ZO)=>{"use strict";var _d=XO();ZO.exports={readJson:_d.readFile,readJsonSync:_d.readFileSync,writeJson:_d.writeFile,writeJsonSync:_d.writeFileSync}});var Ed=y((Ahe,rA)=>{"use strict";var sJ=Gt().fromCallback,rc=dt(),eA=require("path"),tA=kr(),aJ=ai().pathExists;function uJ(t,e,r,n){typeof r=="function"&&(n=r,r="utf8");let i=eA.dirname(t);aJ(i,(o,s)=>{if(o)return n(o);if(s)return rc.writeFile(t,e,r,n);tA.mkdirs(i,a=>{if(a)return n(a);rc.writeFile(t,e,r,n)})})}function cJ(t,...e){let r=eA.dirname(t);if(rc.existsSync(r))return rc.writeFileSync(t,...e);tA.mkdirsSync(r),rc.writeFileSync(t,...e)}rA.exports={outputFile:sJ(uJ),outputFileSync:cJ}});var iA=y((khe,nA)=>{"use strict";var{stringify:lJ}=bd(),{outputFile:fJ}=Ed();async function dJ(t,e,r={}){let n=lJ(e,r);await fJ(t,n,r)}nA.exports=dJ});var sA=y((The,oA)=>{"use strict";var{stringify:hJ}=bd(),{outputFileSync:pJ}=Ed();function mJ(t,e,r){let n=hJ(e,r);pJ(t,n,r)}oA.exports=mJ});var uA=y((Phe,aA)=>{"use strict";var gJ=Gt().fromPromise,Rt=QO();Rt.outputJson=gJ(iA());Rt.outputJsonSync=sA();Rt.outputJSON=Rt.outputJson;Rt.outputJSONSync=Rt.outputJsonSync;Rt.writeJSON=Rt.writeJson;Rt.writeJSONSync=Rt.writeJsonSync;Rt.readJSON=Rt.readJson;Rt.readJSONSync=Rt.readJsonSync;aA.exports=Rt});var pA=y((Rhe,hA)=>{"use strict";var fA=dt(),yJ=require("path"),DJ=yD().copySync,dA=ec().removeSync,vJ=kr().mkdirpSync,cA=Ku();function bJ(t,e,r){r=r||{};let n=r.overwrite||r.clobber||!1,{srcStat:i}=cA.checkPathsSync(t,e,"move");return cA.checkParentPathsSync(t,i,e,"move"),vJ(yJ.dirname(e)),wJ(t,e,n)}function wJ(t,e,r){if(r)return dA(e),lA(t,e,r);if(fA.existsSync(e))throw new Error("dest already exists.");return lA(t,e,r)}function lA(t,e,r){try{fA.renameSync(t,e)}catch(n){if(n.code!=="EXDEV")throw n;return _J(t,e,r)}}function _J(t,e,r){return DJ(t,e,{overwrite:r,errorOnExist:!0}),dA(t)}hA.exports=bJ});var gA=y(($he,mA)=>{"use strict";mA.exports={moveSync:pA()}});var wA=y((Ihe,bA)=>{"use strict";var EJ=dt(),CJ=require("path"),SJ=vD().copy,vA=ec().remove,xJ=kr().mkdirp,FJ=ai().pathExists,yA=Ku();function OJ(t,e,r,n){typeof r=="function"&&(n=r,r={});let i=r.overwrite||r.clobber||!1;yA.checkPaths(t,e,"move",(o,s)=>{if(o)return n(o);let{srcStat:a}=s;yA.checkParentPaths(t,a,e,"move",u=>{if(u)return n(u);xJ(CJ.dirname(e),c=>c?n(c):AJ(t,e,i,n))})})}function AJ(t,e,r,n){if(r)return vA(e,i=>i?n(i):DA(t,e,r,n));FJ(e,(i,o)=>i?n(i):o?n(new Error("dest already exists.")):DA(t,e,r,n))}function DA(t,e,r,n){EJ.rename(t,e,i=>i?i.code!=="EXDEV"?n(i):kJ(t,e,r,n):n())}function kJ(t,e,r,n){SJ(t,e,{overwrite:r,errorOnExist:!0},o=>o?n(o):vA(t,n))}bA.exports=OJ});var EA=y((jhe,_A)=>{"use strict";var TJ=Gt().fromCallback;_A.exports={move:TJ(wA())}});var Cd=y((Nhe,wD)=>{"use strict";wD.exports={...Wu(),...yD(),...vD(),...EO(),...GO(),...uA(),...kr(),...gA(),...EA(),...Ed(),...ai(),...ec()};var CA=require("fs");Object.getOwnPropertyDescriptor(CA,"promises")&&Object.defineProperty(wD.exports,"promises",{get(){return CA.promises}})});var _D=y(Ms=>{"use strict";Object.defineProperty(Ms,"__esModule",{value:!0});Ms.readdir=Ms.stat=void 0;var SA=Cd();async function PJ(t){try{return await SA.stat(t)}catch{}}Ms.stat=PJ;async function RJ(t){try{return await SA.readdir(t)}catch{return[]}}Ms.readdir=RJ});var Us=y(re=>{"use strict";Object.defineProperty(re,"__esModule",{value:!0});re.walk=re.Walker=re.compilePaths=re.tmpfilepath=re.findBaseDirectory=re.isExecutableFile=re.pathExecutable=re.pathWritable=re.pathReadable=re.pathExists=re.pathAccessible=re.writeStreamToFile=re.cacheFileChecksum=re.getFileChecksums=re.getFileChecksum=re.fileToString=re.getFileTree=re.readdirp=re.readdirSafe=re.statSafe=void 0;var $J=(F2(),ke(x2)),vr=Cd(),IJ=require("os"),xn=require("path"),xA=require("stream"),FA=_D();$J.__exportStar(Cd(),re);var OA=_D();Object.defineProperty(re,"statSafe",{enumerable:!0,get:function(){return OA.stat}});Object.defineProperty(re,"readdirSafe",{enumerable:!0,get:function(){return OA.readdir}});async function jJ(t,{filter:e,onError:r,walkerOptions:n}={}){return new Promise((i,o)=>{let s=[],a=CD(t,n);e&&(a=a.pipe(new xA.Transform({objectMode:!0,transform(u,c,l){(!e||e(u))&&this.push(u),l()}}))),a.on("error",u=>r?r(u):o(u)).on("data",u=>s.push(u.path)).on("end",()=>i(s))})}re.readdirp=jJ;async function NJ(t,{onError:e,onFileNode:r=o=>o,onDirectoryNode:n=o=>o,walkerOptions:i}={}){let o=new Map([]),s=u=>{let c=xn.dirname(u.path),l=o.get(c);return l&&l.type==="directory"?l:n({path:c,type:"directory",children:[]})},a=(u,c)=>{let l={path:u.path,parent:c};return u.stats.isDirectory()?n({...l,type:"directory",children:[]}):r({...l,type:"file"})};return new Promise((u,c)=>{t=xn.resolve(t),CD(t,i).on("error",f=>e?e(f):c(f)).on("data",f=>{let h=s(f),d=a(f,h);h.children.push(d),o.set(f.path,d),o.set(h.path,h)}).on("end",()=>{let f=o.get(t);if(!f)return c(new Error("No root node found after walking directory structure."));delete f.parent,u(f)})})}re.getFileTree=NJ;async function LJ(t){try{return await vr.readFile(t,{encoding:"utf8"})}catch(e){if(e.code==="ENOENT"||e.code==="ENOTDIR")return"";throw e}}re.fileToString=LJ;async function ED(t){let e=await Promise.resolve().then(()=>require("crypto"));return new Promise((r,n)=>{let i=e.createHash("md5"),o=vr.createReadStream(t);o.on("error",s=>{n(s)}),i.once("readable",()=>{let s=i.read().toString("hex");r(s)}),o.pipe(i)})}re.getFileChecksum=ED;async function BJ(t){return Promise.all([ED(t),(async()=>{try{return(await vr.readFile(`${t}.md5`,{encoding:"utf8"})).trim()}catch(e){if(e.code!=="ENOENT")throw e}})()])}re.getFileChecksums=BJ;async function qJ(t,e){let r=await ED(t);await vr.writeFile(`${t}.md5`,r,{encoding:"utf8"})}re.cacheFileChecksum=qJ;function MJ(t,e){return new Promise((r,n)=>{let i=vr.createWriteStream(e);t.pipe(i),i.on("error",n),i.on("finish",r)})}re.writeStreamToFile=MJ;async function nc(t,e){try{await vr.access(t,e)}catch{return!1}return!0}re.pathAccessible=nc;async function UJ(t){return nc(t,vr.constants.F_OK)}re.pathExists=UJ;async function VJ(t){return nc(t,vr.constants.R_OK)}re.pathReadable=VJ;async function HJ(t){return nc(t,vr.constants.W_OK)}re.pathWritable=HJ;async function AA(t){return nc(t,vr.constants.X_OK)}re.pathExecutable=AA;async function zJ(t){let[e,r]=await Promise.all([FA.stat(t),AA(t)]);return!!e&&(e.isFile()||e.isSymbolicLink())&&r}re.isExecutableFile=zJ;async function GJ(t,e){if(!(!t||!e)){for(let r of kA(t))if((await FA.readdir(r)).includes(e))return r}}re.findBaseDirectory=GJ;function WJ(t){let e=Math.random().toString(16).substring(2,8);return xn.resolve(IJ.tmpdir(),t?`${t}-${e}`:e)}re.tmpfilepath=WJ;function kA(t){if(t=xn.normalize(t),!xn.isAbsolute(t))throw new Error(`${t} is not an absolute path`);let e=xn.parse(t);return t===e.root?[t]:t.slice(e.root.length).split(xn.sep).map((r,n,i)=>e.root+xn.join(...i.slice(0,i.length-n))).concat(e.root)}re.compilePaths=kA;var Sd=class extends xA.Readable{constructor(e,r={}){super({objectMode:!0}),this.p=e,this.options=r,this.paths=[this.p]}_read(){let e=this.paths.shift(),{pathFilter:r}=this.options;if(!e){this.push(null);return}vr.lstat(e,(n,i)=>{if(n){this.emit("error",n);return}let o={path:e,stats:i};i.isDirectory()?vr.readdir(e,(s,a)=>{if(s){this.emit("error",s);return}let u=a.map(c=>xn.join(e,c));r&&(u=u.filter(c=>r(c.substring(this.p.length+1)))),this.paths.push(...u),this.push(o)}):this.push(o)})}};re.Walker=Sd;function CD(t,e={}){return new Sd(t,e)}re.walk=CD});var SD=y((qhe,TA)=>{var Vs=1e3,Hs=Vs*60,zs=Hs*60,co=zs*24,KJ=co*7,YJ=co*365.25;TA.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return JJ(t);if(r==="number"&&isFinite(t))return e.long?ZJ(t):XJ(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function JJ(t){if(t=String(t),!(t.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(e){var r=parseFloat(e[1]),n=(e[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return r*YJ;case"weeks":case"week":case"w":return r*KJ;case"days":case"day":case"d":return r*co;case"hours":case"hour":case"hrs":case"hr":case"h":return r*zs;case"minutes":case"minute":case"mins":case"min":case"m":return r*Hs;case"seconds":case"second":case"secs":case"sec":case"s":return r*Vs;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}function XJ(t){var e=Math.abs(t);return e>=co?Math.round(t/co)+"d":e>=zs?Math.round(t/zs)+"h":e>=Hs?Math.round(t/Hs)+"m":e>=Vs?Math.round(t/Vs)+"s":t+"ms"}function ZJ(t){var e=Math.abs(t);return e>=co?xd(t,e,co,"day"):e>=zs?xd(t,e,zs,"hour"):e>=Hs?xd(t,e,Hs,"minute"):e>=Vs?xd(t,e,Vs,"second"):t+" ms"}function xd(t,e,r,n){var i=e>=r*1.5;return Math.round(t/r)+" "+n+(i?"s":"")}});var xD=y((Mhe,PA)=>{function QJ(t){r.debug=r,r.default=r,r.coerce=u,r.disable=o,r.enable=i,r.enabled=s,r.humanize=SD(),r.destroy=c,Object.keys(t).forEach(l=>{r[l]=t[l]}),r.names=[],r.skips=[],r.formatters={};function e(l){let f=0;for(let h=0;h<l.length;h++)f=(f<<5)-f+l.charCodeAt(h),f|=0;return r.colors[Math.abs(f)%r.colors.length]}r.selectColor=e;function r(l){let f,h=null,d,p;function v(...g){if(!v.enabled)return;let w=v,x=Number(new Date),D=x-(f||x);w.diff=D,w.prev=f,w.curr=x,f=x,g[0]=r.coerce(g[0]),typeof g[0]!="string"&&g.unshift("%O");let C=0;g[0]=g[0].replace(/%([a-zA-Z%])/g,($,F)=>{if($==="%%")return"%";C++;let L=r.formatters[F];if(typeof L=="function"){let S=g[C];$=L.call(w,S),g.splice(C,1),C--}return $}),r.formatArgs.call(w,g),(w.log||r.log).apply(w,g)}return v.namespace=l,v.useColors=r.useColors(),v.color=r.selectColor(l),v.extend=n,v.destroy=r.destroy,Object.defineProperty(v,"enabled",{enumerable:!0,configurable:!1,get:()=>h!==null?h:(d!==r.namespaces&&(d=r.namespaces,p=r.enabled(l)),p),set:g=>{h=g}}),typeof r.init=="function"&&r.init(v),v}function n(l,f){let h=r(this.namespace+(typeof f>"u"?":":f)+l);return h.log=this.log,h}function i(l){r.save(l),r.namespaces=l,r.names=[],r.skips=[];let f,h=(typeof l=="string"?l:"").split(/[\s,]+/),d=h.length;for(f=0;f<d;f++)h[f]&&(l=h[f].replace(/\*/g,".*?"),l[0]==="-"?r.skips.push(new RegExp("^"+l.slice(1)+"$")):r.names.push(new RegExp("^"+l+"$")))}function o(){let l=[...r.names.map(a),...r.skips.map(a).map(f=>"-"+f)].join(",");return r.enable(""),l}function s(l){if(l[l.length-1]==="*")return!0;let f,h;for(f=0,h=r.skips.length;f<h;f++)if(r.skips[f].test(l))return!1;for(f=0,h=r.names.length;f<h;f++)if(r.names[f].test(l))return!0;return!1}function a(l){return l.toString().substring(2,l.toString().length-2).replace(/\.\*\?$/,"*")}function u(l){return l instanceof Error?l.stack||l.message:l}function c(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return r.enable(r.load()),r}PA.exports=QJ});var RA=y((or,Fd)=>{or.formatArgs=tX;or.save=rX;or.load=nX;or.useColors=eX;or.storage=iX();or.destroy=(()=>{let t=!1;return()=>{t||(t=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();or.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function eX(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let t;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(t=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(t[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function tX(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+Fd.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;t.splice(1,0,e,"color: inherit");let r=0,n=0;t[0].replace(/%[a-zA-Z%]/g,i=>{i!=="%%"&&(r++,i==="%c"&&(n=r))}),t.splice(n,0,e)}or.log=console.debug||console.log||(()=>{});function rX(t){try{t?or.storage.setItem("debug",t):or.storage.removeItem("debug")}catch{}}function nX(){let t;try{t=or.storage.getItem("debug")}catch{}return!t&&typeof process<"u"&&"env"in process&&(t=process.env.DEBUG),t}function iX(){try{return localStorage}catch{}}Fd.exports=xD()(or);var{formatters:oX}=Fd.exports;oX.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var IA=y((Uhe,$A)=>{"use strict";$A.exports=(t,e=process.argv)=>{let r=t.startsWith("-")?"":t.length===1?"-":"--",n=e.indexOf(r+t),i=e.indexOf("--");return n!==-1&&(i===-1||n<i)}});var AD=y((Vhe,NA)=>{"use strict";var sX=require("os"),jA=require("tty"),br=IA(),{env:pt}=process,li;br("no-color")||br("no-colors")||br("color=false")||br("color=never")?li=0:(br("color")||br("colors")||br("color=true")||br("color=always"))&&(li=1);"FORCE_COLOR"in pt&&(pt.FORCE_COLOR==="true"?li=1:pt.FORCE_COLOR==="false"?li=0:li=pt.FORCE_COLOR.length===0?1:Math.min(parseInt(pt.FORCE_COLOR,10),3));function FD(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}function OD(t,e){if(li===0)return 0;if(br("color=16m")||br("color=full")||br("color=truecolor"))return 3;if(br("color=256"))return 2;if(t&&!e&&li===void 0)return 0;let r=li||0;if(pt.TERM==="dumb")return r;if(process.platform==="win32"){let n=sX.release().split(".");return Number(n[0])>=10&&Number(n[2])>=10586?Number(n[2])>=14931?3:2:1}if("CI"in pt)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(n=>n in pt)||pt.CI_NAME==="codeship"?1:r;if("TEAMCITY_VERSION"in pt)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(pt.TEAMCITY_VERSION)?1:0;if(pt.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in pt){let n=parseInt((pt.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(pt.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(pt.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(pt.TERM)||"COLORTERM"in pt?1:r}function aX(t){let e=OD(t,t&&t.isTTY);return FD(e)}NA.exports={supportsColor:aX,stdout:FD(OD(!0,jA.isatty(1))),stderr:FD(OD(!0,jA.isatty(2)))}});var BA=y((mt,Ad)=>{var uX=require("tty"),Od=require("util");mt.init=mX;mt.log=dX;mt.formatArgs=lX;mt.save=hX;mt.load=pX;mt.useColors=cX;mt.destroy=Od.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");mt.colors=[6,2,3,4,5,1];try{let t=AD();t&&(t.stderr||t).level>=2&&(mt.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}mt.inspectOpts=Object.keys(process.env).filter(t=>/^debug_/i.test(t)).reduce((t,e)=>{let r=e.substring(6).toLowerCase().replace(/_([a-z])/g,(i,o)=>o.toUpperCase()),n=process.env[e];return/^(yes|on|true|enabled)$/i.test(n)?n=!0:/^(no|off|false|disabled)$/i.test(n)?n=!1:n==="null"?n=null:n=Number(n),t[r]=n,t},{});function cX(){return"colors"in mt.inspectOpts?!!mt.inspectOpts.colors:uX.isatty(process.stderr.fd)}function lX(t){let{namespace:e,useColors:r}=this;if(r){let n=this.color,i="\x1B[3"+(n<8?n:"8;5;"+n),o=` ${i};1m${e} \x1B[0m`;t[0]=o+t[0].split(`
44
+ see https://github.com/jprichardson/node-fs-extra/issues/269`),Zu.checkPaths(t,e,"copy",(i,o)=>{if(i)return n(i);let{srcStat:s,destStat:a}=o;Zu.checkParentPaths(t,s,e,"copy",u=>u?n(u):r.filter?Z2(Y2,a,t,e,r,n):Y2(a,t,e,r,n))})}function Y2(t,e,r,n,i){let o=Xu.dirname(r);dY(o,(s,a)=>{if(s)return i(s);if(a)return DD(t,e,r,n,i);fY(o,u=>u?i(u):DD(t,e,r,n,i))})}function Z2(t,e,r,n,i,o){Promise.resolve(i.filter(r,n)).then(s=>s?t(e,r,n,i,o):o(),s=>o(s))}function DD(t,e,r,n,i){return n.filter?Z2(J2,t,e,r,n,i):J2(t,e,r,n,i)}function J2(t,e,r,n,i){(n.dereference?Kt.stat:Kt.lstat)(e,(s,a)=>{if(s)return i(s);if(a.isDirectory())return wY(a,t,e,r,n,i);if(a.isFile()||a.isCharacterDevice()||a.isBlockDevice())return mY(a,t,e,r,n,i);if(a.isSymbolicLink())return CY(t,e,r,n,i)})}function mY(t,e,r,n,i,o){return e?gY(t,r,n,i,o):Q2(t,r,n,i,o)}function gY(t,e,r,n,i){if(n.overwrite)Kt.unlink(r,o=>o?i(o):Q2(t,e,r,n,i));else return n.errorOnExist?i(new Error(`'${r}' already exists`)):i()}function Q2(t,e,r,n,i){Kt.copyFile(e,r,o=>o?i(o):n.preserveTimestamps?yY(t.mode,e,r,i):dd(r,t.mode,i))}function yY(t,e,r,n){return DY(t)?vY(r,t,i=>i?n(i):X2(t,e,r,n)):X2(t,e,r,n)}function DY(t){return(t&128)===0}function vY(t,e,r){return dd(t,e|128,r)}function X2(t,e,r,n){bY(e,r,i=>i?n(i):dd(r,t,n))}function dd(t,e,r){return Kt.chmod(t,e,r)}function bY(t,e,r){Kt.stat(t,(n,i)=>n?r(n):hY(e,i.atime,i.mtime,r))}function wY(t,e,r,n,i,o){return e?e&&!e.isDirectory()?o(new Error(`Cannot overwrite non-directory '${n}' with directory '${r}'.`)):eO(r,n,i,o):_Y(t.mode,r,n,i,o)}function _Y(t,e,r,n,i){Kt.mkdir(r,o=>{if(o)return i(o);eO(e,r,n,s=>s?i(s):dd(r,t,i))})}function eO(t,e,r,n){Kt.readdir(t,(i,o)=>i?n(i):tO(o,t,e,r,n))}function tO(t,e,r,n,i){let o=t.pop();return o?EY(t,o,e,r,n,i):i()}function EY(t,e,r,n,i,o){let s=Xu.join(r,e),a=Xu.join(n,e);Zu.checkPaths(s,a,"copy",(u,c)=>{if(u)return o(u);let{destStat:l}=c;DD(l,s,a,i,f=>f?o(f):tO(t,r,n,i,o))})}function CY(t,e,r,n,i){Kt.readlink(e,(o,s)=>{if(o)return i(o);if(n.dereference&&(s=Xu.resolve(process.cwd(),s)),t)Kt.readlink(r,(a,u)=>a?a.code==="EINVAL"||a.code==="UNKNOWN"?Kt.symlink(s,r,i):i(a):(n.dereference&&(u=Xu.resolve(process.cwd(),u)),Zu.isSrcSubdir(s,u)?i(new Error(`Cannot copy '${s}' to a subdirectory of itself, '${u}'.`)):t.isDirectory()&&Zu.isSrcSubdir(u,s)?i(new Error(`Cannot overwrite '${u}' with '${s}'.`)):SY(s,r,i)));else return Kt.symlink(s,r,i)})}function SY(t,e,r){Kt.unlink(e,n=>n?r(n):Kt.symlink(t,e,r))}rO.exports=pY});var vD=y((ghe,iO)=>{"use strict";var xY=Gt().fromCallback;iO.exports={copy:xY(nO())}});var hO=y((yhe,dO)=>{"use strict";var oO=dt(),cO=require("path"),xe=require("assert"),Qu=process.platform==="win32";function lO(t){["unlink","chmod","stat","lstat","rmdir","readdir"].forEach(r=>{t[r]=t[r]||oO[r],r=r+"Sync",t[r]=t[r]||oO[r]}),t.maxBusyTries=t.maxBusyTries||3}function bD(t,e,r){let n=0;typeof e=="function"&&(r=e,e={}),xe(t,"rimraf: missing path"),xe.strictEqual(typeof t,"string","rimraf: path should be a string"),xe.strictEqual(typeof r,"function","rimraf: callback function required"),xe(e,"rimraf: invalid options argument provided"),xe.strictEqual(typeof e,"object","rimraf: options should be object"),lO(e),sO(t,e,function i(o){if(o){if((o.code==="EBUSY"||o.code==="ENOTEMPTY"||o.code==="EPERM")&&n<e.maxBusyTries){n++;let s=n*100;return setTimeout(()=>sO(t,e,i),s)}o.code==="ENOENT"&&(o=null)}r(o)})}function sO(t,e,r){xe(t),xe(e),xe(typeof r=="function"),e.lstat(t,(n,i)=>{if(n&&n.code==="ENOENT")return r(null);if(n&&n.code==="EPERM"&&Qu)return aO(t,e,n,r);if(i&&i.isDirectory())return hd(t,e,n,r);e.unlink(t,o=>{if(o){if(o.code==="ENOENT")return r(null);if(o.code==="EPERM")return Qu?aO(t,e,o,r):hd(t,e,o,r);if(o.code==="EISDIR")return hd(t,e,o,r)}return r(o)})})}function aO(t,e,r,n){xe(t),xe(e),xe(typeof n=="function"),e.chmod(t,438,i=>{i?n(i.code==="ENOENT"?null:r):e.stat(t,(o,s)=>{o?n(o.code==="ENOENT"?null:r):s.isDirectory()?hd(t,e,r,n):e.unlink(t,n)})})}function uO(t,e,r){let n;xe(t),xe(e);try{e.chmodSync(t,438)}catch(i){if(i.code==="ENOENT")return;throw r}try{n=e.statSync(t)}catch(i){if(i.code==="ENOENT")return;throw r}n.isDirectory()?pd(t,e,r):e.unlinkSync(t)}function hd(t,e,r,n){xe(t),xe(e),xe(typeof n=="function"),e.rmdir(t,i=>{i&&(i.code==="ENOTEMPTY"||i.code==="EEXIST"||i.code==="EPERM")?FY(t,e,n):i&&i.code==="ENOTDIR"?n(r):n(i)})}function FY(t,e,r){xe(t),xe(e),xe(typeof r=="function"),e.readdir(t,(n,i)=>{if(n)return r(n);let o=i.length,s;if(o===0)return e.rmdir(t,r);i.forEach(a=>{bD(cO.join(t,a),e,u=>{if(!s){if(u)return r(s=u);--o===0&&e.rmdir(t,r)}})})})}function fO(t,e){let r;e=e||{},lO(e),xe(t,"rimraf: missing path"),xe.strictEqual(typeof t,"string","rimraf: path should be a string"),xe(e,"rimraf: missing options"),xe.strictEqual(typeof e,"object","rimraf: options should be object");try{r=e.lstatSync(t)}catch(n){if(n.code==="ENOENT")return;n.code==="EPERM"&&Qu&&uO(t,e,n)}try{r&&r.isDirectory()?pd(t,e,null):e.unlinkSync(t)}catch(n){if(n.code==="ENOENT")return;if(n.code==="EPERM")return Qu?uO(t,e,n):pd(t,e,n);if(n.code!=="EISDIR")throw n;pd(t,e,n)}}function pd(t,e,r){xe(t),xe(e);try{e.rmdirSync(t)}catch(n){if(n.code==="ENOTDIR")throw r;if(n.code==="ENOTEMPTY"||n.code==="EEXIST"||n.code==="EPERM")OY(t,e);else if(n.code!=="ENOENT")throw n}}function OY(t,e){if(xe(t),xe(e),e.readdirSync(t).forEach(r=>fO(cO.join(t,r),e)),Qu){let r=Date.now();do try{return e.rmdirSync(t,e)}catch{}while(Date.now()-r<500)}else return e.rmdirSync(t,e)}dO.exports=bD;bD.sync=fO});var ec=y((Dhe,mO)=>{"use strict";var AY=Gt().fromCallback,pO=hO();mO.exports={remove:AY(pO),removeSync:pO.sync}});var EO=y((vhe,_O)=>{"use strict";var kY=Gt().fromCallback,DO=dt(),vO=require("path"),bO=kr(),wO=ec(),gO=kY(function(e,r){r=r||function(){},DO.readdir(e,(n,i)=>{if(n)return bO.mkdirs(e,r);i=i.map(s=>vO.join(e,s)),o();function o(){let s=i.pop();if(!s)return r();wO.remove(s,a=>{if(a)return r(a);o()})}})});function yO(t){let e;try{e=DO.readdirSync(t)}catch{return bO.mkdirsSync(t)}e.forEach(r=>{r=vO.join(t,r),wO.removeSync(r)})}_O.exports={emptyDirSync:yO,emptydirSync:yO,emptyDir:gO,emptydir:gO}});var FO=y((bhe,xO)=>{"use strict";var TY=Gt().fromCallback,CO=require("path"),ui=dt(),SO=kr();function PY(t,e){function r(){ui.writeFile(t,"",n=>{if(n)return e(n);e()})}ui.stat(t,(n,i)=>{if(!n&&i.isFile())return e();let o=CO.dirname(t);ui.stat(o,(s,a)=>{if(s)return s.code==="ENOENT"?SO.mkdirs(o,u=>{if(u)return e(u);r()}):e(s);a.isDirectory()?r():ui.readdir(o,u=>{if(u)return e(u)})})})}function RY(t){let e;try{e=ui.statSync(t)}catch{}if(e&&e.isFile())return;let r=CO.dirname(t);try{ui.statSync(r).isDirectory()||ui.readdirSync(r)}catch(n){if(n&&n.code==="ENOENT")SO.mkdirsSync(r);else throw n}ui.writeFileSync(t,"")}xO.exports={createFile:TY(PY),createFileSync:RY}});var PO=y((whe,TO)=>{"use strict";var $Y=Gt().fromCallback,AO=require("path"),ao=dt(),kO=kr(),OO=ai().pathExists;function IY(t,e,r){function n(i,o){ao.link(i,o,s=>{if(s)return r(s);r(null)})}OO(e,(i,o)=>{if(i)return r(i);if(o)return r(null);ao.lstat(t,s=>{if(s)return s.message=s.message.replace("lstat","ensureLink"),r(s);let a=AO.dirname(e);OO(a,(u,c)=>{if(u)return r(u);if(c)return n(t,e);kO.mkdirs(a,l=>{if(l)return r(l);n(t,e)})})})})}function jY(t,e){if(ao.existsSync(e))return;try{ao.lstatSync(t)}catch(o){throw o.message=o.message.replace("lstat","ensureLink"),o}let n=AO.dirname(e);return ao.existsSync(n)||kO.mkdirsSync(n),ao.linkSync(t,e)}TO.exports={createLink:$Y(IY),createLinkSync:jY}});var $O=y((_he,RO)=>{"use strict";var ci=require("path"),tc=dt(),NY=ai().pathExists;function LY(t,e,r){if(ci.isAbsolute(t))return tc.lstat(t,n=>n?(n.message=n.message.replace("lstat","ensureSymlink"),r(n)):r(null,{toCwd:t,toDst:t}));{let n=ci.dirname(e),i=ci.join(n,t);return NY(i,(o,s)=>o?r(o):s?r(null,{toCwd:i,toDst:t}):tc.lstat(t,a=>a?(a.message=a.message.replace("lstat","ensureSymlink"),r(a)):r(null,{toCwd:t,toDst:ci.relative(n,t)})))}}function BY(t,e){let r;if(ci.isAbsolute(t)){if(r=tc.existsSync(t),!r)throw new Error("absolute srcpath does not exist");return{toCwd:t,toDst:t}}else{let n=ci.dirname(e),i=ci.join(n,t);if(r=tc.existsSync(i),r)return{toCwd:i,toDst:t};if(r=tc.existsSync(t),!r)throw new Error("relative srcpath does not exist");return{toCwd:t,toDst:ci.relative(n,t)}}}RO.exports={symlinkPaths:LY,symlinkPathsSync:BY}});var NO=y((Ehe,jO)=>{"use strict";var IO=dt();function qY(t,e,r){if(r=typeof e=="function"?e:r,e=typeof e=="function"?!1:e,e)return r(null,e);IO.lstat(t,(n,i)=>{if(n)return r(null,"file");e=i&&i.isDirectory()?"dir":"file",r(null,e)})}function MY(t,e){let r;if(e)return e;try{r=IO.lstatSync(t)}catch{return"file"}return r&&r.isDirectory()?"dir":"file"}jO.exports={symlinkType:qY,symlinkTypeSync:MY}});var HO=y((Che,VO)=>{"use strict";var UY=Gt().fromCallback,BO=require("path"),Bs=dt(),qO=kr(),VY=qO.mkdirs,HY=qO.mkdirsSync,MO=$O(),zY=MO.symlinkPaths,GY=MO.symlinkPathsSync,UO=NO(),WY=UO.symlinkType,KY=UO.symlinkTypeSync,LO=ai().pathExists;function YY(t,e,r,n){n=typeof r=="function"?r:n,r=typeof r=="function"?!1:r,LO(e,(i,o)=>{if(i)return n(i);if(o)return n(null);zY(t,e,(s,a)=>{if(s)return n(s);t=a.toDst,WY(a.toCwd,r,(u,c)=>{if(u)return n(u);let l=BO.dirname(e);LO(l,(f,h)=>{if(f)return n(f);if(h)return Bs.symlink(t,e,c,n);VY(l,d=>{if(d)return n(d);Bs.symlink(t,e,c,n)})})})})})}function JY(t,e,r){if(Bs.existsSync(e))return;let i=GY(t,e);t=i.toDst,r=KY(i.toCwd,r);let o=BO.dirname(e);return Bs.existsSync(o)||HY(o),Bs.symlinkSync(t,e,r)}VO.exports={createSymlink:UY(YY),createSymlinkSync:JY}});var GO=y((She,zO)=>{"use strict";var md=FO(),gd=PO(),yd=HO();zO.exports={createFile:md.createFile,createFileSync:md.createFileSync,ensureFile:md.createFile,ensureFileSync:md.createFileSync,createLink:gd.createLink,createLinkSync:gd.createLinkSync,ensureLink:gd.createLink,ensureLinkSync:gd.createLinkSync,createSymlink:yd.createSymlink,createSymlinkSync:yd.createSymlinkSync,ensureSymlink:yd.createSymlink,ensureSymlinkSync:yd.createSymlinkSync}});var Dd=y((xhe,WO)=>{function XY(t,{EOL:e=`
45
+ `,finalEOL:r=!0,replacer:n=null,spaces:i}={}){let o=r?e:"";return JSON.stringify(t,n,i).replace(/\n/g,e)+o}function ZY(t){return Buffer.isBuffer(t)&&(t=t.toString("utf8")),t.replace(/^\uFEFF/,"")}WO.exports={stringify:XY,stripBom:ZY}});var XO=y((Fhe,JO)=>{var qs;try{qs=dt()}catch{qs=require("fs")}var vd=Gt(),{stringify:KO,stripBom:YO}=Dd();async function QY(t,e={}){typeof e=="string"&&(e={encoding:e});let r=e.fs||qs,n="throws"in e?e.throws:!0,i=await vd.fromCallback(r.readFile)(t,e);i=YO(i);let o;try{o=JSON.parse(i,e?e.reviver:null)}catch(s){if(n)throw s.message=`${t}: ${s.message}`,s;return null}return o}var eJ=vd.fromPromise(QY);function tJ(t,e={}){typeof e=="string"&&(e={encoding:e});let r=e.fs||qs,n="throws"in e?e.throws:!0;try{let i=r.readFileSync(t,e);return i=YO(i),JSON.parse(i,e.reviver)}catch(i){if(n)throw i.message=`${t}: ${i.message}`,i;return null}}async function rJ(t,e,r={}){let n=r.fs||qs,i=KO(e,r);await vd.fromCallback(n.writeFile)(t,i,r)}var nJ=vd.fromPromise(rJ);function iJ(t,e,r={}){let n=r.fs||qs,i=KO(e,r);return n.writeFileSync(t,i,r)}var oJ={readFile:eJ,readFileSync:tJ,writeFile:nJ,writeFileSync:iJ};JO.exports=oJ});var QO=y((Ohe,ZO)=>{"use strict";var bd=XO();ZO.exports={readJson:bd.readFile,readJsonSync:bd.readFileSync,writeJson:bd.writeFile,writeJsonSync:bd.writeFileSync}});var wd=y((Ahe,rA)=>{"use strict";var sJ=Gt().fromCallback,rc=dt(),eA=require("path"),tA=kr(),aJ=ai().pathExists;function uJ(t,e,r,n){typeof r=="function"&&(n=r,r="utf8");let i=eA.dirname(t);aJ(i,(o,s)=>{if(o)return n(o);if(s)return rc.writeFile(t,e,r,n);tA.mkdirs(i,a=>{if(a)return n(a);rc.writeFile(t,e,r,n)})})}function cJ(t,...e){let r=eA.dirname(t);if(rc.existsSync(r))return rc.writeFileSync(t,...e);tA.mkdirsSync(r),rc.writeFileSync(t,...e)}rA.exports={outputFile:sJ(uJ),outputFileSync:cJ}});var iA=y((khe,nA)=>{"use strict";var{stringify:lJ}=Dd(),{outputFile:fJ}=wd();async function dJ(t,e,r={}){let n=lJ(e,r);await fJ(t,n,r)}nA.exports=dJ});var sA=y((The,oA)=>{"use strict";var{stringify:hJ}=Dd(),{outputFileSync:pJ}=wd();function mJ(t,e,r){let n=hJ(e,r);pJ(t,n,r)}oA.exports=mJ});var uA=y((Phe,aA)=>{"use strict";var gJ=Gt().fromPromise,Rt=QO();Rt.outputJson=gJ(iA());Rt.outputJsonSync=sA();Rt.outputJSON=Rt.outputJson;Rt.outputJSONSync=Rt.outputJsonSync;Rt.writeJSON=Rt.writeJson;Rt.writeJSONSync=Rt.writeJsonSync;Rt.readJSON=Rt.readJson;Rt.readJSONSync=Rt.readJsonSync;aA.exports=Rt});var pA=y((Rhe,hA)=>{"use strict";var fA=dt(),yJ=require("path"),DJ=yD().copySync,dA=ec().removeSync,vJ=kr().mkdirpSync,cA=Ku();function bJ(t,e,r){r=r||{};let n=r.overwrite||r.clobber||!1,{srcStat:i}=cA.checkPathsSync(t,e,"move");return cA.checkParentPathsSync(t,i,e,"move"),vJ(yJ.dirname(e)),wJ(t,e,n)}function wJ(t,e,r){if(r)return dA(e),lA(t,e,r);if(fA.existsSync(e))throw new Error("dest already exists.");return lA(t,e,r)}function lA(t,e,r){try{fA.renameSync(t,e)}catch(n){if(n.code!=="EXDEV")throw n;return _J(t,e,r)}}function _J(t,e,r){return DJ(t,e,{overwrite:r,errorOnExist:!0}),dA(t)}hA.exports=bJ});var gA=y(($he,mA)=>{"use strict";mA.exports={moveSync:pA()}});var wA=y((Ihe,bA)=>{"use strict";var EJ=dt(),CJ=require("path"),SJ=vD().copy,vA=ec().remove,xJ=kr().mkdirp,FJ=ai().pathExists,yA=Ku();function OJ(t,e,r,n){typeof r=="function"&&(n=r,r={});let i=r.overwrite||r.clobber||!1;yA.checkPaths(t,e,"move",(o,s)=>{if(o)return n(o);let{srcStat:a}=s;yA.checkParentPaths(t,a,e,"move",u=>{if(u)return n(u);xJ(CJ.dirname(e),c=>c?n(c):AJ(t,e,i,n))})})}function AJ(t,e,r,n){if(r)return vA(e,i=>i?n(i):DA(t,e,r,n));FJ(e,(i,o)=>i?n(i):o?n(new Error("dest already exists.")):DA(t,e,r,n))}function DA(t,e,r,n){EJ.rename(t,e,i=>i?i.code!=="EXDEV"?n(i):kJ(t,e,r,n):n())}function kJ(t,e,r,n){SJ(t,e,{overwrite:r,errorOnExist:!0},o=>o?n(o):vA(t,n))}bA.exports=OJ});var EA=y((jhe,_A)=>{"use strict";var TJ=Gt().fromCallback;_A.exports={move:TJ(wA())}});var _d=y((Nhe,wD)=>{"use strict";wD.exports={...Wu(),...yD(),...vD(),...EO(),...GO(),...uA(),...kr(),...gA(),...EA(),...wd(),...ai(),...ec()};var CA=require("fs");Object.getOwnPropertyDescriptor(CA,"promises")&&Object.defineProperty(wD.exports,"promises",{get(){return CA.promises}})});var _D=y(Ms=>{"use strict";Object.defineProperty(Ms,"__esModule",{value:!0});Ms.readdir=Ms.stat=void 0;var SA=_d();async function PJ(t){try{return await SA.stat(t)}catch{}}Ms.stat=PJ;async function RJ(t){try{return await SA.readdir(t)}catch{return[]}}Ms.readdir=RJ});var Us=y(re=>{"use strict";Object.defineProperty(re,"__esModule",{value:!0});re.walk=re.Walker=re.compilePaths=re.tmpfilepath=re.findBaseDirectory=re.isExecutableFile=re.pathExecutable=re.pathWritable=re.pathReadable=re.pathExists=re.pathAccessible=re.writeStreamToFile=re.cacheFileChecksum=re.getFileChecksums=re.getFileChecksum=re.fileToString=re.getFileTree=re.readdirp=re.readdirSafe=re.statSafe=void 0;var $J=(F2(),ke(x2)),vr=_d(),IJ=require("os"),xn=require("path"),xA=require("stream"),FA=_D();$J.__exportStar(_d(),re);var OA=_D();Object.defineProperty(re,"statSafe",{enumerable:!0,get:function(){return OA.stat}});Object.defineProperty(re,"readdirSafe",{enumerable:!0,get:function(){return OA.readdir}});async function jJ(t,{filter:e,onError:r,walkerOptions:n}={}){return new Promise((i,o)=>{let s=[],a=CD(t,n);e&&(a=a.pipe(new xA.Transform({objectMode:!0,transform(u,c,l){(!e||e(u))&&this.push(u),l()}}))),a.on("error",u=>r?r(u):o(u)).on("data",u=>s.push(u.path)).on("end",()=>i(s))})}re.readdirp=jJ;async function NJ(t,{onError:e,onFileNode:r=o=>o,onDirectoryNode:n=o=>o,walkerOptions:i}={}){let o=new Map([]),s=u=>{let c=xn.dirname(u.path),l=o.get(c);return l&&l.type==="directory"?l:n({path:c,type:"directory",children:[]})},a=(u,c)=>{let l={path:u.path,parent:c};return u.stats.isDirectory()?n({...l,type:"directory",children:[]}):r({...l,type:"file"})};return new Promise((u,c)=>{t=xn.resolve(t),CD(t,i).on("error",f=>e?e(f):c(f)).on("data",f=>{let h=s(f),d=a(f,h);h.children.push(d),o.set(f.path,d),o.set(h.path,h)}).on("end",()=>{let f=o.get(t);if(!f)return c(new Error("No root node found after walking directory structure."));delete f.parent,u(f)})})}re.getFileTree=NJ;async function LJ(t){try{return await vr.readFile(t,{encoding:"utf8"})}catch(e){if(e.code==="ENOENT"||e.code==="ENOTDIR")return"";throw e}}re.fileToString=LJ;async function ED(t){let e=await Promise.resolve().then(()=>require("crypto"));return new Promise((r,n)=>{let i=e.createHash("md5"),o=vr.createReadStream(t);o.on("error",s=>{n(s)}),i.once("readable",()=>{let s=i.read().toString("hex");r(s)}),o.pipe(i)})}re.getFileChecksum=ED;async function BJ(t){return Promise.all([ED(t),(async()=>{try{return(await vr.readFile(`${t}.md5`,{encoding:"utf8"})).trim()}catch(e){if(e.code!=="ENOENT")throw e}})()])}re.getFileChecksums=BJ;async function qJ(t,e){let r=await ED(t);await vr.writeFile(`${t}.md5`,r,{encoding:"utf8"})}re.cacheFileChecksum=qJ;function MJ(t,e){return new Promise((r,n)=>{let i=vr.createWriteStream(e);t.pipe(i),i.on("error",n),i.on("finish",r)})}re.writeStreamToFile=MJ;async function nc(t,e){try{await vr.access(t,e)}catch{return!1}return!0}re.pathAccessible=nc;async function UJ(t){return nc(t,vr.constants.F_OK)}re.pathExists=UJ;async function VJ(t){return nc(t,vr.constants.R_OK)}re.pathReadable=VJ;async function HJ(t){return nc(t,vr.constants.W_OK)}re.pathWritable=HJ;async function AA(t){return nc(t,vr.constants.X_OK)}re.pathExecutable=AA;async function zJ(t){let[e,r]=await Promise.all([FA.stat(t),AA(t)]);return!!e&&(e.isFile()||e.isSymbolicLink())&&r}re.isExecutableFile=zJ;async function GJ(t,e){if(!(!t||!e)){for(let r of kA(t))if((await FA.readdir(r)).includes(e))return r}}re.findBaseDirectory=GJ;function WJ(t){let e=Math.random().toString(16).substring(2,8);return xn.resolve(IJ.tmpdir(),t?`${t}-${e}`:e)}re.tmpfilepath=WJ;function kA(t){if(t=xn.normalize(t),!xn.isAbsolute(t))throw new Error(`${t} is not an absolute path`);let e=xn.parse(t);return t===e.root?[t]:t.slice(e.root.length).split(xn.sep).map((r,n,i)=>e.root+xn.join(...i.slice(0,i.length-n))).concat(e.root)}re.compilePaths=kA;var Ed=class extends xA.Readable{constructor(e,r={}){super({objectMode:!0}),this.p=e,this.options=r,this.paths=[this.p]}_read(){let e=this.paths.shift(),{pathFilter:r}=this.options;if(!e){this.push(null);return}vr.lstat(e,(n,i)=>{if(n){this.emit("error",n);return}let o={path:e,stats:i};i.isDirectory()?vr.readdir(e,(s,a)=>{if(s){this.emit("error",s);return}let u=a.map(c=>xn.join(e,c));r&&(u=u.filter(c=>r(c.substring(this.p.length+1)))),this.paths.push(...u),this.push(o)}):this.push(o)})}};re.Walker=Ed;function CD(t,e={}){return new Ed(t,e)}re.walk=CD});var SD=y((qhe,TA)=>{var Vs=1e3,Hs=Vs*60,zs=Hs*60,uo=zs*24,KJ=uo*7,YJ=uo*365.25;TA.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return JJ(t);if(r==="number"&&isFinite(t))return e.long?ZJ(t):XJ(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function JJ(t){if(t=String(t),!(t.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(e){var r=parseFloat(e[1]),n=(e[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return r*YJ;case"weeks":case"week":case"w":return r*KJ;case"days":case"day":case"d":return r*uo;case"hours":case"hour":case"hrs":case"hr":case"h":return r*zs;case"minutes":case"minute":case"mins":case"min":case"m":return r*Hs;case"seconds":case"second":case"secs":case"sec":case"s":return r*Vs;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}function XJ(t){var e=Math.abs(t);return e>=uo?Math.round(t/uo)+"d":e>=zs?Math.round(t/zs)+"h":e>=Hs?Math.round(t/Hs)+"m":e>=Vs?Math.round(t/Vs)+"s":t+"ms"}function ZJ(t){var e=Math.abs(t);return e>=uo?Cd(t,e,uo,"day"):e>=zs?Cd(t,e,zs,"hour"):e>=Hs?Cd(t,e,Hs,"minute"):e>=Vs?Cd(t,e,Vs,"second"):t+" ms"}function Cd(t,e,r,n){var i=e>=r*1.5;return Math.round(t/r)+" "+n+(i?"s":"")}});var xD=y((Mhe,PA)=>{function QJ(t){r.debug=r,r.default=r,r.coerce=u,r.disable=o,r.enable=i,r.enabled=s,r.humanize=SD(),r.destroy=c,Object.keys(t).forEach(l=>{r[l]=t[l]}),r.names=[],r.skips=[],r.formatters={};function e(l){let f=0;for(let h=0;h<l.length;h++)f=(f<<5)-f+l.charCodeAt(h),f|=0;return r.colors[Math.abs(f)%r.colors.length]}r.selectColor=e;function r(l){let f,h=null,d,p;function v(...g){if(!v.enabled)return;let w=v,x=Number(new Date),D=x-(f||x);w.diff=D,w.prev=f,w.curr=x,f=x,g[0]=r.coerce(g[0]),typeof g[0]!="string"&&g.unshift("%O");let C=0;g[0]=g[0].replace(/%([a-zA-Z%])/g,($,F)=>{if($==="%%")return"%";C++;let L=r.formatters[F];if(typeof L=="function"){let S=g[C];$=L.call(w,S),g.splice(C,1),C--}return $}),r.formatArgs.call(w,g),(w.log||r.log).apply(w,g)}return v.namespace=l,v.useColors=r.useColors(),v.color=r.selectColor(l),v.extend=n,v.destroy=r.destroy,Object.defineProperty(v,"enabled",{enumerable:!0,configurable:!1,get:()=>h!==null?h:(d!==r.namespaces&&(d=r.namespaces,p=r.enabled(l)),p),set:g=>{h=g}}),typeof r.init=="function"&&r.init(v),v}function n(l,f){let h=r(this.namespace+(typeof f>"u"?":":f)+l);return h.log=this.log,h}function i(l){r.save(l),r.namespaces=l,r.names=[],r.skips=[];let f,h=(typeof l=="string"?l:"").split(/[\s,]+/),d=h.length;for(f=0;f<d;f++)h[f]&&(l=h[f].replace(/\*/g,".*?"),l[0]==="-"?r.skips.push(new RegExp("^"+l.slice(1)+"$")):r.names.push(new RegExp("^"+l+"$")))}function o(){let l=[...r.names.map(a),...r.skips.map(a).map(f=>"-"+f)].join(",");return r.enable(""),l}function s(l){if(l[l.length-1]==="*")return!0;let f,h;for(f=0,h=r.skips.length;f<h;f++)if(r.skips[f].test(l))return!1;for(f=0,h=r.names.length;f<h;f++)if(r.names[f].test(l))return!0;return!1}function a(l){return l.toString().substring(2,l.toString().length-2).replace(/\.\*\?$/,"*")}function u(l){return l instanceof Error?l.stack||l.message:l}function c(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return r.enable(r.load()),r}PA.exports=QJ});var RA=y((or,Sd)=>{or.formatArgs=tX;or.save=rX;or.load=nX;or.useColors=eX;or.storage=iX();or.destroy=(()=>{let t=!1;return()=>{t||(t=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();or.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function eX(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let t;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(t=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(t[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function tX(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+Sd.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;t.splice(1,0,e,"color: inherit");let r=0,n=0;t[0].replace(/%[a-zA-Z%]/g,i=>{i!=="%%"&&(r++,i==="%c"&&(n=r))}),t.splice(n,0,e)}or.log=console.debug||console.log||(()=>{});function rX(t){try{t?or.storage.setItem("debug",t):or.storage.removeItem("debug")}catch{}}function nX(){let t;try{t=or.storage.getItem("debug")}catch{}return!t&&typeof process<"u"&&"env"in process&&(t=process.env.DEBUG),t}function iX(){try{return localStorage}catch{}}Sd.exports=xD()(or);var{formatters:oX}=Sd.exports;oX.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var IA=y((Uhe,$A)=>{"use strict";$A.exports=(t,e=process.argv)=>{let r=t.startsWith("-")?"":t.length===1?"-":"--",n=e.indexOf(r+t),i=e.indexOf("--");return n!==-1&&(i===-1||n<i)}});var AD=y((Vhe,NA)=>{"use strict";var sX=require("os"),jA=require("tty"),br=IA(),{env:pt}=process,li;br("no-color")||br("no-colors")||br("color=false")||br("color=never")?li=0:(br("color")||br("colors")||br("color=true")||br("color=always"))&&(li=1);"FORCE_COLOR"in pt&&(pt.FORCE_COLOR==="true"?li=1:pt.FORCE_COLOR==="false"?li=0:li=pt.FORCE_COLOR.length===0?1:Math.min(parseInt(pt.FORCE_COLOR,10),3));function FD(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}function OD(t,e){if(li===0)return 0;if(br("color=16m")||br("color=full")||br("color=truecolor"))return 3;if(br("color=256"))return 2;if(t&&!e&&li===void 0)return 0;let r=li||0;if(pt.TERM==="dumb")return r;if(process.platform==="win32"){let n=sX.release().split(".");return Number(n[0])>=10&&Number(n[2])>=10586?Number(n[2])>=14931?3:2:1}if("CI"in pt)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(n=>n in pt)||pt.CI_NAME==="codeship"?1:r;if("TEAMCITY_VERSION"in pt)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(pt.TEAMCITY_VERSION)?1:0;if(pt.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in pt){let n=parseInt((pt.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(pt.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(pt.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(pt.TERM)||"COLORTERM"in pt?1:r}function aX(t){let e=OD(t,t&&t.isTTY);return FD(e)}NA.exports={supportsColor:aX,stdout:FD(OD(!0,jA.isatty(1))),stderr:FD(OD(!0,jA.isatty(2)))}});var BA=y((mt,Fd)=>{var uX=require("tty"),xd=require("util");mt.init=mX;mt.log=dX;mt.formatArgs=lX;mt.save=hX;mt.load=pX;mt.useColors=cX;mt.destroy=xd.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");mt.colors=[6,2,3,4,5,1];try{let t=AD();t&&(t.stderr||t).level>=2&&(mt.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}mt.inspectOpts=Object.keys(process.env).filter(t=>/^debug_/i.test(t)).reduce((t,e)=>{let r=e.substring(6).toLowerCase().replace(/_([a-z])/g,(i,o)=>o.toUpperCase()),n=process.env[e];return/^(yes|on|true|enabled)$/i.test(n)?n=!0:/^(no|off|false|disabled)$/i.test(n)?n=!1:n==="null"?n=null:n=Number(n),t[r]=n,t},{});function cX(){return"colors"in mt.inspectOpts?!!mt.inspectOpts.colors:uX.isatty(process.stderr.fd)}function lX(t){let{namespace:e,useColors:r}=this;if(r){let n=this.color,i="\x1B[3"+(n<8?n:"8;5;"+n),o=` ${i};1m${e} \x1B[0m`;t[0]=o+t[0].split(`
46
46
  `).join(`
47
- `+o),t.push(i+"m+"+Ad.exports.humanize(this.diff)+"\x1B[0m")}else t[0]=fX()+e+" "+t[0]}function fX(){return mt.inspectOpts.hideDate?"":new Date().toISOString()+" "}function dX(...t){return process.stderr.write(Od.formatWithOptions(mt.inspectOpts,...t)+`
48
- `)}function hX(t){t?process.env.DEBUG=t:delete process.env.DEBUG}function pX(){return process.env.DEBUG}function mX(t){t.inspectOpts={};let e=Object.keys(mt.inspectOpts);for(let r=0;r<e.length;r++)t.inspectOpts[e[r]]=mt.inspectOpts[e[r]]}Ad.exports=xD()(mt);var{formatters:LA}=Ad.exports;LA.o=function(t){return this.inspectOpts.colors=this.useColors,Od.inspect(t,this.inspectOpts).split(`
49
- `).map(e=>e.trim()).join(" ")};LA.O=function(t){return this.inspectOpts.colors=this.useColors,Od.inspect(t,this.inspectOpts)}});var qA=y((Hhe,kD)=>{typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?kD.exports=RA():kD.exports=BA()});var WA=y((zhe,GA)=>{"use strict";var TD,UA,VA,HA,zA=!0;typeof process<"u"&&({FORCE_COLOR:TD,NODE_DISABLE_COLORS:UA,NO_COLOR:VA,TERM:HA}=process.env||{},zA=process.stdout&&process.stdout.isTTY);var _e={enabled:!UA&&VA==null&&HA!=="dumb"&&(TD!=null&&TD!=="0"||zA),reset:Oe(0,0),bold:Oe(1,22),dim:Oe(2,22),italic:Oe(3,23),underline:Oe(4,24),inverse:Oe(7,27),hidden:Oe(8,28),strikethrough:Oe(9,29),black:Oe(30,39),red:Oe(31,39),green:Oe(32,39),yellow:Oe(33,39),blue:Oe(34,39),magenta:Oe(35,39),cyan:Oe(36,39),white:Oe(37,39),gray:Oe(90,39),grey:Oe(90,39),bgBlack:Oe(40,49),bgRed:Oe(41,49),bgGreen:Oe(42,49),bgYellow:Oe(43,49),bgBlue:Oe(44,49),bgMagenta:Oe(45,49),bgCyan:Oe(46,49),bgWhite:Oe(47,49)};function MA(t,e){let r=0,n,i="",o="";for(;r<t.length;r++)n=t[r],i+=n.open,o+=n.close,~e.indexOf(n.close)&&(e=e.replace(n.rgx,n.close+n.open));return i+e+o}function gX(t,e){let r={has:t,keys:e};return r.reset=_e.reset.bind(r),r.bold=_e.bold.bind(r),r.dim=_e.dim.bind(r),r.italic=_e.italic.bind(r),r.underline=_e.underline.bind(r),r.inverse=_e.inverse.bind(r),r.hidden=_e.hidden.bind(r),r.strikethrough=_e.strikethrough.bind(r),r.black=_e.black.bind(r),r.red=_e.red.bind(r),r.green=_e.green.bind(r),r.yellow=_e.yellow.bind(r),r.blue=_e.blue.bind(r),r.magenta=_e.magenta.bind(r),r.cyan=_e.cyan.bind(r),r.white=_e.white.bind(r),r.gray=_e.gray.bind(r),r.grey=_e.grey.bind(r),r.bgBlack=_e.bgBlack.bind(r),r.bgRed=_e.bgRed.bind(r),r.bgGreen=_e.bgGreen.bind(r),r.bgYellow=_e.bgYellow.bind(r),r.bgBlue=_e.bgBlue.bind(r),r.bgMagenta=_e.bgMagenta.bind(r),r.bgCyan=_e.bgCyan.bind(r),r.bgWhite=_e.bgWhite.bind(r),r}function Oe(t,e){let r={open:`\x1B[${t}m`,close:`\x1B[${e}m`,rgx:new RegExp(`\\x1b\\[${e}m`,"g")};return function(n){return this!==void 0&&this.has!==void 0?(~this.has.indexOf(t)||(this.has.push(t),this.keys.push(r)),n===void 0?this:_e.enabled?MA(this.keys,n+""):n+""):n===void 0?gX([t],[r]):_e.enabled?MA([r],n+""):n+""}}GA.exports=_e});var Gs=y(et=>{"use strict";Object.defineProperty(et,"__esModule",{value:!0});et.ancillary=et.failure=et.success=et.input=et.weak=et.strong=void 0;var yX=(Cn(),ke(En)),Yr=yX.__importDefault(WA());et.strong=Yr.default.bold;et.weak=Yr.default.dim;et.input=Yr.default.cyan;et.success=Yr.default.green;et.failure=Yr.default.red;et.ancillary=Yr.default.cyan;var DX={strong:et.strong,weak:et.weak,input:et.input,success:et.success,failure:et.failure,ancillary:et.ancillary,log:{DEBUG:Yr.default.magenta,INFO:Yr.default.cyan,WARN:Yr.default.yellow,ERROR:Yr.default.red}};et.default=DX});var ic={};mn(ic,{__addDisposableResource:()=>pk,__assign:()=>kd,__asyncDelegator:()=>sk,__asyncGenerator:()=>ok,__asyncValues:()=>ak,__await:()=>Ws,__awaiter:()=>QA,__classPrivateFieldGet:()=>fk,__classPrivateFieldIn:()=>hk,__classPrivateFieldSet:()=>dk,__createBinding:()=>Pd,__decorate:()=>JA,__disposeResources:()=>mk,__esDecorate:()=>vX,__exportStar:()=>tk,__extends:()=>KA,__generator:()=>ek,__importDefault:()=>lk,__importStar:()=>ck,__makeTemplateObject:()=>uk,__metadata:()=>ZA,__param:()=>XA,__propKey:()=>wX,__read:()=>RD,__rest:()=>YA,__runInitializers:()=>bX,__setFunctionName:()=>_X,__spread:()=>rk,__spreadArray:()=>ik,__spreadArrays:()=>nk,__values:()=>Td,default:()=>SX});function KA(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");PD(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}function YA(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}function JA(t,e,r,n){var i=arguments.length,o=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,r,o):s(e,r))||o);return i>3&&o&&Object.defineProperty(e,r,o),o}function XA(t,e){return function(r,n){e(r,n,t)}}function vX(t,e,r,n,i,o){function s(w){if(w!==void 0&&typeof w!="function")throw new TypeError("Function expected");return w}for(var a=n.kind,u=a==="getter"?"get":a==="setter"?"set":"value",c=!e&&t?n.static?t:t.prototype:null,l=e||(c?Object.getOwnPropertyDescriptor(c,n.name):{}),f,h=!1,d=r.length-1;d>=0;d--){var p={};for(var v in n)p[v]=v==="access"?{}:n[v];for(var v in n.access)p.access[v]=n.access[v];p.addInitializer=function(w){if(h)throw new TypeError("Cannot add initializers after decoration has completed");o.push(s(w||null))};var g=(0,r[d])(a==="accessor"?{get:l.get,set:l.set}:l[u],p);if(a==="accessor"){if(g===void 0)continue;if(g===null||typeof g!="object")throw new TypeError("Object expected");(f=s(g.get))&&(l.get=f),(f=s(g.set))&&(l.set=f),(f=s(g.init))&&i.unshift(f)}else(f=s(g))&&(a==="field"?i.unshift(f):l[u]=f)}c&&Object.defineProperty(c,n.name,l),h=!0}function bX(t,e,r){for(var n=arguments.length>2,i=0;i<e.length;i++)r=n?e[i].call(t,r):e[i].call(t);return n?r:void 0}function wX(t){return typeof t=="symbol"?t:"".concat(t)}function _X(t,e,r){return typeof e=="symbol"&&(e=e.description?"[".concat(e.description,"]"):""),Object.defineProperty(t,"name",{configurable:!0,value:r?"".concat(r," ",e):e})}function ZA(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function QA(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(l){try{c(n.next(l))}catch(f){s(f)}}function u(l){try{c(n.throw(l))}catch(f){s(f)}}function c(l){l.done?o(l.value):i(l.value).then(a,u)}c((n=n.apply(t,e||[])).next())})}function ek(t,e){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(c){return function(l){return u([c,l])}}function u(c){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,c[0]&&(r=0)),r;)try{if(n=1,i&&(o=c[0]&2?i.return:c[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,c[1])).done)return o;switch(i=0,o&&(c=[c[0]&2,o.value]),c[0]){case 0:case 1:o=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,i=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]<o[3])){r.label=c[1];break}if(c[0]===6&&r.label<o[1]){r.label=o[1],o=c;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(c);break}o[2]&&r.ops.pop(),r.trys.pop();continue}c=e.call(t,r)}catch(l){c=[6,l],i=0}finally{n=o=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function tk(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Pd(e,t,r)}function Td(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function RD(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,o=[],s;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(a){s={error:a}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return o}function rk(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(RD(arguments[e]));return t}function nk(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var n=Array(t),i=0,e=0;e<r;e++)for(var o=arguments[e],s=0,a=o.length;s<a;s++,i++)n[i]=o[s];return n}function ik(t,e,r){if(r||arguments.length===2)for(var n=0,i=e.length,o;n<i;n++)(o||!(n in e))&&(o||(o=Array.prototype.slice.call(e,0,n)),o[n]=e[n]);return t.concat(o||Array.prototype.slice.call(e))}function Ws(t){return this instanceof Ws?(this.v=t,this):new Ws(t)}function ok(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(t,e||[]),i,o=[];return i={},s("next"),s("throw"),s("return"),i[Symbol.asyncIterator]=function(){return this},i;function s(h){n[h]&&(i[h]=function(d){return new Promise(function(p,v){o.push([h,d,p,v])>1||a(h,d)})})}function a(h,d){try{u(n[h](d))}catch(p){f(o[0][3],p)}}function u(h){h.value instanceof Ws?Promise.resolve(h.value.v).then(c,l):f(o[0][2],h)}function c(h){a("next",h)}function l(h){a("throw",h)}function f(h,d){h(d),o.shift(),o.length&&a(o[0][0],o[0][1])}}function sk(t){var e,r;return e={},n("next"),n("throw",function(i){throw i}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(i,o){e[i]=t[i]?function(s){return(r=!r)?{value:Ws(t[i](s)),done:!1}:o?o(s):s}:o}}function ak(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof Td=="function"?Td(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(o){r[o]=t[o]&&function(s){return new Promise(function(a,u){s=t[o](s),i(a,u,s.done,s.value)})}}function i(o,s,a,u){Promise.resolve(u).then(function(c){o({value:c,done:a})},s)}}function uk(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function ck(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&Pd(e,t,r);return EX(e,t),e}function lk(t){return t&&t.__esModule?t:{default:t}}function fk(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)}function dk(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r}function hk(t,e){if(e===null||typeof e!="object"&&typeof e!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof t=="function"?e===t:t.has(e)}function pk(t,e,r){if(e!=null){if(typeof e!="object"&&typeof e!="function")throw new TypeError("Object expected.");var n;if(r){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");n=e[Symbol.asyncDispose]}if(n===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");n=e[Symbol.dispose]}if(typeof n!="function")throw new TypeError("Object not disposable.");t.stack.push({value:e,dispose:n,async:r})}else r&&t.stack.push({async:!0});return e}function mk(t){function e(n){t.error=t.hasError?new CX(n,t.error,"An error was suppressed during disposal."):n,t.hasError=!0}function r(){for(;t.stack.length;){var n=t.stack.pop();try{var i=n.dispose&&n.dispose.call(n.value);if(n.async)return Promise.resolve(i).then(r,function(o){return e(o),r()})}catch(o){e(o)}}if(t.hasError)throw t.error}return r()}var PD,kd,Pd,EX,CX,SX,oc=ut(()=>{PD=function(t,e){return PD=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])},PD(t,e)};kd=function(){return kd=Object.assign||function(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},kd.apply(this,arguments)};Pd=Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]};EX=Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e};CX=typeof SuppressedError=="function"?SuppressedError:function(t,e,r){var n=new Error(r);return n.name="SuppressedError",n.error=t,n.suppressed=e,n};SX={__extends:KA,__assign:kd,__rest:YA,__decorate:JA,__param:XA,__metadata:ZA,__awaiter:QA,__generator:ek,__createBinding:Pd,__exportStar:tk,__values:Td,__read:RD,__spread:rk,__spreadArrays:nk,__spreadArray:ik,__await:Ws,__asyncGenerator:ok,__asyncDelegator:sk,__asyncValues:ak,__makeTemplateObject:uk,__importStar:ck,__importDefault:lk,__classPrivateFieldGet:fk,__classPrivateFieldSet:dk,__classPrivateFieldIn:hk,__addDisposableResource:pk,__disposeResources:mk}});var $D=y(Rd=>{"use strict";Object.defineProperty(Rd,"__esModule",{value:!0});Rd.EscapeCode=void 0;var Tr="\x1B[",gt=class{};Rd.EscapeCode=gt;gt.cursorLeft=()=>`${Tr}G`;gt.cursorUp=(t=1)=>`${Tr}${t}A`;gt.cursorDown=(t=1)=>`${Tr}${t}B`;gt.cursorForward=(t=1)=>`${Tr}${t}C`;gt.cursorBackward=(t=1)=>`${Tr}${t}D`;gt.cursorHide=()=>`${Tr}?25l`;gt.cursorShow=()=>`${Tr}?25h`;gt.eraseLine=()=>`${Tr}2K`;gt.eraseLines=t=>{let e="";for(let r=0;r<t;r++)e+=gt.eraseLine(),r<t-1&&(e+=gt.cursorUp());return`${e}${gt.cursorLeft()}`};gt.eraseUp=()=>`${Tr}1J`;gt.eraseDown=()=>`${Tr}J`;gt.eraseScreen=()=>`${Tr}2J`});var yk=y($d=>{"use strict";Object.defineProperty($d,"__esModule",{value:!0});$d.Cursor=void 0;var xX=(oc(),ke(ic)),FX=xX.__importDefault(Ky()),gk=$D(),Ks=class t{static show(){t.stream.isTTY&&(t._isVisible=!0,t.stream.write(gk.EscapeCode.cursorShow()))}static hide(){t.stream.isTTY&&(t._listenerAttached||((0,FX.default)(()=>{t.show()}),t._listenerAttached=!0),t._isVisible=!1,t.stream.write(gk.EscapeCode.cursorHide()))}static toggle(){t._isVisible?t.hide():t.show()}};$d.Cursor=Ks;Ks.stream=process.stderr;Ks._isVisible=!0;Ks._listenerAttached=!1});var jD=y((Yhe,ID)=>{"use strict";var Dk=t=>Number.isNaN(t)?!1:t>=4352&&(t<=4447||t===9001||t===9002||11904<=t&&t<=12871&&t!==12351||12880<=t&&t<=19903||19968<=t&&t<=42182||43360<=t&&t<=43388||44032<=t&&t<=55203||63744<=t&&t<=64255||65040<=t&&t<=65049||65072<=t&&t<=65131||65281<=t&&t<=65376||65504<=t&&t<=65510||110592<=t&&t<=110593||127488<=t&&t<=127569||131072<=t&&t<=262141);ID.exports=Dk;ID.exports.default=Dk});var wk=y((Jhe,bk)=>{"use strict";var vk="[\uD800-\uDBFF][\uDC00-\uDFFF]",OX=t=>t&&t.exact?new RegExp(`^${vk}$`):new RegExp(vk,"g");bk.exports=OX});var Ek=y((Xhe,_k)=>{"use strict";_k.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}});var ND=y((Zhe,Sk)=>{var sc=Ek(),Ck={};for(let t of Object.keys(sc))Ck[sc[t]]=t;var J={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};Sk.exports=J;for(let t of Object.keys(J)){if(!("channels"in J[t]))throw new Error("missing channels property: "+t);if(!("labels"in J[t]))throw new Error("missing channel labels property: "+t);if(J[t].labels.length!==J[t].channels)throw new Error("channel and label counts mismatch: "+t);let{channels:e,labels:r}=J[t];delete J[t].channels,delete J[t].labels,Object.defineProperty(J[t],"channels",{value:e}),Object.defineProperty(J[t],"labels",{value:r})}J.rgb.hsl=function(t){let e=t[0]/255,r=t[1]/255,n=t[2]/255,i=Math.min(e,r,n),o=Math.max(e,r,n),s=o-i,a,u;o===i?a=0:e===o?a=(r-n)/s:r===o?a=2+(n-e)/s:n===o&&(a=4+(e-r)/s),a=Math.min(a*60,360),a<0&&(a+=360);let c=(i+o)/2;return o===i?u=0:c<=.5?u=s/(o+i):u=s/(2-o-i),[a,u*100,c*100]};J.rgb.hsv=function(t){let e,r,n,i,o,s=t[0]/255,a=t[1]/255,u=t[2]/255,c=Math.max(s,a,u),l=c-Math.min(s,a,u),f=function(h){return(c-h)/6/l+1/2};return l===0?(i=0,o=0):(o=l/c,e=f(s),r=f(a),n=f(u),s===c?i=n-r:a===c?i=1/3+e-n:u===c&&(i=2/3+r-e),i<0?i+=1:i>1&&(i-=1)),[i*360,o*100,c*100]};J.rgb.hwb=function(t){let e=t[0],r=t[1],n=t[2],i=J.rgb.hsl(t)[0],o=1/255*Math.min(e,Math.min(r,n));return n=1-1/255*Math.max(e,Math.max(r,n)),[i,o*100,n*100]};J.rgb.cmyk=function(t){let e=t[0]/255,r=t[1]/255,n=t[2]/255,i=Math.min(1-e,1-r,1-n),o=(1-e-i)/(1-i)||0,s=(1-r-i)/(1-i)||0,a=(1-n-i)/(1-i)||0;return[o*100,s*100,a*100,i*100]};function AX(t,e){return(t[0]-e[0])**2+(t[1]-e[1])**2+(t[2]-e[2])**2}J.rgb.keyword=function(t){let e=Ck[t];if(e)return e;let r=1/0,n;for(let i of Object.keys(sc)){let o=sc[i],s=AX(t,o);s<r&&(r=s,n=i)}return n};J.keyword.rgb=function(t){return sc[t]};J.rgb.xyz=function(t){let e=t[0]/255,r=t[1]/255,n=t[2]/255;e=e>.04045?((e+.055)/1.055)**2.4:e/12.92,r=r>.04045?((r+.055)/1.055)**2.4:r/12.92,n=n>.04045?((n+.055)/1.055)**2.4:n/12.92;let i=e*.4124+r*.3576+n*.1805,o=e*.2126+r*.7152+n*.0722,s=e*.0193+r*.1192+n*.9505;return[i*100,o*100,s*100]};J.rgb.lab=function(t){let e=J.rgb.xyz(t),r=e[0],n=e[1],i=e[2];r/=95.047,n/=100,i/=108.883,r=r>.008856?r**(1/3):7.787*r+16/116,n=n>.008856?n**(1/3):7.787*n+16/116,i=i>.008856?i**(1/3):7.787*i+16/116;let o=116*n-16,s=500*(r-n),a=200*(n-i);return[o,s,a]};J.hsl.rgb=function(t){let e=t[0]/360,r=t[1]/100,n=t[2]/100,i,o,s;if(r===0)return s=n*255,[s,s,s];n<.5?i=n*(1+r):i=n+r-n*r;let a=2*n-i,u=[0,0,0];for(let c=0;c<3;c++)o=e+1/3*-(c-1),o<0&&o++,o>1&&o--,6*o<1?s=a+(i-a)*6*o:2*o<1?s=i:3*o<2?s=a+(i-a)*(2/3-o)*6:s=a,u[c]=s*255;return u};J.hsl.hsv=function(t){let e=t[0],r=t[1]/100,n=t[2]/100,i=r,o=Math.max(n,.01);n*=2,r*=n<=1?n:2-n,i*=o<=1?o:2-o;let s=(n+r)/2,a=n===0?2*i/(o+i):2*r/(n+r);return[e,a*100,s*100]};J.hsv.rgb=function(t){let e=t[0]/60,r=t[1]/100,n=t[2]/100,i=Math.floor(e)%6,o=e-Math.floor(e),s=255*n*(1-r),a=255*n*(1-r*o),u=255*n*(1-r*(1-o));switch(n*=255,i){case 0:return[n,u,s];case 1:return[a,n,s];case 2:return[s,n,u];case 3:return[s,a,n];case 4:return[u,s,n];case 5:return[n,s,a]}};J.hsv.hsl=function(t){let e=t[0],r=t[1]/100,n=t[2]/100,i=Math.max(n,.01),o,s;s=(2-r)*n;let a=(2-r)*i;return o=r*i,o/=a<=1?a:2-a,o=o||0,s/=2,[e,o*100,s*100]};J.hwb.rgb=function(t){let e=t[0]/360,r=t[1]/100,n=t[2]/100,i=r+n,o;i>1&&(r/=i,n/=i);let s=Math.floor(6*e),a=1-n;o=6*e-s,s&1&&(o=1-o);let u=r+o*(a-r),c,l,f;switch(s){default:case 6:case 0:c=a,l=u,f=r;break;case 1:c=u,l=a,f=r;break;case 2:c=r,l=a,f=u;break;case 3:c=r,l=u,f=a;break;case 4:c=u,l=r,f=a;break;case 5:c=a,l=r,f=u;break}return[c*255,l*255,f*255]};J.cmyk.rgb=function(t){let e=t[0]/100,r=t[1]/100,n=t[2]/100,i=t[3]/100,o=1-Math.min(1,e*(1-i)+i),s=1-Math.min(1,r*(1-i)+i),a=1-Math.min(1,n*(1-i)+i);return[o*255,s*255,a*255]};J.xyz.rgb=function(t){let e=t[0]/100,r=t[1]/100,n=t[2]/100,i,o,s;return i=e*3.2406+r*-1.5372+n*-.4986,o=e*-.9689+r*1.8758+n*.0415,s=e*.0557+r*-.204+n*1.057,i=i>.0031308?1.055*i**(1/2.4)-.055:i*12.92,o=o>.0031308?1.055*o**(1/2.4)-.055:o*12.92,s=s>.0031308?1.055*s**(1/2.4)-.055:s*12.92,i=Math.min(Math.max(0,i),1),o=Math.min(Math.max(0,o),1),s=Math.min(Math.max(0,s),1),[i*255,o*255,s*255]};J.xyz.lab=function(t){let e=t[0],r=t[1],n=t[2];e/=95.047,r/=100,n/=108.883,e=e>.008856?e**(1/3):7.787*e+16/116,r=r>.008856?r**(1/3):7.787*r+16/116,n=n>.008856?n**(1/3):7.787*n+16/116;let i=116*r-16,o=500*(e-r),s=200*(r-n);return[i,o,s]};J.lab.xyz=function(t){let e=t[0],r=t[1],n=t[2],i,o,s;o=(e+16)/116,i=r/500+o,s=o-n/200;let a=o**3,u=i**3,c=s**3;return o=a>.008856?a:(o-16/116)/7.787,i=u>.008856?u:(i-16/116)/7.787,s=c>.008856?c:(s-16/116)/7.787,i*=95.047,o*=100,s*=108.883,[i,o,s]};J.lab.lch=function(t){let e=t[0],r=t[1],n=t[2],i;i=Math.atan2(n,r)*360/2/Math.PI,i<0&&(i+=360);let s=Math.sqrt(r*r+n*n);return[e,s,i]};J.lch.lab=function(t){let e=t[0],r=t[1],i=t[2]/360*2*Math.PI,o=r*Math.cos(i),s=r*Math.sin(i);return[e,o,s]};J.rgb.ansi16=function(t,e=null){let[r,n,i]=t,o=e===null?J.rgb.hsv(t)[2]:e;if(o=Math.round(o/50),o===0)return 30;let s=30+(Math.round(i/255)<<2|Math.round(n/255)<<1|Math.round(r/255));return o===2&&(s+=60),s};J.hsv.ansi16=function(t){return J.rgb.ansi16(J.hsv.rgb(t),t[2])};J.rgb.ansi256=function(t){let e=t[0],r=t[1],n=t[2];return e===r&&r===n?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5)};J.ansi16.rgb=function(t){let e=t%10;if(e===0||e===7)return t>50&&(e+=3.5),e=e/10.5*255,[e,e,e];let r=(~~(t>50)+1)*.5,n=(e&1)*r*255,i=(e>>1&1)*r*255,o=(e>>2&1)*r*255;return[n,i,o]};J.ansi256.rgb=function(t){if(t>=232){let o=(t-232)*10+8;return[o,o,o]}t-=16;let e,r=Math.floor(t/36)/5*255,n=Math.floor((e=t%36)/6)/5*255,i=e%6/5*255;return[r,n,i]};J.rgb.hex=function(t){let r=(((Math.round(t[0])&255)<<16)+((Math.round(t[1])&255)<<8)+(Math.round(t[2])&255)).toString(16).toUpperCase();return"000000".substring(r.length)+r};J.hex.rgb=function(t){let e=t.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!e)return[0,0,0];let r=e[0];e[0].length===3&&(r=r.split("").map(a=>a+a).join(""));let n=parseInt(r,16),i=n>>16&255,o=n>>8&255,s=n&255;return[i,o,s]};J.rgb.hcg=function(t){let e=t[0]/255,r=t[1]/255,n=t[2]/255,i=Math.max(Math.max(e,r),n),o=Math.min(Math.min(e,r),n),s=i-o,a,u;return s<1?a=o/(1-s):a=0,s<=0?u=0:i===e?u=(r-n)/s%6:i===r?u=2+(n-e)/s:u=4+(e-r)/s,u/=6,u%=1,[u*360,s*100,a*100]};J.hsl.hcg=function(t){let e=t[1]/100,r=t[2]/100,n=r<.5?2*e*r:2*e*(1-r),i=0;return n<1&&(i=(r-.5*n)/(1-n)),[t[0],n*100,i*100]};J.hsv.hcg=function(t){let e=t[1]/100,r=t[2]/100,n=e*r,i=0;return n<1&&(i=(r-n)/(1-n)),[t[0],n*100,i*100]};J.hcg.rgb=function(t){let e=t[0]/360,r=t[1]/100,n=t[2]/100;if(r===0)return[n*255,n*255,n*255];let i=[0,0,0],o=e%1*6,s=o%1,a=1-s,u=0;switch(Math.floor(o)){case 0:i[0]=1,i[1]=s,i[2]=0;break;case 1:i[0]=a,i[1]=1,i[2]=0;break;case 2:i[0]=0,i[1]=1,i[2]=s;break;case 3:i[0]=0,i[1]=a,i[2]=1;break;case 4:i[0]=s,i[1]=0,i[2]=1;break;default:i[0]=1,i[1]=0,i[2]=a}return u=(1-r)*n,[(r*i[0]+u)*255,(r*i[1]+u)*255,(r*i[2]+u)*255]};J.hcg.hsv=function(t){let e=t[1]/100,r=t[2]/100,n=e+r*(1-e),i=0;return n>0&&(i=e/n),[t[0],i*100,n*100]};J.hcg.hsl=function(t){let e=t[1]/100,n=t[2]/100*(1-e)+.5*e,i=0;return n>0&&n<.5?i=e/(2*n):n>=.5&&n<1&&(i=e/(2*(1-n))),[t[0],i*100,n*100]};J.hcg.hwb=function(t){let e=t[1]/100,r=t[2]/100,n=e+r*(1-e);return[t[0],(n-e)*100,(1-n)*100]};J.hwb.hcg=function(t){let e=t[1]/100,n=1-t[2]/100,i=n-e,o=0;return i<1&&(o=(n-i)/(1-i)),[t[0],i*100,o*100]};J.apple.rgb=function(t){return[t[0]/65535*255,t[1]/65535*255,t[2]/65535*255]};J.rgb.apple=function(t){return[t[0]/255*65535,t[1]/255*65535,t[2]/255*65535]};J.gray.rgb=function(t){return[t[0]/100*255,t[0]/100*255,t[0]/100*255]};J.gray.hsl=function(t){return[0,0,t[0]]};J.gray.hsv=J.gray.hsl;J.gray.hwb=function(t){return[0,100,t[0]]};J.gray.cmyk=function(t){return[0,0,0,t[0]]};J.gray.lab=function(t){return[t[0],0,0]};J.gray.hex=function(t){let e=Math.round(t[0]/100*255)&255,n=((e<<16)+(e<<8)+e).toString(16).toUpperCase();return"000000".substring(n.length)+n};J.rgb.gray=function(t){return[(t[0]+t[1]+t[2])/3/255*100]}});var Fk=y((Qhe,xk)=>{var Id=ND();function kX(){let t={},e=Object.keys(Id);for(let r=e.length,n=0;n<r;n++)t[e[n]]={distance:-1,parent:null};return t}function TX(t){let e=kX(),r=[t];for(e[t].distance=0;r.length;){let n=r.pop(),i=Object.keys(Id[n]);for(let o=i.length,s=0;s<o;s++){let a=i[s],u=e[a];u.distance===-1&&(u.distance=e[n].distance+1,u.parent=n,r.unshift(a))}}return e}function PX(t,e){return function(r){return e(t(r))}}function RX(t,e){let r=[e[t].parent,t],n=Id[e[t].parent][t],i=e[t].parent;for(;e[i].parent;)r.unshift(e[i].parent),n=PX(Id[e[i].parent][i],n),i=e[i].parent;return n.conversion=r,n}xk.exports=function(t){let e=TX(t),r={},n=Object.keys(e);for(let i=n.length,o=0;o<i;o++){let s=n[o];e[s].parent!==null&&(r[s]=RX(s,e))}return r}});var Ak=y((epe,Ok)=>{var LD=ND(),$X=Fk(),Ys={},IX=Object.keys(LD);function jX(t){let e=function(...r){let n=r[0];return n==null?n:(n.length>1&&(r=n),t(r))};return"conversion"in t&&(e.conversion=t.conversion),e}function NX(t){let e=function(...r){let n=r[0];if(n==null)return n;n.length>1&&(r=n);let i=t(r);if(typeof i=="object")for(let o=i.length,s=0;s<o;s++)i[s]=Math.round(i[s]);return i};return"conversion"in t&&(e.conversion=t.conversion),e}IX.forEach(t=>{Ys[t]={},Object.defineProperty(Ys[t],"channels",{value:LD[t].channels}),Object.defineProperty(Ys[t],"labels",{value:LD[t].labels});let e=$X(t);Object.keys(e).forEach(n=>{let i=e[n];Ys[t][n]=NX(i),Ys[t][n].raw=jX(i)})});Ok.exports=Ys});var qD=y((tpe,$k)=>{"use strict";var kk=(t,e)=>(...r)=>`\x1B[${t(...r)+e}m`,Tk=(t,e)=>(...r)=>{let n=t(...r);return`\x1B[${38+e};5;${n}m`},Pk=(t,e)=>(...r)=>{let n=t(...r);return`\x1B[${38+e};2;${n[0]};${n[1]};${n[2]}m`},jd=t=>t,Rk=(t,e,r)=>[t,e,r],Js=(t,e,r)=>{Object.defineProperty(t,e,{get:()=>{let n=r();return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0}),n},enumerable:!0,configurable:!0})},BD,Xs=(t,e,r,n)=>{BD===void 0&&(BD=Ak());let i=n?10:0,o={};for(let[s,a]of Object.entries(BD)){let u=s==="ansi16"?"ansi":s;s===e?o[u]=t(r,i):typeof a=="object"&&(o[u]=t(a[e],i))}return o};function LX(){let t=new Map,e={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};e.color.gray=e.color.blackBright,e.bgColor.bgGray=e.bgColor.bgBlackBright,e.color.grey=e.color.blackBright,e.bgColor.bgGrey=e.bgColor.bgBlackBright;for(let[r,n]of Object.entries(e)){for(let[i,o]of Object.entries(n))e[i]={open:`\x1B[${o[0]}m`,close:`\x1B[${o[1]}m`},n[i]=e[i],t.set(o[0],o[1]);Object.defineProperty(e,r,{value:n,enumerable:!1})}return Object.defineProperty(e,"codes",{value:t,enumerable:!1}),e.color.close="\x1B[39m",e.bgColor.close="\x1B[49m",Js(e.color,"ansi",()=>Xs(kk,"ansi16",jd,!1)),Js(e.color,"ansi256",()=>Xs(Tk,"ansi256",jd,!1)),Js(e.color,"ansi16m",()=>Xs(Pk,"rgb",Rk,!1)),Js(e.bgColor,"ansi",()=>Xs(kk,"ansi16",jd,!0)),Js(e.bgColor,"ansi256",()=>Xs(Tk,"ansi256",jd,!0)),Js(e.bgColor,"ansi16m",()=>Xs(Pk,"rgb",Rk,!0)),e}Object.defineProperty($k,"exports",{enumerable:!0,get:LX})});var Bk=y((rpe,Lk)=>{"use strict";var BX=jD(),qX=wk(),Ik=qD(),Nk=["\x1B","\x9B"],Nd=t=>`${Nk[0]}[${t}m`,jk=(t,e,r)=>{let n=[];t=[...t];for(let i of t){let o=i;i.includes(";")&&(i=i.split(";")[0][0]+"0");let s=Ik.codes.get(Number.parseInt(i,10));if(s){let a=t.indexOf(s.toString());a===-1?n.push(Nd(e?s:o)):t.splice(a,1)}else if(e){n.push(Nd(0));break}else n.push(Nd(o))}if(e&&(n=n.filter((i,o)=>n.indexOf(i)===o),r!==void 0)){let i=Nd(Ik.codes.get(Number.parseInt(r,10)));n=n.reduce((o,s)=>s===i?[s,...o]:[...o,s],[])}return n.join("")};Lk.exports=(t,e,r)=>{let n=[...t],i=[],o=typeof r=="number"?r:n.length,s=!1,a,u=0,c="";for(let[l,f]of n.entries()){let h=!1;if(Nk.includes(f)){let d=/\d[^m]*/.exec(t.slice(l,l+18));a=d&&d.length>0?d[0]:void 0,u<o&&(s=!0,a!==void 0&&i.push(a))}else s&&f==="m"&&(s=!1,h=!0);if(!s&&!h&&u++,!qX({exact:!0}).test(f)&&BX(f.codePointAt())&&(u++,typeof r!="number"&&o++),u>e&&u<=o)c+=f;else if(u===e&&!s&&a!==void 0)c=jk(i);else if(u>=o){c+=jk(i,!0,a);break}}return c}});var Mk=y((npe,qk)=>{"use strict";qk.exports=({onlyFirst:t=!1}={})=>{let e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(e,t?void 0:"g")}});var Ld=y((ipe,Uk)=>{"use strict";var MX=Mk();Uk.exports=t=>typeof t=="string"?t.replace(MX(),""):t});var Hk=y((ope,Vk)=>{"use strict";Vk.exports=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\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\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])|\uD83C[\uDF3E\uDF73\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])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\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])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\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\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\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\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFD])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83C\uDFF4\u200D\u2620)\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDF6\uD83C\uDDE6|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDBB\uDDD2-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\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\uDEEB\uDEEC\uDEF4-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])|(?:[#\*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\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\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])\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[\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g}});var UD=y((spe,MD)=>{"use strict";var UX=Ld(),VX=jD(),HX=Hk(),zk=t=>{if(typeof t!="string"||t.length===0||(t=UX(t),t.length===0))return 0;t=t.replace(HX()," ");let e=0;for(let r=0;r<t.length;r++){let n=t.codePointAt(r);n<=31||n>=127&&n<=159||n>=768&&n<=879||(n>65535&&r++,e+=VX(n)?2:1)}return e};MD.exports=zk;MD.exports.default=zk});var Xk=y((ape,Jk)=>{"use strict";var ac=UD(),zX=Ld(),GX=qD(),Bd=new Set(["\x1B","\x9B"]),WX=39,HD="\x07",Kk="[",KX="]",Yk="m",zD=`${KX}8;;`,Gk=t=>`${Bd.values().next().value}${Kk}${t}${Yk}`,Wk=t=>`${Bd.values().next().value}${zD}${t}${HD}`,YX=t=>t.split(" ").map(e=>ac(e)),VD=(t,e,r)=>{let n=[...e],i=!1,o=!1,s=ac(zX(t[t.length-1]));for(let[a,u]of n.entries()){let c=ac(u);if(s+c<=r?t[t.length-1]+=u:(t.push(u),s=0),Bd.has(u)&&(i=!0,o=n.slice(a+1).join("").startsWith(zD)),i){o?u===HD&&(i=!1,o=!1):u===Yk&&(i=!1);continue}s+=c,s===r&&a<n.length-1&&(t.push(""),s=0)}!s&&t[t.length-1].length>0&&t.length>1&&(t[t.length-2]+=t.pop())},JX=t=>{let e=t.split(" "),r=e.length;for(;r>0&&!(ac(e[r-1])>0);)r--;return r===e.length?t:e.slice(0,r).join(" ")+e.slice(r).join("")},XX=(t,e,r={})=>{if(r.trim!==!1&&t.trim()==="")return"";let n="",i,o,s=YX(t),a=[""];for(let[c,l]of t.split(" ").entries()){r.trim!==!1&&(a[a.length-1]=a[a.length-1].trimStart());let f=ac(a[a.length-1]);if(c!==0&&(f>=e&&(r.wordWrap===!1||r.trim===!1)&&(a.push(""),f=0),(f>0||r.trim===!1)&&(a[a.length-1]+=" ",f++)),r.hard&&s[c]>e){let h=e-f,d=1+Math.floor((s[c]-h-1)/e);Math.floor((s[c]-1)/e)<d&&a.push(""),VD(a,l,e);continue}if(f+s[c]>e&&f>0&&s[c]>0){if(r.wordWrap===!1&&f<e){VD(a,l,e);continue}a.push("")}if(f+s[c]>e&&r.wordWrap===!1){VD(a,l,e);continue}a[a.length-1]+=l}r.trim!==!1&&(a=a.map(JX));let u=[...a.join(`
50
- `)];for(let[c,l]of u.entries()){if(n+=l,Bd.has(l)){let{groups:h}=new RegExp(`(?:\\${Kk}(?<code>\\d+)m|\\${zD}(?<uri>.*)${HD})`).exec(u.slice(c).join(""))||{groups:{}};if(h.code!==void 0){let d=Number.parseFloat(h.code);i=d===WX?void 0:d}else h.uri!==void 0&&(o=h.uri.length===0?void 0:h.uri)}let f=GX.codes.get(Number(i));u[c+1]===`
47
+ `+o),t.push(i+"m+"+Fd.exports.humanize(this.diff)+"\x1B[0m")}else t[0]=fX()+e+" "+t[0]}function fX(){return mt.inspectOpts.hideDate?"":new Date().toISOString()+" "}function dX(...t){return process.stderr.write(xd.formatWithOptions(mt.inspectOpts,...t)+`
48
+ `)}function hX(t){t?process.env.DEBUG=t:delete process.env.DEBUG}function pX(){return process.env.DEBUG}function mX(t){t.inspectOpts={};let e=Object.keys(mt.inspectOpts);for(let r=0;r<e.length;r++)t.inspectOpts[e[r]]=mt.inspectOpts[e[r]]}Fd.exports=xD()(mt);var{formatters:LA}=Fd.exports;LA.o=function(t){return this.inspectOpts.colors=this.useColors,xd.inspect(t,this.inspectOpts).split(`
49
+ `).map(e=>e.trim()).join(" ")};LA.O=function(t){return this.inspectOpts.colors=this.useColors,xd.inspect(t,this.inspectOpts)}});var qA=y((Hhe,kD)=>{typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?kD.exports=RA():kD.exports=BA()});var WA=y((zhe,GA)=>{"use strict";var TD,UA,VA,HA,zA=!0;typeof process<"u"&&({FORCE_COLOR:TD,NODE_DISABLE_COLORS:UA,NO_COLOR:VA,TERM:HA}=process.env||{},zA=process.stdout&&process.stdout.isTTY);var _e={enabled:!UA&&VA==null&&HA!=="dumb"&&(TD!=null&&TD!=="0"||zA),reset:Oe(0,0),bold:Oe(1,22),dim:Oe(2,22),italic:Oe(3,23),underline:Oe(4,24),inverse:Oe(7,27),hidden:Oe(8,28),strikethrough:Oe(9,29),black:Oe(30,39),red:Oe(31,39),green:Oe(32,39),yellow:Oe(33,39),blue:Oe(34,39),magenta:Oe(35,39),cyan:Oe(36,39),white:Oe(37,39),gray:Oe(90,39),grey:Oe(90,39),bgBlack:Oe(40,49),bgRed:Oe(41,49),bgGreen:Oe(42,49),bgYellow:Oe(43,49),bgBlue:Oe(44,49),bgMagenta:Oe(45,49),bgCyan:Oe(46,49),bgWhite:Oe(47,49)};function MA(t,e){let r=0,n,i="",o="";for(;r<t.length;r++)n=t[r],i+=n.open,o+=n.close,~e.indexOf(n.close)&&(e=e.replace(n.rgx,n.close+n.open));return i+e+o}function gX(t,e){let r={has:t,keys:e};return r.reset=_e.reset.bind(r),r.bold=_e.bold.bind(r),r.dim=_e.dim.bind(r),r.italic=_e.italic.bind(r),r.underline=_e.underline.bind(r),r.inverse=_e.inverse.bind(r),r.hidden=_e.hidden.bind(r),r.strikethrough=_e.strikethrough.bind(r),r.black=_e.black.bind(r),r.red=_e.red.bind(r),r.green=_e.green.bind(r),r.yellow=_e.yellow.bind(r),r.blue=_e.blue.bind(r),r.magenta=_e.magenta.bind(r),r.cyan=_e.cyan.bind(r),r.white=_e.white.bind(r),r.gray=_e.gray.bind(r),r.grey=_e.grey.bind(r),r.bgBlack=_e.bgBlack.bind(r),r.bgRed=_e.bgRed.bind(r),r.bgGreen=_e.bgGreen.bind(r),r.bgYellow=_e.bgYellow.bind(r),r.bgBlue=_e.bgBlue.bind(r),r.bgMagenta=_e.bgMagenta.bind(r),r.bgCyan=_e.bgCyan.bind(r),r.bgWhite=_e.bgWhite.bind(r),r}function Oe(t,e){let r={open:`\x1B[${t}m`,close:`\x1B[${e}m`,rgx:new RegExp(`\\x1b\\[${e}m`,"g")};return function(n){return this!==void 0&&this.has!==void 0?(~this.has.indexOf(t)||(this.has.push(t),this.keys.push(r)),n===void 0?this:_e.enabled?MA(this.keys,n+""):n+""):n===void 0?gX([t],[r]):_e.enabled?MA([r],n+""):n+""}}GA.exports=_e});var Gs=y(et=>{"use strict";Object.defineProperty(et,"__esModule",{value:!0});et.ancillary=et.failure=et.success=et.input=et.weak=et.strong=void 0;var yX=(Cn(),ke(En)),Yr=yX.__importDefault(WA());et.strong=Yr.default.bold;et.weak=Yr.default.dim;et.input=Yr.default.cyan;et.success=Yr.default.green;et.failure=Yr.default.red;et.ancillary=Yr.default.cyan;var DX={strong:et.strong,weak:et.weak,input:et.input,success:et.success,failure:et.failure,ancillary:et.ancillary,log:{DEBUG:Yr.default.magenta,INFO:Yr.default.cyan,WARN:Yr.default.yellow,ERROR:Yr.default.red}};et.default=DX});var ic={};mn(ic,{__addDisposableResource:()=>pk,__assign:()=>Od,__asyncDelegator:()=>sk,__asyncGenerator:()=>ok,__asyncValues:()=>ak,__await:()=>Ws,__awaiter:()=>QA,__classPrivateFieldGet:()=>fk,__classPrivateFieldIn:()=>hk,__classPrivateFieldSet:()=>dk,__createBinding:()=>kd,__decorate:()=>JA,__disposeResources:()=>mk,__esDecorate:()=>vX,__exportStar:()=>tk,__extends:()=>KA,__generator:()=>ek,__importDefault:()=>lk,__importStar:()=>ck,__makeTemplateObject:()=>uk,__metadata:()=>ZA,__param:()=>XA,__propKey:()=>wX,__read:()=>RD,__rest:()=>YA,__runInitializers:()=>bX,__setFunctionName:()=>_X,__spread:()=>rk,__spreadArray:()=>ik,__spreadArrays:()=>nk,__values:()=>Ad,default:()=>SX});function KA(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");PD(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}function YA(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}function JA(t,e,r,n){var i=arguments.length,o=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,r,o):s(e,r))||o);return i>3&&o&&Object.defineProperty(e,r,o),o}function XA(t,e){return function(r,n){e(r,n,t)}}function vX(t,e,r,n,i,o){function s(w){if(w!==void 0&&typeof w!="function")throw new TypeError("Function expected");return w}for(var a=n.kind,u=a==="getter"?"get":a==="setter"?"set":"value",c=!e&&t?n.static?t:t.prototype:null,l=e||(c?Object.getOwnPropertyDescriptor(c,n.name):{}),f,h=!1,d=r.length-1;d>=0;d--){var p={};for(var v in n)p[v]=v==="access"?{}:n[v];for(var v in n.access)p.access[v]=n.access[v];p.addInitializer=function(w){if(h)throw new TypeError("Cannot add initializers after decoration has completed");o.push(s(w||null))};var g=(0,r[d])(a==="accessor"?{get:l.get,set:l.set}:l[u],p);if(a==="accessor"){if(g===void 0)continue;if(g===null||typeof g!="object")throw new TypeError("Object expected");(f=s(g.get))&&(l.get=f),(f=s(g.set))&&(l.set=f),(f=s(g.init))&&i.unshift(f)}else(f=s(g))&&(a==="field"?i.unshift(f):l[u]=f)}c&&Object.defineProperty(c,n.name,l),h=!0}function bX(t,e,r){for(var n=arguments.length>2,i=0;i<e.length;i++)r=n?e[i].call(t,r):e[i].call(t);return n?r:void 0}function wX(t){return typeof t=="symbol"?t:"".concat(t)}function _X(t,e,r){return typeof e=="symbol"&&(e=e.description?"[".concat(e.description,"]"):""),Object.defineProperty(t,"name",{configurable:!0,value:r?"".concat(r," ",e):e})}function ZA(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function QA(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(l){try{c(n.next(l))}catch(f){s(f)}}function u(l){try{c(n.throw(l))}catch(f){s(f)}}function c(l){l.done?o(l.value):i(l.value).then(a,u)}c((n=n.apply(t,e||[])).next())})}function ek(t,e){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(c){return function(l){return u([c,l])}}function u(c){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,c[0]&&(r=0)),r;)try{if(n=1,i&&(o=c[0]&2?i.return:c[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,c[1])).done)return o;switch(i=0,o&&(c=[c[0]&2,o.value]),c[0]){case 0:case 1:o=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,i=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]<o[3])){r.label=c[1];break}if(c[0]===6&&r.label<o[1]){r.label=o[1],o=c;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(c);break}o[2]&&r.ops.pop(),r.trys.pop();continue}c=e.call(t,r)}catch(l){c=[6,l],i=0}finally{n=o=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function tk(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&kd(e,t,r)}function Ad(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function RD(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,o=[],s;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(a){s={error:a}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return o}function rk(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(RD(arguments[e]));return t}function nk(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var n=Array(t),i=0,e=0;e<r;e++)for(var o=arguments[e],s=0,a=o.length;s<a;s++,i++)n[i]=o[s];return n}function ik(t,e,r){if(r||arguments.length===2)for(var n=0,i=e.length,o;n<i;n++)(o||!(n in e))&&(o||(o=Array.prototype.slice.call(e,0,n)),o[n]=e[n]);return t.concat(o||Array.prototype.slice.call(e))}function Ws(t){return this instanceof Ws?(this.v=t,this):new Ws(t)}function ok(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(t,e||[]),i,o=[];return i={},s("next"),s("throw"),s("return"),i[Symbol.asyncIterator]=function(){return this},i;function s(h){n[h]&&(i[h]=function(d){return new Promise(function(p,v){o.push([h,d,p,v])>1||a(h,d)})})}function a(h,d){try{u(n[h](d))}catch(p){f(o[0][3],p)}}function u(h){h.value instanceof Ws?Promise.resolve(h.value.v).then(c,l):f(o[0][2],h)}function c(h){a("next",h)}function l(h){a("throw",h)}function f(h,d){h(d),o.shift(),o.length&&a(o[0][0],o[0][1])}}function sk(t){var e,r;return e={},n("next"),n("throw",function(i){throw i}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(i,o){e[i]=t[i]?function(s){return(r=!r)?{value:Ws(t[i](s)),done:!1}:o?o(s):s}:o}}function ak(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof Ad=="function"?Ad(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(o){r[o]=t[o]&&function(s){return new Promise(function(a,u){s=t[o](s),i(a,u,s.done,s.value)})}}function i(o,s,a,u){Promise.resolve(u).then(function(c){o({value:c,done:a})},s)}}function uk(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function ck(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&kd(e,t,r);return EX(e,t),e}function lk(t){return t&&t.__esModule?t:{default:t}}function fk(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)}function dk(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r}function hk(t,e){if(e===null||typeof e!="object"&&typeof e!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof t=="function"?e===t:t.has(e)}function pk(t,e,r){if(e!=null){if(typeof e!="object"&&typeof e!="function")throw new TypeError("Object expected.");var n;if(r){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");n=e[Symbol.asyncDispose]}if(n===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");n=e[Symbol.dispose]}if(typeof n!="function")throw new TypeError("Object not disposable.");t.stack.push({value:e,dispose:n,async:r})}else r&&t.stack.push({async:!0});return e}function mk(t){function e(n){t.error=t.hasError?new CX(n,t.error,"An error was suppressed during disposal."):n,t.hasError=!0}function r(){for(;t.stack.length;){var n=t.stack.pop();try{var i=n.dispose&&n.dispose.call(n.value);if(n.async)return Promise.resolve(i).then(r,function(o){return e(o),r()})}catch(o){e(o)}}if(t.hasError)throw t.error}return r()}var PD,Od,kd,EX,CX,SX,oc=ut(()=>{PD=function(t,e){return PD=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])},PD(t,e)};Od=function(){return Od=Object.assign||function(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},Od.apply(this,arguments)};kd=Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]};EX=Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e};CX=typeof SuppressedError=="function"?SuppressedError:function(t,e,r){var n=new Error(r);return n.name="SuppressedError",n.error=t,n.suppressed=e,n};SX={__extends:KA,__assign:Od,__rest:YA,__decorate:JA,__param:XA,__metadata:ZA,__awaiter:QA,__generator:ek,__createBinding:kd,__exportStar:tk,__values:Ad,__read:RD,__spread:rk,__spreadArrays:nk,__spreadArray:ik,__await:Ws,__asyncGenerator:ok,__asyncDelegator:sk,__asyncValues:ak,__makeTemplateObject:uk,__importStar:ck,__importDefault:lk,__classPrivateFieldGet:fk,__classPrivateFieldSet:dk,__classPrivateFieldIn:hk,__addDisposableResource:pk,__disposeResources:mk}});var $D=y(Td=>{"use strict";Object.defineProperty(Td,"__esModule",{value:!0});Td.EscapeCode=void 0;var Tr="\x1B[",gt=class{};Td.EscapeCode=gt;gt.cursorLeft=()=>`${Tr}G`;gt.cursorUp=(t=1)=>`${Tr}${t}A`;gt.cursorDown=(t=1)=>`${Tr}${t}B`;gt.cursorForward=(t=1)=>`${Tr}${t}C`;gt.cursorBackward=(t=1)=>`${Tr}${t}D`;gt.cursorHide=()=>`${Tr}?25l`;gt.cursorShow=()=>`${Tr}?25h`;gt.eraseLine=()=>`${Tr}2K`;gt.eraseLines=t=>{let e="";for(let r=0;r<t;r++)e+=gt.eraseLine(),r<t-1&&(e+=gt.cursorUp());return`${e}${gt.cursorLeft()}`};gt.eraseUp=()=>`${Tr}1J`;gt.eraseDown=()=>`${Tr}J`;gt.eraseScreen=()=>`${Tr}2J`});var yk=y(Pd=>{"use strict";Object.defineProperty(Pd,"__esModule",{value:!0});Pd.Cursor=void 0;var xX=(oc(),ke(ic)),FX=xX.__importDefault(Ky()),gk=$D(),Ks=class t{static show(){t.stream.isTTY&&(t._isVisible=!0,t.stream.write(gk.EscapeCode.cursorShow()))}static hide(){t.stream.isTTY&&(t._listenerAttached||((0,FX.default)(()=>{t.show()}),t._listenerAttached=!0),t._isVisible=!1,t.stream.write(gk.EscapeCode.cursorHide()))}static toggle(){t._isVisible?t.hide():t.show()}};Pd.Cursor=Ks;Ks.stream=process.stderr;Ks._isVisible=!0;Ks._listenerAttached=!1});var jD=y((Yhe,ID)=>{"use strict";var Dk=t=>Number.isNaN(t)?!1:t>=4352&&(t<=4447||t===9001||t===9002||11904<=t&&t<=12871&&t!==12351||12880<=t&&t<=19903||19968<=t&&t<=42182||43360<=t&&t<=43388||44032<=t&&t<=55203||63744<=t&&t<=64255||65040<=t&&t<=65049||65072<=t&&t<=65131||65281<=t&&t<=65376||65504<=t&&t<=65510||110592<=t&&t<=110593||127488<=t&&t<=127569||131072<=t&&t<=262141);ID.exports=Dk;ID.exports.default=Dk});var wk=y((Jhe,bk)=>{"use strict";var vk="[\uD800-\uDBFF][\uDC00-\uDFFF]",OX=t=>t&&t.exact?new RegExp(`^${vk}$`):new RegExp(vk,"g");bk.exports=OX});var Ek=y((Xhe,_k)=>{"use strict";_k.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}});var ND=y((Zhe,Sk)=>{var sc=Ek(),Ck={};for(let t of Object.keys(sc))Ck[sc[t]]=t;var J={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};Sk.exports=J;for(let t of Object.keys(J)){if(!("channels"in J[t]))throw new Error("missing channels property: "+t);if(!("labels"in J[t]))throw new Error("missing channel labels property: "+t);if(J[t].labels.length!==J[t].channels)throw new Error("channel and label counts mismatch: "+t);let{channels:e,labels:r}=J[t];delete J[t].channels,delete J[t].labels,Object.defineProperty(J[t],"channels",{value:e}),Object.defineProperty(J[t],"labels",{value:r})}J.rgb.hsl=function(t){let e=t[0]/255,r=t[1]/255,n=t[2]/255,i=Math.min(e,r,n),o=Math.max(e,r,n),s=o-i,a,u;o===i?a=0:e===o?a=(r-n)/s:r===o?a=2+(n-e)/s:n===o&&(a=4+(e-r)/s),a=Math.min(a*60,360),a<0&&(a+=360);let c=(i+o)/2;return o===i?u=0:c<=.5?u=s/(o+i):u=s/(2-o-i),[a,u*100,c*100]};J.rgb.hsv=function(t){let e,r,n,i,o,s=t[0]/255,a=t[1]/255,u=t[2]/255,c=Math.max(s,a,u),l=c-Math.min(s,a,u),f=function(h){return(c-h)/6/l+1/2};return l===0?(i=0,o=0):(o=l/c,e=f(s),r=f(a),n=f(u),s===c?i=n-r:a===c?i=1/3+e-n:u===c&&(i=2/3+r-e),i<0?i+=1:i>1&&(i-=1)),[i*360,o*100,c*100]};J.rgb.hwb=function(t){let e=t[0],r=t[1],n=t[2],i=J.rgb.hsl(t)[0],o=1/255*Math.min(e,Math.min(r,n));return n=1-1/255*Math.max(e,Math.max(r,n)),[i,o*100,n*100]};J.rgb.cmyk=function(t){let e=t[0]/255,r=t[1]/255,n=t[2]/255,i=Math.min(1-e,1-r,1-n),o=(1-e-i)/(1-i)||0,s=(1-r-i)/(1-i)||0,a=(1-n-i)/(1-i)||0;return[o*100,s*100,a*100,i*100]};function AX(t,e){return(t[0]-e[0])**2+(t[1]-e[1])**2+(t[2]-e[2])**2}J.rgb.keyword=function(t){let e=Ck[t];if(e)return e;let r=1/0,n;for(let i of Object.keys(sc)){let o=sc[i],s=AX(t,o);s<r&&(r=s,n=i)}return n};J.keyword.rgb=function(t){return sc[t]};J.rgb.xyz=function(t){let e=t[0]/255,r=t[1]/255,n=t[2]/255;e=e>.04045?((e+.055)/1.055)**2.4:e/12.92,r=r>.04045?((r+.055)/1.055)**2.4:r/12.92,n=n>.04045?((n+.055)/1.055)**2.4:n/12.92;let i=e*.4124+r*.3576+n*.1805,o=e*.2126+r*.7152+n*.0722,s=e*.0193+r*.1192+n*.9505;return[i*100,o*100,s*100]};J.rgb.lab=function(t){let e=J.rgb.xyz(t),r=e[0],n=e[1],i=e[2];r/=95.047,n/=100,i/=108.883,r=r>.008856?r**(1/3):7.787*r+16/116,n=n>.008856?n**(1/3):7.787*n+16/116,i=i>.008856?i**(1/3):7.787*i+16/116;let o=116*n-16,s=500*(r-n),a=200*(n-i);return[o,s,a]};J.hsl.rgb=function(t){let e=t[0]/360,r=t[1]/100,n=t[2]/100,i,o,s;if(r===0)return s=n*255,[s,s,s];n<.5?i=n*(1+r):i=n+r-n*r;let a=2*n-i,u=[0,0,0];for(let c=0;c<3;c++)o=e+1/3*-(c-1),o<0&&o++,o>1&&o--,6*o<1?s=a+(i-a)*6*o:2*o<1?s=i:3*o<2?s=a+(i-a)*(2/3-o)*6:s=a,u[c]=s*255;return u};J.hsl.hsv=function(t){let e=t[0],r=t[1]/100,n=t[2]/100,i=r,o=Math.max(n,.01);n*=2,r*=n<=1?n:2-n,i*=o<=1?o:2-o;let s=(n+r)/2,a=n===0?2*i/(o+i):2*r/(n+r);return[e,a*100,s*100]};J.hsv.rgb=function(t){let e=t[0]/60,r=t[1]/100,n=t[2]/100,i=Math.floor(e)%6,o=e-Math.floor(e),s=255*n*(1-r),a=255*n*(1-r*o),u=255*n*(1-r*(1-o));switch(n*=255,i){case 0:return[n,u,s];case 1:return[a,n,s];case 2:return[s,n,u];case 3:return[s,a,n];case 4:return[u,s,n];case 5:return[n,s,a]}};J.hsv.hsl=function(t){let e=t[0],r=t[1]/100,n=t[2]/100,i=Math.max(n,.01),o,s;s=(2-r)*n;let a=(2-r)*i;return o=r*i,o/=a<=1?a:2-a,o=o||0,s/=2,[e,o*100,s*100]};J.hwb.rgb=function(t){let e=t[0]/360,r=t[1]/100,n=t[2]/100,i=r+n,o;i>1&&(r/=i,n/=i);let s=Math.floor(6*e),a=1-n;o=6*e-s,s&1&&(o=1-o);let u=r+o*(a-r),c,l,f;switch(s){default:case 6:case 0:c=a,l=u,f=r;break;case 1:c=u,l=a,f=r;break;case 2:c=r,l=a,f=u;break;case 3:c=r,l=u,f=a;break;case 4:c=u,l=r,f=a;break;case 5:c=a,l=r,f=u;break}return[c*255,l*255,f*255]};J.cmyk.rgb=function(t){let e=t[0]/100,r=t[1]/100,n=t[2]/100,i=t[3]/100,o=1-Math.min(1,e*(1-i)+i),s=1-Math.min(1,r*(1-i)+i),a=1-Math.min(1,n*(1-i)+i);return[o*255,s*255,a*255]};J.xyz.rgb=function(t){let e=t[0]/100,r=t[1]/100,n=t[2]/100,i,o,s;return i=e*3.2406+r*-1.5372+n*-.4986,o=e*-.9689+r*1.8758+n*.0415,s=e*.0557+r*-.204+n*1.057,i=i>.0031308?1.055*i**(1/2.4)-.055:i*12.92,o=o>.0031308?1.055*o**(1/2.4)-.055:o*12.92,s=s>.0031308?1.055*s**(1/2.4)-.055:s*12.92,i=Math.min(Math.max(0,i),1),o=Math.min(Math.max(0,o),1),s=Math.min(Math.max(0,s),1),[i*255,o*255,s*255]};J.xyz.lab=function(t){let e=t[0],r=t[1],n=t[2];e/=95.047,r/=100,n/=108.883,e=e>.008856?e**(1/3):7.787*e+16/116,r=r>.008856?r**(1/3):7.787*r+16/116,n=n>.008856?n**(1/3):7.787*n+16/116;let i=116*r-16,o=500*(e-r),s=200*(r-n);return[i,o,s]};J.lab.xyz=function(t){let e=t[0],r=t[1],n=t[2],i,o,s;o=(e+16)/116,i=r/500+o,s=o-n/200;let a=o**3,u=i**3,c=s**3;return o=a>.008856?a:(o-16/116)/7.787,i=u>.008856?u:(i-16/116)/7.787,s=c>.008856?c:(s-16/116)/7.787,i*=95.047,o*=100,s*=108.883,[i,o,s]};J.lab.lch=function(t){let e=t[0],r=t[1],n=t[2],i;i=Math.atan2(n,r)*360/2/Math.PI,i<0&&(i+=360);let s=Math.sqrt(r*r+n*n);return[e,s,i]};J.lch.lab=function(t){let e=t[0],r=t[1],i=t[2]/360*2*Math.PI,o=r*Math.cos(i),s=r*Math.sin(i);return[e,o,s]};J.rgb.ansi16=function(t,e=null){let[r,n,i]=t,o=e===null?J.rgb.hsv(t)[2]:e;if(o=Math.round(o/50),o===0)return 30;let s=30+(Math.round(i/255)<<2|Math.round(n/255)<<1|Math.round(r/255));return o===2&&(s+=60),s};J.hsv.ansi16=function(t){return J.rgb.ansi16(J.hsv.rgb(t),t[2])};J.rgb.ansi256=function(t){let e=t[0],r=t[1],n=t[2];return e===r&&r===n?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5)};J.ansi16.rgb=function(t){let e=t%10;if(e===0||e===7)return t>50&&(e+=3.5),e=e/10.5*255,[e,e,e];let r=(~~(t>50)+1)*.5,n=(e&1)*r*255,i=(e>>1&1)*r*255,o=(e>>2&1)*r*255;return[n,i,o]};J.ansi256.rgb=function(t){if(t>=232){let o=(t-232)*10+8;return[o,o,o]}t-=16;let e,r=Math.floor(t/36)/5*255,n=Math.floor((e=t%36)/6)/5*255,i=e%6/5*255;return[r,n,i]};J.rgb.hex=function(t){let r=(((Math.round(t[0])&255)<<16)+((Math.round(t[1])&255)<<8)+(Math.round(t[2])&255)).toString(16).toUpperCase();return"000000".substring(r.length)+r};J.hex.rgb=function(t){let e=t.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!e)return[0,0,0];let r=e[0];e[0].length===3&&(r=r.split("").map(a=>a+a).join(""));let n=parseInt(r,16),i=n>>16&255,o=n>>8&255,s=n&255;return[i,o,s]};J.rgb.hcg=function(t){let e=t[0]/255,r=t[1]/255,n=t[2]/255,i=Math.max(Math.max(e,r),n),o=Math.min(Math.min(e,r),n),s=i-o,a,u;return s<1?a=o/(1-s):a=0,s<=0?u=0:i===e?u=(r-n)/s%6:i===r?u=2+(n-e)/s:u=4+(e-r)/s,u/=6,u%=1,[u*360,s*100,a*100]};J.hsl.hcg=function(t){let e=t[1]/100,r=t[2]/100,n=r<.5?2*e*r:2*e*(1-r),i=0;return n<1&&(i=(r-.5*n)/(1-n)),[t[0],n*100,i*100]};J.hsv.hcg=function(t){let e=t[1]/100,r=t[2]/100,n=e*r,i=0;return n<1&&(i=(r-n)/(1-n)),[t[0],n*100,i*100]};J.hcg.rgb=function(t){let e=t[0]/360,r=t[1]/100,n=t[2]/100;if(r===0)return[n*255,n*255,n*255];let i=[0,0,0],o=e%1*6,s=o%1,a=1-s,u=0;switch(Math.floor(o)){case 0:i[0]=1,i[1]=s,i[2]=0;break;case 1:i[0]=a,i[1]=1,i[2]=0;break;case 2:i[0]=0,i[1]=1,i[2]=s;break;case 3:i[0]=0,i[1]=a,i[2]=1;break;case 4:i[0]=s,i[1]=0,i[2]=1;break;default:i[0]=1,i[1]=0,i[2]=a}return u=(1-r)*n,[(r*i[0]+u)*255,(r*i[1]+u)*255,(r*i[2]+u)*255]};J.hcg.hsv=function(t){let e=t[1]/100,r=t[2]/100,n=e+r*(1-e),i=0;return n>0&&(i=e/n),[t[0],i*100,n*100]};J.hcg.hsl=function(t){let e=t[1]/100,n=t[2]/100*(1-e)+.5*e,i=0;return n>0&&n<.5?i=e/(2*n):n>=.5&&n<1&&(i=e/(2*(1-n))),[t[0],i*100,n*100]};J.hcg.hwb=function(t){let e=t[1]/100,r=t[2]/100,n=e+r*(1-e);return[t[0],(n-e)*100,(1-n)*100]};J.hwb.hcg=function(t){let e=t[1]/100,n=1-t[2]/100,i=n-e,o=0;return i<1&&(o=(n-i)/(1-i)),[t[0],i*100,o*100]};J.apple.rgb=function(t){return[t[0]/65535*255,t[1]/65535*255,t[2]/65535*255]};J.rgb.apple=function(t){return[t[0]/255*65535,t[1]/255*65535,t[2]/255*65535]};J.gray.rgb=function(t){return[t[0]/100*255,t[0]/100*255,t[0]/100*255]};J.gray.hsl=function(t){return[0,0,t[0]]};J.gray.hsv=J.gray.hsl;J.gray.hwb=function(t){return[0,100,t[0]]};J.gray.cmyk=function(t){return[0,0,0,t[0]]};J.gray.lab=function(t){return[t[0],0,0]};J.gray.hex=function(t){let e=Math.round(t[0]/100*255)&255,n=((e<<16)+(e<<8)+e).toString(16).toUpperCase();return"000000".substring(n.length)+n};J.rgb.gray=function(t){return[(t[0]+t[1]+t[2])/3/255*100]}});var Fk=y((Qhe,xk)=>{var Rd=ND();function kX(){let t={},e=Object.keys(Rd);for(let r=e.length,n=0;n<r;n++)t[e[n]]={distance:-1,parent:null};return t}function TX(t){let e=kX(),r=[t];for(e[t].distance=0;r.length;){let n=r.pop(),i=Object.keys(Rd[n]);for(let o=i.length,s=0;s<o;s++){let a=i[s],u=e[a];u.distance===-1&&(u.distance=e[n].distance+1,u.parent=n,r.unshift(a))}}return e}function PX(t,e){return function(r){return e(t(r))}}function RX(t,e){let r=[e[t].parent,t],n=Rd[e[t].parent][t],i=e[t].parent;for(;e[i].parent;)r.unshift(e[i].parent),n=PX(Rd[e[i].parent][i],n),i=e[i].parent;return n.conversion=r,n}xk.exports=function(t){let e=TX(t),r={},n=Object.keys(e);for(let i=n.length,o=0;o<i;o++){let s=n[o];e[s].parent!==null&&(r[s]=RX(s,e))}return r}});var Ak=y((epe,Ok)=>{var LD=ND(),$X=Fk(),Ys={},IX=Object.keys(LD);function jX(t){let e=function(...r){let n=r[0];return n==null?n:(n.length>1&&(r=n),t(r))};return"conversion"in t&&(e.conversion=t.conversion),e}function NX(t){let e=function(...r){let n=r[0];if(n==null)return n;n.length>1&&(r=n);let i=t(r);if(typeof i=="object")for(let o=i.length,s=0;s<o;s++)i[s]=Math.round(i[s]);return i};return"conversion"in t&&(e.conversion=t.conversion),e}IX.forEach(t=>{Ys[t]={},Object.defineProperty(Ys[t],"channels",{value:LD[t].channels}),Object.defineProperty(Ys[t],"labels",{value:LD[t].labels});let e=$X(t);Object.keys(e).forEach(n=>{let i=e[n];Ys[t][n]=NX(i),Ys[t][n].raw=jX(i)})});Ok.exports=Ys});var qD=y((tpe,$k)=>{"use strict";var kk=(t,e)=>(...r)=>`\x1B[${t(...r)+e}m`,Tk=(t,e)=>(...r)=>{let n=t(...r);return`\x1B[${38+e};5;${n}m`},Pk=(t,e)=>(...r)=>{let n=t(...r);return`\x1B[${38+e};2;${n[0]};${n[1]};${n[2]}m`},$d=t=>t,Rk=(t,e,r)=>[t,e,r],Js=(t,e,r)=>{Object.defineProperty(t,e,{get:()=>{let n=r();return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0}),n},enumerable:!0,configurable:!0})},BD,Xs=(t,e,r,n)=>{BD===void 0&&(BD=Ak());let i=n?10:0,o={};for(let[s,a]of Object.entries(BD)){let u=s==="ansi16"?"ansi":s;s===e?o[u]=t(r,i):typeof a=="object"&&(o[u]=t(a[e],i))}return o};function LX(){let t=new Map,e={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};e.color.gray=e.color.blackBright,e.bgColor.bgGray=e.bgColor.bgBlackBright,e.color.grey=e.color.blackBright,e.bgColor.bgGrey=e.bgColor.bgBlackBright;for(let[r,n]of Object.entries(e)){for(let[i,o]of Object.entries(n))e[i]={open:`\x1B[${o[0]}m`,close:`\x1B[${o[1]}m`},n[i]=e[i],t.set(o[0],o[1]);Object.defineProperty(e,r,{value:n,enumerable:!1})}return Object.defineProperty(e,"codes",{value:t,enumerable:!1}),e.color.close="\x1B[39m",e.bgColor.close="\x1B[49m",Js(e.color,"ansi",()=>Xs(kk,"ansi16",$d,!1)),Js(e.color,"ansi256",()=>Xs(Tk,"ansi256",$d,!1)),Js(e.color,"ansi16m",()=>Xs(Pk,"rgb",Rk,!1)),Js(e.bgColor,"ansi",()=>Xs(kk,"ansi16",$d,!0)),Js(e.bgColor,"ansi256",()=>Xs(Tk,"ansi256",$d,!0)),Js(e.bgColor,"ansi16m",()=>Xs(Pk,"rgb",Rk,!0)),e}Object.defineProperty($k,"exports",{enumerable:!0,get:LX})});var Bk=y((rpe,Lk)=>{"use strict";var BX=jD(),qX=wk(),Ik=qD(),Nk=["\x1B","\x9B"],Id=t=>`${Nk[0]}[${t}m`,jk=(t,e,r)=>{let n=[];t=[...t];for(let i of t){let o=i;i.includes(";")&&(i=i.split(";")[0][0]+"0");let s=Ik.codes.get(Number.parseInt(i,10));if(s){let a=t.indexOf(s.toString());a===-1?n.push(Id(e?s:o)):t.splice(a,1)}else if(e){n.push(Id(0));break}else n.push(Id(o))}if(e&&(n=n.filter((i,o)=>n.indexOf(i)===o),r!==void 0)){let i=Id(Ik.codes.get(Number.parseInt(r,10)));n=n.reduce((o,s)=>s===i?[s,...o]:[...o,s],[])}return n.join("")};Lk.exports=(t,e,r)=>{let n=[...t],i=[],o=typeof r=="number"?r:n.length,s=!1,a,u=0,c="";for(let[l,f]of n.entries()){let h=!1;if(Nk.includes(f)){let d=/\d[^m]*/.exec(t.slice(l,l+18));a=d&&d.length>0?d[0]:void 0,u<o&&(s=!0,a!==void 0&&i.push(a))}else s&&f==="m"&&(s=!1,h=!0);if(!s&&!h&&u++,!qX({exact:!0}).test(f)&&BX(f.codePointAt())&&(u++,typeof r!="number"&&o++),u>e&&u<=o)c+=f;else if(u===e&&!s&&a!==void 0)c=jk(i);else if(u>=o){c+=jk(i,!0,a);break}}return c}});var Mk=y((npe,qk)=>{"use strict";qk.exports=({onlyFirst:t=!1}={})=>{let e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(e,t?void 0:"g")}});var jd=y((ipe,Uk)=>{"use strict";var MX=Mk();Uk.exports=t=>typeof t=="string"?t.replace(MX(),""):t});var Hk=y((ope,Vk)=>{"use strict";Vk.exports=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\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\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])|\uD83C[\uDF3E\uDF73\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])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\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])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\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\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\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\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFD])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83C\uDFF4\u200D\u2620)\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDF6\uD83C\uDDE6|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDBB\uDDD2-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\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\uDEEB\uDEEC\uDEF4-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])|(?:[#\*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\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\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])\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[\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g}});var UD=y((spe,MD)=>{"use strict";var UX=jd(),VX=jD(),HX=Hk(),zk=t=>{if(typeof t!="string"||t.length===0||(t=UX(t),t.length===0))return 0;t=t.replace(HX()," ");let e=0;for(let r=0;r<t.length;r++){let n=t.codePointAt(r);n<=31||n>=127&&n<=159||n>=768&&n<=879||(n>65535&&r++,e+=VX(n)?2:1)}return e};MD.exports=zk;MD.exports.default=zk});var Xk=y((ape,Jk)=>{"use strict";var ac=UD(),zX=jd(),GX=qD(),Nd=new Set(["\x1B","\x9B"]),WX=39,HD="\x07",Kk="[",KX="]",Yk="m",zD=`${KX}8;;`,Gk=t=>`${Nd.values().next().value}${Kk}${t}${Yk}`,Wk=t=>`${Nd.values().next().value}${zD}${t}${HD}`,YX=t=>t.split(" ").map(e=>ac(e)),VD=(t,e,r)=>{let n=[...e],i=!1,o=!1,s=ac(zX(t[t.length-1]));for(let[a,u]of n.entries()){let c=ac(u);if(s+c<=r?t[t.length-1]+=u:(t.push(u),s=0),Nd.has(u)&&(i=!0,o=n.slice(a+1).join("").startsWith(zD)),i){o?u===HD&&(i=!1,o=!1):u===Yk&&(i=!1);continue}s+=c,s===r&&a<n.length-1&&(t.push(""),s=0)}!s&&t[t.length-1].length>0&&t.length>1&&(t[t.length-2]+=t.pop())},JX=t=>{let e=t.split(" "),r=e.length;for(;r>0&&!(ac(e[r-1])>0);)r--;return r===e.length?t:e.slice(0,r).join(" ")+e.slice(r).join("")},XX=(t,e,r={})=>{if(r.trim!==!1&&t.trim()==="")return"";let n="",i,o,s=YX(t),a=[""];for(let[c,l]of t.split(" ").entries()){r.trim!==!1&&(a[a.length-1]=a[a.length-1].trimStart());let f=ac(a[a.length-1]);if(c!==0&&(f>=e&&(r.wordWrap===!1||r.trim===!1)&&(a.push(""),f=0),(f>0||r.trim===!1)&&(a[a.length-1]+=" ",f++)),r.hard&&s[c]>e){let h=e-f,d=1+Math.floor((s[c]-h-1)/e);Math.floor((s[c]-1)/e)<d&&a.push(""),VD(a,l,e);continue}if(f+s[c]>e&&f>0&&s[c]>0){if(r.wordWrap===!1&&f<e){VD(a,l,e);continue}a.push("")}if(f+s[c]>e&&r.wordWrap===!1){VD(a,l,e);continue}a[a.length-1]+=l}r.trim!==!1&&(a=a.map(JX));let u=[...a.join(`
50
+ `)];for(let[c,l]of u.entries()){if(n+=l,Nd.has(l)){let{groups:h}=new RegExp(`(?:\\${Kk}(?<code>\\d+)m|\\${zD}(?<uri>.*)${HD})`).exec(u.slice(c).join(""))||{groups:{}};if(h.code!==void 0){let d=Number.parseFloat(h.code);i=d===WX?void 0:d}else h.uri!==void 0&&(o=h.uri.length===0?void 0:h.uri)}let f=GX.codes.get(Number(i));u[c+1]===`
51
51
  `?(o&&(n+=Wk("")),i&&f&&(n+=Gk(f))):l===`
52
52
  `&&(i&&f&&(n+=Gk(i)),o&&(n+=Wk(o)))}return n};Jk.exports=(t,e,r)=>String(t).normalize().replace(/\r\n/g,`
53
53
  `).split(`
54
54
  `).map(n=>XX(n,e,r)).join(`
55
- `)});var e3=y((upe,Qk)=>{"use strict";var ZX=require("os"),Zk=ZX.homedir();Qk.exports=t=>{if(typeof t!="string")throw new TypeError(`Expected a string, got ${typeof t}`);return Zk?t.replace(/^~(?=$|\/|\\)/,Zk):t}});var s3=y(He=>{"use strict";Object.defineProperty(He,"__esModule",{value:!0});He.columnar=He.generateFillSpaceStringList=He.expandPath=He.prettyPath=He.wordWrap=He.indent=He.TTY_WIDTH=He.stripAnsi=He.stringWidth=He.sliceAnsi=void 0;var t3=(oc(),ke(ic)),QX=t3.__importStar(require("os")),Fn=t3.__importStar(require("path")),r3=Bk();He.sliceAnsi=r3;var qd=UD();He.stringWidth=qd;var eZ=Ld();He.stripAnsi=eZ;var tZ=Xk(),rZ=e3(),nZ=80,iZ=120;He.TTY_WIDTH=process.stdout.columns?Math.max(nZ,Math.min(process.stdout.columns,iZ)):1/0;function n3(t=4){return" ".repeat(t)}He.indent=n3;function oZ(t,{width:e=He.TTY_WIDTH,indentation:r=0,append:n=""}){return tZ(t,e-r-n.length,{trim:!0}).split(`
55
+ `)});var e3=y((upe,Qk)=>{"use strict";var ZX=require("os"),Zk=ZX.homedir();Qk.exports=t=>{if(typeof t!="string")throw new TypeError(`Expected a string, got ${typeof t}`);return Zk?t.replace(/^~(?=$|\/|\\)/,Zk):t}});var s3=y(He=>{"use strict";Object.defineProperty(He,"__esModule",{value:!0});He.columnar=He.generateFillSpaceStringList=He.expandPath=He.prettyPath=He.wordWrap=He.indent=He.TTY_WIDTH=He.stripAnsi=He.stringWidth=He.sliceAnsi=void 0;var t3=(oc(),ke(ic)),QX=t3.__importStar(require("os")),Fn=t3.__importStar(require("path")),r3=Bk();He.sliceAnsi=r3;var Ld=UD();He.stringWidth=Ld;var eZ=jd();He.stripAnsi=eZ;var tZ=Xk(),rZ=e3(),nZ=80,iZ=120;He.TTY_WIDTH=process.stdout.columns?Math.max(nZ,Math.min(process.stdout.columns,iZ)):1/0;function n3(t=4){return" ".repeat(t)}He.indent=n3;function oZ(t,{width:e=He.TTY_WIDTH,indentation:r=0,append:n=""}){return tZ(t,e-r-n.length,{trim:!0}).split(`
56
56
  `).join(`${n}
57
- ${n3(r)}`)}He.wordWrap=oZ;function sZ(t){t=i3(t);let e=process.cwd(),r=Fn.dirname(t),n=QX.homedir(),i=Math.abs(r.split(Fn.sep).length-e.split(Fn.sep).length);if(e===r)return"."+Fn.sep+Fn.basename(t);if(r.startsWith(e))return"."+Fn.sep+t.substring(e.length+1);if(i<=2){let o=Fn.relative(e,t);return o||"."}else{if(t===n)return"~";if(t.indexOf(n)===0)return"~"+Fn.sep+t.substring(n.length+1)}return t}He.prettyPath=sZ;function i3(t){return Fn.resolve(rZ(t))}He.expandPath=i3;function o3(t,e=1,r=" "){e<2&&(e=2);let n=Math.max(...t.map(s=>qd(s))),i=n>e?n+1:e,o=r.repeat(i);return t.map(s=>r3(o,0,i-qd(s)))}He.generateFillSpaceStringList=o3;function aZ(t,{hsep:e="-",vsep:r="|",headers:n}){let i=!!n;if(!t[0])return"";let o=n?n.length:t[0].length,s=n?n.map(l=>[l]):t[0].map(()=>[]);for(let l of t){let f=0,h=l.map(d=>{let p=d.split(`
58
- `);return f=Math.max(f,p.length),p});for(let d in l)s[d]&&s[d].push(...h[d],...Array(f-h[d].length).fill(""))}let a=s.map((l,f)=>{if(f<o-1){let h=o3(l);return l.map((d,p)=>`${d}${h[p]}${r===""?"":`${r} `}`)}else return l}),u=0,c=a.reduce((l,f)=>l.map((h,d)=>{let p=l[d]+f[d];return u=Math.max(u,qd(p)),p}));return i&&e!==""&&c.splice(1,0,e.repeat(u)),c.join(`
59
- `)}He.columnar=aZ});var GD=y((lpe,a3)=>{function uZ(t){r.debug=r,r.default=r,r.coerce=u,r.disable=o,r.enable=i,r.enabled=s,r.humanize=SD(),r.destroy=c,Object.keys(t).forEach(l=>{r[l]=t[l]}),r.names=[],r.skips=[],r.formatters={};function e(l){let f=0;for(let h=0;h<l.length;h++)f=(f<<5)-f+l.charCodeAt(h),f|=0;return r.colors[Math.abs(f)%r.colors.length]}r.selectColor=e;function r(l){let f,h=null,d,p;function v(...g){if(!v.enabled)return;let w=v,x=Number(new Date),D=x-(f||x);w.diff=D,w.prev=f,w.curr=x,f=x,g[0]=r.coerce(g[0]),typeof g[0]!="string"&&g.unshift("%O");let C=0;g[0]=g[0].replace(/%([a-zA-Z%])/g,($,F)=>{if($==="%%")return"%";C++;let L=r.formatters[F];if(typeof L=="function"){let S=g[C];$=L.call(w,S),g.splice(C,1),C--}return $}),r.formatArgs.call(w,g),(w.log||r.log).apply(w,g)}return v.namespace=l,v.useColors=r.useColors(),v.color=r.selectColor(l),v.extend=n,v.destroy=r.destroy,Object.defineProperty(v,"enabled",{enumerable:!0,configurable:!1,get:()=>h!==null?h:(d!==r.namespaces&&(d=r.namespaces,p=r.enabled(l)),p),set:g=>{h=g}}),typeof r.init=="function"&&r.init(v),v}function n(l,f){let h=r(this.namespace+(typeof f>"u"?":":f)+l);return h.log=this.log,h}function i(l){r.save(l),r.namespaces=l,r.names=[],r.skips=[];let f,h=(typeof l=="string"?l:"").split(/[\s,]+/),d=h.length;for(f=0;f<d;f++)h[f]&&(l=h[f].replace(/\*/g,".*?"),l[0]==="-"?r.skips.push(new RegExp("^"+l.slice(1)+"$")):r.names.push(new RegExp("^"+l+"$")))}function o(){let l=[...r.names.map(a),...r.skips.map(a).map(f=>"-"+f)].join(",");return r.enable(""),l}function s(l){if(l[l.length-1]==="*")return!0;let f,h;for(f=0,h=r.skips.length;f<h;f++)if(r.skips[f].test(l))return!1;for(f=0,h=r.names.length;f<h;f++)if(r.names[f].test(l))return!0;return!1}function a(l){return l.toString().substring(2,l.toString().length-2).replace(/\.\*\?$/,"*")}function u(l){return l instanceof Error?l.stack||l.message:l}function c(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return r.enable(r.load()),r}a3.exports=uZ});var u3=y((sr,Md)=>{sr.formatArgs=lZ;sr.save=fZ;sr.load=dZ;sr.useColors=cZ;sr.storage=hZ();sr.destroy=(()=>{let t=!1;return()=>{t||(t=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();sr.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function cZ(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function lZ(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+Md.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;t.splice(1,0,e,"color: inherit");let r=0,n=0;t[0].replace(/%[a-zA-Z%]/g,i=>{i!=="%%"&&(r++,i==="%c"&&(n=r))}),t.splice(n,0,e)}sr.log=console.debug||console.log||(()=>{});function fZ(t){try{t?sr.storage.setItem("debug",t):sr.storage.removeItem("debug")}catch{}}function dZ(){let t;try{t=sr.storage.getItem("debug")}catch{}return!t&&typeof process<"u"&&"env"in process&&(t=process.env.DEBUG),t}function hZ(){try{return localStorage}catch{}}Md.exports=GD()(sr);var{formatters:pZ}=Md.exports;pZ.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var l3=y((yt,Vd)=>{var mZ=require("tty"),Ud=require("util");yt.init=_Z;yt.log=vZ;yt.formatArgs=yZ;yt.save=bZ;yt.load=wZ;yt.useColors=gZ;yt.destroy=Ud.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");yt.colors=[6,2,3,4,5,1];try{let t=AD();t&&(t.stderr||t).level>=2&&(yt.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}yt.inspectOpts=Object.keys(process.env).filter(t=>/^debug_/i.test(t)).reduce((t,e)=>{let r=e.substring(6).toLowerCase().replace(/_([a-z])/g,(i,o)=>o.toUpperCase()),n=process.env[e];return/^(yes|on|true|enabled)$/i.test(n)?n=!0:/^(no|off|false|disabled)$/i.test(n)?n=!1:n==="null"?n=null:n=Number(n),t[r]=n,t},{});function gZ(){return"colors"in yt.inspectOpts?!!yt.inspectOpts.colors:mZ.isatty(process.stderr.fd)}function yZ(t){let{namespace:e,useColors:r}=this;if(r){let n=this.color,i="\x1B[3"+(n<8?n:"8;5;"+n),o=` ${i};1m${e} \x1B[0m`;t[0]=o+t[0].split(`
57
+ ${n3(r)}`)}He.wordWrap=oZ;function sZ(t){t=i3(t);let e=process.cwd(),r=Fn.dirname(t),n=QX.homedir(),i=Math.abs(r.split(Fn.sep).length-e.split(Fn.sep).length);if(e===r)return"."+Fn.sep+Fn.basename(t);if(r.startsWith(e))return"."+Fn.sep+t.substring(e.length+1);if(i<=2){let o=Fn.relative(e,t);return o||"."}else{if(t===n)return"~";if(t.indexOf(n)===0)return"~"+Fn.sep+t.substring(n.length+1)}return t}He.prettyPath=sZ;function i3(t){return Fn.resolve(rZ(t))}He.expandPath=i3;function o3(t,e=1,r=" "){e<2&&(e=2);let n=Math.max(...t.map(s=>Ld(s))),i=n>e?n+1:e,o=r.repeat(i);return t.map(s=>r3(o,0,i-Ld(s)))}He.generateFillSpaceStringList=o3;function aZ(t,{hsep:e="-",vsep:r="|",headers:n}){let i=!!n;if(!t[0])return"";let o=n?n.length:t[0].length,s=n?n.map(l=>[l]):t[0].map(()=>[]);for(let l of t){let f=0,h=l.map(d=>{let p=d.split(`
58
+ `);return f=Math.max(f,p.length),p});for(let d in l)s[d]&&s[d].push(...h[d],...Array(f-h[d].length).fill(""))}let a=s.map((l,f)=>{if(f<o-1){let h=o3(l);return l.map((d,p)=>`${d}${h[p]}${r===""?"":`${r} `}`)}else return l}),u=0,c=a.reduce((l,f)=>l.map((h,d)=>{let p=l[d]+f[d];return u=Math.max(u,Ld(p)),p}));return i&&e!==""&&c.splice(1,0,e.repeat(u)),c.join(`
59
+ `)}He.columnar=aZ});var GD=y((lpe,a3)=>{function uZ(t){r.debug=r,r.default=r,r.coerce=u,r.disable=o,r.enable=i,r.enabled=s,r.humanize=SD(),r.destroy=c,Object.keys(t).forEach(l=>{r[l]=t[l]}),r.names=[],r.skips=[],r.formatters={};function e(l){let f=0;for(let h=0;h<l.length;h++)f=(f<<5)-f+l.charCodeAt(h),f|=0;return r.colors[Math.abs(f)%r.colors.length]}r.selectColor=e;function r(l){let f,h=null,d,p;function v(...g){if(!v.enabled)return;let w=v,x=Number(new Date),D=x-(f||x);w.diff=D,w.prev=f,w.curr=x,f=x,g[0]=r.coerce(g[0]),typeof g[0]!="string"&&g.unshift("%O");let C=0;g[0]=g[0].replace(/%([a-zA-Z%])/g,($,F)=>{if($==="%%")return"%";C++;let L=r.formatters[F];if(typeof L=="function"){let S=g[C];$=L.call(w,S),g.splice(C,1),C--}return $}),r.formatArgs.call(w,g),(w.log||r.log).apply(w,g)}return v.namespace=l,v.useColors=r.useColors(),v.color=r.selectColor(l),v.extend=n,v.destroy=r.destroy,Object.defineProperty(v,"enabled",{enumerable:!0,configurable:!1,get:()=>h!==null?h:(d!==r.namespaces&&(d=r.namespaces,p=r.enabled(l)),p),set:g=>{h=g}}),typeof r.init=="function"&&r.init(v),v}function n(l,f){let h=r(this.namespace+(typeof f>"u"?":":f)+l);return h.log=this.log,h}function i(l){r.save(l),r.namespaces=l,r.names=[],r.skips=[];let f,h=(typeof l=="string"?l:"").split(/[\s,]+/),d=h.length;for(f=0;f<d;f++)h[f]&&(l=h[f].replace(/\*/g,".*?"),l[0]==="-"?r.skips.push(new RegExp("^"+l.slice(1)+"$")):r.names.push(new RegExp("^"+l+"$")))}function o(){let l=[...r.names.map(a),...r.skips.map(a).map(f=>"-"+f)].join(",");return r.enable(""),l}function s(l){if(l[l.length-1]==="*")return!0;let f,h;for(f=0,h=r.skips.length;f<h;f++)if(r.skips[f].test(l))return!1;for(f=0,h=r.names.length;f<h;f++)if(r.names[f].test(l))return!0;return!1}function a(l){return l.toString().substring(2,l.toString().length-2).replace(/\.\*\?$/,"*")}function u(l){return l instanceof Error?l.stack||l.message:l}function c(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return r.enable(r.load()),r}a3.exports=uZ});var u3=y((sr,Bd)=>{sr.formatArgs=lZ;sr.save=fZ;sr.load=dZ;sr.useColors=cZ;sr.storage=hZ();sr.destroy=(()=>{let t=!1;return()=>{t||(t=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();sr.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function cZ(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function lZ(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+Bd.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;t.splice(1,0,e,"color: inherit");let r=0,n=0;t[0].replace(/%[a-zA-Z%]/g,i=>{i!=="%%"&&(r++,i==="%c"&&(n=r))}),t.splice(n,0,e)}sr.log=console.debug||console.log||(()=>{});function fZ(t){try{t?sr.storage.setItem("debug",t):sr.storage.removeItem("debug")}catch{}}function dZ(){let t;try{t=sr.storage.getItem("debug")}catch{}return!t&&typeof process<"u"&&"env"in process&&(t=process.env.DEBUG),t}function hZ(){try{return localStorage}catch{}}Bd.exports=GD()(sr);var{formatters:pZ}=Bd.exports;pZ.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var l3=y((yt,Md)=>{var mZ=require("tty"),qd=require("util");yt.init=_Z;yt.log=vZ;yt.formatArgs=yZ;yt.save=bZ;yt.load=wZ;yt.useColors=gZ;yt.destroy=qd.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");yt.colors=[6,2,3,4,5,1];try{let t=AD();t&&(t.stderr||t).level>=2&&(yt.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}yt.inspectOpts=Object.keys(process.env).filter(t=>/^debug_/i.test(t)).reduce((t,e)=>{let r=e.substring(6).toLowerCase().replace(/_([a-z])/g,(i,o)=>o.toUpperCase()),n=process.env[e];return/^(yes|on|true|enabled)$/i.test(n)?n=!0:/^(no|off|false|disabled)$/i.test(n)?n=!1:n==="null"?n=null:n=Number(n),t[r]=n,t},{});function gZ(){return"colors"in yt.inspectOpts?!!yt.inspectOpts.colors:mZ.isatty(process.stderr.fd)}function yZ(t){let{namespace:e,useColors:r}=this;if(r){let n=this.color,i="\x1B[3"+(n<8?n:"8;5;"+n),o=` ${i};1m${e} \x1B[0m`;t[0]=o+t[0].split(`
60
60
  `).join(`
61
- `+o),t.push(i+"m+"+Vd.exports.humanize(this.diff)+"\x1B[0m")}else t[0]=DZ()+e+" "+t[0]}function DZ(){return yt.inspectOpts.hideDate?"":new Date().toISOString()+" "}function vZ(...t){return process.stderr.write(Ud.formatWithOptions(yt.inspectOpts,...t)+`
62
- `)}function bZ(t){t?process.env.DEBUG=t:delete process.env.DEBUG}function wZ(){return process.env.DEBUG}function _Z(t){t.inspectOpts={};let e=Object.keys(yt.inspectOpts);for(let r=0;r<e.length;r++)t.inspectOpts[e[r]]=yt.inspectOpts[e[r]]}Vd.exports=GD()(yt);var{formatters:c3}=Vd.exports;c3.o=function(t){return this.inspectOpts.colors=this.useColors,Ud.inspect(t,this.inspectOpts).split(`
63
- `).map(e=>e.trim()).join(" ")};c3.O=function(t){return this.inspectOpts.colors=this.useColors,Ud.inspect(t,this.inspectOpts)}});var f3=y((fpe,WD)=>{typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?WD.exports=u3():WD.exports=l3()});var d3=y(wr=>{"use strict";Object.defineProperty(wr,"__esModule",{value:!0});wr.TERMINAL_INFO=wr.CI_ENVIRONMENT_VARIABLES_DETECTED=wr.CI_ENVIRONMENT_VARIABLES=void 0;var EZ=(oc(),ke(ic)),CZ=f3(),SZ=EZ.__importStar(require("os")),xZ=(0,CZ.debug)("ionic:utils-terminal:info");wr.CI_ENVIRONMENT_VARIABLES=["CI","BUILD_ID","BUILD_NUMBER","BITBUCKET_COMMIT","CODEBUILD_BUILD_ARN","GITHUB_ACTIONS"];wr.CI_ENVIRONMENT_VARIABLES_DETECTED=wr.CI_ENVIRONMENT_VARIABLES.filter(t=>!!process.env[t]);function FZ(){let{shell:t}=SZ.userInfo();return t||(process.env.SHELL?process.env.SHELL:process.platform==="darwin"?"/bin/bash":process.platform==="win32"?process.env.COMSPEC?process.env.COMSPEC:"cmd.exe":"/bin/sh")}wr.CI_ENVIRONMENT_VARIABLES_DETECTED.length>0&&xZ(`Environment variables for CI detected: ${wr.CI_ENVIRONMENT_VARIABLES_DETECTED.join(", ")}`);wr.TERMINAL_INFO=Object.freeze({ci:wr.CI_ENVIRONMENT_VARIABLES_DETECTED.length>0,shell:FZ(),tty:!!(process.stdin.isTTY&&process.stdout.isTTY&&process.stderr.isTTY),windows:process.platform==="win32"||!!(process.env.OSTYPE&&/^(msys|cygwin)$/.test(process.env.OSTYPE)||process.env.MSYSTEM&&/^MINGW(32|64)$/.test(process.env.MSYSTEM))})});var KD=y(Zs=>{"use strict";Object.defineProperty(Zs,"__esModule",{value:!0});var Hd=(oc(),ke(ic));Hd.__exportStar($D(),Zs);Hd.__exportStar(yk(),Zs);Hd.__exportStar(s3(),Zs);Hd.__exportStar(d3(),Zs)});var Gd=y(Jr=>{"use strict";Object.defineProperty(Jr,"__esModule",{value:!0});Jr.isFatal=Jr.fatal=Jr.FatalException=Jr.BaseException=void 0;var zd=class extends Error{constructor(e,r){super(e),this.message=e,this.code=r}};Jr.BaseException=zd;var uc=class extends zd{constructor(e,r=1){super(e,"FATAL"),this.message=e,this.exitCode=r}};Jr.FatalException=uc;function OZ(t){throw new uc(t)}Jr.fatal=OZ;function AZ(t){return t&&t instanceof uc}Jr.isFatal=AZ});var XD={};mn(XD,{LOGGER_LEVELS:()=>NZ,Logger:()=>JD,NO_COLORS:()=>h3,StreamOutputStrategy:()=>Wd,TTYOutputStrategy:()=>YD,TTY_WIDTH:()=>kZ,createDefaultLogger:()=>jZ,indent:()=>TZ,sliceAnsi:()=>PZ,stringWidth:()=>RZ,stripAnsi:()=>$Z,wordWrap:()=>IZ});var kZ,TZ,PZ,RZ,$Z,IZ,jZ,h3,Wd,YD,JD,NZ,ZD=ut(()=>{kZ=80,TZ=t=>t,PZ=t=>t,RZ=t=>t.length,$Z=t=>t,IZ=t=>t,jZ=()=>({info:console.log,warn:console.warn,error:console.error,debug:console.debug}),h3={},Wd=class{constructor(){this.colors=h3,this.stream=process.stdout}},YD=class extends Wd{constructor(e){super(),this.options=e}},JD=class{constructor(){}info(){}warn(){}error(){}debug(){}},NZ={DEBUG:"DEBUG",INFO:"INFO",WARN:"WARN",ERROR:"ERROR"}});var m3=y(lo=>{"use strict";Object.defineProperty(lo,"__esModule",{value:!0});lo.isInteractive=lo.checkInteractive=void 0;var LZ=(Cn(),ke(En)),p3=KD(),BZ=LZ.__importDefault(Gs()),qZ=cc(),MZ=(...t)=>(0,lo.isInteractive)()?!0:t.length?t.filter(e=>!e).length?(qZ.logger.error(`Non-interactive shell detected.
64
- Run the command with ${BZ.default.input("--help")} to see a list of arguments that must be provided.`),!1):!0:!1;lo.checkInteractive=MZ;var UZ=()=>p3.TERMINAL_INFO.tty&&!p3.TERMINAL_INFO.ci;lo.isInteractive=UZ});var ze=y((gpe,y3)=>{"use strict";var{FORCE_COLOR:VZ,NODE_DISABLE_COLORS:HZ,TERM:zZ}=process.env,Ee={enabled:!HZ&&zZ!=="dumb"&&VZ!=="0",reset:Ae(0,0),bold:Ae(1,22),dim:Ae(2,22),italic:Ae(3,23),underline:Ae(4,24),inverse:Ae(7,27),hidden:Ae(8,28),strikethrough:Ae(9,29),black:Ae(30,39),red:Ae(31,39),green:Ae(32,39),yellow:Ae(33,39),blue:Ae(34,39),magenta:Ae(35,39),cyan:Ae(36,39),white:Ae(37,39),gray:Ae(90,39),grey:Ae(90,39),bgBlack:Ae(40,49),bgRed:Ae(41,49),bgGreen:Ae(42,49),bgYellow:Ae(43,49),bgBlue:Ae(44,49),bgMagenta:Ae(45,49),bgCyan:Ae(46,49),bgWhite:Ae(47,49)};function g3(t,e){let r=0,n,i="",o="";for(;r<t.length;r++)n=t[r],i+=n.open,o+=n.close,e.includes(n.close)&&(e=e.replace(n.rgx,n.close+n.open));return i+e+o}function GZ(t,e){let r={has:t,keys:e};return r.reset=Ee.reset.bind(r),r.bold=Ee.bold.bind(r),r.dim=Ee.dim.bind(r),r.italic=Ee.italic.bind(r),r.underline=Ee.underline.bind(r),r.inverse=Ee.inverse.bind(r),r.hidden=Ee.hidden.bind(r),r.strikethrough=Ee.strikethrough.bind(r),r.black=Ee.black.bind(r),r.red=Ee.red.bind(r),r.green=Ee.green.bind(r),r.yellow=Ee.yellow.bind(r),r.blue=Ee.blue.bind(r),r.magenta=Ee.magenta.bind(r),r.cyan=Ee.cyan.bind(r),r.white=Ee.white.bind(r),r.gray=Ee.gray.bind(r),r.grey=Ee.grey.bind(r),r.bgBlack=Ee.bgBlack.bind(r),r.bgRed=Ee.bgRed.bind(r),r.bgGreen=Ee.bgGreen.bind(r),r.bgYellow=Ee.bgYellow.bind(r),r.bgBlue=Ee.bgBlue.bind(r),r.bgMagenta=Ee.bgMagenta.bind(r),r.bgCyan=Ee.bgCyan.bind(r),r.bgWhite=Ee.bgWhite.bind(r),r}function Ae(t,e){let r={open:`\x1B[${t}m`,close:`\x1B[${e}m`,rgx:new RegExp(`\\x1b\\[${e}m`,"g")};return function(n){return this!==void 0&&this.has!==void 0?(this.has.includes(t)||(this.has.push(t),this.keys.push(r)),n===void 0?this:Ee.enabled?g3(this.keys,n+""):n+""):n===void 0?GZ([t],[r]):Ee.enabled?g3([r],n+""):n+""}}y3.exports=Ee});var v3=y((ype,D3)=>{"use strict";D3.exports=(t,e)=>{if(!(t.meta&&t.name!=="escape")){if(t.ctrl){if(t.name==="a")return"first";if(t.name==="c"||t.name==="d")return"abort";if(t.name==="e")return"last";if(t.name==="g")return"reset"}if(e){if(t.name==="j")return"down";if(t.name==="k")return"up"}return t.name==="return"||t.name==="enter"?"submit":t.name==="backspace"?"delete":t.name==="delete"?"deleteForward":t.name==="abort"?"abort":t.name==="escape"?"exit":t.name==="tab"?"next":t.name==="pagedown"?"nextPage":t.name==="pageup"?"prevPage":t.name==="home"?"home":t.name==="end"?"end":t.name==="up"?"up":t.name==="down"?"down":t.name==="right"?"right":t.name==="left"?"left":!1}}});var Kd=y((Dpe,b3)=>{"use strict";b3.exports=t=>{let e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))"].join("|"),r=new RegExp(e,"g");return typeof t=="string"?t.replace(r,""):t}});var S3=y((vpe,C3)=>{"use strict";function WZ(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=KZ(t))||e&&t&&typeof t.length=="number"){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(c){throw c},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
65
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,s=!1,a;return{s:function(){r=r.call(t)},n:function(){var c=r.next();return o=c.done,c},e:function(c){s=!0,a=c},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(s)throw a}}}}function KZ(t,e){if(t){if(typeof t=="string")return w3(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return w3(t,e)}}function w3(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var YZ=Kd(),E3=Te(),_3=E3.erase,JZ=E3.cursor,XZ=t=>[...YZ(t)].length;C3.exports=function(t,e){if(!e)return _3.line+JZ.to(0);let r=0,n=t.split(/\r?\n/);var i=WZ(n),o;try{for(i.s();!(o=i.n()).done;){let s=o.value;r+=1+Math.floor(Math.max(XZ(s)-1,0)/e)}}catch(s){i.e(s)}finally{i.f()}return _3.lines(r)}});var QD=y((bpe,x3)=>{"use strict";var lc={arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",radioOn:"\u25C9",radioOff:"\u25EF",tick:"\u2714",cross:"\u2716",ellipsis:"\u2026",pointerSmall:"\u203A",line:"\u2500",pointer:"\u276F"},ZZ={arrowUp:lc.arrowUp,arrowDown:lc.arrowDown,arrowLeft:lc.arrowLeft,arrowRight:lc.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"\u221A",cross:"\xD7",ellipsis:"...",pointerSmall:"\xBB",line:"\u2500",pointer:">"},QZ=process.platform==="win32"?ZZ:lc;x3.exports=QZ});var O3=y((wpe,F3)=>{"use strict";var Qs=ze(),fo=QD(),e0=Object.freeze({password:{scale:1,render:t=>"*".repeat(t.length)},emoji:{scale:2,render:t=>"\u{1F603}".repeat(t.length)},invisible:{scale:0,render:t=>""},default:{scale:1,render:t=>`${t}`}}),eQ=t=>e0[t]||e0.default,fc=Object.freeze({aborted:Qs.red(fo.cross),done:Qs.green(fo.tick),exited:Qs.yellow(fo.cross),default:Qs.cyan("?")}),tQ=(t,e,r)=>e?fc.aborted:r?fc.exited:t?fc.done:fc.default,rQ=t=>Qs.gray(t?fo.ellipsis:fo.pointerSmall),nQ=(t,e)=>Qs.gray(t?e?fo.pointerSmall:"+":fo.line);F3.exports={styles:e0,render:eQ,symbols:fc,symbol:tQ,delimiter:rQ,item:nQ}});var k3=y((_pe,A3)=>{"use strict";var iQ=Kd();A3.exports=function(t,e){let r=String(iQ(t)||"").split(/\r?\n/);return e?r.map(n=>Math.ceil(n.length/e)).reduce((n,i)=>n+i):r.length}});var P3=y((Epe,T3)=>{"use strict";T3.exports=(t,e={})=>{let r=Number.isSafeInteger(parseInt(e.margin))?new Array(parseInt(e.margin)).fill(" ").join(""):e.margin||"",n=e.width;return(t||"").split(/\r?\n/g).map(i=>i.split(/\s+/g).reduce((o,s)=>(s.length+r.length>=n||o[o.length-1].length+s.length+1<n?o[o.length-1]+=` ${s}`:o.push(`${r}${s}`),o),[r]).join(`
61
+ `+o),t.push(i+"m+"+Md.exports.humanize(this.diff)+"\x1B[0m")}else t[0]=DZ()+e+" "+t[0]}function DZ(){return yt.inspectOpts.hideDate?"":new Date().toISOString()+" "}function vZ(...t){return process.stderr.write(qd.formatWithOptions(yt.inspectOpts,...t)+`
62
+ `)}function bZ(t){t?process.env.DEBUG=t:delete process.env.DEBUG}function wZ(){return process.env.DEBUG}function _Z(t){t.inspectOpts={};let e=Object.keys(yt.inspectOpts);for(let r=0;r<e.length;r++)t.inspectOpts[e[r]]=yt.inspectOpts[e[r]]}Md.exports=GD()(yt);var{formatters:c3}=Md.exports;c3.o=function(t){return this.inspectOpts.colors=this.useColors,qd.inspect(t,this.inspectOpts).split(`
63
+ `).map(e=>e.trim()).join(" ")};c3.O=function(t){return this.inspectOpts.colors=this.useColors,qd.inspect(t,this.inspectOpts)}});var f3=y((fpe,WD)=>{typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?WD.exports=u3():WD.exports=l3()});var d3=y(wr=>{"use strict";Object.defineProperty(wr,"__esModule",{value:!0});wr.TERMINAL_INFO=wr.CI_ENVIRONMENT_VARIABLES_DETECTED=wr.CI_ENVIRONMENT_VARIABLES=void 0;var EZ=(oc(),ke(ic)),CZ=f3(),SZ=EZ.__importStar(require("os")),xZ=(0,CZ.debug)("ionic:utils-terminal:info");wr.CI_ENVIRONMENT_VARIABLES=["CI","BUILD_ID","BUILD_NUMBER","BITBUCKET_COMMIT","CODEBUILD_BUILD_ARN","GITHUB_ACTIONS"];wr.CI_ENVIRONMENT_VARIABLES_DETECTED=wr.CI_ENVIRONMENT_VARIABLES.filter(t=>!!process.env[t]);function FZ(){let{shell:t}=SZ.userInfo();return t||(process.env.SHELL?process.env.SHELL:process.platform==="darwin"?"/bin/bash":process.platform==="win32"?process.env.COMSPEC?process.env.COMSPEC:"cmd.exe":"/bin/sh")}wr.CI_ENVIRONMENT_VARIABLES_DETECTED.length>0&&xZ(`Environment variables for CI detected: ${wr.CI_ENVIRONMENT_VARIABLES_DETECTED.join(", ")}`);wr.TERMINAL_INFO=Object.freeze({ci:wr.CI_ENVIRONMENT_VARIABLES_DETECTED.length>0,shell:FZ(),tty:!!(process.stdin.isTTY&&process.stdout.isTTY&&process.stderr.isTTY),windows:process.platform==="win32"||!!(process.env.OSTYPE&&/^(msys|cygwin)$/.test(process.env.OSTYPE)||process.env.MSYSTEM&&/^MINGW(32|64)$/.test(process.env.MSYSTEM))})});var KD=y(Zs=>{"use strict";Object.defineProperty(Zs,"__esModule",{value:!0});var Ud=(oc(),ke(ic));Ud.__exportStar($D(),Zs);Ud.__exportStar(yk(),Zs);Ud.__exportStar(s3(),Zs);Ud.__exportStar(d3(),Zs)});var Hd=y(Jr=>{"use strict";Object.defineProperty(Jr,"__esModule",{value:!0});Jr.isFatal=Jr.fatal=Jr.FatalException=Jr.BaseException=void 0;var Vd=class extends Error{constructor(e,r){super(e),this.message=e,this.code=r}};Jr.BaseException=Vd;var uc=class extends Vd{constructor(e,r=1){super(e,"FATAL"),this.message=e,this.exitCode=r}};Jr.FatalException=uc;function OZ(t){throw new uc(t)}Jr.fatal=OZ;function AZ(t){return t&&t instanceof uc}Jr.isFatal=AZ});var XD={};mn(XD,{LOGGER_LEVELS:()=>NZ,Logger:()=>JD,NO_COLORS:()=>h3,StreamOutputStrategy:()=>zd,TTYOutputStrategy:()=>YD,TTY_WIDTH:()=>kZ,createDefaultLogger:()=>jZ,indent:()=>TZ,sliceAnsi:()=>PZ,stringWidth:()=>RZ,stripAnsi:()=>$Z,wordWrap:()=>IZ});var kZ,TZ,PZ,RZ,$Z,IZ,jZ,h3,zd,YD,JD,NZ,ZD=ut(()=>{kZ=80,TZ=t=>t,PZ=t=>t,RZ=t=>t.length,$Z=t=>t,IZ=t=>t,jZ=()=>({info:console.log,warn:console.warn,error:console.error,debug:console.debug}),h3={},zd=class{constructor(){this.colors=h3,this.stream=process.stdout}},YD=class extends zd{constructor(e){super(),this.options=e}},JD=class{constructor(){}info(){}warn(){}error(){}debug(){}},NZ={DEBUG:"DEBUG",INFO:"INFO",WARN:"WARN",ERROR:"ERROR"}});var m3=y(co=>{"use strict";Object.defineProperty(co,"__esModule",{value:!0});co.isInteractive=co.checkInteractive=void 0;var LZ=(Cn(),ke(En)),p3=KD(),BZ=LZ.__importDefault(Gs()),qZ=cc(),MZ=(...t)=>(0,co.isInteractive)()?!0:t.length?t.filter(e=>!e).length?(qZ.logger.error(`Non-interactive shell detected.
64
+ Run the command with ${BZ.default.input("--help")} to see a list of arguments that must be provided.`),!1):!0:!1;co.checkInteractive=MZ;var UZ=()=>p3.TERMINAL_INFO.tty&&!p3.TERMINAL_INFO.ci;co.isInteractive=UZ});var ze=y((gpe,y3)=>{"use strict";var{FORCE_COLOR:VZ,NODE_DISABLE_COLORS:HZ,TERM:zZ}=process.env,Ee={enabled:!HZ&&zZ!=="dumb"&&VZ!=="0",reset:Ae(0,0),bold:Ae(1,22),dim:Ae(2,22),italic:Ae(3,23),underline:Ae(4,24),inverse:Ae(7,27),hidden:Ae(8,28),strikethrough:Ae(9,29),black:Ae(30,39),red:Ae(31,39),green:Ae(32,39),yellow:Ae(33,39),blue:Ae(34,39),magenta:Ae(35,39),cyan:Ae(36,39),white:Ae(37,39),gray:Ae(90,39),grey:Ae(90,39),bgBlack:Ae(40,49),bgRed:Ae(41,49),bgGreen:Ae(42,49),bgYellow:Ae(43,49),bgBlue:Ae(44,49),bgMagenta:Ae(45,49),bgCyan:Ae(46,49),bgWhite:Ae(47,49)};function g3(t,e){let r=0,n,i="",o="";for(;r<t.length;r++)n=t[r],i+=n.open,o+=n.close,e.includes(n.close)&&(e=e.replace(n.rgx,n.close+n.open));return i+e+o}function GZ(t,e){let r={has:t,keys:e};return r.reset=Ee.reset.bind(r),r.bold=Ee.bold.bind(r),r.dim=Ee.dim.bind(r),r.italic=Ee.italic.bind(r),r.underline=Ee.underline.bind(r),r.inverse=Ee.inverse.bind(r),r.hidden=Ee.hidden.bind(r),r.strikethrough=Ee.strikethrough.bind(r),r.black=Ee.black.bind(r),r.red=Ee.red.bind(r),r.green=Ee.green.bind(r),r.yellow=Ee.yellow.bind(r),r.blue=Ee.blue.bind(r),r.magenta=Ee.magenta.bind(r),r.cyan=Ee.cyan.bind(r),r.white=Ee.white.bind(r),r.gray=Ee.gray.bind(r),r.grey=Ee.grey.bind(r),r.bgBlack=Ee.bgBlack.bind(r),r.bgRed=Ee.bgRed.bind(r),r.bgGreen=Ee.bgGreen.bind(r),r.bgYellow=Ee.bgYellow.bind(r),r.bgBlue=Ee.bgBlue.bind(r),r.bgMagenta=Ee.bgMagenta.bind(r),r.bgCyan=Ee.bgCyan.bind(r),r.bgWhite=Ee.bgWhite.bind(r),r}function Ae(t,e){let r={open:`\x1B[${t}m`,close:`\x1B[${e}m`,rgx:new RegExp(`\\x1b\\[${e}m`,"g")};return function(n){return this!==void 0&&this.has!==void 0?(this.has.includes(t)||(this.has.push(t),this.keys.push(r)),n===void 0?this:Ee.enabled?g3(this.keys,n+""):n+""):n===void 0?GZ([t],[r]):Ee.enabled?g3([r],n+""):n+""}}y3.exports=Ee});var v3=y((ype,D3)=>{"use strict";D3.exports=(t,e)=>{if(!(t.meta&&t.name!=="escape")){if(t.ctrl){if(t.name==="a")return"first";if(t.name==="c"||t.name==="d")return"abort";if(t.name==="e")return"last";if(t.name==="g")return"reset"}if(e){if(t.name==="j")return"down";if(t.name==="k")return"up"}return t.name==="return"||t.name==="enter"?"submit":t.name==="backspace"?"delete":t.name==="delete"?"deleteForward":t.name==="abort"?"abort":t.name==="escape"?"exit":t.name==="tab"?"next":t.name==="pagedown"?"nextPage":t.name==="pageup"?"prevPage":t.name==="home"?"home":t.name==="end"?"end":t.name==="up"?"up":t.name==="down"?"down":t.name==="right"?"right":t.name==="left"?"left":!1}}});var Gd=y((Dpe,b3)=>{"use strict";b3.exports=t=>{let e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))"].join("|"),r=new RegExp(e,"g");return typeof t=="string"?t.replace(r,""):t}});var S3=y((vpe,C3)=>{"use strict";function WZ(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=KZ(t))||e&&t&&typeof t.length=="number"){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(c){throw c},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
65
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,s=!1,a;return{s:function(){r=r.call(t)},n:function(){var c=r.next();return o=c.done,c},e:function(c){s=!0,a=c},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(s)throw a}}}}function KZ(t,e){if(t){if(typeof t=="string")return w3(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return w3(t,e)}}function w3(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var YZ=Gd(),E3=Te(),_3=E3.erase,JZ=E3.cursor,XZ=t=>[...YZ(t)].length;C3.exports=function(t,e){if(!e)return _3.line+JZ.to(0);let r=0,n=t.split(/\r?\n/);var i=WZ(n),o;try{for(i.s();!(o=i.n()).done;){let s=o.value;r+=1+Math.floor(Math.max(XZ(s)-1,0)/e)}}catch(s){i.e(s)}finally{i.f()}return _3.lines(r)}});var QD=y((bpe,x3)=>{"use strict";var lc={arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",radioOn:"\u25C9",radioOff:"\u25EF",tick:"\u2714",cross:"\u2716",ellipsis:"\u2026",pointerSmall:"\u203A",line:"\u2500",pointer:"\u276F"},ZZ={arrowUp:lc.arrowUp,arrowDown:lc.arrowDown,arrowLeft:lc.arrowLeft,arrowRight:lc.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"\u221A",cross:"\xD7",ellipsis:"...",pointerSmall:"\xBB",line:"\u2500",pointer:">"},QZ=process.platform==="win32"?ZZ:lc;x3.exports=QZ});var O3=y((wpe,F3)=>{"use strict";var Qs=ze(),lo=QD(),e0=Object.freeze({password:{scale:1,render:t=>"*".repeat(t.length)},emoji:{scale:2,render:t=>"\u{1F603}".repeat(t.length)},invisible:{scale:0,render:t=>""},default:{scale:1,render:t=>`${t}`}}),eQ=t=>e0[t]||e0.default,fc=Object.freeze({aborted:Qs.red(lo.cross),done:Qs.green(lo.tick),exited:Qs.yellow(lo.cross),default:Qs.cyan("?")}),tQ=(t,e,r)=>e?fc.aborted:r?fc.exited:t?fc.done:fc.default,rQ=t=>Qs.gray(t?lo.ellipsis:lo.pointerSmall),nQ=(t,e)=>Qs.gray(t?e?lo.pointerSmall:"+":lo.line);F3.exports={styles:e0,render:eQ,symbols:fc,symbol:tQ,delimiter:rQ,item:nQ}});var k3=y((_pe,A3)=>{"use strict";var iQ=Gd();A3.exports=function(t,e){let r=String(iQ(t)||"").split(/\r?\n/);return e?r.map(n=>Math.ceil(n.length/e)).reduce((n,i)=>n+i):r.length}});var P3=y((Epe,T3)=>{"use strict";T3.exports=(t,e={})=>{let r=Number.isSafeInteger(parseInt(e.margin))?new Array(parseInt(e.margin)).fill(" ").join(""):e.margin||"",n=e.width;return(t||"").split(/\r?\n/g).map(i=>i.split(/\s+/g).reduce((o,s)=>(s.length+r.length>=n||o[o.length-1].length+s.length+1<n?o[o.length-1]+=` ${s}`:o.push(`${r}${s}`),o),[r]).join(`
66
66
  `)).join(`
67
- `)}});var $3=y((Cpe,R3)=>{"use strict";R3.exports=(t,e,r)=>{r=r||e;let n=Math.min(e-r,t-Math.floor(r/2));n<0&&(n=0);let i=Math.min(n+r,e);return{startIndex:n,endIndex:i}}});var Pr=y((Spe,I3)=>{"use strict";I3.exports={action:v3(),clear:S3(),style:O3(),strip:Kd(),figures:QD(),lines:k3(),wrap:P3(),entriesToDisplay:$3()}});var On=y((xpe,L3)=>{"use strict";var j3=require("readline"),oQ=Pr(),sQ=oQ.action,aQ=require("events"),N3=Te(),uQ=N3.beep,cQ=N3.cursor,lQ=ze(),t0=class extends aQ{constructor(e={}){super(),this.firstRender=!0,this.in=e.stdin||process.stdin,this.out=e.stdout||process.stdout,this.onRender=(e.onRender||(()=>{})).bind(this);let r=j3.createInterface({input:this.in,escapeCodeTimeout:50});j3.emitKeypressEvents(this.in,r),this.in.isTTY&&this.in.setRawMode(!0);let n=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1,i=(o,s)=>{let a=sQ(s,n);a===!1?this._&&this._(o,s):typeof this[a]=="function"?this[a](s):this.bell()};this.close=()=>{this.out.write(cQ.show),this.in.removeListener("keypress",i),this.in.isTTY&&this.in.setRawMode(!1),r.close(),this.emit(this.aborted?"abort":this.exited?"exit":"submit",this.value),this.closed=!0},this.in.on("keypress",i)}fire(){this.emit("state",{value:this.value,aborted:!!this.aborted,exited:!!this.exited})}bell(){this.out.write(uQ)}render(){this.onRender(lQ),this.firstRender&&(this.firstRender=!1)}};L3.exports=t0});var V3=y((Fpe,U3)=>{"use strict";function B3(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(c){r(c);return}a.done?e(u):Promise.resolve(u).then(n,i)}function q3(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function s(u){B3(o,n,i,s,a,"next",u)}function a(u){B3(o,n,i,s,a,"throw",u)}s(void 0)})}}var Yd=ze(),fQ=On(),M3=Te(),dQ=M3.erase,dc=M3.cursor,Jd=Pr(),r0=Jd.style,n0=Jd.clear,hQ=Jd.lines,pQ=Jd.figures,i0=class extends fQ{constructor(e={}){super(e),this.transform=r0.render(e.style),this.scale=this.transform.scale,this.msg=e.message,this.initial=e.initial||"",this.validator=e.validate||(()=>!0),this.value="",this.errorMsg=e.error||"Please Enter A Valid Value",this.cursor=+!!this.initial,this.cursorOffset=0,this.clear=n0("",this.out.columns),this.render()}set value(e){!e&&this.initial?(this.placeholder=!0,this.rendered=Yd.gray(this.transform.render(this.initial))):(this.placeholder=!1,this.rendered=this.transform.render(e)),this._value=e,this.fire()}get value(){return this._value}reset(){this.value="",this.cursor=+!!this.initial,this.cursorOffset=0,this.fire(),this.render()}exit(){this.abort()}abort(){this.value=this.value||this.initial,this.done=this.aborted=!0,this.error=!1,this.red=!1,this.fire(),this.render(),this.out.write(`
67
+ `)}});var $3=y((Cpe,R3)=>{"use strict";R3.exports=(t,e,r)=>{r=r||e;let n=Math.min(e-r,t-Math.floor(r/2));n<0&&(n=0);let i=Math.min(n+r,e);return{startIndex:n,endIndex:i}}});var Pr=y((Spe,I3)=>{"use strict";I3.exports={action:v3(),clear:S3(),style:O3(),strip:Gd(),figures:QD(),lines:k3(),wrap:P3(),entriesToDisplay:$3()}});var On=y((xpe,L3)=>{"use strict";var j3=require("readline"),oQ=Pr(),sQ=oQ.action,aQ=require("events"),N3=Te(),uQ=N3.beep,cQ=N3.cursor,lQ=ze(),t0=class extends aQ{constructor(e={}){super(),this.firstRender=!0,this.in=e.stdin||process.stdin,this.out=e.stdout||process.stdout,this.onRender=(e.onRender||(()=>{})).bind(this);let r=j3.createInterface({input:this.in,escapeCodeTimeout:50});j3.emitKeypressEvents(this.in,r),this.in.isTTY&&this.in.setRawMode(!0);let n=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1,i=(o,s)=>{let a=sQ(s,n);a===!1?this._&&this._(o,s):typeof this[a]=="function"?this[a](s):this.bell()};this.close=()=>{this.out.write(cQ.show),this.in.removeListener("keypress",i),this.in.isTTY&&this.in.setRawMode(!1),r.close(),this.emit(this.aborted?"abort":this.exited?"exit":"submit",this.value),this.closed=!0},this.in.on("keypress",i)}fire(){this.emit("state",{value:this.value,aborted:!!this.aborted,exited:!!this.exited})}bell(){this.out.write(uQ)}render(){this.onRender(lQ),this.firstRender&&(this.firstRender=!1)}};L3.exports=t0});var V3=y((Fpe,U3)=>{"use strict";function B3(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(c){r(c);return}a.done?e(u):Promise.resolve(u).then(n,i)}function q3(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function s(u){B3(o,n,i,s,a,"next",u)}function a(u){B3(o,n,i,s,a,"throw",u)}s(void 0)})}}var Wd=ze(),fQ=On(),M3=Te(),dQ=M3.erase,dc=M3.cursor,Kd=Pr(),r0=Kd.style,n0=Kd.clear,hQ=Kd.lines,pQ=Kd.figures,i0=class extends fQ{constructor(e={}){super(e),this.transform=r0.render(e.style),this.scale=this.transform.scale,this.msg=e.message,this.initial=e.initial||"",this.validator=e.validate||(()=>!0),this.value="",this.errorMsg=e.error||"Please Enter A Valid Value",this.cursor=+!!this.initial,this.cursorOffset=0,this.clear=n0("",this.out.columns),this.render()}set value(e){!e&&this.initial?(this.placeholder=!0,this.rendered=Wd.gray(this.transform.render(this.initial))):(this.placeholder=!1,this.rendered=this.transform.render(e)),this._value=e,this.fire()}get value(){return this._value}reset(){this.value="",this.cursor=+!!this.initial,this.cursorOffset=0,this.fire(),this.render()}exit(){this.abort()}abort(){this.value=this.value||this.initial,this.done=this.aborted=!0,this.error=!1,this.red=!1,this.fire(),this.render(),this.out.write(`
68
68
  `),this.close()}validate(){var e=this;return q3(function*(){let r=yield e.validator(e.value);typeof r=="string"&&(e.errorMsg=r,r=!1),e.error=!r})()}submit(){var e=this;return q3(function*(){if(e.value=e.value||e.initial,e.cursorOffset=0,e.cursor=e.rendered.length,yield e.validate(),e.error){e.red=!0,e.fire(),e.render();return}e.done=!0,e.aborted=!1,e.fire(),e.render(),e.out.write(`
69
- `),e.close()})()}next(){if(!this.placeholder)return this.bell();this.value=this.initial,this.cursor=this.rendered.length,this.fire(),this.render()}moveCursor(e){this.placeholder||(this.cursor=this.cursor+e,this.cursorOffset+=e)}_(e,r){let n=this.value.slice(0,this.cursor),i=this.value.slice(this.cursor);this.value=`${n}${e}${i}`,this.red=!1,this.cursor=this.placeholder?0:n.length+1,this.render()}delete(){if(this.isCursorAtStart())return this.bell();let e=this.value.slice(0,this.cursor-1),r=this.value.slice(this.cursor);this.value=`${e}${r}`,this.red=!1,this.isCursorAtStart()?this.cursorOffset=0:(this.cursorOffset++,this.moveCursor(-1)),this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();let e=this.value.slice(0,this.cursor),r=this.value.slice(this.cursor+1);this.value=`${e}${r}`,this.red=!1,this.isCursorAtEnd()?this.cursorOffset=0:this.cursorOffset++,this.render()}first(){this.cursor=0,this.render()}last(){this.cursor=this.value.length,this.render()}left(){if(this.cursor<=0||this.placeholder)return this.bell();this.moveCursor(-1),this.render()}right(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();this.moveCursor(1),this.render()}isCursorAtStart(){return this.cursor===0||this.placeholder&&this.cursor===1}isCursorAtEnd(){return this.cursor===this.rendered.length||this.placeholder&&this.cursor===this.rendered.length+1}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(dc.down(hQ(this.outputError,this.out.columns)-1)+n0(this.outputError,this.out.columns)),this.out.write(n0(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[r0.symbol(this.done,this.aborted),Yd.bold(this.msg),r0.delimiter(this.done),this.red?Yd.red(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
69
+ `),e.close()})()}next(){if(!this.placeholder)return this.bell();this.value=this.initial,this.cursor=this.rendered.length,this.fire(),this.render()}moveCursor(e){this.placeholder||(this.cursor=this.cursor+e,this.cursorOffset+=e)}_(e,r){let n=this.value.slice(0,this.cursor),i=this.value.slice(this.cursor);this.value=`${n}${e}${i}`,this.red=!1,this.cursor=this.placeholder?0:n.length+1,this.render()}delete(){if(this.isCursorAtStart())return this.bell();let e=this.value.slice(0,this.cursor-1),r=this.value.slice(this.cursor);this.value=`${e}${r}`,this.red=!1,this.isCursorAtStart()?this.cursorOffset=0:(this.cursorOffset++,this.moveCursor(-1)),this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();let e=this.value.slice(0,this.cursor),r=this.value.slice(this.cursor+1);this.value=`${e}${r}`,this.red=!1,this.isCursorAtEnd()?this.cursorOffset=0:this.cursorOffset++,this.render()}first(){this.cursor=0,this.render()}last(){this.cursor=this.value.length,this.render()}left(){if(this.cursor<=0||this.placeholder)return this.bell();this.moveCursor(-1),this.render()}right(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();this.moveCursor(1),this.render()}isCursorAtStart(){return this.cursor===0||this.placeholder&&this.cursor===1}isCursorAtEnd(){return this.cursor===this.rendered.length||this.placeholder&&this.cursor===this.rendered.length+1}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(dc.down(hQ(this.outputError,this.out.columns)-1)+n0(this.outputError,this.out.columns)),this.out.write(n0(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[r0.symbol(this.done,this.aborted),Wd.bold(this.msg),r0.delimiter(this.done),this.red?Wd.red(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
70
70
  `).reduce((e,r,n)=>e+`
71
- ${n?" ":pQ.pointerSmall} ${Yd.red().italic(r)}`,"")),this.out.write(dQ.line+dc.to(0)+this.outputText+dc.save+this.outputError+dc.restore+dc.move(this.cursorOffset,0)))}};U3.exports=i0});var W3=y((Ope,G3)=>{"use strict";var An=ze(),mQ=On(),hc=Pr(),H3=hc.style,z3=hc.clear,Xd=hc.figures,gQ=hc.wrap,yQ=hc.entriesToDisplay,DQ=Te(),vQ=DQ.cursor,o0=class extends mQ{constructor(e={}){super(e),this.msg=e.message,this.hint=e.hint||"- Use arrow-keys. Return to submit.",this.warn=e.warn||"- This option is disabled",this.cursor=e.initial||0,this.choices=e.choices.map((r,n)=>(typeof r=="string"&&(r={title:r,value:n}),{title:r&&(r.title||r.value||r),value:r&&(r.value===void 0?n:r.value),description:r&&r.description,selected:r&&r.selected,disabled:r&&r.disabled})),this.optionsPerPage=e.optionsPerPage||10,this.value=(this.choices[this.cursor]||{}).value,this.clear=z3("",this.out.columns),this.render()}moveCursor(e){this.cursor=e,this.value=this.choices[e].value,this.fire()}reset(){this.moveCursor(0),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
71
+ ${n?" ":pQ.pointerSmall} ${Wd.red().italic(r)}`,"")),this.out.write(dQ.line+dc.to(0)+this.outputText+dc.save+this.outputError+dc.restore+dc.move(this.cursorOffset,0)))}};U3.exports=i0});var W3=y((Ope,G3)=>{"use strict";var An=ze(),mQ=On(),hc=Pr(),H3=hc.style,z3=hc.clear,Yd=hc.figures,gQ=hc.wrap,yQ=hc.entriesToDisplay,DQ=Te(),vQ=DQ.cursor,o0=class extends mQ{constructor(e={}){super(e),this.msg=e.message,this.hint=e.hint||"- Use arrow-keys. Return to submit.",this.warn=e.warn||"- This option is disabled",this.cursor=e.initial||0,this.choices=e.choices.map((r,n)=>(typeof r=="string"&&(r={title:r,value:n}),{title:r&&(r.title||r.value||r),value:r&&(r.value===void 0?n:r.value),description:r&&r.description,selected:r&&r.selected,disabled:r&&r.disabled})),this.optionsPerPage=e.optionsPerPage||10,this.value=(this.choices[this.cursor]||{}).value,this.clear=z3("",this.out.columns),this.render()}moveCursor(e){this.cursor=e,this.value=this.choices[e].value,this.fire()}reset(){this.moveCursor(0),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
72
72
  `),this.close()}submit(){this.selection.disabled?this.bell():(this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
73
73
  `),this.close())}first(){this.moveCursor(0),this.render()}last(){this.moveCursor(this.choices.length-1),this.render()}up(){this.cursor===0?this.moveCursor(this.choices.length-1):this.moveCursor(this.cursor-1),this.render()}down(){this.cursor===this.choices.length-1?this.moveCursor(0):this.moveCursor(this.cursor+1),this.render()}next(){this.moveCursor((this.cursor+1)%this.choices.length),this.render()}_(e,r){if(e===" ")return this.submit()}get selection(){return this.choices[this.cursor]}render(){if(this.closed)return;this.firstRender?this.out.write(vQ.hide):this.out.write(z3(this.outputText,this.out.columns)),super.render();let e=yQ(this.cursor,this.choices.length,this.optionsPerPage),r=e.startIndex,n=e.endIndex;if(this.outputText=[H3.symbol(this.done,this.aborted),An.bold(this.msg),H3.delimiter(!1),this.done?this.selection.title:this.selection.disabled?An.yellow(this.warn):An.gray(this.hint)].join(" "),!this.done){this.outputText+=`
74
- `;for(let i=r;i<n;i++){let o,s,a="",u=this.choices[i];i===r&&r>0?s=Xd.arrowUp:i===n-1&&n<this.choices.length?s=Xd.arrowDown:s=" ",u.disabled?(o=this.cursor===i?An.gray().underline(u.title):An.strikethrough().gray(u.title),s=(this.cursor===i?An.bold().gray(Xd.pointer)+" ":" ")+s):(o=this.cursor===i?An.cyan().underline(u.title):u.title,s=(this.cursor===i?An.cyan(Xd.pointer)+" ":" ")+s,u.description&&this.cursor===i&&(a=` - ${u.description}`,(s.length+o.length+a.length>=this.out.columns||u.description.split(/\r?\n/).length>1)&&(a=`
74
+ `;for(let i=r;i<n;i++){let o,s,a="",u=this.choices[i];i===r&&r>0?s=Yd.arrowUp:i===n-1&&n<this.choices.length?s=Yd.arrowDown:s=" ",u.disabled?(o=this.cursor===i?An.gray().underline(u.title):An.strikethrough().gray(u.title),s=(this.cursor===i?An.bold().gray(Yd.pointer)+" ":" ")+s):(o=this.cursor===i?An.cyan().underline(u.title):u.title,s=(this.cursor===i?An.cyan(Yd.pointer)+" ":" ")+s,u.description&&this.cursor===i&&(a=` - ${u.description}`,(s.length+o.length+a.length>=this.out.columns||u.description.split(/\r?\n/).length>1)&&(a=`
75
75
  `+gQ(u.description,{margin:3,width:this.out.columns})))),this.outputText+=`${s} ${o}${An.gray(a)}
76
- `}}this.out.write(this.outputText)}};G3.exports=o0});var Q3=y((Ape,Z3)=>{"use strict";var Zd=ze(),bQ=On(),J3=Pr(),K3=J3.style,wQ=J3.clear,X3=Te(),Y3=X3.cursor,_Q=X3.erase,s0=class extends bQ{constructor(e={}){super(e),this.msg=e.message,this.value=!!e.initial,this.active=e.active||"on",this.inactive=e.inactive||"off",this.initialValue=this.value,this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
76
+ `}}this.out.write(this.outputText)}};G3.exports=o0});var Q3=y((Ape,Z3)=>{"use strict";var Jd=ze(),bQ=On(),J3=Pr(),K3=J3.style,wQ=J3.clear,X3=Te(),Y3=X3.cursor,_Q=X3.erase,s0=class extends bQ{constructor(e={}){super(e),this.msg=e.message,this.value=!!e.initial,this.active=e.active||"on",this.inactive=e.inactive||"off",this.initialValue=this.value,this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
77
77
  `),this.close()}submit(){this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
78
- `),this.close()}deactivate(){if(this.value===!1)return this.bell();this.value=!1,this.render()}activate(){if(this.value===!0)return this.bell();this.value=!0,this.render()}delete(){this.deactivate()}left(){this.deactivate()}right(){this.activate()}down(){this.deactivate()}up(){this.activate()}next(){this.value=!this.value,this.fire(),this.render()}_(e,r){if(e===" ")this.value=!this.value;else if(e==="1")this.value=!0;else if(e==="0")this.value=!1;else return this.bell();this.render()}render(){this.closed||(this.firstRender?this.out.write(Y3.hide):this.out.write(wQ(this.outputText,this.out.columns)),super.render(),this.outputText=[K3.symbol(this.done,this.aborted),Zd.bold(this.msg),K3.delimiter(this.done),this.value?this.inactive:Zd.cyan().underline(this.inactive),Zd.gray("/"),this.value?Zd.cyan().underline(this.active):this.active].join(" "),this.out.write(_Q.line+Y3.to(0)+this.outputText))}};Z3.exports=s0});var Xr=y((kpe,eT)=>{"use strict";var a0=class t{constructor({token:e,date:r,parts:n,locales:i}){this.token=e,this.date=r||new Date,this.parts=n||[this],this.locales=i||{}}up(){}down(){}next(){let e=this.parts.indexOf(this);return this.parts.find((r,n)=>n>e&&r instanceof t)}setTo(e){}prev(){let e=[].concat(this.parts).reverse(),r=e.indexOf(this);return e.find((n,i)=>i>r&&n instanceof t)}toString(){return String(this.date)}};eT.exports=a0});var rT=y((Tpe,tT)=>{"use strict";var EQ=Xr(),u0=class extends EQ{constructor(e={}){super(e)}up(){this.date.setHours((this.date.getHours()+12)%24)}down(){this.up()}toString(){let e=this.date.getHours()>12?"pm":"am";return/\A/.test(this.token)?e.toUpperCase():e}};tT.exports=u0});var iT=y((Ppe,nT)=>{"use strict";var CQ=Xr(),SQ=t=>(t=t%10,t===1?"st":t===2?"nd":t===3?"rd":"th"),c0=class extends CQ{constructor(e={}){super(e)}up(){this.date.setDate(this.date.getDate()+1)}down(){this.date.setDate(this.date.getDate()-1)}setTo(e){this.date.setDate(parseInt(e.substr(-2)))}toString(){let e=this.date.getDate(),r=this.date.getDay();return this.token==="DD"?String(e).padStart(2,"0"):this.token==="Do"?e+SQ(e):this.token==="d"?r+1:this.token==="ddd"?this.locales.weekdaysShort[r]:this.token==="dddd"?this.locales.weekdays[r]:e}};nT.exports=c0});var sT=y((Rpe,oT)=>{"use strict";var xQ=Xr(),l0=class extends xQ{constructor(e={}){super(e)}up(){this.date.setHours(this.date.getHours()+1)}down(){this.date.setHours(this.date.getHours()-1)}setTo(e){this.date.setHours(parseInt(e.substr(-2)))}toString(){let e=this.date.getHours();return/h/.test(this.token)&&(e=e%12||12),this.token.length>1?String(e).padStart(2,"0"):e}};oT.exports=l0});var uT=y(($pe,aT)=>{"use strict";var FQ=Xr(),f0=class extends FQ{constructor(e={}){super(e)}up(){this.date.setMilliseconds(this.date.getMilliseconds()+1)}down(){this.date.setMilliseconds(this.date.getMilliseconds()-1)}setTo(e){this.date.setMilliseconds(parseInt(e.substr(-this.token.length)))}toString(){return String(this.date.getMilliseconds()).padStart(4,"0").substr(0,this.token.length)}};aT.exports=f0});var lT=y((Ipe,cT)=>{"use strict";var OQ=Xr(),d0=class extends OQ{constructor(e={}){super(e)}up(){this.date.setMinutes(this.date.getMinutes()+1)}down(){this.date.setMinutes(this.date.getMinutes()-1)}setTo(e){this.date.setMinutes(parseInt(e.substr(-2)))}toString(){let e=this.date.getMinutes();return this.token.length>1?String(e).padStart(2,"0"):e}};cT.exports=d0});var dT=y((jpe,fT)=>{"use strict";var AQ=Xr(),h0=class extends AQ{constructor(e={}){super(e)}up(){this.date.setMonth(this.date.getMonth()+1)}down(){this.date.setMonth(this.date.getMonth()-1)}setTo(e){e=parseInt(e.substr(-2))-1,this.date.setMonth(e<0?0:e)}toString(){let e=this.date.getMonth(),r=this.token.length;return r===2?String(e+1).padStart(2,"0"):r===3?this.locales.monthsShort[e]:r===4?this.locales.months[e]:String(e+1)}};fT.exports=h0});var pT=y((Npe,hT)=>{"use strict";var kQ=Xr(),p0=class extends kQ{constructor(e={}){super(e)}up(){this.date.setSeconds(this.date.getSeconds()+1)}down(){this.date.setSeconds(this.date.getSeconds()-1)}setTo(e){this.date.setSeconds(parseInt(e.substr(-2)))}toString(){let e=this.date.getSeconds();return this.token.length>1?String(e).padStart(2,"0"):e}};hT.exports=p0});var gT=y((Lpe,mT)=>{"use strict";var TQ=Xr(),m0=class extends TQ{constructor(e={}){super(e)}up(){this.date.setFullYear(this.date.getFullYear()+1)}down(){this.date.setFullYear(this.date.getFullYear()-1)}setTo(e){this.date.setFullYear(e.substr(-4))}toString(){let e=String(this.date.getFullYear()).padStart(4,"0");return this.token.length===2?e.substr(-2):e}};mT.exports=m0});var DT=y((Bpe,yT)=>{"use strict";yT.exports={DatePart:Xr(),Meridiem:rT(),Day:iT(),Hours:sT(),Milliseconds:uT(),Minutes:lT(),Month:dT(),Seconds:pT(),Year:gT()}});var OT=y((qpe,FT)=>{"use strict";function vT(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(c){r(c);return}a.done?e(u):Promise.resolve(u).then(n,i)}function bT(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function s(u){vT(o,n,i,s,a,"next",u)}function a(u){vT(o,n,i,s,a,"throw",u)}s(void 0)})}}var g0=ze(),PQ=On(),D0=Pr(),wT=D0.style,_T=D0.clear,RQ=D0.figures,xT=Te(),$Q=xT.erase,ET=xT.cursor,kn=DT(),CT=kn.DatePart,IQ=kn.Meridiem,jQ=kn.Day,NQ=kn.Hours,LQ=kn.Milliseconds,BQ=kn.Minutes,qQ=kn.Month,MQ=kn.Seconds,UQ=kn.Year,VQ=/\\(.)|"((?:\\["\\]|[^"])+)"|(D[Do]?|d{3,4}|d)|(M{1,4})|(YY(?:YY)?)|([aA])|([Hh]{1,2})|(m{1,2})|(s{1,2})|(S{1,4})|./g,ST={1:({token:t})=>t.replace(/\\(.)/g,"$1"),2:t=>new jQ(t),3:t=>new qQ(t),4:t=>new UQ(t),5:t=>new IQ(t),6:t=>new NQ(t),7:t=>new BQ(t),8:t=>new MQ(t),9:t=>new LQ(t)},HQ={months:"January,February,March,April,May,June,July,August,September,October,November,December".split(","),monthsShort:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","),weekdays:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","),weekdaysShort:"Sun,Mon,Tue,Wed,Thu,Fri,Sat".split(",")},y0=class extends PQ{constructor(e={}){super(e),this.msg=e.message,this.cursor=0,this.typed="",this.locales=Object.assign(HQ,e.locales),this._date=e.initial||new Date,this.errorMsg=e.error||"Please Enter A Valid Value",this.validator=e.validate||(()=>!0),this.mask=e.mask||"YYYY-MM-DD HH:mm:ss",this.clear=_T("",this.out.columns),this.render()}get value(){return this.date}get date(){return this._date}set date(e){e&&this._date.setTime(e.getTime())}set mask(e){let r;for(this.parts=[];r=VQ.exec(e);){let i=r.shift(),o=r.findIndex(s=>s!=null);this.parts.push(o in ST?ST[o]({token:r[o]||i,date:this.date,parts:this.parts,locales:this.locales}):r[o]||i)}let n=this.parts.reduce((i,o)=>(typeof o=="string"&&typeof i[i.length-1]=="string"?i[i.length-1]+=o:i.push(o),i),[]);this.parts.splice(0),this.parts.push(...n),this.reset()}moveCursor(e){this.typed="",this.cursor=e,this.fire()}reset(){this.moveCursor(this.parts.findIndex(e=>e instanceof CT)),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
78
+ `),this.close()}deactivate(){if(this.value===!1)return this.bell();this.value=!1,this.render()}activate(){if(this.value===!0)return this.bell();this.value=!0,this.render()}delete(){this.deactivate()}left(){this.deactivate()}right(){this.activate()}down(){this.deactivate()}up(){this.activate()}next(){this.value=!this.value,this.fire(),this.render()}_(e,r){if(e===" ")this.value=!this.value;else if(e==="1")this.value=!0;else if(e==="0")this.value=!1;else return this.bell();this.render()}render(){this.closed||(this.firstRender?this.out.write(Y3.hide):this.out.write(wQ(this.outputText,this.out.columns)),super.render(),this.outputText=[K3.symbol(this.done,this.aborted),Jd.bold(this.msg),K3.delimiter(this.done),this.value?this.inactive:Jd.cyan().underline(this.inactive),Jd.gray("/"),this.value?Jd.cyan().underline(this.active):this.active].join(" "),this.out.write(_Q.line+Y3.to(0)+this.outputText))}};Z3.exports=s0});var Xr=y((kpe,eT)=>{"use strict";var a0=class t{constructor({token:e,date:r,parts:n,locales:i}){this.token=e,this.date=r||new Date,this.parts=n||[this],this.locales=i||{}}up(){}down(){}next(){let e=this.parts.indexOf(this);return this.parts.find((r,n)=>n>e&&r instanceof t)}setTo(e){}prev(){let e=[].concat(this.parts).reverse(),r=e.indexOf(this);return e.find((n,i)=>i>r&&n instanceof t)}toString(){return String(this.date)}};eT.exports=a0});var rT=y((Tpe,tT)=>{"use strict";var EQ=Xr(),u0=class extends EQ{constructor(e={}){super(e)}up(){this.date.setHours((this.date.getHours()+12)%24)}down(){this.up()}toString(){let e=this.date.getHours()>12?"pm":"am";return/\A/.test(this.token)?e.toUpperCase():e}};tT.exports=u0});var iT=y((Ppe,nT)=>{"use strict";var CQ=Xr(),SQ=t=>(t=t%10,t===1?"st":t===2?"nd":t===3?"rd":"th"),c0=class extends CQ{constructor(e={}){super(e)}up(){this.date.setDate(this.date.getDate()+1)}down(){this.date.setDate(this.date.getDate()-1)}setTo(e){this.date.setDate(parseInt(e.substr(-2)))}toString(){let e=this.date.getDate(),r=this.date.getDay();return this.token==="DD"?String(e).padStart(2,"0"):this.token==="Do"?e+SQ(e):this.token==="d"?r+1:this.token==="ddd"?this.locales.weekdaysShort[r]:this.token==="dddd"?this.locales.weekdays[r]:e}};nT.exports=c0});var sT=y((Rpe,oT)=>{"use strict";var xQ=Xr(),l0=class extends xQ{constructor(e={}){super(e)}up(){this.date.setHours(this.date.getHours()+1)}down(){this.date.setHours(this.date.getHours()-1)}setTo(e){this.date.setHours(parseInt(e.substr(-2)))}toString(){let e=this.date.getHours();return/h/.test(this.token)&&(e=e%12||12),this.token.length>1?String(e).padStart(2,"0"):e}};oT.exports=l0});var uT=y(($pe,aT)=>{"use strict";var FQ=Xr(),f0=class extends FQ{constructor(e={}){super(e)}up(){this.date.setMilliseconds(this.date.getMilliseconds()+1)}down(){this.date.setMilliseconds(this.date.getMilliseconds()-1)}setTo(e){this.date.setMilliseconds(parseInt(e.substr(-this.token.length)))}toString(){return String(this.date.getMilliseconds()).padStart(4,"0").substr(0,this.token.length)}};aT.exports=f0});var lT=y((Ipe,cT)=>{"use strict";var OQ=Xr(),d0=class extends OQ{constructor(e={}){super(e)}up(){this.date.setMinutes(this.date.getMinutes()+1)}down(){this.date.setMinutes(this.date.getMinutes()-1)}setTo(e){this.date.setMinutes(parseInt(e.substr(-2)))}toString(){let e=this.date.getMinutes();return this.token.length>1?String(e).padStart(2,"0"):e}};cT.exports=d0});var dT=y((jpe,fT)=>{"use strict";var AQ=Xr(),h0=class extends AQ{constructor(e={}){super(e)}up(){this.date.setMonth(this.date.getMonth()+1)}down(){this.date.setMonth(this.date.getMonth()-1)}setTo(e){e=parseInt(e.substr(-2))-1,this.date.setMonth(e<0?0:e)}toString(){let e=this.date.getMonth(),r=this.token.length;return r===2?String(e+1).padStart(2,"0"):r===3?this.locales.monthsShort[e]:r===4?this.locales.months[e]:String(e+1)}};fT.exports=h0});var pT=y((Npe,hT)=>{"use strict";var kQ=Xr(),p0=class extends kQ{constructor(e={}){super(e)}up(){this.date.setSeconds(this.date.getSeconds()+1)}down(){this.date.setSeconds(this.date.getSeconds()-1)}setTo(e){this.date.setSeconds(parseInt(e.substr(-2)))}toString(){let e=this.date.getSeconds();return this.token.length>1?String(e).padStart(2,"0"):e}};hT.exports=p0});var gT=y((Lpe,mT)=>{"use strict";var TQ=Xr(),m0=class extends TQ{constructor(e={}){super(e)}up(){this.date.setFullYear(this.date.getFullYear()+1)}down(){this.date.setFullYear(this.date.getFullYear()-1)}setTo(e){this.date.setFullYear(e.substr(-4))}toString(){let e=String(this.date.getFullYear()).padStart(4,"0");return this.token.length===2?e.substr(-2):e}};mT.exports=m0});var DT=y((Bpe,yT)=>{"use strict";yT.exports={DatePart:Xr(),Meridiem:rT(),Day:iT(),Hours:sT(),Milliseconds:uT(),Minutes:lT(),Month:dT(),Seconds:pT(),Year:gT()}});var OT=y((qpe,FT)=>{"use strict";function vT(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(c){r(c);return}a.done?e(u):Promise.resolve(u).then(n,i)}function bT(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function s(u){vT(o,n,i,s,a,"next",u)}function a(u){vT(o,n,i,s,a,"throw",u)}s(void 0)})}}var g0=ze(),PQ=On(),D0=Pr(),wT=D0.style,_T=D0.clear,RQ=D0.figures,xT=Te(),$Q=xT.erase,ET=xT.cursor,kn=DT(),CT=kn.DatePart,IQ=kn.Meridiem,jQ=kn.Day,NQ=kn.Hours,LQ=kn.Milliseconds,BQ=kn.Minutes,qQ=kn.Month,MQ=kn.Seconds,UQ=kn.Year,VQ=/\\(.)|"((?:\\["\\]|[^"])+)"|(D[Do]?|d{3,4}|d)|(M{1,4})|(YY(?:YY)?)|([aA])|([Hh]{1,2})|(m{1,2})|(s{1,2})|(S{1,4})|./g,ST={1:({token:t})=>t.replace(/\\(.)/g,"$1"),2:t=>new jQ(t),3:t=>new qQ(t),4:t=>new UQ(t),5:t=>new IQ(t),6:t=>new NQ(t),7:t=>new BQ(t),8:t=>new MQ(t),9:t=>new LQ(t)},HQ={months:"January,February,March,April,May,June,July,August,September,October,November,December".split(","),monthsShort:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","),weekdays:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","),weekdaysShort:"Sun,Mon,Tue,Wed,Thu,Fri,Sat".split(",")},y0=class extends PQ{constructor(e={}){super(e),this.msg=e.message,this.cursor=0,this.typed="",this.locales=Object.assign(HQ,e.locales),this._date=e.initial||new Date,this.errorMsg=e.error||"Please Enter A Valid Value",this.validator=e.validate||(()=>!0),this.mask=e.mask||"YYYY-MM-DD HH:mm:ss",this.clear=_T("",this.out.columns),this.render()}get value(){return this.date}get date(){return this._date}set date(e){e&&this._date.setTime(e.getTime())}set mask(e){let r;for(this.parts=[];r=VQ.exec(e);){let i=r.shift(),o=r.findIndex(s=>s!=null);this.parts.push(o in ST?ST[o]({token:r[o]||i,date:this.date,parts:this.parts,locales:this.locales}):r[o]||i)}let n=this.parts.reduce((i,o)=>(typeof o=="string"&&typeof i[i.length-1]=="string"?i[i.length-1]+=o:i.push(o),i),[]);this.parts.splice(0),this.parts.push(...n),this.reset()}moveCursor(e){this.typed="",this.cursor=e,this.fire()}reset(){this.moveCursor(this.parts.findIndex(e=>e instanceof CT)),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
79
79
  `),this.close()}validate(){var e=this;return bT(function*(){let r=yield e.validator(e.value);typeof r=="string"&&(e.errorMsg=r,r=!1),e.error=!r})()}submit(){var e=this;return bT(function*(){if(yield e.validate(),e.error){e.color="red",e.fire(),e.render();return}e.done=!0,e.aborted=!1,e.fire(),e.render(),e.out.write(`
80
80
  `),e.close()})()}up(){this.typed="",this.parts[this.cursor].up(),this.render()}down(){this.typed="",this.parts[this.cursor].down(),this.render()}left(){let e=this.parts[this.cursor].prev();if(e==null)return this.bell();this.moveCursor(this.parts.indexOf(e)),this.render()}right(){let e=this.parts[this.cursor].next();if(e==null)return this.bell();this.moveCursor(this.parts.indexOf(e)),this.render()}next(){let e=this.parts[this.cursor].next();this.moveCursor(e?this.parts.indexOf(e):this.parts.findIndex(r=>r instanceof CT)),this.render()}_(e){/\d/.test(e)&&(this.typed+=e,this.parts[this.cursor].setTo(this.typed),this.render())}render(){this.closed||(this.firstRender?this.out.write(ET.hide):this.out.write(_T(this.outputText,this.out.columns)),super.render(),this.outputText=[wT.symbol(this.done,this.aborted),g0.bold(this.msg),wT.delimiter(!1),this.parts.reduce((e,r,n)=>e.concat(n===this.cursor&&!this.done?g0.cyan().underline(r.toString()):r),[]).join("")].join(" "),this.error&&(this.outputText+=this.errorMsg.split(`
81
81
  `).reduce((e,r,n)=>e+`
82
- ${n?" ":RQ.pointerSmall} ${g0.red().italic(r)}`,"")),this.out.write($Q.line+ET.to(0)+this.outputText))}};FT.exports=y0});var IT=y((Mpe,$T)=>{"use strict";function AT(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(c){r(c);return}a.done?e(u):Promise.resolve(u).then(n,i)}function kT(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function s(u){AT(o,n,i,s,a,"next",u)}function a(u){AT(o,n,i,s,a,"throw",u)}s(void 0)})}}var Qd=ze(),zQ=On(),RT=Te(),eh=RT.cursor,GQ=RT.erase,th=Pr(),v0=th.style,WQ=th.figures,TT=th.clear,KQ=th.lines,YQ=/[0-9]/,b0=t=>t!==void 0,PT=(t,e)=>{let r=Math.pow(10,e);return Math.round(t*r)/r},w0=class extends zQ{constructor(e={}){super(e),this.transform=v0.render(e.style),this.msg=e.message,this.initial=b0(e.initial)?e.initial:"",this.float=!!e.float,this.round=e.round||2,this.inc=e.increment||1,this.min=b0(e.min)?e.min:-1/0,this.max=b0(e.max)?e.max:1/0,this.errorMsg=e.error||"Please Enter A Valid Value",this.validator=e.validate||(()=>!0),this.color="cyan",this.value="",this.typed="",this.lastHit=0,this.render()}set value(e){!e&&e!==0?(this.placeholder=!0,this.rendered=Qd.gray(this.transform.render(`${this.initial}`)),this._value=""):(this.placeholder=!1,this.rendered=this.transform.render(`${PT(e,this.round)}`),this._value=PT(e,this.round)),this.fire()}get value(){return this._value}parse(e){return this.float?parseFloat(e):parseInt(e)}valid(e){return e==="-"||e==="."&&this.float||YQ.test(e)}reset(){this.typed="",this.value="",this.fire(),this.render()}exit(){this.abort()}abort(){let e=this.value;this.value=e!==""?e:this.initial,this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
82
+ ${n?" ":RQ.pointerSmall} ${g0.red().italic(r)}`,"")),this.out.write($Q.line+ET.to(0)+this.outputText))}};FT.exports=y0});var IT=y((Mpe,$T)=>{"use strict";function AT(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(c){r(c);return}a.done?e(u):Promise.resolve(u).then(n,i)}function kT(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function s(u){AT(o,n,i,s,a,"next",u)}function a(u){AT(o,n,i,s,a,"throw",u)}s(void 0)})}}var Xd=ze(),zQ=On(),RT=Te(),Zd=RT.cursor,GQ=RT.erase,Qd=Pr(),v0=Qd.style,WQ=Qd.figures,TT=Qd.clear,KQ=Qd.lines,YQ=/[0-9]/,b0=t=>t!==void 0,PT=(t,e)=>{let r=Math.pow(10,e);return Math.round(t*r)/r},w0=class extends zQ{constructor(e={}){super(e),this.transform=v0.render(e.style),this.msg=e.message,this.initial=b0(e.initial)?e.initial:"",this.float=!!e.float,this.round=e.round||2,this.inc=e.increment||1,this.min=b0(e.min)?e.min:-1/0,this.max=b0(e.max)?e.max:1/0,this.errorMsg=e.error||"Please Enter A Valid Value",this.validator=e.validate||(()=>!0),this.color="cyan",this.value="",this.typed="",this.lastHit=0,this.render()}set value(e){!e&&e!==0?(this.placeholder=!0,this.rendered=Xd.gray(this.transform.render(`${this.initial}`)),this._value=""):(this.placeholder=!1,this.rendered=this.transform.render(`${PT(e,this.round)}`),this._value=PT(e,this.round)),this.fire()}get value(){return this._value}parse(e){return this.float?parseFloat(e):parseInt(e)}valid(e){return e==="-"||e==="."&&this.float||YQ.test(e)}reset(){this.typed="",this.value="",this.fire(),this.render()}exit(){this.abort()}abort(){let e=this.value;this.value=e!==""?e:this.initial,this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
83
83
  `),this.close()}validate(){var e=this;return kT(function*(){let r=yield e.validator(e.value);typeof r=="string"&&(e.errorMsg=r,r=!1),e.error=!r})()}submit(){var e=this;return kT(function*(){if(yield e.validate(),e.error){e.color="red",e.fire(),e.render();return}let r=e.value;e.value=r!==""?r:e.initial,e.done=!0,e.aborted=!1,e.error=!1,e.fire(),e.render(),e.out.write(`
84
- `),e.close()})()}up(){if(this.typed="",this.value===""&&(this.value=this.min-this.inc),this.value>=this.max)return this.bell();this.value+=this.inc,this.color="cyan",this.fire(),this.render()}down(){if(this.typed="",this.value===""&&(this.value=this.min+this.inc),this.value<=this.min)return this.bell();this.value-=this.inc,this.color="cyan",this.fire(),this.render()}delete(){let e=this.value.toString();if(e.length===0)return this.bell();this.value=this.parse(e=e.slice(0,-1))||"",this.value!==""&&this.value<this.min&&(this.value=this.min),this.color="cyan",this.fire(),this.render()}next(){this.value=this.initial,this.fire(),this.render()}_(e,r){if(!this.valid(e))return this.bell();let n=Date.now();if(n-this.lastHit>1e3&&(this.typed=""),this.typed+=e,this.lastHit=n,this.color="cyan",e===".")return this.fire();this.value=Math.min(this.parse(this.typed),this.max),this.value>this.max&&(this.value=this.max),this.value<this.min&&(this.value=this.min),this.fire(),this.render()}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(eh.down(KQ(this.outputError,this.out.columns)-1)+TT(this.outputError,this.out.columns)),this.out.write(TT(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[v0.symbol(this.done,this.aborted),Qd.bold(this.msg),v0.delimiter(this.done),!this.done||!this.done&&!this.placeholder?Qd[this.color]().underline(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
84
+ `),e.close()})()}up(){if(this.typed="",this.value===""&&(this.value=this.min-this.inc),this.value>=this.max)return this.bell();this.value+=this.inc,this.color="cyan",this.fire(),this.render()}down(){if(this.typed="",this.value===""&&(this.value=this.min+this.inc),this.value<=this.min)return this.bell();this.value-=this.inc,this.color="cyan",this.fire(),this.render()}delete(){let e=this.value.toString();if(e.length===0)return this.bell();this.value=this.parse(e=e.slice(0,-1))||"",this.value!==""&&this.value<this.min&&(this.value=this.min),this.color="cyan",this.fire(),this.render()}next(){this.value=this.initial,this.fire(),this.render()}_(e,r){if(!this.valid(e))return this.bell();let n=Date.now();if(n-this.lastHit>1e3&&(this.typed=""),this.typed+=e,this.lastHit=n,this.color="cyan",e===".")return this.fire();this.value=Math.min(this.parse(this.typed),this.max),this.value>this.max&&(this.value=this.max),this.value<this.min&&(this.value=this.min),this.fire(),this.render()}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(Zd.down(KQ(this.outputError,this.out.columns)-1)+TT(this.outputError,this.out.columns)),this.out.write(TT(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[v0.symbol(this.done,this.aborted),Xd.bold(this.msg),v0.delimiter(this.done),!this.done||!this.done&&!this.placeholder?Xd[this.color]().underline(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
85
85
  `).reduce((e,r,n)=>e+`
86
- ${n?" ":WQ.pointerSmall} ${Qd.red().italic(r)}`,"")),this.out.write(GQ.line+eh.to(0)+this.outputText+eh.save+this.outputError+eh.restore))}};$T.exports=w0});var E0=y((Upe,LT)=>{"use strict";var Zr=ze(),JQ=Te(),XQ=JQ.cursor,ZQ=On(),pc=Pr(),jT=pc.clear,fi=pc.figures,NT=pc.style,QQ=pc.wrap,eee=pc.entriesToDisplay,_0=class extends ZQ{constructor(e={}){super(e),this.msg=e.message,this.cursor=e.cursor||0,this.scrollIndex=e.cursor||0,this.hint=e.hint||"",this.warn=e.warn||"- This option is disabled -",this.minSelected=e.min,this.showMinError=!1,this.maxChoices=e.max,this.instructions=e.instructions,this.optionsPerPage=e.optionsPerPage||10,this.value=e.choices.map((r,n)=>(typeof r=="string"&&(r={title:r,value:n}),{title:r&&(r.title||r.value||r),description:r&&r.description,value:r&&(r.value===void 0?n:r.value),selected:r&&r.selected,disabled:r&&r.disabled})),this.clear=jT("",this.out.columns),e.overrideRender||this.render()}reset(){this.value.map(e=>!e.selected),this.cursor=0,this.fire(),this.render()}selected(){return this.value.filter(e=>e.selected)}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
86
+ ${n?" ":WQ.pointerSmall} ${Xd.red().italic(r)}`,"")),this.out.write(GQ.line+Zd.to(0)+this.outputText+Zd.save+this.outputError+Zd.restore))}};$T.exports=w0});var E0=y((Upe,LT)=>{"use strict";var Zr=ze(),JQ=Te(),XQ=JQ.cursor,ZQ=On(),pc=Pr(),jT=pc.clear,fi=pc.figures,NT=pc.style,QQ=pc.wrap,eee=pc.entriesToDisplay,_0=class extends ZQ{constructor(e={}){super(e),this.msg=e.message,this.cursor=e.cursor||0,this.scrollIndex=e.cursor||0,this.hint=e.hint||"",this.warn=e.warn||"- This option is disabled -",this.minSelected=e.min,this.showMinError=!1,this.maxChoices=e.max,this.instructions=e.instructions,this.optionsPerPage=e.optionsPerPage||10,this.value=e.choices.map((r,n)=>(typeof r=="string"&&(r={title:r,value:n}),{title:r&&(r.title||r.value||r),description:r&&r.description,value:r&&(r.value===void 0?n:r.value),selected:r&&r.selected,disabled:r&&r.disabled})),this.clear=jT("",this.out.columns),e.overrideRender||this.render()}reset(){this.value.map(e=>!e.selected),this.cursor=0,this.fire(),this.render()}selected(){return this.value.filter(e=>e.selected)}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
87
87
  `),this.close()}submit(){let e=this.value.filter(r=>r.selected);this.minSelected&&e.length<this.minSelected?(this.showMinError=!0,this.render()):(this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
88
88
  `),this.close())}first(){this.cursor=0,this.render()}last(){this.cursor=this.value.length-1,this.render()}next(){this.cursor=(this.cursor+1)%this.value.length,this.render()}up(){this.cursor===0?this.cursor=this.value.length-1:this.cursor--,this.render()}down(){this.cursor===this.value.length-1?this.cursor=0:this.cursor++,this.render()}left(){this.value[this.cursor].selected=!1,this.render()}right(){if(this.value.filter(e=>e.selected).length>=this.maxChoices)return this.bell();this.value[this.cursor].selected=!0,this.render()}handleSpaceToggle(){let e=this.value[this.cursor];if(e.selected)e.selected=!1,this.render();else{if(e.disabled||this.value.filter(r=>r.selected).length>=this.maxChoices)return this.bell();e.selected=!0,this.render()}}toggleAll(){if(this.maxChoices!==void 0||this.value[this.cursor].disabled)return this.bell();let e=!this.value[this.cursor].selected;this.value.filter(r=>!r.disabled).forEach(r=>r.selected=e),this.render()}_(e,r){if(e===" ")this.handleSpaceToggle();else if(e==="a")this.toggleAll();else return this.bell()}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
89
89
  Instructions:
@@ -109,29 +109,29 @@ Instructions:
109
109
  Filtered results for: ${this.inputValue?this.inputValue:Tn.gray("Enter something to filter")}
110
110
  `}renderOption(e,r,n){let i;return r.disabled?i=e===n?Tn.gray().underline(r.title):Tn.strikethrough().gray(r.title):i=e===n?Tn.cyan().underline(r.title):r.title,(r.selected?Tn.green(ea.radioOn):ea.radioOff)+" "+i}renderDoneOrInstructions(){if(this.done)return this.value.filter(r=>r.selected).map(r=>r.title).join(", ");let e=[Tn.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&e.push(Tn.yellow(this.warn)),e.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(cee.hide),super.render();let e=[WT.symbol(this.done,this.aborted),Tn.bold(this.msg),WT.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(e+=Tn.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),e+=this.renderOptions(this.filteredOptions),this.out.write(this.clear+e),this.clear=GT(e,this.out.columns)}};KT.exports=F0});var rP=y((zpe,tP)=>{"use strict";var JT=ze(),fee=On(),QT=Pr(),XT=QT.style,dee=QT.clear,eP=Te(),hee=eP.erase,ZT=eP.cursor,A0=class extends fee{constructor(e={}){super(e),this.msg=e.message,this.value=e.initial,this.initialValue=!!e.initial,this.yesMsg=e.yes||"yes",this.yesOption=e.yesOption||"(Y/n)",this.noMsg=e.no||"no",this.noOption=e.noOption||"(y/N)",this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
111
111
  `),this.close()}submit(){this.value=this.value||!1,this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
112
- `),this.close()}_(e,r){return e.toLowerCase()==="y"?(this.value=!0,this.submit()):e.toLowerCase()==="n"?(this.value=!1,this.submit()):this.bell()}render(){this.closed||(this.firstRender?this.out.write(ZT.hide):this.out.write(dee(this.outputText,this.out.columns)),super.render(),this.outputText=[XT.symbol(this.done,this.aborted),JT.bold(this.msg),XT.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:JT.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(hee.line+ZT.to(0)+this.outputText))}};tP.exports=A0});var iP=y((Gpe,nP)=>{"use strict";nP.exports={TextPrompt:V3(),SelectPrompt:W3(),TogglePrompt:Q3(),DatePrompt:OT(),NumberPrompt:IT(),MultiselectPrompt:E0(),AutocompletePrompt:zT(),AutocompleteMultiselectPrompt:YT(),ConfirmPrompt:rP()}});var sP=y(oP=>{"use strict";var Yt=oP,pee=iP(),rh=t=>t;function Qr(t,e,r={}){return new Promise((n,i)=>{let o=new pee[t](e),s=r.onAbort||rh,a=r.onSubmit||rh,u=r.onExit||rh;o.on("state",e.onState||rh),o.on("submit",c=>n(a(c))),o.on("exit",c=>n(u(c))),o.on("abort",c=>i(s(c)))})}Yt.text=t=>Qr("TextPrompt",t);Yt.password=t=>(t.style="password",Yt.text(t));Yt.invisible=t=>(t.style="invisible",Yt.text(t));Yt.number=t=>Qr("NumberPrompt",t);Yt.date=t=>Qr("DatePrompt",t);Yt.confirm=t=>Qr("ConfirmPrompt",t);Yt.list=t=>{let e=t.separator||",";return Qr("TextPrompt",t,{onSubmit:r=>r.split(e).map(n=>n.trim())})};Yt.toggle=t=>Qr("TogglePrompt",t);Yt.select=t=>Qr("SelectPrompt",t);Yt.multiselect=t=>{t.choices=[].concat(t.choices||[]);let e=r=>r.filter(n=>n.selected).map(n=>n.value);return Qr("MultiselectPrompt",t,{onAbort:e,onSubmit:e})};Yt.autocompleteMultiselect=t=>{t.choices=[].concat(t.choices||[]);let e=r=>r.filter(n=>n.selected).map(n=>n.value);return Qr("AutocompleteMultiselectPrompt",t,{onAbort:e,onSubmit:e})};var mee=(t,e)=>Promise.resolve(e.filter(r=>r.title.slice(0,t.length).toLowerCase()===t.toLowerCase()));Yt.autocomplete=t=>(t.suggest=t.suggest||mee,t.choices=[].concat(t.choices||[]),Qr("AutocompletePrompt",t))});var pP=y((Kpe,hP)=>{"use strict";function aP(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function uP(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?aP(Object(r),!0).forEach(function(n){gee(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):aP(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function gee(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function yee(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=Dee(t))||e&&t&&typeof t.length=="number"){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(c){throw c},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
113
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,s=!1,a;return{s:function(){r=r.call(t)},n:function(){var c=r.next();return o=c.done,c},e:function(c){s=!0,a=c},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(s)throw a}}}}function Dee(t,e){if(t){if(typeof t=="string")return cP(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return cP(t,e)}}function cP(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function lP(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(c){r(c);return}a.done?e(u):Promise.resolve(u).then(n,i)}function fP(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function s(u){lP(o,n,i,s,a,"next",u)}function a(u){lP(o,n,i,s,a,"throw",u)}s(void 0)})}}var k0=sP(),vee=["suggest","format","onState","validate","onRender","type"],dP=()=>{};function di(){return T0.apply(this,arguments)}function T0(){return T0=fP(function*(t=[],{onSubmit:e=dP,onCancel:r=dP}={}){let n={},i=di._override||{};t=[].concat(t);let o,s,a,u,c,l,f=function(){var g=fP(function*(w,x,D=!1){if(!(!D&&w.validate&&w.validate(x)!==!0))return w.format?yield w.format(x,n):x});return function(x,D){return g.apply(this,arguments)}}();var h=yee(t),d;try{for(h.s();!(d=h.n()).done;){s=d.value;var p=s;if(u=p.name,c=p.type,typeof c=="function"&&(c=yield c(o,uP({},n),s),s.type=c),!!c){for(let g in s){if(vee.includes(g))continue;let w=s[g];s[g]=typeof w=="function"?yield w(o,uP({},n),l):w}if(l=s,typeof s.message!="string")throw new Error("prompt message is required");var v=s;if(u=v.name,c=v.type,k0[c]===void 0)throw new Error(`prompt type (${c}) is not defined`);if(i[s.name]!==void 0&&(o=yield f(s,i[s.name]),o!==void 0)){n[u]=o;continue}try{o=di._injected?bee(di._injected,s.initial):yield k0[c](s),n[u]=o=yield f(s,o,!0),a=yield e(s,o,n)}catch{a=!(yield r(s,n))}if(a)return n}}}catch(g){h.e(g)}finally{h.f()}return n}),T0.apply(this,arguments)}function bee(t,e){let r=t.shift();if(r instanceof Error)throw r;return r===void 0?e:r}function wee(t){di._injected=(di._injected||[]).concat(t)}function _ee(t){di._override=Object.assign({},t)}hP.exports=Object.assign(di,{prompt:di,prompts:k0,inject:wee,override:_ee})});var gP=y((Ype,mP)=>{"use strict";mP.exports=(t,e)=>{if(!(t.meta&&t.name!=="escape")){if(t.ctrl){if(t.name==="a")return"first";if(t.name==="c"||t.name==="d")return"abort";if(t.name==="e")return"last";if(t.name==="g")return"reset"}if(e){if(t.name==="j")return"down";if(t.name==="k")return"up"}return t.name==="return"||t.name==="enter"?"submit":t.name==="backspace"?"delete":t.name==="delete"?"deleteForward":t.name==="abort"?"abort":t.name==="escape"?"exit":t.name==="tab"?"next":t.name==="pagedown"?"nextPage":t.name==="pageup"?"prevPage":t.name==="home"?"home":t.name==="end"?"end":t.name==="up"?"up":t.name==="down"?"down":t.name==="right"?"right":t.name==="left"?"left":!1}}});var nh=y((Jpe,yP)=>{"use strict";yP.exports=t=>{let e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))"].join("|"),r=new RegExp(e,"g");return typeof t=="string"?t.replace(r,""):t}});var bP=y((Xpe,vP)=>{"use strict";var Eee=nh(),{erase:DP,cursor:Cee}=Te(),See=t=>[...Eee(t)].length;vP.exports=function(t,e){if(!e)return DP.line+Cee.to(0);let r=0,n=t.split(/\r?\n/);for(let i of n)r+=1+Math.floor(Math.max(See(i)-1,0)/e);return DP.lines(r)}});var P0=y((Zpe,wP)=>{"use strict";var yc={arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",radioOn:"\u25C9",radioOff:"\u25EF",tick:"\u2714",cross:"\u2716",ellipsis:"\u2026",pointerSmall:"\u203A",line:"\u2500",pointer:"\u276F"},xee={arrowUp:yc.arrowUp,arrowDown:yc.arrowDown,arrowLeft:yc.arrowLeft,arrowRight:yc.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"\u221A",cross:"\xD7",ellipsis:"...",pointerSmall:"\xBB",line:"\u2500",pointer:">"},Fee=process.platform==="win32"?xee:yc;wP.exports=Fee});var EP=y((Qpe,_P)=>{"use strict";var ta=ze(),ho=P0(),R0=Object.freeze({password:{scale:1,render:t=>"*".repeat(t.length)},emoji:{scale:2,render:t=>"\u{1F603}".repeat(t.length)},invisible:{scale:0,render:t=>""},default:{scale:1,render:t=>`${t}`}}),Oee=t=>R0[t]||R0.default,Dc=Object.freeze({aborted:ta.red(ho.cross),done:ta.green(ho.tick),exited:ta.yellow(ho.cross),default:ta.cyan("?")}),Aee=(t,e,r)=>e?Dc.aborted:r?Dc.exited:t?Dc.done:Dc.default,kee=t=>ta.gray(t?ho.ellipsis:ho.pointerSmall),Tee=(t,e)=>ta.gray(t?e?ho.pointerSmall:"+":ho.line);_P.exports={styles:R0,render:Oee,symbols:Dc,symbol:Aee,delimiter:kee,item:Tee}});var SP=y((eme,CP)=>{"use strict";var Pee=nh();CP.exports=function(t,e){let r=String(Pee(t)||"").split(/\r?\n/);return e?r.map(n=>Math.ceil(n.length/e)).reduce((n,i)=>n+i):r.length}});var FP=y((tme,xP)=>{"use strict";xP.exports=(t,e={})=>{let r=Number.isSafeInteger(parseInt(e.margin))?new Array(parseInt(e.margin)).fill(" ").join(""):e.margin||"",n=e.width;return(t||"").split(/\r?\n/g).map(i=>i.split(/\s+/g).reduce((o,s)=>(s.length+r.length>=n||o[o.length-1].length+s.length+1<n?o[o.length-1]+=` ${s}`:o.push(`${r}${s}`),o),[r]).join(`
112
+ `),this.close()}_(e,r){return e.toLowerCase()==="y"?(this.value=!0,this.submit()):e.toLowerCase()==="n"?(this.value=!1,this.submit()):this.bell()}render(){this.closed||(this.firstRender?this.out.write(ZT.hide):this.out.write(dee(this.outputText,this.out.columns)),super.render(),this.outputText=[XT.symbol(this.done,this.aborted),JT.bold(this.msg),XT.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:JT.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(hee.line+ZT.to(0)+this.outputText))}};tP.exports=A0});var iP=y((Gpe,nP)=>{"use strict";nP.exports={TextPrompt:V3(),SelectPrompt:W3(),TogglePrompt:Q3(),DatePrompt:OT(),NumberPrompt:IT(),MultiselectPrompt:E0(),AutocompletePrompt:zT(),AutocompleteMultiselectPrompt:YT(),ConfirmPrompt:rP()}});var sP=y(oP=>{"use strict";var Yt=oP,pee=iP(),eh=t=>t;function Qr(t,e,r={}){return new Promise((n,i)=>{let o=new pee[t](e),s=r.onAbort||eh,a=r.onSubmit||eh,u=r.onExit||eh;o.on("state",e.onState||eh),o.on("submit",c=>n(a(c))),o.on("exit",c=>n(u(c))),o.on("abort",c=>i(s(c)))})}Yt.text=t=>Qr("TextPrompt",t);Yt.password=t=>(t.style="password",Yt.text(t));Yt.invisible=t=>(t.style="invisible",Yt.text(t));Yt.number=t=>Qr("NumberPrompt",t);Yt.date=t=>Qr("DatePrompt",t);Yt.confirm=t=>Qr("ConfirmPrompt",t);Yt.list=t=>{let e=t.separator||",";return Qr("TextPrompt",t,{onSubmit:r=>r.split(e).map(n=>n.trim())})};Yt.toggle=t=>Qr("TogglePrompt",t);Yt.select=t=>Qr("SelectPrompt",t);Yt.multiselect=t=>{t.choices=[].concat(t.choices||[]);let e=r=>r.filter(n=>n.selected).map(n=>n.value);return Qr("MultiselectPrompt",t,{onAbort:e,onSubmit:e})};Yt.autocompleteMultiselect=t=>{t.choices=[].concat(t.choices||[]);let e=r=>r.filter(n=>n.selected).map(n=>n.value);return Qr("AutocompleteMultiselectPrompt",t,{onAbort:e,onSubmit:e})};var mee=(t,e)=>Promise.resolve(e.filter(r=>r.title.slice(0,t.length).toLowerCase()===t.toLowerCase()));Yt.autocomplete=t=>(t.suggest=t.suggest||mee,t.choices=[].concat(t.choices||[]),Qr("AutocompletePrompt",t))});var pP=y((Kpe,hP)=>{"use strict";function aP(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function uP(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?aP(Object(r),!0).forEach(function(n){gee(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):aP(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function gee(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function yee(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=Dee(t))||e&&t&&typeof t.length=="number"){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(c){throw c},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
113
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,s=!1,a;return{s:function(){r=r.call(t)},n:function(){var c=r.next();return o=c.done,c},e:function(c){s=!0,a=c},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(s)throw a}}}}function Dee(t,e){if(t){if(typeof t=="string")return cP(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return cP(t,e)}}function cP(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function lP(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(c){r(c);return}a.done?e(u):Promise.resolve(u).then(n,i)}function fP(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function s(u){lP(o,n,i,s,a,"next",u)}function a(u){lP(o,n,i,s,a,"throw",u)}s(void 0)})}}var k0=sP(),vee=["suggest","format","onState","validate","onRender","type"],dP=()=>{};function di(){return T0.apply(this,arguments)}function T0(){return T0=fP(function*(t=[],{onSubmit:e=dP,onCancel:r=dP}={}){let n={},i=di._override||{};t=[].concat(t);let o,s,a,u,c,l,f=function(){var g=fP(function*(w,x,D=!1){if(!(!D&&w.validate&&w.validate(x)!==!0))return w.format?yield w.format(x,n):x});return function(x,D){return g.apply(this,arguments)}}();var h=yee(t),d;try{for(h.s();!(d=h.n()).done;){s=d.value;var p=s;if(u=p.name,c=p.type,typeof c=="function"&&(c=yield c(o,uP({},n),s),s.type=c),!!c){for(let g in s){if(vee.includes(g))continue;let w=s[g];s[g]=typeof w=="function"?yield w(o,uP({},n),l):w}if(l=s,typeof s.message!="string")throw new Error("prompt message is required");var v=s;if(u=v.name,c=v.type,k0[c]===void 0)throw new Error(`prompt type (${c}) is not defined`);if(i[s.name]!==void 0&&(o=yield f(s,i[s.name]),o!==void 0)){n[u]=o;continue}try{o=di._injected?bee(di._injected,s.initial):yield k0[c](s),n[u]=o=yield f(s,o,!0),a=yield e(s,o,n)}catch{a=!(yield r(s,n))}if(a)return n}}}catch(g){h.e(g)}finally{h.f()}return n}),T0.apply(this,arguments)}function bee(t,e){let r=t.shift();if(r instanceof Error)throw r;return r===void 0?e:r}function wee(t){di._injected=(di._injected||[]).concat(t)}function _ee(t){di._override=Object.assign({},t)}hP.exports=Object.assign(di,{prompt:di,prompts:k0,inject:wee,override:_ee})});var gP=y((Ype,mP)=>{"use strict";mP.exports=(t,e)=>{if(!(t.meta&&t.name!=="escape")){if(t.ctrl){if(t.name==="a")return"first";if(t.name==="c"||t.name==="d")return"abort";if(t.name==="e")return"last";if(t.name==="g")return"reset"}if(e){if(t.name==="j")return"down";if(t.name==="k")return"up"}return t.name==="return"||t.name==="enter"?"submit":t.name==="backspace"?"delete":t.name==="delete"?"deleteForward":t.name==="abort"?"abort":t.name==="escape"?"exit":t.name==="tab"?"next":t.name==="pagedown"?"nextPage":t.name==="pageup"?"prevPage":t.name==="home"?"home":t.name==="end"?"end":t.name==="up"?"up":t.name==="down"?"down":t.name==="right"?"right":t.name==="left"?"left":!1}}});var th=y((Jpe,yP)=>{"use strict";yP.exports=t=>{let e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))"].join("|"),r=new RegExp(e,"g");return typeof t=="string"?t.replace(r,""):t}});var bP=y((Xpe,vP)=>{"use strict";var Eee=th(),{erase:DP,cursor:Cee}=Te(),See=t=>[...Eee(t)].length;vP.exports=function(t,e){if(!e)return DP.line+Cee.to(0);let r=0,n=t.split(/\r?\n/);for(let i of n)r+=1+Math.floor(Math.max(See(i)-1,0)/e);return DP.lines(r)}});var P0=y((Zpe,wP)=>{"use strict";var yc={arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",radioOn:"\u25C9",radioOff:"\u25EF",tick:"\u2714",cross:"\u2716",ellipsis:"\u2026",pointerSmall:"\u203A",line:"\u2500",pointer:"\u276F"},xee={arrowUp:yc.arrowUp,arrowDown:yc.arrowDown,arrowLeft:yc.arrowLeft,arrowRight:yc.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"\u221A",cross:"\xD7",ellipsis:"...",pointerSmall:"\xBB",line:"\u2500",pointer:">"},Fee=process.platform==="win32"?xee:yc;wP.exports=Fee});var EP=y((Qpe,_P)=>{"use strict";var ta=ze(),fo=P0(),R0=Object.freeze({password:{scale:1,render:t=>"*".repeat(t.length)},emoji:{scale:2,render:t=>"\u{1F603}".repeat(t.length)},invisible:{scale:0,render:t=>""},default:{scale:1,render:t=>`${t}`}}),Oee=t=>R0[t]||R0.default,Dc=Object.freeze({aborted:ta.red(fo.cross),done:ta.green(fo.tick),exited:ta.yellow(fo.cross),default:ta.cyan("?")}),Aee=(t,e,r)=>e?Dc.aborted:r?Dc.exited:t?Dc.done:Dc.default,kee=t=>ta.gray(t?fo.ellipsis:fo.pointerSmall),Tee=(t,e)=>ta.gray(t?e?fo.pointerSmall:"+":fo.line);_P.exports={styles:R0,render:Oee,symbols:Dc,symbol:Aee,delimiter:kee,item:Tee}});var SP=y((eme,CP)=>{"use strict";var Pee=th();CP.exports=function(t,e){let r=String(Pee(t)||"").split(/\r?\n/);return e?r.map(n=>Math.ceil(n.length/e)).reduce((n,i)=>n+i):r.length}});var FP=y((tme,xP)=>{"use strict";xP.exports=(t,e={})=>{let r=Number.isSafeInteger(parseInt(e.margin))?new Array(parseInt(e.margin)).fill(" ").join(""):e.margin||"",n=e.width;return(t||"").split(/\r?\n/g).map(i=>i.split(/\s+/g).reduce((o,s)=>(s.length+r.length>=n||o[o.length-1].length+s.length+1<n?o[o.length-1]+=` ${s}`:o.push(`${r}${s}`),o),[r]).join(`
114
114
  `)).join(`
115
- `)}});var AP=y((rme,OP)=>{"use strict";OP.exports=(t,e,r)=>{r=r||e;let n=Math.min(e-r,t-Math.floor(r/2));n<0&&(n=0);let i=Math.min(n+r,e);return{startIndex:n,endIndex:i}}});var Rr=y((nme,kP)=>{"use strict";kP.exports={action:gP(),clear:bP(),style:EP(),strip:nh(),figures:P0(),lines:SP(),wrap:FP(),entriesToDisplay:AP()}});var Pn=y((ime,PP)=>{"use strict";var TP=require("readline"),{action:Ree}=Rr(),$ee=require("events"),{beep:Iee,cursor:jee}=Te(),Nee=ze(),$0=class extends $ee{constructor(e={}){super(),this.firstRender=!0,this.in=e.stdin||process.stdin,this.out=e.stdout||process.stdout,this.onRender=(e.onRender||(()=>{})).bind(this);let r=TP.createInterface({input:this.in,escapeCodeTimeout:50});TP.emitKeypressEvents(this.in,r),this.in.isTTY&&this.in.setRawMode(!0);let n=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1,i=(o,s)=>{let a=Ree(s,n);a===!1?this._&&this._(o,s):typeof this[a]=="function"?this[a](s):this.bell()};this.close=()=>{this.out.write(jee.show),this.in.removeListener("keypress",i),this.in.isTTY&&this.in.setRawMode(!1),r.close(),this.emit(this.aborted?"abort":this.exited?"exit":"submit",this.value),this.closed=!0},this.in.on("keypress",i)}fire(){this.emit("state",{value:this.value,aborted:!!this.aborted,exited:!!this.exited})}bell(){this.out.write(Iee)}render(){this.onRender(Nee),this.firstRender&&(this.firstRender=!1)}};PP.exports=$0});var $P=y((ome,RP)=>{var ih=ze(),Lee=Pn(),{erase:Bee,cursor:vc}=Te(),{style:I0,clear:j0,lines:qee,figures:Mee}=Rr(),N0=class extends Lee{constructor(e={}){super(e),this.transform=I0.render(e.style),this.scale=this.transform.scale,this.msg=e.message,this.initial=e.initial||"",this.validator=e.validate||(()=>!0),this.value="",this.errorMsg=e.error||"Please Enter A Valid Value",this.cursor=+!!this.initial,this.cursorOffset=0,this.clear=j0("",this.out.columns),this.render()}set value(e){!e&&this.initial?(this.placeholder=!0,this.rendered=ih.gray(this.transform.render(this.initial))):(this.placeholder=!1,this.rendered=this.transform.render(e)),this._value=e,this.fire()}get value(){return this._value}reset(){this.value="",this.cursor=+!!this.initial,this.cursorOffset=0,this.fire(),this.render()}exit(){this.abort()}abort(){this.value=this.value||this.initial,this.done=this.aborted=!0,this.error=!1,this.red=!1,this.fire(),this.render(),this.out.write(`
115
+ `)}});var AP=y((rme,OP)=>{"use strict";OP.exports=(t,e,r)=>{r=r||e;let n=Math.min(e-r,t-Math.floor(r/2));n<0&&(n=0);let i=Math.min(n+r,e);return{startIndex:n,endIndex:i}}});var Rr=y((nme,kP)=>{"use strict";kP.exports={action:gP(),clear:bP(),style:EP(),strip:th(),figures:P0(),lines:SP(),wrap:FP(),entriesToDisplay:AP()}});var Pn=y((ime,PP)=>{"use strict";var TP=require("readline"),{action:Ree}=Rr(),$ee=require("events"),{beep:Iee,cursor:jee}=Te(),Nee=ze(),$0=class extends $ee{constructor(e={}){super(),this.firstRender=!0,this.in=e.stdin||process.stdin,this.out=e.stdout||process.stdout,this.onRender=(e.onRender||(()=>{})).bind(this);let r=TP.createInterface({input:this.in,escapeCodeTimeout:50});TP.emitKeypressEvents(this.in,r),this.in.isTTY&&this.in.setRawMode(!0);let n=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1,i=(o,s)=>{let a=Ree(s,n);a===!1?this._&&this._(o,s):typeof this[a]=="function"?this[a](s):this.bell()};this.close=()=>{this.out.write(jee.show),this.in.removeListener("keypress",i),this.in.isTTY&&this.in.setRawMode(!1),r.close(),this.emit(this.aborted?"abort":this.exited?"exit":"submit",this.value),this.closed=!0},this.in.on("keypress",i)}fire(){this.emit("state",{value:this.value,aborted:!!this.aborted,exited:!!this.exited})}bell(){this.out.write(Iee)}render(){this.onRender(Nee),this.firstRender&&(this.firstRender=!1)}};PP.exports=$0});var $P=y((ome,RP)=>{var rh=ze(),Lee=Pn(),{erase:Bee,cursor:vc}=Te(),{style:I0,clear:j0,lines:qee,figures:Mee}=Rr(),N0=class extends Lee{constructor(e={}){super(e),this.transform=I0.render(e.style),this.scale=this.transform.scale,this.msg=e.message,this.initial=e.initial||"",this.validator=e.validate||(()=>!0),this.value="",this.errorMsg=e.error||"Please Enter A Valid Value",this.cursor=+!!this.initial,this.cursorOffset=0,this.clear=j0("",this.out.columns),this.render()}set value(e){!e&&this.initial?(this.placeholder=!0,this.rendered=rh.gray(this.transform.render(this.initial))):(this.placeholder=!1,this.rendered=this.transform.render(e)),this._value=e,this.fire()}get value(){return this._value}reset(){this.value="",this.cursor=+!!this.initial,this.cursorOffset=0,this.fire(),this.render()}exit(){this.abort()}abort(){this.value=this.value||this.initial,this.done=this.aborted=!0,this.error=!1,this.red=!1,this.fire(),this.render(),this.out.write(`
116
116
  `),this.close()}async validate(){let e=await this.validator(this.value);typeof e=="string"&&(this.errorMsg=e,e=!1),this.error=!e}async submit(){if(this.value=this.value||this.initial,this.cursorOffset=0,this.cursor=this.rendered.length,await this.validate(),this.error){this.red=!0,this.fire(),this.render();return}this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
117
- `),this.close()}next(){if(!this.placeholder)return this.bell();this.value=this.initial,this.cursor=this.rendered.length,this.fire(),this.render()}moveCursor(e){this.placeholder||(this.cursor=this.cursor+e,this.cursorOffset+=e)}_(e,r){let n=this.value.slice(0,this.cursor),i=this.value.slice(this.cursor);this.value=`${n}${e}${i}`,this.red=!1,this.cursor=this.placeholder?0:n.length+1,this.render()}delete(){if(this.isCursorAtStart())return this.bell();let e=this.value.slice(0,this.cursor-1),r=this.value.slice(this.cursor);this.value=`${e}${r}`,this.red=!1,this.isCursorAtStart()?this.cursorOffset=0:(this.cursorOffset++,this.moveCursor(-1)),this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();let e=this.value.slice(0,this.cursor),r=this.value.slice(this.cursor+1);this.value=`${e}${r}`,this.red=!1,this.isCursorAtEnd()?this.cursorOffset=0:this.cursorOffset++,this.render()}first(){this.cursor=0,this.render()}last(){this.cursor=this.value.length,this.render()}left(){if(this.cursor<=0||this.placeholder)return this.bell();this.moveCursor(-1),this.render()}right(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();this.moveCursor(1),this.render()}isCursorAtStart(){return this.cursor===0||this.placeholder&&this.cursor===1}isCursorAtEnd(){return this.cursor===this.rendered.length||this.placeholder&&this.cursor===this.rendered.length+1}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(vc.down(qee(this.outputError,this.out.columns)-1)+j0(this.outputError,this.out.columns)),this.out.write(j0(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[I0.symbol(this.done,this.aborted),ih.bold(this.msg),I0.delimiter(this.done),this.red?ih.red(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
117
+ `),this.close()}next(){if(!this.placeholder)return this.bell();this.value=this.initial,this.cursor=this.rendered.length,this.fire(),this.render()}moveCursor(e){this.placeholder||(this.cursor=this.cursor+e,this.cursorOffset+=e)}_(e,r){let n=this.value.slice(0,this.cursor),i=this.value.slice(this.cursor);this.value=`${n}${e}${i}`,this.red=!1,this.cursor=this.placeholder?0:n.length+1,this.render()}delete(){if(this.isCursorAtStart())return this.bell();let e=this.value.slice(0,this.cursor-1),r=this.value.slice(this.cursor);this.value=`${e}${r}`,this.red=!1,this.isCursorAtStart()?this.cursorOffset=0:(this.cursorOffset++,this.moveCursor(-1)),this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();let e=this.value.slice(0,this.cursor),r=this.value.slice(this.cursor+1);this.value=`${e}${r}`,this.red=!1,this.isCursorAtEnd()?this.cursorOffset=0:this.cursorOffset++,this.render()}first(){this.cursor=0,this.render()}last(){this.cursor=this.value.length,this.render()}left(){if(this.cursor<=0||this.placeholder)return this.bell();this.moveCursor(-1),this.render()}right(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();this.moveCursor(1),this.render()}isCursorAtStart(){return this.cursor===0||this.placeholder&&this.cursor===1}isCursorAtEnd(){return this.cursor===this.rendered.length||this.placeholder&&this.cursor===this.rendered.length+1}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(vc.down(qee(this.outputError,this.out.columns)-1)+j0(this.outputError,this.out.columns)),this.out.write(j0(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[I0.symbol(this.done,this.aborted),rh.bold(this.msg),I0.delimiter(this.done),this.red?rh.red(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
118
118
  `).reduce((e,r,n)=>e+`
119
- ${n?" ":Mee.pointerSmall} ${ih.red().italic(r)}`,"")),this.out.write(Bee.line+vc.to(0)+this.outputText+vc.save+this.outputError+vc.restore+vc.move(this.cursorOffset,0)))}};RP.exports=N0});var LP=y((sme,NP)=>{"use strict";var Rn=ze(),Uee=Pn(),{style:IP,clear:jP,figures:oh,wrap:Vee,entriesToDisplay:Hee}=Rr(),{cursor:zee}=Te(),L0=class extends Uee{constructor(e={}){super(e),this.msg=e.message,this.hint=e.hint||"- Use arrow-keys. Return to submit.",this.warn=e.warn||"- This option is disabled",this.cursor=e.initial||0,this.choices=e.choices.map((r,n)=>(typeof r=="string"&&(r={title:r,value:n}),{title:r&&(r.title||r.value||r),value:r&&(r.value===void 0?n:r.value),description:r&&r.description,selected:r&&r.selected,disabled:r&&r.disabled})),this.optionsPerPage=e.optionsPerPage||10,this.value=(this.choices[this.cursor]||{}).value,this.clear=jP("",this.out.columns),this.render()}moveCursor(e){this.cursor=e,this.value=this.choices[e].value,this.fire()}reset(){this.moveCursor(0),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
119
+ ${n?" ":Mee.pointerSmall} ${rh.red().italic(r)}`,"")),this.out.write(Bee.line+vc.to(0)+this.outputText+vc.save+this.outputError+vc.restore+vc.move(this.cursorOffset,0)))}};RP.exports=N0});var LP=y((sme,NP)=>{"use strict";var Rn=ze(),Uee=Pn(),{style:IP,clear:jP,figures:nh,wrap:Vee,entriesToDisplay:Hee}=Rr(),{cursor:zee}=Te(),L0=class extends Uee{constructor(e={}){super(e),this.msg=e.message,this.hint=e.hint||"- Use arrow-keys. Return to submit.",this.warn=e.warn||"- This option is disabled",this.cursor=e.initial||0,this.choices=e.choices.map((r,n)=>(typeof r=="string"&&(r={title:r,value:n}),{title:r&&(r.title||r.value||r),value:r&&(r.value===void 0?n:r.value),description:r&&r.description,selected:r&&r.selected,disabled:r&&r.disabled})),this.optionsPerPage=e.optionsPerPage||10,this.value=(this.choices[this.cursor]||{}).value,this.clear=jP("",this.out.columns),this.render()}moveCursor(e){this.cursor=e,this.value=this.choices[e].value,this.fire()}reset(){this.moveCursor(0),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
120
120
  `),this.close()}submit(){this.selection.disabled?this.bell():(this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
121
121
  `),this.close())}first(){this.moveCursor(0),this.render()}last(){this.moveCursor(this.choices.length-1),this.render()}up(){this.cursor===0?this.moveCursor(this.choices.length-1):this.moveCursor(this.cursor-1),this.render()}down(){this.cursor===this.choices.length-1?this.moveCursor(0):this.moveCursor(this.cursor+1),this.render()}next(){this.moveCursor((this.cursor+1)%this.choices.length),this.render()}_(e,r){if(e===" ")return this.submit()}get selection(){return this.choices[this.cursor]}render(){if(this.closed)return;this.firstRender?this.out.write(zee.hide):this.out.write(jP(this.outputText,this.out.columns)),super.render();let{startIndex:e,endIndex:r}=Hee(this.cursor,this.choices.length,this.optionsPerPage);if(this.outputText=[IP.symbol(this.done,this.aborted),Rn.bold(this.msg),IP.delimiter(!1),this.done?this.selection.title:this.selection.disabled?Rn.yellow(this.warn):Rn.gray(this.hint)].join(" "),!this.done){this.outputText+=`
122
- `;for(let n=e;n<r;n++){let i,o,s="",a=this.choices[n];n===e&&e>0?o=oh.arrowUp:n===r-1&&r<this.choices.length?o=oh.arrowDown:o=" ",a.disabled?(i=this.cursor===n?Rn.gray().underline(a.title):Rn.strikethrough().gray(a.title),o=(this.cursor===n?Rn.bold().gray(oh.pointer)+" ":" ")+o):(i=this.cursor===n?Rn.cyan().underline(a.title):a.title,o=(this.cursor===n?Rn.cyan(oh.pointer)+" ":" ")+o,a.description&&this.cursor===n&&(s=` - ${a.description}`,(o.length+i.length+s.length>=this.out.columns||a.description.split(/\r?\n/).length>1)&&(s=`
122
+ `;for(let n=e;n<r;n++){let i,o,s="",a=this.choices[n];n===e&&e>0?o=nh.arrowUp:n===r-1&&r<this.choices.length?o=nh.arrowDown:o=" ",a.disabled?(i=this.cursor===n?Rn.gray().underline(a.title):Rn.strikethrough().gray(a.title),o=(this.cursor===n?Rn.bold().gray(nh.pointer)+" ":" ")+o):(i=this.cursor===n?Rn.cyan().underline(a.title):a.title,o=(this.cursor===n?Rn.cyan(nh.pointer)+" ":" ")+o,a.description&&this.cursor===n&&(s=` - ${a.description}`,(o.length+i.length+s.length>=this.out.columns||a.description.split(/\r?\n/).length>1)&&(s=`
123
123
  `+Vee(a.description,{margin:3,width:this.out.columns})))),this.outputText+=`${o} ${i}${Rn.gray(s)}
124
- `}}this.out.write(this.outputText)}};NP.exports=L0});var UP=y((ame,MP)=>{var sh=ze(),Gee=Pn(),{style:BP,clear:Wee}=Rr(),{cursor:qP,erase:Kee}=Te(),B0=class extends Gee{constructor(e={}){super(e),this.msg=e.message,this.value=!!e.initial,this.active=e.active||"on",this.inactive=e.inactive||"off",this.initialValue=this.value,this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
124
+ `}}this.out.write(this.outputText)}};NP.exports=L0});var UP=y((ame,MP)=>{var ih=ze(),Gee=Pn(),{style:BP,clear:Wee}=Rr(),{cursor:qP,erase:Kee}=Te(),B0=class extends Gee{constructor(e={}){super(e),this.msg=e.message,this.value=!!e.initial,this.active=e.active||"on",this.inactive=e.inactive||"off",this.initialValue=this.value,this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
125
125
  `),this.close()}submit(){this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
126
- `),this.close()}deactivate(){if(this.value===!1)return this.bell();this.value=!1,this.render()}activate(){if(this.value===!0)return this.bell();this.value=!0,this.render()}delete(){this.deactivate()}left(){this.deactivate()}right(){this.activate()}down(){this.deactivate()}up(){this.activate()}next(){this.value=!this.value,this.fire(),this.render()}_(e,r){if(e===" ")this.value=!this.value;else if(e==="1")this.value=!0;else if(e==="0")this.value=!1;else return this.bell();this.render()}render(){this.closed||(this.firstRender?this.out.write(qP.hide):this.out.write(Wee(this.outputText,this.out.columns)),super.render(),this.outputText=[BP.symbol(this.done,this.aborted),sh.bold(this.msg),BP.delimiter(this.done),this.value?this.inactive:sh.cyan().underline(this.inactive),sh.gray("/"),this.value?sh.cyan().underline(this.active):this.active].join(" "),this.out.write(Kee.line+qP.to(0)+this.outputText))}};MP.exports=B0});var en=y((ume,VP)=>{"use strict";var q0=class t{constructor({token:e,date:r,parts:n,locales:i}){this.token=e,this.date=r||new Date,this.parts=n||[this],this.locales=i||{}}up(){}down(){}next(){let e=this.parts.indexOf(this);return this.parts.find((r,n)=>n>e&&r instanceof t)}setTo(e){}prev(){let e=[].concat(this.parts).reverse(),r=e.indexOf(this);return e.find((n,i)=>i>r&&n instanceof t)}toString(){return String(this.date)}};VP.exports=q0});var zP=y((cme,HP)=>{"use strict";var Yee=en(),M0=class extends Yee{constructor(e={}){super(e)}up(){this.date.setHours((this.date.getHours()+12)%24)}down(){this.up()}toString(){let e=this.date.getHours()>12?"pm":"am";return/\A/.test(this.token)?e.toUpperCase():e}};HP.exports=M0});var WP=y((lme,GP)=>{"use strict";var Jee=en(),Xee=t=>(t=t%10,t===1?"st":t===2?"nd":t===3?"rd":"th"),U0=class extends Jee{constructor(e={}){super(e)}up(){this.date.setDate(this.date.getDate()+1)}down(){this.date.setDate(this.date.getDate()-1)}setTo(e){this.date.setDate(parseInt(e.substr(-2)))}toString(){let e=this.date.getDate(),r=this.date.getDay();return this.token==="DD"?String(e).padStart(2,"0"):this.token==="Do"?e+Xee(e):this.token==="d"?r+1:this.token==="ddd"?this.locales.weekdaysShort[r]:this.token==="dddd"?this.locales.weekdays[r]:e}};GP.exports=U0});var YP=y((fme,KP)=>{"use strict";var Zee=en(),V0=class extends Zee{constructor(e={}){super(e)}up(){this.date.setHours(this.date.getHours()+1)}down(){this.date.setHours(this.date.getHours()-1)}setTo(e){this.date.setHours(parseInt(e.substr(-2)))}toString(){let e=this.date.getHours();return/h/.test(this.token)&&(e=e%12||12),this.token.length>1?String(e).padStart(2,"0"):e}};KP.exports=V0});var XP=y((dme,JP)=>{"use strict";var Qee=en(),H0=class extends Qee{constructor(e={}){super(e)}up(){this.date.setMilliseconds(this.date.getMilliseconds()+1)}down(){this.date.setMilliseconds(this.date.getMilliseconds()-1)}setTo(e){this.date.setMilliseconds(parseInt(e.substr(-this.token.length)))}toString(){return String(this.date.getMilliseconds()).padStart(4,"0").substr(0,this.token.length)}};JP.exports=H0});var QP=y((hme,ZP)=>{"use strict";var ete=en(),z0=class extends ete{constructor(e={}){super(e)}up(){this.date.setMinutes(this.date.getMinutes()+1)}down(){this.date.setMinutes(this.date.getMinutes()-1)}setTo(e){this.date.setMinutes(parseInt(e.substr(-2)))}toString(){let e=this.date.getMinutes();return this.token.length>1?String(e).padStart(2,"0"):e}};ZP.exports=z0});var tR=y((pme,eR)=>{"use strict";var tte=en(),G0=class extends tte{constructor(e={}){super(e)}up(){this.date.setMonth(this.date.getMonth()+1)}down(){this.date.setMonth(this.date.getMonth()-1)}setTo(e){e=parseInt(e.substr(-2))-1,this.date.setMonth(e<0?0:e)}toString(){let e=this.date.getMonth(),r=this.token.length;return r===2?String(e+1).padStart(2,"0"):r===3?this.locales.monthsShort[e]:r===4?this.locales.months[e]:String(e+1)}};eR.exports=G0});var nR=y((mme,rR)=>{"use strict";var rte=en(),W0=class extends rte{constructor(e={}){super(e)}up(){this.date.setSeconds(this.date.getSeconds()+1)}down(){this.date.setSeconds(this.date.getSeconds()-1)}setTo(e){this.date.setSeconds(parseInt(e.substr(-2)))}toString(){let e=this.date.getSeconds();return this.token.length>1?String(e).padStart(2,"0"):e}};rR.exports=W0});var oR=y((gme,iR)=>{"use strict";var nte=en(),K0=class extends nte{constructor(e={}){super(e)}up(){this.date.setFullYear(this.date.getFullYear()+1)}down(){this.date.setFullYear(this.date.getFullYear()-1)}setTo(e){this.date.setFullYear(e.substr(-4))}toString(){let e=String(this.date.getFullYear()).padStart(4,"0");return this.token.length===2?e.substr(-2):e}};iR.exports=K0});var aR=y((yme,sR)=>{"use strict";sR.exports={DatePart:en(),Meridiem:zP(),Day:WP(),Hours:YP(),Milliseconds:XP(),Minutes:QP(),Month:tR(),Seconds:nR(),Year:oR()}});var pR=y((Dme,hR)=>{"use strict";var Y0=ze(),ite=Pn(),{style:uR,clear:cR,figures:ote}=Rr(),{erase:ste,cursor:lR}=Te(),{DatePart:fR,Meridiem:ate,Day:ute,Hours:cte,Milliseconds:lte,Minutes:fte,Month:dte,Seconds:hte,Year:pte}=aR(),mte=/\\(.)|"((?:\\["\\]|[^"])+)"|(D[Do]?|d{3,4}|d)|(M{1,4})|(YY(?:YY)?)|([aA])|([Hh]{1,2})|(m{1,2})|(s{1,2})|(S{1,4})|./g,dR={1:({token:t})=>t.replace(/\\(.)/g,"$1"),2:t=>new ute(t),3:t=>new dte(t),4:t=>new pte(t),5:t=>new ate(t),6:t=>new cte(t),7:t=>new fte(t),8:t=>new hte(t),9:t=>new lte(t)},gte={months:"January,February,March,April,May,June,July,August,September,October,November,December".split(","),monthsShort:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","),weekdays:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","),weekdaysShort:"Sun,Mon,Tue,Wed,Thu,Fri,Sat".split(",")},J0=class extends ite{constructor(e={}){super(e),this.msg=e.message,this.cursor=0,this.typed="",this.locales=Object.assign(gte,e.locales),this._date=e.initial||new Date,this.errorMsg=e.error||"Please Enter A Valid Value",this.validator=e.validate||(()=>!0),this.mask=e.mask||"YYYY-MM-DD HH:mm:ss",this.clear=cR("",this.out.columns),this.render()}get value(){return this.date}get date(){return this._date}set date(e){e&&this._date.setTime(e.getTime())}set mask(e){let r;for(this.parts=[];r=mte.exec(e);){let i=r.shift(),o=r.findIndex(s=>s!=null);this.parts.push(o in dR?dR[o]({token:r[o]||i,date:this.date,parts:this.parts,locales:this.locales}):r[o]||i)}let n=this.parts.reduce((i,o)=>(typeof o=="string"&&typeof i[i.length-1]=="string"?i[i.length-1]+=o:i.push(o),i),[]);this.parts.splice(0),this.parts.push(...n),this.reset()}moveCursor(e){this.typed="",this.cursor=e,this.fire()}reset(){this.moveCursor(this.parts.findIndex(e=>e instanceof fR)),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
126
+ `),this.close()}deactivate(){if(this.value===!1)return this.bell();this.value=!1,this.render()}activate(){if(this.value===!0)return this.bell();this.value=!0,this.render()}delete(){this.deactivate()}left(){this.deactivate()}right(){this.activate()}down(){this.deactivate()}up(){this.activate()}next(){this.value=!this.value,this.fire(),this.render()}_(e,r){if(e===" ")this.value=!this.value;else if(e==="1")this.value=!0;else if(e==="0")this.value=!1;else return this.bell();this.render()}render(){this.closed||(this.firstRender?this.out.write(qP.hide):this.out.write(Wee(this.outputText,this.out.columns)),super.render(),this.outputText=[BP.symbol(this.done,this.aborted),ih.bold(this.msg),BP.delimiter(this.done),this.value?this.inactive:ih.cyan().underline(this.inactive),ih.gray("/"),this.value?ih.cyan().underline(this.active):this.active].join(" "),this.out.write(Kee.line+qP.to(0)+this.outputText))}};MP.exports=B0});var en=y((ume,VP)=>{"use strict";var q0=class t{constructor({token:e,date:r,parts:n,locales:i}){this.token=e,this.date=r||new Date,this.parts=n||[this],this.locales=i||{}}up(){}down(){}next(){let e=this.parts.indexOf(this);return this.parts.find((r,n)=>n>e&&r instanceof t)}setTo(e){}prev(){let e=[].concat(this.parts).reverse(),r=e.indexOf(this);return e.find((n,i)=>i>r&&n instanceof t)}toString(){return String(this.date)}};VP.exports=q0});var zP=y((cme,HP)=>{"use strict";var Yee=en(),M0=class extends Yee{constructor(e={}){super(e)}up(){this.date.setHours((this.date.getHours()+12)%24)}down(){this.up()}toString(){let e=this.date.getHours()>12?"pm":"am";return/\A/.test(this.token)?e.toUpperCase():e}};HP.exports=M0});var WP=y((lme,GP)=>{"use strict";var Jee=en(),Xee=t=>(t=t%10,t===1?"st":t===2?"nd":t===3?"rd":"th"),U0=class extends Jee{constructor(e={}){super(e)}up(){this.date.setDate(this.date.getDate()+1)}down(){this.date.setDate(this.date.getDate()-1)}setTo(e){this.date.setDate(parseInt(e.substr(-2)))}toString(){let e=this.date.getDate(),r=this.date.getDay();return this.token==="DD"?String(e).padStart(2,"0"):this.token==="Do"?e+Xee(e):this.token==="d"?r+1:this.token==="ddd"?this.locales.weekdaysShort[r]:this.token==="dddd"?this.locales.weekdays[r]:e}};GP.exports=U0});var YP=y((fme,KP)=>{"use strict";var Zee=en(),V0=class extends Zee{constructor(e={}){super(e)}up(){this.date.setHours(this.date.getHours()+1)}down(){this.date.setHours(this.date.getHours()-1)}setTo(e){this.date.setHours(parseInt(e.substr(-2)))}toString(){let e=this.date.getHours();return/h/.test(this.token)&&(e=e%12||12),this.token.length>1?String(e).padStart(2,"0"):e}};KP.exports=V0});var XP=y((dme,JP)=>{"use strict";var Qee=en(),H0=class extends Qee{constructor(e={}){super(e)}up(){this.date.setMilliseconds(this.date.getMilliseconds()+1)}down(){this.date.setMilliseconds(this.date.getMilliseconds()-1)}setTo(e){this.date.setMilliseconds(parseInt(e.substr(-this.token.length)))}toString(){return String(this.date.getMilliseconds()).padStart(4,"0").substr(0,this.token.length)}};JP.exports=H0});var QP=y((hme,ZP)=>{"use strict";var ete=en(),z0=class extends ete{constructor(e={}){super(e)}up(){this.date.setMinutes(this.date.getMinutes()+1)}down(){this.date.setMinutes(this.date.getMinutes()-1)}setTo(e){this.date.setMinutes(parseInt(e.substr(-2)))}toString(){let e=this.date.getMinutes();return this.token.length>1?String(e).padStart(2,"0"):e}};ZP.exports=z0});var tR=y((pme,eR)=>{"use strict";var tte=en(),G0=class extends tte{constructor(e={}){super(e)}up(){this.date.setMonth(this.date.getMonth()+1)}down(){this.date.setMonth(this.date.getMonth()-1)}setTo(e){e=parseInt(e.substr(-2))-1,this.date.setMonth(e<0?0:e)}toString(){let e=this.date.getMonth(),r=this.token.length;return r===2?String(e+1).padStart(2,"0"):r===3?this.locales.monthsShort[e]:r===4?this.locales.months[e]:String(e+1)}};eR.exports=G0});var nR=y((mme,rR)=>{"use strict";var rte=en(),W0=class extends rte{constructor(e={}){super(e)}up(){this.date.setSeconds(this.date.getSeconds()+1)}down(){this.date.setSeconds(this.date.getSeconds()-1)}setTo(e){this.date.setSeconds(parseInt(e.substr(-2)))}toString(){let e=this.date.getSeconds();return this.token.length>1?String(e).padStart(2,"0"):e}};rR.exports=W0});var oR=y((gme,iR)=>{"use strict";var nte=en(),K0=class extends nte{constructor(e={}){super(e)}up(){this.date.setFullYear(this.date.getFullYear()+1)}down(){this.date.setFullYear(this.date.getFullYear()-1)}setTo(e){this.date.setFullYear(e.substr(-4))}toString(){let e=String(this.date.getFullYear()).padStart(4,"0");return this.token.length===2?e.substr(-2):e}};iR.exports=K0});var aR=y((yme,sR)=>{"use strict";sR.exports={DatePart:en(),Meridiem:zP(),Day:WP(),Hours:YP(),Milliseconds:XP(),Minutes:QP(),Month:tR(),Seconds:nR(),Year:oR()}});var pR=y((Dme,hR)=>{"use strict";var Y0=ze(),ite=Pn(),{style:uR,clear:cR,figures:ote}=Rr(),{erase:ste,cursor:lR}=Te(),{DatePart:fR,Meridiem:ate,Day:ute,Hours:cte,Milliseconds:lte,Minutes:fte,Month:dte,Seconds:hte,Year:pte}=aR(),mte=/\\(.)|"((?:\\["\\]|[^"])+)"|(D[Do]?|d{3,4}|d)|(M{1,4})|(YY(?:YY)?)|([aA])|([Hh]{1,2})|(m{1,2})|(s{1,2})|(S{1,4})|./g,dR={1:({token:t})=>t.replace(/\\(.)/g,"$1"),2:t=>new ute(t),3:t=>new dte(t),4:t=>new pte(t),5:t=>new ate(t),6:t=>new cte(t),7:t=>new fte(t),8:t=>new hte(t),9:t=>new lte(t)},gte={months:"January,February,March,April,May,June,July,August,September,October,November,December".split(","),monthsShort:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","),weekdays:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","),weekdaysShort:"Sun,Mon,Tue,Wed,Thu,Fri,Sat".split(",")},J0=class extends ite{constructor(e={}){super(e),this.msg=e.message,this.cursor=0,this.typed="",this.locales=Object.assign(gte,e.locales),this._date=e.initial||new Date,this.errorMsg=e.error||"Please Enter A Valid Value",this.validator=e.validate||(()=>!0),this.mask=e.mask||"YYYY-MM-DD HH:mm:ss",this.clear=cR("",this.out.columns),this.render()}get value(){return this.date}get date(){return this._date}set date(e){e&&this._date.setTime(e.getTime())}set mask(e){let r;for(this.parts=[];r=mte.exec(e);){let i=r.shift(),o=r.findIndex(s=>s!=null);this.parts.push(o in dR?dR[o]({token:r[o]||i,date:this.date,parts:this.parts,locales:this.locales}):r[o]||i)}let n=this.parts.reduce((i,o)=>(typeof o=="string"&&typeof i[i.length-1]=="string"?i[i.length-1]+=o:i.push(o),i),[]);this.parts.splice(0),this.parts.push(...n),this.reset()}moveCursor(e){this.typed="",this.cursor=e,this.fire()}reset(){this.moveCursor(this.parts.findIndex(e=>e instanceof fR)),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
127
127
  `),this.close()}async validate(){let e=await this.validator(this.value);typeof e=="string"&&(this.errorMsg=e,e=!1),this.error=!e}async submit(){if(await this.validate(),this.error){this.color="red",this.fire(),this.render();return}this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
128
128
  `),this.close()}up(){this.typed="",this.parts[this.cursor].up(),this.render()}down(){this.typed="",this.parts[this.cursor].down(),this.render()}left(){let e=this.parts[this.cursor].prev();if(e==null)return this.bell();this.moveCursor(this.parts.indexOf(e)),this.render()}right(){let e=this.parts[this.cursor].next();if(e==null)return this.bell();this.moveCursor(this.parts.indexOf(e)),this.render()}next(){let e=this.parts[this.cursor].next();this.moveCursor(e?this.parts.indexOf(e):this.parts.findIndex(r=>r instanceof fR)),this.render()}_(e){/\d/.test(e)&&(this.typed+=e,this.parts[this.cursor].setTo(this.typed),this.render())}render(){this.closed||(this.firstRender?this.out.write(lR.hide):this.out.write(cR(this.outputText,this.out.columns)),super.render(),this.outputText=[uR.symbol(this.done,this.aborted),Y0.bold(this.msg),uR.delimiter(!1),this.parts.reduce((e,r,n)=>e.concat(n===this.cursor&&!this.done?Y0.cyan().underline(r.toString()):r),[]).join("")].join(" "),this.error&&(this.outputText+=this.errorMsg.split(`
129
129
  `).reduce((e,r,n)=>e+`
130
- ${n?" ":ote.pointerSmall} ${Y0.red().italic(r)}`,"")),this.out.write(ste.line+lR.to(0)+this.outputText))}};hR.exports=J0});var DR=y((vme,yR)=>{var ah=ze(),yte=Pn(),{cursor:uh,erase:Dte}=Te(),{style:X0,figures:vte,clear:mR,lines:bte}=Rr(),wte=/[0-9]/,Z0=t=>t!==void 0,gR=(t,e)=>{let r=Math.pow(10,e);return Math.round(t*r)/r},Q0=class extends yte{constructor(e={}){super(e),this.transform=X0.render(e.style),this.msg=e.message,this.initial=Z0(e.initial)?e.initial:"",this.float=!!e.float,this.round=e.round||2,this.inc=e.increment||1,this.min=Z0(e.min)?e.min:-1/0,this.max=Z0(e.max)?e.max:1/0,this.errorMsg=e.error||"Please Enter A Valid Value",this.validator=e.validate||(()=>!0),this.color="cyan",this.value="",this.typed="",this.lastHit=0,this.render()}set value(e){!e&&e!==0?(this.placeholder=!0,this.rendered=ah.gray(this.transform.render(`${this.initial}`)),this._value=""):(this.placeholder=!1,this.rendered=this.transform.render(`${gR(e,this.round)}`),this._value=gR(e,this.round)),this.fire()}get value(){return this._value}parse(e){return this.float?parseFloat(e):parseInt(e)}valid(e){return e==="-"||e==="."&&this.float||wte.test(e)}reset(){this.typed="",this.value="",this.fire(),this.render()}exit(){this.abort()}abort(){let e=this.value;this.value=e!==""?e:this.initial,this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
130
+ ${n?" ":ote.pointerSmall} ${Y0.red().italic(r)}`,"")),this.out.write(ste.line+lR.to(0)+this.outputText))}};hR.exports=J0});var DR=y((vme,yR)=>{var oh=ze(),yte=Pn(),{cursor:sh,erase:Dte}=Te(),{style:X0,figures:vte,clear:mR,lines:bte}=Rr(),wte=/[0-9]/,Z0=t=>t!==void 0,gR=(t,e)=>{let r=Math.pow(10,e);return Math.round(t*r)/r},Q0=class extends yte{constructor(e={}){super(e),this.transform=X0.render(e.style),this.msg=e.message,this.initial=Z0(e.initial)?e.initial:"",this.float=!!e.float,this.round=e.round||2,this.inc=e.increment||1,this.min=Z0(e.min)?e.min:-1/0,this.max=Z0(e.max)?e.max:1/0,this.errorMsg=e.error||"Please Enter A Valid Value",this.validator=e.validate||(()=>!0),this.color="cyan",this.value="",this.typed="",this.lastHit=0,this.render()}set value(e){!e&&e!==0?(this.placeholder=!0,this.rendered=oh.gray(this.transform.render(`${this.initial}`)),this._value=""):(this.placeholder=!1,this.rendered=this.transform.render(`${gR(e,this.round)}`),this._value=gR(e,this.round)),this.fire()}get value(){return this._value}parse(e){return this.float?parseFloat(e):parseInt(e)}valid(e){return e==="-"||e==="."&&this.float||wte.test(e)}reset(){this.typed="",this.value="",this.fire(),this.render()}exit(){this.abort()}abort(){let e=this.value;this.value=e!==""?e:this.initial,this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
131
131
  `),this.close()}async validate(){let e=await this.validator(this.value);typeof e=="string"&&(this.errorMsg=e,e=!1),this.error=!e}async submit(){if(await this.validate(),this.error){this.color="red",this.fire(),this.render();return}let e=this.value;this.value=e!==""?e:this.initial,this.done=!0,this.aborted=!1,this.error=!1,this.fire(),this.render(),this.out.write(`
132
- `),this.close()}up(){if(this.typed="",this.value===""&&(this.value=this.min-this.inc),this.value>=this.max)return this.bell();this.value+=this.inc,this.color="cyan",this.fire(),this.render()}down(){if(this.typed="",this.value===""&&(this.value=this.min+this.inc),this.value<=this.min)return this.bell();this.value-=this.inc,this.color="cyan",this.fire(),this.render()}delete(){let e=this.value.toString();if(e.length===0)return this.bell();this.value=this.parse(e=e.slice(0,-1))||"",this.value!==""&&this.value<this.min&&(this.value=this.min),this.color="cyan",this.fire(),this.render()}next(){this.value=this.initial,this.fire(),this.render()}_(e,r){if(!this.valid(e))return this.bell();let n=Date.now();if(n-this.lastHit>1e3&&(this.typed=""),this.typed+=e,this.lastHit=n,this.color="cyan",e===".")return this.fire();this.value=Math.min(this.parse(this.typed),this.max),this.value>this.max&&(this.value=this.max),this.value<this.min&&(this.value=this.min),this.fire(),this.render()}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(uh.down(bte(this.outputError,this.out.columns)-1)+mR(this.outputError,this.out.columns)),this.out.write(mR(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[X0.symbol(this.done,this.aborted),ah.bold(this.msg),X0.delimiter(this.done),!this.done||!this.done&&!this.placeholder?ah[this.color]().underline(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
132
+ `),this.close()}up(){if(this.typed="",this.value===""&&(this.value=this.min-this.inc),this.value>=this.max)return this.bell();this.value+=this.inc,this.color="cyan",this.fire(),this.render()}down(){if(this.typed="",this.value===""&&(this.value=this.min+this.inc),this.value<=this.min)return this.bell();this.value-=this.inc,this.color="cyan",this.fire(),this.render()}delete(){let e=this.value.toString();if(e.length===0)return this.bell();this.value=this.parse(e=e.slice(0,-1))||"",this.value!==""&&this.value<this.min&&(this.value=this.min),this.color="cyan",this.fire(),this.render()}next(){this.value=this.initial,this.fire(),this.render()}_(e,r){if(!this.valid(e))return this.bell();let n=Date.now();if(n-this.lastHit>1e3&&(this.typed=""),this.typed+=e,this.lastHit=n,this.color="cyan",e===".")return this.fire();this.value=Math.min(this.parse(this.typed),this.max),this.value>this.max&&(this.value=this.max),this.value<this.min&&(this.value=this.min),this.fire(),this.render()}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(sh.down(bte(this.outputError,this.out.columns)-1)+mR(this.outputError,this.out.columns)),this.out.write(mR(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[X0.symbol(this.done,this.aborted),oh.bold(this.msg),X0.delimiter(this.done),!this.done||!this.done&&!this.placeholder?oh[this.color]().underline(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
133
133
  `).reduce((e,r,n)=>e+`
134
- ${n?" ":vte.pointerSmall} ${ah.red().italic(r)}`,"")),this.out.write(Dte.line+uh.to(0)+this.outputText+uh.save+this.outputError+uh.restore))}};yR.exports=Q0});var tv=y((bme,wR)=>{"use strict";var tn=ze(),{cursor:_te}=Te(),Ete=Pn(),{clear:vR,figures:hi,style:bR,wrap:Cte,entriesToDisplay:Ste}=Rr(),ev=class extends Ete{constructor(e={}){super(e),this.msg=e.message,this.cursor=e.cursor||0,this.scrollIndex=e.cursor||0,this.hint=e.hint||"",this.warn=e.warn||"- This option is disabled -",this.minSelected=e.min,this.showMinError=!1,this.maxChoices=e.max,this.instructions=e.instructions,this.optionsPerPage=e.optionsPerPage||10,this.value=e.choices.map((r,n)=>(typeof r=="string"&&(r={title:r,value:n}),{title:r&&(r.title||r.value||r),description:r&&r.description,value:r&&(r.value===void 0?n:r.value),selected:r&&r.selected,disabled:r&&r.disabled})),this.clear=vR("",this.out.columns),e.overrideRender||this.render()}reset(){this.value.map(e=>!e.selected),this.cursor=0,this.fire(),this.render()}selected(){return this.value.filter(e=>e.selected)}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
134
+ ${n?" ":vte.pointerSmall} ${oh.red().italic(r)}`,"")),this.out.write(Dte.line+sh.to(0)+this.outputText+sh.save+this.outputError+sh.restore))}};yR.exports=Q0});var tv=y((bme,wR)=>{"use strict";var tn=ze(),{cursor:_te}=Te(),Ete=Pn(),{clear:vR,figures:hi,style:bR,wrap:Cte,entriesToDisplay:Ste}=Rr(),ev=class extends Ete{constructor(e={}){super(e),this.msg=e.message,this.cursor=e.cursor||0,this.scrollIndex=e.cursor||0,this.hint=e.hint||"",this.warn=e.warn||"- This option is disabled -",this.minSelected=e.min,this.showMinError=!1,this.maxChoices=e.max,this.instructions=e.instructions,this.optionsPerPage=e.optionsPerPage||10,this.value=e.choices.map((r,n)=>(typeof r=="string"&&(r={title:r,value:n}),{title:r&&(r.title||r.value||r),description:r&&r.description,value:r&&(r.value===void 0?n:r.value),selected:r&&r.selected,disabled:r&&r.disabled})),this.clear=vR("",this.out.columns),e.overrideRender||this.render()}reset(){this.value.map(e=>!e.selected),this.cursor=0,this.fire(),this.render()}selected(){return this.value.filter(e=>e.selected)}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
135
135
  `),this.close()}submit(){let e=this.value.filter(r=>r.selected);this.minSelected&&e.length<this.minSelected?(this.showMinError=!0,this.render()):(this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
136
136
  `),this.close())}first(){this.cursor=0,this.render()}last(){this.cursor=this.value.length-1,this.render()}next(){this.cursor=(this.cursor+1)%this.value.length,this.render()}up(){this.cursor===0?this.cursor=this.value.length-1:this.cursor--,this.render()}down(){this.cursor===this.value.length-1?this.cursor=0:this.cursor++,this.render()}left(){this.value[this.cursor].selected=!1,this.render()}right(){if(this.value.filter(e=>e.selected).length>=this.maxChoices)return this.bell();this.value[this.cursor].selected=!0,this.render()}handleSpaceToggle(){let e=this.value[this.cursor];if(e.selected)e.selected=!1,this.render();else{if(e.disabled||this.value.filter(r=>r.selected).length>=this.maxChoices)return this.bell();e.selected=!0,this.render()}}toggleAll(){if(this.maxChoices!==void 0||this.value[this.cursor].disabled)return this.bell();let e=!this.value[this.cursor].selected;this.value.filter(r=>!r.disabled).forEach(r=>r.selected=e),this.render()}_(e,r){if(e===" ")this.handleSpaceToggle();else if(e==="a")this.toggleAll();else return this.bell()}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
137
137
  Instructions:
@@ -157,60 +157,60 @@ Instructions:
157
157
  Filtered results for: ${this.inputValue?this.inputValue:$n.gray("Enter something to filter")}
158
158
  `}renderOption(e,r,n){let i;return r.disabled?i=e===n?$n.gray().underline(r.title):$n.strikethrough().gray(r.title):i=e===n?$n.cyan().underline(r.title):r.title,(r.selected?$n.green(ra.radioOn):ra.radioOff)+" "+i}renderDoneOrInstructions(){if(this.done)return this.value.filter(r=>r.selected).map(r=>r.title).join(", ");let e=[$n.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&e.push($n.yellow(this.warn)),e.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(Pte.hide),super.render();let e=[OR.symbol(this.done,this.aborted),$n.bold(this.msg),OR.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(e+=$n.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),e+=this.renderOptions(this.filteredOptions),this.out.write(this.clear+e),this.clear=FR(e,this.out.columns)}};AR.exports=ov});var IR=y((Eme,$R)=>{var TR=ze(),$te=Pn(),{style:PR,clear:Ite}=Rr(),{erase:jte,cursor:RR}=Te(),sv=class extends $te{constructor(e={}){super(e),this.msg=e.message,this.value=e.initial,this.initialValue=!!e.initial,this.yesMsg=e.yes||"yes",this.yesOption=e.yesOption||"(Y/n)",this.noMsg=e.no||"no",this.noOption=e.noOption||"(y/N)",this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
159
159
  `),this.close()}submit(){this.value=this.value||!1,this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
160
- `),this.close()}_(e,r){return e.toLowerCase()==="y"?(this.value=!0,this.submit()):e.toLowerCase()==="n"?(this.value=!1,this.submit()):this.bell()}render(){this.closed||(this.firstRender?this.out.write(RR.hide):this.out.write(Ite(this.outputText,this.out.columns)),super.render(),this.outputText=[PR.symbol(this.done,this.aborted),TR.bold(this.msg),PR.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:TR.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(jte.line+RR.to(0)+this.outputText))}};$R.exports=sv});var NR=y((Cme,jR)=>{"use strict";jR.exports={TextPrompt:$P(),SelectPrompt:LP(),TogglePrompt:UP(),DatePrompt:pR(),NumberPrompt:DR(),MultiselectPrompt:tv(),AutocompletePrompt:xR(),AutocompleteMultiselectPrompt:kR(),ConfirmPrompt:IR()}});var BR=y(LR=>{"use strict";var Jt=LR,Nte=NR(),ch=t=>t;function rn(t,e,r={}){return new Promise((n,i)=>{let o=new Nte[t](e),s=r.onAbort||ch,a=r.onSubmit||ch,u=r.onExit||ch;o.on("state",e.onState||ch),o.on("submit",c=>n(a(c))),o.on("exit",c=>n(u(c))),o.on("abort",c=>i(s(c)))})}Jt.text=t=>rn("TextPrompt",t);Jt.password=t=>(t.style="password",Jt.text(t));Jt.invisible=t=>(t.style="invisible",Jt.text(t));Jt.number=t=>rn("NumberPrompt",t);Jt.date=t=>rn("DatePrompt",t);Jt.confirm=t=>rn("ConfirmPrompt",t);Jt.list=t=>{let e=t.separator||",";return rn("TextPrompt",t,{onSubmit:r=>r.split(e).map(n=>n.trim())})};Jt.toggle=t=>rn("TogglePrompt",t);Jt.select=t=>rn("SelectPrompt",t);Jt.multiselect=t=>{t.choices=[].concat(t.choices||[]);let e=r=>r.filter(n=>n.selected).map(n=>n.value);return rn("MultiselectPrompt",t,{onAbort:e,onSubmit:e})};Jt.autocompleteMultiselect=t=>{t.choices=[].concat(t.choices||[]);let e=r=>r.filter(n=>n.selected).map(n=>n.value);return rn("AutocompleteMultiselectPrompt",t,{onAbort:e,onSubmit:e})};var Lte=(t,e)=>Promise.resolve(e.filter(r=>r.title.slice(0,t.length).toLowerCase()===t.toLowerCase()));Jt.autocomplete=t=>(t.suggest=t.suggest||Lte,t.choices=[].concat(t.choices||[]),rn("AutocompletePrompt",t))});var UR=y((xme,MR)=>{"use strict";var av=BR(),Bte=["suggest","format","onState","validate","onRender","type"],qR=()=>{};async function pi(t=[],{onSubmit:e=qR,onCancel:r=qR}={}){let n={},i=pi._override||{};t=[].concat(t);let o,s,a,u,c,l,f=async(h,d,p=!1)=>{if(!(!p&&h.validate&&h.validate(d)!==!0))return h.format?await h.format(d,n):d};for(s of t)if({name:u,type:c}=s,typeof c=="function"&&(c=await c(o,{...n},s),s.type=c),!!c){for(let h in s){if(Bte.includes(h))continue;let d=s[h];s[h]=typeof d=="function"?await d(o,{...n},l):d}if(l=s,typeof s.message!="string")throw new Error("prompt message is required");if({name:u,type:c}=s,av[c]===void 0)throw new Error(`prompt type (${c}) is not defined`);if(i[s.name]!==void 0&&(o=await f(s,i[s.name]),o!==void 0)){n[u]=o;continue}try{o=pi._injected?qte(pi._injected,s.initial):await av[c](s),n[u]=o=await f(s,o,!0),a=await e(s,o,n)}catch{a=!await r(s,n)}if(a)return n}return n}function qte(t,e){let r=t.shift();if(r instanceof Error)throw r;return r===void 0?e:r}function Mte(t){pi._injected=(pi._injected||[]).concat(t)}function Ute(t){pi._override=Object.assign({},t)}MR.exports=Object.assign(pi,{prompt:pi,prompts:av,inject:Mte,override:Ute})});var lh=y((Fme,VR)=>{function Vte(t){t=(Array.isArray(t)?t:t.split(".")).map(Number);let e=0,r=process.versions.node.split(".").map(Number);for(;e<t.length;e++){if(r[e]>t[e])return!1;if(t[e]>r[e])return!0}return!1}VR.exports=Vte("8.6.0")?pP():UR()});var cc=y(Xt=>{"use strict";Object.defineProperty(Xt,"__esModule",{value:!0});Xt.logSuccess=Xt.logPrompt=Xt.logger=Xt.output=void 0;var uv=(Cn(),ke(En)),po=(ZD(),ke(XD)),mo=uv.__importDefault(Gs()),Hte=m3(),HR={colors:mo.default,stream:process.argv.includes("--json")?process.stderr:process.stdout};Xt.output=(0,Hte.isInteractive)()?new po.TTYOutputStrategy(HR):new po.StreamOutputStrategy(HR);Xt.logger=(0,po.createDefaultLogger)({output:Xt.output,formatterOptions:{titleize:!1,tags:new Map([[po.LOGGER_LEVELS.DEBUG,mo.default.log.DEBUG("[debug]")],[po.LOGGER_LEVELS.INFO,mo.default.log.INFO("[info]")],[po.LOGGER_LEVELS.WARN,mo.default.log.WARN("[warn]")],[po.LOGGER_LEVELS.ERROR,mo.default.log.ERROR("[error]")]])}});async function zte(t,e){let{wordWrap:r}=await Promise.resolve().then(()=>uv.__importStar((ZD(),ke(XD)))),{prompt:n}=await Promise.resolve().then(()=>uv.__importStar(lh()));return Xt.logger.log({msg:`${mo.default.input("[?]")} ${r(t,{indentation:4})}`,logger:Xt.logger,format:!1}),n(e,{onCancel:()=>process.exit(1)})}Xt.logPrompt=zte;function Gte(t){Xt.logger.msg(`${mo.default.success("[success]")} ${t}`)}Xt.logSuccess=Gte});var fh=y(na=>{"use strict";Object.defineProperty(na,"__esModule",{value:!0});na.resolveNode=na.requireTS=void 0;var Wte=Us(),Kte=require("fs"),Yte=require("path"),Jte=(t,e)=>{let r=(0,Yte.resolve)(e);delete require.cache[r],require.extensions[".ts"]=(i,o)=>{var s;let a=(0,Wte.readFileSync)(o,"utf8");o.endsWith(".ts")?a=t.transpileModule(a,{fileName:o,compilerOptions:{module:t.ModuleKind.CommonJS,moduleResolution:t.ModuleResolutionKind.NodeJs,esModuleInterop:!0,strict:!0,target:t.ScriptTarget.ES2017},reportDiagnostics:!0}).outputText:a=a.replace(/export\s+\w+\s+(\w+)/gm,"exports.$1"),(s=i._compile)===null||s===void 0||s.call(i,a,o)};let n=require(r);return delete require.extensions[".ts"],n};na.requireTS=Jte;function Xte(t,...e){try{return require.resolve(e.join("/"),{paths:[t]})}catch{let n=[t,"node_modules",...e].join("/");return(0,Kte.existsSync)(n)?n:null}}na.resolveNode=Xte});var zR={};mn(zR,{default:()=>Zte});var Zte,GR=ut(()=>{Zte={}});var WR=y(nn=>{"use strict";Object.defineProperty(nn,"__esModule",{value:!0});nn.buildXmlElement=nn.writeXML=nn.parseXML=nn.readXML=void 0;var Qte=(Cn(),ke(En)),ere=Us(),wc=Qte.__importDefault((GR(),ke(zR)));async function tre(t){var e;try{let r=await(0,ere.readFile)(t,{encoding:"utf-8"});try{return await wc.default.parseStringPromise(r)}catch(n){throw`Error parsing: ${t}, ${(e=n.stack)!==null&&e!==void 0?e:n}`}}catch{throw`Unable to read: ${t}`}}nn.readXML=tre;function rre(t,e){let r=e!==void 0?new wc.default.Parser({...e}):new wc.default.Parser,n;return r.parseString(t,(i,o)=>{i||(n=o)}),n}nn.parseXML=rre;async function nre(t){return new Promise(e=>{let n=new wc.default.Builder({headless:!0,explicitRoot:!1,rootName:"deleteme"}).buildObject(t);n=n.replace("<deleteme>","").replace("</deleteme>",""),e(n)})}nn.writeXML=nre;function ire(t,e){return new wc.default.Builder({headless:!0,explicitRoot:!1,rootName:e}).buildObject(t)}nn.buildXmlElement=ire});var ZR=y(Ce=>{"use strict";Object.defineProperty(Ce,"__esModule",{value:!0});Ce.getAllElements=Ce.getFilePath=Ce.getAssets=Ce.getJSModules=Ce.getPluginType=Ce.getPlatformElement=Ce.getPluginPlatform=Ce.printPlugins=Ce.fixName=Ce.getDependencies=Ce.resolvePlugin=Ce.getPlugins=Ce.getIncludedPluginPackages=void 0;var ore=(Cn(),ke(En)),sre=Us(),cv=require("path"),ia=ore.__importDefault(Gs()),are=Gd(),ure=cc(),KR=fh(),cre=WR();function YR(t,e){var r,n,i,o;let{extConfig:s}=t.app;switch(e){case"android":return(n=(r=s.android)===null||r===void 0?void 0:r.includePlugins)!==null&&n!==void 0?n:s.includePlugins;case"ios":return(o=(i=s.ios)===null||i===void 0?void 0:i.includePlugins)!==null&&o!==void 0?o:s.includePlugins}}Ce.getIncludedPluginPackages=YR;async function lre(t,e){var r;let n=(r=YR(t,e))!==null&&r!==void 0?r:XR(t);return(await Promise.all(n.map(async o=>JR(t,o)))).filter(o=>!!o)}Ce.getPlugins=lre;async function JR(t,e){try{let r=(0,KR.resolveNode)(t.app.rootDir,e,"package.json");r||(0,are.fatal)(`Unable to find ${ia.default.strong(`node_modules/${e}`)}.
160
+ `),this.close()}_(e,r){return e.toLowerCase()==="y"?(this.value=!0,this.submit()):e.toLowerCase()==="n"?(this.value=!1,this.submit()):this.bell()}render(){this.closed||(this.firstRender?this.out.write(RR.hide):this.out.write(Ite(this.outputText,this.out.columns)),super.render(),this.outputText=[PR.symbol(this.done,this.aborted),TR.bold(this.msg),PR.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:TR.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(jte.line+RR.to(0)+this.outputText))}};$R.exports=sv});var NR=y((Cme,jR)=>{"use strict";jR.exports={TextPrompt:$P(),SelectPrompt:LP(),TogglePrompt:UP(),DatePrompt:pR(),NumberPrompt:DR(),MultiselectPrompt:tv(),AutocompletePrompt:xR(),AutocompleteMultiselectPrompt:kR(),ConfirmPrompt:IR()}});var BR=y(LR=>{"use strict";var Jt=LR,Nte=NR(),ah=t=>t;function rn(t,e,r={}){return new Promise((n,i)=>{let o=new Nte[t](e),s=r.onAbort||ah,a=r.onSubmit||ah,u=r.onExit||ah;o.on("state",e.onState||ah),o.on("submit",c=>n(a(c))),o.on("exit",c=>n(u(c))),o.on("abort",c=>i(s(c)))})}Jt.text=t=>rn("TextPrompt",t);Jt.password=t=>(t.style="password",Jt.text(t));Jt.invisible=t=>(t.style="invisible",Jt.text(t));Jt.number=t=>rn("NumberPrompt",t);Jt.date=t=>rn("DatePrompt",t);Jt.confirm=t=>rn("ConfirmPrompt",t);Jt.list=t=>{let e=t.separator||",";return rn("TextPrompt",t,{onSubmit:r=>r.split(e).map(n=>n.trim())})};Jt.toggle=t=>rn("TogglePrompt",t);Jt.select=t=>rn("SelectPrompt",t);Jt.multiselect=t=>{t.choices=[].concat(t.choices||[]);let e=r=>r.filter(n=>n.selected).map(n=>n.value);return rn("MultiselectPrompt",t,{onAbort:e,onSubmit:e})};Jt.autocompleteMultiselect=t=>{t.choices=[].concat(t.choices||[]);let e=r=>r.filter(n=>n.selected).map(n=>n.value);return rn("AutocompleteMultiselectPrompt",t,{onAbort:e,onSubmit:e})};var Lte=(t,e)=>Promise.resolve(e.filter(r=>r.title.slice(0,t.length).toLowerCase()===t.toLowerCase()));Jt.autocomplete=t=>(t.suggest=t.suggest||Lte,t.choices=[].concat(t.choices||[]),rn("AutocompletePrompt",t))});var UR=y((xme,MR)=>{"use strict";var av=BR(),Bte=["suggest","format","onState","validate","onRender","type"],qR=()=>{};async function pi(t=[],{onSubmit:e=qR,onCancel:r=qR}={}){let n={},i=pi._override||{};t=[].concat(t);let o,s,a,u,c,l,f=async(h,d,p=!1)=>{if(!(!p&&h.validate&&h.validate(d)!==!0))return h.format?await h.format(d,n):d};for(s of t)if({name:u,type:c}=s,typeof c=="function"&&(c=await c(o,{...n},s),s.type=c),!!c){for(let h in s){if(Bte.includes(h))continue;let d=s[h];s[h]=typeof d=="function"?await d(o,{...n},l):d}if(l=s,typeof s.message!="string")throw new Error("prompt message is required");if({name:u,type:c}=s,av[c]===void 0)throw new Error(`prompt type (${c}) is not defined`);if(i[s.name]!==void 0&&(o=await f(s,i[s.name]),o!==void 0)){n[u]=o;continue}try{o=pi._injected?qte(pi._injected,s.initial):await av[c](s),n[u]=o=await f(s,o,!0),a=await e(s,o,n)}catch{a=!await r(s,n)}if(a)return n}return n}function qte(t,e){let r=t.shift();if(r instanceof Error)throw r;return r===void 0?e:r}function Mte(t){pi._injected=(pi._injected||[]).concat(t)}function Ute(t){pi._override=Object.assign({},t)}MR.exports=Object.assign(pi,{prompt:pi,prompts:av,inject:Mte,override:Ute})});var uh=y((Fme,VR)=>{function Vte(t){t=(Array.isArray(t)?t:t.split(".")).map(Number);let e=0,r=process.versions.node.split(".").map(Number);for(;e<t.length;e++){if(r[e]>t[e])return!1;if(t[e]>r[e])return!0}return!1}VR.exports=Vte("8.6.0")?pP():UR()});var cc=y(Xt=>{"use strict";Object.defineProperty(Xt,"__esModule",{value:!0});Xt.logSuccess=Xt.logPrompt=Xt.logger=Xt.output=void 0;var uv=(Cn(),ke(En)),ho=(ZD(),ke(XD)),po=uv.__importDefault(Gs()),Hte=m3(),HR={colors:po.default,stream:process.argv.includes("--json")?process.stderr:process.stdout};Xt.output=(0,Hte.isInteractive)()?new ho.TTYOutputStrategy(HR):new ho.StreamOutputStrategy(HR);Xt.logger=(0,ho.createDefaultLogger)({output:Xt.output,formatterOptions:{titleize:!1,tags:new Map([[ho.LOGGER_LEVELS.DEBUG,po.default.log.DEBUG("[debug]")],[ho.LOGGER_LEVELS.INFO,po.default.log.INFO("[info]")],[ho.LOGGER_LEVELS.WARN,po.default.log.WARN("[warn]")],[ho.LOGGER_LEVELS.ERROR,po.default.log.ERROR("[error]")]])}});async function zte(t,e){let{wordWrap:r}=await Promise.resolve().then(()=>uv.__importStar((ZD(),ke(XD)))),{prompt:n}=await Promise.resolve().then(()=>uv.__importStar(uh()));return Xt.logger.log({msg:`${po.default.input("[?]")} ${r(t,{indentation:4})}`,logger:Xt.logger,format:!1}),n(e,{onCancel:()=>process.exit(1)})}Xt.logPrompt=zte;function Gte(t){Xt.logger.msg(`${po.default.success("[success]")} ${t}`)}Xt.logSuccess=Gte});var ch=y(na=>{"use strict";Object.defineProperty(na,"__esModule",{value:!0});na.resolveNode=na.requireTS=void 0;var Wte=Us(),Kte=require("fs"),Yte=require("path"),Jte=(t,e)=>{let r=(0,Yte.resolve)(e);delete require.cache[r],require.extensions[".ts"]=(i,o)=>{var s;let a=(0,Wte.readFileSync)(o,"utf8");o.endsWith(".ts")?a=t.transpileModule(a,{fileName:o,compilerOptions:{module:t.ModuleKind.CommonJS,moduleResolution:t.ModuleResolutionKind.NodeJs,esModuleInterop:!0,strict:!0,target:t.ScriptTarget.ES2017},reportDiagnostics:!0}).outputText:a=a.replace(/export\s+\w+\s+(\w+)/gm,"exports.$1"),(s=i._compile)===null||s===void 0||s.call(i,a,o)};let n=require(r);return delete require.extensions[".ts"],n};na.requireTS=Jte;function Xte(t,...e){try{return require.resolve(e.join("/"),{paths:[t]})}catch{let n=[t,"node_modules",...e].join("/");return(0,Kte.existsSync)(n)?n:null}}na.resolveNode=Xte});var zR={};mn(zR,{default:()=>Zte});var Zte,GR=ut(()=>{Zte={}});var WR=y(nn=>{"use strict";Object.defineProperty(nn,"__esModule",{value:!0});nn.buildXmlElement=nn.writeXML=nn.parseXML=nn.readXML=void 0;var Qte=(Cn(),ke(En)),ere=Us(),wc=Qte.__importDefault((GR(),ke(zR)));async function tre(t){var e;try{let r=await(0,ere.readFile)(t,{encoding:"utf-8"});try{return await wc.default.parseStringPromise(r)}catch(n){throw`Error parsing: ${t}, ${(e=n.stack)!==null&&e!==void 0?e:n}`}}catch{throw`Unable to read: ${t}`}}nn.readXML=tre;function rre(t,e){let r=e!==void 0?new wc.default.Parser({...e}):new wc.default.Parser,n;return r.parseString(t,(i,o)=>{i||(n=o)}),n}nn.parseXML=rre;async function nre(t){return new Promise(e=>{let n=new wc.default.Builder({headless:!0,explicitRoot:!1,rootName:"deleteme"}).buildObject(t);n=n.replace("<deleteme>","").replace("</deleteme>",""),e(n)})}nn.writeXML=nre;function ire(t,e){return new wc.default.Builder({headless:!0,explicitRoot:!1,rootName:e}).buildObject(t)}nn.buildXmlElement=ire});var ZR=y(Ce=>{"use strict";Object.defineProperty(Ce,"__esModule",{value:!0});Ce.getAllElements=Ce.getFilePath=Ce.getAssets=Ce.getJSModules=Ce.getPluginType=Ce.getPlatformElement=Ce.getPluginPlatform=Ce.printPlugins=Ce.fixName=Ce.getDependencies=Ce.resolvePlugin=Ce.getPlugins=Ce.getIncludedPluginPackages=void 0;var ore=(Cn(),ke(En)),sre=Us(),cv=require("path"),ia=ore.__importDefault(Gs()),are=Hd(),ure=cc(),KR=ch(),cre=WR();function YR(t,e){var r,n,i,o;let{extConfig:s}=t.app;switch(e){case"android":return(n=(r=s.android)===null||r===void 0?void 0:r.includePlugins)!==null&&n!==void 0?n:s.includePlugins;case"ios":return(o=(i=s.ios)===null||i===void 0?void 0:i.includePlugins)!==null&&o!==void 0?o:s.includePlugins}}Ce.getIncludedPluginPackages=YR;async function lre(t,e){var r;let n=(r=YR(t,e))!==null&&r!==void 0?r:XR(t);return(await Promise.all(n.map(async o=>JR(t,o)))).filter(o=>!!o)}Ce.getPlugins=lre;async function JR(t,e){try{let r=(0,KR.resolveNode)(t.app.rootDir,e,"package.json");r||(0,are.fatal)(`Unable to find ${ia.default.strong(`node_modules/${e}`)}.
161
161
  Are you sure ${ia.default.strong(e)} is installed?`);let n=(0,cv.dirname)(r),i=await(0,sre.readJSON)(r);if(!i)return null;if(i.capacitor)return{id:e,name:lv(e),version:i.version,rootPath:n,repository:i.repository,manifest:i.capacitor};let o=(0,cv.join)(n,"plugin.xml"),s=await(0,cre.readXML)(o);return{id:e,name:lv(e),version:i.version,rootPath:n,repository:i.repository,xml:s.plugin}}catch{}return null}Ce.resolvePlugin=JR;function XR(t){var e,r;return[...Object.keys((e=t.app.package.dependencies)!==null&&e!==void 0?e:{}),...Object.keys((r=t.app.package.devDependencies)!==null&&r!==void 0?r:{})]}Ce.getDependencies=XR;function lv(t){return t=t.replace(/\//g,"_").replace(/-/g,"_").replace(/@/g,"").replace(/_\w/g,e=>e[1].toUpperCase()),t.charAt(0).toUpperCase()+t.slice(1)}Ce.fixName=lv;function fre(t,e,r="capacitor"){if(t.length===0)return;let n,i=t.length===1?"":"s";switch(r){case"cordova":n=`Found ${t.length} Cordova plugin${i} for ${ia.default.strong(e)}:
162
162
  `;break;case"incompatible":n=`Found ${t.length} incompatible Cordova plugin${i} for ${ia.default.strong(e)}, skipped install:
163
163
  `;break;case"capacitor":n=`Found ${t.length} Capacitor plugin${i} for ${ia.default.strong(e)}:
164
164
  `;break}n+=t.map(o=>`${o.id}${ia.default.weak(`@${o.version}`)}`).join(`
165
- `),ure.logger.info(n)}Ce.printPlugins=fre;function fv(t,e){return t.xml.platform?t.xml.platform.filter(function(i){return i.$.name===e})[0]:[]}Ce.getPluginPlatform=fv;function dre(t,e,r){let n=fv(t,e);if(n){let i=n[r];if(i)return i}return[]}Ce.getPlatformElement=dre;function hre(t,e){var r,n,i,o;switch(e){case"ios":return(n=(r=t.ios)===null||r===void 0?void 0:r.type)!==null&&n!==void 0?n:0;case"android":return(o=(i=t.android)===null||i===void 0?void 0:i.type)!==null&&o!==void 0?o:0}return 0}Ce.getPluginType=hre;function pre(t,e){return dv(t,e,"js-module")}Ce.getJSModules=pre;function mre(t,e){return dv(t,e,"asset")}Ce.getAssets=mre;function gre(t,e,r){if(r.startsWith("node_modules")){let n=r.split("/").slice(1);n[0].startsWith("@")&&(n=[n[0]+"/"+n[1],...n.slice(2)]);let i=(0,KR.resolveNode)(t.app.rootDir,...n);if(!i)throw new Error(`Can't resolve module ${n[0]}`);return i}return(0,cv.join)(e.rootPath,r)}Ce.getFilePath=gre;function dv(t,e,r){let n=[];t.xml[r]&&(n=n.concat(t.xml[r]));let i=fv(t,e);return i?.[r]&&(n=n.concat(i[r])),n}Ce.getAllElements=dv});var QR={};mn(QR,{default:()=>yre});var yre,e$=ut(()=>{yre={}});var dh=y(mi=>{"use strict";Object.defineProperty(mi,"__esModule",{value:!0});mi.isInstalled=mi.getCommandOutput=mi.runCommand=void 0;var hv=(e$(),ke(QR));async function t$(t,e,r={}){let n=new hv.Subprocess(t,e,r);try{return await n.output()}catch(i){throw i instanceof hv.SubprocessError?i.output?i.output:i.code?i.code:i.error?i.error.message:"Unknown error":i}}mi.runCommand=t$;async function Dre(t,e,r={}){try{return(await t$(t,e,r)).trim()}catch{return null}}mi.getCommandOutput=Dre;async function vre(t){try{await(0,hv.which)(t)}catch{return!1}return!0}mi.isInstalled=vre});var _c=y((Rme,r$)=>{var bre="2.0.0",wre=Number.MAX_SAFE_INTEGER||9007199254740991,_re=16,Ere=250,Cre=["major","premajor","minor","preminor","patch","prepatch","prerelease"];r$.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:_re,MAX_SAFE_BUILD_LENGTH:Ere,MAX_SAFE_INTEGER:wre,RELEASE_TYPES:Cre,SEMVER_SPEC_VERSION:bre,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var Ec=y(($me,n$)=>{var Sre=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{};n$.exports=Sre});var oa=y((In,i$)=>{var{MAX_SAFE_COMPONENT_LENGTH:pv,MAX_SAFE_BUILD_LENGTH:xre,MAX_LENGTH:Fre}=_c(),Ore=Ec();In=i$.exports={};var Are=In.re=[],kre=In.safeRe=[],z=In.src=[],G=In.t={},Tre=0,mv="[a-zA-Z0-9-]",Pre=[["\\s",1],["\\d",Fre],[mv,xre]],Rre=t=>{for(let[e,r]of Pre)t=t.split(`${e}*`).join(`${e}{0,${r}}`).split(`${e}+`).join(`${e}{1,${r}}`);return t},ne=(t,e,r)=>{let n=Rre(e),i=Tre++;Ore(t,i,e),G[t]=i,z[i]=e,Are[i]=new RegExp(e,r?"g":void 0),kre[i]=new RegExp(n,r?"g":void 0)};ne("NUMERICIDENTIFIER","0|[1-9]\\d*");ne("NUMERICIDENTIFIERLOOSE","\\d+");ne("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${mv}*`);ne("MAINVERSION",`(${z[G.NUMERICIDENTIFIER]})\\.(${z[G.NUMERICIDENTIFIER]})\\.(${z[G.NUMERICIDENTIFIER]})`);ne("MAINVERSIONLOOSE",`(${z[G.NUMERICIDENTIFIERLOOSE]})\\.(${z[G.NUMERICIDENTIFIERLOOSE]})\\.(${z[G.NUMERICIDENTIFIERLOOSE]})`);ne("PRERELEASEIDENTIFIER",`(?:${z[G.NUMERICIDENTIFIER]}|${z[G.NONNUMERICIDENTIFIER]})`);ne("PRERELEASEIDENTIFIERLOOSE",`(?:${z[G.NUMERICIDENTIFIERLOOSE]}|${z[G.NONNUMERICIDENTIFIER]})`);ne("PRERELEASE",`(?:-(${z[G.PRERELEASEIDENTIFIER]}(?:\\.${z[G.PRERELEASEIDENTIFIER]})*))`);ne("PRERELEASELOOSE",`(?:-?(${z[G.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${z[G.PRERELEASEIDENTIFIERLOOSE]})*))`);ne("BUILDIDENTIFIER",`${mv}+`);ne("BUILD",`(?:\\+(${z[G.BUILDIDENTIFIER]}(?:\\.${z[G.BUILDIDENTIFIER]})*))`);ne("FULLPLAIN",`v?${z[G.MAINVERSION]}${z[G.PRERELEASE]}?${z[G.BUILD]}?`);ne("FULL",`^${z[G.FULLPLAIN]}$`);ne("LOOSEPLAIN",`[v=\\s]*${z[G.MAINVERSIONLOOSE]}${z[G.PRERELEASELOOSE]}?${z[G.BUILD]}?`);ne("LOOSE",`^${z[G.LOOSEPLAIN]}$`);ne("GTLT","((?:<|>)?=?)");ne("XRANGEIDENTIFIERLOOSE",`${z[G.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);ne("XRANGEIDENTIFIER",`${z[G.NUMERICIDENTIFIER]}|x|X|\\*`);ne("XRANGEPLAIN",`[v=\\s]*(${z[G.XRANGEIDENTIFIER]})(?:\\.(${z[G.XRANGEIDENTIFIER]})(?:\\.(${z[G.XRANGEIDENTIFIER]})(?:${z[G.PRERELEASE]})?${z[G.BUILD]}?)?)?`);ne("XRANGEPLAINLOOSE",`[v=\\s]*(${z[G.XRANGEIDENTIFIERLOOSE]})(?:\\.(${z[G.XRANGEIDENTIFIERLOOSE]})(?:\\.(${z[G.XRANGEIDENTIFIERLOOSE]})(?:${z[G.PRERELEASELOOSE]})?${z[G.BUILD]}?)?)?`);ne("XRANGE",`^${z[G.GTLT]}\\s*${z[G.XRANGEPLAIN]}$`);ne("XRANGELOOSE",`^${z[G.GTLT]}\\s*${z[G.XRANGEPLAINLOOSE]}$`);ne("COERCEPLAIN",`(^|[^\\d])(\\d{1,${pv}})(?:\\.(\\d{1,${pv}}))?(?:\\.(\\d{1,${pv}}))?`);ne("COERCE",`${z[G.COERCEPLAIN]}(?:$|[^\\d])`);ne("COERCEFULL",z[G.COERCEPLAIN]+`(?:${z[G.PRERELEASE]})?(?:${z[G.BUILD]})?(?:$|[^\\d])`);ne("COERCERTL",z[G.COERCE],!0);ne("COERCERTLFULL",z[G.COERCEFULL],!0);ne("LONETILDE","(?:~>?)");ne("TILDETRIM",`(\\s*)${z[G.LONETILDE]}\\s+`,!0);In.tildeTrimReplace="$1~";ne("TILDE",`^${z[G.LONETILDE]}${z[G.XRANGEPLAIN]}$`);ne("TILDELOOSE",`^${z[G.LONETILDE]}${z[G.XRANGEPLAINLOOSE]}$`);ne("LONECARET","(?:\\^)");ne("CARETTRIM",`(\\s*)${z[G.LONECARET]}\\s+`,!0);In.caretTrimReplace="$1^";ne("CARET",`^${z[G.LONECARET]}${z[G.XRANGEPLAIN]}$`);ne("CARETLOOSE",`^${z[G.LONECARET]}${z[G.XRANGEPLAINLOOSE]}$`);ne("COMPARATORLOOSE",`^${z[G.GTLT]}\\s*(${z[G.LOOSEPLAIN]})$|^$`);ne("COMPARATOR",`^${z[G.GTLT]}\\s*(${z[G.FULLPLAIN]})$|^$`);ne("COMPARATORTRIM",`(\\s*)${z[G.GTLT]}\\s*(${z[G.LOOSEPLAIN]}|${z[G.XRANGEPLAIN]})`,!0);In.comparatorTrimReplace="$1$2$3";ne("HYPHENRANGE",`^\\s*(${z[G.XRANGEPLAIN]})\\s+-\\s+(${z[G.XRANGEPLAIN]})\\s*$`);ne("HYPHENRANGELOOSE",`^\\s*(${z[G.XRANGEPLAINLOOSE]})\\s+-\\s+(${z[G.XRANGEPLAINLOOSE]})\\s*$`);ne("STAR","(<|>)?=?\\s*\\*");ne("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");ne("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var hh=y((Ime,o$)=>{var $re=Object.freeze({loose:!0}),Ire=Object.freeze({}),jre=t=>t?typeof t!="object"?$re:t:Ire;o$.exports=jre});var gv=y((jme,u$)=>{var s$=/^[0-9]+$/,a$=(t,e)=>{let r=s$.test(t),n=s$.test(e);return r&&n&&(t=+t,e=+e),t===e?0:r&&!n?-1:n&&!r?1:t<e?-1:1},Nre=(t,e)=>a$(e,t);u$.exports={compareIdentifiers:a$,rcompareIdentifiers:Nre}});var St=y((Nme,d$)=>{var ph=Ec(),{MAX_LENGTH:c$,MAX_SAFE_INTEGER:mh}=_c(),{safeRe:l$,t:f$}=oa(),Lre=hh(),{compareIdentifiers:sa}=gv(),yv=class t{constructor(e,r){if(r=Lre(r),e instanceof t){if(e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease)return e;e=e.version}else if(typeof e!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>c$)throw new TypeError(`version is longer than ${c$} characters`);ph("SemVer",e,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;let n=e.trim().match(r.loose?l$[f$.LOOSE]:l$[f$.FULL]);if(!n)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>mh||this.major<0)throw new TypeError("Invalid major version");if(this.minor>mh||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>mh||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map(i=>{if(/^[0-9]+$/.test(i)){let o=+i;if(o>=0&&o<mh)return o}return i}):this.prerelease=[],this.build=n[5]?n[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(ph("SemVer.compare",this.version,this.options,e),!(e instanceof t)){if(typeof e=="string"&&e===this.version)return 0;e=new t(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof t||(e=new t(e,this.options)),sa(this.major,e.major)||sa(this.minor,e.minor)||sa(this.patch,e.patch)}comparePre(e){if(e instanceof t||(e=new t(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let r=0;do{let n=this.prerelease[r],i=e.prerelease[r];if(ph("prerelease compare",r,n,i),n===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(n===void 0)return-1;if(n===i)continue;return sa(n,i)}while(++r)}compareBuild(e){e instanceof t||(e=new t(e,this.options));let r=0;do{let n=this.build[r],i=e.build[r];if(ph("build compare",r,n,i),n===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(n===void 0)return-1;if(n===i)continue;return sa(n,i)}while(++r)}inc(e,r,n){switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",r,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",r,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",r,n),this.inc("pre",r,n);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",r,n),this.inc("pre",r,n);break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{let i=Number(n)?1:0;if(!r&&n===!1)throw new Error("invalid increment argument: identifier is empty");if(this.prerelease.length===0)this.prerelease=[i];else{let o=this.prerelease.length;for(;--o>=0;)typeof this.prerelease[o]=="number"&&(this.prerelease[o]++,o=-2);if(o===-1){if(r===this.prerelease.join(".")&&n===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(i)}}if(r){let o=[r,i];n===!1&&(o=[r]),sa(this.prerelease[0],r)===0?isNaN(this.prerelease[1])&&(this.prerelease=o):this.prerelease=o}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};d$.exports=yv});var go=y((Lme,p$)=>{var h$=St(),Bre=(t,e,r=!1)=>{if(t instanceof h$)return t;try{return new h$(t,e)}catch(n){if(!r)return null;throw n}};p$.exports=Bre});var g$=y((Bme,m$)=>{var qre=go(),Mre=(t,e)=>{let r=qre(t,e);return r?r.version:null};m$.exports=Mre});var D$=y((qme,y$)=>{var Ure=go(),Vre=(t,e)=>{let r=Ure(t.trim().replace(/^[=v]+/,""),e);return r?r.version:null};y$.exports=Vre});var w$=y((Mme,b$)=>{var v$=St(),Hre=(t,e,r,n,i)=>{typeof r=="string"&&(i=n,n=r,r=void 0);try{return new v$(t instanceof v$?t.version:t,r).inc(e,n,i).version}catch{return null}};b$.exports=Hre});var C$=y((Ume,E$)=>{var _$=go(),zre=(t,e)=>{let r=_$(t,null,!0),n=_$(e,null,!0),i=r.compare(n);if(i===0)return null;let o=i>0,s=o?r:n,a=o?n:r,u=!!s.prerelease.length;if(!!a.prerelease.length&&!u)return!a.patch&&!a.minor?"major":s.patch?"patch":s.minor?"minor":"major";let l=u?"pre":"";return r.major!==n.major?l+"major":r.minor!==n.minor?l+"minor":r.patch!==n.patch?l+"patch":"prerelease"};E$.exports=zre});var x$=y((Vme,S$)=>{var Gre=St(),Wre=(t,e)=>new Gre(t,e).major;S$.exports=Wre});var O$=y((Hme,F$)=>{var Kre=St(),Yre=(t,e)=>new Kre(t,e).minor;F$.exports=Yre});var k$=y((zme,A$)=>{var Jre=St(),Xre=(t,e)=>new Jre(t,e).patch;A$.exports=Xre});var P$=y((Gme,T$)=>{var Zre=go(),Qre=(t,e)=>{let r=Zre(t,e);return r&&r.prerelease.length?r.prerelease:null};T$.exports=Qre});var _r=y((Wme,$$)=>{var R$=St(),ene=(t,e,r)=>new R$(t,r).compare(new R$(e,r));$$.exports=ene});var j$=y((Kme,I$)=>{var tne=_r(),rne=(t,e,r)=>tne(e,t,r);I$.exports=rne});var L$=y((Yme,N$)=>{var nne=_r(),ine=(t,e)=>nne(t,e,!0);N$.exports=ine});var gh=y((Jme,q$)=>{var B$=St(),one=(t,e,r)=>{let n=new B$(t,r),i=new B$(e,r);return n.compare(i)||n.compareBuild(i)};q$.exports=one});var U$=y((Xme,M$)=>{var sne=gh(),ane=(t,e)=>t.sort((r,n)=>sne(r,n,e));M$.exports=ane});var H$=y((Zme,V$)=>{var une=gh(),cne=(t,e)=>t.sort((r,n)=>une(n,r,e));V$.exports=cne});var Cc=y((Qme,z$)=>{var lne=_r(),fne=(t,e,r)=>lne(t,e,r)>0;z$.exports=fne});var yh=y((ege,G$)=>{var dne=_r(),hne=(t,e,r)=>dne(t,e,r)<0;G$.exports=hne});var Dv=y((tge,W$)=>{var pne=_r(),mne=(t,e,r)=>pne(t,e,r)===0;W$.exports=mne});var vv=y((rge,K$)=>{var gne=_r(),yne=(t,e,r)=>gne(t,e,r)!==0;K$.exports=yne});var Dh=y((nge,Y$)=>{var Dne=_r(),vne=(t,e,r)=>Dne(t,e,r)>=0;Y$.exports=vne});var vh=y((ige,J$)=>{var bne=_r(),wne=(t,e,r)=>bne(t,e,r)<=0;J$.exports=wne});var bv=y((oge,X$)=>{var _ne=Dv(),Ene=vv(),Cne=Cc(),Sne=Dh(),xne=yh(),Fne=vh(),One=(t,e,r,n)=>{switch(e){case"===":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t===r;case"!==":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t!==r;case"":case"=":case"==":return _ne(t,r,n);case"!=":return Ene(t,r,n);case">":return Cne(t,r,n);case">=":return Sne(t,r,n);case"<":return xne(t,r,n);case"<=":return Fne(t,r,n);default:throw new TypeError(`Invalid operator: ${e}`)}};X$.exports=One});var Q$=y((sge,Z$)=>{var Ane=St(),kne=go(),{safeRe:bh,t:wh}=oa(),Tne=(t,e)=>{if(t instanceof Ane)return t;if(typeof t=="number"&&(t=String(t)),typeof t!="string")return null;e=e||{};let r=null;if(!e.rtl)r=t.match(e.includePrerelease?bh[wh.COERCEFULL]:bh[wh.COERCE]);else{let u=e.includePrerelease?bh[wh.COERCERTLFULL]:bh[wh.COERCERTL],c;for(;(c=u.exec(t))&&(!r||r.index+r[0].length!==t.length);)(!r||c.index+c[0].length!==r.index+r[0].length)&&(r=c),u.lastIndex=c.index+c[1].length+c[2].length;u.lastIndex=-1}if(r===null)return null;let n=r[2],i=r[3]||"0",o=r[4]||"0",s=e.includePrerelease&&r[5]?`-${r[5]}`:"",a=e.includePrerelease&&r[6]?`+${r[6]}`:"";return kne(`${n}.${i}.${o}${s}${a}`,e)};Z$.exports=Tne});var tI=y((age,eI)=>{var wv=class{constructor(){this.max=1e3,this.map=new Map}get(e){let r=this.map.get(e);if(r!==void 0)return this.map.delete(e),this.map.set(e,r),r}delete(e){return this.map.delete(e)}set(e,r){if(!this.delete(e)&&r!==void 0){if(this.map.size>=this.max){let i=this.map.keys().next().value;this.delete(i)}this.map.set(e,r)}return this}};eI.exports=wv});var Er=y((uge,oI)=>{var Pne=/\s+/g,_v=class t{constructor(e,r){if(r=$ne(r),e instanceof t)return e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease?e:new t(e.raw,r);if(e instanceof Ev)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=e.trim().replace(Pne," "),this.set=this.raw.split("||").map(n=>this.parseRange(n.trim())).filter(n=>n.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let n=this.set[0];if(this.set=this.set.filter(i=>!nI(i[0])),this.set.length===0)this.set=[n];else if(this.set.length>1){for(let i of this.set)if(i.length===1&&Mne(i[0])){this.set=[i];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+="||");let r=this.set[e];for(let n=0;n<r.length;n++)n>0&&(this.formatted+=" "),this.formatted+=r[n].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){let n=((this.options.includePrerelease&&Bne)|(this.options.loose&&qne))+":"+e,i=rI.get(n);if(i)return i;let o=this.options.loose,s=o?Zt[$t.HYPHENRANGELOOSE]:Zt[$t.HYPHENRANGE];e=e.replace(s,Xne(this.options.includePrerelease)),$e("hyphen replace",e),e=e.replace(Zt[$t.COMPARATORTRIM],jne),$e("comparator trim",e),e=e.replace(Zt[$t.TILDETRIM],Nne),$e("tilde trim",e),e=e.replace(Zt[$t.CARETTRIM],Lne),$e("caret trim",e);let a=e.split(" ").map(f=>Une(f,this.options)).join(" ").split(/\s+/).map(f=>Jne(f,this.options));o&&(a=a.filter(f=>($e("loose invalid filter",f,this.options),!!f.match(Zt[$t.COMPARATORLOOSE])))),$e("range list",a);let u=new Map,c=a.map(f=>new Ev(f,this.options));for(let f of c){if(nI(f))return[f];u.set(f.value,f)}u.size>1&&u.has("")&&u.delete("");let l=[...u.values()];return rI.set(n,l),l}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Range is required");return this.set.some(n=>iI(n,r)&&e.set.some(i=>iI(i,r)&&n.every(o=>i.every(s=>o.intersects(s,r)))))}test(e){if(!e)return!1;if(typeof e=="string")try{e=new Ine(e,this.options)}catch{return!1}for(let r=0;r<this.set.length;r++)if(Zne(this.set[r],e,this.options))return!0;return!1}};oI.exports=_v;var Rne=tI(),rI=new Rne,$ne=hh(),Ev=Sc(),$e=Ec(),Ine=St(),{safeRe:Zt,t:$t,comparatorTrimReplace:jne,tildeTrimReplace:Nne,caretTrimReplace:Lne}=oa(),{FLAG_INCLUDE_PRERELEASE:Bne,FLAG_LOOSE:qne}=_c(),nI=t=>t.value==="<0.0.0-0",Mne=t=>t.value==="",iI=(t,e)=>{let r=!0,n=t.slice(),i=n.pop();for(;r&&n.length;)r=n.every(o=>i.intersects(o,e)),i=n.pop();return r},Une=(t,e)=>($e("comp",t,e),t=zne(t,e),$e("caret",t),t=Vne(t,e),$e("tildes",t),t=Wne(t,e),$e("xrange",t),t=Yne(t,e),$e("stars",t),t),It=t=>!t||t.toLowerCase()==="x"||t==="*",Vne=(t,e)=>t.trim().split(/\s+/).map(r=>Hne(r,e)).join(" "),Hne=(t,e)=>{let r=e.loose?Zt[$t.TILDELOOSE]:Zt[$t.TILDE];return t.replace(r,(n,i,o,s,a)=>{$e("tilde",t,n,i,o,s,a);let u;return It(i)?u="":It(o)?u=`>=${i}.0.0 <${+i+1}.0.0-0`:It(s)?u=`>=${i}.${o}.0 <${i}.${+o+1}.0-0`:a?($e("replaceTilde pr",a),u=`>=${i}.${o}.${s}-${a} <${i}.${+o+1}.0-0`):u=`>=${i}.${o}.${s} <${i}.${+o+1}.0-0`,$e("tilde return",u),u})},zne=(t,e)=>t.trim().split(/\s+/).map(r=>Gne(r,e)).join(" "),Gne=(t,e)=>{$e("caret",t,e);let r=e.loose?Zt[$t.CARETLOOSE]:Zt[$t.CARET],n=e.includePrerelease?"-0":"";return t.replace(r,(i,o,s,a,u)=>{$e("caret",t,i,o,s,a,u);let c;return It(o)?c="":It(s)?c=`>=${o}.0.0${n} <${+o+1}.0.0-0`:It(a)?o==="0"?c=`>=${o}.${s}.0${n} <${o}.${+s+1}.0-0`:c=`>=${o}.${s}.0${n} <${+o+1}.0.0-0`:u?($e("replaceCaret pr",u),o==="0"?s==="0"?c=`>=${o}.${s}.${a}-${u} <${o}.${s}.${+a+1}-0`:c=`>=${o}.${s}.${a}-${u} <${o}.${+s+1}.0-0`:c=`>=${o}.${s}.${a}-${u} <${+o+1}.0.0-0`):($e("no pr"),o==="0"?s==="0"?c=`>=${o}.${s}.${a}${n} <${o}.${s}.${+a+1}-0`:c=`>=${o}.${s}.${a}${n} <${o}.${+s+1}.0-0`:c=`>=${o}.${s}.${a} <${+o+1}.0.0-0`),$e("caret return",c),c})},Wne=(t,e)=>($e("replaceXRanges",t,e),t.split(/\s+/).map(r=>Kne(r,e)).join(" ")),Kne=(t,e)=>{t=t.trim();let r=e.loose?Zt[$t.XRANGELOOSE]:Zt[$t.XRANGE];return t.replace(r,(n,i,o,s,a,u)=>{$e("xRange",t,n,i,o,s,a,u);let c=It(o),l=c||It(s),f=l||It(a),h=f;return i==="="&&h&&(i=""),u=e.includePrerelease?"-0":"",c?i===">"||i==="<"?n="<0.0.0-0":n="*":i&&h?(l&&(s=0),a=0,i===">"?(i=">=",l?(o=+o+1,s=0,a=0):(s=+s+1,a=0)):i==="<="&&(i="<",l?o=+o+1:s=+s+1),i==="<"&&(u="-0"),n=`${i+o}.${s}.${a}${u}`):l?n=`>=${o}.0.0${u} <${+o+1}.0.0-0`:f&&(n=`>=${o}.${s}.0${u} <${o}.${+s+1}.0-0`),$e("xRange return",n),n})},Yne=(t,e)=>($e("replaceStars",t,e),t.trim().replace(Zt[$t.STAR],"")),Jne=(t,e)=>($e("replaceGTE0",t,e),t.trim().replace(Zt[e.includePrerelease?$t.GTE0PRE:$t.GTE0],"")),Xne=t=>(e,r,n,i,o,s,a,u,c,l,f,h)=>(It(n)?r="":It(i)?r=`>=${n}.0.0${t?"-0":""}`:It(o)?r=`>=${n}.${i}.0${t?"-0":""}`:s?r=`>=${r}`:r=`>=${r}${t?"-0":""}`,It(c)?u="":It(l)?u=`<${+c+1}.0.0-0`:It(f)?u=`<${c}.${+l+1}.0-0`:h?u=`<=${c}.${l}.${f}-${h}`:t?u=`<${c}.${l}.${+f+1}-0`:u=`<=${u}`,`${r} ${u}`.trim()),Zne=(t,e,r)=>{for(let n=0;n<t.length;n++)if(!t[n].test(e))return!1;if(e.prerelease.length&&!r.includePrerelease){for(let n=0;n<t.length;n++)if($e(t[n].semver),t[n].semver!==Ev.ANY&&t[n].semver.prerelease.length>0){let i=t[n].semver;if(i.major===e.major&&i.minor===e.minor&&i.patch===e.patch)return!0}return!1}return!0}});var Sc=y((cge,fI)=>{var xc=Symbol("SemVer ANY"),xv=class t{static get ANY(){return xc}constructor(e,r){if(r=sI(r),e instanceof t){if(e.loose===!!r.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),Sv("comparator",e,r),this.options=r,this.loose=!!r.loose,this.parse(e),this.semver===xc?this.value="":this.value=this.operator+this.semver.version,Sv("comp",this)}parse(e){let r=this.options.loose?aI[uI.COMPARATORLOOSE]:aI[uI.COMPARATOR],n=e.match(r);if(!n)throw new TypeError(`Invalid comparator: ${e}`);this.operator=n[1]!==void 0?n[1]:"",this.operator==="="&&(this.operator=""),n[2]?this.semver=new cI(n[2],this.options.loose):this.semver=xc}toString(){return this.value}test(e){if(Sv("Comparator.test",e,this.options.loose),this.semver===xc||e===xc)return!0;if(typeof e=="string")try{e=new cI(e,this.options)}catch{return!1}return Cv(e,this.operator,this.semver,this.options)}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new lI(e.value,r).test(this.value):e.operator===""?e.value===""?!0:new lI(this.value,r).test(e.semver):(r=sI(r),r.includePrerelease&&(this.value==="<0.0.0-0"||e.value==="<0.0.0-0")||!r.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&e.operator.startsWith(">")||this.operator.startsWith("<")&&e.operator.startsWith("<")||this.semver.version===e.semver.version&&this.operator.includes("=")&&e.operator.includes("=")||Cv(this.semver,"<",e.semver,r)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||Cv(this.semver,">",e.semver,r)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}};fI.exports=xv;var sI=hh(),{safeRe:aI,t:uI}=oa(),Cv=bv(),Sv=Ec(),cI=St(),lI=Er()});var Fc=y((lge,dI)=>{var Qne=Er(),eie=(t,e,r)=>{try{e=new Qne(e,r)}catch{return!1}return e.test(t)};dI.exports=eie});var pI=y((fge,hI)=>{var tie=Er(),rie=(t,e)=>new tie(t,e).set.map(r=>r.map(n=>n.value).join(" ").trim().split(" "));hI.exports=rie});var gI=y((dge,mI)=>{var nie=St(),iie=Er(),oie=(t,e,r)=>{let n=null,i=null,o=null;try{o=new iie(e,r)}catch{return null}return t.forEach(s=>{o.test(s)&&(!n||i.compare(s)===-1)&&(n=s,i=new nie(n,r))}),n};mI.exports=oie});var DI=y((hge,yI)=>{var sie=St(),aie=Er(),uie=(t,e,r)=>{let n=null,i=null,o=null;try{o=new aie(e,r)}catch{return null}return t.forEach(s=>{o.test(s)&&(!n||i.compare(s)===1)&&(n=s,i=new sie(n,r))}),n};yI.exports=uie});var wI=y((pge,bI)=>{var Fv=St(),cie=Er(),vI=Cc(),lie=(t,e)=>{t=new cie(t,e);let r=new Fv("0.0.0");if(t.test(r)||(r=new Fv("0.0.0-0"),t.test(r)))return r;r=null;for(let n=0;n<t.set.length;++n){let i=t.set[n],o=null;i.forEach(s=>{let a=new Fv(s.semver.version);switch(s.operator){case">":a.prerelease.length===0?a.patch++:a.prerelease.push(0),a.raw=a.format();case"":case">=":(!o||vI(a,o))&&(o=a);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${s.operator}`)}}),o&&(!r||vI(r,o))&&(r=o)}return r&&t.test(r)?r:null};bI.exports=lie});var EI=y((mge,_I)=>{var fie=Er(),die=(t,e)=>{try{return new fie(t,e).range||"*"}catch{return null}};_I.exports=die});var _h=y((gge,FI)=>{var hie=St(),xI=Sc(),{ANY:pie}=xI,mie=Er(),gie=Fc(),CI=Cc(),SI=yh(),yie=vh(),Die=Dh(),vie=(t,e,r,n)=>{t=new hie(t,n),e=new mie(e,n);let i,o,s,a,u;switch(r){case">":i=CI,o=yie,s=SI,a=">",u=">=";break;case"<":i=SI,o=Die,s=CI,a="<",u="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(gie(t,e,n))return!1;for(let c=0;c<e.set.length;++c){let l=e.set[c],f=null,h=null;if(l.forEach(d=>{d.semver===pie&&(d=new xI(">=0.0.0")),f=f||d,h=h||d,i(d.semver,f.semver,n)?f=d:s(d.semver,h.semver,n)&&(h=d)}),f.operator===a||f.operator===u||(!h.operator||h.operator===a)&&o(t,h.semver))return!1;if(h.operator===u&&s(t,h.semver))return!1}return!0};FI.exports=vie});var AI=y((yge,OI)=>{var bie=_h(),wie=(t,e,r)=>bie(t,e,">",r);OI.exports=wie});var TI=y((Dge,kI)=>{var _ie=_h(),Eie=(t,e,r)=>_ie(t,e,"<",r);kI.exports=Eie});var $I=y((vge,RI)=>{var PI=Er(),Cie=(t,e,r)=>(t=new PI(t,r),e=new PI(e,r),t.intersects(e,r));RI.exports=Cie});var jI=y((bge,II)=>{var Sie=Fc(),xie=_r();II.exports=(t,e,r)=>{let n=[],i=null,o=null,s=t.sort((l,f)=>xie(l,f,r));for(let l of s)Sie(l,e,r)?(o=l,i||(i=l)):(o&&n.push([i,o]),o=null,i=null);i&&n.push([i,null]);let a=[];for(let[l,f]of n)l===f?a.push(l):!f&&l===s[0]?a.push("*"):f?l===s[0]?a.push(`<=${f}`):a.push(`${l} - ${f}`):a.push(`>=${l}`);let u=a.join(" || "),c=typeof e.raw=="string"?e.raw:String(e);return u.length<c.length?u:e}});var Tv=y((wge,MI)=>{var NI=Er(),Av=Sc(),{ANY:Ov}=Av,Oc=Fc(),kv=_r(),Fie=(t,e,r={})=>{if(t===e)return!0;t=new NI(t,r),e=new NI(e,r);let n=!1;e:for(let i of t.set){for(let o of e.set){let s=Aie(i,o,r);if(n=n||s!==null,s)continue e}if(n)return!1}return!0},Oie=[new Av(">=0.0.0-0")],LI=[new Av(">=0.0.0")],Aie=(t,e,r)=>{if(t===e)return!0;if(t.length===1&&t[0].semver===Ov){if(e.length===1&&e[0].semver===Ov)return!0;r.includePrerelease?t=Oie:t=LI}if(e.length===1&&e[0].semver===Ov){if(r.includePrerelease)return!0;e=LI}let n=new Set,i,o;for(let d of t)d.operator===">"||d.operator===">="?i=BI(i,d,r):d.operator==="<"||d.operator==="<="?o=qI(o,d,r):n.add(d.semver);if(n.size>1)return null;let s;if(i&&o){if(s=kv(i.semver,o.semver,r),s>0)return null;if(s===0&&(i.operator!==">="||o.operator!=="<="))return null}for(let d of n){if(i&&!Oc(d,String(i),r)||o&&!Oc(d,String(o),r))return null;for(let p of e)if(!Oc(d,String(p),r))return!1;return!0}let a,u,c,l,f=o&&!r.includePrerelease&&o.semver.prerelease.length?o.semver:!1,h=i&&!r.includePrerelease&&i.semver.prerelease.length?i.semver:!1;f&&f.prerelease.length===1&&o.operator==="<"&&f.prerelease[0]===0&&(f=!1);for(let d of e){if(l=l||d.operator===">"||d.operator===">=",c=c||d.operator==="<"||d.operator==="<=",i){if(h&&d.semver.prerelease&&d.semver.prerelease.length&&d.semver.major===h.major&&d.semver.minor===h.minor&&d.semver.patch===h.patch&&(h=!1),d.operator===">"||d.operator===">="){if(a=BI(i,d,r),a===d&&a!==i)return!1}else if(i.operator===">="&&!Oc(i.semver,String(d),r))return!1}if(o){if(f&&d.semver.prerelease&&d.semver.prerelease.length&&d.semver.major===f.major&&d.semver.minor===f.minor&&d.semver.patch===f.patch&&(f=!1),d.operator==="<"||d.operator==="<="){if(u=qI(o,d,r),u===d&&u!==o)return!1}else if(o.operator==="<="&&!Oc(o.semver,String(d),r))return!1}if(!d.operator&&(o||i)&&s!==0)return!1}return!(i&&c&&!o&&s!==0||o&&l&&!i&&s!==0||h||f)},BI=(t,e,r)=>{if(!t)return e;let n=kv(t.semver,e.semver,r);return n>0?t:n<0||e.operator===">"&&t.operator===">="?e:t},qI=(t,e,r)=>{if(!t)return e;let n=kv(t.semver,e.semver,r);return n<0?t:n>0||e.operator==="<"&&t.operator==="<="?e:t};MI.exports=Fie});var Rv=y((_ge,HI)=>{var Pv=oa(),UI=_c(),kie=St(),VI=gv(),Tie=go(),Pie=g$(),Rie=D$(),$ie=w$(),Iie=C$(),jie=x$(),Nie=O$(),Lie=k$(),Bie=P$(),qie=_r(),Mie=j$(),Uie=L$(),Vie=gh(),Hie=U$(),zie=H$(),Gie=Cc(),Wie=yh(),Kie=Dv(),Yie=vv(),Jie=Dh(),Xie=vh(),Zie=bv(),Qie=Q$(),eoe=Sc(),toe=Er(),roe=Fc(),noe=pI(),ioe=gI(),ooe=DI(),soe=wI(),aoe=EI(),uoe=_h(),coe=AI(),loe=TI(),foe=$I(),doe=jI(),hoe=Tv();HI.exports={parse:Tie,valid:Pie,clean:Rie,inc:$ie,diff:Iie,major:jie,minor:Nie,patch:Lie,prerelease:Bie,compare:qie,rcompare:Mie,compareLoose:Uie,compareBuild:Vie,sort:Hie,rsort:zie,gt:Gie,lt:Wie,eq:Kie,neq:Yie,gte:Jie,lte:Xie,cmp:Zie,coerce:Qie,Comparator:eoe,Range:toe,satisfies:roe,toComparators:noe,maxSatisfying:ioe,minSatisfying:ooe,minVersion:soe,validRange:aoe,outside:uoe,gtr:coe,ltr:loe,intersects:foe,simplifyRange:doe,subset:hoe,SemVer:kie,re:Pv.re,src:Pv.src,tokens:Pv.t,SEMVER_SPEC_VERSION:UI.SEMVER_SPEC_VERSION,RELEASE_TYPES:UI.RELEASE_TYPES,compareIdentifiers:VI.compareIdentifiers,rcompareIdentifiers:VI.rcompareIdentifiers}});var r6=y(W=>{"use strict";Object.defineProperty(W,"__esModule",{value:!0});W.parseApkNameFromFlavor=W.checkJDKMajorVersion=W.resolvePlatform=W.checkPlatformVersions=W.getAddedPlatforms=W.getPlatformTargetName=W.promptForPlatformTarget=W.promptForPlatform=W.isValidEnterprisePlatform=W.getKnownEnterprisePlatforms=W.isValidCommunityPlatform=W.getKnownCommunityPlatforms=W.isValidPlatform=W.getKnownPlatforms=W.selectPlatforms=W.getProjectPlatformDirectory=W.getCLIVersion=W.getCoreVersion=W.getCapacitorPackageVersion=W.requireCapacitorPackage=W.getCapacitorPackage=W.runTask=W.runPlatformHook=W.runHooks=W.wait=W.checkAppName=W.checkAppId=W.checkAppDir=W.checkAppConfig=W.checkCapacitorPlatform=W.checkPackage=W.checkWebDir=W.check=void 0;var kc=(Cn(),ke(En)),gi=Us(),zI=KD(),yo=require("path"),Se=kc.__importDefault(Gs()),aa=Gd(),WI=cc(),poe=ZR(),GI=pl(),Ac=fh(),moe=dh();async function goe(t){let r=(await Promise.all(t.map(n=>n()))).filter(n=>n!=null);if(r.length>0)throw r.join(`
166
- `)}W.check=goe;async function yoe(t){var e;return!((e=t.app.extConfig.server)===null||e===void 0)&&e.url?null:["",".","..","../","./"].includes(t.app.webDir)?`"${t.app.webDir}" is not a valid value for webDir`:await(0,gi.pathExists)(t.app.webDirAbs)?await(0,gi.pathExists)((0,yo.join)(t.app.webDirAbs,"index.html"))?null:`The web assets directory (${Se.default.strong((0,zI.prettyPath)(t.app.webDirAbs))}) must contain an ${Se.default.strong("index.html")} file.
165
+ `),ure.logger.info(n)}Ce.printPlugins=fre;function fv(t,e){return t.xml.platform?t.xml.platform.filter(function(i){return i.$.name===e})[0]:[]}Ce.getPluginPlatform=fv;function dre(t,e,r){let n=fv(t,e);if(n){let i=n[r];if(i)return i}return[]}Ce.getPlatformElement=dre;function hre(t,e){var r,n,i,o;switch(e){case"ios":return(n=(r=t.ios)===null||r===void 0?void 0:r.type)!==null&&n!==void 0?n:0;case"android":return(o=(i=t.android)===null||i===void 0?void 0:i.type)!==null&&o!==void 0?o:0}return 0}Ce.getPluginType=hre;function pre(t,e){return dv(t,e,"js-module")}Ce.getJSModules=pre;function mre(t,e){return dv(t,e,"asset")}Ce.getAssets=mre;function gre(t,e,r){if(r.startsWith("node_modules")){let n=r.split("/").slice(1);n[0].startsWith("@")&&(n=[n[0]+"/"+n[1],...n.slice(2)]);let i=(0,KR.resolveNode)(t.app.rootDir,...n);if(!i)throw new Error(`Can't resolve module ${n[0]}`);return i}return(0,cv.join)(e.rootPath,r)}Ce.getFilePath=gre;function dv(t,e,r){let n=[];t.xml[r]&&(n=n.concat(t.xml[r]));let i=fv(t,e);return i?.[r]&&(n=n.concat(i[r])),n}Ce.getAllElements=dv});var QR={};mn(QR,{default:()=>yre});var yre,e$=ut(()=>{yre={}});var lh=y(mi=>{"use strict";Object.defineProperty(mi,"__esModule",{value:!0});mi.isInstalled=mi.getCommandOutput=mi.runCommand=void 0;var hv=(e$(),ke(QR));async function t$(t,e,r={}){let n=new hv.Subprocess(t,e,r);try{return await n.output()}catch(i){throw i instanceof hv.SubprocessError?i.output?i.output:i.code?i.code:i.error?i.error.message:"Unknown error":i}}mi.runCommand=t$;async function Dre(t,e,r={}){try{return(await t$(t,e,r)).trim()}catch{return null}}mi.getCommandOutput=Dre;async function vre(t){try{await(0,hv.which)(t)}catch{return!1}return!0}mi.isInstalled=vre});var _c=y((Rme,r$)=>{var bre="2.0.0",wre=Number.MAX_SAFE_INTEGER||9007199254740991,_re=16,Ere=250,Cre=["major","premajor","minor","preminor","patch","prepatch","prerelease"];r$.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:_re,MAX_SAFE_BUILD_LENGTH:Ere,MAX_SAFE_INTEGER:wre,RELEASE_TYPES:Cre,SEMVER_SPEC_VERSION:bre,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var Ec=y(($me,n$)=>{var Sre=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{};n$.exports=Sre});var oa=y((In,i$)=>{var{MAX_SAFE_COMPONENT_LENGTH:pv,MAX_SAFE_BUILD_LENGTH:xre,MAX_LENGTH:Fre}=_c(),Ore=Ec();In=i$.exports={};var Are=In.re=[],kre=In.safeRe=[],z=In.src=[],G=In.t={},Tre=0,mv="[a-zA-Z0-9-]",Pre=[["\\s",1],["\\d",Fre],[mv,xre]],Rre=t=>{for(let[e,r]of Pre)t=t.split(`${e}*`).join(`${e}{0,${r}}`).split(`${e}+`).join(`${e}{1,${r}}`);return t},ne=(t,e,r)=>{let n=Rre(e),i=Tre++;Ore(t,i,e),G[t]=i,z[i]=e,Are[i]=new RegExp(e,r?"g":void 0),kre[i]=new RegExp(n,r?"g":void 0)};ne("NUMERICIDENTIFIER","0|[1-9]\\d*");ne("NUMERICIDENTIFIERLOOSE","\\d+");ne("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${mv}*`);ne("MAINVERSION",`(${z[G.NUMERICIDENTIFIER]})\\.(${z[G.NUMERICIDENTIFIER]})\\.(${z[G.NUMERICIDENTIFIER]})`);ne("MAINVERSIONLOOSE",`(${z[G.NUMERICIDENTIFIERLOOSE]})\\.(${z[G.NUMERICIDENTIFIERLOOSE]})\\.(${z[G.NUMERICIDENTIFIERLOOSE]})`);ne("PRERELEASEIDENTIFIER",`(?:${z[G.NUMERICIDENTIFIER]}|${z[G.NONNUMERICIDENTIFIER]})`);ne("PRERELEASEIDENTIFIERLOOSE",`(?:${z[G.NUMERICIDENTIFIERLOOSE]}|${z[G.NONNUMERICIDENTIFIER]})`);ne("PRERELEASE",`(?:-(${z[G.PRERELEASEIDENTIFIER]}(?:\\.${z[G.PRERELEASEIDENTIFIER]})*))`);ne("PRERELEASELOOSE",`(?:-?(${z[G.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${z[G.PRERELEASEIDENTIFIERLOOSE]})*))`);ne("BUILDIDENTIFIER",`${mv}+`);ne("BUILD",`(?:\\+(${z[G.BUILDIDENTIFIER]}(?:\\.${z[G.BUILDIDENTIFIER]})*))`);ne("FULLPLAIN",`v?${z[G.MAINVERSION]}${z[G.PRERELEASE]}?${z[G.BUILD]}?`);ne("FULL",`^${z[G.FULLPLAIN]}$`);ne("LOOSEPLAIN",`[v=\\s]*${z[G.MAINVERSIONLOOSE]}${z[G.PRERELEASELOOSE]}?${z[G.BUILD]}?`);ne("LOOSE",`^${z[G.LOOSEPLAIN]}$`);ne("GTLT","((?:<|>)?=?)");ne("XRANGEIDENTIFIERLOOSE",`${z[G.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);ne("XRANGEIDENTIFIER",`${z[G.NUMERICIDENTIFIER]}|x|X|\\*`);ne("XRANGEPLAIN",`[v=\\s]*(${z[G.XRANGEIDENTIFIER]})(?:\\.(${z[G.XRANGEIDENTIFIER]})(?:\\.(${z[G.XRANGEIDENTIFIER]})(?:${z[G.PRERELEASE]})?${z[G.BUILD]}?)?)?`);ne("XRANGEPLAINLOOSE",`[v=\\s]*(${z[G.XRANGEIDENTIFIERLOOSE]})(?:\\.(${z[G.XRANGEIDENTIFIERLOOSE]})(?:\\.(${z[G.XRANGEIDENTIFIERLOOSE]})(?:${z[G.PRERELEASELOOSE]})?${z[G.BUILD]}?)?)?`);ne("XRANGE",`^${z[G.GTLT]}\\s*${z[G.XRANGEPLAIN]}$`);ne("XRANGELOOSE",`^${z[G.GTLT]}\\s*${z[G.XRANGEPLAINLOOSE]}$`);ne("COERCEPLAIN",`(^|[^\\d])(\\d{1,${pv}})(?:\\.(\\d{1,${pv}}))?(?:\\.(\\d{1,${pv}}))?`);ne("COERCE",`${z[G.COERCEPLAIN]}(?:$|[^\\d])`);ne("COERCEFULL",z[G.COERCEPLAIN]+`(?:${z[G.PRERELEASE]})?(?:${z[G.BUILD]})?(?:$|[^\\d])`);ne("COERCERTL",z[G.COERCE],!0);ne("COERCERTLFULL",z[G.COERCEFULL],!0);ne("LONETILDE","(?:~>?)");ne("TILDETRIM",`(\\s*)${z[G.LONETILDE]}\\s+`,!0);In.tildeTrimReplace="$1~";ne("TILDE",`^${z[G.LONETILDE]}${z[G.XRANGEPLAIN]}$`);ne("TILDELOOSE",`^${z[G.LONETILDE]}${z[G.XRANGEPLAINLOOSE]}$`);ne("LONECARET","(?:\\^)");ne("CARETTRIM",`(\\s*)${z[G.LONECARET]}\\s+`,!0);In.caretTrimReplace="$1^";ne("CARET",`^${z[G.LONECARET]}${z[G.XRANGEPLAIN]}$`);ne("CARETLOOSE",`^${z[G.LONECARET]}${z[G.XRANGEPLAINLOOSE]}$`);ne("COMPARATORLOOSE",`^${z[G.GTLT]}\\s*(${z[G.LOOSEPLAIN]})$|^$`);ne("COMPARATOR",`^${z[G.GTLT]}\\s*(${z[G.FULLPLAIN]})$|^$`);ne("COMPARATORTRIM",`(\\s*)${z[G.GTLT]}\\s*(${z[G.LOOSEPLAIN]}|${z[G.XRANGEPLAIN]})`,!0);In.comparatorTrimReplace="$1$2$3";ne("HYPHENRANGE",`^\\s*(${z[G.XRANGEPLAIN]})\\s+-\\s+(${z[G.XRANGEPLAIN]})\\s*$`);ne("HYPHENRANGELOOSE",`^\\s*(${z[G.XRANGEPLAINLOOSE]})\\s+-\\s+(${z[G.XRANGEPLAINLOOSE]})\\s*$`);ne("STAR","(<|>)?=?\\s*\\*");ne("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");ne("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var fh=y((Ime,o$)=>{var $re=Object.freeze({loose:!0}),Ire=Object.freeze({}),jre=t=>t?typeof t!="object"?$re:t:Ire;o$.exports=jre});var gv=y((jme,u$)=>{var s$=/^[0-9]+$/,a$=(t,e)=>{let r=s$.test(t),n=s$.test(e);return r&&n&&(t=+t,e=+e),t===e?0:r&&!n?-1:n&&!r?1:t<e?-1:1},Nre=(t,e)=>a$(e,t);u$.exports={compareIdentifiers:a$,rcompareIdentifiers:Nre}});var St=y((Nme,d$)=>{var dh=Ec(),{MAX_LENGTH:c$,MAX_SAFE_INTEGER:hh}=_c(),{safeRe:l$,t:f$}=oa(),Lre=fh(),{compareIdentifiers:sa}=gv(),yv=class t{constructor(e,r){if(r=Lre(r),e instanceof t){if(e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease)return e;e=e.version}else if(typeof e!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>c$)throw new TypeError(`version is longer than ${c$} characters`);dh("SemVer",e,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;let n=e.trim().match(r.loose?l$[f$.LOOSE]:l$[f$.FULL]);if(!n)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>hh||this.major<0)throw new TypeError("Invalid major version");if(this.minor>hh||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>hh||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map(i=>{if(/^[0-9]+$/.test(i)){let o=+i;if(o>=0&&o<hh)return o}return i}):this.prerelease=[],this.build=n[5]?n[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(dh("SemVer.compare",this.version,this.options,e),!(e instanceof t)){if(typeof e=="string"&&e===this.version)return 0;e=new t(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof t||(e=new t(e,this.options)),sa(this.major,e.major)||sa(this.minor,e.minor)||sa(this.patch,e.patch)}comparePre(e){if(e instanceof t||(e=new t(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let r=0;do{let n=this.prerelease[r],i=e.prerelease[r];if(dh("prerelease compare",r,n,i),n===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(n===void 0)return-1;if(n===i)continue;return sa(n,i)}while(++r)}compareBuild(e){e instanceof t||(e=new t(e,this.options));let r=0;do{let n=this.build[r],i=e.build[r];if(dh("build compare",r,n,i),n===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(n===void 0)return-1;if(n===i)continue;return sa(n,i)}while(++r)}inc(e,r,n){switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",r,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",r,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",r,n),this.inc("pre",r,n);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",r,n),this.inc("pre",r,n);break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{let i=Number(n)?1:0;if(!r&&n===!1)throw new Error("invalid increment argument: identifier is empty");if(this.prerelease.length===0)this.prerelease=[i];else{let o=this.prerelease.length;for(;--o>=0;)typeof this.prerelease[o]=="number"&&(this.prerelease[o]++,o=-2);if(o===-1){if(r===this.prerelease.join(".")&&n===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(i)}}if(r){let o=[r,i];n===!1&&(o=[r]),sa(this.prerelease[0],r)===0?isNaN(this.prerelease[1])&&(this.prerelease=o):this.prerelease=o}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};d$.exports=yv});var mo=y((Lme,p$)=>{var h$=St(),Bre=(t,e,r=!1)=>{if(t instanceof h$)return t;try{return new h$(t,e)}catch(n){if(!r)return null;throw n}};p$.exports=Bre});var g$=y((Bme,m$)=>{var qre=mo(),Mre=(t,e)=>{let r=qre(t,e);return r?r.version:null};m$.exports=Mre});var D$=y((qme,y$)=>{var Ure=mo(),Vre=(t,e)=>{let r=Ure(t.trim().replace(/^[=v]+/,""),e);return r?r.version:null};y$.exports=Vre});var w$=y((Mme,b$)=>{var v$=St(),Hre=(t,e,r,n,i)=>{typeof r=="string"&&(i=n,n=r,r=void 0);try{return new v$(t instanceof v$?t.version:t,r).inc(e,n,i).version}catch{return null}};b$.exports=Hre});var C$=y((Ume,E$)=>{var _$=mo(),zre=(t,e)=>{let r=_$(t,null,!0),n=_$(e,null,!0),i=r.compare(n);if(i===0)return null;let o=i>0,s=o?r:n,a=o?n:r,u=!!s.prerelease.length;if(!!a.prerelease.length&&!u)return!a.patch&&!a.minor?"major":s.patch?"patch":s.minor?"minor":"major";let l=u?"pre":"";return r.major!==n.major?l+"major":r.minor!==n.minor?l+"minor":r.patch!==n.patch?l+"patch":"prerelease"};E$.exports=zre});var x$=y((Vme,S$)=>{var Gre=St(),Wre=(t,e)=>new Gre(t,e).major;S$.exports=Wre});var O$=y((Hme,F$)=>{var Kre=St(),Yre=(t,e)=>new Kre(t,e).minor;F$.exports=Yre});var k$=y((zme,A$)=>{var Jre=St(),Xre=(t,e)=>new Jre(t,e).patch;A$.exports=Xre});var P$=y((Gme,T$)=>{var Zre=mo(),Qre=(t,e)=>{let r=Zre(t,e);return r&&r.prerelease.length?r.prerelease:null};T$.exports=Qre});var _r=y((Wme,$$)=>{var R$=St(),ene=(t,e,r)=>new R$(t,r).compare(new R$(e,r));$$.exports=ene});var j$=y((Kme,I$)=>{var tne=_r(),rne=(t,e,r)=>tne(e,t,r);I$.exports=rne});var L$=y((Yme,N$)=>{var nne=_r(),ine=(t,e)=>nne(t,e,!0);N$.exports=ine});var ph=y((Jme,q$)=>{var B$=St(),one=(t,e,r)=>{let n=new B$(t,r),i=new B$(e,r);return n.compare(i)||n.compareBuild(i)};q$.exports=one});var U$=y((Xme,M$)=>{var sne=ph(),ane=(t,e)=>t.sort((r,n)=>sne(r,n,e));M$.exports=ane});var H$=y((Zme,V$)=>{var une=ph(),cne=(t,e)=>t.sort((r,n)=>une(n,r,e));V$.exports=cne});var Cc=y((Qme,z$)=>{var lne=_r(),fne=(t,e,r)=>lne(t,e,r)>0;z$.exports=fne});var mh=y((ege,G$)=>{var dne=_r(),hne=(t,e,r)=>dne(t,e,r)<0;G$.exports=hne});var Dv=y((tge,W$)=>{var pne=_r(),mne=(t,e,r)=>pne(t,e,r)===0;W$.exports=mne});var vv=y((rge,K$)=>{var gne=_r(),yne=(t,e,r)=>gne(t,e,r)!==0;K$.exports=yne});var gh=y((nge,Y$)=>{var Dne=_r(),vne=(t,e,r)=>Dne(t,e,r)>=0;Y$.exports=vne});var yh=y((ige,J$)=>{var bne=_r(),wne=(t,e,r)=>bne(t,e,r)<=0;J$.exports=wne});var bv=y((oge,X$)=>{var _ne=Dv(),Ene=vv(),Cne=Cc(),Sne=gh(),xne=mh(),Fne=yh(),One=(t,e,r,n)=>{switch(e){case"===":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t===r;case"!==":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t!==r;case"":case"=":case"==":return _ne(t,r,n);case"!=":return Ene(t,r,n);case">":return Cne(t,r,n);case">=":return Sne(t,r,n);case"<":return xne(t,r,n);case"<=":return Fne(t,r,n);default:throw new TypeError(`Invalid operator: ${e}`)}};X$.exports=One});var Q$=y((sge,Z$)=>{var Ane=St(),kne=mo(),{safeRe:Dh,t:vh}=oa(),Tne=(t,e)=>{if(t instanceof Ane)return t;if(typeof t=="number"&&(t=String(t)),typeof t!="string")return null;e=e||{};let r=null;if(!e.rtl)r=t.match(e.includePrerelease?Dh[vh.COERCEFULL]:Dh[vh.COERCE]);else{let u=e.includePrerelease?Dh[vh.COERCERTLFULL]:Dh[vh.COERCERTL],c;for(;(c=u.exec(t))&&(!r||r.index+r[0].length!==t.length);)(!r||c.index+c[0].length!==r.index+r[0].length)&&(r=c),u.lastIndex=c.index+c[1].length+c[2].length;u.lastIndex=-1}if(r===null)return null;let n=r[2],i=r[3]||"0",o=r[4]||"0",s=e.includePrerelease&&r[5]?`-${r[5]}`:"",a=e.includePrerelease&&r[6]?`+${r[6]}`:"";return kne(`${n}.${i}.${o}${s}${a}`,e)};Z$.exports=Tne});var tI=y((age,eI)=>{var wv=class{constructor(){this.max=1e3,this.map=new Map}get(e){let r=this.map.get(e);if(r!==void 0)return this.map.delete(e),this.map.set(e,r),r}delete(e){return this.map.delete(e)}set(e,r){if(!this.delete(e)&&r!==void 0){if(this.map.size>=this.max){let i=this.map.keys().next().value;this.delete(i)}this.map.set(e,r)}return this}};eI.exports=wv});var Er=y((uge,oI)=>{var Pne=/\s+/g,_v=class t{constructor(e,r){if(r=$ne(r),e instanceof t)return e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease?e:new t(e.raw,r);if(e instanceof Ev)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=e.trim().replace(Pne," "),this.set=this.raw.split("||").map(n=>this.parseRange(n.trim())).filter(n=>n.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let n=this.set[0];if(this.set=this.set.filter(i=>!nI(i[0])),this.set.length===0)this.set=[n];else if(this.set.length>1){for(let i of this.set)if(i.length===1&&Mne(i[0])){this.set=[i];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+="||");let r=this.set[e];for(let n=0;n<r.length;n++)n>0&&(this.formatted+=" "),this.formatted+=r[n].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){let n=((this.options.includePrerelease&&Bne)|(this.options.loose&&qne))+":"+e,i=rI.get(n);if(i)return i;let o=this.options.loose,s=o?Zt[$t.HYPHENRANGELOOSE]:Zt[$t.HYPHENRANGE];e=e.replace(s,Xne(this.options.includePrerelease)),$e("hyphen replace",e),e=e.replace(Zt[$t.COMPARATORTRIM],jne),$e("comparator trim",e),e=e.replace(Zt[$t.TILDETRIM],Nne),$e("tilde trim",e),e=e.replace(Zt[$t.CARETTRIM],Lne),$e("caret trim",e);let a=e.split(" ").map(f=>Une(f,this.options)).join(" ").split(/\s+/).map(f=>Jne(f,this.options));o&&(a=a.filter(f=>($e("loose invalid filter",f,this.options),!!f.match(Zt[$t.COMPARATORLOOSE])))),$e("range list",a);let u=new Map,c=a.map(f=>new Ev(f,this.options));for(let f of c){if(nI(f))return[f];u.set(f.value,f)}u.size>1&&u.has("")&&u.delete("");let l=[...u.values()];return rI.set(n,l),l}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Range is required");return this.set.some(n=>iI(n,r)&&e.set.some(i=>iI(i,r)&&n.every(o=>i.every(s=>o.intersects(s,r)))))}test(e){if(!e)return!1;if(typeof e=="string")try{e=new Ine(e,this.options)}catch{return!1}for(let r=0;r<this.set.length;r++)if(Zne(this.set[r],e,this.options))return!0;return!1}};oI.exports=_v;var Rne=tI(),rI=new Rne,$ne=fh(),Ev=Sc(),$e=Ec(),Ine=St(),{safeRe:Zt,t:$t,comparatorTrimReplace:jne,tildeTrimReplace:Nne,caretTrimReplace:Lne}=oa(),{FLAG_INCLUDE_PRERELEASE:Bne,FLAG_LOOSE:qne}=_c(),nI=t=>t.value==="<0.0.0-0",Mne=t=>t.value==="",iI=(t,e)=>{let r=!0,n=t.slice(),i=n.pop();for(;r&&n.length;)r=n.every(o=>i.intersects(o,e)),i=n.pop();return r},Une=(t,e)=>($e("comp",t,e),t=zne(t,e),$e("caret",t),t=Vne(t,e),$e("tildes",t),t=Wne(t,e),$e("xrange",t),t=Yne(t,e),$e("stars",t),t),It=t=>!t||t.toLowerCase()==="x"||t==="*",Vne=(t,e)=>t.trim().split(/\s+/).map(r=>Hne(r,e)).join(" "),Hne=(t,e)=>{let r=e.loose?Zt[$t.TILDELOOSE]:Zt[$t.TILDE];return t.replace(r,(n,i,o,s,a)=>{$e("tilde",t,n,i,o,s,a);let u;return It(i)?u="":It(o)?u=`>=${i}.0.0 <${+i+1}.0.0-0`:It(s)?u=`>=${i}.${o}.0 <${i}.${+o+1}.0-0`:a?($e("replaceTilde pr",a),u=`>=${i}.${o}.${s}-${a} <${i}.${+o+1}.0-0`):u=`>=${i}.${o}.${s} <${i}.${+o+1}.0-0`,$e("tilde return",u),u})},zne=(t,e)=>t.trim().split(/\s+/).map(r=>Gne(r,e)).join(" "),Gne=(t,e)=>{$e("caret",t,e);let r=e.loose?Zt[$t.CARETLOOSE]:Zt[$t.CARET],n=e.includePrerelease?"-0":"";return t.replace(r,(i,o,s,a,u)=>{$e("caret",t,i,o,s,a,u);let c;return It(o)?c="":It(s)?c=`>=${o}.0.0${n} <${+o+1}.0.0-0`:It(a)?o==="0"?c=`>=${o}.${s}.0${n} <${o}.${+s+1}.0-0`:c=`>=${o}.${s}.0${n} <${+o+1}.0.0-0`:u?($e("replaceCaret pr",u),o==="0"?s==="0"?c=`>=${o}.${s}.${a}-${u} <${o}.${s}.${+a+1}-0`:c=`>=${o}.${s}.${a}-${u} <${o}.${+s+1}.0-0`:c=`>=${o}.${s}.${a}-${u} <${+o+1}.0.0-0`):($e("no pr"),o==="0"?s==="0"?c=`>=${o}.${s}.${a}${n} <${o}.${s}.${+a+1}-0`:c=`>=${o}.${s}.${a}${n} <${o}.${+s+1}.0-0`:c=`>=${o}.${s}.${a} <${+o+1}.0.0-0`),$e("caret return",c),c})},Wne=(t,e)=>($e("replaceXRanges",t,e),t.split(/\s+/).map(r=>Kne(r,e)).join(" ")),Kne=(t,e)=>{t=t.trim();let r=e.loose?Zt[$t.XRANGELOOSE]:Zt[$t.XRANGE];return t.replace(r,(n,i,o,s,a,u)=>{$e("xRange",t,n,i,o,s,a,u);let c=It(o),l=c||It(s),f=l||It(a),h=f;return i==="="&&h&&(i=""),u=e.includePrerelease?"-0":"",c?i===">"||i==="<"?n="<0.0.0-0":n="*":i&&h?(l&&(s=0),a=0,i===">"?(i=">=",l?(o=+o+1,s=0,a=0):(s=+s+1,a=0)):i==="<="&&(i="<",l?o=+o+1:s=+s+1),i==="<"&&(u="-0"),n=`${i+o}.${s}.${a}${u}`):l?n=`>=${o}.0.0${u} <${+o+1}.0.0-0`:f&&(n=`>=${o}.${s}.0${u} <${o}.${+s+1}.0-0`),$e("xRange return",n),n})},Yne=(t,e)=>($e("replaceStars",t,e),t.trim().replace(Zt[$t.STAR],"")),Jne=(t,e)=>($e("replaceGTE0",t,e),t.trim().replace(Zt[e.includePrerelease?$t.GTE0PRE:$t.GTE0],"")),Xne=t=>(e,r,n,i,o,s,a,u,c,l,f,h)=>(It(n)?r="":It(i)?r=`>=${n}.0.0${t?"-0":""}`:It(o)?r=`>=${n}.${i}.0${t?"-0":""}`:s?r=`>=${r}`:r=`>=${r}${t?"-0":""}`,It(c)?u="":It(l)?u=`<${+c+1}.0.0-0`:It(f)?u=`<${c}.${+l+1}.0-0`:h?u=`<=${c}.${l}.${f}-${h}`:t?u=`<${c}.${l}.${+f+1}-0`:u=`<=${u}`,`${r} ${u}`.trim()),Zne=(t,e,r)=>{for(let n=0;n<t.length;n++)if(!t[n].test(e))return!1;if(e.prerelease.length&&!r.includePrerelease){for(let n=0;n<t.length;n++)if($e(t[n].semver),t[n].semver!==Ev.ANY&&t[n].semver.prerelease.length>0){let i=t[n].semver;if(i.major===e.major&&i.minor===e.minor&&i.patch===e.patch)return!0}return!1}return!0}});var Sc=y((cge,fI)=>{var xc=Symbol("SemVer ANY"),xv=class t{static get ANY(){return xc}constructor(e,r){if(r=sI(r),e instanceof t){if(e.loose===!!r.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),Sv("comparator",e,r),this.options=r,this.loose=!!r.loose,this.parse(e),this.semver===xc?this.value="":this.value=this.operator+this.semver.version,Sv("comp",this)}parse(e){let r=this.options.loose?aI[uI.COMPARATORLOOSE]:aI[uI.COMPARATOR],n=e.match(r);if(!n)throw new TypeError(`Invalid comparator: ${e}`);this.operator=n[1]!==void 0?n[1]:"",this.operator==="="&&(this.operator=""),n[2]?this.semver=new cI(n[2],this.options.loose):this.semver=xc}toString(){return this.value}test(e){if(Sv("Comparator.test",e,this.options.loose),this.semver===xc||e===xc)return!0;if(typeof e=="string")try{e=new cI(e,this.options)}catch{return!1}return Cv(e,this.operator,this.semver,this.options)}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new lI(e.value,r).test(this.value):e.operator===""?e.value===""?!0:new lI(this.value,r).test(e.semver):(r=sI(r),r.includePrerelease&&(this.value==="<0.0.0-0"||e.value==="<0.0.0-0")||!r.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&e.operator.startsWith(">")||this.operator.startsWith("<")&&e.operator.startsWith("<")||this.semver.version===e.semver.version&&this.operator.includes("=")&&e.operator.includes("=")||Cv(this.semver,"<",e.semver,r)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||Cv(this.semver,">",e.semver,r)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}};fI.exports=xv;var sI=fh(),{safeRe:aI,t:uI}=oa(),Cv=bv(),Sv=Ec(),cI=St(),lI=Er()});var Fc=y((lge,dI)=>{var Qne=Er(),eie=(t,e,r)=>{try{e=new Qne(e,r)}catch{return!1}return e.test(t)};dI.exports=eie});var pI=y((fge,hI)=>{var tie=Er(),rie=(t,e)=>new tie(t,e).set.map(r=>r.map(n=>n.value).join(" ").trim().split(" "));hI.exports=rie});var gI=y((dge,mI)=>{var nie=St(),iie=Er(),oie=(t,e,r)=>{let n=null,i=null,o=null;try{o=new iie(e,r)}catch{return null}return t.forEach(s=>{o.test(s)&&(!n||i.compare(s)===-1)&&(n=s,i=new nie(n,r))}),n};mI.exports=oie});var DI=y((hge,yI)=>{var sie=St(),aie=Er(),uie=(t,e,r)=>{let n=null,i=null,o=null;try{o=new aie(e,r)}catch{return null}return t.forEach(s=>{o.test(s)&&(!n||i.compare(s)===1)&&(n=s,i=new sie(n,r))}),n};yI.exports=uie});var wI=y((pge,bI)=>{var Fv=St(),cie=Er(),vI=Cc(),lie=(t,e)=>{t=new cie(t,e);let r=new Fv("0.0.0");if(t.test(r)||(r=new Fv("0.0.0-0"),t.test(r)))return r;r=null;for(let n=0;n<t.set.length;++n){let i=t.set[n],o=null;i.forEach(s=>{let a=new Fv(s.semver.version);switch(s.operator){case">":a.prerelease.length===0?a.patch++:a.prerelease.push(0),a.raw=a.format();case"":case">=":(!o||vI(a,o))&&(o=a);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${s.operator}`)}}),o&&(!r||vI(r,o))&&(r=o)}return r&&t.test(r)?r:null};bI.exports=lie});var EI=y((mge,_I)=>{var fie=Er(),die=(t,e)=>{try{return new fie(t,e).range||"*"}catch{return null}};_I.exports=die});var bh=y((gge,FI)=>{var hie=St(),xI=Sc(),{ANY:pie}=xI,mie=Er(),gie=Fc(),CI=Cc(),SI=mh(),yie=yh(),Die=gh(),vie=(t,e,r,n)=>{t=new hie(t,n),e=new mie(e,n);let i,o,s,a,u;switch(r){case">":i=CI,o=yie,s=SI,a=">",u=">=";break;case"<":i=SI,o=Die,s=CI,a="<",u="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(gie(t,e,n))return!1;for(let c=0;c<e.set.length;++c){let l=e.set[c],f=null,h=null;if(l.forEach(d=>{d.semver===pie&&(d=new xI(">=0.0.0")),f=f||d,h=h||d,i(d.semver,f.semver,n)?f=d:s(d.semver,h.semver,n)&&(h=d)}),f.operator===a||f.operator===u||(!h.operator||h.operator===a)&&o(t,h.semver))return!1;if(h.operator===u&&s(t,h.semver))return!1}return!0};FI.exports=vie});var AI=y((yge,OI)=>{var bie=bh(),wie=(t,e,r)=>bie(t,e,">",r);OI.exports=wie});var TI=y((Dge,kI)=>{var _ie=bh(),Eie=(t,e,r)=>_ie(t,e,"<",r);kI.exports=Eie});var $I=y((vge,RI)=>{var PI=Er(),Cie=(t,e,r)=>(t=new PI(t,r),e=new PI(e,r),t.intersects(e,r));RI.exports=Cie});var jI=y((bge,II)=>{var Sie=Fc(),xie=_r();II.exports=(t,e,r)=>{let n=[],i=null,o=null,s=t.sort((l,f)=>xie(l,f,r));for(let l of s)Sie(l,e,r)?(o=l,i||(i=l)):(o&&n.push([i,o]),o=null,i=null);i&&n.push([i,null]);let a=[];for(let[l,f]of n)l===f?a.push(l):!f&&l===s[0]?a.push("*"):f?l===s[0]?a.push(`<=${f}`):a.push(`${l} - ${f}`):a.push(`>=${l}`);let u=a.join(" || "),c=typeof e.raw=="string"?e.raw:String(e);return u.length<c.length?u:e}});var Tv=y((wge,MI)=>{var NI=Er(),Av=Sc(),{ANY:Ov}=Av,Oc=Fc(),kv=_r(),Fie=(t,e,r={})=>{if(t===e)return!0;t=new NI(t,r),e=new NI(e,r);let n=!1;e:for(let i of t.set){for(let o of e.set){let s=Aie(i,o,r);if(n=n||s!==null,s)continue e}if(n)return!1}return!0},Oie=[new Av(">=0.0.0-0")],LI=[new Av(">=0.0.0")],Aie=(t,e,r)=>{if(t===e)return!0;if(t.length===1&&t[0].semver===Ov){if(e.length===1&&e[0].semver===Ov)return!0;r.includePrerelease?t=Oie:t=LI}if(e.length===1&&e[0].semver===Ov){if(r.includePrerelease)return!0;e=LI}let n=new Set,i,o;for(let d of t)d.operator===">"||d.operator===">="?i=BI(i,d,r):d.operator==="<"||d.operator==="<="?o=qI(o,d,r):n.add(d.semver);if(n.size>1)return null;let s;if(i&&o){if(s=kv(i.semver,o.semver,r),s>0)return null;if(s===0&&(i.operator!==">="||o.operator!=="<="))return null}for(let d of n){if(i&&!Oc(d,String(i),r)||o&&!Oc(d,String(o),r))return null;for(let p of e)if(!Oc(d,String(p),r))return!1;return!0}let a,u,c,l,f=o&&!r.includePrerelease&&o.semver.prerelease.length?o.semver:!1,h=i&&!r.includePrerelease&&i.semver.prerelease.length?i.semver:!1;f&&f.prerelease.length===1&&o.operator==="<"&&f.prerelease[0]===0&&(f=!1);for(let d of e){if(l=l||d.operator===">"||d.operator===">=",c=c||d.operator==="<"||d.operator==="<=",i){if(h&&d.semver.prerelease&&d.semver.prerelease.length&&d.semver.major===h.major&&d.semver.minor===h.minor&&d.semver.patch===h.patch&&(h=!1),d.operator===">"||d.operator===">="){if(a=BI(i,d,r),a===d&&a!==i)return!1}else if(i.operator===">="&&!Oc(i.semver,String(d),r))return!1}if(o){if(f&&d.semver.prerelease&&d.semver.prerelease.length&&d.semver.major===f.major&&d.semver.minor===f.minor&&d.semver.patch===f.patch&&(f=!1),d.operator==="<"||d.operator==="<="){if(u=qI(o,d,r),u===d&&u!==o)return!1}else if(o.operator==="<="&&!Oc(o.semver,String(d),r))return!1}if(!d.operator&&(o||i)&&s!==0)return!1}return!(i&&c&&!o&&s!==0||o&&l&&!i&&s!==0||h||f)},BI=(t,e,r)=>{if(!t)return e;let n=kv(t.semver,e.semver,r);return n>0?t:n<0||e.operator===">"&&t.operator===">="?e:t},qI=(t,e,r)=>{if(!t)return e;let n=kv(t.semver,e.semver,r);return n<0?t:n>0||e.operator==="<"&&t.operator==="<="?e:t};MI.exports=Fie});var Rv=y((_ge,HI)=>{var Pv=oa(),UI=_c(),kie=St(),VI=gv(),Tie=mo(),Pie=g$(),Rie=D$(),$ie=w$(),Iie=C$(),jie=x$(),Nie=O$(),Lie=k$(),Bie=P$(),qie=_r(),Mie=j$(),Uie=L$(),Vie=ph(),Hie=U$(),zie=H$(),Gie=Cc(),Wie=mh(),Kie=Dv(),Yie=vv(),Jie=gh(),Xie=yh(),Zie=bv(),Qie=Q$(),eoe=Sc(),toe=Er(),roe=Fc(),noe=pI(),ioe=gI(),ooe=DI(),soe=wI(),aoe=EI(),uoe=bh(),coe=AI(),loe=TI(),foe=$I(),doe=jI(),hoe=Tv();HI.exports={parse:Tie,valid:Pie,clean:Rie,inc:$ie,diff:Iie,major:jie,minor:Nie,patch:Lie,prerelease:Bie,compare:qie,rcompare:Mie,compareLoose:Uie,compareBuild:Vie,sort:Hie,rsort:zie,gt:Gie,lt:Wie,eq:Kie,neq:Yie,gte:Jie,lte:Xie,cmp:Zie,coerce:Qie,Comparator:eoe,Range:toe,satisfies:roe,toComparators:noe,maxSatisfying:ioe,minSatisfying:ooe,minVersion:soe,validRange:aoe,outside:uoe,gtr:coe,ltr:loe,intersects:foe,simplifyRange:doe,subset:hoe,SemVer:kie,re:Pv.re,src:Pv.src,tokens:Pv.t,SEMVER_SPEC_VERSION:UI.SEMVER_SPEC_VERSION,RELEASE_TYPES:UI.RELEASE_TYPES,compareIdentifiers:VI.compareIdentifiers,rcompareIdentifiers:VI.rcompareIdentifiers}});var r6=y(W=>{"use strict";Object.defineProperty(W,"__esModule",{value:!0});W.parseApkNameFromFlavor=W.checkJDKMajorVersion=W.resolvePlatform=W.checkPlatformVersions=W.getAddedPlatforms=W.getPlatformTargetName=W.promptForPlatformTarget=W.promptForPlatform=W.isValidEnterprisePlatform=W.getKnownEnterprisePlatforms=W.isValidCommunityPlatform=W.getKnownCommunityPlatforms=W.isValidPlatform=W.getKnownPlatforms=W.selectPlatforms=W.getProjectPlatformDirectory=W.getCLIVersion=W.getCoreVersion=W.getCapacitorPackageVersion=W.requireCapacitorPackage=W.getCapacitorPackage=W.runTask=W.runPlatformHook=W.runHooks=W.wait=W.checkAppName=W.checkAppId=W.checkAppDir=W.checkAppConfig=W.checkCapacitorPlatform=W.checkPackage=W.checkWebDir=W.check=void 0;var kc=(Cn(),ke(En)),gi=Us(),zI=KD(),go=require("path"),Se=kc.__importDefault(Gs()),aa=Hd(),WI=cc(),poe=ZR(),GI=dl(),Ac=ch(),moe=lh();async function goe(t){let r=(await Promise.all(t.map(n=>n()))).filter(n=>n!=null);if(r.length>0)throw r.join(`
166
+ `)}W.check=goe;async function yoe(t){var e;return!((e=t.app.extConfig.server)===null||e===void 0)&&e.url?null:["",".","..","../","./"].includes(t.app.webDir)?`"${t.app.webDir}" is not a valid value for webDir`:await(0,gi.pathExists)(t.app.webDirAbs)?await(0,gi.pathExists)((0,go.join)(t.app.webDirAbs,"index.html"))?null:`The web assets directory (${Se.default.strong((0,zI.prettyPath)(t.app.webDirAbs))}) must contain an ${Se.default.strong("index.html")} file.
167
167
  It will be the entry point for the web portion of the Capacitor app.`:`Could not find the web assets directory: ${Se.default.strong((0,zI.prettyPath)(t.app.webDirAbs))}.
168
168
  Please create it and make sure it has an ${Se.default.strong("index.html")} file. You can change the path of this directory in ${Se.default.strong(t.app.extConfigName)} (${Se.default.input("webDir")} option). You may need to compile the web assets for your app (typically ${Se.default.input("npm run build")}). More info: ${Se.default.strong("https://capacitorjs.com/docs/basics/workflow#sync-your-project")}`}W.checkWebDir=yoe;async function Doe(){return await(0,gi.pathExists)("package.json")||await(0,gi.pathExists)("project.json")?null:`The Capacitor CLI needs to run at the root of an npm package or in a valid NX monorepo.
169
169
  Make sure you have a package.json or project.json file in the directory where you run the Capacitor CLI.
170
170
  More info: ${Se.default.strong("https://docs.npmjs.com/cli/init")}`}W.checkPackage=Doe;async function voe(t,e){return await Iv(t,e)?null:`Could not find the ${Se.default.input(e)} platform.
171
171
  You must install it in your project first, e.g. w/ ${Se.default.input(`npm install @capacitor/${e}`)}`}W.checkCapacitorPlatform=voe;async function boe(t){if(!t.app.appId)return`Missing ${Se.default.input("appId")} for new platform.
172
172
  Please add it in ${t.app.extConfigName} or run ${Se.default.input("npx cap init")}.`;if(!t.app.appName)return`Missing ${Se.default.input("appName")} for new platform.
173
- Please add it in ${t.app.extConfigName} or run ${Se.default.input("npx cap init")}.`;let e=await KI(t,t.app.appId);if(e)return e;let r=await YI(t,t.app.appName);return r||null}W.checkAppConfig=boe;async function woe(t,e){return/^\S*$/.test(e)?null:"Your app directory should not contain spaces"}W.checkAppDir=woe;async function KI(t,e){return e?/^[a-z][a-z0-9_]*(\.[a-z0-9_]+)+$/.test(e.toLowerCase())?null:`Invalid App ID "${e}". Must be in Java package form with no dashes (ex: com.example.app)`:"Invalid App ID. Must be in Java package form with no dashes (ex: com.example.app)"}W.checkAppId=KI;async function YI(t,e){return e?.length?null:"Must provide an app name. For example: 'Spacebook'"}W.checkAppName=YI;async function _oe(t){return new Promise(e=>setTimeout(e,t))}W.wait=_oe;async function Eoe(t,e,r,n){await $v(t,e,r,n),(await(0,poe.getPlugins)(t,e)).forEach(async o=>{await $v(t,e,o.rootPath,n)})}W.runHooks=Eoe;async function $v(t,e,r,n){var i;let{spawn:o}=await Promise.resolve().then(()=>kc.__importStar(require("child_process"))),s;(0,GI.isNXMonorepo)(r)?s=await(0,gi.readJSON)((0,yo.join)((0,GI.findNXMonorepoRoot)(r),"package.json")):s=await(0,gi.readJSON)((0,yo.join)(r,"package.json"));let a=(i=s.scripts)===null||i===void 0?void 0:i[n];if(a)return new Promise((u,c)=>{let l=o(a,{stdio:"inherit",shell:!0,cwd:r,env:{INIT_CWD:r,CAPACITOR_ROOT_DIR:t.app.rootDir,CAPACITOR_WEB_DIR:t.app.webDirAbs,CAPACITOR_CONFIG:JSON.stringify(t.app.extConfig),CAPACITOR_PLATFORM_NAME:e,...process.env}});l.on("close",()=>{u()}),l.on("error",f=>{c(f)})})}W.runPlatformHook=$v;async function Coe(t,e){let r=WI.output.createTaskChain();r.next(t);try{let n=await e();return r.end(),n}catch(n){throw r.fail(),n}}W.runTask=Coe;async function Iv(t,e){let r=(0,Ac.resolveNode)(t.app.rootDir,`@capacitor/${e}`,"package.json");return r?(0,gi.readJSON)(r):null}W.getCapacitorPackage=Iv;async function JI(t,e){let r=await Iv(t,e);return r||(0,aa.fatal)(`Unable to find node_modules/@capacitor/${e}.
174
- Are you sure ${Se.default.strong(`@capacitor/${e}`)} is installed?`),r}W.requireCapacitorPackage=JI;async function Ch(t,e){return(await JI(t,e)).version}W.getCapacitorPackageVersion=Ch;async function XI(t){return Ch(t,"core")}W.getCoreVersion=XI;async function Soe(t){return Ch(t,"cli")}W.getCLIVersion=Soe;function xoe(t,e){switch(e){case"android":return t.android.platformDirAbs;case"ios":return t.ios.platformDirAbs;case"web":return t.web.platformDirAbs}return null}async function Eh(t,e){let r=xoe(t,e);return r&&await(0,gi.pathExists)(r)?r:null}W.getProjectPlatformDirectory=Eh;async function Foe(t,e){if(e){let r=e.toLowerCase().trim();return await Nv(r)?await Eh(t,r)||(r==="web"&&(0,aa.fatal)(`Could not find the web platform directory.
173
+ Please add it in ${t.app.extConfigName} or run ${Se.default.input("npx cap init")}.`;let e=await KI(t,t.app.appId);if(e)return e;let r=await YI(t,t.app.appName);return r||null}W.checkAppConfig=boe;async function woe(t,e){return/^\S*$/.test(e)?null:"Your app directory should not contain spaces"}W.checkAppDir=woe;async function KI(t,e){return e?/^[a-z][a-z0-9_]*(\.[a-z0-9_]+)+$/.test(e.toLowerCase())?null:`Invalid App ID "${e}". Must be in Java package form with no dashes (ex: com.example.app)`:"Invalid App ID. Must be in Java package form with no dashes (ex: com.example.app)"}W.checkAppId=KI;async function YI(t,e){return e?.length?null:"Must provide an app name. For example: 'Spacebook'"}W.checkAppName=YI;async function _oe(t){return new Promise(e=>setTimeout(e,t))}W.wait=_oe;async function Eoe(t,e,r,n){await $v(t,e,r,n),(await(0,poe.getPlugins)(t,e)).forEach(async o=>{await $v(t,e,o.rootPath,n)})}W.runHooks=Eoe;async function $v(t,e,r,n){var i;let{spawn:o}=await Promise.resolve().then(()=>kc.__importStar(require("child_process"))),s;(0,GI.isNXMonorepo)(r)?s=await(0,gi.readJSON)((0,go.join)((0,GI.findNXMonorepoRoot)(r),"package.json")):s=await(0,gi.readJSON)((0,go.join)(r,"package.json"));let a=(i=s.scripts)===null||i===void 0?void 0:i[n];if(a)return new Promise((u,c)=>{let l=o(a,{stdio:"inherit",shell:!0,cwd:r,env:{INIT_CWD:r,CAPACITOR_ROOT_DIR:t.app.rootDir,CAPACITOR_WEB_DIR:t.app.webDirAbs,CAPACITOR_CONFIG:JSON.stringify(t.app.extConfig),CAPACITOR_PLATFORM_NAME:e,...process.env}});l.on("close",()=>{u()}),l.on("error",f=>{c(f)})})}W.runPlatformHook=$v;async function Coe(t,e){let r=WI.output.createTaskChain();r.next(t);try{let n=await e();return r.end(),n}catch(n){throw r.fail(),n}}W.runTask=Coe;async function Iv(t,e){let r=(0,Ac.resolveNode)(t.app.rootDir,`@capacitor/${e}`,"package.json");return r?(0,gi.readJSON)(r):null}W.getCapacitorPackage=Iv;async function JI(t,e){let r=await Iv(t,e);return r||(0,aa.fatal)(`Unable to find node_modules/@capacitor/${e}.
174
+ Are you sure ${Se.default.strong(`@capacitor/${e}`)} is installed?`),r}W.requireCapacitorPackage=JI;async function _h(t,e){return(await JI(t,e)).version}W.getCapacitorPackageVersion=_h;async function XI(t){return _h(t,"core")}W.getCoreVersion=XI;async function Soe(t){return _h(t,"cli")}W.getCLIVersion=Soe;function xoe(t,e){switch(e){case"android":return t.android.platformDirAbs;case"ios":return t.ios.platformDirAbs;case"web":return t.web.platformDirAbs}return null}async function wh(t,e){let r=xoe(t,e);return r&&await(0,gi.pathExists)(r)?r:null}W.getProjectPlatformDirectory=wh;async function Foe(t,e){if(e){let r=e.toLowerCase().trim();return await Nv(r)?await wh(t,r)||(r==="web"&&(0,aa.fatal)(`Could not find the web platform directory.
175
175
  Make sure ${Se.default.strong(t.app.webDir)} exists.`),(0,aa.fatal)(`${Se.default.strong(r)} platform has not been added yet.
176
- See the docs for adding the ${Se.default.strong(r)} platform: ${Se.default.strong(`https://capacitorjs.com/docs/${r}#adding-the-${r}-platform`)}`)):(0,aa.fatal)(`Invalid platform: ${Se.default.input(r)}`),[r]}return t6(t)}W.selectPlatforms=Foe;async function jv(){return["web","android","ios"]}W.getKnownPlatforms=jv;async function Nv(t){return(await jv()).includes(t)}W.isValidPlatform=Nv;async function ZI(){return["electron"]}W.getKnownCommunityPlatforms=ZI;async function Ooe(t){return(await ZI()).includes(t)}W.isValidCommunityPlatform=Ooe;async function QI(){return["windows"]}W.getKnownEnterprisePlatforms=QI;async function Aoe(t){return(await QI()).includes(t)}W.isValidEnterprisePlatform=Aoe;async function koe(t,e,r){let{prompt:n}=await Promise.resolve().then(()=>kc.__importStar(lh()));if(!r)return(await n([{type:"select",name:"mode",message:e,choices:t.map(s=>({title:s,value:s}))}],{onCancel:()=>process.exit(1)})).mode.toLowerCase().trim();let i=r.toLowerCase().trim();if(!await Nv(i)){let o=await jv();(0,aa.fatal)(`Invalid platform: ${Se.default.input(i)}.
177
- Valid platforms include: ${o.join(", ")}`)}return i}W.promptForPlatform=koe;async function Toe(t,e){let{prompt:r}=await Promise.resolve().then(()=>kc.__importStar(lh())),n=t.filter(s=>s.id!==void 0);if(!e)return n.length===1?n[0]:(await r([{type:"select",name:"target",message:"Please choose a target device:",choices:n.map(a=>({title:`${e6(a)} (${a.id})`,value:a}))}],{onCancel:()=>process.exit(1)})).target;let i=e.trim(),o=t.find(s=>s.id===i);return o||(0,aa.fatal)(`Invalid target ID: ${Se.default.input(i)}.
178
- Valid targets are: ${t.map(s=>s.id).join(", ")}`),o}W.promptForPlatformTarget=Toe;function e6(t){var e,r,n;return`${(n=(r=(e=t.name)!==null&&e!==void 0?e:t.model)!==null&&r!==void 0?r:t.id)!==null&&n!==void 0?n:"?"}${t.virtual?` (${t.platform==="ios"?"simulator":"emulator"})`:""}`}W.getPlatformTargetName=e6;async function t6(t){let e=[];return await Eh(t,t.android.name)&&e.push(t.android.name),await Eh(t,t.ios.name)&&e.push(t.ios.name),e.push(t.web.name),e}W.getAddedPlatforms=t6;async function Poe(t,e){let r=await Promise.resolve().then(()=>kc.__importStar(Rv())),n=await XI(t),i=await Ch(t,e);(r.diff(n,i)==="minor"||r.diff(n,i)==="major")&&WI.logger.warn(`${Se.default.strong("@capacitor/core")}${Se.default.weak(`@${n}`)} version doesn't match ${Se.default.strong(`@capacitor/${e}`)}${Se.default.weak(`@${i}`)} version.
179
- Consider updating to a matching version, e.g. w/ ${Se.default.input(`npm install @capacitor/core@${i}`)}`)}W.checkPlatformVersions=Poe;function Roe(t,e){if(e[0]!=="@"){let n=(0,Ac.resolveNode)(t.app.rootDir,`@capacitor/${e}`,"package.json");if(n)return(0,yo.dirname)(n);let i=(0,Ac.resolveNode)(t.app.rootDir,`@capacitor-community/${e}`,"package.json");if(i)return(0,yo.dirname)(i);let o=(0,Ac.resolveNode)(t.app.rootDir,`@ionic-enterprise/capacitor-${e}`,"package.json");if(o)return(0,yo.dirname)(o)}let r=(0,Ac.resolveNode)(t.app.rootDir,e,"package.json");return r?(0,yo.dirname)(r):null}W.resolvePlatform=Roe;async function $oe(){try{let t=await(0,moe.runCommand)("java",["--version"]),r=RegExp(/([0-9]+)\.?([0-9]*)\.?([0-9]*)/).exec(t);if(r===null)return-1;let n=parseInt(r[1]),i=parseInt(r[2]);return typeof n=="number"&&n!=1?n:typeof i=="number"&&n==1&&i<9?i:-1}catch{return-1}}W.checkJDKMajorVersion=$oe;function Ioe(t){let e=t.replace(/([A-Z])/g,"$1").toLowerCase();return`app-${e?`${e}-`:""}debug.apk`}W.parseApkNameFromFlavor=Ioe});var n6=y(Sh=>{"use strict";Object.defineProperty(Sh,"__esModule",{value:!0});Sh.tryFn=void 0;var joe=async(t,...e)=>{try{return await t(...e)}catch{}return null};Sh.tryFn=joe});var i6=y(xh=>{"use strict";Object.defineProperty(xh,"__esModule",{value:!0});xh.formatJSObject=void 0;var Noe=(Cn(),ke(En)),Loe=Noe.__importDefault(require("util"));function Boe(t){try{t=JSON.parse(JSON.stringify(t))}catch(e){throw new Error(`Cannot parse object as JSON: ${e.stack?e.stack:e}`)}return Loe.default.inspect(t,{compact:!1,breakLength:1/0,depth:1/0,maxArrayLength:1/0,maxStringLength:1/0})}xh.formatJSObject=Boe});var o6=y(yi=>{"use strict";Object.defineProperty(yi,"__esModule",{value:!0});yi.lazy=yi.LazyPromise=yi.allSerial=void 0;function qoe(t){return t.reduce((e,r)=>e.then(n=>r().then(i=>n.concat(i))),Promise.resolve([]))}yi.allSerial=qoe;var Fh=class extends Promise{constructor(e){super(()=>{}),this._executor=e}then(e,r){return this._promise=this._promise||new Promise(this._executor),this._promise.then(e,r)}catch(e){return this._promise=this._promise||new Promise(this._executor),this._promise.catch(e)}};yi.LazyPromise=Fh;function Moe(t){return new Fh(async(e,r)=>{try{e(await t())}catch(n){r(n)}})}yi.lazy=Moe});var l6=y(nt=>{"use strict";Object.defineProperty(nt,"__esModule",{value:!0});nt.checkExternalConfig=nt.writeConfig=nt.loadConfig=nt.CONFIG_FILE_NAME_JSON=nt.CONFIG_FILE_NAME_JS=nt.CONFIG_FILE_NAME_TS=void 0;var Bv=(Cn(),ke(En)),Qt=Us(),Uoe=Bv.__importDefault(qA()),ie=require("path"),Di=Bv.__importDefault(Gs()),Voe=r6(),Oh=Gd(),u6=cc(),Lv=n6(),Hoe=i6(),s6=pl(),a6=fh(),ua=o6(),zoe=dh(),c6=(0,Uoe.default)("capacitor:config");nt.CONFIG_FILE_NAME_TS="capacitor.config.ts";nt.CONFIG_FILE_NAME_JS="capacitor.config.js";nt.CONFIG_FILE_NAME_JSON="capacitor.config.json";async function Goe(){var t,e,r,n;let i=process.cwd(),o=(0,ie.dirname)(__dirname),s=await Joe(i),a=await(async()=>{var d,p;if((0,s6.isNXMonorepo)(i)){let v=(0,s6.findNXMonorepoRoot)(i),g=await(0,Lv.tryFn)(Qt.readJSON,(0,ie.resolve)(v,"package.json")),w=(d=g?.devDependencies)!==null&&d!==void 0?d:{},x=(p=g?.dependencies)!==null&&p!==void 0?p:{};return{devDependencies:w,dependencies:x}}return{}})(),u=(t=s.extConfig.appId)!==null&&t!==void 0?t:"",c=(e=s.extConfig.appName)!==null&&e!==void 0?e:"",l=(r=s.extConfig.webDir)!==null&&r!==void 0?r:"www",f=await Xoe(o),h={android:await Zoe(i,s.extConfig,f),ios:await Qoe(i,s.extConfig),web:await ese(i,l),cli:f,app:{rootDir:i,appId:u,appName:c,webDir:l,webDirAbs:(0,ie.resolve)(i,l),package:(n=await(0,Lv.tryFn)(Qt.readJSON,(0,ie.resolve)(i,"package.json")))!==null&&n!==void 0?n:{name:c,version:"1.0.0",...a},...s}};return c6("config: %O",h),h}nt.loadConfig=Goe;async function Woe(t,e){switch((0,ie.extname)(e)){case".json":{await(0,Qt.writeJSON)(e,t,{spaces:2});break}case".ts":{await(0,Qt.writeFile)(e,sse(t));break}}}nt.writeConfig=Woe;async function Koe(t,e,r){var n;try{let i=(0,a6.resolveNode)(t,"typescript");i||(0,Oh.fatal)(`Could not find installation of TypeScript.
180
- To use ${Di.default.strong(e)} files, you must install TypeScript in your project, e.g. w/ ${Di.default.input("npm install -D typescript")}`);let o=require(i),s=(0,a6.requireTS)(o,r),a=s.default?await s.default:s;return{extConfigType:"ts",extConfigName:e,extConfigFilePath:r,extConfig:a}}catch(i){throw(0,Oh.isFatal)(i)||(0,Oh.fatal)(`Parsing ${Di.default.strong(e)} failed.
176
+ See the docs for adding the ${Se.default.strong(r)} platform: ${Se.default.strong(`https://capacitorjs.com/docs/${r}#adding-the-${r}-platform`)}`)):(0,aa.fatal)(`Invalid platform: ${Se.default.input(r)}`),[r]}return t6(t)}W.selectPlatforms=Foe;async function jv(){return["web","android","ios"]}W.getKnownPlatforms=jv;async function Nv(t){return(await jv()).includes(t)}W.isValidPlatform=Nv;async function ZI(){return["electron"]}W.getKnownCommunityPlatforms=ZI;async function Ooe(t){return(await ZI()).includes(t)}W.isValidCommunityPlatform=Ooe;async function QI(){return["windows"]}W.getKnownEnterprisePlatforms=QI;async function Aoe(t){return(await QI()).includes(t)}W.isValidEnterprisePlatform=Aoe;async function koe(t,e,r){let{prompt:n}=await Promise.resolve().then(()=>kc.__importStar(uh()));if(!r)return(await n([{type:"select",name:"mode",message:e,choices:t.map(s=>({title:s,value:s}))}],{onCancel:()=>process.exit(1)})).mode.toLowerCase().trim();let i=r.toLowerCase().trim();if(!await Nv(i)){let o=await jv();(0,aa.fatal)(`Invalid platform: ${Se.default.input(i)}.
177
+ Valid platforms include: ${o.join(", ")}`)}return i}W.promptForPlatform=koe;async function Toe(t,e){let{prompt:r}=await Promise.resolve().then(()=>kc.__importStar(uh())),n=t.filter(s=>s.id!==void 0);if(!e)return n.length===1?n[0]:(await r([{type:"select",name:"target",message:"Please choose a target device:",choices:n.map(a=>({title:`${e6(a)} (${a.id})`,value:a}))}],{onCancel:()=>process.exit(1)})).target;let i=e.trim(),o=t.find(s=>s.id===i);return o||(0,aa.fatal)(`Invalid target ID: ${Se.default.input(i)}.
178
+ Valid targets are: ${t.map(s=>s.id).join(", ")}`),o}W.promptForPlatformTarget=Toe;function e6(t){var e,r,n;return`${(n=(r=(e=t.name)!==null&&e!==void 0?e:t.model)!==null&&r!==void 0?r:t.id)!==null&&n!==void 0?n:"?"}${t.virtual?` (${t.platform==="ios"?"simulator":"emulator"})`:""}`}W.getPlatformTargetName=e6;async function t6(t){let e=[];return await wh(t,t.android.name)&&e.push(t.android.name),await wh(t,t.ios.name)&&e.push(t.ios.name),e.push(t.web.name),e}W.getAddedPlatforms=t6;async function Poe(t,e){let r=await Promise.resolve().then(()=>kc.__importStar(Rv())),n=await XI(t),i=await _h(t,e);(r.diff(n,i)==="minor"||r.diff(n,i)==="major")&&WI.logger.warn(`${Se.default.strong("@capacitor/core")}${Se.default.weak(`@${n}`)} version doesn't match ${Se.default.strong(`@capacitor/${e}`)}${Se.default.weak(`@${i}`)} version.
179
+ Consider updating to a matching version, e.g. w/ ${Se.default.input(`npm install @capacitor/core@${i}`)}`)}W.checkPlatformVersions=Poe;function Roe(t,e){if(e[0]!=="@"){let n=(0,Ac.resolveNode)(t.app.rootDir,`@capacitor/${e}`,"package.json");if(n)return(0,go.dirname)(n);let i=(0,Ac.resolveNode)(t.app.rootDir,`@capacitor-community/${e}`,"package.json");if(i)return(0,go.dirname)(i);let o=(0,Ac.resolveNode)(t.app.rootDir,`@ionic-enterprise/capacitor-${e}`,"package.json");if(o)return(0,go.dirname)(o)}let r=(0,Ac.resolveNode)(t.app.rootDir,e,"package.json");return r?(0,go.dirname)(r):null}W.resolvePlatform=Roe;async function $oe(){try{let t=await(0,moe.runCommand)("java",["--version"]),r=RegExp(/([0-9]+)\.?([0-9]*)\.?([0-9]*)/).exec(t);if(r===null)return-1;let n=parseInt(r[1]),i=parseInt(r[2]);return typeof n=="number"&&n!=1?n:typeof i=="number"&&n==1&&i<9?i:-1}catch{return-1}}W.checkJDKMajorVersion=$oe;function Ioe(t){let e=t.replace(/([A-Z])/g,"$1").toLowerCase();return`app-${e?`${e}-`:""}debug.apk`}W.parseApkNameFromFlavor=Ioe});var n6=y(Eh=>{"use strict";Object.defineProperty(Eh,"__esModule",{value:!0});Eh.tryFn=void 0;var joe=async(t,...e)=>{try{return await t(...e)}catch{}return null};Eh.tryFn=joe});var i6=y(Ch=>{"use strict";Object.defineProperty(Ch,"__esModule",{value:!0});Ch.formatJSObject=void 0;var Noe=(Cn(),ke(En)),Loe=Noe.__importDefault(require("util"));function Boe(t){try{t=JSON.parse(JSON.stringify(t))}catch(e){throw new Error(`Cannot parse object as JSON: ${e.stack?e.stack:e}`)}return Loe.default.inspect(t,{compact:!1,breakLength:1/0,depth:1/0,maxArrayLength:1/0,maxStringLength:1/0})}Ch.formatJSObject=Boe});var o6=y(yi=>{"use strict";Object.defineProperty(yi,"__esModule",{value:!0});yi.lazy=yi.LazyPromise=yi.allSerial=void 0;function qoe(t){return t.reduce((e,r)=>e.then(n=>r().then(i=>n.concat(i))),Promise.resolve([]))}yi.allSerial=qoe;var Sh=class extends Promise{constructor(e){super(()=>{}),this._executor=e}then(e,r){return this._promise=this._promise||new Promise(this._executor),this._promise.then(e,r)}catch(e){return this._promise=this._promise||new Promise(this._executor),this._promise.catch(e)}};yi.LazyPromise=Sh;function Moe(t){return new Sh(async(e,r)=>{try{e(await t())}catch(n){r(n)}})}yi.lazy=Moe});var l6=y(nt=>{"use strict";Object.defineProperty(nt,"__esModule",{value:!0});nt.checkExternalConfig=nt.writeConfig=nt.loadConfig=nt.CONFIG_FILE_NAME_JSON=nt.CONFIG_FILE_NAME_JS=nt.CONFIG_FILE_NAME_TS=void 0;var Bv=(Cn(),ke(En)),Qt=Us(),Uoe=Bv.__importDefault(qA()),ie=require("path"),Di=Bv.__importDefault(Gs()),Voe=r6(),xh=Hd(),u6=cc(),Lv=n6(),Hoe=i6(),s6=dl(),a6=ch(),ua=o6(),zoe=lh(),c6=(0,Uoe.default)("capacitor:config");nt.CONFIG_FILE_NAME_TS="capacitor.config.ts";nt.CONFIG_FILE_NAME_JS="capacitor.config.js";nt.CONFIG_FILE_NAME_JSON="capacitor.config.json";async function Goe(){var t,e,r,n;let i=process.cwd(),o=(0,ie.dirname)(__dirname),s=await Joe(i),a=await(async()=>{var d,p;if((0,s6.isNXMonorepo)(i)){let v=(0,s6.findNXMonorepoRoot)(i),g=await(0,Lv.tryFn)(Qt.readJSON,(0,ie.resolve)(v,"package.json")),w=(d=g?.devDependencies)!==null&&d!==void 0?d:{},x=(p=g?.dependencies)!==null&&p!==void 0?p:{};return{devDependencies:w,dependencies:x}}return{}})(),u=(t=s.extConfig.appId)!==null&&t!==void 0?t:"",c=(e=s.extConfig.appName)!==null&&e!==void 0?e:"",l=(r=s.extConfig.webDir)!==null&&r!==void 0?r:"www",f=await Xoe(o),h={android:await Zoe(i,s.extConfig,f),ios:await Qoe(i,s.extConfig),web:await ese(i,l),cli:f,app:{rootDir:i,appId:u,appName:c,webDir:l,webDirAbs:(0,ie.resolve)(i,l),package:(n=await(0,Lv.tryFn)(Qt.readJSON,(0,ie.resolve)(i,"package.json")))!==null&&n!==void 0?n:{name:c,version:"1.0.0",...a},...s}};return c6("config: %O",h),h}nt.loadConfig=Goe;async function Woe(t,e){switch((0,ie.extname)(e)){case".json":{await(0,Qt.writeJSON)(e,t,{spaces:2});break}case".ts":{await(0,Qt.writeFile)(e,sse(t));break}}}nt.writeConfig=Woe;async function Koe(t,e,r){var n;try{let i=(0,a6.resolveNode)(t,"typescript");i||(0,xh.fatal)(`Could not find installation of TypeScript.
180
+ To use ${Di.default.strong(e)} files, you must install TypeScript in your project, e.g. w/ ${Di.default.input("npm install -D typescript")}`);let o=require(i),s=(0,a6.requireTS)(o,r),a=s.default?await s.default:s;return{extConfigType:"ts",extConfigName:e,extConfigFilePath:r,extConfig:a}}catch(i){throw(0,xh.isFatal)(i)||(0,xh.fatal)(`Parsing ${Di.default.strong(e)} failed.
181
181
 
182
- ${(n=i.stack)!==null&&n!==void 0?n:i}`),i}}async function Yoe(t,e,r){var n;try{return{extConfigType:"js",extConfigName:e,extConfigFilePath:r,extConfig:await require(r)}}catch(i){(0,Oh.fatal)(`Parsing ${Di.default.strong(e)} failed.
182
+ ${(n=i.stack)!==null&&n!==void 0?n:i}`),i}}async function Yoe(t,e,r){var n;try{return{extConfigType:"js",extConfigName:e,extConfigFilePath:r,extConfig:await require(r)}}catch(i){(0,xh.fatal)(`Parsing ${Di.default.strong(e)} failed.
183
183
 
184
184
  ${(n=i.stack)!==null&&n!==void 0?n:i}`)}}async function Joe(t){var e;let r=(0,ie.resolve)(t,nt.CONFIG_FILE_NAME_TS);if(await(0,Qt.pathExists)(r))return Koe(t,nt.CONFIG_FILE_NAME_TS,r);let n=(0,ie.resolve)(t,nt.CONFIG_FILE_NAME_JS);if(await(0,Qt.pathExists)(n))return Yoe(t,nt.CONFIG_FILE_NAME_JS,n);let i=(0,ie.resolve)(t,nt.CONFIG_FILE_NAME_JSON);return{extConfigType:"json",extConfigName:nt.CONFIG_FILE_NAME_JSON,extConfigFilePath:i,extConfig:(e=await(0,Lv.tryFn)(Qt.readJSON,i))!==null&&e!==void 0?e:{}}}async function Xoe(t){let e="assets",r=(0,ie.join)(t,e),n="ios-pods-template.tar.gz",i="capacitor-cordova-ios-plugins.tar.gz",o="android-template.tar.gz",s="capacitor-cordova-android-plugins.tar.gz";return{rootDir:t,assetsDir:e,assetsDirAbs:r,assets:{ios:{platformTemplateArchive:n,platformTemplateArchiveAbs:(0,ie.resolve)(r,n),cordovaPluginsTemplateArchive:i,cordovaPluginsTemplateArchiveAbs:(0,ie.resolve)(r,i)},android:{platformTemplateArchive:o,platformTemplateArchiveAbs:(0,ie.resolve)(r,o),cordovaPluginsTemplateArchive:s,cordovaPluginsTemplateArchiveAbs:(0,ie.resolve)(r,s)}},package:await(0,Qt.readJSON)((0,ie.resolve)(t,"package.json")),os:tse(process.platform)}}async function Zoe(t,e,r){var n,i,o,s,a,u,c,l,f,h,d,p,v,g,w,x,D;let C="android",k=(i=(n=e.android)===null||n===void 0?void 0:n.path)!==null&&i!==void 0?i:"android",$=(0,ie.resolve)(t,k),F="app",L=`${F}/src`,S=`${L}/main`,I=`${S}/assets`,R=`${I}/public`,B=`${S}/res`,q=`${F}/build/outputs/apk/`,K=((o=e.android)===null||o===void 0?void 0:o.flavor)||"";!((s=e.android)===null||s===void 0)&&s.flavor&&(q=`${q}/${(a=e.android)===null||a===void 0?void 0:a.flavor}`);let M=(0,Voe.parseApkNameFromFlavor)(K),E=`${q}/debug`,b="capacitor-cordova-android-plugins",_=(0,ua.lazy)(()=>ise(r.os)),O={keystorePath:(c=(u=e.android)===null||u===void 0?void 0:u.buildOptions)===null||c===void 0?void 0:c.keystorePath,keystorePassword:(f=(l=e.android)===null||l===void 0?void 0:l.buildOptions)===null||f===void 0?void 0:f.keystorePassword,keystoreAlias:(d=(h=e.android)===null||h===void 0?void 0:h.buildOptions)===null||d===void 0?void 0:d.keystoreAlias,keystoreAliasPassword:(v=(p=e.android)===null||p===void 0?void 0:p.buildOptions)===null||v===void 0?void 0:v.keystoreAliasPassword,signingType:(w=(g=e.android)===null||g===void 0?void 0:g.buildOptions)===null||w===void 0?void 0:w.signingType,releaseType:(D=(x=e.android)===null||x===void 0?void 0:x.buildOptions)===null||D===void 0?void 0:D.releaseType};return{name:C,minVersion:"22",studioPath:_,platformDir:k,platformDirAbs:$,cordovaPluginsDir:b,cordovaPluginsDirAbs:(0,ie.resolve)($,b),appDir:F,appDirAbs:(0,ie.resolve)($,F),srcDir:L,srcDirAbs:(0,ie.resolve)($,L),srcMainDir:S,srcMainDirAbs:(0,ie.resolve)($,S),assetsDir:I,assetsDirAbs:(0,ie.resolve)($,I),webDir:R,webDirAbs:(0,ie.resolve)($,R),resDir:B,resDirAbs:(0,ie.resolve)($,B),apkName:M,buildOutputDir:E,buildOutputDirAbs:(0,ie.resolve)($,E),flavor:K,buildOptions:O}}async function Qoe(t,e){var r,n,i,o;let s="ios",a=(n=(r=e.ios)===null||r===void 0?void 0:r.path)!==null&&n!==void 0?n:"ios",u=(0,ie.resolve)(t,a),c=(o=(i=e.ios)===null||i===void 0?void 0:i.scheme)!==null&&o!==void 0?o:"App",l="App",f=(0,ie.resolve)(u,l),h=`${l}/App`,d=(0,ie.resolve)(u,h),p=`${l}/App.xcodeproj`,v=(0,ie.resolve)(u,p),g=(0,ua.lazy)(()=>rse(f)),w=(0,ua.lazy)(()=>ose(t,u,f)),x=(0,ua.lazy)(()=>nse(f,d,v)),D="capacitor-cordova-ios-plugins";return{name:s,minVersion:"13.0",platformDir:a,platformDirAbs:u,scheme:c,cordovaPluginsDir:D,cordovaPluginsDirAbs:(0,ie.resolve)(u,D),nativeProjectDir:l,nativeProjectDirAbs:f,nativeTargetDir:h,nativeTargetDirAbs:d,nativeXcodeProjDir:p,nativeXcodeProjDirAbs:v,nativeXcodeWorkspaceDir:(0,ua.lazy)(async()=>(0,ie.relative)(u,await g)),nativeXcodeWorkspaceDirAbs:g,webDir:(0,ua.lazy)(async()=>(0,ie.relative)(u,await x)),webDirAbs:x,podPath:w}}async function ese(t,e){let r=e,n=(0,ie.resolve)(t,r);return{name:"web",platformDir:r,platformDirAbs:n}}function tse(t){switch(t){case"darwin":return"mac";case"win32":return"windows";case"linux":return"linux"}return"unknown"}async function rse(t){return(0,ie.resolve)(t,"App.xcworkspace")}async function nse(t,e,r){let n=/path\s=\spublic[\s\S]+?sourceTree\s=\s([^;]+)/,i=(0,ie.resolve)(r,"project.pbxproj");try{let s=(await(0,Qt.readFile)(i,{encoding:"utf8"})).match(n);if(s&&s[1]==="SOURCE_ROOT")return u6.logger.warn(`Using the iOS project root for the ${Di.default.strong("public")} directory is deprecated.
185
- Please follow the Upgrade Guide to move ${Di.default.strong("public")} inside the iOS target directory: ${Di.default.strong("https://capacitorjs.com/docs/updating/3-0#move-public-into-the-ios-target-directory")}`),(0,ie.resolve)(t,"public")}catch{}return(0,ie.resolve)(e,"public")}async function ise(t){if(process.env.CAPACITOR_ANDROID_STUDIO_PATH)return process.env.CAPACITOR_ANDROID_STUDIO_PATH;switch(t){case"mac":return"/Applications/Android Studio.app";case"windows":{let{runCommand:e}=await Promise.resolve().then(()=>Bv.__importStar(dh())),r="C:\\Program Files\\Android\\Android Studio\\bin\\studio64.exe";try{if(!await(0,Qt.pathExists)(r)){let n=await e("REG",["QUERY","HKEY_LOCAL_MACHINE\\SOFTWARE\\Android Studio","/v","Path"]);n=n.replace(/(\r\n|\n|\r)/gm,"");let i=n.indexOf("REG_SZ");i>0&&(r=n.substring(i+6).trim()+"\\bin\\studio64.exe")}}catch(n){c6("Error checking registry for Android Studio path: %O",n);break}return r}case"linux":return"/usr/local/android-studio/bin/studio.sh"}return""}async function ose(t,e,r){if(process.env.CAPACITOR_COCOAPODS_PATH)return process.env.CAPACITOR_COCOAPODS_PATH;let n="";if(await(0,Qt.pathExists)((0,ie.resolve)(t,"Gemfile"))?n=(0,ie.resolve)(t,"Gemfile"):await(0,Qt.pathExists)((0,ie.resolve)(e,"Gemfile"))?n=(0,ie.resolve)(e,"Gemfile"):await(0,Qt.pathExists)((0,ie.resolve)(r,"Gemfile"))&&(n=(0,ie.resolve)(r,"Gemfile")),!(n!=""))try{let o=await(0,zoe.getCommandOutput)("git",["rev-parse","--show-toplevel"],{cwd:t});o!=null&&(n=(0,ie.resolve)(o,"Gemfile"))}catch{}try{let o=(await(0,Qt.readFile)(n)).toString();return o&&new RegExp(/gem\s+['"]cocoapods/).test(o)?"bundle exec pod":"pod"}catch{return"pod"}}function sse(t){return`import type { CapacitorConfig } from '@capacitor/cli';
185
+ Please follow the Upgrade Guide to move ${Di.default.strong("public")} inside the iOS target directory: ${Di.default.strong("https://capacitorjs.com/docs/updating/3-0#move-public-into-the-ios-target-directory")}`),(0,ie.resolve)(t,"public")}catch{}return(0,ie.resolve)(e,"public")}async function ise(t){if(process.env.CAPACITOR_ANDROID_STUDIO_PATH)return process.env.CAPACITOR_ANDROID_STUDIO_PATH;switch(t){case"mac":return"/Applications/Android Studio.app";case"windows":{let{runCommand:e}=await Promise.resolve().then(()=>Bv.__importStar(lh())),r="C:\\Program Files\\Android\\Android Studio\\bin\\studio64.exe";try{if(!await(0,Qt.pathExists)(r)){let n=await e("REG",["QUERY","HKEY_LOCAL_MACHINE\\SOFTWARE\\Android Studio","/v","Path"]);n=n.replace(/(\r\n|\n|\r)/gm,"");let i=n.indexOf("REG_SZ");i>0&&(r=n.substring(i+6).trim()+"\\bin\\studio64.exe")}}catch(n){c6("Error checking registry for Android Studio path: %O",n);break}return r}case"linux":return"/usr/local/android-studio/bin/studio.sh"}return""}async function ose(t,e,r){if(process.env.CAPACITOR_COCOAPODS_PATH)return process.env.CAPACITOR_COCOAPODS_PATH;let n="";if(await(0,Qt.pathExists)((0,ie.resolve)(t,"Gemfile"))?n=(0,ie.resolve)(t,"Gemfile"):await(0,Qt.pathExists)((0,ie.resolve)(e,"Gemfile"))?n=(0,ie.resolve)(e,"Gemfile"):await(0,Qt.pathExists)((0,ie.resolve)(r,"Gemfile"))&&(n=(0,ie.resolve)(r,"Gemfile")),!(n!=""))try{let o=await(0,zoe.getCommandOutput)("git",["rev-parse","--show-toplevel"],{cwd:t});o!=null&&(n=(0,ie.resolve)(o,"Gemfile"))}catch{}try{let o=(await(0,Qt.readFile)(n)).toString();return o&&new RegExp(/gem\s+['"]cocoapods/).test(o)?"bundle exec pod":"pod"}catch{return"pod"}}function sse(t){return`import type { CapacitorConfig } from '@capacitor/cli';
186
186
 
187
187
  const config: CapacitorConfig = ${(0,Hoe.formatJSObject)(t)};
188
188
 
189
189
  export default config;
190
- `}function ase(t){if(typeof t.extConfig.bundledWebRuntime<"u"){let e="Can be safely deleted.";t.extConfig.bundledWebRuntime===!0&&(e="Please, use a bundler to bundle Capacitor and its plugins."),u6.logger.warn(`The ${Di.default.strong("bundledWebRuntime")} configuration option has been deprecated. ${e}`)}}nt.checkExternalConfig=ase});function use(){try{return Mv.default.statSync("/.dockerenv"),!0}catch{return!1}}function cse(){try{return Mv.default.readFileSync("/proc/self/cgroup","utf8").includes("docker")}catch{return!1}}function Uv(){return qv===void 0&&(qv=use()||cse()),qv}var Mv,qv,d6=ut(()=>{Mv=ce(require("node:fs"),1)});function ca(){return Vv===void 0&&(Vv=lse()||Uv()),Vv}var h6,Vv,lse,Hv=ut(()=>{h6=ce(require("node:fs"),1);d6();lse=()=>{try{return h6.default.statSync("/run/.containerenv"),!0}catch{return!1}}});var zv,m6,g6,p6,Pc,y6=ut(()=>{zv=ce(require("node:process"),1),m6=ce(require("node:os"),1),g6=ce(require("node:fs"),1);Hv();p6=()=>{if(zv.default.platform!=="linux")return!1;if(m6.default.release().toLowerCase().includes("microsoft"))return!ca();try{return g6.default.readFileSync("/proc/version","utf8").toLowerCase().includes("microsoft")?!ca():!1}catch{return!1}},Pc=zv.default.env.__IS_WSL_TEST__?p6:p6()});function Do(t,e,r){let n=i=>Object.defineProperty(t,e,{value:i,enumerable:!0,writable:!0});return Object.defineProperty(t,e,{configurable:!0,enumerable:!0,get(){let i=r();return n(i),i},set(i){n(i)}}),t}var D6=ut(()=>{});async function Gv(){if(b6.default.platform!=="darwin")throw new Error("macOS only");let{stdout:t}=await fse("defaults",["read","com.apple.LaunchServices/com.apple.launchservices.secure","LSHandlers"]);return/LSHandlerRoleAll = "(?!-)(?<id>[^"]+?)";\s+?LSHandlerURLScheme = (?:http|https);/.exec(t)?.groups.id??"com.apple.Safari"}var v6,b6,w6,fse,_6=ut(()=>{v6=require("node:util"),b6=ce(require("node:process"),1),w6=require("node:child_process"),fse=(0,v6.promisify)(w6.execFile)});async function S6(t,{humanReadableOutput:e=!0}={}){if(E6.default.platform!=="darwin")throw new Error("macOS only");let r=e?[]:["-ss"],{stdout:n}=await dse("osascript",["-e",t,r]);return n.trim()}var E6,C6,Wv,dse,x6=ut(()=>{E6=ce(require("node:process"),1),C6=require("node:util"),Wv=require("node:child_process"),dse=(0,C6.promisify)(Wv.execFile)});async function Kv(t){return S6(`tell application "Finder" to set app_path to application file id "${t}" as string
191
- tell application "System Events" to get value of property list item "CFBundleName" of property list file (app_path & ":Contents:Info.plist")`)}var F6=ut(()=>{x6()});async function Yv(t=hse){let{stdout:e}=await t("reg",["QUERY"," HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\http\\UserChoice","/v","ProgId"]),r=/ProgId\s*REG_SZ\s*(?<id>\S+)/.exec(e);if(!r)throw new Ah(`Cannot find Windows browser in stdout: ${JSON.stringify(e)}`);let{id:n}=r.groups,i=pse[n];if(!i)throw new Ah(`Unknown browser ID: ${n}`);return i}var O6,A6,hse,pse,Ah,k6=ut(()=>{O6=require("node:util"),A6=require("node:child_process"),hse=(0,O6.promisify)(A6.execFile),pse={AppXq0fevzme2pys62n3e0fbqa7peapykr8v:{name:"Edge",id:"com.microsoft.edge.old"},MSEdgeDHTML:{name:"Edge",id:"com.microsoft.edge"},MSEdgeHTM:{name:"Edge",id:"com.microsoft.edge"},"IE.HTTP":{name:"Internet Explorer",id:"com.microsoft.ie"},FirefoxURL:{name:"Firefox",id:"org.mozilla.firefox"},ChromeHTML:{name:"Chrome",id:"com.google.chrome"},BraveHTML:{name:"Brave",id:"com.brave.Browser"},BraveBHTML:{name:"Brave Beta",id:"com.brave.Browser.beta"},BraveSSHTM:{name:"Brave Nightly",id:"com.brave.Browser.nightly"}},Ah=class extends Error{}});async function Jv(){if(kh.default.platform==="darwin"){let t=await Gv();return{name:await Kv(t),id:t}}if(kh.default.platform==="linux"){let{stdout:t}=await mse("xdg-mime",["query","default","x-scheme-handler/http"]),e=t.trim();return{name:gse(e.replace(/.desktop$/,"").replace("-"," ")),id:e}}if(kh.default.platform==="win32")return Yv();throw new Error("Only macOS, Linux, and Windows are supported")}var T6,kh,P6,mse,gse,R6=ut(()=>{T6=require("node:util"),kh=ce(require("node:process"),1),P6=require("node:child_process");_6();F6();k6();mse=(0,T6.promisify)(P6.execFile),gse=t=>t.toLowerCase().replaceAll(/(?:^|\s|-)\S/g,e=>e.toUpperCase())});var M6={};mn(M6,{apps:()=>bo,default:()=>bse,openApp:()=>vse});function N6(t){if(typeof t=="string"||Array.isArray(t))return t;let{[I6]:e}=t;if(!e)throw new Error(`${I6} is not supported`);return e}function Qv({[la]:t},{wsl:e}){if(e&&Pc)return N6(e);if(!t)throw new Error(`${la} is not supported`);return N6(t)}var Rc,L6,Zv,B6,q6,vo,wse,Xv,$6,la,I6,yse,j6,$c,Dse,vse,bo,bse,U6=ut(()=>{Rc=ce(require("node:process"),1),L6=require("node:buffer"),Zv=ce(require("node:path"),1),B6=require("node:url"),q6=ce(require("node:child_process"),1),vo=ce(require("node:fs/promises"),1);y6();D6();R6();Hv();wse={},Xv=Zv.default.dirname((0,B6.fileURLToPath)(wse.url)),$6=Zv.default.join(Xv,"xdg-open"),{platform:la,arch:I6}=Rc.default,yse=(()=>{let t="/mnt/",e;return async function(){if(e)return e;let r="/etc/wsl.conf",n=!1;try{await vo.default.access(r,vo.constants.F_OK),n=!0}catch{}if(!n)return t;let i=await vo.default.readFile(r,{encoding:"utf8"}),o=/(?<!#.*)root\s*=\s*(?<mountPoint>.*)/g.exec(i);return o?(e=o.groups.mountPoint.trim(),e=e.endsWith("/")?e:`${e}/`,e):t}})(),j6=async(t,e)=>{let r;for(let n of t)try{return await e(n)}catch(i){r=i}throw r},$c=async t=>{if(t={wait:!1,background:!1,newInstance:!1,allowNonzeroExitCode:!1,...t},Array.isArray(t.app))return j6(t.app,a=>$c({...t,app:a}));let{name:e,arguments:r=[]}=t.app??{};if(r=[...r],Array.isArray(e))return j6(e,a=>$c({...t,app:{name:a,arguments:r}}));if(e==="browser"||e==="browserPrivate"){let a={"com.google.chrome":"chrome","google-chrome.desktop":"chrome","org.mozilla.firefox":"firefox","firefox.desktop":"firefox","com.microsoft.msedge":"edge","com.microsoft.edge":"edge","microsoft-edge.desktop":"edge"},u={chrome:"--incognito",firefox:"--private-window",edge:"--inPrivate"},c=await Jv();if(c.id in a){let l=a[c.id];return e==="browserPrivate"&&r.push(u[l]),$c({...t,app:{name:bo[l],arguments:r}})}throw new Error(`${c.name} is not supported as a default browser`)}let n,i=[],o={};if(la==="darwin")n="open",t.wait&&i.push("--wait-apps"),t.background&&i.push("--background"),t.newInstance&&i.push("--new"),e&&i.push("-a",e);else if(la==="win32"||Pc&&!ca()&&!e){let a=await yse();n=Pc?`${a}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe`:`${Rc.default.env.SYSTEMROOT||Rc.default.env.windir||"C:\\Windows"}\\System32\\WindowsPowerShell\\v1.0\\powershell`,i.push("-NoProfile","-NonInteractive","-ExecutionPolicy","Bypass","-EncodedCommand"),Pc||(o.windowsVerbatimArguments=!0);let u=["Start"];t.wait&&u.push("-Wait"),e?(u.push(`"\`"${e}\`""`),t.target&&r.push(t.target)):t.target&&u.push(`"${t.target}"`),r.length>0&&(r=r.map(c=>`"\`"${c}\`""`),u.push("-ArgumentList",r.join(","))),t.target=L6.Buffer.from(u.join(" "),"utf16le").toString("base64")}else{if(e)n=e;else{let a=!Xv||Xv==="/",u=!1;try{await vo.default.access($6,vo.constants.X_OK),u=!0}catch{}n=Rc.default.versions.electron??(la==="android"||a||!u)?"xdg-open":$6}r.length>0&&i.push(...r),t.wait||(o.stdio="ignore",o.detached=!0)}la==="darwin"&&r.length>0&&i.push("--args",...r),t.target&&i.push(t.target);let s=q6.default.spawn(n,i,o);return t.wait?new Promise((a,u)=>{s.once("error",u),s.once("close",c=>{if(!t.allowNonzeroExitCode&&c>0){u(new Error(`Exited with code ${c}`));return}a(s)})}):(s.unref(),s)},Dse=(t,e)=>{if(typeof t!="string")throw new TypeError("Expected a `target`");return $c({...e,target:t})},vse=(t,e)=>{if(typeof t!="string"&&!Array.isArray(t))throw new TypeError("Expected a valid `name`");let{arguments:r=[]}=e??{};if(r!=null&&!Array.isArray(r))throw new TypeError("Expected `appArguments` as Array type");return $c({...e,app:{name:t,arguments:r}})};bo={};Do(bo,"chrome",()=>Qv({darwin:"google chrome",win32:"chrome",linux:["google-chrome","google-chrome-stable","chromium"]},{wsl:{ia32:"/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe",x64:["/mnt/c/Program Files/Google/Chrome/Application/chrome.exe","/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe"]}}));Do(bo,"firefox",()=>Qv({darwin:"firefox",win32:"C:\\Program Files\\Mozilla Firefox\\firefox.exe",linux:"firefox"},{wsl:"/mnt/c/Program Files/Mozilla Firefox/firefox.exe"}));Do(bo,"edge",()=>Qv({darwin:"microsoft edge",win32:"msedge",linux:["microsoft-edge","microsoft-edge-dev"]},{wsl:"/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe"}));Do(bo,"browser",()=>"browser");Do(bo,"browserPrivate",()=>"browserPrivate");bse=Dse});var gj=y(Eo=>{Eo.parse=Eo.decode=Rse;Eo.stringify=Eo.encode=hj;Eo.safe=Da;Eo.unsafe=jh;var ub=typeof process<"u"&&process.platform==="win32"?`\r
190
+ `}function ase(t){if(typeof t.extConfig.bundledWebRuntime<"u"){let e="Can be safely deleted.";t.extConfig.bundledWebRuntime===!0&&(e="Please, use a bundler to bundle Capacitor and its plugins."),u6.logger.warn(`The ${Di.default.strong("bundledWebRuntime")} configuration option has been deprecated. ${e}`)}}nt.checkExternalConfig=ase});function use(){try{return Mv.default.statSync("/.dockerenv"),!0}catch{return!1}}function cse(){try{return Mv.default.readFileSync("/proc/self/cgroup","utf8").includes("docker")}catch{return!1}}function Uv(){return qv===void 0&&(qv=use()||cse()),qv}var Mv,qv,d6=ut(()=>{Mv=ce(require("node:fs"),1)});function ca(){return Vv===void 0&&(Vv=lse()||Uv()),Vv}var h6,Vv,lse,Hv=ut(()=>{h6=ce(require("node:fs"),1);d6();lse=()=>{try{return h6.default.statSync("/run/.containerenv"),!0}catch{return!1}}});var zv,m6,g6,p6,Pc,y6=ut(()=>{zv=ce(require("node:process"),1),m6=ce(require("node:os"),1),g6=ce(require("node:fs"),1);Hv();p6=()=>{if(zv.default.platform!=="linux")return!1;if(m6.default.release().toLowerCase().includes("microsoft"))return!ca();try{return g6.default.readFileSync("/proc/version","utf8").toLowerCase().includes("microsoft")?!ca():!1}catch{return!1}},Pc=zv.default.env.__IS_WSL_TEST__?p6:p6()});function yo(t,e,r){let n=i=>Object.defineProperty(t,e,{value:i,enumerable:!0,writable:!0});return Object.defineProperty(t,e,{configurable:!0,enumerable:!0,get(){let i=r();return n(i),i},set(i){n(i)}}),t}var D6=ut(()=>{});async function Gv(){if(b6.default.platform!=="darwin")throw new Error("macOS only");let{stdout:t}=await fse("defaults",["read","com.apple.LaunchServices/com.apple.launchservices.secure","LSHandlers"]);return/LSHandlerRoleAll = "(?!-)(?<id>[^"]+?)";\s+?LSHandlerURLScheme = (?:http|https);/.exec(t)?.groups.id??"com.apple.Safari"}var v6,b6,w6,fse,_6=ut(()=>{v6=require("node:util"),b6=ce(require("node:process"),1),w6=require("node:child_process"),fse=(0,v6.promisify)(w6.execFile)});async function S6(t,{humanReadableOutput:e=!0}={}){if(E6.default.platform!=="darwin")throw new Error("macOS only");let r=e?[]:["-ss"],{stdout:n}=await dse("osascript",["-e",t,r]);return n.trim()}var E6,C6,Wv,dse,x6=ut(()=>{E6=ce(require("node:process"),1),C6=require("node:util"),Wv=require("node:child_process"),dse=(0,C6.promisify)(Wv.execFile)});async function Kv(t){return S6(`tell application "Finder" to set app_path to application file id "${t}" as string
191
+ tell application "System Events" to get value of property list item "CFBundleName" of property list file (app_path & ":Contents:Info.plist")`)}var F6=ut(()=>{x6()});async function Yv(t=hse){let{stdout:e}=await t("reg",["QUERY"," HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\http\\UserChoice","/v","ProgId"]),r=/ProgId\s*REG_SZ\s*(?<id>\S+)/.exec(e);if(!r)throw new Fh(`Cannot find Windows browser in stdout: ${JSON.stringify(e)}`);let{id:n}=r.groups,i=pse[n];if(!i)throw new Fh(`Unknown browser ID: ${n}`);return i}var O6,A6,hse,pse,Fh,k6=ut(()=>{O6=require("node:util"),A6=require("node:child_process"),hse=(0,O6.promisify)(A6.execFile),pse={AppXq0fevzme2pys62n3e0fbqa7peapykr8v:{name:"Edge",id:"com.microsoft.edge.old"},MSEdgeDHTML:{name:"Edge",id:"com.microsoft.edge"},MSEdgeHTM:{name:"Edge",id:"com.microsoft.edge"},"IE.HTTP":{name:"Internet Explorer",id:"com.microsoft.ie"},FirefoxURL:{name:"Firefox",id:"org.mozilla.firefox"},ChromeHTML:{name:"Chrome",id:"com.google.chrome"},BraveHTML:{name:"Brave",id:"com.brave.Browser"},BraveBHTML:{name:"Brave Beta",id:"com.brave.Browser.beta"},BraveSSHTM:{name:"Brave Nightly",id:"com.brave.Browser.nightly"}},Fh=class extends Error{}});async function Jv(){if(Oh.default.platform==="darwin"){let t=await Gv();return{name:await Kv(t),id:t}}if(Oh.default.platform==="linux"){let{stdout:t}=await mse("xdg-mime",["query","default","x-scheme-handler/http"]),e=t.trim();return{name:gse(e.replace(/.desktop$/,"").replace("-"," ")),id:e}}if(Oh.default.platform==="win32")return Yv();throw new Error("Only macOS, Linux, and Windows are supported")}var T6,Oh,P6,mse,gse,R6=ut(()=>{T6=require("node:util"),Oh=ce(require("node:process"),1),P6=require("node:child_process");_6();F6();k6();mse=(0,T6.promisify)(P6.execFile),gse=t=>t.toLowerCase().replaceAll(/(?:^|\s|-)\S/g,e=>e.toUpperCase())});var M6={};mn(M6,{apps:()=>vo,default:()=>bse,openApp:()=>vse});function N6(t){if(typeof t=="string"||Array.isArray(t))return t;let{[I6]:e}=t;if(!e)throw new Error(`${I6} is not supported`);return e}function Qv({[la]:t},{wsl:e}){if(e&&Pc)return N6(e);if(!t)throw new Error(`${la} is not supported`);return N6(t)}var Rc,L6,Zv,B6,q6,Do,wse,Xv,$6,la,I6,yse,j6,$c,Dse,vse,vo,bse,U6=ut(()=>{Rc=ce(require("node:process"),1),L6=require("node:buffer"),Zv=ce(require("node:path"),1),B6=require("node:url"),q6=ce(require("node:child_process"),1),Do=ce(require("node:fs/promises"),1);y6();D6();R6();Hv();wse={},Xv=Zv.default.dirname((0,B6.fileURLToPath)(wse.url)),$6=Zv.default.join(Xv,"xdg-open"),{platform:la,arch:I6}=Rc.default,yse=(()=>{let t="/mnt/",e;return async function(){if(e)return e;let r="/etc/wsl.conf",n=!1;try{await Do.default.access(r,Do.constants.F_OK),n=!0}catch{}if(!n)return t;let i=await Do.default.readFile(r,{encoding:"utf8"}),o=/(?<!#.*)root\s*=\s*(?<mountPoint>.*)/g.exec(i);return o?(e=o.groups.mountPoint.trim(),e=e.endsWith("/")?e:`${e}/`,e):t}})(),j6=async(t,e)=>{let r;for(let n of t)try{return await e(n)}catch(i){r=i}throw r},$c=async t=>{if(t={wait:!1,background:!1,newInstance:!1,allowNonzeroExitCode:!1,...t},Array.isArray(t.app))return j6(t.app,a=>$c({...t,app:a}));let{name:e,arguments:r=[]}=t.app??{};if(r=[...r],Array.isArray(e))return j6(e,a=>$c({...t,app:{name:a,arguments:r}}));if(e==="browser"||e==="browserPrivate"){let a={"com.google.chrome":"chrome","google-chrome.desktop":"chrome","org.mozilla.firefox":"firefox","firefox.desktop":"firefox","com.microsoft.msedge":"edge","com.microsoft.edge":"edge","microsoft-edge.desktop":"edge"},u={chrome:"--incognito",firefox:"--private-window",edge:"--inPrivate"},c=await Jv();if(c.id in a){let l=a[c.id];return e==="browserPrivate"&&r.push(u[l]),$c({...t,app:{name:vo[l],arguments:r}})}throw new Error(`${c.name} is not supported as a default browser`)}let n,i=[],o={};if(la==="darwin")n="open",t.wait&&i.push("--wait-apps"),t.background&&i.push("--background"),t.newInstance&&i.push("--new"),e&&i.push("-a",e);else if(la==="win32"||Pc&&!ca()&&!e){let a=await yse();n=Pc?`${a}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe`:`${Rc.default.env.SYSTEMROOT||Rc.default.env.windir||"C:\\Windows"}\\System32\\WindowsPowerShell\\v1.0\\powershell`,i.push("-NoProfile","-NonInteractive","-ExecutionPolicy","Bypass","-EncodedCommand"),Pc||(o.windowsVerbatimArguments=!0);let u=["Start"];t.wait&&u.push("-Wait"),e?(u.push(`"\`"${e}\`""`),t.target&&r.push(t.target)):t.target&&u.push(`"${t.target}"`),r.length>0&&(r=r.map(c=>`"\`"${c}\`""`),u.push("-ArgumentList",r.join(","))),t.target=L6.Buffer.from(u.join(" "),"utf16le").toString("base64")}else{if(e)n=e;else{let a=!Xv||Xv==="/",u=!1;try{await Do.default.access($6,Do.constants.X_OK),u=!0}catch{}n=Rc.default.versions.electron??(la==="android"||a||!u)?"xdg-open":$6}r.length>0&&i.push(...r),t.wait||(o.stdio="ignore",o.detached=!0)}la==="darwin"&&r.length>0&&i.push("--args",...r),t.target&&i.push(t.target);let s=q6.default.spawn(n,i,o);return t.wait?new Promise((a,u)=>{s.once("error",u),s.once("close",c=>{if(!t.allowNonzeroExitCode&&c>0){u(new Error(`Exited with code ${c}`));return}a(s)})}):(s.unref(),s)},Dse=(t,e)=>{if(typeof t!="string")throw new TypeError("Expected a `target`");return $c({...e,target:t})},vse=(t,e)=>{if(typeof t!="string"&&!Array.isArray(t))throw new TypeError("Expected a valid `name`");let{arguments:r=[]}=e??{};if(r!=null&&!Array.isArray(r))throw new TypeError("Expected `appArguments` as Array type");return $c({...e,app:{name:t,arguments:r}})};vo={};yo(vo,"chrome",()=>Qv({darwin:"google chrome",win32:"chrome",linux:["google-chrome","google-chrome-stable","chromium"]},{wsl:{ia32:"/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe",x64:["/mnt/c/Program Files/Google/Chrome/Application/chrome.exe","/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe"]}}));yo(vo,"firefox",()=>Qv({darwin:"firefox",win32:"C:\\Program Files\\Mozilla Firefox\\firefox.exe",linux:"firefox"},{wsl:"/mnt/c/Program Files/Mozilla Firefox/firefox.exe"}));yo(vo,"edge",()=>Qv({darwin:"microsoft edge",win32:"msedge",linux:["microsoft-edge","microsoft-edge-dev"]},{wsl:"/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe"}));yo(vo,"browser",()=>"browser");yo(vo,"browserPrivate",()=>"browserPrivate");bse=Dse});var gj=y(_o=>{_o.parse=_o.decode=Rse;_o.stringify=_o.encode=hj;_o.safe=Da;_o.unsafe=$h;var ub=typeof process<"u"&&process.platform==="win32"?`\r
192
192
  `:`
193
193
  `;function hj(t,e){var r=[],n="";typeof e=="string"?e={section:e,whitespace:!1}:(e=e||{},e.whitespace=e.whitespace===!0);var i=e.whitespace?" = ":"=";return Object.keys(t).forEach(function(o,s,a){var u=t[o];u&&Array.isArray(u)?u.forEach(function(c){n+=Da(o+"[]")+i+Da(c)+`
194
- `}):u&&typeof u=="object"?r.push(o):n+=Da(o)+i+Da(u)+ub}),e.section&&n.length&&(n="["+Da(e.section)+"]"+ub+n),r.forEach(function(o,s,a){var u=pj(o).join("\\."),c=(e.section?e.section+".":"")+u,l=hj(t[o],{section:c,whitespace:e.whitespace});n.length&&l.length&&(n+=ub),n+=l}),n}function pj(t){return t.replace(/\1/g,"LITERAL\\1LITERAL").replace(/\\\./g,"").split(/\./).map(function(e){return e.replace(/\1/g,"\\.").replace(/\2LITERAL\\1LITERAL\2/g,"")})}function Rse(t){var e={},r=e,n=null,i=/^\[([^\]]*)\]$|^([^=]+)(=(.*))?$/i,o=t.split(/[\r\n]+/g);return o.forEach(function(s,a,u){if(!(!s||s.match(/^\s*[;#]/))){var c=s.match(i);if(c){if(c[1]!==void 0){if(n=jh(c[1]),n==="__proto__"){r={};return}r=e[n]=e[n]||{};return}var l=jh(c[2]);if(l!=="__proto__"){var f=c[3]?jh(c[4]):!0;switch(f){case"true":case"false":case"null":f=JSON.parse(f)}if(l.length>2&&l.slice(-2)==="[]"){if(l=l.substring(0,l.length-2),l==="__proto__")return;r[l]?Array.isArray(r[l])||(r[l]=[r[l]]):r[l]=[]}Array.isArray(r[l])?r[l].push(f):r[l]=f}}}}),Object.keys(e).filter(function(s,a,u){if(!e[s]||typeof e[s]!="object"||Array.isArray(e[s]))return!1;var c=pj(s),l=e,f=c.pop(),h=f.replace(/\\\./g,".");return c.forEach(function(d,p,v){d!=="__proto__"&&((!l[d]||typeof l[d]!="object")&&(l[d]={}),l=l[d])}),l===e&&h===f?!1:(l[h]=e[s],!0)}).forEach(function(s,a,u){delete e[s]}),e}function mj(t){return t.charAt(0)==='"'&&t.slice(-1)==='"'||t.charAt(0)==="'"&&t.slice(-1)==="'"}function Da(t){return typeof t!="string"||t.match(/[=\r\n]/)||t.match(/^\[/)||t.length>1&&mj(t)||t!==t.trim()?JSON.stringify(t):t.replace(/;/g,"\\;").replace(/#/g,"\\#")}function jh(t,e){if(t=(t||"").trim(),mj(t)){t.charAt(0)==="'"&&(t=t.substr(1,t.length-2));try{t=JSON.parse(t)}catch{}}else{for(var r=!1,n="",i=0,o=t.length;i<o;i++){var s=t.charAt(i);if(r)"\\;#".indexOf(s)!==-1?n+=s:n+="\\"+s,r=!1;else{if(";#".indexOf(s)!==-1)break;s==="\\"?r=!0:n+=s}}return r&&(n+="\\"),n.trim()}return t}});var vj=y((oye,Dj)=>{"use strict";var cb=1,yj=2;function $se(){return""}function Ise(t,e,r){return t.slice(e,r).replace(/\S/g," ")}Dj.exports=function(t,e){e=e||{};for(var r,n,i=!1,o=!1,s=0,a="",u=e.whitespace===!1?$se:Ise,c=0;c<t.length;c++){if(r=t[c],n=t[c+1],!o&&r==='"'){var l=t[c-1]==="\\"&&t[c-2]!=="\\";l||(i=!i)}if(!i){if(!o&&r+n==="//")a+=t.slice(s,c),s=c,o=cb,c++;else if(o===cb&&r+n===`\r
194
+ `}):u&&typeof u=="object"?r.push(o):n+=Da(o)+i+Da(u)+ub}),e.section&&n.length&&(n="["+Da(e.section)+"]"+ub+n),r.forEach(function(o,s,a){var u=pj(o).join("\\."),c=(e.section?e.section+".":"")+u,l=hj(t[o],{section:c,whitespace:e.whitespace});n.length&&l.length&&(n+=ub),n+=l}),n}function pj(t){return t.replace(/\1/g,"LITERAL\\1LITERAL").replace(/\\\./g,"").split(/\./).map(function(e){return e.replace(/\1/g,"\\.").replace(/\2LITERAL\\1LITERAL\2/g,"")})}function Rse(t){var e={},r=e,n=null,i=/^\[([^\]]*)\]$|^([^=]+)(=(.*))?$/i,o=t.split(/[\r\n]+/g);return o.forEach(function(s,a,u){if(!(!s||s.match(/^\s*[;#]/))){var c=s.match(i);if(c){if(c[1]!==void 0){if(n=$h(c[1]),n==="__proto__"){r={};return}r=e[n]=e[n]||{};return}var l=$h(c[2]);if(l!=="__proto__"){var f=c[3]?$h(c[4]):!0;switch(f){case"true":case"false":case"null":f=JSON.parse(f)}if(l.length>2&&l.slice(-2)==="[]"){if(l=l.substring(0,l.length-2),l==="__proto__")return;r[l]?Array.isArray(r[l])||(r[l]=[r[l]]):r[l]=[]}Array.isArray(r[l])?r[l].push(f):r[l]=f}}}}),Object.keys(e).filter(function(s,a,u){if(!e[s]||typeof e[s]!="object"||Array.isArray(e[s]))return!1;var c=pj(s),l=e,f=c.pop(),h=f.replace(/\\\./g,".");return c.forEach(function(d,p,v){d!=="__proto__"&&((!l[d]||typeof l[d]!="object")&&(l[d]={}),l=l[d])}),l===e&&h===f?!1:(l[h]=e[s],!0)}).forEach(function(s,a,u){delete e[s]}),e}function mj(t){return t.charAt(0)==='"'&&t.slice(-1)==='"'||t.charAt(0)==="'"&&t.slice(-1)==="'"}function Da(t){return typeof t!="string"||t.match(/[=\r\n]/)||t.match(/^\[/)||t.length>1&&mj(t)||t!==t.trim()?JSON.stringify(t):t.replace(/;/g,"\\;").replace(/#/g,"\\#")}function $h(t,e){if(t=(t||"").trim(),mj(t)){t.charAt(0)==="'"&&(t=t.substr(1,t.length-2));try{t=JSON.parse(t)}catch{}}else{for(var r=!1,n="",i=0,o=t.length;i<o;i++){var s=t.charAt(i);if(r)"\\;#".indexOf(s)!==-1?n+=s:n+="\\"+s,r=!1;else{if(";#".indexOf(s)!==-1)break;s==="\\"?r=!0:n+=s}}return r&&(n+="\\"),n.trim()}return t}});var vj=y((oye,Dj)=>{"use strict";var cb=1,yj=2;function $se(){return""}function Ise(t,e,r){return t.slice(e,r).replace(/\S/g," ")}Dj.exports=function(t,e){e=e||{};for(var r,n,i=!1,o=!1,s=0,a="",u=e.whitespace===!1?$se:Ise,c=0;c<t.length;c++){if(r=t[c],n=t[c+1],!o&&r==='"'){var l=t[c-1]==="\\"&&t[c-2]!=="\\";l||(i=!i)}if(!i){if(!o&&r+n==="//")a+=t.slice(s,c),s=c,o=cb,c++;else if(o===cb&&r+n===`\r
195
195
  `){c++,o=!1,a+=u(t,s,c),s=c;continue}else if(o===cb&&r===`
196
- `)o=!1,a+=u(t,s,c),s=c;else if(!o&&r+n==="/*"){a+=t.slice(s,c),s=c,o=yj,c++;continue}else if(o===yj&&r+n==="*/"){c++,o=!1,a+=u(t,s,c+1),s=c+1;continue}}}return a+(o?u(t.substr(s)):t.substr(s))}});var wj=y(va=>{"use strict";var bj=require("fs"),jse=gj(),jc=require("path"),Nse=vj(),Lse=va.parse=function(t){return/^\s*{/.test(t)?JSON.parse(Nse(t)):jse.parse(t)},Bse=va.file=function(){var t=[].slice.call(arguments).filter(function(i){return i!=null});for(var e in t)if(typeof t[e]!="string")return;var r=jc.join.apply(null,t),n;try{return bj.readFileSync(r,"utf-8")}catch{return}},sye=va.json=function(){var t=Bse.apply(null,arguments);return t?Lse(t):null},aye=va.env=function(t,e){e=e||process.env;var r={},n=t.length;for(var i in e)if(i.toLowerCase().indexOf(t.toLowerCase())===0){for(var o=i.substring(n).split("__"),s;(s=o.indexOf(""))>-1;)o.splice(s,1);var a=r;o.forEach(function(c,l){!c||typeof a!="object"||(l===o.length-1&&(a[c]=e[i]),a[c]===void 0&&(a[c]={}),a=a[c])})}return r},uye=va.find=function(){var t=jc.join.apply(null,[].slice.call(arguments));function e(r,n){var i=jc.join(r,n);try{return bj.statSync(i),i}catch{if(jc.dirname(r)!==r)return e(jc.dirname(r),n)}}return e(process.cwd(),t)}});var Fj=y((lye,xj)=>{"use strict";function Ej(t){return t instanceof Buffer||t instanceof Date||t instanceof RegExp}function Cj(t){if(t instanceof Buffer){var e=Buffer.alloc?Buffer.alloc(t.length):new Buffer(t.length);return t.copy(e),e}else{if(t instanceof Date)return new Date(t.getTime());if(t instanceof RegExp)return new RegExp(t);throw new Error("Unexpected situation")}}function Sj(t){var e=[];return t.forEach(function(r,n){typeof r=="object"&&r!==null?Array.isArray(r)?e[n]=Sj(r):Ej(r)?e[n]=Cj(r):e[n]=lb({},r):e[n]=r}),e}function _j(t,e){return e==="__proto__"?void 0:t[e]}var lb=xj.exports=function(){if(arguments.length<1||typeof arguments[0]!="object")return!1;if(arguments.length<2)return arguments[0];var t=arguments[0],e=Array.prototype.slice.call(arguments,1),r,n,i;return e.forEach(function(o){typeof o!="object"||o===null||Array.isArray(o)||Object.keys(o).forEach(function(s){if(n=_j(t,s),r=_j(o,s),r!==t)if(typeof r!="object"||r===null){t[s]=r;return}else if(Array.isArray(r)){t[s]=Sj(r);return}else if(Ej(r)){t[s]=Cj(r);return}else if(typeof n!="object"||n===null||Array.isArray(n)){t[s]=lb({},r);return}else{t[s]=lb(n,r);return}})}),t}});var Tj=y((fye,kj)=>{"use strict";function qse(t,e){var r=t;e.slice(0,-1).forEach(function(i){r=r[i]||{}});var n=e[e.length-1];return n in r}function Oj(t){return typeof t=="number"||/^0x[0-9a-f]+$/i.test(t)?!0:/^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(t)}function Aj(t,e){return e==="constructor"&&typeof t[e]=="function"||e==="__proto__"}kj.exports=function(t,e){e||(e={});var r={bools:{},strings:{},unknownFn:null};typeof e.unknown=="function"&&(r.unknownFn=e.unknown),typeof e.boolean=="boolean"&&e.boolean?r.allBools=!0:[].concat(e.boolean).filter(Boolean).forEach(function(C){r.bools[C]=!0});var n={};function i(C){return n[C].some(function(k){return r.bools[k]})}Object.keys(e.alias||{}).forEach(function(C){n[C]=[].concat(e.alias[C]),n[C].forEach(function(k){n[k]=[C].concat(n[C].filter(function($){return k!==$}))})}),[].concat(e.string).filter(Boolean).forEach(function(C){r.strings[C]=!0,n[C]&&[].concat(n[C]).forEach(function(k){r.strings[k]=!0})});var o=e.default||{},s={_:[]};function a(C,k){return r.allBools&&/^--[^=]+$/.test(k)||r.strings[C]||r.bools[C]||n[C]}function u(C,k,$){for(var F=C,L=0;L<k.length-1;L++){var S=k[L];if(Aj(F,S))return;F[S]===void 0&&(F[S]={}),(F[S]===Object.prototype||F[S]===Number.prototype||F[S]===String.prototype)&&(F[S]={}),F[S]===Array.prototype&&(F[S]=[]),F=F[S]}var I=k[k.length-1];Aj(F,I)||((F===Object.prototype||F===Number.prototype||F===String.prototype)&&(F={}),F===Array.prototype&&(F=[]),F[I]===void 0||r.bools[I]||typeof F[I]=="boolean"?F[I]=$:Array.isArray(F[I])?F[I].push($):F[I]=[F[I],$])}function c(C,k,$){if(!($&&r.unknownFn&&!a(C,$)&&r.unknownFn($)===!1)){var F=!r.strings[C]&&Oj(k)?Number(k):k;u(s,C.split("."),F),(n[C]||[]).forEach(function(L){u(s,L.split("."),F)})}}Object.keys(r.bools).forEach(function(C){c(C,o[C]===void 0?!1:o[C])});var l=[];t.indexOf("--")!==-1&&(l=t.slice(t.indexOf("--")+1),t=t.slice(0,t.indexOf("--")));for(var f=0;f<t.length;f++){var h=t[f],d,p;if(/^--.+=/.test(h)){var v=h.match(/^--([^=]+)=([\s\S]*)$/);d=v[1];var g=v[2];r.bools[d]&&(g=g!=="false"),c(d,g,h)}else if(/^--no-.+/.test(h))d=h.match(/^--no-(.+)/)[1],c(d,!1,h);else if(/^--.+/.test(h))d=h.match(/^--(.+)/)[1],p=t[f+1],p!==void 0&&!/^(-|--)[^-]/.test(p)&&!r.bools[d]&&!r.allBools&&(!n[d]||!i(d))?(c(d,p,h),f+=1):/^(true|false)$/.test(p)?(c(d,p==="true",h),f+=1):c(d,r.strings[d]?"":!0,h);else if(/^-[^-]+/.test(h)){for(var w=h.slice(1,-1).split(""),x=!1,D=0;D<w.length;D++){if(p=h.slice(D+2),p==="-"){c(w[D],p,h);continue}if(/[A-Za-z]/.test(w[D])&&p[0]==="="){c(w[D],p.slice(1),h),x=!0;break}if(/[A-Za-z]/.test(w[D])&&/-?\d+(\.\d*)?(e-?\d+)?$/.test(p)){c(w[D],p,h),x=!0;break}if(w[D+1]&&w[D+1].match(/\W/)){c(w[D],h.slice(D+2),h),x=!0;break}else c(w[D],r.strings[w[D]]?"":!0,h)}d=h.slice(-1)[0],!x&&d!=="-"&&(t[f+1]&&!/^(-|--)[^-]/.test(t[f+1])&&!r.bools[d]&&(!n[d]||!i(d))?(c(d,t[f+1],h),f+=1):t[f+1]&&/^(true|false)$/.test(t[f+1])?(c(d,t[f+1]==="true",h),f+=1):c(d,r.strings[d]?"":!0,h))}else if((!r.unknownFn||r.unknownFn(h)!==!1)&&s._.push(r.strings._||!Oj(h)?h:Number(h)),e.stopEarly){s._.push.apply(s._,t.slice(f+1));break}}return Object.keys(o).forEach(function(C){qse(s,C.split("."))||(u(s,C.split("."),o[C]),(n[C]||[]).forEach(function(k){u(s,k.split("."),o[C])}))}),e["--"]?s["--"]=l.slice():l.forEach(function(C){s._.push(C)}),s}});var Ij=y((dye,$j)=>{var Nc=wj(),ba=require("path").join,Mse=Fj(),Pj="/etc",Rj=process.platform==="win32",Lc=Rj?process.env.USERPROFILE:process.env.HOME;$j.exports=function(t,e,r,n){if(typeof t!="string")throw new Error("rc(name): name *must* be string");r||(r=Tj()(process.argv.slice(2))),e=(typeof e=="string"?Nc.json(e):e)||{},n=n||Nc.parse;var i=Nc.env(t+"_"),o=[e],s=[];function a(u){if(!(s.indexOf(u)>=0)){var c=Nc.file(u);c&&(o.push(n(c)),s.push(u))}}return Rj||[ba(Pj,t,"config"),ba(Pj,t+"rc")].forEach(a),Lc&&[ba(Lc,".config",t,"config"),ba(Lc,".config",t),ba(Lc,"."+t,"config"),ba(Lc,"."+t+"rc")].forEach(a),a(Nc.find("."+t+"rc")),i.config&&a(i.config),r.config&&a(r.config),Mse.apply(null,o.concat([i,r,s.length?{configs:s,config:s[s.length-1]}:void 0]))}});var Lj=y((pye,Nj)=>{var bi=require("constants"),Use=process.cwd,Nh=null,Vse=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return Nh||(Nh=Use.call(process)),Nh};try{process.cwd()}catch{}typeof process.chdir=="function"&&(db=process.chdir,process.chdir=function(t){Nh=null,db.call(process,t)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,db));var db;Nj.exports=Hse;function Hse(t){bi.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&e(t),t.lutimes||r(t),t.chown=o(t.chown),t.fchown=o(t.fchown),t.lchown=o(t.lchown),t.chmod=n(t.chmod),t.fchmod=n(t.fchmod),t.lchmod=n(t.lchmod),t.chownSync=s(t.chownSync),t.fchownSync=s(t.fchownSync),t.lchownSync=s(t.lchownSync),t.chmodSync=i(t.chmodSync),t.fchmodSync=i(t.fchmodSync),t.lchmodSync=i(t.lchmodSync),t.stat=a(t.stat),t.fstat=a(t.fstat),t.lstat=a(t.lstat),t.statSync=u(t.statSync),t.fstatSync=u(t.fstatSync),t.lstatSync=u(t.lstatSync),t.chmod&&!t.lchmod&&(t.lchmod=function(l,f,h){h&&process.nextTick(h)},t.lchmodSync=function(){}),t.chown&&!t.lchown&&(t.lchown=function(l,f,h,d){d&&process.nextTick(d)},t.lchownSync=function(){}),Vse==="win32"&&(t.rename=typeof t.rename!="function"?t.rename:function(l){function f(h,d,p){var v=Date.now(),g=0;l(h,d,function w(x){if(x&&(x.code==="EACCES"||x.code==="EPERM")&&Date.now()-v<6e4){setTimeout(function(){t.stat(d,function(D,C){D&&D.code==="ENOENT"?l(h,d,w):p(x)})},g),g<100&&(g+=10);return}p&&p(x)})}return Object.setPrototypeOf&&Object.setPrototypeOf(f,l),f}(t.rename)),t.read=typeof t.read!="function"?t.read:function(l){function f(h,d,p,v,g,w){var x;if(w&&typeof w=="function"){var D=0;x=function(C,k,$){if(C&&C.code==="EAGAIN"&&D<10)return D++,l.call(t,h,d,p,v,g,x);w.apply(this,arguments)}}return l.call(t,h,d,p,v,g,x)}return Object.setPrototypeOf&&Object.setPrototypeOf(f,l),f}(t.read),t.readSync=typeof t.readSync!="function"?t.readSync:function(l){return function(f,h,d,p,v){for(var g=0;;)try{return l.call(t,f,h,d,p,v)}catch(w){if(w.code==="EAGAIN"&&g<10){g++;continue}throw w}}}(t.readSync);function e(l){l.lchmod=function(f,h,d){l.open(f,bi.O_WRONLY|bi.O_SYMLINK,h,function(p,v){if(p){d&&d(p);return}l.fchmod(v,h,function(g){l.close(v,function(w){d&&d(g||w)})})})},l.lchmodSync=function(f,h){var d=l.openSync(f,bi.O_WRONLY|bi.O_SYMLINK,h),p=!0,v;try{v=l.fchmodSync(d,h),p=!1}finally{if(p)try{l.closeSync(d)}catch{}else l.closeSync(d)}return v}}function r(l){bi.hasOwnProperty("O_SYMLINK")&&l.futimes?(l.lutimes=function(f,h,d,p){l.open(f,bi.O_SYMLINK,function(v,g){if(v){p&&p(v);return}l.futimes(g,h,d,function(w){l.close(g,function(x){p&&p(w||x)})})})},l.lutimesSync=function(f,h,d){var p=l.openSync(f,bi.O_SYMLINK),v,g=!0;try{v=l.futimesSync(p,h,d),g=!1}finally{if(g)try{l.closeSync(p)}catch{}else l.closeSync(p)}return v}):l.futimes&&(l.lutimes=function(f,h,d,p){p&&process.nextTick(p)},l.lutimesSync=function(){})}function n(l){return l&&function(f,h,d){return l.call(t,f,h,function(p){c(p)&&(p=null),d&&d.apply(this,arguments)})}}function i(l){return l&&function(f,h){try{return l.call(t,f,h)}catch(d){if(!c(d))throw d}}}function o(l){return l&&function(f,h,d,p){return l.call(t,f,h,d,function(v){c(v)&&(v=null),p&&p.apply(this,arguments)})}}function s(l){return l&&function(f,h,d){try{return l.call(t,f,h,d)}catch(p){if(!c(p))throw p}}}function a(l){return l&&function(f,h,d){typeof h=="function"&&(d=h,h=null);function p(v,g){g&&(g.uid<0&&(g.uid+=4294967296),g.gid<0&&(g.gid+=4294967296)),d&&d.apply(this,arguments)}return h?l.call(t,f,h,p):l.call(t,f,p)}}function u(l){return l&&function(f,h){var d=h?l.call(t,f,h):l.call(t,f);return d&&(d.uid<0&&(d.uid+=4294967296),d.gid<0&&(d.gid+=4294967296)),d}}function c(l){if(!l||l.code==="ENOSYS")return!0;var f=!process.getuid||process.getuid()!==0;return!!(f&&(l.code==="EINVAL"||l.code==="EPERM"))}}});var Mj=y((mye,qj)=>{var Bj=require("stream").Stream;qj.exports=zse;function zse(t){return{ReadStream:e,WriteStream:r};function e(n,i){if(!(this instanceof e))return new e(n,i);Bj.call(this);var o=this;this.path=n,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=64*1024,i=i||{};for(var s=Object.keys(i),a=0,u=s.length;a<u;a++){var c=s[a];this[c]=i[c]}if(this.encoding&&this.setEncoding(this.encoding),this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.end===void 0)this.end=1/0;else if(typeof this.end!="number")throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}if(this.fd!==null){process.nextTick(function(){o._read()});return}t.open(this.path,this.flags,this.mode,function(l,f){if(l){o.emit("error",l),o.readable=!1;return}o.fd=f,o.emit("open",f),o._read()})}function r(n,i){if(!(this instanceof r))return new r(n,i);Bj.call(this),this.path=n,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,i=i||{};for(var o=Object.keys(i),s=0,a=o.length;s<a;s++){var u=o[s];this[u]=i[u]}if(this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start}this.busy=!1,this._queue=[],this.fd===null&&(this._open=t.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}});var Vj=y((gye,Uj)=>{"use strict";Uj.exports=Wse;var Gse=Object.getPrototypeOf||function(t){return t.__proto__};function Wse(t){if(t===null||typeof t!="object")return t;if(t instanceof Object)var e={__proto__:Gse(t)};else var e=Object.create(null);return Object.getOwnPropertyNames(t).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}});var Wj=y((yye,mb)=>{var Ge=require("fs"),Kse=Lj(),Yse=Mj(),Jse=Vj(),Lh=require("util"),_t,qh;typeof Symbol=="function"&&typeof Symbol.for=="function"?(_t=Symbol.for("graceful-fs.queue"),qh=Symbol.for("graceful-fs.previous")):(_t="___graceful-fs.queue",qh="___graceful-fs.previous");function Xse(){}function Gj(t,e){Object.defineProperty(t,_t,{get:function(){return e}})}var Co=Xse;Lh.debuglog?Co=Lh.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(Co=function(){var t=Lh.format.apply(Lh,arguments);t="GFS4: "+t.split(/\n/).join(`
197
- GFS4: `),console.error(t)});Ge[_t]||(Hj=global[_t]||[],Gj(Ge,Hj),Ge.close=function(t){function e(r,n){return t.call(Ge,r,function(i){i||zj(),typeof n=="function"&&n.apply(this,arguments)})}return Object.defineProperty(e,qh,{value:t}),e}(Ge.close),Ge.closeSync=function(t){function e(r){t.apply(Ge,arguments),zj()}return Object.defineProperty(e,qh,{value:t}),e}(Ge.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){Co(Ge[_t]),require("assert").equal(Ge[_t].length,0)}));var Hj;global[_t]||Gj(global,Ge[_t]);mb.exports=hb(Jse(Ge));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!Ge.__patched&&(mb.exports=hb(Ge),Ge.__patched=!0);function hb(t){Kse(t),t.gracefulify=hb,t.createReadStream=k,t.createWriteStream=$;var e=t.readFile;t.readFile=r;function r(S,I,R){return typeof I=="function"&&(R=I,I=null),B(S,I,R);function B(q,K,M,E){return e(q,K,function(b){b&&(b.code==="EMFILE"||b.code==="ENFILE")?wa([B,[q,K,M],b,E||Date.now(),Date.now()]):typeof M=="function"&&M.apply(this,arguments)})}}var n=t.writeFile;t.writeFile=i;function i(S,I,R,B){return typeof R=="function"&&(B=R,R=null),q(S,I,R,B);function q(K,M,E,b,_){return n(K,M,E,function(O){O&&(O.code==="EMFILE"||O.code==="ENFILE")?wa([q,[K,M,E,b],O,_||Date.now(),Date.now()]):typeof b=="function"&&b.apply(this,arguments)})}}var o=t.appendFile;o&&(t.appendFile=s);function s(S,I,R,B){return typeof R=="function"&&(B=R,R=null),q(S,I,R,B);function q(K,M,E,b,_){return o(K,M,E,function(O){O&&(O.code==="EMFILE"||O.code==="ENFILE")?wa([q,[K,M,E,b],O,_||Date.now(),Date.now()]):typeof b=="function"&&b.apply(this,arguments)})}}var a=t.copyFile;a&&(t.copyFile=u);function u(S,I,R,B){return typeof R=="function"&&(B=R,R=0),q(S,I,R,B);function q(K,M,E,b,_){return a(K,M,E,function(O){O&&(O.code==="EMFILE"||O.code==="ENFILE")?wa([q,[K,M,E,b],O,_||Date.now(),Date.now()]):typeof b=="function"&&b.apply(this,arguments)})}}var c=t.readdir;t.readdir=f;var l=/^v[0-5]\./;function f(S,I,R){typeof I=="function"&&(R=I,I=null);var B=l.test(process.version)?function(M,E,b,_){return c(M,q(M,E,b,_))}:function(M,E,b,_){return c(M,E,q(M,E,b,_))};return B(S,I,R);function q(K,M,E,b){return function(_,O){_&&(_.code==="EMFILE"||_.code==="ENFILE")?wa([B,[K,M,E],_,b||Date.now(),Date.now()]):(O&&O.sort&&O.sort(),typeof E=="function"&&E.call(this,_,O))}}}if(process.version.substr(0,4)==="v0.8"){var h=Yse(t);w=h.ReadStream,D=h.WriteStream}var d=t.ReadStream;d&&(w.prototype=Object.create(d.prototype),w.prototype.open=x);var p=t.WriteStream;p&&(D.prototype=Object.create(p.prototype),D.prototype.open=C),Object.defineProperty(t,"ReadStream",{get:function(){return w},set:function(S){w=S},enumerable:!0,configurable:!0}),Object.defineProperty(t,"WriteStream",{get:function(){return D},set:function(S){D=S},enumerable:!0,configurable:!0});var v=w;Object.defineProperty(t,"FileReadStream",{get:function(){return v},set:function(S){v=S},enumerable:!0,configurable:!0});var g=D;Object.defineProperty(t,"FileWriteStream",{get:function(){return g},set:function(S){g=S},enumerable:!0,configurable:!0});function w(S,I){return this instanceof w?(d.apply(this,arguments),this):w.apply(Object.create(w.prototype),arguments)}function x(){var S=this;L(S.path,S.flags,S.mode,function(I,R){I?(S.autoClose&&S.destroy(),S.emit("error",I)):(S.fd=R,S.emit("open",R),S.read())})}function D(S,I){return this instanceof D?(p.apply(this,arguments),this):D.apply(Object.create(D.prototype),arguments)}function C(){var S=this;L(S.path,S.flags,S.mode,function(I,R){I?(S.destroy(),S.emit("error",I)):(S.fd=R,S.emit("open",R))})}function k(S,I){return new t.ReadStream(S,I)}function $(S,I){return new t.WriteStream(S,I)}var F=t.open;t.open=L;function L(S,I,R,B){return typeof R=="function"&&(B=R,R=null),q(S,I,R,B);function q(K,M,E,b,_){return F(K,M,E,function(O,j){O&&(O.code==="EMFILE"||O.code==="ENFILE")?wa([q,[K,M,E,b],O,_||Date.now(),Date.now()]):typeof b=="function"&&b.apply(this,arguments)})}}return t}function wa(t){Co("ENQUEUE",t[0].name,t[1]),Ge[_t].push(t),pb()}var Bh;function zj(){for(var t=Date.now(),e=0;e<Ge[_t].length;++e)Ge[_t][e].length>2&&(Ge[_t][e][3]=t,Ge[_t][e][4]=t);pb()}function pb(){if(clearTimeout(Bh),Bh=void 0,Ge[_t].length!==0){var t=Ge[_t].shift(),e=t[0],r=t[1],n=t[2],i=t[3],o=t[4];if(i===void 0)Co("RETRY",e.name,r),e.apply(null,r);else if(Date.now()-i>=6e4){Co("TIMEOUT",e.name,r);var s=r.pop();typeof s=="function"&&s.call(null,n)}else{var a=Date.now()-o,u=Math.max(o-i,1),c=Math.min(u*1.2,100);a>=c?(Co("RETRY",e.name,r),e.apply(null,r.concat([i]))):Ge[_t].push(t)}Bh===void 0&&(Bh=setTimeout(pb,0))}}});var Kj=y(_a=>{"use strict";var Zse=_a&&_a.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(_a,"__esModule",{value:!0});_a.readCAFileSync=void 0;var Qse=Zse(Wj());function eae(t){try{let e=Qse.default.readFileSync(t,"utf8"),r="-----END CERTIFICATE-----";return e.split(r).filter(i=>!!i.trim()).map(i=>`${i.trimLeft()}${r}`)}catch(e){if(e.code==="ENOENT")return;throw e}}_a.readCAFileSync=eae});var Yj=y(So=>{"use strict";var tae=So&&So.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),rae=So&&So.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&tae(e,t,r)};Object.defineProperty(So,"__esModule",{value:!0});rae(Kj(),So)});var Zj=y((bye,Xj)=>{Xj.exports=Jj;function xo(t,e){if(typeof Object.setPrototypeOf=="function")return Object.setPrototypeOf(t,e);t.__proto__=e}function Jj(){this.list=[];var t=null;Object.defineProperty(this,"root",{get:function(){return t},set:function(e){t=e,this.list.length&&xo(this.list[this.list.length-1],e)},enumerable:!0,configurable:!0})}Jj.prototype={get length(){return this.list.length},get keys(){var t=[];for(var e in this.list[0])t.push(e);return t},get snapshot(){var t={};return this.keys.forEach(function(e){t[e]=this.get(e)},this),t},get store(){return this.list[0]},push:function(t){return typeof t!="object"&&(t={valueOf:t}),this.list.length>=1&&xo(this.list[this.list.length-1],t),xo(t,this.root),this.list.push(t)},pop:function(){return this.list.length>=2&&xo(this.list[this.list.length-2],this.root),this.list.pop()},unshift:function(t){return xo(t,this.list[0]||this.root),this.list.unshift(t)},shift:function(){return this.list.length===1&&xo(this.list[0],this.root),this.list.shift()},get:function(t){return this.list[0][t]},set:function(t,e,r){return this.length||this.push({}),r&&this.list[0].hasOwnProperty(t)&&this.push({}),this.list[0][t]=e},forEach:function(t,e){for(var r in this.list[0])t.call(e,r,this.list[0][r])},slice:function(){return this.list.slice.apply(this.list,arguments)},splice:function(){for(var t=this.list.splice.apply(this.list,arguments),e=0,r=this.list.length;e<r;e++)xo(this.list[e],this.list[e+1]||this.root);return t}}});var r8=y(Fo=>{Fo.parse=Fo.decode=nae;Fo.stringify=Fo.encode=Qj;Fo.safe=Ea;Fo.unsafe=Mh;var gb=typeof process<"u"&&process.platform==="win32"?`\r
196
+ `)o=!1,a+=u(t,s,c),s=c;else if(!o&&r+n==="/*"){a+=t.slice(s,c),s=c,o=yj,c++;continue}else if(o===yj&&r+n==="*/"){c++,o=!1,a+=u(t,s,c+1),s=c+1;continue}}}return a+(o?u(t.substr(s)):t.substr(s))}});var wj=y(va=>{"use strict";var bj=require("fs"),jse=gj(),jc=require("path"),Nse=vj(),Lse=va.parse=function(t){return/^\s*{/.test(t)?JSON.parse(Nse(t)):jse.parse(t)},Bse=va.file=function(){var t=[].slice.call(arguments).filter(function(i){return i!=null});for(var e in t)if(typeof t[e]!="string")return;var r=jc.join.apply(null,t),n;try{return bj.readFileSync(r,"utf-8")}catch{return}},sye=va.json=function(){var t=Bse.apply(null,arguments);return t?Lse(t):null},aye=va.env=function(t,e){e=e||process.env;var r={},n=t.length;for(var i in e)if(i.toLowerCase().indexOf(t.toLowerCase())===0){for(var o=i.substring(n).split("__"),s;(s=o.indexOf(""))>-1;)o.splice(s,1);var a=r;o.forEach(function(c,l){!c||typeof a!="object"||(l===o.length-1&&(a[c]=e[i]),a[c]===void 0&&(a[c]={}),a=a[c])})}return r},uye=va.find=function(){var t=jc.join.apply(null,[].slice.call(arguments));function e(r,n){var i=jc.join(r,n);try{return bj.statSync(i),i}catch{if(jc.dirname(r)!==r)return e(jc.dirname(r),n)}}return e(process.cwd(),t)}});var Fj=y((lye,xj)=>{"use strict";function Ej(t){return t instanceof Buffer||t instanceof Date||t instanceof RegExp}function Cj(t){if(t instanceof Buffer){var e=Buffer.alloc?Buffer.alloc(t.length):new Buffer(t.length);return t.copy(e),e}else{if(t instanceof Date)return new Date(t.getTime());if(t instanceof RegExp)return new RegExp(t);throw new Error("Unexpected situation")}}function Sj(t){var e=[];return t.forEach(function(r,n){typeof r=="object"&&r!==null?Array.isArray(r)?e[n]=Sj(r):Ej(r)?e[n]=Cj(r):e[n]=lb({},r):e[n]=r}),e}function _j(t,e){return e==="__proto__"?void 0:t[e]}var lb=xj.exports=function(){if(arguments.length<1||typeof arguments[0]!="object")return!1;if(arguments.length<2)return arguments[0];var t=arguments[0],e=Array.prototype.slice.call(arguments,1),r,n,i;return e.forEach(function(o){typeof o!="object"||o===null||Array.isArray(o)||Object.keys(o).forEach(function(s){if(n=_j(t,s),r=_j(o,s),r!==t)if(typeof r!="object"||r===null){t[s]=r;return}else if(Array.isArray(r)){t[s]=Sj(r);return}else if(Ej(r)){t[s]=Cj(r);return}else if(typeof n!="object"||n===null||Array.isArray(n)){t[s]=lb({},r);return}else{t[s]=lb(n,r);return}})}),t}});var Tj=y((fye,kj)=>{"use strict";function qse(t,e){var r=t;e.slice(0,-1).forEach(function(i){r=r[i]||{}});var n=e[e.length-1];return n in r}function Oj(t){return typeof t=="number"||/^0x[0-9a-f]+$/i.test(t)?!0:/^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(t)}function Aj(t,e){return e==="constructor"&&typeof t[e]=="function"||e==="__proto__"}kj.exports=function(t,e){e||(e={});var r={bools:{},strings:{},unknownFn:null};typeof e.unknown=="function"&&(r.unknownFn=e.unknown),typeof e.boolean=="boolean"&&e.boolean?r.allBools=!0:[].concat(e.boolean).filter(Boolean).forEach(function(C){r.bools[C]=!0});var n={};function i(C){return n[C].some(function(k){return r.bools[k]})}Object.keys(e.alias||{}).forEach(function(C){n[C]=[].concat(e.alias[C]),n[C].forEach(function(k){n[k]=[C].concat(n[C].filter(function($){return k!==$}))})}),[].concat(e.string).filter(Boolean).forEach(function(C){r.strings[C]=!0,n[C]&&[].concat(n[C]).forEach(function(k){r.strings[k]=!0})});var o=e.default||{},s={_:[]};function a(C,k){return r.allBools&&/^--[^=]+$/.test(k)||r.strings[C]||r.bools[C]||n[C]}function u(C,k,$){for(var F=C,L=0;L<k.length-1;L++){var S=k[L];if(Aj(F,S))return;F[S]===void 0&&(F[S]={}),(F[S]===Object.prototype||F[S]===Number.prototype||F[S]===String.prototype)&&(F[S]={}),F[S]===Array.prototype&&(F[S]=[]),F=F[S]}var I=k[k.length-1];Aj(F,I)||((F===Object.prototype||F===Number.prototype||F===String.prototype)&&(F={}),F===Array.prototype&&(F=[]),F[I]===void 0||r.bools[I]||typeof F[I]=="boolean"?F[I]=$:Array.isArray(F[I])?F[I].push($):F[I]=[F[I],$])}function c(C,k,$){if(!($&&r.unknownFn&&!a(C,$)&&r.unknownFn($)===!1)){var F=!r.strings[C]&&Oj(k)?Number(k):k;u(s,C.split("."),F),(n[C]||[]).forEach(function(L){u(s,L.split("."),F)})}}Object.keys(r.bools).forEach(function(C){c(C,o[C]===void 0?!1:o[C])});var l=[];t.indexOf("--")!==-1&&(l=t.slice(t.indexOf("--")+1),t=t.slice(0,t.indexOf("--")));for(var f=0;f<t.length;f++){var h=t[f],d,p;if(/^--.+=/.test(h)){var v=h.match(/^--([^=]+)=([\s\S]*)$/);d=v[1];var g=v[2];r.bools[d]&&(g=g!=="false"),c(d,g,h)}else if(/^--no-.+/.test(h))d=h.match(/^--no-(.+)/)[1],c(d,!1,h);else if(/^--.+/.test(h))d=h.match(/^--(.+)/)[1],p=t[f+1],p!==void 0&&!/^(-|--)[^-]/.test(p)&&!r.bools[d]&&!r.allBools&&(!n[d]||!i(d))?(c(d,p,h),f+=1):/^(true|false)$/.test(p)?(c(d,p==="true",h),f+=1):c(d,r.strings[d]?"":!0,h);else if(/^-[^-]+/.test(h)){for(var w=h.slice(1,-1).split(""),x=!1,D=0;D<w.length;D++){if(p=h.slice(D+2),p==="-"){c(w[D],p,h);continue}if(/[A-Za-z]/.test(w[D])&&p[0]==="="){c(w[D],p.slice(1),h),x=!0;break}if(/[A-Za-z]/.test(w[D])&&/-?\d+(\.\d*)?(e-?\d+)?$/.test(p)){c(w[D],p,h),x=!0;break}if(w[D+1]&&w[D+1].match(/\W/)){c(w[D],h.slice(D+2),h),x=!0;break}else c(w[D],r.strings[w[D]]?"":!0,h)}d=h.slice(-1)[0],!x&&d!=="-"&&(t[f+1]&&!/^(-|--)[^-]/.test(t[f+1])&&!r.bools[d]&&(!n[d]||!i(d))?(c(d,t[f+1],h),f+=1):t[f+1]&&/^(true|false)$/.test(t[f+1])?(c(d,t[f+1]==="true",h),f+=1):c(d,r.strings[d]?"":!0,h))}else if((!r.unknownFn||r.unknownFn(h)!==!1)&&s._.push(r.strings._||!Oj(h)?h:Number(h)),e.stopEarly){s._.push.apply(s._,t.slice(f+1));break}}return Object.keys(o).forEach(function(C){qse(s,C.split("."))||(u(s,C.split("."),o[C]),(n[C]||[]).forEach(function(k){u(s,k.split("."),o[C])}))}),e["--"]?s["--"]=l.slice():l.forEach(function(C){s._.push(C)}),s}});var Ij=y((dye,$j)=>{var Nc=wj(),ba=require("path").join,Mse=Fj(),Pj="/etc",Rj=process.platform==="win32",Lc=Rj?process.env.USERPROFILE:process.env.HOME;$j.exports=function(t,e,r,n){if(typeof t!="string")throw new Error("rc(name): name *must* be string");r||(r=Tj()(process.argv.slice(2))),e=(typeof e=="string"?Nc.json(e):e)||{},n=n||Nc.parse;var i=Nc.env(t+"_"),o=[e],s=[];function a(u){if(!(s.indexOf(u)>=0)){var c=Nc.file(u);c&&(o.push(n(c)),s.push(u))}}return Rj||[ba(Pj,t,"config"),ba(Pj,t+"rc")].forEach(a),Lc&&[ba(Lc,".config",t,"config"),ba(Lc,".config",t),ba(Lc,"."+t,"config"),ba(Lc,"."+t+"rc")].forEach(a),a(Nc.find("."+t+"rc")),i.config&&a(i.config),r.config&&a(r.config),Mse.apply(null,o.concat([i,r,s.length?{configs:s,config:s[s.length-1]}:void 0]))}});var Lj=y((pye,Nj)=>{var bi=require("constants"),Use=process.cwd,Ih=null,Vse=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return Ih||(Ih=Use.call(process)),Ih};try{process.cwd()}catch{}typeof process.chdir=="function"&&(db=process.chdir,process.chdir=function(t){Ih=null,db.call(process,t)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,db));var db;Nj.exports=Hse;function Hse(t){bi.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&e(t),t.lutimes||r(t),t.chown=o(t.chown),t.fchown=o(t.fchown),t.lchown=o(t.lchown),t.chmod=n(t.chmod),t.fchmod=n(t.fchmod),t.lchmod=n(t.lchmod),t.chownSync=s(t.chownSync),t.fchownSync=s(t.fchownSync),t.lchownSync=s(t.lchownSync),t.chmodSync=i(t.chmodSync),t.fchmodSync=i(t.fchmodSync),t.lchmodSync=i(t.lchmodSync),t.stat=a(t.stat),t.fstat=a(t.fstat),t.lstat=a(t.lstat),t.statSync=u(t.statSync),t.fstatSync=u(t.fstatSync),t.lstatSync=u(t.lstatSync),t.chmod&&!t.lchmod&&(t.lchmod=function(l,f,h){h&&process.nextTick(h)},t.lchmodSync=function(){}),t.chown&&!t.lchown&&(t.lchown=function(l,f,h,d){d&&process.nextTick(d)},t.lchownSync=function(){}),Vse==="win32"&&(t.rename=typeof t.rename!="function"?t.rename:function(l){function f(h,d,p){var v=Date.now(),g=0;l(h,d,function w(x){if(x&&(x.code==="EACCES"||x.code==="EPERM")&&Date.now()-v<6e4){setTimeout(function(){t.stat(d,function(D,C){D&&D.code==="ENOENT"?l(h,d,w):p(x)})},g),g<100&&(g+=10);return}p&&p(x)})}return Object.setPrototypeOf&&Object.setPrototypeOf(f,l),f}(t.rename)),t.read=typeof t.read!="function"?t.read:function(l){function f(h,d,p,v,g,w){var x;if(w&&typeof w=="function"){var D=0;x=function(C,k,$){if(C&&C.code==="EAGAIN"&&D<10)return D++,l.call(t,h,d,p,v,g,x);w.apply(this,arguments)}}return l.call(t,h,d,p,v,g,x)}return Object.setPrototypeOf&&Object.setPrototypeOf(f,l),f}(t.read),t.readSync=typeof t.readSync!="function"?t.readSync:function(l){return function(f,h,d,p,v){for(var g=0;;)try{return l.call(t,f,h,d,p,v)}catch(w){if(w.code==="EAGAIN"&&g<10){g++;continue}throw w}}}(t.readSync);function e(l){l.lchmod=function(f,h,d){l.open(f,bi.O_WRONLY|bi.O_SYMLINK,h,function(p,v){if(p){d&&d(p);return}l.fchmod(v,h,function(g){l.close(v,function(w){d&&d(g||w)})})})},l.lchmodSync=function(f,h){var d=l.openSync(f,bi.O_WRONLY|bi.O_SYMLINK,h),p=!0,v;try{v=l.fchmodSync(d,h),p=!1}finally{if(p)try{l.closeSync(d)}catch{}else l.closeSync(d)}return v}}function r(l){bi.hasOwnProperty("O_SYMLINK")&&l.futimes?(l.lutimes=function(f,h,d,p){l.open(f,bi.O_SYMLINK,function(v,g){if(v){p&&p(v);return}l.futimes(g,h,d,function(w){l.close(g,function(x){p&&p(w||x)})})})},l.lutimesSync=function(f,h,d){var p=l.openSync(f,bi.O_SYMLINK),v,g=!0;try{v=l.futimesSync(p,h,d),g=!1}finally{if(g)try{l.closeSync(p)}catch{}else l.closeSync(p)}return v}):l.futimes&&(l.lutimes=function(f,h,d,p){p&&process.nextTick(p)},l.lutimesSync=function(){})}function n(l){return l&&function(f,h,d){return l.call(t,f,h,function(p){c(p)&&(p=null),d&&d.apply(this,arguments)})}}function i(l){return l&&function(f,h){try{return l.call(t,f,h)}catch(d){if(!c(d))throw d}}}function o(l){return l&&function(f,h,d,p){return l.call(t,f,h,d,function(v){c(v)&&(v=null),p&&p.apply(this,arguments)})}}function s(l){return l&&function(f,h,d){try{return l.call(t,f,h,d)}catch(p){if(!c(p))throw p}}}function a(l){return l&&function(f,h,d){typeof h=="function"&&(d=h,h=null);function p(v,g){g&&(g.uid<0&&(g.uid+=4294967296),g.gid<0&&(g.gid+=4294967296)),d&&d.apply(this,arguments)}return h?l.call(t,f,h,p):l.call(t,f,p)}}function u(l){return l&&function(f,h){var d=h?l.call(t,f,h):l.call(t,f);return d&&(d.uid<0&&(d.uid+=4294967296),d.gid<0&&(d.gid+=4294967296)),d}}function c(l){if(!l||l.code==="ENOSYS")return!0;var f=!process.getuid||process.getuid()!==0;return!!(f&&(l.code==="EINVAL"||l.code==="EPERM"))}}});var Mj=y((mye,qj)=>{var Bj=require("stream").Stream;qj.exports=zse;function zse(t){return{ReadStream:e,WriteStream:r};function e(n,i){if(!(this instanceof e))return new e(n,i);Bj.call(this);var o=this;this.path=n,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=64*1024,i=i||{};for(var s=Object.keys(i),a=0,u=s.length;a<u;a++){var c=s[a];this[c]=i[c]}if(this.encoding&&this.setEncoding(this.encoding),this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.end===void 0)this.end=1/0;else if(typeof this.end!="number")throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}if(this.fd!==null){process.nextTick(function(){o._read()});return}t.open(this.path,this.flags,this.mode,function(l,f){if(l){o.emit("error",l),o.readable=!1;return}o.fd=f,o.emit("open",f),o._read()})}function r(n,i){if(!(this instanceof r))return new r(n,i);Bj.call(this),this.path=n,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,i=i||{};for(var o=Object.keys(i),s=0,a=o.length;s<a;s++){var u=o[s];this[u]=i[u]}if(this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start}this.busy=!1,this._queue=[],this.fd===null&&(this._open=t.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}});var Vj=y((gye,Uj)=>{"use strict";Uj.exports=Wse;var Gse=Object.getPrototypeOf||function(t){return t.__proto__};function Wse(t){if(t===null||typeof t!="object")return t;if(t instanceof Object)var e={__proto__:Gse(t)};else var e=Object.create(null);return Object.getOwnPropertyNames(t).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}});var Wj=y((yye,mb)=>{var Ge=require("fs"),Kse=Lj(),Yse=Mj(),Jse=Vj(),jh=require("util"),_t,Lh;typeof Symbol=="function"&&typeof Symbol.for=="function"?(_t=Symbol.for("graceful-fs.queue"),Lh=Symbol.for("graceful-fs.previous")):(_t="___graceful-fs.queue",Lh="___graceful-fs.previous");function Xse(){}function Gj(t,e){Object.defineProperty(t,_t,{get:function(){return e}})}var Eo=Xse;jh.debuglog?Eo=jh.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(Eo=function(){var t=jh.format.apply(jh,arguments);t="GFS4: "+t.split(/\n/).join(`
197
+ GFS4: `),console.error(t)});Ge[_t]||(Hj=global[_t]||[],Gj(Ge,Hj),Ge.close=function(t){function e(r,n){return t.call(Ge,r,function(i){i||zj(),typeof n=="function"&&n.apply(this,arguments)})}return Object.defineProperty(e,Lh,{value:t}),e}(Ge.close),Ge.closeSync=function(t){function e(r){t.apply(Ge,arguments),zj()}return Object.defineProperty(e,Lh,{value:t}),e}(Ge.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){Eo(Ge[_t]),require("assert").equal(Ge[_t].length,0)}));var Hj;global[_t]||Gj(global,Ge[_t]);mb.exports=hb(Jse(Ge));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!Ge.__patched&&(mb.exports=hb(Ge),Ge.__patched=!0);function hb(t){Kse(t),t.gracefulify=hb,t.createReadStream=k,t.createWriteStream=$;var e=t.readFile;t.readFile=r;function r(S,I,R){return typeof I=="function"&&(R=I,I=null),B(S,I,R);function B(q,K,M,E){return e(q,K,function(b){b&&(b.code==="EMFILE"||b.code==="ENFILE")?wa([B,[q,K,M],b,E||Date.now(),Date.now()]):typeof M=="function"&&M.apply(this,arguments)})}}var n=t.writeFile;t.writeFile=i;function i(S,I,R,B){return typeof R=="function"&&(B=R,R=null),q(S,I,R,B);function q(K,M,E,b,_){return n(K,M,E,function(O){O&&(O.code==="EMFILE"||O.code==="ENFILE")?wa([q,[K,M,E,b],O,_||Date.now(),Date.now()]):typeof b=="function"&&b.apply(this,arguments)})}}var o=t.appendFile;o&&(t.appendFile=s);function s(S,I,R,B){return typeof R=="function"&&(B=R,R=null),q(S,I,R,B);function q(K,M,E,b,_){return o(K,M,E,function(O){O&&(O.code==="EMFILE"||O.code==="ENFILE")?wa([q,[K,M,E,b],O,_||Date.now(),Date.now()]):typeof b=="function"&&b.apply(this,arguments)})}}var a=t.copyFile;a&&(t.copyFile=u);function u(S,I,R,B){return typeof R=="function"&&(B=R,R=0),q(S,I,R,B);function q(K,M,E,b,_){return a(K,M,E,function(O){O&&(O.code==="EMFILE"||O.code==="ENFILE")?wa([q,[K,M,E,b],O,_||Date.now(),Date.now()]):typeof b=="function"&&b.apply(this,arguments)})}}var c=t.readdir;t.readdir=f;var l=/^v[0-5]\./;function f(S,I,R){typeof I=="function"&&(R=I,I=null);var B=l.test(process.version)?function(M,E,b,_){return c(M,q(M,E,b,_))}:function(M,E,b,_){return c(M,E,q(M,E,b,_))};return B(S,I,R);function q(K,M,E,b){return function(_,O){_&&(_.code==="EMFILE"||_.code==="ENFILE")?wa([B,[K,M,E],_,b||Date.now(),Date.now()]):(O&&O.sort&&O.sort(),typeof E=="function"&&E.call(this,_,O))}}}if(process.version.substr(0,4)==="v0.8"){var h=Yse(t);w=h.ReadStream,D=h.WriteStream}var d=t.ReadStream;d&&(w.prototype=Object.create(d.prototype),w.prototype.open=x);var p=t.WriteStream;p&&(D.prototype=Object.create(p.prototype),D.prototype.open=C),Object.defineProperty(t,"ReadStream",{get:function(){return w},set:function(S){w=S},enumerable:!0,configurable:!0}),Object.defineProperty(t,"WriteStream",{get:function(){return D},set:function(S){D=S},enumerable:!0,configurable:!0});var v=w;Object.defineProperty(t,"FileReadStream",{get:function(){return v},set:function(S){v=S},enumerable:!0,configurable:!0});var g=D;Object.defineProperty(t,"FileWriteStream",{get:function(){return g},set:function(S){g=S},enumerable:!0,configurable:!0});function w(S,I){return this instanceof w?(d.apply(this,arguments),this):w.apply(Object.create(w.prototype),arguments)}function x(){var S=this;L(S.path,S.flags,S.mode,function(I,R){I?(S.autoClose&&S.destroy(),S.emit("error",I)):(S.fd=R,S.emit("open",R),S.read())})}function D(S,I){return this instanceof D?(p.apply(this,arguments),this):D.apply(Object.create(D.prototype),arguments)}function C(){var S=this;L(S.path,S.flags,S.mode,function(I,R){I?(S.destroy(),S.emit("error",I)):(S.fd=R,S.emit("open",R))})}function k(S,I){return new t.ReadStream(S,I)}function $(S,I){return new t.WriteStream(S,I)}var F=t.open;t.open=L;function L(S,I,R,B){return typeof R=="function"&&(B=R,R=null),q(S,I,R,B);function q(K,M,E,b,_){return F(K,M,E,function(O,j){O&&(O.code==="EMFILE"||O.code==="ENFILE")?wa([q,[K,M,E,b],O,_||Date.now(),Date.now()]):typeof b=="function"&&b.apply(this,arguments)})}}return t}function wa(t){Eo("ENQUEUE",t[0].name,t[1]),Ge[_t].push(t),pb()}var Nh;function zj(){for(var t=Date.now(),e=0;e<Ge[_t].length;++e)Ge[_t][e].length>2&&(Ge[_t][e][3]=t,Ge[_t][e][4]=t);pb()}function pb(){if(clearTimeout(Nh),Nh=void 0,Ge[_t].length!==0){var t=Ge[_t].shift(),e=t[0],r=t[1],n=t[2],i=t[3],o=t[4];if(i===void 0)Eo("RETRY",e.name,r),e.apply(null,r);else if(Date.now()-i>=6e4){Eo("TIMEOUT",e.name,r);var s=r.pop();typeof s=="function"&&s.call(null,n)}else{var a=Date.now()-o,u=Math.max(o-i,1),c=Math.min(u*1.2,100);a>=c?(Eo("RETRY",e.name,r),e.apply(null,r.concat([i]))):Ge[_t].push(t)}Nh===void 0&&(Nh=setTimeout(pb,0))}}});var Kj=y(_a=>{"use strict";var Zse=_a&&_a.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(_a,"__esModule",{value:!0});_a.readCAFileSync=void 0;var Qse=Zse(Wj());function eae(t){try{let e=Qse.default.readFileSync(t,"utf8"),r="-----END CERTIFICATE-----";return e.split(r).filter(i=>!!i.trim()).map(i=>`${i.trimLeft()}${r}`)}catch(e){if(e.code==="ENOENT")return;throw e}}_a.readCAFileSync=eae});var Yj=y(Co=>{"use strict";var tae=Co&&Co.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),rae=Co&&Co.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&tae(e,t,r)};Object.defineProperty(Co,"__esModule",{value:!0});rae(Kj(),Co)});var Zj=y((bye,Xj)=>{Xj.exports=Jj;function So(t,e){if(typeof Object.setPrototypeOf=="function")return Object.setPrototypeOf(t,e);t.__proto__=e}function Jj(){this.list=[];var t=null;Object.defineProperty(this,"root",{get:function(){return t},set:function(e){t=e,this.list.length&&So(this.list[this.list.length-1],e)},enumerable:!0,configurable:!0})}Jj.prototype={get length(){return this.list.length},get keys(){var t=[];for(var e in this.list[0])t.push(e);return t},get snapshot(){var t={};return this.keys.forEach(function(e){t[e]=this.get(e)},this),t},get store(){return this.list[0]},push:function(t){return typeof t!="object"&&(t={valueOf:t}),this.list.length>=1&&So(this.list[this.list.length-1],t),So(t,this.root),this.list.push(t)},pop:function(){return this.list.length>=2&&So(this.list[this.list.length-2],this.root),this.list.pop()},unshift:function(t){return So(t,this.list[0]||this.root),this.list.unshift(t)},shift:function(){return this.list.length===1&&So(this.list[0],this.root),this.list.shift()},get:function(t){return this.list[0][t]},set:function(t,e,r){return this.length||this.push({}),r&&this.list[0].hasOwnProperty(t)&&this.push({}),this.list[0][t]=e},forEach:function(t,e){for(var r in this.list[0])t.call(e,r,this.list[0][r])},slice:function(){return this.list.slice.apply(this.list,arguments)},splice:function(){for(var t=this.list.splice.apply(this.list,arguments),e=0,r=this.list.length;e<r;e++)So(this.list[e],this.list[e+1]||this.root);return t}}});var r8=y(xo=>{xo.parse=xo.decode=nae;xo.stringify=xo.encode=Qj;xo.safe=Ea;xo.unsafe=Bh;var gb=typeof process<"u"&&process.platform==="win32"?`\r
198
198
  `:`
199
199
  `;function Qj(t,e){var r=[],n="";typeof e=="string"?e={section:e,whitespace:!1}:(e=e||{},e.whitespace=e.whitespace===!0);var i=e.whitespace?" = ":"=";return Object.keys(t).forEach(function(o,s,a){var u=t[o];u&&Array.isArray(u)?u.forEach(function(c){n+=Ea(o+"[]")+i+Ea(c)+`
200
- `}):u&&typeof u=="object"?r.push(o):n+=Ea(o)+i+Ea(u)+gb}),e.section&&n.length&&(n="["+Ea(e.section)+"]"+gb+n),r.forEach(function(o,s,a){var u=e8(o).join("\\."),c=(e.section?e.section+".":"")+u,l=Qj(t[o],{section:c,whitespace:e.whitespace});n.length&&l.length&&(n+=gb),n+=l}),n}function e8(t){return t.replace(/\1/g,"LITERAL\\1LITERAL").replace(/\\\./g,"").split(/\./).map(function(e){return e.replace(/\1/g,"\\.").replace(/\2LITERAL\\1LITERAL\2/g,"")})}function nae(t){var e={},r=e,n=null,i=/^\[([^\]]*)\]$|^([^=]+)(=(.*))?$/i,o=t.split(/[\r\n]+/g);return o.forEach(function(s,a,u){if(!(!s||s.match(/^\s*[;#]/))){var c=s.match(i);if(c){if(c[1]!==void 0){if(n=Mh(c[1]),n==="__proto__"){r={};return}r=e[n]=e[n]||{};return}var l=Mh(c[2]);if(l!=="__proto__"){var f=c[3]?Mh(c[4]):!0;switch(f){case"true":case"false":case"null":f=JSON.parse(f)}if(l.length>2&&l.slice(-2)==="[]"){if(l=l.substring(0,l.length-2),l==="__proto__")return;r[l]?Array.isArray(r[l])||(r[l]=[r[l]]):r[l]=[]}Array.isArray(r[l])?r[l].push(f):r[l]=f}}}}),Object.keys(e).filter(function(s,a,u){if(!e[s]||typeof e[s]!="object"||Array.isArray(e[s]))return!1;var c=e8(s),l=e,f=c.pop(),h=f.replace(/\\\./g,".");return c.forEach(function(d,p,v){d!=="__proto__"&&((!l[d]||typeof l[d]!="object")&&(l[d]={}),l=l[d])}),l===e&&h===f?!1:(l[h]=e[s],!0)}).forEach(function(s,a,u){delete e[s]}),e}function t8(t){return t.charAt(0)==='"'&&t.slice(-1)==='"'||t.charAt(0)==="'"&&t.slice(-1)==="'"}function Ea(t){return typeof t!="string"||t.match(/[=\r\n]/)||t.match(/^\[/)||t.length>1&&t8(t)||t!==t.trim()?JSON.stringify(t):t.replace(/;/g,"\\;").replace(/#/g,"\\#")}function Mh(t,e){if(t=(t||"").trim(),t8(t)){t.charAt(0)==="'"&&(t=t.substr(1,t.length-2));try{t=JSON.parse(t)}catch{}}else{for(var r=!1,n="",i=0,o=t.length;i<o;i++){var s=t.charAt(i);if(r)"\\;#".indexOf(s)!==-1?n+=s:n+="\\"+s,r=!1;else{if(";#".indexOf(s)!==-1)break;s==="\\"?r=!0:n+=s}}return r&&(n+="\\"),n.trim()}return t}});var s8=y((Nn,o8)=>{var n8=Zj(),Bc=require("path"),Uh=require("fs"),yb=r8(),Db=require("events").EventEmitter,iae=require("url"),oae=require("http"),Nn=o8.exports=function(){for(var t=[].slice.call(arguments),e=new Ft;t.length;){var r=t.shift();r&&e.push(typeof r=="string"?aae(r):r)}return e},_ye=Nn.find=function(){var t=Bc.join.apply(null,[].slice.call(arguments));function e(r,n){var i=Bc.join(r,n);try{return Uh.statSync(i),i}catch{if(Bc.dirname(r)!==r)return e(Bc.dirname(r),n)}}return e(__dirname,t)},sae=Nn.parse=function(t,e,r){if(t=""+t,r)if(r==="json")if(this.emit)try{return JSON.parse(t)}catch(n){this.emit("error",n)}else return JSON.parse(t);else return yb.parse(t);else try{return JSON.parse(t)}catch{return yb.parse(t)}},aae=Nn.json=function(){var t=[].slice.call(arguments).filter(function(n){return n!=null}),e=Bc.join.apply(null,t),r;try{r=Uh.readFileSync(e,"utf-8")}catch{return}return sae(r,e,"json")},Eye=Nn.env=function(t,e){e=e||process.env;var r={},n=t.length;for(var i in e)i.indexOf(t)===0&&(r[i.substring(n)]=e[i]);return r};Nn.ConfigChain=Ft;function Ft(){Db.apply(this),n8.apply(this,arguments),this._awaiting=0,this._saving=0,this.sources={}}var i8={constructor:{value:Ft}};Object.keys(Db.prototype).forEach(function(t){i8[t]=Object.getOwnPropertyDescriptor(Db.prototype,t)});Ft.prototype=Object.create(n8.prototype,i8);Ft.prototype.del=function(t,e){if(e){var r=this.sources[e];if(r=r&&r.data,!r)return this.emit("error",new Error("not found "+e));delete r[t]}else for(var n=0,i=this.list.length;n<i;n++)delete this.list[n][t];return this};Ft.prototype.set=function(t,e,r){var n;if(r){if(n=this.sources[r],n=n&&n.data,!n)return this.emit("error",new Error("not found "+r))}else if(n=this.list[0],!n)return this.emit("error",new Error("cannot set, no confs!"));return n[t]=e,this};Ft.prototype.get=function(t,e){return e?(e=this.sources[e],e&&(e=e.data),e&&Object.hasOwnProperty.call(e,t)?e[t]:void 0):this.list[0][t]};Ft.prototype.save=function(t,o,r){typeof o=="function"&&(r=o,o=null);var n=this.sources[t];if(!n||!(n.path||n.source)||!n.data)return this.emit("error",new Error("bad save target: "+t));if(n.source){var i=n.prefix||"";return Object.keys(n.data).forEach(function(a){n.source[i+a]=n.data[a]}),this}var o=o||n.type,s=n.data;return n.type==="json"?s=JSON.stringify(s):s=yb.stringify(s),this._saving++,Uh.writeFile(n.path,s,"utf8",function(a){if(this._saving--,a)return r?r(a):this.emit("error",a);this._saving===0&&(r&&r(),this.emit("save"))}.bind(this)),this};Ft.prototype.addFile=function(t,e,r){r=r||t;var n={__source__:r};return this.sources[r]={path:t,type:e},this.push(n),this._await(),Uh.readFile(t,"utf8",function(i,o){i&&this.emit("error",i),this.addString(o,t,e,n)}.bind(this)),this};Ft.prototype.addEnv=function(t,e,r){r=r||"env";var n=Nn.env(t,e);return this.sources[r]={data:n,source:e,prefix:t},this.add(n,r)};Ft.prototype.addUrl=function(t,e,r){this._await();var n=iae.format(t);r=r||n;var i={__source__:r};return this.sources[r]={href:n,type:e},this.push(i),oae.request(t,function(o){var s=[],a=o.headers["content-type"];e||(e=a.indexOf("json")!==-1?"json":a.indexOf("ini")!==-1?"ini":n.match(/\.json$/)?"json":n.match(/\.ini$/)?"ini":null,i.type=e),o.on("data",s.push.bind(s)).on("end",function(){this.addString(Buffer.concat(s),n,e,i)}.bind(this)).on("error",this.emit.bind(this,"error"))}.bind(this)).on("error",this.emit.bind(this,"error")).end(),this};Ft.prototype.addString=function(t,e,r,n){return t=this.parse(t,e,r),this.add(t,n),this};Ft.prototype.add=function(t,e){if(e&&typeof e=="object"){var r=this.list.indexOf(e);if(r===-1)return this.emit("error",new Error("bad marker"));this.splice(r,1,t),e=e.__source__,this.sources[e]=this.sources[e]||{},this.sources[e].data=t,this._resolve()}else typeof e=="string"&&(this.sources[e]=this.sources[e]||{},this.sources[e].data=t),this._await(),this.push(t),process.nextTick(this._resolve.bind(this));return this};Ft.prototype.parse=Nn.parse;Ft.prototype._await=function(){this._awaiting++};Ft.prototype._resolve=function(){this._awaiting--,this._awaiting===0&&this.emit("load",this)}});var u8=y((Cye,a8)=>{a8.exports=function(t){let e=t.indexOf(":");if(e===-1)return vb(t);let r=t.substr(0,e),n=t.substr(e+1);return`${vb(r)}:${vb(n)}`};function vb(t){if(t=t.toLowerCase(),t==="_authtoken")return"_authToken";let e=t[0];for(let r=1;r<t.length;r++)e+=t[r]==="_"?"-":t[r];return e}});var c8=y(Vh=>{"use strict";Object.defineProperty(Vh,"__esModule",{value:!0});Vh.envReplace=void 0;var uae=/(?<!\\)(\\*)\$\{([^${}]+)\}/g;function cae(t,e){return t.replace(uae,lae.bind(null,e))}Vh.envReplace=cae;function lae(t,e,r,n){if(r.length%2)return e.slice((r.length+1)/2);let i=dae(t,n);if(i===void 0)throw new Error(`Failed to replace env in config: ${e}`);return`${r.slice(r.length/2)}${i}`}var fae=/([^:-]+)(:?)-(.+)/;function dae(t,e){let r=e.match(fae);if(!r)return t[e];let[,n,i,o]=r;return Object.prototype.hasOwnProperty.call(t,n)?!t[n]&&i?o:t[n]:o}});var l8=y(Hh=>{"use strict";Object.defineProperty(Hh,"__esModule",{value:!0});Hh.envReplace=void 0;var hae=c8();Object.defineProperty(Hh,"envReplace",{enumerable:!0,get:function(){return hae.envReplace}})});var d8=y(zh=>{"use strict";var pae=require("fs"),Oo=require("path"),{envReplace:f8}=l8(),mae=(t,e,r)=>{if(typeof e!="string")return e;let n=[].concat(t[r]),i=n.indexOf(Oo)!==-1,o=n.indexOf(Boolean)!==-1,s=n.indexOf(String)!==-1,a=n.indexOf(Number)!==-1;if(e=`${e}`.trim(),/^".*"$/.test(e))try{e=JSON.parse(e)}catch{throw new Error(`Failed parsing JSON config key ${r}: ${e}`)}if(o&&!s&&e==="")return!0;switch(e){case"true":return!0;case"false":return!1;case"null":return null;case"undefined":return}return e=f8(e,process.env),i&&((process.platform==="win32"?/^~(\/|\\)/:/^~\//).test(e)&&process.env.HOME&&(e=Oo.resolve(process.env.HOME,e.substr(2))),e=Oo.resolve(e)),a&&!isNaN(e)&&(e=Number(e)),e},gae=t=>{t=Oo.resolve(t);let e=!1;for(;Oo.basename(t)==="node_modules";)t=Oo.dirname(t),e=!0;if(e)return t;let r=(n,i)=>{let o=/^[a-zA-Z]:(\\|\/)?$/;if(n==="/"||process.platform==="win32"&&o.test(n))return i;try{let s=pae.readdirSync(n);if(s.includes("node_modules")||s.includes("package.json")||s.includes("package.json5")||s.includes("package.yaml")||s.includes("pnpm-workspace.yaml"))return n;let a=Oo.dirname(n);return a===n?i:r(a,i)}catch(s){if(n===i){if(s.code==="ENOENT")return i;throw s}return i}};return r(t,t)};zh.envReplace=f8;zh.findPrefix=gae;zh.parseField=mae});var m8=y(p8=>{"use strict";var Ao=require("path"),yae=require("stream").Stream,Gh=require("url"),Dae=()=>{},vae=()=>[],h8=()=>{};p8.types={access:[null,"restricted","public"],"allow-same-version":Boolean,"always-auth":Boolean,also:[null,"dev","development"],audit:Boolean,"auth-type":["legacy","sso","saml","oauth"],"bin-links":Boolean,browser:[null,String],ca:[null,String,Array],cafile:Ao,cache:Ao,"cache-lock-stale":Number,"cache-lock-retries":Number,"cache-lock-wait":Number,"cache-max":Number,"cache-min":Number,cert:[null,String],cidr:[null,String,Array],color:["always",Boolean],depth:Number,description:Boolean,dev:Boolean,"dry-run":Boolean,editor:String,"engine-strict":Boolean,force:Boolean,"fetch-retries":Number,"fetch-retry-factor":Number,"fetch-retry-mintimeout":Number,"fetch-retry-maxtimeout":Number,git:String,"git-tag-version":Boolean,"commit-hooks":Boolean,global:Boolean,globalconfig:Ao,"global-style":Boolean,group:[Number,String],"https-proxy":[null,Gh],"user-agent":String,"ham-it-up":Boolean,heading:String,"if-present":Boolean,"ignore-prepublish":Boolean,"ignore-scripts":Boolean,"init-module":Ao,"init-author-name":String,"init-author-email":String,"init-author-url":["",Gh],"init-license":String,"init-version":h8,json:Boolean,key:[null,String],"legacy-bundling":Boolean,link:Boolean,"local-address":vae(),loglevel:["silent","error","warn","notice","http","timing","info","verbose","silly"],logstream:yae,"logs-max":Number,long:Boolean,maxsockets:Number,message:String,"metrics-registry":[null,String],"node-options":[null,String],"node-version":[null,h8],"no-proxy":[null,String,Array],offline:Boolean,"onload-script":[null,String],only:[null,"dev","development","prod","production"],optional:Boolean,"package-lock":Boolean,otp:[null,String],"package-lock-only":Boolean,parseable:Boolean,"prefer-offline":Boolean,"prefer-online":Boolean,prefix:Ao,production:Boolean,progress:Boolean,proxy:[null,!1,Gh],provenance:Boolean,"read-only":Boolean,"rebuild-bundle":Boolean,registry:[null,Gh],rollback:Boolean,save:Boolean,"save-bundle":Boolean,"save-dev":Boolean,"save-exact":Boolean,"save-optional":Boolean,"save-prefix":String,"save-prod":Boolean,scope:String,"script-shell":[null,String],"scripts-prepend-node-path":[!1,!0,"auto","warn-only"],searchopts:String,searchexclude:[null,String],searchlimit:Number,searchstaleness:Number,"send-metrics":Boolean,shell:String,shrinkwrap:Boolean,"sign-git-tag":Boolean,"sso-poll-frequency":Number,"sso-type":[null,"oauth","saml"],"strict-ssl":Boolean,tag:String,timing:Boolean,tmp:Ao,unicode:Boolean,"unsafe-perm":Boolean,usage:Boolean,user:[Number,String],userconfig:Ao,umask:Dae,version:Boolean,"tag-version-prefix":String,versions:Boolean,viewer:String,_exit:Boolean}});var v8=y((Aye,D8)=>{"use strict";var{readCAFileSync:bae}=Yj(),g8=require("fs"),bb=require("path"),{ConfigChain:wae}=s8(),_ae=u8(),y8=d8(),wb=class extends wae{constructor(e,r){super(e),this.root=e,this._parseField=y8.parseField.bind(null,r||m8())}add(e,r){try{for(let n of Object.keys(e))e[n]=this._parseField(e[n],n)}catch(n){throw n}return super.add(e,r)}addFile(e,r){r=r||e;let n={__source__:r};this.sources[r]={path:e,type:"ini"},this.push(n),this._await();try{let i=g8.readFileSync(e,"utf8");this.addString(i,e,"ini",n)}catch(i){if(i.code==="ENOENT")this.add({},n);else return`Issue while reading "${e}". ${i.message}`}}addEnv(e){e=e||process.env;let r={};return Object.keys(e).filter(n=>/^npm_config_/i.test(n)).forEach(n=>{e[n]&&(r[_ae(n.substr(11))]=e[n])}),super.addEnv("",r,"env")}loadPrefix(){let e=this.list[0];Object.defineProperty(this,"prefix",{enumerable:!0,set:n=>{let i=this.get("global");this[i?"globalPrefix":"localPrefix"]=n},get:()=>this.get("global")?this.globalPrefix:this.localPrefix}),Object.defineProperty(this,"globalPrefix",{enumerable:!0,set:n=>{this.set("prefix",n)},get:()=>bb.resolve(this.get("prefix"))});let r;if(Object.defineProperty(this,"localPrefix",{enumerable:!0,set:n=>{r=n},get:()=>r}),Object.prototype.hasOwnProperty.call(e,"prefix"))r=bb.resolve(e.prefix);else try{r=y8.findPrefix(process.cwd())}catch(n){throw n}return r}loadCAFile(e){if(!e)return;let r=bae(e);r&&this.set("ca",r)}loadUser(){let e=this.root;if(this.get("global"))return;if(process.env.SUDO_UID){e.user=Number(process.env.SUDO_UID);return}let r=bb.resolve(this.get("prefix"));try{let n=g8.statSync(r);e.user=n.uid}catch(n){if(n.code==="ENOENT")return;throw n}}};D8.exports=wb});var S8=y(C8=>{"use strict";var _8=require("os"),Ln=require("path"),E8=_8.tmpdir(),Eae=process.getuid?process.getuid():process.pid,Cae=()=>!0,b8=process.platform==="win32",w8={editor:()=>process.env.EDITOR||process.env.VISUAL||(b8?"notepad.exe":"vi"),shell:()=>b8?process.env.COMSPEC||"cmd.exe":process.env.SHELL||"/bin/bash"},Sae={fromString:()=>process.umask()},Ca=_8.homedir();Ca?process.env.HOME=Ca:Ca=Ln.resolve(E8,"npm-"+Eae);var xae=process.platform==="win32"?"npm-cache":".npm",Fae=process.platform==="win32"&&process.env.APPDATA||Ca,Oae=Ln.resolve(Fae,xae),Wh,ko;Object.defineProperty(C8,"defaults",{get:function(){return Wh||(process.env.PREFIX?ko=process.env.PREFIX:process.platform==="win32"?ko=Ln.dirname(process.execPath):(ko=Ln.dirname(Ln.dirname(process.execPath)),process.env.DESTDIR&&(ko=Ln.join(process.env.DESTDIR,ko))),Wh={access:null,"allow-same-version":!1,"always-auth":!1,also:null,audit:!0,"auth-type":"legacy","bin-links":!0,browser:null,ca:null,cafile:null,cache:Oae,"cache-lock-stale":6e4,"cache-lock-retries":10,"cache-lock-wait":1e4,"cache-max":1/0,"cache-min":10,cert:null,cidr:null,color:process.env.NO_COLOR==null,depth:1/0,description:!0,dev:!1,"dry-run":!1,editor:w8.editor(),"engine-strict":!1,force:!1,"fetch-retries":2,"fetch-retry-factor":10,"fetch-retry-mintimeout":1e4,"fetch-retry-maxtimeout":6e4,git:"git","git-tag-version":!0,"commit-hooks":!0,global:!1,globalconfig:Ln.resolve(ko,"etc","npmrc"),"global-style":!1,group:process.platform==="win32"?0:process.env.SUDO_GID||process.getgid&&process.getgid(),"ham-it-up":!1,heading:"npm","if-present":!1,"ignore-prepublish":!1,"ignore-scripts":!1,"init-module":Ln.resolve(Ca,".npm-init.js"),"init-author-name":"","init-author-email":"","init-author-url":"","init-version":"1.0.0","init-license":"ISC",json:!1,key:null,"legacy-bundling":!1,link:!1,"local-address":void 0,loglevel:"notice",logstream:process.stderr,"logs-max":10,long:!1,maxsockets:50,message:"%s","metrics-registry":null,"node-options":null,offline:!1,"onload-script":!1,only:null,optional:!0,otp:null,"package-lock":!0,"package-lock-only":!1,parseable:!1,"prefer-offline":!1,"prefer-online":!1,prefix:ko,production:process.env.NODE_ENV==="production",progress:!process.env.TRAVIS&&!process.env.CI,provenance:!1,proxy:null,"https-proxy":null,"no-proxy":null,"user-agent":"npm/{npm-version} node/{node-version} {platform} {arch}","read-only":!1,"rebuild-bundle":!0,registry:"https://registry.npmjs.org/",rollback:!0,save:!0,"save-bundle":!1,"save-dev":!1,"save-exact":!1,"save-optional":!1,"save-prefix":"^","save-prod":!1,scope:"","script-shell":null,"scripts-prepend-node-path":"warn-only",searchopts:"",searchexclude:null,searchlimit:20,searchstaleness:15*60,"send-metrics":!1,shell:w8.shell(),shrinkwrap:!0,"sign-git-tag":!1,"sso-poll-frequency":500,"sso-type":"oauth","strict-ssl":!0,tag:"latest","tag-version-prefix":"v",timing:!1,tmp:E8,unicode:Cae(),"unsafe-perm":process.platform==="win32"||process.platform==="cygwin"||!(process.getuid&&process.setuid&&process.getgid&&process.setgid)||process.getuid()!==0,usage:!1,user:process.platform==="win32"?0:"nobody",userconfig:Ln.resolve(Ca,".npmrc"),umask:process.umask?process.umask():Sae.fromString("022"),version:!1,versions:!1,viewer:process.platform==="win32"?"browser":"man",_exit:!0},Wh)}})});var F8=y((Tye,_b)=>{"use strict";var To=require("path"),Aae=v8(),x8=S8();_b.exports=(t,e,r)=>{let n=new Aae(Object.assign({},x8.defaults,r),e);n.add(Object.assign({},t),"cli");let i=[],o=!1;if(require.resolve.paths){let c=require.resolve.paths("npm"),l;try{l=require.resolve("npm",{paths:c.slice(-1)})}catch{o=!0}l&&i.push(n.addFile(To.resolve(To.dirname(l),"..","npmrc"),"builtin"))}n.addEnv(),n.loadPrefix();let s=To.resolve(n.localPrefix,".npmrc"),a=n.get("userconfig");if(!n.get("global")&&s!==a?i.push(n.addFile(s,"project")):n.add({},"project"),n.get("workspace-prefix")&&n.get("workspace-prefix")!==s){let c=To.resolve(n.get("workspace-prefix"),".npmrc");i.push(n.addFile(c,"workspace"))}if(i.push(n.addFile(n.get("userconfig"),"user")),n.get("prefix")){let c=To.resolve(n.get("prefix"),"etc");n.root.globalconfig=To.resolve(c,"npmrc"),n.root.globalignorefile=To.resolve(c,"npmignore")}i.push(n.addFile(n.get("globalconfig"),"global")),n.loadUser();let u=n.get("cafile");return u&&n.loadCAFile(u),{config:n,warnings:i.filter(Boolean),failedToLoadBuiltInConfig:o}};Object.defineProperty(_b.exports,"defaults",{get(){return x8.defaults},enumerable:!0})});var I8=y((Pye,$8)=>{var Eb=require("url"),O8=F8(),A8=":_authToken",k8=":_auth",T8=":username",P8=":_password";$8.exports=function(){let e,r;arguments.length>=2?(e=arguments[0],r=Object.assign({},arguments[1])):typeof arguments[0]=="string"?e=arguments[0]:r=Object.assign({},arguments[0]),r=r||{};let n=r.npmrc;return r.npmrc=(r.npmrc?{config:{get:i=>n[i]}}:O8()).config,e=e||r.npmrc.get("registry")||O8.defaults.registry,R8(e,r)||kae(r.npmrc)};function R8(t,e){let r=Eb.parse(t,!1,!0),n;for(;n!=="/"&&r.pathname!==n;){n=r.pathname||"/";let i="//"+r.host+n.replace(/\/$/,""),o=Pae(i,e.npmrc);if(o)return o;if(!e.recursive)return/\/$/.test(t)?void 0:R8(Eb.resolve(t,"."),e);r.pathname=Eb.resolve(Tae(n),"..")||"/"}}function kae(t){return t.get("_auth")?{token:Kh(t.get("_auth")),type:"Basic"}:void 0}function Tae(t){return t[t.length-1]==="/"?t:t+"/"}function Pae(t,e){let r=Rae(e.get(t+A8)||e.get(t+"/"+A8));if(r)return r;let n=e.get(t+T8)||e.get(t+"/"+T8),i=e.get(t+P8)||e.get(t+"/"+P8),o=$ae(n,i);if(o)return o;let s=Iae(e.get(t+k8)||e.get(t+"/"+k8));if(s)return s}function Kh(t){return t.replace(/^\$\{?([^}]*)\}?$/,function(e,r){return process.env[r]})}function Rae(t){return t?{token:Kh(t),type:"Bearer"}:void 0}function $ae(t,e){if(!t||!e)return;let r=Buffer.from(Kh(e),"base64").toString("utf8");return{token:Buffer.from(t+":"+r,"utf8").toString("base64"),type:"Basic",password:r,username:t}}function Iae(t){return t?{token:Kh(t),type:"Basic"}:void 0}});var jL=y((Nwe,Vn)=>{var ot=require("fs"),Qb=require("os"),fr=require("path"),wL=require("crypto"),ln={fs:ot.constants,os:Qb.constants},_L="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",CL=/XXXXXX/,wue=3,SL=(ln.O_CREAT||ln.fs.O_CREAT)|(ln.O_EXCL||ln.fs.O_EXCL)|(ln.O_RDWR||ln.fs.O_RDWR),_ue=Qb.platform()==="win32",Eue=ln.EBADF||ln.os.errno.EBADF,Cue=ln.ENOENT||ln.os.errno.ENOENT,xL=448,FL=384,Sue="exit",Ra=[],OL=ot.rmdirSync.bind(ot),AL=!1;function xue(t,e){return ot.rm(t,{recursive:!0},e)}function kL(t){return ot.rmSync(t,{recursive:!0})}function ew(t,e){let r=$a(t,e),n=r[0],i=r[1];try{RL(n)}catch(s){return i(s)}let o=n.tries;(function s(){try{let a=PL(n);ot.stat(a,function(u){if(!u)return o-- >0?s():i(new Error("Could not get a unique tmp filename, max tries reached "+a));i(null,a)})}catch(a){i(a)}})()}function tw(t){let e=$a(t),r=e[0];RL(r);let n=r.tries;do{let i=PL(r);try{ot.statSync(i)}catch{return i}}while(n-- >0);throw new Error("Could not get a unique tmp filename, max tries reached")}function Fue(t,e){let r=$a(t,e),n=r[0],i=r[1];ew(n,function(s,a){if(s)return i(s);ot.open(a,SL,n.mode||FL,function(c,l){if(c)return i(c);if(n.discardDescriptor)return ot.close(l,function(h){return i(h,a,void 0,Jb(a,-1,n,!1))});{let f=n.discardDescriptor||n.detachDescriptor;i(null,a,l,Jb(a,f?-1:l,n,!1))}})})}function Oue(t){let e=$a(t),r=e[0],n=r.discardDescriptor||r.detachDescriptor,i=tw(r);var o=ot.openSync(i,SL,r.mode||FL);return r.discardDescriptor&&(ot.closeSync(o),o=void 0),{name:i,fd:o,removeCallback:Jb(i,n?-1:o,r,!0)}}function Aue(t,e){let r=$a(t,e),n=r[0],i=r[1];ew(n,function(s,a){if(s)return i(s);ot.mkdir(a,n.mode||xL,function(c){if(c)return i(c);i(null,a,TL(a,n,!1))})})}function kue(t){let e=$a(t),r=e[0],n=tw(r);return ot.mkdirSync(n,r.mode||xL),{name:n,removeCallback:TL(n,r,!0)}}function Tue(t,e){let r=function(n){if(n&&!Zb(n))return e(n);e()};0<=t[0]?ot.close(t[0],function(){ot.unlink(t[1],r)}):ot.unlink(t[1],r)}function Pue(t){let e=null;try{0<=t[0]&&ot.closeSync(t[0])}catch(r){if(!Iue(r)&&!Zb(r))throw r}finally{try{ot.unlinkSync(t[1])}catch(r){Zb(r)||(e=r)}}if(e!==null)throw e}function Jb(t,e,r,n){let i=yp(Pue,[e,t],n),o=yp(Tue,[e,t],n,i);return r.keep||Ra.unshift(i),n?i:o}function TL(t,e,r){let n=e.unsafeCleanup?xue:ot.rmdir.bind(ot),i=e.unsafeCleanup?kL:OL,o=yp(i,t,r),s=yp(n,t,r,o);return e.keep||Ra.unshift(o),r?o:s}function yp(t,e,r,n){let i=!1;return function o(s){if(!i){let a=n||o,u=Ra.indexOf(a);return u>=0&&Ra.splice(u,1),i=!0,r||t===OL||t===kL?t(e):t(e,s||function(){})}}}function Rue(){if(AL)for(;Ra.length;)try{Ra[0]()}catch{}}function EL(t){let e=[],r=null;try{r=wL.randomBytes(t)}catch{r=wL.pseudoRandomBytes(t)}for(var n=0;n<t;n++)e.push(_L[r[n]%_L.length]);return e.join("")}function $ue(t){return t===null||tr(t)||!t.trim()}function tr(t){return typeof t>"u"}function $a(t,e){if(typeof t=="function")return[{},t];if(tr(t))return[{},e];let r={};for(let n of Object.getOwnPropertyNames(t))r[n]=t[n];return[r,e]}function PL(t){let e=t.tmpdir;if(!tr(t.name))return fr.join(e,t.dir,t.name);if(!tr(t.template))return fr.join(e,t.dir,t.template).replace(CL,EL(6));let r=[t.prefix?t.prefix:"tmp","-",process.pid,"-",EL(12),t.postfix?"-"+t.postfix:""].join("");return fr.join(e,t.dir,r)}function RL(t){t.tmpdir=IL(t);let e=t.tmpdir;if(tr(t.name)||Yb(t.name,"name",e),tr(t.dir)||Yb(t.dir,"dir",e),!tr(t.template)&&(Yb(t.template,"template",e),!t.template.match(CL)))throw new Error(`Invalid template, found "${t.template}".`);if(!tr(t.tries)&&isNaN(t.tries)||t.tries<0)throw new Error(`Invalid tries, found "${t.tries}".`);t.tries=tr(t.name)?t.tries||wue:1,t.keep=!!t.keep,t.detachDescriptor=!!t.detachDescriptor,t.discardDescriptor=!!t.discardDescriptor,t.unsafeCleanup=!!t.unsafeCleanup,t.dir=tr(t.dir)?"":fr.relative(e,Xb(t.dir,e)),t.template=tr(t.template)?void 0:fr.relative(e,Xb(t.template,e)),t.template=$ue(t.template)?void 0:fr.relative(t.dir,t.template),t.name=tr(t.name)?void 0:t.name,t.prefix=tr(t.prefix)?"":t.prefix,t.postfix=tr(t.postfix)?"":t.postfix}function Xb(t,e){return t.startsWith(e)?fr.resolve(t):fr.resolve(fr.join(e,t))}function Yb(t,e,r){if(e==="name"){if(fr.isAbsolute(t))throw new Error(`${e} option must not contain an absolute path, found "${t}".`);let n=fr.basename(t);if(n===".."||n==="."||n!==t)throw new Error(`${e} option must not contain a path, found "${t}".`)}else{if(fr.isAbsolute(t)&&!t.startsWith(r))throw new Error(`${e} option must be relative to "${r}", found "${t}".`);let n=Xb(t,r);if(!n.startsWith(r))throw new Error(`${e} option must be relative to "${r}", found "${n}".`)}}function Iue(t){return $L(t,-Eue,"EBADF")}function Zb(t){return $L(t,-Cue,"ENOENT")}function $L(t,e,r){return _ue?t.code===r:t.code===r&&t.errno===e}function jue(){AL=!0}function IL(t){return fr.resolve(t&&t.tmpdir||Qb.tmpdir())}process.addListener(Sue,Rue);Object.defineProperty(Vn.exports,"tmpdir",{enumerable:!0,configurable:!1,get:function(){return IL()}});Vn.exports.dir=Aue;Vn.exports.dirSync=kue;Vn.exports.file=Fue;Vn.exports.fileSync=Oue;Vn.exports.tmpName=ew;Vn.exports.tmpNameSync=tw;Vn.exports.setGracefulCleanup=jue});var _w=ce(ww(),1),{program:A,createCommand:pce,createArgument:mce,createOption:gce,CommanderError:yce,InvalidArgumentError:Dce,InvalidOptionArgumentError:vce,Command:bce,Argument:wce,Option:_ce,Help:Ece}=_w.default;var Ir={name:"@capgo/cli",version:"4.26.12",description:"A CLI to upload to capgo servers",author:"github.com/riderx",license:"Apache 2.0",homepage:"https://github.com/Cap-go/CLIl#readme",repository:{type:"git",url:"git+https://github.com/Cap-go/CLI.git"},bugs:{url:"https://github.com/Cap-go/CLI/issues"},keywords:["appflow alternative","ionic","capacitor","auto update","live update","capgo","cli","upload","capgo-cli"],main:"dist/index.js",bin:{capgo:"dist/index.js"},engines:{npm:">=8.0.0",node:">=20.0.0"},scripts:{build:"tsc && node build.mjs",dev:"NODE_ENV=development ncc build","no-debug":"node dist/index.js",test:"npx --yes ts-node -T src/index.ts","dev-build":"SUPA_DB=development ncc build",pack:"pkg",types:"npx --yes supabase gen types typescript --project-id=xvwzpoazmxkqosrdewyv > src/types/supabase.types.ts",test_rls:"ts-node ./test/test_headers_rls.ts",lint:'eslint "src/**/*.ts" --fix',"check-posix-paths":"node test/check-posix-paths.js"},devDependencies:{"@antfu/eslint-config":"^3.9.2","@bradenmacdonald/s3-lite-client":"npm:@jsr/bradenmacdonald__s3-lite-client","@capacitor/cli":"^6.2.0","@capgo/find-package-manager":"^0.0.17","@clack/prompts":"^0.8.1","@sauber/table":"npm:@jsr/sauber__table","@std/semver":"npm:@jsr/std__semver","@supabase/supabase-js":"^2.46.0","@tomasklaen/checksum":"^1.1.0","@types/adm-zip":"^0.5.6","@types/node":"^22.8.4","@types/prettyjson":"^0.0.33","@types/semver":"7.5.8","@types/tmp":"^0.2.6","@typescript-eslint/eslint-plugin":"^8.15.0","@typescript-eslint/parser":"^8.15.0","@vercel/ncc":"^0.38.3","adm-zip":"^0.5.16","ci-info":"^4.1.0",commander:"12.1.0",esbuild:"^0.24.0",eslint:"9.16.0","git-format-staged":"3.1.1",husky:"^9.1.7","is-wsl":"^3.1.0",ky:"^1.7.2","latest-version":"^9.0.0",open:"^10.1.0",pkg:"5.8.1",prettyjson:"^1.2.5",semver:"^7.6.3",tmp:"^0.2.3","ts-loader":"^9.5.1","ts-node":"^10.9.2","tsconfig-paths":"4.2.0","tus-js-client":"^4.2.3",typescript:"5.7.2"}};var Sa=require("node:fs"),L8=require("node:process");var At=ce(Te(),1),Lo=require("node:process"),Gn=ce(require("node:readline"),1),Vp=ce(require("node:readline"),1),$w=require("node:tty"),cl=ce(qp(),1);function xB({onlyFirst:t=!1}={}){let e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(e,t?void 0:"g")}function Iw(t){if(typeof t!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);return t.replace(xB(),"")}function jw(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Nw={exports:{}};(function(t){var e={};t.exports=e,e.eastAsianWidth=function(n){var i=n.charCodeAt(0),o=n.length==2?n.charCodeAt(1):0,s=i;return 55296<=i&&i<=56319&&56320<=o&&o<=57343&&(i&=1023,o&=1023,s=i<<10|o,s+=65536),s==12288||65281<=s&&s<=65376||65504<=s&&s<=65510?"F":s==8361||65377<=s&&s<=65470||65474<=s&&s<=65479||65482<=s&&s<=65487||65490<=s&&s<=65495||65498<=s&&s<=65500||65512<=s&&s<=65518?"H":4352<=s&&s<=4447||4515<=s&&s<=4519||4602<=s&&s<=4607||9001<=s&&s<=9002||11904<=s&&s<=11929||11931<=s&&s<=12019||12032<=s&&s<=12245||12272<=s&&s<=12283||12289<=s&&s<=12350||12353<=s&&s<=12438||12441<=s&&s<=12543||12549<=s&&s<=12589||12593<=s&&s<=12686||12688<=s&&s<=12730||12736<=s&&s<=12771||12784<=s&&s<=12830||12832<=s&&s<=12871||12880<=s&&s<=13054||13056<=s&&s<=19903||19968<=s&&s<=42124||42128<=s&&s<=42182||43360<=s&&s<=43388||44032<=s&&s<=55203||55216<=s&&s<=55238||55243<=s&&s<=55291||63744<=s&&s<=64255||65040<=s&&s<=65049||65072<=s&&s<=65106||65108<=s&&s<=65126||65128<=s&&s<=65131||110592<=s&&s<=110593||127488<=s&&s<=127490||127504<=s&&s<=127546||127552<=s&&s<=127560||127568<=s&&s<=127569||131072<=s&&s<=194367||177984<=s&&s<=196605||196608<=s&&s<=262141?"W":32<=s&&s<=126||162<=s&&s<=163||165<=s&&s<=166||s==172||s==175||10214<=s&&s<=10221||10629<=s&&s<=10630?"Na":s==161||s==164||167<=s&&s<=168||s==170||173<=s&&s<=174||176<=s&&s<=180||182<=s&&s<=186||188<=s&&s<=191||s==198||s==208||215<=s&&s<=216||222<=s&&s<=225||s==230||232<=s&&s<=234||236<=s&&s<=237||s==240||242<=s&&s<=243||247<=s&&s<=250||s==252||s==254||s==257||s==273||s==275||s==283||294<=s&&s<=295||s==299||305<=s&&s<=307||s==312||319<=s&&s<=322||s==324||328<=s&&s<=331||s==333||338<=s&&s<=339||358<=s&&s<=359||s==363||s==462||s==464||s==466||s==468||s==470||s==472||s==474||s==476||s==593||s==609||s==708||s==711||713<=s&&s<=715||s==717||s==720||728<=s&&s<=731||s==733||s==735||768<=s&&s<=879||913<=s&&s<=929||931<=s&&s<=937||945<=s&&s<=961||963<=s&&s<=969||s==1025||1040<=s&&s<=1103||s==1105||s==8208||8211<=s&&s<=8214||8216<=s&&s<=8217||8220<=s&&s<=8221||8224<=s&&s<=8226||8228<=s&&s<=8231||s==8240||8242<=s&&s<=8243||s==8245||s==8251||s==8254||s==8308||s==8319||8321<=s&&s<=8324||s==8364||s==8451||s==8453||s==8457||s==8467||s==8470||8481<=s&&s<=8482||s==8486||s==8491||8531<=s&&s<=8532||8539<=s&&s<=8542||8544<=s&&s<=8555||8560<=s&&s<=8569||s==8585||8592<=s&&s<=8601||8632<=s&&s<=8633||s==8658||s==8660||s==8679||s==8704||8706<=s&&s<=8707||8711<=s&&s<=8712||s==8715||s==8719||s==8721||s==8725||s==8730||8733<=s&&s<=8736||s==8739||s==8741||8743<=s&&s<=8748||s==8750||8756<=s&&s<=8759||8764<=s&&s<=8765||s==8776||s==8780||s==8786||8800<=s&&s<=8801||8804<=s&&s<=8807||8810<=s&&s<=8811||8814<=s&&s<=8815||8834<=s&&s<=8835||8838<=s&&s<=8839||s==8853||s==8857||s==8869||s==8895||s==8978||9312<=s&&s<=9449||9451<=s&&s<=9547||9552<=s&&s<=9587||9600<=s&&s<=9615||9618<=s&&s<=9621||9632<=s&&s<=9633||9635<=s&&s<=9641||9650<=s&&s<=9651||9654<=s&&s<=9655||9660<=s&&s<=9661||9664<=s&&s<=9665||9670<=s&&s<=9672||s==9675||9678<=s&&s<=9681||9698<=s&&s<=9701||s==9711||9733<=s&&s<=9734||s==9737||9742<=s&&s<=9743||9748<=s&&s<=9749||s==9756||s==9758||s==9792||s==9794||9824<=s&&s<=9825||9827<=s&&s<=9829||9831<=s&&s<=9834||9836<=s&&s<=9837||s==9839||9886<=s&&s<=9887||9918<=s&&s<=9919||9924<=s&&s<=9933||9935<=s&&s<=9953||s==9955||9960<=s&&s<=9983||s==10045||s==10071||10102<=s&&s<=10111||11093<=s&&s<=11097||12872<=s&&s<=12879||57344<=s&&s<=63743||65024<=s&&s<=65039||s==65533||127232<=s&&s<=127242||127248<=s&&s<=127277||127280<=s&&s<=127337||127344<=s&&s<=127386||917760<=s&&s<=917999||983040<=s&&s<=1048573||1048576<=s&&s<=1114109?"A":"N"},e.characterLength=function(n){var i=this.eastAsianWidth(n);return i=="F"||i=="W"||i=="A"?2:1};function r(n){return n.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}e.length=function(n){for(var i=r(n),o=0,s=0;s<i.length;s++)o=o+this.characterLength(i[s]);return o},e.slice=function(n,i,o){textLen=e.length(n),i=i||0,o=o||1,i<0&&(i=textLen+i),o<0&&(o=textLen+o);for(var s="",a=0,u=r(n),c=0;c<u.length;c++){var l=u[c],f=e.length(l);if(a>=i-(f==2?1:0))if(a+f<=o)s+=l;else break;a+=f}return s}})(Nw);var FB=Nw.exports,OB=jw(FB),AB=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},kB=jw(AB);function La(t,e={}){if(typeof t!="string"||t.length===0||(e={ambiguousIsNarrow:!0,...e},t=Iw(t),t.length===0))return 0;t=t.replace(kB()," ");let r=e.ambiguousIsNarrow?1:2,n=0;for(let i of t){let o=i.codePointAt(0);if(!(o<=31||o>=127&&o<=159||o>=768&&o<=879))switch(OB.eastAsianWidth(i)){case"F":case"W":n+=2;break;case"A":n+=r;break;default:n+=1}}return n}var Mp=10,xw=(t=0)=>e=>`\x1B[${e+t}m`,Fw=(t=0)=>e=>`\x1B[${38+t};5;${e}m`,Ow=(t=0)=>(e,r,n)=>`\x1B[${38+t};2;${e};${r};${n}m`,Ie={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(Ie.modifier);var TB=Object.keys(Ie.color),PB=Object.keys(Ie.bgColor);[...TB,...PB];function RB(){let t=new Map;for(let[e,r]of Object.entries(Ie)){for(let[n,i]of Object.entries(r))Ie[n]={open:`\x1B[${i[0]}m`,close:`\x1B[${i[1]}m`},r[n]=Ie[n],t.set(i[0],i[1]);Object.defineProperty(Ie,e,{value:r,enumerable:!1})}return Object.defineProperty(Ie,"codes",{value:t,enumerable:!1}),Ie.color.close="\x1B[39m",Ie.bgColor.close="\x1B[49m",Ie.color.ansi=xw(),Ie.color.ansi256=Fw(),Ie.color.ansi16m=Ow(),Ie.bgColor.ansi=xw(Mp),Ie.bgColor.ansi256=Fw(Mp),Ie.bgColor.ansi16m=Ow(Mp),Object.defineProperties(Ie,{rgbToAnsi256:{value:(e,r,n)=>e===r&&r===n?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5),enumerable:!1},hexToRgb:{value:e=>{let r=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!r)return[0,0,0];let[n]=r;n.length===3&&(n=[...n].map(o=>o+o).join(""));let i=Number.parseInt(n,16);return[i>>16&255,i>>8&255,i&255]},enumerable:!1},hexToAnsi256:{value:e=>Ie.rgbToAnsi256(...Ie.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value:e=>{if(e<8)return 30+e;if(e<16)return 90+(e-8);let r,n,i;if(e>=232)r=((e-232)*10+8)/255,n=r,i=r;else{e-=16;let a=e%36;r=Math.floor(e/36)/5,n=Math.floor(a/6)/5,i=a%6/5}let o=Math.max(r,n,i)*2;if(o===0)return 30;let s=30+(Math.round(i)<<2|Math.round(n)<<1|Math.round(r));return o===2&&(s+=60),s},enumerable:!1},rgbToAnsi:{value:(e,r,n)=>Ie.ansi256ToAnsi(Ie.rgbToAnsi256(e,r,n)),enumerable:!1},hexToAnsi:{value:e=>Ie.ansi256ToAnsi(Ie.hexToAnsi256(e)),enumerable:!1}}),Ie}var $B=RB(),dl=new Set(["\x1B","\x9B"]),IB=39,Hp="\x07",Lw="[",jB="]",Bw="m",zp=`${jB}8;;`,Aw=t=>`${dl.values().next().value}${Lw}${t}${Bw}`,kw=t=>`${dl.values().next().value}${zp}${t}${Hp}`,NB=t=>t.split(" ").map(e=>La(e)),Up=(t,e,r)=>{let n=[...e],i=!1,o=!1,s=La(Iw(t[t.length-1]));for(let[a,u]of n.entries()){let c=La(u);if(s+c<=r?t[t.length-1]+=u:(t.push(u),s=0),dl.has(u)&&(i=!0,o=n.slice(a+1).join("").startsWith(zp)),i){o?u===Hp&&(i=!1,o=!1):u===Bw&&(i=!1);continue}s+=c,s===r&&a<n.length-1&&(t.push(""),s=0)}!s&&t[t.length-1].length>0&&t.length>1&&(t[t.length-2]+=t.pop())},LB=t=>{let e=t.split(" "),r=e.length;for(;r>0&&!(La(e[r-1])>0);)r--;return r===e.length?t:e.slice(0,r).join(" ")+e.slice(r).join("")},BB=(t,e,r={})=>{if(r.trim!==!1&&t.trim()==="")return"";let n="",i,o,s=NB(t),a=[""];for(let[c,l]of t.split(" ").entries()){r.trim!==!1&&(a[a.length-1]=a[a.length-1].trimStart());let f=La(a[a.length-1]);if(c!==0&&(f>=e&&(r.wordWrap===!1||r.trim===!1)&&(a.push(""),f=0),(f>0||r.trim===!1)&&(a[a.length-1]+=" ",f++)),r.hard&&s[c]>e){let h=e-f,d=1+Math.floor((s[c]-h-1)/e);Math.floor((s[c]-1)/e)<d&&a.push(""),Up(a,l,e);continue}if(f+s[c]>e&&f>0&&s[c]>0){if(r.wordWrap===!1&&f<e){Up(a,l,e);continue}a.push("")}if(f+s[c]>e&&r.wordWrap===!1){Up(a,l,e);continue}a[a.length-1]+=l}r.trim!==!1&&(a=a.map(c=>LB(c)));let u=[...a.join(`
201
- `)];for(let[c,l]of u.entries()){if(n+=l,dl.has(l)){let{groups:h}=new RegExp(`(?:\\${Lw}(?<code>\\d+)m|\\${zp}(?<uri>.*)${Hp})`).exec(u.slice(c).join(""))||{groups:{}};if(h.code!==void 0){let d=Number.parseFloat(h.code);i=d===IB?void 0:d}else h.uri!==void 0&&(o=h.uri.length===0?void 0:h.uri)}let f=$B.codes.get(Number(i));u[c+1]===`
200
+ `}):u&&typeof u=="object"?r.push(o):n+=Ea(o)+i+Ea(u)+gb}),e.section&&n.length&&(n="["+Ea(e.section)+"]"+gb+n),r.forEach(function(o,s,a){var u=e8(o).join("\\."),c=(e.section?e.section+".":"")+u,l=Qj(t[o],{section:c,whitespace:e.whitespace});n.length&&l.length&&(n+=gb),n+=l}),n}function e8(t){return t.replace(/\1/g,"LITERAL\\1LITERAL").replace(/\\\./g,"").split(/\./).map(function(e){return e.replace(/\1/g,"\\.").replace(/\2LITERAL\\1LITERAL\2/g,"")})}function nae(t){var e={},r=e,n=null,i=/^\[([^\]]*)\]$|^([^=]+)(=(.*))?$/i,o=t.split(/[\r\n]+/g);return o.forEach(function(s,a,u){if(!(!s||s.match(/^\s*[;#]/))){var c=s.match(i);if(c){if(c[1]!==void 0){if(n=Bh(c[1]),n==="__proto__"){r={};return}r=e[n]=e[n]||{};return}var l=Bh(c[2]);if(l!=="__proto__"){var f=c[3]?Bh(c[4]):!0;switch(f){case"true":case"false":case"null":f=JSON.parse(f)}if(l.length>2&&l.slice(-2)==="[]"){if(l=l.substring(0,l.length-2),l==="__proto__")return;r[l]?Array.isArray(r[l])||(r[l]=[r[l]]):r[l]=[]}Array.isArray(r[l])?r[l].push(f):r[l]=f}}}}),Object.keys(e).filter(function(s,a,u){if(!e[s]||typeof e[s]!="object"||Array.isArray(e[s]))return!1;var c=e8(s),l=e,f=c.pop(),h=f.replace(/\\\./g,".");return c.forEach(function(d,p,v){d!=="__proto__"&&((!l[d]||typeof l[d]!="object")&&(l[d]={}),l=l[d])}),l===e&&h===f?!1:(l[h]=e[s],!0)}).forEach(function(s,a,u){delete e[s]}),e}function t8(t){return t.charAt(0)==='"'&&t.slice(-1)==='"'||t.charAt(0)==="'"&&t.slice(-1)==="'"}function Ea(t){return typeof t!="string"||t.match(/[=\r\n]/)||t.match(/^\[/)||t.length>1&&t8(t)||t!==t.trim()?JSON.stringify(t):t.replace(/;/g,"\\;").replace(/#/g,"\\#")}function Bh(t,e){if(t=(t||"").trim(),t8(t)){t.charAt(0)==="'"&&(t=t.substr(1,t.length-2));try{t=JSON.parse(t)}catch{}}else{for(var r=!1,n="",i=0,o=t.length;i<o;i++){var s=t.charAt(i);if(r)"\\;#".indexOf(s)!==-1?n+=s:n+="\\"+s,r=!1;else{if(";#".indexOf(s)!==-1)break;s==="\\"?r=!0:n+=s}}return r&&(n+="\\"),n.trim()}return t}});var s8=y((Nn,o8)=>{var n8=Zj(),Bc=require("path"),qh=require("fs"),yb=r8(),Db=require("events").EventEmitter,iae=require("url"),oae=require("http"),Nn=o8.exports=function(){for(var t=[].slice.call(arguments),e=new Ft;t.length;){var r=t.shift();r&&e.push(typeof r=="string"?aae(r):r)}return e},_ye=Nn.find=function(){var t=Bc.join.apply(null,[].slice.call(arguments));function e(r,n){var i=Bc.join(r,n);try{return qh.statSync(i),i}catch{if(Bc.dirname(r)!==r)return e(Bc.dirname(r),n)}}return e(__dirname,t)},sae=Nn.parse=function(t,e,r){if(t=""+t,r)if(r==="json")if(this.emit)try{return JSON.parse(t)}catch(n){this.emit("error",n)}else return JSON.parse(t);else return yb.parse(t);else try{return JSON.parse(t)}catch{return yb.parse(t)}},aae=Nn.json=function(){var t=[].slice.call(arguments).filter(function(n){return n!=null}),e=Bc.join.apply(null,t),r;try{r=qh.readFileSync(e,"utf-8")}catch{return}return sae(r,e,"json")},Eye=Nn.env=function(t,e){e=e||process.env;var r={},n=t.length;for(var i in e)i.indexOf(t)===0&&(r[i.substring(n)]=e[i]);return r};Nn.ConfigChain=Ft;function Ft(){Db.apply(this),n8.apply(this,arguments),this._awaiting=0,this._saving=0,this.sources={}}var i8={constructor:{value:Ft}};Object.keys(Db.prototype).forEach(function(t){i8[t]=Object.getOwnPropertyDescriptor(Db.prototype,t)});Ft.prototype=Object.create(n8.prototype,i8);Ft.prototype.del=function(t,e){if(e){var r=this.sources[e];if(r=r&&r.data,!r)return this.emit("error",new Error("not found "+e));delete r[t]}else for(var n=0,i=this.list.length;n<i;n++)delete this.list[n][t];return this};Ft.prototype.set=function(t,e,r){var n;if(r){if(n=this.sources[r],n=n&&n.data,!n)return this.emit("error",new Error("not found "+r))}else if(n=this.list[0],!n)return this.emit("error",new Error("cannot set, no confs!"));return n[t]=e,this};Ft.prototype.get=function(t,e){return e?(e=this.sources[e],e&&(e=e.data),e&&Object.hasOwnProperty.call(e,t)?e[t]:void 0):this.list[0][t]};Ft.prototype.save=function(t,o,r){typeof o=="function"&&(r=o,o=null);var n=this.sources[t];if(!n||!(n.path||n.source)||!n.data)return this.emit("error",new Error("bad save target: "+t));if(n.source){var i=n.prefix||"";return Object.keys(n.data).forEach(function(a){n.source[i+a]=n.data[a]}),this}var o=o||n.type,s=n.data;return n.type==="json"?s=JSON.stringify(s):s=yb.stringify(s),this._saving++,qh.writeFile(n.path,s,"utf8",function(a){if(this._saving--,a)return r?r(a):this.emit("error",a);this._saving===0&&(r&&r(),this.emit("save"))}.bind(this)),this};Ft.prototype.addFile=function(t,e,r){r=r||t;var n={__source__:r};return this.sources[r]={path:t,type:e},this.push(n),this._await(),qh.readFile(t,"utf8",function(i,o){i&&this.emit("error",i),this.addString(o,t,e,n)}.bind(this)),this};Ft.prototype.addEnv=function(t,e,r){r=r||"env";var n=Nn.env(t,e);return this.sources[r]={data:n,source:e,prefix:t},this.add(n,r)};Ft.prototype.addUrl=function(t,e,r){this._await();var n=iae.format(t);r=r||n;var i={__source__:r};return this.sources[r]={href:n,type:e},this.push(i),oae.request(t,function(o){var s=[],a=o.headers["content-type"];e||(e=a.indexOf("json")!==-1?"json":a.indexOf("ini")!==-1?"ini":n.match(/\.json$/)?"json":n.match(/\.ini$/)?"ini":null,i.type=e),o.on("data",s.push.bind(s)).on("end",function(){this.addString(Buffer.concat(s),n,e,i)}.bind(this)).on("error",this.emit.bind(this,"error"))}.bind(this)).on("error",this.emit.bind(this,"error")).end(),this};Ft.prototype.addString=function(t,e,r,n){return t=this.parse(t,e,r),this.add(t,n),this};Ft.prototype.add=function(t,e){if(e&&typeof e=="object"){var r=this.list.indexOf(e);if(r===-1)return this.emit("error",new Error("bad marker"));this.splice(r,1,t),e=e.__source__,this.sources[e]=this.sources[e]||{},this.sources[e].data=t,this._resolve()}else typeof e=="string"&&(this.sources[e]=this.sources[e]||{},this.sources[e].data=t),this._await(),this.push(t),process.nextTick(this._resolve.bind(this));return this};Ft.prototype.parse=Nn.parse;Ft.prototype._await=function(){this._awaiting++};Ft.prototype._resolve=function(){this._awaiting--,this._awaiting===0&&this.emit("load",this)}});var u8=y((Cye,a8)=>{a8.exports=function(t){let e=t.indexOf(":");if(e===-1)return vb(t);let r=t.substr(0,e),n=t.substr(e+1);return`${vb(r)}:${vb(n)}`};function vb(t){if(t=t.toLowerCase(),t==="_authtoken")return"_authToken";let e=t[0];for(let r=1;r<t.length;r++)e+=t[r]==="_"?"-":t[r];return e}});var c8=y(Mh=>{"use strict";Object.defineProperty(Mh,"__esModule",{value:!0});Mh.envReplace=void 0;var uae=/(?<!\\)(\\*)\$\{([^${}]+)\}/g;function cae(t,e){return t.replace(uae,lae.bind(null,e))}Mh.envReplace=cae;function lae(t,e,r,n){if(r.length%2)return e.slice((r.length+1)/2);let i=dae(t,n);if(i===void 0)throw new Error(`Failed to replace env in config: ${e}`);return`${r.slice(r.length/2)}${i}`}var fae=/([^:-]+)(:?)-(.+)/;function dae(t,e){let r=e.match(fae);if(!r)return t[e];let[,n,i,o]=r;return Object.prototype.hasOwnProperty.call(t,n)?!t[n]&&i?o:t[n]:o}});var l8=y(Uh=>{"use strict";Object.defineProperty(Uh,"__esModule",{value:!0});Uh.envReplace=void 0;var hae=c8();Object.defineProperty(Uh,"envReplace",{enumerable:!0,get:function(){return hae.envReplace}})});var d8=y(Vh=>{"use strict";var pae=require("fs"),Fo=require("path"),{envReplace:f8}=l8(),mae=(t,e,r)=>{if(typeof e!="string")return e;let n=[].concat(t[r]),i=n.indexOf(Fo)!==-1,o=n.indexOf(Boolean)!==-1,s=n.indexOf(String)!==-1,a=n.indexOf(Number)!==-1;if(e=`${e}`.trim(),/^".*"$/.test(e))try{e=JSON.parse(e)}catch{throw new Error(`Failed parsing JSON config key ${r}: ${e}`)}if(o&&!s&&e==="")return!0;switch(e){case"true":return!0;case"false":return!1;case"null":return null;case"undefined":return}return e=f8(e,process.env),i&&((process.platform==="win32"?/^~(\/|\\)/:/^~\//).test(e)&&process.env.HOME&&(e=Fo.resolve(process.env.HOME,e.substr(2))),e=Fo.resolve(e)),a&&!isNaN(e)&&(e=Number(e)),e},gae=t=>{t=Fo.resolve(t);let e=!1;for(;Fo.basename(t)==="node_modules";)t=Fo.dirname(t),e=!0;if(e)return t;let r=(n,i)=>{let o=/^[a-zA-Z]:(\\|\/)?$/;if(n==="/"||process.platform==="win32"&&o.test(n))return i;try{let s=pae.readdirSync(n);if(s.includes("node_modules")||s.includes("package.json")||s.includes("package.json5")||s.includes("package.yaml")||s.includes("pnpm-workspace.yaml"))return n;let a=Fo.dirname(n);return a===n?i:r(a,i)}catch(s){if(n===i){if(s.code==="ENOENT")return i;throw s}return i}};return r(t,t)};Vh.envReplace=f8;Vh.findPrefix=gae;Vh.parseField=mae});var m8=y(p8=>{"use strict";var Oo=require("path"),yae=require("stream").Stream,Hh=require("url"),Dae=()=>{},vae=()=>[],h8=()=>{};p8.types={access:[null,"restricted","public"],"allow-same-version":Boolean,"always-auth":Boolean,also:[null,"dev","development"],audit:Boolean,"auth-type":["legacy","sso","saml","oauth"],"bin-links":Boolean,browser:[null,String],ca:[null,String,Array],cafile:Oo,cache:Oo,"cache-lock-stale":Number,"cache-lock-retries":Number,"cache-lock-wait":Number,"cache-max":Number,"cache-min":Number,cert:[null,String],cidr:[null,String,Array],color:["always",Boolean],depth:Number,description:Boolean,dev:Boolean,"dry-run":Boolean,editor:String,"engine-strict":Boolean,force:Boolean,"fetch-retries":Number,"fetch-retry-factor":Number,"fetch-retry-mintimeout":Number,"fetch-retry-maxtimeout":Number,git:String,"git-tag-version":Boolean,"commit-hooks":Boolean,global:Boolean,globalconfig:Oo,"global-style":Boolean,group:[Number,String],"https-proxy":[null,Hh],"user-agent":String,"ham-it-up":Boolean,heading:String,"if-present":Boolean,"ignore-prepublish":Boolean,"ignore-scripts":Boolean,"init-module":Oo,"init-author-name":String,"init-author-email":String,"init-author-url":["",Hh],"init-license":String,"init-version":h8,json:Boolean,key:[null,String],"legacy-bundling":Boolean,link:Boolean,"local-address":vae(),loglevel:["silent","error","warn","notice","http","timing","info","verbose","silly"],logstream:yae,"logs-max":Number,long:Boolean,maxsockets:Number,message:String,"metrics-registry":[null,String],"node-options":[null,String],"node-version":[null,h8],"no-proxy":[null,String,Array],offline:Boolean,"onload-script":[null,String],only:[null,"dev","development","prod","production"],optional:Boolean,"package-lock":Boolean,otp:[null,String],"package-lock-only":Boolean,parseable:Boolean,"prefer-offline":Boolean,"prefer-online":Boolean,prefix:Oo,production:Boolean,progress:Boolean,proxy:[null,!1,Hh],provenance:Boolean,"read-only":Boolean,"rebuild-bundle":Boolean,registry:[null,Hh],rollback:Boolean,save:Boolean,"save-bundle":Boolean,"save-dev":Boolean,"save-exact":Boolean,"save-optional":Boolean,"save-prefix":String,"save-prod":Boolean,scope:String,"script-shell":[null,String],"scripts-prepend-node-path":[!1,!0,"auto","warn-only"],searchopts:String,searchexclude:[null,String],searchlimit:Number,searchstaleness:Number,"send-metrics":Boolean,shell:String,shrinkwrap:Boolean,"sign-git-tag":Boolean,"sso-poll-frequency":Number,"sso-type":[null,"oauth","saml"],"strict-ssl":Boolean,tag:String,timing:Boolean,tmp:Oo,unicode:Boolean,"unsafe-perm":Boolean,usage:Boolean,user:[Number,String],userconfig:Oo,umask:Dae,version:Boolean,"tag-version-prefix":String,versions:Boolean,viewer:String,_exit:Boolean}});var v8=y((Aye,D8)=>{"use strict";var{readCAFileSync:bae}=Yj(),g8=require("fs"),bb=require("path"),{ConfigChain:wae}=s8(),_ae=u8(),y8=d8(),wb=class extends wae{constructor(e,r){super(e),this.root=e,this._parseField=y8.parseField.bind(null,r||m8())}add(e,r){try{for(let n of Object.keys(e))e[n]=this._parseField(e[n],n)}catch(n){throw n}return super.add(e,r)}addFile(e,r){r=r||e;let n={__source__:r};this.sources[r]={path:e,type:"ini"},this.push(n),this._await();try{let i=g8.readFileSync(e,"utf8");this.addString(i,e,"ini",n)}catch(i){if(i.code==="ENOENT")this.add({},n);else return`Issue while reading "${e}". ${i.message}`}}addEnv(e){e=e||process.env;let r={};return Object.keys(e).filter(n=>/^npm_config_/i.test(n)).forEach(n=>{e[n]&&(r[_ae(n.substr(11))]=e[n])}),super.addEnv("",r,"env")}loadPrefix(){let e=this.list[0];Object.defineProperty(this,"prefix",{enumerable:!0,set:n=>{let i=this.get("global");this[i?"globalPrefix":"localPrefix"]=n},get:()=>this.get("global")?this.globalPrefix:this.localPrefix}),Object.defineProperty(this,"globalPrefix",{enumerable:!0,set:n=>{this.set("prefix",n)},get:()=>bb.resolve(this.get("prefix"))});let r;if(Object.defineProperty(this,"localPrefix",{enumerable:!0,set:n=>{r=n},get:()=>r}),Object.prototype.hasOwnProperty.call(e,"prefix"))r=bb.resolve(e.prefix);else try{r=y8.findPrefix(process.cwd())}catch(n){throw n}return r}loadCAFile(e){if(!e)return;let r=bae(e);r&&this.set("ca",r)}loadUser(){let e=this.root;if(this.get("global"))return;if(process.env.SUDO_UID){e.user=Number(process.env.SUDO_UID);return}let r=bb.resolve(this.get("prefix"));try{let n=g8.statSync(r);e.user=n.uid}catch(n){if(n.code==="ENOENT")return;throw n}}};D8.exports=wb});var S8=y(C8=>{"use strict";var _8=require("os"),Ln=require("path"),E8=_8.tmpdir(),Eae=process.getuid?process.getuid():process.pid,Cae=()=>!0,b8=process.platform==="win32",w8={editor:()=>process.env.EDITOR||process.env.VISUAL||(b8?"notepad.exe":"vi"),shell:()=>b8?process.env.COMSPEC||"cmd.exe":process.env.SHELL||"/bin/bash"},Sae={fromString:()=>process.umask()},Ca=_8.homedir();Ca?process.env.HOME=Ca:Ca=Ln.resolve(E8,"npm-"+Eae);var xae=process.platform==="win32"?"npm-cache":".npm",Fae=process.platform==="win32"&&process.env.APPDATA||Ca,Oae=Ln.resolve(Fae,xae),zh,Ao;Object.defineProperty(C8,"defaults",{get:function(){return zh||(process.env.PREFIX?Ao=process.env.PREFIX:process.platform==="win32"?Ao=Ln.dirname(process.execPath):(Ao=Ln.dirname(Ln.dirname(process.execPath)),process.env.DESTDIR&&(Ao=Ln.join(process.env.DESTDIR,Ao))),zh={access:null,"allow-same-version":!1,"always-auth":!1,also:null,audit:!0,"auth-type":"legacy","bin-links":!0,browser:null,ca:null,cafile:null,cache:Oae,"cache-lock-stale":6e4,"cache-lock-retries":10,"cache-lock-wait":1e4,"cache-max":1/0,"cache-min":10,cert:null,cidr:null,color:process.env.NO_COLOR==null,depth:1/0,description:!0,dev:!1,"dry-run":!1,editor:w8.editor(),"engine-strict":!1,force:!1,"fetch-retries":2,"fetch-retry-factor":10,"fetch-retry-mintimeout":1e4,"fetch-retry-maxtimeout":6e4,git:"git","git-tag-version":!0,"commit-hooks":!0,global:!1,globalconfig:Ln.resolve(Ao,"etc","npmrc"),"global-style":!1,group:process.platform==="win32"?0:process.env.SUDO_GID||process.getgid&&process.getgid(),"ham-it-up":!1,heading:"npm","if-present":!1,"ignore-prepublish":!1,"ignore-scripts":!1,"init-module":Ln.resolve(Ca,".npm-init.js"),"init-author-name":"","init-author-email":"","init-author-url":"","init-version":"1.0.0","init-license":"ISC",json:!1,key:null,"legacy-bundling":!1,link:!1,"local-address":void 0,loglevel:"notice",logstream:process.stderr,"logs-max":10,long:!1,maxsockets:50,message:"%s","metrics-registry":null,"node-options":null,offline:!1,"onload-script":!1,only:null,optional:!0,otp:null,"package-lock":!0,"package-lock-only":!1,parseable:!1,"prefer-offline":!1,"prefer-online":!1,prefix:Ao,production:process.env.NODE_ENV==="production",progress:!process.env.TRAVIS&&!process.env.CI,provenance:!1,proxy:null,"https-proxy":null,"no-proxy":null,"user-agent":"npm/{npm-version} node/{node-version} {platform} {arch}","read-only":!1,"rebuild-bundle":!0,registry:"https://registry.npmjs.org/",rollback:!0,save:!0,"save-bundle":!1,"save-dev":!1,"save-exact":!1,"save-optional":!1,"save-prefix":"^","save-prod":!1,scope:"","script-shell":null,"scripts-prepend-node-path":"warn-only",searchopts:"",searchexclude:null,searchlimit:20,searchstaleness:15*60,"send-metrics":!1,shell:w8.shell(),shrinkwrap:!0,"sign-git-tag":!1,"sso-poll-frequency":500,"sso-type":"oauth","strict-ssl":!0,tag:"latest","tag-version-prefix":"v",timing:!1,tmp:E8,unicode:Cae(),"unsafe-perm":process.platform==="win32"||process.platform==="cygwin"||!(process.getuid&&process.setuid&&process.getgid&&process.setgid)||process.getuid()!==0,usage:!1,user:process.platform==="win32"?0:"nobody",userconfig:Ln.resolve(Ca,".npmrc"),umask:process.umask?process.umask():Sae.fromString("022"),version:!1,versions:!1,viewer:process.platform==="win32"?"browser":"man",_exit:!0},zh)}})});var F8=y((Tye,_b)=>{"use strict";var ko=require("path"),Aae=v8(),x8=S8();_b.exports=(t,e,r)=>{let n=new Aae(Object.assign({},x8.defaults,r),e);n.add(Object.assign({},t),"cli");let i=[],o=!1;if(require.resolve.paths){let c=require.resolve.paths("npm"),l;try{l=require.resolve("npm",{paths:c.slice(-1)})}catch{o=!0}l&&i.push(n.addFile(ko.resolve(ko.dirname(l),"..","npmrc"),"builtin"))}n.addEnv(),n.loadPrefix();let s=ko.resolve(n.localPrefix,".npmrc"),a=n.get("userconfig");if(!n.get("global")&&s!==a?i.push(n.addFile(s,"project")):n.add({},"project"),n.get("workspace-prefix")&&n.get("workspace-prefix")!==s){let c=ko.resolve(n.get("workspace-prefix"),".npmrc");i.push(n.addFile(c,"workspace"))}if(i.push(n.addFile(n.get("userconfig"),"user")),n.get("prefix")){let c=ko.resolve(n.get("prefix"),"etc");n.root.globalconfig=ko.resolve(c,"npmrc"),n.root.globalignorefile=ko.resolve(c,"npmignore")}i.push(n.addFile(n.get("globalconfig"),"global")),n.loadUser();let u=n.get("cafile");return u&&n.loadCAFile(u),{config:n,warnings:i.filter(Boolean),failedToLoadBuiltInConfig:o}};Object.defineProperty(_b.exports,"defaults",{get(){return x8.defaults},enumerable:!0})});var I8=y((Pye,$8)=>{var Eb=require("url"),O8=F8(),A8=":_authToken",k8=":_auth",T8=":username",P8=":_password";$8.exports=function(){let e,r;arguments.length>=2?(e=arguments[0],r=Object.assign({},arguments[1])):typeof arguments[0]=="string"?e=arguments[0]:r=Object.assign({},arguments[0]),r=r||{};let n=r.npmrc;return r.npmrc=(r.npmrc?{config:{get:i=>n[i]}}:O8()).config,e=e||r.npmrc.get("registry")||O8.defaults.registry,R8(e,r)||kae(r.npmrc)};function R8(t,e){let r=Eb.parse(t,!1,!0),n;for(;n!=="/"&&r.pathname!==n;){n=r.pathname||"/";let i="//"+r.host+n.replace(/\/$/,""),o=Pae(i,e.npmrc);if(o)return o;if(!e.recursive)return/\/$/.test(t)?void 0:R8(Eb.resolve(t,"."),e);r.pathname=Eb.resolve(Tae(n),"..")||"/"}}function kae(t){return t.get("_auth")?{token:Gh(t.get("_auth")),type:"Basic"}:void 0}function Tae(t){return t[t.length-1]==="/"?t:t+"/"}function Pae(t,e){let r=Rae(e.get(t+A8)||e.get(t+"/"+A8));if(r)return r;let n=e.get(t+T8)||e.get(t+"/"+T8),i=e.get(t+P8)||e.get(t+"/"+P8),o=$ae(n,i);if(o)return o;let s=Iae(e.get(t+k8)||e.get(t+"/"+k8));if(s)return s}function Gh(t){return t.replace(/^\$\{?([^}]*)\}?$/,function(e,r){return process.env[r]})}function Rae(t){return t?{token:Gh(t),type:"Bearer"}:void 0}function $ae(t,e){if(!t||!e)return;let r=Buffer.from(Gh(e),"base64").toString("utf8");return{token:Buffer.from(t+":"+r,"utf8").toString("base64"),type:"Basic",password:r,username:t}}function Iae(t){return t?{token:Gh(t),type:"Basic"}:void 0}});var jL=y((Nwe,Vn)=>{var ot=require("fs"),Qb=require("os"),fr=require("path"),wL=require("crypto"),ln={fs:ot.constants,os:Qb.constants},_L="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",CL=/XXXXXX/,wue=3,SL=(ln.O_CREAT||ln.fs.O_CREAT)|(ln.O_EXCL||ln.fs.O_EXCL)|(ln.O_RDWR||ln.fs.O_RDWR),_ue=Qb.platform()==="win32",Eue=ln.EBADF||ln.os.errno.EBADF,Cue=ln.ENOENT||ln.os.errno.ENOENT,xL=448,FL=384,Sue="exit",Ra=[],OL=ot.rmdirSync.bind(ot),AL=!1;function xue(t,e){return ot.rm(t,{recursive:!0},e)}function kL(t){return ot.rmSync(t,{recursive:!0})}function ew(t,e){let r=$a(t,e),n=r[0],i=r[1];try{RL(n)}catch(s){return i(s)}let o=n.tries;(function s(){try{let a=PL(n);ot.stat(a,function(u){if(!u)return o-- >0?s():i(new Error("Could not get a unique tmp filename, max tries reached "+a));i(null,a)})}catch(a){i(a)}})()}function tw(t){let e=$a(t),r=e[0];RL(r);let n=r.tries;do{let i=PL(r);try{ot.statSync(i)}catch{return i}}while(n-- >0);throw new Error("Could not get a unique tmp filename, max tries reached")}function Fue(t,e){let r=$a(t,e),n=r[0],i=r[1];ew(n,function(s,a){if(s)return i(s);ot.open(a,SL,n.mode||FL,function(c,l){if(c)return i(c);if(n.discardDescriptor)return ot.close(l,function(h){return i(h,a,void 0,Jb(a,-1,n,!1))});{let f=n.discardDescriptor||n.detachDescriptor;i(null,a,l,Jb(a,f?-1:l,n,!1))}})})}function Oue(t){let e=$a(t),r=e[0],n=r.discardDescriptor||r.detachDescriptor,i=tw(r);var o=ot.openSync(i,SL,r.mode||FL);return r.discardDescriptor&&(ot.closeSync(o),o=void 0),{name:i,fd:o,removeCallback:Jb(i,n?-1:o,r,!0)}}function Aue(t,e){let r=$a(t,e),n=r[0],i=r[1];ew(n,function(s,a){if(s)return i(s);ot.mkdir(a,n.mode||xL,function(c){if(c)return i(c);i(null,a,TL(a,n,!1))})})}function kue(t){let e=$a(t),r=e[0],n=tw(r);return ot.mkdirSync(n,r.mode||xL),{name:n,removeCallback:TL(n,r,!0)}}function Tue(t,e){let r=function(n){if(n&&!Zb(n))return e(n);e()};0<=t[0]?ot.close(t[0],function(){ot.unlink(t[1],r)}):ot.unlink(t[1],r)}function Pue(t){let e=null;try{0<=t[0]&&ot.closeSync(t[0])}catch(r){if(!Iue(r)&&!Zb(r))throw r}finally{try{ot.unlinkSync(t[1])}catch(r){Zb(r)||(e=r)}}if(e!==null)throw e}function Jb(t,e,r,n){let i=yp(Pue,[e,t],n),o=yp(Tue,[e,t],n,i);return r.keep||Ra.unshift(i),n?i:o}function TL(t,e,r){let n=e.unsafeCleanup?xue:ot.rmdir.bind(ot),i=e.unsafeCleanup?kL:OL,o=yp(i,t,r),s=yp(n,t,r,o);return e.keep||Ra.unshift(o),r?o:s}function yp(t,e,r,n){let i=!1;return function o(s){if(!i){let a=n||o,u=Ra.indexOf(a);return u>=0&&Ra.splice(u,1),i=!0,r||t===OL||t===kL?t(e):t(e,s||function(){})}}}function Rue(){if(AL)for(;Ra.length;)try{Ra[0]()}catch{}}function EL(t){let e=[],r=null;try{r=wL.randomBytes(t)}catch{r=wL.pseudoRandomBytes(t)}for(var n=0;n<t;n++)e.push(_L[r[n]%_L.length]);return e.join("")}function $ue(t){return t===null||tr(t)||!t.trim()}function tr(t){return typeof t>"u"}function $a(t,e){if(typeof t=="function")return[{},t];if(tr(t))return[{},e];let r={};for(let n of Object.getOwnPropertyNames(t))r[n]=t[n];return[r,e]}function PL(t){let e=t.tmpdir;if(!tr(t.name))return fr.join(e,t.dir,t.name);if(!tr(t.template))return fr.join(e,t.dir,t.template).replace(CL,EL(6));let r=[t.prefix?t.prefix:"tmp","-",process.pid,"-",EL(12),t.postfix?"-"+t.postfix:""].join("");return fr.join(e,t.dir,r)}function RL(t){t.tmpdir=IL(t);let e=t.tmpdir;if(tr(t.name)||Yb(t.name,"name",e),tr(t.dir)||Yb(t.dir,"dir",e),!tr(t.template)&&(Yb(t.template,"template",e),!t.template.match(CL)))throw new Error(`Invalid template, found "${t.template}".`);if(!tr(t.tries)&&isNaN(t.tries)||t.tries<0)throw new Error(`Invalid tries, found "${t.tries}".`);t.tries=tr(t.name)?t.tries||wue:1,t.keep=!!t.keep,t.detachDescriptor=!!t.detachDescriptor,t.discardDescriptor=!!t.discardDescriptor,t.unsafeCleanup=!!t.unsafeCleanup,t.dir=tr(t.dir)?"":fr.relative(e,Xb(t.dir,e)),t.template=tr(t.template)?void 0:fr.relative(e,Xb(t.template,e)),t.template=$ue(t.template)?void 0:fr.relative(t.dir,t.template),t.name=tr(t.name)?void 0:t.name,t.prefix=tr(t.prefix)?"":t.prefix,t.postfix=tr(t.postfix)?"":t.postfix}function Xb(t,e){return t.startsWith(e)?fr.resolve(t):fr.resolve(fr.join(e,t))}function Yb(t,e,r){if(e==="name"){if(fr.isAbsolute(t))throw new Error(`${e} option must not contain an absolute path, found "${t}".`);let n=fr.basename(t);if(n===".."||n==="."||n!==t)throw new Error(`${e} option must not contain a path, found "${t}".`)}else{if(fr.isAbsolute(t)&&!t.startsWith(r))throw new Error(`${e} option must be relative to "${r}", found "${t}".`);let n=Xb(t,r);if(!n.startsWith(r))throw new Error(`${e} option must be relative to "${r}", found "${n}".`)}}function Iue(t){return $L(t,-Eue,"EBADF")}function Zb(t){return $L(t,-Cue,"ENOENT")}function $L(t,e,r){return _ue?t.code===r:t.code===r&&t.errno===e}function jue(){AL=!0}function IL(t){return fr.resolve(t&&t.tmpdir||Qb.tmpdir())}process.addListener(Sue,Rue);Object.defineProperty(Vn.exports,"tmpdir",{enumerable:!0,configurable:!1,get:function(){return IL()}});Vn.exports.dir=Aue;Vn.exports.dirSync=kue;Vn.exports.file=Fue;Vn.exports.fileSync=Oue;Vn.exports.tmpName=ew;Vn.exports.tmpNameSync=tw;Vn.exports.setGracefulCleanup=jue});var _w=ce(ww(),1),{program:A,createCommand:pce,createArgument:mce,createOption:gce,CommanderError:yce,InvalidArgumentError:Dce,InvalidOptionArgumentError:vce,Command:bce,Argument:wce,Option:_ce,Help:Ece}=_w.default;var Ir={name:"@capgo/cli",version:"4.26.14",description:"A CLI to upload to capgo servers",author:"github.com/riderx",license:"Apache 2.0",homepage:"https://github.com/Cap-go/CLIl#readme",repository:{type:"git",url:"git+https://github.com/Cap-go/CLI.git"},bugs:{url:"https://github.com/Cap-go/CLI/issues"},keywords:["appflow alternative","ionic","capacitor","auto update","live update","capgo","cli","upload","capgo-cli"],main:"dist/index.js",bin:{capgo:"dist/index.js"},engines:{npm:">=8.0.0",node:">=20.0.0"},scripts:{build:"tsc && node build.mjs",dev:"NODE_ENV=development ncc build","no-debug":"node dist/index.js",test:"npx --yes ts-node -T src/index.ts","dev-build":"SUPA_DB=development ncc build",pack:"pkg",types:"npx --yes supabase gen types typescript --project-id=xvwzpoazmxkqosrdewyv > src/types/supabase.types.ts",test_rls:"ts-node ./test/test_headers_rls.ts",lint:'eslint "src/**/*.ts" --fix',"check-posix-paths":"node test/check-posix-paths.js"},devDependencies:{"@antfu/eslint-config":"^3.9.2","@bradenmacdonald/s3-lite-client":"npm:@jsr/bradenmacdonald__s3-lite-client","@capacitor/cli":"^6.2.0","@capgo/find-package-manager":"^0.0.17","@clack/prompts":"^0.8.1","@sauber/table":"npm:@jsr/sauber__table","@std/semver":"npm:@jsr/std__semver","@supabase/supabase-js":"^2.46.0","@tomasklaen/checksum":"^1.1.0","@types/adm-zip":"^0.5.6","@types/node":"^22.8.4","@types/prettyjson":"^0.0.33","@types/semver":"7.5.8","@types/tmp":"^0.2.6","@typescript-eslint/eslint-plugin":"^8.15.0","@typescript-eslint/parser":"^8.15.0","@vercel/ncc":"^0.38.3","adm-zip":"^0.5.16","ci-info":"^4.1.0",commander:"12.1.0",esbuild:"^0.24.0",eslint:"9.17.0","git-format-staged":"3.1.1",husky:"^9.1.7","is-wsl":"^3.1.0",ky:"^1.7.2","latest-version":"^9.0.0",open:"^10.1.0",pkg:"5.8.1",prettyjson:"^1.2.5",semver:"^7.6.3",tmp:"^0.2.3","ts-loader":"^9.5.1","ts-node":"^10.9.2","tsconfig-paths":"4.2.0","tus-js-client":"^4.2.3",typescript:"5.7.2"}};var Sa=require("node:fs"),L8=require("node:process");var At=ce(Te(),1),Lo=require("node:process"),Gn=ce(require("node:readline"),1),Vp=ce(require("node:readline"),1),$w=require("node:tty"),al=ce(qp(),1);function xB({onlyFirst:t=!1}={}){let e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(e,t?void 0:"g")}function Iw(t){if(typeof t!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);return t.replace(xB(),"")}function jw(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Nw={exports:{}};(function(t){var e={};t.exports=e,e.eastAsianWidth=function(n){var i=n.charCodeAt(0),o=n.length==2?n.charCodeAt(1):0,s=i;return 55296<=i&&i<=56319&&56320<=o&&o<=57343&&(i&=1023,o&=1023,s=i<<10|o,s+=65536),s==12288||65281<=s&&s<=65376||65504<=s&&s<=65510?"F":s==8361||65377<=s&&s<=65470||65474<=s&&s<=65479||65482<=s&&s<=65487||65490<=s&&s<=65495||65498<=s&&s<=65500||65512<=s&&s<=65518?"H":4352<=s&&s<=4447||4515<=s&&s<=4519||4602<=s&&s<=4607||9001<=s&&s<=9002||11904<=s&&s<=11929||11931<=s&&s<=12019||12032<=s&&s<=12245||12272<=s&&s<=12283||12289<=s&&s<=12350||12353<=s&&s<=12438||12441<=s&&s<=12543||12549<=s&&s<=12589||12593<=s&&s<=12686||12688<=s&&s<=12730||12736<=s&&s<=12771||12784<=s&&s<=12830||12832<=s&&s<=12871||12880<=s&&s<=13054||13056<=s&&s<=19903||19968<=s&&s<=42124||42128<=s&&s<=42182||43360<=s&&s<=43388||44032<=s&&s<=55203||55216<=s&&s<=55238||55243<=s&&s<=55291||63744<=s&&s<=64255||65040<=s&&s<=65049||65072<=s&&s<=65106||65108<=s&&s<=65126||65128<=s&&s<=65131||110592<=s&&s<=110593||127488<=s&&s<=127490||127504<=s&&s<=127546||127552<=s&&s<=127560||127568<=s&&s<=127569||131072<=s&&s<=194367||177984<=s&&s<=196605||196608<=s&&s<=262141?"W":32<=s&&s<=126||162<=s&&s<=163||165<=s&&s<=166||s==172||s==175||10214<=s&&s<=10221||10629<=s&&s<=10630?"Na":s==161||s==164||167<=s&&s<=168||s==170||173<=s&&s<=174||176<=s&&s<=180||182<=s&&s<=186||188<=s&&s<=191||s==198||s==208||215<=s&&s<=216||222<=s&&s<=225||s==230||232<=s&&s<=234||236<=s&&s<=237||s==240||242<=s&&s<=243||247<=s&&s<=250||s==252||s==254||s==257||s==273||s==275||s==283||294<=s&&s<=295||s==299||305<=s&&s<=307||s==312||319<=s&&s<=322||s==324||328<=s&&s<=331||s==333||338<=s&&s<=339||358<=s&&s<=359||s==363||s==462||s==464||s==466||s==468||s==470||s==472||s==474||s==476||s==593||s==609||s==708||s==711||713<=s&&s<=715||s==717||s==720||728<=s&&s<=731||s==733||s==735||768<=s&&s<=879||913<=s&&s<=929||931<=s&&s<=937||945<=s&&s<=961||963<=s&&s<=969||s==1025||1040<=s&&s<=1103||s==1105||s==8208||8211<=s&&s<=8214||8216<=s&&s<=8217||8220<=s&&s<=8221||8224<=s&&s<=8226||8228<=s&&s<=8231||s==8240||8242<=s&&s<=8243||s==8245||s==8251||s==8254||s==8308||s==8319||8321<=s&&s<=8324||s==8364||s==8451||s==8453||s==8457||s==8467||s==8470||8481<=s&&s<=8482||s==8486||s==8491||8531<=s&&s<=8532||8539<=s&&s<=8542||8544<=s&&s<=8555||8560<=s&&s<=8569||s==8585||8592<=s&&s<=8601||8632<=s&&s<=8633||s==8658||s==8660||s==8679||s==8704||8706<=s&&s<=8707||8711<=s&&s<=8712||s==8715||s==8719||s==8721||s==8725||s==8730||8733<=s&&s<=8736||s==8739||s==8741||8743<=s&&s<=8748||s==8750||8756<=s&&s<=8759||8764<=s&&s<=8765||s==8776||s==8780||s==8786||8800<=s&&s<=8801||8804<=s&&s<=8807||8810<=s&&s<=8811||8814<=s&&s<=8815||8834<=s&&s<=8835||8838<=s&&s<=8839||s==8853||s==8857||s==8869||s==8895||s==8978||9312<=s&&s<=9449||9451<=s&&s<=9547||9552<=s&&s<=9587||9600<=s&&s<=9615||9618<=s&&s<=9621||9632<=s&&s<=9633||9635<=s&&s<=9641||9650<=s&&s<=9651||9654<=s&&s<=9655||9660<=s&&s<=9661||9664<=s&&s<=9665||9670<=s&&s<=9672||s==9675||9678<=s&&s<=9681||9698<=s&&s<=9701||s==9711||9733<=s&&s<=9734||s==9737||9742<=s&&s<=9743||9748<=s&&s<=9749||s==9756||s==9758||s==9792||s==9794||9824<=s&&s<=9825||9827<=s&&s<=9829||9831<=s&&s<=9834||9836<=s&&s<=9837||s==9839||9886<=s&&s<=9887||9918<=s&&s<=9919||9924<=s&&s<=9933||9935<=s&&s<=9953||s==9955||9960<=s&&s<=9983||s==10045||s==10071||10102<=s&&s<=10111||11093<=s&&s<=11097||12872<=s&&s<=12879||57344<=s&&s<=63743||65024<=s&&s<=65039||s==65533||127232<=s&&s<=127242||127248<=s&&s<=127277||127280<=s&&s<=127337||127344<=s&&s<=127386||917760<=s&&s<=917999||983040<=s&&s<=1048573||1048576<=s&&s<=1114109?"A":"N"},e.characterLength=function(n){var i=this.eastAsianWidth(n);return i=="F"||i=="W"||i=="A"?2:1};function r(n){return n.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}e.length=function(n){for(var i=r(n),o=0,s=0;s<i.length;s++)o=o+this.characterLength(i[s]);return o},e.slice=function(n,i,o){textLen=e.length(n),i=i||0,o=o||1,i<0&&(i=textLen+i),o<0&&(o=textLen+o);for(var s="",a=0,u=r(n),c=0;c<u.length;c++){var l=u[c],f=e.length(l);if(a>=i-(f==2?1:0))if(a+f<=o)s+=l;else break;a+=f}return s}})(Nw);var FB=Nw.exports,OB=jw(FB),AB=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},kB=jw(AB);function La(t,e={}){if(typeof t!="string"||t.length===0||(e={ambiguousIsNarrow:!0,...e},t=Iw(t),t.length===0))return 0;t=t.replace(kB()," ");let r=e.ambiguousIsNarrow?1:2,n=0;for(let i of t){let o=i.codePointAt(0);if(!(o<=31||o>=127&&o<=159||o>=768&&o<=879))switch(OB.eastAsianWidth(i)){case"F":case"W":n+=2;break;case"A":n+=r;break;default:n+=1}}return n}var Mp=10,xw=(t=0)=>e=>`\x1B[${e+t}m`,Fw=(t=0)=>e=>`\x1B[${38+t};5;${e}m`,Ow=(t=0)=>(e,r,n)=>`\x1B[${38+t};2;${e};${r};${n}m`,Ie={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(Ie.modifier);var TB=Object.keys(Ie.color),PB=Object.keys(Ie.bgColor);[...TB,...PB];function RB(){let t=new Map;for(let[e,r]of Object.entries(Ie)){for(let[n,i]of Object.entries(r))Ie[n]={open:`\x1B[${i[0]}m`,close:`\x1B[${i[1]}m`},r[n]=Ie[n],t.set(i[0],i[1]);Object.defineProperty(Ie,e,{value:r,enumerable:!1})}return Object.defineProperty(Ie,"codes",{value:t,enumerable:!1}),Ie.color.close="\x1B[39m",Ie.bgColor.close="\x1B[49m",Ie.color.ansi=xw(),Ie.color.ansi256=Fw(),Ie.color.ansi16m=Ow(),Ie.bgColor.ansi=xw(Mp),Ie.bgColor.ansi256=Fw(Mp),Ie.bgColor.ansi16m=Ow(Mp),Object.defineProperties(Ie,{rgbToAnsi256:{value:(e,r,n)=>e===r&&r===n?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5),enumerable:!1},hexToRgb:{value:e=>{let r=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!r)return[0,0,0];let[n]=r;n.length===3&&(n=[...n].map(o=>o+o).join(""));let i=Number.parseInt(n,16);return[i>>16&255,i>>8&255,i&255]},enumerable:!1},hexToAnsi256:{value:e=>Ie.rgbToAnsi256(...Ie.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value:e=>{if(e<8)return 30+e;if(e<16)return 90+(e-8);let r,n,i;if(e>=232)r=((e-232)*10+8)/255,n=r,i=r;else{e-=16;let a=e%36;r=Math.floor(e/36)/5,n=Math.floor(a/6)/5,i=a%6/5}let o=Math.max(r,n,i)*2;if(o===0)return 30;let s=30+(Math.round(i)<<2|Math.round(n)<<1|Math.round(r));return o===2&&(s+=60),s},enumerable:!1},rgbToAnsi:{value:(e,r,n)=>Ie.ansi256ToAnsi(Ie.rgbToAnsi256(e,r,n)),enumerable:!1},hexToAnsi:{value:e=>Ie.ansi256ToAnsi(Ie.hexToAnsi256(e)),enumerable:!1}}),Ie}var $B=RB(),ll=new Set(["\x1B","\x9B"]),IB=39,Hp="\x07",Lw="[",jB="]",Bw="m",zp=`${jB}8;;`,Aw=t=>`${ll.values().next().value}${Lw}${t}${Bw}`,kw=t=>`${ll.values().next().value}${zp}${t}${Hp}`,NB=t=>t.split(" ").map(e=>La(e)),Up=(t,e,r)=>{let n=[...e],i=!1,o=!1,s=La(Iw(t[t.length-1]));for(let[a,u]of n.entries()){let c=La(u);if(s+c<=r?t[t.length-1]+=u:(t.push(u),s=0),ll.has(u)&&(i=!0,o=n.slice(a+1).join("").startsWith(zp)),i){o?u===Hp&&(i=!1,o=!1):u===Bw&&(i=!1);continue}s+=c,s===r&&a<n.length-1&&(t.push(""),s=0)}!s&&t[t.length-1].length>0&&t.length>1&&(t[t.length-2]+=t.pop())},LB=t=>{let e=t.split(" "),r=e.length;for(;r>0&&!(La(e[r-1])>0);)r--;return r===e.length?t:e.slice(0,r).join(" ")+e.slice(r).join("")},BB=(t,e,r={})=>{if(r.trim!==!1&&t.trim()==="")return"";let n="",i,o,s=NB(t),a=[""];for(let[c,l]of t.split(" ").entries()){r.trim!==!1&&(a[a.length-1]=a[a.length-1].trimStart());let f=La(a[a.length-1]);if(c!==0&&(f>=e&&(r.wordWrap===!1||r.trim===!1)&&(a.push(""),f=0),(f>0||r.trim===!1)&&(a[a.length-1]+=" ",f++)),r.hard&&s[c]>e){let h=e-f,d=1+Math.floor((s[c]-h-1)/e);Math.floor((s[c]-1)/e)<d&&a.push(""),Up(a,l,e);continue}if(f+s[c]>e&&f>0&&s[c]>0){if(r.wordWrap===!1&&f<e){Up(a,l,e);continue}a.push("")}if(f+s[c]>e&&r.wordWrap===!1){Up(a,l,e);continue}a[a.length-1]+=l}r.trim!==!1&&(a=a.map(c=>LB(c)));let u=[...a.join(`
201
+ `)];for(let[c,l]of u.entries()){if(n+=l,ll.has(l)){let{groups:h}=new RegExp(`(?:\\${Lw}(?<code>\\d+)m|\\${zp}(?<uri>.*)${Hp})`).exec(u.slice(c).join(""))||{groups:{}};if(h.code!==void 0){let d=Number.parseFloat(h.code);i=d===IB?void 0:d}else h.uri!==void 0&&(o=h.uri.length===0?void 0:h.uri)}let f=$B.codes.get(Number(i));u[c+1]===`
202
202
  `?(o&&(n+=kw("")),i&&f&&(n+=Aw(f))):l===`
203
203
  `&&(i&&f&&(n+=Aw(i)),o&&(n+=kw(o)))}return n};function Tw(t,e,r){return String(t).normalize().replace(/\r\n/g,`
204
204
  `).split(`
205
205
  `).map(n=>BB(n,e,r)).join(`
206
206
  `)}var qB=Object.defineProperty,MB=(t,e,r)=>e in t?qB(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,hr=(t,e,r)=>(MB(t,typeof e!="symbol"?e+"":e,r),r);function UB(t,e){if(t===e)return;let r=t.split(`
207
207
  `),n=e.split(`
208
- `),i=[];for(let o=0;o<Math.max(r.length,n.length);o++)r[o]!==n[o]&&i.push(o);return i}var qw=Symbol("clack:cancel");function kt(t){return t===qw}function ul(t,e){t.isTTY&&t.setRawMode(e)}var Pw=new Map([["k","up"],["j","down"],["h","left"],["l","right"]]),VB=new Set(["up","down","left","right","space","enter"]),Ba=class{constructor({render:e,input:r=Lo.stdin,output:n=Lo.stdout,...i},o=!0){hr(this,"input"),hr(this,"output"),hr(this,"rl"),hr(this,"opts"),hr(this,"_track",!1),hr(this,"_render"),hr(this,"_cursor",0),hr(this,"state","initial"),hr(this,"value"),hr(this,"error",""),hr(this,"subscribers",new Map),hr(this,"_prevFrame",""),this.opts=i,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=e.bind(this),this._track=o,this.input=r,this.output=n}prompt(){let e=new $w.WriteStream(0);return e._write=(r,n,i)=>{this._track&&(this.value=this.rl.line.replace(/\t/g,""),this._cursor=this.rl.cursor,this.emit("value",this.value)),i()},this.input.pipe(e),this.rl=Vp.default.createInterface({input:this.input,output:e,tabSize:2,prompt:"",escapeCodeTimeout:50}),Vp.default.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),ul(this.input,!0),this.output.on("resize",this.render),this.render(),new Promise((r,n)=>{this.once("submit",()=>{this.output.write(At.cursor.show),this.output.off("resize",this.render),ul(this.input,!1),r(this.value)}),this.once("cancel",()=>{this.output.write(At.cursor.show),this.output.off("resize",this.render),ul(this.input,!1),r(qw)})})}on(e,r){let n=this.subscribers.get(e)??[];n.push({cb:r}),this.subscribers.set(e,n)}once(e,r){let n=this.subscribers.get(e)??[];n.push({cb:r,once:!0}),this.subscribers.set(e,n)}emit(e,...r){let n=this.subscribers.get(e)??[],i=[];for(let o of n)o.cb(...r),o.once&&i.push(()=>n.splice(n.indexOf(o),1));for(let o of i)o()}unsubscribe(){this.subscribers.clear()}onKeypress(e,r){if(this.state==="error"&&(this.state="active"),r?.name&&!this._track&&Pw.has(r.name)&&this.emit("cursor",Pw.get(r.name)),r?.name&&VB.has(r.name)&&this.emit("cursor",r.name),e&&(e.toLowerCase()==="y"||e.toLowerCase()==="n")&&this.emit("confirm",e.toLowerCase()==="y"),e===" "&&this.opts.placeholder&&(this.value||(this.rl.write(this.opts.placeholder),this.emit("value",this.opts.placeholder))),e&&this.emit("key",e.toLowerCase()),r?.name==="return"){if(this.opts.validate){let n=this.opts.validate(this.value);n&&(this.error=n,this.state="error",this.rl.write(this.value))}this.state!=="error"&&(this.state="submit")}e===""&&(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(`
209
- `),ul(this.input,!1),this.rl.close(),this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){let e=Tw(this._prevFrame,process.stdout.columns,{hard:!0}).split(`
208
+ `),i=[];for(let o=0;o<Math.max(r.length,n.length);o++)r[o]!==n[o]&&i.push(o);return i}var qw=Symbol("clack:cancel");function kt(t){return t===qw}function sl(t,e){t.isTTY&&t.setRawMode(e)}var Pw=new Map([["k","up"],["j","down"],["h","left"],["l","right"]]),VB=new Set(["up","down","left","right","space","enter"]),Ba=class{constructor({render:e,input:r=Lo.stdin,output:n=Lo.stdout,...i},o=!0){hr(this,"input"),hr(this,"output"),hr(this,"rl"),hr(this,"opts"),hr(this,"_track",!1),hr(this,"_render"),hr(this,"_cursor",0),hr(this,"state","initial"),hr(this,"value"),hr(this,"error",""),hr(this,"subscribers",new Map),hr(this,"_prevFrame",""),this.opts=i,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=e.bind(this),this._track=o,this.input=r,this.output=n}prompt(){let e=new $w.WriteStream(0);return e._write=(r,n,i)=>{this._track&&(this.value=this.rl.line.replace(/\t/g,""),this._cursor=this.rl.cursor,this.emit("value",this.value)),i()},this.input.pipe(e),this.rl=Vp.default.createInterface({input:this.input,output:e,tabSize:2,prompt:"",escapeCodeTimeout:50}),Vp.default.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),sl(this.input,!0),this.output.on("resize",this.render),this.render(),new Promise((r,n)=>{this.once("submit",()=>{this.output.write(At.cursor.show),this.output.off("resize",this.render),sl(this.input,!1),r(this.value)}),this.once("cancel",()=>{this.output.write(At.cursor.show),this.output.off("resize",this.render),sl(this.input,!1),r(qw)})})}on(e,r){let n=this.subscribers.get(e)??[];n.push({cb:r}),this.subscribers.set(e,n)}once(e,r){let n=this.subscribers.get(e)??[];n.push({cb:r,once:!0}),this.subscribers.set(e,n)}emit(e,...r){let n=this.subscribers.get(e)??[],i=[];for(let o of n)o.cb(...r),o.once&&i.push(()=>n.splice(n.indexOf(o),1));for(let o of i)o()}unsubscribe(){this.subscribers.clear()}onKeypress(e,r){if(this.state==="error"&&(this.state="active"),r?.name&&!this._track&&Pw.has(r.name)&&this.emit("cursor",Pw.get(r.name)),r?.name&&VB.has(r.name)&&this.emit("cursor",r.name),e&&(e.toLowerCase()==="y"||e.toLowerCase()==="n")&&this.emit("confirm",e.toLowerCase()==="y"),e===" "&&this.opts.placeholder&&(this.value||(this.rl.write(this.opts.placeholder),this.emit("value",this.opts.placeholder))),e&&this.emit("key",e.toLowerCase()),r?.name==="return"){if(this.opts.validate){let n=this.opts.validate(this.value);n&&(this.error=n,this.state="error",this.rl.write(this.value))}this.state!=="error"&&(this.state="submit")}e===""&&(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(`
209
+ `),sl(this.input,!1),this.rl.close(),this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){let e=Tw(this._prevFrame,process.stdout.columns,{hard:!0}).split(`
210
210
  `).length-1;this.output.write(At.cursor.move(-999,e*-1))}render(){let e=Tw(this._render(this)??"",process.stdout.columns,{hard:!0});if(e!==this._prevFrame){if(this.state==="initial")this.output.write(At.cursor.hide);else{let r=UB(this._prevFrame,e);if(this.restoreCursor(),r&&r?.length===1){let n=r[0];this.output.write(At.cursor.move(0,n)),this.output.write(At.erase.lines(1));let i=e.split(`
211
211
  `);this.output.write(i[n]),this._prevFrame=e,this.output.write(At.cursor.move(0,i.length-n-1));return}else if(r&&r?.length>1){let n=r[0];this.output.write(At.cursor.move(0,n)),this.output.write(At.erase.down());let i=e.split(`
212
212
  `).slice(n);this.output.write(i.join(`
213
- `)),this._prevFrame=e;return}this.output.write(At.erase.down())}this.output.write(e),this.state==="initial"&&(this.state="active"),this._prevFrame=e}}},ll=class extends Ba{get cursor(){return this.value?0:1}get _value(){return this.cursor===0}constructor(e){super(e,!1),this.value=!!e.initialValue,this.on("value",()=>{this.value=this._value}),this.on("confirm",r=>{this.output.write(At.cursor.move(0,-1)),this.value=r,this.state="submit",this.close()}),this.on("cursor",()=>{this.value=!this.value})}};var HB=Object.defineProperty,zB=(t,e,r)=>e in t?HB(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Rw=(t,e,r)=>(zB(t,typeof e!="symbol"?e+"":e,r),r),Mw=class extends Ba{constructor(t){super(t,!1),Rw(this,"options"),Rw(this,"cursor",0),this.options=t.options,this.cursor=this.options.findIndex(({value:e})=>e===t.initialValue),this.cursor===-1&&(this.cursor=0),this.changeValue(),this.on("cursor",e=>{switch(e){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}};var GB=Object.defineProperty,WB=(t,e,r)=>e in t?GB(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,KB=(t,e,r)=>(WB(t,typeof e!="symbol"?e+"":e,r),r),fl=class extends Ba{constructor(e){super(e),KB(this,"valueWithCursor",""),this.on("finalize",()=>{this.value||(this.value=e.defaultValue),this.valueWithCursor=this.value}),this.on("value",()=>{if(this.cursor>=this.value.length)this.valueWithCursor=`${this.value}${cl.default.inverse(cl.default.hidden("_"))}`;else{let r=this.value.slice(0,this.cursor),n=this.value.slice(this.cursor);this.valueWithCursor=`${r}${cl.default.inverse(n[0])}${n.slice(1)}`}})}get cursor(){return this._cursor}},YB=globalThis.process.platform.startsWith("win");function Uw({input:t=Lo.stdin,output:e=Lo.stdout,overwrite:r=!0,hideCursor:n=!0}={}){let i=Gn.createInterface({input:t,output:e,prompt:"",tabSize:1});Gn.emitKeypressEvents(t,i),t.isTTY&&t.setRawMode(!0);let o=(s,{name:a})=>{if(String(s)===""&&process.exit(0),!r)return;Gn.moveCursor(e,a==="return"?0:-1,a==="return"?-1:0,()=>{Gn.clearLine(e,1,()=>{t.once("keypress",o)})})};return n&&process.stdout.write(At.cursor.hide),t.once("keypress",o),()=>{t.off("keypress",o),n&&process.stdout.write(At.cursor.show),t.isTTY&&!YB&&t.setRawMode(!1),i.terminal=!1,i.close()}}var pr=ce(require("node:process"),1),H=ce(qp(),1),Bo=ce(Te(),1);function JB(){return pr.default.platform!=="win32"?pr.default.env.TERM!=="linux":!!pr.default.env.CI||!!pr.default.env.WT_SESSION||!!pr.default.env.TERMINUS_SUBLIME||pr.default.env.ConEmuTask==="{cmd::Cmder}"||pr.default.env.TERM_PROGRAM==="Terminus-Sublime"||pr.default.env.TERM_PROGRAM==="vscode"||pr.default.env.TERM==="xterm-256color"||pr.default.env.TERM==="alacritty"||pr.default.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var Gp=JB(),Qe=(t,e)=>Gp?t:e,XB=Qe("\u25C6","*"),Vw=Qe("\u25A0","x"),Hw=Qe("\u25B2","x"),Yp=Qe("\u25C7","o"),ZB=Qe("\u250C","T"),Ke=Qe("\u2502","|"),qo=Qe("\u2514","\u2014"),Wp=Qe("\u25CF",">"),Kp=Qe("\u25CB"," "),Ice=Qe("\u25FB","[\u2022]"),jce=Qe("\u25FC","[+]"),Nce=Qe("\u25FB","[ ]"),Lce=Qe("\u25AA","\u2022"),Bce=Qe("\u2500","-"),qce=Qe("\u256E","+"),Mce=Qe("\u251C","+"),Uce=Qe("\u256F","+"),QB=Qe("\u25CF","\u2022"),eq=Qe("\u25C6","*"),tq=Qe("\u25B2","!"),rq=Qe("\u25A0","x"),Jp=t=>{switch(t){case"initial":case"active":return H.default.cyan(XB);case"cancel":return H.default.red(Vw);case"error":return H.default.yellow(Hw);case"submit":return H.default.green(Yp)}},nq=t=>{let{cursor:e,options:r,style:n}=t,i=t.maxItems??1/0,o=Math.max(process.stdout.rows-4,0),s=Math.min(o,Math.max(i,5)),a=0;e>=a+s-3?a=Math.max(Math.min(e-s+3,r.length-s),0):e<a+2&&(a=Math.max(e-2,0));let u=s<r.length&&a>0,c=s<r.length&&a+s<r.length;return r.slice(a,a+s).map((l,f,h)=>{let d=f===0&&u,p=f===h.length-1&&c;return d||p?H.default.dim("..."):n(l,f+a===e)})},Xp=t=>new fl({validate:t.validate,placeholder:t.placeholder,defaultValue:t.defaultValue,initialValue:t.initialValue,render(){let e=`${H.default.gray(Ke)}
213
+ `)),this._prevFrame=e;return}this.output.write(At.erase.down())}this.output.write(e),this.state==="initial"&&(this.state="active"),this._prevFrame=e}}},ul=class extends Ba{get cursor(){return this.value?0:1}get _value(){return this.cursor===0}constructor(e){super(e,!1),this.value=!!e.initialValue,this.on("value",()=>{this.value=this._value}),this.on("confirm",r=>{this.output.write(At.cursor.move(0,-1)),this.value=r,this.state="submit",this.close()}),this.on("cursor",()=>{this.value=!this.value})}};var HB=Object.defineProperty,zB=(t,e,r)=>e in t?HB(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Rw=(t,e,r)=>(zB(t,typeof e!="symbol"?e+"":e,r),r),Mw=class extends Ba{constructor(t){super(t,!1),Rw(this,"options"),Rw(this,"cursor",0),this.options=t.options,this.cursor=this.options.findIndex(({value:e})=>e===t.initialValue),this.cursor===-1&&(this.cursor=0),this.changeValue(),this.on("cursor",e=>{switch(e){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}};var GB=Object.defineProperty,WB=(t,e,r)=>e in t?GB(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,KB=(t,e,r)=>(WB(t,typeof e!="symbol"?e+"":e,r),r),cl=class extends Ba{constructor(e){super(e),KB(this,"valueWithCursor",""),this.on("finalize",()=>{this.value||(this.value=e.defaultValue),this.valueWithCursor=this.value}),this.on("value",()=>{if(this.cursor>=this.value.length)this.valueWithCursor=`${this.value}${al.default.inverse(al.default.hidden("_"))}`;else{let r=this.value.slice(0,this.cursor),n=this.value.slice(this.cursor);this.valueWithCursor=`${r}${al.default.inverse(n[0])}${n.slice(1)}`}})}get cursor(){return this._cursor}},YB=globalThis.process.platform.startsWith("win");function Uw({input:t=Lo.stdin,output:e=Lo.stdout,overwrite:r=!0,hideCursor:n=!0}={}){let i=Gn.createInterface({input:t,output:e,prompt:"",tabSize:1});Gn.emitKeypressEvents(t,i),t.isTTY&&t.setRawMode(!0);let o=(s,{name:a})=>{if(String(s)===""&&process.exit(0),!r)return;Gn.moveCursor(e,a==="return"?0:-1,a==="return"?-1:0,()=>{Gn.clearLine(e,1,()=>{t.once("keypress",o)})})};return n&&process.stdout.write(At.cursor.hide),t.once("keypress",o),()=>{t.off("keypress",o),n&&process.stdout.write(At.cursor.show),t.isTTY&&!YB&&t.setRawMode(!1),i.terminal=!1,i.close()}}var pr=ce(require("node:process"),1),H=ce(qp(),1),Bo=ce(Te(),1);function JB(){return pr.default.platform!=="win32"?pr.default.env.TERM!=="linux":!!pr.default.env.CI||!!pr.default.env.WT_SESSION||!!pr.default.env.TERMINUS_SUBLIME||pr.default.env.ConEmuTask==="{cmd::Cmder}"||pr.default.env.TERM_PROGRAM==="Terminus-Sublime"||pr.default.env.TERM_PROGRAM==="vscode"||pr.default.env.TERM==="xterm-256color"||pr.default.env.TERM==="alacritty"||pr.default.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var Gp=JB(),Qe=(t,e)=>Gp?t:e,XB=Qe("\u25C6","*"),Vw=Qe("\u25A0","x"),Hw=Qe("\u25B2","x"),Yp=Qe("\u25C7","o"),ZB=Qe("\u250C","T"),Ke=Qe("\u2502","|"),qo=Qe("\u2514","\u2014"),Wp=Qe("\u25CF",">"),Kp=Qe("\u25CB"," "),Ice=Qe("\u25FB","[\u2022]"),jce=Qe("\u25FC","[+]"),Nce=Qe("\u25FB","[ ]"),Lce=Qe("\u25AA","\u2022"),Bce=Qe("\u2500","-"),qce=Qe("\u256E","+"),Mce=Qe("\u251C","+"),Uce=Qe("\u256F","+"),QB=Qe("\u25CF","\u2022"),eq=Qe("\u25C6","*"),tq=Qe("\u25B2","!"),rq=Qe("\u25A0","x"),Jp=t=>{switch(t){case"initial":case"active":return H.default.cyan(XB);case"cancel":return H.default.red(Vw);case"error":return H.default.yellow(Hw);case"submit":return H.default.green(Yp)}},nq=t=>{let{cursor:e,options:r,style:n}=t,i=t.maxItems??1/0,o=Math.max(process.stdout.rows-4,0),s=Math.min(o,Math.max(i,5)),a=0;e>=a+s-3?a=Math.max(Math.min(e-s+3,r.length-s),0):e<a+2&&(a=Math.max(e-2,0));let u=s<r.length&&a>0,c=s<r.length&&a+s<r.length;return r.slice(a,a+s).map((l,f,h)=>{let d=f===0&&u,p=f===h.length-1&&c;return d||p?H.default.dim("..."):n(l,f+a===e)})},Xp=t=>new cl({validate:t.validate,placeholder:t.placeholder,defaultValue:t.defaultValue,initialValue:t.initialValue,render(){let e=`${H.default.gray(Ke)}
214
214
  ${Jp(this.state)} ${t.message}
215
215
  `,r=t.placeholder?H.default.inverse(t.placeholder[0])+H.default.dim(t.placeholder.slice(1)):H.default.inverse(H.default.hidden("_")),n=this.value?this.valueWithCursor:r;switch(this.state){case"error":return`${e.trim()}
216
216
  ${H.default.yellow(Ke)} ${n}
@@ -218,7 +218,7 @@ ${H.default.yellow(qo)} ${H.default.yellow(this.error)}
218
218
  `;case"submit":return`${e}${H.default.gray(Ke)} ${H.default.dim(this.value||t.placeholder)}`;case"cancel":return`${e}${H.default.gray(Ke)} ${H.default.strikethrough(H.default.dim(this.value??""))}${this.value?.trim()?`
219
219
  `+H.default.gray(Ke):""}`;default:return`${e}${H.default.cyan(Ke)} ${n}
220
220
  ${H.default.cyan(qo)}
221
- `}}}).prompt();var Pe=t=>{let e=t.active??"Yes",r=t.inactive??"No";return new ll({active:e,inactive:r,initialValue:t.initialValue??!0,render(){let n=`${H.default.gray(Ke)}
221
+ `}}}).prompt();var Pe=t=>{let e=t.active??"Yes",r=t.inactive??"No";return new ul({active:e,inactive:r,initialValue:t.initialValue??!0,render(){let n=`${H.default.gray(Ke)}
222
222
  ${Jp(this.state)} ${t.message}
223
223
  `,i=this.value?e:r;switch(this.state){case"submit":return`${n}${H.default.gray(Ke)} ${H.default.dim(i)}`;case"cancel":return`${n}${H.default.gray(Ke)} ${H.default.strikethrough(H.default.dim(i))}
224
224
  ${H.default.gray(Ke)}`;default:return`${n}${H.default.cyan(Ke)} ${this.value?`${H.default.green(Wp)} ${e}`:`${H.default.dim(Kp)} ${H.default.dim(e)}`} ${H.default.dim("/")} ${this.value?`${H.default.dim(Kp)} ${H.default.dim(r)}`:`${H.default.green(Wp)} ${r}`}
@@ -240,19 +240,19 @@ ${H.default.gray(qo)} ${t}
240
240
  `)}
241
241
  `)},info:t=>{m.message(t,{symbol:H.default.blue(QB)})},success:t=>{m.message(t,{symbol:H.default.green(eq)})},step:t=>{m.message(t,{symbol:H.default.green(Yp)})},warn:t=>{m.message(t,{symbol:H.default.yellow(tq)})},warning:t=>{m.warn(t)},error:t=>{m.message(t,{symbol:H.default.red(rq)})}},be=()=>{let t=Gp?["\u25D2","\u25D0","\u25D3","\u25D1"]:["\u2022","o","O","0"],e=Gp?80:120,r,n,i=!1,o="",s=d=>{let p=d>1?"Something went wrong":"Canceled";i&&h(p,d)},a=()=>s(2),u=()=>s(1),c=()=>{process.on("uncaughtExceptionMonitor",a),process.on("unhandledRejection",a),process.on("SIGINT",u),process.on("SIGTERM",u),process.on("exit",s)},l=()=>{process.removeListener("uncaughtExceptionMonitor",a),process.removeListener("unhandledRejection",a),process.removeListener("SIGINT",u),process.removeListener("SIGTERM",u),process.removeListener("exit",s)},f=(d="")=>{i=!0,r=Uw(),o=d.replace(/\.+$/,""),process.stdout.write(`${H.default.gray(Ke)}
242
242
  `);let p=0,v=0;c(),n=setInterval(()=>{let g=H.default.magenta(t[p]),w=".".repeat(Math.floor(v)).slice(0,3);process.stdout.write(Bo.cursor.move(-999,0)),process.stdout.write(Bo.erase.down(1)),process.stdout.write(`${g} ${o}${w}`),p=p+1<t.length?p+1:0,v=v<t.length?v+.125:0},e)},h=(d="",p=0)=>{o=d??o,i=!1,clearInterval(n);let v=p===0?H.default.green(Yp):p===1?H.default.red(Vw):H.default.red(Hw);process.stdout.write(Bo.cursor.move(-999,0)),process.stdout.write(Bo.erase.down(1)),process.stdout.write(`${v} ${o}
243
- `),l(),r()};return{start:f,stop:h,message:(d="")=>{o=d??o}}};var it=require("node:fs"),Th=require("node:os"),tt=ce(require("node:path")),ar=require("node:process"),vi=ce(pl());var yn=require("fs"),Ma=(t=".",e="unknown")=>{let r=`${t}/bun.lockb`,n=`${t}/pnpm-lock.yaml`,i=`${t}/yarn.lock`,o=`${t}/package-lock.json`;return(0,yn.existsSync)(r)?"bun":(0,yn.existsSync)(n)?"pnpm":(0,yn.existsSync)(i)?"yarn":(0,yn.existsSync)(o)?"npm":e},ml=(t=Ma(),e=!1)=>{switch(t){case"bun":return e?"bun install":"install";case"pnpm":return e?"pnpm install":"install";case"yarn":return e?"yarn install":"install";case"npm":return e?"npm install":"install";case"unknown":return e?"unknown unknown":"unknown";default:return e?"npm install":"install"}},zw=(t=".",e="npx")=>{let r=`${t}/bun.lockb`,n=`${t}/pnpm-lock.yaml`,i=`${t}/yarn.lock`,o=`${t}/package-lock.json`;return(0,yn.existsSync)(r)?"bunx":(0,yn.existsSync)(n)?"pnpm exec":(0,yn.existsSync)(i)?"yarn dlx":(0,yn.existsSync)(o)?"npx":e};var da=ce(U_()),Y6=ce(bu()),tb=ce(jC());var ti=class extends Error{response;request;options;constructor(e,r,n){let i=e.status||e.status===0?e.status:"",o=e.statusText||"",s=`${i} ${o}`.trim(),a=s?`status code ${s}`:"an unknown error";super(`Request failed with ${a}: ${r.method} ${r.url}`),this.name="HTTPError",this.response=e,this.request=r,this.options=n}};var as=class extends Error{request;constructor(e){super(`Request timed out: ${e.method} ${e.url}`),this.name="TimeoutError",this.request=e}};var us=t=>t!==null&&typeof t=="object";var _u=(...t)=>{for(let e of t)if((!us(e)||Array.isArray(e))&&e!==void 0)throw new TypeError("The `options` argument must be an object");return Bg({},...t)},Ng=(t={},e={})=>{let r=new globalThis.Headers(t),n=e instanceof globalThis.Headers,i=new globalThis.Headers(e);for(let[o,s]of i.entries())n&&s==="undefined"||s===void 0?r.delete(o):r.set(o,s);return r};function tf(t,e,r){return Object.hasOwn(e,r)&&e[r]===void 0?[]:Bg(t[r]??[],e[r]??[])}var Lg=(t={},e={})=>({beforeRequest:tf(t,e,"beforeRequest"),beforeRetry:tf(t,e,"beforeRetry"),afterResponse:tf(t,e,"afterResponse"),beforeError:tf(t,e,"beforeError")}),Bg=(...t)=>{let e={},r={},n={};for(let i of t)if(Array.isArray(i))Array.isArray(e)||(e=[]),e=[...e,...i];else if(us(i)){for(let[o,s]of Object.entries(i))us(s)&&o in e&&(s=Bg(e[o],s)),e={...e,[o]:s};us(i.hooks)&&(n=Lg(n,i.hooks),e.hooks=n),us(i.headers)&&(r=Ng(r,i.headers),e.headers=r)}return e};var NC=(()=>{let t=!1,e=!1,r=typeof globalThis.ReadableStream=="function",n=typeof globalThis.Request=="function";if(r&&n)try{e=new globalThis.Request("https://empty.invalid",{body:new globalThis.ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type")}catch(i){if(i instanceof Error&&i.message==="unsupported BodyInit type")return!1;throw i}return t&&!e})(),LC=typeof globalThis.AbortController=="function",BC=typeof globalThis.ReadableStream=="function",qC=typeof globalThis.FormData=="function",rf=["get","post","put","patch","head","delete"],c9=()=>{};c9();var MC={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*"},nf=2147483647,of=Symbol("stop"),UC={json:!0,parseJson:!0,stringifyJson:!0,searchParams:!0,prefixUrl:!0,retry:!0,timeout:!0,hooks:!0,throwHttpErrors:!0,onDownloadProgress:!0,fetch:!0},VC={method:!0,headers:!0,body:!0,mode:!0,credentials:!0,cache:!0,redirect:!0,referrer:!0,referrerPolicy:!0,integrity:!0,keepalive:!0,signal:!0,window:!0,dispatcher:!0,duplex:!0,priority:!0};var zC=t=>rf.includes(t)?t.toUpperCase():t,l9=["get","put","head","delete","options","trace"],f9=[408,413,429,500,502,503,504],d9=[413,429,503],HC={limit:2,methods:l9,statusCodes:f9,afterStatusCodes:d9,maxRetryAfter:Number.POSITIVE_INFINITY,backoffLimit:Number.POSITIVE_INFINITY,delay:t=>.3*2**(t-1)*1e3},GC=(t={})=>{if(typeof t=="number")return{...HC,limit:t};if(t.methods&&!Array.isArray(t.methods))throw new Error("retry.methods must be an array");if(t.statusCodes&&!Array.isArray(t.statusCodes))throw new Error("retry.statusCodes must be an array");return{...HC,...t}};async function qg(t,e,r,n){return new Promise((i,o)=>{let s=setTimeout(()=>{r&&r.abort(),o(new as(t))},n.timeout);n.fetch(t,e).then(i).catch(o).then(()=>{clearTimeout(s)})})}async function Mg(t,{signal:e}){return new Promise((r,n)=>{e&&(e.throwIfAborted(),e.addEventListener("abort",i,{once:!0}));function i(){clearTimeout(o),n(e.reason)}let o=setTimeout(()=>{e?.removeEventListener("abort",i),r()},t)})}var WC=(t,e)=>{let r={};for(let n in e)!(n in VC)&&!(n in UC)&&!(n in t)&&(r[n]=e[n]);return r};var Eu=class t{static create(e,r){let n=new t(e,r),i=async()=>{if(typeof n._options.timeout=="number"&&n._options.timeout>nf)throw new RangeError(`The \`timeout\` option cannot be greater than ${nf}`);await Promise.resolve();let a=await n._fetch();for(let u of n._options.hooks.afterResponse){let c=await u(n.request,n._options,n._decorateResponse(a.clone()));c instanceof globalThis.Response&&(a=c)}if(n._decorateResponse(a),!a.ok&&n._options.throwHttpErrors){let u=new ti(a,n.request,n._options);for(let c of n._options.hooks.beforeError)u=await c(u);throw u}if(n._options.onDownloadProgress){if(typeof n._options.onDownloadProgress!="function")throw new TypeError("The `onDownloadProgress` option must be a function");if(!BC)throw new Error("Streams are not supported in your environment. `ReadableStream` is missing.");return n._stream(a.clone(),n._options.onDownloadProgress)}return a},s=n._options.retry.methods.includes(n.request.method.toLowerCase())?n._retry(i):i();for(let[a,u]of Object.entries(MC))s[a]=async()=>{n.request.headers.set("accept",n.request.headers.get("accept")||u);let l=(await s).clone();if(a==="json"){if(l.status===204||(await l.clone().arrayBuffer()).byteLength===0)return"";if(r.parseJson)return r.parseJson(await l.text())}return l[a]()};return s}request;abortController;_retryCount=0;_input;_options;constructor(e,r={}){if(this._input=e,this._options={...r,headers:Ng(this._input.headers,r.headers),hooks:Lg({beforeRequest:[],beforeRetry:[],beforeError:[],afterResponse:[]},r.hooks),method:zC(r.method??this._input.method),prefixUrl:String(r.prefixUrl||""),retry:GC(r.retry),throwHttpErrors:r.throwHttpErrors!==!1,timeout:r.timeout??1e4,fetch:r.fetch??globalThis.fetch.bind(globalThis)},typeof this._input!="string"&&!(this._input instanceof URL||this._input instanceof globalThis.Request))throw new TypeError("`input` must be a string, URL, or Request");if(this._options.prefixUrl&&typeof this._input=="string"){if(this._input.startsWith("/"))throw new Error("`input` must not begin with a slash when using `prefixUrl`");this._options.prefixUrl.endsWith("/")||(this._options.prefixUrl+="/"),this._input=this._options.prefixUrl+this._input}if(LC){this.abortController=new globalThis.AbortController;let n=this._options.signal??this._input.signal;n?.addEventListener("abort",()=>{this.abortController.abort(n.reason)}),this._options.signal=this.abortController.signal}if(NC&&(this._options.duplex="half"),this._options.json!==void 0&&(this._options.body=this._options.stringifyJson?.(this._options.json)??JSON.stringify(this._options.json),this._options.headers.set("content-type",this._options.headers.get("content-type")??"application/json")),this.request=new globalThis.Request(this._input,this._options),this._options.searchParams){let i="?"+(typeof this._options.searchParams=="string"?this._options.searchParams.replace(/^\?/,""):new URLSearchParams(this._options.searchParams).toString()),o=this.request.url.replace(/(?:\?.*?)?(?=#|$)/,i);(qC&&this._options.body instanceof globalThis.FormData||this._options.body instanceof URLSearchParams)&&!(this._options.headers&&this._options.headers["content-type"])&&this.request.headers.delete("content-type"),this.request=new globalThis.Request(new globalThis.Request(o,{...this.request}),this._options)}}_calculateRetryDelay(e){if(this._retryCount++,this._retryCount>this._options.retry.limit||e instanceof as)throw e;if(e instanceof ti){if(!this._options.retry.statusCodes.includes(e.response.status))throw e;let n=e.response.headers.get("Retry-After")??e.response.headers.get("RateLimit-Reset")??e.response.headers.get("X-RateLimit-Reset")??e.response.headers.get("X-Rate-Limit-Reset");if(n&&this._options.retry.afterStatusCodes.includes(e.response.status)){let i=Number(n)*1e3;Number.isNaN(i)?i=Date.parse(n)-Date.now():i>=Date.parse("2024-01-01")&&(i-=Date.now());let o=this._options.retry.maxRetryAfter??i;return i<o?i:o}if(e.response.status===413)throw e}let r=this._options.retry.delay(this._retryCount);return Math.min(this._options.retry.backoffLimit,r)}_decorateResponse(e){return this._options.parseJson&&(e.json=async()=>this._options.parseJson(await e.text())),e}async _retry(e){try{return await e()}catch(r){let n=Math.min(this._calculateRetryDelay(r),nf);if(this._retryCount<1)throw r;await Mg(n,{signal:this._options.signal});for(let i of this._options.hooks.beforeRetry)if(await i({request:this.request,options:this._options,error:r,retryCount:this._retryCount})===of)return;return this._retry(e)}}async _fetch(){for(let n of this._options.hooks.beforeRequest){let i=await n(this.request,this._options);if(i instanceof Request){this.request=i;break}if(i instanceof Response)return i}let e=WC(this.request,this._options),r=this.request;return this.request=r.clone(),this._options.timeout===!1?this._options.fetch(r,e):qg(r,e,this.abortController,this._options)}_stream(e,r){let n=Number(e.headers.get("content-length"))||0,i=0;return e.status===204?(r&&r({percent:1,totalBytes:n,transferredBytes:i},new Uint8Array),new globalThis.Response(null,{status:e.status,statusText:e.statusText,headers:e.headers})):new globalThis.Response(new globalThis.ReadableStream({async start(o){let s=e.body.getReader();r&&r({percent:0,transferredBytes:0,totalBytes:n},new Uint8Array);async function a(){let{done:u,value:c}=await s.read();if(u){o.close();return}if(r){i+=c.byteLength;let l=n===0?0:i/n;r({percent:l,transferredBytes:i,totalBytes:n},c)}o.enqueue(c),await a()}await a()}}),{status:e.status,statusText:e.statusText,headers:e.headers})}};var Ug=t=>{let e=(r,n)=>Eu.create(r,_u(t,n));for(let r of rf)e[r]=(n,i)=>Eu.create(n,_u(t,i,{method:r}));return e.create=r=>Ug(_u(r)),e.extend=r=>(typeof r=="function"&&(r=r(t??{})),Ug(_u(t,r))),e.stop=of,e},h9=Ug(),Hr=h9;var J6=ce(CS()),Ph=ce(nD());var Tc=ce(l6());async function f6(){let t=await(0,Tc.loadConfig)();return{config:t.app.extConfig,path:t.app.extConfigFilePath}}async function on(t,e=!1){let r=await(0,Tc.loadConfig)(),{extConfig:n}=r.app;n&&(n.plugins||(n.plugins={extConfig:{},CapacitorUpdater:{}}),n.plugins.CapacitorUpdater||(n.plugins.CapacitorUpdater={}),e?n=t.config:n.plugins.CapacitorUpdater=t.config.plugins?.CapacitorUpdater,(0,Tc.writeConfig)(n,r.app.extConfigFilePath))}var er=".capgo_key",ur=".capgo_key_v2",cr=`${er}.pub`,jn=`${ur}.pub`;var V6="https://capgo.app",H6="https://files.capgo.app",z6="https://api.capgo.app",G6="https://web.capgo.app",X6=20,Z6=12e4,_se="package.json",ha=/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-z-][0-9a-z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-z-][0-9a-z-]*))*))?(?:\+([0-9a-z-]+(?:\.[0-9a-z-]+)*))?$/i,Q=t=>t?`
244
- ${J6.default.render(t)}`:"";function W6(t){return new Promise(e=>{setTimeout(e,t)})}function rb(t){return(0,vi.isMonorepo)(t)?(0,vi.findMonorepoRoot)(t):(0,vi.isNXMonorepo)(t)?(0,vi.findNXMonorepoRoot)(t):t}async function jt(t=rb((0,ar.cwd)()),e=void 0){e&&((0,it.existsSync)(e)||(m.error(`Package.json at ${e} does not exist`),(0,ar.exit)(1)));let r=(0,it.readFileSync)(e||(0,tt.join)(t,_se));return JSON.parse(r)}async function ee(){try{let t=await f6();return t||(m.error("No capacitor config file found, run `cap init` first"),A.error("")),t}catch(t){m.error(`No capacitor config file found, run \`cap init\` first ${Q(t)}`),A.error("")}}async function wo(t){let e=await ee();return e?.config&&(e.config.plugins||(e.config.plugins={extConfig:{},CapacitorUpdater:{}}),e.config.plugins.CapacitorUpdater||(e.config.plugins.CapacitorUpdater={}),e.config.plugins.CapacitorUpdater={...e.config.plugins.CapacitorUpdater,...t},on(e)),e}async function Cr(){try{let t=await ee(),e={host:t?.config?.plugins?.CapacitorUpdater?.localHost||V6,hostWeb:t?.config?.plugins?.CapacitorUpdater?.localWebHost||G6,hostFilesApi:t?.config?.plugins?.CapacitorUpdater?.localApiFiles||H6,hostApi:t?.config?.plugins?.CapacitorUpdater?.localApi||z6};return t?.config?.plugins?.CapacitorUpdater?.localSupa&&t?.config?.plugins?.CapacitorUpdater?.localSupaAnon&&(m.info("Using custom supabase instance from capacitor.config.json"),e.supaKey=t?.config?.plugins?.CapacitorUpdater?.localSupaAnon,e.supaHost=t?.config?.plugins?.CapacitorUpdater?.localSupa),e}catch{return{host:V6,hostWeb:G6,hostFilesApi:H6,hostApi:z6}}}var Ese=/([A-Za-z0-9]+)\.(java|swift|kt|scala)$/;async function nb(){let t=await Cr();return Hr.get(`${t.hostApi}/private/config`).then(e=>e.json()).then(e=>({...e,...t})).catch(()=>(m.info(`Local config ${Q(t)}`),t))}async function Q6(){let t=await Cr();return Hr.get(`${t.hostFilesApi}/files/config`).then(e=>e.json()).catch(()=>({partialUpload:!1,TUSUpload:!1,partialUploadForced:!1,TUSUploadForced:!1}))}async function de(t){let e=await nb();return(!e.supaHost||!e.supaKey)&&(m.error("Cannot connect to server please try again later"),A.error("")),(0,da.createClient)(e.supaHost,e.supaKey,{auth:{persistSession:!1},global:{headers:{capgkey:t}}})}async function Cse(t,e,r){let{data:n}=await t.rpc("is_allowed_capgkey",{apikey:e,keymode:r}).single();if(!n){m.error("Invalid API key or insufficient permissions.");let i=r.map((o,s)=>r.length===1?`"${o}"`:s===r.length-1?`or "${o}"`:`"${o}", `).join("");m.error(`Your key should be: ${i} mode.`),A.error("")}}async function Sse(t,e){let{data:r}=await t.rpc("is_paying_org",{orgid:e}).single();return r||!1}async function xse(t,e){let{data:r}=await t.rpc("is_trial_org",{orgid:e}).single();return r||0}async function Fse(t,e){let{data:r}=await t.rpc("is_allowed_action_org",{orgid:e}).single();return!!r}async function Ose(t,e,r){let{data:n}=await t.rpc("is_allowed_action",{apikey:r,appid:e}).single();return!!n}var xt=(s=>(s[s.none=0]="none",s[s.read=1]="read",s[s.upload=2]="upload",s[s.write=3]="write",s[s.admin=4]="admin",s[s.super_admin=5]="super_admin",s))(xt||{}),ej=(t,e)=>t>=e;async function tj(t,e,r){let{data:n,error:i}=await t.rpc("get_org_perm_for_apikey",{apikey:e,app_id:r}).single();if(i&&(m.error("Cannot get permissions for organization!"),console.error(i),(0,ar.exit)(1)),n.includes("perm")){let a=null;switch(n){case"perm_none":{a=0;break}case"perm_read":{a=1;break}case"perm_upload":{a=2;break}case"perm_write":{a=3;break}case"perm_admin":{a=4;break}case"perm_owner":{a=5;break}default:n.includes("invite")&&(m.info("Please accept/deny the organization invitation before trying to access the app"),(0,ar.exit)(1)),m.error(`Invalid output when fetching organization permission. Response: ${n}`),(0,ar.exit)(1)}return{okay:!0,data:a}}let s=null;switch(n){case"INVALID_APIKEY":{s="INVALID_APIKEY";break}case"NO_APP":{s="NO_APP";break}case"NO_ORG":{s="NO_ORG";break}default:m.error(`Invalid error when fetching organization permission. Response: ${n}`),(0,ar.exit)(1)}return{okay:!1,error:s}}async function pa(t,e,r,n,i=!0){let o=await nb();await(n?Ose(t,n,r):Fse(t,e))||(m.error(`You need to upgrade your plan to continue to use capgo.
243
+ `),l(),r()};return{start:f,stop:h,message:(d="")=>{o=d??o}}};var it=require("node:fs"),Ah=require("node:os"),tt=ce(require("node:path")),ar=require("node:process"),vi=ce(dl());var yn=require("fs"),Ma=(t=".",e="unknown")=>{let r=`${t}/bun.lockb`,n=`${t}/pnpm-lock.yaml`,i=`${t}/yarn.lock`,o=`${t}/package-lock.json`;return(0,yn.existsSync)(r)?"bun":(0,yn.existsSync)(n)?"pnpm":(0,yn.existsSync)(i)?"yarn":(0,yn.existsSync)(o)?"npm":e},hl=(t=Ma(),e=!1)=>{switch(t){case"bun":return e?"bun install":"install";case"pnpm":return e?"pnpm install":"install";case"yarn":return e?"yarn install":"install";case"npm":return e?"npm install":"install";case"unknown":return e?"unknown unknown":"unknown";default:return e?"npm install":"install"}},zw=(t=".",e="npx")=>{let r=`${t}/bun.lockb`,n=`${t}/pnpm-lock.yaml`,i=`${t}/yarn.lock`,o=`${t}/package-lock.json`;return(0,yn.existsSync)(r)?"bunx":(0,yn.existsSync)(n)?"pnpm exec":(0,yn.existsSync)(i)?"yarn dlx":(0,yn.existsSync)(o)?"npx":e};var da=ce(U_()),Y6=ce(bu()),tb=ce(jC());var ti=class extends Error{response;request;options;constructor(e,r,n){let i=e.status||e.status===0?e.status:"",o=e.statusText||"",s=`${i} ${o}`.trim(),a=s?`status code ${s}`:"an unknown error";super(`Request failed with ${a}: ${r.method} ${r.url}`),this.name="HTTPError",this.response=e,this.request=r,this.options=n}};var as=class extends Error{request;constructor(e){super(`Request timed out: ${e.method} ${e.url}`),this.name="TimeoutError",this.request=e}};var us=t=>t!==null&&typeof t=="object";var _u=(...t)=>{for(let e of t)if((!us(e)||Array.isArray(e))&&e!==void 0)throw new TypeError("The `options` argument must be an object");return Bg({},...t)},Ng=(t={},e={})=>{let r=new globalThis.Headers(t),n=e instanceof globalThis.Headers,i=new globalThis.Headers(e);for(let[o,s]of i.entries())n&&s==="undefined"||s===void 0?r.delete(o):r.set(o,s);return r};function Ql(t,e,r){return Object.hasOwn(e,r)&&e[r]===void 0?[]:Bg(t[r]??[],e[r]??[])}var Lg=(t={},e={})=>({beforeRequest:Ql(t,e,"beforeRequest"),beforeRetry:Ql(t,e,"beforeRetry"),afterResponse:Ql(t,e,"afterResponse"),beforeError:Ql(t,e,"beforeError")}),Bg=(...t)=>{let e={},r={},n={};for(let i of t)if(Array.isArray(i))Array.isArray(e)||(e=[]),e=[...e,...i];else if(us(i)){for(let[o,s]of Object.entries(i))us(s)&&o in e&&(s=Bg(e[o],s)),e={...e,[o]:s};us(i.hooks)&&(n=Lg(n,i.hooks),e.hooks=n),us(i.headers)&&(r=Ng(r,i.headers),e.headers=r)}return e};var NC=(()=>{let t=!1,e=!1,r=typeof globalThis.ReadableStream=="function",n=typeof globalThis.Request=="function";if(r&&n)try{e=new globalThis.Request("https://empty.invalid",{body:new globalThis.ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type")}catch(i){if(i instanceof Error&&i.message==="unsupported BodyInit type")return!1;throw i}return t&&!e})(),LC=typeof globalThis.AbortController=="function",BC=typeof globalThis.ReadableStream=="function",qC=typeof globalThis.FormData=="function",ef=["get","post","put","patch","head","delete"],c9=()=>{};c9();var MC={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*"},tf=2147483647,rf=Symbol("stop"),UC={json:!0,parseJson:!0,stringifyJson:!0,searchParams:!0,prefixUrl:!0,retry:!0,timeout:!0,hooks:!0,throwHttpErrors:!0,onDownloadProgress:!0,fetch:!0},VC={method:!0,headers:!0,body:!0,mode:!0,credentials:!0,cache:!0,redirect:!0,referrer:!0,referrerPolicy:!0,integrity:!0,keepalive:!0,signal:!0,window:!0,dispatcher:!0,duplex:!0,priority:!0};var zC=t=>ef.includes(t)?t.toUpperCase():t,l9=["get","put","head","delete","options","trace"],f9=[408,413,429,500,502,503,504],d9=[413,429,503],HC={limit:2,methods:l9,statusCodes:f9,afterStatusCodes:d9,maxRetryAfter:Number.POSITIVE_INFINITY,backoffLimit:Number.POSITIVE_INFINITY,delay:t=>.3*2**(t-1)*1e3},GC=(t={})=>{if(typeof t=="number")return{...HC,limit:t};if(t.methods&&!Array.isArray(t.methods))throw new Error("retry.methods must be an array");if(t.statusCodes&&!Array.isArray(t.statusCodes))throw new Error("retry.statusCodes must be an array");return{...HC,...t}};async function qg(t,e,r,n){return new Promise((i,o)=>{let s=setTimeout(()=>{r&&r.abort(),o(new as(t))},n.timeout);n.fetch(t,e).then(i).catch(o).then(()=>{clearTimeout(s)})})}async function Mg(t,{signal:e}){return new Promise((r,n)=>{e&&(e.throwIfAborted(),e.addEventListener("abort",i,{once:!0}));function i(){clearTimeout(o),n(e.reason)}let o=setTimeout(()=>{e?.removeEventListener("abort",i),r()},t)})}var WC=(t,e)=>{let r={};for(let n in e)!(n in VC)&&!(n in UC)&&!(n in t)&&(r[n]=e[n]);return r};var Eu=class t{static create(e,r){let n=new t(e,r),i=async()=>{if(typeof n._options.timeout=="number"&&n._options.timeout>tf)throw new RangeError(`The \`timeout\` option cannot be greater than ${tf}`);await Promise.resolve();let a=await n._fetch();for(let u of n._options.hooks.afterResponse){let c=await u(n.request,n._options,n._decorateResponse(a.clone()));c instanceof globalThis.Response&&(a=c)}if(n._decorateResponse(a),!a.ok&&n._options.throwHttpErrors){let u=new ti(a,n.request,n._options);for(let c of n._options.hooks.beforeError)u=await c(u);throw u}if(n._options.onDownloadProgress){if(typeof n._options.onDownloadProgress!="function")throw new TypeError("The `onDownloadProgress` option must be a function");if(!BC)throw new Error("Streams are not supported in your environment. `ReadableStream` is missing.");return n._stream(a.clone(),n._options.onDownloadProgress)}return a},s=n._options.retry.methods.includes(n.request.method.toLowerCase())?n._retry(i):i();for(let[a,u]of Object.entries(MC))s[a]=async()=>{n.request.headers.set("accept",n.request.headers.get("accept")||u);let l=(await s).clone();if(a==="json"){if(l.status===204||(await l.clone().arrayBuffer()).byteLength===0)return"";if(r.parseJson)return r.parseJson(await l.text())}return l[a]()};return s}request;abortController;_retryCount=0;_input;_options;constructor(e,r={}){if(this._input=e,this._options={...r,headers:Ng(this._input.headers,r.headers),hooks:Lg({beforeRequest:[],beforeRetry:[],beforeError:[],afterResponse:[]},r.hooks),method:zC(r.method??this._input.method),prefixUrl:String(r.prefixUrl||""),retry:GC(r.retry),throwHttpErrors:r.throwHttpErrors!==!1,timeout:r.timeout??1e4,fetch:r.fetch??globalThis.fetch.bind(globalThis)},typeof this._input!="string"&&!(this._input instanceof URL||this._input instanceof globalThis.Request))throw new TypeError("`input` must be a string, URL, or Request");if(this._options.prefixUrl&&typeof this._input=="string"){if(this._input.startsWith("/"))throw new Error("`input` must not begin with a slash when using `prefixUrl`");this._options.prefixUrl.endsWith("/")||(this._options.prefixUrl+="/"),this._input=this._options.prefixUrl+this._input}if(LC){this.abortController=new globalThis.AbortController;let n=this._options.signal??this._input.signal;n?.addEventListener("abort",()=>{this.abortController.abort(n.reason)}),this._options.signal=this.abortController.signal}if(NC&&(this._options.duplex="half"),this._options.json!==void 0&&(this._options.body=this._options.stringifyJson?.(this._options.json)??JSON.stringify(this._options.json),this._options.headers.set("content-type",this._options.headers.get("content-type")??"application/json")),this.request=new globalThis.Request(this._input,this._options),this._options.searchParams){let i="?"+(typeof this._options.searchParams=="string"?this._options.searchParams.replace(/^\?/,""):new URLSearchParams(this._options.searchParams).toString()),o=this.request.url.replace(/(?:\?.*?)?(?=#|$)/,i);(qC&&this._options.body instanceof globalThis.FormData||this._options.body instanceof URLSearchParams)&&!(this._options.headers&&this._options.headers["content-type"])&&this.request.headers.delete("content-type"),this.request=new globalThis.Request(new globalThis.Request(o,{...this.request}),this._options)}}_calculateRetryDelay(e){if(this._retryCount++,this._retryCount>this._options.retry.limit||e instanceof as)throw e;if(e instanceof ti){if(!this._options.retry.statusCodes.includes(e.response.status))throw e;let n=e.response.headers.get("Retry-After")??e.response.headers.get("RateLimit-Reset")??e.response.headers.get("X-RateLimit-Reset")??e.response.headers.get("X-Rate-Limit-Reset");if(n&&this._options.retry.afterStatusCodes.includes(e.response.status)){let i=Number(n)*1e3;Number.isNaN(i)?i=Date.parse(n)-Date.now():i>=Date.parse("2024-01-01")&&(i-=Date.now());let o=this._options.retry.maxRetryAfter??i;return i<o?i:o}if(e.response.status===413)throw e}let r=this._options.retry.delay(this._retryCount);return Math.min(this._options.retry.backoffLimit,r)}_decorateResponse(e){return this._options.parseJson&&(e.json=async()=>this._options.parseJson(await e.text())),e}async _retry(e){try{return await e()}catch(r){let n=Math.min(this._calculateRetryDelay(r),tf);if(this._retryCount<1)throw r;await Mg(n,{signal:this._options.signal});for(let i of this._options.hooks.beforeRetry)if(await i({request:this.request,options:this._options,error:r,retryCount:this._retryCount})===rf)return;return this._retry(e)}}async _fetch(){for(let n of this._options.hooks.beforeRequest){let i=await n(this.request,this._options);if(i instanceof Request){this.request=i;break}if(i instanceof Response)return i}let e=WC(this.request,this._options),r=this.request;return this.request=r.clone(),this._options.timeout===!1?this._options.fetch(r,e):qg(r,e,this.abortController,this._options)}_stream(e,r){let n=Number(e.headers.get("content-length"))||0,i=0;return e.status===204?(r&&r({percent:1,totalBytes:n,transferredBytes:i},new Uint8Array),new globalThis.Response(null,{status:e.status,statusText:e.statusText,headers:e.headers})):new globalThis.Response(new globalThis.ReadableStream({async start(o){let s=e.body.getReader();r&&r({percent:0,transferredBytes:0,totalBytes:n},new Uint8Array);async function a(){let{done:u,value:c}=await s.read();if(u){o.close();return}if(r){i+=c.byteLength;let l=n===0?0:i/n;r({percent:l,transferredBytes:i,totalBytes:n},c)}o.enqueue(c),await a()}await a()}}),{status:e.status,statusText:e.statusText,headers:e.headers})}};var Ug=t=>{let e=(r,n)=>Eu.create(r,_u(t,n));for(let r of ef)e[r]=(n,i)=>Eu.create(n,_u(t,i,{method:r}));return e.create=r=>Ug(_u(r)),e.extend=r=>(typeof r=="function"&&(r=r(t??{})),Ug(_u(t,r))),e.stop=rf,e},h9=Ug(),Hr=h9;var J6=ce(CS()),kh=ce(nD());var Tc=ce(l6());async function f6(){let t=await(0,Tc.loadConfig)();return{config:t.app.extConfig,path:t.app.extConfigFilePath}}async function on(t,e=!1){let r=await(0,Tc.loadConfig)(),{extConfig:n}=r.app;n&&(n.plugins||(n.plugins={extConfig:{},CapacitorUpdater:{}}),n.plugins.CapacitorUpdater||(n.plugins.CapacitorUpdater={}),e?n=t.config:n.plugins.CapacitorUpdater=t.config.plugins?.CapacitorUpdater,(0,Tc.writeConfig)(n,r.app.extConfigFilePath))}var er=".capgo_key",ur=".capgo_key_v2",cr=`${er}.pub`,jn=`${ur}.pub`;var V6="https://capgo.app",H6="https://files.capgo.app",z6="https://api.capgo.app",G6="https://web.capgo.app",X6=20,Z6=12e4,_se="package.json",ha=/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-z-][0-9a-z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-z-][0-9a-z-]*))*))?(?:\+([0-9a-z-]+(?:\.[0-9a-z-]+)*))?$/i,Q=t=>t?`
244
+ ${J6.default.render(t)}`:"";function W6(t){return new Promise(e=>{setTimeout(e,t)})}function rb(t){return(0,vi.isMonorepo)(t)?(0,vi.findMonorepoRoot)(t):(0,vi.isNXMonorepo)(t)?(0,vi.findNXMonorepoRoot)(t):t}async function jt(t=rb((0,ar.cwd)()),e=void 0){e&&((0,it.existsSync)(e)||(m.error(`Package.json at ${e} does not exist`),(0,ar.exit)(1)));let r=(0,it.readFileSync)(e||(0,tt.join)(t,_se));return JSON.parse(r)}async function ee(){try{let t=await f6();return t||(m.error("No capacitor config file found, run `cap init` first"),A.error("")),t}catch(t){m.error(`No capacitor config file found, run \`cap init\` first ${Q(t)}`),A.error("")}}async function bo(t){let e=await ee();return e?.config&&(e.config.plugins||(e.config.plugins={extConfig:{},CapacitorUpdater:{}}),e.config.plugins.CapacitorUpdater||(e.config.plugins.CapacitorUpdater={}),e.config.plugins.CapacitorUpdater={...e.config.plugins.CapacitorUpdater,...t},on(e)),e}async function Cr(){try{let t=await ee(),e={host:t?.config?.plugins?.CapacitorUpdater?.localHost||V6,hostWeb:t?.config?.plugins?.CapacitorUpdater?.localWebHost||G6,hostFilesApi:t?.config?.plugins?.CapacitorUpdater?.localApiFiles||H6,hostApi:t?.config?.plugins?.CapacitorUpdater?.localApi||z6};return t?.config?.plugins?.CapacitorUpdater?.localSupa&&t?.config?.plugins?.CapacitorUpdater?.localSupaAnon&&(m.info("Using custom supabase instance from capacitor.config.json"),e.supaKey=t?.config?.plugins?.CapacitorUpdater?.localSupaAnon,e.supaHost=t?.config?.plugins?.CapacitorUpdater?.localSupa),e}catch{return{host:V6,hostWeb:G6,hostFilesApi:H6,hostApi:z6}}}var Ese=/([A-Za-z0-9]+)\.(java|swift|kt|scala)$/;async function nb(){let t=await Cr();return Hr.get(`${t.hostApi}/private/config`).then(e=>e.json()).then(e=>({...e,...t})).catch(()=>(m.info(`Local config ${Q(t)}`),t))}async function Q6(){let t=await Cr();return Hr.get(`${t.hostFilesApi}/files/config`).then(e=>e.json()).catch(()=>({partialUpload:!1,TUSUpload:!1,partialUploadForced:!1,TUSUploadForced:!1}))}async function de(t){let e=await nb();return(!e.supaHost||!e.supaKey)&&(m.error("Cannot connect to server please try again later"),A.error("")),(0,da.createClient)(e.supaHost,e.supaKey,{auth:{persistSession:!1},global:{headers:{capgkey:t}}})}async function Cse(t,e,r){let{data:n}=await t.rpc("is_allowed_capgkey",{apikey:e,keymode:r}).single();if(!n){m.error("Invalid API key or insufficient permissions.");let i=r.map((o,s)=>r.length===1?`"${o}"`:s===r.length-1?`or "${o}"`:`"${o}", `).join("");m.error(`Your key should be: ${i} mode.`),A.error("")}}async function Sse(t,e){let{data:r}=await t.rpc("is_paying_org",{orgid:e}).single();return r||!1}async function xse(t,e){let{data:r}=await t.rpc("is_trial_org",{orgid:e}).single();return r||0}async function Fse(t,e){let{data:r}=await t.rpc("is_allowed_action_org",{orgid:e}).single();return!!r}async function Ose(t,e,r){let{data:n}=await t.rpc("is_allowed_action",{apikey:r,appid:e}).single();return!!n}var xt=(s=>(s[s.none=0]="none",s[s.read=1]="read",s[s.upload=2]="upload",s[s.write=3]="write",s[s.admin=4]="admin",s[s.super_admin=5]="super_admin",s))(xt||{}),ej=(t,e)=>t>=e;async function tj(t,e,r){let{data:n,error:i}=await t.rpc("get_org_perm_for_apikey",{apikey:e,app_id:r}).single();if(i&&(m.error("Cannot get permissions for organization!"),console.error(i),(0,ar.exit)(1)),n.includes("perm")){let a=null;switch(n){case"perm_none":{a=0;break}case"perm_read":{a=1;break}case"perm_upload":{a=2;break}case"perm_write":{a=3;break}case"perm_admin":{a=4;break}case"perm_owner":{a=5;break}default:n.includes("invite")&&(m.info("Please accept/deny the organization invitation before trying to access the app"),(0,ar.exit)(1)),m.error(`Invalid output when fetching organization permission. Response: ${n}`),(0,ar.exit)(1)}return{okay:!0,data:a}}let s=null;switch(n){case"INVALID_APIKEY":{s="INVALID_APIKEY";break}case"NO_APP":{s="NO_APP";break}case"NO_ORG":{s="NO_ORG";break}default:m.error(`Invalid error when fetching organization permission. Response: ${n}`),(0,ar.exit)(1)}return{okay:!1,error:s}}async function pa(t,e,r,n,i=!0){let o=await nb();await(n?Ose(t,n,r):Fse(t,e))||(m.error(`You need to upgrade your plan to continue to use capgo.
245
245
  Upgrade here: ${o.hostWeb}/dashboard/settings/plans
246
246
  `),W6(100),Promise.resolve().then(()=>(U6(),M6)).then(c=>{c.default(`${o.hostWeb}/dashboard/settings/plans`)}),W6(500),A.error(""));let[a,u]=await Promise.all([xse(t,e),Sse(t,e)]);a>0&&i&&!u&&m.warn(`WARNING !!
247
247
  Trial expires in ${a} days, upgrade here: ${o.hostWeb}/dashboard/settings/plans
248
- `)}function pe(t=!1){let e=(0,Th.homedir)(),r,n=`${e}/.capgo`;return(0,it.existsSync)(n)&&(t||m.info(`Use global API key ${n}`),r=(0,it.readFileSync)(n,"utf8").trim()),n=".capgo",!r&&(0,it.existsSync)(n)&&(t||m.info(`Use local API key ${n}`),r=(0,it.readFileSync)(n,"utf8").trim()),r||(m.error(`Cannot find API key in local folder or global, please login first with ${Nt().runner} @capacitor/cli login`),A.error("")),r}async function*ib(t){let e=await(0,it.readdirSync)(t,{withFileTypes:!0});for(let r of e){let n=(0,tt.resolve)(t,r.name);r.isDirectory()&&!r.name.startsWith(".")&&!r.name.startsWith("node_modules")&&!r.name.startsWith("dist")?yield*ib(n):yield n}}function ma(t){let e=/\.(jpg|jpeg|png|gif|bmp|webp)$/i,r=t.match(e);if(r)switch(r[1].toLowerCase()){case"jpg":case"jpeg":return"image/jpeg";case"png":return"image/png";case"webp":return"image/webp"}return null}async function ob(){let t=(0,ar.cwd)(),e=!1,r=(0,tt.resolve)(t,"tsconfig.json");(0,it.existsSync)(r)&&(e=!0);for await(let n of ib(t)){if(n.includes("angular.json"))return m.info("Found angular project"),e?"angular-ts":"angular-js";if(n.includes("nuxt.config.js")||n.includes("nuxt.config.ts"))return m.info("Found nuxtjs project"),e?"nuxtjs-ts":"nuxtjs-js";if(n.includes("next.config.js")||n.includes("next.config.mjs"))return m.info("Found nextjs project"),e?"nextjs-ts":"nextjs-js";if(n.includes("svelte.config.js"))return m.info("Found sveltekit project"),e?"sveltekit-ts":"sveltekit-js";if(n.includes("rolluconfig.js"))return m.info("Found svelte project"),e?"svelte-ts":"svelte-js";if(n.includes("vue.config.js"))return m.info("Found vue project"),e?"vue-ts":"vue-js";if(n.includes("package.json")){let i=(0,tt.dirname)(n),o=await jt(i);if(o.dependencies){if(o.dependencies.react)return m.info("Found react project test"),e?"react-ts":"react-js";if(o.dependencies.vue)return m.info("Found vue project"),e?"vue-ts":"vue-js"}}}return"unknown"}function rj(t,e){return t==="angular-js"||t==="angular-ts"?e?"src/main.ts":"src/main.js":t==="nextjs-js"||t==="nextjs-ts"?e?"src/app/layout.tsx":"src/app/layout.js":t==="svelte-js"||t==="svelte-ts"||t==="vue-js"||t==="vue-ts"?e?"src/main.ts":"src/main.js":t==="react-js"||t==="react-ts"?e?"src/index.tsx":"src/index.js":null}async function nj(t){return t==="angular"?(m.info("Angular project detected"),"build"):t==="nuxtjs"?(m.info("Nuxtjs project detected"),"generate"):t==="nextjs"?(m.info("Nextjs project detected"),m.warn("Please make sure you have configured static export in your next.config.js: https://nextjs.org/docs/pages/building-your-application/deploying/static-exports"),m.warn("Please make sure you have the output: 'export' and distDir: 'dist' in your next.config.js"),await Pe({message:"Do you want to continue?"})||(m.error("Aborted"),A.error("")),"build"):(t==="sveltekit"&&(m.info("Sveltekit project detected"),m.warn("Please make sure you have the adapter-static installed: https://kit.svelte.dev/docs/adapter-static"),m.warn("Please make sure you have the pages: 'dist' and assets: 'dest', in your svelte.config.js adaptater"),await Pe({message:"Do you want to continue?"})||(m.error("Aborted"),A.error(""))),"build")}async function ij(){let t=/(main|index)\.(ts|tsx|js|jsx)$/,e="",r=(0,ar.cwd)(),n=r.split("/").length;for await(let i of ib(r))if(i.split("/").length-n<=2&&t.test(i)){e=i,m.info(`Found main file here ${i}`);break}return e}async function sb(t,e){return t.from("app_versions").upsert(e,{onConflict:"name,app_id"}).eq("app_id",e.app_id).eq("name",e.name)}async function oj(t,e,r){let n={app_id:e,name:r,version:0};try{let o=await t.functions.invoke("private/upload_link",{body:JSON.stringify(n)});if(o.error){if(o.error instanceof da.FunctionsHttpError){let s=await o.error.context.json();m.error(`Upload URL error: ${s.status||JSON.stringify(s)}`)}else m.error(`Cannot get upload url: ${o.error.message}`);return""}return o.data.url}catch(i){m.error(`Cannot get upload url ${Q(i)}`)}return""}async function*sj(t){let e=(0,it.readdirSync)(t,{withFileTypes:!0});for(let r of e){let n=(0,tt.join)(t,r.name);r.isDirectory()?yield*sj(n):yield n}}async function aj(t){let e=[];for await(let r of sj(t)){let n=(0,it.readFileSync)(r),i=await(0,Y6.checksum)(n,"sha256"),o=(0,tt.relative)(t,r);o.startsWith("/")&&(o=o.substring(1)),e.push({file:o,hash:i})}return e}async function Rh(t){return(0,Th.platform)()==="win32"?kse(t):Ase(t)}function Ase(t){let e=new tb.default;return e.addLocalFolder(t),e.toBuffer()}async function kse(t){m.info("Zipping file windows mode");let e=new tb.default,r=(n,i)=>{let o=(0,it.readdirSync)(n);for(let s of o){let a=(0,tt.join)(n,s),u=(0,it.statSync)(a);if(u.isFile()){let c=(0,it.readFileSync)(a);e.addFile((0,tt.join)(i,s).split(tt.sep).join("/"),c)}else u.isDirectory()&&r(a,(0,tt.join)(i,s))}};return r(t,""),e.toBuffer()}async function uj(t,e,r,n,i,o,s){return new Promise((a,u)=>{Fe(t,{channel:"app",event:"App TUS upload",icon:"\u23EB",user_id:r,tags:{"app-id":n},notify:!1}),new Ph.Upload(e,{endpoint:`${s.hostFilesApi}/files/upload/attachments/`,metadataForPartialUploads:{filename:`orgs/${r}/apps/${n}/${i}.zip`,filetype:"application/gzip"},metadata:{filename:`orgs/${r}/apps/${n}/${i}.zip`,filetype:"application/zip"},headers:{Authorization:t},onError(l){if(l instanceof Ph.DetailedError){let f=l.originalResponse?.getBody(),h=JSON.parse(f||'{"error": "unknown error"}');u(h.status||h.error||h.message||"unknown error")}else u(l.message||l.toString()||"unknown error")},onProgress(l,f){let h=(l/f*100).toFixed(2);o.message(`Uploaded ${h}%`)},async onSuccess(){await Fe(t,{channel:"app",event:"App TUS done",icon:"\u23EB",user_id:r,tags:{"app-id":n},notify:!1}).catch(),a(!0)}}).start()})}async function cj(t,e,r){let n={app_id:e,name:r};try{let o=await t.functions.invoke("private/delete_failed_version",{body:JSON.stringify(n),method:"DELETE"});if(o.error){if(o.error instanceof da.FunctionsHttpError){let s=await o.error.context.json();m.error(`Cannot delete failed version: ${s.status||JSON.stringify(s)}`)}else m.error(`Cannot delete failed version: ${o.error.message}`);return}return o.data?.status}catch(i){if(i instanceof da.FunctionsHttpError){let o=await i.context.json();m.error(`Cannot delete failed version: ${o.message||JSON.stringify(o)}`)}else m.error(`Cannot delete failed version: ${Q(i)}`)}}async function $h(t,e){if(!e.app_id||!e.name||!e.created_by)return m.error("missing app_id, name, or created_by"),Promise.reject(new Error("missing app_id, name, or created_by"));let{data:r,error:n}=await t.from("channels").select("enable_progressive_deploy, secondary_version_percentage, second_version").eq("app_id",e.app_id).eq("name",e.name).single();if(r&&!n){if(r.enable_progressive_deploy){if(m.info("Progressive deploy is enabled"),r.secondary_version_percentage!==1&&m.warn("Latest progressive deploy has not finished"),e.second_version=e.version,!r.second_version)return m.error("missing secondVersion"),Promise.reject(new Error("missing secondVersion"));e.version=r.second_version,e.secondary_version_percentage=.1,m.info("Started new progressive upload!")}return t.from("channels").update(e).eq("app_id",e.app_id).eq("name",e.name).select().single()}return t.from("channels").insert(e).select().single()}async function Fe(t,e){try{let r=await nb(),n=await Hr.post(`${r.host}/private/events`,{json:e,headers:{capgkey:t},timeout:1e4,retry:3}).json();n.error&&m.error(`Failed to send LogSnag event: ${n.error}`)}catch{}}async function ga(t,e){let{error:r,data:n}=await t.rpc("get_orgs_v5");r&&(m.error("Cannot get the list of organizations - exiting"),m.error(`Error ${JSON.stringify(r)}`),A.error(""));let i=n.filter(u=>!!e.find(c=>c===u.role));i.length===0&&(m.error(`Could not get organization with roles: ${e.join(" or ")} because the user does not have any org`),A.error(""));let o=i.length>1?await Mo({message:"Please pick the organization that you want to insert to",options:i.map(u=>({value:u.gid,label:u.name}))}):i[0].gid;kt(o)&&(m.error("Canceled organization selection, exiting"),A.error(""));let s=o,a=n.find(u=>u.gid===s);return m.info(`Using the organization "${a.name}" as the app owner`),a}var _o=t=>t.replace(/\./g,"--");async function me(t,e,r=["all"]){await Cse(t,e,r);let{data:n,error:i}=await t.rpc("get_user_id",{apikey:e}).single(),o=(n||"").toString();return(!o||i)&&(m.error("Cannot auth user with apikey"),A.error("")),o}async function Sr(t,e){let{data:r,error:n}=await t.from("apps").select("owner_org").eq("app_id",e).single();return(!r||n)&&(m.error(`Cannot get organization id for app id ${e}`),Q(n),A.error("")),r.owner_org}function ya(t){return new Date(t||"").toLocaleString()}var K6=!1,fa="npm",Ic="install",eb="npx";function Nt(){if(K6)return{pm:fa,command:Ic,installCommand:`${fa} ${Ic}`,runner:eb};let t=rb((0,ar.cwd)());return fa=Ma(t,"npm"),Ic=ml(fa),K6=!0,eb=zw(t),{pm:fa,command:Ic,installCommand:`${fa} ${Ic}`,runner:eb}}function lj(t){return(0,it.readdirSync)(t,{withFileTypes:!0}).flatMap(n=>{let i=(0,tt.join)(t,n.name);return n.isDirectory()?lj(i):i.split(`node_modules${tt.sep}`)[1]||i})}async function ab(t,e){let r=e?e.split(","):[],n;try{n=await jt("",t)}catch(l){m.error("Invalid package.json, JSON parsing failed"),console.error("json parse error: ",l),A.error("")}let i=t?tt.default.resolve(t).replace("package.json",""):rb((0,ar.cwd)()),{dependencies:o}=n;o||(m.error("Missing dependencies section in package.json"),A.error(""));for(let[l,f]of Object.entries(o))typeof f!="string"&&(m.error(`Invalid dependency ${l}: ${f}, expected string, got ${typeof f}`),A.error(""));let s=r.length===0?[(0,tt.join)((0,ar.cwd)(),"node_modules")]:r;if(!s.some(l=>(0,it.existsSync)(l))){let l=Ma(i,"npm"),f=ml(l);m.error(`Missing node_modules folder at ${s.join(", ")}, please run ${l} ${f}`),A.error("")}let u=!1,c=await Promise.all(Object.entries(o).map(async([l,f])=>{let h=!1,d=!1;for(let p of s){let v=(0,tt.join)(p,l);if((0,it.existsSync)(v)){h=!0;try{if(lj(v).some(w=>Ese.test(w))){d=!0;break}}catch(g){m.error(`Error reading node_modules files for ${l} package in ${p}`),console.error(g),A.error("")}}}if(!h){u=!0;let p=Ma(i,"npm"),v=ml(p);return m.error(`Missing dependency ${l}, please run ${p} ${v}`),{name:l,version:f}}return{name:l,version:f,native:d}})).catch(()=>[]);return(u||c.find(l=>l.native===void 0))&&A.error(""),c}async function Tse(t,e,r){let{data:n,error:i}=await t.from("channels").select("version(checksum)").eq("name",r).eq("app_id",e).single(),o=n;return i||o===null||!o.version||!o.version.checksum?null:o.version.checksum}async function Pse(t,e,r){let{data:n,error:i}=await t.from("channels").select(`version (
248
+ `)}function pe(t=!1){let e=(0,Ah.homedir)(),r,n=`${e}/.capgo`;return(0,it.existsSync)(n)&&(t||m.info(`Use global API key ${n}`),r=(0,it.readFileSync)(n,"utf8").trim()),n=".capgo",!r&&(0,it.existsSync)(n)&&(t||m.info(`Use local API key ${n}`),r=(0,it.readFileSync)(n,"utf8").trim()),r||(m.error(`Cannot find API key in local folder or global, please login first with ${Nt().runner} @capacitor/cli login`),A.error("")),r}async function*ib(t){let e=await(0,it.readdirSync)(t,{withFileTypes:!0});for(let r of e){let n=(0,tt.resolve)(t,r.name);r.isDirectory()&&!r.name.startsWith(".")&&!r.name.startsWith("node_modules")&&!r.name.startsWith("dist")?yield*ib(n):yield n}}function ma(t){let e=/\.(jpg|jpeg|png|gif|bmp|webp)$/i,r=t.match(e);if(r)switch(r[1].toLowerCase()){case"jpg":case"jpeg":return"image/jpeg";case"png":return"image/png";case"webp":return"image/webp"}return null}async function ob(){let t=(0,ar.cwd)(),e=!1,r=(0,tt.resolve)(t,"tsconfig.json");(0,it.existsSync)(r)&&(e=!0);for await(let n of ib(t)){if(n.includes("angular.json"))return m.info("Found angular project"),e?"angular-ts":"angular-js";if(n.includes("nuxt.config.js")||n.includes("nuxt.config.ts"))return m.info("Found nuxtjs project"),e?"nuxtjs-ts":"nuxtjs-js";if(n.includes("next.config.js")||n.includes("next.config.mjs"))return m.info("Found nextjs project"),e?"nextjs-ts":"nextjs-js";if(n.includes("svelte.config.js"))return m.info("Found sveltekit project"),e?"sveltekit-ts":"sveltekit-js";if(n.includes("rolluconfig.js"))return m.info("Found svelte project"),e?"svelte-ts":"svelte-js";if(n.includes("vue.config.js"))return m.info("Found vue project"),e?"vue-ts":"vue-js";if(n.includes("package.json")){let i=(0,tt.dirname)(n),o=await jt(i);if(o.dependencies){if(o.dependencies.react)return m.info("Found react project test"),e?"react-ts":"react-js";if(o.dependencies.vue)return m.info("Found vue project"),e?"vue-ts":"vue-js"}}}return"unknown"}function rj(t,e){return t==="angular-js"||t==="angular-ts"?e?"src/main.ts":"src/main.js":t==="nextjs-js"||t==="nextjs-ts"?e?"src/app/layout.tsx":"src/app/layout.js":t==="svelte-js"||t==="svelte-ts"||t==="vue-js"||t==="vue-ts"?e?"src/main.ts":"src/main.js":t==="react-js"||t==="react-ts"?e?"src/index.tsx":"src/index.js":null}async function nj(t){return t==="angular"?(m.info("Angular project detected"),"build"):t==="nuxtjs"?(m.info("Nuxtjs project detected"),"generate"):t==="nextjs"?(m.info("Nextjs project detected"),m.warn("Please make sure you have configured static export in your next.config.js: https://nextjs.org/docs/pages/building-your-application/deploying/static-exports"),m.warn("Please make sure you have the output: 'export' and distDir: 'dist' in your next.config.js"),await Pe({message:"Do you want to continue?"})||(m.error("Aborted"),A.error("")),"build"):(t==="sveltekit"&&(m.info("Sveltekit project detected"),m.warn("Please make sure you have the adapter-static installed: https://kit.svelte.dev/docs/adapter-static"),m.warn("Please make sure you have the pages: 'dist' and assets: 'dest', in your svelte.config.js adaptater"),await Pe({message:"Do you want to continue?"})||(m.error("Aborted"),A.error(""))),"build")}async function ij(){let t=/(main|index)\.(ts|tsx|js|jsx)$/,e="",r=(0,ar.cwd)(),n=r.split("/").length;for await(let i of ib(r))if(i.split("/").length-n<=2&&t.test(i)){e=i,m.info(`Found main file here ${i}`);break}return e}async function sb(t,e){return t.from("app_versions").upsert(e,{onConflict:"name,app_id"}).eq("app_id",e.app_id).eq("name",e.name)}async function oj(t,e,r){let n={app_id:e,name:r,version:0};try{let o=await t.functions.invoke("private/upload_link",{body:JSON.stringify(n)});if(o.error){if(o.error instanceof da.FunctionsHttpError){let s=await o.error.context.json();m.error(`Upload URL error: ${s.status||JSON.stringify(s)}`)}else m.error(`Cannot get upload url: ${o.error.message}`);return""}return o.data.url}catch(i){m.error(`Cannot get upload url ${Q(i)}`)}return""}async function*sj(t){let e=(0,it.readdirSync)(t,{withFileTypes:!0});for(let r of e){let n=(0,tt.join)(t,r.name);r.isDirectory()?yield*sj(n):yield n}}async function aj(t){let e=[];for await(let r of sj(t)){let n=(0,it.readFileSync)(r),i=await(0,Y6.checksum)(n,"sha256"),o=(0,tt.relative)(t,r);o.startsWith("/")&&(o=o.substring(1)),e.push({file:o,hash:i})}return e}async function Th(t){return(0,Ah.platform)()==="win32"?kse(t):Ase(t)}function Ase(t){let e=new tb.default;return e.addLocalFolder(t),e.toBuffer()}async function kse(t){m.info("Zipping file windows mode");let e=new tb.default,r=(n,i)=>{let o=(0,it.readdirSync)(n);for(let s of o){let a=(0,tt.join)(n,s),u=(0,it.statSync)(a);if(u.isFile()){let c=(0,it.readFileSync)(a);e.addFile((0,tt.join)(i,s).split(tt.sep).join("/"),c)}else u.isDirectory()&&r(a,(0,tt.join)(i,s))}};return r(t,""),e.toBuffer()}async function uj(t,e,r,n,i,o,s){return new Promise((a,u)=>{Fe(t,{channel:"app",event:"App TUS upload",icon:"\u23EB",user_id:r,tags:{"app-id":n},notify:!1}),new kh.Upload(e,{endpoint:`${s.hostFilesApi}/files/upload/attachments/`,metadataForPartialUploads:{filename:`orgs/${r}/apps/${n}/${i}.zip`,filetype:"application/gzip"},metadata:{filename:`orgs/${r}/apps/${n}/${i}.zip`,filetype:"application/zip"},headers:{Authorization:t},onError(l){if(l instanceof kh.DetailedError){let f=l.originalResponse?.getBody(),h=JSON.parse(f||'{"error": "unknown error"}');u(h.status||h.error||h.message||"unknown error")}else u(l.message||l.toString()||"unknown error")},onProgress(l,f){let h=(l/f*100).toFixed(2);o.message(`Uploaded ${h}%`)},async onSuccess(){await Fe(t,{channel:"app",event:"App TUS done",icon:"\u23EB",user_id:r,tags:{"app-id":n},notify:!1}).catch(),a(!0)}}).start()})}async function cj(t,e,r){let n={app_id:e,name:r};try{let o=await t.functions.invoke("private/delete_failed_version",{body:JSON.stringify(n),method:"DELETE"});if(o.error){if(o.error instanceof da.FunctionsHttpError){let s=await o.error.context.json();m.error(`Cannot delete failed version: ${s.status||JSON.stringify(s)}`)}else m.error(`Cannot delete failed version: ${o.error.message}`);return}return o.data?.status}catch(i){if(i instanceof da.FunctionsHttpError){let o=await i.context.json();m.error(`Cannot delete failed version: ${o.message||JSON.stringify(o)}`)}else m.error(`Cannot delete failed version: ${Q(i)}`)}}async function Ph(t,e){if(!e.app_id||!e.name||!e.created_by)return m.error("missing app_id, name, or created_by"),Promise.reject(new Error("missing app_id, name, or created_by"));let{data:r,error:n}=await t.from("channels").select("enable_progressive_deploy, secondary_version_percentage, second_version").eq("app_id",e.app_id).eq("name",e.name).single();if(r&&!n){if(r.enable_progressive_deploy){if(m.info("Progressive deploy is enabled"),r.secondary_version_percentage!==1&&m.warn("Latest progressive deploy has not finished"),e.second_version=e.version,!r.second_version)return m.error("missing secondVersion"),Promise.reject(new Error("missing secondVersion"));e.version=r.second_version,e.secondary_version_percentage=.1,m.info("Started new progressive upload!")}return t.from("channels").update(e).eq("app_id",e.app_id).eq("name",e.name).select().single()}return t.from("channels").insert(e).select().single()}async function Fe(t,e){try{let r=await nb(),n=await Hr.post(`${r.host}/private/events`,{json:e,headers:{capgkey:t},timeout:1e4,retry:3}).json();n.error&&m.error(`Failed to send LogSnag event: ${n.error}`)}catch{}}async function ga(t,e){let{error:r,data:n}=await t.rpc("get_orgs_v5");r&&(m.error("Cannot get the list of organizations - exiting"),m.error(`Error ${JSON.stringify(r)}`),A.error(""));let i=n.filter(u=>!!e.find(c=>c===u.role));i.length===0&&(m.error(`Could not get organization with roles: ${e.join(" or ")} because the user does not have any org`),A.error(""));let o=i.length>1?await Mo({message:"Please pick the organization that you want to insert to",options:i.map(u=>({value:u.gid,label:u.name}))}):i[0].gid;kt(o)&&(m.error("Canceled organization selection, exiting"),A.error(""));let s=o,a=n.find(u=>u.gid===s);return m.info(`Using the organization "${a.name}" as the app owner`),a}var wo=t=>t.replace(/\./g,"--");async function me(t,e,r=["all"]){await Cse(t,e,r);let{data:n,error:i}=await t.rpc("get_user_id",{apikey:e}).single(),o=(n||"").toString();return(!o||i)&&(m.error("Cannot auth user with apikey"),A.error("")),o}async function Sr(t,e){let{data:r,error:n}=await t.from("apps").select("owner_org").eq("app_id",e).single();return(!r||n)&&(m.error(`Cannot get organization id for app id ${e}`),Q(n),A.error("")),r.owner_org}function ya(t){return new Date(t||"").toLocaleString()}var K6=!1,fa="npm",Ic="install",eb="npx";function Nt(){if(K6)return{pm:fa,command:Ic,installCommand:`${fa} ${Ic}`,runner:eb};let t=rb((0,ar.cwd)());return fa=Ma(t,"npm"),Ic=hl(fa),K6=!0,eb=zw(t),{pm:fa,command:Ic,installCommand:`${fa} ${Ic}`,runner:eb}}function lj(t){return(0,it.readdirSync)(t,{withFileTypes:!0}).flatMap(n=>{let i=(0,tt.join)(t,n.name);return n.isDirectory()?lj(i):i.split(`node_modules${tt.sep}`)[1]||i})}async function ab(t,e){let r=e?e.split(","):[],n;try{n=await jt("",t)}catch(l){m.error("Invalid package.json, JSON parsing failed"),console.error("json parse error: ",l),A.error("")}let i=t?tt.default.resolve(t).replace("package.json",""):rb((0,ar.cwd)()),{dependencies:o}=n;o||(m.error("Missing dependencies section in package.json"),A.error(""));for(let[l,f]of Object.entries(o))typeof f!="string"&&(m.error(`Invalid dependency ${l}: ${f}, expected string, got ${typeof f}`),A.error(""));let s=r.length===0?[(0,tt.join)((0,ar.cwd)(),"node_modules")]:r;if(!s.some(l=>(0,it.existsSync)(l))){let l=Ma(i,"npm"),f=hl(l);m.error(`Missing node_modules folder at ${s.join(", ")}, please run ${l} ${f}`),A.error("")}let u=!1,c=await Promise.all(Object.entries(o).map(async([l,f])=>{let h=!1,d=!1;for(let p of s){let v=(0,tt.join)(p,l);if((0,it.existsSync)(v)){h=!0;try{if(lj(v).some(w=>Ese.test(w))){d=!0;break}}catch(g){m.error(`Error reading node_modules files for ${l} package in ${p}`),console.error(g),A.error("")}}}if(!h){u=!0;let p=Ma(i,"npm"),v=hl(p);return m.error(`Missing dependency ${l}, please run ${p} ${v}`),{name:l,version:f}}return{name:l,version:f,native:d}})).catch(()=>[]);return(u||c.find(l=>l.native===void 0))&&A.error(""),c}async function Tse(t,e,r){let{data:n,error:i}=await t.from("channels").select("version(checksum)").eq("name",r).eq("app_id",e).single(),o=n;return i||o===null||!o.version||!o.version.checksum?null:o.version.checksum}async function Pse(t,e,r){let{data:n,error:i}=await t.from("channels").select(`version (
249
249
  native_packages
250
250
  )`).eq("name",r).eq("app_id",e).single();i&&(m.error(`Error fetching native packages: ${i.message}`),A.error(""));let o;try{o=n.version.native_packages}catch{m.error("Error parsing native packages"),A.error("")}return o||(m.error("Error parsing native packages, perhaps the metadata does not exist?"),A.error("")),o.forEach(a=>{typeof a!="object"&&(m.error(`Invalid remote native package data: ${a}, expected object, got ${typeof a}`),A.error(""));let{name:u,version:c}=a;(!u||typeof u!="string")&&(m.error(`Invalid remote native package name: ${u}, expected string, got ${typeof u}`),A.error("")),(!c||typeof c!="string")&&(m.error(`Invalid remote native package version: ${c}, expected string, got ${typeof c}`),A.error(""))}),new Map(o.map(a=>[a.name,a]))}async function fj(t,e,r,n){let i=be();i.start(`Checking bundle checksum compatibility with channel ${r}`);let o=await Tse(t,e,r);if(!o){i.stop(`No checksum found for channel ${r}, the bundle will be uploaded`);return}o&&o===n&&(m.error(`Cannot upload the same bundle content.
251
251
  Current bundle checksum matches remote bundle for channel ${r}
252
252
  Did you builded your app before uploading?
253
- PS: You can ignore this check with "--ignore-checksum-check"`),A.error("")),i.stop(`Checksum compatible with ${r} channel`)}function ge(t,e){return t||e?.plugins?.CapacitorUpdater?.appId||e?.appId}async function Ih(t,e,r,n,i){let o=await ab(n,i),s=await Pse(t,e,r),a=o.filter(c=>!!c.native).map(c=>{let l=s.get(c.name);return l?{name:c.name,localVersion:c.version,remoteVersion:l.version}:{name:c.name,localVersion:c.version,remoteVersion:void 0}}),u=[...s].filter(([c])=>o.find(l=>l.name===c)===void 0).map(([c,l])=>({name:c,localVersion:void 0,remoteVersion:l.version}));return a.push(...u),{finalCompatibility:a,localDependencies:o}}async function dj(t,e){let{data:r}=await t.rpc("exist_app_v2",{appid:e}).single();return!!r}async function Be(t,e,r,n){let i=Nt(),o=await tj(t,e,r);if(!o.okay)switch(o.error){case"INVALID_APIKEY":{m.error("Invalid apikey, such apikey does not exists!"),A.error("");break}case"NO_APP":{m.error(`App ${r} does not exist, run first \`${i.runner} @capgo/cli app add ${r}\` to create it`),A.error("");break}case"NO_ORG":{m.error("Could not find organization, please contact support to resolve this!"),A.error("");break}}let s=o.data;return n>s&&(m.error(`Insuficcent permissions for app ${r}. Current permission: ${xt[o.data]}, required for this action: ${xt[n]}.`),A.error("")),o.data}var xr="assets/icon.png";var jj=ce(Ij(),1);function fb(t){let e=(0,jj.default)("npm",{registry:"https://registry.npmjs.org/"}),r=e[`${t}:registry`]||e.config_registry||e.registry;return r.slice(-1)==="/"?r:`${r}/`}var j8=ce(I8(),1),N8=ce(Rv(),1),Cb=class extends Error{constructor(e){super(`Package \`${e}\` could not be found`),this.name="PackageNotFoundError"}},Sb=class extends Error{constructor(e,r){super(`Version \`${r}\` for package \`${e}\` could not be found`),this.name="VersionNotFoundError"}};async function xb(t,e={}){let{version:r="latest"}=e,{omitDeprecated:n=!0}=e,i=t.split("/")[0],o=e.registryUrl??fb(i),s=new URL(encodeURIComponent(t).replace(/^%40/,"@"),o),a=(0,j8.default)(o.toString(),{recursive:!0}),u={accept:"application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*"};e.fullMetadata&&delete u.accept,a&&(u.authorization=`${a.type} ${a.token}`);let c;try{c=await Hr(s,{headers:u,keepalive:!0}).json()}catch(f){throw f?.response?.status===404?new Cb(t):f}if(e.allVersions)return c;let l=new Sb(t,r);if(c["dist-tags"][r]){let{time:f}=c;c=c.versions[c["dist-tags"][r]],c.time=f}else if(r){let f=!!c.versions[r];if(n&&!f)for(let[d,p]of Object.entries(c.versions))p.deprecated&&delete c.versions[d];if(!f){let d=Object.keys(c.versions);if(r=N8.default.maxSatisfying(d,r),!r)throw l}let{time:h}=c;if(c=c.versions[r],c.time=h,!c)throw l}return c}async function qc(t,e){let{version:r}=await xb(t.toLowerCase(),e);return r}async function De(){let t=await qc("@capgo/cli").catch(()=>""),e=t?.split(".")[0];t!==Ir.version&&m.warning(`\u{1F6A8} You are using @capgo/cli@${Ir.version} it's not the latest version.
254
- Please use @capgo/cli@${t}" or @capgo/cli@${e} to keep up to date with the latest features and bug fixes.`)}async function jae(t,e,r=!0){await Fb(t,e,void 0,r)}async function Fb(t,e,r,n=!0){n&&Y("Adding"),await De(),e.apikey=e.apikey||pe();let i=await ee();t=ge(t,i?.config),e.apikey||(m.error("Missing API key, you need to provide a API key to upload your bundle"),A.error("")),t||(m.error("Missing argument, you need to provide a appId, or be in a capacitor project"),A.error("")),t.includes("--")&&(m.error('The app id includes illegal symbols. You cannot use "--" in the app id'),A.error(""));let o=await de(e.apikey);await me(o,e.apikey,["write","all"]),await dj(o,t)&&(t==="io.ionic.starter"?m.error(`This appId ${t} cannot be used it's reserved, please change it in your capacitor config.`):m.error(`App ${t} already exist`),A.error("")),r||(r=await ga(o,["admin","super_admin"]));let a=r.gid;await pa(o,a,e.apikey,void 0,!1);let{name:u,icon:c}=e;u=u||i.config?.appName||"Unknown",c=c||"resources/icon.png",(!c||!u)&&(m.error("Missing argument, you need to provide a appId and a name, or be in a capacitor project"),A.error("")),n&&m.info(`Adding ${t} to Capgo`);let l=null,f=null;c&&(0,Sa.existsSync)(c)?(l=(0,Sa.readFileSync)(c),f=ma(c)||"image/png",m.warn(`Found app icon ${c}`)):(0,Sa.existsSync)(xr)?(l=(0,Sa.readFileSync)(xr),f=ma(xr)||"image/png",m.warn(`Found app icon ${xr}`)):m.warn(`Cannot find app icon in any of the following locations: ${c}, ${xr}`);let h="icon",d="https://xvwzpoazmxkqosrdewyv.supabase.co/storage/v1/object/public/images/capgo.png";if(l&&f){let{error:g}=await o.storage.from(`images/org/${a}/${t}`).upload(h,l,{contentType:f});g&&(console.error(g),m.error(`Could not add app ${Q(g)}`),A.error(""));let{data:w}=await o.storage.from(`images/org/${a}/${t}`).getPublicUrl(h);d=w?.publicUrl||d}let{error:p}=await o.from("apps").insert({icon_url:d,owner_org:a,name:u,app_id:t});p&&(m.error(`Could not add app ${Q(p)}`),A.error(""));let{error:v}=await o.from("app_versions").insert([{owner_org:a,deleted:!0,name:"unknown",app_id:t},{owner_org:a,deleted:!0,name:"builtin",app_id:t}]);return v&&(m.error(`Could not add app ${Q(v)}`),A.error("")),m.success(`App ${t} added to Capgo. ${n?"You can upload a bundle now":""}`),n&&(X("Done \u2705"),(0,L8.exit)()),!0}async function B8(t,e){jae(t,e,!0)}var q8=require("node:process");async function M8(t,e){Y("Deleting"),e.apikey=e.apikey||pe();let r=await ee();t=ge(t,r?.config),e.apikey||(m.error("Missing API key, you need to provide a API key to upload your bundle"),A.error("")),t||(m.error("Missing argument, you need to provide a appId, or be in a capacitor project"),A.error(""));let n=await de(e.apikey),i=await me(n,e.apikey,["write","all"]);await Be(n,e.apikey,t,5);let{data:o,error:s}=await n.from("apps").select("owner_org ( created_by, id )").eq("app_id",t).single(),a=o;if(!s&&(a?.owner_org.created_by??"")!==i){m.warn("Deleting the app is not recomended for users that are not the organization owner"),m.warn("You are invited as a super_admin but your are not the owner"),m.warn("It's strongly recomended that you do not continue!");let h=await Mo({message:"Do you want to continue?",options:[{label:"Yes",value:"yes"},{label:"No",value:"no"}]});(kt(h)||h==="no")&&(m.error("Canceled deleting the app, exiting"),A.error(""))}else s&&m.warn(`Cannot get the app owner ${Q(s)}`);let{error:u}=await n.storage.from("images").remove([`org/${a?.owner_org.id}/${t}/icon`]);u&&(console.error(u,`images/org/${a?.owner_org.id}/${t}`),m.error("Could not delete app logo"));let{error:c}=await n.storage.from(`apps/${t}/${i}`).remove(["versions"]);c&&m.error("Could not delete app version");let{error:l}=await n.from("apps").delete().eq("app_id",t);l&&(m.error("Could not delete app"),A.error(""));let f=await Sr(n,t);await Fe(e.apikey,{channel:"app",event:"App Deleted",icon:"\u{1F5D1}\uFE0F",user_id:f,tags:{"app-id":t},notify:!1}).catch(),m.success("App deleted in Capgo"),X("Done \u2705"),(0,q8.exit)()}var Yh=require("node:os"),xa=require("node:process");async function Nae(t){let e={},r=[];for(let n in t)Object.prototype.hasOwnProperty.call(t,n)&&r.push(qc(n));return await Promise.all(r).then(n=>{let i=Object.keys(t);for(let o=0;o<n.length;o+=1){let s=n[o];s&&(e[i[o]]=s)}}),e}async function Lae(){let{dependencies:t}=await jt(),e={"@capgo/cli":Ir.version};for(let r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&r.startsWith("@capgo/")&&r.startsWith("@capawesome/")&&r.startsWith("capacitor")){let n=t[r].replace("^","").replace("~","");e[r]=n}return e}async function U8(t){m.warn(" \u{1F48A} Capgo Doctor \u{1F48A}");let e=await ee(),r=await jt("",t.packageJson),n=e?.config?.plugins?.CapacitorUpdater?.version||r?.version,i=e?.config?.appName||"";m.info(` App Name: ${i}`);let o=ge("",e?.config);m.info(` App ID: ${o}`),m.info(` App Version: ${n}`);let s=e?.config?.webDir||"";m.info(` Web Dir: ${s}`),m.info(` OS: ${(0,Yh.platform)()} ${(0,Yh.version)()}`),m.info(` Node: ${xa.version}`),m.info(" Installed Dependencies:");let a=await Lae();Object.keys(a).length===0&&(m.warning("\x1B[31m%s\x1B[0m \u{1F6A8} No dependencies found"),(0,xa.exit)(1));for(let l in a)if(Object.prototype.hasOwnProperty.call(a,l)){let f=a[l];m.info(` ${l}: ${f}`)}let u=be();u.start("Running: Loading latest dependencies");let c=await Nae(a);u.stop("Latest Dependencies:");for(let l in c)if(Object.prototype.hasOwnProperty.call(c,l)){let f=c[l];m.info(` ${l}: ${f}`)}JSON.stringify(a)!==JSON.stringify(c)&&(m.warn("\x1B[31m\u{1F6A8} Some dependencies are not up to date\x1B[0m"),(0,xa.exit)(1)),m.success("\x1B[32m\u2705 All dependencies are up to date\x1B[0m"),(0,xa.exit)()}var Ob=require("node:process");function V8(t,e){let n=["normal","bold","dim","italic","underline","strikethrough"].indexOf(t),i="\x1B[";return i+n+"m"+e+i+"0m"}var lr=class t{title=null;headers=[];rows=[];static narrowTheme={top:["\u2554","\u2550","\u2564","\u2557"],row:["\u2551"," ","\u2502","\u2551"],div:["\u255F","\u2500","\u253C","\u2562"],bot:["\u255A","\u2550","\u2567","\u255D"]};static wideTheme={top:["\u2554\u2550","\u2550","\u2550\u2564\u2550","\u2550\u2557"],row:["\u2551 "," "," \u2502 "," \u2551"],div:["\u255F\u2500","\u2500","\u2500\u253C\u2500","\u2500\u2562"],bot:["\u255A\u2550","\u2550","\u2550\u2567\u2550","\u2550\u255D"]};static roundTheme={top:["\u256D\u2500","\u2500","\u2500\u252C\u2500","\u2500\u256E"],row:["\u2502 "," "," \u2502 "," \u2502"],div:["\u251C\u2500","\u2500","\u2500\u253C\u2500","\u2500\u2524"],bot:["\u2570\u2500","\u2500","\u2500\u2534\u2500","\u2500\u256F"]};theme=t.wideTheme;columnWidth(){let e=[this.headers,...this.rows].filter(n=>n.length>0),r=e[0].map(n=>this.cast(n).length);for(let n of e.slice(1))for(let i=0;i<r.length;i++){let o=this.cast(n[i]).length;o>r[i]&&(r[i]=o)}return r}cast(e){return typeof e=="object"?"obj":e!==void 0&&typeof e.toString=="function"?e.toString():""}renderTitle(){return"[ "+this.title+" ]"}renderLine(e){let r=this.columnWidth();return e[0]+r.map(n=>e[1].repeat(n)).join(e[2])+e[3]}renderCell(e,r,n=!1){let i=this.cast(e),o=n?V8("bold",i):i,s=r-i.length,a=this.theme.row[1];switch(typeof e){case"number":return a.repeat(s)+o;case"string":return o+a.repeat(s);case"boolean":case"object":return a.repeat(Math.ceil(s/2))+V8("italic",i)+a.repeat(Math.floor(s/2));default:return a.repeat(s)}}renderRow(e,r=!1){let n=this.theme.row,i=this.columnWidth();return n[0]+e.map((o,s)=>this.renderCell(o,i[s],r)).join(n[2])+n[3]}toString(){let e=this.theme,r=this.headers.length>0,n=this.rows.length>0;return[this.title?this.renderTitle():"",r||n?this.renderLine(e.top):"",r?this.renderRow(this.headers,!0):"",r&&n?this.renderLine(e.div):"",...this.rows.map(i=>this.renderRow(i)),r||n?this.renderLine(e.bot):""].filter(i=>i.length>0).join(`
255
- `)}};function Bae(t){t.length||(m.error("No apps found"),(0,Ob.exit)(1));let e=new lr;e.headers=["Name","id","Created"],e.rows=[],t.reverse().forEach(r=>{e.rows.push([r.name??"",r.app_id,ya(r.created_at)])}),m.success("Apps"),m.success(e.toString())}async function qae(t){let{data:e,error:r}=await t.from("apps").select().order("created_at",{ascending:!1});return r&&(m.error("Apps not found"),A.error("")),e}async function H8(t){Y("List apps in Capgo"),await De(),t.apikey=t.apikey||pe();let e=await de(t.apikey);await me(e,t.apikey,["write","all","read","upload"]),m.info("Getting active bundle in Capgo");let r=await qae(e);m.info(`Active app in Capgo: ${r?.length}`),Bae(r),X("Done \u2705"),(0,Ob.exit)()}var z8=require("node:crypto"),Fa=require("node:fs"),G8=require("node:process");async function W8(t,e){Y("Set app"),e.apikey=e.apikey||pe();let r=await ee();t=ge(t,r?.config),e.apikey||(m.error("Missing API key, you need to provide a API key to upload your bundle"),A.error("")),t||(m.error("Missing argument, you need to provide a appId, or be in a capacitor project"),A.error(""));let n=await de(e.apikey),o=(await ga(n,["admin","super_admin"])).gid,s=await me(n,e.apikey,["write","all"]);await Be(n,e.apikey,t,4);let{name:a,icon:u,retention:c}=e;c&&Number.isNaN(Number(c))?(m.error("retention value must be a number"),A.error("")):c&&c<0&&(m.error("retention value cannot be less than 0"),A.error(""));let l,f,h=`icon_${(0,z8.randomUUID)()}`,d="https://xvwzpoazmxkqosrdewyv.supabase.co/storage/v1/object/public/images/capgo.png";if(u&&(0,Fa.existsSync)(u)?(l=(0,Fa.readFileSync)(u),f=ma(u)||"image/png",m.warn(`Found app icon ${u}`)):(0,Fa.existsSync)(xr)?(l=(0,Fa.readFileSync)(xr),f=ma(xr)||"image/png",m.warn(`Found app icon ${xr}`)):m.warn(`Cannot find app icon in any of the following locations: ${u}, ${xr}`),l&&f){let{error:v}=await n.storage.from(`images/org/${o}/${t}`).upload(h,l,{contentType:f});v&&(m.error(`Could not set app ${Q(v)}`),A.error(""));let{data:g}=await n.storage.from(`images/org/${o}/${t}`).getPublicUrl(h);d=g?.publicUrl||d}let{error:p}=await n.from("apps").update({icon_url:d,name:a,retention:c?c*24*60*60:void 0}).eq("app_id",t).eq("user_id",s);p&&(m.error(`Could not set app ${Q(p)}`),A.error("")),X("Done \u2705"),(0,G8.exit)()}var Oa=require("node:process");async function K8(t,e){Y("Set a specific setting in capacitor config"),e.bool&&e.string&&(m.error("Bool and string CANNOT be set at the same time"),(0,Oa.exit)(1)),!e.bool&&!e.string&&(m.error("You MUST provide either bool or string as the value"),(0,Oa.exit)(1)),e.bool&&e.bool!=="true"&&e.bool!=="false"&&(m.error("Invalid bool"),(0,Oa.exit)(1));try{let r=await ee(),n=r.config,i=t.split(".");i.length===0&&(m.error("Invalid path"),(0,Oa.exit)(1));for(let s of i.slice(0,-1))Object.prototype.hasOwnProperty.call(n,s)||(n[s]={}),n=n[s];let o=e.bool?e.bool==="true":e.string;n[i.at(-1)]=o,await on(r,!0),m.success(`Set "${t}" to "${o}"`)}catch(r){m.error(`Cannot set config in capacitor settings ${Q(r)}`),(0,Oa.exit)(1)}X("Done \u2705")}var Lb=require("node:process");function Jh(t,e){if(isNaN(t)||isNaN(e))throw new Error("Cannot compare against non-numbers");return t===e?0:t<e?-1:1}function X8(t=[],e=[]){return t.length&&!e.length?-1:!t.length&&e.length?1:0}function kb(t=[],e=[]){let r=Math.max(t.length,e.length);for(let n=0;n<r;n++){let i=t[n],o=e[n];if(i===void 0&&o===void 0)return 0;if(o===void 0)return 1;if(i===void 0)return-1;if(typeof i=="string"&&typeof o=="number")return 1;if(typeof i=="number"&&typeof o=="string"||i<o)return-1;if(i>o)return 1}return 0}var Aa="0|[1-9]\\d*",Mae="\\d*[a-zA-Z-][a-zA-Z0-9-]*",Uae=`(?<major>${Aa})\\.(?<minor>${Aa})\\.(?<patch>${Aa})`,Y8=`(?:${Aa}|${Mae})`,Z8=`(?:-(?<prerelease>${Y8}(?:\\.${Y8})*))`,J8="[0-9A-Za-z-]+",Q8=`(?:\\+(?<buildmetadata>${J8}(?:\\.${J8})*))`,eN=`v?${Uae}${Z8}?${Q8}?`,tN=new RegExp(`^${eN}$`),rN="(?:<|>)?=?",Vae="x|X|\\*",Ab=`${Aa}|${Vae}`,nN=`[v=\\s]*(?<major>${Ab})(?:\\.(?<minor>${Ab})(?:\\.(?<patch>${Ab})${Z8}?${Q8}?)?)?`,Hae=new RegExp(`^(?<operator>~>?|\\^|${rN})\\s*${nN}$`),zae=new RegExp(`^(?<operator>${rN})\\s*(${eN})$|^$`);function Tb(t){return typeof t=="number"&&!Number.isNaN(t)&&(!Number.isFinite(t)||0<=t&&t<=Number.MAX_SAFE_INTEGER)}var Pb=256;var Gae=new RegExp(`^${Aa}$`);function Rb(t){return t.split(".").filter(Boolean).map(e=>{if(Gae.test(e)){let r=Number(e);if(Tb(r))return r}return e})}function Mc(t){return t.split(".").filter(Boolean)}function Uc(t,e){let r=Number(t);if(!Tb(r))throw new TypeError(e);return r}function Fr(t,e){return t===e?0:Jh(t.major,e.major)||Jh(t.minor,e.minor)||Jh(t.patch,e.patch)||X8(t.prerelease,e.prerelease)||kb(t.prerelease,e.prerelease)}function $b(t){return t.toFixed(0)}function ka(t){let e=$b(t.major),r=$b(t.minor),n=$b(t.patch),i=t.prerelease?.join(".")??"",o=t.build?.join(".")??"";return[[`${e}.${r}.${n}`,i].filter(u=>u).join("-"),o].filter(u=>u).join("+")}function Wae(t=[]){let e=[...t],r=e.length;for(;r>=0;){let n=e[r];if(typeof n=="number"){e[r]=n+1;break}r-=1}return r===-1&&e.push(0),e}function Vc(t=[],e){let r=Wae(t);return e&&(r[0]!==e||isNaN(r[1]))&&(r=[e,0]),r}function oN(t,e,r={}){let n=r.build!==void 0?Mc(r.build):t.build??[];switch(e){case"premajor":return{major:t.major+1,minor:0,patch:0,prerelease:Vc(t.prerelease,r.prerelease),build:n};case"preminor":return{major:t.major,minor:t.minor+1,patch:0,prerelease:Vc(t.prerelease,r.prerelease),build:n};case"prepatch":return{major:t.major,minor:t.minor,patch:t.patch+1,prerelease:Vc(t.prerelease,r.prerelease),build:n};case"prerelease":{let o=(t.prerelease??[]).length===0?t.patch+1:t.patch;return{major:t.major,minor:t.minor,patch:o,prerelease:Vc(t.prerelease,r.prerelease),build:n}}case"major":return{major:(t.prerelease??[]).length===0||t.minor!==0||t.patch!==0?t.major+1:t.major,minor:0,patch:0,prerelease:[],build:n};case"minor":{let o=(t.prerelease??[]).length===0||t.patch!==0?t.minor+1:t.minor;return{major:t.major,minor:o,patch:0,prerelease:[],build:n}}case"patch":{let o=(t.prerelease??[]).length===0?t.patch+1:t.patch;return{major:t.major,minor:t.minor,patch:o,prerelease:[],build:n}}case"pre":return{major:t.major,minor:t.minor,patch:t.patch,prerelease:Vc(t.prerelease,r.prerelease),build:n};default:throw new TypeError(`Cannot increment version: invalid argument ${e}`)}}var Ib={major:Number.NaN,minor:Number.NaN,patch:Number.NaN,prerelease:[],build:[]},sN={operator:void 0,...Ib};function jb(t,e){return Fr(t,e)>0}function Ta(t,e){return Fr(t,e)<0}function Bn(t){if(typeof t!="string")throw new TypeError(`Cannot parse version as version must be a string: received ${typeof t}`);if(t.length>Pb)throw new TypeError(`Cannot parse version as version length is too long: length is ${t.length}, max length is ${Pb}`);t=t.trim();let e=t.match(tN)?.groups;if(!e)throw new TypeError(`Cannot parse version: ${t}`);let r=Uc(e.major,`Cannot parse version ${t}: invalid major version`),n=Uc(e.minor,`Cannot parse version ${t}: invalid minor version`),i=Uc(e.patch,`Cannot parse version ${t}: invalid patch version`),o=e.prerelease?Rb(e.prerelease):[],s=e.buildmetadata?Mc(e.buildmetadata):[];return{major:r,minor:n,patch:i,prerelease:o,build:s}}var gN=require("node:process");var uN=require("node:process");async function cN(t,e,r){let{data:n,error:i}=await t.from("channels").select().eq("app_id",e).eq("version",r.id);if(i&&(m.error(`Cannot check Version ${e}@${r.name}`),A.error("")),n&&n.length>0){if(Y(`\u274C Version ${e}@${r.name} is used in ${n.length} channel`),await Pe({message:"unlink it?"}))for(let o of n){let s=be();s.start(`Unlinking channel ${o.name}`);let{error:a}=await t.from("channels").update({version:(await Nb(t,e))?.id}).eq("id",o.id);a&&(s.stop(`Cannot update channel ${o.name} ${Q(a)}`),(0,uN.exit)(1)),s.stop(`\u2705 Channel ${o.name} unlinked`)}else m.error("Unlink it first"),A.error("");X(`Version unlinked from ${n.length} channel`)}}function Nb(t,e){return t.from("app_versions").select("id").eq("app_id",e).eq("name","unknown").throwOnError().single().then(({data:r,error:n})=>(n&&(m.error(`Cannot call findUnknownVersion as it returned an error.
253
+ PS: You can ignore this check with "--ignore-checksum-check"`),A.error("")),i.stop(`Checksum compatible with ${r} channel`)}function ge(t,e){return t||e?.plugins?.CapacitorUpdater?.appId||e?.appId}async function Rh(t,e,r,n,i){let o=await ab(n,i),s=await Pse(t,e,r),a=o.filter(c=>!!c.native).map(c=>{let l=s.get(c.name);return l?{name:c.name,localVersion:c.version,remoteVersion:l.version}:{name:c.name,localVersion:c.version,remoteVersion:void 0}}),u=[...s].filter(([c])=>o.find(l=>l.name===c)===void 0).map(([c,l])=>({name:c,localVersion:void 0,remoteVersion:l.version}));return a.push(...u),{finalCompatibility:a,localDependencies:o}}async function dj(t,e){let{data:r}=await t.rpc("exist_app_v2",{appid:e}).single();return!!r}async function Be(t,e,r,n){let i=Nt(),o=await tj(t,e,r);if(!o.okay)switch(o.error){case"INVALID_APIKEY":{m.error("Invalid apikey, such apikey does not exists!"),A.error("");break}case"NO_APP":{m.error(`App ${r} does not exist, run first \`${i.runner} @capgo/cli app add ${r}\` to create it`),A.error("");break}case"NO_ORG":{m.error("Could not find organization, please contact support to resolve this!"),A.error("");break}}let s=o.data;return n>s&&(m.error(`Insuficcent permissions for app ${r}. Current permission: ${xt[o.data]}, required for this action: ${xt[n]}.`),A.error("")),o.data}var xr="assets/icon.png";var jj=ce(Ij(),1);function fb(t){let e=(0,jj.default)("npm",{registry:"https://registry.npmjs.org/"}),r=e[`${t}:registry`]||e.config_registry||e.registry;return r.slice(-1)==="/"?r:`${r}/`}var j8=ce(I8(),1),N8=ce(Rv(),1),Cb=class extends Error{constructor(e){super(`Package \`${e}\` could not be found`),this.name="PackageNotFoundError"}},Sb=class extends Error{constructor(e,r){super(`Version \`${r}\` for package \`${e}\` could not be found`),this.name="VersionNotFoundError"}};async function xb(t,e={}){let{version:r="latest"}=e,{omitDeprecated:n=!0}=e,i=t.split("/")[0],o=e.registryUrl??fb(i),s=new URL(encodeURIComponent(t).replace(/^%40/,"@"),o),a=(0,j8.default)(o.toString(),{recursive:!0}),u={accept:"application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*"};e.fullMetadata&&delete u.accept,a&&(u.authorization=`${a.type} ${a.token}`);let c;try{c=await Hr(s,{headers:u,keepalive:!0}).json()}catch(f){throw f?.response?.status===404?new Cb(t):f}if(e.allVersions)return c;let l=new Sb(t,r);if(c["dist-tags"][r]){let{time:f}=c;c=c.versions[c["dist-tags"][r]],c.time=f}else if(r){let f=!!c.versions[r];if(n&&!f)for(let[d,p]of Object.entries(c.versions))p.deprecated&&delete c.versions[d];if(!f){let d=Object.keys(c.versions);if(r=N8.default.maxSatisfying(d,r),!r)throw l}let{time:h}=c;if(c=c.versions[r],c.time=h,!c)throw l}return c}async function qc(t,e){let{version:r}=await xb(t.toLowerCase(),e);return r}async function De(){let t=await qc("@capgo/cli").catch(()=>""),e=t?.split(".")[0];t!==Ir.version&&m.warning(`\u{1F6A8} You are using @capgo/cli@${Ir.version} it's not the latest version.
254
+ Please use @capgo/cli@${t}" or @capgo/cli@${e} to keep up to date with the latest features and bug fixes.`)}async function jae(t,e,r=!0){await Fb(t,e,void 0,r)}async function Fb(t,e,r,n=!0){n&&Y("Adding"),await De(),e.apikey=e.apikey||pe();let i=await ee();t=ge(t,i?.config),e.apikey||(m.error("Missing API key, you need to provide a API key to upload your bundle"),A.error("")),t||(m.error("Missing argument, you need to provide a appId, or be in a capacitor project"),A.error("")),t.includes("--")&&(m.error('The app id includes illegal symbols. You cannot use "--" in the app id'),A.error(""));let o=await de(e.apikey);await me(o,e.apikey,["write","all"]),await dj(o,t)&&(t==="io.ionic.starter"?m.error(`This appId ${t} cannot be used it's reserved, please change it in your capacitor config.`):m.error(`App ${t} already exist`),A.error("")),r||(r=await ga(o,["admin","super_admin"]));let a=r.gid;await pa(o,a,e.apikey,void 0,!1);let{name:u,icon:c}=e;u=u||i.config?.appName||"Unknown",c=c||"resources/icon.png",(!c||!u)&&(m.error("Missing argument, you need to provide a appId and a name, or be in a capacitor project"),A.error("")),n&&m.info(`Adding ${t} to Capgo`);let l=null,f=null;c&&(0,Sa.existsSync)(c)?(l=(0,Sa.readFileSync)(c),f=ma(c)||"image/png",m.warn(`Found app icon ${c}`)):(0,Sa.existsSync)(xr)?(l=(0,Sa.readFileSync)(xr),f=ma(xr)||"image/png",m.warn(`Found app icon ${xr}`)):m.warn(`Cannot find app icon in any of the following locations: ${c}, ${xr}`);let h="icon",d="https://xvwzpoazmxkqosrdewyv.supabase.co/storage/v1/object/public/images/capgo.png";if(l&&f){let{error:g}=await o.storage.from(`images/org/${a}/${t}`).upload(h,l,{contentType:f});g&&(console.error(g),m.error(`Could not add app ${Q(g)}`),A.error(""));let{data:w}=await o.storage.from(`images/org/${a}/${t}`).getPublicUrl(h);d=w?.publicUrl||d}let{error:p}=await o.from("apps").insert({icon_url:d,owner_org:a,name:u,app_id:t});p&&(m.error(`Could not add app ${Q(p)}`),A.error(""));let{error:v}=await o.from("app_versions").insert([{owner_org:a,deleted:!0,name:"unknown",app_id:t},{owner_org:a,deleted:!0,name:"builtin",app_id:t}]);return v&&(m.error(`Could not add app ${Q(v)}`),A.error("")),m.success(`App ${t} added to Capgo. ${n?"You can upload a bundle now":""}`),n&&(X("Done \u2705"),(0,L8.exit)()),!0}async function B8(t,e){jae(t,e,!0)}var q8=require("node:process");async function M8(t,e){Y("Deleting"),e.apikey=e.apikey||pe();let r=await ee();t=ge(t,r?.config),e.apikey||(m.error("Missing API key, you need to provide a API key to upload your bundle"),A.error("")),t||(m.error("Missing argument, you need to provide a appId, or be in a capacitor project"),A.error(""));let n=await de(e.apikey),i=await me(n,e.apikey,["write","all"]);await Be(n,e.apikey,t,5);let{data:o,error:s}=await n.from("apps").select("owner_org ( created_by, id )").eq("app_id",t).single(),a=o;if(!s&&(a?.owner_org.created_by??"")!==i){m.warn("Deleting the app is not recomended for users that are not the organization owner"),m.warn("You are invited as a super_admin but your are not the owner"),m.warn("It's strongly recomended that you do not continue!");let h=await Mo({message:"Do you want to continue?",options:[{label:"Yes",value:"yes"},{label:"No",value:"no"}]});(kt(h)||h==="no")&&(m.error("Canceled deleting the app, exiting"),A.error(""))}else s&&m.warn(`Cannot get the app owner ${Q(s)}`);let{error:u}=await n.storage.from("images").remove([`org/${a?.owner_org.id}/${t}/icon`]);u&&(console.error(u,`images/org/${a?.owner_org.id}/${t}`),m.error("Could not delete app logo"));let{error:c}=await n.storage.from(`apps/${t}/${i}`).remove(["versions"]);c&&m.error("Could not delete app version");let{error:l}=await n.from("apps").delete().eq("app_id",t);l&&(m.error("Could not delete app"),A.error(""));let f=await Sr(n,t);await Fe(e.apikey,{channel:"app",event:"App Deleted",icon:"\u{1F5D1}\uFE0F",user_id:f,tags:{"app-id":t},notify:!1}).catch(),m.success("App deleted in Capgo"),X("Done \u2705"),(0,q8.exit)()}var Wh=require("node:os"),xa=require("node:process");async function Nae(t){let e={},r=[];for(let n in t)Object.prototype.hasOwnProperty.call(t,n)&&r.push(qc(n));return await Promise.all(r).then(n=>{let i=Object.keys(t);for(let o=0;o<n.length;o+=1){let s=n[o];s&&(e[i[o]]=s)}}),e}async function Lae(){let{dependencies:t}=await jt(),e={"@capgo/cli":Ir.version};for(let r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&r.startsWith("@capgo/")&&r.startsWith("@capawesome/")&&r.startsWith("capacitor")){let n=t[r].replace("^","").replace("~","");e[r]=n}return e}async function U8(t){m.warn(" \u{1F48A} Capgo Doctor \u{1F48A}");let e=await ee(),r=await jt("",t.packageJson),n=e?.config?.plugins?.CapacitorUpdater?.version||r?.version,i=e?.config?.appName||"";m.info(` App Name: ${i}`);let o=ge("",e?.config);m.info(` App ID: ${o}`),m.info(` App Version: ${n}`);let s=e?.config?.webDir||"";m.info(` Web Dir: ${s}`),m.info(` OS: ${(0,Wh.platform)()} ${(0,Wh.version)()}`),m.info(` Node: ${xa.version}`),m.info(" Installed Dependencies:");let a=await Lae();Object.keys(a).length===0&&(m.warning("\x1B[31m%s\x1B[0m \u{1F6A8} No dependencies found"),(0,xa.exit)(1));for(let l in a)if(Object.prototype.hasOwnProperty.call(a,l)){let f=a[l];m.info(` ${l}: ${f}`)}let u=be();u.start("Running: Loading latest dependencies");let c=await Nae(a);u.stop("Latest Dependencies:");for(let l in c)if(Object.prototype.hasOwnProperty.call(c,l)){let f=c[l];m.info(` ${l}: ${f}`)}JSON.stringify(a)!==JSON.stringify(c)&&(m.warn("\x1B[31m\u{1F6A8} Some dependencies are not up to date\x1B[0m"),(0,xa.exit)(1)),m.success("\x1B[32m\u2705 All dependencies are up to date\x1B[0m"),(0,xa.exit)()}var Ob=require("node:process");function V8(t,e){let n=["normal","bold","dim","italic","underline","strikethrough"].indexOf(t),i="\x1B[";return i+n+"m"+e+i+"0m"}var lr=class t{title=null;headers=[];rows=[];static narrowTheme={top:["\u2554","\u2550","\u2564","\u2557"],row:["\u2551"," ","\u2502","\u2551"],div:["\u255F","\u2500","\u253C","\u2562"],bot:["\u255A","\u2550","\u2567","\u255D"]};static wideTheme={top:["\u2554\u2550","\u2550","\u2550\u2564\u2550","\u2550\u2557"],row:["\u2551 "," "," \u2502 "," \u2551"],div:["\u255F\u2500","\u2500","\u2500\u253C\u2500","\u2500\u2562"],bot:["\u255A\u2550","\u2550","\u2550\u2567\u2550","\u2550\u255D"]};static roundTheme={top:["\u256D\u2500","\u2500","\u2500\u252C\u2500","\u2500\u256E"],row:["\u2502 "," "," \u2502 "," \u2502"],div:["\u251C\u2500","\u2500","\u2500\u253C\u2500","\u2500\u2524"],bot:["\u2570\u2500","\u2500","\u2500\u2534\u2500","\u2500\u256F"]};theme=t.wideTheme;columnWidth(){let e=[this.headers,...this.rows].filter(n=>n.length>0),r=e[0].map(n=>this.cast(n).length);for(let n of e.slice(1))for(let i=0;i<r.length;i++){let o=this.cast(n[i]).length;o>r[i]&&(r[i]=o)}return r}cast(e){return typeof e=="object"?"obj":e!==void 0&&typeof e.toString=="function"?e.toString():""}renderTitle(){return"[ "+this.title+" ]"}renderLine(e){let r=this.columnWidth();return e[0]+r.map(n=>e[1].repeat(n)).join(e[2])+e[3]}renderCell(e,r,n=!1){let i=this.cast(e),o=n?V8("bold",i):i,s=r-i.length,a=this.theme.row[1];switch(typeof e){case"number":return a.repeat(s)+o;case"string":return o+a.repeat(s);case"boolean":case"object":return a.repeat(Math.ceil(s/2))+V8("italic",i)+a.repeat(Math.floor(s/2));default:return a.repeat(s)}}renderRow(e,r=!1){let n=this.theme.row,i=this.columnWidth();return n[0]+e.map((o,s)=>this.renderCell(o,i[s],r)).join(n[2])+n[3]}toString(){let e=this.theme,r=this.headers.length>0,n=this.rows.length>0;return[this.title?this.renderTitle():"",r||n?this.renderLine(e.top):"",r?this.renderRow(this.headers,!0):"",r&&n?this.renderLine(e.div):"",...this.rows.map(i=>this.renderRow(i)),r||n?this.renderLine(e.bot):""].filter(i=>i.length>0).join(`
255
+ `)}};function Bae(t){t.length||(m.error("No apps found"),(0,Ob.exit)(1));let e=new lr;e.headers=["Name","id","Created"],e.rows=[],t.reverse().forEach(r=>{e.rows.push([r.name??"",r.app_id,ya(r.created_at)])}),m.success("Apps"),m.success(e.toString())}async function qae(t){let{data:e,error:r}=await t.from("apps").select().order("created_at",{ascending:!1});return r&&(m.error("Apps not found"),A.error("")),e}async function H8(t){Y("List apps in Capgo"),await De(),t.apikey=t.apikey||pe();let e=await de(t.apikey);await me(e,t.apikey,["write","all","read","upload"]),m.info("Getting active bundle in Capgo");let r=await qae(e);m.info(`Active app in Capgo: ${r?.length}`),Bae(r),X("Done \u2705"),(0,Ob.exit)()}var z8=require("node:crypto"),Fa=require("node:fs"),G8=require("node:process");async function W8(t,e){Y("Set app"),e.apikey=e.apikey||pe();let r=await ee();t=ge(t,r?.config),e.apikey||(m.error("Missing API key, you need to provide a API key to upload your bundle"),A.error("")),t||(m.error("Missing argument, you need to provide a appId, or be in a capacitor project"),A.error(""));let n=await de(e.apikey),o=(await ga(n,["admin","super_admin"])).gid,s=await me(n,e.apikey,["write","all"]);await Be(n,e.apikey,t,4);let{name:a,icon:u,retention:c}=e;c&&Number.isNaN(Number(c))?(m.error("retention value must be a number"),A.error("")):c&&c<0&&(m.error("retention value cannot be less than 0"),A.error(""));let l,f,h=`icon_${(0,z8.randomUUID)()}`,d="https://xvwzpoazmxkqosrdewyv.supabase.co/storage/v1/object/public/images/capgo.png";if(u&&(0,Fa.existsSync)(u)?(l=(0,Fa.readFileSync)(u),f=ma(u)||"image/png",m.warn(`Found app icon ${u}`)):(0,Fa.existsSync)(xr)?(l=(0,Fa.readFileSync)(xr),f=ma(xr)||"image/png",m.warn(`Found app icon ${xr}`)):m.warn(`Cannot find app icon in any of the following locations: ${u}, ${xr}`),l&&f){let{error:v}=await n.storage.from(`images/org/${o}/${t}`).upload(h,l,{contentType:f});v&&(m.error(`Could not set app ${Q(v)}`),A.error(""));let{data:g}=await n.storage.from(`images/org/${o}/${t}`).getPublicUrl(h);d=g?.publicUrl||d}let{error:p}=await n.from("apps").update({icon_url:d,name:a,retention:c?c*24*60*60:void 0}).eq("app_id",t).eq("user_id",s);p&&(m.error(`Could not set app ${Q(p)}`),A.error("")),X("Done \u2705"),(0,G8.exit)()}var Oa=require("node:process");async function K8(t,e){Y("Set a specific setting in capacitor config"),e.bool&&e.string&&(m.error("Bool and string CANNOT be set at the same time"),(0,Oa.exit)(1)),!e.bool&&!e.string&&(m.error("You MUST provide either bool or string as the value"),(0,Oa.exit)(1)),e.bool&&e.bool!=="true"&&e.bool!=="false"&&(m.error("Invalid bool"),(0,Oa.exit)(1));try{let r=await ee(),n=r.config,i=t.split(".");i.length===0&&(m.error("Invalid path"),(0,Oa.exit)(1));for(let s of i.slice(0,-1))Object.prototype.hasOwnProperty.call(n,s)||(n[s]={}),n=n[s];let o=e.bool?e.bool==="true":e.string;n[i.at(-1)]=o,await on(r,!0),m.success(`Set "${t}" to "${o}"`)}catch(r){m.error(`Cannot set config in capacitor settings ${Q(r)}`),(0,Oa.exit)(1)}X("Done \u2705")}var Lb=require("node:process");function Kh(t,e){if(isNaN(t)||isNaN(e))throw new Error("Cannot compare against non-numbers");return t===e?0:t<e?-1:1}function X8(t=[],e=[]){return t.length&&!e.length?-1:!t.length&&e.length?1:0}function kb(t=[],e=[]){let r=Math.max(t.length,e.length);for(let n=0;n<r;n++){let i=t[n],o=e[n];if(i===void 0&&o===void 0)return 0;if(o===void 0)return 1;if(i===void 0)return-1;if(typeof i=="string"&&typeof o=="number")return 1;if(typeof i=="number"&&typeof o=="string"||i<o)return-1;if(i>o)return 1}return 0}var Aa="0|[1-9]\\d*",Mae="\\d*[a-zA-Z-][a-zA-Z0-9-]*",Uae=`(?<major>${Aa})\\.(?<minor>${Aa})\\.(?<patch>${Aa})`,Y8=`(?:${Aa}|${Mae})`,Z8=`(?:-(?<prerelease>${Y8}(?:\\.${Y8})*))`,J8="[0-9A-Za-z-]+",Q8=`(?:\\+(?<buildmetadata>${J8}(?:\\.${J8})*))`,eN=`v?${Uae}${Z8}?${Q8}?`,tN=new RegExp(`^${eN}$`),rN="(?:<|>)?=?",Vae="x|X|\\*",Ab=`${Aa}|${Vae}`,nN=`[v=\\s]*(?<major>${Ab})(?:\\.(?<minor>${Ab})(?:\\.(?<patch>${Ab})${Z8}?${Q8}?)?)?`,Hae=new RegExp(`^(?<operator>~>?|\\^|${rN})\\s*${nN}$`),zae=new RegExp(`^(?<operator>${rN})\\s*(${eN})$|^$`);function Tb(t){return typeof t=="number"&&!Number.isNaN(t)&&(!Number.isFinite(t)||0<=t&&t<=Number.MAX_SAFE_INTEGER)}var Pb=256;var Gae=new RegExp(`^${Aa}$`);function Rb(t){return t.split(".").filter(Boolean).map(e=>{if(Gae.test(e)){let r=Number(e);if(Tb(r))return r}return e})}function Mc(t){return t.split(".").filter(Boolean)}function Uc(t,e){let r=Number(t);if(!Tb(r))throw new TypeError(e);return r}function Fr(t,e){return t===e?0:Kh(t.major,e.major)||Kh(t.minor,e.minor)||Kh(t.patch,e.patch)||X8(t.prerelease,e.prerelease)||kb(t.prerelease,e.prerelease)}function $b(t){return t.toFixed(0)}function ka(t){let e=$b(t.major),r=$b(t.minor),n=$b(t.patch),i=t.prerelease?.join(".")??"",o=t.build?.join(".")??"";return[[`${e}.${r}.${n}`,i].filter(u=>u).join("-"),o].filter(u=>u).join("+")}function Wae(t=[]){let e=[...t],r=e.length;for(;r>=0;){let n=e[r];if(typeof n=="number"){e[r]=n+1;break}r-=1}return r===-1&&e.push(0),e}function Vc(t=[],e){let r=Wae(t);return e&&(r[0]!==e||isNaN(r[1]))&&(r=[e,0]),r}function oN(t,e,r={}){let n=r.build!==void 0?Mc(r.build):t.build??[];switch(e){case"premajor":return{major:t.major+1,minor:0,patch:0,prerelease:Vc(t.prerelease,r.prerelease),build:n};case"preminor":return{major:t.major,minor:t.minor+1,patch:0,prerelease:Vc(t.prerelease,r.prerelease),build:n};case"prepatch":return{major:t.major,minor:t.minor,patch:t.patch+1,prerelease:Vc(t.prerelease,r.prerelease),build:n};case"prerelease":{let o=(t.prerelease??[]).length===0?t.patch+1:t.patch;return{major:t.major,minor:t.minor,patch:o,prerelease:Vc(t.prerelease,r.prerelease),build:n}}case"major":return{major:(t.prerelease??[]).length===0||t.minor!==0||t.patch!==0?t.major+1:t.major,minor:0,patch:0,prerelease:[],build:n};case"minor":{let o=(t.prerelease??[]).length===0||t.patch!==0?t.minor+1:t.minor;return{major:t.major,minor:o,patch:0,prerelease:[],build:n}}case"patch":{let o=(t.prerelease??[]).length===0?t.patch+1:t.patch;return{major:t.major,minor:t.minor,patch:o,prerelease:[],build:n}}case"pre":return{major:t.major,minor:t.minor,patch:t.patch,prerelease:Vc(t.prerelease,r.prerelease),build:n};default:throw new TypeError(`Cannot increment version: invalid argument ${e}`)}}var Ib={major:Number.NaN,minor:Number.NaN,patch:Number.NaN,prerelease:[],build:[]},sN={operator:void 0,...Ib};function jb(t,e){return Fr(t,e)>0}function Ta(t,e){return Fr(t,e)<0}function Bn(t){if(typeof t!="string")throw new TypeError(`Cannot parse version as version must be a string: received ${typeof t}`);if(t.length>Pb)throw new TypeError(`Cannot parse version as version length is too long: length is ${t.length}, max length is ${Pb}`);t=t.trim();let e=t.match(tN)?.groups;if(!e)throw new TypeError(`Cannot parse version: ${t}`);let r=Uc(e.major,`Cannot parse version ${t}: invalid major version`),n=Uc(e.minor,`Cannot parse version ${t}: invalid minor version`),i=Uc(e.patch,`Cannot parse version ${t}: invalid patch version`),o=e.prerelease?Rb(e.prerelease):[],s=e.buildmetadata?Mc(e.buildmetadata):[];return{major:r,minor:n,patch:i,prerelease:o,build:s}}var gN=require("node:process");var uN=require("node:process");async function cN(t,e,r){let{data:n,error:i}=await t.from("channels").select().eq("app_id",e).eq("version",r.id);if(i&&(m.error(`Cannot check Version ${e}@${r.name}`),A.error("")),n&&n.length>0){if(Y(`\u274C Version ${e}@${r.name} is used in ${n.length} channel`),await Pe({message:"unlink it?"}))for(let o of n){let s=be();s.start(`Unlinking channel ${o.name}`);let{error:a}=await t.from("channels").update({version:(await Nb(t,e))?.id}).eq("id",o.id);a&&(s.stop(`Cannot update channel ${o.name} ${Q(a)}`),(0,uN.exit)(1)),s.stop(`\u2705 Channel ${o.name} unlinked`)}else m.error("Unlink it first"),A.error("");X(`Version unlinked from ${n.length} channel`)}}function Nb(t,e){return t.from("app_versions").select("id").eq("app_id",e).eq("name","unknown").throwOnError().single().then(({data:r,error:n})=>(n&&(m.error(`Cannot call findUnknownVersion as it returned an error.
256
256
  ${Q(n)}`),A.error("")),r))}function lN(t,e){return t.from("channels").insert(e).select().single()}function fN(t,e,r,n){return t.from("channels").delete().eq("name",e).eq("app_id",r).single()}function dN(t){let e=new lr;e.theme=lr.roundTheme,e.headers=["Name","Version","Public","iOS","Android","Auto Update","Native Auto Update","Device Self Set","Progressive Deploy","Secondary Version","Secondary Version Percentage","AB Testing","AB Testing Version","AB Testing Percentage","Emulator","Dev"],e.rows=[["a",0,!0],["bb",10,!1]],t.reverse().forEach(r=>{e.rows.push([r.name,r.version?.name,r.public?"\u2705":"\u274C",r.ios?"\u2705":"\u274C",r.android?"\u2705":"\u274C",r.disable_auto_update,r.disable_auto_update_under_native?"\u274C":"\u2705",r.allow_device_self_set?"\u2705":"\u274C",r.enable_progressive_deploy?"\u2705":"\u274C",r.enable_progressive_deploy&&r.second_version?r.second_version.name:void 0,r.enable_progressive_deploy&&r.second_version?r.secondary_version_percentage:void 0,r.enable_ab_testing?"\u2705":"\u274C",r.enable_ab_testing&&r.second_version?r.second_version.name:void 0,r.enable_ab_testing&&r.second_version?`${(1-r.secondary_version_percentage)*100}% / ${r.secondary_version_percentage*100}%`:void 0,r.allow_emulator?"\u2705":"\u274C",r.allow_dev?"\u2705":"\u274C"])}),m.success("Channels"),m.success(e.toString())}async function hN(t,e){let{data:r,error:n}=await t.from("channels").select(`
257
257
  id,
258
258
  name,
@@ -272,32 +272,32 @@ ${Q(n)}`),A.error("")),r))}function lN(t,e){return t.from("channels").insert(e).
272
272
  created_by,
273
273
  app_id,
274
274
  version (id, name)
275
- `).eq("app_id",e).order("created_at",{ascending:!1});return n&&(m.error(`App ${e} not found in database`),A.error("")),r}var pN=require("node:process");async function mN(t,e,r){let{data:n,error:i}=await t.from("devices_override").select().eq("app_id",e).eq("version",r.id);if(i&&(m.error(`Cannot check Device override ${e}@${r.name}`),A.error("")),n&&n.length>0)if(Y(`\u274C Version ${e}@${r.name} is used in ${n.length} device override`),await Pe({message:"unlink it?"}))for(let o of n){let s=be();s.start(`Unlinking device ${o.device_id}`);let{error:a}=await t.from("devices_override").delete().eq("device_id",o.device_id);a&&(s.stop(`Cannot unlink device ${o.device_id} ${Q(a)}`),(0,pN.exit)(1)),s.stop(`\u2705 Device ${o.device_id} unlinked`)}else m.error("Unlink it first"),A.error("")}async function Kae(t,e,r){let{error:n}=await t.from("app_versions").update({deleted:!0}).eq("app_id",e).eq("deleted",!1).eq("name",r);n&&(m.error(`App Version ${e}@${r} not found in database`),A.error(""))}async function Zh(t,e,r){let n=await Yae(t,e,r);await cN(t,e,n),await mN(t,e,n),await Kae(t,e,r)}function Qh(t){t.length||(m.error("No bundle found"),(0,gN.exit)(1));let e=new lr;e.theme=lr.roundTheme,e.headers=["Version","Created","Keep"],t.reverse().forEach(r=>{e.rows.push([r.name,ya(r.created_at),r.keep!=null?r.keep:""])}),m.success("Bundles"),m.success(e.toString())}async function ep(t,e){let{data:r,error:n}=await t.from("app_versions").select().eq("app_id",e).eq("deleted",!1).order("created_at",{ascending:!1});return n&&(m.error(`App ${e} not found in database`),A.error("")),r}async function yN(t,e){let{data:r,error:n}=await t.from("channels").select("version").eq("app_id",e);return n&&(m.error(`App ${e} not found in database`),A.error("")),r.map(i=>i.version)}async function Yae(t,e,r){let{data:n,error:i}=await t.from("app_versions").select().eq("app_id",e).eq("name",r).eq("deleted",!1).single();return(!n||i)&&(m.error(`App Version ${e}@${r} doesn't exist`),A.error("")),n}async function Jae(t,e,r){for await(let n of t)m.warn(`Removing ${n.name} created on ${ya(n.created_at)}`),await Zh(e,r,n.name)}function Xae(t,e,r){let n=[];return t?.forEach(i=>{let o=Bn(i.name);jb(o,e)&&Ta(o,r)&&n.push(i)}),n}async function DN(t,e){Y("Cleanup versions in Capgo"),await De(),e.apikey=e.apikey||pe();let{bundle:r,keep:n=4}=e,i=e.force||!1,o=await ee();t=ge(t,o?.config),e.apikey||(m.error("Missing API key, you need to provide an API key to delete your app"),A.error("")),t||(m.error("Missing argument, you need to provide a appid, or be in a capacitor project"),A.error(""));let s=await de(e.apikey);await me(s,e.apikey,["write","all"]),await Be(s,e.apikey,t,3),m.info("Querying all available versions in Capgo");let a=await ep(s,t),u=await yN(s,t);if(m.info(`Total active versions in Capgo: ${a?.length}`),a?.length===0){m.error("No versions found, aborting cleanup");return}if(r){let f=Bn(r),h=oN(f,"major");m.info(`Querying available versions in Capgo between ${ka(f)} and ${ka(h)}`),a=Xae(a,f,h),m.info(`Active versions in Capgo between ${ka(f)} and ${ka(h)}: ${a?.length}`)}let c=[],l=0;if(a.forEach(f=>{let h=u.find(d=>d===f.id);l<n||h?(h?f.keep="\u2705 (Linked to channel)":f.keep="\u2705",l+=1):(f.keep="\u274C",c.push(f))}),c.length===0){m.warn("Nothing to be removed, aborting removal...");return}if(Qh(a),!i){let f=await Pe({message:"Do you want to continue removing the versions specified?"});(kt(f)||!f)&&(m.warn("Not confirmed, aborting removal..."),(0,Lb.exit)())}m.success("You have confirmed removal, removing versions now"),await Jae(c,s,t),X("Done \u2705"),(0,Lb.exit)()}var sn=require("node:fs"),EN=require("node:process");var Hc=require("node:buffer"),Lt=require("node:crypto"),vN="aes-128-cbc",bN="sha256",tp="base64",wN=Lt.constants.RSA_PKCS1_OAEP_PADDING;function _N(t,e,r){let[n,i]=e.split(":"),o=(0,Lt.privateDecrypt)({key:r,padding:wN,oaepHash:bN},Hc.Buffer.from(i,tp)),s=Hc.Buffer.from(n,tp),a=(0,Lt.createDecipheriv)(vN,o,s);return a.setAutoPadding(!0),Hc.Buffer.concat([a.update(t),a.final()])}function rp(t,e){let r=(0,Lt.randomBytes)(16),n=(0,Lt.randomBytes)(16),i=(0,Lt.createCipheriv)(vN,n,r);i.setAutoPadding(!0);let o=r.toString(tp),s=(0,Lt.publicEncrypt)({key:e,padding:wN,oaepHash:bN},n).toString(tp),a=`${o}:${s}`;return{encryptedData:Hc.Buffer.concat([i.update(t),i.final()]),ivSessionKey:a}}function np(t="pem",e=2048){let{publicKey:r,privateKey:n}=(0,Lt.generateKeyPairSync)("rsa",{modulusLength:e});return t==="pem"?{publicKey:r.export({type:"pkcs1",format:"pem"}),privateKey:n.export({type:"pkcs1",format:"pem"})}:{publicKey:r.export({type:"spki",format:"der"}).toString("base64"),privateKey:n.export({type:"pkcs1",format:"pem"}).toString("base64")}}async function CN(t,e,r){Y("Decrypt zip file"),await De(),(0,sn.existsSync)(t)||(m.error(`Zip not found at the path ${t}`),A.error(""));let n=await ee();!r.key&&!(0,sn.existsSync)(er)&&!n.config.plugins?.CapacitorUpdater?.privateKey&&(m.error(`Private Key not found at the path ${er} or in ${n.path}`),A.error(""));let i=r.key||er,o=n.config.plugins?.CapacitorUpdater?.privateKey;!(0,sn.existsSync)(i)&&!o?(m.error(`Cannot find public key ${i} or as keyData option or in ${n.path}`),A.error("")):(0,sn.existsSync)(i)&&(o=(0,sn.readFileSync)(i).toString());let s=(0,sn.readFileSync)(t),a=_N(s,e,r.keyData??o??"");(0,sn.writeFileSync)(`${t}_decrypted.zip`,a),X(`Decrypted zip file at ${t}_decrypted.zip`),(0,EN.exit)()}var an=require("node:fs"),ON=require("node:process");var AN=ce(bu());var Po=require("node:buffer"),Ot=require("node:crypto"),SN="aes-128-cbc",wi="base64",ip=Ot.constants.RSA_PKCS1_PADDING;function xN(t,e,r){let[n,i]=e.split(":"),o=(0,Ot.publicDecrypt)({key:r,padding:ip},Po.Buffer.from(i,wi)),s=Po.Buffer.from(n,wi),a=(0,Ot.createDecipheriv)(SN,o,s);return a.setAutoPadding(!0),Po.Buffer.concat([a.update(t),a.final()])}function op(t,e){return(0,Ot.privateEncrypt)({key:e,padding:ip},Po.Buffer.from(t,wi)).toString(wi)}function FN(t,e){return(0,Ot.publicDecrypt)({key:e,padding:ip},Po.Buffer.from(t,wi)).toString(wi)}function sp(t,e){let r=(0,Ot.randomBytes)(16),n=(0,Ot.randomBytes)(16),i=(0,Ot.createCipheriv)(SN,n,r);i.setAutoPadding(!0);let o=r.toString(wi),s=(0,Ot.privateEncrypt)({key:e,padding:ip},n).toString(wi),a=`${o}:${s}`;return{encryptedData:Po.Buffer.concat([i.update(t),i.final()]),ivSessionKey:a}}async function kN(t,e,r){Y("Decrypt zip file"),await De(),(0,an.existsSync)(t)||(m.error(`Zip not found at the path ${t}`),A.error(""));let n=await ee();!r.key&&!(0,an.existsSync)(jn)&&!n.config.plugins?.CapacitorUpdater?.privateKey&&(m.error(`Private Key not found at the path ${jn} or in ${n.path}`),A.error(""));let i=r.key||jn,o=n.config.plugins?.CapacitorUpdater?.publicKey;!(0,an.existsSync)(i)&&!o?(m.error(`Cannot find public key ${i} or as keyData option or in ${n.path}`),A.error("")):(0,an.existsSync)(i)&&(o=(0,an.readFileSync)(i).toString());let s=(0,an.readFileSync)(t),a=xN(s,e,r.keyData??o??"");if((0,an.writeFileSync)(`${t}_decrypted.zip`,a),m.info(`Decrypted zip file at ${t}_decrypted.zip`),r.checksum){let u=await(0,AN.checksum)(a,"sha256"),c=FN(r.checksum,r.keyData??o??"");u!==c?(m.error(`Checksum does not match ${u} !== ${c}`),A.error("")):m.info("Checksum matches")}X("\u2705 done"),(0,ON.exit)()}var TN=require("node:process");async function PN(t,e,r){Y("Delete bundle"),r.apikey=r.apikey||pe();let n=await ee();e=ge(e,n?.config),r.apikey||(m.error("Missing API key, you need to provide a API key to upload your bundle"),A.error("")),e||(m.error("Missing argument, you need to provide a appId, or be in a capacitor project"),A.error(""));let i=await de(r.apikey);await me(i,r.apikey,["write","all"]),await Be(i,r.apikey,e,3),r.apikey||(m.error("Missing API key, you need to provide an API key to delete your app"),A.error("")),t||(m.error("Missing argument, you need to provide a bundleId, or be in a capacitor project"),A.error("")),e||(m.error("Missing argument, you need to provide a appId, or be in a capacitor project"),A.error("")),m.info(`Deleting bundle ${e}@${t} from Capgo`),m.info("Keep in mind that you will not be able to reuse this bundle version, it's gone forever"),await Zh(i,e,t),m.success(`Bundle ${e}@${t} deleted in Capgo`),X("Done"),(0,TN.exit)()}var _i=require("node:fs"),RN=require("node:process");async function $N(t,e){Y("Encryption"),await De(),(0,_i.existsSync)(t)||(m.error(`Error: Zip not found at the path ${t}`),A.error(""));let r=e.key||cr,n=e.keyData||"";(0,_i.existsSync)(r)&&(n=(0,_i.readFileSync)(r).toString());let i=(0,_i.readFileSync)(t),o=rp(i,n);m.success(`ivSessionKey: ${o.ivSessionKey}`),(0,_i.writeFileSync)(`${t}_encrypted.zip`,o.encryptedData),m.success(`Encrypted zip saved at ${t}_encrypted.zip`),X("Done \u2705"),(0,RN.exit)()}var qn=require("node:fs"),IN=require("node:process");async function jN(t,e,r){let{json:n}=r;n||(Y("Encryption"),await De());let i=await ee(),o=!!i.config.plugins?.CapacitorUpdater?.privateKey,s=!!i.config.plugins?.CapacitorUpdater?.publicKey;o&&!n&&m.warning("There is still a privateKey in the config"),(0,qn.existsSync)(t)||(n?console.error(Q({error:"zip_not_found"})):m.error(`Error: Zip not found at the path ${t}`),A.error("")),s||(n?console.error(Q({error:"missing_public_key"})):m.warning("Warning: Missing Public Key in config"),A.error(""));let a=r.key||ur,u=r.keyData||"";!(0,qn.existsSync)(a)&&!u?(n?console.error(Q({error:"missing_key"})):(m.warning(`Cannot find a private key at ${a} or as a keyData option`),m.error("Error: Missing key")),A.error("")):(0,qn.existsSync)(a)&&(u=(0,qn.readFileSync)(a).toString()),u&&!u.startsWith("-----BEGIN RSA PRIVATE KEY-----")&&(n?console.error(Q({error:"invalid_private_key"})):m.error("the private key provided is not a valid RSA Private key"),A.error(""));let c=(0,qn.readFileSync)(t),l=sp(c,u),f=op(e,u),h=`${t}_encrypted.zip`;n?console.log(JSON.stringify({checksum:f,filename:h,ivSessionKey:l.ivSessionKey},null,2)):(m.success(`Encoded Checksum: ${f}`),m.success(`ivSessionKey: ${l.ivSessionKey}`)),(0,qn.writeFileSync)(h,l.encryptedData),n||(m.success(`Encrypted zip saved at ${h}`),X("Done \u2705")),(0,IN.exit)()}var NN=require("node:process");async function LN(t,e){Y("List bundles"),await De(),e.apikey=e.apikey||pe();let r=await ee();t=ge(t,r?.config),e.apikey||(m.error("Missing API key, you need to provide a API key to upload your bundle"),A.error("")),t||(m.error("Missing argument, you need to provide a appid, or be in a capacitor project"),A.error(""));let n=await de(e.apikey);await me(n,e.apikey,["write","all","read","upload"]),m.info(`Querying available versions of: ${t} in Capgo`),await Be(n,e.apikey,t,1);let i=await ep(n,t);m.info(`Active versions in Capgo: ${i?.length}`),Qh(i),X("Done \u2705"),(0,NN.exit)()}var rL=require("node:crypto"),cn=require("node:fs"),nL=require("node:process");function zc(t,e,r=0){r=Math.max(0,Math.min(r,e.byteLength));let n=e.byteLength-r;return t.byteLength>n&&(t=t.subarray(0,n)),e.set(t,r),t.byteLength}var ap=32*1024,Bb=2**32-2,up=class{#e;#t=0;constructor(e){this.#e=e===void 0?new Uint8Array(0):new Uint8Array(e)}bytes(e={copy:!0}){return e.copy===!1?this.#e.subarray(this.#t):this.#e.slice(this.#t)}empty(){return this.#e.byteLength<=this.#t}get length(){return this.#e.byteLength-this.#t}get capacity(){return this.#e.buffer.byteLength}truncate(e){if(e===0){this.reset();return}if(e<0||e>this.length)throw Error("bytes.Buffer: truncation out of range");this.#r(this.#t+e)}reset(){this.#r(0),this.#t=0}#i(e){let r=this.#e.byteLength;return e<=this.capacity-r?(this.#r(r+e),r):-1}#r(e){if(e>this.#e.buffer.byteLength)throw new RangeError("Length is greater than buffer capacity");this.#e=new Uint8Array(this.#e.buffer,0,e)}readSync(e){if(this.empty())return this.reset(),e.byteLength===0?0:null;let r=zc(this.#e.subarray(this.#t),e);return this.#t+=r,r}read(e){let r=this.readSync(e);return Promise.resolve(r)}writeSync(e){let r=this.#n(e.byteLength);return zc(e,this.#e,r)}write(e){let r=this.writeSync(e);return Promise.resolve(r)}#n(e){let r=this.length;r===0&&this.#t!==0&&this.reset();let n=this.#i(e);if(n>=0)return n;let i=this.capacity;if(e<=Math.floor(i/2)-r)zc(this.#e.subarray(this.#t),this.#e);else{if(i+e>Bb)throw new Error("The buffer cannot be grown beyond the maximum size.");{let o=new Uint8Array(Math.min(2*i+e,Bb));zc(this.#e.subarray(this.#t),o),this.#e=o}}return this.#t=0,this.#r(Math.min(r+e,Bb)),r}grow(e){if(e<0)throw Error("Buffer.grow: negative count");let r=this.#n(e);this.#r(r)}async readFrom(e){let r=0,n=new Uint8Array(ap);for(;;){let i=this.capacity-this.length<ap,o=i?n:new Uint8Array(this.#e.buffer,this.length),s=await e.read(o);if(s===null)return r;i?this.writeSync(o.subarray(0,s)):this.#r(this.length+s),r+=s}}readFromSync(e){let r=0,n=new Uint8Array(ap);for(;;){let i=this.capacity-this.length<ap,o=i?n:new Uint8Array(this.#e.buffer,this.length),s=e.readSync(o);if(s===null)return r;i?this.writeSync(o.subarray(0,s)):this.#r(this.length+s),r+=s}}};var cp=class extends TransformStream{constructor(e){let r=new up;r.grow(e),super({start(){},async transform(n,i){for(r.write(n);r.length>=e;){let o=new Uint8Array(e),s=await r.read(o);if(s!==e)throw new Error(`Unexpectedly read ${s} bytes from transform buffer when trying to read ${e} bytes.`);i.enqueue(o)}},flush(n){r.length&&n.enqueue(r.bytes())}})}};function Ei(t){return t=t.trim(),t=t.replace(/<!--[\s\S]*?-->/g,""),e();function e(){return{declaration:r(),root:n()}}function r(){if(!u(/^<\?xml\s*/))return;let h={attributes:{}};for(;!(c()||l("?>"));){let d=o();if(!d)return h;h.attributes[d.name]=d.value}return u(/\?>\s*/),h}function n(){let f=u(/^<([\w-:.]+)\s*/);if(!f)return;let h={name:f[1],attributes:{},children:[]};for(;!(c()||l(">")||l("?>")||l("/>"));){let p=o();if(!p)return h;h.attributes[p.name]=p.value}if(u(/^\s*\/>\s*/))return h;u(/\??>\s*/),h.content=i();let d;for(;d=n();)h.children.push(d);return u(/^<\/[\w-:.]+>\s*/),h}function i(){let f=u(/^([^<]*)/);return f?a(f[1]):""}function o(){let f=u(/([\w:-]+)\s*=\s*("[^"]*"|'[^']*'|\w+)\s*/);if(f)return{name:f[1],value:a(s(f[2]))}}function s(f){return f.replace(/^['"]|['"]$/g,"")}function a(f){return f.replaceAll("&lt;","<").replaceAll("&gt;",">").replaceAll("&amp;","&")}function u(f){let h=t.match(f);if(h)return t=t.slice(h[0].length),h}function c(){return t.length==0}function l(f){return t.indexOf(f)==0}}var un=class extends Error{constructor(e){super(e)}};var Or=class extends un{},lp=class extends un{},fp=class extends un{},Mn=class extends un{},Ro=class extends un{},Gc=class extends un{},Wc=class extends un{},Un=class extends un{statusCode;code;key;bucketName;resource;region;constructor(e,r,n,i={}){super(n),this.statusCode=e,this.code=r,this.key=i.key,this.bucketName=i.bucketName,this.resource=i.resource,this.region=i.region}};async function BN(t){try{let r=Ei(await t.text()).root;if(r?.name!=="Error")throw new Error("Invalid root, expected <Error>");let n=r.children.find(c=>c.name==="Code")?.content??"UnknownErrorCode",i=r.children.find(c=>c.name==="Message")?.content??"The error message could not be determined.",o=r.children.find(c=>c.name==="Key")?.content,s=r.children.find(c=>c.name==="BucketName")?.content,a=r.children.find(c=>c.name==="Resource")?.content,u=r.children.find(c=>c.name==="Region")?.content;return new Un(t.status,n,i,{key:o,bucketName:s,resource:a,region:u})}catch{return new Un(t.status,"UnrecognizedError",`Error: Unexpected response code ${t.status} ${t.statusText}. Unable to parse response as XML.`)}}function qN(t){return typeof t!="number"||isNaN(t)||t<=0?!1:t>=1&&t<=65535}function MN(t){return typeof t!="string"||t.length<3||t.length>63||t.indexOf("..")>-1||t.match(/[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+/)?!1:!!t.match(/^[a-z0-9][a-z0-9.-]+[a-z0-9]$/)}function $o(t){return!(!Zae(t)||t.length===0)}function Zae(t){return!(typeof t!="string"||t.length>1024)}function dp(t){return Array.from(t).map(e=>e.toString(16).padStart(2,"0")).join("")}function Io(t=""){let e={'"':"","&quot;":"","&#34;":"","&QUOT;":"","&#x00022":""};return t.replace(/^("|&quot;|&#34;)|("|&quot;|&#34;)$/g,r=>e[r])}function Mb(t){return t.get("x-amz-version-id")??null}function Kc(t){t=t||new Date;let e=t.toISOString();return e.substr(0,4)+e.substr(5,2)+e.substr(8,5)+e.substr(14,2)+e.substr(17,2)+"Z"}function Ub(t){t=t||new Date;let e=t.toISOString();return e.substr(0,4)+e.substr(5,2)+e.substr(8,2)}function Vb(t,e){return`${Ub(e)}/${t}/s3/aws4_request`}async function hp(t){return t instanceof Uint8Array||(t=new TextEncoder().encode(t)),dp(new Uint8Array(await crypto.subtle.digest("SHA-256",t)))}var Qae=["x-amz-server-side-encryption-customer-algorithm","x-amz-server-side-encryption-customer-key","x-amz-server-side-encryption-customer-key-MD5"],pp=class extends WritableStream{getResult;constructor({client:e,bucketName:r,objectName:n,partSize:i,metadata:o}){let s,a=1,u,c=[],l=[];super({start(){},async write(f,h){let d="PUT",p=a++;try{if(p==1&&f.length<i){let w=await e.makeRequest({method:d,headers:new Headers({...o,"Content-Length":String(f.length)}),bucketName:r,objectName:n,payload:f});s={etag:Io(w.headers.get("etag")??void 0),versionId:Mb(w.headers)};return}p===1&&(u=(await eue({client:e,bucketName:r,objectName:n,metadata:o})).uploadId);let v={"Content-Length":String(f.length)};for(let w of Qae){let x=o[w];x&&(v[w]=x)}let g=e.makeRequest({method:d,query:{partNumber:p.toString(),uploadId:u},headers:new Headers(v),bucketName:r,objectName:n,payload:f});g.then(w=>{let x=w.headers.get("etag")??"";x&&(x=x.replace(/^"/,"").replace(/"$/,"")),c.push({part:p,etag:x})}),l.push(g)}catch(v){throw v}},async close(){if(!s)if(u)await Promise.all(l),c.sort((f,h)=>f.part>h.part?1:-1),s=await tue({client:e,bucketName:r,objectName:n,uploadId:u,etags:c});else throw new Error("Stream was closed without uploading any data.")}}),this.getResult=()=>{if(s===void 0)throw new Error("Result is not ready. await the stream first.");return s}}};async function eue(t){let e="POST",r=new Headers(t.metadata),o=await(await t.client.makeRequest({method:e,bucketName:t.bucketName,objectName:t.objectName,query:"uploads",headers:r,returnBody:!0})).text(),s=Ei(o).root;if(!s||s.name!=="InitiateMultipartUploadResult")throw new Error(`Unexpected response: ${o}`);let a=s.children.find(u=>u.name==="UploadId")?.content;if(!a)throw new Error(`Unable to get UploadId from response: ${o}`);return{uploadId:a}}async function tue({client:t,bucketName:e,objectName:r,uploadId:n,etags:i}){let o=`
275
+ `).eq("app_id",e).order("created_at",{ascending:!1});return n&&(m.error(`App ${e} not found in database`),A.error("")),r}var pN=require("node:process");async function mN(t,e,r){let{data:n,error:i}=await t.from("devices_override").select().eq("app_id",e).eq("version",r.id);if(i&&(m.error(`Cannot check Device override ${e}@${r.name}`),A.error("")),n&&n.length>0)if(Y(`\u274C Version ${e}@${r.name} is used in ${n.length} device override`),await Pe({message:"unlink it?"}))for(let o of n){let s=be();s.start(`Unlinking device ${o.device_id}`);let{error:a}=await t.from("devices_override").delete().eq("device_id",o.device_id);a&&(s.stop(`Cannot unlink device ${o.device_id} ${Q(a)}`),(0,pN.exit)(1)),s.stop(`\u2705 Device ${o.device_id} unlinked`)}else m.error("Unlink it first"),A.error("")}async function Kae(t,e,r){let{error:n}=await t.from("app_versions").update({deleted:!0}).eq("app_id",e).eq("deleted",!1).eq("name",r);n&&(m.error(`App Version ${e}@${r} not found in database`),A.error(""))}async function Jh(t,e,r){let n=await Yae(t,e,r);await cN(t,e,n),await mN(t,e,n),await Kae(t,e,r)}function Xh(t){t.length||(m.error("No bundle found"),(0,gN.exit)(1));let e=new lr;e.theme=lr.roundTheme,e.headers=["Version","Created","Keep"],t.reverse().forEach(r=>{e.rows.push([r.name,ya(r.created_at),r.keep!=null?r.keep:""])}),m.success("Bundles"),m.success(e.toString())}async function Zh(t,e){let{data:r,error:n}=await t.from("app_versions").select().eq("app_id",e).eq("deleted",!1).order("created_at",{ascending:!1});return n&&(m.error(`App ${e} not found in database`),A.error("")),r}async function yN(t,e){let{data:r,error:n}=await t.from("channels").select("version").eq("app_id",e);return n&&(m.error(`App ${e} not found in database`),A.error("")),r.map(i=>i.version)}async function Yae(t,e,r){let{data:n,error:i}=await t.from("app_versions").select().eq("app_id",e).eq("name",r).eq("deleted",!1).single();return(!n||i)&&(m.error(`App Version ${e}@${r} doesn't exist`),A.error("")),n}async function Jae(t,e,r){for await(let n of t)m.warn(`Removing ${n.name} created on ${ya(n.created_at)}`),await Jh(e,r,n.name)}function Xae(t,e,r){let n=[];return t?.forEach(i=>{let o=Bn(i.name);jb(o,e)&&Ta(o,r)&&n.push(i)}),n}async function DN(t,e){Y("Cleanup versions in Capgo"),await De(),e.apikey=e.apikey||pe();let{bundle:r,keep:n=4}=e,i=e.force||!1,o=await ee();t=ge(t,o?.config),e.apikey||(m.error("Missing API key, you need to provide an API key to delete your app"),A.error("")),t||(m.error("Missing argument, you need to provide a appid, or be in a capacitor project"),A.error(""));let s=await de(e.apikey);await me(s,e.apikey,["write","all"]),await Be(s,e.apikey,t,3),m.info("Querying all available versions in Capgo");let a=await Zh(s,t),u=await yN(s,t);if(m.info(`Total active versions in Capgo: ${a?.length}`),a?.length===0){m.error("No versions found, aborting cleanup");return}if(r){let f=Bn(r),h=oN(f,"major");m.info(`Querying available versions in Capgo between ${ka(f)} and ${ka(h)}`),a=Xae(a,f,h),m.info(`Active versions in Capgo between ${ka(f)} and ${ka(h)}: ${a?.length}`)}let c=[],l=0;if(a.forEach(f=>{let h=u.find(d=>d===f.id);l<n||h?(h?f.keep="\u2705 (Linked to channel)":f.keep="\u2705",l+=1):(f.keep="\u274C",c.push(f))}),c.length===0){m.warn("Nothing to be removed, aborting removal...");return}if(Xh(a),!i){let f=await Pe({message:"Do you want to continue removing the versions specified?"});(kt(f)||!f)&&(m.warn("Not confirmed, aborting removal..."),(0,Lb.exit)())}m.success("You have confirmed removal, removing versions now"),await Jae(c,s,t),X("Done \u2705"),(0,Lb.exit)()}var sn=require("node:fs"),EN=require("node:process");var Hc=require("node:buffer"),Lt=require("node:crypto"),vN="aes-128-cbc",bN="sha256",Qh="base64",wN=Lt.constants.RSA_PKCS1_OAEP_PADDING;function _N(t,e,r){let[n,i]=e.split(":"),o=(0,Lt.privateDecrypt)({key:r,padding:wN,oaepHash:bN},Hc.Buffer.from(i,Qh)),s=Hc.Buffer.from(n,Qh),a=(0,Lt.createDecipheriv)(vN,o,s);return a.setAutoPadding(!0),Hc.Buffer.concat([a.update(t),a.final()])}function ep(t,e){let r=(0,Lt.randomBytes)(16),n=(0,Lt.randomBytes)(16),i=(0,Lt.createCipheriv)(vN,n,r);i.setAutoPadding(!0);let o=r.toString(Qh),s=(0,Lt.publicEncrypt)({key:e,padding:wN,oaepHash:bN},n).toString(Qh),a=`${o}:${s}`;return{encryptedData:Hc.Buffer.concat([i.update(t),i.final()]),ivSessionKey:a}}function tp(t="pem",e=2048){let{publicKey:r,privateKey:n}=(0,Lt.generateKeyPairSync)("rsa",{modulusLength:e});return t==="pem"?{publicKey:r.export({type:"pkcs1",format:"pem"}),privateKey:n.export({type:"pkcs1",format:"pem"})}:{publicKey:r.export({type:"spki",format:"der"}).toString("base64"),privateKey:n.export({type:"pkcs1",format:"pem"}).toString("base64")}}async function CN(t,e,r){Y("Decrypt zip file"),await De(),(0,sn.existsSync)(t)||(m.error(`Zip not found at the path ${t}`),A.error(""));let n=await ee();!r.key&&!(0,sn.existsSync)(er)&&!n.config.plugins?.CapacitorUpdater?.privateKey&&(m.error(`Private Key not found at the path ${er} or in ${n.path}`),A.error(""));let i=r.key||er,o=n.config.plugins?.CapacitorUpdater?.privateKey;!(0,sn.existsSync)(i)&&!o?(m.error(`Cannot find public key ${i} or as keyData option or in ${n.path}`),A.error("")):(0,sn.existsSync)(i)&&(o=(0,sn.readFileSync)(i).toString());let s=(0,sn.readFileSync)(t),a=_N(s,e,r.keyData??o??"");(0,sn.writeFileSync)(`${t}_decrypted.zip`,a),X(`Decrypted zip file at ${t}_decrypted.zip`),(0,EN.exit)()}var an=require("node:fs"),ON=require("node:process");var AN=ce(bu());var To=require("node:buffer"),Ot=require("node:crypto"),SN="aes-128-cbc",wi="base64",rp=Ot.constants.RSA_PKCS1_PADDING;function xN(t,e,r){let[n,i]=e.split(":"),o=(0,Ot.publicDecrypt)({key:r,padding:rp},To.Buffer.from(i,wi)),s=To.Buffer.from(n,wi),a=(0,Ot.createDecipheriv)(SN,o,s);return a.setAutoPadding(!0),To.Buffer.concat([a.update(t),a.final()])}function np(t,e){return(0,Ot.privateEncrypt)({key:e,padding:rp},To.Buffer.from(t,wi)).toString(wi)}function FN(t,e){return(0,Ot.publicDecrypt)({key:e,padding:rp},To.Buffer.from(t,wi)).toString(wi)}function ip(t,e){let r=(0,Ot.randomBytes)(16),n=(0,Ot.randomBytes)(16),i=(0,Ot.createCipheriv)(SN,n,r);i.setAutoPadding(!0);let o=r.toString(wi),s=(0,Ot.privateEncrypt)({key:e,padding:rp},n).toString(wi),a=`${o}:${s}`;return{encryptedData:To.Buffer.concat([i.update(t),i.final()]),ivSessionKey:a}}async function kN(t,e,r){Y("Decrypt zip file"),await De(),(0,an.existsSync)(t)||(m.error(`Zip not found at the path ${t}`),A.error(""));let n=await ee();!r.key&&!(0,an.existsSync)(jn)&&!n.config.plugins?.CapacitorUpdater?.privateKey&&(m.error(`Private Key not found at the path ${jn} or in ${n.path}`),A.error(""));let i=r.key||jn,o=n.config.plugins?.CapacitorUpdater?.publicKey;!(0,an.existsSync)(i)&&!o?(m.error(`Cannot find public key ${i} or as keyData option or in ${n.path}`),A.error("")):(0,an.existsSync)(i)&&(o=(0,an.readFileSync)(i).toString());let s=(0,an.readFileSync)(t),a=xN(s,e,r.keyData??o??"");if((0,an.writeFileSync)(`${t}_decrypted.zip`,a),m.info(`Decrypted zip file at ${t}_decrypted.zip`),r.checksum){let u=await(0,AN.checksum)(a,"sha256"),c=FN(r.checksum,r.keyData??o??"");u!==c?(m.error(`Checksum does not match ${u} !== ${c}`),A.error("")):m.info("Checksum matches")}X("\u2705 done"),(0,ON.exit)()}var TN=require("node:process");async function PN(t,e,r){Y("Delete bundle"),r.apikey=r.apikey||pe();let n=await ee();e=ge(e,n?.config),r.apikey||(m.error("Missing API key, you need to provide a API key to upload your bundle"),A.error("")),e||(m.error("Missing argument, you need to provide a appId, or be in a capacitor project"),A.error(""));let i=await de(r.apikey);await me(i,r.apikey,["write","all"]),await Be(i,r.apikey,e,3),r.apikey||(m.error("Missing API key, you need to provide an API key to delete your app"),A.error("")),t||(m.error("Missing argument, you need to provide a bundleId, or be in a capacitor project"),A.error("")),e||(m.error("Missing argument, you need to provide a appId, or be in a capacitor project"),A.error("")),m.info(`Deleting bundle ${e}@${t} from Capgo`),m.info("Keep in mind that you will not be able to reuse this bundle version, it's gone forever"),await Jh(i,e,t),m.success(`Bundle ${e}@${t} deleted in Capgo`),X("Done"),(0,TN.exit)()}var _i=require("node:fs"),RN=require("node:process");async function $N(t,e){Y("Encryption"),await De(),(0,_i.existsSync)(t)||(m.error(`Error: Zip not found at the path ${t}`),A.error(""));let r=e.key||cr,n=e.keyData||"";(0,_i.existsSync)(r)&&(n=(0,_i.readFileSync)(r).toString());let i=(0,_i.readFileSync)(t),o=ep(i,n);m.success(`ivSessionKey: ${o.ivSessionKey}`),(0,_i.writeFileSync)(`${t}_encrypted.zip`,o.encryptedData),m.success(`Encrypted zip saved at ${t}_encrypted.zip`),X("Done \u2705"),(0,RN.exit)()}var qn=require("node:fs"),IN=require("node:process");async function jN(t,e,r){let{json:n}=r;n||(Y("Encryption"),await De());let i=await ee(),o=!!i.config.plugins?.CapacitorUpdater?.privateKey,s=!!i.config.plugins?.CapacitorUpdater?.publicKey;o&&!n&&m.warning("There is still a privateKey in the config"),(0,qn.existsSync)(t)||(n?console.error(Q({error:"zip_not_found"})):m.error(`Error: Zip not found at the path ${t}`),A.error("")),s||(n?console.error(Q({error:"missing_public_key"})):m.warning("Warning: Missing Public Key in config"),A.error(""));let a=r.key||ur,u=r.keyData||"";!(0,qn.existsSync)(a)&&!u?(n?console.error(Q({error:"missing_key"})):(m.warning(`Cannot find a private key at ${a} or as a keyData option`),m.error("Error: Missing key")),A.error("")):(0,qn.existsSync)(a)&&(u=(0,qn.readFileSync)(a).toString()),u&&!u.startsWith("-----BEGIN RSA PRIVATE KEY-----")&&(n?console.error(Q({error:"invalid_private_key"})):m.error("the private key provided is not a valid RSA Private key"),A.error(""));let c=(0,qn.readFileSync)(t),l=ip(c,u),f=np(e,u),h=`${t}_encrypted.zip`;n?console.log(JSON.stringify({checksum:f,filename:h,ivSessionKey:l.ivSessionKey},null,2)):(m.success(`Encoded Checksum: ${f}`),m.success(`ivSessionKey: ${l.ivSessionKey}`)),(0,qn.writeFileSync)(h,l.encryptedData),n||(m.success(`Encrypted zip saved at ${h}`),X("Done \u2705")),(0,IN.exit)()}var NN=require("node:process");async function LN(t,e){Y("List bundles"),await De(),e.apikey=e.apikey||pe();let r=await ee();t=ge(t,r?.config),e.apikey||(m.error("Missing API key, you need to provide a API key to upload your bundle"),A.error("")),t||(m.error("Missing argument, you need to provide a appid, or be in a capacitor project"),A.error(""));let n=await de(e.apikey);await me(n,e.apikey,["write","all","read","upload"]),m.info(`Querying available versions of: ${t} in Capgo`),await Be(n,e.apikey,t,1);let i=await Zh(n,t);m.info(`Active versions in Capgo: ${i?.length}`),Xh(i),X("Done \u2705"),(0,NN.exit)()}var rL=require("node:crypto"),cn=require("node:fs"),nL=require("node:process");function zc(t,e,r=0){r=Math.max(0,Math.min(r,e.byteLength));let n=e.byteLength-r;return t.byteLength>n&&(t=t.subarray(0,n)),e.set(t,r),t.byteLength}var op=32*1024,Bb=2**32-2,sp=class{#e;#t=0;constructor(e){this.#e=e===void 0?new Uint8Array(0):new Uint8Array(e)}bytes(e={copy:!0}){return e.copy===!1?this.#e.subarray(this.#t):this.#e.slice(this.#t)}empty(){return this.#e.byteLength<=this.#t}get length(){return this.#e.byteLength-this.#t}get capacity(){return this.#e.buffer.byteLength}truncate(e){if(e===0){this.reset();return}if(e<0||e>this.length)throw Error("bytes.Buffer: truncation out of range");this.#r(this.#t+e)}reset(){this.#r(0),this.#t=0}#i(e){let r=this.#e.byteLength;return e<=this.capacity-r?(this.#r(r+e),r):-1}#r(e){if(e>this.#e.buffer.byteLength)throw new RangeError("Length is greater than buffer capacity");this.#e=new Uint8Array(this.#e.buffer,0,e)}readSync(e){if(this.empty())return this.reset(),e.byteLength===0?0:null;let r=zc(this.#e.subarray(this.#t),e);return this.#t+=r,r}read(e){let r=this.readSync(e);return Promise.resolve(r)}writeSync(e){let r=this.#n(e.byteLength);return zc(e,this.#e,r)}write(e){let r=this.writeSync(e);return Promise.resolve(r)}#n(e){let r=this.length;r===0&&this.#t!==0&&this.reset();let n=this.#i(e);if(n>=0)return n;let i=this.capacity;if(e<=Math.floor(i/2)-r)zc(this.#e.subarray(this.#t),this.#e);else{if(i+e>Bb)throw new Error("The buffer cannot be grown beyond the maximum size.");{let o=new Uint8Array(Math.min(2*i+e,Bb));zc(this.#e.subarray(this.#t),o),this.#e=o}}return this.#t=0,this.#r(Math.min(r+e,Bb)),r}grow(e){if(e<0)throw Error("Buffer.grow: negative count");let r=this.#n(e);this.#r(r)}async readFrom(e){let r=0,n=new Uint8Array(op);for(;;){let i=this.capacity-this.length<op,o=i?n:new Uint8Array(this.#e.buffer,this.length),s=await e.read(o);if(s===null)return r;i?this.writeSync(o.subarray(0,s)):this.#r(this.length+s),r+=s}}readFromSync(e){let r=0,n=new Uint8Array(op);for(;;){let i=this.capacity-this.length<op,o=i?n:new Uint8Array(this.#e.buffer,this.length),s=e.readSync(o);if(s===null)return r;i?this.writeSync(o.subarray(0,s)):this.#r(this.length+s),r+=s}}};var ap=class extends TransformStream{constructor(e){let r=new sp;r.grow(e),super({start(){},async transform(n,i){for(r.write(n);r.length>=e;){let o=new Uint8Array(e),s=await r.read(o);if(s!==e)throw new Error(`Unexpectedly read ${s} bytes from transform buffer when trying to read ${e} bytes.`);i.enqueue(o)}},flush(n){r.length&&n.enqueue(r.bytes())}})}};function Ei(t){return t=t.trim(),t=t.replace(/<!--[\s\S]*?-->/g,""),e();function e(){return{declaration:r(),root:n()}}function r(){if(!u(/^<\?xml\s*/))return;let h={attributes:{}};for(;!(c()||l("?>"));){let d=o();if(!d)return h;h.attributes[d.name]=d.value}return u(/\?>\s*/),h}function n(){let f=u(/^<([\w-:.]+)\s*/);if(!f)return;let h={name:f[1],attributes:{},children:[]};for(;!(c()||l(">")||l("?>")||l("/>"));){let p=o();if(!p)return h;h.attributes[p.name]=p.value}if(u(/^\s*\/>\s*/))return h;u(/\??>\s*/),h.content=i();let d;for(;d=n();)h.children.push(d);return u(/^<\/[\w-:.]+>\s*/),h}function i(){let f=u(/^([^<]*)/);return f?a(f[1]):""}function o(){let f=u(/([\w:-]+)\s*=\s*("[^"]*"|'[^']*'|\w+)\s*/);if(f)return{name:f[1],value:a(s(f[2]))}}function s(f){return f.replace(/^['"]|['"]$/g,"")}function a(f){return f.replaceAll("&lt;","<").replaceAll("&gt;",">").replaceAll("&amp;","&")}function u(f){let h=t.match(f);if(h)return t=t.slice(h[0].length),h}function c(){return t.length==0}function l(f){return t.indexOf(f)==0}}var un=class extends Error{constructor(e){super(e)}};var Or=class extends un{},up=class extends un{},cp=class extends un{},Mn=class extends un{},Po=class extends un{},Gc=class extends un{},Wc=class extends un{},Un=class extends un{statusCode;code;key;bucketName;resource;region;constructor(e,r,n,i={}){super(n),this.statusCode=e,this.code=r,this.key=i.key,this.bucketName=i.bucketName,this.resource=i.resource,this.region=i.region}};async function BN(t){try{let r=Ei(await t.text()).root;if(r?.name!=="Error")throw new Error("Invalid root, expected <Error>");let n=r.children.find(c=>c.name==="Code")?.content??"UnknownErrorCode",i=r.children.find(c=>c.name==="Message")?.content??"The error message could not be determined.",o=r.children.find(c=>c.name==="Key")?.content,s=r.children.find(c=>c.name==="BucketName")?.content,a=r.children.find(c=>c.name==="Resource")?.content,u=r.children.find(c=>c.name==="Region")?.content;return new Un(t.status,n,i,{key:o,bucketName:s,resource:a,region:u})}catch{return new Un(t.status,"UnrecognizedError",`Error: Unexpected response code ${t.status} ${t.statusText}. Unable to parse response as XML.`)}}function qN(t){return typeof t!="number"||isNaN(t)||t<=0?!1:t>=1&&t<=65535}function MN(t){return typeof t!="string"||t.length<3||t.length>63||t.indexOf("..")>-1||t.match(/[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+/)?!1:!!t.match(/^[a-z0-9][a-z0-9.-]+[a-z0-9]$/)}function Ro(t){return!(!Zae(t)||t.length===0)}function Zae(t){return!(typeof t!="string"||t.length>1024)}function lp(t){return Array.from(t).map(e=>e.toString(16).padStart(2,"0")).join("")}function $o(t=""){let e={'"':"","&quot;":"","&#34;":"","&QUOT;":"","&#x00022":""};return t.replace(/^("|&quot;|&#34;)|("|&quot;|&#34;)$/g,r=>e[r])}function Mb(t){return t.get("x-amz-version-id")??null}function Kc(t){t=t||new Date;let e=t.toISOString();return e.substr(0,4)+e.substr(5,2)+e.substr(8,5)+e.substr(14,2)+e.substr(17,2)+"Z"}function Ub(t){t=t||new Date;let e=t.toISOString();return e.substr(0,4)+e.substr(5,2)+e.substr(8,2)}function Vb(t,e){return`${Ub(e)}/${t}/s3/aws4_request`}async function fp(t){return t instanceof Uint8Array||(t=new TextEncoder().encode(t)),lp(new Uint8Array(await crypto.subtle.digest("SHA-256",t)))}var Qae=["x-amz-server-side-encryption-customer-algorithm","x-amz-server-side-encryption-customer-key","x-amz-server-side-encryption-customer-key-MD5"],dp=class extends WritableStream{getResult;constructor({client:e,bucketName:r,objectName:n,partSize:i,metadata:o}){let s,a=1,u,c=[],l=[];super({start(){},async write(f,h){let d="PUT",p=a++;try{if(p==1&&f.length<i){let w=await e.makeRequest({method:d,headers:new Headers({...o,"Content-Length":String(f.length)}),bucketName:r,objectName:n,payload:f});s={etag:$o(w.headers.get("etag")??void 0),versionId:Mb(w.headers)};return}p===1&&(u=(await eue({client:e,bucketName:r,objectName:n,metadata:o})).uploadId);let v={"Content-Length":String(f.length)};for(let w of Qae){let x=o[w];x&&(v[w]=x)}let g=e.makeRequest({method:d,query:{partNumber:p.toString(),uploadId:u},headers:new Headers(v),bucketName:r,objectName:n,payload:f});g.then(w=>{let x=w.headers.get("etag")??"";x&&(x=x.replace(/^"/,"").replace(/"$/,"")),c.push({part:p,etag:x})}),l.push(g)}catch(v){throw v}},async close(){if(!s)if(u)await Promise.all(l),c.sort((f,h)=>f.part>h.part?1:-1),s=await tue({client:e,bucketName:r,objectName:n,uploadId:u,etags:c});else throw new Error("Stream was closed without uploading any data.")}}),this.getResult=()=>{if(s===void 0)throw new Error("Result is not ready. await the stream first.");return s}}};async function eue(t){let e="POST",r=new Headers(t.metadata),o=await(await t.client.makeRequest({method:e,bucketName:t.bucketName,objectName:t.objectName,query:"uploads",headers:r,returnBody:!0})).text(),s=Ei(o).root;if(!s||s.name!=="InitiateMultipartUploadResult")throw new Error(`Unexpected response: ${o}`);let a=s.children.find(u=>u.name==="UploadId")?.content;if(!a)throw new Error(`Unable to get UploadId from response: ${o}`);return{uploadId:a}}async function tue({client:t,bucketName:e,objectName:r,uploadId:n,etags:i}){let o=`
276
276
  <CompleteMultipartUpload xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
277
277
  ${i.map(f=>` <Part><PartNumber>${f.part}</PartNumber><ETag>${f.etag}</ETag></Part>`).join(`
278
278
  `)}
279
279
  </CompleteMultipartUpload>
280
- `,s=await t.makeRequest({method:"POST",bucketName:e,objectName:r,query:`uploadId=${encodeURIComponent(n)}`,payload:new TextEncoder().encode(o),returnBody:!0}),a=await s.text(),u=Ei(a).root;if(!u||u.name!=="CompleteMultipartUploadResult")throw new Error(`Unexpected response: ${a}`);let c=u.children.find(f=>f.name==="ETag")?.content;if(!c)throw new Error(`Unable to get ETag from response: ${a}`);let l=Mb(s.headers);return{etag:Io(c),versionId:l}}var Hb="AWS4-HMAC-SHA256";async function UN(t){if(!t.accessKey)throw new Ro("accessKey is required for signing");if(!t.secretKey)throw new Gc("secretKey is required for signing");let e=t.headers.get("x-amz-content-sha256");if(e===null)throw new Error("Internal S3 client error - expected x-amz-content-sha256 header, but it's missing.");let r=HN(t.headers),n=zN(t.method,t.path,t.headers,r,e),i=await GN(n,t.date,t.region),o=await WN(t.date,t.region,t.secretKey),s=KN(t.accessKey,t.region,t.date),a=dp(await Pa(o,i)).toLowerCase();return`${Hb} Credential=${s}, SignedHeaders=${r.join(";").toLowerCase()}, Signature=${a}`}async function VN(t){if(!t.accessKey)throw new Ro("accessKey is required for signing");if(!t.secretKey)throw new Gc("secretKey is required for signing");if(t.expirySeconds<1)throw new Wc("expirySeconds cannot be less than 1 seconds");if(t.expirySeconds>604800)throw new Wc("expirySeconds cannot be greater than 7 days");if(!t.headers.has("Host"))throw new Error("Internal error: host header missing");let e=t.path.split("?")[0],r=t.path.split("?")[1],n=Kc(t.date),i=HN(t.headers),o=KN(t.accessKey,t.region,t.date),s="UNSIGNED-PAYLOAD",a=new URLSearchParams(r);a.set("X-Amz-Algorithm",Hb),a.set("X-Amz-Credential",o),a.set("X-Amz-Date",n),a.set("X-Amz-Expires",t.expirySeconds.toString()),a.set("X-Amz-SignedHeaders",i.join(";").toLowerCase());let u=e+"?"+a.toString().replace("+","%20"),c=zN(t.method,u,t.headers,i,s),l=await GN(c,t.date,t.region),f=await WN(t.date,t.region,t.secretKey),h=dp(await Pa(f,l)).toLowerCase();return`${t.protocol}//${t.headers.get("Host")}${u}&X-Amz-Signature=${h}`}function HN(t){let e=["authorization","content-length","content-type","user-agent"],r=[];for(let n of t.keys())e.includes(n.toLowerCase())||r.push(n);return r.sort(),r}var jo={A:65,Z:90,a:97,z:122,0:48,9:57,"/":47},rue="-._~".split("").map(t=>t.charCodeAt(0));function nue(t,e=!1){let r=new TextEncoder().encode(t),n="";for(let i of r)i>=jo.A&&i<=jo.Z||i>=jo.a&&i<=jo.z||i>=jo[0]&&i<=jo[9]||rue.includes(i)||i==jo["/"]&&e?n+=String.fromCharCode(i):n+="%"+i.toString(16).padStart(2,"0").toUpperCase();return n}function zN(t,e,r,n,i){let o=n.reduce((c,l)=>{let f=`${r.get(l)}`.replace(/ +/g," ");return c.push(`${l.toLowerCase()}:${f}`),c},[]),s=e.split("?")[0],a=e.split("?")[1];a?a=a.split("&").sort().map(c=>c.indexOf("=")===-1?c+"=":c).join("&"):a="";let u=[];return u.push(t.toUpperCase()),u.push(nue(s,!0)),u.push(a),u.push(o.join(`
280
+ `,s=await t.makeRequest({method:"POST",bucketName:e,objectName:r,query:`uploadId=${encodeURIComponent(n)}`,payload:new TextEncoder().encode(o),returnBody:!0}),a=await s.text(),u=Ei(a).root;if(!u||u.name!=="CompleteMultipartUploadResult")throw new Error(`Unexpected response: ${a}`);let c=u.children.find(f=>f.name==="ETag")?.content;if(!c)throw new Error(`Unable to get ETag from response: ${a}`);let l=Mb(s.headers);return{etag:$o(c),versionId:l}}var Hb="AWS4-HMAC-SHA256";async function UN(t){if(!t.accessKey)throw new Po("accessKey is required for signing");if(!t.secretKey)throw new Gc("secretKey is required for signing");let e=t.headers.get("x-amz-content-sha256");if(e===null)throw new Error("Internal S3 client error - expected x-amz-content-sha256 header, but it's missing.");let r=HN(t.headers),n=zN(t.method,t.path,t.headers,r,e),i=await GN(n,t.date,t.region),o=await WN(t.date,t.region,t.secretKey),s=KN(t.accessKey,t.region,t.date),a=lp(await Pa(o,i)).toLowerCase();return`${Hb} Credential=${s}, SignedHeaders=${r.join(";").toLowerCase()}, Signature=${a}`}async function VN(t){if(!t.accessKey)throw new Po("accessKey is required for signing");if(!t.secretKey)throw new Gc("secretKey is required for signing");if(t.expirySeconds<1)throw new Wc("expirySeconds cannot be less than 1 seconds");if(t.expirySeconds>604800)throw new Wc("expirySeconds cannot be greater than 7 days");if(!t.headers.has("Host"))throw new Error("Internal error: host header missing");let e=t.path.split("?")[0],r=t.path.split("?")[1],n=Kc(t.date),i=HN(t.headers),o=KN(t.accessKey,t.region,t.date),s="UNSIGNED-PAYLOAD",a=new URLSearchParams(r);a.set("X-Amz-Algorithm",Hb),a.set("X-Amz-Credential",o),a.set("X-Amz-Date",n),a.set("X-Amz-Expires",t.expirySeconds.toString()),a.set("X-Amz-SignedHeaders",i.join(";").toLowerCase());let u=e+"?"+a.toString().replace("+","%20"),c=zN(t.method,u,t.headers,i,s),l=await GN(c,t.date,t.region),f=await WN(t.date,t.region,t.secretKey),h=lp(await Pa(f,l)).toLowerCase();return`${t.protocol}//${t.headers.get("Host")}${u}&X-Amz-Signature=${h}`}function HN(t){let e=["authorization","content-length","content-type","user-agent"],r=[];for(let n of t.keys())e.includes(n.toLowerCase())||r.push(n);return r.sort(),r}var Io={A:65,Z:90,a:97,z:122,0:48,9:57,"/":47},rue="-._~".split("").map(t=>t.charCodeAt(0));function nue(t,e=!1){let r=new TextEncoder().encode(t),n="";for(let i of r)i>=Io.A&&i<=Io.Z||i>=Io.a&&i<=Io.z||i>=Io[0]&&i<=Io[9]||rue.includes(i)||i==Io["/"]&&e?n+=String.fromCharCode(i):n+="%"+i.toString(16).padStart(2,"0").toUpperCase();return n}function zN(t,e,r,n,i){let o=n.reduce((c,l)=>{let f=`${r.get(l)}`.replace(/ +/g," ");return c.push(`${l.toLowerCase()}:${f}`),c},[]),s=e.split("?")[0],a=e.split("?")[1];a?a=a.split("&").sort().map(c=>c.indexOf("=")===-1?c+"=":c).join("&"):a="";let u=[];return u.push(t.toUpperCase()),u.push(nue(s,!0)),u.push(a),u.push(o.join(`
281
281
  `)+`
282
282
  `),u.push(n.join(";").toLowerCase()),u.push(i),u.join(`
283
- `)}async function GN(t,e,r){let n=await hp(t),i=Vb(r,e),o=[];return o.push(Hb),o.push(Kc(e)),o.push(i),o.push(n),o.join(`
284
- `)}async function WN(t,e,r){let n=Ub(t),i=await Pa("AWS4"+r,n),o=await Pa(i,e),s=await Pa(o,"s3");return await Pa(s,"aws4_request")}function KN(t,e,r){return`${t}/${Vb(e,r)}`}async function Pa(t,e){let r=new TextEncoder,n=await crypto.subtle.importKey("raw",t instanceof Uint8Array?t:r.encode(t),{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign","verify"]),i=await crypto.subtle.sign("HMAC",n,e instanceof Uint8Array?e:r.encode(e));return new Uint8Array(i)}var iue=["Content-Type","Cache-Control","Content-Disposition","Content-Encoding","Content-Language","Expires","x-amz-grant-full-control","x-amz-grant-read","x-amz-grant-read-acp","x-amz-grant-write-acp","x-amz-server-side-encryption","x-amz-storage-class","x-amz-website-redirect-location","x-amz-server-side-encryption-customer-algorithm","x-amz-server-side-encryption-customer-key","x-amz-server-side-encryption-customer-key-MD5","x-amz-server-side-encryption-aws-kms-key-id","x-amz-server-side-encryption-context","x-amz-server-side-encryption-bucket-key-enabled","x-amz-request-payer","x-amz-tagging","x-amz-object-lock-mode","x-amz-object-lock-retain-until-date","x-amz-object-lock-legal-hold","x-amz-expected-bucket-owner"],oue=5*1024*1024,sue=5*1024*1024*1024,zb=5*1024*1024*1024*1024,Yc=class{host;port;protocol;accessKey;#e;sessionToken;defaultBucket;region;userAgent="s3-lite-client";pathStyle;constructor(e){if(e.useSSL===void 0&&(e.useSSL=!0),typeof e.endPoint!="string"||e.endPoint.length===0||e.endPoint.indexOf("/")!==-1)throw new lp(`Invalid endPoint : ${e.endPoint}`);if(e.port!==void 0&&!qN(e.port))throw new Or(`Invalid port : ${e.port}`);if(e.accessKey&&!e.secretKey)throw new Or("If specifying access key, secret key must also be provided.");if(e.accessKey&&e.accessKey.startsWith("ASIA")&&!e.sessionToken)throw new Or("If specifying temporary access key, session token must also be provided.");let r=e.useSSL?443:80;this.port=e.port??r,this.host=e.endPoint.toLowerCase()+(this.port!==r?`:${e.port}`:""),this.protocol=e.useSSL?"https:":"http:",this.accessKey=e.accessKey,this.#e=e.secretKey??"",this.sessionToken=e.sessionToken,this.pathStyle=e.pathStyle??!0,this.defaultBucket=e.bucket,this.region=e.region}getBucketName(e){let r=e?.bucketName??this.defaultBucket;if(r===void 0||!MN(r))throw new fp(`Invalid bucket name: ${r}`);return r}buildRequestOptions(e){let r=this.getBucketName(e),n=this.pathStyle?this.host:`${r}.${this.host}`,i=e.headers??new Headers;i.set("host",n);let o=typeof e.query=="object"?new URLSearchParams(e.query).toString().replace("+","%20"):e.query,s=(this.pathStyle?`/${r}/${e.objectName}`:`/${e.objectName}`)+(o?`?${o}`:"");return{headers:i,host:n,path:s}}async makeRequest({method:e,payload:r,...n}){let i=new Date,{headers:o,host:s,path:a}=this.buildRequestOptions(n),u=n.statusCode??200;if(e==="POST"||e==="PUT"||e==="DELETE")r===void 0?r=new Uint8Array:typeof r=="string"&&(r=new TextEncoder().encode(r)),o.set("Content-Length",String(r.length));else if(r)throw new Error(`Unexpected payload on ${e} request.`);let c=await hp(r??new Uint8Array);o.set("x-amz-date",Kc(i)),o.set("x-amz-content-sha256",c),this.accessKey&&(this.sessionToken&&o.set("x-amz-security-token",this.sessionToken),o.set("authorization",await UN({headers:o,method:e,path:a,accessKey:this.accessKey,secretKey:this.#e,region:this.region,date:i})));let l=`${this.protocol}//${s}${a}`,f=await fetch(l,{method:e,headers:o,body:r});if(f.status!==u)throw f.status>=400?await BN(f):f.status===301?new Un(f.status,"UnexpectedRedirect",'The server unexpectedly returned a redirect response. With AWS S3, this usually means you need to use a region-specific endpoint like "s3.us-west-2.amazonaws.com" instead of "s3.amazonaws.com"'):new Un(f.status,"UnexpectedStatusCode",`Unexpected response code from the server (expected ${u}, got ${f.status} ${f.statusText}).`);return n.returnBody||await f.body?.getReader().read(),f}async deleteObject(e,r={}){let n=this.getBucketName(r);if(!$o(e))throw new Mn(`Invalid object name: ${e}`);let i=r.versionId?{versionId:r.versionId}:{},o=new Headers;r.governanceBypass&&o.set("X-Amz-Bypass-Governance-Retention","true"),await this.makeRequest({method:"DELETE",bucketName:n,objectName:e,headers:o,query:i,statusCode:204})}async exists(e,r){try{return await this.statObject(e,r),!0}catch(n){if(n instanceof Un&&n.statusCode===404)return!1;throw n}}getObject(e,r){return this.getPartialObject(e,{...r,offset:0,length:0})}async getPartialObject(e,{offset:r,length:n,...i}){let o=this.getBucketName(i);if(!$o(e))throw new Mn(`Invalid object name: ${e}`);let s=new Headers(Object.entries(i.metadata??{})),a=200;if(r||n){let c="";r?c=`bytes=${+r}-`:(c="bytes=0-",r=0),n&&(c+=`${+n+r-1}`),s.set("Range",c),a=206}let u={...i.responseParams,...i.versionId?{versionId:i.versionId}:{}};return await this.makeRequest({method:"GET",bucketName:o,objectName:e,headers:s,query:u,statusCode:a,returnBody:!0})}getPresignedUrl(e,r,n={}){if(!this.accessKey)throw new Ro(`Presigned ${e} URLs cannot be generated for anonymous requests. Specify an accessKey and secretKey.`);if(!$o(r))throw new Mn(`Invalid object name: ${r}`);let{headers:i,path:o}=this.buildRequestOptions({objectName:r,bucketName:n.bucketName,query:n.parameters}),s=n.requestDate??new Date,a=n.expirySeconds??24*60*60*7;return VN({protocol:this.protocol,headers:i,method:e,path:o,accessKey:this.accessKey,secretKey:this.#e,region:this.region,date:s,expirySeconds:a})}presignedGetObject(e,r={}){let{versionId:n,responseParams:i,...o}=r,s={...i,...n?{versionId:n}:{}};return this.getPresignedUrl("GET",e,{parameters:s,...o})}async*listObjects(e={}){for await(let r of this.listObjectsGrouped({...e,delimiter:""}))if(r.type==="Object")yield r;else throw new Error(`Unexpected result from listObjectsGrouped(): ${r}`)}async*listObjectsGrouped(e){let r=this.getBucketName(e),n="",i=e.pageSize??1e3;if(i<1||i>1e3)throw new Or("pageSize must be between 1 and 1,000.");let o=0;for(;;){let s=e.maxResults?Math.min(i,e.maxResults-o):i;if(s===0)return;let u=await(await this.makeRequest({method:"GET",bucketName:r,objectName:"",query:{"list-type":"2",prefix:e.prefix??"",delimiter:e.delimiter,"max-keys":String(s),...n?{"continuation-token":n}:{}},returnBody:!0})).text(),c=Ei(u).root;if(!c||c.name!=="ListBucketResult")throw new Error(`Unexpected response: ${u}`);let l=c.children.filter(d=>d.name==="CommonPrefixes").flatMap(d=>d.children),f=[];for(let d of l)f.push({type:"CommonPrefix",prefix:d.content??""}),o++;for(let d of c.children.filter(p=>p.name==="Contents"))f.push({type:"Object",key:d.children.find(p=>p.name==="Key")?.content??"",etag:Io(d.children.find(p=>p.name==="ETag")?.content??""),size:parseInt(d.children.find(p=>p.name==="Size")?.content??"",10),lastModified:new Date(d.children.find(p=>p.name==="LastModified")?.content??"invalid")}),o++;f.sort((d,p)=>{let v=d.type==="Object"?d.key:d.prefix,g=p.type==="Object"?p.key:p.prefix;return v>g?1:v<g?-1:0});for(let d of f)yield d;if(c.children.find(d=>d.name==="IsTruncated")?.content==="true"){let d=c.children.find(p=>p.name==="NextContinuationToken")?.content;if(!d)throw new Error("Unexpectedly missing continuation token, but server said there are more results.");n=d}else return}}async putObject(e,r,n){let i=this.getBucketName(n);if(!$o(e))throw new Mn(`Invalid object name: ${e}`);let o,s;if(typeof r=="string"){let l=new TextEncoder().encode(r);typeof ReadableStream.from<"u"?s=ReadableStream.from([l]):s=new ReadableStream({start(f){f.enqueue(l),f.close()}}),o=l.length}else if(r instanceof Uint8Array)typeof ReadableStream.from<"u"?s=ReadableStream.from([r]):s=new ReadableStream({start(l){l.enqueue(r),l.close()}}),o=r.byteLength;else if(r instanceof ReadableStream)s=r;else throw new Or("Invalid stream/data type provided.");if(n?.size!==void 0){if(o!==void 0&&n?.size!==o)throw new Or(`size was specified (${n.size}) but doesn't match auto-detected size (${o}).`);if(typeof n.size!="number"||n.size<0||isNaN(n.size))throw new Or(`invalid size specified: ${n.size}`);o=n.size}let a=n?.partSize??this.calculatePartSize(o);if(a<oue)throw new Or("Part size should be greater than 5MB");if(a>sue)throw new Or("Part size should be less than 6MB");let u=new cp(a),c=new pp({client:this,bucketName:i,objectName:e,partSize:a,metadata:n?.metadata??{}});return await s.pipeThrough(u).pipeTo(c),c.getResult()}calculatePartSize(e){if(e===void 0&&(e=zb),e>zb)throw new TypeError(`size should not be more than ${zb}`);let r=64*1024*1024;for(;;){if(r*1e4>e)return r;r+=16*1024*1024}}async statObject(e,r){let n=this.getBucketName(r);if(!$o(e))throw new Mn(`Invalid object name: ${e}`);let i={};r?.versionId&&(i.versionId=r.versionId);let o=await this.makeRequest({method:"HEAD",bucketName:n,objectName:e,query:i}),s={};for(let a of iue)o.headers.has(a)&&(s[a]=o.headers.get(a));return o.headers.forEach((a,u)=>{u.startsWith("x-amz-meta-")&&(s[u]=o.headers.get(u))}),{type:"Object",key:e,size:parseInt(o.headers.get("content-length")??"",10),metadata:s,lastModified:new Date(o.headers.get("Last-Modified")??"error: missing last modified"),versionId:o.headers.get("x-amz-version-id")||null,etag:Io(o.headers.get("ETag")??"")}}async copyObject(e,r,n){let i=this.getBucketName(n),o=e.sourceBucketName??i;if(!$o(r))throw new Mn(`Invalid object name: ${r}`);let s=`${o}/${e.sourceKey}`;e.sourceVersionId&&(s+=`?versionId=${e.sourceVersionId}`);let a=new Headers(n?.metadata);n?.metadata!==void 0&&a.set("x-amz-metadata-directive","REPLACE"),a.set("x-amz-copy-source",s);let u=await this.makeRequest({method:"PUT",bucketName:i,objectName:r,headers:a,returnBody:!0}),c=await u.text(),l=Ei(c).root;if(!l||l.name!=="CopyObjectResult")throw new Error(`Unexpected response: ${c}`);let f=l.children.find(d=>d.name==="ETag")?.content??"",h=l.children.find(d=>d.name==="LastModified")?.content;if(h===void 0)throw new Error("Unable to find <LastModified>...</LastModified> from the server.");return{copySourceVersionId:u.headers.get("x-amz-copy-source-version-id")||null,etag:Io(f),lastModified:new Date(h),versionId:u.headers.get("x-amz-version-id")||null}}async bucketExists(e){try{return await this.listObjects({bucketName:e}).next(),!0}catch(r){if(r instanceof Un&&r.statusCode===404)return!1;throw r}}async makeBucket(e){await this.makeRequest({method:"PUT",bucketName:this.getBucketName({bucketName:e}),objectName:"",statusCode:200})}async removeBucket(e){await this.makeRequest({method:"DELETE",bucketName:this.getBucketName({bucketName:e}),objectName:"",statusCode:204})}};var Gb=ce(bu());var Ci=require("node:fs"),Jc=require("node:path");function aue(t,e){return(0,Ci.readFileSync)(t,"utf8").includes(e)}function Xc(t,e){let r=(0,Ci.readdirSync)(t);for(let n of r){let i=(0,Jc.join)(t,n),o=(0,Ci.statSync)(i);if(o.isDirectory()){if(Xc(i,e))return!0}else if(o.isFile()&&(0,Jc.extname)(i)===".js"&&aue(i,e))return!0}return!1}function Zc(t){let e=(0,Ci.readdirSync)(t);if(e.length===1){let n=(0,Jc.join)(t,e[0]);if((0,Ci.statSync)(n).isDirectory())return Zc(n)}return e.indexOf("index.html")>-1}var YN=require("node:fs"),JN=require("node:os"),No=require("node:path"),XN=require("node:stream/consumers"),ZN=require("node:zlib");var QN=ce(nD());async function eL(t,e,r,n){let i=be();i.start("Generating the update manifest");let o=await aj(t);return i.stop("Manifest generated successfully"),await Fe(e,{channel:"partial-update",event:"Generate manifest",icon:"\u{1F4C2}",user_id:r,tags:{"app-id":n},notify:!1}),o}function uue(t){return(0,JN.platform)()!=="win32"?t:No.win32.normalize(t).split(No.win32.sep).join(No.posix.sep)}async function tL(t,e,r,n,i,o){let s=be();s.start("Preparing partial update with TUS protocol");let a=performance.now(),u=await Cr(),c=0,l=e.length,f=e.map(async h=>{let d=(0,No.join)(r,h.file),p=uue(h.file),v=(0,YN.createReadStream)(d).pipe((0,ZN.createBrotliCompress)()),g=await(0,XN.buffer)(v);return new Promise((w,x)=>{new QN.Upload(g,{endpoint:`${u.hostFilesApi}/files/upload/attachments/`,metadata:{filename:`orgs/${o}/apps/${n}/${i}/${p}`},headers:{Authorization:t},onError(C){m.info(`Failed to upload ${p}: ${C}`),x(C)},onProgress(){let C=(c/l*100).toFixed(2);s.message(`Uploading partial update: ${C}%`)},onSuccess(){c++,w({file_name:p,s3_path:`orgs/${o}/apps/${n}/${i}/${p}`,file_hash:h.hash})}}).start()})});try{let h=await Promise.all(f),p=((performance.now()-a)/1e3).toFixed(2);return s.stop(`Partial update uploaded successfully \u{1F4AA} in (${p} seconds)`),await Fe(t,{channel:"app",event:"App Partial TUS done",icon:"\u23EB",user_id:o,tags:{"app-id":n},notify:!1}),await Fe(t,{channel:"performance",event:"Partial upload performance",icon:"\u{1F684}",user_id:o,tags:{"app-id":n,time:p},notify:!1}),h}catch(h){let p=((performance.now()-a)/1e3).toFixed(2);return s.stop(`Failed to upload Partial bundle ( after ${p} seconds)`),m.info(`Error uploading partial update: ${h}, This is not a critical error, the bundle has been uploaded without the partial files`),null}}async function cue(t,e){let r=await jt("",e.packageJson),n=e.bundle||t?.plugins?.CapacitorUpdater?.version||r?.version||`0.0.1-beta.${(0,rL.randomUUID)().split("-")[0]}`;return ha.test(n)||(m.error(`Your bundle name ${n}, is not valid it should follow semver convention : https://semver.org/`),A.error("")),n}function lue(t){let e=t.apikey||pe();return e||(m.error("Missing API key, you need to provide a API key to upload your bundle"),A.error("")),e}function fue(t,e,r){let n=ge(t,r),i=e.path||r?.webDir;return n||(m.error("Missing argument, you need to provide a appid or be in a capacitor project"),A.error("")),i||(m.error("Missing argument, you need to provide a path (--path), or be in a capacitor project"),A.error("")),(0,cn.existsSync)(i)||(m.error(`Path ${i} does not exist, build your app first, or provide a valid path`),A.error("")),{appid:n,path:i}}function due(t,e){let r=t.codeCheck;(typeof r>"u"||r)&&(Xc(e,"notifyAppReady")||(m.error("notifyAppReady() is missing in the source code. see: https://capgo.app/docs/plugin/api/#notifyappready"),A.error("")),Zc(e)||(m.error("index.html is missing in the root folder or in the only folder in the root folder"),A.error("")))}async function hue(t,e,r,n,i,o){let s=r.ignoreMetadataCheck,a=r.autoMinUpdateVersion,u=r.minUpdateVersion,{data:c,error:l}=await t.from("channels").select("disable_auto_update, version ( min_update_version, native_packages )").eq("name",n).eq("app_id",i).single(),f=!!c&&c.disable_auto_update==="version_number",h,d;if(!l&&c&&c.version&&c.version.native_packages&&!s){let g=be();g.start(`Checking bundle compatibility with channel ${n}`);let{finalCompatibility:w,localDependencies:x}=await Ih(t,i,n,r.packageJson,r.nodeModules);if(d=w,h=x,d.find(D=>D.localVersion!==D.remoteVersion))g.stop(`Bundle NOT compatible with ${n} channel`),m.warn(`You can check compatibility with "${e.runner} @capgo/cli bundle compatibility"`),a&&(u=o,m.info(`Auto set min-update-version to ${u}`));else if(a)try{let{min_update_version:D}=c.version;(!D||!ha.test(D))&&(m.error("Invalid remote min update version, skipping auto setting compatibility"),A.error("")),u=D,g.stop(`Auto set min-update-version to ${u}`)}catch{m.error(`Cannot auto set compatibility, invalid data ${c}`),A.error("")}else g.stop(`Bundle compatible with ${n} channel`)}else s||(m.warn(`Channel ${n} is new or it's your first upload with compatibility check, it will be ignored this time`),h=await ab(r.packageJson,r.nodeModules),a&&(u=o,m.info(`Auto set min-update-version to ${u}`)));f&&!u&&!s&&(m.error("You need to provide a min-update-version to upload a bundle to this channel"),A.error("")),u&&(ha.test(u)||(m.error(`Your minimal version update ${u}, is not valid it should follow semver convention : https://semver.org/`),A.error("")));let p=h?new Map(h.filter(g=>!!g.native&&g.native!==void 0).map(g=>[g.name,g])):new Map;return{nativePackages:p.size>0||!r.ignoreMetadataCheck?Array.from(p,([g,w])=>({name:g,version:w.version})):void 0,minUpdateVersion:u}}async function pue(t,e,r){let{data:n,error:i}=await t.rpc("is_trial_org",{orgid:e}).single();(n&&n>0||i)&&(m.warn(`WARNING !!
285
- Trial expires in ${n} days`),m.warn(`Upgrade here: ${r.hostWeb}/dashboard/settings/plans?oid=${e}`))}async function mue(t,e,r){let{data:n,error:i}=await t.rpc("exist_app_versions",{appid:e,apikey:"",name_version:r}).single();(n||i)&&(m.error(`Version already exists ${Q(i)}`),A.error(""))}async function gue(t,e,r,n,i,o){let s,a="",u=null,c=e.key,l=e.keyV2;u=await Rh(t);let f=be();if(f.start("Calculating checksum"),(l||e.keyDataV2||(0,cn.existsSync)(ur))&&c!==!1?a=await(0,Gb.checksum)(u,"sha256"):a=await(0,Gb.checksum)(u,"crc32"),f.stop(`Checksum: ${a}`),c===!1)m.info("Encryption ignored");else if((l||(0,cn.existsSync)(ur)||e.keyDataV2)&&!e.oldEncryption){let d=typeof l=="string"?l:ur,p=e.keyDataV2||"";!p&&!(0,cn.existsSync)(d)&&(m.error(`Cannot find private key ${d}`),A.error("")),await Fe(n,{channel:"app",event:"App encryption v2",icon:"\u{1F511}",user_id:i,tags:{"app-id":o},notify:!1}),p||(p=(0,cn.readFileSync)(d).toString()),m.info("Encrypting your bundle with V2");let v=sp(u,p);a=op(a,p),s=v.ivSessionKey,e.displayIvSession&&m.info(`Your Iv Session key is ${s},
283
+ `)}async function GN(t,e,r){let n=await fp(t),i=Vb(r,e),o=[];return o.push(Hb),o.push(Kc(e)),o.push(i),o.push(n),o.join(`
284
+ `)}async function WN(t,e,r){let n=Ub(t),i=await Pa("AWS4"+r,n),o=await Pa(i,e),s=await Pa(o,"s3");return await Pa(s,"aws4_request")}function KN(t,e,r){return`${t}/${Vb(e,r)}`}async function Pa(t,e){let r=new TextEncoder,n=await crypto.subtle.importKey("raw",t instanceof Uint8Array?t:r.encode(t),{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign","verify"]),i=await crypto.subtle.sign("HMAC",n,e instanceof Uint8Array?e:r.encode(e));return new Uint8Array(i)}var iue=["Content-Type","Cache-Control","Content-Disposition","Content-Encoding","Content-Language","Expires","x-amz-grant-full-control","x-amz-grant-read","x-amz-grant-read-acp","x-amz-grant-write-acp","x-amz-server-side-encryption","x-amz-storage-class","x-amz-website-redirect-location","x-amz-server-side-encryption-customer-algorithm","x-amz-server-side-encryption-customer-key","x-amz-server-side-encryption-customer-key-MD5","x-amz-server-side-encryption-aws-kms-key-id","x-amz-server-side-encryption-context","x-amz-server-side-encryption-bucket-key-enabled","x-amz-request-payer","x-amz-tagging","x-amz-object-lock-mode","x-amz-object-lock-retain-until-date","x-amz-object-lock-legal-hold","x-amz-expected-bucket-owner"],oue=5*1024*1024,sue=5*1024*1024*1024,zb=5*1024*1024*1024*1024,Yc=class{host;port;protocol;accessKey;#e;sessionToken;defaultBucket;region;userAgent="s3-lite-client";pathStyle;constructor(e){if(e.useSSL===void 0&&(e.useSSL=!0),typeof e.endPoint!="string"||e.endPoint.length===0||e.endPoint.indexOf("/")!==-1)throw new up(`Invalid endPoint : ${e.endPoint}`);if(e.port!==void 0&&!qN(e.port))throw new Or(`Invalid port : ${e.port}`);if(e.accessKey&&!e.secretKey)throw new Or("If specifying access key, secret key must also be provided.");if(e.accessKey&&e.accessKey.startsWith("ASIA")&&!e.sessionToken)throw new Or("If specifying temporary access key, session token must also be provided.");let r=e.useSSL?443:80;this.port=e.port??r,this.host=e.endPoint.toLowerCase()+(this.port!==r?`:${e.port}`:""),this.protocol=e.useSSL?"https:":"http:",this.accessKey=e.accessKey,this.#e=e.secretKey??"",this.sessionToken=e.sessionToken,this.pathStyle=e.pathStyle??!0,this.defaultBucket=e.bucket,this.region=e.region}getBucketName(e){let r=e?.bucketName??this.defaultBucket;if(r===void 0||!MN(r))throw new cp(`Invalid bucket name: ${r}`);return r}buildRequestOptions(e){let r=this.getBucketName(e),n=this.pathStyle?this.host:`${r}.${this.host}`,i=e.headers??new Headers;i.set("host",n);let o=typeof e.query=="object"?new URLSearchParams(e.query).toString().replace("+","%20"):e.query,s=(this.pathStyle?`/${r}/${e.objectName}`:`/${e.objectName}`)+(o?`?${o}`:"");return{headers:i,host:n,path:s}}async makeRequest({method:e,payload:r,...n}){let i=new Date,{headers:o,host:s,path:a}=this.buildRequestOptions(n),u=n.statusCode??200;if(e==="POST"||e==="PUT"||e==="DELETE")r===void 0?r=new Uint8Array:typeof r=="string"&&(r=new TextEncoder().encode(r)),o.set("Content-Length",String(r.length));else if(r)throw new Error(`Unexpected payload on ${e} request.`);let c=await fp(r??new Uint8Array);o.set("x-amz-date",Kc(i)),o.set("x-amz-content-sha256",c),this.accessKey&&(this.sessionToken&&o.set("x-amz-security-token",this.sessionToken),o.set("authorization",await UN({headers:o,method:e,path:a,accessKey:this.accessKey,secretKey:this.#e,region:this.region,date:i})));let l=`${this.protocol}//${s}${a}`,f=await fetch(l,{method:e,headers:o,body:r});if(f.status!==u)throw f.status>=400?await BN(f):f.status===301?new Un(f.status,"UnexpectedRedirect",'The server unexpectedly returned a redirect response. With AWS S3, this usually means you need to use a region-specific endpoint like "s3.us-west-2.amazonaws.com" instead of "s3.amazonaws.com"'):new Un(f.status,"UnexpectedStatusCode",`Unexpected response code from the server (expected ${u}, got ${f.status} ${f.statusText}).`);return n.returnBody||await f.body?.getReader().read(),f}async deleteObject(e,r={}){let n=this.getBucketName(r);if(!Ro(e))throw new Mn(`Invalid object name: ${e}`);let i=r.versionId?{versionId:r.versionId}:{},o=new Headers;r.governanceBypass&&o.set("X-Amz-Bypass-Governance-Retention","true"),await this.makeRequest({method:"DELETE",bucketName:n,objectName:e,headers:o,query:i,statusCode:204})}async exists(e,r){try{return await this.statObject(e,r),!0}catch(n){if(n instanceof Un&&n.statusCode===404)return!1;throw n}}getObject(e,r){return this.getPartialObject(e,{...r,offset:0,length:0})}async getPartialObject(e,{offset:r,length:n,...i}){let o=this.getBucketName(i);if(!Ro(e))throw new Mn(`Invalid object name: ${e}`);let s=new Headers(Object.entries(i.metadata??{})),a=200;if(r||n){let c="";r?c=`bytes=${+r}-`:(c="bytes=0-",r=0),n&&(c+=`${+n+r-1}`),s.set("Range",c),a=206}let u={...i.responseParams,...i.versionId?{versionId:i.versionId}:{}};return await this.makeRequest({method:"GET",bucketName:o,objectName:e,headers:s,query:u,statusCode:a,returnBody:!0})}getPresignedUrl(e,r,n={}){if(!this.accessKey)throw new Po(`Presigned ${e} URLs cannot be generated for anonymous requests. Specify an accessKey and secretKey.`);if(!Ro(r))throw new Mn(`Invalid object name: ${r}`);let{headers:i,path:o}=this.buildRequestOptions({objectName:r,bucketName:n.bucketName,query:n.parameters}),s=n.requestDate??new Date,a=n.expirySeconds??24*60*60*7;return VN({protocol:this.protocol,headers:i,method:e,path:o,accessKey:this.accessKey,secretKey:this.#e,region:this.region,date:s,expirySeconds:a})}presignedGetObject(e,r={}){let{versionId:n,responseParams:i,...o}=r,s={...i,...n?{versionId:n}:{}};return this.getPresignedUrl("GET",e,{parameters:s,...o})}async*listObjects(e={}){for await(let r of this.listObjectsGrouped({...e,delimiter:""}))if(r.type==="Object")yield r;else throw new Error(`Unexpected result from listObjectsGrouped(): ${r}`)}async*listObjectsGrouped(e){let r=this.getBucketName(e),n="",i=e.pageSize??1e3;if(i<1||i>1e3)throw new Or("pageSize must be between 1 and 1,000.");let o=0;for(;;){let s=e.maxResults?Math.min(i,e.maxResults-o):i;if(s===0)return;let u=await(await this.makeRequest({method:"GET",bucketName:r,objectName:"",query:{"list-type":"2",prefix:e.prefix??"",delimiter:e.delimiter,"max-keys":String(s),...n?{"continuation-token":n}:{}},returnBody:!0})).text(),c=Ei(u).root;if(!c||c.name!=="ListBucketResult")throw new Error(`Unexpected response: ${u}`);let l=c.children.filter(d=>d.name==="CommonPrefixes").flatMap(d=>d.children),f=[];for(let d of l)f.push({type:"CommonPrefix",prefix:d.content??""}),o++;for(let d of c.children.filter(p=>p.name==="Contents"))f.push({type:"Object",key:d.children.find(p=>p.name==="Key")?.content??"",etag:$o(d.children.find(p=>p.name==="ETag")?.content??""),size:parseInt(d.children.find(p=>p.name==="Size")?.content??"",10),lastModified:new Date(d.children.find(p=>p.name==="LastModified")?.content??"invalid")}),o++;f.sort((d,p)=>{let v=d.type==="Object"?d.key:d.prefix,g=p.type==="Object"?p.key:p.prefix;return v>g?1:v<g?-1:0});for(let d of f)yield d;if(c.children.find(d=>d.name==="IsTruncated")?.content==="true"){let d=c.children.find(p=>p.name==="NextContinuationToken")?.content;if(!d)throw new Error("Unexpectedly missing continuation token, but server said there are more results.");n=d}else return}}async putObject(e,r,n){let i=this.getBucketName(n);if(!Ro(e))throw new Mn(`Invalid object name: ${e}`);let o,s;if(typeof r=="string"){let l=new TextEncoder().encode(r);typeof ReadableStream.from<"u"?s=ReadableStream.from([l]):s=new ReadableStream({start(f){f.enqueue(l),f.close()}}),o=l.length}else if(r instanceof Uint8Array)typeof ReadableStream.from<"u"?s=ReadableStream.from([r]):s=new ReadableStream({start(l){l.enqueue(r),l.close()}}),o=r.byteLength;else if(r instanceof ReadableStream)s=r;else throw new Or("Invalid stream/data type provided.");if(n?.size!==void 0){if(o!==void 0&&n?.size!==o)throw new Or(`size was specified (${n.size}) but doesn't match auto-detected size (${o}).`);if(typeof n.size!="number"||n.size<0||isNaN(n.size))throw new Or(`invalid size specified: ${n.size}`);o=n.size}let a=n?.partSize??this.calculatePartSize(o);if(a<oue)throw new Or("Part size should be greater than 5MB");if(a>sue)throw new Or("Part size should be less than 6MB");let u=new ap(a),c=new dp({client:this,bucketName:i,objectName:e,partSize:a,metadata:n?.metadata??{}});return await s.pipeThrough(u).pipeTo(c),c.getResult()}calculatePartSize(e){if(e===void 0&&(e=zb),e>zb)throw new TypeError(`size should not be more than ${zb}`);let r=64*1024*1024;for(;;){if(r*1e4>e)return r;r+=16*1024*1024}}async statObject(e,r){let n=this.getBucketName(r);if(!Ro(e))throw new Mn(`Invalid object name: ${e}`);let i={};r?.versionId&&(i.versionId=r.versionId);let o=await this.makeRequest({method:"HEAD",bucketName:n,objectName:e,query:i}),s={};for(let a of iue)o.headers.has(a)&&(s[a]=o.headers.get(a));return o.headers.forEach((a,u)=>{u.startsWith("x-amz-meta-")&&(s[u]=o.headers.get(u))}),{type:"Object",key:e,size:parseInt(o.headers.get("content-length")??"",10),metadata:s,lastModified:new Date(o.headers.get("Last-Modified")??"error: missing last modified"),versionId:o.headers.get("x-amz-version-id")||null,etag:$o(o.headers.get("ETag")??"")}}async copyObject(e,r,n){let i=this.getBucketName(n),o=e.sourceBucketName??i;if(!Ro(r))throw new Mn(`Invalid object name: ${r}`);let s=`${o}/${e.sourceKey}`;e.sourceVersionId&&(s+=`?versionId=${e.sourceVersionId}`);let a=new Headers(n?.metadata);n?.metadata!==void 0&&a.set("x-amz-metadata-directive","REPLACE"),a.set("x-amz-copy-source",s);let u=await this.makeRequest({method:"PUT",bucketName:i,objectName:r,headers:a,returnBody:!0}),c=await u.text(),l=Ei(c).root;if(!l||l.name!=="CopyObjectResult")throw new Error(`Unexpected response: ${c}`);let f=l.children.find(d=>d.name==="ETag")?.content??"",h=l.children.find(d=>d.name==="LastModified")?.content;if(h===void 0)throw new Error("Unable to find <LastModified>...</LastModified> from the server.");return{copySourceVersionId:u.headers.get("x-amz-copy-source-version-id")||null,etag:$o(f),lastModified:new Date(h),versionId:u.headers.get("x-amz-version-id")||null}}async bucketExists(e){try{return await this.listObjects({bucketName:e}).next(),!0}catch(r){if(r instanceof Un&&r.statusCode===404)return!1;throw r}}async makeBucket(e){await this.makeRequest({method:"PUT",bucketName:this.getBucketName({bucketName:e}),objectName:"",statusCode:200})}async removeBucket(e){await this.makeRequest({method:"DELETE",bucketName:this.getBucketName({bucketName:e}),objectName:"",statusCode:204})}};var Gb=ce(bu());var jo=require("node:fs"),hp=require("node:path");function aue(t,e){return(0,jo.readFileSync)(t,"utf8").includes(e)}function Jc(t,e){let r=(0,jo.readdirSync)(t);for(let n of r){let i=(0,hp.join)(t,n),o=(0,jo.statSync)(i);if(o.isDirectory()){if(Jc(i,e))return!0}else if(o.isFile()&&(0,hp.extname)(i)===".js"&&aue(i,e))return!0}return!1}function pp(t){return(0,jo.readdirSync)(t).indexOf("index.html")>-1}var YN=require("node:fs"),JN=require("node:os"),No=require("node:path"),XN=require("node:stream/consumers"),ZN=require("node:zlib");var QN=ce(nD());async function eL(t,e,r,n){let i=be();i.start("Generating the update manifest");let o=await aj(t);return i.stop("Manifest generated successfully"),await Fe(e,{channel:"partial-update",event:"Generate manifest",icon:"\u{1F4C2}",user_id:r,tags:{"app-id":n},notify:!1}),o}function uue(t){return(0,JN.platform)()!=="win32"?t:No.win32.normalize(t).split(No.win32.sep).join(No.posix.sep)}async function tL(t,e,r,n,i,o){let s=be();s.start("Preparing partial update with TUS protocol");let a=performance.now(),u=await Cr(),c=0,l=e.length,f=e.map(async h=>{let d=(0,No.join)(r,h.file),p=uue(h.file),v=(0,YN.createReadStream)(d).pipe((0,ZN.createBrotliCompress)()),g=await(0,XN.buffer)(v);return new Promise((w,x)=>{new QN.Upload(g,{endpoint:`${u.hostFilesApi}/files/upload/attachments/`,metadata:{filename:`orgs/${o}/apps/${n}/${i}/${p}`},headers:{Authorization:t},onError(C){m.info(`Failed to upload ${p}: ${C}`),x(C)},onProgress(){let C=(c/l*100).toFixed(2);s.message(`Uploading partial update: ${C}%`)},onSuccess(){c++,w({file_name:p,s3_path:`orgs/${o}/apps/${n}/${i}/${p}`,file_hash:h.hash})}}).start()})});try{let h=await Promise.all(f),p=((performance.now()-a)/1e3).toFixed(2);return s.stop(`Partial update uploaded successfully \u{1F4AA} in (${p} seconds)`),await Fe(t,{channel:"app",event:"App Partial TUS done",icon:"\u23EB",user_id:o,tags:{"app-id":n},notify:!1}),await Fe(t,{channel:"performance",event:"Partial upload performance",icon:"\u{1F684}",user_id:o,tags:{"app-id":n,time:p},notify:!1}),h}catch(h){let p=((performance.now()-a)/1e3).toFixed(2);return s.stop(`Failed to upload Partial bundle ( after ${p} seconds)`),m.info(`Error uploading partial update: ${h}, This is not a critical error, the bundle has been uploaded without the partial files`),null}}async function cue(t,e){let r=await jt("",e.packageJson),n=e.bundle||t?.plugins?.CapacitorUpdater?.version||r?.version||`0.0.1-beta.${(0,rL.randomUUID)().split("-")[0]}`;return ha.test(n)||(m.error(`Your bundle name ${n}, is not valid it should follow semver convention : https://semver.org/`),A.error("")),n}function lue(t){let e=t.apikey||pe();return e||(m.error("Missing API key, you need to provide a API key to upload your bundle"),A.error("")),e}function fue(t,e,r){let n=ge(t,r),i=e.path||r?.webDir;return n||(m.error("Missing argument, you need to provide a appid or be in a capacitor project"),A.error("")),i||(m.error("Missing argument, you need to provide a path (--path), or be in a capacitor project"),A.error("")),(0,cn.existsSync)(i)||(m.error(`Path ${i} does not exist, build your app first, or provide a valid path`),A.error("")),{appid:n,path:i}}function due(t,e){let r=t.codeCheck;(typeof r>"u"||r)&&(Jc(e,"notifyAppReady")||(m.error("notifyAppReady() is missing in the source code. see: https://capgo.app/docs/plugin/api/#notifyappready"),A.error("")),pp(e)||(m.error(`index.html is missing in the root folder of ${e}`),A.error("")))}async function hue(t,e,r,n,i,o){let s=r.ignoreMetadataCheck,a=r.autoMinUpdateVersion,u=r.minUpdateVersion,{data:c,error:l}=await t.from("channels").select("disable_auto_update, version ( min_update_version, native_packages )").eq("name",n).eq("app_id",i).single(),f=!!c&&c.disable_auto_update==="version_number",h,d;if(!l&&c&&c.version&&c.version.native_packages&&!s){let g=be();g.start(`Checking bundle compatibility with channel ${n}`);let{finalCompatibility:w,localDependencies:x}=await Rh(t,i,n,r.packageJson,r.nodeModules);if(d=w,h=x,d.find(D=>D.localVersion!==D.remoteVersion))g.stop(`Bundle NOT compatible with ${n} channel`),m.warn(`You can check compatibility with "${e.runner} @capgo/cli bundle compatibility"`),a&&(u=o,m.info(`Auto set min-update-version to ${u}`));else if(a)try{let{min_update_version:D}=c.version;(!D||!ha.test(D))&&(m.error("Invalid remote min update version, skipping auto setting compatibility"),A.error("")),u=D,g.stop(`Auto set min-update-version to ${u}`)}catch{m.error(`Cannot auto set compatibility, invalid data ${c}`),A.error("")}else g.stop(`Bundle compatible with ${n} channel`)}else s||(m.warn(`Channel ${n} is new or it's your first upload with compatibility check, it will be ignored this time`),h=await ab(r.packageJson,r.nodeModules),a&&(u=o,m.info(`Auto set min-update-version to ${u}`)));f&&!u&&!s&&(m.error("You need to provide a min-update-version to upload a bundle to this channel"),A.error("")),u&&(ha.test(u)||(m.error(`Your minimal version update ${u}, is not valid it should follow semver convention : https://semver.org/`),A.error("")));let p=h?new Map(h.filter(g=>!!g.native&&g.native!==void 0).map(g=>[g.name,g])):new Map;return{nativePackages:p.size>0||!r.ignoreMetadataCheck?Array.from(p,([g,w])=>({name:g,version:w.version})):void 0,minUpdateVersion:u}}async function pue(t,e,r){let{data:n,error:i}=await t.rpc("is_trial_org",{orgid:e}).single();(n&&n>0||i)&&(m.warn(`WARNING !!
285
+ Trial expires in ${n} days`),m.warn(`Upgrade here: ${r.hostWeb}/dashboard/settings/plans?oid=${e}`))}async function mue(t,e,r){let{data:n,error:i}=await t.rpc("exist_app_versions",{appid:e,apikey:"",name_version:r}).single();(n||i)&&(m.error(`Version already exists ${Q(i)}`),A.error(""))}async function gue(t,e,r,n,i,o){let s,a="",u=null,c=e.key,l=e.keyV2;u=await Th(t);let f=be();if(f.start("Calculating checksum"),(l||e.keyDataV2||(0,cn.existsSync)(ur))&&c!==!1?a=await(0,Gb.checksum)(u,"sha256"):a=await(0,Gb.checksum)(u,"crc32"),f.stop(`Checksum: ${a}`),c===!1)m.info("Encryption ignored");else if((l||(0,cn.existsSync)(ur)||e.keyDataV2)&&!e.oldEncryption){let d=typeof l=="string"?l:ur,p=e.keyDataV2||"";!p&&!(0,cn.existsSync)(d)&&(m.error(`Cannot find private key ${d}`),A.error("")),await Fe(n,{channel:"app",event:"App encryption v2",icon:"\u{1F511}",user_id:i,tags:{"app-id":o},notify:!1}),p||(p=(0,cn.readFileSync)(d).toString()),m.info("Encrypting your bundle with V2");let v=ip(u,p);a=np(a,p),s=v.ivSessionKey,e.displayIvSession&&m.info(`Your Iv Session key is ${s},
286
286
  keep it safe, you will need it to decrypt your bundle.
287
287
  It will be also visible in your dashboard
288
288
  `),u=v.encryptedData}else if(c||e.keyData||(0,cn.existsSync)(cr)){m.warn(`WARNING !!
289
- You are using old encryption key, it's not secure enouth and it should be migrate on v2, here is the migration guide: https://capgo.app/docs/cli/migrations/encryption/`);let d=typeof c=="string"?c:cr,p=e.keyData||"";!p&&!(0,cn.existsSync)(d)&&(m.error(`Cannot find public key ${d}`),A.error("")),await Fe(n,{channel:"app",event:"App encryption",icon:"\u{1F511}",user_id:i,tags:{"app-id":o},notify:!1}),p||(p=(0,cn.readFileSync)(d).toString()),m.info("Encrypting your bundle");let v=rp(u,p);s=v.ivSessionKey,e.displayIvSession&&m.info(`Your Iv Session key is ${s},
289
+ You are using old encryption key, it's not secure enouth and it should be migrate on v2, here is the migration guide: https://capgo.app/docs/cli/migrations/encryption/`);let d=typeof c=="string"?c:cr,p=e.keyData||"";!p&&!(0,cn.existsSync)(d)&&(m.error(`Cannot find public key ${d}`),A.error("")),await Fe(n,{channel:"app",event:"App encryption",icon:"\u{1F511}",user_id:i,tags:{"app-id":o},notify:!1}),p||(p=(0,cn.readFileSync)(d).toString()),m.info("Encrypting your bundle");let v=ep(u,p);s=v.ivSessionKey,e.displayIvSession&&m.info(`Your Iv Session key is ${s},
290
290
  keep it safe, you will need it to decrypt your bundle.
291
291
  It will be also visible in your dashboard
292
292
  `),u=v.encryptedData}let h=Math.floor((u?.byteLength??0)/1024/1024);return h>X6&&(m.warn(`WARNING !!
293
293
  The app size is ${h} Mb, this may take a while to download for users
294
294
  `),m.info(`Learn how to optimize your assets https://capgo.app/blog/optimise-your-images-for-updates/
295
295
  `),await Fe(n,{channel:"app-error",event:"App Too Large",icon:"\u{1F69B}",user_id:i,tags:{"app-id":o},notify:!1})),{zipped:u,sessionKey:s,checksum:a}}async function yue(t,e,r,n,i,o,s){let a=be();a.start("Uploading Bundle");let u=performance.now(),c=!1;if(s.dryUpload){a.stop(`Dry run, bundle not uploaded
296
- Bundle uploaded \u{1F4AA} in 0 seconds`);return}try{let h=await Cr();if(s.multipart!==void 0&&s.multipart||s.tus!==void 0&&s.tus){s.multipart?m.info("Uploading bundle with multipart protocol, multipart is deprecated"):m.info("Uploading bundle with TUS protocol"),await uj(t,o,i,r,n,a,h),c=!0;let d=`orgs/${i}/apps/${r}/${n}.zip`,{error:p}=await e.from("app_versions").update({r2_path:d}).eq("name",n).eq("app_id",r);p&&(m.error(`Cannot finish TUS upload ${Q(p)}`),Promise.reject(new Error("Cannot finish TUS upload")))}else{let d=await oj(e,r,n);d||(m.error("Cannot get upload url"),Promise.reject(new Error("Cannot get upload url"))),await Hr.put(d,{timeout:s.timeout||Z6,retry:5,body:o})}}catch(h){let p=((performance.now()-u)/1e3).toFixed(2);if(a.stop(`Failed to upload bundle ( after ${p} seconds)`),h instanceof ti){let v=await h.response.json();m.error(`Response Error: ${v.error||v.status||v.message}`)}else m.error(`Cannot upload bundle ( try again with --tus option) ${Q(h)}`);await cj(e,r,n),A.error("")}let f=((performance.now()-u)/1e3).toFixed(2);a.stop(`Bundle uploaded \u{1F4AA} in (${f} seconds)`),await Fe(t,{channel:"performance",event:c?"TUS upload zip performance":"Upload zip performance",icon:"\u{1F684}",user_id:i,tags:{"app-id":r,time:f},notify:!1})}async function Due(t,e,r,n,i,o,s,a,u){let{data:c}=await t.rpc("get_app_versions",{apikey:e,name_version:n,appid:a}).single();c||(m.warn("Cannot get version id, cannot set channel"),A.error(""));let{error:l,data:f}=await $h(t,{name:i,app_id:a,created_by:o,version:c,owner_org:s});l&&(m.error(`Cannot set channel, the upload key is not allowed to do that, use the "all" for this. ${Q(l)}`),A.error(""));let h=_o(a),d=`${u.hostWeb}/app/p/${h}/channel/${f.id}`;f?.public?m.info("Your update is now available in your public channel \u{1F389}"):f?.id&&m.info(`Link device to this bundle to try it: ${d}`),r?m.info(`Bundle url: ${d}`):c||(m.warn("Cannot set bundle with upload key, use key with more rights for that"),A.error(""))}async function vue(t,e,r){let{error:n,data:i}=await e.from("apps").select("default_upload_channel").single();if(n){m.warn("Cannot find default upload channel");let o=_o(t);return m.info(`You can set it here: ${r}/app/p/${o}/settings`),null}return i.default_upload_channel}async function mp(t,e,r=!0){Y(`Uploading with CLI version ${Ir.version}`);let n=Nt();await De();let{s3Region:i,s3Apikey:o,s3Apisecret:s,s3BucketName:a,s3Endpoint:u,s3Port:c,s3SSL:l}=e,f=lue(e),h=await ee(),d=await Q6(),{appid:p,path:v}=fue(t,e,h.config),g=await cue(h.config,e);e.autoSetBundle&&await wo({version:g}),due(e,v),m.info(`Upload ${p}@${g} started from path "${v}" to Capgo cloud`);let w=await Cr(),x=await de(f),D=await me(x,f,["write","all","upload"]),C=e.channel||await vue(p,x,w.hostWeb)||"dev",k=await Sr(x,p);await pa(x,k,f,p,!0),await pue(x,k,w);let{nativePackages:$,minUpdateVersion:F}=await hue(x,n,e,C,p,g);await mue(x,p,g),e.external&&!e.external.startsWith("https://")&&(m.error(`External link should should start with "https://" current is "${e.external}"`),A.error(""));let L={name:g,app_id:p,session_key:void 0,external_url:e.external,storage_provider:e.external?"external":"r2-direct",min_update_version:F,native_packages:$,owner_org:k,user_id:D,checksum:void 0},S=null;if(e.external)await Fe(f,{channel:"app",event:"App external",icon:"\u{1F4E4}",user_id:k,tags:{"app-id":p},notify:!1}),L.session_key=e.ivSessionKey,L.checksum=e.encryptedChecksum;else{let{zipped:q,sessionKey:K,checksum:M}=await gue(v,e,w,f,k,p);L.session_key=K,L.checksum=M,S=q,e.ignoreChecksumCheck||await fj(x,p,C,M)}!d.TUSUpload||e.external?e.tus=!1:e.tus=e.tus||d.TUSUploadForced,!d.partialUpload||e.external?e.partial=!1:e.partial=e.partial||d.partialUploadForced;let I=e.partial?await eL(v,f,k,p):[],{error:R}=await sb(x,L);if(R&&(m.error(`Cannot add bundle ${Q(R)}`),A.error("")),S&&(a||u||i||o||s||c||l)){(!a||!u||!i||!o||!s||!c)&&(m.error("Missing argument, for S3 upload you need to provide a bucket name, endpoint, region, port, API key, and API secret"),A.error("")),m.info("Uploading to S3");let q=new Yc({endPoint:u,region:i,port:c,useSSL:l,bucket:a,accessKey:o,secretKey:s}),K=`${p}-${g}`,M=encodeURIComponent(K);await q.putObject(K,Uint8Array.from(S)),L.external_url=`https://${u}/${M}`,L.storage_provider="external"}else if(S){await yue(f,x,p,g,k,S,e);let q=null;try{e.dryUpload&&(e.partial=!1),q=e.partial?await tL(f,I,v,p,g,k):null}catch(M){m.info(`Failed to upload partial files to capgo cloud. Error: ${Q(M)}. This is not a critical error, the bundle has been uploaded without the partial files`)}L.storage_provider="r2",L.manifest=q;let{error:K}=await sb(x,L);K&&(m.error(`Cannot update bundle ${Q(K)}`),A.error(""))}let B=await Be(x,f,p,2);return ej(B,3)?await Due(x,f,!!e.bundleUrl,g,C,D,k,p,w):m.warn("Cannot set channel as a upload organization member"),await Fe(f,{channel:"app",event:"App Uploaded",icon:"\u23EB",user_id:k,tags:{"app-id":p},notify:!1}),r&&(X("Time to share your update to the world \u{1F30D}"),(0,nL.exit)()),!0}function iL(t){t.ivSessionKey&&!t.external&&(m.error("You need to provide an external url if you want to use the --iv-session-key option"),A.error("")),t.encryptedChecksum&&!t.external&&(m.error("You need to provide an external url if you want to use the --encrypted-checksum option"),A.error("")),t.partial&&t.external&&(m.error("You cannot use the --partial option with an external url"),A.error("")),t.tus&&t.external&&(m.error("You cannot use the --tus option with an external url"),A.error("")),t.dryUpload&&t.external&&(m.error("You cannot use the --dry-upload option with an external url"),A.error("")),t.multipart&&t.external&&(m.error("You cannot use the --multipart option with an external url"),A.error("")),t.external&&(t.key||t.keyData||t.keyV2||t.keyDataV2)&&(m.error("You cannot set a key if you are uploading to an external url"),A.error("")),(t.key||t.keyData)&&(t.keyV2||t.keyDataV2)&&(m.error("You cannot set both key and key-v2"),A.error("")),t.key&&t.keyData&&(m.error("You cannot set both key and key-data"),A.error("")),t.keyV2&&t.keyDataV2&&(m.error("You cannot set both key-v2 and key-data-v2"),A.error("")),t.external&&(t.s3Region||t.s3Apikey||t.s3Apisecret||t.s3Endpoint||t.s3BucketName||t.s3Port||t.s3SSL)&&(m.error("You cannot set S3 options if you are uploading to an external url, it's automatically handled"),A.error("")),t.encryptedChecksum&&!t.external&&(m.error("You cannot set the --encrypted-checksum option if you are not uploading to an external url"),A.error("")),t.minUpdateVersion&&t.autoMinUpdateVersion&&(m.error("You cannot set both min-update-version and auto-min-update-version, use only one of them"),A.error(""))}async function oL(t,e){try{iL(e),await mp(t,e,!0)}catch(r){m.error(Q(r)),A.error("")}}async function sL(t,e){let r=Nt();m.warn(`\u26A0\uFE0F This command is deprecated, use "${r.runner} @capgo/cli bundle upload" instead \u26A0\uFE0F`);try{iL(e),await mp(t,e,!0)}catch(n){m.error(Q(n)),A.error("")}}var aL=require("node:crypto"),gp=require("node:fs"),uL=require("node:process");var Wb=ce(bu());var bue=20;async function cL(t,e){try{let{bundle:r,path:n}=e,{json:i}=e;i||await De();let o=await ee();t=ge(t,o?.config);let s=(0,aL.randomUUID)().split("-")[0],a=await jt("",e.packageJson);r=r||a?.version||`0.0.1-beta.${s}`,i||Y(`Zipping ${t}@${r}`),r&&!ha.test(r)&&(i?console.error(Q({error:"invalid_semver"})):m.error(`Your bundle name ${r}, is not valid it should follow semver convention : https://semver.org/`),A.error("")),n=n||o?.config?.webDir,(!t||!r||!n)&&(i?console.error(Q({error:"missing_argument"})):m.error("Missing argument, you need to provide a appId and a bundle and a path, or be in a capacitor project"),A.error("")),i||m.info(`Started from path "${n}"`);let u=e.codeCheck;(typeof u>"u"||u)&&(Xc(n,"notifyAppReady")||(i?console.error(Q({error:"notifyAppReady_not_in_source_code"})):m.error("notifyAppReady() is missing in the source code. see: https://capgo.app/docs/plugin/api/#notifyappready"),A.error("")),Zc(n)||(i?console.error(Q({error:"index_html_not_found"})):m.error("index.html is missing in the root folder or in the only folder in the root folder"),A.error("")));let c=await Rh(n);i||m.info(`Zipped ${c.byteLength} bytes`);let l=be();i||l.start("Calculating checksum");let f="";e.keyV2||(0,gp.existsSync)(ur)?f=await(0,Wb.checksum)(c,"sha256"):f=await(0,Wb.checksum)(c,"crc32"),i||l.stop(`Checksum: ${f}`);let h=Math.floor(c.byteLength/1024/1024);h>bue&&!i&&(m.warn(`WARNING !!
296
+ Bundle uploaded \u{1F4AA} in 0 seconds`);return}try{let h=await Cr();if(s.multipart!==void 0&&s.multipart||s.tus!==void 0&&s.tus){s.multipart?m.info("Uploading bundle with multipart protocol, multipart is deprecated"):m.info("Uploading bundle with TUS protocol"),await uj(t,o,i,r,n,a,h),c=!0;let d=`orgs/${i}/apps/${r}/${n}.zip`,{error:p}=await e.from("app_versions").update({r2_path:d}).eq("name",n).eq("app_id",r);p&&(m.error(`Cannot finish TUS upload ${Q(p)}`),Promise.reject(new Error("Cannot finish TUS upload")))}else{let d=await oj(e,r,n);d||(m.error("Cannot get upload url"),Promise.reject(new Error("Cannot get upload url"))),await Hr.put(d,{timeout:s.timeout||Z6,retry:5,body:o})}}catch(h){let p=((performance.now()-u)/1e3).toFixed(2);if(a.stop(`Failed to upload bundle ( after ${p} seconds)`),h instanceof ti){let v=await h.response.json();m.error(`Response Error: ${v.error||v.status||v.message}`)}else m.error(`Cannot upload bundle ( try again with --tus option) ${Q(h)}`);await cj(e,r,n),A.error("")}let f=((performance.now()-u)/1e3).toFixed(2);a.stop(`Bundle uploaded \u{1F4AA} in (${f} seconds)`),await Fe(t,{channel:"performance",event:c?"TUS upload zip performance":"Upload zip performance",icon:"\u{1F684}",user_id:i,tags:{"app-id":r,time:f},notify:!1})}async function Due(t,e,r,n,i,o,s,a,u){let{data:c}=await t.rpc("get_app_versions",{apikey:e,name_version:n,appid:a}).single();c||(m.warn("Cannot get version id, cannot set channel"),A.error(""));let{error:l,data:f}=await Ph(t,{name:i,app_id:a,created_by:o,version:c,owner_org:s});l&&(m.error(`Cannot set channel, the upload key is not allowed to do that, use the "all" for this. ${Q(l)}`),A.error(""));let h=wo(a),d=`${u.hostWeb}/app/p/${h}/channel/${f.id}`;f?.public?m.info("Your update is now available in your public channel \u{1F389}"):f?.id&&m.info(`Link device to this bundle to try it: ${d}`),r?m.info(`Bundle url: ${d}`):c||(m.warn("Cannot set bundle with upload key, use key with more rights for that"),A.error(""))}async function vue(t,e,r){let{error:n,data:i}=await e.from("apps").select("default_upload_channel").single();if(n){m.warn("Cannot find default upload channel");let o=wo(t);return m.info(`You can set it here: ${r}/app/p/${o}/settings`),null}return i.default_upload_channel}async function mp(t,e,r=!0){Y(`Uploading with CLI version ${Ir.version}`);let n=Nt();await De();let{s3Region:i,s3Apikey:o,s3Apisecret:s,s3BucketName:a,s3Endpoint:u,s3Port:c,s3SSL:l}=e,f=lue(e),h=await ee(),d=await Q6(),{appid:p,path:v}=fue(t,e,h.config),g=await cue(h.config,e);e.autoSetBundle&&await bo({version:g}),due(e,v),m.info(`Upload ${p}@${g} started from path "${v}" to Capgo cloud`);let w=await Cr(),x=await de(f),D=await me(x,f,["write","all","upload"]),C=e.channel||await vue(p,x,w.hostWeb)||"dev",k=await Sr(x,p);await pa(x,k,f,p,!0),await pue(x,k,w);let{nativePackages:$,minUpdateVersion:F}=await hue(x,n,e,C,p,g);await mue(x,p,g),e.external&&!e.external.startsWith("https://")&&(m.error(`External link should should start with "https://" current is "${e.external}"`),A.error(""));let L={name:g,app_id:p,session_key:void 0,external_url:e.external,storage_provider:e.external?"external":"r2-direct",min_update_version:F,native_packages:$,owner_org:k,user_id:D,checksum:void 0},S=null;if(e.external)await Fe(f,{channel:"app",event:"App external",icon:"\u{1F4E4}",user_id:k,tags:{"app-id":p},notify:!1}),L.session_key=e.ivSessionKey,L.checksum=e.encryptedChecksum;else{let{zipped:q,sessionKey:K,checksum:M}=await gue(v,e,w,f,k,p);L.session_key=K,L.checksum=M,S=q,e.ignoreChecksumCheck||await fj(x,p,C,M)}!d.TUSUpload||e.external?e.tus=!1:e.tus=e.tus||d.TUSUploadForced,!d.partialUpload||e.external?e.partial=!1:e.partial=e.partial||d.partialUploadForced;let I=e.partial?await eL(v,f,k,p):[],{error:R}=await sb(x,L);if(R&&(m.error(`Cannot add bundle ${Q(R)}`),A.error("")),S&&(a||u||i||o||s||c||l)){(!a||!u||!i||!o||!s||!c)&&(m.error("Missing argument, for S3 upload you need to provide a bucket name, endpoint, region, port, API key, and API secret"),A.error("")),m.info("Uploading to S3");let q=new Yc({endPoint:u,region:i,port:c,useSSL:l,bucket:a,accessKey:o,secretKey:s}),K=`${p}-${g}`,M=encodeURIComponent(K);await q.putObject(K,Uint8Array.from(S)),L.external_url=`https://${u}/${M}`,L.storage_provider="external"}else if(S){await yue(f,x,p,g,k,S,e);let q=null;try{e.dryUpload&&(e.partial=!1),q=e.partial?await tL(f,I,v,p,g,k):null}catch(M){m.info(`Failed to upload partial files to capgo cloud. Error: ${Q(M)}. This is not a critical error, the bundle has been uploaded without the partial files`)}L.storage_provider="r2",L.manifest=q;let{error:K}=await sb(x,L);K&&(m.error(`Cannot update bundle ${Q(K)}`),A.error(""))}let B=await Be(x,f,p,2);return ej(B,3)?await Due(x,f,!!e.bundleUrl,g,C,D,k,p,w):m.warn("Cannot set channel as a upload organization member"),await Fe(f,{channel:"app",event:"App Uploaded",icon:"\u23EB",user_id:k,tags:{"app-id":p},notify:!1}),r&&(X("Time to share your update to the world \u{1F30D}"),(0,nL.exit)()),!0}function iL(t){t.ivSessionKey&&!t.external&&(m.error("You need to provide an external url if you want to use the --iv-session-key option"),A.error("")),t.encryptedChecksum&&!t.external&&(m.error("You need to provide an external url if you want to use the --encrypted-checksum option"),A.error("")),t.partial&&t.external&&(m.error("You cannot use the --partial option with an external url"),A.error("")),t.tus&&t.external&&(m.error("You cannot use the --tus option with an external url"),A.error("")),t.dryUpload&&t.external&&(m.error("You cannot use the --dry-upload option with an external url"),A.error("")),t.multipart&&t.external&&(m.error("You cannot use the --multipart option with an external url"),A.error("")),t.external&&(t.key||t.keyData||t.keyV2||t.keyDataV2)&&(m.error("You cannot set a key if you are uploading to an external url"),A.error("")),(t.key||t.keyData)&&(t.keyV2||t.keyDataV2)&&(m.error("You cannot set both key and key-v2"),A.error("")),t.key&&t.keyData&&(m.error("You cannot set both key and key-data"),A.error("")),t.keyV2&&t.keyDataV2&&(m.error("You cannot set both key-v2 and key-data-v2"),A.error("")),t.external&&(t.s3Region||t.s3Apikey||t.s3Apisecret||t.s3Endpoint||t.s3BucketName||t.s3Port||t.s3SSL)&&(m.error("You cannot set S3 options if you are uploading to an external url, it's automatically handled"),A.error("")),t.encryptedChecksum&&!t.external&&(m.error("You cannot set the --encrypted-checksum option if you are not uploading to an external url"),A.error("")),t.minUpdateVersion&&t.autoMinUpdateVersion&&(m.error("You cannot set both min-update-version and auto-min-update-version, use only one of them"),A.error(""))}async function oL(t,e){try{iL(e),await mp(t,e,!0)}catch(r){m.error(Q(r)),A.error("")}}async function sL(t,e){let r=Nt();m.warn(`\u26A0\uFE0F This command is deprecated, use "${r.runner} @capgo/cli bundle upload" instead \u26A0\uFE0F`);try{iL(e),await mp(t,e,!0)}catch(n){m.error(Q(n)),A.error("")}}var aL=require("node:crypto"),gp=require("node:fs"),uL=require("node:process");var Wb=ce(bu());var bue=20;async function cL(t,e){try{let{bundle:r,path:n}=e,{json:i}=e;i||await De();let o=await ee();t=ge(t,o?.config);let s=(0,aL.randomUUID)().split("-")[0],a=await jt("",e.packageJson);r=r||a?.version||`0.0.1-beta.${s}`,i||Y(`Zipping ${t}@${r}`),r&&!ha.test(r)&&(i?console.error(Q({error:"invalid_semver"})):m.error(`Your bundle name ${r}, is not valid it should follow semver convention : https://semver.org/`),A.error("")),n=n||o?.config?.webDir,(!t||!r||!n)&&(i?console.error(Q({error:"missing_argument"})):m.error("Missing argument, you need to provide a appId and a bundle and a path, or be in a capacitor project"),A.error("")),i||m.info(`Started from path "${n}"`);let u=e.codeCheck;(typeof u>"u"||u)&&(Jc(n,"notifyAppReady")||(i?console.error(Q({error:"notifyAppReady_not_in_source_code"})):m.error("notifyAppReady() is missing in the source code. see: https://capgo.app/docs/plugin/api/#notifyappready"),A.error("")),pp(n)||(i?console.error(Q({error:"index_html_not_found"})):m.error(`index.html is missing in the root folder of ${n}`),A.error("")));let c=await Th(n);i||m.info(`Zipped ${c.byteLength} bytes`);let l=be();i||l.start("Calculating checksum");let f="";e.keyV2||(0,gp.existsSync)(ur)?f=await(0,Wb.checksum)(c,"sha256"):f=await(0,Wb.checksum)(c,"crc32"),i||l.stop(`Checksum: ${f}`);let h=Math.floor(c.byteLength/1024/1024);h>bue&&!i&&(m.warn(`WARNING !!
297
297
  The app size is ${h} Mb, this may take a while to download for users
298
298
  `),m.warn(`Learn how to optimize your assets https://capgo.app/blog/optimise-your-images-for-updates/
299
299
  `));let d=be(),p=e.name||`${t}_${r}.zip`;i||d.start(`Saving to ${p}`),(0,gp.writeFileSync)(p,c),i||d.stop(`Saved to ${p}`),i||X("Done \u2705"),i&&console.log(JSON.stringify({bundle:r,filename:p,checksum:f},null,2)),(0,uL.exit)()}catch(r){m.error(Q(r)),A.error("")}}var lL=require("node:process");async function Kb(t,e,r,n=!0){Y("Create channel"),r.apikey=r.apikey||pe();let i=await ee();e=ge(e,i?.config),r.apikey||(m.error("Missing API key, you need to provide a API key to upload your bundle"),A.error("")),e||(m.error("Missing argument, you need to provide a appId, or be in a capacitor project"),A.error(""));let o=await de(r.apikey);await me(o,r.apikey,["write","all"]),await Be(o,r.apikey,e,4),m.info(`Creating channel ${e}#${t} to Capgo`);try{let s=await Nb(o,e),a=await Sr(o,e);s||(m.error("Cannot find default version for channel creation, please contact Capgo support \u{1F928}"),A.error(""));let u=await lN(o,{name:t,app_id:e,version:s.id,owner_org:a});u.error&&(m.error(`Cannot create Channel \u{1F640}
300
- ${Q(u.error)}`),A.error("")),m.success("Channel created \u2705"),await Fe(r.apikey,{channel:"channel",event:"Create channel",icon:"\u2705",user_id:a,tags:{"app-id":e,channel:t},notify:!1}).catch()}catch{return m.error("Cannot create Channel \u{1F640}"),!1}return n&&(X("Done \u2705"),(0,lL.exit)()),!0}async function fL(t,e,r){Kb(t,e,r,!0)}var dL=require("node:process");async function hL(t,e,r){let{quiet:n}=r;n||Y("List current bundle"),r.apikey=r.apikey||pe(n);let i=await ee();e=ge(e,i?.config),r.apikey||(m.error("Missing API key, you need to provide a API key to upload your bundle"),A.error("")),e||(m.error("Missing argument, you need to provide a appId, or be in a capacitor project"),A.error(""));let o=await de(r.apikey),s=await me(o,r.apikey,["write","all","read"]);await Be(o,r.apikey,e,1),t||(m.error("Please provide a channel to get the bundle from."),A.error(""));let{data:a,error:u}=await o.from("channels").select("version ( name )").eq("name",t).eq("app_id",e).limit(1);(u||a.length===0)&&(m.error(`Error retrieving channel ${t} for app ${e}. Perhaps the channel does not exists?`),A.error(""));let{version:c}=a[0];c||(m.error(`Error retrieving channel ${t} for app ${e}. Perhaps the channel does not exists?`),A.error("")),n?m.info(c.name):m.info(`Current bundle for channel ${t} is ${c.name}`),(0,dL.exit)()}var pL=require("node:process");async function mL(t,e,r){Y("Delete channel"),r.apikey=r.apikey||pe();let n=await ee();e=ge(e,n?.config),r.apikey||(m.error("Missing API key, you need to provide a API key to upload your bundle"),A.error("")),e||(m.error("Missing argument, you need to provide a appId, or be in a capacitor project"),A.error(""));let i=await de(r.apikey),o=await me(i,r.apikey,["write","all"]);await Be(i,r.apikey,e,4),m.info(`Deleting channel ${e}#${t} from Capgo`);try{let s=await fN(i,t,e,o);s.error&&(m.error(`Cannot delete Channel \u{1F640} ${Q(s.error)}`),A.error(""));let a=await Sr(i,e);m.success("Channel deleted"),await Fe(r.apikey,{channel:"channel",event:"Delete channel",icon:"\u2705",user_id:a,tags:{"user-id":o,"app-id":e,channel:t},notify:!1}).catch()}catch{m.error("Cannot delete Channel \u{1F640}")}X("Done \u2705"),(0,pL.exit)()}var gL=require("node:process");async function yL(t,e){Y("List channels"),e.apikey=e.apikey||pe();let r=await ee();t=ge(t,r?.config),e.apikey||m.error("Missing API key, you need to provide a API key to upload your bundle"),t||(m.error("Missing argument, you need to provide a appId, or be in a capacitor project"),A.error(""));let n=await de(e.apikey),i=await me(n,e.apikey,["write","all","read","upload"]);await Be(n,e.apikey,t,1),m.info("Querying available channels in Capgo");let o=await hN(n,t);m.info(`Active channels in Capgo: ${o?.length}`),dN(o),await Fe(e.apikey,{channel:"channel",event:"List channel",icon:"\u2705",user_id:i,tags:{"app-id":t},notify:!1}).catch(),X("Done \u2705"),(0,gL.exit)()}var vL=require("node:process");var DL=["major","minor","metadata","patch","none"];async function bL(t,e,r){Y("Set channel"),r.apikey=r.apikey||pe();let n=await ee();e=ge(e,n?.config),r.apikey||(m.error("Missing API key, you need to provide a API key to upload your bundle"),A.error("")),e||(m.error("Missing argument, you need to provide a appId, or be in a capacitor project"),A.error(""));let i=await de(r.apikey),o=await me(i,r.apikey,["write","all"]);await Be(i,r.apikey,e,4);let s=await Sr(i,e),{bundle:a,state:u,downgrade:c,latest:l,upgrade:f,ios:h,android:d,selfAssign:p,disableAutoUpdate:v,dev:g,emulator:w}=r;t||(m.error("Missing argument, you need to provide a channel"),A.error("")),l&&a&&(m.error("Cannot set latest and bundle at the same time"),A.error("")),a==null&&u==null&&l==null&&c==null&&f==null&&h==null&&d==null&&p==null&&g==null&&w==null&&v==null&&(m.error("Missing argument, you need to provide a option to set"),A.error(""));try{await pa(i,s,r.apikey,e);let x={created_by:o,app_id:e,name:t,owner_org:s,version:void 0},D=await jt("",r.packageJson),C=l?n?.config?.plugins?.CapacitorUpdater?.version||D?.version:a;if(C!=null){let{data:k,error:$}=await i.from("app_versions").select().eq("app_id",e).eq("name",C).eq("user_id",o).eq("deleted",!1).single();($||!k)&&(m.error(`Cannot find version ${C}`),A.error("")),m.info(`Set ${e} channel: ${t} to @${C}`),x.version=k.id}if(u!=null&&((u==="public"||u==="private")&&m.info(`Set ${e} channel: ${t} to public or private is deprecated, use default or normal instead`),m.info(`Set ${e} channel: ${t} to ${u==="public"||u==="default"?"default":"normal"}`),x.public=u==="public"||u==="default"),c!=null&&(m.info(`Set ${e} channel: ${t} to ${c?"allow":"disallow"} downgrade`),x.disable_auto_update_under_native=!c),h!=null&&(m.info(`Set ${e} channel: ${t} to ${h?"allow":"disallow"} ios update`),x.ios=!!h),d!=null&&(m.info(`Set ${e} channel: ${t} to ${d?"allow":"disallow"} android update`),x.android=!!d),p!=null&&(m.info(`Set ${e} channel: ${t} to ${p?"allow":"disallow"} self assign to this channel`),x.allow_device_self_set=!!p),v!=null){let k=v.toLocaleLowerCase();DL.includes(k)||(m.error(`Channel strategy ${k} is not known. The possible values are: ${DL.join(", ")}.`),A.error("")),k==="metadata"&&(k="version_number"),x.disable_auto_update=k,m.info(`Set ${e} channel: ${t} to ${k} disable update strategy to this channel`)}try{let{error:k}=await $h(i,x);k&&(m.error('Cannot set channel the upload key is not allowed to do that, use the "all" for this.'),A.error(""))}catch{m.error('Cannot set channel the upload key is not allowed to do that, use the "all" for this.'),A.error("")}await Fe(r.apikey,{channel:"channel",event:"Set channel",icon:"\u2705",user_id:s,tags:{"app-id":e},notify:!1}).catch()}catch(x){m.error(`Unknow error ${Q(x)}`),A.error("")}X("Done \u2705"),(0,vL.exit)()}var el=require("node:child_process"),st=require("node:fs"),vp=require("node:path"),rr=require("node:process");var bp=ce(jL());var rw=require("node:process");function Nue(t){return new Promise(e=>{setTimeout(e,t)})}async function Hn(t,e,r,n,i="\u2705"){await Fe(r,{channel:t,event:n,icon:i,user_id:e,notify:!1})}async function Lue(t,e,r,n){kt(e)&&(await Hn(t,r,n,"canceled","\u{1F937}"),(0,rw.exit)())}async function Bue(t,e,r){try{let n=await Cr(),i=await Hr.post(`${n.hostApi}/private/stats`,{headers:{"Content-Type":"application/json",capgkey:t},body:JSON.stringify(e)}).then(o=>o.json()).catch(o=>(console.error("Cannot get devices",o),[]));if(i?.length>0&&(r===null||r!==i[0].created_at))return i}catch(n){m.error(`Cannot get stats ${Q(n)}`)}return[]}async function que(t,e,r,n,i,o){if(m.info(`Log from Device: ${t.device_id}`),t.action==="get")m.info("Update Sent your your device, wait until event download complete"),await Hn(e,r,n,"done");else if(t.action.startsWith("download_")){let s=t.action.split("_")[1];s==="complete"?(m.info("Your bundle has been downloaded on your device, background the app now and open it again to see the update"),await Hn(e,r,n,"downloaded")):s==="fail"?(m.error("Your bundle has failed to download on your device."),m.error("Please check if you have network connection and try again")):m.info(`Your bundle is downloading ${s}% ...`)}else{if(t.action==="set")return m.info("Your bundle has been set on your device \u2764\uFE0F"),await Hn(e,r,n,"set"),!1;t.action==="NoChannelOrOverride"?m.error(`No default channel or override (channel/device) found, please create it here ${i}`):t.action==="needPlanUpgrade"?m.error(`Your are out of quota, please upgrade your plan here ${o}/dashboard/settings/plans`):t.action==="missingBundle"?m.error("Your bundle is missing, please check how you build your app"):t.action==="noNew"?(m.error(`The version number you uploaded to your default channel in Capgo, is the same as the present in the device ${t.device_id}.`),m.error(`To fix it, ensure the variable:
300
+ ${Q(u.error)}`),A.error("")),m.success("Channel created \u2705"),await Fe(r.apikey,{channel:"channel",event:"Create channel",icon:"\u2705",user_id:a,tags:{"app-id":e,channel:t},notify:!1}).catch()}catch{return m.error("Cannot create Channel \u{1F640}"),!1}return n&&(X("Done \u2705"),(0,lL.exit)()),!0}async function fL(t,e,r){Kb(t,e,r,!0)}var dL=require("node:process");async function hL(t,e,r){let{quiet:n}=r;n||Y("List current bundle"),r.apikey=r.apikey||pe(n);let i=await ee();e=ge(e,i?.config),r.apikey||(m.error("Missing API key, you need to provide a API key to upload your bundle"),A.error("")),e||(m.error("Missing argument, you need to provide a appId, or be in a capacitor project"),A.error(""));let o=await de(r.apikey),s=await me(o,r.apikey,["write","all","read"]);await Be(o,r.apikey,e,1),t||(m.error("Please provide a channel to get the bundle from."),A.error(""));let{data:a,error:u}=await o.from("channels").select("version ( name )").eq("name",t).eq("app_id",e).limit(1);(u||a.length===0)&&(m.error(`Error retrieving channel ${t} for app ${e}. Perhaps the channel does not exists?`),A.error(""));let{version:c}=a[0];c||(m.error(`Error retrieving channel ${t} for app ${e}. Perhaps the channel does not exists?`),A.error("")),n?m.info(c.name):m.info(`Current bundle for channel ${t} is ${c.name}`),(0,dL.exit)()}var pL=require("node:process");async function mL(t,e,r){Y("Delete channel"),r.apikey=r.apikey||pe();let n=await ee();e=ge(e,n?.config),r.apikey||(m.error("Missing API key, you need to provide a API key to upload your bundle"),A.error("")),e||(m.error("Missing argument, you need to provide a appId, or be in a capacitor project"),A.error(""));let i=await de(r.apikey),o=await me(i,r.apikey,["write","all"]);await Be(i,r.apikey,e,4),m.info(`Deleting channel ${e}#${t} from Capgo`);try{let s=await fN(i,t,e,o);s.error&&(m.error(`Cannot delete Channel \u{1F640} ${Q(s.error)}`),A.error(""));let a=await Sr(i,e);m.success("Channel deleted"),await Fe(r.apikey,{channel:"channel",event:"Delete channel",icon:"\u2705",user_id:a,tags:{"user-id":o,"app-id":e,channel:t},notify:!1}).catch()}catch{m.error("Cannot delete Channel \u{1F640}")}X("Done \u2705"),(0,pL.exit)()}var gL=require("node:process");async function yL(t,e){Y("List channels"),e.apikey=e.apikey||pe();let r=await ee();t=ge(t,r?.config),e.apikey||m.error("Missing API key, you need to provide a API key to upload your bundle"),t||(m.error("Missing argument, you need to provide a appId, or be in a capacitor project"),A.error(""));let n=await de(e.apikey),i=await me(n,e.apikey,["write","all","read","upload"]);await Be(n,e.apikey,t,1),m.info("Querying available channels in Capgo");let o=await hN(n,t);m.info(`Active channels in Capgo: ${o?.length}`),dN(o),await Fe(e.apikey,{channel:"channel",event:"List channel",icon:"\u2705",user_id:i,tags:{"app-id":t},notify:!1}).catch(),X("Done \u2705"),(0,gL.exit)()}var vL=require("node:process");var DL=["major","minor","metadata","patch","none"];async function bL(t,e,r){Y("Set channel"),r.apikey=r.apikey||pe();let n=await ee();e=ge(e,n?.config),r.apikey||(m.error("Missing API key, you need to provide a API key to upload your bundle"),A.error("")),e||(m.error("Missing argument, you need to provide a appId, or be in a capacitor project"),A.error(""));let i=await de(r.apikey),o=await me(i,r.apikey,["write","all"]);await Be(i,r.apikey,e,4);let s=await Sr(i,e),{bundle:a,state:u,downgrade:c,latest:l,upgrade:f,ios:h,android:d,selfAssign:p,disableAutoUpdate:v,dev:g,emulator:w}=r;t||(m.error("Missing argument, you need to provide a channel"),A.error("")),l&&a&&(m.error("Cannot set latest and bundle at the same time"),A.error("")),a==null&&u==null&&l==null&&c==null&&f==null&&h==null&&d==null&&p==null&&g==null&&w==null&&v==null&&(m.error("Missing argument, you need to provide a option to set"),A.error(""));try{await pa(i,s,r.apikey,e);let x={created_by:o,app_id:e,name:t,owner_org:s,version:void 0},D=await jt("",r.packageJson),C=l?n?.config?.plugins?.CapacitorUpdater?.version||D?.version:a;if(C!=null){let{data:k,error:$}=await i.from("app_versions").select().eq("app_id",e).eq("name",C).eq("user_id",o).eq("deleted",!1).single();($||!k)&&(m.error(`Cannot find version ${C}`),A.error("")),m.info(`Set ${e} channel: ${t} to @${C}`),x.version=k.id}if(u!=null&&((u==="public"||u==="private")&&m.info(`Set ${e} channel: ${t} to public or private is deprecated, use default or normal instead`),m.info(`Set ${e} channel: ${t} to ${u==="public"||u==="default"?"default":"normal"}`),x.public=u==="public"||u==="default"),c!=null&&(m.info(`Set ${e} channel: ${t} to ${c?"allow":"disallow"} downgrade`),x.disable_auto_update_under_native=!c),h!=null&&(m.info(`Set ${e} channel: ${t} to ${h?"allow":"disallow"} ios update`),x.ios=!!h),d!=null&&(m.info(`Set ${e} channel: ${t} to ${d?"allow":"disallow"} android update`),x.android=!!d),p!=null&&(m.info(`Set ${e} channel: ${t} to ${p?"allow":"disallow"} self assign to this channel`),x.allow_device_self_set=!!p),v!=null){let k=v.toLocaleLowerCase();DL.includes(k)||(m.error(`Channel strategy ${k} is not known. The possible values are: ${DL.join(", ")}.`),A.error("")),k==="metadata"&&(k="version_number"),x.disable_auto_update=k,m.info(`Set ${e} channel: ${t} to ${k} disable update strategy to this channel`)}try{let{error:k}=await Ph(i,x);k&&(m.error('Cannot set channel the upload key is not allowed to do that, use the "all" for this.'),A.error(""))}catch{m.error('Cannot set channel the upload key is not allowed to do that, use the "all" for this.'),A.error("")}await Fe(r.apikey,{channel:"channel",event:"Set channel",icon:"\u2705",user_id:s,tags:{"app-id":e},notify:!1}).catch()}catch(x){m.error(`Unknow error ${Q(x)}`),A.error("")}X("Done \u2705"),(0,vL.exit)()}var Zc=require("node:child_process"),st=require("node:fs"),vp=require("node:path"),rr=require("node:process");var bp=ce(jL());var rw=require("node:process");function Nue(t){return new Promise(e=>{setTimeout(e,t)})}async function Hn(t,e,r,n,i="\u2705"){await Fe(r,{channel:t,event:n,icon:i,user_id:e,notify:!1})}async function Lue(t,e,r,n){kt(e)&&(await Hn(t,r,n,"canceled","\u{1F937}"),(0,rw.exit)())}async function Bue(t,e,r){try{let n=await Cr(),i=await Hr.post(`${n.hostApi}/private/stats`,{headers:{"Content-Type":"application/json",capgkey:t},body:JSON.stringify(e)}).then(o=>o.json()).catch(o=>(console.error("Cannot get devices",o),[]));if(i?.length>0&&(r===null||r!==i[0].created_at))return i}catch(n){m.error(`Cannot get stats ${Q(n)}`)}return[]}async function que(t,e,r,n,i,o){if(m.info(`Log from Device: ${t.device_id}`),t.action==="get")m.info("Update Sent your your device, wait until event download complete"),await Hn(e,r,n,"done");else if(t.action.startsWith("download_")){let s=t.action.split("_")[1];s==="complete"?(m.info("Your bundle has been downloaded on your device, background the app now and open it again to see the update"),await Hn(e,r,n,"downloaded")):s==="fail"?(m.error("Your bundle has failed to download on your device."),m.error("Please check if you have network connection and try again")):m.info(`Your bundle is downloading ${s}% ...`)}else{if(t.action==="set")return m.info("Your bundle has been set on your device \u2764\uFE0F"),await Hn(e,r,n,"set"),!1;t.action==="NoChannelOrOverride"?m.error(`No default channel or override (channel/device) found, please create it here ${i}`):t.action==="needPlanUpgrade"?m.error(`Your are out of quota, please upgrade your plan here ${o}/dashboard/settings/plans`):t.action==="missingBundle"?m.error("Your bundle is missing, please check how you build your app"):t.action==="noNew"?(m.error(`The version number you uploaded to your default channel in Capgo, is the same as the present in the device ${t.device_id}.`),m.error(`To fix it, ensure the variable:
301
301
  - iOS: keyCFBundleShortVersionString or MARKETING_VERSION
302
302
  - Android: versionName
303
303
  Are lower than the version number you uploaded to Capgo.`),m.error("More info here: https://capgo.app/blog/how-version-work-in-capgo/#versioning-system")):t.action==="disablePlatformIos"?m.error(`iOS is disabled in the default channel and your device ${t.device_id} is an iOS device ${i}`):t.action==="disablePlatformAndroid"?m.error(`Android is disabled in the default channel and your device ${t.device_id} is an Android device ${i}`):t.action==="disableAutoUpdateToMajor"?(m.error(`The version number you uploaded to your default channel in Capgo, is a major version higher (ex: 1.0.0 in device to 2.0.0 in Capgo) than the present in the device ${t.device_id}.`),m.error("Capgo is set by default to protect you from this, and avoid sending breaking changes incompatible with the native code present in the device."),m.error(`To fix it, ensure the variable:
@@ -306,13 +306,13 @@ ${Q(u.error)}`),A.error("")),m.success("Channel created \u2705"),await Fe(r.apik
306
306
  Are lower than the version number you uploaded to Capgo.`),m.error("More info here: https://capgo.app/blog/how-version-work-in-capgo/#versioning-system")):t.action==="disableAutoUpdateUnderNative"?(m.error(`The version number you uploaded to your default channel in Capgo, is lower than the present in the device ${t.device_id}.`),m.error(`To fix it, ensure the variable:
307
307
  - iOS: keyCFBundleShortVersionString or MARKETING_VERSION
308
308
  - Android: versionName
309
- Are lower than the version number you uploaded to Capgo.`),m.error("More info here: https://capgo.app/blog/how-version-work-in-capgo/#versioning-system")):t.action==="disableDevBuild"?(m.error(`Dev build is disabled in the default channel. ${i}`),m.error("Set your channel to allow it if you wanna test your app")):t.action==="disableEmulator"?(m.error(`Emulator is disabled in the default channel. ${i}`),m.error("Set your channel to allow it if you wanna test your app")):t.action==="cannotGetBundle"?(m.error(`We cannot get your bundle from the default channel. ${i}`),m.error("Are you sure your default channel has a bundle set?")):t.action==="set_fail"?m.error(`Your bundle seems to be corrupted, try to download from ${i} to identify the issue`):t.action==="reset"?m.error("Your device has been reset to the builtin bundle, did notifyAppReady() is present in the code builded and uploaded to Capgo ?"):t.action==="update_fail"?(m.error("Your bundle has been installed but failed to call notifyAppReady()"),m.error("Please check if you have network connection and try again")):t.action==="checksum_fail"?m.error("Your bundle has failed to validate checksum, please check your code and send it again to Capgo"):m.error(`Log from Capgo ${t.action}`)}return!0}async function nw(t,e,r,n,i){let o=!0,s=_o(r),a=await Cr(),u=`${a.hostWeb}/app/p/${s}`;await Hn(t,n,e,"Use waitlog");let c={appId:r,devicesId:i?[i]:void 0,order:[{key:"created_at",sortable:"desc"}],rangeStart:new Date().toISOString()},l=null,f=be();for(f.start("Waiting for logs (Expect delay of 30 sec)");o;){await Nue(5e3);let h=await Bue(e,c,l);if(h.length>0){l=h[0].created_at;for(let d of h)if(o=await que(d,t,n,e,u,a.hostWeb),!o)break}}return f.stop("Stop watching logs"),Promise.resolve()}async function NL(t,e){Y("Debug Live update in Capgo"),await De(),e.apikey=e.apikey||pe();let r=await ee();t=ge(t,r?.config);let n=e.device;e.apikey||(m.error("Missing API key, you need to provide an API key to delete your app"),A.error("")),t||(m.error("Missing argument, you need to provide a appId, or be in a capacitor project"),A.error(""));let i=await de(e.apikey),o=await Sr(i,t),s=await Pe({message:"Automatic check if update working in device ?"});await Lue("debug",s,o,e.apikey),s?(m.info(`Wait logs sent to Capgo from ${t} device, Please open your app \u{1F4AA}`),await nw("debug",e.apikey,t,o,n),X("Done \u2705")):X("Canceled \u274C"),X("Done \u2705"),(0,rw.exit)()}var Bt=require("node:fs");async function Mue(t,e=!0){e&&Y("Save keys \u{1F511}");let r=await ee(),n=t.key||jn,i=t.keyData||"";if(!(0,Bt.existsSync)(n)&&!i)if(m)m.error(`Cannot find a public key at ${n} or as keyData option or in ${r.path}`),A.error("");else return!1;else(0,Bt.existsSync)(n)&&(i=(0,Bt.readFileSync)(n).toString());if(i&&!i.startsWith("-----BEGIN RSA PUBLIC KEY-----"))if(m)m.error("the public key provided is not a valid RSA Public key"),A.error("");else return!1;return r?.config&&(r.config.plugins||(r.config.plugins={extConfig:{},CapacitorUpdater:{}}),r.config.plugins.CapacitorUpdater||(r.config.plugins.CapacitorUpdater={}),r.config.plugins.CapacitorUpdater.privateKey&&(delete r.config.plugins.CapacitorUpdater.privateKey,m.info("Old private key deleted from config file"),await Pe({message:"Do you want to setup encryption with the new channel in order to support old apps and facilitate the migration?"})&&(r.config.plugins.CapacitorUpdater.defaultChannel="encryption_v2")),r.config.plugins.CapacitorUpdater.publicKey=i,await on(r)),e&&(m.success(`public key saved into ${r.path} file in local directory`),m.success("your app will decode the zip archive with this key")),!0}async function Uue(t,e=!0){e&&Y("Deleting old private key \u{1F5D1}\uFE0F");let r=await ee();if(r?.config?.plugins?.CapacitorUpdater?.privateKey){if(delete r.config.plugins.CapacitorUpdater.privateKey,await on(r),(0,Bt.existsSync)(er))try{(0,Bt.unlinkSync)(er),e&&m.success(`Old private key file deleted: ${er}`)}catch{e&&m.error(`Failed to delete old private key file: ${er}`)}if((0,Bt.existsSync)(cr))try{(0,Bt.unlinkSync)(cr),e&&m.success(`Old public key file deleted: ${cr}`)}catch{e&&m.error(`Failed to delete old public key file: ${jn}`)}return e&&m.success(`Old private key deleted from ${r.path} file`),!0}else return e&&m.info("No old private key found in config file"),!1}async function LL(t){Y("Save keys \u{1F511}"),await De(),await Mue(t)}async function iw(t,e=!0){e&&Y("Create keys \u{1F511}");let{publicKey:r,privateKey:n}=np();if((0,Bt.existsSync)(jn)&&!t.force)if(m.error("Public Key already exists, use --force to overwrite"),e)A.error("");else return!1;if((0,Bt.writeFileSync)(jn,r),(0,Bt.existsSync)(ur)&&!t.force)if(m.error("Private Key already exists, use --force to overwrite"),e)A.error("");else return!1;(0,Bt.writeFileSync)(ur,n);let i=await ee();return i&&(i.config.plugins||(i.config.plugins={extConfig:{},CapacitorUpdater:{}}),i.config.plugins.CapacitorUpdater||(i.config.plugins.CapacitorUpdater={}),i.config.plugins.CapacitorUpdater.privateKey&&(delete i.config.plugins.CapacitorUpdater.privateKey,m.info("Old private key deleted from config file"),await Pe({message:"Do you want to setup encryption with the new channel in order to support old apps and facilitate the migration?"})&&(i.config.plugins.CapacitorUpdater.defaultChannel="encryption_v2")),i.config.plugins.CapacitorUpdater.publicKey=r,on(i)),m&&(m.success("Your RSA key has been generated"),m.success(`Private key saved in ${ur}`),m.success("This key will be use to encrypt your bundle before sending it to Capgo"),m.success("Keep it safe"),m.success("Than make it unreadable by Capgo and unmodifiable by anyone"),m.success(`Public key saved in ${i.path}`),m.success("Your app will be the only one having it"),m.success("Only your users can decrypt your update"),m.success("Only you can send them an update"),X("Done \u2705")),!0}async function BL(t){await De(),await iw(t)}async function qL(t){await De(),await Uue(t)}var zn=require("node:fs"),sw=require("node:os"),ow=require("node:process");async function ML(){let t=(0,sw.homedir)();return(0,zn.existsSync)(`${t}/.capgo`)||(0,zn.existsSync)(".capgo")}async function aw(t,e,r=!0){if(r&&Y("Login to Capgo"),!t)return r&&(m.error("Missing API key, you need to provide a API key to upload your bundle"),A.error("")),!1;await De();try{let{local:n}=e;if(n)(0,zn.existsSync)(".git")||(m.error("To use local you should be in a git repository"),A.error("")),(0,zn.writeFileSync)(".capgo",`${t}
309
+ Are lower than the version number you uploaded to Capgo.`),m.error("More info here: https://capgo.app/blog/how-version-work-in-capgo/#versioning-system")):t.action==="disableDevBuild"?(m.error(`Dev build is disabled in the default channel. ${i}`),m.error("Set your channel to allow it if you wanna test your app")):t.action==="disableEmulator"?(m.error(`Emulator is disabled in the default channel. ${i}`),m.error("Set your channel to allow it if you wanna test your app")):t.action==="cannotGetBundle"?(m.error(`We cannot get your bundle from the default channel. ${i}`),m.error("Are you sure your default channel has a bundle set?")):t.action==="set_fail"?m.error(`Your bundle seems to be corrupted, try to download from ${i} to identify the issue`):t.action==="reset"?m.error("Your device has been reset to the builtin bundle, did notifyAppReady() is present in the code builded and uploaded to Capgo ?"):t.action==="update_fail"?(m.error("Your bundle has been installed but failed to call notifyAppReady()"),m.error("Please check if you have network connection and try again")):t.action==="checksum_fail"?m.error("Your bundle has failed to validate checksum, please check your code and send it again to Capgo"):m.error(`Log from Capgo ${t.action}`)}return!0}async function nw(t,e,r,n,i){let o=!0,s=wo(r),a=await Cr(),u=`${a.hostWeb}/app/p/${s}`;await Hn(t,n,e,"Use waitlog");let c={appId:r,devicesId:i?[i]:void 0,order:[{key:"created_at",sortable:"desc"}],rangeStart:new Date().toISOString()},l=null,f=be();for(f.start("Waiting for logs (Expect delay of 30 sec)");o;){await Nue(5e3);let h=await Bue(e,c,l);if(h.length>0){l=h[0].created_at;for(let d of h)if(o=await que(d,t,n,e,u,a.hostWeb),!o)break}}return f.stop("Stop watching logs"),Promise.resolve()}async function NL(t,e){Y("Debug Live update in Capgo"),await De(),e.apikey=e.apikey||pe();let r=await ee();t=ge(t,r?.config);let n=e.device;e.apikey||(m.error("Missing API key, you need to provide an API key to delete your app"),A.error("")),t||(m.error("Missing argument, you need to provide a appId, or be in a capacitor project"),A.error(""));let i=await de(e.apikey),o=await Sr(i,t),s=await Pe({message:"Automatic check if update working in device ?"});await Lue("debug",s,o,e.apikey),s?(m.info(`Wait logs sent to Capgo from ${t} device, Please open your app \u{1F4AA}`),await nw("debug",e.apikey,t,o,n),X("Done \u2705")):X("Canceled \u274C"),X("Done \u2705"),(0,rw.exit)()}var Bt=require("node:fs");async function Mue(t,e=!0){e&&Y("Save keys \u{1F511}");let r=await ee(),n=t.key||jn,i=t.keyData||"";if(!(0,Bt.existsSync)(n)&&!i)if(m)m.error(`Cannot find a public key at ${n} or as keyData option or in ${r.path}`),A.error("");else return!1;else(0,Bt.existsSync)(n)&&(i=(0,Bt.readFileSync)(n).toString());if(i&&!i.startsWith("-----BEGIN RSA PUBLIC KEY-----"))if(m)m.error("the public key provided is not a valid RSA Public key"),A.error("");else return!1;return r?.config&&(r.config.plugins||(r.config.plugins={extConfig:{},CapacitorUpdater:{}}),r.config.plugins.CapacitorUpdater||(r.config.plugins.CapacitorUpdater={}),r.config.plugins.CapacitorUpdater.privateKey&&(delete r.config.plugins.CapacitorUpdater.privateKey,m.info("Old private key deleted from config file"),await Pe({message:"Do you want to setup encryption with the new channel in order to support old apps and facilitate the migration?"})&&(r.config.plugins.CapacitorUpdater.defaultChannel="encryption_v2")),r.config.plugins.CapacitorUpdater.publicKey=i,await on(r)),e&&(m.success(`public key saved into ${r.path} file in local directory`),m.success("your app will decode the zip archive with this key")),!0}async function Uue(t,e=!0){e&&Y("Deleting old private key \u{1F5D1}\uFE0F");let r=await ee();if(r?.config?.plugins?.CapacitorUpdater?.privateKey){if(delete r.config.plugins.CapacitorUpdater.privateKey,await on(r),(0,Bt.existsSync)(er))try{(0,Bt.unlinkSync)(er),e&&m.success(`Old private key file deleted: ${er}`)}catch{e&&m.error(`Failed to delete old private key file: ${er}`)}if((0,Bt.existsSync)(cr))try{(0,Bt.unlinkSync)(cr),e&&m.success(`Old public key file deleted: ${cr}`)}catch{e&&m.error(`Failed to delete old public key file: ${jn}`)}return e&&m.success(`Old private key deleted from ${r.path} file`),!0}else return e&&m.info("No old private key found in config file"),!1}async function LL(t){Y("Save keys \u{1F511}"),await De(),await Mue(t)}async function iw(t,e=!0){e&&Y("Create keys \u{1F511}");let{publicKey:r,privateKey:n}=tp();if((0,Bt.existsSync)(jn)&&!t.force)if(m.error("Public Key already exists, use --force to overwrite"),e)A.error("");else return!1;if((0,Bt.writeFileSync)(jn,r),(0,Bt.existsSync)(ur)&&!t.force)if(m.error("Private Key already exists, use --force to overwrite"),e)A.error("");else return!1;(0,Bt.writeFileSync)(ur,n);let i=await ee();return i&&(i.config.plugins||(i.config.plugins={extConfig:{},CapacitorUpdater:{}}),i.config.plugins.CapacitorUpdater||(i.config.plugins.CapacitorUpdater={}),i.config.plugins.CapacitorUpdater.privateKey&&(delete i.config.plugins.CapacitorUpdater.privateKey,m.info("Old private key deleted from config file"),await Pe({message:"Do you want to setup encryption with the new channel in order to support old apps and facilitate the migration?"})&&(i.config.plugins.CapacitorUpdater.defaultChannel="encryption_v2")),i.config.plugins.CapacitorUpdater.publicKey=r,on(i)),m&&(m.success("Your RSA key has been generated"),m.success(`Private key saved in ${ur}`),m.success("This key will be use to encrypt your bundle before sending it to Capgo"),m.success("Keep it safe"),m.success("Than make it unreadable by Capgo and unmodifiable by anyone"),m.success(`Public key saved in ${i.path}`),m.success("Your app will be the only one having it"),m.success("Only your users can decrypt your update"),m.success("Only you can send them an update"),X("Done \u2705")),!0}async function BL(t){await De(),await iw(t)}async function qL(t){await De(),await Uue(t)}var zn=require("node:fs"),sw=require("node:os"),ow=require("node:process");async function ML(){let t=(0,sw.homedir)();return(0,zn.existsSync)(`${t}/.capgo`)||(0,zn.existsSync)(".capgo")}async function aw(t,e,r=!0){if(r&&Y("Login to Capgo"),!t)return r&&(m.error("Missing API key, you need to provide a API key to upload your bundle"),A.error("")),!1;await De();try{let{local:n}=e;if(n)(0,zn.existsSync)(".git")||(m.error("To use local you should be in a git repository"),A.error("")),(0,zn.writeFileSync)(".capgo",`${t}
310
310
  `),(0,zn.appendFileSync)(".gitignore",`.capgo
311
311
  `);else{let s=(0,sw.homedir)();(0,zn.writeFileSync)(`${s}/.capgo`,`${t}
312
- `)}let i=await de(t),o=await me(i,t,["write","all","upload"]);await Fe(t,{channel:"user-login",event:"User CLI login",icon:"\u2705",user_id:o,notify:!1}).catch(),m.success(`login saved into .capgo file in ${n?"local":"home"} directory`)}catch{m.error("Error while saving login"),(0,ow.exit)(1)}return r&&(X("Done \u2705"),(0,ow.exit)()),!0}async function UL(t,e){aw(t,e,!0)}var VL="import { CapacitorUpdater } from '@capgo/capacitor-updater'",Dp="CapacitorUpdater.notifyAppReady()",Vue=/import.*from.*/g,Qc="production",HL={stdio:"pipe"},Ia;function zL(){Ia||(Ia=(0,st.readdirSync)(bp.default.tmpdir).map(t=>({name:t,full:`${bp.default.tmpdir}/${t}`})).find(t=>t.name.startsWith("capgocli"))?.full??bp.default.fileSync({prefix:"capgocli"}).name)}function Si(t){try{zL(),(0,st.writeFileSync)(Ia,JSON.stringify({step_done:t}))}catch(e){m.error(`Cannot mark step as done in the CLI, error:
312
+ `)}let i=await de(t),o=await me(i,t,["write","all","upload"]);await Fe(t,{channel:"user-login",event:"User CLI login",icon:"\u2705",user_id:o,notify:!1}).catch(),m.success(`login saved into .capgo file in ${n?"local":"home"} directory`)}catch{m.error("Error while saving login"),(0,ow.exit)(1)}return r&&(X("Done \u2705"),(0,ow.exit)()),!0}async function UL(t,e){aw(t,e,!0)}var VL="import { CapacitorUpdater } from '@capgo/capacitor-updater'",Dp="CapacitorUpdater.notifyAppReady()",Vue=/import.*from.*/g,Xc="production",HL={stdio:"pipe"},Ia;function zL(){Ia||(Ia=(0,st.readdirSync)(bp.default.tmpdir).map(t=>({name:t,full:`${bp.default.tmpdir}/${t}`})).find(t=>t.name.startsWith("capgocli"))?.full??bp.default.fileSync({prefix:"capgocli"}).name)}function Ci(t){try{zL(),(0,st.writeFileSync)(Ia,JSON.stringify({step_done:t}))}catch(e){m.error(`Cannot mark step as done in the CLI, error:
313
313
  ${e}`),m.warn("Onboarding will continue but please report it to the capgo team!")}}async function Hue(t,e){try{zL();let r=(0,st.readFileSync)(Ia,"utf-8");if(!r||r.length===0)return;let{step_done:n}=JSON.parse(r);m.info(`You have already got to the step ${n}/10 in the previous session`);let i=await Pe({message:"Would you like to continue from where you left off?"});return await fn(i,t,e),i?n:void 0}catch(r){m.error(`Cannot read which steps have been compleated, error:
314
314
  ${r}`),m.warn("Onboarding will continue but please report it to the capgo team!");return}}function zue(){if(Ia)try{(0,st.rmSync)(Ia)}catch(t){m.error(`Cannot delete the tmp steps file.
315
- Error: ${t}`)}}async function fn(t,e,r){kt(t)&&(await Hn("onboarding-v2",e,r,"canceled","\u{1F937}"),(0,rr.exit)())}async function $r(t,e,r){return Hn("onboarding-v2",t,e,`onboarding-step-${r}`)}async function Gue(t,e,r,n){let i=Nt(),o=await Pe({message:`Add ${r} in Capgo?`});if(await fn(o,t.gid,e),o){let s=be();s.start(`Running: ${i.runner} @capgo/cli@latest app add ${r}`),await Fb(r,n,t,!1)?s.stop("App add Done \u2705"):s.stop("App already add \u2705")}else m.info(`If you change your mind, run it for yourself with: "${i.runner} @capgo/cli@latest app add ${r}"`);await $r(t.gid,e,2)}async function Wue(t,e,r){let n=Nt(),i=await Pe({message:`Create default channel ${Qc} for ${r} in Capgo?`});if(await fn(i,t,e),i){let o=be();o.start(`Running: ${n.runner} @capgo/cli@latest channel add ${Qc} ${r} --default`),await Kb(Qc,r,{default:!0,apikey:e},!1)?o.stop("Channel add Done \u2705"):o.stop("Channel already added \u2705")}else m.info(`If you change your mind, run it for yourself with: "${n.runner} @capgo/cli@latest channel add ${Qc} ${r} --default"`);await $r(t,e,3)}var Kue="https://capacitorjs.com/docs/updating/6-0",Yue="https://capacitorjs.com/docs/updating/5-0";async function Jue(t,e,r){let n=Nt(),i=await Pe({message:`Automatic Install "@capgo/capacitor-updater" dependency in ${r}?`});if(await fn(i,t,e),i){let o=be();o.start("Checking if @capgo/capacitor-updater is installed");let s="latest",a=await jt(),u=a.dependencies["@capacitor/core"]||a.devDependencies["@capacitor/core"];if(u=Bn(u?.replace("^","").replace("~","")),u?Ta(u,Bn("5.0.0"))?(o.stop("Error"),m.warn(`@capacitor/core version is ${u}, please update to Capacitor v5 first: ${Yue}`),X("Bye \u{1F44B}"),(0,rr.exit)()):Ta(u,Bn("6.0.0"))&&(o.stop(`@capacitor/core version is ${u}, please update to Capacitor v6: ${Kue} to access the best features of Capgo`),s="^5.0.0"):(o.stop("Error"),m.warn("Cannot find @capacitor/core in package.json, please run `capgo init` in a capacitor project"),X("Bye \u{1F44B}"),(0,rr.exit)()),n.pm==="unknown"&&(o.stop("Error"),m.warn("Cannot reconize package manager, please run `capgo init` in a capacitor project with npm, pnpm, bun or yarn"),X("Bye \u{1F44B}"),(0,rr.exit)()),a.dependencies["@capgo/capacitor-updater"])o.stop("Capgo already installed \u2705");else{await(0,el.execSync)(`${n.installCommand} @capgo/capacitor-updater@${s}`,HL);let c=await jt();await wo({version:c?.version||"1.0.0",appId:r,autoUpdate:!0}),o.stop("Install Done \u2705")}}else m.info(`If you change your mind, run it for yourself with: "${n.installCommand} @capgo/capacitor-updater@latest"`);await $r(t,e,4)}async function Xue(t,e,r){let n=await Pe({message:`Automatic Add "${Dp}" code and import in ${r}?`});if(await fn(n,t,e),n){let i=be();i.start("Adding @capacitor-updater to your main file");let o=await ob();if(o==="nuxtjs-js"||o==="nuxtjs-ts"){let s=(0,vp.join)("plugins");(0,st.existsSync)(s)||(0,st.mkdirSync)(s,{recursive:!0});let a;o==="nuxtjs-ts"?a=(0,vp.join)(s,"capacitorUpdater.client.ts"):a=(0,vp.join)(s,"capacitorUpdater.client.js");let u=`
315
+ Error: ${t}`)}}async function fn(t,e,r){kt(t)&&(await Hn("onboarding-v2",e,r,"canceled","\u{1F937}"),(0,rr.exit)())}async function $r(t,e,r){return Hn("onboarding-v2",t,e,`onboarding-step-${r}`)}async function Gue(t,e,r,n){let i=Nt(),o=await Pe({message:`Add ${r} in Capgo?`});if(await fn(o,t.gid,e),o){let s=be();s.start(`Running: ${i.runner} @capgo/cli@latest app add ${r}`),await Fb(r,n,t,!1)?s.stop("App add Done \u2705"):s.stop("App already add \u2705")}else m.info(`If you change your mind, run it for yourself with: "${i.runner} @capgo/cli@latest app add ${r}"`);await $r(t.gid,e,2)}async function Wue(t,e,r){let n=Nt(),i=await Pe({message:`Create default channel ${Xc} for ${r} in Capgo?`});if(await fn(i,t,e),i){let o=be();o.start(`Running: ${n.runner} @capgo/cli@latest channel add ${Xc} ${r} --default`),await Kb(Xc,r,{default:!0,apikey:e},!1)?o.stop("Channel add Done \u2705"):o.stop("Channel already added \u2705")}else m.info(`If you change your mind, run it for yourself with: "${n.runner} @capgo/cli@latest channel add ${Xc} ${r} --default"`);await $r(t,e,3)}var Kue="https://capacitorjs.com/docs/updating/6-0",Yue="https://capacitorjs.com/docs/updating/5-0";async function Jue(t,e,r){let n=Nt(),i=await Pe({message:`Automatic Install "@capgo/capacitor-updater" dependency in ${r}?`});if(await fn(i,t,e),i){let o=be();o.start("Checking if @capgo/capacitor-updater is installed");let s="latest",a=await jt(),u=a.dependencies["@capacitor/core"]||a.devDependencies["@capacitor/core"];if(u=Bn(u?.replace("^","").replace("~","")),u?Ta(u,Bn("5.0.0"))?(o.stop("Error"),m.warn(`@capacitor/core version is ${u}, please update to Capacitor v5 first: ${Yue}`),X("Bye \u{1F44B}"),(0,rr.exit)()):Ta(u,Bn("6.0.0"))&&(o.stop(`@capacitor/core version is ${u}, please update to Capacitor v6: ${Kue} to access the best features of Capgo`),s="^5.0.0"):(o.stop("Error"),m.warn("Cannot find @capacitor/core in package.json, please run `capgo init` in a capacitor project"),X("Bye \u{1F44B}"),(0,rr.exit)()),n.pm==="unknown"&&(o.stop("Error"),m.warn("Cannot reconize package manager, please run `capgo init` in a capacitor project with npm, pnpm, bun or yarn"),X("Bye \u{1F44B}"),(0,rr.exit)()),a.dependencies["@capgo/capacitor-updater"])o.stop("Capgo already installed \u2705");else{await(0,Zc.execSync)(`${n.installCommand} @capgo/capacitor-updater@${s}`,HL);let c=await jt();await bo({version:c?.version||"1.0.0",appId:r,autoUpdate:!0}),o.stop("Install Done \u2705")}}else m.info(`If you change your mind, run it for yourself with: "${n.installCommand} @capgo/capacitor-updater@latest"`);await $r(t,e,4)}async function Xue(t,e,r){let n=await Pe({message:`Automatic Add "${Dp}" code and import in ${r}?`});if(await fn(n,t,e),n){let i=be();i.start("Adding @capacitor-updater to your main file");let o=await ob();if(o==="nuxtjs-js"||o==="nuxtjs-ts"){let s=(0,vp.join)("plugins");(0,st.existsSync)(s)||(0,st.mkdirSync)(s,{recursive:!0});let a;o==="nuxtjs-ts"?a=(0,vp.join)(s,"capacitorUpdater.client.ts"):a=(0,vp.join)(s,"capacitorUpdater.client.js");let u=`
316
316
  import { CapacitorUpdater } from '@capgo/capacitor-updater'
317
317
 
318
318
  export default defineNuxtPlugin(() => {
@@ -327,7 +327,7 @@ ${Dp};
327
327
  ${VL};
328
328
 
329
329
  ${Dp};
330
- `)}async function Zue(t,e,r){let n=Nt(),i=await Pe({message:`Automatic configure end-to-end encryption in ${r} updates?`});if(await fn(i,t,e),i){let o=be();o.start(`Running: ${n.runner} @capgo/cli@latest key create`),await iw({force:!0},!1)?o.stop("key created \u{1F511}"):(o.stop("Error"),m.warn("Cannot create key \u274C"),X("Bye \u{1F44B}"),(0,rr.exit)(1)),Hn("onboarding-v2",t,e,"Use encryption v2")}await $r(t,e,6)}async function Que(t,e,r){let n=Nt(),i=await Pe({message:`Automatic build ${r} with "${n.pm} run build" ?`});if(await fn(i,t,e),i){let o=be(),s=await ob(),a=await nj(s);o.start(`Running: ${n.pm} run ${a} && ${n.runner} cap sync`),(await jt()).scripts[a]||(o.stop("Error"),m.warn(`Cannot find ${a} script in package.json, please add it and run \`capgo init\` again`),X("Bye \u{1F44B}"),(0,rr.exit)()),(0,el.execSync)(`${n.pm} run ${a} && ${n.runner} cap sync`,HL),o.stop("Build & Sync Done \u2705")}else m.info(`Build yourself with command: ${n.pm} run build && ${n.runner} cap sync`);await $r(t,e,7)}async function ece(t,e,r){let n=Nt(),i=await Pe({message:`Automatic upload ${r} bundle to Capgo?`});if(await fn(i,t,e),i){let o=be();o.start(`Running: ${n.runner} @capgo/cli@latest bundle upload`),await mp(r,{channel:Qc,apikey:e},!1)?o.stop("Upload Done \u2705"):(o.stop("Error"),m.warn("Upload failed \u274C"),X("Bye \u{1F44B}"),(0,rr.exit)())}else m.info(`Upload yourself with command: ${n.runner} @capgo/cli@latest bundle upload`);await $r(t,e,8)}async function tce(t,e){let r=Nt(),n=await Pe({message:"Run in device now ?"});if(await fn(n,t,e),n){let i=await Mo({message:"Pick a platform to run your app",options:[{value:"ios",label:"IOS"},{value:"android",label:"Android"}]});kt(i)&&(X("Bye \u{1F44B}"),(0,rr.exit)());let o=i,s=be();s.start(`Running: ${r.runner} cap run ${o}`),await(0,el.spawnSync)(r.runner,["cap","run",o],{stdio:"inherit"}),s.stop("Started Done \u2705")}else m.info(`If you change your mind, run it for yourself with: ${r.runner} cap run <ios|android>`);await $r(t,e,9)}async function rce(t,e,r,n){let i=await Pe({message:"Automatic check if update working in device ?"});if(await fn(i,t,e),i)m.info(`Wait logs sent to Capgo from ${r} device, Please open your app \u{1F4AA}`),await nw("onboarding-v2",e,r,e,t);else{let o=_o(r);m.info(`Check logs in ${n}/app/p/${o}/logs to see if update works.`)}await $r(t,e,10)}async function GL(t,e,r){let n=Nt();Y("Capgo onboarding \u{1F6EB}"),await De();let i=!r.supaAnon||!r.supaHost?await ee():await wo({statsUrl:`${r.supaHost}/functions/v1/stats`,channelUrl:`${r.supaHost}/functions/v1/channel_self`,updateUrl:`${r.supaHost}/functions/v1/updates`,localApiFiles:`${r.supaHost}/functions/v1`,localS3:!0,localSupa:r.supaHost,localSupaAnon:r.supaAnon}),o=await Cr();e=ge(e,i?.config),r.apikey=t||pe(),e===void 0&&(e=await Xp({message:"Enter your appId:"}),kt(e)&&(Zp("Operation cancelled."),(0,rr.exit)(1)));let s=be();(!ML()||t)&&(s.start(`Running: ${n.runner} @capgo/cli@latest login ***`),await aw(r.apikey,r,!1),s.stop("Login Done \u2705"));let a=await de(r.apikey);await me(a,r.apikey,["upload","all","read","write"]);let u=await ga(a,["admin","super_admin"]),c=u.gid,l=await Hue(c,r.apikey)??0;try{l<1&&await $r(c,r.apikey,1),l<2&&(await Gue(u,r.apikey,e,r),Si(2)),l<3&&(await Wue(c,r.apikey,e),Si(3)),l<4&&(await Jue(c,r.apikey,e),Si(4)),l<5&&(await Xue(c,r.apikey,e),Si(5)),l<6&&(await Zue(c,r.apikey,e),Si(6)),l<7&&(await Que(c,r.apikey,e),Si(7)),l<8&&(await ece(c,r.apikey,e),Si(8)),l<9&&(await tce(c,r.apikey),Si(9)),await rce(c,r.apikey,e,o.hostWeb),await $r(c,r.apikey,0),zue()}catch(f){console.error(f),m.error("Error during onboarding, please try again later"),(0,rr.exit)(1)}m.info("Welcome onboard \u2708\uFE0F!"),m.info("Your Capgo update system is setup"),m.info(`Next time use \`${n.runner} @capgo/cli@latest bundle upload\` to only upload your bundle`),m.info(`If you have any issue try to use the debug command \`${n.runner} @capgo/cli@latest app debug\``),X("Bye \u{1F44B}"),(0,rr.exit)()}var dn=require("node:fs");async function nce(t,e=!0){e&&Y("Save keys \u{1F511}");let r=await ee(),n=t.key||er,i=t.keyData||"";if(!(0,dn.existsSync)(n)&&!i)if(e)m.error(`Cannot find public key ${n} or as keyData option or in ${r.path}`),A.error("");else return!1;else(0,dn.existsSync)(n)&&(i=(0,dn.readFileSync)(n).toString());return r?.config&&(r.config.plugins||(r.config.plugins={extConfig:{},CapacitorUpdater:{}}),r.config.plugins.CapacitorUpdater||(r.config.plugins.CapacitorUpdater={}),r.config.plugins.CapacitorUpdater.privateKey=i,await on(r)),m&&(m.success(`private key saved into ${r.path} file in local directory`),m.success("your app will decode the zip archive with this key")),!0}async function WL(t){Y("Save keys \u{1F511}"),await De(),await nce(t)}async function ice(t,e=!0){e&&Y("Create keys \u{1F511}");let{publicKey:r,privateKey:n}=np();if((0,dn.existsSync)(cr)&&!t.force)if(m.error("Public Key already exists, use --force to overwrite"),e)A.error("");else return!1;if((0,dn.writeFileSync)(cr,r),(0,dn.existsSync)(er)&&!t.force)if(m.error("Private Key already exists, use --force to overwrite"),e)A.error("");else return!1;(0,dn.writeFileSync)(er,n);let i=n.replace(/\\n/g,"\\n"),o=await wo({privateKey:i});return e&&(m.success("Your RSA key has been generated"),m.success(`Public key saved in ${cr}`),m.success("This key will be use to encrypt your bundle before sending it to Capgo"),m.success("Keep it safe"),m.success("Than make it unreadable by Capgo and unmodifiable by anyone"),m.success(`Private key saved in ${o.path}`),m.success("Your app will be the only one having it"),m.success("Only your users can decrypt your update"),m.success("Only you can send them an update"),X("Done \u2705")),!0}async function KL(t){await De(),await ice(t)}async function YL(t){Y("Getting user id"),t.apikey=t.apikey||pe();let e=await de(t.apikey),r=await me(e,t.apikey,["read","all","write"]);X(`Done \u2705: ${r}`)}var JL=ce(Tv());async function XL(t,e){Y("Check compatibility"),e.apikey=e.apikey||pe();let r=await ee();t=ge(t,r?.config);let{channel:n}=e;n||(m.error("Missing argument, you need to provide a channel"),A.error("")),e.apikey||(m.error("Missing API key, you need to provide a API key to upload your bundle"),A.error("")),t||(m.error("Missing argument, you need to provide a appId, or be in a capacitor project"),A.error(""));let i=await de(e.apikey);await me(i,e.apikey,["write","all","read","upload"]),await Be(i,e.apikey,t,1);let{finalCompatibility:o}=await Ih(i,t,n,e.packageJson,e.nodeModules),s=new lr;s.headers=["Package","Local version","Remote version","Compatible"],s.theme=lr.roundTheme,s.rows=[];let a=e.text?"Yes":"\u2705",u=e.text?"No":"\u274C";o.forEach(c=>{let{name:l,localVersion:f,remoteVersion:h}=c,d=u;try{d=(0,JL.default)(f??"",h??"")?a:u}catch(p){m.error(`Fail when compare. Error: ${p}`)}s.rows.push([l,f,h,d])}),m.success("Compatibility"),m.success(s.toString())}A.name(Ir.name).description("Manage packages and bundle versions in Capgo Cloud").version(Ir.version,"-v, --version","output the current version");A.command("login [apikey]").alias("l").description("Save apikey to your machine or folder").action(UL).option("--local","Only save in local folder");A.command("doctor").description("Get info about your Capgo app install").option("--package-json <packageJson>","A path to package.json. Usefull for monorepos").action(U8);A.command("init [apikey] [appId]").alias("i").description("Init a new app").action(GL).option("-n, --name <name>","app name").option("-i, --icon <icon>","app icon path").option("--supa-host <supaHost>","Supabase host URL").option("--supa-anon <supaAnon>","Supabase anon token");var ja=A.command("app").description("Manage app");ja.command("add [appId]").alias("a").description("Add a new app in Capgo Cloud").action(B8).option("-n, --name <name>","app name").option("-i, --icon <icon>","app icon path").option("-a, --apikey <apikey>","apikey to link to your account");ja.command("delete [appId]").description("Delete an app in Capgo Cloud").action(M8).option("-a, --apikey <apikey>","apikey to link to your account");ja.command("list").alias("l").description("list apps in Capgo Cloud").action(H8).option("-a, --apikey <apikey>","apikey to link to your account");ja.command("debug [appId]").description("Listen for live updates event in Capgo Cloud to debug your app").option("-a, --apikey <apikey>","apikey to link to your account").option("-d, --device <device>","the specific device to debug").action(NL);ja.command("setting [path]").description("Modifies capacitor config programmatically").option("--bool <bool>","A value for the setting to modify as a boolean").option("--string <string>","A value for the setting to modify as a string").action(K8);ja.command("set [appId]").alias("s").description("Set an app in Capgo Cloud").action(W8).option("-n, --name <name>","app name").option("-i, --icon <icon>","app icon path").option("-a, --apikey <apikey>","apikey to link to your account").option("-r, --retention <retention>","retention period of app bundle in days");var hn=A.command("bundle").description("Manage bundle");hn.command("upload [appId]").alias("u").description("Upload a new bundle in Capgo Cloud").action(oL).option("-a, --apikey <apikey>","apikey to link to your account").option("-p, --path <path>","path of the folder to upload").option("-c, --channel <channel>","channel to link to").option("-e, --external <url>","link to external url intead of upload to Capgo Cloud").option("--iv-session-key <key>","Set the iv and session key for bundle url external").option("--s3-region <region>","Region for your S3 bucket").option("--s3-apikey <apikey>","Apikey for your S3 endpoint").option("--s3-apisecret <apisecret>","Api secret for your S3 endpoint").option("--s3-endoint <s3Endpoint>","Url of S3 endpoint").option("--s3-bucket-name <bucketName>","Name for your AWS S3 bucket").option("--s3-port <port>","Port for your S3 endpoint").option("--no-s3-ssl","Disable SSL for S3 upload").option("--key <key>","custom path for public signing key (v1 system)").option("--key-data <keyData>","public signing key (v1 system)").option("--key-v2 <key>","custom path for private signing key (v2 system)").option("--key-data-v2 <keyDataV2>","private signing key (v2 system)").option("--bundle-url","prints bundle url into stdout").option("--no-key","ignore signing key and send clear update").option("--no-code-check","Ignore checking if notifyAppReady() is called in soure code and index present in root folder").option("--display-iv-session","Show in the console the iv and session key used to encrypt the update").option("-b, --bundle <bundle>","bundle version number of the bundle to upload").option("--min-update-version <minUpdateVersion>","Minimal version required to update to this version. Used only if the disable auto update is set to metadata in channel").option("--auto-min-update-version","Set the min update version based on native packages").option("--ignore-metadata-check","Ignores the metadata (node_modules) check when uploading").option("--ignore-checksum-check","Ignores the checksum check when uploading").option("--timeout <timeout>","Timeout for the upload process in seconds").option("--multipart","Uses multipart protocol to upload data to S3, Deprecated, use tus instead").option("--tus","Upload the bundle using TUS to Capgo cloud").option("--partial","Upload partial files to Capgo cloud").option("--encrypted-checksum <encryptedChecksum>","An encrypted checksum (signature). Used only when uploading an external bundle.").option("--package-json <packageJson>","A path to package.json. Usefull for monorepos").option("--auto-set-bundle","Set the bundle in capacitor.config.json").option("--dry-upload","Dry upload the bundle process, mean it will not upload the files but add the row in database (useful for testing)").option("--node-modules <nodeModules>","A list of path to node_modules. Usefull for monorepos (comma separated ex: ../../node_modules,./node_modules)");hn.command("compatibility [appId]").action(XL).option("-a, --apikey <apikey>","apikey to link to your account").option("-c, --channel <channel>","channel to check the compatibility with").option("--text","output text instead of emojis").option("--package-json <packageJson>","A path to package.json. Usefull for monorepos").option("--node-modules <nodeModules>","A list of path to node_modules. Usefull for monorepos (comma separated ex: ../../node_modules,./node_modules)");hn.command("delete [bundleId] [appId]").alias("d").description("Delete a bundle in Capgo Cloud").action(PN).option("-a, --apikey <apikey>","apikey to link to your account");hn.command("list [appId]").alias("l").description("List bundle in Capgo Cloud").action(LN).option("-a, --apikey <apikey>","apikey to link to your account");hn.command("cleanup [appId]").alias("c").action(DN).description("Cleanup bundle in Capgo Cloud").option("-b, --bundle <bundle>","bundle version number of the app to delete").option("-a, --apikey <apikey>","apikey to link to your account").option("-k, --keep <keep>","number of version to keep").option("-f, --force","force removal");hn.command("decrypt [zipPath] [sessionKey]").description("Decrypt a signed zip bundle").action(CN).option("--key <key>","custom path for private signing key").option("--key-data <keyData>","private signing key");hn.command("encrypt [zipPath]").description("Encrypt a zip bundle").action($N).option("--key <key>","custom path for private signing key").option("--key-data <keyData>","private signing key");hn.command("encryptV2 [zipPath] [checksum]").description("Encrypt a zip bundle using the new encryption method").action(jN).option("--key <key>","custom path for private signing key").option("--key-data <keyData>","private signing key").option("-j, --json","output in JSON");hn.command("decryptV2 [zipPath] [checksum]").description("Decrypt a zip bundle using the new encryption method").action(kN).option("--key <key>","custom path for private signing key").option("--key-data <keyData>","private signing key").option("--checksum <checksum>","checksum of the bundle, to verify the integrity of the bundle");hn.command("zip [appId]").description("Zip a bundle").action(cL).option("-p, --path <path>","path of the folder to upload").option("-b, --bundle <bundle>","bundle version number to name the zip file").option("-n, --name <name>","name of the zip file").option("-j, --json","output in JSON").option("--no-code-check","Ignore checking if notifyAppReady() is called in soure code and index present in root folder").option("--key-v2","use encryption v2").option("--package-json <packageJson>","A path to package.json. Usefull for monorepos");var tl=A.command("channel").description("Manage channel");tl.command("add [channelId] [appId]").alias("a").description("Create channel").action(fL).option("-d, --default","set the channel as default").option("-a, --apikey <apikey>","apikey to link to your account");tl.command("delete [channelId] [appId]").alias("d").description("Delete channel").action(mL).option("-a, --apikey <apikey>","apikey to link to your account");tl.command("list [appId]").alias("l").description("List channel").action(yL).option("-a, --apikey <apikey>","apikey to link to your account");tl.command("currentBundle [channel] [appId]").description("Get current bundle for specific channel in Capgo Cloud").action(hL).option("-c, --channel <channel>","channel to get the current bundle from").option("-a, --apikey <apikey>","apikey to link to your account").option("--quiet","only print the bundle version");tl.command("set [channelId] [appId]").alias("s").description("Set channel").action(bL).option("-a, --apikey <apikey>","apikey to link to your account").option("-b, --bundle <bundle>","bundle version number of the file to set").option("-s, --state <state>","set the state of the channel, default or normal").option("--latest","get the latest version key in the package.json to set it to the channel").option("--downgrade","Allow to downgrade to version under native one").option("--no-downgrade","Disable downgrade to version under native one").option("--upgrade","Allow to upgrade to version above native one").option("--no-upgrade","Disable upgrade to version above native one").option("--ios","Allow sending update to ios devices").option("--no-ios","Disable sending update to ios devices").option("--android","Allow sending update to android devices").option("--no-android","Disable sending update to android devices").option("--self-assign","Allow to device to self assign to this channel").option("--no-self-assign","Disable devices to self assign to this channel").option("--disable-auto-update <disableAutoUpdate>","Disable auto update strategy for this channel.The possible options are: major, minor, metadata, patch, none").option("--dev","Allow sending update to development devices").option("--no-dev","Disable sending update to development devices").option("--emulator","Allow sending update to emulator devices").option("--no-emulator","Disable sending update to emulator devices").option("--package-json <packageJson>","A path to package.json. Usefull for monorepos");var ZL=A.command("key_old").description("Manage old encryption key");ZL.command("save").description("Save base64 encryption key in capacitor config, usefull for CI").action(WL).option("-f, --force","force generate a new one").option("--key","key path to save in capacitor config").option("--key-data","key data to save in capacitor config");ZL.command("create").description("Create a new encryption key").action(KL).option("-f, --force","force generate a new one");var uw=A.command("key").description("Manage encryption key");uw.command("save").description("Save base64 encryption key in capacitor config, usefull for CI").action(LL).option("-f, --force","force generate a new one").option("--key","key path to save in capacitor config").option("--key-data","key data to save in capacitor config");uw.command("create").description("Create a new encryption key").action(BL).option("-f, --force","force generate a new one");uw.command("delete_old").description("Delete the old encryption key").action(qL);A.command("upload [appId]").alias("u").description("(Deprecated) Upload a new bundle to Capgo Cloud").action(sL).option("-a, --apikey <apikey>","apikey to link to your account").option("-p, --path <path>","path of the folder to upload").option("-c, --channel <channel>","channel to link to").option("-e, --external <url>","link to external url intead of upload to Capgo Cloud").option("--old-encryption","use old encryption").option("--key <key>","custom path for public signing key").option("--key-data <keyData>","public signing key").option("--bundle-url","prints bundle url into stdout").option("--no-key","ignore signing key and send clear update").option("--display-iv-session","Show in the console the iv and session key used to encrypt the update").option("-b, --bundle <bundle>","bundle version number of the file to upload").option("--min-update-version <minUpdateVersion>","Minimal version required to update to this version. Used only if the disable auto update is set to metadata in channel");var oce=A.command("account").description("Manage account");oce.command("id").description("Get your account ID").action(YL).option("-a, --apikey <apikey>","apikey to link to your account");A.parseAsync();
330
+ `)}async function Zue(t,e,r){let n=Nt(),i=await Pe({message:`Automatic configure end-to-end encryption in ${r} updates?`});if(await fn(i,t,e),i){let o=be();o.start(`Running: ${n.runner} @capgo/cli@latest key create`),await iw({force:!0},!1)?o.stop("key created \u{1F511}"):(o.stop("Error"),m.warn("Cannot create key \u274C"),X("Bye \u{1F44B}"),(0,rr.exit)(1)),Hn("onboarding-v2",t,e,"Use encryption v2")}await $r(t,e,6)}async function Que(t,e,r){let n=Nt(),i=await Pe({message:`Automatic build ${r} with "${n.pm} run build" ?`});if(await fn(i,t,e),i){let o=be(),s=await ob(),a=await nj(s);o.start(`Running: ${n.pm} run ${a} && ${n.runner} cap sync`),(await jt()).scripts[a]||(o.stop("Error"),m.warn(`Cannot find ${a} script in package.json, please add it and run \`capgo init\` again`),X("Bye \u{1F44B}"),(0,rr.exit)()),(0,Zc.execSync)(`${n.pm} run ${a} && ${n.runner} cap sync`,HL),o.stop("Build & Sync Done \u2705")}else m.info(`Build yourself with command: ${n.pm} run build && ${n.runner} cap sync`);await $r(t,e,7)}async function ece(t,e,r){let n=Nt(),i=await Pe({message:`Automatic upload ${r} bundle to Capgo?`});if(await fn(i,t,e),i){let o=be();o.start(`Running: ${n.runner} @capgo/cli@latest bundle upload`),await mp(r,{channel:Xc,apikey:e},!1)?o.stop("Upload Done \u2705"):(o.stop("Error"),m.warn("Upload failed \u274C"),X("Bye \u{1F44B}"),(0,rr.exit)())}else m.info(`Upload yourself with command: ${n.runner} @capgo/cli@latest bundle upload`);await $r(t,e,8)}async function tce(t,e){let r=Nt(),n=await Pe({message:"Run in device now ?"});if(await fn(n,t,e),n){let i=await Mo({message:"Pick a platform to run your app",options:[{value:"ios",label:"IOS"},{value:"android",label:"Android"}]});kt(i)&&(X("Bye \u{1F44B}"),(0,rr.exit)());let o=i,s=be();s.start(`Running: ${r.runner} cap run ${o}`),await(0,Zc.spawnSync)(r.runner,["cap","run",o],{stdio:"inherit"}),s.stop("Started Done \u2705")}else m.info(`If you change your mind, run it for yourself with: ${r.runner} cap run <ios|android>`);await $r(t,e,9)}async function rce(t,e,r,n){let i=await Pe({message:"Automatic check if update working in device ?"});if(await fn(i,t,e),i)m.info(`Wait logs sent to Capgo from ${r} device, Please open your app \u{1F4AA}`),await nw("onboarding-v2",e,r,e,t);else{let o=wo(r);m.info(`Check logs in ${n}/app/p/${o}/logs to see if update works.`)}await $r(t,e,10)}async function GL(t,e,r){let n=Nt();Y("Capgo onboarding \u{1F6EB}"),await De();let i=!r.supaAnon||!r.supaHost?await ee():await bo({statsUrl:`${r.supaHost}/functions/v1/stats`,channelUrl:`${r.supaHost}/functions/v1/channel_self`,updateUrl:`${r.supaHost}/functions/v1/updates`,localApiFiles:`${r.supaHost}/functions/v1`,localS3:!0,localSupa:r.supaHost,localSupaAnon:r.supaAnon}),o=await Cr();e=ge(e,i?.config),r.apikey=t||pe(),e===void 0&&(e=await Xp({message:"Enter your appId:"}),kt(e)&&(Zp("Operation cancelled."),(0,rr.exit)(1)));let s=be();(!ML()||t)&&(s.start(`Running: ${n.runner} @capgo/cli@latest login ***`),await aw(r.apikey,r,!1),s.stop("Login Done \u2705"));let a=await de(r.apikey);await me(a,r.apikey,["upload","all","read","write"]);let u=await ga(a,["admin","super_admin"]),c=u.gid,l=await Hue(c,r.apikey)??0;try{l<1&&await $r(c,r.apikey,1),l<2&&(await Gue(u,r.apikey,e,r),Ci(2)),l<3&&(await Wue(c,r.apikey,e),Ci(3)),l<4&&(await Jue(c,r.apikey,e),Ci(4)),l<5&&(await Xue(c,r.apikey,e),Ci(5)),l<6&&(await Zue(c,r.apikey,e),Ci(6)),l<7&&(await Que(c,r.apikey,e),Ci(7)),l<8&&(await ece(c,r.apikey,e),Ci(8)),l<9&&(await tce(c,r.apikey),Ci(9)),await rce(c,r.apikey,e,o.hostWeb),await $r(c,r.apikey,0),zue()}catch(f){console.error(f),m.error("Error during onboarding, please try again later"),(0,rr.exit)(1)}m.info("Welcome onboard \u2708\uFE0F!"),m.info("Your Capgo update system is setup"),m.info(`Next time use \`${n.runner} @capgo/cli@latest bundle upload\` to only upload your bundle`),m.info(`If you have any issue try to use the debug command \`${n.runner} @capgo/cli@latest app debug\``),X("Bye \u{1F44B}"),(0,rr.exit)()}var dn=require("node:fs");async function nce(t,e=!0){e&&Y("Save keys \u{1F511}");let r=await ee(),n=t.key||er,i=t.keyData||"";if(!(0,dn.existsSync)(n)&&!i)if(e)m.error(`Cannot find public key ${n} or as keyData option or in ${r.path}`),A.error("");else return!1;else(0,dn.existsSync)(n)&&(i=(0,dn.readFileSync)(n).toString());return r?.config&&(r.config.plugins||(r.config.plugins={extConfig:{},CapacitorUpdater:{}}),r.config.plugins.CapacitorUpdater||(r.config.plugins.CapacitorUpdater={}),r.config.plugins.CapacitorUpdater.privateKey=i,await on(r)),m&&(m.success(`private key saved into ${r.path} file in local directory`),m.success("your app will decode the zip archive with this key")),!0}async function WL(t){Y("Save keys \u{1F511}"),await De(),await nce(t)}async function ice(t,e=!0){e&&Y("Create keys \u{1F511}");let{publicKey:r,privateKey:n}=tp();if((0,dn.existsSync)(cr)&&!t.force)if(m.error("Public Key already exists, use --force to overwrite"),e)A.error("");else return!1;if((0,dn.writeFileSync)(cr,r),(0,dn.existsSync)(er)&&!t.force)if(m.error("Private Key already exists, use --force to overwrite"),e)A.error("");else return!1;(0,dn.writeFileSync)(er,n);let i=n.replace(/\\n/g,"\\n"),o=await bo({privateKey:i});return e&&(m.success("Your RSA key has been generated"),m.success(`Public key saved in ${cr}`),m.success("This key will be use to encrypt your bundle before sending it to Capgo"),m.success("Keep it safe"),m.success("Than make it unreadable by Capgo and unmodifiable by anyone"),m.success(`Private key saved in ${o.path}`),m.success("Your app will be the only one having it"),m.success("Only your users can decrypt your update"),m.success("Only you can send them an update"),X("Done \u2705")),!0}async function KL(t){await De(),await ice(t)}async function YL(t){Y("Getting user id"),t.apikey=t.apikey||pe();let e=await de(t.apikey),r=await me(e,t.apikey,["read","all","write"]);X(`Done \u2705: ${r}`)}var JL=ce(Tv());async function XL(t,e){Y("Check compatibility"),e.apikey=e.apikey||pe();let r=await ee();t=ge(t,r?.config);let{channel:n}=e;n||(m.error("Missing argument, you need to provide a channel"),A.error("")),e.apikey||(m.error("Missing API key, you need to provide a API key to upload your bundle"),A.error("")),t||(m.error("Missing argument, you need to provide a appId, or be in a capacitor project"),A.error(""));let i=await de(e.apikey);await me(i,e.apikey,["write","all","read","upload"]),await Be(i,e.apikey,t,1);let{finalCompatibility:o}=await Rh(i,t,n,e.packageJson,e.nodeModules),s=new lr;s.headers=["Package","Local version","Remote version","Compatible"],s.theme=lr.roundTheme,s.rows=[];let a=e.text?"Yes":"\u2705",u=e.text?"No":"\u274C";o.forEach(c=>{let{name:l,localVersion:f,remoteVersion:h}=c,d=u;try{d=(0,JL.default)(f??"",h??"")?a:u}catch(p){m.error(`Fail when compare. Error: ${p}`)}s.rows.push([l,f,h,d])}),m.success("Compatibility"),m.success(s.toString())}A.name(Ir.name).description("Manage packages and bundle versions in Capgo Cloud").version(Ir.version,"-v, --version","output the current version");A.command("login [apikey]").alias("l").description("Save apikey to your machine or folder").action(UL).option("--local","Only save in local folder");A.command("doctor").description("Get info about your Capgo app install").option("--package-json <packageJson>","A path to package.json. Usefull for monorepos").action(U8);A.command("init [apikey] [appId]").alias("i").description("Init a new app").action(GL).option("-n, --name <name>","app name").option("-i, --icon <icon>","app icon path").option("--supa-host <supaHost>","Supabase host URL").option("--supa-anon <supaAnon>","Supabase anon token");var ja=A.command("app").description("Manage app");ja.command("add [appId]").alias("a").description("Add a new app in Capgo Cloud").action(B8).option("-n, --name <name>","app name").option("-i, --icon <icon>","app icon path").option("-a, --apikey <apikey>","apikey to link to your account");ja.command("delete [appId]").description("Delete an app in Capgo Cloud").action(M8).option("-a, --apikey <apikey>","apikey to link to your account");ja.command("list").alias("l").description("list apps in Capgo Cloud").action(H8).option("-a, --apikey <apikey>","apikey to link to your account");ja.command("debug [appId]").description("Listen for live updates event in Capgo Cloud to debug your app").option("-a, --apikey <apikey>","apikey to link to your account").option("-d, --device <device>","the specific device to debug").action(NL);ja.command("setting [path]").description("Modifies capacitor config programmatically").option("--bool <bool>","A value for the setting to modify as a boolean").option("--string <string>","A value for the setting to modify as a string").action(K8);ja.command("set [appId]").alias("s").description("Set an app in Capgo Cloud").action(W8).option("-n, --name <name>","app name").option("-i, --icon <icon>","app icon path").option("-a, --apikey <apikey>","apikey to link to your account").option("-r, --retention <retention>","retention period of app bundle in days");var hn=A.command("bundle").description("Manage bundle");hn.command("upload [appId]").alias("u").description("Upload a new bundle in Capgo Cloud").action(oL).option("-a, --apikey <apikey>","apikey to link to your account").option("-p, --path <path>","path of the folder to upload").option("-c, --channel <channel>","channel to link to").option("-e, --external <url>","link to external url intead of upload to Capgo Cloud").option("--iv-session-key <key>","Set the iv and session key for bundle url external").option("--s3-region <region>","Region for your S3 bucket").option("--s3-apikey <apikey>","Apikey for your S3 endpoint").option("--s3-apisecret <apisecret>","Api secret for your S3 endpoint").option("--s3-endoint <s3Endpoint>","Url of S3 endpoint").option("--s3-bucket-name <bucketName>","Name for your AWS S3 bucket").option("--s3-port <port>","Port for your S3 endpoint").option("--no-s3-ssl","Disable SSL for S3 upload").option("--key <key>","custom path for public signing key (v1 system)").option("--key-data <keyData>","public signing key (v1 system)").option("--key-v2 <key>","custom path for private signing key (v2 system)").option("--key-data-v2 <keyDataV2>","private signing key (v2 system)").option("--bundle-url","prints bundle url into stdout").option("--no-key","ignore signing key and send clear update").option("--no-code-check","Ignore checking if notifyAppReady() is called in soure code and index present in root folder").option("--display-iv-session","Show in the console the iv and session key used to encrypt the update").option("-b, --bundle <bundle>","bundle version number of the bundle to upload").option("--min-update-version <minUpdateVersion>","Minimal version required to update to this version. Used only if the disable auto update is set to metadata in channel").option("--auto-min-update-version","Set the min update version based on native packages").option("--ignore-metadata-check","Ignores the metadata (node_modules) check when uploading").option("--ignore-checksum-check","Ignores the checksum check when uploading").option("--timeout <timeout>","Timeout for the upload process in seconds").option("--multipart","Uses multipart protocol to upload data to S3, Deprecated, use tus instead").option("--tus","Upload the bundle using TUS to Capgo cloud").option("--partial","Upload partial files to Capgo cloud").option("--encrypted-checksum <encryptedChecksum>","An encrypted checksum (signature). Used only when uploading an external bundle.").option("--package-json <packageJson>","A path to package.json. Usefull for monorepos").option("--auto-set-bundle","Set the bundle in capacitor.config.json").option("--dry-upload","Dry upload the bundle process, mean it will not upload the files but add the row in database (useful for testing)").option("--node-modules <nodeModules>","A list of path to node_modules. Usefull for monorepos (comma separated ex: ../../node_modules,./node_modules)");hn.command("compatibility [appId]").action(XL).option("-a, --apikey <apikey>","apikey to link to your account").option("-c, --channel <channel>","channel to check the compatibility with").option("--text","output text instead of emojis").option("--package-json <packageJson>","A path to package.json. Usefull for monorepos").option("--node-modules <nodeModules>","A list of path to node_modules. Usefull for monorepos (comma separated ex: ../../node_modules,./node_modules)");hn.command("delete [bundleId] [appId]").alias("d").description("Delete a bundle in Capgo Cloud").action(PN).option("-a, --apikey <apikey>","apikey to link to your account");hn.command("list [appId]").alias("l").description("List bundle in Capgo Cloud").action(LN).option("-a, --apikey <apikey>","apikey to link to your account");hn.command("cleanup [appId]").alias("c").action(DN).description("Cleanup bundle in Capgo Cloud").option("-b, --bundle <bundle>","bundle version number of the app to delete").option("-a, --apikey <apikey>","apikey to link to your account").option("-k, --keep <keep>","number of version to keep").option("-f, --force","force removal");hn.command("decrypt [zipPath] [sessionKey]").description("Decrypt a signed zip bundle").action(CN).option("--key <key>","custom path for private signing key").option("--key-data <keyData>","private signing key");hn.command("encrypt [zipPath]").description("Encrypt a zip bundle").action($N).option("--key <key>","custom path for private signing key").option("--key-data <keyData>","private signing key");hn.command("encryptV2 [zipPath] [checksum]").description("Encrypt a zip bundle using the new encryption method").action(jN).option("--key <key>","custom path for private signing key").option("--key-data <keyData>","private signing key").option("-j, --json","output in JSON");hn.command("decryptV2 [zipPath] [checksum]").description("Decrypt a zip bundle using the new encryption method").action(kN).option("--key <key>","custom path for private signing key").option("--key-data <keyData>","private signing key").option("--checksum <checksum>","checksum of the bundle, to verify the integrity of the bundle");hn.command("zip [appId]").description("Zip a bundle").action(cL).option("-p, --path <path>","path of the folder to upload").option("-b, --bundle <bundle>","bundle version number to name the zip file").option("-n, --name <name>","name of the zip file").option("-j, --json","output in JSON").option("--no-code-check","Ignore checking if notifyAppReady() is called in soure code and index present in root folder").option("--key-v2","use encryption v2").option("--package-json <packageJson>","A path to package.json. Usefull for monorepos");var Qc=A.command("channel").description("Manage channel");Qc.command("add [channelId] [appId]").alias("a").description("Create channel").action(fL).option("-d, --default","set the channel as default").option("-a, --apikey <apikey>","apikey to link to your account");Qc.command("delete [channelId] [appId]").alias("d").description("Delete channel").action(mL).option("-a, --apikey <apikey>","apikey to link to your account");Qc.command("list [appId]").alias("l").description("List channel").action(yL).option("-a, --apikey <apikey>","apikey to link to your account");Qc.command("currentBundle [channel] [appId]").description("Get current bundle for specific channel in Capgo Cloud").action(hL).option("-c, --channel <channel>","channel to get the current bundle from").option("-a, --apikey <apikey>","apikey to link to your account").option("--quiet","only print the bundle version");Qc.command("set [channelId] [appId]").alias("s").description("Set channel").action(bL).option("-a, --apikey <apikey>","apikey to link to your account").option("-b, --bundle <bundle>","bundle version number of the file to set").option("-s, --state <state>","set the state of the channel, default or normal").option("--latest","get the latest version key in the package.json to set it to the channel").option("--downgrade","Allow to downgrade to version under native one").option("--no-downgrade","Disable downgrade to version under native one").option("--upgrade","Allow to upgrade to version above native one").option("--no-upgrade","Disable upgrade to version above native one").option("--ios","Allow sending update to ios devices").option("--no-ios","Disable sending update to ios devices").option("--android","Allow sending update to android devices").option("--no-android","Disable sending update to android devices").option("--self-assign","Allow to device to self assign to this channel").option("--no-self-assign","Disable devices to self assign to this channel").option("--disable-auto-update <disableAutoUpdate>","Disable auto update strategy for this channel.The possible options are: major, minor, metadata, patch, none").option("--dev","Allow sending update to development devices").option("--no-dev","Disable sending update to development devices").option("--emulator","Allow sending update to emulator devices").option("--no-emulator","Disable sending update to emulator devices").option("--package-json <packageJson>","A path to package.json. Usefull for monorepos");var ZL=A.command("key_old").description("Manage old encryption key");ZL.command("save").description("Save base64 encryption key in capacitor config, usefull for CI").action(WL).option("-f, --force","force generate a new one").option("--key","key path to save in capacitor config").option("--key-data","key data to save in capacitor config");ZL.command("create").description("Create a new encryption key").action(KL).option("-f, --force","force generate a new one");var uw=A.command("key").description("Manage encryption key");uw.command("save").description("Save base64 encryption key in capacitor config, usefull for CI").action(LL).option("-f, --force","force generate a new one").option("--key","key path to save in capacitor config").option("--key-data","key data to save in capacitor config");uw.command("create").description("Create a new encryption key").action(BL).option("-f, --force","force generate a new one");uw.command("delete_old").description("Delete the old encryption key").action(qL);A.command("upload [appId]").alias("u").description("(Deprecated) Upload a new bundle to Capgo Cloud").action(sL).option("-a, --apikey <apikey>","apikey to link to your account").option("-p, --path <path>","path of the folder to upload").option("-c, --channel <channel>","channel to link to").option("-e, --external <url>","link to external url intead of upload to Capgo Cloud").option("--old-encryption","use old encryption").option("--key <key>","custom path for public signing key").option("--key-data <keyData>","public signing key").option("--bundle-url","prints bundle url into stdout").option("--no-key","ignore signing key and send clear update").option("--display-iv-session","Show in the console the iv and session key used to encrypt the update").option("-b, --bundle <bundle>","bundle version number of the file to upload").option("--min-update-version <minUpdateVersion>","Minimal version required to update to this version. Used only if the disable auto update is set to metadata in channel");var oce=A.command("account").description("Manage account");oce.command("id").description("Get your account ID").action(YL).option("-a, --apikey <apikey>","apikey to link to your account");A.parseAsync();
331
331
  /*! Bundled license information:
332
332
 
333
333
  safe-buffer/index.js: