@capgo/cli 7.0.17-beta.2 → 7.0.17-beta.3
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 +148 -148
- package/dist/package.json +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,83 +1,83 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
"use strict";var
|
|
3
|
-
`)}displayWidth(e){return
|
|
2
|
+
"use strict";var V8=Object.create;var Hl=Object.defineProperty;var z8=Object.getOwnPropertyDescriptor;var G8=Object.getOwnPropertyNames;var W8=Object.getPrototypeOf,K8=Object.prototype.hasOwnProperty;var Ct=(t,e)=>()=>(t&&(e=t(t=0)),e);var y=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),gi=(t,e)=>{for(var r in e)Hl(t,r,{get:e[r],enumerable:!0})},kb=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of G8(e))!K8.call(t,i)&&i!==r&&Hl(t,i,{get:()=>e[i],enumerable:!(n=z8(e,i))||n.enumerable});return t};var ue=(t,e,r)=>(r=t!=null?V8(W8(t)):{},kb(e||!t||!t.__esModule?Hl(r,"default",{value:t,enumerable:!0}):r,t)),je=t=>kb(Hl({},"__esModule",{value:!0}),t);var Aa=y(Yh=>{var Vl=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}},Kh=class extends Vl{constructor(e){super(1,"commander.invalidArgument",e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};Yh.CommanderError=Vl;Yh.InvalidArgumentError=Kh});var zl=y(Xh=>{var{InvalidArgumentError:Y8}=Aa(),Jh=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 Y8(`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 J8(t){let e=t.name()+(t.variadic===!0?"...":"");return t.required?"<"+e+">":"["+e+"]"}Xh.Argument=Jh;Xh.humanReadableArgName=J8});var ep=y(Qh=>{var{humanReadableArgName:X8}=zl(),Zh=class{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(e){this.helpWidth=this.helpWidth??e.helpWidth??80}visibleCommands(e){let r=e.commands.filter(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=>X8(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,this.displayWidth(r.styleSubcommandTerm(r.subcommandTerm(i)))),0)}longestOptionTermLength(e,r){return r.visibleOptions(e).reduce((n,i)=>Math.max(n,this.displayWidth(r.styleOptionTerm(r.optionTerm(i)))),0)}longestGlobalOptionTermLength(e,r){return r.visibleGlobalOptions(e).reduce((n,i)=>Math.max(n,this.displayWidth(r.styleOptionTerm(r.optionTerm(i)))),0)}longestArgumentTermLength(e,r){return r.visibleArguments(e).reduce((n,i)=>Math.max(n,this.displayWidth(r.styleArgumentTerm(r.argumentTerm(i)))),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;function o(f,h){return r.formatItem(f,n,h,r)}let s=[`${r.styleTitle("Usage:")} ${r.styleUsage(r.commandUsage(e))}`,""],a=r.commandDescription(e);a.length>0&&(s=s.concat([r.boxWrap(r.styleCommandDescription(a),i),""]));let u=r.visibleArguments(e).map(f=>o(r.styleArgumentTerm(r.argumentTerm(f)),r.styleArgumentDescription(r.argumentDescription(f))));u.length>0&&(s=s.concat([r.styleTitle("Arguments:"),...u,""]));let l=r.visibleOptions(e).map(f=>o(r.styleOptionTerm(r.optionTerm(f)),r.styleOptionDescription(r.optionDescription(f))));if(l.length>0&&(s=s.concat([r.styleTitle("Options:"),...l,""])),r.showGlobalOptions){let f=r.visibleGlobalOptions(e).map(h=>o(r.styleOptionTerm(r.optionTerm(h)),r.styleOptionDescription(r.optionDescription(h))));f.length>0&&(s=s.concat([r.styleTitle("Global Options:"),...f,""]))}let c=r.visibleCommands(e).map(f=>o(r.styleSubcommandTerm(r.subcommandTerm(f)),r.styleSubcommandDescription(r.subcommandDescription(f))));return c.length>0&&(s=s.concat([r.styleTitle("Commands:"),...c,""])),s.join(`
|
|
3
|
+
`)}displayWidth(e){return Tb(e).length}styleTitle(e){return e}styleUsage(e){return e.split(" ").map(r=>r==="[options]"?this.styleOptionText(r):r==="[command]"?this.styleSubcommandText(r):r[0]==="["||r[0]==="<"?this.styleArgumentText(r):this.styleCommandText(r)).join(" ")}styleCommandDescription(e){return this.styleDescriptionText(e)}styleOptionDescription(e){return this.styleDescriptionText(e)}styleSubcommandDescription(e){return this.styleDescriptionText(e)}styleArgumentDescription(e){return this.styleDescriptionText(e)}styleDescriptionText(e){return e}styleOptionTerm(e){return this.styleOptionText(e)}styleSubcommandTerm(e){return e.split(" ").map(r=>r==="[options]"?this.styleOptionText(r):r[0]==="["||r[0]==="<"?this.styleArgumentText(r):this.styleSubcommandText(r)).join(" ")}styleArgumentTerm(e){return this.styleArgumentText(e)}styleOptionText(e){return e}styleArgumentText(e){return e}styleSubcommandText(e){return e}styleCommandText(e){return e}padWidth(e,r){return Math.max(r.longestOptionTermLength(e,r),r.longestGlobalOptionTermLength(e,r),r.longestSubcommandTermLength(e,r),r.longestArgumentTermLength(e,r))}preformatted(e){return/\n[^\S\r\n]/.test(e)}formatItem(e,r,n,i){let s=" ".repeat(2);if(!n)return s+e;let a=e.padEnd(r+e.length-i.displayWidth(e)),u=2,c=(this.helpWidth??80)-r-u-2,f;return c<this.minWidthToWrap||i.preformatted(n)?f=n:f=i.boxWrap(n,c).replace(/\n/g,`
|
|
4
4
|
`+" ".repeat(r+u)),s+a+" ".repeat(u)+f.replace(/\n/g,`
|
|
5
5
|
${s}`)}boxWrap(e,r){if(r<this.minWidthToWrap)return e;let n=e.split(/\r\n|\n/),i=/[\s]*[^\s]+/g,o=[];return n.forEach(s=>{let a=s.match(i);if(a===null){o.push("");return}let u=[a.shift()],l=this.displayWidth(u[0]);a.forEach(c=>{let f=this.displayWidth(c);if(l+f<=r){u.push(c),l+=f;return}o.push(u.join(""));let h=c.trimStart();u=[h],l=this.displayWidth(h)}),o.push(u.join(""))}),o.join(`
|
|
6
|
-
`)}};function
|
|
6
|
+
`)}};function Tb(t){let e=/\x1b\[\d*(;\d*)*m/g;return t.replace(e,"")}Qh.Help=Zh;Qh.stripColor=Tb});var ip=y(np=>{var{InvalidArgumentError:Z8}=Aa(),tp=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=Q8(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 Z8(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(r,n):r},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return this.negate?Pb(this.name().replace(/^no-/,"")):Pb(this.name())}is(e){return this.short===e||this.long===e}isBoolean(){return!this.required&&!this.optional&&!this.negate}},rp=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 Pb(t){return t.split("-").reduce((e,r)=>e+r[0].toUpperCase()+r.slice(1))}function Q8(t){let e,r,n=/^-[^-]$/,i=/^--[^-]/,o=t.split(/[ |,]+/).concat("guard");if(n.test(o[0])&&(e=o.shift()),i.test(o[0])&&(r=o.shift()),/^-[^-][^-]/.test(o[0]))throw new Error(`invalid Option flags, short option is dash and single character: '${t}'`);if(e&&n.test(o[0]))throw new Error(`invalid Option flags, more than one short flag: '${t}'`);if(r&&i.test(o[0]))throw new Error(`invalid Option flags, more than one long flag: '${t}'`);if(!(e||r)||o[0].startsWith("-"))throw new Error(`invalid Option flags: '${t}'`);return{shortFlag:e,longFlag:r}}np.Option=tp;np.DualOptions=rp});var $b=y(Rb=>{function eN(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 tN(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=eN(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?`
|
|
7
7
|
(Did you mean one of ${n.join(", ")}?)`:n.length===1?`
|
|
8
|
-
(Did you mean ${n[0]}?)`:""}
|
|
9
|
-
- 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
|
|
10
|
-
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 sp(e,r,n)),De.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
|
|
11
|
-
- 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
|
|
8
|
+
(Did you mean ${n[0]}?)`:""}Rb.suggestSimilar=tN});var Lb=y(lp=>{var rN=require("node:events").EventEmitter,op=require("node:child_process"),cn=require("node:path"),Gl=require("node:fs"),De=require("node:process"),{Argument:nN,humanReadableArgName:iN}=zl(),{CommanderError:sp}=Aa(),{Help:oN,stripColor:sN}=ep(),{Option:Ib,DualOptions:aN}=ip(),{suggestSimilar:jb}=$b(),ap=class t extends rN{constructor(e){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!1,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=e||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._savedState=null,this._outputConfiguration={writeOut:r=>De.stdout.write(r),writeErr:r=>De.stderr.write(r),outputError:(r,n)=>n(r),getOutHelpWidth:()=>De.stdout.isTTY?De.stdout.columns:void 0,getErrHelpWidth:()=>De.stderr.isTTY?De.stderr.columns:void 0,getOutHasColors:()=>up()??(De.stdout.isTTY&&De.stdout.hasColors?.()),getErrHasColors:()=>up()??(De.stderr.isTTY&&De.stderr.hasColors?.()),stripColor:r=>sN(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 oN,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
|
|
9
|
+
- 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 nN(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}'.
|
|
10
|
+
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 sp(e,r,n)),De.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 Ib(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}'
|
|
11
|
+
- 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 Ib)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,l)=>{let c=a.exec(u);return c?c[0]:l},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){De.versions?.electron&&(r.from="electron");let i=De.execArgv??[];(i.includes("-e")||i.includes("--eval")||i.includes("-p")||i.includes("--print"))&&(r.from="eval")}e===void 0&&(e=De.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":De.defaultApp?(this._scriptPath=e[1],n=e.slice(2)):n=e.slice(1);break;case"user":n=e.slice(0);break;case"eval":n=e.slice(1);break;default:throw new Error(`unexpected parse option { from: '${r.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||"program",n}parse(e,r){this._prepareForParse();let n=this._prepareUserArgs(e,r);return this._parseCommand([],n),this}async parseAsync(e,r){this._prepareForParse();let n=this._prepareUserArgs(e,r);return await this._parseCommand([],n),this}_prepareForParse(){this._savedState===null?this.saveStateBeforeParse():this.restoreStateBeforeParse()}saveStateBeforeParse(){this._savedState={_name:this._name,_optionValues:{...this._optionValues},_optionValueSources:{...this._optionValueSources}}}restoreStateBeforeParse(){if(this._storeOptionsAsProperties)throw new Error(`Can not call parse again when storeOptionsAsProperties is true.
|
|
12
12
|
- either make a new Command for each call to parse, or stop storing options as properties`);this._name=this._savedState._name,this._scriptPath=null,this.rawArgs=[],this._optionValues={...this._savedState._optionValues},this._optionValueSources={...this._savedState._optionValueSources},this.args=[],this.processedArgs=[]}_checkForMissingExecutable(e,r,n){if(Gl.existsSync(e))return;let i=r?`searched for local subcommand relative to directory '${r}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",o=`'${e}' does not exist
|
|
13
13
|
- if '${n}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
|
|
14
14
|
- if the default executable name is not suitable, use the executableFile option to supply a custom name or path
|
|
15
|
-
- ${i}`;throw new Error(o)}_executeSubCommand(e,r){r=r.slice();let n=!1,i=[".js",".ts",".tsx",".mjs",".cjs"];function o(c,f){let h=cn.resolve(c,f);if(Gl.existsSync(h))return h;if(i.includes(cn.extname(f)))return;let d=i.find(m=>Gl.existsSync(`${h}${m}`));if(d)return`${h}${d}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let s=e._executableFile||`${this._name}-${e._name}`,a=this._executableDir||"";if(this._scriptPath){let c;try{c=Gl.realpathSync(this._scriptPath)}catch{c=this._scriptPath}a=cn.resolve(cn.dirname(c),a)}if(a){let c=o(a,s);if(!c&&!e._executableFile&&this._scriptPath){let f=cn.basename(this._scriptPath,cn.extname(this._scriptPath));f!==this._name&&(c=o(a,`${f}-${e._name}`))}s=c||s}n=i.includes(cn.extname(s));let u;De.platform!=="win32"?n?(r.unshift(s),r=
|
|
15
|
+
- ${i}`;throw new Error(o)}_executeSubCommand(e,r){r=r.slice();let n=!1,i=[".js",".ts",".tsx",".mjs",".cjs"];function o(c,f){let h=cn.resolve(c,f);if(Gl.existsSync(h))return h;if(i.includes(cn.extname(f)))return;let d=i.find(m=>Gl.existsSync(`${h}${m}`));if(d)return`${h}${d}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let s=e._executableFile||`${this._name}-${e._name}`,a=this._executableDir||"";if(this._scriptPath){let c;try{c=Gl.realpathSync(this._scriptPath)}catch{c=this._scriptPath}a=cn.resolve(cn.dirname(c),a)}if(a){let c=o(a,s);if(!c&&!e._executableFile&&this._scriptPath){let f=cn.basename(this._scriptPath,cn.extname(this._scriptPath));f!==this._name&&(c=o(a,`${f}-${e._name}`))}s=c||s}n=i.includes(cn.extname(s));let u;De.platform!=="win32"?n?(r.unshift(s),r=Nb(De.execArgv).concat(r),u=op.spawn(De.argv[0],r,{stdio:"inherit"})):u=op.spawn(s,r,{stdio:"inherit"}):(this._checkForMissingExecutable(s,a,e._name),r.unshift(s),r=Nb(De.execArgv).concat(r),u=op.spawn(De.execPath,r,{stdio:"inherit"})),u.killed||["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(f=>{De.on(f,()=>{u.killed===!1&&u.exitCode===null&&u.kill(f)})});let l=this._exitCallback;u.on("close",c=>{c=c??1,l?l(new sp(c,"commander.executeSubCommandAsync","(close)")):De.exit(c)}),u.on("error",c=>{if(c.code==="ENOENT")this._checkForMissingExecutable(s,a,e._name);else if(c.code==="EACCES")throw new Error(`'${s}' not executable`);if(!l)De.exit(1);else{let f=new sp(1,"commander.executeSubCommandAsync","(error)");f.nestedError=c,l(f)}}),this.runningCommand=u}_dispatchSubcommand(e,r,n){let i=this._findCommand(e);i||this.help({error:!0}),i._prepareForParse();let o;return o=this._chainOrCallSubCommandHook(o,i,"preSubcommand"),o=this._chainOrCall(o,()=>{if(i._executableHandler)this._executeSubCommand(i,r.concat(n));else return i._parseCommand(r,n)}),o}_dispatchHelpCommand(e){e||this.help();let r=this._findCommand(e);return r&&!r._executableHandler&&r.help(),this._dispatchSubcommand(e,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){this.registeredArguments.forEach((e,r)=>{e.required&&this.args[r]==null&&this.missingArgument(e.name())}),!(this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)&&this.args.length>this.registeredArguments.length&&this._excessArguments(this.args)}_processArguments(){let e=(n,i,o)=>{let s=i;if(i!==null&&n.parseArg){let a=`error: command-argument value '${i}' is invalid for argument '${n.name()}'.`;s=this._callParseArg(n,i,o,a)}return s};this._checkNumberOfArguments();let r=[];this.registeredArguments.forEach((n,i)=>{let o=n.defaultValue;n.variadic?i<this.args.length?(o=this.args.slice(i),n.parseArg&&(o=o.reduce((s,a)=>e(n,a,s),n.defaultValue))):o===void 0&&(o=[]):i<this.args.length&&(o=this.args[i],n.parseArg&&(o=e(n,o,n.defaultValue))),r[i]=o}),this.processedArgs=r}_chainOrCall(e,r){return e&&e.then&&typeof e.then=="function"?e.then(()=>r()):r()}_chainOrCallHooks(e,r){let n=e,i=[];return this._getCommandAndAncestors().reverse().filter(o=>o._lifeCycleHooks[r]!==void 0).forEach(o=>{o._lifeCycleHooks[r].forEach(s=>{i.push({hookedCommand:o,callback:s})})}),r==="postAction"&&i.reverse(),i.forEach(o=>{n=this._chainOrCall(n,()=>o.callback(o.hookedCommand,this))}),n}_chainOrCallSubCommandHook(e,r,n){let i=e;return this._lifeCycleHooks[n]!==void 0&&this._lifeCycleHooks[n].forEach(o=>{i=this._chainOrCall(i,()=>o(this,r))}),i}_parseCommand(e,r){let n=this.parseOptions(r);if(this._parseOptionsEnv(),this._parseOptionsImplied(),e=e.concat(n.operands),r=n.unknown,this.args=e.concat(r),e&&this._findCommand(e[0]))return this._dispatchSubcommand(e[0],e.slice(1),r);if(this._getHelpCommand()&&e[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(e[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(r),this._dispatchSubcommand(this._defaultCommandName,e,r);this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName&&this.help({error:!0}),this._outputHelpIfRequested(n.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let i=()=>{n.unknown.length>0&&this.unknownOption(n.unknown[0])},o=`command:${this.name()}`;if(this._actionHandler){i(),this._processArguments();let s;return s=this._chainOrCallHooks(s,"preAction"),s=this._chainOrCall(s,()=>this._actionHandler(this.processedArgs)),this.parent&&(s=this._chainOrCall(s,()=>{this.parent.emit(o,e,r)})),s=this._chainOrCallHooks(s,"postAction"),s}if(this.parent&&this.parent.listenerCount(o))i(),this._processArguments(),this.parent.emit(o,e,r);else if(e.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",e,r);this.listenerCount("command:*")?this.emit("command:*",e,r):this.commands.length?this.unknownCommand():(i(),this._processArguments())}else this.commands.length?(i(),this.help({error:!0})):(i(),this._processArguments())}_findCommand(e){if(e)return this.commands.find(r=>r._name===e||r._aliases.includes(e))}_findOption(e){return this.options.find(r=>r.is(e))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(e=>{e.options.forEach(r=>{r.mandatory&&e.getOptionValue(r.attributeName())===void 0&&e.missingMandatoryOptionValue(r)})})}_checkForConflictingLocalOptions(){let e=this.options.filter(n=>{let i=n.attributeName();return this.getOptionValue(i)===void 0?!1:this.getOptionValueSource(i)!=="default"});e.filter(n=>n.conflictsWith.length>0).forEach(n=>{let i=e.find(o=>n.conflictsWith.includes(o.attributeName()));i&&this._conflictingOption(n,i)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(e=>{e._checkForConflictingLocalOptions()})}parseOptions(e){let r=[],n=[],i=r,o=e.slice();function s(u){return u.length>1&&u[0]==="-"}let a=null;for(;o.length;){let u=o.shift();if(u==="--"){i===n&&i.push(u),i.push(...o);break}if(a&&!s(u)){this.emit(`option:${a.name()}`,u);continue}if(a=null,s(u)){let l=this._findOption(u);if(l){if(l.required){let c=o.shift();c===void 0&&this.optionMissingArgument(l),this.emit(`option:${l.name()}`,c)}else if(l.optional){let c=null;o.length>0&&!s(o[0])&&(c=o.shift()),this.emit(`option:${l.name()}`,c)}else this.emit(`option:${l.name()}`);a=l.variadic?l:null;continue}}if(u.length>2&&u[0]==="-"&&u[1]!=="-"){let l=this._findOption(`-${u[1]}`);if(l){l.required||l.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${l.name()}`,u.slice(2)):(this.emit(`option:${l.name()}`),o.unshift(`-${u.slice(2)}`));continue}}if(/^--[^=]+=/.test(u)){let l=u.indexOf("="),c=this._findOption(u.slice(0,l));if(c&&(c.required||c.optional)){this.emit(`option:${c.name()}`,u.slice(l+1));continue}}if(s(u)&&(i=n),(this._enablePositionalOptions||this._passThroughOptions)&&r.length===0&&n.length===0){if(this._findCommand(u)){r.push(u),o.length>0&&n.push(...o);break}else if(this._getHelpCommand()&&u===this._getHelpCommand().name()){r.push(u),o.length>0&&r.push(...o);break}else if(this._defaultCommandName){n.push(u),o.length>0&&n.push(...o);break}}if(this._passThroughOptions){i.push(u),o.length>0&&i.push(...o);break}i.push(u)}return{operands:r,unknown:n}}opts(){if(this._storeOptionsAsProperties){let e={},r=this.options.length;for(let n=0;n<r;n++){let i=this.options[n].attributeName();e[i]=i===this._versionOptionName?this._version:this[i]}return e}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((e,r)=>Object.assign(e,r.opts()),{})}error(e,r){this._outputConfiguration.outputError(`${e}
|
|
16
16
|
`,this._outputConfiguration.writeErr),typeof this._showHelpAfterError=="string"?this._outputConfiguration.writeErr(`${this._showHelpAfterError}
|
|
17
17
|
`):this._showHelpAfterError&&(this._outputConfiguration.writeErr(`
|
|
18
|
-
`),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 De.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()}`,De.env[e.envVar]):this.emit(`optionEnv:${e.name()}`))}})}_parseOptionsImplied(){let e=new
|
|
19
|
-
`),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=>
|
|
18
|
+
`),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 De.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()}`,De.env[e.envVar]):this.emit(`optionEnv:${e.name()}`))}})}_parseOptionsImplied(){let e=new aN(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),l=this.options.find(f=>f.negate&&a===f.attributeName()),c=this.options.find(f=>!f.negate&&a===f.attributeName());return l&&(l.presetArg===void 0&&u===!1||l.presetArg!==void 0&&u===l.presetArg)?l:c||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=jb(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=jb(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}
|
|
19
|
+
`),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=>iN(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=cn.basename(e,cn.extname(e)),this}executableDir(e){return e===void 0?this._executableDir:(this._executableDir=e,this)}helpInformation(e){let r=this.createHelp(),n=this._getOutputContext(e);r.prepareContext({error:n.error,helpWidth:n.helpWidth,outputHasColors:n.hasColors});let i=r.formatHelp(this,r);return n.hasColors?i:this._outputConfiguration.stripColor(i)}_getOutputContext(e){e=e||{};let r=!!e.error,n,i,o;return r?(n=a=>this._outputConfiguration.writeErr(a),i=this._outputConfiguration.getErrHasColors(),o=this._outputConfiguration.getErrHelpWidth()):(n=a=>this._outputConfiguration.writeOut(a),i=this._outputConfiguration.getOutHasColors(),o=this._outputConfiguration.getOutHelpWidth()),{error:r,write:a=>(i||(a=this._outputConfiguration.stripColor(a)),n(a)),hasColors:i,helpWidth:o}}outputHelp(e){let r;typeof e=="function"&&(r=e,e=void 0);let n=this._getOutputContext(e),i={error:n.error,write:n.write,command:this};this._getCommandAndAncestors().reverse().forEach(s=>s.emit("beforeAllHelp",i)),this.emit("beforeHelp",i);let o=this.helpInformation({error:n.error});if(r&&(o=r(o),typeof o!="string"&&!Buffer.isBuffer(o)))throw new Error("outputHelp callback must return a string or a Buffer");n.write(o),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit("afterHelp",i),this._getCommandAndAncestors().forEach(s=>s.emit("afterAllHelp",i))}helpOption(e,r){return typeof e=="boolean"?(e?this._helpOption=this._helpOption??void 0:this._helpOption=null,this):(e=e??"-h, --help",r=r??"display help for command",this._helpOption=this.createOption(e,r),this)}_getHelpOption(){return this._helpOption===void 0&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(e){return this._helpOption=e,this}help(e){this.outputHelp(e);let r=Number(De.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.
|
|
20
20
|
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}
|
|
21
|
-
`)}),this}_outputHelpIfRequested(e){let r=this._getHelpOption();r&&e.find(i=>r.is(i))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function jb(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})}function up(){if(De.env.NO_COLOR||De.env.FORCE_COLOR==="0"||De.env.FORCE_COLOR==="false")return!1;if(De.env.FORCE_COLOR||De.env.CLICOLOR_FORCE!==void 0)return!0}lp.Command=ap;lp.useColor=up});var Mb=y(lr=>{var{Argument:Lb}=zl(),{Command:cp}=Nb(),{CommanderError:aN,InvalidArgumentError:Bb}=Aa(),{Help:uN}=ep(),{Option:qb}=ip();lr.program=new cp;lr.createCommand=t=>new cp(t);lr.createOption=(t,e)=>new qb(t,e);lr.createArgument=(t,e)=>new Lb(t,e);lr.Command=cp;lr.Option=qb;lr.Argument=Lb;lr.Help=uN;lr.CommanderError=aN;lr.InvalidArgumentError=Bb;lr.InvalidOptionArgumentError=Bb});var Te=y((vse,Hb)=>{"use strict";var fp="\x1B",Me=`${fp}[`,cN="\x07",dp={to(t,e){return e?`${Me}${e+1};${t+1}H`:`${Me}${t+1}G`},move(t,e){let r="";return t<0?r+=`${Me}${-t}D`:t>0&&(r+=`${Me}${t}C`),e<0?r+=`${Me}${-e}A`:e>0&&(r+=`${Me}${e}B`),r},up:(t=1)=>`${Me}${t}A`,down:(t=1)=>`${Me}${t}B`,forward:(t=1)=>`${Me}${t}C`,backward:(t=1)=>`${Me}${t}D`,nextLine:(t=1)=>`${Me}E`.repeat(t),prevLine:(t=1)=>`${Me}F`.repeat(t),left:`${Me}G`,hide:`${Me}?25l`,show:`${Me}?25h`,save:`${fp}7`,restore:`${fp}8`},fN={up:(t=1)=>`${Me}S`.repeat(t),down:(t=1)=>`${Me}T`.repeat(t)},dN={screen:`${Me}2J`,up:(t=1)=>`${Me}1J`.repeat(t),down:(t=1)=>`${Me}J`.repeat(t),line:`${Me}2K`,lineEnd:`${Me}K`,lineStart:`${Me}1K`,lines(t){let e="";for(let r=0;r<t;r++)e+=this.line+(r<t-1?dp.up():"");return t&&(e+=dp.left),e}};Hb.exports={cursor:dp,scroll:fN,erase:dN,beep:cN}});var pp=y((bse,hp)=>{var Kl=process||{},Vb=Kl.argv||[],Wl=Kl.env||{},hN=!(Wl.NO_COLOR||Vb.includes("--no-color"))&&(!!Wl.FORCE_COLOR||Vb.includes("--color")||Kl.platform==="win32"||(Kl.stdout||{}).isTTY&&Wl.TERM!=="dumb"||!!Wl.CI),pN=(t,e,r=t)=>n=>{let i=""+n,o=i.indexOf(e,t.length);return~o?t+mN(i,e,r,o)+e:t+i+e},mN=(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)},zb=(t=hN)=>{let e=t?pN:()=>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")}};hp.exports=zb();hp.exports.createColors=zb});var ic=y(Bt=>{"use strict";Object.defineProperty(Bt,"__esModule",{value:!0});Bt.isNXMonorepo=Bt.isMonorepo=Bt.findPackageRelativePathInMonorepo=Bt.findPackagePath=Bt.findNXMonorepoRoot=Bt.findMonorepoRoot=void 0;var Pa=require("node:fs"),Bn=require("node:path");function nc(t){let e=(0,Bn.join)(t,"package.json"),r=(0,Bn.join)(t,"pnpm-workspace.yaml");if((0,Pa.existsSync)(r)||(0,Pa.existsSync)(e)&&JSON.parse((0,Pa.readFileSync)(e,"utf-8")).workspaces)return t;let n=(0,Bn.dirname)(t);if(n===t)throw new Error("Monorepo root not found");return nc(n)}Bt.findMonorepoRoot=nc;function Fp(t){let e=(0,Bn.join)(t,"nx.json");if((0,Pa.existsSync)(e))return t;let r=(0,Bn.dirname)(t);if(r===t)throw new Error("Monorepo root not found");return Fp(r)}Bt.findNXMonorepoRoot=Fp;function Op(t,e,r){let n=(0,Bn.join)(e,"node_modules",t);if((0,Pa.existsSync)(n))return n;if(e===r)return null;let i=(0,Bn.dirname)(e);return Op(t,i,r)}Bt.findPackagePath=Op;function GN(t,e){let r=nc(e),n=Op(t,e,r);return n?(0,Bn.relative)(e,n):null}Bt.findPackageRelativePathInMonorepo=GN;function WN(t){try{return nc(t),!0}catch{return!1}}Bt.isMonorepo=WN;function KN(t){try{return Fp(t),!0}catch{return!1}}Bt.isNXMonorepo=KN});var vi={};gi(vi,{default:()=>YN});var YN,bi=Ct(()=>{YN={}});var cw=y(Pr=>{"use strict";var JN=Pr&&Pr.__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]}),XN=Pr&&Pr.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),ZN=Pr&&Pr.__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)&&JN(e,t,r);return XN(e,t),e};Object.defineProperty(Pr,"__esModule",{value:!0});Pr.resolveFetch=void 0;var QN=t=>{let e;return t?e=t:typeof fetch>"u"?e=(...r)=>Promise.resolve().then(()=>ZN((bi(),je(vi)))).then(({default:n})=>n(...r)):e=fetch,(...r)=>e(...r)};Pr.resolveFetch=QN});var Pp=y(er=>{"use strict";Object.defineProperty(er,"__esModule",{value:!0});er.FunctionRegion=er.FunctionsHttpError=er.FunctionsRelayError=er.FunctionsFetchError=er.FunctionsError=void 0;var No=class extends Error{constructor(e,r="FunctionsError",n){super(e),this.name=r,this.context=n}};er.FunctionsError=No;var Ap=class extends No{constructor(e){super("Failed to send a request to the Edge Function","FunctionsFetchError",e)}};er.FunctionsFetchError=Ap;var kp=class extends No{constructor(e){super("Relay Error invoking the Edge Function","FunctionsRelayError",e)}};er.FunctionsRelayError=kp;var Tp=class extends No{constructor(e){super("Edge Function returned a non-2xx status code","FunctionsHttpError",e)}};er.FunctionsHttpError=Tp;var eL;(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"})(eL=er.FunctionRegion||(er.FunctionRegion={}))});var fw=y(Lo=>{"use strict";var tL=Lo&&Lo.__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(c){try{l(n.next(c))}catch(f){s(f)}}function u(c){try{l(n.throw(c))}catch(f){s(f)}}function l(c){c.done?o(c.value):i(c.value).then(a,u)}l((n=n.apply(t,e||[])).next())})};Object.defineProperty(Lo,"__esModule",{value:!0});Lo.FunctionsClient=void 0;var rL=cw(),sc=Pp(),Rp=class{constructor(e,{headers:r={},customFetch:n,region:i=sc.FunctionRegion.Any}={}){this.url=e,this.headers=r,this.region=i,this.fetch=(0,rL.resolveFetch)(n)}setAuth(e){this.headers.Authorization=`Bearer ${e}`}invoke(e,r={}){var n;return tL(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 l;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",l=s):typeof s=="string"?(a["Content-Type"]="text/plain",l=s):typeof FormData<"u"&&s instanceof FormData?l=s:(a["Content-Type"]="application/json",l=JSON.stringify(s)));let c=yield this.fetch(`${this.url}/${e}`,{method:o||"POST",headers:Object.assign(Object.assign(Object.assign({},a),this.headers),i),body:l}).catch(m=>{throw new sc.FunctionsFetchError(m)}),f=c.headers.get("x-relay-error");if(f&&f==="true")throw new sc.FunctionsRelayError(c);if(!c.ok)throw new sc.FunctionsHttpError(c);let h=((n=c.headers.get("Content-Type"))!==null&&n!==void 0?n:"text/plain").split(";")[0].trim(),d;return h==="application/json"?d=yield c.json():h==="application/octet-stream"?d=yield c.blob():h==="text/event-stream"?d=c:h==="multipart/form-data"?d=yield c.formData():d=yield c.text(),{data:d,error:null}}catch(i){return{data:null,error:i}}})}};Lo.FunctionsClient=Rp});var $p=y(qt=>{"use strict";Object.defineProperty(qt,"__esModule",{value:!0});qt.FunctionRegion=qt.FunctionsRelayError=qt.FunctionsHttpError=qt.FunctionsFetchError=qt.FunctionsError=qt.FunctionsClient=void 0;var nL=fw();Object.defineProperty(qt,"FunctionsClient",{enumerable:!0,get:function(){return nL.FunctionsClient}});var $a=Pp();Object.defineProperty(qt,"FunctionsError",{enumerable:!0,get:function(){return $a.FunctionsError}});Object.defineProperty(qt,"FunctionsFetchError",{enumerable:!0,get:function(){return $a.FunctionsFetchError}});Object.defineProperty(qt,"FunctionsHttpError",{enumerable:!0,get:function(){return $a.FunctionsHttpError}});Object.defineProperty(qt,"FunctionsRelayError",{enumerable:!0,get:function(){return $a.FunctionsRelayError}});Object.defineProperty(qt,"FunctionRegion",{enumerable:!0,get:function(){return $a.FunctionRegion}})});var Np=y(jp=>{"use strict";Object.defineProperty(jp,"__esModule",{value:!0});var Ip=class extends Error{constructor(e){super(e.message),this.name="PostgrestError",this.details=e.details,this.hint=e.hint,this.code=e.code}};jp.default=Ip});var Bp=y(Ia=>{"use strict";var dw=Ia&&Ia.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ia,"__esModule",{value:!0});var iL=dw((bi(),je(vi))),oL=dw(Np()),Lp=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=iL.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 l=null,c=null,f=null,h=o.status,d=o.statusText;if(o.ok){if(this.method!=="HEAD"){let _=await o.text();_===""||(this.headers.Accept==="text/csv"||this.headers.Accept&&this.headers.Accept.includes("application/vnd.pgrst.plan+text")?c=_:c=JSON.parse(_))}let b=(s=this.headers.Prefer)===null||s===void 0?void 0:s.match(/count=(exact|planned|estimated)/),D=(a=o.headers.get("content-range"))===null||a===void 0?void 0:a.split("/");b&&D&&D.length>1&&(f=parseInt(D[1])),this.isMaybeSingle&&this.method==="GET"&&Array.isArray(c)&&(c.length>1?(l={code:"PGRST116",details:`Results contain ${c.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},c=null,f=null,h=406,d="Not Acceptable"):c.length===1?c=c[0]:c=null)}else{let b=await o.text();try{l=JSON.parse(b),Array.isArray(l)&&o.status===404&&(c=[],l=null,h=200,d="OK")}catch{o.status===404&&b===""?(h=204,d="No Content"):l={message:b}}if(l&&this.isMaybeSingle&&(!((u=l?.details)===null||u===void 0)&&u.includes("0 rows"))&&(l=null,h=200,d="OK"),l&&this.shouldThrowOnError)throw new oL.default(l)}return{error:l,data:c,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)}};Ia.default=Lp});var Mp=y(ja=>{"use strict";var sL=ja&&ja.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ja,"__esModule",{value:!0});var aL=sL(Bp()),qp=class extends aL.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("|"),l=(a=this.headers.Accept)!==null&&a!==void 0?a:"application/json";return this.headers.Accept=`application/vnd.pgrst.plan+${s}; for="${l}"; 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}};ja.default=qp});var ac=y(Na=>{"use strict";var uL=Na&&Na.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Na,"__esModule",{value:!0});var lL=uL(Mp()),Up=class extends lL.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}};Na.default=Up});var Vp=y(Ba=>{"use strict";var cL=Ba&&Ba.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ba,"__esModule",{value:!0});var La=cL(ac()),Hp=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 La.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 La.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((l,c)=>l.concat(Object.keys(c)),[]);if(u.length>0){let l=[...new Set(u)].map(c=>`"${c}"`);this.url.searchParams.set("columns",l.join(","))}}return new La.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 La.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 La.default({method:r,url:this.url,headers:this.headers,schema:this.schema,fetch:this.fetch,allowEmpty:!1})}};Ba.default=Hp});var hw=y(uc=>{"use strict";Object.defineProperty(uc,"__esModule",{value:!0});uc.version=void 0;uc.version="0.0.0-automated"});var pw=y(lc=>{"use strict";Object.defineProperty(lc,"__esModule",{value:!0});lc.DEFAULT_HEADERS=void 0;var fL=hw();lc.DEFAULT_HEADERS={"X-Client-Info":`postgrest-js/${fL.version}`}});var gw=y(qa=>{"use strict";var mw=qa&&qa.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(qa,"__esModule",{value:!0});var dL=mw(Vp()),hL=mw(ac()),pL=pw(),zp=class t{constructor(e,{headers:r={},schema:n,fetch:i}={}){this.url=e,this.headers=Object.assign(Object.assign({},pL.DEFAULT_HEADERS),r),this.schemaName=n,this.fetch=i}from(e){let r=new URL(`${this.url}/${e}`);return new dL.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(([c,f])=>f!==void 0).map(([c,f])=>[c,Array.isArray(f)?`{${f.join(",")}}`:`${f}`]).forEach(([c,f])=>{a.searchParams.append(c,f)})):(s="POST",u=r);let l=Object.assign({},this.headers);return o&&(l.Prefer=`count=${o}`),new hL.default({method:s,url:a,headers:l,schema:this.schemaName,body:u,fetch:this.fetch,allowEmpty:!1})}};qa.default=zp});var Gp=y(Dt=>{"use strict";var Bo=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 yw=Bo(gw());Dt.PostgrestClient=yw.default;var Dw=Bo(Vp());Dt.PostgrestQueryBuilder=Dw.default;var vw=Bo(ac());Dt.PostgrestFilterBuilder=vw.default;var bw=Bo(Mp());Dt.PostgrestTransformBuilder=bw.default;var ww=Bo(Bp());Dt.PostgrestBuilder=ww.default;var _w=Bo(Np());Dt.PostgrestError=_w.default;Dt.default={PostgrestClient:yw.default,PostgrestQueryBuilder:Dw.default,PostgrestFilterBuilder:vw.default,PostgrestTransformBuilder:bw.default,PostgrestBuilder:ww.default,PostgrestError:_w.default}});var Kp={};gi(Kp,{RealtimeClient:()=>Wp});var Wp,Yp=Ct(()=>{Wp=class{constructor(){}connect(){}disconnect(){}}});var Ua=y(Rr=>{"use strict";Object.defineProperty(Rr,"__esModule",{value:!0});Rr.StorageUnknownError=Rr.StorageApiError=Rr.isStorageError=Rr.StorageError=void 0;var Ma=class extends Error{constructor(e){super(e),this.__isStorageError=!0,this.name="StorageError"}};Rr.StorageError=Ma;function mL(t){return typeof t=="object"&&t!==null&&"__isStorageError"in t}Rr.isStorageError=mL;var Jp=class extends Ma{constructor(e,r){super(e),this.name="StorageApiError",this.status=r}toJSON(){return{name:this.name,message:this.message,status:this.status}}};Rr.StorageApiError=Jp;var Xp=class extends Ma{constructor(e,r){super(e),this.name="StorageUnknownError",this.originalError=r}};Rr.StorageUnknownError=Xp});var cc=y(ut=>{"use strict";var gL=ut&&ut.__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]}),yL=ut&&ut.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Ew=ut&&ut.__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)&&gL(e,t,r);return yL(e,t),e},DL=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(c){try{l(n.next(c))}catch(f){s(f)}}function u(c){try{l(n.throw(c))}catch(f){s(f)}}function l(c){c.done?o(c.value):i(c.value).then(a,u)}l((n=n.apply(t,e||[])).next())})};Object.defineProperty(ut,"__esModule",{value:!0});ut.recursiveToCamel=ut.resolveResponse=ut.resolveFetch=void 0;var vL=t=>{let e;return t?e=t:typeof fetch>"u"?e=(...r)=>Promise.resolve().then(()=>Ew((bi(),je(vi)))).then(({default:n})=>n(...r)):e=fetch,(...r)=>e(...r)};ut.resolveFetch=vL;var bL=()=>DL(void 0,void 0,void 0,function*(){return typeof Response>"u"?(yield Promise.resolve().then(()=>Ew((bi(),je(vi))))).Response:Response});ut.resolveResponse=bL;var wL=t=>{if(Array.isArray(t))return t.map(r=>(0,ut.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,ut.recursiveToCamel)(n)}),e};ut.recursiveToCamel=wL});var em=y(Mt=>{"use strict";var wi=Mt&&Mt.__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(c){try{l(n.next(c))}catch(f){s(f)}}function u(c){try{l(n.throw(c))}catch(f){s(f)}}function l(c){c.done?o(c.value):i(c.value).then(a,u)}l((n=n.apply(t,e||[])).next())})};Object.defineProperty(Mt,"__esModule",{value:!0});Mt.remove=Mt.head=Mt.put=Mt.post=Mt.get=void 0;var Zp=Ua(),_L=cc(),Qp=t=>t.msg||t.message||t.error_description||t.error||JSON.stringify(t),EL=(t,e,r)=>wi(void 0,void 0,void 0,function*(){let n=yield(0,_L.resolveResponse)();t instanceof n&&!r?.noResolveJson?t.json().then(i=>{e(new Zp.StorageApiError(Qp(i),t.status||500))}).catch(i=>{e(new Zp.StorageUnknownError(Qp(i),i))}):e(new Zp.StorageUnknownError(Qp(t),t))}),CL=(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 Ha(t,e,r,n,i,o){return wi(this,void 0,void 0,function*(){return new Promise((s,a)=>{t(r,CL(e,n,i,o)).then(u=>{if(!u.ok)throw u;return n?.noResolveJson?u:u.json()}).then(u=>s(u)).catch(u=>EL(u,a,n))})})}function SL(t,e,r,n){return wi(this,void 0,void 0,function*(){return Ha(t,"GET",e,r,n)})}Mt.get=SL;function xL(t,e,r,n,i){return wi(this,void 0,void 0,function*(){return Ha(t,"POST",e,n,i,r)})}Mt.post=xL;function FL(t,e,r,n,i){return wi(this,void 0,void 0,function*(){return Ha(t,"PUT",e,n,i,r)})}Mt.put=FL;function OL(t,e,r,n){return wi(this,void 0,void 0,function*(){return Ha(t,"HEAD",e,Object.assign(Object.assign({},r),{noResolveJson:!0}),n)})}Mt.head=OL;function AL(t,e,r,n,i){return wi(this,void 0,void 0,function*(){return Ha(t,"DELETE",e,n,i,r)})}Mt.remove=AL});var xw=y(Va=>{"use strict";var Ut=Va&&Va.__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(c){try{l(n.next(c))}catch(f){s(f)}}function u(c){try{l(n.throw(c))}catch(f){s(f)}}function l(c){c.done?o(c.value):i(c.value).then(a,u)}l((n=n.apply(t,e||[])).next())})};Object.defineProperty(Va,"__esModule",{value:!0});var Ht=Ua(),$r=em(),Cw=cc(),kL={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},Sw={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1},tm=class{constructor(e,r={},n,i){this.url=e,this.headers=r,this.bucketId=n,this.fetch=(0,Cw.resolveFetch)(i)}uploadOrUpdate(e,r,n,i){return Ut(this,void 0,void 0,function*(){try{let o,s=Object.assign(Object.assign({},Sw),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 l=this._removeEmptyFolders(r),c=this._getFinalPath(l),f=yield this.fetch(`${this.url}/object/${c}`,Object.assign({method:e,body:o,headers:a},s?.duplex?{duplex:s.duplex}:{})),h=yield f.json();return f.ok?{data:{path:l,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 Ut(this,void 0,void 0,function*(){return this.uploadOrUpdate("POST",e,r,n)})}uploadToSignedUrl(e,r,n,i){return Ut(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,l=Object.assign({upsert:Sw.upsert},i),c=Object.assign(Object.assign({},this.headers),{"x-upsert":String(l.upsert)});typeof Blob<"u"&&n instanceof Blob?(u=new FormData,u.append("cacheControl",l.cacheControl),u.append("",n)):typeof FormData<"u"&&n instanceof FormData?(u=n,u.append("cacheControl",l.cacheControl)):(u=n,c["cache-control"]=`max-age=${l.cacheControl}`,c["content-type"]=l.contentType);let f=yield this.fetch(a.toString(),{method:"PUT",body:u,headers:c}),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 Ut(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,$r.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 Ut(this,void 0,void 0,function*(){return this.uploadOrUpdate("PUT",e,r,n)})}move(e,r,n){return Ut(this,void 0,void 0,function*(){try{return{data:yield(0,$r.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 Ut(this,void 0,void 0,function*(){try{return{data:{path:(yield(0,$r.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 Ut(this,void 0,void 0,function*(){try{let i=this._getFinalPath(e),o=yield(0,$r.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 Ut(this,void 0,void 0,function*(){try{let i=yield(0,$r.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 Ut(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,$r.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 Ut(this,void 0,void 0,function*(){let r=this._getFinalPath(e);try{let n=yield(0,$r.get)(this.fetch,`${this.url}/object/info/${r}`,{headers:this.headers});return{data:(0,Cw.recursiveToCamel)(n),error:null}}catch(n){if((0,Ht.isStorageError)(n))return{data:null,error:n};throw n}})}exists(e){return Ut(this,void 0,void 0,function*(){let r=this._getFinalPath(e);try{return yield(0,$r.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 l=i.join("&");return l!==""&&(l=`?${l}`),{data:{publicUrl:encodeURI(`${this.url}/${a}/public/${n}${l}`)}}}remove(e){return Ut(this,void 0,void 0,function*(){try{return{data:yield(0,$r.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 Ut(this,void 0,void 0,function*(){try{let i=Object.assign(Object.assign(Object.assign({},kL),r),{prefix:e||""});return{data:yield(0,$r.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("&")}};Va.default=tm});var Fw=y(fc=>{"use strict";Object.defineProperty(fc,"__esModule",{value:!0});fc.version=void 0;fc.version="2.7.1"});var Ow=y(dc=>{"use strict";Object.defineProperty(dc,"__esModule",{value:!0});dc.DEFAULT_HEADERS=void 0;var TL=Fw();dc.DEFAULT_HEADERS={"X-Client-Info":`storage-js/${TL.version}`}});var Aw=y(za=>{"use strict";var qo=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(c){try{l(n.next(c))}catch(f){s(f)}}function u(c){try{l(n.throw(c))}catch(f){s(f)}}function l(c){c.done?o(c.value):i(c.value).then(a,u)}l((n=n.apply(t,e||[])).next())})};Object.defineProperty(za,"__esModule",{value:!0});var PL=Ow(),Mo=Ua(),Uo=em(),RL=cc(),rm=class{constructor(e,r={},n){this.url=e,this.headers=Object.assign(Object.assign({},PL.DEFAULT_HEADERS),r),this.fetch=(0,RL.resolveFetch)(n)}listBuckets(){return qo(this,void 0,void 0,function*(){try{return{data:yield(0,Uo.get)(this.fetch,`${this.url}/bucket`,{headers:this.headers}),error:null}}catch(e){if((0,Mo.isStorageError)(e))return{data:null,error:e};throw e}})}getBucket(e){return qo(this,void 0,void 0,function*(){try{return{data:yield(0,Uo.get)(this.fetch,`${this.url}/bucket/${e}`,{headers:this.headers}),error:null}}catch(r){if((0,Mo.isStorageError)(r))return{data:null,error:r};throw r}})}createBucket(e,r={public:!1}){return qo(this,void 0,void 0,function*(){try{return{data:yield(0,Uo.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,Mo.isStorageError)(n))return{data:null,error:n};throw n}})}updateBucket(e,r){return qo(this,void 0,void 0,function*(){try{return{data:yield(0,Uo.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,Mo.isStorageError)(n))return{data:null,error:n};throw n}})}emptyBucket(e){return qo(this,void 0,void 0,function*(){try{return{data:yield(0,Uo.post)(this.fetch,`${this.url}/bucket/${e}/empty`,{},{headers:this.headers}),error:null}}catch(r){if((0,Mo.isStorageError)(r))return{data:null,error:r};throw r}})}deleteBucket(e){return qo(this,void 0,void 0,function*(){try{return{data:yield(0,Uo.remove)(this.fetch,`${this.url}/bucket/${e}`,{},{headers:this.headers}),error:null}}catch(r){if((0,Mo.isStorageError)(r))return{data:null,error:r};throw r}})}};za.default=rm});var Tw=y(Ho=>{"use strict";var kw=Ho&&Ho.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ho,"__esModule",{value:!0});Ho.StorageClient=void 0;var $L=kw(xw()),IL=kw(Aw()),nm=class extends IL.default{constructor(e,r={},n){super(e,r,n)}from(e){return new $L.default(this.url,this.headers,e,this.fetch)}};Ho.StorageClient=nm});var Rw=y(Pw=>{"use strict";Object.defineProperty(Pw,"__esModule",{value:!0})});var Iw=y(Ir=>{"use strict";var jL=Ir&&Ir.__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]}),$w=Ir&&Ir.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&jL(e,t,r)};Object.defineProperty(Ir,"__esModule",{value:!0});Ir.StorageClient=void 0;var NL=Tw();Object.defineProperty(Ir,"StorageClient",{enumerable:!0,get:function(){return NL.StorageClient}});$w(Rw(),Ir);$w(Ua(),Ir)});var jw=y(hc=>{"use strict";Object.defineProperty(hc,"__esModule",{value:!0});hc.version=void 0;hc.version="2.48.1"});var Nw=y(tr=>{"use strict";Object.defineProperty(tr,"__esModule",{value:!0});tr.DEFAULT_REALTIME_OPTIONS=tr.DEFAULT_AUTH_OPTIONS=tr.DEFAULT_DB_OPTIONS=tr.DEFAULT_GLOBAL_OPTIONS=tr.DEFAULT_HEADERS=void 0;var LL=jw(),Ga="";typeof Deno<"u"?Ga="deno":typeof document<"u"?Ga="web":typeof navigator<"u"&&navigator.product==="ReactNative"?Ga="react-native":Ga="node";tr.DEFAULT_HEADERS={"X-Client-Info":`supabase-js-${Ga}/${LL.version}`};tr.DEFAULT_GLOBAL_OPTIONS={headers:tr.DEFAULT_HEADERS};tr.DEFAULT_DB_OPTIONS={schema:"public"};tr.DEFAULT_AUTH_OPTIONS={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"};tr.DEFAULT_REALTIME_OPTIONS={}});var Bw=y(lt=>{"use strict";var BL=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]}),qL=lt&<.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),ML=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)&&BL(e,t,r);return qL(e,t),e},UL=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(c){try{l(n.next(c))}catch(f){s(f)}}function u(c){try{l(n.throw(c))}catch(f){s(f)}}function l(c){c.done?o(c.value):i(c.value).then(a,u)}l((n=n.apply(t,e||[])).next())})};Object.defineProperty(lt,"__esModule",{value:!0});lt.fetchWithAuth=lt.resolveHeadersConstructor=lt.resolveFetch=void 0;var Lw=ML((bi(),je(vi))),HL=t=>{let e;return t?e=t:typeof fetch>"u"?e=Lw.default:e=fetch,(...r)=>e(...r)};lt.resolveFetch=HL;var VL=()=>typeof Headers>"u"?Lw.Headers:Headers;lt.resolveHeadersConstructor=VL;var zL=(t,e,r)=>{let n=(0,lt.resolveFetch)(r),i=(0,lt.resolveHeadersConstructor)();return(o,s)=>UL(void 0,void 0,void 0,function*(){var a;let u=(a=yield e())!==null&&a!==void 0?a:t,l=new i(s?.headers);return l.has("apikey")||l.set("apikey",t),l.has("Authorization")||l.set("Authorization",`Bearer ${u}`),n(o,Object.assign(Object.assign({},s),{headers:l}))})};lt.fetchWithAuth=zL});var qw=y(fr=>{"use strict";var GL=fr&&fr.__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(c){try{l(n.next(c))}catch(f){s(f)}}function u(c){try{l(n.throw(c))}catch(f){s(f)}}function l(c){c.done?o(c.value):i(c.value).then(a,u)}l((n=n.apply(t,e||[])).next())})};Object.defineProperty(fr,"__esModule",{value:!0});fr.applySettingDefaults=fr.isBrowser=fr.stripTrailingSlash=fr.uuid=void 0;function WL(){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)})}fr.uuid=WL;function KL(t){return t.replace(/\/$/,"")}fr.stripTrailingSlash=KL;var YL=()=>typeof window<"u";fr.isBrowser=YL;function JL(t,e){let{db:r,auth:n,realtime:i,global:o}=t,{db:s,auth:a,realtime:u,global:l}=e,c={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({},l),o),accessToken:()=>GL(this,void 0,void 0,function*(){return""})};return t.accessToken?c.accessToken=t.accessToken:delete c.accessToken,c}fr.applySettingDefaults=JL});var im=y(pc=>{"use strict";Object.defineProperty(pc,"__esModule",{value:!0});pc.version=void 0;pc.version="2.67.3"});var mc=y(ct=>{"use strict";Object.defineProperty(ct,"__esModule",{value:!0});ct.API_VERSIONS=ct.API_VERSION_HEADER_NAME=ct.NETWORK_FAILURE=ct.EXPIRY_MARGIN=ct.DEFAULT_HEADERS=ct.AUDIENCE=ct.STORAGE_KEY=ct.GOTRUE_URL=void 0;var XL=im();ct.GOTRUE_URL="http://localhost:9999";ct.STORAGE_KEY="supabase.auth.token";ct.AUDIENCE="";ct.DEFAULT_HEADERS={"X-Client-Info":`gotrue-js/${XL.version}`};ct.EXPIRY_MARGIN=10;ct.NETWORK_FAILURE={MAX_RETRIES:10,RETRY_INTERVAL:2};ct.API_VERSION_HEADER_NAME="X-Supabase-Api-Version";ct.API_VERSIONS={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}}});var Vo=y(ee=>{"use strict";var ZL=ee&&ee.__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]}),QL=ee&&ee.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),eB=ee&&ee.__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)&&ZL(e,t,r);return QL(e,t),e};Object.defineProperty(ee,"__esModule",{value:!0});ee.parseResponseAPIVersion=ee.getCodeChallengeAndMethod=ee.generatePKCEChallenge=ee.generatePKCEVerifier=ee.retryable=ee.sleep=ee.decodeJWTPayload=ee.Deferred=ee.decodeBase64URL=ee.removeItemAsync=ee.getItemAsync=ee.setItemAsync=ee.looksLikeFetchResponse=ee.resolveFetch=ee.parseParametersFromURL=ee.supportsLocalStorage=ee.isBrowser=ee.uuid=ee.expiresAt=void 0;var tB=mc();function rB(t){return Math.round(Date.now()/1e3)+t}ee.expiresAt=rB;function nB(){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)})}ee.uuid=nB;var iB=()=>typeof window<"u"&&typeof document<"u";ee.isBrowser=iB;var _i={tested:!1,writable:!1},oB=()=>{if(!(0,ee.isBrowser)())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(_i.tested)return _i.writable;let t=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(t,t),globalThis.localStorage.removeItem(t),_i.tested=!0,_i.writable=!0}catch{_i.tested=!0,_i.writable=!1}return _i.writable};ee.supportsLocalStorage=oB;function sB(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}ee.parseParametersFromURL=sB;var aB=t=>{let e;return t?e=t:typeof fetch>"u"?e=(...r)=>Promise.resolve().then(()=>eB((bi(),je(vi)))).then(({default:n})=>n(...r)):e=fetch,(...r)=>e(...r)};ee.resolveFetch=aB;var uB=t=>typeof t=="object"&&t!==null&&"status"in t&&"ok"in t&&"json"in t&&typeof t.json=="function";ee.looksLikeFetchResponse=uB;var lB=async(t,e,r)=>{await t.setItem(e,JSON.stringify(r))};ee.setItemAsync=lB;var cB=async(t,e)=>{let r=await t.getItem(e);if(!r)return null;try{return JSON.parse(r)}catch{return r}};ee.getItemAsync=cB;var fB=async(t,e)=>{await t.removeItem(e)};ee.removeItemAsync=fB;function Mw(t){let e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",r="",n,i,o,s,a,u,l,c=0;for(t=t.replace("-","+").replace("_","/");c<t.length;)s=e.indexOf(t.charAt(c++)),a=e.indexOf(t.charAt(c++)),u=e.indexOf(t.charAt(c++)),l=e.indexOf(t.charAt(c++)),n=s<<2|a>>4,i=(a&15)<<4|u>>2,o=(u&3)<<6|l,r=r+String.fromCharCode(n),u!=64&&i!=0&&(r=r+String.fromCharCode(i)),l!=64&&o!=0&&(r=r+String.fromCharCode(o));return r}ee.decodeBase64URL=Mw;var gc=class t{constructor(){this.promise=new t.promiseConstructor((e,r)=>{this.resolve=e,this.reject=r})}};ee.Deferred=gc;gc.promiseConstructor=Promise;function dB(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(Mw(n))}ee.decodeJWTPayload=dB;async function hB(t){return await new Promise(e=>{setTimeout(()=>e(null),t)})}ee.sleep=hB;function pB(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}}})()})}ee.retryable=pB;function mB(t){return("0"+t.toString(16)).substr(-2)}function Uw(){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,mB).join("")}ee.generatePKCEVerifier=Uw;async function gB(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 yB(t){return btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function Hw(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 gB(t);return yB(r)}ee.generatePKCEChallenge=Hw;async function DB(t,e,r=!1){let n=Uw(),i=n;r&&(i+="/PASSWORD_RECOVERY"),await(0,ee.setItemAsync)(t,`${e}-code-verifier`,i);let o=await Hw(n);return[o,n===o?"plain":"s256"]}ee.getCodeChallengeAndMethod=DB;var vB=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function bB(t){let e=t.headers.get(tB.API_VERSION_HEADER_NAME);if(!e||!e.match(vB))return null;try{return new Date(`${e}T00:00:00.0Z`)}catch{return null}}ee.parseResponseAPIVersion=bB});var Wa=y(ce=>{"use strict";Object.defineProperty(ce,"__esModule",{value:!0});ce.isAuthWeakPasswordError=ce.AuthWeakPasswordError=ce.isAuthRetryableFetchError=ce.AuthRetryableFetchError=ce.AuthPKCEGrantCodeExchangeError=ce.isAuthImplicitGrantRedirectError=ce.AuthImplicitGrantRedirectError=ce.AuthInvalidCredentialsError=ce.AuthInvalidTokenResponseError=ce.isAuthSessionMissingError=ce.AuthSessionMissingError=ce.CustomAuthError=ce.AuthUnknownError=ce.isAuthApiError=ce.AuthApiError=ce.isAuthError=ce.AuthError=void 0;var zo=class extends Error{constructor(e,r,n){super(e),this.__isAuthError=!0,this.name="AuthError",this.status=r,this.code=n}};ce.AuthError=zo;function Go(t){return typeof t=="object"&&t!==null&&"__isAuthError"in t}ce.isAuthError=Go;var om=class extends zo{constructor(e,r,n){super(e,r,n),this.name="AuthApiError",this.status=r,this.code=n}};ce.AuthApiError=om;function wB(t){return Go(t)&&t.name==="AuthApiError"}ce.isAuthApiError=wB;var sm=class extends zo{constructor(e,r){super(e),this.name="AuthUnknownError",this.originalError=r}};ce.AuthUnknownError=sm;var jr=class extends zo{constructor(e,r,n,i){super(e,n,i),this.name=r,this.status=n}};ce.CustomAuthError=jr;var am=class extends jr{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}};ce.AuthSessionMissingError=am;function _B(t){return Go(t)&&t.name==="AuthSessionMissingError"}ce.isAuthSessionMissingError=_B;var um=class extends jr{constructor(){super("Auth session or user missing","AuthInvalidTokenResponseError",500,void 0)}};ce.AuthInvalidTokenResponseError=um;var lm=class extends jr{constructor(e){super(e,"AuthInvalidCredentialsError",400,void 0)}};ce.AuthInvalidCredentialsError=lm;var cm=class extends jr{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}}};ce.AuthImplicitGrantRedirectError=cm;function EB(t){return Go(t)&&t.name==="AuthImplicitGrantRedirectError"}ce.isAuthImplicitGrantRedirectError=EB;var fm=class extends jr{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}}};ce.AuthPKCEGrantCodeExchangeError=fm;var dm=class extends jr{constructor(e,r){super(e,"AuthRetryableFetchError",r,void 0)}};ce.AuthRetryableFetchError=dm;function CB(t){return Go(t)&&t.name==="AuthRetryableFetchError"}ce.isAuthRetryableFetchError=CB;var hm=class extends jr{constructor(e,r,n){super(e,"AuthWeakPasswordError",r,"weak_password"),this.reasons=n}};ce.AuthWeakPasswordError=hm;function SB(t){return Go(t)&&t.name==="AuthWeakPasswordError"}ce.isAuthWeakPasswordError=SB});var gm=y(nt=>{"use strict";var xB=nt&&nt.__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(nt,"__esModule",{value:!0});nt._noResolveJsonResponse=nt._generateLinkResponse=nt._ssoResponse=nt._userResponse=nt._sessionResponsePassword=nt._sessionResponse=nt._request=nt.handleError=void 0;var yc=mc(),pm=Vo(),qn=Wa(),Ei=t=>t.msg||t.message||t.error_description||t.error||JSON.stringify(t),FB=[502,503,504];async function mm(t){var e;if(!(0,pm.looksLikeFetchResponse)(t))throw new qn.AuthRetryableFetchError(Ei(t),0);if(FB.includes(t.status))throw new qn.AuthRetryableFetchError(Ei(t),t.status);let r;try{r=await t.json()}catch(o){throw new qn.AuthUnknownError(Ei(o),o)}let n,i=(0,pm.parseResponseAPIVersion)(t);if(i&&i.getTime()>=yc.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 qn.AuthWeakPasswordError(Ei(r),t.status,((e=r.weak_password)===null||e===void 0?void 0:e.reasons)||[]);if(n==="session_not_found")throw new qn.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 qn.AuthWeakPasswordError(Ei(r),t.status,r.weak_password.reasons);throw new qn.AuthApiError(Ei(r),t.status||500,n)}nt.handleError=mm;var OB=(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 AB(t,e,r,n){var i;let o=Object.assign({},n?.headers);o[yc.API_VERSION_HEADER_NAME]||(o[yc.API_VERSION_HEADER_NAME]=yc.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 kB(t,e,r+a,{headers:o,noResolveJson:n?.noResolveJson},{},n?.body);return n?.xform?n?.xform(u):{data:Object.assign({},u),error:null}}nt._request=AB;async function kB(t,e,r,n,i,o){let s=OB(e,n,i,o),a;try{a=await t(r,Object.assign({},s))}catch(u){throw console.error(u),new qn.AuthRetryableFetchError(Ei(u),0)}if(a.ok||await mm(a),n?.noResolveJson)return a;try{return await a.json()}catch(u){await mm(u)}}function Vw(t){var e;let r=null;jB(t)&&(r=Object.assign({},t),t.expires_at||(r.expires_at=(0,pm.expiresAt)(t.expires_in)));let n=(e=t.user)!==null&&e!==void 0?e:t;return{data:{session:r,user:n},error:null}}nt._sessionResponse=Vw;function TB(t){let e=Vw(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}nt._sessionResponsePassword=TB;function PB(t){var e;return{data:{user:(e=t.user)!==null&&e!==void 0?e:t},error:null}}nt._userResponse=PB;function RB(t){return{data:t,error:null}}nt._ssoResponse=RB;function $B(t){let{action_link:e,email_otp:r,hashed_token:n,redirect_to:i,verification_type:o}=t,s=xB(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}}nt._generateLinkResponse=$B;function IB(t){return t}nt._noResolveJsonResponse=IB;function jB(t){return t.access_token&&t.refresh_token&&t.expires_in}});var Dc=y(Ka=>{"use strict";var NB=Ka&&Ka.__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(Ka,"__esModule",{value:!0});var vt=gm(),LB=Vo(),Nr=Wa(),ym=class{constructor({url:e="",headers:r={},fetch:n}){this.url=e,this.headers=r,this.fetch=(0,LB.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,Nr.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,Nr.isAuthError)(n))return{data:{user:null},error:n};throw n}}async generateLink(e){try{let{options:r}=e,n=NB(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,Nr.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,Nr.isAuthError)(r))return{data:{user:null},error:r};throw r}}async listUsers(e){var r,n,i,o,s,a,u;try{let l={nextPage:null,lastPage:0,total:0},c=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(c.error)throw c.error;let f=await c.json(),h=(s=c.headers.get("x-total-count"))!==null&&s!==void 0?s:0,d=(u=(a=c.headers.get("link"))===null||a===void 0?void 0:a.split(","))!==null&&u!==void 0?u:[];return d.length>0&&(d.forEach(m=>{let b=parseInt(m.split(";")[0].split("=")[1].substring(0,1)),D=JSON.parse(m.split(";")[1].split("=")[1]);l[`${D}Page`]=b}),l.total=parseInt(h)),{data:Object.assign(Object.assign({},f),l),error:null}}catch(l){if((0,Nr.isAuthError)(l))return{data:{users:[]},error:l};throw l}}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,Nr.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,Nr.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,Nr.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,Nr.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,Nr.isAuthError)(r))return{data:null,error:r};throw r}}};Ka.default=ym});var zw=y(Wo=>{"use strict";Object.defineProperty(Wo,"__esModule",{value:!0});Wo.memoryLocalStorageAdapter=Wo.localStorageAdapter=void 0;var Dm=Vo();Wo.localStorageAdapter={getItem:t=>(0,Dm.supportsLocalStorage)()?globalThis.localStorage.getItem(t):null,setItem:(t,e)=>{(0,Dm.supportsLocalStorage)()&&globalThis.localStorage.setItem(t,e)},removeItem:t=>{(0,Dm.supportsLocalStorage)()&&globalThis.localStorage.removeItem(t)}};function BB(t={}){return{getItem:e=>t[e]||null,setItem:(e,r)=>{t[e]=r},removeItem:e=>{delete t[e]}}}Wo.memoryLocalStorageAdapter=BB});var Gw=y(vc=>{"use strict";Object.defineProperty(vc,"__esModule",{value:!0});vc.polyfillGlobalThis=void 0;function qB(){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)}}vc.polyfillGlobalThis=qB});var vm=y(it=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0});it.processLock=it.navigatorLock=it.ProcessLockAcquireTimeoutError=it.NavigatorLockAcquireTimeoutError=it.LockAcquireTimeoutError=it.internals=void 0;var MB=Vo();it.internals={debug:!!(globalThis&&(0,MB.supportsLocalStorage)()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug")==="true")};var Ya=class extends Error{constructor(e){super(e),this.isAcquireTimeout=!0}};it.LockAcquireTimeoutError=Ya;var bc=class extends Ya{};it.NavigatorLockAcquireTimeoutError=bc;var wc=class extends Ya{};it.ProcessLockAcquireTimeoutError=wc;async function UB(t,e,r){it.internals.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire lock",t,e);let n=new globalThis.AbortController;return e>0&&setTimeout(()=>{n.abort(),it.internals.debug&&console.log("@supabase/gotrue-js: navigatorLock acquire timed out",t)},e),await Promise.resolve().then(()=>globalThis.navigator.locks.request(t,e===0?{mode:"exclusive",ifAvailable:!0}:{mode:"exclusive",signal:n.signal},async i=>{if(i){it.internals.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquired",t,i.name);try{return await r()}finally{it.internals.debug&&console.log("@supabase/gotrue-js: navigatorLock: released",t,i.name)}}else{if(e===0)throw it.internals.debug&&console.log("@supabase/gotrue-js: navigatorLock: not immediately available",t),new bc(`Acquiring an exclusive Navigator LockManager lock "${t}" immediately failed`);if(it.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()}}))}it.navigatorLock=UB;var Ww={};async function HB(t,e,r){var n;let i=(n=Ww[t])!==null&&n!==void 0?n:Promise.resolve(),o=Promise.race([i.catch(()=>null),e>=0?new Promise((s,a)=>{setTimeout(()=>{a(new wc(`Acquring process lock with name "${t}" timed out`))},e)}):null].filter(s=>s)).catch(s=>{if(s&&s.isAcquireTimeout)throw s;return null}).then(async()=>await r());return Ww[t]=o.catch(async s=>{if(s&&s.isAcquireTimeout)return await i,null;throw s}),await o}it.processLock=HB});var wm=y(Za=>{"use strict";var VB=Za&&Za.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Za,"__esModule",{value:!0});var zB=VB(Dc()),Xa=mc(),X=Wa(),se=gm(),me=Vo(),bm=zw(),GB=Gw(),WB=im(),Kw=vm();(0,GB.polyfillGlobalThis)();var KB={url:Xa.GOTRUE_URL,storageKey:Xa.STORAGE_KEY,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:Xa.DEFAULT_HEADERS,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1},Ja=30*1e3,Yw=3;async function Jw(t,e,r){return await r()}var _c=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,me.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({},KB),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 zB.default({url:i.url,headers:i.headers,fetch:i.fetch}),this.url=i.url,this.headers=i.headers,this.fetch=(0,me.resolveFetch)(i.fetch),this.lock=i.lock||Jw,this.detectSessionInUrl=i.detectSessionInUrl,this.flowType=i.flowType,this.hasCustomAuthorizationHeader=i.hasCustomAuthorizationHeader,i.lock?this.lock=i.lock:(0,me.isBrowser)()&&(!((r=globalThis?.navigator)===null||r===void 0)&&r.locks)?this.lock=Kw.navigatorLock:this.lock=Jw,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,me.supportsLocalStorage)()?this.storage=bm.localStorageAdapter:(this.memoryStorage={},this.storage=(0,bm.memoryLocalStorageAdapter)(this.memoryStorage)):(this.memoryStorage={},this.storage=(0,bm.memoryLocalStorageAdapter)(this.memoryStorage)),(0,me.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} (${WB.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(){var e;try{let r=(0,me.parseParametersFromURL)(window.location.href),n="none";if(this._isImplicitGrantCallback(r)?n="implicit":await this._isPKCECallback(r)&&(n="pkce"),(0,me.isBrowser)()&&this.detectSessionInUrl&&n!=="none"){let{data:i,error:o}=await this._getSessionFromURL(r,n);if(o){if(this._debug("#_initialize()","error detecting session from URL",o),(0,X.isAuthImplicitGrantRedirectError)(o)){let u=(e=o.details)===null||e===void 0?void 0:e.code;if(u==="identity_already_exists"||u==="identity_not_found"||u==="single_identity_not_deletable")return{error:o}}return await this._removeSession(),{error:o}}let{session:s,redirectType:a}=i;return this._debug("#_initialize()","detected session in URL",s,"redirect type",a),await this._saveSession(s),setTimeout(async()=>{a==="recovery"?await this._notifyAllSubscribers("PASSWORD_RECOVERY",s):await this._notifyAllSubscribers("SIGNED_IN",s)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(r){return(0,X.isAuthError)(r)?{error:r}:{error:new X.AuthUnknownError("Unexpected error during initialization",r)}}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(e){var r,n,i;try{let o=await(0,se._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:se._sessionResponse}),{data:s,error:a}=o;if(a||!s)return{data:{user:null,session:null},error:a};let u=s.session,l=s.user;return s.session&&(await this._saveSession(s.session),await this._notifyAllSubscribers("SIGNED_IN",u)),{data:{user:l,session:u},error:null}}catch(o){if((0,X.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:c,password:f,options:h}=e,d=null,m=null;this.flowType==="pkce"&&([d,m]=await(0,me.getCodeChallengeAndMethod)(this.storage,this.storageKey)),o=await(0,se._request)(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:h?.emailRedirectTo,body:{email:c,password:f,data:(r=h?.data)!==null&&r!==void 0?r:{},gotrue_meta_security:{captcha_token:h?.captchaToken},code_challenge:d,code_challenge_method:m},xform:se._sessionResponse})}else if("phone"in e){let{phone:c,password:f,options:h}=e;o=await(0,se._request)(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:c,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:se._sessionResponse})}else throw new X.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,l=s.user;return s.session&&(await this._saveSession(s.session),await this._notifyAllSubscribers("SIGNED_IN",u)),{data:{user:l,session:u},error:null}}catch(o){if((0,X.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,se._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:se._sessionResponsePassword})}else if("phone"in e){let{phone:o,password:s,options:a}=e;r=await(0,se._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:se._sessionResponsePassword})}else throw new X.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 X.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,X.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,me.getItemAsync)(this.storage,`${this.storageKey}-code-verifier`),[n,i]=(r??"").split("/");try{let{data:o,error:s}=await(0,se._request)(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:e,code_verifier:n},xform:se._sessionResponse});if(await(0,me.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 X.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,X.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,se._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:se._sessionResponse}),{data:u,error:l}=a;return l?{data:{user:null,session:null},error:l}:!u||!u.session||!u.user?{data:{user:null,session:null},error:new X.AuthInvalidTokenResponseError}:(u.session&&(await this._saveSession(u.session),await this._notifyAllSubscribers("SIGNED_IN",u.session)),{data:u,error:l})}catch(r){if((0,X.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,l=null,c=null;this.flowType==="pkce"&&([l,c]=await(0,me.getCodeChallengeAndMethod)(this.storage,this.storageKey));let{error:f}=await(0,se._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:l,code_challenge_method:c},redirectTo:u?.emailRedirectTo});return{data:{user:null,session:null},error:f}}if("phone"in e){let{phone:a,options:u}=e,{data:l,error:c}=await(0,se._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:l?.message_id},error:c}}throw new X.AuthInvalidCredentialsError("You must provide either an email or phone number.")}catch(a){if((0,X.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,se._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:se._sessionResponse});if(a)throw a;if(!s)throw new Error("An error occurred on token verification.");let u=s.session,l=s.user;return u?.access_token&&(await this._saveSession(u),await this._notifyAllSubscribers(e.type=="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",u)),{data:{user:l,session:u},error:null}}catch(i){if((0,X.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,me.getCodeChallengeAndMethod)(this.storage,this.storageKey)),await(0,se._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:se._ssoResponse})}catch(o){if((0,X.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 X.AuthSessionMissingError;let{error:i}=await(0,se._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,X.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,se._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,se._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 X.AuthInvalidCredentialsError("You must provide either an email or phone number and a type")}catch(r){if((0,X.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,me.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,l,c)=>(!s&&l==="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 may 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,l,c))})}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,se._request)(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:e,xform:se._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 X.AuthSessionMissingError}:await(0,se._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:se._userResponse})})}catch(r){if((0,X.isAuthError)(r))return(0,X.isAuthSessionMissingError)(r)&&(await this._removeSession(),await(0,me.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 X.AuthSessionMissingError;let s=i.session,a=null,u=null;this.flowType==="pkce"&&e.email!=null&&([a,u]=await(0,me.getCodeChallengeAndMethod)(this.storage,this.storageKey));let{data:l,error:c}=await(0,se._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:se._userResponse});if(c)throw c;return s.user=l.user,await this._saveSession(s),await this._notifyAllSubscribers("USER_UPDATED",s),{data:{user:s.user},error:null}})}catch(n){if((0,X.isAuthError)(n))return{data:{user:null},error:n};throw n}}_decodeJWT(e){return(0,me.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 X.AuthSessionMissingError;let r=Date.now()/1e3,n=r,i=!0,o=null,s=(0,me.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,X.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 X.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,X.isAuthError)(r))return{data:{user:null,session:null},error:r};throw r}}async _getSessionFromURL(e,r){try{if(!(0,me.isBrowser)())throw new X.AuthImplicitGrantRedirectError("No browser detected.");if(e.error||e.error_description||e.error_code)throw new X.AuthImplicitGrantRedirectError(e.error_description||"Error in URL with unspecified error_description",{error:e.error||"unspecified_error",code:e.error_code||"unspecified_code"});switch(r){case"implicit":if(this.flowType==="pkce")throw new X.AuthPKCEGrantCodeExchangeError("Not a valid PKCE flow url.");break;case"pkce":if(this.flowType==="implicit")throw new X.AuthImplicitGrantRedirectError("Not a valid implicit grant flow url.");break;default:}if(r==="pkce"){if(this._debug("#_initialize()","begin","is PKCE flow",!0),!e.code)throw new X.AuthPKCEGrantCodeExchangeError("No code detected.");let{data:F,error:g}=await this._exchangeCodeForSession(e.code);if(g)throw g;let C=new URL(window.location.href);return C.searchParams.delete("code"),window.history.replaceState(window.history.state,"",C.toString()),{data:{session:F.session,redirectType:null},error:null}}let{provider_token:n,provider_refresh_token:i,access_token:o,refresh_token:s,expires_in:a,expires_at:u,token_type:l}=e;if(!o||!a||!s||!l)throw new X.AuthImplicitGrantRedirectError("No session defined in URL");let c=Math.round(Date.now()/1e3),f=parseInt(a),h=c+f;u&&(h=parseInt(u));let d=h-c;d*1e3<=Ja&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${d}s, should have been closer to ${f}s`);let m=h-f;c-m>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",m,h,c):c-m<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew",m,h,c);let{data:b,error:D}=await this._getUser(o);if(D)throw D;let _={provider_token:n,provider_refresh_token:i,access_token:o,expires_in:f,expires_at:h,refresh_token:s,token_type:l,user:b.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),{data:{session:_,redirectType:e.type},error:null}}catch(n){if((0,X.isAuthError)(n))return{data:{session:null,redirectType:null},error:n};throw n}}_isImplicitGrantCallback(e){return!!(e.access_token||e.error_description)}async _isPKCECallback(e){let r=await(0,me.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,X.isAuthApiError)(a)&&(a.status===404||a.status===401||a.status===403)))return{error:a}}return e!=="others"&&(await this._removeSession(),await(0,me.removeItemAsync)(this.storage,`${this.storageKey}-code-verifier`)),{error:null}})}onAuthStateChange(e){let r=(0,me.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,me.getCodeChallengeAndMethod)(this.storage,this.storageKey,!0));try{return await(0,se._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,X.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,X.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,l,c;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,se._request)(this.fetch,"GET",d,{headers:this.headers,jwt:(c=(l=f.session)===null||l===void 0?void 0:l.access_token)!==null&&c!==void 0?c:void 0})});if(i)throw i;return(0,me.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,X.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,se._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,X.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,me.retryable)(async i=>(i>0&&await(0,me.sleep)(200*Math.pow(2,i-1)),this._debug(r,"refreshing attempt",i),await(0,se._request)(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:e},headers:this.headers,xform:se._sessionResponse})),(i,o)=>{let s=200*Math.pow(2,i);return o&&(0,X.isAuthRetryableFetchError)(o)&&Date.now()+s-n<Ja})}catch(n){if(this._debug(r,"error",n),(0,X.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,me.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,me.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+Xa.EXPIRY_MARGIN;if(this._debug(r,`session has${o?"":" not"} expired with margin of ${Xa.EXPIRY_MARGIN}s`),o){if(this.autoRefreshToken&&n.refresh_token){let{error:s}=await this._callRefreshToken(n.refresh_token);s&&(console.error(s),(0,X.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 X.AuthSessionMissingError;if(this.refreshingDeferred)return this.refreshingDeferred.promise;let i=`#_callRefreshToken(${e.substring(0,5)}...)`;this._debug(i,"begin");try{this.refreshingDeferred=new me.Deferred;let{data:o,error:s}=await this._refreshAccessToken(e);if(s)throw s;if(!o.session)throw new X.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,X.isAuthError)(o)){let s={session:null,error:o};return(0,X.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,me.setItemAsync)(this.storage,this.storageKey,e)}async _removeSession(){this._debug("#_removeSession()"),await(0,me.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,me.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(),Ja);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)/Ja);this._debug("#_autoRefreshTokenTick()",`access token expires in ${i} ticks, a tick lasts ${Ja}ms, refresh threshold is ${Yw} ticks`),i<=Yw&&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 Kw.LockAcquireTimeoutError)this._debug("auto refresh token tick lock not available");else throw e}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!(0,me.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,me.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,se._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,X.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:l}=await(0,se._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 l?{data:null,error:l}:(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,X.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,se._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,X.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,se._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,X.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 c=s.amr||[];return{data:{currentLevel:a,nextLevel:u,currentAuthenticationMethods:c},error:null}}))}};Za.default=_c;_c.nextInstanceID=0});var Xw=y(Qa=>{"use strict";var YB=Qa&&Qa.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Qa,"__esModule",{value:!0});var JB=YB(Dc()),XB=JB.default;Qa.default=XB});var Zw=y(eu=>{"use strict";var ZB=eu&&eu.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(eu,"__esModule",{value:!0});var QB=ZB(wm()),eq=QB.default;eu.default=eq});var e_=y(Qw=>{"use strict";Object.defineProperty(Qw,"__esModule",{value:!0})});var Em=y(Le=>{"use strict";var tq=Le&&Le.__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]}),t_=Le&&Le.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&tq(e,t,r)},Ec=Le&&Le.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Le,"__esModule",{value:!0});Le.lockInternals=Le.NavigatorLockAcquireTimeoutError=Le.navigatorLock=Le.AuthClient=Le.AuthAdminApi=Le.GoTrueClient=Le.GoTrueAdminApi=void 0;var rq=Ec(Dc());Le.GoTrueAdminApi=rq.default;var nq=Ec(wm());Le.GoTrueClient=nq.default;var iq=Ec(Xw());Le.AuthAdminApi=iq.default;var oq=Ec(Zw());Le.AuthClient=oq.default;t_(e_(),Le);t_(Wa(),Le);var _m=vm();Object.defineProperty(Le,"navigatorLock",{enumerable:!0,get:function(){return _m.navigatorLock}});Object.defineProperty(Le,"NavigatorLockAcquireTimeoutError",{enumerable:!0,get:function(){return _m.NavigatorLockAcquireTimeoutError}});Object.defineProperty(Le,"lockInternals",{enumerable:!0,get:function(){return _m.internals}})});var r_=y(Cc=>{"use strict";Object.defineProperty(Cc,"__esModule",{value:!0});Cc.SupabaseAuthClient=void 0;var sq=Em(),Cm=class extends sq.AuthClient{constructor(e){super(e)}};Cc.SupabaseAuthClient=Cm});var xm=y(tu=>{"use strict";var aq=tu&&tu.__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(c){try{l(n.next(c))}catch(f){s(f)}}function u(c){try{l(n.throw(c))}catch(f){s(f)}}function l(c){c.done?o(c.value):i(c.value).then(a,u)}l((n=n.apply(t,e||[])).next())})};Object.defineProperty(tu,"__esModule",{value:!0});var uq=$p(),lq=Gp(),cq=(Yp(),je(Kp)),fq=Iw(),Sc=Nw(),dq=Bw(),n_=qw(),hq=r_(),Sm=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,n_.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`,l={db:Sc.DEFAULT_DB_OPTIONS,realtime:Sc.DEFAULT_REALTIME_OPTIONS,auth:Object.assign(Object.assign({},Sc.DEFAULT_AUTH_OPTIONS),{storageKey:u}),global:Sc.DEFAULT_GLOBAL_OPTIONS},c=(0,n_.applySettingDefaults)(n??{},l);this.storageKey=(i=c.auth.storageKey)!==null&&i!==void 0?i:"",this.headers=(o=c.global.headers)!==null&&o!==void 0?o:{},c.accessToken?(this.accessToken=c.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=c.auth)!==null&&s!==void 0?s:{},this.headers,c.global.fetch),this.fetch=(0,dq.fetchWithAuth)(r,this._getAccessToken.bind(this),c.global.fetch),this.realtime=this._initRealtimeClient(Object.assign({headers:this.headers,accessToken:this._getAccessToken.bind(this)},c.realtime)),this.rest=new lq.PostgrestClient(`${a}/rest/v1`,{headers:this.headers,schema:c.db.schema,fetch:this.fetch}),c.accessToken||this._listenForAuthEvents()}get functions(){return new uq.FunctionsClient(this.functionsUrl,{headers:this.headers,customFetch:this.fetch})}get storage(){return new fq.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 aq(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},l,c){let f={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new hq.SupabaseAuthClient({url:this.authUrl,headers:Object.assign(Object.assign({},f),l),storageKey:o,autoRefreshToken:e,persistSession:r,detectSessionInUrl:n,storage:i,flowType:s,lock:a,debug:u,fetch:c,hasCustomAuthorizationHeader:"Authorization"in this.headers})}_initRealtimeClient(e){return new cq.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.changedAccessToken=n:e==="SIGNED_OUT"&&(this.realtime.setAuth(),r=="STORAGE"&&this.auth.signOut(),this.changedAccessToken=void 0)}};tu.default=Sm});var s_=y(Se=>{"use strict";var pq=Se&&Se.__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]}),i_=Se&&Se.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&pq(e,t,r)},o_=Se&&Se.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Se,"__esModule",{value:!0});Se.createClient=Se.SupabaseClient=Se.FunctionRegion=Se.FunctionsError=Se.FunctionsRelayError=Se.FunctionsFetchError=Se.FunctionsHttpError=Se.PostgrestError=void 0;var mq=o_(xm());i_(Em(),Se);var gq=Gp();Object.defineProperty(Se,"PostgrestError",{enumerable:!0,get:function(){return gq.PostgrestError}});var ru=$p();Object.defineProperty(Se,"FunctionsHttpError",{enumerable:!0,get:function(){return ru.FunctionsHttpError}});Object.defineProperty(Se,"FunctionsFetchError",{enumerable:!0,get:function(){return ru.FunctionsFetchError}});Object.defineProperty(Se,"FunctionsRelayError",{enumerable:!0,get:function(){return ru.FunctionsRelayError}});Object.defineProperty(Se,"FunctionsError",{enumerable:!0,get:function(){return ru.FunctionsError}});Object.defineProperty(Se,"FunctionRegion",{enumerable:!0,get:function(){return ru.FunctionRegion}});i_((Yp(),je(Kp)),Se);var yq=xm();Object.defineProperty(Se,"SupabaseClient",{enumerable:!0,get:function(){return o_(yq).default}});var Dq=(t,e,r)=>new mq.default(t,e,r);Se.createClient=Dq});var Fm=y((Tae,a_)=>{a_.exports=require("stream")});var h_=y((Pae,d_)=>{"use strict";function u_(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 l_(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?u_(Object(r),!0).forEach(function(n){vq(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):u_(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function vq(t,e,r){return e=f_(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function bq(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function c_(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,f_(n.key),n)}}function wq(t,e,r){return e&&c_(t.prototype,e),r&&c_(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function f_(t){var e=_q(t,"string");return typeof e=="symbol"?e:String(e)}function _q(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 Eq=require("buffer"),xc=Eq.Buffer,Cq=require("util"),Om=Cq.inspect,Sq=Om&&Om.custom||"inspect";function xq(t,e,r){xc.prototype.copy.call(t,e,r)}d_.exports=function(){function t(){bq(this,t),this.head=null,this.tail=null,this.length=0}return wq(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 xc.alloc(0);for(var n=xc.allocUnsafe(r>>>0),i=this.head,o=0;i;)xq(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=xc.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:Sq,value:function(r,n){return Om(this,l_(l_({},n),{},{depth:0,customInspect:!1}))}}]),t}()});var km=y((Rae,m_)=>{"use strict";function Fq(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(Am,this,t)):process.nextTick(Am,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(Fc,r):(r._writableState.errorEmitted=!0,process.nextTick(p_,r,o)):process.nextTick(p_,r,o):e?(process.nextTick(Fc,r),e(o)):process.nextTick(Fc,r)}),this)}function p_(t,e){Am(t,e),Fc(t)}function Fc(t){t._writableState&&!t._writableState.emitClose||t._readableState&&!t._readableState.emitClose||t.emit("close")}function Oq(){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 Am(t,e){t.emit("error",e)}function Aq(t,e){var r=t._readableState,n=t._writableState;r&&r.autoDestroy||n&&n.autoDestroy?t.destroy(e):t.emit("error",e)}m_.exports={destroy:Fq,undestroy:Oq,errorOrDestroy:Aq}});var Mn=y(($ae,D_)=>{"use strict";var y_={};function dr(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,y_[t]=i}function g_(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 kq(t,e,r){return t.substr(!r||r<0?0:+r,e.length)===e}function Tq(t,e,r){return(r===void 0||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}function Pq(t,e,r){return typeof r!="number"&&(r=0),r+e.length>t.length?!1:t.indexOf(e,r)!==-1}dr("ERR_INVALID_OPT_VALUE",function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'},TypeError);dr("ERR_INVALID_ARG_TYPE",function(t,e,r){let n;typeof e=="string"&&kq(e,"not ")?(n="must not be",e=e.replace(/^not /,"")):n="must be";let i;if(Tq(t," argument"))i=`The ${t} ${n} ${g_(e,"type")}`;else{let o=Pq(t,".")?"property":"argument";i=`The "${t}" ${o} ${n} ${g_(e,"type")}`}return i+=`. Received type ${typeof r}`,i},TypeError);dr("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");dr("ERR_METHOD_NOT_IMPLEMENTED",function(t){return"The "+t+" method is not implemented"});dr("ERR_STREAM_PREMATURE_CLOSE","Premature close");dr("ERR_STREAM_DESTROYED",function(t){return"Cannot call "+t+" after a stream was destroyed"});dr("ERR_MULTIPLE_CALLBACK","Callback called multiple times");dr("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");dr("ERR_STREAM_WRITE_AFTER_END","write after end");dr("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);dr("ERR_UNKNOWN_ENCODING",function(t){return"Unknown encoding: "+t},TypeError);dr("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");D_.exports.codes=y_});var Tm=y((Iae,v_)=>{"use strict";var Rq=Mn().codes.ERR_INVALID_OPT_VALUE;function $q(t,e,r){return t.highWaterMark!=null?t.highWaterMark:e?t[r]:null}function Iq(t,e,r,n){var i=$q(e,n,r);if(i!=null){if(!(isFinite(i)&&Math.floor(i)===i)||i<0){var o=n?r:"highWaterMark";throw new Rq(o,i)}return Math.floor(i)}return t.objectMode?16:16*1024}v_.exports={getHighWaterMark:Iq}});var b_=y((jae,Pm)=>{typeof Object.create=="function"?Pm.exports=function(e,r){r&&(e.super_=r,e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:Pm.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 Ko=y((Nae,$m)=>{try{if(Rm=require("util"),typeof Rm.inherits!="function")throw"";$m.exports=Rm.inherits}catch{$m.exports=b_()}var Rm});var __=y((Lae,w_)=>{w_.exports=require("util").deprecate});var Nm=y((Bae,O_)=>{"use strict";O_.exports=Ye;function C_(t){var e=this;this.next=null,this.entry=null,this.finish=function(){uM(e,t)}}var Yo;Ye.WritableState=iu;var jq={deprecate:__()},S_=Fm(),Ac=require("buffer").Buffer,Nq=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function Lq(t){return Ac.from(t)}function Bq(t){return Ac.isBuffer(t)||t instanceof Nq}var jm=km(),qq=Tm(),Mq=qq.getHighWaterMark,Un=Mn().codes,Uq=Un.ERR_INVALID_ARG_TYPE,Hq=Un.ERR_METHOD_NOT_IMPLEMENTED,Vq=Un.ERR_MULTIPLE_CALLBACK,zq=Un.ERR_STREAM_CANNOT_PIPE,Gq=Un.ERR_STREAM_DESTROYED,Wq=Un.ERR_STREAM_NULL_VALUES,Kq=Un.ERR_STREAM_WRITE_AFTER_END,Yq=Un.ERR_UNKNOWN_ENCODING,Jo=jm.errorOrDestroy;Ko()(Ye,S_);function Jq(){}function iu(t,e,r){Yo=Yo||Ci(),t=t||{},typeof r!="boolean"&&(r=e instanceof Yo),this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=Mq(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){nM(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 C_(this)}iu.prototype.getBuffer=function(){for(var e=this.bufferedRequest,r=[];e;)r.push(e),e=e.next;return r};(function(){try{Object.defineProperty(iu.prototype,"buffer",{get:jq.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var Oc;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(Oc=Function.prototype[Symbol.hasInstance],Object.defineProperty(Ye,Symbol.hasInstance,{value:function(e){return Oc.call(this,e)?!0:this!==Ye?!1:e&&e._writableState instanceof iu}})):Oc=function(e){return e instanceof this};function Ye(t){Yo=Yo||Ci();var e=this instanceof Yo;if(!e&&!Oc.call(Ye,this))return new Ye(t);this._writableState=new iu(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)),S_.call(this)}Ye.prototype.pipe=function(){Jo(this,new zq)};function Xq(t,e){var r=new Kq;Jo(t,r),process.nextTick(e,r)}function Zq(t,e,r,n){var i;return r===null?i=new Wq:typeof r!="string"&&!e.objectMode&&(i=new Uq("chunk",["string","Buffer"],r)),i?(Jo(t,i),process.nextTick(n,i),!1):!0}Ye.prototype.write=function(t,e,r){var n=this._writableState,i=!1,o=!n.objectMode&&Bq(t);return o&&!Ac.isBuffer(t)&&(t=Lq(t)),typeof e=="function"&&(r=e,e=null),o?e="buffer":e||(e=n.defaultEncoding),typeof r!="function"&&(r=Jq),n.ending?Xq(this,r):(o||Zq(this,n,t,r))&&(n.pendingcb++,i=eM(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&&x_(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 Yq(e);return this._writableState.defaultEncoding=e,this};Object.defineProperty(Ye.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function Qq(t,e,r){return!t.objectMode&&t.decodeStrings!==!1&&typeof e=="string"&&(e=Ac.from(e,r)),e}Object.defineProperty(Ye.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function eM(t,e,r,n,i,o){if(!r){var s=Qq(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 l=e.lastBufferedRequest;e.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:o,next:null},l?l.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1}else Im(t,e,!1,a,n,i,o);return u}function Im(t,e,r,n,i,o,s){e.writelen=n,e.writecb=s,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new Gq("write")):r?t._writev(i,e.onwrite):t._write(i,o,e.onwrite),e.sync=!1}function tM(t,e,r,n,i){--e.pendingcb,r?(process.nextTick(i,n),process.nextTick(nu,t,e),t._writableState.errorEmitted=!0,Jo(t,n)):(i(n),t._writableState.errorEmitted=!0,Jo(t,n),nu(t,e))}function rM(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}function nM(t,e){var r=t._writableState,n=r.sync,i=r.writecb;if(typeof i!="function")throw new Vq;if(rM(r),e)tM(t,r,n,e,i);else{var o=F_(r)||t.destroyed;!o&&!r.corked&&!r.bufferProcessing&&r.bufferedRequest&&x_(t,r),n?process.nextTick(E_,t,r,o,i):E_(t,r,o,i)}}function E_(t,e,r,n){r||iM(t,e),e.pendingcb--,n(),nu(t,e)}function iM(t,e){e.length===0&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}function x_(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,Im(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 C_(e),e.bufferedRequestCount=0}else{for(;r;){var u=r.chunk,l=r.encoding,c=r.callback,f=e.objectMode?1:u.length;if(Im(t,e,!1,f,u,l,c),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 Hq("_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||aM(this,n,r),this};Object.defineProperty(Ye.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function F_(t){return t.ending&&t.length===0&&t.bufferedRequest===null&&!t.finished&&!t.writing}function oM(t,e){t._final(function(r){e.pendingcb--,r&&Jo(t,r),e.prefinished=!0,t.emit("prefinish"),nu(t,e)})}function sM(t,e){!e.prefinished&&!e.finalCalled&&(typeof t._final=="function"&&!e.destroyed?(e.pendingcb++,e.finalCalled=!0,process.nextTick(oM,t,e)):(e.prefinished=!0,t.emit("prefinish")))}function nu(t,e){var r=F_(e);if(r&&(sM(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 aM(t,e,r){e.ending=!0,nu(t,e),r&&(e.finished?process.nextTick(r):t.once("finish",r)),e.ended=!0,t.writable=!1}function uM(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=jm.destroy;Ye.prototype._undestroy=jm.undestroy;Ye.prototype._destroy=function(t,e){e(t)}});var Ci=y((qae,k_)=>{"use strict";var lM=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};k_.exports=Lr;var A_=qm(),Bm=Nm();Ko()(Lr,A_);for(Lm=lM(Bm.prototype),kc=0;kc<Lm.length;kc++)Tc=Lm[kc],Lr.prototype[Tc]||(Lr.prototype[Tc]=Bm.prototype[Tc]);var Lm,Tc,kc;function Lr(t){if(!(this instanceof Lr))return new Lr(t);A_.call(this,t),Bm.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",cM)))}Object.defineProperty(Lr.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});Object.defineProperty(Lr.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});Object.defineProperty(Lr.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function cM(){this._writableState.ended||process.nextTick(fM,this)}function fM(t){t.end()}Object.defineProperty(Lr.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 R_=y((Mm,P_)=>{var Pc=require("buffer"),Br=Pc.Buffer;function T_(t,e){for(var r in t)e[r]=t[r]}Br.from&&Br.alloc&&Br.allocUnsafe&&Br.allocUnsafeSlow?P_.exports=Pc:(T_(Pc,Mm),Mm.Buffer=Si);function Si(t,e,r){return Br(t,e,r)}Si.prototype=Object.create(Br.prototype);T_(Br,Si);Si.from=function(t,e,r){if(typeof t=="number")throw new TypeError("Argument must not be a number");return Br(t,e,r)};Si.alloc=function(t,e,r){if(typeof t!="number")throw new TypeError("Argument must be a number");var n=Br(t);return e!==void 0?typeof r=="string"?n.fill(e,r):n.fill(e):n.fill(0),n};Si.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return Br(t)};Si.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return Pc.SlowBuffer(t)}});var Vm=y(I_=>{"use strict";var Hm=R_().Buffer,$_=Hm.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 dM(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 hM(t){var e=dM(t);if(typeof e!="string"&&(Hm.isEncoding===$_||!$_(t)))throw new Error("Unknown encoding: "+t);return e||t}I_.StringDecoder=ou;function ou(t){this.encoding=hM(t);var e;switch(this.encoding){case"utf16le":this.text=vM,this.end=bM,e=4;break;case"utf8":this.fillLast=gM,e=4;break;case"base64":this.text=wM,this.end=_M,e=3;break;default:this.write=EM,this.end=CM;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=Hm.allocUnsafe(e)}ou.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||""};ou.prototype.end=DM;ou.prototype.text=yM;ou.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 Um(t){return t<=127?0:t>>5===6?2:t>>4===14?3:t>>3===30?4:t>>6===2?-1:-2}function pM(t,e,r){var n=e.length-1;if(n<r)return 0;var i=Um(e[n]);return i>=0?(i>0&&(t.lastNeed=i-1),i):--n<r||i===-2?0:(i=Um(e[n]),i>=0?(i>0&&(t.lastNeed=i-2),i):--n<r||i===-2?0:(i=Um(e[n]),i>=0?(i>0&&(i===2?i=0:t.lastNeed=i-3),i):0))}function mM(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 gM(t){var e=this.lastTotal-this.lastNeed,r=mM(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 yM(t,e){var r=pM(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 DM(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"\uFFFD":e}function vM(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 bM(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 wM(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 _M(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function EM(t){return t.toString(this.encoding)}function CM(t){return t&&t.length?this.write(t):""}});var Rc=y((Uae,L_)=>{"use strict";var j_=Mn().codes.ERR_STREAM_PREMATURE_CLOSE;function SM(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 xM(){}function FM(t){return t.setHeader&&typeof t.abort=="function"}function N_(t,e,r){if(typeof e=="function")return N_(t,null,e);e||(e={}),r=SM(r||xM);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,l=function(){n=!1,u=!0,i||r.call(t)},c=function(m){r.call(t,m)},f=function(){var m;if(n&&!u)return(!t._readableState||!t._readableState.ended)&&(m=new j_),r.call(t,m);if(i&&!s)return(!t._writableState||!t._writableState.ended)&&(m=new j_),r.call(t,m)},h=function(){t.req.on("finish",a)};return FM(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",l),t.on("finish",a),e.error!==!1&&t.on("error",c),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",l),t.removeListener("error",c),t.removeListener("close",f)}}L_.exports=N_});var q_=y((Hae,B_)=>{"use strict";var $c;function Hn(t,e,r){return e=OM(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function OM(t){var e=AM(t,"string");return typeof e=="symbol"?e:String(e)}function AM(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 kM=Rc(),Vn=Symbol("lastResolve"),xi=Symbol("lastReject"),su=Symbol("error"),Ic=Symbol("ended"),Fi=Symbol("lastPromise"),zm=Symbol("handlePromise"),Oi=Symbol("stream");function zn(t,e){return{value:t,done:e}}function TM(t){var e=t[Vn];if(e!==null){var r=t[Oi].read();r!==null&&(t[Fi]=null,t[Vn]=null,t[xi]=null,e(zn(r,!1)))}}function PM(t){process.nextTick(TM,t)}function RM(t,e){return function(r,n){t.then(function(){if(e[Ic]){r(zn(void 0,!0));return}e[zm](r,n)},n)}}var $M=Object.getPrototypeOf(function(){}),IM=Object.setPrototypeOf(($c={get stream(){return this[Oi]},next:function(){var e=this,r=this[su];if(r!==null)return Promise.reject(r);if(this[Ic])return Promise.resolve(zn(void 0,!0));if(this[Oi].destroyed)return new Promise(function(s,a){process.nextTick(function(){e[su]?a(e[su]):s(zn(void 0,!0))})});var n=this[Fi],i;if(n)i=new Promise(RM(n,this));else{var o=this[Oi].read();if(o!==null)return Promise.resolve(zn(o,!1));i=new Promise(this[zm])}return this[Fi]=i,i}},Hn($c,Symbol.asyncIterator,function(){return this}),Hn($c,"return",function(){var e=this;return new Promise(function(r,n){e[Oi].destroy(null,function(i){if(i){n(i);return}r(zn(void 0,!0))})})}),$c),$M),jM=function(e){var r,n=Object.create(IM,(r={},Hn(r,Oi,{value:e,writable:!0}),Hn(r,Vn,{value:null,writable:!0}),Hn(r,xi,{value:null,writable:!0}),Hn(r,su,{value:null,writable:!0}),Hn(r,Ic,{value:e._readableState.endEmitted,writable:!0}),Hn(r,zm,{value:function(o,s){var a=n[Oi].read();a?(n[Fi]=null,n[Vn]=null,n[xi]=null,o(zn(a,!1))):(n[Vn]=o,n[xi]=s)},writable:!0}),r));return n[Fi]=null,kM(e,function(i){if(i&&i.code!=="ERR_STREAM_PREMATURE_CLOSE"){var o=n[xi];o!==null&&(n[Fi]=null,n[Vn]=null,n[xi]=null,o(i)),n[su]=i;return}var s=n[Vn];s!==null&&(n[Fi]=null,n[Vn]=null,n[xi]=null,s(zn(void 0,!0))),n[Ic]=!0}),e.on("readable",PM.bind(null,n)),n};B_.exports=jM});var V_=y((Vae,H_)=>{"use strict";function M_(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(l){r(l);return}a.done?e(u):Promise.resolve(u).then(n,i)}function NM(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function s(u){M_(o,n,i,s,a,"next",u)}function a(u){M_(o,n,i,s,a,"throw",u)}s(void 0)})}}function U_(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 LM(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?U_(Object(r),!0).forEach(function(n){BM(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):U_(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function BM(t,e,r){return e=qM(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function qM(t){var e=MM(t,"string");return typeof e=="symbol"?e:String(e)}function MM(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 UM=Mn().codes.ERR_INVALID_ARG_TYPE;function HM(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 UM("iterable",["Iterable"],e);var i=new t(LM({objectMode:!0},r)),o=!1;i._read=function(){o||(o=!0,s())};function s(){return a.apply(this,arguments)}function a(){return a=NM(function*(){try{var u=yield n.next(),l=u.value,c=u.done;c?i.push(null):i.push(yield l)?s():o=!1}catch(f){i.destroy(f)}}),a.apply(this,arguments)}return i}H_.exports=HM});var qm=y((Gae,eE)=>{"use strict";eE.exports=ge;var Xo;ge.ReadableState=K_;var zae=require("events").EventEmitter,W_=function(e,r){return e.listeners(r).length},uu=Fm(),jc=require("buffer").Buffer,VM=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function zM(t){return jc.from(t)}function GM(t){return jc.isBuffer(t)||t instanceof VM}var Gm=require("util"),ae;Gm&&Gm.debuglog?ae=Gm.debuglog("stream"):ae=function(){};var WM=h_(),Qm=km(),KM=Tm(),YM=KM.getHighWaterMark,Nc=Mn().codes,JM=Nc.ERR_INVALID_ARG_TYPE,XM=Nc.ERR_STREAM_PUSH_AFTER_EOF,ZM=Nc.ERR_METHOD_NOT_IMPLEMENTED,QM=Nc.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,Zo,Wm,Km;Ko()(ge,uu);var au=Qm.errorOrDestroy,Ym=["error","close","destroy","pause","resume"];function e4(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 K_(t,e,r){Xo=Xo||Ci(),t=t||{},typeof r!="boolean"&&(r=e instanceof Xo),this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=YM(this,t,"readableHighWaterMark",r),this.buffer=new WM,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&&(Zo||(Zo=Vm().StringDecoder),this.decoder=new Zo(t.encoding),this.encoding=t.encoding)}function ge(t){if(Xo=Xo||Ci(),!(this instanceof ge))return new ge(t);var e=this instanceof Xo;this._readableState=new K_(t,this,e),this.readable=!0,t&&(typeof t.read=="function"&&(this._read=t.read),typeof t.destroy=="function"&&(this._destroy=t.destroy)),uu.call(this)}Object.defineProperty(ge.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}});ge.prototype.destroy=Qm.destroy;ge.prototype._undestroy=Qm.undestroy;ge.prototype._destroy=function(t,e){e(t)};ge.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=jc.from(t,e),e=""),n=!0),Y_(this,t,e,!1,n)};ge.prototype.unshift=function(t){return Y_(this,t,null,!0,!1)};function Y_(t,e,r,n,i){ae("readableAddChunk",e);var o=t._readableState;if(e===null)o.reading=!1,n4(t,o);else{var s;if(i||(s=t4(o,e)),s)au(t,s);else if(o.objectMode||e&&e.length>0)if(typeof e!="string"&&!o.objectMode&&Object.getPrototypeOf(e)!==jc.prototype&&(e=zM(e)),n)o.endEmitted?au(t,new QM):Jm(t,o,e,!0);else if(o.ended)au(t,new XM);else{if(o.destroyed)return!1;o.reading=!1,o.decoder&&!r?(e=o.decoder.write(e),o.objectMode||e.length!==0?Jm(t,o,e,!1):Zm(t,o)):Jm(t,o,e,!1)}else n||(o.reading=!1,Zm(t,o))}return!o.ended&&(o.length<o.highWaterMark||o.length===0)}function Jm(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&&Lc(t)),Zm(t,e)}function t4(t,e){var r;return!GM(e)&&typeof e!="string"&&e!==void 0&&!t.objectMode&&(r=new JM("chunk",["string","Buffer","Uint8Array"],e)),r}ge.prototype.isPaused=function(){return this._readableState.flowing===!1};ge.prototype.setEncoding=function(t){Zo||(Zo=Vm().StringDecoder);var e=new Zo(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 z_=1073741824;function r4(t){return t>=z_?t=z_:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}function G_(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=r4(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}ge.prototype.read=function(t){ae("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 ae("read: emitReadable",e.length,e.ended),e.length===0&&e.ended?Xm(this):Lc(this),null;if(t=G_(t,e),t===0&&e.ended)return e.length===0&&Xm(this),null;var n=e.needReadable;ae("need readable",n),(e.length===0||e.length-t<e.highWaterMark)&&(n=!0,ae("length less than watermark",n)),e.ended||e.reading?(n=!1,ae("reading or ended",n)):n&&(ae("do read"),e.reading=!0,e.sync=!0,e.length===0&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1,e.reading||(t=G_(r,e)));var i;return t>0?i=Z_(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&&Xm(this)),i!==null&&this.emit("data",i),i};function n4(t,e){if(ae("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?Lc(t):(e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,J_(t)))}}function Lc(t){var e=t._readableState;ae("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(ae("emitReadable",e.flowing),e.emittedReadable=!0,process.nextTick(J_,t))}function J_(t){var e=t._readableState;ae("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,eg(t)}function Zm(t,e){e.readingMore||(e.readingMore=!0,process.nextTick(i4,t,e))}function i4(t,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&e.length===0);){var r=e.length;if(ae("maybeReadMore read 0"),t.read(0),r===e.length)break}e.readingMore=!1}ge.prototype._read=function(t){au(this,new ZM("_read()"))};ge.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,ae("pipe count=%d opts=%j",n.pipesCount,e);var i=(!e||e.end!==!1)&&t!==process.stdout&&t!==process.stderr,o=i?a:b;n.endEmitted?process.nextTick(o):r.once("end",o),t.on("unpipe",s);function s(D,_){ae("onunpipe"),D===r&&_&&_.hasUnpiped===!1&&(_.hasUnpiped=!0,c())}function a(){ae("onend"),t.end()}var u=o4(r);t.on("drain",u);var l=!1;function c(){ae("cleanup"),t.removeListener("close",d),t.removeListener("finish",m),t.removeListener("drain",u),t.removeListener("error",h),t.removeListener("unpipe",s),r.removeListener("end",a),r.removeListener("end",b),r.removeListener("data",f),l=!0,n.awaitDrain&&(!t._writableState||t._writableState.needDrain)&&u()}r.on("data",f);function f(D){ae("ondata");var _=t.write(D);ae("dest.write",_),_===!1&&((n.pipesCount===1&&n.pipes===t||n.pipesCount>1&&Q_(n.pipes,t)!==-1)&&!l&&(ae("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function h(D){ae("onerror",D),b(),t.removeListener("error",h),W_(t,"error")===0&&au(t,D)}e4(t,"error",h);function d(){t.removeListener("finish",m),b()}t.once("close",d);function m(){ae("onfinish"),t.removeListener("close",d),b()}t.once("finish",m);function b(){ae("unpipe"),r.unpipe(t)}return t.emit("pipe",r),n.flowing||(ae("pipe resume"),r.resume()),t};function o4(t){return function(){var r=t._readableState;ae("pipeOnDrain",r.awaitDrain),r.awaitDrain&&r.awaitDrain--,r.awaitDrain===0&&W_(t,"data")&&(r.flowing=!0,eg(t))}}ge.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=Q_(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)};ge.prototype.on=function(t,e){var r=uu.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,ae("on readable",n.length,n.reading),n.length?Lc(this):n.reading||process.nextTick(s4,this)),r};ge.prototype.addListener=ge.prototype.on;ge.prototype.removeListener=function(t,e){var r=uu.prototype.removeListener.call(this,t,e);return t==="readable"&&process.nextTick(X_,this),r};ge.prototype.removeAllListeners=function(t){var e=uu.prototype.removeAllListeners.apply(this,arguments);return(t==="readable"||t===void 0)&&process.nextTick(X_,this),e};function X_(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 s4(t){ae("readable nexttick read 0"),t.read(0)}ge.prototype.resume=function(){var t=this._readableState;return t.flowing||(ae("resume"),t.flowing=!t.readableListening,a4(this,t)),t.paused=!1,this};function a4(t,e){e.resumeScheduled||(e.resumeScheduled=!0,process.nextTick(u4,t,e))}function u4(t,e){ae("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),eg(t),e.flowing&&!e.reading&&t.read(0)}ge.prototype.pause=function(){return ae("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(ae("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function eg(t){var e=t._readableState;for(ae("flow",e.flowing);e.flowing&&t.read()!==null;);}ge.prototype.wrap=function(t){var e=this,r=this._readableState,n=!1;t.on("end",function(){if(ae("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(ae("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<Ym.length;o++)t.on(Ym[o],this.emit.bind(this,Ym[o]));return this._read=function(s){ae("wrapped _read",s),n&&(n=!1,t.resume())},this};typeof Symbol=="function"&&(ge.prototype[Symbol.asyncIterator]=function(){return Wm===void 0&&(Wm=q_()),Wm(this)});Object.defineProperty(ge.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}});Object.defineProperty(ge.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}});Object.defineProperty(ge.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}});ge._fromList=Z_;Object.defineProperty(ge.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function Z_(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 Xm(t){var e=t._readableState;ae("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,process.nextTick(l4,e,t))}function l4(t,e){if(ae("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"&&(ge.from=function(t,e){return Km===void 0&&(Km=V_()),Km(ge,t,e)});function Q_(t,e){for(var r=0,n=t.length;r<n;r++)if(t[r]===e)return r;return-1}});var tg=y((Wae,rE)=>{"use strict";rE.exports=dn;var Bc=Mn().codes,c4=Bc.ERR_METHOD_NOT_IMPLEMENTED,f4=Bc.ERR_MULTIPLE_CALLBACK,d4=Bc.ERR_TRANSFORM_ALREADY_TRANSFORMING,h4=Bc.ERR_TRANSFORM_WITH_LENGTH_0,qc=Ci();Ko()(dn,qc);function p4(t,e){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(n===null)return this.emit("error",new f4);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);qc.call(this,t),this._transformState={afterTransform:p4.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",m4)}function m4(){var t=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(e,r){tE(t,e,r)}):tE(this,null,null)}dn.prototype.push=function(t,e){return this._transformState.needTransform=!1,qc.prototype.push.call(this,t,e)};dn.prototype._transform=function(t,e,r){r(new c4("_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){qc.prototype._destroy.call(this,t,function(r){e(r)})};function tE(t,e,r){if(e)return t.emit("error",e);if(r!=null&&t.push(r),t._writableState.length)throw new h4;if(t._transformState.transforming)throw new d4;return t.push(null)}});var oE=y((Kae,iE)=>{"use strict";iE.exports=lu;var nE=tg();Ko()(lu,nE);function lu(t){if(!(this instanceof lu))return new lu(t);nE.call(this,t)}lu.prototype._transform=function(t,e,r){r(null,t)}});var cE=y((Yae,lE)=>{"use strict";var rg;function g4(t){var e=!1;return function(){e||(e=!0,t.apply(void 0,arguments))}}var uE=Mn().codes,y4=uE.ERR_MISSING_ARGS,D4=uE.ERR_STREAM_DESTROYED;function sE(t){if(t)throw t}function v4(t){return t.setHeader&&typeof t.abort=="function"}function b4(t,e,r,n){n=g4(n);var i=!1;t.on("close",function(){i=!0}),rg===void 0&&(rg=Rc()),rg(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,v4(t))return t.abort();if(typeof t.destroy=="function")return t.destroy();n(s||new D4("pipe"))}}}function aE(t){t()}function w4(t,e){return t.pipe(e)}function _4(t){return!t.length||typeof t[t.length-1]!="function"?sE:t.pop()}function E4(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];var n=_4(e);if(Array.isArray(e[0])&&(e=e[0]),e.length<2)throw new y4("streams");var i,o=e.map(function(s,a){var u=a<e.length-1,l=a>0;return b4(s,u,l,function(c){i||(i=c),c&&o.forEach(aE),!u&&(o.forEach(aE),n(i))})});return e.reduce(w4)}lE.exports=E4});var fE=y((hr,fu)=>{var cu=require("stream");process.env.READABLE_STREAM==="disable"&&cu?(fu.exports=cu.Readable,Object.assign(fu.exports,cu),fu.exports.Stream=cu):(hr=fu.exports=qm(),hr.Stream=cu||hr,hr.Readable=hr,hr.Writable=Nm(),hr.Duplex=Ci(),hr.Transform=tg(),hr.PassThrough=oE(),hr.finished=Rc(),hr.pipeline=cE())});var ig=y(ng=>{var dE;(function(t){typeof DO_NOT_EXPORT_CRC>"u"?typeof ng=="object"?t(ng):typeof define=="function"&&define.amd?define(function(){var e={};return t(e),e}):t(dE={}):t(dE={})})(function(t){t.version="1.2.2";function e(){for(var x=0,L=new Array(256),S=0;S!=256;++S)x=S,x=x&1?-306674912^x>>>1:x>>>1,x=x&1?-306674912^x>>>1:x>>>1,x=x&1?-306674912^x>>>1:x>>>1,x=x&1?-306674912^x>>>1:x>>>1,x=x&1?-306674912^x>>>1:x>>>1,x=x&1?-306674912^x>>>1:x>>>1,x=x&1?-306674912^x>>>1:x>>>1,x=x&1?-306674912^x>>>1:x>>>1,L[S]=x;return typeof Int32Array<"u"?new Int32Array(L):L}var r=e();function n(x){var L=0,S=0,I=0,$=typeof Int32Array<"u"?new Int32Array(4096):new Array(4096);for(I=0;I!=256;++I)$[I]=x[I];for(I=0;I!=256;++I)for(S=x[I],L=256+I;L<4096;L+=256)S=$[L]=S>>>8^x[S&255];var B=[];for(I=1;I!=16;++I)B[I-1]=typeof Int32Array<"u"?$.subarray(I*256,I*256+256):$.slice(I*256,I*256+256);return B}var i=n(r),o=i[0],s=i[1],a=i[2],u=i[3],l=i[4],c=i[5],f=i[6],h=i[7],d=i[8],m=i[9],b=i[10],D=i[11],_=i[12],F=i[13],g=i[14];function C(x,L){for(var S=L^-1,I=0,$=x.length;I<$;)S=S>>>8^r[(S^x.charCodeAt(I++))&255];return~S}function A(x,L){for(var S=L^-1,I=x.length-15,$=0;$<I;)S=g[x[$++]^S&255]^F[x[$++]^S>>8&255]^_[x[$++]^S>>16&255]^D[x[$++]^S>>>24]^b[x[$++]]^m[x[$++]]^d[x[$++]]^h[x[$++]]^f[x[$++]]^c[x[$++]]^l[x[$++]]^u[x[$++]]^a[x[$++]]^s[x[$++]]^o[x[$++]]^r[x[$++]];for(I+=15;$<I;)S=S>>>8^r[(S^x[$++])&255];return~S}function T(x,L){for(var S=L^-1,I=0,$=x.length,B=0,q=0;I<$;)B=x.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=x.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=A,t.str=T})});var pE=y((Xae,hE)=>{"use strict";var{Transform:C4}=fE(),S4=ig(),og=class extends C4{constructor(e){super(e),this.checksum=Buffer.allocUnsafe(4),this.checksum.writeInt32BE(0,0),this.rawSize=0}_transform(e,r,n){e&&(this.checksum=S4.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}};hE.exports=og});var gE=y((Zae,mE)=>{"use strict";var{DeflateRaw:x4}=require("zlib"),F4=ig(),sg=class extends x4{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=F4.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}};mE.exports=sg});var DE=y((Qae,yE)=>{"use strict";yE.exports={CRC32Stream:pE(),DeflateCRC32Stream:gE()}});var du=y(Qo=>{"use strict";Object.defineProperty(Qo,"__esModule",{value:!0});Qo.checksum=Qo.checksumFile=void 0;var O4=require("fs"),A4=require("crypto"),bE=require("stream"),k4=require("util"),{CRC32Stream:T4}=DE(),vE=(0,k4.promisify)(bE.pipeline),P4=(t,e,r)=>wE(O4.createReadStream(t),e,r);Qo.checksumFile=P4;async function wE(t,e,r="hex"){let n=$4(t);if(e==="crc32"){let o=new T4,s=vE(n,o);return o.resume(),await s,o.end(),Buffer.from(o.digest()).toString(r)}let i=(0,A4.createHash)(e);return await vE(n,i),i.end(),i.digest(r)}Qo.checksum=wE;function R4(t){return t!=null&&typeof t=="object"&&typeof t.read=="function"&&typeof t.pipe=="function"}var $4=t=>R4(t)?t:new bE.Readable({read(){this.push(t),this.push(null)}})});var ag=y((tue,_E)=>{_E.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 Mc=y(CE=>{var EE={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 I4(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(EE))CE[t]=I4(EE[t])});var AE=y((nue,OE)=>{var j4=require("fs"),at=require("path"),SE=ag(),N4=Mc(),L4=typeof process=="object"&&process.platform==="win32",xE=t=>typeof t=="object"&&t!==null,FE=new Uint32Array(256).map((t,e)=>{for(let r=0;r<8;r++)(e&1)!==0?e=3988292384^e>>>1:e>>>=1;return e>>>0});function Je(t){this.sep=at.sep,this.fs=j4,xE(t)&&xE(t.fs)&&typeof t.fs.statSync=="function"&&(this.fs=t.fs)}OE.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 N4.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 l=at.dirname(t);o.fs.exists(l,function(c){c||o.makeDir(l),o.fs.open(t,"w",438,function(f,h){f?o.fs.chmod(t,438,function(){o.fs.open(t,"w",438,function(d,m){o.fs.write(m,e,0,e.length,0,function(){o.fs.close(m,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),l=e.fs.statSync(u);(!i||i.test(u))&&s.push(at.normalize(u)+(l.isDirectory()?e.sep:"")),l.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,l){if(u)return e(u);l&&(n.push(at.normalize(a)+(l.isDirectory()?r.sep:"")),l.isDirectory()?r.findFilesAsync(a,function(c,f){if(c)return e(c);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 FE[(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 SE.STORED:return"STORED ("+t+")";case SE.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=L4;Je.crcTable=FE});var TE=y((iue,kE)=>{var B4=require("path");kE.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=B4.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 RE=y((oue,PE)=>{PE.exports={efs:!0,encode:t=>Buffer.from(t,"utf8"),decode:t=>t.toString("utf8")}});var ts=y((sue,es)=>{es.exports=AE();es.exports.Constants=ag();es.exports.Errors=Mc();es.exports.FileAttr=TE();es.exports.decoder=RE()});var IE=y((aue,$E)=>{var Gn=ts(),H=Gn.Constants;$E.exports=function(){var t=20,e=10,r=0,n=0,i=0,o=0,s=0,a=0,u=0,l=0,c=0,f=0,h=0,d=0,m=0;t|=Gn.isWin?2560:768,r|=H.FLG_EFS;let b={extraLen:0},D=g=>Math.max(0,g)>>>0,_=g=>Math.max(0,g)&65535,F=g=>Math.max(0,g)&255;return i=Gn.fromDate2DOS(new Date),{get made(){return t},set made(g){t=g},get version(){return e},set version(g){e=g},get flags(){return r},set flags(g){r=g},get flags_efs(){return(r&H.FLG_EFS)>0},set flags_efs(g){g?r|=H.FLG_EFS:r&=~H.FLG_EFS},get flags_desc(){return(r&H.FLG_DESC)>0},set flags_desc(g){g?r|=H.FLG_DESC:r&=~H.FLG_DESC},get method(){return n},set method(g){switch(g){case H.STORED:this.version=10;case H.DEFLATED:default:this.version=20}n=g},get time(){return Gn.fromDOS2Date(this.timeval)},set time(g){this.timeval=Gn.fromDate2DOS(g)},get timeval(){return i},set timeval(g){i=D(g)},get timeHighByte(){return F(i>>>8)},get crc(){return o},set crc(g){o=D(g)},get compressedSize(){return s},set compressedSize(g){s=D(g)},get size(){return a},set size(g){a=D(g)},get fileNameLength(){return u},set fileNameLength(g){u=g},get extraLength(){return l},set extraLength(g){l=g},get extraLocalLength(){return b.extraLen},set extraLocalLength(g){b.extraLen=g},get commentLength(){return c},set commentLength(g){c=g},get diskNumStart(){return f},set diskNumStart(g){f=D(g)},get inAttr(){return h},set inAttr(g){h=D(g)},get attr(){return d},set attr(g){d=D(g)},get fileAttr(){return(d||0)>>16&4095},get offset(){return m},set offset(g){m=D(g)},get encrypted(){return(r&H.FLG_ENC)===H.FLG_ENC},get centralHeaderSize(){return H.CENHDR+u+l+c},get realDataOffset(){return m+H.LOCHDR+b.fnameLen+b.extraLen},get localHeader(){return b},loadLocalHeaderFromBinary:function(g){var C=g.slice(m,m+H.LOCHDR);if(C.readUInt32LE(0)!==H.LOCSIG)throw Gn.Errors.INVALID_LOC();b.version=C.readUInt16LE(H.LOCVER),b.flags=C.readUInt16LE(H.LOCFLG),b.method=C.readUInt16LE(H.LOCHOW),b.time=C.readUInt32LE(H.LOCTIM),b.crc=C.readUInt32LE(H.LOCCRC),b.compressedSize=C.readUInt32LE(H.LOCSIZ),b.size=C.readUInt32LE(H.LOCLEN),b.fnameLen=C.readUInt16LE(H.LOCNAM),b.extraLen=C.readUInt16LE(H.LOCEXT);let A=m+H.LOCHDR+b.fnameLen,T=A+b.extraLen;return g.slice(A,T)},loadFromBinary:function(g){if(g.length!==H.CENHDR||g.readUInt32LE(0)!==H.CENSIG)throw Gn.Errors.INVALID_CEN();t=g.readUInt16LE(H.CENVEM),e=g.readUInt16LE(H.CENVER),r=g.readUInt16LE(H.CENFLG),n=g.readUInt16LE(H.CENHOW),i=g.readUInt32LE(H.CENTIM),o=g.readUInt32LE(H.CENCRC),s=g.readUInt32LE(H.CENSIZ),a=g.readUInt32LE(H.CENLEN),u=g.readUInt16LE(H.CENNAM),l=g.readUInt16LE(H.CENEXT),c=g.readUInt16LE(H.CENCOM),f=g.readUInt16LE(H.CENDSK),h=g.readUInt16LE(H.CENATT),d=g.readUInt32LE(H.CENATX),m=g.readUInt32LE(H.CENOFF)},localHeaderToBinary:function(){var g=Buffer.alloc(H.LOCHDR);return g.writeUInt32LE(H.LOCSIG,0),g.writeUInt16LE(e,H.LOCVER),g.writeUInt16LE(r,H.LOCFLG),g.writeUInt16LE(n,H.LOCHOW),g.writeUInt32LE(i,H.LOCTIM),g.writeUInt32LE(o,H.LOCCRC),g.writeUInt32LE(s,H.LOCSIZ),g.writeUInt32LE(a,H.LOCLEN),g.writeUInt16LE(u,H.LOCNAM),g.writeUInt16LE(b.extraLen,H.LOCEXT),g},centralHeaderToBinary:function(){var g=Buffer.alloc(H.CENHDR+u+l+c);return g.writeUInt32LE(H.CENSIG,0),g.writeUInt16LE(t,H.CENVEM),g.writeUInt16LE(e,H.CENVER),g.writeUInt16LE(r,H.CENFLG),g.writeUInt16LE(n,H.CENHOW),g.writeUInt32LE(i,H.CENTIM),g.writeUInt32LE(o,H.CENCRC),g.writeUInt32LE(s,H.CENSIZ),g.writeUInt32LE(a,H.CENLEN),g.writeUInt16LE(u,H.CENNAM),g.writeUInt16LE(l,H.CENEXT),g.writeUInt16LE(c,H.CENCOM),g.writeUInt16LE(f,H.CENDSK),g.writeUInt16LE(h,H.CENATT),g.writeUInt32LE(d,H.CENATX),g.writeUInt32LE(m,H.CENOFF),g},toJSON:function(){let g=function(C){return C+" bytes"};return{made:t,version:e,flags:r,method:Gn.methodToString(n),time:this.time,crc:"0x"+o.toString(16).toUpperCase(),compressedSize:g(s),size:g(a),fileNameLength:g(u),extraLength:g(l),commentLength:g(c),diskNumStart:f,inAttr:h,attr:d,offset:m,centralHeaderSize:g(H.CENHDR+u+l+c)}},toString:function(){return JSON.stringify(this.toJSON(),null," ")}}}});var NE=y((uue,jE)=>{var rs=ts(),He=rs.Constants;jE.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 He.ENDHDR+i},loadFromBinary:function(o){if((o.length!==He.ENDHDR||o.readUInt32LE(0)!==He.ENDSIG)&&(o.length<He.ZIP64HDR||o.readUInt32LE(0)!==He.ZIP64SIG))throw rs.Errors.INVALID_END();o.readUInt32LE(0)===He.ENDSIG?(t=o.readUInt16LE(He.ENDSUB),e=o.readUInt16LE(He.ENDTOT),r=o.readUInt32LE(He.ENDSIZ),n=o.readUInt32LE(He.ENDOFF),i=o.readUInt16LE(He.ENDCOM)):(t=rs.readBigUInt64LE(o,He.ZIP64SUB),e=rs.readBigUInt64LE(o,He.ZIP64TOT),r=rs.readBigUInt64LE(o,He.ZIP64SIZE),n=rs.readBigUInt64LE(o,He.ZIP64OFF),i=0)},toBinary:function(){var o=Buffer.alloc(He.ENDHDR+i);return o.writeUInt32LE(He.ENDSIG,0),o.writeUInt32LE(0,4),o.writeUInt16LE(t,He.ENDSUB),o.writeUInt16LE(e,He.ENDTOT),o.writeUInt32LE(r,He.ENDSIZ),o.writeUInt32LE(n,He.ENDOFF),o.writeUInt16LE(i,He.ENDCOM),o.fill(" ",He.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 lg=y(ug=>{ug.EntryHeader=IE();ug.MainHeader=NE()});var BE=y((cue,LE)=>{LE.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 l=0;l<o.length;l++){var c=o[l];c.copy(a,u),u+=c.length}n&&n(a)}),i.end(t)}}}});var ME=y((fue,qE)=>{var q4=+(process.versions?process.versions.node:"").split(".")[0]||0;qE.exports=function(t,e){var r=require("zlib");let n=q4>=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),l=0;u.fill(0);for(var c=0;c<s.length;c++){var f=s[c];f.copy(u,l),l+=f.length}i&&i(u)}),o.end(t)}}}});var GE=y((due,zE)=>{"use strict";var{randomFillSync:UE}=require("crypto"),M4=Mc(),U4=new Uint32Array(256).map((t,e)=>{for(let r=0;r<8;r++)(e&1)!==0?e=e>>>1^3988292384:e>>>=1;return e>>>0}),VE=(t,e)=>Math.imul(t,e)>>>0,HE=(t,e)=>U4[(t^e)&255]^t>>>8,hu=()=>typeof UE=="function"?UE(Buffer.alloc(12)):hu.node();hu.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 Uc={genSalt:hu};function Hc(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])}Hc.prototype.updateKeys=function(t){let e=this.keys;return e[0]=HE(e[0],t),e[1]+=e[0]&255,e[1]=VE(e[1],134775813)+1,e[2]=HE(e[2],e[1]>>>24),t};Hc.prototype.next=function(){let t=(this.keys[2]|2)>>>0;return VE(t,t^1)>>8&255};function H4(t){let e=new Hc(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 V4(t){let e=new Hc(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 z4(t,e,r){if(!t||!Buffer.isBuffer(t)||t.length<12)return Buffer.alloc(0);let n=H4(r),i=n(t.slice(0,12)),o=(e.flags&8)===8?e.timeHighByte:e.crc>>>24;if(i[11]!==o)throw M4.WRONG_PASSWORD();return n(t.slice(12))}function G4(t){Buffer.isBuffer(t)&&t.length>=12?Uc.genSalt=function(){return t.slice(0,12)}:t==="node"?Uc.genSalt=hu.node:Uc.genSalt=hu}function W4(t,e,r,n=!1){t==null&&(t=Buffer.alloc(0)),Buffer.isBuffer(t)||(t=Buffer.from(t.toString()));let i=V4(r),o=Uc.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)}zE.exports={decrypt:z4,encrypt:W4,_salter:G4}});var WE=y(Vc=>{Vc.Deflater=BE();Vc.Inflater=ME();Vc.ZipCrypto=GE()});var fg=y((pue,KE)=>{var ve=ts(),K4=lg(),Xe=ve.Constants,cg=WE();KE.exports=function(t,e){var r=new K4.EntryHeader,n=Buffer.alloc(0),i=Buffer.alloc(0),o=!1,s=null,a=Buffer.alloc(0),u=Buffer.alloc(0),l=!0;let c=t,f=typeof c.decoder=="object"?c.decoder:ve.decoder;l=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(g){if(r.flags_desc){let C={},A=r.realDataOffset+r.compressedSize;if(e.readUInt32LE(A)==Xe.LOCSIG||e.readUInt32LE(A)==Xe.CENSIG)throw ve.Errors.DESCRIPTOR_NOT_EXIST();if(e.readUInt32LE(A)==Xe.EXTSIG)C.crc=e.readUInt32LE(A+Xe.EXTCRC),C.compressedSize=e.readUInt32LE(A+Xe.EXTSIZ),C.size=e.readUInt32LE(A+Xe.EXTLEN);else if(e.readUInt16LE(A+12)===19280)C.crc=e.readUInt32LE(A+Xe.EXTCRC-4),C.compressedSize=e.readUInt32LE(A+Xe.EXTSIZ-4),C.size=e.readUInt32LE(A+Xe.EXTLEN-4);else throw ve.Errors.DESCRIPTOR_UNKNOWN();if(C.compressedSize!==r.compressedSize||C.size!==r.size||C.crc!==r.crc)throw ve.Errors.DESCRIPTOR_FAULTY();if(ve.crc32(g)!==C.crc)return!1}else if(ve.crc32(g)!==r.localHeader.crc)return!1;return!0}function m(g,C,A){if(typeof C>"u"&&typeof g=="string"&&(A=g,g=void 0),o)return g&&C&&C(Buffer.alloc(0),ve.Errors.DIRECTORY_CONTENT_ERROR()),Buffer.alloc(0);var T=h();if(T.length===0)return g&&C&&C(T),T;if(r.encrypted){if(typeof A!="string"&&!Buffer.isBuffer(A))throw ve.Errors.INVALID_PASS_PARAM();T=cg.ZipCrypto.decrypt(T,r,A)}var x=Buffer.alloc(r.size);switch(r.method){case ve.Constants.STORED:if(T.copy(x),d(x))return g&&C&&C(x),x;throw g&&C&&C(x,ve.Errors.BAD_CRC()),ve.Errors.BAD_CRC();case ve.Constants.DEFLATED:var L=new cg.Inflater(T,r.size);if(g)L.inflateAsync(function(S){S.copy(S,0),C&&(d(S)?C(S):C(S,ve.Errors.BAD_CRC()))});else{if(L.inflate(x).copy(x,0),!d(x))throw ve.Errors.BAD_CRC(`"${f.decode(n)}"`);return x}break;default:throw g&&C&&C(Buffer.alloc(0),ve.Errors.UNKNOWN_METHOD()),ve.Errors.UNKNOWN_METHOD()}}function b(g,C){if((!s||!s.length)&&Buffer.isBuffer(e))return g&&C&&C(h()),h();if(s.length&&!o){var A;switch(r.method){case ve.Constants.STORED:return r.compressedSize=r.size,A=Buffer.alloc(s.length),s.copy(A),g&&C&&C(A),A;default:case ve.Constants.DEFLATED:var T=new cg.Deflater(s);if(g)T.deflateAsync(function(L){A=Buffer.alloc(L.length),r.compressedSize=L.length,L.copy(A),C&&C(A)});else{var x=T.deflate();return r.compressedSize=x.length,x}T=null;break}}else if(g&&C)C(Buffer.alloc(0));else return Buffer.alloc(0)}function D(g,C){return(g.readUInt32LE(C+4)<<4)+g.readUInt32LE(C)}function _(g){try{for(var C=0,A,T,x;C+4<g.length;)A=g.readUInt16LE(C),C+=2,T=g.readUInt16LE(C),C+=2,x=g.slice(C,C+T),C+=T,Xe.ID_ZIP64===A&&F(x)}catch{throw ve.Errors.EXTRA_FIELD_PARSE_ERROR()}}function F(g){var C,A,T,x;g.length>=Xe.EF_ZIP64_SCOMP&&(C=D(g,Xe.EF_ZIP64_SUNCOMP),r.size===Xe.EF_ZIP64_OR_32&&(r.size=C)),g.length>=Xe.EF_ZIP64_RHO&&(A=D(g,Xe.EF_ZIP64_SCOMP),r.compressedSize===Xe.EF_ZIP64_OR_32&&(r.compressedSize=A)),g.length>=Xe.EF_ZIP64_DSN&&(T=D(g,Xe.EF_ZIP64_RHO),r.offset===Xe.EF_ZIP64_OR_32&&(r.offset=T)),g.length>=Xe.EF_ZIP64_DSN+4&&(x=g.readUInt32LE(Xe.EF_ZIP64_DSN),r.diskNumStart===Xe.EF_ZIP64_OR_16&&(r.diskNumStart=x))}return{get entryName(){return f.decode(n)},get rawEntryName(){return n},set entryName(g){n=ve.toBuffer(g,f.encode);var C=n[n.length-1];o=C===47||C===92,r.fileNameLength=n.length},get efs(){return typeof l=="function"?l(this.entryName):l},get extra(){return a},set extra(g){a=g,r.extraLength=g.length,_(g)},get comment(){return f.decode(i)},set comment(g){if(i=ve.toBuffer(g,f.encode),r.commentLength=i.length,i.length>65535)throw ve.Errors.COMMENT_TOO_LONG()},get name(){var g=f.decode(n);return o?g.substr(g.length-1).split("/").pop():g.split("/").pop()},get isDirectory(){return o},getCompressedData:function(){return b(!1,null)},getCompressedDataAsync:function(g){b(!0,g)},setData:function(g){s=ve.toBuffer(g,ve.decoder.encode),!o&&s.length?(r.size=s.length,r.method=ve.Constants.DEFLATED,r.crc=ve.crc32(g),r.changed=!0):r.method=ve.Constants.STORED},getData:function(g){return r.changed?s:m(!1,null,g)},getDataAsync:function(g,C){r.changed?g(s):m(!0,g,C)},set attr(g){r.attr=g},get attr(){return r.attr},set header(g){r.loadFromBinary(g)},get header(){return r},packCentralHeader:function(){r.flags_efs=this.efs,r.extraLength=a.length;var g=r.centralHeaderToBinary(),C=ve.Constants.CENHDR;return n.copy(g,C),C+=n.length,a.copy(g,C),C+=r.extraLength,i.copy(g,C),g},packLocalHeader:function(){let g=0;r.flags_efs=this.efs,r.extraLocalLength=u.length;let C=r.localHeaderToBinary(),A=Buffer.alloc(C.length+n.length+r.extraLocalLength);return C.copy(A,g),g+=C.length,n.copy(A,g),g+=n.length,u.copy(A,g),g+=u.length,A},toJSON:function(){let g=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:g(e),data:g(s)}},toString:function(){return JSON.stringify(this.toJSON(),null," ")}}}});var XE=y((mue,JE)=>{var YE=fg(),Y4=lg(),bt=ts();JE.exports=function(t,e){var r=[],n={},i=Buffer.alloc(0),o=new Y4.MainHeader,s=!1,a=null;let u=new Set,l=e,{noSort:c,decoder:f}=l;t?m(l.readEntries):s=!0;function h(){let D=new Set;for(let _ of Object.keys(n)){let F=_.split("/");if(F.pop(),!!F.length)for(let g=0;g<F.length;g++){let C=F.slice(0,g+1).join("/")+"/";D.add(C)}}for(let _ of D)if(!(_ in n)){let F=new YE(l);F.entryName=_,F.attr=16,F.temporary=!0,r.push(F),n[F.entryName]=F,u.add(F)}}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 D=o.offset,_=0;_<r.length;_++){var F=D,g=new YE(l,t);g.header=t.slice(F,F+=bt.Constants.CENHDR),g.entryName=t.slice(F,F+=g.header.fileNameLength),g.header.extraLength&&(g.extra=t.slice(F,F+=g.header.extraLength)),g.header.commentLength&&(g.comment=t.slice(F,F+g.header.commentLength)),D+=g.header.centralHeaderSize,r[_]=g,n[g.entryName]=g}u.clear(),h()}function m(D){var _=t.length-bt.Constants.ENDHDR,F=Math.max(0,_-65535),g=F,C=t.length,A=-1,T=0;for((typeof l.trailingSpace=="boolean"?l.trailingSpace:!1)&&(F=0),_;_>=g;_--)if(t[_]===80){if(t.readUInt32LE(_)===bt.Constants.ENDSIG){A=_,T=_,C=_+bt.Constants.ENDHDR,g=_-bt.Constants.END64HDR;continue}if(t.readUInt32LE(_)===bt.Constants.END64SIG){g=F;continue}if(t.readUInt32LE(_)===bt.Constants.ZIP64SIG){A=_,C=_+bt.readBigUInt64LE(t,_+bt.Constants.ZIP64SIZE)+bt.Constants.ZIP64LEAD;break}}if(A==-1)throw bt.Errors.INVALID_FORMAT();o.loadFromBinary(t.slice(A,C)),o.commentLength&&(i=t.slice(T+bt.Constants.ENDHDR)),D&&d()}function b(){r.length>1&&!c&&r.sort((D,_)=>D.entryName.toLowerCase().localeCompare(_.entryName.toLowerCase()))}return{get entries(){return s||d(),r.filter(D=>!u.has(D))},get comment(){return f.decode(i)},set comment(D){i=bt.toBuffer(D,f.encode),o.commentLength=i.length},getEntryCount:function(){return s?r.length:o.diskEntries},forEach:function(D){this.entries.forEach(D)},getEntry:function(D){return s||d(),n[D]||null},setEntry:function(D){s||d(),r.push(D),n[D.entryName]=D,o.totalEntries=r.length},deleteFile:function(D,_=!0){s||d();let F=n[D];this.getEntryChildren(F,_).map(C=>C.entryName).forEach(this.deleteEntry)},deleteEntry:function(D){s||d();let _=n[D],F=r.indexOf(_);F>=0&&(r.splice(F,1),delete n[D],o.totalEntries=r.length)},getEntryChildren:function(D,_=!0){if(s||d(),typeof D=="object")if(D.isDirectory&&_){let F=[],g=D.entryName;for(let C of r)C.entryName.startsWith(g)&&F.push(C);return F}else return[D];return[]},getChildCount:function(D){if(D&&D.isDirectory){let _=this.getEntryChildren(D);return _.includes(D)?_.length-1:_.length}return 0},compressToBuffer:function(){s||d(),b();let D=[],_=[],F=0,g=0;o.size=0,o.offset=0;let C=0;for(let x of this.entries){let L=x.getCompressedData();x.header.offset=g;let S=x.packLocalHeader(),I=S.length+L.length;g+=I,D.push(S),D.push(L);let $=x.packCentralHeader();_.push($),o.size+=$.length,F+=I+$.length,C++}F+=o.mainHeaderSize,o.offset=g,o.totalEntries=C,g=0;let A=Buffer.alloc(F);for(let x of D)x.copy(A,g),g+=x.length;for(let x of _)x.copy(A,g),g+=x.length;let T=o.toBinary();return i&&i.copy(T,bt.Constants.ENDHDR),T.copy(A,g),t=A,s=!1,A},toAsyncBuffer:function(D,_,F,g){try{s||d(),b();let C=[],A=[],T=0,x=0,L=0;o.size=0,o.offset=0;let S=function(I){if(I.length>0){let $=I.shift(),B=$.entryName+$.extra.toString();F&&F(B),$.getCompressedDataAsync(function(q){g&&g(B),$.header.offset=x;let K=$.packLocalHeader(),V=K.length+q.length;x+=V,C.push(K),C.push(q);let E=$.packCentralHeader();A.push(E),o.size+=E.length,T+=V+E.length,L++,S(I)})}else{T+=o.mainHeaderSize,o.offset=x,o.totalEntries=L,x=0;let $=Buffer.alloc(T);C.forEach(function(q){q.copy($,x),x+=q.length}),A.forEach(function(q){q.copy($,x),x+=q.length});let B=o.toBinary();i&&i.copy(B,bt.Constants.ENDHDR),B.copy($,x),t=$,s=!1,D($)}};S(Array.from(this.entries))}catch(C){_(C)}}}}});var eC=y((gue,QE)=>{var Ve=ts(),Ze=require("path"),J4=fg(),X4=XE(),Ai=(...t)=>Ve.findLast(t,e=>typeof e=="boolean"),ZE=(...t)=>Ve.findLast(t,e=>typeof e=="string"),Z4=(...t)=>Ve.findLast(t,e=>typeof e=="function"),Q4={noSort:!1,readEntries:!1,method:Ve.Constants.NONE,fs:null};QE.exports=function(t,e){let r=null,n=Object.assign(Object.create(null),Q4);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=Ve.Constants.BUFFER,t=void 0)),Object.assign(n,e);let i=new Ve(n);if((typeof n.decoder!="object"||typeof n.decoder.encode!="function"||typeof n.decoder.decode!="function")&&(n.decoder=Ve.decoder),t&&typeof t=="string")if(i.fs.existsSync(t))n.method=Ve.Constants.FILE,n.filename=t,r=i.fs.readFileSync(t);else throw Ve.Errors.INVALID_FILENAME();let o=new X4(r,n),{canonical:s,sanitize:a,zipnamefix:u}=Ve;function l(d){if(d&&o){var m;if(typeof d=="string"&&(m=o.getEntry(Ze.posix.normalize(d))),typeof d=="object"&&typeof d.entryName<"u"&&typeof d.header<"u"&&(m=o.getEntry(d.entryName)),m)return m}return null}function c(d){let{join:m,normalize:b,sep:D}=Ze.posix;return m(".",b(D+d.split("\\").join(D)+D))}function f(d){return d instanceof RegExp?function(m){return function(b){return m.test(b)}}(d):typeof d!="function"?()=>!0:d}let h=(d,m)=>{let b=m.slice(-1);return b=b===i.sep?i.sep:"",Ze.relative(d,m)+b};return{readFile:function(d,m){var b=l(d);return b&&b.getData(m)||null},childCount:function(d){let m=l(d);if(m)return o.getChildCount(m)},readFileAsync:function(d,m){var b=l(d);b?b.getDataAsync(m):m(null,"getEntry failed for:"+d)},readAsText:function(d,m){var b=l(d);if(b){var D=b.getData();if(D&&D.length)return D.toString(m||"utf8")}return""},readAsTextAsync:function(d,m,b){var D=l(d);D?D.getDataAsync(function(_,F){if(F){m(_,F);return}_&&_.length?m(_.toString(b||"utf8")):m("")}):m("")},deleteFile:function(d,m=!0){var b=l(d);b&&o.deleteFile(b.entryName,m)},deleteEntry:function(d){var m=l(d);m&&o.deleteEntry(m.entryName)},addZipComment:function(d){o.comment=d},getZipComment:function(){return o.comment||""},addZipEntryComment:function(d,m){var b=l(d);b&&(b.comment=m)},getZipEntryComment:function(d){var m=l(d);return m&&m.comment||""},updateFile:function(d,m){var b=l(d);b&&b.setData(m)},addLocalFile:function(d,m,b,D){if(i.fs.existsSync(d)){m=m?c(m):"";let _=Ze.win32.basename(Ze.win32.normalize(d));m+=b||_;let F=i.fs.statSync(d),g=F.isFile()?i.fs.readFileSync(d):Buffer.alloc(0);F.isDirectory()&&(m+=i.sep),this.addFile(m,g,D,F)}else throw Ve.Errors.FILE_NOT_FOUND(d)},addLocalFileAsync:function(d,m){d=typeof d=="object"?d:{localPath:d};let b=Ze.resolve(d.localPath),{comment:D}=d,{zipPath:_,zipName:F}=d,g=this;i.fs.stat(b,function(C,A){if(C)return m(C,!1);_=_?c(_):"";let T=Ze.win32.basename(Ze.win32.normalize(b));if(_+=F||T,A.isFile())i.fs.readFile(b,function(x,L){return x?m(x,!1):(g.addFile(_,L,D,A),setImmediate(m,void 0,!0))});else if(A.isDirectory())return _+=i.sep,g.addFile(_,Buffer.alloc(0),D,A),setImmediate(m,void 0,!0)})},addLocalFolder:function(d,m,b){if(b=f(b),m=m?c(m):"",d=Ze.normalize(d),i.fs.existsSync(d)){let D=i.findFiles(d),_=this;if(D.length)for(let F of D){let g=Ze.join(m,h(d,F));b(g)&&_.addLocalFile(F,Ze.dirname(g))}}else throw Ve.Errors.FILE_NOT_FOUND(d)},addLocalFolderAsync:function(d,m,b,D){D=f(D),b=b?c(b):"",d=Ze.normalize(d);var _=this;i.fs.open(d,"r",function(F){if(F&&F.code==="ENOENT")m(void 0,Ve.Errors.FILE_NOT_FOUND(d));else if(F)m(void 0,F);else{var g=i.findFiles(d),C=-1,A=function(){if(C+=1,C<g.length){var T=g[C],x=h(d,T).split("\\").join("/");x=x.normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/[^\x20-\x7E]/g,""),D(x)?i.fs.stat(T,function(L,S){L&&m(void 0,L),S.isFile()?i.fs.readFile(T,function(I,$){I?m(void 0,I):(_.addFile(b+x,$,"",S),A())}):(_.addFile(b+x+"/",Buffer.alloc(0),"",S),A())}):process.nextTick(()=>{A()})}else m(!0,void 0)};A()}})},addLocalFolderAsync2:function(d,m){let b=this;d=typeof d=="object"?d:{localPath:d},localPath=Ze.resolve(c(d.localPath));let{zipPath:D,filter:_,namefix:F}=d;_ instanceof RegExp?_=function(A){return function(T){return A.test(T)}}(_):typeof _!="function"&&(_=function(){return!0}),D=D?c(D):"",F=="latin1"&&(F=A=>A.normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/[^\x20-\x7E]/g,"")),typeof F!="function"&&(F=A=>A);let g=A=>Ze.join(D,F(h(localPath,A))),C=A=>Ze.win32.basename(Ze.win32.normalize(F(A)));i.fs.open(localPath,"r",function(A){A&&A.code==="ENOENT"?m(void 0,Ve.Errors.FILE_NOT_FOUND(localPath)):A?m(void 0,A):i.findFilesAsync(localPath,function(T,x){if(T)return m(T);x=x.filter(L=>_(g(L))),x.length||m(void 0,!1),setImmediate(x.reverse().reduce(function(L,S){return function(I,$){if(I||$===!1)return setImmediate(L,I,!1);b.addLocalFileAsync({localPath:S,zipPath:Ze.dirname(g(S)),zipName:C(S)},L)}},m))})})},addLocalFolderPromise:function(d,m){return new Promise((b,D)=>{this.addLocalFolderAsync2(Object.assign({localPath:d},m),(_,F)=>{_&&D(_),F&&b(this)})})},addFile:function(d,m,b,D){d=u(d);let _=l(d),F=_!=null;F||(_=new J4(n),_.entryName=d),_.comment=b||"";let g=typeof D=="object"&&D instanceof i.fs.Stats;g&&(_.header.time=D.mtime);var C=_.isDirectory?16:0;let A=_.isDirectory?16384:32768;return g?A|=4095&D.mode:typeof D=="number"?A|=4095&D:A|=_.isDirectory?493:420,C=(C|A<<16)>>>0,_.attr=C,_.setData(m),F||o.setEntry(_),_},getEntries:function(d){return o.password=d,o?o.entries:[]},getEntry:function(d){return l(d)},getEntryCount:function(){return o.getEntryCount()},forEach:function(d){return o.forEach(d)},extractEntryTo:function(d,m,b,D,_,F){D=Ai(!1,D),_=Ai(!1,_),b=Ai(!0,b),F=ZE(_,F);var g=l(d);if(!g)throw Ve.Errors.NO_ENTRY();var C=s(g.entryName),A=a(m,F&&!g.isDirectory?F:b?C:Ze.basename(C));if(g.isDirectory){var T=o.getEntryChildren(g);return T.forEach(function(S){if(S.isDirectory)return;var I=S.getData();if(!I)throw Ve.Errors.CANT_EXTRACT_FILE();var $=s(S.entryName),B=a(m,b?$:Ze.basename($));let q=_?S.header.fileAttr:void 0;i.writeFileTo(B,I,D,q)}),!0}var x=g.getData(o.password);if(!x)throw Ve.Errors.CANT_EXTRACT_FILE();if(i.fs.existsSync(A)&&!D)throw Ve.Errors.CANT_OVERRIDE();let L=_?d.header.fileAttr:void 0;return i.writeFileTo(A,x,D,L),!0},test:function(d){if(!o)return!1;for(var m in o.entries)try{if(m.isDirectory)continue;var b=o.entries[m].getData(d);if(!b)return!1}catch{return!1}return!0},extractAllTo:function(d,m,b,D){if(b=Ai(!1,b),D=ZE(b,D),m=Ai(!1,m),!o)throw Ve.Errors.NO_ZIP();o.entries.forEach(function(_){var F=a(d,s(_.entryName));if(_.isDirectory){i.makeDir(F);return}var g=_.getData(D);if(!g)throw Ve.Errors.CANT_EXTRACT_FILE();let C=b?_.header.fileAttr:void 0;i.writeFileTo(F,g,m,C);try{i.fs.utimesSync(F,_.header.time,_.header.time)}catch{throw Ve.Errors.CANT_EXTRACT_FILE()}})},extractAllToAsync:function(d,m,b,D){if(D=Z4(m,b,D),b=Ai(!1,b),m=Ai(!1,m),!D)return new Promise((A,T)=>{this.extractAllToAsync(d,m,b,function(x){x?T(x):A(this)})});if(!o){D(Ve.Errors.NO_ZIP());return}d=Ze.resolve(d);let _=A=>a(d,Ze.normalize(s(A.entryName))),F=(A,T)=>new Error(A+': "'+T+'"'),g=[],C=[];o.entries.forEach(A=>{A.isDirectory?g.push(A):C.push(A)});for(let A of g){let T=_(A),x=b?A.header.fileAttr:void 0;try{i.makeDir(T),x&&i.fs.chmodSync(T,x),i.fs.utimesSync(T,A.header.time,A.header.time)}catch{D(F("Unable to create folder",T))}}C.reverse().reduce(function(A,T){return function(x){if(x)A(x);else{let L=Ze.normalize(s(T.entryName)),S=a(d,L);T.getDataAsync(function(I,$){if($)A($);else if(!I)A(Ve.Errors.CANT_EXTRACT_FILE());else{let B=b?T.header.fileAttr:void 0;i.writeFileToAsync(S,I,m,B,function(q){q||A(F("Unable to write file",S)),i.fs.utimes(S,T.header.time,T.header.time,function(K){K?A(F("Unable to set times",S)):A()})})}})}}},D)()},writeZip:function(d,m){if(arguments.length===1&&typeof d=="function"&&(m=d,d=""),!d&&n.filename&&(d=n.filename),!!d){var b=o.compressToBuffer();if(b){var D=i.writeFileTo(d,b,!0);typeof m=="function"&&m(D?null:new Error("failed"),"")}}},writeZipPromise:function(d,m){let{overwrite:b,perm:D}=Object.assign({overwrite:!0},m);return new Promise((_,F)=>{!d&&n.filename&&(d=n.filename),d||F("ADM-ZIP: ZIP File Name Missing"),this.toBufferPromise().then(g=>{let C=A=>A?_(A):F("ADM-ZIP: Wasn't able to write zip file");i.writeFileToAsync(d,g,b,D,C)},F)})},toBufferPromise:function(){return new Promise((d,m)=>{o.toAsyncBuffer(d,m)})},toBuffer:function(d,m,b,D){return typeof d=="function"?(o.toAsyncBuffer(d,m,b,D),null):o.compressToBuffer()}}}});var mC=y((Vue,pC)=>{var hC={};pC.exports=hC;var dC={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(dC).forEach(function(t){var e=dC[t],r=hC[t]=[];r.open="\x1B["+e[0]+"m",r.close="\x1B["+e[1]+"m"})});var yC=y((zue,gC)=>{"use strict";gC.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 vC=y((Gue,DC)=>{"use strict";var o5=require("os"),Sr=yC(),kt=process.env,os=void 0;Sr("no-color")||Sr("no-colors")||Sr("color=false")?os=!1:(Sr("color")||Sr("colors")||Sr("color=true")||Sr("color=always"))&&(os=!0);"FORCE_COLOR"in kt&&(os=kt.FORCE_COLOR.length===0||parseInt(kt.FORCE_COLOR,10)!==0);function s5(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}function a5(t){if(os===!1)return 0;if(Sr("color=16m")||Sr("color=full")||Sr("color=truecolor"))return 3;if(Sr("color=256"))return 2;if(t&&!t.isTTY&&os!==!0)return 0;var e=os?1:0;if(process.platform==="win32"){var r=o5.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 kt)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some(function(i){return i in kt})||kt.CI_NAME==="codeship"?1:e;if("TEAMCITY_VERSION"in kt)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(kt.TEAMCITY_VERSION)?1:0;if("TERM_PROGRAM"in kt){var n=parseInt((kt.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(kt.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Hyper":return 3;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(kt.TERM)?2:/^screen|^xterm|^vt100|^rxvt|color|ansi|cygwin|linux/i.test(kt.TERM)||"COLORTERM"in kt?1:(kt.TERM==="dumb",e)}function Dg(t){var e=a5(t);return s5(e)}DC.exports={supportsColor:Dg,stdout:Dg(process.stdout),stderr:Dg(process.stderr)}});var wC=y((Wue,bC)=>{bC.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 EC=y((Kue,_C)=>{_C.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 l=Math.floor(Math.random()*u);return l}function s(u){var l=!1;return i.filter(function(c){l=c===u}),l}function a(u,l){var c="",f,h;l=l||{},l.up=typeof l.up<"u"?l.up:!0,l.mid=typeof l.mid<"u"?l.mid:!0,l.down=typeof l.down<"u"?l.down:!0,l.size=typeof l.size<"u"?l.size:"maxi",u=u.split("");for(h in u)if(!s(h)){switch(c=c+u[h],f={up:0,down:0,mid:0},l.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 m in d)for(var b=d[m],D=0;D<=f[b];D++)l[b]&&(c=c+n[b][o(n[b].length)])}return c}return a(e,r)}});var SC=y((Yue,CC)=>{CC.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 FC=y((Jue,xC)=>{xC.exports=function(t){return function(e,r,n){return r%2===0?e:t.inverse(e)}}});var AC=y((Xue,OC)=>{OC.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 TC=y((Zue,kC)=>{kC.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 NC=y((ele,jC)=>{var le={};jC.exports=le;le.themes={};var u5=require("util"),ki=le.styles=mC(),RC=Object.defineProperties,l5=new RegExp(/[\r\n]+/g);le.supportsColor=vC().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 Que=le.stylize=function(e,r){if(!le.enabled)return e+"";var n=ki[r];return!n&&r in le?le[r](e):n.open+e+n.close},c5=/[|\\{}()[\]^$+*?.]/g,f5=function(t){if(typeof t!="string")throw new TypeError("Expected a string");return t.replace(c5,"\\$&")};function $C(t){var e=function r(){return h5.apply(r,arguments)};return e._styles=t,e.__proto__=d5,e}var IC=function(){var t={};return ki.grey=ki.gray,Object.keys(ki).forEach(function(e){ki[e].closeRe=new RegExp(f5(ki[e].close),"g"),t[e]={get:function(){return $C(this._styles.concat(e))}}}),t}(),d5=RC(function(){},IC);function h5(){var t=Array.prototype.slice.call(arguments),e=t.map(function(s){return s!=null&&s.constructor===String?s:u5.inspect(s)}).join(" ");if(!le.enabled||!e)return e;for(var r=e.indexOf(`
|
|
22
|
-
`)!=-1,n=this._styles,i=n.length;i--;){var o=ki[n[i]];e=o.open+e.replace(o.closeRe,o.open)+o.close,r&&(e=e.replace(
|
|
23
|
-
`)===-1||r.inlineArrays&&!e&&Array.isArray(t)&&Yc(t[0],!0,r))},
|
|
21
|
+
`)}),this}_outputHelpIfRequested(e){let r=this._getHelpOption();r&&e.find(i=>r.is(i))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function Nb(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})}function up(){if(De.env.NO_COLOR||De.env.FORCE_COLOR==="0"||De.env.FORCE_COLOR==="false")return!1;if(De.env.FORCE_COLOR||De.env.CLICOLOR_FORCE!==void 0)return!0}lp.Command=ap;lp.useColor=up});var Ub=y(lr=>{var{Argument:Bb}=zl(),{Command:cp}=Lb(),{CommanderError:uN,InvalidArgumentError:qb}=Aa(),{Help:lN}=ep(),{Option:Mb}=ip();lr.program=new cp;lr.createCommand=t=>new cp(t);lr.createOption=(t,e)=>new Mb(t,e);lr.createArgument=(t,e)=>new Bb(t,e);lr.Command=cp;lr.Option=Mb;lr.Argument=Bb;lr.Help=lN;lr.CommanderError=uN;lr.InvalidArgumentError=qb;lr.InvalidOptionArgumentError=qb});var Te=y((_se,Vb)=>{"use strict";var fp="\x1B",Me=`${fp}[`,fN="\x07",dp={to(t,e){return e?`${Me}${e+1};${t+1}H`:`${Me}${t+1}G`},move(t,e){let r="";return t<0?r+=`${Me}${-t}D`:t>0&&(r+=`${Me}${t}C`),e<0?r+=`${Me}${-e}A`:e>0&&(r+=`${Me}${e}B`),r},up:(t=1)=>`${Me}${t}A`,down:(t=1)=>`${Me}${t}B`,forward:(t=1)=>`${Me}${t}C`,backward:(t=1)=>`${Me}${t}D`,nextLine:(t=1)=>`${Me}E`.repeat(t),prevLine:(t=1)=>`${Me}F`.repeat(t),left:`${Me}G`,hide:`${Me}?25l`,show:`${Me}?25h`,save:`${fp}7`,restore:`${fp}8`},dN={up:(t=1)=>`${Me}S`.repeat(t),down:(t=1)=>`${Me}T`.repeat(t)},hN={screen:`${Me}2J`,up:(t=1)=>`${Me}1J`.repeat(t),down:(t=1)=>`${Me}J`.repeat(t),line:`${Me}2K`,lineEnd:`${Me}K`,lineStart:`${Me}1K`,lines(t){let e="";for(let r=0;r<t;r++)e+=this.line+(r<t-1?dp.up():"");return t&&(e+=dp.left),e}};Vb.exports={cursor:dp,scroll:dN,erase:hN,beep:fN}});var pp=y((Ese,hp)=>{var Kl=process||{},zb=Kl.argv||[],Wl=Kl.env||{},pN=!(Wl.NO_COLOR||zb.includes("--no-color"))&&(!!Wl.FORCE_COLOR||zb.includes("--color")||Kl.platform==="win32"||(Kl.stdout||{}).isTTY&&Wl.TERM!=="dumb"||!!Wl.CI),mN=(t,e,r=t)=>n=>{let i=""+n,o=i.indexOf(e,t.length);return~o?t+gN(i,e,r,o)+e:t+i+e},gN=(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)},Gb=(t=pN)=>{let e=t?mN:()=>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")}};hp.exports=Gb();hp.exports.createColors=Gb});var ic=y(Bt=>{"use strict";Object.defineProperty(Bt,"__esModule",{value:!0});Bt.isNXMonorepo=Bt.isMonorepo=Bt.findPackageRelativePathInMonorepo=Bt.findPackagePath=Bt.findNXMonorepoRoot=Bt.findMonorepoRoot=void 0;var Pa=require("node:fs"),Bn=require("node:path");function nc(t){let e=(0,Bn.join)(t,"package.json"),r=(0,Bn.join)(t,"pnpm-workspace.yaml");if((0,Pa.existsSync)(r)||(0,Pa.existsSync)(e)&&JSON.parse((0,Pa.readFileSync)(e,"utf-8")).workspaces)return t;let n=(0,Bn.dirname)(t);if(n===t)throw new Error("Monorepo root not found");return nc(n)}Bt.findMonorepoRoot=nc;function Fp(t){let e=(0,Bn.join)(t,"nx.json");if((0,Pa.existsSync)(e))return t;let r=(0,Bn.dirname)(t);if(r===t)throw new Error("Monorepo root not found");return Fp(r)}Bt.findNXMonorepoRoot=Fp;function Op(t,e,r){let n=(0,Bn.join)(e,"node_modules",t);if((0,Pa.existsSync)(n))return n;if(e===r)return null;let i=(0,Bn.dirname)(e);return Op(t,i,r)}Bt.findPackagePath=Op;function WN(t,e){let r=nc(e),n=Op(t,e,r);return n?(0,Bn.relative)(e,n):null}Bt.findPackageRelativePathInMonorepo=WN;function KN(t){try{return nc(t),!0}catch{return!1}}Bt.isMonorepo=KN;function YN(t){try{return Fp(t),!0}catch{return!1}}Bt.isNXMonorepo=YN});var vi={};gi(vi,{default:()=>JN});var JN,bi=Ct(()=>{JN={}});var fw=y(Pr=>{"use strict";var XN=Pr&&Pr.__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]}),ZN=Pr&&Pr.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),QN=Pr&&Pr.__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)&&XN(e,t,r);return ZN(e,t),e};Object.defineProperty(Pr,"__esModule",{value:!0});Pr.resolveFetch=void 0;var eL=t=>{let e;return t?e=t:typeof fetch>"u"?e=(...r)=>Promise.resolve().then(()=>QN((bi(),je(vi)))).then(({default:n})=>n(...r)):e=fetch,(...r)=>e(...r)};Pr.resolveFetch=eL});var Pp=y(er=>{"use strict";Object.defineProperty(er,"__esModule",{value:!0});er.FunctionRegion=er.FunctionsHttpError=er.FunctionsRelayError=er.FunctionsFetchError=er.FunctionsError=void 0;var No=class extends Error{constructor(e,r="FunctionsError",n){super(e),this.name=r,this.context=n}};er.FunctionsError=No;var Ap=class extends No{constructor(e){super("Failed to send a request to the Edge Function","FunctionsFetchError",e)}};er.FunctionsFetchError=Ap;var kp=class extends No{constructor(e){super("Relay Error invoking the Edge Function","FunctionsRelayError",e)}};er.FunctionsRelayError=kp;var Tp=class extends No{constructor(e){super("Edge Function returned a non-2xx status code","FunctionsHttpError",e)}};er.FunctionsHttpError=Tp;var tL;(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"})(tL=er.FunctionRegion||(er.FunctionRegion={}))});var dw=y(Lo=>{"use strict";var rL=Lo&&Lo.__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(c){try{l(n.next(c))}catch(f){s(f)}}function u(c){try{l(n.throw(c))}catch(f){s(f)}}function l(c){c.done?o(c.value):i(c.value).then(a,u)}l((n=n.apply(t,e||[])).next())})};Object.defineProperty(Lo,"__esModule",{value:!0});Lo.FunctionsClient=void 0;var nL=fw(),sc=Pp(),Rp=class{constructor(e,{headers:r={},customFetch:n,region:i=sc.FunctionRegion.Any}={}){this.url=e,this.headers=r,this.region=i,this.fetch=(0,nL.resolveFetch)(n)}setAuth(e){this.headers.Authorization=`Bearer ${e}`}invoke(e,r={}){var n;return rL(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 l;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",l=s):typeof s=="string"?(a["Content-Type"]="text/plain",l=s):typeof FormData<"u"&&s instanceof FormData?l=s:(a["Content-Type"]="application/json",l=JSON.stringify(s)));let c=yield this.fetch(`${this.url}/${e}`,{method:o||"POST",headers:Object.assign(Object.assign(Object.assign({},a),this.headers),i),body:l}).catch(m=>{throw new sc.FunctionsFetchError(m)}),f=c.headers.get("x-relay-error");if(f&&f==="true")throw new sc.FunctionsRelayError(c);if(!c.ok)throw new sc.FunctionsHttpError(c);let h=((n=c.headers.get("Content-Type"))!==null&&n!==void 0?n:"text/plain").split(";")[0].trim(),d;return h==="application/json"?d=yield c.json():h==="application/octet-stream"?d=yield c.blob():h==="text/event-stream"?d=c:h==="multipart/form-data"?d=yield c.formData():d=yield c.text(),{data:d,error:null}}catch(i){return{data:null,error:i}}})}};Lo.FunctionsClient=Rp});var $p=y(qt=>{"use strict";Object.defineProperty(qt,"__esModule",{value:!0});qt.FunctionRegion=qt.FunctionsRelayError=qt.FunctionsHttpError=qt.FunctionsFetchError=qt.FunctionsError=qt.FunctionsClient=void 0;var iL=dw();Object.defineProperty(qt,"FunctionsClient",{enumerable:!0,get:function(){return iL.FunctionsClient}});var $a=Pp();Object.defineProperty(qt,"FunctionsError",{enumerable:!0,get:function(){return $a.FunctionsError}});Object.defineProperty(qt,"FunctionsFetchError",{enumerable:!0,get:function(){return $a.FunctionsFetchError}});Object.defineProperty(qt,"FunctionsHttpError",{enumerable:!0,get:function(){return $a.FunctionsHttpError}});Object.defineProperty(qt,"FunctionsRelayError",{enumerable:!0,get:function(){return $a.FunctionsRelayError}});Object.defineProperty(qt,"FunctionRegion",{enumerable:!0,get:function(){return $a.FunctionRegion}})});var Np=y(jp=>{"use strict";Object.defineProperty(jp,"__esModule",{value:!0});var Ip=class extends Error{constructor(e){super(e.message),this.name="PostgrestError",this.details=e.details,this.hint=e.hint,this.code=e.code}};jp.default=Ip});var Bp=y(Ia=>{"use strict";var hw=Ia&&Ia.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ia,"__esModule",{value:!0});var oL=hw((bi(),je(vi))),sL=hw(Np()),Lp=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=oL.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 l=null,c=null,f=null,h=o.status,d=o.statusText;if(o.ok){if(this.method!=="HEAD"){let _=await o.text();_===""||(this.headers.Accept==="text/csv"||this.headers.Accept&&this.headers.Accept.includes("application/vnd.pgrst.plan+text")?c=_:c=JSON.parse(_))}let b=(s=this.headers.Prefer)===null||s===void 0?void 0:s.match(/count=(exact|planned|estimated)/),D=(a=o.headers.get("content-range"))===null||a===void 0?void 0:a.split("/");b&&D&&D.length>1&&(f=parseInt(D[1])),this.isMaybeSingle&&this.method==="GET"&&Array.isArray(c)&&(c.length>1?(l={code:"PGRST116",details:`Results contain ${c.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},c=null,f=null,h=406,d="Not Acceptable"):c.length===1?c=c[0]:c=null)}else{let b=await o.text();try{l=JSON.parse(b),Array.isArray(l)&&o.status===404&&(c=[],l=null,h=200,d="OK")}catch{o.status===404&&b===""?(h=204,d="No Content"):l={message:b}}if(l&&this.isMaybeSingle&&(!((u=l?.details)===null||u===void 0)&&u.includes("0 rows"))&&(l=null,h=200,d="OK"),l&&this.shouldThrowOnError)throw new sL.default(l)}return{error:l,data:c,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)}};Ia.default=Lp});var Mp=y(ja=>{"use strict";var aL=ja&&ja.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ja,"__esModule",{value:!0});var uL=aL(Bp()),qp=class extends uL.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("|"),l=(a=this.headers.Accept)!==null&&a!==void 0?a:"application/json";return this.headers.Accept=`application/vnd.pgrst.plan+${s}; for="${l}"; 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}};ja.default=qp});var ac=y(Na=>{"use strict";var lL=Na&&Na.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Na,"__esModule",{value:!0});var cL=lL(Mp()),Up=class extends cL.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}};Na.default=Up});var Vp=y(Ba=>{"use strict";var fL=Ba&&Ba.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ba,"__esModule",{value:!0});var La=fL(ac()),Hp=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 La.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 La.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((l,c)=>l.concat(Object.keys(c)),[]);if(u.length>0){let l=[...new Set(u)].map(c=>`"${c}"`);this.url.searchParams.set("columns",l.join(","))}}return new La.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 La.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 La.default({method:r,url:this.url,headers:this.headers,schema:this.schema,fetch:this.fetch,allowEmpty:!1})}};Ba.default=Hp});var pw=y(uc=>{"use strict";Object.defineProperty(uc,"__esModule",{value:!0});uc.version=void 0;uc.version="0.0.0-automated"});var mw=y(lc=>{"use strict";Object.defineProperty(lc,"__esModule",{value:!0});lc.DEFAULT_HEADERS=void 0;var dL=pw();lc.DEFAULT_HEADERS={"X-Client-Info":`postgrest-js/${dL.version}`}});var yw=y(qa=>{"use strict";var gw=qa&&qa.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(qa,"__esModule",{value:!0});var hL=gw(Vp()),pL=gw(ac()),mL=mw(),zp=class t{constructor(e,{headers:r={},schema:n,fetch:i}={}){this.url=e,this.headers=Object.assign(Object.assign({},mL.DEFAULT_HEADERS),r),this.schemaName=n,this.fetch=i}from(e){let r=new URL(`${this.url}/${e}`);return new hL.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(([c,f])=>f!==void 0).map(([c,f])=>[c,Array.isArray(f)?`{${f.join(",")}}`:`${f}`]).forEach(([c,f])=>{a.searchParams.append(c,f)})):(s="POST",u=r);let l=Object.assign({},this.headers);return o&&(l.Prefer=`count=${o}`),new pL.default({method:s,url:a,headers:l,schema:this.schemaName,body:u,fetch:this.fetch,allowEmpty:!1})}};qa.default=zp});var Gp=y(Dt=>{"use strict";var Bo=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 Dw=Bo(yw());Dt.PostgrestClient=Dw.default;var vw=Bo(Vp());Dt.PostgrestQueryBuilder=vw.default;var bw=Bo(ac());Dt.PostgrestFilterBuilder=bw.default;var ww=Bo(Mp());Dt.PostgrestTransformBuilder=ww.default;var _w=Bo(Bp());Dt.PostgrestBuilder=_w.default;var Ew=Bo(Np());Dt.PostgrestError=Ew.default;Dt.default={PostgrestClient:Dw.default,PostgrestQueryBuilder:vw.default,PostgrestFilterBuilder:bw.default,PostgrestTransformBuilder:ww.default,PostgrestBuilder:_w.default,PostgrestError:Ew.default}});var Kp={};gi(Kp,{RealtimeClient:()=>Wp});var Wp,Yp=Ct(()=>{Wp=class{constructor(){}connect(){}disconnect(){}}});var Ua=y(Rr=>{"use strict";Object.defineProperty(Rr,"__esModule",{value:!0});Rr.StorageUnknownError=Rr.StorageApiError=Rr.isStorageError=Rr.StorageError=void 0;var Ma=class extends Error{constructor(e){super(e),this.__isStorageError=!0,this.name="StorageError"}};Rr.StorageError=Ma;function gL(t){return typeof t=="object"&&t!==null&&"__isStorageError"in t}Rr.isStorageError=gL;var Jp=class extends Ma{constructor(e,r){super(e),this.name="StorageApiError",this.status=r}toJSON(){return{name:this.name,message:this.message,status:this.status}}};Rr.StorageApiError=Jp;var Xp=class extends Ma{constructor(e,r){super(e),this.name="StorageUnknownError",this.originalError=r}};Rr.StorageUnknownError=Xp});var cc=y(ut=>{"use strict";var yL=ut&&ut.__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]}),DL=ut&&ut.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Cw=ut&&ut.__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)&&yL(e,t,r);return DL(e,t),e},vL=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(c){try{l(n.next(c))}catch(f){s(f)}}function u(c){try{l(n.throw(c))}catch(f){s(f)}}function l(c){c.done?o(c.value):i(c.value).then(a,u)}l((n=n.apply(t,e||[])).next())})};Object.defineProperty(ut,"__esModule",{value:!0});ut.recursiveToCamel=ut.resolveResponse=ut.resolveFetch=void 0;var bL=t=>{let e;return t?e=t:typeof fetch>"u"?e=(...r)=>Promise.resolve().then(()=>Cw((bi(),je(vi)))).then(({default:n})=>n(...r)):e=fetch,(...r)=>e(...r)};ut.resolveFetch=bL;var wL=()=>vL(void 0,void 0,void 0,function*(){return typeof Response>"u"?(yield Promise.resolve().then(()=>Cw((bi(),je(vi))))).Response:Response});ut.resolveResponse=wL;var _L=t=>{if(Array.isArray(t))return t.map(r=>(0,ut.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,ut.recursiveToCamel)(n)}),e};ut.recursiveToCamel=_L});var em=y(Mt=>{"use strict";var wi=Mt&&Mt.__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(c){try{l(n.next(c))}catch(f){s(f)}}function u(c){try{l(n.throw(c))}catch(f){s(f)}}function l(c){c.done?o(c.value):i(c.value).then(a,u)}l((n=n.apply(t,e||[])).next())})};Object.defineProperty(Mt,"__esModule",{value:!0});Mt.remove=Mt.head=Mt.put=Mt.post=Mt.get=void 0;var Zp=Ua(),EL=cc(),Qp=t=>t.msg||t.message||t.error_description||t.error||JSON.stringify(t),CL=(t,e,r)=>wi(void 0,void 0,void 0,function*(){let n=yield(0,EL.resolveResponse)();t instanceof n&&!r?.noResolveJson?t.json().then(i=>{e(new Zp.StorageApiError(Qp(i),t.status||500))}).catch(i=>{e(new Zp.StorageUnknownError(Qp(i),i))}):e(new Zp.StorageUnknownError(Qp(t),t))}),SL=(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 Ha(t,e,r,n,i,o){return wi(this,void 0,void 0,function*(){return new Promise((s,a)=>{t(r,SL(e,n,i,o)).then(u=>{if(!u.ok)throw u;return n?.noResolveJson?u:u.json()}).then(u=>s(u)).catch(u=>CL(u,a,n))})})}function xL(t,e,r,n){return wi(this,void 0,void 0,function*(){return Ha(t,"GET",e,r,n)})}Mt.get=xL;function FL(t,e,r,n,i){return wi(this,void 0,void 0,function*(){return Ha(t,"POST",e,n,i,r)})}Mt.post=FL;function OL(t,e,r,n,i){return wi(this,void 0,void 0,function*(){return Ha(t,"PUT",e,n,i,r)})}Mt.put=OL;function AL(t,e,r,n){return wi(this,void 0,void 0,function*(){return Ha(t,"HEAD",e,Object.assign(Object.assign({},r),{noResolveJson:!0}),n)})}Mt.head=AL;function kL(t,e,r,n,i){return wi(this,void 0,void 0,function*(){return Ha(t,"DELETE",e,n,i,r)})}Mt.remove=kL});var Fw=y(Va=>{"use strict";var Ut=Va&&Va.__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(c){try{l(n.next(c))}catch(f){s(f)}}function u(c){try{l(n.throw(c))}catch(f){s(f)}}function l(c){c.done?o(c.value):i(c.value).then(a,u)}l((n=n.apply(t,e||[])).next())})};Object.defineProperty(Va,"__esModule",{value:!0});var Ht=Ua(),$r=em(),Sw=cc(),TL={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},xw={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1},tm=class{constructor(e,r={},n,i){this.url=e,this.headers=r,this.bucketId=n,this.fetch=(0,Sw.resolveFetch)(i)}uploadOrUpdate(e,r,n,i){return Ut(this,void 0,void 0,function*(){try{let o,s=Object.assign(Object.assign({},xw),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 l=this._removeEmptyFolders(r),c=this._getFinalPath(l),f=yield this.fetch(`${this.url}/object/${c}`,Object.assign({method:e,body:o,headers:a},s?.duplex?{duplex:s.duplex}:{})),h=yield f.json();return f.ok?{data:{path:l,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 Ut(this,void 0,void 0,function*(){return this.uploadOrUpdate("POST",e,r,n)})}uploadToSignedUrl(e,r,n,i){return Ut(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,l=Object.assign({upsert:xw.upsert},i),c=Object.assign(Object.assign({},this.headers),{"x-upsert":String(l.upsert)});typeof Blob<"u"&&n instanceof Blob?(u=new FormData,u.append("cacheControl",l.cacheControl),u.append("",n)):typeof FormData<"u"&&n instanceof FormData?(u=n,u.append("cacheControl",l.cacheControl)):(u=n,c["cache-control"]=`max-age=${l.cacheControl}`,c["content-type"]=l.contentType);let f=yield this.fetch(a.toString(),{method:"PUT",body:u,headers:c}),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 Ut(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,$r.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 Ut(this,void 0,void 0,function*(){return this.uploadOrUpdate("PUT",e,r,n)})}move(e,r,n){return Ut(this,void 0,void 0,function*(){try{return{data:yield(0,$r.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 Ut(this,void 0,void 0,function*(){try{return{data:{path:(yield(0,$r.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 Ut(this,void 0,void 0,function*(){try{let i=this._getFinalPath(e),o=yield(0,$r.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 Ut(this,void 0,void 0,function*(){try{let i=yield(0,$r.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 Ut(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,$r.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 Ut(this,void 0,void 0,function*(){let r=this._getFinalPath(e);try{let n=yield(0,$r.get)(this.fetch,`${this.url}/object/info/${r}`,{headers:this.headers});return{data:(0,Sw.recursiveToCamel)(n),error:null}}catch(n){if((0,Ht.isStorageError)(n))return{data:null,error:n};throw n}})}exists(e){return Ut(this,void 0,void 0,function*(){let r=this._getFinalPath(e);try{return yield(0,$r.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 l=i.join("&");return l!==""&&(l=`?${l}`),{data:{publicUrl:encodeURI(`${this.url}/${a}/public/${n}${l}`)}}}remove(e){return Ut(this,void 0,void 0,function*(){try{return{data:yield(0,$r.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 Ut(this,void 0,void 0,function*(){try{let i=Object.assign(Object.assign(Object.assign({},TL),r),{prefix:e||""});return{data:yield(0,$r.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("&")}};Va.default=tm});var Ow=y(fc=>{"use strict";Object.defineProperty(fc,"__esModule",{value:!0});fc.version=void 0;fc.version="2.7.1"});var Aw=y(dc=>{"use strict";Object.defineProperty(dc,"__esModule",{value:!0});dc.DEFAULT_HEADERS=void 0;var PL=Ow();dc.DEFAULT_HEADERS={"X-Client-Info":`storage-js/${PL.version}`}});var kw=y(za=>{"use strict";var qo=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(c){try{l(n.next(c))}catch(f){s(f)}}function u(c){try{l(n.throw(c))}catch(f){s(f)}}function l(c){c.done?o(c.value):i(c.value).then(a,u)}l((n=n.apply(t,e||[])).next())})};Object.defineProperty(za,"__esModule",{value:!0});var RL=Aw(),Mo=Ua(),Uo=em(),$L=cc(),rm=class{constructor(e,r={},n){this.url=e,this.headers=Object.assign(Object.assign({},RL.DEFAULT_HEADERS),r),this.fetch=(0,$L.resolveFetch)(n)}listBuckets(){return qo(this,void 0,void 0,function*(){try{return{data:yield(0,Uo.get)(this.fetch,`${this.url}/bucket`,{headers:this.headers}),error:null}}catch(e){if((0,Mo.isStorageError)(e))return{data:null,error:e};throw e}})}getBucket(e){return qo(this,void 0,void 0,function*(){try{return{data:yield(0,Uo.get)(this.fetch,`${this.url}/bucket/${e}`,{headers:this.headers}),error:null}}catch(r){if((0,Mo.isStorageError)(r))return{data:null,error:r};throw r}})}createBucket(e,r={public:!1}){return qo(this,void 0,void 0,function*(){try{return{data:yield(0,Uo.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,Mo.isStorageError)(n))return{data:null,error:n};throw n}})}updateBucket(e,r){return qo(this,void 0,void 0,function*(){try{return{data:yield(0,Uo.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,Mo.isStorageError)(n))return{data:null,error:n};throw n}})}emptyBucket(e){return qo(this,void 0,void 0,function*(){try{return{data:yield(0,Uo.post)(this.fetch,`${this.url}/bucket/${e}/empty`,{},{headers:this.headers}),error:null}}catch(r){if((0,Mo.isStorageError)(r))return{data:null,error:r};throw r}})}deleteBucket(e){return qo(this,void 0,void 0,function*(){try{return{data:yield(0,Uo.remove)(this.fetch,`${this.url}/bucket/${e}`,{},{headers:this.headers}),error:null}}catch(r){if((0,Mo.isStorageError)(r))return{data:null,error:r};throw r}})}};za.default=rm});var Pw=y(Ho=>{"use strict";var Tw=Ho&&Ho.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ho,"__esModule",{value:!0});Ho.StorageClient=void 0;var IL=Tw(Fw()),jL=Tw(kw()),nm=class extends jL.default{constructor(e,r={},n){super(e,r,n)}from(e){return new IL.default(this.url,this.headers,e,this.fetch)}};Ho.StorageClient=nm});var $w=y(Rw=>{"use strict";Object.defineProperty(Rw,"__esModule",{value:!0})});var jw=y(Ir=>{"use strict";var NL=Ir&&Ir.__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]}),Iw=Ir&&Ir.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&NL(e,t,r)};Object.defineProperty(Ir,"__esModule",{value:!0});Ir.StorageClient=void 0;var LL=Pw();Object.defineProperty(Ir,"StorageClient",{enumerable:!0,get:function(){return LL.StorageClient}});Iw($w(),Ir);Iw(Ua(),Ir)});var Nw=y(hc=>{"use strict";Object.defineProperty(hc,"__esModule",{value:!0});hc.version=void 0;hc.version="2.48.1"});var Lw=y(tr=>{"use strict";Object.defineProperty(tr,"__esModule",{value:!0});tr.DEFAULT_REALTIME_OPTIONS=tr.DEFAULT_AUTH_OPTIONS=tr.DEFAULT_DB_OPTIONS=tr.DEFAULT_GLOBAL_OPTIONS=tr.DEFAULT_HEADERS=void 0;var BL=Nw(),Ga="";typeof Deno<"u"?Ga="deno":typeof document<"u"?Ga="web":typeof navigator<"u"&&navigator.product==="ReactNative"?Ga="react-native":Ga="node";tr.DEFAULT_HEADERS={"X-Client-Info":`supabase-js-${Ga}/${BL.version}`};tr.DEFAULT_GLOBAL_OPTIONS={headers:tr.DEFAULT_HEADERS};tr.DEFAULT_DB_OPTIONS={schema:"public"};tr.DEFAULT_AUTH_OPTIONS={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"};tr.DEFAULT_REALTIME_OPTIONS={}});var qw=y(lt=>{"use strict";var qL=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]}),ML=lt&<.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),UL=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)&&qL(e,t,r);return ML(e,t),e},HL=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(c){try{l(n.next(c))}catch(f){s(f)}}function u(c){try{l(n.throw(c))}catch(f){s(f)}}function l(c){c.done?o(c.value):i(c.value).then(a,u)}l((n=n.apply(t,e||[])).next())})};Object.defineProperty(lt,"__esModule",{value:!0});lt.fetchWithAuth=lt.resolveHeadersConstructor=lt.resolveFetch=void 0;var Bw=UL((bi(),je(vi))),VL=t=>{let e;return t?e=t:typeof fetch>"u"?e=Bw.default:e=fetch,(...r)=>e(...r)};lt.resolveFetch=VL;var zL=()=>typeof Headers>"u"?Bw.Headers:Headers;lt.resolveHeadersConstructor=zL;var GL=(t,e,r)=>{let n=(0,lt.resolveFetch)(r),i=(0,lt.resolveHeadersConstructor)();return(o,s)=>HL(void 0,void 0,void 0,function*(){var a;let u=(a=yield e())!==null&&a!==void 0?a:t,l=new i(s?.headers);return l.has("apikey")||l.set("apikey",t),l.has("Authorization")||l.set("Authorization",`Bearer ${u}`),n(o,Object.assign(Object.assign({},s),{headers:l}))})};lt.fetchWithAuth=GL});var Mw=y(fr=>{"use strict";var WL=fr&&fr.__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(c){try{l(n.next(c))}catch(f){s(f)}}function u(c){try{l(n.throw(c))}catch(f){s(f)}}function l(c){c.done?o(c.value):i(c.value).then(a,u)}l((n=n.apply(t,e||[])).next())})};Object.defineProperty(fr,"__esModule",{value:!0});fr.applySettingDefaults=fr.isBrowser=fr.stripTrailingSlash=fr.uuid=void 0;function KL(){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)})}fr.uuid=KL;function YL(t){return t.replace(/\/$/,"")}fr.stripTrailingSlash=YL;var JL=()=>typeof window<"u";fr.isBrowser=JL;function XL(t,e){let{db:r,auth:n,realtime:i,global:o}=t,{db:s,auth:a,realtime:u,global:l}=e,c={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({},l),o),accessToken:()=>WL(this,void 0,void 0,function*(){return""})};return t.accessToken?c.accessToken=t.accessToken:delete c.accessToken,c}fr.applySettingDefaults=XL});var im=y(pc=>{"use strict";Object.defineProperty(pc,"__esModule",{value:!0});pc.version=void 0;pc.version="2.67.3"});var mc=y(ct=>{"use strict";Object.defineProperty(ct,"__esModule",{value:!0});ct.API_VERSIONS=ct.API_VERSION_HEADER_NAME=ct.NETWORK_FAILURE=ct.EXPIRY_MARGIN=ct.DEFAULT_HEADERS=ct.AUDIENCE=ct.STORAGE_KEY=ct.GOTRUE_URL=void 0;var ZL=im();ct.GOTRUE_URL="http://localhost:9999";ct.STORAGE_KEY="supabase.auth.token";ct.AUDIENCE="";ct.DEFAULT_HEADERS={"X-Client-Info":`gotrue-js/${ZL.version}`};ct.EXPIRY_MARGIN=10;ct.NETWORK_FAILURE={MAX_RETRIES:10,RETRY_INTERVAL:2};ct.API_VERSION_HEADER_NAME="X-Supabase-Api-Version";ct.API_VERSIONS={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}}});var Vo=y(ee=>{"use strict";var QL=ee&&ee.__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]}),eB=ee&&ee.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),tB=ee&&ee.__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)&&QL(e,t,r);return eB(e,t),e};Object.defineProperty(ee,"__esModule",{value:!0});ee.parseResponseAPIVersion=ee.getCodeChallengeAndMethod=ee.generatePKCEChallenge=ee.generatePKCEVerifier=ee.retryable=ee.sleep=ee.decodeJWTPayload=ee.Deferred=ee.decodeBase64URL=ee.removeItemAsync=ee.getItemAsync=ee.setItemAsync=ee.looksLikeFetchResponse=ee.resolveFetch=ee.parseParametersFromURL=ee.supportsLocalStorage=ee.isBrowser=ee.uuid=ee.expiresAt=void 0;var rB=mc();function nB(t){return Math.round(Date.now()/1e3)+t}ee.expiresAt=nB;function iB(){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)})}ee.uuid=iB;var oB=()=>typeof window<"u"&&typeof document<"u";ee.isBrowser=oB;var _i={tested:!1,writable:!1},sB=()=>{if(!(0,ee.isBrowser)())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(_i.tested)return _i.writable;let t=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(t,t),globalThis.localStorage.removeItem(t),_i.tested=!0,_i.writable=!0}catch{_i.tested=!0,_i.writable=!1}return _i.writable};ee.supportsLocalStorage=sB;function aB(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}ee.parseParametersFromURL=aB;var uB=t=>{let e;return t?e=t:typeof fetch>"u"?e=(...r)=>Promise.resolve().then(()=>tB((bi(),je(vi)))).then(({default:n})=>n(...r)):e=fetch,(...r)=>e(...r)};ee.resolveFetch=uB;var lB=t=>typeof t=="object"&&t!==null&&"status"in t&&"ok"in t&&"json"in t&&typeof t.json=="function";ee.looksLikeFetchResponse=lB;var cB=async(t,e,r)=>{await t.setItem(e,JSON.stringify(r))};ee.setItemAsync=cB;var fB=async(t,e)=>{let r=await t.getItem(e);if(!r)return null;try{return JSON.parse(r)}catch{return r}};ee.getItemAsync=fB;var dB=async(t,e)=>{await t.removeItem(e)};ee.removeItemAsync=dB;function Uw(t){let e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",r="",n,i,o,s,a,u,l,c=0;for(t=t.replace("-","+").replace("_","/");c<t.length;)s=e.indexOf(t.charAt(c++)),a=e.indexOf(t.charAt(c++)),u=e.indexOf(t.charAt(c++)),l=e.indexOf(t.charAt(c++)),n=s<<2|a>>4,i=(a&15)<<4|u>>2,o=(u&3)<<6|l,r=r+String.fromCharCode(n),u!=64&&i!=0&&(r=r+String.fromCharCode(i)),l!=64&&o!=0&&(r=r+String.fromCharCode(o));return r}ee.decodeBase64URL=Uw;var gc=class t{constructor(){this.promise=new t.promiseConstructor((e,r)=>{this.resolve=e,this.reject=r})}};ee.Deferred=gc;gc.promiseConstructor=Promise;function hB(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(Uw(n))}ee.decodeJWTPayload=hB;async function pB(t){return await new Promise(e=>{setTimeout(()=>e(null),t)})}ee.sleep=pB;function mB(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}}})()})}ee.retryable=mB;function gB(t){return("0"+t.toString(16)).substr(-2)}function Hw(){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,gB).join("")}ee.generatePKCEVerifier=Hw;async function yB(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 DB(t){return btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function Vw(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 yB(t);return DB(r)}ee.generatePKCEChallenge=Vw;async function vB(t,e,r=!1){let n=Hw(),i=n;r&&(i+="/PASSWORD_RECOVERY"),await(0,ee.setItemAsync)(t,`${e}-code-verifier`,i);let o=await Vw(n);return[o,n===o?"plain":"s256"]}ee.getCodeChallengeAndMethod=vB;var bB=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function wB(t){let e=t.headers.get(rB.API_VERSION_HEADER_NAME);if(!e||!e.match(bB))return null;try{return new Date(`${e}T00:00:00.0Z`)}catch{return null}}ee.parseResponseAPIVersion=wB});var Wa=y(ce=>{"use strict";Object.defineProperty(ce,"__esModule",{value:!0});ce.isAuthWeakPasswordError=ce.AuthWeakPasswordError=ce.isAuthRetryableFetchError=ce.AuthRetryableFetchError=ce.AuthPKCEGrantCodeExchangeError=ce.isAuthImplicitGrantRedirectError=ce.AuthImplicitGrantRedirectError=ce.AuthInvalidCredentialsError=ce.AuthInvalidTokenResponseError=ce.isAuthSessionMissingError=ce.AuthSessionMissingError=ce.CustomAuthError=ce.AuthUnknownError=ce.isAuthApiError=ce.AuthApiError=ce.isAuthError=ce.AuthError=void 0;var zo=class extends Error{constructor(e,r,n){super(e),this.__isAuthError=!0,this.name="AuthError",this.status=r,this.code=n}};ce.AuthError=zo;function Go(t){return typeof t=="object"&&t!==null&&"__isAuthError"in t}ce.isAuthError=Go;var om=class extends zo{constructor(e,r,n){super(e,r,n),this.name="AuthApiError",this.status=r,this.code=n}};ce.AuthApiError=om;function _B(t){return Go(t)&&t.name==="AuthApiError"}ce.isAuthApiError=_B;var sm=class extends zo{constructor(e,r){super(e),this.name="AuthUnknownError",this.originalError=r}};ce.AuthUnknownError=sm;var jr=class extends zo{constructor(e,r,n,i){super(e,n,i),this.name=r,this.status=n}};ce.CustomAuthError=jr;var am=class extends jr{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}};ce.AuthSessionMissingError=am;function EB(t){return Go(t)&&t.name==="AuthSessionMissingError"}ce.isAuthSessionMissingError=EB;var um=class extends jr{constructor(){super("Auth session or user missing","AuthInvalidTokenResponseError",500,void 0)}};ce.AuthInvalidTokenResponseError=um;var lm=class extends jr{constructor(e){super(e,"AuthInvalidCredentialsError",400,void 0)}};ce.AuthInvalidCredentialsError=lm;var cm=class extends jr{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}}};ce.AuthImplicitGrantRedirectError=cm;function CB(t){return Go(t)&&t.name==="AuthImplicitGrantRedirectError"}ce.isAuthImplicitGrantRedirectError=CB;var fm=class extends jr{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}}};ce.AuthPKCEGrantCodeExchangeError=fm;var dm=class extends jr{constructor(e,r){super(e,"AuthRetryableFetchError",r,void 0)}};ce.AuthRetryableFetchError=dm;function SB(t){return Go(t)&&t.name==="AuthRetryableFetchError"}ce.isAuthRetryableFetchError=SB;var hm=class extends jr{constructor(e,r,n){super(e,"AuthWeakPasswordError",r,"weak_password"),this.reasons=n}};ce.AuthWeakPasswordError=hm;function xB(t){return Go(t)&&t.name==="AuthWeakPasswordError"}ce.isAuthWeakPasswordError=xB});var gm=y(nt=>{"use strict";var FB=nt&&nt.__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(nt,"__esModule",{value:!0});nt._noResolveJsonResponse=nt._generateLinkResponse=nt._ssoResponse=nt._userResponse=nt._sessionResponsePassword=nt._sessionResponse=nt._request=nt.handleError=void 0;var yc=mc(),pm=Vo(),qn=Wa(),Ei=t=>t.msg||t.message||t.error_description||t.error||JSON.stringify(t),OB=[502,503,504];async function mm(t){var e;if(!(0,pm.looksLikeFetchResponse)(t))throw new qn.AuthRetryableFetchError(Ei(t),0);if(OB.includes(t.status))throw new qn.AuthRetryableFetchError(Ei(t),t.status);let r;try{r=await t.json()}catch(o){throw new qn.AuthUnknownError(Ei(o),o)}let n,i=(0,pm.parseResponseAPIVersion)(t);if(i&&i.getTime()>=yc.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 qn.AuthWeakPasswordError(Ei(r),t.status,((e=r.weak_password)===null||e===void 0?void 0:e.reasons)||[]);if(n==="session_not_found")throw new qn.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 qn.AuthWeakPasswordError(Ei(r),t.status,r.weak_password.reasons);throw new qn.AuthApiError(Ei(r),t.status||500,n)}nt.handleError=mm;var AB=(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 kB(t,e,r,n){var i;let o=Object.assign({},n?.headers);o[yc.API_VERSION_HEADER_NAME]||(o[yc.API_VERSION_HEADER_NAME]=yc.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 TB(t,e,r+a,{headers:o,noResolveJson:n?.noResolveJson},{},n?.body);return n?.xform?n?.xform(u):{data:Object.assign({},u),error:null}}nt._request=kB;async function TB(t,e,r,n,i,o){let s=AB(e,n,i,o),a;try{a=await t(r,Object.assign({},s))}catch(u){throw console.error(u),new qn.AuthRetryableFetchError(Ei(u),0)}if(a.ok||await mm(a),n?.noResolveJson)return a;try{return await a.json()}catch(u){await mm(u)}}function zw(t){var e;let r=null;NB(t)&&(r=Object.assign({},t),t.expires_at||(r.expires_at=(0,pm.expiresAt)(t.expires_in)));let n=(e=t.user)!==null&&e!==void 0?e:t;return{data:{session:r,user:n},error:null}}nt._sessionResponse=zw;function PB(t){let e=zw(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}nt._sessionResponsePassword=PB;function RB(t){var e;return{data:{user:(e=t.user)!==null&&e!==void 0?e:t},error:null}}nt._userResponse=RB;function $B(t){return{data:t,error:null}}nt._ssoResponse=$B;function IB(t){let{action_link:e,email_otp:r,hashed_token:n,redirect_to:i,verification_type:o}=t,s=FB(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}}nt._generateLinkResponse=IB;function jB(t){return t}nt._noResolveJsonResponse=jB;function NB(t){return t.access_token&&t.refresh_token&&t.expires_in}});var Dc=y(Ka=>{"use strict";var LB=Ka&&Ka.__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(Ka,"__esModule",{value:!0});var vt=gm(),BB=Vo(),Nr=Wa(),ym=class{constructor({url:e="",headers:r={},fetch:n}){this.url=e,this.headers=r,this.fetch=(0,BB.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,Nr.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,Nr.isAuthError)(n))return{data:{user:null},error:n};throw n}}async generateLink(e){try{let{options:r}=e,n=LB(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,Nr.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,Nr.isAuthError)(r))return{data:{user:null},error:r};throw r}}async listUsers(e){var r,n,i,o,s,a,u;try{let l={nextPage:null,lastPage:0,total:0},c=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(c.error)throw c.error;let f=await c.json(),h=(s=c.headers.get("x-total-count"))!==null&&s!==void 0?s:0,d=(u=(a=c.headers.get("link"))===null||a===void 0?void 0:a.split(","))!==null&&u!==void 0?u:[];return d.length>0&&(d.forEach(m=>{let b=parseInt(m.split(";")[0].split("=")[1].substring(0,1)),D=JSON.parse(m.split(";")[1].split("=")[1]);l[`${D}Page`]=b}),l.total=parseInt(h)),{data:Object.assign(Object.assign({},f),l),error:null}}catch(l){if((0,Nr.isAuthError)(l))return{data:{users:[]},error:l};throw l}}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,Nr.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,Nr.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,Nr.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,Nr.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,Nr.isAuthError)(r))return{data:null,error:r};throw r}}};Ka.default=ym});var Gw=y(Wo=>{"use strict";Object.defineProperty(Wo,"__esModule",{value:!0});Wo.memoryLocalStorageAdapter=Wo.localStorageAdapter=void 0;var Dm=Vo();Wo.localStorageAdapter={getItem:t=>(0,Dm.supportsLocalStorage)()?globalThis.localStorage.getItem(t):null,setItem:(t,e)=>{(0,Dm.supportsLocalStorage)()&&globalThis.localStorage.setItem(t,e)},removeItem:t=>{(0,Dm.supportsLocalStorage)()&&globalThis.localStorage.removeItem(t)}};function qB(t={}){return{getItem:e=>t[e]||null,setItem:(e,r)=>{t[e]=r},removeItem:e=>{delete t[e]}}}Wo.memoryLocalStorageAdapter=qB});var Ww=y(vc=>{"use strict";Object.defineProperty(vc,"__esModule",{value:!0});vc.polyfillGlobalThis=void 0;function MB(){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)}}vc.polyfillGlobalThis=MB});var vm=y(it=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0});it.processLock=it.navigatorLock=it.ProcessLockAcquireTimeoutError=it.NavigatorLockAcquireTimeoutError=it.LockAcquireTimeoutError=it.internals=void 0;var UB=Vo();it.internals={debug:!!(globalThis&&(0,UB.supportsLocalStorage)()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug")==="true")};var Ya=class extends Error{constructor(e){super(e),this.isAcquireTimeout=!0}};it.LockAcquireTimeoutError=Ya;var bc=class extends Ya{};it.NavigatorLockAcquireTimeoutError=bc;var wc=class extends Ya{};it.ProcessLockAcquireTimeoutError=wc;async function HB(t,e,r){it.internals.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire lock",t,e);let n=new globalThis.AbortController;return e>0&&setTimeout(()=>{n.abort(),it.internals.debug&&console.log("@supabase/gotrue-js: navigatorLock acquire timed out",t)},e),await Promise.resolve().then(()=>globalThis.navigator.locks.request(t,e===0?{mode:"exclusive",ifAvailable:!0}:{mode:"exclusive",signal:n.signal},async i=>{if(i){it.internals.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquired",t,i.name);try{return await r()}finally{it.internals.debug&&console.log("@supabase/gotrue-js: navigatorLock: released",t,i.name)}}else{if(e===0)throw it.internals.debug&&console.log("@supabase/gotrue-js: navigatorLock: not immediately available",t),new bc(`Acquiring an exclusive Navigator LockManager lock "${t}" immediately failed`);if(it.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()}}))}it.navigatorLock=HB;var Kw={};async function VB(t,e,r){var n;let i=(n=Kw[t])!==null&&n!==void 0?n:Promise.resolve(),o=Promise.race([i.catch(()=>null),e>=0?new Promise((s,a)=>{setTimeout(()=>{a(new wc(`Acquring process lock with name "${t}" timed out`))},e)}):null].filter(s=>s)).catch(s=>{if(s&&s.isAcquireTimeout)throw s;return null}).then(async()=>await r());return Kw[t]=o.catch(async s=>{if(s&&s.isAcquireTimeout)return await i,null;throw s}),await o}it.processLock=VB});var wm=y(Za=>{"use strict";var zB=Za&&Za.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Za,"__esModule",{value:!0});var GB=zB(Dc()),Xa=mc(),X=Wa(),se=gm(),me=Vo(),bm=Gw(),WB=Ww(),KB=im(),Yw=vm();(0,WB.polyfillGlobalThis)();var YB={url:Xa.GOTRUE_URL,storageKey:Xa.STORAGE_KEY,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:Xa.DEFAULT_HEADERS,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1},Ja=30*1e3,Jw=3;async function Xw(t,e,r){return await r()}var _c=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,me.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({},YB),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 GB.default({url:i.url,headers:i.headers,fetch:i.fetch}),this.url=i.url,this.headers=i.headers,this.fetch=(0,me.resolveFetch)(i.fetch),this.lock=i.lock||Xw,this.detectSessionInUrl=i.detectSessionInUrl,this.flowType=i.flowType,this.hasCustomAuthorizationHeader=i.hasCustomAuthorizationHeader,i.lock?this.lock=i.lock:(0,me.isBrowser)()&&(!((r=globalThis?.navigator)===null||r===void 0)&&r.locks)?this.lock=Yw.navigatorLock:this.lock=Xw,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,me.supportsLocalStorage)()?this.storage=bm.localStorageAdapter:(this.memoryStorage={},this.storage=(0,bm.memoryLocalStorageAdapter)(this.memoryStorage)):(this.memoryStorage={},this.storage=(0,bm.memoryLocalStorageAdapter)(this.memoryStorage)),(0,me.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} (${KB.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(){var e;try{let r=(0,me.parseParametersFromURL)(window.location.href),n="none";if(this._isImplicitGrantCallback(r)?n="implicit":await this._isPKCECallback(r)&&(n="pkce"),(0,me.isBrowser)()&&this.detectSessionInUrl&&n!=="none"){let{data:i,error:o}=await this._getSessionFromURL(r,n);if(o){if(this._debug("#_initialize()","error detecting session from URL",o),(0,X.isAuthImplicitGrantRedirectError)(o)){let u=(e=o.details)===null||e===void 0?void 0:e.code;if(u==="identity_already_exists"||u==="identity_not_found"||u==="single_identity_not_deletable")return{error:o}}return await this._removeSession(),{error:o}}let{session:s,redirectType:a}=i;return this._debug("#_initialize()","detected session in URL",s,"redirect type",a),await this._saveSession(s),setTimeout(async()=>{a==="recovery"?await this._notifyAllSubscribers("PASSWORD_RECOVERY",s):await this._notifyAllSubscribers("SIGNED_IN",s)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(r){return(0,X.isAuthError)(r)?{error:r}:{error:new X.AuthUnknownError("Unexpected error during initialization",r)}}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(e){var r,n,i;try{let o=await(0,se._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:se._sessionResponse}),{data:s,error:a}=o;if(a||!s)return{data:{user:null,session:null},error:a};let u=s.session,l=s.user;return s.session&&(await this._saveSession(s.session),await this._notifyAllSubscribers("SIGNED_IN",u)),{data:{user:l,session:u},error:null}}catch(o){if((0,X.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:c,password:f,options:h}=e,d=null,m=null;this.flowType==="pkce"&&([d,m]=await(0,me.getCodeChallengeAndMethod)(this.storage,this.storageKey)),o=await(0,se._request)(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:h?.emailRedirectTo,body:{email:c,password:f,data:(r=h?.data)!==null&&r!==void 0?r:{},gotrue_meta_security:{captcha_token:h?.captchaToken},code_challenge:d,code_challenge_method:m},xform:se._sessionResponse})}else if("phone"in e){let{phone:c,password:f,options:h}=e;o=await(0,se._request)(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:c,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:se._sessionResponse})}else throw new X.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,l=s.user;return s.session&&(await this._saveSession(s.session),await this._notifyAllSubscribers("SIGNED_IN",u)),{data:{user:l,session:u},error:null}}catch(o){if((0,X.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,se._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:se._sessionResponsePassword})}else if("phone"in e){let{phone:o,password:s,options:a}=e;r=await(0,se._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:se._sessionResponsePassword})}else throw new X.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 X.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,X.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,me.getItemAsync)(this.storage,`${this.storageKey}-code-verifier`),[n,i]=(r??"").split("/");try{let{data:o,error:s}=await(0,se._request)(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:e,code_verifier:n},xform:se._sessionResponse});if(await(0,me.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 X.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,X.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,se._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:se._sessionResponse}),{data:u,error:l}=a;return l?{data:{user:null,session:null},error:l}:!u||!u.session||!u.user?{data:{user:null,session:null},error:new X.AuthInvalidTokenResponseError}:(u.session&&(await this._saveSession(u.session),await this._notifyAllSubscribers("SIGNED_IN",u.session)),{data:u,error:l})}catch(r){if((0,X.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,l=null,c=null;this.flowType==="pkce"&&([l,c]=await(0,me.getCodeChallengeAndMethod)(this.storage,this.storageKey));let{error:f}=await(0,se._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:l,code_challenge_method:c},redirectTo:u?.emailRedirectTo});return{data:{user:null,session:null},error:f}}if("phone"in e){let{phone:a,options:u}=e,{data:l,error:c}=await(0,se._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:l?.message_id},error:c}}throw new X.AuthInvalidCredentialsError("You must provide either an email or phone number.")}catch(a){if((0,X.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,se._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:se._sessionResponse});if(a)throw a;if(!s)throw new Error("An error occurred on token verification.");let u=s.session,l=s.user;return u?.access_token&&(await this._saveSession(u),await this._notifyAllSubscribers(e.type=="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",u)),{data:{user:l,session:u},error:null}}catch(i){if((0,X.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,me.getCodeChallengeAndMethod)(this.storage,this.storageKey)),await(0,se._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:se._ssoResponse})}catch(o){if((0,X.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 X.AuthSessionMissingError;let{error:i}=await(0,se._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,X.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,se._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,se._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 X.AuthInvalidCredentialsError("You must provide either an email or phone number and a type")}catch(r){if((0,X.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,me.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,l,c)=>(!s&&l==="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 may 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,l,c))})}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,se._request)(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:e,xform:se._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 X.AuthSessionMissingError}:await(0,se._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:se._userResponse})})}catch(r){if((0,X.isAuthError)(r))return(0,X.isAuthSessionMissingError)(r)&&(await this._removeSession(),await(0,me.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 X.AuthSessionMissingError;let s=i.session,a=null,u=null;this.flowType==="pkce"&&e.email!=null&&([a,u]=await(0,me.getCodeChallengeAndMethod)(this.storage,this.storageKey));let{data:l,error:c}=await(0,se._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:se._userResponse});if(c)throw c;return s.user=l.user,await this._saveSession(s),await this._notifyAllSubscribers("USER_UPDATED",s),{data:{user:s.user},error:null}})}catch(n){if((0,X.isAuthError)(n))return{data:{user:null},error:n};throw n}}_decodeJWT(e){return(0,me.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 X.AuthSessionMissingError;let r=Date.now()/1e3,n=r,i=!0,o=null,s=(0,me.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,X.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 X.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,X.isAuthError)(r))return{data:{user:null,session:null},error:r};throw r}}async _getSessionFromURL(e,r){try{if(!(0,me.isBrowser)())throw new X.AuthImplicitGrantRedirectError("No browser detected.");if(e.error||e.error_description||e.error_code)throw new X.AuthImplicitGrantRedirectError(e.error_description||"Error in URL with unspecified error_description",{error:e.error||"unspecified_error",code:e.error_code||"unspecified_code"});switch(r){case"implicit":if(this.flowType==="pkce")throw new X.AuthPKCEGrantCodeExchangeError("Not a valid PKCE flow url.");break;case"pkce":if(this.flowType==="implicit")throw new X.AuthImplicitGrantRedirectError("Not a valid implicit grant flow url.");break;default:}if(r==="pkce"){if(this._debug("#_initialize()","begin","is PKCE flow",!0),!e.code)throw new X.AuthPKCEGrantCodeExchangeError("No code detected.");let{data:F,error:g}=await this._exchangeCodeForSession(e.code);if(g)throw g;let C=new URL(window.location.href);return C.searchParams.delete("code"),window.history.replaceState(window.history.state,"",C.toString()),{data:{session:F.session,redirectType:null},error:null}}let{provider_token:n,provider_refresh_token:i,access_token:o,refresh_token:s,expires_in:a,expires_at:u,token_type:l}=e;if(!o||!a||!s||!l)throw new X.AuthImplicitGrantRedirectError("No session defined in URL");let c=Math.round(Date.now()/1e3),f=parseInt(a),h=c+f;u&&(h=parseInt(u));let d=h-c;d*1e3<=Ja&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${d}s, should have been closer to ${f}s`);let m=h-f;c-m>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",m,h,c):c-m<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew",m,h,c);let{data:b,error:D}=await this._getUser(o);if(D)throw D;let _={provider_token:n,provider_refresh_token:i,access_token:o,expires_in:f,expires_at:h,refresh_token:s,token_type:l,user:b.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),{data:{session:_,redirectType:e.type},error:null}}catch(n){if((0,X.isAuthError)(n))return{data:{session:null,redirectType:null},error:n};throw n}}_isImplicitGrantCallback(e){return!!(e.access_token||e.error_description)}async _isPKCECallback(e){let r=await(0,me.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,X.isAuthApiError)(a)&&(a.status===404||a.status===401||a.status===403)))return{error:a}}return e!=="others"&&(await this._removeSession(),await(0,me.removeItemAsync)(this.storage,`${this.storageKey}-code-verifier`)),{error:null}})}onAuthStateChange(e){let r=(0,me.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,me.getCodeChallengeAndMethod)(this.storage,this.storageKey,!0));try{return await(0,se._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,X.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,X.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,l,c;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,se._request)(this.fetch,"GET",d,{headers:this.headers,jwt:(c=(l=f.session)===null||l===void 0?void 0:l.access_token)!==null&&c!==void 0?c:void 0})});if(i)throw i;return(0,me.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,X.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,se._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,X.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,me.retryable)(async i=>(i>0&&await(0,me.sleep)(200*Math.pow(2,i-1)),this._debug(r,"refreshing attempt",i),await(0,se._request)(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:e},headers:this.headers,xform:se._sessionResponse})),(i,o)=>{let s=200*Math.pow(2,i);return o&&(0,X.isAuthRetryableFetchError)(o)&&Date.now()+s-n<Ja})}catch(n){if(this._debug(r,"error",n),(0,X.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,me.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,me.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+Xa.EXPIRY_MARGIN;if(this._debug(r,`session has${o?"":" not"} expired with margin of ${Xa.EXPIRY_MARGIN}s`),o){if(this.autoRefreshToken&&n.refresh_token){let{error:s}=await this._callRefreshToken(n.refresh_token);s&&(console.error(s),(0,X.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 X.AuthSessionMissingError;if(this.refreshingDeferred)return this.refreshingDeferred.promise;let i=`#_callRefreshToken(${e.substring(0,5)}...)`;this._debug(i,"begin");try{this.refreshingDeferred=new me.Deferred;let{data:o,error:s}=await this._refreshAccessToken(e);if(s)throw s;if(!o.session)throw new X.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,X.isAuthError)(o)){let s={session:null,error:o};return(0,X.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,me.setItemAsync)(this.storage,this.storageKey,e)}async _removeSession(){this._debug("#_removeSession()"),await(0,me.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,me.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(),Ja);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)/Ja);this._debug("#_autoRefreshTokenTick()",`access token expires in ${i} ticks, a tick lasts ${Ja}ms, refresh threshold is ${Jw} ticks`),i<=Jw&&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 Yw.LockAcquireTimeoutError)this._debug("auto refresh token tick lock not available");else throw e}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!(0,me.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,me.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,se._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,X.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:l}=await(0,se._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 l?{data:null,error:l}:(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,X.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,se._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,X.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,se._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,X.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 c=s.amr||[];return{data:{currentLevel:a,nextLevel:u,currentAuthenticationMethods:c},error:null}}))}};Za.default=_c;_c.nextInstanceID=0});var Zw=y(Qa=>{"use strict";var JB=Qa&&Qa.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Qa,"__esModule",{value:!0});var XB=JB(Dc()),ZB=XB.default;Qa.default=ZB});var Qw=y(eu=>{"use strict";var QB=eu&&eu.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(eu,"__esModule",{value:!0});var eq=QB(wm()),tq=eq.default;eu.default=tq});var t_=y(e_=>{"use strict";Object.defineProperty(e_,"__esModule",{value:!0})});var Em=y(Le=>{"use strict";var rq=Le&&Le.__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]}),r_=Le&&Le.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&rq(e,t,r)},Ec=Le&&Le.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Le,"__esModule",{value:!0});Le.lockInternals=Le.NavigatorLockAcquireTimeoutError=Le.navigatorLock=Le.AuthClient=Le.AuthAdminApi=Le.GoTrueClient=Le.GoTrueAdminApi=void 0;var nq=Ec(Dc());Le.GoTrueAdminApi=nq.default;var iq=Ec(wm());Le.GoTrueClient=iq.default;var oq=Ec(Zw());Le.AuthAdminApi=oq.default;var sq=Ec(Qw());Le.AuthClient=sq.default;r_(t_(),Le);r_(Wa(),Le);var _m=vm();Object.defineProperty(Le,"navigatorLock",{enumerable:!0,get:function(){return _m.navigatorLock}});Object.defineProperty(Le,"NavigatorLockAcquireTimeoutError",{enumerable:!0,get:function(){return _m.NavigatorLockAcquireTimeoutError}});Object.defineProperty(Le,"lockInternals",{enumerable:!0,get:function(){return _m.internals}})});var n_=y(Cc=>{"use strict";Object.defineProperty(Cc,"__esModule",{value:!0});Cc.SupabaseAuthClient=void 0;var aq=Em(),Cm=class extends aq.AuthClient{constructor(e){super(e)}};Cc.SupabaseAuthClient=Cm});var xm=y(tu=>{"use strict";var uq=tu&&tu.__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(c){try{l(n.next(c))}catch(f){s(f)}}function u(c){try{l(n.throw(c))}catch(f){s(f)}}function l(c){c.done?o(c.value):i(c.value).then(a,u)}l((n=n.apply(t,e||[])).next())})};Object.defineProperty(tu,"__esModule",{value:!0});var lq=$p(),cq=Gp(),fq=(Yp(),je(Kp)),dq=jw(),Sc=Lw(),hq=qw(),i_=Mw(),pq=n_(),Sm=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,i_.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`,l={db:Sc.DEFAULT_DB_OPTIONS,realtime:Sc.DEFAULT_REALTIME_OPTIONS,auth:Object.assign(Object.assign({},Sc.DEFAULT_AUTH_OPTIONS),{storageKey:u}),global:Sc.DEFAULT_GLOBAL_OPTIONS},c=(0,i_.applySettingDefaults)(n??{},l);this.storageKey=(i=c.auth.storageKey)!==null&&i!==void 0?i:"",this.headers=(o=c.global.headers)!==null&&o!==void 0?o:{},c.accessToken?(this.accessToken=c.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=c.auth)!==null&&s!==void 0?s:{},this.headers,c.global.fetch),this.fetch=(0,hq.fetchWithAuth)(r,this._getAccessToken.bind(this),c.global.fetch),this.realtime=this._initRealtimeClient(Object.assign({headers:this.headers,accessToken:this._getAccessToken.bind(this)},c.realtime)),this.rest=new cq.PostgrestClient(`${a}/rest/v1`,{headers:this.headers,schema:c.db.schema,fetch:this.fetch}),c.accessToken||this._listenForAuthEvents()}get functions(){return new lq.FunctionsClient(this.functionsUrl,{headers:this.headers,customFetch:this.fetch})}get storage(){return new dq.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 uq(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},l,c){let f={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new pq.SupabaseAuthClient({url:this.authUrl,headers:Object.assign(Object.assign({},f),l),storageKey:o,autoRefreshToken:e,persistSession:r,detectSessionInUrl:n,storage:i,flowType:s,lock:a,debug:u,fetch:c,hasCustomAuthorizationHeader:"Authorization"in this.headers})}_initRealtimeClient(e){return new fq.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.changedAccessToken=n:e==="SIGNED_OUT"&&(this.realtime.setAuth(),r=="STORAGE"&&this.auth.signOut(),this.changedAccessToken=void 0)}};tu.default=Sm});var a_=y(Se=>{"use strict";var mq=Se&&Se.__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]}),o_=Se&&Se.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&mq(e,t,r)},s_=Se&&Se.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Se,"__esModule",{value:!0});Se.createClient=Se.SupabaseClient=Se.FunctionRegion=Se.FunctionsError=Se.FunctionsRelayError=Se.FunctionsFetchError=Se.FunctionsHttpError=Se.PostgrestError=void 0;var gq=s_(xm());o_(Em(),Se);var yq=Gp();Object.defineProperty(Se,"PostgrestError",{enumerable:!0,get:function(){return yq.PostgrestError}});var ru=$p();Object.defineProperty(Se,"FunctionsHttpError",{enumerable:!0,get:function(){return ru.FunctionsHttpError}});Object.defineProperty(Se,"FunctionsFetchError",{enumerable:!0,get:function(){return ru.FunctionsFetchError}});Object.defineProperty(Se,"FunctionsRelayError",{enumerable:!0,get:function(){return ru.FunctionsRelayError}});Object.defineProperty(Se,"FunctionsError",{enumerable:!0,get:function(){return ru.FunctionsError}});Object.defineProperty(Se,"FunctionRegion",{enumerable:!0,get:function(){return ru.FunctionRegion}});o_((Yp(),je(Kp)),Se);var Dq=xm();Object.defineProperty(Se,"SupabaseClient",{enumerable:!0,get:function(){return s_(Dq).default}});var vq=(t,e,r)=>new gq.default(t,e,r);Se.createClient=vq});var Fm=y(($ae,u_)=>{u_.exports=require("stream")});var p_=y((Iae,h_)=>{"use strict";function l_(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 c_(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?l_(Object(r),!0).forEach(function(n){bq(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):l_(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function bq(t,e,r){return e=d_(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function wq(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function f_(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,d_(n.key),n)}}function _q(t,e,r){return e&&f_(t.prototype,e),r&&f_(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function d_(t){var e=Eq(t,"string");return typeof e=="symbol"?e:String(e)}function Eq(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 Cq=require("buffer"),xc=Cq.Buffer,Sq=require("util"),Om=Sq.inspect,xq=Om&&Om.custom||"inspect";function Fq(t,e,r){xc.prototype.copy.call(t,e,r)}h_.exports=function(){function t(){wq(this,t),this.head=null,this.tail=null,this.length=0}return _q(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 xc.alloc(0);for(var n=xc.allocUnsafe(r>>>0),i=this.head,o=0;i;)Fq(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=xc.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:xq,value:function(r,n){return Om(this,c_(c_({},n),{},{depth:0,customInspect:!1}))}}]),t}()});var km=y((jae,g_)=>{"use strict";function Oq(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(Am,this,t)):process.nextTick(Am,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(Fc,r):(r._writableState.errorEmitted=!0,process.nextTick(m_,r,o)):process.nextTick(m_,r,o):e?(process.nextTick(Fc,r),e(o)):process.nextTick(Fc,r)}),this)}function m_(t,e){Am(t,e),Fc(t)}function Fc(t){t._writableState&&!t._writableState.emitClose||t._readableState&&!t._readableState.emitClose||t.emit("close")}function Aq(){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 Am(t,e){t.emit("error",e)}function kq(t,e){var r=t._readableState,n=t._writableState;r&&r.autoDestroy||n&&n.autoDestroy?t.destroy(e):t.emit("error",e)}g_.exports={destroy:Oq,undestroy:Aq,errorOrDestroy:kq}});var Mn=y((Nae,v_)=>{"use strict";var D_={};function dr(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,D_[t]=i}function y_(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 Tq(t,e,r){return t.substr(!r||r<0?0:+r,e.length)===e}function Pq(t,e,r){return(r===void 0||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}function Rq(t,e,r){return typeof r!="number"&&(r=0),r+e.length>t.length?!1:t.indexOf(e,r)!==-1}dr("ERR_INVALID_OPT_VALUE",function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'},TypeError);dr("ERR_INVALID_ARG_TYPE",function(t,e,r){let n;typeof e=="string"&&Tq(e,"not ")?(n="must not be",e=e.replace(/^not /,"")):n="must be";let i;if(Pq(t," argument"))i=`The ${t} ${n} ${y_(e,"type")}`;else{let o=Rq(t,".")?"property":"argument";i=`The "${t}" ${o} ${n} ${y_(e,"type")}`}return i+=`. Received type ${typeof r}`,i},TypeError);dr("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");dr("ERR_METHOD_NOT_IMPLEMENTED",function(t){return"The "+t+" method is not implemented"});dr("ERR_STREAM_PREMATURE_CLOSE","Premature close");dr("ERR_STREAM_DESTROYED",function(t){return"Cannot call "+t+" after a stream was destroyed"});dr("ERR_MULTIPLE_CALLBACK","Callback called multiple times");dr("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");dr("ERR_STREAM_WRITE_AFTER_END","write after end");dr("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);dr("ERR_UNKNOWN_ENCODING",function(t){return"Unknown encoding: "+t},TypeError);dr("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");v_.exports.codes=D_});var Tm=y((Lae,b_)=>{"use strict";var $q=Mn().codes.ERR_INVALID_OPT_VALUE;function Iq(t,e,r){return t.highWaterMark!=null?t.highWaterMark:e?t[r]:null}function jq(t,e,r,n){var i=Iq(e,n,r);if(i!=null){if(!(isFinite(i)&&Math.floor(i)===i)||i<0){var o=n?r:"highWaterMark";throw new $q(o,i)}return Math.floor(i)}return t.objectMode?16:16*1024}b_.exports={getHighWaterMark:jq}});var w_=y((Bae,Pm)=>{typeof Object.create=="function"?Pm.exports=function(e,r){r&&(e.super_=r,e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:Pm.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 Ko=y((qae,$m)=>{try{if(Rm=require("util"),typeof Rm.inherits!="function")throw"";$m.exports=Rm.inherits}catch{$m.exports=w_()}var Rm});var E_=y((Mae,__)=>{__.exports=require("util").deprecate});var Nm=y((Uae,A_)=>{"use strict";A_.exports=Ye;function S_(t){var e=this;this.next=null,this.entry=null,this.finish=function(){lM(e,t)}}var Yo;Ye.WritableState=iu;var Nq={deprecate:E_()},x_=Fm(),Ac=require("buffer").Buffer,Lq=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function Bq(t){return Ac.from(t)}function qq(t){return Ac.isBuffer(t)||t instanceof Lq}var jm=km(),Mq=Tm(),Uq=Mq.getHighWaterMark,Un=Mn().codes,Hq=Un.ERR_INVALID_ARG_TYPE,Vq=Un.ERR_METHOD_NOT_IMPLEMENTED,zq=Un.ERR_MULTIPLE_CALLBACK,Gq=Un.ERR_STREAM_CANNOT_PIPE,Wq=Un.ERR_STREAM_DESTROYED,Kq=Un.ERR_STREAM_NULL_VALUES,Yq=Un.ERR_STREAM_WRITE_AFTER_END,Jq=Un.ERR_UNKNOWN_ENCODING,Jo=jm.errorOrDestroy;Ko()(Ye,x_);function Xq(){}function iu(t,e,r){Yo=Yo||Ci(),t=t||{},typeof r!="boolean"&&(r=e instanceof Yo),this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=Uq(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){iM(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 S_(this)}iu.prototype.getBuffer=function(){for(var e=this.bufferedRequest,r=[];e;)r.push(e),e=e.next;return r};(function(){try{Object.defineProperty(iu.prototype,"buffer",{get:Nq.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var Oc;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(Oc=Function.prototype[Symbol.hasInstance],Object.defineProperty(Ye,Symbol.hasInstance,{value:function(e){return Oc.call(this,e)?!0:this!==Ye?!1:e&&e._writableState instanceof iu}})):Oc=function(e){return e instanceof this};function Ye(t){Yo=Yo||Ci();var e=this instanceof Yo;if(!e&&!Oc.call(Ye,this))return new Ye(t);this._writableState=new iu(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)),x_.call(this)}Ye.prototype.pipe=function(){Jo(this,new Gq)};function Zq(t,e){var r=new Yq;Jo(t,r),process.nextTick(e,r)}function Qq(t,e,r,n){var i;return r===null?i=new Kq:typeof r!="string"&&!e.objectMode&&(i=new Hq("chunk",["string","Buffer"],r)),i?(Jo(t,i),process.nextTick(n,i),!1):!0}Ye.prototype.write=function(t,e,r){var n=this._writableState,i=!1,o=!n.objectMode&&qq(t);return o&&!Ac.isBuffer(t)&&(t=Bq(t)),typeof e=="function"&&(r=e,e=null),o?e="buffer":e||(e=n.defaultEncoding),typeof r!="function"&&(r=Xq),n.ending?Zq(this,r):(o||Qq(this,n,t,r))&&(n.pendingcb++,i=tM(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&&F_(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 Jq(e);return this._writableState.defaultEncoding=e,this};Object.defineProperty(Ye.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function eM(t,e,r){return!t.objectMode&&t.decodeStrings!==!1&&typeof e=="string"&&(e=Ac.from(e,r)),e}Object.defineProperty(Ye.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function tM(t,e,r,n,i,o){if(!r){var s=eM(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 l=e.lastBufferedRequest;e.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:o,next:null},l?l.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1}else Im(t,e,!1,a,n,i,o);return u}function Im(t,e,r,n,i,o,s){e.writelen=n,e.writecb=s,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new Wq("write")):r?t._writev(i,e.onwrite):t._write(i,o,e.onwrite),e.sync=!1}function rM(t,e,r,n,i){--e.pendingcb,r?(process.nextTick(i,n),process.nextTick(nu,t,e),t._writableState.errorEmitted=!0,Jo(t,n)):(i(n),t._writableState.errorEmitted=!0,Jo(t,n),nu(t,e))}function nM(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}function iM(t,e){var r=t._writableState,n=r.sync,i=r.writecb;if(typeof i!="function")throw new zq;if(nM(r),e)rM(t,r,n,e,i);else{var o=O_(r)||t.destroyed;!o&&!r.corked&&!r.bufferProcessing&&r.bufferedRequest&&F_(t,r),n?process.nextTick(C_,t,r,o,i):C_(t,r,o,i)}}function C_(t,e,r,n){r||oM(t,e),e.pendingcb--,n(),nu(t,e)}function oM(t,e){e.length===0&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}function F_(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,Im(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 S_(e),e.bufferedRequestCount=0}else{for(;r;){var u=r.chunk,l=r.encoding,c=r.callback,f=e.objectMode?1:u.length;if(Im(t,e,!1,f,u,l,c),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 Vq("_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||uM(this,n,r),this};Object.defineProperty(Ye.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function O_(t){return t.ending&&t.length===0&&t.bufferedRequest===null&&!t.finished&&!t.writing}function sM(t,e){t._final(function(r){e.pendingcb--,r&&Jo(t,r),e.prefinished=!0,t.emit("prefinish"),nu(t,e)})}function aM(t,e){!e.prefinished&&!e.finalCalled&&(typeof t._final=="function"&&!e.destroyed?(e.pendingcb++,e.finalCalled=!0,process.nextTick(sM,t,e)):(e.prefinished=!0,t.emit("prefinish")))}function nu(t,e){var r=O_(e);if(r&&(aM(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 uM(t,e,r){e.ending=!0,nu(t,e),r&&(e.finished?process.nextTick(r):t.once("finish",r)),e.ended=!0,t.writable=!1}function lM(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=jm.destroy;Ye.prototype._undestroy=jm.undestroy;Ye.prototype._destroy=function(t,e){e(t)}});var Ci=y((Hae,T_)=>{"use strict";var cM=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};T_.exports=Lr;var k_=qm(),Bm=Nm();Ko()(Lr,k_);for(Lm=cM(Bm.prototype),kc=0;kc<Lm.length;kc++)Tc=Lm[kc],Lr.prototype[Tc]||(Lr.prototype[Tc]=Bm.prototype[Tc]);var Lm,Tc,kc;function Lr(t){if(!(this instanceof Lr))return new Lr(t);k_.call(this,t),Bm.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",fM)))}Object.defineProperty(Lr.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});Object.defineProperty(Lr.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});Object.defineProperty(Lr.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function fM(){this._writableState.ended||process.nextTick(dM,this)}function dM(t){t.end()}Object.defineProperty(Lr.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 $_=y((Mm,R_)=>{var Pc=require("buffer"),Br=Pc.Buffer;function P_(t,e){for(var r in t)e[r]=t[r]}Br.from&&Br.alloc&&Br.allocUnsafe&&Br.allocUnsafeSlow?R_.exports=Pc:(P_(Pc,Mm),Mm.Buffer=Si);function Si(t,e,r){return Br(t,e,r)}Si.prototype=Object.create(Br.prototype);P_(Br,Si);Si.from=function(t,e,r){if(typeof t=="number")throw new TypeError("Argument must not be a number");return Br(t,e,r)};Si.alloc=function(t,e,r){if(typeof t!="number")throw new TypeError("Argument must be a number");var n=Br(t);return e!==void 0?typeof r=="string"?n.fill(e,r):n.fill(e):n.fill(0),n};Si.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return Br(t)};Si.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return Pc.SlowBuffer(t)}});var Vm=y(j_=>{"use strict";var Hm=$_().Buffer,I_=Hm.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 hM(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 pM(t){var e=hM(t);if(typeof e!="string"&&(Hm.isEncoding===I_||!I_(t)))throw new Error("Unknown encoding: "+t);return e||t}j_.StringDecoder=ou;function ou(t){this.encoding=pM(t);var e;switch(this.encoding){case"utf16le":this.text=bM,this.end=wM,e=4;break;case"utf8":this.fillLast=yM,e=4;break;case"base64":this.text=_M,this.end=EM,e=3;break;default:this.write=CM,this.end=SM;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=Hm.allocUnsafe(e)}ou.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||""};ou.prototype.end=vM;ou.prototype.text=DM;ou.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 Um(t){return t<=127?0:t>>5===6?2:t>>4===14?3:t>>3===30?4:t>>6===2?-1:-2}function mM(t,e,r){var n=e.length-1;if(n<r)return 0;var i=Um(e[n]);return i>=0?(i>0&&(t.lastNeed=i-1),i):--n<r||i===-2?0:(i=Um(e[n]),i>=0?(i>0&&(t.lastNeed=i-2),i):--n<r||i===-2?0:(i=Um(e[n]),i>=0?(i>0&&(i===2?i=0:t.lastNeed=i-3),i):0))}function gM(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 yM(t){var e=this.lastTotal-this.lastNeed,r=gM(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 DM(t,e){var r=mM(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 vM(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"\uFFFD":e}function bM(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 wM(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 _M(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 EM(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function CM(t){return t.toString(this.encoding)}function SM(t){return t&&t.length?this.write(t):""}});var Rc=y((zae,B_)=>{"use strict";var N_=Mn().codes.ERR_STREAM_PREMATURE_CLOSE;function xM(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 FM(){}function OM(t){return t.setHeader&&typeof t.abort=="function"}function L_(t,e,r){if(typeof e=="function")return L_(t,null,e);e||(e={}),r=xM(r||FM);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,l=function(){n=!1,u=!0,i||r.call(t)},c=function(m){r.call(t,m)},f=function(){var m;if(n&&!u)return(!t._readableState||!t._readableState.ended)&&(m=new N_),r.call(t,m);if(i&&!s)return(!t._writableState||!t._writableState.ended)&&(m=new N_),r.call(t,m)},h=function(){t.req.on("finish",a)};return OM(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",l),t.on("finish",a),e.error!==!1&&t.on("error",c),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",l),t.removeListener("error",c),t.removeListener("close",f)}}B_.exports=L_});var M_=y((Gae,q_)=>{"use strict";var $c;function Hn(t,e,r){return e=AM(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function AM(t){var e=kM(t,"string");return typeof e=="symbol"?e:String(e)}function kM(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 TM=Rc(),Vn=Symbol("lastResolve"),xi=Symbol("lastReject"),su=Symbol("error"),Ic=Symbol("ended"),Fi=Symbol("lastPromise"),zm=Symbol("handlePromise"),Oi=Symbol("stream");function zn(t,e){return{value:t,done:e}}function PM(t){var e=t[Vn];if(e!==null){var r=t[Oi].read();r!==null&&(t[Fi]=null,t[Vn]=null,t[xi]=null,e(zn(r,!1)))}}function RM(t){process.nextTick(PM,t)}function $M(t,e){return function(r,n){t.then(function(){if(e[Ic]){r(zn(void 0,!0));return}e[zm](r,n)},n)}}var IM=Object.getPrototypeOf(function(){}),jM=Object.setPrototypeOf(($c={get stream(){return this[Oi]},next:function(){var e=this,r=this[su];if(r!==null)return Promise.reject(r);if(this[Ic])return Promise.resolve(zn(void 0,!0));if(this[Oi].destroyed)return new Promise(function(s,a){process.nextTick(function(){e[su]?a(e[su]):s(zn(void 0,!0))})});var n=this[Fi],i;if(n)i=new Promise($M(n,this));else{var o=this[Oi].read();if(o!==null)return Promise.resolve(zn(o,!1));i=new Promise(this[zm])}return this[Fi]=i,i}},Hn($c,Symbol.asyncIterator,function(){return this}),Hn($c,"return",function(){var e=this;return new Promise(function(r,n){e[Oi].destroy(null,function(i){if(i){n(i);return}r(zn(void 0,!0))})})}),$c),IM),NM=function(e){var r,n=Object.create(jM,(r={},Hn(r,Oi,{value:e,writable:!0}),Hn(r,Vn,{value:null,writable:!0}),Hn(r,xi,{value:null,writable:!0}),Hn(r,su,{value:null,writable:!0}),Hn(r,Ic,{value:e._readableState.endEmitted,writable:!0}),Hn(r,zm,{value:function(o,s){var a=n[Oi].read();a?(n[Fi]=null,n[Vn]=null,n[xi]=null,o(zn(a,!1))):(n[Vn]=o,n[xi]=s)},writable:!0}),r));return n[Fi]=null,TM(e,function(i){if(i&&i.code!=="ERR_STREAM_PREMATURE_CLOSE"){var o=n[xi];o!==null&&(n[Fi]=null,n[Vn]=null,n[xi]=null,o(i)),n[su]=i;return}var s=n[Vn];s!==null&&(n[Fi]=null,n[Vn]=null,n[xi]=null,s(zn(void 0,!0))),n[Ic]=!0}),e.on("readable",RM.bind(null,n)),n};q_.exports=NM});var z_=y((Wae,V_)=>{"use strict";function U_(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(l){r(l);return}a.done?e(u):Promise.resolve(u).then(n,i)}function LM(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function s(u){U_(o,n,i,s,a,"next",u)}function a(u){U_(o,n,i,s,a,"throw",u)}s(void 0)})}}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 BM(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){qM(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 qM(t,e,r){return e=MM(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function MM(t){var e=UM(t,"string");return typeof e=="symbol"?e:String(e)}function UM(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 HM=Mn().codes.ERR_INVALID_ARG_TYPE;function VM(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 HM("iterable",["Iterable"],e);var i=new t(BM({objectMode:!0},r)),o=!1;i._read=function(){o||(o=!0,s())};function s(){return a.apply(this,arguments)}function a(){return a=LM(function*(){try{var u=yield n.next(),l=u.value,c=u.done;c?i.push(null):i.push(yield l)?s():o=!1}catch(f){i.destroy(f)}}),a.apply(this,arguments)}return i}V_.exports=VM});var qm=y((Yae,tE)=>{"use strict";tE.exports=ge;var Xo;ge.ReadableState=Y_;var Kae=require("events").EventEmitter,K_=function(e,r){return e.listeners(r).length},uu=Fm(),jc=require("buffer").Buffer,zM=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function GM(t){return jc.from(t)}function WM(t){return jc.isBuffer(t)||t instanceof zM}var Gm=require("util"),ae;Gm&&Gm.debuglog?ae=Gm.debuglog("stream"):ae=function(){};var KM=p_(),Qm=km(),YM=Tm(),JM=YM.getHighWaterMark,Nc=Mn().codes,XM=Nc.ERR_INVALID_ARG_TYPE,ZM=Nc.ERR_STREAM_PUSH_AFTER_EOF,QM=Nc.ERR_METHOD_NOT_IMPLEMENTED,e4=Nc.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,Zo,Wm,Km;Ko()(ge,uu);var au=Qm.errorOrDestroy,Ym=["error","close","destroy","pause","resume"];function t4(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 Y_(t,e,r){Xo=Xo||Ci(),t=t||{},typeof r!="boolean"&&(r=e instanceof Xo),this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=JM(this,t,"readableHighWaterMark",r),this.buffer=new KM,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&&(Zo||(Zo=Vm().StringDecoder),this.decoder=new Zo(t.encoding),this.encoding=t.encoding)}function ge(t){if(Xo=Xo||Ci(),!(this instanceof ge))return new ge(t);var e=this instanceof Xo;this._readableState=new Y_(t,this,e),this.readable=!0,t&&(typeof t.read=="function"&&(this._read=t.read),typeof t.destroy=="function"&&(this._destroy=t.destroy)),uu.call(this)}Object.defineProperty(ge.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}});ge.prototype.destroy=Qm.destroy;ge.prototype._undestroy=Qm.undestroy;ge.prototype._destroy=function(t,e){e(t)};ge.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=jc.from(t,e),e=""),n=!0),J_(this,t,e,!1,n)};ge.prototype.unshift=function(t){return J_(this,t,null,!0,!1)};function J_(t,e,r,n,i){ae("readableAddChunk",e);var o=t._readableState;if(e===null)o.reading=!1,i4(t,o);else{var s;if(i||(s=r4(o,e)),s)au(t,s);else if(o.objectMode||e&&e.length>0)if(typeof e!="string"&&!o.objectMode&&Object.getPrototypeOf(e)!==jc.prototype&&(e=GM(e)),n)o.endEmitted?au(t,new e4):Jm(t,o,e,!0);else if(o.ended)au(t,new ZM);else{if(o.destroyed)return!1;o.reading=!1,o.decoder&&!r?(e=o.decoder.write(e),o.objectMode||e.length!==0?Jm(t,o,e,!1):Zm(t,o)):Jm(t,o,e,!1)}else n||(o.reading=!1,Zm(t,o))}return!o.ended&&(o.length<o.highWaterMark||o.length===0)}function Jm(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&&Lc(t)),Zm(t,e)}function r4(t,e){var r;return!WM(e)&&typeof e!="string"&&e!==void 0&&!t.objectMode&&(r=new XM("chunk",["string","Buffer","Uint8Array"],e)),r}ge.prototype.isPaused=function(){return this._readableState.flowing===!1};ge.prototype.setEncoding=function(t){Zo||(Zo=Vm().StringDecoder);var e=new Zo(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 G_=1073741824;function n4(t){return t>=G_?t=G_:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}function W_(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=n4(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}ge.prototype.read=function(t){ae("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 ae("read: emitReadable",e.length,e.ended),e.length===0&&e.ended?Xm(this):Lc(this),null;if(t=W_(t,e),t===0&&e.ended)return e.length===0&&Xm(this),null;var n=e.needReadable;ae("need readable",n),(e.length===0||e.length-t<e.highWaterMark)&&(n=!0,ae("length less than watermark",n)),e.ended||e.reading?(n=!1,ae("reading or ended",n)):n&&(ae("do read"),e.reading=!0,e.sync=!0,e.length===0&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1,e.reading||(t=W_(r,e)));var i;return t>0?i=Q_(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&&Xm(this)),i!==null&&this.emit("data",i),i};function i4(t,e){if(ae("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?Lc(t):(e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,X_(t)))}}function Lc(t){var e=t._readableState;ae("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(ae("emitReadable",e.flowing),e.emittedReadable=!0,process.nextTick(X_,t))}function X_(t){var e=t._readableState;ae("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,eg(t)}function Zm(t,e){e.readingMore||(e.readingMore=!0,process.nextTick(o4,t,e))}function o4(t,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&e.length===0);){var r=e.length;if(ae("maybeReadMore read 0"),t.read(0),r===e.length)break}e.readingMore=!1}ge.prototype._read=function(t){au(this,new QM("_read()"))};ge.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,ae("pipe count=%d opts=%j",n.pipesCount,e);var i=(!e||e.end!==!1)&&t!==process.stdout&&t!==process.stderr,o=i?a:b;n.endEmitted?process.nextTick(o):r.once("end",o),t.on("unpipe",s);function s(D,_){ae("onunpipe"),D===r&&_&&_.hasUnpiped===!1&&(_.hasUnpiped=!0,c())}function a(){ae("onend"),t.end()}var u=s4(r);t.on("drain",u);var l=!1;function c(){ae("cleanup"),t.removeListener("close",d),t.removeListener("finish",m),t.removeListener("drain",u),t.removeListener("error",h),t.removeListener("unpipe",s),r.removeListener("end",a),r.removeListener("end",b),r.removeListener("data",f),l=!0,n.awaitDrain&&(!t._writableState||t._writableState.needDrain)&&u()}r.on("data",f);function f(D){ae("ondata");var _=t.write(D);ae("dest.write",_),_===!1&&((n.pipesCount===1&&n.pipes===t||n.pipesCount>1&&eE(n.pipes,t)!==-1)&&!l&&(ae("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function h(D){ae("onerror",D),b(),t.removeListener("error",h),K_(t,"error")===0&&au(t,D)}t4(t,"error",h);function d(){t.removeListener("finish",m),b()}t.once("close",d);function m(){ae("onfinish"),t.removeListener("close",d),b()}t.once("finish",m);function b(){ae("unpipe"),r.unpipe(t)}return t.emit("pipe",r),n.flowing||(ae("pipe resume"),r.resume()),t};function s4(t){return function(){var r=t._readableState;ae("pipeOnDrain",r.awaitDrain),r.awaitDrain&&r.awaitDrain--,r.awaitDrain===0&&K_(t,"data")&&(r.flowing=!0,eg(t))}}ge.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=eE(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)};ge.prototype.on=function(t,e){var r=uu.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,ae("on readable",n.length,n.reading),n.length?Lc(this):n.reading||process.nextTick(a4,this)),r};ge.prototype.addListener=ge.prototype.on;ge.prototype.removeListener=function(t,e){var r=uu.prototype.removeListener.call(this,t,e);return t==="readable"&&process.nextTick(Z_,this),r};ge.prototype.removeAllListeners=function(t){var e=uu.prototype.removeAllListeners.apply(this,arguments);return(t==="readable"||t===void 0)&&process.nextTick(Z_,this),e};function Z_(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 a4(t){ae("readable nexttick read 0"),t.read(0)}ge.prototype.resume=function(){var t=this._readableState;return t.flowing||(ae("resume"),t.flowing=!t.readableListening,u4(this,t)),t.paused=!1,this};function u4(t,e){e.resumeScheduled||(e.resumeScheduled=!0,process.nextTick(l4,t,e))}function l4(t,e){ae("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),eg(t),e.flowing&&!e.reading&&t.read(0)}ge.prototype.pause=function(){return ae("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(ae("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function eg(t){var e=t._readableState;for(ae("flow",e.flowing);e.flowing&&t.read()!==null;);}ge.prototype.wrap=function(t){var e=this,r=this._readableState,n=!1;t.on("end",function(){if(ae("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(ae("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<Ym.length;o++)t.on(Ym[o],this.emit.bind(this,Ym[o]));return this._read=function(s){ae("wrapped _read",s),n&&(n=!1,t.resume())},this};typeof Symbol=="function"&&(ge.prototype[Symbol.asyncIterator]=function(){return Wm===void 0&&(Wm=M_()),Wm(this)});Object.defineProperty(ge.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}});Object.defineProperty(ge.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}});Object.defineProperty(ge.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}});ge._fromList=Q_;Object.defineProperty(ge.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function Q_(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 Xm(t){var e=t._readableState;ae("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,process.nextTick(c4,e,t))}function c4(t,e){if(ae("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"&&(ge.from=function(t,e){return Km===void 0&&(Km=z_()),Km(ge,t,e)});function eE(t,e){for(var r=0,n=t.length;r<n;r++)if(t[r]===e)return r;return-1}});var tg=y((Jae,nE)=>{"use strict";nE.exports=dn;var Bc=Mn().codes,f4=Bc.ERR_METHOD_NOT_IMPLEMENTED,d4=Bc.ERR_MULTIPLE_CALLBACK,h4=Bc.ERR_TRANSFORM_ALREADY_TRANSFORMING,p4=Bc.ERR_TRANSFORM_WITH_LENGTH_0,qc=Ci();Ko()(dn,qc);function m4(t,e){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(n===null)return this.emit("error",new d4);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);qc.call(this,t),this._transformState={afterTransform:m4.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",g4)}function g4(){var t=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(e,r){rE(t,e,r)}):rE(this,null,null)}dn.prototype.push=function(t,e){return this._transformState.needTransform=!1,qc.prototype.push.call(this,t,e)};dn.prototype._transform=function(t,e,r){r(new f4("_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){qc.prototype._destroy.call(this,t,function(r){e(r)})};function rE(t,e,r){if(e)return t.emit("error",e);if(r!=null&&t.push(r),t._writableState.length)throw new p4;if(t._transformState.transforming)throw new h4;return t.push(null)}});var sE=y((Xae,oE)=>{"use strict";oE.exports=lu;var iE=tg();Ko()(lu,iE);function lu(t){if(!(this instanceof lu))return new lu(t);iE.call(this,t)}lu.prototype._transform=function(t,e,r){r(null,t)}});var fE=y((Zae,cE)=>{"use strict";var rg;function y4(t){var e=!1;return function(){e||(e=!0,t.apply(void 0,arguments))}}var lE=Mn().codes,D4=lE.ERR_MISSING_ARGS,v4=lE.ERR_STREAM_DESTROYED;function aE(t){if(t)throw t}function b4(t){return t.setHeader&&typeof t.abort=="function"}function w4(t,e,r,n){n=y4(n);var i=!1;t.on("close",function(){i=!0}),rg===void 0&&(rg=Rc()),rg(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,b4(t))return t.abort();if(typeof t.destroy=="function")return t.destroy();n(s||new v4("pipe"))}}}function uE(t){t()}function _4(t,e){return t.pipe(e)}function E4(t){return!t.length||typeof t[t.length-1]!="function"?aE:t.pop()}function C4(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];var n=E4(e);if(Array.isArray(e[0])&&(e=e[0]),e.length<2)throw new D4("streams");var i,o=e.map(function(s,a){var u=a<e.length-1,l=a>0;return w4(s,u,l,function(c){i||(i=c),c&&o.forEach(uE),!u&&(o.forEach(uE),n(i))})});return e.reduce(_4)}cE.exports=C4});var dE=y((hr,fu)=>{var cu=require("stream");process.env.READABLE_STREAM==="disable"&&cu?(fu.exports=cu.Readable,Object.assign(fu.exports,cu),fu.exports.Stream=cu):(hr=fu.exports=qm(),hr.Stream=cu||hr,hr.Readable=hr,hr.Writable=Nm(),hr.Duplex=Ci(),hr.Transform=tg(),hr.PassThrough=sE(),hr.finished=Rc(),hr.pipeline=fE())});var ig=y(ng=>{var hE;(function(t){typeof DO_NOT_EXPORT_CRC>"u"?typeof ng=="object"?t(ng):typeof define=="function"&&define.amd?define(function(){var e={};return t(e),e}):t(hE={}):t(hE={})})(function(t){t.version="1.2.2";function e(){for(var x=0,L=new Array(256),S=0;S!=256;++S)x=S,x=x&1?-306674912^x>>>1:x>>>1,x=x&1?-306674912^x>>>1:x>>>1,x=x&1?-306674912^x>>>1:x>>>1,x=x&1?-306674912^x>>>1:x>>>1,x=x&1?-306674912^x>>>1:x>>>1,x=x&1?-306674912^x>>>1:x>>>1,x=x&1?-306674912^x>>>1:x>>>1,x=x&1?-306674912^x>>>1:x>>>1,L[S]=x;return typeof Int32Array<"u"?new Int32Array(L):L}var r=e();function n(x){var L=0,S=0,I=0,$=typeof Int32Array<"u"?new Int32Array(4096):new Array(4096);for(I=0;I!=256;++I)$[I]=x[I];for(I=0;I!=256;++I)for(S=x[I],L=256+I;L<4096;L+=256)S=$[L]=S>>>8^x[S&255];var B=[];for(I=1;I!=16;++I)B[I-1]=typeof Int32Array<"u"?$.subarray(I*256,I*256+256):$.slice(I*256,I*256+256);return B}var i=n(r),o=i[0],s=i[1],a=i[2],u=i[3],l=i[4],c=i[5],f=i[6],h=i[7],d=i[8],m=i[9],b=i[10],D=i[11],_=i[12],F=i[13],g=i[14];function C(x,L){for(var S=L^-1,I=0,$=x.length;I<$;)S=S>>>8^r[(S^x.charCodeAt(I++))&255];return~S}function A(x,L){for(var S=L^-1,I=x.length-15,$=0;$<I;)S=g[x[$++]^S&255]^F[x[$++]^S>>8&255]^_[x[$++]^S>>16&255]^D[x[$++]^S>>>24]^b[x[$++]]^m[x[$++]]^d[x[$++]]^h[x[$++]]^f[x[$++]]^c[x[$++]]^l[x[$++]]^u[x[$++]]^a[x[$++]]^s[x[$++]]^o[x[$++]]^r[x[$++]];for(I+=15;$<I;)S=S>>>8^r[(S^x[$++])&255];return~S}function T(x,L){for(var S=L^-1,I=0,$=x.length,B=0,q=0;I<$;)B=x.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=x.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=A,t.str=T})});var mE=y((eue,pE)=>{"use strict";var{Transform:S4}=dE(),x4=ig(),og=class extends S4{constructor(e){super(e),this.checksum=Buffer.allocUnsafe(4),this.checksum.writeInt32BE(0,0),this.rawSize=0}_transform(e,r,n){e&&(this.checksum=x4.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}};pE.exports=og});var yE=y((tue,gE)=>{"use strict";var{DeflateRaw:F4}=require("zlib"),O4=ig(),sg=class extends F4{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=O4.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}};gE.exports=sg});var vE=y((rue,DE)=>{"use strict";DE.exports={CRC32Stream:mE(),DeflateCRC32Stream:yE()}});var du=y(Qo=>{"use strict";Object.defineProperty(Qo,"__esModule",{value:!0});Qo.checksum=Qo.checksumFile=void 0;var A4=require("fs"),k4=require("crypto"),wE=require("stream"),T4=require("util"),{CRC32Stream:P4}=vE(),bE=(0,T4.promisify)(wE.pipeline),R4=(t,e,r)=>_E(A4.createReadStream(t),e,r);Qo.checksumFile=R4;async function _E(t,e,r="hex"){let n=I4(t);if(e==="crc32"){let o=new P4,s=bE(n,o);return o.resume(),await s,o.end(),Buffer.from(o.digest()).toString(r)}let i=(0,k4.createHash)(e);return await bE(n,i),i.end(),i.digest(r)}Qo.checksum=_E;function $4(t){return t!=null&&typeof t=="object"&&typeof t.read=="function"&&typeof t.pipe=="function"}var I4=t=>$4(t)?t:new wE.Readable({read(){this.push(t),this.push(null)}})});var ag=y((iue,EE)=>{EE.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 Mc=y(SE=>{var CE={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 j4(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(CE))SE[t]=j4(CE[t])});var kE=y((sue,AE)=>{var N4=require("fs"),at=require("path"),xE=ag(),L4=Mc(),B4=typeof process=="object"&&process.platform==="win32",FE=t=>typeof t=="object"&&t!==null,OE=new Uint32Array(256).map((t,e)=>{for(let r=0;r<8;r++)(e&1)!==0?e=3988292384^e>>>1:e>>>=1;return e>>>0});function Je(t){this.sep=at.sep,this.fs=N4,FE(t)&&FE(t.fs)&&typeof t.fs.statSync=="function"&&(this.fs=t.fs)}AE.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 L4.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 l=at.dirname(t);o.fs.exists(l,function(c){c||o.makeDir(l),o.fs.open(t,"w",438,function(f,h){f?o.fs.chmod(t,438,function(){o.fs.open(t,"w",438,function(d,m){o.fs.write(m,e,0,e.length,0,function(){o.fs.close(m,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),l=e.fs.statSync(u);(!i||i.test(u))&&s.push(at.normalize(u)+(l.isDirectory()?e.sep:"")),l.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,l){if(u)return e(u);l&&(n.push(at.normalize(a)+(l.isDirectory()?r.sep:"")),l.isDirectory()?r.findFilesAsync(a,function(c,f){if(c)return e(c);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 OE[(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 xE.STORED:return"STORED ("+t+")";case xE.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=B4;Je.crcTable=OE});var PE=y((aue,TE)=>{var q4=require("path");TE.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=q4.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 $E=y((uue,RE)=>{RE.exports={efs:!0,encode:t=>Buffer.from(t,"utf8"),decode:t=>t.toString("utf8")}});var ts=y((lue,es)=>{es.exports=kE();es.exports.Constants=ag();es.exports.Errors=Mc();es.exports.FileAttr=PE();es.exports.decoder=$E()});var jE=y((cue,IE)=>{var Gn=ts(),H=Gn.Constants;IE.exports=function(){var t=20,e=10,r=0,n=0,i=0,o=0,s=0,a=0,u=0,l=0,c=0,f=0,h=0,d=0,m=0;t|=Gn.isWin?2560:768,r|=H.FLG_EFS;let b={extraLen:0},D=g=>Math.max(0,g)>>>0,_=g=>Math.max(0,g)&65535,F=g=>Math.max(0,g)&255;return i=Gn.fromDate2DOS(new Date),{get made(){return t},set made(g){t=g},get version(){return e},set version(g){e=g},get flags(){return r},set flags(g){r=g},get flags_efs(){return(r&H.FLG_EFS)>0},set flags_efs(g){g?r|=H.FLG_EFS:r&=~H.FLG_EFS},get flags_desc(){return(r&H.FLG_DESC)>0},set flags_desc(g){g?r|=H.FLG_DESC:r&=~H.FLG_DESC},get method(){return n},set method(g){switch(g){case H.STORED:this.version=10;case H.DEFLATED:default:this.version=20}n=g},get time(){return Gn.fromDOS2Date(this.timeval)},set time(g){this.timeval=Gn.fromDate2DOS(g)},get timeval(){return i},set timeval(g){i=D(g)},get timeHighByte(){return F(i>>>8)},get crc(){return o},set crc(g){o=D(g)},get compressedSize(){return s},set compressedSize(g){s=D(g)},get size(){return a},set size(g){a=D(g)},get fileNameLength(){return u},set fileNameLength(g){u=g},get extraLength(){return l},set extraLength(g){l=g},get extraLocalLength(){return b.extraLen},set extraLocalLength(g){b.extraLen=g},get commentLength(){return c},set commentLength(g){c=g},get diskNumStart(){return f},set diskNumStart(g){f=D(g)},get inAttr(){return h},set inAttr(g){h=D(g)},get attr(){return d},set attr(g){d=D(g)},get fileAttr(){return(d||0)>>16&4095},get offset(){return m},set offset(g){m=D(g)},get encrypted(){return(r&H.FLG_ENC)===H.FLG_ENC},get centralHeaderSize(){return H.CENHDR+u+l+c},get realDataOffset(){return m+H.LOCHDR+b.fnameLen+b.extraLen},get localHeader(){return b},loadLocalHeaderFromBinary:function(g){var C=g.slice(m,m+H.LOCHDR);if(C.readUInt32LE(0)!==H.LOCSIG)throw Gn.Errors.INVALID_LOC();b.version=C.readUInt16LE(H.LOCVER),b.flags=C.readUInt16LE(H.LOCFLG),b.method=C.readUInt16LE(H.LOCHOW),b.time=C.readUInt32LE(H.LOCTIM),b.crc=C.readUInt32LE(H.LOCCRC),b.compressedSize=C.readUInt32LE(H.LOCSIZ),b.size=C.readUInt32LE(H.LOCLEN),b.fnameLen=C.readUInt16LE(H.LOCNAM),b.extraLen=C.readUInt16LE(H.LOCEXT);let A=m+H.LOCHDR+b.fnameLen,T=A+b.extraLen;return g.slice(A,T)},loadFromBinary:function(g){if(g.length!==H.CENHDR||g.readUInt32LE(0)!==H.CENSIG)throw Gn.Errors.INVALID_CEN();t=g.readUInt16LE(H.CENVEM),e=g.readUInt16LE(H.CENVER),r=g.readUInt16LE(H.CENFLG),n=g.readUInt16LE(H.CENHOW),i=g.readUInt32LE(H.CENTIM),o=g.readUInt32LE(H.CENCRC),s=g.readUInt32LE(H.CENSIZ),a=g.readUInt32LE(H.CENLEN),u=g.readUInt16LE(H.CENNAM),l=g.readUInt16LE(H.CENEXT),c=g.readUInt16LE(H.CENCOM),f=g.readUInt16LE(H.CENDSK),h=g.readUInt16LE(H.CENATT),d=g.readUInt32LE(H.CENATX),m=g.readUInt32LE(H.CENOFF)},localHeaderToBinary:function(){var g=Buffer.alloc(H.LOCHDR);return g.writeUInt32LE(H.LOCSIG,0),g.writeUInt16LE(e,H.LOCVER),g.writeUInt16LE(r,H.LOCFLG),g.writeUInt16LE(n,H.LOCHOW),g.writeUInt32LE(i,H.LOCTIM),g.writeUInt32LE(o,H.LOCCRC),g.writeUInt32LE(s,H.LOCSIZ),g.writeUInt32LE(a,H.LOCLEN),g.writeUInt16LE(u,H.LOCNAM),g.writeUInt16LE(b.extraLen,H.LOCEXT),g},centralHeaderToBinary:function(){var g=Buffer.alloc(H.CENHDR+u+l+c);return g.writeUInt32LE(H.CENSIG,0),g.writeUInt16LE(t,H.CENVEM),g.writeUInt16LE(e,H.CENVER),g.writeUInt16LE(r,H.CENFLG),g.writeUInt16LE(n,H.CENHOW),g.writeUInt32LE(i,H.CENTIM),g.writeUInt32LE(o,H.CENCRC),g.writeUInt32LE(s,H.CENSIZ),g.writeUInt32LE(a,H.CENLEN),g.writeUInt16LE(u,H.CENNAM),g.writeUInt16LE(l,H.CENEXT),g.writeUInt16LE(c,H.CENCOM),g.writeUInt16LE(f,H.CENDSK),g.writeUInt16LE(h,H.CENATT),g.writeUInt32LE(d,H.CENATX),g.writeUInt32LE(m,H.CENOFF),g},toJSON:function(){let g=function(C){return C+" bytes"};return{made:t,version:e,flags:r,method:Gn.methodToString(n),time:this.time,crc:"0x"+o.toString(16).toUpperCase(),compressedSize:g(s),size:g(a),fileNameLength:g(u),extraLength:g(l),commentLength:g(c),diskNumStart:f,inAttr:h,attr:d,offset:m,centralHeaderSize:g(H.CENHDR+u+l+c)}},toString:function(){return JSON.stringify(this.toJSON(),null," ")}}}});var LE=y((fue,NE)=>{var rs=ts(),He=rs.Constants;NE.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 He.ENDHDR+i},loadFromBinary:function(o){if((o.length!==He.ENDHDR||o.readUInt32LE(0)!==He.ENDSIG)&&(o.length<He.ZIP64HDR||o.readUInt32LE(0)!==He.ZIP64SIG))throw rs.Errors.INVALID_END();o.readUInt32LE(0)===He.ENDSIG?(t=o.readUInt16LE(He.ENDSUB),e=o.readUInt16LE(He.ENDTOT),r=o.readUInt32LE(He.ENDSIZ),n=o.readUInt32LE(He.ENDOFF),i=o.readUInt16LE(He.ENDCOM)):(t=rs.readBigUInt64LE(o,He.ZIP64SUB),e=rs.readBigUInt64LE(o,He.ZIP64TOT),r=rs.readBigUInt64LE(o,He.ZIP64SIZE),n=rs.readBigUInt64LE(o,He.ZIP64OFF),i=0)},toBinary:function(){var o=Buffer.alloc(He.ENDHDR+i);return o.writeUInt32LE(He.ENDSIG,0),o.writeUInt32LE(0,4),o.writeUInt16LE(t,He.ENDSUB),o.writeUInt16LE(e,He.ENDTOT),o.writeUInt32LE(r,He.ENDSIZ),o.writeUInt32LE(n,He.ENDOFF),o.writeUInt16LE(i,He.ENDCOM),o.fill(" ",He.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 lg=y(ug=>{ug.EntryHeader=jE();ug.MainHeader=LE()});var qE=y((hue,BE)=>{BE.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 l=0;l<o.length;l++){var c=o[l];c.copy(a,u),u+=c.length}n&&n(a)}),i.end(t)}}}});var UE=y((pue,ME)=>{var M4=+(process.versions?process.versions.node:"").split(".")[0]||0;ME.exports=function(t,e){var r=require("zlib");let n=M4>=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),l=0;u.fill(0);for(var c=0;c<s.length;c++){var f=s[c];f.copy(u,l),l+=f.length}i&&i(u)}),o.end(t)}}}});var WE=y((mue,GE)=>{"use strict";var{randomFillSync:HE}=require("crypto"),U4=Mc(),H4=new Uint32Array(256).map((t,e)=>{for(let r=0;r<8;r++)(e&1)!==0?e=e>>>1^3988292384:e>>>=1;return e>>>0}),zE=(t,e)=>Math.imul(t,e)>>>0,VE=(t,e)=>H4[(t^e)&255]^t>>>8,hu=()=>typeof HE=="function"?HE(Buffer.alloc(12)):hu.node();hu.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 Uc={genSalt:hu};function Hc(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])}Hc.prototype.updateKeys=function(t){let e=this.keys;return e[0]=VE(e[0],t),e[1]+=e[0]&255,e[1]=zE(e[1],134775813)+1,e[2]=VE(e[2],e[1]>>>24),t};Hc.prototype.next=function(){let t=(this.keys[2]|2)>>>0;return zE(t,t^1)>>8&255};function V4(t){let e=new Hc(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 z4(t){let e=new Hc(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 G4(t,e,r){if(!t||!Buffer.isBuffer(t)||t.length<12)return Buffer.alloc(0);let n=V4(r),i=n(t.slice(0,12)),o=(e.flags&8)===8?e.timeHighByte:e.crc>>>24;if(i[11]!==o)throw U4.WRONG_PASSWORD();return n(t.slice(12))}function W4(t){Buffer.isBuffer(t)&&t.length>=12?Uc.genSalt=function(){return t.slice(0,12)}:t==="node"?Uc.genSalt=hu.node:Uc.genSalt=hu}function K4(t,e,r,n=!1){t==null&&(t=Buffer.alloc(0)),Buffer.isBuffer(t)||(t=Buffer.from(t.toString()));let i=z4(r),o=Uc.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)}GE.exports={decrypt:G4,encrypt:K4,_salter:W4}});var KE=y(Vc=>{Vc.Deflater=qE();Vc.Inflater=UE();Vc.ZipCrypto=WE()});var fg=y((yue,YE)=>{var ve=ts(),Y4=lg(),Xe=ve.Constants,cg=KE();YE.exports=function(t,e){var r=new Y4.EntryHeader,n=Buffer.alloc(0),i=Buffer.alloc(0),o=!1,s=null,a=Buffer.alloc(0),u=Buffer.alloc(0),l=!0;let c=t,f=typeof c.decoder=="object"?c.decoder:ve.decoder;l=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(g){if(r.flags_desc){let C={},A=r.realDataOffset+r.compressedSize;if(e.readUInt32LE(A)==Xe.LOCSIG||e.readUInt32LE(A)==Xe.CENSIG)throw ve.Errors.DESCRIPTOR_NOT_EXIST();if(e.readUInt32LE(A)==Xe.EXTSIG)C.crc=e.readUInt32LE(A+Xe.EXTCRC),C.compressedSize=e.readUInt32LE(A+Xe.EXTSIZ),C.size=e.readUInt32LE(A+Xe.EXTLEN);else if(e.readUInt16LE(A+12)===19280)C.crc=e.readUInt32LE(A+Xe.EXTCRC-4),C.compressedSize=e.readUInt32LE(A+Xe.EXTSIZ-4),C.size=e.readUInt32LE(A+Xe.EXTLEN-4);else throw ve.Errors.DESCRIPTOR_UNKNOWN();if(C.compressedSize!==r.compressedSize||C.size!==r.size||C.crc!==r.crc)throw ve.Errors.DESCRIPTOR_FAULTY();if(ve.crc32(g)!==C.crc)return!1}else if(ve.crc32(g)!==r.localHeader.crc)return!1;return!0}function m(g,C,A){if(typeof C>"u"&&typeof g=="string"&&(A=g,g=void 0),o)return g&&C&&C(Buffer.alloc(0),ve.Errors.DIRECTORY_CONTENT_ERROR()),Buffer.alloc(0);var T=h();if(T.length===0)return g&&C&&C(T),T;if(r.encrypted){if(typeof A!="string"&&!Buffer.isBuffer(A))throw ve.Errors.INVALID_PASS_PARAM();T=cg.ZipCrypto.decrypt(T,r,A)}var x=Buffer.alloc(r.size);switch(r.method){case ve.Constants.STORED:if(T.copy(x),d(x))return g&&C&&C(x),x;throw g&&C&&C(x,ve.Errors.BAD_CRC()),ve.Errors.BAD_CRC();case ve.Constants.DEFLATED:var L=new cg.Inflater(T,r.size);if(g)L.inflateAsync(function(S){S.copy(S,0),C&&(d(S)?C(S):C(S,ve.Errors.BAD_CRC()))});else{if(L.inflate(x).copy(x,0),!d(x))throw ve.Errors.BAD_CRC(`"${f.decode(n)}"`);return x}break;default:throw g&&C&&C(Buffer.alloc(0),ve.Errors.UNKNOWN_METHOD()),ve.Errors.UNKNOWN_METHOD()}}function b(g,C){if((!s||!s.length)&&Buffer.isBuffer(e))return g&&C&&C(h()),h();if(s.length&&!o){var A;switch(r.method){case ve.Constants.STORED:return r.compressedSize=r.size,A=Buffer.alloc(s.length),s.copy(A),g&&C&&C(A),A;default:case ve.Constants.DEFLATED:var T=new cg.Deflater(s);if(g)T.deflateAsync(function(L){A=Buffer.alloc(L.length),r.compressedSize=L.length,L.copy(A),C&&C(A)});else{var x=T.deflate();return r.compressedSize=x.length,x}T=null;break}}else if(g&&C)C(Buffer.alloc(0));else return Buffer.alloc(0)}function D(g,C){return(g.readUInt32LE(C+4)<<4)+g.readUInt32LE(C)}function _(g){try{for(var C=0,A,T,x;C+4<g.length;)A=g.readUInt16LE(C),C+=2,T=g.readUInt16LE(C),C+=2,x=g.slice(C,C+T),C+=T,Xe.ID_ZIP64===A&&F(x)}catch{throw ve.Errors.EXTRA_FIELD_PARSE_ERROR()}}function F(g){var C,A,T,x;g.length>=Xe.EF_ZIP64_SCOMP&&(C=D(g,Xe.EF_ZIP64_SUNCOMP),r.size===Xe.EF_ZIP64_OR_32&&(r.size=C)),g.length>=Xe.EF_ZIP64_RHO&&(A=D(g,Xe.EF_ZIP64_SCOMP),r.compressedSize===Xe.EF_ZIP64_OR_32&&(r.compressedSize=A)),g.length>=Xe.EF_ZIP64_DSN&&(T=D(g,Xe.EF_ZIP64_RHO),r.offset===Xe.EF_ZIP64_OR_32&&(r.offset=T)),g.length>=Xe.EF_ZIP64_DSN+4&&(x=g.readUInt32LE(Xe.EF_ZIP64_DSN),r.diskNumStart===Xe.EF_ZIP64_OR_16&&(r.diskNumStart=x))}return{get entryName(){return f.decode(n)},get rawEntryName(){return n},set entryName(g){n=ve.toBuffer(g,f.encode);var C=n[n.length-1];o=C===47||C===92,r.fileNameLength=n.length},get efs(){return typeof l=="function"?l(this.entryName):l},get extra(){return a},set extra(g){a=g,r.extraLength=g.length,_(g)},get comment(){return f.decode(i)},set comment(g){if(i=ve.toBuffer(g,f.encode),r.commentLength=i.length,i.length>65535)throw ve.Errors.COMMENT_TOO_LONG()},get name(){var g=f.decode(n);return o?g.substr(g.length-1).split("/").pop():g.split("/").pop()},get isDirectory(){return o},getCompressedData:function(){return b(!1,null)},getCompressedDataAsync:function(g){b(!0,g)},setData:function(g){s=ve.toBuffer(g,ve.decoder.encode),!o&&s.length?(r.size=s.length,r.method=ve.Constants.DEFLATED,r.crc=ve.crc32(g),r.changed=!0):r.method=ve.Constants.STORED},getData:function(g){return r.changed?s:m(!1,null,g)},getDataAsync:function(g,C){r.changed?g(s):m(!0,g,C)},set attr(g){r.attr=g},get attr(){return r.attr},set header(g){r.loadFromBinary(g)},get header(){return r},packCentralHeader:function(){r.flags_efs=this.efs,r.extraLength=a.length;var g=r.centralHeaderToBinary(),C=ve.Constants.CENHDR;return n.copy(g,C),C+=n.length,a.copy(g,C),C+=r.extraLength,i.copy(g,C),g},packLocalHeader:function(){let g=0;r.flags_efs=this.efs,r.extraLocalLength=u.length;let C=r.localHeaderToBinary(),A=Buffer.alloc(C.length+n.length+r.extraLocalLength);return C.copy(A,g),g+=C.length,n.copy(A,g),g+=n.length,u.copy(A,g),g+=u.length,A},toJSON:function(){let g=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:g(e),data:g(s)}},toString:function(){return JSON.stringify(this.toJSON(),null," ")}}}});var ZE=y((Due,XE)=>{var JE=fg(),J4=lg(),bt=ts();XE.exports=function(t,e){var r=[],n={},i=Buffer.alloc(0),o=new J4.MainHeader,s=!1,a=null;let u=new Set,l=e,{noSort:c,decoder:f}=l;t?m(l.readEntries):s=!0;function h(){let D=new Set;for(let _ of Object.keys(n)){let F=_.split("/");if(F.pop(),!!F.length)for(let g=0;g<F.length;g++){let C=F.slice(0,g+1).join("/")+"/";D.add(C)}}for(let _ of D)if(!(_ in n)){let F=new JE(l);F.entryName=_,F.attr=16,F.temporary=!0,r.push(F),n[F.entryName]=F,u.add(F)}}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 D=o.offset,_=0;_<r.length;_++){var F=D,g=new JE(l,t);g.header=t.slice(F,F+=bt.Constants.CENHDR),g.entryName=t.slice(F,F+=g.header.fileNameLength),g.header.extraLength&&(g.extra=t.slice(F,F+=g.header.extraLength)),g.header.commentLength&&(g.comment=t.slice(F,F+g.header.commentLength)),D+=g.header.centralHeaderSize,r[_]=g,n[g.entryName]=g}u.clear(),h()}function m(D){var _=t.length-bt.Constants.ENDHDR,F=Math.max(0,_-65535),g=F,C=t.length,A=-1,T=0;for((typeof l.trailingSpace=="boolean"?l.trailingSpace:!1)&&(F=0),_;_>=g;_--)if(t[_]===80){if(t.readUInt32LE(_)===bt.Constants.ENDSIG){A=_,T=_,C=_+bt.Constants.ENDHDR,g=_-bt.Constants.END64HDR;continue}if(t.readUInt32LE(_)===bt.Constants.END64SIG){g=F;continue}if(t.readUInt32LE(_)===bt.Constants.ZIP64SIG){A=_,C=_+bt.readBigUInt64LE(t,_+bt.Constants.ZIP64SIZE)+bt.Constants.ZIP64LEAD;break}}if(A==-1)throw bt.Errors.INVALID_FORMAT();o.loadFromBinary(t.slice(A,C)),o.commentLength&&(i=t.slice(T+bt.Constants.ENDHDR)),D&&d()}function b(){r.length>1&&!c&&r.sort((D,_)=>D.entryName.toLowerCase().localeCompare(_.entryName.toLowerCase()))}return{get entries(){return s||d(),r.filter(D=>!u.has(D))},get comment(){return f.decode(i)},set comment(D){i=bt.toBuffer(D,f.encode),o.commentLength=i.length},getEntryCount:function(){return s?r.length:o.diskEntries},forEach:function(D){this.entries.forEach(D)},getEntry:function(D){return s||d(),n[D]||null},setEntry:function(D){s||d(),r.push(D),n[D.entryName]=D,o.totalEntries=r.length},deleteFile:function(D,_=!0){s||d();let F=n[D];this.getEntryChildren(F,_).map(C=>C.entryName).forEach(this.deleteEntry)},deleteEntry:function(D){s||d();let _=n[D],F=r.indexOf(_);F>=0&&(r.splice(F,1),delete n[D],o.totalEntries=r.length)},getEntryChildren:function(D,_=!0){if(s||d(),typeof D=="object")if(D.isDirectory&&_){let F=[],g=D.entryName;for(let C of r)C.entryName.startsWith(g)&&F.push(C);return F}else return[D];return[]},getChildCount:function(D){if(D&&D.isDirectory){let _=this.getEntryChildren(D);return _.includes(D)?_.length-1:_.length}return 0},compressToBuffer:function(){s||d(),b();let D=[],_=[],F=0,g=0;o.size=0,o.offset=0;let C=0;for(let x of this.entries){let L=x.getCompressedData();x.header.offset=g;let S=x.packLocalHeader(),I=S.length+L.length;g+=I,D.push(S),D.push(L);let $=x.packCentralHeader();_.push($),o.size+=$.length,F+=I+$.length,C++}F+=o.mainHeaderSize,o.offset=g,o.totalEntries=C,g=0;let A=Buffer.alloc(F);for(let x of D)x.copy(A,g),g+=x.length;for(let x of _)x.copy(A,g),g+=x.length;let T=o.toBinary();return i&&i.copy(T,bt.Constants.ENDHDR),T.copy(A,g),t=A,s=!1,A},toAsyncBuffer:function(D,_,F,g){try{s||d(),b();let C=[],A=[],T=0,x=0,L=0;o.size=0,o.offset=0;let S=function(I){if(I.length>0){let $=I.shift(),B=$.entryName+$.extra.toString();F&&F(B),$.getCompressedDataAsync(function(q){g&&g(B),$.header.offset=x;let K=$.packLocalHeader(),V=K.length+q.length;x+=V,C.push(K),C.push(q);let E=$.packCentralHeader();A.push(E),o.size+=E.length,T+=V+E.length,L++,S(I)})}else{T+=o.mainHeaderSize,o.offset=x,o.totalEntries=L,x=0;let $=Buffer.alloc(T);C.forEach(function(q){q.copy($,x),x+=q.length}),A.forEach(function(q){q.copy($,x),x+=q.length});let B=o.toBinary();i&&i.copy(B,bt.Constants.ENDHDR),B.copy($,x),t=$,s=!1,D($)}};S(Array.from(this.entries))}catch(C){_(C)}}}}});var tC=y((vue,eC)=>{var Ve=ts(),Ze=require("path"),X4=fg(),Z4=ZE(),Ai=(...t)=>Ve.findLast(t,e=>typeof e=="boolean"),QE=(...t)=>Ve.findLast(t,e=>typeof e=="string"),Q4=(...t)=>Ve.findLast(t,e=>typeof e=="function"),e5={noSort:!1,readEntries:!1,method:Ve.Constants.NONE,fs:null};eC.exports=function(t,e){let r=null,n=Object.assign(Object.create(null),e5);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=Ve.Constants.BUFFER,t=void 0)),Object.assign(n,e);let i=new Ve(n);if((typeof n.decoder!="object"||typeof n.decoder.encode!="function"||typeof n.decoder.decode!="function")&&(n.decoder=Ve.decoder),t&&typeof t=="string")if(i.fs.existsSync(t))n.method=Ve.Constants.FILE,n.filename=t,r=i.fs.readFileSync(t);else throw Ve.Errors.INVALID_FILENAME();let o=new Z4(r,n),{canonical:s,sanitize:a,zipnamefix:u}=Ve;function l(d){if(d&&o){var m;if(typeof d=="string"&&(m=o.getEntry(Ze.posix.normalize(d))),typeof d=="object"&&typeof d.entryName<"u"&&typeof d.header<"u"&&(m=o.getEntry(d.entryName)),m)return m}return null}function c(d){let{join:m,normalize:b,sep:D}=Ze.posix;return m(".",b(D+d.split("\\").join(D)+D))}function f(d){return d instanceof RegExp?function(m){return function(b){return m.test(b)}}(d):typeof d!="function"?()=>!0:d}let h=(d,m)=>{let b=m.slice(-1);return b=b===i.sep?i.sep:"",Ze.relative(d,m)+b};return{readFile:function(d,m){var b=l(d);return b&&b.getData(m)||null},childCount:function(d){let m=l(d);if(m)return o.getChildCount(m)},readFileAsync:function(d,m){var b=l(d);b?b.getDataAsync(m):m(null,"getEntry failed for:"+d)},readAsText:function(d,m){var b=l(d);if(b){var D=b.getData();if(D&&D.length)return D.toString(m||"utf8")}return""},readAsTextAsync:function(d,m,b){var D=l(d);D?D.getDataAsync(function(_,F){if(F){m(_,F);return}_&&_.length?m(_.toString(b||"utf8")):m("")}):m("")},deleteFile:function(d,m=!0){var b=l(d);b&&o.deleteFile(b.entryName,m)},deleteEntry:function(d){var m=l(d);m&&o.deleteEntry(m.entryName)},addZipComment:function(d){o.comment=d},getZipComment:function(){return o.comment||""},addZipEntryComment:function(d,m){var b=l(d);b&&(b.comment=m)},getZipEntryComment:function(d){var m=l(d);return m&&m.comment||""},updateFile:function(d,m){var b=l(d);b&&b.setData(m)},addLocalFile:function(d,m,b,D){if(i.fs.existsSync(d)){m=m?c(m):"";let _=Ze.win32.basename(Ze.win32.normalize(d));m+=b||_;let F=i.fs.statSync(d),g=F.isFile()?i.fs.readFileSync(d):Buffer.alloc(0);F.isDirectory()&&(m+=i.sep),this.addFile(m,g,D,F)}else throw Ve.Errors.FILE_NOT_FOUND(d)},addLocalFileAsync:function(d,m){d=typeof d=="object"?d:{localPath:d};let b=Ze.resolve(d.localPath),{comment:D}=d,{zipPath:_,zipName:F}=d,g=this;i.fs.stat(b,function(C,A){if(C)return m(C,!1);_=_?c(_):"";let T=Ze.win32.basename(Ze.win32.normalize(b));if(_+=F||T,A.isFile())i.fs.readFile(b,function(x,L){return x?m(x,!1):(g.addFile(_,L,D,A),setImmediate(m,void 0,!0))});else if(A.isDirectory())return _+=i.sep,g.addFile(_,Buffer.alloc(0),D,A),setImmediate(m,void 0,!0)})},addLocalFolder:function(d,m,b){if(b=f(b),m=m?c(m):"",d=Ze.normalize(d),i.fs.existsSync(d)){let D=i.findFiles(d),_=this;if(D.length)for(let F of D){let g=Ze.join(m,h(d,F));b(g)&&_.addLocalFile(F,Ze.dirname(g))}}else throw Ve.Errors.FILE_NOT_FOUND(d)},addLocalFolderAsync:function(d,m,b,D){D=f(D),b=b?c(b):"",d=Ze.normalize(d);var _=this;i.fs.open(d,"r",function(F){if(F&&F.code==="ENOENT")m(void 0,Ve.Errors.FILE_NOT_FOUND(d));else if(F)m(void 0,F);else{var g=i.findFiles(d),C=-1,A=function(){if(C+=1,C<g.length){var T=g[C],x=h(d,T).split("\\").join("/");x=x.normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/[^\x20-\x7E]/g,""),D(x)?i.fs.stat(T,function(L,S){L&&m(void 0,L),S.isFile()?i.fs.readFile(T,function(I,$){I?m(void 0,I):(_.addFile(b+x,$,"",S),A())}):(_.addFile(b+x+"/",Buffer.alloc(0),"",S),A())}):process.nextTick(()=>{A()})}else m(!0,void 0)};A()}})},addLocalFolderAsync2:function(d,m){let b=this;d=typeof d=="object"?d:{localPath:d},localPath=Ze.resolve(c(d.localPath));let{zipPath:D,filter:_,namefix:F}=d;_ instanceof RegExp?_=function(A){return function(T){return A.test(T)}}(_):typeof _!="function"&&(_=function(){return!0}),D=D?c(D):"",F=="latin1"&&(F=A=>A.normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/[^\x20-\x7E]/g,"")),typeof F!="function"&&(F=A=>A);let g=A=>Ze.join(D,F(h(localPath,A))),C=A=>Ze.win32.basename(Ze.win32.normalize(F(A)));i.fs.open(localPath,"r",function(A){A&&A.code==="ENOENT"?m(void 0,Ve.Errors.FILE_NOT_FOUND(localPath)):A?m(void 0,A):i.findFilesAsync(localPath,function(T,x){if(T)return m(T);x=x.filter(L=>_(g(L))),x.length||m(void 0,!1),setImmediate(x.reverse().reduce(function(L,S){return function(I,$){if(I||$===!1)return setImmediate(L,I,!1);b.addLocalFileAsync({localPath:S,zipPath:Ze.dirname(g(S)),zipName:C(S)},L)}},m))})})},addLocalFolderPromise:function(d,m){return new Promise((b,D)=>{this.addLocalFolderAsync2(Object.assign({localPath:d},m),(_,F)=>{_&&D(_),F&&b(this)})})},addFile:function(d,m,b,D){d=u(d);let _=l(d),F=_!=null;F||(_=new X4(n),_.entryName=d),_.comment=b||"";let g=typeof D=="object"&&D instanceof i.fs.Stats;g&&(_.header.time=D.mtime);var C=_.isDirectory?16:0;let A=_.isDirectory?16384:32768;return g?A|=4095&D.mode:typeof D=="number"?A|=4095&D:A|=_.isDirectory?493:420,C=(C|A<<16)>>>0,_.attr=C,_.setData(m),F||o.setEntry(_),_},getEntries:function(d){return o.password=d,o?o.entries:[]},getEntry:function(d){return l(d)},getEntryCount:function(){return o.getEntryCount()},forEach:function(d){return o.forEach(d)},extractEntryTo:function(d,m,b,D,_,F){D=Ai(!1,D),_=Ai(!1,_),b=Ai(!0,b),F=QE(_,F);var g=l(d);if(!g)throw Ve.Errors.NO_ENTRY();var C=s(g.entryName),A=a(m,F&&!g.isDirectory?F:b?C:Ze.basename(C));if(g.isDirectory){var T=o.getEntryChildren(g);return T.forEach(function(S){if(S.isDirectory)return;var I=S.getData();if(!I)throw Ve.Errors.CANT_EXTRACT_FILE();var $=s(S.entryName),B=a(m,b?$:Ze.basename($));let q=_?S.header.fileAttr:void 0;i.writeFileTo(B,I,D,q)}),!0}var x=g.getData(o.password);if(!x)throw Ve.Errors.CANT_EXTRACT_FILE();if(i.fs.existsSync(A)&&!D)throw Ve.Errors.CANT_OVERRIDE();let L=_?d.header.fileAttr:void 0;return i.writeFileTo(A,x,D,L),!0},test:function(d){if(!o)return!1;for(var m in o.entries)try{if(m.isDirectory)continue;var b=o.entries[m].getData(d);if(!b)return!1}catch{return!1}return!0},extractAllTo:function(d,m,b,D){if(b=Ai(!1,b),D=QE(b,D),m=Ai(!1,m),!o)throw Ve.Errors.NO_ZIP();o.entries.forEach(function(_){var F=a(d,s(_.entryName));if(_.isDirectory){i.makeDir(F);return}var g=_.getData(D);if(!g)throw Ve.Errors.CANT_EXTRACT_FILE();let C=b?_.header.fileAttr:void 0;i.writeFileTo(F,g,m,C);try{i.fs.utimesSync(F,_.header.time,_.header.time)}catch{throw Ve.Errors.CANT_EXTRACT_FILE()}})},extractAllToAsync:function(d,m,b,D){if(D=Q4(m,b,D),b=Ai(!1,b),m=Ai(!1,m),!D)return new Promise((A,T)=>{this.extractAllToAsync(d,m,b,function(x){x?T(x):A(this)})});if(!o){D(Ve.Errors.NO_ZIP());return}d=Ze.resolve(d);let _=A=>a(d,Ze.normalize(s(A.entryName))),F=(A,T)=>new Error(A+': "'+T+'"'),g=[],C=[];o.entries.forEach(A=>{A.isDirectory?g.push(A):C.push(A)});for(let A of g){let T=_(A),x=b?A.header.fileAttr:void 0;try{i.makeDir(T),x&&i.fs.chmodSync(T,x),i.fs.utimesSync(T,A.header.time,A.header.time)}catch{D(F("Unable to create folder",T))}}C.reverse().reduce(function(A,T){return function(x){if(x)A(x);else{let L=Ze.normalize(s(T.entryName)),S=a(d,L);T.getDataAsync(function(I,$){if($)A($);else if(!I)A(Ve.Errors.CANT_EXTRACT_FILE());else{let B=b?T.header.fileAttr:void 0;i.writeFileToAsync(S,I,m,B,function(q){q||A(F("Unable to write file",S)),i.fs.utimes(S,T.header.time,T.header.time,function(K){K?A(F("Unable to set times",S)):A()})})}})}}},D)()},writeZip:function(d,m){if(arguments.length===1&&typeof d=="function"&&(m=d,d=""),!d&&n.filename&&(d=n.filename),!!d){var b=o.compressToBuffer();if(b){var D=i.writeFileTo(d,b,!0);typeof m=="function"&&m(D?null:new Error("failed"),"")}}},writeZipPromise:function(d,m){let{overwrite:b,perm:D}=Object.assign({overwrite:!0},m);return new Promise((_,F)=>{!d&&n.filename&&(d=n.filename),d||F("ADM-ZIP: ZIP File Name Missing"),this.toBufferPromise().then(g=>{let C=A=>A?_(A):F("ADM-ZIP: Wasn't able to write zip file");i.writeFileToAsync(d,g,b,D,C)},F)})},toBufferPromise:function(){return new Promise((d,m)=>{o.toAsyncBuffer(d,m)})},toBuffer:function(d,m,b,D){return typeof d=="function"?(o.toAsyncBuffer(d,m,b,D),null):o.compressToBuffer()}}}});var gC=y((Wue,mC)=>{var pC={};mC.exports=pC;var hC={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(hC).forEach(function(t){var e=hC[t],r=pC[t]=[];r.open="\x1B["+e[0]+"m",r.close="\x1B["+e[1]+"m"})});var DC=y((Kue,yC)=>{"use strict";yC.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 bC=y((Yue,vC)=>{"use strict";var s5=require("os"),Sr=DC(),kt=process.env,os=void 0;Sr("no-color")||Sr("no-colors")||Sr("color=false")?os=!1:(Sr("color")||Sr("colors")||Sr("color=true")||Sr("color=always"))&&(os=!0);"FORCE_COLOR"in kt&&(os=kt.FORCE_COLOR.length===0||parseInt(kt.FORCE_COLOR,10)!==0);function a5(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}function u5(t){if(os===!1)return 0;if(Sr("color=16m")||Sr("color=full")||Sr("color=truecolor"))return 3;if(Sr("color=256"))return 2;if(t&&!t.isTTY&&os!==!0)return 0;var e=os?1:0;if(process.platform==="win32"){var r=s5.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 kt)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some(function(i){return i in kt})||kt.CI_NAME==="codeship"?1:e;if("TEAMCITY_VERSION"in kt)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(kt.TEAMCITY_VERSION)?1:0;if("TERM_PROGRAM"in kt){var n=parseInt((kt.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(kt.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Hyper":return 3;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(kt.TERM)?2:/^screen|^xterm|^vt100|^rxvt|color|ansi|cygwin|linux/i.test(kt.TERM)||"COLORTERM"in kt?1:(kt.TERM==="dumb",e)}function Dg(t){var e=u5(t);return a5(e)}vC.exports={supportsColor:Dg,stdout:Dg(process.stdout),stderr:Dg(process.stderr)}});var _C=y((Jue,wC)=>{wC.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 CC=y((Xue,EC)=>{EC.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 l=Math.floor(Math.random()*u);return l}function s(u){var l=!1;return i.filter(function(c){l=c===u}),l}function a(u,l){var c="",f,h;l=l||{},l.up=typeof l.up<"u"?l.up:!0,l.mid=typeof l.mid<"u"?l.mid:!0,l.down=typeof l.down<"u"?l.down:!0,l.size=typeof l.size<"u"?l.size:"maxi",u=u.split("");for(h in u)if(!s(h)){switch(c=c+u[h],f={up:0,down:0,mid:0},l.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 m in d)for(var b=d[m],D=0;D<=f[b];D++)l[b]&&(c=c+n[b][o(n[b].length)])}return c}return a(e,r)}});var xC=y((Zue,SC)=>{SC.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 OC=y((Que,FC)=>{FC.exports=function(t){return function(e,r,n){return r%2===0?e:t.inverse(e)}}});var kC=y((ele,AC)=>{AC.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 PC=y((tle,TC)=>{TC.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 LC=y((nle,NC)=>{var le={};NC.exports=le;le.themes={};var l5=require("util"),ki=le.styles=gC(),$C=Object.defineProperties,c5=new RegExp(/[\r\n]+/g);le.supportsColor=bC().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 rle=le.stylize=function(e,r){if(!le.enabled)return e+"";var n=ki[r];return!n&&r in le?le[r](e):n.open+e+n.close},f5=/[|\\{}()[\]^$+*?.]/g,d5=function(t){if(typeof t!="string")throw new TypeError("Expected a string");return t.replace(f5,"\\$&")};function IC(t){var e=function r(){return p5.apply(r,arguments)};return e._styles=t,e.__proto__=h5,e}var jC=function(){var t={};return ki.grey=ki.gray,Object.keys(ki).forEach(function(e){ki[e].closeRe=new RegExp(d5(ki[e].close),"g"),t[e]={get:function(){return IC(this._styles.concat(e))}}}),t}(),h5=$C(function(){},jC);function p5(){var t=Array.prototype.slice.call(arguments),e=t.map(function(s){return s!=null&&s.constructor===String?s:l5.inspect(s)}).join(" ");if(!le.enabled||!e)return e;for(var r=e.indexOf(`
|
|
22
|
+
`)!=-1,n=this._styles,i=n.length;i--;){var o=ki[n[i]];e=o.open+e.replace(o.closeRe,o.open)+o.close,r&&(e=e.replace(c5,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 m5(){var t={};return Object.keys(jC).forEach(function(e){t[e]={get:function(){return IC([e])}}}),t}var g5=function(e,r){var n=r.split("");return n=n.map(e),n.join("")};le.trap=_C();le.zalgo=CC();le.maps={};le.maps.america=xC()(le);le.maps.zebra=OC()(le);le.maps.rainbow=kC()(le);le.maps.random=PC()(le);for(RC in le.maps)(function(t){le[t]=function(e){return g5(le.maps[t],e)}})(RC);var RC;$C(le,m5())});var qC=y((ile,BC)=>{var y5=LC();BC.exports=y5});var MC=y(vg=>{"use strict";vg.indent=function(e){return new Array(e+1).join(" ")};vg.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 UC=y((sle,D5)=>{D5.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 HC=y(gu=>{"use strict";var Mr=qC(),Kn=MC(),v5=/[^\w\s\n\r\v\t\.,]/i;gu.version=UC().version;var bg=function(t,e){return t!==void 0||e.renderUndefined},Yc=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(`
|
|
23
|
+
`)===-1||r.inlineArrays&&!e&&Array.isArray(t)&&Yc(t[0],!0,r))},b5=function(t,e){if(e.noColor)return t;if(typeof t=="string")return e.stringColor?Mr[e.stringColor](t):t;var r=t+"";return t===!0?Mr.green(r):t===!1?Mr.red(r):t==null?Mr.grey(r):typeof t=="number"?t>=0?Mr[e.positiveNumberColor](r):Mr[e.negativeNumberColor](r):typeof t=="function"?"function() {}":Array.isArray(t)?t.join(", "):r},wg=function(t,e){return t.multilineStringColor===null||t.noColor?e:Mr[t.multilineStringColor](e)},w5=function(t,e,r){var n=t.split(`
|
|
24
24
|
`);return n=n.map(function(i){return Kn.indent(e)+wg(r,i)}),n.join(`
|
|
25
|
-
`)},ss=function(t,e,r){if(typeof t=="string"&&t.match(
|
|
25
|
+
`)},ss=function(t,e,r){if(typeof t=="string"&&t.match(v5)&&e.escape&&(t=JSON.stringify(t)),!bg(t,e))return[];if(Yc(t,!1,e))return[Kn.indent(r)+b5(t,e)];if(typeof t=="string")return[Kn.indent(r)+wg(e,'"""'),w5(t,r+e.defaultIndentation,e),Kn.indent(r)+wg(e,'"""')];if(Array.isArray(t)){if(t.length===0)return[Kn.indent(r)+e.emptyArrayMsg];var n=[];return t.forEach(function(a){if(bg(a,e)){var u="- ";e.noColor||(u=Mr[e.dashColor](u)),u=Kn.indent(r)+u,Yc(a,!1,e)?(u+=ss(a,e,0)[0],n.push(u)):(n.push(u),n.push.apply(n,ss(a,e,r+e.defaultIndentation)))}}),n}if(t instanceof Error)return ss({message:t.message,stack:t.stack.split(`
|
|
26
26
|
`)},e,r);var i=e.noAlign?0:Kn.getMaxIndexLength(t),o,s=[];return Object.getOwnPropertyNames(t).forEach(function(a){if(bg(t[a],e))if(o=a+": ",e.noColor||(o=Mr[e.keysColor](o)),o=Kn.indent(r)+o,Yc(t[a],!1,e)){var u=e.noAlign?0:i-a.length;o+=ss(t[a],e,u)[0],s.push(o)}else s.push(o),s.push.apply(s,ss(t[a],e,r+e.defaultIndentation))}),s};gu.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,ss(e,r,n).join(`
|
|
27
27
|
`)};gu.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)+`
|
|
28
|
-
`,e=e.substr(s)}try{o=JSON.parse(e)}catch{return Mr.red("Error:")+" Not valid JSON!"}return i+=gu.render(o,r,n),i}});var Cg=y(Jc=>{"use strict";Object.defineProperty(Jc,"__esModule",{value:!0});Jc.default=void 0;function as(t){"@babel/helpers - typeof";return as=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},as(t)}function HC(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,_5(n.key),n)}}function w5(t,e,r){return e&&HC(t.prototype,e),r&&HC(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function _5(t){var e=E5(t,"string");return as(e)=="symbol"?e:e+""}function E5(t,e){if(as(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(as(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function C5(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function S5(t,e,r){return e=Du(e),x5(t,Eg()?Reflect.construct(e,r||[],Du(t).constructor):e.apply(t,r))}function x5(t,e){if(e&&(as(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return F5(t)}function F5(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function O5(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&&yu(t,e)}function _g(t){var e=typeof Map=="function"?new Map:void 0;return _g=function(n){if(n===null||!k5(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 A5(n,arguments,Du(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),yu(i,n)},_g(t)}function A5(t,e,r){if(Eg())return Reflect.construct.apply(null,arguments);var n=[null];n.push.apply(n,e);var i=new(t.bind.apply(t,n));return r&&yu(i,r.prototype),i}function Eg(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Eg=function(){return!!t})()}function k5(t){try{return Function.toString.call(t).indexOf("[native code]")!==-1}catch{return typeof t=="function"}}function yu(t,e){return yu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},yu(t,e)}function Du(t){return Du=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Du(t)}var T5=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(C5(this,e),n=S5(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(),l=o.getURL(),c=s?s.getStatus():"n/a",f=s?s.getBody()||"":"n/a";r+=", originated from request (method: ".concat(u,", url: ").concat(l,", response code: ").concat(c,", response text: ").concat(f,", request id: ").concat(a,")")}return n.message=r,n}return O5(e,t),w5(e)}(_g(Error)),ole=Jc.default=T5});var Sg=y(Xc=>{"use strict";Object.defineProperty(Xc,"__esModule",{value:!0});Xc.enableDebugLog=P5;Xc.log=R5;var VC=!1;function P5(){VC=!0}function R5(t){VC&&console.log(t)}});var GC=y(Zc=>{"use strict";Object.defineProperty(Zc,"__esModule",{value:!0});Zc.default=void 0;function vu(t){"@babel/helpers - typeof";return vu=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},vu(t)}function $5(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function zC(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,j5(n.key),n)}}function I5(t,e,r){return e&&zC(t.prototype,e),r&&zC(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function j5(t){var e=N5(t,"string");return vu(e)=="symbol"?e:e+""}function N5(t,e){if(vu(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(vu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var ule=Zc.default=function(){function t(){$5(this,t)}return I5(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 WC=y((xg,Fg)=>{(function(t,e){typeof xg=="object"&&typeof Fg<"u"?Fg.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(P){var N={};return P.forEach(function(ie,oe){return N[ie]=oe}),N}(s),u=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,l=String.fromCharCode.bind(String),c=typeof Uint8Array.from=="function"?Uint8Array.from.bind(Uint8Array):function(P){return new Uint8Array(Array.prototype.slice.call(P,0))},f=function(P){return P.replace(/=/g,"").replace(/[+\/]/g,function(N){return N=="+"?"-":"_"})},h=function(P){return P.replace(/[^A-Za-z0-9\+\/]/g,"")},d=function(P){for(var N,ie,oe,ye,ln="",Wh=P.length%3,Ul=0;Ul<P.length;){if((ie=P.charCodeAt(Ul++))>255||(oe=P.charCodeAt(Ul++))>255||(ye=P.charCodeAt(Ul++))>255)throw new TypeError("invalid character found");N=ie<<16|oe<<8|ye,ln+=s[N>>18&63]+s[N>>12&63]+s[N>>6&63]+s[N&63]}return Wh?ln.slice(0,Wh-3)+"===".substring(Wh):ln},m=typeof btoa=="function"?function(P){return btoa(P)}:r?function(P){return Buffer.from(P,"binary").toString("base64")}:d,b=r?function(P){return Buffer.from(P).toString("base64")}:function(P){for(var N=4096,ie=[],oe=0,ye=P.length;oe<ye;oe+=N)ie.push(l.apply(null,P.subarray(oe,oe+N)));return m(ie.join(""))},D=function(P,N){return N===void 0&&(N=!1),N?f(b(P)):b(P)},_=function(P){if(P.length<2){var N=P.charCodeAt(0);return N<128?P:N<2048?l(192|N>>>6)+l(128|N&63):l(224|N>>>12&15)+l(128|N>>>6&63)+l(128|N&63)}else{var N=65536+(P.charCodeAt(0)-55296)*1024+(P.charCodeAt(1)-56320);return l(240|N>>>18&7)+l(128|N>>>12&63)+l(128|N>>>6&63)+l(128|N&63)}},F=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,g=function(P){return P.replace(F,_)},C=r?function(P){return Buffer.from(P,"utf8").toString("base64")}:i?function(P){return b(i.encode(P))}:function(P){return m(g(P))},A=function(P,N){return N===void 0&&(N=!1),N?f(C(P)):C(P)},T=function(P){return A(P,!0)},x=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,L=function(P){switch(P.length){case 4:var N=(7&P.charCodeAt(0))<<18|(63&P.charCodeAt(1))<<12|(63&P.charCodeAt(2))<<6|63&P.charCodeAt(3),ie=N-65536;return l((ie>>>10)+55296)+l((ie&1023)+56320);case 3:return l((15&P.charCodeAt(0))<<12|(63&P.charCodeAt(1))<<6|63&P.charCodeAt(2));default:return l((31&P.charCodeAt(0))<<6|63&P.charCodeAt(1))}},S=function(P){return P.replace(x,L)},I=function(P){if(P=P.replace(/\s+/g,""),!u.test(P))throw new TypeError("malformed base64.");P+="==".slice(2-(P.length&3));for(var N,ie="",oe,ye,ln=0;ln<P.length;)N=a[P.charAt(ln++)]<<18|a[P.charAt(ln++)]<<12|(oe=a[P.charAt(ln++)])<<6|(ye=a[P.charAt(ln++)]),ie+=oe===64?l(N>>16&255):ye===64?l(N>>16&255,N>>8&255):l(N>>16&255,N>>8&255,N&255);return ie},$=typeof atob=="function"?function(P){return atob(h(P))}:r?function(P){return Buffer.from(P,"base64").toString("binary")}:I,B=r?function(P){return c(Buffer.from(P,"base64"))}:function(P){return c($(P).split("").map(function(N){return N.charCodeAt(0)}))},q=function(P){return B(V(P))},K=r?function(P){return Buffer.from(P,"base64").toString("utf8")}:n?function(P){return n.decode(B(P))}:function(P){return S($(P))},V=function(P){return h(P.replace(/[-_]/g,function(N){return N=="-"?"+":"/"}))},E=function(P){return K(V(P))},v=function(P){if(typeof P!="string")return!1;var N=P.replace(/\s+/g,"").replace(/={0,2}$/,"");return!/[^\s0-9a-zA-Z\+/]/.test(N)||!/[^\s0-9a-zA-Z\-_]/.test(N)},w=function(P){return{value:P,enumerable:!1,writable:!0,configurable:!0}},O=function(){var P=function(N,ie){return Object.defineProperty(String.prototype,N,w(ie))};P("fromBase64",function(){return E(this)}),P("toBase64",function(N){return A(this,N)}),P("toBase64URI",function(){return A(this,!0)}),P("toBase64URL",function(){return A(this,!0)}),P("toUint8Array",function(){return q(this)})},j=function(){var P=function(N,ie){return Object.defineProperty(Uint8Array.prototype,N,w(ie))};P("toBase64",function(N){return D(this,N)}),P("toBase64URI",function(){return D(this,!0)}),P("toBase64URL",function(){return D(this,!0)})},R=function(){O(),j()},M={version:t,VERSION:e,atob:$,atobPolyfill:I,btoa:m,btoaPolyfill:d,fromBase64:E,toBase64:A,encode:A,encodeURI:T,encodeURL:T,utob:g,btou:S,decode:E,isValid:v,fromUint8Array:D,toUint8Array:q,extendString:O,extendUint8Array:j,extendBuiltins:R};return M.Base64={},Object.keys(M).forEach(function(P){return M.Base64[P]=M[P]}),M})});var YC=y((cle,KC)=>{"use strict";KC.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 ZC=y(Og=>{"use strict";var L5=Object.prototype.hasOwnProperty,B5;function JC(t){try{return decodeURIComponent(t.replace(/\+/g," "))}catch{return null}}function XC(t){try{return encodeURIComponent(t)}catch{return null}}function q5(t){for(var e=/([^=?#&]+)=?([^&]*)/g,r={},n;n=e.exec(t);){var i=JC(n[1]),o=JC(n[2]);i===null||o===null||i in r||(r[i]=o)}return r}function M5(t,e){e=e||"";var r=[],n,i;typeof e!="string"&&(e="?");for(i in t)if(L5.call(t,i)){if(n=t[i],!n&&(n===null||n===B5||isNaN(n))&&(n=""),i=XC(i),n=XC(n),i===null||n===null)continue;r.push(i+"="+n)}return r.length?e+r.join("&"):""}Og.stringify=M5;Og.parse=q5});var sS=y((dle,oS)=>{"use strict";var eS=YC(),Qc=ZC(),U5=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,tS=/[\n\r\t]/g,H5=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,rS=/:\d+$/,V5=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i,z5=/^[a-zA-Z]:/;function kg(t){return(t||"").toString().replace(U5,"")}var Ag=[["#","hash"],["?","query"],function(e,r){return Ur(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]],QC={hash:1,query:1};function nS(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 Hr(unescape(t.pathname),{});else if(i==="string"){n=new Hr(t,{});for(o in QC)delete n[o]}else if(i==="object"){for(o in t)o in QC||(n[o]=t[o]);n.slashes===void 0&&(n.slashes=H5.test(t.href))}return n}function Ur(t){return t==="file:"||t==="ftp:"||t==="http:"||t==="https:"||t==="ws:"||t==="wss:"}function iS(t,e){t=kg(t),t=t.replace(tS,""),e=e||{};var r=V5.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)):Ur(n)?a=r[4]:n?i&&(a=a.slice(2)):s>=2&&Ur(e.protocol)&&(a=r[4]),{protocol:n,slashes:i||Ur(n),slashesCount:s,rest:a}}function G5(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 Hr(t,e,r){if(t=kg(t),t=t.replace(tS,""),!(this instanceof Hr))return new Hr(t,e,r);var n,i,o,s,a,u,l=Ag.slice(),c=typeof e,f=this,h=0;for(c!=="object"&&c!=="string"&&(r=e,e=null),r&&typeof r!="function"&&(r=Qc.parse),e=nS(e),i=iS(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||z5.test(t))||!i.slashes&&(i.protocol||i.slashesCount<2||!Ur(f.protocol)))&&(l[3]=[/(.*)/,"pathname"]);h<l.length;h++){if(s=l[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=G5(f.pathname,e.pathname)),f.pathname.charAt(0)!=="/"&&Ur(f.protocol)&&(f.pathname="/"+f.pathname),eS(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:"&&Ur(f.protocol)&&f.host?f.protocol+"//"+f.host:"null",f.href=f.toString()}function W5(t,e,r){var n=this;switch(t){case"query":typeof e=="string"&&e.length&&(e=(r||Qc.parse)(e)),n[t]=e;break;case"port":n[t]=e,eS(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,rS.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<Ag.length;s++){var a=Ag[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:"&&Ur(n.protocol)&&n.host?n.protocol+"//"+n.host:"null",n.href=n.toString(),n}function K5(t){(!t||typeof t!="function")&&(t=Qc.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||Ur(r.protocol)?"//":"");return r.username?(o+=r.username,r.password&&(o+=":"+r.password),o+="@"):r.password?(o+=":"+r.password,o+="@"):r.protocol!=="file:"&&Ur(r.protocol)&&!n&&r.pathname!=="/"&&(o+="@"),(n[n.length-1]===":"||rS.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}Hr.prototype={set:W5,toString:K5};Hr.extractProtocol=iS;Hr.location=nS;Hr.trimLeft=kg;Hr.qs=Qc;oS.exports=Hr});var aS=y(Tg=>{"use strict";Object.defineProperty(Tg,"__esModule",{value:!0});Tg.default=Y5;function Y5(){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 _S=y(nf=>{"use strict";Object.defineProperty(nf,"__esModule",{value:!0});nf.default=void 0;var J5=WC(),X5=$g(sS()),ef=$g(Cg()),Ti=Sg(),Z5=$g(aS());function $g(t){return t&&t.__esModule?t:{default:t}}function Pg(){"use strict";Pg=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(E,v,w){E[v]=w.value},o=typeof Symbol=="function"?Symbol:{},s=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function l(E,v,w){return Object.defineProperty(E,v,{value:w,enumerable:!0,configurable:!0,writable:!0}),E[v]}try{l({},"")}catch{l=function(w,O,j){return w[O]=j}}function c(E,v,w,O){var j=v&&v.prototype instanceof _?v:_,R=Object.create(j.prototype),M=new K(O||[]);return i(R,"_invoke",{value:I(E,w,M)}),R}function f(E,v,w){try{return{type:"normal",arg:E.call(v,w)}}catch(O){return{type:"throw",arg:O}}}e.wrap=c;var h="suspendedStart",d="suspendedYield",m="executing",b="completed",D={};function _(){}function F(){}function g(){}var C={};l(C,s,function(){return this});var A=Object.getPrototypeOf,T=A&&A(A(V([])));T&&T!==r&&n.call(T,s)&&(C=T);var x=g.prototype=_.prototype=Object.create(C);function L(E){["next","throw","return"].forEach(function(v){l(E,v,function(w){return this._invoke(v,w)})})}function S(E,v){function w(j,R,M,P){var N=f(E[j],E,R);if(N.type!=="throw"){var ie=N.arg,oe=ie.value;return oe&&Pi(oe)=="object"&&n.call(oe,"__await")?v.resolve(oe.__await).then(function(ye){w("next",ye,M,P)},function(ye){w("throw",ye,M,P)}):v.resolve(oe).then(function(ye){ie.value=ye,M(ie)},function(ye){return w("throw",ye,M,P)})}P(N.arg)}var O;i(this,"_invoke",{value:function(R,M){function P(){return new v(function(N,ie){w(R,M,N,ie)})}return O=O?O.then(P,P):P()}})}function I(E,v,w){var O=h;return function(j,R){if(O===m)throw Error("Generator is already running");if(O===b){if(j==="throw")throw R;return{value:t,done:!0}}for(w.method=j,w.arg=R;;){var M=w.delegate;if(M){var P=$(M,w);if(P){if(P===D)continue;return P}}if(w.method==="next")w.sent=w._sent=w.arg;else if(w.method==="throw"){if(O===h)throw O=b,w.arg;w.dispatchException(w.arg)}else w.method==="return"&&w.abrupt("return",w.arg);O=m;var N=f(E,v,w);if(N.type==="normal"){if(O=w.done?b:d,N.arg===D)continue;return{value:N.arg,done:w.done}}N.type==="throw"&&(O=b,w.method="throw",w.arg=N.arg)}}}function $(E,v){var w=v.method,O=E.iterator[w];if(O===t)return v.delegate=null,w==="throw"&&E.iterator.return&&(v.method="return",v.arg=t,$(E,v),v.method==="throw")||w!=="return"&&(v.method="throw",v.arg=new TypeError("The iterator does not provide a '"+w+"' method")),D;var j=f(O,E.iterator,v.arg);if(j.type==="throw")return v.method="throw",v.arg=j.arg,v.delegate=null,D;var R=j.arg;return R?R.done?(v[E.resultName]=R.value,v.next=E.nextLoc,v.method!=="return"&&(v.method="next",v.arg=t),v.delegate=null,D):R:(v.method="throw",v.arg=new TypeError("iterator result is not an object"),v.delegate=null,D)}function B(E){var v={tryLoc:E[0]};1 in E&&(v.catchLoc=E[1]),2 in E&&(v.finallyLoc=E[2],v.afterLoc=E[3]),this.tryEntries.push(v)}function q(E){var v=E.completion||{};v.type="normal",delete v.arg,E.completion=v}function K(E){this.tryEntries=[{tryLoc:"root"}],E.forEach(B,this),this.reset(!0)}function V(E){if(E||E===""){var v=E[s];if(v)return v.call(E);if(typeof E.next=="function")return E;if(!isNaN(E.length)){var w=-1,O=function j(){for(;++w<E.length;)if(n.call(E,w))return j.value=E[w],j.done=!1,j;return j.value=t,j.done=!0,j};return O.next=O}}throw new TypeError(Pi(E)+" is not iterable")}return F.prototype=g,i(x,"constructor",{value:g,configurable:!0}),i(g,"constructor",{value:F,configurable:!0}),F.displayName=l(g,u,"GeneratorFunction"),e.isGeneratorFunction=function(E){var v=typeof E=="function"&&E.constructor;return!!v&&(v===F||(v.displayName||v.name)==="GeneratorFunction")},e.mark=function(E){return Object.setPrototypeOf?Object.setPrototypeOf(E,g):(E.__proto__=g,l(E,u,"GeneratorFunction")),E.prototype=Object.create(x),E},e.awrap=function(E){return{__await:E}},L(S.prototype),l(S.prototype,a,function(){return this}),e.AsyncIterator=S,e.async=function(E,v,w,O,j){j===void 0&&(j=Promise);var R=new S(c(E,v,w,O),j);return e.isGeneratorFunction(v)?R:R.next().then(function(M){return M.done?M.value:R.next()})},L(x),l(x,u,"Generator"),l(x,s,function(){return this}),l(x,"toString",function(){return"[object Generator]"}),e.keys=function(E){var v=Object(E),w=[];for(var O in v)w.push(O);return w.reverse(),function j(){for(;w.length;){var R=w.pop();if(R in v)return j.value=R,j.done=!1,j}return j.done=!0,j}},e.values=V,K.prototype={constructor:K,reset:function(v){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),!v)for(var w in this)w.charAt(0)==="t"&&n.call(this,w)&&!isNaN(+w.slice(1))&&(this[w]=t)},stop:function(){this.done=!0;var v=this.tryEntries[0].completion;if(v.type==="throw")throw v.arg;return this.rval},dispatchException:function(v){if(this.done)throw v;var w=this;function O(ie,oe){return M.type="throw",M.arg=v,w.next=ie,oe&&(w.method="next",w.arg=t),!!oe}for(var j=this.tryEntries.length-1;j>=0;--j){var R=this.tryEntries[j],M=R.completion;if(R.tryLoc==="root")return O("end");if(R.tryLoc<=this.prev){var P=n.call(R,"catchLoc"),N=n.call(R,"finallyLoc");if(P&&N){if(this.prev<R.catchLoc)return O(R.catchLoc,!0);if(this.prev<R.finallyLoc)return O(R.finallyLoc)}else if(P){if(this.prev<R.catchLoc)return O(R.catchLoc,!0)}else{if(!N)throw Error("try statement without catch or finally");if(this.prev<R.finallyLoc)return O(R.finallyLoc)}}}},abrupt:function(v,w){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 R=j;break}}R&&(v==="break"||v==="continue")&&R.tryLoc<=w&&w<=R.finallyLoc&&(R=null);var M=R?R.completion:{};return M.type=v,M.arg=w,R?(this.method="next",this.next=R.finallyLoc,D):this.complete(M)},complete:function(v,w){if(v.type==="throw")throw v.arg;return v.type==="break"||v.type==="continue"?this.next=v.arg:v.type==="return"?(this.rval=this.arg=v.arg,this.method="return",this.next="end"):v.type==="normal"&&w&&(this.next=w),D},finish:function(v){for(var w=this.tryEntries.length-1;w>=0;--w){var O=this.tryEntries[w];if(O.finallyLoc===v)return this.complete(O.completion,O.afterLoc),q(O),D}},catch:function(v){for(var w=this.tryEntries.length-1;w>=0;--w){var O=this.tryEntries[w];if(O.tryLoc===v){var j=O.completion;if(j.type==="throw"){var R=j.arg;q(O)}return R}}throw Error("illegal catch attempt")},delegateYield:function(v,w,O){return this.delegate={iterator:V(v),resultName:w,nextLoc:O},this.method==="next"&&(this.arg=t),D}},e}function uS(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(l){r(l);return}a.done?e(u):Promise.resolve(u).then(n,i)}function Q5(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function s(u){uS(o,n,i,s,a,"next",u)}function a(u){uS(o,n,i,s,a,"throw",u)}s(void 0)})}}function yS(t,e){return rU(t)||tU(t,e)||DS(t,e)||eU()}function eU(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
29
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function
|
|
30
|
-
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 l=r.next();return o=l.done,l},e:function(l){s=!0,a=l},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(s)throw a}}}}function DS(t,e){if(t){if(typeof t=="string")return lS(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 lS(t,e)}}function lS(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 cS(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 us(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?cS(Object(r),!0).forEach(function(n){iU(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):cS(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function iU(t,e,r){return e=vS(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function oU(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,vS(n.key),n)}}function sU(t,e,r){return e&&fS(t.prototype,e),r&&fS(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function vS(t){var e=aU(t,"string");return Pi(e)=="symbol"?e:e+""}function aU(t,e){if(Pi(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Pi(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var tf="tus-v1",rf="ietf-draft-03",bu="ietf-draft-05",uU={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:wS,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:tf},bS=function(){function t(e,r){oU(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 sU(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(![tf,rf,bu].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,Ti.log)("No fingerprint was calculated meaning that the upload cannot be stored in the URL storage."):(0,Ti.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:cU(this._source.size,s);this._parallelUploadUrls&&a.forEach(function(c,f){c.uploadUrl=n._parallelUploadUrls[f]||null}),this._parallelUploadUrls=new Array(a.length);var u=a.map(function(c,f){var h=0;return n._source.slice(c.start,c.end).then(function(d){var m=d.value;return new Promise(function(b,D){var _=us(us({},n.options),{},{uploadUrl:c.uploadUrl||null,storeFingerprintForResuming:!1,removeFingerprintOnSuccess:!1,parallelUploads:1,parallelUploadBoundaries:null,metadata:n.options.metadataForPartialUploads,headers:us(us({},n.options.headers),{},{"Upload-Concat":"partial"}),onSuccess:b,onError:D,onProgress:function(C){o=o-h+C,h=C,n._emitProgress(o,i)},onUploadUrlAvailable:function(){n._parallelUploadUrls[f]=F.url,n._parallelUploadUrls.filter(function(C){return!!C}).length===a.length&&n._saveUploadInUrlStorage()}}),F=new t(m,_);F.start(),n._parallelUploads.push(F)})})}),l;Promise.all(u).then(function(){l=n._openRequest("POST",n.options.endpoint),l.setHeader("Upload-Concat","final;".concat(n._parallelUploadUrls.join(" ")));var c=dS(n.options.metadata);return c!==""&&l.setHeader("Upload-Metadata",c),n._sendRequest(l,null)}).then(function(c){if(!ls(c.getStatus(),200)){n._emitHttpError(l,c,"tus: unexpected response while creating upload");return}var f=c.getHeader("Location");if(f==null){n._emitHttpError(l,c,"tus: invalid or missing Location header");return}n.url=gS(n.options.endpoint,f),(0,Ti.log)("Created upload at ".concat(n.url)),n._emitSuccess(c)}).catch(function(c){n._emitError(c)})}},{key:"_startSingleUpload",value:function(){if(this._aborted=!1,this.url!=null){(0,Ti.log)("Resuming upload from previous URL: ".concat(this.url)),this._resumeUpload();return}if(this.options.uploadUrl!=null){(0,Ti.log)("Resuming upload from provided URL: ".concat(this.options.uploadUrl)),this.url=this.options.uploadUrl,this._resumeUpload();return}(0,Ti.log)("Creating a new upload"),this._createUpload()}},{key:"abort",value:function(r){var n=this;if(this._parallelUploads!=null){var i=nU(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 ef.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),mS(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=dS(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===rf||this.options.protocol===bu)&&n.setHeader("Upload-Complete","?0"),o=this._sendRequest(n,null)),o.then(function(s){if(!ls(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=gS(r.options.endpoint,a),(0,Ti.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(!ls(s,200)){if(s===423){r._emitHttpError(n,o,"tus: upload is currently locked; retry later");return}if(ls(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===tf){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(!ls(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)}),this.options.protocol===tf?r.setHeader("Content-Type","application/offset+octet-stream"):this.options.protocol===bu&&r.setHeader("Content-Type","application/partial-upload"),(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,l=a!=null&&a.size?a.size:0;n.options.uploadLengthDeferred&&u&&(n._size=n._offset+l,r.setHeader("Upload-Length","".concat(n._size)));var c=n._offset+l;return!n.options.uploadLengthDeferred&&u&&c!==n._size?Promise.reject(new Error("upload was configured with a size of ".concat(n._size," bytes, but the source is done after ").concat(c," bytes"))):a===null?n._sendRequest(r):((n.options.protocol===rf||n.options.protocol===bu)&&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=hS(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 pS(r,n,this.options)}}],[{key:"terminate",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=hS("DELETE",r,n);return pS(i,null,n).then(function(o){if(o.getStatus()!==204)throw new ef.default("tus: unexpected response while terminating upload",null,i,o)}).catch(function(o){if(o instanceof ef.default||(o=new ef.default("tus: failed to terminate upload",o,i,null)),!mS(o,0,n))throw o;var s=n.retryDelays[0],a=n.retryDelays.slice(1),u=us(us({},n),{},{retryDelays:a});return new Promise(function(l){return setTimeout(l,s)}).then(function(){return t.terminate(r,u)})})}}])}();function dS(t){return Object.entries(t).map(function(e){var r=yS(e,2),n=r[0],i=r[1];return"".concat(n," ").concat(J5.Base64.encode(String(i)))}).join(",")}function ls(t,e){return t>=e&&t<e+100}function hS(t,e,r){var n=r.httpStack.createRequest(t,e);r.protocol===rf?n.setHeader("Upload-Draft-Interop-Version","5"):r.protocol===bu?n.setHeader("Upload-Draft-Interop-Version","6"):n.setHeader("Tus-Resumable","1.0.0");for(var i=r.headers||{},o=0,s=Object.entries(i);o<s.length;o++){var a=yS(s[o],2),u=a[0],l=a[1];n.setHeader(u,l)}if(r.addRequestId){var c=(0,Z5.default)();n.setHeader("X-Request-ID",c)}return n}function pS(t,e,r){return Rg.apply(this,arguments)}function Rg(){return Rg=Q5(Pg().mark(function t(e,r,n){var i;return Pg().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)})),Rg.apply(this,arguments)}function lU(){var t=!0;return typeof navigator<"u"&&navigator.onLine===!1&&(t=!1),t}function mS(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):wS(t)}function wS(t){var e=t.originalResponse?t.originalResponse.getStatus():0;return(!ls(e,400)||e===409||e===423)&&lU()}function gS(t,e){return new X5.default(e,t).toString()}function cU(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}bS.defaultOptions=uU;var ple=nf.default=bS});var CS=y((gle,ES)=>{"use strict";var Vr=t=>t!==null&&typeof t=="object"&&typeof t.pipe=="function";Vr.writable=t=>Vr(t)&&t.writable!==!1&&typeof t._write=="function"&&typeof t._writableState=="object";Vr.readable=t=>Vr(t)&&t.readable!==!1&&typeof t._read=="function"&&typeof t._readableState=="object";Vr.duplex=t=>Vr.writable(t)&&Vr.readable(t);Vr.transform=t=>Vr.duplex(t)&&typeof t._transform=="function";ES.exports=Vr});var xS=y(of=>{"use strict";Object.defineProperty(of,"__esModule",{value:!0});of.default=void 0;function wu(t){"@babel/helpers - typeof";return wu=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},wu(t)}function fU(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}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,hU(n.key),n)}}function dU(t,e,r){return e&&SS(t.prototype,e),r&&SS(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function hU(t){var e=pU(t,"string");return wu(e)=="symbol"?e:e+""}function pU(t,e){if(wu(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(wu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var yle=of.default=function(){function t(e){fU(this,t),this._buffer=e,this.size=e.length}return dU(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 kS=y(Ng=>{"use strict";Object.defineProperty(Ng,"__esModule",{value:!0});Ng.default=bU;var AS=require("fs");function Ri(t){"@babel/helpers - typeof";return Ri=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},Ri(t)}function Ig(){"use strict";Ig=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(E,v,w){E[v]=w.value},o=typeof Symbol=="function"?Symbol:{},s=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function l(E,v,w){return Object.defineProperty(E,v,{value:w,enumerable:!0,configurable:!0,writable:!0}),E[v]}try{l({},"")}catch{l=function(w,O,j){return w[O]=j}}function c(E,v,w,O){var j=v&&v.prototype instanceof _?v:_,R=Object.create(j.prototype),M=new K(O||[]);return i(R,"_invoke",{value:I(E,w,M)}),R}function f(E,v,w){try{return{type:"normal",arg:E.call(v,w)}}catch(O){return{type:"throw",arg:O}}}e.wrap=c;var h="suspendedStart",d="suspendedYield",m="executing",b="completed",D={};function _(){}function F(){}function g(){}var C={};l(C,s,function(){return this});var A=Object.getPrototypeOf,T=A&&A(A(V([])));T&&T!==r&&n.call(T,s)&&(C=T);var x=g.prototype=_.prototype=Object.create(C);function L(E){["next","throw","return"].forEach(function(v){l(E,v,function(w){return this._invoke(v,w)})})}function S(E,v){function w(j,R,M,P){var N=f(E[j],E,R);if(N.type!=="throw"){var ie=N.arg,oe=ie.value;return oe&&Ri(oe)=="object"&&n.call(oe,"__await")?v.resolve(oe.__await).then(function(ye){w("next",ye,M,P)},function(ye){w("throw",ye,M,P)}):v.resolve(oe).then(function(ye){ie.value=ye,M(ie)},function(ye){return w("throw",ye,M,P)})}P(N.arg)}var O;i(this,"_invoke",{value:function(R,M){function P(){return new v(function(N,ie){w(R,M,N,ie)})}return O=O?O.then(P,P):P()}})}function I(E,v,w){var O=h;return function(j,R){if(O===m)throw Error("Generator is already running");if(O===b){if(j==="throw")throw R;return{value:t,done:!0}}for(w.method=j,w.arg=R;;){var M=w.delegate;if(M){var P=$(M,w);if(P){if(P===D)continue;return P}}if(w.method==="next")w.sent=w._sent=w.arg;else if(w.method==="throw"){if(O===h)throw O=b,w.arg;w.dispatchException(w.arg)}else w.method==="return"&&w.abrupt("return",w.arg);O=m;var N=f(E,v,w);if(N.type==="normal"){if(O=w.done?b:d,N.arg===D)continue;return{value:N.arg,done:w.done}}N.type==="throw"&&(O=b,w.method="throw",w.arg=N.arg)}}}function $(E,v){var w=v.method,O=E.iterator[w];if(O===t)return v.delegate=null,w==="throw"&&E.iterator.return&&(v.method="return",v.arg=t,$(E,v),v.method==="throw")||w!=="return"&&(v.method="throw",v.arg=new TypeError("The iterator does not provide a '"+w+"' method")),D;var j=f(O,E.iterator,v.arg);if(j.type==="throw")return v.method="throw",v.arg=j.arg,v.delegate=null,D;var R=j.arg;return R?R.done?(v[E.resultName]=R.value,v.next=E.nextLoc,v.method!=="return"&&(v.method="next",v.arg=t),v.delegate=null,D):R:(v.method="throw",v.arg=new TypeError("iterator result is not an object"),v.delegate=null,D)}function B(E){var v={tryLoc:E[0]};1 in E&&(v.catchLoc=E[1]),2 in E&&(v.finallyLoc=E[2],v.afterLoc=E[3]),this.tryEntries.push(v)}function q(E){var v=E.completion||{};v.type="normal",delete v.arg,E.completion=v}function K(E){this.tryEntries=[{tryLoc:"root"}],E.forEach(B,this),this.reset(!0)}function V(E){if(E||E===""){var v=E[s];if(v)return v.call(E);if(typeof E.next=="function")return E;if(!isNaN(E.length)){var w=-1,O=function j(){for(;++w<E.length;)if(n.call(E,w))return j.value=E[w],j.done=!1,j;return j.value=t,j.done=!0,j};return O.next=O}}throw new TypeError(Ri(E)+" is not iterable")}return F.prototype=g,i(x,"constructor",{value:g,configurable:!0}),i(g,"constructor",{value:F,configurable:!0}),F.displayName=l(g,u,"GeneratorFunction"),e.isGeneratorFunction=function(E){var v=typeof E=="function"&&E.constructor;return!!v&&(v===F||(v.displayName||v.name)==="GeneratorFunction")},e.mark=function(E){return Object.setPrototypeOf?Object.setPrototypeOf(E,g):(E.__proto__=g,l(E,u,"GeneratorFunction")),E.prototype=Object.create(x),E},e.awrap=function(E){return{__await:E}},L(S.prototype),l(S.prototype,a,function(){return this}),e.AsyncIterator=S,e.async=function(E,v,w,O,j){j===void 0&&(j=Promise);var R=new S(c(E,v,w,O),j);return e.isGeneratorFunction(v)?R:R.next().then(function(M){return M.done?M.value:R.next()})},L(x),l(x,u,"Generator"),l(x,s,function(){return this}),l(x,"toString",function(){return"[object Generator]"}),e.keys=function(E){var v=Object(E),w=[];for(var O in v)w.push(O);return w.reverse(),function j(){for(;w.length;){var R=w.pop();if(R in v)return j.value=R,j.done=!1,j}return j.done=!0,j}},e.values=V,K.prototype={constructor:K,reset:function(v){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),!v)for(var w in this)w.charAt(0)==="t"&&n.call(this,w)&&!isNaN(+w.slice(1))&&(this[w]=t)},stop:function(){this.done=!0;var v=this.tryEntries[0].completion;if(v.type==="throw")throw v.arg;return this.rval},dispatchException:function(v){if(this.done)throw v;var w=this;function O(ie,oe){return M.type="throw",M.arg=v,w.next=ie,oe&&(w.method="next",w.arg=t),!!oe}for(var j=this.tryEntries.length-1;j>=0;--j){var R=this.tryEntries[j],M=R.completion;if(R.tryLoc==="root")return O("end");if(R.tryLoc<=this.prev){var P=n.call(R,"catchLoc"),N=n.call(R,"finallyLoc");if(P&&N){if(this.prev<R.catchLoc)return O(R.catchLoc,!0);if(this.prev<R.finallyLoc)return O(R.finallyLoc)}else if(P){if(this.prev<R.catchLoc)return O(R.catchLoc,!0)}else{if(!N)throw Error("try statement without catch or finally");if(this.prev<R.finallyLoc)return O(R.finallyLoc)}}}},abrupt:function(v,w){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 R=j;break}}R&&(v==="break"||v==="continue")&&R.tryLoc<=w&&w<=R.finallyLoc&&(R=null);var M=R?R.completion:{};return M.type=v,M.arg=w,R?(this.method="next",this.next=R.finallyLoc,D):this.complete(M)},complete:function(v,w){if(v.type==="throw")throw v.arg;return v.type==="break"||v.type==="continue"?this.next=v.arg:v.type==="return"?(this.rval=this.arg=v.arg,this.method="return",this.next="end"):v.type==="normal"&&w&&(this.next=w),D},finish:function(v){for(var w=this.tryEntries.length-1;w>=0;--w){var O=this.tryEntries[w];if(O.finallyLoc===v)return this.complete(O.completion,O.afterLoc),q(O),D}},catch:function(v){for(var w=this.tryEntries.length-1;w>=0;--w){var O=this.tryEntries[w];if(O.tryLoc===v){var j=O.completion;if(j.type==="throw"){var R=j.arg;q(O)}return R}}throw Error("illegal catch attempt")},delegateYield:function(v,w,O){return this.delegate={iterator:V(v),resultName:w,nextLoc:O},this.method==="next"&&(this.arg=t),D}},e}function mU(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,yU(n.key),n)}}function gU(t,e,r){return e&&FS(t.prototype,e),r&&FS(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function yU(t){var e=DU(t,"string");return Ri(e)=="symbol"?e:e+""}function DU(t,e){if(Ri(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Ri(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function OS(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(l){r(l);return}a.done?e(u):Promise.resolve(u).then(n,i)}function vU(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function s(u){OS(o,n,i,s,a,"next",u)}function a(u){OS(o,n,i,s,a,"throw",u)}s(void 0)})}}function bU(t){return jg.apply(this,arguments)}function jg(){return jg=vU(Ig().mark(function t(e){var r,n,i,o,s,a,u;return Ig().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return n=e.path.toString(),c.next=3,AS.promises.stat(n);case 3:return i=c.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,c.abrupt("return",new wU(e,n,u));case 9:case"end":return c.stop()}},t)})),jg.apply(this,arguments)}var wU=function(){function t(e,r,n){mU(this,t),this._stream=e,this._path=r,this.size=n}return gU(t,[{key:"slice",value:function(r,n){var i,o=(i=this._stream.start)!==null&&i!==void 0?i:0,s=(0,AS.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 Bg=y(sf=>{"use strict";Object.defineProperty(sf,"__esModule",{value:!0});sf.default=void 0;function $i(t){"@babel/helpers - typeof";return $i=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},$i(t)}function _u(){"use strict";_u=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(E,v,w){E[v]=w.value},o=typeof Symbol=="function"?Symbol:{},s=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function l(E,v,w){return Object.defineProperty(E,v,{value:w,enumerable:!0,configurable:!0,writable:!0}),E[v]}try{l({},"")}catch{l=function(w,O,j){return w[O]=j}}function c(E,v,w,O){var j=v&&v.prototype instanceof _?v:_,R=Object.create(j.prototype),M=new K(O||[]);return i(R,"_invoke",{value:I(E,w,M)}),R}function f(E,v,w){try{return{type:"normal",arg:E.call(v,w)}}catch(O){return{type:"throw",arg:O}}}e.wrap=c;var h="suspendedStart",d="suspendedYield",m="executing",b="completed",D={};function _(){}function F(){}function g(){}var C={};l(C,s,function(){return this});var A=Object.getPrototypeOf,T=A&&A(A(V([])));T&&T!==r&&n.call(T,s)&&(C=T);var x=g.prototype=_.prototype=Object.create(C);function L(E){["next","throw","return"].forEach(function(v){l(E,v,function(w){return this._invoke(v,w)})})}function S(E,v){function w(j,R,M,P){var N=f(E[j],E,R);if(N.type!=="throw"){var ie=N.arg,oe=ie.value;return oe&&$i(oe)=="object"&&n.call(oe,"__await")?v.resolve(oe.__await).then(function(ye){w("next",ye,M,P)},function(ye){w("throw",ye,M,P)}):v.resolve(oe).then(function(ye){ie.value=ye,M(ie)},function(ye){return w("throw",ye,M,P)})}P(N.arg)}var O;i(this,"_invoke",{value:function(R,M){function P(){return new v(function(N,ie){w(R,M,N,ie)})}return O=O?O.then(P,P):P()}})}function I(E,v,w){var O=h;return function(j,R){if(O===m)throw Error("Generator is already running");if(O===b){if(j==="throw")throw R;return{value:t,done:!0}}for(w.method=j,w.arg=R;;){var M=w.delegate;if(M){var P=$(M,w);if(P){if(P===D)continue;return P}}if(w.method==="next")w.sent=w._sent=w.arg;else if(w.method==="throw"){if(O===h)throw O=b,w.arg;w.dispatchException(w.arg)}else w.method==="return"&&w.abrupt("return",w.arg);O=m;var N=f(E,v,w);if(N.type==="normal"){if(O=w.done?b:d,N.arg===D)continue;return{value:N.arg,done:w.done}}N.type==="throw"&&(O=b,w.method="throw",w.arg=N.arg)}}}function $(E,v){var w=v.method,O=E.iterator[w];if(O===t)return v.delegate=null,w==="throw"&&E.iterator.return&&(v.method="return",v.arg=t,$(E,v),v.method==="throw")||w!=="return"&&(v.method="throw",v.arg=new TypeError("The iterator does not provide a '"+w+"' method")),D;var j=f(O,E.iterator,v.arg);if(j.type==="throw")return v.method="throw",v.arg=j.arg,v.delegate=null,D;var R=j.arg;return R?R.done?(v[E.resultName]=R.value,v.next=E.nextLoc,v.method!=="return"&&(v.method="next",v.arg=t),v.delegate=null,D):R:(v.method="throw",v.arg=new TypeError("iterator result is not an object"),v.delegate=null,D)}function B(E){var v={tryLoc:E[0]};1 in E&&(v.catchLoc=E[1]),2 in E&&(v.finallyLoc=E[2],v.afterLoc=E[3]),this.tryEntries.push(v)}function q(E){var v=E.completion||{};v.type="normal",delete v.arg,E.completion=v}function K(E){this.tryEntries=[{tryLoc:"root"}],E.forEach(B,this),this.reset(!0)}function V(E){if(E||E===""){var v=E[s];if(v)return v.call(E);if(typeof E.next=="function")return E;if(!isNaN(E.length)){var w=-1,O=function j(){for(;++w<E.length;)if(n.call(E,w))return j.value=E[w],j.done=!1,j;return j.value=t,j.done=!0,j};return O.next=O}}throw new TypeError($i(E)+" is not iterable")}return F.prototype=g,i(x,"constructor",{value:g,configurable:!0}),i(g,"constructor",{value:F,configurable:!0}),F.displayName=l(g,u,"GeneratorFunction"),e.isGeneratorFunction=function(E){var v=typeof E=="function"&&E.constructor;return!!v&&(v===F||(v.displayName||v.name)==="GeneratorFunction")},e.mark=function(E){return Object.setPrototypeOf?Object.setPrototypeOf(E,g):(E.__proto__=g,l(E,u,"GeneratorFunction")),E.prototype=Object.create(x),E},e.awrap=function(E){return{__await:E}},L(S.prototype),l(S.prototype,a,function(){return this}),e.AsyncIterator=S,e.async=function(E,v,w,O,j){j===void 0&&(j=Promise);var R=new S(c(E,v,w,O),j);return e.isGeneratorFunction(v)?R:R.next().then(function(M){return M.done?M.value:R.next()})},L(x),l(x,u,"Generator"),l(x,s,function(){return this}),l(x,"toString",function(){return"[object Generator]"}),e.keys=function(E){var v=Object(E),w=[];for(var O in v)w.push(O);return w.reverse(),function j(){for(;w.length;){var R=w.pop();if(R in v)return j.value=R,j.done=!1,j}return j.done=!0,j}},e.values=V,K.prototype={constructor:K,reset:function(v){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),!v)for(var w in this)w.charAt(0)==="t"&&n.call(this,w)&&!isNaN(+w.slice(1))&&(this[w]=t)},stop:function(){this.done=!0;var v=this.tryEntries[0].completion;if(v.type==="throw")throw v.arg;return this.rval},dispatchException:function(v){if(this.done)throw v;var w=this;function O(ie,oe){return M.type="throw",M.arg=v,w.next=ie,oe&&(w.method="next",w.arg=t),!!oe}for(var j=this.tryEntries.length-1;j>=0;--j){var R=this.tryEntries[j],M=R.completion;if(R.tryLoc==="root")return O("end");if(R.tryLoc<=this.prev){var P=n.call(R,"catchLoc"),N=n.call(R,"finallyLoc");if(P&&N){if(this.prev<R.catchLoc)return O(R.catchLoc,!0);if(this.prev<R.finallyLoc)return O(R.finallyLoc)}else if(P){if(this.prev<R.catchLoc)return O(R.catchLoc,!0)}else{if(!N)throw Error("try statement without catch or finally");if(this.prev<R.finallyLoc)return O(R.finallyLoc)}}}},abrupt:function(v,w){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 R=j;break}}R&&(v==="break"||v==="continue")&&R.tryLoc<=w&&w<=R.finallyLoc&&(R=null);var M=R?R.completion:{};return M.type=v,M.arg=w,R?(this.method="next",this.next=R.finallyLoc,D):this.complete(M)},complete:function(v,w){if(v.type==="throw")throw v.arg;return v.type==="break"||v.type==="continue"?this.next=v.arg:v.type==="return"?(this.rval=this.arg=v.arg,this.method="return",this.next="end"):v.type==="normal"&&w&&(this.next=w),D},finish:function(v){for(var w=this.tryEntries.length-1;w>=0;--w){var O=this.tryEntries[w];if(O.finallyLoc===v)return this.complete(O.completion,O.afterLoc),q(O),D}},catch:function(v){for(var w=this.tryEntries.length-1;w>=0;--w){var O=this.tryEntries[w];if(O.tryLoc===v){var j=O.completion;if(j.type==="throw"){var R=j.arg;q(O)}return R}}throw Error("illegal catch attempt")},delegateYield:function(v,w,O){return this.delegate={iterator:V(v),resultName:w,nextLoc:O},this.method==="next"&&(this.arg=t),D}},e}function _U(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function TS(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,CU(n.key),n)}}function EU(t,e,r){return e&&TS(t.prototype,e),r&&TS(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function CU(t){var e=SU(t,"string");return $i(e)=="symbol"?e:e+""}function SU(t,e){if($i(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if($i(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function PS(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(l){r(l);return}a.done?e(u):Promise.resolve(u).then(n,i)}function RS(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function s(u){PS(o,n,i,s,a,"next",u)}function a(u){PS(o,n,i,s,a,"throw",u)}s(void 0)})}}function xU(t,e){return Lg.apply(this,arguments)}function Lg(){return Lg=RS(_u().mark(function t(e,r){return _u().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return i.abrupt("return",new Promise(function(o,s){var a=function(c){e.off("readable",u),s(c)},u=function l(){var c=e.read(r);c!==null&&(e.off("error",a),e.off("readable",l),o(c))};e.once("error",a),e.on("readable",u)}));case 1:case"end":return i.stop()}},t)})),Lg.apply(this,arguments)}var ble=sf.default=function(){function t(e){var r=this;_U(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 EU(t,[{key:"slice",value:function(){var e=RS(_u().mark(function n(i,o){var s,a,u,l,c;return _u().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(l=o-i,!(l>s.length)){h.next=16;break}return h.next=14,xU(this._stream,l-s.length);case 14:c=h.sent,s=Buffer.concat([s,c]);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 IS=y(uf=>{"use strict";Object.defineProperty(uf,"__esModule",{value:!0});uf.default=void 0;var FU=require("fs"),OU=af(CS()),AU=af(xS()),kU=af(kS()),TU=af(Bg());function af(t){return t&&t.__esModule?t:{default:t}}function Eu(t){"@babel/helpers - typeof";return Eu=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},Eu(t)}function PU(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function $S(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,$U(n.key),n)}}function RU(t,e,r){return e&&$S(t.prototype,e),r&&$S(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function $U(t){var e=IU(t,"string");return Eu(e)=="symbol"?e:e+""}function IU(t,e){if(Eu(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Eu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var _le=uf.default=function(){function t(){PU(this,t)}return RU(t,[{key:"openFile",value:function(r,n){return Buffer.isBuffer(r)?Promise.resolve(new AU.default(r)):r instanceof FU.ReadStream&&r.path!=null?(0,kU.default)(r):OU.default.readable(r)?(n=Number(n),Number.isFinite(n)?Promise.resolve(new TU.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 BS=y(qg=>{"use strict";Object.defineProperty(qg,"__esModule",{value:!0});qg.default=LU;var jU=require("crypto"),jS=LS(require("fs")),NU=LS(require("path"));function NS(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,r=new WeakMap;return(NS=function(n){return n?r:e})(t)}function LS(t,e){if(!e&&t&&t.__esModule)return t;if(t===null||typeof t!="object"&&typeof t!="function")return{default:t};var r=NS(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 LU(t,e){if(Buffer.isBuffer(t)){var r=65536,n=t.slice(0,Math.min(r,t.length)),i=(0,jU.createHash)("md5").update(n).digest("hex"),o=["node-buffer",i,t.length,e.endpoint].join("-");return Promise.resolve(o)}return t instanceof jS.ReadStream&&t.path!=null?new Promise(function(s,a){var u=NU.resolve(t.path);jS.stat(t.path,function(l,c){if(l){a(l);return}var f=["node-file",u,c.size,c.mtime.getTime(),e.endpoint].join("-");s(f)})}):Promise.resolve(null)}});var VS=y((Sle,HS)=>{var US="Expected a function",qS=NaN,BU="[object Symbol]",qU=/^\s+|\s+$/g,MU=/^[-+]0x[0-9a-f]+$/i,UU=/^0b[01]+$/i,HU=/^0o[0-7]+$/i,VU=parseInt,zU=typeof global=="object"&&global&&global.Object===Object&&global,GU=typeof self=="object"&&self&&self.Object===Object&&self,WU=zU||GU||Function("return this")(),KU=Object.prototype,YU=KU.toString,JU=Math.max,XU=Math.min,Mg=function(){return WU.Date.now()};function ZU(t,e,r){var n,i,o,s,a,u,l=0,c=!1,f=!1,h=!0;if(typeof t!="function")throw new TypeError(US);e=MS(e)||0,lf(r)&&(c=!!r.leading,f="maxWait"in r,o=f?JU(MS(r.maxWait)||0,e):o,h="trailing"in r?!!r.trailing:h);function d(T){var x=n,L=i;return n=i=void 0,l=T,s=t.apply(L,x),s}function m(T){return l=T,a=setTimeout(_,e),c?d(T):s}function b(T){var x=T-u,L=T-l,S=e-x;return f?XU(S,o-L):S}function D(T){var x=T-u,L=T-l;return u===void 0||x>=e||x<0||f&&L>=o}function _(){var T=Mg();if(D(T))return F(T);a=setTimeout(_,b(T))}function F(T){return a=void 0,h&&n?d(T):(n=i=void 0,s)}function g(){a!==void 0&&clearTimeout(a),l=0,n=u=i=a=void 0}function C(){return a===void 0?s:F(Mg())}function A(){var T=Mg(),x=D(T);if(n=arguments,i=this,u=T,x){if(a===void 0)return m(u);if(f)return a=setTimeout(_,e),d(u)}return a===void 0&&(a=setTimeout(_,e)),s}return A.cancel=g,A.flush=C,A}function QU(t,e,r){var n=!0,i=!0;if(typeof t!="function")throw new TypeError(US);return lf(r)&&(n="leading"in r?!!r.leading:n,i="trailing"in r?!!r.trailing:i),ZU(t,e,{leading:n,maxWait:e,trailing:i})}function lf(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function e9(t){return!!t&&typeof t=="object"}function t9(t){return typeof t=="symbol"||e9(t)&&YU.call(t)==BU}function MS(t){if(typeof t=="number")return t;if(t9(t))return qS;if(lf(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=lf(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=t.replace(qU,"");var r=UU.test(t);return r||HU.test(t)?VU(t.slice(2),r?2:8):MU.test(t)?qS:+t}HS.exports=QU});var QS=y(hf=>{"use strict";Object.defineProperty(hf,"__esModule",{value:!0});hf.default=void 0;var r9=JS(require("http")),n9=JS(require("https")),WS=require("stream"),i9=require("url"),KS=o9(VS());function o9(t){return t&&t.__esModule?t:{default:t}}function YS(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,r=new WeakMap;return(YS=function(n){return n?r:e})(t)}function JS(t,e){if(!e&&t&&t.__esModule)return t;if(t===null||typeof t!="object"&&typeof t!="function")return{default:t};var r=YS(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 s9(t,e,r){return e=cf(e),a9(t,XS()?Reflect.construct(e,r||[],cf(t).constructor):e.apply(t,r))}function a9(t,e){if(e&&(cs(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return u9(t)}function u9(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function XS(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(XS=function(){return!!t})()}function cf(t){return cf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},cf(t)}function l9(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&&Ug(t,e)}function Ug(t,e){return Ug=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Ug(t,e)}function zS(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 Cu(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?zS(Object(r),!0).forEach(function(n){c9(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):zS(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function c9(t,e,r){return e=ZS(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function cs(t){"@babel/helpers - typeof";return cs=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},cs(t)}function ff(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function GS(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,ZS(n.key),n)}}function df(t,e,r){return e&&GS(t.prototype,e),r&&GS(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function ZS(t){var e=f9(t,"string");return cs(e)=="symbol"?e:e+""}function f9(t,e){if(cs(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(cs(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var xle=hf.default=function(){function t(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};ff(this,t),this._requestOptions=e}return df(t,[{key:"createRequest",value:function(r,n){return new d9(r,n,this._requestOptions)}},{key:"getName",value:function(){return"NodeHttpStack"}}])}(),d9=function(){function t(e,r,n){ff(this,t),this._method=e,this._url=r,this._headers={},this._request=null,this._progressHandler=function(){},this._requestOptions=n||{}}return df(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=Cu(Cu(Cu({},(0,i9.parse)(r._url)),r._requestOptions),{},{method:r._method,headers:Cu(Cu({},r._requestOptions.headers||{}),r._headers)});n!=null&&n.size&&(s.headers["Content-Length"]=n.size);var a=s.protocol==="https:"?n9:r9;r._request=a.request(s);var u=r._request;u.on("response",function(l){var c=[];l.on("data",function(f){c.push(f)}),l.on("end",function(){var f=Buffer.concat(c).toString("utf8");i(new h9(l,f))})}),u.on("error",function(l){o(l)}),n instanceof WS.Readable?n.pipe(new p9(r._progressHandler)).pipe(u):n instanceof Uint8Array?m9(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}}])}(),h9=function(){function t(e,r){ff(this,t),this._response=e,this._body=r}return df(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}}])}(),p9=function(t){function e(r){var n;return ff(this,e),n=s9(this,e),n._onprogress=(0,KS.default)(r,100,{leading:!0,trailing:!1}),n._position=0,n}return l9(e,t),df(e,[{key:"_transform",value:function(n,i,o){this._position+=n.length,this._onprogress(this._position),o(null,n)}}])}(WS.Transform),m9=function(e,r,n){n=(0,KS.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 e1=y(Hg=>{"use strict";Hg.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};Hg.root=function(t,e,r){var n=this,i,o={stackLength:Error.stackTraceLimit,rootOnly:!0},s="",a=Error.stackTraceLimit,u;function l(){u[0]=n.toString(),n.stack=u.join(`
|
|
28
|
+
`,e=e.substr(s)}try{o=JSON.parse(e)}catch{return Mr.red("Error:")+" Not valid JSON!"}return i+=gu.render(o,r,n),i}});var Cg=y(Jc=>{"use strict";Object.defineProperty(Jc,"__esModule",{value:!0});Jc.default=void 0;function as(t){"@babel/helpers - typeof";return as=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},as(t)}function VC(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,E5(n.key),n)}}function _5(t,e,r){return e&&VC(t.prototype,e),r&&VC(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function E5(t){var e=C5(t,"string");return as(e)=="symbol"?e:e+""}function C5(t,e){if(as(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(as(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function S5(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function x5(t,e,r){return e=Du(e),F5(t,Eg()?Reflect.construct(e,r||[],Du(t).constructor):e.apply(t,r))}function F5(t,e){if(e&&(as(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return O5(t)}function O5(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function A5(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&&yu(t,e)}function _g(t){var e=typeof Map=="function"?new Map:void 0;return _g=function(n){if(n===null||!T5(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 k5(n,arguments,Du(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),yu(i,n)},_g(t)}function k5(t,e,r){if(Eg())return Reflect.construct.apply(null,arguments);var n=[null];n.push.apply(n,e);var i=new(t.bind.apply(t,n));return r&&yu(i,r.prototype),i}function Eg(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Eg=function(){return!!t})()}function T5(t){try{return Function.toString.call(t).indexOf("[native code]")!==-1}catch{return typeof t=="function"}}function yu(t,e){return yu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},yu(t,e)}function Du(t){return Du=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Du(t)}var P5=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(S5(this,e),n=x5(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(),l=o.getURL(),c=s?s.getStatus():"n/a",f=s?s.getBody()||"":"n/a";r+=", originated from request (method: ".concat(u,", url: ").concat(l,", response code: ").concat(c,", response text: ").concat(f,", request id: ").concat(a,")")}return n.message=r,n}return A5(e,t),_5(e)}(_g(Error)),ule=Jc.default=P5});var Sg=y(Xc=>{"use strict";Object.defineProperty(Xc,"__esModule",{value:!0});Xc.enableDebugLog=R5;Xc.log=$5;var zC=!1;function R5(){zC=!0}function $5(t){zC&&console.log(t)}});var WC=y(Zc=>{"use strict";Object.defineProperty(Zc,"__esModule",{value:!0});Zc.default=void 0;function vu(t){"@babel/helpers - typeof";return vu=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},vu(t)}function I5(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function GC(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,N5(n.key),n)}}function j5(t,e,r){return e&&GC(t.prototype,e),r&&GC(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function N5(t){var e=L5(t,"string");return vu(e)=="symbol"?e:e+""}function L5(t,e){if(vu(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(vu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var fle=Zc.default=function(){function t(){I5(this,t)}return j5(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 KC=y((xg,Fg)=>{(function(t,e){typeof xg=="object"&&typeof Fg<"u"?Fg.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(P){var N={};return P.forEach(function(ie,oe){return N[ie]=oe}),N}(s),u=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,l=String.fromCharCode.bind(String),c=typeof Uint8Array.from=="function"?Uint8Array.from.bind(Uint8Array):function(P){return new Uint8Array(Array.prototype.slice.call(P,0))},f=function(P){return P.replace(/=/g,"").replace(/[+\/]/g,function(N){return N=="+"?"-":"_"})},h=function(P){return P.replace(/[^A-Za-z0-9\+\/]/g,"")},d=function(P){for(var N,ie,oe,ye,ln="",Wh=P.length%3,Ul=0;Ul<P.length;){if((ie=P.charCodeAt(Ul++))>255||(oe=P.charCodeAt(Ul++))>255||(ye=P.charCodeAt(Ul++))>255)throw new TypeError("invalid character found");N=ie<<16|oe<<8|ye,ln+=s[N>>18&63]+s[N>>12&63]+s[N>>6&63]+s[N&63]}return Wh?ln.slice(0,Wh-3)+"===".substring(Wh):ln},m=typeof btoa=="function"?function(P){return btoa(P)}:r?function(P){return Buffer.from(P,"binary").toString("base64")}:d,b=r?function(P){return Buffer.from(P).toString("base64")}:function(P){for(var N=4096,ie=[],oe=0,ye=P.length;oe<ye;oe+=N)ie.push(l.apply(null,P.subarray(oe,oe+N)));return m(ie.join(""))},D=function(P,N){return N===void 0&&(N=!1),N?f(b(P)):b(P)},_=function(P){if(P.length<2){var N=P.charCodeAt(0);return N<128?P:N<2048?l(192|N>>>6)+l(128|N&63):l(224|N>>>12&15)+l(128|N>>>6&63)+l(128|N&63)}else{var N=65536+(P.charCodeAt(0)-55296)*1024+(P.charCodeAt(1)-56320);return l(240|N>>>18&7)+l(128|N>>>12&63)+l(128|N>>>6&63)+l(128|N&63)}},F=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,g=function(P){return P.replace(F,_)},C=r?function(P){return Buffer.from(P,"utf8").toString("base64")}:i?function(P){return b(i.encode(P))}:function(P){return m(g(P))},A=function(P,N){return N===void 0&&(N=!1),N?f(C(P)):C(P)},T=function(P){return A(P,!0)},x=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,L=function(P){switch(P.length){case 4:var N=(7&P.charCodeAt(0))<<18|(63&P.charCodeAt(1))<<12|(63&P.charCodeAt(2))<<6|63&P.charCodeAt(3),ie=N-65536;return l((ie>>>10)+55296)+l((ie&1023)+56320);case 3:return l((15&P.charCodeAt(0))<<12|(63&P.charCodeAt(1))<<6|63&P.charCodeAt(2));default:return l((31&P.charCodeAt(0))<<6|63&P.charCodeAt(1))}},S=function(P){return P.replace(x,L)},I=function(P){if(P=P.replace(/\s+/g,""),!u.test(P))throw new TypeError("malformed base64.");P+="==".slice(2-(P.length&3));for(var N,ie="",oe,ye,ln=0;ln<P.length;)N=a[P.charAt(ln++)]<<18|a[P.charAt(ln++)]<<12|(oe=a[P.charAt(ln++)])<<6|(ye=a[P.charAt(ln++)]),ie+=oe===64?l(N>>16&255):ye===64?l(N>>16&255,N>>8&255):l(N>>16&255,N>>8&255,N&255);return ie},$=typeof atob=="function"?function(P){return atob(h(P))}:r?function(P){return Buffer.from(P,"base64").toString("binary")}:I,B=r?function(P){return c(Buffer.from(P,"base64"))}:function(P){return c($(P).split("").map(function(N){return N.charCodeAt(0)}))},q=function(P){return B(V(P))},K=r?function(P){return Buffer.from(P,"base64").toString("utf8")}:n?function(P){return n.decode(B(P))}:function(P){return S($(P))},V=function(P){return h(P.replace(/[-_]/g,function(N){return N=="-"?"+":"/"}))},E=function(P){return K(V(P))},v=function(P){if(typeof P!="string")return!1;var N=P.replace(/\s+/g,"").replace(/={0,2}$/,"");return!/[^\s0-9a-zA-Z\+/]/.test(N)||!/[^\s0-9a-zA-Z\-_]/.test(N)},w=function(P){return{value:P,enumerable:!1,writable:!0,configurable:!0}},O=function(){var P=function(N,ie){return Object.defineProperty(String.prototype,N,w(ie))};P("fromBase64",function(){return E(this)}),P("toBase64",function(N){return A(this,N)}),P("toBase64URI",function(){return A(this,!0)}),P("toBase64URL",function(){return A(this,!0)}),P("toUint8Array",function(){return q(this)})},j=function(){var P=function(N,ie){return Object.defineProperty(Uint8Array.prototype,N,w(ie))};P("toBase64",function(N){return D(this,N)}),P("toBase64URI",function(){return D(this,!0)}),P("toBase64URL",function(){return D(this,!0)})},R=function(){O(),j()},M={version:t,VERSION:e,atob:$,atobPolyfill:I,btoa:m,btoaPolyfill:d,fromBase64:E,toBase64:A,encode:A,encodeURI:T,encodeURL:T,utob:g,btou:S,decode:E,isValid:v,fromUint8Array:D,toUint8Array:q,extendString:O,extendUint8Array:j,extendBuiltins:R};return M.Base64={},Object.keys(M).forEach(function(P){return M.Base64[P]=M[P]}),M})});var JC=y((hle,YC)=>{"use strict";YC.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 QC=y(Og=>{"use strict";var B5=Object.prototype.hasOwnProperty,q5;function XC(t){try{return decodeURIComponent(t.replace(/\+/g," "))}catch{return null}}function ZC(t){try{return encodeURIComponent(t)}catch{return null}}function M5(t){for(var e=/([^=?#&]+)=?([^&]*)/g,r={},n;n=e.exec(t);){var i=XC(n[1]),o=XC(n[2]);i===null||o===null||i in r||(r[i]=o)}return r}function U5(t,e){e=e||"";var r=[],n,i;typeof e!="string"&&(e="?");for(i in t)if(B5.call(t,i)){if(n=t[i],!n&&(n===null||n===q5||isNaN(n))&&(n=""),i=ZC(i),n=ZC(n),i===null||n===null)continue;r.push(i+"="+n)}return r.length?e+r.join("&"):""}Og.stringify=U5;Og.parse=M5});var aS=y((mle,sS)=>{"use strict";var tS=JC(),Qc=QC(),H5=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,rS=/[\n\r\t]/g,V5=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,nS=/:\d+$/,z5=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i,G5=/^[a-zA-Z]:/;function kg(t){return(t||"").toString().replace(H5,"")}var Ag=[["#","hash"],["?","query"],function(e,r){return Ur(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]],eS={hash:1,query:1};function iS(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 Hr(unescape(t.pathname),{});else if(i==="string"){n=new Hr(t,{});for(o in eS)delete n[o]}else if(i==="object"){for(o in t)o in eS||(n[o]=t[o]);n.slashes===void 0&&(n.slashes=V5.test(t.href))}return n}function Ur(t){return t==="file:"||t==="ftp:"||t==="http:"||t==="https:"||t==="ws:"||t==="wss:"}function oS(t,e){t=kg(t),t=t.replace(rS,""),e=e||{};var r=z5.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)):Ur(n)?a=r[4]:n?i&&(a=a.slice(2)):s>=2&&Ur(e.protocol)&&(a=r[4]),{protocol:n,slashes:i||Ur(n),slashesCount:s,rest:a}}function W5(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 Hr(t,e,r){if(t=kg(t),t=t.replace(rS,""),!(this instanceof Hr))return new Hr(t,e,r);var n,i,o,s,a,u,l=Ag.slice(),c=typeof e,f=this,h=0;for(c!=="object"&&c!=="string"&&(r=e,e=null),r&&typeof r!="function"&&(r=Qc.parse),e=iS(e),i=oS(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||G5.test(t))||!i.slashes&&(i.protocol||i.slashesCount<2||!Ur(f.protocol)))&&(l[3]=[/(.*)/,"pathname"]);h<l.length;h++){if(s=l[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=W5(f.pathname,e.pathname)),f.pathname.charAt(0)!=="/"&&Ur(f.protocol)&&(f.pathname="/"+f.pathname),tS(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:"&&Ur(f.protocol)&&f.host?f.protocol+"//"+f.host:"null",f.href=f.toString()}function K5(t,e,r){var n=this;switch(t){case"query":typeof e=="string"&&e.length&&(e=(r||Qc.parse)(e)),n[t]=e;break;case"port":n[t]=e,tS(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,nS.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<Ag.length;s++){var a=Ag[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:"&&Ur(n.protocol)&&n.host?n.protocol+"//"+n.host:"null",n.href=n.toString(),n}function Y5(t){(!t||typeof t!="function")&&(t=Qc.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||Ur(r.protocol)?"//":"");return r.username?(o+=r.username,r.password&&(o+=":"+r.password),o+="@"):r.password?(o+=":"+r.password,o+="@"):r.protocol!=="file:"&&Ur(r.protocol)&&!n&&r.pathname!=="/"&&(o+="@"),(n[n.length-1]===":"||nS.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}Hr.prototype={set:K5,toString:Y5};Hr.extractProtocol=oS;Hr.location=iS;Hr.trimLeft=kg;Hr.qs=Qc;sS.exports=Hr});var uS=y(Tg=>{"use strict";Object.defineProperty(Tg,"__esModule",{value:!0});Tg.default=J5;function J5(){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 ES=y(nf=>{"use strict";Object.defineProperty(nf,"__esModule",{value:!0});nf.default=void 0;var X5=KC(),Z5=$g(aS()),ef=$g(Cg()),Ti=Sg(),Q5=$g(uS());function $g(t){return t&&t.__esModule?t:{default:t}}function Pg(){"use strict";Pg=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(E,v,w){E[v]=w.value},o=typeof Symbol=="function"?Symbol:{},s=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function l(E,v,w){return Object.defineProperty(E,v,{value:w,enumerable:!0,configurable:!0,writable:!0}),E[v]}try{l({},"")}catch{l=function(w,O,j){return w[O]=j}}function c(E,v,w,O){var j=v&&v.prototype instanceof _?v:_,R=Object.create(j.prototype),M=new K(O||[]);return i(R,"_invoke",{value:I(E,w,M)}),R}function f(E,v,w){try{return{type:"normal",arg:E.call(v,w)}}catch(O){return{type:"throw",arg:O}}}e.wrap=c;var h="suspendedStart",d="suspendedYield",m="executing",b="completed",D={};function _(){}function F(){}function g(){}var C={};l(C,s,function(){return this});var A=Object.getPrototypeOf,T=A&&A(A(V([])));T&&T!==r&&n.call(T,s)&&(C=T);var x=g.prototype=_.prototype=Object.create(C);function L(E){["next","throw","return"].forEach(function(v){l(E,v,function(w){return this._invoke(v,w)})})}function S(E,v){function w(j,R,M,P){var N=f(E[j],E,R);if(N.type!=="throw"){var ie=N.arg,oe=ie.value;return oe&&Pi(oe)=="object"&&n.call(oe,"__await")?v.resolve(oe.__await).then(function(ye){w("next",ye,M,P)},function(ye){w("throw",ye,M,P)}):v.resolve(oe).then(function(ye){ie.value=ye,M(ie)},function(ye){return w("throw",ye,M,P)})}P(N.arg)}var O;i(this,"_invoke",{value:function(R,M){function P(){return new v(function(N,ie){w(R,M,N,ie)})}return O=O?O.then(P,P):P()}})}function I(E,v,w){var O=h;return function(j,R){if(O===m)throw Error("Generator is already running");if(O===b){if(j==="throw")throw R;return{value:t,done:!0}}for(w.method=j,w.arg=R;;){var M=w.delegate;if(M){var P=$(M,w);if(P){if(P===D)continue;return P}}if(w.method==="next")w.sent=w._sent=w.arg;else if(w.method==="throw"){if(O===h)throw O=b,w.arg;w.dispatchException(w.arg)}else w.method==="return"&&w.abrupt("return",w.arg);O=m;var N=f(E,v,w);if(N.type==="normal"){if(O=w.done?b:d,N.arg===D)continue;return{value:N.arg,done:w.done}}N.type==="throw"&&(O=b,w.method="throw",w.arg=N.arg)}}}function $(E,v){var w=v.method,O=E.iterator[w];if(O===t)return v.delegate=null,w==="throw"&&E.iterator.return&&(v.method="return",v.arg=t,$(E,v),v.method==="throw")||w!=="return"&&(v.method="throw",v.arg=new TypeError("The iterator does not provide a '"+w+"' method")),D;var j=f(O,E.iterator,v.arg);if(j.type==="throw")return v.method="throw",v.arg=j.arg,v.delegate=null,D;var R=j.arg;return R?R.done?(v[E.resultName]=R.value,v.next=E.nextLoc,v.method!=="return"&&(v.method="next",v.arg=t),v.delegate=null,D):R:(v.method="throw",v.arg=new TypeError("iterator result is not an object"),v.delegate=null,D)}function B(E){var v={tryLoc:E[0]};1 in E&&(v.catchLoc=E[1]),2 in E&&(v.finallyLoc=E[2],v.afterLoc=E[3]),this.tryEntries.push(v)}function q(E){var v=E.completion||{};v.type="normal",delete v.arg,E.completion=v}function K(E){this.tryEntries=[{tryLoc:"root"}],E.forEach(B,this),this.reset(!0)}function V(E){if(E||E===""){var v=E[s];if(v)return v.call(E);if(typeof E.next=="function")return E;if(!isNaN(E.length)){var w=-1,O=function j(){for(;++w<E.length;)if(n.call(E,w))return j.value=E[w],j.done=!1,j;return j.value=t,j.done=!0,j};return O.next=O}}throw new TypeError(Pi(E)+" is not iterable")}return F.prototype=g,i(x,"constructor",{value:g,configurable:!0}),i(g,"constructor",{value:F,configurable:!0}),F.displayName=l(g,u,"GeneratorFunction"),e.isGeneratorFunction=function(E){var v=typeof E=="function"&&E.constructor;return!!v&&(v===F||(v.displayName||v.name)==="GeneratorFunction")},e.mark=function(E){return Object.setPrototypeOf?Object.setPrototypeOf(E,g):(E.__proto__=g,l(E,u,"GeneratorFunction")),E.prototype=Object.create(x),E},e.awrap=function(E){return{__await:E}},L(S.prototype),l(S.prototype,a,function(){return this}),e.AsyncIterator=S,e.async=function(E,v,w,O,j){j===void 0&&(j=Promise);var R=new S(c(E,v,w,O),j);return e.isGeneratorFunction(v)?R:R.next().then(function(M){return M.done?M.value:R.next()})},L(x),l(x,u,"Generator"),l(x,s,function(){return this}),l(x,"toString",function(){return"[object Generator]"}),e.keys=function(E){var v=Object(E),w=[];for(var O in v)w.push(O);return w.reverse(),function j(){for(;w.length;){var R=w.pop();if(R in v)return j.value=R,j.done=!1,j}return j.done=!0,j}},e.values=V,K.prototype={constructor:K,reset:function(v){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),!v)for(var w in this)w.charAt(0)==="t"&&n.call(this,w)&&!isNaN(+w.slice(1))&&(this[w]=t)},stop:function(){this.done=!0;var v=this.tryEntries[0].completion;if(v.type==="throw")throw v.arg;return this.rval},dispatchException:function(v){if(this.done)throw v;var w=this;function O(ie,oe){return M.type="throw",M.arg=v,w.next=ie,oe&&(w.method="next",w.arg=t),!!oe}for(var j=this.tryEntries.length-1;j>=0;--j){var R=this.tryEntries[j],M=R.completion;if(R.tryLoc==="root")return O("end");if(R.tryLoc<=this.prev){var P=n.call(R,"catchLoc"),N=n.call(R,"finallyLoc");if(P&&N){if(this.prev<R.catchLoc)return O(R.catchLoc,!0);if(this.prev<R.finallyLoc)return O(R.finallyLoc)}else if(P){if(this.prev<R.catchLoc)return O(R.catchLoc,!0)}else{if(!N)throw Error("try statement without catch or finally");if(this.prev<R.finallyLoc)return O(R.finallyLoc)}}}},abrupt:function(v,w){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 R=j;break}}R&&(v==="break"||v==="continue")&&R.tryLoc<=w&&w<=R.finallyLoc&&(R=null);var M=R?R.completion:{};return M.type=v,M.arg=w,R?(this.method="next",this.next=R.finallyLoc,D):this.complete(M)},complete:function(v,w){if(v.type==="throw")throw v.arg;return v.type==="break"||v.type==="continue"?this.next=v.arg:v.type==="return"?(this.rval=this.arg=v.arg,this.method="return",this.next="end"):v.type==="normal"&&w&&(this.next=w),D},finish:function(v){for(var w=this.tryEntries.length-1;w>=0;--w){var O=this.tryEntries[w];if(O.finallyLoc===v)return this.complete(O.completion,O.afterLoc),q(O),D}},catch:function(v){for(var w=this.tryEntries.length-1;w>=0;--w){var O=this.tryEntries[w];if(O.tryLoc===v){var j=O.completion;if(j.type==="throw"){var R=j.arg;q(O)}return R}}throw Error("illegal catch attempt")},delegateYield:function(v,w,O){return this.delegate={iterator:V(v),resultName:w,nextLoc:O},this.method==="next"&&(this.arg=t),D}},e}function lS(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(l){r(l);return}a.done?e(u):Promise.resolve(u).then(n,i)}function eU(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function s(u){lS(o,n,i,s,a,"next",u)}function a(u){lS(o,n,i,s,a,"throw",u)}s(void 0)})}}function DS(t,e){return nU(t)||rU(t,e)||vS(t,e)||tU()}function tU(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
29
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function rU(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,l=!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(c){l=!0,i=c}finally{try{if(!u&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(l)throw i}}return a}}function nU(t){if(Array.isArray(t))return t}function Pi(t){"@babel/helpers - typeof";return Pi=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},Pi(t)}function iU(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=vS(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(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
30
|
+
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 l=r.next();return o=l.done,l},e:function(l){s=!0,a=l},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(s)throw a}}}}function vS(t,e){if(t){if(typeof t=="string")return cS(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 cS(t,e)}}function cS(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 fS(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 us(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?fS(Object(r),!0).forEach(function(n){oU(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):fS(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function oU(t,e,r){return e=bS(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function sU(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function dS(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,bS(n.key),n)}}function aU(t,e,r){return e&&dS(t.prototype,e),r&&dS(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function bS(t){var e=uU(t,"string");return Pi(e)=="symbol"?e:e+""}function uU(t,e){if(Pi(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Pi(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var tf="tus-v1",rf="ietf-draft-03",bu="ietf-draft-05",lU={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:_S,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:tf},wS=function(){function t(e,r){sU(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 aU(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(![tf,rf,bu].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,Ti.log)("No fingerprint was calculated meaning that the upload cannot be stored in the URL storage."):(0,Ti.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:fU(this._source.size,s);this._parallelUploadUrls&&a.forEach(function(c,f){c.uploadUrl=n._parallelUploadUrls[f]||null}),this._parallelUploadUrls=new Array(a.length);var u=a.map(function(c,f){var h=0;return n._source.slice(c.start,c.end).then(function(d){var m=d.value;return new Promise(function(b,D){var _=us(us({},n.options),{},{uploadUrl:c.uploadUrl||null,storeFingerprintForResuming:!1,removeFingerprintOnSuccess:!1,parallelUploads:1,parallelUploadBoundaries:null,metadata:n.options.metadataForPartialUploads,headers:us(us({},n.options.headers),{},{"Upload-Concat":"partial"}),onSuccess:b,onError:D,onProgress:function(C){o=o-h+C,h=C,n._emitProgress(o,i)},onUploadUrlAvailable:function(){n._parallelUploadUrls[f]=F.url,n._parallelUploadUrls.filter(function(C){return!!C}).length===a.length&&n._saveUploadInUrlStorage()}}),F=new t(m,_);F.start(),n._parallelUploads.push(F)})})}),l;Promise.all(u).then(function(){l=n._openRequest("POST",n.options.endpoint),l.setHeader("Upload-Concat","final;".concat(n._parallelUploadUrls.join(" ")));var c=hS(n.options.metadata);return c!==""&&l.setHeader("Upload-Metadata",c),n._sendRequest(l,null)}).then(function(c){if(!ls(c.getStatus(),200)){n._emitHttpError(l,c,"tus: unexpected response while creating upload");return}var f=c.getHeader("Location");if(f==null){n._emitHttpError(l,c,"tus: invalid or missing Location header");return}n.url=yS(n.options.endpoint,f),(0,Ti.log)("Created upload at ".concat(n.url)),n._emitSuccess(c)}).catch(function(c){n._emitError(c)})}},{key:"_startSingleUpload",value:function(){if(this._aborted=!1,this.url!=null){(0,Ti.log)("Resuming upload from previous URL: ".concat(this.url)),this._resumeUpload();return}if(this.options.uploadUrl!=null){(0,Ti.log)("Resuming upload from provided URL: ".concat(this.options.uploadUrl)),this.url=this.options.uploadUrl,this._resumeUpload();return}(0,Ti.log)("Creating a new upload"),this._createUpload()}},{key:"abort",value:function(r){var n=this;if(this._parallelUploads!=null){var i=iU(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 ef.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),gS(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=hS(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===rf||this.options.protocol===bu)&&n.setHeader("Upload-Complete","?0"),o=this._sendRequest(n,null)),o.then(function(s){if(!ls(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=yS(r.options.endpoint,a),(0,Ti.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(!ls(s,200)){if(s===423){r._emitHttpError(n,o,"tus: upload is currently locked; retry later");return}if(ls(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===tf){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(!ls(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)}),this.options.protocol===tf?r.setHeader("Content-Type","application/offset+octet-stream"):this.options.protocol===bu&&r.setHeader("Content-Type","application/partial-upload"),(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,l=a!=null&&a.size?a.size:0;n.options.uploadLengthDeferred&&u&&(n._size=n._offset+l,r.setHeader("Upload-Length","".concat(n._size)));var c=n._offset+l;return!n.options.uploadLengthDeferred&&u&&c!==n._size?Promise.reject(new Error("upload was configured with a size of ".concat(n._size," bytes, but the source is done after ").concat(c," bytes"))):a===null?n._sendRequest(r):((n.options.protocol===rf||n.options.protocol===bu)&&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=pS(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 mS(r,n,this.options)}}],[{key:"terminate",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=pS("DELETE",r,n);return mS(i,null,n).then(function(o){if(o.getStatus()!==204)throw new ef.default("tus: unexpected response while terminating upload",null,i,o)}).catch(function(o){if(o instanceof ef.default||(o=new ef.default("tus: failed to terminate upload",o,i,null)),!gS(o,0,n))throw o;var s=n.retryDelays[0],a=n.retryDelays.slice(1),u=us(us({},n),{},{retryDelays:a});return new Promise(function(l){return setTimeout(l,s)}).then(function(){return t.terminate(r,u)})})}}])}();function hS(t){return Object.entries(t).map(function(e){var r=DS(e,2),n=r[0],i=r[1];return"".concat(n," ").concat(X5.Base64.encode(String(i)))}).join(",")}function ls(t,e){return t>=e&&t<e+100}function pS(t,e,r){var n=r.httpStack.createRequest(t,e);r.protocol===rf?n.setHeader("Upload-Draft-Interop-Version","5"):r.protocol===bu?n.setHeader("Upload-Draft-Interop-Version","6"):n.setHeader("Tus-Resumable","1.0.0");for(var i=r.headers||{},o=0,s=Object.entries(i);o<s.length;o++){var a=DS(s[o],2),u=a[0],l=a[1];n.setHeader(u,l)}if(r.addRequestId){var c=(0,Q5.default)();n.setHeader("X-Request-ID",c)}return n}function mS(t,e,r){return Rg.apply(this,arguments)}function Rg(){return Rg=eU(Pg().mark(function t(e,r,n){var i;return Pg().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)})),Rg.apply(this,arguments)}function cU(){var t=!0;return typeof navigator<"u"&&navigator.onLine===!1&&(t=!1),t}function gS(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):_S(t)}function _S(t){var e=t.originalResponse?t.originalResponse.getStatus():0;return(!ls(e,400)||e===409||e===423)&&cU()}function yS(t,e){return new Z5.default(e,t).toString()}function fU(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}wS.defaultOptions=lU;var yle=nf.default=wS});var SS=y((vle,CS)=>{"use strict";var Vr=t=>t!==null&&typeof t=="object"&&typeof t.pipe=="function";Vr.writable=t=>Vr(t)&&t.writable!==!1&&typeof t._write=="function"&&typeof t._writableState=="object";Vr.readable=t=>Vr(t)&&t.readable!==!1&&typeof t._read=="function"&&typeof t._readableState=="object";Vr.duplex=t=>Vr.writable(t)&&Vr.readable(t);Vr.transform=t=>Vr.duplex(t)&&typeof t._transform=="function";CS.exports=Vr});var FS=y(of=>{"use strict";Object.defineProperty(of,"__esModule",{value:!0});of.default=void 0;function wu(t){"@babel/helpers - typeof";return wu=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},wu(t)}function dU(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function xS(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,pU(n.key),n)}}function hU(t,e,r){return e&&xS(t.prototype,e),r&&xS(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function pU(t){var e=mU(t,"string");return wu(e)=="symbol"?e:e+""}function mU(t,e){if(wu(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(wu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var ble=of.default=function(){function t(e){dU(this,t),this._buffer=e,this.size=e.length}return hU(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 TS=y(Ng=>{"use strict";Object.defineProperty(Ng,"__esModule",{value:!0});Ng.default=wU;var kS=require("fs");function Ri(t){"@babel/helpers - typeof";return Ri=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},Ri(t)}function Ig(){"use strict";Ig=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(E,v,w){E[v]=w.value},o=typeof Symbol=="function"?Symbol:{},s=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function l(E,v,w){return Object.defineProperty(E,v,{value:w,enumerable:!0,configurable:!0,writable:!0}),E[v]}try{l({},"")}catch{l=function(w,O,j){return w[O]=j}}function c(E,v,w,O){var j=v&&v.prototype instanceof _?v:_,R=Object.create(j.prototype),M=new K(O||[]);return i(R,"_invoke",{value:I(E,w,M)}),R}function f(E,v,w){try{return{type:"normal",arg:E.call(v,w)}}catch(O){return{type:"throw",arg:O}}}e.wrap=c;var h="suspendedStart",d="suspendedYield",m="executing",b="completed",D={};function _(){}function F(){}function g(){}var C={};l(C,s,function(){return this});var A=Object.getPrototypeOf,T=A&&A(A(V([])));T&&T!==r&&n.call(T,s)&&(C=T);var x=g.prototype=_.prototype=Object.create(C);function L(E){["next","throw","return"].forEach(function(v){l(E,v,function(w){return this._invoke(v,w)})})}function S(E,v){function w(j,R,M,P){var N=f(E[j],E,R);if(N.type!=="throw"){var ie=N.arg,oe=ie.value;return oe&&Ri(oe)=="object"&&n.call(oe,"__await")?v.resolve(oe.__await).then(function(ye){w("next",ye,M,P)},function(ye){w("throw",ye,M,P)}):v.resolve(oe).then(function(ye){ie.value=ye,M(ie)},function(ye){return w("throw",ye,M,P)})}P(N.arg)}var O;i(this,"_invoke",{value:function(R,M){function P(){return new v(function(N,ie){w(R,M,N,ie)})}return O=O?O.then(P,P):P()}})}function I(E,v,w){var O=h;return function(j,R){if(O===m)throw Error("Generator is already running");if(O===b){if(j==="throw")throw R;return{value:t,done:!0}}for(w.method=j,w.arg=R;;){var M=w.delegate;if(M){var P=$(M,w);if(P){if(P===D)continue;return P}}if(w.method==="next")w.sent=w._sent=w.arg;else if(w.method==="throw"){if(O===h)throw O=b,w.arg;w.dispatchException(w.arg)}else w.method==="return"&&w.abrupt("return",w.arg);O=m;var N=f(E,v,w);if(N.type==="normal"){if(O=w.done?b:d,N.arg===D)continue;return{value:N.arg,done:w.done}}N.type==="throw"&&(O=b,w.method="throw",w.arg=N.arg)}}}function $(E,v){var w=v.method,O=E.iterator[w];if(O===t)return v.delegate=null,w==="throw"&&E.iterator.return&&(v.method="return",v.arg=t,$(E,v),v.method==="throw")||w!=="return"&&(v.method="throw",v.arg=new TypeError("The iterator does not provide a '"+w+"' method")),D;var j=f(O,E.iterator,v.arg);if(j.type==="throw")return v.method="throw",v.arg=j.arg,v.delegate=null,D;var R=j.arg;return R?R.done?(v[E.resultName]=R.value,v.next=E.nextLoc,v.method!=="return"&&(v.method="next",v.arg=t),v.delegate=null,D):R:(v.method="throw",v.arg=new TypeError("iterator result is not an object"),v.delegate=null,D)}function B(E){var v={tryLoc:E[0]};1 in E&&(v.catchLoc=E[1]),2 in E&&(v.finallyLoc=E[2],v.afterLoc=E[3]),this.tryEntries.push(v)}function q(E){var v=E.completion||{};v.type="normal",delete v.arg,E.completion=v}function K(E){this.tryEntries=[{tryLoc:"root"}],E.forEach(B,this),this.reset(!0)}function V(E){if(E||E===""){var v=E[s];if(v)return v.call(E);if(typeof E.next=="function")return E;if(!isNaN(E.length)){var w=-1,O=function j(){for(;++w<E.length;)if(n.call(E,w))return j.value=E[w],j.done=!1,j;return j.value=t,j.done=!0,j};return O.next=O}}throw new TypeError(Ri(E)+" is not iterable")}return F.prototype=g,i(x,"constructor",{value:g,configurable:!0}),i(g,"constructor",{value:F,configurable:!0}),F.displayName=l(g,u,"GeneratorFunction"),e.isGeneratorFunction=function(E){var v=typeof E=="function"&&E.constructor;return!!v&&(v===F||(v.displayName||v.name)==="GeneratorFunction")},e.mark=function(E){return Object.setPrototypeOf?Object.setPrototypeOf(E,g):(E.__proto__=g,l(E,u,"GeneratorFunction")),E.prototype=Object.create(x),E},e.awrap=function(E){return{__await:E}},L(S.prototype),l(S.prototype,a,function(){return this}),e.AsyncIterator=S,e.async=function(E,v,w,O,j){j===void 0&&(j=Promise);var R=new S(c(E,v,w,O),j);return e.isGeneratorFunction(v)?R:R.next().then(function(M){return M.done?M.value:R.next()})},L(x),l(x,u,"Generator"),l(x,s,function(){return this}),l(x,"toString",function(){return"[object Generator]"}),e.keys=function(E){var v=Object(E),w=[];for(var O in v)w.push(O);return w.reverse(),function j(){for(;w.length;){var R=w.pop();if(R in v)return j.value=R,j.done=!1,j}return j.done=!0,j}},e.values=V,K.prototype={constructor:K,reset:function(v){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),!v)for(var w in this)w.charAt(0)==="t"&&n.call(this,w)&&!isNaN(+w.slice(1))&&(this[w]=t)},stop:function(){this.done=!0;var v=this.tryEntries[0].completion;if(v.type==="throw")throw v.arg;return this.rval},dispatchException:function(v){if(this.done)throw v;var w=this;function O(ie,oe){return M.type="throw",M.arg=v,w.next=ie,oe&&(w.method="next",w.arg=t),!!oe}for(var j=this.tryEntries.length-1;j>=0;--j){var R=this.tryEntries[j],M=R.completion;if(R.tryLoc==="root")return O("end");if(R.tryLoc<=this.prev){var P=n.call(R,"catchLoc"),N=n.call(R,"finallyLoc");if(P&&N){if(this.prev<R.catchLoc)return O(R.catchLoc,!0);if(this.prev<R.finallyLoc)return O(R.finallyLoc)}else if(P){if(this.prev<R.catchLoc)return O(R.catchLoc,!0)}else{if(!N)throw Error("try statement without catch or finally");if(this.prev<R.finallyLoc)return O(R.finallyLoc)}}}},abrupt:function(v,w){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 R=j;break}}R&&(v==="break"||v==="continue")&&R.tryLoc<=w&&w<=R.finallyLoc&&(R=null);var M=R?R.completion:{};return M.type=v,M.arg=w,R?(this.method="next",this.next=R.finallyLoc,D):this.complete(M)},complete:function(v,w){if(v.type==="throw")throw v.arg;return v.type==="break"||v.type==="continue"?this.next=v.arg:v.type==="return"?(this.rval=this.arg=v.arg,this.method="return",this.next="end"):v.type==="normal"&&w&&(this.next=w),D},finish:function(v){for(var w=this.tryEntries.length-1;w>=0;--w){var O=this.tryEntries[w];if(O.finallyLoc===v)return this.complete(O.completion,O.afterLoc),q(O),D}},catch:function(v){for(var w=this.tryEntries.length-1;w>=0;--w){var O=this.tryEntries[w];if(O.tryLoc===v){var j=O.completion;if(j.type==="throw"){var R=j.arg;q(O)}return R}}throw Error("illegal catch attempt")},delegateYield:function(v,w,O){return this.delegate={iterator:V(v),resultName:w,nextLoc:O},this.method==="next"&&(this.arg=t),D}},e}function gU(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function OS(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,DU(n.key),n)}}function yU(t,e,r){return e&&OS(t.prototype,e),r&&OS(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function DU(t){var e=vU(t,"string");return Ri(e)=="symbol"?e:e+""}function vU(t,e){if(Ri(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Ri(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function AS(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(l){r(l);return}a.done?e(u):Promise.resolve(u).then(n,i)}function bU(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function s(u){AS(o,n,i,s,a,"next",u)}function a(u){AS(o,n,i,s,a,"throw",u)}s(void 0)})}}function wU(t){return jg.apply(this,arguments)}function jg(){return jg=bU(Ig().mark(function t(e){var r,n,i,o,s,a,u;return Ig().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return n=e.path.toString(),c.next=3,kS.promises.stat(n);case 3:return i=c.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,c.abrupt("return",new _U(e,n,u));case 9:case"end":return c.stop()}},t)})),jg.apply(this,arguments)}var _U=function(){function t(e,r,n){gU(this,t),this._stream=e,this._path=r,this.size=n}return yU(t,[{key:"slice",value:function(r,n){var i,o=(i=this._stream.start)!==null&&i!==void 0?i:0,s=(0,kS.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 Bg=y(sf=>{"use strict";Object.defineProperty(sf,"__esModule",{value:!0});sf.default=void 0;function $i(t){"@babel/helpers - typeof";return $i=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},$i(t)}function _u(){"use strict";_u=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(E,v,w){E[v]=w.value},o=typeof Symbol=="function"?Symbol:{},s=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function l(E,v,w){return Object.defineProperty(E,v,{value:w,enumerable:!0,configurable:!0,writable:!0}),E[v]}try{l({},"")}catch{l=function(w,O,j){return w[O]=j}}function c(E,v,w,O){var j=v&&v.prototype instanceof _?v:_,R=Object.create(j.prototype),M=new K(O||[]);return i(R,"_invoke",{value:I(E,w,M)}),R}function f(E,v,w){try{return{type:"normal",arg:E.call(v,w)}}catch(O){return{type:"throw",arg:O}}}e.wrap=c;var h="suspendedStart",d="suspendedYield",m="executing",b="completed",D={};function _(){}function F(){}function g(){}var C={};l(C,s,function(){return this});var A=Object.getPrototypeOf,T=A&&A(A(V([])));T&&T!==r&&n.call(T,s)&&(C=T);var x=g.prototype=_.prototype=Object.create(C);function L(E){["next","throw","return"].forEach(function(v){l(E,v,function(w){return this._invoke(v,w)})})}function S(E,v){function w(j,R,M,P){var N=f(E[j],E,R);if(N.type!=="throw"){var ie=N.arg,oe=ie.value;return oe&&$i(oe)=="object"&&n.call(oe,"__await")?v.resolve(oe.__await).then(function(ye){w("next",ye,M,P)},function(ye){w("throw",ye,M,P)}):v.resolve(oe).then(function(ye){ie.value=ye,M(ie)},function(ye){return w("throw",ye,M,P)})}P(N.arg)}var O;i(this,"_invoke",{value:function(R,M){function P(){return new v(function(N,ie){w(R,M,N,ie)})}return O=O?O.then(P,P):P()}})}function I(E,v,w){var O=h;return function(j,R){if(O===m)throw Error("Generator is already running");if(O===b){if(j==="throw")throw R;return{value:t,done:!0}}for(w.method=j,w.arg=R;;){var M=w.delegate;if(M){var P=$(M,w);if(P){if(P===D)continue;return P}}if(w.method==="next")w.sent=w._sent=w.arg;else if(w.method==="throw"){if(O===h)throw O=b,w.arg;w.dispatchException(w.arg)}else w.method==="return"&&w.abrupt("return",w.arg);O=m;var N=f(E,v,w);if(N.type==="normal"){if(O=w.done?b:d,N.arg===D)continue;return{value:N.arg,done:w.done}}N.type==="throw"&&(O=b,w.method="throw",w.arg=N.arg)}}}function $(E,v){var w=v.method,O=E.iterator[w];if(O===t)return v.delegate=null,w==="throw"&&E.iterator.return&&(v.method="return",v.arg=t,$(E,v),v.method==="throw")||w!=="return"&&(v.method="throw",v.arg=new TypeError("The iterator does not provide a '"+w+"' method")),D;var j=f(O,E.iterator,v.arg);if(j.type==="throw")return v.method="throw",v.arg=j.arg,v.delegate=null,D;var R=j.arg;return R?R.done?(v[E.resultName]=R.value,v.next=E.nextLoc,v.method!=="return"&&(v.method="next",v.arg=t),v.delegate=null,D):R:(v.method="throw",v.arg=new TypeError("iterator result is not an object"),v.delegate=null,D)}function B(E){var v={tryLoc:E[0]};1 in E&&(v.catchLoc=E[1]),2 in E&&(v.finallyLoc=E[2],v.afterLoc=E[3]),this.tryEntries.push(v)}function q(E){var v=E.completion||{};v.type="normal",delete v.arg,E.completion=v}function K(E){this.tryEntries=[{tryLoc:"root"}],E.forEach(B,this),this.reset(!0)}function V(E){if(E||E===""){var v=E[s];if(v)return v.call(E);if(typeof E.next=="function")return E;if(!isNaN(E.length)){var w=-1,O=function j(){for(;++w<E.length;)if(n.call(E,w))return j.value=E[w],j.done=!1,j;return j.value=t,j.done=!0,j};return O.next=O}}throw new TypeError($i(E)+" is not iterable")}return F.prototype=g,i(x,"constructor",{value:g,configurable:!0}),i(g,"constructor",{value:F,configurable:!0}),F.displayName=l(g,u,"GeneratorFunction"),e.isGeneratorFunction=function(E){var v=typeof E=="function"&&E.constructor;return!!v&&(v===F||(v.displayName||v.name)==="GeneratorFunction")},e.mark=function(E){return Object.setPrototypeOf?Object.setPrototypeOf(E,g):(E.__proto__=g,l(E,u,"GeneratorFunction")),E.prototype=Object.create(x),E},e.awrap=function(E){return{__await:E}},L(S.prototype),l(S.prototype,a,function(){return this}),e.AsyncIterator=S,e.async=function(E,v,w,O,j){j===void 0&&(j=Promise);var R=new S(c(E,v,w,O),j);return e.isGeneratorFunction(v)?R:R.next().then(function(M){return M.done?M.value:R.next()})},L(x),l(x,u,"Generator"),l(x,s,function(){return this}),l(x,"toString",function(){return"[object Generator]"}),e.keys=function(E){var v=Object(E),w=[];for(var O in v)w.push(O);return w.reverse(),function j(){for(;w.length;){var R=w.pop();if(R in v)return j.value=R,j.done=!1,j}return j.done=!0,j}},e.values=V,K.prototype={constructor:K,reset:function(v){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),!v)for(var w in this)w.charAt(0)==="t"&&n.call(this,w)&&!isNaN(+w.slice(1))&&(this[w]=t)},stop:function(){this.done=!0;var v=this.tryEntries[0].completion;if(v.type==="throw")throw v.arg;return this.rval},dispatchException:function(v){if(this.done)throw v;var w=this;function O(ie,oe){return M.type="throw",M.arg=v,w.next=ie,oe&&(w.method="next",w.arg=t),!!oe}for(var j=this.tryEntries.length-1;j>=0;--j){var R=this.tryEntries[j],M=R.completion;if(R.tryLoc==="root")return O("end");if(R.tryLoc<=this.prev){var P=n.call(R,"catchLoc"),N=n.call(R,"finallyLoc");if(P&&N){if(this.prev<R.catchLoc)return O(R.catchLoc,!0);if(this.prev<R.finallyLoc)return O(R.finallyLoc)}else if(P){if(this.prev<R.catchLoc)return O(R.catchLoc,!0)}else{if(!N)throw Error("try statement without catch or finally");if(this.prev<R.finallyLoc)return O(R.finallyLoc)}}}},abrupt:function(v,w){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 R=j;break}}R&&(v==="break"||v==="continue")&&R.tryLoc<=w&&w<=R.finallyLoc&&(R=null);var M=R?R.completion:{};return M.type=v,M.arg=w,R?(this.method="next",this.next=R.finallyLoc,D):this.complete(M)},complete:function(v,w){if(v.type==="throw")throw v.arg;return v.type==="break"||v.type==="continue"?this.next=v.arg:v.type==="return"?(this.rval=this.arg=v.arg,this.method="return",this.next="end"):v.type==="normal"&&w&&(this.next=w),D},finish:function(v){for(var w=this.tryEntries.length-1;w>=0;--w){var O=this.tryEntries[w];if(O.finallyLoc===v)return this.complete(O.completion,O.afterLoc),q(O),D}},catch:function(v){for(var w=this.tryEntries.length-1;w>=0;--w){var O=this.tryEntries[w];if(O.tryLoc===v){var j=O.completion;if(j.type==="throw"){var R=j.arg;q(O)}return R}}throw Error("illegal catch attempt")},delegateYield:function(v,w,O){return this.delegate={iterator:V(v),resultName:w,nextLoc:O},this.method==="next"&&(this.arg=t),D}},e}function EU(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function PS(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,SU(n.key),n)}}function CU(t,e,r){return e&&PS(t.prototype,e),r&&PS(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function SU(t){var e=xU(t,"string");return $i(e)=="symbol"?e:e+""}function xU(t,e){if($i(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if($i(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function RS(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(l){r(l);return}a.done?e(u):Promise.resolve(u).then(n,i)}function $S(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function s(u){RS(o,n,i,s,a,"next",u)}function a(u){RS(o,n,i,s,a,"throw",u)}s(void 0)})}}function FU(t,e){return Lg.apply(this,arguments)}function Lg(){return Lg=$S(_u().mark(function t(e,r){return _u().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return i.abrupt("return",new Promise(function(o,s){var a=function(c){e.off("readable",u),s(c)},u=function l(){var c=e.read(r);c!==null&&(e.off("error",a),e.off("readable",l),o(c))};e.once("error",a),e.on("readable",u)}));case 1:case"end":return i.stop()}},t)})),Lg.apply(this,arguments)}var Ele=sf.default=function(){function t(e){var r=this;EU(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 CU(t,[{key:"slice",value:function(){var e=$S(_u().mark(function n(i,o){var s,a,u,l,c;return _u().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(l=o-i,!(l>s.length)){h.next=16;break}return h.next=14,FU(this._stream,l-s.length);case 14:c=h.sent,s=Buffer.concat([s,c]);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 jS=y(uf=>{"use strict";Object.defineProperty(uf,"__esModule",{value:!0});uf.default=void 0;var OU=require("fs"),AU=af(SS()),kU=af(FS()),TU=af(TS()),PU=af(Bg());function af(t){return t&&t.__esModule?t:{default:t}}function Eu(t){"@babel/helpers - typeof";return Eu=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},Eu(t)}function RU(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function IS(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,IU(n.key),n)}}function $U(t,e,r){return e&&IS(t.prototype,e),r&&IS(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function IU(t){var e=jU(t,"string");return Eu(e)=="symbol"?e:e+""}function jU(t,e){if(Eu(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Eu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Sle=uf.default=function(){function t(){RU(this,t)}return $U(t,[{key:"openFile",value:function(r,n){return Buffer.isBuffer(r)?Promise.resolve(new kU.default(r)):r instanceof OU.ReadStream&&r.path!=null?(0,TU.default)(r):AU.default.readable(r)?(n=Number(n),Number.isFinite(n)?Promise.resolve(new PU.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 qS=y(qg=>{"use strict";Object.defineProperty(qg,"__esModule",{value:!0});qg.default=BU;var NU=require("crypto"),NS=BS(require("fs")),LU=BS(require("path"));function LS(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,r=new WeakMap;return(LS=function(n){return n?r:e})(t)}function BS(t,e){if(!e&&t&&t.__esModule)return t;if(t===null||typeof t!="object"&&typeof t!="function")return{default:t};var r=LS(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 BU(t,e){if(Buffer.isBuffer(t)){var r=65536,n=t.slice(0,Math.min(r,t.length)),i=(0,NU.createHash)("md5").update(n).digest("hex"),o=["node-buffer",i,t.length,e.endpoint].join("-");return Promise.resolve(o)}return t instanceof NS.ReadStream&&t.path!=null?new Promise(function(s,a){var u=LU.resolve(t.path);NS.stat(t.path,function(l,c){if(l){a(l);return}var f=["node-file",u,c.size,c.mtime.getTime(),e.endpoint].join("-");s(f)})}):Promise.resolve(null)}});var zS=y((Ole,VS)=>{var HS="Expected a function",MS=NaN,qU="[object Symbol]",MU=/^\s+|\s+$/g,UU=/^[-+]0x[0-9a-f]+$/i,HU=/^0b[01]+$/i,VU=/^0o[0-7]+$/i,zU=parseInt,GU=typeof global=="object"&&global&&global.Object===Object&&global,WU=typeof self=="object"&&self&&self.Object===Object&&self,KU=GU||WU||Function("return this")(),YU=Object.prototype,JU=YU.toString,XU=Math.max,ZU=Math.min,Mg=function(){return KU.Date.now()};function QU(t,e,r){var n,i,o,s,a,u,l=0,c=!1,f=!1,h=!0;if(typeof t!="function")throw new TypeError(HS);e=US(e)||0,lf(r)&&(c=!!r.leading,f="maxWait"in r,o=f?XU(US(r.maxWait)||0,e):o,h="trailing"in r?!!r.trailing:h);function d(T){var x=n,L=i;return n=i=void 0,l=T,s=t.apply(L,x),s}function m(T){return l=T,a=setTimeout(_,e),c?d(T):s}function b(T){var x=T-u,L=T-l,S=e-x;return f?ZU(S,o-L):S}function D(T){var x=T-u,L=T-l;return u===void 0||x>=e||x<0||f&&L>=o}function _(){var T=Mg();if(D(T))return F(T);a=setTimeout(_,b(T))}function F(T){return a=void 0,h&&n?d(T):(n=i=void 0,s)}function g(){a!==void 0&&clearTimeout(a),l=0,n=u=i=a=void 0}function C(){return a===void 0?s:F(Mg())}function A(){var T=Mg(),x=D(T);if(n=arguments,i=this,u=T,x){if(a===void 0)return m(u);if(f)return a=setTimeout(_,e),d(u)}return a===void 0&&(a=setTimeout(_,e)),s}return A.cancel=g,A.flush=C,A}function e9(t,e,r){var n=!0,i=!0;if(typeof t!="function")throw new TypeError(HS);return lf(r)&&(n="leading"in r?!!r.leading:n,i="trailing"in r?!!r.trailing:i),QU(t,e,{leading:n,maxWait:e,trailing:i})}function lf(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function t9(t){return!!t&&typeof t=="object"}function r9(t){return typeof t=="symbol"||t9(t)&&JU.call(t)==qU}function US(t){if(typeof t=="number")return t;if(r9(t))return MS;if(lf(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=lf(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=t.replace(MU,"");var r=HU.test(t);return r||VU.test(t)?zU(t.slice(2),r?2:8):UU.test(t)?MS:+t}VS.exports=e9});var e1=y(hf=>{"use strict";Object.defineProperty(hf,"__esModule",{value:!0});hf.default=void 0;var n9=XS(require("http")),i9=XS(require("https")),KS=require("stream"),o9=require("url"),YS=s9(zS());function s9(t){return t&&t.__esModule?t:{default:t}}function JS(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,r=new WeakMap;return(JS=function(n){return n?r:e})(t)}function XS(t,e){if(!e&&t&&t.__esModule)return t;if(t===null||typeof t!="object"&&typeof t!="function")return{default:t};var r=JS(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 a9(t,e,r){return e=cf(e),u9(t,ZS()?Reflect.construct(e,r||[],cf(t).constructor):e.apply(t,r))}function u9(t,e){if(e&&(cs(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return l9(t)}function l9(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function ZS(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(ZS=function(){return!!t})()}function cf(t){return cf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},cf(t)}function c9(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&&Ug(t,e)}function Ug(t,e){return Ug=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Ug(t,e)}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 Cu(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){f9(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 f9(t,e,r){return e=QS(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function cs(t){"@babel/helpers - typeof";return cs=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},cs(t)}function ff(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,QS(n.key),n)}}function df(t,e,r){return e&&WS(t.prototype,e),r&&WS(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function QS(t){var e=d9(t,"string");return cs(e)=="symbol"?e:e+""}function d9(t,e){if(cs(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(cs(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Ale=hf.default=function(){function t(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};ff(this,t),this._requestOptions=e}return df(t,[{key:"createRequest",value:function(r,n){return new h9(r,n,this._requestOptions)}},{key:"getName",value:function(){return"NodeHttpStack"}}])}(),h9=function(){function t(e,r,n){ff(this,t),this._method=e,this._url=r,this._headers={},this._request=null,this._progressHandler=function(){},this._requestOptions=n||{}}return df(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=Cu(Cu(Cu({},(0,o9.parse)(r._url)),r._requestOptions),{},{method:r._method,headers:Cu(Cu({},r._requestOptions.headers||{}),r._headers)});n!=null&&n.size&&(s.headers["Content-Length"]=n.size);var a=s.protocol==="https:"?i9:n9;r._request=a.request(s);var u=r._request;u.on("response",function(l){var c=[];l.on("data",function(f){c.push(f)}),l.on("end",function(){var f=Buffer.concat(c).toString("utf8");i(new p9(l,f))})}),u.on("error",function(l){o(l)}),n instanceof KS.Readable?n.pipe(new m9(r._progressHandler)).pipe(u):n instanceof Uint8Array?g9(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}}])}(),p9=function(){function t(e,r){ff(this,t),this._response=e,this._body=r}return df(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}}])}(),m9=function(t){function e(r){var n;return ff(this,e),n=a9(this,e),n._onprogress=(0,YS.default)(r,100,{leading:!0,trailing:!1}),n._position=0,n}return c9(e,t),df(e,[{key:"_transform",value:function(n,i,o){this._position+=n.length,this._onprogress(this._position),o(null,n)}}])}(KS.Transform),g9=function(e,r,n){n=(0,YS.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 t1=y(Hg=>{"use strict";Hg.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};Hg.root=function(t,e,r){var n=this,i,o={stackLength:Error.stackTraceLimit,rootOnly:!0},s="",a=Error.stackTraceLimit,u;function l(){u[0]=n.toString(),n.stack=u.join(`
|
|
31
31
|
`)}(!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(c){switch(c){case"code":i=t.code||void 0;break;case"message":s=t.message||"";break;default:n[c]=t[c]}}),Error.stackTraceLimit=o.stackLength+2,u=new Error().stack.split(`
|
|
32
32
|
`),u.splice(0,3),u.unshift(""),Error.stackTraceLimit=a,this.stack=u.join(`
|
|
33
|
-
`),Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,get:function(){return i},set:function(c){i=c,l()}}),Object.defineProperty(this,"message",{configurable:!0,enumerable:!0,get:function(){return s},set:function(c){s=c,l()}}),l())}});var n1=y((Ale,r1)=>{"use strict";r1.exports=Ii;Ii.factory=e1();var Gg=Ii("CustomError");Gg.order=Ii(Gg,{message:"Arguments out of order.",code:"EOARG"});function Ii(t,e,r,n){var i,o;return e=pf(arguments,1,Error,t1,[Vg,mf]),r=pf(arguments,2,{},Vg,[mf]),n=pf(arguments,3,zg,mf,[]),t=pf(arguments,0,e===Error?"Error":e.prototype.CustomError.name,g9,[t1,Vg,mf]),o=e===Error,o&&n===zg&&(n=Ii.factory.root),i=function(s,a){var u,l,c,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={}),l=this.CustomError.chain.slice(0).reverse().map(function(m){return m.properties}),l.push(s),l.unshift({}),d=Object.assign.apply(Object,l),u=this,c={},Object.keys(Ii.factory).forEach(function(m){c[m]=function(b,D){Ii.factory[m].call(u,b,D,c)}}),f=this.CustomError.chain.length-1;f>=0;f--)h=this.CustomError.chain[f],h.factory!==zg&&h.factory.call(this,d,a,c)},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 pf(t,e,r,n,i){var o=-1,s=-1,a,u,l=e<t.length?e:t.length,c;for(a=0;a<=l;a++){if(c=t[a],o===-1)for(u=0;u<i.length;u++)i[u](c)&&(o=a);s===-1&&n(c)&&(s=a)}if(s!==-1&&o!==-1&&o<s)throw new Gg.order;return s!==-1?t[s]:r}function mf(t){return typeof t=="function"&&t!==Error&&!t.prototype.CustomError}function g9(t){return typeof t=="string"}function t1(t){return typeof t=="function"&&(t===Error||t.prototype.CustomError)}function Vg(t){return t&&typeof t=="object"}function zg(){}});var o1=y((kle,i1)=>{i1.exports=n1()});var c1=y((ji,fs)=>{var y9=1/0,D9="[object Symbol]",Su={function:!0,object:!0},v9=Su[typeof ji]&&ji&&!ji.nodeType?ji:void 0,b9=Su[typeof fs]&&fs&&!fs.nodeType?fs:void 0,w9=gf(v9&&b9&&typeof global=="object"&&global),_9=gf(Su[typeof self]&&self),s1=gf(Su[typeof window]&&window),Wg=gf(Su[typeof ji]&&ji),E9=w9||s1!==(Wg&&Wg.window)&&s1||_9||Wg||Function("return this")();function gf(t){return t&&t.Object===Object?t:null}var C9=Object.prototype,S9=C9.toString,a1=E9.Symbol,u1=a1?a1.prototype:void 0,l1=u1?u1.toString:void 0;function x9(t){if(typeof t=="string")return t;if(O9(t))return l1?l1.call(t):"";var e=t+"";return e=="0"&&1/t==-y9?"-0":e}function F9(t){return!!t&&typeof t=="object"}function O9(t){return typeof t=="symbol"||F9(t)&&S9.call(t)==D9}fs.exports=x9});var y1=y((Ni,ds)=>{var A9=c1(),k9="Expected a function",d1="__lodash_hash_undefined__",T9="[object Function]",P9="[object GeneratorFunction]",R9=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]/g,$9=/[\\^$.*+?()[\]{}|]/g,I9=/\\(\\)?/g,j9=/^\[object .+?Constructor\]$/,Fu={function:!0,object:!0},N9=Fu[typeof Ni]&&Ni&&!Ni.nodeType?Ni:void 0,L9=Fu[typeof ds]&&ds&&!ds.nodeType?ds:void 0,B9=yf(N9&&L9&&typeof global=="object"&&global),q9=yf(Fu[typeof self]&&self),f1=yf(Fu[typeof window]&&window),Kg=yf(Fu[typeof Ni]&&Ni),M9=B9||f1!==(Kg&&Kg.window)&&f1||q9||Kg||Function("return this")();function yf(t){return t&&t.Object===Object?t:null}function U9(t){var e=!1;if(t!=null&&typeof t.toString!="function")try{e=!!(t+"")}catch{}return e}var H9=Array.prototype,h1=Object.prototype,p1=Function.prototype.toString,Yg=h1.hasOwnProperty,V9=h1.toString,z9=RegExp("^"+p1.call(Yg).replace($9,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),G9=H9.splice,W9=m1(M9,"Map"),xu=m1(Object,"create");function Li(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 K9(){this.__data__=xu?xu(null):{}}function Y9(t){return this.has(t)&&delete this.__data__[t]}function J9(t){var e=this.__data__;if(xu){var r=e[t];return r===d1?void 0:r}return Yg.call(e,t)?e[t]:void 0}function X9(t){var e=this.__data__;return xu?e[t]!==void 0:Yg.call(e,t)}function Z9(t,e){var r=this.__data__;return r[t]=xu&&e===void 0?d1:e,this}Li.prototype.clear=K9;Li.prototype.delete=Y9;Li.prototype.get=J9;Li.prototype.has=X9;Li.prototype.set=Z9;function hs(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 Q9(){this.__data__=[]}function e7(t){var e=this.__data__,r=Df(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():G9.call(e,r,1),!0}function t7(t){var e=this.__data__,r=Df(e,t);return r<0?void 0:e[r][1]}function r7(t){return Df(this.__data__,t)>-1}function n7(t,e){var r=this.__data__,n=Df(r,t);return n<0?r.push([t,e]):r[n][1]=e,this}hs.prototype.clear=Q9;hs.prototype.delete=e7;hs.prototype.get=t7;hs.prototype.has=r7;hs.prototype.set=n7;function Bi(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 i7(){this.__data__={hash:new Li,map:new(W9||hs),string:new Li}}function o7(t){return vf(this,t).delete(t)}function s7(t){return vf(this,t).get(t)}function a7(t){return vf(this,t).has(t)}function u7(t,e){return vf(this,t).set(t,e),this}Bi.prototype.clear=i7;Bi.prototype.delete=o7;Bi.prototype.get=s7;Bi.prototype.has=a7;Bi.prototype.set=u7;function Df(t,e){for(var r=t.length;r--;)if(d7(t[r][0],e))return r;return-1}function vf(t,e){var r=t.__data__;return l7(e)?r[typeof e=="string"?"string":"hash"]:r.map}function m1(t,e){var r=t[e];return p7(r)?r:void 0}function l7(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}var c7=Jg(function(t){var e=[];return m7(t).replace(R9,function(r,n,i,o){e.push(i?o.replace(I9,"$1"):n||r)}),e});function f7(t){if(t!=null){try{return p1.call(t)}catch{}try{return t+""}catch{}}return""}function Jg(t,e){if(typeof t!="function"||e&&typeof e!="function")throw new TypeError(k9);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(Jg.Cache||Bi),r}Jg.Cache=Bi;function d7(t,e){return t===e||t!==t&&e!==e}function h7(t){var e=g1(t)?V9.call(t):"";return e==T9||e==P9}function g1(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function p7(t){if(!g1(t))return!1;var e=h7(t)||U9(t)?z9:j9;return e.test(f7(t))}function m7(t){return t==null?"":A9(t)}ds.exports=c7});var W1=y((qi,ms)=>{var g7=y1(),y7=200,ay="__lodash_hash_undefined__",Cf=1,gs=2,D7=1/0,E1=9007199254740991,bf="[object Arguments]",Qg="[object Array]",C1="[object Boolean]",S1="[object Date]",x1="[object Error]",F1="[object Function]",v7="[object GeneratorFunction]",Ou="[object Map]",O1="[object Number]",ps="[object Object]",D1="[object Promise]",A1="[object RegExp]",Au="[object Set]",uy="[object String]",k1="[object Symbol]",ey="[object WeakMap]",T1="[object ArrayBuffer]",wf="[object DataView]",b7="[object Float32Array]",w7="[object Float64Array]",_7="[object Int8Array]",E7="[object Int16Array]",C7="[object Int32Array]",S7="[object Uint8Array]",x7="[object Uint8ClampedArray]",F7="[object Uint16Array]",O7="[object Uint32Array]",A7=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,k7=/^\w*$/,T7=/[\\^$.*+?()[\]{}|]/g,P7=/^\[object .+?Constructor\]$/,R7=/^(?:0|[1-9]\d*)$/,Re={};Re[b7]=Re[w7]=Re[_7]=Re[E7]=Re[C7]=Re[S7]=Re[x7]=Re[F7]=Re[O7]=!0;Re[bf]=Re[Qg]=Re[T1]=Re[C1]=Re[wf]=Re[S1]=Re[x1]=Re[F1]=Re[Ou]=Re[O1]=Re[ps]=Re[A1]=Re[Au]=Re[uy]=Re[ey]=!1;var Tu={function:!0,object:!0},$7=Tu[typeof qi]&&qi&&!qi.nodeType?qi:void 0,I7=Tu[typeof ms]&&ms&&!ms.nodeType?ms:void 0,j7=Sf($7&&I7&&typeof global=="object"&&global),N7=Sf(Tu[typeof self]&&self),v1=Sf(Tu[typeof window]&&window),Xg=Sf(Tu[typeof qi]&&qi),Hi=j7||v1!==(Xg&&Xg.window)&&v1||N7||Xg||Function("return this")();function L7(t,e){for(var r=-1,n=t.length,i=Array(n);++r<n;)i[r]=e(t[r],r,t);return i}function B7(t,e){for(var r=-1,n=t.length;++r<n;)if(e(t[r],r,t))return!0;return!1}function q7(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}function M7(t,e){return L7(e,function(r){return[r,t[r]]})}function Sf(t){return t&&t.Object===Object?t:null}function ty(t){var e=!1;if(t!=null&&typeof t.toString!="function")try{e=!!(t+"")}catch{}return e}function P1(t){var e=-1,r=Array(t.size);return t.forEach(function(n,i){r[++e]=[i,n]}),r}function U7(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}function H7(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=[n,n]}),r}var V7=Array.prototype,xf=Object.prototype,R1=Function.prototype.toString,Mi=xf.hasOwnProperty,Vi=xf.toString,z7=RegExp("^"+R1.call(Mi).replace(T7,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),b1=Hi.Symbol,w1=Hi.Uint8Array,G7=xf.propertyIsEnumerable,W7=V7.splice,K7=Object.getPrototypeOf,Y7=Object.keys,ry=ys(Hi,"DataView"),_f=ys(Hi,"Map"),ny=ys(Hi,"Promise"),iy=ys(Hi,"Set"),oy=ys(Hi,"WeakMap"),ku=ys(Object,"create"),J7=Gi(ry),X7=Gi(_f),Z7=Gi(ny),Q7=Gi(iy),eH=Gi(oy),_1=b1?b1.prototype:void 0,Zg=_1?_1.valueOf:void 0;function Ui(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 tH(){this.__data__=ku?ku(null):{}}function rH(t){return this.has(t)&&delete this.__data__[t]}function nH(t){var e=this.__data__;if(ku){var r=e[t];return r===ay?void 0:r}return Mi.call(e,t)?e[t]:void 0}function iH(t){var e=this.__data__;return ku?e[t]!==void 0:Mi.call(e,t)}function oH(t,e){var r=this.__data__;return r[t]=ku&&e===void 0?ay:e,this}Ui.prototype.clear=tH;Ui.prototype.delete=rH;Ui.prototype.get=nH;Ui.prototype.has=iH;Ui.prototype.set=oH;function mn(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 sH(){this.__data__=[]}function aH(t){var e=this.__data__,r=Ff(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():W7.call(e,r,1),!0}function uH(t){var e=this.__data__,r=Ff(e,t);return r<0?void 0:e[r][1]}function lH(t){return Ff(this.__data__,t)>-1}function cH(t,e){var r=this.__data__,n=Ff(r,t);return n<0?r.push([t,e]):r[n][1]=e,this}mn.prototype.clear=sH;mn.prototype.delete=aH;mn.prototype.get=uH;mn.prototype.has=lH;mn.prototype.set=cH;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 fH(){this.__data__={hash:new Ui,map:new(_f||mn),string:new Ui}}function dH(t){return Of(this,t).delete(t)}function hH(t){return Of(this,t).get(t)}function pH(t){return Of(this,t).has(t)}function mH(t,e){return Of(this,t).set(t,e),this}zi.prototype.clear=fH;zi.prototype.delete=dH;zi.prototype.get=hH;zi.prototype.has=pH;zi.prototype.set=mH;function Ef(t){var e=-1,r=t?t.length:0;for(this.__data__=new zi;++e<r;)this.add(t[e])}function gH(t){return this.__data__.set(t,ay),this}function yH(t){return this.__data__.has(t)}Ef.prototype.add=Ef.prototype.push=gH;Ef.prototype.has=yH;function pn(t){this.__data__=new mn(t)}function DH(){this.__data__=new mn}function vH(t){return this.__data__.delete(t)}function bH(t){return this.__data__.get(t)}function wH(t){return this.__data__.has(t)}function _H(t,e){var r=this.__data__;return r instanceof mn&&r.__data__.length==y7&&(r=this.__data__=new zi(r.__data__)),r.set(t,e),this}pn.prototype.clear=DH;pn.prototype.delete=vH;pn.prototype.get=bH;pn.prototype.has=wH;pn.prototype.set=_H;function Ff(t,e){for(var r=t.length;r--;)if(MH(t[r][0],e))return r;return-1}function $1(t,e){e=Af(e,t)?[e]:N1(e);for(var r=0,n=e.length;t!=null&&r<n;)t=t[kf(e[r++])];return r&&r==n?t:void 0}function I1(t,e){return Mi.call(t,e)||typeof t=="object"&&e in t&&jH(t)===null}function EH(t,e){return e in Object(t)}function ly(t,e,r,n,i){return t===e?!0:t==null||e==null||!Pf(t)&&!Pu(e)?t!==t&&e!==e:CH(t,e,ly,r,n,i)}function CH(t,e,r,n,i,o){var s=Yn(t),a=Yn(e),u=Qg,l=Qg;s||(u=hn(t),u=u==bf?ps:u),a||(l=hn(e),l=l==bf?ps:l);var c=u==ps&&!ty(t),f=l==ps&&!ty(e),h=u==l;if(h&&!c)return o||(o=new pn),s||VH(t)?L1(t,e,r,n,i,o):PH(t,e,u,r,n,i,o);if(!(i&gs)){var d=c&&Mi.call(t,"__wrapped__"),m=f&&Mi.call(e,"__wrapped__");if(d||m){var b=d?t.value():t,D=m?e.value():e;return o||(o=new pn),r(b,D,n,i,o)}}return h?(o||(o=new pn),RH(t,e,r,n,i,o)):!1}function SH(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],l=t[u],c=a[1];if(s&&a[2]){if(l===void 0&&!(u in t))return!1}else{var f=new pn;if(n)var h=n(l,c,u,t,e,f);if(!(h===void 0?ly(c,l,n,Cf|gs,f):h))return!1}}return!0}function xH(t){return typeof t=="function"?t:t==null?KH:typeof t=="object"?Yn(t)?AH(t[0],t[1]):OH(t):YH(t)}function FH(t){return Y7(Object(t))}function OH(t){var e=IH(t);return e.length==1&&e[0][2]?M1(e[0][0],e[0][1]):function(r){return r===t||SH(r,t,e)}}function AH(t,e){return Af(t)&&q1(e)?M1(kf(t),e):function(r){var n=zH(r,t);return n===void 0&&n===e?GH(r,t):ly(e,n,void 0,Cf|gs)}}function j1(t){return function(e){return e?.[t]}}function kH(t){return function(e){return $1(e,t)}}function N1(t){return Yn(t)?t:g7(t)}function TH(t){return function(e){var r=hn(e);return r==Ou?P1(e):r==Au?H7(e):M7(e,t(e))}}function L1(t,e,r,n,i,o){var s=i&gs,a=t.length,u=e.length;if(a!=u&&!(s&&u>a))return!1;var l=o.get(t);if(l)return l==e;var c=-1,f=!0,h=i&Cf?new Ef:void 0;for(o.set(t,e);++c<a;){var d=t[c],m=e[c];if(n)var b=s?n(m,d,c,e,t,o):n(d,m,c,t,e,o);if(b!==void 0){if(b)continue;f=!1;break}if(h){if(!B7(e,function(D,_){if(!h.has(_)&&(d===D||r(d,D,n,i,o)))return h.add(_)})){f=!1;break}}else if(!(d===m||r(d,m,n,i,o))){f=!1;break}}return o.delete(t),f}function PH(t,e,r,n,i,o,s){switch(r){case wf:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case T1:return!(t.byteLength!=e.byteLength||!n(new w1(t),new w1(e)));case C1:case S1:return+t==+e;case x1:return t.name==e.name&&t.message==e.message;case O1:return t!=+t?e!=+e:t==+e;case A1:case uy:return t==e+"";case Ou:var a=P1;case Au:var u=o&gs;if(a||(a=U7),t.size!=e.size&&!u)return!1;var l=s.get(t);return l?l==e:(o|=Cf,s.set(t,e),L1(a(t),a(e),n,i,o,s));case k1:if(Zg)return Zg.call(t)==Zg.call(e)}return!1}function RH(t,e,r,n,i,o){var s=i&gs,a=sy(t),u=a.length,l=sy(e),c=l.length;if(u!=c&&!s)return!1;for(var f=u;f--;){var h=a[f];if(!(s?h in e:I1(e,h)))return!1}var d=o.get(t);if(d)return d==e;var m=!0;o.set(t,e);for(var b=s;++f<u;){h=a[f];var D=t[h],_=e[h];if(n)var F=s?n(_,D,h,e,t,o):n(D,_,h,t,e,o);if(!(F===void 0?D===_||r(D,_,n,i,o):F)){m=!1;break}b||(b=h=="constructor")}if(m&&!b){var g=t.constructor,C=e.constructor;g!=C&&"constructor"in t&&"constructor"in e&&!(typeof g=="function"&&g instanceof g&&typeof C=="function"&&C instanceof C)&&(m=!1)}return o.delete(t),m}var $H=j1("length");function Of(t,e){var r=t.__data__;return BH(e)?r[typeof e=="string"?"string":"hash"]:r.map}function IH(t){for(var e=WH(t),r=e.length;r--;)e[r][2]=q1(e[r][1]);return e}function ys(t,e){var r=t[e];return HH(r)?r:void 0}function jH(t){return K7(Object(t))}function hn(t){return Vi.call(t)}(ry&&hn(new ry(new ArrayBuffer(1)))!=wf||_f&&hn(new _f)!=Ou||ny&&hn(ny.resolve())!=D1||iy&&hn(new iy)!=Au||oy&&hn(new oy)!=ey)&&(hn=function(t){var e=Vi.call(t),r=e==ps?t.constructor:void 0,n=r?Gi(r):void 0;if(n)switch(n){case J7:return wf;case X7:return Ou;case Z7:return D1;case Q7:return Au;case eH:return ey}return e});function NH(t,e,r){e=Af(e,t)?[e]:N1(e);for(var n,i=-1,s=e.length;++i<s;){var o=kf(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&&Tf(s)&&B1(o,s)&&(Yn(t)||z1(t)||U1(t))}function LH(t){var e=t?t.length:void 0;return Tf(e)&&(Yn(t)||z1(t)||U1(t))?q7(e,String):null}function B1(t,e){return e=e??E1,!!e&&(typeof t=="number"||R7.test(t))&&t>-1&&t%1==0&&t<e}function Af(t,e){if(Yn(t))return!1;var r=typeof t;return r=="number"||r=="symbol"||r=="boolean"||t==null||G1(t)?!0:k7.test(t)||!A7.test(t)||e!=null&&t in Object(e)}function BH(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function qH(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||xf;return t===r}function q1(t){return t===t&&!Pf(t)}function M1(t,e){return function(r){return r==null?!1:r[t]===e&&(e!==void 0||t in Object(r))}}function kf(t){if(typeof t=="string"||G1(t))return t;var e=t+"";return e=="0"&&1/t==-D7?"-0":e}function Gi(t){if(t!=null){try{return R1.call(t)}catch{}try{return t+""}catch{}}return""}function MH(t,e){return t===e||t!==t&&e!==e}function U1(t){return UH(t)&&Mi.call(t,"callee")&&(!G7.call(t,"callee")||Vi.call(t)==bf)}var Yn=Array.isArray;function H1(t){return t!=null&&Tf($H(t))&&!V1(t)}function UH(t){return Pu(t)&&H1(t)}function V1(t){var e=Pf(t)?Vi.call(t):"";return e==F1||e==v7}function Tf(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=E1}function Pf(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function Pu(t){return!!t&&typeof t=="object"}function HH(t){if(!Pf(t))return!1;var e=V1(t)||ty(t)?z7:P7;return e.test(Gi(t))}function z1(t){return typeof t=="string"||!Yn(t)&&Pu(t)&&Vi.call(t)==uy}function G1(t){return typeof t=="symbol"||Pu(t)&&Vi.call(t)==k1}function VH(t){return Pu(t)&&Tf(t.length)&&!!Re[Vi.call(t)]}function zH(t,e,r){var n=t==null?void 0:$1(t,e);return n===void 0?r:n}function GH(t,e){return t!=null&&NH(t,e,EH)}function sy(t){var e=qH(t);if(!(e||H1(t)))return FH(t);var r=LH(t),n=!!r,i=r||[],o=i.length;for(var s in t)I1(t,s)&&!(n&&(s=="length"||B1(s,o)))&&!(e&&s=="constructor")&&i.push(s);return i}var WH=TH(sy);function KH(t){return t}function YH(t){return Af(t)?j1(kf(t)):kH(t)}ms.exports=xH});var Z1=y((Wi,Ds)=>{var JH=1/0,XH="[object Function]",ZH="[object GeneratorFunction]",QH=/[\\^$.*+?()[\]{}|]/g,eV=/^\[object .+?Constructor\]$/,Ru={function:!0,object:!0},tV=Ru[typeof Wi]&&Wi&&!Wi.nodeType?Wi:void 0,rV=Ru[typeof Ds]&&Ds&&!Ds.nodeType?Ds:void 0,nV=Rf(tV&&rV&&typeof global=="object"&&global),iV=Rf(Ru[typeof self]&&self),K1=Rf(Ru[typeof window]&&window),cy=Rf(Ru[typeof Wi]&&Wi),oV=nV||K1!==(cy&&cy.window)&&K1||iV||cy||Function("return this")();function Rf(t){return t&&t.Object===Object?t:null}function sV(t){var e=!1;if(t!=null&&typeof t.toString!="function")try{e=!!(t+"")}catch{}return e}function aV(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}var Y1=Object.prototype,J1=Function.prototype.toString,uV=Y1.hasOwnProperty,lV=Y1.toString,cV=RegExp("^"+J1.call(uV).replace(QH,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),fy=dV(oV,"Set"),fV=fy&&1/aV(new fy([,-0]))[1]==JH?function(t){return new fy(t)}:gV;function dV(t,e){var r=t[e];return mV(r)?r:void 0}function hV(t){if(t!=null){try{return J1.call(t)}catch{}try{return t+""}catch{}}return""}function pV(t){var e=X1(t)?lV.call(t):"";return e==XH||e==ZH}function X1(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function mV(t){if(!X1(t))return!1;var e=pV(t)||sV(t)?cV:eV;return e.test(hV(t))}function gV(){}Ds.exports=fV});var ex=y((Ki,vs)=>{var $u={function:!0,object:!0},yV=$u[typeof Ki]&&Ki&&!Ki.nodeType?Ki:void 0,DV=$u[typeof vs]&&vs&&!vs.nodeType?vs:void 0,vV=$f(yV&&DV&&typeof global=="object"&&global),bV=$f($u[typeof self]&&self),Q1=$f($u[typeof window]&&window),dy=$f($u[typeof Ki]&&Ki),wV=vV||Q1!==(dy&&dy.window)&&Q1||bV||dy||Function("return this")();function $f(t){return t&&t.Object===Object?t:null}vs.exports=wV});var sx=y((Tle,ox)=>{var _V=Z1(),EV=ex(),CV=200,hy="__lodash_hash_undefined__",SV="[object Function]",xV="[object GeneratorFunction]",FV=/[\\^$.*+?()[\]{}|]/g,OV=/^\[object .+?Constructor\]$/;function AV(t,e){return!!t.length&&TV(t,e,0)>-1}function kV(t,e,r){for(var n=-1,i=t.length;++n<i;)if(r(e,t[n]))return!0;return!1}function TV(t,e,r){if(e!==e)return RV(t,r);for(var n=r-1,i=t.length;++n<i;)if(t[n]===e)return n;return-1}function PV(t,e){return t.has(e)}function RV(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 $V(t){var e=!1;if(t!=null&&typeof t.toString!="function")try{e=!!(t+"")}catch{}return e}function IV(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}var jV=Array.prototype,tx=Object.prototype,rx=Function.prototype.toString,py=tx.hasOwnProperty,NV=tx.toString,LV=RegExp("^"+rx.call(py).replace(FV,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),BV=jV.splice,qV=nx(EV,"Map"),Iu=nx(Object,"create");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 MV(){this.__data__=Iu?Iu(null):{}}function UV(t){return this.has(t)&&delete this.__data__[t]}function HV(t){var e=this.__data__;if(Iu){var r=e[t];return r===hy?void 0:r}return py.call(e,t)?e[t]:void 0}function VV(t){var e=this.__data__;return Iu?e[t]!==void 0:py.call(e,t)}function zV(t,e){var r=this.__data__;return r[t]=Iu&&e===void 0?hy:e,this}Yi.prototype.clear=MV;Yi.prototype.delete=UV;Yi.prototype.get=HV;Yi.prototype.has=VV;Yi.prototype.set=zV;function bs(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 GV(){this.__data__=[]}function WV(t){var e=this.__data__,r=jf(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():BV.call(e,r,1),!0}function KV(t){var e=this.__data__,r=jf(e,t);return r<0?void 0:e[r][1]}function YV(t){return jf(this.__data__,t)>-1}function JV(t,e){var r=this.__data__,n=jf(r,t);return n<0?r.push([t,e]):r[n][1]=e,this}bs.prototype.clear=GV;bs.prototype.delete=WV;bs.prototype.get=KV;bs.prototype.has=YV;bs.prototype.set=JV;function ws(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 XV(){this.__data__={hash:new Yi,map:new(qV||bs),string:new Yi}}function ZV(t){return Nf(this,t).delete(t)}function QV(t){return Nf(this,t).get(t)}function ez(t){return Nf(this,t).has(t)}function tz(t,e){return Nf(this,t).set(t,e),this}ws.prototype.clear=XV;ws.prototype.delete=ZV;ws.prototype.get=QV;ws.prototype.has=ez;ws.prototype.set=tz;function If(t){var e=-1,r=t?t.length:0;for(this.__data__=new ws;++e<r;)this.add(t[e])}function rz(t){return this.__data__.set(t,hy),this}function nz(t){return this.__data__.has(t)}If.prototype.add=If.prototype.push=rz;If.prototype.has=nz;function jf(t,e){for(var r=t.length;r--;)if(az(t[r][0],e))return r;return-1}function iz(t,e,r){var n=-1,i=AV,o=t.length,s=!0,a=[],u=a;if(r)s=!1,i=kV;else if(o>=CV){var l=e?null:_V(t);if(l)return IV(l);s=!1,i=PV,u=new If}else u=e?[]:a;e:for(;++n<o;){var c=t[n],f=e?e(c):c;if(c=r||c!==0?c:0,s&&f===f){for(var h=u.length;h--;)if(u[h]===f)continue e;e&&u.push(f),a.push(c)}else i(u,f,r)||(u!==a&&u.push(f),a.push(c))}return a}function Nf(t,e){var r=t.__data__;return oz(e)?r[typeof e=="string"?"string":"hash"]:r.map}function nx(t,e){var r=t[e];return lz(r)?r:void 0}function oz(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function sz(t){if(t!=null){try{return rx.call(t)}catch{}try{return t+""}catch{}}return""}function az(t,e){return t===e||t!==t&&e!==e}function uz(t){var e=ix(t)?NV.call(t):"";return e==SV||e==xV}function ix(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function lz(t){if(!ix(t))return!1;var e=uz(t)||$V(t)?LV:OV;return e.test(sz(t))}ox.exports=iz});var ux=y((Ple,ax)=>{var cz=W1(),fz=sx();function dz(t,e){return t&&t.length?fz(t,cz(e)):[]}ax.exports=dz});var cx=y((Rle,lx)=>{"use strict";var hz=o1(),pz=ux(),mz=hz("MultiError");lx.exports=my;function my(t){if(!(this instanceof my))return new my(t);if(t=Array.isArray(t)?t:[t],t=pz(t,function(r){return r.stack}),t.length===1)return t[0];var e=new mz({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(`
|
|
33
|
+
`),Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,get:function(){return i},set:function(c){i=c,l()}}),Object.defineProperty(this,"message",{configurable:!0,enumerable:!0,get:function(){return s},set:function(c){s=c,l()}}),l())}});var i1=y((Ple,n1)=>{"use strict";n1.exports=Ii;Ii.factory=t1();var Gg=Ii("CustomError");Gg.order=Ii(Gg,{message:"Arguments out of order.",code:"EOARG"});function Ii(t,e,r,n){var i,o;return e=pf(arguments,1,Error,r1,[Vg,mf]),r=pf(arguments,2,{},Vg,[mf]),n=pf(arguments,3,zg,mf,[]),t=pf(arguments,0,e===Error?"Error":e.prototype.CustomError.name,y9,[r1,Vg,mf]),o=e===Error,o&&n===zg&&(n=Ii.factory.root),i=function(s,a){var u,l,c,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={}),l=this.CustomError.chain.slice(0).reverse().map(function(m){return m.properties}),l.push(s),l.unshift({}),d=Object.assign.apply(Object,l),u=this,c={},Object.keys(Ii.factory).forEach(function(m){c[m]=function(b,D){Ii.factory[m].call(u,b,D,c)}}),f=this.CustomError.chain.length-1;f>=0;f--)h=this.CustomError.chain[f],h.factory!==zg&&h.factory.call(this,d,a,c)},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 pf(t,e,r,n,i){var o=-1,s=-1,a,u,l=e<t.length?e:t.length,c;for(a=0;a<=l;a++){if(c=t[a],o===-1)for(u=0;u<i.length;u++)i[u](c)&&(o=a);s===-1&&n(c)&&(s=a)}if(s!==-1&&o!==-1&&o<s)throw new Gg.order;return s!==-1?t[s]:r}function mf(t){return typeof t=="function"&&t!==Error&&!t.prototype.CustomError}function y9(t){return typeof t=="string"}function r1(t){return typeof t=="function"&&(t===Error||t.prototype.CustomError)}function Vg(t){return t&&typeof t=="object"}function zg(){}});var s1=y((Rle,o1)=>{o1.exports=i1()});var f1=y((ji,fs)=>{var D9=1/0,v9="[object Symbol]",Su={function:!0,object:!0},b9=Su[typeof ji]&&ji&&!ji.nodeType?ji:void 0,w9=Su[typeof fs]&&fs&&!fs.nodeType?fs:void 0,_9=gf(b9&&w9&&typeof global=="object"&&global),E9=gf(Su[typeof self]&&self),a1=gf(Su[typeof window]&&window),Wg=gf(Su[typeof ji]&&ji),C9=_9||a1!==(Wg&&Wg.window)&&a1||E9||Wg||Function("return this")();function gf(t){return t&&t.Object===Object?t:null}var S9=Object.prototype,x9=S9.toString,u1=C9.Symbol,l1=u1?u1.prototype:void 0,c1=l1?l1.toString:void 0;function F9(t){if(typeof t=="string")return t;if(A9(t))return c1?c1.call(t):"";var e=t+"";return e=="0"&&1/t==-D9?"-0":e}function O9(t){return!!t&&typeof t=="object"}function A9(t){return typeof t=="symbol"||O9(t)&&x9.call(t)==v9}fs.exports=F9});var D1=y((Ni,ds)=>{var k9=f1(),T9="Expected a function",h1="__lodash_hash_undefined__",P9="[object Function]",R9="[object GeneratorFunction]",$9=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]/g,I9=/[\\^$.*+?()[\]{}|]/g,j9=/\\(\\)?/g,N9=/^\[object .+?Constructor\]$/,Fu={function:!0,object:!0},L9=Fu[typeof Ni]&&Ni&&!Ni.nodeType?Ni:void 0,B9=Fu[typeof ds]&&ds&&!ds.nodeType?ds:void 0,q9=yf(L9&&B9&&typeof global=="object"&&global),M9=yf(Fu[typeof self]&&self),d1=yf(Fu[typeof window]&&window),Kg=yf(Fu[typeof Ni]&&Ni),U9=q9||d1!==(Kg&&Kg.window)&&d1||M9||Kg||Function("return this")();function yf(t){return t&&t.Object===Object?t:null}function H9(t){var e=!1;if(t!=null&&typeof t.toString!="function")try{e=!!(t+"")}catch{}return e}var V9=Array.prototype,p1=Object.prototype,m1=Function.prototype.toString,Yg=p1.hasOwnProperty,z9=p1.toString,G9=RegExp("^"+m1.call(Yg).replace(I9,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),W9=V9.splice,K9=g1(U9,"Map"),xu=g1(Object,"create");function Li(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 Y9(){this.__data__=xu?xu(null):{}}function J9(t){return this.has(t)&&delete this.__data__[t]}function X9(t){var e=this.__data__;if(xu){var r=e[t];return r===h1?void 0:r}return Yg.call(e,t)?e[t]:void 0}function Z9(t){var e=this.__data__;return xu?e[t]!==void 0:Yg.call(e,t)}function Q9(t,e){var r=this.__data__;return r[t]=xu&&e===void 0?h1:e,this}Li.prototype.clear=Y9;Li.prototype.delete=J9;Li.prototype.get=X9;Li.prototype.has=Z9;Li.prototype.set=Q9;function hs(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 e7(){this.__data__=[]}function t7(t){var e=this.__data__,r=Df(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():W9.call(e,r,1),!0}function r7(t){var e=this.__data__,r=Df(e,t);return r<0?void 0:e[r][1]}function n7(t){return Df(this.__data__,t)>-1}function i7(t,e){var r=this.__data__,n=Df(r,t);return n<0?r.push([t,e]):r[n][1]=e,this}hs.prototype.clear=e7;hs.prototype.delete=t7;hs.prototype.get=r7;hs.prototype.has=n7;hs.prototype.set=i7;function Bi(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 o7(){this.__data__={hash:new Li,map:new(K9||hs),string:new Li}}function s7(t){return vf(this,t).delete(t)}function a7(t){return vf(this,t).get(t)}function u7(t){return vf(this,t).has(t)}function l7(t,e){return vf(this,t).set(t,e),this}Bi.prototype.clear=o7;Bi.prototype.delete=s7;Bi.prototype.get=a7;Bi.prototype.has=u7;Bi.prototype.set=l7;function Df(t,e){for(var r=t.length;r--;)if(h7(t[r][0],e))return r;return-1}function vf(t,e){var r=t.__data__;return c7(e)?r[typeof e=="string"?"string":"hash"]:r.map}function g1(t,e){var r=t[e];return m7(r)?r:void 0}function c7(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}var f7=Jg(function(t){var e=[];return g7(t).replace($9,function(r,n,i,o){e.push(i?o.replace(j9,"$1"):n||r)}),e});function d7(t){if(t!=null){try{return m1.call(t)}catch{}try{return t+""}catch{}}return""}function Jg(t,e){if(typeof t!="function"||e&&typeof e!="function")throw new TypeError(T9);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(Jg.Cache||Bi),r}Jg.Cache=Bi;function h7(t,e){return t===e||t!==t&&e!==e}function p7(t){var e=y1(t)?z9.call(t):"";return e==P9||e==R9}function y1(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function m7(t){if(!y1(t))return!1;var e=p7(t)||H9(t)?G9:N9;return e.test(d7(t))}function g7(t){return t==null?"":k9(t)}ds.exports=f7});var K1=y((qi,ms)=>{var y7=D1(),D7=200,ay="__lodash_hash_undefined__",Cf=1,gs=2,v7=1/0,C1=9007199254740991,bf="[object Arguments]",Qg="[object Array]",S1="[object Boolean]",x1="[object Date]",F1="[object Error]",O1="[object Function]",b7="[object GeneratorFunction]",Ou="[object Map]",A1="[object Number]",ps="[object Object]",v1="[object Promise]",k1="[object RegExp]",Au="[object Set]",uy="[object String]",T1="[object Symbol]",ey="[object WeakMap]",P1="[object ArrayBuffer]",wf="[object DataView]",w7="[object Float32Array]",_7="[object Float64Array]",E7="[object Int8Array]",C7="[object Int16Array]",S7="[object Int32Array]",x7="[object Uint8Array]",F7="[object Uint8ClampedArray]",O7="[object Uint16Array]",A7="[object Uint32Array]",k7=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,T7=/^\w*$/,P7=/[\\^$.*+?()[\]{}|]/g,R7=/^\[object .+?Constructor\]$/,$7=/^(?:0|[1-9]\d*)$/,Re={};Re[w7]=Re[_7]=Re[E7]=Re[C7]=Re[S7]=Re[x7]=Re[F7]=Re[O7]=Re[A7]=!0;Re[bf]=Re[Qg]=Re[P1]=Re[S1]=Re[wf]=Re[x1]=Re[F1]=Re[O1]=Re[Ou]=Re[A1]=Re[ps]=Re[k1]=Re[Au]=Re[uy]=Re[ey]=!1;var Tu={function:!0,object:!0},I7=Tu[typeof qi]&&qi&&!qi.nodeType?qi:void 0,j7=Tu[typeof ms]&&ms&&!ms.nodeType?ms:void 0,N7=Sf(I7&&j7&&typeof global=="object"&&global),L7=Sf(Tu[typeof self]&&self),b1=Sf(Tu[typeof window]&&window),Xg=Sf(Tu[typeof qi]&&qi),Hi=N7||b1!==(Xg&&Xg.window)&&b1||L7||Xg||Function("return this")();function B7(t,e){for(var r=-1,n=t.length,i=Array(n);++r<n;)i[r]=e(t[r],r,t);return i}function q7(t,e){for(var r=-1,n=t.length;++r<n;)if(e(t[r],r,t))return!0;return!1}function M7(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}function U7(t,e){return B7(e,function(r){return[r,t[r]]})}function Sf(t){return t&&t.Object===Object?t:null}function ty(t){var e=!1;if(t!=null&&typeof t.toString!="function")try{e=!!(t+"")}catch{}return e}function R1(t){var e=-1,r=Array(t.size);return t.forEach(function(n,i){r[++e]=[i,n]}),r}function H7(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}function V7(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=[n,n]}),r}var z7=Array.prototype,xf=Object.prototype,$1=Function.prototype.toString,Mi=xf.hasOwnProperty,Vi=xf.toString,G7=RegExp("^"+$1.call(Mi).replace(P7,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),w1=Hi.Symbol,_1=Hi.Uint8Array,W7=xf.propertyIsEnumerable,K7=z7.splice,Y7=Object.getPrototypeOf,J7=Object.keys,ry=ys(Hi,"DataView"),_f=ys(Hi,"Map"),ny=ys(Hi,"Promise"),iy=ys(Hi,"Set"),oy=ys(Hi,"WeakMap"),ku=ys(Object,"create"),X7=Gi(ry),Z7=Gi(_f),Q7=Gi(ny),eH=Gi(iy),tH=Gi(oy),E1=w1?w1.prototype:void 0,Zg=E1?E1.valueOf:void 0;function Ui(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 rH(){this.__data__=ku?ku(null):{}}function nH(t){return this.has(t)&&delete this.__data__[t]}function iH(t){var e=this.__data__;if(ku){var r=e[t];return r===ay?void 0:r}return Mi.call(e,t)?e[t]:void 0}function oH(t){var e=this.__data__;return ku?e[t]!==void 0:Mi.call(e,t)}function sH(t,e){var r=this.__data__;return r[t]=ku&&e===void 0?ay:e,this}Ui.prototype.clear=rH;Ui.prototype.delete=nH;Ui.prototype.get=iH;Ui.prototype.has=oH;Ui.prototype.set=sH;function mn(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 aH(){this.__data__=[]}function uH(t){var e=this.__data__,r=Ff(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():K7.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 cH(t){return Ff(this.__data__,t)>-1}function fH(t,e){var r=this.__data__,n=Ff(r,t);return n<0?r.push([t,e]):r[n][1]=e,this}mn.prototype.clear=aH;mn.prototype.delete=uH;mn.prototype.get=lH;mn.prototype.has=cH;mn.prototype.set=fH;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 dH(){this.__data__={hash:new Ui,map:new(_f||mn),string:new Ui}}function hH(t){return Of(this,t).delete(t)}function pH(t){return Of(this,t).get(t)}function mH(t){return Of(this,t).has(t)}function gH(t,e){return Of(this,t).set(t,e),this}zi.prototype.clear=dH;zi.prototype.delete=hH;zi.prototype.get=pH;zi.prototype.has=mH;zi.prototype.set=gH;function Ef(t){var e=-1,r=t?t.length:0;for(this.__data__=new zi;++e<r;)this.add(t[e])}function yH(t){return this.__data__.set(t,ay),this}function DH(t){return this.__data__.has(t)}Ef.prototype.add=Ef.prototype.push=yH;Ef.prototype.has=DH;function pn(t){this.__data__=new mn(t)}function vH(){this.__data__=new mn}function bH(t){return this.__data__.delete(t)}function wH(t){return this.__data__.get(t)}function _H(t){return this.__data__.has(t)}function EH(t,e){var r=this.__data__;return r instanceof mn&&r.__data__.length==D7&&(r=this.__data__=new zi(r.__data__)),r.set(t,e),this}pn.prototype.clear=vH;pn.prototype.delete=bH;pn.prototype.get=wH;pn.prototype.has=_H;pn.prototype.set=EH;function Ff(t,e){for(var r=t.length;r--;)if(UH(t[r][0],e))return r;return-1}function I1(t,e){e=Af(e,t)?[e]:L1(e);for(var r=0,n=e.length;t!=null&&r<n;)t=t[kf(e[r++])];return r&&r==n?t:void 0}function j1(t,e){return Mi.call(t,e)||typeof t=="object"&&e in t&&NH(t)===null}function CH(t,e){return e in Object(t)}function ly(t,e,r,n,i){return t===e?!0:t==null||e==null||!Pf(t)&&!Pu(e)?t!==t&&e!==e:SH(t,e,ly,r,n,i)}function SH(t,e,r,n,i,o){var s=Yn(t),a=Yn(e),u=Qg,l=Qg;s||(u=hn(t),u=u==bf?ps:u),a||(l=hn(e),l=l==bf?ps:l);var c=u==ps&&!ty(t),f=l==ps&&!ty(e),h=u==l;if(h&&!c)return o||(o=new pn),s||zH(t)?B1(t,e,r,n,i,o):RH(t,e,u,r,n,i,o);if(!(i&gs)){var d=c&&Mi.call(t,"__wrapped__"),m=f&&Mi.call(e,"__wrapped__");if(d||m){var b=d?t.value():t,D=m?e.value():e;return o||(o=new pn),r(b,D,n,i,o)}}return h?(o||(o=new pn),$H(t,e,r,n,i,o)):!1}function xH(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],l=t[u],c=a[1];if(s&&a[2]){if(l===void 0&&!(u in t))return!1}else{var f=new pn;if(n)var h=n(l,c,u,t,e,f);if(!(h===void 0?ly(c,l,n,Cf|gs,f):h))return!1}}return!0}function FH(t){return typeof t=="function"?t:t==null?YH:typeof t=="object"?Yn(t)?kH(t[0],t[1]):AH(t):JH(t)}function OH(t){return J7(Object(t))}function AH(t){var e=jH(t);return e.length==1&&e[0][2]?U1(e[0][0],e[0][1]):function(r){return r===t||xH(r,t,e)}}function kH(t,e){return Af(t)&&M1(e)?U1(kf(t),e):function(r){var n=GH(r,t);return n===void 0&&n===e?WH(r,t):ly(e,n,void 0,Cf|gs)}}function N1(t){return function(e){return e?.[t]}}function TH(t){return function(e){return I1(e,t)}}function L1(t){return Yn(t)?t:y7(t)}function PH(t){return function(e){var r=hn(e);return r==Ou?R1(e):r==Au?V7(e):U7(e,t(e))}}function B1(t,e,r,n,i,o){var s=i&gs,a=t.length,u=e.length;if(a!=u&&!(s&&u>a))return!1;var l=o.get(t);if(l)return l==e;var c=-1,f=!0,h=i&Cf?new Ef:void 0;for(o.set(t,e);++c<a;){var d=t[c],m=e[c];if(n)var b=s?n(m,d,c,e,t,o):n(d,m,c,t,e,o);if(b!==void 0){if(b)continue;f=!1;break}if(h){if(!q7(e,function(D,_){if(!h.has(_)&&(d===D||r(d,D,n,i,o)))return h.add(_)})){f=!1;break}}else if(!(d===m||r(d,m,n,i,o))){f=!1;break}}return o.delete(t),f}function RH(t,e,r,n,i,o,s){switch(r){case wf:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case P1:return!(t.byteLength!=e.byteLength||!n(new _1(t),new _1(e)));case S1:case x1:return+t==+e;case F1:return t.name==e.name&&t.message==e.message;case A1:return t!=+t?e!=+e:t==+e;case k1:case uy:return t==e+"";case Ou:var a=R1;case Au:var u=o&gs;if(a||(a=H7),t.size!=e.size&&!u)return!1;var l=s.get(t);return l?l==e:(o|=Cf,s.set(t,e),B1(a(t),a(e),n,i,o,s));case T1:if(Zg)return Zg.call(t)==Zg.call(e)}return!1}function $H(t,e,r,n,i,o){var s=i&gs,a=sy(t),u=a.length,l=sy(e),c=l.length;if(u!=c&&!s)return!1;for(var f=u;f--;){var h=a[f];if(!(s?h in e:j1(e,h)))return!1}var d=o.get(t);if(d)return d==e;var m=!0;o.set(t,e);for(var b=s;++f<u;){h=a[f];var D=t[h],_=e[h];if(n)var F=s?n(_,D,h,e,t,o):n(D,_,h,t,e,o);if(!(F===void 0?D===_||r(D,_,n,i,o):F)){m=!1;break}b||(b=h=="constructor")}if(m&&!b){var g=t.constructor,C=e.constructor;g!=C&&"constructor"in t&&"constructor"in e&&!(typeof g=="function"&&g instanceof g&&typeof C=="function"&&C instanceof C)&&(m=!1)}return o.delete(t),m}var IH=N1("length");function Of(t,e){var r=t.__data__;return qH(e)?r[typeof e=="string"?"string":"hash"]:r.map}function jH(t){for(var e=KH(t),r=e.length;r--;)e[r][2]=M1(e[r][1]);return e}function ys(t,e){var r=t[e];return VH(r)?r:void 0}function NH(t){return Y7(Object(t))}function hn(t){return Vi.call(t)}(ry&&hn(new ry(new ArrayBuffer(1)))!=wf||_f&&hn(new _f)!=Ou||ny&&hn(ny.resolve())!=v1||iy&&hn(new iy)!=Au||oy&&hn(new oy)!=ey)&&(hn=function(t){var e=Vi.call(t),r=e==ps?t.constructor:void 0,n=r?Gi(r):void 0;if(n)switch(n){case X7:return wf;case Z7:return Ou;case Q7:return v1;case eH:return Au;case tH:return ey}return e});function LH(t,e,r){e=Af(e,t)?[e]:L1(e);for(var n,i=-1,s=e.length;++i<s;){var o=kf(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&&Tf(s)&&q1(o,s)&&(Yn(t)||G1(t)||H1(t))}function BH(t){var e=t?t.length:void 0;return Tf(e)&&(Yn(t)||G1(t)||H1(t))?M7(e,String):null}function q1(t,e){return e=e??C1,!!e&&(typeof t=="number"||$7.test(t))&&t>-1&&t%1==0&&t<e}function Af(t,e){if(Yn(t))return!1;var r=typeof t;return r=="number"||r=="symbol"||r=="boolean"||t==null||W1(t)?!0:T7.test(t)||!k7.test(t)||e!=null&&t in Object(e)}function qH(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function MH(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||xf;return t===r}function M1(t){return t===t&&!Pf(t)}function U1(t,e){return function(r){return r==null?!1:r[t]===e&&(e!==void 0||t in Object(r))}}function kf(t){if(typeof t=="string"||W1(t))return t;var e=t+"";return e=="0"&&1/t==-v7?"-0":e}function Gi(t){if(t!=null){try{return $1.call(t)}catch{}try{return t+""}catch{}}return""}function UH(t,e){return t===e||t!==t&&e!==e}function H1(t){return HH(t)&&Mi.call(t,"callee")&&(!W7.call(t,"callee")||Vi.call(t)==bf)}var Yn=Array.isArray;function V1(t){return t!=null&&Tf(IH(t))&&!z1(t)}function HH(t){return Pu(t)&&V1(t)}function z1(t){var e=Pf(t)?Vi.call(t):"";return e==O1||e==b7}function Tf(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=C1}function Pf(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function Pu(t){return!!t&&typeof t=="object"}function VH(t){if(!Pf(t))return!1;var e=z1(t)||ty(t)?G7:R7;return e.test(Gi(t))}function G1(t){return typeof t=="string"||!Yn(t)&&Pu(t)&&Vi.call(t)==uy}function W1(t){return typeof t=="symbol"||Pu(t)&&Vi.call(t)==T1}function zH(t){return Pu(t)&&Tf(t.length)&&!!Re[Vi.call(t)]}function GH(t,e,r){var n=t==null?void 0:I1(t,e);return n===void 0?r:n}function WH(t,e){return t!=null&&LH(t,e,CH)}function sy(t){var e=MH(t);if(!(e||V1(t)))return OH(t);var r=BH(t),n=!!r,i=r||[],o=i.length;for(var s in t)j1(t,s)&&!(n&&(s=="length"||q1(s,o)))&&!(e&&s=="constructor")&&i.push(s);return i}var KH=PH(sy);function YH(t){return t}function JH(t){return Af(t)?N1(kf(t)):TH(t)}ms.exports=FH});var Q1=y((Wi,Ds)=>{var XH=1/0,ZH="[object Function]",QH="[object GeneratorFunction]",eV=/[\\^$.*+?()[\]{}|]/g,tV=/^\[object .+?Constructor\]$/,Ru={function:!0,object:!0},rV=Ru[typeof Wi]&&Wi&&!Wi.nodeType?Wi:void 0,nV=Ru[typeof Ds]&&Ds&&!Ds.nodeType?Ds:void 0,iV=Rf(rV&&nV&&typeof global=="object"&&global),oV=Rf(Ru[typeof self]&&self),Y1=Rf(Ru[typeof window]&&window),cy=Rf(Ru[typeof Wi]&&Wi),sV=iV||Y1!==(cy&&cy.window)&&Y1||oV||cy||Function("return this")();function Rf(t){return t&&t.Object===Object?t:null}function aV(t){var e=!1;if(t!=null&&typeof t.toString!="function")try{e=!!(t+"")}catch{}return e}function uV(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}var J1=Object.prototype,X1=Function.prototype.toString,lV=J1.hasOwnProperty,cV=J1.toString,fV=RegExp("^"+X1.call(lV).replace(eV,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),fy=hV(sV,"Set"),dV=fy&&1/uV(new fy([,-0]))[1]==XH?function(t){return new fy(t)}:yV;function hV(t,e){var r=t[e];return gV(r)?r:void 0}function pV(t){if(t!=null){try{return X1.call(t)}catch{}try{return t+""}catch{}}return""}function mV(t){var e=Z1(t)?cV.call(t):"";return e==ZH||e==QH}function Z1(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function gV(t){if(!Z1(t))return!1;var e=mV(t)||aV(t)?fV:tV;return e.test(pV(t))}function yV(){}Ds.exports=dV});var tx=y((Ki,vs)=>{var $u={function:!0,object:!0},DV=$u[typeof Ki]&&Ki&&!Ki.nodeType?Ki:void 0,vV=$u[typeof vs]&&vs&&!vs.nodeType?vs:void 0,bV=$f(DV&&vV&&typeof global=="object"&&global),wV=$f($u[typeof self]&&self),ex=$f($u[typeof window]&&window),dy=$f($u[typeof Ki]&&Ki),_V=bV||ex!==(dy&&dy.window)&&ex||wV||dy||Function("return this")();function $f(t){return t&&t.Object===Object?t:null}vs.exports=_V});var ax=y(($le,sx)=>{var EV=Q1(),CV=tx(),SV=200,hy="__lodash_hash_undefined__",xV="[object Function]",FV="[object GeneratorFunction]",OV=/[\\^$.*+?()[\]{}|]/g,AV=/^\[object .+?Constructor\]$/;function kV(t,e){return!!t.length&&PV(t,e,0)>-1}function TV(t,e,r){for(var n=-1,i=t.length;++n<i;)if(r(e,t[n]))return!0;return!1}function PV(t,e,r){if(e!==e)return $V(t,r);for(var n=r-1,i=t.length;++n<i;)if(t[n]===e)return n;return-1}function RV(t,e){return t.has(e)}function $V(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 IV(t){var e=!1;if(t!=null&&typeof t.toString!="function")try{e=!!(t+"")}catch{}return e}function jV(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}var NV=Array.prototype,rx=Object.prototype,nx=Function.prototype.toString,py=rx.hasOwnProperty,LV=rx.toString,BV=RegExp("^"+nx.call(py).replace(OV,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),qV=NV.splice,MV=ix(CV,"Map"),Iu=ix(Object,"create");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 UV(){this.__data__=Iu?Iu(null):{}}function HV(t){return this.has(t)&&delete this.__data__[t]}function VV(t){var e=this.__data__;if(Iu){var r=e[t];return r===hy?void 0:r}return py.call(e,t)?e[t]:void 0}function zV(t){var e=this.__data__;return Iu?e[t]!==void 0:py.call(e,t)}function GV(t,e){var r=this.__data__;return r[t]=Iu&&e===void 0?hy:e,this}Yi.prototype.clear=UV;Yi.prototype.delete=HV;Yi.prototype.get=VV;Yi.prototype.has=zV;Yi.prototype.set=GV;function bs(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 WV(){this.__data__=[]}function KV(t){var e=this.__data__,r=jf(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():qV.call(e,r,1),!0}function YV(t){var e=this.__data__,r=jf(e,t);return r<0?void 0:e[r][1]}function JV(t){return jf(this.__data__,t)>-1}function XV(t,e){var r=this.__data__,n=jf(r,t);return n<0?r.push([t,e]):r[n][1]=e,this}bs.prototype.clear=WV;bs.prototype.delete=KV;bs.prototype.get=YV;bs.prototype.has=JV;bs.prototype.set=XV;function ws(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 ZV(){this.__data__={hash:new Yi,map:new(MV||bs),string:new Yi}}function QV(t){return Nf(this,t).delete(t)}function ez(t){return Nf(this,t).get(t)}function tz(t){return Nf(this,t).has(t)}function rz(t,e){return Nf(this,t).set(t,e),this}ws.prototype.clear=ZV;ws.prototype.delete=QV;ws.prototype.get=ez;ws.prototype.has=tz;ws.prototype.set=rz;function If(t){var e=-1,r=t?t.length:0;for(this.__data__=new ws;++e<r;)this.add(t[e])}function nz(t){return this.__data__.set(t,hy),this}function iz(t){return this.__data__.has(t)}If.prototype.add=If.prototype.push=nz;If.prototype.has=iz;function jf(t,e){for(var r=t.length;r--;)if(uz(t[r][0],e))return r;return-1}function oz(t,e,r){var n=-1,i=kV,o=t.length,s=!0,a=[],u=a;if(r)s=!1,i=TV;else if(o>=SV){var l=e?null:EV(t);if(l)return jV(l);s=!1,i=RV,u=new If}else u=e?[]:a;e:for(;++n<o;){var c=t[n],f=e?e(c):c;if(c=r||c!==0?c:0,s&&f===f){for(var h=u.length;h--;)if(u[h]===f)continue e;e&&u.push(f),a.push(c)}else i(u,f,r)||(u!==a&&u.push(f),a.push(c))}return a}function Nf(t,e){var r=t.__data__;return sz(e)?r[typeof e=="string"?"string":"hash"]:r.map}function ix(t,e){var r=t[e];return cz(r)?r:void 0}function sz(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function az(t){if(t!=null){try{return nx.call(t)}catch{}try{return t+""}catch{}}return""}function uz(t,e){return t===e||t!==t&&e!==e}function lz(t){var e=ox(t)?LV.call(t):"";return e==xV||e==FV}function ox(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function cz(t){if(!ox(t))return!1;var e=lz(t)||IV(t)?BV:AV;return e.test(az(t))}sx.exports=oz});var lx=y((Ile,ux)=>{var fz=K1(),dz=ax();function hz(t,e){return t&&t.length?dz(t,fz(e)):[]}ux.exports=hz});var fx=y((jle,cx)=>{"use strict";var pz=s1(),mz=lx(),gz=pz("MultiError");cx.exports=my;function my(t){if(!(this instanceof my))return new my(t);if(t=Array.isArray(t)?t:[t],t=mz(t,function(r){return r.stack}),t.length===1)return t[0];var e=new gz({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(`
|
|
34
34
|
|
|
35
35
|
`)}),e.__defineSetter__("stack",function(r){return[r].concat(e.stack).join(`
|
|
36
36
|
|
|
37
|
-
`)}),e}});var
|
|
38
|
-
GFS4: `),console.error(t)});ze[wt]||(Dx=global[wt]||[],bx(ze,Dx),ze.close=function(t){function e(r,n){return t.call(ze,r,function(i){i||vx(),typeof n=="function"&&n.apply(this,arguments)})}return Object.defineProperty(e,Mf,{value:t}),e}(ze.close),ze.closeSync=function(t){function e(r){t.apply(ze,arguments),vx()}return Object.defineProperty(e,Mf,{value:t}),e}(ze.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){Ji(ze[wt]),require("assert").equal(ze[wt].length,0)}));var Dx;global[wt]||bx(global,ze[wt]);vy.exports=yy(Cz(ze));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!ze.__patched&&(vy.exports=yy(ze),ze.__patched=!0);function yy(t){_z(t),t.gracefulify=yy,t.createReadStream=A,t.createWriteStream=T;var e=t.readFile;t.readFile=r;function r(S,I,$){return typeof I=="function"&&($=I,I=null),B(S,I,$);function B(q,K,V,E){return e(q,K,function(v){v&&(v.code==="EMFILE"||v.code==="ENFILE")?_s([B,[q,K,V],v,E||Date.now(),Date.now()]):typeof V=="function"&&V.apply(this,arguments)})}}var n=t.writeFile;t.writeFile=i;function i(S,I,$,B){return typeof $=="function"&&(B=$,$=null),q(S,I,$,B);function q(K,V,E,v,w){return n(K,V,E,function(O){O&&(O.code==="EMFILE"||O.code==="ENFILE")?_s([q,[K,V,E,v],O,w||Date.now(),Date.now()]):typeof v=="function"&&v.apply(this,arguments)})}}var o=t.appendFile;o&&(t.appendFile=s);function s(S,I,$,B){return typeof $=="function"&&(B=$,$=null),q(S,I,$,B);function q(K,V,E,v,w){return o(K,V,E,function(O){O&&(O.code==="EMFILE"||O.code==="ENFILE")?_s([q,[K,V,E,v],O,w||Date.now(),Date.now()]):typeof v=="function"&&v.apply(this,arguments)})}}var a=t.copyFile;a&&(t.copyFile=u);function u(S,I,$,B){return typeof $=="function"&&(B=$,$=0),q(S,I,$,B);function q(K,V,E,v,w){return a(K,V,E,function(O){O&&(O.code==="EMFILE"||O.code==="ENFILE")?_s([q,[K,V,E,v],O,w||Date.now(),Date.now()]):typeof v=="function"&&v.apply(this,arguments)})}}var l=t.readdir;t.readdir=f;var c=/^v[0-5]\./;function f(S,I,$){typeof I=="function"&&($=I,I=null);var B=c.test(process.version)?function(V,E,v,w){return l(V,q(V,E,v,w))}:function(V,E,v,w){return l(V,E,q(V,E,v,w))};return B(S,I,$);function q(K,V,E,v){return function(w,O){w&&(w.code==="EMFILE"||w.code==="ENFILE")?_s([B,[K,V,E],w,v||Date.now(),Date.now()]):(O&&O.sort&&O.sort(),typeof E=="function"&&E.call(this,w,O))}}}if(process.version.substr(0,4)==="v0.8"){var h=Ez(t);_=h.ReadStream,g=h.WriteStream}var d=t.ReadStream;d&&(_.prototype=Object.create(d.prototype),_.prototype.open=F);var m=t.WriteStream;m&&(g.prototype=Object.create(m.prototype),g.prototype.open=C),Object.defineProperty(t,"ReadStream",{get:function(){return _},set:function(S){_=S},enumerable:!0,configurable:!0}),Object.defineProperty(t,"WriteStream",{get:function(){return g},set:function(S){g=S},enumerable:!0,configurable:!0});var b=_;Object.defineProperty(t,"FileReadStream",{get:function(){return b},set:function(S){b=S},enumerable:!0,configurable:!0});var D=g;Object.defineProperty(t,"FileWriteStream",{get:function(){return D},set:function(S){D=S},enumerable:!0,configurable:!0});function _(S,I){return this instanceof _?(d.apply(this,arguments),this):_.apply(Object.create(_.prototype),arguments)}function F(){var S=this;L(S.path,S.flags,S.mode,function(I,$){I?(S.autoClose&&S.destroy(),S.emit("error",I)):(S.fd=$,S.emit("open",$),S.read())})}function g(S,I){return this instanceof g?(m.apply(this,arguments),this):g.apply(Object.create(g.prototype),arguments)}function C(){var S=this;L(S.path,S.flags,S.mode,function(I,$){I?(S.destroy(),S.emit("error",I)):(S.fd=$,S.emit("open",$))})}function A(S,I){return new t.ReadStream(S,I)}function T(S,I){return new t.WriteStream(S,I)}var x=t.open;t.open=L;function L(S,I,$,B){return typeof $=="function"&&(B=$,$=null),q(S,I,$,B);function q(K,V,E,v,w){return x(K,V,E,function(O,j){O&&(O.code==="EMFILE"||O.code==="ENFILE")?_s([q,[K,V,E,v],O,w||Date.now(),Date.now()]):typeof v=="function"&&v.apply(this,arguments)})}}return t}function _s(t){Ji("ENQUEUE",t[0].name,t[1]),ze[wt].push(t),Dy()}var qf;function vx(){for(var t=Date.now(),e=0;e<ze[wt].length;++e)ze[wt][e].length>2&&(ze[wt][e][3]=t,ze[wt][e][4]=t);Dy()}function Dy(){if(clearTimeout(qf),qf=void 0,ze[wt].length!==0){var t=ze[wt].shift(),e=t[0],r=t[1],n=t[2],i=t[3],o=t[4];if(i===void 0)Ji("RETRY",e.name,r),e.apply(null,r);else if(Date.now()-i>=6e4){Ji("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),l=Math.min(u*1.2,100);a>=l?(Ji("RETRY",e.name,r),e.apply(null,r.concat([i]))):ze[wt].push(t)}qf===void 0&&(qf=setTimeout(Dy,0))}}});var _x=y((Lle,wx)=>{function pr(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))}wx.exports=pr;pr.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts};pr.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timeouts=[],this._cachedTimeouts=null};pr.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};pr.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)};pr.prototype.try=function(t){console.log("Using RetryOperation.try() is deprecated"),this.attempt(t)};pr.prototype.start=function(t){console.log("Using RetryOperation.start() is deprecated"),this.attempt(t)};pr.prototype.start=pr.prototype.try;pr.prototype.errors=function(){return this._errors};pr.prototype.attempts=function(){return this._attempts};pr.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 Ex=y(Xi=>{var xz=_x();Xi.operation=function(t){var e=Xi.timeouts(t);return new xz(e,{forever:t&&t.forever,unref:t&&t.unref,maxRetryTime:t&&t.maxRetryTime})};Xi.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};Xi.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};Xi.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 l=Xi.operation(e),c=Array.prototype.slice.call(arguments,1),f=c.pop();c.push(function(h){l.retry(h)||(h&&(arguments[0]=l.mainError()),f.apply(this,arguments))}),l.attempt(function(){u.apply(t,c)})}.bind(t,s),t[o].options=e}}});var Sx=y((qle,Cx)=>{Cx.exports=Ex()});var xx=y((Mle,Uf)=>{Uf.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];process.platform!=="win32"&&Uf.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&Uf.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")});var _y=y((Ule,Ss)=>{var Be=global.process,Zi=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"};Zi(Be)?(Fx=require("assert"),Es=xx(),Ox=/^win/i.test(Be.platform),ju=require("events"),typeof ju!="function"&&(ju=ju.EventEmitter),Be.__signal_exit_emitter__?ft=Be.__signal_exit_emitter__:(ft=Be.__signal_exit_emitter__=new ju,ft.count=0,ft.emitted={}),ft.infinite||(ft.setMaxListeners(1/0),ft.infinite=!0),Ss.exports=function(t,e){if(!Zi(global.process))return function(){};Fx.equal(typeof t,"function","a callback must be provided for exit handler"),Cs===!1&&by();var r="exit";e&&e.alwaysLast&&(r="afterexit");var n=function(){ft.removeListener(r,t),ft.listeners("exit").length===0&&ft.listeners("afterexit").length===0&&Hf()};return ft.on(r,t),n},Hf=function(){!Cs||!Zi(global.process)||(Cs=!1,Es.forEach(function(e){try{Be.removeListener(e,Vf[e])}catch{}}),Be.emit=zf,Be.reallyExit=wy,ft.count-=1)},Ss.exports.unload=Hf,Qi=function(e,r,n){ft.emitted[e]||(ft.emitted[e]=!0,ft.emit(e,r,n))},Vf={},Es.forEach(function(t){Vf[t]=function(){if(Zi(global.process)){var r=Be.listeners(t);r.length===ft.count&&(Hf(),Qi("exit",null,t),Qi("afterexit",null,t),Ox&&t==="SIGHUP"&&(t="SIGINT"),Be.kill(Be.pid,t))}}}),Ss.exports.signals=function(){return Es},Cs=!1,by=function(){Cs||!Zi(global.process)||(Cs=!0,ft.count+=1,Es=Es.filter(function(e){try{return Be.on(e,Vf[e]),!0}catch{return!1}}),Be.emit=kx,Be.reallyExit=Ax)},Ss.exports.load=by,wy=Be.reallyExit,Ax=function(e){Zi(global.process)&&(Be.exitCode=e||0,Qi("exit",Be.exitCode,null),Qi("afterexit",Be.exitCode,null),wy.call(Be,Be.exitCode))},zf=Be.emit,kx=function(e,r){if(e==="exit"&&Zi(global.process)){r!==void 0&&(Be.exitCode=r);var n=zf.apply(this,arguments);return Qi("exit",Be.exitCode,null),Qi("afterexit",Be.exitCode,null),n}else return zf.apply(this,arguments)}):Ss.exports=function(){return function(){}};var Fx,Es,Ox,ju,ft,Hf,Qi,Vf,Cs,by,wy,Ax,zf,kx});var Px=y((Hle,Ey)=>{"use strict";var Tx=Symbol();function Fz(t,e,r){let n=e[Tx];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,Tx,{value:u}),r(null,a.mtime,u)})})}function Oz(t){let e=Date.now();return t==="s"&&(e=Math.ceil(e/1e3)*1e3),new Date(e)}Ey.exports.probe=Fz;Ey.exports.getMtime=Oz});var Nx=y((Vle,Lu)=>{"use strict";var Az=require("path"),xy=Xn(),kz=Sx(),Tz=_y(),Rx=Px(),gn={};function Nu(t,e){return e.lockfilePath||`${t}.lock`}function Fy(t,e,r){if(!e.realpath)return r(null,Az.resolve(t));e.fs.realpath(t,r)}function Sy(t,e,r){let n=Nu(t,e);e.fs.mkdir(n,i=>{if(!i)return Rx.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"?Sy(t,{...e,stale:0},r):r(o);if(!$x(s,e))return r(Object.assign(new Error("Lock file is already being held"),{code:"ELOCKED",file:t}));Ix(t,e,a=>{if(a)return r(a);Sy(t,{...e,stale:0},r)})})})}function $x(t,e){return t.mtime.getTime()<Date.now()-e.stale}function Ix(t,e,r){e.fs.rmdir(Nu(t,e),n=>{if(n&&n.code!=="ENOENT")return r(n);r()})}function Gf(t,e){let r=gn[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?Cy(t,r,Object.assign(n,{code:"ECOMPROMISED"})):(r.updateDelay=1e3,Gf(t,e));if(!(r.mtime.getTime()===i.mtime.getTime()))return Cy(t,r,Object.assign(new Error("Unable to update lock within the stale threshold"),{code:"ECOMPROMISED"}));let a=Rx.getMtime(r.mtimePrecision);e.fs.utimes(r.lockfilePath,a,a,u=>{let l=r.lastUpdate+e.stale<Date.now();if(!r.released){if(u)return u.code==="ENOENT"||l?Cy(t,r,Object.assign(u,{code:"ECOMPROMISED"})):(r.updateDelay=1e3,Gf(t,e));r.mtime=a,r.lastUpdate=Date.now(),r.updateDelay=null,Gf(t,e)}})})},r.updateDelay),r.updateTimeout.unref&&r.updateTimeout.unref())}function Cy(t,e,r){e.released=!0,e.updateTimeout&&clearTimeout(e.updateTimeout),gn[t]===e&&delete gn[t],e.options.onCompromised(r)}function Pz(t,e,r){e={stale:1e4,update:null,realpath:!0,retries:0,fs:xy,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),Fy(t,e,(n,i)=>{if(n)return r(n);let o=kz.operation(e.retries);o.attempt(()=>{Sy(i,e,(s,a,u)=>{if(o.retry(s))return;if(s)return r(o.mainError());let l=gn[i]={lockfilePath:Nu(i,e),mtime:a,mtimePrecision:u,options:e,lastUpdate:Date.now()};Gf(i,e),r(null,c=>{if(l.released)return c&&c(Object.assign(new Error("Lock is already released"),{code:"ERELEASED"}));jx(i,{...e,realpath:!1},c)})})})})}function jx(t,e,r){e={fs:xy,realpath:!0,...e},Fy(t,e,(n,i)=>{if(n)return r(n);let o=gn[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 gn[i],Ix(i,e,r)})}function Rz(t,e,r){e={stale:1e4,realpath:!0,fs:xy,...e},e.stale=Math.max(e.stale||0,2e3),Fy(t,e,(n,i)=>{if(n)return r(n);e.fs.stat(Nu(i,e),(o,s)=>o?o.code==="ENOENT"?r(null,!1):r(o):r(null,!$x(s,e)))})}function $z(){return gn}Tz(()=>{for(let t in gn){let e=gn[t].options;try{e.fs.rmdirSync(Nu(t,e))}catch{}}});Lu.exports.lock=Pz;Lu.exports.unlock=jx;Lu.exports.check=Rz;Lu.exports.getLocks=$z});var Bx=y((zle,Lx)=>{"use strict";var Iz=Xn();function jz(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 Nz(t){return(...e)=>new Promise((r,n)=>{e.push((i,o)=>{i?n(i):r(o)}),t(...e)})}function Lz(t){return(...e)=>{let r,n;if(e.push((i,o)=>{r=i,n=o}),t(...e),r)throw r;return n}}function Bz(t){if(t={...t},t.fs=jz(t.fs||Iz),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}Lx.exports={toPromise:Nz,toSync:Lz,toSyncOptions:Bz}});var Mx=y((Gle,Zn)=>{"use strict";var xs=Nx(),{toPromise:Wf,toSync:Kf,toSyncOptions:Oy}=Bx();async function qx(t,e){let r=await Wf(xs.lock)(t,e);return Wf(r)}function qz(t,e){let r=Kf(xs.lock)(t,Oy(e));return Kf(r)}function Mz(t,e){return Wf(xs.unlock)(t,e)}function Uz(t,e){return Kf(xs.unlock)(t,Oy(e))}function Hz(t,e){return Wf(xs.check)(t,e)}function Vz(t,e){return Kf(xs.check)(t,Oy(e))}Zn.exports=qx;Zn.exports.lock=qx;Zn.exports.unlock=Mz;Zn.exports.lockSync=qz;Zn.exports.unlockSync=Uz;Zn.exports.check=Hz;Zn.exports.checkSync=Vz});var Gx=y(Fs=>{"use strict";Object.defineProperty(Fs,"__esModule",{value:!0});Fs.canStoreURLs=Fs.FileUrlStorage=void 0;var Ux=require("fs"),zz=Wz(cx()),Hx=Gz(Mx());function zx(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,r=new WeakMap;return(zx=function(n){return n?r:e})(t)}function Gz(t,e){if(!e&&t&&t.__esModule)return t;if(t===null||typeof t!="object"&&typeof t!="function")return{default:t};var r=zx(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 Wz(t){return t&&t.__esModule?t:{default:t}}function Bu(t){"@babel/helpers - typeof";return Bu=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},Bu(t)}function Kz(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Vx(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,Jz(n.key),n)}}function Yz(t,e,r){return e&&Vx(t.prototype,e),r&&Vx(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function Jz(t){var e=Xz(t,"string");return Bu(e)=="symbol"?e:e+""}function Xz(t,e){if(Bu(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Bu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Wle=Fs.canStoreURLs=!0,Kle=Fs.FileUrlStorage=function(){function t(e){Kz(this,t),this.path=e}return Yz(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(l){l?u(l):a(s)})})}},{key:"_setItem",value:function(r,n,i){var o=this;Hx.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(l){return i(l)})})}).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;Hx.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,zz.default)([i,o]))});return}r().then(n).catch(n)}}},{key:"_writeData",value:function(r,n){var i={encoding:"utf8",mode:432,flag:"w"};(0,Ux.writeFile)(this.path,JSON.stringify(r),i,function(o){return n(o)})}},{key:"_getData",value:function(r){(0,Ux.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 Ty=y(Vt=>{"use strict";Object.defineProperty(Vt,"__esModule",{value:!0});Object.defineProperty(Vt,"DefaultHttpStack",{enumerable:!0,get:function(){return Jx.default}});Object.defineProperty(Vt,"DetailedError",{enumerable:!0,get:function(){return Zz.default}});Object.defineProperty(Vt,"FileUrlStorage",{enumerable:!0,get:function(){return Xx.FileUrlStorage}});Object.defineProperty(Vt,"StreamSource",{enumerable:!0,get:function(){return nG.default}});Vt.Upload=void 0;Object.defineProperty(Vt,"canStoreURLs",{enumerable:!0,get:function(){return Xx.canStoreURLs}});Vt.defaultOptions=void 0;Object.defineProperty(Vt,"enableDebugLog",{enumerable:!0,get:function(){return Qz.enableDebugLog}});Vt.isSupported=void 0;var Zz=eo(Cg()),Qz=Sg(),eG=eo(GC()),Ay=eo(_S()),tG=eo(IS()),rG=eo(BS()),Jx=eo(QS()),nG=eo(Bg()),Xx=Gx();function eo(t){return t&&t.__esModule?t:{default:t}}function As(t){"@babel/helpers - typeof";return As=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},As(t)}function iG(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Wx(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,Qx(n.key),n)}}function oG(t,e,r){return e&&Wx(t.prototype,e),r&&Wx(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function sG(t,e,r){return e=Yf(e),aG(t,Zx()?Reflect.construct(e,r||[],Yf(t).constructor):e.apply(t,r))}function aG(t,e){if(e&&(As(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return uG(t)}function uG(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Zx(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Zx=function(){return!!t})()}function Yf(t){return Yf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Yf(t)}function lG(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&&ky(t,e)}function ky(t,e){return ky=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},ky(t,e)}function Kx(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 Os(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Kx(Object(r),!0).forEach(function(n){cG(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Kx(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function cG(t,e,r){return e=Qx(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Qx(t){var e=fG(t,"string");return As(e)=="symbol"?e:e+""}function fG(t,e){if(As(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(As(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Yx=Vt.defaultOptions=Os(Os({},Ay.default.defaultOptions),{},{httpStack:new Jx.default,fileReader:new tG.default,urlStorage:new eG.default,fingerprint:rG.default}),Jle=Vt.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 iG(this,e),n=Os(Os({},Yx),n),sG(this,e,[r,n])}return lG(e,t),oG(e,null,[{key:"terminate",value:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return i=Os(Os({},Yx),i),Ay.default.terminate(n,i)}}])}(Ay.default),Xle=Vt.isSupported=!0});var rr={};gi(rr,{__addDisposableResource:()=>C2,__assign:()=>Jf,__asyncDelegator:()=>g2,__asyncGenerator:()=>m2,__asyncValues:()=>y2,__await:()=>ks,__awaiter:()=>l2,__classPrivateFieldGet:()=>w2,__classPrivateFieldIn:()=>E2,__classPrivateFieldSet:()=>_2,__createBinding:()=>Zf,__decorate:()=>r2,__disposeResources:()=>S2,__esDecorate:()=>i2,__exportStar:()=>f2,__extends:()=>e2,__generator:()=>c2,__importDefault:()=>b2,__importStar:()=>v2,__makeTemplateObject:()=>D2,__metadata:()=>u2,__param:()=>n2,__propKey:()=>s2,__read:()=>$y,__rest:()=>t2,__rewriteRelativeImportExtension:()=>x2,__runInitializers:()=>o2,__setFunctionName:()=>a2,__spread:()=>d2,__spreadArray:()=>p2,__spreadArrays:()=>h2,__values:()=>Xf,default:()=>pG});function e2(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Py(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}function t2(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 r2(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 n2(t,e){return function(r,n){e(r,n,t)}}function i2(t,e,r,n,i,o){function s(_){if(_!==void 0&&typeof _!="function")throw new TypeError("Function expected");return _}for(var a=n.kind,u=a==="getter"?"get":a==="setter"?"set":"value",l=!e&&t?n.static?t:t.prototype:null,c=e||(l?Object.getOwnPropertyDescriptor(l,n.name):{}),f,h=!1,d=r.length-1;d>=0;d--){var m={};for(var b in n)m[b]=b==="access"?{}:n[b];for(var b in n.access)m.access[b]=n.access[b];m.addInitializer=function(_){if(h)throw new TypeError("Cannot add initializers after decoration has completed");o.push(s(_||null))};var D=(0,r[d])(a==="accessor"?{get:c.get,set:c.set}:c[u],m);if(a==="accessor"){if(D===void 0)continue;if(D===null||typeof D!="object")throw new TypeError("Object expected");(f=s(D.get))&&(c.get=f),(f=s(D.set))&&(c.set=f),(f=s(D.init))&&i.unshift(f)}else(f=s(D))&&(a==="field"?i.unshift(f):c[u]=f)}l&&Object.defineProperty(l,n.name,c),h=!0}function o2(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 s2(t){return typeof t=="symbol"?t:"".concat(t)}function a2(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 l2(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(c){try{l(n.next(c))}catch(f){s(f)}}function u(c){try{l(n.throw(c))}catch(f){s(f)}}function l(c){c.done?o(c.value):i(c.value).then(a,u)}l((n=n.apply(t,e||[])).next())})}function c2(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(l){return function(c){return u([l,c])}}function u(l){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,l[0]&&(r=0)),r;)try{if(n=1,i&&(o=l[0]&2?i.return:l[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,l[1])).done)return o;switch(i=0,o&&(l=[l[0]&2,o.value]),l[0]){case 0:case 1:o=l;break;case 4:return r.label++,{value:l[1],done:!1};case 5:r.label++,i=l[1],l=[0];continue;case 7:l=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(l[0]===6||l[0]===2)){r=0;continue}if(l[0]===3&&(!o||l[1]>o[0]&&l[1]<o[3])){r.label=l[1];break}if(l[0]===6&&r.label<o[1]){r.label=o[1],o=l;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(l);break}o[2]&&r.ops.pop(),r.trys.pop();continue}l=e.call(t,r)}catch(c){l=[6,c],i=0}finally{n=o=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}function f2(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Zf(e,t,r)}function Xf(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 $y(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($y(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 ks(t){return this instanceof ks?(this.v=t,this):new ks(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=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(m){return Promise.resolve(m).then(d,f)}}function a(d,m){n[d]&&(i[d]=function(b){return new Promise(function(D,_){o.push([d,b,D,_])>1||u(d,b)})},m&&(i[d]=m(i[d])))}function u(d,m){try{l(n[d](m))}catch(b){h(o[0][3],b)}}function l(d){d.value instanceof ks?Promise.resolve(d.value.v).then(c,f):h(o[0][2],d)}function c(d){u("next",d)}function f(d){u("throw",d)}function h(d,m){d(m),o.shift(),o.length&&u(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:ks(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 Xf=="function"?Xf(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(l){o({value:l,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=Ry(t),n=0;n<r.length;n++)r[n]!=="default"&&Zf(e,t,r[n]);return dG(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,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 S2(t){function e(o){t.error=t.hasError?new hG(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()}function x2(t,e){return typeof t=="string"&&/^\.\.?\//.test(t)?t.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(r,n,i,o,s){return n?e?".jsx":".js":i&&(!o||!s)?r:i+o+"."+s.toLowerCase()+"js"}):t}var Py,Jf,Zf,dG,Ry,hG,pG,nr=Ct(()=>{Py=function(t,e){return Py=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])},Py(t,e)};Jf=function(){return Jf=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},Jf.apply(this,arguments)};Zf=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]};dG=Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e},Ry=function(t){return Ry=Object.getOwnPropertyNames||function(e){var r=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(r[r.length]=n);return r},Ry(t)};hG=typeof SuppressedError=="function"?SuppressedError:function(t,e,r){var n=new Error(r);return n.name="SuppressedError",n.error=t,n.suppressed=e,n};pG={__extends:e2,__assign:Jf,__rest:t2,__decorate:r2,__param:n2,__esDecorate:i2,__runInitializers:o2,__propKey:s2,__setFunctionName:a2,__metadata:u2,__awaiter:l2,__generator:c2,__createBinding:Zf,__exportStar:f2,__values:Xf,__read:$y,__spread:d2,__spreadArrays:h2,__spreadArray:p2,__await:ks,__asyncGenerator:m2,__asyncDelegator:g2,__asyncValues:y2,__makeTemplateObject:D2,__importStar:v2,__importDefault:b2,__classPrivateFieldGet:w2,__classPrivateFieldSet:_2,__classPrivateFieldIn:E2,__addDisposableResource:C2,__disposeResources:S2,__rewriteRelativeImportExtension:x2}});var O2=y((Qle,F2)=>{var Ts=1e3,Ps=Ts*60,Rs=Ps*60,to=Rs*24,mG=to*7,gG=to*365.25;F2.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return yG(t);if(r==="number"&&isFinite(t))return e.long?vG(t):DG(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function yG(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*gG;case"weeks":case"week":case"w":return r*mG;case"days":case"day":case"d":return r*to;case"hours":case"hour":case"hrs":case"hr":case"h":return r*Rs;case"minutes":case"minute":case"mins":case"min":case"m":return r*Ps;case"seconds":case"second":case"secs":case"sec":case"s":return r*Ts;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}function DG(t){var e=Math.abs(t);return e>=to?Math.round(t/to)+"d":e>=Rs?Math.round(t/Rs)+"h":e>=Ps?Math.round(t/Ps)+"m":e>=Ts?Math.round(t/Ts)+"s":t+"ms"}function vG(t){var e=Math.abs(t);return e>=to?Qf(t,e,to,"day"):e>=Rs?Qf(t,e,Rs,"hour"):e>=Ps?Qf(t,e,Ps,"minute"):e>=Ts?Qf(t,e,Ts,"second"):t+" ms"}function Qf(t,e,r,n){var i=e>=r*1.5;return Math.round(t/r)+" "+n+(i?"s":"")}});var Iy=y((ece,A2)=>{function bG(t){r.debug=r,r.default=r,r.coerce=u,r.disable=s,r.enable=i,r.enabled=a,r.humanize=O2(),r.destroy=l,Object.keys(t).forEach(c=>{r[c]=t[c]}),r.names=[],r.skips=[],r.formatters={};function e(c){let f=0;for(let h=0;h<c.length;h++)f=(f<<5)-f+c.charCodeAt(h),f|=0;return r.colors[Math.abs(f)%r.colors.length]}r.selectColor=e;function r(c){let f,h=null,d,m;function b(...D){if(!b.enabled)return;let _=b,F=Number(new Date),g=F-(f||F);_.diff=g,_.prev=f,_.curr=F,f=F,D[0]=r.coerce(D[0]),typeof D[0]!="string"&&D.unshift("%O");let C=0;D[0]=D[0].replace(/%([a-zA-Z%])/g,(T,x)=>{if(T==="%%")return"%";C++;let L=r.formatters[x];if(typeof L=="function"){let S=D[C];T=L.call(_,S),D.splice(C,1),C--}return T}),r.formatArgs.call(_,D),(_.log||r.log).apply(_,D)}return b.namespace=c,b.useColors=r.useColors(),b.color=r.selectColor(c),b.extend=n,b.destroy=r.destroy,Object.defineProperty(b,"enabled",{enumerable:!0,configurable:!1,get:()=>h!==null?h:(d!==r.namespaces&&(d=r.namespaces,m=r.enabled(c)),m),set:D=>{h=D}}),typeof r.init=="function"&&r.init(b),b}function n(c,f){let h=r(this.namespace+(typeof f>"u"?":":f)+c);return h.log=this.log,h}function i(c){r.save(c),r.namespaces=c,r.names=[],r.skips=[];let f=(typeof c=="string"?c:"").trim().replace(" ",",").split(",").filter(Boolean);for(let h of f)h[0]==="-"?r.skips.push(h.slice(1)):r.names.push(h)}function o(c,f){let h=0,d=0,m=-1,b=0;for(;h<c.length;)if(d<f.length&&(f[d]===c[h]||f[d]==="*"))f[d]==="*"?(m=d,b=h,d++):(h++,d++);else if(m!==-1)d=m+1,b++,h=b;else return!1;for(;d<f.length&&f[d]==="*";)d++;return d===f.length}function s(){let c=[...r.names,...r.skips.map(f=>"-"+f)].join(",");return r.enable(""),c}function a(c){for(let f of r.skips)if(o(c,f))return!1;for(let f of r.names)if(o(c,f))return!0;return!1}function u(c){return c instanceof Error?c.stack||c.message:c}function l(){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}A2.exports=bG});var k2=y((ir,ed)=>{ir.formatArgs=_G;ir.save=EG;ir.load=CG;ir.useColors=wG;ir.storage=SG();ir.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`."))}})();ir.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 wG(){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 _G(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+ed.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)}ir.log=console.debug||console.log||(()=>{});function EG(t){try{t?ir.storage.setItem("debug",t):ir.storage.removeItem("debug")}catch{}}function CG(){let t;try{t=ir.storage.getItem("debug")}catch{}return!t&&typeof process<"u"&&"env"in process&&(t=process.env.DEBUG),t}function SG(){try{return localStorage}catch{}}ed.exports=Iy()(ir);var{formatters:xG}=ed.exports;xG.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var P2=y((tce,T2)=>{"use strict";T2.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 I2=y((rce,$2)=>{"use strict";var FG=require("os"),R2=require("tty"),mr=P2(),{env:dt}=process,Qn;mr("no-color")||mr("no-colors")||mr("color=false")||mr("color=never")?Qn=0:(mr("color")||mr("colors")||mr("color=true")||mr("color=always"))&&(Qn=1);"FORCE_COLOR"in dt&&(dt.FORCE_COLOR==="true"?Qn=1:dt.FORCE_COLOR==="false"?Qn=0:Qn=dt.FORCE_COLOR.length===0?1:Math.min(parseInt(dt.FORCE_COLOR,10),3));function jy(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}function Ny(t,e){if(Qn===0)return 0;if(mr("color=16m")||mr("color=full")||mr("color=truecolor"))return 3;if(mr("color=256"))return 2;if(t&&!e&&Qn===void 0)return 0;let r=Qn||0;if(dt.TERM==="dumb")return r;if(process.platform==="win32"){let n=FG.release().split(".");return Number(n[0])>=10&&Number(n[2])>=10586?Number(n[2])>=14931?3:2:1}if("CI"in dt)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(n=>n in dt)||dt.CI_NAME==="codeship"?1:r;if("TEAMCITY_VERSION"in dt)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(dt.TEAMCITY_VERSION)?1:0;if(dt.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in dt){let n=parseInt((dt.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(dt.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(dt.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(dt.TERM)||"COLORTERM"in dt?1:r}function OG(t){let e=Ny(t,t&&t.isTTY);return jy(e)}$2.exports={supportsColor:OG,stdout:jy(Ny(!0,R2.isatty(1))),stderr:jy(Ny(!0,R2.isatty(2)))}});var N2=y((ht,rd)=>{var AG=require("tty"),td=require("util");ht.init=jG;ht.log=RG;ht.formatArgs=TG;ht.save=$G;ht.load=IG;ht.useColors=kG;ht.destroy=td.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");ht.colors=[6,2,3,4,5,1];try{let t=I2();t&&(t.stderr||t).level>=2&&(ht.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{}ht.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 kG(){return"colors"in ht.inspectOpts?!!ht.inspectOpts.colors:AG.isatty(process.stderr.fd)}function TG(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(`
|
|
37
|
+
`)}),e}});var hx=y((Nle,dx)=>{var Jn=require("constants"),yz=process.cwd,Lf=null,Dz=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return Lf||(Lf=yz.call(process)),Lf};try{process.cwd()}catch{}typeof process.chdir=="function"&&(gy=process.chdir,process.chdir=function(t){Lf=null,gy.call(process,t)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,gy));var gy;dx.exports=vz;function vz(t){Jn.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(c,f,h){h&&process.nextTick(h)},t.lchmodSync=function(){}),t.chown&&!t.lchown&&(t.lchown=function(c,f,h,d){d&&process.nextTick(d)},t.lchownSync=function(){}),Dz==="win32"&&(t.rename=typeof t.rename!="function"?t.rename:function(c){function f(h,d,m){var b=Date.now(),D=0;c(h,d,function _(F){if(F&&(F.code==="EACCES"||F.code==="EPERM"||F.code==="EBUSY")&&Date.now()-b<6e4){setTimeout(function(){t.stat(d,function(g,C){g&&g.code==="ENOENT"?c(h,d,_):m(F)})},D),D<100&&(D+=10);return}m&&m(F)})}return Object.setPrototypeOf&&Object.setPrototypeOf(f,c),f}(t.rename)),t.read=typeof t.read!="function"?t.read:function(c){function f(h,d,m,b,D,_){var F;if(_&&typeof _=="function"){var g=0;F=function(C,A,T){if(C&&C.code==="EAGAIN"&&g<10)return g++,c.call(t,h,d,m,b,D,F);_.apply(this,arguments)}}return c.call(t,h,d,m,b,D,F)}return Object.setPrototypeOf&&Object.setPrototypeOf(f,c),f}(t.read),t.readSync=typeof t.readSync!="function"?t.readSync:function(c){return function(f,h,d,m,b){for(var D=0;;)try{return c.call(t,f,h,d,m,b)}catch(_){if(_.code==="EAGAIN"&&D<10){D++;continue}throw _}}}(t.readSync);function e(c){c.lchmod=function(f,h,d){c.open(f,Jn.O_WRONLY|Jn.O_SYMLINK,h,function(m,b){if(m){d&&d(m);return}c.fchmod(b,h,function(D){c.close(b,function(_){d&&d(D||_)})})})},c.lchmodSync=function(f,h){var d=c.openSync(f,Jn.O_WRONLY|Jn.O_SYMLINK,h),m=!0,b;try{b=c.fchmodSync(d,h),m=!1}finally{if(m)try{c.closeSync(d)}catch{}else c.closeSync(d)}return b}}function r(c){Jn.hasOwnProperty("O_SYMLINK")&&c.futimes?(c.lutimes=function(f,h,d,m){c.open(f,Jn.O_SYMLINK,function(b,D){if(b){m&&m(b);return}c.futimes(D,h,d,function(_){c.close(D,function(F){m&&m(_||F)})})})},c.lutimesSync=function(f,h,d){var m=c.openSync(f,Jn.O_SYMLINK),b,D=!0;try{b=c.futimesSync(m,h,d),D=!1}finally{if(D)try{c.closeSync(m)}catch{}else c.closeSync(m)}return b}):c.futimes&&(c.lutimes=function(f,h,d,m){m&&process.nextTick(m)},c.lutimesSync=function(){})}function n(c){return c&&function(f,h,d){return c.call(t,f,h,function(m){l(m)&&(m=null),d&&d.apply(this,arguments)})}}function i(c){return c&&function(f,h){try{return c.call(t,f,h)}catch(d){if(!l(d))throw d}}}function o(c){return c&&function(f,h,d,m){return c.call(t,f,h,d,function(b){l(b)&&(b=null),m&&m.apply(this,arguments)})}}function s(c){return c&&function(f,h,d){try{return c.call(t,f,h,d)}catch(m){if(!l(m))throw m}}}function a(c){return c&&function(f,h,d){typeof h=="function"&&(d=h,h=null);function m(b,D){D&&(D.uid<0&&(D.uid+=4294967296),D.gid<0&&(D.gid+=4294967296)),d&&d.apply(this,arguments)}return h?c.call(t,f,h,m):c.call(t,f,m)}}function u(c){return c&&function(f,h){var d=h?c.call(t,f,h):c.call(t,f);return d&&(d.uid<0&&(d.uid+=4294967296),d.gid<0&&(d.gid+=4294967296)),d}}function l(c){if(!c||c.code==="ENOSYS")return!0;var f=!process.getuid||process.getuid()!==0;return!!(f&&(c.code==="EINVAL"||c.code==="EPERM"))}}});var gx=y((Lle,mx)=>{var px=require("stream").Stream;mx.exports=bz;function bz(t){return{ReadStream:e,WriteStream:r};function e(n,i){if(!(this instanceof e))return new e(n,i);px.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 l=s[a];this[l]=i[l]}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(c,f){if(c){o.emit("error",c),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);px.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 Dx=y((Ble,yx)=>{"use strict";yx.exports=_z;var wz=Object.getPrototypeOf||function(t){return t.__proto__};function _z(t){if(t===null||typeof t!="object")return t;if(t instanceof Object)var e={__proto__:wz(t)};else var e=Object.create(null);return Object.getOwnPropertyNames(t).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}});var Xn=y((qle,vy)=>{var ze=require("fs"),Ez=hx(),Cz=gx(),Sz=Dx(),Bf=require("util"),wt,Mf;typeof Symbol=="function"&&typeof Symbol.for=="function"?(wt=Symbol.for("graceful-fs.queue"),Mf=Symbol.for("graceful-fs.previous")):(wt="___graceful-fs.queue",Mf="___graceful-fs.previous");function xz(){}function wx(t,e){Object.defineProperty(t,wt,{get:function(){return e}})}var Ji=xz;Bf.debuglog?Ji=Bf.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(Ji=function(){var t=Bf.format.apply(Bf,arguments);t="GFS4: "+t.split(/\n/).join(`
|
|
38
|
+
GFS4: `),console.error(t)});ze[wt]||(vx=global[wt]||[],wx(ze,vx),ze.close=function(t){function e(r,n){return t.call(ze,r,function(i){i||bx(),typeof n=="function"&&n.apply(this,arguments)})}return Object.defineProperty(e,Mf,{value:t}),e}(ze.close),ze.closeSync=function(t){function e(r){t.apply(ze,arguments),bx()}return Object.defineProperty(e,Mf,{value:t}),e}(ze.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){Ji(ze[wt]),require("assert").equal(ze[wt].length,0)}));var vx;global[wt]||wx(global,ze[wt]);vy.exports=yy(Sz(ze));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!ze.__patched&&(vy.exports=yy(ze),ze.__patched=!0);function yy(t){Ez(t),t.gracefulify=yy,t.createReadStream=A,t.createWriteStream=T;var e=t.readFile;t.readFile=r;function r(S,I,$){return typeof I=="function"&&($=I,I=null),B(S,I,$);function B(q,K,V,E){return e(q,K,function(v){v&&(v.code==="EMFILE"||v.code==="ENFILE")?_s([B,[q,K,V],v,E||Date.now(),Date.now()]):typeof V=="function"&&V.apply(this,arguments)})}}var n=t.writeFile;t.writeFile=i;function i(S,I,$,B){return typeof $=="function"&&(B=$,$=null),q(S,I,$,B);function q(K,V,E,v,w){return n(K,V,E,function(O){O&&(O.code==="EMFILE"||O.code==="ENFILE")?_s([q,[K,V,E,v],O,w||Date.now(),Date.now()]):typeof v=="function"&&v.apply(this,arguments)})}}var o=t.appendFile;o&&(t.appendFile=s);function s(S,I,$,B){return typeof $=="function"&&(B=$,$=null),q(S,I,$,B);function q(K,V,E,v,w){return o(K,V,E,function(O){O&&(O.code==="EMFILE"||O.code==="ENFILE")?_s([q,[K,V,E,v],O,w||Date.now(),Date.now()]):typeof v=="function"&&v.apply(this,arguments)})}}var a=t.copyFile;a&&(t.copyFile=u);function u(S,I,$,B){return typeof $=="function"&&(B=$,$=0),q(S,I,$,B);function q(K,V,E,v,w){return a(K,V,E,function(O){O&&(O.code==="EMFILE"||O.code==="ENFILE")?_s([q,[K,V,E,v],O,w||Date.now(),Date.now()]):typeof v=="function"&&v.apply(this,arguments)})}}var l=t.readdir;t.readdir=f;var c=/^v[0-5]\./;function f(S,I,$){typeof I=="function"&&($=I,I=null);var B=c.test(process.version)?function(V,E,v,w){return l(V,q(V,E,v,w))}:function(V,E,v,w){return l(V,E,q(V,E,v,w))};return B(S,I,$);function q(K,V,E,v){return function(w,O){w&&(w.code==="EMFILE"||w.code==="ENFILE")?_s([B,[K,V,E],w,v||Date.now(),Date.now()]):(O&&O.sort&&O.sort(),typeof E=="function"&&E.call(this,w,O))}}}if(process.version.substr(0,4)==="v0.8"){var h=Cz(t);_=h.ReadStream,g=h.WriteStream}var d=t.ReadStream;d&&(_.prototype=Object.create(d.prototype),_.prototype.open=F);var m=t.WriteStream;m&&(g.prototype=Object.create(m.prototype),g.prototype.open=C),Object.defineProperty(t,"ReadStream",{get:function(){return _},set:function(S){_=S},enumerable:!0,configurable:!0}),Object.defineProperty(t,"WriteStream",{get:function(){return g},set:function(S){g=S},enumerable:!0,configurable:!0});var b=_;Object.defineProperty(t,"FileReadStream",{get:function(){return b},set:function(S){b=S},enumerable:!0,configurable:!0});var D=g;Object.defineProperty(t,"FileWriteStream",{get:function(){return D},set:function(S){D=S},enumerable:!0,configurable:!0});function _(S,I){return this instanceof _?(d.apply(this,arguments),this):_.apply(Object.create(_.prototype),arguments)}function F(){var S=this;L(S.path,S.flags,S.mode,function(I,$){I?(S.autoClose&&S.destroy(),S.emit("error",I)):(S.fd=$,S.emit("open",$),S.read())})}function g(S,I){return this instanceof g?(m.apply(this,arguments),this):g.apply(Object.create(g.prototype),arguments)}function C(){var S=this;L(S.path,S.flags,S.mode,function(I,$){I?(S.destroy(),S.emit("error",I)):(S.fd=$,S.emit("open",$))})}function A(S,I){return new t.ReadStream(S,I)}function T(S,I){return new t.WriteStream(S,I)}var x=t.open;t.open=L;function L(S,I,$,B){return typeof $=="function"&&(B=$,$=null),q(S,I,$,B);function q(K,V,E,v,w){return x(K,V,E,function(O,j){O&&(O.code==="EMFILE"||O.code==="ENFILE")?_s([q,[K,V,E,v],O,w||Date.now(),Date.now()]):typeof v=="function"&&v.apply(this,arguments)})}}return t}function _s(t){Ji("ENQUEUE",t[0].name,t[1]),ze[wt].push(t),Dy()}var qf;function bx(){for(var t=Date.now(),e=0;e<ze[wt].length;++e)ze[wt][e].length>2&&(ze[wt][e][3]=t,ze[wt][e][4]=t);Dy()}function Dy(){if(clearTimeout(qf),qf=void 0,ze[wt].length!==0){var t=ze[wt].shift(),e=t[0],r=t[1],n=t[2],i=t[3],o=t[4];if(i===void 0)Ji("RETRY",e.name,r),e.apply(null,r);else if(Date.now()-i>=6e4){Ji("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),l=Math.min(u*1.2,100);a>=l?(Ji("RETRY",e.name,r),e.apply(null,r.concat([i]))):ze[wt].push(t)}qf===void 0&&(qf=setTimeout(Dy,0))}}});var Ex=y((Mle,_x)=>{function pr(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))}_x.exports=pr;pr.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts};pr.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timeouts=[],this._cachedTimeouts=null};pr.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};pr.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)};pr.prototype.try=function(t){console.log("Using RetryOperation.try() is deprecated"),this.attempt(t)};pr.prototype.start=function(t){console.log("Using RetryOperation.start() is deprecated"),this.attempt(t)};pr.prototype.start=pr.prototype.try;pr.prototype.errors=function(){return this._errors};pr.prototype.attempts=function(){return this._attempts};pr.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 Cx=y(Xi=>{var Fz=Ex();Xi.operation=function(t){var e=Xi.timeouts(t);return new Fz(e,{forever:t&&t.forever,unref:t&&t.unref,maxRetryTime:t&&t.maxRetryTime})};Xi.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};Xi.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};Xi.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 l=Xi.operation(e),c=Array.prototype.slice.call(arguments,1),f=c.pop();c.push(function(h){l.retry(h)||(h&&(arguments[0]=l.mainError()),f.apply(this,arguments))}),l.attempt(function(){u.apply(t,c)})}.bind(t,s),t[o].options=e}}});var xx=y((Hle,Sx)=>{Sx.exports=Cx()});var Fx=y((Vle,Uf)=>{Uf.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];process.platform!=="win32"&&Uf.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&Uf.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")});var _y=y((zle,Ss)=>{var Be=global.process,Zi=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"};Zi(Be)?(Ox=require("assert"),Es=Fx(),Ax=/^win/i.test(Be.platform),ju=require("events"),typeof ju!="function"&&(ju=ju.EventEmitter),Be.__signal_exit_emitter__?ft=Be.__signal_exit_emitter__:(ft=Be.__signal_exit_emitter__=new ju,ft.count=0,ft.emitted={}),ft.infinite||(ft.setMaxListeners(1/0),ft.infinite=!0),Ss.exports=function(t,e){if(!Zi(global.process))return function(){};Ox.equal(typeof t,"function","a callback must be provided for exit handler"),Cs===!1&&by();var r="exit";e&&e.alwaysLast&&(r="afterexit");var n=function(){ft.removeListener(r,t),ft.listeners("exit").length===0&&ft.listeners("afterexit").length===0&&Hf()};return ft.on(r,t),n},Hf=function(){!Cs||!Zi(global.process)||(Cs=!1,Es.forEach(function(e){try{Be.removeListener(e,Vf[e])}catch{}}),Be.emit=zf,Be.reallyExit=wy,ft.count-=1)},Ss.exports.unload=Hf,Qi=function(e,r,n){ft.emitted[e]||(ft.emitted[e]=!0,ft.emit(e,r,n))},Vf={},Es.forEach(function(t){Vf[t]=function(){if(Zi(global.process)){var r=Be.listeners(t);r.length===ft.count&&(Hf(),Qi("exit",null,t),Qi("afterexit",null,t),Ax&&t==="SIGHUP"&&(t="SIGINT"),Be.kill(Be.pid,t))}}}),Ss.exports.signals=function(){return Es},Cs=!1,by=function(){Cs||!Zi(global.process)||(Cs=!0,ft.count+=1,Es=Es.filter(function(e){try{return Be.on(e,Vf[e]),!0}catch{return!1}}),Be.emit=Tx,Be.reallyExit=kx)},Ss.exports.load=by,wy=Be.reallyExit,kx=function(e){Zi(global.process)&&(Be.exitCode=e||0,Qi("exit",Be.exitCode,null),Qi("afterexit",Be.exitCode,null),wy.call(Be,Be.exitCode))},zf=Be.emit,Tx=function(e,r){if(e==="exit"&&Zi(global.process)){r!==void 0&&(Be.exitCode=r);var n=zf.apply(this,arguments);return Qi("exit",Be.exitCode,null),Qi("afterexit",Be.exitCode,null),n}else return zf.apply(this,arguments)}):Ss.exports=function(){return function(){}};var Ox,Es,Ax,ju,ft,Hf,Qi,Vf,Cs,by,wy,kx,zf,Tx});var Rx=y((Gle,Ey)=>{"use strict";var Px=Symbol();function Oz(t,e,r){let n=e[Px];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,Px,{value:u}),r(null,a.mtime,u)})})}function Az(t){let e=Date.now();return t==="s"&&(e=Math.ceil(e/1e3)*1e3),new Date(e)}Ey.exports.probe=Oz;Ey.exports.getMtime=Az});var Lx=y((Wle,Lu)=>{"use strict";var kz=require("path"),xy=Xn(),Tz=xx(),Pz=_y(),$x=Rx(),gn={};function Nu(t,e){return e.lockfilePath||`${t}.lock`}function Fy(t,e,r){if(!e.realpath)return r(null,kz.resolve(t));e.fs.realpath(t,r)}function Sy(t,e,r){let n=Nu(t,e);e.fs.mkdir(n,i=>{if(!i)return $x.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"?Sy(t,{...e,stale:0},r):r(o);if(!Ix(s,e))return r(Object.assign(new Error("Lock file is already being held"),{code:"ELOCKED",file:t}));jx(t,e,a=>{if(a)return r(a);Sy(t,{...e,stale:0},r)})})})}function Ix(t,e){return t.mtime.getTime()<Date.now()-e.stale}function jx(t,e,r){e.fs.rmdir(Nu(t,e),n=>{if(n&&n.code!=="ENOENT")return r(n);r()})}function Gf(t,e){let r=gn[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?Cy(t,r,Object.assign(n,{code:"ECOMPROMISED"})):(r.updateDelay=1e3,Gf(t,e));if(!(r.mtime.getTime()===i.mtime.getTime()))return Cy(t,r,Object.assign(new Error("Unable to update lock within the stale threshold"),{code:"ECOMPROMISED"}));let a=$x.getMtime(r.mtimePrecision);e.fs.utimes(r.lockfilePath,a,a,u=>{let l=r.lastUpdate+e.stale<Date.now();if(!r.released){if(u)return u.code==="ENOENT"||l?Cy(t,r,Object.assign(u,{code:"ECOMPROMISED"})):(r.updateDelay=1e3,Gf(t,e));r.mtime=a,r.lastUpdate=Date.now(),r.updateDelay=null,Gf(t,e)}})})},r.updateDelay),r.updateTimeout.unref&&r.updateTimeout.unref())}function Cy(t,e,r){e.released=!0,e.updateTimeout&&clearTimeout(e.updateTimeout),gn[t]===e&&delete gn[t],e.options.onCompromised(r)}function Rz(t,e,r){e={stale:1e4,update:null,realpath:!0,retries:0,fs:xy,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),Fy(t,e,(n,i)=>{if(n)return r(n);let o=Tz.operation(e.retries);o.attempt(()=>{Sy(i,e,(s,a,u)=>{if(o.retry(s))return;if(s)return r(o.mainError());let l=gn[i]={lockfilePath:Nu(i,e),mtime:a,mtimePrecision:u,options:e,lastUpdate:Date.now()};Gf(i,e),r(null,c=>{if(l.released)return c&&c(Object.assign(new Error("Lock is already released"),{code:"ERELEASED"}));Nx(i,{...e,realpath:!1},c)})})})})}function Nx(t,e,r){e={fs:xy,realpath:!0,...e},Fy(t,e,(n,i)=>{if(n)return r(n);let o=gn[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 gn[i],jx(i,e,r)})}function $z(t,e,r){e={stale:1e4,realpath:!0,fs:xy,...e},e.stale=Math.max(e.stale||0,2e3),Fy(t,e,(n,i)=>{if(n)return r(n);e.fs.stat(Nu(i,e),(o,s)=>o?o.code==="ENOENT"?r(null,!1):r(o):r(null,!Ix(s,e)))})}function Iz(){return gn}Pz(()=>{for(let t in gn){let e=gn[t].options;try{e.fs.rmdirSync(Nu(t,e))}catch{}}});Lu.exports.lock=Rz;Lu.exports.unlock=Nx;Lu.exports.check=$z;Lu.exports.getLocks=Iz});var qx=y((Kle,Bx)=>{"use strict";var jz=Xn();function Nz(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 Lz(t){return(...e)=>new Promise((r,n)=>{e.push((i,o)=>{i?n(i):r(o)}),t(...e)})}function Bz(t){return(...e)=>{let r,n;if(e.push((i,o)=>{r=i,n=o}),t(...e),r)throw r;return n}}function qz(t){if(t={...t},t.fs=Nz(t.fs||jz),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}Bx.exports={toPromise:Lz,toSync:Bz,toSyncOptions:qz}});var Ux=y((Yle,Zn)=>{"use strict";var xs=Lx(),{toPromise:Wf,toSync:Kf,toSyncOptions:Oy}=qx();async function Mx(t,e){let r=await Wf(xs.lock)(t,e);return Wf(r)}function Mz(t,e){let r=Kf(xs.lock)(t,Oy(e));return Kf(r)}function Uz(t,e){return Wf(xs.unlock)(t,e)}function Hz(t,e){return Kf(xs.unlock)(t,Oy(e))}function Vz(t,e){return Wf(xs.check)(t,e)}function zz(t,e){return Kf(xs.check)(t,Oy(e))}Zn.exports=Mx;Zn.exports.lock=Mx;Zn.exports.unlock=Uz;Zn.exports.lockSync=Mz;Zn.exports.unlockSync=Hz;Zn.exports.check=Vz;Zn.exports.checkSync=zz});var Wx=y(Fs=>{"use strict";Object.defineProperty(Fs,"__esModule",{value:!0});Fs.canStoreURLs=Fs.FileUrlStorage=void 0;var Hx=require("fs"),Gz=Kz(fx()),Vx=Wz(Ux());function Gx(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,r=new WeakMap;return(Gx=function(n){return n?r:e})(t)}function Wz(t,e){if(!e&&t&&t.__esModule)return t;if(t===null||typeof t!="object"&&typeof t!="function")return{default:t};var r=Gx(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 Kz(t){return t&&t.__esModule?t:{default:t}}function Bu(t){"@babel/helpers - typeof";return Bu=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},Bu(t)}function Yz(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function zx(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,Xz(n.key),n)}}function Jz(t,e,r){return e&&zx(t.prototype,e),r&&zx(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function Xz(t){var e=Zz(t,"string");return Bu(e)=="symbol"?e:e+""}function Zz(t,e){if(Bu(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Bu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Jle=Fs.canStoreURLs=!0,Xle=Fs.FileUrlStorage=function(){function t(e){Yz(this,t),this.path=e}return Jz(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(l){l?u(l):a(s)})})}},{key:"_setItem",value:function(r,n,i){var o=this;Vx.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(l){return i(l)})})}).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;Vx.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,Gz.default)([i,o]))});return}r().then(n).catch(n)}}},{key:"_writeData",value:function(r,n){var i={encoding:"utf8",mode:432,flag:"w"};(0,Hx.writeFile)(this.path,JSON.stringify(r),i,function(o){return n(o)})}},{key:"_getData",value:function(r){(0,Hx.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 Ty=y(Vt=>{"use strict";Object.defineProperty(Vt,"__esModule",{value:!0});Object.defineProperty(Vt,"DefaultHttpStack",{enumerable:!0,get:function(){return Xx.default}});Object.defineProperty(Vt,"DetailedError",{enumerable:!0,get:function(){return Qz.default}});Object.defineProperty(Vt,"FileUrlStorage",{enumerable:!0,get:function(){return Zx.FileUrlStorage}});Object.defineProperty(Vt,"StreamSource",{enumerable:!0,get:function(){return iG.default}});Vt.Upload=void 0;Object.defineProperty(Vt,"canStoreURLs",{enumerable:!0,get:function(){return Zx.canStoreURLs}});Vt.defaultOptions=void 0;Object.defineProperty(Vt,"enableDebugLog",{enumerable:!0,get:function(){return eG.enableDebugLog}});Vt.isSupported=void 0;var Qz=eo(Cg()),eG=Sg(),tG=eo(WC()),Ay=eo(ES()),rG=eo(jS()),nG=eo(qS()),Xx=eo(e1()),iG=eo(Bg()),Zx=Wx();function eo(t){return t&&t.__esModule?t:{default:t}}function As(t){"@babel/helpers - typeof";return As=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},As(t)}function oG(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Kx(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,eF(n.key),n)}}function sG(t,e,r){return e&&Kx(t.prototype,e),r&&Kx(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function aG(t,e,r){return e=Yf(e),uG(t,Qx()?Reflect.construct(e,r||[],Yf(t).constructor):e.apply(t,r))}function uG(t,e){if(e&&(As(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return lG(t)}function lG(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Qx(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Qx=function(){return!!t})()}function Yf(t){return Yf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Yf(t)}function cG(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&&ky(t,e)}function ky(t,e){return ky=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},ky(t,e)}function Yx(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 Os(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Yx(Object(r),!0).forEach(function(n){fG(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Yx(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function fG(t,e,r){return e=eF(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function eF(t){var e=dG(t,"string");return As(e)=="symbol"?e:e+""}function dG(t,e){if(As(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(As(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Jx=Vt.defaultOptions=Os(Os({},Ay.default.defaultOptions),{},{httpStack:new Xx.default,fileReader:new rG.default,urlStorage:new tG.default,fingerprint:nG.default}),Qle=Vt.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 oG(this,e),n=Os(Os({},Jx),n),aG(this,e,[r,n])}return cG(e,t),sG(e,null,[{key:"terminate",value:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return i=Os(Os({},Jx),i),Ay.default.terminate(n,i)}}])}(Ay.default),ece=Vt.isSupported=!0});var rr={};gi(rr,{__addDisposableResource:()=>SF,__assign:()=>Jf,__asyncDelegator:()=>yF,__asyncGenerator:()=>gF,__asyncValues:()=>DF,__await:()=>ks,__awaiter:()=>cF,__classPrivateFieldGet:()=>_F,__classPrivateFieldIn:()=>CF,__classPrivateFieldSet:()=>EF,__createBinding:()=>Zf,__decorate:()=>nF,__disposeResources:()=>xF,__esDecorate:()=>oF,__exportStar:()=>dF,__extends:()=>tF,__generator:()=>fF,__importDefault:()=>wF,__importStar:()=>bF,__makeTemplateObject:()=>vF,__metadata:()=>lF,__param:()=>iF,__propKey:()=>aF,__read:()=>$y,__rest:()=>rF,__rewriteRelativeImportExtension:()=>FF,__runInitializers:()=>sF,__setFunctionName:()=>uF,__spread:()=>hF,__spreadArray:()=>mF,__spreadArrays:()=>pF,__values:()=>Xf,default:()=>mG});function tF(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Py(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}function rF(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 nF(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 iF(t,e){return function(r,n){e(r,n,t)}}function oF(t,e,r,n,i,o){function s(_){if(_!==void 0&&typeof _!="function")throw new TypeError("Function expected");return _}for(var a=n.kind,u=a==="getter"?"get":a==="setter"?"set":"value",l=!e&&t?n.static?t:t.prototype:null,c=e||(l?Object.getOwnPropertyDescriptor(l,n.name):{}),f,h=!1,d=r.length-1;d>=0;d--){var m={};for(var b in n)m[b]=b==="access"?{}:n[b];for(var b in n.access)m.access[b]=n.access[b];m.addInitializer=function(_){if(h)throw new TypeError("Cannot add initializers after decoration has completed");o.push(s(_||null))};var D=(0,r[d])(a==="accessor"?{get:c.get,set:c.set}:c[u],m);if(a==="accessor"){if(D===void 0)continue;if(D===null||typeof D!="object")throw new TypeError("Object expected");(f=s(D.get))&&(c.get=f),(f=s(D.set))&&(c.set=f),(f=s(D.init))&&i.unshift(f)}else(f=s(D))&&(a==="field"?i.unshift(f):c[u]=f)}l&&Object.defineProperty(l,n.name,c),h=!0}function sF(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 aF(t){return typeof t=="symbol"?t:"".concat(t)}function uF(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 lF(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function cF(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(c){try{l(n.next(c))}catch(f){s(f)}}function u(c){try{l(n.throw(c))}catch(f){s(f)}}function l(c){c.done?o(c.value):i(c.value).then(a,u)}l((n=n.apply(t,e||[])).next())})}function fF(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(l){return function(c){return u([l,c])}}function u(l){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,l[0]&&(r=0)),r;)try{if(n=1,i&&(o=l[0]&2?i.return:l[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,l[1])).done)return o;switch(i=0,o&&(l=[l[0]&2,o.value]),l[0]){case 0:case 1:o=l;break;case 4:return r.label++,{value:l[1],done:!1};case 5:r.label++,i=l[1],l=[0];continue;case 7:l=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(l[0]===6||l[0]===2)){r=0;continue}if(l[0]===3&&(!o||l[1]>o[0]&&l[1]<o[3])){r.label=l[1];break}if(l[0]===6&&r.label<o[1]){r.label=o[1],o=l;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(l);break}o[2]&&r.ops.pop(),r.trys.pop();continue}l=e.call(t,r)}catch(c){l=[6,c],i=0}finally{n=o=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}function dF(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Zf(e,t,r)}function Xf(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 $y(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($y(arguments[e]));return t}function pF(){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 mF(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 ks(t){return this instanceof ks?(this.v=t,this):new ks(t)}function gF(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(m){return Promise.resolve(m).then(d,f)}}function a(d,m){n[d]&&(i[d]=function(b){return new Promise(function(D,_){o.push([d,b,D,_])>1||u(d,b)})},m&&(i[d]=m(i[d])))}function u(d,m){try{l(n[d](m))}catch(b){h(o[0][3],b)}}function l(d){d.value instanceof ks?Promise.resolve(d.value.v).then(c,f):h(o[0][2],d)}function c(d){u("next",d)}function f(d){u("throw",d)}function h(d,m){d(m),o.shift(),o.length&&u(o[0][0],o[0][1])}}function yF(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:ks(t[i](s)),done:!1}:o?o(s):s}:o}}function DF(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 Xf=="function"?Xf(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(l){o({value:l,done:a})},s)}}function vF(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function bF(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r=Ry(t),n=0;n<r.length;n++)r[n]!=="default"&&Zf(e,t,r[n]);return hG(e,t),e}function wF(t){return t&&t.__esModule?t:{default:t}}function _F(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 EF(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 CF(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 SF(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 xF(t){function e(o){t.error=t.hasError?new pG(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()}function FF(t,e){return typeof t=="string"&&/^\.\.?\//.test(t)?t.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(r,n,i,o,s){return n?e?".jsx":".js":i&&(!o||!s)?r:i+o+"."+s.toLowerCase()+"js"}):t}var Py,Jf,Zf,hG,Ry,pG,mG,nr=Ct(()=>{Py=function(t,e){return Py=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])},Py(t,e)};Jf=function(){return Jf=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},Jf.apply(this,arguments)};Zf=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]};hG=Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e},Ry=function(t){return Ry=Object.getOwnPropertyNames||function(e){var r=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(r[r.length]=n);return r},Ry(t)};pG=typeof SuppressedError=="function"?SuppressedError:function(t,e,r){var n=new Error(r);return n.name="SuppressedError",n.error=t,n.suppressed=e,n};mG={__extends:tF,__assign:Jf,__rest:rF,__decorate:nF,__param:iF,__esDecorate:oF,__runInitializers:sF,__propKey:aF,__setFunctionName:uF,__metadata:lF,__awaiter:cF,__generator:fF,__createBinding:Zf,__exportStar:dF,__values:Xf,__read:$y,__spread:hF,__spreadArrays:pF,__spreadArray:mF,__await:ks,__asyncGenerator:gF,__asyncDelegator:yF,__asyncValues:DF,__makeTemplateObject:vF,__importStar:bF,__importDefault:wF,__classPrivateFieldGet:_F,__classPrivateFieldSet:EF,__classPrivateFieldIn:CF,__addDisposableResource:SF,__disposeResources:xF,__rewriteRelativeImportExtension:FF}});var AF=y((rce,OF)=>{var Ts=1e3,Ps=Ts*60,Rs=Ps*60,to=Rs*24,gG=to*7,yG=to*365.25;OF.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return DG(t);if(r==="number"&&isFinite(t))return e.long?bG(t):vG(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function DG(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*yG;case"weeks":case"week":case"w":return r*gG;case"days":case"day":case"d":return r*to;case"hours":case"hour":case"hrs":case"hr":case"h":return r*Rs;case"minutes":case"minute":case"mins":case"min":case"m":return r*Ps;case"seconds":case"second":case"secs":case"sec":case"s":return r*Ts;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}function vG(t){var e=Math.abs(t);return e>=to?Math.round(t/to)+"d":e>=Rs?Math.round(t/Rs)+"h":e>=Ps?Math.round(t/Ps)+"m":e>=Ts?Math.round(t/Ts)+"s":t+"ms"}function bG(t){var e=Math.abs(t);return e>=to?Qf(t,e,to,"day"):e>=Rs?Qf(t,e,Rs,"hour"):e>=Ps?Qf(t,e,Ps,"minute"):e>=Ts?Qf(t,e,Ts,"second"):t+" ms"}function Qf(t,e,r,n){var i=e>=r*1.5;return Math.round(t/r)+" "+n+(i?"s":"")}});var Iy=y((nce,kF)=>{function wG(t){r.debug=r,r.default=r,r.coerce=u,r.disable=s,r.enable=i,r.enabled=a,r.humanize=AF(),r.destroy=l,Object.keys(t).forEach(c=>{r[c]=t[c]}),r.names=[],r.skips=[],r.formatters={};function e(c){let f=0;for(let h=0;h<c.length;h++)f=(f<<5)-f+c.charCodeAt(h),f|=0;return r.colors[Math.abs(f)%r.colors.length]}r.selectColor=e;function r(c){let f,h=null,d,m;function b(...D){if(!b.enabled)return;let _=b,F=Number(new Date),g=F-(f||F);_.diff=g,_.prev=f,_.curr=F,f=F,D[0]=r.coerce(D[0]),typeof D[0]!="string"&&D.unshift("%O");let C=0;D[0]=D[0].replace(/%([a-zA-Z%])/g,(T,x)=>{if(T==="%%")return"%";C++;let L=r.formatters[x];if(typeof L=="function"){let S=D[C];T=L.call(_,S),D.splice(C,1),C--}return T}),r.formatArgs.call(_,D),(_.log||r.log).apply(_,D)}return b.namespace=c,b.useColors=r.useColors(),b.color=r.selectColor(c),b.extend=n,b.destroy=r.destroy,Object.defineProperty(b,"enabled",{enumerable:!0,configurable:!1,get:()=>h!==null?h:(d!==r.namespaces&&(d=r.namespaces,m=r.enabled(c)),m),set:D=>{h=D}}),typeof r.init=="function"&&r.init(b),b}function n(c,f){let h=r(this.namespace+(typeof f>"u"?":":f)+c);return h.log=this.log,h}function i(c){r.save(c),r.namespaces=c,r.names=[],r.skips=[];let f=(typeof c=="string"?c:"").trim().replace(" ",",").split(",").filter(Boolean);for(let h of f)h[0]==="-"?r.skips.push(h.slice(1)):r.names.push(h)}function o(c,f){let h=0,d=0,m=-1,b=0;for(;h<c.length;)if(d<f.length&&(f[d]===c[h]||f[d]==="*"))f[d]==="*"?(m=d,b=h,d++):(h++,d++);else if(m!==-1)d=m+1,b++,h=b;else return!1;for(;d<f.length&&f[d]==="*";)d++;return d===f.length}function s(){let c=[...r.names,...r.skips.map(f=>"-"+f)].join(",");return r.enable(""),c}function a(c){for(let f of r.skips)if(o(c,f))return!1;for(let f of r.names)if(o(c,f))return!0;return!1}function u(c){return c instanceof Error?c.stack||c.message:c}function l(){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}kF.exports=wG});var TF=y((ir,ed)=>{ir.formatArgs=EG;ir.save=CG;ir.load=SG;ir.useColors=_G;ir.storage=xG();ir.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`."))}})();ir.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 _G(){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 EG(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+ed.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)}ir.log=console.debug||console.log||(()=>{});function CG(t){try{t?ir.storage.setItem("debug",t):ir.storage.removeItem("debug")}catch{}}function SG(){let t;try{t=ir.storage.getItem("debug")}catch{}return!t&&typeof process<"u"&&"env"in process&&(t=process.env.DEBUG),t}function xG(){try{return localStorage}catch{}}ed.exports=Iy()(ir);var{formatters:FG}=ed.exports;FG.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var RF=y((ice,PF)=>{"use strict";PF.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 jF=y((oce,IF)=>{"use strict";var OG=require("os"),$F=require("tty"),mr=RF(),{env:dt}=process,Qn;mr("no-color")||mr("no-colors")||mr("color=false")||mr("color=never")?Qn=0:(mr("color")||mr("colors")||mr("color=true")||mr("color=always"))&&(Qn=1);"FORCE_COLOR"in dt&&(dt.FORCE_COLOR==="true"?Qn=1:dt.FORCE_COLOR==="false"?Qn=0:Qn=dt.FORCE_COLOR.length===0?1:Math.min(parseInt(dt.FORCE_COLOR,10),3));function jy(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}function Ny(t,e){if(Qn===0)return 0;if(mr("color=16m")||mr("color=full")||mr("color=truecolor"))return 3;if(mr("color=256"))return 2;if(t&&!e&&Qn===void 0)return 0;let r=Qn||0;if(dt.TERM==="dumb")return r;if(process.platform==="win32"){let n=OG.release().split(".");return Number(n[0])>=10&&Number(n[2])>=10586?Number(n[2])>=14931?3:2:1}if("CI"in dt)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(n=>n in dt)||dt.CI_NAME==="codeship"?1:r;if("TEAMCITY_VERSION"in dt)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(dt.TEAMCITY_VERSION)?1:0;if(dt.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in dt){let n=parseInt((dt.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(dt.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(dt.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(dt.TERM)||"COLORTERM"in dt?1:r}function AG(t){let e=Ny(t,t&&t.isTTY);return jy(e)}IF.exports={supportsColor:AG,stdout:jy(Ny(!0,$F.isatty(1))),stderr:jy(Ny(!0,$F.isatty(2)))}});var LF=y((ht,rd)=>{var kG=require("tty"),td=require("util");ht.init=NG;ht.log=$G;ht.formatArgs=PG;ht.save=IG;ht.load=jG;ht.useColors=TG;ht.destroy=td.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");ht.colors=[6,2,3,4,5,1];try{let t=jF();t&&(t.stderr||t).level>=2&&(ht.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{}ht.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 TG(){return"colors"in ht.inspectOpts?!!ht.inspectOpts.colors:kG.isatty(process.stderr.fd)}function PG(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(`
|
|
39
39
|
`).join(`
|
|
40
|
-
`+o),t.push(i+"m+"+rd.exports.humanize(this.diff)+"\x1B[0m")}else t[0]=
|
|
41
|
-
`)}function
|
|
42
|
-
`).map(e=>e.trim()).join(" ")};
|
|
40
|
+
`+o),t.push(i+"m+"+rd.exports.humanize(this.diff)+"\x1B[0m")}else t[0]=RG()+e+" "+t[0]}function RG(){return ht.inspectOpts.hideDate?"":new Date().toISOString()+" "}function $G(...t){return process.stderr.write(td.formatWithOptions(ht.inspectOpts,...t)+`
|
|
41
|
+
`)}function IG(t){t?process.env.DEBUG=t:delete process.env.DEBUG}function jG(){return process.env.DEBUG}function NG(t){t.inspectOpts={};let e=Object.keys(ht.inspectOpts);for(let r=0;r<e.length;r++)t.inspectOpts[e[r]]=ht.inspectOpts[e[r]]}rd.exports=Iy()(ht);var{formatters:NF}=rd.exports;NF.o=function(t){return this.inspectOpts.colors=this.useColors,td.inspect(t,this.inspectOpts).split(`
|
|
42
|
+
`).map(e=>e.trim()).join(" ")};NF.O=function(t){return this.inspectOpts.colors=this.useColors,td.inspect(t,this.inspectOpts)}});var By=y((sce,Ly)=>{typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?Ly.exports=TF():Ly.exports=LF()});var pt=y(qy=>{"use strict";qy.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})};qy.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 Pt=y(yn=>{"use strict";var BF=pt().fromCallback,Tt=Xn(),LG=["access","appendFile","chmod","chown","close","copyFile","cp","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","glob","lchmod","lchown","lutimes","link","lstat","mkdir","mkdtemp","open","opendir","readdir","readFile","readlink","realpath","rename","rm","rmdir","stat","statfs","symlink","truncate","unlink","utimes","writeFile"].filter(t=>typeof Tt[t]=="function");Object.assign(yn,Tt);LG.forEach(t=>{yn[t]=BF(Tt[t])});yn.exists=function(t,e){return typeof e=="function"?Tt.exists(t,e):new Promise(r=>Tt.exists(t,r))};yn.read=function(t,e,r,n,i,o){return typeof o=="function"?Tt.read(t,e,r,n,i,o):new Promise((s,a)=>{Tt.read(t,e,r,n,i,(u,l,c)=>{if(u)return a(u);s({bytesRead:l,buffer:c})})})};yn.write=function(t,e,...r){return typeof r[r.length-1]=="function"?Tt.write(t,e,...r):new Promise((n,i)=>{Tt.write(t,e,...r,(o,s,a)=>{if(o)return i(o);n({bytesWritten:s,buffer:a})})})};yn.readv=function(t,e,...r){return typeof r[r.length-1]=="function"?Tt.readv(t,e,...r):new Promise((n,i)=>{Tt.readv(t,e,...r,(o,s,a)=>{if(o)return i(o);n({bytesRead:s,buffers:a})})})};yn.writev=function(t,e,...r){return typeof r[r.length-1]=="function"?Tt.writev(t,e,...r):new Promise((n,i)=>{Tt.writev(t,e,...r,(o,s,a)=>{if(o)return i(o);n({bytesWritten:s,buffers:a})})})};typeof Tt.realpath.native=="function"?yn.realpath.native=BF(Tt.realpath.native):process.emitWarning("fs.realpath.native is not a function. Is fs being monkey-patched?","Warning","fs-extra-WARN0003")});var MF=y((lce,qF)=>{"use strict";var BG=require("path");qF.exports.checkPath=function(e){if(process.platform==="win32"&&/[<>:"|?*]/.test(e.replace(BG.parse(e).root,""))){let n=new Error(`Path contains invalid characters: ${e}`);throw n.code="EINVAL",n}}});var zF=y((cce,My)=>{"use strict";var UF=Pt(),{checkPath:HF}=MF(),VF=t=>{let e={mode:511};return typeof t=="number"?t:{...e,...t}.mode};My.exports.makeDir=async(t,e)=>(HF(t),UF.mkdir(t,{mode:VF(e),recursive:!0}));My.exports.makeDirSync=(t,e)=>(HF(t),UF.mkdirSync(t,{mode:VF(e),recursive:!0}))});var xr=y((fce,GF)=>{"use strict";var qG=pt().fromPromise,{makeDir:MG,makeDirSync:Uy}=zF(),Hy=qG(MG);GF.exports={mkdirs:Hy,mkdirsSync:Uy,mkdirp:Hy,mkdirpSync:Uy,ensureDir:Hy,ensureDirSync:Uy}});var ei=y((dce,KF)=>{"use strict";var UG=pt().fromPromise,WF=Pt();function HG(t){return WF.access(t).then(()=>!0).catch(()=>!1)}KF.exports={pathExists:UG(HG),pathExistsSync:WF.existsSync}});var Vy=y((hce,YF)=>{"use strict";var $s=Pt(),VG=pt().fromPromise;async function zG(t,e,r){let n=await $s.open(t,"r+"),i=null;try{await $s.futimes(n,e,r)}finally{try{await $s.close(n)}catch(o){i=o}}if(i)throw i}function GG(t,e,r){let n=$s.openSync(t,"r+");return $s.futimesSync(n,e,r),$s.closeSync(n)}YF.exports={utimesMillis:VG(zG),utimesMillisSync:GG}});var ro=y((pce,QF)=>{"use strict";var Is=Pt(),mt=require("path"),JF=pt().fromPromise;function WG(t,e,r){let n=r.dereference?i=>Is.stat(i,{bigint:!0}):i=>Is.lstat(i,{bigint:!0});return Promise.all([n(t),n(e).catch(i=>{if(i.code==="ENOENT")return null;throw i})]).then(([i,o])=>({srcStat:i,destStat:o}))}function KG(t,e,r){let n,i=r.dereference?s=>Is.statSync(s,{bigint:!0}):s=>Is.lstatSync(s,{bigint:!0}),o=i(t);try{n=i(e)}catch(s){if(s.code==="ENOENT")return{srcStat:o,destStat:null};throw s}return{srcStat:o,destStat:n}}async function YG(t,e,r,n){let{srcStat:i,destStat:o}=await WG(t,e,n);if(o){if(qu(i,o)){let s=mt.basename(t),a=mt.basename(e);if(r==="move"&&s!==a&&s.toLowerCase()===a.toLowerCase())return{srcStat:i,destStat:o,isChangingCase:!0};throw new Error("Source and destination must not be the same.")}if(i.isDirectory()&&!o.isDirectory())throw new Error(`Cannot overwrite non-directory '${e}' with directory '${t}'.`);if(!i.isDirectory()&&o.isDirectory())throw new Error(`Cannot overwrite directory '${e}' with non-directory '${t}'.`)}if(i.isDirectory()&&zy(t,e))throw new Error(nd(t,e,r));return{srcStat:i,destStat:o}}function JG(t,e,r,n){let{srcStat:i,destStat:o}=KG(t,e,n);if(o){if(qu(i,o)){let s=mt.basename(t),a=mt.basename(e);if(r==="move"&&s!==a&&s.toLowerCase()===a.toLowerCase())return{srcStat:i,destStat:o,isChangingCase:!0};throw new Error("Source and destination must not be the same.")}if(i.isDirectory()&&!o.isDirectory())throw new Error(`Cannot overwrite non-directory '${e}' with directory '${t}'.`);if(!i.isDirectory()&&o.isDirectory())throw new Error(`Cannot overwrite directory '${e}' with non-directory '${t}'.`)}if(i.isDirectory()&&zy(t,e))throw new Error(nd(t,e,r));return{srcStat:i,destStat:o}}async function XF(t,e,r,n){let i=mt.resolve(mt.dirname(t)),o=mt.resolve(mt.dirname(r));if(o===i||o===mt.parse(o).root)return;let s;try{s=await Is.stat(o,{bigint:!0})}catch(a){if(a.code==="ENOENT")return;throw a}if(qu(e,s))throw new Error(nd(t,r,n));return XF(t,e,o,n)}function ZF(t,e,r,n){let i=mt.resolve(mt.dirname(t)),o=mt.resolve(mt.dirname(r));if(o===i||o===mt.parse(o).root)return;let s;try{s=Is.statSync(o,{bigint:!0})}catch(a){if(a.code==="ENOENT")return;throw a}if(qu(e,s))throw new Error(nd(t,r,n));return ZF(t,e,o,n)}function qu(t,e){return e.ino&&e.dev&&e.ino===t.ino&&e.dev===t.dev}function zy(t,e){let r=mt.resolve(t).split(mt.sep).filter(i=>i),n=mt.resolve(e).split(mt.sep).filter(i=>i);return r.every((i,o)=>n[o]===i)}function nd(t,e,r){return`Cannot ${r} '${t}' to a subdirectory of itself, '${e}'.`}QF.exports={checkPaths:JF(YG),checkPathsSync:JG,checkParentPaths:JF(XF),checkParentPathsSync:ZF,isSrcSubdir:zy,areIdentical:qu}});var i2=y((mce,n2)=>{"use strict";var xt=Pt(),Mu=require("path"),{mkdirs:XG}=xr(),{pathExists:ZG}=ei(),{utimesMillis:QG}=Vy(),Uu=ro();async function eW(t,e,r={}){typeof r=="function"&&(r={filter:r}),r.clobber="clobber"in r?!!r.clobber:!0,r.overwrite="overwrite"in r?!!r.overwrite:r.clobber,r.preserveTimestamps&&process.arch==="ia32"&&process.emitWarning(`Using the preserveTimestamps option in 32-bit node is not recommended;
|
|
43
43
|
|
|
44
|
-
see https://github.com/jprichardson/node-fs-extra/issues/269`,"Warning","fs-extra-WARN0001");let{srcStat:n,destStat:i}=await Uu.checkPaths(t,e,"copy",r);if(await Uu.checkParentPaths(t,n,e,"copy"),!await
|
|
44
|
+
see https://github.com/jprichardson/node-fs-extra/issues/269`,"Warning","fs-extra-WARN0001");let{srcStat:n,destStat:i}=await Uu.checkPaths(t,e,"copy",r);if(await Uu.checkParentPaths(t,n,e,"copy"),!await t2(t,e,r))return;let s=Mu.dirname(e);await ZG(s)||await XG(s),await r2(i,t,e,r)}async function t2(t,e,r){return r.filter?r.filter(t,e):!0}async function r2(t,e,r,n){let o=await(n.dereference?xt.stat:xt.lstat)(e);if(o.isDirectory())return iW(o,t,e,r,n);if(o.isFile()||o.isCharacterDevice()||o.isBlockDevice())return tW(o,t,e,r,n);if(o.isSymbolicLink())return oW(t,e,r,n);throw o.isSocket()?new Error(`Cannot copy a socket file: ${e}`):o.isFIFO()?new Error(`Cannot copy a FIFO pipe: ${e}`):new Error(`Unknown file: ${e}`)}async function tW(t,e,r,n,i){if(!e)return e2(t,r,n,i);if(i.overwrite)return await xt.unlink(n),e2(t,r,n,i);if(i.errorOnExist)throw new Error(`'${n}' already exists`)}async function e2(t,e,r,n){if(await xt.copyFile(e,r),n.preserveTimestamps){rW(t.mode)&&await nW(r,t.mode);let i=await xt.stat(e);await QG(r,i.atime,i.mtime)}return xt.chmod(r,t.mode)}function rW(t){return(t&128)===0}function nW(t,e){return xt.chmod(t,e|128)}async function iW(t,e,r,n,i){e||await xt.mkdir(n);let o=[];for await(let s of await xt.opendir(r)){let a=Mu.join(r,s.name),u=Mu.join(n,s.name);o.push(t2(a,u,i).then(l=>{if(l)return Uu.checkPaths(a,u,"copy",i).then(({destStat:c})=>r2(c,a,u,i))}))}await Promise.all(o),e||await xt.chmod(n,t.mode)}async function oW(t,e,r,n){let i=await xt.readlink(e);if(n.dereference&&(i=Mu.resolve(process.cwd(),i)),!t)return xt.symlink(i,r);let o=null;try{o=await xt.readlink(r)}catch(s){if(s.code==="EINVAL"||s.code==="UNKNOWN")return xt.symlink(i,r);throw s}if(n.dereference&&(o=Mu.resolve(process.cwd(),o)),Uu.isSrcSubdir(i,o))throw new Error(`Cannot copy '${i}' to a subdirectory of itself, '${o}'.`);if(Uu.isSrcSubdir(o,i))throw new Error(`Cannot overwrite '${o}' with '${i}'.`);return await xt.unlink(r),xt.symlink(i,r)}n2.exports=eW});var l2=y((gce,u2)=>{"use strict";var Rt=Xn(),Hu=require("path"),sW=xr().mkdirsSync,aW=Vy().utimesMillisSync,Vu=ro();function uW(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"&&process.emitWarning(`Using the preserveTimestamps option in 32-bit node is not recommended;
|
|
45
45
|
|
|
46
|
-
see https://github.com/jprichardson/node-fs-extra/issues/269`,"Warning","fs-extra-WARN0002");let{srcStat:n,destStat:i}=Vu.checkPathsSync(t,e,"copy",r);if(Vu.checkParentPathsSync(t,n,e,"copy"),r.filter&&!r.filter(t,e))return;let o=Hu.dirname(e);return Rt.existsSync(o)||
|
|
47
|
-
`,finalEOL:r=!0,replacer:n=null,spaces:i}={}){let o=r?e:"";return JSON.stringify(t,n,i).replace(/\n/g,e)+o}function YW(t){return Buffer.isBuffer(t)&&(t=t.toString("utf8")),t.replace(/^\uFEFF/,"")}GF.exports={stringify:KW,stripBom:YW}});var JF=y((Cce,YF)=>{var js;try{js=Xn()}catch{js=require("fs")}var sd=pt(),{stringify:WF,stripBom:KF}=od();async function JW(t,e={}){typeof e=="string"&&(e={encoding:e});let r=e.fs||js,n="throws"in e?e.throws:!0,i=await sd.fromCallback(r.readFile)(t,e);i=KF(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 XW=sd.fromPromise(JW);function ZW(t,e={}){typeof e=="string"&&(e={encoding:e});let r=e.fs||js,n="throws"in e?e.throws:!0;try{let i=r.readFileSync(t,e);return i=KF(i),JSON.parse(i,e.reviver)}catch(i){if(n)throw i.message=`${t}: ${i.message}`,i;return null}}async function QW(t,e,r={}){let n=r.fs||js,i=WF(e,r);await sd.fromCallback(n.writeFile)(t,i,r)}var eK=sd.fromPromise(QW);function tK(t,e,r={}){let n=r.fs||js,i=WF(e,r);return n.writeFileSync(t,i,r)}var rK={readFile:XW,readFileSync:ZW,writeFile:eK,writeFileSync:tK};YF.exports=rK});var ZF=y((Sce,XF)=>{"use strict";var ad=JF();XF.exports={readJson:ad.readFile,readJsonSync:ad.readFileSync,writeJson:ad.writeFile,writeJsonSync:ad.writeFileSync}});var ud=y((xce,tO)=>{"use strict";var nK=pt().fromPromise,Wy=Pt(),QF=require("path"),eO=xr(),iK=ei().pathExists;async function oK(t,e,r="utf-8"){let n=QF.dirname(t);return await iK(n)||await eO.mkdirs(n),Wy.writeFile(t,e,r)}function sK(t,...e){let r=QF.dirname(t);Wy.existsSync(r)||eO.mkdirsSync(r),Wy.writeFileSync(t,...e)}tO.exports={outputFile:nK(oK),outputFileSync:sK}});var nO=y((Fce,rO)=>{"use strict";var{stringify:aK}=od(),{outputFile:uK}=ud();async function lK(t,e,r={}){let n=aK(e,r);await uK(t,n,r)}rO.exports=lK});var oO=y((Oce,iO)=>{"use strict";var{stringify:cK}=od(),{outputFileSync:fK}=ud();function dK(t,e,r){let n=cK(e,r);fK(t,n,r)}iO.exports=dK});var aO=y((Ace,sO)=>{"use strict";var hK=pt().fromPromise,$t=ZF();$t.outputJson=hK(nO());$t.outputJsonSync=oO();$t.outputJSON=$t.outputJson;$t.outputJSONSync=$t.outputJsonSync;$t.writeJSON=$t.writeJson;$t.writeJSONSync=$t.writeJsonSync;$t.readJSON=$t.readJson;$t.readJSONSync=$t.readJsonSync;sO.exports=$t});var dO=y((kce,fO)=>{"use strict";var pK=Pt(),uO=require("path"),{copy:mK}=id(),{remove:cO}=zu(),{mkdirp:gK}=xr(),{pathExists:yK}=ei(),lO=ro();async function DK(t,e,r={}){let n=r.overwrite||r.clobber||!1,{srcStat:i,isChangingCase:o=!1}=await lO.checkPaths(t,e,"move",r);await lO.checkParentPaths(t,i,e,"move");let s=uO.dirname(e);return uO.parse(s).root!==s&&await gK(s),vK(t,e,n,o)}async function vK(t,e,r,n){if(!n){if(r)await cO(e);else if(await yK(e))throw new Error("dest already exists.")}try{await pK.rename(t,e)}catch(i){if(i.code!=="EXDEV")throw i;await bK(t,e,r)}}async function bK(t,e,r){return await mK(t,e,{overwrite:r,errorOnExist:!0,preserveTimestamps:!0}),cO(t)}fO.exports=DK});var yO=y((Tce,gO)=>{"use strict";var pO=Xn(),Yy=require("path"),wK=id().copySync,mO=zu().removeSync,_K=xr().mkdirpSync,hO=ro();function EK(t,e,r){r=r||{};let n=r.overwrite||r.clobber||!1,{srcStat:i,isChangingCase:o=!1}=hO.checkPathsSync(t,e,"move",r);return hO.checkParentPathsSync(t,i,e,"move"),CK(e)||_K(Yy.dirname(e)),SK(t,e,n,o)}function CK(t){let e=Yy.dirname(t);return Yy.parse(e).root===e}function SK(t,e,r,n){if(n)return Ky(t,e,r);if(r)return mO(e),Ky(t,e,r);if(pO.existsSync(e))throw new Error("dest already exists.");return Ky(t,e,r)}function Ky(t,e,r){try{pO.renameSync(t,e)}catch(n){if(n.code!=="EXDEV")throw n;return xK(t,e,r)}}function xK(t,e,r){return wK(t,e,{overwrite:r,errorOnExist:!0,preserveTimestamps:!0}),mO(t)}gO.exports=EK});var vO=y((Pce,DO)=>{"use strict";var FK=pt().fromPromise;DO.exports={move:FK(dO()),moveSync:yO()}});var Ns=y((Rce,bO)=>{"use strict";bO.exports={...Pt(),...id(),...vF(),...zF(),...aO(),...xr(),...vO(),...ud(),...ei(),...zu()}});var FO=y(($ce,xO)=>{"use strict";var Jy,_O,EO,CO,SO=!0;typeof process<"u"&&({FORCE_COLOR:Jy,NODE_DISABLE_COLORS:_O,NO_COLOR:EO,TERM:CO}=process.env||{},SO=process.stdout&&process.stdout.isTTY);var be={enabled:!_O&&EO==null&&CO!=="dumb"&&(Jy!=null&&Jy!=="0"||SO),reset:xe(0,0),bold:xe(1,22),dim:xe(2,22),italic:xe(3,23),underline:xe(4,24),inverse:xe(7,27),hidden:xe(8,28),strikethrough:xe(9,29),black:xe(30,39),red:xe(31,39),green:xe(32,39),yellow:xe(33,39),blue:xe(34,39),magenta:xe(35,39),cyan:xe(36,39),white:xe(37,39),gray:xe(90,39),grey:xe(90,39),bgBlack:xe(40,49),bgRed:xe(41,49),bgGreen:xe(42,49),bgYellow:xe(43,49),bgBlue:xe(44,49),bgMagenta:xe(45,49),bgCyan:xe(46,49),bgWhite:xe(47,49)};function wO(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 OK(t,e){let r={has:t,keys:e};return r.reset=be.reset.bind(r),r.bold=be.bold.bind(r),r.dim=be.dim.bind(r),r.italic=be.italic.bind(r),r.underline=be.underline.bind(r),r.inverse=be.inverse.bind(r),r.hidden=be.hidden.bind(r),r.strikethrough=be.strikethrough.bind(r),r.black=be.black.bind(r),r.red=be.red.bind(r),r.green=be.green.bind(r),r.yellow=be.yellow.bind(r),r.blue=be.blue.bind(r),r.magenta=be.magenta.bind(r),r.cyan=be.cyan.bind(r),r.white=be.white.bind(r),r.gray=be.gray.bind(r),r.grey=be.grey.bind(r),r.bgBlack=be.bgBlack.bind(r),r.bgRed=be.bgRed.bind(r),r.bgGreen=be.bgGreen.bind(r),r.bgYellow=be.bgYellow.bind(r),r.bgBlue=be.bgBlue.bind(r),r.bgMagenta=be.bgMagenta.bind(r),r.bgCyan=be.bgCyan.bind(r),r.bgWhite=be.bgWhite.bind(r),r}function xe(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:be.enabled?wO(this.keys,n+""):n+""):n===void 0?OK([t],[r]):be.enabled?wO([r],n+""):n+""}}xO.exports=be});var Ls=y(rt=>{"use strict";Object.defineProperty(rt,"__esModule",{value:!0});rt.ancillary=rt.failure=rt.success=rt.input=rt.weak=rt.strong=void 0;var AK=(nr(),je(rr)),Gr=AK.__importDefault(FO());rt.strong=Gr.default.bold;rt.weak=Gr.default.dim;rt.input=Gr.default.cyan;rt.success=Gr.default.green;rt.failure=Gr.default.red;rt.ancillary=Gr.default.cyan;var kK={strong:rt.strong,weak:rt.weak,input:rt.input,success:rt.success,failure:rt.failure,ancillary:rt.ancillary,log:{DEBUG:Gr.default.magenta,INFO:Gr.default.cyan,WARN:Gr.default.yellow,ERROR:Gr.default.red}};rt.default=kK});var Xy=y(ld=>{"use strict";Object.defineProperty(ld,"__esModule",{value:!0});ld.EscapeCode=void 0;var Fr="\x1B[",gt=class{};ld.EscapeCode=gt;gt.cursorLeft=()=>`${Fr}G`;gt.cursorUp=(t=1)=>`${Fr}${t}A`;gt.cursorDown=(t=1)=>`${Fr}${t}B`;gt.cursorForward=(t=1)=>`${Fr}${t}C`;gt.cursorBackward=(t=1)=>`${Fr}${t}D`;gt.cursorHide=()=>`${Fr}?25l`;gt.cursorShow=()=>`${Fr}?25h`;gt.eraseLine=()=>`${Fr}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=()=>`${Fr}1J`;gt.eraseDown=()=>`${Fr}J`;gt.eraseScreen=()=>`${Fr}2J`});var AO=y(cd=>{"use strict";Object.defineProperty(cd,"__esModule",{value:!0});cd.Cursor=void 0;var TK=(nr(),je(rr)),PK=TK.__importDefault(_y()),OO=Xy(),Bs=class t{static show(){t.stream.isTTY&&(t._isVisible=!0,t.stream.write(OO.EscapeCode.cursorShow()))}static hide(){t.stream.isTTY&&(t._listenerAttached||((0,PK.default)(()=>{t.show()}),t._listenerAttached=!0),t._isVisible=!1,t.stream.write(OO.EscapeCode.cursorHide()))}static toggle(){t._isVisible?t.hide():t.show()}};cd.Cursor=Bs;Bs.stream=process.stderr;Bs._isVisible=!0;Bs._listenerAttached=!1});var Qy=y((Lce,Zy)=>{"use strict";var kO=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);Zy.exports=kO;Zy.exports.default=kO});var RO=y((Bce,PO)=>{"use strict";var TO="[\uD800-\uDBFF][\uDC00-\uDFFF]",RK=t=>t&&t.exact?new RegExp(`^${TO}$`):new RegExp(TO,"g");PO.exports=RK});var IO=y((qce,$O)=>{"use strict";$O.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 eD=y((Mce,NO)=>{var Wu=IO(),jO={};for(let t of Object.keys(Wu))jO[Wu[t]]=t;var Y={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"]}};NO.exports=Y;for(let t of Object.keys(Y)){if(!("channels"in Y[t]))throw new Error("missing channels property: "+t);if(!("labels"in Y[t]))throw new Error("missing channel labels property: "+t);if(Y[t].labels.length!==Y[t].channels)throw new Error("channel and label counts mismatch: "+t);let{channels:e,labels:r}=Y[t];delete Y[t].channels,delete Y[t].labels,Object.defineProperty(Y[t],"channels",{value:e}),Object.defineProperty(Y[t],"labels",{value:r})}Y.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 l=(i+o)/2;return o===i?u=0:l<=.5?u=s/(o+i):u=s/(2-o-i),[a,u*100,l*100]};Y.rgb.hsv=function(t){let e,r,n,i,o,s=t[0]/255,a=t[1]/255,u=t[2]/255,l=Math.max(s,a,u),c=l-Math.min(s,a,u),f=function(h){return(l-h)/6/c+1/2};return c===0?(i=0,o=0):(o=c/l,e=f(s),r=f(a),n=f(u),s===l?i=n-r:a===l?i=1/3+e-n:u===l&&(i=2/3+r-e),i<0?i+=1:i>1&&(i-=1)),[i*360,o*100,l*100]};Y.rgb.hwb=function(t){let e=t[0],r=t[1],n=t[2],i=Y.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]};Y.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 $K(t,e){return(t[0]-e[0])**2+(t[1]-e[1])**2+(t[2]-e[2])**2}Y.rgb.keyword=function(t){let e=jO[t];if(e)return e;let r=1/0,n;for(let i of Object.keys(Wu)){let o=Wu[i],s=$K(t,o);s<r&&(r=s,n=i)}return n};Y.keyword.rgb=function(t){return Wu[t]};Y.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]};Y.rgb.lab=function(t){let e=Y.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]};Y.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 l=0;l<3;l++)o=e+1/3*-(l-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[l]=s*255;return u};Y.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]};Y.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]}};Y.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]};Y.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)!==0&&(o=1-o);let u=r+o*(a-r),l,c,f;switch(s){default:case 6:case 0:l=a,c=u,f=r;break;case 1:l=u,c=a,f=r;break;case 2:l=r,c=a,f=u;break;case 3:l=r,c=u,f=a;break;case 4:l=u,c=r,f=a;break;case 5:l=a,c=r,f=u;break}return[l*255,c*255,f*255]};Y.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]};Y.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]};Y.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]};Y.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,l=s**3;return o=a>.008856?a:(o-16/116)/7.787,i=u>.008856?u:(i-16/116)/7.787,s=l>.008856?l:(s-16/116)/7.787,i*=95.047,o*=100,s*=108.883,[i,o,s]};Y.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]};Y.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]};Y.rgb.ansi16=function(t,e=null){let[r,n,i]=t,o=e===null?Y.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};Y.hsv.ansi16=function(t){return Y.rgb.ansi16(Y.hsv.rgb(t),t[2])};Y.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)};Y.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]};Y.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]};Y.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};Y.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]};Y.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]};Y.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]};Y.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]};Y.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]};Y.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]};Y.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]};Y.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]};Y.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]};Y.apple.rgb=function(t){return[t[0]/65535*255,t[1]/65535*255,t[2]/65535*255]};Y.rgb.apple=function(t){return[t[0]/255*65535,t[1]/255*65535,t[2]/255*65535]};Y.gray.rgb=function(t){return[t[0]/100*255,t[0]/100*255,t[0]/100*255]};Y.gray.hsl=function(t){return[0,0,t[0]]};Y.gray.hsv=Y.gray.hsl;Y.gray.hwb=function(t){return[0,100,t[0]]};Y.gray.cmyk=function(t){return[0,0,0,t[0]]};Y.gray.lab=function(t){return[t[0],0,0]};Y.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};Y.rgb.gray=function(t){return[(t[0]+t[1]+t[2])/3/255*100]}});var BO=y((Uce,LO)=>{var fd=eD();function IK(){let t={},e=Object.keys(fd);for(let r=e.length,n=0;n<r;n++)t[e[n]]={distance:-1,parent:null};return t}function jK(t){let e=IK(),r=[t];for(e[t].distance=0;r.length;){let n=r.pop(),i=Object.keys(fd[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 NK(t,e){return function(r){return e(t(r))}}function LK(t,e){let r=[e[t].parent,t],n=fd[e[t].parent][t],i=e[t].parent;for(;e[i].parent;)r.unshift(e[i].parent),n=NK(fd[e[i].parent][i],n),i=e[i].parent;return n.conversion=r,n}LO.exports=function(t){let e=jK(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]=LK(s,e))}return r}});var MO=y((Hce,qO)=>{var tD=eD(),BK=BO(),qs={},qK=Object.keys(tD);function MK(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 UK(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}qK.forEach(t=>{qs[t]={},Object.defineProperty(qs[t],"channels",{value:tD[t].channels}),Object.defineProperty(qs[t],"labels",{value:tD[t].labels});let e=BK(t);Object.keys(e).forEach(n=>{let i=e[n];qs[t][n]=UK(i),qs[t][n].raw=MK(i)})});qO.exports=qs});var nD=y((Vce,GO)=>{"use strict";var UO=(t,e)=>(...r)=>`\x1B[${t(...r)+e}m`,HO=(t,e)=>(...r)=>{let n=t(...r);return`\x1B[${38+e};5;${n}m`},VO=(t,e)=>(...r)=>{let n=t(...r);return`\x1B[${38+e};2;${n[0]};${n[1]};${n[2]}m`},dd=t=>t,zO=(t,e,r)=>[t,e,r],Ms=(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})},rD,Us=(t,e,r,n)=>{rD===void 0&&(rD=MO());let i=n?10:0,o={};for(let[s,a]of Object.entries(rD)){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 HK(){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",Ms(e.color,"ansi",()=>Us(UO,"ansi16",dd,!1)),Ms(e.color,"ansi256",()=>Us(HO,"ansi256",dd,!1)),Ms(e.color,"ansi16m",()=>Us(VO,"rgb",zO,!1)),Ms(e.bgColor,"ansi",()=>Us(UO,"ansi16",dd,!0)),Ms(e.bgColor,"ansi256",()=>Us(HO,"ansi256",dd,!0)),Ms(e.bgColor,"ansi16m",()=>Us(VO,"rgb",zO,!0)),e}Object.defineProperty(GO,"exports",{enumerable:!0,get:HK})});var XO=y((zce,JO)=>{"use strict";var VK=Qy(),zK=RO(),WO=nD(),YO=["\x1B","\x9B"],hd=t=>`${YO[0]}[${t}m`,KO=(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=WO.codes.get(Number.parseInt(i,10));if(s){let a=t.indexOf(s.toString());a===-1?n.push(hd(e?s:o)):t.splice(a,1)}else if(e){n.push(hd(0));break}else n.push(hd(o))}if(e&&(n=n.filter((i,o)=>n.indexOf(i)===o),r!==void 0)){let i=hd(WO.codes.get(Number.parseInt(r,10)));n=n.reduce((o,s)=>s===i?[s,...o]:[...o,s],[])}return n.join("")};JO.exports=(t,e,r)=>{let n=[...t],i=[],o=typeof r=="number"?r:n.length,s=!1,a,u=0,l="";for(let[c,f]of n.entries()){let h=!1;if(YO.includes(f)){let d=/\d[^m]*/.exec(t.slice(c,c+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++,!zK({exact:!0}).test(f)&&VK(f.codePointAt())&&(u++,typeof r!="number"&&o++),u>e&&u<=o)l+=f;else if(u===e&&!s&&a!==void 0)l=KO(i);else if(u>=o){l+=KO(i,!0,a);break}}return l}});var QO=y((Gce,ZO)=>{"use strict";ZO.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 pd=y((Wce,eA)=>{"use strict";var GK=QO();eA.exports=t=>typeof t=="string"?t.replace(GK(),""):t});var rA=y((Kce,tA)=>{"use strict";tA.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 oD=y((Yce,iD)=>{"use strict";var WK=pd(),KK=Qy(),YK=rA(),nA=t=>{if(typeof t!="string"||t.length===0||(t=WK(t),t.length===0))return 0;t=t.replace(YK()," ");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+=KK(n)?2:1)}return e};iD.exports=nA;iD.exports.default=nA});var lA=y((Jce,uA)=>{"use strict";var Ku=oD(),JK=pd(),XK=nD(),md=new Set(["\x1B","\x9B"]),ZK=39,aD="\x07",sA="[",QK="]",aA="m",uD=`${QK}8;;`,iA=t=>`${md.values().next().value}${sA}${t}${aA}`,oA=t=>`${md.values().next().value}${uD}${t}${aD}`,eY=t=>t.split(" ").map(e=>Ku(e)),sD=(t,e,r)=>{let n=[...e],i=!1,o=!1,s=Ku(JK(t[t.length-1]));for(let[a,u]of n.entries()){let l=Ku(u);if(s+l<=r?t[t.length-1]+=u:(t.push(u),s=0),md.has(u)&&(i=!0,o=n.slice(a+1).join("").startsWith(uD)),i){o?u===aD&&(i=!1,o=!1):u===aA&&(i=!1);continue}s+=l,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())},tY=t=>{let e=t.split(" "),r=e.length;for(;r>0&&!(Ku(e[r-1])>0);)r--;return r===e.length?t:e.slice(0,r).join(" ")+e.slice(r).join("")},rY=(t,e,r={})=>{if(r.trim!==!1&&t.trim()==="")return"";let n="",i,o,s=eY(t),a=[""];for(let[l,c]of t.split(" ").entries()){r.trim!==!1&&(a[a.length-1]=a[a.length-1].trimStart());let f=Ku(a[a.length-1]);if(l!==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[l]>e){let h=e-f,d=1+Math.floor((s[l]-h-1)/e);Math.floor((s[l]-1)/e)<d&&a.push(""),sD(a,c,e);continue}if(f+s[l]>e&&f>0&&s[l]>0){if(r.wordWrap===!1&&f<e){sD(a,c,e);continue}a.push("")}if(f+s[l]>e&&r.wordWrap===!1){sD(a,c,e);continue}a[a.length-1]+=c}r.trim!==!1&&(a=a.map(tY));let u=[...a.join(`
|
|
48
|
-
`)];for(let[l,c]of u.entries()){if(n+=c,md.has(c)){let{groups:h}=new RegExp(`(?:\\${
|
|
49
|
-
`?(o&&(n+=
|
|
50
|
-
`&&(i&&f&&(n+=
|
|
46
|
+
see https://github.com/jprichardson/node-fs-extra/issues/269`,"Warning","fs-extra-WARN0002");let{srcStat:n,destStat:i}=Vu.checkPathsSync(t,e,"copy",r);if(Vu.checkParentPathsSync(t,n,e,"copy"),r.filter&&!r.filter(t,e))return;let o=Hu.dirname(e);return Rt.existsSync(o)||sW(o),o2(i,t,e,r)}function o2(t,e,r,n){let o=(n.dereference?Rt.statSync:Rt.lstatSync)(e);if(o.isDirectory())return mW(o,t,e,r,n);if(o.isFile()||o.isCharacterDevice()||o.isBlockDevice())return lW(o,t,e,r,n);if(o.isSymbolicLink())return DW(t,e,r,n);throw o.isSocket()?new Error(`Cannot copy a socket file: ${e}`):o.isFIFO()?new Error(`Cannot copy a FIFO pipe: ${e}`):new Error(`Unknown file: ${e}`)}function lW(t,e,r,n,i){return e?cW(t,r,n,i):s2(t,r,n,i)}function cW(t,e,r,n){if(n.overwrite)return Rt.unlinkSync(r),s2(t,e,r,n);if(n.errorOnExist)throw new Error(`'${r}' already exists`)}function s2(t,e,r,n){return Rt.copyFileSync(e,r),n.preserveTimestamps&&fW(t.mode,e,r),Gy(r,t.mode)}function fW(t,e,r){return dW(t)&&hW(r,t),pW(e,r)}function dW(t){return(t&128)===0}function hW(t,e){return Gy(t,e|128)}function Gy(t,e){return Rt.chmodSync(t,e)}function pW(t,e){let r=Rt.statSync(t);return aW(e,r.atime,r.mtime)}function mW(t,e,r,n,i){return e?a2(r,n,i):gW(t.mode,r,n,i)}function gW(t,e,r,n){return Rt.mkdirSync(r),a2(e,r,n),Gy(r,t)}function a2(t,e,r){let n=Rt.opendirSync(t);try{let i;for(;(i=n.readSync())!==null;)yW(i.name,t,e,r)}finally{n.closeSync()}}function yW(t,e,r,n){let i=Hu.join(e,t),o=Hu.join(r,t);if(n.filter&&!n.filter(i,o))return;let{destStat:s}=Vu.checkPathsSync(i,o,"copy",n);return o2(s,i,o,n)}function DW(t,e,r,n){let i=Rt.readlinkSync(e);if(n.dereference&&(i=Hu.resolve(process.cwd(),i)),t){let o;try{o=Rt.readlinkSync(r)}catch(s){if(s.code==="EINVAL"||s.code==="UNKNOWN")return Rt.symlinkSync(i,r);throw s}if(n.dereference&&(o=Hu.resolve(process.cwd(),o)),Vu.isSrcSubdir(i,o))throw new Error(`Cannot copy '${i}' to a subdirectory of itself, '${o}'.`);if(Vu.isSrcSubdir(o,i))throw new Error(`Cannot overwrite '${o}' with '${i}'.`);return vW(i,r)}else return Rt.symlinkSync(i,r)}function vW(t,e){return Rt.unlinkSync(e),Rt.symlinkSync(t,e)}u2.exports=uW});var id=y((yce,c2)=>{"use strict";var bW=pt().fromPromise;c2.exports={copy:bW(i2()),copySync:l2()}});var zu=y((Dce,d2)=>{"use strict";var f2=Xn(),wW=pt().fromCallback;function _W(t,e){f2.rm(t,{recursive:!0,force:!0},e)}function EW(t){f2.rmSync(t,{recursive:!0,force:!0})}d2.exports={remove:wW(_W),removeSync:EW}});var b2=y((vce,v2)=>{"use strict";var CW=pt().fromPromise,m2=Pt(),g2=require("path"),y2=xr(),D2=zu(),h2=CW(async function(e){let r;try{r=await m2.readdir(e)}catch{return y2.mkdirs(e)}return Promise.all(r.map(n=>D2.remove(g2.join(e,n))))});function p2(t){let e;try{e=m2.readdirSync(t)}catch{return y2.mkdirsSync(t)}e.forEach(r=>{r=g2.join(t,r),D2.removeSync(r)})}v2.exports={emptyDirSync:p2,emptydirSync:p2,emptyDir:h2,emptydir:h2}});var C2=y((bce,E2)=>{"use strict";var SW=pt().fromPromise,w2=require("path"),Dn=Pt(),_2=xr();async function xW(t){let e;try{e=await Dn.stat(t)}catch{}if(e&&e.isFile())return;let r=w2.dirname(t),n=null;try{n=await Dn.stat(r)}catch(i){if(i.code==="ENOENT"){await _2.mkdirs(r),await Dn.writeFile(t,"");return}else throw i}n.isDirectory()?await Dn.writeFile(t,""):await Dn.readdir(r)}function FW(t){let e;try{e=Dn.statSync(t)}catch{}if(e&&e.isFile())return;let r=w2.dirname(t);try{Dn.statSync(r).isDirectory()||Dn.readdirSync(r)}catch(n){if(n&&n.code==="ENOENT")_2.mkdirsSync(r);else throw n}Dn.writeFileSync(t,"")}E2.exports={createFile:SW(xW),createFileSync:FW}});var A2=y((wce,O2)=>{"use strict";var OW=pt().fromPromise,S2=require("path"),ti=Pt(),x2=xr(),{pathExists:AW}=ei(),{areIdentical:F2}=ro();async function kW(t,e){let r;try{r=await ti.lstat(e)}catch{}let n;try{n=await ti.lstat(t)}catch(s){throw s.message=s.message.replace("lstat","ensureLink"),s}if(r&&F2(n,r))return;let i=S2.dirname(e);await AW(i)||await x2.mkdirs(i),await ti.link(t,e)}function TW(t,e){let r;try{r=ti.lstatSync(e)}catch{}try{let o=ti.lstatSync(t);if(r&&F2(o,r))return}catch(o){throw o.message=o.message.replace("lstat","ensureLink"),o}let n=S2.dirname(e);return ti.existsSync(n)||x2.mkdirsSync(n),ti.linkSync(t,e)}O2.exports={createLink:OW(kW),createLinkSync:TW}});var T2=y((_ce,k2)=>{"use strict";var ri=require("path"),Gu=Pt(),{pathExists:PW}=ei(),RW=pt().fromPromise;async function $W(t,e){if(ri.isAbsolute(t)){try{await Gu.lstat(t)}catch(o){throw o.message=o.message.replace("lstat","ensureSymlink"),o}return{toCwd:t,toDst:t}}let r=ri.dirname(e),n=ri.join(r,t);if(await PW(n))return{toCwd:n,toDst:t};try{await Gu.lstat(t)}catch(o){throw o.message=o.message.replace("lstat","ensureSymlink"),o}return{toCwd:t,toDst:ri.relative(r,t)}}function IW(t,e){if(ri.isAbsolute(t)){if(!Gu.existsSync(t))throw new Error("absolute srcpath does not exist");return{toCwd:t,toDst:t}}let r=ri.dirname(e),n=ri.join(r,t);if(Gu.existsSync(n))return{toCwd:n,toDst:t};if(!Gu.existsSync(t))throw new Error("relative srcpath does not exist");return{toCwd:t,toDst:ri.relative(r,t)}}k2.exports={symlinkPaths:RW($W),symlinkPathsSync:IW}});var $2=y((Ece,R2)=>{"use strict";var P2=Pt(),jW=pt().fromPromise;async function NW(t,e){if(e)return e;let r;try{r=await P2.lstat(t)}catch{return"file"}return r&&r.isDirectory()?"dir":"file"}function LW(t,e){if(e)return e;let r;try{r=P2.lstatSync(t)}catch{return"file"}return r&&r.isDirectory()?"dir":"file"}R2.exports={symlinkType:jW(NW),symlinkTypeSync:LW}});var L2=y((Cce,N2)=>{"use strict";var BW=pt().fromPromise,I2=require("path"),zr=Pt(),{mkdirs:qW,mkdirsSync:MW}=xr(),{symlinkPaths:UW,symlinkPathsSync:HW}=T2(),{symlinkType:VW,symlinkTypeSync:zW}=$2(),{pathExists:GW}=ei(),{areIdentical:j2}=ro();async function WW(t,e,r){let n;try{n=await zr.lstat(e)}catch{}if(n&&n.isSymbolicLink()){let[a,u]=await Promise.all([zr.stat(t),zr.stat(e)]);if(j2(a,u))return}let i=await UW(t,e);t=i.toDst;let o=await VW(i.toCwd,r),s=I2.dirname(e);return await GW(s)||await qW(s),zr.symlink(t,e,o)}function KW(t,e,r){let n;try{n=zr.lstatSync(e)}catch{}if(n&&n.isSymbolicLink()){let a=zr.statSync(t),u=zr.statSync(e);if(j2(a,u))return}let i=HW(t,e);t=i.toDst,r=zW(i.toCwd,r);let o=I2.dirname(e);return zr.existsSync(o)||MW(o),zr.symlinkSync(t,e,r)}N2.exports={createSymlink:BW(WW),createSymlinkSync:KW}});var G2=y((Sce,z2)=>{"use strict";var{createFile:B2,createFileSync:q2}=C2(),{createLink:M2,createLinkSync:U2}=A2(),{createSymlink:H2,createSymlinkSync:V2}=L2();z2.exports={createFile:B2,createFileSync:q2,ensureFile:B2,ensureFileSync:q2,createLink:M2,createLinkSync:U2,ensureLink:M2,ensureLinkSync:U2,createSymlink:H2,createSymlinkSync:V2,ensureSymlink:H2,ensureSymlinkSync:V2}});var od=y((xce,W2)=>{function YW(t,{EOL:e=`
|
|
47
|
+
`,finalEOL:r=!0,replacer:n=null,spaces:i}={}){let o=r?e:"";return JSON.stringify(t,n,i).replace(/\n/g,e)+o}function JW(t){return Buffer.isBuffer(t)&&(t=t.toString("utf8")),t.replace(/^\uFEFF/,"")}W2.exports={stringify:YW,stripBom:JW}});var X2=y((Fce,J2)=>{var js;try{js=Xn()}catch{js=require("fs")}var sd=pt(),{stringify:K2,stripBom:Y2}=od();async function XW(t,e={}){typeof e=="string"&&(e={encoding:e});let r=e.fs||js,n="throws"in e?e.throws:!0,i=await sd.fromCallback(r.readFile)(t,e);i=Y2(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 ZW=sd.fromPromise(XW);function QW(t,e={}){typeof e=="string"&&(e={encoding:e});let r=e.fs||js,n="throws"in e?e.throws:!0;try{let i=r.readFileSync(t,e);return i=Y2(i),JSON.parse(i,e.reviver)}catch(i){if(n)throw i.message=`${t}: ${i.message}`,i;return null}}async function eK(t,e,r={}){let n=r.fs||js,i=K2(e,r);await sd.fromCallback(n.writeFile)(t,i,r)}var tK=sd.fromPromise(eK);function rK(t,e,r={}){let n=r.fs||js,i=K2(e,r);return n.writeFileSync(t,i,r)}var nK={readFile:ZW,readFileSync:QW,writeFile:tK,writeFileSync:rK};J2.exports=nK});var Q2=y((Oce,Z2)=>{"use strict";var ad=X2();Z2.exports={readJson:ad.readFile,readJsonSync:ad.readFileSync,writeJson:ad.writeFile,writeJsonSync:ad.writeFileSync}});var ud=y((Ace,rO)=>{"use strict";var iK=pt().fromPromise,Wy=Pt(),eO=require("path"),tO=xr(),oK=ei().pathExists;async function sK(t,e,r="utf-8"){let n=eO.dirname(t);return await oK(n)||await tO.mkdirs(n),Wy.writeFile(t,e,r)}function aK(t,...e){let r=eO.dirname(t);Wy.existsSync(r)||tO.mkdirsSync(r),Wy.writeFileSync(t,...e)}rO.exports={outputFile:iK(sK),outputFileSync:aK}});var iO=y((kce,nO)=>{"use strict";var{stringify:uK}=od(),{outputFile:lK}=ud();async function cK(t,e,r={}){let n=uK(e,r);await lK(t,n,r)}nO.exports=cK});var sO=y((Tce,oO)=>{"use strict";var{stringify:fK}=od(),{outputFileSync:dK}=ud();function hK(t,e,r){let n=fK(e,r);dK(t,n,r)}oO.exports=hK});var uO=y((Pce,aO)=>{"use strict";var pK=pt().fromPromise,$t=Q2();$t.outputJson=pK(iO());$t.outputJsonSync=sO();$t.outputJSON=$t.outputJson;$t.outputJSONSync=$t.outputJsonSync;$t.writeJSON=$t.writeJson;$t.writeJSONSync=$t.writeJsonSync;$t.readJSON=$t.readJson;$t.readJSONSync=$t.readJsonSync;aO.exports=$t});var hO=y((Rce,dO)=>{"use strict";var mK=Pt(),lO=require("path"),{copy:gK}=id(),{remove:fO}=zu(),{mkdirp:yK}=xr(),{pathExists:DK}=ei(),cO=ro();async function vK(t,e,r={}){let n=r.overwrite||r.clobber||!1,{srcStat:i,isChangingCase:o=!1}=await cO.checkPaths(t,e,"move",r);await cO.checkParentPaths(t,i,e,"move");let s=lO.dirname(e);return lO.parse(s).root!==s&&await yK(s),bK(t,e,n,o)}async function bK(t,e,r,n){if(!n){if(r)await fO(e);else if(await DK(e))throw new Error("dest already exists.")}try{await mK.rename(t,e)}catch(i){if(i.code!=="EXDEV")throw i;await wK(t,e,r)}}async function wK(t,e,r){return await gK(t,e,{overwrite:r,errorOnExist:!0,preserveTimestamps:!0}),fO(t)}dO.exports=vK});var DO=y(($ce,yO)=>{"use strict";var mO=Xn(),Yy=require("path"),_K=id().copySync,gO=zu().removeSync,EK=xr().mkdirpSync,pO=ro();function CK(t,e,r){r=r||{};let n=r.overwrite||r.clobber||!1,{srcStat:i,isChangingCase:o=!1}=pO.checkPathsSync(t,e,"move",r);return pO.checkParentPathsSync(t,i,e,"move"),SK(e)||EK(Yy.dirname(e)),xK(t,e,n,o)}function SK(t){let e=Yy.dirname(t);return Yy.parse(e).root===e}function xK(t,e,r,n){if(n)return Ky(t,e,r);if(r)return gO(e),Ky(t,e,r);if(mO.existsSync(e))throw new Error("dest already exists.");return Ky(t,e,r)}function Ky(t,e,r){try{mO.renameSync(t,e)}catch(n){if(n.code!=="EXDEV")throw n;return FK(t,e,r)}}function FK(t,e,r){return _K(t,e,{overwrite:r,errorOnExist:!0,preserveTimestamps:!0}),gO(t)}yO.exports=CK});var bO=y((Ice,vO)=>{"use strict";var OK=pt().fromPromise;vO.exports={move:OK(hO()),moveSync:DO()}});var Ns=y((jce,wO)=>{"use strict";wO.exports={...Pt(),...id(),...b2(),...G2(),...uO(),...xr(),...bO(),...ud(),...ei(),...zu()}});var OO=y((Nce,FO)=>{"use strict";var Jy,EO,CO,SO,xO=!0;typeof process<"u"&&({FORCE_COLOR:Jy,NODE_DISABLE_COLORS:EO,NO_COLOR:CO,TERM:SO}=process.env||{},xO=process.stdout&&process.stdout.isTTY);var be={enabled:!EO&&CO==null&&SO!=="dumb"&&(Jy!=null&&Jy!=="0"||xO),reset:xe(0,0),bold:xe(1,22),dim:xe(2,22),italic:xe(3,23),underline:xe(4,24),inverse:xe(7,27),hidden:xe(8,28),strikethrough:xe(9,29),black:xe(30,39),red:xe(31,39),green:xe(32,39),yellow:xe(33,39),blue:xe(34,39),magenta:xe(35,39),cyan:xe(36,39),white:xe(37,39),gray:xe(90,39),grey:xe(90,39),bgBlack:xe(40,49),bgRed:xe(41,49),bgGreen:xe(42,49),bgYellow:xe(43,49),bgBlue:xe(44,49),bgMagenta:xe(45,49),bgCyan:xe(46,49),bgWhite:xe(47,49)};function _O(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 AK(t,e){let r={has:t,keys:e};return r.reset=be.reset.bind(r),r.bold=be.bold.bind(r),r.dim=be.dim.bind(r),r.italic=be.italic.bind(r),r.underline=be.underline.bind(r),r.inverse=be.inverse.bind(r),r.hidden=be.hidden.bind(r),r.strikethrough=be.strikethrough.bind(r),r.black=be.black.bind(r),r.red=be.red.bind(r),r.green=be.green.bind(r),r.yellow=be.yellow.bind(r),r.blue=be.blue.bind(r),r.magenta=be.magenta.bind(r),r.cyan=be.cyan.bind(r),r.white=be.white.bind(r),r.gray=be.gray.bind(r),r.grey=be.grey.bind(r),r.bgBlack=be.bgBlack.bind(r),r.bgRed=be.bgRed.bind(r),r.bgGreen=be.bgGreen.bind(r),r.bgYellow=be.bgYellow.bind(r),r.bgBlue=be.bgBlue.bind(r),r.bgMagenta=be.bgMagenta.bind(r),r.bgCyan=be.bgCyan.bind(r),r.bgWhite=be.bgWhite.bind(r),r}function xe(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:be.enabled?_O(this.keys,n+""):n+""):n===void 0?AK([t],[r]):be.enabled?_O([r],n+""):n+""}}FO.exports=be});var Ls=y(rt=>{"use strict";Object.defineProperty(rt,"__esModule",{value:!0});rt.ancillary=rt.failure=rt.success=rt.input=rt.weak=rt.strong=void 0;var kK=(nr(),je(rr)),Gr=kK.__importDefault(OO());rt.strong=Gr.default.bold;rt.weak=Gr.default.dim;rt.input=Gr.default.cyan;rt.success=Gr.default.green;rt.failure=Gr.default.red;rt.ancillary=Gr.default.cyan;var TK={strong:rt.strong,weak:rt.weak,input:rt.input,success:rt.success,failure:rt.failure,ancillary:rt.ancillary,log:{DEBUG:Gr.default.magenta,INFO:Gr.default.cyan,WARN:Gr.default.yellow,ERROR:Gr.default.red}};rt.default=TK});var Xy=y(ld=>{"use strict";Object.defineProperty(ld,"__esModule",{value:!0});ld.EscapeCode=void 0;var Fr="\x1B[",gt=class{};ld.EscapeCode=gt;gt.cursorLeft=()=>`${Fr}G`;gt.cursorUp=(t=1)=>`${Fr}${t}A`;gt.cursorDown=(t=1)=>`${Fr}${t}B`;gt.cursorForward=(t=1)=>`${Fr}${t}C`;gt.cursorBackward=(t=1)=>`${Fr}${t}D`;gt.cursorHide=()=>`${Fr}?25l`;gt.cursorShow=()=>`${Fr}?25h`;gt.eraseLine=()=>`${Fr}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=()=>`${Fr}1J`;gt.eraseDown=()=>`${Fr}J`;gt.eraseScreen=()=>`${Fr}2J`});var kO=y(cd=>{"use strict";Object.defineProperty(cd,"__esModule",{value:!0});cd.Cursor=void 0;var PK=(nr(),je(rr)),RK=PK.__importDefault(_y()),AO=Xy(),Bs=class t{static show(){t.stream.isTTY&&(t._isVisible=!0,t.stream.write(AO.EscapeCode.cursorShow()))}static hide(){t.stream.isTTY&&(t._listenerAttached||((0,RK.default)(()=>{t.show()}),t._listenerAttached=!0),t._isVisible=!1,t.stream.write(AO.EscapeCode.cursorHide()))}static toggle(){t._isVisible?t.hide():t.show()}};cd.Cursor=Bs;Bs.stream=process.stderr;Bs._isVisible=!0;Bs._listenerAttached=!1});var Qy=y((Mce,Zy)=>{"use strict";var TO=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);Zy.exports=TO;Zy.exports.default=TO});var $O=y((Uce,RO)=>{"use strict";var PO="[\uD800-\uDBFF][\uDC00-\uDFFF]",$K=t=>t&&t.exact?new RegExp(`^${PO}$`):new RegExp(PO,"g");RO.exports=$K});var jO=y((Hce,IO)=>{"use strict";IO.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 eD=y((Vce,LO)=>{var Wu=jO(),NO={};for(let t of Object.keys(Wu))NO[Wu[t]]=t;var Y={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"]}};LO.exports=Y;for(let t of Object.keys(Y)){if(!("channels"in Y[t]))throw new Error("missing channels property: "+t);if(!("labels"in Y[t]))throw new Error("missing channel labels property: "+t);if(Y[t].labels.length!==Y[t].channels)throw new Error("channel and label counts mismatch: "+t);let{channels:e,labels:r}=Y[t];delete Y[t].channels,delete Y[t].labels,Object.defineProperty(Y[t],"channels",{value:e}),Object.defineProperty(Y[t],"labels",{value:r})}Y.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 l=(i+o)/2;return o===i?u=0:l<=.5?u=s/(o+i):u=s/(2-o-i),[a,u*100,l*100]};Y.rgb.hsv=function(t){let e,r,n,i,o,s=t[0]/255,a=t[1]/255,u=t[2]/255,l=Math.max(s,a,u),c=l-Math.min(s,a,u),f=function(h){return(l-h)/6/c+1/2};return c===0?(i=0,o=0):(o=c/l,e=f(s),r=f(a),n=f(u),s===l?i=n-r:a===l?i=1/3+e-n:u===l&&(i=2/3+r-e),i<0?i+=1:i>1&&(i-=1)),[i*360,o*100,l*100]};Y.rgb.hwb=function(t){let e=t[0],r=t[1],n=t[2],i=Y.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]};Y.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 IK(t,e){return(t[0]-e[0])**2+(t[1]-e[1])**2+(t[2]-e[2])**2}Y.rgb.keyword=function(t){let e=NO[t];if(e)return e;let r=1/0,n;for(let i of Object.keys(Wu)){let o=Wu[i],s=IK(t,o);s<r&&(r=s,n=i)}return n};Y.keyword.rgb=function(t){return Wu[t]};Y.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]};Y.rgb.lab=function(t){let e=Y.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]};Y.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 l=0;l<3;l++)o=e+1/3*-(l-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[l]=s*255;return u};Y.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]};Y.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]}};Y.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]};Y.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)!==0&&(o=1-o);let u=r+o*(a-r),l,c,f;switch(s){default:case 6:case 0:l=a,c=u,f=r;break;case 1:l=u,c=a,f=r;break;case 2:l=r,c=a,f=u;break;case 3:l=r,c=u,f=a;break;case 4:l=u,c=r,f=a;break;case 5:l=a,c=r,f=u;break}return[l*255,c*255,f*255]};Y.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]};Y.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]};Y.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]};Y.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,l=s**3;return o=a>.008856?a:(o-16/116)/7.787,i=u>.008856?u:(i-16/116)/7.787,s=l>.008856?l:(s-16/116)/7.787,i*=95.047,o*=100,s*=108.883,[i,o,s]};Y.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]};Y.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]};Y.rgb.ansi16=function(t,e=null){let[r,n,i]=t,o=e===null?Y.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};Y.hsv.ansi16=function(t){return Y.rgb.ansi16(Y.hsv.rgb(t),t[2])};Y.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)};Y.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]};Y.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]};Y.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};Y.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]};Y.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]};Y.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]};Y.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]};Y.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]};Y.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]};Y.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]};Y.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]};Y.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]};Y.apple.rgb=function(t){return[t[0]/65535*255,t[1]/65535*255,t[2]/65535*255]};Y.rgb.apple=function(t){return[t[0]/255*65535,t[1]/255*65535,t[2]/255*65535]};Y.gray.rgb=function(t){return[t[0]/100*255,t[0]/100*255,t[0]/100*255]};Y.gray.hsl=function(t){return[0,0,t[0]]};Y.gray.hsv=Y.gray.hsl;Y.gray.hwb=function(t){return[0,100,t[0]]};Y.gray.cmyk=function(t){return[0,0,0,t[0]]};Y.gray.lab=function(t){return[t[0],0,0]};Y.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};Y.rgb.gray=function(t){return[(t[0]+t[1]+t[2])/3/255*100]}});var qO=y((zce,BO)=>{var fd=eD();function jK(){let t={},e=Object.keys(fd);for(let r=e.length,n=0;n<r;n++)t[e[n]]={distance:-1,parent:null};return t}function NK(t){let e=jK(),r=[t];for(e[t].distance=0;r.length;){let n=r.pop(),i=Object.keys(fd[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 LK(t,e){return function(r){return e(t(r))}}function BK(t,e){let r=[e[t].parent,t],n=fd[e[t].parent][t],i=e[t].parent;for(;e[i].parent;)r.unshift(e[i].parent),n=LK(fd[e[i].parent][i],n),i=e[i].parent;return n.conversion=r,n}BO.exports=function(t){let e=NK(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]=BK(s,e))}return r}});var UO=y((Gce,MO)=>{var tD=eD(),qK=qO(),qs={},MK=Object.keys(tD);function UK(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 HK(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}MK.forEach(t=>{qs[t]={},Object.defineProperty(qs[t],"channels",{value:tD[t].channels}),Object.defineProperty(qs[t],"labels",{value:tD[t].labels});let e=qK(t);Object.keys(e).forEach(n=>{let i=e[n];qs[t][n]=HK(i),qs[t][n].raw=UK(i)})});MO.exports=qs});var nD=y((Wce,WO)=>{"use strict";var HO=(t,e)=>(...r)=>`\x1B[${t(...r)+e}m`,VO=(t,e)=>(...r)=>{let n=t(...r);return`\x1B[${38+e};5;${n}m`},zO=(t,e)=>(...r)=>{let n=t(...r);return`\x1B[${38+e};2;${n[0]};${n[1]};${n[2]}m`},dd=t=>t,GO=(t,e,r)=>[t,e,r],Ms=(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})},rD,Us=(t,e,r,n)=>{rD===void 0&&(rD=UO());let i=n?10:0,o={};for(let[s,a]of Object.entries(rD)){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 VK(){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",Ms(e.color,"ansi",()=>Us(HO,"ansi16",dd,!1)),Ms(e.color,"ansi256",()=>Us(VO,"ansi256",dd,!1)),Ms(e.color,"ansi16m",()=>Us(zO,"rgb",GO,!1)),Ms(e.bgColor,"ansi",()=>Us(HO,"ansi16",dd,!0)),Ms(e.bgColor,"ansi256",()=>Us(VO,"ansi256",dd,!0)),Ms(e.bgColor,"ansi16m",()=>Us(zO,"rgb",GO,!0)),e}Object.defineProperty(WO,"exports",{enumerable:!0,get:VK})});var ZO=y((Kce,XO)=>{"use strict";var zK=Qy(),GK=$O(),KO=nD(),JO=["\x1B","\x9B"],hd=t=>`${JO[0]}[${t}m`,YO=(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=KO.codes.get(Number.parseInt(i,10));if(s){let a=t.indexOf(s.toString());a===-1?n.push(hd(e?s:o)):t.splice(a,1)}else if(e){n.push(hd(0));break}else n.push(hd(o))}if(e&&(n=n.filter((i,o)=>n.indexOf(i)===o),r!==void 0)){let i=hd(KO.codes.get(Number.parseInt(r,10)));n=n.reduce((o,s)=>s===i?[s,...o]:[...o,s],[])}return n.join("")};XO.exports=(t,e,r)=>{let n=[...t],i=[],o=typeof r=="number"?r:n.length,s=!1,a,u=0,l="";for(let[c,f]of n.entries()){let h=!1;if(JO.includes(f)){let d=/\d[^m]*/.exec(t.slice(c,c+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++,!GK({exact:!0}).test(f)&&zK(f.codePointAt())&&(u++,typeof r!="number"&&o++),u>e&&u<=o)l+=f;else if(u===e&&!s&&a!==void 0)l=YO(i);else if(u>=o){l+=YO(i,!0,a);break}}return l}});var eA=y((Yce,QO)=>{"use strict";QO.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 pd=y((Jce,tA)=>{"use strict";var WK=eA();tA.exports=t=>typeof t=="string"?t.replace(WK(),""):t});var nA=y((Xce,rA)=>{"use strict";rA.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 oD=y((Zce,iD)=>{"use strict";var KK=pd(),YK=Qy(),JK=nA(),iA=t=>{if(typeof t!="string"||t.length===0||(t=KK(t),t.length===0))return 0;t=t.replace(JK()," ");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+=YK(n)?2:1)}return e};iD.exports=iA;iD.exports.default=iA});var cA=y((Qce,lA)=>{"use strict";var Ku=oD(),XK=pd(),ZK=nD(),md=new Set(["\x1B","\x9B"]),QK=39,aD="\x07",aA="[",eY="]",uA="m",uD=`${eY}8;;`,oA=t=>`${md.values().next().value}${aA}${t}${uA}`,sA=t=>`${md.values().next().value}${uD}${t}${aD}`,tY=t=>t.split(" ").map(e=>Ku(e)),sD=(t,e,r)=>{let n=[...e],i=!1,o=!1,s=Ku(XK(t[t.length-1]));for(let[a,u]of n.entries()){let l=Ku(u);if(s+l<=r?t[t.length-1]+=u:(t.push(u),s=0),md.has(u)&&(i=!0,o=n.slice(a+1).join("").startsWith(uD)),i){o?u===aD&&(i=!1,o=!1):u===uA&&(i=!1);continue}s+=l,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())},rY=t=>{let e=t.split(" "),r=e.length;for(;r>0&&!(Ku(e[r-1])>0);)r--;return r===e.length?t:e.slice(0,r).join(" ")+e.slice(r).join("")},nY=(t,e,r={})=>{if(r.trim!==!1&&t.trim()==="")return"";let n="",i,o,s=tY(t),a=[""];for(let[l,c]of t.split(" ").entries()){r.trim!==!1&&(a[a.length-1]=a[a.length-1].trimStart());let f=Ku(a[a.length-1]);if(l!==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[l]>e){let h=e-f,d=1+Math.floor((s[l]-h-1)/e);Math.floor((s[l]-1)/e)<d&&a.push(""),sD(a,c,e);continue}if(f+s[l]>e&&f>0&&s[l]>0){if(r.wordWrap===!1&&f<e){sD(a,c,e);continue}a.push("")}if(f+s[l]>e&&r.wordWrap===!1){sD(a,c,e);continue}a[a.length-1]+=c}r.trim!==!1&&(a=a.map(rY));let u=[...a.join(`
|
|
48
|
+
`)];for(let[l,c]of u.entries()){if(n+=c,md.has(c)){let{groups:h}=new RegExp(`(?:\\${aA}(?<code>\\d+)m|\\${uD}(?<uri>.*)${aD})`).exec(u.slice(l).join(""))||{groups:{}};if(h.code!==void 0){let d=Number.parseFloat(h.code);i=d===QK?void 0:d}else h.uri!==void 0&&(o=h.uri.length===0?void 0:h.uri)}let f=ZK.codes.get(Number(i));u[l+1]===`
|
|
49
|
+
`?(o&&(n+=sA("")),i&&f&&(n+=oA(f))):c===`
|
|
50
|
+
`&&(i&&f&&(n+=oA(i)),o&&(n+=sA(o)))}return n};lA.exports=(t,e,r)=>String(t).normalize().replace(/\r\n/g,`
|
|
51
51
|
`).split(`
|
|
52
|
-
`).map(n=>
|
|
53
|
-
`)});var
|
|
52
|
+
`).map(n=>nY(n,e,r)).join(`
|
|
53
|
+
`)});var hA=y((efe,dA)=>{"use strict";var iY=require("os"),fA=iY.homedir();dA.exports=t=>{if(typeof t!="string")throw new TypeError(`Expected a string, got ${typeof t}`);return fA?t.replace(/^~(?=$|\/|\\)/,fA):t}});var vA=y(Ge=>{"use strict";Object.defineProperty(Ge,"__esModule",{value:!0});Ge.columnar=Ge.generateFillSpaceStringList=Ge.expandPath=Ge.prettyPath=Ge.wordWrap=Ge.indent=Ge.TTY_WIDTH=Ge.stripAnsi=Ge.stringWidth=Ge.sliceAnsi=void 0;var pA=(nr(),je(rr)),oY=pA.__importStar(require("os")),vn=pA.__importStar(require("path")),mA=ZO();Ge.sliceAnsi=mA;var gd=oD();Ge.stringWidth=gd;var sY=pd();Ge.stripAnsi=sY;var aY=cA(),uY=hA(),lY=80,cY=120;Ge.TTY_WIDTH=process.stdout.columns?Math.max(lY,Math.min(process.stdout.columns,cY)):1/0;function gA(t=4){return" ".repeat(t)}Ge.indent=gA;function fY(t,{width:e=Ge.TTY_WIDTH,indentation:r=0,append:n=""}){return aY(t,e-r-n.length,{trim:!0}).split(`
|
|
54
54
|
`).join(`${n}
|
|
55
|
-
${
|
|
56
|
-
`);return f=Math.max(f,m.length),m});for(let d in c)s[d]&&s[d].push(...h[d],...Array(f-h[d].length).fill(""))}let a=s.map((c,f)=>{if(f<o-1){let h=
|
|
57
|
-
`)}Ge.columnar=
|
|
58
|
-
Run the command with ${
|
|
59
|
-
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 l=r.next();return o=l.done,l},e:function(l){s=!0,a=l},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(s)throw a}}}}function
|
|
55
|
+
${gA(r)}`)}Ge.wordWrap=fY;function dY(t){t=yA(t);let e=process.cwd(),r=vn.dirname(t),n=oY.homedir(),i=Math.abs(r.split(vn.sep).length-e.split(vn.sep).length);if(e===r)return"."+vn.sep+vn.basename(t);if(r.startsWith(e))return"."+vn.sep+t.substring(e.length+1);if(i<=2){let o=vn.relative(e,t);return o||"."}else{if(t===n)return"~";if(t.indexOf(n)===0)return"~"+vn.sep+t.substring(n.length+1)}return t}Ge.prettyPath=dY;function yA(t){return vn.resolve(uY(t))}Ge.expandPath=yA;function DA(t,e=1,r=" "){e<2&&(e=2);let n=Math.max(...t.map(s=>gd(s))),i=n>e?n+1:e,o=r.repeat(i);return t.map(s=>mA(o,0,i-gd(s)))}Ge.generateFillSpaceStringList=DA;function hY(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(c=>[c]):t[0].map(()=>[]);for(let c of t){let f=0,h=c.map(d=>{let m=d.split(`
|
|
56
|
+
`);return f=Math.max(f,m.length),m});for(let d in c)s[d]&&s[d].push(...h[d],...Array(f-h[d].length).fill(""))}let a=s.map((c,f)=>{if(f<o-1){let h=DA(c);return c.map((d,m)=>`${d}${h[m]}${r===""?"":`${r} `}`)}else return c}),u=0,l=a.reduce((c,f)=>c.map((h,d)=>{let m=c[d]+f[d];return u=Math.max(u,gd(m)),m}));return i&&e!==""&&l.splice(1,0,e.repeat(u)),l.join(`
|
|
57
|
+
`)}Ge.columnar=hY});var bA=y(gr=>{"use strict";Object.defineProperty(gr,"__esModule",{value:!0});gr.TERMINAL_INFO=gr.CI_ENVIRONMENT_VARIABLES_DETECTED=gr.CI_ENVIRONMENT_VARIABLES=void 0;var pY=(nr(),je(rr)),mY=By(),gY=pY.__importStar(require("os")),yY=(0,mY.debug)("ionic:utils-terminal:info");gr.CI_ENVIRONMENT_VARIABLES=["CI","BUILD_ID","BUILD_NUMBER","BITBUCKET_COMMIT","CODEBUILD_BUILD_ARN","GITHUB_ACTIONS"];gr.CI_ENVIRONMENT_VARIABLES_DETECTED=gr.CI_ENVIRONMENT_VARIABLES.filter(t=>!!process.env[t]);function DY(){let{shell:t}=gY.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")}gr.CI_ENVIRONMENT_VARIABLES_DETECTED.length>0&&yY(`Environment variables for CI detected: ${gr.CI_ENVIRONMENT_VARIABLES_DETECTED.join(", ")}`);gr.TERMINAL_INFO=Object.freeze({ci:gr.CI_ENVIRONMENT_VARIABLES_DETECTED.length>0,shell:DY(),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 lD=y(Hs=>{"use strict";Object.defineProperty(Hs,"__esModule",{value:!0});var yd=(nr(),je(rr));yd.__exportStar(Xy(),Hs);yd.__exportStar(kO(),Hs);yd.__exportStar(vA(),Hs);yd.__exportStar(bA(),Hs)});var vd=y(Wr=>{"use strict";Object.defineProperty(Wr,"__esModule",{value:!0});Wr.isFatal=Wr.fatal=Wr.FatalException=Wr.BaseException=void 0;var Dd=class extends Error{constructor(e,r){super(e),this.message=e,this.code=r}};Wr.BaseException=Dd;var Yu=class extends Dd{constructor(e,r=1){super(e,"FATAL"),this.message=e,this.exitCode=r}};Wr.FatalException=Yu;function vY(t){throw new Yu(t)}Wr.fatal=vY;function bY(t){return t&&t instanceof Yu}Wr.isFatal=bY});var dD={};gi(dD,{LOGGER_LEVELS:()=>OY,Logger:()=>fD,NO_COLORS:()=>wA,StreamOutputStrategy:()=>bd,TTYOutputStrategy:()=>cD,TTY_WIDTH:()=>wY,createDefaultLogger:()=>FY,indent:()=>_Y,sliceAnsi:()=>EY,stringWidth:()=>CY,stripAnsi:()=>SY,wordWrap:()=>xY});var wY,_Y,EY,CY,SY,xY,FY,wA,bd,cD,fD,OY,hD=Ct(()=>{wY=80,_Y=t=>t,EY=t=>t,CY=t=>t.length,SY=t=>t,xY=t=>t,FY=()=>({info:console.log,warn:console.warn,error:console.error,debug:console.debug}),wA={},bd=class{constructor(){this.colors=wA,this.stream=process.stdout}},cD=class extends bd{constructor(e){super(),this.options=e}},fD=class{constructor(){}info(){}warn(){}error(){}debug(){}},OY={DEBUG:"DEBUG",INFO:"INFO",WARN:"WARN",ERROR:"ERROR"}});var EA=y(no=>{"use strict";Object.defineProperty(no,"__esModule",{value:!0});no.isInteractive=no.checkInteractive=void 0;var AY=(nr(),je(rr)),_A=lD(),kY=AY.__importDefault(Ls()),TY=Ju(),PY=(...t)=>(0,no.isInteractive)()?!0:t.length?t.filter(e=>!e).length?(TY.logger.error(`Non-interactive shell detected.
|
|
58
|
+
Run the command with ${kY.default.input("--help")} to see a list of arguments that must be provided.`),!1):!0:!1;no.checkInteractive=PY;var RY=()=>_A.TERMINAL_INFO.tty&&!_A.TERMINAL_INFO.ci;no.isInteractive=RY});var We=y((sfe,SA)=>{"use strict";var{FORCE_COLOR:$Y,NODE_DISABLE_COLORS:IY,TERM:jY}=process.env,we={enabled:!IY&&jY!=="dumb"&&$Y!=="0",reset:Fe(0,0),bold:Fe(1,22),dim:Fe(2,22),italic:Fe(3,23),underline:Fe(4,24),inverse:Fe(7,27),hidden:Fe(8,28),strikethrough:Fe(9,29),black:Fe(30,39),red:Fe(31,39),green:Fe(32,39),yellow:Fe(33,39),blue:Fe(34,39),magenta:Fe(35,39),cyan:Fe(36,39),white:Fe(37,39),gray:Fe(90,39),grey:Fe(90,39),bgBlack:Fe(40,49),bgRed:Fe(41,49),bgGreen:Fe(42,49),bgYellow:Fe(43,49),bgBlue:Fe(44,49),bgMagenta:Fe(45,49),bgCyan:Fe(46,49),bgWhite:Fe(47,49)};function CA(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 NY(t,e){let r={has:t,keys:e};return r.reset=we.reset.bind(r),r.bold=we.bold.bind(r),r.dim=we.dim.bind(r),r.italic=we.italic.bind(r),r.underline=we.underline.bind(r),r.inverse=we.inverse.bind(r),r.hidden=we.hidden.bind(r),r.strikethrough=we.strikethrough.bind(r),r.black=we.black.bind(r),r.red=we.red.bind(r),r.green=we.green.bind(r),r.yellow=we.yellow.bind(r),r.blue=we.blue.bind(r),r.magenta=we.magenta.bind(r),r.cyan=we.cyan.bind(r),r.white=we.white.bind(r),r.gray=we.gray.bind(r),r.grey=we.grey.bind(r),r.bgBlack=we.bgBlack.bind(r),r.bgRed=we.bgRed.bind(r),r.bgGreen=we.bgGreen.bind(r),r.bgYellow=we.bgYellow.bind(r),r.bgBlue=we.bgBlue.bind(r),r.bgMagenta=we.bgMagenta.bind(r),r.bgCyan=we.bgCyan.bind(r),r.bgWhite=we.bgWhite.bind(r),r}function Fe(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:we.enabled?CA(this.keys,n+""):n+""):n===void 0?NY([t],[r]):we.enabled?CA([r],n+""):n+""}}SA.exports=we});var FA=y((afe,xA)=>{"use strict";xA.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 wd=y((ufe,OA)=>{"use strict";OA.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 RA=y((lfe,PA)=>{"use strict";function LY(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=BY(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(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
59
|
+
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 l=r.next();return o=l.done,l},e:function(l){s=!0,a=l},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(s)throw a}}}}function BY(t,e){if(t){if(typeof t=="string")return AA(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 AA(t,e)}}function AA(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 qY=wd(),TA=Te(),kA=TA.erase,MY=TA.cursor,UY=t=>[...qY(t)].length;PA.exports=function(t,e){if(!e)return kA.line+MY.to(0);let r=0,n=t.split(/\r?\n/);var i=LY(n),o;try{for(i.s();!(o=i.n()).done;){let s=o.value;r+=1+Math.floor(Math.max(UY(s)-1,0)/e)}}catch(s){i.e(s)}finally{i.f()}return kA.lines(r)}});var pD=y((cfe,$A)=>{"use strict";var Xu={arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",radioOn:"\u25C9",radioOff:"\u25EF",tick:"\u2714",cross:"\u2716",ellipsis:"\u2026",pointerSmall:"\u203A",line:"\u2500",pointer:"\u276F"},HY={arrowUp:Xu.arrowUp,arrowDown:Xu.arrowDown,arrowLeft:Xu.arrowLeft,arrowRight:Xu.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"\u221A",cross:"\xD7",ellipsis:"...",pointerSmall:"\xBB",line:"\u2500",pointer:">"},VY=process.platform==="win32"?HY:Xu;$A.exports=VY});var jA=y((ffe,IA)=>{"use strict";var Vs=We(),io=pD(),mD=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}`}}),zY=t=>mD[t]||mD.default,Zu=Object.freeze({aborted:Vs.red(io.cross),done:Vs.green(io.tick),exited:Vs.yellow(io.cross),default:Vs.cyan("?")}),GY=(t,e,r)=>e?Zu.aborted:r?Zu.exited:t?Zu.done:Zu.default,WY=t=>Vs.gray(t?io.ellipsis:io.pointerSmall),KY=(t,e)=>Vs.gray(t?e?io.pointerSmall:"+":io.line);IA.exports={styles:mD,render:zY,symbols:Zu,symbol:GY,delimiter:WY,item:KY}});var LA=y((dfe,NA)=>{"use strict";var YY=wd();NA.exports=function(t,e){let r=String(YY(t)||"").split(/\r?\n/);return e?r.map(n=>Math.ceil(n.length/e)).reduce((n,i)=>n+i):r.length}});var qA=y((hfe,BA)=>{"use strict";BA.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(`
|
|
60
60
|
`)).join(`
|
|
61
|
-
`)}});var
|
|
62
|
-
`),this.close()}validate(){var e=this;return
|
|
63
|
-
`),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(Qu.down(
|
|
61
|
+
`)}});var UA=y((pfe,MA)=>{"use strict";MA.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 Or=y((mfe,HA)=>{"use strict";HA.exports={action:FA(),clear:RA(),style:jA(),strip:wd(),figures:pD(),lines:LA(),wrap:qA(),entriesToDisplay:UA()}});var bn=y((gfe,GA)=>{"use strict";var VA=require("readline"),JY=Or(),XY=JY.action,ZY=require("events"),zA=Te(),QY=zA.beep,eJ=zA.cursor,tJ=We(),gD=class extends ZY{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=VA.createInterface({input:this.in,escapeCodeTimeout:50});VA.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=XY(s,n);a===!1?this._&&this._(o,s):typeof this[a]=="function"?this[a](s):this.bell()};this.close=()=>{this.out.write(eJ.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(QY)}render(){this.onRender(tJ),this.firstRender&&(this.firstRender=!1)}};GA.exports=gD});var XA=y((yfe,JA)=>{"use strict";function WA(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(l){r(l);return}a.done?e(u):Promise.resolve(u).then(n,i)}function KA(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function s(u){WA(o,n,i,s,a,"next",u)}function a(u){WA(o,n,i,s,a,"throw",u)}s(void 0)})}}var _d=We(),rJ=bn(),YA=Te(),nJ=YA.erase,Qu=YA.cursor,Ed=Or(),yD=Ed.style,DD=Ed.clear,iJ=Ed.lines,oJ=Ed.figures,vD=class extends rJ{constructor(e={}){super(e),this.transform=yD.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=DD("",this.out.columns),this.render()}set value(e){!e&&this.initial?(this.placeholder=!0,this.rendered=_d.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(`
|
|
62
|
+
`),this.close()}validate(){var e=this;return KA(function*(){let r=yield e.validator(e.value);typeof r=="string"&&(e.errorMsg=r,r=!1),e.error=!r})()}submit(){var e=this;return KA(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(`
|
|
63
|
+
`),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(Qu.down(iJ(this.outputError,this.out.columns)-1)+DD(this.outputError,this.out.columns)),this.out.write(DD(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[yD.symbol(this.done,this.aborted),_d.bold(this.msg),yD.delimiter(this.done),this.red?_d.red(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
|
|
64
64
|
`).reduce((e,r,n)=>e+`
|
|
65
|
-
${n?" ":
|
|
65
|
+
${n?" ":oJ.pointerSmall} ${_d.red().italic(r)}`,"")),this.out.write(nJ.line+Qu.to(0)+this.outputText+Qu.save+this.outputError+Qu.restore+Qu.move(this.cursorOffset,0)))}};JA.exports=vD});var tk=y((Dfe,ek)=>{"use strict";var wn=We(),sJ=bn(),el=Or(),ZA=el.style,QA=el.clear,Cd=el.figures,aJ=el.wrap,uJ=el.entriesToDisplay,lJ=Te(),cJ=lJ.cursor,bD=class extends sJ{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=QA("",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(`
|
|
66
66
|
`),this.close()}submit(){this.selection.disabled?this.bell():(this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
|
67
|
-
`),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(
|
|
67
|
+
`),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(cJ.hide):this.out.write(QA(this.outputText,this.out.columns)),super.render();let e=uJ(this.cursor,this.choices.length,this.optionsPerPage),r=e.startIndex,n=e.endIndex;if(this.outputText=[ZA.symbol(this.done,this.aborted),wn.bold(this.msg),ZA.delimiter(!1),this.done?this.selection.title:this.selection.disabled?wn.yellow(this.warn):wn.gray(this.hint)].join(" "),!this.done){this.outputText+=`
|
|
68
68
|
`;for(let i=r;i<n;i++){let o,s,a="",u=this.choices[i];i===r&&r>0?s=Cd.arrowUp:i===n-1&&n<this.choices.length?s=Cd.arrowDown:s=" ",u.disabled?(o=this.cursor===i?wn.gray().underline(u.title):wn.strikethrough().gray(u.title),s=(this.cursor===i?wn.bold().gray(Cd.pointer)+" ":" ")+s):(o=this.cursor===i?wn.cyan().underline(u.title):u.title,s=(this.cursor===i?wn.cyan(Cd.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=`
|
|
69
|
-
`+
|
|
70
|
-
`}}this.out.write(this.outputText)}};
|
|
69
|
+
`+aJ(u.description,{margin:3,width:this.out.columns})))),this.outputText+=`${s} ${o}${wn.gray(a)}
|
|
70
|
+
`}}this.out.write(this.outputText)}};ek.exports=bD});var ak=y((vfe,sk)=>{"use strict";var Sd=We(),fJ=bn(),ik=Or(),rk=ik.style,dJ=ik.clear,ok=Te(),nk=ok.cursor,hJ=ok.erase,wD=class extends fJ{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(`
|
|
71
71
|
`),this.close()}submit(){this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
|
72
|
-
`),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(
|
|
73
|
-
`),this.close()}validate(){var e=this;return
|
|
74
|
-
`),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
|
|
72
|
+
`),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(nk.hide):this.out.write(dJ(this.outputText,this.out.columns)),super.render(),this.outputText=[rk.symbol(this.done,this.aborted),Sd.bold(this.msg),rk.delimiter(this.done),this.value?this.inactive:Sd.cyan().underline(this.inactive),Sd.gray("/"),this.value?Sd.cyan().underline(this.active):this.active].join(" "),this.out.write(hJ.line+nk.to(0)+this.outputText))}};sk.exports=wD});var Kr=y((bfe,uk)=>{"use strict";var _D=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)}};uk.exports=_D});var ck=y((wfe,lk)=>{"use strict";var pJ=Kr(),ED=class extends pJ{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}};lk.exports=ED});var dk=y((_fe,fk)=>{"use strict";var mJ=Kr(),gJ=t=>(t=t%10,t===1?"st":t===2?"nd":t===3?"rd":"th"),CD=class extends mJ{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+gJ(e):this.token==="d"?r+1:this.token==="ddd"?this.locales.weekdaysShort[r]:this.token==="dddd"?this.locales.weekdays[r]:e}};fk.exports=CD});var pk=y((Efe,hk)=>{"use strict";var yJ=Kr(),SD=class extends yJ{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}};hk.exports=SD});var gk=y((Cfe,mk)=>{"use strict";var DJ=Kr(),xD=class extends DJ{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)}};mk.exports=xD});var Dk=y((Sfe,yk)=>{"use strict";var vJ=Kr(),FD=class extends vJ{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}};yk.exports=FD});var bk=y((xfe,vk)=>{"use strict";var bJ=Kr(),OD=class extends bJ{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)}};vk.exports=OD});var _k=y((Ffe,wk)=>{"use strict";var wJ=Kr(),AD=class extends wJ{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}};wk.exports=AD});var Ck=y((Ofe,Ek)=>{"use strict";var _J=Kr(),kD=class extends _J{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}};Ek.exports=kD});var xk=y((Afe,Sk)=>{"use strict";Sk.exports={DatePart:Kr(),Meridiem:ck(),Day:dk(),Hours:pk(),Milliseconds:gk(),Minutes:Dk(),Month:bk(),Seconds:_k(),Year:Ck()}});var jk=y((kfe,Ik)=>{"use strict";function Fk(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(l){r(l);return}a.done?e(u):Promise.resolve(u).then(n,i)}function Ok(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function s(u){Fk(o,n,i,s,a,"next",u)}function a(u){Fk(o,n,i,s,a,"throw",u)}s(void 0)})}}var TD=We(),EJ=bn(),RD=Or(),Ak=RD.style,kk=RD.clear,CJ=RD.figures,$k=Te(),SJ=$k.erase,Tk=$k.cursor,_n=xk(),Pk=_n.DatePart,xJ=_n.Meridiem,FJ=_n.Day,OJ=_n.Hours,AJ=_n.Milliseconds,kJ=_n.Minutes,TJ=_n.Month,PJ=_n.Seconds,RJ=_n.Year,$J=/\\(.)|"((?:\\["\\]|[^"])+)"|(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,Rk={1:({token:t})=>t.replace(/\\(.)/g,"$1"),2:t=>new FJ(t),3:t=>new TJ(t),4:t=>new RJ(t),5:t=>new xJ(t),6:t=>new OJ(t),7:t=>new kJ(t),8:t=>new PJ(t),9:t=>new AJ(t)},IJ={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(",")},PD=class extends EJ{constructor(e={}){super(e),this.msg=e.message,this.cursor=0,this.typed="",this.locales=Object.assign(IJ,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=kk("",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=$J.exec(e);){let i=r.shift(),o=r.findIndex(s=>s!=null);this.parts.push(o in Rk?Rk[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 Pk)),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
|
|
73
|
+
`),this.close()}validate(){var e=this;return Ok(function*(){let r=yield e.validator(e.value);typeof r=="string"&&(e.errorMsg=r,r=!1),e.error=!r})()}submit(){var e=this;return Ok(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(`
|
|
74
|
+
`),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 Pk)),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(Tk.hide):this.out.write(kk(this.outputText,this.out.columns)),super.render(),this.outputText=[Ak.symbol(this.done,this.aborted),TD.bold(this.msg),Ak.delimiter(!1),this.parts.reduce((e,r,n)=>e.concat(n===this.cursor&&!this.done?TD.cyan().underline(r.toString()):r),[]).join("")].join(" "),this.error&&(this.outputText+=this.errorMsg.split(`
|
|
75
75
|
`).reduce((e,r,n)=>e+`
|
|
76
|
-
${n?" ":
|
|
77
|
-
`),this.close()}validate(){var e=this;return
|
|
78
|
-
`),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(Fd.down(
|
|
76
|
+
${n?" ":CJ.pointerSmall} ${TD.red().italic(r)}`,"")),this.out.write(SJ.line+Tk.to(0)+this.outputText))}};Ik.exports=PD});var Hk=y((Tfe,Uk)=>{"use strict";function Nk(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(l){r(l);return}a.done?e(u):Promise.resolve(u).then(n,i)}function Lk(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function s(u){Nk(o,n,i,s,a,"next",u)}function a(u){Nk(o,n,i,s,a,"throw",u)}s(void 0)})}}var xd=We(),jJ=bn(),Mk=Te(),Fd=Mk.cursor,NJ=Mk.erase,Od=Or(),$D=Od.style,LJ=Od.figures,Bk=Od.clear,BJ=Od.lines,qJ=/[0-9]/,ID=t=>t!==void 0,qk=(t,e)=>{let r=Math.pow(10,e);return Math.round(t*r)/r},jD=class extends jJ{constructor(e={}){super(e),this.transform=$D.render(e.style),this.msg=e.message,this.initial=ID(e.initial)?e.initial:"",this.float=!!e.float,this.round=e.round||2,this.inc=e.increment||1,this.min=ID(e.min)?e.min:-1/0,this.max=ID(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(`${qk(e,this.round)}`),this._value=qk(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||qJ.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(`
|
|
77
|
+
`),this.close()}validate(){var e=this;return Lk(function*(){let r=yield e.validator(e.value);typeof r=="string"&&(e.errorMsg=r,r=!1),e.error=!r})()}submit(){var e=this;return Lk(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(`
|
|
78
|
+
`),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(Fd.down(BJ(this.outputError,this.out.columns)-1)+Bk(this.outputError,this.out.columns)),this.out.write(Bk(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[$D.symbol(this.done,this.aborted),xd.bold(this.msg),$D.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(`
|
|
79
79
|
`).reduce((e,r,n)=>e+`
|
|
80
|
-
${n?" ":
|
|
80
|
+
${n?" ":LJ.pointerSmall} ${xd.red().italic(r)}`,"")),this.out.write(NJ.line+Fd.to(0)+this.outputText+Fd.save+this.outputError+Fd.restore))}};Uk.exports=jD});var LD=y((Pfe,Gk)=>{"use strict";var Yr=We(),MJ=Te(),UJ=MJ.cursor,HJ=bn(),tl=Or(),Vk=tl.clear,ni=tl.figures,zk=tl.style,VJ=tl.wrap,zJ=tl.entriesToDisplay,ND=class extends HJ{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=Vk("",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(`
|
|
81
81
|
`),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(`
|
|
82
82
|
`),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:`
|
|
83
83
|
Instructions:
|
|
@@ -85,15 +85,15 @@ Instructions:
|
|
|
85
85
|
${ni.arrowLeft}/${ni.arrowRight}/[space]: Toggle selection
|
|
86
86
|
`+(this.maxChoices===void 0?` a: Toggle all
|
|
87
87
|
`:"")+" enter/return: Complete answer":""}renderOption(e,r,n,i){let o=(r.selected?Yr.green(ni.radioOn):ni.radioOff)+" "+i+" ",s,a;return r.disabled?s=e===n?Yr.gray().underline(r.title):Yr.strikethrough().gray(r.title):(s=e===n?Yr.cyan().underline(r.title):r.title,e===n&&r.description&&(a=` - ${r.description}`,(o.length+s.length+a.length>=this.out.columns||r.description.split(/\r?\n/).length>1)&&(a=`
|
|
88
|
-
`+
|
|
88
|
+
`+VJ(r.description,{margin:o.length,width:this.out.columns})))),o+s+Yr.gray(a||"")}paginateOptions(e){if(e.length===0)return Yr.red("No matches for this query.");let r=zJ(this.cursor,e.length,this.optionsPerPage),n=r.startIndex,i=r.endIndex,o,s=[];for(let a=n;a<i;a++)a===n&&n>0?o=ni.arrowUp:a===i-1&&i<e.length?o=ni.arrowDown:o=" ",s.push(this.renderOption(this.cursor,e[a],a,o));return`
|
|
89
89
|
`+s.join(`
|
|
90
|
-
`)}renderOptions(e){return this.done?"":this.paginateOptions(e)}renderDoneOrInstructions(){if(this.done)return this.value.filter(r=>r.selected).map(r=>r.title).join(", ");let e=[Yr.gray(this.hint),this.renderInstructions()];return this.value[this.cursor].disabled&&e.push(Yr.yellow(this.warn)),e.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(
|
|
90
|
+
`)}renderOptions(e){return this.done?"":this.paginateOptions(e)}renderDoneOrInstructions(){if(this.done)return this.value.filter(r=>r.selected).map(r=>r.title).join(", ");let e=[Yr.gray(this.hint),this.renderInstructions()];return this.value[this.cursor].disabled&&e.push(Yr.yellow(this.warn)),e.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(UJ.hide),super.render();let e=[zk.symbol(this.done,this.aborted),Yr.bold(this.msg),zk.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(e+=Yr.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),e+=this.renderOptions(this.value),this.out.write(this.clear+e),this.clear=Vk(e,this.out.columns)}};Gk.exports=ND});var Qk=y((Rfe,Zk)=>{"use strict";function Wk(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(l){r(l);return}a.done?e(u):Promise.resolve(u).then(n,i)}function GJ(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function s(u){Wk(o,n,i,s,a,"next",u)}function a(u){Wk(o,n,i,s,a,"throw",u)}s(void 0)})}}var rl=We(),WJ=bn(),Xk=Te(),KJ=Xk.erase,Kk=Xk.cursor,nl=Or(),BD=nl.style,Yk=nl.clear,qD=nl.figures,YJ=nl.wrap,JJ=nl.entriesToDisplay,Jk=(t,e)=>t[e]&&(t[e].value||t[e].title||t[e]),XJ=(t,e)=>t[e]&&(t[e].title||t[e].value||t[e]),ZJ=(t,e)=>{let r=t.findIndex(n=>n.value===e||n.title===e);return r>-1?r:void 0},MD=class extends WJ{constructor(e={}){super(e),this.msg=e.message,this.suggest=e.suggest,this.choices=e.choices,this.initial=typeof e.initial=="number"?e.initial:ZJ(e.choices,e.initial),this.select=this.initial||e.cursor||0,this.i18n={noMatches:e.noMatches||"no matches found"},this.fallback=e.fallback||this.initial,this.clearFirst=e.clearFirst||!1,this.suggestions=[],this.input="",this.limit=e.limit||10,this.cursor=0,this.transform=BD.render(e.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=Yk("",this.out.columns),this.complete(this.render),this.render()}set fallback(e){this._fb=Number.isSafeInteger(parseInt(e))?parseInt(e):e}get fallback(){let e;return typeof this._fb=="number"?e=this.choices[this._fb]:typeof this._fb=="string"&&(e={title:this._fb}),e||this._fb||{title:this.i18n.noMatches}}moveSelect(e){this.select=e,this.suggestions.length>0?this.value=Jk(this.suggestions,e):this.value=this.fallback.value,this.fire()}complete(e){var r=this;return GJ(function*(){let n=r.completing=r.suggest(r.input,r.choices),i=yield n;if(r.completing!==n)return;r.suggestions=i.map((s,a,u)=>({title:XJ(u,a),value:Jk(u,a),description:s.description})),r.completing=!1;let o=Math.max(i.length-1,0);r.moveSelect(Math.min(o,r.select)),e&&e()})()}reset(){this.input="",this.complete(()=>{this.moveSelect(this.initial!==void 0?this.initial:0),this.render()}),this.render()}exit(){this.clearFirst&&this.input.length>0?this.reset():(this.done=this.exited=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
|
91
91
|
`),this.close())}abort(){this.done=this.aborted=!0,this.exited=!1,this.fire(),this.render(),this.out.write(`
|
|
92
92
|
`),this.close()}submit(){this.done=!0,this.aborted=this.exited=!1,this.fire(),this.render(),this.out.write(`
|
|
93
93
|
`),this.close()}_(e,r){let n=this.input.slice(0,this.cursor),i=this.input.slice(this.cursor);this.input=`${n}${e}${i}`,this.cursor=n.length+1,this.complete(this.render),this.render()}delete(){if(this.cursor===0)return this.bell();let e=this.input.slice(0,this.cursor-1),r=this.input.slice(this.cursor);this.input=`${e}${r}`,this.complete(this.render),this.cursor=this.cursor-1,this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();let e=this.input.slice(0,this.cursor),r=this.input.slice(this.cursor+1);this.input=`${e}${r}`,this.complete(this.render),this.render()}first(){this.moveSelect(0),this.render()}last(){this.moveSelect(this.suggestions.length-1),this.render()}up(){this.select===0?this.moveSelect(this.suggestions.length-1):this.moveSelect(this.select-1),this.render()}down(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render()}next(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render()}nextPage(){this.moveSelect(Math.min(this.select+this.limit,this.suggestions.length-1)),this.render()}prevPage(){this.moveSelect(Math.max(this.select-this.limit,0)),this.render()}left(){if(this.cursor<=0)return this.bell();this.cursor=this.cursor-1,this.render()}right(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();this.cursor=this.cursor+1,this.render()}renderOption(e,r,n,i){let o,s=n?qD.arrowUp:i?qD.arrowDown:" ",a=r?rl.cyan().underline(e.title):e.title;return s=(r?rl.cyan(qD.pointer)+" ":" ")+s,e.description&&(o=` - ${e.description}`,(s.length+a.length+o.length>=this.out.columns||e.description.split(/\r?\n/).length>1)&&(o=`
|
|
94
|
-
`+
|
|
94
|
+
`+YJ(e.description,{margin:3,width:this.out.columns}))),s+" "+a+rl.gray(o||"")}render(){if(this.closed)return;this.firstRender?this.out.write(Kk.hide):this.out.write(Yk(this.outputText,this.out.columns)),super.render();let e=JJ(this.select,this.choices.length,this.limit),r=e.startIndex,n=e.endIndex;if(this.outputText=[BD.symbol(this.done,this.aborted,this.exited),rl.bold(this.msg),BD.delimiter(this.completing),this.done&&this.suggestions[this.select]?this.suggestions[this.select].title:this.rendered=this.transform.render(this.input)].join(" "),!this.done){let i=this.suggestions.slice(r,n).map((o,s)=>this.renderOption(o,this.select===s+r,s===0&&r>0,s+r===n-1&&n<this.choices.length)).join(`
|
|
95
95
|
`);this.outputText+=`
|
|
96
|
-
`+(i||rl.gray(this.fallback.title))}this.out.write(
|
|
96
|
+
`+(i||rl.gray(this.fallback.title))}this.out.write(KJ.line+Kk.to(0)+this.outputText)}};Zk.exports=MD});var nT=y(($fe,rT)=>{"use strict";var En=We(),QJ=Te(),eX=QJ.cursor,tX=LD(),HD=Or(),eT=HD.clear,tT=HD.style,zs=HD.figures,UD=class extends tX{constructor(e={}){e.overrideRender=!0,super(e),this.inputValue="",this.clear=eT("",this.out.columns),this.filteredOptions=this.value,this.render()}last(){this.cursor=this.filteredOptions.length-1,this.render()}next(){this.cursor=(this.cursor+1)%this.filteredOptions.length,this.render()}up(){this.cursor===0?this.cursor=this.filteredOptions.length-1:this.cursor--,this.render()}down(){this.cursor===this.filteredOptions.length-1?this.cursor=0:this.cursor++,this.render()}left(){this.filteredOptions[this.cursor].selected=!1,this.render()}right(){if(this.value.filter(e=>e.selected).length>=this.maxChoices)return this.bell();this.filteredOptions[this.cursor].selected=!0,this.render()}delete(){this.inputValue.length&&(this.inputValue=this.inputValue.substr(0,this.inputValue.length-1),this.updateFilteredOptions())}updateFilteredOptions(){let e=this.filteredOptions[this.cursor];this.filteredOptions=this.value.filter(n=>this.inputValue?!!(typeof n.title=="string"&&n.title.toLowerCase().includes(this.inputValue.toLowerCase())||typeof n.value=="string"&&n.value.toLowerCase().includes(this.inputValue.toLowerCase())):!0);let r=this.filteredOptions.findIndex(n=>n===e);this.cursor=r<0?0:r,this.render()}handleSpaceToggle(){let e=this.filteredOptions[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()}}handleInputChange(e){this.inputValue=this.inputValue+e,this.updateFilteredOptions()}_(e,r){e===" "?this.handleSpaceToggle():this.handleInputChange(e)}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
|
|
97
97
|
Instructions:
|
|
98
98
|
${zs.arrowUp}/${zs.arrowDown}: Highlight option
|
|
99
99
|
${zs.arrowLeft}/${zs.arrowRight}/[space]: Toggle selection
|
|
@@ -101,31 +101,31 @@ Instructions:
|
|
|
101
101
|
enter/return: Complete answer
|
|
102
102
|
`:""}renderCurrentInput(){return`
|
|
103
103
|
Filtered results for: ${this.inputValue?this.inputValue:En.gray("Enter something to filter")}
|
|
104
|
-
`}renderOption(e,r,n){let i;return r.disabled?i=e===n?En.gray().underline(r.title):En.strikethrough().gray(r.title):i=e===n?En.cyan().underline(r.title):r.title,(r.selected?En.green(zs.radioOn):zs.radioOff)+" "+i}renderDoneOrInstructions(){if(this.done)return this.value.filter(r=>r.selected).map(r=>r.title).join(", ");let e=[En.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&e.push(En.yellow(this.warn)),e.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(
|
|
104
|
+
`}renderOption(e,r,n){let i;return r.disabled?i=e===n?En.gray().underline(r.title):En.strikethrough().gray(r.title):i=e===n?En.cyan().underline(r.title):r.title,(r.selected?En.green(zs.radioOn):zs.radioOff)+" "+i}renderDoneOrInstructions(){if(this.done)return this.value.filter(r=>r.selected).map(r=>r.title).join(", ");let e=[En.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&e.push(En.yellow(this.warn)),e.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(eX.hide),super.render();let e=[tT.symbol(this.done,this.aborted),En.bold(this.msg),tT.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(e+=En.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=eT(e,this.out.columns)}};rT.exports=UD});var cT=y((Ife,lT)=>{"use strict";var iT=We(),rX=bn(),aT=Or(),oT=aT.style,nX=aT.clear,uT=Te(),iX=uT.erase,sT=uT.cursor,VD=class extends rX{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(`
|
|
105
105
|
`),this.close()}submit(){this.value=this.value||!1,this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
|
106
|
-
`),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(
|
|
107
|
-
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 l=r.next();return o=l.done,l},e:function(l){s=!0,a=l},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(s)throw a}}}}function
|
|
106
|
+
`),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(sT.hide):this.out.write(nX(this.outputText,this.out.columns)),super.render(),this.outputText=[oT.symbol(this.done,this.aborted),iT.bold(this.msg),oT.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:iT.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(iX.line+sT.to(0)+this.outputText))}};lT.exports=VD});var dT=y((jfe,fT)=>{"use strict";fT.exports={TextPrompt:XA(),SelectPrompt:tk(),TogglePrompt:ak(),DatePrompt:jk(),NumberPrompt:Hk(),MultiselectPrompt:LD(),AutocompletePrompt:Qk(),AutocompleteMultiselectPrompt:nT(),ConfirmPrompt:cT()}});var pT=y(hT=>{"use strict";var zt=hT,oX=dT(),Ad=t=>t;function Jr(t,e,r={}){return new Promise((n,i)=>{let o=new oX[t](e),s=r.onAbort||Ad,a=r.onSubmit||Ad,u=r.onExit||Ad;o.on("state",e.onState||Ad),o.on("submit",l=>n(a(l))),o.on("exit",l=>n(u(l))),o.on("abort",l=>i(s(l)))})}zt.text=t=>Jr("TextPrompt",t);zt.password=t=>(t.style="password",zt.text(t));zt.invisible=t=>(t.style="invisible",zt.text(t));zt.number=t=>Jr("NumberPrompt",t);zt.date=t=>Jr("DatePrompt",t);zt.confirm=t=>Jr("ConfirmPrompt",t);zt.list=t=>{let e=t.separator||",";return Jr("TextPrompt",t,{onSubmit:r=>r.split(e).map(n=>n.trim())})};zt.toggle=t=>Jr("TogglePrompt",t);zt.select=t=>Jr("SelectPrompt",t);zt.multiselect=t=>{t.choices=[].concat(t.choices||[]);let e=r=>r.filter(n=>n.selected).map(n=>n.value);return Jr("MultiselectPrompt",t,{onAbort:e,onSubmit:e})};zt.autocompleteMultiselect=t=>{t.choices=[].concat(t.choices||[]);let e=r=>r.filter(n=>n.selected).map(n=>n.value);return Jr("AutocompleteMultiselectPrompt",t,{onAbort:e,onSubmit:e})};var sX=(t,e)=>Promise.resolve(e.filter(r=>r.title.slice(0,t.length).toLowerCase()===t.toLowerCase()));zt.autocomplete=t=>(t.suggest=t.suggest||sX,t.choices=[].concat(t.choices||[]),Jr("AutocompletePrompt",t))});var _T=y((Lfe,wT)=>{"use strict";function mT(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 gT(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?mT(Object(r),!0).forEach(function(n){aX(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):mT(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function aX(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function uX(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=lX(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(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
107
|
+
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 l=r.next();return o=l.done,l},e:function(l){s=!0,a=l},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(s)throw a}}}}function lX(t,e){if(t){if(typeof t=="string")return yT(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 yT(t,e)}}function yT(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 DT(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(l){r(l);return}a.done?e(u):Promise.resolve(u).then(n,i)}function vT(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function s(u){DT(o,n,i,s,a,"next",u)}function a(u){DT(o,n,i,s,a,"throw",u)}s(void 0)})}}var zD=pT(),cX=["suggest","format","onState","validate","onRender","type"],bT=()=>{};function ii(){return GD.apply(this,arguments)}function GD(){return GD=vT(function*(t=[],{onSubmit:e=bT,onCancel:r=bT}={}){let n={},i=ii._override||{};t=[].concat(t);let o,s,a,u,l,c,f=function(){var D=vT(function*(_,F,g=!1){if(!(!g&&_.validate&&_.validate(F)!==!0))return _.format?yield _.format(F,n):F});return function(F,g){return D.apply(this,arguments)}}();var h=uX(t),d;try{for(h.s();!(d=h.n()).done;){s=d.value;var m=s;if(u=m.name,l=m.type,typeof l=="function"&&(l=yield l(o,gT({},n),s),s.type=l),!!l){for(let D in s){if(cX.includes(D))continue;let _=s[D];s[D]=typeof _=="function"?yield _(o,gT({},n),c):_}if(c=s,typeof s.message!="string")throw new Error("prompt message is required");var b=s;if(u=b.name,l=b.type,zD[l]===void 0)throw new Error(`prompt type (${l}) 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=ii._injected?fX(ii._injected,s.initial):yield zD[l](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(D){h.e(D)}finally{h.f()}return n}),GD.apply(this,arguments)}function fX(t,e){let r=t.shift();if(r instanceof Error)throw r;return r===void 0?e:r}function dX(t){ii._injected=(ii._injected||[]).concat(t)}function hX(t){ii._override=Object.assign({},t)}wT.exports=Object.assign(ii,{prompt:ii,prompts:zD,inject:dX,override:hX})});var CT=y((Bfe,ET)=>{"use strict";ET.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((qfe,ST)=>{"use strict";ST.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 OT=y((Mfe,FT)=>{"use strict";var pX=kd(),{erase:xT,cursor:mX}=Te(),gX=t=>[...pX(t)].length;FT.exports=function(t,e){if(!e)return xT.line+mX.to(0);let r=0,n=t.split(/\r?\n/);for(let i of n)r+=1+Math.floor(Math.max(gX(i)-1,0)/e);return xT.lines(r)}});var WD=y((Ufe,AT)=>{"use strict";var il={arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",radioOn:"\u25C9",radioOff:"\u25EF",tick:"\u2714",cross:"\u2716",ellipsis:"\u2026",pointerSmall:"\u203A",line:"\u2500",pointer:"\u276F"},yX={arrowUp:il.arrowUp,arrowDown:il.arrowDown,arrowLeft:il.arrowLeft,arrowRight:il.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"\u221A",cross:"\xD7",ellipsis:"...",pointerSmall:"\xBB",line:"\u2500",pointer:">"},DX=process.platform==="win32"?yX:il;AT.exports=DX});var TT=y((Hfe,kT)=>{"use strict";var Gs=We(),oo=WD(),KD=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}`}}),vX=t=>KD[t]||KD.default,ol=Object.freeze({aborted:Gs.red(oo.cross),done:Gs.green(oo.tick),exited:Gs.yellow(oo.cross),default:Gs.cyan("?")}),bX=(t,e,r)=>e?ol.aborted:r?ol.exited:t?ol.done:ol.default,wX=t=>Gs.gray(t?oo.ellipsis:oo.pointerSmall),_X=(t,e)=>Gs.gray(t?e?oo.pointerSmall:"+":oo.line);kT.exports={styles:KD,render:vX,symbols:ol,symbol:bX,delimiter:wX,item:_X}});var RT=y((Vfe,PT)=>{"use strict";var EX=kd();PT.exports=function(t,e){let r=String(EX(t)||"").split(/\r?\n/);return e?r.map(n=>Math.ceil(n.length/e)).reduce((n,i)=>n+i):r.length}});var IT=y((zfe,$T)=>{"use strict";$T.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(`
|
|
108
108
|
`)).join(`
|
|
109
|
-
`)}});var
|
|
109
|
+
`)}});var NT=y((Gfe,jT)=>{"use strict";jT.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 Ar=y((Wfe,LT)=>{"use strict";LT.exports={action:CT(),clear:OT(),style:TT(),strip:kd(),figures:WD(),lines:RT(),wrap:IT(),entriesToDisplay:NT()}});var Cn=y((Kfe,qT)=>{"use strict";var BT=require("readline"),{action:CX}=Ar(),SX=require("events"),{beep:xX,cursor:FX}=Te(),OX=We(),YD=class extends SX{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=BT.createInterface({input:this.in,escapeCodeTimeout:50});BT.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=CX(s,n);a===!1?this._&&this._(o,s):typeof this[a]=="function"?this[a](s):this.bell()};this.close=()=>{this.out.write(FX.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(xX)}render(){this.onRender(OX),this.firstRender&&(this.firstRender=!1)}};qT.exports=YD});var UT=y((Yfe,MT)=>{var Td=We(),AX=Cn(),{erase:kX,cursor:sl}=Te(),{style:JD,clear:XD,lines:TX,figures:PX}=Ar(),ZD=class extends AX{constructor(e={}){super(e),this.transform=JD.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=XD("",this.out.columns),this.render()}set value(e){!e&&this.initial?(this.placeholder=!0,this.rendered=Td.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(`
|
|
110
110
|
`),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(`
|
|
111
|
-
`),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(sl.down(
|
|
111
|
+
`),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(sl.down(TX(this.outputError,this.out.columns)-1)+XD(this.outputError,this.out.columns)),this.out.write(XD(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[JD.symbol(this.done,this.aborted),Td.bold(this.msg),JD.delimiter(this.done),this.red?Td.red(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
|
|
112
112
|
`).reduce((e,r,n)=>e+`
|
|
113
|
-
${n?" ":
|
|
113
|
+
${n?" ":PX.pointerSmall} ${Td.red().italic(r)}`,"")),this.out.write(kX.line+sl.to(0)+this.outputText+sl.save+this.outputError+sl.restore+sl.move(this.cursorOffset,0)))}};MT.exports=ZD});var GT=y((Jfe,zT)=>{"use strict";var Sn=We(),RX=Cn(),{style:HT,clear:VT,figures:Pd,wrap:$X,entriesToDisplay:IX}=Ar(),{cursor:jX}=Te(),QD=class extends RX{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=VT("",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(`
|
|
114
114
|
`),this.close()}submit(){this.selection.disabled?this.bell():(this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
|
115
|
-
`),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(
|
|
115
|
+
`),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(jX.hide):this.out.write(VT(this.outputText,this.out.columns)),super.render();let{startIndex:e,endIndex:r}=IX(this.cursor,this.choices.length,this.optionsPerPage);if(this.outputText=[HT.symbol(this.done,this.aborted),Sn.bold(this.msg),HT.delimiter(!1),this.done?this.selection.title:this.selection.disabled?Sn.yellow(this.warn):Sn.gray(this.hint)].join(" "),!this.done){this.outputText+=`
|
|
116
116
|
`;for(let n=e;n<r;n++){let i,o,s="",a=this.choices[n];n===e&&e>0?o=Pd.arrowUp:n===r-1&&r<this.choices.length?o=Pd.arrowDown:o=" ",a.disabled?(i=this.cursor===n?Sn.gray().underline(a.title):Sn.strikethrough().gray(a.title),o=(this.cursor===n?Sn.bold().gray(Pd.pointer)+" ":" ")+o):(i=this.cursor===n?Sn.cyan().underline(a.title):a.title,o=(this.cursor===n?Sn.cyan(Pd.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=`
|
|
117
|
-
|
|
118
|
-
`}}this.out.write(this.outputText)}};
|
|
117
|
+
`+$X(a.description,{margin:3,width:this.out.columns})))),this.outputText+=`${o} ${i}${Sn.gray(s)}
|
|
118
|
+
`}}this.out.write(this.outputText)}};zT.exports=QD});var JT=y((Xfe,YT)=>{var Rd=We(),NX=Cn(),{style:WT,clear:LX}=Ar(),{cursor:KT,erase:BX}=Te(),e0=class extends NX{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(`
|
|
119
119
|
`),this.close()}submit(){this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
|
120
|
-
`),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(
|
|
120
|
+
`),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(KT.hide):this.out.write(LX(this.outputText,this.out.columns)),super.render(),this.outputText=[WT.symbol(this.done,this.aborted),Rd.bold(this.msg),WT.delimiter(this.done),this.value?this.inactive:Rd.cyan().underline(this.inactive),Rd.gray("/"),this.value?Rd.cyan().underline(this.active):this.active].join(" "),this.out.write(BX.line+KT.to(0)+this.outputText))}};YT.exports=e0});var Xr=y((Zfe,XT)=>{"use strict";var t0=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)}};XT.exports=t0});var QT=y((Qfe,ZT)=>{"use strict";var qX=Xr(),r0=class extends qX{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}};ZT.exports=r0});var tP=y((ede,eP)=>{"use strict";var MX=Xr(),UX=t=>(t=t%10,t===1?"st":t===2?"nd":t===3?"rd":"th"),n0=class extends MX{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+UX(e):this.token==="d"?r+1:this.token==="ddd"?this.locales.weekdaysShort[r]:this.token==="dddd"?this.locales.weekdays[r]:e}};eP.exports=n0});var nP=y((tde,rP)=>{"use strict";var HX=Xr(),i0=class extends HX{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}};rP.exports=i0});var oP=y((rde,iP)=>{"use strict";var VX=Xr(),o0=class extends VX{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)}};iP.exports=o0});var aP=y((nde,sP)=>{"use strict";var zX=Xr(),s0=class extends zX{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}};sP.exports=s0});var lP=y((ide,uP)=>{"use strict";var GX=Xr(),a0=class extends GX{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)}};uP.exports=a0});var fP=y((ode,cP)=>{"use strict";var WX=Xr(),u0=class extends WX{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}};cP.exports=u0});var hP=y((sde,dP)=>{"use strict";var KX=Xr(),l0=class extends KX{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}};dP.exports=l0});var mP=y((ade,pP)=>{"use strict";pP.exports={DatePart:Xr(),Meridiem:QT(),Day:tP(),Hours:nP(),Milliseconds:oP(),Minutes:aP(),Month:lP(),Seconds:fP(),Year:hP()}});var _P=y((ude,wP)=>{"use strict";var c0=We(),YX=Cn(),{style:gP,clear:yP,figures:JX}=Ar(),{erase:XX,cursor:DP}=Te(),{DatePart:vP,Meridiem:ZX,Day:QX,Hours:eZ,Milliseconds:tZ,Minutes:rZ,Month:nZ,Seconds:iZ,Year:oZ}=mP(),sZ=/\\(.)|"((?:\\["\\]|[^"])+)"|(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,bP={1:({token:t})=>t.replace(/\\(.)/g,"$1"),2:t=>new QX(t),3:t=>new nZ(t),4:t=>new oZ(t),5:t=>new ZX(t),6:t=>new eZ(t),7:t=>new rZ(t),8:t=>new iZ(t),9:t=>new tZ(t)},aZ={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(",")},f0=class extends YX{constructor(e={}){super(e),this.msg=e.message,this.cursor=0,this.typed="",this.locales=Object.assign(aZ,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=yP("",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=sZ.exec(e);){let i=r.shift(),o=r.findIndex(s=>s!=null);this.parts.push(o in bP?bP[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 vP)),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
|
|
121
121
|
`),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(`
|
|
122
|
-
`),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
|
|
122
|
+
`),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 vP)),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(DP.hide):this.out.write(yP(this.outputText,this.out.columns)),super.render(),this.outputText=[gP.symbol(this.done,this.aborted),c0.bold(this.msg),gP.delimiter(!1),this.parts.reduce((e,r,n)=>e.concat(n===this.cursor&&!this.done?c0.cyan().underline(r.toString()):r),[]).join("")].join(" "),this.error&&(this.outputText+=this.errorMsg.split(`
|
|
123
123
|
`).reduce((e,r,n)=>e+`
|
|
124
|
-
${n?" ":
|
|
124
|
+
${n?" ":JX.pointerSmall} ${c0.red().italic(r)}`,"")),this.out.write(XX.line+DP.to(0)+this.outputText))}};wP.exports=f0});var xP=y((lde,SP)=>{var $d=We(),uZ=Cn(),{cursor:Id,erase:lZ}=Te(),{style:d0,figures:cZ,clear:EP,lines:fZ}=Ar(),dZ=/[0-9]/,h0=t=>t!==void 0,CP=(t,e)=>{let r=Math.pow(10,e);return Math.round(t*r)/r},p0=class extends uZ{constructor(e={}){super(e),this.transform=d0.render(e.style),this.msg=e.message,this.initial=h0(e.initial)?e.initial:"",this.float=!!e.float,this.round=e.round||2,this.inc=e.increment||1,this.min=h0(e.min)?e.min:-1/0,this.max=h0(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=$d.gray(this.transform.render(`${this.initial}`)),this._value=""):(this.placeholder=!1,this.rendered=this.transform.render(`${CP(e,this.round)}`),this._value=CP(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||dZ.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(`
|
|
125
125
|
`),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(`
|
|
126
|
-
`),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(Id.down(
|
|
126
|
+
`),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(Id.down(fZ(this.outputError,this.out.columns)-1)+EP(this.outputError,this.out.columns)),this.out.write(EP(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[d0.symbol(this.done,this.aborted),$d.bold(this.msg),d0.delimiter(this.done),!this.done||!this.done&&!this.placeholder?$d[this.color]().underline(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
|
|
127
127
|
`).reduce((e,r,n)=>e+`
|
|
128
|
-
${n?" ":
|
|
128
|
+
${n?" ":cZ.pointerSmall} ${$d.red().italic(r)}`,"")),this.out.write(lZ.line+Id.to(0)+this.outputText+Id.save+this.outputError+Id.restore))}};SP.exports=p0});var g0=y((cde,AP)=>{"use strict";var Zr=We(),{cursor:hZ}=Te(),pZ=Cn(),{clear:FP,figures:oi,style:OP,wrap:mZ,entriesToDisplay:gZ}=Ar(),m0=class extends pZ{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=FP("",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(`
|
|
129
129
|
`),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(`
|
|
130
130
|
`),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:`
|
|
131
131
|
Instructions:
|
|
@@ -133,15 +133,15 @@ Instructions:
|
|
|
133
133
|
${oi.arrowLeft}/${oi.arrowRight}/[space]: Toggle selection
|
|
134
134
|
`+(this.maxChoices===void 0?` a: Toggle all
|
|
135
135
|
`:"")+" enter/return: Complete answer":""}renderOption(e,r,n,i){let o=(r.selected?Zr.green(oi.radioOn):oi.radioOff)+" "+i+" ",s,a;return r.disabled?s=e===n?Zr.gray().underline(r.title):Zr.strikethrough().gray(r.title):(s=e===n?Zr.cyan().underline(r.title):r.title,e===n&&r.description&&(a=` - ${r.description}`,(o.length+s.length+a.length>=this.out.columns||r.description.split(/\r?\n/).length>1)&&(a=`
|
|
136
|
-
`+
|
|
136
|
+
`+mZ(r.description,{margin:o.length,width:this.out.columns})))),o+s+Zr.gray(a||"")}paginateOptions(e){if(e.length===0)return Zr.red("No matches for this query.");let{startIndex:r,endIndex:n}=gZ(this.cursor,e.length,this.optionsPerPage),i,o=[];for(let s=r;s<n;s++)s===r&&r>0?i=oi.arrowUp:s===n-1&&n<e.length?i=oi.arrowDown:i=" ",o.push(this.renderOption(this.cursor,e[s],s,i));return`
|
|
137
137
|
`+o.join(`
|
|
138
|
-
`)}renderOptions(e){return this.done?"":this.paginateOptions(e)}renderDoneOrInstructions(){if(this.done)return this.value.filter(r=>r.selected).map(r=>r.title).join(", ");let e=[Zr.gray(this.hint),this.renderInstructions()];return this.value[this.cursor].disabled&&e.push(Zr.yellow(this.warn)),e.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(
|
|
138
|
+
`)}renderOptions(e){return this.done?"":this.paginateOptions(e)}renderDoneOrInstructions(){if(this.done)return this.value.filter(r=>r.selected).map(r=>r.title).join(", ");let e=[Zr.gray(this.hint),this.renderInstructions()];return this.value[this.cursor].disabled&&e.push(Zr.yellow(this.warn)),e.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(hZ.hide),super.render();let e=[OP.symbol(this.done,this.aborted),Zr.bold(this.msg),OP.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(e+=Zr.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),e+=this.renderOptions(this.value),this.out.write(this.clear+e),this.clear=FP(e,this.out.columns)}};AP.exports=m0});var $P=y((fde,RP)=>{"use strict";var al=We(),yZ=Cn(),{erase:DZ,cursor:kP}=Te(),{style:y0,clear:TP,figures:D0,wrap:vZ,entriesToDisplay:bZ}=Ar(),PP=(t,e)=>t[e]&&(t[e].value||t[e].title||t[e]),wZ=(t,e)=>t[e]&&(t[e].title||t[e].value||t[e]),_Z=(t,e)=>{let r=t.findIndex(n=>n.value===e||n.title===e);return r>-1?r:void 0},v0=class extends yZ{constructor(e={}){super(e),this.msg=e.message,this.suggest=e.suggest,this.choices=e.choices,this.initial=typeof e.initial=="number"?e.initial:_Z(e.choices,e.initial),this.select=this.initial||e.cursor||0,this.i18n={noMatches:e.noMatches||"no matches found"},this.fallback=e.fallback||this.initial,this.clearFirst=e.clearFirst||!1,this.suggestions=[],this.input="",this.limit=e.limit||10,this.cursor=0,this.transform=y0.render(e.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=TP("",this.out.columns),this.complete(this.render),this.render()}set fallback(e){this._fb=Number.isSafeInteger(parseInt(e))?parseInt(e):e}get fallback(){let e;return typeof this._fb=="number"?e=this.choices[this._fb]:typeof this._fb=="string"&&(e={title:this._fb}),e||this._fb||{title:this.i18n.noMatches}}moveSelect(e){this.select=e,this.suggestions.length>0?this.value=PP(this.suggestions,e):this.value=this.fallback.value,this.fire()}async complete(e){let r=this.completing=this.suggest(this.input,this.choices),n=await r;if(this.completing!==r)return;this.suggestions=n.map((o,s,a)=>({title:wZ(a,s),value:PP(a,s),description:o.description})),this.completing=!1;let i=Math.max(n.length-1,0);this.moveSelect(Math.min(i,this.select)),e&&e()}reset(){this.input="",this.complete(()=>{this.moveSelect(this.initial!==void 0?this.initial:0),this.render()}),this.render()}exit(){this.clearFirst&&this.input.length>0?this.reset():(this.done=this.exited=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
|
139
139
|
`),this.close())}abort(){this.done=this.aborted=!0,this.exited=!1,this.fire(),this.render(),this.out.write(`
|
|
140
140
|
`),this.close()}submit(){this.done=!0,this.aborted=this.exited=!1,this.fire(),this.render(),this.out.write(`
|
|
141
141
|
`),this.close()}_(e,r){let n=this.input.slice(0,this.cursor),i=this.input.slice(this.cursor);this.input=`${n}${e}${i}`,this.cursor=n.length+1,this.complete(this.render),this.render()}delete(){if(this.cursor===0)return this.bell();let e=this.input.slice(0,this.cursor-1),r=this.input.slice(this.cursor);this.input=`${e}${r}`,this.complete(this.render),this.cursor=this.cursor-1,this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();let e=this.input.slice(0,this.cursor),r=this.input.slice(this.cursor+1);this.input=`${e}${r}`,this.complete(this.render),this.render()}first(){this.moveSelect(0),this.render()}last(){this.moveSelect(this.suggestions.length-1),this.render()}up(){this.select===0?this.moveSelect(this.suggestions.length-1):this.moveSelect(this.select-1),this.render()}down(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render()}next(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render()}nextPage(){this.moveSelect(Math.min(this.select+this.limit,this.suggestions.length-1)),this.render()}prevPage(){this.moveSelect(Math.max(this.select-this.limit,0)),this.render()}left(){if(this.cursor<=0)return this.bell();this.cursor=this.cursor-1,this.render()}right(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();this.cursor=this.cursor+1,this.render()}renderOption(e,r,n,i){let o,s=n?D0.arrowUp:i?D0.arrowDown:" ",a=r?al.cyan().underline(e.title):e.title;return s=(r?al.cyan(D0.pointer)+" ":" ")+s,e.description&&(o=` - ${e.description}`,(s.length+a.length+o.length>=this.out.columns||e.description.split(/\r?\n/).length>1)&&(o=`
|
|
142
|
-
`+
|
|
142
|
+
`+vZ(e.description,{margin:3,width:this.out.columns}))),s+" "+a+al.gray(o||"")}render(){if(this.closed)return;this.firstRender?this.out.write(kP.hide):this.out.write(TP(this.outputText,this.out.columns)),super.render();let{startIndex:e,endIndex:r}=bZ(this.select,this.choices.length,this.limit);if(this.outputText=[y0.symbol(this.done,this.aborted,this.exited),al.bold(this.msg),y0.delimiter(this.completing),this.done&&this.suggestions[this.select]?this.suggestions[this.select].title:this.rendered=this.transform.render(this.input)].join(" "),!this.done){let n=this.suggestions.slice(e,r).map((i,o)=>this.renderOption(i,this.select===o+e,o===0&&e>0,o+e===r-1&&r<this.choices.length)).join(`
|
|
143
143
|
`);this.outputText+=`
|
|
144
|
-
`+(n||al.gray(this.fallback.title))}this.out.write(
|
|
144
|
+
`+(n||al.gray(this.fallback.title))}this.out.write(DZ.line+kP.to(0)+this.outputText)}};RP.exports=v0});var LP=y((dde,NP)=>{"use strict";var xn=We(),{cursor:EZ}=Te(),CZ=g0(),{clear:IP,style:jP,figures:Ws}=Ar(),b0=class extends CZ{constructor(e={}){e.overrideRender=!0,super(e),this.inputValue="",this.clear=IP("",this.out.columns),this.filteredOptions=this.value,this.render()}last(){this.cursor=this.filteredOptions.length-1,this.render()}next(){this.cursor=(this.cursor+1)%this.filteredOptions.length,this.render()}up(){this.cursor===0?this.cursor=this.filteredOptions.length-1:this.cursor--,this.render()}down(){this.cursor===this.filteredOptions.length-1?this.cursor=0:this.cursor++,this.render()}left(){this.filteredOptions[this.cursor].selected=!1,this.render()}right(){if(this.value.filter(e=>e.selected).length>=this.maxChoices)return this.bell();this.filteredOptions[this.cursor].selected=!0,this.render()}delete(){this.inputValue.length&&(this.inputValue=this.inputValue.substr(0,this.inputValue.length-1),this.updateFilteredOptions())}updateFilteredOptions(){let e=this.filteredOptions[this.cursor];this.filteredOptions=this.value.filter(n=>this.inputValue?!!(typeof n.title=="string"&&n.title.toLowerCase().includes(this.inputValue.toLowerCase())||typeof n.value=="string"&&n.value.toLowerCase().includes(this.inputValue.toLowerCase())):!0);let r=this.filteredOptions.findIndex(n=>n===e);this.cursor=r<0?0:r,this.render()}handleSpaceToggle(){let e=this.filteredOptions[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()}}handleInputChange(e){this.inputValue=this.inputValue+e,this.updateFilteredOptions()}_(e,r){e===" "?this.handleSpaceToggle():this.handleInputChange(e)}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
|
|
145
145
|
Instructions:
|
|
146
146
|
${Ws.arrowUp}/${Ws.arrowDown}: Highlight option
|
|
147
147
|
${Ws.arrowLeft}/${Ws.arrowRight}/[space]: Toggle selection
|
|
@@ -149,22 +149,22 @@ Instructions:
|
|
|
149
149
|
enter/return: Complete answer
|
|
150
150
|
`:""}renderCurrentInput(){return`
|
|
151
151
|
Filtered results for: ${this.inputValue?this.inputValue:xn.gray("Enter something to filter")}
|
|
152
|
-
`}renderOption(e,r,n){let i;return r.disabled?i=e===n?xn.gray().underline(r.title):xn.strikethrough().gray(r.title):i=e===n?xn.cyan().underline(r.title):r.title,(r.selected?xn.green(Ws.radioOn):Ws.radioOff)+" "+i}renderDoneOrInstructions(){if(this.done)return this.value.filter(r=>r.selected).map(r=>r.title).join(", ");let e=[xn.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&e.push(xn.yellow(this.warn)),e.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(
|
|
152
|
+
`}renderOption(e,r,n){let i;return r.disabled?i=e===n?xn.gray().underline(r.title):xn.strikethrough().gray(r.title):i=e===n?xn.cyan().underline(r.title):r.title,(r.selected?xn.green(Ws.radioOn):Ws.radioOff)+" "+i}renderDoneOrInstructions(){if(this.done)return this.value.filter(r=>r.selected).map(r=>r.title).join(", ");let e=[xn.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&e.push(xn.yellow(this.warn)),e.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(EZ.hide),super.render();let e=[jP.symbol(this.done,this.aborted),xn.bold(this.msg),jP.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(e+=xn.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=IP(e,this.out.columns)}};NP.exports=b0});var HP=y((hde,UP)=>{var BP=We(),SZ=Cn(),{style:qP,clear:xZ}=Ar(),{erase:FZ,cursor:MP}=Te(),w0=class extends SZ{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(`
|
|
153
153
|
`),this.close()}submit(){this.value=this.value||!1,this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
|
154
|
-
`),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(
|
|
155
|
-
Are you sure ${Ys.default.strong(e)} is installed?`);let n=(0,C0.dirname)(r),i=await(0,
|
|
154
|
+
`),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(MP.hide):this.out.write(xZ(this.outputText,this.out.columns)),super.render(),this.outputText=[qP.symbol(this.done,this.aborted),BP.bold(this.msg),qP.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:BP.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(FZ.line+MP.to(0)+this.outputText))}};UP.exports=w0});var zP=y((pde,VP)=>{"use strict";VP.exports={TextPrompt:UT(),SelectPrompt:GT(),TogglePrompt:JT(),DatePrompt:_P(),NumberPrompt:xP(),MultiselectPrompt:g0(),AutocompletePrompt:$P(),AutocompleteMultiselectPrompt:LP(),ConfirmPrompt:HP()}});var WP=y(GP=>{"use strict";var Gt=GP,OZ=zP(),jd=t=>t;function Qr(t,e,r={}){return new Promise((n,i)=>{let o=new OZ[t](e),s=r.onAbort||jd,a=r.onSubmit||jd,u=r.onExit||jd;o.on("state",e.onState||jd),o.on("submit",l=>n(a(l))),o.on("exit",l=>n(u(l))),o.on("abort",l=>i(s(l)))})}Gt.text=t=>Qr("TextPrompt",t);Gt.password=t=>(t.style="password",Gt.text(t));Gt.invisible=t=>(t.style="invisible",Gt.text(t));Gt.number=t=>Qr("NumberPrompt",t);Gt.date=t=>Qr("DatePrompt",t);Gt.confirm=t=>Qr("ConfirmPrompt",t);Gt.list=t=>{let e=t.separator||",";return Qr("TextPrompt",t,{onSubmit:r=>r.split(e).map(n=>n.trim())})};Gt.toggle=t=>Qr("TogglePrompt",t);Gt.select=t=>Qr("SelectPrompt",t);Gt.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})};Gt.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 AZ=(t,e)=>Promise.resolve(e.filter(r=>r.title.slice(0,t.length).toLowerCase()===t.toLowerCase()));Gt.autocomplete=t=>(t.suggest=t.suggest||AZ,t.choices=[].concat(t.choices||[]),Qr("AutocompletePrompt",t))});var JP=y((gde,YP)=>{"use strict";var _0=WP(),kZ=["suggest","format","onState","validate","onRender","type"],KP=()=>{};async function si(t=[],{onSubmit:e=KP,onCancel:r=KP}={}){let n={},i=si._override||{};t=[].concat(t);let o,s,a,u,l,c,f=async(h,d,m=!1)=>{if(!(!m&&h.validate&&h.validate(d)!==!0))return h.format?await h.format(d,n):d};for(s of t)if({name:u,type:l}=s,typeof l=="function"&&(l=await l(o,{...n},s),s.type=l),!!l){for(let h in s){if(kZ.includes(h))continue;let d=s[h];s[h]=typeof d=="function"?await d(o,{...n},c):d}if(c=s,typeof s.message!="string")throw new Error("prompt message is required");if({name:u,type:l}=s,_0[l]===void 0)throw new Error(`prompt type (${l}) 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=si._injected?TZ(si._injected,s.initial):await _0[l](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 TZ(t,e){let r=t.shift();if(r instanceof Error)throw r;return r===void 0?e:r}function PZ(t){si._injected=(si._injected||[]).concat(t)}function RZ(t){si._override=Object.assign({},t)}YP.exports=Object.assign(si,{prompt:si,prompts:_0,inject:PZ,override:RZ})});var Nd=y((yde,XP)=>{function $Z(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}XP.exports=$Z("8.6.0")?_T():JP()});var Ju=y(Wt=>{"use strict";Object.defineProperty(Wt,"__esModule",{value:!0});Wt.logSuccess=Wt.logPrompt=Wt.logger=Wt.output=void 0;var E0=(nr(),je(rr)),so=(hD(),je(dD)),ao=E0.__importDefault(Ls()),IZ=EA(),ZP={colors:ao.default,stream:process.argv.includes("--json")?process.stderr:process.stdout};Wt.output=(0,IZ.isInteractive)()?new so.TTYOutputStrategy(ZP):new so.StreamOutputStrategy(ZP);Wt.logger=(0,so.createDefaultLogger)({output:Wt.output,formatterOptions:{titleize:!1,tags:new Map([[so.LOGGER_LEVELS.DEBUG,ao.default.log.DEBUG("[debug]")],[so.LOGGER_LEVELS.INFO,ao.default.log.INFO("[info]")],[so.LOGGER_LEVELS.WARN,ao.default.log.WARN("[warn]")],[so.LOGGER_LEVELS.ERROR,ao.default.log.ERROR("[error]")]])}});async function jZ(t,e){let{wordWrap:r}=await Promise.resolve().then(()=>E0.__importStar((hD(),je(dD)))),{prompt:n}=await Promise.resolve().then(()=>E0.__importStar(Nd()));return Wt.logger.log({msg:`${ao.default.input("[?]")} ${r(t,{indentation:4})}`,logger:Wt.logger,format:!1}),n(e,{onCancel:()=>process.exit(1)})}Wt.logPrompt=jZ;function NZ(t){Wt.logger.msg(`${ao.default.success("[success]")} ${t}`)}Wt.logSuccess=NZ});var Ld=y(Ks=>{"use strict";Object.defineProperty(Ks,"__esModule",{value:!0});Ks.resolveNode=Ks.requireTS=void 0;var LZ=require("fs"),BZ=Ns(),qZ=require("path"),MZ=(t,e)=>{let r=(0,qZ.resolve)(e);delete require.cache[r],require.extensions[".ts"]=(i,o)=>{var s;let a=(0,BZ.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};Ks.requireTS=MZ;function UZ(t,...e){try{return require.resolve(e.join("/"),{paths:[t]})}catch{let n=[t,"node_modules",...e].join("/");return(0,LZ.existsSync)(n)?n:null}}Ks.resolveNode=UZ});var QP={};gi(QP,{default:()=>HZ});var HZ,e3=Ct(()=>{HZ={}});var t3=y(en=>{"use strict";Object.defineProperty(en,"__esModule",{value:!0});en.buildXmlElement=en.writeXML=en.parseXML=en.readXML=void 0;var VZ=(nr(),je(rr)),zZ=Ns(),ul=VZ.__importDefault((e3(),je(QP)));async function GZ(t){var e;try{let r=await(0,zZ.readFile)(t,{encoding:"utf-8"});try{return await ul.default.parseStringPromise(r)}catch(n){throw`Error parsing: ${t}, ${(e=n.stack)!==null&&e!==void 0?e:n}`}}catch{throw`Unable to read: ${t}`}}en.readXML=GZ;function WZ(t,e){let r=e!==void 0?new ul.default.Parser({...e}):new ul.default.Parser,n;return r.parseString(t,(i,o)=>{i||(n=o)}),n}en.parseXML=WZ;async function KZ(t){return new Promise(e=>{let n=new ul.default.Builder({headless:!0,explicitRoot:!1,rootName:"deleteme"}).buildObject(t);n=n.replace("<deleteme>","").replace("</deleteme>",""),e(n)})}en.writeXML=KZ;function YZ(t,e){return new ul.default.Builder({headless:!0,explicitRoot:!1,rootName:e}).buildObject(t)}en.buildXmlElement=YZ});var s3=y(Ee=>{"use strict";Object.defineProperty(Ee,"__esModule",{value:!0});Ee.getAllElements=Ee.getFilePath=Ee.getAssets=Ee.getJSModules=Ee.getPluginType=Ee.getPlatformElement=Ee.getPluginPlatform=Ee.printPlugins=Ee.fixName=Ee.getDependencies=Ee.resolvePlugin=Ee.getPlugins=Ee.getIncludedPluginPackages=void 0;var JZ=(nr(),je(rr)),XZ=Ns(),C0=require("path"),Ys=JZ.__importDefault(Ls()),ZZ=vd(),QZ=Ju(),r3=Ld(),eQ=t3();function n3(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}}Ee.getIncludedPluginPackages=n3;async function tQ(t,e){var r;let n=(r=n3(t,e))!==null&&r!==void 0?r:o3(t);return(await Promise.all(n.map(async o=>i3(t,o)))).filter(o=>!!o)}Ee.getPlugins=tQ;async function i3(t,e){try{let r=(0,r3.resolveNode)(t.app.rootDir,e,"package.json");r||(0,ZZ.fatal)(`Unable to find ${Ys.default.strong(`node_modules/${e}`)}.
|
|
155
|
+
Are you sure ${Ys.default.strong(e)} is installed?`);let n=(0,C0.dirname)(r),i=await(0,XZ.readJSON)(r);if(!i)return null;if(i.capacitor)return{id:e,name:S0(e),version:i.version,rootPath:n,repository:i.repository,manifest:i.capacitor};let o=(0,C0.join)(n,"plugin.xml"),s=await(0,eQ.readXML)(o);return{id:e,name:S0(e),version:i.version,rootPath:n,repository:i.repository,xml:s.plugin}}catch{}return null}Ee.resolvePlugin=i3;function o3(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:{})]}Ee.getDependencies=o3;function S0(t){return t=t.replace(/\//g,"_").replace(/-/g,"_").replace(/@/g,"").replace(/_\w/g,e=>e[1].toUpperCase()),t.charAt(0).toUpperCase()+t.slice(1)}Ee.fixName=S0;function rQ(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 ${Ys.default.strong(e)}:
|
|
156
156
|
`;break;case"incompatible":n=`Found ${t.length} incompatible Cordova plugin${i} for ${Ys.default.strong(e)}, skipped install:
|
|
157
157
|
`;break;case"capacitor":n=`Found ${t.length} Capacitor plugin${i} for ${Ys.default.strong(e)}:
|
|
158
158
|
`;break}n+=t.map(o=>`${o.id}${Ys.default.weak(`@${o.version}`)}`).join(`
|
|
159
|
-
`),ZZ.logger.info(n)}Ee.printPlugins=tQ;function x0(t,e){return t.xml.platform?t.xml.platform.filter(function(i){return i.$.name===e})[0]:[]}Ee.getPluginPlatform=x0;function rQ(t,e,r){let n=x0(t,e);if(n){let i=n[r];if(i)return i}return[]}Ee.getPlatformElement=rQ;function nQ(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}Ee.getPluginType=nQ;function iQ(t,e){return F0(t,e,"js-module")}Ee.getJSModules=iQ;function oQ(t,e){return F0(t,e,"asset")}Ee.getAssets=oQ;function sQ(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,t3.resolveNode)(t.app.rootDir,...n);if(!i)throw new Error(`Can't resolve module ${n[0]}`);return i}return(0,C0.join)(e.rootPath,r)}Ee.getFilePath=sQ;function F0(t,e,r){let n=[];t.xml[r]&&(n=n.concat(t.xml[r]));let i=x0(t,e);return i?.[r]&&(n=n.concat(i[r])),n}Ee.getAllElements=F0});var s3={};gi(s3,{default:()=>aQ});var aQ,a3=Ct(()=>{aQ={}});var Bd=y(ai=>{"use strict";Object.defineProperty(ai,"__esModule",{value:!0});ai.isInstalled=ai.getCommandOutput=ai.runCommand=void 0;var O0=(a3(),je(s3));async function u3(t,e,r={}){let n=new O0.Subprocess(t,e,r);try{return await n.output()}catch(i){throw i instanceof O0.SubprocessError?i.output?i.output:i.cause?`${i.message} ${i.cause.toString()}`:i.code?i.code:"Unknown error":i}}ai.runCommand=u3;async function uQ(t,e,r={}){try{return(await u3(t,e,r)).trim()}catch{return null}}ai.getCommandOutput=uQ;async function lQ(t){try{await(0,O0.which)(t)}catch{return!1}return!0}ai.isInstalled=lQ});var ll=y((bde,l3)=>{var cQ="2.0.0",fQ=Number.MAX_SAFE_INTEGER||9007199254740991,dQ=16,hQ=250,pQ=["major","premajor","minor","preminor","patch","prepatch","prerelease"];l3.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:dQ,MAX_SAFE_BUILD_LENGTH:hQ,MAX_SAFE_INTEGER:fQ,RELEASE_TYPES:pQ,SEMVER_SPEC_VERSION:cQ,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var cl=y((wde,c3)=>{var mQ=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{};c3.exports=mQ});var Js=y((tn,f3)=>{var{MAX_SAFE_COMPONENT_LENGTH:A0,MAX_SAFE_BUILD_LENGTH:gQ,MAX_LENGTH:yQ}=ll(),DQ=cl();tn=f3.exports={};var vQ=tn.re=[],bQ=tn.safeRe=[],z=tn.src=[],wQ=tn.safeSrc=[],G=tn.t={},_Q=0,k0="[a-zA-Z0-9-]",EQ=[["\\s",1],["\\d",yQ],[k0,gQ]],CQ=t=>{for(let[e,r]of EQ)t=t.split(`${e}*`).join(`${e}{0,${r}}`).split(`${e}+`).join(`${e}{1,${r}}`);return t},re=(t,e,r)=>{let n=CQ(e),i=_Q++;DQ(t,i,e),G[t]=i,z[i]=e,wQ[i]=n,vQ[i]=new RegExp(e,r?"g":void 0),bQ[i]=new RegExp(n,r?"g":void 0)};re("NUMERICIDENTIFIER","0|[1-9]\\d*");re("NUMERICIDENTIFIERLOOSE","\\d+");re("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${k0}*`);re("MAINVERSION",`(${z[G.NUMERICIDENTIFIER]})\\.(${z[G.NUMERICIDENTIFIER]})\\.(${z[G.NUMERICIDENTIFIER]})`);re("MAINVERSIONLOOSE",`(${z[G.NUMERICIDENTIFIERLOOSE]})\\.(${z[G.NUMERICIDENTIFIERLOOSE]})\\.(${z[G.NUMERICIDENTIFIERLOOSE]})`);re("PRERELEASEIDENTIFIER",`(?:${z[G.NUMERICIDENTIFIER]}|${z[G.NONNUMERICIDENTIFIER]})`);re("PRERELEASEIDENTIFIERLOOSE",`(?:${z[G.NUMERICIDENTIFIERLOOSE]}|${z[G.NONNUMERICIDENTIFIER]})`);re("PRERELEASE",`(?:-(${z[G.PRERELEASEIDENTIFIER]}(?:\\.${z[G.PRERELEASEIDENTIFIER]})*))`);re("PRERELEASELOOSE",`(?:-?(${z[G.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${z[G.PRERELEASEIDENTIFIERLOOSE]})*))`);re("BUILDIDENTIFIER",`${k0}+`);re("BUILD",`(?:\\+(${z[G.BUILDIDENTIFIER]}(?:\\.${z[G.BUILDIDENTIFIER]})*))`);re("FULLPLAIN",`v?${z[G.MAINVERSION]}${z[G.PRERELEASE]}?${z[G.BUILD]}?`);re("FULL",`^${z[G.FULLPLAIN]}$`);re("LOOSEPLAIN",`[v=\\s]*${z[G.MAINVERSIONLOOSE]}${z[G.PRERELEASELOOSE]}?${z[G.BUILD]}?`);re("LOOSE",`^${z[G.LOOSEPLAIN]}$`);re("GTLT","((?:<|>)?=?)");re("XRANGEIDENTIFIERLOOSE",`${z[G.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);re("XRANGEIDENTIFIER",`${z[G.NUMERICIDENTIFIER]}|x|X|\\*`);re("XRANGEPLAIN",`[v=\\s]*(${z[G.XRANGEIDENTIFIER]})(?:\\.(${z[G.XRANGEIDENTIFIER]})(?:\\.(${z[G.XRANGEIDENTIFIER]})(?:${z[G.PRERELEASE]})?${z[G.BUILD]}?)?)?`);re("XRANGEPLAINLOOSE",`[v=\\s]*(${z[G.XRANGEIDENTIFIERLOOSE]})(?:\\.(${z[G.XRANGEIDENTIFIERLOOSE]})(?:\\.(${z[G.XRANGEIDENTIFIERLOOSE]})(?:${z[G.PRERELEASELOOSE]})?${z[G.BUILD]}?)?)?`);re("XRANGE",`^${z[G.GTLT]}\\s*${z[G.XRANGEPLAIN]}$`);re("XRANGELOOSE",`^${z[G.GTLT]}\\s*${z[G.XRANGEPLAINLOOSE]}$`);re("COERCEPLAIN",`(^|[^\\d])(\\d{1,${A0}})(?:\\.(\\d{1,${A0}}))?(?:\\.(\\d{1,${A0}}))?`);re("COERCE",`${z[G.COERCEPLAIN]}(?:$|[^\\d])`);re("COERCEFULL",z[G.COERCEPLAIN]+`(?:${z[G.PRERELEASE]})?(?:${z[G.BUILD]})?(?:$|[^\\d])`);re("COERCERTL",z[G.COERCE],!0);re("COERCERTLFULL",z[G.COERCEFULL],!0);re("LONETILDE","(?:~>?)");re("TILDETRIM",`(\\s*)${z[G.LONETILDE]}\\s+`,!0);tn.tildeTrimReplace="$1~";re("TILDE",`^${z[G.LONETILDE]}${z[G.XRANGEPLAIN]}$`);re("TILDELOOSE",`^${z[G.LONETILDE]}${z[G.XRANGEPLAINLOOSE]}$`);re("LONECARET","(?:\\^)");re("CARETTRIM",`(\\s*)${z[G.LONECARET]}\\s+`,!0);tn.caretTrimReplace="$1^";re("CARET",`^${z[G.LONECARET]}${z[G.XRANGEPLAIN]}$`);re("CARETLOOSE",`^${z[G.LONECARET]}${z[G.XRANGEPLAINLOOSE]}$`);re("COMPARATORLOOSE",`^${z[G.GTLT]}\\s*(${z[G.LOOSEPLAIN]})$|^$`);re("COMPARATOR",`^${z[G.GTLT]}\\s*(${z[G.FULLPLAIN]})$|^$`);re("COMPARATORTRIM",`(\\s*)${z[G.GTLT]}\\s*(${z[G.LOOSEPLAIN]}|${z[G.XRANGEPLAIN]})`,!0);tn.comparatorTrimReplace="$1$2$3";re("HYPHENRANGE",`^\\s*(${z[G.XRANGEPLAIN]})\\s+-\\s+(${z[G.XRANGEPLAIN]})\\s*$`);re("HYPHENRANGELOOSE",`^\\s*(${z[G.XRANGEPLAINLOOSE]})\\s+-\\s+(${z[G.XRANGEPLAINLOOSE]})\\s*$`);re("STAR","(<|>)?=?\\s*\\*");re("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");re("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var qd=y((_de,d3)=>{var SQ=Object.freeze({loose:!0}),xQ=Object.freeze({}),FQ=t=>t?typeof t!="object"?SQ:t:xQ;d3.exports=FQ});var T0=y((Ede,m3)=>{var h3=/^[0-9]+$/,p3=(t,e)=>{let r=h3.test(t),n=h3.test(e);return r&&n&&(t=+t,e=+e),t===e?0:r&&!n?-1:n&&!r?1:t<e?-1:1},OQ=(t,e)=>p3(e,t);m3.exports={compareIdentifiers:p3,rcompareIdentifiers:OQ}});var Ft=y((Cde,v3)=>{var Md=cl(),{MAX_LENGTH:g3,MAX_SAFE_INTEGER:Ud}=ll(),{safeRe:y3,safeSrc:D3,t:Hd}=Js(),AQ=qd(),{compareIdentifiers:Xs}=T0(),P0=class t{constructor(e,r){if(r=AQ(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>g3)throw new TypeError(`version is longer than ${g3} characters`);Md("SemVer",e,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;let n=e.trim().match(r.loose?y3[Hd.LOOSE]:y3[Hd.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>Ud||this.major<0)throw new TypeError("Invalid major version");if(this.minor>Ud||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>Ud||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<Ud)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(Md("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)),Xs(this.major,e.major)||Xs(this.minor,e.minor)||Xs(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(Md("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 Xs(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(Md("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 Xs(n,i)}while(++r)}inc(e,r,n){if(e.startsWith("pre")){if(!r&&n===!1)throw new Error("invalid increment argument: identifier is empty");if(r){let i=new RegExp(`^${this.options.loose?D3[Hd.PRERELEASELOOSE]:D3[Hd.PRERELEASE]}$`),o=`-${r}`.match(i);if(!o||o[1]!==r)throw new Error(`invalid identifier: ${r}`)}}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"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;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(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]),Xs(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}};v3.exports=P0});var uo=y((Sde,w3)=>{var b3=Ft(),kQ=(t,e,r=!1)=>{if(t instanceof b3)return t;try{return new b3(t,e)}catch(n){if(!r)return null;throw n}};w3.exports=kQ});var E3=y((xde,_3)=>{var TQ=uo(),PQ=(t,e)=>{let r=TQ(t,e);return r?r.version:null};_3.exports=PQ});var S3=y((Fde,C3)=>{var RQ=uo(),$Q=(t,e)=>{let r=RQ(t.trim().replace(/^[=v]+/,""),e);return r?r.version:null};C3.exports=$Q});var O3=y((Ode,F3)=>{var x3=Ft(),IQ=(t,e,r,n,i)=>{typeof r=="string"&&(i=n,n=r,r=void 0);try{return new x3(t instanceof x3?t.version:t,r).inc(e,n,i).version}catch{return null}};F3.exports=IQ});var T3=y((Ade,k3)=>{var A3=uo(),jQ=(t,e)=>{let r=A3(t,null,!0),n=A3(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){if(!a.patch&&!a.minor)return"major";if(a.compareMain(s)===0)return a.minor&&!a.patch?"minor":"patch"}let c=u?"pre":"";return r.major!==n.major?c+"major":r.minor!==n.minor?c+"minor":r.patch!==n.patch?c+"patch":"prerelease"};k3.exports=jQ});var R3=y((kde,P3)=>{var NQ=Ft(),LQ=(t,e)=>new NQ(t,e).major;P3.exports=LQ});var I3=y((Tde,$3)=>{var BQ=Ft(),qQ=(t,e)=>new BQ(t,e).minor;$3.exports=qQ});var N3=y((Pde,j3)=>{var MQ=Ft(),UQ=(t,e)=>new MQ(t,e).patch;j3.exports=UQ});var B3=y((Rde,L3)=>{var HQ=uo(),VQ=(t,e)=>{let r=HQ(t,e);return r&&r.prerelease.length?r.prerelease:null};L3.exports=VQ});var yr=y(($de,M3)=>{var q3=Ft(),zQ=(t,e,r)=>new q3(t,r).compare(new q3(e,r));M3.exports=zQ});var H3=y((Ide,U3)=>{var GQ=yr(),WQ=(t,e,r)=>GQ(e,t,r);U3.exports=WQ});var z3=y((jde,V3)=>{var KQ=yr(),YQ=(t,e)=>KQ(t,e,!0);V3.exports=YQ});var Vd=y((Nde,W3)=>{var G3=Ft(),JQ=(t,e,r)=>{let n=new G3(t,r),i=new G3(e,r);return n.compare(i)||n.compareBuild(i)};W3.exports=JQ});var Y3=y((Lde,K3)=>{var XQ=Vd(),ZQ=(t,e)=>t.sort((r,n)=>XQ(r,n,e));K3.exports=ZQ});var X3=y((Bde,J3)=>{var QQ=Vd(),eee=(t,e)=>t.sort((r,n)=>QQ(n,r,e));J3.exports=eee});var fl=y((qde,Z3)=>{var tee=yr(),ree=(t,e,r)=>tee(t,e,r)>0;Z3.exports=ree});var zd=y((Mde,Q3)=>{var nee=yr(),iee=(t,e,r)=>nee(t,e,r)<0;Q3.exports=iee});var R0=y((Ude,eR)=>{var oee=yr(),see=(t,e,r)=>oee(t,e,r)===0;eR.exports=see});var $0=y((Hde,tR)=>{var aee=yr(),uee=(t,e,r)=>aee(t,e,r)!==0;tR.exports=uee});var Gd=y((Vde,rR)=>{var lee=yr(),cee=(t,e,r)=>lee(t,e,r)>=0;rR.exports=cee});var Wd=y((zde,nR)=>{var fee=yr(),dee=(t,e,r)=>fee(t,e,r)<=0;nR.exports=dee});var I0=y((Gde,iR)=>{var hee=R0(),pee=$0(),mee=fl(),gee=Gd(),yee=zd(),Dee=Wd(),vee=(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 hee(t,r,n);case"!=":return pee(t,r,n);case">":return mee(t,r,n);case">=":return gee(t,r,n);case"<":return yee(t,r,n);case"<=":return Dee(t,r,n);default:throw new TypeError(`Invalid operator: ${e}`)}};iR.exports=vee});var sR=y((Wde,oR)=>{var bee=Ft(),wee=uo(),{safeRe:Kd,t:Yd}=Js(),_ee=(t,e)=>{if(t instanceof bee)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?Kd[Yd.COERCEFULL]:Kd[Yd.COERCE]);else{let u=e.includePrerelease?Kd[Yd.COERCERTLFULL]:Kd[Yd.COERCERTL],l;for(;(l=u.exec(t))&&(!r||r.index+r[0].length!==t.length);)(!r||l.index+l[0].length!==r.index+r[0].length)&&(r=l),u.lastIndex=l.index+l[1].length+l[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 wee(`${n}.${i}.${o}${s}${a}`,e)};oR.exports=_ee});var uR=y((Kde,aR)=>{var j0=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}};aR.exports=j0});var Dr=y((Yde,dR)=>{var Eee=/\s+/g,N0=class t{constructor(e,r){if(r=See(r),e instanceof t)return e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease?e:new t(e.raw,r);if(e instanceof L0)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(Eee," "),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=>!cR(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&&Pee(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&&kee)|(this.options.loose&&Tee))+":"+e,i=lR.get(n);if(i)return i;let o=this.options.loose,s=o?Kt[It.HYPHENRANGELOOSE]:Kt[It.HYPHENRANGE];e=e.replace(s,Uee(this.options.includePrerelease)),$e("hyphen replace",e),e=e.replace(Kt[It.COMPARATORTRIM],Fee),$e("comparator trim",e),e=e.replace(Kt[It.TILDETRIM],Oee),$e("tilde trim",e),e=e.replace(Kt[It.CARETTRIM],Aee),$e("caret trim",e);let a=e.split(" ").map(f=>Ree(f,this.options)).join(" ").split(/\s+/).map(f=>Mee(f,this.options));o&&(a=a.filter(f=>($e("loose invalid filter",f,this.options),!!f.match(Kt[It.COMPARATORLOOSE])))),$e("range list",a);let u=new Map,l=a.map(f=>new L0(f,this.options));for(let f of l){if(cR(f))return[f];u.set(f.value,f)}u.size>1&&u.has("")&&u.delete("");let c=[...u.values()];return lR.set(n,c),c}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Range is required");return this.set.some(n=>fR(n,r)&&e.set.some(i=>fR(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 xee(e,this.options)}catch{return!1}for(let r=0;r<this.set.length;r++)if(Hee(this.set[r],e,this.options))return!0;return!1}};dR.exports=N0;var Cee=uR(),lR=new Cee,See=qd(),L0=dl(),$e=cl(),xee=Ft(),{safeRe:Kt,t:It,comparatorTrimReplace:Fee,tildeTrimReplace:Oee,caretTrimReplace:Aee}=Js(),{FLAG_INCLUDE_PRERELEASE:kee,FLAG_LOOSE:Tee}=ll(),cR=t=>t.value==="<0.0.0-0",Pee=t=>t.value==="",fR=(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},Ree=(t,e)=>($e("comp",t,e),t=jee(t,e),$e("caret",t),t=$ee(t,e),$e("tildes",t),t=Lee(t,e),$e("xrange",t),t=qee(t,e),$e("stars",t),t),jt=t=>!t||t.toLowerCase()==="x"||t==="*",$ee=(t,e)=>t.trim().split(/\s+/).map(r=>Iee(r,e)).join(" "),Iee=(t,e)=>{let r=e.loose?Kt[It.TILDELOOSE]:Kt[It.TILDE];return t.replace(r,(n,i,o,s,a)=>{$e("tilde",t,n,i,o,s,a);let u;return jt(i)?u="":jt(o)?u=`>=${i}.0.0 <${+i+1}.0.0-0`:jt(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})},jee=(t,e)=>t.trim().split(/\s+/).map(r=>Nee(r,e)).join(" "),Nee=(t,e)=>{$e("caret",t,e);let r=e.loose?Kt[It.CARETLOOSE]:Kt[It.CARET],n=e.includePrerelease?"-0":"";return t.replace(r,(i,o,s,a,u)=>{$e("caret",t,i,o,s,a,u);let l;return jt(o)?l="":jt(s)?l=`>=${o}.0.0${n} <${+o+1}.0.0-0`:jt(a)?o==="0"?l=`>=${o}.${s}.0${n} <${o}.${+s+1}.0-0`:l=`>=${o}.${s}.0${n} <${+o+1}.0.0-0`:u?($e("replaceCaret pr",u),o==="0"?s==="0"?l=`>=${o}.${s}.${a}-${u} <${o}.${s}.${+a+1}-0`:l=`>=${o}.${s}.${a}-${u} <${o}.${+s+1}.0-0`:l=`>=${o}.${s}.${a}-${u} <${+o+1}.0.0-0`):($e("no pr"),o==="0"?s==="0"?l=`>=${o}.${s}.${a}${n} <${o}.${s}.${+a+1}-0`:l=`>=${o}.${s}.${a}${n} <${o}.${+s+1}.0-0`:l=`>=${o}.${s}.${a} <${+o+1}.0.0-0`),$e("caret return",l),l})},Lee=(t,e)=>($e("replaceXRanges",t,e),t.split(/\s+/).map(r=>Bee(r,e)).join(" ")),Bee=(t,e)=>{t=t.trim();let r=e.loose?Kt[It.XRANGELOOSE]:Kt[It.XRANGE];return t.replace(r,(n,i,o,s,a,u)=>{$e("xRange",t,n,i,o,s,a,u);let l=jt(o),c=l||jt(s),f=c||jt(a),h=f;return i==="="&&h&&(i=""),u=e.includePrerelease?"-0":"",l?i===">"||i==="<"?n="<0.0.0-0":n="*":i&&h?(c&&(s=0),a=0,i===">"?(i=">=",c?(o=+o+1,s=0,a=0):(s=+s+1,a=0)):i==="<="&&(i="<",c?o=+o+1:s=+s+1),i==="<"&&(u="-0"),n=`${i+o}.${s}.${a}${u}`):c?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})},qee=(t,e)=>($e("replaceStars",t,e),t.trim().replace(Kt[It.STAR],"")),Mee=(t,e)=>($e("replaceGTE0",t,e),t.trim().replace(Kt[e.includePrerelease?It.GTE0PRE:It.GTE0],"")),Uee=t=>(e,r,n,i,o,s,a,u,l,c,f,h)=>(jt(n)?r="":jt(i)?r=`>=${n}.0.0${t?"-0":""}`:jt(o)?r=`>=${n}.${i}.0${t?"-0":""}`:s?r=`>=${r}`:r=`>=${r}${t?"-0":""}`,jt(l)?u="":jt(c)?u=`<${+l+1}.0.0-0`:jt(f)?u=`<${l}.${+c+1}.0-0`:h?u=`<=${l}.${c}.${f}-${h}`:t?u=`<${l}.${c}.${+f+1}-0`:u=`<=${u}`,`${r} ${u}`.trim()),Hee=(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!==L0.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 dl=y((Jde,DR)=>{var hl=Symbol("SemVer ANY"),M0=class t{static get ANY(){return hl}constructor(e,r){if(r=hR(r),e instanceof t){if(e.loose===!!r.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),q0("comparator",e,r),this.options=r,this.loose=!!r.loose,this.parse(e),this.semver===hl?this.value="":this.value=this.operator+this.semver.version,q0("comp",this)}parse(e){let r=this.options.loose?pR[mR.COMPARATORLOOSE]:pR[mR.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 gR(n[2],this.options.loose):this.semver=hl}toString(){return this.value}test(e){if(q0("Comparator.test",e,this.options.loose),this.semver===hl||e===hl)return!0;if(typeof e=="string")try{e=new gR(e,this.options)}catch{return!1}return B0(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 yR(e.value,r).test(this.value):e.operator===""?e.value===""?!0:new yR(this.value,r).test(e.semver):(r=hR(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("=")||B0(this.semver,"<",e.semver,r)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||B0(this.semver,">",e.semver,r)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}};DR.exports=M0;var hR=qd(),{safeRe:pR,t:mR}=Js(),B0=I0(),q0=cl(),gR=Ft(),yR=Dr()});var pl=y((Xde,vR)=>{var Vee=Dr(),zee=(t,e,r)=>{try{e=new Vee(e,r)}catch{return!1}return e.test(t)};vR.exports=zee});var wR=y((Zde,bR)=>{var Gee=Dr(),Wee=(t,e)=>new Gee(t,e).set.map(r=>r.map(n=>n.value).join(" ").trim().split(" "));bR.exports=Wee});var ER=y((Qde,_R)=>{var Kee=Ft(),Yee=Dr(),Jee=(t,e,r)=>{let n=null,i=null,o=null;try{o=new Yee(e,r)}catch{return null}return t.forEach(s=>{o.test(s)&&(!n||i.compare(s)===-1)&&(n=s,i=new Kee(n,r))}),n};_R.exports=Jee});var SR=y((ehe,CR)=>{var Xee=Ft(),Zee=Dr(),Qee=(t,e,r)=>{let n=null,i=null,o=null;try{o=new Zee(e,r)}catch{return null}return t.forEach(s=>{o.test(s)&&(!n||i.compare(s)===1)&&(n=s,i=new Xee(n,r))}),n};CR.exports=Qee});var OR=y((the,FR)=>{var U0=Ft(),ete=Dr(),xR=fl(),tte=(t,e)=>{t=new ete(t,e);let r=new U0("0.0.0");if(t.test(r)||(r=new U0("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 U0(s.semver.version);switch(s.operator){case">":a.prerelease.length===0?a.patch++:a.prerelease.push(0),a.raw=a.format();case"":case">=":(!o||xR(a,o))&&(o=a);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${s.operator}`)}}),o&&(!r||xR(r,o))&&(r=o)}return r&&t.test(r)?r:null};FR.exports=tte});var kR=y((rhe,AR)=>{var rte=Dr(),nte=(t,e)=>{try{return new rte(t,e).range||"*"}catch{return null}};AR.exports=nte});var Jd=y((nhe,$R)=>{var ite=Ft(),RR=dl(),{ANY:ote}=RR,ste=Dr(),ate=pl(),TR=fl(),PR=zd(),ute=Wd(),lte=Gd(),cte=(t,e,r,n)=>{t=new ite(t,n),e=new ste(e,n);let i,o,s,a,u;switch(r){case">":i=TR,o=ute,s=PR,a=">",u=">=";break;case"<":i=PR,o=lte,s=TR,a="<",u="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(ate(t,e,n))return!1;for(let l=0;l<e.set.length;++l){let c=e.set[l],f=null,h=null;if(c.forEach(d=>{d.semver===ote&&(d=new RR(">=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};$R.exports=cte});var jR=y((ihe,IR)=>{var fte=Jd(),dte=(t,e,r)=>fte(t,e,">",r);IR.exports=dte});var LR=y((ohe,NR)=>{var hte=Jd(),pte=(t,e,r)=>hte(t,e,"<",r);NR.exports=pte});var MR=y((she,qR)=>{var BR=Dr(),mte=(t,e,r)=>(t=new BR(t,r),e=new BR(e,r),t.intersects(e,r));qR.exports=mte});var HR=y((ahe,UR)=>{var gte=pl(),yte=yr();UR.exports=(t,e,r)=>{let n=[],i=null,o=null,s=t.sort((c,f)=>yte(c,f,r));for(let c of s)gte(c,e,r)?(o=c,i||(i=c)):(o&&n.push([i,o]),o=null,i=null);i&&n.push([i,null]);let a=[];for(let[c,f]of n)c===f?a.push(c):!f&&c===s[0]?a.push("*"):f?c===s[0]?a.push(`<=${f}`):a.push(`${c} - ${f}`):a.push(`>=${c}`);let u=a.join(" || "),l=typeof e.raw=="string"?e.raw:String(e);return u.length<l.length?u:e}});var G0=y((uhe,KR)=>{var VR=Dr(),V0=dl(),{ANY:H0}=V0,ml=pl(),z0=yr(),Dte=(t,e,r={})=>{if(t===e)return!0;t=new VR(t,r),e=new VR(e,r);let n=!1;e:for(let i of t.set){for(let o of e.set){let s=bte(i,o,r);if(n=n||s!==null,s)continue e}if(n)return!1}return!0},vte=[new V0(">=0.0.0-0")],zR=[new V0(">=0.0.0")],bte=(t,e,r)=>{if(t===e)return!0;if(t.length===1&&t[0].semver===H0){if(e.length===1&&e[0].semver===H0)return!0;r.includePrerelease?t=vte:t=zR}if(e.length===1&&e[0].semver===H0){if(r.includePrerelease)return!0;e=zR}let n=new Set,i,o;for(let d of t)d.operator===">"||d.operator===">="?i=GR(i,d,r):d.operator==="<"||d.operator==="<="?o=WR(o,d,r):n.add(d.semver);if(n.size>1)return null;let s;if(i&&o){if(s=z0(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&&!ml(d,String(i),r)||o&&!ml(d,String(o),r))return null;for(let m of e)if(!ml(d,String(m),r))return!1;return!0}let a,u,l,c,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(c=c||d.operator===">"||d.operator===">=",l=l||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=GR(i,d,r),a===d&&a!==i)return!1}else if(i.operator===">="&&!ml(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=WR(o,d,r),u===d&&u!==o)return!1}else if(o.operator==="<="&&!ml(o.semver,String(d),r))return!1}if(!d.operator&&(o||i)&&s!==0)return!1}return!(i&&l&&!o&&s!==0||o&&c&&!i&&s!==0||h||f)},GR=(t,e,r)=>{if(!t)return e;let n=z0(t.semver,e.semver,r);return n>0?t:n<0||e.operator===">"&&t.operator===">="?e:t},WR=(t,e,r)=>{if(!t)return e;let n=z0(t.semver,e.semver,r);return n<0?t:n>0||e.operator==="<"&&t.operator==="<="?e:t};KR.exports=Dte});var K0=y((lhe,XR)=>{var W0=Js(),YR=ll(),wte=Ft(),JR=T0(),_te=uo(),Ete=E3(),Cte=S3(),Ste=O3(),xte=T3(),Fte=R3(),Ote=I3(),Ate=N3(),kte=B3(),Tte=yr(),Pte=H3(),Rte=z3(),$te=Vd(),Ite=Y3(),jte=X3(),Nte=fl(),Lte=zd(),Bte=R0(),qte=$0(),Mte=Gd(),Ute=Wd(),Hte=I0(),Vte=sR(),zte=dl(),Gte=Dr(),Wte=pl(),Kte=wR(),Yte=ER(),Jte=SR(),Xte=OR(),Zte=kR(),Qte=Jd(),ere=jR(),tre=LR(),rre=MR(),nre=HR(),ire=G0();XR.exports={parse:_te,valid:Ete,clean:Cte,inc:Ste,diff:xte,major:Fte,minor:Ote,patch:Ate,prerelease:kte,compare:Tte,rcompare:Pte,compareLoose:Rte,compareBuild:$te,sort:Ite,rsort:jte,gt:Nte,lt:Lte,eq:Bte,neq:qte,gte:Mte,lte:Ute,cmp:Hte,coerce:Vte,Comparator:zte,Range:Gte,satisfies:Wte,toComparators:Kte,maxSatisfying:Yte,minSatisfying:Jte,minVersion:Xte,validRange:Zte,outside:Qte,gtr:ere,ltr:tre,intersects:rre,simplifyRange:nre,subset:ire,SemVer:wte,re:W0.re,src:W0.src,tokens:W0.t,SEMVER_SPEC_VERSION:YR.SEMVER_SPEC_VERSION,RELEASE_TYPES:YR.RELEASE_TYPES,compareIdentifiers:JR.compareIdentifiers,rcompareIdentifiers:JR.rcompareIdentifiers}});var l$=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 yl=(nr(),je(rr)),ZR=lD(),ui=Ns(),lo=require("path"),Ce=yl.__importDefault(Ls()),Zs=vd(),e$=Ju(),ore=o3(),QR=ic(),gl=Ld(),sre=Bd();async function are(t){let r=(await Promise.all(t.map(n=>n()))).filter(n=>n!=null);if(r.length>0)throw r.join(`
|
|
160
|
-
`)}W.check=
|
|
161
|
-
It will be the entry point for the web portion of the Capacitor app.`:`Could not find the web assets directory: ${Ce.default.strong((0,
|
|
162
|
-
Please create it and make sure it has an ${Ce.default.strong("index.html")} file. You can change the path of this directory in ${Ce.default.strong(t.app.extConfigName)} (${Ce.default.input("webDir")} option). You may need to compile the web assets for your app (typically ${Ce.default.input("npm run build")}). More info: ${Ce.default.strong("https://capacitorjs.com/docs/basics/workflow#sync-your-project")}`}W.checkWebDir=
|
|
159
|
+
`),QZ.logger.info(n)}Ee.printPlugins=rQ;function x0(t,e){return t.xml.platform?t.xml.platform.filter(function(i){return i.$.name===e})[0]:[]}Ee.getPluginPlatform=x0;function nQ(t,e,r){let n=x0(t,e);if(n){let i=n[r];if(i)return i}return[]}Ee.getPlatformElement=nQ;function iQ(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}Ee.getPluginType=iQ;function oQ(t,e){return F0(t,e,"js-module")}Ee.getJSModules=oQ;function sQ(t,e){return F0(t,e,"asset")}Ee.getAssets=sQ;function aQ(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,r3.resolveNode)(t.app.rootDir,...n);if(!i)throw new Error(`Can't resolve module ${n[0]}`);return i}return(0,C0.join)(e.rootPath,r)}Ee.getFilePath=aQ;function F0(t,e,r){let n=[];t.xml[r]&&(n=n.concat(t.xml[r]));let i=x0(t,e);return i?.[r]&&(n=n.concat(i[r])),n}Ee.getAllElements=F0});var a3={};gi(a3,{default:()=>uQ});var uQ,u3=Ct(()=>{uQ={}});var Bd=y(ai=>{"use strict";Object.defineProperty(ai,"__esModule",{value:!0});ai.isInstalled=ai.getCommandOutput=ai.runCommand=void 0;var O0=(u3(),je(a3));async function l3(t,e,r={}){let n=new O0.Subprocess(t,e,r);try{return await n.output()}catch(i){throw i instanceof O0.SubprocessError?i.output?i.output:i.cause?`${i.message} ${i.cause.toString()}`:i.code?i.code:"Unknown error":i}}ai.runCommand=l3;async function lQ(t,e,r={}){try{return(await l3(t,e,r)).trim()}catch{return null}}ai.getCommandOutput=lQ;async function cQ(t){try{await(0,O0.which)(t)}catch{return!1}return!0}ai.isInstalled=cQ});var ll=y((Ede,c3)=>{var fQ="2.0.0",dQ=Number.MAX_SAFE_INTEGER||9007199254740991,hQ=16,pQ=250,mQ=["major","premajor","minor","preminor","patch","prepatch","prerelease"];c3.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:hQ,MAX_SAFE_BUILD_LENGTH:pQ,MAX_SAFE_INTEGER:dQ,RELEASE_TYPES:mQ,SEMVER_SPEC_VERSION:fQ,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var cl=y((Cde,f3)=>{var gQ=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{};f3.exports=gQ});var Js=y((tn,d3)=>{var{MAX_SAFE_COMPONENT_LENGTH:A0,MAX_SAFE_BUILD_LENGTH:yQ,MAX_LENGTH:DQ}=ll(),vQ=cl();tn=d3.exports={};var bQ=tn.re=[],wQ=tn.safeRe=[],z=tn.src=[],_Q=tn.safeSrc=[],G=tn.t={},EQ=0,k0="[a-zA-Z0-9-]",CQ=[["\\s",1],["\\d",DQ],[k0,yQ]],SQ=t=>{for(let[e,r]of CQ)t=t.split(`${e}*`).join(`${e}{0,${r}}`).split(`${e}+`).join(`${e}{1,${r}}`);return t},re=(t,e,r)=>{let n=SQ(e),i=EQ++;vQ(t,i,e),G[t]=i,z[i]=e,_Q[i]=n,bQ[i]=new RegExp(e,r?"g":void 0),wQ[i]=new RegExp(n,r?"g":void 0)};re("NUMERICIDENTIFIER","0|[1-9]\\d*");re("NUMERICIDENTIFIERLOOSE","\\d+");re("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${k0}*`);re("MAINVERSION",`(${z[G.NUMERICIDENTIFIER]})\\.(${z[G.NUMERICIDENTIFIER]})\\.(${z[G.NUMERICIDENTIFIER]})`);re("MAINVERSIONLOOSE",`(${z[G.NUMERICIDENTIFIERLOOSE]})\\.(${z[G.NUMERICIDENTIFIERLOOSE]})\\.(${z[G.NUMERICIDENTIFIERLOOSE]})`);re("PRERELEASEIDENTIFIER",`(?:${z[G.NUMERICIDENTIFIER]}|${z[G.NONNUMERICIDENTIFIER]})`);re("PRERELEASEIDENTIFIERLOOSE",`(?:${z[G.NUMERICIDENTIFIERLOOSE]}|${z[G.NONNUMERICIDENTIFIER]})`);re("PRERELEASE",`(?:-(${z[G.PRERELEASEIDENTIFIER]}(?:\\.${z[G.PRERELEASEIDENTIFIER]})*))`);re("PRERELEASELOOSE",`(?:-?(${z[G.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${z[G.PRERELEASEIDENTIFIERLOOSE]})*))`);re("BUILDIDENTIFIER",`${k0}+`);re("BUILD",`(?:\\+(${z[G.BUILDIDENTIFIER]}(?:\\.${z[G.BUILDIDENTIFIER]})*))`);re("FULLPLAIN",`v?${z[G.MAINVERSION]}${z[G.PRERELEASE]}?${z[G.BUILD]}?`);re("FULL",`^${z[G.FULLPLAIN]}$`);re("LOOSEPLAIN",`[v=\\s]*${z[G.MAINVERSIONLOOSE]}${z[G.PRERELEASELOOSE]}?${z[G.BUILD]}?`);re("LOOSE",`^${z[G.LOOSEPLAIN]}$`);re("GTLT","((?:<|>)?=?)");re("XRANGEIDENTIFIERLOOSE",`${z[G.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);re("XRANGEIDENTIFIER",`${z[G.NUMERICIDENTIFIER]}|x|X|\\*`);re("XRANGEPLAIN",`[v=\\s]*(${z[G.XRANGEIDENTIFIER]})(?:\\.(${z[G.XRANGEIDENTIFIER]})(?:\\.(${z[G.XRANGEIDENTIFIER]})(?:${z[G.PRERELEASE]})?${z[G.BUILD]}?)?)?`);re("XRANGEPLAINLOOSE",`[v=\\s]*(${z[G.XRANGEIDENTIFIERLOOSE]})(?:\\.(${z[G.XRANGEIDENTIFIERLOOSE]})(?:\\.(${z[G.XRANGEIDENTIFIERLOOSE]})(?:${z[G.PRERELEASELOOSE]})?${z[G.BUILD]}?)?)?`);re("XRANGE",`^${z[G.GTLT]}\\s*${z[G.XRANGEPLAIN]}$`);re("XRANGELOOSE",`^${z[G.GTLT]}\\s*${z[G.XRANGEPLAINLOOSE]}$`);re("COERCEPLAIN",`(^|[^\\d])(\\d{1,${A0}})(?:\\.(\\d{1,${A0}}))?(?:\\.(\\d{1,${A0}}))?`);re("COERCE",`${z[G.COERCEPLAIN]}(?:$|[^\\d])`);re("COERCEFULL",z[G.COERCEPLAIN]+`(?:${z[G.PRERELEASE]})?(?:${z[G.BUILD]})?(?:$|[^\\d])`);re("COERCERTL",z[G.COERCE],!0);re("COERCERTLFULL",z[G.COERCEFULL],!0);re("LONETILDE","(?:~>?)");re("TILDETRIM",`(\\s*)${z[G.LONETILDE]}\\s+`,!0);tn.tildeTrimReplace="$1~";re("TILDE",`^${z[G.LONETILDE]}${z[G.XRANGEPLAIN]}$`);re("TILDELOOSE",`^${z[G.LONETILDE]}${z[G.XRANGEPLAINLOOSE]}$`);re("LONECARET","(?:\\^)");re("CARETTRIM",`(\\s*)${z[G.LONECARET]}\\s+`,!0);tn.caretTrimReplace="$1^";re("CARET",`^${z[G.LONECARET]}${z[G.XRANGEPLAIN]}$`);re("CARETLOOSE",`^${z[G.LONECARET]}${z[G.XRANGEPLAINLOOSE]}$`);re("COMPARATORLOOSE",`^${z[G.GTLT]}\\s*(${z[G.LOOSEPLAIN]})$|^$`);re("COMPARATOR",`^${z[G.GTLT]}\\s*(${z[G.FULLPLAIN]})$|^$`);re("COMPARATORTRIM",`(\\s*)${z[G.GTLT]}\\s*(${z[G.LOOSEPLAIN]}|${z[G.XRANGEPLAIN]})`,!0);tn.comparatorTrimReplace="$1$2$3";re("HYPHENRANGE",`^\\s*(${z[G.XRANGEPLAIN]})\\s+-\\s+(${z[G.XRANGEPLAIN]})\\s*$`);re("HYPHENRANGELOOSE",`^\\s*(${z[G.XRANGEPLAINLOOSE]})\\s+-\\s+(${z[G.XRANGEPLAINLOOSE]})\\s*$`);re("STAR","(<|>)?=?\\s*\\*");re("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");re("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var qd=y((Sde,h3)=>{var xQ=Object.freeze({loose:!0}),FQ=Object.freeze({}),OQ=t=>t?typeof t!="object"?xQ:t:FQ;h3.exports=OQ});var T0=y((xde,g3)=>{var p3=/^[0-9]+$/,m3=(t,e)=>{let r=p3.test(t),n=p3.test(e);return r&&n&&(t=+t,e=+e),t===e?0:r&&!n?-1:n&&!r?1:t<e?-1:1},AQ=(t,e)=>m3(e,t);g3.exports={compareIdentifiers:m3,rcompareIdentifiers:AQ}});var Ft=y((Fde,b3)=>{var Md=cl(),{MAX_LENGTH:y3,MAX_SAFE_INTEGER:Ud}=ll(),{safeRe:D3,safeSrc:v3,t:Hd}=Js(),kQ=qd(),{compareIdentifiers:Xs}=T0(),P0=class t{constructor(e,r){if(r=kQ(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>y3)throw new TypeError(`version is longer than ${y3} characters`);Md("SemVer",e,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;let n=e.trim().match(r.loose?D3[Hd.LOOSE]:D3[Hd.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>Ud||this.major<0)throw new TypeError("Invalid major version");if(this.minor>Ud||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>Ud||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<Ud)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(Md("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)),Xs(this.major,e.major)||Xs(this.minor,e.minor)||Xs(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(Md("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 Xs(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(Md("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 Xs(n,i)}while(++r)}inc(e,r,n){if(e.startsWith("pre")){if(!r&&n===!1)throw new Error("invalid increment argument: identifier is empty");if(r){let i=new RegExp(`^${this.options.loose?v3[Hd.PRERELEASELOOSE]:v3[Hd.PRERELEASE]}$`),o=`-${r}`.match(i);if(!o||o[1]!==r)throw new Error(`invalid identifier: ${r}`)}}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"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;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(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]),Xs(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}};b3.exports=P0});var uo=y((Ode,_3)=>{var w3=Ft(),TQ=(t,e,r=!1)=>{if(t instanceof w3)return t;try{return new w3(t,e)}catch(n){if(!r)return null;throw n}};_3.exports=TQ});var C3=y((Ade,E3)=>{var PQ=uo(),RQ=(t,e)=>{let r=PQ(t,e);return r?r.version:null};E3.exports=RQ});var x3=y((kde,S3)=>{var $Q=uo(),IQ=(t,e)=>{let r=$Q(t.trim().replace(/^[=v]+/,""),e);return r?r.version:null};S3.exports=IQ});var A3=y((Tde,O3)=>{var F3=Ft(),jQ=(t,e,r,n,i)=>{typeof r=="string"&&(i=n,n=r,r=void 0);try{return new F3(t instanceof F3?t.version:t,r).inc(e,n,i).version}catch{return null}};O3.exports=jQ});var P3=y((Pde,T3)=>{var k3=uo(),NQ=(t,e)=>{let r=k3(t,null,!0),n=k3(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){if(!a.patch&&!a.minor)return"major";if(a.compareMain(s)===0)return a.minor&&!a.patch?"minor":"patch"}let c=u?"pre":"";return r.major!==n.major?c+"major":r.minor!==n.minor?c+"minor":r.patch!==n.patch?c+"patch":"prerelease"};T3.exports=NQ});var $3=y((Rde,R3)=>{var LQ=Ft(),BQ=(t,e)=>new LQ(t,e).major;R3.exports=BQ});var j3=y(($de,I3)=>{var qQ=Ft(),MQ=(t,e)=>new qQ(t,e).minor;I3.exports=MQ});var L3=y((Ide,N3)=>{var UQ=Ft(),HQ=(t,e)=>new UQ(t,e).patch;N3.exports=HQ});var q3=y((jde,B3)=>{var VQ=uo(),zQ=(t,e)=>{let r=VQ(t,e);return r&&r.prerelease.length?r.prerelease:null};B3.exports=zQ});var yr=y((Nde,U3)=>{var M3=Ft(),GQ=(t,e,r)=>new M3(t,r).compare(new M3(e,r));U3.exports=GQ});var V3=y((Lde,H3)=>{var WQ=yr(),KQ=(t,e,r)=>WQ(e,t,r);H3.exports=KQ});var G3=y((Bde,z3)=>{var YQ=yr(),JQ=(t,e)=>YQ(t,e,!0);z3.exports=JQ});var Vd=y((qde,K3)=>{var W3=Ft(),XQ=(t,e,r)=>{let n=new W3(t,r),i=new W3(e,r);return n.compare(i)||n.compareBuild(i)};K3.exports=XQ});var J3=y((Mde,Y3)=>{var ZQ=Vd(),QQ=(t,e)=>t.sort((r,n)=>ZQ(r,n,e));Y3.exports=QQ});var Z3=y((Ude,X3)=>{var eee=Vd(),tee=(t,e)=>t.sort((r,n)=>eee(n,r,e));X3.exports=tee});var fl=y((Hde,Q3)=>{var ree=yr(),nee=(t,e,r)=>ree(t,e,r)>0;Q3.exports=nee});var zd=y((Vde,eR)=>{var iee=yr(),oee=(t,e,r)=>iee(t,e,r)<0;eR.exports=oee});var R0=y((zde,tR)=>{var see=yr(),aee=(t,e,r)=>see(t,e,r)===0;tR.exports=aee});var $0=y((Gde,rR)=>{var uee=yr(),lee=(t,e,r)=>uee(t,e,r)!==0;rR.exports=lee});var Gd=y((Wde,nR)=>{var cee=yr(),fee=(t,e,r)=>cee(t,e,r)>=0;nR.exports=fee});var Wd=y((Kde,iR)=>{var dee=yr(),hee=(t,e,r)=>dee(t,e,r)<=0;iR.exports=hee});var I0=y((Yde,oR)=>{var pee=R0(),mee=$0(),gee=fl(),yee=Gd(),Dee=zd(),vee=Wd(),bee=(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 pee(t,r,n);case"!=":return mee(t,r,n);case">":return gee(t,r,n);case">=":return yee(t,r,n);case"<":return Dee(t,r,n);case"<=":return vee(t,r,n);default:throw new TypeError(`Invalid operator: ${e}`)}};oR.exports=bee});var aR=y((Jde,sR)=>{var wee=Ft(),_ee=uo(),{safeRe:Kd,t:Yd}=Js(),Eee=(t,e)=>{if(t instanceof wee)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?Kd[Yd.COERCEFULL]:Kd[Yd.COERCE]);else{let u=e.includePrerelease?Kd[Yd.COERCERTLFULL]:Kd[Yd.COERCERTL],l;for(;(l=u.exec(t))&&(!r||r.index+r[0].length!==t.length);)(!r||l.index+l[0].length!==r.index+r[0].length)&&(r=l),u.lastIndex=l.index+l[1].length+l[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 _ee(`${n}.${i}.${o}${s}${a}`,e)};sR.exports=Eee});var lR=y((Xde,uR)=>{var j0=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}};uR.exports=j0});var Dr=y((Zde,hR)=>{var Cee=/\s+/g,N0=class t{constructor(e,r){if(r=xee(r),e instanceof t)return e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease?e:new t(e.raw,r);if(e instanceof L0)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(Cee," "),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=>!fR(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&&Ree(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&&Tee)|(this.options.loose&&Pee))+":"+e,i=cR.get(n);if(i)return i;let o=this.options.loose,s=o?Kt[It.HYPHENRANGELOOSE]:Kt[It.HYPHENRANGE];e=e.replace(s,Hee(this.options.includePrerelease)),$e("hyphen replace",e),e=e.replace(Kt[It.COMPARATORTRIM],Oee),$e("comparator trim",e),e=e.replace(Kt[It.TILDETRIM],Aee),$e("tilde trim",e),e=e.replace(Kt[It.CARETTRIM],kee),$e("caret trim",e);let a=e.split(" ").map(f=>$ee(f,this.options)).join(" ").split(/\s+/).map(f=>Uee(f,this.options));o&&(a=a.filter(f=>($e("loose invalid filter",f,this.options),!!f.match(Kt[It.COMPARATORLOOSE])))),$e("range list",a);let u=new Map,l=a.map(f=>new L0(f,this.options));for(let f of l){if(fR(f))return[f];u.set(f.value,f)}u.size>1&&u.has("")&&u.delete("");let c=[...u.values()];return cR.set(n,c),c}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Range is required");return this.set.some(n=>dR(n,r)&&e.set.some(i=>dR(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 Fee(e,this.options)}catch{return!1}for(let r=0;r<this.set.length;r++)if(Vee(this.set[r],e,this.options))return!0;return!1}};hR.exports=N0;var See=lR(),cR=new See,xee=qd(),L0=dl(),$e=cl(),Fee=Ft(),{safeRe:Kt,t:It,comparatorTrimReplace:Oee,tildeTrimReplace:Aee,caretTrimReplace:kee}=Js(),{FLAG_INCLUDE_PRERELEASE:Tee,FLAG_LOOSE:Pee}=ll(),fR=t=>t.value==="<0.0.0-0",Ree=t=>t.value==="",dR=(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},$ee=(t,e)=>($e("comp",t,e),t=Nee(t,e),$e("caret",t),t=Iee(t,e),$e("tildes",t),t=Bee(t,e),$e("xrange",t),t=Mee(t,e),$e("stars",t),t),jt=t=>!t||t.toLowerCase()==="x"||t==="*",Iee=(t,e)=>t.trim().split(/\s+/).map(r=>jee(r,e)).join(" "),jee=(t,e)=>{let r=e.loose?Kt[It.TILDELOOSE]:Kt[It.TILDE];return t.replace(r,(n,i,o,s,a)=>{$e("tilde",t,n,i,o,s,a);let u;return jt(i)?u="":jt(o)?u=`>=${i}.0.0 <${+i+1}.0.0-0`:jt(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})},Nee=(t,e)=>t.trim().split(/\s+/).map(r=>Lee(r,e)).join(" "),Lee=(t,e)=>{$e("caret",t,e);let r=e.loose?Kt[It.CARETLOOSE]:Kt[It.CARET],n=e.includePrerelease?"-0":"";return t.replace(r,(i,o,s,a,u)=>{$e("caret",t,i,o,s,a,u);let l;return jt(o)?l="":jt(s)?l=`>=${o}.0.0${n} <${+o+1}.0.0-0`:jt(a)?o==="0"?l=`>=${o}.${s}.0${n} <${o}.${+s+1}.0-0`:l=`>=${o}.${s}.0${n} <${+o+1}.0.0-0`:u?($e("replaceCaret pr",u),o==="0"?s==="0"?l=`>=${o}.${s}.${a}-${u} <${o}.${s}.${+a+1}-0`:l=`>=${o}.${s}.${a}-${u} <${o}.${+s+1}.0-0`:l=`>=${o}.${s}.${a}-${u} <${+o+1}.0.0-0`):($e("no pr"),o==="0"?s==="0"?l=`>=${o}.${s}.${a}${n} <${o}.${s}.${+a+1}-0`:l=`>=${o}.${s}.${a}${n} <${o}.${+s+1}.0-0`:l=`>=${o}.${s}.${a} <${+o+1}.0.0-0`),$e("caret return",l),l})},Bee=(t,e)=>($e("replaceXRanges",t,e),t.split(/\s+/).map(r=>qee(r,e)).join(" ")),qee=(t,e)=>{t=t.trim();let r=e.loose?Kt[It.XRANGELOOSE]:Kt[It.XRANGE];return t.replace(r,(n,i,o,s,a,u)=>{$e("xRange",t,n,i,o,s,a,u);let l=jt(o),c=l||jt(s),f=c||jt(a),h=f;return i==="="&&h&&(i=""),u=e.includePrerelease?"-0":"",l?i===">"||i==="<"?n="<0.0.0-0":n="*":i&&h?(c&&(s=0),a=0,i===">"?(i=">=",c?(o=+o+1,s=0,a=0):(s=+s+1,a=0)):i==="<="&&(i="<",c?o=+o+1:s=+s+1),i==="<"&&(u="-0"),n=`${i+o}.${s}.${a}${u}`):c?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})},Mee=(t,e)=>($e("replaceStars",t,e),t.trim().replace(Kt[It.STAR],"")),Uee=(t,e)=>($e("replaceGTE0",t,e),t.trim().replace(Kt[e.includePrerelease?It.GTE0PRE:It.GTE0],"")),Hee=t=>(e,r,n,i,o,s,a,u,l,c,f,h)=>(jt(n)?r="":jt(i)?r=`>=${n}.0.0${t?"-0":""}`:jt(o)?r=`>=${n}.${i}.0${t?"-0":""}`:s?r=`>=${r}`:r=`>=${r}${t?"-0":""}`,jt(l)?u="":jt(c)?u=`<${+l+1}.0.0-0`:jt(f)?u=`<${l}.${+c+1}.0-0`:h?u=`<=${l}.${c}.${f}-${h}`:t?u=`<${l}.${c}.${+f+1}-0`:u=`<=${u}`,`${r} ${u}`.trim()),Vee=(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!==L0.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 dl=y((Qde,vR)=>{var hl=Symbol("SemVer ANY"),M0=class t{static get ANY(){return hl}constructor(e,r){if(r=pR(r),e instanceof t){if(e.loose===!!r.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),q0("comparator",e,r),this.options=r,this.loose=!!r.loose,this.parse(e),this.semver===hl?this.value="":this.value=this.operator+this.semver.version,q0("comp",this)}parse(e){let r=this.options.loose?mR[gR.COMPARATORLOOSE]:mR[gR.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 yR(n[2],this.options.loose):this.semver=hl}toString(){return this.value}test(e){if(q0("Comparator.test",e,this.options.loose),this.semver===hl||e===hl)return!0;if(typeof e=="string")try{e=new yR(e,this.options)}catch{return!1}return B0(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 DR(e.value,r).test(this.value):e.operator===""?e.value===""?!0:new DR(this.value,r).test(e.semver):(r=pR(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("=")||B0(this.semver,"<",e.semver,r)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||B0(this.semver,">",e.semver,r)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}};vR.exports=M0;var pR=qd(),{safeRe:mR,t:gR}=Js(),B0=I0(),q0=cl(),yR=Ft(),DR=Dr()});var pl=y((ehe,bR)=>{var zee=Dr(),Gee=(t,e,r)=>{try{e=new zee(e,r)}catch{return!1}return e.test(t)};bR.exports=Gee});var _R=y((the,wR)=>{var Wee=Dr(),Kee=(t,e)=>new Wee(t,e).set.map(r=>r.map(n=>n.value).join(" ").trim().split(" "));wR.exports=Kee});var CR=y((rhe,ER)=>{var Yee=Ft(),Jee=Dr(),Xee=(t,e,r)=>{let n=null,i=null,o=null;try{o=new Jee(e,r)}catch{return null}return t.forEach(s=>{o.test(s)&&(!n||i.compare(s)===-1)&&(n=s,i=new Yee(n,r))}),n};ER.exports=Xee});var xR=y((nhe,SR)=>{var Zee=Ft(),Qee=Dr(),ete=(t,e,r)=>{let n=null,i=null,o=null;try{o=new Qee(e,r)}catch{return null}return t.forEach(s=>{o.test(s)&&(!n||i.compare(s)===1)&&(n=s,i=new Zee(n,r))}),n};SR.exports=ete});var AR=y((ihe,OR)=>{var U0=Ft(),tte=Dr(),FR=fl(),rte=(t,e)=>{t=new tte(t,e);let r=new U0("0.0.0");if(t.test(r)||(r=new U0("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 U0(s.semver.version);switch(s.operator){case">":a.prerelease.length===0?a.patch++:a.prerelease.push(0),a.raw=a.format();case"":case">=":(!o||FR(a,o))&&(o=a);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${s.operator}`)}}),o&&(!r||FR(r,o))&&(r=o)}return r&&t.test(r)?r:null};OR.exports=rte});var TR=y((ohe,kR)=>{var nte=Dr(),ite=(t,e)=>{try{return new nte(t,e).range||"*"}catch{return null}};kR.exports=ite});var Jd=y((she,IR)=>{var ote=Ft(),$R=dl(),{ANY:ste}=$R,ate=Dr(),ute=pl(),PR=fl(),RR=zd(),lte=Wd(),cte=Gd(),fte=(t,e,r,n)=>{t=new ote(t,n),e=new ate(e,n);let i,o,s,a,u;switch(r){case">":i=PR,o=lte,s=RR,a=">",u=">=";break;case"<":i=RR,o=cte,s=PR,a="<",u="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(ute(t,e,n))return!1;for(let l=0;l<e.set.length;++l){let c=e.set[l],f=null,h=null;if(c.forEach(d=>{d.semver===ste&&(d=new $R(">=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};IR.exports=fte});var NR=y((ahe,jR)=>{var dte=Jd(),hte=(t,e,r)=>dte(t,e,">",r);jR.exports=hte});var BR=y((uhe,LR)=>{var pte=Jd(),mte=(t,e,r)=>pte(t,e,"<",r);LR.exports=mte});var UR=y((lhe,MR)=>{var qR=Dr(),gte=(t,e,r)=>(t=new qR(t,r),e=new qR(e,r),t.intersects(e,r));MR.exports=gte});var VR=y((che,HR)=>{var yte=pl(),Dte=yr();HR.exports=(t,e,r)=>{let n=[],i=null,o=null,s=t.sort((c,f)=>Dte(c,f,r));for(let c of s)yte(c,e,r)?(o=c,i||(i=c)):(o&&n.push([i,o]),o=null,i=null);i&&n.push([i,null]);let a=[];for(let[c,f]of n)c===f?a.push(c):!f&&c===s[0]?a.push("*"):f?c===s[0]?a.push(`<=${f}`):a.push(`${c} - ${f}`):a.push(`>=${c}`);let u=a.join(" || "),l=typeof e.raw=="string"?e.raw:String(e);return u.length<l.length?u:e}});var G0=y((fhe,YR)=>{var zR=Dr(),V0=dl(),{ANY:H0}=V0,ml=pl(),z0=yr(),vte=(t,e,r={})=>{if(t===e)return!0;t=new zR(t,r),e=new zR(e,r);let n=!1;e:for(let i of t.set){for(let o of e.set){let s=wte(i,o,r);if(n=n||s!==null,s)continue e}if(n)return!1}return!0},bte=[new V0(">=0.0.0-0")],GR=[new V0(">=0.0.0")],wte=(t,e,r)=>{if(t===e)return!0;if(t.length===1&&t[0].semver===H0){if(e.length===1&&e[0].semver===H0)return!0;r.includePrerelease?t=bte:t=GR}if(e.length===1&&e[0].semver===H0){if(r.includePrerelease)return!0;e=GR}let n=new Set,i,o;for(let d of t)d.operator===">"||d.operator===">="?i=WR(i,d,r):d.operator==="<"||d.operator==="<="?o=KR(o,d,r):n.add(d.semver);if(n.size>1)return null;let s;if(i&&o){if(s=z0(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&&!ml(d,String(i),r)||o&&!ml(d,String(o),r))return null;for(let m of e)if(!ml(d,String(m),r))return!1;return!0}let a,u,l,c,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(c=c||d.operator===">"||d.operator===">=",l=l||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=WR(i,d,r),a===d&&a!==i)return!1}else if(i.operator===">="&&!ml(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=KR(o,d,r),u===d&&u!==o)return!1}else if(o.operator==="<="&&!ml(o.semver,String(d),r))return!1}if(!d.operator&&(o||i)&&s!==0)return!1}return!(i&&l&&!o&&s!==0||o&&c&&!i&&s!==0||h||f)},WR=(t,e,r)=>{if(!t)return e;let n=z0(t.semver,e.semver,r);return n>0?t:n<0||e.operator===">"&&t.operator===">="?e:t},KR=(t,e,r)=>{if(!t)return e;let n=z0(t.semver,e.semver,r);return n<0?t:n>0||e.operator==="<"&&t.operator==="<="?e:t};YR.exports=vte});var K0=y((dhe,ZR)=>{var W0=Js(),JR=ll(),_te=Ft(),XR=T0(),Ete=uo(),Cte=C3(),Ste=x3(),xte=A3(),Fte=P3(),Ote=$3(),Ate=j3(),kte=L3(),Tte=q3(),Pte=yr(),Rte=V3(),$te=G3(),Ite=Vd(),jte=J3(),Nte=Z3(),Lte=fl(),Bte=zd(),qte=R0(),Mte=$0(),Ute=Gd(),Hte=Wd(),Vte=I0(),zte=aR(),Gte=dl(),Wte=Dr(),Kte=pl(),Yte=_R(),Jte=CR(),Xte=xR(),Zte=AR(),Qte=TR(),ere=Jd(),tre=NR(),rre=BR(),nre=UR(),ire=VR(),ore=G0();ZR.exports={parse:Ete,valid:Cte,clean:Ste,inc:xte,diff:Fte,major:Ote,minor:Ate,patch:kte,prerelease:Tte,compare:Pte,rcompare:Rte,compareLoose:$te,compareBuild:Ite,sort:jte,rsort:Nte,gt:Lte,lt:Bte,eq:qte,neq:Mte,gte:Ute,lte:Hte,cmp:Vte,coerce:zte,Comparator:Gte,Range:Wte,satisfies:Kte,toComparators:Yte,maxSatisfying:Jte,minSatisfying:Xte,minVersion:Zte,validRange:Qte,outside:ere,gtr:tre,ltr:rre,intersects:nre,simplifyRange:ire,subset:ore,SemVer:_te,re:W0.re,src:W0.src,tokens:W0.t,SEMVER_SPEC_VERSION:JR.SEMVER_SPEC_VERSION,RELEASE_TYPES:JR.RELEASE_TYPES,compareIdentifiers:XR.compareIdentifiers,rcompareIdentifiers:XR.rcompareIdentifiers}});var c$=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 yl=(nr(),je(rr)),QR=lD(),ui=Ns(),lo=require("path"),Ce=yl.__importDefault(Ls()),Zs=vd(),t$=Ju(),sre=s3(),e$=ic(),gl=Ld(),are=Bd();async function ure(t){let r=(await Promise.all(t.map(n=>n()))).filter(n=>n!=null);if(r.length>0)throw r.join(`
|
|
160
|
+
`)}W.check=ure;async function lre(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,ui.pathExists)(t.app.webDirAbs)?await(0,ui.pathExists)((0,lo.join)(t.app.webDirAbs,"index.html"))?null:`The web assets directory (${Ce.default.strong((0,QR.prettyPath)(t.app.webDirAbs))}) must contain an ${Ce.default.strong("index.html")} file.
|
|
161
|
+
It will be the entry point for the web portion of the Capacitor app.`:`Could not find the web assets directory: ${Ce.default.strong((0,QR.prettyPath)(t.app.webDirAbs))}.
|
|
162
|
+
Please create it and make sure it has an ${Ce.default.strong("index.html")} file. You can change the path of this directory in ${Ce.default.strong(t.app.extConfigName)} (${Ce.default.input("webDir")} option). You may need to compile the web assets for your app (typically ${Ce.default.input("npm run build")}). More info: ${Ce.default.strong("https://capacitorjs.com/docs/basics/workflow#sync-your-project")}`}W.checkWebDir=lre;async function cre(){return await(0,ui.pathExists)("package.json")||await(0,ui.pathExists)("project.json")?null:`The Capacitor CLI needs to run at the root of an npm package or in a valid NX monorepo.
|
|
163
163
|
Make sure you have a package.json or project.json file in the directory where you run the Capacitor CLI.
|
|
164
|
-
More info: ${Ce.default.strong("https://docs.npmjs.com/cli/init")}`}W.checkPackage=
|
|
165
|
-
You must install it in your project first, e.g. w/ ${Ce.default.input(`npm install @capacitor/${e}`)}`}W.checkCapacitorPlatform=
|
|
164
|
+
More info: ${Ce.default.strong("https://docs.npmjs.com/cli/init")}`}W.checkPackage=cre;async function fre(t,e){return await J0(t,e)?null:`Could not find the ${Ce.default.input(e)} platform.
|
|
165
|
+
You must install it in your project first, e.g. w/ ${Ce.default.input(`npm install @capacitor/${e}`)}`}W.checkCapacitorPlatform=fre;async function dre(t){if(!t.app.appId)return`Missing ${Ce.default.input("appId")} for new platform.
|
|
166
166
|
Please add it in ${t.app.extConfigName} or run ${Ce.default.input("npx cap init")}.`;if(!t.app.appName)return`Missing ${Ce.default.input("appName")} for new platform.
|
|
167
|
-
Please add it in ${t.app.extConfigName} or run ${Ce.default.input("npx cap init")}.`;let e=await
|
|
167
|
+
Please add it in ${t.app.extConfigName} or run ${Ce.default.input("npx cap init")}.`;let e=await r$(t,t.app.appId);if(e)return e;let r=await n$(t,t.app.appName);return r||null}W.checkAppConfig=dre;async function hre(t,e){return/^\S*$/.test(e)?null:"Your app directory should not contain spaces"}W.checkAppDir=hre;async function r$(t,e){return e?/^[a-zA-Z][\w]*(?:\.[a-zA-Z][\w]*)+$/.test(e.toLowerCase())?null:`
|
|
168
168
|
Invalid App ID "${e}". Your App ID must meet the following requirements to be valid on both iOS and Android:
|
|
169
169
|
- Must be in Java package form with no dashes (ex: com.example.app)
|
|
170
170
|
- It must have at least two segments (one or more dots).
|
|
@@ -172,49 +172,49 @@ Please add it in ${t.app.extConfigName} or run ${Ce.default.input("npx cap init"
|
|
|
172
172
|
- All characters must be alphanumeric or an underscore [a-zA-Z][a-zA-Z0-9]+.
|
|
173
173
|
|
|
174
174
|
If you would like to skip validation, run "cap init" with the "--skip-appid-validation" flag.
|
|
175
|
-
`:"Invalid App ID. App ID is required and cannot be blank."}W.checkAppId=
|
|
176
|
-
Are you sure ${Ce.default.strong(`@capacitor/${e}`)} is installed?`),r}W.requireCapacitorPackage=
|
|
175
|
+
`:"Invalid App ID. App ID is required and cannot be blank."}W.checkAppId=r$;async function n$(t,e){return e?.length?null:"Must provide an app name. For example: 'Spacebook'"}W.checkAppName=n$;async function pre(t){return new Promise(e=>setTimeout(e,t))}W.wait=pre;async function mre(t,e,r,n){await Y0(t,e,r,n),(await(0,sre.getPlugins)(t,e)).forEach(async o=>{await Y0(t,e,o.rootPath,n)})}W.runHooks=mre;async function Y0(t,e,r,n){var i;let{spawn:o}=await Promise.resolve().then(()=>yl.__importStar(require("child_process"))),s;(0,e$.isNXMonorepo)(r)?s=await(0,ui.readJSON)((0,lo.join)((0,e$.findNXMonorepoRoot)(r),"package.json")):s=await(0,ui.readJSON)((0,lo.join)(r,"package.json"));let a=(i=s.scripts)===null||i===void 0?void 0:i[n];if(a)return new Promise((u,l)=>{let c=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}});c.on("close",()=>{u()}),c.on("error",f=>{l(f)})})}W.runPlatformHook=Y0;async function gre(t,e){let r=t$.output.createTaskChain();r.next(t);try{let n=await e();return r.end(),n}catch(n){throw r.fail(),n}}W.runTask=gre;async function J0(t,e){let r=(0,gl.resolveNode)(t.app.rootDir,`@capacitor/${e}`,"package.json");return r?(0,ui.readJSON)(r):null}W.getCapacitorPackage=J0;async function i$(t,e){let r=await J0(t,e);return r||(0,Zs.fatal)(`Unable to find node_modules/@capacitor/${e}.
|
|
176
|
+
Are you sure ${Ce.default.strong(`@capacitor/${e}`)} is installed?`),r}W.requireCapacitorPackage=i$;async function Zd(t,e){return(await i$(t,e)).version}W.getCapacitorPackageVersion=Zd;async function o$(t){return Zd(t,"core")}W.getCoreVersion=o$;async function yre(t){return Zd(t,"cli")}W.getCLIVersion=yre;function Dre(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 Xd(t,e){let r=Dre(t,e);return r&&await(0,ui.pathExists)(r)?r:null}W.getProjectPlatformDirectory=Xd;async function vre(t,e){if(e){let r=e.toLowerCase().trim();return await Z0(r)?await Xd(t,r)||(r==="web"&&(0,Zs.fatal)(`Could not find the web platform directory.
|
|
177
177
|
Make sure ${Ce.default.strong(t.app.webDir)} exists.`),(0,Zs.fatal)(`${Ce.default.strong(r)} platform has not been added yet.
|
|
178
|
-
See the docs for adding the ${Ce.default.strong(r)} platform: ${Ce.default.strong(`https://capacitorjs.com/docs/${r}#adding-the-${r}-platform`)}`)):(0,Zs.fatal)(`Invalid platform: ${Ce.default.input(r)}`),[r]}return
|
|
179
|
-
Valid platforms include: ${o.join(", ")}`)}return i}W.promptForPlatform=
|
|
180
|
-
Valid targets are: ${t.map(s=>s.id).join(", ")}`),o}W.promptForPlatformTarget=
|
|
181
|
-
Consider updating to a matching version, e.g. w/ ${Ce.default.input(`npm install @capacitor/core@${i}`)}`)}W.checkPlatformVersions=
|
|
182
|
-
To use ${co.default.strong(e)} files, you must install TypeScript in your project, e.g. w/ ${co.default.input("npm install -D typescript")}`);let o=require(i),s=(0,
|
|
178
|
+
See the docs for adding the ${Ce.default.strong(r)} platform: ${Ce.default.strong(`https://capacitorjs.com/docs/${r}#adding-the-${r}-platform`)}`)):(0,Zs.fatal)(`Invalid platform: ${Ce.default.input(r)}`),[r]}return l$(t)}W.selectPlatforms=vre;async function X0(){return["web","android","ios"]}W.getKnownPlatforms=X0;async function Z0(t){return(await X0()).includes(t)}W.isValidPlatform=Z0;async function s$(){return["electron"]}W.getKnownCommunityPlatforms=s$;async function bre(t){return(await s$()).includes(t)}W.isValidCommunityPlatform=bre;async function a$(){return["windows"]}W.getKnownEnterprisePlatforms=a$;async function wre(t){return(await a$()).includes(t)}W.isValidEnterprisePlatform=wre;async function _re(t,e,r){let{prompt:n}=await Promise.resolve().then(()=>yl.__importStar(Nd()));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 Z0(i)){let o=await X0();(0,Zs.fatal)(`Invalid platform: ${Ce.default.input(i)}.
|
|
179
|
+
Valid platforms include: ${o.join(", ")}`)}return i}W.promptForPlatform=_re;async function Ere(t,e){let{prompt:r}=await Promise.resolve().then(()=>yl.__importStar(Nd())),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:`${u$(a)} (${a.id})`,value:a}))}],{onCancel:()=>process.exit(1)})).target;let i=e.trim(),o=t.find(s=>s.id===i);return o||(0,Zs.fatal)(`Invalid target ID: ${Ce.default.input(i)}.
|
|
180
|
+
Valid targets are: ${t.map(s=>s.id).join(", ")}`),o}W.promptForPlatformTarget=Ere;function u$(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=u$;async function l$(t){let e=[];return await Xd(t,t.android.name)&&e.push(t.android.name),await Xd(t,t.ios.name)&&e.push(t.ios.name),e.push(t.web.name),e}W.getAddedPlatforms=l$;async function Cre(t,e){let r=await Promise.resolve().then(()=>yl.__importStar(K0())),n=await o$(t),i=await Zd(t,e);(r.diff(n,i)==="minor"||r.diff(n,i)==="major")&&t$.logger.warn(`${Ce.default.strong("@capacitor/core")}${Ce.default.weak(`@${n}`)} version doesn't match ${Ce.default.strong(`@capacitor/${e}`)}${Ce.default.weak(`@${i}`)} version.
|
|
181
|
+
Consider updating to a matching version, e.g. w/ ${Ce.default.input(`npm install @capacitor/core@${i}`)}`)}W.checkPlatformVersions=Cre;function Sre(t,e){if(e[0]!=="@"){let n=(0,gl.resolveNode)(t.app.rootDir,`@capacitor/${e}`,"package.json");if(n)return(0,lo.dirname)(n);let i=(0,gl.resolveNode)(t.app.rootDir,`@capacitor-community/${e}`,"package.json");if(i)return(0,lo.dirname)(i);let o=(0,gl.resolveNode)(t.app.rootDir,`@ionic-enterprise/capacitor-${e}`,"package.json");if(o)return(0,lo.dirname)(o)}let r=(0,gl.resolveNode)(t.app.rootDir,e,"package.json");return r?(0,lo.dirname)(r):null}W.resolvePlatform=Sre;async function xre(){try{let t=await(0,are.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=xre;function Fre(t){let e=t.replace(/([A-Z])/g,"$1").toLowerCase();return`app-${e?`${e}-`:""}debug.apk`}W.parseApkNameFromFlavor=Fre});var f$=y(Qd=>{"use strict";Object.defineProperty(Qd,"__esModule",{value:!0});Qd.tryFn=void 0;var Ore=async(t,...e)=>{try{return await t(...e)}catch{}return null};Qd.tryFn=Ore});var d$=y(eh=>{"use strict";Object.defineProperty(eh,"__esModule",{value:!0});eh.formatJSObject=void 0;var Are=(nr(),je(rr)),kre=Are.__importDefault(require("util"));function Tre(t){try{t=JSON.parse(JSON.stringify(t))}catch(e){throw new Error(`Cannot parse object as JSON: ${e.stack?e.stack:e}`)}return kre.default.inspect(t,{compact:!1,breakLength:1/0,depth:1/0,maxArrayLength:1/0,maxStringLength:1/0})}eh.formatJSObject=Tre});var h$=y(li=>{"use strict";Object.defineProperty(li,"__esModule",{value:!0});li.lazy=li.LazyPromise=li.allSerial=void 0;function Pre(t){return t.reduce((e,r)=>e.then(n=>r().then(i=>n.concat(i))),Promise.resolve([]))}li.allSerial=Pre;var th=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)}};li.LazyPromise=th;function Rre(t){return new th(async(e,r)=>{try{e(await t())}catch(n){r(n)}})}li.lazy=Rre});var y$=y(yt=>{"use strict";Object.defineProperty(yt,"__esModule",{value:!0});yt.writeConfig=yt.loadConfig=yt.CONFIG_FILE_NAME_JSON=yt.CONFIG_FILE_NAME_JS=yt.CONFIG_FILE_NAME_TS=void 0;var ev=(nr(),je(rr)),$re=ev.__importDefault(By()),Yt=Ns(),ne=require("path"),co=ev.__importDefault(Ls()),Ire=c$(),rh=vd(),jre=Ju(),Q0=f$(),Nre=d$(),p$=ic(),m$=Ld(),Qs=h$(),Lre=Bd(),g$=(0,$re.default)("capacitor:config");yt.CONFIG_FILE_NAME_TS="capacitor.config.ts";yt.CONFIG_FILE_NAME_JS="capacitor.config.js";yt.CONFIG_FILE_NAME_JSON="capacitor.config.json";async function Bre(){var t,e,r,n;let i=process.cwd(),o=(0,ne.dirname)(__dirname),s=await Hre(i),a=await(async()=>{var d,m;if((0,p$.isNXMonorepo)(i)){let b=(0,p$.findNXMonorepoRoot)(i),D=await(0,Q0.tryFn)(Yt.readJSON,(0,ne.resolve)(b,"package.json")),_=(d=D?.devDependencies)!==null&&d!==void 0?d:{},F=(m=D?.dependencies)!==null&&m!==void 0?m:{};return{devDependencies:_,dependencies:F}}return{}})(),u=(t=s.extConfig.appId)!==null&&t!==void 0?t:"",l=(e=s.extConfig.appName)!==null&&e!==void 0?e:"",c=(r=s.extConfig.webDir)!==null&&r!==void 0?r:"www",f=await Vre(o),h={android:await zre(i,s.extConfig,f),ios:await Gre(i,s.extConfig),web:await Wre(i,c),cli:f,app:{rootDir:i,appId:u,appName:l,webDir:c,webDirAbs:(0,ne.resolve)(i,c),package:(n=await(0,Q0.tryFn)(Yt.readJSON,(0,ne.resolve)(i,"package.json")))!==null&&n!==void 0?n:{name:l,version:"1.0.0",...a},...s}};return g$("config: %O",h),h}yt.loadConfig=Bre;async function qre(t,e){switch((0,ne.extname)(e)){case".json":{await(0,Yt.writeJSON)(e,t,{spaces:2});break}case".ts":{await(0,Yt.writeFile)(e,Qre(t));break}}}yt.writeConfig=qre;async function Mre(t,e,r){var n;try{let i=(0,m$.resolveNode)(t,"typescript");i||(0,rh.fatal)(`Could not find installation of TypeScript.
|
|
182
|
+
To use ${co.default.strong(e)} files, you must install TypeScript in your project, e.g. w/ ${co.default.input("npm install -D typescript")}`);let o=require(i),s=(0,m$.requireTS)(o,r),a=s.default?await s.default:s;return{extConfigType:"ts",extConfigName:e,extConfigFilePath:r,extConfig:a}}catch(i){throw(0,rh.isFatal)(i)||(0,rh.fatal)(`Parsing ${co.default.strong(e)} failed.
|
|
183
183
|
|
|
184
|
-
${(n=i.stack)!==null&&n!==void 0?n:i}`),i}}async function
|
|
184
|
+
${(n=i.stack)!==null&&n!==void 0?n:i}`),i}}async function Ure(t,e,r){var n;try{return{extConfigType:"js",extConfigName:e,extConfigFilePath:r,extConfig:await require(r)}}catch(i){(0,rh.fatal)(`Parsing ${co.default.strong(e)} failed.
|
|
185
185
|
|
|
186
|
-
${(n=i.stack)!==null&&n!==void 0?n:i}`)}}async function
|
|
187
|
-
Please follow the Upgrade Guide to move ${co.default.strong("public")} inside the iOS target directory: ${co.default.strong("https://capacitorjs.com/docs/updating/3-0#move-public-into-the-ios-target-directory")}`),(0,ne.resolve)(t,"public")}catch{}return(0,ne.resolve)(e,"public")}async function
|
|
186
|
+
${(n=i.stack)!==null&&n!==void 0?n:i}`)}}async function Hre(t){var e;let r=(0,ne.resolve)(t,yt.CONFIG_FILE_NAME_TS);if(await(0,Yt.pathExists)(r))return Mre(t,yt.CONFIG_FILE_NAME_TS,r);let n=(0,ne.resolve)(t,yt.CONFIG_FILE_NAME_JS);if(await(0,Yt.pathExists)(n))return Ure(t,yt.CONFIG_FILE_NAME_JS,n);let i=(0,ne.resolve)(t,yt.CONFIG_FILE_NAME_JSON);return{extConfigType:"json",extConfigName:yt.CONFIG_FILE_NAME_JSON,extConfigFilePath:i,extConfig:(e=await(0,Q0.tryFn)(Yt.readJSON,i))!==null&&e!==void 0?e:{}}}async function Vre(t){let e="assets",r=(0,ne.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,ne.resolve)(r,n),cordovaPluginsTemplateArchive:i,cordovaPluginsTemplateArchiveAbs:(0,ne.resolve)(r,i)},android:{platformTemplateArchive:o,platformTemplateArchiveAbs:(0,ne.resolve)(r,o),cordovaPluginsTemplateArchive:s,cordovaPluginsTemplateArchiveAbs:(0,ne.resolve)(r,s)}},package:await(0,Yt.readJSON)((0,ne.resolve)(t,"package.json")),os:Kre(process.platform)}}async function zre(t,e,r){var n,i,o,s,a,u,l,c,f,h,d,m,b,D,_,F,g;let C="android",A=(i=(n=e.android)===null||n===void 0?void 0:n.path)!==null&&i!==void 0?i:"android",T=(0,ne.resolve)(t,A),x="app",L=`${x}/src`,S=`${L}/main`,I=`${S}/assets`,$=`${I}/public`,B=`${S}/res`,q=`${x}/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 V=(0,Ire.parseApkNameFromFlavor)(K),E=`${q}/debug`,v="capacitor-cordova-android-plugins",w=(0,Qs.lazy)(()=>Xre(r.os)),O={keystorePath:(l=(u=e.android)===null||u===void 0?void 0:u.buildOptions)===null||l===void 0?void 0:l.keystorePath,keystorePassword:(f=(c=e.android)===null||c===void 0?void 0:c.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:(b=(m=e.android)===null||m===void 0?void 0:m.buildOptions)===null||b===void 0?void 0:b.keystoreAliasPassword,signingType:(_=(D=e.android)===null||D===void 0?void 0:D.buildOptions)===null||_===void 0?void 0:_.signingType,releaseType:(g=(F=e.android)===null||F===void 0?void 0:F.buildOptions)===null||g===void 0?void 0:g.releaseType};return{name:C,minVersion:"23",studioPath:w,platformDir:A,platformDirAbs:T,cordovaPluginsDir:v,cordovaPluginsDirAbs:(0,ne.resolve)(T,v),appDir:x,appDirAbs:(0,ne.resolve)(T,x),srcDir:L,srcDirAbs:(0,ne.resolve)(T,L),srcMainDir:S,srcMainDirAbs:(0,ne.resolve)(T,S),assetsDir:I,assetsDirAbs:(0,ne.resolve)(T,I),webDir:$,webDirAbs:(0,ne.resolve)(T,$),resDir:B,resDirAbs:(0,ne.resolve)(T,B),apkName:V,buildOutputDir:E,buildOutputDirAbs:(0,ne.resolve)(T,E),flavor:K,buildOptions:O}}async function Gre(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,ne.resolve)(t,a),l=(o=(i=e.ios)===null||i===void 0?void 0:i.scheme)!==null&&o!==void 0?o:"App",c="App",f=(0,ne.resolve)(u,c),h=`${c}/App`,d=(0,ne.resolve)(u,h),m=`${c}/App.xcodeproj`,b=(0,ne.resolve)(u,m),D=(0,Qs.lazy)(()=>Yre(f)),_=(0,Qs.lazy)(()=>Zre(t,u,f)),F=(0,Qs.lazy)(()=>Jre(f,d,b)),g="capacitor-cordova-ios-plugins";return{name:s,minVersion:"14.0",platformDir:a,platformDirAbs:u,scheme:l,cordovaPluginsDir:g,cordovaPluginsDirAbs:(0,ne.resolve)(u,g),nativeProjectDir:c,nativeProjectDirAbs:f,nativeTargetDir:h,nativeTargetDirAbs:d,nativeXcodeProjDir:m,nativeXcodeProjDirAbs:b,nativeXcodeWorkspaceDir:(0,Qs.lazy)(async()=>(0,ne.relative)(u,await D)),nativeXcodeWorkspaceDirAbs:D,webDir:(0,Qs.lazy)(async()=>(0,ne.relative)(u,await F)),webDirAbs:F,podPath:_}}async function Wre(t,e){let r=e,n=(0,ne.resolve)(t,r);return{name:"web",platformDir:r,platformDirAbs:n}}function Kre(t){switch(t){case"darwin":return"mac";case"win32":return"windows";case"linux":return"linux"}return"unknown"}async function Yre(t){return(0,ne.resolve)(t,"App.xcworkspace")}async function Jre(t,e,r){let n=/path\s=\spublic[\s\S]+?sourceTree\s=\s([^;]+)/,i=(0,ne.resolve)(r,"project.pbxproj");try{let s=(await(0,Yt.readFile)(i,{encoding:"utf8"})).match(n);if(s&&s[1]==="SOURCE_ROOT")return jre.logger.warn(`Using the iOS project root for the ${co.default.strong("public")} directory is deprecated.
|
|
187
|
+
Please follow the Upgrade Guide to move ${co.default.strong("public")} inside the iOS target directory: ${co.default.strong("https://capacitorjs.com/docs/updating/3-0#move-public-into-the-ios-target-directory")}`),(0,ne.resolve)(t,"public")}catch{}return(0,ne.resolve)(e,"public")}async function Xre(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(()=>ev.__importStar(Bd())),r="C:\\Program Files\\Android\\Android Studio\\bin\\studio64.exe";try{if(!await(0,Yt.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){g$("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 Zre(t,e,r){if(process.env.CAPACITOR_COCOAPODS_PATH)return process.env.CAPACITOR_COCOAPODS_PATH;let n="";if(await(0,Yt.pathExists)((0,ne.resolve)(t,"Gemfile"))?n=(0,ne.resolve)(t,"Gemfile"):await(0,Yt.pathExists)((0,ne.resolve)(e,"Gemfile"))?n=(0,ne.resolve)(e,"Gemfile"):await(0,Yt.pathExists)((0,ne.resolve)(r,"Gemfile"))&&(n=(0,ne.resolve)(r,"Gemfile")),!(n!=""))try{let o=await(0,Lre.getCommandOutput)("git",["rev-parse","--show-toplevel"],{cwd:t});o!=null&&(n=(0,ne.resolve)(o,"Gemfile"))}catch{}try{let o=(await(0,Yt.readFile)(n)).toString();return o&&new RegExp(/gem\s+['"]cocoapods/).test(o)?"bundle exec pod":"pod"}catch{return"pod"}}function Qre(t){return`import type { CapacitorConfig } from '@capacitor/cli';
|
|
188
188
|
|
|
189
|
-
const config: CapacitorConfig = ${(0,
|
|
189
|
+
const config: CapacitorConfig = ${(0,Nre.formatJSObject)(t)};
|
|
190
190
|
|
|
191
191
|
export default config;
|
|
192
|
-
`}});function
|
|
193
|
-
tell application "System Events" to get value of property list item "CFBundleName" of property list file (app_path & ":Contents:Info.plist")`)}var
|
|
192
|
+
`}});function ene(){try{return rv.default.statSync("/.dockerenv"),!0}catch{return!1}}function tne(){try{return rv.default.readFileSync("/proc/self/cgroup","utf8").includes("docker")}catch{return!1}}function nv(){return tv===void 0&&(tv=ene()||tne()),tv}var rv,tv,v$=Ct(()=>{rv=ue(require("node:fs"),1)});function ea(){return iv===void 0&&(iv=rne()||nv()),iv}var b$,iv,rne,ov=Ct(()=>{b$=ue(require("node:fs"),1);v$();rne=()=>{try{return b$.default.statSync("/run/.containerenv"),!0}catch{return!1}}});var sv,_$,E$,w$,vl,C$=Ct(()=>{sv=ue(require("node:process"),1),_$=ue(require("node:os"),1),E$=ue(require("node:fs"),1);ov();w$=()=>{if(sv.default.platform!=="linux")return!1;if(_$.default.release().toLowerCase().includes("microsoft"))return!ea();try{return E$.default.readFileSync("/proc/version","utf8").toLowerCase().includes("microsoft")?!ea():!1}catch{return!1}},vl=sv.default.env.__IS_WSL_TEST__?w$:w$()});function fo(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 S$=Ct(()=>{});async function av(){if(F$.default.platform!=="darwin")throw new Error("macOS only");let{stdout:t}=await nne("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 x$,F$,O$,nne,A$=Ct(()=>{x$=require("node:util"),F$=ue(require("node:process"),1),O$=require("node:child_process"),nne=(0,x$.promisify)(O$.execFile)});async function P$(t,{humanReadableOutput:e=!0}={}){if(k$.default.platform!=="darwin")throw new Error("macOS only");let r=e?[]:["-ss"],{stdout:n}=await ine("osascript",["-e",t,r]);return n.trim()}var k$,T$,uv,ine,R$=Ct(()=>{k$=ue(require("node:process"),1),T$=require("node:util"),uv=require("node:child_process"),ine=(0,T$.promisify)(uv.execFile)});async function lv(t){return P$(`tell application "Finder" to set app_path to application file id "${t}" as string
|
|
193
|
+
tell application "System Events" to get value of property list item "CFBundleName" of property list file (app_path & ":Contents:Info.plist")`)}var $$=Ct(()=>{R$()});async function cv(t=one){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 nh(`Cannot find Windows browser in stdout: ${JSON.stringify(e)}`);let{id:n}=r.groups,i=sne[n];if(!i)throw new nh(`Unknown browser ID: ${n}`);return i}var I$,j$,one,sne,nh,N$=Ct(()=>{I$=require("node:util"),j$=require("node:child_process"),one=(0,I$.promisify)(j$.execFile),sne={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"}},nh=class extends Error{}});async function fv(){if(ih.default.platform==="darwin"){let t=await av();return{name:await lv(t),id:t}}if(ih.default.platform==="linux"){let{stdout:t}=await ane("xdg-mime",["query","default","x-scheme-handler/http"]),e=t.trim();return{name:une(e.replace(/.desktop$/,"").replace("-"," ")),id:e}}if(ih.default.platform==="win32")return cv();throw new Error("Only macOS, Linux, and Windows are supported")}var L$,ih,B$,ane,une,q$=Ct(()=>{L$=require("node:util"),ih=ue(require("node:process"),1),B$=require("node:child_process");A$();$$();N$();ane=(0,L$.promisify)(B$.execFile),une=t=>t.toLowerCase().replaceAll(/(?:^|\s|-)\S/g,e=>e.toUpperCase())});var mv={};gi(mv,{apps:()=>po,default:()=>dne,openApp:()=>fne});function V$(t){if(typeof t=="string"||Array.isArray(t))return t;let{[U$]:e}=t;if(!e)throw new Error(`${U$} is not supported`);return e}function pv({[ta]:t},{wsl:e}){if(e&&vl)return V$(e);if(!t)throw new Error(`${ta} is not supported`);return V$(t)}var bl,z$,hv,G$,W$,ho,hne,dv,M$,ta,U$,lne,H$,wl,cne,fne,po,dne,gv=Ct(()=>{bl=ue(require("node:process"),1),z$=require("node:buffer"),hv=ue(require("node:path"),1),G$=require("node:url"),W$=ue(require("node:child_process"),1),ho=ue(require("node:fs/promises"),1);C$();S$();q$();ov();hne={},dv=hv.default.dirname((0,G$.fileURLToPath)(hne.url)),M$=hv.default.join(dv,"xdg-open"),{platform:ta,arch:U$}=bl.default,lne=(()=>{let t="/mnt/",e;return async function(){if(e)return e;let r="/etc/wsl.conf",n=!1;try{await ho.default.access(r,ho.constants.F_OK),n=!0}catch{}if(!n)return t;let i=await ho.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}})(),H$=async(t,e)=>{let r;for(let n of t)try{return await e(n)}catch(i){r=i}throw r},wl=async t=>{if(t={wait:!1,background:!1,newInstance:!1,allowNonzeroExitCode:!1,...t},Array.isArray(t.app))return H$(t.app,a=>wl({...t,app:a}));let{name:e,arguments:r=[]}=t.app??{};if(r=[...r],Array.isArray(e))return H$(e,a=>wl({...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"},l=await fv();if(l.id in a){let c=a[l.id];return e==="browserPrivate"&&r.push(u[c]),wl({...t,app:{name:po[c],arguments:r}})}throw new Error(`${l.name} is not supported as a default browser`)}let n,i=[],o={};if(ta==="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(ta==="win32"||vl&&!ea()&&!e){let a=await lne();n=vl?`${a}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe`:`${bl.default.env.SYSTEMROOT||bl.default.env.windir||"C:\\Windows"}\\System32\\WindowsPowerShell\\v1.0\\powershell`,i.push("-NoProfile","-NonInteractive","-ExecutionPolicy","Bypass","-EncodedCommand"),vl||(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(l=>`"\`"${l}\`""`),u.push("-ArgumentList",r.join(","))),t.target=z$.Buffer.from(u.join(" "),"utf16le").toString("base64")}else{if(e)n=e;else{let a=!dv||dv==="/",u=!1;try{await ho.default.access(M$,ho.constants.X_OK),u=!0}catch{}n=bl.default.versions.electron??(ta==="android"||a||!u)?"xdg-open":M$}r.length>0&&i.push(...r),t.wait||(o.stdio="ignore",o.detached=!0)}ta==="darwin"&&r.length>0&&i.push("--args",...r),t.target&&i.push(t.target);let s=W$.default.spawn(n,i,o);return t.wait?new Promise((a,u)=>{s.once("error",u),s.once("close",l=>{if(!t.allowNonzeroExitCode&&l>0){u(new Error(`Exited with code ${l}`));return}a(s)})}):(s.unref(),s)},cne=(t,e)=>{if(typeof t!="string")throw new TypeError("Expected a `target`");return wl({...e,target:t})},fne=(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 wl({...e,app:{name:t,arguments:r}})};po={};fo(po,"chrome",()=>pv({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"]}}));fo(po,"firefox",()=>pv({darwin:"firefox",win32:"C:\\Program Files\\Mozilla Firefox\\firefox.exe",linux:"firefox"},{wsl:"/mnt/c/Program Files/Mozilla Firefox/firefox.exe"}));fo(po,"edge",()=>pv({darwin:"microsoft edge",win32:"msedge",linux:["microsoft-edge","microsoft-edge-dev"]},{wsl:"/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe"}));fo(po,"browser",()=>"browser");fo(po,"browserPrivate",()=>"browserPrivate");dne=cne});var CI=y(go=>{go.parse=go.decode=Sne;go.stringify=go.encode=wI;go.safe=la;go.unsafe=ph;var Cv=typeof process<"u"&&process.platform==="win32"?`\r
|
|
194
194
|
`:`
|
|
195
|
-
`;function
|
|
196
|
-
`}):u&&typeof u=="object"?r.push(o):n+=la(o)+i+la(u)+Cv}),e.section&&n.length&&(n="["+la(e.section)+"]"+Cv+n),r.forEach(function(o,s,a){var u=
|
|
195
|
+
`;function wI(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(l){n+=la(o+"[]")+i+la(l)+`
|
|
196
|
+
`}):u&&typeof u=="object"?r.push(o):n+=la(o)+i+la(u)+Cv}),e.section&&n.length&&(n="["+la(e.section)+"]"+Cv+n),r.forEach(function(o,s,a){var u=_I(o).join("\\."),l=(e.section?e.section+".":"")+u,c=wI(t[o],{section:l,whitespace:e.whitespace});n.length&&c.length&&(n+=Cv),n+=c}),n}function _I(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 Sne(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 l=s.match(i);if(l){if(l[1]!==void 0){if(n=ph(l[1]),n==="__proto__"){r={};return}r=e[n]=e[n]||{};return}var c=ph(l[2]);if(c!=="__proto__"){var f=l[3]?ph(l[4]):!0;switch(f){case"true":case"false":case"null":f=JSON.parse(f)}if(c.length>2&&c.slice(-2)==="[]"){if(c=c.substring(0,c.length-2),c==="__proto__")return;r[c]?Array.isArray(r[c])||(r[c]=[r[c]]):r[c]=[]}Array.isArray(r[c])?r[c].push(f):r[c]=f}}}}),Object.keys(e).filter(function(s,a,u){if(!e[s]||typeof e[s]!="object"||Array.isArray(e[s]))return!1;var l=_I(s),c=e,f=l.pop(),h=f.replace(/\\\./g,".");return l.forEach(function(d,m,b){d!=="__proto__"&&((!c[d]||typeof c[d]!="object")&&(c[d]={}),c=c[d])}),c===e&&h===f?!1:(c[h]=e[s],!0)}).forEach(function(s,a,u){delete e[s]}),e}function EI(t){return t.charAt(0)==='"'&&t.slice(-1)==='"'||t.charAt(0)==="'"&&t.slice(-1)==="'"}function la(t){return typeof t!="string"||t.match(/[=\r\n]/)||t.match(/^\[/)||t.length>1&&EI(t)||t!==t.trim()?JSON.stringify(t):t.replace(/;/g,"\\;").replace(/#/g,"\\#")}function ph(t,e){if(t=(t||"").trim(),EI(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 FI=y((Yhe,xI)=>{"use strict";var Sv=1,SI=2;function xne(){return""}function Fne(t,e,r){return t.slice(e,r).replace(/\S/g," ")}xI.exports=function(t,e){e=e||{};for(var r,n,i=!1,o=!1,s=0,a="",u=e.whitespace===!1?xne:Fne,l=0;l<t.length;l++){if(r=t[l],n=t[l+1],!o&&r==='"'){var c=t[l-1]==="\\"&&t[l-2]!=="\\";c||(i=!i)}if(!i){if(!o&&r+n==="//")a+=t.slice(s,l),s=l,o=Sv,l++;else if(o===Sv&&r+n===`\r
|
|
197
197
|
`){l++,o=!1,a+=u(t,s,l),s=l;continue}else if(o===Sv&&r===`
|
|
198
|
-
`)o=!1,a+=u(t,s,l),s=l;else if(!o&&r+n==="/*"){a+=t.slice(s,l),s=l,o=CI,l++;continue}else if(o===CI&&r+n==="*/"){l++,o=!1,a+=u(t,s,l+1),s=l+1;continue}}}return a+(o?u(t.substr(s)):t.substr(s))}});var OI=y(ca=>{"use strict";var FI=require("fs"),Fne=EI(),Cl=require("path"),One=xI(),Ane=ca.parse=function(t){return/^\s*{/.test(t)?JSON.parse(One(t)):Fne.parse(t)},kne=ca.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=Cl.join.apply(null,t),n;try{return FI.readFileSync(r,"utf-8")}catch{return}},Whe=ca.json=function(){var t=kne.apply(null,arguments);return t?Ane(t):null},Khe=ca.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(l,c){!l||typeof a!="object"||(c===o.length-1&&(a[l]=e[i]),a[l]===void 0&&(a[l]={}),a=a[l])})}return r},Yhe=ca.find=function(){var t=Cl.join.apply(null,[].slice.call(arguments));function e(r,n){var i=Cl.join(r,n);try{return FI.statSync(i),i}catch{if(Cl.dirname(r)!==r)return e(Cl.dirname(r),n)}}return e(process.cwd(),t)}});var $I=y((Xhe,RI)=>{"use strict";function kI(t){return t instanceof Buffer||t instanceof Date||t instanceof RegExp}function TI(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 PI(t){var e=[];return t.forEach(function(r,n){typeof r=="object"&&r!==null?Array.isArray(r)?e[n]=PI(r):kI(r)?e[n]=TI(r):e[n]=xv({},r):e[n]=r}),e}function AI(t,e){return e==="__proto__"?void 0:t[e]}var xv=RI.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=AI(t,s),r=AI(o,s),r!==t)if(typeof r!="object"||r===null){t[s]=r;return}else if(Array.isArray(r)){t[s]=PI(r);return}else if(kI(r)){t[s]=TI(r);return}else if(typeof n!="object"||n===null||Array.isArray(n)){t[s]=xv({},r);return}else{t[s]=xv(n,r);return}})}),t}});var LI=y((Zhe,NI)=>{"use strict";function Tne(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 II(t){return typeof t=="number"||/^0x[0-9a-f]+$/i.test(t)?!0:/^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(t)}function jI(t,e){return e==="constructor"&&typeof t[e]=="function"||e==="__proto__"}NI.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(A){return r.bools[A]})}Object.keys(e.alias||{}).forEach(function(C){n[C]=[].concat(e.alias[C]),n[C].forEach(function(A){n[A]=[C].concat(n[C].filter(function(T){return A!==T}))})}),[].concat(e.string).filter(Boolean).forEach(function(C){r.strings[C]=!0,n[C]&&[].concat(n[C]).forEach(function(A){r.strings[A]=!0})});var o=e.default||{},s={_:[]};function a(C,A){return r.allBools&&/^--[^=]+$/.test(A)||r.strings[C]||r.bools[C]||n[C]}function u(C,A,T){for(var x=C,L=0;L<A.length-1;L++){var S=A[L];if(jI(x,S))return;x[S]===void 0&&(x[S]={}),(x[S]===Object.prototype||x[S]===Number.prototype||x[S]===String.prototype)&&(x[S]={}),x[S]===Array.prototype&&(x[S]=[]),x=x[S]}var I=A[A.length-1];jI(x,I)||((x===Object.prototype||x===Number.prototype||x===String.prototype)&&(x={}),x===Array.prototype&&(x=[]),x[I]===void 0||r.bools[I]||typeof x[I]=="boolean"?x[I]=T:Array.isArray(x[I])?x[I].push(T):x[I]=[x[I],T])}function l(C,A,T){if(!(T&&r.unknownFn&&!a(C,T)&&r.unknownFn(T)===!1)){var x=!r.strings[C]&&II(A)?Number(A):A;u(s,C.split("."),x),(n[C]||[]).forEach(function(L){u(s,L.split("."),x)})}}Object.keys(r.bools).forEach(function(C){l(C,o[C]===void 0?!1:o[C])});var c=[];t.indexOf("--")!==-1&&(c=t.slice(t.indexOf("--")+1),t=t.slice(0,t.indexOf("--")));for(var f=0;f<t.length;f++){var h=t[f],d,m;if(/^--.+=/.test(h)){var b=h.match(/^--([^=]+)=([\s\S]*)$/);d=b[1];var D=b[2];r.bools[d]&&(D=D!=="false"),l(d,D,h)}else if(/^--no-.+/.test(h))d=h.match(/^--no-(.+)/)[1],l(d,!1,h);else if(/^--.+/.test(h))d=h.match(/^--(.+)/)[1],m=t[f+1],m!==void 0&&!/^(-|--)[^-]/.test(m)&&!r.bools[d]&&!r.allBools&&(!n[d]||!i(d))?(l(d,m,h),f+=1):/^(true|false)$/.test(m)?(l(d,m==="true",h),f+=1):l(d,r.strings[d]?"":!0,h);else if(/^-[^-]+/.test(h)){for(var _=h.slice(1,-1).split(""),F=!1,g=0;g<_.length;g++){if(m=h.slice(g+2),m==="-"){l(_[g],m,h);continue}if(/[A-Za-z]/.test(_[g])&&m[0]==="="){l(_[g],m.slice(1),h),F=!0;break}if(/[A-Za-z]/.test(_[g])&&/-?\d+(\.\d*)?(e-?\d+)?$/.test(m)){l(_[g],m,h),F=!0;break}if(_[g+1]&&_[g+1].match(/\W/)){l(_[g],h.slice(g+2),h),F=!0;break}else l(_[g],r.strings[_[g]]?"":!0,h)}d=h.slice(-1)[0],!F&&d!=="-"&&(t[f+1]&&!/^(-|--)[^-]/.test(t[f+1])&&!r.bools[d]&&(!n[d]||!i(d))?(l(d,t[f+1],h),f+=1):t[f+1]&&/^(true|false)$/.test(t[f+1])?(l(d,t[f+1]==="true",h),f+=1):l(d,r.strings[d]?"":!0,h))}else if((!r.unknownFn||r.unknownFn(h)!==!1)&&s._.push(r.strings._||!II(h)?h:Number(h)),e.stopEarly){s._.push.apply(s._,t.slice(f+1));break}}return Object.keys(o).forEach(function(C){Tne(s,C.split("."))||(u(s,C.split("."),o[C]),(n[C]||[]).forEach(function(A){u(s,A.split("."),o[C])}))}),e["--"]?s["--"]=c.slice():c.forEach(function(C){s._.push(C)}),s}});var UI=y((Qhe,MI)=>{var Sl=OI(),fa=require("path").join,Pne=$I(),BI="/etc",qI=process.platform==="win32",xl=qI?process.env.USERPROFILE:process.env.HOME;MI.exports=function(t,e,r,n){if(typeof t!="string")throw new Error("rc(name): name *must* be string");r||(r=LI()(process.argv.slice(2))),e=(typeof e=="string"?Sl.json(e):e)||{},n=n||Sl.parse;var i=Sl.env(t+"_"),o=[e],s=[];function a(u){if(!(s.indexOf(u)>=0)){var l=Sl.file(u);l&&(o.push(n(l)),s.push(u))}}return qI||[fa(BI,t,"config"),fa(BI,t+"rc")].forEach(a),xl&&[fa(xl,".config",t,"config"),fa(xl,".config",t),fa(xl,"."+t,"config"),fa(xl,"."+t+"rc")].forEach(a),a(Sl.find("."+t+"rc")),i.config&&a(i.config),r.config&&a(r.config),Pne.apply(null,o.concat([i,r,s.length?{configs:s,config:s[s.length-1]}:void 0]))}});var zI=y((tpe,VI)=>{var fi=require("constants"),Rne=process.cwd,mh=null,$ne=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return mh||(mh=Rne.call(process)),mh};try{process.cwd()}catch{}typeof process.chdir=="function"&&(Ov=process.chdir,process.chdir=function(t){mh=null,Ov.call(process,t)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,Ov));var Ov;VI.exports=Ine;function Ine(t){fi.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(c,f,h){h&&process.nextTick(h)},t.lchmodSync=function(){}),t.chown&&!t.lchown&&(t.lchown=function(c,f,h,d){d&&process.nextTick(d)},t.lchownSync=function(){}),$ne==="win32"&&(t.rename=typeof t.rename!="function"?t.rename:function(c){function f(h,d,m){var b=Date.now(),D=0;c(h,d,function _(F){if(F&&(F.code==="EACCES"||F.code==="EPERM")&&Date.now()-b<6e4){setTimeout(function(){t.stat(d,function(g,C){g&&g.code==="ENOENT"?c(h,d,_):m(F)})},D),D<100&&(D+=10);return}m&&m(F)})}return Object.setPrototypeOf&&Object.setPrototypeOf(f,c),f}(t.rename)),t.read=typeof t.read!="function"?t.read:function(c){function f(h,d,m,b,D,_){var F;if(_&&typeof _=="function"){var g=0;F=function(C,A,T){if(C&&C.code==="EAGAIN"&&g<10)return g++,c.call(t,h,d,m,b,D,F);_.apply(this,arguments)}}return c.call(t,h,d,m,b,D,F)}return Object.setPrototypeOf&&Object.setPrototypeOf(f,c),f}(t.read),t.readSync=typeof t.readSync!="function"?t.readSync:function(c){return function(f,h,d,m,b){for(var D=0;;)try{return c.call(t,f,h,d,m,b)}catch(_){if(_.code==="EAGAIN"&&D<10){D++;continue}throw _}}}(t.readSync);function e(c){c.lchmod=function(f,h,d){c.open(f,fi.O_WRONLY|fi.O_SYMLINK,h,function(m,b){if(m){d&&d(m);return}c.fchmod(b,h,function(D){c.close(b,function(_){d&&d(D||_)})})})},c.lchmodSync=function(f,h){var d=c.openSync(f,fi.O_WRONLY|fi.O_SYMLINK,h),m=!0,b;try{b=c.fchmodSync(d,h),m=!1}finally{if(m)try{c.closeSync(d)}catch{}else c.closeSync(d)}return b}}function r(c){fi.hasOwnProperty("O_SYMLINK")&&c.futimes?(c.lutimes=function(f,h,d,m){c.open(f,fi.O_SYMLINK,function(b,D){if(b){m&&m(b);return}c.futimes(D,h,d,function(_){c.close(D,function(F){m&&m(_||F)})})})},c.lutimesSync=function(f,h,d){var m=c.openSync(f,fi.O_SYMLINK),b,D=!0;try{b=c.futimesSync(m,h,d),D=!1}finally{if(D)try{c.closeSync(m)}catch{}else c.closeSync(m)}return b}):c.futimes&&(c.lutimes=function(f,h,d,m){m&&process.nextTick(m)},c.lutimesSync=function(){})}function n(c){return c&&function(f,h,d){return c.call(t,f,h,function(m){l(m)&&(m=null),d&&d.apply(this,arguments)})}}function i(c){return c&&function(f,h){try{return c.call(t,f,h)}catch(d){if(!l(d))throw d}}}function o(c){return c&&function(f,h,d,m){return c.call(t,f,h,d,function(b){l(b)&&(b=null),m&&m.apply(this,arguments)})}}function s(c){return c&&function(f,h,d){try{return c.call(t,f,h,d)}catch(m){if(!l(m))throw m}}}function a(c){return c&&function(f,h,d){typeof h=="function"&&(d=h,h=null);function m(b,D){D&&(D.uid<0&&(D.uid+=4294967296),D.gid<0&&(D.gid+=4294967296)),d&&d.apply(this,arguments)}return h?c.call(t,f,h,m):c.call(t,f,m)}}function u(c){return c&&function(f,h){var d=h?c.call(t,f,h):c.call(t,f);return d&&(d.uid<0&&(d.uid+=4294967296),d.gid<0&&(d.gid+=4294967296)),d}}function l(c){if(!c||c.code==="ENOSYS")return!0;var f=!process.getuid||process.getuid()!==0;return!!(f&&(c.code==="EINVAL"||c.code==="EPERM"))}}});var KI=y((rpe,WI)=>{var GI=require("stream").Stream;WI.exports=jne;function jne(t){return{ReadStream:e,WriteStream:r};function e(n,i){if(!(this instanceof e))return new e(n,i);GI.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 l=s[a];this[l]=i[l]}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(c,f){if(c){o.emit("error",c),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);GI.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 JI=y((npe,YI)=>{"use strict";YI.exports=Lne;var Nne=Object.getPrototypeOf||function(t){return t.__proto__};function Lne(t){if(t===null||typeof t!="object")return t;if(t instanceof Object)var e={__proto__:Nne(t)};else var e=Object.create(null);return Object.getOwnPropertyNames(t).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}});var ej=y((ipe,Tv)=>{var Ke=require("fs"),Bne=zI(),qne=KI(),Mne=JI(),gh=require("util"),_t,Dh;typeof Symbol=="function"&&typeof Symbol.for=="function"?(_t=Symbol.for("graceful-fs.queue"),Dh=Symbol.for("graceful-fs.previous")):(_t="___graceful-fs.queue",Dh="___graceful-fs.previous");function Une(){}function QI(t,e){Object.defineProperty(t,_t,{get:function(){return e}})}var yo=Une;gh.debuglog?yo=gh.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(yo=function(){var t=gh.format.apply(gh,arguments);t="GFS4: "+t.split(/\n/).join(`
|
|
199
|
-
GFS4: `),console.error(t)});Ke[_t]||(
|
|
198
|
+
`)o=!1,a+=u(t,s,l),s=l;else if(!o&&r+n==="/*"){a+=t.slice(s,l),s=l,o=SI,l++;continue}else if(o===SI&&r+n==="*/"){l++,o=!1,a+=u(t,s,l+1),s=l+1;continue}}}return a+(o?u(t.substr(s)):t.substr(s))}});var AI=y(ca=>{"use strict";var OI=require("fs"),One=CI(),Cl=require("path"),Ane=FI(),kne=ca.parse=function(t){return/^\s*{/.test(t)?JSON.parse(Ane(t)):One.parse(t)},Tne=ca.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=Cl.join.apply(null,t),n;try{return OI.readFileSync(r,"utf-8")}catch{return}},Jhe=ca.json=function(){var t=Tne.apply(null,arguments);return t?kne(t):null},Xhe=ca.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(l,c){!l||typeof a!="object"||(c===o.length-1&&(a[l]=e[i]),a[l]===void 0&&(a[l]={}),a=a[l])})}return r},Zhe=ca.find=function(){var t=Cl.join.apply(null,[].slice.call(arguments));function e(r,n){var i=Cl.join(r,n);try{return OI.statSync(i),i}catch{if(Cl.dirname(r)!==r)return e(Cl.dirname(r),n)}}return e(process.cwd(),t)}});var II=y((epe,$I)=>{"use strict";function TI(t){return t instanceof Buffer||t instanceof Date||t instanceof RegExp}function PI(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 RI(t){var e=[];return t.forEach(function(r,n){typeof r=="object"&&r!==null?Array.isArray(r)?e[n]=RI(r):TI(r)?e[n]=PI(r):e[n]=xv({},r):e[n]=r}),e}function kI(t,e){return e==="__proto__"?void 0:t[e]}var xv=$I.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=kI(t,s),r=kI(o,s),r!==t)if(typeof r!="object"||r===null){t[s]=r;return}else if(Array.isArray(r)){t[s]=RI(r);return}else if(TI(r)){t[s]=PI(r);return}else if(typeof n!="object"||n===null||Array.isArray(n)){t[s]=xv({},r);return}else{t[s]=xv(n,r);return}})}),t}});var BI=y((tpe,LI)=>{"use strict";function Pne(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 jI(t){return typeof t=="number"||/^0x[0-9a-f]+$/i.test(t)?!0:/^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(t)}function NI(t,e){return e==="constructor"&&typeof t[e]=="function"||e==="__proto__"}LI.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(A){return r.bools[A]})}Object.keys(e.alias||{}).forEach(function(C){n[C]=[].concat(e.alias[C]),n[C].forEach(function(A){n[A]=[C].concat(n[C].filter(function(T){return A!==T}))})}),[].concat(e.string).filter(Boolean).forEach(function(C){r.strings[C]=!0,n[C]&&[].concat(n[C]).forEach(function(A){r.strings[A]=!0})});var o=e.default||{},s={_:[]};function a(C,A){return r.allBools&&/^--[^=]+$/.test(A)||r.strings[C]||r.bools[C]||n[C]}function u(C,A,T){for(var x=C,L=0;L<A.length-1;L++){var S=A[L];if(NI(x,S))return;x[S]===void 0&&(x[S]={}),(x[S]===Object.prototype||x[S]===Number.prototype||x[S]===String.prototype)&&(x[S]={}),x[S]===Array.prototype&&(x[S]=[]),x=x[S]}var I=A[A.length-1];NI(x,I)||((x===Object.prototype||x===Number.prototype||x===String.prototype)&&(x={}),x===Array.prototype&&(x=[]),x[I]===void 0||r.bools[I]||typeof x[I]=="boolean"?x[I]=T:Array.isArray(x[I])?x[I].push(T):x[I]=[x[I],T])}function l(C,A,T){if(!(T&&r.unknownFn&&!a(C,T)&&r.unknownFn(T)===!1)){var x=!r.strings[C]&&jI(A)?Number(A):A;u(s,C.split("."),x),(n[C]||[]).forEach(function(L){u(s,L.split("."),x)})}}Object.keys(r.bools).forEach(function(C){l(C,o[C]===void 0?!1:o[C])});var c=[];t.indexOf("--")!==-1&&(c=t.slice(t.indexOf("--")+1),t=t.slice(0,t.indexOf("--")));for(var f=0;f<t.length;f++){var h=t[f],d,m;if(/^--.+=/.test(h)){var b=h.match(/^--([^=]+)=([\s\S]*)$/);d=b[1];var D=b[2];r.bools[d]&&(D=D!=="false"),l(d,D,h)}else if(/^--no-.+/.test(h))d=h.match(/^--no-(.+)/)[1],l(d,!1,h);else if(/^--.+/.test(h))d=h.match(/^--(.+)/)[1],m=t[f+1],m!==void 0&&!/^(-|--)[^-]/.test(m)&&!r.bools[d]&&!r.allBools&&(!n[d]||!i(d))?(l(d,m,h),f+=1):/^(true|false)$/.test(m)?(l(d,m==="true",h),f+=1):l(d,r.strings[d]?"":!0,h);else if(/^-[^-]+/.test(h)){for(var _=h.slice(1,-1).split(""),F=!1,g=0;g<_.length;g++){if(m=h.slice(g+2),m==="-"){l(_[g],m,h);continue}if(/[A-Za-z]/.test(_[g])&&m[0]==="="){l(_[g],m.slice(1),h),F=!0;break}if(/[A-Za-z]/.test(_[g])&&/-?\d+(\.\d*)?(e-?\d+)?$/.test(m)){l(_[g],m,h),F=!0;break}if(_[g+1]&&_[g+1].match(/\W/)){l(_[g],h.slice(g+2),h),F=!0;break}else l(_[g],r.strings[_[g]]?"":!0,h)}d=h.slice(-1)[0],!F&&d!=="-"&&(t[f+1]&&!/^(-|--)[^-]/.test(t[f+1])&&!r.bools[d]&&(!n[d]||!i(d))?(l(d,t[f+1],h),f+=1):t[f+1]&&/^(true|false)$/.test(t[f+1])?(l(d,t[f+1]==="true",h),f+=1):l(d,r.strings[d]?"":!0,h))}else if((!r.unknownFn||r.unknownFn(h)!==!1)&&s._.push(r.strings._||!jI(h)?h:Number(h)),e.stopEarly){s._.push.apply(s._,t.slice(f+1));break}}return Object.keys(o).forEach(function(C){Pne(s,C.split("."))||(u(s,C.split("."),o[C]),(n[C]||[]).forEach(function(A){u(s,A.split("."),o[C])}))}),e["--"]?s["--"]=c.slice():c.forEach(function(C){s._.push(C)}),s}});var HI=y((rpe,UI)=>{var Sl=AI(),fa=require("path").join,Rne=II(),qI="/etc",MI=process.platform==="win32",xl=MI?process.env.USERPROFILE:process.env.HOME;UI.exports=function(t,e,r,n){if(typeof t!="string")throw new Error("rc(name): name *must* be string");r||(r=BI()(process.argv.slice(2))),e=(typeof e=="string"?Sl.json(e):e)||{},n=n||Sl.parse;var i=Sl.env(t+"_"),o=[e],s=[];function a(u){if(!(s.indexOf(u)>=0)){var l=Sl.file(u);l&&(o.push(n(l)),s.push(u))}}return MI||[fa(qI,t,"config"),fa(qI,t+"rc")].forEach(a),xl&&[fa(xl,".config",t,"config"),fa(xl,".config",t),fa(xl,"."+t,"config"),fa(xl,"."+t+"rc")].forEach(a),a(Sl.find("."+t+"rc")),i.config&&a(i.config),r.config&&a(r.config),Rne.apply(null,o.concat([i,r,s.length?{configs:s,config:s[s.length-1]}:void 0]))}});var GI=y((ipe,zI)=>{var fi=require("constants"),$ne=process.cwd,mh=null,Ine=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return mh||(mh=$ne.call(process)),mh};try{process.cwd()}catch{}typeof process.chdir=="function"&&(Ov=process.chdir,process.chdir=function(t){mh=null,Ov.call(process,t)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,Ov));var Ov;zI.exports=jne;function jne(t){fi.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(c,f,h){h&&process.nextTick(h)},t.lchmodSync=function(){}),t.chown&&!t.lchown&&(t.lchown=function(c,f,h,d){d&&process.nextTick(d)},t.lchownSync=function(){}),Ine==="win32"&&(t.rename=typeof t.rename!="function"?t.rename:function(c){function f(h,d,m){var b=Date.now(),D=0;c(h,d,function _(F){if(F&&(F.code==="EACCES"||F.code==="EPERM")&&Date.now()-b<6e4){setTimeout(function(){t.stat(d,function(g,C){g&&g.code==="ENOENT"?c(h,d,_):m(F)})},D),D<100&&(D+=10);return}m&&m(F)})}return Object.setPrototypeOf&&Object.setPrototypeOf(f,c),f}(t.rename)),t.read=typeof t.read!="function"?t.read:function(c){function f(h,d,m,b,D,_){var F;if(_&&typeof _=="function"){var g=0;F=function(C,A,T){if(C&&C.code==="EAGAIN"&&g<10)return g++,c.call(t,h,d,m,b,D,F);_.apply(this,arguments)}}return c.call(t,h,d,m,b,D,F)}return Object.setPrototypeOf&&Object.setPrototypeOf(f,c),f}(t.read),t.readSync=typeof t.readSync!="function"?t.readSync:function(c){return function(f,h,d,m,b){for(var D=0;;)try{return c.call(t,f,h,d,m,b)}catch(_){if(_.code==="EAGAIN"&&D<10){D++;continue}throw _}}}(t.readSync);function e(c){c.lchmod=function(f,h,d){c.open(f,fi.O_WRONLY|fi.O_SYMLINK,h,function(m,b){if(m){d&&d(m);return}c.fchmod(b,h,function(D){c.close(b,function(_){d&&d(D||_)})})})},c.lchmodSync=function(f,h){var d=c.openSync(f,fi.O_WRONLY|fi.O_SYMLINK,h),m=!0,b;try{b=c.fchmodSync(d,h),m=!1}finally{if(m)try{c.closeSync(d)}catch{}else c.closeSync(d)}return b}}function r(c){fi.hasOwnProperty("O_SYMLINK")&&c.futimes?(c.lutimes=function(f,h,d,m){c.open(f,fi.O_SYMLINK,function(b,D){if(b){m&&m(b);return}c.futimes(D,h,d,function(_){c.close(D,function(F){m&&m(_||F)})})})},c.lutimesSync=function(f,h,d){var m=c.openSync(f,fi.O_SYMLINK),b,D=!0;try{b=c.futimesSync(m,h,d),D=!1}finally{if(D)try{c.closeSync(m)}catch{}else c.closeSync(m)}return b}):c.futimes&&(c.lutimes=function(f,h,d,m){m&&process.nextTick(m)},c.lutimesSync=function(){})}function n(c){return c&&function(f,h,d){return c.call(t,f,h,function(m){l(m)&&(m=null),d&&d.apply(this,arguments)})}}function i(c){return c&&function(f,h){try{return c.call(t,f,h)}catch(d){if(!l(d))throw d}}}function o(c){return c&&function(f,h,d,m){return c.call(t,f,h,d,function(b){l(b)&&(b=null),m&&m.apply(this,arguments)})}}function s(c){return c&&function(f,h,d){try{return c.call(t,f,h,d)}catch(m){if(!l(m))throw m}}}function a(c){return c&&function(f,h,d){typeof h=="function"&&(d=h,h=null);function m(b,D){D&&(D.uid<0&&(D.uid+=4294967296),D.gid<0&&(D.gid+=4294967296)),d&&d.apply(this,arguments)}return h?c.call(t,f,h,m):c.call(t,f,m)}}function u(c){return c&&function(f,h){var d=h?c.call(t,f,h):c.call(t,f);return d&&(d.uid<0&&(d.uid+=4294967296),d.gid<0&&(d.gid+=4294967296)),d}}function l(c){if(!c||c.code==="ENOSYS")return!0;var f=!process.getuid||process.getuid()!==0;return!!(f&&(c.code==="EINVAL"||c.code==="EPERM"))}}});var YI=y((ope,KI)=>{var WI=require("stream").Stream;KI.exports=Nne;function Nne(t){return{ReadStream:e,WriteStream:r};function e(n,i){if(!(this instanceof e))return new e(n,i);WI.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 l=s[a];this[l]=i[l]}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(c,f){if(c){o.emit("error",c),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);WI.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 XI=y((spe,JI)=>{"use strict";JI.exports=Bne;var Lne=Object.getPrototypeOf||function(t){return t.__proto__};function Bne(t){if(t===null||typeof t!="object")return t;if(t instanceof Object)var e={__proto__:Lne(t)};else var e=Object.create(null);return Object.getOwnPropertyNames(t).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}});var tj=y((ape,Tv)=>{var Ke=require("fs"),qne=GI(),Mne=YI(),Une=XI(),gh=require("util"),_t,Dh;typeof Symbol=="function"&&typeof Symbol.for=="function"?(_t=Symbol.for("graceful-fs.queue"),Dh=Symbol.for("graceful-fs.previous")):(_t="___graceful-fs.queue",Dh="___graceful-fs.previous");function Hne(){}function ej(t,e){Object.defineProperty(t,_t,{get:function(){return e}})}var yo=Hne;gh.debuglog?yo=gh.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(yo=function(){var t=gh.format.apply(gh,arguments);t="GFS4: "+t.split(/\n/).join(`
|
|
199
|
+
GFS4: `),console.error(t)});Ke[_t]||(ZI=global[_t]||[],ej(Ke,ZI),Ke.close=function(t){function e(r,n){return t.call(Ke,r,function(i){i||QI(),typeof n=="function"&&n.apply(this,arguments)})}return Object.defineProperty(e,Dh,{value:t}),e}(Ke.close),Ke.closeSync=function(t){function e(r){t.apply(Ke,arguments),QI()}return Object.defineProperty(e,Dh,{value:t}),e}(Ke.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){yo(Ke[_t]),require("assert").equal(Ke[_t].length,0)}));var ZI;global[_t]||ej(global,Ke[_t]);Tv.exports=Av(Une(Ke));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!Ke.__patched&&(Tv.exports=Av(Ke),Ke.__patched=!0);function Av(t){qne(t),t.gracefulify=Av,t.createReadStream=A,t.createWriteStream=T;var e=t.readFile;t.readFile=r;function r(S,I,$){return typeof I=="function"&&($=I,I=null),B(S,I,$);function B(q,K,V,E){return e(q,K,function(v){v&&(v.code==="EMFILE"||v.code==="ENFILE")?da([B,[q,K,V],v,E||Date.now(),Date.now()]):typeof V=="function"&&V.apply(this,arguments)})}}var n=t.writeFile;t.writeFile=i;function i(S,I,$,B){return typeof $=="function"&&(B=$,$=null),q(S,I,$,B);function q(K,V,E,v,w){return n(K,V,E,function(O){O&&(O.code==="EMFILE"||O.code==="ENFILE")?da([q,[K,V,E,v],O,w||Date.now(),Date.now()]):typeof v=="function"&&v.apply(this,arguments)})}}var o=t.appendFile;o&&(t.appendFile=s);function s(S,I,$,B){return typeof $=="function"&&(B=$,$=null),q(S,I,$,B);function q(K,V,E,v,w){return o(K,V,E,function(O){O&&(O.code==="EMFILE"||O.code==="ENFILE")?da([q,[K,V,E,v],O,w||Date.now(),Date.now()]):typeof v=="function"&&v.apply(this,arguments)})}}var a=t.copyFile;a&&(t.copyFile=u);function u(S,I,$,B){return typeof $=="function"&&(B=$,$=0),q(S,I,$,B);function q(K,V,E,v,w){return a(K,V,E,function(O){O&&(O.code==="EMFILE"||O.code==="ENFILE")?da([q,[K,V,E,v],O,w||Date.now(),Date.now()]):typeof v=="function"&&v.apply(this,arguments)})}}var l=t.readdir;t.readdir=f;var c=/^v[0-5]\./;function f(S,I,$){typeof I=="function"&&($=I,I=null);var B=c.test(process.version)?function(V,E,v,w){return l(V,q(V,E,v,w))}:function(V,E,v,w){return l(V,E,q(V,E,v,w))};return B(S,I,$);function q(K,V,E,v){return function(w,O){w&&(w.code==="EMFILE"||w.code==="ENFILE")?da([B,[K,V,E],w,v||Date.now(),Date.now()]):(O&&O.sort&&O.sort(),typeof E=="function"&&E.call(this,w,O))}}}if(process.version.substr(0,4)==="v0.8"){var h=Mne(t);_=h.ReadStream,g=h.WriteStream}var d=t.ReadStream;d&&(_.prototype=Object.create(d.prototype),_.prototype.open=F);var m=t.WriteStream;m&&(g.prototype=Object.create(m.prototype),g.prototype.open=C),Object.defineProperty(t,"ReadStream",{get:function(){return _},set:function(S){_=S},enumerable:!0,configurable:!0}),Object.defineProperty(t,"WriteStream",{get:function(){return g},set:function(S){g=S},enumerable:!0,configurable:!0});var b=_;Object.defineProperty(t,"FileReadStream",{get:function(){return b},set:function(S){b=S},enumerable:!0,configurable:!0});var D=g;Object.defineProperty(t,"FileWriteStream",{get:function(){return D},set:function(S){D=S},enumerable:!0,configurable:!0});function _(S,I){return this instanceof _?(d.apply(this,arguments),this):_.apply(Object.create(_.prototype),arguments)}function F(){var S=this;L(S.path,S.flags,S.mode,function(I,$){I?(S.autoClose&&S.destroy(),S.emit("error",I)):(S.fd=$,S.emit("open",$),S.read())})}function g(S,I){return this instanceof g?(m.apply(this,arguments),this):g.apply(Object.create(g.prototype),arguments)}function C(){var S=this;L(S.path,S.flags,S.mode,function(I,$){I?(S.destroy(),S.emit("error",I)):(S.fd=$,S.emit("open",$))})}function A(S,I){return new t.ReadStream(S,I)}function T(S,I){return new t.WriteStream(S,I)}var x=t.open;t.open=L;function L(S,I,$,B){return typeof $=="function"&&(B=$,$=null),q(S,I,$,B);function q(K,V,E,v,w){return x(K,V,E,function(O,j){O&&(O.code==="EMFILE"||O.code==="ENFILE")?da([q,[K,V,E,v],O,w||Date.now(),Date.now()]):typeof v=="function"&&v.apply(this,arguments)})}}return t}function da(t){yo("ENQUEUE",t[0].name,t[1]),Ke[_t].push(t),kv()}var yh;function QI(){for(var t=Date.now(),e=0;e<Ke[_t].length;++e)Ke[_t][e].length>2&&(Ke[_t][e][3]=t,Ke[_t][e][4]=t);kv()}function kv(){if(clearTimeout(yh),yh=void 0,Ke[_t].length!==0){var t=Ke[_t].shift(),e=t[0],r=t[1],n=t[2],i=t[3],o=t[4];if(i===void 0)yo("RETRY",e.name,r),e.apply(null,r);else if(Date.now()-i>=6e4){yo("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),l=Math.min(u*1.2,100);a>=l?(yo("RETRY",e.name,r),e.apply(null,r.concat([i]))):Ke[_t].push(t)}yh===void 0&&(yh=setTimeout(kv,0))}}});var rj=y(ha=>{"use strict";var Vne=ha&&ha.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ha,"__esModule",{value:!0});ha.readCAFileSync=void 0;var zne=Vne(tj());function Gne(t){try{let e=zne.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}}ha.readCAFileSync=Gne});var nj=y(Do=>{"use strict";var Wne=Do&&Do.__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]}),Kne=Do&&Do.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Wne(e,t,r)};Object.defineProperty(Do,"__esModule",{value:!0});Kne(rj(),Do)});var sj=y((cpe,oj)=>{oj.exports=ij;function vo(t,e){if(typeof Object.setPrototypeOf=="function")return Object.setPrototypeOf(t,e);t.__proto__=e}function ij(){this.list=[];var t=null;Object.defineProperty(this,"root",{get:function(){return t},set:function(e){t=e,this.list.length&&vo(this.list[this.list.length-1],e)},enumerable:!0,configurable:!0})}ij.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&&vo(this.list[this.list.length-1],t),vo(t,this.root),this.list.push(t)},pop:function(){return this.list.length>=2&&vo(this.list[this.list.length-2],this.root),this.list.pop()},unshift:function(t){return vo(t,this.list[0]||this.root),this.list.unshift(t)},shift:function(){return this.list.length===1&&vo(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++)vo(this.list[e],this.list[e+1]||this.root);return t}}});var cj=y(bo=>{bo.parse=bo.decode=Yne;bo.stringify=bo.encode=aj;bo.safe=pa;bo.unsafe=vh;var Pv=typeof process<"u"&&process.platform==="win32"?`\r
|
|
200
200
|
`:`
|
|
201
|
-
`;function
|
|
202
|
-
`}):u&&typeof u=="object"?r.push(o):n+=pa(o)+i+pa(u)+Pv}),e.section&&n.length&&(n="["+pa(e.section)+"]"+Pv+n),r.forEach(function(o,s,a){var u=aj(o).join("\\."),l=(e.section?e.section+".":"")+u,c=sj(t[o],{section:l,whitespace:e.whitespace});n.length&&c.length&&(n+=Pv),n+=c}),n}function aj(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 Kne(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 l=s.match(i);if(l){if(l[1]!==void 0){if(n=vh(l[1]),n==="__proto__"){r={};return}r=e[n]=e[n]||{};return}var c=vh(l[2]);if(c!=="__proto__"){var f=l[3]?vh(l[4]):!0;switch(f){case"true":case"false":case"null":f=JSON.parse(f)}if(c.length>2&&c.slice(-2)==="[]"){if(c=c.substring(0,c.length-2),c==="__proto__")return;r[c]?Array.isArray(r[c])||(r[c]=[r[c]]):r[c]=[]}Array.isArray(r[c])?r[c].push(f):r[c]=f}}}}),Object.keys(e).filter(function(s,a,u){if(!e[s]||typeof e[s]!="object"||Array.isArray(e[s]))return!1;var l=aj(s),c=e,f=l.pop(),h=f.replace(/\\\./g,".");return l.forEach(function(d,m,b){d!=="__proto__"&&((!c[d]||typeof c[d]!="object")&&(c[d]={}),c=c[d])}),c===e&&h===f?!1:(c[h]=e[s],!0)}).forEach(function(s,a,u){delete e[s]}),e}function uj(t){return t.charAt(0)==='"'&&t.slice(-1)==='"'||t.charAt(0)==="'"&&t.slice(-1)==="'"}function pa(t){return typeof t!="string"||t.match(/[=\r\n]/)||t.match(/^\[/)||t.length>1&&uj(t)||t!==t.trim()?JSON.stringify(t):t.replace(/;/g,"\\;").replace(/#/g,"\\#")}function vh(t,e){if(t=(t||"").trim(),uj(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 hj=y((An,dj)=>{var cj=oj(),Fl=require("path"),bh=require("fs"),Rv=lj(),$v=require("events").EventEmitter,Yne=require("url"),Jne=require("http"),An=dj.exports=function(){for(var t=[].slice.call(arguments),e=new At;t.length;){var r=t.shift();r&&e.push(typeof r=="string"?Zne(r):r)}return e},lpe=An.find=function(){var t=Fl.join.apply(null,[].slice.call(arguments));function e(r,n){var i=Fl.join(r,n);try{return bh.statSync(i),i}catch{if(Fl.dirname(r)!==r)return e(Fl.dirname(r),n)}}return e(__dirname,t)},Xne=An.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 Rv.parse(t);else try{return JSON.parse(t)}catch{return Rv.parse(t)}},Zne=An.json=function(){var t=[].slice.call(arguments).filter(function(n){return n!=null}),e=Fl.join.apply(null,t),r;try{r=bh.readFileSync(e,"utf-8")}catch{return}return Xne(r,e,"json")},cpe=An.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};An.ConfigChain=At;function At(){$v.apply(this),cj.apply(this,arguments),this._awaiting=0,this._saving=0,this.sources={}}var fj={constructor:{value:At}};Object.keys($v.prototype).forEach(function(t){fj[t]=Object.getOwnPropertyDescriptor($v.prototype,t)});At.prototype=Object.create(cj.prototype,fj);At.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};At.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};At.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]};At.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=Rv.stringify(s),this._saving++,bh.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};At.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(),bh.readFile(t,"utf8",function(i,o){i&&this.emit("error",i),this.addString(o,t,e,n)}.bind(this)),this};At.prototype.addEnv=function(t,e,r){r=r||"env";var n=An.env(t,e);return this.sources[r]={data:n,source:e,prefix:t},this.add(n,r)};At.prototype.addUrl=function(t,e,r){this._await();var n=Yne.format(t);r=r||n;var i={__source__:r};return this.sources[r]={href:n,type:e},this.push(i),Jne.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};At.prototype.addString=function(t,e,r,n){return t=this.parse(t,e,r),this.add(t,n),this};At.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};At.prototype.parse=An.parse;At.prototype._await=function(){this._awaiting++};At.prototype._resolve=function(){this._awaiting--,this._awaiting===0&&this.emit("load",this)}});var mj=y((fpe,pj)=>{pj.exports=function(t){let e=t.indexOf(":");if(e===-1)return Iv(t);let r=t.substr(0,e),n=t.substr(e+1);return`${Iv(r)}:${Iv(n)}`};function Iv(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 gj=y(wh=>{"use strict";Object.defineProperty(wh,"__esModule",{value:!0});wh.envReplace=void 0;var Qne=/(?<!\\)(\\*)\$\{([^${}]+)\}/g;function eie(t,e){return t.replace(Qne,tie.bind(null,e))}wh.envReplace=eie;function tie(t,e,r,n){if(r.length%2)return e.slice((r.length+1)/2);let i=nie(t,n);if(i===void 0)throw new Error(`Failed to replace env in config: ${e}`);return`${r.slice(r.length/2)}${i}`}var rie=/([^:-]+)(:?)-(.+)/;function nie(t,e){let r=e.match(rie);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 yj=y(_h=>{"use strict";Object.defineProperty(_h,"__esModule",{value:!0});_h.envReplace=void 0;var iie=gj();Object.defineProperty(_h,"envReplace",{enumerable:!0,get:function(){return iie.envReplace}})});var Dj=y(Ol=>{"use strict";var oie=require("fs"),wo=require("path"),{envReplace:jv}=yj(),sie=t=>typeof t!="string"?t:jv(t,process.env),aie=(t,e,r)=>{if(typeof e!="string")return e;let n=[].concat(t[r]),i=n.indexOf(wo)!==-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=jv(e,process.env),i&&((process.platform==="win32"?/^~(\/|\\)/:/^~\//).test(e)&&process.env.HOME&&(e=wo.resolve(process.env.HOME,e.substr(2))),e=wo.resolve(e)),a&&!isNaN(e)&&(e=Number(e)),e},uie=t=>{t=wo.resolve(t);let e=!1;for(;wo.basename(t)==="node_modules";)t=wo.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=oie.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=wo.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)};Ol.envReplace=jv;Ol.findPrefix=uie;Ol.parseField=aie;Ol.parseKey=sie});var wj=y(bj=>{"use strict";var _o=require("path"),lie=require("stream").Stream,Eh=require("url"),cie=()=>{},fie=()=>[],vj=()=>{};bj.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:_o,cache:_o,"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:_o,"global-style":Boolean,group:[Number,String],"https-proxy":[null,Eh],"user-agent":String,"ham-it-up":Boolean,heading:String,"if-present":Boolean,"ignore-prepublish":Boolean,"ignore-scripts":Boolean,"init-module":_o,"init-author-name":String,"init-author-email":String,"init-author-url":["",Eh],"init-license":String,"init-version":vj,json:Boolean,key:[null,String],"legacy-bundling":Boolean,link:Boolean,"local-address":fie(),loglevel:["silent","error","warn","notice","http","timing","info","verbose","silly"],logstream:lie,"logs-max":Number,long:Boolean,maxsockets:Number,message:String,"metrics-registry":[null,String],"node-options":[null,String],"node-version":[null,vj],"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:_o,production:Boolean,progress:Boolean,proxy:[null,!1,Eh],provenance:Boolean,"read-only":Boolean,"rebuild-bundle":Boolean,registry:[null,Eh],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:_o,unicode:Boolean,"unsafe-perm":Boolean,usage:Boolean,user:[Number,String],userconfig:_o,umask:cie,version:Boolean,"tag-version-prefix":String,versions:Boolean,viewer:String,_exit:Boolean}});var Cj=y((gpe,Ej)=>{"use strict";var{readCAFileSync:die}=rj(),_j=require("fs"),Nv=require("path"),{ConfigChain:hie}=hj(),pie=mj(),Lv=Dj(),Bv=class extends hie{constructor(e,r){super(e),this.root=e,this._parseField=Lv.parseField.bind(null,r||wj())}add(e,r){try{for(let[n,i]of Object.entries(e)){let o=Lv.parseKey(n);o!==n&&delete e[n],e[o]=this._parseField(i,o)}}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=_j.readFileSync(e,"utf8");this.addString(i,e,"ini",n)}catch(i){if(i.code==="ENOENT")this.add({},n);else if(i.code!=="EISDIR")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=>{if(!e[n])return;let i=pie(n.substr(11)),o=e[n];r[i]=mie(i,o)}),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:()=>Nv.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=Nv.resolve(e.prefix);else try{r=Lv.findPrefix(process.cwd())}catch(n){throw n}return r}loadCAFile(e){if(!e)return;let r=die(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=Nv.resolve(this.get("prefix"));try{let n=_j.statSync(r);e.user=n.uid}catch(n){if(n.code==="ENOENT")return;throw n}}};function mie(t,e){function r(n){let i=`
|
|
201
|
+
`;function aj(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(l){n+=pa(o+"[]")+i+pa(l)+`
|
|
202
|
+
`}):u&&typeof u=="object"?r.push(o):n+=pa(o)+i+pa(u)+Pv}),e.section&&n.length&&(n="["+pa(e.section)+"]"+Pv+n),r.forEach(function(o,s,a){var u=uj(o).join("\\."),l=(e.section?e.section+".":"")+u,c=aj(t[o],{section:l,whitespace:e.whitespace});n.length&&c.length&&(n+=Pv),n+=c}),n}function uj(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 Yne(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 l=s.match(i);if(l){if(l[1]!==void 0){if(n=vh(l[1]),n==="__proto__"){r={};return}r=e[n]=e[n]||{};return}var c=vh(l[2]);if(c!=="__proto__"){var f=l[3]?vh(l[4]):!0;switch(f){case"true":case"false":case"null":f=JSON.parse(f)}if(c.length>2&&c.slice(-2)==="[]"){if(c=c.substring(0,c.length-2),c==="__proto__")return;r[c]?Array.isArray(r[c])||(r[c]=[r[c]]):r[c]=[]}Array.isArray(r[c])?r[c].push(f):r[c]=f}}}}),Object.keys(e).filter(function(s,a,u){if(!e[s]||typeof e[s]!="object"||Array.isArray(e[s]))return!1;var l=uj(s),c=e,f=l.pop(),h=f.replace(/\\\./g,".");return l.forEach(function(d,m,b){d!=="__proto__"&&((!c[d]||typeof c[d]!="object")&&(c[d]={}),c=c[d])}),c===e&&h===f?!1:(c[h]=e[s],!0)}).forEach(function(s,a,u){delete e[s]}),e}function lj(t){return t.charAt(0)==='"'&&t.slice(-1)==='"'||t.charAt(0)==="'"&&t.slice(-1)==="'"}function pa(t){return typeof t!="string"||t.match(/[=\r\n]/)||t.match(/^\[/)||t.length>1&&lj(t)||t!==t.trim()?JSON.stringify(t):t.replace(/;/g,"\\;").replace(/#/g,"\\#")}function vh(t,e){if(t=(t||"").trim(),lj(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 pj=y((An,hj)=>{var fj=sj(),Fl=require("path"),bh=require("fs"),Rv=cj(),$v=require("events").EventEmitter,Jne=require("url"),Xne=require("http"),An=hj.exports=function(){for(var t=[].slice.call(arguments),e=new At;t.length;){var r=t.shift();r&&e.push(typeof r=="string"?Qne(r):r)}return e},dpe=An.find=function(){var t=Fl.join.apply(null,[].slice.call(arguments));function e(r,n){var i=Fl.join(r,n);try{return bh.statSync(i),i}catch{if(Fl.dirname(r)!==r)return e(Fl.dirname(r),n)}}return e(__dirname,t)},Zne=An.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 Rv.parse(t);else try{return JSON.parse(t)}catch{return Rv.parse(t)}},Qne=An.json=function(){var t=[].slice.call(arguments).filter(function(n){return n!=null}),e=Fl.join.apply(null,t),r;try{r=bh.readFileSync(e,"utf-8")}catch{return}return Zne(r,e,"json")},hpe=An.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};An.ConfigChain=At;function At(){$v.apply(this),fj.apply(this,arguments),this._awaiting=0,this._saving=0,this.sources={}}var dj={constructor:{value:At}};Object.keys($v.prototype).forEach(function(t){dj[t]=Object.getOwnPropertyDescriptor($v.prototype,t)});At.prototype=Object.create(fj.prototype,dj);At.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};At.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};At.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]};At.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=Rv.stringify(s),this._saving++,bh.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};At.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(),bh.readFile(t,"utf8",function(i,o){i&&this.emit("error",i),this.addString(o,t,e,n)}.bind(this)),this};At.prototype.addEnv=function(t,e,r){r=r||"env";var n=An.env(t,e);return this.sources[r]={data:n,source:e,prefix:t},this.add(n,r)};At.prototype.addUrl=function(t,e,r){this._await();var n=Jne.format(t);r=r||n;var i={__source__:r};return this.sources[r]={href:n,type:e},this.push(i),Xne.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};At.prototype.addString=function(t,e,r,n){return t=this.parse(t,e,r),this.add(t,n),this};At.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};At.prototype.parse=An.parse;At.prototype._await=function(){this._awaiting++};At.prototype._resolve=function(){this._awaiting--,this._awaiting===0&&this.emit("load",this)}});var gj=y((ppe,mj)=>{mj.exports=function(t){let e=t.indexOf(":");if(e===-1)return Iv(t);let r=t.substr(0,e),n=t.substr(e+1);return`${Iv(r)}:${Iv(n)}`};function Iv(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 yj=y(wh=>{"use strict";Object.defineProperty(wh,"__esModule",{value:!0});wh.envReplace=void 0;var eie=/(?<!\\)(\\*)\$\{([^${}]+)\}/g;function tie(t,e){return t.replace(eie,rie.bind(null,e))}wh.envReplace=tie;function rie(t,e,r,n){if(r.length%2)return e.slice((r.length+1)/2);let i=iie(t,n);if(i===void 0)throw new Error(`Failed to replace env in config: ${e}`);return`${r.slice(r.length/2)}${i}`}var nie=/([^:-]+)(:?)-(.+)/;function iie(t,e){let r=e.match(nie);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 Dj=y(_h=>{"use strict";Object.defineProperty(_h,"__esModule",{value:!0});_h.envReplace=void 0;var oie=yj();Object.defineProperty(_h,"envReplace",{enumerable:!0,get:function(){return oie.envReplace}})});var vj=y(Ol=>{"use strict";var sie=require("fs"),wo=require("path"),{envReplace:jv}=Dj(),aie=t=>typeof t!="string"?t:jv(t,process.env),uie=(t,e,r)=>{if(typeof e!="string")return e;let n=[].concat(t[r]),i=n.indexOf(wo)!==-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=jv(e,process.env),i&&((process.platform==="win32"?/^~(\/|\\)/:/^~\//).test(e)&&process.env.HOME&&(e=wo.resolve(process.env.HOME,e.substr(2))),e=wo.resolve(e)),a&&!isNaN(e)&&(e=Number(e)),e},lie=t=>{t=wo.resolve(t);let e=!1;for(;wo.basename(t)==="node_modules";)t=wo.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=sie.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=wo.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)};Ol.envReplace=jv;Ol.findPrefix=lie;Ol.parseField=uie;Ol.parseKey=aie});var _j=y(wj=>{"use strict";var _o=require("path"),cie=require("stream").Stream,Eh=require("url"),fie=()=>{},die=()=>[],bj=()=>{};wj.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:_o,cache:_o,"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:_o,"global-style":Boolean,group:[Number,String],"https-proxy":[null,Eh],"user-agent":String,"ham-it-up":Boolean,heading:String,"if-present":Boolean,"ignore-prepublish":Boolean,"ignore-scripts":Boolean,"init-module":_o,"init-author-name":String,"init-author-email":String,"init-author-url":["",Eh],"init-license":String,"init-version":bj,json:Boolean,key:[null,String],"legacy-bundling":Boolean,link:Boolean,"local-address":die(),loglevel:["silent","error","warn","notice","http","timing","info","verbose","silly"],logstream:cie,"logs-max":Number,long:Boolean,maxsockets:Number,message:String,"metrics-registry":[null,String],"node-options":[null,String],"node-version":[null,bj],"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:_o,production:Boolean,progress:Boolean,proxy:[null,!1,Eh],provenance:Boolean,"read-only":Boolean,"rebuild-bundle":Boolean,registry:[null,Eh],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:_o,unicode:Boolean,"unsafe-perm":Boolean,usage:Boolean,user:[Number,String],userconfig:_o,umask:fie,version:Boolean,"tag-version-prefix":String,versions:Boolean,viewer:String,_exit:Boolean}});var Sj=y((vpe,Cj)=>{"use strict";var{readCAFileSync:hie}=nj(),Ej=require("fs"),Nv=require("path"),{ConfigChain:pie}=pj(),mie=gj(),Lv=vj(),Bv=class extends pie{constructor(e,r){super(e),this.root=e,this._parseField=Lv.parseField.bind(null,r||_j())}add(e,r){try{for(let[n,i]of Object.entries(e)){let o=Lv.parseKey(n);o!==n&&delete e[n],e[o]=this._parseField(i,o)}}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=Ej.readFileSync(e,"utf8");this.addString(i,e,"ini",n)}catch(i){if(i.code==="ENOENT")this.add({},n);else if(i.code!=="EISDIR")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=>{if(!e[n])return;let i=mie(n.substr(11)),o=e[n];r[i]=gie(i,o)}),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:()=>Nv.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=Nv.resolve(e.prefix);else try{r=Lv.findPrefix(process.cwd())}catch(n){throw n}return r}loadCAFile(e){if(!e)return;let r=hie(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=Nv.resolve(this.get("prefix"));try{let n=Ej.statSync(r);e.user=n.uid}catch(n){if(n.code==="ENOENT")return;throw n}}};function gie(t,e){function r(n){let i=`
|
|
203
203
|
|
|
204
|
-
`;return n.indexOf(i)?n.split(i):n.split(",")}switch(t){case"hoist-pattern":case"public-hoist-pattern":return r(e)}return e}Ej.exports=Bv});var kj=y(Aj=>{"use strict";var Fj=require("os"),kn=require("path"),Oj=Fj.tmpdir(),gie=process.getuid?process.getuid():process.pid,yie=()=>!0,Sj=process.platform==="win32",xj={editor:()=>process.env.EDITOR||process.env.VISUAL||(Sj?"notepad.exe":"vi"),shell:()=>Sj?process.env.COMSPEC||"cmd.exe":process.env.SHELL||"/bin/bash"},Die={fromString:()=>process.umask()},ma=Fj.homedir();ma?process.env.HOME=ma:ma=kn.resolve(Oj,"npm-"+gie);var vie=process.platform==="win32"?"npm-cache":".npm",bie=process.platform==="win32"&&process.env.APPDATA||ma,wie=kn.resolve(bie,vie),Ch,Eo;Object.defineProperty(Aj,"defaults",{get:function(){return Ch||(process.env.PREFIX?Eo=process.env.PREFIX:process.platform==="win32"?Eo=kn.dirname(process.execPath):(Eo=kn.dirname(kn.dirname(process.execPath)),process.env.DESTDIR&&(Eo=kn.join(process.env.DESTDIR,Eo))),Ch={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:wie,"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:xj.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:kn.resolve(Eo,"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":kn.resolve(ma,".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:Eo,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:xj.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:Oj,unicode:yie(),"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:kn.resolve(ma,".npmrc"),umask:process.umask?process.umask():Die.fromString("022"),version:!1,versions:!1,viewer:process.platform==="win32"?"browser":"man",_exit:!0},Ch)}})});var Pj=y((Dpe,qv)=>{"use strict";var Co=require("path"),_ie=Cj(),Tj=kj();qv.exports=(t,e,r)=>{let n=new _ie(Object.assign({},Tj.defaults,r),e);n.add(Object.assign({},t),"cli");let i=[],o=!1;if(require.resolve.paths){let l=require.resolve.paths("npm"),c;try{c=require.resolve("npm",{paths:l.slice(-1)})}catch{o=!0}c&&i.push(n.addFile(Co.resolve(Co.dirname(c),"..","npmrc"),"builtin"))}n.addEnv(),n.loadPrefix();let s=Co.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 l=Co.resolve(n.get("workspace-prefix"),".npmrc");i.push(n.addFile(l,"workspace"))}if(i.push(n.addFile(n.get("userconfig"),"user")),n.get("prefix")){let l=Co.resolve(n.get("prefix"),"etc");n.root.globalconfig=Co.resolve(l,"npmrc"),n.root.globalignorefile=Co.resolve(l,"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(qv.exports,"defaults",{get(){return Tj.defaults},enumerable:!0})});var qj=y((vpe,Bj)=>{var Mv=require("url"),Rj=Pj(),$j=":_authToken",Ij=":_auth",jj=":username",Nj=":_password";Bj.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]}}:Rj()).config,e=e||r.npmrc.get("registry")||Rj.defaults.registry,Lj(e,r)||Eie(r.npmrc)};function Lj(t,e){let r=Mv.parse(t,!1,!0),n;for(;n!=="/"&&r.pathname!==n;){n=r.pathname||"/";let i="//"+r.host+n.replace(/\/$/,""),o=Sie(i,e.npmrc);if(o)return o;if(!e.recursive)return/\/$/.test(t)?void 0:Lj(Mv.resolve(t,"."),e);r.pathname=Mv.resolve(Cie(n),"..")||"/"}}function Eie(t){return t.get("_auth")?{token:Sh(t.get("_auth")),type:"Basic"}:void 0}function Cie(t){return t[t.length-1]==="/"?t:t+"/"}function Sie(t,e){let r=xie(e.get(t+$j)||e.get(t+"/"+$j));if(r)return r;let n=e.get(t+jj)||e.get(t+"/"+jj),i=e.get(t+Nj)||e.get(t+"/"+Nj),o=Fie(n,i);if(o)return o;let s=Oie(e.get(t+Ij)||e.get(t+"/"+Ij));if(s)return s}function Sh(t){return t.replace(/^\$\{?([^}]*)\}?$/,function(e,r){return process.env[r]})}function xie(t){return t?{token:Sh(t),type:"Bearer"}:void 0}function Fie(t,e){if(!t||!e)return;let r=Buffer.from(Sh(e),"base64").toString("utf8");return{token:Buffer.from(t+":"+r,"utf8").toString("base64"),type:"Basic",password:r,username:t}}function Oie(t){return t?{token:Sh(t),type:"Basic"}:void 0}});var P8=y((g0e,jn)=>{var ot=require("fs"),wb=require("os"),ur=require("path"),y8=require("crypto"),sn={fs:ot.constants,os:wb.constants},D8="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",b8=/XXXXXX/,voe=3,w8=(sn.O_CREAT||sn.fs.O_CREAT)|(sn.O_EXCL||sn.fs.O_EXCL)|(sn.O_RDWR||sn.fs.O_RDWR),boe=wb.platform()==="win32",woe=sn.EBADF||sn.os.errno.EBADF,_oe=sn.ENOENT||sn.os.errno.ENOENT,_8=448,E8=384,Eoe="exit",Sa=[],C8=ot.rmdirSync.bind(ot),S8=!1;function Coe(t,e){return ot.rm(t,{recursive:!0},e)}function x8(t){return ot.rmSync(t,{recursive:!0})}function _b(t,e){let r=xa(t,e),n=r[0],i=r[1];try{A8(n)}catch(s){return i(s)}let o=n.tries;(function s(){try{let a=O8(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 Eb(t){let e=xa(t),r=e[0];A8(r);let n=r.tries;do{let i=O8(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 Soe(t,e){let r=xa(t,e),n=r[0],i=r[1];_b(n,function(s,a){if(s)return i(s);ot.open(a,w8,n.mode||E8,function(l,c){if(l)return i(l);if(n.discardDescriptor)return ot.close(c,function(h){return i(h,a,void 0,Db(a,-1,n,!1))});{let f=n.discardDescriptor||n.detachDescriptor;i(null,a,c,Db(a,f?-1:c,n,!1))}})})}function xoe(t){let e=xa(t),r=e[0],n=r.discardDescriptor||r.detachDescriptor,i=Eb(r);var o=ot.openSync(i,w8,r.mode||E8);return r.discardDescriptor&&(ot.closeSync(o),o=void 0),{name:i,fd:o,removeCallback:Db(i,n?-1:o,r,!0)}}function Foe(t,e){let r=xa(t,e),n=r[0],i=r[1];_b(n,function(s,a){if(s)return i(s);ot.mkdir(a,n.mode||_8,function(l){if(l)return i(l);i(null,a,F8(a,n,!1))})})}function Ooe(t){let e=xa(t),r=e[0],n=Eb(r);return ot.mkdirSync(n,r.mode||_8),{name:n,removeCallback:F8(n,r,!0)}}function Aoe(t,e){let r=function(n){if(n&&!bb(n))return e(n);e()};0<=t[0]?ot.close(t[0],function(){ot.unlink(t[1],r)}):ot.unlink(t[1],r)}function koe(t){let e=null;try{0<=t[0]&&ot.closeSync(t[0])}catch(r){if(!Roe(r)&&!bb(r))throw r}finally{try{ot.unlinkSync(t[1])}catch(r){bb(r)||(e=r)}}if(e!==null)throw e}function Db(t,e,r,n){let i=Vh(koe,[e,t],n),o=Vh(Aoe,[e,t],n,i);return r.keep||Sa.unshift(i),n?i:o}function F8(t,e,r){let n=e.unsafeCleanup?Coe:ot.rmdir.bind(ot),i=e.unsafeCleanup?x8:C8,o=Vh(i,t,r),s=Vh(n,t,r,o);return e.keep||Sa.unshift(o),r?o:s}function Vh(t,e,r,n){let i=!1;return function o(s){if(!i){let a=n||o,u=Sa.indexOf(a);return u>=0&&Sa.splice(u,1),i=!0,r||t===C8||t===x8?t(e):t(e,s||function(){})}}}function Toe(){if(S8)for(;Sa.length;)try{Sa[0]()}catch{}}function v8(t){let e=[],r=null;try{r=y8.randomBytes(t)}catch{r=y8.pseudoRandomBytes(t)}for(var n=0;n<t;n++)e.push(D8[r[n]%D8.length]);return e.join("")}function Poe(t){return t===null||Zt(t)||!t.trim()}function Zt(t){return typeof t>"u"}function xa(t,e){if(typeof t=="function")return[{},t];if(Zt(t))return[{},e];let r={};for(let n of Object.getOwnPropertyNames(t))r[n]=t[n];return[r,e]}function O8(t){let e=t.tmpdir;if(!Zt(t.name))return ur.join(e,t.dir,t.name);if(!Zt(t.template))return ur.join(e,t.dir,t.template).replace(b8,v8(6));let r=[t.prefix?t.prefix:"tmp","-",process.pid,"-",v8(12),t.postfix?"-"+t.postfix:""].join("");return ur.join(e,t.dir,r)}function A8(t){t.tmpdir=T8(t);let e=t.tmpdir;if(Zt(t.name)||yb(t.name,"name",e),Zt(t.dir)||yb(t.dir,"dir",e),!Zt(t.template)&&(yb(t.template,"template",e),!t.template.match(b8)))throw new Error(`Invalid template, found "${t.template}".`);if(!Zt(t.tries)&&isNaN(t.tries)||t.tries<0)throw new Error(`Invalid tries, found "${t.tries}".`);t.tries=Zt(t.name)?t.tries||voe:1,t.keep=!!t.keep,t.detachDescriptor=!!t.detachDescriptor,t.discardDescriptor=!!t.discardDescriptor,t.unsafeCleanup=!!t.unsafeCleanup,t.dir=Zt(t.dir)?"":ur.relative(e,vb(t.dir,e)),t.template=Zt(t.template)?void 0:ur.relative(e,vb(t.template,e)),t.template=Poe(t.template)?void 0:ur.relative(t.dir,t.template),t.name=Zt(t.name)?void 0:t.name,t.prefix=Zt(t.prefix)?"":t.prefix,t.postfix=Zt(t.postfix)?"":t.postfix}function vb(t,e){return t.startsWith(e)?ur.resolve(t):ur.resolve(ur.join(e,t))}function yb(t,e,r){if(e==="name"){if(ur.isAbsolute(t))throw new Error(`${e} option must not contain an absolute path, found "${t}".`);let n=ur.basename(t);if(n===".."||n==="."||n!==t)throw new Error(`${e} option must not contain a path, found "${t}".`)}else{if(ur.isAbsolute(t)&&!t.startsWith(r))throw new Error(`${e} option must be relative to "${r}", found "${t}".`);let n=vb(t,r);if(!n.startsWith(r))throw new Error(`${e} option must be relative to "${r}", found "${n}".`)}}function Roe(t){return k8(t,-woe,"EBADF")}function bb(t){return k8(t,-_oe,"ENOENT")}function k8(t,e,r){return boe?t.code===r:t.code===r&&t.errno===e}function $oe(){S8=!0}function T8(t){return ur.resolve(t&&t.tmpdir||wb.tmpdir())}process.addListener(Eoe,Toe);Object.defineProperty(jn.exports,"tmpdir",{enumerable:!0,configurable:!1,get:function(){return T8()}});jn.exports.dir=Foe;jn.exports.dirSync=Ooe;jn.exports.file=Soe;jn.exports.fileSync=xoe;jn.exports.tmpName=_b;jn.exports.tmpNameSync=Eb;jn.exports.setGracefulCleanup=$oe});var Ub=ue(Mb(),1),{program:k,createCommand:ase,createArgument:use,createOption:lse,CommanderError:cse,InvalidArgumentError:fse,InvalidOptionArgumentError:dse,Command:hse,Argument:pse,Option:mse,Help:gse}=Ub.default;var Cr={name:"@capgo/cli",version:"7.0.17-beta.2",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":"^4.1.1","@bradenmacdonald/s3-lite-client":"npm:@jsr/bradenmacdonald__s3-lite-client","@capacitor/cli":"^7.0.1","@capgo/find-package-manager":"^0.0.17","@clack/prompts":"^0.10.0","@sauber/table":"npm:@jsr/sauber__table","@std/semver":"npm:@jsr/std__semver","@supabase/supabase-js":"^2.48.1","@tomasklaen/checksum":"^1.1.0","@types/adm-zip":"^0.5.7","@types/node":"^22.13.1","@types/prettyjson":"^0.0.33","@types/semver":"^7.5.8","@types/tmp":"^0.2.6","@vercel/ncc":"^0.38.3","adm-zip":"^0.5.16","ci-info":"^4.1.0",commander:"13.0.0",esbuild:"^0.25.0",eslint:"9.20.1","git-format-staged":"3.1.1",husky:"^9.1.7","is-wsl":"^3.1.0",ky:"^1.7.4","latest-version":"^9.0.0",open:"^10.1.0",pkg:"5.8.1",prettyjson:"^1.2.5",semver:"^7.7.1",tmp:"^0.2.3","ts-loader":"^9.5.2","ts-node":"^10.9.2","tsconfig-paths":"4.2.0","tus-js-client":"^4.3.1",typescript:"5.7.3"}};var ga=require("node:fs"),Hj=require("node:process");var St=ue(Te(),1),Io=require("node:process"),Ln=ue(require("node:readline"),1),yp=ue(require("node:readline"),1),Qb=require("node:tty"),ew=ue(pp(),1);function gN({onlyFirst:t=!1}={}){let e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");return new RegExp(e,t?void 0:"g")}var yN=gN();function tw(t){if(typeof t!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);return t.replace(yN,"")}function rw(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),l=0;l<u.length;l++){var c=u[l],f=e.length(c);if(a>=i-(f==2?1:0))if(a+f<=o)s+=c;else break;a+=f}return s}})(nw);var DN=nw.exports,vN=rw(DN),bN=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},wN=rw(bN);function ka(t,e={}){if(typeof t!="string"||t.length===0||(e={ambiguousIsNarrow:!0,...e},t=tw(t),t.length===0))return 0;t=t.replace(wN()," ");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(vN.eastAsianWidth(i)){case"F":case"W":n+=2;break;case"A":n+=r;break;default:n+=1}}return n}var mp=10,Gb=(t=0)=>e=>`\x1B[${e+t}m`,Wb=(t=0)=>e=>`\x1B[${38+t};5;${e}m`,Kb=(t=0)=>(e,r,n)=>`\x1B[${38+t};2;${e};${r};${n}m`,Ne={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(Ne.modifier);var _N=Object.keys(Ne.color),EN=Object.keys(Ne.bgColor);[..._N,...EN];function CN(){let t=new Map;for(let[e,r]of Object.entries(Ne)){for(let[n,i]of Object.entries(r))Ne[n]={open:`\x1B[${i[0]}m`,close:`\x1B[${i[1]}m`},r[n]=Ne[n],t.set(i[0],i[1]);Object.defineProperty(Ne,e,{value:r,enumerable:!1})}return Object.defineProperty(Ne,"codes",{value:t,enumerable:!1}),Ne.color.close="\x1B[39m",Ne.bgColor.close="\x1B[49m",Ne.color.ansi=Gb(),Ne.color.ansi256=Wb(),Ne.color.ansi16m=Kb(),Ne.bgColor.ansi=Gb(mp),Ne.bgColor.ansi256=Wb(mp),Ne.bgColor.ansi16m=Kb(mp),Object.defineProperties(Ne,{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=>Ne.rgbToAnsi256(...Ne.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)=>Ne.ansi256ToAnsi(Ne.rgbToAnsi256(e,r,n)),enumerable:!1},hexToAnsi:{value:e=>Ne.ansi256ToAnsi(Ne.hexToAnsi256(e)),enumerable:!1}}),Ne}var SN=CN(),ec=new Set(["\x1B","\x9B"]),xN=39,vp="\x07",iw="[",FN="]",ow="m",bp=`${FN}8;;`,Yb=t=>`${ec.values().next().value}${iw}${t}${ow}`,Jb=t=>`${ec.values().next().value}${bp}${t}${vp}`,ON=t=>t.split(" ").map(e=>ka(e)),gp=(t,e,r)=>{let n=[...e],i=!1,o=!1,s=ka(tw(t[t.length-1]));for(let[a,u]of n.entries()){let l=ka(u);if(s+l<=r?t[t.length-1]+=u:(t.push(u),s=0),ec.has(u)&&(i=!0,o=n.slice(a+1).join("").startsWith(bp)),i){o?u===vp&&(i=!1,o=!1):u===ow&&(i=!1);continue}s+=l,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())},AN=t=>{let e=t.split(" "),r=e.length;for(;r>0&&!(ka(e[r-1])>0);)r--;return r===e.length?t:e.slice(0,r).join(" ")+e.slice(r).join("")},kN=(t,e,r={})=>{if(r.trim!==!1&&t.trim()==="")return"";let n="",i,o,s=ON(t),a=[""];for(let[l,c]of t.split(" ").entries()){r.trim!==!1&&(a[a.length-1]=a[a.length-1].trimStart());let f=ka(a[a.length-1]);if(l!==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[l]>e){let h=e-f,d=1+Math.floor((s[l]-h-1)/e);Math.floor((s[l]-1)/e)<d&&a.push(""),gp(a,c,e);continue}if(f+s[l]>e&&f>0&&s[l]>0){if(r.wordWrap===!1&&f<e){gp(a,c,e);continue}a.push("")}if(f+s[l]>e&&r.wordWrap===!1){gp(a,c,e);continue}a[a.length-1]+=c}r.trim!==!1&&(a=a.map(l=>AN(l)));let u=[...a.join(`
|
|
205
|
-
`)];for(let[l,c]of u.entries()){if(n+=c,ec.has(c)){let{groups:h}=new RegExp(`(?:\\${
|
|
206
|
-
`?(o&&(n+=
|
|
207
|
-
`&&(i&&f&&(n+=
|
|
204
|
+
`;return n.indexOf(i)?n.split(i):n.split(",")}switch(t){case"hoist-pattern":case"public-hoist-pattern":return r(e)}return e}Cj.exports=Bv});var Tj=y(kj=>{"use strict";var Oj=require("os"),kn=require("path"),Aj=Oj.tmpdir(),yie=process.getuid?process.getuid():process.pid,Die=()=>!0,xj=process.platform==="win32",Fj={editor:()=>process.env.EDITOR||process.env.VISUAL||(xj?"notepad.exe":"vi"),shell:()=>xj?process.env.COMSPEC||"cmd.exe":process.env.SHELL||"/bin/bash"},vie={fromString:()=>process.umask()},ma=Oj.homedir();ma?process.env.HOME=ma:ma=kn.resolve(Aj,"npm-"+yie);var bie=process.platform==="win32"?"npm-cache":".npm",wie=process.platform==="win32"&&process.env.APPDATA||ma,_ie=kn.resolve(wie,bie),Ch,Eo;Object.defineProperty(kj,"defaults",{get:function(){return Ch||(process.env.PREFIX?Eo=process.env.PREFIX:process.platform==="win32"?Eo=kn.dirname(process.execPath):(Eo=kn.dirname(kn.dirname(process.execPath)),process.env.DESTDIR&&(Eo=kn.join(process.env.DESTDIR,Eo))),Ch={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:_ie,"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:Fj.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:kn.resolve(Eo,"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":kn.resolve(ma,".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:Eo,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:Fj.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:Aj,unicode:Die(),"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:kn.resolve(ma,".npmrc"),umask:process.umask?process.umask():vie.fromString("022"),version:!1,versions:!1,viewer:process.platform==="win32"?"browser":"man",_exit:!0},Ch)}})});var Rj=y((wpe,qv)=>{"use strict";var Co=require("path"),Eie=Sj(),Pj=Tj();qv.exports=(t,e,r)=>{let n=new Eie(Object.assign({},Pj.defaults,r),e);n.add(Object.assign({},t),"cli");let i=[],o=!1;if(require.resolve.paths){let l=require.resolve.paths("npm"),c;try{c=require.resolve("npm",{paths:l.slice(-1)})}catch{o=!0}c&&i.push(n.addFile(Co.resolve(Co.dirname(c),"..","npmrc"),"builtin"))}n.addEnv(),n.loadPrefix();let s=Co.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 l=Co.resolve(n.get("workspace-prefix"),".npmrc");i.push(n.addFile(l,"workspace"))}if(i.push(n.addFile(n.get("userconfig"),"user")),n.get("prefix")){let l=Co.resolve(n.get("prefix"),"etc");n.root.globalconfig=Co.resolve(l,"npmrc"),n.root.globalignorefile=Co.resolve(l,"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(qv.exports,"defaults",{get(){return Pj.defaults},enumerable:!0})});var Mj=y((_pe,qj)=>{var Mv=require("url"),$j=Rj(),Ij=":_authToken",jj=":_auth",Nj=":username",Lj=":_password";qj.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]}}:$j()).config,e=e||r.npmrc.get("registry")||$j.defaults.registry,Bj(e,r)||Cie(r.npmrc)};function Bj(t,e){let r=Mv.parse(t,!1,!0),n;for(;n!=="/"&&r.pathname!==n;){n=r.pathname||"/";let i="//"+r.host+n.replace(/\/$/,""),o=xie(i,e.npmrc);if(o)return o;if(!e.recursive)return/\/$/.test(t)?void 0:Bj(Mv.resolve(t,"."),e);r.pathname=Mv.resolve(Sie(n),"..")||"/"}}function Cie(t){return t.get("_auth")?{token:Sh(t.get("_auth")),type:"Basic"}:void 0}function Sie(t){return t[t.length-1]==="/"?t:t+"/"}function xie(t,e){let r=Fie(e.get(t+Ij)||e.get(t+"/"+Ij));if(r)return r;let n=e.get(t+Nj)||e.get(t+"/"+Nj),i=e.get(t+Lj)||e.get(t+"/"+Lj),o=Oie(n,i);if(o)return o;let s=Aie(e.get(t+jj)||e.get(t+"/"+jj));if(s)return s}function Sh(t){return t.replace(/^\$\{?([^}]*)\}?$/,function(e,r){return process.env[r]})}function Fie(t){return t?{token:Sh(t),type:"Bearer"}:void 0}function Oie(t,e){if(!t||!e)return;let r=Buffer.from(Sh(e),"base64").toString("utf8");return{token:Buffer.from(t+":"+r,"utf8").toString("base64"),type:"Basic",password:r,username:t}}function Aie(t){return t?{token:Sh(t),type:"Basic"}:void 0}});var R8=y((v0e,jn)=>{var ot=require("fs"),_b=require("os"),ur=require("path"),D8=require("crypto"),sn={fs:ot.constants,os:_b.constants},v8="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",w8=/XXXXXX/,_oe=3,_8=(sn.O_CREAT||sn.fs.O_CREAT)|(sn.O_EXCL||sn.fs.O_EXCL)|(sn.O_RDWR||sn.fs.O_RDWR),Eoe=_b.platform()==="win32",Coe=sn.EBADF||sn.os.errno.EBADF,Soe=sn.ENOENT||sn.os.errno.ENOENT,E8=448,C8=384,xoe="exit",Sa=[],S8=ot.rmdirSync.bind(ot),x8=!1;function Foe(t,e){return ot.rm(t,{recursive:!0},e)}function F8(t){return ot.rmSync(t,{recursive:!0})}function Eb(t,e){let r=xa(t,e),n=r[0],i=r[1];try{k8(n)}catch(s){return i(s)}let o=n.tries;(function s(){try{let a=A8(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 Cb(t){let e=xa(t),r=e[0];k8(r);let n=r.tries;do{let i=A8(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 Ooe(t,e){let r=xa(t,e),n=r[0],i=r[1];Eb(n,function(s,a){if(s)return i(s);ot.open(a,_8,n.mode||C8,function(l,c){if(l)return i(l);if(n.discardDescriptor)return ot.close(c,function(h){return i(h,a,void 0,vb(a,-1,n,!1))});{let f=n.discardDescriptor||n.detachDescriptor;i(null,a,c,vb(a,f?-1:c,n,!1))}})})}function Aoe(t){let e=xa(t),r=e[0],n=r.discardDescriptor||r.detachDescriptor,i=Cb(r);var o=ot.openSync(i,_8,r.mode||C8);return r.discardDescriptor&&(ot.closeSync(o),o=void 0),{name:i,fd:o,removeCallback:vb(i,n?-1:o,r,!0)}}function koe(t,e){let r=xa(t,e),n=r[0],i=r[1];Eb(n,function(s,a){if(s)return i(s);ot.mkdir(a,n.mode||E8,function(l){if(l)return i(l);i(null,a,O8(a,n,!1))})})}function Toe(t){let e=xa(t),r=e[0],n=Cb(r);return ot.mkdirSync(n,r.mode||E8),{name:n,removeCallback:O8(n,r,!0)}}function Poe(t,e){let r=function(n){if(n&&!wb(n))return e(n);e()};0<=t[0]?ot.close(t[0],function(){ot.unlink(t[1],r)}):ot.unlink(t[1],r)}function Roe(t){let e=null;try{0<=t[0]&&ot.closeSync(t[0])}catch(r){if(!joe(r)&&!wb(r))throw r}finally{try{ot.unlinkSync(t[1])}catch(r){wb(r)||(e=r)}}if(e!==null)throw e}function vb(t,e,r,n){let i=Vh(Roe,[e,t],n),o=Vh(Poe,[e,t],n,i);return r.keep||Sa.unshift(i),n?i:o}function O8(t,e,r){let n=e.unsafeCleanup?Foe:ot.rmdir.bind(ot),i=e.unsafeCleanup?F8:S8,o=Vh(i,t,r),s=Vh(n,t,r,o);return e.keep||Sa.unshift(o),r?o:s}function Vh(t,e,r,n){let i=!1;return function o(s){if(!i){let a=n||o,u=Sa.indexOf(a);return u>=0&&Sa.splice(u,1),i=!0,r||t===S8||t===F8?t(e):t(e,s||function(){})}}}function $oe(){if(x8)for(;Sa.length;)try{Sa[0]()}catch{}}function b8(t){let e=[],r=null;try{r=D8.randomBytes(t)}catch{r=D8.pseudoRandomBytes(t)}for(var n=0;n<t;n++)e.push(v8[r[n]%v8.length]);return e.join("")}function Ioe(t){return t===null||Zt(t)||!t.trim()}function Zt(t){return typeof t>"u"}function xa(t,e){if(typeof t=="function")return[{},t];if(Zt(t))return[{},e];let r={};for(let n of Object.getOwnPropertyNames(t))r[n]=t[n];return[r,e]}function A8(t){let e=t.tmpdir;if(!Zt(t.name))return ur.join(e,t.dir,t.name);if(!Zt(t.template))return ur.join(e,t.dir,t.template).replace(w8,b8(6));let r=[t.prefix?t.prefix:"tmp","-",process.pid,"-",b8(12),t.postfix?"-"+t.postfix:""].join("");return ur.join(e,t.dir,r)}function k8(t){t.tmpdir=P8(t);let e=t.tmpdir;if(Zt(t.name)||Db(t.name,"name",e),Zt(t.dir)||Db(t.dir,"dir",e),!Zt(t.template)&&(Db(t.template,"template",e),!t.template.match(w8)))throw new Error(`Invalid template, found "${t.template}".`);if(!Zt(t.tries)&&isNaN(t.tries)||t.tries<0)throw new Error(`Invalid tries, found "${t.tries}".`);t.tries=Zt(t.name)?t.tries||_oe:1,t.keep=!!t.keep,t.detachDescriptor=!!t.detachDescriptor,t.discardDescriptor=!!t.discardDescriptor,t.unsafeCleanup=!!t.unsafeCleanup,t.dir=Zt(t.dir)?"":ur.relative(e,bb(t.dir,e)),t.template=Zt(t.template)?void 0:ur.relative(e,bb(t.template,e)),t.template=Ioe(t.template)?void 0:ur.relative(t.dir,t.template),t.name=Zt(t.name)?void 0:t.name,t.prefix=Zt(t.prefix)?"":t.prefix,t.postfix=Zt(t.postfix)?"":t.postfix}function bb(t,e){return t.startsWith(e)?ur.resolve(t):ur.resolve(ur.join(e,t))}function Db(t,e,r){if(e==="name"){if(ur.isAbsolute(t))throw new Error(`${e} option must not contain an absolute path, found "${t}".`);let n=ur.basename(t);if(n===".."||n==="."||n!==t)throw new Error(`${e} option must not contain a path, found "${t}".`)}else{if(ur.isAbsolute(t)&&!t.startsWith(r))throw new Error(`${e} option must be relative to "${r}", found "${t}".`);let n=bb(t,r);if(!n.startsWith(r))throw new Error(`${e} option must be relative to "${r}", found "${n}".`)}}function joe(t){return T8(t,-Coe,"EBADF")}function wb(t){return T8(t,-Soe,"ENOENT")}function T8(t,e,r){return Eoe?t.code===r:t.code===r&&t.errno===e}function Noe(){x8=!0}function P8(t){return ur.resolve(t&&t.tmpdir||_b.tmpdir())}process.addListener(xoe,$oe);Object.defineProperty(jn.exports,"tmpdir",{enumerable:!0,configurable:!1,get:function(){return P8()}});jn.exports.dir=koe;jn.exports.dirSync=Toe;jn.exports.file=Ooe;jn.exports.fileSync=Aoe;jn.exports.tmpName=Eb;jn.exports.tmpNameSync=Cb;jn.exports.setGracefulCleanup=Noe});var Hb=ue(Ub(),1),{program:k,createCommand:cse,createArgument:fse,createOption:dse,CommanderError:hse,InvalidArgumentError:pse,InvalidOptionArgumentError:mse,Command:gse,Argument:yse,Option:Dse,Help:vse}=Hb.default;var Cr={name:"@capgo/cli",version:"7.0.17-beta.3",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":"^4.1.1","@bradenmacdonald/s3-lite-client":"npm:@jsr/bradenmacdonald__s3-lite-client","@capacitor/cli":"^7.0.1","@capgo/find-package-manager":"^0.0.17","@clack/prompts":"^0.10.0","@sauber/table":"npm:@jsr/sauber__table","@std/semver":"npm:@jsr/std__semver","@supabase/supabase-js":"^2.48.1","@tomasklaen/checksum":"^1.1.0","@types/adm-zip":"^0.5.7","@types/node":"^22.13.1","@types/prettyjson":"^0.0.33","@types/semver":"^7.5.8","@types/tmp":"^0.2.6","@vercel/ncc":"^0.38.3","adm-zip":"^0.5.16","ci-info":"^4.1.0",commander:"13.0.0",esbuild:"^0.25.0",eslint:"9.20.1","git-format-staged":"3.1.1",husky:"^9.1.7","is-wsl":"^3.1.0",ky:"^1.7.4","latest-version":"^9.0.0",open:"^10.1.0",pkg:"5.8.1",prettyjson:"^1.2.5",semver:"^7.7.1",tmp:"^0.2.3","ts-loader":"^9.5.2","ts-node":"^10.9.2","tsconfig-paths":"4.2.0","tus-js-client":"^4.3.1",typescript:"5.7.3"}};var ga=require("node:fs"),Vj=require("node:process");var St=ue(Te(),1),Io=require("node:process"),Ln=ue(require("node:readline"),1),yp=ue(require("node:readline"),1),ew=require("node:tty"),tw=ue(pp(),1);function yN({onlyFirst:t=!1}={}){let e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");return new RegExp(e,t?void 0:"g")}var DN=yN();function rw(t){if(typeof t!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);return t.replace(DN,"")}function nw(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var iw={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),l=0;l<u.length;l++){var c=u[l],f=e.length(c);if(a>=i-(f==2?1:0))if(a+f<=o)s+=c;else break;a+=f}return s}})(iw);var vN=iw.exports,bN=nw(vN),wN=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},_N=nw(wN);function ka(t,e={}){if(typeof t!="string"||t.length===0||(e={ambiguousIsNarrow:!0,...e},t=rw(t),t.length===0))return 0;t=t.replace(_N()," ");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(bN.eastAsianWidth(i)){case"F":case"W":n+=2;break;case"A":n+=r;break;default:n+=1}}return n}var mp=10,Wb=(t=0)=>e=>`\x1B[${e+t}m`,Kb=(t=0)=>e=>`\x1B[${38+t};5;${e}m`,Yb=(t=0)=>(e,r,n)=>`\x1B[${38+t};2;${e};${r};${n}m`,Ne={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(Ne.modifier);var EN=Object.keys(Ne.color),CN=Object.keys(Ne.bgColor);[...EN,...CN];function SN(){let t=new Map;for(let[e,r]of Object.entries(Ne)){for(let[n,i]of Object.entries(r))Ne[n]={open:`\x1B[${i[0]}m`,close:`\x1B[${i[1]}m`},r[n]=Ne[n],t.set(i[0],i[1]);Object.defineProperty(Ne,e,{value:r,enumerable:!1})}return Object.defineProperty(Ne,"codes",{value:t,enumerable:!1}),Ne.color.close="\x1B[39m",Ne.bgColor.close="\x1B[49m",Ne.color.ansi=Wb(),Ne.color.ansi256=Kb(),Ne.color.ansi16m=Yb(),Ne.bgColor.ansi=Wb(mp),Ne.bgColor.ansi256=Kb(mp),Ne.bgColor.ansi16m=Yb(mp),Object.defineProperties(Ne,{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=>Ne.rgbToAnsi256(...Ne.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)=>Ne.ansi256ToAnsi(Ne.rgbToAnsi256(e,r,n)),enumerable:!1},hexToAnsi:{value:e=>Ne.ansi256ToAnsi(Ne.hexToAnsi256(e)),enumerable:!1}}),Ne}var xN=SN(),ec=new Set(["\x1B","\x9B"]),FN=39,vp="\x07",ow="[",ON="]",sw="m",bp=`${ON}8;;`,Jb=t=>`${ec.values().next().value}${ow}${t}${sw}`,Xb=t=>`${ec.values().next().value}${bp}${t}${vp}`,AN=t=>t.split(" ").map(e=>ka(e)),gp=(t,e,r)=>{let n=[...e],i=!1,o=!1,s=ka(rw(t[t.length-1]));for(let[a,u]of n.entries()){let l=ka(u);if(s+l<=r?t[t.length-1]+=u:(t.push(u),s=0),ec.has(u)&&(i=!0,o=n.slice(a+1).join("").startsWith(bp)),i){o?u===vp&&(i=!1,o=!1):u===sw&&(i=!1);continue}s+=l,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())},kN=t=>{let e=t.split(" "),r=e.length;for(;r>0&&!(ka(e[r-1])>0);)r--;return r===e.length?t:e.slice(0,r).join(" ")+e.slice(r).join("")},TN=(t,e,r={})=>{if(r.trim!==!1&&t.trim()==="")return"";let n="",i,o,s=AN(t),a=[""];for(let[l,c]of t.split(" ").entries()){r.trim!==!1&&(a[a.length-1]=a[a.length-1].trimStart());let f=ka(a[a.length-1]);if(l!==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[l]>e){let h=e-f,d=1+Math.floor((s[l]-h-1)/e);Math.floor((s[l]-1)/e)<d&&a.push(""),gp(a,c,e);continue}if(f+s[l]>e&&f>0&&s[l]>0){if(r.wordWrap===!1&&f<e){gp(a,c,e);continue}a.push("")}if(f+s[l]>e&&r.wordWrap===!1){gp(a,c,e);continue}a[a.length-1]+=c}r.trim!==!1&&(a=a.map(l=>kN(l)));let u=[...a.join(`
|
|
205
|
+
`)];for(let[l,c]of u.entries()){if(n+=c,ec.has(c)){let{groups:h}=new RegExp(`(?:\\${ow}(?<code>\\d+)m|\\${bp}(?<uri>.*)${vp})`).exec(u.slice(l).join(""))||{groups:{}};if(h.code!==void 0){let d=Number.parseFloat(h.code);i=d===FN?void 0:d}else h.uri!==void 0&&(o=h.uri.length===0?void 0:h.uri)}let f=xN.codes.get(Number(i));u[l+1]===`
|
|
206
|
+
`?(o&&(n+=Xb("")),i&&f&&(n+=Jb(f))):c===`
|
|
207
|
+
`&&(i&&f&&(n+=Jb(i)),o&&(n+=Xb(o)))}return n};function Zb(t,e,r){return String(t).normalize().replace(/\r\n/g,`
|
|
208
208
|
`).split(`
|
|
209
|
-
`).map(n=>
|
|
210
|
-
`)}var
|
|
209
|
+
`).map(n=>TN(n,e,r)).join(`
|
|
210
|
+
`)}var PN=["up","down","left","right","space","enter","cancel"],Jl={actions:new Set(PN),aliases:new Map([["k","up"],["j","down"],["h","left"],["l","right"],["","cancel"],["escape","cancel"]])};function wp(t,e){if(typeof t=="string")return Jl.aliases.get(t)===e;for(let r of t)if(r!==void 0&&wp(r,e))return!0;return!1}function RN(t,e){if(t===e)return;let r=t.split(`
|
|
211
211
|
`),n=e.split(`
|
|
212
|
-
`),i=[];for(let o=0;o<Math.max(r.length,n.length);o++)r[o]!==n[o]&&i.push(o);return i}var
|
|
213
|
-
`),Yl(this.input,!1),this.rl?.close(),this.rl=void 0,this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){let e=
|
|
214
|
-
`).length-1;this.output.write(St.cursor.move(-999,e*-1))}render(){let e=
|
|
212
|
+
`),i=[];for(let o=0;o<Math.max(r.length,n.length);o++)r[o]!==n[o]&&i.push(o);return i}var $N=globalThis.process.platform.startsWith("win"),Dp=Symbol("clack:cancel");function st(t){return t===Dp}function Yl(t,e){let r=t;r.isTTY&&r.setRawMode(e)}function aw({input:t=Io.stdin,output:e=Io.stdout,overwrite:r=!0,hideCursor:n=!0}={}){let i=Ln.createInterface({input:t,output:e,prompt:"",tabSize:1});Ln.emitKeypressEvents(t,i),t.isTTY&&t.setRawMode(!0);let o=(s,{name:a,sequence:u})=>{let l=String(s);if(wp([l,a,u],"cancel")){n&&e.write(St.cursor.show),process.exit(0);return}if(!r)return;Ln.moveCursor(e,a==="return"?0:-1,a==="return"?-1:0,()=>{Ln.clearLine(e,1,()=>{t.once("keypress",o)})})};return n&&e.write(St.cursor.hide),t.once("keypress",o),()=>{t.off("keypress",o),n&&e.write(St.cursor.show),t.isTTY&&!$N&&t.setRawMode(!1),i.terminal=!1,i.close()}}var IN=Object.defineProperty,jN=(t,e,r)=>e in t?IN(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Qt=(t,e,r)=>(jN(t,typeof e!="symbol"?e+"":e,r),r),Ta=class{constructor(e,r=!0){Qt(this,"input"),Qt(this,"output"),Qt(this,"_abortSignal"),Qt(this,"rl"),Qt(this,"opts"),Qt(this,"_render"),Qt(this,"_track",!1),Qt(this,"_prevFrame",""),Qt(this,"_subscribers",new Map),Qt(this,"_cursor",0),Qt(this,"state","initial"),Qt(this,"error",""),Qt(this,"value");let{input:n=Io.stdin,output:i=Io.stdout,render:o,signal:s,...a}=e;this.opts=a,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=o.bind(this),this._track=r,this._abortSignal=s,this.input=n,this.output=i}unsubscribe(){this._subscribers.clear()}setSubscriber(e,r){let n=this._subscribers.get(e)??[];n.push(r),this._subscribers.set(e,n)}on(e,r){this.setSubscriber(e,{cb:r})}once(e,r){this.setSubscriber(e,{cb:r,once:!0})}emit(e,...r){let n=this._subscribers.get(e)??[],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()}prompt(){return new Promise((e,r)=>{if(this._abortSignal){if(this._abortSignal.aborted)return this.state="cancel",this.close(),e(Dp);this._abortSignal.addEventListener("abort",()=>{this.state="cancel",this.close()},{once:!0})}let n=new ew.WriteStream(0);n._write=(i,o,s)=>{this._track&&(this.value=this.rl?.line.replace(/\t/g,""),this._cursor=this.rl?.cursor??0,this.emit("value",this.value)),s()},this.input.pipe(n),this.rl=yp.default.createInterface({input:this.input,output:n,tabSize:2,prompt:"",escapeCodeTimeout:50}),yp.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),Yl(this.input,!0),this.output.on("resize",this.render),this.render(),this.once("submit",()=>{this.output.write(St.cursor.show),this.output.off("resize",this.render),Yl(this.input,!1),e(this.value)}),this.once("cancel",()=>{this.output.write(St.cursor.show),this.output.off("resize",this.render),Yl(this.input,!1),e(Dp)})})}onKeypress(e,r){if(this.state==="error"&&(this.state="active"),r?.name&&(!this._track&&Jl.aliases.has(r.name)&&this.emit("cursor",Jl.aliases.get(r.name)),Jl.actions.has(r.name)&&this.emit("cursor",r.name)),e&&(e.toLowerCase()==="y"||e.toLowerCase()==="n")&&this.emit("confirm",e.toLowerCase()==="y"),e===" "&&this.opts.placeholder&&(this.value||(this.rl?.write(this.opts.placeholder),this.emit("value",this.opts.placeholder))),e&&this.emit("key",e.toLowerCase()),r?.name==="return"){if(this.opts.validate){let n=this.opts.validate(this.value);n&&(this.error=n instanceof Error?n.message:n,this.state="error",this.rl?.write(this.value))}this.state!=="error"&&(this.state="submit")}wp([e,r?.name,r?.sequence],"cancel")&&(this.state="cancel"),(this.state==="submit"||this.state==="cancel")&&this.emit("finalize"),this.render(),(this.state==="submit"||this.state==="cancel")&&this.close()}close(){this.input.unpipe(),this.input.removeListener("keypress",this.onKeypress),this.output.write(`
|
|
213
|
+
`),Yl(this.input,!1),this.rl?.close(),this.rl=void 0,this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){let e=Zb(this._prevFrame,process.stdout.columns,{hard:!0}).split(`
|
|
214
|
+
`).length-1;this.output.write(St.cursor.move(-999,e*-1))}render(){let e=Zb(this._render(this)??"",process.stdout.columns,{hard:!0});if(e!==this._prevFrame){if(this.state==="initial")this.output.write(St.cursor.hide);else{let r=RN(this._prevFrame,e);if(this.restoreCursor(),r&&r?.length===1){let n=r[0];this.output.write(St.cursor.move(0,n)),this.output.write(St.erase.lines(1));let i=e.split(`
|
|
215
215
|
`);this.output.write(i[n]),this._prevFrame=e,this.output.write(St.cursor.move(0,i.length-n-1));return}if(r&&r?.length>1){let n=r[0];this.output.write(St.cursor.move(0,n)),this.output.write(St.erase.down());let i=e.split(`
|
|
216
216
|
`).slice(n);this.output.write(i.join(`
|
|
217
|
-
`)),this._prevFrame=e;return}this.output.write(St.erase.down())}this.output.write(e),this.state==="initial"&&(this.state="active"),this._prevFrame=e}}},Xl=class extends Ta{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(St.cursor.move(0,-1)),this.value=r,this.state="submit",this.close()}),this.on("cursor",()=>{this.value=!this.value})}};var
|
|
217
|
+
`)),this._prevFrame=e;return}this.output.write(St.erase.down())}this.output.write(e),this.state==="initial"&&(this.state="active"),this._prevFrame=e}}},Xl=class extends Ta{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(St.cursor.move(0,-1)),this.value=r,this.state="submit",this.close()}),this.on("cursor",()=>{this.value=!this.value})}};var NN=Object.defineProperty,LN=(t,e,r)=>e in t?NN(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Qb=(t,e,r)=>(LN(t,typeof e!="symbol"?e+"":e,r),r),Zl=class extends Ta{constructor(e){super(e,!1),Qb(this,"options"),Qb(this,"cursor",0),this.options=e.options,this.cursor=this.options.findIndex(({value:r})=>r===e.initialValue),this.cursor===-1&&(this.cursor=0),this.changeValue(),this.on("cursor",r=>{switch(r){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 Ql=class extends Ta{get valueWithCursor(){if(this.state==="submit")return this.value;if(this.cursor>=this.value.length)return`${this.value}\u2588`;let e=this.value.slice(0,this.cursor),[r,...n]=this.value.slice(this.cursor);return`${e}${tw.default.inverse(r)}${n.join("")}`}get cursor(){return this._cursor}constructor(e){super(e),this.on("finalize",()=>{this.value||(this.value=e.defaultValue)})}};var cr=ue(require("node:process"),1),U=ue(pp(),1),tc=ue(Te(),1);function BN(){return cr.default.platform!=="win32"?cr.default.env.TERM!=="linux":!!cr.default.env.CI||!!cr.default.env.WT_SESSION||!!cr.default.env.TERMINUS_SUBLIME||cr.default.env.ConEmuTask==="{cmd::Cmder}"||cr.default.env.TERM_PROGRAM==="Terminus-Sublime"||cr.default.env.TERM_PROGRAM==="vscode"||cr.default.env.TERM==="xterm-256color"||cr.default.env.TERM==="alacritty"||cr.default.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var _p=BN(),tt=(t,e)=>_p?t:e,qN=tt("\u25C6","*"),uw=tt("\u25A0","x"),lw=tt("\u25B2","x"),Sp=tt("\u25C7","o"),MN=tt("\u250C","T"),Ue=tt("\u2502","|"),jo=tt("\u2514","\u2014"),Ep=tt("\u25CF",">"),Cp=tt("\u25CB"," "),Tse=tt("\u25FB","[\u2022]"),Pse=tt("\u25FC","[+]"),Rse=tt("\u25FB","[ ]"),$se=tt("\u25AA","\u2022"),Ise=tt("\u2500","-"),jse=tt("\u256E","+"),Nse=tt("\u251C","+"),Lse=tt("\u256F","+"),UN=tt("\u25CF","\u2022"),HN=tt("\u25C6","*"),VN=tt("\u25B2","!"),zN=tt("\u25A0","x"),xp=t=>{switch(t){case"initial":case"active":return U.default.cyan(qN);case"cancel":return U.default.red(uw);case"error":return U.default.yellow(lw);case"submit":return U.default.green(Sp)}},GN=t=>{let{cursor:e,options:r,style:n}=t,i=t.maxItems??Number.POSITIVE_INFINITY,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,l=s<r.length&&a+s<r.length;return r.slice(a,a+s).map((c,f,h)=>{let d=f===0&&u,m=f===h.length-1&&l;return d||m?U.default.dim("..."):n(c,f+a===e)})},rc=t=>new Ql({validate:t.validate,placeholder:t.placeholder,defaultValue:t.defaultValue,initialValue:t.initialValue,render(){let e=`${U.default.gray(Ue)}
|
|
218
218
|
${xp(this.state)} ${t.message}
|
|
219
219
|
`,r=t.placeholder?U.default.inverse(t.placeholder[0])+U.default.dim(t.placeholder.slice(1)):U.default.inverse(U.default.hidden("_")),n=this.value?this.valueWithCursor:r;switch(this.state){case"error":return`${e.trim()}
|
|
220
220
|
${U.default.yellow(Ue)} ${n}
|
|
@@ -230,41 +230,41 @@ ${U.default.cyan(jo)}
|
|
|
230
230
|
`}}}).prompt()},yi=t=>{let e=(r,n)=>{let i=r.label??String(r.value);switch(n){case"selected":return`${U.default.dim(i)}`;case"active":return`${U.default.green(Ep)} ${i} ${r.hint?U.default.dim(`(${r.hint})`):""}`;case"cancelled":return`${U.default.strikethrough(U.default.dim(i))}`;default:return`${U.default.dim(Cp)} ${U.default.dim(i)}`}};return new Zl({options:t.options,initialValue:t.initialValue,render(){let r=`${U.default.gray(Ue)}
|
|
231
231
|
${xp(this.state)} ${t.message}
|
|
232
232
|
`;switch(this.state){case"submit":return`${r}${U.default.gray(Ue)} ${e(this.options[this.cursor],"selected")}`;case"cancel":return`${r}${U.default.gray(Ue)} ${e(this.options[this.cursor],"cancelled")}
|
|
233
|
-
${U.default.gray(Ue)}`;default:return`${r}${U.default.cyan(Ue)} ${
|
|
233
|
+
${U.default.gray(Ue)}`;default:return`${r}${U.default.cyan(Ue)} ${GN({cursor:this.cursor,options:this.options,maxItems:t.maxItems,style:(n,i)=>e(n,i?"active":"inactive")}).join(`
|
|
234
234
|
${U.default.cyan(Ue)} `)}
|
|
235
235
|
${U.default.cyan(jo)}
|
|
236
236
|
`}}}).prompt()};var Di=(t="")=>{process.stdout.write(`${U.default.gray(jo)} ${U.default.red(t)}
|
|
237
237
|
|
|
238
|
-
`)},Z=(t="")=>{process.stdout.write(`${U.default.gray(
|
|
238
|
+
`)},Z=(t="")=>{process.stdout.write(`${U.default.gray(MN)} ${t}
|
|
239
239
|
`)},J=(t="")=>{process.stdout.write(`${U.default.gray(Ue)}
|
|
240
240
|
${U.default.gray(jo)} ${t}
|
|
241
241
|
|
|
242
242
|
`)},p={message:(t="",{symbol:e=U.default.gray(Ue)}={})=>{let r=[`${U.default.gray(Ue)}`];if(t){let[n,...i]=t.split(`
|
|
243
243
|
`);r.push(`${e} ${n}`,...i.map(o=>`${U.default.gray(Ue)} ${o}`))}process.stdout.write(`${r.join(`
|
|
244
244
|
`)}
|
|
245
|
-
`)},info:t=>{p.message(t,{symbol:U.default.blue(
|
|
245
|
+
`)},info:t=>{p.message(t,{symbol:U.default.blue(UN)})},success:t=>{p.message(t,{symbol:U.default.green(HN)})},step:t=>{p.message(t,{symbol:U.default.green(Sp)})},warn:t=>{p.message(t,{symbol:U.default.yellow(VN)})},warning:t=>{p.warn(t)},error:t=>{p.message(t,{symbol:U.default.red(zN)})}},Bse=`${U.default.gray(Ue)} `;var _e=({indicator:t="dots"}={})=>{let e=_p?["\u25D2","\u25D0","\u25D3","\u25D1"]:["\u2022","o","O","0"],r=_p?80:120,n=process.env.CI==="true",i,o,s=!1,a="",u,l=performance.now(),c=C=>{let A=C>1?"Something went wrong":"Canceled";s&&g(A,C)},f=()=>c(2),h=()=>c(1),d=()=>{process.on("uncaughtExceptionMonitor",f),process.on("unhandledRejection",f),process.on("SIGINT",h),process.on("SIGTERM",h),process.on("exit",c)},m=()=>{process.removeListener("uncaughtExceptionMonitor",f),process.removeListener("unhandledRejection",f),process.removeListener("SIGINT",h),process.removeListener("SIGTERM",h),process.removeListener("exit",c)},b=()=>{if(u===void 0)return;n&&process.stdout.write(`
|
|
246
246
|
`);let C=u.split(`
|
|
247
|
-
`);process.stdout.write(tc.cursor.move(-999,C.length-1)),process.stdout.write(tc.erase.down(C.length))},D=C=>C.replace(/\.+$/,""),_=C=>{let A=(performance.now()-C)/1e3,T=Math.floor(A/60),x=Math.floor(A%60);return T>0?`[${T}m ${x}s]`:`[${x}s]`},F=(C="")=>{s=!0,i=
|
|
248
|
-
`);let A=0,T=0;d(),o=setInterval(()=>{if(n&&a===u)return;b(),u=a;let x=U.default.magenta(e[A]);if(n)process.stdout.write(`${x} ${a}...`);else if(t==="timer")process.stdout.write(`${x} ${a} ${_(l)}`);else{let L=".".repeat(Math.floor(T)).slice(0,3);process.stdout.write(`${x} ${a}${L}`)}A=A+1<e.length?A+1:0,T=T<e.length?T+.125:0},r)},g=(C="",A=0)=>{s=!1,clearInterval(o),b();let T=A===0?U.default.green(Sp):A===1?U.default.red(
|
|
247
|
+
`);process.stdout.write(tc.cursor.move(-999,C.length-1)),process.stdout.write(tc.erase.down(C.length))},D=C=>C.replace(/\.+$/,""),_=C=>{let A=(performance.now()-C)/1e3,T=Math.floor(A/60),x=Math.floor(A%60);return T>0?`[${T}m ${x}s]`:`[${x}s]`},F=(C="")=>{s=!0,i=aw(),a=D(C),l=performance.now(),process.stdout.write(`${U.default.gray(Ue)}
|
|
248
|
+
`);let A=0,T=0;d(),o=setInterval(()=>{if(n&&a===u)return;b(),u=a;let x=U.default.magenta(e[A]);if(n)process.stdout.write(`${x} ${a}...`);else if(t==="timer")process.stdout.write(`${x} ${a} ${_(l)}`);else{let L=".".repeat(Math.floor(T)).slice(0,3);process.stdout.write(`${x} ${a}${L}`)}A=A+1<e.length?A+1:0,T=T<e.length?T+.125:0},r)},g=(C="",A=0)=>{s=!1,clearInterval(o),b();let T=A===0?U.default.green(Sp):A===1?U.default.red(uw):U.default.red(lw);a=D(C??a),t==="timer"?process.stdout.write(`${T} ${a} ${_(l)}
|
|
249
249
|
`):process.stdout.write(`${T} ${a}
|
|
250
|
-
`),m(),i()};return{start:F,stop:g,message:(C="")=>{a=D(C??a)}}};var et=require("node:fs"),sh=require("node:os"),Qe=ue(require("node:path")),Nt=require("node:process"),rn=ue(ic());var fn=require("fs"),Ra=(t=".",e="unknown")=>{let r=`${t}/bun.lockb`,n=`${t}/pnpm-lock.yaml`,i=`${t}/yarn.lock`,o=`${t}/package-lock.json`;return(0,fn.existsSync)(r)?"bun":(0,fn.existsSync)(n)?"pnpm":(0,fn.existsSync)(i)?"yarn":(0,fn.existsSync)(o)?"npm":e},oc=(t=Ra(),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"}},lw=(t=".",e="npx")=>{let r=`${t}/bun.lockb`,n=`${t}/pnpm-lock.yaml`,i=`${t}/yarn.lock`,o=`${t}/package-lock.json`;return(0,fn.existsSync)(r)?"bunx":(0,fn.existsSync)(n)?"pnpm exec":(0,fn.existsSync)(i)?"yarn dlx":(0,fn.existsSync)(o)?"npx":e};var na=ue(s_()),Z$=ue(du()),Dv=ue(eC());var Wn=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 ns=class extends Error{request;constructor(e){super(`Request timed out: ${e.method} ${e.url}`),this.name="TimeoutError",this.request=e}};var is=t=>t!==null&&typeof t=="object";var pu=(...t)=>{for(let e of t)if((!is(e)||Array.isArray(e))&&e!==void 0)throw new TypeError("The `options` argument must be an object");return pg({},...t)},dg=(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 zc(t,e,r){return Object.hasOwn(e,r)&&e[r]===void 0?[]:pg(t[r]??[],e[r]??[])}var hg=(t={},e={})=>({beforeRequest:zc(t,e,"beforeRequest"),beforeRetry:zc(t,e,"beforeRetry"),afterResponse:zc(t,e,"afterResponse"),beforeError:zc(t,e,"beforeError")}),pg=(...t)=>{let e={},r={},n={};for(let i of t)if(Array.isArray(i))Array.isArray(e)||(e=[]),e=[...e,...i];else if(is(i)){for(let[o,s]of Object.entries(i))is(s)&&o in e&&(s=pg(e[o],s)),e={...e,[o]:s};is(i.hooks)&&(n=hg(n,i.hooks),e.hooks=n),is(i.headers)&&(r=dg(r,i.headers),e.headers=r)}return e};var tC=(()=>{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})(),rC=typeof globalThis.AbortController=="function",nC=typeof globalThis.ReadableStream=="function",iC=typeof globalThis.FormData=="function",Gc=["get","post","put","patch","head","delete"],e5=()=>{};e5();var oC={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*"},Wc=2147483647,Kc=Symbol("stop"),sC={json:!0,parseJson:!0,stringifyJson:!0,searchParams:!0,prefixUrl:!0,retry:!0,timeout:!0,hooks:!0,throwHttpErrors:!0,onDownloadProgress:!0,fetch:!0},aC={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 lC=t=>Gc.includes(t)?t.toUpperCase():t,t5=["get","put","head","delete","options","trace"],r5=[408,413,429,500,502,503,504],n5=[413,429,503],uC={limit:2,methods:t5,statusCodes:r5,afterStatusCodes:n5,maxRetryAfter:Number.POSITIVE_INFINITY,backoffLimit:Number.POSITIVE_INFINITY,delay:t=>.3*2**(t-1)*1e3},cC=(t={})=>{if(typeof t=="number")return{...uC,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{...uC,...t}};async function mg(t,e,r,n){return new Promise((i,o)=>{let s=setTimeout(()=>{r&&r.abort(),o(new ns(t))},n.timeout);n.fetch(t,e).then(i).catch(o).then(()=>{clearTimeout(s)})})}async function gg(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 fC=(t,e)=>{let r={};for(let n in e)!(n in aC)&&!(n in sC)&&!(n in t)&&(r[n]=e[n]);return r};var mu=class t{static create(e,r){let n=new t(e,r),i=async()=>{if(typeof n._options.timeout=="number"&&n._options.timeout>Wc)throw new RangeError(`The \`timeout\` option cannot be greater than ${Wc}`);await Promise.resolve();let a=await n._fetch();for(let u of n._options.hooks.afterResponse){let l=await u(n.request,n._options,n._decorateResponse(a.clone()));l instanceof globalThis.Response&&(a=l)}if(n._decorateResponse(a),!a.ok&&n._options.throwHttpErrors){let u=new Wn(a,n.request,n._options);for(let l of n._options.hooks.beforeError)u=await l(u);throw u}if(n._options.onDownloadProgress){if(typeof n._options.onDownloadProgress!="function")throw new TypeError("The `onDownloadProgress` option must be a function");if(!nC)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(oC))s[a]=async()=>{n.request.headers.set("accept",n.request.headers.get("accept")||u);let l=await s;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:dg(this._input.headers,r.headers),hooks:hg({beforeRequest:[],beforeRetry:[],beforeError:[],afterResponse:[]},r.hooks),method:lC(r.method??this._input.method),prefixUrl:String(r.prefixUrl||""),retry:cC(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(rC){this.abortController=new globalThis.AbortController;let n=this._options.signal??this._input.signal;n?.aborted&&this.abortController.abort(n?.reason),n?.addEventListener("abort",()=>{this.abortController.abort(n.reason)}),this._options.signal=this.abortController.signal}if(tC&&(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);(iC&&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 ns)throw e;if(e instanceof Wn){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),Wc);if(this._retryCount<1)throw r;await gg(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})===Kc)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=fC(this.request,this._options),r=this.request;return this.request=r.clone(),this._options.timeout===!1?this._options.fetch(r,e):mg(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:l}=await s.read();if(u){o.close();return}if(r){i+=l.byteLength;let c=n===0?0:i/n;r({percent:c,transferredBytes:i,totalBytes:n},l)}o.enqueue(l),await a()}await a()}}),{status:e.status,statusText:e.statusText,headers:e.headers})}};var yg=t=>{let e=(r,n)=>mu.create(r,pu(t,n));for(let r of Gc)e[r]=(n,i)=>mu.create(n,pu(t,i,{method:r}));return e.create=r=>yg(pu(r)),e.extend=r=>(typeof r=="function"&&(r=r(t??{})),yg(pu(t,r))),e.stop=Kc,e},i5=yg(),qr=i5;var Q$=ue(UC()),ah=ue(Ty());var Dl=ue(g$());async function y$(){let t=await(0,Dl.loadConfig)();return{config:t.app.extConfig,path:t.app.extConfigFilePath}}async function ci(t,e=!1){let r=await(0,Dl.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,Dl.writeConfig)(n,r.app.extConfigFilePath))}var ia=".capgo_key",or=".capgo_key_v2",uh=`${ia}.pub`,Fn=`${or}.pub`,W$="https://capgo.app",K$="https://files.capgo.app",Y$="https://api.capgo.app",J$="https://web.capgo.app",eI=12e4,hne=1024*1024*20,pne=1024*1024*1024,mne=1024*1024*99,tI="package.json",oa=/^(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?`
|
|
251
|
-
${
|
|
250
|
+
`),m(),i()};return{start:F,stop:g,message:(C="")=>{a=D(C??a)}}};var et=require("node:fs"),sh=require("node:os"),Qe=ue(require("node:path")),Nt=require("node:process"),rn=ue(ic());var fn=require("fs"),Ra=(t=".",e="unknown")=>{let r=`${t}/bun.lockb`,n=`${t}/pnpm-lock.yaml`,i=`${t}/yarn.lock`,o=`${t}/package-lock.json`;return(0,fn.existsSync)(r)?"bun":(0,fn.existsSync)(n)?"pnpm":(0,fn.existsSync)(i)?"yarn":(0,fn.existsSync)(o)?"npm":e},oc=(t=Ra(),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"}},cw=(t=".",e="npx")=>{let r=`${t}/bun.lockb`,n=`${t}/pnpm-lock.yaml`,i=`${t}/yarn.lock`,o=`${t}/package-lock.json`;return(0,fn.existsSync)(r)?"bunx":(0,fn.existsSync)(n)?"pnpm exec":(0,fn.existsSync)(i)?"yarn dlx":(0,fn.existsSync)(o)?"npx":e};var na=ue(a_()),Q$=ue(du()),Dv=ue(tC());var Wn=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 ns=class extends Error{request;constructor(e){super(`Request timed out: ${e.method} ${e.url}`),this.name="TimeoutError",this.request=e}};var is=t=>t!==null&&typeof t=="object";var pu=(...t)=>{for(let e of t)if((!is(e)||Array.isArray(e))&&e!==void 0)throw new TypeError("The `options` argument must be an object");return pg({},...t)},dg=(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 zc(t,e,r){return Object.hasOwn(e,r)&&e[r]===void 0?[]:pg(t[r]??[],e[r]??[])}var hg=(t={},e={})=>({beforeRequest:zc(t,e,"beforeRequest"),beforeRetry:zc(t,e,"beforeRetry"),afterResponse:zc(t,e,"afterResponse"),beforeError:zc(t,e,"beforeError")}),pg=(...t)=>{let e={},r={},n={};for(let i of t)if(Array.isArray(i))Array.isArray(e)||(e=[]),e=[...e,...i];else if(is(i)){for(let[o,s]of Object.entries(i))is(s)&&o in e&&(s=pg(e[o],s)),e={...e,[o]:s};is(i.hooks)&&(n=hg(n,i.hooks),e.hooks=n),is(i.headers)&&(r=dg(r,i.headers),e.headers=r)}return e};var rC=(()=>{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})(),nC=typeof globalThis.AbortController=="function",iC=typeof globalThis.ReadableStream=="function",oC=typeof globalThis.FormData=="function",Gc=["get","post","put","patch","head","delete"],t5=()=>{};t5();var sC={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*"},Wc=2147483647,Kc=Symbol("stop"),aC={json:!0,parseJson:!0,stringifyJson:!0,searchParams:!0,prefixUrl:!0,retry:!0,timeout:!0,hooks:!0,throwHttpErrors:!0,onDownloadProgress:!0,fetch:!0},uC={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 cC=t=>Gc.includes(t)?t.toUpperCase():t,r5=["get","put","head","delete","options","trace"],n5=[408,413,429,500,502,503,504],i5=[413,429,503],lC={limit:2,methods:r5,statusCodes:n5,afterStatusCodes:i5,maxRetryAfter:Number.POSITIVE_INFINITY,backoffLimit:Number.POSITIVE_INFINITY,delay:t=>.3*2**(t-1)*1e3},fC=(t={})=>{if(typeof t=="number")return{...lC,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{...lC,...t}};async function mg(t,e,r,n){return new Promise((i,o)=>{let s=setTimeout(()=>{r&&r.abort(),o(new ns(t))},n.timeout);n.fetch(t,e).then(i).catch(o).then(()=>{clearTimeout(s)})})}async function gg(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 dC=(t,e)=>{let r={};for(let n in e)!(n in uC)&&!(n in aC)&&!(n in t)&&(r[n]=e[n]);return r};var mu=class t{static create(e,r){let n=new t(e,r),i=async()=>{if(typeof n._options.timeout=="number"&&n._options.timeout>Wc)throw new RangeError(`The \`timeout\` option cannot be greater than ${Wc}`);await Promise.resolve();let a=await n._fetch();for(let u of n._options.hooks.afterResponse){let l=await u(n.request,n._options,n._decorateResponse(a.clone()));l instanceof globalThis.Response&&(a=l)}if(n._decorateResponse(a),!a.ok&&n._options.throwHttpErrors){let u=new Wn(a,n.request,n._options);for(let l of n._options.hooks.beforeError)u=await l(u);throw u}if(n._options.onDownloadProgress){if(typeof n._options.onDownloadProgress!="function")throw new TypeError("The `onDownloadProgress` option must be a function");if(!iC)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(sC))s[a]=async()=>{n.request.headers.set("accept",n.request.headers.get("accept")||u);let l=await s;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:dg(this._input.headers,r.headers),hooks:hg({beforeRequest:[],beforeRetry:[],beforeError:[],afterResponse:[]},r.hooks),method:cC(r.method??this._input.method),prefixUrl:String(r.prefixUrl||""),retry:fC(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(nC){this.abortController=new globalThis.AbortController;let n=this._options.signal??this._input.signal;n?.aborted&&this.abortController.abort(n?.reason),n?.addEventListener("abort",()=>{this.abortController.abort(n.reason)}),this._options.signal=this.abortController.signal}if(rC&&(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);(oC&&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 ns)throw e;if(e instanceof Wn){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),Wc);if(this._retryCount<1)throw r;await gg(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})===Kc)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=dC(this.request,this._options),r=this.request;return this.request=r.clone(),this._options.timeout===!1?this._options.fetch(r,e):mg(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:l}=await s.read();if(u){o.close();return}if(r){i+=l.byteLength;let c=n===0?0:i/n;r({percent:c,transferredBytes:i,totalBytes:n},l)}o.enqueue(l),await a()}await a()}}),{status:e.status,statusText:e.statusText,headers:e.headers})}};var yg=t=>{let e=(r,n)=>mu.create(r,pu(t,n));for(let r of Gc)e[r]=(n,i)=>mu.create(n,pu(t,i,{method:r}));return e.create=r=>yg(pu(r)),e.extend=r=>(typeof r=="function"&&(r=r(t??{})),yg(pu(t,r))),e.stop=Kc,e},o5=yg(),qr=o5;var eI=ue(HC()),ah=ue(Ty());var Dl=ue(y$());async function D$(){let t=await(0,Dl.loadConfig)();return{config:t.app.extConfig,path:t.app.extConfigFilePath}}async function ci(t,e=!1){let r=await(0,Dl.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,Dl.writeConfig)(n,r.app.extConfigFilePath))}var ia=".capgo_key",or=".capgo_key_v2",uh=`${ia}.pub`,Fn=`${or}.pub`,K$="https://capgo.app",Y$="https://files.capgo.app",J$="https://api.capgo.app",X$="https://web.capgo.app",tI=12e4,pne=1024*1024*20,mne=1024*1024*1024,gne=1024*1024*99,rI="package.json",oa=/^(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?`
|
|
251
|
+
${eI.default.render(t)}`:"";function oh(t){return new Promise(e=>{setTimeout(e,t)})}function nI(t){return(0,rn.isMonorepo)(t)||(0,rn.isNXMonorepo)(t)}function On(t){return(0,rn.isMonorepo)(t)?(0,rn.findMonorepoRoot)(t):(0,rn.isNXMonorepo)(t)?(0,rn.findNXMonorepoRoot)(t):t}async function vr(t=On((0,Nt.cwd)()),e=void 0){let r=e?.split(",")[0];r&&((0,et.existsSync)(r)||(p.error(`Package.json at ${r} does not exist`),(0,Nt.exit)(1)));let n=(0,et.readFileSync)(r||(0,Qe.join)(t,rI));return JSON.parse(n)}async function kr(t=On((0,Nt.cwd)()),e=void 0){let r=e?.split(",");if(r||(r=[(0,Qe.join)(t,rI)]),r)for(let i of r)(0,et.existsSync)(i)||(p.error(`Package.json at ${i} does not exist`),(0,Nt.exit)(1));let n=new Map;for(let i of r){let o=(0,et.readFileSync)(i),s=JSON.parse(o);for(let a in s.dependencies)n.set(a,s.dependencies[a]);for(let a in s.devDependencies)n.set(a,s.devDependencies[a])}return n}async function te(){try{let t=await D$();return t||(p.error("No capacitor config file found, run `cap init` first"),k.error("")),t}catch(t){p.error(`No capacitor config file found, run \`cap init\` first ${Q(t)}`),k.error("")}}async function El(t){let e=await te();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},ci(e)),e}async function br(){try{let t=await te(),e={host:t?.config?.plugins?.CapacitorUpdater?.localHost||K$,hostWeb:t?.config?.plugins?.CapacitorUpdater?.localWebHost||X$,hostFilesApi:t?.config?.plugins?.CapacitorUpdater?.localApiFiles||Y$,hostApi:t?.config?.plugins?.CapacitorUpdater?.localApi||J$};return t?.config?.plugins?.CapacitorUpdater?.localSupa&&t?.config?.plugins?.CapacitorUpdater?.localSupaAnon&&(p.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:K$,hostWeb:X$,hostFilesApi:Y$,hostApi:J$}}}var yne=/([A-Za-z0-9]+)\.(java|swift|kt|scala)$/;async function lh(){let t=await br();return qr.get(`${t.hostApi}/private/config`).then(e=>e.json()).then(e=>({...e,...t})).catch(()=>(p.info(`Local config ${Q(t)}`),t))}async function iI(){let t=await br();return qr.get(`${t.hostFilesApi}/files/config`).then(e=>e.json()).catch(()=>({partialUpload:!1,TUSUpload:!1,partialUploadForced:!1,TUSUploadForced:!1,maxUploadLength:mne,maxChunkSize:gne,alertUploadSize:pne}))}async function fe(t){let e=await lh();return(!e.supaHost||!e.supaKey)&&(p.error("Cannot connect to server please try again later"),k.error("")),(0,na.createClient)(e.supaHost,e.supaKey,{auth:{persistSession:!1},global:{headers:{capgkey:t}}})}async function Dne(t,e,r){let{data:n}=await t.rpc("is_allowed_capgkey",{apikey:e,keymode:r}).single();if(!n){p.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("");p.error(`Your key should be: ${i} mode.`),k.error("")}}async function oI(t,e){let{data:r}=await t.rpc("is_paying_org",{orgid:e}).single();return r||!1}async function sI(t,e){let{data:r}=await t.rpc("is_trial_org",{orgid:e}).single();return r||0}async function vne(t,e){let{data:r}=await t.rpc("is_allowed_action_org",{orgid:e}).single();return!!r}async function bne(t,e,r){let{data:n}=await t.rpc("is_allowed_action",{apikey:r,appid:e}).single();return!!n}var Ot=(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))(Ot||{}),vv=(t,e)=>t>=e;async function aI(t,e,r){let{data:n,error:i}=await t.rpc("get_org_perm_for_apikey",{apikey:e,app_id:r}).single();if(i&&(p.error("Cannot get permissions for organization!"),console.error(i),(0,Nt.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")&&(p.info("Please accept/deny the organization invitation before trying to access the app"),(0,Nt.exit)(1)),p.error(`Invalid output when fetching organization permission. Response: ${n}`),(0,Nt.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:p.error(`Invalid error when fetching organization permission. Response: ${n}`),(0,Nt.exit)(1)}return{okay:!1,error:s}}async function uI(t,e,r){let{data:n,error:i}=await t.rpc("get_organization_cli_warnings",{orgid:e,cli_version:r});if(i){p.error(`Cannot get cli warnings: ${Q(i)}`);return}if(n.length>0){p.warn(`Found ${n.length} cli warnings for your organization.`);let o=!1;for(let s of n){if(typeof s!="object"||typeof s.message!="string"||typeof s.fatal!="boolean"){p.error(`Invalid cli warning: ${s}`);continue}let a=s;a.fatal?(o=!0,p.error(`${a.message.replaceAll("\\n",`
|
|
252
252
|
`)}`)):p.warn(`${a.message.replaceAll("\\n",`
|
|
253
|
-
`)}`)}o&&(p.error("Please fix the warnings and try again."),k.error("")),p.info("End of cli warnings.")}}async function ch(t,e,r,n,i=!0){let o=await lh();await(n?
|
|
253
|
+
`)}`)}o&&(p.error("Please fix the warnings and try again."),k.error("")),p.info("End of cli warnings.")}}async function ch(t,e,r,n,i=!0){let o=await lh();await(n?bne(t,n,r):vne(t,e))||(p.error(`You need to upgrade your plan to continue to use capgo.
|
|
254
254
|
Upgrade here: ${o.hostWeb}/dashboard/settings/plans
|
|
255
|
-
`),oh(100),Promise.resolve().then(()=>(gv(),mv)).then(l=>{l.default(`${o.hostWeb}/dashboard/settings/plans`)}),oh(500),k.error(""));let[a,u]=await Promise.all([
|
|
255
|
+
`),oh(100),Promise.resolve().then(()=>(gv(),mv)).then(l=>{l.default(`${o.hostWeb}/dashboard/settings/plans`)}),oh(500),k.error(""));let[a,u]=await Promise.all([sI(t,e),oI(t,e)]);a>0&&i&&!u&&p.warn(`WARNING !!
|
|
256
256
|
Trial expires in ${a} days, upgrade here: ${o.hostWeb}/dashboard/settings/plans
|
|
257
|
-
`)}async function
|
|
257
|
+
`)}async function lI(t,e,r,n,i=!0){let o=await lh(),{data:s}=await t.rpc("is_allowed_action_org_action",{orgid:e,actions:["storage"]});s||(p.error(`You need to upgrade your plan to continue to use capgo.
|
|
258
258
|
Upgrade here: ${o.hostWeb}/dashboard/settings/plans
|
|
259
|
-
`),oh(100),Promise.resolve().then(()=>(gv(),mv)).then(l=>{l.default(`${o.hostWeb}/dashboard/settings/plans`)}),oh(500),k.error(""));let[a,u]=await Promise.all([
|
|
259
|
+
`),oh(100),Promise.resolve().then(()=>(gv(),mv)).then(l=>{l.default(`${o.hostWeb}/dashboard/settings/plans`)}),oh(500),k.error(""));let[a,u]=await Promise.all([sI(t,e),oI(t,e)]);a>0&&i&&!u&&p.warn(`WARNING !!
|
|
260
260
|
Trial expires in ${a} days, upgrade here: ${o.hostWeb}/dashboard/settings/plans
|
|
261
|
-
`)}function de(t=!1){let e=(0,sh.homedir)(),r,n=`${e}/.capgo`;return(0,et.existsSync)(n)&&(t||p.info(`Use global API key ${n}`),r=(0,et.readFileSync)(n,"utf8").trim()),n=".capgo",!r&&(0,et.existsSync)(n)&&(t||p.info(`Use local API key ${n}`),r=(0,et.readFileSync)(n,"utf8").trim()),r||(p.error(`Cannot find API key in local folder or global, please login first with ${Jt().runner} @capacitor/cli login`),k.error("")),r}async function*bv(t){let e=await(0,et.readdirSync)(t,{withFileTypes:!0});for(let r of e){let n=(0,Qe.resolve)(t,r.name);r.isDirectory()&&!r.name.startsWith(".")&&!r.name.startsWith("node_modules")&&!r.name.startsWith("dist")?yield*bv(n):yield n}}function sa(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 wv(){let t=(0,Nt.cwd)(),e=!1,r=(0,Qe.resolve)(t,"tsconfig.json");(0,et.existsSync)(r)&&(e=!0);for await(let n of bv(t)){if(n.includes("angular.json"))return p.info("Found angular project"),e?"angular-ts":"angular-js";if(n.includes("nuxt.config.js")||n.includes("nuxt.config.ts"))return p.info("Found nuxtjs project"),e?"nuxtjs-ts":"nuxtjs-js";if(n.includes("next.config.js")||n.includes("next.config.mjs"))return p.info("Found nextjs project"),e?"nextjs-ts":"nextjs-js";if(n.includes("svelte.config.js"))return p.info("Found sveltekit project"),e?"sveltekit-ts":"sveltekit-js";if(n.includes("rolluconfig.js"))return p.info("Found svelte project"),e?"svelte-ts":"svelte-js";if(n.includes("vue.config.js"))return p.info("Found vue project"),e?"vue-ts":"vue-js";if(n.includes("package.json")){let i=(0,Qe.dirname)(n),o=await kr(i);if(o){if(o.get("react"))return p.info("Found react project test"),e?"react-ts":"react-js";if(o.get("vue"))return p.info("Found vue project"),e?"vue-ts":"vue-js"}}}return"unknown"}function lI(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 cI(t){return t==="angular"?(p.info("Angular project detected"),"build"):t==="nuxtjs"?(p.info("Nuxtjs project detected"),"generate"):t==="nextjs"?(p.info("Nextjs project detected"),p.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"),p.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?"})||(p.error("Aborted"),k.error("")),"build"):(t==="sveltekit"&&(p.info("Sveltekit project detected"),p.warn("Please make sure you have the adapter-static installed: https://kit.svelte.dev/docs/adapter-static"),p.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?"})||(p.error("Aborted"),k.error(""))),"build")}async function fI(){let t=/(main|index)\.(ts|tsx|js|jsx)$/,e="",r=(0,Nt.cwd)(),n=r.split("/").length;for await(let i of bv(r))if(i.split("/").length-n<=2&&t.test(i)){e=i,p.info(`Found main file here ${i}`);break}return e}async function _v(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 dI(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 na.FunctionsHttpError){let s=await o.error.context.json();p.error(`Upload URL error: ${s.status||JSON.stringify(s)}`)}else p.error(`Cannot get upload url: ${o.error.message}`);return""}return o.data.url}catch(i){p.error(`Cannot get upload url ${Q(i)}`)}return""}async function*hI(t){let e=(0,et.readdirSync)(t,{withFileTypes:!0});for(let r of e){let n=(0,Qe.join)(t,r.name);r.isDirectory()?yield*hI(n):yield n}}async function pI(t){let e=[];for await(let r of hI(t)){let n=(0,et.readFileSync)(r),i=await(0,Z$.checksum)(n,"sha256"),o=(0,Qe.relative)(t,r);o.startsWith("/")&&(o=o.substring(1)),e.push({file:o,hash:i})}return e}async function fh(t){return(0,sh.platform)()==="win32"?wne(t):bne(t)}function bne(t){let e=new Dv.default;return e.addLocalFolder(t),e.toBuffer()}async function wne(t){p.info("Zipping file windows mode");let e=new Dv.default,r=(n,i)=>{let o=(0,et.readdirSync)(n);for(let s of o){let a=(0,Qe.join)(n,s),u=(0,et.statSync)(a);if(u.isFile()){let l=(0,et.readFileSync)(a);e.addFile((0,Qe.join)(i,s).split(Qe.sep).join("/"),l)}else u.isDirectory()&&r(a,(0,Qe.join)(i,s))}};return r(t,""),e.toBuffer()}async function mI(t,e,r,n,i,o,s,a){return new Promise((u,l)=>{Oe(t,{channel:"app",event:"App TUS upload",icon:"\u23EB",user_id:r,tags:{"app-id":n},notify:!1}),new ah.Upload(e,{endpoint:`${s.hostFilesApi}/files/upload/attachments/`,chunkSize:a,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(f){if(p.error(`Error uploading bundle: ${f.message}`),f instanceof ah.DetailedError){let h=f.originalResponse?.getBody(),d=JSON.parse(h||'{"error": "unknown error"}');l(d.status||d.error||d.message||"unknown error")}else l(f.message||f.toString()||"unknown error")},onProgress(f,h){let d=(f/h*100).toFixed(2);o.message(`Uploaded ${d}%`)},async onSuccess(){await Oe(t,{channel:"app",event:"App TUS done",icon:"\u23EB",user_id:r,tags:{"app-id":n},notify:!1}).catch(),u(!0)}}).start()})}async function gI(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 na.FunctionsHttpError){let s=await o.error.context.json();p.error(`Cannot delete failed version: ${s.status||JSON.stringify(s)}`)}else p.error(`Cannot delete failed version: ${o.error.message}`);return}return o.data?.status}catch(i){if(i instanceof na.FunctionsHttpError){let o=await i.context.json();p.error(`Cannot delete failed version: ${o.message||JSON.stringify(o)}`)}else p.error(`Cannot delete failed version: ${Q(i)}`)}}async function dh(t,e){if(!e.app_id||!e.name||!e.created_by)return p.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().eq("app_id",e.app_id).eq("name",e.name).single();return r&&!n?t.from("channels").update(e).eq("app_id",e.app_id).eq("name",e.name).select().single():t.from("channels").insert(e).select().single()}async function Oe(t,e){try{let r=await lh(),n=await qr.post(`${r.host}/private/events`,{json:e,headers:{capgkey:t},timeout:1e4,retry:3}).json();n.error&&p.error(`Failed to send LogSnag event: ${n.error}`)}catch{}}async function aa(t,e){let{error:r,data:n}=await t.rpc("get_orgs_v6");r&&(p.error("Cannot get the list of organizations - exiting"),p.error(`Error ${JSON.stringify(r)}`),k.error(""));let i=n.filter(u=>!!e.find(l=>l===u.role));i.length===0&&(p.error(`Could not get organization with roles: ${e.join(" or ")} because the user does not have any org`),k.error(""));let o=i.length>1?await yi({message:"Please pick the organization that you want to insert to",options:i.map(u=>({value:u.gid,label:u.name}))}):i[0].gid;st(o)&&(p.error("Canceled organization selection, exiting"),k.error(""));let s=o,a=n.find(u=>u.gid===s);return p.info(`Using the organization "${a.name}" as the app owner`),a}var mo=t=>t.replace(/\./g,"--");async function he(t,e,r=["all"]){await yne(t,e,r);let{data:n,error:i}=await t.rpc("get_user_id",{apikey:e}).single(),o=(n||"").toString();return(!o||i)&&(p.error("Cannot auth user with apikey"),k.error("")),o}async function wr(t,e){let{data:r,error:n}=await t.from("apps").select("owner_org").eq("app_id",e).single();return(!r||n)&&(p.error(`Cannot get organization id for app id ${e}`),Q(n),k.error("")),r.owner_org}function ua(t){return new Date(t||"").toLocaleString()}var X$=!1,ra="npm",_l="install",yv="npx";function Jt(){if(X$)return{pm:ra,command:_l,installCommand:`${ra} ${_l}`,runner:yv};let t=On((0,Nt.cwd)());return ra=Ra(t,"npm"),_l=oc(ra),X$=!0,yv=lw(t),{pm:ra,command:_l,installCommand:`${ra} ${_l}`,runner:yv}}function yI(t){return(0,et.readdirSync)(t,{withFileTypes:!0}).flatMap(n=>{let i=(0,Qe.join)(t,n.name);return n.isDirectory()?yI(i):i.split(`node_modules${Qe.sep}`)[1]||i})}async function Ev(t,e){let r=e?e.split(","):[],n;try{n=await kr("",t)}catch(c){p.error("Invalid package.json, JSON parsing failed"),console.error("json parse error: ",c),k.error("")}let i=t?.split(",")[0],o=i?Qe.default.resolve(i).replace("package.json",""):On((0,Nt.cwd)());n||(p.error("Missing dependencies section in package.json"),k.error(""));for(let[c,f]of Object.entries(n))typeof f!="string"&&(p.error(`Invalid dependency ${c}: ${f}, expected string, got ${typeof f}`),k.error(""));let s=r.length===0?[(0,Qe.join)((0,Nt.cwd)(),"node_modules")]:r;if(!s.some(c=>(0,et.existsSync)(c))){let c=Ra(o,"npm"),f=oc(c);p.error(`Missing node_modules folder at ${s.join(", ")}, please run ${c} ${f}`),k.error("")}let u=!1,l=await Promise.all(Array.from(n.entries()).map(async([c,f])=>{let h=!1,d=!1;for(let m of s){let b=(0,Qe.join)(m,c);if((0,et.existsSync)(b)){h=!0;try{if(yI(b).some(_=>gne.test(_))){d=!0;break}}catch(D){p.error(`Error reading node_modules files for ${c} package in ${m}`),console.error(D),k.error("")}}}if(!h){u=!0;let m=Ra(o,"npm"),b=oc(m);return p.error(`Missing dependency ${c}, please run ${m} ${b}`),{name:c,version:f}}return{name:c,version:f,native:d}})).catch(()=>[]);return(u||l.find(c=>c.native===void 0))&&(p.error("Missing dependencies or invalid dependencies"),p.error("If you use monorepo, workspace or any special package manager you can use the --package-json [path,] and --node-modules [path,] options to make the command work properly"),k.error("")),l}async function _ne(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 Ene(t,e,r){let{data:n,error:i}=await t.from("channels").select(`version (
|
|
261
|
+
`)}function de(t=!1){let e=(0,sh.homedir)(),r,n=`${e}/.capgo`;return(0,et.existsSync)(n)&&(t||p.info(`Use global API key ${n}`),r=(0,et.readFileSync)(n,"utf8").trim()),n=".capgo",!r&&(0,et.existsSync)(n)&&(t||p.info(`Use local API key ${n}`),r=(0,et.readFileSync)(n,"utf8").trim()),r||(p.error(`Cannot find API key in local folder or global, please login first with ${Jt().runner} @capacitor/cli login`),k.error("")),r}async function*bv(t){let e=await(0,et.readdirSync)(t,{withFileTypes:!0});for(let r of e){let n=(0,Qe.resolve)(t,r.name);r.isDirectory()&&!r.name.startsWith(".")&&!r.name.startsWith("node_modules")&&!r.name.startsWith("dist")?yield*bv(n):yield n}}function sa(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 wv(){let t=(0,Nt.cwd)(),e=!1,r=(0,Qe.resolve)(t,"tsconfig.json");(0,et.existsSync)(r)&&(e=!0);for await(let n of bv(t)){if(n.includes("angular.json"))return p.info("Found angular project"),e?"angular-ts":"angular-js";if(n.includes("nuxt.config.js")||n.includes("nuxt.config.ts"))return p.info("Found nuxtjs project"),e?"nuxtjs-ts":"nuxtjs-js";if(n.includes("next.config.js")||n.includes("next.config.mjs"))return p.info("Found nextjs project"),e?"nextjs-ts":"nextjs-js";if(n.includes("svelte.config.js"))return p.info("Found sveltekit project"),e?"sveltekit-ts":"sveltekit-js";if(n.includes("rolluconfig.js"))return p.info("Found svelte project"),e?"svelte-ts":"svelte-js";if(n.includes("vue.config.js"))return p.info("Found vue project"),e?"vue-ts":"vue-js";if(n.includes("package.json")){let i=(0,Qe.dirname)(n),o=await kr(i);if(o){if(o.get("react"))return p.info("Found react project test"),e?"react-ts":"react-js";if(o.get("vue"))return p.info("Found vue project"),e?"vue-ts":"vue-js"}}}return"unknown"}function cI(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 fI(t){return t==="angular"?(p.info("Angular project detected"),"build"):t==="nuxtjs"?(p.info("Nuxtjs project detected"),"generate"):t==="nextjs"?(p.info("Nextjs project detected"),p.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"),p.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?"})||(p.error("Aborted"),k.error("")),"build"):(t==="sveltekit"&&(p.info("Sveltekit project detected"),p.warn("Please make sure you have the adapter-static installed: https://kit.svelte.dev/docs/adapter-static"),p.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?"})||(p.error("Aborted"),k.error(""))),"build")}async function dI(){let t=/(main|index)\.(ts|tsx|js|jsx)$/,e="",r=(0,Nt.cwd)(),n=r.split("/").length;for await(let i of bv(r))if(i.split("/").length-n<=2&&t.test(i)){e=i,p.info(`Found main file here ${i}`);break}return e}async function _v(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 hI(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 na.FunctionsHttpError){let s=await o.error.context.json();p.error(`Upload URL error: ${s.status||JSON.stringify(s)}`)}else p.error(`Cannot get upload url: ${o.error.message}`);return""}return o.data.url}catch(i){p.error(`Cannot get upload url ${Q(i)}`)}return""}async function*pI(t){let e=(0,et.readdirSync)(t,{withFileTypes:!0});for(let r of e){let n=(0,Qe.join)(t,r.name);r.isDirectory()?yield*pI(n):yield n}}async function mI(t){let e=[];for await(let r of pI(t)){let n=(0,et.readFileSync)(r),i=await(0,Q$.checksum)(n,"sha256"),o=(0,Qe.relative)(t,r);o.startsWith("/")&&(o=o.substring(1)),e.push({file:o,hash:i})}return e}async function fh(t){return(0,sh.platform)()==="win32"?_ne(t):wne(t)}function wne(t){let e=new Dv.default;return e.addLocalFolder(t),e.toBuffer()}async function _ne(t){p.info("Zipping file windows mode");let e=new Dv.default,r=(n,i)=>{let o=(0,et.readdirSync)(n);for(let s of o){let a=(0,Qe.join)(n,s),u=(0,et.statSync)(a);if(u.isFile()){let l=(0,et.readFileSync)(a);e.addFile((0,Qe.join)(i,s).split(Qe.sep).join("/"),l)}else u.isDirectory()&&r(a,(0,Qe.join)(i,s))}};return r(t,""),e.toBuffer()}async function gI(t,e,r,n,i,o,s,a){return new Promise((u,l)=>{Oe(t,{channel:"app",event:"App TUS upload",icon:"\u23EB",user_id:r,tags:{"app-id":n},notify:!1}),new ah.Upload(e,{endpoint:`${s.hostFilesApi}/files/upload/attachments/`,chunkSize:a,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(f){if(p.error(`Error uploading bundle: ${f.message}`),f instanceof ah.DetailedError){let h=f.originalResponse?.getBody(),d=JSON.parse(h||'{"error": "unknown error"}');l(d.status||d.error||d.message||"unknown error")}else l(f.message||f.toString()||"unknown error")},onProgress(f,h){let d=(f/h*100).toFixed(2);o.message(`Uploaded ${d}%`)},async onSuccess(){await Oe(t,{channel:"app",event:"App TUS done",icon:"\u23EB",user_id:r,tags:{"app-id":n},notify:!1}).catch(),u(!0)}}).start()})}async function yI(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 na.FunctionsHttpError){let s=await o.error.context.json();p.error(`Cannot delete failed version: ${s.status||JSON.stringify(s)}`)}else p.error(`Cannot delete failed version: ${o.error.message}`);return}return o.data?.status}catch(i){if(i instanceof na.FunctionsHttpError){let o=await i.context.json();p.error(`Cannot delete failed version: ${o.message||JSON.stringify(o)}`)}else p.error(`Cannot delete failed version: ${Q(i)}`)}}async function dh(t,e){if(!e.app_id||!e.name||!e.created_by)return p.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().eq("app_id",e.app_id).eq("name",e.name).single();return r&&!n?t.from("channels").update(e).eq("app_id",e.app_id).eq("name",e.name).select().single():t.from("channels").insert(e).select().single()}async function Oe(t,e){try{let r=await lh(),n=await qr.post(`${r.host}/private/events`,{json:e,headers:{capgkey:t},timeout:1e4,retry:3}).json();n.error&&p.error(`Failed to send LogSnag event: ${n.error}`)}catch{}}async function aa(t,e){let{error:r,data:n}=await t.rpc("get_orgs_v6");r&&(p.error("Cannot get the list of organizations - exiting"),p.error(`Error ${JSON.stringify(r)}`),k.error(""));let i=n.filter(u=>!!e.find(l=>l===u.role));i.length===0&&(p.error(`Could not get organization with roles: ${e.join(" or ")} because the user does not have any org`),k.error(""));let o=i.length>1?await yi({message:"Please pick the organization that you want to insert to",options:i.map(u=>({value:u.gid,label:u.name}))}):i[0].gid;st(o)&&(p.error("Canceled organization selection, exiting"),k.error(""));let s=o,a=n.find(u=>u.gid===s);return p.info(`Using the organization "${a.name}" as the app owner`),a}var mo=t=>t.replace(/\./g,"--");async function he(t,e,r=["all"]){await Dne(t,e,r);let{data:n,error:i}=await t.rpc("get_user_id",{apikey:e}).single(),o=(n||"").toString();return(!o||i)&&(p.error("Cannot auth user with apikey"),k.error("")),o}async function wr(t,e){let{data:r,error:n}=await t.from("apps").select("owner_org").eq("app_id",e).single();return(!r||n)&&(p.error(`Cannot get organization id for app id ${e}`),Q(n),k.error("")),r.owner_org}function ua(t){return new Date(t||"").toLocaleString()}var Z$=!1,ra="npm",_l="install",yv="npx";function Jt(){if(Z$)return{pm:ra,command:_l,installCommand:`${ra} ${_l}`,runner:yv};let t=On((0,Nt.cwd)());return ra=Ra(t,"npm"),_l=oc(ra),Z$=!0,yv=cw(t),{pm:ra,command:_l,installCommand:`${ra} ${_l}`,runner:yv}}function DI(t){return(0,et.readdirSync)(t,{withFileTypes:!0}).flatMap(n=>{let i=(0,Qe.join)(t,n.name);return n.isDirectory()?DI(i):i.split(`node_modules${Qe.sep}`)[1]||i})}async function Ev(t,e){let r=e?e.split(","):[],n;try{n=await kr("",t)}catch(c){p.error("Invalid package.json, JSON parsing failed"),console.error("json parse error: ",c),k.error("")}let i=t?.split(",")[0],o=i?Qe.default.resolve(i).replace("package.json",""):On((0,Nt.cwd)());n||(p.error("Missing dependencies section in package.json"),k.error(""));for(let[c,f]of Object.entries(n))typeof f!="string"&&(p.error(`Invalid dependency ${c}: ${f}, expected string, got ${typeof f}`),k.error(""));let s=r.length===0?[(0,Qe.join)((0,Nt.cwd)(),"node_modules")]:r;if(!s.some(c=>(0,et.existsSync)(c))){let c=Ra(o,"npm"),f=oc(c);p.error(`Missing node_modules folder at ${s.join(", ")}, please run ${c} ${f}`),k.error("")}let u=!1,l=await Promise.all(Array.from(n.entries()).map(async([c,f])=>{let h=!1,d=!1;for(let m of s){let b=(0,Qe.join)(m,c);if((0,et.existsSync)(b)){h=!0;try{if(DI(b).some(_=>yne.test(_))){d=!0;break}}catch(D){p.error(`Error reading node_modules files for ${c} package in ${m}`),console.error(D),k.error("")}}}if(!h){u=!0;let m=Ra(o,"npm"),b=oc(m);return p.error(`Missing dependency ${c}, please run ${m} ${b}`),{name:c,version:f}}return{name:c,version:f,native:d}})).catch(()=>[]);return(u||l.find(c=>c.native===void 0))&&(p.error("Missing dependencies or invalid dependencies"),p.error("If you use monorepo, workspace or any special package manager you can use the --package-json [path,] and --node-modules [path,] options to make the command work properly"),k.error("")),l}async function Ene(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 Cne(t,e,r){let{data:n,error:i}=await t.from("channels").select(`version (
|
|
262
262
|
native_packages
|
|
263
|
-
)`).eq("name",r).eq("app_id",e).single();i&&(p.error(`Error fetching native packages: ${i.message}`),k.error(""));let o;try{o=n.version.native_packages}catch{p.error("Error parsing native packages"),k.error("")}return o||(p.error("Error parsing native packages, perhaps the metadata does not exist?"),k.error("")),o.forEach(a=>{typeof a!="object"&&(p.error(`Invalid remote native package data: ${a}, expected object, got ${typeof a}`),k.error(""));let{name:u,version:l}=a;(!u||typeof u!="string")&&(p.error(`Invalid remote native package name: ${u}, expected string, got ${typeof u}`),k.error("")),(!l||typeof l!="string")&&(p.error(`Invalid remote native package version: ${l}, expected string, got ${typeof l}`),k.error(""))}),new Map(o.map(a=>[a.name,a]))}async function
|
|
263
|
+
)`).eq("name",r).eq("app_id",e).single();i&&(p.error(`Error fetching native packages: ${i.message}`),k.error(""));let o;try{o=n.version.native_packages}catch{p.error("Error parsing native packages"),k.error("")}return o||(p.error("Error parsing native packages, perhaps the metadata does not exist?"),k.error("")),o.forEach(a=>{typeof a!="object"&&(p.error(`Invalid remote native package data: ${a}, expected object, got ${typeof a}`),k.error(""));let{name:u,version:l}=a;(!u||typeof u!="string")&&(p.error(`Invalid remote native package name: ${u}, expected string, got ${typeof u}`),k.error("")),(!l||typeof l!="string")&&(p.error(`Invalid remote native package version: ${l}, expected string, got ${typeof l}`),k.error(""))}),new Map(o.map(a=>[a.name,a]))}async function vI(t,e,r,n){let i=_e();i.start(`Checking bundle checksum compatibility with channel ${r}`);let o=await Ene(t,e,r);if(!o){i.stop(`No checksum found for channel ${r}, the bundle will be uploaded`);return}o&&o===n&&(p.error(`Cannot upload the same bundle content.
|
|
264
264
|
Current bundle checksum matches remote bundle for channel ${r}
|
|
265
265
|
Did you builded your app before uploading?
|
|
266
|
-
PS: You can ignore this check with "--ignore-checksum-check"`),k.error("")),i.stop(`Checksum compatible with ${r} channel`)}function pe(t,e){return t||e?.plugins?.CapacitorUpdater?.appId||e?.appId}async function hh(t,e,r,n,i){let o=await Ev(n,i),s=await
|
|
267
|
-
Please use @capgo/cli@${t}" or @capgo/cli@${e} to keep up to date with the latest features and bug fixes.`)}async function
|
|
266
|
+
PS: You can ignore this check with "--ignore-checksum-check"`),k.error("")),i.stop(`Checksum compatible with ${r} channel`)}function pe(t,e){return t||e?.plugins?.CapacitorUpdater?.appId||e?.appId}async function hh(t,e,r,n,i){let o=await Ev(n,i),s=await Cne(t,e,r),a=o.filter(l=>!!l.native).map(l=>{let c=s.get(l.name);return c?{name:l.name,localVersion:l.version,remoteVersion:c.version}:{name:l.name,localVersion:l.version,remoteVersion:void 0}}),u=[...s].filter(([l])=>o.find(c=>c.name===l)===void 0).map(([l,c])=>({name:l,localVersion:void 0,remoteVersion:c.version}));return a.push(...u),{finalCompatibility:a,localDependencies:o}}async function bI(t,e){let{data:r}=await t.rpc("exist_app_v2",{appid:e}).single();return!!r}async function qe(t,e,r,n){let i=Jt(),o=await aI(t,e,r);if(!o.okay)switch(o.error){case"INVALID_APIKEY":{p.error("Invalid apikey, such apikey does not exists!"),k.error("");break}case"NO_APP":{p.error(`App ${r} does not exist, run first \`${i.runner} @capgo/cli app add ${r}\` to create it`),k.error("");break}case"NO_ORG":{p.error("Could not find organization, please contact support to resolve this!"),k.error("");break}}let s=o.data;return n>s&&(p.error(`Insuficcent permissions for app ${r}. Current permission: ${Ot[o.data]}, required for this action: ${Ot[n]}.`),k.error("")),o.data}var _r="assets/icon.png";var VI=ue(HI(),1);function Fv(t){let e=(0,VI.default)("npm",{registry:"https://registry.npmjs.org/"}),r=e[`${t}:registry`]||e.config_registry||e.registry;return r.slice(-1)==="/"?r:`${r}/`}var Uj=ue(Mj(),1),Hj=ue(K0(),1),Uv=class extends Error{constructor(e){super(`Package \`${e}\` could not be found`),this.name="PackageNotFoundError"}},Hv=class extends Error{constructor(e,r){super(`Version \`${r}\` for package \`${e}\` could not be found`),this.name="VersionNotFoundError"}};async function Vv(t,e={}){let{version:r="latest"}=e,{omitDeprecated:n=!0}=e,i=t.split("/")[0],o=e.registryUrl??Fv(i),s=new URL(encodeURIComponent(t).replace(/^%40/,"@"),o),a=(0,Uj.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 l;try{l=await qr(s,{headers:u,keepalive:!0}).json()}catch(f){throw f?.response?.status===404?new Uv(t):f}if(e.allVersions)return l;let c=new Hv(t,r);if(l["dist-tags"][r]){let{time:f}=l;l=l.versions[l["dist-tags"][r]],l.time=f}else if(r){let f=!!l.versions[r];if(n&&!f)for(let[d,m]of Object.entries(l.versions))m.deprecated&&delete l.versions[d];if(!f){let d=Object.keys(l.versions);if(r=Hj.default.maxSatisfying(d,r),!r)throw c}let{time:h}=l;if(l=l.versions[r],l.time=h,!l)throw c}return l}async function Al(t,e){let{version:r}=await Vv(t.toLowerCase(),e);return r}async function Ae(){let t=await Al("@capgo/cli").catch(()=>""),e=t?.split(".")[0];t!==Cr.version&&p.warning(`\u{1F6A8} You are using @capgo/cli@${Cr.version} it's not the latest version.
|
|
267
|
+
Please use @capgo/cli@${t}" or @capgo/cli@${e} to keep up to date with the latest features and bug fixes.`)}async function kie(t,e,r=!0){await zv(t,e,void 0,r)}async function zv(t,e,r,n=!0){n&&Z("Adding"),await Ae(),e.apikey=e.apikey||de();let i=await te();t=pe(t,i?.config),e.apikey||(p.error("Missing API key, you need to provide a API key to upload your bundle"),k.error("")),t||(p.error("Missing argument, you need to provide a appId, or be in a capacitor project"),k.error("")),t.includes("--")&&(p.error('The app id includes illegal symbols. You cannot use "--" in the app id'),k.error(""));let o=await fe(e.apikey);await he(o,e.apikey,["write","all"]),await bI(o,t)&&(t==="io.ionic.starter"?p.error(`This appId ${t} cannot be used it's reserved, please change it in your capacitor config.`):p.error(`App ${t} already exist`),k.error("")),r||(r=await aa(o,["admin","super_admin"]));let a=r.gid;await ch(o,a,e.apikey,void 0,!1);let{name:u,icon:l}=e;u=u||i.config?.appName||"Unknown",l=l||"resources/icon.png",(!l||!u)&&(p.error("Missing argument, you need to provide a appId and a name, or be in a capacitor project"),k.error("")),n&&p.info(`Adding ${t} to Capgo`);let c=null,f=null;l&&(0,ga.existsSync)(l)?(c=(0,ga.readFileSync)(l),f=sa(l)||"image/png",p.warn(`Found app icon ${l}`)):(0,ga.existsSync)(_r)?(c=(0,ga.readFileSync)(_r),f=sa(_r)||"image/png",p.warn(`Found app icon ${_r}`)):p.warn(`Cannot find app icon in any of the following locations: ${l}, ${_r}`);let h="icon",d="https://xvwzpoazmxkqosrdewyv.supabase.co/storage/v1/object/public/images/capgo.png";if(c&&f){let{error:D}=await o.storage.from(`images/org/${a}/${t}`).upload(h,c,{contentType:f});D&&(console.error(D),p.error(`Could not add app ${Q(D)}`),k.error(""));let{data:_}=await o.storage.from(`images/org/${a}/${t}`).getPublicUrl(h);d=_?.publicUrl||d}let{error:m}=await o.from("apps").insert({icon_url:d,owner_org:a,name:u,app_id:t});m&&(p.error(`Could not add app ${Q(m)}`),k.error(""));let{error:b}=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 b&&(p.error(`Could not add app ${Q(b)}`),k.error("")),p.success(`App ${t} added to Capgo. ${n?"You can upload a bundle now":""}`),n&&(J("Done \u2705"),(0,Vj.exit)()),!0}async function zj(t,e){kie(t,e,!0)}var Gv=require("node:process");function Tie(t){return new Promise(e=>{setTimeout(e,t)})}async function Tn(t,e,r,n,i="\u2705"){await Oe(r,{channel:t,event:n,icon:i,user_id:e,notify:!1})}async function Pie(t,e,r,n){st(e)&&(await Tn(t,r,n,"canceled","\u{1F937}"),(0,Gv.exit)())}async function Rie(t,e,r){try{let n=await br(),i=await qr.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){p.error(`Cannot get stats ${Q(n)}`)}return[]}async function $ie(t,e,r,n,i,o){if(p.info(`Log from Device: ${t.device_id}`),t.action==="get")p.info("Update Sent your your device, wait until event download complete"),await Tn(e,r,n,"done");else if(t.action.startsWith("download_")){let s=t.action.split("_")[1];s==="complete"?(p.info("Your bundle has been downloaded on your device, background the app now and open it again to see the update"),await Tn(e,r,n,"downloaded")):s==="fail"?(p.error("Your bundle has failed to download on your device."),p.error("Please check if you have network connection and try again")):p.info(`Your bundle is downloading ${s}% ...`)}else{if(t.action==="set")return p.info("Your bundle has been set on your device \u2764\uFE0F"),await Tn(e,r,n,"set"),!1;t.action==="NoChannelOrOverride"?p.error(`No default channel or override (channel/device) found, please create it here ${i}`):t.action==="needPlanUpgrade"?p.error(`Your are out of quota, please upgrade your plan here ${o}/dashboard/settings/plans`):t.action==="missingBundle"?p.error("Your bundle is missing, please check how you build your app"):t.action==="noNew"?(p.error(`The version number you uploaded to your default channel in Capgo, is the same as the present in the device ${t.device_id}.`),p.error(`To fix it, ensure the variable:
|
|
268
268
|
- iOS: keyCFBundleShortVersionString or MARKETING_VERSION
|
|
269
269
|
- Android: versionName
|
|
270
270
|
Are lower than the version number you uploaded to Capgo.`),p.error("More info here: https://capgo.app/blog/how-version-work-in-capgo/#versioning-system")):t.action==="disablePlatformIos"?p.error(`iOS is disabled in the default channel and your device ${t.device_id} is an iOS device ${i}`):t.action==="disablePlatformAndroid"?p.error(`Android is disabled in the default channel and your device ${t.device_id} is an Android device ${i}`):t.action==="disableAutoUpdateToMajor"?(p.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}.`),p.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."),p.error(`To fix it, ensure the variable:
|
|
@@ -273,12 +273,12 @@ Please use @capgo/cli@${t}" or @capgo/cli@${e} to keep up to date with the lates
|
|
|
273
273
|
Are lower than the version number you uploaded to Capgo.`),p.error("More info here: https://capgo.app/blog/how-version-work-in-capgo/#versioning-system")):t.action==="disableAutoUpdateUnderNative"?(p.error(`The version number you uploaded to your default channel in Capgo, is lower than the present in the device ${t.device_id}.`),p.error(`To fix it, ensure the variable:
|
|
274
274
|
- iOS: keyCFBundleShortVersionString or MARKETING_VERSION
|
|
275
275
|
- Android: versionName
|
|
276
|
-
Are lower than the version number you uploaded to Capgo.`),p.error("More info here: https://capgo.app/blog/how-version-work-in-capgo/#versioning-system")):t.action==="disableDevBuild"?(p.error(`Dev build is disabled in the default channel. ${i}`),p.error("Set your channel to allow it if you wanna test your app")):t.action==="disableEmulator"?(p.error(`Emulator is disabled in the default channel. ${i}`),p.error("Set your channel to allow it if you wanna test your app")):t.action==="cannotGetBundle"?(p.error(`We cannot get your bundle from the default channel. ${i}`),p.error("Are you sure your default channel has a bundle set?")):t.action==="set_fail"?p.error(`Your bundle seems to be corrupted, try to download from ${i} to identify the issue`):t.action==="reset"?p.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"?(p.error("Your bundle has been installed but failed to call notifyAppReady()"),p.error("Please check if you have network connection and try again")):t.action==="checksum_fail"?p.error("Your bundle has failed to validate checksum, please check your code and send it again to Capgo"):p.error(`Log from Capgo ${t.action}`)}return!0}async function Wv(t,e,r,n,i){let o=!0,s=mo(r),a=await br(),u=`${a.hostWeb}/app/p/${s}`;await Tn(t,n,e,"Use waitlog");let l={appId:r,devicesId:i?[i]:void 0,order:[{key:"created_at",sortable:"desc"}],rangeStart:new Date().toISOString()},c=null,f=_e();for(f.start("Waiting for logs (Expect delay of 30 sec)");o;){await
|
|
277
|
-
`)}};function
|
|
278
|
-
${Q(n)}`),k.error("")),r))}function
|
|
276
|
+
Are lower than the version number you uploaded to Capgo.`),p.error("More info here: https://capgo.app/blog/how-version-work-in-capgo/#versioning-system")):t.action==="disableDevBuild"?(p.error(`Dev build is disabled in the default channel. ${i}`),p.error("Set your channel to allow it if you wanna test your app")):t.action==="disableEmulator"?(p.error(`Emulator is disabled in the default channel. ${i}`),p.error("Set your channel to allow it if you wanna test your app")):t.action==="cannotGetBundle"?(p.error(`We cannot get your bundle from the default channel. ${i}`),p.error("Are you sure your default channel has a bundle set?")):t.action==="set_fail"?p.error(`Your bundle seems to be corrupted, try to download from ${i} to identify the issue`):t.action==="reset"?p.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"?(p.error("Your bundle has been installed but failed to call notifyAppReady()"),p.error("Please check if you have network connection and try again")):t.action==="checksum_fail"?p.error("Your bundle has failed to validate checksum, please check your code and send it again to Capgo"):p.error(`Log from Capgo ${t.action}`)}return!0}async function Wv(t,e,r,n,i){let o=!0,s=mo(r),a=await br(),u=`${a.hostWeb}/app/p/${s}`;await Tn(t,n,e,"Use waitlog");let l={appId:r,devicesId:i?[i]:void 0,order:[{key:"created_at",sortable:"desc"}],rangeStart:new Date().toISOString()},c=null,f=_e();for(f.start("Waiting for logs (Expect delay of 30 sec)");o;){await Tie(5e3);let h=await Rie(e,l,c);if(h.length>0){c=h[0].created_at;for(let d of h)if(o=await $ie(d,t,n,e,u,a.hostWeb),!o)break}}return f.stop("Stop watching logs"),Promise.resolve()}async function Gj(t,e){Z("Debug Live update in Capgo"),await Ae(),e.apikey=e.apikey||de();let r=await te();t=pe(t,r?.config);let n=e.device;e.apikey||(p.error("Missing API key, you need to provide an API key to delete your app"),k.error("")),t||(p.error("Missing argument, you need to provide a appId, or be in a capacitor project"),k.error(""));let i=await fe(e.apikey),o=await wr(i,t),s=await Pe({message:"Automatic check if update working in device ?"});await Pie("debug",s,o,e.apikey),s?(p.info(`Wait logs sent to Capgo from ${t} device, Please open your app \u{1F4AA}`),await Wv("debug",e.apikey,t,o,n),J("Done \u2705")):J("Canceled \u274C"),J("Done \u2705"),(0,Gv.exit)()}var Wj=require("node:process");async function Kj(t,e){Z("Deleting"),e.apikey=e.apikey||de();let r=await te();t=pe(t,r?.config),e.apikey||(p.error("Missing API key, you need to provide a API key to upload your bundle"),k.error("")),t||(p.error("Missing argument, you need to provide a appId, or be in a capacitor project"),k.error(""));let n=await fe(e.apikey),i=await he(n,e.apikey,["write","all"]);await qe(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){p.warn("Deleting the app is not recomended for users that are not the organization owner"),p.warn("You are invited as a super_admin but your are not the owner"),p.warn("It's strongly recomended that you do not continue!");let h=await yi({message:"Do you want to continue?",options:[{label:"Yes",value:"yes"},{label:"No",value:"no"}]});(st(h)||h==="no")&&(p.error("Canceled deleting the app, exiting"),k.error(""))}else s&&p.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}`),p.error("Could not delete app logo"));let{error:l}=await n.storage.from(`apps/${t}/${i}`).remove(["versions"]);l&&p.error("Could not delete app version");let{error:c}=await n.from("apps").delete().eq("app_id",t);c&&(p.error("Could not delete app"),k.error(""));let f=await wr(n,t);await Oe(e.apikey,{channel:"app",event:"App Deleted",icon:"\u{1F5D1}\uFE0F",user_id:f,tags:{"app-id":t},notify:!1}).catch(),p.success("App deleted in Capgo"),J("Done \u2705"),(0,Wj.exit)()}var xh=require("node:os"),ya=require("node:process");async function Iie(t){let e={},r=[];for(let n in t)Object.prototype.hasOwnProperty.call(t,n)&&r.push(Al(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 jie(){let{dependencies:t}=await vr(),e={"@capgo/cli":Cr.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 Yj(t){p.warn(" \u{1F48A} Capgo Doctor \u{1F48A}");let e=await te(),r=await vr("",t.packageJson),n=e?.config?.plugins?.CapacitorUpdater?.version||r?.version,i=e?.config?.appName||"";p.info(` App Name: ${i}`);let o=pe("",e?.config);p.info(` App ID: ${o}`),p.info(` App Version: ${n}`);let s=e?.config?.webDir||"";p.info(` Web Dir: ${s}`),p.info(` OS: ${(0,xh.platform)()} ${(0,xh.version)()}`),p.info(` Node: ${ya.version}`),p.info(" Installed Dependencies:");let a=await jie();Object.keys(a).length===0&&(p.warning("\x1B[31m%s\x1B[0m \u{1F6A8} No dependencies found"),(0,ya.exit)(1));for(let c in a)if(Object.prototype.hasOwnProperty.call(a,c)){let f=a[c];p.info(` ${c}: ${f}`)}let u=_e();u.start("Running: Loading latest dependencies");let l=await Iie(a);u.stop("Latest Dependencies:");for(let c in l)if(Object.prototype.hasOwnProperty.call(l,c)){let f=l[c];p.info(` ${c}: ${f}`)}JSON.stringify(a)!==JSON.stringify(l)&&(p.warn("\x1B[31m\u{1F6A8} Some dependencies are not up to date\x1B[0m"),(0,ya.exit)(1)),p.success("\x1B[32m\u2705 All dependencies are up to date\x1B[0m"),(0,ya.exit)()}var Kv=require("node:process");function Jj(t,e){let n=["normal","bold","dim","italic","underline","strikethrough"].indexOf(t),i="\x1B[";return i+n+"m"+e+i+"0m"}var sr=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?Jj("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))+Jj("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(`
|
|
277
|
+
`)}};function Nie(t){t.length||(p.error("No apps found"),(0,Kv.exit)(1));let e=new sr;e.headers=["Name","id","Created"],e.rows=[],t.reverse().forEach(r=>{e.rows.push([r.name??"",r.app_id,ua(r.created_at)])}),p.success("Apps"),p.success(e.toString())}async function Lie(t){let{data:e,error:r}=await t.from("apps").select().order("created_at",{ascending:!1});return r&&(p.error("Apps not found"),k.error("")),e}async function Xj(t){Z("List apps in Capgo"),await Ae(),t.apikey=t.apikey||de();let e=await fe(t.apikey);await he(e,t.apikey,["write","all","read","upload"]),p.info("Getting active bundle in Capgo");let r=await Lie(e);p.info(`Active app in Capgo: ${r?.length}`),Nie(r),J("Done \u2705"),(0,Kv.exit)()}var Zj=require("node:crypto"),Da=require("node:fs"),Qj=require("node:process");async function e6(t,e){Z("Set app"),e.apikey=e.apikey||de();let r=await te();t=pe(t,r?.config),e.apikey||(p.error("Missing API key, you need to provide a API key to upload your bundle"),k.error("")),t||(p.error("Missing argument, you need to provide a appId, or be in a capacitor project"),k.error(""));let n=await fe(e.apikey),o=(await aa(n,["admin","super_admin"])).gid,s=await he(n,e.apikey,["write","all"]);await qe(n,e.apikey,t,4);let{name:a,icon:u,retention:l}=e;l&&Number.isNaN(Number(l))?(p.error("retention value must be a number"),k.error("")):l&&l<0&&(p.error("retention value cannot be less than 0"),k.error(""));let c,f,h=`icon_${(0,Zj.randomUUID)()}`,d="https://xvwzpoazmxkqosrdewyv.supabase.co/storage/v1/object/public/images/capgo.png";if(u&&(0,Da.existsSync)(u)?(c=(0,Da.readFileSync)(u),f=sa(u)||"image/png",p.warn(`Found app icon ${u}`)):(0,Da.existsSync)(_r)?(c=(0,Da.readFileSync)(_r),f=sa(_r)||"image/png",p.warn(`Found app icon ${_r}`)):p.warn(`Cannot find app icon in any of the following locations: ${u}, ${_r}`),c&&f){let{error:b}=await n.storage.from(`images/org/${o}/${t}`).upload(h,c,{contentType:f});b&&(p.error(`Could not set app ${Q(b)}`),k.error(""));let{data:D}=await n.storage.from(`images/org/${o}/${t}`).getPublicUrl(h);d=D?.publicUrl||d}let{error:m}=await n.from("apps").update({icon_url:d,name:a,retention:l?l*24*60*60:void 0}).eq("app_id",t).eq("user_id",s);m&&(p.error(`Could not set app ${Q(m)}`),k.error("")),J("Done \u2705"),(0,Qj.exit)()}var va=require("node:process");async function t6(t,e){Z("Set a specific setting in capacitor config"),e.bool&&e.string&&(p.error("Bool and string CANNOT be set at the same time"),(0,va.exit)(1)),!e.bool&&!e.string&&(p.error("You MUST provide either bool or string as the value"),(0,va.exit)(1)),e.bool&&e.bool!=="true"&&e.bool!=="false"&&(p.error("Invalid bool"),(0,va.exit)(1));try{let r=await te(),n=r.config,i=t.split(".");i.length===0&&(p.error("Invalid path"),(0,va.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 ci(r,!0),p.success(`Set "${t}" to "${o}"`)}catch(r){p.error(`Cannot set config in capacitor settings ${Q(r)}`),(0,va.exit)(1)}J("Done \u2705")}var ob=require("node:process");function Fh(t,e){if(isNaN(t)||isNaN(e))throw new Error("Cannot compare against non-numbers");return t===e?0:t<e?-1:1}function i6(t=[],e=[]){return t.length&&!e.length?-1:!t.length&&e.length?1:0}function Jv(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 ba="0|[1-9]\\d*",Bie="\\d*[a-zA-Z-][a-zA-Z0-9-]*",qie=`(?<major>${ba})\\.(?<minor>${ba})\\.(?<patch>${ba})`,r6=`(?:${ba}|${Bie})`,o6=`(?:-(?<prerelease>${r6}(?:\\.${r6})*))`,n6="[0-9A-Za-z-]+",s6=`(?:\\+(?<buildmetadata>${n6}(?:\\.${n6})*))`,a6=`v?${qie}${o6}?${s6}?`,u6=new RegExp(`^${a6}$`),l6="(?:<|>)?=?",Mie="x|X|\\*",Yv=`${ba}|${Mie}`,c6=`[v=\\s]*(?<major>${Yv})(?:\\.(?<minor>${Yv})(?:\\.(?<patch>${Yv})${o6}?${s6}?)?)?`,Uie=new RegExp(`^(?<operator>~>?|\\^|${l6})\\s*${c6}$`),Hie=new RegExp(`^(?<operator>${l6})\\s*(${a6})$|^$`);function Xv(t){return typeof t=="number"&&!Number.isNaN(t)&&(!Number.isFinite(t)||0<=t&&t<=Number.MAX_SAFE_INTEGER)}var Zv=256;var Vie=new RegExp(`^${ba}$`);function Qv(t){return t.split(".").filter(Boolean).map(e=>{if(Vie.test(e)){let r=Number(e);if(Xv(r))return r}return e})}function kl(t){return t.split(".").filter(Boolean)}function Tl(t,e){let r=Number(t);if(!Xv(r))throw new TypeError(e);return r}function ar(t,e){return t===e?0:Fh(t.major,e.major)||Fh(t.minor,e.minor)||Fh(t.patch,e.patch)||i6(t.prerelease,e.prerelease)||Jv(t.prerelease,e.prerelease)}function eb(t){return t.toFixed(0)}function wa(t){let e=eb(t.major),r=eb(t.minor),n=eb(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 zie(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 Pl(t=[],e){let r=zie(t);return e&&(r[0]!==e||isNaN(r[1]))&&(r=[e,0]),r}function d6(t,e,r={}){let n=r.build!==void 0?kl(r.build):t.build??[];switch(e){case"premajor":return{major:t.major+1,minor:0,patch:0,prerelease:Pl(t.prerelease,r.prerelease),build:n};case"preminor":return{major:t.major,minor:t.minor+1,patch:0,prerelease:Pl(t.prerelease,r.prerelease),build:n};case"prepatch":return{major:t.major,minor:t.minor,patch:t.patch+1,prerelease:Pl(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:Pl(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:Pl(t.prerelease,r.prerelease),build:n};default:throw new TypeError(`Cannot increment version: invalid argument ${e}`)}}var tb={major:Number.NaN,minor:Number.NaN,patch:Number.NaN,prerelease:[],build:[]},h6={operator:void 0,...tb};function rb(t,e){return ar(t,e)>0}function So(t,e){return ar(t,e)<0}function Xt(t){if(typeof t!="string")throw new TypeError(`Cannot parse version as version must be a string: received ${typeof t}`);if(t.length>Zv)throw new TypeError(`Cannot parse version as version length is too long: length is ${t.length}, max length is ${Zv}`);t=t.trim();let e=t.match(u6)?.groups;if(!e)throw new TypeError(`Cannot parse version: ${t}`);let r=Tl(e.major,`Cannot parse version ${t}: invalid major version`),n=Tl(e.minor,`Cannot parse version ${t}: invalid minor version`),i=Tl(e.patch,`Cannot parse version ${t}: invalid patch version`),o=e.prerelease?Qv(e.prerelease):[],s=e.buildmetadata?kl(e.buildmetadata):[];return{major:r,minor:n,patch:i,prerelease:o,build:s}}function m6(t,e){return ar(t,e)>=0}var E6=require("node:process");var g6=require("node:process");async function y6(t,e,r){let{data:n,error:i}=await t.from("channels").select().eq("app_id",e).eq("version",r.id);if(i&&(p.error(`Cannot check Version ${e}@${r.name}`),k.error("")),n&&n.length>0){if(Z(`\u274C Version ${e}@${r.name} is used in ${n.length} channel`),await Pe({message:"unlink it?"}))for(let o of n){let s=_e();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,g6.exit)(1)),s.stop(`\u2705 Channel ${o.name} unlinked`)}else p.error("Unlink it first"),k.error("");J(`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&&(p.error(`Cannot call findUnknownVersion as it returned an error.
|
|
278
|
+
${Q(n)}`),k.error("")),r))}function D6(t,e){return t.from("channels").insert(e).select().single()}function v6(t,e,r,n){return t.from("channels").delete().eq("name",e).eq("app_id",r).single()}function b6(t,e,r){return t.from("channels").select(`
|
|
279
279
|
id,
|
|
280
280
|
version (id, name)
|
|
281
|
-
`).eq("app_id",e).eq("name",r).single().throwOnError().then(({data:n})=>n?.version)}function
|
|
281
|
+
`).eq("app_id",e).eq("name",r).single().throwOnError().then(({data:n})=>n?.version)}function w6(t){let e=new sr;e.theme=sr.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.allow_emulator?"\u2705":"\u274C",r.allow_dev?"\u2705":"\u274C"])}),p.success("Channels"),p.success(e.toString())}async function _6(t,e){let{data:r,error:n}=await t.from("channels").select(`
|
|
282
282
|
id,
|
|
283
283
|
name,
|
|
284
284
|
public,
|
|
@@ -293,49 +293,49 @@ ${Q(n)}`),k.error("")),r))}function y6(t,e){return t.from("channels").insert(e).
|
|
|
293
293
|
created_by,
|
|
294
294
|
app_id,
|
|
295
295
|
version (id, name)
|
|
296
|
-
`).eq("app_id",e).order("created_at",{ascending:!1});return n&&(p.error(`App ${e} not found in database`),k.error("")),r}async function ib(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&&(p.error(`App Version ${e}@${r} not found in database`),k.error(""))}async function Ah(t,e,r){let n=await zie(t,e,r);await g6(t,e,n),await ib(t,e,r)}function kh(t){t.length||(p.error("No bundle found"),(0,_6.exit)(1));let e=new sr;e.theme=sr.roundTheme,e.headers=["Version","Created","Keep"],t.reverse().forEach(r=>{e.rows.push([r.name,ua(r.created_at),r.keep!=null?r.keep:""])}),p.success("Bundles"),p.success(e.toString())}async function Th(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&&(p.error(`App ${e} not found in database`),k.error("")),r}async function E6(t,e){let{data:r,error:n}=await t.from("channels").select("version").eq("app_id",e);return n&&(p.error(`App ${e} not found in database`),k.error("")),r.map(i=>i.version)}async function zie(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)&&(p.error(`App Version ${e}@${r} doesn't exist`),k.error("")),n}async function Gie(t,e,r){for await(let n of t)p.warn(`Removing ${n.name} created on ${ua(n.created_at)}`),await Ah(e,r,n.name)}function Wie(t,e,r){let n=[];return t?.forEach(i=>{let o=Xt(i.name);rb(o,e)&&So(o,r)&&n.push(i)}),n}async function C6(t,e){Z("Cleanup versions in Capgo"),await Ae(),e.apikey=e.apikey||de();let{bundle:r,keep:n=4}=e,i=e.force||!1,o=await te();t=pe(t,o?.config),e.apikey||(p.error("Missing API key, you need to provide an API key to delete your app"),k.error("")),t||(p.error("Missing argument, you need to provide a appid, or be in a capacitor project"),k.error(""));let s=await fe(e.apikey);await he(s,e.apikey,["write","all"]),await qe(s,e.apikey,t,3),p.info("Querying all available versions in Capgo");let a=await Th(s,t),u=await E6(s,t);if(p.info(`Total active versions in Capgo: ${a?.length}`),a?.length===0){p.error("No versions found, aborting cleanup");return}if(r){let f=Xt(r),h=f6(f,"major");p.info(`Querying available versions in Capgo between ${wa(f)} and ${wa(h)}`),a=Wie(a,f,h),p.info(`Active versions in Capgo between ${wa(f)} and ${wa(h)}: ${a?.length}`)}let l=[],c=0;if(a.forEach(f=>{let h=u.find(d=>d===f.id);c<n||h?(h?f.keep="\u2705 (Linked to channel)":f.keep="\u2705",c+=1):(f.keep="\u274C",l.push(f))}),l.length===0){p.warn("Nothing to be removed, aborting removal...");return}if(kh(a),!i){let f=await Pe({message:"Do you want to continue removing the versions specified?"});(st(f)||!f)&&(p.warn("Not confirmed, aborting removal..."),(0,ob.exit)())}p.success("You have confirmed removal, removing versions now"),await Gie(l,s,t),J("Done \u2705"),(0,ob.exit)()}var S6=ue(G0());async function x6(t,e){Z("Check compatibility"),e.apikey=e.apikey||de();let r=await te();t=pe(t,r?.config);let{channel:n}=e;n||(p.error("Missing argument, you need to provide a channel"),k.error("")),e.apikey||(p.error("Missing API key, you need to provide a API key to upload your bundle"),k.error("")),t||(p.error("Missing argument, you need to provide a appId, or be in a capacitor project"),k.error(""));let i=await fe(e.apikey);await he(i,e.apikey,["write","all","read","upload"]),await qe(i,e.apikey,t,1);let{finalCompatibility:o}=await hh(i,t,n,e.packageJson,e.nodeModules),s=new sr;s.headers=["Package","Local version","Remote version","Compatible"],s.theme=sr.roundTheme,s.rows=[];let a=e.text?"Yes":"\u2705",u=e.text?"No":"\u274C";o.forEach(l=>{let{name:c,localVersion:f,remoteVersion:h}=l,d=u;try{d=(0,S6.default)(f??"",h??"")?a:u}catch(m){p.error(`Fail when compare. Error: ${m}`)}s.rows.push([c,f,h,d])}),p.success("Compatibility"),p.success(s.toString())}var nn=require("node:fs"),T6=require("node:process");var P6=ue(du());var di=require("node:buffer"),Et=require("node:crypto"),F6="aes-128-cbc",Pn="base64",Ph=Et.constants.RSA_PKCS1_PADDING;function Rh(t){let e=(0,Et.randomBytes)(16),r=(0,Et.randomBytes)(16),n=e.toString(Pn),i=(0,Et.privateEncrypt)({key:t,padding:Ph},r).toString(Pn);return{sessionKey:r,ivSessionKey:`${n}:${i}`}}function _a(t,e,r){let[n]=r.split(":"),i=di.Buffer.from(n,Pn),o=(0,Et.createCipheriv)(F6,e,i);return o.setAutoPadding(!0),di.Buffer.concat([o.update(t),o.final()])}function O6(t,e,r){let[n,i]=e.split(":"),o=(0,Et.publicDecrypt)({key:r,padding:Ph},di.Buffer.from(i,Pn)),s=di.Buffer.from(n,Pn),a=(0,Et.createDecipheriv)(F6,o,s);return a.setAutoPadding(!0),di.Buffer.concat([a.update(t),a.final()])}function Ea(t,e){return(0,Et.privateEncrypt)({key:e,padding:Ph},di.Buffer.from(t,Pn)).toString(Pn)}function A6(t="pem",e=2048){let{publicKey:r,privateKey:n}=(0,Et.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")}}function k6(t,e){return(0,Et.publicDecrypt)({key:e,padding:Ph},di.Buffer.from(t,Pn)).toString(Pn)}async function R6(t,e,r){Z("Decrypt zip file"),await Ae(),(0,nn.existsSync)(t)||(p.error(`Zip not found at the path ${t}`),k.error(""));let n=await te();!r.key&&!(0,nn.existsSync)(Fn)&&!n.config.plugins?.CapacitorUpdater?.privateKey&&(p.error(`Private Key not found at the path ${Fn} or in ${n.path}`),k.error(""));let i=r.key||Fn,o=n.config.plugins?.CapacitorUpdater?.publicKey;!(0,nn.existsSync)(i)&&!o?(p.error(`Cannot find public key ${i} or as keyData option or in ${n.path}`),k.error("")):(0,nn.existsSync)(i)&&(o=(0,nn.readFileSync)(i).toString());let s=(0,nn.readFileSync)(t),a=O6(s,e,r.keyData??o??"");if((0,nn.writeFileSync)(`${t}_decrypted.zip`,a),p.info(`Decrypted zip file at ${t}_decrypted.zip`),r.checksum){let u=await(0,P6.checksum)(a,"sha256"),l=k6(r.checksum,r.keyData??o??"");u!==l?(p.error(`Checksum does not match ${u} !== ${l}`),k.error("")):p.info("Checksum matches")}J("\u2705 done"),(0,T6.exit)()}var $6=require("node:process");async function I6(t,e,r){Z("Delete bundle"),r.apikey=r.apikey||de();let n=await te();e=pe(e,n?.config),r.apikey||(p.error("Missing API key, you need to provide a API key to upload your bundle"),k.error("")),e||(p.error("Missing argument, you need to provide a appId, or be in a capacitor project"),k.error(""));let i=await fe(r.apikey);await he(i,r.apikey,["write","all"]),await qe(i,r.apikey,e,3),r.apikey||(p.error("Missing API key, you need to provide an API key to delete your app"),k.error("")),t||(p.error("Missing argument, you need to provide a bundleId, or be in a capacitor project"),k.error("")),e||(p.error("Missing argument, you need to provide a appId, or be in a capacitor project"),k.error("")),p.info(`Deleting bundle ${e}@${t} from Capgo`),p.info("Keep in mind that you will not be able to reuse this bundle version, it's gone forever"),await Ah(i,e,t),p.success(`Bundle ${e}@${t} deleted in Capgo`),J("Done"),(0,$6.exit)()}var Rn=require("node:fs"),j6=require("node:process");async function N6(t,e,r){let{json:n}=r;n||(Z("Encryption"),await Ae());let i=await te(),o=!!i.config.plugins?.CapacitorUpdater?.privateKey,s=!!i.config.plugins?.CapacitorUpdater?.publicKey;o&&!n&&p.warning("There is still a privateKey in the config"),(0,Rn.existsSync)(t)||(n?console.error(Q({error:"zip_not_found"})):p.error(`Error: Zip not found at the path ${t}`),k.error("")),s||(n?console.error(Q({error:"missing_public_key"})):p.warning("Warning: Missing Public Key in config"),k.error(""));let a=r.key||or,u=r.keyData||"";!(0,Rn.existsSync)(a)&&!u?(n?console.error(Q({error:"missing_key"})):(p.warning(`Cannot find a private key at ${a} or as a keyData option`),p.error("Error: Missing key")),k.error("")):(0,Rn.existsSync)(a)&&(u=(0,Rn.readFileSync)(a).toString()),u&&!u.startsWith("-----BEGIN RSA PRIVATE KEY-----")&&(n?console.error(Q({error:"invalid_private_key"})):p.error("the private key provided is not a valid RSA Private key"),k.error(""));let l=(0,Rn.readFileSync)(t),{sessionKey:c,ivSessionKey:f}=Rh(u),h=_a(l,c,f),d=Ea(e,u),m=`${t}_encrypted.zip`;n?console.log(JSON.stringify({checksum:d,filename:m,ivSessionKey:f},null,2)):(p.success(`Encoded Checksum: ${d}`),p.success(`ivSessionKey: ${f}`)),(0,Rn.writeFileSync)(m,h),n||(p.success(`Encrypted zip saved at ${m}`),J("Done \u2705")),(0,j6.exit)()}var L6=require("node:process");async function B6(t,e){Z("List bundles"),await Ae(),e.apikey=e.apikey||de();let r=await te();t=pe(t,r?.config),e.apikey||(p.error("Missing API key, you need to provide a API key to upload your bundle"),k.error("")),t||(p.error("Missing argument, you need to provide a appid, or be in a capacitor project"),k.error(""));let n=await fe(e.apikey);await he(n,e.apikey,["write","all","read","upload"]),p.info(`Querying available versions of: ${t} in Capgo`),await qe(n,e.apikey,t,1);let i=await Th(n,t);p.info(`Active versions in Capgo: ${i?.length}`),kh(i),J("Done \u2705"),(0,L6.exit)()}var e8=require("node:crypto"),Ro=require("node:fs"),t8=require("node:path/posix"),Uh=require("node:process");var $h=class extends TransformStream{outChunkSize;constructor(e){let r=new Uint8Array(e),n=0;super({transform(i,o){let s=0;for(;s<i.length;){let a=e-n,u=Math.min(a,i.length-s);r.set(i.subarray(s,s+u),n),s+=u,n+=u,n===e&&(o.enqueue(r),r=new Uint8Array(e),n=0)}},flush(i){n>0&&i.enqueue(r.subarray(0,n))}}),this.outChunkSize=e}};function hi(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(;!(l()||c("?>"));){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(;!(l()||c(">")||c("?>")||c("/>"));){let m=o();if(!m)return h;h.attributes[m.name]=m.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("<","<").replaceAll(">",">").replaceAll("&","&")}function u(f){let h=t.match(f);if(h)return t=t.slice(h[0].length),h}function l(){return t.length==0}function c(f){return t.indexOf(f)==0}}var on=class extends Error{constructor(e){super(e)}};var Er=class extends on{},Ih=class extends on{},jh=class extends on{},$n=class extends on{},xo=class extends on{},Rl=class extends on{},$l=class extends on{},In=class extends on{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 q6(t){try{let r=hi(await t.text()).root;if(r?.name!=="Error")throw new Error("Invalid root, expected <Error>");let n=r.children.find(l=>l.name==="Code")?.content??"UnknownErrorCode",i=r.children.find(l=>l.name==="Message")?.content??"The error message could not be determined.",o=r.children.find(l=>l.name==="Key")?.content,s=r.children.find(l=>l.name==="BucketName")?.content,a=r.children.find(l=>l.name==="Resource")?.content,u=r.children.find(l=>l.name==="Region")?.content;return new In(t.status,n,i,{key:o,bucketName:s,resource:a,region:u})}catch{return new In(t.status,"UnrecognizedError",`Error: Unexpected response code ${t.status} ${t.statusText}. Unable to parse response as XML.`)}}function M6(t){return typeof t!="number"||isNaN(t)||t<=0?!1:t>=1&&t<=65535}function U6(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 Fo(t){return!(!Kie(t)||t.length===0)}function Kie(t){return!(typeof t!="string"||t.length>1024)}function Nh(t){return Array.from(t).map(e=>e.toString(16).padStart(2,"0")).join("")}function Oo(t=""){let e={'"':"",""":"",""":"",""":"",""":""};return t.replace(/^("|"|")|("|"|")$/g,r=>e[r])}function ab(t){return t.get("x-amz-version-id")??null}function Il(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 lb(t,e){return`${ub(e)}/${t}/s3/aws4_request`}async function Lh(t){return t instanceof Uint8Array||(t=new TextEncoder().encode(t)),Nh(new Uint8Array(await crypto.subtle.digest("SHA-256",t)))}var Yie=["x-amz-server-side-encryption-customer-algorithm","x-amz-server-side-encryption-customer-key","x-amz-server-side-encryption-customer-key-MD5"],Bh=class extends WritableStream{getResult;constructor({client:e,bucketName:r,objectName:n,partSize:i,metadata:o}){let s,a=1,u,l=[],c=[];super({start(){},async write(f,h){let d="PUT",m=a++;try{if(m==1&&f.length<i){let _=await e.makeRequest({method:d,headers:new Headers({...o,"Content-Length":String(f.length)}),bucketName:r,objectName:n,payload:f});s={etag:Oo(_.headers.get("etag")??void 0),versionId:ab(_.headers)};return}m===1&&(u=(await Jie({client:e,bucketName:r,objectName:n,metadata:o})).uploadId);let b={"Content-Length":String(f.length)};for(let _ of Yie){let F=o[_];F&&(b[_]=F)}let D=e.makeRequest({method:d,query:{partNumber:m.toString(),uploadId:u},headers:new Headers(b),bucketName:r,objectName:n,payload:f});D.then(_=>{let F=_.headers.get("etag")??"";F&&(F=F.replace(/^"/,"").replace(/"$/,"")),l.push({part:m,etag:F})}),c.push(D)}catch(b){throw b}},async close(){if(!s)if(u)await Promise.all(c),l.sort((f,h)=>f.part>h.part?1:-1),s=await Xie({client:e,bucketName:r,objectName:n,uploadId:u,etags:l});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 Jie(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=hi(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 Xie({client:t,bucketName:e,objectName:r,uploadId:n,etags:i}){let o=`
|
|
296
|
+
`).eq("app_id",e).order("created_at",{ascending:!1});return n&&(p.error(`App ${e} not found in database`),k.error("")),r}async function ib(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&&(p.error(`App Version ${e}@${r} not found in database`),k.error(""))}async function Ah(t,e,r){let n=await Gie(t,e,r);await y6(t,e,n),await ib(t,e,r)}function kh(t){t.length||(p.error("No bundle found"),(0,E6.exit)(1));let e=new sr;e.theme=sr.roundTheme,e.headers=["Version","Created","Keep"],t.reverse().forEach(r=>{e.rows.push([r.name,ua(r.created_at),r.keep!=null?r.keep:""])}),p.success("Bundles"),p.success(e.toString())}async function Th(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&&(p.error(`App ${e} not found in database`),k.error("")),r}async function C6(t,e){let{data:r,error:n}=await t.from("channels").select("version").eq("app_id",e);return n&&(p.error(`App ${e} not found in database`),k.error("")),r.map(i=>i.version)}async function Gie(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)&&(p.error(`App Version ${e}@${r} doesn't exist`),k.error("")),n}async function Wie(t,e,r){for await(let n of t)p.warn(`Removing ${n.name} created on ${ua(n.created_at)}`),await Ah(e,r,n.name)}function Kie(t,e,r){let n=[];return t?.forEach(i=>{let o=Xt(i.name);rb(o,e)&&So(o,r)&&n.push(i)}),n}async function S6(t,e){Z("Cleanup versions in Capgo"),await Ae(),e.apikey=e.apikey||de();let{bundle:r,keep:n=4}=e,i=e.force||!1,o=await te();t=pe(t,o?.config),e.apikey||(p.error("Missing API key, you need to provide an API key to delete your app"),k.error("")),t||(p.error("Missing argument, you need to provide a appid, or be in a capacitor project"),k.error(""));let s=await fe(e.apikey);await he(s,e.apikey,["write","all"]),await qe(s,e.apikey,t,3),p.info("Querying all available versions in Capgo");let a=await Th(s,t),u=await C6(s,t);if(p.info(`Total active versions in Capgo: ${a?.length}`),a?.length===0){p.error("No versions found, aborting cleanup");return}if(r){let f=Xt(r),h=d6(f,"major");p.info(`Querying available versions in Capgo between ${wa(f)} and ${wa(h)}`),a=Kie(a,f,h),p.info(`Active versions in Capgo between ${wa(f)} and ${wa(h)}: ${a?.length}`)}let l=[],c=0;if(a.forEach(f=>{let h=u.find(d=>d===f.id);c<n||h?(h?f.keep="\u2705 (Linked to channel)":f.keep="\u2705",c+=1):(f.keep="\u274C",l.push(f))}),l.length===0){p.warn("Nothing to be removed, aborting removal...");return}if(kh(a),!i){let f=await Pe({message:"Do you want to continue removing the versions specified?"});(st(f)||!f)&&(p.warn("Not confirmed, aborting removal..."),(0,ob.exit)())}p.success("You have confirmed removal, removing versions now"),await Wie(l,s,t),J("Done \u2705"),(0,ob.exit)()}var x6=ue(G0());async function F6(t,e){Z("Check compatibility"),e.apikey=e.apikey||de();let r=await te();t=pe(t,r?.config);let{channel:n}=e;n||(p.error("Missing argument, you need to provide a channel"),k.error("")),e.apikey||(p.error("Missing API key, you need to provide a API key to upload your bundle"),k.error("")),t||(p.error("Missing argument, you need to provide a appId, or be in a capacitor project"),k.error(""));let i=await fe(e.apikey);await he(i,e.apikey,["write","all","read","upload"]),await qe(i,e.apikey,t,1);let{finalCompatibility:o}=await hh(i,t,n,e.packageJson,e.nodeModules),s=new sr;s.headers=["Package","Local version","Remote version","Compatible"],s.theme=sr.roundTheme,s.rows=[];let a=e.text?"Yes":"\u2705",u=e.text?"No":"\u274C";o.forEach(l=>{let{name:c,localVersion:f,remoteVersion:h}=l,d=u;try{d=(0,x6.default)(f??"",h??"")?a:u}catch(m){p.error(`Fail when compare. Error: ${m}`)}s.rows.push([c,f,h,d])}),p.success("Compatibility"),p.success(s.toString())}var nn=require("node:fs"),P6=require("node:process");var R6=ue(du());var di=require("node:buffer"),Et=require("node:crypto"),O6="aes-128-cbc",Pn="base64",Ph=Et.constants.RSA_PKCS1_PADDING;function Rh(t){let e=(0,Et.randomBytes)(16),r=(0,Et.randomBytes)(16),n=e.toString(Pn),i=(0,Et.privateEncrypt)({key:t,padding:Ph},r).toString(Pn);return{sessionKey:r,ivSessionKey:`${n}:${i}`}}function _a(t,e,r){let[n]=r.split(":"),i=di.Buffer.from(n,Pn),o=(0,Et.createCipheriv)(O6,e,i);return o.setAutoPadding(!0),di.Buffer.concat([o.update(t),o.final()])}function A6(t,e,r){let[n,i]=e.split(":"),o=(0,Et.publicDecrypt)({key:r,padding:Ph},di.Buffer.from(i,Pn)),s=di.Buffer.from(n,Pn),a=(0,Et.createDecipheriv)(O6,o,s);return a.setAutoPadding(!0),di.Buffer.concat([a.update(t),a.final()])}function Ea(t,e){return(0,Et.privateEncrypt)({key:e,padding:Ph},di.Buffer.from(t,Pn)).toString(Pn)}function k6(t="pem",e=2048){let{publicKey:r,privateKey:n}=(0,Et.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")}}function T6(t,e){return(0,Et.publicDecrypt)({key:e,padding:Ph},di.Buffer.from(t,Pn)).toString(Pn)}async function $6(t,e,r){Z("Decrypt zip file"),await Ae(),(0,nn.existsSync)(t)||(p.error(`Zip not found at the path ${t}`),k.error(""));let n=await te();!r.key&&!(0,nn.existsSync)(Fn)&&!n.config.plugins?.CapacitorUpdater?.privateKey&&(p.error(`Private Key not found at the path ${Fn} or in ${n.path}`),k.error(""));let i=r.key||Fn,o=n.config.plugins?.CapacitorUpdater?.publicKey;!(0,nn.existsSync)(i)&&!o?(p.error(`Cannot find public key ${i} or as keyData option or in ${n.path}`),k.error("")):(0,nn.existsSync)(i)&&(o=(0,nn.readFileSync)(i).toString());let s=(0,nn.readFileSync)(t),a=A6(s,e,r.keyData??o??"");if((0,nn.writeFileSync)(`${t}_decrypted.zip`,a),p.info(`Decrypted zip file at ${t}_decrypted.zip`),r.checksum){let u=await(0,R6.checksum)(a,"sha256"),l=T6(r.checksum,r.keyData??o??"");u!==l?(p.error(`Checksum does not match ${u} !== ${l}`),k.error("")):p.info("Checksum matches")}J("\u2705 done"),(0,P6.exit)()}var I6=require("node:process");async function j6(t,e,r){Z("Delete bundle"),r.apikey=r.apikey||de();let n=await te();e=pe(e,n?.config),r.apikey||(p.error("Missing API key, you need to provide a API key to upload your bundle"),k.error("")),e||(p.error("Missing argument, you need to provide a appId, or be in a capacitor project"),k.error(""));let i=await fe(r.apikey);await he(i,r.apikey,["write","all"]),await qe(i,r.apikey,e,3),r.apikey||(p.error("Missing API key, you need to provide an API key to delete your app"),k.error("")),t||(p.error("Missing argument, you need to provide a bundleId, or be in a capacitor project"),k.error("")),e||(p.error("Missing argument, you need to provide a appId, or be in a capacitor project"),k.error("")),p.info(`Deleting bundle ${e}@${t} from Capgo`),p.info("Keep in mind that you will not be able to reuse this bundle version, it's gone forever"),await Ah(i,e,t),p.success(`Bundle ${e}@${t} deleted in Capgo`),J("Done"),(0,I6.exit)()}var Rn=require("node:fs"),N6=require("node:process");async function L6(t,e,r){let{json:n}=r;n||(Z("Encryption"),await Ae());let i=await te(),o=!!i.config.plugins?.CapacitorUpdater?.privateKey,s=!!i.config.plugins?.CapacitorUpdater?.publicKey;o&&!n&&p.warning("There is still a privateKey in the config"),(0,Rn.existsSync)(t)||(n?console.error(Q({error:"zip_not_found"})):p.error(`Error: Zip not found at the path ${t}`),k.error("")),s||(n?console.error(Q({error:"missing_public_key"})):p.warning("Warning: Missing Public Key in config"),k.error(""));let a=r.key||or,u=r.keyData||"";!(0,Rn.existsSync)(a)&&!u?(n?console.error(Q({error:"missing_key"})):(p.warning(`Cannot find a private key at ${a} or as a keyData option`),p.error("Error: Missing key")),k.error("")):(0,Rn.existsSync)(a)&&(u=(0,Rn.readFileSync)(a).toString()),u&&!u.startsWith("-----BEGIN RSA PRIVATE KEY-----")&&(n?console.error(Q({error:"invalid_private_key"})):p.error("the private key provided is not a valid RSA Private key"),k.error(""));let l=(0,Rn.readFileSync)(t),{sessionKey:c,ivSessionKey:f}=Rh(u),h=_a(l,c,f),d=Ea(e,u),m=`${t}_encrypted.zip`;n?console.log(JSON.stringify({checksum:d,filename:m,ivSessionKey:f},null,2)):(p.success(`Encoded Checksum: ${d}`),p.success(`ivSessionKey: ${f}`)),(0,Rn.writeFileSync)(m,h),n||(p.success(`Encrypted zip saved at ${m}`),J("Done \u2705")),(0,N6.exit)()}var B6=require("node:process");async function q6(t,e){Z("List bundles"),await Ae(),e.apikey=e.apikey||de();let r=await te();t=pe(t,r?.config),e.apikey||(p.error("Missing API key, you need to provide a API key to upload your bundle"),k.error("")),t||(p.error("Missing argument, you need to provide a appid, or be in a capacitor project"),k.error(""));let n=await fe(e.apikey);await he(n,e.apikey,["write","all","read","upload"]),p.info(`Querying available versions of: ${t} in Capgo`),await qe(n,e.apikey,t,1);let i=await Th(n,t);p.info(`Active versions in Capgo: ${i?.length}`),kh(i),J("Done \u2705"),(0,B6.exit)()}var t8=require("node:crypto"),Ro=require("node:fs"),r8=require("node:path/posix"),Uh=require("node:process");var $h=class extends TransformStream{outChunkSize;constructor(e){let r=new Uint8Array(e),n=0;super({transform(i,o){let s=0;for(;s<i.length;){let a=e-n,u=Math.min(a,i.length-s);r.set(i.subarray(s,s+u),n),s+=u,n+=u,n===e&&(o.enqueue(r),r=new Uint8Array(e),n=0)}},flush(i){n>0&&i.enqueue(r.subarray(0,n))}}),this.outChunkSize=e}};function hi(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(;!(l()||c("?>"));){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(;!(l()||c(">")||c("?>")||c("/>"));){let m=o();if(!m)return h;h.attributes[m.name]=m.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("<","<").replaceAll(">",">").replaceAll("&","&")}function u(f){let h=t.match(f);if(h)return t=t.slice(h[0].length),h}function l(){return t.length==0}function c(f){return t.indexOf(f)==0}}var on=class extends Error{constructor(e){super(e)}};var Er=class extends on{},Ih=class extends on{},jh=class extends on{},$n=class extends on{},xo=class extends on{},Rl=class extends on{},$l=class extends on{},In=class extends on{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 M6(t){try{let r=hi(await t.text()).root;if(r?.name!=="Error")throw new Error("Invalid root, expected <Error>");let n=r.children.find(l=>l.name==="Code")?.content??"UnknownErrorCode",i=r.children.find(l=>l.name==="Message")?.content??"The error message could not be determined.",o=r.children.find(l=>l.name==="Key")?.content,s=r.children.find(l=>l.name==="BucketName")?.content,a=r.children.find(l=>l.name==="Resource")?.content,u=r.children.find(l=>l.name==="Region")?.content;return new In(t.status,n,i,{key:o,bucketName:s,resource:a,region:u})}catch{return new In(t.status,"UnrecognizedError",`Error: Unexpected response code ${t.status} ${t.statusText}. Unable to parse response as XML.`)}}function U6(t){return typeof t!="number"||isNaN(t)||t<=0?!1:t>=1&&t<=65535}function H6(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 Fo(t){return!(!Yie(t)||t.length===0)}function Yie(t){return!(typeof t!="string"||t.length>1024)}function Nh(t){return Array.from(t).map(e=>e.toString(16).padStart(2,"0")).join("")}function Oo(t=""){let e={'"':"",""":"",""":"",""":"",""":""};return t.replace(/^("|"|")|("|"|")$/g,r=>e[r])}function ab(t){return t.get("x-amz-version-id")??null}function Il(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 lb(t,e){return`${ub(e)}/${t}/s3/aws4_request`}async function Lh(t){return t instanceof Uint8Array||(t=new TextEncoder().encode(t)),Nh(new Uint8Array(await crypto.subtle.digest("SHA-256",t)))}var Jie=["x-amz-server-side-encryption-customer-algorithm","x-amz-server-side-encryption-customer-key","x-amz-server-side-encryption-customer-key-MD5"],Bh=class extends WritableStream{getResult;constructor({client:e,bucketName:r,objectName:n,partSize:i,metadata:o}){let s,a=1,u,l=[],c=[];super({start(){},async write(f,h){let d="PUT",m=a++;try{if(m==1&&f.length<i){let _=await e.makeRequest({method:d,headers:new Headers({...o,"Content-Length":String(f.length)}),bucketName:r,objectName:n,payload:f});s={etag:Oo(_.headers.get("etag")??void 0),versionId:ab(_.headers)};return}m===1&&(u=(await Xie({client:e,bucketName:r,objectName:n,metadata:o})).uploadId);let b={"Content-Length":String(f.length)};for(let _ of Jie){let F=o[_];F&&(b[_]=F)}let D=e.makeRequest({method:d,query:{partNumber:m.toString(),uploadId:u},headers:new Headers(b),bucketName:r,objectName:n,payload:f});D.then(_=>{let F=_.headers.get("etag")??"";F&&(F=F.replace(/^"/,"").replace(/"$/,"")),l.push({part:m,etag:F})}),c.push(D)}catch(b){throw b}},async close(){if(!s)if(u)await Promise.all(c),l.sort((f,h)=>f.part>h.part?1:-1),s=await Zie({client:e,bucketName:r,objectName:n,uploadId:u,etags:l});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 Xie(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=hi(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 Zie({client:t,bucketName:e,objectName:r,uploadId:n,etags:i}){let o=`
|
|
297
297
|
<CompleteMultipartUpload xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
|
|
298
298
|
${i.map(f=>` <Part><PartNumber>${f.part}</PartNumber><ETag>${f.etag}</ETag></Part>`).join(`
|
|
299
299
|
`)}
|
|
300
300
|
</CompleteMultipartUpload>
|
|
301
|
-
`,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=hi(a).root;if(!u||u.name!=="CompleteMultipartUploadResult")throw new Error(`Unexpected response: ${a}`);let l=u.children.find(f=>f.name==="ETag")?.content;if(!l)throw new Error(`Unable to get ETag from response: ${a}`);let c=ab(s.headers);return{etag:Oo(l),versionId:c}}var cb="AWS4-HMAC-SHA256";async function
|
|
301
|
+
`,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=hi(a).root;if(!u||u.name!=="CompleteMultipartUploadResult")throw new Error(`Unexpected response: ${a}`);let l=u.children.find(f=>f.name==="ETag")?.content;if(!l)throw new Error(`Unable to get ETag from response: ${a}`);let c=ab(s.headers);return{etag:Oo(l),versionId:c}}var cb="AWS4-HMAC-SHA256";async function V6(t){if(!t.accessKey)throw new xo("accessKey is required for signing");if(!t.secretKey)throw new Rl("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=G6(t.headers),n=W6(t.method,t.path,t.headers,r,e),i=await K6(n,t.date,t.region),o=await Y6(t.date,t.region,t.secretKey),s=J6(t.accessKey,t.region,t.date),a=Nh(await Ca(o,i)).toLowerCase();return`${cb} Credential=${s}, SignedHeaders=${r.join(";").toLowerCase()}, Signature=${a}`}async function z6(t){if(!t.accessKey)throw new xo("accessKey is required for signing");if(!t.secretKey)throw new Rl("secretKey is required for signing");if(t.expirySeconds<1)throw new $l("expirySeconds cannot be less than 1 seconds");if(t.expirySeconds>604800)throw new $l("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=Il(t.date),i=G6(t.headers),o=J6(t.accessKey,t.region,t.date),s="UNSIGNED-PAYLOAD",a=new URLSearchParams(r);a.set("X-Amz-Algorithm",cb),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"),l=W6(t.method,u,t.headers,i,s),c=await K6(l,t.date,t.region),f=await Y6(t.date,t.region,t.secretKey),h=Nh(await Ca(f,c)).toLowerCase();return`${t.protocol}//${t.headers.get("Host")}${u}&X-Amz-Signature=${h}`}function G6(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 Ao={A:65,Z:90,a:97,z:122,0:48,9:57,"/":47},Qie="-._~".split("").map(t=>t.charCodeAt(0));function eoe(t,e=!1){let r=new TextEncoder().encode(t),n="";for(let i of r)i>=Ao.A&&i<=Ao.Z||i>=Ao.a&&i<=Ao.z||i>=Ao[0]&&i<=Ao[9]||Qie.includes(i)||i==Ao["/"]&&e?n+=String.fromCharCode(i):n+="%"+i.toString(16).padStart(2,"0").toUpperCase();return n}function W6(t,e,r,n,i){let o=n.reduce((l,c)=>{let f=`${r.get(c)}`.replace(/ +/g," ");return l.push(`${c.toLowerCase()}:${f}`),l},[]),s=e.split("?")[0],a=e.split("?")[1];a?a=a.split("&").sort().map(l=>l.indexOf("=")===-1?l+"=":l).join("&"):a="";let u=[];return u.push(t.toUpperCase()),u.push(eoe(s,!0)),u.push(a),u.push(o.join(`
|
|
302
302
|
`)+`
|
|
303
303
|
`),u.push(n.join(";").toLowerCase()),u.push(i),u.join(`
|
|
304
|
-
`)}async function
|
|
305
|
-
`)}async function K6(t,e,r){let n=ub(t),i=await Ca("AWS4"+r,n),o=await Ca(i,e),s=await Ca(o,"s3");return await Ca(s,"aws4_request")}function Y6(t,e,r){return`${t}/${lb(e,r)}`}async function Ca(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 eoe=["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"],toe=5*1024*1024,roe=5*1024*1024*1024,fb=5*1024*1024*1024*1024,jl=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 Ih(`Invalid endPoint : ${e.endPoint}`);if(e.port!==void 0&&!M6(e.port))throw new Er(`Invalid port : ${e.port}`);if(e.accessKey&&!e.secretKey)throw new Er("If specifying access key, secret key must also be provided.");if(e.accessKey&&e.accessKey.startsWith("ASIA")&&!e.sessionToken)throw new Er("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||!U6(r))throw new jh(`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 l=await Lh(r??new Uint8Array);o.set("x-amz-date",Il(i)),o.set("x-amz-content-sha256",l),this.accessKey&&(this.sessionToken&&o.set("x-amz-security-token",this.sessionToken),o.set("authorization",await H6({headers:o,method:e,path:a,accessKey:this.accessKey,secretKey:this.#e,region:this.region,date:i})));let c=`${this.protocol}//${s}${a}`,f=await fetch(c,{method:e,headers:o,body:r});if(f.status!==u)throw f.status>=400?await q6(f):f.status===301?new In(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 In(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(!Fo(e))throw new $n(`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 In&&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(!Fo(e))throw new $n(`Invalid object name: ${e}`);let s=new Headers(Object.entries(i.metadata??{})),a=200;if(r||n){let l="";r?l=`bytes=${+r}-`:(l="bytes=0-",r=0),n&&(l+=`${+n+r-1}`),s.set("Range",l),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 xo(`Presigned ${e} URLs cannot be generated for anonymous requests. Specify an accessKey and secretKey.`);if(!Fo(r))throw new $n(`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 V6({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 Er("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(),l=hi(u).root;if(!l||l.name!=="ListBucketResult")throw new Error(`Unexpected response: ${u}`);let c=l.children.filter(d=>d.name==="CommonPrefixes").flatMap(d=>d.children),f=[];for(let d of c)f.push({type:"CommonPrefix",prefix:d.content??""}),o++;for(let d of l.children.filter(m=>m.name==="Contents"))f.push({type:"Object",key:d.children.find(m=>m.name==="Key")?.content??"",etag:Oo(d.children.find(m=>m.name==="ETag")?.content??""),size:parseInt(d.children.find(m=>m.name==="Size")?.content??"",10),lastModified:new Date(d.children.find(m=>m.name==="LastModified")?.content??"invalid")}),o++;f.sort((d,m)=>{let b=d.type==="Object"?d.key:d.prefix,D=m.type==="Object"?m.key:m.prefix;return b>D?1:b<D?-1:0});for(let d of f)yield d;if(l.children.find(d=>d.name==="IsTruncated")?.content==="true"){let d=l.children.find(m=>m.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(!Fo(e))throw new $n(`Invalid object name: ${e}`);let o,s;if(typeof r=="string"){let c=new TextEncoder().encode(r);typeof ReadableStream.from<"u"?s=ReadableStream.from([c]):s=new ReadableStream({start(f){f.enqueue(c),f.close()}}),o=c.length}else if(r instanceof Uint8Array)typeof ReadableStream.from<"u"?s=ReadableStream.from([r]):s=new ReadableStream({start(c){c.enqueue(r),c.close()}}),o=r.byteLength;else if(r instanceof ReadableStream)s=r;else throw new Er("Invalid stream/data type provided.");if(n?.size!==void 0){if(o!==void 0&&n?.size!==o)throw new Er(`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 Er(`invalid size specified: ${n.size}`);o=n.size}let a=n?.partSize??this.calculatePartSize(o);if(a<toe)throw new Er("Part size should be greater than 5MB");if(a>roe)throw new Er("Part size should be less than 6MB");let u=new $h(a),l=new Bh({client:this,bucketName:i,objectName:e,partSize:a,metadata:n?.metadata??{}});return await s.pipeThrough(u).pipeTo(l),l.getResult()}calculatePartSize(e){if(e===void 0&&(e=fb),e>fb)throw new TypeError(`size should not be more than ${fb}`);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(!Fo(e))throw new $n(`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 eoe)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:Oo(o.headers.get("ETag")??"")}}async copyObject(e,r,n){let i=this.getBucketName(n),o=e.sourceBucketName??i;if(!Fo(r))throw new $n(`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}),l=await u.text(),c=hi(l).root;if(!c||c.name!=="CopyObjectResult")throw new Error(`Unexpected response: ${l}`);let f=c.children.find(d=>d.name==="ETag")?.content??"",h=c.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:Oo(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 In&&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 hb=ue(du());var ko=require("node:fs"),qh=require("node:path");function noe(t,e){return(0,ko.readFileSync)(t,"utf8").includes(e)}function Nl(t,e){let r=(0,ko.readdirSync)(t);for(let n of r){let i=(0,qh.join)(t,n),o=(0,ko.statSync)(i);if(o.isDirectory()){if(Nl(i,e))return!0}else if(o.isFile()&&(0,qh.extname)(i)===".js"&&noe(i,e))return!0}return!1}function Mh(t){return(0,ko.readdirSync)(t).indexOf("index.html")>-1}var Ll=require("node:fs"),J6=require("node:os"),Po=require("node:path"),db=require("node:stream/consumers"),To=require("node:zlib");var X6=ue(Ty());async function Z6(t,e,r,n,i,o){let s=_e();s.start(i!=="v2"?"Generating the update manifest":"Generating the update manifest with v2 encryption");let a=await pI(t);return i==="v2"&&a.forEach(u=>{u.hash=Ea(u.hash,o)}),s.stop("Manifest generated successfully"),await Oe(e,{channel:"partial-update",event:"Generate manifest",icon:"\u{1F4C2}",user_id:r,tags:{"app-id":n},notify:!1}),a}function ioe(t){return(0,J6.platform)()!=="win32"?t:Po.win32.normalize(t).split(Po.win32.sep).join(Po.posix.sep)}async function Q6(t,e,r,n,i,o,s,a){let u=_e();u.start("Preparing partial update with TUS protocol");let l=performance.now(),c=await br(),f=0,h=e.length,d=4096,m=e.map(async b=>{let D=(0,Po.join)(r,b.file),_=ioe(b.file),F=(0,Ll.statSync)(D),g;if(F.size>=d){let A=(0,To.createBrotliCompress)({params:{[To.constants.BROTLI_PARAM_QUALITY]:4,[To.constants.BROTLI_PARAM_SIZE_HINT]:F.size,[To.constants.BROTLI_PARAM_MODE]:To.constants.BROTLI_MODE_TEXT}}),T=(0,Ll.createReadStream)(D).pipe(A);g=await(0,db.buffer)(T)}else g=await(0,db.buffer)((0,Ll.createReadStream)(D));let C=g;return s&&(C=_a(g,s.sessionKey,s.ivSessionKey)),new Promise((A,T)=>{new X6.Upload(C,{endpoint:`${c.hostFilesApi}/files/upload/attachments/`,chunkSize:a,metadata:{filename:`orgs/${o}/apps/${n}/${i}/${_}`},headers:{Authorization:t},onError(L){p.info(`Failed to upload ${_}: ${L}`),T(L)},onProgress(){let L=(f/h*100).toFixed(2);u.message(`Uploading partial update: ${L}%`)},onSuccess(){f++,A({file_name:_,s3_path:`orgs/${o}/apps/${n}/${i}/${_}`,file_hash:b.hash})}}).start()})});try{let b=await Promise.all(m),_=((performance.now()-l)/1e3).toFixed(2);return u.stop(`Partial update uploaded successfully \u{1F4AA} in (${_} seconds)`),await Oe(t,{channel:"app",event:"App Partial TUS done",icon:"\u23EB",user_id:o,tags:{"app-id":n},notify:!1}),await Oe(t,{channel:"performance",event:"Partial upload performance",icon:"\u{1F684}",user_id:o,tags:{"app-id":n,time:_},notify:!1}),b}catch(b){let _=((performance.now()-l)/1e3).toFixed(2);return u.stop(`Failed to upload Partial bundle ( after ${_} seconds)`),p.info(`Error uploading partial update: ${b}, This is not a critical error, the bundle has been uploaded without the partial files`),null}}async function ooe(t,e){let r=await vr("",e.packageJson),n=e.bundle||t?.plugins?.CapacitorUpdater?.version||r?.version||`0.0.1-beta.${(0,e8.randomUUID)().split("-")[0]}`;return oa.test(n)||(p.error(`Your bundle name ${n}, is not valid it should follow semver convention : https://semver.org/`),k.error("")),n}function soe(t){let e=t.apikey||de();return e||(p.error("Missing API key, you need to provide a API key to upload your bundle"),k.error("")),e}function aoe(t,e,r){let n=pe(t,r),i=e.path||r?.webDir;return n||(p.error("Missing argument, you need to provide a appid or be in a capacitor project"),k.error("")),i||(p.error("Missing argument, you need to provide a path (--path), or be in a capacitor project"),k.error("")),(0,Ro.existsSync)(i)||(p.error(`Path ${i} does not exist, build your app first, or provide a valid path`),k.error("")),{appid:n,path:i}}function uoe(t,e){let r=t.codeCheck;(typeof r>"u"||r)&&(Nl(e,"notifyAppReady")||(p.error("notifyAppReady() is missing in the build folder of your app. see: https://capgo.app/docs/plugin/api/#notifyappready"),k.error("")),Mh(e)||(p.error(`index.html is missing in the root folder of ${e}`),k.error("")))}async function loe(t,e,r,n,i,o){let s=r.ignoreMetadataCheck,a=r.autoMinUpdateVersion,u=r.minUpdateVersion,{data:l,error:c}=await t.from("channels").select("disable_auto_update, version ( min_update_version, native_packages )").eq("name",n).eq("app_id",i).single(),f=!!l&&l.disable_auto_update==="version_number",h,d;if(!c&&l&&l.version&&l.version.native_packages&&!s){let D=_e();D.start(`Checking bundle compatibility with channel ${n}`);let{finalCompatibility:_,localDependencies:F}=await hh(t,i,n,r.packageJson,r.nodeModules);if(d=_,h=F,d.find(g=>g.localVersion!==g.remoteVersion))D.stop(`Bundle NOT compatible with ${n} channel`),p.warn(`You can check compatibility with "${e.runner} @capgo/cli bundle compatibility"`),a&&(u=o,p.info(`Auto set min-update-version to ${u}`));else if(a)try{let{min_update_version:g}=l.version;(!g||!oa.test(g))&&(p.error("Invalid remote min update version, skipping auto setting compatibility"),k.error("")),u=g,D.stop(`Auto set min-update-version to ${u}`)}catch{p.error(`Cannot auto set compatibility, invalid data ${l}`),k.error("")}else D.stop(`Bundle compatible with ${n} channel`)}else s||(p.warn(`Channel ${n} is new or it's your first upload with compatibility check, it will be ignored this time`),h=await Ev(r.packageJson,r.nodeModules),a&&(u=o,p.info(`Auto set min-update-version to ${u}`)));f&&!u&&!s&&(p.error("You need to provide a min-update-version to upload a bundle to this channel"),k.error("")),u&&(oa.test(u)||(p.error(`Your minimal version update ${u}, is not valid it should follow semver convention : https://semver.org/`),k.error("")));let m=h?new Map(h.filter(D=>!!D.native&&D.native!==void 0).map(D=>[D.name,D])):new Map;return{nativePackages:m.size>0||!r.ignoreMetadataCheck?Array.from(m,([D,_])=>({name:D,version:_.version})):void 0,minUpdateVersion:u}}async function coe(t,e,r){let{data:n,error:i}=await t.rpc("is_trial_org",{orgid:e}).single();(n&&n>0||i)&&(p.warn(`WARNING !!
|
|
306
|
-
Trial expires in ${n} days`),p.warn(`Upgrade here: ${r.hostWeb}/dashboard/settings/plans?oid=${e}`))}async function
|
|
304
|
+
`)}async function K6(t,e,r){let n=await Lh(t),i=lb(r,e),o=[];return o.push(cb),o.push(Il(e)),o.push(i),o.push(n),o.join(`
|
|
305
|
+
`)}async function Y6(t,e,r){let n=ub(t),i=await Ca("AWS4"+r,n),o=await Ca(i,e),s=await Ca(o,"s3");return await Ca(s,"aws4_request")}function J6(t,e,r){return`${t}/${lb(e,r)}`}async function Ca(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 toe=["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"],roe=5*1024*1024,noe=5*1024*1024*1024,fb=5*1024*1024*1024*1024,jl=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 Ih(`Invalid endPoint : ${e.endPoint}`);if(e.port!==void 0&&!U6(e.port))throw new Er(`Invalid port : ${e.port}`);if(e.accessKey&&!e.secretKey)throw new Er("If specifying access key, secret key must also be provided.");if(e.accessKey&&e.accessKey.startsWith("ASIA")&&!e.sessionToken)throw new Er("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||!H6(r))throw new jh(`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 l=await Lh(r??new Uint8Array);o.set("x-amz-date",Il(i)),o.set("x-amz-content-sha256",l),this.accessKey&&(this.sessionToken&&o.set("x-amz-security-token",this.sessionToken),o.set("authorization",await V6({headers:o,method:e,path:a,accessKey:this.accessKey,secretKey:this.#e,region:this.region,date:i})));let c=`${this.protocol}//${s}${a}`,f=await fetch(c,{method:e,headers:o,body:r});if(f.status!==u)throw f.status>=400?await M6(f):f.status===301?new In(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 In(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(!Fo(e))throw new $n(`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 In&&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(!Fo(e))throw new $n(`Invalid object name: ${e}`);let s=new Headers(Object.entries(i.metadata??{})),a=200;if(r||n){let l="";r?l=`bytes=${+r}-`:(l="bytes=0-",r=0),n&&(l+=`${+n+r-1}`),s.set("Range",l),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 xo(`Presigned ${e} URLs cannot be generated for anonymous requests. Specify an accessKey and secretKey.`);if(!Fo(r))throw new $n(`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 z6({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 Er("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(),l=hi(u).root;if(!l||l.name!=="ListBucketResult")throw new Error(`Unexpected response: ${u}`);let c=l.children.filter(d=>d.name==="CommonPrefixes").flatMap(d=>d.children),f=[];for(let d of c)f.push({type:"CommonPrefix",prefix:d.content??""}),o++;for(let d of l.children.filter(m=>m.name==="Contents"))f.push({type:"Object",key:d.children.find(m=>m.name==="Key")?.content??"",etag:Oo(d.children.find(m=>m.name==="ETag")?.content??""),size:parseInt(d.children.find(m=>m.name==="Size")?.content??"",10),lastModified:new Date(d.children.find(m=>m.name==="LastModified")?.content??"invalid")}),o++;f.sort((d,m)=>{let b=d.type==="Object"?d.key:d.prefix,D=m.type==="Object"?m.key:m.prefix;return b>D?1:b<D?-1:0});for(let d of f)yield d;if(l.children.find(d=>d.name==="IsTruncated")?.content==="true"){let d=l.children.find(m=>m.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(!Fo(e))throw new $n(`Invalid object name: ${e}`);let o,s;if(typeof r=="string"){let c=new TextEncoder().encode(r);typeof ReadableStream.from<"u"?s=ReadableStream.from([c]):s=new ReadableStream({start(f){f.enqueue(c),f.close()}}),o=c.length}else if(r instanceof Uint8Array)typeof ReadableStream.from<"u"?s=ReadableStream.from([r]):s=new ReadableStream({start(c){c.enqueue(r),c.close()}}),o=r.byteLength;else if(r instanceof ReadableStream)s=r;else throw new Er("Invalid stream/data type provided.");if(n?.size!==void 0){if(o!==void 0&&n?.size!==o)throw new Er(`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 Er(`invalid size specified: ${n.size}`);o=n.size}let a=n?.partSize??this.calculatePartSize(o);if(a<roe)throw new Er("Part size should be greater than 5MB");if(a>noe)throw new Er("Part size should be less than 6MB");let u=new $h(a),l=new Bh({client:this,bucketName:i,objectName:e,partSize:a,metadata:n?.metadata??{}});return await s.pipeThrough(u).pipeTo(l),l.getResult()}calculatePartSize(e){if(e===void 0&&(e=fb),e>fb)throw new TypeError(`size should not be more than ${fb}`);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(!Fo(e))throw new $n(`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 toe)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:Oo(o.headers.get("ETag")??"")}}async copyObject(e,r,n){let i=this.getBucketName(n),o=e.sourceBucketName??i;if(!Fo(r))throw new $n(`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}),l=await u.text(),c=hi(l).root;if(!c||c.name!=="CopyObjectResult")throw new Error(`Unexpected response: ${l}`);let f=c.children.find(d=>d.name==="ETag")?.content??"",h=c.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:Oo(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 In&&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 pb=ue(du());var ko=require("node:fs"),qh=require("node:path");function ioe(t,e){return(0,ko.readFileSync)(t,"utf8").includes(e)}function Nl(t,e){let r=(0,ko.readdirSync)(t);for(let n of r){let i=(0,qh.join)(t,n),o=(0,ko.statSync)(i);if(o.isDirectory()){if(Nl(i,e))return!0}else if(o.isFile()&&(0,qh.extname)(i)===".js"&&ioe(i,e))return!0}return!1}function Mh(t){return(0,ko.readdirSync)(t).indexOf("index.html")>-1}var hb=require("node:buffer"),Ll=require("node:fs"),X6=require("node:os"),Po=require("node:path"),db=require("node:stream/consumers"),To=require("node:zlib");var Z6=ue(Ty());var ooe=hb.Buffer.from([110,31]);function soe(t){return hb.Buffer.concat([ooe,t])}async function Q6(t,e,r,n,i,o){let s=_e();s.start(i!=="v2"?"Generating the update manifest":"Generating the update manifest with v2 encryption");let a=await mI(t);return i==="v2"&&a.forEach(u=>{u.hash=Ea(u.hash,o)}),s.stop("Manifest generated successfully"),await Oe(e,{channel:"partial-update",event:"Generate manifest",icon:"\u{1F4C2}",user_id:r,tags:{"app-id":n},notify:!1}),a}function aoe(t){return(0,X6.platform)()!=="win32"?t:Po.win32.normalize(t).split(Po.win32.sep).join(Po.posix.sep)}async function e8(t,e,r,n,i,o,s,a){let u=_e();u.start("Preparing partial update with TUS protocol");let l=performance.now(),c=await br(),f=0,h=e.length,d=4096,m=e.map(async b=>{let D=(0,Po.join)(r,b.file),_=aoe(b.file),F=(0,Ll.statSync)(D),g;if(F.size>=d){let A=(0,To.createBrotliCompress)({params:{[To.constants.BROTLI_PARAM_QUALITY]:4,[To.constants.BROTLI_PARAM_SIZE_HINT]:F.size,[To.constants.BROTLI_PARAM_MODE]:To.constants.BROTLI_MODE_TEXT}}),T=(0,Ll.createReadStream)(D).pipe(A);g=soe(await(0,db.buffer)(T))}else g=await(0,db.buffer)((0,Ll.createReadStream)(D));let C=g;return s&&(C=_a(g,s.sessionKey,s.ivSessionKey)),new Promise((A,T)=>{new Z6.Upload(C,{endpoint:`${c.hostFilesApi}/files/upload/attachments/`,chunkSize:a,metadata:{filename:`orgs/${o}/apps/${n}/${i}/${_}`},headers:{Authorization:t},onError(L){p.info(`Failed to upload ${_}: ${L}`),T(L)},onProgress(){let L=(f/h*100).toFixed(2);u.message(`Uploading partial update: ${L}%`)},onSuccess(){f++,A({file_name:_,s3_path:`orgs/${o}/apps/${n}/${i}/${_}`,file_hash:b.hash})}}).start()})});try{let b=await Promise.all(m),_=((performance.now()-l)/1e3).toFixed(2);return u.stop(`Partial update uploaded successfully \u{1F4AA} in (${_} seconds)`),await Oe(t,{channel:"app",event:"App Partial TUS done",icon:"\u23EB",user_id:o,tags:{"app-id":n},notify:!1}),await Oe(t,{channel:"performance",event:"Partial upload performance",icon:"\u{1F684}",user_id:o,tags:{"app-id":n,time:_},notify:!1}),b}catch(b){let _=((performance.now()-l)/1e3).toFixed(2);return u.stop(`Failed to upload Partial bundle ( after ${_} seconds)`),p.info(`Error uploading partial update: ${b}, This is not a critical error, the bundle has been uploaded without the partial files`),null}}async function uoe(t,e){let r=await vr("",e.packageJson),n=e.bundle||t?.plugins?.CapacitorUpdater?.version||r?.version||`0.0.1-beta.${(0,t8.randomUUID)().split("-")[0]}`;return oa.test(n)||(p.error(`Your bundle name ${n}, is not valid it should follow semver convention : https://semver.org/`),k.error("")),n}function loe(t){let e=t.apikey||de();return e||(p.error("Missing API key, you need to provide a API key to upload your bundle"),k.error("")),e}function coe(t,e,r){let n=pe(t,r),i=e.path||r?.webDir;return n||(p.error("Missing argument, you need to provide a appid or be in a capacitor project"),k.error("")),i||(p.error("Missing argument, you need to provide a path (--path), or be in a capacitor project"),k.error("")),(0,Ro.existsSync)(i)||(p.error(`Path ${i} does not exist, build your app first, or provide a valid path`),k.error("")),{appid:n,path:i}}function foe(t,e){let r=t.codeCheck;(typeof r>"u"||r)&&(Nl(e,"notifyAppReady")||(p.error("notifyAppReady() is missing in the build folder of your app. see: https://capgo.app/docs/plugin/api/#notifyappready"),k.error("")),Mh(e)||(p.error(`index.html is missing in the root folder of ${e}`),k.error("")))}async function doe(t,e,r,n,i,o){let s=r.ignoreMetadataCheck,a=r.autoMinUpdateVersion,u=r.minUpdateVersion,{data:l,error:c}=await t.from("channels").select("disable_auto_update, version ( min_update_version, native_packages )").eq("name",n).eq("app_id",i).single(),f=!!l&&l.disable_auto_update==="version_number",h,d;if(!c&&l&&l.version&&l.version.native_packages&&!s){let D=_e();D.start(`Checking bundle compatibility with channel ${n}`);let{finalCompatibility:_,localDependencies:F}=await hh(t,i,n,r.packageJson,r.nodeModules);if(d=_,h=F,d.find(g=>g.localVersion!==g.remoteVersion))D.stop(`Bundle NOT compatible with ${n} channel`),p.warn(`You can check compatibility with "${e.runner} @capgo/cli bundle compatibility"`),a&&(u=o,p.info(`Auto set min-update-version to ${u}`));else if(a)try{let{min_update_version:g}=l.version;(!g||!oa.test(g))&&(p.error("Invalid remote min update version, skipping auto setting compatibility"),k.error("")),u=g,D.stop(`Auto set min-update-version to ${u}`)}catch{p.error(`Cannot auto set compatibility, invalid data ${l}`),k.error("")}else D.stop(`Bundle compatible with ${n} channel`)}else s||(p.warn(`Channel ${n} is new or it's your first upload with compatibility check, it will be ignored this time`),h=await Ev(r.packageJson,r.nodeModules),a&&(u=o,p.info(`Auto set min-update-version to ${u}`)));f&&!u&&!s&&(p.error("You need to provide a min-update-version to upload a bundle to this channel"),k.error("")),u&&(oa.test(u)||(p.error(`Your minimal version update ${u}, is not valid it should follow semver convention : https://semver.org/`),k.error("")));let m=h?new Map(h.filter(D=>!!D.native&&D.native!==void 0).map(D=>[D.name,D])):new Map;return{nativePackages:m.size>0||!r.ignoreMetadataCheck?Array.from(m,([D,_])=>({name:D,version:_.version})):void 0,minUpdateVersion:u}}async function hoe(t,e,r){let{data:n,error:i}=await t.rpc("is_trial_org",{orgid:e}).single();(n&&n>0||i)&&(p.warn(`WARNING !!
|
|
306
|
+
Trial expires in ${n} days`),p.warn(`Upgrade here: ${r.hostWeb}/dashboard/settings/plans?oid=${e}`))}async function poe(t,e,r){let{data:n,error:i}=await t.rpc("exist_app_versions",{appid:e,apikey:"",name_version:r}).single();(n||i)&&(p.error(`Version ${r} already exists ${Q(i)}`),k.error(""))}async function moe(t,e,r,n,i,o,s){let a,u,l="",c=null,f="none",h="",d=e.keyV2,m=e.key===!1;c=await fh(t);let b=_e();b.start("Calculating checksum");let D=(0,r8.join)(On((0,Uh.cwd)()),"package.json"),F=(await kr(void 0,e.packageJson||D)).get("@capgo/capacitor-updater");F=F?.replace("^","").replace("~","");let g=!1;if(F?g=m6(Xt(F),Xt("7.0.0")):(p.warn("Cannot find @capgo/capacitor-updater in your package.json, assuming it is v7"),g=!0),(d||e.keyDataV2||(0,Ro.existsSync)(or))&&!m||g?l=await(0,pb.checksum)(c,"sha256"):l=await(0,pb.checksum)(c,"crc32"),b.stop(`Checksum: ${l}`),m)p.info("Encryption ignored");else if((d||(0,Ro.existsSync)(or)||e.keyDataV2)&&!e.oldEncryption){let T=typeof d=="string"?d:or,x=e.keyDataV2||"";!x&&!(0,Ro.existsSync)(T)&&(p.error(`Cannot find private key ${T}`),k.error("")),await Oe(r,{channel:"app",event:"App encryption v2",icon:"\u{1F511}",user_id:n,tags:{"app-id":i},notify:!1}),x||(x=(0,Ro.readFileSync)(T).toString()),p.info("Encrypting your bundle with V2");let{sessionKey:L,ivSessionKey:S}=Rh(x),I=_a(c,L,S);l=Ea(l,x),a=S,u=L,f="v2",h=x,e.displayIvSession&&p.info(`Your Iv Session key is ${a},
|
|
307
307
|
keep it safe, you will need it to decrypt your bundle.
|
|
308
308
|
It will be also visible in your dashboard
|
|
309
309
|
`),c=I}let C=Math.floor((c?.byteLength??0)/1024/1024),A=Math.floor(o/1024/1024);return c?.byteLength>o?(p.error(`The bundle size is ${C} Mb, this is greater than the maximum upload length ${A} Mb, please reduce the size of your bundle`),k.error("")):c?.byteLength>s&&(p.warn(`WARNING !!
|
|
310
310
|
The bundle size is ${C} Mb, this may take a while to download for users
|
|
311
311
|
`),p.info(`Learn how to optimize your assets https://capgo.app/blog/optimise-your-images-for-updates/
|
|
312
|
-
`),await Oe(r,{channel:"app-error",event:"App Too Large",icon:"\u{1F69B}",user_id:n,tags:{"app-id":i},notify:!1})),{zipped:c,ivSessionKey:a,sessionKey:u,checksum:l,encryptionMethod:f,finalKeyData:h}}async function
|
|
313
|
-
Bundle uploaded \u{1F4AA} in 0 seconds`);return}try{let d=await br();if(s.multipart!==void 0&&s.multipart||s.tus!==void 0&&s.tus){s.multipart?p.info("Uploading bundle with multipart is deprecated, we upload with TUS instead"):p.info("Uploading bundle with TUS protocol"),await mI(t,o,i,r,n,u,d,a),c=!0;let m=`orgs/${i}/apps/${r}/${n}.zip`,{error:b}=await e.from("app_versions").update({r2_path:m}).eq("name",n).eq("app_id",r);if(b)return p.error(`Cannot finish TUS upload ${Q(b)}`),Promise.reject(new Error("Cannot finish TUS upload"))}else{let m=await dI(e,r,n);if(!m)return p.error("Cannot get upload url"),Promise.reject(new Error("Cannot get upload url"));await qr.put(m,{timeout:s.timeout||eI,retry:5,body:o})}}catch(d){let b=((performance.now()-l)/1e3).toFixed(2);if(u.stop(`Failed to upload bundle ( after ${b} seconds)`),d instanceof Wn){let D=await d.response.json();p.error(`Response Error: ${D.error||D.status||D.message}`)}else s.tus?p.error(`Cannot upload bundle please contact support if the issue persists ${Q(d)}`):p.error(`Cannot upload bundle ( try again with --tus option) ${Q(d)}`);await gI(e,r,n),k.error("")}let h=((performance.now()-l)/1e3).toFixed(2);u.stop(`Bundle uploaded \u{1F4AA} in (${h} seconds)`),await Oe(t,{channel:"performance",event:c?"TUS upload zip performance":"Upload zip performance",icon:"\u{1F684}",user_id:i,tags:{"app-id":r,time:h},notify:!1})}async function poe(t,e,r){let{data:n,error:i}=await t.from("channels").select("version ( id, name, deleted )").eq("app_id",e).eq("name",r);if(i){p.error(`Cannot delete linked bundle on upload ${Q(i)}`);return}if(n.length===0){p.warn("No linked bundle found in the channel you are trying to upload to");return}let o=n[0].version;if(o.deleted){p.warn("The linked bundle is already deleted");return}let{error:s}=await t.from("app_versions").update({deleted:!0}).eq("id",o.id);if(s){p.error(`Cannot delete linked bundle on upload ${Q(s)}`);return}p.info("Linked bundle deleted")}async function moe(t,e,r,n,i,o,s,a,u){let{data:l}=await t.rpc("get_app_versions",{apikey:e,name_version:n,appid:a}).single();l||(p.warn("Cannot get version id, cannot set channel"),k.error(""));let{data:c}=await t.rpc("is_allowed_capgkey",{apikey:e,keymode:["write","all"]}).single();if(c){let{error:f,data:h}=await dh(t,{name:i,app_id:a,created_by:o,version:l,owner_org:s});f&&(p.error(`Cannot set channel, the upload key is not allowed to do that, use the "all" for this. ${Q(f)}`),k.error(""));let d=mo(a),m=`${u.hostWeb}/app/p/${d}/channel/${h.id}`;h?.public?p.info("Your update is now available in your public channel \u{1F389}"):h?.id&&p.info(`Link device to this bundle to try it: ${m}`),r?p.info(`Bundle url: ${m}`):l||(p.warn("Cannot set bundle with upload key, use key with more rights for that"),k.error(""))}else p.warn("The upload key is not allowed to set the version in the channel")}async function goe(t,e,r){let{error:n,data:i}=await e.from("apps").select("default_upload_channel").single();if(n){p.warn("Cannot find default upload channel");let o=mo(t);return p.info(`You can set it here: ${r}/app/p/${o}/settings`),null}return i.default_upload_channel}async function pb(t,e,r=!0){Z(`Uploading with CLI version ${Cr.version}`);let n,i=Jt();await Ae();let{s3Region:o,s3Apikey:s,s3Apisecret:a,s3BucketName:u,s3Endpoint:l,s3Port:c,s3SSL:f}=e,h=soe(e),d=await te(),m=await nI(),{appid:b,path:D}=aoe(t,e,d.config),_=await ooe(d.config,e);e.autoSetBundle&&await El({version:_}),uoe(e,D),p.info(`Upload ${b}@${_} started from path "${D}" to Capgo cloud`);let F=await br(),g=await fe(h),C=await he(g,h,["write","all","upload"]),A=e.channel||await goe(b,g,F.hostWeb)||"dev",T=await wr(g,b);await aI(g,T,Cr.version),await uI(g,T,h,b,!0),await coe(g,T,F);let{nativePackages:x,minUpdateVersion:L}=await loe(g,i,e,A,b,_);await foe(g,b,_),e.external&&!e.external.startsWith("https://")&&(p.error(`External link should should start with "https://" current is "${e.external}"`),k.error("")),e.deleteLinkedBundleOnUpload&&(p.warn("Deleting linked bundle on upload is destructive, it will delete the currently linked bundle in the channel you are trying to upload to."),p.warn("Please make sure you want to do this, if you are not sure, please do not use this option."));let S={name:_,app_id:b,session_key:void 0,external_url:e.external,storage_provider:e.external?"external":"r2-direct",min_update_version:L,native_packages:x,owner_org:T,user_id:C,checksum:void 0},I=null,$="none",B="";if(e.external)await Oe(h,{channel:"app",event:"App external",icon:"\u{1F4E4}",user_id:T,tags:{"app-id":b},notify:!1}),S.session_key=e.ivSessionKey,S.checksum=e.encryptedChecksum;else{let{zipped:E,ivSessionKey:v,checksum:w,sessionKey:O,encryptionMethod:j,finalKeyData:R}=await doe(D,e,h,T,b,m.maxUploadLength,m.alertUploadSize);S.session_key=v,S.checksum=w,n=O,I=E,$=j,B=R,e.ignoreChecksumCheck||await DI(g,b,A,w)}!m.TUSUpload||e.external?e.tus=!1:e.tus=e.tus||m.TUSUploadForced,!m.partialUpload||e.external?e.partial=!1:e.partial=e.partial||e.partialOnly||m.partialUploadForced,e.encryptPartial&&$==="v1"&&(p.error("You cannot encrypt the partial update if you are not using the v2 encryption method"),k.error(""));let q=e.partial?await Z6(D,h,T,b,e.encryptPartial?$:"none",B):[],{error:K}=await _v(g,S);if(K&&(p.error(`Cannot add bundle ${Q(K)}`),k.error("")),e.tusChunkSize&&e.tusChunkSize>m.maxChunkSize?(p.error(`Chunk size ${e.tusChunkSize} is greater than the maximum chunk size ${m.maxChunkSize}, using the maximum chunk size`),e.tusChunkSize=m.maxChunkSize):e.tusChunkSize||(e.tusChunkSize=m.maxChunkSize),I&&(u||l||o||s||a||c||f)){(!u||!l||!o||!s||!a||!c)&&(p.error("Missing argument, for S3 upload you need to provide a bucket name, endpoint, region, port, API key, and API secret"),k.error("")),p.info("Uploading to S3");let E=new jl({endPoint:l,region:o,port:c,useSSL:f,bucket:u,accessKey:s,secretKey:a}),v=`${b}-${_}`,w=encodeURIComponent(v);await E.putObject(v,Uint8Array.from(I)),S.external_url=`https://${l}/${w}`,S.storage_provider="external"}else if(I){e.partialOnly||await hoe(h,g,b,_,T,I,e,e.tusChunkSize);let E=null;try{e.dryUpload&&(e.partial=!1);let w=S.session_key&&e.encryptPartial&&n?{sessionKey:n,ivSessionKey:S.session_key}:void 0;E=e.partial?await Q6(h,q,D,b,_,T,w,e.tusChunkSize):null}catch(w){p.info(`Failed to upload partial files to capgo cloud. Error: ${Q(w)}. This is not a critical error, the bundle has been uploaded without the partial files`)}S.storage_provider="r2",S.manifest=E;let{error:v}=await _v(g,S);v&&(p.error(`Cannot update bundle ${Q(v)}`),k.error(""))}let V=await qe(g,h,b,2);return e.deleteLinkedBundleOnUpload&&vv(V,3)?await poe(g,b,A):e.deleteLinkedBundleOnUpload&&p.warn("Cannot delete linked bundle on upload as a upload organization member"),vv(V,3)?await moe(g,h,!!e.bundleUrl,_,A,C,T,b,F):p.warn("Cannot set channel as a upload organization member"),await Oe(h,{channel:"app",event:"App Uploaded",icon:"\u23EB",user_id:T,tags:{"app-id":b},notify:!1}),r&&(J("Time to share your update to the world \u{1F30D}"),(0,Uh.exit)()),!0}function yoe(t){t.ivSessionKey&&!t.external&&(p.error("You need to provide an external url if you want to use the --iv-session-key option"),k.error("")),t.encryptedChecksum&&!t.external&&(p.error("You need to provide an external url if you want to use the --encrypted-checksum option"),k.error("")),t.partial&&t.external&&(p.error("You cannot use the --partial option with an external url"),k.error("")),t.tus&&t.external&&(p.error("You cannot use the --tus option with an external url"),k.error("")),t.dryUpload&&t.external&&(p.error("You cannot use the --dry-upload option with an external url"),k.error("")),t.multipart&&t.external&&(p.error("You cannot use the --multipart option with an external url"),k.error("")),t.external&&(t.keyV2||t.keyDataV2)&&(p.error("You cannot set a key if you are uploading to an external url"),k.error("")),t.keyV2&&t.keyDataV2&&(p.error("You cannot set both key-v2 and key-data-v2"),k.error("")),t.external&&(t.s3Region||t.s3Apikey||t.s3Apisecret||t.s3Endpoint||t.s3BucketName||t.s3Port||t.s3SSL)&&(p.error("You cannot set S3 options if you are uploading to an external url, it's automatically handled"),k.error("")),t.encryptedChecksum&&!t.external&&(p.error("You cannot set the --encrypted-checksum option if you are not uploading to an external url"),k.error("")),t.minUpdateVersion&&t.autoMinUpdateVersion&&(p.error("You cannot set both min-update-version and auto-min-update-version, use only one of them"),k.error(""))}async function r8(t,e){try{yoe(e),await pb(t,e,!0)}catch(r){p.error(Q(r)),k.error("")}}var n8=require("node:crypto"),Hh=require("node:fs"),i8=require("node:process");var mb=ue(du());var Doe=20;async function o8(t,e){try{let{bundle:r,path:n}=e,{json:i}=e;i||await Ae();let o=await te();t=pe(t,o?.config);let s=(0,n8.randomUUID)().split("-")[0],a=await vr("",e.packageJson);r=r||a?.version||`0.0.1-beta.${s}`,i||Z(`Zipping ${t}@${r}`),r&&!oa.test(r)&&(i?console.error(Q({error:"invalid_semver"})):p.error(`Your bundle name ${r}, is not valid it should follow semver convention : https://semver.org/`),k.error("")),n=n||o?.config?.webDir,(!t||!r||!n)&&(i?console.error(Q({error:"missing_argument"})):p.error("Missing argument, you need to provide a appId and a bundle and a path, or be in a capacitor project"),k.error("")),i||p.info(`Started from path "${n}"`);let u=e.codeCheck;(typeof u>"u"||u)&&(Nl(n,"notifyAppReady")||(i?console.error(Q({error:"notifyAppReady_not_in_source_code"})):p.error("notifyAppReady() is missing in the build folder of your app. see: https://capgo.app/docs/plugin/api/#notifyappready"),k.error("")),Mh(n)||(i?console.error(Q({error:"index_html_not_found"})):p.error(`index.html is missing in the root folder of ${n}`),k.error("")));let l=await fh(n);i||p.info(`Zipped ${l.byteLength} bytes`);let c=_e();i||c.start("Calculating checksum");let f="";e.keyV2||(0,Hh.existsSync)(or)?f=await(0,mb.checksum)(l,"sha256"):f=await(0,mb.checksum)(l,"crc32"),i||c.stop(`Checksum: ${f}`);let h=Math.floor(l.byteLength/1024/1024);h>Doe&&!i&&(p.warn(`WARNING !!
|
|
312
|
+
`),await Oe(r,{channel:"app-error",event:"App Too Large",icon:"\u{1F69B}",user_id:n,tags:{"app-id":i},notify:!1})),{zipped:c,ivSessionKey:a,sessionKey:u,checksum:l,encryptionMethod:f,finalKeyData:h}}async function goe(t,e,r,n,i,o,s,a){let u=_e();u.start("Uploading Bundle");let l=performance.now(),c=!1;if(s.dryUpload){u.stop(`Dry run, bundle not uploaded
|
|
313
|
+
Bundle uploaded \u{1F4AA} in 0 seconds`);return}try{let d=await br();if(s.multipart!==void 0&&s.multipart||s.tus!==void 0&&s.tus){s.multipart?p.info("Uploading bundle with multipart is deprecated, we upload with TUS instead"):p.info("Uploading bundle with TUS protocol"),await gI(t,o,i,r,n,u,d,a),c=!0;let m=`orgs/${i}/apps/${r}/${n}.zip`,{error:b}=await e.from("app_versions").update({r2_path:m}).eq("name",n).eq("app_id",r);if(b)return p.error(`Cannot finish TUS upload ${Q(b)}`),Promise.reject(new Error("Cannot finish TUS upload"))}else{let m=await hI(e,r,n);if(!m)return p.error("Cannot get upload url"),Promise.reject(new Error("Cannot get upload url"));await qr.put(m,{timeout:s.timeout||tI,retry:5,body:o})}}catch(d){let b=((performance.now()-l)/1e3).toFixed(2);if(u.stop(`Failed to upload bundle ( after ${b} seconds)`),d instanceof Wn){let D=await d.response.json();p.error(`Response Error: ${D.error||D.status||D.message}`)}else s.tus?p.error(`Cannot upload bundle please contact support if the issue persists ${Q(d)}`):p.error(`Cannot upload bundle ( try again with --tus option) ${Q(d)}`);await yI(e,r,n),k.error("")}let h=((performance.now()-l)/1e3).toFixed(2);u.stop(`Bundle uploaded \u{1F4AA} in (${h} seconds)`),await Oe(t,{channel:"performance",event:c?"TUS upload zip performance":"Upload zip performance",icon:"\u{1F684}",user_id:i,tags:{"app-id":r,time:h},notify:!1})}async function yoe(t,e,r){let{data:n,error:i}=await t.from("channels").select("version ( id, name, deleted )").eq("app_id",e).eq("name",r);if(i){p.error(`Cannot delete linked bundle on upload ${Q(i)}`);return}if(n.length===0){p.warn("No linked bundle found in the channel you are trying to upload to");return}let o=n[0].version;if(o.deleted){p.warn("The linked bundle is already deleted");return}let{error:s}=await t.from("app_versions").update({deleted:!0}).eq("id",o.id);if(s){p.error(`Cannot delete linked bundle on upload ${Q(s)}`);return}p.info("Linked bundle deleted")}async function Doe(t,e,r,n,i,o,s,a,u){let{data:l}=await t.rpc("get_app_versions",{apikey:e,name_version:n,appid:a}).single();l||(p.warn("Cannot get version id, cannot set channel"),k.error(""));let{data:c}=await t.rpc("is_allowed_capgkey",{apikey:e,keymode:["write","all"]}).single();if(c){let{error:f,data:h}=await dh(t,{name:i,app_id:a,created_by:o,version:l,owner_org:s});f&&(p.error(`Cannot set channel, the upload key is not allowed to do that, use the "all" for this. ${Q(f)}`),k.error(""));let d=mo(a),m=`${u.hostWeb}/app/p/${d}/channel/${h.id}`;h?.public?p.info("Your update is now available in your public channel \u{1F389}"):h?.id&&p.info(`Link device to this bundle to try it: ${m}`),r?p.info(`Bundle url: ${m}`):l||(p.warn("Cannot set bundle with upload key, use key with more rights for that"),k.error(""))}else p.warn("The upload key is not allowed to set the version in the channel")}async function voe(t,e,r){let{error:n,data:i}=await e.from("apps").select("default_upload_channel").single();if(n){p.warn("Cannot find default upload channel");let o=mo(t);return p.info(`You can set it here: ${r}/app/p/${o}/settings`),null}return i.default_upload_channel}async function mb(t,e,r=!0){Z(`Uploading with CLI version ${Cr.version}`);let n,i=Jt();await Ae();let{s3Region:o,s3Apikey:s,s3Apisecret:a,s3BucketName:u,s3Endpoint:l,s3Port:c,s3SSL:f}=e,h=loe(e),d=await te(),m=await iI(),{appid:b,path:D}=coe(t,e,d.config),_=await uoe(d.config,e);e.autoSetBundle&&await El({version:_}),foe(e,D),p.info(`Upload ${b}@${_} started from path "${D}" to Capgo cloud`);let F=await br(),g=await fe(h),C=await he(g,h,["write","all","upload"]),A=e.channel||await voe(b,g,F.hostWeb)||"dev",T=await wr(g,b);await uI(g,T,Cr.version),await lI(g,T,h,b,!0),await hoe(g,T,F);let{nativePackages:x,minUpdateVersion:L}=await doe(g,i,e,A,b,_);await poe(g,b,_),e.external&&!e.external.startsWith("https://")&&(p.error(`External link should should start with "https://" current is "${e.external}"`),k.error("")),e.deleteLinkedBundleOnUpload&&(p.warn("Deleting linked bundle on upload is destructive, it will delete the currently linked bundle in the channel you are trying to upload to."),p.warn("Please make sure you want to do this, if you are not sure, please do not use this option."));let S={name:_,app_id:b,session_key:void 0,external_url:e.external,storage_provider:e.external?"external":"r2-direct",min_update_version:L,native_packages:x,owner_org:T,user_id:C,checksum:void 0},I=null,$="none",B="";if(e.external)await Oe(h,{channel:"app",event:"App external",icon:"\u{1F4E4}",user_id:T,tags:{"app-id":b},notify:!1}),S.session_key=e.ivSessionKey,S.checksum=e.encryptedChecksum;else{let{zipped:E,ivSessionKey:v,checksum:w,sessionKey:O,encryptionMethod:j,finalKeyData:R}=await moe(D,e,h,T,b,m.maxUploadLength,m.alertUploadSize);S.session_key=v,S.checksum=w,n=O,I=E,$=j,B=R,e.ignoreChecksumCheck||await vI(g,b,A,w)}!m.TUSUpload||e.external?e.tus=!1:e.tus=e.tus||m.TUSUploadForced,!m.partialUpload||e.external?e.partial=!1:e.partial=e.partial||e.partialOnly||m.partialUploadForced,e.encryptPartial&&$==="v1"&&(p.error("You cannot encrypt the partial update if you are not using the v2 encryption method"),k.error(""));let q=e.partial?await Q6(D,h,T,b,e.encryptPartial?$:"none",B):[],{error:K}=await _v(g,S);if(K&&(p.error(`Cannot add bundle ${Q(K)}`),k.error("")),e.tusChunkSize&&e.tusChunkSize>m.maxChunkSize?(p.error(`Chunk size ${e.tusChunkSize} is greater than the maximum chunk size ${m.maxChunkSize}, using the maximum chunk size`),e.tusChunkSize=m.maxChunkSize):e.tusChunkSize||(e.tusChunkSize=m.maxChunkSize),I&&(u||l||o||s||a||c||f)){(!u||!l||!o||!s||!a||!c)&&(p.error("Missing argument, for S3 upload you need to provide a bucket name, endpoint, region, port, API key, and API secret"),k.error("")),p.info("Uploading to S3");let E=new jl({endPoint:l,region:o,port:c,useSSL:f,bucket:u,accessKey:s,secretKey:a}),v=`${b}-${_}`,w=encodeURIComponent(v);await E.putObject(v,Uint8Array.from(I)),S.external_url=`https://${l}/${w}`,S.storage_provider="external"}else if(I){e.partialOnly||await goe(h,g,b,_,T,I,e,e.tusChunkSize);let E=null;try{e.dryUpload&&(e.partial=!1);let w=S.session_key&&e.encryptPartial&&n?{sessionKey:n,ivSessionKey:S.session_key}:void 0;E=e.partial?await e8(h,q,D,b,_,T,w,e.tusChunkSize):null}catch(w){p.info(`Failed to upload partial files to capgo cloud. Error: ${Q(w)}. This is not a critical error, the bundle has been uploaded without the partial files`)}S.storage_provider="r2",S.manifest=E;let{error:v}=await _v(g,S);v&&(p.error(`Cannot update bundle ${Q(v)}`),k.error(""))}let V=await qe(g,h,b,2);return e.deleteLinkedBundleOnUpload&&vv(V,3)?await yoe(g,b,A):e.deleteLinkedBundleOnUpload&&p.warn("Cannot delete linked bundle on upload as a upload organization member"),vv(V,3)?await Doe(g,h,!!e.bundleUrl,_,A,C,T,b,F):p.warn("Cannot set channel as a upload organization member"),await Oe(h,{channel:"app",event:"App Uploaded",icon:"\u23EB",user_id:T,tags:{"app-id":b},notify:!1}),r&&(J("Time to share your update to the world \u{1F30D}"),(0,Uh.exit)()),!0}function boe(t){t.ivSessionKey&&!t.external&&(p.error("You need to provide an external url if you want to use the --iv-session-key option"),k.error("")),t.encryptedChecksum&&!t.external&&(p.error("You need to provide an external url if you want to use the --encrypted-checksum option"),k.error("")),t.partial&&t.external&&(p.error("You cannot use the --partial option with an external url"),k.error("")),t.tus&&t.external&&(p.error("You cannot use the --tus option with an external url"),k.error("")),t.dryUpload&&t.external&&(p.error("You cannot use the --dry-upload option with an external url"),k.error("")),t.multipart&&t.external&&(p.error("You cannot use the --multipart option with an external url"),k.error("")),t.external&&(t.keyV2||t.keyDataV2)&&(p.error("You cannot set a key if you are uploading to an external url"),k.error("")),t.keyV2&&t.keyDataV2&&(p.error("You cannot set both key-v2 and key-data-v2"),k.error("")),t.external&&(t.s3Region||t.s3Apikey||t.s3Apisecret||t.s3Endpoint||t.s3BucketName||t.s3Port||t.s3SSL)&&(p.error("You cannot set S3 options if you are uploading to an external url, it's automatically handled"),k.error("")),t.encryptedChecksum&&!t.external&&(p.error("You cannot set the --encrypted-checksum option if you are not uploading to an external url"),k.error("")),t.minUpdateVersion&&t.autoMinUpdateVersion&&(p.error("You cannot set both min-update-version and auto-min-update-version, use only one of them"),k.error(""))}async function n8(t,e){try{boe(e),await mb(t,e,!0)}catch(r){p.error(Q(r)),k.error("")}}var i8=require("node:crypto"),Hh=require("node:fs"),o8=require("node:process");var gb=ue(du());var woe=20;async function s8(t,e){try{let{bundle:r,path:n}=e,{json:i}=e;i||await Ae();let o=await te();t=pe(t,o?.config);let s=(0,i8.randomUUID)().split("-")[0],a=await vr("",e.packageJson);r=r||a?.version||`0.0.1-beta.${s}`,i||Z(`Zipping ${t}@${r}`),r&&!oa.test(r)&&(i?console.error(Q({error:"invalid_semver"})):p.error(`Your bundle name ${r}, is not valid it should follow semver convention : https://semver.org/`),k.error("")),n=n||o?.config?.webDir,(!t||!r||!n)&&(i?console.error(Q({error:"missing_argument"})):p.error("Missing argument, you need to provide a appId and a bundle and a path, or be in a capacitor project"),k.error("")),i||p.info(`Started from path "${n}"`);let u=e.codeCheck;(typeof u>"u"||u)&&(Nl(n,"notifyAppReady")||(i?console.error(Q({error:"notifyAppReady_not_in_source_code"})):p.error("notifyAppReady() is missing in the build folder of your app. see: https://capgo.app/docs/plugin/api/#notifyappready"),k.error("")),Mh(n)||(i?console.error(Q({error:"index_html_not_found"})):p.error(`index.html is missing in the root folder of ${n}`),k.error("")));let l=await fh(n);i||p.info(`Zipped ${l.byteLength} bytes`);let c=_e();i||c.start("Calculating checksum");let f="";e.keyV2||(0,Hh.existsSync)(or)?f=await(0,gb.checksum)(l,"sha256"):f=await(0,gb.checksum)(l,"crc32"),i||c.stop(`Checksum: ${f}`);let h=Math.floor(l.byteLength/1024/1024);h>woe&&!i&&(p.warn(`WARNING !!
|
|
314
314
|
The bundle size is ${h} Mb, this may take a while to download for users
|
|
315
315
|
`),p.warn(`Learn how to optimize your assets https://capgo.app/blog/optimise-your-images-for-updates/
|
|
316
|
-
`));let d=_e(),m=e.name||`${t}_${r}.zip`;i||d.start(`Saving to ${m}`),(0,Hh.writeFileSync)(m,l),i||d.stop(`Saved to ${m}`),i||J("Done \u2705"),i&&console.log(JSON.stringify({bundle:r,filename:m,checksum:f},null,2)),(0,
|
|
317
|
-
${Q(u.error)}`),k.error("")),p.success("Channel created \u2705"),await Oe(r.apikey,{channel:"channel",event:"Create channel",icon:"\u2705",user_id:a,tags:{"app-id":e,channel:t},notify:!1}).catch()}catch{return p.error("Cannot create Channel \u{1F640}"),!1}return n&&(J("Done \u2705"),(0,s8.exit)()),!0}async function a8(t,e,r){gb(t,e,r,!0)}var u8=require("node:process");async function l8(t,e,r){let{quiet:n}=r;n||Z("List current bundle"),r.apikey=r.apikey||de(n);let i=await te();e=pe(e,i?.config),r.apikey||(p.error("Missing API key, you need to provide a API key to upload your bundle"),k.error("")),e||(p.error("Missing argument, you need to provide a appId, or be in a capacitor project"),k.error(""));let o=await fe(r.apikey),s=await he(o,r.apikey,["write","all","read"]);await qe(o,r.apikey,e,1),t||(p.error("Please provide a channel to get the bundle from."),k.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)&&(p.error(`Error retrieving channel ${t} for app ${e}. Perhaps the channel does not exists?`),k.error(""));let{version:l}=a[0];l||(p.error(`Error retrieving channel ${t} for app ${e}. Perhaps the channel does not exists?`),k.error("")),n?p.info(l.name):p.info(`Current bundle for channel ${t} is ${l.name}`),(0,u8.exit)()}var c8=require("node:process");async function f8(t,e,r){Z("Delete channel"),r.apikey=r.apikey||de();let n=await te();e=pe(e,n?.config),r.apikey||(p.error("Missing API key, you need to provide a API key to upload your bundle"),k.error("")),e||(p.error("Missing argument, you need to provide a appId, or be in a capacitor project"),k.error(""));let i=await fe(r.apikey),o=await he(i,r.apikey,["all"]);if(await qe(i,r.apikey,e,4),r.deleteBundle){p.info(`Deleting bundle ${e}#${t} from Capgo`);let s=await v6(i,e,t);s&&s.name&&(p.info(`Deleting bundle ${s.name} from Capgo`),await ib(i,e,s.name))}p.info(`Deleting channel ${e}#${t} from Capgo`);try{let s=await D6(i,t,e,o);s.error&&(p.error(`Cannot delete Channel \u{1F640} ${Q(s.error)}`),k.error(""));let a=await wr(i,e);p.success("Channel deleted"),await Oe(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{p.error("Cannot delete Channel \u{1F640}")}J("Done \u2705"),(0,c8.exit)()}var d8=require("node:process");async function h8(t,e){Z("List channels"),e.apikey=e.apikey||de();let r=await te();t=pe(t,r?.config),e.apikey||p.error("Missing API key, you need to provide a API key to upload your bundle"),t||(p.error("Missing argument, you need to provide a appId, or be in a capacitor project"),k.error(""));let n=await fe(e.apikey),i=await he(n,e.apikey,["write","all","read","upload"]);await qe(n,e.apikey,t,1),p.info("Querying available channels in Capgo");let o=await w6(n,t);p.info(`Active channels in Capgo: ${o?.length}`),b6(o),await Oe(e.apikey,{channel:"channel",event:"List channel",icon:"\u2705",user_id:i,tags:{"app-id":t},notify:!1}).catch(),J("Done \u2705"),(0,d8.exit)()}var m8=require("node:process");var p8=["major","minor","metadata","patch","none"];async function g8(t,e,r){Z("Set channel"),r.apikey=r.apikey||de();let n=await te();e=pe(e,n?.config),r.apikey||(p.error("Missing API key, you need to provide a API key to upload your bundle"),k.error("")),e||(p.error("Missing argument, you need to provide a appId, or be in a capacitor project"),k.error(""));let i=await fe(r.apikey),o=await he(i,r.apikey,["write","all"]);await qe(i,r.apikey,e,4);let s=await wr(i,e),{bundle:a,state:u,downgrade:l,latest:c,upgrade:f,ios:h,android:d,selfAssign:m,disableAutoUpdate:b,dev:D,emulator:_}=r;t||(p.error("Missing argument, you need to provide a channel"),k.error("")),c&&a&&(p.error("Cannot set latest and bundle at the same time"),k.error("")),a==null&&u==null&&c==null&&l==null&&f==null&&h==null&&d==null&&m==null&&D==null&&_==null&&b==null&&(p.error("Missing argument, you need to provide a option to set"),k.error(""));try{await ch(i,s,r.apikey,e);let F={created_by:o,app_id:e,name:t,owner_org:s,version:void 0},g=await vr("",r.packageJson),C=c?n?.config?.plugins?.CapacitorUpdater?.version||g?.version:a;if(C!=null){let{data:A,error:T}=await i.from("app_versions").select().eq("app_id",e).eq("name",C).eq("user_id",o).eq("deleted",!1).single();(T||!A)&&(p.error(`Cannot find version ${C}`),k.error("")),p.info(`Set ${e} channel: ${t} to @${C}`),F.version=A.id}if(u!=null&&((u==="public"||u==="private")&&p.info(`Set ${e} channel: ${t} to public or private is deprecated, use default or normal instead`),p.info(`Set ${e} channel: ${t} to ${u==="public"||u==="default"?"default":"normal"}`),F.public=u==="public"||u==="default"),l!=null&&(p.info(`Set ${e} channel: ${t} to ${l?"allow":"disallow"} downgrade`),F.disable_auto_update_under_native=!l),h!=null&&(p.info(`Set ${e} channel: ${t} to ${h?"allow":"disallow"} ios update`),F.ios=!!h),d!=null&&(p.info(`Set ${e} channel: ${t} to ${d?"allow":"disallow"} android update`),F.android=!!d),m!=null&&(p.info(`Set ${e} channel: ${t} to ${m?"allow":"disallow"} self assign to this channel`),F.allow_device_self_set=!!m),b!=null){let A=b.toLocaleLowerCase();p8.includes(A)||(p.error(`Channel strategy ${A} is not known. The possible values are: ${p8.join(", ")}.`),k.error("")),A==="metadata"&&(A="version_number"),F.disable_auto_update=A,p.info(`Set ${e} channel: ${t} to ${A} disable update strategy to this channel`)}try{let{error:A}=await dh(i,F);A&&(p.error('Cannot set channel the upload key is not allowed to do that, use the "all" for this.'),k.error(""))}catch{p.error('Cannot set channel the upload key is not allowed to do that, use the "all" for this.'),k.error("")}await Oe(r.apikey,{channel:"channel",event:"Set channel",icon:"\u2705",user_id:s,tags:{"app-id":e},notify:!1}).catch()}catch(F){p.error(`Unknow error ${Q(F)}`),k.error("")}J("Done \u2705"),(0,m8.exit)()}var ql=require("node:child_process"),Ie=require("node:fs"),pi=require("node:path"),ke=require("node:process");var Gh=ue(P8());var Lt=require("node:fs");async function Ioe(t,e=!0){e&&Z("Save keys \u{1F511}");let r=await te(),n=t.key||Fn,i=t.keyData||"";if(!(0,Lt.existsSync)(n)&&!i)if(p)p.error(`Cannot find a public key at ${n} or as keyData option or in ${r.path}`),k.error("");else return!1;else(0,Lt.existsSync)(n)&&(i=(0,Lt.readFileSync)(n).toString());if(i&&!i.startsWith("-----BEGIN RSA PUBLIC KEY-----"))if(p)p.error("the public key provided is not a valid RSA Public key"),k.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,p.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 ci(r)),e&&(p.success(`public key saved into ${r.path} file in local directory`),p.success("your app will decode the zip archive with this key")),!0}async function joe(t,e=!0){e&&Z("Deleting old private key \u{1F5D1}\uFE0F");let r=await te();if(r?.config?.plugins?.CapacitorUpdater?.privateKey){if(delete r.config.plugins.CapacitorUpdater.privateKey,await ci(r),(0,Lt.existsSync)(ia))try{(0,Lt.unlinkSync)(ia),e&&p.success(`Old private key file deleted: ${ia}`)}catch{e&&p.error(`Failed to delete old private key file: ${ia}`)}if((0,Lt.existsSync)(uh))try{(0,Lt.unlinkSync)(uh),e&&p.success(`Old public key file deleted: ${uh}`)}catch{e&&p.error(`Failed to delete old public key file: ${Fn}`)}return e&&p.success(`Old private key deleted from ${r.path} file`),!0}else return e&&p.info("No old private key found in config file"),!1}async function R8(t){Z("Save keys \u{1F511}"),await Ae(),await Ioe(t)}async function Cb(t,e=!0){e&&Z("Create keys \u{1F511}");let{publicKey:r,privateKey:n}=A6();if((0,Lt.existsSync)(Fn)&&!t.force)if(p.error("Public Key already exists, use --force to overwrite"),e)k.error("");else return!1;if((0,Lt.writeFileSync)(Fn,r),(0,Lt.existsSync)(or)&&!t.force)if(p.error("Private Key already exists, use --force to overwrite"),e)k.error("");else return!1;(0,Lt.writeFileSync)(or,n);let i=await te();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,p.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,ci(i)),p&&(p.success("Your RSA key has been generated"),p.success(`Private key saved in ${or}`),p.success("This key will be use to encrypt your bundle before sending it to Capgo"),p.success("Keep it safe"),p.success("Than make it unreadable by Capgo and unmodifiable by anyone"),p.success(`Public key saved in ${i.path}`),p.success("Your app will be the only one having it"),p.success("Only your users can decrypt your update"),p.success("Only you can send them an update"),J("Done \u2705")),!0}async function $8(t){await Ae(),await Cb(t)}async function I8(t){await Ae(),await joe(t)}var Nn=require("node:fs"),xb=require("node:os"),Sb=require("node:process");async function j8(){let t=(0,xb.homedir)();return(0,Nn.existsSync)(`${t}/.capgo`)||(0,Nn.existsSync)(".capgo")}async function Fb(t,e,r=!0){if(r&&Z("Login to Capgo"),!t)return r&&(p.error("Missing API key, you need to provide a API key to upload your bundle"),k.error("")),!1;await Ae();try{let{local:n}=e;if(n)(0,Nn.existsSync)(".git")||(p.error("To use local you should be in a git repository"),k.error("")),(0,Nn.writeFileSync)(".capgo",`${t}
|
|
316
|
+
`));let d=_e(),m=e.name||`${t}_${r}.zip`;i||d.start(`Saving to ${m}`),(0,Hh.writeFileSync)(m,l),i||d.stop(`Saved to ${m}`),i||J("Done \u2705"),i&&console.log(JSON.stringify({bundle:r,filename:m,checksum:f},null,2)),(0,o8.exit)()}catch(r){p.error(Q(r)),k.error("")}}var a8=require("node:process");async function yb(t,e,r,n=!0){Z("Create channel"),r.apikey=r.apikey||de();let i=await te();e=pe(e,i?.config),r.apikey||(p.error("Missing API key, you need to provide a API key to upload your bundle"),k.error("")),e||(p.error("Missing argument, you need to provide a appId, or be in a capacitor project"),k.error(""));let o=await fe(r.apikey);await he(o,r.apikey,["write","all"]),await qe(o,r.apikey,e,4),p.info(`Creating channel ${e}#${t} to Capgo`);try{let s=await nb(o,e),a=await wr(o,e);s||(p.error("Cannot find default version for channel creation, please contact Capgo support \u{1F928}"),k.error(""));let u=await D6(o,{name:t,app_id:e,version:s.id,owner_org:a});u.error&&(p.error(`Cannot create Channel \u{1F640}
|
|
317
|
+
${Q(u.error)}`),k.error("")),p.success("Channel created \u2705"),await Oe(r.apikey,{channel:"channel",event:"Create channel",icon:"\u2705",user_id:a,tags:{"app-id":e,channel:t},notify:!1}).catch()}catch{return p.error("Cannot create Channel \u{1F640}"),!1}return n&&(J("Done \u2705"),(0,a8.exit)()),!0}async function u8(t,e,r){yb(t,e,r,!0)}var l8=require("node:process");async function c8(t,e,r){let{quiet:n}=r;n||Z("List current bundle"),r.apikey=r.apikey||de(n);let i=await te();e=pe(e,i?.config),r.apikey||(p.error("Missing API key, you need to provide a API key to upload your bundle"),k.error("")),e||(p.error("Missing argument, you need to provide a appId, or be in a capacitor project"),k.error(""));let o=await fe(r.apikey),s=await he(o,r.apikey,["write","all","read"]);await qe(o,r.apikey,e,1),t||(p.error("Please provide a channel to get the bundle from."),k.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)&&(p.error(`Error retrieving channel ${t} for app ${e}. Perhaps the channel does not exists?`),k.error(""));let{version:l}=a[0];l||(p.error(`Error retrieving channel ${t} for app ${e}. Perhaps the channel does not exists?`),k.error("")),n?p.info(l.name):p.info(`Current bundle for channel ${t} is ${l.name}`),(0,l8.exit)()}var f8=require("node:process");async function d8(t,e,r){Z("Delete channel"),r.apikey=r.apikey||de();let n=await te();e=pe(e,n?.config),r.apikey||(p.error("Missing API key, you need to provide a API key to upload your bundle"),k.error("")),e||(p.error("Missing argument, you need to provide a appId, or be in a capacitor project"),k.error(""));let i=await fe(r.apikey),o=await he(i,r.apikey,["all"]);if(await qe(i,r.apikey,e,4),r.deleteBundle){p.info(`Deleting bundle ${e}#${t} from Capgo`);let s=await b6(i,e,t);s&&s.name&&(p.info(`Deleting bundle ${s.name} from Capgo`),await ib(i,e,s.name))}p.info(`Deleting channel ${e}#${t} from Capgo`);try{let s=await v6(i,t,e,o);s.error&&(p.error(`Cannot delete Channel \u{1F640} ${Q(s.error)}`),k.error(""));let a=await wr(i,e);p.success("Channel deleted"),await Oe(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{p.error("Cannot delete Channel \u{1F640}")}J("Done \u2705"),(0,f8.exit)()}var h8=require("node:process");async function p8(t,e){Z("List channels"),e.apikey=e.apikey||de();let r=await te();t=pe(t,r?.config),e.apikey||p.error("Missing API key, you need to provide a API key to upload your bundle"),t||(p.error("Missing argument, you need to provide a appId, or be in a capacitor project"),k.error(""));let n=await fe(e.apikey),i=await he(n,e.apikey,["write","all","read","upload"]);await qe(n,e.apikey,t,1),p.info("Querying available channels in Capgo");let o=await _6(n,t);p.info(`Active channels in Capgo: ${o?.length}`),w6(o),await Oe(e.apikey,{channel:"channel",event:"List channel",icon:"\u2705",user_id:i,tags:{"app-id":t},notify:!1}).catch(),J("Done \u2705"),(0,h8.exit)()}var g8=require("node:process");var m8=["major","minor","metadata","patch","none"];async function y8(t,e,r){Z("Set channel"),r.apikey=r.apikey||de();let n=await te();e=pe(e,n?.config),r.apikey||(p.error("Missing API key, you need to provide a API key to upload your bundle"),k.error("")),e||(p.error("Missing argument, you need to provide a appId, or be in a capacitor project"),k.error(""));let i=await fe(r.apikey),o=await he(i,r.apikey,["write","all"]);await qe(i,r.apikey,e,4);let s=await wr(i,e),{bundle:a,state:u,downgrade:l,latest:c,upgrade:f,ios:h,android:d,selfAssign:m,disableAutoUpdate:b,dev:D,emulator:_}=r;t||(p.error("Missing argument, you need to provide a channel"),k.error("")),c&&a&&(p.error("Cannot set latest and bundle at the same time"),k.error("")),a==null&&u==null&&c==null&&l==null&&f==null&&h==null&&d==null&&m==null&&D==null&&_==null&&b==null&&(p.error("Missing argument, you need to provide a option to set"),k.error(""));try{await ch(i,s,r.apikey,e);let F={created_by:o,app_id:e,name:t,owner_org:s,version:void 0},g=await vr("",r.packageJson),C=c?n?.config?.plugins?.CapacitorUpdater?.version||g?.version:a;if(C!=null){let{data:A,error:T}=await i.from("app_versions").select().eq("app_id",e).eq("name",C).eq("user_id",o).eq("deleted",!1).single();(T||!A)&&(p.error(`Cannot find version ${C}`),k.error("")),p.info(`Set ${e} channel: ${t} to @${C}`),F.version=A.id}if(u!=null&&((u==="public"||u==="private")&&p.info(`Set ${e} channel: ${t} to public or private is deprecated, use default or normal instead`),p.info(`Set ${e} channel: ${t} to ${u==="public"||u==="default"?"default":"normal"}`),F.public=u==="public"||u==="default"),l!=null&&(p.info(`Set ${e} channel: ${t} to ${l?"allow":"disallow"} downgrade`),F.disable_auto_update_under_native=!l),h!=null&&(p.info(`Set ${e} channel: ${t} to ${h?"allow":"disallow"} ios update`),F.ios=!!h),d!=null&&(p.info(`Set ${e} channel: ${t} to ${d?"allow":"disallow"} android update`),F.android=!!d),m!=null&&(p.info(`Set ${e} channel: ${t} to ${m?"allow":"disallow"} self assign to this channel`),F.allow_device_self_set=!!m),b!=null){let A=b.toLocaleLowerCase();m8.includes(A)||(p.error(`Channel strategy ${A} is not known. The possible values are: ${m8.join(", ")}.`),k.error("")),A==="metadata"&&(A="version_number"),F.disable_auto_update=A,p.info(`Set ${e} channel: ${t} to ${A} disable update strategy to this channel`)}try{let{error:A}=await dh(i,F);A&&(p.error('Cannot set channel the upload key is not allowed to do that, use the "all" for this.'),k.error(""))}catch{p.error('Cannot set channel the upload key is not allowed to do that, use the "all" for this.'),k.error("")}await Oe(r.apikey,{channel:"channel",event:"Set channel",icon:"\u2705",user_id:s,tags:{"app-id":e},notify:!1}).catch()}catch(F){p.error(`Unknow error ${Q(F)}`),k.error("")}J("Done \u2705"),(0,g8.exit)()}var ql=require("node:child_process"),Ie=require("node:fs"),pi=require("node:path"),ke=require("node:process");var Gh=ue(R8());var Lt=require("node:fs");async function Loe(t,e=!0){e&&Z("Save keys \u{1F511}");let r=await te(),n=t.key||Fn,i=t.keyData||"";if(!(0,Lt.existsSync)(n)&&!i)if(p)p.error(`Cannot find a public key at ${n} or as keyData option or in ${r.path}`),k.error("");else return!1;else(0,Lt.existsSync)(n)&&(i=(0,Lt.readFileSync)(n).toString());if(i&&!i.startsWith("-----BEGIN RSA PUBLIC KEY-----"))if(p)p.error("the public key provided is not a valid RSA Public key"),k.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,p.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 ci(r)),e&&(p.success(`public key saved into ${r.path} file in local directory`),p.success("your app will decode the zip archive with this key")),!0}async function Boe(t,e=!0){e&&Z("Deleting old private key \u{1F5D1}\uFE0F");let r=await te();if(r?.config?.plugins?.CapacitorUpdater?.privateKey){if(delete r.config.plugins.CapacitorUpdater.privateKey,await ci(r),(0,Lt.existsSync)(ia))try{(0,Lt.unlinkSync)(ia),e&&p.success(`Old private key file deleted: ${ia}`)}catch{e&&p.error(`Failed to delete old private key file: ${ia}`)}if((0,Lt.existsSync)(uh))try{(0,Lt.unlinkSync)(uh),e&&p.success(`Old public key file deleted: ${uh}`)}catch{e&&p.error(`Failed to delete old public key file: ${Fn}`)}return e&&p.success(`Old private key deleted from ${r.path} file`),!0}else return e&&p.info("No old private key found in config file"),!1}async function $8(t){Z("Save keys \u{1F511}"),await Ae(),await Loe(t)}async function Sb(t,e=!0){e&&Z("Create keys \u{1F511}");let{publicKey:r,privateKey:n}=k6();if((0,Lt.existsSync)(Fn)&&!t.force)if(p.error("Public Key already exists, use --force to overwrite"),e)k.error("");else return!1;if((0,Lt.writeFileSync)(Fn,r),(0,Lt.existsSync)(or)&&!t.force)if(p.error("Private Key already exists, use --force to overwrite"),e)k.error("");else return!1;(0,Lt.writeFileSync)(or,n);let i=await te();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,p.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,ci(i)),p&&(p.success("Your RSA key has been generated"),p.success(`Private key saved in ${or}`),p.success("This key will be use to encrypt your bundle before sending it to Capgo"),p.success("Keep it safe"),p.success("Than make it unreadable by Capgo and unmodifiable by anyone"),p.success(`Public key saved in ${i.path}`),p.success("Your app will be the only one having it"),p.success("Only your users can decrypt your update"),p.success("Only you can send them an update"),J("Done \u2705")),!0}async function I8(t){await Ae(),await Sb(t)}async function j8(t){await Ae(),await Boe(t)}var Nn=require("node:fs"),Fb=require("node:os"),xb=require("node:process");async function N8(){let t=(0,Fb.homedir)();return(0,Nn.existsSync)(`${t}/.capgo`)||(0,Nn.existsSync)(".capgo")}async function Ob(t,e,r=!0){if(r&&Z("Login to Capgo"),!t)return r&&(p.error("Missing API key, you need to provide a API key to upload your bundle"),k.error("")),!1;await Ae();try{let{local:n}=e;if(n)(0,Nn.existsSync)(".git")||(p.error("To use local you should be in a git repository"),k.error("")),(0,Nn.writeFileSync)(".capgo",`${t}
|
|
318
318
|
`),(0,Nn.appendFileSync)(".gitignore",`.capgo
|
|
319
|
-
`);else{let s=(0,
|
|
320
|
-
`)}let i=await fe(t),o=await he(i,t,["write","all","upload"]);await Oe(t,{channel:"user-login",event:"User CLI login",icon:"\u2705",user_id:o,notify:!1}).catch(),p.success(`login saved into .capgo file in ${n?"local":"home"} directory`)}catch{p.error("Error while saving login"),(0,
|
|
321
|
-
${r}`),p.warn("Onboarding will continue but please report it to the capgo team!")}}async function
|
|
322
|
-
${r}`),p.warn("Onboarding will continue but please report it to the capgo team!");return}}function
|
|
323
|
-
Error: ${t}`)}}async function un(t,e,r){st(t)&&(await Tn("onboarding-v2",e,r,"canceled","\u{1F937}"),(0,ke.exit)())}async function Tr(t,e,r){return Tn("onboarding-v2",t,e,`onboarding-step-${r}`)}async function
|
|
319
|
+
`);else{let s=(0,Fb.homedir)();(0,Nn.writeFileSync)(`${s}/.capgo`,`${t}
|
|
320
|
+
`)}let i=await fe(t),o=await he(i,t,["write","all","upload"]);await Oe(t,{channel:"user-login",event:"User CLI login",icon:"\u2705",user_id:o,notify:!1}).catch(),p.success(`login saved into .capgo file in ${n?"local":"home"} directory`)}catch{p.error("Error while saving login"),(0,xb.exit)(1)}return r&&(J("Done \u2705"),(0,xb.exit)()),!0}async function L8(t,e){Ob(t,e,!0)}var B8="import { CapacitorUpdater } from '@capgo/capacitor-updater'",zh="CapacitorUpdater.notifyAppReady()",qoe=/import.*from.*/g,Bl="production",q8={stdio:"pipe"},Fa,$o;function M8(){Fa||(Fa=(0,Ie.readdirSync)(Gh.default.tmpdir).map(t=>({name:t,full:`${Gh.default.tmpdir}/${t}`})).find(t=>t.name.startsWith("capgocli"))?.full??Gh.default.fileSync({prefix:"capgocli"}).name)}function an(t,e){try{M8(),(0,Ie.writeFileSync)(Fa,JSON.stringify(e?{step_done:t,pathToPackageJson:e}:{step_done:t,pathToPackageJson:$o})),e&&($o=e)}catch(r){p.error(`Cannot mark step as done in the CLI, error:
|
|
321
|
+
${r}`),p.warn("Onboarding will continue but please report it to the capgo team!")}}async function Moe(t,e){try{M8();let r=(0,Ie.readFileSync)(Fa,"utf-8");if(!r||r.length===0)return;let{step_done:n,pathToPackageJson:i}=JSON.parse(r);p.info(`You have already got to the step ${n}/10 in the previous session`);let o=await Pe({message:"Would you like to continue from where you left off?"});return await un(o,t,e),o?(i&&($o=i),n):void 0}catch(r){p.error(`Cannot read which steps have been compleated, error:
|
|
322
|
+
${r}`),p.warn("Onboarding will continue but please report it to the capgo team!");return}}function Uoe(){if(Fa)try{(0,Ie.rmSync)(Fa)}catch(t){p.error(`Cannot delete the tmp steps file.
|
|
323
|
+
Error: ${t}`)}}async function un(t,e,r){st(t)&&(await Tn("onboarding-v2",e,r,"canceled","\u{1F937}"),(0,ke.exit)())}async function Tr(t,e,r){return Tn("onboarding-v2",t,e,`onboarding-step-${r}`)}async function Hoe(t,e,r,n){let i=Jt(),o=await Pe({message:`Add ${r} in Capgo?`});if(await un(o,t.gid,e),o){let s=_e();s.start(`Running: ${i.runner} @capgo/cli@latest app add ${r}`),await zv(r,n,t,!1)?s.stop("App add Done \u2705"):s.stop("App already add \u2705")}else p.info(`If you change your mind, run it for yourself with: "${i.runner} @capgo/cli@latest app add ${r}"`);await Tr(t.gid,e,2)}async function Voe(t,e,r){let n=Jt(),i=await Pe({message:`Create default channel ${Bl} for ${r} in Capgo?`});if(await un(i,t,e),i){let o=_e();o.start(`Running: ${n.runner} @capgo/cli@latest channel add ${Bl} ${r} --default`),await yb(Bl,r,{default:!0,apikey:e},!1)?o.stop("Channel add Done \u2705"):o.stop("Channel already added \u2705")}else p.info(`If you change your mind, run it for yourself with: "${n.runner} @capgo/cli@latest channel add ${Bl} ${r} --default"`);await Tr(t,e,3)}async function zoe(t){let e=(0,pi.join)(On((0,ke.cwd)()),"package.json"),r=$o?await kr(void 0,$o):await kr(void 0,e);if(r.size===0||!r.has("@capacitor/core")){p.warn("No adequate dependencies found");let n=await Pe({message:"Would you like to select the package.json file manually?"});if(st(n)&&(Di("Operation cancelled."),(0,ke.exit)(1)),n){let i=await Pe({message:"Would you like to use a tree selector to choose the package.json file?"});if(st(i)&&(Di("Operation cancelled."),(0,ke.exit)(1)),i){let s=(0,ke.cwd)(),a="package.json";for(;;){let u=(0,Ie.readdirSync)(s).map(l=>({value:l,label:l}));if(u.push({value:"..",label:".."}),a=await yi({message:"Select package.json file:",options:u}),st(a)&&(Di("Operation cancelled."),(0,ke.exit)(1)),!(0,Ie.statSync)((0,pi.join)(s,a)).isDirectory()&&a!=="package.json"){p.error("Selected a file that is not a package.json file");continue}if(s=(0,pi.join)(s,a),a==="package.json")break}return await an(t,s),{dependencies:await kr(void 0,s),path:s}}let o=await rc({message:"Enter path to node_modules folder:"});return st(o)&&(Di("Operation cancelled."),(0,ke.exit)(1)),(0,Ie.existsSync)(o)||(p.error(`Path ${o} does not exist`),(0,ke.exit)(1)),{dependencies:await kr(void 0,o),path:o}}}return await an(t,e),{dependencies:await kr(void 0,e),path:e}}var Goe="https://capacitorjs.com/docs/updating/6-0",Woe="https://capacitorjs.com/docs/updating/5-0";async function Koe(t,e,r){let n=Jt(),i=await Pe({message:`Automatic Install "@capgo/capacitor-updater" dependency in ${r}?`});if(await un(i,t,e),i){let o=_e(),s="latest",{dependencies:a,path:u}=await zoe(3);o.start("Checking if @capgo/capacitor-updater is installed"),a.has("@capacitor/core")||(o.stop("Error"),p.warn("Cannot find @capacitor/core in package.json"),J("Bye \u{1F44B}"),(0,ke.exit)());let l=Xt(a.get("@capacitor/core")?.replace("^","").replace("~","")??"");if(l?So(l,Xt("5.0.0"))?(o.stop("Error"),p.warn(`@capacitor/core version is ${l}, please update to Capacitor v5 first: ${Woe}`),J("Bye \u{1F44B}"),(0,ke.exit)()):So(l,Xt("6.0.0"))&&(o.stop(`@capacitor/core version is ${l}, please update to Capacitor v6: ${Goe} to access the best features of Capgo`),s="^5.0.0"):(o.stop("Error"),p.warn("Cannot find @capacitor/core in package.json, please run `capgo init` in a capacitor project"),J("Bye \u{1F44B}"),(0,ke.exit)()),n.pm==="unknown"&&(o.stop("Error"),p.warn("Cannot reconize package manager, please run `capgo init` in a capacitor project with npm, pnpm, bun or yarn"),J("Bye \u{1F44B}"),(0,ke.exit)()),a.get("@capgo/capacitor-updater"))o.stop("Capgo already installed \u2705");else{await(0,ql.execSync)(`${n.installCommand} @capgo/capacitor-updater@${s}`,{...q8,cwd:u.replace("/package.json","")});let c=await vr(void 0,u);await El({version:c?.version||"1.0.0",appId:r,autoUpdate:!0}),o.stop("Install Done \u2705")}}else p.info(`If you change your mind, run it for yourself with: "${n.installCommand} @capgo/capacitor-updater@latest"`);await Tr(t,e,4)}async function Yoe(t,e,r){let n=await Pe({message:`Automatic Add "${zh}" code and import in ${r}?`});if(await un(n,t,e),n){let i=_e();i.start("Adding @capacitor-updater to your main file");let o=await wv();if(o==="nuxtjs-js"||o==="nuxtjs-ts"){let s=(0,pi.join)("plugins");(0,Ie.existsSync)(s)||(0,Ie.mkdirSync)(s,{recursive:!0});let a;o==="nuxtjs-ts"?a=(0,pi.join)(s,"capacitorUpdater.client.ts"):a=(0,pi.join)(s,"capacitorUpdater.client.js");let u=`
|
|
324
324
|
import { CapacitorUpdater } from '@capgo/capacitor-updater'
|
|
325
325
|
|
|
326
326
|
export default defineNuxtPlugin(() => {
|
|
327
327
|
CapacitorUpdater.notifyAppReady()
|
|
328
328
|
})
|
|
329
|
-
`;(0,Ie.existsSync)(a)?(0,Ie.readFileSync)(a,"utf8").includes("CapacitorUpdater.notifyAppReady()")?(i.stop("Code already added to capacitorUpdater.client.ts file inside plugins directory \u2705"),p.info("Plugins directory and capacitorUpdater.client.ts file already exist with required code")):((0,Ie.writeFileSync)(a,u,"utf8"),i.stop("Code added to capacitorUpdater.client.ts file inside plugins directory \u2705"),p.info("Updated capacitorUpdater.client.ts file with required code")):((0,Ie.writeFileSync)(a,u,"utf8"),i.stop("Code added to capacitorUpdater.client.ts file inside plugins directory \u2705"),p.info("Created plugins directory and capacitorUpdater.client.ts file"))}else{let s;if(o==="unknown")s=await
|
|
330
|
-
${
|
|
329
|
+
`;(0,Ie.existsSync)(a)?(0,Ie.readFileSync)(a,"utf8").includes("CapacitorUpdater.notifyAppReady()")?(i.stop("Code already added to capacitorUpdater.client.ts file inside plugins directory \u2705"),p.info("Plugins directory and capacitorUpdater.client.ts file already exist with required code")):((0,Ie.writeFileSync)(a,u,"utf8"),i.stop("Code added to capacitorUpdater.client.ts file inside plugins directory \u2705"),p.info("Updated capacitorUpdater.client.ts file with required code")):((0,Ie.writeFileSync)(a,u,"utf8"),i.stop("Code added to capacitorUpdater.client.ts file inside plugins directory \u2705"),p.info("Created plugins directory and capacitorUpdater.client.ts file"))}else{let s;if(o==="unknown")s=await dI();else{let f=o.endsWith("-ts");s=await cI(o,f)}if(!s||!(0,Ie.existsSync)(s)){i.stop("Cannot find main file to install Updater plugin");let f=await rc({message:"Provide the correct relative path to your main file (JS or TS):",validate:h=>{if(!(0,Ie.existsSync)(h))return"File does not exist. Please provide a valid path."}});st(f)&&(Di("Operation cancelled."),(0,ke.exit)(1)),s=f}let u=(0,Ie.readFileSync)(s,"utf8").toString(),c=u.match(qoe)?.pop();if(c||(i.stop("Error"),p.warn("Cannot find import line in main file, use manual installation: https://capgo.app/docs/plugin/cloud-mode/auto-update/"),J("Bye \u{1F44B}"),(0,ke.exit)()),u.includes(zh))i.stop(`Code already added to ${s} \u2705`);else{let f=u.replace(c,`${c}
|
|
330
|
+
${B8};
|
|
331
331
|
|
|
332
332
|
${zh};
|
|
333
333
|
`);(0,Ie.writeFileSync)(s,f,"utf8"),i.stop(`Code added to ${s} \u2705`)}}await Tr(t,e,5)}else p.info(`Add to your main file the following code:
|
|
334
334
|
|
|
335
|
-
${
|
|
335
|
+
${B8};
|
|
336
336
|
|
|
337
337
|
${zh};
|
|
338
|
-
`)}async function Woe(t,e,r){let n=await kr(),i=Xt(n.get("@capacitor/core")?.replace("^","").replace("~","")??"");i||p.warn("Cannot find @capacitor/core in package.json. It is likely that you are using a monorepo. Please NOTE that encryption is not supported in Capacitor V5.");let o=Jt(),s=await Pe({message:`Automatic configure end-to-end encryption in ${r} updates?`});if(await un(s,t,e),s){if(i&&So(i,Xt("6.0.0"))){p.warn("Encryption is not supported in Capacitor V5.");return}let a=_e();a.start(`Running: ${o.runner} @capgo/cli@latest key create`),await Cb({force:!0},!1)?a.stop("key created \u{1F511}"):(a.stop("Error"),p.warn("Cannot create key \u274C"),J("Bye \u{1F44B}"),(0,ke.exit)(1)),Tn("onboarding-v2",t,e,"Use encryption v2")}await Tr(t,e,6)}async function Koe(t,e,r){let n=Jt(),i=await Pe({message:`Automatic build ${r} with "${n.pm} run build" ?`});if(await un(i,t,e),i){let o=_e(),s=await wv(),a=await cI(s);o.start(`Running: ${n.pm} run ${a} && ${n.runner} cap sync`),(await vr()).scripts[a]||(o.stop("Error"),p.warn(`Cannot find ${a} script in package.json, please add it and run \`capgo init\` again`),J("Bye \u{1F44B}"),(0,ke.exit)()),(0,ql.execSync)(`${n.pm} run ${a} && ${n.runner} cap sync`,B8),o.stop("Build & Sync Done \u2705")}else p.info(`Build yourself with command: ${n.pm} run build && ${n.runner} cap sync`);await Tr(t,e,7)}async function Yoe(t,e,r){let n=Jt(),i=await Pe({message:`Automatic upload ${r} bundle to Capgo?`});if(await un(i,t,e),i){let o=_e(),s;o.start(`Running: ${n.runner} @capgo/cli@latest bundle upload`);let a=rI((0,ke.cwd)());$o&&a&&(p.warn("You are most likely using a monorepo, please provide the path to your package.json file AND node_modules path folder when uploading your bundle"),p.warn(`Example: ${n.runner} @capgo/cli@latest bundle upload --package-json ./packages/my-app/package.json --node-modules ./packages/my-app/node_modules`),s=(0,pi.join)(On((0,ke.cwd)()),"node_modules"),p.warn(`Guessed node modules path at: ${s}`),(0,Ie.existsSync)(s)||(p.error("Node modules path does not exist, upload skipped"),J("Bye \u{1F44B}"),(0,ke.exit)(1))),await pb(r,{channel:Bl,apikey:e,packageJson:a?$o:void 0,nodeModules:a?s:void 0},!1)?o.stop("Upload Done \u2705"):(o.stop("Error"),p.warn("Upload failed \u274C"),J("Bye \u{1F44B}"),(0,ke.exit)())}else p.info(`Upload yourself with command: ${n.runner} @capgo/cli@latest bundle upload`);await Tr(t,e,8)}async function Joe(t,e){let r=Jt(),n=await Pe({message:"Run in device now ?"});if(await un(n,t,e),n){let i=await yi({message:"Pick a platform to run your app",options:[{value:"ios",label:"IOS"},{value:"android",label:"Android"}]});st(i)&&(J("Bye \u{1F44B}"),(0,ke.exit)());let o=i,s=_e();s.start(`Running: ${r.runner} cap run ${o}`),await(0,ql.spawnSync)(r.runner,["cap","run",o],{stdio:"inherit"}),s.stop("Started Done \u2705")}else p.info(`If you change your mind, run it for yourself with: ${r.runner} cap run <ios|android>`);await Tr(t,e,9)}async function Xoe(t,e,r,n){let i=await Pe({message:"Automatic check if update working in device ?"});if(await un(i,t,e),i)p.info(`Wait logs sent to Capgo from ${r} device, Please open your app \u{1F4AA}`),await Wv("onboarding-v2",e,r,e,t);else{let o=mo(r);p.info(`Check logs in ${n}/app/p/${o}/logs to see if update works.`)}await Tr(t,e,10)}async function M8(t,e,r){let n=Jt();Z("Capgo onboarding \u{1F6EB}"),await Ae();let i=!r.supaAnon||!r.supaHost?await te():await El({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 br();e=pe(e,i?.config),r.apikey=t||de(),e===void 0&&(e=await rc({message:"Enter your appId:"}),st(e)&&(Di("Operation cancelled."),(0,ke.exit)(1)));let s=_e();(!j8()||t)&&(s.start(`Running: ${n.runner} @capgo/cli@latest login ***`),await Fb(r.apikey,r,!1),s.stop("Login Done \u2705"));let a=await fe(r.apikey);await he(a,r.apikey,["upload","all","read","write"]);let u=await aa(a,["admin","super_admin"]),l=u.gid,c=await Loe(l,r.apikey)??0;try{c<1&&await Tr(l,r.apikey,1),c<2&&(await qoe(u,r.apikey,e,r),an(2)),c<3&&(await Moe(l,r.apikey,e),an(3)),c<4&&(await zoe(l,r.apikey,e),an(4)),c<5&&(await Goe(l,r.apikey,e),an(5)),c<6&&(await Woe(l,r.apikey,e),an(6)),c<7&&(await Koe(l,r.apikey,e),an(7)),c<8&&(await Yoe(l,r.apikey,e),an(8)),c<9&&(await Joe(l,r.apikey),an(9)),await Xoe(l,r.apikey,e,o.hostWeb),await Tr(l,r.apikey,0),Boe()}catch(f){console.error(f),p.error("Error during onboarding, please try again later"),(0,ke.exit)(1)}p.info("Welcome onboard \u2708\uFE0F!"),p.info("Your Capgo update system is setup"),p.info(`Next time use \`${n.runner} @capgo/cli@latest bundle upload\` to only upload your bundle`),p.info(`If you have any issue try to use the debug command \`${n.runner} @capgo/cli@latest app debug\``),J("Bye \u{1F44B}"),(0,ke.exit)()}async function U8(t){Z("Getting user id"),t.apikey=t.apikey||de();let e=await fe(t.apikey),r=await he(e,t.apikey,["read","all","write"]);J(`Done \u2705: ${r}`)}k.name(Cr.name).description("Manage packages and bundle versions in Capgo Cloud").version(Cr.version,"-v, --version","output the current version");k.command("login [apikey]").alias("l").description("Save apikey to your machine or folder").action(N8).option("--local","Only save in local folder");k.command("doctor").description("Get info about your Capgo app install").option("--package-json <packageJson>","A list of path to package.json. Usefull for monorepos (comma separated ex: ../../package.json,./package.json)").action(Kj);k.command("init [apikey] [appId]").alias("i").description("Init a new app").action(M8).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 Oa=k.command("app").description("Manage app");Oa.command("add [appId]").alias("a").description("Add a new app in Capgo Cloud").action(Vj).option("-n, --name <name>","app name").option("-i, --icon <icon>","app icon path").option("-a, --apikey <apikey>","apikey to link to your account");Oa.command("delete [appId]").description("Delete an app in Capgo Cloud").action(Wj).option("-a, --apikey <apikey>","apikey to link to your account");Oa.command("list").alias("l").description("list apps in Capgo Cloud").action(Jj).option("-a, --apikey <apikey>","apikey to link to your account");Oa.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(zj);Oa.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(e6);Oa.command("set [appId]").alias("s").description("Set an app in Capgo Cloud").action(Qj).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 mi=k.command("bundle").description("Manage bundle");mi.command("upload [appId]").alias("u").description("Upload a new bundle in Capgo Cloud").action(r8).option("-a, --apikey <apikey>","apikey to link to your account").option("-p, --path <path>","path of the folder to upload, if not provided it will use the webDir set in capacitor.config").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-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("--tus-chunk-size <tusChunkSize>","Chunk size for the TUS upload").option("--partial","Upload partial files to Capgo cloud").option("--partial-only","Upload only partial files to Capgo cloud, skip the zipped file, useful for big bundle").option("--encrypted-checksum <encryptedChecksum>","An encrypted checksum (signature). Used only when uploading an external bundle.").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("--package-json <packageJson>","A list of path to package.json. Usefull for monorepos (comma separated ex: ../../package.json,./package.json)").option("--node-modules <nodeModules>","A list of path to node_modules. Usefull for monorepos (comma separated ex: ../../node_modules,./node_modules)").option("--encrypt-partial","Encrypt the partial update files").option("--delete-linked-bundle-on-upload","Locates the currently linked bundle in the channel you are trying to upload to, and deletes it");mi.command("compatibility [appId]").action(x6).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 list of path to package.json. Usefull for monorepos (comma separated ex: ../../package.json,./package.json)").option("--node-modules <nodeModules>","A list of path to node_modules. Usefull for monorepos (comma separated ex: ../../node_modules,./node_modules)");mi.command("delete [bundleId] [appId]").alias("d").description("Delete a bundle in Capgo Cloud").action(I6).option("-a, --apikey <apikey>","apikey to link to your account");mi.command("list [appId]").alias("l").description("List bundle in Capgo Cloud").action(B6).option("-a, --apikey <apikey>","apikey to link to your account");mi.command("cleanup [appId]").alias("c").action(C6).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");mi.command("encrypt [zipPath] [checksum]").description("Encrypt a zip bundle using the new encryption method").action(N6).option("--key <key>","custom path for private signing key").option("--key-data <keyData>","private signing key").option("-j, --json","output in JSON");mi.command("decrypt [zipPath] [checksum]").description("Decrypt a zip bundle using the new encryption method").action(R6).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");mi.command("zip [appId]").description("Zip a bundle").action(o8).option("-p, --path <path>","path of the folder to upload, if not provided it will use the webDir set in capacitor.config").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 list of path to package.json. Usefull for monorepos (comma separated ex: ../../package.json,./package.json)");var Ml=k.command("channel").description("Manage channel");Ml.command("add [channelId] [appId]").alias("a").description("Create channel").action(a8).option("-d, --default","set the channel as default").option("-a, --apikey <apikey>","apikey to link to your account");Ml.command("delete [channelId] [appId]").alias("d").description("Delete channel").action(f8).option("-a, --apikey <apikey>","apikey to link to your account").option("--delete-bundle","delete the bundle associated with the channel");Ml.command("list [appId]").alias("l").description("List channel").action(h8).option("-a, --apikey <apikey>","apikey to link to your account");Ml.command("currentBundle [channel] [appId]").description("Get current bundle for specific channel in Capgo Cloud").action(l8).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");Ml.command("set [channelId] [appId]").alias("s").description("Set channel").action(g8).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 list of path to package.json. Usefull for monorepos (comma separated ex: ../../package.json,./package.json)");var Ob=k.command("key").description("Manage encryption key");Ob.command("save").description("Save base64 encryption key in capacitor config, usefull for CI").action(R8).option("-f, --force","force generate a new one").option("--key <key>","key path to save in capacitor config").option("--key-data <keyData>","key data to save in capacitor config");Ob.command("create").description("Create a new encryption key").action($8).option("-f, --force","force generate a new one");Ob.command("delete_old").description("Delete the old encryption key").action(I8);var Zoe=k.command("account").description("Manage account");Zoe.command("id").description("Get your account ID, it's safe to share it in discord or other places").action(U8).option("-a, --apikey <apikey>","apikey to link to your account");k.parseAsync();
|
|
338
|
+
`)}async function Joe(t,e,r){let n=await kr(),i=Xt(n.get("@capacitor/core")?.replace("^","").replace("~","")??"");i||p.warn("Cannot find @capacitor/core in package.json. It is likely that you are using a monorepo. Please NOTE that encryption is not supported in Capacitor V5.");let o=Jt(),s=await Pe({message:`Automatic configure end-to-end encryption in ${r} updates?`});if(await un(s,t,e),s){if(i&&So(i,Xt("6.0.0"))){p.warn("Encryption is not supported in Capacitor V5.");return}let a=_e();a.start(`Running: ${o.runner} @capgo/cli@latest key create`),await Sb({force:!0},!1)?a.stop("key created \u{1F511}"):(a.stop("Error"),p.warn("Cannot create key \u274C"),J("Bye \u{1F44B}"),(0,ke.exit)(1)),Tn("onboarding-v2",t,e,"Use encryption v2")}await Tr(t,e,6)}async function Xoe(t,e,r){let n=Jt(),i=await Pe({message:`Automatic build ${r} with "${n.pm} run build" ?`});if(await un(i,t,e),i){let o=_e(),s=await wv(),a=await fI(s);o.start(`Running: ${n.pm} run ${a} && ${n.runner} cap sync`),(await vr()).scripts[a]||(o.stop("Error"),p.warn(`Cannot find ${a} script in package.json, please add it and run \`capgo init\` again`),J("Bye \u{1F44B}"),(0,ke.exit)()),(0,ql.execSync)(`${n.pm} run ${a} && ${n.runner} cap sync`,q8),o.stop("Build & Sync Done \u2705")}else p.info(`Build yourself with command: ${n.pm} run build && ${n.runner} cap sync`);await Tr(t,e,7)}async function Zoe(t,e,r){let n=Jt(),i=await Pe({message:`Automatic upload ${r} bundle to Capgo?`});if(await un(i,t,e),i){let o=_e(),s;o.start(`Running: ${n.runner} @capgo/cli@latest bundle upload`);let a=nI((0,ke.cwd)());$o&&a&&(p.warn("You are most likely using a monorepo, please provide the path to your package.json file AND node_modules path folder when uploading your bundle"),p.warn(`Example: ${n.runner} @capgo/cli@latest bundle upload --package-json ./packages/my-app/package.json --node-modules ./packages/my-app/node_modules`),s=(0,pi.join)(On((0,ke.cwd)()),"node_modules"),p.warn(`Guessed node modules path at: ${s}`),(0,Ie.existsSync)(s)||(p.error("Node modules path does not exist, upload skipped"),J("Bye \u{1F44B}"),(0,ke.exit)(1))),await mb(r,{channel:Bl,apikey:e,packageJson:a?$o:void 0,nodeModules:a?s:void 0},!1)?o.stop("Upload Done \u2705"):(o.stop("Error"),p.warn("Upload failed \u274C"),J("Bye \u{1F44B}"),(0,ke.exit)())}else p.info(`Upload yourself with command: ${n.runner} @capgo/cli@latest bundle upload`);await Tr(t,e,8)}async function Qoe(t,e){let r=Jt(),n=await Pe({message:"Run in device now ?"});if(await un(n,t,e),n){let i=await yi({message:"Pick a platform to run your app",options:[{value:"ios",label:"IOS"},{value:"android",label:"Android"}]});st(i)&&(J("Bye \u{1F44B}"),(0,ke.exit)());let o=i,s=_e();s.start(`Running: ${r.runner} cap run ${o}`),await(0,ql.spawnSync)(r.runner,["cap","run",o],{stdio:"inherit"}),s.stop("Started Done \u2705")}else p.info(`If you change your mind, run it for yourself with: ${r.runner} cap run <ios|android>`);await Tr(t,e,9)}async function ese(t,e,r,n){let i=await Pe({message:"Automatic check if update working in device ?"});if(await un(i,t,e),i)p.info(`Wait logs sent to Capgo from ${r} device, Please open your app \u{1F4AA}`),await Wv("onboarding-v2",e,r,e,t);else{let o=mo(r);p.info(`Check logs in ${n}/app/p/${o}/logs to see if update works.`)}await Tr(t,e,10)}async function U8(t,e,r){let n=Jt();Z("Capgo onboarding \u{1F6EB}"),await Ae();let i=!r.supaAnon||!r.supaHost?await te():await El({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 br();e=pe(e,i?.config),r.apikey=t||de(),e===void 0&&(e=await rc({message:"Enter your appId:"}),st(e)&&(Di("Operation cancelled."),(0,ke.exit)(1)));let s=_e();(!N8()||t)&&(s.start(`Running: ${n.runner} @capgo/cli@latest login ***`),await Ob(r.apikey,r,!1),s.stop("Login Done \u2705"));let a=await fe(r.apikey);await he(a,r.apikey,["upload","all","read","write"]);let u=await aa(a,["admin","super_admin"]),l=u.gid,c=await Moe(l,r.apikey)??0;try{c<1&&await Tr(l,r.apikey,1),c<2&&(await Hoe(u,r.apikey,e,r),an(2)),c<3&&(await Voe(l,r.apikey,e),an(3)),c<4&&(await Koe(l,r.apikey,e),an(4)),c<5&&(await Yoe(l,r.apikey,e),an(5)),c<6&&(await Joe(l,r.apikey,e),an(6)),c<7&&(await Xoe(l,r.apikey,e),an(7)),c<8&&(await Zoe(l,r.apikey,e),an(8)),c<9&&(await Qoe(l,r.apikey),an(9)),await ese(l,r.apikey,e,o.hostWeb),await Tr(l,r.apikey,0),Uoe()}catch(f){console.error(f),p.error("Error during onboarding, please try again later"),(0,ke.exit)(1)}p.info("Welcome onboard \u2708\uFE0F!"),p.info("Your Capgo update system is setup"),p.info(`Next time use \`${n.runner} @capgo/cli@latest bundle upload\` to only upload your bundle`),p.info(`If you have any issue try to use the debug command \`${n.runner} @capgo/cli@latest app debug\``),J("Bye \u{1F44B}"),(0,ke.exit)()}async function H8(t){Z("Getting user id"),t.apikey=t.apikey||de();let e=await fe(t.apikey),r=await he(e,t.apikey,["read","all","write"]);J(`Done \u2705: ${r}`)}k.name(Cr.name).description("Manage packages and bundle versions in Capgo Cloud").version(Cr.version,"-v, --version","output the current version");k.command("login [apikey]").alias("l").description("Save apikey to your machine or folder").action(L8).option("--local","Only save in local folder");k.command("doctor").description("Get info about your Capgo app install").option("--package-json <packageJson>","A list of path to package.json. Usefull for monorepos (comma separated ex: ../../package.json,./package.json)").action(Yj);k.command("init [apikey] [appId]").alias("i").description("Init a new app").action(U8).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 Oa=k.command("app").description("Manage app");Oa.command("add [appId]").alias("a").description("Add a new app in Capgo Cloud").action(zj).option("-n, --name <name>","app name").option("-i, --icon <icon>","app icon path").option("-a, --apikey <apikey>","apikey to link to your account");Oa.command("delete [appId]").description("Delete an app in Capgo Cloud").action(Kj).option("-a, --apikey <apikey>","apikey to link to your account");Oa.command("list").alias("l").description("list apps in Capgo Cloud").action(Xj).option("-a, --apikey <apikey>","apikey to link to your account");Oa.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(Gj);Oa.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(t6);Oa.command("set [appId]").alias("s").description("Set an app in Capgo Cloud").action(e6).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 mi=k.command("bundle").description("Manage bundle");mi.command("upload [appId]").alias("u").description("Upload a new bundle in Capgo Cloud").action(n8).option("-a, --apikey <apikey>","apikey to link to your account").option("-p, --path <path>","path of the folder to upload, if not provided it will use the webDir set in capacitor.config").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-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("--tus-chunk-size <tusChunkSize>","Chunk size for the TUS upload").option("--partial","Upload partial files to Capgo cloud").option("--partial-only","Upload only partial files to Capgo cloud, skip the zipped file, useful for big bundle").option("--encrypted-checksum <encryptedChecksum>","An encrypted checksum (signature). Used only when uploading an external bundle.").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("--package-json <packageJson>","A list of path to package.json. Usefull for monorepos (comma separated ex: ../../package.json,./package.json)").option("--node-modules <nodeModules>","A list of path to node_modules. Usefull for monorepos (comma separated ex: ../../node_modules,./node_modules)").option("--encrypt-partial","Encrypt the partial update files").option("--delete-linked-bundle-on-upload","Locates the currently linked bundle in the channel you are trying to upload to, and deletes it");mi.command("compatibility [appId]").action(F6).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 list of path to package.json. Usefull for monorepos (comma separated ex: ../../package.json,./package.json)").option("--node-modules <nodeModules>","A list of path to node_modules. Usefull for monorepos (comma separated ex: ../../node_modules,./node_modules)");mi.command("delete [bundleId] [appId]").alias("d").description("Delete a bundle in Capgo Cloud").action(j6).option("-a, --apikey <apikey>","apikey to link to your account");mi.command("list [appId]").alias("l").description("List bundle in Capgo Cloud").action(q6).option("-a, --apikey <apikey>","apikey to link to your account");mi.command("cleanup [appId]").alias("c").action(S6).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");mi.command("encrypt [zipPath] [checksum]").description("Encrypt a zip bundle using the new encryption method").action(L6).option("--key <key>","custom path for private signing key").option("--key-data <keyData>","private signing key").option("-j, --json","output in JSON");mi.command("decrypt [zipPath] [checksum]").description("Decrypt a zip bundle using the new encryption method").action($6).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");mi.command("zip [appId]").description("Zip a bundle").action(s8).option("-p, --path <path>","path of the folder to upload, if not provided it will use the webDir set in capacitor.config").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 list of path to package.json. Usefull for monorepos (comma separated ex: ../../package.json,./package.json)");var Ml=k.command("channel").description("Manage channel");Ml.command("add [channelId] [appId]").alias("a").description("Create channel").action(u8).option("-d, --default","set the channel as default").option("-a, --apikey <apikey>","apikey to link to your account");Ml.command("delete [channelId] [appId]").alias("d").description("Delete channel").action(d8).option("-a, --apikey <apikey>","apikey to link to your account").option("--delete-bundle","delete the bundle associated with the channel");Ml.command("list [appId]").alias("l").description("List channel").action(p8).option("-a, --apikey <apikey>","apikey to link to your account");Ml.command("currentBundle [channel] [appId]").description("Get current bundle for specific channel in Capgo Cloud").action(c8).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");Ml.command("set [channelId] [appId]").alias("s").description("Set channel").action(y8).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 list of path to package.json. Usefull for monorepos (comma separated ex: ../../package.json,./package.json)");var Ab=k.command("key").description("Manage encryption key");Ab.command("save").description("Save base64 encryption key in capacitor config, usefull for CI").action($8).option("-f, --force","force generate a new one").option("--key <key>","key path to save in capacitor config").option("--key-data <keyData>","key data to save in capacitor config");Ab.command("create").description("Create a new encryption key").action(I8).option("-f, --force","force generate a new one");Ab.command("delete_old").description("Delete the old encryption key").action(j8);var tse=k.command("account").description("Manage account");tse.command("id").description("Get your account ID, it's safe to share it in discord or other places").action(H8).option("-a, --apikey <apikey>","apikey to link to your account");k.parseAsync();
|
|
339
339
|
/*! Bundled license information:
|
|
340
340
|
|
|
341
341
|
safe-buffer/index.js:
|