@capgo/cli 4.24.1 → 4.24.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,89 +1,89 @@
1
1
  #!/usr/bin/env node
2
- "use strict";var XL=Object.create;var rl=Object.defineProperty;var ZL=Object.getOwnPropertyDescriptor;var QL=Object.getOwnPropertyNames;var eB=Object.getPrototypeOf,tB=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),mn=(t,e)=>{for(var r in e)rl(t,r,{get:e[r],enumerable:!0})},sw=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of QL(e))!tB.call(t,i)&&i!==r&&rl(t,i,{get:()=>e[i],enumerable:!(n=ZL(e,i))||n.enumerable});return t};var le=(t,e,r)=>(r=t!=null?XL(eB(t)):{},sw(e||!t||!t.__esModule?rl(r,"default",{value:t,enumerable:!0}):r,t)),Ae=t=>sw(rl({},"__esModule",{value:!0}),t);var ja=y(wp=>{var nl=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}},bp=class extends nl{constructor(e){super(1,"commander.invalidArgument",e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};wp.CommanderError=nl;wp.InvalidArgumentError=bp});var il=y(Ep=>{var{InvalidArgumentError:rB}=ja(),_p=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 rB(`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 nB(t){let e=t.name()+(t.variadic===!0?"...":"");return t.required?"<"+e+">":"["+e+"]"}Ep.Argument=_p;Ep.humanReadableArgName=nB});var Sp=y(aw=>{var{humanReadableArgName:iB}=il(),Cp=class{constructor(){this.helpWidth=void 0,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}visibleCommands(e){let r=e.commands.filter(i=>!i._hidden),n=e._getHelpCommand();return n&&!n._hidden&&r.push(n),this.sortSubcommands&&r.sort((i,o)=>i.name().localeCompare(o.name())),r}compareOptions(e,r){let n=i=>i.short?i.short.replace(/^-/,""):i.long.replace(/^--/,"");return n(e).localeCompare(n(r))}visibleOptions(e){let r=e.options.filter(i=>!i.hidden),n=e._getHelpOption();if(n&&!n.hidden){let i=n.short&&e._findOption(n.short),o=n.long&&e._findOption(n.long);!i&&!o?r.push(n):n.long&&!o?r.push(e.createOption(n.long,n.description)):n.short&&!i&&r.push(e.createOption(n.short,n.description))}return this.sortOptions&&r.sort(this.compareOptions),r}visibleGlobalOptions(e){if(!this.showGlobalOptions)return[];let r=[];for(let n=e.parent;n;n=n.parent){let i=n.options.filter(o=>!o.hidden);r.push(...i)}return this.sortOptions&&r.sort(this.compareOptions),r}visibleArguments(e){return e._argsDescription&&e.registeredArguments.forEach(r=>{r.description=r.description||e._argsDescription[r.name()]||""}),e.registeredArguments.find(r=>r.description)?e.registeredArguments:[]}subcommandTerm(e){let r=e.registeredArguments.map(n=>iB(n)).join(" ");return e._name+(e._aliases[0]?"|"+e._aliases[0]:"")+(e.options.length?" [options]":"")+(r?" "+r:"")}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,r){return r.visibleCommands(e).reduce((n,i)=>Math.max(n,r.subcommandTerm(i).length),0)}longestOptionTermLength(e,r){return r.visibleOptions(e).reduce((n,i)=>Math.max(n,r.optionTerm(i).length),0)}longestGlobalOptionTermLength(e,r){return r.visibleGlobalOptions(e).reduce((n,i)=>Math.max(n,r.optionTerm(i).length),0)}longestArgumentTermLength(e,r){return r.visibleArguments(e).reduce((n,i)=>Math.max(n,r.argumentTerm(i).length),0)}commandUsage(e){let r=e._name;e._aliases[0]&&(r=r+"|"+e._aliases[0]);let n="";for(let i=e.parent;i;i=i.parent)n=i.name()+" "+n;return n+r+" "+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.summary()||e.description()}optionDescription(e){let r=[];return e.argChoices&&r.push(`choices: ${e.argChoices.map(n=>JSON.stringify(n)).join(", ")}`),e.defaultValue!==void 0&&(e.required||e.optional||e.isBoolean()&&typeof e.defaultValue=="boolean")&&r.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),e.presetArg!==void 0&&e.optional&&r.push(`preset: ${JSON.stringify(e.presetArg)}`),e.envVar!==void 0&&r.push(`env: ${e.envVar}`),r.length>0?`${e.description} (${r.join(", ")})`:e.description}argumentDescription(e){let r=[];if(e.argChoices&&r.push(`choices: ${e.argChoices.map(n=>JSON.stringify(n)).join(", ")}`),e.defaultValue!==void 0&&r.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),r.length>0){let n=`(${r.join(", ")})`;return e.description?`${e.description} ${n}`:n}return e.description}formatHelp(e,r){let n=r.padWidth(e,r),i=r.helpWidth||80,o=2,s=2;function a(m,b){if(b){let g=`${m.padEnd(n+s)}${b}`;return r.wrap(g,i-o,n+s)}return m}function u(m){return m.join(`
2
+ "use strict";var XL=Object.create;var rl=Object.defineProperty;var ZL=Object.getOwnPropertyDescriptor;var QL=Object.getOwnPropertyNames;var eB=Object.getPrototypeOf,tB=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),mn=(t,e)=>{for(var r in e)rl(t,r,{get:e[r],enumerable:!0})},ow=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of QL(e))!tB.call(t,i)&&i!==r&&rl(t,i,{get:()=>e[i],enumerable:!(n=ZL(e,i))||n.enumerable});return t};var le=(t,e,r)=>(r=t!=null?XL(eB(t)):{},ow(e||!t||!t.__esModule?rl(r,"default",{value:t,enumerable:!0}):r,t)),Ae=t=>ow(rl({},"__esModule",{value:!0}),t);var ja=y(wp=>{var nl=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}},bp=class extends nl{constructor(e){super(1,"commander.invalidArgument",e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};wp.CommanderError=nl;wp.InvalidArgumentError=bp});var il=y(Ep=>{var{InvalidArgumentError:rB}=ja(),_p=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 rB(`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 nB(t){let e=t.name()+(t.variadic===!0?"...":"");return t.required?"<"+e+">":"["+e+"]"}Ep.Argument=_p;Ep.humanReadableArgName=nB});var Sp=y(sw=>{var{humanReadableArgName:iB}=il(),Cp=class{constructor(){this.helpWidth=void 0,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}visibleCommands(e){let r=e.commands.filter(i=>!i._hidden),n=e._getHelpCommand();return n&&!n._hidden&&r.push(n),this.sortSubcommands&&r.sort((i,o)=>i.name().localeCompare(o.name())),r}compareOptions(e,r){let n=i=>i.short?i.short.replace(/^-/,""):i.long.replace(/^--/,"");return n(e).localeCompare(n(r))}visibleOptions(e){let r=e.options.filter(i=>!i.hidden),n=e._getHelpOption();if(n&&!n.hidden){let i=n.short&&e._findOption(n.short),o=n.long&&e._findOption(n.long);!i&&!o?r.push(n):n.long&&!o?r.push(e.createOption(n.long,n.description)):n.short&&!i&&r.push(e.createOption(n.short,n.description))}return this.sortOptions&&r.sort(this.compareOptions),r}visibleGlobalOptions(e){if(!this.showGlobalOptions)return[];let r=[];for(let n=e.parent;n;n=n.parent){let i=n.options.filter(o=>!o.hidden);r.push(...i)}return this.sortOptions&&r.sort(this.compareOptions),r}visibleArguments(e){return e._argsDescription&&e.registeredArguments.forEach(r=>{r.description=r.description||e._argsDescription[r.name()]||""}),e.registeredArguments.find(r=>r.description)?e.registeredArguments:[]}subcommandTerm(e){let r=e.registeredArguments.map(n=>iB(n)).join(" ");return e._name+(e._aliases[0]?"|"+e._aliases[0]:"")+(e.options.length?" [options]":"")+(r?" "+r:"")}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,r){return r.visibleCommands(e).reduce((n,i)=>Math.max(n,r.subcommandTerm(i).length),0)}longestOptionTermLength(e,r){return r.visibleOptions(e).reduce((n,i)=>Math.max(n,r.optionTerm(i).length),0)}longestGlobalOptionTermLength(e,r){return r.visibleGlobalOptions(e).reduce((n,i)=>Math.max(n,r.optionTerm(i).length),0)}longestArgumentTermLength(e,r){return r.visibleArguments(e).reduce((n,i)=>Math.max(n,r.argumentTerm(i).length),0)}commandUsage(e){let r=e._name;e._aliases[0]&&(r=r+"|"+e._aliases[0]);let n="";for(let i=e.parent;i;i=i.parent)n=i.name()+" "+n;return n+r+" "+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.summary()||e.description()}optionDescription(e){let r=[];return e.argChoices&&r.push(`choices: ${e.argChoices.map(n=>JSON.stringify(n)).join(", ")}`),e.defaultValue!==void 0&&(e.required||e.optional||e.isBoolean()&&typeof e.defaultValue=="boolean")&&r.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),e.presetArg!==void 0&&e.optional&&r.push(`preset: ${JSON.stringify(e.presetArg)}`),e.envVar!==void 0&&r.push(`env: ${e.envVar}`),r.length>0?`${e.description} (${r.join(", ")})`:e.description}argumentDescription(e){let r=[];if(e.argChoices&&r.push(`choices: ${e.argChoices.map(n=>JSON.stringify(n)).join(", ")}`),e.defaultValue!==void 0&&r.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),r.length>0){let n=`(${r.join(", ")})`;return e.description?`${e.description} ${n}`:n}return e.description}formatHelp(e,r){let n=r.padWidth(e,r),i=r.helpWidth||80,o=2,s=2;function a(m,b){if(b){let g=`${m.padEnd(n+s)}${b}`;return r.wrap(g,i-o,n+s)}return m}function u(m){return m.join(`
3
3
  `).replace(/^/gm," ".repeat(o))}let c=[`Usage: ${r.commandUsage(e)}`,""],l=r.commandDescription(e);l.length>0&&(c=c.concat([r.wrap(l,i,0),""]));let f=r.visibleArguments(e).map(m=>a(r.argumentTerm(m),r.argumentDescription(m)));f.length>0&&(c=c.concat(["Arguments:",u(f),""]));let h=r.visibleOptions(e).map(m=>a(r.optionTerm(m),r.optionDescription(m)));if(h.length>0&&(c=c.concat(["Options:",u(h),""])),this.showGlobalOptions){let m=r.visibleGlobalOptions(e).map(b=>a(r.optionTerm(b),r.optionDescription(b)));m.length>0&&(c=c.concat(["Global Options:",u(m),""]))}let d=r.visibleCommands(e).map(m=>a(r.subcommandTerm(m),r.subcommandDescription(m)));return d.length>0&&(c=c.concat(["Commands:",u(d),""])),c.join(`
4
4
  `)}padWidth(e,r){return Math.max(r.longestOptionTermLength(e,r),r.longestGlobalOptionTermLength(e,r),r.longestSubcommandTermLength(e,r),r.longestArgumentTermLength(e,r))}wrap(e,r,n,i=40){let o=" \\f\\t\\v\xA0\u1680\u2000-\u200A\u202F\u205F\u3000\uFEFF",s=new RegExp(`[\\n][${o}]+`);if(e.match(s))return e;let a=r-n;if(a<i)return e;let u=e.slice(0,n),c=e.slice(n).replace(`\r
5
5
  `,`
6
6
  `),l=" ".repeat(n),h="\\s\u200B",d=new RegExp(`
7
7
  |.{1,${a-1}}([${h}]|$)|[^${h}]+?([${h}]|$)`,"g"),m=c.match(d)||[];return u+m.map((b,g)=>b===`
8
8
  `?"":(g>0?l:"")+b.trimEnd()).join(`
9
- `)}};aw.Help=Cp});var Ap=y(Op=>{var{InvalidArgumentError:oB}=ja(),xp=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=aB(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 oB(`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 sB(this.name().replace(/^no-/,""))}is(e){return this.short===e||this.long===e}isBoolean(){return!this.required&&!this.optional&&!this.negate}},Fp=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 sB(t){return t.split("-").reduce((e,r)=>e+r[0].toUpperCase()+r.slice(1))}function aB(t){let e,r,n=t.split(/[ |,]+/);return n.length>1&&!/^[[<]/.test(n[1])&&(e=n.shift()),r=n.shift(),!e&&/^-[^-]$/.test(r)&&(e=r,r=void 0),{shortFlag:e,longFlag:r}}Op.Option=xp;Op.DualOptions=Fp});var cw=y(uw=>{function uB(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 cB(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=uB(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?`
9
+ `)}};sw.Help=Cp});var Ap=y(Op=>{var{InvalidArgumentError:oB}=ja(),xp=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=aB(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 oB(`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 sB(this.name().replace(/^no-/,""))}is(e){return this.short===e||this.long===e}isBoolean(){return!this.required&&!this.optional&&!this.negate}},Fp=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 sB(t){return t.split("-").reduce((e,r)=>e+r[0].toUpperCase()+r.slice(1))}function aB(t){let e,r,n=t.split(/[ |,]+/);return n.length>1&&!/^[[<]/.test(n[1])&&(e=n.shift()),r=n.shift(),!e&&/^-[^-]$/.test(r)&&(e=r,r=void 0),{shortFlag:e,longFlag:r}}Op.Option=xp;Op.DualOptions=Fp});var uw=y(aw=>{function uB(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 cB(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=uB(t,s),u=Math.max(t.length,s.length);(u-a)/u>o&&(a<i?(i=a,n=[s]):a===i&&n.push(s))}),n.sort((s,a)=>s.localeCompare(a)),r&&(n=n.map(s=>`--${s}`)),n.length>1?`
10
10
  (Did you mean one of ${n.join(", ")}?)`:n.length===1?`
11
- (Did you mean ${n[0]}?)`:""}uw.suggestSimilar=cB});var pw=y(hw=>{var lB=require("node:events").EventEmitter,kp=require("node:child_process"),gn=require("node:path"),Tp=require("node:fs"),Ke=require("node:process"),{Argument:fB,humanReadableArgName:dB}=il(),{CommanderError:Pp}=ja(),{Help:hB}=Sp(),{Option:lw,DualOptions:pB}=Ap(),{suggestSimilar:fw}=cw(),Rp=class t extends lB{constructor(e){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!0,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=e||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._outputConfiguration={writeOut:r=>Ke.stdout.write(r),writeErr:r=>Ke.stderr.write(r),getOutHelpWidth:()=>Ke.stdout.isTTY?Ke.stdout.columns:void 0,getErrHelpWidth:()=>Ke.stderr.isTTY?Ke.stderr.columns:void 0,outputError:(r,n)=>n(r)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={}}copyInheritedSettings(e){return this._outputConfiguration=e._outputConfiguration,this._helpOption=e._helpOption,this._helpCommand=e._helpCommand,this._helpConfiguration=e._helpConfiguration,this._exitCallback=e._exitCallback,this._storeOptionsAsProperties=e._storeOptionsAsProperties,this._combineFlagAndOptionalValue=e._combineFlagAndOptionalValue,this._allowExcessArguments=e._allowExcessArguments,this._enablePositionalOptions=e._enablePositionalOptions,this._showHelpAfterError=e._showHelpAfterError,this._showSuggestionAfterError=e._showSuggestionAfterError,this}_getCommandAndAncestors(){let e=[];for(let r=this;r;r=r.parent)e.push(r);return e}command(e,r,n){let i=r,o=n;typeof i=="object"&&i!==null&&(o=i,i=null),o=o||{};let[,s,a]=e.match(/([^ ]+) *(.*)/),u=this.createCommand(s);return i&&(u.description(i),u._executableHandler=!0),o.isDefault&&(this._defaultCommandName=u._name),u._hidden=!!(o.noHelp||o.hidden),u._executableFile=o.executableFile||null,a&&u.arguments(a),this._registerCommand(u),u.parent=this,u.copyInheritedSettings(this),i?this:u}createCommand(e){return new t(e)}createHelp(){return Object.assign(new hB,this.configureHelp())}configureHelp(e){return e===void 0?this._helpConfiguration:(this._helpConfiguration=e,this)}configureOutput(e){return e===void 0?this._outputConfiguration:(Object.assign(this._outputConfiguration,e),this)}showHelpAfterError(e=!0){return typeof e!="string"&&(e=!!e),this._showHelpAfterError=e,this}showSuggestionAfterError(e=!0){return this._showSuggestionAfterError=!!e,this}addCommand(e,r){if(!e._name)throw new Error(`Command passed to .addCommand() must have a name
11
+ (Did you mean ${n[0]}?)`:""}aw.suggestSimilar=cB});var hw=y(dw=>{var lB=require("node:events").EventEmitter,kp=require("node:child_process"),gn=require("node:path"),Tp=require("node:fs"),Ke=require("node:process"),{Argument:fB,humanReadableArgName:dB}=il(),{CommanderError:Pp}=ja(),{Help:hB}=Sp(),{Option:cw,DualOptions:pB}=Ap(),{suggestSimilar:lw}=uw(),Rp=class t extends lB{constructor(e){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!0,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=e||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._outputConfiguration={writeOut:r=>Ke.stdout.write(r),writeErr:r=>Ke.stderr.write(r),getOutHelpWidth:()=>Ke.stdout.isTTY?Ke.stdout.columns:void 0,getErrHelpWidth:()=>Ke.stderr.isTTY?Ke.stderr.columns:void 0,outputError:(r,n)=>n(r)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={}}copyInheritedSettings(e){return this._outputConfiguration=e._outputConfiguration,this._helpOption=e._helpOption,this._helpCommand=e._helpCommand,this._helpConfiguration=e._helpConfiguration,this._exitCallback=e._exitCallback,this._storeOptionsAsProperties=e._storeOptionsAsProperties,this._combineFlagAndOptionalValue=e._combineFlagAndOptionalValue,this._allowExcessArguments=e._allowExcessArguments,this._enablePositionalOptions=e._enablePositionalOptions,this._showHelpAfterError=e._showHelpAfterError,this._showSuggestionAfterError=e._showSuggestionAfterError,this}_getCommandAndAncestors(){let e=[];for(let r=this;r;r=r.parent)e.push(r);return e}command(e,r,n){let i=r,o=n;typeof i=="object"&&i!==null&&(o=i,i=null),o=o||{};let[,s,a]=e.match(/([^ ]+) *(.*)/),u=this.createCommand(s);return i&&(u.description(i),u._executableHandler=!0),o.isDefault&&(this._defaultCommandName=u._name),u._hidden=!!(o.noHelp||o.hidden),u._executableFile=o.executableFile||null,a&&u.arguments(a),this._registerCommand(u),u.parent=this,u.copyInheritedSettings(this),i?this:u}createCommand(e){return new t(e)}createHelp(){return Object.assign(new hB,this.configureHelp())}configureHelp(e){return e===void 0?this._helpConfiguration:(this._helpConfiguration=e,this)}configureOutput(e){return e===void 0?this._outputConfiguration:(Object.assign(this._outputConfiguration,e),this)}showHelpAfterError(e=!0){return typeof e!="string"&&(e=!!e),this._showHelpAfterError=e,this}showSuggestionAfterError(e=!0){return this._showSuggestionAfterError=!!e,this}addCommand(e,r){if(!e._name)throw new Error(`Command passed to .addCommand() must have a name
12
12
  - specify the name in Command constructor or using .name()`);return r=r||{},r.isDefault&&(this._defaultCommandName=e._name),(r.noHelp||r.hidden)&&(e._hidden=!0),this._registerCommand(e),e.parent=this,e._checkForBrokenPassThrough(),this}createArgument(e,r){return new fB(e,r)}argument(e,r,n,i){let o=this.createArgument(e,r);return typeof n=="function"?o.default(i).argParser(n):o.default(n),this.addArgument(o),this}arguments(e){return e.trim().split(/ +/).forEach(r=>{this.argument(r)}),this}addArgument(e){let r=this.registeredArguments.slice(-1)[0];if(r&&r.variadic)throw new Error(`only the last argument can be variadic '${r.name()}'`);if(e.required&&e.defaultValue!==void 0&&e.parseArg===void 0)throw new Error(`a default value for a required argument is never used: '${e.name()}'`);return this.registeredArguments.push(e),this}helpCommand(e,r){if(typeof e=="boolean")return this._addImplicitHelpCommand=e,this;e=e??"help [command]";let[,n,i]=e.match(/([^ ]+) *(.*)/),o=r??"display help for command",s=this.createCommand(n);return s.helpOption(!1),i&&s.arguments(i),o&&s.description(o),this._addImplicitHelpCommand=!0,this._helpCommand=s,this}addHelpCommand(e,r){return typeof e!="object"?(this.helpCommand(e,r),this):(this._addImplicitHelpCommand=!0,this._helpCommand=e,this)}_getHelpCommand(){return this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"))?(this._helpCommand===void 0&&this.helpCommand(void 0,void 0),this._helpCommand):null}hook(e,r){let n=["preSubcommand","preAction","postAction"];if(!n.includes(e))throw new Error(`Unexpected value for event passed to hook : '${e}'.
13
- 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 Pp(e,r,n)),Ke.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 lw(e,r)}_callParseArg(e,r,n,i){try{return e.parseArg(r,n)}catch(o){if(o.code==="commander.invalidArgument"){let s=`${i} ${o.message}`;this.error(s,{exitCode:o.exitCode,code:o.code})}throw o}}_registerOption(e){let r=e.short&&this._findOption(e.short)||e.long&&this._findOption(e.long);if(r){let n=e.long&&this._findOption(e.long)?e.long:e.short;throw new Error(`Cannot add option '${e.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${n}'
14
- - 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 lw)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");let s=this.createOption(r,n);if(s.makeOptionMandatory(!!e.mandatory),typeof i=="function")s.default(o).argParser(i);else if(i instanceof RegExp){let a=i;i=(u,c)=>{let l=a.exec(u);return l?l[0]:c},s.default(o).argParser(i)}else s.default(i);return this.addOption(s)}option(e,r,n,i){return this._optionEx({},e,r,n,i)}requiredOption(e,r,n,i){return this._optionEx({mandatory:!0},e,r,n,i)}combineFlagAndOptionalValue(e=!0){return this._combineFlagAndOptionalValue=!!e,this}allowUnknownOption(e=!0){return this._allowUnknownOption=!!e,this}allowExcessArguments(e=!0){return this._allowExcessArguments=!!e,this}enablePositionalOptions(e=!0){return this._enablePositionalOptions=!!e,this}passThroughOptions(e=!0){return this._passThroughOptions=!!e,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw new Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties(e=!0){if(this.options.length)throw new Error("call .storeOptionsAsProperties() before adding options");if(Object.keys(this._optionValues).length)throw new Error("call .storeOptionsAsProperties() before setting option values");return this._storeOptionsAsProperties=!!e,this}getOptionValue(e){return this._storeOptionsAsProperties?this[e]:this._optionValues[e]}setOptionValue(e,r){return this.setOptionValueWithSource(e,r,void 0)}setOptionValueWithSource(e,r,n){return this._storeOptionsAsProperties?this[e]=r:this._optionValues[e]=r,this._optionValueSources[e]=n,this}getOptionValueSource(e){return this._optionValueSources[e]}getOptionValueSourceWithGlobals(e){let r;return this._getCommandAndAncestors().forEach(n=>{n.getOptionValueSource(e)!==void 0&&(r=n.getOptionValueSource(e))}),r}_prepareUserArgs(e,r){if(e!==void 0&&!Array.isArray(e))throw new Error("first parameter to parse must be array or undefined");if(r=r||{},e===void 0&&r.from===void 0){Ke.versions?.electron&&(r.from="electron");let i=Ke.execArgv??[];(i.includes("-e")||i.includes("--eval")||i.includes("-p")||i.includes("--print"))&&(r.from="eval")}e===void 0&&(e=Ke.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":Ke.defaultApp?(this._scriptPath=e[1],n=e.slice(2)):n=e.slice(1);break;case"user":n=e.slice(0);break;case"eval":n=e.slice(1);break;default:throw new Error(`unexpected parse option { from: '${r.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||"program",n}parse(e,r){let n=this._prepareUserArgs(e,r);return this._parseCommand([],n),this}async parseAsync(e,r){let n=this._prepareUserArgs(e,r);return await this._parseCommand([],n),this}_executeSubCommand(e,r){r=r.slice();let n=!1,i=[".js",".ts",".tsx",".mjs",".cjs"];function o(l,f){let h=gn.resolve(l,f);if(Tp.existsSync(h))return h;if(i.includes(gn.extname(f)))return;let d=i.find(m=>Tp.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 l;try{l=Tp.realpathSync(this._scriptPath)}catch{l=this._scriptPath}a=gn.resolve(gn.dirname(l),a)}if(a){let l=o(a,s);if(!l&&!e._executableFile&&this._scriptPath){let f=gn.basename(this._scriptPath,gn.extname(this._scriptPath));f!==this._name&&(l=o(a,`${f}-${e._name}`))}s=l||s}n=i.includes(gn.extname(s));let u;Ke.platform!=="win32"?n?(r.unshift(s),r=dw(Ke.execArgv).concat(r),u=kp.spawn(Ke.argv[0],r,{stdio:"inherit"})):u=kp.spawn(s,r,{stdio:"inherit"}):(r.unshift(s),r=dw(Ke.execArgv).concat(r),u=kp.spawn(Ke.execPath,r,{stdio:"inherit"})),u.killed||["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(f=>{Ke.on(f,()=>{u.killed===!1&&u.exitCode===null&&u.kill(f)})});let c=this._exitCallback;u.on("close",l=>{l=l??1,c?c(new Pp(l,"commander.executeSubCommandAsync","(close)")):Ke.exit(l)}),u.on("error",l=>{if(l.code==="ENOENT"){let f=a?`searched for local subcommand relative to directory '${a}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",h=`'${s}' does not exist
13
+ Expecting one of '${n.join("', '")}'`);return this._lifeCycleHooks[e]?this._lifeCycleHooks[e].push(r):this._lifeCycleHooks[e]=[r],this}exitOverride(e){return e?this._exitCallback=e:this._exitCallback=r=>{if(r.code!=="commander.executeSubCommandAsync")throw r},this}_exit(e,r,n){this._exitCallback&&this._exitCallback(new Pp(e,r,n)),Ke.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 cw(e,r)}_callParseArg(e,r,n,i){try{return e.parseArg(r,n)}catch(o){if(o.code==="commander.invalidArgument"){let s=`${i} ${o.message}`;this.error(s,{exitCode:o.exitCode,code:o.code})}throw o}}_registerOption(e){let r=e.short&&this._findOption(e.short)||e.long&&this._findOption(e.long);if(r){let n=e.long&&this._findOption(e.long)?e.long:e.short;throw new Error(`Cannot add option '${e.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${n}'
14
+ - 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 cw)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");let s=this.createOption(r,n);if(s.makeOptionMandatory(!!e.mandatory),typeof i=="function")s.default(o).argParser(i);else if(i instanceof RegExp){let a=i;i=(u,c)=>{let l=a.exec(u);return l?l[0]:c},s.default(o).argParser(i)}else s.default(i);return this.addOption(s)}option(e,r,n,i){return this._optionEx({},e,r,n,i)}requiredOption(e,r,n,i){return this._optionEx({mandatory:!0},e,r,n,i)}combineFlagAndOptionalValue(e=!0){return this._combineFlagAndOptionalValue=!!e,this}allowUnknownOption(e=!0){return this._allowUnknownOption=!!e,this}allowExcessArguments(e=!0){return this._allowExcessArguments=!!e,this}enablePositionalOptions(e=!0){return this._enablePositionalOptions=!!e,this}passThroughOptions(e=!0){return this._passThroughOptions=!!e,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw new Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties(e=!0){if(this.options.length)throw new Error("call .storeOptionsAsProperties() before adding options");if(Object.keys(this._optionValues).length)throw new Error("call .storeOptionsAsProperties() before setting option values");return this._storeOptionsAsProperties=!!e,this}getOptionValue(e){return this._storeOptionsAsProperties?this[e]:this._optionValues[e]}setOptionValue(e,r){return this.setOptionValueWithSource(e,r,void 0)}setOptionValueWithSource(e,r,n){return this._storeOptionsAsProperties?this[e]=r:this._optionValues[e]=r,this._optionValueSources[e]=n,this}getOptionValueSource(e){return this._optionValueSources[e]}getOptionValueSourceWithGlobals(e){let r;return this._getCommandAndAncestors().forEach(n=>{n.getOptionValueSource(e)!==void 0&&(r=n.getOptionValueSource(e))}),r}_prepareUserArgs(e,r){if(e!==void 0&&!Array.isArray(e))throw new Error("first parameter to parse must be array or undefined");if(r=r||{},e===void 0&&r.from===void 0){Ke.versions?.electron&&(r.from="electron");let i=Ke.execArgv??[];(i.includes("-e")||i.includes("--eval")||i.includes("-p")||i.includes("--print"))&&(r.from="eval")}e===void 0&&(e=Ke.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":Ke.defaultApp?(this._scriptPath=e[1],n=e.slice(2)):n=e.slice(1);break;case"user":n=e.slice(0);break;case"eval":n=e.slice(1);break;default:throw new Error(`unexpected parse option { from: '${r.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||"program",n}parse(e,r){let n=this._prepareUserArgs(e,r);return this._parseCommand([],n),this}async parseAsync(e,r){let n=this._prepareUserArgs(e,r);return await this._parseCommand([],n),this}_executeSubCommand(e,r){r=r.slice();let n=!1,i=[".js",".ts",".tsx",".mjs",".cjs"];function o(l,f){let h=gn.resolve(l,f);if(Tp.existsSync(h))return h;if(i.includes(gn.extname(f)))return;let d=i.find(m=>Tp.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 l;try{l=Tp.realpathSync(this._scriptPath)}catch{l=this._scriptPath}a=gn.resolve(gn.dirname(l),a)}if(a){let l=o(a,s);if(!l&&!e._executableFile&&this._scriptPath){let f=gn.basename(this._scriptPath,gn.extname(this._scriptPath));f!==this._name&&(l=o(a,`${f}-${e._name}`))}s=l||s}n=i.includes(gn.extname(s));let u;Ke.platform!=="win32"?n?(r.unshift(s),r=fw(Ke.execArgv).concat(r),u=kp.spawn(Ke.argv[0],r,{stdio:"inherit"})):u=kp.spawn(s,r,{stdio:"inherit"}):(r.unshift(s),r=fw(Ke.execArgv).concat(r),u=kp.spawn(Ke.execPath,r,{stdio:"inherit"})),u.killed||["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(f=>{Ke.on(f,()=>{u.killed===!1&&u.exitCode===null&&u.kill(f)})});let c=this._exitCallback;u.on("close",l=>{l=l??1,c?c(new Pp(l,"commander.executeSubCommandAsync","(close)")):Ke.exit(l)}),u.on("error",l=>{if(l.code==="ENOENT"){let f=a?`searched for local subcommand relative to directory '${a}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",h=`'${s}' does not exist
15
15
  - if '${e._name}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
16
16
  - if the default executable name is not suitable, use the executableFile option to supply a custom name or path
17
17
  - ${f}`;throw new Error(h)}else if(l.code==="EACCES")throw new Error(`'${s}' not executable`);if(!c)Ke.exit(1);else{let f=new Pp(1,"commander.executeSubCommandAsync","(error)");f.nestedError=l,c(f)}}),this.runningCommand=u}_dispatchSubcommand(e,r,n){let i=this._findCommand(e);i||this.help({error:!0});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 c=this._findOption(u);if(c){if(c.required){let l=o.shift();l===void 0&&this.optionMissingArgument(c),this.emit(`option:${c.name()}`,l)}else if(c.optional){let l=null;o.length>0&&!s(o[0])&&(l=o.shift()),this.emit(`option:${c.name()}`,l)}else this.emit(`option:${c.name()}`);a=c.variadic?c:null;continue}}if(u.length>2&&u[0]==="-"&&u[1]!=="-"){let c=this._findOption(`-${u[1]}`);if(c){c.required||c.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${c.name()}`,u.slice(2)):(this.emit(`option:${c.name()}`),o.unshift(`-${u.slice(2)}`));continue}}if(/^--[^=]+=/.test(u)){let c=u.indexOf("="),l=this._findOption(u.slice(0,c));if(l&&(l.required||l.optional)){this.emit(`option:${l.name()}`,u.slice(c+1));continue}}if(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}
18
18
  `,this._outputConfiguration.writeErr),typeof this._showHelpAfterError=="string"?this._outputConfiguration.writeErr(`${this._showHelpAfterError}
19
19
  `):this._showHelpAfterError&&(this._outputConfiguration.writeErr(`
20
- `),this.outputHelp({error:!0}));let n=r||{},i=n.exitCode||1,o=n.code||"commander.error";this._exit(i,o,e)}_parseOptionsEnv(){this.options.forEach(e=>{if(e.envVar&&e.envVar in Ke.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()}`,Ke.env[e.envVar]):this.emit(`optionEnv:${e.name()}`))}})}_parseOptionsImplied(){let e=new pB(this.options),r=n=>this.getOptionValue(n)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(n));this.options.filter(n=>n.implied!==void 0&&r(n.attributeName())&&e.valueFromOption(this.getOptionValue(n.attributeName()),n)).forEach(n=>{Object.keys(n.implied).filter(i=>!r(i)).forEach(i=>{this.setOptionValueWithSource(i,n.implied[i],"implied")})})}missingArgument(e){let r=`error: missing required argument '${e}'`;this.error(r,{code:"commander.missingArgument"})}optionMissingArgument(e){let r=`error: option '${e.flags}' argument missing`;this.error(r,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(e){let r=`error: required option '${e.flags}' not specified`;this.error(r,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(e,r){let n=s=>{let a=s.attributeName(),u=this.getOptionValue(a),c=this.options.find(f=>f.negate&&a===f.attributeName()),l=this.options.find(f=>!f.negate&&a===f.attributeName());return c&&(c.presetArg===void 0&&u===!1||c.presetArg!==void 0&&u===c.presetArg)?c:l||s},i=s=>{let a=n(s),u=a.attributeName();return this.getOptionValueSource(u)==="env"?`environment variable '${a.envVar}'`:`option '${a.flags}'`},o=`error: ${i(e)} cannot be used with ${i(r)}`;this.error(o,{code:"commander.conflictingOption"})}unknownOption(e){if(this._allowUnknownOption)return;let r="";if(e.startsWith("--")&&this._showSuggestionAfterError){let i=[],o=this;do{let s=o.createHelp().visibleOptions(o).filter(a=>a.long).map(a=>a.long);i=i.concat(s),o=o.parent}while(o&&!o._enablePositionalOptions);r=fw(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=fw(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}
20
+ `),this.outputHelp({error:!0}));let n=r||{},i=n.exitCode||1,o=n.code||"commander.error";this._exit(i,o,e)}_parseOptionsEnv(){this.options.forEach(e=>{if(e.envVar&&e.envVar in Ke.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()}`,Ke.env[e.envVar]):this.emit(`optionEnv:${e.name()}`))}})}_parseOptionsImplied(){let e=new pB(this.options),r=n=>this.getOptionValue(n)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(n));this.options.filter(n=>n.implied!==void 0&&r(n.attributeName())&&e.valueFromOption(this.getOptionValue(n.attributeName()),n)).forEach(n=>{Object.keys(n.implied).filter(i=>!r(i)).forEach(i=>{this.setOptionValueWithSource(i,n.implied[i],"implied")})})}missingArgument(e){let r=`error: missing required argument '${e}'`;this.error(r,{code:"commander.missingArgument"})}optionMissingArgument(e){let r=`error: option '${e.flags}' argument missing`;this.error(r,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(e){let r=`error: required option '${e.flags}' not specified`;this.error(r,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(e,r){let n=s=>{let a=s.attributeName(),u=this.getOptionValue(a),c=this.options.find(f=>f.negate&&a===f.attributeName()),l=this.options.find(f=>!f.negate&&a===f.attributeName());return c&&(c.presetArg===void 0&&u===!1||c.presetArg!==void 0&&u===c.presetArg)?c:l||s},i=s=>{let a=n(s),u=a.attributeName();return this.getOptionValueSource(u)==="env"?`environment variable '${a.envVar}'`:`option '${a.flags}'`},o=`error: ${i(e)} cannot be used with ${i(r)}`;this.error(o,{code:"commander.conflictingOption"})}unknownOption(e){if(this._allowUnknownOption)return;let r="";if(e.startsWith("--")&&this._showSuggestionAfterError){let i=[],o=this;do{let s=o.createHelp().visibleOptions(o).filter(a=>a.long).map(a=>a.long);i=i.concat(s),o=o.parent}while(o&&!o._enablePositionalOptions);r=lw(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=lw(e,i)}let n=`error: unknown command '${e}'${r}`;this.error(n,{code:"commander.unknownCommand"})}version(e,r,n){if(e===void 0)return this._version;this._version=e,r=r||"-V, --version",n=n||"output the version number";let i=this.createOption(r,n);return this._versionOptionName=i.attributeName(),this._registerOption(i),this.on("option:"+i.name(),()=>{this._outputConfiguration.writeOut(`${e}
21
21
  `),this._exit(0,"commander.version",e)}),this}description(e,r){return e===void 0&&r===void 0?this._description:(this._description=e,r&&(this._argsDescription=r),this)}summary(e){return e===void 0?this._summary:(this._summary=e,this)}alias(e){if(e===void 0)return this._aliases[0];let r=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(r=this.commands[this.commands.length-1]),e===r._name)throw new Error("Command alias can't be the same as its name");let n=this.parent?._findCommand(e);if(n){let i=[n.name()].concat(n.aliases()).join("|");throw new Error(`cannot add alias '${e}' to command '${this.name()}' as already have command '${i}'`)}return r._aliases.push(e),this}aliases(e){return e===void 0?this._aliases:(e.forEach(r=>this.alias(r)),this)}usage(e){if(e===void 0){if(this._usage)return this._usage;let r=this.registeredArguments.map(n=>dB(n));return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?r:[]).join(" ")}return this._usage=e,this}name(e){return e===void 0?this._name:(this._name=e,this)}nameFromFilename(e){return this._name=gn.basename(e,gn.extname(e)),this}executableDir(e){return e===void 0?this._executableDir:(this._executableDir=e,this)}helpInformation(e){let r=this.createHelp();return r.helpWidth===void 0&&(r.helpWidth=e&&e.error?this._outputConfiguration.getErrHelpWidth():this._outputConfiguration.getOutHelpWidth()),r.formatHelp(this,r)}_getHelpContext(e){e=e||{};let r={error:!!e.error},n;return r.error?n=i=>this._outputConfiguration.writeErr(i):n=i=>this._outputConfiguration.writeOut(i),r.write=e.write||n,r.command=this,r}outputHelp(e){let r;typeof e=="function"&&(r=e,e=void 0);let n=this._getHelpContext(e);this._getCommandAndAncestors().reverse().forEach(o=>o.emit("beforeAllHelp",n)),this.emit("beforeHelp",n);let i=this.helpInformation(n);if(r&&(i=r(i),typeof i!="string"&&!Buffer.isBuffer(i)))throw new Error("outputHelp callback must return a string or a Buffer");n.write(i),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit("afterHelp",n),this._getCommandAndAncestors().forEach(o=>o.emit("afterAllHelp",n))}helpOption(e,r){return typeof e=="boolean"?(e?this._helpOption=this._helpOption??void 0:this._helpOption=null,this):(e=e??"-h, --help",r=r??"display help for command",this._helpOption=this.createOption(e,r),this)}_getHelpOption(){return this._helpOption===void 0&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(e){return this._helpOption=e,this}help(e){this.outputHelp(e);let r=Ke.exitCode||0;r===0&&e&&typeof e!="function"&&e.error&&(r=1),this._exit(r,"commander.help","(outputHelp)")}addHelpText(e,r){let n=["beforeAll","before","after","afterAll"];if(!n.includes(e))throw new Error(`Unexpected value for position to addHelpText.
22
22
  Expecting one of '${n.join("', '")}'`);let i=`${e}Help`;return this.on(i,o=>{let s;typeof r=="function"?s=r({error:o.error,command:o.command}):s=r,s&&o.write(`${s}
23
- `)}),this}_outputHelpIfRequested(e){let r=this._getHelpOption();r&&e.find(i=>r.is(i))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function dw(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})}hw.Command=Rp});var Dw=y(hr=>{var{Argument:mw}=il(),{Command:$p}=pw(),{CommanderError:mB,InvalidArgumentError:gw}=ja(),{Help:gB}=Sp(),{Option:yw}=Ap();hr.program=new $p;hr.createCommand=t=>new $p(t);hr.createOption=(t,e)=>new yw(t,e);hr.createArgument=(t,e)=>new mw(t,e);hr.Command=$p;hr.Option=yw;hr.Argument=mw;hr.Help=gB;hr.CommanderError=mB;hr.InvalidArgumentError=gw;hr.InvalidOptionArgumentError=gw});var ke=y((pce,bw)=>{"use strict";var Ip="\x1B",Me=`${Ip}[`,DB="\x07",jp={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:`${Ip}7`,restore:`${Ip}8`},vB={up:(t=1)=>`${Me}S`.repeat(t),down:(t=1)=>`${Me}T`.repeat(t)},bB={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?jp.up():"");return t&&(e+=jp.left),e}};bw.exports={cursor:jp,scroll:vB,erase:bB,beep:DB}});var Ew=y((mce,Np)=>{var wB=require("tty"),_B=!("NO_COLOR"in process.env||process.argv.includes("--no-color"))&&("FORCE_COLOR"in process.env||process.argv.includes("--color")||process.platform==="win32"||wB.isatty(1)&&process.env.TERM!=="dumb"||"CI"in process.env),$e=(t,e,r=t)=>n=>{let i=""+n,o=i.indexOf(e,t.length);return~o?t+ww(i,e,r,o)+e:t+i+e},ww=(t,e,r,n)=>{let i=t.substring(0,n)+r,o=t.substring(n+e.length),s=o.indexOf(e);return~s?i+ww(o,e,r,s):i+o},_w=(t=_B)=>({isColorSupported:t,reset:t?e=>`\x1B[0m${e}\x1B[0m`:String,bold:t?$e("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"):String,dim:t?$e("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"):String,italic:t?$e("\x1B[3m","\x1B[23m"):String,underline:t?$e("\x1B[4m","\x1B[24m"):String,inverse:t?$e("\x1B[7m","\x1B[27m"):String,hidden:t?$e("\x1B[8m","\x1B[28m"):String,strikethrough:t?$e("\x1B[9m","\x1B[29m"):String,black:t?$e("\x1B[30m","\x1B[39m"):String,red:t?$e("\x1B[31m","\x1B[39m"):String,green:t?$e("\x1B[32m","\x1B[39m"):String,yellow:t?$e("\x1B[33m","\x1B[39m"):String,blue:t?$e("\x1B[34m","\x1B[39m"):String,magenta:t?$e("\x1B[35m","\x1B[39m"):String,cyan:t?$e("\x1B[36m","\x1B[39m"):String,white:t?$e("\x1B[37m","\x1B[39m"):String,gray:t?$e("\x1B[90m","\x1B[39m"):String,bgBlack:t?$e("\x1B[40m","\x1B[49m"):String,bgRed:t?$e("\x1B[41m","\x1B[49m"):String,bgGreen:t?$e("\x1B[42m","\x1B[49m"):String,bgYellow:t?$e("\x1B[43m","\x1B[49m"):String,bgBlue:t?$e("\x1B[44m","\x1B[49m"):String,bgMagenta:t?$e("\x1B[45m","\x1B[49m"):String,bgCyan:t?$e("\x1B[46m","\x1B[49m"):String,bgWhite:t?$e("\x1B[47m","\x1B[49m"):String});Np.exports=_w();Np.exports.createColors=_w});var Bw=y((yce,Hp)=>{var LB=require("tty"),BB=!("NO_COLOR"in process.env||process.argv.includes("--no-color"))&&("FORCE_COLOR"in process.env||process.argv.includes("--color")||process.platform==="win32"||LB.isatty(1)&&process.env.TERM!=="dumb"||"CI"in process.env),je=(t,e,r=t)=>n=>{let i=""+n,o=i.indexOf(e,t.length);return~o?t+Nw(i,e,r,o)+e:t+i+e},Nw=(t,e,r,n)=>{let i=t.substring(0,n)+r,o=t.substring(n+e.length),s=o.indexOf(e);return~s?i+Nw(o,e,r,s):i+o},Lw=(t=BB)=>({isColorSupported:t,reset:t?e=>`\x1B[0m${e}\x1B[0m`:String,bold:t?je("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"):String,dim:t?je("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"):String,italic:t?je("\x1B[3m","\x1B[23m"):String,underline:t?je("\x1B[4m","\x1B[24m"):String,inverse:t?je("\x1B[7m","\x1B[27m"):String,hidden:t?je("\x1B[8m","\x1B[28m"):String,strikethrough:t?je("\x1B[9m","\x1B[29m"):String,black:t?je("\x1B[30m","\x1B[39m"):String,red:t?je("\x1B[31m","\x1B[39m"):String,green:t?je("\x1B[32m","\x1B[39m"):String,yellow:t?je("\x1B[33m","\x1B[39m"):String,blue:t?je("\x1B[34m","\x1B[39m"):String,magenta:t?je("\x1B[35m","\x1B[39m"):String,cyan:t?je("\x1B[36m","\x1B[39m"):String,white:t?je("\x1B[37m","\x1B[39m"):String,gray:t?je("\x1B[90m","\x1B[39m"):String,bgBlack:t?je("\x1B[40m","\x1B[49m"):String,bgRed:t?je("\x1B[41m","\x1B[49m"):String,bgGreen:t?je("\x1B[42m","\x1B[49m"):String,bgYellow:t?je("\x1B[43m","\x1B[49m"):String,bgBlue:t?je("\x1B[44m","\x1B[49m"):String,bgMagenta:t?je("\x1B[45m","\x1B[49m"):String,bgCyan:t?je("\x1B[46m","\x1B[49m"):String,bgWhite:t?je("\x1B[47m","\x1B[49m"):String});Hp.exports=Lw();Hp.exports.createColors=Lw});var dl=y(Mt=>{"use strict";Object.defineProperty(Mt,"__esModule",{value:!0});Mt.isNXMonorepo=Mt.isMonorepo=Mt.findPackageRelativePathInMonorepo=Mt.findPackagePath=Mt.findNXMonorepoRoot=Mt.findMonorepoRoot=void 0;var Ba=require("node:fs"),Wn=require("node:path");function fl(t){let e=(0,Wn.join)(t,"package.json"),r=(0,Wn.join)(t,"pnpm-workspace.yaml");if((0,Ba.existsSync)(r)||(0,Ba.existsSync)(e)&&JSON.parse((0,Ba.readFileSync)(e,"utf-8")).workspaces)return t;let n=(0,Wn.dirname)(t);if(n===t)throw new Error("Monorepo root not found");return fl(n)}Mt.findMonorepoRoot=fl;function Jp(t){let e=(0,Wn.join)(t,"nx.json");if((0,Ba.existsSync)(e))return t;let r=(0,Wn.dirname)(t);if(r===t)throw new Error("Monorepo root not found");return Jp(r)}Mt.findNXMonorepoRoot=Jp;function Xp(t,e,r){let n=(0,Wn.join)(e,"node_modules",t);if((0,Ba.existsSync)(n))return n;if(e===r)return null;let i=(0,Wn.dirname)(e);return Xp(t,i,r)}Mt.findPackagePath=Xp;function WB(t,e){let r=fl(e),n=Xp(t,e,r);return n?(0,Wn.relative)(e,n):null}Mt.findPackageRelativePathInMonorepo=WB;function KB(t){try{return fl(t),!0}catch{return!1}}Mt.isMonorepo=KB;function YB(t){try{return Jp(t),!0}catch{return!1}}Mt.isNXMonorepo=YB});var xi={};mn(xi,{default:()=>JB});var JB,Fi=ct(()=>{JB={}});var zw=y(jr=>{"use strict";var XB=jr&&jr.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),ZB=jr&&jr.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),QB=jr&&jr.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&XB(e,t,r);return ZB(e,t),e};Object.defineProperty(jr,"__esModule",{value:!0});jr.resolveFetch=void 0;var eq=t=>{let e;return t?e=t:typeof fetch>"u"?e=(...r)=>Promise.resolve().then(()=>QB((Fi(),Ae(xi)))).then(({default:n})=>n(...r)):e=fetch,(...r)=>e(...r)};jr.resolveFetch=eq});var tm=y(nr=>{"use strict";Object.defineProperty(nr,"__esModule",{value:!0});nr.FunctionRegion=nr.FunctionsHttpError=nr.FunctionsRelayError=nr.FunctionsFetchError=nr.FunctionsError=void 0;var qo=class extends Error{constructor(e,r="FunctionsError",n){super(e),this.name=r,this.context=n}};nr.FunctionsError=qo;var Zp=class extends qo{constructor(e){super("Failed to send a request to the Edge Function","FunctionsFetchError",e)}};nr.FunctionsFetchError=Zp;var Qp=class extends qo{constructor(e){super("Relay Error invoking the Edge Function","FunctionsRelayError",e)}};nr.FunctionsRelayError=Qp;var em=class extends qo{constructor(e){super("Edge Function returned a non-2xx status code","FunctionsHttpError",e)}};nr.FunctionsHttpError=em;var tq;(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"})(tq=nr.FunctionRegion||(nr.FunctionRegion={}))});var Gw=y(Mo=>{"use strict";var rq=Mo&&Mo.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(l){try{c(n.next(l))}catch(f){s(f)}}function u(l){try{c(n.throw(l))}catch(f){s(f)}}function c(l){l.done?o(l.value):i(l.value).then(a,u)}c((n=n.apply(t,e||[])).next())})};Object.defineProperty(Mo,"__esModule",{value:!0});Mo.FunctionsClient=void 0;var nq=zw(),pl=tm(),rm=class{constructor(e,{headers:r={},customFetch:n,region:i=pl.FunctionRegion.Any}={}){this.url=e,this.headers=r,this.region=i,this.fetch=(0,nq.resolveFetch)(n)}setAuth(e){this.headers.Authorization=`Bearer ${e}`}invoke(e,r={}){var n;return rq(this,void 0,void 0,function*(){try{let{headers:i,method:o,body:s}=r,a={},{region:u}=r;u||(u=this.region),u&&u!=="any"&&(a["x-region"]=u);let c;s&&(i&&!Object.prototype.hasOwnProperty.call(i,"Content-Type")||!i)&&(typeof Blob<"u"&&s instanceof Blob||s instanceof ArrayBuffer?(a["Content-Type"]="application/octet-stream",c=s):typeof s=="string"?(a["Content-Type"]="text/plain",c=s):typeof FormData<"u"&&s instanceof FormData?c=s:(a["Content-Type"]="application/json",c=JSON.stringify(s)));let l=yield this.fetch(`${this.url}/${e}`,{method:o||"POST",headers:Object.assign(Object.assign(Object.assign({},a),this.headers),i),body:c}).catch(m=>{throw new pl.FunctionsFetchError(m)}),f=l.headers.get("x-relay-error");if(f&&f==="true")throw new pl.FunctionsRelayError(l);if(!l.ok)throw new pl.FunctionsHttpError(l);let h=((n=l.headers.get("Content-Type"))!==null&&n!==void 0?n:"text/plain").split(";")[0].trim(),d;return h==="application/json"?d=yield l.json():h==="application/octet-stream"?d=yield l.blob():h==="text/event-stream"?d=l:h==="multipart/form-data"?d=yield l.formData():d=yield l.text(),{data:d,error:null}}catch(i){return{data:null,error:i}}})}};Mo.FunctionsClient=rm});var nm=y(Ut=>{"use strict";Object.defineProperty(Ut,"__esModule",{value:!0});Ut.FunctionRegion=Ut.FunctionsRelayError=Ut.FunctionsHttpError=Ut.FunctionsFetchError=Ut.FunctionsError=Ut.FunctionsClient=void 0;var iq=Gw();Object.defineProperty(Ut,"FunctionsClient",{enumerable:!0,get:function(){return iq.FunctionsClient}});var Ma=tm();Object.defineProperty(Ut,"FunctionsError",{enumerable:!0,get:function(){return Ma.FunctionsError}});Object.defineProperty(Ut,"FunctionsFetchError",{enumerable:!0,get:function(){return Ma.FunctionsFetchError}});Object.defineProperty(Ut,"FunctionsHttpError",{enumerable:!0,get:function(){return Ma.FunctionsHttpError}});Object.defineProperty(Ut,"FunctionsRelayError",{enumerable:!0,get:function(){return Ma.FunctionsRelayError}});Object.defineProperty(Ut,"FunctionRegion",{enumerable:!0,get:function(){return Ma.FunctionRegion}})});var sm=y(om=>{"use strict";Object.defineProperty(om,"__esModule",{value:!0});var im=class extends Error{constructor(e){super(e.message),this.name="PostgrestError",this.details=e.details,this.hint=e.hint,this.code=e.code}};om.default=im});var um=y(Ua=>{"use strict";var Ww=Ua&&Ua.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ua,"__esModule",{value:!0});var oq=Ww((Fi(),Ae(xi))),sq=Ww(sm()),am=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=oq.default:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(e,r){return this.headers=Object.assign({},this.headers),this.headers[e]=r,this}then(e,r){this.schema===void 0||(["GET","HEAD"].includes(this.method)?this.headers["Accept-Profile"]=this.schema:this.headers["Content-Profile"]=this.schema),this.method!=="GET"&&this.method!=="HEAD"&&(this.headers["Content-Type"]="application/json");let n=this.fetch,i=n(this.url.toString(),{method:this.method,headers:this.headers,body:JSON.stringify(this.body),signal:this.signal}).then(async o=>{var s,a,u;let c=null,l=null,f=null,h=o.status,d=o.statusText;if(o.ok){if(this.method!=="HEAD"){let w=await o.text();w===""||(this.headers.Accept==="text/csv"||this.headers.Accept&&this.headers.Accept.includes("application/vnd.pgrst.plan+text")?l=w:l=JSON.parse(w))}let b=(s=this.headers.Prefer)===null||s===void 0?void 0:s.match(/count=(exact|planned|estimated)/),g=(a=o.headers.get("content-range"))===null||a===void 0?void 0:a.split("/");b&&g&&g.length>1&&(f=parseInt(g[1])),this.isMaybeSingle&&this.method==="GET"&&Array.isArray(l)&&(l.length>1?(c={code:"PGRST116",details:`Results contain ${l.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},l=null,f=null,h=406,d="Not Acceptable"):l.length===1?l=l[0]:l=null)}else{let b=await o.text();try{c=JSON.parse(b),Array.isArray(c)&&o.status===404&&(l=[],c=null,h=200,d="OK")}catch{o.status===404&&b===""?(h=204,d="No Content"):c={message:b}}if(c&&this.isMaybeSingle&&(!((u=c?.details)===null||u===void 0)&&u.includes("0 rows"))&&(c=null,h=200,d="OK"),c&&this.shouldThrowOnError)throw new sq.default(c)}return{error:c,data:l,count:f,status:h,statusText:d}});return this.shouldThrowOnError||(i=i.catch(o=>{var s,a,u;return{error:{message:`${(s=o?.name)!==null&&s!==void 0?s:"FetchError"}: ${o?.message}`,details:`${(a=o?.stack)!==null&&a!==void 0?a:""}`,hint:"",code:`${(u=o?.code)!==null&&u!==void 0?u:""}`},data:null,count:null,status:0,statusText:""}})),i.then(e,r)}};Ua.default=am});var lm=y(Va=>{"use strict";var aq=Va&&Va.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Va,"__esModule",{value:!0});var uq=aq(um()),cm=class extends uq.default{select(e){let r=!1,n=(e??"*").split("").map(i=>/\s/.test(i)&&!r?"":(i==='"'&&(r=!r),i)).join("");return this.url.searchParams.set("select",n),this.headers.Prefer&&(this.headers.Prefer+=","),this.headers.Prefer+="return=representation",this}order(e,{ascending:r=!0,nullsFirst:n,foreignTable:i,referencedTable:o=i}={}){let s=o?`${o}.order`:"order",a=this.url.searchParams.get(s);return this.url.searchParams.set(s,`${a?`${a},`:""}${e}.${r?"asc":"desc"}${n===void 0?"":n?".nullsfirst":".nullslast"}`),this}limit(e,{foreignTable:r,referencedTable:n=r}={}){let i=typeof n>"u"?"limit":`${n}.limit`;return this.url.searchParams.set(i,`${e}`),this}range(e,r,{foreignTable:n,referencedTable:i=n}={}){let o=typeof i>"u"?"offset":`${i}.offset`,s=typeof i>"u"?"limit":`${i}.limit`;return this.url.searchParams.set(o,`${e}`),this.url.searchParams.set(s,`${r-e+1}`),this}abortSignal(e){return this.signal=e,this}single(){return this.headers.Accept="application/vnd.pgrst.object+json",this}maybeSingle(){return this.method==="GET"?this.headers.Accept="application/json":this.headers.Accept="application/vnd.pgrst.object+json",this.isMaybeSingle=!0,this}csv(){return this.headers.Accept="text/csv",this}geojson(){return this.headers.Accept="application/geo+json",this}explain({analyze:e=!1,verbose:r=!1,settings:n=!1,buffers:i=!1,wal:o=!1,format:s="text"}={}){var a;let u=[e?"analyze":null,r?"verbose":null,n?"settings":null,i?"buffers":null,o?"wal":null].filter(Boolean).join("|"),c=(a=this.headers.Accept)!==null&&a!==void 0?a:"application/json";return this.headers.Accept=`application/vnd.pgrst.plan+${s}; for="${c}"; options=${u};`,s==="json"?this:this}rollback(){var e;return((e=this.headers.Prefer)!==null&&e!==void 0?e:"").trim().length>0?this.headers.Prefer+=",tx=rollback":this.headers.Prefer="tx=rollback",this}returns(){return this}};Va.default=cm});var ml=y(Ha=>{"use strict";var cq=Ha&&Ha.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ha,"__esModule",{value:!0});var lq=cq(lm()),fm=class extends lq.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}};Ha.default=fm});var hm=y(Ga=>{"use strict";var fq=Ga&&Ga.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ga,"__esModule",{value:!0});var za=fq(ml()),dm=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 za.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 za.default({method:i,url:this.url,headers:this.headers,schema:this.schema,body:e,fetch:this.fetch,allowEmpty:!1})}upsert(e,{onConflict:r,ignoreDuplicates:n=!1,count:i,defaultToNull:o=!0}={}){let s="POST",a=[`resolution=${n?"ignore":"merge"}-duplicates`];if(r!==void 0&&this.url.searchParams.set("on_conflict",r),this.headers.Prefer&&a.push(this.headers.Prefer),i&&a.push(`count=${i}`),o||a.push("missing=default"),this.headers.Prefer=a.join(","),Array.isArray(e)){let u=e.reduce((c,l)=>c.concat(Object.keys(l)),[]);if(u.length>0){let c=[...new Set(u)].map(l=>`"${l}"`);this.url.searchParams.set("columns",c.join(","))}}return new za.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 za.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 za.default({method:r,url:this.url,headers:this.headers,schema:this.schema,fetch:this.fetch,allowEmpty:!1})}};Ga.default=dm});var Kw=y(gl=>{"use strict";Object.defineProperty(gl,"__esModule",{value:!0});gl.version=void 0;gl.version="0.0.0-automated"});var Yw=y(yl=>{"use strict";Object.defineProperty(yl,"__esModule",{value:!0});yl.DEFAULT_HEADERS=void 0;var dq=Kw();yl.DEFAULT_HEADERS={"X-Client-Info":`postgrest-js/${dq.version}`}});var Xw=y(Wa=>{"use strict";var Jw=Wa&&Wa.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Wa,"__esModule",{value:!0});var hq=Jw(hm()),pq=Jw(ml()),mq=Yw(),pm=class t{constructor(e,{headers:r={},schema:n,fetch:i}={}){this.url=e,this.headers=Object.assign(Object.assign({},mq.DEFAULT_HEADERS),r),this.schemaName=n,this.fetch=i}from(e){let r=new URL(`${this.url}/${e}`);return new hq.default(r,{headers:Object.assign({},this.headers),schema:this.schemaName,fetch:this.fetch})}schema(e){return new t(this.url,{headers:this.headers,schema:e,fetch:this.fetch})}rpc(e,r={},{head:n=!1,get:i=!1,count:o}={}){let s,a=new URL(`${this.url}/rpc/${e}`),u;n||i?(s=n?"HEAD":"GET",Object.entries(r).filter(([l,f])=>f!==void 0).map(([l,f])=>[l,Array.isArray(f)?`{${f.join(",")}}`:`${f}`]).forEach(([l,f])=>{a.searchParams.append(l,f)})):(s="POST",u=r);let c=Object.assign({},this.headers);return o&&(c.Prefer=`count=${o}`),new pq.default({method:s,url:a,headers:c,schema:this.schemaName,body:u,fetch:this.fetch,allowEmpty:!1})}};Wa.default=pm});var i_=y(vt=>{"use strict";var Uo=vt&&vt.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(vt,"__esModule",{value:!0});vt.PostgrestError=vt.PostgrestBuilder=vt.PostgrestTransformBuilder=vt.PostgrestFilterBuilder=vt.PostgrestQueryBuilder=vt.PostgrestClient=void 0;var Zw=Uo(Xw());vt.PostgrestClient=Zw.default;var Qw=Uo(hm());vt.PostgrestQueryBuilder=Qw.default;var e_=Uo(ml());vt.PostgrestFilterBuilder=e_.default;var t_=Uo(lm());vt.PostgrestTransformBuilder=t_.default;var r_=Uo(um());vt.PostgrestBuilder=r_.default;var n_=Uo(sm());vt.PostgrestError=n_.default;vt.default={PostgrestClient:Zw.default,PostgrestQueryBuilder:Qw.default,PostgrestFilterBuilder:e_.default,PostgrestTransformBuilder:t_.default,PostgrestBuilder:r_.default,PostgrestError:n_.default}});var gm={};mn(gm,{RealtimeClient:()=>mm});var mm,ym=ct(()=>{mm=class{constructor(){}connect(){}disconnect(){}}});var Ya=y(Nr=>{"use strict";Object.defineProperty(Nr,"__esModule",{value:!0});Nr.StorageUnknownError=Nr.StorageApiError=Nr.isStorageError=Nr.StorageError=void 0;var Ka=class extends Error{constructor(e){super(e),this.__isStorageError=!0,this.name="StorageError"}};Nr.StorageError=Ka;function gq(t){return typeof t=="object"&&t!==null&&"__isStorageError"in t}Nr.isStorageError=gq;var Dm=class extends Ka{constructor(e,r){super(e),this.name="StorageApiError",this.status=r}toJSON(){return{name:this.name,message:this.message,status:this.status}}};Nr.StorageApiError=Dm;var vm=class extends Ka{constructor(e,r){super(e),this.name="StorageUnknownError",this.originalError=r}};Nr.StorageUnknownError=vm});var Dl=y(lt=>{"use strict";var yq=lt&&lt.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),Dq=lt&&lt.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o_=lt&&lt.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&yq(e,t,r);return Dq(e,t),e},vq=lt&&lt.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(l){try{c(n.next(l))}catch(f){s(f)}}function u(l){try{c(n.throw(l))}catch(f){s(f)}}function c(l){l.done?o(l.value):i(l.value).then(a,u)}c((n=n.apply(t,e||[])).next())})};Object.defineProperty(lt,"__esModule",{value:!0});lt.recursiveToCamel=lt.resolveResponse=lt.resolveFetch=void 0;var bq=t=>{let e;return t?e=t:typeof fetch>"u"?e=(...r)=>Promise.resolve().then(()=>o_((Fi(),Ae(xi)))).then(({default:n})=>n(...r)):e=fetch,(...r)=>e(...r)};lt.resolveFetch=bq;var wq=()=>vq(void 0,void 0,void 0,function*(){return typeof Response>"u"?(yield Promise.resolve().then(()=>o_((Fi(),Ae(xi))))).Response:Response});lt.resolveResponse=wq;var _q=t=>{if(Array.isArray(t))return t.map(r=>(0,lt.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,lt.recursiveToCamel)(n)}),e};lt.recursiveToCamel=_q});var _m=y(Vt=>{"use strict";var Oi=Vt&&Vt.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(l){try{c(n.next(l))}catch(f){s(f)}}function u(l){try{c(n.throw(l))}catch(f){s(f)}}function c(l){l.done?o(l.value):i(l.value).then(a,u)}c((n=n.apply(t,e||[])).next())})};Object.defineProperty(Vt,"__esModule",{value:!0});Vt.remove=Vt.head=Vt.put=Vt.post=Vt.get=void 0;var bm=Ya(),Eq=Dl(),wm=t=>t.msg||t.message||t.error_description||t.error||JSON.stringify(t),Cq=(t,e,r)=>Oi(void 0,void 0,void 0,function*(){let n=yield(0,Eq.resolveResponse)();t instanceof n&&!r?.noResolveJson?t.json().then(i=>{e(new bm.StorageApiError(wm(i),t.status||500))}).catch(i=>{e(new bm.StorageUnknownError(wm(i),i))}):e(new bm.StorageUnknownError(wm(t),t))}),Sq=(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 Ja(t,e,r,n,i,o){return Oi(this,void 0,void 0,function*(){return new Promise((s,a)=>{t(r,Sq(e,n,i,o)).then(u=>{if(!u.ok)throw u;return n?.noResolveJson?u:u.json()}).then(u=>s(u)).catch(u=>Cq(u,a,n))})})}function xq(t,e,r,n){return Oi(this,void 0,void 0,function*(){return Ja(t,"GET",e,r,n)})}Vt.get=xq;function Fq(t,e,r,n,i){return Oi(this,void 0,void 0,function*(){return Ja(t,"POST",e,n,i,r)})}Vt.post=Fq;function Oq(t,e,r,n,i){return Oi(this,void 0,void 0,function*(){return Ja(t,"PUT",e,n,i,r)})}Vt.put=Oq;function Aq(t,e,r,n){return Oi(this,void 0,void 0,function*(){return Ja(t,"HEAD",e,Object.assign(Object.assign({},r),{noResolveJson:!0}),n)})}Vt.head=Aq;function kq(t,e,r,n,i){return Oi(this,void 0,void 0,function*(){return Ja(t,"DELETE",e,n,i,r)})}Vt.remove=kq});var u_=y(Xa=>{"use strict";var Ht=Xa&&Xa.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(l){try{c(n.next(l))}catch(f){s(f)}}function u(l){try{c(n.throw(l))}catch(f){s(f)}}function c(l){l.done?o(l.value):i(l.value).then(a,u)}c((n=n.apply(t,e||[])).next())})};Object.defineProperty(Xa,"__esModule",{value:!0});var zt=Ya(),Lr=_m(),s_=Dl(),Tq={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},a_={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1},Em=class{constructor(e,r={},n,i){this.url=e,this.headers=r,this.bucketId=n,this.fetch=(0,s_.resolveFetch)(i)}uploadOrUpdate(e,r,n,i){return Ht(this,void 0,void 0,function*(){try{let o,s=Object.assign(Object.assign({},a_),i),a=Object.assign(Object.assign({},this.headers),e==="POST"&&{"x-upsert":String(s.upsert)}),u=s.metadata;typeof Blob<"u"&&n instanceof Blob?(o=new FormData,o.append("cacheControl",s.cacheControl),u&&o.append("metadata",this.encodeMetadata(u)),o.append("",n)):typeof FormData<"u"&&n instanceof FormData?(o=n,o.append("cacheControl",s.cacheControl),u&&o.append("metadata",this.encodeMetadata(u))):(o=n,a["cache-control"]=`max-age=${s.cacheControl}`,a["content-type"]=s.contentType,u&&(a["x-metadata"]=this.toBase64(this.encodeMetadata(u)))),i?.headers&&(a=Object.assign(Object.assign({},a),i.headers));let c=this._removeEmptyFolders(r),l=this._getFinalPath(c),f=yield this.fetch(`${this.url}/object/${l}`,Object.assign({method:e,body:o,headers:a},s?.duplex?{duplex:s.duplex}:{})),h=yield f.json();return f.ok?{data:{path:c,id:h.Id,fullPath:h.Key},error:null}:{data:null,error:h}}catch(o){if((0,zt.isStorageError)(o))return{data:null,error:o};throw o}})}upload(e,r,n){return Ht(this,void 0,void 0,function*(){return this.uploadOrUpdate("POST",e,r,n)})}uploadToSignedUrl(e,r,n,i){return Ht(this,void 0,void 0,function*(){let o=this._removeEmptyFolders(e),s=this._getFinalPath(o),a=new URL(this.url+`/object/upload/sign/${s}`);a.searchParams.set("token",r);try{let u,c=Object.assign({upsert:a_.upsert},i),l=Object.assign(Object.assign({},this.headers),{"x-upsert":String(c.upsert)});typeof Blob<"u"&&n instanceof Blob?(u=new FormData,u.append("cacheControl",c.cacheControl),u.append("",n)):typeof FormData<"u"&&n instanceof FormData?(u=n,u.append("cacheControl",c.cacheControl)):(u=n,l["cache-control"]=`max-age=${c.cacheControl}`,l["content-type"]=c.contentType);let f=yield this.fetch(a.toString(),{method:"PUT",body:u,headers:l}),h=yield f.json();return f.ok?{data:{path:o,fullPath:h.Key},error:null}:{data:null,error:h}}catch(u){if((0,zt.isStorageError)(u))return{data:null,error:u};throw u}})}createSignedUploadUrl(e,r){return Ht(this,void 0,void 0,function*(){try{let n=this._getFinalPath(e),i=Object.assign({},this.headers);r?.upsert&&(i["x-upsert"]="true");let o=yield(0,Lr.post)(this.fetch,`${this.url}/object/upload/sign/${n}`,{},{headers:i}),s=new URL(this.url+o.url),a=s.searchParams.get("token");if(!a)throw new zt.StorageError("No token returned by API");return{data:{signedUrl:s.toString(),path:e,token:a},error:null}}catch(n){if((0,zt.isStorageError)(n))return{data:null,error:n};throw n}})}update(e,r,n){return Ht(this,void 0,void 0,function*(){return this.uploadOrUpdate("PUT",e,r,n)})}move(e,r,n){return Ht(this,void 0,void 0,function*(){try{return{data:yield(0,Lr.post)(this.fetch,`${this.url}/object/move`,{bucketId:this.bucketId,sourceKey:e,destinationKey:r,destinationBucket:n?.destinationBucket},{headers:this.headers}),error:null}}catch(i){if((0,zt.isStorageError)(i))return{data:null,error:i};throw i}})}copy(e,r,n){return Ht(this,void 0,void 0,function*(){try{return{data:{path:(yield(0,Lr.post)(this.fetch,`${this.url}/object/copy`,{bucketId:this.bucketId,sourceKey:e,destinationKey:r,destinationBucket:n?.destinationBucket},{headers:this.headers})).Key},error:null}}catch(i){if((0,zt.isStorageError)(i))return{data:null,error:i};throw i}})}createSignedUrl(e,r,n){return Ht(this,void 0,void 0,function*(){try{let i=this._getFinalPath(e),o=yield(0,Lr.post)(this.fetch,`${this.url}/object/sign/${i}`,Object.assign({expiresIn:r},n?.transform?{transform:n.transform}:{}),{headers:this.headers}),s=n?.download?`&download=${n.download===!0?"":n.download}`:"";return o={signedUrl:encodeURI(`${this.url}${o.signedURL}${s}`)},{data:o,error:null}}catch(i){if((0,zt.isStorageError)(i))return{data:null,error:i};throw i}})}createSignedUrls(e,r,n){return Ht(this,void 0,void 0,function*(){try{let i=yield(0,Lr.post)(this.fetch,`${this.url}/object/sign/${this.bucketId}`,{expiresIn:r,paths:e},{headers:this.headers}),o=n?.download?`&download=${n.download===!0?"":n.download}`:"";return{data:i.map(s=>Object.assign(Object.assign({},s),{signedUrl:s.signedURL?encodeURI(`${this.url}${s.signedURL}${o}`):null})),error:null}}catch(i){if((0,zt.isStorageError)(i))return{data:null,error:i};throw i}})}download(e,r){return Ht(this,void 0,void 0,function*(){let i=typeof r?.transform<"u"?"render/image/authenticated":"object",o=this.transformOptsToQueryString(r?.transform||{}),s=o?`?${o}`:"";try{let a=this._getFinalPath(e);return{data:yield(yield(0,Lr.get)(this.fetch,`${this.url}/${i}/${a}${s}`,{headers:this.headers,noResolveJson:!0})).blob(),error:null}}catch(a){if((0,zt.isStorageError)(a))return{data:null,error:a};throw a}})}info(e){return Ht(this,void 0,void 0,function*(){let r=this._getFinalPath(e);try{let n=yield(0,Lr.get)(this.fetch,`${this.url}/object/info/${r}`,{headers:this.headers});return{data:(0,s_.recursiveToCamel)(n),error:null}}catch(n){if((0,zt.isStorageError)(n))return{data:null,error:n};throw n}})}exists(e){return Ht(this,void 0,void 0,function*(){let r=this._getFinalPath(e);try{return yield(0,Lr.head)(this.fetch,`${this.url}/object/${r}`,{headers:this.headers}),{data:!0,error:null}}catch(n){if((0,zt.isStorageError)(n)&&n instanceof zt.StorageUnknownError){let i=n.originalError;if([400,404].includes(i?.status))return{data:!1,error:n}}throw n}})}getPublicUrl(e,r){let n=this._getFinalPath(e),i=[],o=r?.download?`download=${r.download===!0?"":r.download}`:"";o!==""&&i.push(o);let a=typeof r?.transform<"u"?"render/image":"object",u=this.transformOptsToQueryString(r?.transform||{});u!==""&&i.push(u);let c=i.join("&");return c!==""&&(c=`?${c}`),{data:{publicUrl:encodeURI(`${this.url}/${a}/public/${n}${c}`)}}}remove(e){return Ht(this,void 0,void 0,function*(){try{return{data:yield(0,Lr.remove)(this.fetch,`${this.url}/object/${this.bucketId}`,{prefixes:e},{headers:this.headers}),error:null}}catch(r){if((0,zt.isStorageError)(r))return{data:null,error:r};throw r}})}list(e,r,n){return Ht(this,void 0,void 0,function*(){try{let i=Object.assign(Object.assign(Object.assign({},Tq),r),{prefix:e||""});return{data:yield(0,Lr.post)(this.fetch,`${this.url}/object/list/${this.bucketId}`,i,{headers:this.headers},n),error:null}}catch(i){if((0,zt.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("&")}};Xa.default=Em});var c_=y(vl=>{"use strict";Object.defineProperty(vl,"__esModule",{value:!0});vl.version=void 0;vl.version="2.7.1"});var l_=y(bl=>{"use strict";Object.defineProperty(bl,"__esModule",{value:!0});bl.DEFAULT_HEADERS=void 0;var Pq=c_();bl.DEFAULT_HEADERS={"X-Client-Info":`storage-js/${Pq.version}`}});var f_=y(Za=>{"use strict";var Vo=Za&&Za.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(l){try{c(n.next(l))}catch(f){s(f)}}function u(l){try{c(n.throw(l))}catch(f){s(f)}}function c(l){l.done?o(l.value):i(l.value).then(a,u)}c((n=n.apply(t,e||[])).next())})};Object.defineProperty(Za,"__esModule",{value:!0});var Rq=l_(),Ho=Ya(),zo=_m(),$q=Dl(),Cm=class{constructor(e,r={},n){this.url=e,this.headers=Object.assign(Object.assign({},Rq.DEFAULT_HEADERS),r),this.fetch=(0,$q.resolveFetch)(n)}listBuckets(){return Vo(this,void 0,void 0,function*(){try{return{data:yield(0,zo.get)(this.fetch,`${this.url}/bucket`,{headers:this.headers}),error:null}}catch(e){if((0,Ho.isStorageError)(e))return{data:null,error:e};throw e}})}getBucket(e){return Vo(this,void 0,void 0,function*(){try{return{data:yield(0,zo.get)(this.fetch,`${this.url}/bucket/${e}`,{headers:this.headers}),error:null}}catch(r){if((0,Ho.isStorageError)(r))return{data:null,error:r};throw r}})}createBucket(e,r={public:!1}){return Vo(this,void 0,void 0,function*(){try{return{data:yield(0,zo.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,Ho.isStorageError)(n))return{data:null,error:n};throw n}})}updateBucket(e,r){return Vo(this,void 0,void 0,function*(){try{return{data:yield(0,zo.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,Ho.isStorageError)(n))return{data:null,error:n};throw n}})}emptyBucket(e){return Vo(this,void 0,void 0,function*(){try{return{data:yield(0,zo.post)(this.fetch,`${this.url}/bucket/${e}/empty`,{},{headers:this.headers}),error:null}}catch(r){if((0,Ho.isStorageError)(r))return{data:null,error:r};throw r}})}deleteBucket(e){return Vo(this,void 0,void 0,function*(){try{return{data:yield(0,zo.remove)(this.fetch,`${this.url}/bucket/${e}`,{},{headers:this.headers}),error:null}}catch(r){if((0,Ho.isStorageError)(r))return{data:null,error:r};throw r}})}};Za.default=Cm});var h_=y(Go=>{"use strict";var d_=Go&&Go.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Go,"__esModule",{value:!0});Go.StorageClient=void 0;var Iq=d_(u_()),jq=d_(f_()),Sm=class extends jq.default{constructor(e,r={},n){super(e,r,n)}from(e){return new Iq.default(this.url,this.headers,e,this.fetch)}};Go.StorageClient=Sm});var m_=y(p_=>{"use strict";Object.defineProperty(p_,"__esModule",{value:!0})});var y_=y(Br=>{"use strict";var Nq=Br&&Br.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),g_=Br&&Br.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Nq(e,t,r)};Object.defineProperty(Br,"__esModule",{value:!0});Br.StorageClient=void 0;var Lq=h_();Object.defineProperty(Br,"StorageClient",{enumerable:!0,get:function(){return Lq.StorageClient}});g_(m_(),Br);g_(Ya(),Br)});var D_=y(wl=>{"use strict";Object.defineProperty(wl,"__esModule",{value:!0});wl.version=void 0;wl.version="2.46.0"});var v_=y(ir=>{"use strict";Object.defineProperty(ir,"__esModule",{value:!0});ir.DEFAULT_REALTIME_OPTIONS=ir.DEFAULT_AUTH_OPTIONS=ir.DEFAULT_DB_OPTIONS=ir.DEFAULT_GLOBAL_OPTIONS=ir.DEFAULT_HEADERS=void 0;var Bq=D_(),Qa="";typeof Deno<"u"?Qa="deno":typeof document<"u"?Qa="web":typeof navigator<"u"&&navigator.product==="ReactNative"?Qa="react-native":Qa="node";ir.DEFAULT_HEADERS={"X-Client-Info":`supabase-js-${Qa}/${Bq.version}`};ir.DEFAULT_GLOBAL_OPTIONS={headers:ir.DEFAULT_HEADERS};ir.DEFAULT_DB_OPTIONS={schema:"public"};ir.DEFAULT_AUTH_OPTIONS={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"};ir.DEFAULT_REALTIME_OPTIONS={}});var w_=y(ft=>{"use strict";var qq=ft&&ft.__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]}),Mq=ft&&ft.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Uq=ft&&ft.__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)&&qq(e,t,r);return Mq(e,t),e},Vq=ft&&ft.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(l){try{c(n.next(l))}catch(f){s(f)}}function u(l){try{c(n.throw(l))}catch(f){s(f)}}function c(l){l.done?o(l.value):i(l.value).then(a,u)}c((n=n.apply(t,e||[])).next())})};Object.defineProperty(ft,"__esModule",{value:!0});ft.fetchWithAuth=ft.resolveHeadersConstructor=ft.resolveFetch=void 0;var b_=Uq((Fi(),Ae(xi))),Hq=t=>{let e;return t?e=t:typeof fetch>"u"?e=b_.default:e=fetch,(...r)=>e(...r)};ft.resolveFetch=Hq;var zq=()=>typeof Headers>"u"?b_.Headers:Headers;ft.resolveHeadersConstructor=zq;var Gq=(t,e,r)=>{let n=(0,ft.resolveFetch)(r),i=(0,ft.resolveHeadersConstructor)();return(o,s)=>Vq(void 0,void 0,void 0,function*(){var a;let u=(a=yield e())!==null&&a!==void 0?a:t,c=new i(s?.headers);return c.has("apikey")||c.set("apikey",t),c.has("Authorization")||c.set("Authorization",`Bearer ${u}`),n(o,Object.assign(Object.assign({},s),{headers:c}))})};ft.fetchWithAuth=Gq});var __=y(mr=>{"use strict";var Wq=mr&&mr.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(l){try{c(n.next(l))}catch(f){s(f)}}function u(l){try{c(n.throw(l))}catch(f){s(f)}}function c(l){l.done?o(l.value):i(l.value).then(a,u)}c((n=n.apply(t,e||[])).next())})};Object.defineProperty(mr,"__esModule",{value:!0});mr.applySettingDefaults=mr.isBrowser=mr.stripTrailingSlash=mr.uuid=void 0;function Kq(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var e=Math.random()*16|0,r=t=="x"?e:e&3|8;return r.toString(16)})}mr.uuid=Kq;function Yq(t){return t.replace(/\/$/,"")}mr.stripTrailingSlash=Yq;var Jq=()=>typeof window<"u";mr.isBrowser=Jq;function Xq(t,e){let{db:r,auth:n,realtime:i,global:o}=t,{db:s,auth:a,realtime:u,global:c}=e,l={db:Object.assign(Object.assign({},s),r),auth:Object.assign(Object.assign({},a),n),realtime:Object.assign(Object.assign({},u),i),global:Object.assign(Object.assign({},c),o),accessToken:()=>Wq(this,void 0,void 0,function*(){return""})};return t.accessToken?l.accessToken=t.accessToken:delete l.accessToken,l}mr.applySettingDefaults=Xq});var xm=y(_l=>{"use strict";Object.defineProperty(_l,"__esModule",{value:!0});_l.version=void 0;_l.version="2.65.1"});var El=y(dt=>{"use strict";Object.defineProperty(dt,"__esModule",{value:!0});dt.API_VERSIONS=dt.API_VERSION_HEADER_NAME=dt.NETWORK_FAILURE=dt.EXPIRY_MARGIN=dt.DEFAULT_HEADERS=dt.AUDIENCE=dt.STORAGE_KEY=dt.GOTRUE_URL=void 0;var Zq=xm();dt.GOTRUE_URL="http://localhost:9999";dt.STORAGE_KEY="supabase.auth.token";dt.AUDIENCE="";dt.DEFAULT_HEADERS={"X-Client-Info":`gotrue-js/${Zq.version}`};dt.EXPIRY_MARGIN=10;dt.NETWORK_FAILURE={MAX_RETRIES:10,RETRY_INTERVAL:2};dt.API_VERSION_HEADER_NAME="X-Supabase-Api-Version";dt.API_VERSIONS={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}}});var Wo=y(te=>{"use strict";var Qq=te&&te.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),eM=te&&te.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),tM=te&&te.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&Qq(e,t,r);return eM(e,t),e};Object.defineProperty(te,"__esModule",{value:!0});te.parseResponseAPIVersion=te.getCodeChallengeAndMethod=te.generatePKCEChallenge=te.generatePKCEVerifier=te.retryable=te.sleep=te.decodeJWTPayload=te.Deferred=te.decodeBase64URL=te.removeItemAsync=te.getItemAsync=te.setItemAsync=te.looksLikeFetchResponse=te.resolveFetch=te.parseParametersFromURL=te.supportsLocalStorage=te.isBrowser=te.uuid=te.expiresAt=void 0;var rM=El();function nM(t){return Math.round(Date.now()/1e3)+t}te.expiresAt=nM;function iM(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){let e=Math.random()*16|0;return(t=="x"?e:e&3|8).toString(16)})}te.uuid=iM;var oM=()=>typeof document<"u";te.isBrowser=oM;var Ai={tested:!1,writable:!1},sM=()=>{if(!(0,te.isBrowser)())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(Ai.tested)return Ai.writable;let t=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(t,t),globalThis.localStorage.removeItem(t),Ai.tested=!0,Ai.writable=!0}catch{Ai.tested=!0,Ai.writable=!1}return Ai.writable};te.supportsLocalStorage=sM;function aM(t){let e={},r=new URL(t);if(r.hash&&r.hash[0]==="#")try{new URLSearchParams(r.hash.substring(1)).forEach((i,o)=>{e[o]=i})}catch{}return r.searchParams.forEach((n,i)=>{e[i]=n}),e}te.parseParametersFromURL=aM;var uM=t=>{let e;return t?e=t:typeof fetch>"u"?e=(...r)=>Promise.resolve().then(()=>tM((Fi(),Ae(xi)))).then(({default:n})=>n(...r)):e=fetch,(...r)=>e(...r)};te.resolveFetch=uM;var cM=t=>typeof t=="object"&&t!==null&&"status"in t&&"ok"in t&&"json"in t&&typeof t.json=="function";te.looksLikeFetchResponse=cM;var lM=async(t,e,r)=>{await t.setItem(e,JSON.stringify(r))};te.setItemAsync=lM;var fM=async(t,e)=>{let r=await t.getItem(e);if(!r)return null;try{return JSON.parse(r)}catch{return r}};te.getItemAsync=fM;var dM=async(t,e)=>{await t.removeItem(e)};te.removeItemAsync=dM;function E_(t){let e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",r="",n,i,o,s,a,u,c,l=0;for(t=t.replace("-","+").replace("_","/");l<t.length;)s=e.indexOf(t.charAt(l++)),a=e.indexOf(t.charAt(l++)),u=e.indexOf(t.charAt(l++)),c=e.indexOf(t.charAt(l++)),n=s<<2|a>>4,i=(a&15)<<4|u>>2,o=(u&3)<<6|c,r=r+String.fromCharCode(n),u!=64&&i!=0&&(r=r+String.fromCharCode(i)),c!=64&&o!=0&&(r=r+String.fromCharCode(o));return r}te.decodeBase64URL=E_;var Cl=class t{constructor(){this.promise=new t.promiseConstructor((e,r)=>{this.resolve=e,this.reject=r})}};te.Deferred=Cl;Cl.promiseConstructor=Promise;function hM(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(E_(n))}te.decodeJWTPayload=hM;async function pM(t){return await new Promise(e=>{setTimeout(()=>e(null),t)})}te.sleep=pM;function mM(t,e){return new Promise((n,i)=>{(async()=>{for(let o=0;o<1/0;o++)try{let s=await t(o);if(!e(o,null,s)){n(s);return}}catch(s){if(!e(o,s)){i(s);return}}})()})}te.retryable=mM;function gM(t){return("0"+t.toString(16)).substr(-2)}function C_(){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,gM).join("")}te.generatePKCEVerifier=C_;async function yM(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 DM(t){return btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function S_(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 yM(t);return DM(r)}te.generatePKCEChallenge=S_;async function vM(t,e,r=!1){let n=C_(),i=n;r&&(i+="/PASSWORD_RECOVERY"),await(0,te.setItemAsync)(t,`${e}-code-verifier`,i);let o=await S_(n);return[o,n===o?"plain":"s256"]}te.getCodeChallengeAndMethod=vM;var bM=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function wM(t){let e=t.headers.get(rM.API_VERSION_HEADER_NAME);if(!e||!e.match(bM))return null;try{return new Date(`${e}T00:00:00.0Z`)}catch{return null}}te.parseResponseAPIVersion=wM});var tu=y(he=>{"use strict";Object.defineProperty(he,"__esModule",{value:!0});he.isAuthWeakPasswordError=he.AuthWeakPasswordError=he.isAuthRetryableFetchError=he.AuthRetryableFetchError=he.AuthPKCEGrantCodeExchangeError=he.AuthImplicitGrantRedirectError=he.AuthInvalidCredentialsError=he.AuthInvalidTokenResponseError=he.isAuthSessionMissingError=he.AuthSessionMissingError=he.CustomAuthError=he.AuthUnknownError=he.isAuthApiError=he.AuthApiError=he.isAuthError=he.AuthError=void 0;var Ko=class extends Error{constructor(e,r,n){super(e),this.__isAuthError=!0,this.name="AuthError",this.status=r,this.code=n}};he.AuthError=Ko;function eu(t){return typeof t=="object"&&t!==null&&"__isAuthError"in t}he.isAuthError=eu;var Fm=class extends Ko{constructor(e,r,n){super(e,r,n),this.name="AuthApiError",this.status=r,this.code=n}};he.AuthApiError=Fm;function _M(t){return eu(t)&&t.name==="AuthApiError"}he.isAuthApiError=_M;var Om=class extends Ko{constructor(e,r){super(e),this.name="AuthUnknownError",this.originalError=r}};he.AuthUnknownError=Om;var qr=class extends Ko{constructor(e,r,n,i){super(e,n,i),this.name=r,this.status=n}};he.CustomAuthError=qr;var Am=class extends qr{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}};he.AuthSessionMissingError=Am;function EM(t){return eu(t)&&t.name==="AuthSessionMissingError"}he.isAuthSessionMissingError=EM;var km=class extends qr{constructor(){super("Auth session or user missing","AuthInvalidTokenResponseError",500,void 0)}};he.AuthInvalidTokenResponseError=km;var Tm=class extends qr{constructor(e){super(e,"AuthInvalidCredentialsError",400,void 0)}};he.AuthInvalidCredentialsError=Tm;var Pm=class extends qr{constructor(e,r=null){super(e,"AuthImplicitGrantRedirectError",500,void 0),this.details=null,this.details=r}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}};he.AuthImplicitGrantRedirectError=Pm;var Rm=class extends qr{constructor(e,r=null){super(e,"AuthPKCEGrantCodeExchangeError",500,void 0),this.details=null,this.details=r}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}};he.AuthPKCEGrantCodeExchangeError=Rm;var $m=class extends qr{constructor(e,r){super(e,"AuthRetryableFetchError",r,void 0)}};he.AuthRetryableFetchError=$m;function CM(t){return eu(t)&&t.name==="AuthRetryableFetchError"}he.isAuthRetryableFetchError=CM;var Im=class extends qr{constructor(e,r,n){super(e,"AuthWeakPasswordError",r,"weak_password"),this.reasons=n}};he.AuthWeakPasswordError=Im;function SM(t){return eu(t)&&t.name==="AuthWeakPasswordError"}he.isAuthWeakPasswordError=SM});var Lm=y(nt=>{"use strict";var xM=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 Sl=El(),jm=Wo(),Kn=tu(),ki=t=>t.msg||t.message||t.error_description||t.error||JSON.stringify(t),FM=[502,503,504];async function Nm(t){var e;if(!(0,jm.looksLikeFetchResponse)(t))throw new Kn.AuthRetryableFetchError(ki(t),0);if(FM.includes(t.status))throw new Kn.AuthRetryableFetchError(ki(t),t.status);let r;try{r=await t.json()}catch(o){throw new Kn.AuthUnknownError(ki(o),o)}let n,i=(0,jm.parseResponseAPIVersion)(t);if(i&&i.getTime()>=Sl.API_VERSIONS["2024-01-01"].timestamp&&typeof r=="object"&&r&&typeof r.code=="string"?n=r.code:typeof r=="object"&&r&&typeof r.error_code=="string"&&(n=r.error_code),n){if(n==="weak_password")throw new Kn.AuthWeakPasswordError(ki(r),t.status,((e=r.weak_password)===null||e===void 0?void 0:e.reasons)||[]);if(n==="session_not_found")throw new Kn.AuthSessionMissingError}else if(typeof r=="object"&&r&&typeof r.weak_password=="object"&&r.weak_password&&Array.isArray(r.weak_password.reasons)&&r.weak_password.reasons.length&&r.weak_password.reasons.reduce((o,s)=>o&&typeof s=="string",!0))throw new Kn.AuthWeakPasswordError(ki(r),t.status,r.weak_password.reasons);throw new Kn.AuthApiError(ki(r),t.status||500,n)}nt.handleError=Nm;var OM=(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 AM(t,e,r,n){var i;let o=Object.assign({},n?.headers);o[Sl.API_VERSION_HEADER_NAME]||(o[Sl.API_VERSION_HEADER_NAME]=Sl.API_VERSIONS["2024-01-01"].name),n?.jwt&&(o.Authorization=`Bearer ${n.jwt}`);let s=(i=n?.query)!==null&&i!==void 0?i:{};n?.redirectTo&&(s.redirect_to=n.redirectTo);let a=Object.keys(s).length?"?"+new URLSearchParams(s).toString():"",u=await kM(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=AM;async function kM(t,e,r,n,i,o){let s=OM(e,n,i,o),a;try{a=await t(r,Object.assign({},s))}catch(u){throw console.error(u),new Kn.AuthRetryableFetchError(ki(u),0)}if(a.ok||await Nm(a),n?.noResolveJson)return a;try{return await a.json()}catch(u){await Nm(u)}}function x_(t){var e;let r=null;jM(t)&&(r=Object.assign({},t),t.expires_at||(r.expires_at=(0,jm.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=x_;function TM(t){let e=x_(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=TM;function PM(t){var e;return{data:{user:(e=t.user)!==null&&e!==void 0?e:t},error:null}}nt._userResponse=PM;function RM(t){return{data:t,error:null}}nt._ssoResponse=RM;function $M(t){let{action_link:e,email_otp:r,hashed_token:n,redirect_to:i,verification_type:o}=t,s=xM(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=$M;function IM(t){return t}nt._noResolveJsonResponse=IM;function jM(t){return t.access_token&&t.refresh_token&&t.expires_in}});var xl=y(ru=>{"use strict";var NM=ru&&ru.__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(ru,"__esModule",{value:!0});var bt=Lm(),LM=Wo(),Mr=tu(),Bm=class{constructor({url:e="",headers:r={},fetch:n}){this.url=e,this.headers=r,this.fetch=(0,LM.resolveFetch)(n),this.mfa={listFactors:this._listFactors.bind(this),deleteFactor:this._deleteFactor.bind(this)}}async signOut(e,r="global"){try{return await(0,bt._request)(this.fetch,"POST",`${this.url}/logout?scope=${r}`,{headers:this.headers,jwt:e,noResolveJson:!0}),{data:null,error:null}}catch(n){if((0,Mr.isAuthError)(n))return{data:null,error:n};throw n}}async inviteUserByEmail(e,r={}){try{return await(0,bt._request)(this.fetch,"POST",`${this.url}/invite`,{body:{email:e,data:r.data},headers:this.headers,redirectTo:r.redirectTo,xform:bt._userResponse})}catch(n){if((0,Mr.isAuthError)(n))return{data:{user:null},error:n};throw n}}async generateLink(e){try{let{options:r}=e,n=NM(e,["options"]),i=Object.assign(Object.assign({},n),r);return"newEmail"in n&&(i.new_email=n?.newEmail,delete i.newEmail),await(0,bt._request)(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:i,headers:this.headers,xform:bt._generateLinkResponse,redirectTo:r?.redirectTo})}catch(r){if((0,Mr.isAuthError)(r))return{data:{properties:null,user:null},error:r};throw r}}async createUser(e){try{return await(0,bt._request)(this.fetch,"POST",`${this.url}/admin/users`,{body:e,headers:this.headers,xform:bt._userResponse})}catch(r){if((0,Mr.isAuthError)(r))return{data:{user:null},error:r};throw r}}async listUsers(e){var r,n,i,o,s,a,u;try{let c={nextPage:null,lastPage:0,total:0},l=await(0,bt._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:bt._noResolveJsonResponse});if(l.error)throw l.error;let f=await l.json(),h=(s=l.headers.get("x-total-count"))!==null&&s!==void 0?s:0,d=(u=(a=l.headers.get("link"))===null||a===void 0?void 0:a.split(","))!==null&&u!==void 0?u:[];return d.length>0&&(d.forEach(m=>{let b=parseInt(m.split(";")[0].split("=")[1].substring(0,1)),g=JSON.parse(m.split(";")[1].split("=")[1]);c[`${g}Page`]=b}),c.total=parseInt(h)),{data:Object.assign(Object.assign({},f),c),error:null}}catch(c){if((0,Mr.isAuthError)(c))return{data:{users:[]},error:c};throw c}}async getUserById(e){try{return await(0,bt._request)(this.fetch,"GET",`${this.url}/admin/users/${e}`,{headers:this.headers,xform:bt._userResponse})}catch(r){if((0,Mr.isAuthError)(r))return{data:{user:null},error:r};throw r}}async updateUserById(e,r){try{return await(0,bt._request)(this.fetch,"PUT",`${this.url}/admin/users/${e}`,{body:r,headers:this.headers,xform:bt._userResponse})}catch(n){if((0,Mr.isAuthError)(n))return{data:{user:null},error:n};throw n}}async deleteUser(e,r=!1){try{return await(0,bt._request)(this.fetch,"DELETE",`${this.url}/admin/users/${e}`,{headers:this.headers,body:{should_soft_delete:r},xform:bt._userResponse})}catch(n){if((0,Mr.isAuthError)(n))return{data:{user:null},error:n};throw n}}async _listFactors(e){try{let{data:r,error:n}=await(0,bt._request)(this.fetch,"GET",`${this.url}/admin/users/${e.userId}/factors`,{headers:this.headers,xform:i=>({data:{factors:i},error:null})});return{data:r,error:n}}catch(r){if((0,Mr.isAuthError)(r))return{data:null,error:r};throw r}}async _deleteFactor(e){try{return{data:await(0,bt._request)(this.fetch,"DELETE",`${this.url}/admin/users/${e.userId}/factors/${e.id}`,{headers:this.headers}),error:null}}catch(r){if((0,Mr.isAuthError)(r))return{data:null,error:r};throw r}}};ru.default=Bm});var F_=y(Yo=>{"use strict";Object.defineProperty(Yo,"__esModule",{value:!0});Yo.memoryLocalStorageAdapter=Yo.localStorageAdapter=void 0;var qm=Wo();Yo.localStorageAdapter={getItem:t=>(0,qm.supportsLocalStorage)()?globalThis.localStorage.getItem(t):null,setItem:(t,e)=>{(0,qm.supportsLocalStorage)()&&globalThis.localStorage.setItem(t,e)},removeItem:t=>{(0,qm.supportsLocalStorage)()&&globalThis.localStorage.removeItem(t)}};function BM(t={}){return{getItem:e=>t[e]||null,setItem:(e,r)=>{t[e]=r},removeItem:e=>{delete t[e]}}}Yo.memoryLocalStorageAdapter=BM});var O_=y(Fl=>{"use strict";Object.defineProperty(Fl,"__esModule",{value:!0});Fl.polyfillGlobalThis=void 0;function qM(){if(typeof globalThis!="object")try{Object.defineProperty(Object.prototype,"__magic__",{get:function(){return this},configurable:!0}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__}catch{typeof self<"u"&&(self.globalThis=self)}}Fl.polyfillGlobalThis=qM});var Mm=y(Ct=>{"use strict";Object.defineProperty(Ct,"__esModule",{value:!0});Ct.navigatorLock=Ct.NavigatorLockAcquireTimeoutError=Ct.LockAcquireTimeoutError=Ct.internals=void 0;var MM=Wo();Ct.internals={debug:!!(globalThis&&(0,MM.supportsLocalStorage)()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug")==="true")};var Ol=class extends Error{constructor(e){super(e),this.isAcquireTimeout=!0}};Ct.LockAcquireTimeoutError=Ol;var Al=class extends Ol{};Ct.NavigatorLockAcquireTimeoutError=Al;async function UM(t,e,r){Ct.internals.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire lock",t,e);let n=new globalThis.AbortController;return e>0&&setTimeout(()=>{n.abort(),Ct.internals.debug&&console.log("@supabase/gotrue-js: navigatorLock acquire timed out",t)},e),await globalThis.navigator.locks.request(t,e===0?{mode:"exclusive",ifAvailable:!0}:{mode:"exclusive",signal:n.signal},async i=>{if(i){Ct.internals.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquired",t,i.name);try{return await r()}finally{Ct.internals.debug&&console.log("@supabase/gotrue-js: navigatorLock: released",t,i.name)}}else{if(e===0)throw Ct.internals.debug&&console.log("@supabase/gotrue-js: navigatorLock: not immediately available",t),new Al(`Acquiring an exclusive Navigator LockManager lock "${t}" immediately failed`);if(Ct.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()}})}Ct.navigatorLock=UM});var Vm=y(ou=>{"use strict";var VM=ou&&ou.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ou,"__esModule",{value:!0});var HM=VM(xl()),iu=El(),Z=tu(),ae=Lm(),fe=Wo(),Um=F_(),zM=O_(),GM=xm(),A_=Mm();(0,zM.polyfillGlobalThis)();var WM={url:iu.GOTRUE_URL,storageKey:iu.STORAGE_KEY,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:iu.DEFAULT_HEADERS,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1},nu=30*1e3,k_=3;async function T_(t,e,r){return await r()}var kl=class t{constructor(e){var r,n;this.memoryStorage=null,this.stateChangeEmitters=new Map,this.autoRefreshTicker=null,this.visibilityChangedCallback=null,this.refreshingDeferred=null,this.initializePromise=null,this.detectSessionInUrl=!0,this.hasCustomAuthorizationHeader=!1,this.suppressGetSessionWarning=!1,this.lockAcquired=!1,this.pendingInLock=[],this.broadcastChannel=null,this.logger=console.log,this.instanceID=t.nextInstanceID,t.nextInstanceID+=1,this.instanceID>0&&(0,fe.isBrowser)()&&console.warn("Multiple GoTrueClient instances detected in the same browser context. It is not an error, but this should be avoided as it may produce undefined behavior when used concurrently under the same storage key.");let i=Object.assign(Object.assign({},WM),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 HM.default({url:i.url,headers:i.headers,fetch:i.fetch}),this.url=i.url,this.headers=i.headers,this.fetch=(0,fe.resolveFetch)(i.fetch),this.lock=i.lock||T_,this.detectSessionInUrl=i.detectSessionInUrl,this.flowType=i.flowType,this.hasCustomAuthorizationHeader=i.hasCustomAuthorizationHeader,i.lock?this.lock=i.lock:(0,fe.isBrowser)()&&(!((r=globalThis?.navigator)===null||r===void 0)&&r.locks)?this.lock=A_.navigatorLock:this.lock=T_,this.mfa={verify:this._verify.bind(this),enroll:this._enroll.bind(this),unenroll:this._unenroll.bind(this),challenge:this._challenge.bind(this),listFactors:this._listFactors.bind(this),challengeAndVerify:this._challengeAndVerify.bind(this),getAuthenticatorAssuranceLevel:this._getAuthenticatorAssuranceLevel.bind(this)},this.persistSession?i.storage?this.storage=i.storage:(0,fe.supportsLocalStorage)()?this.storage=Um.localStorageAdapter:(this.memoryStorage={},this.storage=(0,Um.memoryLocalStorageAdapter)(this.memoryStorage)):(this.memoryStorage={},this.storage=(0,Um.memoryLocalStorageAdapter)(this.memoryStorage)),(0,fe.isBrowser)()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(o){console.error("Failed to create a new BroadcastChannel, multi-tab state changes will not be available",o)}(n=this.broadcastChannel)===null||n===void 0||n.addEventListener("message",async o=>{this._debug("received broadcast notification from other tab or client",o),await this._notifyAllSubscribers(o.data.event,o.data.session,!1)})}this.initialize()}_debug(...e){return this.logDebugMessages&&this.logger(`GoTrueClient@${this.instanceID} (${GM.version}) ${new Date().toISOString()}`,...e),this}async initialize(){return this.initializePromise?await this.initializePromise:(this.initializePromise=(async()=>await this._acquireLock(-1,async()=>await this._initialize()))(),await this.initializePromise)}async _initialize(){try{let e=(0,fe.isBrowser)()?await this._isPKCEFlow():!1;if(this._debug("#_initialize()","begin","is PKCE flow",e),e||this.detectSessionInUrl&&this._isImplicitGrantFlow()){let{data:r,error:n}=await this._getSessionFromURL(e);if(n)return this._debug("#_initialize()","error detecting session from URL",n),n?.code==="identity_already_exists"?{error:n}:(await this._removeSession(),{error:n});let{session:i,redirectType:o}=r;return this._debug("#_initialize()","detected session in URL",i,"redirect type",o),await this._saveSession(i),setTimeout(async()=>{o==="recovery"?await this._notifyAllSubscribers("PASSWORD_RECOVERY",i):await this._notifyAllSubscribers("SIGNED_IN",i)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(e){return(0,Z.isAuthError)(e)?{error:e}:{error:new Z.AuthUnknownError("Unexpected error during initialization",e)}}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(e){var r,n,i;try{let o=await(0,ae._request)(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{data:(n=(r=e?.options)===null||r===void 0?void 0:r.data)!==null&&n!==void 0?n:{},gotrue_meta_security:{captcha_token:(i=e?.options)===null||i===void 0?void 0:i.captchaToken}},xform:ae._sessionResponse}),{data:s,error:a}=o;if(a||!s)return{data:{user:null,session:null},error:a};let u=s.session,c=s.user;return s.session&&(await this._saveSession(s.session),await this._notifyAllSubscribers("SIGNED_IN",u)),{data:{user:c,session:u},error:null}}catch(o){if((0,Z.isAuthError)(o))return{data:{user:null,session:null},error:o};throw o}}async signUp(e){var r,n,i;try{let o;if("email"in e){let{email:l,password:f,options:h}=e,d=null,m=null;this.flowType==="pkce"&&([d,m]=await(0,fe.getCodeChallengeAndMethod)(this.storage,this.storageKey)),o=await(0,ae._request)(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:h?.emailRedirectTo,body:{email:l,password:f,data:(r=h?.data)!==null&&r!==void 0?r:{},gotrue_meta_security:{captcha_token:h?.captchaToken},code_challenge:d,code_challenge_method:m},xform:ae._sessionResponse})}else if("phone"in e){let{phone:l,password:f,options:h}=e;o=await(0,ae._request)(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:l,password:f,data:(n=h?.data)!==null&&n!==void 0?n:{},channel:(i=h?.channel)!==null&&i!==void 0?i:"sms",gotrue_meta_security:{captcha_token:h?.captchaToken}},xform:ae._sessionResponse})}else throw new Z.AuthInvalidCredentialsError("You must provide either an email or phone number and a password");let{data:s,error:a}=o;if(a||!s)return{data:{user:null,session:null},error:a};let u=s.session,c=s.user;return s.session&&(await this._saveSession(s.session),await this._notifyAllSubscribers("SIGNED_IN",u)),{data:{user:c,session:u},error:null}}catch(o){if((0,Z.isAuthError)(o))return{data:{user:null,session:null},error:o};throw o}}async signInWithPassword(e){try{let r;if("email"in e){let{email:o,password:s,options:a}=e;r=await(0,ae._request)(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:o,password:s,gotrue_meta_security:{captcha_token:a?.captchaToken}},xform:ae._sessionResponsePassword})}else if("phone"in e){let{phone:o,password:s,options:a}=e;r=await(0,ae._request)(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:o,password:s,gotrue_meta_security:{captcha_token:a?.captchaToken}},xform:ae._sessionResponsePassword})}else throw new Z.AuthInvalidCredentialsError("You must provide either an email or phone number and a password");let{data:n,error:i}=r;return i?{data:{user:null,session:null},error:i}:!n||!n.session||!n.user?{data:{user:null,session:null},error:new Z.AuthInvalidTokenResponseError}:(n.session&&(await this._saveSession(n.session),await this._notifyAllSubscribers("SIGNED_IN",n.session)),{data:Object.assign({user:n.user,session:n.session},n.weak_password?{weakPassword:n.weak_password}:null),error:i})}catch(r){if((0,Z.isAuthError)(r))return{data:{user:null,session:null},error:r};throw r}}async signInWithOAuth(e){var r,n,i,o;return await this._handleProviderSignIn(e.provider,{redirectTo:(r=e.options)===null||r===void 0?void 0:r.redirectTo,scopes:(n=e.options)===null||n===void 0?void 0:n.scopes,queryParams:(i=e.options)===null||i===void 0?void 0:i.queryParams,skipBrowserRedirect:(o=e.options)===null||o===void 0?void 0:o.skipBrowserRedirect})}async exchangeCodeForSession(e){return await this.initializePromise,this._acquireLock(-1,async()=>this._exchangeCodeForSession(e))}async _exchangeCodeForSession(e){let r=await(0,fe.getItemAsync)(this.storage,`${this.storageKey}-code-verifier`),[n,i]=(r??"").split("/");try{let{data:o,error:s}=await(0,ae._request)(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:e,code_verifier:n},xform:ae._sessionResponse});if(await(0,fe.removeItemAsync)(this.storage,`${this.storageKey}-code-verifier`),s)throw s;return!o||!o.session||!o.user?{data:{user:null,session:null,redirectType:null},error:new Z.AuthInvalidTokenResponseError}:(o.session&&(await this._saveSession(o.session),await this._notifyAllSubscribers("SIGNED_IN",o.session)),{data:Object.assign(Object.assign({},o),{redirectType:i??null}),error:s})}catch(o){if((0,Z.isAuthError)(o))return{data:{user:null,session:null,redirectType:null},error:o};throw o}}async signInWithIdToken(e){try{let{options:r,provider:n,token:i,access_token:o,nonce:s}=e,a=await(0,ae._request)(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:n,id_token:i,access_token:o,nonce:s,gotrue_meta_security:{captcha_token:r?.captchaToken}},xform:ae._sessionResponse}),{data:u,error:c}=a;return c?{data:{user:null,session:null},error:c}:!u||!u.session||!u.user?{data:{user:null,session:null},error:new Z.AuthInvalidTokenResponseError}:(u.session&&(await this._saveSession(u.session),await this._notifyAllSubscribers("SIGNED_IN",u.session)),{data:u,error:c})}catch(r){if((0,Z.isAuthError)(r))return{data:{user:null,session:null},error:r};throw r}}async signInWithOtp(e){var r,n,i,o,s;try{if("email"in e){let{email:a,options:u}=e,c=null,l=null;this.flowType==="pkce"&&([c,l]=await(0,fe.getCodeChallengeAndMethod)(this.storage,this.storageKey));let{error:f}=await(0,ae._request)(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:a,data:(r=u?.data)!==null&&r!==void 0?r:{},create_user:(n=u?.shouldCreateUser)!==null&&n!==void 0?n:!0,gotrue_meta_security:{captcha_token:u?.captchaToken},code_challenge:c,code_challenge_method:l},redirectTo:u?.emailRedirectTo});return{data:{user:null,session:null},error:f}}if("phone"in e){let{phone:a,options:u}=e,{data:c,error:l}=await(0,ae._request)(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:a,data:(i=u?.data)!==null&&i!==void 0?i:{},create_user:(o=u?.shouldCreateUser)!==null&&o!==void 0?o:!0,gotrue_meta_security:{captcha_token:u?.captchaToken},channel:(s=u?.channel)!==null&&s!==void 0?s:"sms"}});return{data:{user:null,session:null,messageId:c?.message_id},error:l}}throw new Z.AuthInvalidCredentialsError("You must provide either an email or phone number.")}catch(a){if((0,Z.isAuthError)(a))return{data:{user:null,session:null},error:a};throw a}}async verifyOtp(e){var r,n;try{let i,o;"options"in e&&(i=(r=e.options)===null||r===void 0?void 0:r.redirectTo,o=(n=e.options)===null||n===void 0?void 0:n.captchaToken);let{data:s,error:a}=await(0,ae._request)(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},e),{gotrue_meta_security:{captcha_token:o}}),redirectTo:i,xform:ae._sessionResponse});if(a)throw a;if(!s)throw new Error("An error occurred on token verification.");let u=s.session,c=s.user;return u?.access_token&&(await this._saveSession(u),await this._notifyAllSubscribers(e.type=="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",u)),{data:{user:c,session:u},error:null}}catch(i){if((0,Z.isAuthError)(i))return{data:{user:null,session:null},error:i};throw i}}async signInWithSSO(e){var r,n,i;try{let o=null,s=null;return this.flowType==="pkce"&&([o,s]=await(0,fe.getCodeChallengeAndMethod)(this.storage,this.storageKey)),await(0,ae._request)(this.fetch,"POST",`${this.url}/sso`,{body:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},"providerId"in e?{provider_id:e.providerId}:null),"domain"in e?{domain:e.domain}:null),{redirect_to:(n=(r=e.options)===null||r===void 0?void 0:r.redirectTo)!==null&&n!==void 0?n:void 0}),!((i=e?.options)===null||i===void 0)&&i.captchaToken?{gotrue_meta_security:{captcha_token:e.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:o,code_challenge_method:s}),headers:this.headers,xform:ae._ssoResponse})}catch(o){if((0,Z.isAuthError)(o))return{data:null,error:o};throw o}}async reauthenticate(){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._reauthenticate())}async _reauthenticate(){try{return await this._useSession(async e=>{let{data:{session:r},error:n}=e;if(n)throw n;if(!r)throw new Z.AuthSessionMissingError;let{error:i}=await(0,ae._request)(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:r.access_token});return{data:{user:null,session:null},error:i}})}catch(e){if((0,Z.isAuthError)(e))return{data:{user:null,session:null},error:e};throw e}}async resend(e){try{let r=`${this.url}/resend`;if("email"in e){let{email:n,type:i,options:o}=e,{error:s}=await(0,ae._request)(this.fetch,"POST",r,{headers:this.headers,body:{email:n,type:i,gotrue_meta_security:{captcha_token:o?.captchaToken}},redirectTo:o?.emailRedirectTo});return{data:{user:null,session:null},error:s}}else if("phone"in e){let{phone:n,type:i,options:o}=e,{data:s,error:a}=await(0,ae._request)(this.fetch,"POST",r,{headers:this.headers,body:{phone:n,type:i,gotrue_meta_security:{captcha_token:o?.captchaToken}}});return{data:{user:null,session:null,messageId:s?.message_id},error:a}}throw new Z.AuthInvalidCredentialsError("You must provide either an email or phone number and a type")}catch(r){if((0,Z.isAuthError)(r))return{data:{user:null,session:null},error:r};throw r}}async getSession(){return await this.initializePromise,await this._acquireLock(-1,async()=>this._useSession(async r=>r))}async _acquireLock(e,r){this._debug("#_acquireLock","begin",e);try{if(this.lockAcquired){let n=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),i=(async()=>(await n,await r()))();return this.pendingInLock.push((async()=>{try{await i}catch{}})()),i}return await this.lock(`lock:${this.storageKey}`,e,async()=>{this._debug("#_acquireLock","lock acquired for storage key",this.storageKey);try{this.lockAcquired=!0;let n=r();for(this.pendingInLock.push((async()=>{try{await n}catch{}})()),await n;this.pendingInLock.length;){let i=[...this.pendingInLock];await Promise.all(i),this.pendingInLock.splice(0,i.length)}return await n}finally{this._debug("#_acquireLock","lock released for storage key",this.storageKey),this.lockAcquired=!1}})}finally{this._debug("#_acquireLock","end")}}async _useSession(e){this._debug("#_useSession","begin");try{let r=await this.__loadSession();return await e(r)}finally{this._debug("#_useSession","end")}}async __loadSession(){this._debug("#__loadSession()","begin"),this.lockAcquired||this._debug("#__loadSession()","used outside of an acquired lock!",new Error().stack);try{let e=null,r=await(0,fe.getItemAsync)(this.storage,this.storageKey);if(this._debug("#getSession()","session from storage",r),r!==null&&(this._isValidSession(r)?e=r:(this._debug("#getSession()","session from storage is not valid"),await this._removeSession())),!e)return{data:{session:null},error:null};let n=e.expires_at?e.expires_at<=Date.now()/1e3:!1;if(this._debug("#__loadSession()",`session has${n?"":" not"} expired`,"expires_at",e.expires_at),!n){if(this.storage.isServer){let s=this.suppressGetSessionWarning;e=new Proxy(e,{get:(u,c,l)=>(!s&&c==="user"&&(console.warn("Using the user object as returned from supabase.auth.getSession() or from some supabase.auth.onAuthStateChange() events could be insecure! This value comes directly from the storage medium (usually cookies on the server) and many not be authentic. Use supabase.auth.getUser() instead which authenticates the data by contacting the Supabase Auth server."),s=!0,this.suppressGetSessionWarning=!0),Reflect.get(u,c,l))})}return{data:{session:e},error:null}}let{session:i,error:o}=await this._callRefreshToken(e.refresh_token);return o?{data:{session:null},error:o}:{data:{session:i},error:null}}finally{this._debug("#__loadSession()","end")}}async getUser(e){return e?await this._getUser(e):(await this.initializePromise,await this._acquireLock(-1,async()=>await this._getUser()))}async _getUser(e){try{return e?await(0,ae._request)(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:e,xform:ae._userResponse}):await this._useSession(async r=>{var n,i,o;let{data:s,error:a}=r;if(a)throw a;return!(!((n=s.session)===null||n===void 0)&&n.access_token)&&!this.hasCustomAuthorizationHeader?{data:{user:null},error:new Z.AuthSessionMissingError}:await(0,ae._request)(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:(o=(i=s.session)===null||i===void 0?void 0:i.access_token)!==null&&o!==void 0?o:void 0,xform:ae._userResponse})})}catch(r){if((0,Z.isAuthError)(r))return(0,Z.isAuthSessionMissingError)(r)&&(await this._removeSession(),await(0,fe.removeItemAsync)(this.storage,`${this.storageKey}-code-verifier`)),{data:{user:null},error:r};throw r}}async updateUser(e,r={}){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._updateUser(e,r))}async _updateUser(e,r={}){try{return await this._useSession(async n=>{let{data:i,error:o}=n;if(o)throw o;if(!i.session)throw new Z.AuthSessionMissingError;let s=i.session,a=null,u=null;this.flowType==="pkce"&&e.email!=null&&([a,u]=await(0,fe.getCodeChallengeAndMethod)(this.storage,this.storageKey));let{data:c,error:l}=await(0,ae._request)(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:r?.emailRedirectTo,body:Object.assign(Object.assign({},e),{code_challenge:a,code_challenge_method:u}),jwt:s.access_token,xform:ae._userResponse});if(l)throw l;return s.user=c.user,await this._saveSession(s),await this._notifyAllSubscribers("USER_UPDATED",s),{data:{user:s.user},error:null}})}catch(n){if((0,Z.isAuthError)(n))return{data:{user:null},error:n};throw n}}_decodeJWT(e){return(0,fe.decodeJWTPayload)(e)}async setSession(e){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._setSession(e))}async _setSession(e){try{if(!e.access_token||!e.refresh_token)throw new Z.AuthSessionMissingError;let r=Date.now()/1e3,n=r,i=!0,o=null,s=(0,fe.decodeJWTPayload)(e.access_token);if(s.exp&&(n=s.exp,i=n<=r),i){let{session:a,error:u}=await this._callRefreshToken(e.refresh_token);if(u)return{data:{user:null,session:null},error:u};if(!a)return{data:{user:null,session:null},error:null};o=a}else{let{data:a,error:u}=await this._getUser(e.access_token);if(u)throw u;o={access_token:e.access_token,refresh_token:e.refresh_token,user:a.user,token_type:"bearer",expires_in:n-r,expires_at:n},await this._saveSession(o),await this._notifyAllSubscribers("SIGNED_IN",o)}return{data:{user:o.user,session:o},error:null}}catch(r){if((0,Z.isAuthError)(r))return{data:{session:null,user:null},error:r};throw r}}async refreshSession(e){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._refreshSession(e))}async _refreshSession(e){try{return await this._useSession(async r=>{var n;if(!e){let{data:s,error:a}=r;if(a)throw a;e=(n=s.session)!==null&&n!==void 0?n:void 0}if(!e?.refresh_token)throw new Z.AuthSessionMissingError;let{session:i,error:o}=await this._callRefreshToken(e.refresh_token);return o?{data:{user:null,session:null},error:o}:i?{data:{user:i.user,session:i},error:null}:{data:{user:null,session:null},error:null}})}catch(r){if((0,Z.isAuthError)(r))return{data:{user:null,session:null},error:r};throw r}}async _getSessionFromURL(e){try{if(!(0,fe.isBrowser)())throw new Z.AuthImplicitGrantRedirectError("No browser detected.");if(this.flowType==="implicit"&&!this._isImplicitGrantFlow())throw new Z.AuthImplicitGrantRedirectError("Not a valid implicit grant flow url.");if(this.flowType=="pkce"&&!e)throw new Z.AuthPKCEGrantCodeExchangeError("Not a valid PKCE flow url.");let r=(0,fe.parseParametersFromURL)(window.location.href);if(e){if(!r.code)throw new Z.AuthPKCEGrantCodeExchangeError("No code detected.");let{data:x,error:D}=await this._exchangeCodeForSession(r.code);if(D)throw D;let C=new URL(window.location.href);return C.searchParams.delete("code"),window.history.replaceState(window.history.state,"",C.toString()),{data:{session:x.session,redirectType:null},error:null}}if(r.error||r.error_description||r.error_code)throw new Z.AuthImplicitGrantRedirectError(r.error_description||"Error in URL with unspecified error_description",{error:r.error||"unspecified_error",code:r.error_code||"unspecified_code"});let{provider_token:n,provider_refresh_token:i,access_token:o,refresh_token:s,expires_in:a,expires_at:u,token_type:c}=r;if(!o||!a||!s||!c)throw new Z.AuthImplicitGrantRedirectError("No session defined in URL");let l=Math.round(Date.now()/1e3),f=parseInt(a),h=l+f;u&&(h=parseInt(u));let d=h-l;d*1e3<=nu&&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;l-m>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",m,h,l):l-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,l);let{data:b,error:g}=await this._getUser(o);if(g)throw g;let w={provider_token:n,provider_refresh_token:i,access_token:o,expires_in:f,expires_at:h,refresh_token:s,token_type:c,user:b.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),{data:{session:w,redirectType:r.type},error:null}}catch(r){if((0,Z.isAuthError)(r))return{data:{session:null,redirectType:null},error:r};throw r}}_isImplicitGrantFlow(){let e=(0,fe.parseParametersFromURL)(window.location.href);return!!((0,fe.isBrowser)()&&(e.access_token||e.error_description))}async _isPKCEFlow(){let e=(0,fe.parseParametersFromURL)(window.location.href),r=await(0,fe.getItemAsync)(this.storage,`${this.storageKey}-code-verifier`);return!!(e.code&&r)}async signOut(e={scope:"global"}){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._signOut(e))}async _signOut({scope:e}={scope:"global"}){return await this._useSession(async r=>{var n;let{data:i,error:o}=r;if(o)return{error:o};let s=(n=i.session)===null||n===void 0?void 0:n.access_token;if(s){let{error:a}=await this.admin.signOut(s,e);if(a&&!((0,Z.isAuthApiError)(a)&&(a.status===404||a.status===401||a.status===403)))return{error:a}}return e!=="others"&&(await this._removeSession(),await(0,fe.removeItemAsync)(this.storage,`${this.storageKey}-code-verifier`)),{error:null}})}onAuthStateChange(e){let r=(0,fe.uuid)(),n={id:r,callback:e,unsubscribe:()=>{this._debug("#unsubscribe()","state change callback with id removed",r),this.stateChangeEmitters.delete(r)}};return this._debug("#onAuthStateChange()","registered callback with id",r),this.stateChangeEmitters.set(r,n),(async()=>(await this.initializePromise,await this._acquireLock(-1,async()=>{this._emitInitialSession(r)})))(),{data:{subscription:n}}}async _emitInitialSession(e){return await this._useSession(async r=>{var n,i;try{let{data:{session:o},error:s}=r;if(s)throw s;await((n=this.stateChangeEmitters.get(e))===null||n===void 0?void 0:n.callback("INITIAL_SESSION",o)),this._debug("INITIAL_SESSION","callback id",e,"session",o)}catch(o){await((i=this.stateChangeEmitters.get(e))===null||i===void 0?void 0:i.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",e,"error",o),console.error(o)}})}async resetPasswordForEmail(e,r={}){let n=null,i=null;this.flowType==="pkce"&&([n,i]=await(0,fe.getCodeChallengeAndMethod)(this.storage,this.storageKey,!0));try{return await(0,ae._request)(this.fetch,"POST",`${this.url}/recover`,{body:{email:e,code_challenge:n,code_challenge_method:i,gotrue_meta_security:{captcha_token:r.captchaToken}},headers:this.headers,redirectTo:r.redirectTo})}catch(o){if((0,Z.isAuthError)(o))return{data:null,error:o};throw o}}async getUserIdentities(){var e;try{let{data:r,error:n}=await this.getUser();if(n)throw n;return{data:{identities:(e=r.user.identities)!==null&&e!==void 0?e:[]},error:null}}catch(r){if((0,Z.isAuthError)(r))return{data:null,error:r};throw r}}async linkIdentity(e){var r;try{let{data:n,error:i}=await this._useSession(async o=>{var s,a,u,c,l;let{data:f,error:h}=o;if(h)throw h;let d=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,e.provider,{redirectTo:(s=e.options)===null||s===void 0?void 0:s.redirectTo,scopes:(a=e.options)===null||a===void 0?void 0:a.scopes,queryParams:(u=e.options)===null||u===void 0?void 0:u.queryParams,skipBrowserRedirect:!0});return await(0,ae._request)(this.fetch,"GET",d,{headers:this.headers,jwt:(l=(c=f.session)===null||c===void 0?void 0:c.access_token)!==null&&l!==void 0?l:void 0})});if(i)throw i;return(0,fe.isBrowser)()&&!(!((r=e.options)===null||r===void 0)&&r.skipBrowserRedirect)&&window.location.assign(n?.url),{data:{provider:e.provider,url:n?.url},error:null}}catch(n){if((0,Z.isAuthError)(n))return{data:{provider:e.provider,url:null},error:n};throw n}}async unlinkIdentity(e){try{return await this._useSession(async r=>{var n,i;let{data:o,error:s}=r;if(s)throw s;return await(0,ae._request)(this.fetch,"DELETE",`${this.url}/user/identities/${e.identity_id}`,{headers:this.headers,jwt:(i=(n=o.session)===null||n===void 0?void 0:n.access_token)!==null&&i!==void 0?i:void 0})})}catch(r){if((0,Z.isAuthError)(r))return{data:null,error:r};throw r}}async _refreshAccessToken(e){let r=`#_refreshAccessToken(${e.substring(0,5)}...)`;this._debug(r,"begin");try{let n=Date.now();return await(0,fe.retryable)(async i=>(i>0&&await(0,fe.sleep)(200*Math.pow(2,i-1)),this._debug(r,"refreshing attempt",i),await(0,ae._request)(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:e},headers:this.headers,xform:ae._sessionResponse})),(i,o)=>{let s=200*Math.pow(2,i);return o&&(0,Z.isAuthRetryableFetchError)(o)&&Date.now()+s-n<nu})}catch(n){if(this._debug(r,"error",n),(0,Z.isAuthError)(n))return{data:{session:null,user:null},error:n};throw n}finally{this._debug(r,"end")}}_isValidSession(e){return typeof e=="object"&&e!==null&&"access_token"in e&&"refresh_token"in e&&"expires_at"in e}async _handleProviderSignIn(e,r){let n=await this._getUrlForProvider(`${this.url}/authorize`,e,{redirectTo:r.redirectTo,scopes:r.scopes,queryParams:r.queryParams});return this._debug("#_handleProviderSignIn()","provider",e,"options",r,"url",n),(0,fe.isBrowser)()&&!r.skipBrowserRedirect&&window.location.assign(n),{data:{provider:e,url:n},error:null}}async _recoverAndRefresh(){var e;let r="#_recoverAndRefresh()";this._debug(r,"begin");try{let n=await(0,fe.getItemAsync)(this.storage,this.storageKey);if(this._debug(r,"session from storage",n),!this._isValidSession(n)){this._debug(r,"session is not valid"),n!==null&&await this._removeSession();return}let i=Math.round(Date.now()/1e3),o=((e=n.expires_at)!==null&&e!==void 0?e:1/0)<i+iu.EXPIRY_MARGIN;if(this._debug(r,`session has${o?"":" not"} expired with margin of ${iu.EXPIRY_MARGIN}s`),o){if(this.autoRefreshToken&&n.refresh_token){let{error:s}=await this._callRefreshToken(n.refresh_token);s&&(console.error(s),(0,Z.isAuthRetryableFetchError)(s)||(this._debug(r,"refresh failed with a non-retryable error, removing the session",s),await this._removeSession()))}}else await this._notifyAllSubscribers("SIGNED_IN",n)}catch(n){this._debug(r,"error",n),console.error(n);return}finally{this._debug(r,"end")}}async _callRefreshToken(e){var r,n;if(!e)throw new Z.AuthSessionMissingError;if(this.refreshingDeferred)return this.refreshingDeferred.promise;let i=`#_callRefreshToken(${e.substring(0,5)}...)`;this._debug(i,"begin");try{this.refreshingDeferred=new fe.Deferred;let{data:o,error:s}=await this._refreshAccessToken(e);if(s)throw s;if(!o.session)throw new Z.AuthSessionMissingError;await this._saveSession(o.session),await this._notifyAllSubscribers("TOKEN_REFRESHED",o.session);let a={session:o.session,error:null};return this.refreshingDeferred.resolve(a),a}catch(o){if(this._debug(i,"error",o),(0,Z.isAuthError)(o)){let s={session:null,error:o};return(0,Z.isAuthRetryableFetchError)(o)||await this._removeSession(),(r=this.refreshingDeferred)===null||r===void 0||r.resolve(s),s}throw(n=this.refreshingDeferred)===null||n===void 0||n.reject(o),o}finally{this.refreshingDeferred=null,this._debug(i,"end")}}async _notifyAllSubscribers(e,r,n=!0){let i=`#_notifyAllSubscribers(${e})`;this._debug(i,"begin",r,`broadcast = ${n}`);try{this.broadcastChannel&&n&&this.broadcastChannel.postMessage({event:e,session:r});let o=[],s=Array.from(this.stateChangeEmitters.values()).map(async a=>{try{await a.callback(e,r)}catch(u){o.push(u)}});if(await Promise.all(s),o.length>0){for(let a=0;a<o.length;a+=1)console.error(o[a]);throw o[0]}}finally{this._debug(i,"end")}}async _saveSession(e){this._debug("#_saveSession()",e),this.suppressGetSessionWarning=!0,await(0,fe.setItemAsync)(this.storage,this.storageKey,e)}async _removeSession(){this._debug("#_removeSession()"),await(0,fe.removeItemAsync)(this.storage,this.storageKey),await this._notifyAllSubscribers("SIGNED_OUT",null)}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()");let e=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{e&&(0,fe.isBrowser)()&&window?.removeEventListener&&window.removeEventListener("visibilitychange",e)}catch(r){console.error("removing visibilitychange callback failed",r)}}async _startAutoRefresh(){await this._stopAutoRefresh(),this._debug("#_startAutoRefresh()");let e=setInterval(()=>this._autoRefreshTokenTick(),nu);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)/nu);this._debug("#_autoRefreshTokenTick()",`access token expires in ${i} ticks, a tick lasts ${nu}ms, refresh threshold is ${k_} ticks`),i<=k_&&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 A_.LockAcquireTimeoutError)this._debug("auto refresh token tick lock not available");else throw e}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!(0,fe.isBrowser)()||!window?.addEventListener)return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>await this._onVisibilityChanged(!1),window?.addEventListener("visibilitychange",this.visibilityChangedCallback),await this._onVisibilityChanged(!0)}catch(e){console.error("_handleVisibilityChange",e)}}async _onVisibilityChanged(e){let r=`#_onVisibilityChanged(${e})`;this._debug(r,"visibilityState",document.visibilityState),document.visibilityState==="visible"?(this.autoRefreshToken&&this._startAutoRefresh(),e||(await this.initializePromise,await this._acquireLock(-1,async()=>{if(document.visibilityState!=="visible"){this._debug(r,"acquired the lock to recover the session, but the browser visibilityState is no longer visible, aborting");return}await this._recoverAndRefresh()}))):document.visibilityState==="hidden"&&this.autoRefreshToken&&this._stopAutoRefresh()}async _getUrlForProvider(e,r,n){let i=[`provider=${encodeURIComponent(r)}`];if(n?.redirectTo&&i.push(`redirect_to=${encodeURIComponent(n.redirectTo)}`),n?.scopes&&i.push(`scopes=${encodeURIComponent(n.scopes)}`),this.flowType==="pkce"){let[o,s]=await(0,fe.getCodeChallengeAndMethod)(this.storage,this.storageKey),a=new URLSearchParams({code_challenge:`${encodeURIComponent(o)}`,code_challenge_method:`${encodeURIComponent(s)}`});i.push(a.toString())}if(n?.queryParams){let o=new URLSearchParams(n.queryParams);i.push(o.toString())}return n?.skipBrowserRedirect&&i.push(`skip_http_redirect=${n.skipBrowserRedirect}`),`${e}?${i.join("&")}`}async _unenroll(e){try{return await this._useSession(async r=>{var n;let{data:i,error:o}=r;return o?{data:null,error:o}:await(0,ae._request)(this.fetch,"DELETE",`${this.url}/factors/${e.factorId}`,{headers:this.headers,jwt:(n=i?.session)===null||n===void 0?void 0:n.access_token})})}catch(r){if((0,Z.isAuthError)(r))return{data:null,error:r};throw r}}async _enroll(e){try{return await this._useSession(async r=>{var n,i;let{data:o,error:s}=r;if(s)return{data:null,error:s};let a=Object.assign({friendly_name:e.friendlyName,factor_type:e.factorType},e.factorType==="phone"?{phone:e.phone}:{issuer:e.issuer}),{data:u,error:c}=await(0,ae._request)(this.fetch,"POST",`${this.url}/factors`,{body:a,headers:this.headers,jwt:(n=o?.session)===null||n===void 0?void 0:n.access_token});return c?{data:null,error:c}:(e.factorType==="totp"&&(!((i=u?.totp)===null||i===void 0)&&i.qr_code)&&(u.totp.qr_code=`data:image/svg+xml;utf-8,${u.totp.qr_code}`),{data:u,error:null})})}catch(r){if((0,Z.isAuthError)(r))return{data:null,error:r};throw r}}async _verify(e){return this._acquireLock(-1,async()=>{try{return await this._useSession(async r=>{var n;let{data:i,error:o}=r;if(o)return{data:null,error:o};let{data:s,error:a}=await(0,ae._request)(this.fetch,"POST",`${this.url}/factors/${e.factorId}/verify`,{body:{code:e.code,challenge_id:e.challengeId},headers:this.headers,jwt:(n=i?.session)===null||n===void 0?void 0:n.access_token});return a?{data:null,error:a}:(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+s.expires_in},s)),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",s),{data:s,error:a})})}catch(r){if((0,Z.isAuthError)(r))return{data:null,error:r};throw r}})}async _challenge(e){return this._acquireLock(-1,async()=>{try{return await this._useSession(async r=>{var n;let{data:i,error:o}=r;return o?{data:null,error:o}:await(0,ae._request)(this.fetch,"POST",`${this.url}/factors/${e.factorId}/challenge`,{body:{channel:e.channel},headers:this.headers,jwt:(n=i?.session)===null||n===void 0?void 0:n.access_token})})}catch(r){if((0,Z.isAuthError)(r))return{data:null,error:r};throw r}})}async _challengeAndVerify(e){let{data:r,error:n}=await this._challenge({factorId:e.factorId});return n?{data:null,error:n}:await this._verify({factorId:e.factorId,challengeId:r.id,code:e.code})}async _listFactors(){let{data:{user:e},error:r}=await this.getUser();if(r)return{data:null,error:r};let n=e?.factors||[],i=n.filter(s=>s.factor_type==="totp"&&s.status==="verified"),o=n.filter(s=>s.factor_type==="phone"&&s.status==="verified");return{data:{all:n,totp:i,phone:o},error:null}}async _getAuthenticatorAssuranceLevel(){return this._acquireLock(-1,async()=>await this._useSession(async e=>{var r,n;let{data:{session:i},error:o}=e;if(o)return{data:null,error:o};if(!i)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};let s=this._decodeJWT(i.access_token),a=null;s.aal&&(a=s.aal);let u=a;((n=(r=i.user.factors)===null||r===void 0?void 0:r.filter(f=>f.status==="verified"))!==null&&n!==void 0?n:[]).length>0&&(u="aal2");let l=s.amr||[];return{data:{currentLevel:a,nextLevel:u,currentAuthenticationMethods:l},error:null}}))}};ou.default=kl;kl.nextInstanceID=0});var P_=y(su=>{"use strict";var KM=su&&su.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(su,"__esModule",{value:!0});var YM=KM(xl()),JM=YM.default;su.default=JM});var R_=y(au=>{"use strict";var XM=au&&au.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(au,"__esModule",{value:!0});var ZM=XM(Vm()),QM=ZM.default;au.default=QM});var I_=y($_=>{"use strict";Object.defineProperty($_,"__esModule",{value:!0})});var zm=y(Ne=>{"use strict";var e4=Ne&&Ne.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),j_=Ne&&Ne.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&e4(e,t,r)},Tl=Ne&&Ne.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ne,"__esModule",{value:!0});Ne.lockInternals=Ne.NavigatorLockAcquireTimeoutError=Ne.navigatorLock=Ne.AuthClient=Ne.AuthAdminApi=Ne.GoTrueClient=Ne.GoTrueAdminApi=void 0;var t4=Tl(xl());Ne.GoTrueAdminApi=t4.default;var r4=Tl(Vm());Ne.GoTrueClient=r4.default;var n4=Tl(P_());Ne.AuthAdminApi=n4.default;var i4=Tl(R_());Ne.AuthClient=i4.default;j_(I_(),Ne);j_(tu(),Ne);var Hm=Mm();Object.defineProperty(Ne,"navigatorLock",{enumerable:!0,get:function(){return Hm.navigatorLock}});Object.defineProperty(Ne,"NavigatorLockAcquireTimeoutError",{enumerable:!0,get:function(){return Hm.NavigatorLockAcquireTimeoutError}});Object.defineProperty(Ne,"lockInternals",{enumerable:!0,get:function(){return Hm.internals}})});var N_=y(Pl=>{"use strict";Object.defineProperty(Pl,"__esModule",{value:!0});Pl.SupabaseAuthClient=void 0;var o4=zm(),Gm=class extends o4.AuthClient{constructor(e){super(e)}};Pl.SupabaseAuthClient=Gm});var Km=y(uu=>{"use strict";var s4=uu&&uu.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(l){try{c(n.next(l))}catch(f){s(f)}}function u(l){try{c(n.throw(l))}catch(f){s(f)}}function c(l){l.done?o(l.value):i(l.value).then(a,u)}c((n=n.apply(t,e||[])).next())})};Object.defineProperty(uu,"__esModule",{value:!0});var a4=nm(),u4=i_(),c4=(ym(),Ae(gm)),l4=y_(),Rl=v_(),f4=w_(),L_=__(),d4=N_(),Wm=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,L_.stripTrailingSlash)(e);this.realtimeUrl=`${a}/realtime/v1`.replace(/^http/i,"ws"),this.authUrl=`${a}/auth/v1`,this.storageUrl=`${a}/storage/v1`,this.functionsUrl=`${a}/functions/v1`;let u=`sb-${new URL(this.authUrl).hostname.split(".")[0]}-auth-token`,c={db:Rl.DEFAULT_DB_OPTIONS,realtime:Rl.DEFAULT_REALTIME_OPTIONS,auth:Object.assign(Object.assign({},Rl.DEFAULT_AUTH_OPTIONS),{storageKey:u}),global:Rl.DEFAULT_GLOBAL_OPTIONS},l=(0,L_.applySettingDefaults)(n??{},c);this.storageKey=(i=l.auth.storageKey)!==null&&i!==void 0?i:"",this.headers=(o=l.global.headers)!==null&&o!==void 0?o:{},l.accessToken?(this.accessToken=l.accessToken,this.auth=new Proxy({},{get:(f,h)=>{throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(h)} is not possible`)}})):this.auth=this._initSupabaseAuthClient((s=l.auth)!==null&&s!==void 0?s:{},this.headers,l.global.fetch),this.fetch=(0,f4.fetchWithAuth)(r,this._getAccessToken.bind(this),l.global.fetch),this.realtime=this._initRealtimeClient(Object.assign({headers:this.headers},l.realtime)),this.rest=new u4.PostgrestClient(`${a}/rest/v1`,{headers:this.headers,schema:l.db.schema,fetch:this.fetch}),l.accessToken||this._listenForAuthEvents()}get functions(){return new a4.FunctionsClient(this.functionsUrl,{headers:this.headers,customFetch:this.fetch})}get storage(){return new l4.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 s4(this,void 0,void 0,function*(){if(this.accessToken)return yield this.accessToken();let{data:n}=yield this.auth.getSession();return(r=(e=n.session)===null||e===void 0?void 0:e.access_token)!==null&&r!==void 0?r:null})}_initSupabaseAuthClient({autoRefreshToken:e,persistSession:r,detectSessionInUrl:n,storage:i,storageKey:o,flowType:s,lock:a,debug:u},c,l){var f;let h={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new d4.SupabaseAuthClient({url:this.authUrl,headers:Object.assign(Object.assign({},h),c),storageKey:o,autoRefreshToken:e,persistSession:r,detectSessionInUrl:n,storage:i,flowType:s,lock:a,debug:u,fetch:l,hasCustomAuthorizationHeader:(f="Authorization"in this.headers)!==null&&f!==void 0?f:!1})}_initRealtimeClient(e){return new c4.RealtimeClient(this.realtimeUrl,Object.assign(Object.assign({},e),{params:Object.assign({apikey:this.supabaseKey},e?.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((r,n)=>{this._handleTokenChanged(r,"CLIENT",n?.access_token)})}_handleTokenChanged(e,r,n){(e==="TOKEN_REFRESHED"||e==="SIGNED_IN")&&this.changedAccessToken!==n?(this.realtime.setAuth(n??null),this.changedAccessToken=n):e==="SIGNED_OUT"&&(this.realtime.setAuth(this.supabaseKey),r=="STORAGE"&&this.auth.signOut(),this.changedAccessToken=void 0)}};uu.default=Wm});var M_=y(Le=>{"use strict";var h4=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]}),B_=Le&&Le.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&h4(e,t,r)},q_=Le&&Le.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Le,"__esModule",{value:!0});Le.createClient=Le.SupabaseClient=Le.FunctionRegion=Le.FunctionsError=Le.FunctionsRelayError=Le.FunctionsFetchError=Le.FunctionsHttpError=void 0;var p4=q_(Km());B_(zm(),Le);var cu=nm();Object.defineProperty(Le,"FunctionsHttpError",{enumerable:!0,get:function(){return cu.FunctionsHttpError}});Object.defineProperty(Le,"FunctionsFetchError",{enumerable:!0,get:function(){return cu.FunctionsFetchError}});Object.defineProperty(Le,"FunctionsRelayError",{enumerable:!0,get:function(){return cu.FunctionsRelayError}});Object.defineProperty(Le,"FunctionsError",{enumerable:!0,get:function(){return cu.FunctionsError}});Object.defineProperty(Le,"FunctionRegion",{enumerable:!0,get:function(){return cu.FunctionRegion}});B_((ym(),Ae(gm)),Le);var m4=Km();Object.defineProperty(Le,"SupabaseClient",{enumerable:!0,get:function(){return q_(m4).default}});var g4=(t,e,r)=>new p4.default(t,e,r);Le.createClient=g4});var Ym=y((Sle,U_)=>{U_.exports=require("stream")});var K_=y((xle,W_)=>{"use strict";function V_(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 H_(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?V_(Object(r),!0).forEach(function(n){y4(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):V_(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function y4(t,e,r){return e=G_(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function D4(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function z_(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,G_(n.key),n)}}function v4(t,e,r){return e&&z_(t.prototype,e),r&&z_(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function G_(t){var e=b4(t,"string");return typeof e=="symbol"?e:String(e)}function b4(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 w4=require("buffer"),$l=w4.Buffer,_4=require("util"),Jm=_4.inspect,E4=Jm&&Jm.custom||"inspect";function C4(t,e,r){$l.prototype.copy.call(t,e,r)}W_.exports=function(){function t(){D4(this,t),this.head=null,this.tail=null,this.length=0}return v4(t,[{key:"push",value:function(r){var n={data:r,next:null};this.length>0?this.tail.next=n:this.head=n,this.tail=n,++this.length}},{key:"unshift",value:function(r){var n={data:r,next:this.head};this.length===0&&(this.tail=n),this.head=n,++this.length}},{key:"shift",value:function(){if(this.length!==0){var r=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,r}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(r){if(this.length===0)return"";for(var n=this.head,i=""+n.data;n=n.next;)i+=r+n.data;return i}},{key:"concat",value:function(r){if(this.length===0)return $l.alloc(0);for(var n=$l.allocUnsafe(r>>>0),i=this.head,o=0;i;)C4(i.data,n,o),o+=i.data.length,i=i.next;return n}},{key:"consume",value:function(r,n){var i;return r<this.head.data.length?(i=this.head.data.slice(0,r),this.head.data=this.head.data.slice(r)):r===this.head.data.length?i=this.shift():i=n?this._getString(r):this._getBuffer(r),i}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(r){var n=this.head,i=1,o=n.data;for(r-=o.length;n=n.next;){var s=n.data,a=r>s.length?s.length:r;if(a===s.length?o+=s:o+=s.slice(0,r),r-=a,r===0){a===s.length?(++i,n.next?this.head=n.next:this.head=this.tail=null):(this.head=n,n.data=s.slice(a));break}++i}return this.length-=i,o}},{key:"_getBuffer",value:function(r){var n=$l.allocUnsafe(r),i=this.head,o=1;for(i.data.copy(n),r-=i.data.length;i=i.next;){var s=i.data,a=r>s.length?s.length:r;if(s.copy(n,n.length-r,0,a),r-=a,r===0){a===s.length?(++o,i.next?this.head=i.next:this.head=this.tail=null):(this.head=i,i.data=s.slice(a));break}++o}return this.length-=o,n}},{key:E4,value:function(r,n){return Jm(this,H_(H_({},n),{},{depth:0,customInspect:!1}))}}]),t}()});var Zm=y((Fle,J_)=>{"use strict";function S4(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(Xm,this,t)):process.nextTick(Xm,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,function(o){!e&&o?r._writableState?r._writableState.errorEmitted?process.nextTick(Il,r):(r._writableState.errorEmitted=!0,process.nextTick(Y_,r,o)):process.nextTick(Y_,r,o):e?(process.nextTick(Il,r),e(o)):process.nextTick(Il,r)}),this)}function Y_(t,e){Xm(t,e),Il(t)}function Il(t){t._writableState&&!t._writableState.emitClose||t._readableState&&!t._readableState.emitClose||t.emit("close")}function x4(){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 Xm(t,e){t.emit("error",e)}function F4(t,e){var r=t._readableState,n=t._writableState;r&&r.autoDestroy||n&&n.autoDestroy?t.destroy(e):t.emit("error",e)}J_.exports={destroy:S4,undestroy:x4,errorOrDestroy:F4}});var Yn=y((Ole,Q_)=>{"use strict";var Z_={};function gr(t,e,r){r||(r=Error);function n(o,s,a){return typeof e=="string"?e:e(o,s,a)}class i extends r{constructor(s,a,u){super(n(s,a,u))}}i.prototype.name=r.name,i.prototype.code=t,Z_[t]=i}function X_(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 O4(t,e,r){return t.substr(!r||r<0?0:+r,e.length)===e}function A4(t,e,r){return(r===void 0||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}function k4(t,e,r){return typeof r!="number"&&(r=0),r+e.length>t.length?!1:t.indexOf(e,r)!==-1}gr("ERR_INVALID_OPT_VALUE",function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'},TypeError);gr("ERR_INVALID_ARG_TYPE",function(t,e,r){let n;typeof e=="string"&&O4(e,"not ")?(n="must not be",e=e.replace(/^not /,"")):n="must be";let i;if(A4(t," argument"))i=`The ${t} ${n} ${X_(e,"type")}`;else{let o=k4(t,".")?"property":"argument";i=`The "${t}" ${o} ${n} ${X_(e,"type")}`}return i+=`. Received type ${typeof r}`,i},TypeError);gr("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");gr("ERR_METHOD_NOT_IMPLEMENTED",function(t){return"The "+t+" method is not implemented"});gr("ERR_STREAM_PREMATURE_CLOSE","Premature close");gr("ERR_STREAM_DESTROYED",function(t){return"Cannot call "+t+" after a stream was destroyed"});gr("ERR_MULTIPLE_CALLBACK","Callback called multiple times");gr("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");gr("ERR_STREAM_WRITE_AFTER_END","write after end");gr("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);gr("ERR_UNKNOWN_ENCODING",function(t){return"Unknown encoding: "+t},TypeError);gr("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");Q_.exports.codes=Z_});var Qm=y((Ale,eE)=>{"use strict";var T4=Yn().codes.ERR_INVALID_OPT_VALUE;function P4(t,e,r){return t.highWaterMark!=null?t.highWaterMark:e?t[r]:null}function R4(t,e,r,n){var i=P4(e,n,r);if(i!=null){if(!(isFinite(i)&&Math.floor(i)===i)||i<0){var o=n?r:"highWaterMark";throw new T4(o,i)}return Math.floor(i)}return t.objectMode?16:16*1024}eE.exports={getHighWaterMark:R4}});var tE=y((kle,eg)=>{typeof Object.create=="function"?eg.exports=function(e,r){r&&(e.super_=r,e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:eg.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 Jo=y((Tle,rg)=>{try{if(tg=require("util"),typeof tg.inherits!="function")throw"";rg.exports=tg.inherits}catch{rg.exports=tE()}var tg});var nE=y((Ple,rE)=>{rE.exports=require("util").deprecate});var og=y((Rle,cE)=>{"use strict";cE.exports=Je;function oE(t){var e=this;this.next=null,this.entry=null,this.finish=function(){s5(e,t)}}var Xo;Je.WritableState=fu;var $4={deprecate:nE()},sE=Ym(),Nl=require("buffer").Buffer,I4=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function j4(t){return Nl.from(t)}function N4(t){return Nl.isBuffer(t)||t instanceof I4}var ig=Zm(),L4=Qm(),B4=L4.getHighWaterMark,Jn=Yn().codes,q4=Jn.ERR_INVALID_ARG_TYPE,M4=Jn.ERR_METHOD_NOT_IMPLEMENTED,U4=Jn.ERR_MULTIPLE_CALLBACK,V4=Jn.ERR_STREAM_CANNOT_PIPE,H4=Jn.ERR_STREAM_DESTROYED,z4=Jn.ERR_STREAM_NULL_VALUES,G4=Jn.ERR_STREAM_WRITE_AFTER_END,W4=Jn.ERR_UNKNOWN_ENCODING,Zo=ig.errorOrDestroy;Jo()(Je,sE);function K4(){}function fu(t,e,r){Xo=Xo||Ti(),t=t||{},typeof r!="boolean"&&(r=e instanceof Xo),this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=B4(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){t5(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 oE(this)}fu.prototype.getBuffer=function(){for(var e=this.bufferedRequest,r=[];e;)r.push(e),e=e.next;return r};(function(){try{Object.defineProperty(fu.prototype,"buffer",{get:$4.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var jl;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(jl=Function.prototype[Symbol.hasInstance],Object.defineProperty(Je,Symbol.hasInstance,{value:function(e){return jl.call(this,e)?!0:this!==Je?!1:e&&e._writableState instanceof fu}})):jl=function(e){return e instanceof this};function Je(t){Xo=Xo||Ti();var e=this instanceof Xo;if(!e&&!jl.call(Je,this))return new Je(t);this._writableState=new fu(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)),sE.call(this)}Je.prototype.pipe=function(){Zo(this,new V4)};function Y4(t,e){var r=new G4;Zo(t,r),process.nextTick(e,r)}function J4(t,e,r,n){var i;return r===null?i=new z4:typeof r!="string"&&!e.objectMode&&(i=new q4("chunk",["string","Buffer"],r)),i?(Zo(t,i),process.nextTick(n,i),!1):!0}Je.prototype.write=function(t,e,r){var n=this._writableState,i=!1,o=!n.objectMode&&N4(t);return o&&!Nl.isBuffer(t)&&(t=j4(t)),typeof e=="function"&&(r=e,e=null),o?e="buffer":e||(e=n.defaultEncoding),typeof r!="function"&&(r=K4),n.ending?Y4(this,r):(o||J4(this,n,t,r))&&(n.pendingcb++,i=Z4(this,n,o,t,e,r)),i};Je.prototype.cork=function(){this._writableState.corked++};Je.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,!t.writing&&!t.corked&&!t.bufferProcessing&&t.bufferedRequest&&aE(this,t))};Je.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 W4(e);return this._writableState.defaultEncoding=e,this};Object.defineProperty(Je.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function X4(t,e,r){return!t.objectMode&&t.decodeStrings!==!1&&typeof e=="string"&&(e=Nl.from(e,r)),e}Object.defineProperty(Je.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function Z4(t,e,r,n,i,o){if(!r){var s=X4(e,n,i);n!==s&&(r=!0,i="buffer",n=s)}var a=e.objectMode?1:n.length;e.length+=a;var u=e.length<e.highWaterMark;if(u||(e.needDrain=!0),e.writing||e.corked){var c=e.lastBufferedRequest;e.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:o,next:null},c?c.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1}else ng(t,e,!1,a,n,i,o);return u}function ng(t,e,r,n,i,o,s){e.writelen=n,e.writecb=s,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new H4("write")):r?t._writev(i,e.onwrite):t._write(i,o,e.onwrite),e.sync=!1}function Q4(t,e,r,n,i){--e.pendingcb,r?(process.nextTick(i,n),process.nextTick(lu,t,e),t._writableState.errorEmitted=!0,Zo(t,n)):(i(n),t._writableState.errorEmitted=!0,Zo(t,n),lu(t,e))}function e5(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}function t5(t,e){var r=t._writableState,n=r.sync,i=r.writecb;if(typeof i!="function")throw new U4;if(e5(r),e)Q4(t,r,n,e,i);else{var o=uE(r)||t.destroyed;!o&&!r.corked&&!r.bufferProcessing&&r.bufferedRequest&&aE(t,r),n?process.nextTick(iE,t,r,o,i):iE(t,r,o,i)}}function iE(t,e,r,n){r||r5(t,e),e.pendingcb--,n(),lu(t,e)}function r5(t,e){e.length===0&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}function aE(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,ng(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 oE(e),e.bufferedRequestCount=0}else{for(;r;){var u=r.chunk,c=r.encoding,l=r.callback,f=e.objectMode?1:u.length;if(ng(t,e,!1,f,u,c,l),r=r.next,e.bufferedRequestCount--,e.writing)break}r===null&&(e.lastBufferedRequest=null)}e.bufferedRequest=r,e.bufferProcessing=!1}Je.prototype._write=function(t,e,r){r(new M4("_write()"))};Je.prototype._writev=null;Je.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||o5(this,n,r),this};Object.defineProperty(Je.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function uE(t){return t.ending&&t.length===0&&t.bufferedRequest===null&&!t.finished&&!t.writing}function n5(t,e){t._final(function(r){e.pendingcb--,r&&Zo(t,r),e.prefinished=!0,t.emit("prefinish"),lu(t,e)})}function i5(t,e){!e.prefinished&&!e.finalCalled&&(typeof t._final=="function"&&!e.destroyed?(e.pendingcb++,e.finalCalled=!0,process.nextTick(n5,t,e)):(e.prefinished=!0,t.emit("prefinish")))}function lu(t,e){var r=uE(e);if(r&&(i5(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 o5(t,e,r){e.ending=!0,lu(t,e),r&&(e.finished?process.nextTick(r):t.once("finish",r)),e.ended=!0,t.writable=!1}function s5(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(Je.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}});Je.prototype.destroy=ig.destroy;Je.prototype._undestroy=ig.undestroy;Je.prototype._destroy=function(t,e){e(t)}});var Ti=y(($le,fE)=>{"use strict";var a5=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};fE.exports=Ur;var lE=ug(),ag=og();Jo()(Ur,lE);for(sg=a5(ag.prototype),Ll=0;Ll<sg.length;Ll++)Bl=sg[Ll],Ur.prototype[Bl]||(Ur.prototype[Bl]=ag.prototype[Bl]);var sg,Bl,Ll;function Ur(t){if(!(this instanceof Ur))return new Ur(t);lE.call(this,t),ag.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",u5)))}Object.defineProperty(Ur.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});Object.defineProperty(Ur.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});Object.defineProperty(Ur.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function u5(){this._writableState.ended||process.nextTick(c5,this)}function c5(t){t.end()}Object.defineProperty(Ur.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(e){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=e,this._writableState.destroyed=e)}})});var pE=y((cg,hE)=>{var ql=require("buffer"),Vr=ql.Buffer;function dE(t,e){for(var r in t)e[r]=t[r]}Vr.from&&Vr.alloc&&Vr.allocUnsafe&&Vr.allocUnsafeSlow?hE.exports=ql:(dE(ql,cg),cg.Buffer=Pi);function Pi(t,e,r){return Vr(t,e,r)}Pi.prototype=Object.create(Vr.prototype);dE(Vr,Pi);Pi.from=function(t,e,r){if(typeof t=="number")throw new TypeError("Argument must not be a number");return Vr(t,e,r)};Pi.alloc=function(t,e,r){if(typeof t!="number")throw new TypeError("Argument must be a number");var n=Vr(t);return e!==void 0?typeof r=="string"?n.fill(e,r):n.fill(e):n.fill(0),n};Pi.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return Vr(t)};Pi.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return ql.SlowBuffer(t)}});var dg=y(gE=>{"use strict";var fg=pE().Buffer,mE=fg.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 l5(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 f5(t){var e=l5(t);if(typeof e!="string"&&(fg.isEncoding===mE||!mE(t)))throw new Error("Unknown encoding: "+t);return e||t}gE.StringDecoder=du;function du(t){this.encoding=f5(t);var e;switch(this.encoding){case"utf16le":this.text=y5,this.end=D5,e=4;break;case"utf8":this.fillLast=p5,e=4;break;case"base64":this.text=v5,this.end=b5,e=3;break;default:this.write=w5,this.end=_5;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=fg.allocUnsafe(e)}du.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||""};du.prototype.end=g5;du.prototype.text=m5;du.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 lg(t){return t<=127?0:t>>5===6?2:t>>4===14?3:t>>3===30?4:t>>6===2?-1:-2}function d5(t,e,r){var n=e.length-1;if(n<r)return 0;var i=lg(e[n]);return i>=0?(i>0&&(t.lastNeed=i-1),i):--n<r||i===-2?0:(i=lg(e[n]),i>=0?(i>0&&(t.lastNeed=i-2),i):--n<r||i===-2?0:(i=lg(e[n]),i>=0?(i>0&&(i===2?i=0:t.lastNeed=i-3),i):0))}function h5(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 p5(t){var e=this.lastTotal-this.lastNeed,r=h5(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 m5(t,e){var r=d5(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 g5(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"\uFFFD":e}function y5(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 D5(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 v5(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 b5(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function w5(t){return t.toString(this.encoding)}function _5(t){return t&&t.length?this.write(t):""}});var Ml=y((jle,vE)=>{"use strict";var yE=Yn().codes.ERR_STREAM_PREMATURE_CLOSE;function E5(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 C5(){}function S5(t){return t.setHeader&&typeof t.abort=="function"}function DE(t,e,r){if(typeof e=="function")return DE(t,null,e);e||(e={}),r=E5(r||C5);var n=e.readable||e.readable!==!1&&t.readable,i=e.writable||e.writable!==!1&&t.writable,o=function(){t.writable||a()},s=t._writableState&&t._writableState.finished,a=function(){i=!1,s=!0,n||r.call(t)},u=t._readableState&&t._readableState.endEmitted,c=function(){n=!1,u=!0,i||r.call(t)},l=function(m){r.call(t,m)},f=function(){var m;if(n&&!u)return(!t._readableState||!t._readableState.ended)&&(m=new yE),r.call(t,m);if(i&&!s)return(!t._writableState||!t._writableState.ended)&&(m=new yE),r.call(t,m)},h=function(){t.req.on("finish",a)};return S5(t)?(t.on("complete",a),t.on("abort",f),t.req?h():t.on("request",h)):i&&!t._writableState&&(t.on("end",o),t.on("close",o)),t.on("end",c),t.on("finish",a),e.error!==!1&&t.on("error",l),t.on("close",f),function(){t.removeListener("complete",a),t.removeListener("abort",f),t.removeListener("request",h),t.req&&t.req.removeListener("finish",a),t.removeListener("end",o),t.removeListener("close",o),t.removeListener("finish",a),t.removeListener("end",c),t.removeListener("error",l),t.removeListener("close",f)}}vE.exports=DE});var wE=y((Nle,bE)=>{"use strict";var Ul;function Xn(t,e,r){return e=x5(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function x5(t){var e=F5(t,"string");return typeof e=="symbol"?e:String(e)}function F5(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 O5=Ml(),Zn=Symbol("lastResolve"),Ri=Symbol("lastReject"),hu=Symbol("error"),Vl=Symbol("ended"),$i=Symbol("lastPromise"),hg=Symbol("handlePromise"),Ii=Symbol("stream");function Qn(t,e){return{value:t,done:e}}function A5(t){var e=t[Zn];if(e!==null){var r=t[Ii].read();r!==null&&(t[$i]=null,t[Zn]=null,t[Ri]=null,e(Qn(r,!1)))}}function k5(t){process.nextTick(A5,t)}function T5(t,e){return function(r,n){t.then(function(){if(e[Vl]){r(Qn(void 0,!0));return}e[hg](r,n)},n)}}var P5=Object.getPrototypeOf(function(){}),R5=Object.setPrototypeOf((Ul={get stream(){return this[Ii]},next:function(){var e=this,r=this[hu];if(r!==null)return Promise.reject(r);if(this[Vl])return Promise.resolve(Qn(void 0,!0));if(this[Ii].destroyed)return new Promise(function(s,a){process.nextTick(function(){e[hu]?a(e[hu]):s(Qn(void 0,!0))})});var n=this[$i],i;if(n)i=new Promise(T5(n,this));else{var o=this[Ii].read();if(o!==null)return Promise.resolve(Qn(o,!1));i=new Promise(this[hg])}return this[$i]=i,i}},Xn(Ul,Symbol.asyncIterator,function(){return this}),Xn(Ul,"return",function(){var e=this;return new Promise(function(r,n){e[Ii].destroy(null,function(i){if(i){n(i);return}r(Qn(void 0,!0))})})}),Ul),P5),$5=function(e){var r,n=Object.create(R5,(r={},Xn(r,Ii,{value:e,writable:!0}),Xn(r,Zn,{value:null,writable:!0}),Xn(r,Ri,{value:null,writable:!0}),Xn(r,hu,{value:null,writable:!0}),Xn(r,Vl,{value:e._readableState.endEmitted,writable:!0}),Xn(r,hg,{value:function(o,s){var a=n[Ii].read();a?(n[$i]=null,n[Zn]=null,n[Ri]=null,o(Qn(a,!1))):(n[Zn]=o,n[Ri]=s)},writable:!0}),r));return n[$i]=null,O5(e,function(i){if(i&&i.code!=="ERR_STREAM_PREMATURE_CLOSE"){var o=n[Ri];o!==null&&(n[$i]=null,n[Zn]=null,n[Ri]=null,o(i)),n[hu]=i;return}var s=n[Zn];s!==null&&(n[$i]=null,n[Zn]=null,n[Ri]=null,s(Qn(void 0,!0))),n[Vl]=!0}),e.on("readable",k5.bind(null,n)),n};bE.exports=$5});var SE=y((Lle,CE)=>{"use strict";function _E(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(c){r(c);return}a.done?e(u):Promise.resolve(u).then(n,i)}function I5(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function s(u){_E(o,n,i,s,a,"next",u)}function a(u){_E(o,n,i,s,a,"throw",u)}s(void 0)})}}function EE(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 j5(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?EE(Object(r),!0).forEach(function(n){N5(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):EE(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function N5(t,e,r){return e=L5(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function L5(t){var e=B5(t,"string");return typeof e=="symbol"?e:String(e)}function B5(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 q5=Yn().codes.ERR_INVALID_ARG_TYPE;function M5(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 q5("iterable",["Iterable"],e);var i=new t(j5({objectMode:!0},r)),o=!1;i._read=function(){o||(o=!0,s())};function s(){return a.apply(this,arguments)}function a(){return a=I5(function*(){try{var u=yield n.next(),c=u.value,l=u.done;l?i.push(null):i.push(yield c)?s():o=!1}catch(f){i.destroy(f)}}),a.apply(this,arguments)}return i}CE.exports=M5});var ug=y((qle,IE)=>{"use strict";IE.exports=ge;var Qo;ge.ReadableState=AE;var Ble=require("events").EventEmitter,OE=function(e,r){return e.listeners(r).length},mu=Ym(),Hl=require("buffer").Buffer,U5=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function V5(t){return Hl.from(t)}function H5(t){return Hl.isBuffer(t)||t instanceof U5}var pg=require("util"),ue;pg&&pg.debuglog?ue=pg.debuglog("stream"):ue=function(){};var z5=K_(),wg=Zm(),G5=Qm(),W5=G5.getHighWaterMark,zl=Yn().codes,K5=zl.ERR_INVALID_ARG_TYPE,Y5=zl.ERR_STREAM_PUSH_AFTER_EOF,J5=zl.ERR_METHOD_NOT_IMPLEMENTED,X5=zl.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,es,mg,gg;Jo()(ge,mu);var pu=wg.errorOrDestroy,yg=["error","close","destroy","pause","resume"];function Z5(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 AE(t,e,r){Qo=Qo||Ti(),t=t||{},typeof r!="boolean"&&(r=e instanceof Qo),this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=W5(this,t,"readableHighWaterMark",r),this.buffer=new z5,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&&(es||(es=dg().StringDecoder),this.decoder=new es(t.encoding),this.encoding=t.encoding)}function ge(t){if(Qo=Qo||Ti(),!(this instanceof ge))return new ge(t);var e=this instanceof Qo;this._readableState=new AE(t,this,e),this.readable=!0,t&&(typeof t.read=="function"&&(this._read=t.read),typeof t.destroy=="function"&&(this._destroy=t.destroy)),mu.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=wg.destroy;ge.prototype._undestroy=wg.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=Hl.from(t,e),e=""),n=!0),kE(this,t,e,!1,n)};ge.prototype.unshift=function(t){return kE(this,t,null,!0,!1)};function kE(t,e,r,n,i){ue("readableAddChunk",e);var o=t._readableState;if(e===null)o.reading=!1,tU(t,o);else{var s;if(i||(s=Q5(o,e)),s)pu(t,s);else if(o.objectMode||e&&e.length>0)if(typeof e!="string"&&!o.objectMode&&Object.getPrototypeOf(e)!==Hl.prototype&&(e=V5(e)),n)o.endEmitted?pu(t,new X5):Dg(t,o,e,!0);else if(o.ended)pu(t,new Y5);else{if(o.destroyed)return!1;o.reading=!1,o.decoder&&!r?(e=o.decoder.write(e),o.objectMode||e.length!==0?Dg(t,o,e,!1):bg(t,o)):Dg(t,o,e,!1)}else n||(o.reading=!1,bg(t,o))}return!o.ended&&(o.length<o.highWaterMark||o.length===0)}function Dg(t,e,r,n){e.flowing&&e.length===0&&!e.sync?(e.awaitDrain=0,t.emit("data",r)):(e.length+=e.objectMode?1:r.length,n?e.buffer.unshift(r):e.buffer.push(r),e.needReadable&&Gl(t)),bg(t,e)}function Q5(t,e){var r;return!H5(e)&&typeof e!="string"&&e!==void 0&&!t.objectMode&&(r=new K5("chunk",["string","Buffer","Uint8Array"],e)),r}ge.prototype.isPaused=function(){return this._readableState.flowing===!1};ge.prototype.setEncoding=function(t){es||(es=dg().StringDecoder);var e=new es(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 xE=1073741824;function eU(t){return t>=xE?t=xE:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}function FE(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=eU(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}ge.prototype.read=function(t){ue("read",t),t=parseInt(t,10);var e=this._readableState,r=t;if(t!==0&&(e.emittedReadable=!1),t===0&&e.needReadable&&((e.highWaterMark!==0?e.length>=e.highWaterMark:e.length>0)||e.ended))return ue("read: emitReadable",e.length,e.ended),e.length===0&&e.ended?vg(this):Gl(this),null;if(t=FE(t,e),t===0&&e.ended)return e.length===0&&vg(this),null;var n=e.needReadable;ue("need readable",n),(e.length===0||e.length-t<e.highWaterMark)&&(n=!0,ue("length less than watermark",n)),e.ended||e.reading?(n=!1,ue("reading or ended",n)):n&&(ue("do read"),e.reading=!0,e.sync=!0,e.length===0&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1,e.reading||(t=FE(r,e)));var i;return t>0?i=RE(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&&vg(this)),i!==null&&this.emit("data",i),i};function tU(t,e){if(ue("onEofChunk"),!e.ended){if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,e.sync?Gl(t):(e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,TE(t)))}}function Gl(t){var e=t._readableState;ue("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(ue("emitReadable",e.flowing),e.emittedReadable=!0,process.nextTick(TE,t))}function TE(t){var e=t._readableState;ue("emitReadable_",e.destroyed,e.length,e.ended),!e.destroyed&&(e.length||e.ended)&&(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,_g(t)}function bg(t,e){e.readingMore||(e.readingMore=!0,process.nextTick(rU,t,e))}function rU(t,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&e.length===0);){var r=e.length;if(ue("maybeReadMore read 0"),t.read(0),r===e.length)break}e.readingMore=!1}ge.prototype._read=function(t){pu(this,new J5("_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,ue("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(g,w){ue("onunpipe"),g===r&&w&&w.hasUnpiped===!1&&(w.hasUnpiped=!0,l())}function a(){ue("onend"),t.end()}var u=nU(r);t.on("drain",u);var c=!1;function l(){ue("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),c=!0,n.awaitDrain&&(!t._writableState||t._writableState.needDrain)&&u()}r.on("data",f);function f(g){ue("ondata");var w=t.write(g);ue("dest.write",w),w===!1&&((n.pipesCount===1&&n.pipes===t||n.pipesCount>1&&$E(n.pipes,t)!==-1)&&!c&&(ue("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function h(g){ue("onerror",g),b(),t.removeListener("error",h),OE(t,"error")===0&&pu(t,g)}Z5(t,"error",h);function d(){t.removeListener("finish",m),b()}t.once("close",d);function m(){ue("onfinish"),t.removeListener("close",d),b()}t.once("finish",m);function b(){ue("unpipe"),r.unpipe(t)}return t.emit("pipe",r),n.flowing||(ue("pipe resume"),r.resume()),t};function nU(t){return function(){var r=t._readableState;ue("pipeOnDrain",r.awaitDrain),r.awaitDrain&&r.awaitDrain--,r.awaitDrain===0&&OE(t,"data")&&(r.flowing=!0,_g(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=$E(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=mu.prototype.on.call(this,t,e),n=this._readableState;return t==="data"?(n.readableListening=this.listenerCount("readable")>0,n.flowing!==!1&&this.resume()):t==="readable"&&!n.endEmitted&&!n.readableListening&&(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,ue("on readable",n.length,n.reading),n.length?Gl(this):n.reading||process.nextTick(iU,this)),r};ge.prototype.addListener=ge.prototype.on;ge.prototype.removeListener=function(t,e){var r=mu.prototype.removeListener.call(this,t,e);return t==="readable"&&process.nextTick(PE,this),r};ge.prototype.removeAllListeners=function(t){var e=mu.prototype.removeAllListeners.apply(this,arguments);return(t==="readable"||t===void 0)&&process.nextTick(PE,this),e};function PE(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 iU(t){ue("readable nexttick read 0"),t.read(0)}ge.prototype.resume=function(){var t=this._readableState;return t.flowing||(ue("resume"),t.flowing=!t.readableListening,oU(this,t)),t.paused=!1,this};function oU(t,e){e.resumeScheduled||(e.resumeScheduled=!0,process.nextTick(sU,t,e))}function sU(t,e){ue("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),_g(t),e.flowing&&!e.reading&&t.read(0)}ge.prototype.pause=function(){return ue("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(ue("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function _g(t){var e=t._readableState;for(ue("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(ue("wrapped end"),r.decoder&&!r.ended){var s=r.decoder.end();s&&s.length&&e.push(s)}e.push(null)}),t.on("data",function(s){if(ue("wrapped data"),r.decoder&&(s=r.decoder.write(s)),!(r.objectMode&&s==null)&&!(!r.objectMode&&(!s||!s.length))){var a=e.push(s);a||(n=!0,t.pause())}});for(var i in t)this[i]===void 0&&typeof t[i]=="function"&&(this[i]=function(a){return function(){return t[a].apply(t,arguments)}}(i));for(var o=0;o<yg.length;o++)t.on(yg[o],this.emit.bind(this,yg[o]));return this._read=function(s){ue("wrapped _read",s),n&&(n=!1,t.resume())},this};typeof Symbol=="function"&&(ge.prototype[Symbol.asyncIterator]=function(){return mg===void 0&&(mg=wE()),mg(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=RE;Object.defineProperty(ge.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function RE(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 vg(t){var e=t._readableState;ue("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,process.nextTick(aU,e,t))}function aU(t,e){if(ue("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&t.length===0&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var r=e._writableState;(!r||r.autoDestroy&&r.finished)&&e.destroy()}}typeof Symbol=="function"&&(ge.from=function(t,e){return gg===void 0&&(gg=SE()),gg(ge,t,e)});function $E(t,e){for(var r=0,n=t.length;r<n;r++)if(t[r]===e)return r;return-1}});var Eg=y((Mle,NE)=>{"use strict";NE.exports=Dn;var Wl=Yn().codes,uU=Wl.ERR_METHOD_NOT_IMPLEMENTED,cU=Wl.ERR_MULTIPLE_CALLBACK,lU=Wl.ERR_TRANSFORM_ALREADY_TRANSFORMING,fU=Wl.ERR_TRANSFORM_WITH_LENGTH_0,Kl=Ti();Jo()(Dn,Kl);function dU(t,e){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(n===null)return this.emit("error",new cU);r.writechunk=null,r.writecb=null,e!=null&&this.push(e),n(t);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function Dn(t){if(!(this instanceof Dn))return new Dn(t);Kl.call(this,t),this._transformState={afterTransform:dU.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",hU)}function hU(){var t=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(e,r){jE(t,e,r)}):jE(this,null,null)}Dn.prototype.push=function(t,e){return this._transformState.needTransform=!1,Kl.prototype.push.call(this,t,e)};Dn.prototype._transform=function(t,e,r){r(new uU("_transform()"))};Dn.prototype._write=function(t,e,r){var n=this._transformState;if(n.writecb=r,n.writechunk=t,n.writeencoding=e,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}};Dn.prototype._read=function(t){var e=this._transformState;e.writechunk!==null&&!e.transforming?(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform)):e.needTransform=!0};Dn.prototype._destroy=function(t,e){Kl.prototype._destroy.call(this,t,function(r){e(r)})};function jE(t,e,r){if(e)return t.emit("error",e);if(r!=null&&t.push(r),t._writableState.length)throw new fU;if(t._transformState.transforming)throw new lU;return t.push(null)}});var qE=y((Ule,BE)=>{"use strict";BE.exports=gu;var LE=Eg();Jo()(gu,LE);function gu(t){if(!(this instanceof gu))return new gu(t);LE.call(this,t)}gu.prototype._transform=function(t,e,r){r(null,t)}});var zE=y((Vle,HE)=>{"use strict";var Cg;function pU(t){var e=!1;return function(){e||(e=!0,t.apply(void 0,arguments))}}var VE=Yn().codes,mU=VE.ERR_MISSING_ARGS,gU=VE.ERR_STREAM_DESTROYED;function ME(t){if(t)throw t}function yU(t){return t.setHeader&&typeof t.abort=="function"}function DU(t,e,r,n){n=pU(n);var i=!1;t.on("close",function(){i=!0}),Cg===void 0&&(Cg=Ml()),Cg(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,yU(t))return t.abort();if(typeof t.destroy=="function")return t.destroy();n(s||new gU("pipe"))}}}function UE(t){t()}function vU(t,e){return t.pipe(e)}function bU(t){return!t.length||typeof t[t.length-1]!="function"?ME:t.pop()}function wU(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];var n=bU(e);if(Array.isArray(e[0])&&(e=e[0]),e.length<2)throw new mU("streams");var i,o=e.map(function(s,a){var u=a<e.length-1,c=a>0;return DU(s,u,c,function(l){i||(i=l),l&&o.forEach(UE),!u&&(o.forEach(UE),n(i))})});return e.reduce(vU)}HE.exports=wU});var GE=y((yr,Du)=>{var yu=require("stream");process.env.READABLE_STREAM==="disable"&&yu?(Du.exports=yu.Readable,Object.assign(Du.exports,yu),Du.exports.Stream=yu):(yr=Du.exports=ug(),yr.Stream=yu||yr,yr.Readable=yr,yr.Writable=og(),yr.Duplex=Ti(),yr.Transform=Eg(),yr.PassThrough=qE(),yr.finished=Ml(),yr.pipeline=zE())});var xg=y(Sg=>{var WE;(function(t){typeof DO_NOT_EXPORT_CRC>"u"?typeof Sg=="object"?t(Sg):typeof define=="function"&&define.amd?define(function(){var e={};return t(e),e}):t(WE={}):t(WE={})})(function(t){t.version="1.2.2";function e(){for(var F=0,L=new Array(256),S=0;S!=256;++S)F=S,F=F&1?-306674912^F>>>1:F>>>1,F=F&1?-306674912^F>>>1:F>>>1,F=F&1?-306674912^F>>>1:F>>>1,F=F&1?-306674912^F>>>1:F>>>1,F=F&1?-306674912^F>>>1:F>>>1,F=F&1?-306674912^F>>>1:F>>>1,F=F&1?-306674912^F>>>1:F>>>1,F=F&1?-306674912^F>>>1:F>>>1,L[S]=F;return typeof Int32Array<"u"?new Int32Array(L):L}var r=e();function n(F){var L=0,S=0,I=0,R=typeof Int32Array<"u"?new Int32Array(4096):new Array(4096);for(I=0;I!=256;++I)R[I]=F[I];for(I=0;I!=256;++I)for(S=F[I],L=256+I;L<4096;L+=256)S=R[L]=S>>>8^F[S&255];var B=[];for(I=1;I!=16;++I)B[I-1]=typeof Int32Array<"u"?R.subarray(I*256,I*256+256):R.slice(I*256,I*256+256);return B}var i=n(r),o=i[0],s=i[1],a=i[2],u=i[3],c=i[4],l=i[5],f=i[6],h=i[7],d=i[8],m=i[9],b=i[10],g=i[11],w=i[12],x=i[13],D=i[14];function C(F,L){for(var S=L^-1,I=0,R=F.length;I<R;)S=S>>>8^r[(S^F.charCodeAt(I++))&255];return~S}function k(F,L){for(var S=L^-1,I=F.length-15,R=0;R<I;)S=D[F[R++]^S&255]^x[F[R++]^S>>8&255]^w[F[R++]^S>>16&255]^g[F[R++]^S>>>24]^b[F[R++]]^m[F[R++]]^d[F[R++]]^h[F[R++]]^f[F[R++]]^l[F[R++]]^c[F[R++]]^u[F[R++]]^a[F[R++]]^s[F[R++]]^o[F[R++]]^r[F[R++]];for(I+=15;R<I;)S=S>>>8^r[(S^F[R++])&255];return~S}function $(F,L){for(var S=L^-1,I=0,R=F.length,B=0,q=0;I<R;)B=F.charCodeAt(I++),B<128?S=S>>>8^r[(S^B)&255]:B<2048?(S=S>>>8^r[(S^(192|B>>6&31))&255],S=S>>>8^r[(S^(128|B&63))&255]):B>=55296&&B<57344?(B=(B&1023)+64,q=F.charCodeAt(I++)&1023,S=S>>>8^r[(S^(240|B>>8&7))&255],S=S>>>8^r[(S^(128|B>>2&63))&255],S=S>>>8^r[(S^(128|q>>6&15|(B&3)<<4))&255],S=S>>>8^r[(S^(128|q&63))&255]):(S=S>>>8^r[(S^(224|B>>12&15))&255],S=S>>>8^r[(S^(128|B>>6&63))&255],S=S>>>8^r[(S^(128|B&63))&255]);return~S}t.table=r,t.bstr=C,t.buf=k,t.str=$})});var YE=y((zle,KE)=>{"use strict";var{Transform:_U}=GE(),EU=xg(),Fg=class extends _U{constructor(e){super(e),this.checksum=Buffer.allocUnsafe(4),this.checksum.writeInt32BE(0,0),this.rawSize=0}_transform(e,r,n){e&&(this.checksum=EU.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}};KE.exports=Fg});var XE=y((Gle,JE)=>{"use strict";var{DeflateRaw:CU}=require("zlib"),SU=xg(),Og=class extends CU{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=SU.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}};JE.exports=Og});var QE=y((Wle,ZE)=>{"use strict";ZE.exports={CRC32Stream:YE(),DeflateCRC32Stream:XE()}});var vu=y(ts=>{"use strict";Object.defineProperty(ts,"__esModule",{value:!0});ts.checksum=ts.checksumFile=void 0;var xU=require("fs"),FU=require("crypto"),tC=require("stream"),OU=require("util"),{CRC32Stream:AU}=QE(),eC=(0,OU.promisify)(tC.pipeline),kU=(t,e,r)=>rC(xU.createReadStream(t),e,r);ts.checksumFile=kU;async function rC(t,e,r="hex"){let n=PU(t);if(e==="crc32"){let o=new AU,s=eC(n,o);return o.resume(),await s,o.end(),Buffer.from(o.digest()).toString(r)}let i=(0,FU.createHash)(e);return await eC(n,i),i.end(),i.digest(r)}ts.checksum=rC;function TU(t){return t!=null&&typeof t=="object"&&typeof t.read=="function"&&typeof t.pipe=="function"}var PU=t=>TU(t)?t:new tC.Readable({read(){this.push(t),this.push(null)}})});var Ag=y((Yle,nC)=>{nC.exports={LOCHDR:30,LOCSIG:67324752,LOCVER:4,LOCFLG:6,LOCHOW:8,LOCTIM:10,LOCCRC:14,LOCSIZ:18,LOCLEN:22,LOCNAM:26,LOCEXT:28,EXTSIG:134695760,EXTHDR:16,EXTCRC:4,EXTSIZ:8,EXTLEN:12,CENHDR:46,CENSIG:33639248,CENVEM:4,CENVER:6,CENFLG:8,CENHOW:10,CENTIM:12,CENCRC:16,CENSIZ:20,CENLEN:24,CENNAM:28,CENEXT:30,CENCOM:32,CENDSK:34,CENATT:36,CENATX:38,CENOFF:42,ENDHDR:22,ENDSIG:101010256,ENDSUB:8,ENDTOT:10,ENDSIZ:12,ENDOFF:16,ENDCOM:20,END64HDR:20,END64SIG:117853008,END64START:4,END64OFF:8,END64NUMDISKS:16,ZIP64SIG:101075792,ZIP64HDR:56,ZIP64LEAD:12,ZIP64SIZE:4,ZIP64VEM:12,ZIP64VER:14,ZIP64DSK:16,ZIP64DSKDIR:20,ZIP64SUB:24,ZIP64TOT:32,ZIP64SIZB:40,ZIP64OFF:48,ZIP64EXTRA:56,STORED:0,SHRUNK:1,REDUCED1:2,REDUCED2:3,REDUCED3:4,REDUCED4:5,IMPLODED:6,DEFLATED:8,ENHANCED_DEFLATED:9,PKWARE:10,BZIP2:12,LZMA:14,IBM_TERSE:18,IBM_LZ77:19,AES_ENCRYPT:99,FLG_ENC:1,FLG_COMP1:2,FLG_COMP2:4,FLG_DESC:8,FLG_ENH:16,FLG_PATCH:32,FLG_STR:64,FLG_EFS:2048,FLG_MSK:4096,FILE:2,BUFFER:1,NONE:0,EF_ID:0,EF_SIZE:2,ID_ZIP64:1,ID_AVINFO:7,ID_PFS:8,ID_OS2:9,ID_NTFS:10,ID_OPENVMS:12,ID_UNIX:13,ID_FORK:14,ID_PATCH:15,ID_X509_PKCS7:20,ID_X509_CERTID_F:21,ID_X509_CERTID_C:22,ID_STRONGENC:23,ID_RECORD_MGT:24,ID_X509_PKCS7_RL:25,ID_IBM1:101,ID_IBM2:102,ID_POSZIP:18064,EF_ZIP64_OR_32:4294967295,EF_ZIP64_OR_16:65535,EF_ZIP64_SUNCOMP:0,EF_ZIP64_SCOMP:8,EF_ZIP64_RHO:16,EF_ZIP64_DSN:24}});var Yl=y(oC=>{var iC={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 RU(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(iC))oC[t]=RU(iC[t])});var lC=y((Xle,cC)=>{var $U=require("fs"),ut=require("path"),sC=Ag(),IU=Yl(),jU=typeof process=="object"&&process.platform==="win32",aC=t=>typeof t=="object"&&t!==null,uC=new Uint32Array(256).map((t,e)=>{for(let r=0;r<8;r++)e&1?e=3988292384^e>>>1:e>>>=1;return e>>>0});function Xe(t){this.sep=ut.sep,this.fs=$U,aC(t)&&aC(t.fs)&&typeof t.fs.statSync=="function"&&(this.fs=t.fs)}cC.exports=Xe;Xe.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 IU.FILE_IN_THE_WAY(`"${i}"`)}})}r(t)};Xe.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=ut.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};Xe.prototype.writeFileToAsync=function(t,e,r,n,i){typeof n=="function"&&(i=n,n=void 0);let o=this;o.fs.exists(t,function(s){if(s&&!r)return i(!1);o.fs.stat(t,function(a,u){if(s&&u.isDirectory())return i(!1);var c=ut.dirname(t);o.fs.exists(c,function(l){l||o.makeDir(c),o.fs.open(t,"w",438,function(f,h){f?o.fs.chmod(t,438,function(){o.fs.open(t,"w",438,function(d,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)})})})})})};Xe.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=ut.join(n,a),c=e.fs.statSync(u);(!i||i.test(u))&&s.push(ut.normalize(u)+(c.isDirectory()?e.sep:"")),c.isDirectory()&&o&&(s=s.concat(r(u,i,o)))}),s}return r(t,void 0,!0)};Xe.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=ut.join(t,a),r.fs.stat(a,function(u,c){if(u)return e(u);c&&(n.push(ut.normalize(a)+(c.isDirectory()?r.sep:"")),c.isDirectory()?r.findFilesAsync(a,function(l,f){if(l)return e(l);n=n.concat(f),--s||e(null,n)}):--s||e(null,n))})})})};Xe.prototype.getAttributes=function(){};Xe.prototype.setAttributes=function(){};Xe.crc32update=function(t,e){return uC[(t^e)&255]^t>>>8};Xe.crc32=function(t){typeof t=="string"&&(t=Buffer.from(t,"utf8"));let e=t.length,r=-1;for(let n=0;n<e;)r=Xe.crc32update(r,t[n++]);return~r>>>0};Xe.methodToString=function(t){switch(t){case sC.STORED:return"STORED ("+t+")";case sC.DEFLATED:return"DEFLATED ("+t+")";default:return"UNSUPPORTED ("+t+")"}};Xe.canonical=function(t){if(!t)return"";let e=ut.posix.normalize("/"+t.split("\\").join("/"));return ut.join(".",e)};Xe.zipnamefix=function(t){if(!t)return"";let e=ut.posix.normalize("/"+t.split("\\").join("/"));return ut.posix.join(".",e)};Xe.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]};Xe.sanitize=function(t,e){t=ut.resolve(ut.normalize(t));for(var r=e.split("/"),n=0,i=r.length;n<i;n++){var o=ut.normalize(ut.join(t,r.slice(n,i).join(ut.sep)));if(o.indexOf(t)===0)return o}return ut.normalize(ut.join(t,ut.basename(e)))};Xe.toBuffer=function(e,r){return Buffer.isBuffer(e)?e:e instanceof Uint8Array?Buffer.from(e):typeof e=="string"?r(e):Buffer.alloc(0)};Xe.readBigUInt64LE=function(t,e){var r=Buffer.from(t.slice(e,e+8));return r.swap64(),parseInt(`0x${r.toString("hex")}`)};Xe.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)};Xe.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};Xe.isWin=jU;Xe.crcTable=uC});var dC=y((Zle,fC)=>{var NU=require("path");fC.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=NU.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 pC=y((Qle,hC)=>{hC.exports={efs:!0,encode:t=>Buffer.from(t,"utf8"),decode:t=>t.toString("utf8")}});var ns=y((efe,rs)=>{rs.exports=lC();rs.exports.Constants=Ag();rs.exports.Errors=Yl();rs.exports.FileAttr=dC();rs.exports.decoder=pC()});var gC=y((tfe,mC)=>{var ei=ns(),H=ei.Constants;mC.exports=function(){var t=20,e=10,r=0,n=0,i=0,o=0,s=0,a=0,u=0,c=0,l=0,f=0,h=0,d=0,m=0;t|=ei.isWin?2560:768,r|=H.FLG_EFS;let b={extraLen:0},g=D=>Math.max(0,D)>>>0,w=D=>Math.max(0,D)&65535,x=D=>Math.max(0,D)&255;return i=ei.fromDate2DOS(new Date),{get made(){return t},set made(D){t=D},get version(){return e},set version(D){e=D},get flags(){return r},set flags(D){r=D},get flags_efs(){return(r&H.FLG_EFS)>0},set flags_efs(D){D?r|=H.FLG_EFS:r&=~H.FLG_EFS},get flags_desc(){return(r&H.FLG_DESC)>0},set flags_desc(D){D?r|=H.FLG_DESC:r&=~H.FLG_DESC},get method(){return n},set method(D){switch(D){case H.STORED:this.version=10;case H.DEFLATED:default:this.version=20}n=D},get time(){return ei.fromDOS2Date(this.timeval)},set time(D){this.timeval=ei.fromDate2DOS(D)},get timeval(){return i},set timeval(D){i=g(D)},get timeHighByte(){return x(i>>>8)},get crc(){return o},set crc(D){o=g(D)},get compressedSize(){return s},set compressedSize(D){s=g(D)},get size(){return a},set size(D){a=g(D)},get fileNameLength(){return u},set fileNameLength(D){u=D},get extraLength(){return c},set extraLength(D){c=D},get extraLocalLength(){return b.extraLen},set extraLocalLength(D){b.extraLen=D},get commentLength(){return l},set commentLength(D){l=D},get diskNumStart(){return f},set diskNumStart(D){f=g(D)},get inAttr(){return h},set inAttr(D){h=g(D)},get attr(){return d},set attr(D){d=g(D)},get fileAttr(){return(d||0)>>16&4095},get offset(){return m},set offset(D){m=g(D)},get encrypted(){return(r&H.FLG_ENC)===H.FLG_ENC},get centralHeaderSize(){return H.CENHDR+u+c+l},get realDataOffset(){return m+H.LOCHDR+b.fnameLen+b.extraLen},get localHeader(){return b},loadLocalHeaderFromBinary:function(D){var C=D.slice(m,m+H.LOCHDR);if(C.readUInt32LE(0)!==H.LOCSIG)throw ei.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 k=m+H.LOCHDR+b.fnameLen,$=k+b.extraLen;return D.slice(k,$)},loadFromBinary:function(D){if(D.length!==H.CENHDR||D.readUInt32LE(0)!==H.CENSIG)throw ei.Errors.INVALID_CEN();t=D.readUInt16LE(H.CENVEM),e=D.readUInt16LE(H.CENVER),r=D.readUInt16LE(H.CENFLG),n=D.readUInt16LE(H.CENHOW),i=D.readUInt32LE(H.CENTIM),o=D.readUInt32LE(H.CENCRC),s=D.readUInt32LE(H.CENSIZ),a=D.readUInt32LE(H.CENLEN),u=D.readUInt16LE(H.CENNAM),c=D.readUInt16LE(H.CENEXT),l=D.readUInt16LE(H.CENCOM),f=D.readUInt16LE(H.CENDSK),h=D.readUInt16LE(H.CENATT),d=D.readUInt32LE(H.CENATX),m=D.readUInt32LE(H.CENOFF)},localHeaderToBinary:function(){var D=Buffer.alloc(H.LOCHDR);return D.writeUInt32LE(H.LOCSIG,0),D.writeUInt16LE(e,H.LOCVER),D.writeUInt16LE(r,H.LOCFLG),D.writeUInt16LE(n,H.LOCHOW),D.writeUInt32LE(i,H.LOCTIM),D.writeUInt32LE(o,H.LOCCRC),D.writeUInt32LE(s,H.LOCSIZ),D.writeUInt32LE(a,H.LOCLEN),D.writeUInt16LE(u,H.LOCNAM),D.writeUInt16LE(b.extraLen,H.LOCEXT),D},centralHeaderToBinary:function(){var D=Buffer.alloc(H.CENHDR+u+c+l);return D.writeUInt32LE(H.CENSIG,0),D.writeUInt16LE(t,H.CENVEM),D.writeUInt16LE(e,H.CENVER),D.writeUInt16LE(r,H.CENFLG),D.writeUInt16LE(n,H.CENHOW),D.writeUInt32LE(i,H.CENTIM),D.writeUInt32LE(o,H.CENCRC),D.writeUInt32LE(s,H.CENSIZ),D.writeUInt32LE(a,H.CENLEN),D.writeUInt16LE(u,H.CENNAM),D.writeUInt16LE(c,H.CENEXT),D.writeUInt16LE(l,H.CENCOM),D.writeUInt16LE(f,H.CENDSK),D.writeUInt16LE(h,H.CENATT),D.writeUInt32LE(d,H.CENATX),D.writeUInt32LE(m,H.CENOFF),D},toJSON:function(){let D=function(C){return C+" bytes"};return{made:t,version:e,flags:r,method:ei.methodToString(n),time:this.time,crc:"0x"+o.toString(16).toUpperCase(),compressedSize:D(s),size:D(a),fileNameLength:D(u),extraLength:D(c),commentLength:D(l),diskNumStart:f,inAttr:h,attr:d,offset:m,centralHeaderSize:D(H.CENHDR+u+c+l)}},toString:function(){return JSON.stringify(this.toJSON(),null," ")}}}});var DC=y((rfe,yC)=>{var is=ns(),Ue=is.Constants;yC.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 Ue.ENDHDR+i},loadFromBinary:function(o){if((o.length!==Ue.ENDHDR||o.readUInt32LE(0)!==Ue.ENDSIG)&&(o.length<Ue.ZIP64HDR||o.readUInt32LE(0)!==Ue.ZIP64SIG))throw is.Errors.INVALID_END();o.readUInt32LE(0)===Ue.ENDSIG?(t=o.readUInt16LE(Ue.ENDSUB),e=o.readUInt16LE(Ue.ENDTOT),r=o.readUInt32LE(Ue.ENDSIZ),n=o.readUInt32LE(Ue.ENDOFF),i=o.readUInt16LE(Ue.ENDCOM)):(t=is.readBigUInt64LE(o,Ue.ZIP64SUB),e=is.readBigUInt64LE(o,Ue.ZIP64TOT),r=is.readBigUInt64LE(o,Ue.ZIP64SIZE),n=is.readBigUInt64LE(o,Ue.ZIP64OFF),i=0)},toBinary:function(){var o=Buffer.alloc(Ue.ENDHDR+i);return o.writeUInt32LE(Ue.ENDSIG,0),o.writeUInt32LE(0,4),o.writeUInt16LE(t,Ue.ENDSUB),o.writeUInt16LE(e,Ue.ENDTOT),o.writeUInt32LE(r,Ue.ENDSIZ),o.writeUInt32LE(n,Ue.ENDOFF),o.writeUInt16LE(i,Ue.ENDCOM),o.fill(" ",Ue.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 Tg=y(kg=>{kg.EntryHeader=gC();kg.MainHeader=DC()});var bC=y((ife,vC)=>{vC.exports=function(t){var e=require("zlib"),r={chunkSize:(parseInt(t.length/1024)+1)*1024};return{deflate:function(){return e.deflateRawSync(t,r)},deflateAsync:function(n){var i=e.createDeflateRaw(r),o=[],s=0;i.on("data",function(a){o.push(a),s+=a.length}),i.on("end",function(){var a=Buffer.alloc(s),u=0;a.fill(0);for(var c=0;c<o.length;c++){var l=o[c];l.copy(a,u),u+=l.length}n&&n(a)}),i.end(t)}}}});var _C=y((ofe,wC)=>{var LU=+(process.versions?process.versions.node:"").split(".")[0]||0;wC.exports=function(t,e){var r=require("zlib");let n=LU>=15&&e>0?{maxOutputLength:e}:{};return{inflate:function(){return r.inflateRawSync(t,n)},inflateAsync:function(i){var o=r.createInflateRaw(n),s=[],a=0;o.on("data",function(u){s.push(u),a+=u.length}),o.on("end",function(){var u=Buffer.alloc(a),c=0;u.fill(0);for(var l=0;l<s.length;l++){var f=s[l];f.copy(u,c),c+=f.length}i&&i(u)}),o.end(t)}}}});var FC=y((sfe,xC)=>{"use strict";var{randomFillSync:EC}=require("crypto"),BU=Yl(),qU=new Uint32Array(256).map((t,e)=>{for(let r=0;r<8;r++)e&1?e=e>>>1^3988292384:e>>>=1;return e>>>0}),SC=(t,e)=>Math.imul(t,e)>>>0,CC=(t,e)=>qU[(t^e)&255]^t>>>8,bu=()=>typeof EC=="function"?EC(Buffer.alloc(12)):bu.node();bu.node=()=>{let t=Buffer.alloc(12),e=t.length;for(let r=0;r<e;r++)t[r]=Math.random()*256&255;return t};var Jl={genSalt:bu};function Xl(t){let e=Buffer.isBuffer(t)?t:Buffer.from(t);this.keys=new Uint32Array([305419896,591751049,878082192]);for(let r=0;r<e.length;r++)this.updateKeys(e[r])}Xl.prototype.updateKeys=function(t){let e=this.keys;return e[0]=CC(e[0],t),e[1]+=e[0]&255,e[1]=SC(e[1],134775813)+1,e[2]=CC(e[2],e[1]>>>24),t};Xl.prototype.next=function(){let t=(this.keys[2]|2)>>>0;return SC(t,t^1)>>8&255};function MU(t){let e=new Xl(t);return function(r){let n=Buffer.alloc(r.length),i=0;for(let o of r)n[i++]=e.updateKeys(o^e.next());return n}}function UU(t){let e=new Xl(t);return function(r,n,i=0){n||(n=Buffer.alloc(r.length));for(let o of r){let s=e.next();n[i++]=o^s,e.updateKeys(o)}return n}}function VU(t,e,r){if(!t||!Buffer.isBuffer(t)||t.length<12)return Buffer.alloc(0);let n=MU(r),i=n(t.slice(0,12)),o=(e.flags&8)===8?e.timeHighByte:e.crc>>>24;if(i[11]!==o)throw BU.WRONG_PASSWORD();return n(t.slice(12))}function HU(t){Buffer.isBuffer(t)&&t.length>=12?Jl.genSalt=function(){return t.slice(0,12)}:t==="node"?Jl.genSalt=bu.node:Jl.genSalt=bu}function zU(t,e,r,n=!1){t==null&&(t=Buffer.alloc(0)),Buffer.isBuffer(t)||(t=Buffer.from(t.toString()));let i=UU(r),o=Jl.genSalt();o[11]=e.crc>>>24&255,n&&(o[10]=e.crc>>>16&255);let s=Buffer.alloc(t.length+12);return i(o,s),i(t,s,12)}xC.exports={decrypt:VU,encrypt:zU,_salter:HU}});var OC=y(Zl=>{Zl.Deflater=bC();Zl.Inflater=_C();Zl.ZipCrypto=FC()});var Rg=y((ufe,AC)=>{var be=ns(),GU=Tg(),Ze=be.Constants,Pg=OC();AC.exports=function(t,e){var r=new GU.EntryHeader,n=Buffer.alloc(0),i=Buffer.alloc(0),o=!1,s=null,a=Buffer.alloc(0),u=Buffer.alloc(0),c=!0;let l=t,f=typeof l.decoder=="object"?l.decoder:be.decoder;c=f.hasOwnProperty("efs")?f.efs:!1;function h(){return!e||!(e instanceof Uint8Array)?Buffer.alloc(0):(u=r.loadLocalHeaderFromBinary(e),e.slice(r.realDataOffset,r.realDataOffset+r.compressedSize))}function d(D){if(r.flags_desc){let C={},k=r.realDataOffset+r.compressedSize;if(e.readUInt32LE(k)==Ze.LOCSIG||e.readUInt32LE(k)==Ze.CENSIG)throw be.Errors.DESCRIPTOR_NOT_EXIST();if(e.readUInt32LE(k)==Ze.EXTSIG)C.crc=e.readUInt32LE(k+Ze.EXTCRC),C.compressedSize=e.readUInt32LE(k+Ze.EXTSIZ),C.size=e.readUInt32LE(k+Ze.EXTLEN);else if(e.readUInt16LE(k+12)===19280)C.crc=e.readUInt32LE(k+Ze.EXTCRC-4),C.compressedSize=e.readUInt32LE(k+Ze.EXTSIZ-4),C.size=e.readUInt32LE(k+Ze.EXTLEN-4);else throw be.Errors.DESCRIPTOR_UNKNOWN();if(C.compressedSize!==r.compressedSize||C.size!==r.size||C.crc!==r.crc)throw be.Errors.DESCRIPTOR_FAULTY();if(be.crc32(D)!==C.crc)return!1}else if(be.crc32(D)!==r.localHeader.crc)return!1;return!0}function m(D,C,k){if(typeof C>"u"&&typeof D=="string"&&(k=D,D=void 0),o)return D&&C&&C(Buffer.alloc(0),be.Errors.DIRECTORY_CONTENT_ERROR()),Buffer.alloc(0);var $=h();if($.length===0)return D&&C&&C($),$;if(r.encrypted){if(typeof k!="string"&&!Buffer.isBuffer(k))throw be.Errors.INVALID_PASS_PARAM();$=Pg.ZipCrypto.decrypt($,r,k)}var F=Buffer.alloc(r.size);switch(r.method){case be.Constants.STORED:if($.copy(F),d(F))return D&&C&&C(F),F;throw D&&C&&C(F,be.Errors.BAD_CRC()),be.Errors.BAD_CRC();case be.Constants.DEFLATED:var L=new Pg.Inflater($,r.size);if(D)L.inflateAsync(function(S){S.copy(S,0),C&&(d(S)?C(S):C(S,be.Errors.BAD_CRC()))});else{if(L.inflate(F).copy(F,0),!d(F))throw be.Errors.BAD_CRC(`"${f.decode(n)}"`);return F}break;default:throw D&&C&&C(Buffer.alloc(0),be.Errors.UNKNOWN_METHOD()),be.Errors.UNKNOWN_METHOD()}}function b(D,C){if((!s||!s.length)&&Buffer.isBuffer(e))return D&&C&&C(h()),h();if(s.length&&!o){var k;switch(r.method){case be.Constants.STORED:return r.compressedSize=r.size,k=Buffer.alloc(s.length),s.copy(k),D&&C&&C(k),k;default:case be.Constants.DEFLATED:var $=new Pg.Deflater(s);if(D)$.deflateAsync(function(L){k=Buffer.alloc(L.length),r.compressedSize=L.length,L.copy(k),C&&C(k)});else{var F=$.deflate();return r.compressedSize=F.length,F}$=null;break}}else if(D&&C)C(Buffer.alloc(0));else return Buffer.alloc(0)}function g(D,C){return(D.readUInt32LE(C+4)<<4)+D.readUInt32LE(C)}function w(D){try{for(var C=0,k,$,F;C+4<D.length;)k=D.readUInt16LE(C),C+=2,$=D.readUInt16LE(C),C+=2,F=D.slice(C,C+$),C+=$,Ze.ID_ZIP64===k&&x(F)}catch{throw be.Errors.EXTRA_FIELD_PARSE_ERROR()}}function x(D){var C,k,$,F;D.length>=Ze.EF_ZIP64_SCOMP&&(C=g(D,Ze.EF_ZIP64_SUNCOMP),r.size===Ze.EF_ZIP64_OR_32&&(r.size=C)),D.length>=Ze.EF_ZIP64_RHO&&(k=g(D,Ze.EF_ZIP64_SCOMP),r.compressedSize===Ze.EF_ZIP64_OR_32&&(r.compressedSize=k)),D.length>=Ze.EF_ZIP64_DSN&&($=g(D,Ze.EF_ZIP64_RHO),r.offset===Ze.EF_ZIP64_OR_32&&(r.offset=$)),D.length>=Ze.EF_ZIP64_DSN+4&&(F=D.readUInt32LE(Ze.EF_ZIP64_DSN),r.diskNumStart===Ze.EF_ZIP64_OR_16&&(r.diskNumStart=F))}return{get entryName(){return f.decode(n)},get rawEntryName(){return n},set entryName(D){n=be.toBuffer(D,f.encode);var C=n[n.length-1];o=C===47||C===92,r.fileNameLength=n.length},get efs(){return typeof c=="function"?c(this.entryName):c},get extra(){return a},set extra(D){a=D,r.extraLength=D.length,w(D)},get comment(){return f.decode(i)},set comment(D){if(i=be.toBuffer(D,f.encode),r.commentLength=i.length,i.length>65535)throw be.Errors.COMMENT_TOO_LONG()},get name(){var D=f.decode(n);return o?D.substr(D.length-1).split("/").pop():D.split("/").pop()},get isDirectory(){return o},getCompressedData:function(){return b(!1,null)},getCompressedDataAsync:function(D){b(!0,D)},setData:function(D){s=be.toBuffer(D,be.decoder.encode),!o&&s.length?(r.size=s.length,r.method=be.Constants.DEFLATED,r.crc=be.crc32(D),r.changed=!0):r.method=be.Constants.STORED},getData:function(D){return r.changed?s:m(!1,null,D)},getDataAsync:function(D,C){r.changed?D(s):m(!0,D,C)},set attr(D){r.attr=D},get attr(){return r.attr},set header(D){r.loadFromBinary(D)},get header(){return r},packCentralHeader:function(){r.flags_efs=this.efs,r.extraLength=a.length;var D=r.centralHeaderToBinary(),C=be.Constants.CENHDR;return n.copy(D,C),C+=n.length,a.copy(D,C),C+=r.extraLength,i.copy(D,C),D},packLocalHeader:function(){let D=0;r.flags_efs=this.efs,r.extraLocalLength=u.length;let C=r.localHeaderToBinary(),k=Buffer.alloc(C.length+n.length+r.extraLocalLength);return C.copy(k,D),D+=C.length,n.copy(k,D),D+=n.length,u.copy(k,D),D+=u.length,k},toJSON:function(){let D=function(C){return"<"+(C&&C.length+" bytes buffer"||"null")+">"};return{entryName:this.entryName,name:this.name,comment:this.comment,isDirectory:this.isDirectory,header:r.toJSON(),compressedData:D(e),data:D(s)}},toString:function(){return JSON.stringify(this.toJSON(),null," ")}}}});var PC=y((cfe,TC)=>{var kC=Rg(),WU=Tg(),wt=ns();TC.exports=function(t,e){var r=[],n={},i=Buffer.alloc(0),o=new WU.MainHeader,s=!1,a=null;let u=new Set,c=e,{noSort:l,decoder:f}=c;t?m(c.readEntries):s=!0;function h(){let g=new Set;for(let w of Object.keys(n)){let x=w.split("/");if(x.pop(),!!x.length)for(let D=0;D<x.length;D++){let C=x.slice(0,D+1).join("/")+"/";g.add(C)}}for(let w of g)if(!(w in n)){let x=new kC(c);x.entryName=w,x.attr=16,x.temporary=!0,r.push(x),n[x.entryName]=x,u.add(x)}}function d(){if(s=!0,n={},o.diskEntries>(t.length-o.offset)/wt.Constants.CENHDR)throw wt.Errors.DISK_ENTRY_TOO_LARGE();r=new Array(o.diskEntries);for(var g=o.offset,w=0;w<r.length;w++){var x=g,D=new kC(c,t);D.header=t.slice(x,x+=wt.Constants.CENHDR),D.entryName=t.slice(x,x+=D.header.fileNameLength),D.header.extraLength&&(D.extra=t.slice(x,x+=D.header.extraLength)),D.header.commentLength&&(D.comment=t.slice(x,x+D.header.commentLength)),g+=D.header.centralHeaderSize,r[w]=D,n[D.entryName]=D}u.clear(),h()}function m(g){var w=t.length-wt.Constants.ENDHDR,x=Math.max(0,w-65535),D=x,C=t.length,k=-1,$=0;for((typeof c.trailingSpace=="boolean"?c.trailingSpace:!1)&&(x=0),w;w>=D;w--)if(t[w]===80){if(t.readUInt32LE(w)===wt.Constants.ENDSIG){k=w,$=w,C=w+wt.Constants.ENDHDR,D=w-wt.Constants.END64HDR;continue}if(t.readUInt32LE(w)===wt.Constants.END64SIG){D=x;continue}if(t.readUInt32LE(w)===wt.Constants.ZIP64SIG){k=w,C=w+wt.readBigUInt64LE(t,w+wt.Constants.ZIP64SIZE)+wt.Constants.ZIP64LEAD;break}}if(k==-1)throw wt.Errors.INVALID_FORMAT();o.loadFromBinary(t.slice(k,C)),o.commentLength&&(i=t.slice($+wt.Constants.ENDHDR)),g&&d()}function b(){r.length>1&&!l&&r.sort((g,w)=>g.entryName.toLowerCase().localeCompare(w.entryName.toLowerCase()))}return{get entries(){return s||d(),r.filter(g=>!u.has(g))},get comment(){return f.decode(i)},set comment(g){i=wt.toBuffer(g,f.encode),o.commentLength=i.length},getEntryCount:function(){return s?r.length:o.diskEntries},forEach:function(g){this.entries.forEach(g)},getEntry:function(g){return s||d(),n[g]||null},setEntry:function(g){s||d(),r.push(g),n[g.entryName]=g,o.totalEntries=r.length},deleteFile:function(g,w=!0){s||d();let x=n[g];this.getEntryChildren(x,w).map(C=>C.entryName).forEach(this.deleteEntry)},deleteEntry:function(g){s||d();let w=n[g],x=r.indexOf(w);x>=0&&(r.splice(x,1),delete n[g],o.totalEntries=r.length)},getEntryChildren:function(g,w=!0){if(s||d(),typeof g=="object")if(g.isDirectory&&w){let x=[],D=g.entryName;for(let C of r)C.entryName.startsWith(D)&&x.push(C);return x}else return[g];return[]},getChildCount:function(g){if(g&&g.isDirectory){let w=this.getEntryChildren(g);return w.includes(g)?w.length-1:w.length}return 0},compressToBuffer:function(){s||d(),b();let g=[],w=[],x=0,D=0;o.size=0,o.offset=0;let C=0;for(let F of this.entries){let L=F.getCompressedData();F.header.offset=D;let S=F.packLocalHeader(),I=S.length+L.length;D+=I,g.push(S),g.push(L);let R=F.packCentralHeader();w.push(R),o.size+=R.length,x+=I+R.length,C++}x+=o.mainHeaderSize,o.offset=D,o.totalEntries=C,D=0;let k=Buffer.alloc(x);for(let F of g)F.copy(k,D),D+=F.length;for(let F of w)F.copy(k,D),D+=F.length;let $=o.toBinary();return i&&i.copy($,wt.Constants.ENDHDR),$.copy(k,D),t=k,s=!1,k},toAsyncBuffer:function(g,w,x,D){try{s||d(),b();let C=[],k=[],$=0,F=0,L=0;o.size=0,o.offset=0;let S=function(I){if(I.length>0){let R=I.shift(),B=R.entryName+R.extra.toString();x&&x(B),R.getCompressedDataAsync(function(q){D&&D(B),R.header.offset=F;let K=R.packLocalHeader(),M=K.length+q.length;F+=M,C.push(K),C.push(q);let E=R.packCentralHeader();k.push(E),o.size+=E.length,$+=M+E.length,L++,S(I)})}else{$+=o.mainHeaderSize,o.offset=F,o.totalEntries=L,F=0;let R=Buffer.alloc($);C.forEach(function(q){q.copy(R,F),F+=q.length}),k.forEach(function(q){q.copy(R,F),F+=q.length});let B=o.toBinary();i&&i.copy(B,wt.Constants.ENDHDR),B.copy(R,F),t=R,s=!1,g(R)}};S(Array.from(this.entries))}catch(C){w(C)}}}}});var IC=y((lfe,$C)=>{var Ve=ns(),Qe=require("path"),KU=Rg(),YU=PC(),ji=(...t)=>Ve.findLast(t,e=>typeof e=="boolean"),RC=(...t)=>Ve.findLast(t,e=>typeof e=="string"),JU=(...t)=>Ve.findLast(t,e=>typeof e=="function"),XU={noSort:!1,readEntries:!1,method:Ve.Constants.NONE,fs:null};$C.exports=function(t,e){let r=null,n=Object.assign(Object.create(null),XU);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 YU(r,n),{canonical:s,sanitize:a,zipnamefix:u}=Ve;function c(d){if(d&&o){var m;if(typeof d=="string"&&(m=o.getEntry(Qe.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 l(d){let{join:m,normalize:b,sep:g}=Qe.posix;return m(".",b(g+d.split("\\").join(g)+g))}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:"",Qe.relative(d,m)+b};return{readFile:function(d,m){var b=c(d);return b&&b.getData(m)||null},childCount:function(d){let m=c(d);if(m)return o.getChildCount(m)},readFileAsync:function(d,m){var b=c(d);b?b.getDataAsync(m):m(null,"getEntry failed for:"+d)},readAsText:function(d,m){var b=c(d);if(b){var g=b.getData();if(g&&g.length)return g.toString(m||"utf8")}return""},readAsTextAsync:function(d,m,b){var g=c(d);g?g.getDataAsync(function(w,x){if(x){m(w,x);return}w&&w.length?m(w.toString(b||"utf8")):m("")}):m("")},deleteFile:function(d,m=!0){var b=c(d);b&&o.deleteFile(b.entryName,m)},deleteEntry:function(d){var m=c(d);m&&o.deleteEntry(m.entryName)},addZipComment:function(d){o.comment=d},getZipComment:function(){return o.comment||""},addZipEntryComment:function(d,m){var b=c(d);b&&(b.comment=m)},getZipEntryComment:function(d){var m=c(d);return m&&m.comment||""},updateFile:function(d,m){var b=c(d);b&&b.setData(m)},addLocalFile:function(d,m,b,g){if(i.fs.existsSync(d)){m=m?l(m):"";let w=Qe.win32.basename(Qe.win32.normalize(d));m+=b||w;let x=i.fs.statSync(d),D=x.isFile()?i.fs.readFileSync(d):Buffer.alloc(0);x.isDirectory()&&(m+=i.sep),this.addFile(m,D,g,x)}else throw Ve.Errors.FILE_NOT_FOUND(d)},addLocalFileAsync:function(d,m){d=typeof d=="object"?d:{localPath:d};let b=Qe.resolve(d.localPath),{comment:g}=d,{zipPath:w,zipName:x}=d,D=this;i.fs.stat(b,function(C,k){if(C)return m(C,!1);w=w?l(w):"";let $=Qe.win32.basename(Qe.win32.normalize(b));if(w+=x||$,k.isFile())i.fs.readFile(b,function(F,L){return F?m(F,!1):(D.addFile(w,L,g,k),setImmediate(m,void 0,!0))});else if(k.isDirectory())return w+=i.sep,D.addFile(w,Buffer.alloc(0),g,k),setImmediate(m,void 0,!0)})},addLocalFolder:function(d,m,b){if(b=f(b),m=m?l(m):"",d=Qe.normalize(d),i.fs.existsSync(d)){let g=i.findFiles(d),w=this;if(g.length)for(let x of g){let D=Qe.join(m,h(d,x));b(D)&&w.addLocalFile(x,Qe.dirname(D))}}else throw Ve.Errors.FILE_NOT_FOUND(d)},addLocalFolderAsync:function(d,m,b,g){g=f(g),b=b?l(b):"",d=Qe.normalize(d);var w=this;i.fs.open(d,"r",function(x){if(x&&x.code==="ENOENT")m(void 0,Ve.Errors.FILE_NOT_FOUND(d));else if(x)m(void 0,x);else{var D=i.findFiles(d),C=-1,k=function(){if(C+=1,C<D.length){var $=D[C],F=h(d,$).split("\\").join("/");F=F.normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/[^\x20-\x7E]/g,""),g(F)?i.fs.stat($,function(L,S){L&&m(void 0,L),S.isFile()?i.fs.readFile($,function(I,R){I?m(void 0,I):(w.addFile(b+F,R,"",S),k())}):(w.addFile(b+F+"/",Buffer.alloc(0),"",S),k())}):process.nextTick(()=>{k()})}else m(!0,void 0)};k()}})},addLocalFolderAsync2:function(d,m){let b=this;d=typeof d=="object"?d:{localPath:d},localPath=Qe.resolve(l(d.localPath));let{zipPath:g,filter:w,namefix:x}=d;w instanceof RegExp?w=function(k){return function($){return k.test($)}}(w):typeof w!="function"&&(w=function(){return!0}),g=g?l(g):"",x=="latin1"&&(x=k=>k.normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/[^\x20-\x7E]/g,"")),typeof x!="function"&&(x=k=>k);let D=k=>Qe.join(g,x(h(localPath,k))),C=k=>Qe.win32.basename(Qe.win32.normalize(x(k)));i.fs.open(localPath,"r",function(k){k&&k.code==="ENOENT"?m(void 0,Ve.Errors.FILE_NOT_FOUND(localPath)):k?m(void 0,k):i.findFilesAsync(localPath,function($,F){if($)return m($);F=F.filter(L=>w(D(L))),F.length||m(void 0,!1),setImmediate(F.reverse().reduce(function(L,S){return function(I,R){if(I||R===!1)return setImmediate(L,I,!1);b.addLocalFileAsync({localPath:S,zipPath:Qe.dirname(D(S)),zipName:C(S)},L)}},m))})})},addLocalFolderPromise:function(d,m){return new Promise((b,g)=>{this.addLocalFolderAsync2(Object.assign({localPath:d},m),(w,x)=>{w&&g(w),x&&b(this)})})},addFile:function(d,m,b,g){d=u(d);let w=c(d),x=w!=null;x||(w=new KU(n),w.entryName=d),w.comment=b||"";let D=typeof g=="object"&&g instanceof i.fs.Stats;D&&(w.header.time=g.mtime);var C=w.isDirectory?16:0;let k=w.isDirectory?16384:32768;return D?k|=4095&g.mode:typeof g=="number"?k|=4095&g:k|=w.isDirectory?493:420,C=(C|k<<16)>>>0,w.attr=C,w.setData(m),x||o.setEntry(w),w},getEntries:function(d){return o.password=d,o?o.entries:[]},getEntry:function(d){return c(d)},getEntryCount:function(){return o.getEntryCount()},forEach:function(d){return o.forEach(d)},extractEntryTo:function(d,m,b,g,w,x){g=ji(!1,g),w=ji(!1,w),b=ji(!0,b),x=RC(w,x);var D=c(d);if(!D)throw Ve.Errors.NO_ENTRY();var C=s(D.entryName),k=a(m,x&&!D.isDirectory?x:b?C:Qe.basename(C));if(D.isDirectory){var $=o.getEntryChildren(D);return $.forEach(function(S){if(S.isDirectory)return;var I=S.getData();if(!I)throw Ve.Errors.CANT_EXTRACT_FILE();var R=s(S.entryName),B=a(m,b?R:Qe.basename(R));let q=w?S.header.fileAttr:void 0;i.writeFileTo(B,I,g,q)}),!0}var F=D.getData(o.password);if(!F)throw Ve.Errors.CANT_EXTRACT_FILE();if(i.fs.existsSync(k)&&!g)throw Ve.Errors.CANT_OVERRIDE();let L=w?d.header.fileAttr:void 0;return i.writeFileTo(k,F,g,L),!0},test:function(d){if(!o)return!1;for(var 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,g){if(b=ji(!1,b),g=RC(b,g),m=ji(!1,m),!o)throw Ve.Errors.NO_ZIP();o.entries.forEach(function(w){var x=a(d,s(w.entryName));if(w.isDirectory){i.makeDir(x);return}var D=w.getData(g);if(!D)throw Ve.Errors.CANT_EXTRACT_FILE();let C=b?w.header.fileAttr:void 0;i.writeFileTo(x,D,m,C);try{i.fs.utimesSync(x,w.header.time,w.header.time)}catch{throw Ve.Errors.CANT_EXTRACT_FILE()}})},extractAllToAsync:function(d,m,b,g){if(g=JU(m,b,g),b=ji(!1,b),m=ji(!1,m),!g)return new Promise((k,$)=>{this.extractAllToAsync(d,m,b,function(F){F?$(F):k(this)})});if(!o){g(Ve.Errors.NO_ZIP());return}d=Qe.resolve(d);let w=k=>a(d,Qe.normalize(s(k.entryName))),x=(k,$)=>new Error(k+': "'+$+'"'),D=[],C=[];o.entries.forEach(k=>{k.isDirectory?D.push(k):C.push(k)});for(let k of D){let $=w(k),F=b?k.header.fileAttr:void 0;try{i.makeDir($),F&&i.fs.chmodSync($,F),i.fs.utimesSync($,k.header.time,k.header.time)}catch{g(x("Unable to create folder",$))}}C.reverse().reduce(function(k,$){return function(F){if(F)k(F);else{let L=Qe.normalize(s($.entryName)),S=a(d,L);$.getDataAsync(function(I,R){if(R)k(R);else if(!I)k(Ve.Errors.CANT_EXTRACT_FILE());else{let B=b?$.header.fileAttr:void 0;i.writeFileToAsync(S,I,m,B,function(q){q||k(x("Unable to write file",S)),i.fs.utimes(S,$.header.time,$.header.time,function(K){K?k(x("Unable to set times",S)):k()})})}})}}},g)()},writeZip:function(d,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 g=i.writeFileTo(d,b,!0);typeof m=="function"&&m(g?null:new Error("failed"),"")}}},writeZipPromise:function(d,m){let{overwrite:b,perm:g}=Object.assign({overwrite:!0},m);return new Promise((w,x)=>{!d&&n.filename&&(d=n.filename),d||x("ADM-ZIP: ZIP File Name Missing"),this.toBufferPromise().then(D=>{let C=k=>k?w(k):x("ADM-ZIP: Wasn't able to write zip file");i.writeFileToAsync(d,D,b,g,C)},x)})},toBufferPromise:function(){return new Promise((d,m)=>{o.toAsyncBuffer(d,m)})},toBuffer:function(d,m,b,g){return typeof d=="function"?(o.toAsyncBuffer(d,m,b,g),null):o.compressToBuffer()}}}});var JC=y((Lfe,YC)=>{var KC={};YC.exports=KC;var WC={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(WC).forEach(function(t){var e=WC[t],r=KC[t]=[];r.open="\x1B["+e[0]+"m",r.close="\x1B["+e[1]+"m"})});var ZC=y((Bfe,XC)=>{"use strict";XC.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 eS=y((qfe,QC)=>{"use strict";var n9=require("os"),Ar=ZC(),Tt=process.env,as=void 0;Ar("no-color")||Ar("no-colors")||Ar("color=false")?as=!1:(Ar("color")||Ar("colors")||Ar("color=true")||Ar("color=always"))&&(as=!0);"FORCE_COLOR"in Tt&&(as=Tt.FORCE_COLOR.length===0||parseInt(Tt.FORCE_COLOR,10)!==0);function i9(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}function o9(t){if(as===!1)return 0;if(Ar("color=16m")||Ar("color=full")||Ar("color=truecolor"))return 3;if(Ar("color=256"))return 2;if(t&&!t.isTTY&&as!==!0)return 0;var e=as?1:0;if(process.platform==="win32"){var r=n9.release().split(".");return Number(process.versions.node.split(".")[0])>=8&&Number(r[0])>=10&&Number(r[2])>=10586?Number(r[2])>=14931?3:2:1}if("CI"in Tt)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some(function(i){return i in Tt})||Tt.CI_NAME==="codeship"?1:e;if("TEAMCITY_VERSION"in Tt)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Tt.TEAMCITY_VERSION)?1:0;if("TERM_PROGRAM"in Tt){var n=parseInt((Tt.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(Tt.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Hyper":return 3;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(Tt.TERM)?2:/^screen|^xterm|^vt100|^rxvt|color|ansi|cygwin|linux/i.test(Tt.TERM)||"COLORTERM"in Tt?1:(Tt.TERM==="dumb",e)}function qg(t){var e=o9(t);return i9(e)}QC.exports={supportsColor:qg,stdout:qg(process.stdout),stderr:qg(process.stderr)}});var rS=y((Mfe,tS)=>{tS.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 iS=y((Ufe,nS)=>{nS.exports=function(e,r){e=e||" he is here ";var n={up:["\u030D","\u030E","\u0304","\u0305","\u033F","\u0311","\u0306","\u0310","\u0352","\u0357","\u0351","\u0307","\u0308","\u030A","\u0342","\u0313","\u0308","\u034A","\u034B","\u034C","\u0303","\u0302","\u030C","\u0350","\u0300","\u0301","\u030B","\u030F","\u0312","\u0313","\u0314","\u033D","\u0309","\u0363","\u0364","\u0365","\u0366","\u0367","\u0368","\u0369","\u036A","\u036B","\u036C","\u036D","\u036E","\u036F","\u033E","\u035B","\u0346","\u031A"],down:["\u0316","\u0317","\u0318","\u0319","\u031C","\u031D","\u031E","\u031F","\u0320","\u0324","\u0325","\u0326","\u0329","\u032A","\u032B","\u032C","\u032D","\u032E","\u032F","\u0330","\u0331","\u0332","\u0333","\u0339","\u033A","\u033B","\u033C","\u0345","\u0347","\u0348","\u0349","\u034D","\u034E","\u0353","\u0354","\u0355","\u0356","\u0359","\u035A","\u0323"],mid:["\u0315","\u031B","\u0300","\u0301","\u0358","\u0321","\u0322","\u0327","\u0328","\u0334","\u0335","\u0336","\u035C","\u035D","\u035E","\u035F","\u0360","\u0362","\u0338","\u0337","\u0361"," \u0489"]},i=[].concat(n.up,n.down,n.mid);function o(u){var c=Math.floor(Math.random()*u);return c}function s(u){var c=!1;return i.filter(function(l){c=l===u}),c}function a(u,c){var l="",f,h;c=c||{},c.up=typeof c.up<"u"?c.up:!0,c.mid=typeof c.mid<"u"?c.mid:!0,c.down=typeof c.down<"u"?c.down:!0,c.size=typeof c.size<"u"?c.size:"maxi",u=u.split("");for(h in u)if(!s(h)){switch(l=l+u[h],f={up:0,down:0,mid:0},c.size){case"mini":f.up=o(8),f.mid=o(2),f.down=o(8);break;case"maxi":f.up=o(16)+3,f.mid=o(4)+1,f.down=o(64)+3;break;default:f.up=o(8)+1,f.mid=o(6)/2,f.down=o(8)+1;break}var d=["up","mid","down"];for(var m in d)for(var b=d[m],g=0;g<=f[b];g++)c[b]&&(l=l+n[b][o(n[b].length)])}return l}return a(e,r)}});var sS=y((Vfe,oS)=>{oS.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 uS=y((Hfe,aS)=>{aS.exports=function(t){return function(e,r,n){return r%2===0?e:t.inverse(e)}}});var lS=y((zfe,cS)=>{cS.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 dS=y((Gfe,fS)=>{fS.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 DS=y((Kfe,yS)=>{var ce={};yS.exports=ce;ce.themes={};var s9=require("util"),Ni=ce.styles=JC(),pS=Object.defineProperties,a9=new RegExp(/[\r\n]+/g);ce.supportsColor=eS().supportsColor;typeof ce.enabled>"u"&&(ce.enabled=ce.supportsColor()!==!1);ce.enable=function(){ce.enabled=!0};ce.disable=function(){ce.enabled=!1};ce.stripColors=ce.strip=function(t){return(""+t).replace(/\x1B\[\d+m/g,"")};var Wfe=ce.stylize=function(e,r){if(!ce.enabled)return e+"";var n=Ni[r];return!n&&r in ce?ce[r](e):n.open+e+n.close},u9=/[|\\{}()[\]^$+*?.]/g,c9=function(t){if(typeof t!="string")throw new TypeError("Expected a string");return t.replace(u9,"\\$&")};function mS(t){var e=function r(){return f9.apply(r,arguments)};return e._styles=t,e.__proto__=l9,e}var gS=function(){var t={};return Ni.grey=Ni.gray,Object.keys(Ni).forEach(function(e){Ni[e].closeRe=new RegExp(c9(Ni[e].close),"g"),t[e]={get:function(){return mS(this._styles.concat(e))}}}),t}(),l9=pS(function(){},gS);function f9(){var t=Array.prototype.slice.call(arguments),e=t.map(function(s){return s!=null&&s.constructor===String?s:s9.inspect(s)}).join(" ");if(!ce.enabled||!e)return e;for(var r=e.indexOf(`
24
- `)!=-1,n=this._styles,i=n.length;i--;){var o=Ni[n[i]];e=o.open+e.replace(o.closeRe,o.open)+o.close,r&&(e=e.replace(a9,function(s){return o.close+s+o.open}))}return e}ce.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){ce[r]=function(n){if(typeof t[r]=="object"){var i=n;for(var o in t[r])i=ce[t[r][o]](i);return i}return ce[t[r]](n)}})(e)};function d9(){var t={};return Object.keys(gS).forEach(function(e){t[e]={get:function(){return mS([e])}}}),t}var h9=function(e,r){var n=r.split("");return n=n.map(e),n.join("")};ce.trap=rS();ce.zalgo=iS();ce.maps={};ce.maps.america=sS()(ce);ce.maps.zebra=uS()(ce);ce.maps.rainbow=lS()(ce);ce.maps.random=dS()(ce);for(hS in ce.maps)(function(t){ce[t]=function(e){return h9(ce.maps[t],e)}})(hS);var hS;pS(ce,d9())});var bS=y((Yfe,vS)=>{var p9=DS();vS.exports=p9});var wS=y(Mg=>{"use strict";Mg.indent=function(e){return new Array(e+1).join(" ")};Mg.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 _S=y((Xfe,m9)=>{m9.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 ES=y(Eu=>{"use strict";var zr=bS(),ri=wS(),g9=/[^\w\s\n\r\v\t\.,]/i;Eu.version=_S().version;var Ug=function(t,e){return t!==void 0||e.renderUndefined},nf=function(t,e,r){return!!(typeof t=="boolean"||typeof t=="number"||typeof t=="function"||t===null||t===void 0||t instanceof Date||typeof t=="string"&&t.indexOf(`
23
+ `)}),this}_outputHelpIfRequested(e){let r=this._getHelpOption();r&&e.find(i=>r.is(i))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function fw(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})}dw.Command=Rp});var yw=y(hr=>{var{Argument:pw}=il(),{Command:$p}=hw(),{CommanderError:mB,InvalidArgumentError:mw}=ja(),{Help:gB}=Sp(),{Option:gw}=Ap();hr.program=new $p;hr.createCommand=t=>new $p(t);hr.createOption=(t,e)=>new gw(t,e);hr.createArgument=(t,e)=>new pw(t,e);hr.Command=$p;hr.Option=gw;hr.Argument=pw;hr.Help=gB;hr.CommanderError=mB;hr.InvalidArgumentError=mw;hr.InvalidOptionArgumentError=mw});var ke=y((pce,vw)=>{"use strict";var Ip="\x1B",Me=`${Ip}[`,DB="\x07",jp={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:`${Ip}7`,restore:`${Ip}8`},vB={up:(t=1)=>`${Me}S`.repeat(t),down:(t=1)=>`${Me}T`.repeat(t)},bB={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?jp.up():"");return t&&(e+=jp.left),e}};vw.exports={cursor:jp,scroll:vB,erase:bB,beep:DB}});var _w=y((mce,Np)=>{var wB=require("tty"),_B=!("NO_COLOR"in process.env||process.argv.includes("--no-color"))&&("FORCE_COLOR"in process.env||process.argv.includes("--color")||process.platform==="win32"||wB.isatty(1)&&process.env.TERM!=="dumb"||"CI"in process.env),$e=(t,e,r=t)=>n=>{let i=""+n,o=i.indexOf(e,t.length);return~o?t+bw(i,e,r,o)+e:t+i+e},bw=(t,e,r,n)=>{let i=t.substring(0,n)+r,o=t.substring(n+e.length),s=o.indexOf(e);return~s?i+bw(o,e,r,s):i+o},ww=(t=_B)=>({isColorSupported:t,reset:t?e=>`\x1B[0m${e}\x1B[0m`:String,bold:t?$e("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"):String,dim:t?$e("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"):String,italic:t?$e("\x1B[3m","\x1B[23m"):String,underline:t?$e("\x1B[4m","\x1B[24m"):String,inverse:t?$e("\x1B[7m","\x1B[27m"):String,hidden:t?$e("\x1B[8m","\x1B[28m"):String,strikethrough:t?$e("\x1B[9m","\x1B[29m"):String,black:t?$e("\x1B[30m","\x1B[39m"):String,red:t?$e("\x1B[31m","\x1B[39m"):String,green:t?$e("\x1B[32m","\x1B[39m"):String,yellow:t?$e("\x1B[33m","\x1B[39m"):String,blue:t?$e("\x1B[34m","\x1B[39m"):String,magenta:t?$e("\x1B[35m","\x1B[39m"):String,cyan:t?$e("\x1B[36m","\x1B[39m"):String,white:t?$e("\x1B[37m","\x1B[39m"):String,gray:t?$e("\x1B[90m","\x1B[39m"):String,bgBlack:t?$e("\x1B[40m","\x1B[49m"):String,bgRed:t?$e("\x1B[41m","\x1B[49m"):String,bgGreen:t?$e("\x1B[42m","\x1B[49m"):String,bgYellow:t?$e("\x1B[43m","\x1B[49m"):String,bgBlue:t?$e("\x1B[44m","\x1B[49m"):String,bgMagenta:t?$e("\x1B[45m","\x1B[49m"):String,bgCyan:t?$e("\x1B[46m","\x1B[49m"):String,bgWhite:t?$e("\x1B[47m","\x1B[49m"):String});Np.exports=ww();Np.exports.createColors=ww});var Lw=y((yce,Hp)=>{var LB=require("tty"),BB=!("NO_COLOR"in process.env||process.argv.includes("--no-color"))&&("FORCE_COLOR"in process.env||process.argv.includes("--color")||process.platform==="win32"||LB.isatty(1)&&process.env.TERM!=="dumb"||"CI"in process.env),je=(t,e,r=t)=>n=>{let i=""+n,o=i.indexOf(e,t.length);return~o?t+jw(i,e,r,o)+e:t+i+e},jw=(t,e,r,n)=>{let i=t.substring(0,n)+r,o=t.substring(n+e.length),s=o.indexOf(e);return~s?i+jw(o,e,r,s):i+o},Nw=(t=BB)=>({isColorSupported:t,reset:t?e=>`\x1B[0m${e}\x1B[0m`:String,bold:t?je("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"):String,dim:t?je("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"):String,italic:t?je("\x1B[3m","\x1B[23m"):String,underline:t?je("\x1B[4m","\x1B[24m"):String,inverse:t?je("\x1B[7m","\x1B[27m"):String,hidden:t?je("\x1B[8m","\x1B[28m"):String,strikethrough:t?je("\x1B[9m","\x1B[29m"):String,black:t?je("\x1B[30m","\x1B[39m"):String,red:t?je("\x1B[31m","\x1B[39m"):String,green:t?je("\x1B[32m","\x1B[39m"):String,yellow:t?je("\x1B[33m","\x1B[39m"):String,blue:t?je("\x1B[34m","\x1B[39m"):String,magenta:t?je("\x1B[35m","\x1B[39m"):String,cyan:t?je("\x1B[36m","\x1B[39m"):String,white:t?je("\x1B[37m","\x1B[39m"):String,gray:t?je("\x1B[90m","\x1B[39m"):String,bgBlack:t?je("\x1B[40m","\x1B[49m"):String,bgRed:t?je("\x1B[41m","\x1B[49m"):String,bgGreen:t?je("\x1B[42m","\x1B[49m"):String,bgYellow:t?je("\x1B[43m","\x1B[49m"):String,bgBlue:t?je("\x1B[44m","\x1B[49m"):String,bgMagenta:t?je("\x1B[45m","\x1B[49m"):String,bgCyan:t?je("\x1B[46m","\x1B[49m"):String,bgWhite:t?je("\x1B[47m","\x1B[49m"):String});Hp.exports=Nw();Hp.exports.createColors=Nw});var dl=y(Mt=>{"use strict";Object.defineProperty(Mt,"__esModule",{value:!0});Mt.isNXMonorepo=Mt.isMonorepo=Mt.findPackageRelativePathInMonorepo=Mt.findPackagePath=Mt.findNXMonorepoRoot=Mt.findMonorepoRoot=void 0;var Ba=require("node:fs"),Wn=require("node:path");function fl(t){let e=(0,Wn.join)(t,"package.json"),r=(0,Wn.join)(t,"pnpm-workspace.yaml");if((0,Ba.existsSync)(r)||(0,Ba.existsSync)(e)&&JSON.parse((0,Ba.readFileSync)(e,"utf-8")).workspaces)return t;let n=(0,Wn.dirname)(t);if(n===t)throw new Error("Monorepo root not found");return fl(n)}Mt.findMonorepoRoot=fl;function Jp(t){let e=(0,Wn.join)(t,"nx.json");if((0,Ba.existsSync)(e))return t;let r=(0,Wn.dirname)(t);if(r===t)throw new Error("Monorepo root not found");return Jp(r)}Mt.findNXMonorepoRoot=Jp;function Xp(t,e,r){let n=(0,Wn.join)(e,"node_modules",t);if((0,Ba.existsSync)(n))return n;if(e===r)return null;let i=(0,Wn.dirname)(e);return Xp(t,i,r)}Mt.findPackagePath=Xp;function WB(t,e){let r=fl(e),n=Xp(t,e,r);return n?(0,Wn.relative)(e,n):null}Mt.findPackageRelativePathInMonorepo=WB;function KB(t){try{return fl(t),!0}catch{return!1}}Mt.isMonorepo=KB;function YB(t){try{return Jp(t),!0}catch{return!1}}Mt.isNXMonorepo=YB});var xi={};mn(xi,{default:()=>JB});var JB,Fi=ct(()=>{JB={}});var Hw=y(jr=>{"use strict";var XB=jr&&jr.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),ZB=jr&&jr.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),QB=jr&&jr.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&XB(e,t,r);return ZB(e,t),e};Object.defineProperty(jr,"__esModule",{value:!0});jr.resolveFetch=void 0;var eq=t=>{let e;return t?e=t:typeof fetch>"u"?e=(...r)=>Promise.resolve().then(()=>QB((Fi(),Ae(xi)))).then(({default:n})=>n(...r)):e=fetch,(...r)=>e(...r)};jr.resolveFetch=eq});var tm=y(nr=>{"use strict";Object.defineProperty(nr,"__esModule",{value:!0});nr.FunctionRegion=nr.FunctionsHttpError=nr.FunctionsRelayError=nr.FunctionsFetchError=nr.FunctionsError=void 0;var qo=class extends Error{constructor(e,r="FunctionsError",n){super(e),this.name=r,this.context=n}};nr.FunctionsError=qo;var Zp=class extends qo{constructor(e){super("Failed to send a request to the Edge Function","FunctionsFetchError",e)}};nr.FunctionsFetchError=Zp;var Qp=class extends qo{constructor(e){super("Relay Error invoking the Edge Function","FunctionsRelayError",e)}};nr.FunctionsRelayError=Qp;var em=class extends qo{constructor(e){super("Edge Function returned a non-2xx status code","FunctionsHttpError",e)}};nr.FunctionsHttpError=em;var tq;(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"})(tq=nr.FunctionRegion||(nr.FunctionRegion={}))});var zw=y(Mo=>{"use strict";var rq=Mo&&Mo.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(l){try{c(n.next(l))}catch(f){s(f)}}function u(l){try{c(n.throw(l))}catch(f){s(f)}}function c(l){l.done?o(l.value):i(l.value).then(a,u)}c((n=n.apply(t,e||[])).next())})};Object.defineProperty(Mo,"__esModule",{value:!0});Mo.FunctionsClient=void 0;var nq=Hw(),pl=tm(),rm=class{constructor(e,{headers:r={},customFetch:n,region:i=pl.FunctionRegion.Any}={}){this.url=e,this.headers=r,this.region=i,this.fetch=(0,nq.resolveFetch)(n)}setAuth(e){this.headers.Authorization=`Bearer ${e}`}invoke(e,r={}){var n;return rq(this,void 0,void 0,function*(){try{let{headers:i,method:o,body:s}=r,a={},{region:u}=r;u||(u=this.region),u&&u!=="any"&&(a["x-region"]=u);let c;s&&(i&&!Object.prototype.hasOwnProperty.call(i,"Content-Type")||!i)&&(typeof Blob<"u"&&s instanceof Blob||s instanceof ArrayBuffer?(a["Content-Type"]="application/octet-stream",c=s):typeof s=="string"?(a["Content-Type"]="text/plain",c=s):typeof FormData<"u"&&s instanceof FormData?c=s:(a["Content-Type"]="application/json",c=JSON.stringify(s)));let l=yield this.fetch(`${this.url}/${e}`,{method:o||"POST",headers:Object.assign(Object.assign(Object.assign({},a),this.headers),i),body:c}).catch(m=>{throw new pl.FunctionsFetchError(m)}),f=l.headers.get("x-relay-error");if(f&&f==="true")throw new pl.FunctionsRelayError(l);if(!l.ok)throw new pl.FunctionsHttpError(l);let h=((n=l.headers.get("Content-Type"))!==null&&n!==void 0?n:"text/plain").split(";")[0].trim(),d;return h==="application/json"?d=yield l.json():h==="application/octet-stream"?d=yield l.blob():h==="text/event-stream"?d=l:h==="multipart/form-data"?d=yield l.formData():d=yield l.text(),{data:d,error:null}}catch(i){return{data:null,error:i}}})}};Mo.FunctionsClient=rm});var nm=y(Ut=>{"use strict";Object.defineProperty(Ut,"__esModule",{value:!0});Ut.FunctionRegion=Ut.FunctionsRelayError=Ut.FunctionsHttpError=Ut.FunctionsFetchError=Ut.FunctionsError=Ut.FunctionsClient=void 0;var iq=zw();Object.defineProperty(Ut,"FunctionsClient",{enumerable:!0,get:function(){return iq.FunctionsClient}});var Ma=tm();Object.defineProperty(Ut,"FunctionsError",{enumerable:!0,get:function(){return Ma.FunctionsError}});Object.defineProperty(Ut,"FunctionsFetchError",{enumerable:!0,get:function(){return Ma.FunctionsFetchError}});Object.defineProperty(Ut,"FunctionsHttpError",{enumerable:!0,get:function(){return Ma.FunctionsHttpError}});Object.defineProperty(Ut,"FunctionsRelayError",{enumerable:!0,get:function(){return Ma.FunctionsRelayError}});Object.defineProperty(Ut,"FunctionRegion",{enumerable:!0,get:function(){return Ma.FunctionRegion}})});var sm=y(om=>{"use strict";Object.defineProperty(om,"__esModule",{value:!0});var im=class extends Error{constructor(e){super(e.message),this.name="PostgrestError",this.details=e.details,this.hint=e.hint,this.code=e.code}};om.default=im});var um=y(Ua=>{"use strict";var Gw=Ua&&Ua.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ua,"__esModule",{value:!0});var oq=Gw((Fi(),Ae(xi))),sq=Gw(sm()),am=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=oq.default:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(e,r){return this.headers=Object.assign({},this.headers),this.headers[e]=r,this}then(e,r){this.schema===void 0||(["GET","HEAD"].includes(this.method)?this.headers["Accept-Profile"]=this.schema:this.headers["Content-Profile"]=this.schema),this.method!=="GET"&&this.method!=="HEAD"&&(this.headers["Content-Type"]="application/json");let n=this.fetch,i=n(this.url.toString(),{method:this.method,headers:this.headers,body:JSON.stringify(this.body),signal:this.signal}).then(async o=>{var s,a,u;let c=null,l=null,f=null,h=o.status,d=o.statusText;if(o.ok){if(this.method!=="HEAD"){let w=await o.text();w===""||(this.headers.Accept==="text/csv"||this.headers.Accept&&this.headers.Accept.includes("application/vnd.pgrst.plan+text")?l=w:l=JSON.parse(w))}let b=(s=this.headers.Prefer)===null||s===void 0?void 0:s.match(/count=(exact|planned|estimated)/),g=(a=o.headers.get("content-range"))===null||a===void 0?void 0:a.split("/");b&&g&&g.length>1&&(f=parseInt(g[1])),this.isMaybeSingle&&this.method==="GET"&&Array.isArray(l)&&(l.length>1?(c={code:"PGRST116",details:`Results contain ${l.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},l=null,f=null,h=406,d="Not Acceptable"):l.length===1?l=l[0]:l=null)}else{let b=await o.text();try{c=JSON.parse(b),Array.isArray(c)&&o.status===404&&(l=[],c=null,h=200,d="OK")}catch{o.status===404&&b===""?(h=204,d="No Content"):c={message:b}}if(c&&this.isMaybeSingle&&(!((u=c?.details)===null||u===void 0)&&u.includes("0 rows"))&&(c=null,h=200,d="OK"),c&&this.shouldThrowOnError)throw new sq.default(c)}return{error:c,data:l,count:f,status:h,statusText:d}});return this.shouldThrowOnError||(i=i.catch(o=>{var s,a,u;return{error:{message:`${(s=o?.name)!==null&&s!==void 0?s:"FetchError"}: ${o?.message}`,details:`${(a=o?.stack)!==null&&a!==void 0?a:""}`,hint:"",code:`${(u=o?.code)!==null&&u!==void 0?u:""}`},data:null,count:null,status:0,statusText:""}})),i.then(e,r)}};Ua.default=am});var lm=y(Va=>{"use strict";var aq=Va&&Va.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Va,"__esModule",{value:!0});var uq=aq(um()),cm=class extends uq.default{select(e){let r=!1,n=(e??"*").split("").map(i=>/\s/.test(i)&&!r?"":(i==='"'&&(r=!r),i)).join("");return this.url.searchParams.set("select",n),this.headers.Prefer&&(this.headers.Prefer+=","),this.headers.Prefer+="return=representation",this}order(e,{ascending:r=!0,nullsFirst:n,foreignTable:i,referencedTable:o=i}={}){let s=o?`${o}.order`:"order",a=this.url.searchParams.get(s);return this.url.searchParams.set(s,`${a?`${a},`:""}${e}.${r?"asc":"desc"}${n===void 0?"":n?".nullsfirst":".nullslast"}`),this}limit(e,{foreignTable:r,referencedTable:n=r}={}){let i=typeof n>"u"?"limit":`${n}.limit`;return this.url.searchParams.set(i,`${e}`),this}range(e,r,{foreignTable:n,referencedTable:i=n}={}){let o=typeof i>"u"?"offset":`${i}.offset`,s=typeof i>"u"?"limit":`${i}.limit`;return this.url.searchParams.set(o,`${e}`),this.url.searchParams.set(s,`${r-e+1}`),this}abortSignal(e){return this.signal=e,this}single(){return this.headers.Accept="application/vnd.pgrst.object+json",this}maybeSingle(){return this.method==="GET"?this.headers.Accept="application/json":this.headers.Accept="application/vnd.pgrst.object+json",this.isMaybeSingle=!0,this}csv(){return this.headers.Accept="text/csv",this}geojson(){return this.headers.Accept="application/geo+json",this}explain({analyze:e=!1,verbose:r=!1,settings:n=!1,buffers:i=!1,wal:o=!1,format:s="text"}={}){var a;let u=[e?"analyze":null,r?"verbose":null,n?"settings":null,i?"buffers":null,o?"wal":null].filter(Boolean).join("|"),c=(a=this.headers.Accept)!==null&&a!==void 0?a:"application/json";return this.headers.Accept=`application/vnd.pgrst.plan+${s}; for="${c}"; options=${u};`,s==="json"?this:this}rollback(){var e;return((e=this.headers.Prefer)!==null&&e!==void 0?e:"").trim().length>0?this.headers.Prefer+=",tx=rollback":this.headers.Prefer="tx=rollback",this}returns(){return this}};Va.default=cm});var ml=y(Ha=>{"use strict";var cq=Ha&&Ha.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ha,"__esModule",{value:!0});var lq=cq(lm()),fm=class extends lq.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}};Ha.default=fm});var hm=y(Ga=>{"use strict";var fq=Ga&&Ga.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ga,"__esModule",{value:!0});var za=fq(ml()),dm=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 za.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 za.default({method:i,url:this.url,headers:this.headers,schema:this.schema,body:e,fetch:this.fetch,allowEmpty:!1})}upsert(e,{onConflict:r,ignoreDuplicates:n=!1,count:i,defaultToNull:o=!0}={}){let s="POST",a=[`resolution=${n?"ignore":"merge"}-duplicates`];if(r!==void 0&&this.url.searchParams.set("on_conflict",r),this.headers.Prefer&&a.push(this.headers.Prefer),i&&a.push(`count=${i}`),o||a.push("missing=default"),this.headers.Prefer=a.join(","),Array.isArray(e)){let u=e.reduce((c,l)=>c.concat(Object.keys(l)),[]);if(u.length>0){let c=[...new Set(u)].map(l=>`"${l}"`);this.url.searchParams.set("columns",c.join(","))}}return new za.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 za.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 za.default({method:r,url:this.url,headers:this.headers,schema:this.schema,fetch:this.fetch,allowEmpty:!1})}};Ga.default=dm});var Ww=y(gl=>{"use strict";Object.defineProperty(gl,"__esModule",{value:!0});gl.version=void 0;gl.version="0.0.0-automated"});var Kw=y(yl=>{"use strict";Object.defineProperty(yl,"__esModule",{value:!0});yl.DEFAULT_HEADERS=void 0;var dq=Ww();yl.DEFAULT_HEADERS={"X-Client-Info":`postgrest-js/${dq.version}`}});var Jw=y(Wa=>{"use strict";var Yw=Wa&&Wa.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Wa,"__esModule",{value:!0});var hq=Yw(hm()),pq=Yw(ml()),mq=Kw(),pm=class t{constructor(e,{headers:r={},schema:n,fetch:i}={}){this.url=e,this.headers=Object.assign(Object.assign({},mq.DEFAULT_HEADERS),r),this.schemaName=n,this.fetch=i}from(e){let r=new URL(`${this.url}/${e}`);return new hq.default(r,{headers:Object.assign({},this.headers),schema:this.schemaName,fetch:this.fetch})}schema(e){return new t(this.url,{headers:this.headers,schema:e,fetch:this.fetch})}rpc(e,r={},{head:n=!1,get:i=!1,count:o}={}){let s,a=new URL(`${this.url}/rpc/${e}`),u;n||i?(s=n?"HEAD":"GET",Object.entries(r).filter(([l,f])=>f!==void 0).map(([l,f])=>[l,Array.isArray(f)?`{${f.join(",")}}`:`${f}`]).forEach(([l,f])=>{a.searchParams.append(l,f)})):(s="POST",u=r);let c=Object.assign({},this.headers);return o&&(c.Prefer=`count=${o}`),new pq.default({method:s,url:a,headers:c,schema:this.schemaName,body:u,fetch:this.fetch,allowEmpty:!1})}};Wa.default=pm});var n_=y(vt=>{"use strict";var Uo=vt&&vt.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(vt,"__esModule",{value:!0});vt.PostgrestError=vt.PostgrestBuilder=vt.PostgrestTransformBuilder=vt.PostgrestFilterBuilder=vt.PostgrestQueryBuilder=vt.PostgrestClient=void 0;var Xw=Uo(Jw());vt.PostgrestClient=Xw.default;var Zw=Uo(hm());vt.PostgrestQueryBuilder=Zw.default;var Qw=Uo(ml());vt.PostgrestFilterBuilder=Qw.default;var e_=Uo(lm());vt.PostgrestTransformBuilder=e_.default;var t_=Uo(um());vt.PostgrestBuilder=t_.default;var r_=Uo(sm());vt.PostgrestError=r_.default;vt.default={PostgrestClient:Xw.default,PostgrestQueryBuilder:Zw.default,PostgrestFilterBuilder:Qw.default,PostgrestTransformBuilder:e_.default,PostgrestBuilder:t_.default,PostgrestError:r_.default}});var gm={};mn(gm,{RealtimeClient:()=>mm});var mm,ym=ct(()=>{mm=class{constructor(){}connect(){}disconnect(){}}});var Ya=y(Nr=>{"use strict";Object.defineProperty(Nr,"__esModule",{value:!0});Nr.StorageUnknownError=Nr.StorageApiError=Nr.isStorageError=Nr.StorageError=void 0;var Ka=class extends Error{constructor(e){super(e),this.__isStorageError=!0,this.name="StorageError"}};Nr.StorageError=Ka;function gq(t){return typeof t=="object"&&t!==null&&"__isStorageError"in t}Nr.isStorageError=gq;var Dm=class extends Ka{constructor(e,r){super(e),this.name="StorageApiError",this.status=r}toJSON(){return{name:this.name,message:this.message,status:this.status}}};Nr.StorageApiError=Dm;var vm=class extends Ka{constructor(e,r){super(e),this.name="StorageUnknownError",this.originalError=r}};Nr.StorageUnknownError=vm});var Dl=y(lt=>{"use strict";var yq=lt&&lt.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),Dq=lt&&lt.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),i_=lt&&lt.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&yq(e,t,r);return Dq(e,t),e},vq=lt&&lt.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(l){try{c(n.next(l))}catch(f){s(f)}}function u(l){try{c(n.throw(l))}catch(f){s(f)}}function c(l){l.done?o(l.value):i(l.value).then(a,u)}c((n=n.apply(t,e||[])).next())})};Object.defineProperty(lt,"__esModule",{value:!0});lt.recursiveToCamel=lt.resolveResponse=lt.resolveFetch=void 0;var bq=t=>{let e;return t?e=t:typeof fetch>"u"?e=(...r)=>Promise.resolve().then(()=>i_((Fi(),Ae(xi)))).then(({default:n})=>n(...r)):e=fetch,(...r)=>e(...r)};lt.resolveFetch=bq;var wq=()=>vq(void 0,void 0,void 0,function*(){return typeof Response>"u"?(yield Promise.resolve().then(()=>i_((Fi(),Ae(xi))))).Response:Response});lt.resolveResponse=wq;var _q=t=>{if(Array.isArray(t))return t.map(r=>(0,lt.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,lt.recursiveToCamel)(n)}),e};lt.recursiveToCamel=_q});var _m=y(Vt=>{"use strict";var Oi=Vt&&Vt.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(l){try{c(n.next(l))}catch(f){s(f)}}function u(l){try{c(n.throw(l))}catch(f){s(f)}}function c(l){l.done?o(l.value):i(l.value).then(a,u)}c((n=n.apply(t,e||[])).next())})};Object.defineProperty(Vt,"__esModule",{value:!0});Vt.remove=Vt.head=Vt.put=Vt.post=Vt.get=void 0;var bm=Ya(),Eq=Dl(),wm=t=>t.msg||t.message||t.error_description||t.error||JSON.stringify(t),Cq=(t,e,r)=>Oi(void 0,void 0,void 0,function*(){let n=yield(0,Eq.resolveResponse)();t instanceof n&&!r?.noResolveJson?t.json().then(i=>{e(new bm.StorageApiError(wm(i),t.status||500))}).catch(i=>{e(new bm.StorageUnknownError(wm(i),i))}):e(new bm.StorageUnknownError(wm(t),t))}),Sq=(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 Ja(t,e,r,n,i,o){return Oi(this,void 0,void 0,function*(){return new Promise((s,a)=>{t(r,Sq(e,n,i,o)).then(u=>{if(!u.ok)throw u;return n?.noResolveJson?u:u.json()}).then(u=>s(u)).catch(u=>Cq(u,a,n))})})}function xq(t,e,r,n){return Oi(this,void 0,void 0,function*(){return Ja(t,"GET",e,r,n)})}Vt.get=xq;function Fq(t,e,r,n,i){return Oi(this,void 0,void 0,function*(){return Ja(t,"POST",e,n,i,r)})}Vt.post=Fq;function Oq(t,e,r,n,i){return Oi(this,void 0,void 0,function*(){return Ja(t,"PUT",e,n,i,r)})}Vt.put=Oq;function Aq(t,e,r,n){return Oi(this,void 0,void 0,function*(){return Ja(t,"HEAD",e,Object.assign(Object.assign({},r),{noResolveJson:!0}),n)})}Vt.head=Aq;function kq(t,e,r,n,i){return Oi(this,void 0,void 0,function*(){return Ja(t,"DELETE",e,n,i,r)})}Vt.remove=kq});var a_=y(Xa=>{"use strict";var Ht=Xa&&Xa.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(l){try{c(n.next(l))}catch(f){s(f)}}function u(l){try{c(n.throw(l))}catch(f){s(f)}}function c(l){l.done?o(l.value):i(l.value).then(a,u)}c((n=n.apply(t,e||[])).next())})};Object.defineProperty(Xa,"__esModule",{value:!0});var zt=Ya(),Lr=_m(),o_=Dl(),Tq={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},s_={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1},Em=class{constructor(e,r={},n,i){this.url=e,this.headers=r,this.bucketId=n,this.fetch=(0,o_.resolveFetch)(i)}uploadOrUpdate(e,r,n,i){return Ht(this,void 0,void 0,function*(){try{let o,s=Object.assign(Object.assign({},s_),i),a=Object.assign(Object.assign({},this.headers),e==="POST"&&{"x-upsert":String(s.upsert)}),u=s.metadata;typeof Blob<"u"&&n instanceof Blob?(o=new FormData,o.append("cacheControl",s.cacheControl),u&&o.append("metadata",this.encodeMetadata(u)),o.append("",n)):typeof FormData<"u"&&n instanceof FormData?(o=n,o.append("cacheControl",s.cacheControl),u&&o.append("metadata",this.encodeMetadata(u))):(o=n,a["cache-control"]=`max-age=${s.cacheControl}`,a["content-type"]=s.contentType,u&&(a["x-metadata"]=this.toBase64(this.encodeMetadata(u)))),i?.headers&&(a=Object.assign(Object.assign({},a),i.headers));let c=this._removeEmptyFolders(r),l=this._getFinalPath(c),f=yield this.fetch(`${this.url}/object/${l}`,Object.assign({method:e,body:o,headers:a},s?.duplex?{duplex:s.duplex}:{})),h=yield f.json();return f.ok?{data:{path:c,id:h.Id,fullPath:h.Key},error:null}:{data:null,error:h}}catch(o){if((0,zt.isStorageError)(o))return{data:null,error:o};throw o}})}upload(e,r,n){return Ht(this,void 0,void 0,function*(){return this.uploadOrUpdate("POST",e,r,n)})}uploadToSignedUrl(e,r,n,i){return Ht(this,void 0,void 0,function*(){let o=this._removeEmptyFolders(e),s=this._getFinalPath(o),a=new URL(this.url+`/object/upload/sign/${s}`);a.searchParams.set("token",r);try{let u,c=Object.assign({upsert:s_.upsert},i),l=Object.assign(Object.assign({},this.headers),{"x-upsert":String(c.upsert)});typeof Blob<"u"&&n instanceof Blob?(u=new FormData,u.append("cacheControl",c.cacheControl),u.append("",n)):typeof FormData<"u"&&n instanceof FormData?(u=n,u.append("cacheControl",c.cacheControl)):(u=n,l["cache-control"]=`max-age=${c.cacheControl}`,l["content-type"]=c.contentType);let f=yield this.fetch(a.toString(),{method:"PUT",body:u,headers:l}),h=yield f.json();return f.ok?{data:{path:o,fullPath:h.Key},error:null}:{data:null,error:h}}catch(u){if((0,zt.isStorageError)(u))return{data:null,error:u};throw u}})}createSignedUploadUrl(e,r){return Ht(this,void 0,void 0,function*(){try{let n=this._getFinalPath(e),i=Object.assign({},this.headers);r?.upsert&&(i["x-upsert"]="true");let o=yield(0,Lr.post)(this.fetch,`${this.url}/object/upload/sign/${n}`,{},{headers:i}),s=new URL(this.url+o.url),a=s.searchParams.get("token");if(!a)throw new zt.StorageError("No token returned by API");return{data:{signedUrl:s.toString(),path:e,token:a},error:null}}catch(n){if((0,zt.isStorageError)(n))return{data:null,error:n};throw n}})}update(e,r,n){return Ht(this,void 0,void 0,function*(){return this.uploadOrUpdate("PUT",e,r,n)})}move(e,r,n){return Ht(this,void 0,void 0,function*(){try{return{data:yield(0,Lr.post)(this.fetch,`${this.url}/object/move`,{bucketId:this.bucketId,sourceKey:e,destinationKey:r,destinationBucket:n?.destinationBucket},{headers:this.headers}),error:null}}catch(i){if((0,zt.isStorageError)(i))return{data:null,error:i};throw i}})}copy(e,r,n){return Ht(this,void 0,void 0,function*(){try{return{data:{path:(yield(0,Lr.post)(this.fetch,`${this.url}/object/copy`,{bucketId:this.bucketId,sourceKey:e,destinationKey:r,destinationBucket:n?.destinationBucket},{headers:this.headers})).Key},error:null}}catch(i){if((0,zt.isStorageError)(i))return{data:null,error:i};throw i}})}createSignedUrl(e,r,n){return Ht(this,void 0,void 0,function*(){try{let i=this._getFinalPath(e),o=yield(0,Lr.post)(this.fetch,`${this.url}/object/sign/${i}`,Object.assign({expiresIn:r},n?.transform?{transform:n.transform}:{}),{headers:this.headers}),s=n?.download?`&download=${n.download===!0?"":n.download}`:"";return o={signedUrl:encodeURI(`${this.url}${o.signedURL}${s}`)},{data:o,error:null}}catch(i){if((0,zt.isStorageError)(i))return{data:null,error:i};throw i}})}createSignedUrls(e,r,n){return Ht(this,void 0,void 0,function*(){try{let i=yield(0,Lr.post)(this.fetch,`${this.url}/object/sign/${this.bucketId}`,{expiresIn:r,paths:e},{headers:this.headers}),o=n?.download?`&download=${n.download===!0?"":n.download}`:"";return{data:i.map(s=>Object.assign(Object.assign({},s),{signedUrl:s.signedURL?encodeURI(`${this.url}${s.signedURL}${o}`):null})),error:null}}catch(i){if((0,zt.isStorageError)(i))return{data:null,error:i};throw i}})}download(e,r){return Ht(this,void 0,void 0,function*(){let i=typeof r?.transform<"u"?"render/image/authenticated":"object",o=this.transformOptsToQueryString(r?.transform||{}),s=o?`?${o}`:"";try{let a=this._getFinalPath(e);return{data:yield(yield(0,Lr.get)(this.fetch,`${this.url}/${i}/${a}${s}`,{headers:this.headers,noResolveJson:!0})).blob(),error:null}}catch(a){if((0,zt.isStorageError)(a))return{data:null,error:a};throw a}})}info(e){return Ht(this,void 0,void 0,function*(){let r=this._getFinalPath(e);try{let n=yield(0,Lr.get)(this.fetch,`${this.url}/object/info/${r}`,{headers:this.headers});return{data:(0,o_.recursiveToCamel)(n),error:null}}catch(n){if((0,zt.isStorageError)(n))return{data:null,error:n};throw n}})}exists(e){return Ht(this,void 0,void 0,function*(){let r=this._getFinalPath(e);try{return yield(0,Lr.head)(this.fetch,`${this.url}/object/${r}`,{headers:this.headers}),{data:!0,error:null}}catch(n){if((0,zt.isStorageError)(n)&&n instanceof zt.StorageUnknownError){let i=n.originalError;if([400,404].includes(i?.status))return{data:!1,error:n}}throw n}})}getPublicUrl(e,r){let n=this._getFinalPath(e),i=[],o=r?.download?`download=${r.download===!0?"":r.download}`:"";o!==""&&i.push(o);let a=typeof r?.transform<"u"?"render/image":"object",u=this.transformOptsToQueryString(r?.transform||{});u!==""&&i.push(u);let c=i.join("&");return c!==""&&(c=`?${c}`),{data:{publicUrl:encodeURI(`${this.url}/${a}/public/${n}${c}`)}}}remove(e){return Ht(this,void 0,void 0,function*(){try{return{data:yield(0,Lr.remove)(this.fetch,`${this.url}/object/${this.bucketId}`,{prefixes:e},{headers:this.headers}),error:null}}catch(r){if((0,zt.isStorageError)(r))return{data:null,error:r};throw r}})}list(e,r,n){return Ht(this,void 0,void 0,function*(){try{let i=Object.assign(Object.assign(Object.assign({},Tq),r),{prefix:e||""});return{data:yield(0,Lr.post)(this.fetch,`${this.url}/object/list/${this.bucketId}`,i,{headers:this.headers},n),error:null}}catch(i){if((0,zt.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("&")}};Xa.default=Em});var u_=y(vl=>{"use strict";Object.defineProperty(vl,"__esModule",{value:!0});vl.version=void 0;vl.version="2.7.1"});var c_=y(bl=>{"use strict";Object.defineProperty(bl,"__esModule",{value:!0});bl.DEFAULT_HEADERS=void 0;var Pq=u_();bl.DEFAULT_HEADERS={"X-Client-Info":`storage-js/${Pq.version}`}});var l_=y(Za=>{"use strict";var Vo=Za&&Za.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(l){try{c(n.next(l))}catch(f){s(f)}}function u(l){try{c(n.throw(l))}catch(f){s(f)}}function c(l){l.done?o(l.value):i(l.value).then(a,u)}c((n=n.apply(t,e||[])).next())})};Object.defineProperty(Za,"__esModule",{value:!0});var Rq=c_(),Ho=Ya(),zo=_m(),$q=Dl(),Cm=class{constructor(e,r={},n){this.url=e,this.headers=Object.assign(Object.assign({},Rq.DEFAULT_HEADERS),r),this.fetch=(0,$q.resolveFetch)(n)}listBuckets(){return Vo(this,void 0,void 0,function*(){try{return{data:yield(0,zo.get)(this.fetch,`${this.url}/bucket`,{headers:this.headers}),error:null}}catch(e){if((0,Ho.isStorageError)(e))return{data:null,error:e};throw e}})}getBucket(e){return Vo(this,void 0,void 0,function*(){try{return{data:yield(0,zo.get)(this.fetch,`${this.url}/bucket/${e}`,{headers:this.headers}),error:null}}catch(r){if((0,Ho.isStorageError)(r))return{data:null,error:r};throw r}})}createBucket(e,r={public:!1}){return Vo(this,void 0,void 0,function*(){try{return{data:yield(0,zo.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,Ho.isStorageError)(n))return{data:null,error:n};throw n}})}updateBucket(e,r){return Vo(this,void 0,void 0,function*(){try{return{data:yield(0,zo.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,Ho.isStorageError)(n))return{data:null,error:n};throw n}})}emptyBucket(e){return Vo(this,void 0,void 0,function*(){try{return{data:yield(0,zo.post)(this.fetch,`${this.url}/bucket/${e}/empty`,{},{headers:this.headers}),error:null}}catch(r){if((0,Ho.isStorageError)(r))return{data:null,error:r};throw r}})}deleteBucket(e){return Vo(this,void 0,void 0,function*(){try{return{data:yield(0,zo.remove)(this.fetch,`${this.url}/bucket/${e}`,{},{headers:this.headers}),error:null}}catch(r){if((0,Ho.isStorageError)(r))return{data:null,error:r};throw r}})}};Za.default=Cm});var d_=y(Go=>{"use strict";var f_=Go&&Go.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Go,"__esModule",{value:!0});Go.StorageClient=void 0;var Iq=f_(a_()),jq=f_(l_()),Sm=class extends jq.default{constructor(e,r={},n){super(e,r,n)}from(e){return new Iq.default(this.url,this.headers,e,this.fetch)}};Go.StorageClient=Sm});var p_=y(h_=>{"use strict";Object.defineProperty(h_,"__esModule",{value:!0})});var g_=y(Br=>{"use strict";var Nq=Br&&Br.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),m_=Br&&Br.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Nq(e,t,r)};Object.defineProperty(Br,"__esModule",{value:!0});Br.StorageClient=void 0;var Lq=d_();Object.defineProperty(Br,"StorageClient",{enumerable:!0,get:function(){return Lq.StorageClient}});m_(p_(),Br);m_(Ya(),Br)});var y_=y(wl=>{"use strict";Object.defineProperty(wl,"__esModule",{value:!0});wl.version=void 0;wl.version="2.46.0"});var D_=y(ir=>{"use strict";Object.defineProperty(ir,"__esModule",{value:!0});ir.DEFAULT_REALTIME_OPTIONS=ir.DEFAULT_AUTH_OPTIONS=ir.DEFAULT_DB_OPTIONS=ir.DEFAULT_GLOBAL_OPTIONS=ir.DEFAULT_HEADERS=void 0;var Bq=y_(),Qa="";typeof Deno<"u"?Qa="deno":typeof document<"u"?Qa="web":typeof navigator<"u"&&navigator.product==="ReactNative"?Qa="react-native":Qa="node";ir.DEFAULT_HEADERS={"X-Client-Info":`supabase-js-${Qa}/${Bq.version}`};ir.DEFAULT_GLOBAL_OPTIONS={headers:ir.DEFAULT_HEADERS};ir.DEFAULT_DB_OPTIONS={schema:"public"};ir.DEFAULT_AUTH_OPTIONS={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"};ir.DEFAULT_REALTIME_OPTIONS={}});var b_=y(ft=>{"use strict";var qq=ft&&ft.__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]}),Mq=ft&&ft.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Uq=ft&&ft.__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)&&qq(e,t,r);return Mq(e,t),e},Vq=ft&&ft.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(l){try{c(n.next(l))}catch(f){s(f)}}function u(l){try{c(n.throw(l))}catch(f){s(f)}}function c(l){l.done?o(l.value):i(l.value).then(a,u)}c((n=n.apply(t,e||[])).next())})};Object.defineProperty(ft,"__esModule",{value:!0});ft.fetchWithAuth=ft.resolveHeadersConstructor=ft.resolveFetch=void 0;var v_=Uq((Fi(),Ae(xi))),Hq=t=>{let e;return t?e=t:typeof fetch>"u"?e=v_.default:e=fetch,(...r)=>e(...r)};ft.resolveFetch=Hq;var zq=()=>typeof Headers>"u"?v_.Headers:Headers;ft.resolveHeadersConstructor=zq;var Gq=(t,e,r)=>{let n=(0,ft.resolveFetch)(r),i=(0,ft.resolveHeadersConstructor)();return(o,s)=>Vq(void 0,void 0,void 0,function*(){var a;let u=(a=yield e())!==null&&a!==void 0?a:t,c=new i(s?.headers);return c.has("apikey")||c.set("apikey",t),c.has("Authorization")||c.set("Authorization",`Bearer ${u}`),n(o,Object.assign(Object.assign({},s),{headers:c}))})};ft.fetchWithAuth=Gq});var w_=y(mr=>{"use strict";var Wq=mr&&mr.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(l){try{c(n.next(l))}catch(f){s(f)}}function u(l){try{c(n.throw(l))}catch(f){s(f)}}function c(l){l.done?o(l.value):i(l.value).then(a,u)}c((n=n.apply(t,e||[])).next())})};Object.defineProperty(mr,"__esModule",{value:!0});mr.applySettingDefaults=mr.isBrowser=mr.stripTrailingSlash=mr.uuid=void 0;function Kq(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var e=Math.random()*16|0,r=t=="x"?e:e&3|8;return r.toString(16)})}mr.uuid=Kq;function Yq(t){return t.replace(/\/$/,"")}mr.stripTrailingSlash=Yq;var Jq=()=>typeof window<"u";mr.isBrowser=Jq;function Xq(t,e){let{db:r,auth:n,realtime:i,global:o}=t,{db:s,auth:a,realtime:u,global:c}=e,l={db:Object.assign(Object.assign({},s),r),auth:Object.assign(Object.assign({},a),n),realtime:Object.assign(Object.assign({},u),i),global:Object.assign(Object.assign({},c),o),accessToken:()=>Wq(this,void 0,void 0,function*(){return""})};return t.accessToken?l.accessToken=t.accessToken:delete l.accessToken,l}mr.applySettingDefaults=Xq});var xm=y(_l=>{"use strict";Object.defineProperty(_l,"__esModule",{value:!0});_l.version=void 0;_l.version="2.65.1"});var El=y(dt=>{"use strict";Object.defineProperty(dt,"__esModule",{value:!0});dt.API_VERSIONS=dt.API_VERSION_HEADER_NAME=dt.NETWORK_FAILURE=dt.EXPIRY_MARGIN=dt.DEFAULT_HEADERS=dt.AUDIENCE=dt.STORAGE_KEY=dt.GOTRUE_URL=void 0;var Zq=xm();dt.GOTRUE_URL="http://localhost:9999";dt.STORAGE_KEY="supabase.auth.token";dt.AUDIENCE="";dt.DEFAULT_HEADERS={"X-Client-Info":`gotrue-js/${Zq.version}`};dt.EXPIRY_MARGIN=10;dt.NETWORK_FAILURE={MAX_RETRIES:10,RETRY_INTERVAL:2};dt.API_VERSION_HEADER_NAME="X-Supabase-Api-Version";dt.API_VERSIONS={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}}});var Wo=y(te=>{"use strict";var Qq=te&&te.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),eM=te&&te.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),tM=te&&te.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&Qq(e,t,r);return eM(e,t),e};Object.defineProperty(te,"__esModule",{value:!0});te.parseResponseAPIVersion=te.getCodeChallengeAndMethod=te.generatePKCEChallenge=te.generatePKCEVerifier=te.retryable=te.sleep=te.decodeJWTPayload=te.Deferred=te.decodeBase64URL=te.removeItemAsync=te.getItemAsync=te.setItemAsync=te.looksLikeFetchResponse=te.resolveFetch=te.parseParametersFromURL=te.supportsLocalStorage=te.isBrowser=te.uuid=te.expiresAt=void 0;var rM=El();function nM(t){return Math.round(Date.now()/1e3)+t}te.expiresAt=nM;function iM(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){let e=Math.random()*16|0;return(t=="x"?e:e&3|8).toString(16)})}te.uuid=iM;var oM=()=>typeof document<"u";te.isBrowser=oM;var Ai={tested:!1,writable:!1},sM=()=>{if(!(0,te.isBrowser)())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(Ai.tested)return Ai.writable;let t=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(t,t),globalThis.localStorage.removeItem(t),Ai.tested=!0,Ai.writable=!0}catch{Ai.tested=!0,Ai.writable=!1}return Ai.writable};te.supportsLocalStorage=sM;function aM(t){let e={},r=new URL(t);if(r.hash&&r.hash[0]==="#")try{new URLSearchParams(r.hash.substring(1)).forEach((i,o)=>{e[o]=i})}catch{}return r.searchParams.forEach((n,i)=>{e[i]=n}),e}te.parseParametersFromURL=aM;var uM=t=>{let e;return t?e=t:typeof fetch>"u"?e=(...r)=>Promise.resolve().then(()=>tM((Fi(),Ae(xi)))).then(({default:n})=>n(...r)):e=fetch,(...r)=>e(...r)};te.resolveFetch=uM;var cM=t=>typeof t=="object"&&t!==null&&"status"in t&&"ok"in t&&"json"in t&&typeof t.json=="function";te.looksLikeFetchResponse=cM;var lM=async(t,e,r)=>{await t.setItem(e,JSON.stringify(r))};te.setItemAsync=lM;var fM=async(t,e)=>{let r=await t.getItem(e);if(!r)return null;try{return JSON.parse(r)}catch{return r}};te.getItemAsync=fM;var dM=async(t,e)=>{await t.removeItem(e)};te.removeItemAsync=dM;function __(t){let e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",r="",n,i,o,s,a,u,c,l=0;for(t=t.replace("-","+").replace("_","/");l<t.length;)s=e.indexOf(t.charAt(l++)),a=e.indexOf(t.charAt(l++)),u=e.indexOf(t.charAt(l++)),c=e.indexOf(t.charAt(l++)),n=s<<2|a>>4,i=(a&15)<<4|u>>2,o=(u&3)<<6|c,r=r+String.fromCharCode(n),u!=64&&i!=0&&(r=r+String.fromCharCode(i)),c!=64&&o!=0&&(r=r+String.fromCharCode(o));return r}te.decodeBase64URL=__;var Cl=class t{constructor(){this.promise=new t.promiseConstructor((e,r)=>{this.resolve=e,this.reject=r})}};te.Deferred=Cl;Cl.promiseConstructor=Promise;function hM(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(__(n))}te.decodeJWTPayload=hM;async function pM(t){return await new Promise(e=>{setTimeout(()=>e(null),t)})}te.sleep=pM;function mM(t,e){return new Promise((n,i)=>{(async()=>{for(let o=0;o<1/0;o++)try{let s=await t(o);if(!e(o,null,s)){n(s);return}}catch(s){if(!e(o,s)){i(s);return}}})()})}te.retryable=mM;function gM(t){return("0"+t.toString(16)).substr(-2)}function E_(){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,gM).join("")}te.generatePKCEVerifier=E_;async function yM(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 DM(t){return btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function C_(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 yM(t);return DM(r)}te.generatePKCEChallenge=C_;async function vM(t,e,r=!1){let n=E_(),i=n;r&&(i+="/PASSWORD_RECOVERY"),await(0,te.setItemAsync)(t,`${e}-code-verifier`,i);let o=await C_(n);return[o,n===o?"plain":"s256"]}te.getCodeChallengeAndMethod=vM;var bM=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function wM(t){let e=t.headers.get(rM.API_VERSION_HEADER_NAME);if(!e||!e.match(bM))return null;try{return new Date(`${e}T00:00:00.0Z`)}catch{return null}}te.parseResponseAPIVersion=wM});var tu=y(he=>{"use strict";Object.defineProperty(he,"__esModule",{value:!0});he.isAuthWeakPasswordError=he.AuthWeakPasswordError=he.isAuthRetryableFetchError=he.AuthRetryableFetchError=he.AuthPKCEGrantCodeExchangeError=he.AuthImplicitGrantRedirectError=he.AuthInvalidCredentialsError=he.AuthInvalidTokenResponseError=he.isAuthSessionMissingError=he.AuthSessionMissingError=he.CustomAuthError=he.AuthUnknownError=he.isAuthApiError=he.AuthApiError=he.isAuthError=he.AuthError=void 0;var Ko=class extends Error{constructor(e,r,n){super(e),this.__isAuthError=!0,this.name="AuthError",this.status=r,this.code=n}};he.AuthError=Ko;function eu(t){return typeof t=="object"&&t!==null&&"__isAuthError"in t}he.isAuthError=eu;var Fm=class extends Ko{constructor(e,r,n){super(e,r,n),this.name="AuthApiError",this.status=r,this.code=n}};he.AuthApiError=Fm;function _M(t){return eu(t)&&t.name==="AuthApiError"}he.isAuthApiError=_M;var Om=class extends Ko{constructor(e,r){super(e),this.name="AuthUnknownError",this.originalError=r}};he.AuthUnknownError=Om;var qr=class extends Ko{constructor(e,r,n,i){super(e,n,i),this.name=r,this.status=n}};he.CustomAuthError=qr;var Am=class extends qr{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}};he.AuthSessionMissingError=Am;function EM(t){return eu(t)&&t.name==="AuthSessionMissingError"}he.isAuthSessionMissingError=EM;var km=class extends qr{constructor(){super("Auth session or user missing","AuthInvalidTokenResponseError",500,void 0)}};he.AuthInvalidTokenResponseError=km;var Tm=class extends qr{constructor(e){super(e,"AuthInvalidCredentialsError",400,void 0)}};he.AuthInvalidCredentialsError=Tm;var Pm=class extends qr{constructor(e,r=null){super(e,"AuthImplicitGrantRedirectError",500,void 0),this.details=null,this.details=r}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}};he.AuthImplicitGrantRedirectError=Pm;var Rm=class extends qr{constructor(e,r=null){super(e,"AuthPKCEGrantCodeExchangeError",500,void 0),this.details=null,this.details=r}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}};he.AuthPKCEGrantCodeExchangeError=Rm;var $m=class extends qr{constructor(e,r){super(e,"AuthRetryableFetchError",r,void 0)}};he.AuthRetryableFetchError=$m;function CM(t){return eu(t)&&t.name==="AuthRetryableFetchError"}he.isAuthRetryableFetchError=CM;var Im=class extends qr{constructor(e,r,n){super(e,"AuthWeakPasswordError",r,"weak_password"),this.reasons=n}};he.AuthWeakPasswordError=Im;function SM(t){return eu(t)&&t.name==="AuthWeakPasswordError"}he.isAuthWeakPasswordError=SM});var Lm=y(nt=>{"use strict";var xM=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 Sl=El(),jm=Wo(),Kn=tu(),ki=t=>t.msg||t.message||t.error_description||t.error||JSON.stringify(t),FM=[502,503,504];async function Nm(t){var e;if(!(0,jm.looksLikeFetchResponse)(t))throw new Kn.AuthRetryableFetchError(ki(t),0);if(FM.includes(t.status))throw new Kn.AuthRetryableFetchError(ki(t),t.status);let r;try{r=await t.json()}catch(o){throw new Kn.AuthUnknownError(ki(o),o)}let n,i=(0,jm.parseResponseAPIVersion)(t);if(i&&i.getTime()>=Sl.API_VERSIONS["2024-01-01"].timestamp&&typeof r=="object"&&r&&typeof r.code=="string"?n=r.code:typeof r=="object"&&r&&typeof r.error_code=="string"&&(n=r.error_code),n){if(n==="weak_password")throw new Kn.AuthWeakPasswordError(ki(r),t.status,((e=r.weak_password)===null||e===void 0?void 0:e.reasons)||[]);if(n==="session_not_found")throw new Kn.AuthSessionMissingError}else if(typeof r=="object"&&r&&typeof r.weak_password=="object"&&r.weak_password&&Array.isArray(r.weak_password.reasons)&&r.weak_password.reasons.length&&r.weak_password.reasons.reduce((o,s)=>o&&typeof s=="string",!0))throw new Kn.AuthWeakPasswordError(ki(r),t.status,r.weak_password.reasons);throw new Kn.AuthApiError(ki(r),t.status||500,n)}nt.handleError=Nm;var OM=(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 AM(t,e,r,n){var i;let o=Object.assign({},n?.headers);o[Sl.API_VERSION_HEADER_NAME]||(o[Sl.API_VERSION_HEADER_NAME]=Sl.API_VERSIONS["2024-01-01"].name),n?.jwt&&(o.Authorization=`Bearer ${n.jwt}`);let s=(i=n?.query)!==null&&i!==void 0?i:{};n?.redirectTo&&(s.redirect_to=n.redirectTo);let a=Object.keys(s).length?"?"+new URLSearchParams(s).toString():"",u=await kM(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=AM;async function kM(t,e,r,n,i,o){let s=OM(e,n,i,o),a;try{a=await t(r,Object.assign({},s))}catch(u){throw console.error(u),new Kn.AuthRetryableFetchError(ki(u),0)}if(a.ok||await Nm(a),n?.noResolveJson)return a;try{return await a.json()}catch(u){await Nm(u)}}function S_(t){var e;let r=null;jM(t)&&(r=Object.assign({},t),t.expires_at||(r.expires_at=(0,jm.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=S_;function TM(t){let e=S_(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=TM;function PM(t){var e;return{data:{user:(e=t.user)!==null&&e!==void 0?e:t},error:null}}nt._userResponse=PM;function RM(t){return{data:t,error:null}}nt._ssoResponse=RM;function $M(t){let{action_link:e,email_otp:r,hashed_token:n,redirect_to:i,verification_type:o}=t,s=xM(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=$M;function IM(t){return t}nt._noResolveJsonResponse=IM;function jM(t){return t.access_token&&t.refresh_token&&t.expires_in}});var xl=y(ru=>{"use strict";var NM=ru&&ru.__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(ru,"__esModule",{value:!0});var bt=Lm(),LM=Wo(),Mr=tu(),Bm=class{constructor({url:e="",headers:r={},fetch:n}){this.url=e,this.headers=r,this.fetch=(0,LM.resolveFetch)(n),this.mfa={listFactors:this._listFactors.bind(this),deleteFactor:this._deleteFactor.bind(this)}}async signOut(e,r="global"){try{return await(0,bt._request)(this.fetch,"POST",`${this.url}/logout?scope=${r}`,{headers:this.headers,jwt:e,noResolveJson:!0}),{data:null,error:null}}catch(n){if((0,Mr.isAuthError)(n))return{data:null,error:n};throw n}}async inviteUserByEmail(e,r={}){try{return await(0,bt._request)(this.fetch,"POST",`${this.url}/invite`,{body:{email:e,data:r.data},headers:this.headers,redirectTo:r.redirectTo,xform:bt._userResponse})}catch(n){if((0,Mr.isAuthError)(n))return{data:{user:null},error:n};throw n}}async generateLink(e){try{let{options:r}=e,n=NM(e,["options"]),i=Object.assign(Object.assign({},n),r);return"newEmail"in n&&(i.new_email=n?.newEmail,delete i.newEmail),await(0,bt._request)(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:i,headers:this.headers,xform:bt._generateLinkResponse,redirectTo:r?.redirectTo})}catch(r){if((0,Mr.isAuthError)(r))return{data:{properties:null,user:null},error:r};throw r}}async createUser(e){try{return await(0,bt._request)(this.fetch,"POST",`${this.url}/admin/users`,{body:e,headers:this.headers,xform:bt._userResponse})}catch(r){if((0,Mr.isAuthError)(r))return{data:{user:null},error:r};throw r}}async listUsers(e){var r,n,i,o,s,a,u;try{let c={nextPage:null,lastPage:0,total:0},l=await(0,bt._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:bt._noResolveJsonResponse});if(l.error)throw l.error;let f=await l.json(),h=(s=l.headers.get("x-total-count"))!==null&&s!==void 0?s:0,d=(u=(a=l.headers.get("link"))===null||a===void 0?void 0:a.split(","))!==null&&u!==void 0?u:[];return d.length>0&&(d.forEach(m=>{let b=parseInt(m.split(";")[0].split("=")[1].substring(0,1)),g=JSON.parse(m.split(";")[1].split("=")[1]);c[`${g}Page`]=b}),c.total=parseInt(h)),{data:Object.assign(Object.assign({},f),c),error:null}}catch(c){if((0,Mr.isAuthError)(c))return{data:{users:[]},error:c};throw c}}async getUserById(e){try{return await(0,bt._request)(this.fetch,"GET",`${this.url}/admin/users/${e}`,{headers:this.headers,xform:bt._userResponse})}catch(r){if((0,Mr.isAuthError)(r))return{data:{user:null},error:r};throw r}}async updateUserById(e,r){try{return await(0,bt._request)(this.fetch,"PUT",`${this.url}/admin/users/${e}`,{body:r,headers:this.headers,xform:bt._userResponse})}catch(n){if((0,Mr.isAuthError)(n))return{data:{user:null},error:n};throw n}}async deleteUser(e,r=!1){try{return await(0,bt._request)(this.fetch,"DELETE",`${this.url}/admin/users/${e}`,{headers:this.headers,body:{should_soft_delete:r},xform:bt._userResponse})}catch(n){if((0,Mr.isAuthError)(n))return{data:{user:null},error:n};throw n}}async _listFactors(e){try{let{data:r,error:n}=await(0,bt._request)(this.fetch,"GET",`${this.url}/admin/users/${e.userId}/factors`,{headers:this.headers,xform:i=>({data:{factors:i},error:null})});return{data:r,error:n}}catch(r){if((0,Mr.isAuthError)(r))return{data:null,error:r};throw r}}async _deleteFactor(e){try{return{data:await(0,bt._request)(this.fetch,"DELETE",`${this.url}/admin/users/${e.userId}/factors/${e.id}`,{headers:this.headers}),error:null}}catch(r){if((0,Mr.isAuthError)(r))return{data:null,error:r};throw r}}};ru.default=Bm});var x_=y(Yo=>{"use strict";Object.defineProperty(Yo,"__esModule",{value:!0});Yo.memoryLocalStorageAdapter=Yo.localStorageAdapter=void 0;var qm=Wo();Yo.localStorageAdapter={getItem:t=>(0,qm.supportsLocalStorage)()?globalThis.localStorage.getItem(t):null,setItem:(t,e)=>{(0,qm.supportsLocalStorage)()&&globalThis.localStorage.setItem(t,e)},removeItem:t=>{(0,qm.supportsLocalStorage)()&&globalThis.localStorage.removeItem(t)}};function BM(t={}){return{getItem:e=>t[e]||null,setItem:(e,r)=>{t[e]=r},removeItem:e=>{delete t[e]}}}Yo.memoryLocalStorageAdapter=BM});var F_=y(Fl=>{"use strict";Object.defineProperty(Fl,"__esModule",{value:!0});Fl.polyfillGlobalThis=void 0;function qM(){if(typeof globalThis!="object")try{Object.defineProperty(Object.prototype,"__magic__",{get:function(){return this},configurable:!0}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__}catch{typeof self<"u"&&(self.globalThis=self)}}Fl.polyfillGlobalThis=qM});var Mm=y(Ct=>{"use strict";Object.defineProperty(Ct,"__esModule",{value:!0});Ct.navigatorLock=Ct.NavigatorLockAcquireTimeoutError=Ct.LockAcquireTimeoutError=Ct.internals=void 0;var MM=Wo();Ct.internals={debug:!!(globalThis&&(0,MM.supportsLocalStorage)()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug")==="true")};var Ol=class extends Error{constructor(e){super(e),this.isAcquireTimeout=!0}};Ct.LockAcquireTimeoutError=Ol;var Al=class extends Ol{};Ct.NavigatorLockAcquireTimeoutError=Al;async function UM(t,e,r){Ct.internals.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire lock",t,e);let n=new globalThis.AbortController;return e>0&&setTimeout(()=>{n.abort(),Ct.internals.debug&&console.log("@supabase/gotrue-js: navigatorLock acquire timed out",t)},e),await globalThis.navigator.locks.request(t,e===0?{mode:"exclusive",ifAvailable:!0}:{mode:"exclusive",signal:n.signal},async i=>{if(i){Ct.internals.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquired",t,i.name);try{return await r()}finally{Ct.internals.debug&&console.log("@supabase/gotrue-js: navigatorLock: released",t,i.name)}}else{if(e===0)throw Ct.internals.debug&&console.log("@supabase/gotrue-js: navigatorLock: not immediately available",t),new Al(`Acquiring an exclusive Navigator LockManager lock "${t}" immediately failed`);if(Ct.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()}})}Ct.navigatorLock=UM});var Vm=y(ou=>{"use strict";var VM=ou&&ou.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ou,"__esModule",{value:!0});var HM=VM(xl()),iu=El(),Z=tu(),ae=Lm(),fe=Wo(),Um=x_(),zM=F_(),GM=xm(),O_=Mm();(0,zM.polyfillGlobalThis)();var WM={url:iu.GOTRUE_URL,storageKey:iu.STORAGE_KEY,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:iu.DEFAULT_HEADERS,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1},nu=30*1e3,A_=3;async function k_(t,e,r){return await r()}var kl=class t{constructor(e){var r,n;this.memoryStorage=null,this.stateChangeEmitters=new Map,this.autoRefreshTicker=null,this.visibilityChangedCallback=null,this.refreshingDeferred=null,this.initializePromise=null,this.detectSessionInUrl=!0,this.hasCustomAuthorizationHeader=!1,this.suppressGetSessionWarning=!1,this.lockAcquired=!1,this.pendingInLock=[],this.broadcastChannel=null,this.logger=console.log,this.instanceID=t.nextInstanceID,t.nextInstanceID+=1,this.instanceID>0&&(0,fe.isBrowser)()&&console.warn("Multiple GoTrueClient instances detected in the same browser context. It is not an error, but this should be avoided as it may produce undefined behavior when used concurrently under the same storage key.");let i=Object.assign(Object.assign({},WM),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 HM.default({url:i.url,headers:i.headers,fetch:i.fetch}),this.url=i.url,this.headers=i.headers,this.fetch=(0,fe.resolveFetch)(i.fetch),this.lock=i.lock||k_,this.detectSessionInUrl=i.detectSessionInUrl,this.flowType=i.flowType,this.hasCustomAuthorizationHeader=i.hasCustomAuthorizationHeader,i.lock?this.lock=i.lock:(0,fe.isBrowser)()&&(!((r=globalThis?.navigator)===null||r===void 0)&&r.locks)?this.lock=O_.navigatorLock:this.lock=k_,this.mfa={verify:this._verify.bind(this),enroll:this._enroll.bind(this),unenroll:this._unenroll.bind(this),challenge:this._challenge.bind(this),listFactors:this._listFactors.bind(this),challengeAndVerify:this._challengeAndVerify.bind(this),getAuthenticatorAssuranceLevel:this._getAuthenticatorAssuranceLevel.bind(this)},this.persistSession?i.storage?this.storage=i.storage:(0,fe.supportsLocalStorage)()?this.storage=Um.localStorageAdapter:(this.memoryStorage={},this.storage=(0,Um.memoryLocalStorageAdapter)(this.memoryStorage)):(this.memoryStorage={},this.storage=(0,Um.memoryLocalStorageAdapter)(this.memoryStorage)),(0,fe.isBrowser)()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(o){console.error("Failed to create a new BroadcastChannel, multi-tab state changes will not be available",o)}(n=this.broadcastChannel)===null||n===void 0||n.addEventListener("message",async o=>{this._debug("received broadcast notification from other tab or client",o),await this._notifyAllSubscribers(o.data.event,o.data.session,!1)})}this.initialize()}_debug(...e){return this.logDebugMessages&&this.logger(`GoTrueClient@${this.instanceID} (${GM.version}) ${new Date().toISOString()}`,...e),this}async initialize(){return this.initializePromise?await this.initializePromise:(this.initializePromise=(async()=>await this._acquireLock(-1,async()=>await this._initialize()))(),await this.initializePromise)}async _initialize(){try{let e=(0,fe.isBrowser)()?await this._isPKCEFlow():!1;if(this._debug("#_initialize()","begin","is PKCE flow",e),e||this.detectSessionInUrl&&this._isImplicitGrantFlow()){let{data:r,error:n}=await this._getSessionFromURL(e);if(n)return this._debug("#_initialize()","error detecting session from URL",n),n?.code==="identity_already_exists"?{error:n}:(await this._removeSession(),{error:n});let{session:i,redirectType:o}=r;return this._debug("#_initialize()","detected session in URL",i,"redirect type",o),await this._saveSession(i),setTimeout(async()=>{o==="recovery"?await this._notifyAllSubscribers("PASSWORD_RECOVERY",i):await this._notifyAllSubscribers("SIGNED_IN",i)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(e){return(0,Z.isAuthError)(e)?{error:e}:{error:new Z.AuthUnknownError("Unexpected error during initialization",e)}}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(e){var r,n,i;try{let o=await(0,ae._request)(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{data:(n=(r=e?.options)===null||r===void 0?void 0:r.data)!==null&&n!==void 0?n:{},gotrue_meta_security:{captcha_token:(i=e?.options)===null||i===void 0?void 0:i.captchaToken}},xform:ae._sessionResponse}),{data:s,error:a}=o;if(a||!s)return{data:{user:null,session:null},error:a};let u=s.session,c=s.user;return s.session&&(await this._saveSession(s.session),await this._notifyAllSubscribers("SIGNED_IN",u)),{data:{user:c,session:u},error:null}}catch(o){if((0,Z.isAuthError)(o))return{data:{user:null,session:null},error:o};throw o}}async signUp(e){var r,n,i;try{let o;if("email"in e){let{email:l,password:f,options:h}=e,d=null,m=null;this.flowType==="pkce"&&([d,m]=await(0,fe.getCodeChallengeAndMethod)(this.storage,this.storageKey)),o=await(0,ae._request)(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:h?.emailRedirectTo,body:{email:l,password:f,data:(r=h?.data)!==null&&r!==void 0?r:{},gotrue_meta_security:{captcha_token:h?.captchaToken},code_challenge:d,code_challenge_method:m},xform:ae._sessionResponse})}else if("phone"in e){let{phone:l,password:f,options:h}=e;o=await(0,ae._request)(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:l,password:f,data:(n=h?.data)!==null&&n!==void 0?n:{},channel:(i=h?.channel)!==null&&i!==void 0?i:"sms",gotrue_meta_security:{captcha_token:h?.captchaToken}},xform:ae._sessionResponse})}else throw new Z.AuthInvalidCredentialsError("You must provide either an email or phone number and a password");let{data:s,error:a}=o;if(a||!s)return{data:{user:null,session:null},error:a};let u=s.session,c=s.user;return s.session&&(await this._saveSession(s.session),await this._notifyAllSubscribers("SIGNED_IN",u)),{data:{user:c,session:u},error:null}}catch(o){if((0,Z.isAuthError)(o))return{data:{user:null,session:null},error:o};throw o}}async signInWithPassword(e){try{let r;if("email"in e){let{email:o,password:s,options:a}=e;r=await(0,ae._request)(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:o,password:s,gotrue_meta_security:{captcha_token:a?.captchaToken}},xform:ae._sessionResponsePassword})}else if("phone"in e){let{phone:o,password:s,options:a}=e;r=await(0,ae._request)(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:o,password:s,gotrue_meta_security:{captcha_token:a?.captchaToken}},xform:ae._sessionResponsePassword})}else throw new Z.AuthInvalidCredentialsError("You must provide either an email or phone number and a password");let{data:n,error:i}=r;return i?{data:{user:null,session:null},error:i}:!n||!n.session||!n.user?{data:{user:null,session:null},error:new Z.AuthInvalidTokenResponseError}:(n.session&&(await this._saveSession(n.session),await this._notifyAllSubscribers("SIGNED_IN",n.session)),{data:Object.assign({user:n.user,session:n.session},n.weak_password?{weakPassword:n.weak_password}:null),error:i})}catch(r){if((0,Z.isAuthError)(r))return{data:{user:null,session:null},error:r};throw r}}async signInWithOAuth(e){var r,n,i,o;return await this._handleProviderSignIn(e.provider,{redirectTo:(r=e.options)===null||r===void 0?void 0:r.redirectTo,scopes:(n=e.options)===null||n===void 0?void 0:n.scopes,queryParams:(i=e.options)===null||i===void 0?void 0:i.queryParams,skipBrowserRedirect:(o=e.options)===null||o===void 0?void 0:o.skipBrowserRedirect})}async exchangeCodeForSession(e){return await this.initializePromise,this._acquireLock(-1,async()=>this._exchangeCodeForSession(e))}async _exchangeCodeForSession(e){let r=await(0,fe.getItemAsync)(this.storage,`${this.storageKey}-code-verifier`),[n,i]=(r??"").split("/");try{let{data:o,error:s}=await(0,ae._request)(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:e,code_verifier:n},xform:ae._sessionResponse});if(await(0,fe.removeItemAsync)(this.storage,`${this.storageKey}-code-verifier`),s)throw s;return!o||!o.session||!o.user?{data:{user:null,session:null,redirectType:null},error:new Z.AuthInvalidTokenResponseError}:(o.session&&(await this._saveSession(o.session),await this._notifyAllSubscribers("SIGNED_IN",o.session)),{data:Object.assign(Object.assign({},o),{redirectType:i??null}),error:s})}catch(o){if((0,Z.isAuthError)(o))return{data:{user:null,session:null,redirectType:null},error:o};throw o}}async signInWithIdToken(e){try{let{options:r,provider:n,token:i,access_token:o,nonce:s}=e,a=await(0,ae._request)(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:n,id_token:i,access_token:o,nonce:s,gotrue_meta_security:{captcha_token:r?.captchaToken}},xform:ae._sessionResponse}),{data:u,error:c}=a;return c?{data:{user:null,session:null},error:c}:!u||!u.session||!u.user?{data:{user:null,session:null},error:new Z.AuthInvalidTokenResponseError}:(u.session&&(await this._saveSession(u.session),await this._notifyAllSubscribers("SIGNED_IN",u.session)),{data:u,error:c})}catch(r){if((0,Z.isAuthError)(r))return{data:{user:null,session:null},error:r};throw r}}async signInWithOtp(e){var r,n,i,o,s;try{if("email"in e){let{email:a,options:u}=e,c=null,l=null;this.flowType==="pkce"&&([c,l]=await(0,fe.getCodeChallengeAndMethod)(this.storage,this.storageKey));let{error:f}=await(0,ae._request)(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:a,data:(r=u?.data)!==null&&r!==void 0?r:{},create_user:(n=u?.shouldCreateUser)!==null&&n!==void 0?n:!0,gotrue_meta_security:{captcha_token:u?.captchaToken},code_challenge:c,code_challenge_method:l},redirectTo:u?.emailRedirectTo});return{data:{user:null,session:null},error:f}}if("phone"in e){let{phone:a,options:u}=e,{data:c,error:l}=await(0,ae._request)(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:a,data:(i=u?.data)!==null&&i!==void 0?i:{},create_user:(o=u?.shouldCreateUser)!==null&&o!==void 0?o:!0,gotrue_meta_security:{captcha_token:u?.captchaToken},channel:(s=u?.channel)!==null&&s!==void 0?s:"sms"}});return{data:{user:null,session:null,messageId:c?.message_id},error:l}}throw new Z.AuthInvalidCredentialsError("You must provide either an email or phone number.")}catch(a){if((0,Z.isAuthError)(a))return{data:{user:null,session:null},error:a};throw a}}async verifyOtp(e){var r,n;try{let i,o;"options"in e&&(i=(r=e.options)===null||r===void 0?void 0:r.redirectTo,o=(n=e.options)===null||n===void 0?void 0:n.captchaToken);let{data:s,error:a}=await(0,ae._request)(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},e),{gotrue_meta_security:{captcha_token:o}}),redirectTo:i,xform:ae._sessionResponse});if(a)throw a;if(!s)throw new Error("An error occurred on token verification.");let u=s.session,c=s.user;return u?.access_token&&(await this._saveSession(u),await this._notifyAllSubscribers(e.type=="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",u)),{data:{user:c,session:u},error:null}}catch(i){if((0,Z.isAuthError)(i))return{data:{user:null,session:null},error:i};throw i}}async signInWithSSO(e){var r,n,i;try{let o=null,s=null;return this.flowType==="pkce"&&([o,s]=await(0,fe.getCodeChallengeAndMethod)(this.storage,this.storageKey)),await(0,ae._request)(this.fetch,"POST",`${this.url}/sso`,{body:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},"providerId"in e?{provider_id:e.providerId}:null),"domain"in e?{domain:e.domain}:null),{redirect_to:(n=(r=e.options)===null||r===void 0?void 0:r.redirectTo)!==null&&n!==void 0?n:void 0}),!((i=e?.options)===null||i===void 0)&&i.captchaToken?{gotrue_meta_security:{captcha_token:e.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:o,code_challenge_method:s}),headers:this.headers,xform:ae._ssoResponse})}catch(o){if((0,Z.isAuthError)(o))return{data:null,error:o};throw o}}async reauthenticate(){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._reauthenticate())}async _reauthenticate(){try{return await this._useSession(async e=>{let{data:{session:r},error:n}=e;if(n)throw n;if(!r)throw new Z.AuthSessionMissingError;let{error:i}=await(0,ae._request)(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:r.access_token});return{data:{user:null,session:null},error:i}})}catch(e){if((0,Z.isAuthError)(e))return{data:{user:null,session:null},error:e};throw e}}async resend(e){try{let r=`${this.url}/resend`;if("email"in e){let{email:n,type:i,options:o}=e,{error:s}=await(0,ae._request)(this.fetch,"POST",r,{headers:this.headers,body:{email:n,type:i,gotrue_meta_security:{captcha_token:o?.captchaToken}},redirectTo:o?.emailRedirectTo});return{data:{user:null,session:null},error:s}}else if("phone"in e){let{phone:n,type:i,options:o}=e,{data:s,error:a}=await(0,ae._request)(this.fetch,"POST",r,{headers:this.headers,body:{phone:n,type:i,gotrue_meta_security:{captcha_token:o?.captchaToken}}});return{data:{user:null,session:null,messageId:s?.message_id},error:a}}throw new Z.AuthInvalidCredentialsError("You must provide either an email or phone number and a type")}catch(r){if((0,Z.isAuthError)(r))return{data:{user:null,session:null},error:r};throw r}}async getSession(){return await this.initializePromise,await this._acquireLock(-1,async()=>this._useSession(async r=>r))}async _acquireLock(e,r){this._debug("#_acquireLock","begin",e);try{if(this.lockAcquired){let n=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),i=(async()=>(await n,await r()))();return this.pendingInLock.push((async()=>{try{await i}catch{}})()),i}return await this.lock(`lock:${this.storageKey}`,e,async()=>{this._debug("#_acquireLock","lock acquired for storage key",this.storageKey);try{this.lockAcquired=!0;let n=r();for(this.pendingInLock.push((async()=>{try{await n}catch{}})()),await n;this.pendingInLock.length;){let i=[...this.pendingInLock];await Promise.all(i),this.pendingInLock.splice(0,i.length)}return await n}finally{this._debug("#_acquireLock","lock released for storage key",this.storageKey),this.lockAcquired=!1}})}finally{this._debug("#_acquireLock","end")}}async _useSession(e){this._debug("#_useSession","begin");try{let r=await this.__loadSession();return await e(r)}finally{this._debug("#_useSession","end")}}async __loadSession(){this._debug("#__loadSession()","begin"),this.lockAcquired||this._debug("#__loadSession()","used outside of an acquired lock!",new Error().stack);try{let e=null,r=await(0,fe.getItemAsync)(this.storage,this.storageKey);if(this._debug("#getSession()","session from storage",r),r!==null&&(this._isValidSession(r)?e=r:(this._debug("#getSession()","session from storage is not valid"),await this._removeSession())),!e)return{data:{session:null},error:null};let n=e.expires_at?e.expires_at<=Date.now()/1e3:!1;if(this._debug("#__loadSession()",`session has${n?"":" not"} expired`,"expires_at",e.expires_at),!n){if(this.storage.isServer){let s=this.suppressGetSessionWarning;e=new Proxy(e,{get:(u,c,l)=>(!s&&c==="user"&&(console.warn("Using the user object as returned from supabase.auth.getSession() or from some supabase.auth.onAuthStateChange() events could be insecure! This value comes directly from the storage medium (usually cookies on the server) and many not be authentic. Use supabase.auth.getUser() instead which authenticates the data by contacting the Supabase Auth server."),s=!0,this.suppressGetSessionWarning=!0),Reflect.get(u,c,l))})}return{data:{session:e},error:null}}let{session:i,error:o}=await this._callRefreshToken(e.refresh_token);return o?{data:{session:null},error:o}:{data:{session:i},error:null}}finally{this._debug("#__loadSession()","end")}}async getUser(e){return e?await this._getUser(e):(await this.initializePromise,await this._acquireLock(-1,async()=>await this._getUser()))}async _getUser(e){try{return e?await(0,ae._request)(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:e,xform:ae._userResponse}):await this._useSession(async r=>{var n,i,o;let{data:s,error:a}=r;if(a)throw a;return!(!((n=s.session)===null||n===void 0)&&n.access_token)&&!this.hasCustomAuthorizationHeader?{data:{user:null},error:new Z.AuthSessionMissingError}:await(0,ae._request)(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:(o=(i=s.session)===null||i===void 0?void 0:i.access_token)!==null&&o!==void 0?o:void 0,xform:ae._userResponse})})}catch(r){if((0,Z.isAuthError)(r))return(0,Z.isAuthSessionMissingError)(r)&&(await this._removeSession(),await(0,fe.removeItemAsync)(this.storage,`${this.storageKey}-code-verifier`)),{data:{user:null},error:r};throw r}}async updateUser(e,r={}){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._updateUser(e,r))}async _updateUser(e,r={}){try{return await this._useSession(async n=>{let{data:i,error:o}=n;if(o)throw o;if(!i.session)throw new Z.AuthSessionMissingError;let s=i.session,a=null,u=null;this.flowType==="pkce"&&e.email!=null&&([a,u]=await(0,fe.getCodeChallengeAndMethod)(this.storage,this.storageKey));let{data:c,error:l}=await(0,ae._request)(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:r?.emailRedirectTo,body:Object.assign(Object.assign({},e),{code_challenge:a,code_challenge_method:u}),jwt:s.access_token,xform:ae._userResponse});if(l)throw l;return s.user=c.user,await this._saveSession(s),await this._notifyAllSubscribers("USER_UPDATED",s),{data:{user:s.user},error:null}})}catch(n){if((0,Z.isAuthError)(n))return{data:{user:null},error:n};throw n}}_decodeJWT(e){return(0,fe.decodeJWTPayload)(e)}async setSession(e){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._setSession(e))}async _setSession(e){try{if(!e.access_token||!e.refresh_token)throw new Z.AuthSessionMissingError;let r=Date.now()/1e3,n=r,i=!0,o=null,s=(0,fe.decodeJWTPayload)(e.access_token);if(s.exp&&(n=s.exp,i=n<=r),i){let{session:a,error:u}=await this._callRefreshToken(e.refresh_token);if(u)return{data:{user:null,session:null},error:u};if(!a)return{data:{user:null,session:null},error:null};o=a}else{let{data:a,error:u}=await this._getUser(e.access_token);if(u)throw u;o={access_token:e.access_token,refresh_token:e.refresh_token,user:a.user,token_type:"bearer",expires_in:n-r,expires_at:n},await this._saveSession(o),await this._notifyAllSubscribers("SIGNED_IN",o)}return{data:{user:o.user,session:o},error:null}}catch(r){if((0,Z.isAuthError)(r))return{data:{session:null,user:null},error:r};throw r}}async refreshSession(e){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._refreshSession(e))}async _refreshSession(e){try{return await this._useSession(async r=>{var n;if(!e){let{data:s,error:a}=r;if(a)throw a;e=(n=s.session)!==null&&n!==void 0?n:void 0}if(!e?.refresh_token)throw new Z.AuthSessionMissingError;let{session:i,error:o}=await this._callRefreshToken(e.refresh_token);return o?{data:{user:null,session:null},error:o}:i?{data:{user:i.user,session:i},error:null}:{data:{user:null,session:null},error:null}})}catch(r){if((0,Z.isAuthError)(r))return{data:{user:null,session:null},error:r};throw r}}async _getSessionFromURL(e){try{if(!(0,fe.isBrowser)())throw new Z.AuthImplicitGrantRedirectError("No browser detected.");if(this.flowType==="implicit"&&!this._isImplicitGrantFlow())throw new Z.AuthImplicitGrantRedirectError("Not a valid implicit grant flow url.");if(this.flowType=="pkce"&&!e)throw new Z.AuthPKCEGrantCodeExchangeError("Not a valid PKCE flow url.");let r=(0,fe.parseParametersFromURL)(window.location.href);if(e){if(!r.code)throw new Z.AuthPKCEGrantCodeExchangeError("No code detected.");let{data:x,error:D}=await this._exchangeCodeForSession(r.code);if(D)throw D;let C=new URL(window.location.href);return C.searchParams.delete("code"),window.history.replaceState(window.history.state,"",C.toString()),{data:{session:x.session,redirectType:null},error:null}}if(r.error||r.error_description||r.error_code)throw new Z.AuthImplicitGrantRedirectError(r.error_description||"Error in URL with unspecified error_description",{error:r.error||"unspecified_error",code:r.error_code||"unspecified_code"});let{provider_token:n,provider_refresh_token:i,access_token:o,refresh_token:s,expires_in:a,expires_at:u,token_type:c}=r;if(!o||!a||!s||!c)throw new Z.AuthImplicitGrantRedirectError("No session defined in URL");let l=Math.round(Date.now()/1e3),f=parseInt(a),h=l+f;u&&(h=parseInt(u));let d=h-l;d*1e3<=nu&&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;l-m>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",m,h,l):l-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,l);let{data:b,error:g}=await this._getUser(o);if(g)throw g;let w={provider_token:n,provider_refresh_token:i,access_token:o,expires_in:f,expires_at:h,refresh_token:s,token_type:c,user:b.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),{data:{session:w,redirectType:r.type},error:null}}catch(r){if((0,Z.isAuthError)(r))return{data:{session:null,redirectType:null},error:r};throw r}}_isImplicitGrantFlow(){let e=(0,fe.parseParametersFromURL)(window.location.href);return!!((0,fe.isBrowser)()&&(e.access_token||e.error_description))}async _isPKCEFlow(){let e=(0,fe.parseParametersFromURL)(window.location.href),r=await(0,fe.getItemAsync)(this.storage,`${this.storageKey}-code-verifier`);return!!(e.code&&r)}async signOut(e={scope:"global"}){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._signOut(e))}async _signOut({scope:e}={scope:"global"}){return await this._useSession(async r=>{var n;let{data:i,error:o}=r;if(o)return{error:o};let s=(n=i.session)===null||n===void 0?void 0:n.access_token;if(s){let{error:a}=await this.admin.signOut(s,e);if(a&&!((0,Z.isAuthApiError)(a)&&(a.status===404||a.status===401||a.status===403)))return{error:a}}return e!=="others"&&(await this._removeSession(),await(0,fe.removeItemAsync)(this.storage,`${this.storageKey}-code-verifier`)),{error:null}})}onAuthStateChange(e){let r=(0,fe.uuid)(),n={id:r,callback:e,unsubscribe:()=>{this._debug("#unsubscribe()","state change callback with id removed",r),this.stateChangeEmitters.delete(r)}};return this._debug("#onAuthStateChange()","registered callback with id",r),this.stateChangeEmitters.set(r,n),(async()=>(await this.initializePromise,await this._acquireLock(-1,async()=>{this._emitInitialSession(r)})))(),{data:{subscription:n}}}async _emitInitialSession(e){return await this._useSession(async r=>{var n,i;try{let{data:{session:o},error:s}=r;if(s)throw s;await((n=this.stateChangeEmitters.get(e))===null||n===void 0?void 0:n.callback("INITIAL_SESSION",o)),this._debug("INITIAL_SESSION","callback id",e,"session",o)}catch(o){await((i=this.stateChangeEmitters.get(e))===null||i===void 0?void 0:i.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",e,"error",o),console.error(o)}})}async resetPasswordForEmail(e,r={}){let n=null,i=null;this.flowType==="pkce"&&([n,i]=await(0,fe.getCodeChallengeAndMethod)(this.storage,this.storageKey,!0));try{return await(0,ae._request)(this.fetch,"POST",`${this.url}/recover`,{body:{email:e,code_challenge:n,code_challenge_method:i,gotrue_meta_security:{captcha_token:r.captchaToken}},headers:this.headers,redirectTo:r.redirectTo})}catch(o){if((0,Z.isAuthError)(o))return{data:null,error:o};throw o}}async getUserIdentities(){var e;try{let{data:r,error:n}=await this.getUser();if(n)throw n;return{data:{identities:(e=r.user.identities)!==null&&e!==void 0?e:[]},error:null}}catch(r){if((0,Z.isAuthError)(r))return{data:null,error:r};throw r}}async linkIdentity(e){var r;try{let{data:n,error:i}=await this._useSession(async o=>{var s,a,u,c,l;let{data:f,error:h}=o;if(h)throw h;let d=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,e.provider,{redirectTo:(s=e.options)===null||s===void 0?void 0:s.redirectTo,scopes:(a=e.options)===null||a===void 0?void 0:a.scopes,queryParams:(u=e.options)===null||u===void 0?void 0:u.queryParams,skipBrowserRedirect:!0});return await(0,ae._request)(this.fetch,"GET",d,{headers:this.headers,jwt:(l=(c=f.session)===null||c===void 0?void 0:c.access_token)!==null&&l!==void 0?l:void 0})});if(i)throw i;return(0,fe.isBrowser)()&&!(!((r=e.options)===null||r===void 0)&&r.skipBrowserRedirect)&&window.location.assign(n?.url),{data:{provider:e.provider,url:n?.url},error:null}}catch(n){if((0,Z.isAuthError)(n))return{data:{provider:e.provider,url:null},error:n};throw n}}async unlinkIdentity(e){try{return await this._useSession(async r=>{var n,i;let{data:o,error:s}=r;if(s)throw s;return await(0,ae._request)(this.fetch,"DELETE",`${this.url}/user/identities/${e.identity_id}`,{headers:this.headers,jwt:(i=(n=o.session)===null||n===void 0?void 0:n.access_token)!==null&&i!==void 0?i:void 0})})}catch(r){if((0,Z.isAuthError)(r))return{data:null,error:r};throw r}}async _refreshAccessToken(e){let r=`#_refreshAccessToken(${e.substring(0,5)}...)`;this._debug(r,"begin");try{let n=Date.now();return await(0,fe.retryable)(async i=>(i>0&&await(0,fe.sleep)(200*Math.pow(2,i-1)),this._debug(r,"refreshing attempt",i),await(0,ae._request)(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:e},headers:this.headers,xform:ae._sessionResponse})),(i,o)=>{let s=200*Math.pow(2,i);return o&&(0,Z.isAuthRetryableFetchError)(o)&&Date.now()+s-n<nu})}catch(n){if(this._debug(r,"error",n),(0,Z.isAuthError)(n))return{data:{session:null,user:null},error:n};throw n}finally{this._debug(r,"end")}}_isValidSession(e){return typeof e=="object"&&e!==null&&"access_token"in e&&"refresh_token"in e&&"expires_at"in e}async _handleProviderSignIn(e,r){let n=await this._getUrlForProvider(`${this.url}/authorize`,e,{redirectTo:r.redirectTo,scopes:r.scopes,queryParams:r.queryParams});return this._debug("#_handleProviderSignIn()","provider",e,"options",r,"url",n),(0,fe.isBrowser)()&&!r.skipBrowserRedirect&&window.location.assign(n),{data:{provider:e,url:n},error:null}}async _recoverAndRefresh(){var e;let r="#_recoverAndRefresh()";this._debug(r,"begin");try{let n=await(0,fe.getItemAsync)(this.storage,this.storageKey);if(this._debug(r,"session from storage",n),!this._isValidSession(n)){this._debug(r,"session is not valid"),n!==null&&await this._removeSession();return}let i=Math.round(Date.now()/1e3),o=((e=n.expires_at)!==null&&e!==void 0?e:1/0)<i+iu.EXPIRY_MARGIN;if(this._debug(r,`session has${o?"":" not"} expired with margin of ${iu.EXPIRY_MARGIN}s`),o){if(this.autoRefreshToken&&n.refresh_token){let{error:s}=await this._callRefreshToken(n.refresh_token);s&&(console.error(s),(0,Z.isAuthRetryableFetchError)(s)||(this._debug(r,"refresh failed with a non-retryable error, removing the session",s),await this._removeSession()))}}else await this._notifyAllSubscribers("SIGNED_IN",n)}catch(n){this._debug(r,"error",n),console.error(n);return}finally{this._debug(r,"end")}}async _callRefreshToken(e){var r,n;if(!e)throw new Z.AuthSessionMissingError;if(this.refreshingDeferred)return this.refreshingDeferred.promise;let i=`#_callRefreshToken(${e.substring(0,5)}...)`;this._debug(i,"begin");try{this.refreshingDeferred=new fe.Deferred;let{data:o,error:s}=await this._refreshAccessToken(e);if(s)throw s;if(!o.session)throw new Z.AuthSessionMissingError;await this._saveSession(o.session),await this._notifyAllSubscribers("TOKEN_REFRESHED",o.session);let a={session:o.session,error:null};return this.refreshingDeferred.resolve(a),a}catch(o){if(this._debug(i,"error",o),(0,Z.isAuthError)(o)){let s={session:null,error:o};return(0,Z.isAuthRetryableFetchError)(o)||await this._removeSession(),(r=this.refreshingDeferred)===null||r===void 0||r.resolve(s),s}throw(n=this.refreshingDeferred)===null||n===void 0||n.reject(o),o}finally{this.refreshingDeferred=null,this._debug(i,"end")}}async _notifyAllSubscribers(e,r,n=!0){let i=`#_notifyAllSubscribers(${e})`;this._debug(i,"begin",r,`broadcast = ${n}`);try{this.broadcastChannel&&n&&this.broadcastChannel.postMessage({event:e,session:r});let o=[],s=Array.from(this.stateChangeEmitters.values()).map(async a=>{try{await a.callback(e,r)}catch(u){o.push(u)}});if(await Promise.all(s),o.length>0){for(let a=0;a<o.length;a+=1)console.error(o[a]);throw o[0]}}finally{this._debug(i,"end")}}async _saveSession(e){this._debug("#_saveSession()",e),this.suppressGetSessionWarning=!0,await(0,fe.setItemAsync)(this.storage,this.storageKey,e)}async _removeSession(){this._debug("#_removeSession()"),await(0,fe.removeItemAsync)(this.storage,this.storageKey),await this._notifyAllSubscribers("SIGNED_OUT",null)}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()");let e=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{e&&(0,fe.isBrowser)()&&window?.removeEventListener&&window.removeEventListener("visibilitychange",e)}catch(r){console.error("removing visibilitychange callback failed",r)}}async _startAutoRefresh(){await this._stopAutoRefresh(),this._debug("#_startAutoRefresh()");let e=setInterval(()=>this._autoRefreshTokenTick(),nu);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)/nu);this._debug("#_autoRefreshTokenTick()",`access token expires in ${i} ticks, a tick lasts ${nu}ms, refresh threshold is ${A_} ticks`),i<=A_&&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 O_.LockAcquireTimeoutError)this._debug("auto refresh token tick lock not available");else throw e}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!(0,fe.isBrowser)()||!window?.addEventListener)return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>await this._onVisibilityChanged(!1),window?.addEventListener("visibilitychange",this.visibilityChangedCallback),await this._onVisibilityChanged(!0)}catch(e){console.error("_handleVisibilityChange",e)}}async _onVisibilityChanged(e){let r=`#_onVisibilityChanged(${e})`;this._debug(r,"visibilityState",document.visibilityState),document.visibilityState==="visible"?(this.autoRefreshToken&&this._startAutoRefresh(),e||(await this.initializePromise,await this._acquireLock(-1,async()=>{if(document.visibilityState!=="visible"){this._debug(r,"acquired the lock to recover the session, but the browser visibilityState is no longer visible, aborting");return}await this._recoverAndRefresh()}))):document.visibilityState==="hidden"&&this.autoRefreshToken&&this._stopAutoRefresh()}async _getUrlForProvider(e,r,n){let i=[`provider=${encodeURIComponent(r)}`];if(n?.redirectTo&&i.push(`redirect_to=${encodeURIComponent(n.redirectTo)}`),n?.scopes&&i.push(`scopes=${encodeURIComponent(n.scopes)}`),this.flowType==="pkce"){let[o,s]=await(0,fe.getCodeChallengeAndMethod)(this.storage,this.storageKey),a=new URLSearchParams({code_challenge:`${encodeURIComponent(o)}`,code_challenge_method:`${encodeURIComponent(s)}`});i.push(a.toString())}if(n?.queryParams){let o=new URLSearchParams(n.queryParams);i.push(o.toString())}return n?.skipBrowserRedirect&&i.push(`skip_http_redirect=${n.skipBrowserRedirect}`),`${e}?${i.join("&")}`}async _unenroll(e){try{return await this._useSession(async r=>{var n;let{data:i,error:o}=r;return o?{data:null,error:o}:await(0,ae._request)(this.fetch,"DELETE",`${this.url}/factors/${e.factorId}`,{headers:this.headers,jwt:(n=i?.session)===null||n===void 0?void 0:n.access_token})})}catch(r){if((0,Z.isAuthError)(r))return{data:null,error:r};throw r}}async _enroll(e){try{return await this._useSession(async r=>{var n,i;let{data:o,error:s}=r;if(s)return{data:null,error:s};let a=Object.assign({friendly_name:e.friendlyName,factor_type:e.factorType},e.factorType==="phone"?{phone:e.phone}:{issuer:e.issuer}),{data:u,error:c}=await(0,ae._request)(this.fetch,"POST",`${this.url}/factors`,{body:a,headers:this.headers,jwt:(n=o?.session)===null||n===void 0?void 0:n.access_token});return c?{data:null,error:c}:(e.factorType==="totp"&&(!((i=u?.totp)===null||i===void 0)&&i.qr_code)&&(u.totp.qr_code=`data:image/svg+xml;utf-8,${u.totp.qr_code}`),{data:u,error:null})})}catch(r){if((0,Z.isAuthError)(r))return{data:null,error:r};throw r}}async _verify(e){return this._acquireLock(-1,async()=>{try{return await this._useSession(async r=>{var n;let{data:i,error:o}=r;if(o)return{data:null,error:o};let{data:s,error:a}=await(0,ae._request)(this.fetch,"POST",`${this.url}/factors/${e.factorId}/verify`,{body:{code:e.code,challenge_id:e.challengeId},headers:this.headers,jwt:(n=i?.session)===null||n===void 0?void 0:n.access_token});return a?{data:null,error:a}:(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+s.expires_in},s)),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",s),{data:s,error:a})})}catch(r){if((0,Z.isAuthError)(r))return{data:null,error:r};throw r}})}async _challenge(e){return this._acquireLock(-1,async()=>{try{return await this._useSession(async r=>{var n;let{data:i,error:o}=r;return o?{data:null,error:o}:await(0,ae._request)(this.fetch,"POST",`${this.url}/factors/${e.factorId}/challenge`,{body:{channel:e.channel},headers:this.headers,jwt:(n=i?.session)===null||n===void 0?void 0:n.access_token})})}catch(r){if((0,Z.isAuthError)(r))return{data:null,error:r};throw r}})}async _challengeAndVerify(e){let{data:r,error:n}=await this._challenge({factorId:e.factorId});return n?{data:null,error:n}:await this._verify({factorId:e.factorId,challengeId:r.id,code:e.code})}async _listFactors(){let{data:{user:e},error:r}=await this.getUser();if(r)return{data:null,error:r};let n=e?.factors||[],i=n.filter(s=>s.factor_type==="totp"&&s.status==="verified"),o=n.filter(s=>s.factor_type==="phone"&&s.status==="verified");return{data:{all:n,totp:i,phone:o},error:null}}async _getAuthenticatorAssuranceLevel(){return this._acquireLock(-1,async()=>await this._useSession(async e=>{var r,n;let{data:{session:i},error:o}=e;if(o)return{data:null,error:o};if(!i)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};let s=this._decodeJWT(i.access_token),a=null;s.aal&&(a=s.aal);let u=a;((n=(r=i.user.factors)===null||r===void 0?void 0:r.filter(f=>f.status==="verified"))!==null&&n!==void 0?n:[]).length>0&&(u="aal2");let l=s.amr||[];return{data:{currentLevel:a,nextLevel:u,currentAuthenticationMethods:l},error:null}}))}};ou.default=kl;kl.nextInstanceID=0});var T_=y(su=>{"use strict";var KM=su&&su.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(su,"__esModule",{value:!0});var YM=KM(xl()),JM=YM.default;su.default=JM});var P_=y(au=>{"use strict";var XM=au&&au.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(au,"__esModule",{value:!0});var ZM=XM(Vm()),QM=ZM.default;au.default=QM});var $_=y(R_=>{"use strict";Object.defineProperty(R_,"__esModule",{value:!0})});var zm=y(Ne=>{"use strict";var e4=Ne&&Ne.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),I_=Ne&&Ne.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&e4(e,t,r)},Tl=Ne&&Ne.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ne,"__esModule",{value:!0});Ne.lockInternals=Ne.NavigatorLockAcquireTimeoutError=Ne.navigatorLock=Ne.AuthClient=Ne.AuthAdminApi=Ne.GoTrueClient=Ne.GoTrueAdminApi=void 0;var t4=Tl(xl());Ne.GoTrueAdminApi=t4.default;var r4=Tl(Vm());Ne.GoTrueClient=r4.default;var n4=Tl(T_());Ne.AuthAdminApi=n4.default;var i4=Tl(P_());Ne.AuthClient=i4.default;I_($_(),Ne);I_(tu(),Ne);var Hm=Mm();Object.defineProperty(Ne,"navigatorLock",{enumerable:!0,get:function(){return Hm.navigatorLock}});Object.defineProperty(Ne,"NavigatorLockAcquireTimeoutError",{enumerable:!0,get:function(){return Hm.NavigatorLockAcquireTimeoutError}});Object.defineProperty(Ne,"lockInternals",{enumerable:!0,get:function(){return Hm.internals}})});var j_=y(Pl=>{"use strict";Object.defineProperty(Pl,"__esModule",{value:!0});Pl.SupabaseAuthClient=void 0;var o4=zm(),Gm=class extends o4.AuthClient{constructor(e){super(e)}};Pl.SupabaseAuthClient=Gm});var Km=y(uu=>{"use strict";var s4=uu&&uu.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(l){try{c(n.next(l))}catch(f){s(f)}}function u(l){try{c(n.throw(l))}catch(f){s(f)}}function c(l){l.done?o(l.value):i(l.value).then(a,u)}c((n=n.apply(t,e||[])).next())})};Object.defineProperty(uu,"__esModule",{value:!0});var a4=nm(),u4=n_(),c4=(ym(),Ae(gm)),l4=g_(),Rl=D_(),f4=b_(),N_=w_(),d4=j_(),Wm=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`,c={db:Rl.DEFAULT_DB_OPTIONS,realtime:Rl.DEFAULT_REALTIME_OPTIONS,auth:Object.assign(Object.assign({},Rl.DEFAULT_AUTH_OPTIONS),{storageKey:u}),global:Rl.DEFAULT_GLOBAL_OPTIONS},l=(0,N_.applySettingDefaults)(n??{},c);this.storageKey=(i=l.auth.storageKey)!==null&&i!==void 0?i:"",this.headers=(o=l.global.headers)!==null&&o!==void 0?o:{},l.accessToken?(this.accessToken=l.accessToken,this.auth=new Proxy({},{get:(f,h)=>{throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(h)} is not possible`)}})):this.auth=this._initSupabaseAuthClient((s=l.auth)!==null&&s!==void 0?s:{},this.headers,l.global.fetch),this.fetch=(0,f4.fetchWithAuth)(r,this._getAccessToken.bind(this),l.global.fetch),this.realtime=this._initRealtimeClient(Object.assign({headers:this.headers},l.realtime)),this.rest=new u4.PostgrestClient(`${a}/rest/v1`,{headers:this.headers,schema:l.db.schema,fetch:this.fetch}),l.accessToken||this._listenForAuthEvents()}get functions(){return new a4.FunctionsClient(this.functionsUrl,{headers:this.headers,customFetch:this.fetch})}get storage(){return new l4.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 s4(this,void 0,void 0,function*(){if(this.accessToken)return yield this.accessToken();let{data:n}=yield this.auth.getSession();return(r=(e=n.session)===null||e===void 0?void 0:e.access_token)!==null&&r!==void 0?r:null})}_initSupabaseAuthClient({autoRefreshToken:e,persistSession:r,detectSessionInUrl:n,storage:i,storageKey:o,flowType:s,lock:a,debug:u},c,l){var f;let h={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new d4.SupabaseAuthClient({url:this.authUrl,headers:Object.assign(Object.assign({},h),c),storageKey:o,autoRefreshToken:e,persistSession:r,detectSessionInUrl:n,storage:i,flowType:s,lock:a,debug:u,fetch:l,hasCustomAuthorizationHeader:(f="Authorization"in this.headers)!==null&&f!==void 0?f:!1})}_initRealtimeClient(e){return new c4.RealtimeClient(this.realtimeUrl,Object.assign(Object.assign({},e),{params:Object.assign({apikey:this.supabaseKey},e?.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((r,n)=>{this._handleTokenChanged(r,"CLIENT",n?.access_token)})}_handleTokenChanged(e,r,n){(e==="TOKEN_REFRESHED"||e==="SIGNED_IN")&&this.changedAccessToken!==n?(this.realtime.setAuth(n??null),this.changedAccessToken=n):e==="SIGNED_OUT"&&(this.realtime.setAuth(this.supabaseKey),r=="STORAGE"&&this.auth.signOut(),this.changedAccessToken=void 0)}};uu.default=Wm});var q_=y(Le=>{"use strict";var h4=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]}),L_=Le&&Le.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&h4(e,t,r)},B_=Le&&Le.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Le,"__esModule",{value:!0});Le.createClient=Le.SupabaseClient=Le.FunctionRegion=Le.FunctionsError=Le.FunctionsRelayError=Le.FunctionsFetchError=Le.FunctionsHttpError=void 0;var p4=B_(Km());L_(zm(),Le);var cu=nm();Object.defineProperty(Le,"FunctionsHttpError",{enumerable:!0,get:function(){return cu.FunctionsHttpError}});Object.defineProperty(Le,"FunctionsFetchError",{enumerable:!0,get:function(){return cu.FunctionsFetchError}});Object.defineProperty(Le,"FunctionsRelayError",{enumerable:!0,get:function(){return cu.FunctionsRelayError}});Object.defineProperty(Le,"FunctionsError",{enumerable:!0,get:function(){return cu.FunctionsError}});Object.defineProperty(Le,"FunctionRegion",{enumerable:!0,get:function(){return cu.FunctionRegion}});L_((ym(),Ae(gm)),Le);var m4=Km();Object.defineProperty(Le,"SupabaseClient",{enumerable:!0,get:function(){return B_(m4).default}});var g4=(t,e,r)=>new p4.default(t,e,r);Le.createClient=g4});var Ym=y((Sle,M_)=>{M_.exports=require("stream")});var W_=y((xle,G_)=>{"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 V_(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){y4(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 y4(t,e,r){return e=z_(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function D4(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function H_(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,z_(n.key),n)}}function v4(t,e,r){return e&&H_(t.prototype,e),r&&H_(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function z_(t){var e=b4(t,"string");return typeof e=="symbol"?e:String(e)}function b4(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 w4=require("buffer"),$l=w4.Buffer,_4=require("util"),Jm=_4.inspect,E4=Jm&&Jm.custom||"inspect";function C4(t,e,r){$l.prototype.copy.call(t,e,r)}G_.exports=function(){function t(){D4(this,t),this.head=null,this.tail=null,this.length=0}return v4(t,[{key:"push",value:function(r){var n={data:r,next:null};this.length>0?this.tail.next=n:this.head=n,this.tail=n,++this.length}},{key:"unshift",value:function(r){var n={data:r,next:this.head};this.length===0&&(this.tail=n),this.head=n,++this.length}},{key:"shift",value:function(){if(this.length!==0){var r=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,r}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(r){if(this.length===0)return"";for(var n=this.head,i=""+n.data;n=n.next;)i+=r+n.data;return i}},{key:"concat",value:function(r){if(this.length===0)return $l.alloc(0);for(var n=$l.allocUnsafe(r>>>0),i=this.head,o=0;i;)C4(i.data,n,o),o+=i.data.length,i=i.next;return n}},{key:"consume",value:function(r,n){var i;return r<this.head.data.length?(i=this.head.data.slice(0,r),this.head.data=this.head.data.slice(r)):r===this.head.data.length?i=this.shift():i=n?this._getString(r):this._getBuffer(r),i}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(r){var n=this.head,i=1,o=n.data;for(r-=o.length;n=n.next;){var s=n.data,a=r>s.length?s.length:r;if(a===s.length?o+=s:o+=s.slice(0,r),r-=a,r===0){a===s.length?(++i,n.next?this.head=n.next:this.head=this.tail=null):(this.head=n,n.data=s.slice(a));break}++i}return this.length-=i,o}},{key:"_getBuffer",value:function(r){var n=$l.allocUnsafe(r),i=this.head,o=1;for(i.data.copy(n),r-=i.data.length;i=i.next;){var s=i.data,a=r>s.length?s.length:r;if(s.copy(n,n.length-r,0,a),r-=a,r===0){a===s.length?(++o,i.next?this.head=i.next:this.head=this.tail=null):(this.head=i,i.data=s.slice(a));break}++o}return this.length-=o,n}},{key:E4,value:function(r,n){return Jm(this,V_(V_({},n),{},{depth:0,customInspect:!1}))}}]),t}()});var Zm=y((Fle,Y_)=>{"use strict";function S4(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(Xm,this,t)):process.nextTick(Xm,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,function(o){!e&&o?r._writableState?r._writableState.errorEmitted?process.nextTick(Il,r):(r._writableState.errorEmitted=!0,process.nextTick(K_,r,o)):process.nextTick(K_,r,o):e?(process.nextTick(Il,r),e(o)):process.nextTick(Il,r)}),this)}function K_(t,e){Xm(t,e),Il(t)}function Il(t){t._writableState&&!t._writableState.emitClose||t._readableState&&!t._readableState.emitClose||t.emit("close")}function x4(){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 Xm(t,e){t.emit("error",e)}function F4(t,e){var r=t._readableState,n=t._writableState;r&&r.autoDestroy||n&&n.autoDestroy?t.destroy(e):t.emit("error",e)}Y_.exports={destroy:S4,undestroy:x4,errorOrDestroy:F4}});var Yn=y((Ole,Z_)=>{"use strict";var X_={};function gr(t,e,r){r||(r=Error);function n(o,s,a){return typeof e=="string"?e:e(o,s,a)}class i extends r{constructor(s,a,u){super(n(s,a,u))}}i.prototype.name=r.name,i.prototype.code=t,X_[t]=i}function J_(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 O4(t,e,r){return t.substr(!r||r<0?0:+r,e.length)===e}function A4(t,e,r){return(r===void 0||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}function k4(t,e,r){return typeof r!="number"&&(r=0),r+e.length>t.length?!1:t.indexOf(e,r)!==-1}gr("ERR_INVALID_OPT_VALUE",function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'},TypeError);gr("ERR_INVALID_ARG_TYPE",function(t,e,r){let n;typeof e=="string"&&O4(e,"not ")?(n="must not be",e=e.replace(/^not /,"")):n="must be";let i;if(A4(t," argument"))i=`The ${t} ${n} ${J_(e,"type")}`;else{let o=k4(t,".")?"property":"argument";i=`The "${t}" ${o} ${n} ${J_(e,"type")}`}return i+=`. Received type ${typeof r}`,i},TypeError);gr("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");gr("ERR_METHOD_NOT_IMPLEMENTED",function(t){return"The "+t+" method is not implemented"});gr("ERR_STREAM_PREMATURE_CLOSE","Premature close");gr("ERR_STREAM_DESTROYED",function(t){return"Cannot call "+t+" after a stream was destroyed"});gr("ERR_MULTIPLE_CALLBACK","Callback called multiple times");gr("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");gr("ERR_STREAM_WRITE_AFTER_END","write after end");gr("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);gr("ERR_UNKNOWN_ENCODING",function(t){return"Unknown encoding: "+t},TypeError);gr("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");Z_.exports.codes=X_});var Qm=y((Ale,Q_)=>{"use strict";var T4=Yn().codes.ERR_INVALID_OPT_VALUE;function P4(t,e,r){return t.highWaterMark!=null?t.highWaterMark:e?t[r]:null}function R4(t,e,r,n){var i=P4(e,n,r);if(i!=null){if(!(isFinite(i)&&Math.floor(i)===i)||i<0){var o=n?r:"highWaterMark";throw new T4(o,i)}return Math.floor(i)}return t.objectMode?16:16*1024}Q_.exports={getHighWaterMark:R4}});var eE=y((kle,eg)=>{typeof Object.create=="function"?eg.exports=function(e,r){r&&(e.super_=r,e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:eg.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 Jo=y((Tle,rg)=>{try{if(tg=require("util"),typeof tg.inherits!="function")throw"";rg.exports=tg.inherits}catch{rg.exports=eE()}var tg});var rE=y((Ple,tE)=>{tE.exports=require("util").deprecate});var og=y((Rle,uE)=>{"use strict";uE.exports=Je;function iE(t){var e=this;this.next=null,this.entry=null,this.finish=function(){s5(e,t)}}var Xo;Je.WritableState=fu;var $4={deprecate:rE()},oE=Ym(),Nl=require("buffer").Buffer,I4=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function j4(t){return Nl.from(t)}function N4(t){return Nl.isBuffer(t)||t instanceof I4}var ig=Zm(),L4=Qm(),B4=L4.getHighWaterMark,Jn=Yn().codes,q4=Jn.ERR_INVALID_ARG_TYPE,M4=Jn.ERR_METHOD_NOT_IMPLEMENTED,U4=Jn.ERR_MULTIPLE_CALLBACK,V4=Jn.ERR_STREAM_CANNOT_PIPE,H4=Jn.ERR_STREAM_DESTROYED,z4=Jn.ERR_STREAM_NULL_VALUES,G4=Jn.ERR_STREAM_WRITE_AFTER_END,W4=Jn.ERR_UNKNOWN_ENCODING,Zo=ig.errorOrDestroy;Jo()(Je,oE);function K4(){}function fu(t,e,r){Xo=Xo||Ti(),t=t||{},typeof r!="boolean"&&(r=e instanceof Xo),this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=B4(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){t5(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 iE(this)}fu.prototype.getBuffer=function(){for(var e=this.bufferedRequest,r=[];e;)r.push(e),e=e.next;return r};(function(){try{Object.defineProperty(fu.prototype,"buffer",{get:$4.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var jl;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(jl=Function.prototype[Symbol.hasInstance],Object.defineProperty(Je,Symbol.hasInstance,{value:function(e){return jl.call(this,e)?!0:this!==Je?!1:e&&e._writableState instanceof fu}})):jl=function(e){return e instanceof this};function Je(t){Xo=Xo||Ti();var e=this instanceof Xo;if(!e&&!jl.call(Je,this))return new Je(t);this._writableState=new fu(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)),oE.call(this)}Je.prototype.pipe=function(){Zo(this,new V4)};function Y4(t,e){var r=new G4;Zo(t,r),process.nextTick(e,r)}function J4(t,e,r,n){var i;return r===null?i=new z4:typeof r!="string"&&!e.objectMode&&(i=new q4("chunk",["string","Buffer"],r)),i?(Zo(t,i),process.nextTick(n,i),!1):!0}Je.prototype.write=function(t,e,r){var n=this._writableState,i=!1,o=!n.objectMode&&N4(t);return o&&!Nl.isBuffer(t)&&(t=j4(t)),typeof e=="function"&&(r=e,e=null),o?e="buffer":e||(e=n.defaultEncoding),typeof r!="function"&&(r=K4),n.ending?Y4(this,r):(o||J4(this,n,t,r))&&(n.pendingcb++,i=Z4(this,n,o,t,e,r)),i};Je.prototype.cork=function(){this._writableState.corked++};Je.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,!t.writing&&!t.corked&&!t.bufferProcessing&&t.bufferedRequest&&sE(this,t))};Je.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 W4(e);return this._writableState.defaultEncoding=e,this};Object.defineProperty(Je.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function X4(t,e,r){return!t.objectMode&&t.decodeStrings!==!1&&typeof e=="string"&&(e=Nl.from(e,r)),e}Object.defineProperty(Je.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function Z4(t,e,r,n,i,o){if(!r){var s=X4(e,n,i);n!==s&&(r=!0,i="buffer",n=s)}var a=e.objectMode?1:n.length;e.length+=a;var u=e.length<e.highWaterMark;if(u||(e.needDrain=!0),e.writing||e.corked){var c=e.lastBufferedRequest;e.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:o,next:null},c?c.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1}else ng(t,e,!1,a,n,i,o);return u}function ng(t,e,r,n,i,o,s){e.writelen=n,e.writecb=s,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new H4("write")):r?t._writev(i,e.onwrite):t._write(i,o,e.onwrite),e.sync=!1}function Q4(t,e,r,n,i){--e.pendingcb,r?(process.nextTick(i,n),process.nextTick(lu,t,e),t._writableState.errorEmitted=!0,Zo(t,n)):(i(n),t._writableState.errorEmitted=!0,Zo(t,n),lu(t,e))}function e5(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}function t5(t,e){var r=t._writableState,n=r.sync,i=r.writecb;if(typeof i!="function")throw new U4;if(e5(r),e)Q4(t,r,n,e,i);else{var o=aE(r)||t.destroyed;!o&&!r.corked&&!r.bufferProcessing&&r.bufferedRequest&&sE(t,r),n?process.nextTick(nE,t,r,o,i):nE(t,r,o,i)}}function nE(t,e,r,n){r||r5(t,e),e.pendingcb--,n(),lu(t,e)}function r5(t,e){e.length===0&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}function sE(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,ng(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 iE(e),e.bufferedRequestCount=0}else{for(;r;){var u=r.chunk,c=r.encoding,l=r.callback,f=e.objectMode?1:u.length;if(ng(t,e,!1,f,u,c,l),r=r.next,e.bufferedRequestCount--,e.writing)break}r===null&&(e.lastBufferedRequest=null)}e.bufferedRequest=r,e.bufferProcessing=!1}Je.prototype._write=function(t,e,r){r(new M4("_write()"))};Je.prototype._writev=null;Je.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||o5(this,n,r),this};Object.defineProperty(Je.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function aE(t){return t.ending&&t.length===0&&t.bufferedRequest===null&&!t.finished&&!t.writing}function n5(t,e){t._final(function(r){e.pendingcb--,r&&Zo(t,r),e.prefinished=!0,t.emit("prefinish"),lu(t,e)})}function i5(t,e){!e.prefinished&&!e.finalCalled&&(typeof t._final=="function"&&!e.destroyed?(e.pendingcb++,e.finalCalled=!0,process.nextTick(n5,t,e)):(e.prefinished=!0,t.emit("prefinish")))}function lu(t,e){var r=aE(e);if(r&&(i5(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 o5(t,e,r){e.ending=!0,lu(t,e),r&&(e.finished?process.nextTick(r):t.once("finish",r)),e.ended=!0,t.writable=!1}function s5(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(Je.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}});Je.prototype.destroy=ig.destroy;Je.prototype._undestroy=ig.undestroy;Je.prototype._destroy=function(t,e){e(t)}});var Ti=y(($le,lE)=>{"use strict";var a5=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};lE.exports=Ur;var cE=ug(),ag=og();Jo()(Ur,cE);for(sg=a5(ag.prototype),Ll=0;Ll<sg.length;Ll++)Bl=sg[Ll],Ur.prototype[Bl]||(Ur.prototype[Bl]=ag.prototype[Bl]);var sg,Bl,Ll;function Ur(t){if(!(this instanceof Ur))return new Ur(t);cE.call(this,t),ag.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",u5)))}Object.defineProperty(Ur.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});Object.defineProperty(Ur.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});Object.defineProperty(Ur.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function u5(){this._writableState.ended||process.nextTick(c5,this)}function c5(t){t.end()}Object.defineProperty(Ur.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(e){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=e,this._writableState.destroyed=e)}})});var hE=y((cg,dE)=>{var ql=require("buffer"),Vr=ql.Buffer;function fE(t,e){for(var r in t)e[r]=t[r]}Vr.from&&Vr.alloc&&Vr.allocUnsafe&&Vr.allocUnsafeSlow?dE.exports=ql:(fE(ql,cg),cg.Buffer=Pi);function Pi(t,e,r){return Vr(t,e,r)}Pi.prototype=Object.create(Vr.prototype);fE(Vr,Pi);Pi.from=function(t,e,r){if(typeof t=="number")throw new TypeError("Argument must not be a number");return Vr(t,e,r)};Pi.alloc=function(t,e,r){if(typeof t!="number")throw new TypeError("Argument must be a number");var n=Vr(t);return e!==void 0?typeof r=="string"?n.fill(e,r):n.fill(e):n.fill(0),n};Pi.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return Vr(t)};Pi.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return ql.SlowBuffer(t)}});var dg=y(mE=>{"use strict";var fg=hE().Buffer,pE=fg.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 l5(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 f5(t){var e=l5(t);if(typeof e!="string"&&(fg.isEncoding===pE||!pE(t)))throw new Error("Unknown encoding: "+t);return e||t}mE.StringDecoder=du;function du(t){this.encoding=f5(t);var e;switch(this.encoding){case"utf16le":this.text=y5,this.end=D5,e=4;break;case"utf8":this.fillLast=p5,e=4;break;case"base64":this.text=v5,this.end=b5,e=3;break;default:this.write=w5,this.end=_5;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=fg.allocUnsafe(e)}du.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||""};du.prototype.end=g5;du.prototype.text=m5;du.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 lg(t){return t<=127?0:t>>5===6?2:t>>4===14?3:t>>3===30?4:t>>6===2?-1:-2}function d5(t,e,r){var n=e.length-1;if(n<r)return 0;var i=lg(e[n]);return i>=0?(i>0&&(t.lastNeed=i-1),i):--n<r||i===-2?0:(i=lg(e[n]),i>=0?(i>0&&(t.lastNeed=i-2),i):--n<r||i===-2?0:(i=lg(e[n]),i>=0?(i>0&&(i===2?i=0:t.lastNeed=i-3),i):0))}function h5(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 p5(t){var e=this.lastTotal-this.lastNeed,r=h5(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 m5(t,e){var r=d5(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 g5(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"\uFFFD":e}function y5(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 D5(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 v5(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 b5(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function w5(t){return t.toString(this.encoding)}function _5(t){return t&&t.length?this.write(t):""}});var Ml=y((jle,DE)=>{"use strict";var gE=Yn().codes.ERR_STREAM_PREMATURE_CLOSE;function E5(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 C5(){}function S5(t){return t.setHeader&&typeof t.abort=="function"}function yE(t,e,r){if(typeof e=="function")return yE(t,null,e);e||(e={}),r=E5(r||C5);var n=e.readable||e.readable!==!1&&t.readable,i=e.writable||e.writable!==!1&&t.writable,o=function(){t.writable||a()},s=t._writableState&&t._writableState.finished,a=function(){i=!1,s=!0,n||r.call(t)},u=t._readableState&&t._readableState.endEmitted,c=function(){n=!1,u=!0,i||r.call(t)},l=function(m){r.call(t,m)},f=function(){var m;if(n&&!u)return(!t._readableState||!t._readableState.ended)&&(m=new gE),r.call(t,m);if(i&&!s)return(!t._writableState||!t._writableState.ended)&&(m=new gE),r.call(t,m)},h=function(){t.req.on("finish",a)};return S5(t)?(t.on("complete",a),t.on("abort",f),t.req?h():t.on("request",h)):i&&!t._writableState&&(t.on("end",o),t.on("close",o)),t.on("end",c),t.on("finish",a),e.error!==!1&&t.on("error",l),t.on("close",f),function(){t.removeListener("complete",a),t.removeListener("abort",f),t.removeListener("request",h),t.req&&t.req.removeListener("finish",a),t.removeListener("end",o),t.removeListener("close",o),t.removeListener("finish",a),t.removeListener("end",c),t.removeListener("error",l),t.removeListener("close",f)}}DE.exports=yE});var bE=y((Nle,vE)=>{"use strict";var Ul;function Xn(t,e,r){return e=x5(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function x5(t){var e=F5(t,"string");return typeof e=="symbol"?e:String(e)}function F5(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 O5=Ml(),Zn=Symbol("lastResolve"),Ri=Symbol("lastReject"),hu=Symbol("error"),Vl=Symbol("ended"),$i=Symbol("lastPromise"),hg=Symbol("handlePromise"),Ii=Symbol("stream");function Qn(t,e){return{value:t,done:e}}function A5(t){var e=t[Zn];if(e!==null){var r=t[Ii].read();r!==null&&(t[$i]=null,t[Zn]=null,t[Ri]=null,e(Qn(r,!1)))}}function k5(t){process.nextTick(A5,t)}function T5(t,e){return function(r,n){t.then(function(){if(e[Vl]){r(Qn(void 0,!0));return}e[hg](r,n)},n)}}var P5=Object.getPrototypeOf(function(){}),R5=Object.setPrototypeOf((Ul={get stream(){return this[Ii]},next:function(){var e=this,r=this[hu];if(r!==null)return Promise.reject(r);if(this[Vl])return Promise.resolve(Qn(void 0,!0));if(this[Ii].destroyed)return new Promise(function(s,a){process.nextTick(function(){e[hu]?a(e[hu]):s(Qn(void 0,!0))})});var n=this[$i],i;if(n)i=new Promise(T5(n,this));else{var o=this[Ii].read();if(o!==null)return Promise.resolve(Qn(o,!1));i=new Promise(this[hg])}return this[$i]=i,i}},Xn(Ul,Symbol.asyncIterator,function(){return this}),Xn(Ul,"return",function(){var e=this;return new Promise(function(r,n){e[Ii].destroy(null,function(i){if(i){n(i);return}r(Qn(void 0,!0))})})}),Ul),P5),$5=function(e){var r,n=Object.create(R5,(r={},Xn(r,Ii,{value:e,writable:!0}),Xn(r,Zn,{value:null,writable:!0}),Xn(r,Ri,{value:null,writable:!0}),Xn(r,hu,{value:null,writable:!0}),Xn(r,Vl,{value:e._readableState.endEmitted,writable:!0}),Xn(r,hg,{value:function(o,s){var a=n[Ii].read();a?(n[$i]=null,n[Zn]=null,n[Ri]=null,o(Qn(a,!1))):(n[Zn]=o,n[Ri]=s)},writable:!0}),r));return n[$i]=null,O5(e,function(i){if(i&&i.code!=="ERR_STREAM_PREMATURE_CLOSE"){var o=n[Ri];o!==null&&(n[$i]=null,n[Zn]=null,n[Ri]=null,o(i)),n[hu]=i;return}var s=n[Zn];s!==null&&(n[$i]=null,n[Zn]=null,n[Ri]=null,s(Qn(void 0,!0))),n[Vl]=!0}),e.on("readable",k5.bind(null,n)),n};vE.exports=$5});var CE=y((Lle,EE)=>{"use strict";function wE(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(c){r(c);return}a.done?e(u):Promise.resolve(u).then(n,i)}function I5(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function s(u){wE(o,n,i,s,a,"next",u)}function a(u){wE(o,n,i,s,a,"throw",u)}s(void 0)})}}function _E(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 j5(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?_E(Object(r),!0).forEach(function(n){N5(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):_E(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function N5(t,e,r){return e=L5(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function L5(t){var e=B5(t,"string");return typeof e=="symbol"?e:String(e)}function B5(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 q5=Yn().codes.ERR_INVALID_ARG_TYPE;function M5(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 q5("iterable",["Iterable"],e);var i=new t(j5({objectMode:!0},r)),o=!1;i._read=function(){o||(o=!0,s())};function s(){return a.apply(this,arguments)}function a(){return a=I5(function*(){try{var u=yield n.next(),c=u.value,l=u.done;l?i.push(null):i.push(yield c)?s():o=!1}catch(f){i.destroy(f)}}),a.apply(this,arguments)}return i}EE.exports=M5});var ug=y((qle,$E)=>{"use strict";$E.exports=ge;var Qo;ge.ReadableState=OE;var Ble=require("events").EventEmitter,FE=function(e,r){return e.listeners(r).length},mu=Ym(),Hl=require("buffer").Buffer,U5=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function V5(t){return Hl.from(t)}function H5(t){return Hl.isBuffer(t)||t instanceof U5}var pg=require("util"),ue;pg&&pg.debuglog?ue=pg.debuglog("stream"):ue=function(){};var z5=W_(),wg=Zm(),G5=Qm(),W5=G5.getHighWaterMark,zl=Yn().codes,K5=zl.ERR_INVALID_ARG_TYPE,Y5=zl.ERR_STREAM_PUSH_AFTER_EOF,J5=zl.ERR_METHOD_NOT_IMPLEMENTED,X5=zl.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,es,mg,gg;Jo()(ge,mu);var pu=wg.errorOrDestroy,yg=["error","close","destroy","pause","resume"];function Z5(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 OE(t,e,r){Qo=Qo||Ti(),t=t||{},typeof r!="boolean"&&(r=e instanceof Qo),this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=W5(this,t,"readableHighWaterMark",r),this.buffer=new z5,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&&(es||(es=dg().StringDecoder),this.decoder=new es(t.encoding),this.encoding=t.encoding)}function ge(t){if(Qo=Qo||Ti(),!(this instanceof ge))return new ge(t);var e=this instanceof Qo;this._readableState=new OE(t,this,e),this.readable=!0,t&&(typeof t.read=="function"&&(this._read=t.read),typeof t.destroy=="function"&&(this._destroy=t.destroy)),mu.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=wg.destroy;ge.prototype._undestroy=wg.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=Hl.from(t,e),e=""),n=!0),AE(this,t,e,!1,n)};ge.prototype.unshift=function(t){return AE(this,t,null,!0,!1)};function AE(t,e,r,n,i){ue("readableAddChunk",e);var o=t._readableState;if(e===null)o.reading=!1,tU(t,o);else{var s;if(i||(s=Q5(o,e)),s)pu(t,s);else if(o.objectMode||e&&e.length>0)if(typeof e!="string"&&!o.objectMode&&Object.getPrototypeOf(e)!==Hl.prototype&&(e=V5(e)),n)o.endEmitted?pu(t,new X5):Dg(t,o,e,!0);else if(o.ended)pu(t,new Y5);else{if(o.destroyed)return!1;o.reading=!1,o.decoder&&!r?(e=o.decoder.write(e),o.objectMode||e.length!==0?Dg(t,o,e,!1):bg(t,o)):Dg(t,o,e,!1)}else n||(o.reading=!1,bg(t,o))}return!o.ended&&(o.length<o.highWaterMark||o.length===0)}function Dg(t,e,r,n){e.flowing&&e.length===0&&!e.sync?(e.awaitDrain=0,t.emit("data",r)):(e.length+=e.objectMode?1:r.length,n?e.buffer.unshift(r):e.buffer.push(r),e.needReadable&&Gl(t)),bg(t,e)}function Q5(t,e){var r;return!H5(e)&&typeof e!="string"&&e!==void 0&&!t.objectMode&&(r=new K5("chunk",["string","Buffer","Uint8Array"],e)),r}ge.prototype.isPaused=function(){return this._readableState.flowing===!1};ge.prototype.setEncoding=function(t){es||(es=dg().StringDecoder);var e=new es(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 SE=1073741824;function eU(t){return t>=SE?t=SE:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}function xE(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=eU(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}ge.prototype.read=function(t){ue("read",t),t=parseInt(t,10);var e=this._readableState,r=t;if(t!==0&&(e.emittedReadable=!1),t===0&&e.needReadable&&((e.highWaterMark!==0?e.length>=e.highWaterMark:e.length>0)||e.ended))return ue("read: emitReadable",e.length,e.ended),e.length===0&&e.ended?vg(this):Gl(this),null;if(t=xE(t,e),t===0&&e.ended)return e.length===0&&vg(this),null;var n=e.needReadable;ue("need readable",n),(e.length===0||e.length-t<e.highWaterMark)&&(n=!0,ue("length less than watermark",n)),e.ended||e.reading?(n=!1,ue("reading or ended",n)):n&&(ue("do read"),e.reading=!0,e.sync=!0,e.length===0&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1,e.reading||(t=xE(r,e)));var i;return t>0?i=PE(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&&vg(this)),i!==null&&this.emit("data",i),i};function tU(t,e){if(ue("onEofChunk"),!e.ended){if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,e.sync?Gl(t):(e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,kE(t)))}}function Gl(t){var e=t._readableState;ue("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(ue("emitReadable",e.flowing),e.emittedReadable=!0,process.nextTick(kE,t))}function kE(t){var e=t._readableState;ue("emitReadable_",e.destroyed,e.length,e.ended),!e.destroyed&&(e.length||e.ended)&&(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,_g(t)}function bg(t,e){e.readingMore||(e.readingMore=!0,process.nextTick(rU,t,e))}function rU(t,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&e.length===0);){var r=e.length;if(ue("maybeReadMore read 0"),t.read(0),r===e.length)break}e.readingMore=!1}ge.prototype._read=function(t){pu(this,new J5("_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,ue("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(g,w){ue("onunpipe"),g===r&&w&&w.hasUnpiped===!1&&(w.hasUnpiped=!0,l())}function a(){ue("onend"),t.end()}var u=nU(r);t.on("drain",u);var c=!1;function l(){ue("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),c=!0,n.awaitDrain&&(!t._writableState||t._writableState.needDrain)&&u()}r.on("data",f);function f(g){ue("ondata");var w=t.write(g);ue("dest.write",w),w===!1&&((n.pipesCount===1&&n.pipes===t||n.pipesCount>1&&RE(n.pipes,t)!==-1)&&!c&&(ue("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function h(g){ue("onerror",g),b(),t.removeListener("error",h),FE(t,"error")===0&&pu(t,g)}Z5(t,"error",h);function d(){t.removeListener("finish",m),b()}t.once("close",d);function m(){ue("onfinish"),t.removeListener("close",d),b()}t.once("finish",m);function b(){ue("unpipe"),r.unpipe(t)}return t.emit("pipe",r),n.flowing||(ue("pipe resume"),r.resume()),t};function nU(t){return function(){var r=t._readableState;ue("pipeOnDrain",r.awaitDrain),r.awaitDrain&&r.awaitDrain--,r.awaitDrain===0&&FE(t,"data")&&(r.flowing=!0,_g(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=RE(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=mu.prototype.on.call(this,t,e),n=this._readableState;return t==="data"?(n.readableListening=this.listenerCount("readable")>0,n.flowing!==!1&&this.resume()):t==="readable"&&!n.endEmitted&&!n.readableListening&&(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,ue("on readable",n.length,n.reading),n.length?Gl(this):n.reading||process.nextTick(iU,this)),r};ge.prototype.addListener=ge.prototype.on;ge.prototype.removeListener=function(t,e){var r=mu.prototype.removeListener.call(this,t,e);return t==="readable"&&process.nextTick(TE,this),r};ge.prototype.removeAllListeners=function(t){var e=mu.prototype.removeAllListeners.apply(this,arguments);return(t==="readable"||t===void 0)&&process.nextTick(TE,this),e};function TE(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 iU(t){ue("readable nexttick read 0"),t.read(0)}ge.prototype.resume=function(){var t=this._readableState;return t.flowing||(ue("resume"),t.flowing=!t.readableListening,oU(this,t)),t.paused=!1,this};function oU(t,e){e.resumeScheduled||(e.resumeScheduled=!0,process.nextTick(sU,t,e))}function sU(t,e){ue("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),_g(t),e.flowing&&!e.reading&&t.read(0)}ge.prototype.pause=function(){return ue("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(ue("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function _g(t){var e=t._readableState;for(ue("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(ue("wrapped end"),r.decoder&&!r.ended){var s=r.decoder.end();s&&s.length&&e.push(s)}e.push(null)}),t.on("data",function(s){if(ue("wrapped data"),r.decoder&&(s=r.decoder.write(s)),!(r.objectMode&&s==null)&&!(!r.objectMode&&(!s||!s.length))){var a=e.push(s);a||(n=!0,t.pause())}});for(var i in t)this[i]===void 0&&typeof t[i]=="function"&&(this[i]=function(a){return function(){return t[a].apply(t,arguments)}}(i));for(var o=0;o<yg.length;o++)t.on(yg[o],this.emit.bind(this,yg[o]));return this._read=function(s){ue("wrapped _read",s),n&&(n=!1,t.resume())},this};typeof Symbol=="function"&&(ge.prototype[Symbol.asyncIterator]=function(){return mg===void 0&&(mg=bE()),mg(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=PE;Object.defineProperty(ge.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function PE(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 vg(t){var e=t._readableState;ue("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,process.nextTick(aU,e,t))}function aU(t,e){if(ue("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&t.length===0&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var r=e._writableState;(!r||r.autoDestroy&&r.finished)&&e.destroy()}}typeof Symbol=="function"&&(ge.from=function(t,e){return gg===void 0&&(gg=CE()),gg(ge,t,e)});function RE(t,e){for(var r=0,n=t.length;r<n;r++)if(t[r]===e)return r;return-1}});var Eg=y((Mle,jE)=>{"use strict";jE.exports=Dn;var Wl=Yn().codes,uU=Wl.ERR_METHOD_NOT_IMPLEMENTED,cU=Wl.ERR_MULTIPLE_CALLBACK,lU=Wl.ERR_TRANSFORM_ALREADY_TRANSFORMING,fU=Wl.ERR_TRANSFORM_WITH_LENGTH_0,Kl=Ti();Jo()(Dn,Kl);function dU(t,e){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(n===null)return this.emit("error",new cU);r.writechunk=null,r.writecb=null,e!=null&&this.push(e),n(t);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function Dn(t){if(!(this instanceof Dn))return new Dn(t);Kl.call(this,t),this._transformState={afterTransform:dU.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",hU)}function hU(){var t=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(e,r){IE(t,e,r)}):IE(this,null,null)}Dn.prototype.push=function(t,e){return this._transformState.needTransform=!1,Kl.prototype.push.call(this,t,e)};Dn.prototype._transform=function(t,e,r){r(new uU("_transform()"))};Dn.prototype._write=function(t,e,r){var n=this._transformState;if(n.writecb=r,n.writechunk=t,n.writeencoding=e,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}};Dn.prototype._read=function(t){var e=this._transformState;e.writechunk!==null&&!e.transforming?(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform)):e.needTransform=!0};Dn.prototype._destroy=function(t,e){Kl.prototype._destroy.call(this,t,function(r){e(r)})};function IE(t,e,r){if(e)return t.emit("error",e);if(r!=null&&t.push(r),t._writableState.length)throw new fU;if(t._transformState.transforming)throw new lU;return t.push(null)}});var BE=y((Ule,LE)=>{"use strict";LE.exports=gu;var NE=Eg();Jo()(gu,NE);function gu(t){if(!(this instanceof gu))return new gu(t);NE.call(this,t)}gu.prototype._transform=function(t,e,r){r(null,t)}});var HE=y((Vle,VE)=>{"use strict";var Cg;function pU(t){var e=!1;return function(){e||(e=!0,t.apply(void 0,arguments))}}var UE=Yn().codes,mU=UE.ERR_MISSING_ARGS,gU=UE.ERR_STREAM_DESTROYED;function qE(t){if(t)throw t}function yU(t){return t.setHeader&&typeof t.abort=="function"}function DU(t,e,r,n){n=pU(n);var i=!1;t.on("close",function(){i=!0}),Cg===void 0&&(Cg=Ml()),Cg(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,yU(t))return t.abort();if(typeof t.destroy=="function")return t.destroy();n(s||new gU("pipe"))}}}function ME(t){t()}function vU(t,e){return t.pipe(e)}function bU(t){return!t.length||typeof t[t.length-1]!="function"?qE:t.pop()}function wU(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];var n=bU(e);if(Array.isArray(e[0])&&(e=e[0]),e.length<2)throw new mU("streams");var i,o=e.map(function(s,a){var u=a<e.length-1,c=a>0;return DU(s,u,c,function(l){i||(i=l),l&&o.forEach(ME),!u&&(o.forEach(ME),n(i))})});return e.reduce(vU)}VE.exports=wU});var zE=y((yr,Du)=>{var yu=require("stream");process.env.READABLE_STREAM==="disable"&&yu?(Du.exports=yu.Readable,Object.assign(Du.exports,yu),Du.exports.Stream=yu):(yr=Du.exports=ug(),yr.Stream=yu||yr,yr.Readable=yr,yr.Writable=og(),yr.Duplex=Ti(),yr.Transform=Eg(),yr.PassThrough=BE(),yr.finished=Ml(),yr.pipeline=HE())});var xg=y(Sg=>{var GE;(function(t){typeof DO_NOT_EXPORT_CRC>"u"?typeof Sg=="object"?t(Sg):typeof define=="function"&&define.amd?define(function(){var e={};return t(e),e}):t(GE={}):t(GE={})})(function(t){t.version="1.2.2";function e(){for(var F=0,L=new Array(256),S=0;S!=256;++S)F=S,F=F&1?-306674912^F>>>1:F>>>1,F=F&1?-306674912^F>>>1:F>>>1,F=F&1?-306674912^F>>>1:F>>>1,F=F&1?-306674912^F>>>1:F>>>1,F=F&1?-306674912^F>>>1:F>>>1,F=F&1?-306674912^F>>>1:F>>>1,F=F&1?-306674912^F>>>1:F>>>1,F=F&1?-306674912^F>>>1:F>>>1,L[S]=F;return typeof Int32Array<"u"?new Int32Array(L):L}var r=e();function n(F){var L=0,S=0,I=0,R=typeof Int32Array<"u"?new Int32Array(4096):new Array(4096);for(I=0;I!=256;++I)R[I]=F[I];for(I=0;I!=256;++I)for(S=F[I],L=256+I;L<4096;L+=256)S=R[L]=S>>>8^F[S&255];var B=[];for(I=1;I!=16;++I)B[I-1]=typeof Int32Array<"u"?R.subarray(I*256,I*256+256):R.slice(I*256,I*256+256);return B}var i=n(r),o=i[0],s=i[1],a=i[2],u=i[3],c=i[4],l=i[5],f=i[6],h=i[7],d=i[8],m=i[9],b=i[10],g=i[11],w=i[12],x=i[13],D=i[14];function C(F,L){for(var S=L^-1,I=0,R=F.length;I<R;)S=S>>>8^r[(S^F.charCodeAt(I++))&255];return~S}function k(F,L){for(var S=L^-1,I=F.length-15,R=0;R<I;)S=D[F[R++]^S&255]^x[F[R++]^S>>8&255]^w[F[R++]^S>>16&255]^g[F[R++]^S>>>24]^b[F[R++]]^m[F[R++]]^d[F[R++]]^h[F[R++]]^f[F[R++]]^l[F[R++]]^c[F[R++]]^u[F[R++]]^a[F[R++]]^s[F[R++]]^o[F[R++]]^r[F[R++]];for(I+=15;R<I;)S=S>>>8^r[(S^F[R++])&255];return~S}function $(F,L){for(var S=L^-1,I=0,R=F.length,B=0,q=0;I<R;)B=F.charCodeAt(I++),B<128?S=S>>>8^r[(S^B)&255]:B<2048?(S=S>>>8^r[(S^(192|B>>6&31))&255],S=S>>>8^r[(S^(128|B&63))&255]):B>=55296&&B<57344?(B=(B&1023)+64,q=F.charCodeAt(I++)&1023,S=S>>>8^r[(S^(240|B>>8&7))&255],S=S>>>8^r[(S^(128|B>>2&63))&255],S=S>>>8^r[(S^(128|q>>6&15|(B&3)<<4))&255],S=S>>>8^r[(S^(128|q&63))&255]):(S=S>>>8^r[(S^(224|B>>12&15))&255],S=S>>>8^r[(S^(128|B>>6&63))&255],S=S>>>8^r[(S^(128|B&63))&255]);return~S}t.table=r,t.bstr=C,t.buf=k,t.str=$})});var KE=y((zle,WE)=>{"use strict";var{Transform:_U}=zE(),EU=xg(),Fg=class extends _U{constructor(e){super(e),this.checksum=Buffer.allocUnsafe(4),this.checksum.writeInt32BE(0,0),this.rawSize=0}_transform(e,r,n){e&&(this.checksum=EU.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}};WE.exports=Fg});var JE=y((Gle,YE)=>{"use strict";var{DeflateRaw:CU}=require("zlib"),SU=xg(),Og=class extends CU{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=SU.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}};YE.exports=Og});var ZE=y((Wle,XE)=>{"use strict";XE.exports={CRC32Stream:KE(),DeflateCRC32Stream:JE()}});var vu=y(ts=>{"use strict";Object.defineProperty(ts,"__esModule",{value:!0});ts.checksum=ts.checksumFile=void 0;var xU=require("fs"),FU=require("crypto"),eC=require("stream"),OU=require("util"),{CRC32Stream:AU}=ZE(),QE=(0,OU.promisify)(eC.pipeline),kU=(t,e,r)=>tC(xU.createReadStream(t),e,r);ts.checksumFile=kU;async function tC(t,e,r="hex"){let n=PU(t);if(e==="crc32"){let o=new AU,s=QE(n,o);return o.resume(),await s,o.end(),Buffer.from(o.digest()).toString(r)}let i=(0,FU.createHash)(e);return await QE(n,i),i.end(),i.digest(r)}ts.checksum=tC;function TU(t){return t!=null&&typeof t=="object"&&typeof t.read=="function"&&typeof t.pipe=="function"}var PU=t=>TU(t)?t:new eC.Readable({read(){this.push(t),this.push(null)}})});var Ag=y((Yle,rC)=>{rC.exports={LOCHDR:30,LOCSIG:67324752,LOCVER:4,LOCFLG:6,LOCHOW:8,LOCTIM:10,LOCCRC:14,LOCSIZ:18,LOCLEN:22,LOCNAM:26,LOCEXT:28,EXTSIG:134695760,EXTHDR:16,EXTCRC:4,EXTSIZ:8,EXTLEN:12,CENHDR:46,CENSIG:33639248,CENVEM:4,CENVER:6,CENFLG:8,CENHOW:10,CENTIM:12,CENCRC:16,CENSIZ:20,CENLEN:24,CENNAM:28,CENEXT:30,CENCOM:32,CENDSK:34,CENATT:36,CENATX:38,CENOFF:42,ENDHDR:22,ENDSIG:101010256,ENDSUB:8,ENDTOT:10,ENDSIZ:12,ENDOFF:16,ENDCOM:20,END64HDR:20,END64SIG:117853008,END64START:4,END64OFF:8,END64NUMDISKS:16,ZIP64SIG:101075792,ZIP64HDR:56,ZIP64LEAD:12,ZIP64SIZE:4,ZIP64VEM:12,ZIP64VER:14,ZIP64DSK:16,ZIP64DSKDIR:20,ZIP64SUB:24,ZIP64TOT:32,ZIP64SIZB:40,ZIP64OFF:48,ZIP64EXTRA:56,STORED:0,SHRUNK:1,REDUCED1:2,REDUCED2:3,REDUCED3:4,REDUCED4:5,IMPLODED:6,DEFLATED:8,ENHANCED_DEFLATED:9,PKWARE:10,BZIP2:12,LZMA:14,IBM_TERSE:18,IBM_LZ77:19,AES_ENCRYPT:99,FLG_ENC:1,FLG_COMP1:2,FLG_COMP2:4,FLG_DESC:8,FLG_ENH:16,FLG_PATCH:32,FLG_STR:64,FLG_EFS:2048,FLG_MSK:4096,FILE:2,BUFFER:1,NONE:0,EF_ID:0,EF_SIZE:2,ID_ZIP64:1,ID_AVINFO:7,ID_PFS:8,ID_OS2:9,ID_NTFS:10,ID_OPENVMS:12,ID_UNIX:13,ID_FORK:14,ID_PATCH:15,ID_X509_PKCS7:20,ID_X509_CERTID_F:21,ID_X509_CERTID_C:22,ID_STRONGENC:23,ID_RECORD_MGT:24,ID_X509_PKCS7_RL:25,ID_IBM1:101,ID_IBM2:102,ID_POSZIP:18064,EF_ZIP64_OR_32:4294967295,EF_ZIP64_OR_16:65535,EF_ZIP64_SUNCOMP:0,EF_ZIP64_SCOMP:8,EF_ZIP64_RHO:16,EF_ZIP64_DSN:24}});var Yl=y(iC=>{var nC={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 RU(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(nC))iC[t]=RU(nC[t])});var cC=y((Xle,uC)=>{var $U=require("fs"),ut=require("path"),oC=Ag(),IU=Yl(),jU=typeof process=="object"&&process.platform==="win32",sC=t=>typeof t=="object"&&t!==null,aC=new Uint32Array(256).map((t,e)=>{for(let r=0;r<8;r++)e&1?e=3988292384^e>>>1:e>>>=1;return e>>>0});function Xe(t){this.sep=ut.sep,this.fs=$U,sC(t)&&sC(t.fs)&&typeof t.fs.statSync=="function"&&(this.fs=t.fs)}uC.exports=Xe;Xe.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 IU.FILE_IN_THE_WAY(`"${i}"`)}})}r(t)};Xe.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=ut.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};Xe.prototype.writeFileToAsync=function(t,e,r,n,i){typeof n=="function"&&(i=n,n=void 0);let o=this;o.fs.exists(t,function(s){if(s&&!r)return i(!1);o.fs.stat(t,function(a,u){if(s&&u.isDirectory())return i(!1);var c=ut.dirname(t);o.fs.exists(c,function(l){l||o.makeDir(c),o.fs.open(t,"w",438,function(f,h){f?o.fs.chmod(t,438,function(){o.fs.open(t,"w",438,function(d,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)})})})})})};Xe.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=ut.join(n,a),c=e.fs.statSync(u);(!i||i.test(u))&&s.push(ut.normalize(u)+(c.isDirectory()?e.sep:"")),c.isDirectory()&&o&&(s=s.concat(r(u,i,o)))}),s}return r(t,void 0,!0)};Xe.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=ut.join(t,a),r.fs.stat(a,function(u,c){if(u)return e(u);c&&(n.push(ut.normalize(a)+(c.isDirectory()?r.sep:"")),c.isDirectory()?r.findFilesAsync(a,function(l,f){if(l)return e(l);n=n.concat(f),--s||e(null,n)}):--s||e(null,n))})})})};Xe.prototype.getAttributes=function(){};Xe.prototype.setAttributes=function(){};Xe.crc32update=function(t,e){return aC[(t^e)&255]^t>>>8};Xe.crc32=function(t){typeof t=="string"&&(t=Buffer.from(t,"utf8"));let e=t.length,r=-1;for(let n=0;n<e;)r=Xe.crc32update(r,t[n++]);return~r>>>0};Xe.methodToString=function(t){switch(t){case oC.STORED:return"STORED ("+t+")";case oC.DEFLATED:return"DEFLATED ("+t+")";default:return"UNSUPPORTED ("+t+")"}};Xe.canonical=function(t){if(!t)return"";let e=ut.posix.normalize("/"+t.split("\\").join("/"));return ut.join(".",e)};Xe.zipnamefix=function(t){if(!t)return"";let e=ut.posix.normalize("/"+t.split("\\").join("/"));return ut.posix.join(".",e)};Xe.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]};Xe.sanitize=function(t,e){t=ut.resolve(ut.normalize(t));for(var r=e.split("/"),n=0,i=r.length;n<i;n++){var o=ut.normalize(ut.join(t,r.slice(n,i).join(ut.sep)));if(o.indexOf(t)===0)return o}return ut.normalize(ut.join(t,ut.basename(e)))};Xe.toBuffer=function(e,r){return Buffer.isBuffer(e)?e:e instanceof Uint8Array?Buffer.from(e):typeof e=="string"?r(e):Buffer.alloc(0)};Xe.readBigUInt64LE=function(t,e){var r=Buffer.from(t.slice(e,e+8));return r.swap64(),parseInt(`0x${r.toString("hex")}`)};Xe.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)};Xe.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};Xe.isWin=jU;Xe.crcTable=aC});var fC=y((Zle,lC)=>{var NU=require("path");lC.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=NU.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 hC=y((Qle,dC)=>{dC.exports={efs:!0,encode:t=>Buffer.from(t,"utf8"),decode:t=>t.toString("utf8")}});var ns=y((efe,rs)=>{rs.exports=cC();rs.exports.Constants=Ag();rs.exports.Errors=Yl();rs.exports.FileAttr=fC();rs.exports.decoder=hC()});var mC=y((tfe,pC)=>{var ei=ns(),H=ei.Constants;pC.exports=function(){var t=20,e=10,r=0,n=0,i=0,o=0,s=0,a=0,u=0,c=0,l=0,f=0,h=0,d=0,m=0;t|=ei.isWin?2560:768,r|=H.FLG_EFS;let b={extraLen:0},g=D=>Math.max(0,D)>>>0,w=D=>Math.max(0,D)&65535,x=D=>Math.max(0,D)&255;return i=ei.fromDate2DOS(new Date),{get made(){return t},set made(D){t=D},get version(){return e},set version(D){e=D},get flags(){return r},set flags(D){r=D},get flags_efs(){return(r&H.FLG_EFS)>0},set flags_efs(D){D?r|=H.FLG_EFS:r&=~H.FLG_EFS},get flags_desc(){return(r&H.FLG_DESC)>0},set flags_desc(D){D?r|=H.FLG_DESC:r&=~H.FLG_DESC},get method(){return n},set method(D){switch(D){case H.STORED:this.version=10;case H.DEFLATED:default:this.version=20}n=D},get time(){return ei.fromDOS2Date(this.timeval)},set time(D){this.timeval=ei.fromDate2DOS(D)},get timeval(){return i},set timeval(D){i=g(D)},get timeHighByte(){return x(i>>>8)},get crc(){return o},set crc(D){o=g(D)},get compressedSize(){return s},set compressedSize(D){s=g(D)},get size(){return a},set size(D){a=g(D)},get fileNameLength(){return u},set fileNameLength(D){u=D},get extraLength(){return c},set extraLength(D){c=D},get extraLocalLength(){return b.extraLen},set extraLocalLength(D){b.extraLen=D},get commentLength(){return l},set commentLength(D){l=D},get diskNumStart(){return f},set diskNumStart(D){f=g(D)},get inAttr(){return h},set inAttr(D){h=g(D)},get attr(){return d},set attr(D){d=g(D)},get fileAttr(){return(d||0)>>16&4095},get offset(){return m},set offset(D){m=g(D)},get encrypted(){return(r&H.FLG_ENC)===H.FLG_ENC},get centralHeaderSize(){return H.CENHDR+u+c+l},get realDataOffset(){return m+H.LOCHDR+b.fnameLen+b.extraLen},get localHeader(){return b},loadLocalHeaderFromBinary:function(D){var C=D.slice(m,m+H.LOCHDR);if(C.readUInt32LE(0)!==H.LOCSIG)throw ei.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 k=m+H.LOCHDR+b.fnameLen,$=k+b.extraLen;return D.slice(k,$)},loadFromBinary:function(D){if(D.length!==H.CENHDR||D.readUInt32LE(0)!==H.CENSIG)throw ei.Errors.INVALID_CEN();t=D.readUInt16LE(H.CENVEM),e=D.readUInt16LE(H.CENVER),r=D.readUInt16LE(H.CENFLG),n=D.readUInt16LE(H.CENHOW),i=D.readUInt32LE(H.CENTIM),o=D.readUInt32LE(H.CENCRC),s=D.readUInt32LE(H.CENSIZ),a=D.readUInt32LE(H.CENLEN),u=D.readUInt16LE(H.CENNAM),c=D.readUInt16LE(H.CENEXT),l=D.readUInt16LE(H.CENCOM),f=D.readUInt16LE(H.CENDSK),h=D.readUInt16LE(H.CENATT),d=D.readUInt32LE(H.CENATX),m=D.readUInt32LE(H.CENOFF)},localHeaderToBinary:function(){var D=Buffer.alloc(H.LOCHDR);return D.writeUInt32LE(H.LOCSIG,0),D.writeUInt16LE(e,H.LOCVER),D.writeUInt16LE(r,H.LOCFLG),D.writeUInt16LE(n,H.LOCHOW),D.writeUInt32LE(i,H.LOCTIM),D.writeUInt32LE(o,H.LOCCRC),D.writeUInt32LE(s,H.LOCSIZ),D.writeUInt32LE(a,H.LOCLEN),D.writeUInt16LE(u,H.LOCNAM),D.writeUInt16LE(b.extraLen,H.LOCEXT),D},centralHeaderToBinary:function(){var D=Buffer.alloc(H.CENHDR+u+c+l);return D.writeUInt32LE(H.CENSIG,0),D.writeUInt16LE(t,H.CENVEM),D.writeUInt16LE(e,H.CENVER),D.writeUInt16LE(r,H.CENFLG),D.writeUInt16LE(n,H.CENHOW),D.writeUInt32LE(i,H.CENTIM),D.writeUInt32LE(o,H.CENCRC),D.writeUInt32LE(s,H.CENSIZ),D.writeUInt32LE(a,H.CENLEN),D.writeUInt16LE(u,H.CENNAM),D.writeUInt16LE(c,H.CENEXT),D.writeUInt16LE(l,H.CENCOM),D.writeUInt16LE(f,H.CENDSK),D.writeUInt16LE(h,H.CENATT),D.writeUInt32LE(d,H.CENATX),D.writeUInt32LE(m,H.CENOFF),D},toJSON:function(){let D=function(C){return C+" bytes"};return{made:t,version:e,flags:r,method:ei.methodToString(n),time:this.time,crc:"0x"+o.toString(16).toUpperCase(),compressedSize:D(s),size:D(a),fileNameLength:D(u),extraLength:D(c),commentLength:D(l),diskNumStart:f,inAttr:h,attr:d,offset:m,centralHeaderSize:D(H.CENHDR+u+c+l)}},toString:function(){return JSON.stringify(this.toJSON(),null," ")}}}});var yC=y((rfe,gC)=>{var is=ns(),Ue=is.Constants;gC.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 Ue.ENDHDR+i},loadFromBinary:function(o){if((o.length!==Ue.ENDHDR||o.readUInt32LE(0)!==Ue.ENDSIG)&&(o.length<Ue.ZIP64HDR||o.readUInt32LE(0)!==Ue.ZIP64SIG))throw is.Errors.INVALID_END();o.readUInt32LE(0)===Ue.ENDSIG?(t=o.readUInt16LE(Ue.ENDSUB),e=o.readUInt16LE(Ue.ENDTOT),r=o.readUInt32LE(Ue.ENDSIZ),n=o.readUInt32LE(Ue.ENDOFF),i=o.readUInt16LE(Ue.ENDCOM)):(t=is.readBigUInt64LE(o,Ue.ZIP64SUB),e=is.readBigUInt64LE(o,Ue.ZIP64TOT),r=is.readBigUInt64LE(o,Ue.ZIP64SIZE),n=is.readBigUInt64LE(o,Ue.ZIP64OFF),i=0)},toBinary:function(){var o=Buffer.alloc(Ue.ENDHDR+i);return o.writeUInt32LE(Ue.ENDSIG,0),o.writeUInt32LE(0,4),o.writeUInt16LE(t,Ue.ENDSUB),o.writeUInt16LE(e,Ue.ENDTOT),o.writeUInt32LE(r,Ue.ENDSIZ),o.writeUInt32LE(n,Ue.ENDOFF),o.writeUInt16LE(i,Ue.ENDCOM),o.fill(" ",Ue.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 Tg=y(kg=>{kg.EntryHeader=mC();kg.MainHeader=yC()});var vC=y((ife,DC)=>{DC.exports=function(t){var e=require("zlib"),r={chunkSize:(parseInt(t.length/1024)+1)*1024};return{deflate:function(){return e.deflateRawSync(t,r)},deflateAsync:function(n){var i=e.createDeflateRaw(r),o=[],s=0;i.on("data",function(a){o.push(a),s+=a.length}),i.on("end",function(){var a=Buffer.alloc(s),u=0;a.fill(0);for(var c=0;c<o.length;c++){var l=o[c];l.copy(a,u),u+=l.length}n&&n(a)}),i.end(t)}}}});var wC=y((ofe,bC)=>{var LU=+(process.versions?process.versions.node:"").split(".")[0]||0;bC.exports=function(t,e){var r=require("zlib");let n=LU>=15&&e>0?{maxOutputLength:e}:{};return{inflate:function(){return r.inflateRawSync(t,n)},inflateAsync:function(i){var o=r.createInflateRaw(n),s=[],a=0;o.on("data",function(u){s.push(u),a+=u.length}),o.on("end",function(){var u=Buffer.alloc(a),c=0;u.fill(0);for(var l=0;l<s.length;l++){var f=s[l];f.copy(u,c),c+=f.length}i&&i(u)}),o.end(t)}}}});var xC=y((sfe,SC)=>{"use strict";var{randomFillSync:_C}=require("crypto"),BU=Yl(),qU=new Uint32Array(256).map((t,e)=>{for(let r=0;r<8;r++)e&1?e=e>>>1^3988292384:e>>>=1;return e>>>0}),CC=(t,e)=>Math.imul(t,e)>>>0,EC=(t,e)=>qU[(t^e)&255]^t>>>8,bu=()=>typeof _C=="function"?_C(Buffer.alloc(12)):bu.node();bu.node=()=>{let t=Buffer.alloc(12),e=t.length;for(let r=0;r<e;r++)t[r]=Math.random()*256&255;return t};var Jl={genSalt:bu};function Xl(t){let e=Buffer.isBuffer(t)?t:Buffer.from(t);this.keys=new Uint32Array([305419896,591751049,878082192]);for(let r=0;r<e.length;r++)this.updateKeys(e[r])}Xl.prototype.updateKeys=function(t){let e=this.keys;return e[0]=EC(e[0],t),e[1]+=e[0]&255,e[1]=CC(e[1],134775813)+1,e[2]=EC(e[2],e[1]>>>24),t};Xl.prototype.next=function(){let t=(this.keys[2]|2)>>>0;return CC(t,t^1)>>8&255};function MU(t){let e=new Xl(t);return function(r){let n=Buffer.alloc(r.length),i=0;for(let o of r)n[i++]=e.updateKeys(o^e.next());return n}}function UU(t){let e=new Xl(t);return function(r,n,i=0){n||(n=Buffer.alloc(r.length));for(let o of r){let s=e.next();n[i++]=o^s,e.updateKeys(o)}return n}}function VU(t,e,r){if(!t||!Buffer.isBuffer(t)||t.length<12)return Buffer.alloc(0);let n=MU(r),i=n(t.slice(0,12)),o=(e.flags&8)===8?e.timeHighByte:e.crc>>>24;if(i[11]!==o)throw BU.WRONG_PASSWORD();return n(t.slice(12))}function HU(t){Buffer.isBuffer(t)&&t.length>=12?Jl.genSalt=function(){return t.slice(0,12)}:t==="node"?Jl.genSalt=bu.node:Jl.genSalt=bu}function zU(t,e,r,n=!1){t==null&&(t=Buffer.alloc(0)),Buffer.isBuffer(t)||(t=Buffer.from(t.toString()));let i=UU(r),o=Jl.genSalt();o[11]=e.crc>>>24&255,n&&(o[10]=e.crc>>>16&255);let s=Buffer.alloc(t.length+12);return i(o,s),i(t,s,12)}SC.exports={decrypt:VU,encrypt:zU,_salter:HU}});var FC=y(Zl=>{Zl.Deflater=vC();Zl.Inflater=wC();Zl.ZipCrypto=xC()});var Rg=y((ufe,OC)=>{var be=ns(),GU=Tg(),Ze=be.Constants,Pg=FC();OC.exports=function(t,e){var r=new GU.EntryHeader,n=Buffer.alloc(0),i=Buffer.alloc(0),o=!1,s=null,a=Buffer.alloc(0),u=Buffer.alloc(0),c=!0;let l=t,f=typeof l.decoder=="object"?l.decoder:be.decoder;c=f.hasOwnProperty("efs")?f.efs:!1;function h(){return!e||!(e instanceof Uint8Array)?Buffer.alloc(0):(u=r.loadLocalHeaderFromBinary(e),e.slice(r.realDataOffset,r.realDataOffset+r.compressedSize))}function d(D){if(r.flags_desc){let C={},k=r.realDataOffset+r.compressedSize;if(e.readUInt32LE(k)==Ze.LOCSIG||e.readUInt32LE(k)==Ze.CENSIG)throw be.Errors.DESCRIPTOR_NOT_EXIST();if(e.readUInt32LE(k)==Ze.EXTSIG)C.crc=e.readUInt32LE(k+Ze.EXTCRC),C.compressedSize=e.readUInt32LE(k+Ze.EXTSIZ),C.size=e.readUInt32LE(k+Ze.EXTLEN);else if(e.readUInt16LE(k+12)===19280)C.crc=e.readUInt32LE(k+Ze.EXTCRC-4),C.compressedSize=e.readUInt32LE(k+Ze.EXTSIZ-4),C.size=e.readUInt32LE(k+Ze.EXTLEN-4);else throw be.Errors.DESCRIPTOR_UNKNOWN();if(C.compressedSize!==r.compressedSize||C.size!==r.size||C.crc!==r.crc)throw be.Errors.DESCRIPTOR_FAULTY();if(be.crc32(D)!==C.crc)return!1}else if(be.crc32(D)!==r.localHeader.crc)return!1;return!0}function m(D,C,k){if(typeof C>"u"&&typeof D=="string"&&(k=D,D=void 0),o)return D&&C&&C(Buffer.alloc(0),be.Errors.DIRECTORY_CONTENT_ERROR()),Buffer.alloc(0);var $=h();if($.length===0)return D&&C&&C($),$;if(r.encrypted){if(typeof k!="string"&&!Buffer.isBuffer(k))throw be.Errors.INVALID_PASS_PARAM();$=Pg.ZipCrypto.decrypt($,r,k)}var F=Buffer.alloc(r.size);switch(r.method){case be.Constants.STORED:if($.copy(F),d(F))return D&&C&&C(F),F;throw D&&C&&C(F,be.Errors.BAD_CRC()),be.Errors.BAD_CRC();case be.Constants.DEFLATED:var L=new Pg.Inflater($,r.size);if(D)L.inflateAsync(function(S){S.copy(S,0),C&&(d(S)?C(S):C(S,be.Errors.BAD_CRC()))});else{if(L.inflate(F).copy(F,0),!d(F))throw be.Errors.BAD_CRC(`"${f.decode(n)}"`);return F}break;default:throw D&&C&&C(Buffer.alloc(0),be.Errors.UNKNOWN_METHOD()),be.Errors.UNKNOWN_METHOD()}}function b(D,C){if((!s||!s.length)&&Buffer.isBuffer(e))return D&&C&&C(h()),h();if(s.length&&!o){var k;switch(r.method){case be.Constants.STORED:return r.compressedSize=r.size,k=Buffer.alloc(s.length),s.copy(k),D&&C&&C(k),k;default:case be.Constants.DEFLATED:var $=new Pg.Deflater(s);if(D)$.deflateAsync(function(L){k=Buffer.alloc(L.length),r.compressedSize=L.length,L.copy(k),C&&C(k)});else{var F=$.deflate();return r.compressedSize=F.length,F}$=null;break}}else if(D&&C)C(Buffer.alloc(0));else return Buffer.alloc(0)}function g(D,C){return(D.readUInt32LE(C+4)<<4)+D.readUInt32LE(C)}function w(D){try{for(var C=0,k,$,F;C+4<D.length;)k=D.readUInt16LE(C),C+=2,$=D.readUInt16LE(C),C+=2,F=D.slice(C,C+$),C+=$,Ze.ID_ZIP64===k&&x(F)}catch{throw be.Errors.EXTRA_FIELD_PARSE_ERROR()}}function x(D){var C,k,$,F;D.length>=Ze.EF_ZIP64_SCOMP&&(C=g(D,Ze.EF_ZIP64_SUNCOMP),r.size===Ze.EF_ZIP64_OR_32&&(r.size=C)),D.length>=Ze.EF_ZIP64_RHO&&(k=g(D,Ze.EF_ZIP64_SCOMP),r.compressedSize===Ze.EF_ZIP64_OR_32&&(r.compressedSize=k)),D.length>=Ze.EF_ZIP64_DSN&&($=g(D,Ze.EF_ZIP64_RHO),r.offset===Ze.EF_ZIP64_OR_32&&(r.offset=$)),D.length>=Ze.EF_ZIP64_DSN+4&&(F=D.readUInt32LE(Ze.EF_ZIP64_DSN),r.diskNumStart===Ze.EF_ZIP64_OR_16&&(r.diskNumStart=F))}return{get entryName(){return f.decode(n)},get rawEntryName(){return n},set entryName(D){n=be.toBuffer(D,f.encode);var C=n[n.length-1];o=C===47||C===92,r.fileNameLength=n.length},get efs(){return typeof c=="function"?c(this.entryName):c},get extra(){return a},set extra(D){a=D,r.extraLength=D.length,w(D)},get comment(){return f.decode(i)},set comment(D){if(i=be.toBuffer(D,f.encode),r.commentLength=i.length,i.length>65535)throw be.Errors.COMMENT_TOO_LONG()},get name(){var D=f.decode(n);return o?D.substr(D.length-1).split("/").pop():D.split("/").pop()},get isDirectory(){return o},getCompressedData:function(){return b(!1,null)},getCompressedDataAsync:function(D){b(!0,D)},setData:function(D){s=be.toBuffer(D,be.decoder.encode),!o&&s.length?(r.size=s.length,r.method=be.Constants.DEFLATED,r.crc=be.crc32(D),r.changed=!0):r.method=be.Constants.STORED},getData:function(D){return r.changed?s:m(!1,null,D)},getDataAsync:function(D,C){r.changed?D(s):m(!0,D,C)},set attr(D){r.attr=D},get attr(){return r.attr},set header(D){r.loadFromBinary(D)},get header(){return r},packCentralHeader:function(){r.flags_efs=this.efs,r.extraLength=a.length;var D=r.centralHeaderToBinary(),C=be.Constants.CENHDR;return n.copy(D,C),C+=n.length,a.copy(D,C),C+=r.extraLength,i.copy(D,C),D},packLocalHeader:function(){let D=0;r.flags_efs=this.efs,r.extraLocalLength=u.length;let C=r.localHeaderToBinary(),k=Buffer.alloc(C.length+n.length+r.extraLocalLength);return C.copy(k,D),D+=C.length,n.copy(k,D),D+=n.length,u.copy(k,D),D+=u.length,k},toJSON:function(){let D=function(C){return"<"+(C&&C.length+" bytes buffer"||"null")+">"};return{entryName:this.entryName,name:this.name,comment:this.comment,isDirectory:this.isDirectory,header:r.toJSON(),compressedData:D(e),data:D(s)}},toString:function(){return JSON.stringify(this.toJSON(),null," ")}}}});var TC=y((cfe,kC)=>{var AC=Rg(),WU=Tg(),wt=ns();kC.exports=function(t,e){var r=[],n={},i=Buffer.alloc(0),o=new WU.MainHeader,s=!1,a=null;let u=new Set,c=e,{noSort:l,decoder:f}=c;t?m(c.readEntries):s=!0;function h(){let g=new Set;for(let w of Object.keys(n)){let x=w.split("/");if(x.pop(),!!x.length)for(let D=0;D<x.length;D++){let C=x.slice(0,D+1).join("/")+"/";g.add(C)}}for(let w of g)if(!(w in n)){let x=new AC(c);x.entryName=w,x.attr=16,x.temporary=!0,r.push(x),n[x.entryName]=x,u.add(x)}}function d(){if(s=!0,n={},o.diskEntries>(t.length-o.offset)/wt.Constants.CENHDR)throw wt.Errors.DISK_ENTRY_TOO_LARGE();r=new Array(o.diskEntries);for(var g=o.offset,w=0;w<r.length;w++){var x=g,D=new AC(c,t);D.header=t.slice(x,x+=wt.Constants.CENHDR),D.entryName=t.slice(x,x+=D.header.fileNameLength),D.header.extraLength&&(D.extra=t.slice(x,x+=D.header.extraLength)),D.header.commentLength&&(D.comment=t.slice(x,x+D.header.commentLength)),g+=D.header.centralHeaderSize,r[w]=D,n[D.entryName]=D}u.clear(),h()}function m(g){var w=t.length-wt.Constants.ENDHDR,x=Math.max(0,w-65535),D=x,C=t.length,k=-1,$=0;for((typeof c.trailingSpace=="boolean"?c.trailingSpace:!1)&&(x=0),w;w>=D;w--)if(t[w]===80){if(t.readUInt32LE(w)===wt.Constants.ENDSIG){k=w,$=w,C=w+wt.Constants.ENDHDR,D=w-wt.Constants.END64HDR;continue}if(t.readUInt32LE(w)===wt.Constants.END64SIG){D=x;continue}if(t.readUInt32LE(w)===wt.Constants.ZIP64SIG){k=w,C=w+wt.readBigUInt64LE(t,w+wt.Constants.ZIP64SIZE)+wt.Constants.ZIP64LEAD;break}}if(k==-1)throw wt.Errors.INVALID_FORMAT();o.loadFromBinary(t.slice(k,C)),o.commentLength&&(i=t.slice($+wt.Constants.ENDHDR)),g&&d()}function b(){r.length>1&&!l&&r.sort((g,w)=>g.entryName.toLowerCase().localeCompare(w.entryName.toLowerCase()))}return{get entries(){return s||d(),r.filter(g=>!u.has(g))},get comment(){return f.decode(i)},set comment(g){i=wt.toBuffer(g,f.encode),o.commentLength=i.length},getEntryCount:function(){return s?r.length:o.diskEntries},forEach:function(g){this.entries.forEach(g)},getEntry:function(g){return s||d(),n[g]||null},setEntry:function(g){s||d(),r.push(g),n[g.entryName]=g,o.totalEntries=r.length},deleteFile:function(g,w=!0){s||d();let x=n[g];this.getEntryChildren(x,w).map(C=>C.entryName).forEach(this.deleteEntry)},deleteEntry:function(g){s||d();let w=n[g],x=r.indexOf(w);x>=0&&(r.splice(x,1),delete n[g],o.totalEntries=r.length)},getEntryChildren:function(g,w=!0){if(s||d(),typeof g=="object")if(g.isDirectory&&w){let x=[],D=g.entryName;for(let C of r)C.entryName.startsWith(D)&&x.push(C);return x}else return[g];return[]},getChildCount:function(g){if(g&&g.isDirectory){let w=this.getEntryChildren(g);return w.includes(g)?w.length-1:w.length}return 0},compressToBuffer:function(){s||d(),b();let g=[],w=[],x=0,D=0;o.size=0,o.offset=0;let C=0;for(let F of this.entries){let L=F.getCompressedData();F.header.offset=D;let S=F.packLocalHeader(),I=S.length+L.length;D+=I,g.push(S),g.push(L);let R=F.packCentralHeader();w.push(R),o.size+=R.length,x+=I+R.length,C++}x+=o.mainHeaderSize,o.offset=D,o.totalEntries=C,D=0;let k=Buffer.alloc(x);for(let F of g)F.copy(k,D),D+=F.length;for(let F of w)F.copy(k,D),D+=F.length;let $=o.toBinary();return i&&i.copy($,wt.Constants.ENDHDR),$.copy(k,D),t=k,s=!1,k},toAsyncBuffer:function(g,w,x,D){try{s||d(),b();let C=[],k=[],$=0,F=0,L=0;o.size=0,o.offset=0;let S=function(I){if(I.length>0){let R=I.shift(),B=R.entryName+R.extra.toString();x&&x(B),R.getCompressedDataAsync(function(q){D&&D(B),R.header.offset=F;let K=R.packLocalHeader(),M=K.length+q.length;F+=M,C.push(K),C.push(q);let E=R.packCentralHeader();k.push(E),o.size+=E.length,$+=M+E.length,L++,S(I)})}else{$+=o.mainHeaderSize,o.offset=F,o.totalEntries=L,F=0;let R=Buffer.alloc($);C.forEach(function(q){q.copy(R,F),F+=q.length}),k.forEach(function(q){q.copy(R,F),F+=q.length});let B=o.toBinary();i&&i.copy(B,wt.Constants.ENDHDR),B.copy(R,F),t=R,s=!1,g(R)}};S(Array.from(this.entries))}catch(C){w(C)}}}}});var $C=y((lfe,RC)=>{var Ve=ns(),Qe=require("path"),KU=Rg(),YU=TC(),ji=(...t)=>Ve.findLast(t,e=>typeof e=="boolean"),PC=(...t)=>Ve.findLast(t,e=>typeof e=="string"),JU=(...t)=>Ve.findLast(t,e=>typeof e=="function"),XU={noSort:!1,readEntries:!1,method:Ve.Constants.NONE,fs:null};RC.exports=function(t,e){let r=null,n=Object.assign(Object.create(null),XU);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 YU(r,n),{canonical:s,sanitize:a,zipnamefix:u}=Ve;function c(d){if(d&&o){var m;if(typeof d=="string"&&(m=o.getEntry(Qe.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 l(d){let{join:m,normalize:b,sep:g}=Qe.posix;return m(".",b(g+d.split("\\").join(g)+g))}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:"",Qe.relative(d,m)+b};return{readFile:function(d,m){var b=c(d);return b&&b.getData(m)||null},childCount:function(d){let m=c(d);if(m)return o.getChildCount(m)},readFileAsync:function(d,m){var b=c(d);b?b.getDataAsync(m):m(null,"getEntry failed for:"+d)},readAsText:function(d,m){var b=c(d);if(b){var g=b.getData();if(g&&g.length)return g.toString(m||"utf8")}return""},readAsTextAsync:function(d,m,b){var g=c(d);g?g.getDataAsync(function(w,x){if(x){m(w,x);return}w&&w.length?m(w.toString(b||"utf8")):m("")}):m("")},deleteFile:function(d,m=!0){var b=c(d);b&&o.deleteFile(b.entryName,m)},deleteEntry:function(d){var m=c(d);m&&o.deleteEntry(m.entryName)},addZipComment:function(d){o.comment=d},getZipComment:function(){return o.comment||""},addZipEntryComment:function(d,m){var b=c(d);b&&(b.comment=m)},getZipEntryComment:function(d){var m=c(d);return m&&m.comment||""},updateFile:function(d,m){var b=c(d);b&&b.setData(m)},addLocalFile:function(d,m,b,g){if(i.fs.existsSync(d)){m=m?l(m):"";let w=Qe.win32.basename(Qe.win32.normalize(d));m+=b||w;let x=i.fs.statSync(d),D=x.isFile()?i.fs.readFileSync(d):Buffer.alloc(0);x.isDirectory()&&(m+=i.sep),this.addFile(m,D,g,x)}else throw Ve.Errors.FILE_NOT_FOUND(d)},addLocalFileAsync:function(d,m){d=typeof d=="object"?d:{localPath:d};let b=Qe.resolve(d.localPath),{comment:g}=d,{zipPath:w,zipName:x}=d,D=this;i.fs.stat(b,function(C,k){if(C)return m(C,!1);w=w?l(w):"";let $=Qe.win32.basename(Qe.win32.normalize(b));if(w+=x||$,k.isFile())i.fs.readFile(b,function(F,L){return F?m(F,!1):(D.addFile(w,L,g,k),setImmediate(m,void 0,!0))});else if(k.isDirectory())return w+=i.sep,D.addFile(w,Buffer.alloc(0),g,k),setImmediate(m,void 0,!0)})},addLocalFolder:function(d,m,b){if(b=f(b),m=m?l(m):"",d=Qe.normalize(d),i.fs.existsSync(d)){let g=i.findFiles(d),w=this;if(g.length)for(let x of g){let D=Qe.join(m,h(d,x));b(D)&&w.addLocalFile(x,Qe.dirname(D))}}else throw Ve.Errors.FILE_NOT_FOUND(d)},addLocalFolderAsync:function(d,m,b,g){g=f(g),b=b?l(b):"",d=Qe.normalize(d);var w=this;i.fs.open(d,"r",function(x){if(x&&x.code==="ENOENT")m(void 0,Ve.Errors.FILE_NOT_FOUND(d));else if(x)m(void 0,x);else{var D=i.findFiles(d),C=-1,k=function(){if(C+=1,C<D.length){var $=D[C],F=h(d,$).split("\\").join("/");F=F.normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/[^\x20-\x7E]/g,""),g(F)?i.fs.stat($,function(L,S){L&&m(void 0,L),S.isFile()?i.fs.readFile($,function(I,R){I?m(void 0,I):(w.addFile(b+F,R,"",S),k())}):(w.addFile(b+F+"/",Buffer.alloc(0),"",S),k())}):process.nextTick(()=>{k()})}else m(!0,void 0)};k()}})},addLocalFolderAsync2:function(d,m){let b=this;d=typeof d=="object"?d:{localPath:d},localPath=Qe.resolve(l(d.localPath));let{zipPath:g,filter:w,namefix:x}=d;w instanceof RegExp?w=function(k){return function($){return k.test($)}}(w):typeof w!="function"&&(w=function(){return!0}),g=g?l(g):"",x=="latin1"&&(x=k=>k.normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/[^\x20-\x7E]/g,"")),typeof x!="function"&&(x=k=>k);let D=k=>Qe.join(g,x(h(localPath,k))),C=k=>Qe.win32.basename(Qe.win32.normalize(x(k)));i.fs.open(localPath,"r",function(k){k&&k.code==="ENOENT"?m(void 0,Ve.Errors.FILE_NOT_FOUND(localPath)):k?m(void 0,k):i.findFilesAsync(localPath,function($,F){if($)return m($);F=F.filter(L=>w(D(L))),F.length||m(void 0,!1),setImmediate(F.reverse().reduce(function(L,S){return function(I,R){if(I||R===!1)return setImmediate(L,I,!1);b.addLocalFileAsync({localPath:S,zipPath:Qe.dirname(D(S)),zipName:C(S)},L)}},m))})})},addLocalFolderPromise:function(d,m){return new Promise((b,g)=>{this.addLocalFolderAsync2(Object.assign({localPath:d},m),(w,x)=>{w&&g(w),x&&b(this)})})},addFile:function(d,m,b,g){d=u(d);let w=c(d),x=w!=null;x||(w=new KU(n),w.entryName=d),w.comment=b||"";let D=typeof g=="object"&&g instanceof i.fs.Stats;D&&(w.header.time=g.mtime);var C=w.isDirectory?16:0;let k=w.isDirectory?16384:32768;return D?k|=4095&g.mode:typeof g=="number"?k|=4095&g:k|=w.isDirectory?493:420,C=(C|k<<16)>>>0,w.attr=C,w.setData(m),x||o.setEntry(w),w},getEntries:function(d){return o.password=d,o?o.entries:[]},getEntry:function(d){return c(d)},getEntryCount:function(){return o.getEntryCount()},forEach:function(d){return o.forEach(d)},extractEntryTo:function(d,m,b,g,w,x){g=ji(!1,g),w=ji(!1,w),b=ji(!0,b),x=PC(w,x);var D=c(d);if(!D)throw Ve.Errors.NO_ENTRY();var C=s(D.entryName),k=a(m,x&&!D.isDirectory?x:b?C:Qe.basename(C));if(D.isDirectory){var $=o.getEntryChildren(D);return $.forEach(function(S){if(S.isDirectory)return;var I=S.getData();if(!I)throw Ve.Errors.CANT_EXTRACT_FILE();var R=s(S.entryName),B=a(m,b?R:Qe.basename(R));let q=w?S.header.fileAttr:void 0;i.writeFileTo(B,I,g,q)}),!0}var F=D.getData(o.password);if(!F)throw Ve.Errors.CANT_EXTRACT_FILE();if(i.fs.existsSync(k)&&!g)throw Ve.Errors.CANT_OVERRIDE();let L=w?d.header.fileAttr:void 0;return i.writeFileTo(k,F,g,L),!0},test:function(d){if(!o)return!1;for(var 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,g){if(b=ji(!1,b),g=PC(b,g),m=ji(!1,m),!o)throw Ve.Errors.NO_ZIP();o.entries.forEach(function(w){var x=a(d,s(w.entryName));if(w.isDirectory){i.makeDir(x);return}var D=w.getData(g);if(!D)throw Ve.Errors.CANT_EXTRACT_FILE();let C=b?w.header.fileAttr:void 0;i.writeFileTo(x,D,m,C);try{i.fs.utimesSync(x,w.header.time,w.header.time)}catch{throw Ve.Errors.CANT_EXTRACT_FILE()}})},extractAllToAsync:function(d,m,b,g){if(g=JU(m,b,g),b=ji(!1,b),m=ji(!1,m),!g)return new Promise((k,$)=>{this.extractAllToAsync(d,m,b,function(F){F?$(F):k(this)})});if(!o){g(Ve.Errors.NO_ZIP());return}d=Qe.resolve(d);let w=k=>a(d,Qe.normalize(s(k.entryName))),x=(k,$)=>new Error(k+': "'+$+'"'),D=[],C=[];o.entries.forEach(k=>{k.isDirectory?D.push(k):C.push(k)});for(let k of D){let $=w(k),F=b?k.header.fileAttr:void 0;try{i.makeDir($),F&&i.fs.chmodSync($,F),i.fs.utimesSync($,k.header.time,k.header.time)}catch{g(x("Unable to create folder",$))}}C.reverse().reduce(function(k,$){return function(F){if(F)k(F);else{let L=Qe.normalize(s($.entryName)),S=a(d,L);$.getDataAsync(function(I,R){if(R)k(R);else if(!I)k(Ve.Errors.CANT_EXTRACT_FILE());else{let B=b?$.header.fileAttr:void 0;i.writeFileToAsync(S,I,m,B,function(q){q||k(x("Unable to write file",S)),i.fs.utimes(S,$.header.time,$.header.time,function(K){K?k(x("Unable to set times",S)):k()})})}})}}},g)()},writeZip:function(d,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 g=i.writeFileTo(d,b,!0);typeof m=="function"&&m(g?null:new Error("failed"),"")}}},writeZipPromise:function(d,m){let{overwrite:b,perm:g}=Object.assign({overwrite:!0},m);return new Promise((w,x)=>{!d&&n.filename&&(d=n.filename),d||x("ADM-ZIP: ZIP File Name Missing"),this.toBufferPromise().then(D=>{let C=k=>k?w(k):x("ADM-ZIP: Wasn't able to write zip file");i.writeFileToAsync(d,D,b,g,C)},x)})},toBufferPromise:function(){return new Promise((d,m)=>{o.toAsyncBuffer(d,m)})},toBuffer:function(d,m,b,g){return typeof d=="function"?(o.toAsyncBuffer(d,m,b,g),null):o.compressToBuffer()}}}});var YC=y((Lfe,KC)=>{var WC={};KC.exports=WC;var GC={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(GC).forEach(function(t){var e=GC[t],r=WC[t]=[];r.open="\x1B["+e[0]+"m",r.close="\x1B["+e[1]+"m"})});var XC=y((Bfe,JC)=>{"use strict";JC.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 QC=y((qfe,ZC)=>{"use strict";var n9=require("os"),Ar=XC(),Tt=process.env,as=void 0;Ar("no-color")||Ar("no-colors")||Ar("color=false")?as=!1:(Ar("color")||Ar("colors")||Ar("color=true")||Ar("color=always"))&&(as=!0);"FORCE_COLOR"in Tt&&(as=Tt.FORCE_COLOR.length===0||parseInt(Tt.FORCE_COLOR,10)!==0);function i9(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}function o9(t){if(as===!1)return 0;if(Ar("color=16m")||Ar("color=full")||Ar("color=truecolor"))return 3;if(Ar("color=256"))return 2;if(t&&!t.isTTY&&as!==!0)return 0;var e=as?1:0;if(process.platform==="win32"){var r=n9.release().split(".");return Number(process.versions.node.split(".")[0])>=8&&Number(r[0])>=10&&Number(r[2])>=10586?Number(r[2])>=14931?3:2:1}if("CI"in Tt)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some(function(i){return i in Tt})||Tt.CI_NAME==="codeship"?1:e;if("TEAMCITY_VERSION"in Tt)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Tt.TEAMCITY_VERSION)?1:0;if("TERM_PROGRAM"in Tt){var n=parseInt((Tt.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(Tt.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Hyper":return 3;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(Tt.TERM)?2:/^screen|^xterm|^vt100|^rxvt|color|ansi|cygwin|linux/i.test(Tt.TERM)||"COLORTERM"in Tt?1:(Tt.TERM==="dumb",e)}function qg(t){var e=o9(t);return i9(e)}ZC.exports={supportsColor:qg,stdout:qg(process.stdout),stderr:qg(process.stderr)}});var tS=y((Mfe,eS)=>{eS.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 nS=y((Ufe,rS)=>{rS.exports=function(e,r){e=e||" he is here ";var n={up:["\u030D","\u030E","\u0304","\u0305","\u033F","\u0311","\u0306","\u0310","\u0352","\u0357","\u0351","\u0307","\u0308","\u030A","\u0342","\u0313","\u0308","\u034A","\u034B","\u034C","\u0303","\u0302","\u030C","\u0350","\u0300","\u0301","\u030B","\u030F","\u0312","\u0313","\u0314","\u033D","\u0309","\u0363","\u0364","\u0365","\u0366","\u0367","\u0368","\u0369","\u036A","\u036B","\u036C","\u036D","\u036E","\u036F","\u033E","\u035B","\u0346","\u031A"],down:["\u0316","\u0317","\u0318","\u0319","\u031C","\u031D","\u031E","\u031F","\u0320","\u0324","\u0325","\u0326","\u0329","\u032A","\u032B","\u032C","\u032D","\u032E","\u032F","\u0330","\u0331","\u0332","\u0333","\u0339","\u033A","\u033B","\u033C","\u0345","\u0347","\u0348","\u0349","\u034D","\u034E","\u0353","\u0354","\u0355","\u0356","\u0359","\u035A","\u0323"],mid:["\u0315","\u031B","\u0300","\u0301","\u0358","\u0321","\u0322","\u0327","\u0328","\u0334","\u0335","\u0336","\u035C","\u035D","\u035E","\u035F","\u0360","\u0362","\u0338","\u0337","\u0361"," \u0489"]},i=[].concat(n.up,n.down,n.mid);function o(u){var c=Math.floor(Math.random()*u);return c}function s(u){var c=!1;return i.filter(function(l){c=l===u}),c}function a(u,c){var l="",f,h;c=c||{},c.up=typeof c.up<"u"?c.up:!0,c.mid=typeof c.mid<"u"?c.mid:!0,c.down=typeof c.down<"u"?c.down:!0,c.size=typeof c.size<"u"?c.size:"maxi",u=u.split("");for(h in u)if(!s(h)){switch(l=l+u[h],f={up:0,down:0,mid:0},c.size){case"mini":f.up=o(8),f.mid=o(2),f.down=o(8);break;case"maxi":f.up=o(16)+3,f.mid=o(4)+1,f.down=o(64)+3;break;default:f.up=o(8)+1,f.mid=o(6)/2,f.down=o(8)+1;break}var d=["up","mid","down"];for(var m in d)for(var b=d[m],g=0;g<=f[b];g++)c[b]&&(l=l+n[b][o(n[b].length)])}return l}return a(e,r)}});var oS=y((Vfe,iS)=>{iS.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 aS=y((Hfe,sS)=>{sS.exports=function(t){return function(e,r,n){return r%2===0?e:t.inverse(e)}}});var cS=y((zfe,uS)=>{uS.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 fS=y((Gfe,lS)=>{lS.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 yS=y((Kfe,gS)=>{var ce={};gS.exports=ce;ce.themes={};var s9=require("util"),Ni=ce.styles=YC(),hS=Object.defineProperties,a9=new RegExp(/[\r\n]+/g);ce.supportsColor=QC().supportsColor;typeof ce.enabled>"u"&&(ce.enabled=ce.supportsColor()!==!1);ce.enable=function(){ce.enabled=!0};ce.disable=function(){ce.enabled=!1};ce.stripColors=ce.strip=function(t){return(""+t).replace(/\x1B\[\d+m/g,"")};var Wfe=ce.stylize=function(e,r){if(!ce.enabled)return e+"";var n=Ni[r];return!n&&r in ce?ce[r](e):n.open+e+n.close},u9=/[|\\{}()[\]^$+*?.]/g,c9=function(t){if(typeof t!="string")throw new TypeError("Expected a string");return t.replace(u9,"\\$&")};function pS(t){var e=function r(){return f9.apply(r,arguments)};return e._styles=t,e.__proto__=l9,e}var mS=function(){var t={};return Ni.grey=Ni.gray,Object.keys(Ni).forEach(function(e){Ni[e].closeRe=new RegExp(c9(Ni[e].close),"g"),t[e]={get:function(){return pS(this._styles.concat(e))}}}),t}(),l9=hS(function(){},mS);function f9(){var t=Array.prototype.slice.call(arguments),e=t.map(function(s){return s!=null&&s.constructor===String?s:s9.inspect(s)}).join(" ");if(!ce.enabled||!e)return e;for(var r=e.indexOf(`
24
+ `)!=-1,n=this._styles,i=n.length;i--;){var o=Ni[n[i]];e=o.open+e.replace(o.closeRe,o.open)+o.close,r&&(e=e.replace(a9,function(s){return o.close+s+o.open}))}return e}ce.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){ce[r]=function(n){if(typeof t[r]=="object"){var i=n;for(var o in t[r])i=ce[t[r][o]](i);return i}return ce[t[r]](n)}})(e)};function d9(){var t={};return Object.keys(mS).forEach(function(e){t[e]={get:function(){return pS([e])}}}),t}var h9=function(e,r){var n=r.split("");return n=n.map(e),n.join("")};ce.trap=tS();ce.zalgo=nS();ce.maps={};ce.maps.america=oS()(ce);ce.maps.zebra=aS()(ce);ce.maps.rainbow=cS()(ce);ce.maps.random=fS()(ce);for(dS in ce.maps)(function(t){ce[t]=function(e){return h9(ce.maps[t],e)}})(dS);var dS;hS(ce,d9())});var vS=y((Yfe,DS)=>{var p9=yS();DS.exports=p9});var bS=y(Mg=>{"use strict";Mg.indent=function(e){return new Array(e+1).join(" ")};Mg.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 wS=y((Xfe,m9)=>{m9.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 _S=y(Eu=>{"use strict";var zr=vS(),ri=bS(),g9=/[^\w\s\n\r\v\t\.,]/i;Eu.version=wS().version;var Ug=function(t,e){return t!==void 0||e.renderUndefined},nf=function(t,e,r){return!!(typeof t=="boolean"||typeof t=="number"||typeof t=="function"||t===null||t===void 0||t instanceof Date||typeof t=="string"&&t.indexOf(`
25
25
  `)===-1||r.inlineArrays&&!e&&Array.isArray(t)&&nf(t[0],!0,r))},y9=function(t,e){if(e.noColor)return t;if(typeof t=="string")return e.stringColor?zr[e.stringColor](t):t;var r=t+"";return t===!0?zr.green(r):t===!1?zr.red(r):t==null?zr.grey(r):typeof t=="number"?t>=0?zr[e.positiveNumberColor](r):zr[e.negativeNumberColor](r):typeof t=="function"?"function() {}":Array.isArray(t)?t.join(", "):r},Vg=function(t,e){return t.multilineStringColor===null||t.noColor?e:zr[t.multilineStringColor](e)},D9=function(t,e,r){var n=t.split(`
26
26
  `);return n=n.map(function(i){return ri.indent(e)+Vg(r,i)}),n.join(`
27
27
  `)},us=function(t,e,r){if(typeof t=="string"&&t.match(g9)&&e.escape&&(t=JSON.stringify(t)),!Ug(t,e))return[];if(nf(t,!1,e))return[ri.indent(r)+y9(t,e)];if(typeof t=="string")return[ri.indent(r)+Vg(e,'"""'),D9(t,r+e.defaultIndentation,e),ri.indent(r)+Vg(e,'"""')];if(Array.isArray(t)){if(t.length===0)return[ri.indent(r)+e.emptyArrayMsg];var n=[];return t.forEach(function(a){if(Ug(a,e)){var u="- ";e.noColor||(u=zr[e.dashColor](u)),u=ri.indent(r)+u,nf(a,!1,e)?(u+=us(a,e,0)[0],n.push(u)):(n.push(u),n.push.apply(n,us(a,e,r+e.defaultIndentation)))}}),n}if(t instanceof Error)return us({message:t.message,stack:t.stack.split(`
28
28
  `)},e,r);var i=e.noAlign?0:ri.getMaxIndexLength(t),o,s=[];return Object.getOwnPropertyNames(t).forEach(function(a){if(Ug(t[a],e))if(o=a+": ",e.noColor||(o=zr[e.keysColor](o)),o=ri.indent(r)+o,nf(t[a],!1,e)){var u=e.noAlign?0:i-a.length;o+=us(t[a],e,u)[0],s.push(o)}else s.push(o),s.push.apply(s,us(t[a],e,r+e.defaultIndentation))}),s};Eu.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,us(e,r,n).join(`
29
29
  `)};Eu.renderString=function(e,r,n){var i="",o;if(typeof e!="string"||e==="")return"";if(e[0]!=="{"&&e[0]!=="["){var s;e.indexOf("{")===-1?s=e.indexOf("["):e.indexOf("[")===-1||e.indexOf("{")<e.indexOf("[")?s=e.indexOf("{"):s=e.indexOf("["),i+=e.substr(0,s)+`
30
- `,e=e.substr(s)}try{o=JSON.parse(e)}catch{return zr.red("Error:")+" Not valid JSON!"}return i+=Eu.render(o,r,n),i}});var Gg=y(of=>{"use strict";Object.defineProperty(of,"__esModule",{value:!0});of.default=void 0;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 CS(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,b9(n.key),n)}}function v9(t,e,r){return e&&CS(t.prototype,e),r&&CS(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function b9(t){var e=w9(t,"string");return cs(e)=="symbol"?e:e+""}function w9(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)}function _9(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function E9(t,e,r){return e=Su(e),C9(t,zg()?Reflect.construct(e,r||[],Su(t).constructor):e.apply(t,r))}function C9(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 S9(t)}function S9(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function x9(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&&Cu(t,e)}function Hg(t){var e=typeof Map=="function"?new Map:void 0;return Hg=function(n){if(n===null||!O9(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 F9(n,arguments,Su(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),Cu(i,n)},Hg(t)}function F9(t,e,r){if(zg())return Reflect.construct.apply(null,arguments);var n=[null];n.push.apply(n,e);var i=new(t.bind.apply(t,n));return r&&Cu(i,r.prototype),i}function zg(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(zg=function(){return!!t})()}function O9(t){try{return Function.toString.call(t).indexOf("[native code]")!==-1}catch{return typeof t=="function"}}function Cu(t,e){return Cu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Cu(t,e)}function Su(t){return Su=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Su(t)}var A9=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(_9(this,e),n=E9(this,e,[r]),n.originalRequest=o,n.originalResponse=s,n.causingError=i,i!=null&&(r+=", caused by ".concat(i.toString())),o!=null){var a=o.getHeader("X-Request-ID")||"n/a",u=o.getMethod(),c=o.getURL(),l=s?s.getStatus():"n/a",f=s?s.getBody()||"":"n/a";r+=", originated from request (method: ".concat(u,", url: ").concat(c,", response code: ").concat(l,", response text: ").concat(f,", request id: ").concat(a,")")}return n.message=r,n}return x9(e,t),v9(e)}(Hg(Error)),Qfe=of.default=A9});var Wg=y(sf=>{"use strict";Object.defineProperty(sf,"__esModule",{value:!0});sf.enableDebugLog=k9;sf.log=T9;var SS=!1;function k9(){SS=!0}function T9(t){SS&&console.log(t)}});var FS=y(af=>{"use strict";Object.defineProperty(af,"__esModule",{value:!0});af.default=void 0;function xu(t){"@babel/helpers - typeof";return xu=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},xu(t)}function P9(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,$9(n.key),n)}}function R9(t,e,r){return e&&xS(t.prototype,e),r&&xS(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function $9(t){var e=I9(t,"string");return xu(e)=="symbol"?e:e+""}function I9(t,e){if(xu(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(xu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var rde=af.default=function(){function t(){P9(this,t)}return R9(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 OS=y((Kg,Yg)=>{(function(t,e){typeof Kg=="object"&&typeof Yg<"u"?Yg.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:Kg,function(){"use strict";var t="3.7.7",e=t,r=typeof Buffer=="function",n=typeof TextDecoder=="function"?new TextDecoder:void 0,i=typeof TextEncoder=="function"?new TextEncoder:void 0,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",s=Array.prototype.slice.call(o),a=function(T){var N={};return T.forEach(function(oe,se){return N[oe]=se}),N}(s),u=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,c=String.fromCharCode.bind(String),l=typeof Uint8Array.from=="function"?Uint8Array.from.bind(Uint8Array):function(T){return new Uint8Array(Array.prototype.slice.call(T,0))},f=function(T){return T.replace(/=/g,"").replace(/[+\/]/g,function(N){return N=="+"?"-":"_"})},h=function(T){return T.replace(/[^A-Za-z0-9\+\/]/g,"")},d=function(T){for(var N,oe,se,De,pn="",vp=T.length%3,tl=0;tl<T.length;){if((oe=T.charCodeAt(tl++))>255||(se=T.charCodeAt(tl++))>255||(De=T.charCodeAt(tl++))>255)throw new TypeError("invalid character found");N=oe<<16|se<<8|De,pn+=s[N>>18&63]+s[N>>12&63]+s[N>>6&63]+s[N&63]}return vp?pn.slice(0,vp-3)+"===".substring(vp):pn},m=typeof btoa=="function"?function(T){return btoa(T)}:r?function(T){return Buffer.from(T,"binary").toString("base64")}:d,b=r?function(T){return Buffer.from(T).toString("base64")}:function(T){for(var N=4096,oe=[],se=0,De=T.length;se<De;se+=N)oe.push(c.apply(null,T.subarray(se,se+N)));return m(oe.join(""))},g=function(T,N){return N===void 0&&(N=!1),N?f(b(T)):b(T)},w=function(T){if(T.length<2){var N=T.charCodeAt(0);return N<128?T:N<2048?c(192|N>>>6)+c(128|N&63):c(224|N>>>12&15)+c(128|N>>>6&63)+c(128|N&63)}else{var N=65536+(T.charCodeAt(0)-55296)*1024+(T.charCodeAt(1)-56320);return c(240|N>>>18&7)+c(128|N>>>12&63)+c(128|N>>>6&63)+c(128|N&63)}},x=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,D=function(T){return T.replace(x,w)},C=r?function(T){return Buffer.from(T,"utf8").toString("base64")}:i?function(T){return b(i.encode(T))}:function(T){return m(D(T))},k=function(T,N){return N===void 0&&(N=!1),N?f(C(T)):C(T)},$=function(T){return k(T,!0)},F=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,L=function(T){switch(T.length){case 4:var N=(7&T.charCodeAt(0))<<18|(63&T.charCodeAt(1))<<12|(63&T.charCodeAt(2))<<6|63&T.charCodeAt(3),oe=N-65536;return c((oe>>>10)+55296)+c((oe&1023)+56320);case 3:return c((15&T.charCodeAt(0))<<12|(63&T.charCodeAt(1))<<6|63&T.charCodeAt(2));default:return c((31&T.charCodeAt(0))<<6|63&T.charCodeAt(1))}},S=function(T){return T.replace(F,L)},I=function(T){if(T=T.replace(/\s+/g,""),!u.test(T))throw new TypeError("malformed base64.");T+="==".slice(2-(T.length&3));for(var N,oe="",se,De,pn=0;pn<T.length;)N=a[T.charAt(pn++)]<<18|a[T.charAt(pn++)]<<12|(se=a[T.charAt(pn++)])<<6|(De=a[T.charAt(pn++)]),oe+=se===64?c(N>>16&255):De===64?c(N>>16&255,N>>8&255):c(N>>16&255,N>>8&255,N&255);return oe},R=typeof atob=="function"?function(T){return atob(h(T))}:r?function(T){return Buffer.from(T,"base64").toString("binary")}:I,B=r?function(T){return l(Buffer.from(T,"base64"))}:function(T){return l(R(T).split("").map(function(N){return N.charCodeAt(0)}))},q=function(T){return B(M(T))},K=r?function(T){return Buffer.from(T,"base64").toString("utf8")}:n?function(T){return n.decode(B(T))}:function(T){return S(R(T))},M=function(T){return h(T.replace(/[-_]/g,function(N){return N=="-"?"+":"/"}))},E=function(T){return K(M(T))},v=function(T){if(typeof T!="string")return!1;var N=T.replace(/\s+/g,"").replace(/={0,2}$/,"");return!/[^\s0-9a-zA-Z\+/]/.test(N)||!/[^\s0-9a-zA-Z\-_]/.test(N)},_=function(T){return{value:T,enumerable:!1,writable:!0,configurable:!0}},O=function(){var T=function(N,oe){return Object.defineProperty(String.prototype,N,_(oe))};T("fromBase64",function(){return E(this)}),T("toBase64",function(N){return k(this,N)}),T("toBase64URI",function(){return k(this,!0)}),T("toBase64URL",function(){return k(this,!0)}),T("toUint8Array",function(){return q(this)})},j=function(){var T=function(N,oe){return Object.defineProperty(Uint8Array.prototype,N,_(oe))};T("toBase64",function(N){return g(this,N)}),T("toBase64URI",function(){return g(this,!0)}),T("toBase64URL",function(){return g(this,!0)})},P=function(){O(),j()},U={version:t,VERSION:e,atob:R,atobPolyfill:I,btoa:m,btoaPolyfill:d,fromBase64:E,toBase64:k,encode:k,encodeURI:$,encodeURL:$,utob:D,btou:S,decode:E,isValid:v,fromUint8Array:g,toUint8Array:q,extendString:O,extendUint8Array:j,extendBuiltins:P};return U.Base64={},Object.keys(U).forEach(function(T){return U.Base64[T]=U[T]}),U})});var kS=y((ide,AS)=>{"use strict";AS.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 RS=y(Jg=>{"use strict";var j9=Object.prototype.hasOwnProperty,N9;function TS(t){try{return decodeURIComponent(t.replace(/\+/g," "))}catch{return null}}function PS(t){try{return encodeURIComponent(t)}catch{return null}}function L9(t){for(var e=/([^=?#&]+)=?([^&]*)/g,r={},n;n=e.exec(t);){var i=TS(n[1]),o=TS(n[2]);i===null||o===null||i in r||(r[i]=o)}return r}function B9(t,e){e=e||"";var r=[],n,i;typeof e!="string"&&(e="?");for(i in t)if(j9.call(t,i)){if(n=t[i],!n&&(n===null||n===N9||isNaN(n))&&(n=""),i=PS(i),n=PS(n),i===null||n===null)continue;r.push(i+"="+n)}return r.length?e+r.join("&"):""}Jg.stringify=B9;Jg.parse=L9});var MS=y((sde,qS)=>{"use strict";var IS=kS(),uf=RS(),q9=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,jS=/[\n\r\t]/g,M9=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,NS=/:\d+$/,U9=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i,V9=/^[a-zA-Z]:/;function Zg(t){return(t||"").toString().replace(q9,"")}var Xg=[["#","hash"],["?","query"],function(e,r){return Gr(r.protocol)?e.replace(/\\/g,"/"):e},["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d*)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],$S={hash:1,query:1};function LS(t){var e;typeof window<"u"?e=window:typeof global<"u"?e=global:typeof self<"u"?e=self:e={};var r=e.location||{};t=t||r;var n={},i=typeof t,o;if(t.protocol==="blob:")n=new Wr(unescape(t.pathname),{});else if(i==="string"){n=new Wr(t,{});for(o in $S)delete n[o]}else if(i==="object"){for(o in t)o in $S||(n[o]=t[o]);n.slashes===void 0&&(n.slashes=M9.test(t.href))}return n}function Gr(t){return t==="file:"||t==="ftp:"||t==="http:"||t==="https:"||t==="ws:"||t==="wss:"}function BS(t,e){t=Zg(t),t=t.replace(jS,""),e=e||{};var r=U9.exec(t),n=r[1]?r[1].toLowerCase():"",i=!!r[2],o=!!r[3],s=0,a;return i?o?(a=r[2]+r[3]+r[4],s=r[2].length+r[3].length):(a=r[2]+r[4],s=r[2].length):o?(a=r[3]+r[4],s=r[3].length):a=r[4],n==="file:"?s>=2&&(a=a.slice(2)):Gr(n)?a=r[4]:n?i&&(a=a.slice(2)):s>=2&&Gr(e.protocol)&&(a=r[4]),{protocol:n,slashes:i||Gr(n),slashesCount:s,rest:a}}function H9(t,e){if(t==="")return e;for(var r=(e||"/").split("/").slice(0,-1).concat(t.split("/")),n=r.length,i=r[n-1],o=!1,s=0;n--;)r[n]==="."?r.splice(n,1):r[n]===".."?(r.splice(n,1),s++):s&&(n===0&&(o=!0),r.splice(n,1),s--);return o&&r.unshift(""),(i==="."||i==="..")&&r.push(""),r.join("/")}function Wr(t,e,r){if(t=Zg(t),t=t.replace(jS,""),!(this instanceof Wr))return new Wr(t,e,r);var n,i,o,s,a,u,c=Xg.slice(),l=typeof e,f=this,h=0;for(l!=="object"&&l!=="string"&&(r=e,e=null),r&&typeof r!="function"&&(r=uf.parse),e=LS(e),i=BS(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||V9.test(t))||!i.slashes&&(i.protocol||i.slashesCount<2||!Gr(f.protocol)))&&(c[3]=[/(.*)/,"pathname"]);h<c.length;h++){if(s=c[h],typeof s=="function"){t=s(t,f);continue}o=s[0],u=s[1],o!==o?f[u]=t:typeof o=="string"?(a=o==="@"?t.lastIndexOf(o):t.indexOf(o),~a&&(typeof s[2]=="number"?(f[u]=t.slice(0,a),t=t.slice(a+s[2])):(f[u]=t.slice(a),t=t.slice(0,a)))):(a=o.exec(t))&&(f[u]=a[1],t=t.slice(0,a.index)),f[u]=f[u]||n&&s[3]&&e[u]||"",s[4]&&(f[u]=f[u].toLowerCase())}r&&(f.query=r(f.query)),n&&e.slashes&&f.pathname.charAt(0)!=="/"&&(f.pathname!==""||e.pathname!=="")&&(f.pathname=H9(f.pathname,e.pathname)),f.pathname.charAt(0)!=="/"&&Gr(f.protocol)&&(f.pathname="/"+f.pathname),IS(f.port,f.protocol)||(f.host=f.hostname,f.port=""),f.username=f.password="",f.auth&&(a=f.auth.indexOf(":"),~a?(f.username=f.auth.slice(0,a),f.username=encodeURIComponent(decodeURIComponent(f.username)),f.password=f.auth.slice(a+1),f.password=encodeURIComponent(decodeURIComponent(f.password))):f.username=encodeURIComponent(decodeURIComponent(f.auth)),f.auth=f.password?f.username+":"+f.password:f.username),f.origin=f.protocol!=="file:"&&Gr(f.protocol)&&f.host?f.protocol+"//"+f.host:"null",f.href=f.toString()}function z9(t,e,r){var n=this;switch(t){case"query":typeof e=="string"&&e.length&&(e=(r||uf.parse)(e)),n[t]=e;break;case"port":n[t]=e,IS(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<Xg.length;s++){var a=Xg[s];a[4]&&(n[a[1]]=n[a[1]].toLowerCase())}return n.auth=n.password?n.username+":"+n.password:n.username,n.origin=n.protocol!=="file:"&&Gr(n.protocol)&&n.host?n.protocol+"//"+n.host:"null",n.href=n.toString(),n}function G9(t){(!t||typeof t!="function")&&(t=uf.stringify);var e,r=this,n=r.host,i=r.protocol;i&&i.charAt(i.length-1)!==":"&&(i+=":");var o=i+(r.protocol&&r.slashes||Gr(r.protocol)?"//":"");return r.username?(o+=r.username,r.password&&(o+=":"+r.password),o+="@"):r.password?(o+=":"+r.password,o+="@"):r.protocol!=="file:"&&Gr(r.protocol)&&!n&&r.pathname!=="/"&&(o+="@"),(n[n.length-1]===":"||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}Wr.prototype={set:z9,toString:G9};Wr.extractProtocol=BS;Wr.location=LS;Wr.trimLeft=Zg;Wr.qs=uf;qS.exports=Wr});var US=y(Qg=>{"use strict";Object.defineProperty(Qg,"__esModule",{value:!0});Qg.default=W9;function W9(){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 n1=y(ff=>{"use strict";Object.defineProperty(ff,"__esModule",{value:!0});ff.default=void 0;var K9=OS(),Y9=ny(MS()),cf=ny(Gg()),Li=Wg(),J9=ny(US());function ny(t){return t&&t.__esModule?t:{default:t}}function ey(){"use strict";ey=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(E,v,_){E[v]=_.value},o=typeof Symbol=="function"?Symbol:{},s=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function c(E,v,_){return Object.defineProperty(E,v,{value:_,enumerable:!0,configurable:!0,writable:!0}),E[v]}try{c({},"")}catch{c=function(_,O,j){return _[O]=j}}function l(E,v,_,O){var j=v&&v.prototype instanceof w?v:w,P=Object.create(j.prototype),U=new K(O||[]);return i(P,"_invoke",{value:I(E,_,U)}),P}function f(E,v,_){try{return{type:"normal",arg:E.call(v,_)}}catch(O){return{type:"throw",arg:O}}}e.wrap=l;var h="suspendedStart",d="suspendedYield",m="executing",b="completed",g={};function w(){}function x(){}function D(){}var C={};c(C,s,function(){return this});var k=Object.getPrototypeOf,$=k&&k(k(M([])));$&&$!==r&&n.call($,s)&&(C=$);var F=D.prototype=w.prototype=Object.create(C);function L(E){["next","throw","return"].forEach(function(v){c(E,v,function(_){return this._invoke(v,_)})})}function S(E,v){function _(j,P,U,T){var N=f(E[j],E,P);if(N.type!=="throw"){var oe=N.arg,se=oe.value;return se&&Bi(se)=="object"&&n.call(se,"__await")?v.resolve(se.__await).then(function(De){_("next",De,U,T)},function(De){_("throw",De,U,T)}):v.resolve(se).then(function(De){oe.value=De,U(oe)},function(De){return _("throw",De,U,T)})}T(N.arg)}var O;i(this,"_invoke",{value:function(P,U){function T(){return new v(function(N,oe){_(P,U,N,oe)})}return O=O?O.then(T,T):T()}})}function I(E,v,_){var O=h;return function(j,P){if(O===m)throw Error("Generator is already running");if(O===b){if(j==="throw")throw P;return{value:t,done:!0}}for(_.method=j,_.arg=P;;){var U=_.delegate;if(U){var T=R(U,_);if(T){if(T===g)continue;return T}}if(_.method==="next")_.sent=_._sent=_.arg;else if(_.method==="throw"){if(O===h)throw O=b,_.arg;_.dispatchException(_.arg)}else _.method==="return"&&_.abrupt("return",_.arg);O=m;var N=f(E,v,_);if(N.type==="normal"){if(O=_.done?b:d,N.arg===g)continue;return{value:N.arg,done:_.done}}N.type==="throw"&&(O=b,_.method="throw",_.arg=N.arg)}}}function R(E,v){var _=v.method,O=E.iterator[_];if(O===t)return v.delegate=null,_==="throw"&&E.iterator.return&&(v.method="return",v.arg=t,R(E,v),v.method==="throw")||_!=="return"&&(v.method="throw",v.arg=new TypeError("The iterator does not provide a '"+_+"' method")),g;var j=f(O,E.iterator,v.arg);if(j.type==="throw")return v.method="throw",v.arg=j.arg,v.delegate=null,g;var P=j.arg;return P?P.done?(v[E.resultName]=P.value,v.next=E.nextLoc,v.method!=="return"&&(v.method="next",v.arg=t),v.delegate=null,g):P:(v.method="throw",v.arg=new TypeError("iterator result is not an object"),v.delegate=null,g)}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 M(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 _=-1,O=function j(){for(;++_<E.length;)if(n.call(E,_))return j.value=E[_],j.done=!1,j;return j.value=t,j.done=!0,j};return O.next=O}}throw new TypeError(Bi(E)+" is not iterable")}return x.prototype=D,i(F,"constructor",{value:D,configurable:!0}),i(D,"constructor",{value:x,configurable:!0}),x.displayName=c(D,u,"GeneratorFunction"),e.isGeneratorFunction=function(E){var v=typeof E=="function"&&E.constructor;return!!v&&(v===x||(v.displayName||v.name)==="GeneratorFunction")},e.mark=function(E){return Object.setPrototypeOf?Object.setPrototypeOf(E,D):(E.__proto__=D,c(E,u,"GeneratorFunction")),E.prototype=Object.create(F),E},e.awrap=function(E){return{__await:E}},L(S.prototype),c(S.prototype,a,function(){return this}),e.AsyncIterator=S,e.async=function(E,v,_,O,j){j===void 0&&(j=Promise);var P=new S(l(E,v,_,O),j);return e.isGeneratorFunction(v)?P:P.next().then(function(U){return U.done?U.value:P.next()})},L(F),c(F,u,"Generator"),c(F,s,function(){return this}),c(F,"toString",function(){return"[object Generator]"}),e.keys=function(E){var v=Object(E),_=[];for(var O in v)_.push(O);return _.reverse(),function j(){for(;_.length;){var P=_.pop();if(P in v)return j.value=P,j.done=!1,j}return j.done=!0,j}},e.values=M,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 _ in this)_.charAt(0)==="t"&&n.call(this,_)&&!isNaN(+_.slice(1))&&(this[_]=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 _=this;function O(oe,se){return U.type="throw",U.arg=v,_.next=oe,se&&(_.method="next",_.arg=t),!!se}for(var j=this.tryEntries.length-1;j>=0;--j){var P=this.tryEntries[j],U=P.completion;if(P.tryLoc==="root")return O("end");if(P.tryLoc<=this.prev){var T=n.call(P,"catchLoc"),N=n.call(P,"finallyLoc");if(T&&N){if(this.prev<P.catchLoc)return O(P.catchLoc,!0);if(this.prev<P.finallyLoc)return O(P.finallyLoc)}else if(T){if(this.prev<P.catchLoc)return O(P.catchLoc,!0)}else{if(!N)throw Error("try statement without catch or finally");if(this.prev<P.finallyLoc)return O(P.finallyLoc)}}}},abrupt:function(v,_){for(var O=this.tryEntries.length-1;O>=0;--O){var j=this.tryEntries[O];if(j.tryLoc<=this.prev&&n.call(j,"finallyLoc")&&this.prev<j.finallyLoc){var P=j;break}}P&&(v==="break"||v==="continue")&&P.tryLoc<=_&&_<=P.finallyLoc&&(P=null);var U=P?P.completion:{};return U.type=v,U.arg=_,P?(this.method="next",this.next=P.finallyLoc,g):this.complete(U)},complete:function(v,_){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"&&_&&(this.next=_),g},finish:function(v){for(var _=this.tryEntries.length-1;_>=0;--_){var O=this.tryEntries[_];if(O.finallyLoc===v)return this.complete(O.completion,O.afterLoc),q(O),g}},catch:function(v){for(var _=this.tryEntries.length-1;_>=0;--_){var O=this.tryEntries[_];if(O.tryLoc===v){var j=O.completion;if(j.type==="throw"){var P=j.arg;q(O)}return P}}throw Error("illegal catch attempt")},delegateYield:function(v,_,O){return this.delegate={iterator:M(v),resultName:_,nextLoc:O},this.method==="next"&&(this.arg=t),g}},e}function VS(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(c){r(c);return}a.done?e(u):Promise.resolve(u).then(n,i)}function X9(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function s(u){VS(o,n,i,s,a,"next",u)}function a(u){VS(o,n,i,s,a,"throw",u)}s(void 0)})}}function ZS(t,e){return e7(t)||Q9(t,e)||QS(t,e)||Z9()}function Z9(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
31
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Q9(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,o,s,a=[],u=!0,c=!1;try{if(o=(r=r.call(t)).next,e===0){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=o.call(r)).done)&&(a.push(n.value),a.length!==e);u=!0);}catch(l){c=!0,i=l}finally{try{if(!u&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(c)throw i}}return a}}function e7(t){if(Array.isArray(t))return t}function Bi(t){"@babel/helpers - typeof";return Bi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Bi(t)}function t7(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=QS(t))||e&&t&&typeof t.length=="number"){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(c){throw c},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
32
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,s=!1,a;return{s:function(){r=r.call(t)},n:function(){var c=r.next();return o=c.done,c},e:function(c){s=!0,a=c},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(s)throw a}}}}function QS(t,e){if(t){if(typeof t=="string")return HS(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 HS(t,e)}}function HS(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 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 ls(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){r7(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 r7(t,e,r){return e=e1(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function n7(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,e1(n.key),n)}}function i7(t,e,r){return e&&GS(t.prototype,e),r&&GS(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function e1(t){var e=o7(t,"string");return Bi(e)=="symbol"?e:e+""}function o7(t,e){if(Bi(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Bi(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var ty="tus-v1",lf="ietf-draft-03",s7={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:r1,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:ty},t1=function(){function t(e,r){n7(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 i7(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(![ty,lf].includes(this.options.protocol)){this._emitError(new Error("tus: unsupported protocol ".concat(this.options.protocol)));return}if(!this.options.endpoint&&!this.options.uploadUrl&&!this.url){this._emitError(new Error("tus: neither an endpoint or an upload URL is provided"));return}var i=this.options.retryDelays;if(i!=null&&Object.prototype.toString.call(i)!=="[object Array]"){this._emitError(new Error("tus: the `retryDelays` option must either be an array or null"));return}if(this.options.parallelUploads>1)for(var o=0,s=["uploadUrl","uploadSize","uploadLengthDeferred"];o<s.length;o++){var a=s[o];if(this.options[a]){this._emitError(new Error("tus: cannot use the ".concat(a," option when parallelUploads is enabled")));return}}if(this.options.parallelUploadBoundaries){if(this.options.parallelUploads<=1){this._emitError(new Error("tus: cannot use the `parallelUploadBoundaries` option when `parallelUploads` is disabled"));return}if(this.options.parallelUploads!==this.options.parallelUploadBoundaries.length){this._emitError(new Error("tus: the `parallelUploadBoundaries` must have the same length as the value of `parallelUploads`"));return}}this.options.fingerprint(n,this.options).then(function(u){return u==null?(0,Li.log)("No fingerprint was calculated meaning that the upload cannot be stored in the URL storage."):(0,Li.log)("Calculated fingerprint: ".concat(u)),r._fingerprint=u,r._source?r._source:r.options.fileReader.openFile(n,r.options.chunkSize)}).then(function(u){if(r._source=u,r.options.uploadLengthDeferred)r._size=null;else if(r.options.uploadSize!=null){if(r._size=Number(r.options.uploadSize),Number.isNaN(r._size)){r._emitError(new Error("tus: cannot convert `uploadSize` option into a number"));return}}else if(r._size=r._source.size,r._size==null){r._emitError(new Error("tus: cannot automatically derive upload's size from input. Specify it manually using the `uploadSize` option or use the `uploadLengthDeferred` option"));return}r.options.parallelUploads>1||r._parallelUploadUrls!=null?r._startParallelUpload():r._startSingleUpload()}).catch(function(u){r._emitError(u)})}},{key:"_startParallelUpload",value:function(){var r,n=this,i=this._size,o=0;this._parallelUploads=[];var s=this._parallelUploadUrls!=null?this._parallelUploadUrls.length:this.options.parallelUploads,a=(r=this.options.parallelUploadBoundaries)!==null&&r!==void 0?r:u7(this._source.size,s);this._parallelUploadUrls&&a.forEach(function(l,f){l.uploadUrl=n._parallelUploadUrls[f]||null}),this._parallelUploadUrls=new Array(a.length);var u=a.map(function(l,f){var h=0;return n._source.slice(l.start,l.end).then(function(d){var m=d.value;return new Promise(function(b,g){var w=ls(ls({},n.options),{},{uploadUrl:l.uploadUrl||null,storeFingerprintForResuming:!1,removeFingerprintOnSuccess:!1,parallelUploads:1,parallelUploadBoundaries:null,metadata:n.options.metadataForPartialUploads,headers:ls(ls({},n.options.headers),{},{"Upload-Concat":"partial"}),onSuccess:b,onError:g,onProgress:function(C){o=o-h+C,h=C,n._emitProgress(o,i)},onUploadUrlAvailable:function(){n._parallelUploadUrls[f]=x.url,n._parallelUploadUrls.filter(function(C){return!!C}).length===a.length&&n._saveUploadInUrlStorage()}}),x=new t(m,w);x.start(),n._parallelUploads.push(x)})})}),c;Promise.all(u).then(function(){c=n._openRequest("POST",n.options.endpoint),c.setHeader("Upload-Concat","final;".concat(n._parallelUploadUrls.join(" ")));var l=WS(n.options.metadata);return l!==""&&c.setHeader("Upload-Metadata",l),n._sendRequest(c,null)}).then(function(l){if(!fs(l.getStatus(),200)){n._emitHttpError(c,l,"tus: unexpected response while creating upload");return}var f=l.getHeader("Location");if(f==null){n._emitHttpError(c,l,"tus: invalid or missing Location header");return}n.url=XS(n.options.endpoint,f),(0,Li.log)("Created upload at ".concat(n.url)),n._emitSuccess(l)}).catch(function(l){n._emitError(l)})}},{key:"_startSingleUpload",value:function(){if(this._aborted=!1,this.url!=null){(0,Li.log)("Resuming upload from previous URL: ".concat(this.url)),this._resumeUpload();return}if(this.options.uploadUrl!=null){(0,Li.log)("Resuming upload from provided URL: ".concat(this.options.uploadUrl)),this.url=this.options.uploadUrl,this._resumeUpload();return}(0,Li.log)("Creating a new upload"),this._createUpload()}},{key:"abort",value:function(r){var n=this;if(this._parallelUploads!=null){var i=t7(this._parallelUploads),o;try{for(i.s();!(o=i.n()).done;){var s=o.value;s.abort(r)}}catch(a){i.e(a)}finally{i.f()}}return this._req!==null&&this._req.abort(),this._aborted=!0,this._retryTimeout!=null&&(clearTimeout(this._retryTimeout),this._retryTimeout=null),!r||this.url==null?Promise.resolve():t.terminate(this.url,this.options).then(function(){return n._removeFromUrlStorage()})}},{key:"_emitHttpError",value:function(r,n,i,o){this._emitError(new cf.default(i,o,r,n))}},{key:"_emitError",value:function(r){var n=this;if(!this._aborted){if(this.options.retryDelays!=null){var i=this._offset!=null&&this._offset>this._offsetBeforeRetry;if(i&&(this._retryAttempt=0),JS(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=WS(this.options.metadata);i!==""&&n.setHeader("Upload-Metadata",i);var o;this.options.uploadDataDuringCreation&&!this.options.uploadLengthDeferred?(this._offset=0,o=this._addChunkToRequest(n)):(this.options.protocol===lf&&n.setHeader("Upload-Complete","?0"),o=this._sendRequest(n,null)),o.then(function(s){if(!fs(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=XS(r.options.endpoint,a),(0,Li.log)("Created upload at ".concat(r.url)),typeof r.options.onUploadUrlAvailable=="function"&&r.options.onUploadUrlAvailable(),r._size===0){r._emitSuccess(s),r._source.close();return}r._saveUploadInUrlStorage().then(function(){r.options.uploadDataDuringCreation?r._handleUploadResponse(n,s):(r._offset=0,r._performUpload())})}).catch(function(s){r._emitHttpError(n,null,"tus: failed to create upload",s)})}},{key:"_resumeUpload",value:function(){var r=this,n=this._openRequest("HEAD",this.url),i=this._sendRequest(n,null);i.then(function(o){var s=o.getStatus();if(!fs(s,200)){if(s===423){r._emitHttpError(n,o,"tus: upload is currently locked; retry later");return}if(fs(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===ty){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(!fs(o.getStatus(),200)){r._emitHttpError(n,o,"tus: unexpected response while uploading chunk");return}r._handleUploadResponse(n,o)}).catch(function(o){r._aborted||r._emitHttpError(n,null,"tus: failed to upload chunk at offset ".concat(r._offset),o)})}}},{key:"_addChunkToRequest",value:function(r){var n=this,i=this._offset,o=this._offset+this.options.chunkSize;return r.setProgressHandler(function(s){n._emitProgress(i+s,n._size)}),r.setHeader("Content-Type","application/offset+octet-stream"),(o===Number.POSITIVE_INFINITY||o>this._size)&&!this.options.uploadLengthDeferred&&(o=this._size),this._source.slice(i,o).then(function(s){var a=s.value,u=s.done,c=a!=null&&a.size?a.size:0;n.options.uploadLengthDeferred&&u&&(n._size=n._offset+c,r.setHeader("Upload-Length","".concat(n._size)));var l=n._offset+c;return!n.options.uploadLengthDeferred&&u&&l!==n._size?Promise.reject(new Error("upload was configured with a size of ".concat(n._size," bytes, but the source is done after ").concat(l," bytes"))):a===null?n._sendRequest(r):(n.options.protocol===lf&&r.setHeader("Upload-Complete",u?"?1":"?0"),n._emitProgress(n._offset,n._size),n._sendRequest(r,a))})}},{key:"_handleUploadResponse",value:function(r,n){var i=Number.parseInt(n.getHeader("Upload-Offset"),10);if(Number.isNaN(i)){this._emitHttpError(r,n,"tus: invalid or missing offset value");return}if(this._emitProgress(i,this._size),this._emitChunkComplete(i-this._offset,i,this._size),this._offset=i,i===this._size){this._emitSuccess(n),this._source.close();return}this._performUpload()}},{key:"_openRequest",value:function(r,n){var i=KS(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 YS(r,n,this.options)}}],[{key:"terminate",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=KS("DELETE",r,n);return YS(i,null,n).then(function(o){if(o.getStatus()!==204)throw new cf.default("tus: unexpected response while terminating upload",null,i,o)}).catch(function(o){if(o instanceof cf.default||(o=new cf.default("tus: failed to terminate upload",o,i,null)),!JS(o,0,n))throw o;var s=n.retryDelays[0],a=n.retryDelays.slice(1),u=ls(ls({},n),{},{retryDelays:a});return new Promise(function(c){return setTimeout(c,s)}).then(function(){return t.terminate(r,u)})})}}])}();function WS(t){return Object.entries(t).map(function(e){var r=ZS(e,2),n=r[0],i=r[1];return"".concat(n," ").concat(K9.Base64.encode(String(i)))}).join(",")}function fs(t,e){return t>=e&&t<e+100}function KS(t,e,r){var n=r.httpStack.createRequest(t,e);r.protocol===lf?n.setHeader("Upload-Draft-Interop-Version","5"):n.setHeader("Tus-Resumable","1.0.0");for(var i=r.headers||{},o=0,s=Object.entries(i);o<s.length;o++){var a=ZS(s[o],2),u=a[0],c=a[1];n.setHeader(u,c)}if(r.addRequestId){var l=(0,J9.default)();n.setHeader("X-Request-ID",l)}return n}function YS(t,e,r){return ry.apply(this,arguments)}function ry(){return ry=X9(ey().mark(function t(e,r,n){var i;return ey().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)})),ry.apply(this,arguments)}function a7(){var t=!0;return typeof navigator<"u"&&navigator.onLine===!1&&(t=!1),t}function JS(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):r1(t)}function r1(t){var e=t.originalResponse?t.originalResponse.getStatus():0;return(!fs(e,400)||e===409||e===423)&&a7()}function XS(t,e){return new Y9.default(e,t).toString()}function u7(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}t1.defaultOptions=s7;var ude=ff.default=t1});var o1=y((lde,i1)=>{"use strict";var Kr=t=>t!==null&&typeof t=="object"&&typeof t.pipe=="function";Kr.writable=t=>Kr(t)&&t.writable!==!1&&typeof t._write=="function"&&typeof t._writableState=="object";Kr.readable=t=>Kr(t)&&t.readable!==!1&&typeof t._read=="function"&&typeof t._readableState=="object";Kr.duplex=t=>Kr.writable(t)&&Kr.readable(t);Kr.transform=t=>Kr.duplex(t)&&typeof t._transform=="function";i1.exports=Kr});var a1=y(df=>{"use strict";Object.defineProperty(df,"__esModule",{value:!0});df.default=void 0;function Fu(t){"@babel/helpers - typeof";return Fu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Fu(t)}function c7(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s1(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,f7(n.key),n)}}function l7(t,e,r){return e&&s1(t.prototype,e),r&&s1(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function f7(t){var e=d7(t,"string");return Fu(e)=="symbol"?e:e+""}function d7(t,e){if(Fu(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Fu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var fde=df.default=function(){function t(e){c7(this,t),this._buffer=e,this.size=e.length}return l7(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 f1=y(sy=>{"use strict";Object.defineProperty(sy,"__esModule",{value:!0});sy.default=D7;var l1=require("fs");function qi(t){"@babel/helpers - typeof";return qi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},qi(t)}function iy(){"use strict";iy=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(E,v,_){E[v]=_.value},o=typeof Symbol=="function"?Symbol:{},s=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function c(E,v,_){return Object.defineProperty(E,v,{value:_,enumerable:!0,configurable:!0,writable:!0}),E[v]}try{c({},"")}catch{c=function(_,O,j){return _[O]=j}}function l(E,v,_,O){var j=v&&v.prototype instanceof w?v:w,P=Object.create(j.prototype),U=new K(O||[]);return i(P,"_invoke",{value:I(E,_,U)}),P}function f(E,v,_){try{return{type:"normal",arg:E.call(v,_)}}catch(O){return{type:"throw",arg:O}}}e.wrap=l;var h="suspendedStart",d="suspendedYield",m="executing",b="completed",g={};function w(){}function x(){}function D(){}var C={};c(C,s,function(){return this});var k=Object.getPrototypeOf,$=k&&k(k(M([])));$&&$!==r&&n.call($,s)&&(C=$);var F=D.prototype=w.prototype=Object.create(C);function L(E){["next","throw","return"].forEach(function(v){c(E,v,function(_){return this._invoke(v,_)})})}function S(E,v){function _(j,P,U,T){var N=f(E[j],E,P);if(N.type!=="throw"){var oe=N.arg,se=oe.value;return se&&qi(se)=="object"&&n.call(se,"__await")?v.resolve(se.__await).then(function(De){_("next",De,U,T)},function(De){_("throw",De,U,T)}):v.resolve(se).then(function(De){oe.value=De,U(oe)},function(De){return _("throw",De,U,T)})}T(N.arg)}var O;i(this,"_invoke",{value:function(P,U){function T(){return new v(function(N,oe){_(P,U,N,oe)})}return O=O?O.then(T,T):T()}})}function I(E,v,_){var O=h;return function(j,P){if(O===m)throw Error("Generator is already running");if(O===b){if(j==="throw")throw P;return{value:t,done:!0}}for(_.method=j,_.arg=P;;){var U=_.delegate;if(U){var T=R(U,_);if(T){if(T===g)continue;return T}}if(_.method==="next")_.sent=_._sent=_.arg;else if(_.method==="throw"){if(O===h)throw O=b,_.arg;_.dispatchException(_.arg)}else _.method==="return"&&_.abrupt("return",_.arg);O=m;var N=f(E,v,_);if(N.type==="normal"){if(O=_.done?b:d,N.arg===g)continue;return{value:N.arg,done:_.done}}N.type==="throw"&&(O=b,_.method="throw",_.arg=N.arg)}}}function R(E,v){var _=v.method,O=E.iterator[_];if(O===t)return v.delegate=null,_==="throw"&&E.iterator.return&&(v.method="return",v.arg=t,R(E,v),v.method==="throw")||_!=="return"&&(v.method="throw",v.arg=new TypeError("The iterator does not provide a '"+_+"' method")),g;var j=f(O,E.iterator,v.arg);if(j.type==="throw")return v.method="throw",v.arg=j.arg,v.delegate=null,g;var P=j.arg;return P?P.done?(v[E.resultName]=P.value,v.next=E.nextLoc,v.method!=="return"&&(v.method="next",v.arg=t),v.delegate=null,g):P:(v.method="throw",v.arg=new TypeError("iterator result is not an object"),v.delegate=null,g)}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 M(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 _=-1,O=function j(){for(;++_<E.length;)if(n.call(E,_))return j.value=E[_],j.done=!1,j;return j.value=t,j.done=!0,j};return O.next=O}}throw new TypeError(qi(E)+" is not iterable")}return x.prototype=D,i(F,"constructor",{value:D,configurable:!0}),i(D,"constructor",{value:x,configurable:!0}),x.displayName=c(D,u,"GeneratorFunction"),e.isGeneratorFunction=function(E){var v=typeof E=="function"&&E.constructor;return!!v&&(v===x||(v.displayName||v.name)==="GeneratorFunction")},e.mark=function(E){return Object.setPrototypeOf?Object.setPrototypeOf(E,D):(E.__proto__=D,c(E,u,"GeneratorFunction")),E.prototype=Object.create(F),E},e.awrap=function(E){return{__await:E}},L(S.prototype),c(S.prototype,a,function(){return this}),e.AsyncIterator=S,e.async=function(E,v,_,O,j){j===void 0&&(j=Promise);var P=new S(l(E,v,_,O),j);return e.isGeneratorFunction(v)?P:P.next().then(function(U){return U.done?U.value:P.next()})},L(F),c(F,u,"Generator"),c(F,s,function(){return this}),c(F,"toString",function(){return"[object Generator]"}),e.keys=function(E){var v=Object(E),_=[];for(var O in v)_.push(O);return _.reverse(),function j(){for(;_.length;){var P=_.pop();if(P in v)return j.value=P,j.done=!1,j}return j.done=!0,j}},e.values=M,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 _ in this)_.charAt(0)==="t"&&n.call(this,_)&&!isNaN(+_.slice(1))&&(this[_]=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 _=this;function O(oe,se){return U.type="throw",U.arg=v,_.next=oe,se&&(_.method="next",_.arg=t),!!se}for(var j=this.tryEntries.length-1;j>=0;--j){var P=this.tryEntries[j],U=P.completion;if(P.tryLoc==="root")return O("end");if(P.tryLoc<=this.prev){var T=n.call(P,"catchLoc"),N=n.call(P,"finallyLoc");if(T&&N){if(this.prev<P.catchLoc)return O(P.catchLoc,!0);if(this.prev<P.finallyLoc)return O(P.finallyLoc)}else if(T){if(this.prev<P.catchLoc)return O(P.catchLoc,!0)}else{if(!N)throw Error("try statement without catch or finally");if(this.prev<P.finallyLoc)return O(P.finallyLoc)}}}},abrupt:function(v,_){for(var O=this.tryEntries.length-1;O>=0;--O){var j=this.tryEntries[O];if(j.tryLoc<=this.prev&&n.call(j,"finallyLoc")&&this.prev<j.finallyLoc){var P=j;break}}P&&(v==="break"||v==="continue")&&P.tryLoc<=_&&_<=P.finallyLoc&&(P=null);var U=P?P.completion:{};return U.type=v,U.arg=_,P?(this.method="next",this.next=P.finallyLoc,g):this.complete(U)},complete:function(v,_){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"&&_&&(this.next=_),g},finish:function(v){for(var _=this.tryEntries.length-1;_>=0;--_){var O=this.tryEntries[_];if(O.finallyLoc===v)return this.complete(O.completion,O.afterLoc),q(O),g}},catch:function(v){for(var _=this.tryEntries.length-1;_>=0;--_){var O=this.tryEntries[_];if(O.tryLoc===v){var j=O.completion;if(j.type==="throw"){var P=j.arg;q(O)}return P}}throw Error("illegal catch attempt")},delegateYield:function(v,_,O){return this.delegate={iterator:M(v),resultName:_,nextLoc:O},this.method==="next"&&(this.arg=t),g}},e}function h7(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function u1(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,m7(n.key),n)}}function p7(t,e,r){return e&&u1(t.prototype,e),r&&u1(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function m7(t){var e=g7(t,"string");return qi(e)=="symbol"?e:e+""}function g7(t,e){if(qi(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(qi(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function c1(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(c){r(c);return}a.done?e(u):Promise.resolve(u).then(n,i)}function y7(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function s(u){c1(o,n,i,s,a,"next",u)}function a(u){c1(o,n,i,s,a,"throw",u)}s(void 0)})}}function D7(t){return oy.apply(this,arguments)}function oy(){return oy=y7(iy().mark(function t(e){var r,n,i,o,s,a,u;return iy().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return n=e.path.toString(),l.next=3,l1.promises.stat(n);case 3:return i=l.sent,o=i.size,s=(r=e.start)!==null&&r!==void 0?r:0,a=Number.isFinite(e.end)?e.end+1:o,u=a-s,l.abrupt("return",new v7(e,n,u));case 9:case"end":return l.stop()}},t)})),oy.apply(this,arguments)}var v7=function(){function t(e,r,n){h7(this,t),this._stream=e,this._path=r,this.size=n}return p7(t,[{key:"slice",value:function(r,n){var i,o=(i=this._stream.start)!==null&&i!==void 0?i:0,s=(0,l1.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 uy=y(hf=>{"use strict";Object.defineProperty(hf,"__esModule",{value:!0});hf.default=void 0;function Mi(t){"@babel/helpers - typeof";return Mi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Mi(t)}function Ou(){"use strict";Ou=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(E,v,_){E[v]=_.value},o=typeof Symbol=="function"?Symbol:{},s=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function c(E,v,_){return Object.defineProperty(E,v,{value:_,enumerable:!0,configurable:!0,writable:!0}),E[v]}try{c({},"")}catch{c=function(_,O,j){return _[O]=j}}function l(E,v,_,O){var j=v&&v.prototype instanceof w?v:w,P=Object.create(j.prototype),U=new K(O||[]);return i(P,"_invoke",{value:I(E,_,U)}),P}function f(E,v,_){try{return{type:"normal",arg:E.call(v,_)}}catch(O){return{type:"throw",arg:O}}}e.wrap=l;var h="suspendedStart",d="suspendedYield",m="executing",b="completed",g={};function w(){}function x(){}function D(){}var C={};c(C,s,function(){return this});var k=Object.getPrototypeOf,$=k&&k(k(M([])));$&&$!==r&&n.call($,s)&&(C=$);var F=D.prototype=w.prototype=Object.create(C);function L(E){["next","throw","return"].forEach(function(v){c(E,v,function(_){return this._invoke(v,_)})})}function S(E,v){function _(j,P,U,T){var N=f(E[j],E,P);if(N.type!=="throw"){var oe=N.arg,se=oe.value;return se&&Mi(se)=="object"&&n.call(se,"__await")?v.resolve(se.__await).then(function(De){_("next",De,U,T)},function(De){_("throw",De,U,T)}):v.resolve(se).then(function(De){oe.value=De,U(oe)},function(De){return _("throw",De,U,T)})}T(N.arg)}var O;i(this,"_invoke",{value:function(P,U){function T(){return new v(function(N,oe){_(P,U,N,oe)})}return O=O?O.then(T,T):T()}})}function I(E,v,_){var O=h;return function(j,P){if(O===m)throw Error("Generator is already running");if(O===b){if(j==="throw")throw P;return{value:t,done:!0}}for(_.method=j,_.arg=P;;){var U=_.delegate;if(U){var T=R(U,_);if(T){if(T===g)continue;return T}}if(_.method==="next")_.sent=_._sent=_.arg;else if(_.method==="throw"){if(O===h)throw O=b,_.arg;_.dispatchException(_.arg)}else _.method==="return"&&_.abrupt("return",_.arg);O=m;var N=f(E,v,_);if(N.type==="normal"){if(O=_.done?b:d,N.arg===g)continue;return{value:N.arg,done:_.done}}N.type==="throw"&&(O=b,_.method="throw",_.arg=N.arg)}}}function R(E,v){var _=v.method,O=E.iterator[_];if(O===t)return v.delegate=null,_==="throw"&&E.iterator.return&&(v.method="return",v.arg=t,R(E,v),v.method==="throw")||_!=="return"&&(v.method="throw",v.arg=new TypeError("The iterator does not provide a '"+_+"' method")),g;var j=f(O,E.iterator,v.arg);if(j.type==="throw")return v.method="throw",v.arg=j.arg,v.delegate=null,g;var P=j.arg;return P?P.done?(v[E.resultName]=P.value,v.next=E.nextLoc,v.method!=="return"&&(v.method="next",v.arg=t),v.delegate=null,g):P:(v.method="throw",v.arg=new TypeError("iterator result is not an object"),v.delegate=null,g)}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 M(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 _=-1,O=function j(){for(;++_<E.length;)if(n.call(E,_))return j.value=E[_],j.done=!1,j;return j.value=t,j.done=!0,j};return O.next=O}}throw new TypeError(Mi(E)+" is not iterable")}return x.prototype=D,i(F,"constructor",{value:D,configurable:!0}),i(D,"constructor",{value:x,configurable:!0}),x.displayName=c(D,u,"GeneratorFunction"),e.isGeneratorFunction=function(E){var v=typeof E=="function"&&E.constructor;return!!v&&(v===x||(v.displayName||v.name)==="GeneratorFunction")},e.mark=function(E){return Object.setPrototypeOf?Object.setPrototypeOf(E,D):(E.__proto__=D,c(E,u,"GeneratorFunction")),E.prototype=Object.create(F),E},e.awrap=function(E){return{__await:E}},L(S.prototype),c(S.prototype,a,function(){return this}),e.AsyncIterator=S,e.async=function(E,v,_,O,j){j===void 0&&(j=Promise);var P=new S(l(E,v,_,O),j);return e.isGeneratorFunction(v)?P:P.next().then(function(U){return U.done?U.value:P.next()})},L(F),c(F,u,"Generator"),c(F,s,function(){return this}),c(F,"toString",function(){return"[object Generator]"}),e.keys=function(E){var v=Object(E),_=[];for(var O in v)_.push(O);return _.reverse(),function j(){for(;_.length;){var P=_.pop();if(P in v)return j.value=P,j.done=!1,j}return j.done=!0,j}},e.values=M,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 _ in this)_.charAt(0)==="t"&&n.call(this,_)&&!isNaN(+_.slice(1))&&(this[_]=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 _=this;function O(oe,se){return U.type="throw",U.arg=v,_.next=oe,se&&(_.method="next",_.arg=t),!!se}for(var j=this.tryEntries.length-1;j>=0;--j){var P=this.tryEntries[j],U=P.completion;if(P.tryLoc==="root")return O("end");if(P.tryLoc<=this.prev){var T=n.call(P,"catchLoc"),N=n.call(P,"finallyLoc");if(T&&N){if(this.prev<P.catchLoc)return O(P.catchLoc,!0);if(this.prev<P.finallyLoc)return O(P.finallyLoc)}else if(T){if(this.prev<P.catchLoc)return O(P.catchLoc,!0)}else{if(!N)throw Error("try statement without catch or finally");if(this.prev<P.finallyLoc)return O(P.finallyLoc)}}}},abrupt:function(v,_){for(var O=this.tryEntries.length-1;O>=0;--O){var j=this.tryEntries[O];if(j.tryLoc<=this.prev&&n.call(j,"finallyLoc")&&this.prev<j.finallyLoc){var P=j;break}}P&&(v==="break"||v==="continue")&&P.tryLoc<=_&&_<=P.finallyLoc&&(P=null);var U=P?P.completion:{};return U.type=v,U.arg=_,P?(this.method="next",this.next=P.finallyLoc,g):this.complete(U)},complete:function(v,_){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"&&_&&(this.next=_),g},finish:function(v){for(var _=this.tryEntries.length-1;_>=0;--_){var O=this.tryEntries[_];if(O.finallyLoc===v)return this.complete(O.completion,O.afterLoc),q(O),g}},catch:function(v){for(var _=this.tryEntries.length-1;_>=0;--_){var O=this.tryEntries[_];if(O.tryLoc===v){var j=O.completion;if(j.type==="throw"){var P=j.arg;q(O)}return P}}throw Error("illegal catch attempt")},delegateYield:function(v,_,O){return this.delegate={iterator:M(v),resultName:_,nextLoc:O},this.method==="next"&&(this.arg=t),g}},e}function b7(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function d1(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,_7(n.key),n)}}function w7(t,e,r){return e&&d1(t.prototype,e),r&&d1(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function _7(t){var e=E7(t,"string");return Mi(e)=="symbol"?e:e+""}function E7(t,e){if(Mi(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Mi(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function h1(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(c){r(c);return}a.done?e(u):Promise.resolve(u).then(n,i)}function p1(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function s(u){h1(o,n,i,s,a,"next",u)}function a(u){h1(o,n,i,s,a,"throw",u)}s(void 0)})}}function C7(t,e){return ay.apply(this,arguments)}function ay(){return ay=p1(Ou().mark(function t(e,r){return Ou().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return i.abrupt("return",new Promise(function(o,s){var a=function(l){e.off("readable",u),s(l)},u=function c(){var l=e.read(r);l!==null&&(e.off("error",a),e.off("readable",c),o(l))};e.once("error",a),e.on("readable",u)}));case 1:case"end":return i.stop()}},t)})),ay.apply(this,arguments)}var pde=hf.default=function(){function t(e){var r=this;b7(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 w7(t,[{key:"slice",value:function(){var e=p1(Ou().mark(function n(i,o){var s,a,u,c,l;return Ou().wrap(function(h){for(;;)switch(h.prev=h.next){case 0:if(!(i<this._bufPos)){h.next=2;break}throw new Error("cannot slice from position which we already seeked away");case 2:if(!(i>this._bufPos+this._buf.length)){h.next=4;break}throw new Error("slice start is outside of buffer (currently not implemented)");case 4:if(!this._error){h.next=6;break}throw this._error;case 6:if(i<this._bufPos+this._buf.length?(a=i-this._bufPos,u=Math.min(this._buf.length,o-this._bufPos),s=this._buf.slice(a,u)):s=Buffer.alloc(0),!this._ended){h.next=10;break}return s.size=s.length,h.abrupt("return",{value:s,done:!0});case 10:if(c=o-i,!(c>s.length)){h.next=16;break}return h.next=14,C7(this._stream,c-s.length);case 14:l=h.sent,s=Buffer.concat([s,l]);case 16:return this._buf=s,this._bufPos=i,s.size=s.length,h.abrupt("return",{value:s,done:this._ended});case 20:case"end":return h.stop()}},n,this)}));function r(n,i){return e.apply(this,arguments)}return r}()},{key:"close",value:function(){this._stream.destroy()}}])}()});var g1=y(mf=>{"use strict";Object.defineProperty(mf,"__esModule",{value:!0});mf.default=void 0;var S7=require("fs"),x7=pf(o1()),F7=pf(a1()),O7=pf(f1()),A7=pf(uy());function pf(t){return t&&t.__esModule?t:{default:t}}function Au(t){"@babel/helpers - typeof";return Au=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},Au(t)}function k7(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function m1(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,P7(n.key),n)}}function T7(t,e,r){return e&&m1(t.prototype,e),r&&m1(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function P7(t){var e=R7(t,"string");return Au(e)=="symbol"?e:e+""}function R7(t,e){if(Au(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Au(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var gde=mf.default=function(){function t(){k7(this,t)}return T7(t,[{key:"openFile",value:function(r,n){return Buffer.isBuffer(r)?Promise.resolve(new F7.default(r)):r instanceof S7.ReadStream&&r.path!=null?(0,O7.default)(r):x7.default.readable(r)?(n=Number(n),Number.isFinite(n)?Promise.resolve(new A7.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 b1=y(cy=>{"use strict";Object.defineProperty(cy,"__esModule",{value:!0});cy.default=j7;var $7=require("crypto"),y1=v1(require("fs")),I7=v1(require("path"));function D1(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,r=new WeakMap;return(D1=function(n){return n?r:e})(t)}function v1(t,e){if(!e&&t&&t.__esModule)return t;if(t===null||typeof t!="object"&&typeof t!="function")return{default:t};var r=D1(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 j7(t,e){if(Buffer.isBuffer(t)){var r=65536,n=t.slice(0,Math.min(r,t.length)),i=(0,$7.createHash)("md5").update(n).digest("hex"),o=["node-buffer",i,t.length,e.endpoint].join("-");return Promise.resolve(o)}return t instanceof y1.ReadStream&&t.path!=null?new Promise(function(s,a){var u=I7.resolve(t.path);y1.stat(t.path,function(c,l){if(c){a(c);return}var f=["node-file",u,l.size,l.mtime.getTime(),e.endpoint].join("-");s(f)})}):Promise.resolve(null)}});var S1=y((vde,C1)=>{var E1="Expected a function",w1=NaN,N7="[object Symbol]",L7=/^\s+|\s+$/g,B7=/^[-+]0x[0-9a-f]+$/i,q7=/^0b[01]+$/i,M7=/^0o[0-7]+$/i,U7=parseInt,V7=typeof global=="object"&&global&&global.Object===Object&&global,H7=typeof self=="object"&&self&&self.Object===Object&&self,z7=V7||H7||Function("return this")(),G7=Object.prototype,W7=G7.toString,K7=Math.max,Y7=Math.min,ly=function(){return z7.Date.now()};function J7(t,e,r){var n,i,o,s,a,u,c=0,l=!1,f=!1,h=!0;if(typeof t!="function")throw new TypeError(E1);e=_1(e)||0,gf(r)&&(l=!!r.leading,f="maxWait"in r,o=f?K7(_1(r.maxWait)||0,e):o,h="trailing"in r?!!r.trailing:h);function d($){var F=n,L=i;return n=i=void 0,c=$,s=t.apply(L,F),s}function m($){return c=$,a=setTimeout(w,e),l?d($):s}function b($){var F=$-u,L=$-c,S=e-F;return f?Y7(S,o-L):S}function g($){var F=$-u,L=$-c;return u===void 0||F>=e||F<0||f&&L>=o}function w(){var $=ly();if(g($))return x($);a=setTimeout(w,b($))}function x($){return a=void 0,h&&n?d($):(n=i=void 0,s)}function D(){a!==void 0&&clearTimeout(a),c=0,n=u=i=a=void 0}function C(){return a===void 0?s:x(ly())}function k(){var $=ly(),F=g($);if(n=arguments,i=this,u=$,F){if(a===void 0)return m(u);if(f)return a=setTimeout(w,e),d(u)}return a===void 0&&(a=setTimeout(w,e)),s}return k.cancel=D,k.flush=C,k}function X7(t,e,r){var n=!0,i=!0;if(typeof t!="function")throw new TypeError(E1);return gf(r)&&(n="leading"in r?!!r.leading:n,i="trailing"in r?!!r.trailing:i),J7(t,e,{leading:n,maxWait:e,trailing:i})}function gf(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function Z7(t){return!!t&&typeof t=="object"}function Q7(t){return typeof t=="symbol"||Z7(t)&&W7.call(t)==N7}function _1(t){if(typeof t=="number")return t;if(Q7(t))return w1;if(gf(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=gf(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=t.replace(L7,"");var r=q7.test(t);return r||M7.test(t)?U7(t.slice(2),r?2:8):B7.test(t)?w1:+t}C1.exports=X7});var $1=y(bf=>{"use strict";Object.defineProperty(bf,"__esModule",{value:!0});bf.default=void 0;var eV=T1(require("http")),tV=T1(require("https")),O1=require("stream"),rV=require("url"),A1=nV(S1());function nV(t){return t&&t.__esModule?t:{default:t}}function k1(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,r=new WeakMap;return(k1=function(n){return n?r:e})(t)}function T1(t,e){if(!e&&t&&t.__esModule)return t;if(t===null||typeof t!="object"&&typeof t!="function")return{default:t};var r=k1(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 iV(t,e,r){return e=yf(e),oV(t,P1()?Reflect.construct(e,r||[],yf(t).constructor):e.apply(t,r))}function oV(t,e){if(e&&(ds(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return sV(t)}function sV(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function P1(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(P1=function(){return!!t})()}function yf(t){return yf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},yf(t)}function aV(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&&fy(t,e)}function fy(t,e){return fy=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},fy(t,e)}function x1(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 ku(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?x1(Object(r),!0).forEach(function(n){uV(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):x1(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function uV(t,e,r){return e=R1(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ds(t){"@babel/helpers - typeof";return ds=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},ds(t)}function Df(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function F1(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,R1(n.key),n)}}function vf(t,e,r){return e&&F1(t.prototype,e),r&&F1(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function R1(t){var e=cV(t,"string");return ds(e)=="symbol"?e:e+""}function cV(t,e){if(ds(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(ds(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var bde=bf.default=function(){function t(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Df(this,t),this._requestOptions=e}return vf(t,[{key:"createRequest",value:function(r,n){return new lV(r,n,this._requestOptions)}},{key:"getName",value:function(){return"NodeHttpStack"}}])}(),lV=function(){function t(e,r,n){Df(this,t),this._method=e,this._url=r,this._headers={},this._request=null,this._progressHandler=function(){},this._requestOptions=n||{}}return vf(t,[{key:"getMethod",value:function(){return this._method}},{key:"getURL",value:function(){return this._url}},{key:"setHeader",value:function(r,n){this._headers[r]=n}},{key:"getHeader",value:function(r){return this._headers[r]}},{key:"setProgressHandler",value:function(r){this._progressHandler=r}},{key:"send",value:function(){var r=this,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return new Promise(function(i,o){var s=ku(ku(ku({},(0,rV.parse)(r._url)),r._requestOptions),{},{method:r._method,headers:ku(ku({},r._requestOptions.headers||{}),r._headers)});n!=null&&n.size&&(s.headers["Content-Length"]=n.size);var a=s.protocol==="https:"?tV:eV;r._request=a.request(s);var u=r._request;u.on("response",function(c){var l=[];c.on("data",function(f){l.push(f)}),c.on("end",function(){var f=Buffer.concat(l).toString("utf8");i(new fV(c,f))})}),u.on("error",function(c){o(c)}),n instanceof O1.Readable?n.pipe(new dV(r._progressHandler)).pipe(u):n instanceof Uint8Array?hV(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}}])}(),fV=function(){function t(e,r){Df(this,t),this._response=e,this._body=r}return vf(t,[{key:"getStatus",value:function(){return this._response.statusCode}},{key:"getHeader",value:function(r){return this._response.headers[r.toLowerCase()]}},{key:"getBody",value:function(){return this._body}},{key:"getUnderlyingObject",value:function(){return this._response}}])}(),dV=function(t){function e(r){var n;return Df(this,e),n=iV(this,e),n._onprogress=(0,A1.default)(r,100,{leading:!0,trailing:!1}),n._position=0,n}return aV(e,t),vf(e,[{key:"_transform",value:function(n,i,o){this._position+=n.length,this._onprogress(this._position),o(null,n)}}])}(O1.Transform),hV=function(e,r,n){n=(0,A1.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 I1=y(dy=>{"use strict";dy.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};dy.root=function(t,e,r){var n=this,i,o={stackLength:Error.stackTraceLimit,rootOnly:!0},s="",a=Error.stackTraceLimit,u;function c(){u[0]=n.toString(),n.stack=u.join(`
30
+ `,e=e.substr(s)}try{o=JSON.parse(e)}catch{return zr.red("Error:")+" Not valid JSON!"}return i+=Eu.render(o,r,n),i}});var Gg=y(of=>{"use strict";Object.defineProperty(of,"__esModule",{value:!0});of.default=void 0;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 ES(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,b9(n.key),n)}}function v9(t,e,r){return e&&ES(t.prototype,e),r&&ES(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function b9(t){var e=w9(t,"string");return cs(e)=="symbol"?e:e+""}function w9(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)}function _9(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function E9(t,e,r){return e=Su(e),C9(t,zg()?Reflect.construct(e,r||[],Su(t).constructor):e.apply(t,r))}function C9(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 S9(t)}function S9(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function x9(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&&Cu(t,e)}function Hg(t){var e=typeof Map=="function"?new Map:void 0;return Hg=function(n){if(n===null||!O9(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 F9(n,arguments,Su(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),Cu(i,n)},Hg(t)}function F9(t,e,r){if(zg())return Reflect.construct.apply(null,arguments);var n=[null];n.push.apply(n,e);var i=new(t.bind.apply(t,n));return r&&Cu(i,r.prototype),i}function zg(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(zg=function(){return!!t})()}function O9(t){try{return Function.toString.call(t).indexOf("[native code]")!==-1}catch{return typeof t=="function"}}function Cu(t,e){return Cu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Cu(t,e)}function Su(t){return Su=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Su(t)}var A9=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(_9(this,e),n=E9(this,e,[r]),n.originalRequest=o,n.originalResponse=s,n.causingError=i,i!=null&&(r+=", caused by ".concat(i.toString())),o!=null){var a=o.getHeader("X-Request-ID")||"n/a",u=o.getMethod(),c=o.getURL(),l=s?s.getStatus():"n/a",f=s?s.getBody()||"":"n/a";r+=", originated from request (method: ".concat(u,", url: ").concat(c,", response code: ").concat(l,", response text: ").concat(f,", request id: ").concat(a,")")}return n.message=r,n}return x9(e,t),v9(e)}(Hg(Error)),Qfe=of.default=A9});var Wg=y(sf=>{"use strict";Object.defineProperty(sf,"__esModule",{value:!0});sf.enableDebugLog=k9;sf.log=T9;var CS=!1;function k9(){CS=!0}function T9(t){CS&&console.log(t)}});var xS=y(af=>{"use strict";Object.defineProperty(af,"__esModule",{value:!0});af.default=void 0;function xu(t){"@babel/helpers - typeof";return xu=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},xu(t)}function P9(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,$9(n.key),n)}}function R9(t,e,r){return e&&SS(t.prototype,e),r&&SS(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function $9(t){var e=I9(t,"string");return xu(e)=="symbol"?e:e+""}function I9(t,e){if(xu(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(xu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var rde=af.default=function(){function t(){P9(this,t)}return R9(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 FS=y((Kg,Yg)=>{(function(t,e){typeof Kg=="object"&&typeof Yg<"u"?Yg.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:Kg,function(){"use strict";var t="3.7.7",e=t,r=typeof Buffer=="function",n=typeof TextDecoder=="function"?new TextDecoder:void 0,i=typeof TextEncoder=="function"?new TextEncoder:void 0,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",s=Array.prototype.slice.call(o),a=function(T){var N={};return T.forEach(function(oe,se){return N[oe]=se}),N}(s),u=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,c=String.fromCharCode.bind(String),l=typeof Uint8Array.from=="function"?Uint8Array.from.bind(Uint8Array):function(T){return new Uint8Array(Array.prototype.slice.call(T,0))},f=function(T){return T.replace(/=/g,"").replace(/[+\/]/g,function(N){return N=="+"?"-":"_"})},h=function(T){return T.replace(/[^A-Za-z0-9\+\/]/g,"")},d=function(T){for(var N,oe,se,De,pn="",vp=T.length%3,tl=0;tl<T.length;){if((oe=T.charCodeAt(tl++))>255||(se=T.charCodeAt(tl++))>255||(De=T.charCodeAt(tl++))>255)throw new TypeError("invalid character found");N=oe<<16|se<<8|De,pn+=s[N>>18&63]+s[N>>12&63]+s[N>>6&63]+s[N&63]}return vp?pn.slice(0,vp-3)+"===".substring(vp):pn},m=typeof btoa=="function"?function(T){return btoa(T)}:r?function(T){return Buffer.from(T,"binary").toString("base64")}:d,b=r?function(T){return Buffer.from(T).toString("base64")}:function(T){for(var N=4096,oe=[],se=0,De=T.length;se<De;se+=N)oe.push(c.apply(null,T.subarray(se,se+N)));return m(oe.join(""))},g=function(T,N){return N===void 0&&(N=!1),N?f(b(T)):b(T)},w=function(T){if(T.length<2){var N=T.charCodeAt(0);return N<128?T:N<2048?c(192|N>>>6)+c(128|N&63):c(224|N>>>12&15)+c(128|N>>>6&63)+c(128|N&63)}else{var N=65536+(T.charCodeAt(0)-55296)*1024+(T.charCodeAt(1)-56320);return c(240|N>>>18&7)+c(128|N>>>12&63)+c(128|N>>>6&63)+c(128|N&63)}},x=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,D=function(T){return T.replace(x,w)},C=r?function(T){return Buffer.from(T,"utf8").toString("base64")}:i?function(T){return b(i.encode(T))}:function(T){return m(D(T))},k=function(T,N){return N===void 0&&(N=!1),N?f(C(T)):C(T)},$=function(T){return k(T,!0)},F=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,L=function(T){switch(T.length){case 4:var N=(7&T.charCodeAt(0))<<18|(63&T.charCodeAt(1))<<12|(63&T.charCodeAt(2))<<6|63&T.charCodeAt(3),oe=N-65536;return c((oe>>>10)+55296)+c((oe&1023)+56320);case 3:return c((15&T.charCodeAt(0))<<12|(63&T.charCodeAt(1))<<6|63&T.charCodeAt(2));default:return c((31&T.charCodeAt(0))<<6|63&T.charCodeAt(1))}},S=function(T){return T.replace(F,L)},I=function(T){if(T=T.replace(/\s+/g,""),!u.test(T))throw new TypeError("malformed base64.");T+="==".slice(2-(T.length&3));for(var N,oe="",se,De,pn=0;pn<T.length;)N=a[T.charAt(pn++)]<<18|a[T.charAt(pn++)]<<12|(se=a[T.charAt(pn++)])<<6|(De=a[T.charAt(pn++)]),oe+=se===64?c(N>>16&255):De===64?c(N>>16&255,N>>8&255):c(N>>16&255,N>>8&255,N&255);return oe},R=typeof atob=="function"?function(T){return atob(h(T))}:r?function(T){return Buffer.from(T,"base64").toString("binary")}:I,B=r?function(T){return l(Buffer.from(T,"base64"))}:function(T){return l(R(T).split("").map(function(N){return N.charCodeAt(0)}))},q=function(T){return B(M(T))},K=r?function(T){return Buffer.from(T,"base64").toString("utf8")}:n?function(T){return n.decode(B(T))}:function(T){return S(R(T))},M=function(T){return h(T.replace(/[-_]/g,function(N){return N=="-"?"+":"/"}))},E=function(T){return K(M(T))},v=function(T){if(typeof T!="string")return!1;var N=T.replace(/\s+/g,"").replace(/={0,2}$/,"");return!/[^\s0-9a-zA-Z\+/]/.test(N)||!/[^\s0-9a-zA-Z\-_]/.test(N)},_=function(T){return{value:T,enumerable:!1,writable:!0,configurable:!0}},O=function(){var T=function(N,oe){return Object.defineProperty(String.prototype,N,_(oe))};T("fromBase64",function(){return E(this)}),T("toBase64",function(N){return k(this,N)}),T("toBase64URI",function(){return k(this,!0)}),T("toBase64URL",function(){return k(this,!0)}),T("toUint8Array",function(){return q(this)})},j=function(){var T=function(N,oe){return Object.defineProperty(Uint8Array.prototype,N,_(oe))};T("toBase64",function(N){return g(this,N)}),T("toBase64URI",function(){return g(this,!0)}),T("toBase64URL",function(){return g(this,!0)})},P=function(){O(),j()},U={version:t,VERSION:e,atob:R,atobPolyfill:I,btoa:m,btoaPolyfill:d,fromBase64:E,toBase64:k,encode:k,encodeURI:$,encodeURL:$,utob:D,btou:S,decode:E,isValid:v,fromUint8Array:g,toUint8Array:q,extendString:O,extendUint8Array:j,extendBuiltins:P};return U.Base64={},Object.keys(U).forEach(function(T){return U.Base64[T]=U[T]}),U})});var AS=y((ide,OS)=>{"use strict";OS.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 PS=y(Jg=>{"use strict";var j9=Object.prototype.hasOwnProperty,N9;function kS(t){try{return decodeURIComponent(t.replace(/\+/g," "))}catch{return null}}function TS(t){try{return encodeURIComponent(t)}catch{return null}}function L9(t){for(var e=/([^=?#&]+)=?([^&]*)/g,r={},n;n=e.exec(t);){var i=kS(n[1]),o=kS(n[2]);i===null||o===null||i in r||(r[i]=o)}return r}function B9(t,e){e=e||"";var r=[],n,i;typeof e!="string"&&(e="?");for(i in t)if(j9.call(t,i)){if(n=t[i],!n&&(n===null||n===N9||isNaN(n))&&(n=""),i=TS(i),n=TS(n),i===null||n===null)continue;r.push(i+"="+n)}return r.length?e+r.join("&"):""}Jg.stringify=B9;Jg.parse=L9});var qS=y((sde,BS)=>{"use strict";var $S=AS(),uf=PS(),q9=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,IS=/[\n\r\t]/g,M9=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,jS=/:\d+$/,U9=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i,V9=/^[a-zA-Z]:/;function Zg(t){return(t||"").toString().replace(q9,"")}var Xg=[["#","hash"],["?","query"],function(e,r){return Gr(r.protocol)?e.replace(/\\/g,"/"):e},["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d*)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],RS={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 Wr(unescape(t.pathname),{});else if(i==="string"){n=new Wr(t,{});for(o in RS)delete n[o]}else if(i==="object"){for(o in t)o in RS||(n[o]=t[o]);n.slashes===void 0&&(n.slashes=M9.test(t.href))}return n}function Gr(t){return t==="file:"||t==="ftp:"||t==="http:"||t==="https:"||t==="ws:"||t==="wss:"}function LS(t,e){t=Zg(t),t=t.replace(IS,""),e=e||{};var r=U9.exec(t),n=r[1]?r[1].toLowerCase():"",i=!!r[2],o=!!r[3],s=0,a;return i?o?(a=r[2]+r[3]+r[4],s=r[2].length+r[3].length):(a=r[2]+r[4],s=r[2].length):o?(a=r[3]+r[4],s=r[3].length):a=r[4],n==="file:"?s>=2&&(a=a.slice(2)):Gr(n)?a=r[4]:n?i&&(a=a.slice(2)):s>=2&&Gr(e.protocol)&&(a=r[4]),{protocol:n,slashes:i||Gr(n),slashesCount:s,rest:a}}function H9(t,e){if(t==="")return e;for(var r=(e||"/").split("/").slice(0,-1).concat(t.split("/")),n=r.length,i=r[n-1],o=!1,s=0;n--;)r[n]==="."?r.splice(n,1):r[n]===".."?(r.splice(n,1),s++):s&&(n===0&&(o=!0),r.splice(n,1),s--);return o&&r.unshift(""),(i==="."||i==="..")&&r.push(""),r.join("/")}function Wr(t,e,r){if(t=Zg(t),t=t.replace(IS,""),!(this instanceof Wr))return new Wr(t,e,r);var n,i,o,s,a,u,c=Xg.slice(),l=typeof e,f=this,h=0;for(l!=="object"&&l!=="string"&&(r=e,e=null),r&&typeof r!="function"&&(r=uf.parse),e=NS(e),i=LS(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||V9.test(t))||!i.slashes&&(i.protocol||i.slashesCount<2||!Gr(f.protocol)))&&(c[3]=[/(.*)/,"pathname"]);h<c.length;h++){if(s=c[h],typeof s=="function"){t=s(t,f);continue}o=s[0],u=s[1],o!==o?f[u]=t:typeof o=="string"?(a=o==="@"?t.lastIndexOf(o):t.indexOf(o),~a&&(typeof s[2]=="number"?(f[u]=t.slice(0,a),t=t.slice(a+s[2])):(f[u]=t.slice(a),t=t.slice(0,a)))):(a=o.exec(t))&&(f[u]=a[1],t=t.slice(0,a.index)),f[u]=f[u]||n&&s[3]&&e[u]||"",s[4]&&(f[u]=f[u].toLowerCase())}r&&(f.query=r(f.query)),n&&e.slashes&&f.pathname.charAt(0)!=="/"&&(f.pathname!==""||e.pathname!=="")&&(f.pathname=H9(f.pathname,e.pathname)),f.pathname.charAt(0)!=="/"&&Gr(f.protocol)&&(f.pathname="/"+f.pathname),$S(f.port,f.protocol)||(f.host=f.hostname,f.port=""),f.username=f.password="",f.auth&&(a=f.auth.indexOf(":"),~a?(f.username=f.auth.slice(0,a),f.username=encodeURIComponent(decodeURIComponent(f.username)),f.password=f.auth.slice(a+1),f.password=encodeURIComponent(decodeURIComponent(f.password))):f.username=encodeURIComponent(decodeURIComponent(f.auth)),f.auth=f.password?f.username+":"+f.password:f.username),f.origin=f.protocol!=="file:"&&Gr(f.protocol)&&f.host?f.protocol+"//"+f.host:"null",f.href=f.toString()}function z9(t,e,r){var n=this;switch(t){case"query":typeof e=="string"&&e.length&&(e=(r||uf.parse)(e)),n[t]=e;break;case"port":n[t]=e,$S(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,jS.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<Xg.length;s++){var a=Xg[s];a[4]&&(n[a[1]]=n[a[1]].toLowerCase())}return n.auth=n.password?n.username+":"+n.password:n.username,n.origin=n.protocol!=="file:"&&Gr(n.protocol)&&n.host?n.protocol+"//"+n.host:"null",n.href=n.toString(),n}function G9(t){(!t||typeof t!="function")&&(t=uf.stringify);var e,r=this,n=r.host,i=r.protocol;i&&i.charAt(i.length-1)!==":"&&(i+=":");var o=i+(r.protocol&&r.slashes||Gr(r.protocol)?"//":"");return r.username?(o+=r.username,r.password&&(o+=":"+r.password),o+="@"):r.password?(o+=":"+r.password,o+="@"):r.protocol!=="file:"&&Gr(r.protocol)&&!n&&r.pathname!=="/"&&(o+="@"),(n[n.length-1]===":"||jS.test(r.hostname)&&!r.port)&&(n+=":"),o+=n+r.pathname,e=typeof r.query=="object"?t(r.query):r.query,e&&(o+=e.charAt(0)!=="?"?"?"+e:e),r.hash&&(o+=r.hash),o}Wr.prototype={set:z9,toString:G9};Wr.extractProtocol=LS;Wr.location=NS;Wr.trimLeft=Zg;Wr.qs=uf;BS.exports=Wr});var MS=y(Qg=>{"use strict";Object.defineProperty(Qg,"__esModule",{value:!0});Qg.default=W9;function W9(){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 r1=y(ff=>{"use strict";Object.defineProperty(ff,"__esModule",{value:!0});ff.default=void 0;var K9=FS(),Y9=ny(qS()),cf=ny(Gg()),Li=Wg(),J9=ny(MS());function ny(t){return t&&t.__esModule?t:{default:t}}function ey(){"use strict";ey=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(E,v,_){E[v]=_.value},o=typeof Symbol=="function"?Symbol:{},s=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function c(E,v,_){return Object.defineProperty(E,v,{value:_,enumerable:!0,configurable:!0,writable:!0}),E[v]}try{c({},"")}catch{c=function(_,O,j){return _[O]=j}}function l(E,v,_,O){var j=v&&v.prototype instanceof w?v:w,P=Object.create(j.prototype),U=new K(O||[]);return i(P,"_invoke",{value:I(E,_,U)}),P}function f(E,v,_){try{return{type:"normal",arg:E.call(v,_)}}catch(O){return{type:"throw",arg:O}}}e.wrap=l;var h="suspendedStart",d="suspendedYield",m="executing",b="completed",g={};function w(){}function x(){}function D(){}var C={};c(C,s,function(){return this});var k=Object.getPrototypeOf,$=k&&k(k(M([])));$&&$!==r&&n.call($,s)&&(C=$);var F=D.prototype=w.prototype=Object.create(C);function L(E){["next","throw","return"].forEach(function(v){c(E,v,function(_){return this._invoke(v,_)})})}function S(E,v){function _(j,P,U,T){var N=f(E[j],E,P);if(N.type!=="throw"){var oe=N.arg,se=oe.value;return se&&Bi(se)=="object"&&n.call(se,"__await")?v.resolve(se.__await).then(function(De){_("next",De,U,T)},function(De){_("throw",De,U,T)}):v.resolve(se).then(function(De){oe.value=De,U(oe)},function(De){return _("throw",De,U,T)})}T(N.arg)}var O;i(this,"_invoke",{value:function(P,U){function T(){return new v(function(N,oe){_(P,U,N,oe)})}return O=O?O.then(T,T):T()}})}function I(E,v,_){var O=h;return function(j,P){if(O===m)throw Error("Generator is already running");if(O===b){if(j==="throw")throw P;return{value:t,done:!0}}for(_.method=j,_.arg=P;;){var U=_.delegate;if(U){var T=R(U,_);if(T){if(T===g)continue;return T}}if(_.method==="next")_.sent=_._sent=_.arg;else if(_.method==="throw"){if(O===h)throw O=b,_.arg;_.dispatchException(_.arg)}else _.method==="return"&&_.abrupt("return",_.arg);O=m;var N=f(E,v,_);if(N.type==="normal"){if(O=_.done?b:d,N.arg===g)continue;return{value:N.arg,done:_.done}}N.type==="throw"&&(O=b,_.method="throw",_.arg=N.arg)}}}function R(E,v){var _=v.method,O=E.iterator[_];if(O===t)return v.delegate=null,_==="throw"&&E.iterator.return&&(v.method="return",v.arg=t,R(E,v),v.method==="throw")||_!=="return"&&(v.method="throw",v.arg=new TypeError("The iterator does not provide a '"+_+"' method")),g;var j=f(O,E.iterator,v.arg);if(j.type==="throw")return v.method="throw",v.arg=j.arg,v.delegate=null,g;var P=j.arg;return P?P.done?(v[E.resultName]=P.value,v.next=E.nextLoc,v.method!=="return"&&(v.method="next",v.arg=t),v.delegate=null,g):P:(v.method="throw",v.arg=new TypeError("iterator result is not an object"),v.delegate=null,g)}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 M(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 _=-1,O=function j(){for(;++_<E.length;)if(n.call(E,_))return j.value=E[_],j.done=!1,j;return j.value=t,j.done=!0,j};return O.next=O}}throw new TypeError(Bi(E)+" is not iterable")}return x.prototype=D,i(F,"constructor",{value:D,configurable:!0}),i(D,"constructor",{value:x,configurable:!0}),x.displayName=c(D,u,"GeneratorFunction"),e.isGeneratorFunction=function(E){var v=typeof E=="function"&&E.constructor;return!!v&&(v===x||(v.displayName||v.name)==="GeneratorFunction")},e.mark=function(E){return Object.setPrototypeOf?Object.setPrototypeOf(E,D):(E.__proto__=D,c(E,u,"GeneratorFunction")),E.prototype=Object.create(F),E},e.awrap=function(E){return{__await:E}},L(S.prototype),c(S.prototype,a,function(){return this}),e.AsyncIterator=S,e.async=function(E,v,_,O,j){j===void 0&&(j=Promise);var P=new S(l(E,v,_,O),j);return e.isGeneratorFunction(v)?P:P.next().then(function(U){return U.done?U.value:P.next()})},L(F),c(F,u,"Generator"),c(F,s,function(){return this}),c(F,"toString",function(){return"[object Generator]"}),e.keys=function(E){var v=Object(E),_=[];for(var O in v)_.push(O);return _.reverse(),function j(){for(;_.length;){var P=_.pop();if(P in v)return j.value=P,j.done=!1,j}return j.done=!0,j}},e.values=M,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 _ in this)_.charAt(0)==="t"&&n.call(this,_)&&!isNaN(+_.slice(1))&&(this[_]=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 _=this;function O(oe,se){return U.type="throw",U.arg=v,_.next=oe,se&&(_.method="next",_.arg=t),!!se}for(var j=this.tryEntries.length-1;j>=0;--j){var P=this.tryEntries[j],U=P.completion;if(P.tryLoc==="root")return O("end");if(P.tryLoc<=this.prev){var T=n.call(P,"catchLoc"),N=n.call(P,"finallyLoc");if(T&&N){if(this.prev<P.catchLoc)return O(P.catchLoc,!0);if(this.prev<P.finallyLoc)return O(P.finallyLoc)}else if(T){if(this.prev<P.catchLoc)return O(P.catchLoc,!0)}else{if(!N)throw Error("try statement without catch or finally");if(this.prev<P.finallyLoc)return O(P.finallyLoc)}}}},abrupt:function(v,_){for(var O=this.tryEntries.length-1;O>=0;--O){var j=this.tryEntries[O];if(j.tryLoc<=this.prev&&n.call(j,"finallyLoc")&&this.prev<j.finallyLoc){var P=j;break}}P&&(v==="break"||v==="continue")&&P.tryLoc<=_&&_<=P.finallyLoc&&(P=null);var U=P?P.completion:{};return U.type=v,U.arg=_,P?(this.method="next",this.next=P.finallyLoc,g):this.complete(U)},complete:function(v,_){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"&&_&&(this.next=_),g},finish:function(v){for(var _=this.tryEntries.length-1;_>=0;--_){var O=this.tryEntries[_];if(O.finallyLoc===v)return this.complete(O.completion,O.afterLoc),q(O),g}},catch:function(v){for(var _=this.tryEntries.length-1;_>=0;--_){var O=this.tryEntries[_];if(O.tryLoc===v){var j=O.completion;if(j.type==="throw"){var P=j.arg;q(O)}return P}}throw Error("illegal catch attempt")},delegateYield:function(v,_,O){return this.delegate={iterator:M(v),resultName:_,nextLoc:O},this.method==="next"&&(this.arg=t),g}},e}function US(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(c){r(c);return}a.done?e(u):Promise.resolve(u).then(n,i)}function X9(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 XS(t,e){return e7(t)||Q9(t,e)||ZS(t,e)||Z9()}function Z9(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
31
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Q9(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,o,s,a=[],u=!0,c=!1;try{if(o=(r=r.call(t)).next,e===0){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=o.call(r)).done)&&(a.push(n.value),a.length!==e);u=!0);}catch(l){c=!0,i=l}finally{try{if(!u&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(c)throw i}}return a}}function e7(t){if(Array.isArray(t))return t}function Bi(t){"@babel/helpers - typeof";return Bi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Bi(t)}function t7(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=ZS(t))||e&&t&&typeof t.length=="number"){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(c){throw c},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
32
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,s=!1,a;return{s:function(){r=r.call(t)},n:function(){var c=r.next();return o=c.done,c},e:function(c){s=!0,a=c},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(s)throw a}}}}function ZS(t,e){if(t){if(typeof t=="string")return VS(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 VS(t,e)}}function VS(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 HS(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 ls(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?HS(Object(r),!0).forEach(function(n){r7(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):HS(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function r7(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 n7(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function zS(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 i7(t,e,r){return e&&zS(t.prototype,e),r&&zS(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function QS(t){var e=o7(t,"string");return Bi(e)=="symbol"?e:e+""}function o7(t,e){if(Bi(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Bi(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var ty="tus-v1",lf="ietf-draft-03",s7={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:t1,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:ty},e1=function(){function t(e,r){n7(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 i7(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(![ty,lf].includes(this.options.protocol)){this._emitError(new Error("tus: unsupported protocol ".concat(this.options.protocol)));return}if(!this.options.endpoint&&!this.options.uploadUrl&&!this.url){this._emitError(new Error("tus: neither an endpoint or an upload URL is provided"));return}var i=this.options.retryDelays;if(i!=null&&Object.prototype.toString.call(i)!=="[object Array]"){this._emitError(new Error("tus: the `retryDelays` option must either be an array or null"));return}if(this.options.parallelUploads>1)for(var o=0,s=["uploadUrl","uploadSize","uploadLengthDeferred"];o<s.length;o++){var a=s[o];if(this.options[a]){this._emitError(new Error("tus: cannot use the ".concat(a," option when parallelUploads is enabled")));return}}if(this.options.parallelUploadBoundaries){if(this.options.parallelUploads<=1){this._emitError(new Error("tus: cannot use the `parallelUploadBoundaries` option when `parallelUploads` is disabled"));return}if(this.options.parallelUploads!==this.options.parallelUploadBoundaries.length){this._emitError(new Error("tus: the `parallelUploadBoundaries` must have the same length as the value of `parallelUploads`"));return}}this.options.fingerprint(n,this.options).then(function(u){return u==null?(0,Li.log)("No fingerprint was calculated meaning that the upload cannot be stored in the URL storage."):(0,Li.log)("Calculated fingerprint: ".concat(u)),r._fingerprint=u,r._source?r._source:r.options.fileReader.openFile(n,r.options.chunkSize)}).then(function(u){if(r._source=u,r.options.uploadLengthDeferred)r._size=null;else if(r.options.uploadSize!=null){if(r._size=Number(r.options.uploadSize),Number.isNaN(r._size)){r._emitError(new Error("tus: cannot convert `uploadSize` option into a number"));return}}else if(r._size=r._source.size,r._size==null){r._emitError(new Error("tus: cannot automatically derive upload's size from input. Specify it manually using the `uploadSize` option or use the `uploadLengthDeferred` option"));return}r.options.parallelUploads>1||r._parallelUploadUrls!=null?r._startParallelUpload():r._startSingleUpload()}).catch(function(u){r._emitError(u)})}},{key:"_startParallelUpload",value:function(){var r,n=this,i=this._size,o=0;this._parallelUploads=[];var s=this._parallelUploadUrls!=null?this._parallelUploadUrls.length:this.options.parallelUploads,a=(r=this.options.parallelUploadBoundaries)!==null&&r!==void 0?r:u7(this._source.size,s);this._parallelUploadUrls&&a.forEach(function(l,f){l.uploadUrl=n._parallelUploadUrls[f]||null}),this._parallelUploadUrls=new Array(a.length);var u=a.map(function(l,f){var h=0;return n._source.slice(l.start,l.end).then(function(d){var m=d.value;return new Promise(function(b,g){var w=ls(ls({},n.options),{},{uploadUrl:l.uploadUrl||null,storeFingerprintForResuming:!1,removeFingerprintOnSuccess:!1,parallelUploads:1,parallelUploadBoundaries:null,metadata:n.options.metadataForPartialUploads,headers:ls(ls({},n.options.headers),{},{"Upload-Concat":"partial"}),onSuccess:b,onError:g,onProgress:function(C){o=o-h+C,h=C,n._emitProgress(o,i)},onUploadUrlAvailable:function(){n._parallelUploadUrls[f]=x.url,n._parallelUploadUrls.filter(function(C){return!!C}).length===a.length&&n._saveUploadInUrlStorage()}}),x=new t(m,w);x.start(),n._parallelUploads.push(x)})})}),c;Promise.all(u).then(function(){c=n._openRequest("POST",n.options.endpoint),c.setHeader("Upload-Concat","final;".concat(n._parallelUploadUrls.join(" ")));var l=GS(n.options.metadata);return l!==""&&c.setHeader("Upload-Metadata",l),n._sendRequest(c,null)}).then(function(l){if(!fs(l.getStatus(),200)){n._emitHttpError(c,l,"tus: unexpected response while creating upload");return}var f=l.getHeader("Location");if(f==null){n._emitHttpError(c,l,"tus: invalid or missing Location header");return}n.url=JS(n.options.endpoint,f),(0,Li.log)("Created upload at ".concat(n.url)),n._emitSuccess(l)}).catch(function(l){n._emitError(l)})}},{key:"_startSingleUpload",value:function(){if(this._aborted=!1,this.url!=null){(0,Li.log)("Resuming upload from previous URL: ".concat(this.url)),this._resumeUpload();return}if(this.options.uploadUrl!=null){(0,Li.log)("Resuming upload from provided URL: ".concat(this.options.uploadUrl)),this.url=this.options.uploadUrl,this._resumeUpload();return}(0,Li.log)("Creating a new upload"),this._createUpload()}},{key:"abort",value:function(r){var n=this;if(this._parallelUploads!=null){var i=t7(this._parallelUploads),o;try{for(i.s();!(o=i.n()).done;){var s=o.value;s.abort(r)}}catch(a){i.e(a)}finally{i.f()}}return this._req!==null&&this._req.abort(),this._aborted=!0,this._retryTimeout!=null&&(clearTimeout(this._retryTimeout),this._retryTimeout=null),!r||this.url==null?Promise.resolve():t.terminate(this.url,this.options).then(function(){return n._removeFromUrlStorage()})}},{key:"_emitHttpError",value:function(r,n,i,o){this._emitError(new cf.default(i,o,r,n))}},{key:"_emitError",value:function(r){var n=this;if(!this._aborted){if(this.options.retryDelays!=null){var i=this._offset!=null&&this._offset>this._offsetBeforeRetry;if(i&&(this._retryAttempt=0),YS(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=GS(this.options.metadata);i!==""&&n.setHeader("Upload-Metadata",i);var o;this.options.uploadDataDuringCreation&&!this.options.uploadLengthDeferred?(this._offset=0,o=this._addChunkToRequest(n)):(this.options.protocol===lf&&n.setHeader("Upload-Complete","?0"),o=this._sendRequest(n,null)),o.then(function(s){if(!fs(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=JS(r.options.endpoint,a),(0,Li.log)("Created upload at ".concat(r.url)),typeof r.options.onUploadUrlAvailable=="function"&&r.options.onUploadUrlAvailable(),r._size===0){r._emitSuccess(s),r._source.close();return}r._saveUploadInUrlStorage().then(function(){r.options.uploadDataDuringCreation?r._handleUploadResponse(n,s):(r._offset=0,r._performUpload())})}).catch(function(s){r._emitHttpError(n,null,"tus: failed to create upload",s)})}},{key:"_resumeUpload",value:function(){var r=this,n=this._openRequest("HEAD",this.url),i=this._sendRequest(n,null);i.then(function(o){var s=o.getStatus();if(!fs(s,200)){if(s===423){r._emitHttpError(n,o,"tus: upload is currently locked; retry later");return}if(fs(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===ty){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(!fs(o.getStatus(),200)){r._emitHttpError(n,o,"tus: unexpected response while uploading chunk");return}r._handleUploadResponse(n,o)}).catch(function(o){r._aborted||r._emitHttpError(n,null,"tus: failed to upload chunk at offset ".concat(r._offset),o)})}}},{key:"_addChunkToRequest",value:function(r){var n=this,i=this._offset,o=this._offset+this.options.chunkSize;return r.setProgressHandler(function(s){n._emitProgress(i+s,n._size)}),r.setHeader("Content-Type","application/offset+octet-stream"),(o===Number.POSITIVE_INFINITY||o>this._size)&&!this.options.uploadLengthDeferred&&(o=this._size),this._source.slice(i,o).then(function(s){var a=s.value,u=s.done,c=a!=null&&a.size?a.size:0;n.options.uploadLengthDeferred&&u&&(n._size=n._offset+c,r.setHeader("Upload-Length","".concat(n._size)));var l=n._offset+c;return!n.options.uploadLengthDeferred&&u&&l!==n._size?Promise.reject(new Error("upload was configured with a size of ".concat(n._size," bytes, but the source is done after ").concat(l," bytes"))):a===null?n._sendRequest(r):(n.options.protocol===lf&&r.setHeader("Upload-Complete",u?"?1":"?0"),n._emitProgress(n._offset,n._size),n._sendRequest(r,a))})}},{key:"_handleUploadResponse",value:function(r,n){var i=Number.parseInt(n.getHeader("Upload-Offset"),10);if(Number.isNaN(i)){this._emitHttpError(r,n,"tus: invalid or missing offset value");return}if(this._emitProgress(i,this._size),this._emitChunkComplete(i-this._offset,i,this._size),this._offset=i,i===this._size){this._emitSuccess(n),this._source.close();return}this._performUpload()}},{key:"_openRequest",value:function(r,n){var i=WS(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 KS(r,n,this.options)}}],[{key:"terminate",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=WS("DELETE",r,n);return KS(i,null,n).then(function(o){if(o.getStatus()!==204)throw new cf.default("tus: unexpected response while terminating upload",null,i,o)}).catch(function(o){if(o instanceof cf.default||(o=new cf.default("tus: failed to terminate upload",o,i,null)),!YS(o,0,n))throw o;var s=n.retryDelays[0],a=n.retryDelays.slice(1),u=ls(ls({},n),{},{retryDelays:a});return new Promise(function(c){return setTimeout(c,s)}).then(function(){return t.terminate(r,u)})})}}])}();function GS(t){return Object.entries(t).map(function(e){var r=XS(e,2),n=r[0],i=r[1];return"".concat(n," ").concat(K9.Base64.encode(String(i)))}).join(",")}function fs(t,e){return t>=e&&t<e+100}function WS(t,e,r){var n=r.httpStack.createRequest(t,e);r.protocol===lf?n.setHeader("Upload-Draft-Interop-Version","5"):n.setHeader("Tus-Resumable","1.0.0");for(var i=r.headers||{},o=0,s=Object.entries(i);o<s.length;o++){var a=XS(s[o],2),u=a[0],c=a[1];n.setHeader(u,c)}if(r.addRequestId){var l=(0,J9.default)();n.setHeader("X-Request-ID",l)}return n}function KS(t,e,r){return ry.apply(this,arguments)}function ry(){return ry=X9(ey().mark(function t(e,r,n){var i;return ey().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)})),ry.apply(this,arguments)}function a7(){var t=!0;return typeof navigator<"u"&&navigator.onLine===!1&&(t=!1),t}function YS(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):t1(t)}function t1(t){var e=t.originalResponse?t.originalResponse.getStatus():0;return(!fs(e,400)||e===409||e===423)&&a7()}function JS(t,e){return new Y9.default(e,t).toString()}function u7(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}e1.defaultOptions=s7;var ude=ff.default=e1});var i1=y((lde,n1)=>{"use strict";var Kr=t=>t!==null&&typeof t=="object"&&typeof t.pipe=="function";Kr.writable=t=>Kr(t)&&t.writable!==!1&&typeof t._write=="function"&&typeof t._writableState=="object";Kr.readable=t=>Kr(t)&&t.readable!==!1&&typeof t._read=="function"&&typeof t._readableState=="object";Kr.duplex=t=>Kr.writable(t)&&Kr.readable(t);Kr.transform=t=>Kr.duplex(t)&&typeof t._transform=="function";n1.exports=Kr});var s1=y(df=>{"use strict";Object.defineProperty(df,"__esModule",{value:!0});df.default=void 0;function Fu(t){"@babel/helpers - typeof";return Fu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Fu(t)}function c7(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o1(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,f7(n.key),n)}}function l7(t,e,r){return e&&o1(t.prototype,e),r&&o1(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function f7(t){var e=d7(t,"string");return Fu(e)=="symbol"?e:e+""}function d7(t,e){if(Fu(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Fu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var fde=df.default=function(){function t(e){c7(this,t),this._buffer=e,this.size=e.length}return l7(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 l1=y(sy=>{"use strict";Object.defineProperty(sy,"__esModule",{value:!0});sy.default=D7;var c1=require("fs");function qi(t){"@babel/helpers - typeof";return qi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},qi(t)}function iy(){"use strict";iy=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(E,v,_){E[v]=_.value},o=typeof Symbol=="function"?Symbol:{},s=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function c(E,v,_){return Object.defineProperty(E,v,{value:_,enumerable:!0,configurable:!0,writable:!0}),E[v]}try{c({},"")}catch{c=function(_,O,j){return _[O]=j}}function l(E,v,_,O){var j=v&&v.prototype instanceof w?v:w,P=Object.create(j.prototype),U=new K(O||[]);return i(P,"_invoke",{value:I(E,_,U)}),P}function f(E,v,_){try{return{type:"normal",arg:E.call(v,_)}}catch(O){return{type:"throw",arg:O}}}e.wrap=l;var h="suspendedStart",d="suspendedYield",m="executing",b="completed",g={};function w(){}function x(){}function D(){}var C={};c(C,s,function(){return this});var k=Object.getPrototypeOf,$=k&&k(k(M([])));$&&$!==r&&n.call($,s)&&(C=$);var F=D.prototype=w.prototype=Object.create(C);function L(E){["next","throw","return"].forEach(function(v){c(E,v,function(_){return this._invoke(v,_)})})}function S(E,v){function _(j,P,U,T){var N=f(E[j],E,P);if(N.type!=="throw"){var oe=N.arg,se=oe.value;return se&&qi(se)=="object"&&n.call(se,"__await")?v.resolve(se.__await).then(function(De){_("next",De,U,T)},function(De){_("throw",De,U,T)}):v.resolve(se).then(function(De){oe.value=De,U(oe)},function(De){return _("throw",De,U,T)})}T(N.arg)}var O;i(this,"_invoke",{value:function(P,U){function T(){return new v(function(N,oe){_(P,U,N,oe)})}return O=O?O.then(T,T):T()}})}function I(E,v,_){var O=h;return function(j,P){if(O===m)throw Error("Generator is already running");if(O===b){if(j==="throw")throw P;return{value:t,done:!0}}for(_.method=j,_.arg=P;;){var U=_.delegate;if(U){var T=R(U,_);if(T){if(T===g)continue;return T}}if(_.method==="next")_.sent=_._sent=_.arg;else if(_.method==="throw"){if(O===h)throw O=b,_.arg;_.dispatchException(_.arg)}else _.method==="return"&&_.abrupt("return",_.arg);O=m;var N=f(E,v,_);if(N.type==="normal"){if(O=_.done?b:d,N.arg===g)continue;return{value:N.arg,done:_.done}}N.type==="throw"&&(O=b,_.method="throw",_.arg=N.arg)}}}function R(E,v){var _=v.method,O=E.iterator[_];if(O===t)return v.delegate=null,_==="throw"&&E.iterator.return&&(v.method="return",v.arg=t,R(E,v),v.method==="throw")||_!=="return"&&(v.method="throw",v.arg=new TypeError("The iterator does not provide a '"+_+"' method")),g;var j=f(O,E.iterator,v.arg);if(j.type==="throw")return v.method="throw",v.arg=j.arg,v.delegate=null,g;var P=j.arg;return P?P.done?(v[E.resultName]=P.value,v.next=E.nextLoc,v.method!=="return"&&(v.method="next",v.arg=t),v.delegate=null,g):P:(v.method="throw",v.arg=new TypeError("iterator result is not an object"),v.delegate=null,g)}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 M(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 _=-1,O=function j(){for(;++_<E.length;)if(n.call(E,_))return j.value=E[_],j.done=!1,j;return j.value=t,j.done=!0,j};return O.next=O}}throw new TypeError(qi(E)+" is not iterable")}return x.prototype=D,i(F,"constructor",{value:D,configurable:!0}),i(D,"constructor",{value:x,configurable:!0}),x.displayName=c(D,u,"GeneratorFunction"),e.isGeneratorFunction=function(E){var v=typeof E=="function"&&E.constructor;return!!v&&(v===x||(v.displayName||v.name)==="GeneratorFunction")},e.mark=function(E){return Object.setPrototypeOf?Object.setPrototypeOf(E,D):(E.__proto__=D,c(E,u,"GeneratorFunction")),E.prototype=Object.create(F),E},e.awrap=function(E){return{__await:E}},L(S.prototype),c(S.prototype,a,function(){return this}),e.AsyncIterator=S,e.async=function(E,v,_,O,j){j===void 0&&(j=Promise);var P=new S(l(E,v,_,O),j);return e.isGeneratorFunction(v)?P:P.next().then(function(U){return U.done?U.value:P.next()})},L(F),c(F,u,"Generator"),c(F,s,function(){return this}),c(F,"toString",function(){return"[object Generator]"}),e.keys=function(E){var v=Object(E),_=[];for(var O in v)_.push(O);return _.reverse(),function j(){for(;_.length;){var P=_.pop();if(P in v)return j.value=P,j.done=!1,j}return j.done=!0,j}},e.values=M,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 _ in this)_.charAt(0)==="t"&&n.call(this,_)&&!isNaN(+_.slice(1))&&(this[_]=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 _=this;function O(oe,se){return U.type="throw",U.arg=v,_.next=oe,se&&(_.method="next",_.arg=t),!!se}for(var j=this.tryEntries.length-1;j>=0;--j){var P=this.tryEntries[j],U=P.completion;if(P.tryLoc==="root")return O("end");if(P.tryLoc<=this.prev){var T=n.call(P,"catchLoc"),N=n.call(P,"finallyLoc");if(T&&N){if(this.prev<P.catchLoc)return O(P.catchLoc,!0);if(this.prev<P.finallyLoc)return O(P.finallyLoc)}else if(T){if(this.prev<P.catchLoc)return O(P.catchLoc,!0)}else{if(!N)throw Error("try statement without catch or finally");if(this.prev<P.finallyLoc)return O(P.finallyLoc)}}}},abrupt:function(v,_){for(var O=this.tryEntries.length-1;O>=0;--O){var j=this.tryEntries[O];if(j.tryLoc<=this.prev&&n.call(j,"finallyLoc")&&this.prev<j.finallyLoc){var P=j;break}}P&&(v==="break"||v==="continue")&&P.tryLoc<=_&&_<=P.finallyLoc&&(P=null);var U=P?P.completion:{};return U.type=v,U.arg=_,P?(this.method="next",this.next=P.finallyLoc,g):this.complete(U)},complete:function(v,_){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"&&_&&(this.next=_),g},finish:function(v){for(var _=this.tryEntries.length-1;_>=0;--_){var O=this.tryEntries[_];if(O.finallyLoc===v)return this.complete(O.completion,O.afterLoc),q(O),g}},catch:function(v){for(var _=this.tryEntries.length-1;_>=0;--_){var O=this.tryEntries[_];if(O.tryLoc===v){var j=O.completion;if(j.type==="throw"){var P=j.arg;q(O)}return P}}throw Error("illegal catch attempt")},delegateYield:function(v,_,O){return this.delegate={iterator:M(v),resultName:_,nextLoc:O},this.method==="next"&&(this.arg=t),g}},e}function h7(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a1(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,m7(n.key),n)}}function p7(t,e,r){return e&&a1(t.prototype,e),r&&a1(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function m7(t){var e=g7(t,"string");return qi(e)=="symbol"?e:e+""}function g7(t,e){if(qi(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(qi(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function u1(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(c){r(c);return}a.done?e(u):Promise.resolve(u).then(n,i)}function y7(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function s(u){u1(o,n,i,s,a,"next",u)}function a(u){u1(o,n,i,s,a,"throw",u)}s(void 0)})}}function D7(t){return oy.apply(this,arguments)}function oy(){return oy=y7(iy().mark(function t(e){var r,n,i,o,s,a,u;return iy().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return n=e.path.toString(),l.next=3,c1.promises.stat(n);case 3:return i=l.sent,o=i.size,s=(r=e.start)!==null&&r!==void 0?r:0,a=Number.isFinite(e.end)?e.end+1:o,u=a-s,l.abrupt("return",new v7(e,n,u));case 9:case"end":return l.stop()}},t)})),oy.apply(this,arguments)}var v7=function(){function t(e,r,n){h7(this,t),this._stream=e,this._path=r,this.size=n}return p7(t,[{key:"slice",value:function(r,n){var i,o=(i=this._stream.start)!==null&&i!==void 0?i:0,s=(0,c1.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 uy=y(hf=>{"use strict";Object.defineProperty(hf,"__esModule",{value:!0});hf.default=void 0;function Mi(t){"@babel/helpers - typeof";return Mi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Mi(t)}function Ou(){"use strict";Ou=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(E,v,_){E[v]=_.value},o=typeof Symbol=="function"?Symbol:{},s=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function c(E,v,_){return Object.defineProperty(E,v,{value:_,enumerable:!0,configurable:!0,writable:!0}),E[v]}try{c({},"")}catch{c=function(_,O,j){return _[O]=j}}function l(E,v,_,O){var j=v&&v.prototype instanceof w?v:w,P=Object.create(j.prototype),U=new K(O||[]);return i(P,"_invoke",{value:I(E,_,U)}),P}function f(E,v,_){try{return{type:"normal",arg:E.call(v,_)}}catch(O){return{type:"throw",arg:O}}}e.wrap=l;var h="suspendedStart",d="suspendedYield",m="executing",b="completed",g={};function w(){}function x(){}function D(){}var C={};c(C,s,function(){return this});var k=Object.getPrototypeOf,$=k&&k(k(M([])));$&&$!==r&&n.call($,s)&&(C=$);var F=D.prototype=w.prototype=Object.create(C);function L(E){["next","throw","return"].forEach(function(v){c(E,v,function(_){return this._invoke(v,_)})})}function S(E,v){function _(j,P,U,T){var N=f(E[j],E,P);if(N.type!=="throw"){var oe=N.arg,se=oe.value;return se&&Mi(se)=="object"&&n.call(se,"__await")?v.resolve(se.__await).then(function(De){_("next",De,U,T)},function(De){_("throw",De,U,T)}):v.resolve(se).then(function(De){oe.value=De,U(oe)},function(De){return _("throw",De,U,T)})}T(N.arg)}var O;i(this,"_invoke",{value:function(P,U){function T(){return new v(function(N,oe){_(P,U,N,oe)})}return O=O?O.then(T,T):T()}})}function I(E,v,_){var O=h;return function(j,P){if(O===m)throw Error("Generator is already running");if(O===b){if(j==="throw")throw P;return{value:t,done:!0}}for(_.method=j,_.arg=P;;){var U=_.delegate;if(U){var T=R(U,_);if(T){if(T===g)continue;return T}}if(_.method==="next")_.sent=_._sent=_.arg;else if(_.method==="throw"){if(O===h)throw O=b,_.arg;_.dispatchException(_.arg)}else _.method==="return"&&_.abrupt("return",_.arg);O=m;var N=f(E,v,_);if(N.type==="normal"){if(O=_.done?b:d,N.arg===g)continue;return{value:N.arg,done:_.done}}N.type==="throw"&&(O=b,_.method="throw",_.arg=N.arg)}}}function R(E,v){var _=v.method,O=E.iterator[_];if(O===t)return v.delegate=null,_==="throw"&&E.iterator.return&&(v.method="return",v.arg=t,R(E,v),v.method==="throw")||_!=="return"&&(v.method="throw",v.arg=new TypeError("The iterator does not provide a '"+_+"' method")),g;var j=f(O,E.iterator,v.arg);if(j.type==="throw")return v.method="throw",v.arg=j.arg,v.delegate=null,g;var P=j.arg;return P?P.done?(v[E.resultName]=P.value,v.next=E.nextLoc,v.method!=="return"&&(v.method="next",v.arg=t),v.delegate=null,g):P:(v.method="throw",v.arg=new TypeError("iterator result is not an object"),v.delegate=null,g)}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 M(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 _=-1,O=function j(){for(;++_<E.length;)if(n.call(E,_))return j.value=E[_],j.done=!1,j;return j.value=t,j.done=!0,j};return O.next=O}}throw new TypeError(Mi(E)+" is not iterable")}return x.prototype=D,i(F,"constructor",{value:D,configurable:!0}),i(D,"constructor",{value:x,configurable:!0}),x.displayName=c(D,u,"GeneratorFunction"),e.isGeneratorFunction=function(E){var v=typeof E=="function"&&E.constructor;return!!v&&(v===x||(v.displayName||v.name)==="GeneratorFunction")},e.mark=function(E){return Object.setPrototypeOf?Object.setPrototypeOf(E,D):(E.__proto__=D,c(E,u,"GeneratorFunction")),E.prototype=Object.create(F),E},e.awrap=function(E){return{__await:E}},L(S.prototype),c(S.prototype,a,function(){return this}),e.AsyncIterator=S,e.async=function(E,v,_,O,j){j===void 0&&(j=Promise);var P=new S(l(E,v,_,O),j);return e.isGeneratorFunction(v)?P:P.next().then(function(U){return U.done?U.value:P.next()})},L(F),c(F,u,"Generator"),c(F,s,function(){return this}),c(F,"toString",function(){return"[object Generator]"}),e.keys=function(E){var v=Object(E),_=[];for(var O in v)_.push(O);return _.reverse(),function j(){for(;_.length;){var P=_.pop();if(P in v)return j.value=P,j.done=!1,j}return j.done=!0,j}},e.values=M,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 _ in this)_.charAt(0)==="t"&&n.call(this,_)&&!isNaN(+_.slice(1))&&(this[_]=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 _=this;function O(oe,se){return U.type="throw",U.arg=v,_.next=oe,se&&(_.method="next",_.arg=t),!!se}for(var j=this.tryEntries.length-1;j>=0;--j){var P=this.tryEntries[j],U=P.completion;if(P.tryLoc==="root")return O("end");if(P.tryLoc<=this.prev){var T=n.call(P,"catchLoc"),N=n.call(P,"finallyLoc");if(T&&N){if(this.prev<P.catchLoc)return O(P.catchLoc,!0);if(this.prev<P.finallyLoc)return O(P.finallyLoc)}else if(T){if(this.prev<P.catchLoc)return O(P.catchLoc,!0)}else{if(!N)throw Error("try statement without catch or finally");if(this.prev<P.finallyLoc)return O(P.finallyLoc)}}}},abrupt:function(v,_){for(var O=this.tryEntries.length-1;O>=0;--O){var j=this.tryEntries[O];if(j.tryLoc<=this.prev&&n.call(j,"finallyLoc")&&this.prev<j.finallyLoc){var P=j;break}}P&&(v==="break"||v==="continue")&&P.tryLoc<=_&&_<=P.finallyLoc&&(P=null);var U=P?P.completion:{};return U.type=v,U.arg=_,P?(this.method="next",this.next=P.finallyLoc,g):this.complete(U)},complete:function(v,_){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"&&_&&(this.next=_),g},finish:function(v){for(var _=this.tryEntries.length-1;_>=0;--_){var O=this.tryEntries[_];if(O.finallyLoc===v)return this.complete(O.completion,O.afterLoc),q(O),g}},catch:function(v){for(var _=this.tryEntries.length-1;_>=0;--_){var O=this.tryEntries[_];if(O.tryLoc===v){var j=O.completion;if(j.type==="throw"){var P=j.arg;q(O)}return P}}throw Error("illegal catch attempt")},delegateYield:function(v,_,O){return this.delegate={iterator:M(v),resultName:_,nextLoc:O},this.method==="next"&&(this.arg=t),g}},e}function b7(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function f1(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,_7(n.key),n)}}function w7(t,e,r){return e&&f1(t.prototype,e),r&&f1(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function _7(t){var e=E7(t,"string");return Mi(e)=="symbol"?e:e+""}function E7(t,e){if(Mi(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Mi(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function d1(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(c){r(c);return}a.done?e(u):Promise.resolve(u).then(n,i)}function h1(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function s(u){d1(o,n,i,s,a,"next",u)}function a(u){d1(o,n,i,s,a,"throw",u)}s(void 0)})}}function C7(t,e){return ay.apply(this,arguments)}function ay(){return ay=h1(Ou().mark(function t(e,r){return Ou().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return i.abrupt("return",new Promise(function(o,s){var a=function(l){e.off("readable",u),s(l)},u=function c(){var l=e.read(r);l!==null&&(e.off("error",a),e.off("readable",c),o(l))};e.once("error",a),e.on("readable",u)}));case 1:case"end":return i.stop()}},t)})),ay.apply(this,arguments)}var pde=hf.default=function(){function t(e){var r=this;b7(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 w7(t,[{key:"slice",value:function(){var e=h1(Ou().mark(function n(i,o){var s,a,u,c,l;return Ou().wrap(function(h){for(;;)switch(h.prev=h.next){case 0:if(!(i<this._bufPos)){h.next=2;break}throw new Error("cannot slice from position which we already seeked away");case 2:if(!(i>this._bufPos+this._buf.length)){h.next=4;break}throw new Error("slice start is outside of buffer (currently not implemented)");case 4:if(!this._error){h.next=6;break}throw this._error;case 6:if(i<this._bufPos+this._buf.length?(a=i-this._bufPos,u=Math.min(this._buf.length,o-this._bufPos),s=this._buf.slice(a,u)):s=Buffer.alloc(0),!this._ended){h.next=10;break}return s.size=s.length,h.abrupt("return",{value:s,done:!0});case 10:if(c=o-i,!(c>s.length)){h.next=16;break}return h.next=14,C7(this._stream,c-s.length);case 14:l=h.sent,s=Buffer.concat([s,l]);case 16:return this._buf=s,this._bufPos=i,s.size=s.length,h.abrupt("return",{value:s,done:this._ended});case 20:case"end":return h.stop()}},n,this)}));function r(n,i){return e.apply(this,arguments)}return r}()},{key:"close",value:function(){this._stream.destroy()}}])}()});var m1=y(mf=>{"use strict";Object.defineProperty(mf,"__esModule",{value:!0});mf.default=void 0;var S7=require("fs"),x7=pf(i1()),F7=pf(s1()),O7=pf(l1()),A7=pf(uy());function pf(t){return t&&t.__esModule?t:{default:t}}function Au(t){"@babel/helpers - typeof";return Au=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},Au(t)}function k7(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function p1(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,P7(n.key),n)}}function T7(t,e,r){return e&&p1(t.prototype,e),r&&p1(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function P7(t){var e=R7(t,"string");return Au(e)=="symbol"?e:e+""}function R7(t,e){if(Au(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Au(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var gde=mf.default=function(){function t(){k7(this,t)}return T7(t,[{key:"openFile",value:function(r,n){return Buffer.isBuffer(r)?Promise.resolve(new F7.default(r)):r instanceof S7.ReadStream&&r.path!=null?(0,O7.default)(r):x7.default.readable(r)?(n=Number(n),Number.isFinite(n)?Promise.resolve(new A7.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 v1=y(cy=>{"use strict";Object.defineProperty(cy,"__esModule",{value:!0});cy.default=j7;var $7=require("crypto"),g1=D1(require("fs")),I7=D1(require("path"));function y1(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,r=new WeakMap;return(y1=function(n){return n?r:e})(t)}function D1(t,e){if(!e&&t&&t.__esModule)return t;if(t===null||typeof t!="object"&&typeof t!="function")return{default:t};var r=y1(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 j7(t,e){if(Buffer.isBuffer(t)){var r=65536,n=t.slice(0,Math.min(r,t.length)),i=(0,$7.createHash)("md5").update(n).digest("hex"),o=["node-buffer",i,t.length,e.endpoint].join("-");return Promise.resolve(o)}return t instanceof g1.ReadStream&&t.path!=null?new Promise(function(s,a){var u=I7.resolve(t.path);g1.stat(t.path,function(c,l){if(c){a(c);return}var f=["node-file",u,l.size,l.mtime.getTime(),e.endpoint].join("-");s(f)})}):Promise.resolve(null)}});var C1=y((vde,E1)=>{var _1="Expected a function",b1=NaN,N7="[object Symbol]",L7=/^\s+|\s+$/g,B7=/^[-+]0x[0-9a-f]+$/i,q7=/^0b[01]+$/i,M7=/^0o[0-7]+$/i,U7=parseInt,V7=typeof global=="object"&&global&&global.Object===Object&&global,H7=typeof self=="object"&&self&&self.Object===Object&&self,z7=V7||H7||Function("return this")(),G7=Object.prototype,W7=G7.toString,K7=Math.max,Y7=Math.min,ly=function(){return z7.Date.now()};function J7(t,e,r){var n,i,o,s,a,u,c=0,l=!1,f=!1,h=!0;if(typeof t!="function")throw new TypeError(_1);e=w1(e)||0,gf(r)&&(l=!!r.leading,f="maxWait"in r,o=f?K7(w1(r.maxWait)||0,e):o,h="trailing"in r?!!r.trailing:h);function d($){var F=n,L=i;return n=i=void 0,c=$,s=t.apply(L,F),s}function m($){return c=$,a=setTimeout(w,e),l?d($):s}function b($){var F=$-u,L=$-c,S=e-F;return f?Y7(S,o-L):S}function g($){var F=$-u,L=$-c;return u===void 0||F>=e||F<0||f&&L>=o}function w(){var $=ly();if(g($))return x($);a=setTimeout(w,b($))}function x($){return a=void 0,h&&n?d($):(n=i=void 0,s)}function D(){a!==void 0&&clearTimeout(a),c=0,n=u=i=a=void 0}function C(){return a===void 0?s:x(ly())}function k(){var $=ly(),F=g($);if(n=arguments,i=this,u=$,F){if(a===void 0)return m(u);if(f)return a=setTimeout(w,e),d(u)}return a===void 0&&(a=setTimeout(w,e)),s}return k.cancel=D,k.flush=C,k}function X7(t,e,r){var n=!0,i=!0;if(typeof t!="function")throw new TypeError(_1);return gf(r)&&(n="leading"in r?!!r.leading:n,i="trailing"in r?!!r.trailing:i),J7(t,e,{leading:n,maxWait:e,trailing:i})}function gf(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function Z7(t){return!!t&&typeof t=="object"}function Q7(t){return typeof t=="symbol"||Z7(t)&&W7.call(t)==N7}function w1(t){if(typeof t=="number")return t;if(Q7(t))return b1;if(gf(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=gf(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=t.replace(L7,"");var r=q7.test(t);return r||M7.test(t)?U7(t.slice(2),r?2:8):B7.test(t)?b1:+t}E1.exports=X7});var R1=y(bf=>{"use strict";Object.defineProperty(bf,"__esModule",{value:!0});bf.default=void 0;var eV=k1(require("http")),tV=k1(require("https")),F1=require("stream"),rV=require("url"),O1=nV(C1());function nV(t){return t&&t.__esModule?t:{default:t}}function A1(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,r=new WeakMap;return(A1=function(n){return n?r:e})(t)}function k1(t,e){if(!e&&t&&t.__esModule)return t;if(t===null||typeof t!="object"&&typeof t!="function")return{default:t};var r=A1(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 iV(t,e,r){return e=yf(e),oV(t,T1()?Reflect.construct(e,r||[],yf(t).constructor):e.apply(t,r))}function oV(t,e){if(e&&(ds(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return sV(t)}function sV(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function T1(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(T1=function(){return!!t})()}function yf(t){return yf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},yf(t)}function aV(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&&fy(t,e)}function fy(t,e){return fy=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},fy(t,e)}function S1(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 ku(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?S1(Object(r),!0).forEach(function(n){uV(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):S1(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function uV(t,e,r){return e=P1(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ds(t){"@babel/helpers - typeof";return ds=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},ds(t)}function Df(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function x1(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,P1(n.key),n)}}function vf(t,e,r){return e&&x1(t.prototype,e),r&&x1(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function P1(t){var e=cV(t,"string");return ds(e)=="symbol"?e:e+""}function cV(t,e){if(ds(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(ds(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var bde=bf.default=function(){function t(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Df(this,t),this._requestOptions=e}return vf(t,[{key:"createRequest",value:function(r,n){return new lV(r,n,this._requestOptions)}},{key:"getName",value:function(){return"NodeHttpStack"}}])}(),lV=function(){function t(e,r,n){Df(this,t),this._method=e,this._url=r,this._headers={},this._request=null,this._progressHandler=function(){},this._requestOptions=n||{}}return vf(t,[{key:"getMethod",value:function(){return this._method}},{key:"getURL",value:function(){return this._url}},{key:"setHeader",value:function(r,n){this._headers[r]=n}},{key:"getHeader",value:function(r){return this._headers[r]}},{key:"setProgressHandler",value:function(r){this._progressHandler=r}},{key:"send",value:function(){var r=this,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return new Promise(function(i,o){var s=ku(ku(ku({},(0,rV.parse)(r._url)),r._requestOptions),{},{method:r._method,headers:ku(ku({},r._requestOptions.headers||{}),r._headers)});n!=null&&n.size&&(s.headers["Content-Length"]=n.size);var a=s.protocol==="https:"?tV:eV;r._request=a.request(s);var u=r._request;u.on("response",function(c){var l=[];c.on("data",function(f){l.push(f)}),c.on("end",function(){var f=Buffer.concat(l).toString("utf8");i(new fV(c,f))})}),u.on("error",function(c){o(c)}),n instanceof F1.Readable?n.pipe(new dV(r._progressHandler)).pipe(u):n instanceof Uint8Array?hV(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}}])}(),fV=function(){function t(e,r){Df(this,t),this._response=e,this._body=r}return vf(t,[{key:"getStatus",value:function(){return this._response.statusCode}},{key:"getHeader",value:function(r){return this._response.headers[r.toLowerCase()]}},{key:"getBody",value:function(){return this._body}},{key:"getUnderlyingObject",value:function(){return this._response}}])}(),dV=function(t){function e(r){var n;return Df(this,e),n=iV(this,e),n._onprogress=(0,O1.default)(r,100,{leading:!0,trailing:!1}),n._position=0,n}return aV(e,t),vf(e,[{key:"_transform",value:function(n,i,o){this._position+=n.length,this._onprogress(this._position),o(null,n)}}])}(F1.Transform),hV=function(e,r,n){n=(0,O1.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 $1=y(dy=>{"use strict";dy.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};dy.root=function(t,e,r){var n=this,i,o={stackLength:Error.stackTraceLimit,rootOnly:!0},s="",a=Error.stackTraceLimit,u;function c(){u[0]=n.toString(),n.stack=u.join(`
33
33
  `)}(!e||typeof e!="object")&&(e={}),e.hasOwnProperty("stackLength")&&typeof e.stackLength=="number"&&!isNaN(e.stackLength)&&e.stackLength>=0&&(o.stackLength=e.stackLength),e.hasOwnProperty("rootOnly")||(o.rootOnly=e.rootOnly),(!o.rootOnly||this.CustomError.parent===Error)&&(Object.keys(t).forEach(function(l){switch(l){case"code":i=t.code||void 0;break;case"message":s=t.message||"";break;default:n[l]=t[l]}}),Error.stackTraceLimit=o.stackLength+2,u=new Error().stack.split(`
34
34
  `),u.splice(0,3),u.unshift(""),Error.stackTraceLimit=a,this.stack=u.join(`
35
- `),Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,get:function(){return i},set:function(l){i=l,c()}}),Object.defineProperty(this,"message",{configurable:!0,enumerable:!0,get:function(){return s},set:function(l){s=l,c()}}),c())}});var L1=y((Ede,N1)=>{"use strict";N1.exports=Ui;Ui.factory=I1();var my=Ui("CustomError");my.order=Ui(my,{message:"Arguments out of order.",code:"EOARG"});function Ui(t,e,r,n){var i,o;return e=wf(arguments,1,Error,j1,[hy,_f]),r=wf(arguments,2,{},hy,[_f]),n=wf(arguments,3,py,_f,[]),t=wf(arguments,0,e===Error?"Error":e.prototype.CustomError.name,pV,[j1,hy,_f]),o=e===Error,o&&n===py&&(n=Ui.factory.root),i=function(s,a){var u,c,l,f,h,d;if(!(this instanceof i))return new i(s,a);for(delete this.constructor.name,Object.defineProperty(this.constructor,"name",{enumerable:!1,configurable:!0,value:t,writable:!1}),typeof s=="string"&&(s={message:s}),s||(s={}),c=this.CustomError.chain.slice(0).reverse().map(function(m){return m.properties}),c.push(s),c.unshift({}),d=Object.assign.apply(Object,c),u=this,l={},Object.keys(Ui.factory).forEach(function(m){l[m]=function(b,g){Ui.factory[m].call(u,b,g,l)}}),f=this.CustomError.chain.length-1;f>=0;f--)h=this.CustomError.chain[f],h.factory!==py&&h.factory.call(this,d,a,l)},i.prototype=Object.create(e.prototype),i.prototype.constructor=i,i.prototype.name=t,i.prototype.CustomError={chain:o?[]:e.prototype.CustomError.chain.slice(0),factory:n,name:t,parent:e,properties:r},i.prototype.CustomError.chain.unshift(i.prototype.CustomError),i.prototype.toString=function(){var s=this.CustomError.chain[this.CustomError.chain.length-1].name;return this.code&&(s+=" "+this.code),this.message&&(s+=": "+this.message),s},i}function wf(t,e,r,n,i){var o=-1,s=-1,a,u,c=e<t.length?e:t.length,l;for(a=0;a<=c;a++){if(l=t[a],o===-1)for(u=0;u<i.length;u++)i[u](l)&&(o=a);s===-1&&n(l)&&(s=a)}if(s!==-1&&o!==-1&&o<s)throw new my.order;return s!==-1?t[s]:r}function _f(t){return typeof t=="function"&&t!==Error&&!t.prototype.CustomError}function pV(t){return typeof t=="string"}function j1(t){return typeof t=="function"&&(t===Error||t.prototype.CustomError)}function hy(t){return t&&typeof t=="object"}function py(){}});var q1=y((Cde,B1)=>{B1.exports=L1()});var z1=y((Vi,hs)=>{var mV=1/0,gV="[object Symbol]",Tu={function:!0,object:!0},yV=Tu[typeof Vi]&&Vi&&!Vi.nodeType?Vi:void 0,DV=Tu[typeof hs]&&hs&&!hs.nodeType?hs:void 0,vV=Ef(yV&&DV&&typeof global=="object"&&global),bV=Ef(Tu[typeof self]&&self),M1=Ef(Tu[typeof window]&&window),gy=Ef(Tu[typeof Vi]&&Vi),wV=vV||M1!==(gy&&gy.window)&&M1||bV||gy||Function("return this")();function Ef(t){return t&&t.Object===Object?t:null}var _V=Object.prototype,EV=_V.toString,U1=wV.Symbol,V1=U1?U1.prototype:void 0,H1=V1?V1.toString:void 0;function CV(t){if(typeof t=="string")return t;if(xV(t))return H1?H1.call(t):"";var e=t+"";return e=="0"&&1/t==-mV?"-0":e}function SV(t){return!!t&&typeof t=="object"}function xV(t){return typeof t=="symbol"||SV(t)&&EV.call(t)==gV}hs.exports=CV});var Z1=y((Hi,ps)=>{var FV=z1(),OV="Expected a function",W1="__lodash_hash_undefined__",AV="[object Function]",kV="[object GeneratorFunction]",TV=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]/g,PV=/[\\^$.*+?()[\]{}|]/g,RV=/\\(\\)?/g,$V=/^\[object .+?Constructor\]$/,Ru={function:!0,object:!0},IV=Ru[typeof Hi]&&Hi&&!Hi.nodeType?Hi:void 0,jV=Ru[typeof ps]&&ps&&!ps.nodeType?ps:void 0,NV=Cf(IV&&jV&&typeof global=="object"&&global),LV=Cf(Ru[typeof self]&&self),G1=Cf(Ru[typeof window]&&window),yy=Cf(Ru[typeof Hi]&&Hi),BV=NV||G1!==(yy&&yy.window)&&G1||LV||yy||Function("return this")();function Cf(t){return t&&t.Object===Object?t:null}function qV(t){var e=!1;if(t!=null&&typeof t.toString!="function")try{e=!!(t+"")}catch{}return e}var MV=Array.prototype,K1=Object.prototype,Y1=Function.prototype.toString,Dy=K1.hasOwnProperty,UV=K1.toString,VV=RegExp("^"+Y1.call(Dy).replace(PV,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),HV=MV.splice,zV=J1(BV,"Map"),Pu=J1(Object,"create");function zi(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function GV(){this.__data__=Pu?Pu(null):{}}function WV(t){return this.has(t)&&delete this.__data__[t]}function KV(t){var e=this.__data__;if(Pu){var r=e[t];return r===W1?void 0:r}return Dy.call(e,t)?e[t]:void 0}function YV(t){var e=this.__data__;return Pu?e[t]!==void 0:Dy.call(e,t)}function JV(t,e){var r=this.__data__;return r[t]=Pu&&e===void 0?W1:e,this}zi.prototype.clear=GV;zi.prototype.delete=WV;zi.prototype.get=KV;zi.prototype.has=YV;zi.prototype.set=JV;function ms(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__=[]}function ZV(t){var e=this.__data__,r=Sf(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():HV.call(e,r,1),!0}function QV(t){var e=this.__data__,r=Sf(e,t);return r<0?void 0:e[r][1]}function eH(t){return Sf(this.__data__,t)>-1}function tH(t,e){var r=this.__data__,n=Sf(r,t);return n<0?r.push([t,e]):r[n][1]=e,this}ms.prototype.clear=XV;ms.prototype.delete=ZV;ms.prototype.get=QV;ms.prototype.has=eH;ms.prototype.set=tH;function Gi(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function rH(){this.__data__={hash:new zi,map:new(zV||ms),string:new zi}}function nH(t){return xf(this,t).delete(t)}function iH(t){return xf(this,t).get(t)}function oH(t){return xf(this,t).has(t)}function sH(t,e){return xf(this,t).set(t,e),this}Gi.prototype.clear=rH;Gi.prototype.delete=nH;Gi.prototype.get=iH;Gi.prototype.has=oH;Gi.prototype.set=sH;function Sf(t,e){for(var r=t.length;r--;)if(lH(t[r][0],e))return r;return-1}function xf(t,e){var r=t.__data__;return aH(e)?r[typeof e=="string"?"string":"hash"]:r.map}function J1(t,e){var r=t[e];return dH(r)?r:void 0}function aH(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}var uH=vy(function(t){var e=[];return hH(t).replace(TV,function(r,n,i,o){e.push(i?o.replace(RV,"$1"):n||r)}),e});function cH(t){if(t!=null){try{return Y1.call(t)}catch{}try{return t+""}catch{}}return""}function vy(t,e){if(typeof t!="function"||e&&typeof e!="function")throw new TypeError(OV);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(vy.Cache||Gi),r}vy.Cache=Gi;function lH(t,e){return t===e||t!==t&&e!==e}function fH(t){var e=X1(t)?UV.call(t):"";return e==AV||e==kV}function X1(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function dH(t){if(!X1(t))return!1;var e=fH(t)||qV(t)?VV:$V;return e.test(cH(t))}function hH(t){return t==null?"":FV(t)}ps.exports=uH});var Ox=y((Wi,ys)=>{var pH=Z1(),mH=200,ky="__lodash_hash_undefined__",Tf=1,Ds=2,gH=1/0,ix=9007199254740991,Ff="[object Arguments]",_y="[object Array]",ox="[object Boolean]",sx="[object Date]",ax="[object Error]",ux="[object Function]",yH="[object GeneratorFunction]",$u="[object Map]",cx="[object Number]",gs="[object Object]",Q1="[object Promise]",lx="[object RegExp]",Iu="[object Set]",Ty="[object String]",fx="[object Symbol]",Ey="[object WeakMap]",dx="[object ArrayBuffer]",Of="[object DataView]",DH="[object Float32Array]",vH="[object Float64Array]",bH="[object Int8Array]",wH="[object Int16Array]",_H="[object Int32Array]",EH="[object Uint8Array]",CH="[object Uint8ClampedArray]",SH="[object Uint16Array]",xH="[object Uint32Array]",FH=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,OH=/^\w*$/,AH=/[\\^$.*+?()[\]{}|]/g,kH=/^\[object .+?Constructor\]$/,TH=/^(?:0|[1-9]\d*)$/,Pe={};Pe[DH]=Pe[vH]=Pe[bH]=Pe[wH]=Pe[_H]=Pe[EH]=Pe[CH]=Pe[SH]=Pe[xH]=!0;Pe[Ff]=Pe[_y]=Pe[dx]=Pe[ox]=Pe[Of]=Pe[sx]=Pe[ax]=Pe[ux]=Pe[$u]=Pe[cx]=Pe[gs]=Pe[lx]=Pe[Iu]=Pe[Ty]=Pe[Ey]=!1;var Nu={function:!0,object:!0},PH=Nu[typeof Wi]&&Wi&&!Wi.nodeType?Wi:void 0,RH=Nu[typeof ys]&&ys&&!ys.nodeType?ys:void 0,$H=Pf(PH&&RH&&typeof global=="object"&&global),IH=Pf(Nu[typeof self]&&self),ex=Pf(Nu[typeof window]&&window),by=Pf(Nu[typeof Wi]&&Wi),Ji=$H||ex!==(by&&by.window)&&ex||IH||by||Function("return this")();function jH(t,e){for(var r=-1,n=t.length,i=Array(n);++r<n;)i[r]=e(t[r],r,t);return i}function NH(t,e){for(var r=-1,n=t.length;++r<n;)if(e(t[r],r,t))return!0;return!1}function LH(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}function BH(t,e){return jH(e,function(r){return[r,t[r]]})}function Pf(t){return t&&t.Object===Object?t:null}function Cy(t){var e=!1;if(t!=null&&typeof t.toString!="function")try{e=!!(t+"")}catch{}return e}function hx(t){var e=-1,r=Array(t.size);return t.forEach(function(n,i){r[++e]=[i,n]}),r}function qH(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}function MH(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=[n,n]}),r}var UH=Array.prototype,Rf=Object.prototype,px=Function.prototype.toString,Ki=Rf.hasOwnProperty,Xi=Rf.toString,VH=RegExp("^"+px.call(Ki).replace(AH,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),tx=Ji.Symbol,rx=Ji.Uint8Array,HH=Rf.propertyIsEnumerable,zH=UH.splice,GH=Object.getPrototypeOf,WH=Object.keys,Sy=vs(Ji,"DataView"),Af=vs(Ji,"Map"),xy=vs(Ji,"Promise"),Fy=vs(Ji,"Set"),Oy=vs(Ji,"WeakMap"),ju=vs(Object,"create"),KH=Qi(Sy),YH=Qi(Af),JH=Qi(xy),XH=Qi(Fy),ZH=Qi(Oy),nx=tx?tx.prototype:void 0,wy=nx?nx.valueOf:void 0;function Yi(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function QH(){this.__data__=ju?ju(null):{}}function ez(t){return this.has(t)&&delete this.__data__[t]}function tz(t){var e=this.__data__;if(ju){var r=e[t];return r===ky?void 0:r}return Ki.call(e,t)?e[t]:void 0}function rz(t){var e=this.__data__;return ju?e[t]!==void 0:Ki.call(e,t)}function nz(t,e){var r=this.__data__;return r[t]=ju&&e===void 0?ky:e,this}Yi.prototype.clear=QH;Yi.prototype.delete=ez;Yi.prototype.get=tz;Yi.prototype.has=rz;Yi.prototype.set=nz;function wn(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function iz(){this.__data__=[]}function oz(t){var e=this.__data__,r=$f(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():zH.call(e,r,1),!0}function sz(t){var e=this.__data__,r=$f(e,t);return r<0?void 0:e[r][1]}function az(t){return $f(this.__data__,t)>-1}function uz(t,e){var r=this.__data__,n=$f(r,t);return n<0?r.push([t,e]):r[n][1]=e,this}wn.prototype.clear=iz;wn.prototype.delete=oz;wn.prototype.get=sz;wn.prototype.has=az;wn.prototype.set=uz;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 cz(){this.__data__={hash:new Yi,map:new(Af||wn),string:new Yi}}function lz(t){return If(this,t).delete(t)}function fz(t){return If(this,t).get(t)}function dz(t){return If(this,t).has(t)}function hz(t,e){return If(this,t).set(t,e),this}Zi.prototype.clear=cz;Zi.prototype.delete=lz;Zi.prototype.get=fz;Zi.prototype.has=dz;Zi.prototype.set=hz;function kf(t){var e=-1,r=t?t.length:0;for(this.__data__=new Zi;++e<r;)this.add(t[e])}function pz(t){return this.__data__.set(t,ky),this}function mz(t){return this.__data__.has(t)}kf.prototype.add=kf.prototype.push=pz;kf.prototype.has=mz;function bn(t){this.__data__=new wn(t)}function gz(){this.__data__=new wn}function yz(t){return this.__data__.delete(t)}function Dz(t){return this.__data__.get(t)}function vz(t){return this.__data__.has(t)}function bz(t,e){var r=this.__data__;return r instanceof wn&&r.__data__.length==mH&&(r=this.__data__=new Zi(r.__data__)),r.set(t,e),this}bn.prototype.clear=gz;bn.prototype.delete=yz;bn.prototype.get=Dz;bn.prototype.has=vz;bn.prototype.set=bz;function $f(t,e){for(var r=t.length;r--;)if(Bz(t[r][0],e))return r;return-1}function mx(t,e){e=jf(e,t)?[e]:Dx(e);for(var r=0,n=e.length;t!=null&&r<n;)t=t[Nf(e[r++])];return r&&r==n?t:void 0}function gx(t,e){return Ki.call(t,e)||typeof t=="object"&&e in t&&$z(t)===null}function wz(t,e){return e in Object(t)}function Py(t,e,r,n,i){return t===e?!0:t==null||e==null||!Bf(t)&&!Lu(e)?t!==t&&e!==e:_z(t,e,Py,r,n,i)}function _z(t,e,r,n,i,o){var s=ni(t),a=ni(e),u=_y,c=_y;s||(u=vn(t),u=u==Ff?gs:u),a||(c=vn(e),c=c==Ff?gs:c);var l=u==gs&&!Cy(t),f=c==gs&&!Cy(e),h=u==c;if(h&&!l)return o||(o=new bn),s||Uz(t)?vx(t,e,r,n,i,o):kz(t,e,u,r,n,i,o);if(!(i&Ds)){var d=l&&Ki.call(t,"__wrapped__"),m=f&&Ki.call(e,"__wrapped__");if(d||m){var b=d?t.value():t,g=m?e.value():e;return o||(o=new bn),r(b,g,n,i,o)}}return h?(o||(o=new bn),Tz(t,e,r,n,i,o)):!1}function Ez(t,e,r,n){var i=r.length,o=i,s=!n;if(t==null)return!o;for(t=Object(t);i--;){var a=r[i];if(s&&a[2]?a[1]!==t[a[0]]:!(a[0]in t))return!1}for(;++i<o;){a=r[i];var u=a[0],c=t[u],l=a[1];if(s&&a[2]){if(c===void 0&&!(u in t))return!1}else{var f=new bn;if(n)var h=n(c,l,u,t,e,f);if(!(h===void 0?Py(l,c,n,Tf|Ds,f):h))return!1}}return!0}function Cz(t){return typeof t=="function"?t:t==null?Gz:typeof t=="object"?ni(t)?Fz(t[0],t[1]):xz(t):Wz(t)}function Sz(t){return WH(Object(t))}function xz(t){var e=Rz(t);return e.length==1&&e[0][2]?_x(e[0][0],e[0][1]):function(r){return r===t||Ez(r,t,e)}}function Fz(t,e){return jf(t)&&wx(e)?_x(Nf(t),e):function(r){var n=Vz(r,t);return n===void 0&&n===e?Hz(r,t):Py(e,n,void 0,Tf|Ds)}}function yx(t){return function(e){return e?.[t]}}function Oz(t){return function(e){return mx(e,t)}}function Dx(t){return ni(t)?t:pH(t)}function Az(t){return function(e){var r=vn(e);return r==$u?hx(e):r==Iu?MH(e):BH(e,t(e))}}function vx(t,e,r,n,i,o){var s=i&Ds,a=t.length,u=e.length;if(a!=u&&!(s&&u>a))return!1;var c=o.get(t);if(c)return c==e;var l=-1,f=!0,h=i&Tf?new kf:void 0;for(o.set(t,e);++l<a;){var d=t[l],m=e[l];if(n)var b=s?n(m,d,l,e,t,o):n(d,m,l,t,e,o);if(b!==void 0){if(b)continue;f=!1;break}if(h){if(!NH(e,function(g,w){if(!h.has(w)&&(d===g||r(d,g,n,i,o)))return h.add(w)})){f=!1;break}}else if(!(d===m||r(d,m,n,i,o))){f=!1;break}}return o.delete(t),f}function kz(t,e,r,n,i,o,s){switch(r){case Of:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case dx:return!(t.byteLength!=e.byteLength||!n(new rx(t),new rx(e)));case ox:case sx:return+t==+e;case ax:return t.name==e.name&&t.message==e.message;case cx:return t!=+t?e!=+e:t==+e;case lx:case Ty:return t==e+"";case $u:var a=hx;case Iu:var u=o&Ds;if(a||(a=qH),t.size!=e.size&&!u)return!1;var c=s.get(t);return c?c==e:(o|=Tf,s.set(t,e),vx(a(t),a(e),n,i,o,s));case fx:if(wy)return wy.call(t)==wy.call(e)}return!1}function Tz(t,e,r,n,i,o){var s=i&Ds,a=Ay(t),u=a.length,c=Ay(e),l=c.length;if(u!=l&&!s)return!1;for(var f=u;f--;){var h=a[f];if(!(s?h in e:gx(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 g=t[h],w=e[h];if(n)var x=s?n(w,g,h,e,t,o):n(g,w,h,t,e,o);if(!(x===void 0?g===w||r(g,w,n,i,o):x)){m=!1;break}b||(b=h=="constructor")}if(m&&!b){var D=t.constructor,C=e.constructor;D!=C&&"constructor"in t&&"constructor"in e&&!(typeof D=="function"&&D instanceof D&&typeof C=="function"&&C instanceof C)&&(m=!1)}return o.delete(t),m}var Pz=yx("length");function If(t,e){var r=t.__data__;return Nz(e)?r[typeof e=="string"?"string":"hash"]:r.map}function Rz(t){for(var e=zz(t),r=e.length;r--;)e[r][2]=wx(e[r][1]);return e}function vs(t,e){var r=t[e];return Mz(r)?r:void 0}function $z(t){return GH(Object(t))}function vn(t){return Xi.call(t)}(Sy&&vn(new Sy(new ArrayBuffer(1)))!=Of||Af&&vn(new Af)!=$u||xy&&vn(xy.resolve())!=Q1||Fy&&vn(new Fy)!=Iu||Oy&&vn(new Oy)!=Ey)&&(vn=function(t){var e=Xi.call(t),r=e==gs?t.constructor:void 0,n=r?Qi(r):void 0;if(n)switch(n){case KH:return Of;case YH:return $u;case JH:return Q1;case XH:return Iu;case ZH:return Ey}return e});function Iz(t,e,r){e=jf(e,t)?[e]:Dx(e);for(var n,i=-1,s=e.length;++i<s;){var o=Nf(e[i]);if(!(n=t!=null&&r(t,o)))break;t=t[o]}if(n)return n;var s=t?t.length:0;return!!s&&Lf(s)&&bx(o,s)&&(ni(t)||xx(t)||Ex(t))}function jz(t){var e=t?t.length:void 0;return Lf(e)&&(ni(t)||xx(t)||Ex(t))?LH(e,String):null}function bx(t,e){return e=e??ix,!!e&&(typeof t=="number"||TH.test(t))&&t>-1&&t%1==0&&t<e}function jf(t,e){if(ni(t))return!1;var r=typeof t;return r=="number"||r=="symbol"||r=="boolean"||t==null||Fx(t)?!0:OH.test(t)||!FH.test(t)||e!=null&&t in Object(e)}function Nz(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function Lz(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||Rf;return t===r}function wx(t){return t===t&&!Bf(t)}function _x(t,e){return function(r){return r==null?!1:r[t]===e&&(e!==void 0||t in Object(r))}}function Nf(t){if(typeof t=="string"||Fx(t))return t;var e=t+"";return e=="0"&&1/t==-gH?"-0":e}function Qi(t){if(t!=null){try{return px.call(t)}catch{}try{return t+""}catch{}}return""}function Bz(t,e){return t===e||t!==t&&e!==e}function Ex(t){return qz(t)&&Ki.call(t,"callee")&&(!HH.call(t,"callee")||Xi.call(t)==Ff)}var ni=Array.isArray;function Cx(t){return t!=null&&Lf(Pz(t))&&!Sx(t)}function qz(t){return Lu(t)&&Cx(t)}function Sx(t){var e=Bf(t)?Xi.call(t):"";return e==ux||e==yH}function Lf(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=ix}function Bf(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function Lu(t){return!!t&&typeof t=="object"}function Mz(t){if(!Bf(t))return!1;var e=Sx(t)||Cy(t)?VH:kH;return e.test(Qi(t))}function xx(t){return typeof t=="string"||!ni(t)&&Lu(t)&&Xi.call(t)==Ty}function Fx(t){return typeof t=="symbol"||Lu(t)&&Xi.call(t)==fx}function Uz(t){return Lu(t)&&Lf(t.length)&&!!Pe[Xi.call(t)]}function Vz(t,e,r){var n=t==null?void 0:mx(t,e);return n===void 0?r:n}function Hz(t,e){return t!=null&&Iz(t,e,wz)}function Ay(t){var e=Lz(t);if(!(e||Cx(t)))return Sz(t);var r=jz(t),n=!!r,i=r||[],o=i.length;for(var s in t)gx(t,s)&&!(n&&(s=="length"||bx(s,o)))&&!(e&&s=="constructor")&&i.push(s);return i}var zz=Az(Ay);function Gz(t){return t}function Wz(t){return jf(t)?yx(Nf(t)):Oz(t)}ys.exports=Cz});var Rx=y((eo,bs)=>{var Kz=1/0,Yz="[object Function]",Jz="[object GeneratorFunction]",Xz=/[\\^$.*+?()[\]{}|]/g,Zz=/^\[object .+?Constructor\]$/,Bu={function:!0,object:!0},Qz=Bu[typeof eo]&&eo&&!eo.nodeType?eo:void 0,eG=Bu[typeof bs]&&bs&&!bs.nodeType?bs:void 0,tG=qf(Qz&&eG&&typeof global=="object"&&global),rG=qf(Bu[typeof self]&&self),Ax=qf(Bu[typeof window]&&window),Ry=qf(Bu[typeof eo]&&eo),nG=tG||Ax!==(Ry&&Ry.window)&&Ax||rG||Ry||Function("return this")();function qf(t){return t&&t.Object===Object?t:null}function iG(t){var e=!1;if(t!=null&&typeof t.toString!="function")try{e=!!(t+"")}catch{}return e}function oG(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}var kx=Object.prototype,Tx=Function.prototype.toString,sG=kx.hasOwnProperty,aG=kx.toString,uG=RegExp("^"+Tx.call(sG).replace(Xz,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),$y=lG(nG,"Set"),cG=$y&&1/oG(new $y([,-0]))[1]==Kz?function(t){return new $y(t)}:pG;function lG(t,e){var r=t[e];return hG(r)?r:void 0}function fG(t){if(t!=null){try{return Tx.call(t)}catch{}try{return t+""}catch{}}return""}function dG(t){var e=Px(t)?aG.call(t):"";return e==Yz||e==Jz}function Px(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function hG(t){if(!Px(t))return!1;var e=dG(t)||iG(t)?uG:Zz;return e.test(fG(t))}function pG(){}bs.exports=cG});var Ix=y((to,ws)=>{var qu={function:!0,object:!0},mG=qu[typeof to]&&to&&!to.nodeType?to:void 0,gG=qu[typeof ws]&&ws&&!ws.nodeType?ws:void 0,yG=Mf(mG&&gG&&typeof global=="object"&&global),DG=Mf(qu[typeof self]&&self),$x=Mf(qu[typeof window]&&window),Iy=Mf(qu[typeof to]&&to),vG=yG||$x!==(Iy&&Iy.window)&&$x||DG||Iy||Function("return this")();function Mf(t){return t&&t.Object===Object?t:null}ws.exports=vG});var Mx=y((Sde,qx)=>{var bG=Rx(),wG=Ix(),_G=200,jy="__lodash_hash_undefined__",EG="[object Function]",CG="[object GeneratorFunction]",SG=/[\\^$.*+?()[\]{}|]/g,xG=/^\[object .+?Constructor\]$/;function FG(t,e){return!!t.length&&AG(t,e,0)>-1}function OG(t,e,r){for(var n=-1,i=t.length;++n<i;)if(r(e,t[n]))return!0;return!1}function AG(t,e,r){if(e!==e)return TG(t,r);for(var n=r-1,i=t.length;++n<i;)if(t[n]===e)return n;return-1}function kG(t,e){return t.has(e)}function TG(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 PG(t){var e=!1;if(t!=null&&typeof t.toString!="function")try{e=!!(t+"")}catch{}return e}function RG(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}var $G=Array.prototype,jx=Object.prototype,Nx=Function.prototype.toString,Ny=jx.hasOwnProperty,IG=jx.toString,jG=RegExp("^"+Nx.call(Ny).replace(SG,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),NG=$G.splice,LG=Lx(wG,"Map"),Mu=Lx(Object,"create");function ro(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function BG(){this.__data__=Mu?Mu(null):{}}function qG(t){return this.has(t)&&delete this.__data__[t]}function MG(t){var e=this.__data__;if(Mu){var r=e[t];return r===jy?void 0:r}return Ny.call(e,t)?e[t]:void 0}function UG(t){var e=this.__data__;return Mu?e[t]!==void 0:Ny.call(e,t)}function VG(t,e){var r=this.__data__;return r[t]=Mu&&e===void 0?jy:e,this}ro.prototype.clear=BG;ro.prototype.delete=qG;ro.prototype.get=MG;ro.prototype.has=UG;ro.prototype.set=VG;function _s(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 HG(){this.__data__=[]}function zG(t){var e=this.__data__,r=Vf(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():NG.call(e,r,1),!0}function GG(t){var e=this.__data__,r=Vf(e,t);return r<0?void 0:e[r][1]}function WG(t){return Vf(this.__data__,t)>-1}function KG(t,e){var r=this.__data__,n=Vf(r,t);return n<0?r.push([t,e]):r[n][1]=e,this}_s.prototype.clear=HG;_s.prototype.delete=zG;_s.prototype.get=GG;_s.prototype.has=WG;_s.prototype.set=KG;function Es(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 YG(){this.__data__={hash:new ro,map:new(LG||_s),string:new ro}}function JG(t){return Hf(this,t).delete(t)}function XG(t){return Hf(this,t).get(t)}function ZG(t){return Hf(this,t).has(t)}function QG(t,e){return Hf(this,t).set(t,e),this}Es.prototype.clear=YG;Es.prototype.delete=JG;Es.prototype.get=XG;Es.prototype.has=ZG;Es.prototype.set=QG;function Uf(t){var e=-1,r=t?t.length:0;for(this.__data__=new Es;++e<r;)this.add(t[e])}function eW(t){return this.__data__.set(t,jy),this}function tW(t){return this.__data__.has(t)}Uf.prototype.add=Uf.prototype.push=eW;Uf.prototype.has=tW;function Vf(t,e){for(var r=t.length;r--;)if(oW(t[r][0],e))return r;return-1}function rW(t,e,r){var n=-1,i=FG,o=t.length,s=!0,a=[],u=a;if(r)s=!1,i=OG;else if(o>=_G){var c=e?null:bG(t);if(c)return RG(c);s=!1,i=kG,u=new Uf}else u=e?[]:a;e:for(;++n<o;){var l=t[n],f=e?e(l):l;if(l=r||l!==0?l:0,s&&f===f){for(var h=u.length;h--;)if(u[h]===f)continue e;e&&u.push(f),a.push(l)}else i(u,f,r)||(u!==a&&u.push(f),a.push(l))}return a}function Hf(t,e){var r=t.__data__;return nW(e)?r[typeof e=="string"?"string":"hash"]:r.map}function Lx(t,e){var r=t[e];return aW(r)?r:void 0}function nW(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function iW(t){if(t!=null){try{return Nx.call(t)}catch{}try{return t+""}catch{}}return""}function oW(t,e){return t===e||t!==t&&e!==e}function sW(t){var e=Bx(t)?IG.call(t):"";return e==EG||e==CG}function Bx(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function aW(t){if(!Bx(t))return!1;var e=sW(t)||PG(t)?jG:xG;return e.test(iW(t))}qx.exports=rW});var Vx=y((xde,Ux)=>{var uW=Ox(),cW=Mx();function lW(t,e){return t&&t.length?cW(t,uW(e)):[]}Ux.exports=lW});var zx=y((Fde,Hx)=>{"use strict";var fW=q1(),dW=Vx(),hW=fW("MultiError");Hx.exports=Ly;function Ly(t){if(!(this instanceof Ly))return new Ly(t);if(t=Array.isArray(t)?t:[t],t=dW(t,function(r){return r.stack}),t.length===1)return t[0];var e=new hW({message:t.map(function(r){return r.message}).join("; "),errors:t.reduce(function(r,n){return r.concat(n.errors||n)},[])});return e.__defineGetter__("stack",function(){return t.map(function(r){return r.stack}).join(`
35
+ `),Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,get:function(){return i},set:function(l){i=l,c()}}),Object.defineProperty(this,"message",{configurable:!0,enumerable:!0,get:function(){return s},set:function(l){s=l,c()}}),c())}});var N1=y((Ede,j1)=>{"use strict";j1.exports=Ui;Ui.factory=$1();var my=Ui("CustomError");my.order=Ui(my,{message:"Arguments out of order.",code:"EOARG"});function Ui(t,e,r,n){var i,o;return e=wf(arguments,1,Error,I1,[hy,_f]),r=wf(arguments,2,{},hy,[_f]),n=wf(arguments,3,py,_f,[]),t=wf(arguments,0,e===Error?"Error":e.prototype.CustomError.name,pV,[I1,hy,_f]),o=e===Error,o&&n===py&&(n=Ui.factory.root),i=function(s,a){var u,c,l,f,h,d;if(!(this instanceof i))return new i(s,a);for(delete this.constructor.name,Object.defineProperty(this.constructor,"name",{enumerable:!1,configurable:!0,value:t,writable:!1}),typeof s=="string"&&(s={message:s}),s||(s={}),c=this.CustomError.chain.slice(0).reverse().map(function(m){return m.properties}),c.push(s),c.unshift({}),d=Object.assign.apply(Object,c),u=this,l={},Object.keys(Ui.factory).forEach(function(m){l[m]=function(b,g){Ui.factory[m].call(u,b,g,l)}}),f=this.CustomError.chain.length-1;f>=0;f--)h=this.CustomError.chain[f],h.factory!==py&&h.factory.call(this,d,a,l)},i.prototype=Object.create(e.prototype),i.prototype.constructor=i,i.prototype.name=t,i.prototype.CustomError={chain:o?[]:e.prototype.CustomError.chain.slice(0),factory:n,name:t,parent:e,properties:r},i.prototype.CustomError.chain.unshift(i.prototype.CustomError),i.prototype.toString=function(){var s=this.CustomError.chain[this.CustomError.chain.length-1].name;return this.code&&(s+=" "+this.code),this.message&&(s+=": "+this.message),s},i}function wf(t,e,r,n,i){var o=-1,s=-1,a,u,c=e<t.length?e:t.length,l;for(a=0;a<=c;a++){if(l=t[a],o===-1)for(u=0;u<i.length;u++)i[u](l)&&(o=a);s===-1&&n(l)&&(s=a)}if(s!==-1&&o!==-1&&o<s)throw new my.order;return s!==-1?t[s]:r}function _f(t){return typeof t=="function"&&t!==Error&&!t.prototype.CustomError}function pV(t){return typeof t=="string"}function I1(t){return typeof t=="function"&&(t===Error||t.prototype.CustomError)}function hy(t){return t&&typeof t=="object"}function py(){}});var B1=y((Cde,L1)=>{L1.exports=N1()});var H1=y((Vi,hs)=>{var mV=1/0,gV="[object Symbol]",Tu={function:!0,object:!0},yV=Tu[typeof Vi]&&Vi&&!Vi.nodeType?Vi:void 0,DV=Tu[typeof hs]&&hs&&!hs.nodeType?hs:void 0,vV=Ef(yV&&DV&&typeof global=="object"&&global),bV=Ef(Tu[typeof self]&&self),q1=Ef(Tu[typeof window]&&window),gy=Ef(Tu[typeof Vi]&&Vi),wV=vV||q1!==(gy&&gy.window)&&q1||bV||gy||Function("return this")();function Ef(t){return t&&t.Object===Object?t:null}var _V=Object.prototype,EV=_V.toString,M1=wV.Symbol,U1=M1?M1.prototype:void 0,V1=U1?U1.toString:void 0;function CV(t){if(typeof t=="string")return t;if(xV(t))return V1?V1.call(t):"";var e=t+"";return e=="0"&&1/t==-mV?"-0":e}function SV(t){return!!t&&typeof t=="object"}function xV(t){return typeof t=="symbol"||SV(t)&&EV.call(t)==gV}hs.exports=CV});var X1=y((Hi,ps)=>{var FV=H1(),OV="Expected a function",G1="__lodash_hash_undefined__",AV="[object Function]",kV="[object GeneratorFunction]",TV=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]/g,PV=/[\\^$.*+?()[\]{}|]/g,RV=/\\(\\)?/g,$V=/^\[object .+?Constructor\]$/,Ru={function:!0,object:!0},IV=Ru[typeof Hi]&&Hi&&!Hi.nodeType?Hi:void 0,jV=Ru[typeof ps]&&ps&&!ps.nodeType?ps:void 0,NV=Cf(IV&&jV&&typeof global=="object"&&global),LV=Cf(Ru[typeof self]&&self),z1=Cf(Ru[typeof window]&&window),yy=Cf(Ru[typeof Hi]&&Hi),BV=NV||z1!==(yy&&yy.window)&&z1||LV||yy||Function("return this")();function Cf(t){return t&&t.Object===Object?t:null}function qV(t){var e=!1;if(t!=null&&typeof t.toString!="function")try{e=!!(t+"")}catch{}return e}var MV=Array.prototype,W1=Object.prototype,K1=Function.prototype.toString,Dy=W1.hasOwnProperty,UV=W1.toString,VV=RegExp("^"+K1.call(Dy).replace(PV,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),HV=MV.splice,zV=Y1(BV,"Map"),Pu=Y1(Object,"create");function zi(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function GV(){this.__data__=Pu?Pu(null):{}}function WV(t){return this.has(t)&&delete this.__data__[t]}function KV(t){var e=this.__data__;if(Pu){var r=e[t];return r===G1?void 0:r}return Dy.call(e,t)?e[t]:void 0}function YV(t){var e=this.__data__;return Pu?e[t]!==void 0:Dy.call(e,t)}function JV(t,e){var r=this.__data__;return r[t]=Pu&&e===void 0?G1:e,this}zi.prototype.clear=GV;zi.prototype.delete=WV;zi.prototype.get=KV;zi.prototype.has=YV;zi.prototype.set=JV;function ms(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__=[]}function ZV(t){var e=this.__data__,r=Sf(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():HV.call(e,r,1),!0}function QV(t){var e=this.__data__,r=Sf(e,t);return r<0?void 0:e[r][1]}function eH(t){return Sf(this.__data__,t)>-1}function tH(t,e){var r=this.__data__,n=Sf(r,t);return n<0?r.push([t,e]):r[n][1]=e,this}ms.prototype.clear=XV;ms.prototype.delete=ZV;ms.prototype.get=QV;ms.prototype.has=eH;ms.prototype.set=tH;function Gi(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function rH(){this.__data__={hash:new zi,map:new(zV||ms),string:new zi}}function nH(t){return xf(this,t).delete(t)}function iH(t){return xf(this,t).get(t)}function oH(t){return xf(this,t).has(t)}function sH(t,e){return xf(this,t).set(t,e),this}Gi.prototype.clear=rH;Gi.prototype.delete=nH;Gi.prototype.get=iH;Gi.prototype.has=oH;Gi.prototype.set=sH;function Sf(t,e){for(var r=t.length;r--;)if(lH(t[r][0],e))return r;return-1}function xf(t,e){var r=t.__data__;return aH(e)?r[typeof e=="string"?"string":"hash"]:r.map}function Y1(t,e){var r=t[e];return dH(r)?r:void 0}function aH(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}var uH=vy(function(t){var e=[];return hH(t).replace(TV,function(r,n,i,o){e.push(i?o.replace(RV,"$1"):n||r)}),e});function cH(t){if(t!=null){try{return K1.call(t)}catch{}try{return t+""}catch{}}return""}function vy(t,e){if(typeof t!="function"||e&&typeof e!="function")throw new TypeError(OV);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(vy.Cache||Gi),r}vy.Cache=Gi;function lH(t,e){return t===e||t!==t&&e!==e}function fH(t){var e=J1(t)?UV.call(t):"";return e==AV||e==kV}function J1(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function dH(t){if(!J1(t))return!1;var e=fH(t)||qV(t)?VV:$V;return e.test(cH(t))}function hH(t){return t==null?"":FV(t)}ps.exports=uH});var Fx=y((Wi,ys)=>{var pH=X1(),mH=200,ky="__lodash_hash_undefined__",Tf=1,Ds=2,gH=1/0,nx=9007199254740991,Ff="[object Arguments]",_y="[object Array]",ix="[object Boolean]",ox="[object Date]",sx="[object Error]",ax="[object Function]",yH="[object GeneratorFunction]",$u="[object Map]",ux="[object Number]",gs="[object Object]",Z1="[object Promise]",cx="[object RegExp]",Iu="[object Set]",Ty="[object String]",lx="[object Symbol]",Ey="[object WeakMap]",fx="[object ArrayBuffer]",Of="[object DataView]",DH="[object Float32Array]",vH="[object Float64Array]",bH="[object Int8Array]",wH="[object Int16Array]",_H="[object Int32Array]",EH="[object Uint8Array]",CH="[object Uint8ClampedArray]",SH="[object Uint16Array]",xH="[object Uint32Array]",FH=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,OH=/^\w*$/,AH=/[\\^$.*+?()[\]{}|]/g,kH=/^\[object .+?Constructor\]$/,TH=/^(?:0|[1-9]\d*)$/,Pe={};Pe[DH]=Pe[vH]=Pe[bH]=Pe[wH]=Pe[_H]=Pe[EH]=Pe[CH]=Pe[SH]=Pe[xH]=!0;Pe[Ff]=Pe[_y]=Pe[fx]=Pe[ix]=Pe[Of]=Pe[ox]=Pe[sx]=Pe[ax]=Pe[$u]=Pe[ux]=Pe[gs]=Pe[cx]=Pe[Iu]=Pe[Ty]=Pe[Ey]=!1;var Nu={function:!0,object:!0},PH=Nu[typeof Wi]&&Wi&&!Wi.nodeType?Wi:void 0,RH=Nu[typeof ys]&&ys&&!ys.nodeType?ys:void 0,$H=Pf(PH&&RH&&typeof global=="object"&&global),IH=Pf(Nu[typeof self]&&self),Q1=Pf(Nu[typeof window]&&window),by=Pf(Nu[typeof Wi]&&Wi),Ji=$H||Q1!==(by&&by.window)&&Q1||IH||by||Function("return this")();function jH(t,e){for(var r=-1,n=t.length,i=Array(n);++r<n;)i[r]=e(t[r],r,t);return i}function NH(t,e){for(var r=-1,n=t.length;++r<n;)if(e(t[r],r,t))return!0;return!1}function LH(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}function BH(t,e){return jH(e,function(r){return[r,t[r]]})}function Pf(t){return t&&t.Object===Object?t:null}function Cy(t){var e=!1;if(t!=null&&typeof t.toString!="function")try{e=!!(t+"")}catch{}return e}function dx(t){var e=-1,r=Array(t.size);return t.forEach(function(n,i){r[++e]=[i,n]}),r}function qH(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}function MH(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=[n,n]}),r}var UH=Array.prototype,Rf=Object.prototype,hx=Function.prototype.toString,Ki=Rf.hasOwnProperty,Xi=Rf.toString,VH=RegExp("^"+hx.call(Ki).replace(AH,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ex=Ji.Symbol,tx=Ji.Uint8Array,HH=Rf.propertyIsEnumerable,zH=UH.splice,GH=Object.getPrototypeOf,WH=Object.keys,Sy=vs(Ji,"DataView"),Af=vs(Ji,"Map"),xy=vs(Ji,"Promise"),Fy=vs(Ji,"Set"),Oy=vs(Ji,"WeakMap"),ju=vs(Object,"create"),KH=Qi(Sy),YH=Qi(Af),JH=Qi(xy),XH=Qi(Fy),ZH=Qi(Oy),rx=ex?ex.prototype:void 0,wy=rx?rx.valueOf:void 0;function Yi(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function QH(){this.__data__=ju?ju(null):{}}function ez(t){return this.has(t)&&delete this.__data__[t]}function tz(t){var e=this.__data__;if(ju){var r=e[t];return r===ky?void 0:r}return Ki.call(e,t)?e[t]:void 0}function rz(t){var e=this.__data__;return ju?e[t]!==void 0:Ki.call(e,t)}function nz(t,e){var r=this.__data__;return r[t]=ju&&e===void 0?ky:e,this}Yi.prototype.clear=QH;Yi.prototype.delete=ez;Yi.prototype.get=tz;Yi.prototype.has=rz;Yi.prototype.set=nz;function wn(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function iz(){this.__data__=[]}function oz(t){var e=this.__data__,r=$f(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():zH.call(e,r,1),!0}function sz(t){var e=this.__data__,r=$f(e,t);return r<0?void 0:e[r][1]}function az(t){return $f(this.__data__,t)>-1}function uz(t,e){var r=this.__data__,n=$f(r,t);return n<0?r.push([t,e]):r[n][1]=e,this}wn.prototype.clear=iz;wn.prototype.delete=oz;wn.prototype.get=sz;wn.prototype.has=az;wn.prototype.set=uz;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 cz(){this.__data__={hash:new Yi,map:new(Af||wn),string:new Yi}}function lz(t){return If(this,t).delete(t)}function fz(t){return If(this,t).get(t)}function dz(t){return If(this,t).has(t)}function hz(t,e){return If(this,t).set(t,e),this}Zi.prototype.clear=cz;Zi.prototype.delete=lz;Zi.prototype.get=fz;Zi.prototype.has=dz;Zi.prototype.set=hz;function kf(t){var e=-1,r=t?t.length:0;for(this.__data__=new Zi;++e<r;)this.add(t[e])}function pz(t){return this.__data__.set(t,ky),this}function mz(t){return this.__data__.has(t)}kf.prototype.add=kf.prototype.push=pz;kf.prototype.has=mz;function bn(t){this.__data__=new wn(t)}function gz(){this.__data__=new wn}function yz(t){return this.__data__.delete(t)}function Dz(t){return this.__data__.get(t)}function vz(t){return this.__data__.has(t)}function bz(t,e){var r=this.__data__;return r instanceof wn&&r.__data__.length==mH&&(r=this.__data__=new Zi(r.__data__)),r.set(t,e),this}bn.prototype.clear=gz;bn.prototype.delete=yz;bn.prototype.get=Dz;bn.prototype.has=vz;bn.prototype.set=bz;function $f(t,e){for(var r=t.length;r--;)if(Bz(t[r][0],e))return r;return-1}function px(t,e){e=jf(e,t)?[e]:yx(e);for(var r=0,n=e.length;t!=null&&r<n;)t=t[Nf(e[r++])];return r&&r==n?t:void 0}function mx(t,e){return Ki.call(t,e)||typeof t=="object"&&e in t&&$z(t)===null}function wz(t,e){return e in Object(t)}function Py(t,e,r,n,i){return t===e?!0:t==null||e==null||!Bf(t)&&!Lu(e)?t!==t&&e!==e:_z(t,e,Py,r,n,i)}function _z(t,e,r,n,i,o){var s=ni(t),a=ni(e),u=_y,c=_y;s||(u=vn(t),u=u==Ff?gs:u),a||(c=vn(e),c=c==Ff?gs:c);var l=u==gs&&!Cy(t),f=c==gs&&!Cy(e),h=u==c;if(h&&!l)return o||(o=new bn),s||Uz(t)?Dx(t,e,r,n,i,o):kz(t,e,u,r,n,i,o);if(!(i&Ds)){var d=l&&Ki.call(t,"__wrapped__"),m=f&&Ki.call(e,"__wrapped__");if(d||m){var b=d?t.value():t,g=m?e.value():e;return o||(o=new bn),r(b,g,n,i,o)}}return h?(o||(o=new bn),Tz(t,e,r,n,i,o)):!1}function Ez(t,e,r,n){var i=r.length,o=i,s=!n;if(t==null)return!o;for(t=Object(t);i--;){var a=r[i];if(s&&a[2]?a[1]!==t[a[0]]:!(a[0]in t))return!1}for(;++i<o;){a=r[i];var u=a[0],c=t[u],l=a[1];if(s&&a[2]){if(c===void 0&&!(u in t))return!1}else{var f=new bn;if(n)var h=n(c,l,u,t,e,f);if(!(h===void 0?Py(l,c,n,Tf|Ds,f):h))return!1}}return!0}function Cz(t){return typeof t=="function"?t:t==null?Gz:typeof t=="object"?ni(t)?Fz(t[0],t[1]):xz(t):Wz(t)}function Sz(t){return WH(Object(t))}function xz(t){var e=Rz(t);return e.length==1&&e[0][2]?wx(e[0][0],e[0][1]):function(r){return r===t||Ez(r,t,e)}}function Fz(t,e){return jf(t)&&bx(e)?wx(Nf(t),e):function(r){var n=Vz(r,t);return n===void 0&&n===e?Hz(r,t):Py(e,n,void 0,Tf|Ds)}}function gx(t){return function(e){return e?.[t]}}function Oz(t){return function(e){return px(e,t)}}function yx(t){return ni(t)?t:pH(t)}function Az(t){return function(e){var r=vn(e);return r==$u?dx(e):r==Iu?MH(e):BH(e,t(e))}}function Dx(t,e,r,n,i,o){var s=i&Ds,a=t.length,u=e.length;if(a!=u&&!(s&&u>a))return!1;var c=o.get(t);if(c)return c==e;var l=-1,f=!0,h=i&Tf?new kf:void 0;for(o.set(t,e);++l<a;){var d=t[l],m=e[l];if(n)var b=s?n(m,d,l,e,t,o):n(d,m,l,t,e,o);if(b!==void 0){if(b)continue;f=!1;break}if(h){if(!NH(e,function(g,w){if(!h.has(w)&&(d===g||r(d,g,n,i,o)))return h.add(w)})){f=!1;break}}else if(!(d===m||r(d,m,n,i,o))){f=!1;break}}return o.delete(t),f}function kz(t,e,r,n,i,o,s){switch(r){case Of:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case fx:return!(t.byteLength!=e.byteLength||!n(new tx(t),new tx(e)));case ix:case ox:return+t==+e;case sx:return t.name==e.name&&t.message==e.message;case ux:return t!=+t?e!=+e:t==+e;case cx:case Ty:return t==e+"";case $u:var a=dx;case Iu:var u=o&Ds;if(a||(a=qH),t.size!=e.size&&!u)return!1;var c=s.get(t);return c?c==e:(o|=Tf,s.set(t,e),Dx(a(t),a(e),n,i,o,s));case lx:if(wy)return wy.call(t)==wy.call(e)}return!1}function Tz(t,e,r,n,i,o){var s=i&Ds,a=Ay(t),u=a.length,c=Ay(e),l=c.length;if(u!=l&&!s)return!1;for(var f=u;f--;){var h=a[f];if(!(s?h in e:mx(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 g=t[h],w=e[h];if(n)var x=s?n(w,g,h,e,t,o):n(g,w,h,t,e,o);if(!(x===void 0?g===w||r(g,w,n,i,o):x)){m=!1;break}b||(b=h=="constructor")}if(m&&!b){var D=t.constructor,C=e.constructor;D!=C&&"constructor"in t&&"constructor"in e&&!(typeof D=="function"&&D instanceof D&&typeof C=="function"&&C instanceof C)&&(m=!1)}return o.delete(t),m}var Pz=gx("length");function If(t,e){var r=t.__data__;return Nz(e)?r[typeof e=="string"?"string":"hash"]:r.map}function Rz(t){for(var e=zz(t),r=e.length;r--;)e[r][2]=bx(e[r][1]);return e}function vs(t,e){var r=t[e];return Mz(r)?r:void 0}function $z(t){return GH(Object(t))}function vn(t){return Xi.call(t)}(Sy&&vn(new Sy(new ArrayBuffer(1)))!=Of||Af&&vn(new Af)!=$u||xy&&vn(xy.resolve())!=Z1||Fy&&vn(new Fy)!=Iu||Oy&&vn(new Oy)!=Ey)&&(vn=function(t){var e=Xi.call(t),r=e==gs?t.constructor:void 0,n=r?Qi(r):void 0;if(n)switch(n){case KH:return Of;case YH:return $u;case JH:return Z1;case XH:return Iu;case ZH:return Ey}return e});function Iz(t,e,r){e=jf(e,t)?[e]:yx(e);for(var n,i=-1,s=e.length;++i<s;){var o=Nf(e[i]);if(!(n=t!=null&&r(t,o)))break;t=t[o]}if(n)return n;var s=t?t.length:0;return!!s&&Lf(s)&&vx(o,s)&&(ni(t)||Sx(t)||_x(t))}function jz(t){var e=t?t.length:void 0;return Lf(e)&&(ni(t)||Sx(t)||_x(t))?LH(e,String):null}function vx(t,e){return e=e??nx,!!e&&(typeof t=="number"||TH.test(t))&&t>-1&&t%1==0&&t<e}function jf(t,e){if(ni(t))return!1;var r=typeof t;return r=="number"||r=="symbol"||r=="boolean"||t==null||xx(t)?!0:OH.test(t)||!FH.test(t)||e!=null&&t in Object(e)}function Nz(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function Lz(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||Rf;return t===r}function bx(t){return t===t&&!Bf(t)}function wx(t,e){return function(r){return r==null?!1:r[t]===e&&(e!==void 0||t in Object(r))}}function Nf(t){if(typeof t=="string"||xx(t))return t;var e=t+"";return e=="0"&&1/t==-gH?"-0":e}function Qi(t){if(t!=null){try{return hx.call(t)}catch{}try{return t+""}catch{}}return""}function Bz(t,e){return t===e||t!==t&&e!==e}function _x(t){return qz(t)&&Ki.call(t,"callee")&&(!HH.call(t,"callee")||Xi.call(t)==Ff)}var ni=Array.isArray;function Ex(t){return t!=null&&Lf(Pz(t))&&!Cx(t)}function qz(t){return Lu(t)&&Ex(t)}function Cx(t){var e=Bf(t)?Xi.call(t):"";return e==ax||e==yH}function Lf(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=nx}function Bf(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function Lu(t){return!!t&&typeof t=="object"}function Mz(t){if(!Bf(t))return!1;var e=Cx(t)||Cy(t)?VH:kH;return e.test(Qi(t))}function Sx(t){return typeof t=="string"||!ni(t)&&Lu(t)&&Xi.call(t)==Ty}function xx(t){return typeof t=="symbol"||Lu(t)&&Xi.call(t)==lx}function Uz(t){return Lu(t)&&Lf(t.length)&&!!Pe[Xi.call(t)]}function Vz(t,e,r){var n=t==null?void 0:px(t,e);return n===void 0?r:n}function Hz(t,e){return t!=null&&Iz(t,e,wz)}function Ay(t){var e=Lz(t);if(!(e||Ex(t)))return Sz(t);var r=jz(t),n=!!r,i=r||[],o=i.length;for(var s in t)mx(t,s)&&!(n&&(s=="length"||vx(s,o)))&&!(e&&s=="constructor")&&i.push(s);return i}var zz=Az(Ay);function Gz(t){return t}function Wz(t){return jf(t)?gx(Nf(t)):Oz(t)}ys.exports=Cz});var Px=y((eo,bs)=>{var Kz=1/0,Yz="[object Function]",Jz="[object GeneratorFunction]",Xz=/[\\^$.*+?()[\]{}|]/g,Zz=/^\[object .+?Constructor\]$/,Bu={function:!0,object:!0},Qz=Bu[typeof eo]&&eo&&!eo.nodeType?eo:void 0,eG=Bu[typeof bs]&&bs&&!bs.nodeType?bs:void 0,tG=qf(Qz&&eG&&typeof global=="object"&&global),rG=qf(Bu[typeof self]&&self),Ox=qf(Bu[typeof window]&&window),Ry=qf(Bu[typeof eo]&&eo),nG=tG||Ox!==(Ry&&Ry.window)&&Ox||rG||Ry||Function("return this")();function qf(t){return t&&t.Object===Object?t:null}function iG(t){var e=!1;if(t!=null&&typeof t.toString!="function")try{e=!!(t+"")}catch{}return e}function oG(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}var Ax=Object.prototype,kx=Function.prototype.toString,sG=Ax.hasOwnProperty,aG=Ax.toString,uG=RegExp("^"+kx.call(sG).replace(Xz,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),$y=lG(nG,"Set"),cG=$y&&1/oG(new $y([,-0]))[1]==Kz?function(t){return new $y(t)}:pG;function lG(t,e){var r=t[e];return hG(r)?r:void 0}function fG(t){if(t!=null){try{return kx.call(t)}catch{}try{return t+""}catch{}}return""}function dG(t){var e=Tx(t)?aG.call(t):"";return e==Yz||e==Jz}function Tx(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function hG(t){if(!Tx(t))return!1;var e=dG(t)||iG(t)?uG:Zz;return e.test(fG(t))}function pG(){}bs.exports=cG});var $x=y((to,ws)=>{var qu={function:!0,object:!0},mG=qu[typeof to]&&to&&!to.nodeType?to:void 0,gG=qu[typeof ws]&&ws&&!ws.nodeType?ws:void 0,yG=Mf(mG&&gG&&typeof global=="object"&&global),DG=Mf(qu[typeof self]&&self),Rx=Mf(qu[typeof window]&&window),Iy=Mf(qu[typeof to]&&to),vG=yG||Rx!==(Iy&&Iy.window)&&Rx||DG||Iy||Function("return this")();function Mf(t){return t&&t.Object===Object?t:null}ws.exports=vG});var qx=y((Sde,Bx)=>{var bG=Px(),wG=$x(),_G=200,jy="__lodash_hash_undefined__",EG="[object Function]",CG="[object GeneratorFunction]",SG=/[\\^$.*+?()[\]{}|]/g,xG=/^\[object .+?Constructor\]$/;function FG(t,e){return!!t.length&&AG(t,e,0)>-1}function OG(t,e,r){for(var n=-1,i=t.length;++n<i;)if(r(e,t[n]))return!0;return!1}function AG(t,e,r){if(e!==e)return TG(t,r);for(var n=r-1,i=t.length;++n<i;)if(t[n]===e)return n;return-1}function kG(t,e){return t.has(e)}function TG(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 PG(t){var e=!1;if(t!=null&&typeof t.toString!="function")try{e=!!(t+"")}catch{}return e}function RG(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}var $G=Array.prototype,Ix=Object.prototype,jx=Function.prototype.toString,Ny=Ix.hasOwnProperty,IG=Ix.toString,jG=RegExp("^"+jx.call(Ny).replace(SG,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),NG=$G.splice,LG=Nx(wG,"Map"),Mu=Nx(Object,"create");function ro(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function BG(){this.__data__=Mu?Mu(null):{}}function qG(t){return this.has(t)&&delete this.__data__[t]}function MG(t){var e=this.__data__;if(Mu){var r=e[t];return r===jy?void 0:r}return Ny.call(e,t)?e[t]:void 0}function UG(t){var e=this.__data__;return Mu?e[t]!==void 0:Ny.call(e,t)}function VG(t,e){var r=this.__data__;return r[t]=Mu&&e===void 0?jy:e,this}ro.prototype.clear=BG;ro.prototype.delete=qG;ro.prototype.get=MG;ro.prototype.has=UG;ro.prototype.set=VG;function _s(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 HG(){this.__data__=[]}function zG(t){var e=this.__data__,r=Vf(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():NG.call(e,r,1),!0}function GG(t){var e=this.__data__,r=Vf(e,t);return r<0?void 0:e[r][1]}function WG(t){return Vf(this.__data__,t)>-1}function KG(t,e){var r=this.__data__,n=Vf(r,t);return n<0?r.push([t,e]):r[n][1]=e,this}_s.prototype.clear=HG;_s.prototype.delete=zG;_s.prototype.get=GG;_s.prototype.has=WG;_s.prototype.set=KG;function Es(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 YG(){this.__data__={hash:new ro,map:new(LG||_s),string:new ro}}function JG(t){return Hf(this,t).delete(t)}function XG(t){return Hf(this,t).get(t)}function ZG(t){return Hf(this,t).has(t)}function QG(t,e){return Hf(this,t).set(t,e),this}Es.prototype.clear=YG;Es.prototype.delete=JG;Es.prototype.get=XG;Es.prototype.has=ZG;Es.prototype.set=QG;function Uf(t){var e=-1,r=t?t.length:0;for(this.__data__=new Es;++e<r;)this.add(t[e])}function eW(t){return this.__data__.set(t,jy),this}function tW(t){return this.__data__.has(t)}Uf.prototype.add=Uf.prototype.push=eW;Uf.prototype.has=tW;function Vf(t,e){for(var r=t.length;r--;)if(oW(t[r][0],e))return r;return-1}function rW(t,e,r){var n=-1,i=FG,o=t.length,s=!0,a=[],u=a;if(r)s=!1,i=OG;else if(o>=_G){var c=e?null:bG(t);if(c)return RG(c);s=!1,i=kG,u=new Uf}else u=e?[]:a;e:for(;++n<o;){var l=t[n],f=e?e(l):l;if(l=r||l!==0?l:0,s&&f===f){for(var h=u.length;h--;)if(u[h]===f)continue e;e&&u.push(f),a.push(l)}else i(u,f,r)||(u!==a&&u.push(f),a.push(l))}return a}function Hf(t,e){var r=t.__data__;return nW(e)?r[typeof e=="string"?"string":"hash"]:r.map}function Nx(t,e){var r=t[e];return aW(r)?r:void 0}function nW(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function iW(t){if(t!=null){try{return jx.call(t)}catch{}try{return t+""}catch{}}return""}function oW(t,e){return t===e||t!==t&&e!==e}function sW(t){var e=Lx(t)?IG.call(t):"";return e==EG||e==CG}function Lx(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function aW(t){if(!Lx(t))return!1;var e=sW(t)||PG(t)?jG:xG;return e.test(iW(t))}Bx.exports=rW});var Ux=y((xde,Mx)=>{var uW=Fx(),cW=qx();function lW(t,e){return t&&t.length?cW(t,uW(e)):[]}Mx.exports=lW});var Hx=y((Fde,Vx)=>{"use strict";var fW=B1(),dW=Ux(),hW=fW("MultiError");Vx.exports=Ly;function Ly(t){if(!(this instanceof Ly))return new Ly(t);if(t=Array.isArray(t)?t:[t],t=dW(t,function(r){return r.stack}),t.length===1)return t[0];var e=new hW({message:t.map(function(r){return r.message}).join("; "),errors:t.reduce(function(r,n){return r.concat(n.errors||n)},[])});return e.__defineGetter__("stack",function(){return t.map(function(r){return r.stack}).join(`
36
36
 
37
37
  `)}),e.__defineSetter__("stack",function(r){return[r].concat(e.stack).join(`
38
38
 
39
- `)}),e}});var Wx=y((Ode,Gx)=>{var ii=require("constants"),pW=process.cwd,zf=null,mW=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return zf||(zf=pW.call(process)),zf};try{process.cwd()}catch{}typeof process.chdir=="function"&&(By=process.chdir,process.chdir=function(t){zf=null,By.call(process,t)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,By));var By;Gx.exports=gW;function gW(t){ii.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&e(t),t.lutimes||r(t),t.chown=o(t.chown),t.fchown=o(t.fchown),t.lchown=o(t.lchown),t.chmod=n(t.chmod),t.fchmod=n(t.fchmod),t.lchmod=n(t.lchmod),t.chownSync=s(t.chownSync),t.fchownSync=s(t.fchownSync),t.lchownSync=s(t.lchownSync),t.chmodSync=i(t.chmodSync),t.fchmodSync=i(t.fchmodSync),t.lchmodSync=i(t.lchmodSync),t.stat=a(t.stat),t.fstat=a(t.fstat),t.lstat=a(t.lstat),t.statSync=u(t.statSync),t.fstatSync=u(t.fstatSync),t.lstatSync=u(t.lstatSync),t.chmod&&!t.lchmod&&(t.lchmod=function(l,f,h){h&&process.nextTick(h)},t.lchmodSync=function(){}),t.chown&&!t.lchown&&(t.lchown=function(l,f,h,d){d&&process.nextTick(d)},t.lchownSync=function(){}),mW==="win32"&&(t.rename=typeof t.rename!="function"?t.rename:function(l){function f(h,d,m){var b=Date.now(),g=0;l(h,d,function w(x){if(x&&(x.code==="EACCES"||x.code==="EPERM"||x.code==="EBUSY")&&Date.now()-b<6e4){setTimeout(function(){t.stat(d,function(D,C){D&&D.code==="ENOENT"?l(h,d,w):m(x)})},g),g<100&&(g+=10);return}m&&m(x)})}return Object.setPrototypeOf&&Object.setPrototypeOf(f,l),f}(t.rename)),t.read=typeof t.read!="function"?t.read:function(l){function f(h,d,m,b,g,w){var x;if(w&&typeof w=="function"){var D=0;x=function(C,k,$){if(C&&C.code==="EAGAIN"&&D<10)return D++,l.call(t,h,d,m,b,g,x);w.apply(this,arguments)}}return l.call(t,h,d,m,b,g,x)}return Object.setPrototypeOf&&Object.setPrototypeOf(f,l),f}(t.read),t.readSync=typeof t.readSync!="function"?t.readSync:function(l){return function(f,h,d,m,b){for(var g=0;;)try{return l.call(t,f,h,d,m,b)}catch(w){if(w.code==="EAGAIN"&&g<10){g++;continue}throw w}}}(t.readSync);function e(l){l.lchmod=function(f,h,d){l.open(f,ii.O_WRONLY|ii.O_SYMLINK,h,function(m,b){if(m){d&&d(m);return}l.fchmod(b,h,function(g){l.close(b,function(w){d&&d(g||w)})})})},l.lchmodSync=function(f,h){var d=l.openSync(f,ii.O_WRONLY|ii.O_SYMLINK,h),m=!0,b;try{b=l.fchmodSync(d,h),m=!1}finally{if(m)try{l.closeSync(d)}catch{}else l.closeSync(d)}return b}}function r(l){ii.hasOwnProperty("O_SYMLINK")&&l.futimes?(l.lutimes=function(f,h,d,m){l.open(f,ii.O_SYMLINK,function(b,g){if(b){m&&m(b);return}l.futimes(g,h,d,function(w){l.close(g,function(x){m&&m(w||x)})})})},l.lutimesSync=function(f,h,d){var m=l.openSync(f,ii.O_SYMLINK),b,g=!0;try{b=l.futimesSync(m,h,d),g=!1}finally{if(g)try{l.closeSync(m)}catch{}else l.closeSync(m)}return b}):l.futimes&&(l.lutimes=function(f,h,d,m){m&&process.nextTick(m)},l.lutimesSync=function(){})}function n(l){return l&&function(f,h,d){return l.call(t,f,h,function(m){c(m)&&(m=null),d&&d.apply(this,arguments)})}}function i(l){return l&&function(f,h){try{return l.call(t,f,h)}catch(d){if(!c(d))throw d}}}function o(l){return l&&function(f,h,d,m){return l.call(t,f,h,d,function(b){c(b)&&(b=null),m&&m.apply(this,arguments)})}}function s(l){return l&&function(f,h,d){try{return l.call(t,f,h,d)}catch(m){if(!c(m))throw m}}}function a(l){return l&&function(f,h,d){typeof h=="function"&&(d=h,h=null);function m(b,g){g&&(g.uid<0&&(g.uid+=4294967296),g.gid<0&&(g.gid+=4294967296)),d&&d.apply(this,arguments)}return h?l.call(t,f,h,m):l.call(t,f,m)}}function u(l){return l&&function(f,h){var d=h?l.call(t,f,h):l.call(t,f);return d&&(d.uid<0&&(d.uid+=4294967296),d.gid<0&&(d.gid+=4294967296)),d}}function c(l){if(!l||l.code==="ENOSYS")return!0;var f=!process.getuid||process.getuid()!==0;return!!(f&&(l.code==="EINVAL"||l.code==="EPERM"))}}});var Jx=y((Ade,Yx)=>{var Kx=require("stream").Stream;Yx.exports=yW;function yW(t){return{ReadStream:e,WriteStream:r};function e(n,i){if(!(this instanceof e))return new e(n,i);Kx.call(this);var o=this;this.path=n,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=64*1024,i=i||{};for(var s=Object.keys(i),a=0,u=s.length;a<u;a++){var c=s[a];this[c]=i[c]}if(this.encoding&&this.setEncoding(this.encoding),this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.end===void 0)this.end=1/0;else if(typeof this.end!="number")throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}if(this.fd!==null){process.nextTick(function(){o._read()});return}t.open(this.path,this.flags,this.mode,function(l,f){if(l){o.emit("error",l),o.readable=!1;return}o.fd=f,o.emit("open",f),o._read()})}function r(n,i){if(!(this instanceof r))return new r(n,i);Kx.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 Zx=y((kde,Xx)=>{"use strict";Xx.exports=vW;var DW=Object.getPrototypeOf||function(t){return t.__proto__};function vW(t){if(t===null||typeof t!="object")return t;if(t instanceof Object)var e={__proto__:DW(t)};else var e=Object.create(null);return Object.getOwnPropertyNames(t).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}});var ht=y((Tde,Uy)=>{var He=require("fs"),bW=Wx(),wW=Jx(),_W=Zx(),Gf=require("util"),_t,Kf;typeof Symbol=="function"&&typeof Symbol.for=="function"?(_t=Symbol.for("graceful-fs.queue"),Kf=Symbol.for("graceful-fs.previous")):(_t="___graceful-fs.queue",Kf="___graceful-fs.previous");function EW(){}function tF(t,e){Object.defineProperty(t,_t,{get:function(){return e}})}var no=EW;Gf.debuglog?no=Gf.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(no=function(){var t=Gf.format.apply(Gf,arguments);t="GFS4: "+t.split(/\n/).join(`
40
- GFS4: `),console.error(t)});He[_t]||(Qx=global[_t]||[],tF(He,Qx),He.close=function(t){function e(r,n){return t.call(He,r,function(i){i||eF(),typeof n=="function"&&n.apply(this,arguments)})}return Object.defineProperty(e,Kf,{value:t}),e}(He.close),He.closeSync=function(t){function e(r){t.apply(He,arguments),eF()}return Object.defineProperty(e,Kf,{value:t}),e}(He.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){no(He[_t]),require("assert").equal(He[_t].length,0)}));var Qx;global[_t]||tF(global,He[_t]);Uy.exports=qy(_W(He));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!He.__patched&&(Uy.exports=qy(He),He.__patched=!0);function qy(t){bW(t),t.gracefulify=qy,t.createReadStream=k,t.createWriteStream=$;var e=t.readFile;t.readFile=r;function r(S,I,R){return typeof I=="function"&&(R=I,I=null),B(S,I,R);function B(q,K,M,E){return e(q,K,function(v){v&&(v.code==="EMFILE"||v.code==="ENFILE")?Cs([B,[q,K,M],v,E||Date.now(),Date.now()]):typeof M=="function"&&M.apply(this,arguments)})}}var n=t.writeFile;t.writeFile=i;function i(S,I,R,B){return typeof R=="function"&&(B=R,R=null),q(S,I,R,B);function q(K,M,E,v,_){return n(K,M,E,function(O){O&&(O.code==="EMFILE"||O.code==="ENFILE")?Cs([q,[K,M,E,v],O,_||Date.now(),Date.now()]):typeof v=="function"&&v.apply(this,arguments)})}}var o=t.appendFile;o&&(t.appendFile=s);function s(S,I,R,B){return typeof R=="function"&&(B=R,R=null),q(S,I,R,B);function q(K,M,E,v,_){return o(K,M,E,function(O){O&&(O.code==="EMFILE"||O.code==="ENFILE")?Cs([q,[K,M,E,v],O,_||Date.now(),Date.now()]):typeof v=="function"&&v.apply(this,arguments)})}}var a=t.copyFile;a&&(t.copyFile=u);function u(S,I,R,B){return typeof R=="function"&&(B=R,R=0),q(S,I,R,B);function q(K,M,E,v,_){return a(K,M,E,function(O){O&&(O.code==="EMFILE"||O.code==="ENFILE")?Cs([q,[K,M,E,v],O,_||Date.now(),Date.now()]):typeof v=="function"&&v.apply(this,arguments)})}}var c=t.readdir;t.readdir=f;var l=/^v[0-5]\./;function f(S,I,R){typeof I=="function"&&(R=I,I=null);var B=l.test(process.version)?function(M,E,v,_){return c(M,q(M,E,v,_))}:function(M,E,v,_){return c(M,E,q(M,E,v,_))};return B(S,I,R);function q(K,M,E,v){return function(_,O){_&&(_.code==="EMFILE"||_.code==="ENFILE")?Cs([B,[K,M,E],_,v||Date.now(),Date.now()]):(O&&O.sort&&O.sort(),typeof E=="function"&&E.call(this,_,O))}}}if(process.version.substr(0,4)==="v0.8"){var h=wW(t);w=h.ReadStream,D=h.WriteStream}var d=t.ReadStream;d&&(w.prototype=Object.create(d.prototype),w.prototype.open=x);var m=t.WriteStream;m&&(D.prototype=Object.create(m.prototype),D.prototype.open=C),Object.defineProperty(t,"ReadStream",{get:function(){return w},set:function(S){w=S},enumerable:!0,configurable:!0}),Object.defineProperty(t,"WriteStream",{get:function(){return D},set:function(S){D=S},enumerable:!0,configurable:!0});var b=w;Object.defineProperty(t,"FileReadStream",{get:function(){return b},set:function(S){b=S},enumerable:!0,configurable:!0});var g=D;Object.defineProperty(t,"FileWriteStream",{get:function(){return g},set:function(S){g=S},enumerable:!0,configurable:!0});function w(S,I){return this instanceof w?(d.apply(this,arguments),this):w.apply(Object.create(w.prototype),arguments)}function x(){var S=this;L(S.path,S.flags,S.mode,function(I,R){I?(S.autoClose&&S.destroy(),S.emit("error",I)):(S.fd=R,S.emit("open",R),S.read())})}function D(S,I){return this instanceof D?(m.apply(this,arguments),this):D.apply(Object.create(D.prototype),arguments)}function C(){var S=this;L(S.path,S.flags,S.mode,function(I,R){I?(S.destroy(),S.emit("error",I)):(S.fd=R,S.emit("open",R))})}function k(S,I){return new t.ReadStream(S,I)}function $(S,I){return new t.WriteStream(S,I)}var F=t.open;t.open=L;function L(S,I,R,B){return typeof R=="function"&&(B=R,R=null),q(S,I,R,B);function q(K,M,E,v,_){return F(K,M,E,function(O,j){O&&(O.code==="EMFILE"||O.code==="ENFILE")?Cs([q,[K,M,E,v],O,_||Date.now(),Date.now()]):typeof v=="function"&&v.apply(this,arguments)})}}return t}function Cs(t){no("ENQUEUE",t[0].name,t[1]),He[_t].push(t),My()}var Wf;function eF(){for(var t=Date.now(),e=0;e<He[_t].length;++e)He[_t][e].length>2&&(He[_t][e][3]=t,He[_t][e][4]=t);My()}function My(){if(clearTimeout(Wf),Wf=void 0,He[_t].length!==0){var t=He[_t].shift(),e=t[0],r=t[1],n=t[2],i=t[3],o=t[4];if(i===void 0)no("RETRY",e.name,r),e.apply(null,r);else if(Date.now()-i>=6e4){no("TIMEOUT",e.name,r);var s=r.pop();typeof s=="function"&&s.call(null,n)}else{var a=Date.now()-o,u=Math.max(o-i,1),c=Math.min(u*1.2,100);a>=c?(no("RETRY",e.name,r),e.apply(null,r.concat([i]))):He[_t].push(t)}Wf===void 0&&(Wf=setTimeout(My,0))}}});var nF=y((Pde,rF)=>{function Dr(t,e){typeof e=="boolean"&&(e={forever:e}),this._originalTimeouts=JSON.parse(JSON.stringify(t)),this._timeouts=t,this._options=e||{},this._maxRetryTime=e&&e.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}rF.exports=Dr;Dr.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts};Dr.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timeouts=[],this._cachedTimeouts=null};Dr.prototype.retry=function(t){if(this._timeout&&clearTimeout(this._timeout),!t)return!1;var e=new Date().getTime();if(t&&e-this._operationStart>=this._maxRetryTime)return this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(t);var r=this._timeouts.shift();if(r===void 0)if(this._cachedTimeouts)this._errors.splice(this._errors.length-1,this._errors.length),this._timeouts=this._cachedTimeouts.slice(0),r=this._timeouts.shift();else return!1;var n=this,i=setTimeout(function(){n._attempts++,n._operationTimeoutCb&&(n._timeout=setTimeout(function(){n._operationTimeoutCb(n._attempts)},n._operationTimeout),n._options.unref&&n._timeout.unref()),n._fn(n._attempts)},r);return this._options.unref&&i.unref(),!0};Dr.prototype.attempt=function(t,e){this._fn=t,e&&(e.timeout&&(this._operationTimeout=e.timeout),e.cb&&(this._operationTimeoutCb=e.cb));var r=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){r._operationTimeoutCb()},r._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)};Dr.prototype.try=function(t){console.log("Using RetryOperation.try() is deprecated"),this.attempt(t)};Dr.prototype.start=function(t){console.log("Using RetryOperation.start() is deprecated"),this.attempt(t)};Dr.prototype.start=Dr.prototype.try;Dr.prototype.errors=function(){return this._errors};Dr.prototype.attempts=function(){return this._attempts};Dr.prototype.mainError=function(){if(this._errors.length===0)return null;for(var t={},e=null,r=0,n=0;n<this._errors.length;n++){var i=this._errors[n],o=i.message,s=(t[o]||0)+1;t[o]=s,s>=r&&(e=i,r=s)}return e}});var iF=y(io=>{var CW=nF();io.operation=function(t){var e=io.timeouts(t);return new CW(e,{forever:t&&t.forever,unref:t&&t.unref,maxRetryTime:t&&t.maxRetryTime})};io.timeouts=function(t){if(t instanceof Array)return[].concat(t);var e={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var r in t)e[r]=t[r];if(e.minTimeout>e.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var n=[],i=0;i<e.retries;i++)n.push(this.createTimeout(i,e));return t&&t.forever&&!n.length&&n.push(this.createTimeout(i,e)),n.sort(function(o,s){return o-s}),n};io.createTimeout=function(t,e){var r=e.randomize?Math.random()+1:1,n=Math.round(r*e.minTimeout*Math.pow(e.factor,t));return n=Math.min(n,e.maxTimeout),n};io.wrap=function(t,e,r){if(e instanceof Array&&(r=e,e=null),!r){r=[];for(var n in t)typeof t[n]=="function"&&r.push(n)}for(var i=0;i<r.length;i++){var o=r[i],s=t[o];t[o]=function(u){var c=io.operation(e),l=Array.prototype.slice.call(arguments,1),f=l.pop();l.push(function(h){c.retry(h)||(h&&(arguments[0]=c.mainError()),f.apply(this,arguments))}),c.attempt(function(){u.apply(t,l)})}.bind(t,s),t[o].options=e}}});var sF=y(($de,oF)=>{oF.exports=iF()});var aF=y((Ide,Yf)=>{Yf.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];process.platform!=="win32"&&Yf.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&Yf.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")});var zy=y((jde,Fs)=>{var Be=global.process,oo=function(t){return t&&typeof t=="object"&&typeof t.removeListener=="function"&&typeof t.emit=="function"&&typeof t.reallyExit=="function"&&typeof t.listeners=="function"&&typeof t.kill=="function"&&typeof t.pid=="number"&&typeof t.on=="function"};oo(Be)?(uF=require("assert"),Ss=aF(),cF=/^win/i.test(Be.platform),Uu=require("events"),typeof Uu!="function"&&(Uu=Uu.EventEmitter),Be.__signal_exit_emitter__?pt=Be.__signal_exit_emitter__:(pt=Be.__signal_exit_emitter__=new Uu,pt.count=0,pt.emitted={}),pt.infinite||(pt.setMaxListeners(1/0),pt.infinite=!0),Fs.exports=function(t,e){if(!oo(global.process))return function(){};uF.equal(typeof t,"function","a callback must be provided for exit handler"),xs===!1&&Vy();var r="exit";e&&e.alwaysLast&&(r="afterexit");var n=function(){pt.removeListener(r,t),pt.listeners("exit").length===0&&pt.listeners("afterexit").length===0&&Jf()};return pt.on(r,t),n},Jf=function(){!xs||!oo(global.process)||(xs=!1,Ss.forEach(function(e){try{Be.removeListener(e,Xf[e])}catch{}}),Be.emit=Zf,Be.reallyExit=Hy,pt.count-=1)},Fs.exports.unload=Jf,so=function(e,r,n){pt.emitted[e]||(pt.emitted[e]=!0,pt.emit(e,r,n))},Xf={},Ss.forEach(function(t){Xf[t]=function(){if(oo(global.process)){var r=Be.listeners(t);r.length===pt.count&&(Jf(),so("exit",null,t),so("afterexit",null,t),cF&&t==="SIGHUP"&&(t="SIGINT"),Be.kill(Be.pid,t))}}}),Fs.exports.signals=function(){return Ss},xs=!1,Vy=function(){xs||!oo(global.process)||(xs=!0,pt.count+=1,Ss=Ss.filter(function(e){try{return Be.on(e,Xf[e]),!0}catch{return!1}}),Be.emit=fF,Be.reallyExit=lF)},Fs.exports.load=Vy,Hy=Be.reallyExit,lF=function(e){oo(global.process)&&(Be.exitCode=e||0,so("exit",Be.exitCode,null),so("afterexit",Be.exitCode,null),Hy.call(Be,Be.exitCode))},Zf=Be.emit,fF=function(e,r){if(e==="exit"&&oo(global.process)){r!==void 0&&(Be.exitCode=r);var n=Zf.apply(this,arguments);return so("exit",Be.exitCode,null),so("afterexit",Be.exitCode,null),n}else return Zf.apply(this,arguments)}):Fs.exports=function(){return function(){}};var uF,Ss,cF,Uu,pt,Jf,so,Xf,xs,Vy,Hy,lF,Zf,fF});var hF=y((Nde,Gy)=>{"use strict";var dF=Symbol();function SW(t,e,r){let n=e[dF];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,dF,{value:u}),r(null,a.mtime,u)})})}function xW(t){let e=Date.now();return t==="s"&&(e=Math.ceil(e/1e3)*1e3),new Date(e)}Gy.exports.probe=SW;Gy.exports.getMtime=xW});var DF=y((Lde,Hu)=>{"use strict";var FW=require("path"),Yy=ht(),OW=sF(),AW=zy(),pF=hF(),_n={};function Vu(t,e){return e.lockfilePath||`${t}.lock`}function Jy(t,e,r){if(!e.realpath)return r(null,FW.resolve(t));e.fs.realpath(t,r)}function Ky(t,e,r){let n=Vu(t,e);e.fs.mkdir(n,i=>{if(!i)return pF.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"?Ky(t,{...e,stale:0},r):r(o);if(!mF(s,e))return r(Object.assign(new Error("Lock file is already being held"),{code:"ELOCKED",file:t}));gF(t,e,a=>{if(a)return r(a);Ky(t,{...e,stale:0},r)})})})}function mF(t,e){return t.mtime.getTime()<Date.now()-e.stale}function gF(t,e,r){e.fs.rmdir(Vu(t,e),n=>{if(n&&n.code!=="ENOENT")return r(n);r()})}function Qf(t,e){let r=_n[t];r.updateTimeout||(r.updateDelay=r.updateDelay||e.update,r.updateTimeout=setTimeout(()=>{r.updateTimeout=null,e.fs.stat(r.lockfilePath,(n,i)=>{let o=r.lastUpdate+e.stale<Date.now();if(n)return n.code==="ENOENT"||o?Wy(t,r,Object.assign(n,{code:"ECOMPROMISED"})):(r.updateDelay=1e3,Qf(t,e));if(!(r.mtime.getTime()===i.mtime.getTime()))return Wy(t,r,Object.assign(new Error("Unable to update lock within the stale threshold"),{code:"ECOMPROMISED"}));let a=pF.getMtime(r.mtimePrecision);e.fs.utimes(r.lockfilePath,a,a,u=>{let c=r.lastUpdate+e.stale<Date.now();if(!r.released){if(u)return u.code==="ENOENT"||c?Wy(t,r,Object.assign(u,{code:"ECOMPROMISED"})):(r.updateDelay=1e3,Qf(t,e));r.mtime=a,r.lastUpdate=Date.now(),r.updateDelay=null,Qf(t,e)}})})},r.updateDelay),r.updateTimeout.unref&&r.updateTimeout.unref())}function Wy(t,e,r){e.released=!0,e.updateTimeout&&clearTimeout(e.updateTimeout),_n[t]===e&&delete _n[t],e.options.onCompromised(r)}function kW(t,e,r){e={stale:1e4,update:null,realpath:!0,retries:0,fs:Yy,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),Jy(t,e,(n,i)=>{if(n)return r(n);let o=OW.operation(e.retries);o.attempt(()=>{Ky(i,e,(s,a,u)=>{if(o.retry(s))return;if(s)return r(o.mainError());let c=_n[i]={lockfilePath:Vu(i,e),mtime:a,mtimePrecision:u,options:e,lastUpdate:Date.now()};Qf(i,e),r(null,l=>{if(c.released)return l&&l(Object.assign(new Error("Lock is already released"),{code:"ERELEASED"}));yF(i,{...e,realpath:!1},l)})})})})}function yF(t,e,r){e={fs:Yy,realpath:!0,...e},Jy(t,e,(n,i)=>{if(n)return r(n);let o=_n[i];if(!o)return r(Object.assign(new Error("Lock is not acquired/owned by you"),{code:"ENOTACQUIRED"}));o.updateTimeout&&clearTimeout(o.updateTimeout),o.released=!0,delete _n[i],gF(i,e,r)})}function TW(t,e,r){e={stale:1e4,realpath:!0,fs:Yy,...e},e.stale=Math.max(e.stale||0,2e3),Jy(t,e,(n,i)=>{if(n)return r(n);e.fs.stat(Vu(i,e),(o,s)=>o?o.code==="ENOENT"?r(null,!1):r(o):r(null,!mF(s,e)))})}function PW(){return _n}AW(()=>{for(let t in _n){let e=_n[t].options;try{e.fs.rmdirSync(Vu(t,e))}catch{}}});Hu.exports.lock=kW;Hu.exports.unlock=yF;Hu.exports.check=TW;Hu.exports.getLocks=PW});var bF=y((Bde,vF)=>{"use strict";var RW=ht();function $W(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 IW(t){return(...e)=>new Promise((r,n)=>{e.push((i,o)=>{i?n(i):r(o)}),t(...e)})}function jW(t){return(...e)=>{let r,n;if(e.push((i,o)=>{r=i,n=o}),t(...e),r)throw r;return n}}function NW(t){if(t={...t},t.fs=$W(t.fs||RW),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}vF.exports={toPromise:IW,toSync:jW,toSyncOptions:NW}});var _F=y((qde,oi)=>{"use strict";var Os=DF(),{toPromise:ed,toSync:td,toSyncOptions:Xy}=bF();async function wF(t,e){let r=await ed(Os.lock)(t,e);return ed(r)}function LW(t,e){let r=td(Os.lock)(t,Xy(e));return td(r)}function BW(t,e){return ed(Os.unlock)(t,e)}function qW(t,e){return td(Os.unlock)(t,Xy(e))}function MW(t,e){return ed(Os.check)(t,e)}function UW(t,e){return td(Os.check)(t,Xy(e))}oi.exports=wF;oi.exports.lock=wF;oi.exports.unlock=BW;oi.exports.lockSync=LW;oi.exports.unlockSync=qW;oi.exports.check=MW;oi.exports.checkSync=UW});var FF=y(As=>{"use strict";Object.defineProperty(As,"__esModule",{value:!0});As.canStoreURLs=As.FileUrlStorage=void 0;var EF=require("fs"),VW=zW(zx()),CF=HW(_F());function xF(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,r=new WeakMap;return(xF=function(n){return n?r:e})(t)}function HW(t,e){if(!e&&t&&t.__esModule)return t;if(t===null||typeof t!="object"&&typeof t!="function")return{default:t};var r=xF(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 zW(t){return t&&t.__esModule?t:{default:t}}function zu(t){"@babel/helpers - typeof";return zu=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},zu(t)}function GW(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function SF(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,KW(n.key),n)}}function WW(t,e,r){return e&&SF(t.prototype,e),r&&SF(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function KW(t){var e=YW(t,"string");return zu(e)=="symbol"?e:e+""}function YW(t,e){if(zu(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(zu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Mde=As.canStoreURLs=!0,Ude=As.FileUrlStorage=function(){function t(e){GW(this,t),this.path=e}return WW(t,[{key:"findAllUploads",value:function(){var r=this;return new Promise(function(n,i){r._getItems("tus::",function(o,s){o?i(o):n(s)})})}},{key:"findUploadsByFingerprint",value:function(r){var n=this;return new Promise(function(i,o){n._getItems("tus::".concat(r),function(s,a){s?o(s):i(a)})})}},{key:"removeUpload",value:function(r){var n=this;return new Promise(function(i,o){n._removeItem(r,function(s){s?o(s):i()})})}},{key:"addUpload",value:function(r,n){var i=this,o=Math.round(Math.random()*1e12),s="tus::".concat(r,"::").concat(o);return new Promise(function(a,u){i._setItem(s,n,function(c){c?u(c):a(s)})})}},{key:"_setItem",value:function(r,n,i){var o=this;CF.lock(this.path,this._lockfileOptions()).then(function(s){i=o._releaseAndCb(s,i),o._getData(function(a,u){if(a){i(a);return}u[r]=n,o._writeData(u,function(c){return i(c)})})}).catch(i)}},{key:"_getItems",value:function(r,n){this._getData(function(i,o){if(i){n(i);return}var s=Object.keys(o).filter(function(a){return a.startsWith(r)}).map(function(a){var u=o[a];return u.urlStorageKey=a,u});n(null,s)})}},{key:"_removeItem",value:function(r,n){var i=this;CF.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,VW.default)([i,o]))});return}r().then(n).catch(n)}}},{key:"_writeData",value:function(r,n){var i={encoding:"utf8",mode:432,flag:"w"};(0,EF.writeFile)(this.path,JSON.stringify(r),i,function(o){return n(o)})}},{key:"_getData",value:function(r){(0,EF.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 eD=y(Gt=>{"use strict";Object.defineProperty(Gt,"__esModule",{value:!0});Object.defineProperty(Gt,"DefaultHttpStack",{enumerable:!0,get:function(){return TF.default}});Object.defineProperty(Gt,"DetailedError",{enumerable:!0,get:function(){return JW.default}});Object.defineProperty(Gt,"FileUrlStorage",{enumerable:!0,get:function(){return PF.FileUrlStorage}});Object.defineProperty(Gt,"StreamSource",{enumerable:!0,get:function(){return tK.default}});Gt.Upload=void 0;Object.defineProperty(Gt,"canStoreURLs",{enumerable:!0,get:function(){return PF.canStoreURLs}});Gt.defaultOptions=void 0;Object.defineProperty(Gt,"enableDebugLog",{enumerable:!0,get:function(){return XW.enableDebugLog}});Gt.isSupported=void 0;var JW=ao(Gg()),XW=Wg(),ZW=ao(FS()),Zy=ao(n1()),QW=ao(g1()),eK=ao(b1()),TF=ao($1()),tK=ao(uy()),PF=FF();function ao(t){return t&&t.__esModule?t:{default:t}}function Ts(t){"@babel/helpers - typeof";return Ts=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},Ts(t)}function rK(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function OF(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 nK(t,e,r){return e&&OF(t.prototype,e),r&&OF(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function iK(t,e,r){return e=rd(e),oK(t,RF()?Reflect.construct(e,r||[],rd(t).constructor):e.apply(t,r))}function oK(t,e){if(e&&(Ts(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return sK(t)}function sK(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function RF(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(RF=function(){return!!t})()}function rd(t){return rd=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},rd(t)}function aK(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&&Qy(t,e)}function Qy(t,e){return Qy=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Qy(t,e)}function AF(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 ks(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?AF(Object(r),!0).forEach(function(n){uK(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):AF(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function uK(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 $F(t){var e=cK(t,"string");return Ts(e)=="symbol"?e:e+""}function cK(t,e){if(Ts(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Ts(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var kF=Gt.defaultOptions=ks(ks({},Zy.default.defaultOptions),{},{httpStack:new TF.default,fileReader:new QW.default,urlStorage:new ZW.default,fingerprint:eK.default}),Hde=Gt.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 rK(this,e),n=ks(ks({},kF),n),iK(this,e,[r,n])}return aK(e,t),nK(e,null,[{key:"terminate",value:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return i=ks(ks({},kF),i),Zy.default.terminate(n,i)}}])}(Zy.default),zde=Gt.isSupported=!0});var En={};mn(En,{__addDisposableResource:()=>t2,__assign:()=>nd,__asyncDelegator:()=>WF,__asyncGenerator:()=>GF,__asyncValues:()=>KF,__await:()=>Ps,__awaiter:()=>qF,__classPrivateFieldGet:()=>ZF,__classPrivateFieldIn:()=>e2,__classPrivateFieldSet:()=>QF,__createBinding:()=>od,__decorate:()=>NF,__disposeResources:()=>r2,__esDecorate:()=>lK,__exportStar:()=>UF,__extends:()=>IF,__generator:()=>MF,__importDefault:()=>XF,__importStar:()=>JF,__makeTemplateObject:()=>YF,__metadata:()=>BF,__param:()=>LF,__propKey:()=>dK,__read:()=>rD,__rest:()=>jF,__runInitializers:()=>fK,__setFunctionName:()=>hK,__spread:()=>VF,__spreadArray:()=>zF,__spreadArrays:()=>HF,__values:()=>id,default:()=>gK});function IF(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");tD(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}function jF(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 LF(t,e){return function(r,n){e(r,n,t)}}function lK(t,e,r,n,i,o){function s(w){if(w!==void 0&&typeof w!="function")throw new TypeError("Function expected");return w}for(var a=n.kind,u=a==="getter"?"get":a==="setter"?"set":"value",c=!e&&t?n.static?t:t.prototype:null,l=e||(c?Object.getOwnPropertyDescriptor(c,n.name):{}),f,h=!1,d=r.length-1;d>=0;d--){var 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(w){if(h)throw new TypeError("Cannot add initializers after decoration has completed");o.push(s(w||null))};var g=(0,r[d])(a==="accessor"?{get:l.get,set:l.set}:l[u],m);if(a==="accessor"){if(g===void 0)continue;if(g===null||typeof g!="object")throw new TypeError("Object expected");(f=s(g.get))&&(l.get=f),(f=s(g.set))&&(l.set=f),(f=s(g.init))&&i.unshift(f)}else(f=s(g))&&(a==="field"?i.unshift(f):l[u]=f)}c&&Object.defineProperty(c,n.name,l),h=!0}function fK(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 dK(t){return typeof t=="symbol"?t:"".concat(t)}function hK(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 BF(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function qF(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(l){try{c(n.next(l))}catch(f){s(f)}}function u(l){try{c(n.throw(l))}catch(f){s(f)}}function c(l){l.done?o(l.value):i(l.value).then(a,u)}c((n=n.apply(t,e||[])).next())})}function MF(t,e){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,s=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(c){return function(l){return u([c,l])}}function u(c){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,c[0]&&(r=0)),r;)try{if(n=1,i&&(o=c[0]&2?i.return:c[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,c[1])).done)return o;switch(i=0,o&&(c=[c[0]&2,o.value]),c[0]){case 0:case 1:o=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,i=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]<o[3])){r.label=c[1];break}if(c[0]===6&&r.label<o[1]){r.label=o[1],o=c;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(c);break}o[2]&&r.ops.pop(),r.trys.pop();continue}c=e.call(t,r)}catch(l){c=[6,l],i=0}finally{n=o=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function UF(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&od(e,t,r)}function id(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function rD(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,o=[],s;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(a){s={error:a}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return o}function VF(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(rD(arguments[e]));return t}function HF(){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 zF(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 Ps(t){return this instanceof Ps?(this.v=t,this):new Ps(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(g,w){o.push([d,b,g,w])>1||u(d,b)})},m&&(i[d]=m(i[d])))}function u(d,m){try{c(n[d](m))}catch(b){h(o[0][3],b)}}function c(d){d.value instanceof Ps?Promise.resolve(d.value.v).then(l,f):h(o[0][2],d)}function l(d){u("next",d)}function f(d){u("throw",d)}function h(d,m){d(m),o.shift(),o.length&&u(o[0][0],o[0][1])}}function WF(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:Ps(t[i](s)),done:!1}:o?o(s):s}:o}}function KF(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof id=="function"?id(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(o){r[o]=t[o]&&function(s){return new Promise(function(a,u){s=t[o](s),i(a,u,s.done,s.value)})}}function i(o,s,a,u){Promise.resolve(u).then(function(c){o({value:c,done:a})},s)}}function YF(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function JF(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&od(e,t,r);return pK(e,t),e}function XF(t){return t&&t.__esModule?t:{default:t}}function ZF(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 QF(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 t2(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 r2(t){function e(o){t.error=t.hasError?new mK(o,t.error,"An error was suppressed during disposal."):o,t.hasError=!0}var r,n=0;function i(){for(;r=t.stack.pop();)try{if(!r.async&&n===1)return n=0,t.stack.push(r),Promise.resolve().then(i);if(r.dispose){var o=r.dispose.call(r.value);if(r.async)return n|=2,Promise.resolve(o).then(i,function(s){return e(s),i()})}else n|=1}catch(s){e(s)}if(n===1)return t.hasError?Promise.reject(t.error):Promise.resolve();if(t.hasError)throw t.error}return i()}var tD,nd,od,pK,mK,gK,Cn=ct(()=>{tD=function(t,e){return tD=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])},tD(t,e)};nd=function(){return nd=Object.assign||function(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},nd.apply(this,arguments)};od=Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]};pK=Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e};mK=typeof SuppressedError=="function"?SuppressedError:function(t,e,r){var n=new Error(r);return n.name="SuppressedError",n.error=t,n.suppressed=e,n};gK={__extends:IF,__assign:nd,__rest:jF,__decorate:NF,__param:LF,__metadata:BF,__awaiter:qF,__generator:MF,__createBinding:od,__exportStar:UF,__values:id,__read:rD,__spread:VF,__spreadArrays:HF,__spreadArray:zF,__await:Ps,__asyncGenerator:GF,__asyncDelegator:WF,__asyncValues:KF,__makeTemplateObject:YF,__importStar:JF,__importDefault:XF,__classPrivateFieldGet:ZF,__classPrivateFieldSet:QF,__classPrivateFieldIn:e2,__addDisposableResource:t2,__disposeResources:r2}});var S2={};mn(S2,{__addDisposableResource:()=>E2,__assign:()=>sd,__asyncDelegator:()=>m2,__asyncGenerator:()=>p2,__asyncValues:()=>g2,__await:()=>Rs,__awaiter:()=>u2,__classPrivateFieldGet:()=>b2,__classPrivateFieldIn:()=>_2,__classPrivateFieldSet:()=>w2,__createBinding:()=>ud,__decorate:()=>o2,__disposeResources:()=>C2,__esDecorate:()=>yK,__exportStar:()=>l2,__extends:()=>n2,__generator:()=>c2,__importDefault:()=>v2,__importStar:()=>D2,__makeTemplateObject:()=>y2,__metadata:()=>a2,__param:()=>s2,__propKey:()=>vK,__read:()=>iD,__rest:()=>i2,__runInitializers:()=>DK,__setFunctionName:()=>bK,__spread:()=>f2,__spreadArray:()=>h2,__spreadArrays:()=>d2,__values:()=>ad,default:()=>EK});function n2(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");nD(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}function i2(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 o2(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 s2(t,e){return function(r,n){e(r,n,t)}}function yK(t,e,r,n,i,o){function s(w){if(w!==void 0&&typeof w!="function")throw new TypeError("Function expected");return w}for(var a=n.kind,u=a==="getter"?"get":a==="setter"?"set":"value",c=!e&&t?n.static?t:t.prototype:null,l=e||(c?Object.getOwnPropertyDescriptor(c,n.name):{}),f,h=!1,d=r.length-1;d>=0;d--){var 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(w){if(h)throw new TypeError("Cannot add initializers after decoration has completed");o.push(s(w||null))};var g=(0,r[d])(a==="accessor"?{get:l.get,set:l.set}:l[u],m);if(a==="accessor"){if(g===void 0)continue;if(g===null||typeof g!="object")throw new TypeError("Object expected");(f=s(g.get))&&(l.get=f),(f=s(g.set))&&(l.set=f),(f=s(g.init))&&i.unshift(f)}else(f=s(g))&&(a==="field"?i.unshift(f):l[u]=f)}c&&Object.defineProperty(c,n.name,l),h=!0}function DK(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 vK(t){return typeof t=="symbol"?t:"".concat(t)}function bK(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 a2(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function u2(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(l){try{c(n.next(l))}catch(f){s(f)}}function u(l){try{c(n.throw(l))}catch(f){s(f)}}function c(l){l.done?o(l.value):i(l.value).then(a,u)}c((n=n.apply(t,e||[])).next())})}function 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;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(c){return function(l){return u([c,l])}}function u(c){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,c[0]&&(r=0)),r;)try{if(n=1,i&&(o=c[0]&2?i.return:c[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,c[1])).done)return o;switch(i=0,o&&(c=[c[0]&2,o.value]),c[0]){case 0:case 1:o=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,i=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]<o[3])){r.label=c[1];break}if(c[0]===6&&r.label<o[1]){r.label=o[1],o=c;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(c);break}o[2]&&r.ops.pop(),r.trys.pop();continue}c=e.call(t,r)}catch(l){c=[6,l],i=0}finally{n=o=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function l2(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&ud(e,t,r)}function ad(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function iD(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 f2(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(iD(arguments[e]));return t}function d2(){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 h2(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 Rs(t){return this instanceof Rs?(this.v=t,this):new Rs(t)}function p2(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(t,e||[]),i,o=[];return i={},s("next"),s("throw"),s("return"),i[Symbol.asyncIterator]=function(){return this},i;function s(h){n[h]&&(i[h]=function(d){return new Promise(function(m,b){o.push([h,d,m,b])>1||a(h,d)})})}function a(h,d){try{u(n[h](d))}catch(m){f(o[0][3],m)}}function u(h){h.value instanceof Rs?Promise.resolve(h.value.v).then(c,l):f(o[0][2],h)}function c(h){a("next",h)}function l(h){a("throw",h)}function f(h,d){h(d),o.shift(),o.length&&a(o[0][0],o[0][1])}}function m2(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:Rs(t[i](s)),done:!1}:o?o(s):s}:o}}function g2(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof ad=="function"?ad(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(o){r[o]=t[o]&&function(s){return new Promise(function(a,u){s=t[o](s),i(a,u,s.done,s.value)})}}function i(o,s,a,u){Promise.resolve(u).then(function(c){o({value:c,done:a})},s)}}function y2(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function D2(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&ud(e,t,r);return wK(e,t),e}function v2(t){return t&&t.__esModule?t:{default:t}}function b2(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 w2(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 _2(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 E2(t,e,r){if(e!=null){if(typeof e!="object"&&typeof e!="function")throw new TypeError("Object expected.");var n;if(r){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");n=e[Symbol.asyncDispose]}if(n===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");n=e[Symbol.dispose]}if(typeof n!="function")throw new TypeError("Object not disposable.");t.stack.push({value:e,dispose:n,async:r})}else r&&t.stack.push({async:!0});return e}function C2(t){function e(n){t.error=t.hasError?new _K(n,t.error,"An error was suppressed during disposal."):n,t.hasError=!0}function r(){for(;t.stack.length;){var n=t.stack.pop();try{var i=n.dispose&&n.dispose.call(n.value);if(n.async)return Promise.resolve(i).then(r,function(o){return e(o),r()})}catch(o){e(o)}}if(t.hasError)throw t.error}return r()}var nD,sd,ud,wK,_K,EK,x2=ct(()=>{nD=function(t,e){return nD=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])},nD(t,e)};sd=function(){return sd=Object.assign||function(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},sd.apply(this,arguments)};ud=Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]};wK=Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e};_K=typeof SuppressedError=="function"?SuppressedError:function(t,e,r){var n=new Error(r);return n.name="SuppressedError",n.error=t,n.suppressed=e,n};EK={__extends:n2,__assign:sd,__rest:i2,__decorate:o2,__param:s2,__metadata:a2,__awaiter:u2,__generator:c2,__createBinding:ud,__exportStar:l2,__values:ad,__read:iD,__spread:f2,__spreadArrays:d2,__spreadArray:h2,__await:Rs,__asyncGenerator:p2,__asyncDelegator:m2,__asyncValues:g2,__makeTemplateObject:y2,__importStar:D2,__importDefault:v2,__classPrivateFieldGet:b2,__classPrivateFieldSet:w2,__classPrivateFieldIn:_2,__addDisposableResource:E2,__disposeResources:C2}});var Wt=y(oD=>{"use strict";oD.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})};oD.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 Gu=y(si=>{"use strict";var F2=Wt().fromCallback,Pt=ht(),CK=["access","appendFile","chmod","chown","close","copyFile","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","lchmod","lchown","link","lstat","mkdir","mkdtemp","open","opendir","readdir","readFile","readlink","realpath","rename","rm","rmdir","stat","symlink","truncate","unlink","utimes","writeFile"].filter(t=>typeof Pt[t]=="function");Object.keys(Pt).forEach(t=>{t!=="promises"&&(si[t]=Pt[t])});CK.forEach(t=>{si[t]=F2(Pt[t])});si.exists=function(t,e){return typeof e=="function"?Pt.exists(t,e):new Promise(r=>Pt.exists(t,r))};si.read=function(t,e,r,n,i,o){return typeof o=="function"?Pt.read(t,e,r,n,i,o):new Promise((s,a)=>{Pt.read(t,e,r,n,i,(u,c,l)=>{if(u)return a(u);s({bytesRead:c,buffer:l})})})};si.write=function(t,e,...r){return typeof r[r.length-1]=="function"?Pt.write(t,e,...r):new Promise((n,i)=>{Pt.write(t,e,...r,(o,s,a)=>{if(o)return i(o);n({bytesWritten:s,buffer:a})})})};typeof Pt.writev=="function"&&(si.writev=function(t,e,...r){return typeof r[r.length-1]=="function"?Pt.writev(t,e,...r):new Promise((n,i)=>{Pt.writev(t,e,...r,(o,s,a)=>{if(o)return i(o);n({bytesWritten:s,buffers:a})})})});typeof Pt.realpath.native=="function"&&(si.realpath.native=F2(Pt.realpath.native))});var sD=y((Yde,O2)=>{O2.exports=t=>{let e=process.versions.node.split(".").map(r=>parseInt(r,10));return t=t.split(".").map(r=>parseInt(r,10)),e[0]>t[0]||e[0]===t[0]&&(e[1]>t[1]||e[1]===t[1]&&e[2]>=t[2])}});var R2=y((Jde,aD)=>{"use strict";var $s=Gu(),Sn=require("path"),SK=sD(),A2=SK("10.12.0"),k2=t=>{if(process.platform==="win32"&&/[<>:"|?*]/.test(t.replace(Sn.parse(t).root,""))){let r=new Error(`Path contains invalid characters: ${t}`);throw r.code="EINVAL",r}},T2=t=>{let e={mode:511};return typeof t=="number"&&(t={mode:t}),{...e,...t}},P2=t=>{let e=new Error(`operation not permitted, mkdir '${t}'`);return e.code="EPERM",e.errno=-4048,e.path=t,e.syscall="mkdir",e};aD.exports.makeDir=async(t,e)=>{if(k2(t),e=T2(e),A2){let n=Sn.resolve(t);return $s.mkdir(n,{mode:e.mode,recursive:!0})}let r=async n=>{try{await $s.mkdir(n,e.mode)}catch(i){if(i.code==="EPERM")throw i;if(i.code==="ENOENT"){if(Sn.dirname(n)===n)throw P2(n);if(i.message.includes("null bytes"))throw i;return await r(Sn.dirname(n)),r(n)}try{if(!(await $s.stat(n)).isDirectory())throw new Error("The path is not a directory")}catch{throw i}}};return r(Sn.resolve(t))};aD.exports.makeDirSync=(t,e)=>{if(k2(t),e=T2(e),A2){let n=Sn.resolve(t);return $s.mkdirSync(n,{mode:e.mode,recursive:!0})}let r=n=>{try{$s.mkdirSync(n,e.mode)}catch(i){if(i.code==="EPERM")throw i;if(i.code==="ENOENT"){if(Sn.dirname(n)===n)throw P2(n);if(i.message.includes("null bytes"))throw i;return r(Sn.dirname(n)),r(n)}try{if(!$s.statSync(n).isDirectory())throw new Error("The path is not a directory")}catch{throw i}}};return r(Sn.resolve(t))}});var kr=y((Xde,$2)=>{"use strict";var xK=Wt().fromPromise,{makeDir:FK,makeDirSync:uD}=R2(),cD=xK(FK);$2.exports={mkdirs:cD,mkdirsSync:uD,mkdirp:cD,mkdirpSync:uD,ensureDir:cD,ensureDirSync:uD}});var lD=y((Zde,I2)=>{"use strict";var Is=ht();function OK(t,e,r,n){Is.open(t,"r+",(i,o)=>{if(i)return n(i);Is.futimes(o,e,r,s=>{Is.close(o,a=>{n&&n(s||a)})})})}function AK(t,e,r){let n=Is.openSync(t,"r+");return Is.futimesSync(n,e,r),Is.closeSync(n)}I2.exports={utimesMillis:OK,utimesMillisSync:AK}});var Wu=y((Qde,B2)=>{"use strict";var js=Gu(),Kt=require("path"),kK=require("util"),TK=sD(),cd=TK("10.5.0"),j2=t=>cd?js.stat(t,{bigint:!0}):js.stat(t),fD=t=>cd?js.statSync(t,{bigint:!0}):js.statSync(t);function PK(t,e){return Promise.all([j2(t),j2(e).catch(r=>{if(r.code==="ENOENT")return null;throw r})]).then(([r,n])=>({srcStat:r,destStat:n}))}function RK(t,e){let r,n=fD(t);try{r=fD(e)}catch(i){if(i.code==="ENOENT")return{srcStat:n,destStat:null};throw i}return{srcStat:n,destStat:r}}function $K(t,e,r,n){kK.callbackify(PK)(t,e,(i,o)=>{if(i)return n(i);let{srcStat:s,destStat:a}=o;return a&&ld(s,a)?n(new Error("Source and destination must not be the same.")):s.isDirectory()&&dD(t,e)?n(new Error(fd(t,e,r))):n(null,{srcStat:s,destStat:a})})}function IK(t,e,r){let{srcStat:n,destStat:i}=RK(t,e);if(i&&ld(n,i))throw new Error("Source and destination must not be the same.");if(n.isDirectory()&&dD(t,e))throw new Error(fd(t,e,r));return{srcStat:n,destStat:i}}function N2(t,e,r,n,i){let o=Kt.resolve(Kt.dirname(t)),s=Kt.resolve(Kt.dirname(r));if(s===o||s===Kt.parse(s).root)return i();let a=(u,c)=>u?u.code==="ENOENT"?i():i(u):ld(e,c)?i(new Error(fd(t,r,n))):N2(t,e,s,n,i);cd?js.stat(s,{bigint:!0},a):js.stat(s,a)}function L2(t,e,r,n){let i=Kt.resolve(Kt.dirname(t)),o=Kt.resolve(Kt.dirname(r));if(o===i||o===Kt.parse(o).root)return;let s;try{s=fD(o)}catch(a){if(a.code==="ENOENT")return;throw a}if(ld(e,s))throw new Error(fd(t,r,n));return L2(t,e,o,n)}function ld(t,e){return!!(e.ino&&e.dev&&e.ino===t.ino&&e.dev===t.dev&&(cd||e.ino<Number.MAX_SAFE_INTEGER||e.size===t.size&&e.mode===t.mode&&e.nlink===t.nlink&&e.atimeMs===t.atimeMs&&e.mtimeMs===t.mtimeMs&&e.ctimeMs===t.ctimeMs&&e.birthtimeMs===t.birthtimeMs))}function dD(t,e){let r=Kt.resolve(t).split(Kt.sep).filter(i=>i),n=Kt.resolve(e).split(Kt.sep).filter(i=>i);return r.reduce((i,o,s)=>i&&n[s]===o,!0)}function fd(t,e,r){return`Cannot ${r} '${t}' to a subdirectory of itself, '${e}'.`}B2.exports={checkPaths:$K,checkPathsSync:IK,checkParentPaths:N2,checkParentPathsSync:L2,isSrcSubdir:dD}});var H2=y((ehe,V2)=>{"use strict";var St=ht(),Ku=require("path"),jK=kr().mkdirsSync,NK=lD().utimesMillisSync,Yu=Wu();function LK(t,e,r){typeof r=="function"&&(r={filter:r}),r=r||{},r.clobber="clobber"in r?!!r.clobber:!0,r.overwrite="overwrite"in r?!!r.overwrite:r.clobber,r.preserveTimestamps&&process.arch==="ia32"&&console.warn(`fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;
39
+ `)}),e}});var Gx=y((Ode,zx)=>{var ii=require("constants"),pW=process.cwd,zf=null,mW=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return zf||(zf=pW.call(process)),zf};try{process.cwd()}catch{}typeof process.chdir=="function"&&(By=process.chdir,process.chdir=function(t){zf=null,By.call(process,t)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,By));var By;zx.exports=gW;function gW(t){ii.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&e(t),t.lutimes||r(t),t.chown=o(t.chown),t.fchown=o(t.fchown),t.lchown=o(t.lchown),t.chmod=n(t.chmod),t.fchmod=n(t.fchmod),t.lchmod=n(t.lchmod),t.chownSync=s(t.chownSync),t.fchownSync=s(t.fchownSync),t.lchownSync=s(t.lchownSync),t.chmodSync=i(t.chmodSync),t.fchmodSync=i(t.fchmodSync),t.lchmodSync=i(t.lchmodSync),t.stat=a(t.stat),t.fstat=a(t.fstat),t.lstat=a(t.lstat),t.statSync=u(t.statSync),t.fstatSync=u(t.fstatSync),t.lstatSync=u(t.lstatSync),t.chmod&&!t.lchmod&&(t.lchmod=function(l,f,h){h&&process.nextTick(h)},t.lchmodSync=function(){}),t.chown&&!t.lchown&&(t.lchown=function(l,f,h,d){d&&process.nextTick(d)},t.lchownSync=function(){}),mW==="win32"&&(t.rename=typeof t.rename!="function"?t.rename:function(l){function f(h,d,m){var b=Date.now(),g=0;l(h,d,function w(x){if(x&&(x.code==="EACCES"||x.code==="EPERM"||x.code==="EBUSY")&&Date.now()-b<6e4){setTimeout(function(){t.stat(d,function(D,C){D&&D.code==="ENOENT"?l(h,d,w):m(x)})},g),g<100&&(g+=10);return}m&&m(x)})}return Object.setPrototypeOf&&Object.setPrototypeOf(f,l),f}(t.rename)),t.read=typeof t.read!="function"?t.read:function(l){function f(h,d,m,b,g,w){var x;if(w&&typeof w=="function"){var D=0;x=function(C,k,$){if(C&&C.code==="EAGAIN"&&D<10)return D++,l.call(t,h,d,m,b,g,x);w.apply(this,arguments)}}return l.call(t,h,d,m,b,g,x)}return Object.setPrototypeOf&&Object.setPrototypeOf(f,l),f}(t.read),t.readSync=typeof t.readSync!="function"?t.readSync:function(l){return function(f,h,d,m,b){for(var g=0;;)try{return l.call(t,f,h,d,m,b)}catch(w){if(w.code==="EAGAIN"&&g<10){g++;continue}throw w}}}(t.readSync);function e(l){l.lchmod=function(f,h,d){l.open(f,ii.O_WRONLY|ii.O_SYMLINK,h,function(m,b){if(m){d&&d(m);return}l.fchmod(b,h,function(g){l.close(b,function(w){d&&d(g||w)})})})},l.lchmodSync=function(f,h){var d=l.openSync(f,ii.O_WRONLY|ii.O_SYMLINK,h),m=!0,b;try{b=l.fchmodSync(d,h),m=!1}finally{if(m)try{l.closeSync(d)}catch{}else l.closeSync(d)}return b}}function r(l){ii.hasOwnProperty("O_SYMLINK")&&l.futimes?(l.lutimes=function(f,h,d,m){l.open(f,ii.O_SYMLINK,function(b,g){if(b){m&&m(b);return}l.futimes(g,h,d,function(w){l.close(g,function(x){m&&m(w||x)})})})},l.lutimesSync=function(f,h,d){var m=l.openSync(f,ii.O_SYMLINK),b,g=!0;try{b=l.futimesSync(m,h,d),g=!1}finally{if(g)try{l.closeSync(m)}catch{}else l.closeSync(m)}return b}):l.futimes&&(l.lutimes=function(f,h,d,m){m&&process.nextTick(m)},l.lutimesSync=function(){})}function n(l){return l&&function(f,h,d){return l.call(t,f,h,function(m){c(m)&&(m=null),d&&d.apply(this,arguments)})}}function i(l){return l&&function(f,h){try{return l.call(t,f,h)}catch(d){if(!c(d))throw d}}}function o(l){return l&&function(f,h,d,m){return l.call(t,f,h,d,function(b){c(b)&&(b=null),m&&m.apply(this,arguments)})}}function s(l){return l&&function(f,h,d){try{return l.call(t,f,h,d)}catch(m){if(!c(m))throw m}}}function a(l){return l&&function(f,h,d){typeof h=="function"&&(d=h,h=null);function m(b,g){g&&(g.uid<0&&(g.uid+=4294967296),g.gid<0&&(g.gid+=4294967296)),d&&d.apply(this,arguments)}return h?l.call(t,f,h,m):l.call(t,f,m)}}function u(l){return l&&function(f,h){var d=h?l.call(t,f,h):l.call(t,f);return d&&(d.uid<0&&(d.uid+=4294967296),d.gid<0&&(d.gid+=4294967296)),d}}function c(l){if(!l||l.code==="ENOSYS")return!0;var f=!process.getuid||process.getuid()!==0;return!!(f&&(l.code==="EINVAL"||l.code==="EPERM"))}}});var Yx=y((Ade,Kx)=>{var Wx=require("stream").Stream;Kx.exports=yW;function yW(t){return{ReadStream:e,WriteStream:r};function e(n,i){if(!(this instanceof e))return new e(n,i);Wx.call(this);var o=this;this.path=n,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=64*1024,i=i||{};for(var s=Object.keys(i),a=0,u=s.length;a<u;a++){var c=s[a];this[c]=i[c]}if(this.encoding&&this.setEncoding(this.encoding),this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.end===void 0)this.end=1/0;else if(typeof this.end!="number")throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}if(this.fd!==null){process.nextTick(function(){o._read()});return}t.open(this.path,this.flags,this.mode,function(l,f){if(l){o.emit("error",l),o.readable=!1;return}o.fd=f,o.emit("open",f),o._read()})}function r(n,i){if(!(this instanceof r))return new r(n,i);Wx.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 Xx=y((kde,Jx)=>{"use strict";Jx.exports=vW;var DW=Object.getPrototypeOf||function(t){return t.__proto__};function vW(t){if(t===null||typeof t!="object")return t;if(t instanceof Object)var e={__proto__:DW(t)};else var e=Object.create(null);return Object.getOwnPropertyNames(t).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}});var ht=y((Tde,Uy)=>{var He=require("fs"),bW=Gx(),wW=Yx(),_W=Xx(),Gf=require("util"),_t,Kf;typeof Symbol=="function"&&typeof Symbol.for=="function"?(_t=Symbol.for("graceful-fs.queue"),Kf=Symbol.for("graceful-fs.previous")):(_t="___graceful-fs.queue",Kf="___graceful-fs.previous");function EW(){}function eF(t,e){Object.defineProperty(t,_t,{get:function(){return e}})}var no=EW;Gf.debuglog?no=Gf.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(no=function(){var t=Gf.format.apply(Gf,arguments);t="GFS4: "+t.split(/\n/).join(`
40
+ GFS4: `),console.error(t)});He[_t]||(Zx=global[_t]||[],eF(He,Zx),He.close=function(t){function e(r,n){return t.call(He,r,function(i){i||Qx(),typeof n=="function"&&n.apply(this,arguments)})}return Object.defineProperty(e,Kf,{value:t}),e}(He.close),He.closeSync=function(t){function e(r){t.apply(He,arguments),Qx()}return Object.defineProperty(e,Kf,{value:t}),e}(He.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){no(He[_t]),require("assert").equal(He[_t].length,0)}));var Zx;global[_t]||eF(global,He[_t]);Uy.exports=qy(_W(He));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!He.__patched&&(Uy.exports=qy(He),He.__patched=!0);function qy(t){bW(t),t.gracefulify=qy,t.createReadStream=k,t.createWriteStream=$;var e=t.readFile;t.readFile=r;function r(S,I,R){return typeof I=="function"&&(R=I,I=null),B(S,I,R);function B(q,K,M,E){return e(q,K,function(v){v&&(v.code==="EMFILE"||v.code==="ENFILE")?Cs([B,[q,K,M],v,E||Date.now(),Date.now()]):typeof M=="function"&&M.apply(this,arguments)})}}var n=t.writeFile;t.writeFile=i;function i(S,I,R,B){return typeof R=="function"&&(B=R,R=null),q(S,I,R,B);function q(K,M,E,v,_){return n(K,M,E,function(O){O&&(O.code==="EMFILE"||O.code==="ENFILE")?Cs([q,[K,M,E,v],O,_||Date.now(),Date.now()]):typeof v=="function"&&v.apply(this,arguments)})}}var o=t.appendFile;o&&(t.appendFile=s);function s(S,I,R,B){return typeof R=="function"&&(B=R,R=null),q(S,I,R,B);function q(K,M,E,v,_){return o(K,M,E,function(O){O&&(O.code==="EMFILE"||O.code==="ENFILE")?Cs([q,[K,M,E,v],O,_||Date.now(),Date.now()]):typeof v=="function"&&v.apply(this,arguments)})}}var a=t.copyFile;a&&(t.copyFile=u);function u(S,I,R,B){return typeof R=="function"&&(B=R,R=0),q(S,I,R,B);function q(K,M,E,v,_){return a(K,M,E,function(O){O&&(O.code==="EMFILE"||O.code==="ENFILE")?Cs([q,[K,M,E,v],O,_||Date.now(),Date.now()]):typeof v=="function"&&v.apply(this,arguments)})}}var c=t.readdir;t.readdir=f;var l=/^v[0-5]\./;function f(S,I,R){typeof I=="function"&&(R=I,I=null);var B=l.test(process.version)?function(M,E,v,_){return c(M,q(M,E,v,_))}:function(M,E,v,_){return c(M,E,q(M,E,v,_))};return B(S,I,R);function q(K,M,E,v){return function(_,O){_&&(_.code==="EMFILE"||_.code==="ENFILE")?Cs([B,[K,M,E],_,v||Date.now(),Date.now()]):(O&&O.sort&&O.sort(),typeof E=="function"&&E.call(this,_,O))}}}if(process.version.substr(0,4)==="v0.8"){var h=wW(t);w=h.ReadStream,D=h.WriteStream}var d=t.ReadStream;d&&(w.prototype=Object.create(d.prototype),w.prototype.open=x);var m=t.WriteStream;m&&(D.prototype=Object.create(m.prototype),D.prototype.open=C),Object.defineProperty(t,"ReadStream",{get:function(){return w},set:function(S){w=S},enumerable:!0,configurable:!0}),Object.defineProperty(t,"WriteStream",{get:function(){return D},set:function(S){D=S},enumerable:!0,configurable:!0});var b=w;Object.defineProperty(t,"FileReadStream",{get:function(){return b},set:function(S){b=S},enumerable:!0,configurable:!0});var g=D;Object.defineProperty(t,"FileWriteStream",{get:function(){return g},set:function(S){g=S},enumerable:!0,configurable:!0});function w(S,I){return this instanceof w?(d.apply(this,arguments),this):w.apply(Object.create(w.prototype),arguments)}function x(){var S=this;L(S.path,S.flags,S.mode,function(I,R){I?(S.autoClose&&S.destroy(),S.emit("error",I)):(S.fd=R,S.emit("open",R),S.read())})}function D(S,I){return this instanceof D?(m.apply(this,arguments),this):D.apply(Object.create(D.prototype),arguments)}function C(){var S=this;L(S.path,S.flags,S.mode,function(I,R){I?(S.destroy(),S.emit("error",I)):(S.fd=R,S.emit("open",R))})}function k(S,I){return new t.ReadStream(S,I)}function $(S,I){return new t.WriteStream(S,I)}var F=t.open;t.open=L;function L(S,I,R,B){return typeof R=="function"&&(B=R,R=null),q(S,I,R,B);function q(K,M,E,v,_){return F(K,M,E,function(O,j){O&&(O.code==="EMFILE"||O.code==="ENFILE")?Cs([q,[K,M,E,v],O,_||Date.now(),Date.now()]):typeof v=="function"&&v.apply(this,arguments)})}}return t}function Cs(t){no("ENQUEUE",t[0].name,t[1]),He[_t].push(t),My()}var Wf;function Qx(){for(var t=Date.now(),e=0;e<He[_t].length;++e)He[_t][e].length>2&&(He[_t][e][3]=t,He[_t][e][4]=t);My()}function My(){if(clearTimeout(Wf),Wf=void 0,He[_t].length!==0){var t=He[_t].shift(),e=t[0],r=t[1],n=t[2],i=t[3],o=t[4];if(i===void 0)no("RETRY",e.name,r),e.apply(null,r);else if(Date.now()-i>=6e4){no("TIMEOUT",e.name,r);var s=r.pop();typeof s=="function"&&s.call(null,n)}else{var a=Date.now()-o,u=Math.max(o-i,1),c=Math.min(u*1.2,100);a>=c?(no("RETRY",e.name,r),e.apply(null,r.concat([i]))):He[_t].push(t)}Wf===void 0&&(Wf=setTimeout(My,0))}}});var rF=y((Pde,tF)=>{function Dr(t,e){typeof e=="boolean"&&(e={forever:e}),this._originalTimeouts=JSON.parse(JSON.stringify(t)),this._timeouts=t,this._options=e||{},this._maxRetryTime=e&&e.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}tF.exports=Dr;Dr.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts};Dr.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timeouts=[],this._cachedTimeouts=null};Dr.prototype.retry=function(t){if(this._timeout&&clearTimeout(this._timeout),!t)return!1;var e=new Date().getTime();if(t&&e-this._operationStart>=this._maxRetryTime)return this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(t);var r=this._timeouts.shift();if(r===void 0)if(this._cachedTimeouts)this._errors.splice(this._errors.length-1,this._errors.length),this._timeouts=this._cachedTimeouts.slice(0),r=this._timeouts.shift();else return!1;var n=this,i=setTimeout(function(){n._attempts++,n._operationTimeoutCb&&(n._timeout=setTimeout(function(){n._operationTimeoutCb(n._attempts)},n._operationTimeout),n._options.unref&&n._timeout.unref()),n._fn(n._attempts)},r);return this._options.unref&&i.unref(),!0};Dr.prototype.attempt=function(t,e){this._fn=t,e&&(e.timeout&&(this._operationTimeout=e.timeout),e.cb&&(this._operationTimeoutCb=e.cb));var r=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){r._operationTimeoutCb()},r._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)};Dr.prototype.try=function(t){console.log("Using RetryOperation.try() is deprecated"),this.attempt(t)};Dr.prototype.start=function(t){console.log("Using RetryOperation.start() is deprecated"),this.attempt(t)};Dr.prototype.start=Dr.prototype.try;Dr.prototype.errors=function(){return this._errors};Dr.prototype.attempts=function(){return this._attempts};Dr.prototype.mainError=function(){if(this._errors.length===0)return null;for(var t={},e=null,r=0,n=0;n<this._errors.length;n++){var i=this._errors[n],o=i.message,s=(t[o]||0)+1;t[o]=s,s>=r&&(e=i,r=s)}return e}});var nF=y(io=>{var CW=rF();io.operation=function(t){var e=io.timeouts(t);return new CW(e,{forever:t&&t.forever,unref:t&&t.unref,maxRetryTime:t&&t.maxRetryTime})};io.timeouts=function(t){if(t instanceof Array)return[].concat(t);var e={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var r in t)e[r]=t[r];if(e.minTimeout>e.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var n=[],i=0;i<e.retries;i++)n.push(this.createTimeout(i,e));return t&&t.forever&&!n.length&&n.push(this.createTimeout(i,e)),n.sort(function(o,s){return o-s}),n};io.createTimeout=function(t,e){var r=e.randomize?Math.random()+1:1,n=Math.round(r*e.minTimeout*Math.pow(e.factor,t));return n=Math.min(n,e.maxTimeout),n};io.wrap=function(t,e,r){if(e instanceof Array&&(r=e,e=null),!r){r=[];for(var n in t)typeof t[n]=="function"&&r.push(n)}for(var i=0;i<r.length;i++){var o=r[i],s=t[o];t[o]=function(u){var c=io.operation(e),l=Array.prototype.slice.call(arguments,1),f=l.pop();l.push(function(h){c.retry(h)||(h&&(arguments[0]=c.mainError()),f.apply(this,arguments))}),c.attempt(function(){u.apply(t,l)})}.bind(t,s),t[o].options=e}}});var oF=y(($de,iF)=>{iF.exports=nF()});var sF=y((Ide,Yf)=>{Yf.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];process.platform!=="win32"&&Yf.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&Yf.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")});var zy=y((jde,Fs)=>{var Be=global.process,oo=function(t){return t&&typeof t=="object"&&typeof t.removeListener=="function"&&typeof t.emit=="function"&&typeof t.reallyExit=="function"&&typeof t.listeners=="function"&&typeof t.kill=="function"&&typeof t.pid=="number"&&typeof t.on=="function"};oo(Be)?(aF=require("assert"),Ss=sF(),uF=/^win/i.test(Be.platform),Uu=require("events"),typeof Uu!="function"&&(Uu=Uu.EventEmitter),Be.__signal_exit_emitter__?pt=Be.__signal_exit_emitter__:(pt=Be.__signal_exit_emitter__=new Uu,pt.count=0,pt.emitted={}),pt.infinite||(pt.setMaxListeners(1/0),pt.infinite=!0),Fs.exports=function(t,e){if(!oo(global.process))return function(){};aF.equal(typeof t,"function","a callback must be provided for exit handler"),xs===!1&&Vy();var r="exit";e&&e.alwaysLast&&(r="afterexit");var n=function(){pt.removeListener(r,t),pt.listeners("exit").length===0&&pt.listeners("afterexit").length===0&&Jf()};return pt.on(r,t),n},Jf=function(){!xs||!oo(global.process)||(xs=!1,Ss.forEach(function(e){try{Be.removeListener(e,Xf[e])}catch{}}),Be.emit=Zf,Be.reallyExit=Hy,pt.count-=1)},Fs.exports.unload=Jf,so=function(e,r,n){pt.emitted[e]||(pt.emitted[e]=!0,pt.emit(e,r,n))},Xf={},Ss.forEach(function(t){Xf[t]=function(){if(oo(global.process)){var r=Be.listeners(t);r.length===pt.count&&(Jf(),so("exit",null,t),so("afterexit",null,t),uF&&t==="SIGHUP"&&(t="SIGINT"),Be.kill(Be.pid,t))}}}),Fs.exports.signals=function(){return Ss},xs=!1,Vy=function(){xs||!oo(global.process)||(xs=!0,pt.count+=1,Ss=Ss.filter(function(e){try{return Be.on(e,Xf[e]),!0}catch{return!1}}),Be.emit=lF,Be.reallyExit=cF)},Fs.exports.load=Vy,Hy=Be.reallyExit,cF=function(e){oo(global.process)&&(Be.exitCode=e||0,so("exit",Be.exitCode,null),so("afterexit",Be.exitCode,null),Hy.call(Be,Be.exitCode))},Zf=Be.emit,lF=function(e,r){if(e==="exit"&&oo(global.process)){r!==void 0&&(Be.exitCode=r);var n=Zf.apply(this,arguments);return so("exit",Be.exitCode,null),so("afterexit",Be.exitCode,null),n}else return Zf.apply(this,arguments)}):Fs.exports=function(){return function(){}};var aF,Ss,uF,Uu,pt,Jf,so,Xf,xs,Vy,Hy,cF,Zf,lF});var dF=y((Nde,Gy)=>{"use strict";var fF=Symbol();function SW(t,e,r){let n=e[fF];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,fF,{value:u}),r(null,a.mtime,u)})})}function xW(t){let e=Date.now();return t==="s"&&(e=Math.ceil(e/1e3)*1e3),new Date(e)}Gy.exports.probe=SW;Gy.exports.getMtime=xW});var yF=y((Lde,Hu)=>{"use strict";var FW=require("path"),Yy=ht(),OW=oF(),AW=zy(),hF=dF(),_n={};function Vu(t,e){return e.lockfilePath||`${t}.lock`}function Jy(t,e,r){if(!e.realpath)return r(null,FW.resolve(t));e.fs.realpath(t,r)}function Ky(t,e,r){let n=Vu(t,e);e.fs.mkdir(n,i=>{if(!i)return hF.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"?Ky(t,{...e,stale:0},r):r(o);if(!pF(s,e))return r(Object.assign(new Error("Lock file is already being held"),{code:"ELOCKED",file:t}));mF(t,e,a=>{if(a)return r(a);Ky(t,{...e,stale:0},r)})})})}function pF(t,e){return t.mtime.getTime()<Date.now()-e.stale}function mF(t,e,r){e.fs.rmdir(Vu(t,e),n=>{if(n&&n.code!=="ENOENT")return r(n);r()})}function Qf(t,e){let r=_n[t];r.updateTimeout||(r.updateDelay=r.updateDelay||e.update,r.updateTimeout=setTimeout(()=>{r.updateTimeout=null,e.fs.stat(r.lockfilePath,(n,i)=>{let o=r.lastUpdate+e.stale<Date.now();if(n)return n.code==="ENOENT"||o?Wy(t,r,Object.assign(n,{code:"ECOMPROMISED"})):(r.updateDelay=1e3,Qf(t,e));if(!(r.mtime.getTime()===i.mtime.getTime()))return Wy(t,r,Object.assign(new Error("Unable to update lock within the stale threshold"),{code:"ECOMPROMISED"}));let a=hF.getMtime(r.mtimePrecision);e.fs.utimes(r.lockfilePath,a,a,u=>{let c=r.lastUpdate+e.stale<Date.now();if(!r.released){if(u)return u.code==="ENOENT"||c?Wy(t,r,Object.assign(u,{code:"ECOMPROMISED"})):(r.updateDelay=1e3,Qf(t,e));r.mtime=a,r.lastUpdate=Date.now(),r.updateDelay=null,Qf(t,e)}})})},r.updateDelay),r.updateTimeout.unref&&r.updateTimeout.unref())}function Wy(t,e,r){e.released=!0,e.updateTimeout&&clearTimeout(e.updateTimeout),_n[t]===e&&delete _n[t],e.options.onCompromised(r)}function kW(t,e,r){e={stale:1e4,update:null,realpath:!0,retries:0,fs:Yy,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),Jy(t,e,(n,i)=>{if(n)return r(n);let o=OW.operation(e.retries);o.attempt(()=>{Ky(i,e,(s,a,u)=>{if(o.retry(s))return;if(s)return r(o.mainError());let c=_n[i]={lockfilePath:Vu(i,e),mtime:a,mtimePrecision:u,options:e,lastUpdate:Date.now()};Qf(i,e),r(null,l=>{if(c.released)return l&&l(Object.assign(new Error("Lock is already released"),{code:"ERELEASED"}));gF(i,{...e,realpath:!1},l)})})})})}function gF(t,e,r){e={fs:Yy,realpath:!0,...e},Jy(t,e,(n,i)=>{if(n)return r(n);let o=_n[i];if(!o)return r(Object.assign(new Error("Lock is not acquired/owned by you"),{code:"ENOTACQUIRED"}));o.updateTimeout&&clearTimeout(o.updateTimeout),o.released=!0,delete _n[i],mF(i,e,r)})}function TW(t,e,r){e={stale:1e4,realpath:!0,fs:Yy,...e},e.stale=Math.max(e.stale||0,2e3),Jy(t,e,(n,i)=>{if(n)return r(n);e.fs.stat(Vu(i,e),(o,s)=>o?o.code==="ENOENT"?r(null,!1):r(o):r(null,!pF(s,e)))})}function PW(){return _n}AW(()=>{for(let t in _n){let e=_n[t].options;try{e.fs.rmdirSync(Vu(t,e))}catch{}}});Hu.exports.lock=kW;Hu.exports.unlock=gF;Hu.exports.check=TW;Hu.exports.getLocks=PW});var vF=y((Bde,DF)=>{"use strict";var RW=ht();function $W(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 IW(t){return(...e)=>new Promise((r,n)=>{e.push((i,o)=>{i?n(i):r(o)}),t(...e)})}function jW(t){return(...e)=>{let r,n;if(e.push((i,o)=>{r=i,n=o}),t(...e),r)throw r;return n}}function NW(t){if(t={...t},t.fs=$W(t.fs||RW),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}DF.exports={toPromise:IW,toSync:jW,toSyncOptions:NW}});var wF=y((qde,oi)=>{"use strict";var Os=yF(),{toPromise:ed,toSync:td,toSyncOptions:Xy}=vF();async function bF(t,e){let r=await ed(Os.lock)(t,e);return ed(r)}function LW(t,e){let r=td(Os.lock)(t,Xy(e));return td(r)}function BW(t,e){return ed(Os.unlock)(t,e)}function qW(t,e){return td(Os.unlock)(t,Xy(e))}function MW(t,e){return ed(Os.check)(t,e)}function UW(t,e){return td(Os.check)(t,Xy(e))}oi.exports=bF;oi.exports.lock=bF;oi.exports.unlock=BW;oi.exports.lockSync=LW;oi.exports.unlockSync=qW;oi.exports.check=MW;oi.exports.checkSync=UW});var xF=y(As=>{"use strict";Object.defineProperty(As,"__esModule",{value:!0});As.canStoreURLs=As.FileUrlStorage=void 0;var _F=require("fs"),VW=zW(Hx()),EF=HW(wF());function SF(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,r=new WeakMap;return(SF=function(n){return n?r:e})(t)}function HW(t,e){if(!e&&t&&t.__esModule)return t;if(t===null||typeof t!="object"&&typeof t!="function")return{default:t};var r=SF(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 zW(t){return t&&t.__esModule?t:{default:t}}function zu(t){"@babel/helpers - typeof";return zu=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},zu(t)}function GW(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function CF(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,KW(n.key),n)}}function WW(t,e,r){return e&&CF(t.prototype,e),r&&CF(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function KW(t){var e=YW(t,"string");return zu(e)=="symbol"?e:e+""}function YW(t,e){if(zu(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(zu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Mde=As.canStoreURLs=!0,Ude=As.FileUrlStorage=function(){function t(e){GW(this,t),this.path=e}return WW(t,[{key:"findAllUploads",value:function(){var r=this;return new Promise(function(n,i){r._getItems("tus::",function(o,s){o?i(o):n(s)})})}},{key:"findUploadsByFingerprint",value:function(r){var n=this;return new Promise(function(i,o){n._getItems("tus::".concat(r),function(s,a){s?o(s):i(a)})})}},{key:"removeUpload",value:function(r){var n=this;return new Promise(function(i,o){n._removeItem(r,function(s){s?o(s):i()})})}},{key:"addUpload",value:function(r,n){var i=this,o=Math.round(Math.random()*1e12),s="tus::".concat(r,"::").concat(o);return new Promise(function(a,u){i._setItem(s,n,function(c){c?u(c):a(s)})})}},{key:"_setItem",value:function(r,n,i){var o=this;EF.lock(this.path,this._lockfileOptions()).then(function(s){i=o._releaseAndCb(s,i),o._getData(function(a,u){if(a){i(a);return}u[r]=n,o._writeData(u,function(c){return i(c)})})}).catch(i)}},{key:"_getItems",value:function(r,n){this._getData(function(i,o){if(i){n(i);return}var s=Object.keys(o).filter(function(a){return a.startsWith(r)}).map(function(a){var u=o[a];return u.urlStorageKey=a,u});n(null,s)})}},{key:"_removeItem",value:function(r,n){var i=this;EF.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,VW.default)([i,o]))});return}r().then(n).catch(n)}}},{key:"_writeData",value:function(r,n){var i={encoding:"utf8",mode:432,flag:"w"};(0,_F.writeFile)(this.path,JSON.stringify(r),i,function(o){return n(o)})}},{key:"_getData",value:function(r){(0,_F.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 eD=y(Gt=>{"use strict";Object.defineProperty(Gt,"__esModule",{value:!0});Object.defineProperty(Gt,"DefaultHttpStack",{enumerable:!0,get:function(){return kF.default}});Object.defineProperty(Gt,"DetailedError",{enumerable:!0,get:function(){return JW.default}});Object.defineProperty(Gt,"FileUrlStorage",{enumerable:!0,get:function(){return TF.FileUrlStorage}});Object.defineProperty(Gt,"StreamSource",{enumerable:!0,get:function(){return tK.default}});Gt.Upload=void 0;Object.defineProperty(Gt,"canStoreURLs",{enumerable:!0,get:function(){return TF.canStoreURLs}});Gt.defaultOptions=void 0;Object.defineProperty(Gt,"enableDebugLog",{enumerable:!0,get:function(){return XW.enableDebugLog}});Gt.isSupported=void 0;var JW=ao(Gg()),XW=Wg(),ZW=ao(xS()),Zy=ao(r1()),QW=ao(m1()),eK=ao(v1()),kF=ao(R1()),tK=ao(uy()),TF=xF();function ao(t){return t&&t.__esModule?t:{default:t}}function Ts(t){"@babel/helpers - typeof";return Ts=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},Ts(t)}function rK(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function FF(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,RF(n.key),n)}}function nK(t,e,r){return e&&FF(t.prototype,e),r&&FF(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function iK(t,e,r){return e=rd(e),oK(t,PF()?Reflect.construct(e,r||[],rd(t).constructor):e.apply(t,r))}function oK(t,e){if(e&&(Ts(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return sK(t)}function sK(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function PF(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(PF=function(){return!!t})()}function rd(t){return rd=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},rd(t)}function aK(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&&Qy(t,e)}function Qy(t,e){return Qy=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Qy(t,e)}function OF(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 ks(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?OF(Object(r),!0).forEach(function(n){uK(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):OF(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function uK(t,e,r){return e=RF(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function RF(t){var e=cK(t,"string");return Ts(e)=="symbol"?e:e+""}function cK(t,e){if(Ts(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Ts(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var AF=Gt.defaultOptions=ks(ks({},Zy.default.defaultOptions),{},{httpStack:new kF.default,fileReader:new QW.default,urlStorage:new ZW.default,fingerprint:eK.default}),Hde=Gt.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 rK(this,e),n=ks(ks({},AF),n),iK(this,e,[r,n])}return aK(e,t),nK(e,null,[{key:"terminate",value:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return i=ks(ks({},AF),i),Zy.default.terminate(n,i)}}])}(Zy.default),zde=Gt.isSupported=!0});var En={};mn(En,{__addDisposableResource:()=>e2,__assign:()=>nd,__asyncDelegator:()=>GF,__asyncGenerator:()=>zF,__asyncValues:()=>WF,__await:()=>Ps,__awaiter:()=>BF,__classPrivateFieldGet:()=>XF,__classPrivateFieldIn:()=>QF,__classPrivateFieldSet:()=>ZF,__createBinding:()=>od,__decorate:()=>jF,__disposeResources:()=>t2,__esDecorate:()=>lK,__exportStar:()=>MF,__extends:()=>$F,__generator:()=>qF,__importDefault:()=>JF,__importStar:()=>YF,__makeTemplateObject:()=>KF,__metadata:()=>LF,__param:()=>NF,__propKey:()=>dK,__read:()=>rD,__rest:()=>IF,__runInitializers:()=>fK,__setFunctionName:()=>hK,__spread:()=>UF,__spreadArray:()=>HF,__spreadArrays:()=>VF,__values:()=>id,default:()=>gK});function $F(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");tD(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}function IF(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 jF(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 NF(t,e){return function(r,n){e(r,n,t)}}function lK(t,e,r,n,i,o){function s(w){if(w!==void 0&&typeof w!="function")throw new TypeError("Function expected");return w}for(var a=n.kind,u=a==="getter"?"get":a==="setter"?"set":"value",c=!e&&t?n.static?t:t.prototype:null,l=e||(c?Object.getOwnPropertyDescriptor(c,n.name):{}),f,h=!1,d=r.length-1;d>=0;d--){var 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(w){if(h)throw new TypeError("Cannot add initializers after decoration has completed");o.push(s(w||null))};var g=(0,r[d])(a==="accessor"?{get:l.get,set:l.set}:l[u],m);if(a==="accessor"){if(g===void 0)continue;if(g===null||typeof g!="object")throw new TypeError("Object expected");(f=s(g.get))&&(l.get=f),(f=s(g.set))&&(l.set=f),(f=s(g.init))&&i.unshift(f)}else(f=s(g))&&(a==="field"?i.unshift(f):l[u]=f)}c&&Object.defineProperty(c,n.name,l),h=!0}function fK(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 dK(t){return typeof t=="symbol"?t:"".concat(t)}function hK(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 BF(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(l){try{c(n.next(l))}catch(f){s(f)}}function u(l){try{c(n.throw(l))}catch(f){s(f)}}function c(l){l.done?o(l.value):i(l.value).then(a,u)}c((n=n.apply(t,e||[])).next())})}function qF(t,e){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,s=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(c){return function(l){return u([c,l])}}function u(c){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,c[0]&&(r=0)),r;)try{if(n=1,i&&(o=c[0]&2?i.return:c[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,c[1])).done)return o;switch(i=0,o&&(c=[c[0]&2,o.value]),c[0]){case 0:case 1:o=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,i=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]<o[3])){r.label=c[1];break}if(c[0]===6&&r.label<o[1]){r.label=o[1],o=c;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(c);break}o[2]&&r.ops.pop(),r.trys.pop();continue}c=e.call(t,r)}catch(l){c=[6,l],i=0}finally{n=o=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function MF(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&od(e,t,r)}function id(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function rD(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,o=[],s;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(a){s={error:a}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return o}function UF(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(rD(arguments[e]));return t}function VF(){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 HF(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 Ps(t){return this instanceof Ps?(this.v=t,this):new Ps(t)}function zF(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(g,w){o.push([d,b,g,w])>1||u(d,b)})},m&&(i[d]=m(i[d])))}function u(d,m){try{c(n[d](m))}catch(b){h(o[0][3],b)}}function c(d){d.value instanceof Ps?Promise.resolve(d.value.v).then(l,f):h(o[0][2],d)}function l(d){u("next",d)}function f(d){u("throw",d)}function h(d,m){d(m),o.shift(),o.length&&u(o[0][0],o[0][1])}}function GF(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:Ps(t[i](s)),done:!1}:o?o(s):s}:o}}function WF(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof id=="function"?id(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(o){r[o]=t[o]&&function(s){return new Promise(function(a,u){s=t[o](s),i(a,u,s.done,s.value)})}}function i(o,s,a,u){Promise.resolve(u).then(function(c){o({value:c,done:a})},s)}}function KF(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function YF(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&od(e,t,r);return pK(e,t),e}function JF(t){return t&&t.__esModule?t:{default:t}}function XF(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 ZF(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 QF(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 e2(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 t2(t){function e(o){t.error=t.hasError?new mK(o,t.error,"An error was suppressed during disposal."):o,t.hasError=!0}var r,n=0;function i(){for(;r=t.stack.pop();)try{if(!r.async&&n===1)return n=0,t.stack.push(r),Promise.resolve().then(i);if(r.dispose){var o=r.dispose.call(r.value);if(r.async)return n|=2,Promise.resolve(o).then(i,function(s){return e(s),i()})}else n|=1}catch(s){e(s)}if(n===1)return t.hasError?Promise.reject(t.error):Promise.resolve();if(t.hasError)throw t.error}return i()}var tD,nd,od,pK,mK,gK,Cn=ct(()=>{tD=function(t,e){return tD=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])},tD(t,e)};nd=function(){return nd=Object.assign||function(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},nd.apply(this,arguments)};od=Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]};pK=Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e};mK=typeof SuppressedError=="function"?SuppressedError:function(t,e,r){var n=new Error(r);return n.name="SuppressedError",n.error=t,n.suppressed=e,n};gK={__extends:$F,__assign:nd,__rest:IF,__decorate:jF,__param:NF,__metadata:LF,__awaiter:BF,__generator:qF,__createBinding:od,__exportStar:MF,__values:id,__read:rD,__spread:UF,__spreadArrays:VF,__spreadArray:HF,__await:Ps,__asyncGenerator:zF,__asyncDelegator:GF,__asyncValues:WF,__makeTemplateObject:KF,__importStar:YF,__importDefault:JF,__classPrivateFieldGet:XF,__classPrivateFieldSet:ZF,__classPrivateFieldIn:QF,__addDisposableResource:e2,__disposeResources:t2}});var C2={};mn(C2,{__addDisposableResource:()=>_2,__assign:()=>sd,__asyncDelegator:()=>p2,__asyncGenerator:()=>h2,__asyncValues:()=>m2,__await:()=>Rs,__awaiter:()=>a2,__classPrivateFieldGet:()=>v2,__classPrivateFieldIn:()=>w2,__classPrivateFieldSet:()=>b2,__createBinding:()=>ud,__decorate:()=>i2,__disposeResources:()=>E2,__esDecorate:()=>yK,__exportStar:()=>c2,__extends:()=>r2,__generator:()=>u2,__importDefault:()=>D2,__importStar:()=>y2,__makeTemplateObject:()=>g2,__metadata:()=>s2,__param:()=>o2,__propKey:()=>vK,__read:()=>iD,__rest:()=>n2,__runInitializers:()=>DK,__setFunctionName:()=>bK,__spread:()=>l2,__spreadArray:()=>d2,__spreadArrays:()=>f2,__values:()=>ad,default:()=>EK});function r2(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");nD(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}function n2(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 i2(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 o2(t,e){return function(r,n){e(r,n,t)}}function yK(t,e,r,n,i,o){function s(w){if(w!==void 0&&typeof w!="function")throw new TypeError("Function expected");return w}for(var a=n.kind,u=a==="getter"?"get":a==="setter"?"set":"value",c=!e&&t?n.static?t:t.prototype:null,l=e||(c?Object.getOwnPropertyDescriptor(c,n.name):{}),f,h=!1,d=r.length-1;d>=0;d--){var 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(w){if(h)throw new TypeError("Cannot add initializers after decoration has completed");o.push(s(w||null))};var g=(0,r[d])(a==="accessor"?{get:l.get,set:l.set}:l[u],m);if(a==="accessor"){if(g===void 0)continue;if(g===null||typeof g!="object")throw new TypeError("Object expected");(f=s(g.get))&&(l.get=f),(f=s(g.set))&&(l.set=f),(f=s(g.init))&&i.unshift(f)}else(f=s(g))&&(a==="field"?i.unshift(f):l[u]=f)}c&&Object.defineProperty(c,n.name,l),h=!0}function DK(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 vK(t){return typeof t=="symbol"?t:"".concat(t)}function bK(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 s2(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function a2(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(l){try{c(n.next(l))}catch(f){s(f)}}function u(l){try{c(n.throw(l))}catch(f){s(f)}}function c(l){l.done?o(l.value):i(l.value).then(a,u)}c((n=n.apply(t,e||[])).next())})}function u2(t,e){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(c){return function(l){return u([c,l])}}function u(c){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,c[0]&&(r=0)),r;)try{if(n=1,i&&(o=c[0]&2?i.return:c[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,c[1])).done)return o;switch(i=0,o&&(c=[c[0]&2,o.value]),c[0]){case 0:case 1:o=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,i=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]<o[3])){r.label=c[1];break}if(c[0]===6&&r.label<o[1]){r.label=o[1],o=c;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(c);break}o[2]&&r.ops.pop(),r.trys.pop();continue}c=e.call(t,r)}catch(l){c=[6,l],i=0}finally{n=o=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function c2(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&ud(e,t,r)}function ad(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function iD(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 l2(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(iD(arguments[e]));return t}function f2(){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 d2(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 Rs(t){return this instanceof Rs?(this.v=t,this):new Rs(t)}function h2(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(t,e||[]),i,o=[];return i={},s("next"),s("throw"),s("return"),i[Symbol.asyncIterator]=function(){return this},i;function s(h){n[h]&&(i[h]=function(d){return new Promise(function(m,b){o.push([h,d,m,b])>1||a(h,d)})})}function a(h,d){try{u(n[h](d))}catch(m){f(o[0][3],m)}}function u(h){h.value instanceof Rs?Promise.resolve(h.value.v).then(c,l):f(o[0][2],h)}function c(h){a("next",h)}function l(h){a("throw",h)}function f(h,d){h(d),o.shift(),o.length&&a(o[0][0],o[0][1])}}function p2(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:Rs(t[i](s)),done:!1}:o?o(s):s}:o}}function m2(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof ad=="function"?ad(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(o){r[o]=t[o]&&function(s){return new Promise(function(a,u){s=t[o](s),i(a,u,s.done,s.value)})}}function i(o,s,a,u){Promise.resolve(u).then(function(c){o({value:c,done:a})},s)}}function g2(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function y2(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&ud(e,t,r);return wK(e,t),e}function D2(t){return t&&t.__esModule?t:{default:t}}function v2(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 b2(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 w2(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 _2(t,e,r){if(e!=null){if(typeof e!="object"&&typeof e!="function")throw new TypeError("Object expected.");var n;if(r){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");n=e[Symbol.asyncDispose]}if(n===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");n=e[Symbol.dispose]}if(typeof n!="function")throw new TypeError("Object not disposable.");t.stack.push({value:e,dispose:n,async:r})}else r&&t.stack.push({async:!0});return e}function E2(t){function e(n){t.error=t.hasError?new _K(n,t.error,"An error was suppressed during disposal."):n,t.hasError=!0}function r(){for(;t.stack.length;){var n=t.stack.pop();try{var i=n.dispose&&n.dispose.call(n.value);if(n.async)return Promise.resolve(i).then(r,function(o){return e(o),r()})}catch(o){e(o)}}if(t.hasError)throw t.error}return r()}var nD,sd,ud,wK,_K,EK,S2=ct(()=>{nD=function(t,e){return nD=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])},nD(t,e)};sd=function(){return sd=Object.assign||function(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},sd.apply(this,arguments)};ud=Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]};wK=Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e};_K=typeof SuppressedError=="function"?SuppressedError:function(t,e,r){var n=new Error(r);return n.name="SuppressedError",n.error=t,n.suppressed=e,n};EK={__extends:r2,__assign:sd,__rest:n2,__decorate:i2,__param:o2,__metadata:s2,__awaiter:a2,__generator:u2,__createBinding:ud,__exportStar:c2,__values:ad,__read:iD,__spread:l2,__spreadArrays:f2,__spreadArray:d2,__await:Rs,__asyncGenerator:h2,__asyncDelegator:p2,__asyncValues:m2,__makeTemplateObject:g2,__importStar:y2,__importDefault:D2,__classPrivateFieldGet:v2,__classPrivateFieldSet:b2,__classPrivateFieldIn:w2,__addDisposableResource:_2,__disposeResources:E2}});var Wt=y(oD=>{"use strict";oD.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})};oD.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 Gu=y(si=>{"use strict";var x2=Wt().fromCallback,Pt=ht(),CK=["access","appendFile","chmod","chown","close","copyFile","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","lchmod","lchown","link","lstat","mkdir","mkdtemp","open","opendir","readdir","readFile","readlink","realpath","rename","rm","rmdir","stat","symlink","truncate","unlink","utimes","writeFile"].filter(t=>typeof Pt[t]=="function");Object.keys(Pt).forEach(t=>{t!=="promises"&&(si[t]=Pt[t])});CK.forEach(t=>{si[t]=x2(Pt[t])});si.exists=function(t,e){return typeof e=="function"?Pt.exists(t,e):new Promise(r=>Pt.exists(t,r))};si.read=function(t,e,r,n,i,o){return typeof o=="function"?Pt.read(t,e,r,n,i,o):new Promise((s,a)=>{Pt.read(t,e,r,n,i,(u,c,l)=>{if(u)return a(u);s({bytesRead:c,buffer:l})})})};si.write=function(t,e,...r){return typeof r[r.length-1]=="function"?Pt.write(t,e,...r):new Promise((n,i)=>{Pt.write(t,e,...r,(o,s,a)=>{if(o)return i(o);n({bytesWritten:s,buffer:a})})})};typeof Pt.writev=="function"&&(si.writev=function(t,e,...r){return typeof r[r.length-1]=="function"?Pt.writev(t,e,...r):new Promise((n,i)=>{Pt.writev(t,e,...r,(o,s,a)=>{if(o)return i(o);n({bytesWritten:s,buffers:a})})})});typeof Pt.realpath.native=="function"&&(si.realpath.native=x2(Pt.realpath.native))});var sD=y((Yde,F2)=>{F2.exports=t=>{let e=process.versions.node.split(".").map(r=>parseInt(r,10));return t=t.split(".").map(r=>parseInt(r,10)),e[0]>t[0]||e[0]===t[0]&&(e[1]>t[1]||e[1]===t[1]&&e[2]>=t[2])}});var P2=y((Jde,aD)=>{"use strict";var $s=Gu(),Sn=require("path"),SK=sD(),O2=SK("10.12.0"),A2=t=>{if(process.platform==="win32"&&/[<>:"|?*]/.test(t.replace(Sn.parse(t).root,""))){let r=new Error(`Path contains invalid characters: ${t}`);throw r.code="EINVAL",r}},k2=t=>{let e={mode:511};return typeof t=="number"&&(t={mode:t}),{...e,...t}},T2=t=>{let e=new Error(`operation not permitted, mkdir '${t}'`);return e.code="EPERM",e.errno=-4048,e.path=t,e.syscall="mkdir",e};aD.exports.makeDir=async(t,e)=>{if(A2(t),e=k2(e),O2){let n=Sn.resolve(t);return $s.mkdir(n,{mode:e.mode,recursive:!0})}let r=async n=>{try{await $s.mkdir(n,e.mode)}catch(i){if(i.code==="EPERM")throw i;if(i.code==="ENOENT"){if(Sn.dirname(n)===n)throw T2(n);if(i.message.includes("null bytes"))throw i;return await r(Sn.dirname(n)),r(n)}try{if(!(await $s.stat(n)).isDirectory())throw new Error("The path is not a directory")}catch{throw i}}};return r(Sn.resolve(t))};aD.exports.makeDirSync=(t,e)=>{if(A2(t),e=k2(e),O2){let n=Sn.resolve(t);return $s.mkdirSync(n,{mode:e.mode,recursive:!0})}let r=n=>{try{$s.mkdirSync(n,e.mode)}catch(i){if(i.code==="EPERM")throw i;if(i.code==="ENOENT"){if(Sn.dirname(n)===n)throw T2(n);if(i.message.includes("null bytes"))throw i;return r(Sn.dirname(n)),r(n)}try{if(!$s.statSync(n).isDirectory())throw new Error("The path is not a directory")}catch{throw i}}};return r(Sn.resolve(t))}});var kr=y((Xde,R2)=>{"use strict";var xK=Wt().fromPromise,{makeDir:FK,makeDirSync:uD}=P2(),cD=xK(FK);R2.exports={mkdirs:cD,mkdirsSync:uD,mkdirp:cD,mkdirpSync:uD,ensureDir:cD,ensureDirSync:uD}});var lD=y((Zde,$2)=>{"use strict";var Is=ht();function OK(t,e,r,n){Is.open(t,"r+",(i,o)=>{if(i)return n(i);Is.futimes(o,e,r,s=>{Is.close(o,a=>{n&&n(s||a)})})})}function AK(t,e,r){let n=Is.openSync(t,"r+");return Is.futimesSync(n,e,r),Is.closeSync(n)}$2.exports={utimesMillis:OK,utimesMillisSync:AK}});var Wu=y((Qde,L2)=>{"use strict";var js=Gu(),Kt=require("path"),kK=require("util"),TK=sD(),cd=TK("10.5.0"),I2=t=>cd?js.stat(t,{bigint:!0}):js.stat(t),fD=t=>cd?js.statSync(t,{bigint:!0}):js.statSync(t);function PK(t,e){return Promise.all([I2(t),I2(e).catch(r=>{if(r.code==="ENOENT")return null;throw r})]).then(([r,n])=>({srcStat:r,destStat:n}))}function RK(t,e){let r,n=fD(t);try{r=fD(e)}catch(i){if(i.code==="ENOENT")return{srcStat:n,destStat:null};throw i}return{srcStat:n,destStat:r}}function $K(t,e,r,n){kK.callbackify(PK)(t,e,(i,o)=>{if(i)return n(i);let{srcStat:s,destStat:a}=o;return a&&ld(s,a)?n(new Error("Source and destination must not be the same.")):s.isDirectory()&&dD(t,e)?n(new Error(fd(t,e,r))):n(null,{srcStat:s,destStat:a})})}function IK(t,e,r){let{srcStat:n,destStat:i}=RK(t,e);if(i&&ld(n,i))throw new Error("Source and destination must not be the same.");if(n.isDirectory()&&dD(t,e))throw new Error(fd(t,e,r));return{srcStat:n,destStat:i}}function j2(t,e,r,n,i){let o=Kt.resolve(Kt.dirname(t)),s=Kt.resolve(Kt.dirname(r));if(s===o||s===Kt.parse(s).root)return i();let a=(u,c)=>u?u.code==="ENOENT"?i():i(u):ld(e,c)?i(new Error(fd(t,r,n))):j2(t,e,s,n,i);cd?js.stat(s,{bigint:!0},a):js.stat(s,a)}function N2(t,e,r,n){let i=Kt.resolve(Kt.dirname(t)),o=Kt.resolve(Kt.dirname(r));if(o===i||o===Kt.parse(o).root)return;let s;try{s=fD(o)}catch(a){if(a.code==="ENOENT")return;throw a}if(ld(e,s))throw new Error(fd(t,r,n));return N2(t,e,o,n)}function ld(t,e){return!!(e.ino&&e.dev&&e.ino===t.ino&&e.dev===t.dev&&(cd||e.ino<Number.MAX_SAFE_INTEGER||e.size===t.size&&e.mode===t.mode&&e.nlink===t.nlink&&e.atimeMs===t.atimeMs&&e.mtimeMs===t.mtimeMs&&e.ctimeMs===t.ctimeMs&&e.birthtimeMs===t.birthtimeMs))}function dD(t,e){let r=Kt.resolve(t).split(Kt.sep).filter(i=>i),n=Kt.resolve(e).split(Kt.sep).filter(i=>i);return r.reduce((i,o,s)=>i&&n[s]===o,!0)}function fd(t,e,r){return`Cannot ${r} '${t}' to a subdirectory of itself, '${e}'.`}L2.exports={checkPaths:$K,checkPathsSync:IK,checkParentPaths:j2,checkParentPathsSync:N2,isSrcSubdir:dD}});var V2=y((ehe,U2)=>{"use strict";var St=ht(),Ku=require("path"),jK=kr().mkdirsSync,NK=lD().utimesMillisSync,Yu=Wu();function LK(t,e,r){typeof r=="function"&&(r={filter:r}),r=r||{},r.clobber="clobber"in r?!!r.clobber:!0,r.overwrite="overwrite"in r?!!r.overwrite:r.clobber,r.preserveTimestamps&&process.arch==="ia32"&&console.warn(`fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;
41
41
 
42
- see https://github.com/jprichardson/node-fs-extra/issues/269`);let{srcStat:n,destStat:i}=Yu.checkPathsSync(t,e,"copy");return Yu.checkParentPathsSync(t,n,e,"copy"),BK(i,t,e,r)}function BK(t,e,r,n){if(n.filter&&!n.filter(e,r))return;let i=Ku.dirname(r);return St.existsSync(i)||jK(i),q2(t,e,r,n)}function q2(t,e,r,n){if(!(n.filter&&!n.filter(e,r)))return qK(t,e,r,n)}function qK(t,e,r,n){let o=(n.dereference?St.statSync:St.lstatSync)(e);if(o.isDirectory())return WK(o,t,e,r,n);if(o.isFile()||o.isCharacterDevice()||o.isBlockDevice())return MK(o,t,e,r,n);if(o.isSymbolicLink())return JK(t,e,r,n)}function MK(t,e,r,n,i){return e?UK(t,r,n,i):M2(t,r,n,i)}function UK(t,e,r,n){if(n.overwrite)return St.unlinkSync(r),M2(t,e,r,n);if(n.errorOnExist)throw new Error(`'${r}' already exists`)}function M2(t,e,r,n){return St.copyFileSync(e,r),n.preserveTimestamps&&VK(t.mode,e,r),hD(r,t.mode)}function VK(t,e,r){return HK(t)&&zK(r,t),GK(e,r)}function HK(t){return(t&128)===0}function zK(t,e){return hD(t,e|128)}function hD(t,e){return St.chmodSync(t,e)}function GK(t,e){let r=St.statSync(t);return NK(e,r.atime,r.mtime)}function WK(t,e,r,n,i){if(!e)return KK(t.mode,r,n,i);if(e&&!e.isDirectory())throw new Error(`Cannot overwrite non-directory '${n}' with directory '${r}'.`);return U2(r,n,i)}function KK(t,e,r,n){return St.mkdirSync(r),U2(e,r,n),hD(r,t)}function U2(t,e,r){St.readdirSync(t).forEach(n=>YK(n,t,e,r))}function YK(t,e,r,n){let i=Ku.join(e,t),o=Ku.join(r,t),{destStat:s}=Yu.checkPathsSync(i,o,"copy");return q2(s,i,o,n)}function JK(t,e,r,n){let i=St.readlinkSync(e);if(n.dereference&&(i=Ku.resolve(process.cwd(),i)),t){let o;try{o=St.readlinkSync(r)}catch(s){if(s.code==="EINVAL"||s.code==="UNKNOWN")return St.symlinkSync(i,r);throw s}if(n.dereference&&(o=Ku.resolve(process.cwd(),o)),Yu.isSrcSubdir(i,o))throw new Error(`Cannot copy '${i}' to a subdirectory of itself, '${o}'.`);if(St.statSync(r).isDirectory()&&Yu.isSrcSubdir(o,i))throw new Error(`Cannot overwrite '${o}' with '${i}'.`);return XK(i,r)}else return St.symlinkSync(i,r)}function XK(t,e){return St.unlinkSync(e),St.symlinkSync(t,e)}V2.exports=LK});var pD=y((the,z2)=>{"use strict";z2.exports={copySync:H2()}});var ai=y((rhe,W2)=>{"use strict";var ZK=Wt().fromPromise,G2=Gu();function QK(t){return G2.access(t).then(()=>!0).catch(()=>!1)}W2.exports={pathExists:ZK(QK),pathExistsSync:G2.existsSync}});var rO=y((nhe,tO)=>{"use strict";var Yt=ht(),Ju=require("path"),eY=kr().mkdirs,tY=ai().pathExists,rY=lD().utimesMillis,Xu=Wu();function nY(t,e,r,n){typeof r=="function"&&!n?(n=r,r={}):typeof r=="function"&&(r={filter:r}),n=n||function(){},r=r||{},r.clobber="clobber"in r?!!r.clobber:!0,r.overwrite="overwrite"in r?!!r.overwrite:r.clobber,r.preserveTimestamps&&process.arch==="ia32"&&console.warn(`fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;
42
+ see https://github.com/jprichardson/node-fs-extra/issues/269`);let{srcStat:n,destStat:i}=Yu.checkPathsSync(t,e,"copy");return Yu.checkParentPathsSync(t,n,e,"copy"),BK(i,t,e,r)}function BK(t,e,r,n){if(n.filter&&!n.filter(e,r))return;let i=Ku.dirname(r);return St.existsSync(i)||jK(i),B2(t,e,r,n)}function B2(t,e,r,n){if(!(n.filter&&!n.filter(e,r)))return qK(t,e,r,n)}function qK(t,e,r,n){let o=(n.dereference?St.statSync:St.lstatSync)(e);if(o.isDirectory())return WK(o,t,e,r,n);if(o.isFile()||o.isCharacterDevice()||o.isBlockDevice())return MK(o,t,e,r,n);if(o.isSymbolicLink())return JK(t,e,r,n)}function MK(t,e,r,n,i){return e?UK(t,r,n,i):q2(t,r,n,i)}function UK(t,e,r,n){if(n.overwrite)return St.unlinkSync(r),q2(t,e,r,n);if(n.errorOnExist)throw new Error(`'${r}' already exists`)}function q2(t,e,r,n){return St.copyFileSync(e,r),n.preserveTimestamps&&VK(t.mode,e,r),hD(r,t.mode)}function VK(t,e,r){return HK(t)&&zK(r,t),GK(e,r)}function HK(t){return(t&128)===0}function zK(t,e){return hD(t,e|128)}function hD(t,e){return St.chmodSync(t,e)}function GK(t,e){let r=St.statSync(t);return NK(e,r.atime,r.mtime)}function WK(t,e,r,n,i){if(!e)return KK(t.mode,r,n,i);if(e&&!e.isDirectory())throw new Error(`Cannot overwrite non-directory '${n}' with directory '${r}'.`);return M2(r,n,i)}function KK(t,e,r,n){return St.mkdirSync(r),M2(e,r,n),hD(r,t)}function M2(t,e,r){St.readdirSync(t).forEach(n=>YK(n,t,e,r))}function YK(t,e,r,n){let i=Ku.join(e,t),o=Ku.join(r,t),{destStat:s}=Yu.checkPathsSync(i,o,"copy");return B2(s,i,o,n)}function JK(t,e,r,n){let i=St.readlinkSync(e);if(n.dereference&&(i=Ku.resolve(process.cwd(),i)),t){let o;try{o=St.readlinkSync(r)}catch(s){if(s.code==="EINVAL"||s.code==="UNKNOWN")return St.symlinkSync(i,r);throw s}if(n.dereference&&(o=Ku.resolve(process.cwd(),o)),Yu.isSrcSubdir(i,o))throw new Error(`Cannot copy '${i}' to a subdirectory of itself, '${o}'.`);if(St.statSync(r).isDirectory()&&Yu.isSrcSubdir(o,i))throw new Error(`Cannot overwrite '${o}' with '${i}'.`);return XK(i,r)}else return St.symlinkSync(i,r)}function XK(t,e){return St.unlinkSync(e),St.symlinkSync(t,e)}U2.exports=LK});var pD=y((the,H2)=>{"use strict";H2.exports={copySync:V2()}});var ai=y((rhe,G2)=>{"use strict";var ZK=Wt().fromPromise,z2=Gu();function QK(t){return z2.access(t).then(()=>!0).catch(()=>!1)}G2.exports={pathExists:ZK(QK),pathExistsSync:z2.existsSync}});var tO=y((nhe,eO)=>{"use strict";var Yt=ht(),Ju=require("path"),eY=kr().mkdirs,tY=ai().pathExists,rY=lD().utimesMillis,Xu=Wu();function nY(t,e,r,n){typeof r=="function"&&!n?(n=r,r={}):typeof r=="function"&&(r={filter:r}),n=n||function(){},r=r||{},r.clobber="clobber"in r?!!r.clobber:!0,r.overwrite="overwrite"in r?!!r.overwrite:r.clobber,r.preserveTimestamps&&process.arch==="ia32"&&console.warn(`fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;
43
43
 
44
- see https://github.com/jprichardson/node-fs-extra/issues/269`),Xu.checkPaths(t,e,"copy",(i,o)=>{if(i)return n(i);let{srcStat:s,destStat:a}=o;Xu.checkParentPaths(t,s,e,"copy",u=>u?n(u):r.filter?X2(K2,a,t,e,r,n):K2(a,t,e,r,n))})}function K2(t,e,r,n,i){let o=Ju.dirname(r);tY(o,(s,a)=>{if(s)return i(s);if(a)return mD(t,e,r,n,i);eY(o,u=>u?i(u):mD(t,e,r,n,i))})}function X2(t,e,r,n,i,o){Promise.resolve(i.filter(r,n)).then(s=>s?t(e,r,n,i,o):o(),s=>o(s))}function mD(t,e,r,n,i){return n.filter?X2(Y2,t,e,r,n,i):Y2(t,e,r,n,i)}function Y2(t,e,r,n,i){(n.dereference?Yt.stat:Yt.lstat)(e,(s,a)=>{if(s)return i(s);if(a.isDirectory())return lY(a,t,e,r,n,i);if(a.isFile()||a.isCharacterDevice()||a.isBlockDevice())return iY(a,t,e,r,n,i);if(a.isSymbolicLink())return hY(t,e,r,n,i)})}function iY(t,e,r,n,i,o){return e?oY(t,r,n,i,o):Z2(t,r,n,i,o)}function oY(t,e,r,n,i){if(n.overwrite)Yt.unlink(r,o=>o?i(o):Z2(t,e,r,n,i));else return n.errorOnExist?i(new Error(`'${r}' already exists`)):i()}function Z2(t,e,r,n,i){Yt.copyFile(e,r,o=>o?i(o):n.preserveTimestamps?sY(t.mode,e,r,i):dd(r,t.mode,i))}function sY(t,e,r,n){return aY(t)?uY(r,t,i=>i?n(i):J2(t,e,r,n)):J2(t,e,r,n)}function aY(t){return(t&128)===0}function uY(t,e,r){return dd(t,e|128,r)}function J2(t,e,r,n){cY(e,r,i=>i?n(i):dd(r,t,n))}function dd(t,e,r){return Yt.chmod(t,e,r)}function cY(t,e,r){Yt.stat(t,(n,i)=>n?r(n):rY(e,i.atime,i.mtime,r))}function lY(t,e,r,n,i,o){return e?e&&!e.isDirectory()?o(new Error(`Cannot overwrite non-directory '${n}' with directory '${r}'.`)):Q2(r,n,i,o):fY(t.mode,r,n,i,o)}function fY(t,e,r,n,i){Yt.mkdir(r,o=>{if(o)return i(o);Q2(e,r,n,s=>s?i(s):dd(r,t,i))})}function Q2(t,e,r,n){Yt.readdir(t,(i,o)=>i?n(i):eO(o,t,e,r,n))}function eO(t,e,r,n,i){let o=t.pop();return o?dY(t,o,e,r,n,i):i()}function dY(t,e,r,n,i,o){let s=Ju.join(r,e),a=Ju.join(n,e);Xu.checkPaths(s,a,"copy",(u,c)=>{if(u)return o(u);let{destStat:l}=c;mD(l,s,a,i,f=>f?o(f):eO(t,r,n,i,o))})}function hY(t,e,r,n,i){Yt.readlink(e,(o,s)=>{if(o)return i(o);if(n.dereference&&(s=Ju.resolve(process.cwd(),s)),t)Yt.readlink(r,(a,u)=>a?a.code==="EINVAL"||a.code==="UNKNOWN"?Yt.symlink(s,r,i):i(a):(n.dereference&&(u=Ju.resolve(process.cwd(),u)),Xu.isSrcSubdir(s,u)?i(new Error(`Cannot copy '${s}' to a subdirectory of itself, '${u}'.`)):t.isDirectory()&&Xu.isSrcSubdir(u,s)?i(new Error(`Cannot overwrite '${u}' with '${s}'.`)):pY(s,r,i)));else return Yt.symlink(s,r,i)})}function pY(t,e,r){Yt.unlink(e,n=>n?r(n):Yt.symlink(t,e,r))}tO.exports=nY});var gD=y((ihe,nO)=>{"use strict";var mY=Wt().fromCallback;nO.exports={copy:mY(rO())}});var dO=y((ohe,fO)=>{"use strict";var iO=ht(),uO=require("path"),Se=require("assert"),Zu=process.platform==="win32";function cO(t){["unlink","chmod","stat","lstat","rmdir","readdir"].forEach(r=>{t[r]=t[r]||iO[r],r=r+"Sync",t[r]=t[r]||iO[r]}),t.maxBusyTries=t.maxBusyTries||3}function yD(t,e,r){let n=0;typeof e=="function"&&(r=e,e={}),Se(t,"rimraf: missing path"),Se.strictEqual(typeof t,"string","rimraf: path should be a string"),Se.strictEqual(typeof r,"function","rimraf: callback function required"),Se(e,"rimraf: invalid options argument provided"),Se.strictEqual(typeof e,"object","rimraf: options should be object"),cO(e),oO(t,e,function i(o){if(o){if((o.code==="EBUSY"||o.code==="ENOTEMPTY"||o.code==="EPERM")&&n<e.maxBusyTries){n++;let s=n*100;return setTimeout(()=>oO(t,e,i),s)}o.code==="ENOENT"&&(o=null)}r(o)})}function oO(t,e,r){Se(t),Se(e),Se(typeof r=="function"),e.lstat(t,(n,i)=>{if(n&&n.code==="ENOENT")return r(null);if(n&&n.code==="EPERM"&&Zu)return sO(t,e,n,r);if(i&&i.isDirectory())return hd(t,e,n,r);e.unlink(t,o=>{if(o){if(o.code==="ENOENT")return r(null);if(o.code==="EPERM")return Zu?sO(t,e,o,r):hd(t,e,o,r);if(o.code==="EISDIR")return hd(t,e,o,r)}return r(o)})})}function sO(t,e,r,n){Se(t),Se(e),Se(typeof n=="function"),e.chmod(t,438,i=>{i?n(i.code==="ENOENT"?null:r):e.stat(t,(o,s)=>{o?n(o.code==="ENOENT"?null:r):s.isDirectory()?hd(t,e,r,n):e.unlink(t,n)})})}function aO(t,e,r){let n;Se(t),Se(e);try{e.chmodSync(t,438)}catch(i){if(i.code==="ENOENT")return;throw r}try{n=e.statSync(t)}catch(i){if(i.code==="ENOENT")return;throw r}n.isDirectory()?pd(t,e,r):e.unlinkSync(t)}function hd(t,e,r,n){Se(t),Se(e),Se(typeof n=="function"),e.rmdir(t,i=>{i&&(i.code==="ENOTEMPTY"||i.code==="EEXIST"||i.code==="EPERM")?gY(t,e,n):i&&i.code==="ENOTDIR"?n(r):n(i)})}function gY(t,e,r){Se(t),Se(e),Se(typeof r=="function"),e.readdir(t,(n,i)=>{if(n)return r(n);let o=i.length,s;if(o===0)return e.rmdir(t,r);i.forEach(a=>{yD(uO.join(t,a),e,u=>{if(!s){if(u)return r(s=u);--o===0&&e.rmdir(t,r)}})})})}function lO(t,e){let r;e=e||{},cO(e),Se(t,"rimraf: missing path"),Se.strictEqual(typeof t,"string","rimraf: path should be a string"),Se(e,"rimraf: missing options"),Se.strictEqual(typeof e,"object","rimraf: options should be object");try{r=e.lstatSync(t)}catch(n){if(n.code==="ENOENT")return;n.code==="EPERM"&&Zu&&aO(t,e,n)}try{r&&r.isDirectory()?pd(t,e,null):e.unlinkSync(t)}catch(n){if(n.code==="ENOENT")return;if(n.code==="EPERM")return Zu?aO(t,e,n):pd(t,e,n);if(n.code!=="EISDIR")throw n;pd(t,e,n)}}function pd(t,e,r){Se(t),Se(e);try{e.rmdirSync(t)}catch(n){if(n.code==="ENOTDIR")throw r;if(n.code==="ENOTEMPTY"||n.code==="EEXIST"||n.code==="EPERM")yY(t,e);else if(n.code!=="ENOENT")throw n}}function yY(t,e){if(Se(t),Se(e),e.readdirSync(t).forEach(r=>lO(uO.join(t,r),e)),Zu){let r=Date.now();do try{return e.rmdirSync(t,e)}catch{}while(Date.now()-r<500)}else return e.rmdirSync(t,e)}fO.exports=yD;yD.sync=lO});var Qu=y((she,pO)=>{"use strict";var DY=Wt().fromCallback,hO=dO();pO.exports={remove:DY(hO),removeSync:hO.sync}});var _O=y((ahe,wO)=>{"use strict";var vY=Wt().fromCallback,yO=ht(),DO=require("path"),vO=kr(),bO=Qu(),mO=vY(function(e,r){r=r||function(){},yO.readdir(e,(n,i)=>{if(n)return vO.mkdirs(e,r);i=i.map(s=>DO.join(e,s)),o();function o(){let s=i.pop();if(!s)return r();bO.remove(s,a=>{if(a)return r(a);o()})}})});function gO(t){let e;try{e=yO.readdirSync(t)}catch{return vO.mkdirsSync(t)}e.forEach(r=>{r=DO.join(t,r),bO.removeSync(r)})}wO.exports={emptyDirSync:gO,emptydirSync:gO,emptyDir:mO,emptydir:mO}});var xO=y((uhe,SO)=>{"use strict";var bY=Wt().fromCallback,EO=require("path"),ui=ht(),CO=kr();function wY(t,e){function r(){ui.writeFile(t,"",n=>{if(n)return e(n);e()})}ui.stat(t,(n,i)=>{if(!n&&i.isFile())return e();let o=EO.dirname(t);ui.stat(o,(s,a)=>{if(s)return s.code==="ENOENT"?CO.mkdirs(o,u=>{if(u)return e(u);r()}):e(s);a.isDirectory()?r():ui.readdir(o,u=>{if(u)return e(u)})})})}function _Y(t){let e;try{e=ui.statSync(t)}catch{}if(e&&e.isFile())return;let r=EO.dirname(t);try{ui.statSync(r).isDirectory()||ui.readdirSync(r)}catch(n){if(n&&n.code==="ENOENT")CO.mkdirsSync(r);else throw n}ui.writeFileSync(t,"")}SO.exports={createFile:bY(wY),createFileSync:_Y}});var TO=y((che,kO)=>{"use strict";var EY=Wt().fromCallback,OO=require("path"),uo=ht(),AO=kr(),FO=ai().pathExists;function CY(t,e,r){function n(i,o){uo.link(i,o,s=>{if(s)return r(s);r(null)})}FO(e,(i,o)=>{if(i)return r(i);if(o)return r(null);uo.lstat(t,s=>{if(s)return s.message=s.message.replace("lstat","ensureLink"),r(s);let a=OO.dirname(e);FO(a,(u,c)=>{if(u)return r(u);if(c)return n(t,e);AO.mkdirs(a,l=>{if(l)return r(l);n(t,e)})})})})}function SY(t,e){if(uo.existsSync(e))return;try{uo.lstatSync(t)}catch(o){throw o.message=o.message.replace("lstat","ensureLink"),o}let n=OO.dirname(e);return uo.existsSync(n)||AO.mkdirsSync(n),uo.linkSync(t,e)}kO.exports={createLink:EY(CY),createLinkSync:SY}});var RO=y((lhe,PO)=>{"use strict";var ci=require("path"),ec=ht(),xY=ai().pathExists;function FY(t,e,r){if(ci.isAbsolute(t))return ec.lstat(t,n=>n?(n.message=n.message.replace("lstat","ensureSymlink"),r(n)):r(null,{toCwd:t,toDst:t}));{let n=ci.dirname(e),i=ci.join(n,t);return xY(i,(o,s)=>o?r(o):s?r(null,{toCwd:i,toDst:t}):ec.lstat(t,a=>a?(a.message=a.message.replace("lstat","ensureSymlink"),r(a)):r(null,{toCwd:t,toDst:ci.relative(n,t)})))}}function OY(t,e){let r;if(ci.isAbsolute(t)){if(r=ec.existsSync(t),!r)throw new Error("absolute srcpath does not exist");return{toCwd:t,toDst:t}}else{let n=ci.dirname(e),i=ci.join(n,t);if(r=ec.existsSync(i),r)return{toCwd:i,toDst:t};if(r=ec.existsSync(t),!r)throw new Error("relative srcpath does not exist");return{toCwd:t,toDst:ci.relative(n,t)}}}PO.exports={symlinkPaths:FY,symlinkPathsSync:OY}});var jO=y((fhe,IO)=>{"use strict";var $O=ht();function AY(t,e,r){if(r=typeof e=="function"?e:r,e=typeof e=="function"?!1:e,e)return r(null,e);$O.lstat(t,(n,i)=>{if(n)return r(null,"file");e=i&&i.isDirectory()?"dir":"file",r(null,e)})}function kY(t,e){let r;if(e)return e;try{r=$O.lstatSync(t)}catch{return"file"}return r&&r.isDirectory()?"dir":"file"}IO.exports={symlinkType:AY,symlinkTypeSync:kY}});var VO=y((dhe,UO)=>{"use strict";var TY=Wt().fromCallback,LO=require("path"),Ns=ht(),BO=kr(),PY=BO.mkdirs,RY=BO.mkdirsSync,qO=RO(),$Y=qO.symlinkPaths,IY=qO.symlinkPathsSync,MO=jO(),jY=MO.symlinkType,NY=MO.symlinkTypeSync,NO=ai().pathExists;function LY(t,e,r,n){n=typeof r=="function"?r:n,r=typeof r=="function"?!1:r,NO(e,(i,o)=>{if(i)return n(i);if(o)return n(null);$Y(t,e,(s,a)=>{if(s)return n(s);t=a.toDst,jY(a.toCwd,r,(u,c)=>{if(u)return n(u);let l=LO.dirname(e);NO(l,(f,h)=>{if(f)return n(f);if(h)return Ns.symlink(t,e,c,n);PY(l,d=>{if(d)return n(d);Ns.symlink(t,e,c,n)})})})})})}function BY(t,e,r){if(Ns.existsSync(e))return;let i=IY(t,e);t=i.toDst,r=NY(i.toCwd,r);let o=LO.dirname(e);return Ns.existsSync(o)||RY(o),Ns.symlinkSync(t,e,r)}UO.exports={createSymlink:TY(LY),createSymlinkSync:BY}});var zO=y((hhe,HO)=>{"use strict";var md=xO(),gd=TO(),yd=VO();HO.exports={createFile:md.createFile,createFileSync:md.createFileSync,ensureFile:md.createFile,ensureFileSync:md.createFileSync,createLink:gd.createLink,createLinkSync:gd.createLinkSync,ensureLink:gd.createLink,ensureLinkSync:gd.createLinkSync,createSymlink:yd.createSymlink,createSymlinkSync:yd.createSymlinkSync,ensureSymlink:yd.createSymlink,ensureSymlinkSync:yd.createSymlinkSync}});var Dd=y((phe,GO)=>{function qY(t,{EOL:e=`
45
- `,finalEOL:r=!0,replacer:n=null,spaces:i}={}){let o=r?e:"";return JSON.stringify(t,n,i).replace(/\n/g,e)+o}function MY(t){return Buffer.isBuffer(t)&&(t=t.toString("utf8")),t.replace(/^\uFEFF/,"")}GO.exports={stringify:qY,stripBom:MY}});var JO=y((mhe,YO)=>{var Ls;try{Ls=ht()}catch{Ls=require("fs")}var vd=Wt(),{stringify:WO,stripBom:KO}=Dd();async function UY(t,e={}){typeof e=="string"&&(e={encoding:e});let r=e.fs||Ls,n="throws"in e?e.throws:!0,i=await vd.fromCallback(r.readFile)(t,e);i=KO(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 VY=vd.fromPromise(UY);function HY(t,e={}){typeof e=="string"&&(e={encoding:e});let r=e.fs||Ls,n="throws"in e?e.throws:!0;try{let i=r.readFileSync(t,e);return i=KO(i),JSON.parse(i,e.reviver)}catch(i){if(n)throw i.message=`${t}: ${i.message}`,i;return null}}async function zY(t,e,r={}){let n=r.fs||Ls,i=WO(e,r);await vd.fromCallback(n.writeFile)(t,i,r)}var GY=vd.fromPromise(zY);function WY(t,e,r={}){let n=r.fs||Ls,i=WO(e,r);return n.writeFileSync(t,i,r)}var KY={readFile:VY,readFileSync:HY,writeFile:GY,writeFileSync:WY};YO.exports=KY});var ZO=y((ghe,XO)=>{"use strict";var bd=JO();XO.exports={readJson:bd.readFile,readJsonSync:bd.readFileSync,writeJson:bd.writeFile,writeJsonSync:bd.writeFileSync}});var wd=y((yhe,tA)=>{"use strict";var YY=Wt().fromCallback,tc=ht(),QO=require("path"),eA=kr(),JY=ai().pathExists;function XY(t,e,r,n){typeof r=="function"&&(n=r,r="utf8");let i=QO.dirname(t);JY(i,(o,s)=>{if(o)return n(o);if(s)return tc.writeFile(t,e,r,n);eA.mkdirs(i,a=>{if(a)return n(a);tc.writeFile(t,e,r,n)})})}function ZY(t,...e){let r=QO.dirname(t);if(tc.existsSync(r))return tc.writeFileSync(t,...e);eA.mkdirsSync(r),tc.writeFileSync(t,...e)}tA.exports={outputFile:YY(XY),outputFileSync:ZY}});var nA=y((Dhe,rA)=>{"use strict";var{stringify:QY}=Dd(),{outputFile:eJ}=wd();async function tJ(t,e,r={}){let n=QY(e,r);await eJ(t,n,r)}rA.exports=tJ});var oA=y((vhe,iA)=>{"use strict";var{stringify:rJ}=Dd(),{outputFileSync:nJ}=wd();function iJ(t,e,r){let n=rJ(e,r);nJ(t,n,r)}iA.exports=iJ});var aA=y((bhe,sA)=>{"use strict";var oJ=Wt().fromPromise,Rt=ZO();Rt.outputJson=oJ(nA());Rt.outputJsonSync=oA();Rt.outputJSON=Rt.outputJson;Rt.outputJSONSync=Rt.outputJsonSync;Rt.writeJSON=Rt.writeJson;Rt.writeJSONSync=Rt.writeJsonSync;Rt.readJSON=Rt.readJson;Rt.readJSONSync=Rt.readJsonSync;sA.exports=Rt});var hA=y((whe,dA)=>{"use strict";var lA=ht(),sJ=require("path"),aJ=pD().copySync,fA=Qu().removeSync,uJ=kr().mkdirpSync,uA=Wu();function cJ(t,e,r){r=r||{};let n=r.overwrite||r.clobber||!1,{srcStat:i}=uA.checkPathsSync(t,e,"move");return uA.checkParentPathsSync(t,i,e,"move"),uJ(sJ.dirname(e)),lJ(t,e,n)}function lJ(t,e,r){if(r)return fA(e),cA(t,e,r);if(lA.existsSync(e))throw new Error("dest already exists.");return cA(t,e,r)}function cA(t,e,r){try{lA.renameSync(t,e)}catch(n){if(n.code!=="EXDEV")throw n;return fJ(t,e,r)}}function fJ(t,e,r){return aJ(t,e,{overwrite:r,errorOnExist:!0}),fA(t)}dA.exports=cJ});var mA=y((_he,pA)=>{"use strict";pA.exports={moveSync:hA()}});var bA=y((Ehe,vA)=>{"use strict";var dJ=ht(),hJ=require("path"),pJ=gD().copy,DA=Qu().remove,mJ=kr().mkdirp,gJ=ai().pathExists,gA=Wu();function yJ(t,e,r,n){typeof r=="function"&&(n=r,r={});let i=r.overwrite||r.clobber||!1;gA.checkPaths(t,e,"move",(o,s)=>{if(o)return n(o);let{srcStat:a}=s;gA.checkParentPaths(t,a,e,"move",u=>{if(u)return n(u);mJ(hJ.dirname(e),c=>c?n(c):DJ(t,e,i,n))})})}function DJ(t,e,r,n){if(r)return DA(e,i=>i?n(i):yA(t,e,r,n));gJ(e,(i,o)=>i?n(i):o?n(new Error("dest already exists.")):yA(t,e,r,n))}function yA(t,e,r,n){dJ.rename(t,e,i=>i?i.code!=="EXDEV"?n(i):vJ(t,e,r,n):n())}function vJ(t,e,r,n){pJ(t,e,{overwrite:r,errorOnExist:!0},o=>o?n(o):DA(t,n))}vA.exports=yJ});var _A=y((Che,wA)=>{"use strict";var bJ=Wt().fromCallback;wA.exports={move:bJ(bA())}});var _d=y((She,DD)=>{"use strict";DD.exports={...Gu(),...pD(),...gD(),..._O(),...zO(),...aA(),...kr(),...mA(),..._A(),...wd(),...ai(),...Qu()};var EA=require("fs");Object.getOwnPropertyDescriptor(EA,"promises")&&Object.defineProperty(DD.exports,"promises",{get(){return EA.promises}})});var vD=y(Bs=>{"use strict";Object.defineProperty(Bs,"__esModule",{value:!0});Bs.readdir=Bs.stat=void 0;var CA=_d();async function wJ(t){try{return await CA.stat(t)}catch{}}Bs.stat=wJ;async function _J(t){try{return await CA.readdir(t)}catch{return[]}}Bs.readdir=_J});var qs=y(re=>{"use strict";Object.defineProperty(re,"__esModule",{value:!0});re.walk=re.Walker=re.compilePaths=re.tmpfilepath=re.findBaseDirectory=re.isExecutableFile=re.pathExecutable=re.pathWritable=re.pathReadable=re.pathExists=re.pathAccessible=re.writeStreamToFile=re.cacheFileChecksum=re.getFileChecksums=re.getFileChecksum=re.fileToString=re.getFileTree=re.readdirp=re.readdirSafe=re.statSafe=void 0;var EJ=(x2(),Ae(S2)),vr=_d(),CJ=require("os"),xn=require("path"),SA=require("stream"),xA=vD();EJ.__exportStar(_d(),re);var FA=vD();Object.defineProperty(re,"statSafe",{enumerable:!0,get:function(){return FA.stat}});Object.defineProperty(re,"readdirSafe",{enumerable:!0,get:function(){return FA.readdir}});async function SJ(t,{filter:e,onError:r,walkerOptions:n}={}){return new Promise((i,o)=>{let s=[],a=wD(t,n);e&&(a=a.pipe(new SA.Transform({objectMode:!0,transform(u,c,l){(!e||e(u))&&this.push(u),l()}}))),a.on("error",u=>r?r(u):o(u)).on("data",u=>s.push(u.path)).on("end",()=>i(s))})}re.readdirp=SJ;async function xJ(t,{onError:e,onFileNode:r=o=>o,onDirectoryNode:n=o=>o,walkerOptions:i}={}){let o=new Map([]),s=u=>{let c=xn.dirname(u.path),l=o.get(c);return l&&l.type==="directory"?l:n({path:c,type:"directory",children:[]})},a=(u,c)=>{let l={path:u.path,parent:c};return u.stats.isDirectory()?n({...l,type:"directory",children:[]}):r({...l,type:"file"})};return new Promise((u,c)=>{t=xn.resolve(t),wD(t,i).on("error",f=>e?e(f):c(f)).on("data",f=>{let h=s(f),d=a(f,h);h.children.push(d),o.set(f.path,d),o.set(h.path,h)}).on("end",()=>{let f=o.get(t);if(!f)return c(new Error("No root node found after walking directory structure."));delete f.parent,u(f)})})}re.getFileTree=xJ;async function FJ(t){try{return await vr.readFile(t,{encoding:"utf8"})}catch(e){if(e.code==="ENOENT"||e.code==="ENOTDIR")return"";throw e}}re.fileToString=FJ;async function bD(t){let e=await Promise.resolve().then(()=>require("crypto"));return new Promise((r,n)=>{let i=e.createHash("md5"),o=vr.createReadStream(t);o.on("error",s=>{n(s)}),i.once("readable",()=>{let s=i.read().toString("hex");r(s)}),o.pipe(i)})}re.getFileChecksum=bD;async function OJ(t){return Promise.all([bD(t),(async()=>{try{return(await vr.readFile(`${t}.md5`,{encoding:"utf8"})).trim()}catch(e){if(e.code!=="ENOENT")throw e}})()])}re.getFileChecksums=OJ;async function AJ(t,e){let r=await bD(t);await vr.writeFile(`${t}.md5`,r,{encoding:"utf8"})}re.cacheFileChecksum=AJ;function kJ(t,e){return new Promise((r,n)=>{let i=vr.createWriteStream(e);t.pipe(i),i.on("error",n),i.on("finish",r)})}re.writeStreamToFile=kJ;async function rc(t,e){try{await vr.access(t,e)}catch{return!1}return!0}re.pathAccessible=rc;async function TJ(t){return rc(t,vr.constants.F_OK)}re.pathExists=TJ;async function PJ(t){return rc(t,vr.constants.R_OK)}re.pathReadable=PJ;async function RJ(t){return rc(t,vr.constants.W_OK)}re.pathWritable=RJ;async function OA(t){return rc(t,vr.constants.X_OK)}re.pathExecutable=OA;async function $J(t){let[e,r]=await Promise.all([xA.stat(t),OA(t)]);return!!e&&(e.isFile()||e.isSymbolicLink())&&r}re.isExecutableFile=$J;async function IJ(t,e){if(!(!t||!e)){for(let r of AA(t))if((await xA.readdir(r)).includes(e))return r}}re.findBaseDirectory=IJ;function jJ(t){let e=Math.random().toString(16).substring(2,8);return xn.resolve(CJ.tmpdir(),t?`${t}-${e}`:e)}re.tmpfilepath=jJ;function AA(t){if(t=xn.normalize(t),!xn.isAbsolute(t))throw new Error(`${t} is not an absolute path`);let e=xn.parse(t);return t===e.root?[t]:t.slice(e.root.length).split(xn.sep).map((r,n,i)=>e.root+xn.join(...i.slice(0,i.length-n))).concat(e.root)}re.compilePaths=AA;var Ed=class extends SA.Readable{constructor(e,r={}){super({objectMode:!0}),this.p=e,this.options=r,this.paths=[this.p]}_read(){let e=this.paths.shift(),{pathFilter:r}=this.options;if(!e){this.push(null);return}vr.lstat(e,(n,i)=>{if(n){this.emit("error",n);return}let o={path:e,stats:i};i.isDirectory()?vr.readdir(e,(s,a)=>{if(s){this.emit("error",s);return}let u=a.map(c=>xn.join(e,c));r&&(u=u.filter(c=>r(c.substring(this.p.length+1)))),this.paths.push(...u),this.push(o)}):this.push(o)})}};re.Walker=Ed;function wD(t,e={}){return new Ed(t,e)}re.walk=wD});var _D=y((Ohe,kA)=>{var Ms=1e3,Us=Ms*60,Vs=Us*60,co=Vs*24,NJ=co*7,LJ=co*365.25;kA.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return BJ(t);if(r==="number"&&isFinite(t))return e.long?MJ(t):qJ(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function BJ(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*LJ;case"weeks":case"week":case"w":return r*NJ;case"days":case"day":case"d":return r*co;case"hours":case"hour":case"hrs":case"hr":case"h":return r*Vs;case"minutes":case"minute":case"mins":case"min":case"m":return r*Us;case"seconds":case"second":case"secs":case"sec":case"s":return r*Ms;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}function qJ(t){var e=Math.abs(t);return e>=co?Math.round(t/co)+"d":e>=Vs?Math.round(t/Vs)+"h":e>=Us?Math.round(t/Us)+"m":e>=Ms?Math.round(t/Ms)+"s":t+"ms"}function MJ(t){var e=Math.abs(t);return e>=co?Cd(t,e,co,"day"):e>=Vs?Cd(t,e,Vs,"hour"):e>=Us?Cd(t,e,Us,"minute"):e>=Ms?Cd(t,e,Ms,"second"):t+" ms"}function Cd(t,e,r,n){var i=e>=r*1.5;return Math.round(t/r)+" "+n+(i?"s":"")}});var ED=y((Ahe,TA)=>{function UJ(t){r.debug=r,r.default=r,r.coerce=u,r.disable=o,r.enable=i,r.enabled=s,r.humanize=_D(),r.destroy=c,Object.keys(t).forEach(l=>{r[l]=t[l]}),r.names=[],r.skips=[],r.formatters={};function e(l){let f=0;for(let h=0;h<l.length;h++)f=(f<<5)-f+l.charCodeAt(h),f|=0;return r.colors[Math.abs(f)%r.colors.length]}r.selectColor=e;function r(l){let f,h=null,d,m;function b(...g){if(!b.enabled)return;let w=b,x=Number(new Date),D=x-(f||x);w.diff=D,w.prev=f,w.curr=x,f=x,g[0]=r.coerce(g[0]),typeof g[0]!="string"&&g.unshift("%O");let C=0;g[0]=g[0].replace(/%([a-zA-Z%])/g,($,F)=>{if($==="%%")return"%";C++;let L=r.formatters[F];if(typeof L=="function"){let S=g[C];$=L.call(w,S),g.splice(C,1),C--}return $}),r.formatArgs.call(w,g),(w.log||r.log).apply(w,g)}return b.namespace=l,b.useColors=r.useColors(),b.color=r.selectColor(l),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(l)),m),set:g=>{h=g}}),typeof r.init=="function"&&r.init(b),b}function n(l,f){let h=r(this.namespace+(typeof f>"u"?":":f)+l);return h.log=this.log,h}function i(l){r.save(l),r.namespaces=l,r.names=[],r.skips=[];let f,h=(typeof l=="string"?l:"").split(/[\s,]+/),d=h.length;for(f=0;f<d;f++)h[f]&&(l=h[f].replace(/\*/g,".*?"),l[0]==="-"?r.skips.push(new RegExp("^"+l.slice(1)+"$")):r.names.push(new RegExp("^"+l+"$")))}function o(){let l=[...r.names.map(a),...r.skips.map(a).map(f=>"-"+f)].join(",");return r.enable(""),l}function s(l){if(l[l.length-1]==="*")return!0;let f,h;for(f=0,h=r.skips.length;f<h;f++)if(r.skips[f].test(l))return!1;for(f=0,h=r.names.length;f<h;f++)if(r.names[f].test(l))return!0;return!1}function a(l){return l.toString().substring(2,l.toString().length-2).replace(/\.\*\?$/,"*")}function u(l){return l instanceof Error?l.stack||l.message:l}function c(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return r.enable(r.load()),r}TA.exports=UJ});var PA=y((or,Sd)=>{or.formatArgs=HJ;or.save=zJ;or.load=GJ;or.useColors=VJ;or.storage=WJ();or.destroy=(()=>{let t=!1;return()=>{t||(t=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();or.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function VJ(){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 HJ(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+Sd.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;t.splice(1,0,e,"color: inherit");let r=0,n=0;t[0].replace(/%[a-zA-Z%]/g,i=>{i!=="%%"&&(r++,i==="%c"&&(n=r))}),t.splice(n,0,e)}or.log=console.debug||console.log||(()=>{});function zJ(t){try{t?or.storage.setItem("debug",t):or.storage.removeItem("debug")}catch{}}function GJ(){let t;try{t=or.storage.getItem("debug")}catch{}return!t&&typeof process<"u"&&"env"in process&&(t=process.env.DEBUG),t}function WJ(){try{return localStorage}catch{}}Sd.exports=ED()(or);var{formatters:KJ}=Sd.exports;KJ.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var $A=y((khe,RA)=>{"use strict";RA.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 xD=y((The,jA)=>{"use strict";var YJ=require("os"),IA=require("tty"),br=$A(),{env:mt}=process,li;br("no-color")||br("no-colors")||br("color=false")||br("color=never")?li=0:(br("color")||br("colors")||br("color=true")||br("color=always"))&&(li=1);"FORCE_COLOR"in mt&&(mt.FORCE_COLOR==="true"?li=1:mt.FORCE_COLOR==="false"?li=0:li=mt.FORCE_COLOR.length===0?1:Math.min(parseInt(mt.FORCE_COLOR,10),3));function CD(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}function SD(t,e){if(li===0)return 0;if(br("color=16m")||br("color=full")||br("color=truecolor"))return 3;if(br("color=256"))return 2;if(t&&!e&&li===void 0)return 0;let r=li||0;if(mt.TERM==="dumb")return r;if(process.platform==="win32"){let n=YJ.release().split(".");return Number(n[0])>=10&&Number(n[2])>=10586?Number(n[2])>=14931?3:2:1}if("CI"in mt)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(n=>n in mt)||mt.CI_NAME==="codeship"?1:r;if("TEAMCITY_VERSION"in mt)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(mt.TEAMCITY_VERSION)?1:0;if(mt.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in mt){let n=parseInt((mt.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(mt.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(mt.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(mt.TERM)||"COLORTERM"in mt?1:r}function JJ(t){let e=SD(t,t&&t.isTTY);return CD(e)}jA.exports={supportsColor:JJ,stdout:CD(SD(!0,IA.isatty(1))),stderr:CD(SD(!0,IA.isatty(2)))}});var LA=y((gt,Fd)=>{var XJ=require("tty"),xd=require("util");gt.init=iX;gt.log=tX;gt.formatArgs=QJ;gt.save=rX;gt.load=nX;gt.useColors=ZJ;gt.destroy=xd.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");gt.colors=[6,2,3,4,5,1];try{let t=xD();t&&(t.stderr||t).level>=2&&(gt.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{}gt.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 ZJ(){return"colors"in gt.inspectOpts?!!gt.inspectOpts.colors:XJ.isatty(process.stderr.fd)}function QJ(t){let{namespace:e,useColors:r}=this;if(r){let n=this.color,i="\x1B[3"+(n<8?n:"8;5;"+n),o=` ${i};1m${e} \x1B[0m`;t[0]=o+t[0].split(`
44
+ see https://github.com/jprichardson/node-fs-extra/issues/269`),Xu.checkPaths(t,e,"copy",(i,o)=>{if(i)return n(i);let{srcStat:s,destStat:a}=o;Xu.checkParentPaths(t,s,e,"copy",u=>u?n(u):r.filter?J2(W2,a,t,e,r,n):W2(a,t,e,r,n))})}function W2(t,e,r,n,i){let o=Ju.dirname(r);tY(o,(s,a)=>{if(s)return i(s);if(a)return mD(t,e,r,n,i);eY(o,u=>u?i(u):mD(t,e,r,n,i))})}function J2(t,e,r,n,i,o){Promise.resolve(i.filter(r,n)).then(s=>s?t(e,r,n,i,o):o(),s=>o(s))}function mD(t,e,r,n,i){return n.filter?J2(K2,t,e,r,n,i):K2(t,e,r,n,i)}function K2(t,e,r,n,i){(n.dereference?Yt.stat:Yt.lstat)(e,(s,a)=>{if(s)return i(s);if(a.isDirectory())return lY(a,t,e,r,n,i);if(a.isFile()||a.isCharacterDevice()||a.isBlockDevice())return iY(a,t,e,r,n,i);if(a.isSymbolicLink())return hY(t,e,r,n,i)})}function iY(t,e,r,n,i,o){return e?oY(t,r,n,i,o):X2(t,r,n,i,o)}function oY(t,e,r,n,i){if(n.overwrite)Yt.unlink(r,o=>o?i(o):X2(t,e,r,n,i));else return n.errorOnExist?i(new Error(`'${r}' already exists`)):i()}function X2(t,e,r,n,i){Yt.copyFile(e,r,o=>o?i(o):n.preserveTimestamps?sY(t.mode,e,r,i):dd(r,t.mode,i))}function sY(t,e,r,n){return aY(t)?uY(r,t,i=>i?n(i):Y2(t,e,r,n)):Y2(t,e,r,n)}function aY(t){return(t&128)===0}function uY(t,e,r){return dd(t,e|128,r)}function Y2(t,e,r,n){cY(e,r,i=>i?n(i):dd(r,t,n))}function dd(t,e,r){return Yt.chmod(t,e,r)}function cY(t,e,r){Yt.stat(t,(n,i)=>n?r(n):rY(e,i.atime,i.mtime,r))}function lY(t,e,r,n,i,o){return e?e&&!e.isDirectory()?o(new Error(`Cannot overwrite non-directory '${n}' with directory '${r}'.`)):Z2(r,n,i,o):fY(t.mode,r,n,i,o)}function fY(t,e,r,n,i){Yt.mkdir(r,o=>{if(o)return i(o);Z2(e,r,n,s=>s?i(s):dd(r,t,i))})}function Z2(t,e,r,n){Yt.readdir(t,(i,o)=>i?n(i):Q2(o,t,e,r,n))}function Q2(t,e,r,n,i){let o=t.pop();return o?dY(t,o,e,r,n,i):i()}function dY(t,e,r,n,i,o){let s=Ju.join(r,e),a=Ju.join(n,e);Xu.checkPaths(s,a,"copy",(u,c)=>{if(u)return o(u);let{destStat:l}=c;mD(l,s,a,i,f=>f?o(f):Q2(t,r,n,i,o))})}function hY(t,e,r,n,i){Yt.readlink(e,(o,s)=>{if(o)return i(o);if(n.dereference&&(s=Ju.resolve(process.cwd(),s)),t)Yt.readlink(r,(a,u)=>a?a.code==="EINVAL"||a.code==="UNKNOWN"?Yt.symlink(s,r,i):i(a):(n.dereference&&(u=Ju.resolve(process.cwd(),u)),Xu.isSrcSubdir(s,u)?i(new Error(`Cannot copy '${s}' to a subdirectory of itself, '${u}'.`)):t.isDirectory()&&Xu.isSrcSubdir(u,s)?i(new Error(`Cannot overwrite '${u}' with '${s}'.`)):pY(s,r,i)));else return Yt.symlink(s,r,i)})}function pY(t,e,r){Yt.unlink(e,n=>n?r(n):Yt.symlink(t,e,r))}eO.exports=nY});var gD=y((ihe,rO)=>{"use strict";var mY=Wt().fromCallback;rO.exports={copy:mY(tO())}});var fO=y((ohe,lO)=>{"use strict";var nO=ht(),aO=require("path"),Se=require("assert"),Zu=process.platform==="win32";function uO(t){["unlink","chmod","stat","lstat","rmdir","readdir"].forEach(r=>{t[r]=t[r]||nO[r],r=r+"Sync",t[r]=t[r]||nO[r]}),t.maxBusyTries=t.maxBusyTries||3}function yD(t,e,r){let n=0;typeof e=="function"&&(r=e,e={}),Se(t,"rimraf: missing path"),Se.strictEqual(typeof t,"string","rimraf: path should be a string"),Se.strictEqual(typeof r,"function","rimraf: callback function required"),Se(e,"rimraf: invalid options argument provided"),Se.strictEqual(typeof e,"object","rimraf: options should be object"),uO(e),iO(t,e,function i(o){if(o){if((o.code==="EBUSY"||o.code==="ENOTEMPTY"||o.code==="EPERM")&&n<e.maxBusyTries){n++;let s=n*100;return setTimeout(()=>iO(t,e,i),s)}o.code==="ENOENT"&&(o=null)}r(o)})}function iO(t,e,r){Se(t),Se(e),Se(typeof r=="function"),e.lstat(t,(n,i)=>{if(n&&n.code==="ENOENT")return r(null);if(n&&n.code==="EPERM"&&Zu)return oO(t,e,n,r);if(i&&i.isDirectory())return hd(t,e,n,r);e.unlink(t,o=>{if(o){if(o.code==="ENOENT")return r(null);if(o.code==="EPERM")return Zu?oO(t,e,o,r):hd(t,e,o,r);if(o.code==="EISDIR")return hd(t,e,o,r)}return r(o)})})}function oO(t,e,r,n){Se(t),Se(e),Se(typeof n=="function"),e.chmod(t,438,i=>{i?n(i.code==="ENOENT"?null:r):e.stat(t,(o,s)=>{o?n(o.code==="ENOENT"?null:r):s.isDirectory()?hd(t,e,r,n):e.unlink(t,n)})})}function sO(t,e,r){let n;Se(t),Se(e);try{e.chmodSync(t,438)}catch(i){if(i.code==="ENOENT")return;throw r}try{n=e.statSync(t)}catch(i){if(i.code==="ENOENT")return;throw r}n.isDirectory()?pd(t,e,r):e.unlinkSync(t)}function hd(t,e,r,n){Se(t),Se(e),Se(typeof n=="function"),e.rmdir(t,i=>{i&&(i.code==="ENOTEMPTY"||i.code==="EEXIST"||i.code==="EPERM")?gY(t,e,n):i&&i.code==="ENOTDIR"?n(r):n(i)})}function gY(t,e,r){Se(t),Se(e),Se(typeof r=="function"),e.readdir(t,(n,i)=>{if(n)return r(n);let o=i.length,s;if(o===0)return e.rmdir(t,r);i.forEach(a=>{yD(aO.join(t,a),e,u=>{if(!s){if(u)return r(s=u);--o===0&&e.rmdir(t,r)}})})})}function cO(t,e){let r;e=e||{},uO(e),Se(t,"rimraf: missing path"),Se.strictEqual(typeof t,"string","rimraf: path should be a string"),Se(e,"rimraf: missing options"),Se.strictEqual(typeof e,"object","rimraf: options should be object");try{r=e.lstatSync(t)}catch(n){if(n.code==="ENOENT")return;n.code==="EPERM"&&Zu&&sO(t,e,n)}try{r&&r.isDirectory()?pd(t,e,null):e.unlinkSync(t)}catch(n){if(n.code==="ENOENT")return;if(n.code==="EPERM")return Zu?sO(t,e,n):pd(t,e,n);if(n.code!=="EISDIR")throw n;pd(t,e,n)}}function pd(t,e,r){Se(t),Se(e);try{e.rmdirSync(t)}catch(n){if(n.code==="ENOTDIR")throw r;if(n.code==="ENOTEMPTY"||n.code==="EEXIST"||n.code==="EPERM")yY(t,e);else if(n.code!=="ENOENT")throw n}}function yY(t,e){if(Se(t),Se(e),e.readdirSync(t).forEach(r=>cO(aO.join(t,r),e)),Zu){let r=Date.now();do try{return e.rmdirSync(t,e)}catch{}while(Date.now()-r<500)}else return e.rmdirSync(t,e)}lO.exports=yD;yD.sync=cO});var Qu=y((she,hO)=>{"use strict";var DY=Wt().fromCallback,dO=fO();hO.exports={remove:DY(dO),removeSync:dO.sync}});var wO=y((ahe,bO)=>{"use strict";var vY=Wt().fromCallback,gO=ht(),yO=require("path"),DO=kr(),vO=Qu(),pO=vY(function(e,r){r=r||function(){},gO.readdir(e,(n,i)=>{if(n)return DO.mkdirs(e,r);i=i.map(s=>yO.join(e,s)),o();function o(){let s=i.pop();if(!s)return r();vO.remove(s,a=>{if(a)return r(a);o()})}})});function mO(t){let e;try{e=gO.readdirSync(t)}catch{return DO.mkdirsSync(t)}e.forEach(r=>{r=yO.join(t,r),vO.removeSync(r)})}bO.exports={emptyDirSync:mO,emptydirSync:mO,emptyDir:pO,emptydir:pO}});var SO=y((uhe,CO)=>{"use strict";var bY=Wt().fromCallback,_O=require("path"),ui=ht(),EO=kr();function wY(t,e){function r(){ui.writeFile(t,"",n=>{if(n)return e(n);e()})}ui.stat(t,(n,i)=>{if(!n&&i.isFile())return e();let o=_O.dirname(t);ui.stat(o,(s,a)=>{if(s)return s.code==="ENOENT"?EO.mkdirs(o,u=>{if(u)return e(u);r()}):e(s);a.isDirectory()?r():ui.readdir(o,u=>{if(u)return e(u)})})})}function _Y(t){let e;try{e=ui.statSync(t)}catch{}if(e&&e.isFile())return;let r=_O.dirname(t);try{ui.statSync(r).isDirectory()||ui.readdirSync(r)}catch(n){if(n&&n.code==="ENOENT")EO.mkdirsSync(r);else throw n}ui.writeFileSync(t,"")}CO.exports={createFile:bY(wY),createFileSync:_Y}});var kO=y((che,AO)=>{"use strict";var EY=Wt().fromCallback,FO=require("path"),uo=ht(),OO=kr(),xO=ai().pathExists;function CY(t,e,r){function n(i,o){uo.link(i,o,s=>{if(s)return r(s);r(null)})}xO(e,(i,o)=>{if(i)return r(i);if(o)return r(null);uo.lstat(t,s=>{if(s)return s.message=s.message.replace("lstat","ensureLink"),r(s);let a=FO.dirname(e);xO(a,(u,c)=>{if(u)return r(u);if(c)return n(t,e);OO.mkdirs(a,l=>{if(l)return r(l);n(t,e)})})})})}function SY(t,e){if(uo.existsSync(e))return;try{uo.lstatSync(t)}catch(o){throw o.message=o.message.replace("lstat","ensureLink"),o}let n=FO.dirname(e);return uo.existsSync(n)||OO.mkdirsSync(n),uo.linkSync(t,e)}AO.exports={createLink:EY(CY),createLinkSync:SY}});var PO=y((lhe,TO)=>{"use strict";var ci=require("path"),ec=ht(),xY=ai().pathExists;function FY(t,e,r){if(ci.isAbsolute(t))return ec.lstat(t,n=>n?(n.message=n.message.replace("lstat","ensureSymlink"),r(n)):r(null,{toCwd:t,toDst:t}));{let n=ci.dirname(e),i=ci.join(n,t);return xY(i,(o,s)=>o?r(o):s?r(null,{toCwd:i,toDst:t}):ec.lstat(t,a=>a?(a.message=a.message.replace("lstat","ensureSymlink"),r(a)):r(null,{toCwd:t,toDst:ci.relative(n,t)})))}}function OY(t,e){let r;if(ci.isAbsolute(t)){if(r=ec.existsSync(t),!r)throw new Error("absolute srcpath does not exist");return{toCwd:t,toDst:t}}else{let n=ci.dirname(e),i=ci.join(n,t);if(r=ec.existsSync(i),r)return{toCwd:i,toDst:t};if(r=ec.existsSync(t),!r)throw new Error("relative srcpath does not exist");return{toCwd:t,toDst:ci.relative(n,t)}}}TO.exports={symlinkPaths:FY,symlinkPathsSync:OY}});var IO=y((fhe,$O)=>{"use strict";var RO=ht();function AY(t,e,r){if(r=typeof e=="function"?e:r,e=typeof e=="function"?!1:e,e)return r(null,e);RO.lstat(t,(n,i)=>{if(n)return r(null,"file");e=i&&i.isDirectory()?"dir":"file",r(null,e)})}function kY(t,e){let r;if(e)return e;try{r=RO.lstatSync(t)}catch{return"file"}return r&&r.isDirectory()?"dir":"file"}$O.exports={symlinkType:AY,symlinkTypeSync:kY}});var UO=y((dhe,MO)=>{"use strict";var TY=Wt().fromCallback,NO=require("path"),Ns=ht(),LO=kr(),PY=LO.mkdirs,RY=LO.mkdirsSync,BO=PO(),$Y=BO.symlinkPaths,IY=BO.symlinkPathsSync,qO=IO(),jY=qO.symlinkType,NY=qO.symlinkTypeSync,jO=ai().pathExists;function LY(t,e,r,n){n=typeof r=="function"?r:n,r=typeof r=="function"?!1:r,jO(e,(i,o)=>{if(i)return n(i);if(o)return n(null);$Y(t,e,(s,a)=>{if(s)return n(s);t=a.toDst,jY(a.toCwd,r,(u,c)=>{if(u)return n(u);let l=NO.dirname(e);jO(l,(f,h)=>{if(f)return n(f);if(h)return Ns.symlink(t,e,c,n);PY(l,d=>{if(d)return n(d);Ns.symlink(t,e,c,n)})})})})})}function BY(t,e,r){if(Ns.existsSync(e))return;let i=IY(t,e);t=i.toDst,r=NY(i.toCwd,r);let o=NO.dirname(e);return Ns.existsSync(o)||RY(o),Ns.symlinkSync(t,e,r)}MO.exports={createSymlink:TY(LY),createSymlinkSync:BY}});var HO=y((hhe,VO)=>{"use strict";var md=SO(),gd=kO(),yd=UO();VO.exports={createFile:md.createFile,createFileSync:md.createFileSync,ensureFile:md.createFile,ensureFileSync:md.createFileSync,createLink:gd.createLink,createLinkSync:gd.createLinkSync,ensureLink:gd.createLink,ensureLinkSync:gd.createLinkSync,createSymlink:yd.createSymlink,createSymlinkSync:yd.createSymlinkSync,ensureSymlink:yd.createSymlink,ensureSymlinkSync:yd.createSymlinkSync}});var Dd=y((phe,zO)=>{function qY(t,{EOL:e=`
45
+ `,finalEOL:r=!0,replacer:n=null,spaces:i}={}){let o=r?e:"";return JSON.stringify(t,n,i).replace(/\n/g,e)+o}function MY(t){return Buffer.isBuffer(t)&&(t=t.toString("utf8")),t.replace(/^\uFEFF/,"")}zO.exports={stringify:qY,stripBom:MY}});var YO=y((mhe,KO)=>{var Ls;try{Ls=ht()}catch{Ls=require("fs")}var vd=Wt(),{stringify:GO,stripBom:WO}=Dd();async function UY(t,e={}){typeof e=="string"&&(e={encoding:e});let r=e.fs||Ls,n="throws"in e?e.throws:!0,i=await vd.fromCallback(r.readFile)(t,e);i=WO(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 VY=vd.fromPromise(UY);function HY(t,e={}){typeof e=="string"&&(e={encoding:e});let r=e.fs||Ls,n="throws"in e?e.throws:!0;try{let i=r.readFileSync(t,e);return i=WO(i),JSON.parse(i,e.reviver)}catch(i){if(n)throw i.message=`${t}: ${i.message}`,i;return null}}async function zY(t,e,r={}){let n=r.fs||Ls,i=GO(e,r);await vd.fromCallback(n.writeFile)(t,i,r)}var GY=vd.fromPromise(zY);function WY(t,e,r={}){let n=r.fs||Ls,i=GO(e,r);return n.writeFileSync(t,i,r)}var KY={readFile:VY,readFileSync:HY,writeFile:GY,writeFileSync:WY};KO.exports=KY});var XO=y((ghe,JO)=>{"use strict";var bd=YO();JO.exports={readJson:bd.readFile,readJsonSync:bd.readFileSync,writeJson:bd.writeFile,writeJsonSync:bd.writeFileSync}});var wd=y((yhe,eA)=>{"use strict";var YY=Wt().fromCallback,tc=ht(),ZO=require("path"),QO=kr(),JY=ai().pathExists;function XY(t,e,r,n){typeof r=="function"&&(n=r,r="utf8");let i=ZO.dirname(t);JY(i,(o,s)=>{if(o)return n(o);if(s)return tc.writeFile(t,e,r,n);QO.mkdirs(i,a=>{if(a)return n(a);tc.writeFile(t,e,r,n)})})}function ZY(t,...e){let r=ZO.dirname(t);if(tc.existsSync(r))return tc.writeFileSync(t,...e);QO.mkdirsSync(r),tc.writeFileSync(t,...e)}eA.exports={outputFile:YY(XY),outputFileSync:ZY}});var rA=y((Dhe,tA)=>{"use strict";var{stringify:QY}=Dd(),{outputFile:eJ}=wd();async function tJ(t,e,r={}){let n=QY(e,r);await eJ(t,n,r)}tA.exports=tJ});var iA=y((vhe,nA)=>{"use strict";var{stringify:rJ}=Dd(),{outputFileSync:nJ}=wd();function iJ(t,e,r){let n=rJ(e,r);nJ(t,n,r)}nA.exports=iJ});var sA=y((bhe,oA)=>{"use strict";var oJ=Wt().fromPromise,Rt=XO();Rt.outputJson=oJ(rA());Rt.outputJsonSync=iA();Rt.outputJSON=Rt.outputJson;Rt.outputJSONSync=Rt.outputJsonSync;Rt.writeJSON=Rt.writeJson;Rt.writeJSONSync=Rt.writeJsonSync;Rt.readJSON=Rt.readJson;Rt.readJSONSync=Rt.readJsonSync;oA.exports=Rt});var dA=y((whe,fA)=>{"use strict";var cA=ht(),sJ=require("path"),aJ=pD().copySync,lA=Qu().removeSync,uJ=kr().mkdirpSync,aA=Wu();function cJ(t,e,r){r=r||{};let n=r.overwrite||r.clobber||!1,{srcStat:i}=aA.checkPathsSync(t,e,"move");return aA.checkParentPathsSync(t,i,e,"move"),uJ(sJ.dirname(e)),lJ(t,e,n)}function lJ(t,e,r){if(r)return lA(e),uA(t,e,r);if(cA.existsSync(e))throw new Error("dest already exists.");return uA(t,e,r)}function uA(t,e,r){try{cA.renameSync(t,e)}catch(n){if(n.code!=="EXDEV")throw n;return fJ(t,e,r)}}function fJ(t,e,r){return aJ(t,e,{overwrite:r,errorOnExist:!0}),lA(t)}fA.exports=cJ});var pA=y((_he,hA)=>{"use strict";hA.exports={moveSync:dA()}});var vA=y((Ehe,DA)=>{"use strict";var dJ=ht(),hJ=require("path"),pJ=gD().copy,yA=Qu().remove,mJ=kr().mkdirp,gJ=ai().pathExists,mA=Wu();function yJ(t,e,r,n){typeof r=="function"&&(n=r,r={});let i=r.overwrite||r.clobber||!1;mA.checkPaths(t,e,"move",(o,s)=>{if(o)return n(o);let{srcStat:a}=s;mA.checkParentPaths(t,a,e,"move",u=>{if(u)return n(u);mJ(hJ.dirname(e),c=>c?n(c):DJ(t,e,i,n))})})}function DJ(t,e,r,n){if(r)return yA(e,i=>i?n(i):gA(t,e,r,n));gJ(e,(i,o)=>i?n(i):o?n(new Error("dest already exists.")):gA(t,e,r,n))}function gA(t,e,r,n){dJ.rename(t,e,i=>i?i.code!=="EXDEV"?n(i):vJ(t,e,r,n):n())}function vJ(t,e,r,n){pJ(t,e,{overwrite:r,errorOnExist:!0},o=>o?n(o):yA(t,n))}DA.exports=yJ});var wA=y((Che,bA)=>{"use strict";var bJ=Wt().fromCallback;bA.exports={move:bJ(vA())}});var _d=y((She,DD)=>{"use strict";DD.exports={...Gu(),...pD(),...gD(),...wO(),...HO(),...sA(),...kr(),...pA(),...wA(),...wd(),...ai(),...Qu()};var _A=require("fs");Object.getOwnPropertyDescriptor(_A,"promises")&&Object.defineProperty(DD.exports,"promises",{get(){return _A.promises}})});var vD=y(Bs=>{"use strict";Object.defineProperty(Bs,"__esModule",{value:!0});Bs.readdir=Bs.stat=void 0;var EA=_d();async function wJ(t){try{return await EA.stat(t)}catch{}}Bs.stat=wJ;async function _J(t){try{return await EA.readdir(t)}catch{return[]}}Bs.readdir=_J});var qs=y(re=>{"use strict";Object.defineProperty(re,"__esModule",{value:!0});re.walk=re.Walker=re.compilePaths=re.tmpfilepath=re.findBaseDirectory=re.isExecutableFile=re.pathExecutable=re.pathWritable=re.pathReadable=re.pathExists=re.pathAccessible=re.writeStreamToFile=re.cacheFileChecksum=re.getFileChecksums=re.getFileChecksum=re.fileToString=re.getFileTree=re.readdirp=re.readdirSafe=re.statSafe=void 0;var EJ=(S2(),Ae(C2)),vr=_d(),CJ=require("os"),xn=require("path"),CA=require("stream"),SA=vD();EJ.__exportStar(_d(),re);var xA=vD();Object.defineProperty(re,"statSafe",{enumerable:!0,get:function(){return xA.stat}});Object.defineProperty(re,"readdirSafe",{enumerable:!0,get:function(){return xA.readdir}});async function SJ(t,{filter:e,onError:r,walkerOptions:n}={}){return new Promise((i,o)=>{let s=[],a=wD(t,n);e&&(a=a.pipe(new CA.Transform({objectMode:!0,transform(u,c,l){(!e||e(u))&&this.push(u),l()}}))),a.on("error",u=>r?r(u):o(u)).on("data",u=>s.push(u.path)).on("end",()=>i(s))})}re.readdirp=SJ;async function xJ(t,{onError:e,onFileNode:r=o=>o,onDirectoryNode:n=o=>o,walkerOptions:i}={}){let o=new Map([]),s=u=>{let c=xn.dirname(u.path),l=o.get(c);return l&&l.type==="directory"?l:n({path:c,type:"directory",children:[]})},a=(u,c)=>{let l={path:u.path,parent:c};return u.stats.isDirectory()?n({...l,type:"directory",children:[]}):r({...l,type:"file"})};return new Promise((u,c)=>{t=xn.resolve(t),wD(t,i).on("error",f=>e?e(f):c(f)).on("data",f=>{let h=s(f),d=a(f,h);h.children.push(d),o.set(f.path,d),o.set(h.path,h)}).on("end",()=>{let f=o.get(t);if(!f)return c(new Error("No root node found after walking directory structure."));delete f.parent,u(f)})})}re.getFileTree=xJ;async function FJ(t){try{return await vr.readFile(t,{encoding:"utf8"})}catch(e){if(e.code==="ENOENT"||e.code==="ENOTDIR")return"";throw e}}re.fileToString=FJ;async function bD(t){let e=await Promise.resolve().then(()=>require("crypto"));return new Promise((r,n)=>{let i=e.createHash("md5"),o=vr.createReadStream(t);o.on("error",s=>{n(s)}),i.once("readable",()=>{let s=i.read().toString("hex");r(s)}),o.pipe(i)})}re.getFileChecksum=bD;async function OJ(t){return Promise.all([bD(t),(async()=>{try{return(await vr.readFile(`${t}.md5`,{encoding:"utf8"})).trim()}catch(e){if(e.code!=="ENOENT")throw e}})()])}re.getFileChecksums=OJ;async function AJ(t,e){let r=await bD(t);await vr.writeFile(`${t}.md5`,r,{encoding:"utf8"})}re.cacheFileChecksum=AJ;function kJ(t,e){return new Promise((r,n)=>{let i=vr.createWriteStream(e);t.pipe(i),i.on("error",n),i.on("finish",r)})}re.writeStreamToFile=kJ;async function rc(t,e){try{await vr.access(t,e)}catch{return!1}return!0}re.pathAccessible=rc;async function TJ(t){return rc(t,vr.constants.F_OK)}re.pathExists=TJ;async function PJ(t){return rc(t,vr.constants.R_OK)}re.pathReadable=PJ;async function RJ(t){return rc(t,vr.constants.W_OK)}re.pathWritable=RJ;async function FA(t){return rc(t,vr.constants.X_OK)}re.pathExecutable=FA;async function $J(t){let[e,r]=await Promise.all([SA.stat(t),FA(t)]);return!!e&&(e.isFile()||e.isSymbolicLink())&&r}re.isExecutableFile=$J;async function IJ(t,e){if(!(!t||!e)){for(let r of OA(t))if((await SA.readdir(r)).includes(e))return r}}re.findBaseDirectory=IJ;function jJ(t){let e=Math.random().toString(16).substring(2,8);return xn.resolve(CJ.tmpdir(),t?`${t}-${e}`:e)}re.tmpfilepath=jJ;function OA(t){if(t=xn.normalize(t),!xn.isAbsolute(t))throw new Error(`${t} is not an absolute path`);let e=xn.parse(t);return t===e.root?[t]:t.slice(e.root.length).split(xn.sep).map((r,n,i)=>e.root+xn.join(...i.slice(0,i.length-n))).concat(e.root)}re.compilePaths=OA;var Ed=class extends CA.Readable{constructor(e,r={}){super({objectMode:!0}),this.p=e,this.options=r,this.paths=[this.p]}_read(){let e=this.paths.shift(),{pathFilter:r}=this.options;if(!e){this.push(null);return}vr.lstat(e,(n,i)=>{if(n){this.emit("error",n);return}let o={path:e,stats:i};i.isDirectory()?vr.readdir(e,(s,a)=>{if(s){this.emit("error",s);return}let u=a.map(c=>xn.join(e,c));r&&(u=u.filter(c=>r(c.substring(this.p.length+1)))),this.paths.push(...u),this.push(o)}):this.push(o)})}};re.Walker=Ed;function wD(t,e={}){return new Ed(t,e)}re.walk=wD});var _D=y((Ohe,AA)=>{var Ms=1e3,Us=Ms*60,Vs=Us*60,co=Vs*24,NJ=co*7,LJ=co*365.25;AA.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return BJ(t);if(r==="number"&&isFinite(t))return e.long?MJ(t):qJ(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function BJ(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*LJ;case"weeks":case"week":case"w":return r*NJ;case"days":case"day":case"d":return r*co;case"hours":case"hour":case"hrs":case"hr":case"h":return r*Vs;case"minutes":case"minute":case"mins":case"min":case"m":return r*Us;case"seconds":case"second":case"secs":case"sec":case"s":return r*Ms;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}function qJ(t){var e=Math.abs(t);return e>=co?Math.round(t/co)+"d":e>=Vs?Math.round(t/Vs)+"h":e>=Us?Math.round(t/Us)+"m":e>=Ms?Math.round(t/Ms)+"s":t+"ms"}function MJ(t){var e=Math.abs(t);return e>=co?Cd(t,e,co,"day"):e>=Vs?Cd(t,e,Vs,"hour"):e>=Us?Cd(t,e,Us,"minute"):e>=Ms?Cd(t,e,Ms,"second"):t+" ms"}function Cd(t,e,r,n){var i=e>=r*1.5;return Math.round(t/r)+" "+n+(i?"s":"")}});var ED=y((Ahe,kA)=>{function UJ(t){r.debug=r,r.default=r,r.coerce=u,r.disable=o,r.enable=i,r.enabled=s,r.humanize=_D(),r.destroy=c,Object.keys(t).forEach(l=>{r[l]=t[l]}),r.names=[],r.skips=[],r.formatters={};function e(l){let f=0;for(let h=0;h<l.length;h++)f=(f<<5)-f+l.charCodeAt(h),f|=0;return r.colors[Math.abs(f)%r.colors.length]}r.selectColor=e;function r(l){let f,h=null,d,m;function b(...g){if(!b.enabled)return;let w=b,x=Number(new Date),D=x-(f||x);w.diff=D,w.prev=f,w.curr=x,f=x,g[0]=r.coerce(g[0]),typeof g[0]!="string"&&g.unshift("%O");let C=0;g[0]=g[0].replace(/%([a-zA-Z%])/g,($,F)=>{if($==="%%")return"%";C++;let L=r.formatters[F];if(typeof L=="function"){let S=g[C];$=L.call(w,S),g.splice(C,1),C--}return $}),r.formatArgs.call(w,g),(w.log||r.log).apply(w,g)}return b.namespace=l,b.useColors=r.useColors(),b.color=r.selectColor(l),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(l)),m),set:g=>{h=g}}),typeof r.init=="function"&&r.init(b),b}function n(l,f){let h=r(this.namespace+(typeof f>"u"?":":f)+l);return h.log=this.log,h}function i(l){r.save(l),r.namespaces=l,r.names=[],r.skips=[];let f,h=(typeof l=="string"?l:"").split(/[\s,]+/),d=h.length;for(f=0;f<d;f++)h[f]&&(l=h[f].replace(/\*/g,".*?"),l[0]==="-"?r.skips.push(new RegExp("^"+l.slice(1)+"$")):r.names.push(new RegExp("^"+l+"$")))}function o(){let l=[...r.names.map(a),...r.skips.map(a).map(f=>"-"+f)].join(",");return r.enable(""),l}function s(l){if(l[l.length-1]==="*")return!0;let f,h;for(f=0,h=r.skips.length;f<h;f++)if(r.skips[f].test(l))return!1;for(f=0,h=r.names.length;f<h;f++)if(r.names[f].test(l))return!0;return!1}function a(l){return l.toString().substring(2,l.toString().length-2).replace(/\.\*\?$/,"*")}function u(l){return l instanceof Error?l.stack||l.message:l}function c(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return r.enable(r.load()),r}kA.exports=UJ});var TA=y((or,Sd)=>{or.formatArgs=HJ;or.save=zJ;or.load=GJ;or.useColors=VJ;or.storage=WJ();or.destroy=(()=>{let t=!1;return()=>{t||(t=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();or.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function VJ(){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 HJ(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+Sd.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;t.splice(1,0,e,"color: inherit");let r=0,n=0;t[0].replace(/%[a-zA-Z%]/g,i=>{i!=="%%"&&(r++,i==="%c"&&(n=r))}),t.splice(n,0,e)}or.log=console.debug||console.log||(()=>{});function zJ(t){try{t?or.storage.setItem("debug",t):or.storage.removeItem("debug")}catch{}}function GJ(){let t;try{t=or.storage.getItem("debug")}catch{}return!t&&typeof process<"u"&&"env"in process&&(t=process.env.DEBUG),t}function WJ(){try{return localStorage}catch{}}Sd.exports=ED()(or);var{formatters:KJ}=Sd.exports;KJ.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var RA=y((khe,PA)=>{"use strict";PA.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 xD=y((The,IA)=>{"use strict";var YJ=require("os"),$A=require("tty"),br=RA(),{env:mt}=process,li;br("no-color")||br("no-colors")||br("color=false")||br("color=never")?li=0:(br("color")||br("colors")||br("color=true")||br("color=always"))&&(li=1);"FORCE_COLOR"in mt&&(mt.FORCE_COLOR==="true"?li=1:mt.FORCE_COLOR==="false"?li=0:li=mt.FORCE_COLOR.length===0?1:Math.min(parseInt(mt.FORCE_COLOR,10),3));function CD(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}function SD(t,e){if(li===0)return 0;if(br("color=16m")||br("color=full")||br("color=truecolor"))return 3;if(br("color=256"))return 2;if(t&&!e&&li===void 0)return 0;let r=li||0;if(mt.TERM==="dumb")return r;if(process.platform==="win32"){let n=YJ.release().split(".");return Number(n[0])>=10&&Number(n[2])>=10586?Number(n[2])>=14931?3:2:1}if("CI"in mt)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(n=>n in mt)||mt.CI_NAME==="codeship"?1:r;if("TEAMCITY_VERSION"in mt)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(mt.TEAMCITY_VERSION)?1:0;if(mt.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in mt){let n=parseInt((mt.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(mt.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(mt.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(mt.TERM)||"COLORTERM"in mt?1:r}function JJ(t){let e=SD(t,t&&t.isTTY);return CD(e)}IA.exports={supportsColor:JJ,stdout:CD(SD(!0,$A.isatty(1))),stderr:CD(SD(!0,$A.isatty(2)))}});var NA=y((gt,Fd)=>{var XJ=require("tty"),xd=require("util");gt.init=iX;gt.log=tX;gt.formatArgs=QJ;gt.save=rX;gt.load=nX;gt.useColors=ZJ;gt.destroy=xd.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");gt.colors=[6,2,3,4,5,1];try{let t=xD();t&&(t.stderr||t).level>=2&&(gt.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{}gt.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 ZJ(){return"colors"in gt.inspectOpts?!!gt.inspectOpts.colors:XJ.isatty(process.stderr.fd)}function QJ(t){let{namespace:e,useColors:r}=this;if(r){let n=this.color,i="\x1B[3"+(n<8?n:"8;5;"+n),o=` ${i};1m${e} \x1B[0m`;t[0]=o+t[0].split(`
46
46
  `).join(`
47
47
  `+o),t.push(i+"m+"+Fd.exports.humanize(this.diff)+"\x1B[0m")}else t[0]=eX()+e+" "+t[0]}function eX(){return gt.inspectOpts.hideDate?"":new Date().toISOString()+" "}function tX(...t){return process.stderr.write(xd.formatWithOptions(gt.inspectOpts,...t)+`
48
- `)}function rX(t){t?process.env.DEBUG=t:delete process.env.DEBUG}function nX(){return process.env.DEBUG}function iX(t){t.inspectOpts={};let e=Object.keys(gt.inspectOpts);for(let r=0;r<e.length;r++)t.inspectOpts[e[r]]=gt.inspectOpts[e[r]]}Fd.exports=ED()(gt);var{formatters:NA}=Fd.exports;NA.o=function(t){return this.inspectOpts.colors=this.useColors,xd.inspect(t,this.inspectOpts).split(`
49
- `).map(e=>e.trim()).join(" ")};NA.O=function(t){return this.inspectOpts.colors=this.useColors,xd.inspect(t,this.inspectOpts)}});var BA=y((Phe,FD)=>{typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?FD.exports=PA():FD.exports=LA()});var GA=y((Rhe,zA)=>{"use strict";var OD,MA,UA,VA,HA=!0;typeof process<"u"&&({FORCE_COLOR:OD,NODE_DISABLE_COLORS:MA,NO_COLOR:UA,TERM:VA}=process.env||{},HA=process.stdout&&process.stdout.isTTY);var we={enabled:!MA&&UA==null&&VA!=="dumb"&&(OD!=null&&OD!=="0"||HA),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 qA(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 oX(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.indexOf(t)||(this.has.push(t),this.keys.push(r)),n===void 0?this:we.enabled?qA(this.keys,n+""):n+""):n===void 0?oX([t],[r]):we.enabled?qA([r],n+""):n+""}}zA.exports=we});var Hs=y(tt=>{"use strict";Object.defineProperty(tt,"__esModule",{value:!0});tt.ancillary=tt.failure=tt.success=tt.input=tt.weak=tt.strong=void 0;var sX=(Cn(),Ae(En)),Yr=sX.__importDefault(GA());tt.strong=Yr.default.bold;tt.weak=Yr.default.dim;tt.input=Yr.default.cyan;tt.success=Yr.default.green;tt.failure=Yr.default.red;tt.ancillary=Yr.default.cyan;var aX={strong:tt.strong,weak:tt.weak,input:tt.input,success:tt.success,failure:tt.failure,ancillary:tt.ancillary,log:{DEBUG:Yr.default.magenta,INFO:Yr.default.cyan,WARN:Yr.default.yellow,ERROR:Yr.default.red}};tt.default=aX});var nc={};mn(nc,{__addDisposableResource:()=>hk,__assign:()=>Od,__asyncDelegator:()=>ok,__asyncGenerator:()=>ik,__asyncValues:()=>sk,__await:()=>zs,__awaiter:()=>ZA,__classPrivateFieldGet:()=>lk,__classPrivateFieldIn:()=>dk,__classPrivateFieldSet:()=>fk,__createBinding:()=>kd,__decorate:()=>YA,__disposeResources:()=>pk,__esDecorate:()=>uX,__exportStar:()=>ek,__extends:()=>WA,__generator:()=>QA,__importDefault:()=>ck,__importStar:()=>uk,__makeTemplateObject:()=>ak,__metadata:()=>XA,__param:()=>JA,__propKey:()=>lX,__read:()=>kD,__rest:()=>KA,__runInitializers:()=>cX,__setFunctionName:()=>fX,__spread:()=>tk,__spreadArray:()=>nk,__spreadArrays:()=>rk,__values:()=>Ad,default:()=>pX});function WA(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");AD(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}function KA(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 YA(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 JA(t,e){return function(r,n){e(r,n,t)}}function uX(t,e,r,n,i,o){function s(w){if(w!==void 0&&typeof w!="function")throw new TypeError("Function expected");return w}for(var a=n.kind,u=a==="getter"?"get":a==="setter"?"set":"value",c=!e&&t?n.static?t:t.prototype:null,l=e||(c?Object.getOwnPropertyDescriptor(c,n.name):{}),f,h=!1,d=r.length-1;d>=0;d--){var 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(w){if(h)throw new TypeError("Cannot add initializers after decoration has completed");o.push(s(w||null))};var g=(0,r[d])(a==="accessor"?{get:l.get,set:l.set}:l[u],m);if(a==="accessor"){if(g===void 0)continue;if(g===null||typeof g!="object")throw new TypeError("Object expected");(f=s(g.get))&&(l.get=f),(f=s(g.set))&&(l.set=f),(f=s(g.init))&&i.unshift(f)}else(f=s(g))&&(a==="field"?i.unshift(f):l[u]=f)}c&&Object.defineProperty(c,n.name,l),h=!0}function cX(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 lX(t){return typeof t=="symbol"?t:"".concat(t)}function fX(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 XA(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function ZA(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(l){try{c(n.next(l))}catch(f){s(f)}}function u(l){try{c(n.throw(l))}catch(f){s(f)}}function c(l){l.done?o(l.value):i(l.value).then(a,u)}c((n=n.apply(t,e||[])).next())})}function QA(t,e){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(c){return function(l){return u([c,l])}}function u(c){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,c[0]&&(r=0)),r;)try{if(n=1,i&&(o=c[0]&2?i.return:c[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,c[1])).done)return o;switch(i=0,o&&(c=[c[0]&2,o.value]),c[0]){case 0:case 1:o=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,i=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]<o[3])){r.label=c[1];break}if(c[0]===6&&r.label<o[1]){r.label=o[1],o=c;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(c);break}o[2]&&r.ops.pop(),r.trys.pop();continue}c=e.call(t,r)}catch(l){c=[6,l],i=0}finally{n=o=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function ek(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&kd(e,t,r)}function Ad(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function kD(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 tk(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(kD(arguments[e]));return t}function rk(){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 nk(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 zs(t){return this instanceof zs?(this.v=t,this):new zs(t)}function ik(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(t,e||[]),i,o=[];return i={},s("next"),s("throw"),s("return"),i[Symbol.asyncIterator]=function(){return this},i;function s(h){n[h]&&(i[h]=function(d){return new Promise(function(m,b){o.push([h,d,m,b])>1||a(h,d)})})}function a(h,d){try{u(n[h](d))}catch(m){f(o[0][3],m)}}function u(h){h.value instanceof zs?Promise.resolve(h.value.v).then(c,l):f(o[0][2],h)}function c(h){a("next",h)}function l(h){a("throw",h)}function f(h,d){h(d),o.shift(),o.length&&a(o[0][0],o[0][1])}}function ok(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:zs(t[i](s)),done:!1}:o?o(s):s}:o}}function sk(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof Ad=="function"?Ad(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(o){r[o]=t[o]&&function(s){return new Promise(function(a,u){s=t[o](s),i(a,u,s.done,s.value)})}}function i(o,s,a,u){Promise.resolve(u).then(function(c){o({value:c,done:a})},s)}}function ak(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function uk(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&kd(e,t,r);return dX(e,t),e}function ck(t){return t&&t.__esModule?t:{default:t}}function lk(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 fk(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 dk(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 hk(t,e,r){if(e!=null){if(typeof e!="object"&&typeof e!="function")throw new TypeError("Object expected.");var n;if(r){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");n=e[Symbol.asyncDispose]}if(n===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");n=e[Symbol.dispose]}if(typeof n!="function")throw new TypeError("Object not disposable.");t.stack.push({value:e,dispose:n,async:r})}else r&&t.stack.push({async:!0});return e}function pk(t){function e(n){t.error=t.hasError?new hX(n,t.error,"An error was suppressed during disposal."):n,t.hasError=!0}function r(){for(;t.stack.length;){var n=t.stack.pop();try{var i=n.dispose&&n.dispose.call(n.value);if(n.async)return Promise.resolve(i).then(r,function(o){return e(o),r()})}catch(o){e(o)}}if(t.hasError)throw t.error}return r()}var AD,Od,kd,dX,hX,pX,ic=ct(()=>{AD=function(t,e){return AD=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])},AD(t,e)};Od=function(){return Od=Object.assign||function(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},Od.apply(this,arguments)};kd=Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]};dX=Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e};hX=typeof SuppressedError=="function"?SuppressedError:function(t,e,r){var n=new Error(r);return n.name="SuppressedError",n.error=t,n.suppressed=e,n};pX={__extends:WA,__assign:Od,__rest:KA,__decorate:YA,__param:JA,__metadata:XA,__awaiter:ZA,__generator:QA,__createBinding:kd,__exportStar:ek,__values:Ad,__read:kD,__spread:tk,__spreadArrays:rk,__spreadArray:nk,__await:zs,__asyncGenerator:ik,__asyncDelegator:ok,__asyncValues:sk,__makeTemplateObject:ak,__importStar:uk,__importDefault:ck,__classPrivateFieldGet:lk,__classPrivateFieldSet:fk,__classPrivateFieldIn:dk,__addDisposableResource:hk,__disposeResources:pk}});var TD=y(Td=>{"use strict";Object.defineProperty(Td,"__esModule",{value:!0});Td.EscapeCode=void 0;var Tr="\x1B[",yt=class{};Td.EscapeCode=yt;yt.cursorLeft=()=>`${Tr}G`;yt.cursorUp=(t=1)=>`${Tr}${t}A`;yt.cursorDown=(t=1)=>`${Tr}${t}B`;yt.cursorForward=(t=1)=>`${Tr}${t}C`;yt.cursorBackward=(t=1)=>`${Tr}${t}D`;yt.cursorHide=()=>`${Tr}?25l`;yt.cursorShow=()=>`${Tr}?25h`;yt.eraseLine=()=>`${Tr}2K`;yt.eraseLines=t=>{let e="";for(let r=0;r<t;r++)e+=yt.eraseLine(),r<t-1&&(e+=yt.cursorUp());return`${e}${yt.cursorLeft()}`};yt.eraseUp=()=>`${Tr}1J`;yt.eraseDown=()=>`${Tr}J`;yt.eraseScreen=()=>`${Tr}2J`});var gk=y(Pd=>{"use strict";Object.defineProperty(Pd,"__esModule",{value:!0});Pd.Cursor=void 0;var mX=(ic(),Ae(nc)),gX=mX.__importDefault(zy()),mk=TD(),Gs=class t{static show(){t.stream.isTTY&&(t._isVisible=!0,t.stream.write(mk.EscapeCode.cursorShow()))}static hide(){t.stream.isTTY&&(t._listenerAttached||((0,gX.default)(()=>{t.show()}),t._listenerAttached=!0),t._isVisible=!1,t.stream.write(mk.EscapeCode.cursorHide()))}static toggle(){t._isVisible?t.hide():t.show()}};Pd.Cursor=Gs;Gs.stream=process.stderr;Gs._isVisible=!0;Gs._listenerAttached=!1});var RD=y((Nhe,PD)=>{"use strict";var yk=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);PD.exports=yk;PD.exports.default=yk});var bk=y((Lhe,vk)=>{"use strict";var Dk="[\uD800-\uDBFF][\uDC00-\uDFFF]",yX=t=>t&&t.exact?new RegExp(`^${Dk}$`):new RegExp(Dk,"g");vk.exports=yX});var _k=y((Bhe,wk)=>{"use strict";wk.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 $D=y((qhe,Ck)=>{var oc=_k(),Ek={};for(let t of Object.keys(oc))Ek[oc[t]]=t;var J={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};Ck.exports=J;for(let t of Object.keys(J)){if(!("channels"in J[t]))throw new Error("missing channels property: "+t);if(!("labels"in J[t]))throw new Error("missing channel labels property: "+t);if(J[t].labels.length!==J[t].channels)throw new Error("channel and label counts mismatch: "+t);let{channels:e,labels:r}=J[t];delete J[t].channels,delete J[t].labels,Object.defineProperty(J[t],"channels",{value:e}),Object.defineProperty(J[t],"labels",{value:r})}J.rgb.hsl=function(t){let e=t[0]/255,r=t[1]/255,n=t[2]/255,i=Math.min(e,r,n),o=Math.max(e,r,n),s=o-i,a,u;o===i?a=0:e===o?a=(r-n)/s:r===o?a=2+(n-e)/s:n===o&&(a=4+(e-r)/s),a=Math.min(a*60,360),a<0&&(a+=360);let c=(i+o)/2;return o===i?u=0:c<=.5?u=s/(o+i):u=s/(2-o-i),[a,u*100,c*100]};J.rgb.hsv=function(t){let e,r,n,i,o,s=t[0]/255,a=t[1]/255,u=t[2]/255,c=Math.max(s,a,u),l=c-Math.min(s,a,u),f=function(h){return(c-h)/6/l+1/2};return l===0?(i=0,o=0):(o=l/c,e=f(s),r=f(a),n=f(u),s===c?i=n-r:a===c?i=1/3+e-n:u===c&&(i=2/3+r-e),i<0?i+=1:i>1&&(i-=1)),[i*360,o*100,c*100]};J.rgb.hwb=function(t){let e=t[0],r=t[1],n=t[2],i=J.rgb.hsl(t)[0],o=1/255*Math.min(e,Math.min(r,n));return n=1-1/255*Math.max(e,Math.max(r,n)),[i,o*100,n*100]};J.rgb.cmyk=function(t){let e=t[0]/255,r=t[1]/255,n=t[2]/255,i=Math.min(1-e,1-r,1-n),o=(1-e-i)/(1-i)||0,s=(1-r-i)/(1-i)||0,a=(1-n-i)/(1-i)||0;return[o*100,s*100,a*100,i*100]};function DX(t,e){return(t[0]-e[0])**2+(t[1]-e[1])**2+(t[2]-e[2])**2}J.rgb.keyword=function(t){let e=Ek[t];if(e)return e;let r=1/0,n;for(let i of Object.keys(oc)){let o=oc[i],s=DX(t,o);s<r&&(r=s,n=i)}return n};J.keyword.rgb=function(t){return oc[t]};J.rgb.xyz=function(t){let e=t[0]/255,r=t[1]/255,n=t[2]/255;e=e>.04045?((e+.055)/1.055)**2.4:e/12.92,r=r>.04045?((r+.055)/1.055)**2.4:r/12.92,n=n>.04045?((n+.055)/1.055)**2.4:n/12.92;let i=e*.4124+r*.3576+n*.1805,o=e*.2126+r*.7152+n*.0722,s=e*.0193+r*.1192+n*.9505;return[i*100,o*100,s*100]};J.rgb.lab=function(t){let e=J.rgb.xyz(t),r=e[0],n=e[1],i=e[2];r/=95.047,n/=100,i/=108.883,r=r>.008856?r**(1/3):7.787*r+16/116,n=n>.008856?n**(1/3):7.787*n+16/116,i=i>.008856?i**(1/3):7.787*i+16/116;let o=116*n-16,s=500*(r-n),a=200*(n-i);return[o,s,a]};J.hsl.rgb=function(t){let e=t[0]/360,r=t[1]/100,n=t[2]/100,i,o,s;if(r===0)return s=n*255,[s,s,s];n<.5?i=n*(1+r):i=n+r-n*r;let a=2*n-i,u=[0,0,0];for(let c=0;c<3;c++)o=e+1/3*-(c-1),o<0&&o++,o>1&&o--,6*o<1?s=a+(i-a)*6*o:2*o<1?s=i:3*o<2?s=a+(i-a)*(2/3-o)*6:s=a,u[c]=s*255;return u};J.hsl.hsv=function(t){let e=t[0],r=t[1]/100,n=t[2]/100,i=r,o=Math.max(n,.01);n*=2,r*=n<=1?n:2-n,i*=o<=1?o:2-o;let s=(n+r)/2,a=n===0?2*i/(o+i):2*r/(n+r);return[e,a*100,s*100]};J.hsv.rgb=function(t){let e=t[0]/60,r=t[1]/100,n=t[2]/100,i=Math.floor(e)%6,o=e-Math.floor(e),s=255*n*(1-r),a=255*n*(1-r*o),u=255*n*(1-r*(1-o));switch(n*=255,i){case 0:return[n,u,s];case 1:return[a,n,s];case 2:return[s,n,u];case 3:return[s,a,n];case 4:return[u,s,n];case 5:return[n,s,a]}};J.hsv.hsl=function(t){let e=t[0],r=t[1]/100,n=t[2]/100,i=Math.max(n,.01),o,s;s=(2-r)*n;let a=(2-r)*i;return o=r*i,o/=a<=1?a:2-a,o=o||0,s/=2,[e,o*100,s*100]};J.hwb.rgb=function(t){let e=t[0]/360,r=t[1]/100,n=t[2]/100,i=r+n,o;i>1&&(r/=i,n/=i);let s=Math.floor(6*e),a=1-n;o=6*e-s,s&1&&(o=1-o);let u=r+o*(a-r),c,l,f;switch(s){default:case 6:case 0:c=a,l=u,f=r;break;case 1:c=u,l=a,f=r;break;case 2:c=r,l=a,f=u;break;case 3:c=r,l=u,f=a;break;case 4:c=u,l=r,f=a;break;case 5:c=a,l=r,f=u;break}return[c*255,l*255,f*255]};J.cmyk.rgb=function(t){let e=t[0]/100,r=t[1]/100,n=t[2]/100,i=t[3]/100,o=1-Math.min(1,e*(1-i)+i),s=1-Math.min(1,r*(1-i)+i),a=1-Math.min(1,n*(1-i)+i);return[o*255,s*255,a*255]};J.xyz.rgb=function(t){let e=t[0]/100,r=t[1]/100,n=t[2]/100,i,o,s;return i=e*3.2406+r*-1.5372+n*-.4986,o=e*-.9689+r*1.8758+n*.0415,s=e*.0557+r*-.204+n*1.057,i=i>.0031308?1.055*i**(1/2.4)-.055:i*12.92,o=o>.0031308?1.055*o**(1/2.4)-.055:o*12.92,s=s>.0031308?1.055*s**(1/2.4)-.055:s*12.92,i=Math.min(Math.max(0,i),1),o=Math.min(Math.max(0,o),1),s=Math.min(Math.max(0,s),1),[i*255,o*255,s*255]};J.xyz.lab=function(t){let e=t[0],r=t[1],n=t[2];e/=95.047,r/=100,n/=108.883,e=e>.008856?e**(1/3):7.787*e+16/116,r=r>.008856?r**(1/3):7.787*r+16/116,n=n>.008856?n**(1/3):7.787*n+16/116;let i=116*r-16,o=500*(e-r),s=200*(r-n);return[i,o,s]};J.lab.xyz=function(t){let e=t[0],r=t[1],n=t[2],i,o,s;o=(e+16)/116,i=r/500+o,s=o-n/200;let a=o**3,u=i**3,c=s**3;return o=a>.008856?a:(o-16/116)/7.787,i=u>.008856?u:(i-16/116)/7.787,s=c>.008856?c:(s-16/116)/7.787,i*=95.047,o*=100,s*=108.883,[i,o,s]};J.lab.lch=function(t){let e=t[0],r=t[1],n=t[2],i;i=Math.atan2(n,r)*360/2/Math.PI,i<0&&(i+=360);let s=Math.sqrt(r*r+n*n);return[e,s,i]};J.lch.lab=function(t){let e=t[0],r=t[1],i=t[2]/360*2*Math.PI,o=r*Math.cos(i),s=r*Math.sin(i);return[e,o,s]};J.rgb.ansi16=function(t,e=null){let[r,n,i]=t,o=e===null?J.rgb.hsv(t)[2]:e;if(o=Math.round(o/50),o===0)return 30;let s=30+(Math.round(i/255)<<2|Math.round(n/255)<<1|Math.round(r/255));return o===2&&(s+=60),s};J.hsv.ansi16=function(t){return J.rgb.ansi16(J.hsv.rgb(t),t[2])};J.rgb.ansi256=function(t){let e=t[0],r=t[1],n=t[2];return e===r&&r===n?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5)};J.ansi16.rgb=function(t){let e=t%10;if(e===0||e===7)return t>50&&(e+=3.5),e=e/10.5*255,[e,e,e];let r=(~~(t>50)+1)*.5,n=(e&1)*r*255,i=(e>>1&1)*r*255,o=(e>>2&1)*r*255;return[n,i,o]};J.ansi256.rgb=function(t){if(t>=232){let o=(t-232)*10+8;return[o,o,o]}t-=16;let e,r=Math.floor(t/36)/5*255,n=Math.floor((e=t%36)/6)/5*255,i=e%6/5*255;return[r,n,i]};J.rgb.hex=function(t){let r=(((Math.round(t[0])&255)<<16)+((Math.round(t[1])&255)<<8)+(Math.round(t[2])&255)).toString(16).toUpperCase();return"000000".substring(r.length)+r};J.hex.rgb=function(t){let e=t.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!e)return[0,0,0];let r=e[0];e[0].length===3&&(r=r.split("").map(a=>a+a).join(""));let n=parseInt(r,16),i=n>>16&255,o=n>>8&255,s=n&255;return[i,o,s]};J.rgb.hcg=function(t){let e=t[0]/255,r=t[1]/255,n=t[2]/255,i=Math.max(Math.max(e,r),n),o=Math.min(Math.min(e,r),n),s=i-o,a,u;return s<1?a=o/(1-s):a=0,s<=0?u=0:i===e?u=(r-n)/s%6:i===r?u=2+(n-e)/s:u=4+(e-r)/s,u/=6,u%=1,[u*360,s*100,a*100]};J.hsl.hcg=function(t){let e=t[1]/100,r=t[2]/100,n=r<.5?2*e*r:2*e*(1-r),i=0;return n<1&&(i=(r-.5*n)/(1-n)),[t[0],n*100,i*100]};J.hsv.hcg=function(t){let e=t[1]/100,r=t[2]/100,n=e*r,i=0;return n<1&&(i=(r-n)/(1-n)),[t[0],n*100,i*100]};J.hcg.rgb=function(t){let e=t[0]/360,r=t[1]/100,n=t[2]/100;if(r===0)return[n*255,n*255,n*255];let i=[0,0,0],o=e%1*6,s=o%1,a=1-s,u=0;switch(Math.floor(o)){case 0:i[0]=1,i[1]=s,i[2]=0;break;case 1:i[0]=a,i[1]=1,i[2]=0;break;case 2:i[0]=0,i[1]=1,i[2]=s;break;case 3:i[0]=0,i[1]=a,i[2]=1;break;case 4:i[0]=s,i[1]=0,i[2]=1;break;default:i[0]=1,i[1]=0,i[2]=a}return u=(1-r)*n,[(r*i[0]+u)*255,(r*i[1]+u)*255,(r*i[2]+u)*255]};J.hcg.hsv=function(t){let e=t[1]/100,r=t[2]/100,n=e+r*(1-e),i=0;return n>0&&(i=e/n),[t[0],i*100,n*100]};J.hcg.hsl=function(t){let e=t[1]/100,n=t[2]/100*(1-e)+.5*e,i=0;return n>0&&n<.5?i=e/(2*n):n>=.5&&n<1&&(i=e/(2*(1-n))),[t[0],i*100,n*100]};J.hcg.hwb=function(t){let e=t[1]/100,r=t[2]/100,n=e+r*(1-e);return[t[0],(n-e)*100,(1-n)*100]};J.hwb.hcg=function(t){let e=t[1]/100,n=1-t[2]/100,i=n-e,o=0;return i<1&&(o=(n-i)/(1-i)),[t[0],i*100,o*100]};J.apple.rgb=function(t){return[t[0]/65535*255,t[1]/65535*255,t[2]/65535*255]};J.rgb.apple=function(t){return[t[0]/255*65535,t[1]/255*65535,t[2]/255*65535]};J.gray.rgb=function(t){return[t[0]/100*255,t[0]/100*255,t[0]/100*255]};J.gray.hsl=function(t){return[0,0,t[0]]};J.gray.hsv=J.gray.hsl;J.gray.hwb=function(t){return[0,100,t[0]]};J.gray.cmyk=function(t){return[0,0,0,t[0]]};J.gray.lab=function(t){return[t[0],0,0]};J.gray.hex=function(t){let e=Math.round(t[0]/100*255)&255,n=((e<<16)+(e<<8)+e).toString(16).toUpperCase();return"000000".substring(n.length)+n};J.rgb.gray=function(t){return[(t[0]+t[1]+t[2])/3/255*100]}});var xk=y((Mhe,Sk)=>{var Rd=$D();function vX(){let t={},e=Object.keys(Rd);for(let r=e.length,n=0;n<r;n++)t[e[n]]={distance:-1,parent:null};return t}function bX(t){let e=vX(),r=[t];for(e[t].distance=0;r.length;){let n=r.pop(),i=Object.keys(Rd[n]);for(let o=i.length,s=0;s<o;s++){let a=i[s],u=e[a];u.distance===-1&&(u.distance=e[n].distance+1,u.parent=n,r.unshift(a))}}return e}function wX(t,e){return function(r){return e(t(r))}}function _X(t,e){let r=[e[t].parent,t],n=Rd[e[t].parent][t],i=e[t].parent;for(;e[i].parent;)r.unshift(e[i].parent),n=wX(Rd[e[i].parent][i],n),i=e[i].parent;return n.conversion=r,n}Sk.exports=function(t){let e=bX(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]=_X(s,e))}return r}});var Ok=y((Uhe,Fk)=>{var ID=$D(),EX=xk(),Ws={},CX=Object.keys(ID);function SX(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 xX(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}CX.forEach(t=>{Ws[t]={},Object.defineProperty(Ws[t],"channels",{value:ID[t].channels}),Object.defineProperty(Ws[t],"labels",{value:ID[t].labels});let e=EX(t);Object.keys(e).forEach(n=>{let i=e[n];Ws[t][n]=xX(i),Ws[t][n].raw=SX(i)})});Fk.exports=Ws});var ND=y((Vhe,Rk)=>{"use strict";var Ak=(t,e)=>(...r)=>`\x1B[${t(...r)+e}m`,kk=(t,e)=>(...r)=>{let n=t(...r);return`\x1B[${38+e};5;${n}m`},Tk=(t,e)=>(...r)=>{let n=t(...r);return`\x1B[${38+e};2;${n[0]};${n[1]};${n[2]}m`},$d=t=>t,Pk=(t,e,r)=>[t,e,r],Ks=(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})},jD,Ys=(t,e,r,n)=>{jD===void 0&&(jD=Ok());let i=n?10:0,o={};for(let[s,a]of Object.entries(jD)){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 FX(){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",Ks(e.color,"ansi",()=>Ys(Ak,"ansi16",$d,!1)),Ks(e.color,"ansi256",()=>Ys(kk,"ansi256",$d,!1)),Ks(e.color,"ansi16m",()=>Ys(Tk,"rgb",Pk,!1)),Ks(e.bgColor,"ansi",()=>Ys(Ak,"ansi16",$d,!0)),Ks(e.bgColor,"ansi256",()=>Ys(kk,"ansi256",$d,!0)),Ks(e.bgColor,"ansi16m",()=>Ys(Tk,"rgb",Pk,!0)),e}Object.defineProperty(Rk,"exports",{enumerable:!0,get:FX})});var Lk=y((Hhe,Nk)=>{"use strict";var OX=RD(),AX=bk(),$k=ND(),jk=["\x1B","\x9B"],Id=t=>`${jk[0]}[${t}m`,Ik=(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=$k.codes.get(Number.parseInt(i,10));if(s){let a=t.indexOf(s.toString());a===-1?n.push(Id(e?s:o)):t.splice(a,1)}else if(e){n.push(Id(0));break}else n.push(Id(o))}if(e&&(n=n.filter((i,o)=>n.indexOf(i)===o),r!==void 0)){let i=Id($k.codes.get(Number.parseInt(r,10)));n=n.reduce((o,s)=>s===i?[s,...o]:[...o,s],[])}return n.join("")};Nk.exports=(t,e,r)=>{let n=[...t],i=[],o=typeof r=="number"?r:n.length,s=!1,a,u=0,c="";for(let[l,f]of n.entries()){let h=!1;if(jk.includes(f)){let d=/\d[^m]*/.exec(t.slice(l,l+18));a=d&&d.length>0?d[0]:void 0,u<o&&(s=!0,a!==void 0&&i.push(a))}else s&&f==="m"&&(s=!1,h=!0);if(!s&&!h&&u++,!AX({exact:!0}).test(f)&&OX(f.codePointAt())&&(u++,typeof r!="number"&&o++),u>e&&u<=o)c+=f;else if(u===e&&!s&&a!==void 0)c=Ik(i);else if(u>=o){c+=Ik(i,!0,a);break}}return c}});var qk=y((zhe,Bk)=>{"use strict";Bk.exports=({onlyFirst:t=!1}={})=>{let e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(e,t?void 0:"g")}});var jd=y((Ghe,Mk)=>{"use strict";var kX=qk();Mk.exports=t=>typeof t=="string"?t.replace(kX(),""):t});var Vk=y((Whe,Uk)=>{"use strict";Uk.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 BD=y((Khe,LD)=>{"use strict";var TX=jd(),PX=RD(),RX=Vk(),Hk=t=>{if(typeof t!="string"||t.length===0||(t=TX(t),t.length===0))return 0;t=t.replace(RX()," ");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+=PX(n)?2:1)}return e};LD.exports=Hk;LD.exports.default=Hk});var Jk=y((Yhe,Yk)=>{"use strict";var sc=BD(),$X=jd(),IX=ND(),Nd=new Set(["\x1B","\x9B"]),jX=39,MD="\x07",Wk="[",NX="]",Kk="m",UD=`${NX}8;;`,zk=t=>`${Nd.values().next().value}${Wk}${t}${Kk}`,Gk=t=>`${Nd.values().next().value}${UD}${t}${MD}`,LX=t=>t.split(" ").map(e=>sc(e)),qD=(t,e,r)=>{let n=[...e],i=!1,o=!1,s=sc($X(t[t.length-1]));for(let[a,u]of n.entries()){let c=sc(u);if(s+c<=r?t[t.length-1]+=u:(t.push(u),s=0),Nd.has(u)&&(i=!0,o=n.slice(a+1).join("").startsWith(UD)),i){o?u===MD&&(i=!1,o=!1):u===Kk&&(i=!1);continue}s+=c,s===r&&a<n.length-1&&(t.push(""),s=0)}!s&&t[t.length-1].length>0&&t.length>1&&(t[t.length-2]+=t.pop())},BX=t=>{let e=t.split(" "),r=e.length;for(;r>0&&!(sc(e[r-1])>0);)r--;return r===e.length?t:e.slice(0,r).join(" ")+e.slice(r).join("")},qX=(t,e,r={})=>{if(r.trim!==!1&&t.trim()==="")return"";let n="",i,o,s=LX(t),a=[""];for(let[c,l]of t.split(" ").entries()){r.trim!==!1&&(a[a.length-1]=a[a.length-1].trimStart());let f=sc(a[a.length-1]);if(c!==0&&(f>=e&&(r.wordWrap===!1||r.trim===!1)&&(a.push(""),f=0),(f>0||r.trim===!1)&&(a[a.length-1]+=" ",f++)),r.hard&&s[c]>e){let h=e-f,d=1+Math.floor((s[c]-h-1)/e);Math.floor((s[c]-1)/e)<d&&a.push(""),qD(a,l,e);continue}if(f+s[c]>e&&f>0&&s[c]>0){if(r.wordWrap===!1&&f<e){qD(a,l,e);continue}a.push("")}if(f+s[c]>e&&r.wordWrap===!1){qD(a,l,e);continue}a[a.length-1]+=l}r.trim!==!1&&(a=a.map(BX));let u=[...a.join(`
50
- `)];for(let[c,l]of u.entries()){if(n+=l,Nd.has(l)){let{groups:h}=new RegExp(`(?:\\${Wk}(?<code>\\d+)m|\\${UD}(?<uri>.*)${MD})`).exec(u.slice(c).join(""))||{groups:{}};if(h.code!==void 0){let d=Number.parseFloat(h.code);i=d===jX?void 0:d}else h.uri!==void 0&&(o=h.uri.length===0?void 0:h.uri)}let f=IX.codes.get(Number(i));u[c+1]===`
51
- `?(o&&(n+=Gk("")),i&&f&&(n+=zk(f))):l===`
52
- `&&(i&&f&&(n+=zk(i)),o&&(n+=Gk(o)))}return n};Yk.exports=(t,e,r)=>String(t).normalize().replace(/\r\n/g,`
48
+ `)}function rX(t){t?process.env.DEBUG=t:delete process.env.DEBUG}function nX(){return process.env.DEBUG}function iX(t){t.inspectOpts={};let e=Object.keys(gt.inspectOpts);for(let r=0;r<e.length;r++)t.inspectOpts[e[r]]=gt.inspectOpts[e[r]]}Fd.exports=ED()(gt);var{formatters:jA}=Fd.exports;jA.o=function(t){return this.inspectOpts.colors=this.useColors,xd.inspect(t,this.inspectOpts).split(`
49
+ `).map(e=>e.trim()).join(" ")};jA.O=function(t){return this.inspectOpts.colors=this.useColors,xd.inspect(t,this.inspectOpts)}});var LA=y((Phe,FD)=>{typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?FD.exports=TA():FD.exports=NA()});var zA=y((Rhe,HA)=>{"use strict";var OD,qA,MA,UA,VA=!0;typeof process<"u"&&({FORCE_COLOR:OD,NODE_DISABLE_COLORS:qA,NO_COLOR:MA,TERM:UA}=process.env||{},VA=process.stdout&&process.stdout.isTTY);var we={enabled:!qA&&MA==null&&UA!=="dumb"&&(OD!=null&&OD!=="0"||VA),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 BA(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 oX(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.indexOf(t)||(this.has.push(t),this.keys.push(r)),n===void 0?this:we.enabled?BA(this.keys,n+""):n+""):n===void 0?oX([t],[r]):we.enabled?BA([r],n+""):n+""}}HA.exports=we});var Hs=y(tt=>{"use strict";Object.defineProperty(tt,"__esModule",{value:!0});tt.ancillary=tt.failure=tt.success=tt.input=tt.weak=tt.strong=void 0;var sX=(Cn(),Ae(En)),Yr=sX.__importDefault(zA());tt.strong=Yr.default.bold;tt.weak=Yr.default.dim;tt.input=Yr.default.cyan;tt.success=Yr.default.green;tt.failure=Yr.default.red;tt.ancillary=Yr.default.cyan;var aX={strong:tt.strong,weak:tt.weak,input:tt.input,success:tt.success,failure:tt.failure,ancillary:tt.ancillary,log:{DEBUG:Yr.default.magenta,INFO:Yr.default.cyan,WARN:Yr.default.yellow,ERROR:Yr.default.red}};tt.default=aX});var nc={};mn(nc,{__addDisposableResource:()=>dk,__assign:()=>Od,__asyncDelegator:()=>ik,__asyncGenerator:()=>nk,__asyncValues:()=>ok,__await:()=>zs,__awaiter:()=>XA,__classPrivateFieldGet:()=>ck,__classPrivateFieldIn:()=>fk,__classPrivateFieldSet:()=>lk,__createBinding:()=>kd,__decorate:()=>KA,__disposeResources:()=>hk,__esDecorate:()=>uX,__exportStar:()=>QA,__extends:()=>GA,__generator:()=>ZA,__importDefault:()=>uk,__importStar:()=>ak,__makeTemplateObject:()=>sk,__metadata:()=>JA,__param:()=>YA,__propKey:()=>lX,__read:()=>kD,__rest:()=>WA,__runInitializers:()=>cX,__setFunctionName:()=>fX,__spread:()=>ek,__spreadArray:()=>rk,__spreadArrays:()=>tk,__values:()=>Ad,default:()=>pX});function GA(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");AD(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}function WA(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 KA(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 YA(t,e){return function(r,n){e(r,n,t)}}function uX(t,e,r,n,i,o){function s(w){if(w!==void 0&&typeof w!="function")throw new TypeError("Function expected");return w}for(var a=n.kind,u=a==="getter"?"get":a==="setter"?"set":"value",c=!e&&t?n.static?t:t.prototype:null,l=e||(c?Object.getOwnPropertyDescriptor(c,n.name):{}),f,h=!1,d=r.length-1;d>=0;d--){var 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(w){if(h)throw new TypeError("Cannot add initializers after decoration has completed");o.push(s(w||null))};var g=(0,r[d])(a==="accessor"?{get:l.get,set:l.set}:l[u],m);if(a==="accessor"){if(g===void 0)continue;if(g===null||typeof g!="object")throw new TypeError("Object expected");(f=s(g.get))&&(l.get=f),(f=s(g.set))&&(l.set=f),(f=s(g.init))&&i.unshift(f)}else(f=s(g))&&(a==="field"?i.unshift(f):l[u]=f)}c&&Object.defineProperty(c,n.name,l),h=!0}function cX(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 lX(t){return typeof t=="symbol"?t:"".concat(t)}function fX(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 JA(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function XA(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(l){try{c(n.next(l))}catch(f){s(f)}}function u(l){try{c(n.throw(l))}catch(f){s(f)}}function c(l){l.done?o(l.value):i(l.value).then(a,u)}c((n=n.apply(t,e||[])).next())})}function ZA(t,e){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(c){return function(l){return u([c,l])}}function u(c){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,c[0]&&(r=0)),r;)try{if(n=1,i&&(o=c[0]&2?i.return:c[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,c[1])).done)return o;switch(i=0,o&&(c=[c[0]&2,o.value]),c[0]){case 0:case 1:o=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,i=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]<o[3])){r.label=c[1];break}if(c[0]===6&&r.label<o[1]){r.label=o[1],o=c;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(c);break}o[2]&&r.ops.pop(),r.trys.pop();continue}c=e.call(t,r)}catch(l){c=[6,l],i=0}finally{n=o=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function QA(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&kd(e,t,r)}function Ad(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function kD(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 ek(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(kD(arguments[e]));return t}function tk(){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 rk(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 zs(t){return this instanceof zs?(this.v=t,this):new zs(t)}function nk(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(t,e||[]),i,o=[];return i={},s("next"),s("throw"),s("return"),i[Symbol.asyncIterator]=function(){return this},i;function s(h){n[h]&&(i[h]=function(d){return new Promise(function(m,b){o.push([h,d,m,b])>1||a(h,d)})})}function a(h,d){try{u(n[h](d))}catch(m){f(o[0][3],m)}}function u(h){h.value instanceof zs?Promise.resolve(h.value.v).then(c,l):f(o[0][2],h)}function c(h){a("next",h)}function l(h){a("throw",h)}function f(h,d){h(d),o.shift(),o.length&&a(o[0][0],o[0][1])}}function ik(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:zs(t[i](s)),done:!1}:o?o(s):s}:o}}function ok(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof Ad=="function"?Ad(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(o){r[o]=t[o]&&function(s){return new Promise(function(a,u){s=t[o](s),i(a,u,s.done,s.value)})}}function i(o,s,a,u){Promise.resolve(u).then(function(c){o({value:c,done:a})},s)}}function sk(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function ak(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&kd(e,t,r);return dX(e,t),e}function uk(t){return t&&t.__esModule?t:{default:t}}function ck(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 lk(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 fk(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 dk(t,e,r){if(e!=null){if(typeof e!="object"&&typeof e!="function")throw new TypeError("Object expected.");var n;if(r){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");n=e[Symbol.asyncDispose]}if(n===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");n=e[Symbol.dispose]}if(typeof n!="function")throw new TypeError("Object not disposable.");t.stack.push({value:e,dispose:n,async:r})}else r&&t.stack.push({async:!0});return e}function hk(t){function e(n){t.error=t.hasError?new hX(n,t.error,"An error was suppressed during disposal."):n,t.hasError=!0}function r(){for(;t.stack.length;){var n=t.stack.pop();try{var i=n.dispose&&n.dispose.call(n.value);if(n.async)return Promise.resolve(i).then(r,function(o){return e(o),r()})}catch(o){e(o)}}if(t.hasError)throw t.error}return r()}var AD,Od,kd,dX,hX,pX,ic=ct(()=>{AD=function(t,e){return AD=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])},AD(t,e)};Od=function(){return Od=Object.assign||function(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},Od.apply(this,arguments)};kd=Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]};dX=Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e};hX=typeof SuppressedError=="function"?SuppressedError:function(t,e,r){var n=new Error(r);return n.name="SuppressedError",n.error=t,n.suppressed=e,n};pX={__extends:GA,__assign:Od,__rest:WA,__decorate:KA,__param:YA,__metadata:JA,__awaiter:XA,__generator:ZA,__createBinding:kd,__exportStar:QA,__values:Ad,__read:kD,__spread:ek,__spreadArrays:tk,__spreadArray:rk,__await:zs,__asyncGenerator:nk,__asyncDelegator:ik,__asyncValues:ok,__makeTemplateObject:sk,__importStar:ak,__importDefault:uk,__classPrivateFieldGet:ck,__classPrivateFieldSet:lk,__classPrivateFieldIn:fk,__addDisposableResource:dk,__disposeResources:hk}});var TD=y(Td=>{"use strict";Object.defineProperty(Td,"__esModule",{value:!0});Td.EscapeCode=void 0;var Tr="\x1B[",yt=class{};Td.EscapeCode=yt;yt.cursorLeft=()=>`${Tr}G`;yt.cursorUp=(t=1)=>`${Tr}${t}A`;yt.cursorDown=(t=1)=>`${Tr}${t}B`;yt.cursorForward=(t=1)=>`${Tr}${t}C`;yt.cursorBackward=(t=1)=>`${Tr}${t}D`;yt.cursorHide=()=>`${Tr}?25l`;yt.cursorShow=()=>`${Tr}?25h`;yt.eraseLine=()=>`${Tr}2K`;yt.eraseLines=t=>{let e="";for(let r=0;r<t;r++)e+=yt.eraseLine(),r<t-1&&(e+=yt.cursorUp());return`${e}${yt.cursorLeft()}`};yt.eraseUp=()=>`${Tr}1J`;yt.eraseDown=()=>`${Tr}J`;yt.eraseScreen=()=>`${Tr}2J`});var mk=y(Pd=>{"use strict";Object.defineProperty(Pd,"__esModule",{value:!0});Pd.Cursor=void 0;var mX=(ic(),Ae(nc)),gX=mX.__importDefault(zy()),pk=TD(),Gs=class t{static show(){t.stream.isTTY&&(t._isVisible=!0,t.stream.write(pk.EscapeCode.cursorShow()))}static hide(){t.stream.isTTY&&(t._listenerAttached||((0,gX.default)(()=>{t.show()}),t._listenerAttached=!0),t._isVisible=!1,t.stream.write(pk.EscapeCode.cursorHide()))}static toggle(){t._isVisible?t.hide():t.show()}};Pd.Cursor=Gs;Gs.stream=process.stderr;Gs._isVisible=!0;Gs._listenerAttached=!1});var RD=y((Nhe,PD)=>{"use strict";var gk=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);PD.exports=gk;PD.exports.default=gk});var vk=y((Lhe,Dk)=>{"use strict";var yk="[\uD800-\uDBFF][\uDC00-\uDFFF]",yX=t=>t&&t.exact?new RegExp(`^${yk}$`):new RegExp(yk,"g");Dk.exports=yX});var wk=y((Bhe,bk)=>{"use strict";bk.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 $D=y((qhe,Ek)=>{var oc=wk(),_k={};for(let t of Object.keys(oc))_k[oc[t]]=t;var J={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};Ek.exports=J;for(let t of Object.keys(J)){if(!("channels"in J[t]))throw new Error("missing channels property: "+t);if(!("labels"in J[t]))throw new Error("missing channel labels property: "+t);if(J[t].labels.length!==J[t].channels)throw new Error("channel and label counts mismatch: "+t);let{channels:e,labels:r}=J[t];delete J[t].channels,delete J[t].labels,Object.defineProperty(J[t],"channels",{value:e}),Object.defineProperty(J[t],"labels",{value:r})}J.rgb.hsl=function(t){let e=t[0]/255,r=t[1]/255,n=t[2]/255,i=Math.min(e,r,n),o=Math.max(e,r,n),s=o-i,a,u;o===i?a=0:e===o?a=(r-n)/s:r===o?a=2+(n-e)/s:n===o&&(a=4+(e-r)/s),a=Math.min(a*60,360),a<0&&(a+=360);let c=(i+o)/2;return o===i?u=0:c<=.5?u=s/(o+i):u=s/(2-o-i),[a,u*100,c*100]};J.rgb.hsv=function(t){let e,r,n,i,o,s=t[0]/255,a=t[1]/255,u=t[2]/255,c=Math.max(s,a,u),l=c-Math.min(s,a,u),f=function(h){return(c-h)/6/l+1/2};return l===0?(i=0,o=0):(o=l/c,e=f(s),r=f(a),n=f(u),s===c?i=n-r:a===c?i=1/3+e-n:u===c&&(i=2/3+r-e),i<0?i+=1:i>1&&(i-=1)),[i*360,o*100,c*100]};J.rgb.hwb=function(t){let e=t[0],r=t[1],n=t[2],i=J.rgb.hsl(t)[0],o=1/255*Math.min(e,Math.min(r,n));return n=1-1/255*Math.max(e,Math.max(r,n)),[i,o*100,n*100]};J.rgb.cmyk=function(t){let e=t[0]/255,r=t[1]/255,n=t[2]/255,i=Math.min(1-e,1-r,1-n),o=(1-e-i)/(1-i)||0,s=(1-r-i)/(1-i)||0,a=(1-n-i)/(1-i)||0;return[o*100,s*100,a*100,i*100]};function DX(t,e){return(t[0]-e[0])**2+(t[1]-e[1])**2+(t[2]-e[2])**2}J.rgb.keyword=function(t){let e=_k[t];if(e)return e;let r=1/0,n;for(let i of Object.keys(oc)){let o=oc[i],s=DX(t,o);s<r&&(r=s,n=i)}return n};J.keyword.rgb=function(t){return oc[t]};J.rgb.xyz=function(t){let e=t[0]/255,r=t[1]/255,n=t[2]/255;e=e>.04045?((e+.055)/1.055)**2.4:e/12.92,r=r>.04045?((r+.055)/1.055)**2.4:r/12.92,n=n>.04045?((n+.055)/1.055)**2.4:n/12.92;let i=e*.4124+r*.3576+n*.1805,o=e*.2126+r*.7152+n*.0722,s=e*.0193+r*.1192+n*.9505;return[i*100,o*100,s*100]};J.rgb.lab=function(t){let e=J.rgb.xyz(t),r=e[0],n=e[1],i=e[2];r/=95.047,n/=100,i/=108.883,r=r>.008856?r**(1/3):7.787*r+16/116,n=n>.008856?n**(1/3):7.787*n+16/116,i=i>.008856?i**(1/3):7.787*i+16/116;let o=116*n-16,s=500*(r-n),a=200*(n-i);return[o,s,a]};J.hsl.rgb=function(t){let e=t[0]/360,r=t[1]/100,n=t[2]/100,i,o,s;if(r===0)return s=n*255,[s,s,s];n<.5?i=n*(1+r):i=n+r-n*r;let a=2*n-i,u=[0,0,0];for(let c=0;c<3;c++)o=e+1/3*-(c-1),o<0&&o++,o>1&&o--,6*o<1?s=a+(i-a)*6*o:2*o<1?s=i:3*o<2?s=a+(i-a)*(2/3-o)*6:s=a,u[c]=s*255;return u};J.hsl.hsv=function(t){let e=t[0],r=t[1]/100,n=t[2]/100,i=r,o=Math.max(n,.01);n*=2,r*=n<=1?n:2-n,i*=o<=1?o:2-o;let s=(n+r)/2,a=n===0?2*i/(o+i):2*r/(n+r);return[e,a*100,s*100]};J.hsv.rgb=function(t){let e=t[0]/60,r=t[1]/100,n=t[2]/100,i=Math.floor(e)%6,o=e-Math.floor(e),s=255*n*(1-r),a=255*n*(1-r*o),u=255*n*(1-r*(1-o));switch(n*=255,i){case 0:return[n,u,s];case 1:return[a,n,s];case 2:return[s,n,u];case 3:return[s,a,n];case 4:return[u,s,n];case 5:return[n,s,a]}};J.hsv.hsl=function(t){let e=t[0],r=t[1]/100,n=t[2]/100,i=Math.max(n,.01),o,s;s=(2-r)*n;let a=(2-r)*i;return o=r*i,o/=a<=1?a:2-a,o=o||0,s/=2,[e,o*100,s*100]};J.hwb.rgb=function(t){let e=t[0]/360,r=t[1]/100,n=t[2]/100,i=r+n,o;i>1&&(r/=i,n/=i);let s=Math.floor(6*e),a=1-n;o=6*e-s,s&1&&(o=1-o);let u=r+o*(a-r),c,l,f;switch(s){default:case 6:case 0:c=a,l=u,f=r;break;case 1:c=u,l=a,f=r;break;case 2:c=r,l=a,f=u;break;case 3:c=r,l=u,f=a;break;case 4:c=u,l=r,f=a;break;case 5:c=a,l=r,f=u;break}return[c*255,l*255,f*255]};J.cmyk.rgb=function(t){let e=t[0]/100,r=t[1]/100,n=t[2]/100,i=t[3]/100,o=1-Math.min(1,e*(1-i)+i),s=1-Math.min(1,r*(1-i)+i),a=1-Math.min(1,n*(1-i)+i);return[o*255,s*255,a*255]};J.xyz.rgb=function(t){let e=t[0]/100,r=t[1]/100,n=t[2]/100,i,o,s;return i=e*3.2406+r*-1.5372+n*-.4986,o=e*-.9689+r*1.8758+n*.0415,s=e*.0557+r*-.204+n*1.057,i=i>.0031308?1.055*i**(1/2.4)-.055:i*12.92,o=o>.0031308?1.055*o**(1/2.4)-.055:o*12.92,s=s>.0031308?1.055*s**(1/2.4)-.055:s*12.92,i=Math.min(Math.max(0,i),1),o=Math.min(Math.max(0,o),1),s=Math.min(Math.max(0,s),1),[i*255,o*255,s*255]};J.xyz.lab=function(t){let e=t[0],r=t[1],n=t[2];e/=95.047,r/=100,n/=108.883,e=e>.008856?e**(1/3):7.787*e+16/116,r=r>.008856?r**(1/3):7.787*r+16/116,n=n>.008856?n**(1/3):7.787*n+16/116;let i=116*r-16,o=500*(e-r),s=200*(r-n);return[i,o,s]};J.lab.xyz=function(t){let e=t[0],r=t[1],n=t[2],i,o,s;o=(e+16)/116,i=r/500+o,s=o-n/200;let a=o**3,u=i**3,c=s**3;return o=a>.008856?a:(o-16/116)/7.787,i=u>.008856?u:(i-16/116)/7.787,s=c>.008856?c:(s-16/116)/7.787,i*=95.047,o*=100,s*=108.883,[i,o,s]};J.lab.lch=function(t){let e=t[0],r=t[1],n=t[2],i;i=Math.atan2(n,r)*360/2/Math.PI,i<0&&(i+=360);let s=Math.sqrt(r*r+n*n);return[e,s,i]};J.lch.lab=function(t){let e=t[0],r=t[1],i=t[2]/360*2*Math.PI,o=r*Math.cos(i),s=r*Math.sin(i);return[e,o,s]};J.rgb.ansi16=function(t,e=null){let[r,n,i]=t,o=e===null?J.rgb.hsv(t)[2]:e;if(o=Math.round(o/50),o===0)return 30;let s=30+(Math.round(i/255)<<2|Math.round(n/255)<<1|Math.round(r/255));return o===2&&(s+=60),s};J.hsv.ansi16=function(t){return J.rgb.ansi16(J.hsv.rgb(t),t[2])};J.rgb.ansi256=function(t){let e=t[0],r=t[1],n=t[2];return e===r&&r===n?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5)};J.ansi16.rgb=function(t){let e=t%10;if(e===0||e===7)return t>50&&(e+=3.5),e=e/10.5*255,[e,e,e];let r=(~~(t>50)+1)*.5,n=(e&1)*r*255,i=(e>>1&1)*r*255,o=(e>>2&1)*r*255;return[n,i,o]};J.ansi256.rgb=function(t){if(t>=232){let o=(t-232)*10+8;return[o,o,o]}t-=16;let e,r=Math.floor(t/36)/5*255,n=Math.floor((e=t%36)/6)/5*255,i=e%6/5*255;return[r,n,i]};J.rgb.hex=function(t){let r=(((Math.round(t[0])&255)<<16)+((Math.round(t[1])&255)<<8)+(Math.round(t[2])&255)).toString(16).toUpperCase();return"000000".substring(r.length)+r};J.hex.rgb=function(t){let e=t.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!e)return[0,0,0];let r=e[0];e[0].length===3&&(r=r.split("").map(a=>a+a).join(""));let n=parseInt(r,16),i=n>>16&255,o=n>>8&255,s=n&255;return[i,o,s]};J.rgb.hcg=function(t){let e=t[0]/255,r=t[1]/255,n=t[2]/255,i=Math.max(Math.max(e,r),n),o=Math.min(Math.min(e,r),n),s=i-o,a,u;return s<1?a=o/(1-s):a=0,s<=0?u=0:i===e?u=(r-n)/s%6:i===r?u=2+(n-e)/s:u=4+(e-r)/s,u/=6,u%=1,[u*360,s*100,a*100]};J.hsl.hcg=function(t){let e=t[1]/100,r=t[2]/100,n=r<.5?2*e*r:2*e*(1-r),i=0;return n<1&&(i=(r-.5*n)/(1-n)),[t[0],n*100,i*100]};J.hsv.hcg=function(t){let e=t[1]/100,r=t[2]/100,n=e*r,i=0;return n<1&&(i=(r-n)/(1-n)),[t[0],n*100,i*100]};J.hcg.rgb=function(t){let e=t[0]/360,r=t[1]/100,n=t[2]/100;if(r===0)return[n*255,n*255,n*255];let i=[0,0,0],o=e%1*6,s=o%1,a=1-s,u=0;switch(Math.floor(o)){case 0:i[0]=1,i[1]=s,i[2]=0;break;case 1:i[0]=a,i[1]=1,i[2]=0;break;case 2:i[0]=0,i[1]=1,i[2]=s;break;case 3:i[0]=0,i[1]=a,i[2]=1;break;case 4:i[0]=s,i[1]=0,i[2]=1;break;default:i[0]=1,i[1]=0,i[2]=a}return u=(1-r)*n,[(r*i[0]+u)*255,(r*i[1]+u)*255,(r*i[2]+u)*255]};J.hcg.hsv=function(t){let e=t[1]/100,r=t[2]/100,n=e+r*(1-e),i=0;return n>0&&(i=e/n),[t[0],i*100,n*100]};J.hcg.hsl=function(t){let e=t[1]/100,n=t[2]/100*(1-e)+.5*e,i=0;return n>0&&n<.5?i=e/(2*n):n>=.5&&n<1&&(i=e/(2*(1-n))),[t[0],i*100,n*100]};J.hcg.hwb=function(t){let e=t[1]/100,r=t[2]/100,n=e+r*(1-e);return[t[0],(n-e)*100,(1-n)*100]};J.hwb.hcg=function(t){let e=t[1]/100,n=1-t[2]/100,i=n-e,o=0;return i<1&&(o=(n-i)/(1-i)),[t[0],i*100,o*100]};J.apple.rgb=function(t){return[t[0]/65535*255,t[1]/65535*255,t[2]/65535*255]};J.rgb.apple=function(t){return[t[0]/255*65535,t[1]/255*65535,t[2]/255*65535]};J.gray.rgb=function(t){return[t[0]/100*255,t[0]/100*255,t[0]/100*255]};J.gray.hsl=function(t){return[0,0,t[0]]};J.gray.hsv=J.gray.hsl;J.gray.hwb=function(t){return[0,100,t[0]]};J.gray.cmyk=function(t){return[0,0,0,t[0]]};J.gray.lab=function(t){return[t[0],0,0]};J.gray.hex=function(t){let e=Math.round(t[0]/100*255)&255,n=((e<<16)+(e<<8)+e).toString(16).toUpperCase();return"000000".substring(n.length)+n};J.rgb.gray=function(t){return[(t[0]+t[1]+t[2])/3/255*100]}});var Sk=y((Mhe,Ck)=>{var Rd=$D();function vX(){let t={},e=Object.keys(Rd);for(let r=e.length,n=0;n<r;n++)t[e[n]]={distance:-1,parent:null};return t}function bX(t){let e=vX(),r=[t];for(e[t].distance=0;r.length;){let n=r.pop(),i=Object.keys(Rd[n]);for(let o=i.length,s=0;s<o;s++){let a=i[s],u=e[a];u.distance===-1&&(u.distance=e[n].distance+1,u.parent=n,r.unshift(a))}}return e}function wX(t,e){return function(r){return e(t(r))}}function _X(t,e){let r=[e[t].parent,t],n=Rd[e[t].parent][t],i=e[t].parent;for(;e[i].parent;)r.unshift(e[i].parent),n=wX(Rd[e[i].parent][i],n),i=e[i].parent;return n.conversion=r,n}Ck.exports=function(t){let e=bX(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]=_X(s,e))}return r}});var Fk=y((Uhe,xk)=>{var ID=$D(),EX=Sk(),Ws={},CX=Object.keys(ID);function SX(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 xX(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}CX.forEach(t=>{Ws[t]={},Object.defineProperty(Ws[t],"channels",{value:ID[t].channels}),Object.defineProperty(Ws[t],"labels",{value:ID[t].labels});let e=EX(t);Object.keys(e).forEach(n=>{let i=e[n];Ws[t][n]=xX(i),Ws[t][n].raw=SX(i)})});xk.exports=Ws});var ND=y((Vhe,Pk)=>{"use strict";var Ok=(t,e)=>(...r)=>`\x1B[${t(...r)+e}m`,Ak=(t,e)=>(...r)=>{let n=t(...r);return`\x1B[${38+e};5;${n}m`},kk=(t,e)=>(...r)=>{let n=t(...r);return`\x1B[${38+e};2;${n[0]};${n[1]};${n[2]}m`},$d=t=>t,Tk=(t,e,r)=>[t,e,r],Ks=(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})},jD,Ys=(t,e,r,n)=>{jD===void 0&&(jD=Fk());let i=n?10:0,o={};for(let[s,a]of Object.entries(jD)){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 FX(){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",Ks(e.color,"ansi",()=>Ys(Ok,"ansi16",$d,!1)),Ks(e.color,"ansi256",()=>Ys(Ak,"ansi256",$d,!1)),Ks(e.color,"ansi16m",()=>Ys(kk,"rgb",Tk,!1)),Ks(e.bgColor,"ansi",()=>Ys(Ok,"ansi16",$d,!0)),Ks(e.bgColor,"ansi256",()=>Ys(Ak,"ansi256",$d,!0)),Ks(e.bgColor,"ansi16m",()=>Ys(kk,"rgb",Tk,!0)),e}Object.defineProperty(Pk,"exports",{enumerable:!0,get:FX})});var Nk=y((Hhe,jk)=>{"use strict";var OX=RD(),AX=vk(),Rk=ND(),Ik=["\x1B","\x9B"],Id=t=>`${Ik[0]}[${t}m`,$k=(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=Rk.codes.get(Number.parseInt(i,10));if(s){let a=t.indexOf(s.toString());a===-1?n.push(Id(e?s:o)):t.splice(a,1)}else if(e){n.push(Id(0));break}else n.push(Id(o))}if(e&&(n=n.filter((i,o)=>n.indexOf(i)===o),r!==void 0)){let i=Id(Rk.codes.get(Number.parseInt(r,10)));n=n.reduce((o,s)=>s===i?[s,...o]:[...o,s],[])}return n.join("")};jk.exports=(t,e,r)=>{let n=[...t],i=[],o=typeof r=="number"?r:n.length,s=!1,a,u=0,c="";for(let[l,f]of n.entries()){let h=!1;if(Ik.includes(f)){let d=/\d[^m]*/.exec(t.slice(l,l+18));a=d&&d.length>0?d[0]:void 0,u<o&&(s=!0,a!==void 0&&i.push(a))}else s&&f==="m"&&(s=!1,h=!0);if(!s&&!h&&u++,!AX({exact:!0}).test(f)&&OX(f.codePointAt())&&(u++,typeof r!="number"&&o++),u>e&&u<=o)c+=f;else if(u===e&&!s&&a!==void 0)c=$k(i);else if(u>=o){c+=$k(i,!0,a);break}}return c}});var Bk=y((zhe,Lk)=>{"use strict";Lk.exports=({onlyFirst:t=!1}={})=>{let e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(e,t?void 0:"g")}});var jd=y((Ghe,qk)=>{"use strict";var kX=Bk();qk.exports=t=>typeof t=="string"?t.replace(kX(),""):t});var Uk=y((Whe,Mk)=>{"use strict";Mk.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 BD=y((Khe,LD)=>{"use strict";var TX=jd(),PX=RD(),RX=Uk(),Vk=t=>{if(typeof t!="string"||t.length===0||(t=TX(t),t.length===0))return 0;t=t.replace(RX()," ");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+=PX(n)?2:1)}return e};LD.exports=Vk;LD.exports.default=Vk});var Yk=y((Yhe,Kk)=>{"use strict";var sc=BD(),$X=jd(),IX=ND(),Nd=new Set(["\x1B","\x9B"]),jX=39,MD="\x07",Gk="[",NX="]",Wk="m",UD=`${NX}8;;`,Hk=t=>`${Nd.values().next().value}${Gk}${t}${Wk}`,zk=t=>`${Nd.values().next().value}${UD}${t}${MD}`,LX=t=>t.split(" ").map(e=>sc(e)),qD=(t,e,r)=>{let n=[...e],i=!1,o=!1,s=sc($X(t[t.length-1]));for(let[a,u]of n.entries()){let c=sc(u);if(s+c<=r?t[t.length-1]+=u:(t.push(u),s=0),Nd.has(u)&&(i=!0,o=n.slice(a+1).join("").startsWith(UD)),i){o?u===MD&&(i=!1,o=!1):u===Wk&&(i=!1);continue}s+=c,s===r&&a<n.length-1&&(t.push(""),s=0)}!s&&t[t.length-1].length>0&&t.length>1&&(t[t.length-2]+=t.pop())},BX=t=>{let e=t.split(" "),r=e.length;for(;r>0&&!(sc(e[r-1])>0);)r--;return r===e.length?t:e.slice(0,r).join(" ")+e.slice(r).join("")},qX=(t,e,r={})=>{if(r.trim!==!1&&t.trim()==="")return"";let n="",i,o,s=LX(t),a=[""];for(let[c,l]of t.split(" ").entries()){r.trim!==!1&&(a[a.length-1]=a[a.length-1].trimStart());let f=sc(a[a.length-1]);if(c!==0&&(f>=e&&(r.wordWrap===!1||r.trim===!1)&&(a.push(""),f=0),(f>0||r.trim===!1)&&(a[a.length-1]+=" ",f++)),r.hard&&s[c]>e){let h=e-f,d=1+Math.floor((s[c]-h-1)/e);Math.floor((s[c]-1)/e)<d&&a.push(""),qD(a,l,e);continue}if(f+s[c]>e&&f>0&&s[c]>0){if(r.wordWrap===!1&&f<e){qD(a,l,e);continue}a.push("")}if(f+s[c]>e&&r.wordWrap===!1){qD(a,l,e);continue}a[a.length-1]+=l}r.trim!==!1&&(a=a.map(BX));let u=[...a.join(`
50
+ `)];for(let[c,l]of u.entries()){if(n+=l,Nd.has(l)){let{groups:h}=new RegExp(`(?:\\${Gk}(?<code>\\d+)m|\\${UD}(?<uri>.*)${MD})`).exec(u.slice(c).join(""))||{groups:{}};if(h.code!==void 0){let d=Number.parseFloat(h.code);i=d===jX?void 0:d}else h.uri!==void 0&&(o=h.uri.length===0?void 0:h.uri)}let f=IX.codes.get(Number(i));u[c+1]===`
51
+ `?(o&&(n+=zk("")),i&&f&&(n+=Hk(f))):l===`
52
+ `&&(i&&f&&(n+=Hk(i)),o&&(n+=zk(o)))}return n};Kk.exports=(t,e,r)=>String(t).normalize().replace(/\r\n/g,`
53
53
  `).split(`
54
54
  `).map(n=>qX(n,e,r)).join(`
55
- `)});var Qk=y((Jhe,Zk)=>{"use strict";var MX=require("os"),Xk=MX.homedir();Zk.exports=t=>{if(typeof t!="string")throw new TypeError(`Expected a string, got ${typeof t}`);return Xk?t.replace(/^~(?=$|\/|\\)/,Xk):t}});var o3=y(ze=>{"use strict";Object.defineProperty(ze,"__esModule",{value:!0});ze.columnar=ze.generateFillSpaceStringList=ze.expandPath=ze.prettyPath=ze.wordWrap=ze.indent=ze.TTY_WIDTH=ze.stripAnsi=ze.stringWidth=ze.sliceAnsi=void 0;var e3=(ic(),Ae(nc)),UX=e3.__importStar(require("os")),Fn=e3.__importStar(require("path")),t3=Lk();ze.sliceAnsi=t3;var Ld=BD();ze.stringWidth=Ld;var VX=jd();ze.stripAnsi=VX;var HX=Jk(),zX=Qk(),GX=80,WX=120;ze.TTY_WIDTH=process.stdout.columns?Math.max(GX,Math.min(process.stdout.columns,WX)):1/0;function r3(t=4){return" ".repeat(t)}ze.indent=r3;function KX(t,{width:e=ze.TTY_WIDTH,indentation:r=0,append:n=""}){return HX(t,e-r-n.length,{trim:!0}).split(`
55
+ `)});var Zk=y((Jhe,Xk)=>{"use strict";var MX=require("os"),Jk=MX.homedir();Xk.exports=t=>{if(typeof t!="string")throw new TypeError(`Expected a string, got ${typeof t}`);return Jk?t.replace(/^~(?=$|\/|\\)/,Jk):t}});var i3=y(ze=>{"use strict";Object.defineProperty(ze,"__esModule",{value:!0});ze.columnar=ze.generateFillSpaceStringList=ze.expandPath=ze.prettyPath=ze.wordWrap=ze.indent=ze.TTY_WIDTH=ze.stripAnsi=ze.stringWidth=ze.sliceAnsi=void 0;var Qk=(ic(),Ae(nc)),UX=Qk.__importStar(require("os")),Fn=Qk.__importStar(require("path")),e3=Nk();ze.sliceAnsi=e3;var Ld=BD();ze.stringWidth=Ld;var VX=jd();ze.stripAnsi=VX;var HX=Yk(),zX=Zk(),GX=80,WX=120;ze.TTY_WIDTH=process.stdout.columns?Math.max(GX,Math.min(process.stdout.columns,WX)):1/0;function t3(t=4){return" ".repeat(t)}ze.indent=t3;function KX(t,{width:e=ze.TTY_WIDTH,indentation:r=0,append:n=""}){return HX(t,e-r-n.length,{trim:!0}).split(`
56
56
  `).join(`${n}
57
- ${r3(r)}`)}ze.wordWrap=KX;function YX(t){t=n3(t);let e=process.cwd(),r=Fn.dirname(t),n=UX.homedir(),i=Math.abs(r.split(Fn.sep).length-e.split(Fn.sep).length);if(e===r)return"."+Fn.sep+Fn.basename(t);if(r.startsWith(e))return"."+Fn.sep+t.substring(e.length+1);if(i<=2){let o=Fn.relative(e,t);return o||"."}else{if(t===n)return"~";if(t.indexOf(n)===0)return"~"+Fn.sep+t.substring(n.length+1)}return t}ze.prettyPath=YX;function n3(t){return Fn.resolve(zX(t))}ze.expandPath=n3;function i3(t,e=1,r=" "){e<2&&(e=2);let n=Math.max(...t.map(s=>Ld(s))),i=n>e?n+1:e,o=r.repeat(i);return t.map(s=>t3(o,0,i-Ld(s)))}ze.generateFillSpaceStringList=i3;function JX(t,{hsep:e="-",vsep:r="|",headers:n}){let i=!!n;if(!t[0])return"";let o=n?n.length:t[0].length,s=n?n.map(l=>[l]):t[0].map(()=>[]);for(let l of t){let f=0,h=l.map(d=>{let m=d.split(`
58
- `);return f=Math.max(f,m.length),m});for(let d in l)s[d]&&s[d].push(...h[d],...Array(f-h[d].length).fill(""))}let a=s.map((l,f)=>{if(f<o-1){let h=i3(l);return l.map((d,m)=>`${d}${h[m]}${r===""?"":`${r} `}`)}else return l}),u=0,c=a.reduce((l,f)=>l.map((h,d)=>{let m=l[d]+f[d];return u=Math.max(u,Ld(m)),m}));return i&&e!==""&&c.splice(1,0,e.repeat(u)),c.join(`
59
- `)}ze.columnar=JX});var VD=y((Zhe,s3)=>{function XX(t){r.debug=r,r.default=r,r.coerce=u,r.disable=o,r.enable=i,r.enabled=s,r.humanize=_D(),r.destroy=c,Object.keys(t).forEach(l=>{r[l]=t[l]}),r.names=[],r.skips=[],r.formatters={};function e(l){let f=0;for(let h=0;h<l.length;h++)f=(f<<5)-f+l.charCodeAt(h),f|=0;return r.colors[Math.abs(f)%r.colors.length]}r.selectColor=e;function r(l){let f,h=null,d,m;function b(...g){if(!b.enabled)return;let w=b,x=Number(new Date),D=x-(f||x);w.diff=D,w.prev=f,w.curr=x,f=x,g[0]=r.coerce(g[0]),typeof g[0]!="string"&&g.unshift("%O");let C=0;g[0]=g[0].replace(/%([a-zA-Z%])/g,($,F)=>{if($==="%%")return"%";C++;let L=r.formatters[F];if(typeof L=="function"){let S=g[C];$=L.call(w,S),g.splice(C,1),C--}return $}),r.formatArgs.call(w,g),(w.log||r.log).apply(w,g)}return b.namespace=l,b.useColors=r.useColors(),b.color=r.selectColor(l),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(l)),m),set:g=>{h=g}}),typeof r.init=="function"&&r.init(b),b}function n(l,f){let h=r(this.namespace+(typeof f>"u"?":":f)+l);return h.log=this.log,h}function i(l){r.save(l),r.namespaces=l,r.names=[],r.skips=[];let f,h=(typeof l=="string"?l:"").split(/[\s,]+/),d=h.length;for(f=0;f<d;f++)h[f]&&(l=h[f].replace(/\*/g,".*?"),l[0]==="-"?r.skips.push(new RegExp("^"+l.slice(1)+"$")):r.names.push(new RegExp("^"+l+"$")))}function o(){let l=[...r.names.map(a),...r.skips.map(a).map(f=>"-"+f)].join(",");return r.enable(""),l}function s(l){if(l[l.length-1]==="*")return!0;let f,h;for(f=0,h=r.skips.length;f<h;f++)if(r.skips[f].test(l))return!1;for(f=0,h=r.names.length;f<h;f++)if(r.names[f].test(l))return!0;return!1}function a(l){return l.toString().substring(2,l.toString().length-2).replace(/\.\*\?$/,"*")}function u(l){return l instanceof Error?l.stack||l.message:l}function c(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return r.enable(r.load()),r}s3.exports=XX});var a3=y((sr,Bd)=>{sr.formatArgs=QX;sr.save=eZ;sr.load=tZ;sr.useColors=ZX;sr.storage=rZ();sr.destroy=(()=>{let t=!1;return()=>{t||(t=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();sr.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function ZX(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function QX(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+Bd.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;t.splice(1,0,e,"color: inherit");let r=0,n=0;t[0].replace(/%[a-zA-Z%]/g,i=>{i!=="%%"&&(r++,i==="%c"&&(n=r))}),t.splice(n,0,e)}sr.log=console.debug||console.log||(()=>{});function eZ(t){try{t?sr.storage.setItem("debug",t):sr.storage.removeItem("debug")}catch{}}function tZ(){let t;try{t=sr.storage.getItem("debug")}catch{}return!t&&typeof process<"u"&&"env"in process&&(t=process.env.DEBUG),t}function rZ(){try{return localStorage}catch{}}Bd.exports=VD()(sr);var{formatters:nZ}=Bd.exports;nZ.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var c3=y((Dt,Md)=>{var iZ=require("tty"),qd=require("util");Dt.init=fZ;Dt.log=uZ;Dt.formatArgs=sZ;Dt.save=cZ;Dt.load=lZ;Dt.useColors=oZ;Dt.destroy=qd.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");Dt.colors=[6,2,3,4,5,1];try{let t=xD();t&&(t.stderr||t).level>=2&&(Dt.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{}Dt.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 oZ(){return"colors"in Dt.inspectOpts?!!Dt.inspectOpts.colors:iZ.isatty(process.stderr.fd)}function sZ(t){let{namespace:e,useColors:r}=this;if(r){let n=this.color,i="\x1B[3"+(n<8?n:"8;5;"+n),o=` ${i};1m${e} \x1B[0m`;t[0]=o+t[0].split(`
57
+ ${t3(r)}`)}ze.wordWrap=KX;function YX(t){t=r3(t);let e=process.cwd(),r=Fn.dirname(t),n=UX.homedir(),i=Math.abs(r.split(Fn.sep).length-e.split(Fn.sep).length);if(e===r)return"."+Fn.sep+Fn.basename(t);if(r.startsWith(e))return"."+Fn.sep+t.substring(e.length+1);if(i<=2){let o=Fn.relative(e,t);return o||"."}else{if(t===n)return"~";if(t.indexOf(n)===0)return"~"+Fn.sep+t.substring(n.length+1)}return t}ze.prettyPath=YX;function r3(t){return Fn.resolve(zX(t))}ze.expandPath=r3;function n3(t,e=1,r=" "){e<2&&(e=2);let n=Math.max(...t.map(s=>Ld(s))),i=n>e?n+1:e,o=r.repeat(i);return t.map(s=>e3(o,0,i-Ld(s)))}ze.generateFillSpaceStringList=n3;function JX(t,{hsep:e="-",vsep:r="|",headers:n}){let i=!!n;if(!t[0])return"";let o=n?n.length:t[0].length,s=n?n.map(l=>[l]):t[0].map(()=>[]);for(let l of t){let f=0,h=l.map(d=>{let m=d.split(`
58
+ `);return f=Math.max(f,m.length),m});for(let d in l)s[d]&&s[d].push(...h[d],...Array(f-h[d].length).fill(""))}let a=s.map((l,f)=>{if(f<o-1){let h=n3(l);return l.map((d,m)=>`${d}${h[m]}${r===""?"":`${r} `}`)}else return l}),u=0,c=a.reduce((l,f)=>l.map((h,d)=>{let m=l[d]+f[d];return u=Math.max(u,Ld(m)),m}));return i&&e!==""&&c.splice(1,0,e.repeat(u)),c.join(`
59
+ `)}ze.columnar=JX});var VD=y((Zhe,o3)=>{function XX(t){r.debug=r,r.default=r,r.coerce=u,r.disable=o,r.enable=i,r.enabled=s,r.humanize=_D(),r.destroy=c,Object.keys(t).forEach(l=>{r[l]=t[l]}),r.names=[],r.skips=[],r.formatters={};function e(l){let f=0;for(let h=0;h<l.length;h++)f=(f<<5)-f+l.charCodeAt(h),f|=0;return r.colors[Math.abs(f)%r.colors.length]}r.selectColor=e;function r(l){let f,h=null,d,m;function b(...g){if(!b.enabled)return;let w=b,x=Number(new Date),D=x-(f||x);w.diff=D,w.prev=f,w.curr=x,f=x,g[0]=r.coerce(g[0]),typeof g[0]!="string"&&g.unshift("%O");let C=0;g[0]=g[0].replace(/%([a-zA-Z%])/g,($,F)=>{if($==="%%")return"%";C++;let L=r.formatters[F];if(typeof L=="function"){let S=g[C];$=L.call(w,S),g.splice(C,1),C--}return $}),r.formatArgs.call(w,g),(w.log||r.log).apply(w,g)}return b.namespace=l,b.useColors=r.useColors(),b.color=r.selectColor(l),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(l)),m),set:g=>{h=g}}),typeof r.init=="function"&&r.init(b),b}function n(l,f){let h=r(this.namespace+(typeof f>"u"?":":f)+l);return h.log=this.log,h}function i(l){r.save(l),r.namespaces=l,r.names=[],r.skips=[];let f,h=(typeof l=="string"?l:"").split(/[\s,]+/),d=h.length;for(f=0;f<d;f++)h[f]&&(l=h[f].replace(/\*/g,".*?"),l[0]==="-"?r.skips.push(new RegExp("^"+l.slice(1)+"$")):r.names.push(new RegExp("^"+l+"$")))}function o(){let l=[...r.names.map(a),...r.skips.map(a).map(f=>"-"+f)].join(",");return r.enable(""),l}function s(l){if(l[l.length-1]==="*")return!0;let f,h;for(f=0,h=r.skips.length;f<h;f++)if(r.skips[f].test(l))return!1;for(f=0,h=r.names.length;f<h;f++)if(r.names[f].test(l))return!0;return!1}function a(l){return l.toString().substring(2,l.toString().length-2).replace(/\.\*\?$/,"*")}function u(l){return l instanceof Error?l.stack||l.message:l}function c(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return r.enable(r.load()),r}o3.exports=XX});var s3=y((sr,Bd)=>{sr.formatArgs=QX;sr.save=eZ;sr.load=tZ;sr.useColors=ZX;sr.storage=rZ();sr.destroy=(()=>{let t=!1;return()=>{t||(t=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();sr.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function ZX(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function QX(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+Bd.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;t.splice(1,0,e,"color: inherit");let r=0,n=0;t[0].replace(/%[a-zA-Z%]/g,i=>{i!=="%%"&&(r++,i==="%c"&&(n=r))}),t.splice(n,0,e)}sr.log=console.debug||console.log||(()=>{});function eZ(t){try{t?sr.storage.setItem("debug",t):sr.storage.removeItem("debug")}catch{}}function tZ(){let t;try{t=sr.storage.getItem("debug")}catch{}return!t&&typeof process<"u"&&"env"in process&&(t=process.env.DEBUG),t}function rZ(){try{return localStorage}catch{}}Bd.exports=VD()(sr);var{formatters:nZ}=Bd.exports;nZ.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var u3=y((Dt,Md)=>{var iZ=require("tty"),qd=require("util");Dt.init=fZ;Dt.log=uZ;Dt.formatArgs=sZ;Dt.save=cZ;Dt.load=lZ;Dt.useColors=oZ;Dt.destroy=qd.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");Dt.colors=[6,2,3,4,5,1];try{let t=xD();t&&(t.stderr||t).level>=2&&(Dt.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{}Dt.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 oZ(){return"colors"in Dt.inspectOpts?!!Dt.inspectOpts.colors:iZ.isatty(process.stderr.fd)}function sZ(t){let{namespace:e,useColors:r}=this;if(r){let n=this.color,i="\x1B[3"+(n<8?n:"8;5;"+n),o=` ${i};1m${e} \x1B[0m`;t[0]=o+t[0].split(`
60
60
  `).join(`
61
61
  `+o),t.push(i+"m+"+Md.exports.humanize(this.diff)+"\x1B[0m")}else t[0]=aZ()+e+" "+t[0]}function aZ(){return Dt.inspectOpts.hideDate?"":new Date().toISOString()+" "}function uZ(...t){return process.stderr.write(qd.formatWithOptions(Dt.inspectOpts,...t)+`
62
- `)}function cZ(t){t?process.env.DEBUG=t:delete process.env.DEBUG}function lZ(){return process.env.DEBUG}function fZ(t){t.inspectOpts={};let e=Object.keys(Dt.inspectOpts);for(let r=0;r<e.length;r++)t.inspectOpts[e[r]]=Dt.inspectOpts[e[r]]}Md.exports=VD()(Dt);var{formatters:u3}=Md.exports;u3.o=function(t){return this.inspectOpts.colors=this.useColors,qd.inspect(t,this.inspectOpts).split(`
63
- `).map(e=>e.trim()).join(" ")};u3.O=function(t){return this.inspectOpts.colors=this.useColors,qd.inspect(t,this.inspectOpts)}});var l3=y((Qhe,HD)=>{typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?HD.exports=a3():HD.exports=c3()});var f3=y(wr=>{"use strict";Object.defineProperty(wr,"__esModule",{value:!0});wr.TERMINAL_INFO=wr.CI_ENVIRONMENT_VARIABLES_DETECTED=wr.CI_ENVIRONMENT_VARIABLES=void 0;var dZ=(ic(),Ae(nc)),hZ=l3(),pZ=dZ.__importStar(require("os")),mZ=(0,hZ.debug)("ionic:utils-terminal:info");wr.CI_ENVIRONMENT_VARIABLES=["CI","BUILD_ID","BUILD_NUMBER","BITBUCKET_COMMIT","CODEBUILD_BUILD_ARN","GITHUB_ACTIONS"];wr.CI_ENVIRONMENT_VARIABLES_DETECTED=wr.CI_ENVIRONMENT_VARIABLES.filter(t=>!!process.env[t]);function gZ(){let{shell:t}=pZ.userInfo();return t||(process.env.SHELL?process.env.SHELL:process.platform==="darwin"?"/bin/bash":process.platform==="win32"?process.env.COMSPEC?process.env.COMSPEC:"cmd.exe":"/bin/sh")}wr.CI_ENVIRONMENT_VARIABLES_DETECTED.length>0&&mZ(`Environment variables for CI detected: ${wr.CI_ENVIRONMENT_VARIABLES_DETECTED.join(", ")}`);wr.TERMINAL_INFO=Object.freeze({ci:wr.CI_ENVIRONMENT_VARIABLES_DETECTED.length>0,shell:gZ(),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 zD=y(Js=>{"use strict";Object.defineProperty(Js,"__esModule",{value:!0});var Ud=(ic(),Ae(nc));Ud.__exportStar(TD(),Js);Ud.__exportStar(gk(),Js);Ud.__exportStar(o3(),Js);Ud.__exportStar(f3(),Js)});var Hd=y(Jr=>{"use strict";Object.defineProperty(Jr,"__esModule",{value:!0});Jr.isFatal=Jr.fatal=Jr.FatalException=Jr.BaseException=void 0;var Vd=class extends Error{constructor(e,r){super(e),this.message=e,this.code=r}};Jr.BaseException=Vd;var ac=class extends Vd{constructor(e,r=1){super(e,"FATAL"),this.message=e,this.exitCode=r}};Jr.FatalException=ac;function yZ(t){throw new ac(t)}Jr.fatal=yZ;function DZ(t){return t&&t instanceof ac}Jr.isFatal=DZ});var KD={};mn(KD,{LOGGER_LEVELS:()=>xZ,Logger:()=>WD,NO_COLORS:()=>d3,StreamOutputStrategy:()=>zd,TTYOutputStrategy:()=>GD,TTY_WIDTH:()=>vZ,createDefaultLogger:()=>SZ,indent:()=>bZ,sliceAnsi:()=>wZ,stringWidth:()=>_Z,stripAnsi:()=>EZ,wordWrap:()=>CZ});var vZ,bZ,wZ,_Z,EZ,CZ,SZ,d3,zd,GD,WD,xZ,YD=ct(()=>{vZ=80,bZ=t=>t,wZ=t=>t,_Z=t=>t.length,EZ=t=>t,CZ=t=>t,SZ=()=>({info:console.log,warn:console.warn,error:console.error,debug:console.debug}),d3={},zd=class{constructor(){this.colors=d3,this.stream=process.stdout}},GD=class extends zd{constructor(e){super(),this.options=e}},WD=class{constructor(){}info(){}warn(){}error(){}debug(){}},xZ={DEBUG:"DEBUG",INFO:"INFO",WARN:"WARN",ERROR:"ERROR"}});var p3=y(lo=>{"use strict";Object.defineProperty(lo,"__esModule",{value:!0});lo.isInteractive=lo.checkInteractive=void 0;var FZ=(Cn(),Ae(En)),h3=zD(),OZ=FZ.__importDefault(Hs()),AZ=uc(),kZ=(...t)=>(0,lo.isInteractive)()?!0:t.length?t.filter(e=>!e).length?(AZ.logger.error(`Non-interactive shell detected.
64
- Run the command with ${OZ.default.input("--help")} to see a list of arguments that must be provided.`),!1):!0:!1;lo.checkInteractive=kZ;var TZ=()=>h3.TERMINAL_INFO.tty&&!h3.TERMINAL_INFO.ci;lo.isInteractive=TZ});var Ge=y((ipe,g3)=>{"use strict";var{FORCE_COLOR:PZ,NODE_DISABLE_COLORS:RZ,TERM:$Z}=process.env,_e={enabled:!RZ&&$Z!=="dumb"&&PZ!=="0",reset:Oe(0,0),bold:Oe(1,22),dim:Oe(2,22),italic:Oe(3,23),underline:Oe(4,24),inverse:Oe(7,27),hidden:Oe(8,28),strikethrough:Oe(9,29),black:Oe(30,39),red:Oe(31,39),green:Oe(32,39),yellow:Oe(33,39),blue:Oe(34,39),magenta:Oe(35,39),cyan:Oe(36,39),white:Oe(37,39),gray:Oe(90,39),grey:Oe(90,39),bgBlack:Oe(40,49),bgRed:Oe(41,49),bgGreen:Oe(42,49),bgYellow:Oe(43,49),bgBlue:Oe(44,49),bgMagenta:Oe(45,49),bgCyan:Oe(46,49),bgWhite:Oe(47,49)};function m3(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 IZ(t,e){let r={has:t,keys:e};return r.reset=_e.reset.bind(r),r.bold=_e.bold.bind(r),r.dim=_e.dim.bind(r),r.italic=_e.italic.bind(r),r.underline=_e.underline.bind(r),r.inverse=_e.inverse.bind(r),r.hidden=_e.hidden.bind(r),r.strikethrough=_e.strikethrough.bind(r),r.black=_e.black.bind(r),r.red=_e.red.bind(r),r.green=_e.green.bind(r),r.yellow=_e.yellow.bind(r),r.blue=_e.blue.bind(r),r.magenta=_e.magenta.bind(r),r.cyan=_e.cyan.bind(r),r.white=_e.white.bind(r),r.gray=_e.gray.bind(r),r.grey=_e.grey.bind(r),r.bgBlack=_e.bgBlack.bind(r),r.bgRed=_e.bgRed.bind(r),r.bgGreen=_e.bgGreen.bind(r),r.bgYellow=_e.bgYellow.bind(r),r.bgBlue=_e.bgBlue.bind(r),r.bgMagenta=_e.bgMagenta.bind(r),r.bgCyan=_e.bgCyan.bind(r),r.bgWhite=_e.bgWhite.bind(r),r}function Oe(t,e){let r={open:`\x1B[${t}m`,close:`\x1B[${e}m`,rgx:new RegExp(`\\x1b\\[${e}m`,"g")};return function(n){return this!==void 0&&this.has!==void 0?(this.has.includes(t)||(this.has.push(t),this.keys.push(r)),n===void 0?this:_e.enabled?m3(this.keys,n+""):n+""):n===void 0?IZ([t],[r]):_e.enabled?m3([r],n+""):n+""}}g3.exports=_e});var D3=y((ope,y3)=>{"use strict";y3.exports=(t,e)=>{if(!(t.meta&&t.name!=="escape")){if(t.ctrl){if(t.name==="a")return"first";if(t.name==="c"||t.name==="d")return"abort";if(t.name==="e")return"last";if(t.name==="g")return"reset"}if(e){if(t.name==="j")return"down";if(t.name==="k")return"up"}return t.name==="return"||t.name==="enter"?"submit":t.name==="backspace"?"delete":t.name==="delete"?"deleteForward":t.name==="abort"?"abort":t.name==="escape"?"exit":t.name==="tab"?"next":t.name==="pagedown"?"nextPage":t.name==="pageup"?"prevPage":t.name==="home"?"home":t.name==="end"?"end":t.name==="up"?"up":t.name==="down"?"down":t.name==="right"?"right":t.name==="left"?"left":!1}}});var Gd=y((spe,v3)=>{"use strict";v3.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 C3=y((ape,E3)=>{"use strict";function jZ(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=NZ(t))||e&&t&&typeof t.length=="number"){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(c){throw c},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
65
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,s=!1,a;return{s:function(){r=r.call(t)},n:function(){var c=r.next();return o=c.done,c},e:function(c){s=!0,a=c},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(s)throw a}}}}function NZ(t,e){if(t){if(typeof t=="string")return b3(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 b3(t,e)}}function b3(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 LZ=Gd(),_3=ke(),w3=_3.erase,BZ=_3.cursor,qZ=t=>[...LZ(t)].length;E3.exports=function(t,e){if(!e)return w3.line+BZ.to(0);let r=0,n=t.split(/\r?\n/);var i=jZ(n),o;try{for(i.s();!(o=i.n()).done;){let s=o.value;r+=1+Math.floor(Math.max(qZ(s)-1,0)/e)}}catch(s){i.e(s)}finally{i.f()}return w3.lines(r)}});var JD=y((upe,S3)=>{"use strict";var cc={arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",radioOn:"\u25C9",radioOff:"\u25EF",tick:"\u2714",cross:"\u2716",ellipsis:"\u2026",pointerSmall:"\u203A",line:"\u2500",pointer:"\u276F"},MZ={arrowUp:cc.arrowUp,arrowDown:cc.arrowDown,arrowLeft:cc.arrowLeft,arrowRight:cc.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"\u221A",cross:"\xD7",ellipsis:"...",pointerSmall:"\xBB",line:"\u2500",pointer:">"},UZ=process.platform==="win32"?MZ:cc;S3.exports=UZ});var F3=y((cpe,x3)=>{"use strict";var Xs=Ge(),fo=JD(),XD=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}`}}),VZ=t=>XD[t]||XD.default,lc=Object.freeze({aborted:Xs.red(fo.cross),done:Xs.green(fo.tick),exited:Xs.yellow(fo.cross),default:Xs.cyan("?")}),HZ=(t,e,r)=>e?lc.aborted:r?lc.exited:t?lc.done:lc.default,zZ=t=>Xs.gray(t?fo.ellipsis:fo.pointerSmall),GZ=(t,e)=>Xs.gray(t?e?fo.pointerSmall:"+":fo.line);x3.exports={styles:XD,render:VZ,symbols:lc,symbol:HZ,delimiter:zZ,item:GZ}});var A3=y((lpe,O3)=>{"use strict";var WZ=Gd();O3.exports=function(t,e){let r=String(WZ(t)||"").split(/\r?\n/);return e?r.map(n=>Math.ceil(n.length/e)).reduce((n,i)=>n+i):r.length}});var T3=y((fpe,k3)=>{"use strict";k3.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(`
62
+ `)}function cZ(t){t?process.env.DEBUG=t:delete process.env.DEBUG}function lZ(){return process.env.DEBUG}function fZ(t){t.inspectOpts={};let e=Object.keys(Dt.inspectOpts);for(let r=0;r<e.length;r++)t.inspectOpts[e[r]]=Dt.inspectOpts[e[r]]}Md.exports=VD()(Dt);var{formatters:a3}=Md.exports;a3.o=function(t){return this.inspectOpts.colors=this.useColors,qd.inspect(t,this.inspectOpts).split(`
63
+ `).map(e=>e.trim()).join(" ")};a3.O=function(t){return this.inspectOpts.colors=this.useColors,qd.inspect(t,this.inspectOpts)}});var c3=y((Qhe,HD)=>{typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?HD.exports=s3():HD.exports=u3()});var l3=y(wr=>{"use strict";Object.defineProperty(wr,"__esModule",{value:!0});wr.TERMINAL_INFO=wr.CI_ENVIRONMENT_VARIABLES_DETECTED=wr.CI_ENVIRONMENT_VARIABLES=void 0;var dZ=(ic(),Ae(nc)),hZ=c3(),pZ=dZ.__importStar(require("os")),mZ=(0,hZ.debug)("ionic:utils-terminal:info");wr.CI_ENVIRONMENT_VARIABLES=["CI","BUILD_ID","BUILD_NUMBER","BITBUCKET_COMMIT","CODEBUILD_BUILD_ARN","GITHUB_ACTIONS"];wr.CI_ENVIRONMENT_VARIABLES_DETECTED=wr.CI_ENVIRONMENT_VARIABLES.filter(t=>!!process.env[t]);function gZ(){let{shell:t}=pZ.userInfo();return t||(process.env.SHELL?process.env.SHELL:process.platform==="darwin"?"/bin/bash":process.platform==="win32"?process.env.COMSPEC?process.env.COMSPEC:"cmd.exe":"/bin/sh")}wr.CI_ENVIRONMENT_VARIABLES_DETECTED.length>0&&mZ(`Environment variables for CI detected: ${wr.CI_ENVIRONMENT_VARIABLES_DETECTED.join(", ")}`);wr.TERMINAL_INFO=Object.freeze({ci:wr.CI_ENVIRONMENT_VARIABLES_DETECTED.length>0,shell:gZ(),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 zD=y(Js=>{"use strict";Object.defineProperty(Js,"__esModule",{value:!0});var Ud=(ic(),Ae(nc));Ud.__exportStar(TD(),Js);Ud.__exportStar(mk(),Js);Ud.__exportStar(i3(),Js);Ud.__exportStar(l3(),Js)});var Hd=y(Jr=>{"use strict";Object.defineProperty(Jr,"__esModule",{value:!0});Jr.isFatal=Jr.fatal=Jr.FatalException=Jr.BaseException=void 0;var Vd=class extends Error{constructor(e,r){super(e),this.message=e,this.code=r}};Jr.BaseException=Vd;var ac=class extends Vd{constructor(e,r=1){super(e,"FATAL"),this.message=e,this.exitCode=r}};Jr.FatalException=ac;function yZ(t){throw new ac(t)}Jr.fatal=yZ;function DZ(t){return t&&t instanceof ac}Jr.isFatal=DZ});var KD={};mn(KD,{LOGGER_LEVELS:()=>xZ,Logger:()=>WD,NO_COLORS:()=>f3,StreamOutputStrategy:()=>zd,TTYOutputStrategy:()=>GD,TTY_WIDTH:()=>vZ,createDefaultLogger:()=>SZ,indent:()=>bZ,sliceAnsi:()=>wZ,stringWidth:()=>_Z,stripAnsi:()=>EZ,wordWrap:()=>CZ});var vZ,bZ,wZ,_Z,EZ,CZ,SZ,f3,zd,GD,WD,xZ,YD=ct(()=>{vZ=80,bZ=t=>t,wZ=t=>t,_Z=t=>t.length,EZ=t=>t,CZ=t=>t,SZ=()=>({info:console.log,warn:console.warn,error:console.error,debug:console.debug}),f3={},zd=class{constructor(){this.colors=f3,this.stream=process.stdout}},GD=class extends zd{constructor(e){super(),this.options=e}},WD=class{constructor(){}info(){}warn(){}error(){}debug(){}},xZ={DEBUG:"DEBUG",INFO:"INFO",WARN:"WARN",ERROR:"ERROR"}});var h3=y(lo=>{"use strict";Object.defineProperty(lo,"__esModule",{value:!0});lo.isInteractive=lo.checkInteractive=void 0;var FZ=(Cn(),Ae(En)),d3=zD(),OZ=FZ.__importDefault(Hs()),AZ=uc(),kZ=(...t)=>(0,lo.isInteractive)()?!0:t.length?t.filter(e=>!e).length?(AZ.logger.error(`Non-interactive shell detected.
64
+ Run the command with ${OZ.default.input("--help")} to see a list of arguments that must be provided.`),!1):!0:!1;lo.checkInteractive=kZ;var TZ=()=>d3.TERMINAL_INFO.tty&&!d3.TERMINAL_INFO.ci;lo.isInteractive=TZ});var Ge=y((ipe,m3)=>{"use strict";var{FORCE_COLOR:PZ,NODE_DISABLE_COLORS:RZ,TERM:$Z}=process.env,_e={enabled:!RZ&&$Z!=="dumb"&&PZ!=="0",reset:Oe(0,0),bold:Oe(1,22),dim:Oe(2,22),italic:Oe(3,23),underline:Oe(4,24),inverse:Oe(7,27),hidden:Oe(8,28),strikethrough:Oe(9,29),black:Oe(30,39),red:Oe(31,39),green:Oe(32,39),yellow:Oe(33,39),blue:Oe(34,39),magenta:Oe(35,39),cyan:Oe(36,39),white:Oe(37,39),gray:Oe(90,39),grey:Oe(90,39),bgBlack:Oe(40,49),bgRed:Oe(41,49),bgGreen:Oe(42,49),bgYellow:Oe(43,49),bgBlue:Oe(44,49),bgMagenta:Oe(45,49),bgCyan:Oe(46,49),bgWhite:Oe(47,49)};function p3(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 IZ(t,e){let r={has:t,keys:e};return r.reset=_e.reset.bind(r),r.bold=_e.bold.bind(r),r.dim=_e.dim.bind(r),r.italic=_e.italic.bind(r),r.underline=_e.underline.bind(r),r.inverse=_e.inverse.bind(r),r.hidden=_e.hidden.bind(r),r.strikethrough=_e.strikethrough.bind(r),r.black=_e.black.bind(r),r.red=_e.red.bind(r),r.green=_e.green.bind(r),r.yellow=_e.yellow.bind(r),r.blue=_e.blue.bind(r),r.magenta=_e.magenta.bind(r),r.cyan=_e.cyan.bind(r),r.white=_e.white.bind(r),r.gray=_e.gray.bind(r),r.grey=_e.grey.bind(r),r.bgBlack=_e.bgBlack.bind(r),r.bgRed=_e.bgRed.bind(r),r.bgGreen=_e.bgGreen.bind(r),r.bgYellow=_e.bgYellow.bind(r),r.bgBlue=_e.bgBlue.bind(r),r.bgMagenta=_e.bgMagenta.bind(r),r.bgCyan=_e.bgCyan.bind(r),r.bgWhite=_e.bgWhite.bind(r),r}function Oe(t,e){let r={open:`\x1B[${t}m`,close:`\x1B[${e}m`,rgx:new RegExp(`\\x1b\\[${e}m`,"g")};return function(n){return this!==void 0&&this.has!==void 0?(this.has.includes(t)||(this.has.push(t),this.keys.push(r)),n===void 0?this:_e.enabled?p3(this.keys,n+""):n+""):n===void 0?IZ([t],[r]):_e.enabled?p3([r],n+""):n+""}}m3.exports=_e});var y3=y((ope,g3)=>{"use strict";g3.exports=(t,e)=>{if(!(t.meta&&t.name!=="escape")){if(t.ctrl){if(t.name==="a")return"first";if(t.name==="c"||t.name==="d")return"abort";if(t.name==="e")return"last";if(t.name==="g")return"reset"}if(e){if(t.name==="j")return"down";if(t.name==="k")return"up"}return t.name==="return"||t.name==="enter"?"submit":t.name==="backspace"?"delete":t.name==="delete"?"deleteForward":t.name==="abort"?"abort":t.name==="escape"?"exit":t.name==="tab"?"next":t.name==="pagedown"?"nextPage":t.name==="pageup"?"prevPage":t.name==="home"?"home":t.name==="end"?"end":t.name==="up"?"up":t.name==="down"?"down":t.name==="right"?"right":t.name==="left"?"left":!1}}});var Gd=y((spe,D3)=>{"use strict";D3.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 E3=y((ape,_3)=>{"use strict";function jZ(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=NZ(t))||e&&t&&typeof t.length=="number"){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(c){throw c},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
65
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,s=!1,a;return{s:function(){r=r.call(t)},n:function(){var c=r.next();return o=c.done,c},e:function(c){s=!0,a=c},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(s)throw a}}}}function NZ(t,e){if(t){if(typeof t=="string")return v3(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 v3(t,e)}}function v3(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 LZ=Gd(),w3=ke(),b3=w3.erase,BZ=w3.cursor,qZ=t=>[...LZ(t)].length;_3.exports=function(t,e){if(!e)return b3.line+BZ.to(0);let r=0,n=t.split(/\r?\n/);var i=jZ(n),o;try{for(i.s();!(o=i.n()).done;){let s=o.value;r+=1+Math.floor(Math.max(qZ(s)-1,0)/e)}}catch(s){i.e(s)}finally{i.f()}return b3.lines(r)}});var JD=y((upe,C3)=>{"use strict";var cc={arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",radioOn:"\u25C9",radioOff:"\u25EF",tick:"\u2714",cross:"\u2716",ellipsis:"\u2026",pointerSmall:"\u203A",line:"\u2500",pointer:"\u276F"},MZ={arrowUp:cc.arrowUp,arrowDown:cc.arrowDown,arrowLeft:cc.arrowLeft,arrowRight:cc.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"\u221A",cross:"\xD7",ellipsis:"...",pointerSmall:"\xBB",line:"\u2500",pointer:">"},UZ=process.platform==="win32"?MZ:cc;C3.exports=UZ});var x3=y((cpe,S3)=>{"use strict";var Xs=Ge(),fo=JD(),XD=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}`}}),VZ=t=>XD[t]||XD.default,lc=Object.freeze({aborted:Xs.red(fo.cross),done:Xs.green(fo.tick),exited:Xs.yellow(fo.cross),default:Xs.cyan("?")}),HZ=(t,e,r)=>e?lc.aborted:r?lc.exited:t?lc.done:lc.default,zZ=t=>Xs.gray(t?fo.ellipsis:fo.pointerSmall),GZ=(t,e)=>Xs.gray(t?e?fo.pointerSmall:"+":fo.line);S3.exports={styles:XD,render:VZ,symbols:lc,symbol:HZ,delimiter:zZ,item:GZ}});var O3=y((lpe,F3)=>{"use strict";var WZ=Gd();F3.exports=function(t,e){let r=String(WZ(t)||"").split(/\r?\n/);return e?r.map(n=>Math.ceil(n.length/e)).reduce((n,i)=>n+i):r.length}});var k3=y((fpe,A3)=>{"use strict";A3.exports=(t,e={})=>{let r=Number.isSafeInteger(parseInt(e.margin))?new Array(parseInt(e.margin)).fill(" ").join(""):e.margin||"",n=e.width;return(t||"").split(/\r?\n/g).map(i=>i.split(/\s+/g).reduce((o,s)=>(s.length+r.length>=n||o[o.length-1].length+s.length+1<n?o[o.length-1]+=` ${s}`:o.push(`${r}${s}`),o),[r]).join(`
66
66
  `)).join(`
67
- `)}});var R3=y((dpe,P3)=>{"use strict";P3.exports=(t,e,r)=>{r=r||e;let n=Math.min(e-r,t-Math.floor(r/2));n<0&&(n=0);let i=Math.min(n+r,e);return{startIndex:n,endIndex:i}}});var Pr=y((hpe,$3)=>{"use strict";$3.exports={action:D3(),clear:C3(),style:F3(),strip:Gd(),figures:JD(),lines:A3(),wrap:T3(),entriesToDisplay:R3()}});var On=y((ppe,N3)=>{"use strict";var I3=require("readline"),KZ=Pr(),YZ=KZ.action,JZ=require("events"),j3=ke(),XZ=j3.beep,ZZ=j3.cursor,QZ=Ge(),ZD=class extends JZ{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=I3.createInterface({input:this.in,escapeCodeTimeout:50});I3.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=YZ(s,n);a===!1?this._&&this._(o,s):typeof this[a]=="function"?this[a](s):this.bell()};this.close=()=>{this.out.write(ZZ.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(XZ)}render(){this.onRender(QZ),this.firstRender&&(this.firstRender=!1)}};N3.exports=ZD});var U3=y((mpe,M3)=>{"use strict";function L3(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(c){r(c);return}a.done?e(u):Promise.resolve(u).then(n,i)}function B3(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function s(u){L3(o,n,i,s,a,"next",u)}function a(u){L3(o,n,i,s,a,"throw",u)}s(void 0)})}}var Wd=Ge(),eQ=On(),q3=ke(),tQ=q3.erase,fc=q3.cursor,Kd=Pr(),QD=Kd.style,e0=Kd.clear,rQ=Kd.lines,nQ=Kd.figures,t0=class extends eQ{constructor(e={}){super(e),this.transform=QD.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=e0("",this.out.columns),this.render()}set value(e){!e&&this.initial?(this.placeholder=!0,this.rendered=Wd.gray(this.transform.render(this.initial))):(this.placeholder=!1,this.rendered=this.transform.render(e)),this._value=e,this.fire()}get value(){return this._value}reset(){this.value="",this.cursor=+!!this.initial,this.cursorOffset=0,this.fire(),this.render()}exit(){this.abort()}abort(){this.value=this.value||this.initial,this.done=this.aborted=!0,this.error=!1,this.red=!1,this.fire(),this.render(),this.out.write(`
68
- `),this.close()}validate(){var e=this;return B3(function*(){let r=yield e.validator(e.value);typeof r=="string"&&(e.errorMsg=r,r=!1),e.error=!r})()}submit(){var e=this;return B3(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(`
67
+ `)}});var P3=y((dpe,T3)=>{"use strict";T3.exports=(t,e,r)=>{r=r||e;let n=Math.min(e-r,t-Math.floor(r/2));n<0&&(n=0);let i=Math.min(n+r,e);return{startIndex:n,endIndex:i}}});var Pr=y((hpe,R3)=>{"use strict";R3.exports={action:y3(),clear:E3(),style:x3(),strip:Gd(),figures:JD(),lines:O3(),wrap:k3(),entriesToDisplay:P3()}});var On=y((ppe,j3)=>{"use strict";var $3=require("readline"),KZ=Pr(),YZ=KZ.action,JZ=require("events"),I3=ke(),XZ=I3.beep,ZZ=I3.cursor,QZ=Ge(),ZD=class extends JZ{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=$3.createInterface({input:this.in,escapeCodeTimeout:50});$3.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=YZ(s,n);a===!1?this._&&this._(o,s):typeof this[a]=="function"?this[a](s):this.bell()};this.close=()=>{this.out.write(ZZ.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(XZ)}render(){this.onRender(QZ),this.firstRender&&(this.firstRender=!1)}};j3.exports=ZD});var M3=y((mpe,q3)=>{"use strict";function N3(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(c){r(c);return}a.done?e(u):Promise.resolve(u).then(n,i)}function L3(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function s(u){N3(o,n,i,s,a,"next",u)}function a(u){N3(o,n,i,s,a,"throw",u)}s(void 0)})}}var Wd=Ge(),eQ=On(),B3=ke(),tQ=B3.erase,fc=B3.cursor,Kd=Pr(),QD=Kd.style,e0=Kd.clear,rQ=Kd.lines,nQ=Kd.figures,t0=class extends eQ{constructor(e={}){super(e),this.transform=QD.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=e0("",this.out.columns),this.render()}set value(e){!e&&this.initial?(this.placeholder=!0,this.rendered=Wd.gray(this.transform.render(this.initial))):(this.placeholder=!1,this.rendered=this.transform.render(e)),this._value=e,this.fire()}get value(){return this._value}reset(){this.value="",this.cursor=+!!this.initial,this.cursorOffset=0,this.fire(),this.render()}exit(){this.abort()}abort(){this.value=this.value||this.initial,this.done=this.aborted=!0,this.error=!1,this.red=!1,this.fire(),this.render(),this.out.write(`
68
+ `),this.close()}validate(){var e=this;return L3(function*(){let r=yield e.validator(e.value);typeof r=="string"&&(e.errorMsg=r,r=!1),e.error=!r})()}submit(){var e=this;return L3(function*(){if(e.value=e.value||e.initial,e.cursorOffset=0,e.cursor=e.rendered.length,yield e.validate(),e.error){e.red=!0,e.fire(),e.render();return}e.done=!0,e.aborted=!1,e.fire(),e.render(),e.out.write(`
69
69
  `),e.close()})()}next(){if(!this.placeholder)return this.bell();this.value=this.initial,this.cursor=this.rendered.length,this.fire(),this.render()}moveCursor(e){this.placeholder||(this.cursor=this.cursor+e,this.cursorOffset+=e)}_(e,r){let n=this.value.slice(0,this.cursor),i=this.value.slice(this.cursor);this.value=`${n}${e}${i}`,this.red=!1,this.cursor=this.placeholder?0:n.length+1,this.render()}delete(){if(this.isCursorAtStart())return this.bell();let e=this.value.slice(0,this.cursor-1),r=this.value.slice(this.cursor);this.value=`${e}${r}`,this.red=!1,this.isCursorAtStart()?this.cursorOffset=0:(this.cursorOffset++,this.moveCursor(-1)),this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();let e=this.value.slice(0,this.cursor),r=this.value.slice(this.cursor+1);this.value=`${e}${r}`,this.red=!1,this.isCursorAtEnd()?this.cursorOffset=0:this.cursorOffset++,this.render()}first(){this.cursor=0,this.render()}last(){this.cursor=this.value.length,this.render()}left(){if(this.cursor<=0||this.placeholder)return this.bell();this.moveCursor(-1),this.render()}right(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();this.moveCursor(1),this.render()}isCursorAtStart(){return this.cursor===0||this.placeholder&&this.cursor===1}isCursorAtEnd(){return this.cursor===this.rendered.length||this.placeholder&&this.cursor===this.rendered.length+1}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(fc.down(rQ(this.outputError,this.out.columns)-1)+e0(this.outputError,this.out.columns)),this.out.write(e0(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[QD.symbol(this.done,this.aborted),Wd.bold(this.msg),QD.delimiter(this.done),this.red?Wd.red(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
70
70
  `).reduce((e,r,n)=>e+`
71
- ${n?" ":nQ.pointerSmall} ${Wd.red().italic(r)}`,"")),this.out.write(tQ.line+fc.to(0)+this.outputText+fc.save+this.outputError+fc.restore+fc.move(this.cursorOffset,0)))}};M3.exports=t0});var G3=y((gpe,z3)=>{"use strict";var An=Ge(),iQ=On(),dc=Pr(),V3=dc.style,H3=dc.clear,Yd=dc.figures,oQ=dc.wrap,sQ=dc.entriesToDisplay,aQ=ke(),uQ=aQ.cursor,r0=class extends iQ{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=H3("",this.out.columns),this.render()}moveCursor(e){this.cursor=e,this.value=this.choices[e].value,this.fire()}reset(){this.moveCursor(0),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
71
+ ${n?" ":nQ.pointerSmall} ${Wd.red().italic(r)}`,"")),this.out.write(tQ.line+fc.to(0)+this.outputText+fc.save+this.outputError+fc.restore+fc.move(this.cursorOffset,0)))}};q3.exports=t0});var z3=y((gpe,H3)=>{"use strict";var An=Ge(),iQ=On(),dc=Pr(),U3=dc.style,V3=dc.clear,Yd=dc.figures,oQ=dc.wrap,sQ=dc.entriesToDisplay,aQ=ke(),uQ=aQ.cursor,r0=class extends iQ{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=V3("",this.out.columns),this.render()}moveCursor(e){this.cursor=e,this.value=this.choices[e].value,this.fire()}reset(){this.moveCursor(0),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
72
72
  `),this.close()}submit(){this.selection.disabled?this.bell():(this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
73
- `),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(uQ.hide):this.out.write(H3(this.outputText,this.out.columns)),super.render();let e=sQ(this.cursor,this.choices.length,this.optionsPerPage),r=e.startIndex,n=e.endIndex;if(this.outputText=[V3.symbol(this.done,this.aborted),An.bold(this.msg),V3.delimiter(!1),this.done?this.selection.title:this.selection.disabled?An.yellow(this.warn):An.gray(this.hint)].join(" "),!this.done){this.outputText+=`
73
+ `),this.close())}first(){this.moveCursor(0),this.render()}last(){this.moveCursor(this.choices.length-1),this.render()}up(){this.cursor===0?this.moveCursor(this.choices.length-1):this.moveCursor(this.cursor-1),this.render()}down(){this.cursor===this.choices.length-1?this.moveCursor(0):this.moveCursor(this.cursor+1),this.render()}next(){this.moveCursor((this.cursor+1)%this.choices.length),this.render()}_(e,r){if(e===" ")return this.submit()}get selection(){return this.choices[this.cursor]}render(){if(this.closed)return;this.firstRender?this.out.write(uQ.hide):this.out.write(V3(this.outputText,this.out.columns)),super.render();let e=sQ(this.cursor,this.choices.length,this.optionsPerPage),r=e.startIndex,n=e.endIndex;if(this.outputText=[U3.symbol(this.done,this.aborted),An.bold(this.msg),U3.delimiter(!1),this.done?this.selection.title:this.selection.disabled?An.yellow(this.warn):An.gray(this.hint)].join(" "),!this.done){this.outputText+=`
74
74
  `;for(let i=r;i<n;i++){let o,s,a="",u=this.choices[i];i===r&&r>0?s=Yd.arrowUp:i===n-1&&n<this.choices.length?s=Yd.arrowDown:s=" ",u.disabled?(o=this.cursor===i?An.gray().underline(u.title):An.strikethrough().gray(u.title),s=(this.cursor===i?An.bold().gray(Yd.pointer)+" ":" ")+s):(o=this.cursor===i?An.cyan().underline(u.title):u.title,s=(this.cursor===i?An.cyan(Yd.pointer)+" ":" ")+s,u.description&&this.cursor===i&&(a=` - ${u.description}`,(s.length+o.length+a.length>=this.out.columns||u.description.split(/\r?\n/).length>1)&&(a=`
75
75
  `+oQ(u.description,{margin:3,width:this.out.columns})))),this.outputText+=`${s} ${o}${An.gray(a)}
76
- `}}this.out.write(this.outputText)}};z3.exports=r0});var Z3=y((ype,X3)=>{"use strict";var Jd=Ge(),cQ=On(),Y3=Pr(),W3=Y3.style,lQ=Y3.clear,J3=ke(),K3=J3.cursor,fQ=J3.erase,n0=class extends cQ{constructor(e={}){super(e),this.msg=e.message,this.value=!!e.initial,this.active=e.active||"on",this.inactive=e.inactive||"off",this.initialValue=this.value,this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
76
+ `}}this.out.write(this.outputText)}};H3.exports=r0});var X3=y((ype,J3)=>{"use strict";var Jd=Ge(),cQ=On(),K3=Pr(),G3=K3.style,lQ=K3.clear,Y3=ke(),W3=Y3.cursor,fQ=Y3.erase,n0=class extends cQ{constructor(e={}){super(e),this.msg=e.message,this.value=!!e.initial,this.active=e.active||"on",this.inactive=e.inactive||"off",this.initialValue=this.value,this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
77
77
  `),this.close()}submit(){this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
78
- `),this.close()}deactivate(){if(this.value===!1)return this.bell();this.value=!1,this.render()}activate(){if(this.value===!0)return this.bell();this.value=!0,this.render()}delete(){this.deactivate()}left(){this.deactivate()}right(){this.activate()}down(){this.deactivate()}up(){this.activate()}next(){this.value=!this.value,this.fire(),this.render()}_(e,r){if(e===" ")this.value=!this.value;else if(e==="1")this.value=!0;else if(e==="0")this.value=!1;else return this.bell();this.render()}render(){this.closed||(this.firstRender?this.out.write(K3.hide):this.out.write(lQ(this.outputText,this.out.columns)),super.render(),this.outputText=[W3.symbol(this.done,this.aborted),Jd.bold(this.msg),W3.delimiter(this.done),this.value?this.inactive:Jd.cyan().underline(this.inactive),Jd.gray("/"),this.value?Jd.cyan().underline(this.active):this.active].join(" "),this.out.write(fQ.line+K3.to(0)+this.outputText))}};X3.exports=n0});var Xr=y((Dpe,Q3)=>{"use strict";var i0=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)}};Q3.exports=i0});var tT=y((vpe,eT)=>{"use strict";var dQ=Xr(),o0=class extends dQ{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}};eT.exports=o0});var nT=y((bpe,rT)=>{"use strict";var hQ=Xr(),pQ=t=>(t=t%10,t===1?"st":t===2?"nd":t===3?"rd":"th"),s0=class extends hQ{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+pQ(e):this.token==="d"?r+1:this.token==="ddd"?this.locales.weekdaysShort[r]:this.token==="dddd"?this.locales.weekdays[r]:e}};rT.exports=s0});var oT=y((wpe,iT)=>{"use strict";var mQ=Xr(),a0=class extends mQ{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}};iT.exports=a0});var aT=y((_pe,sT)=>{"use strict";var gQ=Xr(),u0=class extends gQ{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)}};sT.exports=u0});var cT=y((Epe,uT)=>{"use strict";var yQ=Xr(),c0=class extends yQ{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}};uT.exports=c0});var fT=y((Cpe,lT)=>{"use strict";var DQ=Xr(),l0=class extends DQ{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)}};lT.exports=l0});var hT=y((Spe,dT)=>{"use strict";var vQ=Xr(),f0=class extends vQ{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}};dT.exports=f0});var mT=y((xpe,pT)=>{"use strict";var bQ=Xr(),d0=class extends bQ{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}};pT.exports=d0});var yT=y((Fpe,gT)=>{"use strict";gT.exports={DatePart:Xr(),Meridiem:tT(),Day:nT(),Hours:oT(),Milliseconds:aT(),Minutes:cT(),Month:fT(),Seconds:hT(),Year:mT()}});var FT=y((Ope,xT)=>{"use strict";function DT(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(c){r(c);return}a.done?e(u):Promise.resolve(u).then(n,i)}function 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 h0=Ge(),wQ=On(),m0=Pr(),bT=m0.style,wT=m0.clear,_Q=m0.figures,ST=ke(),EQ=ST.erase,_T=ST.cursor,kn=yT(),ET=kn.DatePart,CQ=kn.Meridiem,SQ=kn.Day,xQ=kn.Hours,FQ=kn.Milliseconds,OQ=kn.Minutes,AQ=kn.Month,kQ=kn.Seconds,TQ=kn.Year,PQ=/\\(.)|"((?:\\["\\]|[^"])+)"|(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,CT={1:({token:t})=>t.replace(/\\(.)/g,"$1"),2:t=>new SQ(t),3:t=>new AQ(t),4:t=>new TQ(t),5:t=>new CQ(t),6:t=>new xQ(t),7:t=>new OQ(t),8:t=>new kQ(t),9:t=>new FQ(t)},RQ={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(",")},p0=class extends wQ{constructor(e={}){super(e),this.msg=e.message,this.cursor=0,this.typed="",this.locales=Object.assign(RQ,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=wT("",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=PQ.exec(e);){let i=r.shift(),o=r.findIndex(s=>s!=null);this.parts.push(o in CT?CT[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 ET)),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
79
- `),this.close()}validate(){var e=this;return vT(function*(){let r=yield e.validator(e.value);typeof r=="string"&&(e.errorMsg=r,r=!1),e.error=!r})()}submit(){var e=this;return vT(function*(){if(yield e.validate(),e.error){e.color="red",e.fire(),e.render();return}e.done=!0,e.aborted=!1,e.fire(),e.render(),e.out.write(`
80
- `),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 ET)),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(_T.hide):this.out.write(wT(this.outputText,this.out.columns)),super.render(),this.outputText=[bT.symbol(this.done,this.aborted),h0.bold(this.msg),bT.delimiter(!1),this.parts.reduce((e,r,n)=>e.concat(n===this.cursor&&!this.done?h0.cyan().underline(r.toString()):r),[]).join("")].join(" "),this.error&&(this.outputText+=this.errorMsg.split(`
78
+ `),this.close()}deactivate(){if(this.value===!1)return this.bell();this.value=!1,this.render()}activate(){if(this.value===!0)return this.bell();this.value=!0,this.render()}delete(){this.deactivate()}left(){this.deactivate()}right(){this.activate()}down(){this.deactivate()}up(){this.activate()}next(){this.value=!this.value,this.fire(),this.render()}_(e,r){if(e===" ")this.value=!this.value;else if(e==="1")this.value=!0;else if(e==="0")this.value=!1;else return this.bell();this.render()}render(){this.closed||(this.firstRender?this.out.write(W3.hide):this.out.write(lQ(this.outputText,this.out.columns)),super.render(),this.outputText=[G3.symbol(this.done,this.aborted),Jd.bold(this.msg),G3.delimiter(this.done),this.value?this.inactive:Jd.cyan().underline(this.inactive),Jd.gray("/"),this.value?Jd.cyan().underline(this.active):this.active].join(" "),this.out.write(fQ.line+W3.to(0)+this.outputText))}};J3.exports=n0});var Xr=y((Dpe,Z3)=>{"use strict";var i0=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)}};Z3.exports=i0});var eT=y((vpe,Q3)=>{"use strict";var dQ=Xr(),o0=class extends dQ{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}};Q3.exports=o0});var rT=y((bpe,tT)=>{"use strict";var hQ=Xr(),pQ=t=>(t=t%10,t===1?"st":t===2?"nd":t===3?"rd":"th"),s0=class extends hQ{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+pQ(e):this.token==="d"?r+1:this.token==="ddd"?this.locales.weekdaysShort[r]:this.token==="dddd"?this.locales.weekdays[r]:e}};tT.exports=s0});var iT=y((wpe,nT)=>{"use strict";var mQ=Xr(),a0=class extends mQ{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}};nT.exports=a0});var sT=y((_pe,oT)=>{"use strict";var gQ=Xr(),u0=class extends gQ{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)}};oT.exports=u0});var uT=y((Epe,aT)=>{"use strict";var yQ=Xr(),c0=class extends yQ{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}};aT.exports=c0});var lT=y((Cpe,cT)=>{"use strict";var DQ=Xr(),l0=class extends DQ{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)}};cT.exports=l0});var dT=y((Spe,fT)=>{"use strict";var vQ=Xr(),f0=class extends vQ{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}};fT.exports=f0});var pT=y((xpe,hT)=>{"use strict";var bQ=Xr(),d0=class extends bQ{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}};hT.exports=d0});var gT=y((Fpe,mT)=>{"use strict";mT.exports={DatePart:Xr(),Meridiem:eT(),Day:rT(),Hours:iT(),Milliseconds:sT(),Minutes:uT(),Month:lT(),Seconds:dT(),Year:pT()}});var xT=y((Ope,ST)=>{"use strict";function yT(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(c){r(c);return}a.done?e(u):Promise.resolve(u).then(n,i)}function DT(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function s(u){yT(o,n,i,s,a,"next",u)}function a(u){yT(o,n,i,s,a,"throw",u)}s(void 0)})}}var h0=Ge(),wQ=On(),m0=Pr(),vT=m0.style,bT=m0.clear,_Q=m0.figures,CT=ke(),EQ=CT.erase,wT=CT.cursor,kn=gT(),_T=kn.DatePart,CQ=kn.Meridiem,SQ=kn.Day,xQ=kn.Hours,FQ=kn.Milliseconds,OQ=kn.Minutes,AQ=kn.Month,kQ=kn.Seconds,TQ=kn.Year,PQ=/\\(.)|"((?:\\["\\]|[^"])+)"|(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,ET={1:({token:t})=>t.replace(/\\(.)/g,"$1"),2:t=>new SQ(t),3:t=>new AQ(t),4:t=>new TQ(t),5:t=>new CQ(t),6:t=>new xQ(t),7:t=>new OQ(t),8:t=>new kQ(t),9:t=>new FQ(t)},RQ={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(",")},p0=class extends wQ{constructor(e={}){super(e),this.msg=e.message,this.cursor=0,this.typed="",this.locales=Object.assign(RQ,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=bT("",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=PQ.exec(e);){let i=r.shift(),o=r.findIndex(s=>s!=null);this.parts.push(o in ET?ET[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 _T)),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
79
+ `),this.close()}validate(){var e=this;return DT(function*(){let r=yield e.validator(e.value);typeof r=="string"&&(e.errorMsg=r,r=!1),e.error=!r})()}submit(){var e=this;return DT(function*(){if(yield e.validate(),e.error){e.color="red",e.fire(),e.render();return}e.done=!0,e.aborted=!1,e.fire(),e.render(),e.out.write(`
80
+ `),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 _T)),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(wT.hide):this.out.write(bT(this.outputText,this.out.columns)),super.render(),this.outputText=[vT.symbol(this.done,this.aborted),h0.bold(this.msg),vT.delimiter(!1),this.parts.reduce((e,r,n)=>e.concat(n===this.cursor&&!this.done?h0.cyan().underline(r.toString()):r),[]).join("")].join(" "),this.error&&(this.outputText+=this.errorMsg.split(`
81
81
  `).reduce((e,r,n)=>e+`
82
- ${n?" ":_Q.pointerSmall} ${h0.red().italic(r)}`,"")),this.out.write(EQ.line+_T.to(0)+this.outputText))}};xT.exports=p0});var $T=y((Ape,RT)=>{"use strict";function OT(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(c){r(c);return}a.done?e(u):Promise.resolve(u).then(n,i)}function AT(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function s(u){OT(o,n,i,s,a,"next",u)}function a(u){OT(o,n,i,s,a,"throw",u)}s(void 0)})}}var Xd=Ge(),$Q=On(),PT=ke(),Zd=PT.cursor,IQ=PT.erase,Qd=Pr(),g0=Qd.style,jQ=Qd.figures,kT=Qd.clear,NQ=Qd.lines,LQ=/[0-9]/,y0=t=>t!==void 0,TT=(t,e)=>{let r=Math.pow(10,e);return Math.round(t*r)/r},D0=class extends $Q{constructor(e={}){super(e),this.transform=g0.render(e.style),this.msg=e.message,this.initial=y0(e.initial)?e.initial:"",this.float=!!e.float,this.round=e.round||2,this.inc=e.increment||1,this.min=y0(e.min)?e.min:-1/0,this.max=y0(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(`${TT(e,this.round)}`),this._value=TT(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||LQ.test(e)}reset(){this.typed="",this.value="",this.fire(),this.render()}exit(){this.abort()}abort(){let e=this.value;this.value=e!==""?e:this.initial,this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
83
- `),this.close()}validate(){var e=this;return AT(function*(){let r=yield e.validator(e.value);typeof r=="string"&&(e.errorMsg=r,r=!1),e.error=!r})()}submit(){var e=this;return AT(function*(){if(yield e.validate(),e.error){e.color="red",e.fire(),e.render();return}let r=e.value;e.value=r!==""?r:e.initial,e.done=!0,e.aborted=!1,e.error=!1,e.fire(),e.render(),e.out.write(`
84
- `),e.close()})()}up(){if(this.typed="",this.value===""&&(this.value=this.min-this.inc),this.value>=this.max)return this.bell();this.value+=this.inc,this.color="cyan",this.fire(),this.render()}down(){if(this.typed="",this.value===""&&(this.value=this.min+this.inc),this.value<=this.min)return this.bell();this.value-=this.inc,this.color="cyan",this.fire(),this.render()}delete(){let e=this.value.toString();if(e.length===0)return this.bell();this.value=this.parse(e=e.slice(0,-1))||"",this.value!==""&&this.value<this.min&&(this.value=this.min),this.color="cyan",this.fire(),this.render()}next(){this.value=this.initial,this.fire(),this.render()}_(e,r){if(!this.valid(e))return this.bell();let n=Date.now();if(n-this.lastHit>1e3&&(this.typed=""),this.typed+=e,this.lastHit=n,this.color="cyan",e===".")return this.fire();this.value=Math.min(this.parse(this.typed),this.max),this.value>this.max&&(this.value=this.max),this.value<this.min&&(this.value=this.min),this.fire(),this.render()}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(Zd.down(NQ(this.outputError,this.out.columns)-1)+kT(this.outputError,this.out.columns)),this.out.write(kT(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[g0.symbol(this.done,this.aborted),Xd.bold(this.msg),g0.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(`
82
+ ${n?" ":_Q.pointerSmall} ${h0.red().italic(r)}`,"")),this.out.write(EQ.line+wT.to(0)+this.outputText))}};ST.exports=p0});var RT=y((Ape,PT)=>{"use strict";function FT(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(c){r(c);return}a.done?e(u):Promise.resolve(u).then(n,i)}function OT(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function s(u){FT(o,n,i,s,a,"next",u)}function a(u){FT(o,n,i,s,a,"throw",u)}s(void 0)})}}var Xd=Ge(),$Q=On(),TT=ke(),Zd=TT.cursor,IQ=TT.erase,Qd=Pr(),g0=Qd.style,jQ=Qd.figures,AT=Qd.clear,NQ=Qd.lines,LQ=/[0-9]/,y0=t=>t!==void 0,kT=(t,e)=>{let r=Math.pow(10,e);return Math.round(t*r)/r},D0=class extends $Q{constructor(e={}){super(e),this.transform=g0.render(e.style),this.msg=e.message,this.initial=y0(e.initial)?e.initial:"",this.float=!!e.float,this.round=e.round||2,this.inc=e.increment||1,this.min=y0(e.min)?e.min:-1/0,this.max=y0(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(`${kT(e,this.round)}`),this._value=kT(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||LQ.test(e)}reset(){this.typed="",this.value="",this.fire(),this.render()}exit(){this.abort()}abort(){let e=this.value;this.value=e!==""?e:this.initial,this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
83
+ `),this.close()}validate(){var e=this;return OT(function*(){let r=yield e.validator(e.value);typeof r=="string"&&(e.errorMsg=r,r=!1),e.error=!r})()}submit(){var e=this;return OT(function*(){if(yield e.validate(),e.error){e.color="red",e.fire(),e.render();return}let r=e.value;e.value=r!==""?r:e.initial,e.done=!0,e.aborted=!1,e.error=!1,e.fire(),e.render(),e.out.write(`
84
+ `),e.close()})()}up(){if(this.typed="",this.value===""&&(this.value=this.min-this.inc),this.value>=this.max)return this.bell();this.value+=this.inc,this.color="cyan",this.fire(),this.render()}down(){if(this.typed="",this.value===""&&(this.value=this.min+this.inc),this.value<=this.min)return this.bell();this.value-=this.inc,this.color="cyan",this.fire(),this.render()}delete(){let e=this.value.toString();if(e.length===0)return this.bell();this.value=this.parse(e=e.slice(0,-1))||"",this.value!==""&&this.value<this.min&&(this.value=this.min),this.color="cyan",this.fire(),this.render()}next(){this.value=this.initial,this.fire(),this.render()}_(e,r){if(!this.valid(e))return this.bell();let n=Date.now();if(n-this.lastHit>1e3&&(this.typed=""),this.typed+=e,this.lastHit=n,this.color="cyan",e===".")return this.fire();this.value=Math.min(this.parse(this.typed),this.max),this.value>this.max&&(this.value=this.max),this.value<this.min&&(this.value=this.min),this.fire(),this.render()}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(Zd.down(NQ(this.outputError,this.out.columns)-1)+AT(this.outputError,this.out.columns)),this.out.write(AT(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[g0.symbol(this.done,this.aborted),Xd.bold(this.msg),g0.delimiter(this.done),!this.done||!this.done&&!this.placeholder?Xd[this.color]().underline(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
85
85
  `).reduce((e,r,n)=>e+`
86
- ${n?" ":jQ.pointerSmall} ${Xd.red().italic(r)}`,"")),this.out.write(IQ.line+Zd.to(0)+this.outputText+Zd.save+this.outputError+Zd.restore))}};RT.exports=D0});var b0=y((kpe,NT)=>{"use strict";var Zr=Ge(),BQ=ke(),qQ=BQ.cursor,MQ=On(),hc=Pr(),IT=hc.clear,fi=hc.figures,jT=hc.style,UQ=hc.wrap,VQ=hc.entriesToDisplay,v0=class extends MQ{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=IT("",this.out.columns),e.overrideRender||this.render()}reset(){this.value.map(e=>!e.selected),this.cursor=0,this.fire(),this.render()}selected(){return this.value.filter(e=>e.selected)}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
86
+ ${n?" ":jQ.pointerSmall} ${Xd.red().italic(r)}`,"")),this.out.write(IQ.line+Zd.to(0)+this.outputText+Zd.save+this.outputError+Zd.restore))}};PT.exports=D0});var b0=y((kpe,jT)=>{"use strict";var Zr=Ge(),BQ=ke(),qQ=BQ.cursor,MQ=On(),hc=Pr(),$T=hc.clear,fi=hc.figures,IT=hc.style,UQ=hc.wrap,VQ=hc.entriesToDisplay,v0=class extends MQ{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=$T("",this.out.columns),e.overrideRender||this.render()}reset(){this.value.map(e=>!e.selected),this.cursor=0,this.fire(),this.render()}selected(){return this.value.filter(e=>e.selected)}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
87
87
  `),this.close()}submit(){let e=this.value.filter(r=>r.selected);this.minSelected&&e.length<this.minSelected?(this.showMinError=!0,this.render()):(this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
88
88
  `),this.close())}first(){this.cursor=0,this.render()}last(){this.cursor=this.value.length-1,this.render()}next(){this.cursor=(this.cursor+1)%this.value.length,this.render()}up(){this.cursor===0?this.cursor=this.value.length-1:this.cursor--,this.render()}down(){this.cursor===this.value.length-1?this.cursor=0:this.cursor++,this.render()}left(){this.value[this.cursor].selected=!1,this.render()}right(){if(this.value.filter(e=>e.selected).length>=this.maxChoices)return this.bell();this.value[this.cursor].selected=!0,this.render()}handleSpaceToggle(){let e=this.value[this.cursor];if(e.selected)e.selected=!1,this.render();else{if(e.disabled||this.value.filter(r=>r.selected).length>=this.maxChoices)return this.bell();e.selected=!0,this.render()}}toggleAll(){if(this.maxChoices!==void 0||this.value[this.cursor].disabled)return this.bell();let e=!this.value[this.cursor].selected;this.value.filter(r=>!r.disabled).forEach(r=>r.selected=e),this.render()}_(e,r){if(e===" ")this.handleSpaceToggle();else if(e==="a")this.toggleAll();else return this.bell()}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
89
89
  Instructions:
@@ -93,13 +93,13 @@ Instructions:
93
93
  `:"")+" enter/return: Complete answer":""}renderOption(e,r,n,i){let o=(r.selected?Zr.green(fi.radioOn):fi.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=`
94
94
  `+UQ(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 r=VQ(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=fi.arrowUp:a===i-1&&i<e.length?o=fi.arrowDown:o=" ",s.push(this.renderOption(this.cursor,e[a],a,o));return`
95
95
  `+s.join(`
96
- `)}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(qQ.hide),super.render();let e=[jT.symbol(this.done,this.aborted),Zr.bold(this.msg),jT.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=IT(e,this.out.columns)}};NT.exports=v0});var HT=y((Tpe,VT)=>{"use strict";function LT(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(c){r(c);return}a.done?e(u):Promise.resolve(u).then(n,i)}function HQ(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function s(u){LT(o,n,i,s,a,"next",u)}function a(u){LT(o,n,i,s,a,"throw",u)}s(void 0)})}}var pc=Ge(),zQ=On(),UT=ke(),GQ=UT.erase,BT=UT.cursor,mc=Pr(),w0=mc.style,qT=mc.clear,_0=mc.figures,WQ=mc.wrap,KQ=mc.entriesToDisplay,MT=(t,e)=>t[e]&&(t[e].value||t[e].title||t[e]),YQ=(t,e)=>t[e]&&(t[e].title||t[e].value||t[e]),JQ=(t,e)=>{let r=t.findIndex(n=>n.value===e||n.title===e);return r>-1?r:void 0},E0=class extends zQ{constructor(e={}){super(e),this.msg=e.message,this.suggest=e.suggest,this.choices=e.choices,this.initial=typeof e.initial=="number"?e.initial:JQ(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=w0.render(e.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=qT("",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=MT(this.suggestions,e):this.value=this.fallback.value,this.fire()}complete(e){var r=this;return HQ(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:YQ(u,a),value:MT(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(`
96
+ `)}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(qQ.hide),super.render();let e=[IT.symbol(this.done,this.aborted),Zr.bold(this.msg),IT.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=$T(e,this.out.columns)}};jT.exports=v0});var VT=y((Tpe,UT)=>{"use strict";function NT(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(c){r(c);return}a.done?e(u):Promise.resolve(u).then(n,i)}function HQ(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function s(u){NT(o,n,i,s,a,"next",u)}function a(u){NT(o,n,i,s,a,"throw",u)}s(void 0)})}}var pc=Ge(),zQ=On(),MT=ke(),GQ=MT.erase,LT=MT.cursor,mc=Pr(),w0=mc.style,BT=mc.clear,_0=mc.figures,WQ=mc.wrap,KQ=mc.entriesToDisplay,qT=(t,e)=>t[e]&&(t[e].value||t[e].title||t[e]),YQ=(t,e)=>t[e]&&(t[e].title||t[e].value||t[e]),JQ=(t,e)=>{let r=t.findIndex(n=>n.value===e||n.title===e);return r>-1?r:void 0},E0=class extends zQ{constructor(e={}){super(e),this.msg=e.message,this.suggest=e.suggest,this.choices=e.choices,this.initial=typeof e.initial=="number"?e.initial:JQ(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=w0.render(e.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=BT("",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=qT(this.suggestions,e):this.value=this.fallback.value,this.fire()}complete(e){var r=this;return HQ(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:YQ(u,a),value:qT(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(`
97
97
  `),this.close())}abort(){this.done=this.aborted=!0,this.exited=!1,this.fire(),this.render(),this.out.write(`
98
98
  `),this.close()}submit(){this.done=!0,this.aborted=this.exited=!1,this.fire(),this.render(),this.out.write(`
99
99
  `),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?_0.arrowUp:i?_0.arrowDown:" ",a=r?pc.cyan().underline(e.title):e.title;return s=(r?pc.cyan(_0.pointer)+" ":" ")+s,e.description&&(o=` - ${e.description}`,(s.length+a.length+o.length>=this.out.columns||e.description.split(/\r?\n/).length>1)&&(o=`
100
- `+WQ(e.description,{margin:3,width:this.out.columns}))),s+" "+a+pc.gray(o||"")}render(){if(this.closed)return;this.firstRender?this.out.write(BT.hide):this.out.write(qT(this.outputText,this.out.columns)),super.render();let e=KQ(this.select,this.choices.length,this.limit),r=e.startIndex,n=e.endIndex;if(this.outputText=[w0.symbol(this.done,this.aborted,this.exited),pc.bold(this.msg),w0.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(`
100
+ `+WQ(e.description,{margin:3,width:this.out.columns}))),s+" "+a+pc.gray(o||"")}render(){if(this.closed)return;this.firstRender?this.out.write(LT.hide):this.out.write(BT(this.outputText,this.out.columns)),super.render();let e=KQ(this.select,this.choices.length,this.limit),r=e.startIndex,n=e.endIndex;if(this.outputText=[w0.symbol(this.done,this.aborted,this.exited),pc.bold(this.msg),w0.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(`
101
101
  `);this.outputText+=`
102
- `+(i||pc.gray(this.fallback.title))}this.out.write(GQ.line+BT.to(0)+this.outputText)}};VT.exports=E0});var KT=y((Ppe,WT)=>{"use strict";var Tn=Ge(),XQ=ke(),ZQ=XQ.cursor,QQ=b0(),S0=Pr(),zT=S0.clear,GT=S0.style,Zs=S0.figures,C0=class extends QQ{constructor(e={}){e.overrideRender=!0,super(e),this.inputValue="",this.clear=zT("",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:`
102
+ `+(i||pc.gray(this.fallback.title))}this.out.write(GQ.line+LT.to(0)+this.outputText)}};UT.exports=E0});var WT=y((Ppe,GT)=>{"use strict";var Tn=Ge(),XQ=ke(),ZQ=XQ.cursor,QQ=b0(),S0=Pr(),HT=S0.clear,zT=S0.style,Zs=S0.figures,C0=class extends QQ{constructor(e={}){e.overrideRender=!0,super(e),this.inputValue="",this.clear=HT("",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:`
103
103
  Instructions:
104
104
  ${Zs.arrowUp}/${Zs.arrowDown}: Highlight option
105
105
  ${Zs.arrowLeft}/${Zs.arrowRight}/[space]: Toggle selection
@@ -107,31 +107,31 @@ Instructions:
107
107
  enter/return: Complete answer
108
108
  `:""}renderCurrentInput(){return`
109
109
  Filtered results for: ${this.inputValue?this.inputValue:Tn.gray("Enter something to filter")}
110
- `}renderOption(e,r,n){let i;return r.disabled?i=e===n?Tn.gray().underline(r.title):Tn.strikethrough().gray(r.title):i=e===n?Tn.cyan().underline(r.title):r.title,(r.selected?Tn.green(Zs.radioOn):Zs.radioOff)+" "+i}renderDoneOrInstructions(){if(this.done)return this.value.filter(r=>r.selected).map(r=>r.title).join(", ");let e=[Tn.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&e.push(Tn.yellow(this.warn)),e.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(ZQ.hide),super.render();let e=[GT.symbol(this.done,this.aborted),Tn.bold(this.msg),GT.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(e+=Tn.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),e+=this.renderOptions(this.filteredOptions),this.out.write(this.clear+e),this.clear=zT(e,this.out.columns)}};WT.exports=C0});var tP=y((Rpe,eP)=>{"use strict";var YT=Ge(),eee=On(),ZT=Pr(),JT=ZT.style,tee=ZT.clear,QT=ke(),ree=QT.erase,XT=QT.cursor,x0=class extends eee{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(`
110
+ `}renderOption(e,r,n){let i;return r.disabled?i=e===n?Tn.gray().underline(r.title):Tn.strikethrough().gray(r.title):i=e===n?Tn.cyan().underline(r.title):r.title,(r.selected?Tn.green(Zs.radioOn):Zs.radioOff)+" "+i}renderDoneOrInstructions(){if(this.done)return this.value.filter(r=>r.selected).map(r=>r.title).join(", ");let e=[Tn.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&e.push(Tn.yellow(this.warn)),e.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(ZQ.hide),super.render();let e=[zT.symbol(this.done,this.aborted),Tn.bold(this.msg),zT.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(e+=Tn.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),e+=this.renderOptions(this.filteredOptions),this.out.write(this.clear+e),this.clear=HT(e,this.out.columns)}};GT.exports=C0});var eP=y((Rpe,QT)=>{"use strict";var KT=Ge(),eee=On(),XT=Pr(),YT=XT.style,tee=XT.clear,ZT=ke(),ree=ZT.erase,JT=ZT.cursor,x0=class extends eee{constructor(e={}){super(e),this.msg=e.message,this.value=e.initial,this.initialValue=!!e.initial,this.yesMsg=e.yes||"yes",this.yesOption=e.yesOption||"(Y/n)",this.noMsg=e.no||"no",this.noOption=e.noOption||"(y/N)",this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
111
111
  `),this.close()}submit(){this.value=this.value||!1,this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
112
- `),this.close()}_(e,r){return e.toLowerCase()==="y"?(this.value=!0,this.submit()):e.toLowerCase()==="n"?(this.value=!1,this.submit()):this.bell()}render(){this.closed||(this.firstRender?this.out.write(XT.hide):this.out.write(tee(this.outputText,this.out.columns)),super.render(),this.outputText=[JT.symbol(this.done,this.aborted),YT.bold(this.msg),JT.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:YT.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(ree.line+XT.to(0)+this.outputText))}};eP.exports=x0});var nP=y(($pe,rP)=>{"use strict";rP.exports={TextPrompt:U3(),SelectPrompt:G3(),TogglePrompt:Z3(),DatePrompt:FT(),NumberPrompt:$T(),MultiselectPrompt:b0(),AutocompletePrompt:HT(),AutocompleteMultiselectPrompt:KT(),ConfirmPrompt:tP()}});var oP=y(iP=>{"use strict";var Jt=iP,nee=nP(),eh=t=>t;function Qr(t,e,r={}){return new Promise((n,i)=>{let o=new nee[t](e),s=r.onAbort||eh,a=r.onSubmit||eh,u=r.onExit||eh;o.on("state",e.onState||eh),o.on("submit",c=>n(a(c))),o.on("exit",c=>n(u(c))),o.on("abort",c=>i(s(c)))})}Jt.text=t=>Qr("TextPrompt",t);Jt.password=t=>(t.style="password",Jt.text(t));Jt.invisible=t=>(t.style="invisible",Jt.text(t));Jt.number=t=>Qr("NumberPrompt",t);Jt.date=t=>Qr("DatePrompt",t);Jt.confirm=t=>Qr("ConfirmPrompt",t);Jt.list=t=>{let e=t.separator||",";return Qr("TextPrompt",t,{onSubmit:r=>r.split(e).map(n=>n.trim())})};Jt.toggle=t=>Qr("TogglePrompt",t);Jt.select=t=>Qr("SelectPrompt",t);Jt.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})};Jt.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 iee=(t,e)=>Promise.resolve(e.filter(r=>r.title.slice(0,t.length).toLowerCase()===t.toLowerCase()));Jt.autocomplete=t=>(t.suggest=t.suggest||iee,t.choices=[].concat(t.choices||[]),Qr("AutocompletePrompt",t))});var hP=y((jpe,dP)=>{"use strict";function sP(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 aP(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?sP(Object(r),!0).forEach(function(n){oee(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):sP(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function oee(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function see(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=aee(t))||e&&t&&typeof t.length=="number"){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(c){throw c},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
113
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,s=!1,a;return{s:function(){r=r.call(t)},n:function(){var c=r.next();return o=c.done,c},e:function(c){s=!0,a=c},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(s)throw a}}}}function aee(t,e){if(t){if(typeof t=="string")return uP(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 uP(t,e)}}function uP(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 cP(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(c){r(c);return}a.done?e(u):Promise.resolve(u).then(n,i)}function lP(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function s(u){cP(o,n,i,s,a,"next",u)}function a(u){cP(o,n,i,s,a,"throw",u)}s(void 0)})}}var F0=oP(),uee=["suggest","format","onState","validate","onRender","type"],fP=()=>{};function di(){return O0.apply(this,arguments)}function O0(){return O0=lP(function*(t=[],{onSubmit:e=fP,onCancel:r=fP}={}){let n={},i=di._override||{};t=[].concat(t);let o,s,a,u,c,l,f=function(){var g=lP(function*(w,x,D=!1){if(!(!D&&w.validate&&w.validate(x)!==!0))return w.format?yield w.format(x,n):x});return function(x,D){return g.apply(this,arguments)}}();var h=see(t),d;try{for(h.s();!(d=h.n()).done;){s=d.value;var m=s;if(u=m.name,c=m.type,typeof c=="function"&&(c=yield c(o,aP({},n),s),s.type=c),!!c){for(let g in s){if(uee.includes(g))continue;let w=s[g];s[g]=typeof w=="function"?yield w(o,aP({},n),l):w}if(l=s,typeof s.message!="string")throw new Error("prompt message is required");var b=s;if(u=b.name,c=b.type,F0[c]===void 0)throw new Error(`prompt type (${c}) is not defined`);if(i[s.name]!==void 0&&(o=yield f(s,i[s.name]),o!==void 0)){n[u]=o;continue}try{o=di._injected?cee(di._injected,s.initial):yield F0[c](s),n[u]=o=yield f(s,o,!0),a=yield e(s,o,n)}catch{a=!(yield r(s,n))}if(a)return n}}}catch(g){h.e(g)}finally{h.f()}return n}),O0.apply(this,arguments)}function cee(t,e){let r=t.shift();if(r instanceof Error)throw r;return r===void 0?e:r}function lee(t){di._injected=(di._injected||[]).concat(t)}function fee(t){di._override=Object.assign({},t)}dP.exports=Object.assign(di,{prompt:di,prompts:F0,inject:lee,override:fee})});var mP=y((Npe,pP)=>{"use strict";pP.exports=(t,e)=>{if(!(t.meta&&t.name!=="escape")){if(t.ctrl){if(t.name==="a")return"first";if(t.name==="c"||t.name==="d")return"abort";if(t.name==="e")return"last";if(t.name==="g")return"reset"}if(e){if(t.name==="j")return"down";if(t.name==="k")return"up"}return t.name==="return"||t.name==="enter"?"submit":t.name==="backspace"?"delete":t.name==="delete"?"deleteForward":t.name==="abort"?"abort":t.name==="escape"?"exit":t.name==="tab"?"next":t.name==="pagedown"?"nextPage":t.name==="pageup"?"prevPage":t.name==="home"?"home":t.name==="end"?"end":t.name==="up"?"up":t.name==="down"?"down":t.name==="right"?"right":t.name==="left"?"left":!1}}});var th=y((Lpe,gP)=>{"use strict";gP.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 vP=y((Bpe,DP)=>{"use strict";var dee=th(),{erase:yP,cursor:hee}=ke(),pee=t=>[...dee(t)].length;DP.exports=function(t,e){if(!e)return yP.line+hee.to(0);let r=0,n=t.split(/\r?\n/);for(let i of n)r+=1+Math.floor(Math.max(pee(i)-1,0)/e);return yP.lines(r)}});var A0=y((qpe,bP)=>{"use strict";var gc={arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",radioOn:"\u25C9",radioOff:"\u25EF",tick:"\u2714",cross:"\u2716",ellipsis:"\u2026",pointerSmall:"\u203A",line:"\u2500",pointer:"\u276F"},mee={arrowUp:gc.arrowUp,arrowDown:gc.arrowDown,arrowLeft:gc.arrowLeft,arrowRight:gc.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"\u221A",cross:"\xD7",ellipsis:"...",pointerSmall:"\xBB",line:"\u2500",pointer:">"},gee=process.platform==="win32"?mee:gc;bP.exports=gee});var _P=y((Mpe,wP)=>{"use strict";var Qs=Ge(),ho=A0(),k0=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}`}}),yee=t=>k0[t]||k0.default,yc=Object.freeze({aborted:Qs.red(ho.cross),done:Qs.green(ho.tick),exited:Qs.yellow(ho.cross),default:Qs.cyan("?")}),Dee=(t,e,r)=>e?yc.aborted:r?yc.exited:t?yc.done:yc.default,vee=t=>Qs.gray(t?ho.ellipsis:ho.pointerSmall),bee=(t,e)=>Qs.gray(t?e?ho.pointerSmall:"+":ho.line);wP.exports={styles:k0,render:yee,symbols:yc,symbol:Dee,delimiter:vee,item:bee}});var CP=y((Upe,EP)=>{"use strict";var wee=th();EP.exports=function(t,e){let r=String(wee(t)||"").split(/\r?\n/);return e?r.map(n=>Math.ceil(n.length/e)).reduce((n,i)=>n+i):r.length}});var xP=y((Vpe,SP)=>{"use strict";SP.exports=(t,e={})=>{let r=Number.isSafeInteger(parseInt(e.margin))?new Array(parseInt(e.margin)).fill(" ").join(""):e.margin||"",n=e.width;return(t||"").split(/\r?\n/g).map(i=>i.split(/\s+/g).reduce((o,s)=>(s.length+r.length>=n||o[o.length-1].length+s.length+1<n?o[o.length-1]+=` ${s}`:o.push(`${r}${s}`),o),[r]).join(`
112
+ `),this.close()}_(e,r){return e.toLowerCase()==="y"?(this.value=!0,this.submit()):e.toLowerCase()==="n"?(this.value=!1,this.submit()):this.bell()}render(){this.closed||(this.firstRender?this.out.write(JT.hide):this.out.write(tee(this.outputText,this.out.columns)),super.render(),this.outputText=[YT.symbol(this.done,this.aborted),KT.bold(this.msg),YT.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:KT.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(ree.line+JT.to(0)+this.outputText))}};QT.exports=x0});var rP=y(($pe,tP)=>{"use strict";tP.exports={TextPrompt:M3(),SelectPrompt:z3(),TogglePrompt:X3(),DatePrompt:xT(),NumberPrompt:RT(),MultiselectPrompt:b0(),AutocompletePrompt:VT(),AutocompleteMultiselectPrompt:WT(),ConfirmPrompt:eP()}});var iP=y(nP=>{"use strict";var Jt=nP,nee=rP(),eh=t=>t;function Qr(t,e,r={}){return new Promise((n,i)=>{let o=new nee[t](e),s=r.onAbort||eh,a=r.onSubmit||eh,u=r.onExit||eh;o.on("state",e.onState||eh),o.on("submit",c=>n(a(c))),o.on("exit",c=>n(u(c))),o.on("abort",c=>i(s(c)))})}Jt.text=t=>Qr("TextPrompt",t);Jt.password=t=>(t.style="password",Jt.text(t));Jt.invisible=t=>(t.style="invisible",Jt.text(t));Jt.number=t=>Qr("NumberPrompt",t);Jt.date=t=>Qr("DatePrompt",t);Jt.confirm=t=>Qr("ConfirmPrompt",t);Jt.list=t=>{let e=t.separator||",";return Qr("TextPrompt",t,{onSubmit:r=>r.split(e).map(n=>n.trim())})};Jt.toggle=t=>Qr("TogglePrompt",t);Jt.select=t=>Qr("SelectPrompt",t);Jt.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})};Jt.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 iee=(t,e)=>Promise.resolve(e.filter(r=>r.title.slice(0,t.length).toLowerCase()===t.toLowerCase()));Jt.autocomplete=t=>(t.suggest=t.suggest||iee,t.choices=[].concat(t.choices||[]),Qr("AutocompletePrompt",t))});var dP=y((jpe,fP)=>{"use strict";function oP(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 sP(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?oP(Object(r),!0).forEach(function(n){oee(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):oP(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function oee(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function see(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=aee(t))||e&&t&&typeof t.length=="number"){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(c){throw c},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
113
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,s=!1,a;return{s:function(){r=r.call(t)},n:function(){var c=r.next();return o=c.done,c},e:function(c){s=!0,a=c},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(s)throw a}}}}function aee(t,e){if(t){if(typeof t=="string")return aP(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 aP(t,e)}}function aP(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 uP(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(c){r(c);return}a.done?e(u):Promise.resolve(u).then(n,i)}function cP(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function s(u){uP(o,n,i,s,a,"next",u)}function a(u){uP(o,n,i,s,a,"throw",u)}s(void 0)})}}var F0=iP(),uee=["suggest","format","onState","validate","onRender","type"],lP=()=>{};function di(){return O0.apply(this,arguments)}function O0(){return O0=cP(function*(t=[],{onSubmit:e=lP,onCancel:r=lP}={}){let n={},i=di._override||{};t=[].concat(t);let o,s,a,u,c,l,f=function(){var g=cP(function*(w,x,D=!1){if(!(!D&&w.validate&&w.validate(x)!==!0))return w.format?yield w.format(x,n):x});return function(x,D){return g.apply(this,arguments)}}();var h=see(t),d;try{for(h.s();!(d=h.n()).done;){s=d.value;var m=s;if(u=m.name,c=m.type,typeof c=="function"&&(c=yield c(o,sP({},n),s),s.type=c),!!c){for(let g in s){if(uee.includes(g))continue;let w=s[g];s[g]=typeof w=="function"?yield w(o,sP({},n),l):w}if(l=s,typeof s.message!="string")throw new Error("prompt message is required");var b=s;if(u=b.name,c=b.type,F0[c]===void 0)throw new Error(`prompt type (${c}) is not defined`);if(i[s.name]!==void 0&&(o=yield f(s,i[s.name]),o!==void 0)){n[u]=o;continue}try{o=di._injected?cee(di._injected,s.initial):yield F0[c](s),n[u]=o=yield f(s,o,!0),a=yield e(s,o,n)}catch{a=!(yield r(s,n))}if(a)return n}}}catch(g){h.e(g)}finally{h.f()}return n}),O0.apply(this,arguments)}function cee(t,e){let r=t.shift();if(r instanceof Error)throw r;return r===void 0?e:r}function lee(t){di._injected=(di._injected||[]).concat(t)}function fee(t){di._override=Object.assign({},t)}fP.exports=Object.assign(di,{prompt:di,prompts:F0,inject:lee,override:fee})});var pP=y((Npe,hP)=>{"use strict";hP.exports=(t,e)=>{if(!(t.meta&&t.name!=="escape")){if(t.ctrl){if(t.name==="a")return"first";if(t.name==="c"||t.name==="d")return"abort";if(t.name==="e")return"last";if(t.name==="g")return"reset"}if(e){if(t.name==="j")return"down";if(t.name==="k")return"up"}return t.name==="return"||t.name==="enter"?"submit":t.name==="backspace"?"delete":t.name==="delete"?"deleteForward":t.name==="abort"?"abort":t.name==="escape"?"exit":t.name==="tab"?"next":t.name==="pagedown"?"nextPage":t.name==="pageup"?"prevPage":t.name==="home"?"home":t.name==="end"?"end":t.name==="up"?"up":t.name==="down"?"down":t.name==="right"?"right":t.name==="left"?"left":!1}}});var th=y((Lpe,mP)=>{"use strict";mP.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 DP=y((Bpe,yP)=>{"use strict";var dee=th(),{erase:gP,cursor:hee}=ke(),pee=t=>[...dee(t)].length;yP.exports=function(t,e){if(!e)return gP.line+hee.to(0);let r=0,n=t.split(/\r?\n/);for(let i of n)r+=1+Math.floor(Math.max(pee(i)-1,0)/e);return gP.lines(r)}});var A0=y((qpe,vP)=>{"use strict";var gc={arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",radioOn:"\u25C9",radioOff:"\u25EF",tick:"\u2714",cross:"\u2716",ellipsis:"\u2026",pointerSmall:"\u203A",line:"\u2500",pointer:"\u276F"},mee={arrowUp:gc.arrowUp,arrowDown:gc.arrowDown,arrowLeft:gc.arrowLeft,arrowRight:gc.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"\u221A",cross:"\xD7",ellipsis:"...",pointerSmall:"\xBB",line:"\u2500",pointer:">"},gee=process.platform==="win32"?mee:gc;vP.exports=gee});var wP=y((Mpe,bP)=>{"use strict";var Qs=Ge(),ho=A0(),k0=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}`}}),yee=t=>k0[t]||k0.default,yc=Object.freeze({aborted:Qs.red(ho.cross),done:Qs.green(ho.tick),exited:Qs.yellow(ho.cross),default:Qs.cyan("?")}),Dee=(t,e,r)=>e?yc.aborted:r?yc.exited:t?yc.done:yc.default,vee=t=>Qs.gray(t?ho.ellipsis:ho.pointerSmall),bee=(t,e)=>Qs.gray(t?e?ho.pointerSmall:"+":ho.line);bP.exports={styles:k0,render:yee,symbols:yc,symbol:Dee,delimiter:vee,item:bee}});var EP=y((Upe,_P)=>{"use strict";var wee=th();_P.exports=function(t,e){let r=String(wee(t)||"").split(/\r?\n/);return e?r.map(n=>Math.ceil(n.length/e)).reduce((n,i)=>n+i):r.length}});var SP=y((Vpe,CP)=>{"use strict";CP.exports=(t,e={})=>{let r=Number.isSafeInteger(parseInt(e.margin))?new Array(parseInt(e.margin)).fill(" ").join(""):e.margin||"",n=e.width;return(t||"").split(/\r?\n/g).map(i=>i.split(/\s+/g).reduce((o,s)=>(s.length+r.length>=n||o[o.length-1].length+s.length+1<n?o[o.length-1]+=` ${s}`:o.push(`${r}${s}`),o),[r]).join(`
114
114
  `)).join(`
115
- `)}});var OP=y((Hpe,FP)=>{"use strict";FP.exports=(t,e,r)=>{r=r||e;let n=Math.min(e-r,t-Math.floor(r/2));n<0&&(n=0);let i=Math.min(n+r,e);return{startIndex:n,endIndex:i}}});var Rr=y((zpe,AP)=>{"use strict";AP.exports={action:mP(),clear:vP(),style:_P(),strip:th(),figures:A0(),lines:CP(),wrap:xP(),entriesToDisplay:OP()}});var Pn=y((Gpe,TP)=>{"use strict";var kP=require("readline"),{action:_ee}=Rr(),Eee=require("events"),{beep:Cee,cursor:See}=ke(),xee=Ge(),T0=class extends Eee{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=kP.createInterface({input:this.in,escapeCodeTimeout:50});kP.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=_ee(s,n);a===!1?this._&&this._(o,s):typeof this[a]=="function"?this[a](s):this.bell()};this.close=()=>{this.out.write(See.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(Cee)}render(){this.onRender(xee),this.firstRender&&(this.firstRender=!1)}};TP.exports=T0});var RP=y((Wpe,PP)=>{var rh=Ge(),Fee=Pn(),{erase:Oee,cursor:Dc}=ke(),{style:P0,clear:R0,lines:Aee,figures:kee}=Rr(),$0=class extends Fee{constructor(e={}){super(e),this.transform=P0.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=R0("",this.out.columns),this.render()}set value(e){!e&&this.initial?(this.placeholder=!0,this.rendered=rh.gray(this.transform.render(this.initial))):(this.placeholder=!1,this.rendered=this.transform.render(e)),this._value=e,this.fire()}get value(){return this._value}reset(){this.value="",this.cursor=+!!this.initial,this.cursorOffset=0,this.fire(),this.render()}exit(){this.abort()}abort(){this.value=this.value||this.initial,this.done=this.aborted=!0,this.error=!1,this.red=!1,this.fire(),this.render(),this.out.write(`
115
+ `)}});var FP=y((Hpe,xP)=>{"use strict";xP.exports=(t,e,r)=>{r=r||e;let n=Math.min(e-r,t-Math.floor(r/2));n<0&&(n=0);let i=Math.min(n+r,e);return{startIndex:n,endIndex:i}}});var Rr=y((zpe,OP)=>{"use strict";OP.exports={action:pP(),clear:DP(),style:wP(),strip:th(),figures:A0(),lines:EP(),wrap:SP(),entriesToDisplay:FP()}});var Pn=y((Gpe,kP)=>{"use strict";var AP=require("readline"),{action:_ee}=Rr(),Eee=require("events"),{beep:Cee,cursor:See}=ke(),xee=Ge(),T0=class extends Eee{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=AP.createInterface({input:this.in,escapeCodeTimeout:50});AP.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=_ee(s,n);a===!1?this._&&this._(o,s):typeof this[a]=="function"?this[a](s):this.bell()};this.close=()=>{this.out.write(See.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(Cee)}render(){this.onRender(xee),this.firstRender&&(this.firstRender=!1)}};kP.exports=T0});var PP=y((Wpe,TP)=>{var rh=Ge(),Fee=Pn(),{erase:Oee,cursor:Dc}=ke(),{style:P0,clear:R0,lines:Aee,figures:kee}=Rr(),$0=class extends Fee{constructor(e={}){super(e),this.transform=P0.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=R0("",this.out.columns),this.render()}set value(e){!e&&this.initial?(this.placeholder=!0,this.rendered=rh.gray(this.transform.render(this.initial))):(this.placeholder=!1,this.rendered=this.transform.render(e)),this._value=e,this.fire()}get value(){return this._value}reset(){this.value="",this.cursor=+!!this.initial,this.cursorOffset=0,this.fire(),this.render()}exit(){this.abort()}abort(){this.value=this.value||this.initial,this.done=this.aborted=!0,this.error=!1,this.red=!1,this.fire(),this.render(),this.out.write(`
116
116
  `),this.close()}async validate(){let e=await this.validator(this.value);typeof e=="string"&&(this.errorMsg=e,e=!1),this.error=!e}async submit(){if(this.value=this.value||this.initial,this.cursorOffset=0,this.cursor=this.rendered.length,await this.validate(),this.error){this.red=!0,this.fire(),this.render();return}this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
117
117
  `),this.close()}next(){if(!this.placeholder)return this.bell();this.value=this.initial,this.cursor=this.rendered.length,this.fire(),this.render()}moveCursor(e){this.placeholder||(this.cursor=this.cursor+e,this.cursorOffset+=e)}_(e,r){let n=this.value.slice(0,this.cursor),i=this.value.slice(this.cursor);this.value=`${n}${e}${i}`,this.red=!1,this.cursor=this.placeholder?0:n.length+1,this.render()}delete(){if(this.isCursorAtStart())return this.bell();let e=this.value.slice(0,this.cursor-1),r=this.value.slice(this.cursor);this.value=`${e}${r}`,this.red=!1,this.isCursorAtStart()?this.cursorOffset=0:(this.cursorOffset++,this.moveCursor(-1)),this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();let e=this.value.slice(0,this.cursor),r=this.value.slice(this.cursor+1);this.value=`${e}${r}`,this.red=!1,this.isCursorAtEnd()?this.cursorOffset=0:this.cursorOffset++,this.render()}first(){this.cursor=0,this.render()}last(){this.cursor=this.value.length,this.render()}left(){if(this.cursor<=0||this.placeholder)return this.bell();this.moveCursor(-1),this.render()}right(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();this.moveCursor(1),this.render()}isCursorAtStart(){return this.cursor===0||this.placeholder&&this.cursor===1}isCursorAtEnd(){return this.cursor===this.rendered.length||this.placeholder&&this.cursor===this.rendered.length+1}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(Dc.down(Aee(this.outputError,this.out.columns)-1)+R0(this.outputError,this.out.columns)),this.out.write(R0(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[P0.symbol(this.done,this.aborted),rh.bold(this.msg),P0.delimiter(this.done),this.red?rh.red(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
118
118
  `).reduce((e,r,n)=>e+`
119
- ${n?" ":kee.pointerSmall} ${rh.red().italic(r)}`,"")),this.out.write(Oee.line+Dc.to(0)+this.outputText+Dc.save+this.outputError+Dc.restore+Dc.move(this.cursorOffset,0)))}};PP.exports=$0});var NP=y((Kpe,jP)=>{"use strict";var Rn=Ge(),Tee=Pn(),{style:$P,clear:IP,figures:nh,wrap:Pee,entriesToDisplay:Ree}=Rr(),{cursor:$ee}=ke(),I0=class extends Tee{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=IP("",this.out.columns),this.render()}moveCursor(e){this.cursor=e,this.value=this.choices[e].value,this.fire()}reset(){this.moveCursor(0),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
119
+ ${n?" ":kee.pointerSmall} ${rh.red().italic(r)}`,"")),this.out.write(Oee.line+Dc.to(0)+this.outputText+Dc.save+this.outputError+Dc.restore+Dc.move(this.cursorOffset,0)))}};TP.exports=$0});var jP=y((Kpe,IP)=>{"use strict";var Rn=Ge(),Tee=Pn(),{style:RP,clear:$P,figures:nh,wrap:Pee,entriesToDisplay:Ree}=Rr(),{cursor:$ee}=ke(),I0=class extends Tee{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=$P("",this.out.columns),this.render()}moveCursor(e){this.cursor=e,this.value=this.choices[e].value,this.fire()}reset(){this.moveCursor(0),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
120
120
  `),this.close()}submit(){this.selection.disabled?this.bell():(this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
121
- `),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($ee.hide):this.out.write(IP(this.outputText,this.out.columns)),super.render();let{startIndex:e,endIndex:r}=Ree(this.cursor,this.choices.length,this.optionsPerPage);if(this.outputText=[$P.symbol(this.done,this.aborted),Rn.bold(this.msg),$P.delimiter(!1),this.done?this.selection.title:this.selection.disabled?Rn.yellow(this.warn):Rn.gray(this.hint)].join(" "),!this.done){this.outputText+=`
121
+ `),this.close())}first(){this.moveCursor(0),this.render()}last(){this.moveCursor(this.choices.length-1),this.render()}up(){this.cursor===0?this.moveCursor(this.choices.length-1):this.moveCursor(this.cursor-1),this.render()}down(){this.cursor===this.choices.length-1?this.moveCursor(0):this.moveCursor(this.cursor+1),this.render()}next(){this.moveCursor((this.cursor+1)%this.choices.length),this.render()}_(e,r){if(e===" ")return this.submit()}get selection(){return this.choices[this.cursor]}render(){if(this.closed)return;this.firstRender?this.out.write($ee.hide):this.out.write($P(this.outputText,this.out.columns)),super.render();let{startIndex:e,endIndex:r}=Ree(this.cursor,this.choices.length,this.optionsPerPage);if(this.outputText=[RP.symbol(this.done,this.aborted),Rn.bold(this.msg),RP.delimiter(!1),this.done?this.selection.title:this.selection.disabled?Rn.yellow(this.warn):Rn.gray(this.hint)].join(" "),!this.done){this.outputText+=`
122
122
  `;for(let n=e;n<r;n++){let i,o,s="",a=this.choices[n];n===e&&e>0?o=nh.arrowUp:n===r-1&&r<this.choices.length?o=nh.arrowDown:o=" ",a.disabled?(i=this.cursor===n?Rn.gray().underline(a.title):Rn.strikethrough().gray(a.title),o=(this.cursor===n?Rn.bold().gray(nh.pointer)+" ":" ")+o):(i=this.cursor===n?Rn.cyan().underline(a.title):a.title,o=(this.cursor===n?Rn.cyan(nh.pointer)+" ":" ")+o,a.description&&this.cursor===n&&(s=` - ${a.description}`,(o.length+i.length+s.length>=this.out.columns||a.description.split(/\r?\n/).length>1)&&(s=`
123
123
  `+Pee(a.description,{margin:3,width:this.out.columns})))),this.outputText+=`${o} ${i}${Rn.gray(s)}
124
- `}}this.out.write(this.outputText)}};jP.exports=I0});var MP=y((Ype,qP)=>{var ih=Ge(),Iee=Pn(),{style:LP,clear:jee}=Rr(),{cursor:BP,erase:Nee}=ke(),j0=class extends Iee{constructor(e={}){super(e),this.msg=e.message,this.value=!!e.initial,this.active=e.active||"on",this.inactive=e.inactive||"off",this.initialValue=this.value,this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
124
+ `}}this.out.write(this.outputText)}};IP.exports=I0});var qP=y((Ype,BP)=>{var ih=Ge(),Iee=Pn(),{style:NP,clear:jee}=Rr(),{cursor:LP,erase:Nee}=ke(),j0=class extends Iee{constructor(e={}){super(e),this.msg=e.message,this.value=!!e.initial,this.active=e.active||"on",this.inactive=e.inactive||"off",this.initialValue=this.value,this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
125
125
  `),this.close()}submit(){this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
126
- `),this.close()}deactivate(){if(this.value===!1)return this.bell();this.value=!1,this.render()}activate(){if(this.value===!0)return this.bell();this.value=!0,this.render()}delete(){this.deactivate()}left(){this.deactivate()}right(){this.activate()}down(){this.deactivate()}up(){this.activate()}next(){this.value=!this.value,this.fire(),this.render()}_(e,r){if(e===" ")this.value=!this.value;else if(e==="1")this.value=!0;else if(e==="0")this.value=!1;else return this.bell();this.render()}render(){this.closed||(this.firstRender?this.out.write(BP.hide):this.out.write(jee(this.outputText,this.out.columns)),super.render(),this.outputText=[LP.symbol(this.done,this.aborted),ih.bold(this.msg),LP.delimiter(this.done),this.value?this.inactive:ih.cyan().underline(this.inactive),ih.gray("/"),this.value?ih.cyan().underline(this.active):this.active].join(" "),this.out.write(Nee.line+BP.to(0)+this.outputText))}};qP.exports=j0});var en=y((Jpe,UP)=>{"use strict";var N0=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)}};UP.exports=N0});var HP=y((Xpe,VP)=>{"use strict";var Lee=en(),L0=class extends Lee{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}};VP.exports=L0});var GP=y((Zpe,zP)=>{"use strict";var Bee=en(),qee=t=>(t=t%10,t===1?"st":t===2?"nd":t===3?"rd":"th"),B0=class extends Bee{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+qee(e):this.token==="d"?r+1:this.token==="ddd"?this.locales.weekdaysShort[r]:this.token==="dddd"?this.locales.weekdays[r]:e}};zP.exports=B0});var KP=y((Qpe,WP)=>{"use strict";var Mee=en(),q0=class extends Mee{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}};WP.exports=q0});var JP=y((eme,YP)=>{"use strict";var Uee=en(),M0=class extends Uee{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)}};YP.exports=M0});var ZP=y((tme,XP)=>{"use strict";var Vee=en(),U0=class extends Vee{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}};XP.exports=U0});var eR=y((rme,QP)=>{"use strict";var Hee=en(),V0=class extends Hee{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)}};QP.exports=V0});var rR=y((nme,tR)=>{"use strict";var zee=en(),H0=class extends zee{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}};tR.exports=H0});var iR=y((ime,nR)=>{"use strict";var Gee=en(),z0=class extends Gee{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}};nR.exports=z0});var sR=y((ome,oR)=>{"use strict";oR.exports={DatePart:en(),Meridiem:HP(),Day:GP(),Hours:KP(),Milliseconds:JP(),Minutes:ZP(),Month:eR(),Seconds:rR(),Year:iR()}});var hR=y((sme,dR)=>{"use strict";var G0=Ge(),Wee=Pn(),{style:aR,clear:uR,figures:Kee}=Rr(),{erase:Yee,cursor:cR}=ke(),{DatePart:lR,Meridiem:Jee,Day:Xee,Hours:Zee,Milliseconds:Qee,Minutes:ete,Month:tte,Seconds:rte,Year:nte}=sR(),ite=/\\(.)|"((?:\\["\\]|[^"])+)"|(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,fR={1:({token:t})=>t.replace(/\\(.)/g,"$1"),2:t=>new Xee(t),3:t=>new tte(t),4:t=>new nte(t),5:t=>new Jee(t),6:t=>new Zee(t),7:t=>new ete(t),8:t=>new rte(t),9:t=>new Qee(t)},ote={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(",")},W0=class extends Wee{constructor(e={}){super(e),this.msg=e.message,this.cursor=0,this.typed="",this.locales=Object.assign(ote,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=uR("",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=ite.exec(e);){let i=r.shift(),o=r.findIndex(s=>s!=null);this.parts.push(o in fR?fR[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 lR)),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
126
+ `),this.close()}deactivate(){if(this.value===!1)return this.bell();this.value=!1,this.render()}activate(){if(this.value===!0)return this.bell();this.value=!0,this.render()}delete(){this.deactivate()}left(){this.deactivate()}right(){this.activate()}down(){this.deactivate()}up(){this.activate()}next(){this.value=!this.value,this.fire(),this.render()}_(e,r){if(e===" ")this.value=!this.value;else if(e==="1")this.value=!0;else if(e==="0")this.value=!1;else return this.bell();this.render()}render(){this.closed||(this.firstRender?this.out.write(LP.hide):this.out.write(jee(this.outputText,this.out.columns)),super.render(),this.outputText=[NP.symbol(this.done,this.aborted),ih.bold(this.msg),NP.delimiter(this.done),this.value?this.inactive:ih.cyan().underline(this.inactive),ih.gray("/"),this.value?ih.cyan().underline(this.active):this.active].join(" "),this.out.write(Nee.line+LP.to(0)+this.outputText))}};BP.exports=j0});var en=y((Jpe,MP)=>{"use strict";var N0=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)}};MP.exports=N0});var VP=y((Xpe,UP)=>{"use strict";var Lee=en(),L0=class extends Lee{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}};UP.exports=L0});var zP=y((Zpe,HP)=>{"use strict";var Bee=en(),qee=t=>(t=t%10,t===1?"st":t===2?"nd":t===3?"rd":"th"),B0=class extends Bee{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+qee(e):this.token==="d"?r+1:this.token==="ddd"?this.locales.weekdaysShort[r]:this.token==="dddd"?this.locales.weekdays[r]:e}};HP.exports=B0});var WP=y((Qpe,GP)=>{"use strict";var Mee=en(),q0=class extends Mee{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}};GP.exports=q0});var YP=y((eme,KP)=>{"use strict";var Uee=en(),M0=class extends Uee{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)}};KP.exports=M0});var XP=y((tme,JP)=>{"use strict";var Vee=en(),U0=class extends Vee{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}};JP.exports=U0});var QP=y((rme,ZP)=>{"use strict";var Hee=en(),V0=class extends Hee{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)}};ZP.exports=V0});var tR=y((nme,eR)=>{"use strict";var zee=en(),H0=class extends zee{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}};eR.exports=H0});var nR=y((ime,rR)=>{"use strict";var Gee=en(),z0=class extends Gee{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}};rR.exports=z0});var oR=y((ome,iR)=>{"use strict";iR.exports={DatePart:en(),Meridiem:VP(),Day:zP(),Hours:WP(),Milliseconds:YP(),Minutes:XP(),Month:QP(),Seconds:tR(),Year:nR()}});var dR=y((sme,fR)=>{"use strict";var G0=Ge(),Wee=Pn(),{style:sR,clear:aR,figures:Kee}=Rr(),{erase:Yee,cursor:uR}=ke(),{DatePart:cR,Meridiem:Jee,Day:Xee,Hours:Zee,Milliseconds:Qee,Minutes:ete,Month:tte,Seconds:rte,Year:nte}=oR(),ite=/\\(.)|"((?:\\["\\]|[^"])+)"|(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,lR={1:({token:t})=>t.replace(/\\(.)/g,"$1"),2:t=>new Xee(t),3:t=>new tte(t),4:t=>new nte(t),5:t=>new Jee(t),6:t=>new Zee(t),7:t=>new ete(t),8:t=>new rte(t),9:t=>new Qee(t)},ote={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(",")},W0=class extends Wee{constructor(e={}){super(e),this.msg=e.message,this.cursor=0,this.typed="",this.locales=Object.assign(ote,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=aR("",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=ite.exec(e);){let i=r.shift(),o=r.findIndex(s=>s!=null);this.parts.push(o in lR?lR[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 cR)),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
127
127
  `),this.close()}async validate(){let e=await this.validator(this.value);typeof e=="string"&&(this.errorMsg=e,e=!1),this.error=!e}async submit(){if(await this.validate(),this.error){this.color="red",this.fire(),this.render();return}this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
128
- `),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 lR)),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(cR.hide):this.out.write(uR(this.outputText,this.out.columns)),super.render(),this.outputText=[aR.symbol(this.done,this.aborted),G0.bold(this.msg),aR.delimiter(!1),this.parts.reduce((e,r,n)=>e.concat(n===this.cursor&&!this.done?G0.cyan().underline(r.toString()):r),[]).join("")].join(" "),this.error&&(this.outputText+=this.errorMsg.split(`
128
+ `),this.close()}up(){this.typed="",this.parts[this.cursor].up(),this.render()}down(){this.typed="",this.parts[this.cursor].down(),this.render()}left(){let e=this.parts[this.cursor].prev();if(e==null)return this.bell();this.moveCursor(this.parts.indexOf(e)),this.render()}right(){let e=this.parts[this.cursor].next();if(e==null)return this.bell();this.moveCursor(this.parts.indexOf(e)),this.render()}next(){let e=this.parts[this.cursor].next();this.moveCursor(e?this.parts.indexOf(e):this.parts.findIndex(r=>r instanceof cR)),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(uR.hide):this.out.write(aR(this.outputText,this.out.columns)),super.render(),this.outputText=[sR.symbol(this.done,this.aborted),G0.bold(this.msg),sR.delimiter(!1),this.parts.reduce((e,r,n)=>e.concat(n===this.cursor&&!this.done?G0.cyan().underline(r.toString()):r),[]).join("")].join(" "),this.error&&(this.outputText+=this.errorMsg.split(`
129
129
  `).reduce((e,r,n)=>e+`
130
- ${n?" ":Kee.pointerSmall} ${G0.red().italic(r)}`,"")),this.out.write(Yee.line+cR.to(0)+this.outputText))}};dR.exports=W0});var yR=y((ame,gR)=>{var oh=Ge(),ste=Pn(),{cursor:sh,erase:ate}=ke(),{style:K0,figures:ute,clear:pR,lines:cte}=Rr(),lte=/[0-9]/,Y0=t=>t!==void 0,mR=(t,e)=>{let r=Math.pow(10,e);return Math.round(t*r)/r},J0=class extends ste{constructor(e={}){super(e),this.transform=K0.render(e.style),this.msg=e.message,this.initial=Y0(e.initial)?e.initial:"",this.float=!!e.float,this.round=e.round||2,this.inc=e.increment||1,this.min=Y0(e.min)?e.min:-1/0,this.max=Y0(e.max)?e.max:1/0,this.errorMsg=e.error||"Please Enter A Valid Value",this.validator=e.validate||(()=>!0),this.color="cyan",this.value="",this.typed="",this.lastHit=0,this.render()}set value(e){!e&&e!==0?(this.placeholder=!0,this.rendered=oh.gray(this.transform.render(`${this.initial}`)),this._value=""):(this.placeholder=!1,this.rendered=this.transform.render(`${mR(e,this.round)}`),this._value=mR(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||lte.test(e)}reset(){this.typed="",this.value="",this.fire(),this.render()}exit(){this.abort()}abort(){let e=this.value;this.value=e!==""?e:this.initial,this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
130
+ ${n?" ":Kee.pointerSmall} ${G0.red().italic(r)}`,"")),this.out.write(Yee.line+uR.to(0)+this.outputText))}};fR.exports=W0});var gR=y((ame,mR)=>{var oh=Ge(),ste=Pn(),{cursor:sh,erase:ate}=ke(),{style:K0,figures:ute,clear:hR,lines:cte}=Rr(),lte=/[0-9]/,Y0=t=>t!==void 0,pR=(t,e)=>{let r=Math.pow(10,e);return Math.round(t*r)/r},J0=class extends ste{constructor(e={}){super(e),this.transform=K0.render(e.style),this.msg=e.message,this.initial=Y0(e.initial)?e.initial:"",this.float=!!e.float,this.round=e.round||2,this.inc=e.increment||1,this.min=Y0(e.min)?e.min:-1/0,this.max=Y0(e.max)?e.max:1/0,this.errorMsg=e.error||"Please Enter A Valid Value",this.validator=e.validate||(()=>!0),this.color="cyan",this.value="",this.typed="",this.lastHit=0,this.render()}set value(e){!e&&e!==0?(this.placeholder=!0,this.rendered=oh.gray(this.transform.render(`${this.initial}`)),this._value=""):(this.placeholder=!1,this.rendered=this.transform.render(`${pR(e,this.round)}`),this._value=pR(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||lte.test(e)}reset(){this.typed="",this.value="",this.fire(),this.render()}exit(){this.abort()}abort(){let e=this.value;this.value=e!==""?e:this.initial,this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
131
131
  `),this.close()}async validate(){let e=await this.validator(this.value);typeof e=="string"&&(this.errorMsg=e,e=!1),this.error=!e}async submit(){if(await this.validate(),this.error){this.color="red",this.fire(),this.render();return}let e=this.value;this.value=e!==""?e:this.initial,this.done=!0,this.aborted=!1,this.error=!1,this.fire(),this.render(),this.out.write(`
132
- `),this.close()}up(){if(this.typed="",this.value===""&&(this.value=this.min-this.inc),this.value>=this.max)return this.bell();this.value+=this.inc,this.color="cyan",this.fire(),this.render()}down(){if(this.typed="",this.value===""&&(this.value=this.min+this.inc),this.value<=this.min)return this.bell();this.value-=this.inc,this.color="cyan",this.fire(),this.render()}delete(){let e=this.value.toString();if(e.length===0)return this.bell();this.value=this.parse(e=e.slice(0,-1))||"",this.value!==""&&this.value<this.min&&(this.value=this.min),this.color="cyan",this.fire(),this.render()}next(){this.value=this.initial,this.fire(),this.render()}_(e,r){if(!this.valid(e))return this.bell();let n=Date.now();if(n-this.lastHit>1e3&&(this.typed=""),this.typed+=e,this.lastHit=n,this.color="cyan",e===".")return this.fire();this.value=Math.min(this.parse(this.typed),this.max),this.value>this.max&&(this.value=this.max),this.value<this.min&&(this.value=this.min),this.fire(),this.render()}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(sh.down(cte(this.outputError,this.out.columns)-1)+pR(this.outputError,this.out.columns)),this.out.write(pR(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[K0.symbol(this.done,this.aborted),oh.bold(this.msg),K0.delimiter(this.done),!this.done||!this.done&&!this.placeholder?oh[this.color]().underline(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
132
+ `),this.close()}up(){if(this.typed="",this.value===""&&(this.value=this.min-this.inc),this.value>=this.max)return this.bell();this.value+=this.inc,this.color="cyan",this.fire(),this.render()}down(){if(this.typed="",this.value===""&&(this.value=this.min+this.inc),this.value<=this.min)return this.bell();this.value-=this.inc,this.color="cyan",this.fire(),this.render()}delete(){let e=this.value.toString();if(e.length===0)return this.bell();this.value=this.parse(e=e.slice(0,-1))||"",this.value!==""&&this.value<this.min&&(this.value=this.min),this.color="cyan",this.fire(),this.render()}next(){this.value=this.initial,this.fire(),this.render()}_(e,r){if(!this.valid(e))return this.bell();let n=Date.now();if(n-this.lastHit>1e3&&(this.typed=""),this.typed+=e,this.lastHit=n,this.color="cyan",e===".")return this.fire();this.value=Math.min(this.parse(this.typed),this.max),this.value>this.max&&(this.value=this.max),this.value<this.min&&(this.value=this.min),this.fire(),this.render()}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(sh.down(cte(this.outputError,this.out.columns)-1)+hR(this.outputError,this.out.columns)),this.out.write(hR(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[K0.symbol(this.done,this.aborted),oh.bold(this.msg),K0.delimiter(this.done),!this.done||!this.done&&!this.placeholder?oh[this.color]().underline(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
133
133
  `).reduce((e,r,n)=>e+`
134
- ${n?" ":ute.pointerSmall} ${oh.red().italic(r)}`,"")),this.out.write(ate.line+sh.to(0)+this.outputText+sh.save+this.outputError+sh.restore))}};gR.exports=J0});var Z0=y((ume,bR)=>{"use strict";var tn=Ge(),{cursor:fte}=ke(),dte=Pn(),{clear:DR,figures:hi,style:vR,wrap:hte,entriesToDisplay:pte}=Rr(),X0=class extends dte{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=DR("",this.out.columns),e.overrideRender||this.render()}reset(){this.value.map(e=>!e.selected),this.cursor=0,this.fire(),this.render()}selected(){return this.value.filter(e=>e.selected)}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
134
+ ${n?" ":ute.pointerSmall} ${oh.red().italic(r)}`,"")),this.out.write(ate.line+sh.to(0)+this.outputText+sh.save+this.outputError+sh.restore))}};mR.exports=J0});var Z0=y((ume,vR)=>{"use strict";var tn=Ge(),{cursor:fte}=ke(),dte=Pn(),{clear:yR,figures:hi,style:DR,wrap:hte,entriesToDisplay:pte}=Rr(),X0=class extends dte{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=yR("",this.out.columns),e.overrideRender||this.render()}reset(){this.value.map(e=>!e.selected),this.cursor=0,this.fire(),this.render()}selected(){return this.value.filter(e=>e.selected)}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
135
135
  `),this.close()}submit(){let e=this.value.filter(r=>r.selected);this.minSelected&&e.length<this.minSelected?(this.showMinError=!0,this.render()):(this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
136
136
  `),this.close())}first(){this.cursor=0,this.render()}last(){this.cursor=this.value.length-1,this.render()}next(){this.cursor=(this.cursor+1)%this.value.length,this.render()}up(){this.cursor===0?this.cursor=this.value.length-1:this.cursor--,this.render()}down(){this.cursor===this.value.length-1?this.cursor=0:this.cursor++,this.render()}left(){this.value[this.cursor].selected=!1,this.render()}right(){if(this.value.filter(e=>e.selected).length>=this.maxChoices)return this.bell();this.value[this.cursor].selected=!0,this.render()}handleSpaceToggle(){let e=this.value[this.cursor];if(e.selected)e.selected=!1,this.render();else{if(e.disabled||this.value.filter(r=>r.selected).length>=this.maxChoices)return this.bell();e.selected=!0,this.render()}}toggleAll(){if(this.maxChoices!==void 0||this.value[this.cursor].disabled)return this.bell();let e=!this.value[this.cursor].selected;this.value.filter(r=>!r.disabled).forEach(r=>r.selected=e),this.render()}_(e,r){if(e===" ")this.handleSpaceToggle();else if(e==="a")this.toggleAll();else return this.bell()}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
137
137
  Instructions:
@@ -141,13 +141,13 @@ Instructions:
141
141
  `:"")+" enter/return: Complete answer":""}renderOption(e,r,n,i){let o=(r.selected?tn.green(hi.radioOn):hi.radioOff)+" "+i+" ",s,a;return r.disabled?s=e===n?tn.gray().underline(r.title):tn.strikethrough().gray(r.title):(s=e===n?tn.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=`
142
142
  `+hte(r.description,{margin:o.length,width:this.out.columns})))),o+s+tn.gray(a||"")}paginateOptions(e){if(e.length===0)return tn.red("No matches for this query.");let{startIndex:r,endIndex:n}=pte(this.cursor,e.length,this.optionsPerPage),i,o=[];for(let s=r;s<n;s++)s===r&&r>0?i=hi.arrowUp:s===n-1&&n<e.length?i=hi.arrowDown:i=" ",o.push(this.renderOption(this.cursor,e[s],s,i));return`
143
143
  `+o.join(`
144
- `)}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=[tn.gray(this.hint),this.renderInstructions()];return this.value[this.cursor].disabled&&e.push(tn.yellow(this.warn)),e.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(fte.hide),super.render();let e=[vR.symbol(this.done,this.aborted),tn.bold(this.msg),vR.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(e+=tn.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),e+=this.renderOptions(this.value),this.out.write(this.clear+e),this.clear=DR(e,this.out.columns)}};bR.exports=X0});var SR=y((cme,CR)=>{"use strict";var vc=Ge(),mte=Pn(),{erase:gte,cursor:wR}=ke(),{style:Q0,clear:_R,figures:ev,wrap:yte,entriesToDisplay:Dte}=Rr(),ER=(t,e)=>t[e]&&(t[e].value||t[e].title||t[e]),vte=(t,e)=>t[e]&&(t[e].title||t[e].value||t[e]),bte=(t,e)=>{let r=t.findIndex(n=>n.value===e||n.title===e);return r>-1?r:void 0},tv=class extends mte{constructor(e={}){super(e),this.msg=e.message,this.suggest=e.suggest,this.choices=e.choices,this.initial=typeof e.initial=="number"?e.initial:bte(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=Q0.render(e.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=_R("",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=ER(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:vte(a,s),value:ER(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(`
144
+ `)}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=[tn.gray(this.hint),this.renderInstructions()];return this.value[this.cursor].disabled&&e.push(tn.yellow(this.warn)),e.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(fte.hide),super.render();let e=[DR.symbol(this.done,this.aborted),tn.bold(this.msg),DR.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(e+=tn.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),e+=this.renderOptions(this.value),this.out.write(this.clear+e),this.clear=yR(e,this.out.columns)}};vR.exports=X0});var CR=y((cme,ER)=>{"use strict";var vc=Ge(),mte=Pn(),{erase:gte,cursor:bR}=ke(),{style:Q0,clear:wR,figures:ev,wrap:yte,entriesToDisplay:Dte}=Rr(),_R=(t,e)=>t[e]&&(t[e].value||t[e].title||t[e]),vte=(t,e)=>t[e]&&(t[e].title||t[e].value||t[e]),bte=(t,e)=>{let r=t.findIndex(n=>n.value===e||n.title===e);return r>-1?r:void 0},tv=class extends mte{constructor(e={}){super(e),this.msg=e.message,this.suggest=e.suggest,this.choices=e.choices,this.initial=typeof e.initial=="number"?e.initial:bte(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=Q0.render(e.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=wR("",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=_R(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:vte(a,s),value:_R(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(`
145
145
  `),this.close())}abort(){this.done=this.aborted=!0,this.exited=!1,this.fire(),this.render(),this.out.write(`
146
146
  `),this.close()}submit(){this.done=!0,this.aborted=this.exited=!1,this.fire(),this.render(),this.out.write(`
147
147
  `),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?ev.arrowUp:i?ev.arrowDown:" ",a=r?vc.cyan().underline(e.title):e.title;return s=(r?vc.cyan(ev.pointer)+" ":" ")+s,e.description&&(o=` - ${e.description}`,(s.length+a.length+o.length>=this.out.columns||e.description.split(/\r?\n/).length>1)&&(o=`
148
- `+yte(e.description,{margin:3,width:this.out.columns}))),s+" "+a+vc.gray(o||"")}render(){if(this.closed)return;this.firstRender?this.out.write(wR.hide):this.out.write(_R(this.outputText,this.out.columns)),super.render();let{startIndex:e,endIndex:r}=Dte(this.select,this.choices.length,this.limit);if(this.outputText=[Q0.symbol(this.done,this.aborted,this.exited),vc.bold(this.msg),Q0.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(`
148
+ `+yte(e.description,{margin:3,width:this.out.columns}))),s+" "+a+vc.gray(o||"")}render(){if(this.closed)return;this.firstRender?this.out.write(bR.hide):this.out.write(wR(this.outputText,this.out.columns)),super.render();let{startIndex:e,endIndex:r}=Dte(this.select,this.choices.length,this.limit);if(this.outputText=[Q0.symbol(this.done,this.aborted,this.exited),vc.bold(this.msg),Q0.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(`
149
149
  `);this.outputText+=`
150
- `+(n||vc.gray(this.fallback.title))}this.out.write(gte.line+wR.to(0)+this.outputText)}};CR.exports=tv});var AR=y((lme,OR)=>{"use strict";var $n=Ge(),{cursor:wte}=ke(),_te=Z0(),{clear:xR,style:FR,figures:ea}=Rr(),rv=class extends _te{constructor(e={}){e.overrideRender=!0,super(e),this.inputValue="",this.clear=xR("",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:`
150
+ `+(n||vc.gray(this.fallback.title))}this.out.write(gte.line+bR.to(0)+this.outputText)}};ER.exports=tv});var OR=y((lme,FR)=>{"use strict";var $n=Ge(),{cursor:wte}=ke(),_te=Z0(),{clear:SR,style:xR,figures:ea}=Rr(),rv=class extends _te{constructor(e={}){e.overrideRender=!0,super(e),this.inputValue="",this.clear=SR("",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:`
151
151
  Instructions:
152
152
  ${ea.arrowUp}/${ea.arrowDown}: Highlight option
153
153
  ${ea.arrowLeft}/${ea.arrowRight}/[space]: Toggle selection
@@ -155,62 +155,62 @@ Instructions:
155
155
  enter/return: Complete answer
156
156
  `:""}renderCurrentInput(){return`
157
157
  Filtered results for: ${this.inputValue?this.inputValue:$n.gray("Enter something to filter")}
158
- `}renderOption(e,r,n){let i;return r.disabled?i=e===n?$n.gray().underline(r.title):$n.strikethrough().gray(r.title):i=e===n?$n.cyan().underline(r.title):r.title,(r.selected?$n.green(ea.radioOn):ea.radioOff)+" "+i}renderDoneOrInstructions(){if(this.done)return this.value.filter(r=>r.selected).map(r=>r.title).join(", ");let e=[$n.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&e.push($n.yellow(this.warn)),e.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(wte.hide),super.render();let e=[FR.symbol(this.done,this.aborted),$n.bold(this.msg),FR.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(e+=$n.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),e+=this.renderOptions(this.filteredOptions),this.out.write(this.clear+e),this.clear=xR(e,this.out.columns)}};OR.exports=rv});var $R=y((fme,RR)=>{var kR=Ge(),Ete=Pn(),{style:TR,clear:Cte}=Rr(),{erase:Ste,cursor:PR}=ke(),nv=class extends Ete{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(`
158
+ `}renderOption(e,r,n){let i;return r.disabled?i=e===n?$n.gray().underline(r.title):$n.strikethrough().gray(r.title):i=e===n?$n.cyan().underline(r.title):r.title,(r.selected?$n.green(ea.radioOn):ea.radioOff)+" "+i}renderDoneOrInstructions(){if(this.done)return this.value.filter(r=>r.selected).map(r=>r.title).join(", ");let e=[$n.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&e.push($n.yellow(this.warn)),e.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(wte.hide),super.render();let e=[xR.symbol(this.done,this.aborted),$n.bold(this.msg),xR.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(e+=$n.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),e+=this.renderOptions(this.filteredOptions),this.out.write(this.clear+e),this.clear=SR(e,this.out.columns)}};FR.exports=rv});var RR=y((fme,PR)=>{var AR=Ge(),Ete=Pn(),{style:kR,clear:Cte}=Rr(),{erase:Ste,cursor:TR}=ke(),nv=class extends Ete{constructor(e={}){super(e),this.msg=e.message,this.value=e.initial,this.initialValue=!!e.initial,this.yesMsg=e.yes||"yes",this.yesOption=e.yesOption||"(Y/n)",this.noMsg=e.no||"no",this.noOption=e.noOption||"(y/N)",this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
159
159
  `),this.close()}submit(){this.value=this.value||!1,this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
160
- `),this.close()}_(e,r){return e.toLowerCase()==="y"?(this.value=!0,this.submit()):e.toLowerCase()==="n"?(this.value=!1,this.submit()):this.bell()}render(){this.closed||(this.firstRender?this.out.write(PR.hide):this.out.write(Cte(this.outputText,this.out.columns)),super.render(),this.outputText=[TR.symbol(this.done,this.aborted),kR.bold(this.msg),TR.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:kR.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(Ste.line+PR.to(0)+this.outputText))}};RR.exports=nv});var jR=y((dme,IR)=>{"use strict";IR.exports={TextPrompt:RP(),SelectPrompt:NP(),TogglePrompt:MP(),DatePrompt:hR(),NumberPrompt:yR(),MultiselectPrompt:Z0(),AutocompletePrompt:SR(),AutocompleteMultiselectPrompt:AR(),ConfirmPrompt:$R()}});var LR=y(NR=>{"use strict";var Xt=NR,xte=jR(),ah=t=>t;function rn(t,e,r={}){return new Promise((n,i)=>{let o=new xte[t](e),s=r.onAbort||ah,a=r.onSubmit||ah,u=r.onExit||ah;o.on("state",e.onState||ah),o.on("submit",c=>n(a(c))),o.on("exit",c=>n(u(c))),o.on("abort",c=>i(s(c)))})}Xt.text=t=>rn("TextPrompt",t);Xt.password=t=>(t.style="password",Xt.text(t));Xt.invisible=t=>(t.style="invisible",Xt.text(t));Xt.number=t=>rn("NumberPrompt",t);Xt.date=t=>rn("DatePrompt",t);Xt.confirm=t=>rn("ConfirmPrompt",t);Xt.list=t=>{let e=t.separator||",";return rn("TextPrompt",t,{onSubmit:r=>r.split(e).map(n=>n.trim())})};Xt.toggle=t=>rn("TogglePrompt",t);Xt.select=t=>rn("SelectPrompt",t);Xt.multiselect=t=>{t.choices=[].concat(t.choices||[]);let e=r=>r.filter(n=>n.selected).map(n=>n.value);return rn("MultiselectPrompt",t,{onAbort:e,onSubmit:e})};Xt.autocompleteMultiselect=t=>{t.choices=[].concat(t.choices||[]);let e=r=>r.filter(n=>n.selected).map(n=>n.value);return rn("AutocompleteMultiselectPrompt",t,{onAbort:e,onSubmit:e})};var Fte=(t,e)=>Promise.resolve(e.filter(r=>r.title.slice(0,t.length).toLowerCase()===t.toLowerCase()));Xt.autocomplete=t=>(t.suggest=t.suggest||Fte,t.choices=[].concat(t.choices||[]),rn("AutocompletePrompt",t))});var MR=y((pme,qR)=>{"use strict";var iv=LR(),Ote=["suggest","format","onState","validate","onRender","type"],BR=()=>{};async function pi(t=[],{onSubmit:e=BR,onCancel:r=BR}={}){let n={},i=pi._override||{};t=[].concat(t);let o,s,a,u,c,l,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:c}=s,typeof c=="function"&&(c=await c(o,{...n},s),s.type=c),!!c){for(let h in s){if(Ote.includes(h))continue;let d=s[h];s[h]=typeof d=="function"?await d(o,{...n},l):d}if(l=s,typeof s.message!="string")throw new Error("prompt message is required");if({name:u,type:c}=s,iv[c]===void 0)throw new Error(`prompt type (${c}) is not defined`);if(i[s.name]!==void 0&&(o=await f(s,i[s.name]),o!==void 0)){n[u]=o;continue}try{o=pi._injected?Ate(pi._injected,s.initial):await iv[c](s),n[u]=o=await f(s,o,!0),a=await e(s,o,n)}catch{a=!await r(s,n)}if(a)return n}return n}function Ate(t,e){let r=t.shift();if(r instanceof Error)throw r;return r===void 0?e:r}function kte(t){pi._injected=(pi._injected||[]).concat(t)}function Tte(t){pi._override=Object.assign({},t)}qR.exports=Object.assign(pi,{prompt:pi,prompts:iv,inject:kte,override:Tte})});var uh=y((mme,UR)=>{function Pte(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}UR.exports=Pte("8.6.0")?hP():MR()});var uc=y(Zt=>{"use strict";Object.defineProperty(Zt,"__esModule",{value:!0});Zt.logSuccess=Zt.logPrompt=Zt.logger=Zt.output=void 0;var ov=(Cn(),Ae(En)),po=(YD(),Ae(KD)),mo=ov.__importDefault(Hs()),Rte=p3(),VR={colors:mo.default,stream:process.argv.includes("--json")?process.stderr:process.stdout};Zt.output=(0,Rte.isInteractive)()?new po.TTYOutputStrategy(VR):new po.StreamOutputStrategy(VR);Zt.logger=(0,po.createDefaultLogger)({output:Zt.output,formatterOptions:{titleize:!1,tags:new Map([[po.LOGGER_LEVELS.DEBUG,mo.default.log.DEBUG("[debug]")],[po.LOGGER_LEVELS.INFO,mo.default.log.INFO("[info]")],[po.LOGGER_LEVELS.WARN,mo.default.log.WARN("[warn]")],[po.LOGGER_LEVELS.ERROR,mo.default.log.ERROR("[error]")]])}});async function $te(t,e){let{wordWrap:r}=await Promise.resolve().then(()=>ov.__importStar((YD(),Ae(KD)))),{prompt:n}=await Promise.resolve().then(()=>ov.__importStar(uh()));return Zt.logger.log({msg:`${mo.default.input("[?]")} ${r(t,{indentation:4})}`,logger:Zt.logger,format:!1}),n(e,{onCancel:()=>process.exit(1)})}Zt.logPrompt=$te;function Ite(t){Zt.logger.msg(`${mo.default.success("[success]")} ${t}`)}Zt.logSuccess=Ite});var ch=y(ta=>{"use strict";Object.defineProperty(ta,"__esModule",{value:!0});ta.resolveNode=ta.requireTS=void 0;var jte=qs(),Nte=require("fs"),Lte=require("path"),Bte=(t,e)=>{let r=(0,Lte.resolve)(e);delete require.cache[r],require.extensions[".ts"]=(i,o)=>{var s;let a=(0,jte.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};ta.requireTS=Bte;function qte(t,...e){try{return require.resolve(e.join("/"),{paths:[t]})}catch{let n=[t,"node_modules",...e].join("/");return(0,Nte.existsSync)(n)?n:null}}ta.resolveNode=qte});var HR={};mn(HR,{default:()=>Mte});var Mte,zR=ct(()=>{Mte={}});var GR=y(nn=>{"use strict";Object.defineProperty(nn,"__esModule",{value:!0});nn.buildXmlElement=nn.writeXML=nn.parseXML=nn.readXML=void 0;var Ute=(Cn(),Ae(En)),Vte=qs(),bc=Ute.__importDefault((zR(),Ae(HR)));async function Hte(t){var e;try{let r=await(0,Vte.readFile)(t,{encoding:"utf-8"});try{return await bc.default.parseStringPromise(r)}catch(n){throw`Error parsing: ${t}, ${(e=n.stack)!==null&&e!==void 0?e:n}`}}catch{throw`Unable to read: ${t}`}}nn.readXML=Hte;function zte(t,e){let r=e!==void 0?new bc.default.Parser({...e}):new bc.default.Parser,n;return r.parseString(t,(i,o)=>{i||(n=o)}),n}nn.parseXML=zte;async function Gte(t){return new Promise(e=>{let n=new bc.default.Builder({headless:!0,explicitRoot:!1,rootName:"deleteme"}).buildObject(t);n=n.replace("<deleteme>","").replace("</deleteme>",""),e(n)})}nn.writeXML=Gte;function Wte(t,e){return new bc.default.Builder({headless:!0,explicitRoot:!1,rootName:e}).buildObject(t)}nn.buildXmlElement=Wte});var XR=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 Kte=(Cn(),Ae(En)),Yte=qs(),sv=require("path"),ra=Kte.__importDefault(Hs()),Jte=Hd(),Xte=uc(),WR=ch(),Zte=GR();function KR(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=KR;async function Qte(t,e){var r;let n=(r=KR(t,e))!==null&&r!==void 0?r:JR(t);return(await Promise.all(n.map(async o=>YR(t,o)))).filter(o=>!!o)}Ee.getPlugins=Qte;async function YR(t,e){try{let r=(0,WR.resolveNode)(t.app.rootDir,e,"package.json");r||(0,Jte.fatal)(`Unable to find ${ra.default.strong(`node_modules/${e}`)}.
161
- Are you sure ${ra.default.strong(e)} is installed?`);let n=(0,sv.dirname)(r),i=await(0,Yte.readJSON)(r);if(!i)return null;if(i.capacitor)return{id:e,name:av(e),version:i.version,rootPath:n,repository:i.repository,manifest:i.capacitor};let o=(0,sv.join)(n,"plugin.xml"),s=await(0,Zte.readXML)(o);return{id:e,name:av(e),version:i.version,rootPath:n,repository:i.repository,xml:s.plugin}}catch{}return null}Ee.resolvePlugin=YR;function JR(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=JR;function av(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=av;function ere(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 ${ra.default.strong(e)}:
160
+ `),this.close()}_(e,r){return e.toLowerCase()==="y"?(this.value=!0,this.submit()):e.toLowerCase()==="n"?(this.value=!1,this.submit()):this.bell()}render(){this.closed||(this.firstRender?this.out.write(TR.hide):this.out.write(Cte(this.outputText,this.out.columns)),super.render(),this.outputText=[kR.symbol(this.done,this.aborted),AR.bold(this.msg),kR.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:AR.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(Ste.line+TR.to(0)+this.outputText))}};PR.exports=nv});var IR=y((dme,$R)=>{"use strict";$R.exports={TextPrompt:PP(),SelectPrompt:jP(),TogglePrompt:qP(),DatePrompt:dR(),NumberPrompt:gR(),MultiselectPrompt:Z0(),AutocompletePrompt:CR(),AutocompleteMultiselectPrompt:OR(),ConfirmPrompt:RR()}});var NR=y(jR=>{"use strict";var Xt=jR,xte=IR(),ah=t=>t;function rn(t,e,r={}){return new Promise((n,i)=>{let o=new xte[t](e),s=r.onAbort||ah,a=r.onSubmit||ah,u=r.onExit||ah;o.on("state",e.onState||ah),o.on("submit",c=>n(a(c))),o.on("exit",c=>n(u(c))),o.on("abort",c=>i(s(c)))})}Xt.text=t=>rn("TextPrompt",t);Xt.password=t=>(t.style="password",Xt.text(t));Xt.invisible=t=>(t.style="invisible",Xt.text(t));Xt.number=t=>rn("NumberPrompt",t);Xt.date=t=>rn("DatePrompt",t);Xt.confirm=t=>rn("ConfirmPrompt",t);Xt.list=t=>{let e=t.separator||",";return rn("TextPrompt",t,{onSubmit:r=>r.split(e).map(n=>n.trim())})};Xt.toggle=t=>rn("TogglePrompt",t);Xt.select=t=>rn("SelectPrompt",t);Xt.multiselect=t=>{t.choices=[].concat(t.choices||[]);let e=r=>r.filter(n=>n.selected).map(n=>n.value);return rn("MultiselectPrompt",t,{onAbort:e,onSubmit:e})};Xt.autocompleteMultiselect=t=>{t.choices=[].concat(t.choices||[]);let e=r=>r.filter(n=>n.selected).map(n=>n.value);return rn("AutocompleteMultiselectPrompt",t,{onAbort:e,onSubmit:e})};var Fte=(t,e)=>Promise.resolve(e.filter(r=>r.title.slice(0,t.length).toLowerCase()===t.toLowerCase()));Xt.autocomplete=t=>(t.suggest=t.suggest||Fte,t.choices=[].concat(t.choices||[]),rn("AutocompletePrompt",t))});var qR=y((pme,BR)=>{"use strict";var iv=NR(),Ote=["suggest","format","onState","validate","onRender","type"],LR=()=>{};async function pi(t=[],{onSubmit:e=LR,onCancel:r=LR}={}){let n={},i=pi._override||{};t=[].concat(t);let o,s,a,u,c,l,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:c}=s,typeof c=="function"&&(c=await c(o,{...n},s),s.type=c),!!c){for(let h in s){if(Ote.includes(h))continue;let d=s[h];s[h]=typeof d=="function"?await d(o,{...n},l):d}if(l=s,typeof s.message!="string")throw new Error("prompt message is required");if({name:u,type:c}=s,iv[c]===void 0)throw new Error(`prompt type (${c}) is not defined`);if(i[s.name]!==void 0&&(o=await f(s,i[s.name]),o!==void 0)){n[u]=o;continue}try{o=pi._injected?Ate(pi._injected,s.initial):await iv[c](s),n[u]=o=await f(s,o,!0),a=await e(s,o,n)}catch{a=!await r(s,n)}if(a)return n}return n}function Ate(t,e){let r=t.shift();if(r instanceof Error)throw r;return r===void 0?e:r}function kte(t){pi._injected=(pi._injected||[]).concat(t)}function Tte(t){pi._override=Object.assign({},t)}BR.exports=Object.assign(pi,{prompt:pi,prompts:iv,inject:kte,override:Tte})});var uh=y((mme,MR)=>{function Pte(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}MR.exports=Pte("8.6.0")?dP():qR()});var uc=y(Zt=>{"use strict";Object.defineProperty(Zt,"__esModule",{value:!0});Zt.logSuccess=Zt.logPrompt=Zt.logger=Zt.output=void 0;var ov=(Cn(),Ae(En)),po=(YD(),Ae(KD)),mo=ov.__importDefault(Hs()),Rte=h3(),UR={colors:mo.default,stream:process.argv.includes("--json")?process.stderr:process.stdout};Zt.output=(0,Rte.isInteractive)()?new po.TTYOutputStrategy(UR):new po.StreamOutputStrategy(UR);Zt.logger=(0,po.createDefaultLogger)({output:Zt.output,formatterOptions:{titleize:!1,tags:new Map([[po.LOGGER_LEVELS.DEBUG,mo.default.log.DEBUG("[debug]")],[po.LOGGER_LEVELS.INFO,mo.default.log.INFO("[info]")],[po.LOGGER_LEVELS.WARN,mo.default.log.WARN("[warn]")],[po.LOGGER_LEVELS.ERROR,mo.default.log.ERROR("[error]")]])}});async function $te(t,e){let{wordWrap:r}=await Promise.resolve().then(()=>ov.__importStar((YD(),Ae(KD)))),{prompt:n}=await Promise.resolve().then(()=>ov.__importStar(uh()));return Zt.logger.log({msg:`${mo.default.input("[?]")} ${r(t,{indentation:4})}`,logger:Zt.logger,format:!1}),n(e,{onCancel:()=>process.exit(1)})}Zt.logPrompt=$te;function Ite(t){Zt.logger.msg(`${mo.default.success("[success]")} ${t}`)}Zt.logSuccess=Ite});var ch=y(ta=>{"use strict";Object.defineProperty(ta,"__esModule",{value:!0});ta.resolveNode=ta.requireTS=void 0;var jte=qs(),Nte=require("fs"),Lte=require("path"),Bte=(t,e)=>{let r=(0,Lte.resolve)(e);delete require.cache[r],require.extensions[".ts"]=(i,o)=>{var s;let a=(0,jte.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};ta.requireTS=Bte;function qte(t,...e){try{return require.resolve(e.join("/"),{paths:[t]})}catch{let n=[t,"node_modules",...e].join("/");return(0,Nte.existsSync)(n)?n:null}}ta.resolveNode=qte});var VR={};mn(VR,{default:()=>Mte});var Mte,HR=ct(()=>{Mte={}});var zR=y(nn=>{"use strict";Object.defineProperty(nn,"__esModule",{value:!0});nn.buildXmlElement=nn.writeXML=nn.parseXML=nn.readXML=void 0;var Ute=(Cn(),Ae(En)),Vte=qs(),bc=Ute.__importDefault((HR(),Ae(VR)));async function Hte(t){var e;try{let r=await(0,Vte.readFile)(t,{encoding:"utf-8"});try{return await bc.default.parseStringPromise(r)}catch(n){throw`Error parsing: ${t}, ${(e=n.stack)!==null&&e!==void 0?e:n}`}}catch{throw`Unable to read: ${t}`}}nn.readXML=Hte;function zte(t,e){let r=e!==void 0?new bc.default.Parser({...e}):new bc.default.Parser,n;return r.parseString(t,(i,o)=>{i||(n=o)}),n}nn.parseXML=zte;async function Gte(t){return new Promise(e=>{let n=new bc.default.Builder({headless:!0,explicitRoot:!1,rootName:"deleteme"}).buildObject(t);n=n.replace("<deleteme>","").replace("</deleteme>",""),e(n)})}nn.writeXML=Gte;function Wte(t,e){return new bc.default.Builder({headless:!0,explicitRoot:!1,rootName:e}).buildObject(t)}nn.buildXmlElement=Wte});var JR=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 Kte=(Cn(),Ae(En)),Yte=qs(),sv=require("path"),ra=Kte.__importDefault(Hs()),Jte=Hd(),Xte=uc(),GR=ch(),Zte=zR();function WR(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=WR;async function Qte(t,e){var r;let n=(r=WR(t,e))!==null&&r!==void 0?r:YR(t);return(await Promise.all(n.map(async o=>KR(t,o)))).filter(o=>!!o)}Ee.getPlugins=Qte;async function KR(t,e){try{let r=(0,GR.resolveNode)(t.app.rootDir,e,"package.json");r||(0,Jte.fatal)(`Unable to find ${ra.default.strong(`node_modules/${e}`)}.
161
+ Are you sure ${ra.default.strong(e)} is installed?`);let n=(0,sv.dirname)(r),i=await(0,Yte.readJSON)(r);if(!i)return null;if(i.capacitor)return{id:e,name:av(e),version:i.version,rootPath:n,repository:i.repository,manifest:i.capacitor};let o=(0,sv.join)(n,"plugin.xml"),s=await(0,Zte.readXML)(o);return{id:e,name:av(e),version:i.version,rootPath:n,repository:i.repository,xml:s.plugin}}catch{}return null}Ee.resolvePlugin=KR;function YR(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=YR;function av(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=av;function ere(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 ${ra.default.strong(e)}:
162
162
  `;break;case"incompatible":n=`Found ${t.length} incompatible Cordova plugin${i} for ${ra.default.strong(e)}, skipped install:
163
163
  `;break;case"capacitor":n=`Found ${t.length} Capacitor plugin${i} for ${ra.default.strong(e)}:
164
164
  `;break}n+=t.map(o=>`${o.id}${ra.default.weak(`@${o.version}`)}`).join(`
165
- `),Xte.logger.info(n)}Ee.printPlugins=ere;function uv(t,e){return t.xml.platform?t.xml.platform.filter(function(i){return i.$.name===e})[0]:[]}Ee.getPluginPlatform=uv;function tre(t,e,r){let n=uv(t,e);if(n){let i=n[r];if(i)return i}return[]}Ee.getPlatformElement=tre;function rre(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=rre;function nre(t,e){return cv(t,e,"js-module")}Ee.getJSModules=nre;function ire(t,e){return cv(t,e,"asset")}Ee.getAssets=ire;function ore(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,WR.resolveNode)(t.app.rootDir,...n);if(!i)throw new Error(`Can't resolve module ${n[0]}`);return i}return(0,sv.join)(e.rootPath,r)}Ee.getFilePath=ore;function cv(t,e,r){let n=[];t.xml[r]&&(n=n.concat(t.xml[r]));let i=uv(t,e);return i?.[r]&&(n=n.concat(i[r])),n}Ee.getAllElements=cv});var ZR={};mn(ZR,{default:()=>sre});var sre,QR=ct(()=>{sre={}});var lh=y(mi=>{"use strict";Object.defineProperty(mi,"__esModule",{value:!0});mi.isInstalled=mi.getCommandOutput=mi.runCommand=void 0;var lv=(QR(),Ae(ZR));async function e$(t,e,r={}){let n=new lv.Subprocess(t,e,r);try{return await n.output()}catch(i){throw i instanceof lv.SubprocessError?i.output?i.output:i.code?i.code:i.error?i.error.message:"Unknown error":i}}mi.runCommand=e$;async function are(t,e,r={}){try{return(await e$(t,e,r)).trim()}catch{return null}}mi.getCommandOutput=are;async function ure(t){try{await(0,lv.which)(t)}catch{return!1}return!0}mi.isInstalled=ure});var wc=y((wme,t$)=>{var cre="2.0.0",lre=Number.MAX_SAFE_INTEGER||9007199254740991,fre=16,dre=250,hre=["major","premajor","minor","preminor","patch","prepatch","prerelease"];t$.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:fre,MAX_SAFE_BUILD_LENGTH:dre,MAX_SAFE_INTEGER:lre,RELEASE_TYPES:hre,SEMVER_SPEC_VERSION:cre,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var _c=y((_me,r$)=>{var pre=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{};r$.exports=pre});var na=y((In,n$)=>{var{MAX_SAFE_COMPONENT_LENGTH:fv,MAX_SAFE_BUILD_LENGTH:mre,MAX_LENGTH:gre}=wc(),yre=_c();In=n$.exports={};var Dre=In.re=[],vre=In.safeRe=[],z=In.src=[],G=In.t={},bre=0,dv="[a-zA-Z0-9-]",wre=[["\\s",1],["\\d",gre],[dv,mre]],_re=t=>{for(let[e,r]of wre)t=t.split(`${e}*`).join(`${e}{0,${r}}`).split(`${e}+`).join(`${e}{1,${r}}`);return t},ne=(t,e,r)=>{let n=_re(e),i=bre++;yre(t,i,e),G[t]=i,z[i]=e,Dre[i]=new RegExp(e,r?"g":void 0),vre[i]=new RegExp(n,r?"g":void 0)};ne("NUMERICIDENTIFIER","0|[1-9]\\d*");ne("NUMERICIDENTIFIERLOOSE","\\d+");ne("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${dv}*`);ne("MAINVERSION",`(${z[G.NUMERICIDENTIFIER]})\\.(${z[G.NUMERICIDENTIFIER]})\\.(${z[G.NUMERICIDENTIFIER]})`);ne("MAINVERSIONLOOSE",`(${z[G.NUMERICIDENTIFIERLOOSE]})\\.(${z[G.NUMERICIDENTIFIERLOOSE]})\\.(${z[G.NUMERICIDENTIFIERLOOSE]})`);ne("PRERELEASEIDENTIFIER",`(?:${z[G.NUMERICIDENTIFIER]}|${z[G.NONNUMERICIDENTIFIER]})`);ne("PRERELEASEIDENTIFIERLOOSE",`(?:${z[G.NUMERICIDENTIFIERLOOSE]}|${z[G.NONNUMERICIDENTIFIER]})`);ne("PRERELEASE",`(?:-(${z[G.PRERELEASEIDENTIFIER]}(?:\\.${z[G.PRERELEASEIDENTIFIER]})*))`);ne("PRERELEASELOOSE",`(?:-?(${z[G.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${z[G.PRERELEASEIDENTIFIERLOOSE]})*))`);ne("BUILDIDENTIFIER",`${dv}+`);ne("BUILD",`(?:\\+(${z[G.BUILDIDENTIFIER]}(?:\\.${z[G.BUILDIDENTIFIER]})*))`);ne("FULLPLAIN",`v?${z[G.MAINVERSION]}${z[G.PRERELEASE]}?${z[G.BUILD]}?`);ne("FULL",`^${z[G.FULLPLAIN]}$`);ne("LOOSEPLAIN",`[v=\\s]*${z[G.MAINVERSIONLOOSE]}${z[G.PRERELEASELOOSE]}?${z[G.BUILD]}?`);ne("LOOSE",`^${z[G.LOOSEPLAIN]}$`);ne("GTLT","((?:<|>)?=?)");ne("XRANGEIDENTIFIERLOOSE",`${z[G.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);ne("XRANGEIDENTIFIER",`${z[G.NUMERICIDENTIFIER]}|x|X|\\*`);ne("XRANGEPLAIN",`[v=\\s]*(${z[G.XRANGEIDENTIFIER]})(?:\\.(${z[G.XRANGEIDENTIFIER]})(?:\\.(${z[G.XRANGEIDENTIFIER]})(?:${z[G.PRERELEASE]})?${z[G.BUILD]}?)?)?`);ne("XRANGEPLAINLOOSE",`[v=\\s]*(${z[G.XRANGEIDENTIFIERLOOSE]})(?:\\.(${z[G.XRANGEIDENTIFIERLOOSE]})(?:\\.(${z[G.XRANGEIDENTIFIERLOOSE]})(?:${z[G.PRERELEASELOOSE]})?${z[G.BUILD]}?)?)?`);ne("XRANGE",`^${z[G.GTLT]}\\s*${z[G.XRANGEPLAIN]}$`);ne("XRANGELOOSE",`^${z[G.GTLT]}\\s*${z[G.XRANGEPLAINLOOSE]}$`);ne("COERCEPLAIN",`(^|[^\\d])(\\d{1,${fv}})(?:\\.(\\d{1,${fv}}))?(?:\\.(\\d{1,${fv}}))?`);ne("COERCE",`${z[G.COERCEPLAIN]}(?:$|[^\\d])`);ne("COERCEFULL",z[G.COERCEPLAIN]+`(?:${z[G.PRERELEASE]})?(?:${z[G.BUILD]})?(?:$|[^\\d])`);ne("COERCERTL",z[G.COERCE],!0);ne("COERCERTLFULL",z[G.COERCEFULL],!0);ne("LONETILDE","(?:~>?)");ne("TILDETRIM",`(\\s*)${z[G.LONETILDE]}\\s+`,!0);In.tildeTrimReplace="$1~";ne("TILDE",`^${z[G.LONETILDE]}${z[G.XRANGEPLAIN]}$`);ne("TILDELOOSE",`^${z[G.LONETILDE]}${z[G.XRANGEPLAINLOOSE]}$`);ne("LONECARET","(?:\\^)");ne("CARETTRIM",`(\\s*)${z[G.LONECARET]}\\s+`,!0);In.caretTrimReplace="$1^";ne("CARET",`^${z[G.LONECARET]}${z[G.XRANGEPLAIN]}$`);ne("CARETLOOSE",`^${z[G.LONECARET]}${z[G.XRANGEPLAINLOOSE]}$`);ne("COMPARATORLOOSE",`^${z[G.GTLT]}\\s*(${z[G.LOOSEPLAIN]})$|^$`);ne("COMPARATOR",`^${z[G.GTLT]}\\s*(${z[G.FULLPLAIN]})$|^$`);ne("COMPARATORTRIM",`(\\s*)${z[G.GTLT]}\\s*(${z[G.LOOSEPLAIN]}|${z[G.XRANGEPLAIN]})`,!0);In.comparatorTrimReplace="$1$2$3";ne("HYPHENRANGE",`^\\s*(${z[G.XRANGEPLAIN]})\\s+-\\s+(${z[G.XRANGEPLAIN]})\\s*$`);ne("HYPHENRANGELOOSE",`^\\s*(${z[G.XRANGEPLAINLOOSE]})\\s+-\\s+(${z[G.XRANGEPLAINLOOSE]})\\s*$`);ne("STAR","(<|>)?=?\\s*\\*");ne("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");ne("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var fh=y((Eme,i$)=>{var Ere=Object.freeze({loose:!0}),Cre=Object.freeze({}),Sre=t=>t?typeof t!="object"?Ere:t:Cre;i$.exports=Sre});var hv=y((Cme,a$)=>{var o$=/^[0-9]+$/,s$=(t,e)=>{let r=o$.test(t),n=o$.test(e);return r&&n&&(t=+t,e=+e),t===e?0:r&&!n?-1:n&&!r?1:t<e?-1:1},xre=(t,e)=>s$(e,t);a$.exports={compareIdentifiers:s$,rcompareIdentifiers:xre}});var xt=y((Sme,f$)=>{var dh=_c(),{MAX_LENGTH:u$,MAX_SAFE_INTEGER:hh}=wc(),{safeRe:c$,t:l$}=na(),Fre=fh(),{compareIdentifiers:ia}=hv(),pv=class t{constructor(e,r){if(r=Fre(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>u$)throw new TypeError(`version is longer than ${u$} characters`);dh("SemVer",e,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;let n=e.trim().match(r.loose?c$[l$.LOOSE]:c$[l$.FULL]);if(!n)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>hh||this.major<0)throw new TypeError("Invalid major version");if(this.minor>hh||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>hh||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map(i=>{if(/^[0-9]+$/.test(i)){let o=+i;if(o>=0&&o<hh)return o}return i}):this.prerelease=[],this.build=n[5]?n[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(dh("SemVer.compare",this.version,this.options,e),!(e instanceof t)){if(typeof e=="string"&&e===this.version)return 0;e=new t(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof t||(e=new t(e,this.options)),ia(this.major,e.major)||ia(this.minor,e.minor)||ia(this.patch,e.patch)}comparePre(e){if(e instanceof t||(e=new t(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let r=0;do{let n=this.prerelease[r],i=e.prerelease[r];if(dh("prerelease compare",r,n,i),n===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(n===void 0)return-1;if(n===i)continue;return ia(n,i)}while(++r)}compareBuild(e){e instanceof t||(e=new t(e,this.options));let r=0;do{let n=this.build[r],i=e.build[r];if(dh("build compare",r,n,i),n===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(n===void 0)return-1;if(n===i)continue;return ia(n,i)}while(++r)}inc(e,r,n){switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",r,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",r,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",r,n),this.inc("pre",r,n);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",r,n),this.inc("pre",r,n);break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{let i=Number(n)?1:0;if(!r&&n===!1)throw new Error("invalid increment argument: identifier is empty");if(this.prerelease.length===0)this.prerelease=[i];else{let o=this.prerelease.length;for(;--o>=0;)typeof this.prerelease[o]=="number"&&(this.prerelease[o]++,o=-2);if(o===-1){if(r===this.prerelease.join(".")&&n===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(i)}}if(r){let o=[r,i];n===!1&&(o=[r]),ia(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}};f$.exports=pv});var go=y((xme,h$)=>{var d$=xt(),Ore=(t,e,r=!1)=>{if(t instanceof d$)return t;try{return new d$(t,e)}catch(n){if(!r)return null;throw n}};h$.exports=Ore});var m$=y((Fme,p$)=>{var Are=go(),kre=(t,e)=>{let r=Are(t,e);return r?r.version:null};p$.exports=kre});var y$=y((Ome,g$)=>{var Tre=go(),Pre=(t,e)=>{let r=Tre(t.trim().replace(/^[=v]+/,""),e);return r?r.version:null};g$.exports=Pre});var b$=y((Ame,v$)=>{var D$=xt(),Rre=(t,e,r,n,i)=>{typeof r=="string"&&(i=n,n=r,r=void 0);try{return new D$(t instanceof D$?t.version:t,r).inc(e,n,i).version}catch{return null}};v$.exports=Rre});var E$=y((kme,_$)=>{var w$=go(),$re=(t,e)=>{let r=w$(t,null,!0),n=w$(e,null,!0),i=r.compare(n);if(i===0)return null;let o=i>0,s=o?r:n,a=o?n:r,u=!!s.prerelease.length;if(!!a.prerelease.length&&!u)return!a.patch&&!a.minor?"major":s.patch?"patch":s.minor?"minor":"major";let l=u?"pre":"";return r.major!==n.major?l+"major":r.minor!==n.minor?l+"minor":r.patch!==n.patch?l+"patch":"prerelease"};_$.exports=$re});var S$=y((Tme,C$)=>{var Ire=xt(),jre=(t,e)=>new Ire(t,e).major;C$.exports=jre});var F$=y((Pme,x$)=>{var Nre=xt(),Lre=(t,e)=>new Nre(t,e).minor;x$.exports=Lre});var A$=y((Rme,O$)=>{var Bre=xt(),qre=(t,e)=>new Bre(t,e).patch;O$.exports=qre});var T$=y(($me,k$)=>{var Mre=go(),Ure=(t,e)=>{let r=Mre(t,e);return r&&r.prerelease.length?r.prerelease:null};k$.exports=Ure});var _r=y((Ime,R$)=>{var P$=xt(),Vre=(t,e,r)=>new P$(t,r).compare(new P$(e,r));R$.exports=Vre});var I$=y((jme,$$)=>{var Hre=_r(),zre=(t,e,r)=>Hre(e,t,r);$$.exports=zre});var N$=y((Nme,j$)=>{var Gre=_r(),Wre=(t,e)=>Gre(t,e,!0);j$.exports=Wre});var ph=y((Lme,B$)=>{var L$=xt(),Kre=(t,e,r)=>{let n=new L$(t,r),i=new L$(e,r);return n.compare(i)||n.compareBuild(i)};B$.exports=Kre});var M$=y((Bme,q$)=>{var Yre=ph(),Jre=(t,e)=>t.sort((r,n)=>Yre(r,n,e));q$.exports=Jre});var V$=y((qme,U$)=>{var Xre=ph(),Zre=(t,e)=>t.sort((r,n)=>Xre(n,r,e));U$.exports=Zre});var Ec=y((Mme,H$)=>{var Qre=_r(),ene=(t,e,r)=>Qre(t,e,r)>0;H$.exports=ene});var mh=y((Ume,z$)=>{var tne=_r(),rne=(t,e,r)=>tne(t,e,r)<0;z$.exports=rne});var mv=y((Vme,G$)=>{var nne=_r(),ine=(t,e,r)=>nne(t,e,r)===0;G$.exports=ine});var gv=y((Hme,W$)=>{var one=_r(),sne=(t,e,r)=>one(t,e,r)!==0;W$.exports=sne});var gh=y((zme,K$)=>{var ane=_r(),une=(t,e,r)=>ane(t,e,r)>=0;K$.exports=une});var yh=y((Gme,Y$)=>{var cne=_r(),lne=(t,e,r)=>cne(t,e,r)<=0;Y$.exports=lne});var yv=y((Wme,J$)=>{var fne=mv(),dne=gv(),hne=Ec(),pne=gh(),mne=mh(),gne=yh(),yne=(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 fne(t,r,n);case"!=":return dne(t,r,n);case">":return hne(t,r,n);case">=":return pne(t,r,n);case"<":return mne(t,r,n);case"<=":return gne(t,r,n);default:throw new TypeError(`Invalid operator: ${e}`)}};J$.exports=yne});var Z$=y((Kme,X$)=>{var Dne=xt(),vne=go(),{safeRe:Dh,t:vh}=na(),bne=(t,e)=>{if(t instanceof Dne)return t;if(typeof t=="number"&&(t=String(t)),typeof t!="string")return null;e=e||{};let r=null;if(!e.rtl)r=t.match(e.includePrerelease?Dh[vh.COERCEFULL]:Dh[vh.COERCE]);else{let u=e.includePrerelease?Dh[vh.COERCERTLFULL]:Dh[vh.COERCERTL],c;for(;(c=u.exec(t))&&(!r||r.index+r[0].length!==t.length);)(!r||c.index+c[0].length!==r.index+r[0].length)&&(r=c),u.lastIndex=c.index+c[1].length+c[2].length;u.lastIndex=-1}if(r===null)return null;let n=r[2],i=r[3]||"0",o=r[4]||"0",s=e.includePrerelease&&r[5]?`-${r[5]}`:"",a=e.includePrerelease&&r[6]?`+${r[6]}`:"";return vne(`${n}.${i}.${o}${s}${a}`,e)};X$.exports=bne});var eI=y((Yme,Q$)=>{var Dv=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}};Q$.exports=Dv});var Er=y((Jme,iI)=>{var wne=/\s+/g,vv=class t{constructor(e,r){if(r=Ene(r),e instanceof t)return e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease?e:new t(e.raw,r);if(e instanceof bv)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(wne," "),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=>!rI(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&&kne(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&&One)|(this.options.loose&&Ane))+":"+e,i=tI.get(n);if(i)return i;let o=this.options.loose,s=o?Qt[$t.HYPHENRANGELOOSE]:Qt[$t.HYPHENRANGE];e=e.replace(s,qne(this.options.includePrerelease)),Re("hyphen replace",e),e=e.replace(Qt[$t.COMPARATORTRIM],Sne),Re("comparator trim",e),e=e.replace(Qt[$t.TILDETRIM],xne),Re("tilde trim",e),e=e.replace(Qt[$t.CARETTRIM],Fne),Re("caret trim",e);let a=e.split(" ").map(f=>Tne(f,this.options)).join(" ").split(/\s+/).map(f=>Bne(f,this.options));o&&(a=a.filter(f=>(Re("loose invalid filter",f,this.options),!!f.match(Qt[$t.COMPARATORLOOSE])))),Re("range list",a);let u=new Map,c=a.map(f=>new bv(f,this.options));for(let f of c){if(rI(f))return[f];u.set(f.value,f)}u.size>1&&u.has("")&&u.delete("");let l=[...u.values()];return tI.set(n,l),l}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Range is required");return this.set.some(n=>nI(n,r)&&e.set.some(i=>nI(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 Cne(e,this.options)}catch{return!1}for(let r=0;r<this.set.length;r++)if(Mne(this.set[r],e,this.options))return!0;return!1}};iI.exports=vv;var _ne=eI(),tI=new _ne,Ene=fh(),bv=Cc(),Re=_c(),Cne=xt(),{safeRe:Qt,t:$t,comparatorTrimReplace:Sne,tildeTrimReplace:xne,caretTrimReplace:Fne}=na(),{FLAG_INCLUDE_PRERELEASE:One,FLAG_LOOSE:Ane}=wc(),rI=t=>t.value==="<0.0.0-0",kne=t=>t.value==="",nI=(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},Tne=(t,e)=>(Re("comp",t,e),t=$ne(t,e),Re("caret",t),t=Pne(t,e),Re("tildes",t),t=jne(t,e),Re("xrange",t),t=Lne(t,e),Re("stars",t),t),It=t=>!t||t.toLowerCase()==="x"||t==="*",Pne=(t,e)=>t.trim().split(/\s+/).map(r=>Rne(r,e)).join(" "),Rne=(t,e)=>{let r=e.loose?Qt[$t.TILDELOOSE]:Qt[$t.TILDE];return t.replace(r,(n,i,o,s,a)=>{Re("tilde",t,n,i,o,s,a);let u;return It(i)?u="":It(o)?u=`>=${i}.0.0 <${+i+1}.0.0-0`:It(s)?u=`>=${i}.${o}.0 <${i}.${+o+1}.0-0`:a?(Re("replaceTilde pr",a),u=`>=${i}.${o}.${s}-${a} <${i}.${+o+1}.0-0`):u=`>=${i}.${o}.${s} <${i}.${+o+1}.0-0`,Re("tilde return",u),u})},$ne=(t,e)=>t.trim().split(/\s+/).map(r=>Ine(r,e)).join(" "),Ine=(t,e)=>{Re("caret",t,e);let r=e.loose?Qt[$t.CARETLOOSE]:Qt[$t.CARET],n=e.includePrerelease?"-0":"";return t.replace(r,(i,o,s,a,u)=>{Re("caret",t,i,o,s,a,u);let c;return It(o)?c="":It(s)?c=`>=${o}.0.0${n} <${+o+1}.0.0-0`:It(a)?o==="0"?c=`>=${o}.${s}.0${n} <${o}.${+s+1}.0-0`:c=`>=${o}.${s}.0${n} <${+o+1}.0.0-0`:u?(Re("replaceCaret pr",u),o==="0"?s==="0"?c=`>=${o}.${s}.${a}-${u} <${o}.${s}.${+a+1}-0`:c=`>=${o}.${s}.${a}-${u} <${o}.${+s+1}.0-0`:c=`>=${o}.${s}.${a}-${u} <${+o+1}.0.0-0`):(Re("no pr"),o==="0"?s==="0"?c=`>=${o}.${s}.${a}${n} <${o}.${s}.${+a+1}-0`:c=`>=${o}.${s}.${a}${n} <${o}.${+s+1}.0-0`:c=`>=${o}.${s}.${a} <${+o+1}.0.0-0`),Re("caret return",c),c})},jne=(t,e)=>(Re("replaceXRanges",t,e),t.split(/\s+/).map(r=>Nne(r,e)).join(" ")),Nne=(t,e)=>{t=t.trim();let r=e.loose?Qt[$t.XRANGELOOSE]:Qt[$t.XRANGE];return t.replace(r,(n,i,o,s,a,u)=>{Re("xRange",t,n,i,o,s,a,u);let c=It(o),l=c||It(s),f=l||It(a),h=f;return i==="="&&h&&(i=""),u=e.includePrerelease?"-0":"",c?i===">"||i==="<"?n="<0.0.0-0":n="*":i&&h?(l&&(s=0),a=0,i===">"?(i=">=",l?(o=+o+1,s=0,a=0):(s=+s+1,a=0)):i==="<="&&(i="<",l?o=+o+1:s=+s+1),i==="<"&&(u="-0"),n=`${i+o}.${s}.${a}${u}`):l?n=`>=${o}.0.0${u} <${+o+1}.0.0-0`:f&&(n=`>=${o}.${s}.0${u} <${o}.${+s+1}.0-0`),Re("xRange return",n),n})},Lne=(t,e)=>(Re("replaceStars",t,e),t.trim().replace(Qt[$t.STAR],"")),Bne=(t,e)=>(Re("replaceGTE0",t,e),t.trim().replace(Qt[e.includePrerelease?$t.GTE0PRE:$t.GTE0],"")),qne=t=>(e,r,n,i,o,s,a,u,c,l,f,h)=>(It(n)?r="":It(i)?r=`>=${n}.0.0${t?"-0":""}`:It(o)?r=`>=${n}.${i}.0${t?"-0":""}`:s?r=`>=${r}`:r=`>=${r}${t?"-0":""}`,It(c)?u="":It(l)?u=`<${+c+1}.0.0-0`:It(f)?u=`<${c}.${+l+1}.0-0`:h?u=`<=${c}.${l}.${f}-${h}`:t?u=`<${c}.${l}.${+f+1}-0`:u=`<=${u}`,`${r} ${u}`.trim()),Mne=(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(Re(t[n].semver),t[n].semver!==bv.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 Cc=y((Xme,lI)=>{var Sc=Symbol("SemVer ANY"),Ev=class t{static get ANY(){return Sc}constructor(e,r){if(r=oI(r),e instanceof t){if(e.loose===!!r.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),_v("comparator",e,r),this.options=r,this.loose=!!r.loose,this.parse(e),this.semver===Sc?this.value="":this.value=this.operator+this.semver.version,_v("comp",this)}parse(e){let r=this.options.loose?sI[aI.COMPARATORLOOSE]:sI[aI.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 uI(n[2],this.options.loose):this.semver=Sc}toString(){return this.value}test(e){if(_v("Comparator.test",e,this.options.loose),this.semver===Sc||e===Sc)return!0;if(typeof e=="string")try{e=new uI(e,this.options)}catch{return!1}return wv(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 cI(e.value,r).test(this.value):e.operator===""?e.value===""?!0:new cI(this.value,r).test(e.semver):(r=oI(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("=")||wv(this.semver,"<",e.semver,r)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||wv(this.semver,">",e.semver,r)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}};lI.exports=Ev;var oI=fh(),{safeRe:sI,t:aI}=na(),wv=yv(),_v=_c(),uI=xt(),cI=Er()});var xc=y((Zme,fI)=>{var Une=Er(),Vne=(t,e,r)=>{try{e=new Une(e,r)}catch{return!1}return e.test(t)};fI.exports=Vne});var hI=y((Qme,dI)=>{var Hne=Er(),zne=(t,e)=>new Hne(t,e).set.map(r=>r.map(n=>n.value).join(" ").trim().split(" "));dI.exports=zne});var mI=y((ege,pI)=>{var Gne=xt(),Wne=Er(),Kne=(t,e,r)=>{let n=null,i=null,o=null;try{o=new Wne(e,r)}catch{return null}return t.forEach(s=>{o.test(s)&&(!n||i.compare(s)===-1)&&(n=s,i=new Gne(n,r))}),n};pI.exports=Kne});var yI=y((tge,gI)=>{var Yne=xt(),Jne=Er(),Xne=(t,e,r)=>{let n=null,i=null,o=null;try{o=new Jne(e,r)}catch{return null}return t.forEach(s=>{o.test(s)&&(!n||i.compare(s)===1)&&(n=s,i=new Yne(n,r))}),n};gI.exports=Xne});var bI=y((rge,vI)=>{var Cv=xt(),Zne=Er(),DI=Ec(),Qne=(t,e)=>{t=new Zne(t,e);let r=new Cv("0.0.0");if(t.test(r)||(r=new Cv("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 Cv(s.semver.version);switch(s.operator){case">":a.prerelease.length===0?a.patch++:a.prerelease.push(0),a.raw=a.format();case"":case">=":(!o||DI(a,o))&&(o=a);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${s.operator}`)}}),o&&(!r||DI(r,o))&&(r=o)}return r&&t.test(r)?r:null};vI.exports=Qne});var _I=y((nge,wI)=>{var eie=Er(),tie=(t,e)=>{try{return new eie(t,e).range||"*"}catch{return null}};wI.exports=tie});var bh=y((ige,xI)=>{var rie=xt(),SI=Cc(),{ANY:nie}=SI,iie=Er(),oie=xc(),EI=Ec(),CI=mh(),sie=yh(),aie=gh(),uie=(t,e,r,n)=>{t=new rie(t,n),e=new iie(e,n);let i,o,s,a,u;switch(r){case">":i=EI,o=sie,s=CI,a=">",u=">=";break;case"<":i=CI,o=aie,s=EI,a="<",u="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(oie(t,e,n))return!1;for(let c=0;c<e.set.length;++c){let l=e.set[c],f=null,h=null;if(l.forEach(d=>{d.semver===nie&&(d=new SI(">=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};xI.exports=uie});var OI=y((oge,FI)=>{var cie=bh(),lie=(t,e,r)=>cie(t,e,">",r);FI.exports=lie});var kI=y((sge,AI)=>{var fie=bh(),die=(t,e,r)=>fie(t,e,"<",r);AI.exports=die});var RI=y((age,PI)=>{var TI=Er(),hie=(t,e,r)=>(t=new TI(t,r),e=new TI(e,r),t.intersects(e,r));PI.exports=hie});var II=y((uge,$I)=>{var pie=xc(),mie=_r();$I.exports=(t,e,r)=>{let n=[],i=null,o=null,s=t.sort((l,f)=>mie(l,f,r));for(let l of s)pie(l,e,r)?(o=l,i||(i=l)):(o&&n.push([i,o]),o=null,i=null);i&&n.push([i,null]);let a=[];for(let[l,f]of n)l===f?a.push(l):!f&&l===s[0]?a.push("*"):f?l===s[0]?a.push(`<=${f}`):a.push(`${l} - ${f}`):a.push(`>=${l}`);let u=a.join(" || "),c=typeof e.raw=="string"?e.raw:String(e);return u.length<c.length?u:e}});var MI=y((cge,qI)=>{var jI=Er(),xv=Cc(),{ANY:Sv}=xv,Fc=xc(),Fv=_r(),gie=(t,e,r={})=>{if(t===e)return!0;t=new jI(t,r),e=new jI(e,r);let n=!1;e:for(let i of t.set){for(let o of e.set){let s=Die(i,o,r);if(n=n||s!==null,s)continue e}if(n)return!1}return!0},yie=[new xv(">=0.0.0-0")],NI=[new xv(">=0.0.0")],Die=(t,e,r)=>{if(t===e)return!0;if(t.length===1&&t[0].semver===Sv){if(e.length===1&&e[0].semver===Sv)return!0;r.includePrerelease?t=yie:t=NI}if(e.length===1&&e[0].semver===Sv){if(r.includePrerelease)return!0;e=NI}let n=new Set,i,o;for(let d of t)d.operator===">"||d.operator===">="?i=LI(i,d,r):d.operator==="<"||d.operator==="<="?o=BI(o,d,r):n.add(d.semver);if(n.size>1)return null;let s;if(i&&o){if(s=Fv(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&&!Fc(d,String(i),r)||o&&!Fc(d,String(o),r))return null;for(let m of e)if(!Fc(d,String(m),r))return!1;return!0}let a,u,c,l,f=o&&!r.includePrerelease&&o.semver.prerelease.length?o.semver:!1,h=i&&!r.includePrerelease&&i.semver.prerelease.length?i.semver:!1;f&&f.prerelease.length===1&&o.operator==="<"&&f.prerelease[0]===0&&(f=!1);for(let d of e){if(l=l||d.operator===">"||d.operator===">=",c=c||d.operator==="<"||d.operator==="<=",i){if(h&&d.semver.prerelease&&d.semver.prerelease.length&&d.semver.major===h.major&&d.semver.minor===h.minor&&d.semver.patch===h.patch&&(h=!1),d.operator===">"||d.operator===">="){if(a=LI(i,d,r),a===d&&a!==i)return!1}else if(i.operator===">="&&!Fc(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=BI(o,d,r),u===d&&u!==o)return!1}else if(o.operator==="<="&&!Fc(o.semver,String(d),r))return!1}if(!d.operator&&(o||i)&&s!==0)return!1}return!(i&&c&&!o&&s!==0||o&&l&&!i&&s!==0||h||f)},LI=(t,e,r)=>{if(!t)return e;let n=Fv(t.semver,e.semver,r);return n>0?t:n<0||e.operator===">"&&t.operator===">="?e:t},BI=(t,e,r)=>{if(!t)return e;let n=Fv(t.semver,e.semver,r);return n<0?t:n>0||e.operator==="<"&&t.operator==="<="?e:t};qI.exports=gie});var Av=y((lge,HI)=>{var Ov=na(),UI=wc(),vie=xt(),VI=hv(),bie=go(),wie=m$(),_ie=y$(),Eie=b$(),Cie=E$(),Sie=S$(),xie=F$(),Fie=A$(),Oie=T$(),Aie=_r(),kie=I$(),Tie=N$(),Pie=ph(),Rie=M$(),$ie=V$(),Iie=Ec(),jie=mh(),Nie=mv(),Lie=gv(),Bie=gh(),qie=yh(),Mie=yv(),Uie=Z$(),Vie=Cc(),Hie=Er(),zie=xc(),Gie=hI(),Wie=mI(),Kie=yI(),Yie=bI(),Jie=_I(),Xie=bh(),Zie=OI(),Qie=kI(),eoe=RI(),toe=II(),roe=MI();HI.exports={parse:bie,valid:wie,clean:_ie,inc:Eie,diff:Cie,major:Sie,minor:xie,patch:Fie,prerelease:Oie,compare:Aie,rcompare:kie,compareLoose:Tie,compareBuild:Pie,sort:Rie,rsort:$ie,gt:Iie,lt:jie,eq:Nie,neq:Lie,gte:Bie,lte:qie,cmp:Mie,coerce:Uie,Comparator:Vie,Range:Hie,satisfies:zie,toComparators:Gie,maxSatisfying:Wie,minSatisfying:Kie,minVersion:Yie,validRange:Jie,outside:Xie,gtr:Zie,ltr:Qie,intersects:eoe,simplifyRange:toe,subset:roe,SemVer:vie,re:Ov.re,src:Ov.src,tokens:Ov.t,SEMVER_SPEC_VERSION:UI.SEMVER_SPEC_VERSION,RELEASE_TYPES:UI.RELEASE_TYPES,compareIdentifiers:VI.compareIdentifiers,rcompareIdentifiers:VI.rcompareIdentifiers}});var r6=y(W=>{"use strict";Object.defineProperty(W,"__esModule",{value:!0});W.parseApkNameFromFlavor=W.checkJDKMajorVersion=W.resolvePlatform=W.checkPlatformVersions=W.getAddedPlatforms=W.getPlatformTargetName=W.promptForPlatformTarget=W.promptForPlatform=W.isValidEnterprisePlatform=W.getKnownEnterprisePlatforms=W.isValidCommunityPlatform=W.getKnownCommunityPlatforms=W.isValidPlatform=W.getKnownPlatforms=W.selectPlatforms=W.getProjectPlatformDirectory=W.getCLIVersion=W.getCoreVersion=W.getCapacitorPackageVersion=W.requireCapacitorPackage=W.getCapacitorPackage=W.runTask=W.runPlatformHook=W.runHooks=W.wait=W.checkAppName=W.checkAppId=W.checkAppDir=W.checkAppConfig=W.checkCapacitorPlatform=W.checkPackage=W.checkWebDir=W.check=void 0;var Ac=(Cn(),Ae(En)),gi=qs(),zI=zD(),yo=require("path"),Ce=Ac.__importDefault(Hs()),oa=Hd(),WI=uc(),noe=XR(),GI=dl(),Oc=ch(),ioe=lh();async function ooe(t){let r=(await Promise.all(t.map(n=>n()))).filter(n=>n!=null);if(r.length>0)throw r.join(`
166
- `)}W.check=ooe;async function soe(t){var e;return!((e=t.app.extConfig.server)===null||e===void 0)&&e.url?null:["",".","..","../","./"].includes(t.app.webDir)?`"${t.app.webDir}" is not a valid value for webDir`:await(0,gi.pathExists)(t.app.webDirAbs)?await(0,gi.pathExists)((0,yo.join)(t.app.webDirAbs,"index.html"))?null:`The web assets directory (${Ce.default.strong((0,zI.prettyPath)(t.app.webDirAbs))}) must contain an ${Ce.default.strong("index.html")} file.
167
- 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,zI.prettyPath)(t.app.webDirAbs))}.
165
+ `),Xte.logger.info(n)}Ee.printPlugins=ere;function uv(t,e){return t.xml.platform?t.xml.platform.filter(function(i){return i.$.name===e})[0]:[]}Ee.getPluginPlatform=uv;function tre(t,e,r){let n=uv(t,e);if(n){let i=n[r];if(i)return i}return[]}Ee.getPlatformElement=tre;function rre(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=rre;function nre(t,e){return cv(t,e,"js-module")}Ee.getJSModules=nre;function ire(t,e){return cv(t,e,"asset")}Ee.getAssets=ire;function ore(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,GR.resolveNode)(t.app.rootDir,...n);if(!i)throw new Error(`Can't resolve module ${n[0]}`);return i}return(0,sv.join)(e.rootPath,r)}Ee.getFilePath=ore;function cv(t,e,r){let n=[];t.xml[r]&&(n=n.concat(t.xml[r]));let i=uv(t,e);return i?.[r]&&(n=n.concat(i[r])),n}Ee.getAllElements=cv});var XR={};mn(XR,{default:()=>sre});var sre,ZR=ct(()=>{sre={}});var lh=y(mi=>{"use strict";Object.defineProperty(mi,"__esModule",{value:!0});mi.isInstalled=mi.getCommandOutput=mi.runCommand=void 0;var lv=(ZR(),Ae(XR));async function QR(t,e,r={}){let n=new lv.Subprocess(t,e,r);try{return await n.output()}catch(i){throw i instanceof lv.SubprocessError?i.output?i.output:i.code?i.code:i.error?i.error.message:"Unknown error":i}}mi.runCommand=QR;async function are(t,e,r={}){try{return(await QR(t,e,r)).trim()}catch{return null}}mi.getCommandOutput=are;async function ure(t){try{await(0,lv.which)(t)}catch{return!1}return!0}mi.isInstalled=ure});var wc=y((wme,e$)=>{var cre="2.0.0",lre=Number.MAX_SAFE_INTEGER||9007199254740991,fre=16,dre=250,hre=["major","premajor","minor","preminor","patch","prepatch","prerelease"];e$.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:fre,MAX_SAFE_BUILD_LENGTH:dre,MAX_SAFE_INTEGER:lre,RELEASE_TYPES:hre,SEMVER_SPEC_VERSION:cre,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var _c=y((_me,t$)=>{var pre=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{};t$.exports=pre});var na=y((In,r$)=>{var{MAX_SAFE_COMPONENT_LENGTH:fv,MAX_SAFE_BUILD_LENGTH:mre,MAX_LENGTH:gre}=wc(),yre=_c();In=r$.exports={};var Dre=In.re=[],vre=In.safeRe=[],z=In.src=[],G=In.t={},bre=0,dv="[a-zA-Z0-9-]",wre=[["\\s",1],["\\d",gre],[dv,mre]],_re=t=>{for(let[e,r]of wre)t=t.split(`${e}*`).join(`${e}{0,${r}}`).split(`${e}+`).join(`${e}{1,${r}}`);return t},ne=(t,e,r)=>{let n=_re(e),i=bre++;yre(t,i,e),G[t]=i,z[i]=e,Dre[i]=new RegExp(e,r?"g":void 0),vre[i]=new RegExp(n,r?"g":void 0)};ne("NUMERICIDENTIFIER","0|[1-9]\\d*");ne("NUMERICIDENTIFIERLOOSE","\\d+");ne("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${dv}*`);ne("MAINVERSION",`(${z[G.NUMERICIDENTIFIER]})\\.(${z[G.NUMERICIDENTIFIER]})\\.(${z[G.NUMERICIDENTIFIER]})`);ne("MAINVERSIONLOOSE",`(${z[G.NUMERICIDENTIFIERLOOSE]})\\.(${z[G.NUMERICIDENTIFIERLOOSE]})\\.(${z[G.NUMERICIDENTIFIERLOOSE]})`);ne("PRERELEASEIDENTIFIER",`(?:${z[G.NUMERICIDENTIFIER]}|${z[G.NONNUMERICIDENTIFIER]})`);ne("PRERELEASEIDENTIFIERLOOSE",`(?:${z[G.NUMERICIDENTIFIERLOOSE]}|${z[G.NONNUMERICIDENTIFIER]})`);ne("PRERELEASE",`(?:-(${z[G.PRERELEASEIDENTIFIER]}(?:\\.${z[G.PRERELEASEIDENTIFIER]})*))`);ne("PRERELEASELOOSE",`(?:-?(${z[G.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${z[G.PRERELEASEIDENTIFIERLOOSE]})*))`);ne("BUILDIDENTIFIER",`${dv}+`);ne("BUILD",`(?:\\+(${z[G.BUILDIDENTIFIER]}(?:\\.${z[G.BUILDIDENTIFIER]})*))`);ne("FULLPLAIN",`v?${z[G.MAINVERSION]}${z[G.PRERELEASE]}?${z[G.BUILD]}?`);ne("FULL",`^${z[G.FULLPLAIN]}$`);ne("LOOSEPLAIN",`[v=\\s]*${z[G.MAINVERSIONLOOSE]}${z[G.PRERELEASELOOSE]}?${z[G.BUILD]}?`);ne("LOOSE",`^${z[G.LOOSEPLAIN]}$`);ne("GTLT","((?:<|>)?=?)");ne("XRANGEIDENTIFIERLOOSE",`${z[G.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);ne("XRANGEIDENTIFIER",`${z[G.NUMERICIDENTIFIER]}|x|X|\\*`);ne("XRANGEPLAIN",`[v=\\s]*(${z[G.XRANGEIDENTIFIER]})(?:\\.(${z[G.XRANGEIDENTIFIER]})(?:\\.(${z[G.XRANGEIDENTIFIER]})(?:${z[G.PRERELEASE]})?${z[G.BUILD]}?)?)?`);ne("XRANGEPLAINLOOSE",`[v=\\s]*(${z[G.XRANGEIDENTIFIERLOOSE]})(?:\\.(${z[G.XRANGEIDENTIFIERLOOSE]})(?:\\.(${z[G.XRANGEIDENTIFIERLOOSE]})(?:${z[G.PRERELEASELOOSE]})?${z[G.BUILD]}?)?)?`);ne("XRANGE",`^${z[G.GTLT]}\\s*${z[G.XRANGEPLAIN]}$`);ne("XRANGELOOSE",`^${z[G.GTLT]}\\s*${z[G.XRANGEPLAINLOOSE]}$`);ne("COERCEPLAIN",`(^|[^\\d])(\\d{1,${fv}})(?:\\.(\\d{1,${fv}}))?(?:\\.(\\d{1,${fv}}))?`);ne("COERCE",`${z[G.COERCEPLAIN]}(?:$|[^\\d])`);ne("COERCEFULL",z[G.COERCEPLAIN]+`(?:${z[G.PRERELEASE]})?(?:${z[G.BUILD]})?(?:$|[^\\d])`);ne("COERCERTL",z[G.COERCE],!0);ne("COERCERTLFULL",z[G.COERCEFULL],!0);ne("LONETILDE","(?:~>?)");ne("TILDETRIM",`(\\s*)${z[G.LONETILDE]}\\s+`,!0);In.tildeTrimReplace="$1~";ne("TILDE",`^${z[G.LONETILDE]}${z[G.XRANGEPLAIN]}$`);ne("TILDELOOSE",`^${z[G.LONETILDE]}${z[G.XRANGEPLAINLOOSE]}$`);ne("LONECARET","(?:\\^)");ne("CARETTRIM",`(\\s*)${z[G.LONECARET]}\\s+`,!0);In.caretTrimReplace="$1^";ne("CARET",`^${z[G.LONECARET]}${z[G.XRANGEPLAIN]}$`);ne("CARETLOOSE",`^${z[G.LONECARET]}${z[G.XRANGEPLAINLOOSE]}$`);ne("COMPARATORLOOSE",`^${z[G.GTLT]}\\s*(${z[G.LOOSEPLAIN]})$|^$`);ne("COMPARATOR",`^${z[G.GTLT]}\\s*(${z[G.FULLPLAIN]})$|^$`);ne("COMPARATORTRIM",`(\\s*)${z[G.GTLT]}\\s*(${z[G.LOOSEPLAIN]}|${z[G.XRANGEPLAIN]})`,!0);In.comparatorTrimReplace="$1$2$3";ne("HYPHENRANGE",`^\\s*(${z[G.XRANGEPLAIN]})\\s+-\\s+(${z[G.XRANGEPLAIN]})\\s*$`);ne("HYPHENRANGELOOSE",`^\\s*(${z[G.XRANGEPLAINLOOSE]})\\s+-\\s+(${z[G.XRANGEPLAINLOOSE]})\\s*$`);ne("STAR","(<|>)?=?\\s*\\*");ne("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");ne("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var fh=y((Eme,n$)=>{var Ere=Object.freeze({loose:!0}),Cre=Object.freeze({}),Sre=t=>t?typeof t!="object"?Ere:t:Cre;n$.exports=Sre});var hv=y((Cme,s$)=>{var i$=/^[0-9]+$/,o$=(t,e)=>{let r=i$.test(t),n=i$.test(e);return r&&n&&(t=+t,e=+e),t===e?0:r&&!n?-1:n&&!r?1:t<e?-1:1},xre=(t,e)=>o$(e,t);s$.exports={compareIdentifiers:o$,rcompareIdentifiers:xre}});var xt=y((Sme,l$)=>{var dh=_c(),{MAX_LENGTH:a$,MAX_SAFE_INTEGER:hh}=wc(),{safeRe:u$,t:c$}=na(),Fre=fh(),{compareIdentifiers:ia}=hv(),pv=class t{constructor(e,r){if(r=Fre(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>a$)throw new TypeError(`version is longer than ${a$} characters`);dh("SemVer",e,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;let n=e.trim().match(r.loose?u$[c$.LOOSE]:u$[c$.FULL]);if(!n)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>hh||this.major<0)throw new TypeError("Invalid major version");if(this.minor>hh||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>hh||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map(i=>{if(/^[0-9]+$/.test(i)){let o=+i;if(o>=0&&o<hh)return o}return i}):this.prerelease=[],this.build=n[5]?n[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(dh("SemVer.compare",this.version,this.options,e),!(e instanceof t)){if(typeof e=="string"&&e===this.version)return 0;e=new t(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof t||(e=new t(e,this.options)),ia(this.major,e.major)||ia(this.minor,e.minor)||ia(this.patch,e.patch)}comparePre(e){if(e instanceof t||(e=new t(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let r=0;do{let n=this.prerelease[r],i=e.prerelease[r];if(dh("prerelease compare",r,n,i),n===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(n===void 0)return-1;if(n===i)continue;return ia(n,i)}while(++r)}compareBuild(e){e instanceof t||(e=new t(e,this.options));let r=0;do{let n=this.build[r],i=e.build[r];if(dh("build compare",r,n,i),n===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(n===void 0)return-1;if(n===i)continue;return ia(n,i)}while(++r)}inc(e,r,n){switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",r,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",r,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",r,n),this.inc("pre",r,n);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",r,n),this.inc("pre",r,n);break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{let i=Number(n)?1:0;if(!r&&n===!1)throw new Error("invalid increment argument: identifier is empty");if(this.prerelease.length===0)this.prerelease=[i];else{let o=this.prerelease.length;for(;--o>=0;)typeof this.prerelease[o]=="number"&&(this.prerelease[o]++,o=-2);if(o===-1){if(r===this.prerelease.join(".")&&n===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(i)}}if(r){let o=[r,i];n===!1&&(o=[r]),ia(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}};l$.exports=pv});var go=y((xme,d$)=>{var f$=xt(),Ore=(t,e,r=!1)=>{if(t instanceof f$)return t;try{return new f$(t,e)}catch(n){if(!r)return null;throw n}};d$.exports=Ore});var p$=y((Fme,h$)=>{var Are=go(),kre=(t,e)=>{let r=Are(t,e);return r?r.version:null};h$.exports=kre});var g$=y((Ome,m$)=>{var Tre=go(),Pre=(t,e)=>{let r=Tre(t.trim().replace(/^[=v]+/,""),e);return r?r.version:null};m$.exports=Pre});var v$=y((Ame,D$)=>{var y$=xt(),Rre=(t,e,r,n,i)=>{typeof r=="string"&&(i=n,n=r,r=void 0);try{return new y$(t instanceof y$?t.version:t,r).inc(e,n,i).version}catch{return null}};D$.exports=Rre});var _$=y((kme,w$)=>{var b$=go(),$re=(t,e)=>{let r=b$(t,null,!0),n=b$(e,null,!0),i=r.compare(n);if(i===0)return null;let o=i>0,s=o?r:n,a=o?n:r,u=!!s.prerelease.length;if(!!a.prerelease.length&&!u)return!a.patch&&!a.minor?"major":s.patch?"patch":s.minor?"minor":"major";let l=u?"pre":"";return r.major!==n.major?l+"major":r.minor!==n.minor?l+"minor":r.patch!==n.patch?l+"patch":"prerelease"};w$.exports=$re});var C$=y((Tme,E$)=>{var Ire=xt(),jre=(t,e)=>new Ire(t,e).major;E$.exports=jre});var x$=y((Pme,S$)=>{var Nre=xt(),Lre=(t,e)=>new Nre(t,e).minor;S$.exports=Lre});var O$=y((Rme,F$)=>{var Bre=xt(),qre=(t,e)=>new Bre(t,e).patch;F$.exports=qre});var k$=y(($me,A$)=>{var Mre=go(),Ure=(t,e)=>{let r=Mre(t,e);return r&&r.prerelease.length?r.prerelease:null};A$.exports=Ure});var _r=y((Ime,P$)=>{var T$=xt(),Vre=(t,e,r)=>new T$(t,r).compare(new T$(e,r));P$.exports=Vre});var $$=y((jme,R$)=>{var Hre=_r(),zre=(t,e,r)=>Hre(e,t,r);R$.exports=zre});var j$=y((Nme,I$)=>{var Gre=_r(),Wre=(t,e)=>Gre(t,e,!0);I$.exports=Wre});var ph=y((Lme,L$)=>{var N$=xt(),Kre=(t,e,r)=>{let n=new N$(t,r),i=new N$(e,r);return n.compare(i)||n.compareBuild(i)};L$.exports=Kre});var q$=y((Bme,B$)=>{var Yre=ph(),Jre=(t,e)=>t.sort((r,n)=>Yre(r,n,e));B$.exports=Jre});var U$=y((qme,M$)=>{var Xre=ph(),Zre=(t,e)=>t.sort((r,n)=>Xre(n,r,e));M$.exports=Zre});var Ec=y((Mme,V$)=>{var Qre=_r(),ene=(t,e,r)=>Qre(t,e,r)>0;V$.exports=ene});var mh=y((Ume,H$)=>{var tne=_r(),rne=(t,e,r)=>tne(t,e,r)<0;H$.exports=rne});var mv=y((Vme,z$)=>{var nne=_r(),ine=(t,e,r)=>nne(t,e,r)===0;z$.exports=ine});var gv=y((Hme,G$)=>{var one=_r(),sne=(t,e,r)=>one(t,e,r)!==0;G$.exports=sne});var gh=y((zme,W$)=>{var ane=_r(),une=(t,e,r)=>ane(t,e,r)>=0;W$.exports=une});var yh=y((Gme,K$)=>{var cne=_r(),lne=(t,e,r)=>cne(t,e,r)<=0;K$.exports=lne});var yv=y((Wme,Y$)=>{var fne=mv(),dne=gv(),hne=Ec(),pne=gh(),mne=mh(),gne=yh(),yne=(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 fne(t,r,n);case"!=":return dne(t,r,n);case">":return hne(t,r,n);case">=":return pne(t,r,n);case"<":return mne(t,r,n);case"<=":return gne(t,r,n);default:throw new TypeError(`Invalid operator: ${e}`)}};Y$.exports=yne});var X$=y((Kme,J$)=>{var Dne=xt(),vne=go(),{safeRe:Dh,t:vh}=na(),bne=(t,e)=>{if(t instanceof Dne)return t;if(typeof t=="number"&&(t=String(t)),typeof t!="string")return null;e=e||{};let r=null;if(!e.rtl)r=t.match(e.includePrerelease?Dh[vh.COERCEFULL]:Dh[vh.COERCE]);else{let u=e.includePrerelease?Dh[vh.COERCERTLFULL]:Dh[vh.COERCERTL],c;for(;(c=u.exec(t))&&(!r||r.index+r[0].length!==t.length);)(!r||c.index+c[0].length!==r.index+r[0].length)&&(r=c),u.lastIndex=c.index+c[1].length+c[2].length;u.lastIndex=-1}if(r===null)return null;let n=r[2],i=r[3]||"0",o=r[4]||"0",s=e.includePrerelease&&r[5]?`-${r[5]}`:"",a=e.includePrerelease&&r[6]?`+${r[6]}`:"";return vne(`${n}.${i}.${o}${s}${a}`,e)};J$.exports=bne});var Q$=y((Yme,Z$)=>{var Dv=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}};Z$.exports=Dv});var Er=y((Jme,nI)=>{var wne=/\s+/g,vv=class t{constructor(e,r){if(r=Ene(r),e instanceof t)return e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease?e:new t(e.raw,r);if(e instanceof bv)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(wne," "),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=>!tI(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&&kne(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&&One)|(this.options.loose&&Ane))+":"+e,i=eI.get(n);if(i)return i;let o=this.options.loose,s=o?Qt[$t.HYPHENRANGELOOSE]:Qt[$t.HYPHENRANGE];e=e.replace(s,qne(this.options.includePrerelease)),Re("hyphen replace",e),e=e.replace(Qt[$t.COMPARATORTRIM],Sne),Re("comparator trim",e),e=e.replace(Qt[$t.TILDETRIM],xne),Re("tilde trim",e),e=e.replace(Qt[$t.CARETTRIM],Fne),Re("caret trim",e);let a=e.split(" ").map(f=>Tne(f,this.options)).join(" ").split(/\s+/).map(f=>Bne(f,this.options));o&&(a=a.filter(f=>(Re("loose invalid filter",f,this.options),!!f.match(Qt[$t.COMPARATORLOOSE])))),Re("range list",a);let u=new Map,c=a.map(f=>new bv(f,this.options));for(let f of c){if(tI(f))return[f];u.set(f.value,f)}u.size>1&&u.has("")&&u.delete("");let l=[...u.values()];return eI.set(n,l),l}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Range is required");return this.set.some(n=>rI(n,r)&&e.set.some(i=>rI(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 Cne(e,this.options)}catch{return!1}for(let r=0;r<this.set.length;r++)if(Mne(this.set[r],e,this.options))return!0;return!1}};nI.exports=vv;var _ne=Q$(),eI=new _ne,Ene=fh(),bv=Cc(),Re=_c(),Cne=xt(),{safeRe:Qt,t:$t,comparatorTrimReplace:Sne,tildeTrimReplace:xne,caretTrimReplace:Fne}=na(),{FLAG_INCLUDE_PRERELEASE:One,FLAG_LOOSE:Ane}=wc(),tI=t=>t.value==="<0.0.0-0",kne=t=>t.value==="",rI=(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},Tne=(t,e)=>(Re("comp",t,e),t=$ne(t,e),Re("caret",t),t=Pne(t,e),Re("tildes",t),t=jne(t,e),Re("xrange",t),t=Lne(t,e),Re("stars",t),t),It=t=>!t||t.toLowerCase()==="x"||t==="*",Pne=(t,e)=>t.trim().split(/\s+/).map(r=>Rne(r,e)).join(" "),Rne=(t,e)=>{let r=e.loose?Qt[$t.TILDELOOSE]:Qt[$t.TILDE];return t.replace(r,(n,i,o,s,a)=>{Re("tilde",t,n,i,o,s,a);let u;return It(i)?u="":It(o)?u=`>=${i}.0.0 <${+i+1}.0.0-0`:It(s)?u=`>=${i}.${o}.0 <${i}.${+o+1}.0-0`:a?(Re("replaceTilde pr",a),u=`>=${i}.${o}.${s}-${a} <${i}.${+o+1}.0-0`):u=`>=${i}.${o}.${s} <${i}.${+o+1}.0-0`,Re("tilde return",u),u})},$ne=(t,e)=>t.trim().split(/\s+/).map(r=>Ine(r,e)).join(" "),Ine=(t,e)=>{Re("caret",t,e);let r=e.loose?Qt[$t.CARETLOOSE]:Qt[$t.CARET],n=e.includePrerelease?"-0":"";return t.replace(r,(i,o,s,a,u)=>{Re("caret",t,i,o,s,a,u);let c;return It(o)?c="":It(s)?c=`>=${o}.0.0${n} <${+o+1}.0.0-0`:It(a)?o==="0"?c=`>=${o}.${s}.0${n} <${o}.${+s+1}.0-0`:c=`>=${o}.${s}.0${n} <${+o+1}.0.0-0`:u?(Re("replaceCaret pr",u),o==="0"?s==="0"?c=`>=${o}.${s}.${a}-${u} <${o}.${s}.${+a+1}-0`:c=`>=${o}.${s}.${a}-${u} <${o}.${+s+1}.0-0`:c=`>=${o}.${s}.${a}-${u} <${+o+1}.0.0-0`):(Re("no pr"),o==="0"?s==="0"?c=`>=${o}.${s}.${a}${n} <${o}.${s}.${+a+1}-0`:c=`>=${o}.${s}.${a}${n} <${o}.${+s+1}.0-0`:c=`>=${o}.${s}.${a} <${+o+1}.0.0-0`),Re("caret return",c),c})},jne=(t,e)=>(Re("replaceXRanges",t,e),t.split(/\s+/).map(r=>Nne(r,e)).join(" ")),Nne=(t,e)=>{t=t.trim();let r=e.loose?Qt[$t.XRANGELOOSE]:Qt[$t.XRANGE];return t.replace(r,(n,i,o,s,a,u)=>{Re("xRange",t,n,i,o,s,a,u);let c=It(o),l=c||It(s),f=l||It(a),h=f;return i==="="&&h&&(i=""),u=e.includePrerelease?"-0":"",c?i===">"||i==="<"?n="<0.0.0-0":n="*":i&&h?(l&&(s=0),a=0,i===">"?(i=">=",l?(o=+o+1,s=0,a=0):(s=+s+1,a=0)):i==="<="&&(i="<",l?o=+o+1:s=+s+1),i==="<"&&(u="-0"),n=`${i+o}.${s}.${a}${u}`):l?n=`>=${o}.0.0${u} <${+o+1}.0.0-0`:f&&(n=`>=${o}.${s}.0${u} <${o}.${+s+1}.0-0`),Re("xRange return",n),n})},Lne=(t,e)=>(Re("replaceStars",t,e),t.trim().replace(Qt[$t.STAR],"")),Bne=(t,e)=>(Re("replaceGTE0",t,e),t.trim().replace(Qt[e.includePrerelease?$t.GTE0PRE:$t.GTE0],"")),qne=t=>(e,r,n,i,o,s,a,u,c,l,f,h)=>(It(n)?r="":It(i)?r=`>=${n}.0.0${t?"-0":""}`:It(o)?r=`>=${n}.${i}.0${t?"-0":""}`:s?r=`>=${r}`:r=`>=${r}${t?"-0":""}`,It(c)?u="":It(l)?u=`<${+c+1}.0.0-0`:It(f)?u=`<${c}.${+l+1}.0-0`:h?u=`<=${c}.${l}.${f}-${h}`:t?u=`<${c}.${l}.${+f+1}-0`:u=`<=${u}`,`${r} ${u}`.trim()),Mne=(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(Re(t[n].semver),t[n].semver!==bv.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 Cc=y((Xme,cI)=>{var Sc=Symbol("SemVer ANY"),Ev=class t{static get ANY(){return Sc}constructor(e,r){if(r=iI(r),e instanceof t){if(e.loose===!!r.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),_v("comparator",e,r),this.options=r,this.loose=!!r.loose,this.parse(e),this.semver===Sc?this.value="":this.value=this.operator+this.semver.version,_v("comp",this)}parse(e){let r=this.options.loose?oI[sI.COMPARATORLOOSE]:oI[sI.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 aI(n[2],this.options.loose):this.semver=Sc}toString(){return this.value}test(e){if(_v("Comparator.test",e,this.options.loose),this.semver===Sc||e===Sc)return!0;if(typeof e=="string")try{e=new aI(e,this.options)}catch{return!1}return wv(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 uI(e.value,r).test(this.value):e.operator===""?e.value===""?!0:new uI(this.value,r).test(e.semver):(r=iI(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("=")||wv(this.semver,"<",e.semver,r)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||wv(this.semver,">",e.semver,r)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}};cI.exports=Ev;var iI=fh(),{safeRe:oI,t:sI}=na(),wv=yv(),_v=_c(),aI=xt(),uI=Er()});var xc=y((Zme,lI)=>{var Une=Er(),Vne=(t,e,r)=>{try{e=new Une(e,r)}catch{return!1}return e.test(t)};lI.exports=Vne});var dI=y((Qme,fI)=>{var Hne=Er(),zne=(t,e)=>new Hne(t,e).set.map(r=>r.map(n=>n.value).join(" ").trim().split(" "));fI.exports=zne});var pI=y((ege,hI)=>{var Gne=xt(),Wne=Er(),Kne=(t,e,r)=>{let n=null,i=null,o=null;try{o=new Wne(e,r)}catch{return null}return t.forEach(s=>{o.test(s)&&(!n||i.compare(s)===-1)&&(n=s,i=new Gne(n,r))}),n};hI.exports=Kne});var gI=y((tge,mI)=>{var Yne=xt(),Jne=Er(),Xne=(t,e,r)=>{let n=null,i=null,o=null;try{o=new Jne(e,r)}catch{return null}return t.forEach(s=>{o.test(s)&&(!n||i.compare(s)===1)&&(n=s,i=new Yne(n,r))}),n};mI.exports=Xne});var vI=y((rge,DI)=>{var Cv=xt(),Zne=Er(),yI=Ec(),Qne=(t,e)=>{t=new Zne(t,e);let r=new Cv("0.0.0");if(t.test(r)||(r=new Cv("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 Cv(s.semver.version);switch(s.operator){case">":a.prerelease.length===0?a.patch++:a.prerelease.push(0),a.raw=a.format();case"":case">=":(!o||yI(a,o))&&(o=a);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${s.operator}`)}}),o&&(!r||yI(r,o))&&(r=o)}return r&&t.test(r)?r:null};DI.exports=Qne});var wI=y((nge,bI)=>{var eie=Er(),tie=(t,e)=>{try{return new eie(t,e).range||"*"}catch{return null}};bI.exports=tie});var bh=y((ige,SI)=>{var rie=xt(),CI=Cc(),{ANY:nie}=CI,iie=Er(),oie=xc(),_I=Ec(),EI=mh(),sie=yh(),aie=gh(),uie=(t,e,r,n)=>{t=new rie(t,n),e=new iie(e,n);let i,o,s,a,u;switch(r){case">":i=_I,o=sie,s=EI,a=">",u=">=";break;case"<":i=EI,o=aie,s=_I,a="<",u="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(oie(t,e,n))return!1;for(let c=0;c<e.set.length;++c){let l=e.set[c],f=null,h=null;if(l.forEach(d=>{d.semver===nie&&(d=new CI(">=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};SI.exports=uie});var FI=y((oge,xI)=>{var cie=bh(),lie=(t,e,r)=>cie(t,e,">",r);xI.exports=lie});var AI=y((sge,OI)=>{var fie=bh(),die=(t,e,r)=>fie(t,e,"<",r);OI.exports=die});var PI=y((age,TI)=>{var kI=Er(),hie=(t,e,r)=>(t=new kI(t,r),e=new kI(e,r),t.intersects(e,r));TI.exports=hie});var $I=y((uge,RI)=>{var pie=xc(),mie=_r();RI.exports=(t,e,r)=>{let n=[],i=null,o=null,s=t.sort((l,f)=>mie(l,f,r));for(let l of s)pie(l,e,r)?(o=l,i||(i=l)):(o&&n.push([i,o]),o=null,i=null);i&&n.push([i,null]);let a=[];for(let[l,f]of n)l===f?a.push(l):!f&&l===s[0]?a.push("*"):f?l===s[0]?a.push(`<=${f}`):a.push(`${l} - ${f}`):a.push(`>=${l}`);let u=a.join(" || "),c=typeof e.raw=="string"?e.raw:String(e);return u.length<c.length?u:e}});var qI=y((cge,BI)=>{var II=Er(),xv=Cc(),{ANY:Sv}=xv,Fc=xc(),Fv=_r(),gie=(t,e,r={})=>{if(t===e)return!0;t=new II(t,r),e=new II(e,r);let n=!1;e:for(let i of t.set){for(let o of e.set){let s=Die(i,o,r);if(n=n||s!==null,s)continue e}if(n)return!1}return!0},yie=[new xv(">=0.0.0-0")],jI=[new xv(">=0.0.0")],Die=(t,e,r)=>{if(t===e)return!0;if(t.length===1&&t[0].semver===Sv){if(e.length===1&&e[0].semver===Sv)return!0;r.includePrerelease?t=yie:t=jI}if(e.length===1&&e[0].semver===Sv){if(r.includePrerelease)return!0;e=jI}let n=new Set,i,o;for(let d of t)d.operator===">"||d.operator===">="?i=NI(i,d,r):d.operator==="<"||d.operator==="<="?o=LI(o,d,r):n.add(d.semver);if(n.size>1)return null;let s;if(i&&o){if(s=Fv(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&&!Fc(d,String(i),r)||o&&!Fc(d,String(o),r))return null;for(let m of e)if(!Fc(d,String(m),r))return!1;return!0}let a,u,c,l,f=o&&!r.includePrerelease&&o.semver.prerelease.length?o.semver:!1,h=i&&!r.includePrerelease&&i.semver.prerelease.length?i.semver:!1;f&&f.prerelease.length===1&&o.operator==="<"&&f.prerelease[0]===0&&(f=!1);for(let d of e){if(l=l||d.operator===">"||d.operator===">=",c=c||d.operator==="<"||d.operator==="<=",i){if(h&&d.semver.prerelease&&d.semver.prerelease.length&&d.semver.major===h.major&&d.semver.minor===h.minor&&d.semver.patch===h.patch&&(h=!1),d.operator===">"||d.operator===">="){if(a=NI(i,d,r),a===d&&a!==i)return!1}else if(i.operator===">="&&!Fc(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=LI(o,d,r),u===d&&u!==o)return!1}else if(o.operator==="<="&&!Fc(o.semver,String(d),r))return!1}if(!d.operator&&(o||i)&&s!==0)return!1}return!(i&&c&&!o&&s!==0||o&&l&&!i&&s!==0||h||f)},NI=(t,e,r)=>{if(!t)return e;let n=Fv(t.semver,e.semver,r);return n>0?t:n<0||e.operator===">"&&t.operator===">="?e:t},LI=(t,e,r)=>{if(!t)return e;let n=Fv(t.semver,e.semver,r);return n<0?t:n>0||e.operator==="<"&&t.operator==="<="?e:t};BI.exports=gie});var Av=y((lge,VI)=>{var Ov=na(),MI=wc(),vie=xt(),UI=hv(),bie=go(),wie=p$(),_ie=g$(),Eie=v$(),Cie=_$(),Sie=C$(),xie=x$(),Fie=O$(),Oie=k$(),Aie=_r(),kie=$$(),Tie=j$(),Pie=ph(),Rie=q$(),$ie=U$(),Iie=Ec(),jie=mh(),Nie=mv(),Lie=gv(),Bie=gh(),qie=yh(),Mie=yv(),Uie=X$(),Vie=Cc(),Hie=Er(),zie=xc(),Gie=dI(),Wie=pI(),Kie=gI(),Yie=vI(),Jie=wI(),Xie=bh(),Zie=FI(),Qie=AI(),eoe=PI(),toe=$I(),roe=qI();VI.exports={parse:bie,valid:wie,clean:_ie,inc:Eie,diff:Cie,major:Sie,minor:xie,patch:Fie,prerelease:Oie,compare:Aie,rcompare:kie,compareLoose:Tie,compareBuild:Pie,sort:Rie,rsort:$ie,gt:Iie,lt:jie,eq:Nie,neq:Lie,gte:Bie,lte:qie,cmp:Mie,coerce:Uie,Comparator:Vie,Range:Hie,satisfies:zie,toComparators:Gie,maxSatisfying:Wie,minSatisfying:Kie,minVersion:Yie,validRange:Jie,outside:Xie,gtr:Zie,ltr:Qie,intersects:eoe,simplifyRange:toe,subset:roe,SemVer:vie,re:Ov.re,src:Ov.src,tokens:Ov.t,SEMVER_SPEC_VERSION:MI.SEMVER_SPEC_VERSION,RELEASE_TYPES:MI.RELEASE_TYPES,compareIdentifiers:UI.compareIdentifiers,rcompareIdentifiers:UI.rcompareIdentifiers}});var t6=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 Ac=(Cn(),Ae(En)),gi=qs(),HI=zD(),yo=require("path"),Ce=Ac.__importDefault(Hs()),oa=Hd(),GI=uc(),noe=JR(),zI=dl(),Oc=ch(),ioe=lh();async function ooe(t){let r=(await Promise.all(t.map(n=>n()))).filter(n=>n!=null);if(r.length>0)throw r.join(`
166
+ `)}W.check=ooe;async function soe(t){var e;return!((e=t.app.extConfig.server)===null||e===void 0)&&e.url?null:["",".","..","../","./"].includes(t.app.webDir)?`"${t.app.webDir}" is not a valid value for webDir`:await(0,gi.pathExists)(t.app.webDirAbs)?await(0,gi.pathExists)((0,yo.join)(t.app.webDirAbs,"index.html"))?null:`The web assets directory (${Ce.default.strong((0,HI.prettyPath)(t.app.webDirAbs))}) must contain an ${Ce.default.strong("index.html")} file.
167
+ 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,HI.prettyPath)(t.app.webDirAbs))}.
168
168
  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=soe;async function aoe(){return await(0,gi.pathExists)("package.json")||await(0,gi.pathExists)("project.json")?null:`The Capacitor CLI needs to run at the root of an npm package or in a valid NX monorepo.
169
169
  Make sure you have a package.json or project.json file in the directory where you run the Capacitor CLI.
170
170
  More info: ${Ce.default.strong("https://docs.npmjs.com/cli/init")}`}W.checkPackage=aoe;async function uoe(t,e){return await Tv(t,e)?null:`Could not find the ${Ce.default.input(e)} platform.
171
171
  You must install it in your project first, e.g. w/ ${Ce.default.input(`npm install @capacitor/${e}`)}`}W.checkCapacitorPlatform=uoe;async function coe(t){if(!t.app.appId)return`Missing ${Ce.default.input("appId")} for new platform.
172
172
  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.
173
- Please add it in ${t.app.extConfigName} or run ${Ce.default.input("npx cap init")}.`;let e=await KI(t,t.app.appId);if(e)return e;let r=await YI(t,t.app.appName);return r||null}W.checkAppConfig=coe;async function loe(t,e){return/^\S*$/.test(e)?null:"Your app directory should not contain spaces"}W.checkAppDir=loe;async function KI(t,e){return e?/^[a-z][a-z0-9_]*(\.[a-z0-9_]+)+$/.test(e.toLowerCase())?null:`Invalid App ID "${e}". Must be in Java package form with no dashes (ex: com.example.app)`:"Invalid App ID. Must be in Java package form with no dashes (ex: com.example.app)"}W.checkAppId=KI;async function YI(t,e){return e?.length?null:"Must provide an app name. For example: 'Spacebook'"}W.checkAppName=YI;async function foe(t){return new Promise(e=>setTimeout(e,t))}W.wait=foe;async function doe(t,e,r,n){await kv(t,e,r,n),(await(0,noe.getPlugins)(t,e)).forEach(async o=>{await kv(t,e,o.rootPath,n)})}W.runHooks=doe;async function kv(t,e,r,n){var i;let{spawn:o}=await Promise.resolve().then(()=>Ac.__importStar(require("child_process"))),s;(0,GI.isNXMonorepo)(r)?s=await(0,gi.readJSON)((0,yo.join)((0,GI.findNXMonorepoRoot)(r),"package.json")):s=await(0,gi.readJSON)((0,yo.join)(r,"package.json"));let a=(i=s.scripts)===null||i===void 0?void 0:i[n];if(a)return new Promise((u,c)=>{let l=o(a,{stdio:"inherit",shell:!0,cwd:r,env:{INIT_CWD:r,CAPACITOR_ROOT_DIR:t.app.rootDir,CAPACITOR_WEB_DIR:t.app.webDirAbs,CAPACITOR_CONFIG:JSON.stringify(t.app.extConfig),CAPACITOR_PLATFORM_NAME:e,...process.env}});l.on("close",()=>{u()}),l.on("error",f=>{c(f)})})}W.runPlatformHook=kv;async function hoe(t,e){let r=WI.output.createTaskChain();r.next(t);try{let n=await e();return r.end(),n}catch(n){throw r.fail(),n}}W.runTask=hoe;async function Tv(t,e){let r=(0,Oc.resolveNode)(t.app.rootDir,`@capacitor/${e}`,"package.json");return r?(0,gi.readJSON)(r):null}W.getCapacitorPackage=Tv;async function JI(t,e){let r=await Tv(t,e);return r||(0,oa.fatal)(`Unable to find node_modules/@capacitor/${e}.
174
- Are you sure ${Ce.default.strong(`@capacitor/${e}`)} is installed?`),r}W.requireCapacitorPackage=JI;async function _h(t,e){return(await JI(t,e)).version}W.getCapacitorPackageVersion=_h;async function XI(t){return _h(t,"core")}W.getCoreVersion=XI;async function poe(t){return _h(t,"cli")}W.getCLIVersion=poe;function moe(t,e){switch(e){case"android":return t.android.platformDirAbs;case"ios":return t.ios.platformDirAbs;case"web":return t.web.platformDirAbs}return null}async function wh(t,e){let r=moe(t,e);return r&&await(0,gi.pathExists)(r)?r:null}W.getProjectPlatformDirectory=wh;async function goe(t,e){if(e){let r=e.toLowerCase().trim();return await Rv(r)?await wh(t,r)||(r==="web"&&(0,oa.fatal)(`Could not find the web platform directory.
173
+ Please add it in ${t.app.extConfigName} or run ${Ce.default.input("npx cap init")}.`;let e=await WI(t,t.app.appId);if(e)return e;let r=await KI(t,t.app.appName);return r||null}W.checkAppConfig=coe;async function loe(t,e){return/^\S*$/.test(e)?null:"Your app directory should not contain spaces"}W.checkAppDir=loe;async function WI(t,e){return e?/^[a-z][a-z0-9_]*(\.[a-z0-9_]+)+$/.test(e.toLowerCase())?null:`Invalid App ID "${e}". Must be in Java package form with no dashes (ex: com.example.app)`:"Invalid App ID. Must be in Java package form with no dashes (ex: com.example.app)"}W.checkAppId=WI;async function KI(t,e){return e?.length?null:"Must provide an app name. For example: 'Spacebook'"}W.checkAppName=KI;async function foe(t){return new Promise(e=>setTimeout(e,t))}W.wait=foe;async function doe(t,e,r,n){await kv(t,e,r,n),(await(0,noe.getPlugins)(t,e)).forEach(async o=>{await kv(t,e,o.rootPath,n)})}W.runHooks=doe;async function kv(t,e,r,n){var i;let{spawn:o}=await Promise.resolve().then(()=>Ac.__importStar(require("child_process"))),s;(0,zI.isNXMonorepo)(r)?s=await(0,gi.readJSON)((0,yo.join)((0,zI.findNXMonorepoRoot)(r),"package.json")):s=await(0,gi.readJSON)((0,yo.join)(r,"package.json"));let a=(i=s.scripts)===null||i===void 0?void 0:i[n];if(a)return new Promise((u,c)=>{let l=o(a,{stdio:"inherit",shell:!0,cwd:r,env:{INIT_CWD:r,CAPACITOR_ROOT_DIR:t.app.rootDir,CAPACITOR_WEB_DIR:t.app.webDirAbs,CAPACITOR_CONFIG:JSON.stringify(t.app.extConfig),CAPACITOR_PLATFORM_NAME:e,...process.env}});l.on("close",()=>{u()}),l.on("error",f=>{c(f)})})}W.runPlatformHook=kv;async function hoe(t,e){let r=GI.output.createTaskChain();r.next(t);try{let n=await e();return r.end(),n}catch(n){throw r.fail(),n}}W.runTask=hoe;async function Tv(t,e){let r=(0,Oc.resolveNode)(t.app.rootDir,`@capacitor/${e}`,"package.json");return r?(0,gi.readJSON)(r):null}W.getCapacitorPackage=Tv;async function YI(t,e){let r=await Tv(t,e);return r||(0,oa.fatal)(`Unable to find node_modules/@capacitor/${e}.
174
+ Are you sure ${Ce.default.strong(`@capacitor/${e}`)} is installed?`),r}W.requireCapacitorPackage=YI;async function _h(t,e){return(await YI(t,e)).version}W.getCapacitorPackageVersion=_h;async function JI(t){return _h(t,"core")}W.getCoreVersion=JI;async function poe(t){return _h(t,"cli")}W.getCLIVersion=poe;function moe(t,e){switch(e){case"android":return t.android.platformDirAbs;case"ios":return t.ios.platformDirAbs;case"web":return t.web.platformDirAbs}return null}async function wh(t,e){let r=moe(t,e);return r&&await(0,gi.pathExists)(r)?r:null}W.getProjectPlatformDirectory=wh;async function goe(t,e){if(e){let r=e.toLowerCase().trim();return await Rv(r)?await wh(t,r)||(r==="web"&&(0,oa.fatal)(`Could not find the web platform directory.
175
175
  Make sure ${Ce.default.strong(t.app.webDir)} exists.`),(0,oa.fatal)(`${Ce.default.strong(r)} platform has not been added yet.
176
- See the docs for adding the ${Ce.default.strong(r)} platform: ${Ce.default.strong(`https://capacitorjs.com/docs/${r}#adding-the-${r}-platform`)}`)):(0,oa.fatal)(`Invalid platform: ${Ce.default.input(r)}`),[r]}return t6(t)}W.selectPlatforms=goe;async function Pv(){return["web","android","ios"]}W.getKnownPlatforms=Pv;async function Rv(t){return(await Pv()).includes(t)}W.isValidPlatform=Rv;async function ZI(){return["electron"]}W.getKnownCommunityPlatforms=ZI;async function yoe(t){return(await ZI()).includes(t)}W.isValidCommunityPlatform=yoe;async function QI(){return["windows"]}W.getKnownEnterprisePlatforms=QI;async function Doe(t){return(await QI()).includes(t)}W.isValidEnterprisePlatform=Doe;async function voe(t,e,r){let{prompt:n}=await Promise.resolve().then(()=>Ac.__importStar(uh()));if(!r)return(await n([{type:"select",name:"mode",message:e,choices:t.map(s=>({title:s,value:s}))}],{onCancel:()=>process.exit(1)})).mode.toLowerCase().trim();let i=r.toLowerCase().trim();if(!await Rv(i)){let o=await Pv();(0,oa.fatal)(`Invalid platform: ${Ce.default.input(i)}.
177
- Valid platforms include: ${o.join(", ")}`)}return i}W.promptForPlatform=voe;async function boe(t,e){let{prompt:r}=await Promise.resolve().then(()=>Ac.__importStar(uh())),n=t.filter(s=>s.id!==void 0);if(!e)return n.length===1?n[0]:(await r([{type:"select",name:"target",message:"Please choose a target device:",choices:n.map(a=>({title:`${e6(a)} (${a.id})`,value:a}))}],{onCancel:()=>process.exit(1)})).target;let i=e.trim(),o=t.find(s=>s.id===i);return o||(0,oa.fatal)(`Invalid target ID: ${Ce.default.input(i)}.
178
- Valid targets are: ${t.map(s=>s.id).join(", ")}`),o}W.promptForPlatformTarget=boe;function e6(t){var e,r,n;return`${(n=(r=(e=t.name)!==null&&e!==void 0?e:t.model)!==null&&r!==void 0?r:t.id)!==null&&n!==void 0?n:"?"}${t.virtual?` (${t.platform==="ios"?"simulator":"emulator"})`:""}`}W.getPlatformTargetName=e6;async function t6(t){let e=[];return await wh(t,t.android.name)&&e.push(t.android.name),await wh(t,t.ios.name)&&e.push(t.ios.name),e.push(t.web.name),e}W.getAddedPlatforms=t6;async function woe(t,e){let r=await Promise.resolve().then(()=>Ac.__importStar(Av())),n=await XI(t),i=await _h(t,e);(r.diff(n,i)==="minor"||r.diff(n,i)==="major")&&WI.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.
179
- Consider updating to a matching version, e.g. w/ ${Ce.default.input(`npm install @capacitor/core@${i}`)}`)}W.checkPlatformVersions=woe;function _oe(t,e){if(e[0]!=="@"){let n=(0,Oc.resolveNode)(t.app.rootDir,`@capacitor/${e}`,"package.json");if(n)return(0,yo.dirname)(n);let i=(0,Oc.resolveNode)(t.app.rootDir,`@capacitor-community/${e}`,"package.json");if(i)return(0,yo.dirname)(i);let o=(0,Oc.resolveNode)(t.app.rootDir,`@ionic-enterprise/capacitor-${e}`,"package.json");if(o)return(0,yo.dirname)(o)}let r=(0,Oc.resolveNode)(t.app.rootDir,e,"package.json");return r?(0,yo.dirname)(r):null}W.resolvePlatform=_oe;async function Eoe(){try{let t=await(0,ioe.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=Eoe;function Coe(t){let e=t.replace(/([A-Z])/g,"$1").toLowerCase();return`app-${e?`${e}-`:""}debug.apk`}W.parseApkNameFromFlavor=Coe});var n6=y(Eh=>{"use strict";Object.defineProperty(Eh,"__esModule",{value:!0});Eh.tryFn=void 0;var Soe=async(t,...e)=>{try{return await t(...e)}catch{}return null};Eh.tryFn=Soe});var i6=y(Ch=>{"use strict";Object.defineProperty(Ch,"__esModule",{value:!0});Ch.formatJSObject=void 0;var xoe=(Cn(),Ae(En)),Foe=xoe.__importDefault(require("util"));function Ooe(t){try{t=JSON.parse(JSON.stringify(t))}catch(e){throw new Error(`Cannot parse object as JSON: ${e.stack?e.stack:e}`)}return Foe.default.inspect(t,{compact:!1,breakLength:1/0,depth:1/0,maxArrayLength:1/0,maxStringLength:1/0})}Ch.formatJSObject=Ooe});var o6=y(yi=>{"use strict";Object.defineProperty(yi,"__esModule",{value:!0});yi.lazy=yi.LazyPromise=yi.allSerial=void 0;function Aoe(t){return t.reduce((e,r)=>e.then(n=>r().then(i=>n.concat(i))),Promise.resolve([]))}yi.allSerial=Aoe;var Sh=class extends Promise{constructor(e){super(()=>{}),this._executor=e}then(e,r){return this._promise=this._promise||new Promise(this._executor),this._promise.then(e,r)}catch(e){return this._promise=this._promise||new Promise(this._executor),this._promise.catch(e)}};yi.LazyPromise=Sh;function koe(t){return new Sh(async(e,r)=>{try{e(await t())}catch(n){r(n)}})}yi.lazy=koe});var l6=y(it=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0});it.checkExternalConfig=it.writeConfig=it.loadConfig=it.CONFIG_FILE_NAME_JSON=it.CONFIG_FILE_NAME_JS=it.CONFIG_FILE_NAME_TS=void 0;var Iv=(Cn(),Ae(En)),er=qs(),Toe=Iv.__importDefault(BA()),ie=require("path"),Di=Iv.__importDefault(Hs()),Poe=r6(),xh=Hd(),u6=uc(),$v=n6(),Roe=i6(),s6=dl(),a6=ch(),sa=o6(),$oe=lh(),c6=(0,Toe.default)("capacitor:config");it.CONFIG_FILE_NAME_TS="capacitor.config.ts";it.CONFIG_FILE_NAME_JS="capacitor.config.js";it.CONFIG_FILE_NAME_JSON="capacitor.config.json";async function Ioe(){var t,e,r,n;let i=process.cwd(),o=(0,ie.dirname)(__dirname),s=await Boe(i),a=await(async()=>{var d,m;if((0,s6.isNXMonorepo)(i)){let b=(0,s6.findNXMonorepoRoot)(i),g=await(0,$v.tryFn)(er.readJSON,(0,ie.resolve)(b,"package.json")),w=(d=g?.devDependencies)!==null&&d!==void 0?d:{},x=(m=g?.dependencies)!==null&&m!==void 0?m:{};return{devDependencies:w,dependencies:x}}return{}})(),u=(t=s.extConfig.appId)!==null&&t!==void 0?t:"",c=(e=s.extConfig.appName)!==null&&e!==void 0?e:"",l=(r=s.extConfig.webDir)!==null&&r!==void 0?r:"www",f=await qoe(o),h={android:await Moe(i,s.extConfig,f),ios:await Uoe(i,s.extConfig),web:await Voe(i,l),cli:f,app:{rootDir:i,appId:u,appName:c,webDir:l,webDirAbs:(0,ie.resolve)(i,l),package:(n=await(0,$v.tryFn)(er.readJSON,(0,ie.resolve)(i,"package.json")))!==null&&n!==void 0?n:{name:c,version:"1.0.0",...a},...s}};return c6("config: %O",h),h}it.loadConfig=Ioe;async function joe(t,e){switch((0,ie.extname)(e)){case".json":{await(0,er.writeJSON)(e,t,{spaces:2});break}case".ts":{await(0,er.writeFile)(e,Yoe(t));break}}}it.writeConfig=joe;async function Noe(t,e,r){var n;try{let i=(0,a6.resolveNode)(t,"typescript");i||(0,xh.fatal)(`Could not find installation of TypeScript.
180
- To use ${Di.default.strong(e)} files, you must install TypeScript in your project, e.g. w/ ${Di.default.input("npm install -D typescript")}`);let o=require(i),s=(0,a6.requireTS)(o,r),a=s.default?await s.default:s;return{extConfigType:"ts",extConfigName:e,extConfigFilePath:r,extConfig:a}}catch(i){throw(0,xh.isFatal)(i)||(0,xh.fatal)(`Parsing ${Di.default.strong(e)} failed.
176
+ See the docs for adding the ${Ce.default.strong(r)} platform: ${Ce.default.strong(`https://capacitorjs.com/docs/${r}#adding-the-${r}-platform`)}`)):(0,oa.fatal)(`Invalid platform: ${Ce.default.input(r)}`),[r]}return e6(t)}W.selectPlatforms=goe;async function Pv(){return["web","android","ios"]}W.getKnownPlatforms=Pv;async function Rv(t){return(await Pv()).includes(t)}W.isValidPlatform=Rv;async function XI(){return["electron"]}W.getKnownCommunityPlatforms=XI;async function yoe(t){return(await XI()).includes(t)}W.isValidCommunityPlatform=yoe;async function ZI(){return["windows"]}W.getKnownEnterprisePlatforms=ZI;async function Doe(t){return(await ZI()).includes(t)}W.isValidEnterprisePlatform=Doe;async function voe(t,e,r){let{prompt:n}=await Promise.resolve().then(()=>Ac.__importStar(uh()));if(!r)return(await n([{type:"select",name:"mode",message:e,choices:t.map(s=>({title:s,value:s}))}],{onCancel:()=>process.exit(1)})).mode.toLowerCase().trim();let i=r.toLowerCase().trim();if(!await Rv(i)){let o=await Pv();(0,oa.fatal)(`Invalid platform: ${Ce.default.input(i)}.
177
+ Valid platforms include: ${o.join(", ")}`)}return i}W.promptForPlatform=voe;async function boe(t,e){let{prompt:r}=await Promise.resolve().then(()=>Ac.__importStar(uh())),n=t.filter(s=>s.id!==void 0);if(!e)return n.length===1?n[0]:(await r([{type:"select",name:"target",message:"Please choose a target device:",choices:n.map(a=>({title:`${QI(a)} (${a.id})`,value:a}))}],{onCancel:()=>process.exit(1)})).target;let i=e.trim(),o=t.find(s=>s.id===i);return o||(0,oa.fatal)(`Invalid target ID: ${Ce.default.input(i)}.
178
+ Valid targets are: ${t.map(s=>s.id).join(", ")}`),o}W.promptForPlatformTarget=boe;function QI(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=QI;async function e6(t){let e=[];return await wh(t,t.android.name)&&e.push(t.android.name),await wh(t,t.ios.name)&&e.push(t.ios.name),e.push(t.web.name),e}W.getAddedPlatforms=e6;async function woe(t,e){let r=await Promise.resolve().then(()=>Ac.__importStar(Av())),n=await JI(t),i=await _h(t,e);(r.diff(n,i)==="minor"||r.diff(n,i)==="major")&&GI.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.
179
+ Consider updating to a matching version, e.g. w/ ${Ce.default.input(`npm install @capacitor/core@${i}`)}`)}W.checkPlatformVersions=woe;function _oe(t,e){if(e[0]!=="@"){let n=(0,Oc.resolveNode)(t.app.rootDir,`@capacitor/${e}`,"package.json");if(n)return(0,yo.dirname)(n);let i=(0,Oc.resolveNode)(t.app.rootDir,`@capacitor-community/${e}`,"package.json");if(i)return(0,yo.dirname)(i);let o=(0,Oc.resolveNode)(t.app.rootDir,`@ionic-enterprise/capacitor-${e}`,"package.json");if(o)return(0,yo.dirname)(o)}let r=(0,Oc.resolveNode)(t.app.rootDir,e,"package.json");return r?(0,yo.dirname)(r):null}W.resolvePlatform=_oe;async function Eoe(){try{let t=await(0,ioe.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=Eoe;function Coe(t){let e=t.replace(/([A-Z])/g,"$1").toLowerCase();return`app-${e?`${e}-`:""}debug.apk`}W.parseApkNameFromFlavor=Coe});var r6=y(Eh=>{"use strict";Object.defineProperty(Eh,"__esModule",{value:!0});Eh.tryFn=void 0;var Soe=async(t,...e)=>{try{return await t(...e)}catch{}return null};Eh.tryFn=Soe});var n6=y(Ch=>{"use strict";Object.defineProperty(Ch,"__esModule",{value:!0});Ch.formatJSObject=void 0;var xoe=(Cn(),Ae(En)),Foe=xoe.__importDefault(require("util"));function Ooe(t){try{t=JSON.parse(JSON.stringify(t))}catch(e){throw new Error(`Cannot parse object as JSON: ${e.stack?e.stack:e}`)}return Foe.default.inspect(t,{compact:!1,breakLength:1/0,depth:1/0,maxArrayLength:1/0,maxStringLength:1/0})}Ch.formatJSObject=Ooe});var i6=y(yi=>{"use strict";Object.defineProperty(yi,"__esModule",{value:!0});yi.lazy=yi.LazyPromise=yi.allSerial=void 0;function Aoe(t){return t.reduce((e,r)=>e.then(n=>r().then(i=>n.concat(i))),Promise.resolve([]))}yi.allSerial=Aoe;var Sh=class extends Promise{constructor(e){super(()=>{}),this._executor=e}then(e,r){return this._promise=this._promise||new Promise(this._executor),this._promise.then(e,r)}catch(e){return this._promise=this._promise||new Promise(this._executor),this._promise.catch(e)}};yi.LazyPromise=Sh;function koe(t){return new Sh(async(e,r)=>{try{e(await t())}catch(n){r(n)}})}yi.lazy=koe});var c6=y(it=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0});it.checkExternalConfig=it.writeConfig=it.loadConfig=it.CONFIG_FILE_NAME_JSON=it.CONFIG_FILE_NAME_JS=it.CONFIG_FILE_NAME_TS=void 0;var Iv=(Cn(),Ae(En)),er=qs(),Toe=Iv.__importDefault(LA()),ie=require("path"),Di=Iv.__importDefault(Hs()),Poe=t6(),xh=Hd(),a6=uc(),$v=r6(),Roe=n6(),o6=dl(),s6=ch(),sa=i6(),$oe=lh(),u6=(0,Toe.default)("capacitor:config");it.CONFIG_FILE_NAME_TS="capacitor.config.ts";it.CONFIG_FILE_NAME_JS="capacitor.config.js";it.CONFIG_FILE_NAME_JSON="capacitor.config.json";async function Ioe(){var t,e,r,n;let i=process.cwd(),o=(0,ie.dirname)(__dirname),s=await Boe(i),a=await(async()=>{var d,m;if((0,o6.isNXMonorepo)(i)){let b=(0,o6.findNXMonorepoRoot)(i),g=await(0,$v.tryFn)(er.readJSON,(0,ie.resolve)(b,"package.json")),w=(d=g?.devDependencies)!==null&&d!==void 0?d:{},x=(m=g?.dependencies)!==null&&m!==void 0?m:{};return{devDependencies:w,dependencies:x}}return{}})(),u=(t=s.extConfig.appId)!==null&&t!==void 0?t:"",c=(e=s.extConfig.appName)!==null&&e!==void 0?e:"",l=(r=s.extConfig.webDir)!==null&&r!==void 0?r:"www",f=await qoe(o),h={android:await Moe(i,s.extConfig,f),ios:await Uoe(i,s.extConfig),web:await Voe(i,l),cli:f,app:{rootDir:i,appId:u,appName:c,webDir:l,webDirAbs:(0,ie.resolve)(i,l),package:(n=await(0,$v.tryFn)(er.readJSON,(0,ie.resolve)(i,"package.json")))!==null&&n!==void 0?n:{name:c,version:"1.0.0",...a},...s}};return u6("config: %O",h),h}it.loadConfig=Ioe;async function joe(t,e){switch((0,ie.extname)(e)){case".json":{await(0,er.writeJSON)(e,t,{spaces:2});break}case".ts":{await(0,er.writeFile)(e,Yoe(t));break}}}it.writeConfig=joe;async function Noe(t,e,r){var n;try{let i=(0,s6.resolveNode)(t,"typescript");i||(0,xh.fatal)(`Could not find installation of TypeScript.
180
+ To use ${Di.default.strong(e)} files, you must install TypeScript in your project, e.g. w/ ${Di.default.input("npm install -D typescript")}`);let o=require(i),s=(0,s6.requireTS)(o,r),a=s.default?await s.default:s;return{extConfigType:"ts",extConfigName:e,extConfigFilePath:r,extConfig:a}}catch(i){throw(0,xh.isFatal)(i)||(0,xh.fatal)(`Parsing ${Di.default.strong(e)} failed.
181
181
 
182
182
  ${(n=i.stack)!==null&&n!==void 0?n:i}`),i}}async function Loe(t,e,r){var n;try{return{extConfigType:"js",extConfigName:e,extConfigFilePath:r,extConfig:await require(r)}}catch(i){(0,xh.fatal)(`Parsing ${Di.default.strong(e)} failed.
183
183
 
184
- ${(n=i.stack)!==null&&n!==void 0?n:i}`)}}async function Boe(t){var e;let r=(0,ie.resolve)(t,it.CONFIG_FILE_NAME_TS);if(await(0,er.pathExists)(r))return Noe(t,it.CONFIG_FILE_NAME_TS,r);let n=(0,ie.resolve)(t,it.CONFIG_FILE_NAME_JS);if(await(0,er.pathExists)(n))return Loe(t,it.CONFIG_FILE_NAME_JS,n);let i=(0,ie.resolve)(t,it.CONFIG_FILE_NAME_JSON);return{extConfigType:"json",extConfigName:it.CONFIG_FILE_NAME_JSON,extConfigFilePath:i,extConfig:(e=await(0,$v.tryFn)(er.readJSON,i))!==null&&e!==void 0?e:{}}}async function qoe(t){let e="assets",r=(0,ie.join)(t,e),n="ios-pods-template.tar.gz",i="capacitor-cordova-ios-plugins.tar.gz",o="android-template.tar.gz",s="capacitor-cordova-android-plugins.tar.gz";return{rootDir:t,assetsDir:e,assetsDirAbs:r,assets:{ios:{platformTemplateArchive:n,platformTemplateArchiveAbs:(0,ie.resolve)(r,n),cordovaPluginsTemplateArchive:i,cordovaPluginsTemplateArchiveAbs:(0,ie.resolve)(r,i)},android:{platformTemplateArchive:o,platformTemplateArchiveAbs:(0,ie.resolve)(r,o),cordovaPluginsTemplateArchive:s,cordovaPluginsTemplateArchiveAbs:(0,ie.resolve)(r,s)}},package:await(0,er.readJSON)((0,ie.resolve)(t,"package.json")),os:Hoe(process.platform)}}async function Moe(t,e,r){var n,i,o,s,a,u,c,l,f,h,d,m,b,g,w,x,D;let C="android",k=(i=(n=e.android)===null||n===void 0?void 0:n.path)!==null&&i!==void 0?i:"android",$=(0,ie.resolve)(t,k),F="app",L=`${F}/src`,S=`${L}/main`,I=`${S}/assets`,R=`${I}/public`,B=`${S}/res`,q=`${F}/build/outputs/apk/`,K=((o=e.android)===null||o===void 0?void 0:o.flavor)||"";!((s=e.android)===null||s===void 0)&&s.flavor&&(q=`${q}/${(a=e.android)===null||a===void 0?void 0:a.flavor}`);let M=(0,Poe.parseApkNameFromFlavor)(K),E=`${q}/debug`,v="capacitor-cordova-android-plugins",_=(0,sa.lazy)(()=>Woe(r.os)),O={keystorePath:(c=(u=e.android)===null||u===void 0?void 0:u.buildOptions)===null||c===void 0?void 0:c.keystorePath,keystorePassword:(f=(l=e.android)===null||l===void 0?void 0:l.buildOptions)===null||f===void 0?void 0:f.keystorePassword,keystoreAlias:(d=(h=e.android)===null||h===void 0?void 0:h.buildOptions)===null||d===void 0?void 0:d.keystoreAlias,keystoreAliasPassword:(b=(m=e.android)===null||m===void 0?void 0:m.buildOptions)===null||b===void 0?void 0:b.keystoreAliasPassword,signingType:(w=(g=e.android)===null||g===void 0?void 0:g.buildOptions)===null||w===void 0?void 0:w.signingType,releaseType:(D=(x=e.android)===null||x===void 0?void 0:x.buildOptions)===null||D===void 0?void 0:D.releaseType};return{name:C,minVersion:"22",studioPath:_,platformDir:k,platformDirAbs:$,cordovaPluginsDir:v,cordovaPluginsDirAbs:(0,ie.resolve)($,v),appDir:F,appDirAbs:(0,ie.resolve)($,F),srcDir:L,srcDirAbs:(0,ie.resolve)($,L),srcMainDir:S,srcMainDirAbs:(0,ie.resolve)($,S),assetsDir:I,assetsDirAbs:(0,ie.resolve)($,I),webDir:R,webDirAbs:(0,ie.resolve)($,R),resDir:B,resDirAbs:(0,ie.resolve)($,B),apkName:M,buildOutputDir:E,buildOutputDirAbs:(0,ie.resolve)($,E),flavor:K,buildOptions:O}}async function Uoe(t,e){var r,n,i,o;let s="ios",a=(n=(r=e.ios)===null||r===void 0?void 0:r.path)!==null&&n!==void 0?n:"ios",u=(0,ie.resolve)(t,a),c=(o=(i=e.ios)===null||i===void 0?void 0:i.scheme)!==null&&o!==void 0?o:"App",l="App",f=(0,ie.resolve)(u,l),h=`${l}/App`,d=(0,ie.resolve)(u,h),m=`${l}/App.xcodeproj`,b=(0,ie.resolve)(u,m),g=(0,sa.lazy)(()=>zoe(f)),w=(0,sa.lazy)(()=>Koe(t,u,f)),x=(0,sa.lazy)(()=>Goe(f,d,b)),D="capacitor-cordova-ios-plugins";return{name:s,minVersion:"13.0",platformDir:a,platformDirAbs:u,scheme:c,cordovaPluginsDir:D,cordovaPluginsDirAbs:(0,ie.resolve)(u,D),nativeProjectDir:l,nativeProjectDirAbs:f,nativeTargetDir:h,nativeTargetDirAbs:d,nativeXcodeProjDir:m,nativeXcodeProjDirAbs:b,nativeXcodeWorkspaceDir:(0,sa.lazy)(async()=>(0,ie.relative)(u,await g)),nativeXcodeWorkspaceDirAbs:g,webDir:(0,sa.lazy)(async()=>(0,ie.relative)(u,await x)),webDirAbs:x,podPath:w}}async function Voe(t,e){let r=e,n=(0,ie.resolve)(t,r);return{name:"web",platformDir:r,platformDirAbs:n}}function Hoe(t){switch(t){case"darwin":return"mac";case"win32":return"windows";case"linux":return"linux"}return"unknown"}async function zoe(t){return(0,ie.resolve)(t,"App.xcworkspace")}async function Goe(t,e,r){let n=/path\s=\spublic[\s\S]+?sourceTree\s=\s([^;]+)/,i=(0,ie.resolve)(r,"project.pbxproj");try{let s=(await(0,er.readFile)(i,{encoding:"utf8"})).match(n);if(s&&s[1]==="SOURCE_ROOT")return u6.logger.warn(`Using the iOS project root for the ${Di.default.strong("public")} directory is deprecated.
185
- Please follow the Upgrade Guide to move ${Di.default.strong("public")} inside the iOS target directory: ${Di.default.strong("https://capacitorjs.com/docs/updating/3-0#move-public-into-the-ios-target-directory")}`),(0,ie.resolve)(t,"public")}catch{}return(0,ie.resolve)(e,"public")}async function Woe(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(()=>Iv.__importStar(lh())),r="C:\\Program Files\\Android\\Android Studio\\bin\\studio64.exe";try{if(!await(0,er.pathExists)(r)){let n=await e("REG",["QUERY","HKEY_LOCAL_MACHINE\\SOFTWARE\\Android Studio","/v","Path"]);n=n.replace(/(\r\n|\n|\r)/gm,"");let i=n.indexOf("REG_SZ");i>0&&(r=n.substring(i+6).trim()+"\\bin\\studio64.exe")}}catch(n){c6("Error checking registry for Android Studio path: %O",n);break}return r}case"linux":return"/usr/local/android-studio/bin/studio.sh"}return""}async function Koe(t,e,r){if(process.env.CAPACITOR_COCOAPODS_PATH)return process.env.CAPACITOR_COCOAPODS_PATH;let n="";if(await(0,er.pathExists)((0,ie.resolve)(t,"Gemfile"))?n=(0,ie.resolve)(t,"Gemfile"):await(0,er.pathExists)((0,ie.resolve)(e,"Gemfile"))?n=(0,ie.resolve)(e,"Gemfile"):await(0,er.pathExists)((0,ie.resolve)(r,"Gemfile"))&&(n=(0,ie.resolve)(r,"Gemfile")),!(n!=""))try{let o=await(0,$oe.getCommandOutput)("git",["rev-parse","--show-toplevel"],{cwd:t});o!=null&&(n=(0,ie.resolve)(o,"Gemfile"))}catch{}try{let o=(await(0,er.readFile)(n)).toString();return o&&new RegExp(/gem\s+['"]cocoapods/).test(o)?"bundle exec pod":"pod"}catch{return"pod"}}function Yoe(t){return`import type { CapacitorConfig } from '@capacitor/cli';
184
+ ${(n=i.stack)!==null&&n!==void 0?n:i}`)}}async function Boe(t){var e;let r=(0,ie.resolve)(t,it.CONFIG_FILE_NAME_TS);if(await(0,er.pathExists)(r))return Noe(t,it.CONFIG_FILE_NAME_TS,r);let n=(0,ie.resolve)(t,it.CONFIG_FILE_NAME_JS);if(await(0,er.pathExists)(n))return Loe(t,it.CONFIG_FILE_NAME_JS,n);let i=(0,ie.resolve)(t,it.CONFIG_FILE_NAME_JSON);return{extConfigType:"json",extConfigName:it.CONFIG_FILE_NAME_JSON,extConfigFilePath:i,extConfig:(e=await(0,$v.tryFn)(er.readJSON,i))!==null&&e!==void 0?e:{}}}async function qoe(t){let e="assets",r=(0,ie.join)(t,e),n="ios-pods-template.tar.gz",i="capacitor-cordova-ios-plugins.tar.gz",o="android-template.tar.gz",s="capacitor-cordova-android-plugins.tar.gz";return{rootDir:t,assetsDir:e,assetsDirAbs:r,assets:{ios:{platformTemplateArchive:n,platformTemplateArchiveAbs:(0,ie.resolve)(r,n),cordovaPluginsTemplateArchive:i,cordovaPluginsTemplateArchiveAbs:(0,ie.resolve)(r,i)},android:{platformTemplateArchive:o,platformTemplateArchiveAbs:(0,ie.resolve)(r,o),cordovaPluginsTemplateArchive:s,cordovaPluginsTemplateArchiveAbs:(0,ie.resolve)(r,s)}},package:await(0,er.readJSON)((0,ie.resolve)(t,"package.json")),os:Hoe(process.platform)}}async function Moe(t,e,r){var n,i,o,s,a,u,c,l,f,h,d,m,b,g,w,x,D;let C="android",k=(i=(n=e.android)===null||n===void 0?void 0:n.path)!==null&&i!==void 0?i:"android",$=(0,ie.resolve)(t,k),F="app",L=`${F}/src`,S=`${L}/main`,I=`${S}/assets`,R=`${I}/public`,B=`${S}/res`,q=`${F}/build/outputs/apk/`,K=((o=e.android)===null||o===void 0?void 0:o.flavor)||"";!((s=e.android)===null||s===void 0)&&s.flavor&&(q=`${q}/${(a=e.android)===null||a===void 0?void 0:a.flavor}`);let M=(0,Poe.parseApkNameFromFlavor)(K),E=`${q}/debug`,v="capacitor-cordova-android-plugins",_=(0,sa.lazy)(()=>Woe(r.os)),O={keystorePath:(c=(u=e.android)===null||u===void 0?void 0:u.buildOptions)===null||c===void 0?void 0:c.keystorePath,keystorePassword:(f=(l=e.android)===null||l===void 0?void 0:l.buildOptions)===null||f===void 0?void 0:f.keystorePassword,keystoreAlias:(d=(h=e.android)===null||h===void 0?void 0:h.buildOptions)===null||d===void 0?void 0:d.keystoreAlias,keystoreAliasPassword:(b=(m=e.android)===null||m===void 0?void 0:m.buildOptions)===null||b===void 0?void 0:b.keystoreAliasPassword,signingType:(w=(g=e.android)===null||g===void 0?void 0:g.buildOptions)===null||w===void 0?void 0:w.signingType,releaseType:(D=(x=e.android)===null||x===void 0?void 0:x.buildOptions)===null||D===void 0?void 0:D.releaseType};return{name:C,minVersion:"22",studioPath:_,platformDir:k,platformDirAbs:$,cordovaPluginsDir:v,cordovaPluginsDirAbs:(0,ie.resolve)($,v),appDir:F,appDirAbs:(0,ie.resolve)($,F),srcDir:L,srcDirAbs:(0,ie.resolve)($,L),srcMainDir:S,srcMainDirAbs:(0,ie.resolve)($,S),assetsDir:I,assetsDirAbs:(0,ie.resolve)($,I),webDir:R,webDirAbs:(0,ie.resolve)($,R),resDir:B,resDirAbs:(0,ie.resolve)($,B),apkName:M,buildOutputDir:E,buildOutputDirAbs:(0,ie.resolve)($,E),flavor:K,buildOptions:O}}async function Uoe(t,e){var r,n,i,o;let s="ios",a=(n=(r=e.ios)===null||r===void 0?void 0:r.path)!==null&&n!==void 0?n:"ios",u=(0,ie.resolve)(t,a),c=(o=(i=e.ios)===null||i===void 0?void 0:i.scheme)!==null&&o!==void 0?o:"App",l="App",f=(0,ie.resolve)(u,l),h=`${l}/App`,d=(0,ie.resolve)(u,h),m=`${l}/App.xcodeproj`,b=(0,ie.resolve)(u,m),g=(0,sa.lazy)(()=>zoe(f)),w=(0,sa.lazy)(()=>Koe(t,u,f)),x=(0,sa.lazy)(()=>Goe(f,d,b)),D="capacitor-cordova-ios-plugins";return{name:s,minVersion:"13.0",platformDir:a,platformDirAbs:u,scheme:c,cordovaPluginsDir:D,cordovaPluginsDirAbs:(0,ie.resolve)(u,D),nativeProjectDir:l,nativeProjectDirAbs:f,nativeTargetDir:h,nativeTargetDirAbs:d,nativeXcodeProjDir:m,nativeXcodeProjDirAbs:b,nativeXcodeWorkspaceDir:(0,sa.lazy)(async()=>(0,ie.relative)(u,await g)),nativeXcodeWorkspaceDirAbs:g,webDir:(0,sa.lazy)(async()=>(0,ie.relative)(u,await x)),webDirAbs:x,podPath:w}}async function Voe(t,e){let r=e,n=(0,ie.resolve)(t,r);return{name:"web",platformDir:r,platformDirAbs:n}}function Hoe(t){switch(t){case"darwin":return"mac";case"win32":return"windows";case"linux":return"linux"}return"unknown"}async function zoe(t){return(0,ie.resolve)(t,"App.xcworkspace")}async function Goe(t,e,r){let n=/path\s=\spublic[\s\S]+?sourceTree\s=\s([^;]+)/,i=(0,ie.resolve)(r,"project.pbxproj");try{let s=(await(0,er.readFile)(i,{encoding:"utf8"})).match(n);if(s&&s[1]==="SOURCE_ROOT")return a6.logger.warn(`Using the iOS project root for the ${Di.default.strong("public")} directory is deprecated.
185
+ Please follow the Upgrade Guide to move ${Di.default.strong("public")} inside the iOS target directory: ${Di.default.strong("https://capacitorjs.com/docs/updating/3-0#move-public-into-the-ios-target-directory")}`),(0,ie.resolve)(t,"public")}catch{}return(0,ie.resolve)(e,"public")}async function Woe(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(()=>Iv.__importStar(lh())),r="C:\\Program Files\\Android\\Android Studio\\bin\\studio64.exe";try{if(!await(0,er.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){u6("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 Koe(t,e,r){if(process.env.CAPACITOR_COCOAPODS_PATH)return process.env.CAPACITOR_COCOAPODS_PATH;let n="";if(await(0,er.pathExists)((0,ie.resolve)(t,"Gemfile"))?n=(0,ie.resolve)(t,"Gemfile"):await(0,er.pathExists)((0,ie.resolve)(e,"Gemfile"))?n=(0,ie.resolve)(e,"Gemfile"):await(0,er.pathExists)((0,ie.resolve)(r,"Gemfile"))&&(n=(0,ie.resolve)(r,"Gemfile")),!(n!=""))try{let o=await(0,$oe.getCommandOutput)("git",["rev-parse","--show-toplevel"],{cwd:t});o!=null&&(n=(0,ie.resolve)(o,"Gemfile"))}catch{}try{let o=(await(0,er.readFile)(n)).toString();return o&&new RegExp(/gem\s+['"]cocoapods/).test(o)?"bundle exec pod":"pod"}catch{return"pod"}}function Yoe(t){return`import type { CapacitorConfig } from '@capacitor/cli';
186
186
 
187
187
  const config: CapacitorConfig = ${(0,Roe.formatJSObject)(t)};
188
188
 
189
189
  export default config;
190
- `}function Joe(t){if(typeof t.extConfig.bundledWebRuntime<"u"){let e="Can be safely deleted.";t.extConfig.bundledWebRuntime===!0&&(e="Please, use a bundler to bundle Capacitor and its plugins."),u6.logger.warn(`The ${Di.default.strong("bundledWebRuntime")} configuration option has been deprecated. ${e}`)}}it.checkExternalConfig=Joe});function Xoe(){try{return Nv.default.statSync("/.dockerenv"),!0}catch{return!1}}function Zoe(){try{return Nv.default.readFileSync("/proc/self/cgroup","utf8").includes("docker")}catch{return!1}}function Lv(){return jv===void 0&&(jv=Xoe()||Zoe()),jv}var Nv,jv,d6=ct(()=>{Nv=le(require("node:fs"),1)});function aa(){return Bv===void 0&&(Bv=Qoe()||Lv()),Bv}var h6,Bv,Qoe,qv=ct(()=>{h6=le(require("node:fs"),1);d6();Qoe=()=>{try{return h6.default.statSync("/run/.containerenv"),!0}catch{return!1}}});var Mv,m6,g6,p6,Tc,y6=ct(()=>{Mv=le(require("node:process"),1),m6=le(require("node:os"),1),g6=le(require("node:fs"),1);qv();p6=()=>{if(Mv.default.platform!=="linux")return!1;if(m6.default.release().toLowerCase().includes("microsoft"))return!aa();try{return g6.default.readFileSync("/proc/version","utf8").toLowerCase().includes("microsoft")?!aa():!1}catch{return!1}},Tc=Mv.default.env.__IS_WSL_TEST__?p6:p6()});function Do(t,e,r){let n=i=>Object.defineProperty(t,e,{value:i,enumerable:!0,writable:!0});return Object.defineProperty(t,e,{configurable:!0,enumerable:!0,get(){let i=r();return n(i),i},set(i){n(i)}}),t}var D6=ct(()=>{});async function Uv(){if(b6.default.platform!=="darwin")throw new Error("macOS only");let{stdout:t}=await ese("defaults",["read","com.apple.LaunchServices/com.apple.launchservices.secure","LSHandlers"]);return/LSHandlerRoleAll = "(?!-)(?<id>[^"]+?)";\s+?LSHandlerURLScheme = (?:http|https);/.exec(t)?.groups.id??"com.apple.Safari"}var v6,b6,w6,ese,_6=ct(()=>{v6=require("node:util"),b6=le(require("node:process"),1),w6=require("node:child_process"),ese=(0,v6.promisify)(w6.execFile)});async function S6(t,{humanReadableOutput:e=!0}={}){if(E6.default.platform!=="darwin")throw new Error("macOS only");let r=e?[]:["-ss"],{stdout:n}=await tse("osascript",["-e",t,r]);return n.trim()}var E6,C6,Vv,tse,x6=ct(()=>{E6=le(require("node:process"),1),C6=require("node:util"),Vv=require("node:child_process"),tse=(0,C6.promisify)(Vv.execFile)});async function Hv(t){return S6(`tell application "Finder" to set app_path to application file id "${t}" as string
191
- tell application "System Events" to get value of property list item "CFBundleName" of property list file (app_path & ":Contents:Info.plist")`)}var F6=ct(()=>{x6()});async function zv(t=rse){let{stdout:e}=await t("reg",["QUERY"," HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\http\\UserChoice","/v","ProgId"]),r=/ProgId\s*REG_SZ\s*(?<id>\S+)/.exec(e);if(!r)throw new Fh(`Cannot find Windows browser in stdout: ${JSON.stringify(e)}`);let{id:n}=r.groups,i=nse[n];if(!i)throw new Fh(`Unknown browser ID: ${n}`);return i}var O6,A6,rse,nse,Fh,k6=ct(()=>{O6=require("node:util"),A6=require("node:child_process"),rse=(0,O6.promisify)(A6.execFile),nse={AppXq0fevzme2pys62n3e0fbqa7peapykr8v:{name:"Edge",id:"com.microsoft.edge.old"},MSEdgeDHTML:{name:"Edge",id:"com.microsoft.edge"},MSEdgeHTM:{name:"Edge",id:"com.microsoft.edge"},"IE.HTTP":{name:"Internet Explorer",id:"com.microsoft.ie"},FirefoxURL:{name:"Firefox",id:"org.mozilla.firefox"},ChromeHTML:{name:"Chrome",id:"com.google.chrome"},BraveHTML:{name:"Brave",id:"com.brave.Browser"},BraveBHTML:{name:"Brave Beta",id:"com.brave.Browser.beta"},BraveSSHTM:{name:"Brave Nightly",id:"com.brave.Browser.nightly"}},Fh=class extends Error{}});async function Gv(){if(Oh.default.platform==="darwin"){let t=await Uv();return{name:await Hv(t),id:t}}if(Oh.default.platform==="linux"){let{stdout:t}=await ise("xdg-mime",["query","default","x-scheme-handler/http"]),e=t.trim();return{name:ose(e.replace(/.desktop$/,"").replace("-"," ")),id:e}}if(Oh.default.platform==="win32")return zv();throw new Error("Only macOS, Linux, and Windows are supported")}var T6,Oh,P6,ise,ose,R6=ct(()=>{T6=require("node:util"),Oh=le(require("node:process"),1),P6=require("node:child_process");_6();F6();k6();ise=(0,T6.promisify)(P6.execFile),ose=t=>t.toLowerCase().replaceAll(/(?:^|\s|-)\S/g,e=>e.toUpperCase())});var M6={};mn(M6,{apps:()=>bo,default:()=>cse,openApp:()=>use});function N6(t){if(typeof t=="string"||Array.isArray(t))return t;let{[I6]:e}=t;if(!e)throw new Error(`${I6} is not supported`);return e}function Yv({[ua]:t},{wsl:e}){if(e&&Tc)return N6(e);if(!t)throw new Error(`${ua} is not supported`);return N6(t)}var Pc,L6,Kv,B6,q6,vo,lse,Wv,$6,ua,I6,sse,j6,Rc,ase,use,bo,cse,U6=ct(()=>{Pc=le(require("node:process"),1),L6=require("node:buffer"),Kv=le(require("node:path"),1),B6=require("node:url"),q6=le(require("node:child_process"),1),vo=le(require("node:fs/promises"),1);y6();D6();R6();qv();lse={},Wv=Kv.default.dirname((0,B6.fileURLToPath)(lse.url)),$6=Kv.default.join(Wv,"xdg-open"),{platform:ua,arch:I6}=Pc.default,sse=(()=>{let t="/mnt/",e;return async function(){if(e)return e;let r="/etc/wsl.conf",n=!1;try{await vo.default.access(r,vo.constants.F_OK),n=!0}catch{}if(!n)return t;let i=await vo.default.readFile(r,{encoding:"utf8"}),o=/(?<!#.*)root\s*=\s*(?<mountPoint>.*)/g.exec(i);return o?(e=o.groups.mountPoint.trim(),e=e.endsWith("/")?e:`${e}/`,e):t}})(),j6=async(t,e)=>{let r;for(let n of t)try{return await e(n)}catch(i){r=i}throw r},Rc=async t=>{if(t={wait:!1,background:!1,newInstance:!1,allowNonzeroExitCode:!1,...t},Array.isArray(t.app))return j6(t.app,a=>Rc({...t,app:a}));let{name:e,arguments:r=[]}=t.app??{};if(r=[...r],Array.isArray(e))return j6(e,a=>Rc({...t,app:{name:a,arguments:r}}));if(e==="browser"||e==="browserPrivate"){let a={"com.google.chrome":"chrome","google-chrome.desktop":"chrome","org.mozilla.firefox":"firefox","firefox.desktop":"firefox","com.microsoft.msedge":"edge","com.microsoft.edge":"edge","microsoft-edge.desktop":"edge"},u={chrome:"--incognito",firefox:"--private-window",edge:"--inPrivate"},c=await Gv();if(c.id in a){let l=a[c.id];return e==="browserPrivate"&&r.push(u[l]),Rc({...t,app:{name:bo[l],arguments:r}})}throw new Error(`${c.name} is not supported as a default browser`)}let n,i=[],o={};if(ua==="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(ua==="win32"||Tc&&!aa()&&!e){let a=await sse();n=Tc?`${a}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe`:`${Pc.default.env.SYSTEMROOT||Pc.default.env.windir||"C:\\Windows"}\\System32\\WindowsPowerShell\\v1.0\\powershell`,i.push("-NoProfile","-NonInteractive","-ExecutionPolicy","Bypass","-EncodedCommand"),Tc||(o.windowsVerbatimArguments=!0);let u=["Start"];t.wait&&u.push("-Wait"),e?(u.push(`"\`"${e}\`""`),t.target&&r.push(t.target)):t.target&&u.push(`"${t.target}"`),r.length>0&&(r=r.map(c=>`"\`"${c}\`""`),u.push("-ArgumentList",r.join(","))),t.target=L6.Buffer.from(u.join(" "),"utf16le").toString("base64")}else{if(e)n=e;else{let a=!Wv||Wv==="/",u=!1;try{await vo.default.access($6,vo.constants.X_OK),u=!0}catch{}n=Pc.default.versions.electron??(ua==="android"||a||!u)?"xdg-open":$6}r.length>0&&i.push(...r),t.wait||(o.stdio="ignore",o.detached=!0)}ua==="darwin"&&r.length>0&&i.push("--args",...r),t.target&&i.push(t.target);let s=q6.default.spawn(n,i,o);return t.wait?new Promise((a,u)=>{s.once("error",u),s.once("close",c=>{if(!t.allowNonzeroExitCode&&c>0){u(new Error(`Exited with code ${c}`));return}a(s)})}):(s.unref(),s)},ase=(t,e)=>{if(typeof t!="string")throw new TypeError("Expected a `target`");return Rc({...e,target:t})},use=(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 Rc({...e,app:{name:t,arguments:r}})};bo={};Do(bo,"chrome",()=>Yv({darwin:"google chrome",win32:"chrome",linux:["google-chrome","google-chrome-stable","chromium"]},{wsl:{ia32:"/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe",x64:["/mnt/c/Program Files/Google/Chrome/Application/chrome.exe","/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe"]}}));Do(bo,"firefox",()=>Yv({darwin:"firefox",win32:"C:\\Program Files\\Mozilla Firefox\\firefox.exe",linux:"firefox"},{wsl:"/mnt/c/Program Files/Mozilla Firefox/firefox.exe"}));Do(bo,"edge",()=>Yv({darwin:"microsoft edge",win32:"msedge",linux:["microsoft-edge","microsoft-edge-dev"]},{wsl:"/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe"}));Do(bo,"browser",()=>"browser");Do(bo,"browserPrivate",()=>"browserPrivate");cse=ase});var mj=y(_o=>{_o.parse=_o.decode=_se;_o.stringify=_o.encode=dj;_o.safe=ya;_o.unsafe=$h;var ob=typeof process<"u"&&process.platform==="win32"?`\r
190
+ `}function Joe(t){if(typeof t.extConfig.bundledWebRuntime<"u"){let e="Can be safely deleted.";t.extConfig.bundledWebRuntime===!0&&(e="Please, use a bundler to bundle Capacitor and its plugins."),a6.logger.warn(`The ${Di.default.strong("bundledWebRuntime")} configuration option has been deprecated. ${e}`)}}it.checkExternalConfig=Joe});function Xoe(){try{return Nv.default.statSync("/.dockerenv"),!0}catch{return!1}}function Zoe(){try{return Nv.default.readFileSync("/proc/self/cgroup","utf8").includes("docker")}catch{return!1}}function Lv(){return jv===void 0&&(jv=Xoe()||Zoe()),jv}var Nv,jv,f6=ct(()=>{Nv=le(require("node:fs"),1)});function aa(){return Bv===void 0&&(Bv=Qoe()||Lv()),Bv}var d6,Bv,Qoe,qv=ct(()=>{d6=le(require("node:fs"),1);f6();Qoe=()=>{try{return d6.default.statSync("/run/.containerenv"),!0}catch{return!1}}});var Mv,p6,m6,h6,Tc,g6=ct(()=>{Mv=le(require("node:process"),1),p6=le(require("node:os"),1),m6=le(require("node:fs"),1);qv();h6=()=>{if(Mv.default.platform!=="linux")return!1;if(p6.default.release().toLowerCase().includes("microsoft"))return!aa();try{return m6.default.readFileSync("/proc/version","utf8").toLowerCase().includes("microsoft")?!aa():!1}catch{return!1}},Tc=Mv.default.env.__IS_WSL_TEST__?h6:h6()});function Do(t,e,r){let n=i=>Object.defineProperty(t,e,{value:i,enumerable:!0,writable:!0});return Object.defineProperty(t,e,{configurable:!0,enumerable:!0,get(){let i=r();return n(i),i},set(i){n(i)}}),t}var y6=ct(()=>{});async function Uv(){if(v6.default.platform!=="darwin")throw new Error("macOS only");let{stdout:t}=await ese("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 D6,v6,b6,ese,w6=ct(()=>{D6=require("node:util"),v6=le(require("node:process"),1),b6=require("node:child_process"),ese=(0,D6.promisify)(b6.execFile)});async function C6(t,{humanReadableOutput:e=!0}={}){if(_6.default.platform!=="darwin")throw new Error("macOS only");let r=e?[]:["-ss"],{stdout:n}=await tse("osascript",["-e",t,r]);return n.trim()}var _6,E6,Vv,tse,S6=ct(()=>{_6=le(require("node:process"),1),E6=require("node:util"),Vv=require("node:child_process"),tse=(0,E6.promisify)(Vv.execFile)});async function Hv(t){return C6(`tell application "Finder" to set app_path to application file id "${t}" as string
191
+ tell application "System Events" to get value of property list item "CFBundleName" of property list file (app_path & ":Contents:Info.plist")`)}var x6=ct(()=>{S6()});async function zv(t=rse){let{stdout:e}=await t("reg",["QUERY"," HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\http\\UserChoice","/v","ProgId"]),r=/ProgId\s*REG_SZ\s*(?<id>\S+)/.exec(e);if(!r)throw new Fh(`Cannot find Windows browser in stdout: ${JSON.stringify(e)}`);let{id:n}=r.groups,i=nse[n];if(!i)throw new Fh(`Unknown browser ID: ${n}`);return i}var F6,O6,rse,nse,Fh,A6=ct(()=>{F6=require("node:util"),O6=require("node:child_process"),rse=(0,F6.promisify)(O6.execFile),nse={AppXq0fevzme2pys62n3e0fbqa7peapykr8v:{name:"Edge",id:"com.microsoft.edge.old"},MSEdgeDHTML:{name:"Edge",id:"com.microsoft.edge"},MSEdgeHTM:{name:"Edge",id:"com.microsoft.edge"},"IE.HTTP":{name:"Internet Explorer",id:"com.microsoft.ie"},FirefoxURL:{name:"Firefox",id:"org.mozilla.firefox"},ChromeHTML:{name:"Chrome",id:"com.google.chrome"},BraveHTML:{name:"Brave",id:"com.brave.Browser"},BraveBHTML:{name:"Brave Beta",id:"com.brave.Browser.beta"},BraveSSHTM:{name:"Brave Nightly",id:"com.brave.Browser.nightly"}},Fh=class extends Error{}});async function Gv(){if(Oh.default.platform==="darwin"){let t=await Uv();return{name:await Hv(t),id:t}}if(Oh.default.platform==="linux"){let{stdout:t}=await ise("xdg-mime",["query","default","x-scheme-handler/http"]),e=t.trim();return{name:ose(e.replace(/.desktop$/,"").replace("-"," ")),id:e}}if(Oh.default.platform==="win32")return zv();throw new Error("Only macOS, Linux, and Windows are supported")}var k6,Oh,T6,ise,ose,P6=ct(()=>{k6=require("node:util"),Oh=le(require("node:process"),1),T6=require("node:child_process");w6();x6();A6();ise=(0,k6.promisify)(T6.execFile),ose=t=>t.toLowerCase().replaceAll(/(?:^|\s|-)\S/g,e=>e.toUpperCase())});var q6={};mn(q6,{apps:()=>bo,default:()=>cse,openApp:()=>use});function j6(t){if(typeof t=="string"||Array.isArray(t))return t;let{[$6]:e}=t;if(!e)throw new Error(`${$6} is not supported`);return e}function Yv({[ua]:t},{wsl:e}){if(e&&Tc)return j6(e);if(!t)throw new Error(`${ua} is not supported`);return j6(t)}var Pc,N6,Kv,L6,B6,vo,lse,Wv,R6,ua,$6,sse,I6,Rc,ase,use,bo,cse,M6=ct(()=>{Pc=le(require("node:process"),1),N6=require("node:buffer"),Kv=le(require("node:path"),1),L6=require("node:url"),B6=le(require("node:child_process"),1),vo=le(require("node:fs/promises"),1);g6();y6();P6();qv();lse={},Wv=Kv.default.dirname((0,L6.fileURLToPath)(lse.url)),R6=Kv.default.join(Wv,"xdg-open"),{platform:ua,arch:$6}=Pc.default,sse=(()=>{let t="/mnt/",e;return async function(){if(e)return e;let r="/etc/wsl.conf",n=!1;try{await vo.default.access(r,vo.constants.F_OK),n=!0}catch{}if(!n)return t;let i=await vo.default.readFile(r,{encoding:"utf8"}),o=/(?<!#.*)root\s*=\s*(?<mountPoint>.*)/g.exec(i);return o?(e=o.groups.mountPoint.trim(),e=e.endsWith("/")?e:`${e}/`,e):t}})(),I6=async(t,e)=>{let r;for(let n of t)try{return await e(n)}catch(i){r=i}throw r},Rc=async t=>{if(t={wait:!1,background:!1,newInstance:!1,allowNonzeroExitCode:!1,...t},Array.isArray(t.app))return I6(t.app,a=>Rc({...t,app:a}));let{name:e,arguments:r=[]}=t.app??{};if(r=[...r],Array.isArray(e))return I6(e,a=>Rc({...t,app:{name:a,arguments:r}}));if(e==="browser"||e==="browserPrivate"){let a={"com.google.chrome":"chrome","google-chrome.desktop":"chrome","org.mozilla.firefox":"firefox","firefox.desktop":"firefox","com.microsoft.msedge":"edge","com.microsoft.edge":"edge","microsoft-edge.desktop":"edge"},u={chrome:"--incognito",firefox:"--private-window",edge:"--inPrivate"},c=await Gv();if(c.id in a){let l=a[c.id];return e==="browserPrivate"&&r.push(u[l]),Rc({...t,app:{name:bo[l],arguments:r}})}throw new Error(`${c.name} is not supported as a default browser`)}let n,i=[],o={};if(ua==="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(ua==="win32"||Tc&&!aa()&&!e){let a=await sse();n=Tc?`${a}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe`:`${Pc.default.env.SYSTEMROOT||Pc.default.env.windir||"C:\\Windows"}\\System32\\WindowsPowerShell\\v1.0\\powershell`,i.push("-NoProfile","-NonInteractive","-ExecutionPolicy","Bypass","-EncodedCommand"),Tc||(o.windowsVerbatimArguments=!0);let u=["Start"];t.wait&&u.push("-Wait"),e?(u.push(`"\`"${e}\`""`),t.target&&r.push(t.target)):t.target&&u.push(`"${t.target}"`),r.length>0&&(r=r.map(c=>`"\`"${c}\`""`),u.push("-ArgumentList",r.join(","))),t.target=N6.Buffer.from(u.join(" "),"utf16le").toString("base64")}else{if(e)n=e;else{let a=!Wv||Wv==="/",u=!1;try{await vo.default.access(R6,vo.constants.X_OK),u=!0}catch{}n=Pc.default.versions.electron??(ua==="android"||a||!u)?"xdg-open":R6}r.length>0&&i.push(...r),t.wait||(o.stdio="ignore",o.detached=!0)}ua==="darwin"&&r.length>0&&i.push("--args",...r),t.target&&i.push(t.target);let s=B6.default.spawn(n,i,o);return t.wait?new Promise((a,u)=>{s.once("error",u),s.once("close",c=>{if(!t.allowNonzeroExitCode&&c>0){u(new Error(`Exited with code ${c}`));return}a(s)})}):(s.unref(),s)},ase=(t,e)=>{if(typeof t!="string")throw new TypeError("Expected a `target`");return Rc({...e,target:t})},use=(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 Rc({...e,app:{name:t,arguments:r}})};bo={};Do(bo,"chrome",()=>Yv({darwin:"google chrome",win32:"chrome",linux:["google-chrome","google-chrome-stable","chromium"]},{wsl:{ia32:"/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe",x64:["/mnt/c/Program Files/Google/Chrome/Application/chrome.exe","/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe"]}}));Do(bo,"firefox",()=>Yv({darwin:"firefox",win32:"C:\\Program Files\\Mozilla Firefox\\firefox.exe",linux:"firefox"},{wsl:"/mnt/c/Program Files/Mozilla Firefox/firefox.exe"}));Do(bo,"edge",()=>Yv({darwin:"microsoft edge",win32:"msedge",linux:["microsoft-edge","microsoft-edge-dev"]},{wsl:"/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe"}));Do(bo,"browser",()=>"browser");Do(bo,"browserPrivate",()=>"browserPrivate");cse=ase});var mj=y(_o=>{_o.parse=_o.decode=_se;_o.stringify=_o.encode=dj;_o.safe=ya;_o.unsafe=$h;var ib=typeof process<"u"&&process.platform==="win32"?`\r
192
192
  `:`
193
193
  `;function dj(t,e){var r=[],n="";typeof e=="string"?e={section:e,whitespace:!1}:(e=e||{},e.whitespace=e.whitespace===!0);var i=e.whitespace?" = ":"=";return Object.keys(t).forEach(function(o,s,a){var u=t[o];u&&Array.isArray(u)?u.forEach(function(c){n+=ya(o+"[]")+i+ya(c)+`
194
- `}):u&&typeof u=="object"?r.push(o):n+=ya(o)+i+ya(u)+ob}),e.section&&n.length&&(n="["+ya(e.section)+"]"+ob+n),r.forEach(function(o,s,a){var u=hj(o).join("\\."),c=(e.section?e.section+".":"")+u,l=dj(t[o],{section:c,whitespace:e.whitespace});n.length&&l.length&&(n+=ob),n+=l}),n}function hj(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 _se(t){var e={},r=e,n=null,i=/^\[([^\]]*)\]$|^([^=]+)(=(.*))?$/i,o=t.split(/[\r\n]+/g);return o.forEach(function(s,a,u){if(!(!s||s.match(/^\s*[;#]/))){var c=s.match(i);if(c){if(c[1]!==void 0){if(n=$h(c[1]),n==="__proto__"){r={};return}r=e[n]=e[n]||{};return}var l=$h(c[2]);if(l!=="__proto__"){var f=c[3]?$h(c[4]):!0;switch(f){case"true":case"false":case"null":f=JSON.parse(f)}if(l.length>2&&l.slice(-2)==="[]"){if(l=l.substring(0,l.length-2),l==="__proto__")return;r[l]?Array.isArray(r[l])||(r[l]=[r[l]]):r[l]=[]}Array.isArray(r[l])?r[l].push(f):r[l]=f}}}}),Object.keys(e).filter(function(s,a,u){if(!e[s]||typeof e[s]!="object"||Array.isArray(e[s]))return!1;var c=hj(s),l=e,f=c.pop(),h=f.replace(/\\\./g,".");return c.forEach(function(d,m,b){d!=="__proto__"&&((!l[d]||typeof l[d]!="object")&&(l[d]={}),l=l[d])}),l===e&&h===f?!1:(l[h]=e[s],!0)}).forEach(function(s,a,u){delete e[s]}),e}function pj(t){return t.charAt(0)==='"'&&t.slice(-1)==='"'||t.charAt(0)==="'"&&t.slice(-1)==="'"}function ya(t){return typeof t!="string"||t.match(/[=\r\n]/)||t.match(/^\[/)||t.length>1&&pj(t)||t!==t.trim()?JSON.stringify(t):t.replace(/;/g,"\\;").replace(/#/g,"\\#")}function $h(t,e){if(t=(t||"").trim(),pj(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 Dj=y((Wge,yj)=>{"use strict";var sb=1,gj=2;function Ese(){return""}function Cse(t,e,r){return t.slice(e,r).replace(/\S/g," ")}yj.exports=function(t,e){e=e||{};for(var r,n,i=!1,o=!1,s=0,a="",u=e.whitespace===!1?Ese:Cse,c=0;c<t.length;c++){if(r=t[c],n=t[c+1],!o&&r==='"'){var l=t[c-1]==="\\"&&t[c-2]!=="\\";l||(i=!i)}if(!i){if(!o&&r+n==="//")a+=t.slice(s,c),s=c,o=sb,c++;else if(o===sb&&r+n===`\r
195
- `){c++,o=!1,a+=u(t,s,c),s=c;continue}else if(o===sb&&r===`
196
- `)o=!1,a+=u(t,s,c),s=c;else if(!o&&r+n==="/*"){a+=t.slice(s,c),s=c,o=gj,c++;continue}else if(o===gj&&r+n==="*/"){c++,o=!1,a+=u(t,s,c+1),s=c+1;continue}}}return a+(o?u(t.substr(s)):t.substr(s))}});var bj=y(Da=>{"use strict";var vj=require("fs"),Sse=mj(),Ic=require("path"),xse=Dj(),Fse=Da.parse=function(t){return/^\s*{/.test(t)?JSON.parse(xse(t)):Sse.parse(t)},Ose=Da.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=Ic.join.apply(null,t),n;try{return vj.readFileSync(r,"utf-8")}catch{return}},Kge=Da.json=function(){var t=Ose.apply(null,arguments);return t?Fse(t):null},Yge=Da.env=function(t,e){e=e||process.env;var r={},n=t.length;for(var i in e)if(i.toLowerCase().indexOf(t.toLowerCase())===0){for(var o=i.substring(n).split("__"),s;(s=o.indexOf(""))>-1;)o.splice(s,1);var a=r;o.forEach(function(c,l){!c||typeof a!="object"||(l===o.length-1&&(a[c]=e[i]),a[c]===void 0&&(a[c]={}),a=a[c])})}return r},Jge=Da.find=function(){var t=Ic.join.apply(null,[].slice.call(arguments));function e(r,n){var i=Ic.join(r,n);try{return vj.statSync(i),i}catch{if(Ic.dirname(r)!==r)return e(Ic.dirname(r),n)}}return e(process.cwd(),t)}});var xj=y((Zge,Sj)=>{"use strict";function _j(t){return t instanceof Buffer||t instanceof Date||t instanceof RegExp}function Ej(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 Cj(t){var e=[];return t.forEach(function(r,n){typeof r=="object"&&r!==null?Array.isArray(r)?e[n]=Cj(r):_j(r)?e[n]=Ej(r):e[n]=ab({},r):e[n]=r}),e}function wj(t,e){return e==="__proto__"?void 0:t[e]}var ab=Sj.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=wj(t,s),r=wj(o,s),r!==t)if(typeof r!="object"||r===null){t[s]=r;return}else if(Array.isArray(r)){t[s]=Cj(r);return}else if(_j(r)){t[s]=Ej(r);return}else if(typeof n!="object"||n===null||Array.isArray(n)){t[s]=ab({},r);return}else{t[s]=ab(n,r);return}})}),t}});var kj=y((Qge,Aj)=>{"use strict";function Ase(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 Fj(t){return typeof t=="number"||/^0x[0-9a-f]+$/i.test(t)?!0:/^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(t)}function Oj(t,e){return e==="constructor"&&typeof t[e]=="function"||e==="__proto__"}Aj.exports=function(t,e){e||(e={});var r={bools:{},strings:{},unknownFn:null};typeof e.unknown=="function"&&(r.unknownFn=e.unknown),typeof e.boolean=="boolean"&&e.boolean?r.allBools=!0:[].concat(e.boolean).filter(Boolean).forEach(function(C){r.bools[C]=!0});var n={};function i(C){return n[C].some(function(k){return r.bools[k]})}Object.keys(e.alias||{}).forEach(function(C){n[C]=[].concat(e.alias[C]),n[C].forEach(function(k){n[k]=[C].concat(n[C].filter(function($){return k!==$}))})}),[].concat(e.string).filter(Boolean).forEach(function(C){r.strings[C]=!0,n[C]&&[].concat(n[C]).forEach(function(k){r.strings[k]=!0})});var o=e.default||{},s={_:[]};function a(C,k){return r.allBools&&/^--[^=]+$/.test(k)||r.strings[C]||r.bools[C]||n[C]}function u(C,k,$){for(var F=C,L=0;L<k.length-1;L++){var S=k[L];if(Oj(F,S))return;F[S]===void 0&&(F[S]={}),(F[S]===Object.prototype||F[S]===Number.prototype||F[S]===String.prototype)&&(F[S]={}),F[S]===Array.prototype&&(F[S]=[]),F=F[S]}var I=k[k.length-1];Oj(F,I)||((F===Object.prototype||F===Number.prototype||F===String.prototype)&&(F={}),F===Array.prototype&&(F=[]),F[I]===void 0||r.bools[I]||typeof F[I]=="boolean"?F[I]=$:Array.isArray(F[I])?F[I].push($):F[I]=[F[I],$])}function c(C,k,$){if(!($&&r.unknownFn&&!a(C,$)&&r.unknownFn($)===!1)){var F=!r.strings[C]&&Fj(k)?Number(k):k;u(s,C.split("."),F),(n[C]||[]).forEach(function(L){u(s,L.split("."),F)})}}Object.keys(r.bools).forEach(function(C){c(C,o[C]===void 0?!1:o[C])});var l=[];t.indexOf("--")!==-1&&(l=t.slice(t.indexOf("--")+1),t=t.slice(0,t.indexOf("--")));for(var f=0;f<t.length;f++){var h=t[f],d,m;if(/^--.+=/.test(h)){var b=h.match(/^--([^=]+)=([\s\S]*)$/);d=b[1];var g=b[2];r.bools[d]&&(g=g!=="false"),c(d,g,h)}else if(/^--no-.+/.test(h))d=h.match(/^--no-(.+)/)[1],c(d,!1,h);else if(/^--.+/.test(h))d=h.match(/^--(.+)/)[1],m=t[f+1],m!==void 0&&!/^(-|--)[^-]/.test(m)&&!r.bools[d]&&!r.allBools&&(!n[d]||!i(d))?(c(d,m,h),f+=1):/^(true|false)$/.test(m)?(c(d,m==="true",h),f+=1):c(d,r.strings[d]?"":!0,h);else if(/^-[^-]+/.test(h)){for(var w=h.slice(1,-1).split(""),x=!1,D=0;D<w.length;D++){if(m=h.slice(D+2),m==="-"){c(w[D],m,h);continue}if(/[A-Za-z]/.test(w[D])&&m[0]==="="){c(w[D],m.slice(1),h),x=!0;break}if(/[A-Za-z]/.test(w[D])&&/-?\d+(\.\d*)?(e-?\d+)?$/.test(m)){c(w[D],m,h),x=!0;break}if(w[D+1]&&w[D+1].match(/\W/)){c(w[D],h.slice(D+2),h),x=!0;break}else c(w[D],r.strings[w[D]]?"":!0,h)}d=h.slice(-1)[0],!x&&d!=="-"&&(t[f+1]&&!/^(-|--)[^-]/.test(t[f+1])&&!r.bools[d]&&(!n[d]||!i(d))?(c(d,t[f+1],h),f+=1):t[f+1]&&/^(true|false)$/.test(t[f+1])?(c(d,t[f+1]==="true",h),f+=1):c(d,r.strings[d]?"":!0,h))}else if((!r.unknownFn||r.unknownFn(h)!==!1)&&s._.push(r.strings._||!Fj(h)?h:Number(h)),e.stopEarly){s._.push.apply(s._,t.slice(f+1));break}}return Object.keys(o).forEach(function(C){Ase(s,C.split("."))||(u(s,C.split("."),o[C]),(n[C]||[]).forEach(function(k){u(s,k.split("."),o[C])}))}),e["--"]?s["--"]=l.slice():l.forEach(function(C){s._.push(C)}),s}});var $j=y((eye,Rj)=>{var jc=bj(),va=require("path").join,kse=xj(),Tj="/etc",Pj=process.platform==="win32",Nc=Pj?process.env.USERPROFILE:process.env.HOME;Rj.exports=function(t,e,r,n){if(typeof t!="string")throw new Error("rc(name): name *must* be string");r||(r=kj()(process.argv.slice(2))),e=(typeof e=="string"?jc.json(e):e)||{},n=n||jc.parse;var i=jc.env(t+"_"),o=[e],s=[];function a(u){if(!(s.indexOf(u)>=0)){var c=jc.file(u);c&&(o.push(n(c)),s.push(u))}}return Pj||[va(Tj,t,"config"),va(Tj,t+"rc")].forEach(a),Nc&&[va(Nc,".config",t,"config"),va(Nc,".config",t),va(Nc,"."+t,"config"),va(Nc,"."+t+"rc")].forEach(a),a(jc.find("."+t+"rc")),i.config&&a(i.config),r.config&&a(r.config),kse.apply(null,o.concat([i,r,s.length?{configs:s,config:s[s.length-1]}:void 0]))}});var Nj=y((rye,jj)=>{var bi=require("constants"),Tse=process.cwd,Ih=null,Pse=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return Ih||(Ih=Tse.call(process)),Ih};try{process.cwd()}catch{}typeof process.chdir=="function"&&(cb=process.chdir,process.chdir=function(t){Ih=null,cb.call(process,t)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,cb));var cb;jj.exports=Rse;function Rse(t){bi.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&e(t),t.lutimes||r(t),t.chown=o(t.chown),t.fchown=o(t.fchown),t.lchown=o(t.lchown),t.chmod=n(t.chmod),t.fchmod=n(t.fchmod),t.lchmod=n(t.lchmod),t.chownSync=s(t.chownSync),t.fchownSync=s(t.fchownSync),t.lchownSync=s(t.lchownSync),t.chmodSync=i(t.chmodSync),t.fchmodSync=i(t.fchmodSync),t.lchmodSync=i(t.lchmodSync),t.stat=a(t.stat),t.fstat=a(t.fstat),t.lstat=a(t.lstat),t.statSync=u(t.statSync),t.fstatSync=u(t.fstatSync),t.lstatSync=u(t.lstatSync),t.chmod&&!t.lchmod&&(t.lchmod=function(l,f,h){h&&process.nextTick(h)},t.lchmodSync=function(){}),t.chown&&!t.lchown&&(t.lchown=function(l,f,h,d){d&&process.nextTick(d)},t.lchownSync=function(){}),Pse==="win32"&&(t.rename=typeof t.rename!="function"?t.rename:function(l){function f(h,d,m){var b=Date.now(),g=0;l(h,d,function w(x){if(x&&(x.code==="EACCES"||x.code==="EPERM")&&Date.now()-b<6e4){setTimeout(function(){t.stat(d,function(D,C){D&&D.code==="ENOENT"?l(h,d,w):m(x)})},g),g<100&&(g+=10);return}m&&m(x)})}return Object.setPrototypeOf&&Object.setPrototypeOf(f,l),f}(t.rename)),t.read=typeof t.read!="function"?t.read:function(l){function f(h,d,m,b,g,w){var x;if(w&&typeof w=="function"){var D=0;x=function(C,k,$){if(C&&C.code==="EAGAIN"&&D<10)return D++,l.call(t,h,d,m,b,g,x);w.apply(this,arguments)}}return l.call(t,h,d,m,b,g,x)}return Object.setPrototypeOf&&Object.setPrototypeOf(f,l),f}(t.read),t.readSync=typeof t.readSync!="function"?t.readSync:function(l){return function(f,h,d,m,b){for(var g=0;;)try{return l.call(t,f,h,d,m,b)}catch(w){if(w.code==="EAGAIN"&&g<10){g++;continue}throw w}}}(t.readSync);function e(l){l.lchmod=function(f,h,d){l.open(f,bi.O_WRONLY|bi.O_SYMLINK,h,function(m,b){if(m){d&&d(m);return}l.fchmod(b,h,function(g){l.close(b,function(w){d&&d(g||w)})})})},l.lchmodSync=function(f,h){var d=l.openSync(f,bi.O_WRONLY|bi.O_SYMLINK,h),m=!0,b;try{b=l.fchmodSync(d,h),m=!1}finally{if(m)try{l.closeSync(d)}catch{}else l.closeSync(d)}return b}}function r(l){bi.hasOwnProperty("O_SYMLINK")&&l.futimes?(l.lutimes=function(f,h,d,m){l.open(f,bi.O_SYMLINK,function(b,g){if(b){m&&m(b);return}l.futimes(g,h,d,function(w){l.close(g,function(x){m&&m(w||x)})})})},l.lutimesSync=function(f,h,d){var m=l.openSync(f,bi.O_SYMLINK),b,g=!0;try{b=l.futimesSync(m,h,d),g=!1}finally{if(g)try{l.closeSync(m)}catch{}else l.closeSync(m)}return b}):l.futimes&&(l.lutimes=function(f,h,d,m){m&&process.nextTick(m)},l.lutimesSync=function(){})}function n(l){return l&&function(f,h,d){return l.call(t,f,h,function(m){c(m)&&(m=null),d&&d.apply(this,arguments)})}}function i(l){return l&&function(f,h){try{return l.call(t,f,h)}catch(d){if(!c(d))throw d}}}function o(l){return l&&function(f,h,d,m){return l.call(t,f,h,d,function(b){c(b)&&(b=null),m&&m.apply(this,arguments)})}}function s(l){return l&&function(f,h,d){try{return l.call(t,f,h,d)}catch(m){if(!c(m))throw m}}}function a(l){return l&&function(f,h,d){typeof h=="function"&&(d=h,h=null);function m(b,g){g&&(g.uid<0&&(g.uid+=4294967296),g.gid<0&&(g.gid+=4294967296)),d&&d.apply(this,arguments)}return h?l.call(t,f,h,m):l.call(t,f,m)}}function u(l){return l&&function(f,h){var d=h?l.call(t,f,h):l.call(t,f);return d&&(d.uid<0&&(d.uid+=4294967296),d.gid<0&&(d.gid+=4294967296)),d}}function c(l){if(!l||l.code==="ENOSYS")return!0;var f=!process.getuid||process.getuid()!==0;return!!(f&&(l.code==="EINVAL"||l.code==="EPERM"))}}});var qj=y((nye,Bj)=>{var Lj=require("stream").Stream;Bj.exports=$se;function $se(t){return{ReadStream:e,WriteStream:r};function e(n,i){if(!(this instanceof e))return new e(n,i);Lj.call(this);var o=this;this.path=n,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=64*1024,i=i||{};for(var s=Object.keys(i),a=0,u=s.length;a<u;a++){var c=s[a];this[c]=i[c]}if(this.encoding&&this.setEncoding(this.encoding),this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.end===void 0)this.end=1/0;else if(typeof this.end!="number")throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}if(this.fd!==null){process.nextTick(function(){o._read()});return}t.open(this.path,this.flags,this.mode,function(l,f){if(l){o.emit("error",l),o.readable=!1;return}o.fd=f,o.emit("open",f),o._read()})}function r(n,i){if(!(this instanceof r))return new r(n,i);Lj.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 Uj=y((iye,Mj)=>{"use strict";Mj.exports=jse;var Ise=Object.getPrototypeOf||function(t){return t.__proto__};function jse(t){if(t===null||typeof t!="object")return t;if(t instanceof Object)var e={__proto__:Ise(t)};else var e=Object.create(null);return Object.getOwnPropertyNames(t).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}});var Gj=y((oye,db)=>{var We=require("fs"),Nse=Nj(),Lse=qj(),Bse=Uj(),jh=require("util"),Et,Lh;typeof Symbol=="function"&&typeof Symbol.for=="function"?(Et=Symbol.for("graceful-fs.queue"),Lh=Symbol.for("graceful-fs.previous")):(Et="___graceful-fs.queue",Lh="___graceful-fs.previous");function qse(){}function zj(t,e){Object.defineProperty(t,Et,{get:function(){return e}})}var Eo=qse;jh.debuglog?Eo=jh.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(Eo=function(){var t=jh.format.apply(jh,arguments);t="GFS4: "+t.split(/\n/).join(`
197
- GFS4: `),console.error(t)});We[Et]||(Vj=global[Et]||[],zj(We,Vj),We.close=function(t){function e(r,n){return t.call(We,r,function(i){i||Hj(),typeof n=="function"&&n.apply(this,arguments)})}return Object.defineProperty(e,Lh,{value:t}),e}(We.close),We.closeSync=function(t){function e(r){t.apply(We,arguments),Hj()}return Object.defineProperty(e,Lh,{value:t}),e}(We.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){Eo(We[Et]),require("assert").equal(We[Et].length,0)}));var Vj;global[Et]||zj(global,We[Et]);db.exports=lb(Bse(We));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!We.__patched&&(db.exports=lb(We),We.__patched=!0);function lb(t){Nse(t),t.gracefulify=lb,t.createReadStream=k,t.createWriteStream=$;var e=t.readFile;t.readFile=r;function r(S,I,R){return typeof I=="function"&&(R=I,I=null),B(S,I,R);function B(q,K,M,E){return e(q,K,function(v){v&&(v.code==="EMFILE"||v.code==="ENFILE")?ba([B,[q,K,M],v,E||Date.now(),Date.now()]):typeof M=="function"&&M.apply(this,arguments)})}}var n=t.writeFile;t.writeFile=i;function i(S,I,R,B){return typeof R=="function"&&(B=R,R=null),q(S,I,R,B);function q(K,M,E,v,_){return n(K,M,E,function(O){O&&(O.code==="EMFILE"||O.code==="ENFILE")?ba([q,[K,M,E,v],O,_||Date.now(),Date.now()]):typeof v=="function"&&v.apply(this,arguments)})}}var o=t.appendFile;o&&(t.appendFile=s);function s(S,I,R,B){return typeof R=="function"&&(B=R,R=null),q(S,I,R,B);function q(K,M,E,v,_){return o(K,M,E,function(O){O&&(O.code==="EMFILE"||O.code==="ENFILE")?ba([q,[K,M,E,v],O,_||Date.now(),Date.now()]):typeof v=="function"&&v.apply(this,arguments)})}}var a=t.copyFile;a&&(t.copyFile=u);function u(S,I,R,B){return typeof R=="function"&&(B=R,R=0),q(S,I,R,B);function q(K,M,E,v,_){return a(K,M,E,function(O){O&&(O.code==="EMFILE"||O.code==="ENFILE")?ba([q,[K,M,E,v],O,_||Date.now(),Date.now()]):typeof v=="function"&&v.apply(this,arguments)})}}var c=t.readdir;t.readdir=f;var l=/^v[0-5]\./;function f(S,I,R){typeof I=="function"&&(R=I,I=null);var B=l.test(process.version)?function(M,E,v,_){return c(M,q(M,E,v,_))}:function(M,E,v,_){return c(M,E,q(M,E,v,_))};return B(S,I,R);function q(K,M,E,v){return function(_,O){_&&(_.code==="EMFILE"||_.code==="ENFILE")?ba([B,[K,M,E],_,v||Date.now(),Date.now()]):(O&&O.sort&&O.sort(),typeof E=="function"&&E.call(this,_,O))}}}if(process.version.substr(0,4)==="v0.8"){var h=Lse(t);w=h.ReadStream,D=h.WriteStream}var d=t.ReadStream;d&&(w.prototype=Object.create(d.prototype),w.prototype.open=x);var m=t.WriteStream;m&&(D.prototype=Object.create(m.prototype),D.prototype.open=C),Object.defineProperty(t,"ReadStream",{get:function(){return w},set:function(S){w=S},enumerable:!0,configurable:!0}),Object.defineProperty(t,"WriteStream",{get:function(){return D},set:function(S){D=S},enumerable:!0,configurable:!0});var b=w;Object.defineProperty(t,"FileReadStream",{get:function(){return b},set:function(S){b=S},enumerable:!0,configurable:!0});var g=D;Object.defineProperty(t,"FileWriteStream",{get:function(){return g},set:function(S){g=S},enumerable:!0,configurable:!0});function w(S,I){return this instanceof w?(d.apply(this,arguments),this):w.apply(Object.create(w.prototype),arguments)}function x(){var S=this;L(S.path,S.flags,S.mode,function(I,R){I?(S.autoClose&&S.destroy(),S.emit("error",I)):(S.fd=R,S.emit("open",R),S.read())})}function D(S,I){return this instanceof D?(m.apply(this,arguments),this):D.apply(Object.create(D.prototype),arguments)}function C(){var S=this;L(S.path,S.flags,S.mode,function(I,R){I?(S.destroy(),S.emit("error",I)):(S.fd=R,S.emit("open",R))})}function k(S,I){return new t.ReadStream(S,I)}function $(S,I){return new t.WriteStream(S,I)}var F=t.open;t.open=L;function L(S,I,R,B){return typeof R=="function"&&(B=R,R=null),q(S,I,R,B);function q(K,M,E,v,_){return F(K,M,E,function(O,j){O&&(O.code==="EMFILE"||O.code==="ENFILE")?ba([q,[K,M,E,v],O,_||Date.now(),Date.now()]):typeof v=="function"&&v.apply(this,arguments)})}}return t}function ba(t){Eo("ENQUEUE",t[0].name,t[1]),We[Et].push(t),fb()}var Nh;function Hj(){for(var t=Date.now(),e=0;e<We[Et].length;++e)We[Et][e].length>2&&(We[Et][e][3]=t,We[Et][e][4]=t);fb()}function fb(){if(clearTimeout(Nh),Nh=void 0,We[Et].length!==0){var t=We[Et].shift(),e=t[0],r=t[1],n=t[2],i=t[3],o=t[4];if(i===void 0)Eo("RETRY",e.name,r),e.apply(null,r);else if(Date.now()-i>=6e4){Eo("TIMEOUT",e.name,r);var s=r.pop();typeof s=="function"&&s.call(null,n)}else{var a=Date.now()-o,u=Math.max(o-i,1),c=Math.min(u*1.2,100);a>=c?(Eo("RETRY",e.name,r),e.apply(null,r.concat([i]))):We[Et].push(t)}Nh===void 0&&(Nh=setTimeout(fb,0))}}});var Wj=y(wa=>{"use strict";var Mse=wa&&wa.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(wa,"__esModule",{value:!0});wa.readCAFileSync=void 0;var Use=Mse(Gj());function Vse(t){try{let e=Use.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}}wa.readCAFileSync=Vse});var Kj=y(Co=>{"use strict";var Hse=Co&&Co.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),zse=Co&&Co.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Hse(e,t,r)};Object.defineProperty(Co,"__esModule",{value:!0});zse(Wj(),Co)});var Xj=y((uye,Jj)=>{Jj.exports=Yj;function So(t,e){if(typeof Object.setPrototypeOf=="function")return Object.setPrototypeOf(t,e);t.__proto__=e}function Yj(){this.list=[];var t=null;Object.defineProperty(this,"root",{get:function(){return t},set:function(e){t=e,this.list.length&&So(this.list[this.list.length-1],e)},enumerable:!0,configurable:!0})}Yj.prototype={get length(){return this.list.length},get keys(){var t=[];for(var e in this.list[0])t.push(e);return t},get snapshot(){var t={};return this.keys.forEach(function(e){t[e]=this.get(e)},this),t},get store(){return this.list[0]},push:function(t){return typeof t!="object"&&(t={valueOf:t}),this.list.length>=1&&So(this.list[this.list.length-1],t),So(t,this.root),this.list.push(t)},pop:function(){return this.list.length>=2&&So(this.list[this.list.length-2],this.root),this.list.pop()},unshift:function(t){return So(t,this.list[0]||this.root),this.list.unshift(t)},shift:function(){return this.list.length===1&&So(this.list[0],this.root),this.list.shift()},get:function(t){return this.list[0][t]},set:function(t,e,r){return this.length||this.push({}),r&&this.list[0].hasOwnProperty(t)&&this.push({}),this.list[0][t]=e},forEach:function(t,e){for(var r in this.list[0])t.call(e,r,this.list[0][r])},slice:function(){return this.list.slice.apply(this.list,arguments)},splice:function(){for(var t=this.list.splice.apply(this.list,arguments),e=0,r=this.list.length;e<r;e++)So(this.list[e],this.list[e+1]||this.root);return t}}});var t8=y(xo=>{xo.parse=xo.decode=Gse;xo.stringify=xo.encode=Zj;xo.safe=_a;xo.unsafe=Bh;var hb=typeof process<"u"&&process.platform==="win32"?`\r
194
+ `}):u&&typeof u=="object"?r.push(o):n+=ya(o)+i+ya(u)+ib}),e.section&&n.length&&(n="["+ya(e.section)+"]"+ib+n),r.forEach(function(o,s,a){var u=hj(o).join("\\."),c=(e.section?e.section+".":"")+u,l=dj(t[o],{section:c,whitespace:e.whitespace});n.length&&l.length&&(n+=ib),n+=l}),n}function hj(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 _se(t){var e={},r=e,n=null,i=/^\[([^\]]*)\]$|^([^=]+)(=(.*))?$/i,o=t.split(/[\r\n]+/g);return o.forEach(function(s,a,u){if(!(!s||s.match(/^\s*[;#]/))){var c=s.match(i);if(c){if(c[1]!==void 0){if(n=$h(c[1]),n==="__proto__"){r={};return}r=e[n]=e[n]||{};return}var l=$h(c[2]);if(l!=="__proto__"){var f=c[3]?$h(c[4]):!0;switch(f){case"true":case"false":case"null":f=JSON.parse(f)}if(l.length>2&&l.slice(-2)==="[]"){if(l=l.substring(0,l.length-2),l==="__proto__")return;r[l]?Array.isArray(r[l])||(r[l]=[r[l]]):r[l]=[]}Array.isArray(r[l])?r[l].push(f):r[l]=f}}}}),Object.keys(e).filter(function(s,a,u){if(!e[s]||typeof e[s]!="object"||Array.isArray(e[s]))return!1;var c=hj(s),l=e,f=c.pop(),h=f.replace(/\\\./g,".");return c.forEach(function(d,m,b){d!=="__proto__"&&((!l[d]||typeof l[d]!="object")&&(l[d]={}),l=l[d])}),l===e&&h===f?!1:(l[h]=e[s],!0)}).forEach(function(s,a,u){delete e[s]}),e}function pj(t){return t.charAt(0)==='"'&&t.slice(-1)==='"'||t.charAt(0)==="'"&&t.slice(-1)==="'"}function ya(t){return typeof t!="string"||t.match(/[=\r\n]/)||t.match(/^\[/)||t.length>1&&pj(t)||t!==t.trim()?JSON.stringify(t):t.replace(/;/g,"\\;").replace(/#/g,"\\#")}function $h(t,e){if(t=(t||"").trim(),pj(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 Dj=y((Wge,yj)=>{"use strict";var ob=1,gj=2;function Ese(){return""}function Cse(t,e,r){return t.slice(e,r).replace(/\S/g," ")}yj.exports=function(t,e){e=e||{};for(var r,n,i=!1,o=!1,s=0,a="",u=e.whitespace===!1?Ese:Cse,c=0;c<t.length;c++){if(r=t[c],n=t[c+1],!o&&r==='"'){var l=t[c-1]==="\\"&&t[c-2]!=="\\";l||(i=!i)}if(!i){if(!o&&r+n==="//")a+=t.slice(s,c),s=c,o=ob,c++;else if(o===ob&&r+n===`\r
195
+ `){c++,o=!1,a+=u(t,s,c),s=c;continue}else if(o===ob&&r===`
196
+ `)o=!1,a+=u(t,s,c),s=c;else if(!o&&r+n==="/*"){a+=t.slice(s,c),s=c,o=gj,c++;continue}else if(o===gj&&r+n==="*/"){c++,o=!1,a+=u(t,s,c+1),s=c+1;continue}}}return a+(o?u(t.substr(s)):t.substr(s))}});var bj=y(Da=>{"use strict";var vj=require("fs"),Sse=mj(),Ic=require("path"),xse=Dj(),Fse=Da.parse=function(t){return/^\s*{/.test(t)?JSON.parse(xse(t)):Sse.parse(t)},Ose=Da.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=Ic.join.apply(null,t),n;try{return vj.readFileSync(r,"utf-8")}catch{return}},Kge=Da.json=function(){var t=Ose.apply(null,arguments);return t?Fse(t):null},Yge=Da.env=function(t,e){e=e||process.env;var r={},n=t.length;for(var i in e)if(i.toLowerCase().indexOf(t.toLowerCase())===0){for(var o=i.substring(n).split("__"),s;(s=o.indexOf(""))>-1;)o.splice(s,1);var a=r;o.forEach(function(c,l){!c||typeof a!="object"||(l===o.length-1&&(a[c]=e[i]),a[c]===void 0&&(a[c]={}),a=a[c])})}return r},Jge=Da.find=function(){var t=Ic.join.apply(null,[].slice.call(arguments));function e(r,n){var i=Ic.join(r,n);try{return vj.statSync(i),i}catch{if(Ic.dirname(r)!==r)return e(Ic.dirname(r),n)}}return e(process.cwd(),t)}});var xj=y((Zge,Sj)=>{"use strict";function _j(t){return t instanceof Buffer||t instanceof Date||t instanceof RegExp}function Ej(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 Cj(t){var e=[];return t.forEach(function(r,n){typeof r=="object"&&r!==null?Array.isArray(r)?e[n]=Cj(r):_j(r)?e[n]=Ej(r):e[n]=sb({},r):e[n]=r}),e}function wj(t,e){return e==="__proto__"?void 0:t[e]}var sb=Sj.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=wj(t,s),r=wj(o,s),r!==t)if(typeof r!="object"||r===null){t[s]=r;return}else if(Array.isArray(r)){t[s]=Cj(r);return}else if(_j(r)){t[s]=Ej(r);return}else if(typeof n!="object"||n===null||Array.isArray(n)){t[s]=sb({},r);return}else{t[s]=sb(n,r);return}})}),t}});var kj=y((Qge,Aj)=>{"use strict";function Ase(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 Fj(t){return typeof t=="number"||/^0x[0-9a-f]+$/i.test(t)?!0:/^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(t)}function Oj(t,e){return e==="constructor"&&typeof t[e]=="function"||e==="__proto__"}Aj.exports=function(t,e){e||(e={});var r={bools:{},strings:{},unknownFn:null};typeof e.unknown=="function"&&(r.unknownFn=e.unknown),typeof e.boolean=="boolean"&&e.boolean?r.allBools=!0:[].concat(e.boolean).filter(Boolean).forEach(function(C){r.bools[C]=!0});var n={};function i(C){return n[C].some(function(k){return r.bools[k]})}Object.keys(e.alias||{}).forEach(function(C){n[C]=[].concat(e.alias[C]),n[C].forEach(function(k){n[k]=[C].concat(n[C].filter(function($){return k!==$}))})}),[].concat(e.string).filter(Boolean).forEach(function(C){r.strings[C]=!0,n[C]&&[].concat(n[C]).forEach(function(k){r.strings[k]=!0})});var o=e.default||{},s={_:[]};function a(C,k){return r.allBools&&/^--[^=]+$/.test(k)||r.strings[C]||r.bools[C]||n[C]}function u(C,k,$){for(var F=C,L=0;L<k.length-1;L++){var S=k[L];if(Oj(F,S))return;F[S]===void 0&&(F[S]={}),(F[S]===Object.prototype||F[S]===Number.prototype||F[S]===String.prototype)&&(F[S]={}),F[S]===Array.prototype&&(F[S]=[]),F=F[S]}var I=k[k.length-1];Oj(F,I)||((F===Object.prototype||F===Number.prototype||F===String.prototype)&&(F={}),F===Array.prototype&&(F=[]),F[I]===void 0||r.bools[I]||typeof F[I]=="boolean"?F[I]=$:Array.isArray(F[I])?F[I].push($):F[I]=[F[I],$])}function c(C,k,$){if(!($&&r.unknownFn&&!a(C,$)&&r.unknownFn($)===!1)){var F=!r.strings[C]&&Fj(k)?Number(k):k;u(s,C.split("."),F),(n[C]||[]).forEach(function(L){u(s,L.split("."),F)})}}Object.keys(r.bools).forEach(function(C){c(C,o[C]===void 0?!1:o[C])});var l=[];t.indexOf("--")!==-1&&(l=t.slice(t.indexOf("--")+1),t=t.slice(0,t.indexOf("--")));for(var f=0;f<t.length;f++){var h=t[f],d,m;if(/^--.+=/.test(h)){var b=h.match(/^--([^=]+)=([\s\S]*)$/);d=b[1];var g=b[2];r.bools[d]&&(g=g!=="false"),c(d,g,h)}else if(/^--no-.+/.test(h))d=h.match(/^--no-(.+)/)[1],c(d,!1,h);else if(/^--.+/.test(h))d=h.match(/^--(.+)/)[1],m=t[f+1],m!==void 0&&!/^(-|--)[^-]/.test(m)&&!r.bools[d]&&!r.allBools&&(!n[d]||!i(d))?(c(d,m,h),f+=1):/^(true|false)$/.test(m)?(c(d,m==="true",h),f+=1):c(d,r.strings[d]?"":!0,h);else if(/^-[^-]+/.test(h)){for(var w=h.slice(1,-1).split(""),x=!1,D=0;D<w.length;D++){if(m=h.slice(D+2),m==="-"){c(w[D],m,h);continue}if(/[A-Za-z]/.test(w[D])&&m[0]==="="){c(w[D],m.slice(1),h),x=!0;break}if(/[A-Za-z]/.test(w[D])&&/-?\d+(\.\d*)?(e-?\d+)?$/.test(m)){c(w[D],m,h),x=!0;break}if(w[D+1]&&w[D+1].match(/\W/)){c(w[D],h.slice(D+2),h),x=!0;break}else c(w[D],r.strings[w[D]]?"":!0,h)}d=h.slice(-1)[0],!x&&d!=="-"&&(t[f+1]&&!/^(-|--)[^-]/.test(t[f+1])&&!r.bools[d]&&(!n[d]||!i(d))?(c(d,t[f+1],h),f+=1):t[f+1]&&/^(true|false)$/.test(t[f+1])?(c(d,t[f+1]==="true",h),f+=1):c(d,r.strings[d]?"":!0,h))}else if((!r.unknownFn||r.unknownFn(h)!==!1)&&s._.push(r.strings._||!Fj(h)?h:Number(h)),e.stopEarly){s._.push.apply(s._,t.slice(f+1));break}}return Object.keys(o).forEach(function(C){Ase(s,C.split("."))||(u(s,C.split("."),o[C]),(n[C]||[]).forEach(function(k){u(s,k.split("."),o[C])}))}),e["--"]?s["--"]=l.slice():l.forEach(function(C){s._.push(C)}),s}});var $j=y((eye,Rj)=>{var jc=bj(),va=require("path").join,kse=xj(),Tj="/etc",Pj=process.platform==="win32",Nc=Pj?process.env.USERPROFILE:process.env.HOME;Rj.exports=function(t,e,r,n){if(typeof t!="string")throw new Error("rc(name): name *must* be string");r||(r=kj()(process.argv.slice(2))),e=(typeof e=="string"?jc.json(e):e)||{},n=n||jc.parse;var i=jc.env(t+"_"),o=[e],s=[];function a(u){if(!(s.indexOf(u)>=0)){var c=jc.file(u);c&&(o.push(n(c)),s.push(u))}}return Pj||[va(Tj,t,"config"),va(Tj,t+"rc")].forEach(a),Nc&&[va(Nc,".config",t,"config"),va(Nc,".config",t),va(Nc,"."+t,"config"),va(Nc,"."+t+"rc")].forEach(a),a(jc.find("."+t+"rc")),i.config&&a(i.config),r.config&&a(r.config),kse.apply(null,o.concat([i,r,s.length?{configs:s,config:s[s.length-1]}:void 0]))}});var Nj=y((rye,jj)=>{var bi=require("constants"),Tse=process.cwd,Ih=null,Pse=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return Ih||(Ih=Tse.call(process)),Ih};try{process.cwd()}catch{}typeof process.chdir=="function"&&(ub=process.chdir,process.chdir=function(t){Ih=null,ub.call(process,t)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,ub));var ub;jj.exports=Rse;function Rse(t){bi.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&e(t),t.lutimes||r(t),t.chown=o(t.chown),t.fchown=o(t.fchown),t.lchown=o(t.lchown),t.chmod=n(t.chmod),t.fchmod=n(t.fchmod),t.lchmod=n(t.lchmod),t.chownSync=s(t.chownSync),t.fchownSync=s(t.fchownSync),t.lchownSync=s(t.lchownSync),t.chmodSync=i(t.chmodSync),t.fchmodSync=i(t.fchmodSync),t.lchmodSync=i(t.lchmodSync),t.stat=a(t.stat),t.fstat=a(t.fstat),t.lstat=a(t.lstat),t.statSync=u(t.statSync),t.fstatSync=u(t.fstatSync),t.lstatSync=u(t.lstatSync),t.chmod&&!t.lchmod&&(t.lchmod=function(l,f,h){h&&process.nextTick(h)},t.lchmodSync=function(){}),t.chown&&!t.lchown&&(t.lchown=function(l,f,h,d){d&&process.nextTick(d)},t.lchownSync=function(){}),Pse==="win32"&&(t.rename=typeof t.rename!="function"?t.rename:function(l){function f(h,d,m){var b=Date.now(),g=0;l(h,d,function w(x){if(x&&(x.code==="EACCES"||x.code==="EPERM")&&Date.now()-b<6e4){setTimeout(function(){t.stat(d,function(D,C){D&&D.code==="ENOENT"?l(h,d,w):m(x)})},g),g<100&&(g+=10);return}m&&m(x)})}return Object.setPrototypeOf&&Object.setPrototypeOf(f,l),f}(t.rename)),t.read=typeof t.read!="function"?t.read:function(l){function f(h,d,m,b,g,w){var x;if(w&&typeof w=="function"){var D=0;x=function(C,k,$){if(C&&C.code==="EAGAIN"&&D<10)return D++,l.call(t,h,d,m,b,g,x);w.apply(this,arguments)}}return l.call(t,h,d,m,b,g,x)}return Object.setPrototypeOf&&Object.setPrototypeOf(f,l),f}(t.read),t.readSync=typeof t.readSync!="function"?t.readSync:function(l){return function(f,h,d,m,b){for(var g=0;;)try{return l.call(t,f,h,d,m,b)}catch(w){if(w.code==="EAGAIN"&&g<10){g++;continue}throw w}}}(t.readSync);function e(l){l.lchmod=function(f,h,d){l.open(f,bi.O_WRONLY|bi.O_SYMLINK,h,function(m,b){if(m){d&&d(m);return}l.fchmod(b,h,function(g){l.close(b,function(w){d&&d(g||w)})})})},l.lchmodSync=function(f,h){var d=l.openSync(f,bi.O_WRONLY|bi.O_SYMLINK,h),m=!0,b;try{b=l.fchmodSync(d,h),m=!1}finally{if(m)try{l.closeSync(d)}catch{}else l.closeSync(d)}return b}}function r(l){bi.hasOwnProperty("O_SYMLINK")&&l.futimes?(l.lutimes=function(f,h,d,m){l.open(f,bi.O_SYMLINK,function(b,g){if(b){m&&m(b);return}l.futimes(g,h,d,function(w){l.close(g,function(x){m&&m(w||x)})})})},l.lutimesSync=function(f,h,d){var m=l.openSync(f,bi.O_SYMLINK),b,g=!0;try{b=l.futimesSync(m,h,d),g=!1}finally{if(g)try{l.closeSync(m)}catch{}else l.closeSync(m)}return b}):l.futimes&&(l.lutimes=function(f,h,d,m){m&&process.nextTick(m)},l.lutimesSync=function(){})}function n(l){return l&&function(f,h,d){return l.call(t,f,h,function(m){c(m)&&(m=null),d&&d.apply(this,arguments)})}}function i(l){return l&&function(f,h){try{return l.call(t,f,h)}catch(d){if(!c(d))throw d}}}function o(l){return l&&function(f,h,d,m){return l.call(t,f,h,d,function(b){c(b)&&(b=null),m&&m.apply(this,arguments)})}}function s(l){return l&&function(f,h,d){try{return l.call(t,f,h,d)}catch(m){if(!c(m))throw m}}}function a(l){return l&&function(f,h,d){typeof h=="function"&&(d=h,h=null);function m(b,g){g&&(g.uid<0&&(g.uid+=4294967296),g.gid<0&&(g.gid+=4294967296)),d&&d.apply(this,arguments)}return h?l.call(t,f,h,m):l.call(t,f,m)}}function u(l){return l&&function(f,h){var d=h?l.call(t,f,h):l.call(t,f);return d&&(d.uid<0&&(d.uid+=4294967296),d.gid<0&&(d.gid+=4294967296)),d}}function c(l){if(!l||l.code==="ENOSYS")return!0;var f=!process.getuid||process.getuid()!==0;return!!(f&&(l.code==="EINVAL"||l.code==="EPERM"))}}});var qj=y((nye,Bj)=>{var Lj=require("stream").Stream;Bj.exports=$se;function $se(t){return{ReadStream:e,WriteStream:r};function e(n,i){if(!(this instanceof e))return new e(n,i);Lj.call(this);var o=this;this.path=n,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=64*1024,i=i||{};for(var s=Object.keys(i),a=0,u=s.length;a<u;a++){var c=s[a];this[c]=i[c]}if(this.encoding&&this.setEncoding(this.encoding),this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.end===void 0)this.end=1/0;else if(typeof this.end!="number")throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}if(this.fd!==null){process.nextTick(function(){o._read()});return}t.open(this.path,this.flags,this.mode,function(l,f){if(l){o.emit("error",l),o.readable=!1;return}o.fd=f,o.emit("open",f),o._read()})}function r(n,i){if(!(this instanceof r))return new r(n,i);Lj.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 Uj=y((iye,Mj)=>{"use strict";Mj.exports=jse;var Ise=Object.getPrototypeOf||function(t){return t.__proto__};function jse(t){if(t===null||typeof t!="object")return t;if(t instanceof Object)var e={__proto__:Ise(t)};else var e=Object.create(null);return Object.getOwnPropertyNames(t).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}});var Gj=y((oye,fb)=>{var We=require("fs"),Nse=Nj(),Lse=qj(),Bse=Uj(),jh=require("util"),Et,Lh;typeof Symbol=="function"&&typeof Symbol.for=="function"?(Et=Symbol.for("graceful-fs.queue"),Lh=Symbol.for("graceful-fs.previous")):(Et="___graceful-fs.queue",Lh="___graceful-fs.previous");function qse(){}function zj(t,e){Object.defineProperty(t,Et,{get:function(){return e}})}var Eo=qse;jh.debuglog?Eo=jh.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(Eo=function(){var t=jh.format.apply(jh,arguments);t="GFS4: "+t.split(/\n/).join(`
197
+ GFS4: `),console.error(t)});We[Et]||(Vj=global[Et]||[],zj(We,Vj),We.close=function(t){function e(r,n){return t.call(We,r,function(i){i||Hj(),typeof n=="function"&&n.apply(this,arguments)})}return Object.defineProperty(e,Lh,{value:t}),e}(We.close),We.closeSync=function(t){function e(r){t.apply(We,arguments),Hj()}return Object.defineProperty(e,Lh,{value:t}),e}(We.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){Eo(We[Et]),require("assert").equal(We[Et].length,0)}));var Vj;global[Et]||zj(global,We[Et]);fb.exports=cb(Bse(We));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!We.__patched&&(fb.exports=cb(We),We.__patched=!0);function cb(t){Nse(t),t.gracefulify=cb,t.createReadStream=k,t.createWriteStream=$;var e=t.readFile;t.readFile=r;function r(S,I,R){return typeof I=="function"&&(R=I,I=null),B(S,I,R);function B(q,K,M,E){return e(q,K,function(v){v&&(v.code==="EMFILE"||v.code==="ENFILE")?ba([B,[q,K,M],v,E||Date.now(),Date.now()]):typeof M=="function"&&M.apply(this,arguments)})}}var n=t.writeFile;t.writeFile=i;function i(S,I,R,B){return typeof R=="function"&&(B=R,R=null),q(S,I,R,B);function q(K,M,E,v,_){return n(K,M,E,function(O){O&&(O.code==="EMFILE"||O.code==="ENFILE")?ba([q,[K,M,E,v],O,_||Date.now(),Date.now()]):typeof v=="function"&&v.apply(this,arguments)})}}var o=t.appendFile;o&&(t.appendFile=s);function s(S,I,R,B){return typeof R=="function"&&(B=R,R=null),q(S,I,R,B);function q(K,M,E,v,_){return o(K,M,E,function(O){O&&(O.code==="EMFILE"||O.code==="ENFILE")?ba([q,[K,M,E,v],O,_||Date.now(),Date.now()]):typeof v=="function"&&v.apply(this,arguments)})}}var a=t.copyFile;a&&(t.copyFile=u);function u(S,I,R,B){return typeof R=="function"&&(B=R,R=0),q(S,I,R,B);function q(K,M,E,v,_){return a(K,M,E,function(O){O&&(O.code==="EMFILE"||O.code==="ENFILE")?ba([q,[K,M,E,v],O,_||Date.now(),Date.now()]):typeof v=="function"&&v.apply(this,arguments)})}}var c=t.readdir;t.readdir=f;var l=/^v[0-5]\./;function f(S,I,R){typeof I=="function"&&(R=I,I=null);var B=l.test(process.version)?function(M,E,v,_){return c(M,q(M,E,v,_))}:function(M,E,v,_){return c(M,E,q(M,E,v,_))};return B(S,I,R);function q(K,M,E,v){return function(_,O){_&&(_.code==="EMFILE"||_.code==="ENFILE")?ba([B,[K,M,E],_,v||Date.now(),Date.now()]):(O&&O.sort&&O.sort(),typeof E=="function"&&E.call(this,_,O))}}}if(process.version.substr(0,4)==="v0.8"){var h=Lse(t);w=h.ReadStream,D=h.WriteStream}var d=t.ReadStream;d&&(w.prototype=Object.create(d.prototype),w.prototype.open=x);var m=t.WriteStream;m&&(D.prototype=Object.create(m.prototype),D.prototype.open=C),Object.defineProperty(t,"ReadStream",{get:function(){return w},set:function(S){w=S},enumerable:!0,configurable:!0}),Object.defineProperty(t,"WriteStream",{get:function(){return D},set:function(S){D=S},enumerable:!0,configurable:!0});var b=w;Object.defineProperty(t,"FileReadStream",{get:function(){return b},set:function(S){b=S},enumerable:!0,configurable:!0});var g=D;Object.defineProperty(t,"FileWriteStream",{get:function(){return g},set:function(S){g=S},enumerable:!0,configurable:!0});function w(S,I){return this instanceof w?(d.apply(this,arguments),this):w.apply(Object.create(w.prototype),arguments)}function x(){var S=this;L(S.path,S.flags,S.mode,function(I,R){I?(S.autoClose&&S.destroy(),S.emit("error",I)):(S.fd=R,S.emit("open",R),S.read())})}function D(S,I){return this instanceof D?(m.apply(this,arguments),this):D.apply(Object.create(D.prototype),arguments)}function C(){var S=this;L(S.path,S.flags,S.mode,function(I,R){I?(S.destroy(),S.emit("error",I)):(S.fd=R,S.emit("open",R))})}function k(S,I){return new t.ReadStream(S,I)}function $(S,I){return new t.WriteStream(S,I)}var F=t.open;t.open=L;function L(S,I,R,B){return typeof R=="function"&&(B=R,R=null),q(S,I,R,B);function q(K,M,E,v,_){return F(K,M,E,function(O,j){O&&(O.code==="EMFILE"||O.code==="ENFILE")?ba([q,[K,M,E,v],O,_||Date.now(),Date.now()]):typeof v=="function"&&v.apply(this,arguments)})}}return t}function ba(t){Eo("ENQUEUE",t[0].name,t[1]),We[Et].push(t),lb()}var Nh;function Hj(){for(var t=Date.now(),e=0;e<We[Et].length;++e)We[Et][e].length>2&&(We[Et][e][3]=t,We[Et][e][4]=t);lb()}function lb(){if(clearTimeout(Nh),Nh=void 0,We[Et].length!==0){var t=We[Et].shift(),e=t[0],r=t[1],n=t[2],i=t[3],o=t[4];if(i===void 0)Eo("RETRY",e.name,r),e.apply(null,r);else if(Date.now()-i>=6e4){Eo("TIMEOUT",e.name,r);var s=r.pop();typeof s=="function"&&s.call(null,n)}else{var a=Date.now()-o,u=Math.max(o-i,1),c=Math.min(u*1.2,100);a>=c?(Eo("RETRY",e.name,r),e.apply(null,r.concat([i]))):We[Et].push(t)}Nh===void 0&&(Nh=setTimeout(lb,0))}}});var Wj=y(wa=>{"use strict";var Mse=wa&&wa.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(wa,"__esModule",{value:!0});wa.readCAFileSync=void 0;var Use=Mse(Gj());function Vse(t){try{let e=Use.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}}wa.readCAFileSync=Vse});var Kj=y(Co=>{"use strict";var Hse=Co&&Co.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),zse=Co&&Co.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Hse(e,t,r)};Object.defineProperty(Co,"__esModule",{value:!0});zse(Wj(),Co)});var Xj=y((uye,Jj)=>{Jj.exports=Yj;function So(t,e){if(typeof Object.setPrototypeOf=="function")return Object.setPrototypeOf(t,e);t.__proto__=e}function Yj(){this.list=[];var t=null;Object.defineProperty(this,"root",{get:function(){return t},set:function(e){t=e,this.list.length&&So(this.list[this.list.length-1],e)},enumerable:!0,configurable:!0})}Yj.prototype={get length(){return this.list.length},get keys(){var t=[];for(var e in this.list[0])t.push(e);return t},get snapshot(){var t={};return this.keys.forEach(function(e){t[e]=this.get(e)},this),t},get store(){return this.list[0]},push:function(t){return typeof t!="object"&&(t={valueOf:t}),this.list.length>=1&&So(this.list[this.list.length-1],t),So(t,this.root),this.list.push(t)},pop:function(){return this.list.length>=2&&So(this.list[this.list.length-2],this.root),this.list.pop()},unshift:function(t){return So(t,this.list[0]||this.root),this.list.unshift(t)},shift:function(){return this.list.length===1&&So(this.list[0],this.root),this.list.shift()},get:function(t){return this.list[0][t]},set:function(t,e,r){return this.length||this.push({}),r&&this.list[0].hasOwnProperty(t)&&this.push({}),this.list[0][t]=e},forEach:function(t,e){for(var r in this.list[0])t.call(e,r,this.list[0][r])},slice:function(){return this.list.slice.apply(this.list,arguments)},splice:function(){for(var t=this.list.splice.apply(this.list,arguments),e=0,r=this.list.length;e<r;e++)So(this.list[e],this.list[e+1]||this.root);return t}}});var t8=y(xo=>{xo.parse=xo.decode=Gse;xo.stringify=xo.encode=Zj;xo.safe=_a;xo.unsafe=Bh;var db=typeof process<"u"&&process.platform==="win32"?`\r
198
198
  `:`
199
199
  `;function Zj(t,e){var r=[],n="";typeof e=="string"?e={section:e,whitespace:!1}:(e=e||{},e.whitespace=e.whitespace===!0);var i=e.whitespace?" = ":"=";return Object.keys(t).forEach(function(o,s,a){var u=t[o];u&&Array.isArray(u)?u.forEach(function(c){n+=_a(o+"[]")+i+_a(c)+`
200
- `}):u&&typeof u=="object"?r.push(o):n+=_a(o)+i+_a(u)+hb}),e.section&&n.length&&(n="["+_a(e.section)+"]"+hb+n),r.forEach(function(o,s,a){var u=Qj(o).join("\\."),c=(e.section?e.section+".":"")+u,l=Zj(t[o],{section:c,whitespace:e.whitespace});n.length&&l.length&&(n+=hb),n+=l}),n}function Qj(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 Gse(t){var e={},r=e,n=null,i=/^\[([^\]]*)\]$|^([^=]+)(=(.*))?$/i,o=t.split(/[\r\n]+/g);return o.forEach(function(s,a,u){if(!(!s||s.match(/^\s*[;#]/))){var c=s.match(i);if(c){if(c[1]!==void 0){if(n=Bh(c[1]),n==="__proto__"){r={};return}r=e[n]=e[n]||{};return}var l=Bh(c[2]);if(l!=="__proto__"){var f=c[3]?Bh(c[4]):!0;switch(f){case"true":case"false":case"null":f=JSON.parse(f)}if(l.length>2&&l.slice(-2)==="[]"){if(l=l.substring(0,l.length-2),l==="__proto__")return;r[l]?Array.isArray(r[l])||(r[l]=[r[l]]):r[l]=[]}Array.isArray(r[l])?r[l].push(f):r[l]=f}}}}),Object.keys(e).filter(function(s,a,u){if(!e[s]||typeof e[s]!="object"||Array.isArray(e[s]))return!1;var c=Qj(s),l=e,f=c.pop(),h=f.replace(/\\\./g,".");return c.forEach(function(d,m,b){d!=="__proto__"&&((!l[d]||typeof l[d]!="object")&&(l[d]={}),l=l[d])}),l===e&&h===f?!1:(l[h]=e[s],!0)}).forEach(function(s,a,u){delete e[s]}),e}function e8(t){return t.charAt(0)==='"'&&t.slice(-1)==='"'||t.charAt(0)==="'"&&t.slice(-1)==="'"}function _a(t){return typeof t!="string"||t.match(/[=\r\n]/)||t.match(/^\[/)||t.length>1&&e8(t)||t!==t.trim()?JSON.stringify(t):t.replace(/;/g,"\\;").replace(/#/g,"\\#")}function Bh(t,e){if(t=(t||"").trim(),e8(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 o8=y((Nn,i8)=>{var r8=Xj(),Lc=require("path"),qh=require("fs"),pb=t8(),mb=require("events").EventEmitter,Wse=require("url"),Kse=require("http"),Nn=i8.exports=function(){for(var t=[].slice.call(arguments),e=new Ot;t.length;){var r=t.shift();r&&e.push(typeof r=="string"?Jse(r):r)}return e},lye=Nn.find=function(){var t=Lc.join.apply(null,[].slice.call(arguments));function e(r,n){var i=Lc.join(r,n);try{return qh.statSync(i),i}catch{if(Lc.dirname(r)!==r)return e(Lc.dirname(r),n)}}return e(__dirname,t)},Yse=Nn.parse=function(t,e,r){if(t=""+t,r)if(r==="json")if(this.emit)try{return JSON.parse(t)}catch(n){this.emit("error",n)}else return JSON.parse(t);else return pb.parse(t);else try{return JSON.parse(t)}catch{return pb.parse(t)}},Jse=Nn.json=function(){var t=[].slice.call(arguments).filter(function(n){return n!=null}),e=Lc.join.apply(null,t),r;try{r=qh.readFileSync(e,"utf-8")}catch{return}return Yse(r,e,"json")},fye=Nn.env=function(t,e){e=e||process.env;var r={},n=t.length;for(var i in e)i.indexOf(t)===0&&(r[i.substring(n)]=e[i]);return r};Nn.ConfigChain=Ot;function Ot(){mb.apply(this),r8.apply(this,arguments),this._awaiting=0,this._saving=0,this.sources={}}var n8={constructor:{value:Ot}};Object.keys(mb.prototype).forEach(function(t){n8[t]=Object.getOwnPropertyDescriptor(mb.prototype,t)});Ot.prototype=Object.create(r8.prototype,n8);Ot.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};Ot.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};Ot.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]};Ot.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=pb.stringify(s),this._saving++,qh.writeFile(n.path,s,"utf8",function(a){if(this._saving--,a)return r?r(a):this.emit("error",a);this._saving===0&&(r&&r(),this.emit("save"))}.bind(this)),this};Ot.prototype.addFile=function(t,e,r){r=r||t;var n={__source__:r};return this.sources[r]={path:t,type:e},this.push(n),this._await(),qh.readFile(t,"utf8",function(i,o){i&&this.emit("error",i),this.addString(o,t,e,n)}.bind(this)),this};Ot.prototype.addEnv=function(t,e,r){r=r||"env";var n=Nn.env(t,e);return this.sources[r]={data:n,source:e,prefix:t},this.add(n,r)};Ot.prototype.addUrl=function(t,e,r){this._await();var n=Wse.format(t);r=r||n;var i={__source__:r};return this.sources[r]={href:n,type:e},this.push(i),Kse.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};Ot.prototype.addString=function(t,e,r,n){return t=this.parse(t,e,r),this.add(t,n),this};Ot.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};Ot.prototype.parse=Nn.parse;Ot.prototype._await=function(){this._awaiting++};Ot.prototype._resolve=function(){this._awaiting--,this._awaiting===0&&this.emit("load",this)}});var a8=y((dye,s8)=>{s8.exports=function(t){let e=t.indexOf(":");if(e===-1)return gb(t);let r=t.substr(0,e),n=t.substr(e+1);return`${gb(r)}:${gb(n)}`};function gb(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 u8=y(Mh=>{"use strict";Object.defineProperty(Mh,"__esModule",{value:!0});Mh.envReplace=void 0;var Xse=/(?<!\\)(\\*)\$\{([^${}]+)\}/g;function Zse(t,e){return t.replace(Xse,Qse.bind(null,e))}Mh.envReplace=Zse;function Qse(t,e,r,n){if(r.length%2)return e.slice((r.length+1)/2);let i=tae(t,n);if(i===void 0)throw new Error(`Failed to replace env in config: ${e}`);return`${r.slice(r.length/2)}${i}`}var eae=/([^:-]+)(:?)-(.+)/;function tae(t,e){let r=e.match(eae);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 c8=y(Uh=>{"use strict";Object.defineProperty(Uh,"__esModule",{value:!0});Uh.envReplace=void 0;var rae=u8();Object.defineProperty(Uh,"envReplace",{enumerable:!0,get:function(){return rae.envReplace}})});var f8=y(Vh=>{"use strict";var nae=require("fs"),Fo=require("path"),{envReplace:l8}=c8(),iae=(t,e,r)=>{if(typeof e!="string")return e;let n=[].concat(t[r]),i=n.indexOf(Fo)!==-1,o=n.indexOf(Boolean)!==-1,s=n.indexOf(String)!==-1,a=n.indexOf(Number)!==-1;if(e=`${e}`.trim(),/^".*"$/.test(e))try{e=JSON.parse(e)}catch{throw new Error(`Failed parsing JSON config key ${r}: ${e}`)}if(o&&!s&&e==="")return!0;switch(e){case"true":return!0;case"false":return!1;case"null":return null;case"undefined":return}return e=l8(e,process.env),i&&((process.platform==="win32"?/^~(\/|\\)/:/^~\//).test(e)&&process.env.HOME&&(e=Fo.resolve(process.env.HOME,e.substr(2))),e=Fo.resolve(e)),a&&!isNaN(e)&&(e=Number(e)),e},oae=t=>{t=Fo.resolve(t);let e=!1;for(;Fo.basename(t)==="node_modules";)t=Fo.dirname(t),e=!0;if(e)return t;let r=(n,i)=>{let o=/^[a-zA-Z]:(\\|\/)?$/;if(n==="/"||process.platform==="win32"&&o.test(n))return i;try{let s=nae.readdirSync(n);if(s.includes("node_modules")||s.includes("package.json")||s.includes("package.json5")||s.includes("package.yaml")||s.includes("pnpm-workspace.yaml"))return n;let a=Fo.dirname(n);return a===n?i:r(a,i)}catch(s){if(n===i){if(s.code==="ENOENT")return i;throw s}return i}};return r(t,t)};Vh.envReplace=l8;Vh.findPrefix=oae;Vh.parseField=iae});var p8=y(h8=>{"use strict";var Oo=require("path"),sae=require("stream").Stream,Hh=require("url"),aae=()=>{},uae=()=>[],d8=()=>{};h8.types={access:[null,"restricted","public"],"allow-same-version":Boolean,"always-auth":Boolean,also:[null,"dev","development"],audit:Boolean,"auth-type":["legacy","sso","saml","oauth"],"bin-links":Boolean,browser:[null,String],ca:[null,String,Array],cafile:Oo,cache:Oo,"cache-lock-stale":Number,"cache-lock-retries":Number,"cache-lock-wait":Number,"cache-max":Number,"cache-min":Number,cert:[null,String],cidr:[null,String,Array],color:["always",Boolean],depth:Number,description:Boolean,dev:Boolean,"dry-run":Boolean,editor:String,"engine-strict":Boolean,force:Boolean,"fetch-retries":Number,"fetch-retry-factor":Number,"fetch-retry-mintimeout":Number,"fetch-retry-maxtimeout":Number,git:String,"git-tag-version":Boolean,"commit-hooks":Boolean,global:Boolean,globalconfig:Oo,"global-style":Boolean,group:[Number,String],"https-proxy":[null,Hh],"user-agent":String,"ham-it-up":Boolean,heading:String,"if-present":Boolean,"ignore-prepublish":Boolean,"ignore-scripts":Boolean,"init-module":Oo,"init-author-name":String,"init-author-email":String,"init-author-url":["",Hh],"init-license":String,"init-version":d8,json:Boolean,key:[null,String],"legacy-bundling":Boolean,link:Boolean,"local-address":uae(),loglevel:["silent","error","warn","notice","http","timing","info","verbose","silly"],logstream:sae,"logs-max":Number,long:Boolean,maxsockets:Number,message:String,"metrics-registry":[null,String],"node-options":[null,String],"node-version":[null,d8],"no-proxy":[null,String,Array],offline:Boolean,"onload-script":[null,String],only:[null,"dev","development","prod","production"],optional:Boolean,"package-lock":Boolean,otp:[null,String],"package-lock-only":Boolean,parseable:Boolean,"prefer-offline":Boolean,"prefer-online":Boolean,prefix:Oo,production:Boolean,progress:Boolean,proxy:[null,!1,Hh],provenance:Boolean,"read-only":Boolean,"rebuild-bundle":Boolean,registry:[null,Hh],rollback:Boolean,save:Boolean,"save-bundle":Boolean,"save-dev":Boolean,"save-exact":Boolean,"save-optional":Boolean,"save-prefix":String,"save-prod":Boolean,scope:String,"script-shell":[null,String],"scripts-prepend-node-path":[!1,!0,"auto","warn-only"],searchopts:String,searchexclude:[null,String],searchlimit:Number,searchstaleness:Number,"send-metrics":Boolean,shell:String,shrinkwrap:Boolean,"sign-git-tag":Boolean,"sso-poll-frequency":Number,"sso-type":[null,"oauth","saml"],"strict-ssl":Boolean,tag:String,timing:Boolean,tmp:Oo,unicode:Boolean,"unsafe-perm":Boolean,usage:Boolean,user:[Number,String],userconfig:Oo,umask:aae,version:Boolean,"tag-version-prefix":String,versions:Boolean,viewer:String,_exit:Boolean}});var D8=y((yye,y8)=>{"use strict";var{readCAFileSync:cae}=Kj(),m8=require("fs"),yb=require("path"),{ConfigChain:lae}=o8(),fae=a8(),g8=f8(),Db=class extends lae{constructor(e,r){super(e),this.root=e,this._parseField=g8.parseField.bind(null,r||p8())}add(e,r){try{for(let n of Object.keys(e))e[n]=this._parseField(e[n],n)}catch(n){throw n}return super.add(e,r)}addFile(e,r){r=r||e;let n={__source__:r};this.sources[r]={path:e,type:"ini"},this.push(n),this._await();try{let i=m8.readFileSync(e,"utf8");this.addString(i,e,"ini",n)}catch(i){if(i.code==="ENOENT")this.add({},n);else return`Issue while reading "${e}". ${i.message}`}}addEnv(e){e=e||process.env;let r={};return Object.keys(e).filter(n=>/^npm_config_/i.test(n)).forEach(n=>{e[n]&&(r[fae(n.substr(11))]=e[n])}),super.addEnv("",r,"env")}loadPrefix(){let e=this.list[0];Object.defineProperty(this,"prefix",{enumerable:!0,set:n=>{let i=this.get("global");this[i?"globalPrefix":"localPrefix"]=n},get:()=>this.get("global")?this.globalPrefix:this.localPrefix}),Object.defineProperty(this,"globalPrefix",{enumerable:!0,set:n=>{this.set("prefix",n)},get:()=>yb.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=yb.resolve(e.prefix);else try{r=g8.findPrefix(process.cwd())}catch(n){throw n}return r}loadCAFile(e){if(!e)return;let r=cae(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=yb.resolve(this.get("prefix"));try{let n=m8.statSync(r);e.user=n.uid}catch(n){if(n.code==="ENOENT")return;throw n}}};y8.exports=Db});var C8=y(E8=>{"use strict";var w8=require("os"),Ln=require("path"),_8=w8.tmpdir(),dae=process.getuid?process.getuid():process.pid,hae=()=>!0,v8=process.platform==="win32",b8={editor:()=>process.env.EDITOR||process.env.VISUAL||(v8?"notepad.exe":"vi"),shell:()=>v8?process.env.COMSPEC||"cmd.exe":process.env.SHELL||"/bin/bash"},pae={fromString:()=>process.umask()},Ea=w8.homedir();Ea?process.env.HOME=Ea:Ea=Ln.resolve(_8,"npm-"+dae);var mae=process.platform==="win32"?"npm-cache":".npm",gae=process.platform==="win32"&&process.env.APPDATA||Ea,yae=Ln.resolve(gae,mae),zh,Ao;Object.defineProperty(E8,"defaults",{get:function(){return zh||(process.env.PREFIX?Ao=process.env.PREFIX:process.platform==="win32"?Ao=Ln.dirname(process.execPath):(Ao=Ln.dirname(Ln.dirname(process.execPath)),process.env.DESTDIR&&(Ao=Ln.join(process.env.DESTDIR,Ao))),zh={access:null,"allow-same-version":!1,"always-auth":!1,also:null,audit:!0,"auth-type":"legacy","bin-links":!0,browser:null,ca:null,cafile:null,cache:yae,"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:b8.editor(),"engine-strict":!1,force:!1,"fetch-retries":2,"fetch-retry-factor":10,"fetch-retry-mintimeout":1e4,"fetch-retry-maxtimeout":6e4,git:"git","git-tag-version":!0,"commit-hooks":!0,global:!1,globalconfig:Ln.resolve(Ao,"etc","npmrc"),"global-style":!1,group:process.platform==="win32"?0:process.env.SUDO_GID||process.getgid&&process.getgid(),"ham-it-up":!1,heading:"npm","if-present":!1,"ignore-prepublish":!1,"ignore-scripts":!1,"init-module":Ln.resolve(Ea,".npm-init.js"),"init-author-name":"","init-author-email":"","init-author-url":"","init-version":"1.0.0","init-license":"ISC",json:!1,key:null,"legacy-bundling":!1,link:!1,"local-address":void 0,loglevel:"notice",logstream:process.stderr,"logs-max":10,long:!1,maxsockets:50,message:"%s","metrics-registry":null,"node-options":null,offline:!1,"onload-script":!1,only:null,optional:!0,otp:null,"package-lock":!0,"package-lock-only":!1,parseable:!1,"prefer-offline":!1,"prefer-online":!1,prefix:Ao,production:process.env.NODE_ENV==="production",progress:!process.env.TRAVIS&&!process.env.CI,provenance:!1,proxy:null,"https-proxy":null,"no-proxy":null,"user-agent":"npm/{npm-version} node/{node-version} {platform} {arch}","read-only":!1,"rebuild-bundle":!0,registry:"https://registry.npmjs.org/",rollback:!0,save:!0,"save-bundle":!1,"save-dev":!1,"save-exact":!1,"save-optional":!1,"save-prefix":"^","save-prod":!1,scope:"","script-shell":null,"scripts-prepend-node-path":"warn-only",searchopts:"",searchexclude:null,searchlimit:20,searchstaleness:15*60,"send-metrics":!1,shell:b8.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:_8,unicode:hae(),"unsafe-perm":process.platform==="win32"||process.platform==="cygwin"||!(process.getuid&&process.setuid&&process.getgid&&process.setgid)||process.getuid()!==0,usage:!1,user:process.platform==="win32"?0:"nobody",userconfig:Ln.resolve(Ea,".npmrc"),umask:process.umask?process.umask():pae.fromString("022"),version:!1,versions:!1,viewer:process.platform==="win32"?"browser":"man",_exit:!0},zh)}})});var x8=y((vye,vb)=>{"use strict";var ko=require("path"),Dae=D8(),S8=C8();vb.exports=(t,e,r)=>{let n=new Dae(Object.assign({},S8.defaults,r),e);n.add(Object.assign({},t),"cli");let i=[],o=!1;if(require.resolve.paths){let c=require.resolve.paths("npm"),l;try{l=require.resolve("npm",{paths:c.slice(-1)})}catch{o=!0}l&&i.push(n.addFile(ko.resolve(ko.dirname(l),"..","npmrc"),"builtin"))}n.addEnv(),n.loadPrefix();let s=ko.resolve(n.localPrefix,".npmrc"),a=n.get("userconfig");if(!n.get("global")&&s!==a?i.push(n.addFile(s,"project")):n.add({},"project"),n.get("workspace-prefix")&&n.get("workspace-prefix")!==s){let c=ko.resolve(n.get("workspace-prefix"),".npmrc");i.push(n.addFile(c,"workspace"))}if(i.push(n.addFile(n.get("userconfig"),"user")),n.get("prefix")){let c=ko.resolve(n.get("prefix"),"etc");n.root.globalconfig=ko.resolve(c,"npmrc"),n.root.globalignorefile=ko.resolve(c,"npmignore")}i.push(n.addFile(n.get("globalconfig"),"global")),n.loadUser();let u=n.get("cafile");return u&&n.loadCAFile(u),{config:n,warnings:i.filter(Boolean),failedToLoadBuiltInConfig:o}};Object.defineProperty(vb.exports,"defaults",{get(){return S8.defaults},enumerable:!0})});var $8=y((bye,R8)=>{var bb=require("url"),F8=x8(),O8=":_authToken",A8=":_auth",k8=":username",T8=":_password";R8.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]}}:F8()).config,e=e||r.npmrc.get("registry")||F8.defaults.registry,P8(e,r)||vae(r.npmrc)};function P8(t,e){let r=bb.parse(t,!1,!0),n;for(;n!=="/"&&r.pathname!==n;){n=r.pathname||"/";let i="//"+r.host+n.replace(/\/$/,""),o=wae(i,e.npmrc);if(o)return o;if(!e.recursive)return/\/$/.test(t)?void 0:P8(bb.resolve(t,"."),e);r.pathname=bb.resolve(bae(n),"..")||"/"}}function vae(t){return t.get("_auth")?{token:Gh(t.get("_auth")),type:"Basic"}:void 0}function bae(t){return t[t.length-1]==="/"?t:t+"/"}function wae(t,e){let r=_ae(e.get(t+O8)||e.get(t+"/"+O8));if(r)return r;let n=e.get(t+k8)||e.get(t+"/"+k8),i=e.get(t+T8)||e.get(t+"/"+T8),o=Eae(n,i);if(o)return o;let s=Cae(e.get(t+A8)||e.get(t+"/"+A8));if(s)return s}function Gh(t){return t.replace(/^\$\{?([^}]*)\}?$/,function(e,r){return process.env[r]})}function _ae(t){return t?{token:Gh(t),type:"Bearer"}:void 0}function Eae(t,e){if(!t||!e)return;let r=Buffer.from(Gh(e),"base64").toString("utf8");return{token:Buffer.from(t+":"+r,"utf8").toString("base64"),type:"Basic",password:r,username:t}}function Cae(t){return t?{token:Gh(t),type:"Basic"}:void 0}});var IL=y((Swe,Vn)=>{var st=require("fs"),Jb=require("os"),fr=require("path"),bL=require("crypto"),ln={fs:st.constants,os:Jb.constants},wL="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",EL=/XXXXXX/,cue=3,CL=(ln.O_CREAT||ln.fs.O_CREAT)|(ln.O_EXCL||ln.fs.O_EXCL)|(ln.O_RDWR||ln.fs.O_RDWR),lue=Jb.platform()==="win32",fue=ln.EBADF||ln.os.errno.EBADF,due=ln.ENOENT||ln.os.errno.ENOENT,SL=448,xL=384,hue="exit",Pa=[],FL=st.rmdirSync.bind(st),OL=!1;function pue(t,e){return st.rm(t,{recursive:!0},e)}function AL(t){return st.rmSync(t,{recursive:!0})}function Xb(t,e){let r=Ra(t,e),n=r[0],i=r[1];try{PL(n)}catch(s){return i(s)}let o=n.tries;(function s(){try{let a=TL(n);st.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 Zb(t){let e=Ra(t),r=e[0];PL(r);let n=r.tries;do{let i=TL(r);try{st.statSync(i)}catch{return i}}while(n-- >0);throw new Error("Could not get a unique tmp filename, max tries reached")}function mue(t,e){let r=Ra(t,e),n=r[0],i=r[1];Xb(n,function(s,a){if(s)return i(s);st.open(a,CL,n.mode||xL,function(c,l){if(c)return i(c);if(n.discardDescriptor)return st.close(l,function(h){return i(h,a,void 0,Wb(a,-1,n,!1))});{let f=n.discardDescriptor||n.detachDescriptor;i(null,a,l,Wb(a,f?-1:l,n,!1))}})})}function gue(t){let e=Ra(t),r=e[0],n=r.discardDescriptor||r.detachDescriptor,i=Zb(r);var o=st.openSync(i,CL,r.mode||xL);return r.discardDescriptor&&(st.closeSync(o),o=void 0),{name:i,fd:o,removeCallback:Wb(i,n?-1:o,r,!0)}}function yue(t,e){let r=Ra(t,e),n=r[0],i=r[1];Xb(n,function(s,a){if(s)return i(s);st.mkdir(a,n.mode||SL,function(c){if(c)return i(c);i(null,a,kL(a,n,!1))})})}function Due(t){let e=Ra(t),r=e[0],n=Zb(r);return st.mkdirSync(n,r.mode||SL),{name:n,removeCallback:kL(n,r,!0)}}function vue(t,e){let r=function(n){if(n&&!Yb(n))return e(n);e()};0<=t[0]?st.close(t[0],function(){st.unlink(t[1],r)}):st.unlink(t[1],r)}function bue(t){let e=null;try{0<=t[0]&&st.closeSync(t[0])}catch(r){if(!Eue(r)&&!Yb(r))throw r}finally{try{st.unlinkSync(t[1])}catch(r){Yb(r)||(e=r)}}if(e!==null)throw e}function Wb(t,e,r,n){let i=mp(bue,[e,t],n),o=mp(vue,[e,t],n,i);return r.keep||Pa.unshift(i),n?i:o}function kL(t,e,r){let n=e.unsafeCleanup?pue:st.rmdir.bind(st),i=e.unsafeCleanup?AL:FL,o=mp(i,t,r),s=mp(n,t,r,o);return e.keep||Pa.unshift(o),r?o:s}function mp(t,e,r,n){let i=!1;return function o(s){if(!i){let a=n||o,u=Pa.indexOf(a);return u>=0&&Pa.splice(u,1),i=!0,r||t===FL||t===AL?t(e):t(e,s||function(){})}}}function wue(){if(OL)for(;Pa.length;)try{Pa[0]()}catch{}}function _L(t){let e=[],r=null;try{r=bL.randomBytes(t)}catch{r=bL.pseudoRandomBytes(t)}for(var n=0;n<t;n++)e.push(wL[r[n]%wL.length]);return e.join("")}function _ue(t){return t===null||rr(t)||!t.trim()}function rr(t){return typeof t>"u"}function Ra(t,e){if(typeof t=="function")return[{},t];if(rr(t))return[{},e];let r={};for(let n of Object.getOwnPropertyNames(t))r[n]=t[n];return[r,e]}function TL(t){let e=t.tmpdir;if(!rr(t.name))return fr.join(e,t.dir,t.name);if(!rr(t.template))return fr.join(e,t.dir,t.template).replace(EL,_L(6));let r=[t.prefix?t.prefix:"tmp","-",process.pid,"-",_L(12),t.postfix?"-"+t.postfix:""].join("");return fr.join(e,t.dir,r)}function PL(t){t.tmpdir=$L(t);let e=t.tmpdir;if(rr(t.name)||Gb(t.name,"name",e),rr(t.dir)||Gb(t.dir,"dir",e),!rr(t.template)&&(Gb(t.template,"template",e),!t.template.match(EL)))throw new Error(`Invalid template, found "${t.template}".`);if(!rr(t.tries)&&isNaN(t.tries)||t.tries<0)throw new Error(`Invalid tries, found "${t.tries}".`);t.tries=rr(t.name)?t.tries||cue:1,t.keep=!!t.keep,t.detachDescriptor=!!t.detachDescriptor,t.discardDescriptor=!!t.discardDescriptor,t.unsafeCleanup=!!t.unsafeCleanup,t.dir=rr(t.dir)?"":fr.relative(e,Kb(t.dir,e)),t.template=rr(t.template)?void 0:fr.relative(e,Kb(t.template,e)),t.template=_ue(t.template)?void 0:fr.relative(t.dir,t.template),t.name=rr(t.name)?void 0:t.name,t.prefix=rr(t.prefix)?"":t.prefix,t.postfix=rr(t.postfix)?"":t.postfix}function Kb(t,e){return t.startsWith(e)?fr.resolve(t):fr.resolve(fr.join(e,t))}function Gb(t,e,r){if(e==="name"){if(fr.isAbsolute(t))throw new Error(`${e} option must not contain an absolute path, found "${t}".`);let n=fr.basename(t);if(n===".."||n==="."||n!==t)throw new Error(`${e} option must not contain a path, found "${t}".`)}else{if(fr.isAbsolute(t)&&!t.startsWith(r))throw new Error(`${e} option must be relative to "${r}", found "${t}".`);let n=Kb(t,r);if(!n.startsWith(r))throw new Error(`${e} option must be relative to "${r}", found "${n}".`)}}function Eue(t){return RL(t,-fue,"EBADF")}function Yb(t){return RL(t,-due,"ENOENT")}function RL(t,e,r){return lue?t.code===r:t.code===r&&t.errno===e}function Cue(){OL=!0}function $L(t){return fr.resolve(t&&t.tmpdir||Jb.tmpdir())}process.addListener(hue,wue);Object.defineProperty(Vn.exports,"tmpdir",{enumerable:!0,configurable:!1,get:function(){return $L()}});Vn.exports.dir=yue;Vn.exports.dirSync=Due;Vn.exports.file=mue;Vn.exports.fileSync=gue;Vn.exports.tmpName=Xb;Vn.exports.tmpNameSync=Zb;Vn.exports.setGracefulCleanup=Cue});var vw=le(Dw(),1),{program:A,createCommand:rce,createArgument:nce,createOption:ice,CommanderError:oce,InvalidArgumentError:sce,InvalidOptionArgumentError:ace,Command:uce,Argument:cce,Option:lce,Help:fce}=vw.default;var Ir={name:"@capgo/cli",version:"4.24.1",description:"A CLI to upload to capgo servers",author:"github.com/riderx",license:"Apache 2.0",homepage:"https://github.com/Cap-go/CLIl#readme",repository:{type:"git",url:"git+https://github.com/Cap-go/CLI.git"},bugs:{url:"https://github.com/Cap-go/CLI/issues"},keywords:["appflow alternative","ionic","capacitor","auto update","live update","capgo","cli","upload","capgo-cli"],main:"dist/index.js",bin:{capgo:"dist/index.js"},engines:{npm:">=8.0.0",node:">=20.0.0"},scripts:{build:"tsc && node build.mjs",dev:"NODE_ENV=development ncc build","no-debug":"node dist/index.js",test:"npx --yes ts-node -T src/index.ts","dev-build":"SUPA_DB=development ncc build",pack:"pkg",types:"npx --yes supabase gen types typescript --project-id=xvwzpoazmxkqosrdewyv > src/types/supabase.types.ts",test_rls:"ts-node ./test/test_headers_rls.ts",lint:'eslint "src/**/*.ts" --fix',"check-posix-paths":"node test/check-posix-paths.js"},devDependencies:{"@antfu/eslint-config":"^3.8.0","@bradenmacdonald/s3-lite-client":"npm:@jsr/bradenmacdonald__s3-lite-client","@capacitor/cli":"^6.1.2","@capgo/find-package-manager":"^0.0.17","@clack/prompts":"^0.7.0","@sauber/table":"npm:@jsr/sauber__table","@std/semver":"npm:@jsr/std__semver","@supabase/supabase-js":"^2.46.0","@tomasklaen/checksum":"^1.1.0","@types/adm-zip":"^0.5.6","@types/node":"^22.8.4","@types/prettyjson":"^0.0.33","@types/tmp":"^0.2.6","@typescript-eslint/eslint-plugin":"^8.12.2","@typescript-eslint/parser":"^8.12.2","@vercel/ncc":"^0.38.2","adm-zip":"^0.5.16","ci-info":"^4.0.0",commander:"12.1.0",esbuild:"^0.24.0",eslint:"9.14.0","git-format-staged":"3.1.1",husky:"^9.1.6","is-wsl":"^3.1.0",ky:"^1.7.2","latest-version":"^9.0.0",open:"^10.1.0",pkg:"5.8.1",prettyjson:"^1.2.5",tmp:"^0.2.3","ts-loader":"^9.5.1","ts-node":"^10.9.2","tsconfig-paths":"4.2.0","tus-js-client":"^4.2.3",typescript:"5.6.3"}};var Ca=require("node:fs"),N8=require("node:process");var kt=le(ke(),1),jo=require("node:process"),Gn=le(require("node:readline"),1),qp=le(require("node:readline"),1),Tw=require("node:tty"),sl=le(Ew(),1);function EB({onlyFirst:t=!1}={}){let e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(e,t?void 0:"g")}function Pw(t){if(typeof t!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);return t.replace(EB(),"")}var Mp={},CB={get exports(){return Mp},set exports(t){Mp=t}};(function(t){var e={};t.exports=e,e.eastAsianWidth=function(n){var i=n.charCodeAt(0),o=n.length==2?n.charCodeAt(1):0,s=i;return 55296<=i&&i<=56319&&56320<=o&&o<=57343&&(i&=1023,o&=1023,s=i<<10|o,s+=65536),s==12288||65281<=s&&s<=65376||65504<=s&&s<=65510?"F":s==8361||65377<=s&&s<=65470||65474<=s&&s<=65479||65482<=s&&s<=65487||65490<=s&&s<=65495||65498<=s&&s<=65500||65512<=s&&s<=65518?"H":4352<=s&&s<=4447||4515<=s&&s<=4519||4602<=s&&s<=4607||9001<=s&&s<=9002||11904<=s&&s<=11929||11931<=s&&s<=12019||12032<=s&&s<=12245||12272<=s&&s<=12283||12289<=s&&s<=12350||12353<=s&&s<=12438||12441<=s&&s<=12543||12549<=s&&s<=12589||12593<=s&&s<=12686||12688<=s&&s<=12730||12736<=s&&s<=12771||12784<=s&&s<=12830||12832<=s&&s<=12871||12880<=s&&s<=13054||13056<=s&&s<=19903||19968<=s&&s<=42124||42128<=s&&s<=42182||43360<=s&&s<=43388||44032<=s&&s<=55203||55216<=s&&s<=55238||55243<=s&&s<=55291||63744<=s&&s<=64255||65040<=s&&s<=65049||65072<=s&&s<=65106||65108<=s&&s<=65126||65128<=s&&s<=65131||110592<=s&&s<=110593||127488<=s&&s<=127490||127504<=s&&s<=127546||127552<=s&&s<=127560||127568<=s&&s<=127569||131072<=s&&s<=194367||177984<=s&&s<=196605||196608<=s&&s<=262141?"W":32<=s&&s<=126||162<=s&&s<=163||165<=s&&s<=166||s==172||s==175||10214<=s&&s<=10221||10629<=s&&s<=10630?"Na":s==161||s==164||167<=s&&s<=168||s==170||173<=s&&s<=174||176<=s&&s<=180||182<=s&&s<=186||188<=s&&s<=191||s==198||s==208||215<=s&&s<=216||222<=s&&s<=225||s==230||232<=s&&s<=234||236<=s&&s<=237||s==240||242<=s&&s<=243||247<=s&&s<=250||s==252||s==254||s==257||s==273||s==275||s==283||294<=s&&s<=295||s==299||305<=s&&s<=307||s==312||319<=s&&s<=322||s==324||328<=s&&s<=331||s==333||338<=s&&s<=339||358<=s&&s<=359||s==363||s==462||s==464||s==466||s==468||s==470||s==472||s==474||s==476||s==593||s==609||s==708||s==711||713<=s&&s<=715||s==717||s==720||728<=s&&s<=731||s==733||s==735||768<=s&&s<=879||913<=s&&s<=929||931<=s&&s<=937||945<=s&&s<=961||963<=s&&s<=969||s==1025||1040<=s&&s<=1103||s==1105||s==8208||8211<=s&&s<=8214||8216<=s&&s<=8217||8220<=s&&s<=8221||8224<=s&&s<=8226||8228<=s&&s<=8231||s==8240||8242<=s&&s<=8243||s==8245||s==8251||s==8254||s==8308||s==8319||8321<=s&&s<=8324||s==8364||s==8451||s==8453||s==8457||s==8467||s==8470||8481<=s&&s<=8482||s==8486||s==8491||8531<=s&&s<=8532||8539<=s&&s<=8542||8544<=s&&s<=8555||8560<=s&&s<=8569||s==8585||8592<=s&&s<=8601||8632<=s&&s<=8633||s==8658||s==8660||s==8679||s==8704||8706<=s&&s<=8707||8711<=s&&s<=8712||s==8715||s==8719||s==8721||s==8725||s==8730||8733<=s&&s<=8736||s==8739||s==8741||8743<=s&&s<=8748||s==8750||8756<=s&&s<=8759||8764<=s&&s<=8765||s==8776||s==8780||s==8786||8800<=s&&s<=8801||8804<=s&&s<=8807||8810<=s&&s<=8811||8814<=s&&s<=8815||8834<=s&&s<=8835||8838<=s&&s<=8839||s==8853||s==8857||s==8869||s==8895||s==8978||9312<=s&&s<=9449||9451<=s&&s<=9547||9552<=s&&s<=9587||9600<=s&&s<=9615||9618<=s&&s<=9621||9632<=s&&s<=9633||9635<=s&&s<=9641||9650<=s&&s<=9651||9654<=s&&s<=9655||9660<=s&&s<=9661||9664<=s&&s<=9665||9670<=s&&s<=9672||s==9675||9678<=s&&s<=9681||9698<=s&&s<=9701||s==9711||9733<=s&&s<=9734||s==9737||9742<=s&&s<=9743||9748<=s&&s<=9749||s==9756||s==9758||s==9792||s==9794||9824<=s&&s<=9825||9827<=s&&s<=9829||9831<=s&&s<=9834||9836<=s&&s<=9837||s==9839||9886<=s&&s<=9887||9918<=s&&s<=9919||9924<=s&&s<=9933||9935<=s&&s<=9953||s==9955||9960<=s&&s<=9983||s==10045||s==10071||10102<=s&&s<=10111||11093<=s&&s<=11097||12872<=s&&s<=12879||57344<=s&&s<=63743||65024<=s&&s<=65039||s==65533||127232<=s&&s<=127242||127248<=s&&s<=127277||127280<=s&&s<=127337||127344<=s&&s<=127386||917760<=s&&s<=917999||983040<=s&&s<=1048573||1048576<=s&&s<=1114109?"A":"N"},e.characterLength=function(n){var i=this.eastAsianWidth(n);return i=="F"||i=="W"||i=="A"?2:1};function r(n){return n.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}e.length=function(n){for(var i=r(n),o=0,s=0;s<i.length;s++)o=o+this.characterLength(i[s]);return o},e.slice=function(n,i,o){textLen=e.length(n),i=i||0,o=o||1,i<0&&(i=textLen+i),o<0&&(o=textLen+o);for(var s="",a=0,u=r(n),c=0;c<u.length;c++){var l=u[c],f=e.length(l);if(a>=i-(f==2?1:0))if(a+f<=o)s+=l;else break;a+=f}return s}})(CB);var SB=Mp,xB=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};function Na(t,e={}){if(typeof t!="string"||t.length===0||(e={ambiguousIsNarrow:!0,...e},t=Pw(t),t.length===0))return 0;t=t.replace(xB()," ");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(SB.eastAsianWidth(i)){case"F":case"W":n+=2;break;case"A":n+=r;break;default:n+=1}}return n}var Lp=10,Cw=(t=0)=>e=>`\x1B[${e+t}m`,Sw=(t=0)=>e=>`\x1B[${38+t};5;${e}m`,xw=(t=0)=>(e,r,n)=>`\x1B[${38+t};2;${e};${r};${n}m`,Ie={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};Object.keys(Ie.modifier);var FB=Object.keys(Ie.color),OB=Object.keys(Ie.bgColor);[...FB,...OB];function AB(){let t=new Map;for(let[e,r]of Object.entries(Ie)){for(let[n,i]of Object.entries(r))Ie[n]={open:`\x1B[${i[0]}m`,close:`\x1B[${i[1]}m`},r[n]=Ie[n],t.set(i[0],i[1]);Object.defineProperty(Ie,e,{value:r,enumerable:!1})}return Object.defineProperty(Ie,"codes",{value:t,enumerable:!1}),Ie.color.close="\x1B[39m",Ie.bgColor.close="\x1B[49m",Ie.color.ansi=Cw(),Ie.color.ansi256=Sw(),Ie.color.ansi16m=xw(),Ie.bgColor.ansi=Cw(Lp),Ie.bgColor.ansi256=Sw(Lp),Ie.bgColor.ansi16m=xw(Lp),Object.defineProperties(Ie,{rgbToAnsi256:{value:(e,r,n)=>e===r&&r===n?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5),enumerable:!1},hexToRgb:{value:e=>{let r=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!r)return[0,0,0];let[n]=r;n.length===3&&(n=[...n].map(o=>o+o).join(""));let i=Number.parseInt(n,16);return[i>>16&255,i>>8&255,i&255]},enumerable:!1},hexToAnsi256:{value:e=>Ie.rgbToAnsi256(...Ie.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value:e=>{if(e<8)return 30+e;if(e<16)return 90+(e-8);let r,n,i;if(e>=232)r=((e-232)*10+8)/255,n=r,i=r;else{e-=16;let a=e%36;r=Math.floor(e/36)/5,n=Math.floor(a/6)/5,i=a%6/5}let o=Math.max(r,n,i)*2;if(o===0)return 30;let s=30+(Math.round(i)<<2|Math.round(n)<<1|Math.round(r));return o===2&&(s+=60),s},enumerable:!1},rgbToAnsi:{value:(e,r,n)=>Ie.ansi256ToAnsi(Ie.rgbToAnsi256(e,r,n)),enumerable:!1},hexToAnsi:{value:e=>Ie.ansi256ToAnsi(Ie.hexToAnsi256(e)),enumerable:!1}}),Ie}var kB=AB(),ll=new Set(["\x1B","\x9B"]),TB=39,Up="\x07",Rw="[",PB="]",$w="m",Vp=`${PB}8;;`,Fw=t=>`${ll.values().next().value}${Rw}${t}${$w}`,Ow=t=>`${ll.values().next().value}${Vp}${t}${Up}`,RB=t=>t.split(" ").map(e=>Na(e)),Bp=(t,e,r)=>{let n=[...e],i=!1,o=!1,s=Na(Pw(t[t.length-1]));for(let[a,u]of n.entries()){let c=Na(u);if(s+c<=r?t[t.length-1]+=u:(t.push(u),s=0),ll.has(u)&&(i=!0,o=n.slice(a+1).join("").startsWith(Vp)),i){o?u===Up&&(i=!1,o=!1):u===$w&&(i=!1);continue}s+=c,s===r&&a<n.length-1&&(t.push(""),s=0)}!s&&t[t.length-1].length>0&&t.length>1&&(t[t.length-2]+=t.pop())},$B=t=>{let e=t.split(" "),r=e.length;for(;r>0&&!(Na(e[r-1])>0);)r--;return r===e.length?t:e.slice(0,r).join(" ")+e.slice(r).join("")},IB=(t,e,r={})=>{if(r.trim!==!1&&t.trim()==="")return"";let n="",i,o,s=RB(t),a=[""];for(let[c,l]of t.split(" ").entries()){r.trim!==!1&&(a[a.length-1]=a[a.length-1].trimStart());let f=Na(a[a.length-1]);if(c!==0&&(f>=e&&(r.wordWrap===!1||r.trim===!1)&&(a.push(""),f=0),(f>0||r.trim===!1)&&(a[a.length-1]+=" ",f++)),r.hard&&s[c]>e){let h=e-f,d=1+Math.floor((s[c]-h-1)/e);Math.floor((s[c]-1)/e)<d&&a.push(""),Bp(a,l,e);continue}if(f+s[c]>e&&f>0&&s[c]>0){if(r.wordWrap===!1&&f<e){Bp(a,l,e);continue}a.push("")}if(f+s[c]>e&&r.wordWrap===!1){Bp(a,l,e);continue}a[a.length-1]+=l}r.trim!==!1&&(a=a.map(c=>$B(c)));let u=[...a.join(`
201
- `)];for(let[c,l]of u.entries()){if(n+=l,ll.has(l)){let{groups:h}=new RegExp(`(?:\\${Rw}(?<code>\\d+)m|\\${Vp}(?<uri>.*)${Up})`).exec(u.slice(c).join(""))||{groups:{}};if(h.code!==void 0){let d=Number.parseFloat(h.code);i=d===TB?void 0:d}else h.uri!==void 0&&(o=h.uri.length===0?void 0:h.uri)}let f=kB.codes.get(Number(i));u[c+1]===`
202
- `?(o&&(n+=Ow("")),i&&f&&(n+=Fw(f))):l===`
203
- `&&(i&&f&&(n+=Fw(i)),o&&(n+=Ow(o)))}return n};function Aw(t,e,r){return String(t).normalize().replace(/\r\n/g,`
200
+ `}):u&&typeof u=="object"?r.push(o):n+=_a(o)+i+_a(u)+db}),e.section&&n.length&&(n="["+_a(e.section)+"]"+db+n),r.forEach(function(o,s,a){var u=Qj(o).join("\\."),c=(e.section?e.section+".":"")+u,l=Zj(t[o],{section:c,whitespace:e.whitespace});n.length&&l.length&&(n+=db),n+=l}),n}function Qj(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 Gse(t){var e={},r=e,n=null,i=/^\[([^\]]*)\]$|^([^=]+)(=(.*))?$/i,o=t.split(/[\r\n]+/g);return o.forEach(function(s,a,u){if(!(!s||s.match(/^\s*[;#]/))){var c=s.match(i);if(c){if(c[1]!==void 0){if(n=Bh(c[1]),n==="__proto__"){r={};return}r=e[n]=e[n]||{};return}var l=Bh(c[2]);if(l!=="__proto__"){var f=c[3]?Bh(c[4]):!0;switch(f){case"true":case"false":case"null":f=JSON.parse(f)}if(l.length>2&&l.slice(-2)==="[]"){if(l=l.substring(0,l.length-2),l==="__proto__")return;r[l]?Array.isArray(r[l])||(r[l]=[r[l]]):r[l]=[]}Array.isArray(r[l])?r[l].push(f):r[l]=f}}}}),Object.keys(e).filter(function(s,a,u){if(!e[s]||typeof e[s]!="object"||Array.isArray(e[s]))return!1;var c=Qj(s),l=e,f=c.pop(),h=f.replace(/\\\./g,".");return c.forEach(function(d,m,b){d!=="__proto__"&&((!l[d]||typeof l[d]!="object")&&(l[d]={}),l=l[d])}),l===e&&h===f?!1:(l[h]=e[s],!0)}).forEach(function(s,a,u){delete e[s]}),e}function e8(t){return t.charAt(0)==='"'&&t.slice(-1)==='"'||t.charAt(0)==="'"&&t.slice(-1)==="'"}function _a(t){return typeof t!="string"||t.match(/[=\r\n]/)||t.match(/^\[/)||t.length>1&&e8(t)||t!==t.trim()?JSON.stringify(t):t.replace(/;/g,"\\;").replace(/#/g,"\\#")}function Bh(t,e){if(t=(t||"").trim(),e8(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 o8=y((Nn,i8)=>{var r8=Xj(),Lc=require("path"),qh=require("fs"),hb=t8(),pb=require("events").EventEmitter,Wse=require("url"),Kse=require("http"),Nn=i8.exports=function(){for(var t=[].slice.call(arguments),e=new Ot;t.length;){var r=t.shift();r&&e.push(typeof r=="string"?Jse(r):r)}return e},lye=Nn.find=function(){var t=Lc.join.apply(null,[].slice.call(arguments));function e(r,n){var i=Lc.join(r,n);try{return qh.statSync(i),i}catch{if(Lc.dirname(r)!==r)return e(Lc.dirname(r),n)}}return e(__dirname,t)},Yse=Nn.parse=function(t,e,r){if(t=""+t,r)if(r==="json")if(this.emit)try{return JSON.parse(t)}catch(n){this.emit("error",n)}else return JSON.parse(t);else return hb.parse(t);else try{return JSON.parse(t)}catch{return hb.parse(t)}},Jse=Nn.json=function(){var t=[].slice.call(arguments).filter(function(n){return n!=null}),e=Lc.join.apply(null,t),r;try{r=qh.readFileSync(e,"utf-8")}catch{return}return Yse(r,e,"json")},fye=Nn.env=function(t,e){e=e||process.env;var r={},n=t.length;for(var i in e)i.indexOf(t)===0&&(r[i.substring(n)]=e[i]);return r};Nn.ConfigChain=Ot;function Ot(){pb.apply(this),r8.apply(this,arguments),this._awaiting=0,this._saving=0,this.sources={}}var n8={constructor:{value:Ot}};Object.keys(pb.prototype).forEach(function(t){n8[t]=Object.getOwnPropertyDescriptor(pb.prototype,t)});Ot.prototype=Object.create(r8.prototype,n8);Ot.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};Ot.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};Ot.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]};Ot.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=hb.stringify(s),this._saving++,qh.writeFile(n.path,s,"utf8",function(a){if(this._saving--,a)return r?r(a):this.emit("error",a);this._saving===0&&(r&&r(),this.emit("save"))}.bind(this)),this};Ot.prototype.addFile=function(t,e,r){r=r||t;var n={__source__:r};return this.sources[r]={path:t,type:e},this.push(n),this._await(),qh.readFile(t,"utf8",function(i,o){i&&this.emit("error",i),this.addString(o,t,e,n)}.bind(this)),this};Ot.prototype.addEnv=function(t,e,r){r=r||"env";var n=Nn.env(t,e);return this.sources[r]={data:n,source:e,prefix:t},this.add(n,r)};Ot.prototype.addUrl=function(t,e,r){this._await();var n=Wse.format(t);r=r||n;var i={__source__:r};return this.sources[r]={href:n,type:e},this.push(i),Kse.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};Ot.prototype.addString=function(t,e,r,n){return t=this.parse(t,e,r),this.add(t,n),this};Ot.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};Ot.prototype.parse=Nn.parse;Ot.prototype._await=function(){this._awaiting++};Ot.prototype._resolve=function(){this._awaiting--,this._awaiting===0&&this.emit("load",this)}});var a8=y((dye,s8)=>{s8.exports=function(t){let e=t.indexOf(":");if(e===-1)return mb(t);let r=t.substr(0,e),n=t.substr(e+1);return`${mb(r)}:${mb(n)}`};function mb(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 u8=y(Mh=>{"use strict";Object.defineProperty(Mh,"__esModule",{value:!0});Mh.envReplace=void 0;var Xse=/(?<!\\)(\\*)\$\{([^${}]+)\}/g;function Zse(t,e){return t.replace(Xse,Qse.bind(null,e))}Mh.envReplace=Zse;function Qse(t,e,r,n){if(r.length%2)return e.slice((r.length+1)/2);let i=tae(t,n);if(i===void 0)throw new Error(`Failed to replace env in config: ${e}`);return`${r.slice(r.length/2)}${i}`}var eae=/([^:-]+)(:?)-(.+)/;function tae(t,e){let r=e.match(eae);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 c8=y(Uh=>{"use strict";Object.defineProperty(Uh,"__esModule",{value:!0});Uh.envReplace=void 0;var rae=u8();Object.defineProperty(Uh,"envReplace",{enumerable:!0,get:function(){return rae.envReplace}})});var f8=y(Vh=>{"use strict";var nae=require("fs"),Fo=require("path"),{envReplace:l8}=c8(),iae=(t,e,r)=>{if(typeof e!="string")return e;let n=[].concat(t[r]),i=n.indexOf(Fo)!==-1,o=n.indexOf(Boolean)!==-1,s=n.indexOf(String)!==-1,a=n.indexOf(Number)!==-1;if(e=`${e}`.trim(),/^".*"$/.test(e))try{e=JSON.parse(e)}catch{throw new Error(`Failed parsing JSON config key ${r}: ${e}`)}if(o&&!s&&e==="")return!0;switch(e){case"true":return!0;case"false":return!1;case"null":return null;case"undefined":return}return e=l8(e,process.env),i&&((process.platform==="win32"?/^~(\/|\\)/:/^~\//).test(e)&&process.env.HOME&&(e=Fo.resolve(process.env.HOME,e.substr(2))),e=Fo.resolve(e)),a&&!isNaN(e)&&(e=Number(e)),e},oae=t=>{t=Fo.resolve(t);let e=!1;for(;Fo.basename(t)==="node_modules";)t=Fo.dirname(t),e=!0;if(e)return t;let r=(n,i)=>{let o=/^[a-zA-Z]:(\\|\/)?$/;if(n==="/"||process.platform==="win32"&&o.test(n))return i;try{let s=nae.readdirSync(n);if(s.includes("node_modules")||s.includes("package.json")||s.includes("package.json5")||s.includes("package.yaml")||s.includes("pnpm-workspace.yaml"))return n;let a=Fo.dirname(n);return a===n?i:r(a,i)}catch(s){if(n===i){if(s.code==="ENOENT")return i;throw s}return i}};return r(t,t)};Vh.envReplace=l8;Vh.findPrefix=oae;Vh.parseField=iae});var p8=y(h8=>{"use strict";var Oo=require("path"),sae=require("stream").Stream,Hh=require("url"),aae=()=>{},uae=()=>[],d8=()=>{};h8.types={access:[null,"restricted","public"],"allow-same-version":Boolean,"always-auth":Boolean,also:[null,"dev","development"],audit:Boolean,"auth-type":["legacy","sso","saml","oauth"],"bin-links":Boolean,browser:[null,String],ca:[null,String,Array],cafile:Oo,cache:Oo,"cache-lock-stale":Number,"cache-lock-retries":Number,"cache-lock-wait":Number,"cache-max":Number,"cache-min":Number,cert:[null,String],cidr:[null,String,Array],color:["always",Boolean],depth:Number,description:Boolean,dev:Boolean,"dry-run":Boolean,editor:String,"engine-strict":Boolean,force:Boolean,"fetch-retries":Number,"fetch-retry-factor":Number,"fetch-retry-mintimeout":Number,"fetch-retry-maxtimeout":Number,git:String,"git-tag-version":Boolean,"commit-hooks":Boolean,global:Boolean,globalconfig:Oo,"global-style":Boolean,group:[Number,String],"https-proxy":[null,Hh],"user-agent":String,"ham-it-up":Boolean,heading:String,"if-present":Boolean,"ignore-prepublish":Boolean,"ignore-scripts":Boolean,"init-module":Oo,"init-author-name":String,"init-author-email":String,"init-author-url":["",Hh],"init-license":String,"init-version":d8,json:Boolean,key:[null,String],"legacy-bundling":Boolean,link:Boolean,"local-address":uae(),loglevel:["silent","error","warn","notice","http","timing","info","verbose","silly"],logstream:sae,"logs-max":Number,long:Boolean,maxsockets:Number,message:String,"metrics-registry":[null,String],"node-options":[null,String],"node-version":[null,d8],"no-proxy":[null,String,Array],offline:Boolean,"onload-script":[null,String],only:[null,"dev","development","prod","production"],optional:Boolean,"package-lock":Boolean,otp:[null,String],"package-lock-only":Boolean,parseable:Boolean,"prefer-offline":Boolean,"prefer-online":Boolean,prefix:Oo,production:Boolean,progress:Boolean,proxy:[null,!1,Hh],provenance:Boolean,"read-only":Boolean,"rebuild-bundle":Boolean,registry:[null,Hh],rollback:Boolean,save:Boolean,"save-bundle":Boolean,"save-dev":Boolean,"save-exact":Boolean,"save-optional":Boolean,"save-prefix":String,"save-prod":Boolean,scope:String,"script-shell":[null,String],"scripts-prepend-node-path":[!1,!0,"auto","warn-only"],searchopts:String,searchexclude:[null,String],searchlimit:Number,searchstaleness:Number,"send-metrics":Boolean,shell:String,shrinkwrap:Boolean,"sign-git-tag":Boolean,"sso-poll-frequency":Number,"sso-type":[null,"oauth","saml"],"strict-ssl":Boolean,tag:String,timing:Boolean,tmp:Oo,unicode:Boolean,"unsafe-perm":Boolean,usage:Boolean,user:[Number,String],userconfig:Oo,umask:aae,version:Boolean,"tag-version-prefix":String,versions:Boolean,viewer:String,_exit:Boolean}});var D8=y((yye,y8)=>{"use strict";var{readCAFileSync:cae}=Kj(),m8=require("fs"),gb=require("path"),{ConfigChain:lae}=o8(),fae=a8(),g8=f8(),yb=class extends lae{constructor(e,r){super(e),this.root=e,this._parseField=g8.parseField.bind(null,r||p8())}add(e,r){try{for(let n of Object.keys(e))e[n]=this._parseField(e[n],n)}catch(n){throw n}return super.add(e,r)}addFile(e,r){r=r||e;let n={__source__:r};this.sources[r]={path:e,type:"ini"},this.push(n),this._await();try{let i=m8.readFileSync(e,"utf8");this.addString(i,e,"ini",n)}catch(i){if(i.code==="ENOENT")this.add({},n);else return`Issue while reading "${e}". ${i.message}`}}addEnv(e){e=e||process.env;let r={};return Object.keys(e).filter(n=>/^npm_config_/i.test(n)).forEach(n=>{e[n]&&(r[fae(n.substr(11))]=e[n])}),super.addEnv("",r,"env")}loadPrefix(){let e=this.list[0];Object.defineProperty(this,"prefix",{enumerable:!0,set:n=>{let i=this.get("global");this[i?"globalPrefix":"localPrefix"]=n},get:()=>this.get("global")?this.globalPrefix:this.localPrefix}),Object.defineProperty(this,"globalPrefix",{enumerable:!0,set:n=>{this.set("prefix",n)},get:()=>gb.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=gb.resolve(e.prefix);else try{r=g8.findPrefix(process.cwd())}catch(n){throw n}return r}loadCAFile(e){if(!e)return;let r=cae(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=gb.resolve(this.get("prefix"));try{let n=m8.statSync(r);e.user=n.uid}catch(n){if(n.code==="ENOENT")return;throw n}}};y8.exports=yb});var C8=y(E8=>{"use strict";var w8=require("os"),Ln=require("path"),_8=w8.tmpdir(),dae=process.getuid?process.getuid():process.pid,hae=()=>!0,v8=process.platform==="win32",b8={editor:()=>process.env.EDITOR||process.env.VISUAL||(v8?"notepad.exe":"vi"),shell:()=>v8?process.env.COMSPEC||"cmd.exe":process.env.SHELL||"/bin/bash"},pae={fromString:()=>process.umask()},Ea=w8.homedir();Ea?process.env.HOME=Ea:Ea=Ln.resolve(_8,"npm-"+dae);var mae=process.platform==="win32"?"npm-cache":".npm",gae=process.platform==="win32"&&process.env.APPDATA||Ea,yae=Ln.resolve(gae,mae),zh,Ao;Object.defineProperty(E8,"defaults",{get:function(){return zh||(process.env.PREFIX?Ao=process.env.PREFIX:process.platform==="win32"?Ao=Ln.dirname(process.execPath):(Ao=Ln.dirname(Ln.dirname(process.execPath)),process.env.DESTDIR&&(Ao=Ln.join(process.env.DESTDIR,Ao))),zh={access:null,"allow-same-version":!1,"always-auth":!1,also:null,audit:!0,"auth-type":"legacy","bin-links":!0,browser:null,ca:null,cafile:null,cache:yae,"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:b8.editor(),"engine-strict":!1,force:!1,"fetch-retries":2,"fetch-retry-factor":10,"fetch-retry-mintimeout":1e4,"fetch-retry-maxtimeout":6e4,git:"git","git-tag-version":!0,"commit-hooks":!0,global:!1,globalconfig:Ln.resolve(Ao,"etc","npmrc"),"global-style":!1,group:process.platform==="win32"?0:process.env.SUDO_GID||process.getgid&&process.getgid(),"ham-it-up":!1,heading:"npm","if-present":!1,"ignore-prepublish":!1,"ignore-scripts":!1,"init-module":Ln.resolve(Ea,".npm-init.js"),"init-author-name":"","init-author-email":"","init-author-url":"","init-version":"1.0.0","init-license":"ISC",json:!1,key:null,"legacy-bundling":!1,link:!1,"local-address":void 0,loglevel:"notice",logstream:process.stderr,"logs-max":10,long:!1,maxsockets:50,message:"%s","metrics-registry":null,"node-options":null,offline:!1,"onload-script":!1,only:null,optional:!0,otp:null,"package-lock":!0,"package-lock-only":!1,parseable:!1,"prefer-offline":!1,"prefer-online":!1,prefix:Ao,production:process.env.NODE_ENV==="production",progress:!process.env.TRAVIS&&!process.env.CI,provenance:!1,proxy:null,"https-proxy":null,"no-proxy":null,"user-agent":"npm/{npm-version} node/{node-version} {platform} {arch}","read-only":!1,"rebuild-bundle":!0,registry:"https://registry.npmjs.org/",rollback:!0,save:!0,"save-bundle":!1,"save-dev":!1,"save-exact":!1,"save-optional":!1,"save-prefix":"^","save-prod":!1,scope:"","script-shell":null,"scripts-prepend-node-path":"warn-only",searchopts:"",searchexclude:null,searchlimit:20,searchstaleness:15*60,"send-metrics":!1,shell:b8.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:_8,unicode:hae(),"unsafe-perm":process.platform==="win32"||process.platform==="cygwin"||!(process.getuid&&process.setuid&&process.getgid&&process.setgid)||process.getuid()!==0,usage:!1,user:process.platform==="win32"?0:"nobody",userconfig:Ln.resolve(Ea,".npmrc"),umask:process.umask?process.umask():pae.fromString("022"),version:!1,versions:!1,viewer:process.platform==="win32"?"browser":"man",_exit:!0},zh)}})});var x8=y((vye,Db)=>{"use strict";var ko=require("path"),Dae=D8(),S8=C8();Db.exports=(t,e,r)=>{let n=new Dae(Object.assign({},S8.defaults,r),e);n.add(Object.assign({},t),"cli");let i=[],o=!1;if(require.resolve.paths){let c=require.resolve.paths("npm"),l;try{l=require.resolve("npm",{paths:c.slice(-1)})}catch{o=!0}l&&i.push(n.addFile(ko.resolve(ko.dirname(l),"..","npmrc"),"builtin"))}n.addEnv(),n.loadPrefix();let s=ko.resolve(n.localPrefix,".npmrc"),a=n.get("userconfig");if(!n.get("global")&&s!==a?i.push(n.addFile(s,"project")):n.add({},"project"),n.get("workspace-prefix")&&n.get("workspace-prefix")!==s){let c=ko.resolve(n.get("workspace-prefix"),".npmrc");i.push(n.addFile(c,"workspace"))}if(i.push(n.addFile(n.get("userconfig"),"user")),n.get("prefix")){let c=ko.resolve(n.get("prefix"),"etc");n.root.globalconfig=ko.resolve(c,"npmrc"),n.root.globalignorefile=ko.resolve(c,"npmignore")}i.push(n.addFile(n.get("globalconfig"),"global")),n.loadUser();let u=n.get("cafile");return u&&n.loadCAFile(u),{config:n,warnings:i.filter(Boolean),failedToLoadBuiltInConfig:o}};Object.defineProperty(Db.exports,"defaults",{get(){return S8.defaults},enumerable:!0})});var $8=y((bye,R8)=>{var vb=require("url"),F8=x8(),O8=":_authToken",A8=":_auth",k8=":username",T8=":_password";R8.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]}}:F8()).config,e=e||r.npmrc.get("registry")||F8.defaults.registry,P8(e,r)||vae(r.npmrc)};function P8(t,e){let r=vb.parse(t,!1,!0),n;for(;n!=="/"&&r.pathname!==n;){n=r.pathname||"/";let i="//"+r.host+n.replace(/\/$/,""),o=wae(i,e.npmrc);if(o)return o;if(!e.recursive)return/\/$/.test(t)?void 0:P8(vb.resolve(t,"."),e);r.pathname=vb.resolve(bae(n),"..")||"/"}}function vae(t){return t.get("_auth")?{token:Gh(t.get("_auth")),type:"Basic"}:void 0}function bae(t){return t[t.length-1]==="/"?t:t+"/"}function wae(t,e){let r=_ae(e.get(t+O8)||e.get(t+"/"+O8));if(r)return r;let n=e.get(t+k8)||e.get(t+"/"+k8),i=e.get(t+T8)||e.get(t+"/"+T8),o=Eae(n,i);if(o)return o;let s=Cae(e.get(t+A8)||e.get(t+"/"+A8));if(s)return s}function Gh(t){return t.replace(/^\$\{?([^}]*)\}?$/,function(e,r){return process.env[r]})}function _ae(t){return t?{token:Gh(t),type:"Bearer"}:void 0}function Eae(t,e){if(!t||!e)return;let r=Buffer.from(Gh(e),"base64").toString("utf8");return{token:Buffer.from(t+":"+r,"utf8").toString("base64"),type:"Basic",password:r,username:t}}function Cae(t){return t?{token:Gh(t),type:"Basic"}:void 0}});var IL=y((Swe,Vn)=>{var st=require("fs"),Yb=require("os"),fr=require("path"),bL=require("crypto"),ln={fs:st.constants,os:Yb.constants},wL="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",EL=/XXXXXX/,cue=3,CL=(ln.O_CREAT||ln.fs.O_CREAT)|(ln.O_EXCL||ln.fs.O_EXCL)|(ln.O_RDWR||ln.fs.O_RDWR),lue=Yb.platform()==="win32",fue=ln.EBADF||ln.os.errno.EBADF,due=ln.ENOENT||ln.os.errno.ENOENT,SL=448,xL=384,hue="exit",Pa=[],FL=st.rmdirSync.bind(st),OL=!1;function pue(t,e){return st.rm(t,{recursive:!0},e)}function AL(t){return st.rmSync(t,{recursive:!0})}function Jb(t,e){let r=Ra(t,e),n=r[0],i=r[1];try{PL(n)}catch(s){return i(s)}let o=n.tries;(function s(){try{let a=TL(n);st.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 Xb(t){let e=Ra(t),r=e[0];PL(r);let n=r.tries;do{let i=TL(r);try{st.statSync(i)}catch{return i}}while(n-- >0);throw new Error("Could not get a unique tmp filename, max tries reached")}function mue(t,e){let r=Ra(t,e),n=r[0],i=r[1];Jb(n,function(s,a){if(s)return i(s);st.open(a,CL,n.mode||xL,function(c,l){if(c)return i(c);if(n.discardDescriptor)return st.close(l,function(h){return i(h,a,void 0,Gb(a,-1,n,!1))});{let f=n.discardDescriptor||n.detachDescriptor;i(null,a,l,Gb(a,f?-1:l,n,!1))}})})}function gue(t){let e=Ra(t),r=e[0],n=r.discardDescriptor||r.detachDescriptor,i=Xb(r);var o=st.openSync(i,CL,r.mode||xL);return r.discardDescriptor&&(st.closeSync(o),o=void 0),{name:i,fd:o,removeCallback:Gb(i,n?-1:o,r,!0)}}function yue(t,e){let r=Ra(t,e),n=r[0],i=r[1];Jb(n,function(s,a){if(s)return i(s);st.mkdir(a,n.mode||SL,function(c){if(c)return i(c);i(null,a,kL(a,n,!1))})})}function Due(t){let e=Ra(t),r=e[0],n=Xb(r);return st.mkdirSync(n,r.mode||SL),{name:n,removeCallback:kL(n,r,!0)}}function vue(t,e){let r=function(n){if(n&&!Kb(n))return e(n);e()};0<=t[0]?st.close(t[0],function(){st.unlink(t[1],r)}):st.unlink(t[1],r)}function bue(t){let e=null;try{0<=t[0]&&st.closeSync(t[0])}catch(r){if(!Eue(r)&&!Kb(r))throw r}finally{try{st.unlinkSync(t[1])}catch(r){Kb(r)||(e=r)}}if(e!==null)throw e}function Gb(t,e,r,n){let i=mp(bue,[e,t],n),o=mp(vue,[e,t],n,i);return r.keep||Pa.unshift(i),n?i:o}function kL(t,e,r){let n=e.unsafeCleanup?pue:st.rmdir.bind(st),i=e.unsafeCleanup?AL:FL,o=mp(i,t,r),s=mp(n,t,r,o);return e.keep||Pa.unshift(o),r?o:s}function mp(t,e,r,n){let i=!1;return function o(s){if(!i){let a=n||o,u=Pa.indexOf(a);return u>=0&&Pa.splice(u,1),i=!0,r||t===FL||t===AL?t(e):t(e,s||function(){})}}}function wue(){if(OL)for(;Pa.length;)try{Pa[0]()}catch{}}function _L(t){let e=[],r=null;try{r=bL.randomBytes(t)}catch{r=bL.pseudoRandomBytes(t)}for(var n=0;n<t;n++)e.push(wL[r[n]%wL.length]);return e.join("")}function _ue(t){return t===null||rr(t)||!t.trim()}function rr(t){return typeof t>"u"}function Ra(t,e){if(typeof t=="function")return[{},t];if(rr(t))return[{},e];let r={};for(let n of Object.getOwnPropertyNames(t))r[n]=t[n];return[r,e]}function TL(t){let e=t.tmpdir;if(!rr(t.name))return fr.join(e,t.dir,t.name);if(!rr(t.template))return fr.join(e,t.dir,t.template).replace(EL,_L(6));let r=[t.prefix?t.prefix:"tmp","-",process.pid,"-",_L(12),t.postfix?"-"+t.postfix:""].join("");return fr.join(e,t.dir,r)}function PL(t){t.tmpdir=$L(t);let e=t.tmpdir;if(rr(t.name)||zb(t.name,"name",e),rr(t.dir)||zb(t.dir,"dir",e),!rr(t.template)&&(zb(t.template,"template",e),!t.template.match(EL)))throw new Error(`Invalid template, found "${t.template}".`);if(!rr(t.tries)&&isNaN(t.tries)||t.tries<0)throw new Error(`Invalid tries, found "${t.tries}".`);t.tries=rr(t.name)?t.tries||cue:1,t.keep=!!t.keep,t.detachDescriptor=!!t.detachDescriptor,t.discardDescriptor=!!t.discardDescriptor,t.unsafeCleanup=!!t.unsafeCleanup,t.dir=rr(t.dir)?"":fr.relative(e,Wb(t.dir,e)),t.template=rr(t.template)?void 0:fr.relative(e,Wb(t.template,e)),t.template=_ue(t.template)?void 0:fr.relative(t.dir,t.template),t.name=rr(t.name)?void 0:t.name,t.prefix=rr(t.prefix)?"":t.prefix,t.postfix=rr(t.postfix)?"":t.postfix}function Wb(t,e){return t.startsWith(e)?fr.resolve(t):fr.resolve(fr.join(e,t))}function zb(t,e,r){if(e==="name"){if(fr.isAbsolute(t))throw new Error(`${e} option must not contain an absolute path, found "${t}".`);let n=fr.basename(t);if(n===".."||n==="."||n!==t)throw new Error(`${e} option must not contain a path, found "${t}".`)}else{if(fr.isAbsolute(t)&&!t.startsWith(r))throw new Error(`${e} option must be relative to "${r}", found "${t}".`);let n=Wb(t,r);if(!n.startsWith(r))throw new Error(`${e} option must be relative to "${r}", found "${n}".`)}}function Eue(t){return RL(t,-fue,"EBADF")}function Kb(t){return RL(t,-due,"ENOENT")}function RL(t,e,r){return lue?t.code===r:t.code===r&&t.errno===e}function Cue(){OL=!0}function $L(t){return fr.resolve(t&&t.tmpdir||Yb.tmpdir())}process.addListener(hue,wue);Object.defineProperty(Vn.exports,"tmpdir",{enumerable:!0,configurable:!1,get:function(){return $L()}});Vn.exports.dir=yue;Vn.exports.dirSync=Due;Vn.exports.file=mue;Vn.exports.fileSync=gue;Vn.exports.tmpName=Jb;Vn.exports.tmpNameSync=Xb;Vn.exports.setGracefulCleanup=Cue});var Dw=le(yw(),1),{program:A,createCommand:rce,createArgument:nce,createOption:ice,CommanderError:oce,InvalidArgumentError:sce,InvalidOptionArgumentError:ace,Command:uce,Argument:cce,Option:lce,Help:fce}=Dw.default;var Ir={name:"@capgo/cli",version:"4.24.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":"^3.8.0","@bradenmacdonald/s3-lite-client":"npm:@jsr/bradenmacdonald__s3-lite-client","@capacitor/cli":"^6.1.2","@capgo/find-package-manager":"^0.0.17","@clack/prompts":"^0.7.0","@sauber/table":"npm:@jsr/sauber__table","@std/semver":"npm:@jsr/std__semver","@supabase/supabase-js":"^2.46.0","@tomasklaen/checksum":"^1.1.0","@types/adm-zip":"^0.5.6","@types/node":"^22.8.4","@types/prettyjson":"^0.0.33","@types/tmp":"^0.2.6","@typescript-eslint/eslint-plugin":"^8.12.2","@typescript-eslint/parser":"^8.12.2","@vercel/ncc":"^0.38.2","adm-zip":"^0.5.16","ci-info":"^4.0.0",commander:"12.1.0",esbuild:"^0.24.0",eslint:"9.14.0","git-format-staged":"3.1.1",husky:"^9.1.6","is-wsl":"^3.1.0",ky:"^1.7.2","latest-version":"^9.0.0",open:"^10.1.0",pkg:"5.8.1",prettyjson:"^1.2.5",tmp:"^0.2.3","ts-loader":"^9.5.1","ts-node":"^10.9.2","tsconfig-paths":"4.2.0","tus-js-client":"^4.2.3",typescript:"5.6.3"}};var Ca=require("node:fs"),N8=require("node:process");var kt=le(ke(),1),jo=require("node:process"),Gn=le(require("node:readline"),1),qp=le(require("node:readline"),1),kw=require("node:tty"),sl=le(_w(),1);function EB({onlyFirst:t=!1}={}){let e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(e,t?void 0:"g")}function Tw(t){if(typeof t!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);return t.replace(EB(),"")}var Mp={},CB={get exports(){return Mp},set exports(t){Mp=t}};(function(t){var e={};t.exports=e,e.eastAsianWidth=function(n){var i=n.charCodeAt(0),o=n.length==2?n.charCodeAt(1):0,s=i;return 55296<=i&&i<=56319&&56320<=o&&o<=57343&&(i&=1023,o&=1023,s=i<<10|o,s+=65536),s==12288||65281<=s&&s<=65376||65504<=s&&s<=65510?"F":s==8361||65377<=s&&s<=65470||65474<=s&&s<=65479||65482<=s&&s<=65487||65490<=s&&s<=65495||65498<=s&&s<=65500||65512<=s&&s<=65518?"H":4352<=s&&s<=4447||4515<=s&&s<=4519||4602<=s&&s<=4607||9001<=s&&s<=9002||11904<=s&&s<=11929||11931<=s&&s<=12019||12032<=s&&s<=12245||12272<=s&&s<=12283||12289<=s&&s<=12350||12353<=s&&s<=12438||12441<=s&&s<=12543||12549<=s&&s<=12589||12593<=s&&s<=12686||12688<=s&&s<=12730||12736<=s&&s<=12771||12784<=s&&s<=12830||12832<=s&&s<=12871||12880<=s&&s<=13054||13056<=s&&s<=19903||19968<=s&&s<=42124||42128<=s&&s<=42182||43360<=s&&s<=43388||44032<=s&&s<=55203||55216<=s&&s<=55238||55243<=s&&s<=55291||63744<=s&&s<=64255||65040<=s&&s<=65049||65072<=s&&s<=65106||65108<=s&&s<=65126||65128<=s&&s<=65131||110592<=s&&s<=110593||127488<=s&&s<=127490||127504<=s&&s<=127546||127552<=s&&s<=127560||127568<=s&&s<=127569||131072<=s&&s<=194367||177984<=s&&s<=196605||196608<=s&&s<=262141?"W":32<=s&&s<=126||162<=s&&s<=163||165<=s&&s<=166||s==172||s==175||10214<=s&&s<=10221||10629<=s&&s<=10630?"Na":s==161||s==164||167<=s&&s<=168||s==170||173<=s&&s<=174||176<=s&&s<=180||182<=s&&s<=186||188<=s&&s<=191||s==198||s==208||215<=s&&s<=216||222<=s&&s<=225||s==230||232<=s&&s<=234||236<=s&&s<=237||s==240||242<=s&&s<=243||247<=s&&s<=250||s==252||s==254||s==257||s==273||s==275||s==283||294<=s&&s<=295||s==299||305<=s&&s<=307||s==312||319<=s&&s<=322||s==324||328<=s&&s<=331||s==333||338<=s&&s<=339||358<=s&&s<=359||s==363||s==462||s==464||s==466||s==468||s==470||s==472||s==474||s==476||s==593||s==609||s==708||s==711||713<=s&&s<=715||s==717||s==720||728<=s&&s<=731||s==733||s==735||768<=s&&s<=879||913<=s&&s<=929||931<=s&&s<=937||945<=s&&s<=961||963<=s&&s<=969||s==1025||1040<=s&&s<=1103||s==1105||s==8208||8211<=s&&s<=8214||8216<=s&&s<=8217||8220<=s&&s<=8221||8224<=s&&s<=8226||8228<=s&&s<=8231||s==8240||8242<=s&&s<=8243||s==8245||s==8251||s==8254||s==8308||s==8319||8321<=s&&s<=8324||s==8364||s==8451||s==8453||s==8457||s==8467||s==8470||8481<=s&&s<=8482||s==8486||s==8491||8531<=s&&s<=8532||8539<=s&&s<=8542||8544<=s&&s<=8555||8560<=s&&s<=8569||s==8585||8592<=s&&s<=8601||8632<=s&&s<=8633||s==8658||s==8660||s==8679||s==8704||8706<=s&&s<=8707||8711<=s&&s<=8712||s==8715||s==8719||s==8721||s==8725||s==8730||8733<=s&&s<=8736||s==8739||s==8741||8743<=s&&s<=8748||s==8750||8756<=s&&s<=8759||8764<=s&&s<=8765||s==8776||s==8780||s==8786||8800<=s&&s<=8801||8804<=s&&s<=8807||8810<=s&&s<=8811||8814<=s&&s<=8815||8834<=s&&s<=8835||8838<=s&&s<=8839||s==8853||s==8857||s==8869||s==8895||s==8978||9312<=s&&s<=9449||9451<=s&&s<=9547||9552<=s&&s<=9587||9600<=s&&s<=9615||9618<=s&&s<=9621||9632<=s&&s<=9633||9635<=s&&s<=9641||9650<=s&&s<=9651||9654<=s&&s<=9655||9660<=s&&s<=9661||9664<=s&&s<=9665||9670<=s&&s<=9672||s==9675||9678<=s&&s<=9681||9698<=s&&s<=9701||s==9711||9733<=s&&s<=9734||s==9737||9742<=s&&s<=9743||9748<=s&&s<=9749||s==9756||s==9758||s==9792||s==9794||9824<=s&&s<=9825||9827<=s&&s<=9829||9831<=s&&s<=9834||9836<=s&&s<=9837||s==9839||9886<=s&&s<=9887||9918<=s&&s<=9919||9924<=s&&s<=9933||9935<=s&&s<=9953||s==9955||9960<=s&&s<=9983||s==10045||s==10071||10102<=s&&s<=10111||11093<=s&&s<=11097||12872<=s&&s<=12879||57344<=s&&s<=63743||65024<=s&&s<=65039||s==65533||127232<=s&&s<=127242||127248<=s&&s<=127277||127280<=s&&s<=127337||127344<=s&&s<=127386||917760<=s&&s<=917999||983040<=s&&s<=1048573||1048576<=s&&s<=1114109?"A":"N"},e.characterLength=function(n){var i=this.eastAsianWidth(n);return i=="F"||i=="W"||i=="A"?2:1};function r(n){return n.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}e.length=function(n){for(var i=r(n),o=0,s=0;s<i.length;s++)o=o+this.characterLength(i[s]);return o},e.slice=function(n,i,o){textLen=e.length(n),i=i||0,o=o||1,i<0&&(i=textLen+i),o<0&&(o=textLen+o);for(var s="",a=0,u=r(n),c=0;c<u.length;c++){var l=u[c],f=e.length(l);if(a>=i-(f==2?1:0))if(a+f<=o)s+=l;else break;a+=f}return s}})(CB);var SB=Mp,xB=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};function Na(t,e={}){if(typeof t!="string"||t.length===0||(e={ambiguousIsNarrow:!0,...e},t=Tw(t),t.length===0))return 0;t=t.replace(xB()," ");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(SB.eastAsianWidth(i)){case"F":case"W":n+=2;break;case"A":n+=r;break;default:n+=1}}return n}var Lp=10,Ew=(t=0)=>e=>`\x1B[${e+t}m`,Cw=(t=0)=>e=>`\x1B[${38+t};5;${e}m`,Sw=(t=0)=>(e,r,n)=>`\x1B[${38+t};2;${e};${r};${n}m`,Ie={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};Object.keys(Ie.modifier);var FB=Object.keys(Ie.color),OB=Object.keys(Ie.bgColor);[...FB,...OB];function AB(){let t=new Map;for(let[e,r]of Object.entries(Ie)){for(let[n,i]of Object.entries(r))Ie[n]={open:`\x1B[${i[0]}m`,close:`\x1B[${i[1]}m`},r[n]=Ie[n],t.set(i[0],i[1]);Object.defineProperty(Ie,e,{value:r,enumerable:!1})}return Object.defineProperty(Ie,"codes",{value:t,enumerable:!1}),Ie.color.close="\x1B[39m",Ie.bgColor.close="\x1B[49m",Ie.color.ansi=Ew(),Ie.color.ansi256=Cw(),Ie.color.ansi16m=Sw(),Ie.bgColor.ansi=Ew(Lp),Ie.bgColor.ansi256=Cw(Lp),Ie.bgColor.ansi16m=Sw(Lp),Object.defineProperties(Ie,{rgbToAnsi256:{value:(e,r,n)=>e===r&&r===n?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5),enumerable:!1},hexToRgb:{value:e=>{let r=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!r)return[0,0,0];let[n]=r;n.length===3&&(n=[...n].map(o=>o+o).join(""));let i=Number.parseInt(n,16);return[i>>16&255,i>>8&255,i&255]},enumerable:!1},hexToAnsi256:{value:e=>Ie.rgbToAnsi256(...Ie.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value:e=>{if(e<8)return 30+e;if(e<16)return 90+(e-8);let r,n,i;if(e>=232)r=((e-232)*10+8)/255,n=r,i=r;else{e-=16;let a=e%36;r=Math.floor(e/36)/5,n=Math.floor(a/6)/5,i=a%6/5}let o=Math.max(r,n,i)*2;if(o===0)return 30;let s=30+(Math.round(i)<<2|Math.round(n)<<1|Math.round(r));return o===2&&(s+=60),s},enumerable:!1},rgbToAnsi:{value:(e,r,n)=>Ie.ansi256ToAnsi(Ie.rgbToAnsi256(e,r,n)),enumerable:!1},hexToAnsi:{value:e=>Ie.ansi256ToAnsi(Ie.hexToAnsi256(e)),enumerable:!1}}),Ie}var kB=AB(),ll=new Set(["\x1B","\x9B"]),TB=39,Up="\x07",Pw="[",PB="]",Rw="m",Vp=`${PB}8;;`,xw=t=>`${ll.values().next().value}${Pw}${t}${Rw}`,Fw=t=>`${ll.values().next().value}${Vp}${t}${Up}`,RB=t=>t.split(" ").map(e=>Na(e)),Bp=(t,e,r)=>{let n=[...e],i=!1,o=!1,s=Na(Tw(t[t.length-1]));for(let[a,u]of n.entries()){let c=Na(u);if(s+c<=r?t[t.length-1]+=u:(t.push(u),s=0),ll.has(u)&&(i=!0,o=n.slice(a+1).join("").startsWith(Vp)),i){o?u===Up&&(i=!1,o=!1):u===Rw&&(i=!1);continue}s+=c,s===r&&a<n.length-1&&(t.push(""),s=0)}!s&&t[t.length-1].length>0&&t.length>1&&(t[t.length-2]+=t.pop())},$B=t=>{let e=t.split(" "),r=e.length;for(;r>0&&!(Na(e[r-1])>0);)r--;return r===e.length?t:e.slice(0,r).join(" ")+e.slice(r).join("")},IB=(t,e,r={})=>{if(r.trim!==!1&&t.trim()==="")return"";let n="",i,o,s=RB(t),a=[""];for(let[c,l]of t.split(" ").entries()){r.trim!==!1&&(a[a.length-1]=a[a.length-1].trimStart());let f=Na(a[a.length-1]);if(c!==0&&(f>=e&&(r.wordWrap===!1||r.trim===!1)&&(a.push(""),f=0),(f>0||r.trim===!1)&&(a[a.length-1]+=" ",f++)),r.hard&&s[c]>e){let h=e-f,d=1+Math.floor((s[c]-h-1)/e);Math.floor((s[c]-1)/e)<d&&a.push(""),Bp(a,l,e);continue}if(f+s[c]>e&&f>0&&s[c]>0){if(r.wordWrap===!1&&f<e){Bp(a,l,e);continue}a.push("")}if(f+s[c]>e&&r.wordWrap===!1){Bp(a,l,e);continue}a[a.length-1]+=l}r.trim!==!1&&(a=a.map(c=>$B(c)));let u=[...a.join(`
201
+ `)];for(let[c,l]of u.entries()){if(n+=l,ll.has(l)){let{groups:h}=new RegExp(`(?:\\${Pw}(?<code>\\d+)m|\\${Vp}(?<uri>.*)${Up})`).exec(u.slice(c).join(""))||{groups:{}};if(h.code!==void 0){let d=Number.parseFloat(h.code);i=d===TB?void 0:d}else h.uri!==void 0&&(o=h.uri.length===0?void 0:h.uri)}let f=kB.codes.get(Number(i));u[c+1]===`
202
+ `?(o&&(n+=Fw("")),i&&f&&(n+=xw(f))):l===`
203
+ `&&(i&&f&&(n+=xw(i)),o&&(n+=Fw(o)))}return n};function Ow(t,e,r){return String(t).normalize().replace(/\r\n/g,`
204
204
  `).split(`
205
205
  `).map(n=>IB(n,e,r)).join(`
206
206
  `)}function jB(t,e){if(t===e)return;let r=t.split(`
207
207
  `),n=e.split(`
208
- `),i=[];for(let o=0;o<Math.max(r.length,n.length);o++)r[o]!==n[o]&&i.push(o);return i}var Iw=Symbol("clack:cancel");function qt(t){return t===Iw}function ol(t,e){t.isTTY&&t.setRawMode(e)}var kw=new Map([["k","up"],["j","down"],["h","left"],["l","right"]]),NB=new Set(["up","down","left","right","space","enter"]),La=class{constructor({render:e,input:r=jo.stdin,output:n=jo.stdout,...i},o=!0){this._track=!1,this._cursor=0,this.state="initial",this.error="",this.subscribers=new Map,this._prevFrame="",this.opts=i,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=e.bind(this),this._track=o,this.input=r,this.output=n}prompt(){let e=new Tw.WriteStream(0);return e._write=(r,n,i)=>{this._track&&(this.value=this.rl.line.replace(/\t/g,""),this._cursor=this.rl.cursor,this.emit("value",this.value)),i()},this.input.pipe(e),this.rl=qp.default.createInterface({input:this.input,output:e,tabSize:2,prompt:"",escapeCodeTimeout:50}),qp.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),ol(this.input,!0),this.output.on("resize",this.render),this.render(),new Promise((r,n)=>{this.once("submit",()=>{this.output.write(kt.cursor.show),this.output.off("resize",this.render),ol(this.input,!1),r(this.value)}),this.once("cancel",()=>{this.output.write(kt.cursor.show),this.output.off("resize",this.render),ol(this.input,!1),r(Iw)})})}on(e,r){let n=this.subscribers.get(e)??[];n.push({cb:r}),this.subscribers.set(e,n)}once(e,r){let n=this.subscribers.get(e)??[];n.push({cb:r,once:!0}),this.subscribers.set(e,n)}emit(e,...r){let n=this.subscribers.get(e)??[],i=[];for(let o of n)o.cb(...r),o.once&&i.push(()=>n.splice(n.indexOf(o),1));for(let o of i)o()}unsubscribe(){this.subscribers.clear()}onKeypress(e,r){if(this.state==="error"&&(this.state="active"),r?.name&&!this._track&&kw.has(r.name)&&this.emit("cursor",kw.get(r.name)),r?.name&&NB.has(r.name)&&this.emit("cursor",r.name),e&&(e.toLowerCase()==="y"||e.toLowerCase()==="n")&&this.emit("confirm",e.toLowerCase()==="y"),e&&this.emit("key",e.toLowerCase()),r?.name==="return"){if(this.opts.validate){let n=this.opts.validate(this.value);n&&(this.error=n,this.state="error",this.rl.write(this.value))}this.state!=="error"&&(this.state="submit")}e===""&&(this.state="cancel"),(this.state==="submit"||this.state==="cancel")&&this.emit("finalize"),this.render(),(this.state==="submit"||this.state==="cancel")&&this.close()}close(){this.input.unpipe(),this.input.removeListener("keypress",this.onKeypress),this.output.write(`
209
- `),ol(this.input,!1),this.rl.close(),this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){let e=Aw(this._prevFrame,process.stdout.columns,{hard:!0}).split(`
210
- `).length-1;this.output.write(kt.cursor.move(-999,e*-1))}render(){let e=Aw(this._render(this)??"",process.stdout.columns,{hard:!0});if(e!==this._prevFrame){if(this.state==="initial")this.output.write(kt.cursor.hide);else{let r=jB(this._prevFrame,e);if(this.restoreCursor(),r&&r?.length===1){let n=r[0];this.output.write(kt.cursor.move(0,n)),this.output.write(kt.erase.lines(1));let i=e.split(`
208
+ `),i=[];for(let o=0;o<Math.max(r.length,n.length);o++)r[o]!==n[o]&&i.push(o);return i}var $w=Symbol("clack:cancel");function qt(t){return t===$w}function ol(t,e){t.isTTY&&t.setRawMode(e)}var Aw=new Map([["k","up"],["j","down"],["h","left"],["l","right"]]),NB=new Set(["up","down","left","right","space","enter"]),La=class{constructor({render:e,input:r=jo.stdin,output:n=jo.stdout,...i},o=!0){this._track=!1,this._cursor=0,this.state="initial",this.error="",this.subscribers=new Map,this._prevFrame="",this.opts=i,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=e.bind(this),this._track=o,this.input=r,this.output=n}prompt(){let e=new kw.WriteStream(0);return e._write=(r,n,i)=>{this._track&&(this.value=this.rl.line.replace(/\t/g,""),this._cursor=this.rl.cursor,this.emit("value",this.value)),i()},this.input.pipe(e),this.rl=qp.default.createInterface({input:this.input,output:e,tabSize:2,prompt:"",escapeCodeTimeout:50}),qp.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),ol(this.input,!0),this.output.on("resize",this.render),this.render(),new Promise((r,n)=>{this.once("submit",()=>{this.output.write(kt.cursor.show),this.output.off("resize",this.render),ol(this.input,!1),r(this.value)}),this.once("cancel",()=>{this.output.write(kt.cursor.show),this.output.off("resize",this.render),ol(this.input,!1),r($w)})})}on(e,r){let n=this.subscribers.get(e)??[];n.push({cb:r}),this.subscribers.set(e,n)}once(e,r){let n=this.subscribers.get(e)??[];n.push({cb:r,once:!0}),this.subscribers.set(e,n)}emit(e,...r){let n=this.subscribers.get(e)??[],i=[];for(let o of n)o.cb(...r),o.once&&i.push(()=>n.splice(n.indexOf(o),1));for(let o of i)o()}unsubscribe(){this.subscribers.clear()}onKeypress(e,r){if(this.state==="error"&&(this.state="active"),r?.name&&!this._track&&Aw.has(r.name)&&this.emit("cursor",Aw.get(r.name)),r?.name&&NB.has(r.name)&&this.emit("cursor",r.name),e&&(e.toLowerCase()==="y"||e.toLowerCase()==="n")&&this.emit("confirm",e.toLowerCase()==="y"),e&&this.emit("key",e.toLowerCase()),r?.name==="return"){if(this.opts.validate){let n=this.opts.validate(this.value);n&&(this.error=n,this.state="error",this.rl.write(this.value))}this.state!=="error"&&(this.state="submit")}e===""&&(this.state="cancel"),(this.state==="submit"||this.state==="cancel")&&this.emit("finalize"),this.render(),(this.state==="submit"||this.state==="cancel")&&this.close()}close(){this.input.unpipe(),this.input.removeListener("keypress",this.onKeypress),this.output.write(`
209
+ `),ol(this.input,!1),this.rl.close(),this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){let e=Ow(this._prevFrame,process.stdout.columns,{hard:!0}).split(`
210
+ `).length-1;this.output.write(kt.cursor.move(-999,e*-1))}render(){let e=Ow(this._render(this)??"",process.stdout.columns,{hard:!0});if(e!==this._prevFrame){if(this.state==="initial")this.output.write(kt.cursor.hide);else{let r=jB(this._prevFrame,e);if(this.restoreCursor(),r&&r?.length===1){let n=r[0];this.output.write(kt.cursor.move(0,n)),this.output.write(kt.erase.lines(1));let i=e.split(`
211
211
  `);this.output.write(i[n]),this._prevFrame=e,this.output.write(kt.cursor.move(0,i.length-n-1));return}else if(r&&r?.length>1){let n=r[0];this.output.write(kt.cursor.move(0,n)),this.output.write(kt.erase.down());let i=e.split(`
212
212
  `).slice(n);this.output.write(i.join(`
213
- `)),this._prevFrame=e;return}this.output.write(kt.erase.down())}this.output.write(e),this.state==="initial"&&(this.state="active"),this._prevFrame=e}}},al=class extends La{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(kt.cursor.move(0,-1)),this.value=r,this.state="submit",this.close()}),this.on("cursor",()=>{this.value=!this.value})}};var ul=class extends La{constructor(e){super(e,!1),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 cl=class extends La{constructor(e){super(e),this.valueWithCursor="",this.on("finalize",()=>{this.value||(this.value=e.defaultValue),this.valueWithCursor=this.value}),this.on("value",()=>{if(this.cursor>=this.value.length)this.valueWithCursor=`${this.value}${sl.default.inverse(sl.default.hidden("_"))}`;else{let r=this.value.slice(0,this.cursor),n=this.value.slice(this.cursor);this.valueWithCursor=`${r}${sl.default.inverse(n[0])}${n.slice(1)}`}})}get cursor(){return this._cursor}};function jw({input:t=jo.stdin,output:e=jo.stdout,overwrite:r=!0,hideCursor:n=!0}={}){let i=Gn.createInterface({input:t,output:e,prompt:"",tabSize:1});Gn.emitKeypressEvents(t,i),t.isTTY&&t.setRawMode(!0);let o=(s,{name:a})=>{if(String(s)===""&&process.exit(0),!r)return;Gn.moveCursor(e,a==="return"?0:-1,a==="return"?-1:0,()=>{Gn.clearLine(e,1,()=>{t.once("keypress",o)})})};return n&&process.stdout.write(kt.cursor.hide),t.once("keypress",o),()=>{t.off("keypress",o),n&&process.stdout.write(kt.cursor.show),t.isTTY&&t.setRawMode(!1),i.terminal=!1,i.close()}}var pr=le(require("node:process"),1),V=le(Bw(),1),No=le(ke(),1);function qB(){return pr.default.platform!=="win32"?pr.default.env.TERM!=="linux":!!pr.default.env.CI||!!pr.default.env.WT_SESSION||!!pr.default.env.TERMINUS_SUBLIME||pr.default.env.ConEmuTask==="{cmd::Cmder}"||pr.default.env.TERM_PROGRAM==="Terminus-Sublime"||pr.default.env.TERM_PROGRAM==="vscode"||pr.default.env.TERM==="xterm-256color"||pr.default.env.TERM==="alacritty"||pr.default.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var zp=qB(),et=(t,e)=>zp?t:e,MB=et("\u25C6","*"),qw=et("\u25A0","x"),Mw=et("\u25B2","x"),Kp=et("\u25C7","o"),UB=et("\u250C","T"),Ye=et("\u2502","|"),Lo=et("\u2514","\u2014"),Gp=et("\u25CF",">"),Wp=et("\u25CB"," "),Ece=et("\u25FB","[\u2022]"),Cce=et("\u25FC","[+]"),Sce=et("\u25FB","[ ]"),xce=et("\u25AA","\u2022"),Fce=et("\u2500","-"),Oce=et("\u256E","+"),Ace=et("\u251C","+"),kce=et("\u256F","+"),VB=et("\u25CF","\u2022"),HB=et("\u25C6","*"),zB=et("\u25B2","!"),GB=et("\u25A0","x"),Yp=t=>{switch(t){case"initial":case"active":return V.default.cyan(MB);case"cancel":return V.default.red(qw);case"error":return V.default.yellow(Mw);case"submit":return V.default.green(Kp)}},Uw=t=>new cl({validate:t.validate,placeholder:t.placeholder,defaultValue:t.defaultValue,initialValue:t.initialValue,render(){let e=`${V.default.gray(Ye)}
213
+ `)),this._prevFrame=e;return}this.output.write(kt.erase.down())}this.output.write(e),this.state==="initial"&&(this.state="active"),this._prevFrame=e}}},al=class extends La{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(kt.cursor.move(0,-1)),this.value=r,this.state="submit",this.close()}),this.on("cursor",()=>{this.value=!this.value})}};var ul=class extends La{constructor(e){super(e,!1),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 cl=class extends La{constructor(e){super(e),this.valueWithCursor="",this.on("finalize",()=>{this.value||(this.value=e.defaultValue),this.valueWithCursor=this.value}),this.on("value",()=>{if(this.cursor>=this.value.length)this.valueWithCursor=`${this.value}${sl.default.inverse(sl.default.hidden("_"))}`;else{let r=this.value.slice(0,this.cursor),n=this.value.slice(this.cursor);this.valueWithCursor=`${r}${sl.default.inverse(n[0])}${n.slice(1)}`}})}get cursor(){return this._cursor}};function Iw({input:t=jo.stdin,output:e=jo.stdout,overwrite:r=!0,hideCursor:n=!0}={}){let i=Gn.createInterface({input:t,output:e,prompt:"",tabSize:1});Gn.emitKeypressEvents(t,i),t.isTTY&&t.setRawMode(!0);let o=(s,{name:a})=>{if(String(s)===""&&process.exit(0),!r)return;Gn.moveCursor(e,a==="return"?0:-1,a==="return"?-1:0,()=>{Gn.clearLine(e,1,()=>{t.once("keypress",o)})})};return n&&process.stdout.write(kt.cursor.hide),t.once("keypress",o),()=>{t.off("keypress",o),n&&process.stdout.write(kt.cursor.show),t.isTTY&&t.setRawMode(!1),i.terminal=!1,i.close()}}var pr=le(require("node:process"),1),V=le(Lw(),1),No=le(ke(),1);function qB(){return pr.default.platform!=="win32"?pr.default.env.TERM!=="linux":!!pr.default.env.CI||!!pr.default.env.WT_SESSION||!!pr.default.env.TERMINUS_SUBLIME||pr.default.env.ConEmuTask==="{cmd::Cmder}"||pr.default.env.TERM_PROGRAM==="Terminus-Sublime"||pr.default.env.TERM_PROGRAM==="vscode"||pr.default.env.TERM==="xterm-256color"||pr.default.env.TERM==="alacritty"||pr.default.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var zp=qB(),et=(t,e)=>zp?t:e,MB=et("\u25C6","*"),Bw=et("\u25A0","x"),qw=et("\u25B2","x"),Kp=et("\u25C7","o"),UB=et("\u250C","T"),Ye=et("\u2502","|"),Lo=et("\u2514","\u2014"),Gp=et("\u25CF",">"),Wp=et("\u25CB"," "),Ece=et("\u25FB","[\u2022]"),Cce=et("\u25FC","[+]"),Sce=et("\u25FB","[ ]"),xce=et("\u25AA","\u2022"),Fce=et("\u2500","-"),Oce=et("\u256E","+"),Ace=et("\u251C","+"),kce=et("\u256F","+"),VB=et("\u25CF","\u2022"),HB=et("\u25C6","*"),zB=et("\u25B2","!"),GB=et("\u25A0","x"),Yp=t=>{switch(t){case"initial":case"active":return V.default.cyan(MB);case"cancel":return V.default.red(Bw);case"error":return V.default.yellow(qw);case"submit":return V.default.green(Kp)}},Mw=t=>new cl({validate:t.validate,placeholder:t.placeholder,defaultValue:t.defaultValue,initialValue:t.initialValue,render(){let e=`${V.default.gray(Ye)}
214
214
  ${Yp(this.state)} ${t.message}
215
215
  `,r=t.placeholder?V.default.inverse(t.placeholder[0])+V.default.dim(t.placeholder.slice(1)):V.default.inverse(V.default.hidden("_")),n=this.value?this.valueWithCursor:r;switch(this.state){case"error":return`${e.trim()}
216
216
  ${V.default.yellow(Ye)} ${n}
@@ -229,7 +229,7 @@ ${Yp(this.state)} ${t.message}
229
229
  ${V.default.gray(Ye)}`;default:{let i=t.maxItems===void 0?1/0:Math.max(t.maxItems,5);this.cursor>=r+i-3?r=Math.max(Math.min(this.cursor-i+3,this.options.length-i),0):this.cursor<r+2&&(r=Math.max(this.cursor-2,0));let o=i<this.options.length&&r>0,s=i<this.options.length&&r+i<this.options.length;return`${n}${V.default.cyan(Ye)} ${this.options.slice(r,r+i).map((a,u,c)=>u===0&&o?V.default.dim("..."):u===c.length-1&&s?V.default.dim("..."):e(a,u+r===this.cursor?"active":"inactive")).join(`
230
230
  ${V.default.cyan(Ye)} `)}
231
231
  ${V.default.cyan(Lo)}
232
- `}}}}).prompt()};var Vw=(t="")=>{process.stdout.write(`${V.default.gray(Lo)} ${V.default.red(t)}
232
+ `}}}}).prompt()};var Uw=(t="")=>{process.stdout.write(`${V.default.gray(Lo)} ${V.default.red(t)}
233
233
 
234
234
  `)},Y=(t="")=>{process.stdout.write(`${V.default.gray(UB)} ${t}
235
235
  `)},X=(t="")=>{process.stdout.write(`${V.default.gray(Ye)}
@@ -238,21 +238,21 @@ ${V.default.gray(Lo)} ${t}
238
238
  `)},p={message:(t="",{symbol:e=V.default.gray(Ye)}={})=>{let r=[`${V.default.gray(Ye)}`];if(t){let[n,...i]=t.split(`
239
239
  `);r.push(`${e} ${n}`,...i.map(o=>`${V.default.gray(Ye)} ${o}`))}process.stdout.write(`${r.join(`
240
240
  `)}
241
- `)},info:t=>{p.message(t,{symbol:V.default.blue(VB)})},success:t=>{p.message(t,{symbol:V.default.green(HB)})},step:t=>{p.message(t,{symbol:V.default.green(Kp)})},warn:t=>{p.message(t,{symbol:V.default.yellow(zB)})},warning:t=>{p.warn(t)},error:t=>{p.message(t,{symbol:V.default.red(GB)})}},ve=()=>{let t=zp?["\u25D2","\u25D0","\u25D3","\u25D1"]:["\u2022","o","O","0"],e=zp?80:120,r,n,i=!1,o="",s=(l="")=>{i=!0,r=jw(),o=l.replace(/\.+$/,""),process.stdout.write(`${V.default.gray(Ye)}
242
- `);let f=0,h=0;n=setInterval(()=>{let d=V.default.magenta(t[f]),m=".".repeat(Math.floor(h)).slice(0,3);process.stdout.write(No.cursor.move(-999,0)),process.stdout.write(No.erase.down(1)),process.stdout.write(`${d} ${o}${m}`),f=f+1<t.length?f+1:0,h=h<t.length?h+.125:0},e)},a=(l="",f=0)=>{o=l??o,i=!1,clearInterval(n);let h=f===0?V.default.green(Kp):f===1?V.default.red(qw):V.default.red(Mw);process.stdout.write(No.cursor.move(-999,0)),process.stdout.write(No.erase.down(1)),process.stdout.write(`${h} ${o}
243
- `),r()},u=(l="")=>{o=l??o},c=l=>{let f=l>1?"Something went wrong":"Canceled";i&&a(f,l)};return process.on("uncaughtExceptionMonitor",()=>c(2)),process.on("unhandledRejection",()=>c(2)),process.on("SIGINT",()=>c(1)),process.on("SIGTERM",()=>c(1)),process.on("exit",c),{start:s,stop:a,message:u}};var ot=require("node:fs"),Ah=require("node:os"),rt=le(require("node:path")),ar=require("node:process"),vi=le(dl());var yn=require("fs"),qa=(t=".",e="unknown")=>{let r=`${t}/bun.lockb`,n=`${t}/pnpm-lock.yaml`,i=`${t}/yarn.lock`,o=`${t}/package-lock.json`;return(0,yn.existsSync)(r)?"bun":(0,yn.existsSync)(n)?"pnpm":(0,yn.existsSync)(i)?"yarn":(0,yn.existsSync)(o)?"npm":e},hl=(t=qa(),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"}},Hw=(t=".",e="npx")=>{let r=`${t}/bun.lockb`,n=`${t}/pnpm-lock.yaml`,i=`${t}/yarn.lock`,o=`${t}/package-lock.json`;return(0,yn.existsSync)(r)?"bunx":(0,yn.existsSync)(n)?"pnpm exec":(0,yn.existsSync)(i)?"yarn dlx":(0,yn.existsSync)(o)?"npx":e};var la=le(M_()),Y6=le(vu()),Xv=le(IC());var ti=class extends Error{response;request;options;constructor(e,r,n){let i=e.status||e.status===0?e.status:"",o=e.statusText||"",s=`${i} ${o}`.trim(),a=s?`status code ${s}`:"an unknown error";super(`Request failed with ${a}: ${r.method} ${r.url}`),this.name="HTTPError",this.response=e,this.request=r,this.options=n}};var os=class extends Error{request;constructor(e){super(`Request timed out: ${e.method} ${e.url}`),this.name="TimeoutError",this.request=e}};var ss=t=>t!==null&&typeof t=="object";var wu=(...t)=>{for(let e of t)if((!ss(e)||Array.isArray(e))&&e!==void 0)throw new TypeError("The `options` argument must be an object");return jg({},...t)},$g=(t={},e={})=>{let r=new globalThis.Headers(t),n=e instanceof globalThis.Headers,i=new globalThis.Headers(e);for(let[o,s]of i.entries())n&&s==="undefined"||s===void 0?r.delete(o):r.set(o,s);return r};function Ql(t,e,r){return Object.hasOwn(e,r)&&e[r]===void 0?[]:jg(t[r]??[],e[r]??[])}var Ig=(t={},e={})=>({beforeRequest:Ql(t,e,"beforeRequest"),beforeRetry:Ql(t,e,"beforeRetry"),afterResponse:Ql(t,e,"afterResponse"),beforeError:Ql(t,e,"beforeError")}),jg=(...t)=>{let e={},r={},n={};for(let i of t)if(Array.isArray(i))Array.isArray(e)||(e=[]),e=[...e,...i];else if(ss(i)){for(let[o,s]of Object.entries(i))ss(s)&&o in e&&(s=jg(e[o],s)),e={...e,[o]:s};ss(i.hooks)&&(n=Ig(n,i.hooks),e.hooks=n),ss(i.headers)&&(r=$g(r,i.headers),e.headers=r)}return e};var jC=(()=>{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",LC=typeof globalThis.ReadableStream=="function",BC=typeof globalThis.FormData=="function",ef=["get","post","put","patch","head","delete"],ZU=()=>{};ZU();var qC={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*"},tf=2147483647,rf=Symbol("stop"),MC={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 HC=t=>ef.includes(t)?t.toUpperCase():t,QU=["get","put","head","delete","options","trace"],e9=[408,413,429,500,502,503,504],t9=[413,429,503],VC={limit:2,methods:QU,statusCodes:e9,afterStatusCodes:t9,maxRetryAfter:Number.POSITIVE_INFINITY,backoffLimit:Number.POSITIVE_INFINITY,delay:t=>.3*2**(t-1)*1e3},zC=(t={})=>{if(typeof t=="number")return{...VC,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{...VC,...t}};async function Ng(t,e,r,n){return new Promise((i,o)=>{let s=setTimeout(()=>{r&&r.abort(),o(new os(t))},n.timeout);n.fetch(t,e).then(i).catch(o).then(()=>{clearTimeout(s)})})}async function Lg(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 GC=(t,e)=>{let r={};for(let n in e)!(n in UC)&&!(n in MC)&&!(n in t)&&(r[n]=e[n]);return r};var _u=class t{static create(e,r){let n=new t(e,r),i=async()=>{if(typeof n._options.timeout=="number"&&n._options.timeout>tf)throw new RangeError(`The \`timeout\` option cannot be greater than ${tf}`);await Promise.resolve();let a=await n._fetch();for(let u of n._options.hooks.afterResponse){let c=await u(n.request,n._options,n._decorateResponse(a.clone()));c instanceof globalThis.Response&&(a=c)}if(n._decorateResponse(a),!a.ok&&n._options.throwHttpErrors){let u=new ti(a,n.request,n._options);for(let c of n._options.hooks.beforeError)u=await c(u);throw u}if(n._options.onDownloadProgress){if(typeof n._options.onDownloadProgress!="function")throw new TypeError("The `onDownloadProgress` option must be a function");if(!LC)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(qC))s[a]=async()=>{n.request.headers.set("accept",n.request.headers.get("accept")||u);let l=(await s).clone();if(a==="json"){if(l.status===204||(await l.clone().arrayBuffer()).byteLength===0)return"";if(r.parseJson)return r.parseJson(await l.text())}return l[a]()};return s}request;abortController;_retryCount=0;_input;_options;constructor(e,r={}){if(this._input=e,this._options={...r,headers:$g(this._input.headers,r.headers),hooks:Ig({beforeRequest:[],beforeRetry:[],beforeError:[],afterResponse:[]},r.hooks),method:HC(r.method??this._input.method),prefixUrl:String(r.prefixUrl||""),retry:zC(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?.addEventListener("abort",()=>{this.abortController.abort(n.reason)}),this._options.signal=this.abortController.signal}if(jC&&(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);(BC&&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 os)throw e;if(e instanceof ti){if(!this._options.retry.statusCodes.includes(e.response.status))throw e;let n=e.response.headers.get("Retry-After")??e.response.headers.get("RateLimit-Reset")??e.response.headers.get("X-RateLimit-Reset")??e.response.headers.get("X-Rate-Limit-Reset");if(n&&this._options.retry.afterStatusCodes.includes(e.response.status)){let i=Number(n)*1e3;Number.isNaN(i)?i=Date.parse(n)-Date.now():i>=Date.parse("2024-01-01")&&(i-=Date.now());let o=this._options.retry.maxRetryAfter??i;return i<o?i:o}if(e.response.status===413)throw e}let r=this._options.retry.delay(this._retryCount);return Math.min(this._options.retry.backoffLimit,r)}_decorateResponse(e){return this._options.parseJson&&(e.json=async()=>this._options.parseJson(await e.text())),e}async _retry(e){try{return await e()}catch(r){let n=Math.min(this._calculateRetryDelay(r),tf);if(this._retryCount<1)throw r;await Lg(n,{signal:this._options.signal});for(let i of this._options.hooks.beforeRetry)if(await i({request:this.request,options:this._options,error:r,retryCount:this._retryCount})===rf)return;return this._retry(e)}}async _fetch(){for(let n of this._options.hooks.beforeRequest){let i=await n(this.request,this._options);if(i instanceof Request){this.request=i;break}if(i instanceof Response)return i}let e=GC(this.request,this._options),r=this.request;return this.request=r.clone(),this._options.timeout===!1?this._options.fetch(r,e):Ng(r,e,this.abortController,this._options)}_stream(e,r){let n=Number(e.headers.get("content-length"))||0,i=0;return e.status===204?(r&&r({percent:1,totalBytes:n,transferredBytes:i},new Uint8Array),new globalThis.Response(null,{status:e.status,statusText:e.statusText,headers:e.headers})):new globalThis.Response(new globalThis.ReadableStream({async start(o){let s=e.body.getReader();r&&r({percent:0,transferredBytes:0,totalBytes:n},new Uint8Array);async function a(){let{done:u,value:c}=await s.read();if(u){o.close();return}if(r){i+=c.byteLength;let l=n===0?0:i/n;r({percent:l,transferredBytes:i,totalBytes:n},c)}o.enqueue(c),await a()}await a()}}),{status:e.status,statusText:e.statusText,headers:e.headers})}};var Bg=t=>{let e=(r,n)=>_u.create(r,wu(t,n));for(let r of ef)e[r]=(n,i)=>_u.create(n,wu(t,i,{method:r}));return e.create=r=>Bg(wu(r)),e.extend=r=>(typeof r=="function"&&(r=r(t??{})),Bg(wu(t,r))),e.stop=rf,e},r9=Bg(),Hr=r9;var J6=le(ES()),kh=le(eD());var kc=le(l6());async function f6(){let t=await(0,kc.loadConfig)();return{config:t.app.extConfig,path:t.app.extConfigFilePath}}async function on(t,e=!1){let r=await(0,kc.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,kc.writeConfig)(n,r.app.extConfigFilePath))}var tr=".capgo_key",ur=".capgo_key_v2",cr=`${tr}.pub`,jn=`${ur}.pub`;var V6="https://capgo.app",H6="https://files.capgo.app",z6="https://api.capgo.app",G6="https://web.capgo.app",X6=20,Z6=12e4,fse="package.json",fa=/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-z-][0-9a-z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-z-][0-9a-z-]*))*))?(?:\+([0-9a-z-]+(?:\.[0-9a-z-]+)*))?$/i,Q=t=>t?`
244
- ${J6.default.render(t)}`:"";function W6(t){return new Promise(e=>{setTimeout(e,t)})}function Zv(t){return(0,vi.isMonorepo)(t)?(0,vi.findMonorepoRoot)(t):(0,vi.isNXMonorepo)(t)?(0,vi.findNXMonorepoRoot)(t):t}async function jt(t=Zv((0,ar.cwd)()),e=void 0){e&&((0,ot.existsSync)(e)||(p.error(`Package.json at ${e} does not exist`),(0,ar.exit)(1)));let r=(0,ot.readFileSync)(e||(0,rt.join)(t,fse));return JSON.parse(r)}async function ee(){try{let t=await f6();return t||(p.error("No capacitor config file found, run `cap init` first"),A.error("")),t}catch(t){p.error(`No capacitor config file found, run \`cap init\` first ${Q(t)}`),A.error("")}}async function da(t){let e=await ee();return e?.config&&(e.config.plugins||(e.config.plugins={extConfig:{},CapacitorUpdater:{}}),e.config.plugins.CapacitorUpdater||(e.config.plugins.CapacitorUpdater={}),e.config.plugins.CapacitorUpdater={...e.config.plugins.CapacitorUpdater,...t},on(e)),e}async function Cr(){try{let t=await ee(),e={host:t?.config?.plugins?.CapacitorUpdater?.localHost||V6,hostWeb:t?.config?.plugins?.CapacitorUpdater?.localWebHost||G6,hostFilesApi:t?.config?.plugins?.CapacitorUpdater?.localApiFiles||H6,hostApi:t?.config?.plugins?.CapacitorUpdater?.localApi||z6};return t?.config?.plugins?.CapacitorUpdater?.localSupa&&t?.config?.plugins?.CapacitorUpdater?.localSupaAnon&&(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:V6,hostWeb:G6,hostFilesApi:H6,hostApi:z6}}}var dse=/([A-Za-z0-9]+)\.(java|swift|kt|scala)$/;async function Qv(){let t=await Cr();return Hr.get(`${t.hostApi}/private/config`).then(e=>e.json()).then(e=>({...e,...t})).catch(()=>(p.info(`Local config ${Q(t)}`),t))}async function Q6(){let t=await Cr();return Hr.get(`${t.hostFilesApi}/files/config`).then(e=>e.json()).catch(()=>({partialUpload:!1,TUSUpload:!1,partialUploadForced:!1,TUSUploadForced:!1}))}async function de(t){let e=await Qv();return(!e.supaHost||!e.supaKey)&&(p.error("Cannot connect to server please try again later"),A.error("")),(0,la.createClient)(e.supaHost,e.supaKey,{auth:{persistSession:!1},global:{headers:{capgkey:t}}})}async function hse(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.`),A.error("")}}async function pse(t,e){let{data:r}=await t.rpc("is_paying_org",{orgid:e}).single();return r||!1}async function mse(t,e){let{data:r}=await t.rpc("is_trial_org",{orgid:e}).single();return r||0}async function gse(t,e){let{data:r}=await t.rpc("is_allowed_action_org",{orgid:e}).single();return!!r}async function yse(t,e,r){let{data:n}=await t.rpc("is_allowed_action",{apikey:r,appid:e}).single();return!!n}var Ft=(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))(Ft||{}),ej=(t,e)=>t>=e;async function tj(t,e,r){let{data:n,error:i}=await t.rpc("get_org_perm_for_apikey",{apikey:e,app_id:r}).single();if(i&&(p.error("Cannot get permissions for organization!"),console.error(i),(0,ar.exit)(1)),n.includes("perm")){let a=null;switch(n){case"perm_none":{a=0;break}case"perm_read":{a=1;break}case"perm_upload":{a=2;break}case"perm_write":{a=3;break}case"perm_admin":{a=4;break}case"perm_owner":{a=5;break}default:n.includes("invite")&&(p.info("Please accept/deny the organization invitation before trying to access the app"),(0,ar.exit)(1)),p.error(`Invalid output when fetching organization permission. Response: ${n}`),(0,ar.exit)(1)}return{okay:!0,data:a}}let s=null;switch(n){case"INVALID_APIKEY":{s="INVALID_APIKEY";break}case"NO_APP":{s="NO_APP";break}case"NO_ORG":{s="NO_ORG";break}default:p.error(`Invalid error when fetching organization permission. Response: ${n}`),(0,ar.exit)(1)}return{okay:!1,error:s}}async function ha(t,e,r,n,i=!0){let o=await Qv();await(n?yse(t,n,r):gse(t,e))||(p.error(`You need to upgrade your plan to continue to use capgo.
241
+ `)},info:t=>{p.message(t,{symbol:V.default.blue(VB)})},success:t=>{p.message(t,{symbol:V.default.green(HB)})},step:t=>{p.message(t,{symbol:V.default.green(Kp)})},warn:t=>{p.message(t,{symbol:V.default.yellow(zB)})},warning:t=>{p.warn(t)},error:t=>{p.message(t,{symbol:V.default.red(GB)})}},ve=()=>{let t=zp?["\u25D2","\u25D0","\u25D3","\u25D1"]:["\u2022","o","O","0"],e=zp?80:120,r,n,i=!1,o="",s=(l="")=>{i=!0,r=Iw(),o=l.replace(/\.+$/,""),process.stdout.write(`${V.default.gray(Ye)}
242
+ `);let f=0,h=0;n=setInterval(()=>{let d=V.default.magenta(t[f]),m=".".repeat(Math.floor(h)).slice(0,3);process.stdout.write(No.cursor.move(-999,0)),process.stdout.write(No.erase.down(1)),process.stdout.write(`${d} ${o}${m}`),f=f+1<t.length?f+1:0,h=h<t.length?h+.125:0},e)},a=(l="",f=0)=>{o=l??o,i=!1,clearInterval(n);let h=f===0?V.default.green(Kp):f===1?V.default.red(Bw):V.default.red(qw);process.stdout.write(No.cursor.move(-999,0)),process.stdout.write(No.erase.down(1)),process.stdout.write(`${h} ${o}
243
+ `),r()},u=(l="")=>{o=l??o},c=l=>{let f=l>1?"Something went wrong":"Canceled";i&&a(f,l)};return process.on("uncaughtExceptionMonitor",()=>c(2)),process.on("unhandledRejection",()=>c(2)),process.on("SIGINT",()=>c(1)),process.on("SIGTERM",()=>c(1)),process.on("exit",c),{start:s,stop:a,message:u}};var ot=require("node:fs"),Ah=require("node:os"),rt=le(require("node:path")),ar=require("node:process"),vi=le(dl());var yn=require("fs"),qa=(t=".",e="unknown")=>{let r=`${t}/bun.lockb`,n=`${t}/pnpm-lock.yaml`,i=`${t}/yarn.lock`,o=`${t}/package-lock.json`;return(0,yn.existsSync)(r)?"bun":(0,yn.existsSync)(n)?"pnpm":(0,yn.existsSync)(i)?"yarn":(0,yn.existsSync)(o)?"npm":e},hl=(t=qa(),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"}},Vw=(t=".",e="npx")=>{let r=`${t}/bun.lockb`,n=`${t}/pnpm-lock.yaml`,i=`${t}/yarn.lock`,o=`${t}/package-lock.json`;return(0,yn.existsSync)(r)?"bunx":(0,yn.existsSync)(n)?"pnpm exec":(0,yn.existsSync)(i)?"yarn dlx":(0,yn.existsSync)(o)?"npx":e};var la=le(q_()),K6=le(vu()),Xv=le($C());var ti=class extends Error{response;request;options;constructor(e,r,n){let i=e.status||e.status===0?e.status:"",o=e.statusText||"",s=`${i} ${o}`.trim(),a=s?`status code ${s}`:"an unknown error";super(`Request failed with ${a}: ${r.method} ${r.url}`),this.name="HTTPError",this.response=e,this.request=r,this.options=n}};var os=class extends Error{request;constructor(e){super(`Request timed out: ${e.method} ${e.url}`),this.name="TimeoutError",this.request=e}};var ss=t=>t!==null&&typeof t=="object";var wu=(...t)=>{for(let e of t)if((!ss(e)||Array.isArray(e))&&e!==void 0)throw new TypeError("The `options` argument must be an object");return jg({},...t)},$g=(t={},e={})=>{let r=new globalThis.Headers(t),n=e instanceof globalThis.Headers,i=new globalThis.Headers(e);for(let[o,s]of i.entries())n&&s==="undefined"||s===void 0?r.delete(o):r.set(o,s);return r};function Ql(t,e,r){return Object.hasOwn(e,r)&&e[r]===void 0?[]:jg(t[r]??[],e[r]??[])}var Ig=(t={},e={})=>({beforeRequest:Ql(t,e,"beforeRequest"),beforeRetry:Ql(t,e,"beforeRetry"),afterResponse:Ql(t,e,"afterResponse"),beforeError:Ql(t,e,"beforeError")}),jg=(...t)=>{let e={},r={},n={};for(let i of t)if(Array.isArray(i))Array.isArray(e)||(e=[]),e=[...e,...i];else if(ss(i)){for(let[o,s]of Object.entries(i))ss(s)&&o in e&&(s=jg(e[o],s)),e={...e,[o]:s};ss(i.hooks)&&(n=Ig(n,i.hooks),e.hooks=n),ss(i.headers)&&(r=$g(r,i.headers),e.headers=r)}return e};var IC=(()=>{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})(),jC=typeof globalThis.AbortController=="function",NC=typeof globalThis.ReadableStream=="function",LC=typeof globalThis.FormData=="function",ef=["get","post","put","patch","head","delete"],ZU=()=>{};ZU();var BC={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*"},tf=2147483647,rf=Symbol("stop"),qC={json:!0,parseJson:!0,stringifyJson:!0,searchParams:!0,prefixUrl:!0,retry:!0,timeout:!0,hooks:!0,throwHttpErrors:!0,onDownloadProgress:!0,fetch:!0},MC={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 VC=t=>ef.includes(t)?t.toUpperCase():t,QU=["get","put","head","delete","options","trace"],e9=[408,413,429,500,502,503,504],t9=[413,429,503],UC={limit:2,methods:QU,statusCodes:e9,afterStatusCodes:t9,maxRetryAfter:Number.POSITIVE_INFINITY,backoffLimit:Number.POSITIVE_INFINITY,delay:t=>.3*2**(t-1)*1e3},HC=(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 Ng(t,e,r,n){return new Promise((i,o)=>{let s=setTimeout(()=>{r&&r.abort(),o(new os(t))},n.timeout);n.fetch(t,e).then(i).catch(o).then(()=>{clearTimeout(s)})})}async function Lg(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 zC=(t,e)=>{let r={};for(let n in e)!(n in MC)&&!(n in qC)&&!(n in t)&&(r[n]=e[n]);return r};var _u=class t{static create(e,r){let n=new t(e,r),i=async()=>{if(typeof n._options.timeout=="number"&&n._options.timeout>tf)throw new RangeError(`The \`timeout\` option cannot be greater than ${tf}`);await Promise.resolve();let a=await n._fetch();for(let u of n._options.hooks.afterResponse){let c=await u(n.request,n._options,n._decorateResponse(a.clone()));c instanceof globalThis.Response&&(a=c)}if(n._decorateResponse(a),!a.ok&&n._options.throwHttpErrors){let u=new ti(a,n.request,n._options);for(let c of n._options.hooks.beforeError)u=await c(u);throw u}if(n._options.onDownloadProgress){if(typeof n._options.onDownloadProgress!="function")throw new TypeError("The `onDownloadProgress` option must be a function");if(!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(BC))s[a]=async()=>{n.request.headers.set("accept",n.request.headers.get("accept")||u);let l=(await s).clone();if(a==="json"){if(l.status===204||(await l.clone().arrayBuffer()).byteLength===0)return"";if(r.parseJson)return r.parseJson(await l.text())}return l[a]()};return s}request;abortController;_retryCount=0;_input;_options;constructor(e,r={}){if(this._input=e,this._options={...r,headers:$g(this._input.headers,r.headers),hooks:Ig({beforeRequest:[],beforeRetry:[],beforeError:[],afterResponse:[]},r.hooks),method:VC(r.method??this._input.method),prefixUrl:String(r.prefixUrl||""),retry:HC(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(jC){this.abortController=new globalThis.AbortController;let n=this._options.signal??this._input.signal;n?.addEventListener("abort",()=>{this.abortController.abort(n.reason)}),this._options.signal=this.abortController.signal}if(IC&&(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);(LC&&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 os)throw e;if(e instanceof ti){if(!this._options.retry.statusCodes.includes(e.response.status))throw e;let n=e.response.headers.get("Retry-After")??e.response.headers.get("RateLimit-Reset")??e.response.headers.get("X-RateLimit-Reset")??e.response.headers.get("X-Rate-Limit-Reset");if(n&&this._options.retry.afterStatusCodes.includes(e.response.status)){let i=Number(n)*1e3;Number.isNaN(i)?i=Date.parse(n)-Date.now():i>=Date.parse("2024-01-01")&&(i-=Date.now());let o=this._options.retry.maxRetryAfter??i;return i<o?i:o}if(e.response.status===413)throw e}let r=this._options.retry.delay(this._retryCount);return Math.min(this._options.retry.backoffLimit,r)}_decorateResponse(e){return this._options.parseJson&&(e.json=async()=>this._options.parseJson(await e.text())),e}async _retry(e){try{return await e()}catch(r){let n=Math.min(this._calculateRetryDelay(r),tf);if(this._retryCount<1)throw r;await Lg(n,{signal:this._options.signal});for(let i of this._options.hooks.beforeRetry)if(await i({request:this.request,options:this._options,error:r,retryCount:this._retryCount})===rf)return;return this._retry(e)}}async _fetch(){for(let n of this._options.hooks.beforeRequest){let i=await n(this.request,this._options);if(i instanceof Request){this.request=i;break}if(i instanceof Response)return i}let e=zC(this.request,this._options),r=this.request;return this.request=r.clone(),this._options.timeout===!1?this._options.fetch(r,e):Ng(r,e,this.abortController,this._options)}_stream(e,r){let n=Number(e.headers.get("content-length"))||0,i=0;return e.status===204?(r&&r({percent:1,totalBytes:n,transferredBytes:i},new Uint8Array),new globalThis.Response(null,{status:e.status,statusText:e.statusText,headers:e.headers})):new globalThis.Response(new globalThis.ReadableStream({async start(o){let s=e.body.getReader();r&&r({percent:0,transferredBytes:0,totalBytes:n},new Uint8Array);async function a(){let{done:u,value:c}=await s.read();if(u){o.close();return}if(r){i+=c.byteLength;let l=n===0?0:i/n;r({percent:l,transferredBytes:i,totalBytes:n},c)}o.enqueue(c),await a()}await a()}}),{status:e.status,statusText:e.statusText,headers:e.headers})}};var Bg=t=>{let e=(r,n)=>_u.create(r,wu(t,n));for(let r of ef)e[r]=(n,i)=>_u.create(n,wu(t,i,{method:r}));return e.create=r=>Bg(wu(r)),e.extend=r=>(typeof r=="function"&&(r=r(t??{})),Bg(wu(t,r))),e.stop=rf,e},r9=Bg(),Hr=r9;var Y6=le(_S()),kh=le(eD());var kc=le(c6());async function l6(){let t=await(0,kc.loadConfig)();return{config:t.app.extConfig,path:t.app.extConfigFilePath}}async function on(t,e=!1){let r=await(0,kc.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,kc.writeConfig)(n,r.app.extConfigFilePath))}var tr=".capgo_key",ur=".capgo_key_v2",cr=`${tr}.pub`,jn=`${ur}.pub`;var U6="https://capgo.app",V6="https://files.capgo.app",H6="https://api.capgo.app",z6="https://web.capgo.app",J6=20,X6=12e4,fse="package.json",fa=/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-z-][0-9a-z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-z-][0-9a-z-]*))*))?(?:\+([0-9a-z-]+(?:\.[0-9a-z-]+)*))?$/i,Q=t=>t?`
244
+ ${Y6.default.render(t)}`:"";function G6(t){return new Promise(e=>{setTimeout(e,t)})}function Zv(t){return(0,vi.isMonorepo)(t)?(0,vi.findMonorepoRoot)(t):(0,vi.isNXMonorepo)(t)?(0,vi.findNXMonorepoRoot)(t):t}async function jt(t=Zv((0,ar.cwd)()),e=void 0){e&&((0,ot.existsSync)(e)||(p.error(`Package.json at ${e} does not exist`),(0,ar.exit)(1)));let r=(0,ot.readFileSync)(e||(0,rt.join)(t,fse));return JSON.parse(r)}async function ee(){try{let t=await l6();return t||(p.error("No capacitor config file found, run `cap init` first"),A.error("")),t}catch(t){p.error(`No capacitor config file found, run \`cap init\` first ${Q(t)}`),A.error("")}}async function da(t){let e=await ee();return e?.config&&(e.config.plugins||(e.config.plugins={extConfig:{},CapacitorUpdater:{}}),e.config.plugins.CapacitorUpdater||(e.config.plugins.CapacitorUpdater={}),e.config.plugins.CapacitorUpdater={...e.config.plugins.CapacitorUpdater,...t},on(e)),e}async function Cr(){try{let t=await ee(),e={host:t?.config?.plugins?.CapacitorUpdater?.localHost||U6,hostWeb:t?.config?.plugins?.CapacitorUpdater?.localWebHost||z6,hostFilesApi:t?.config?.plugins?.CapacitorUpdater?.localApiFiles||V6,hostApi:t?.config?.plugins?.CapacitorUpdater?.localApi||H6};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:U6,hostWeb:z6,hostFilesApi:V6,hostApi:H6}}}var dse=/([A-Za-z0-9]+)\.(java|swift|kt|scala)$/;async function Qv(){let t=await Cr();return Hr.get(`${t.hostApi}/private/config`).then(e=>e.json()).then(e=>({...e,...t})).catch(()=>(p.info(`Local config ${Q(t)}`),t))}async function Z6(){let t=await Cr();return Hr.get(`${t.hostFilesApi}/files/config`).then(e=>e.json()).catch(()=>({partialUpload:!1,TUSUpload:!1,partialUploadForced:!1,TUSUploadForced:!1}))}async function de(t){let e=await Qv();return(!e.supaHost||!e.supaKey)&&(p.error("Cannot connect to server please try again later"),A.error("")),(0,la.createClient)(e.supaHost,e.supaKey,{auth:{persistSession:!1},global:{headers:{capgkey:t}}})}async function hse(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.`),A.error("")}}async function pse(t,e){let{data:r}=await t.rpc("is_paying_org",{orgid:e}).single();return r||!1}async function mse(t,e){let{data:r}=await t.rpc("is_trial_org",{orgid:e}).single();return r||0}async function gse(t,e){let{data:r}=await t.rpc("is_allowed_action_org",{orgid:e}).single();return!!r}async function yse(t,e,r){let{data:n}=await t.rpc("is_allowed_action",{apikey:r,appid:e}).single();return!!n}var Ft=(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))(Ft||{}),Q6=(t,e)=>t>=e;async function ej(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,ar.exit)(1)),n.includes("perm")){let a=null;switch(n){case"perm_none":{a=0;break}case"perm_read":{a=1;break}case"perm_upload":{a=2;break}case"perm_write":{a=3;break}case"perm_admin":{a=4;break}case"perm_owner":{a=5;break}default:n.includes("invite")&&(p.info("Please accept/deny the organization invitation before trying to access the app"),(0,ar.exit)(1)),p.error(`Invalid output when fetching organization permission. Response: ${n}`),(0,ar.exit)(1)}return{okay:!0,data:a}}let s=null;switch(n){case"INVALID_APIKEY":{s="INVALID_APIKEY";break}case"NO_APP":{s="NO_APP";break}case"NO_ORG":{s="NO_ORG";break}default:p.error(`Invalid error when fetching organization permission. Response: ${n}`),(0,ar.exit)(1)}return{okay:!1,error:s}}async function ha(t,e,r,n,i=!0){let o=await Qv();await(n?yse(t,n,r):gse(t,e))||(p.error(`You need to upgrade your plan to continue to use capgo.
245
245
  Upgrade here: ${o.hostWeb}/dashboard/settings/plans
246
- `),W6(100),Promise.resolve().then(()=>(U6(),M6)).then(c=>{c.default(`${o.hostWeb}/dashboard/settings/plans`)}),W6(500),A.error(""));let[a,u]=await Promise.all([mse(t,e),pse(t,e)]);a>0&&i&&!u&&p.warn(`WARNING !!
246
+ `),G6(100),Promise.resolve().then(()=>(M6(),q6)).then(c=>{c.default(`${o.hostWeb}/dashboard/settings/plans`)}),G6(500),A.error(""));let[a,u]=await Promise.all([mse(t,e),pse(t,e)]);a>0&&i&&!u&&p.warn(`WARNING !!
247
247
  Trial expires in ${a} days, upgrade here: ${o.hostWeb}/dashboard/settings/plans
248
- `)}function pe(t=!1){let e=(0,Ah.homedir)(),r,n=`${e}/.capgo`;return(0,ot.existsSync)(n)&&(t||p.info(`Use global API key ${n}`),r=(0,ot.readFileSync)(n,"utf8").trim()),n=".capgo",!r&&(0,ot.existsSync)(n)&&(t||p.info(`Use local API key ${n}`),r=(0,ot.readFileSync)(n,"utf8").trim()),r||(p.error(`Cannot find API key in local folder or global, please login first with ${Nt().runner} @capacitor/cli login`),A.error("")),r}async function*eb(t){let e=await(0,ot.readdirSync)(t,{withFileTypes:!0});for(let r of e){let n=(0,rt.resolve)(t,r.name);r.isDirectory()&&!r.name.startsWith(".")&&!r.name.startsWith("node_modules")&&!r.name.startsWith("dist")?yield*eb(n):yield n}}function pa(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 tb(){let t=(0,ar.cwd)(),e=!1,r=(0,rt.resolve)(t,"tsconfig.json");(0,ot.existsSync)(r)&&(e=!0);for await(let n of eb(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,rt.dirname)(n),o=await jt(i);if(o.dependencies){if(o.dependencies.react)return p.info("Found react project test"),e?"react-ts":"react-js";if(o.dependencies.vue)return p.info("Found vue project"),e?"vue-ts":"vue-js"}}}return"unknown"}function rj(t,e){return t==="angular-js"||t==="angular-ts"?e?"src/main.ts":"src/main.js":t==="nextjs-js"||t==="nextjs-ts"?e?"src/app/layout.tsx":"src/app/layout.js":t==="svelte-js"||t==="svelte-ts"||t==="vue-js"||t==="vue-ts"?e?"src/main.ts":"src/main.js":t==="react-js"||t==="react-ts"?e?"src/index.tsx":"src/index.js":null}async function nj(t){return t==="angular"?(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 Te({message:"Do you want to continue?"})||(p.error("Aborted"),A.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 Te({message:"Do you want to continue?"})||(p.error("Aborted"),A.error(""))),"build")}async function ij(){let t=/(main|index)\.(ts|tsx|js|jsx)$/,e="",r=(0,ar.cwd)(),n=r.split("/").length;for await(let i of eb(r))if(i.split("/").length-n<=2&&t.test(i)){e=i,p.info(`Found main file here ${i}`);break}return e}async function rb(t,e){return t.from("app_versions").upsert(e,{onConflict:"name,app_id"}).eq("app_id",e.app_id).eq("name",e.name)}async function oj(t,e,r){let n={app_id:e,name:r,version:0};try{let o=await t.functions.invoke("private/upload_link",{body:JSON.stringify(n)});if(o.error){if(o.error instanceof la.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*sj(t){let e=(0,ot.readdirSync)(t,{withFileTypes:!0});for(let r of e){let n=(0,rt.join)(t,r.name);r.isDirectory()?yield*sj(n):yield n}}async function aj(t){let e=[];for await(let r of sj(t)){let n=(0,ot.readFileSync)(r),i=await(0,Y6.checksum)(n,"sha256"),o=(0,rt.relative)(t,r);o.startsWith("/")&&(o=o.substring(1)),e.push({file:o,hash:i})}return e}async function Th(t){return(0,Ah.platform)()==="win32"?vse(t):Dse(t)}function Dse(t){let e=new Xv.default;return e.addLocalFolder(t),e.toBuffer()}async function vse(t){p.info("Zipping file windows mode");let e=new Xv.default,r=(n,i)=>{let o=(0,ot.readdirSync)(n);for(let s of o){let a=(0,rt.join)(n,s),u=(0,ot.statSync)(a);if(u.isFile()){let c=(0,ot.readFileSync)(a);e.addFile((0,rt.join)(i,s).split(rt.sep).join("/"),c)}else u.isDirectory()&&r(a,(0,rt.join)(i,s))}};return r(t,""),e.toBuffer()}async function nb(t,e,r,n,i,o,s){return new Promise((a,u)=>{xe(t,{channel:"app",event:"App TUS upload",icon:"\u23EB",user_id:r,tags:{"app-id":n},notify:!1}),new kh.Upload(e,{endpoint:`${s.hostFilesApi}/files/upload/attachments/`,metadataForPartialUploads:{filename:`orgs/${r}/apps/${n}/${i}.zip`,filetype:"application/gzip"},metadata:{filename:`orgs/${r}/apps/${n}/${i}.zip`,filetype:"application/zip"},headers:{Authorization:t},onError(l){if(l instanceof kh.DetailedError){let f=l.originalResponse?.getBody(),h=JSON.parse(f||'{"error": "unknown error"}');u(h.status||h.error||h.message||"unknown error")}else u(l.message||l.toString()||"unknown error")},onProgress(l,f){let h=(l/f*100).toFixed(2);o.message(`Uploaded ${h}%`)},async onSuccess(){await xe(t,{channel:"app",event:"App TUS done",icon:"\u23EB",user_id:r,tags:{"app-id":n},notify:!1}).catch(),a(!0)}}).start()})}async function uj(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 la.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 la.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 Ph(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("enable_progressive_deploy, secondary_version_percentage, second_version").eq("app_id",e.app_id).eq("name",e.name).single();if(r&&!n){if(r.enable_progressive_deploy){if(p.info("Progressive deploy is enabled"),r.secondary_version_percentage!==1&&p.warn("Latest progressive deploy has not finished"),e.second_version=e.version,!r.second_version)return p.error("missing secondVersion"),Promise.reject(new Error("missing secondVersion"));e.version=r.second_version,e.secondary_version_percentage=.1,p.info("Started new progressive upload!")}return t.from("channels").update(e).eq("app_id",e.app_id).eq("name",e.name).select().single()}return t.from("channels").insert(e).select().single()}async function xe(t,e){try{let r=await Qv(),n=await Hr.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 ma(t,e){let{error:r,data:n}=await t.rpc("get_orgs_v5");r&&(p.error("Cannot get the list of organizations - exiting"),p.error(`Error ${JSON.stringify(r)}`),A.error(""));let i=n.filter(u=>!!e.find(c=>c===u.role));i.length===0&&(p.error(`Could not get organization with roles: ${e.join(" or ")} because the user does not have any org`),A.error(""));let o=i.length>1?await Bo({message:"Please pick the organization that you want to insert to",options:i.map(u=>({value:u.gid,label:u.name}))}):i[0].gid;qt(o)&&(p.error("Canceled organization selection, exiting"),A.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 wo=t=>t.replace(/\./g,"--");async function me(t,e,r=["all"]){await hse(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"),A.error("")),o}async function Sr(t,e){let{data:r,error:n}=await t.from("apps").select("owner_org").eq("app_id",e).single();return(!r||n)&&(p.error(`Cannot get organization id for app id ${e}`),Q(n),A.error("")),r.owner_org}function ga(t){return new Date(t||"").toLocaleString()}var K6=!1,ca="npm",$c="install",Jv="npx";function Nt(){if(K6)return{pm:ca,command:$c,installCommand:`${ca} ${$c}`,runner:Jv};let t=Zv((0,ar.cwd)());return ca=qa(t,"npm"),$c=hl(ca),K6=!0,Jv=Hw(t),{pm:ca,command:$c,installCommand:`${ca} ${$c}`,runner:Jv}}function cj(t){return(0,ot.readdirSync)(t,{withFileTypes:!0}).flatMap(n=>{let i=(0,rt.join)(t,n.name);return n.isDirectory()?cj(i):i.split(`node_modules${rt.sep}`)[1]||i})}async function ib(t){let e;try{e=await jt("",t)}catch(a){p.error("Invalid package.json, JSON parsing failed"),console.error("json parse error: ",a),A.error("")}let r=t?rt.default.resolve(t).replace("package.json",""):Zv((0,ar.cwd)()),{dependencies:n}=e;n||(p.error("Missing dependencies section in package.json"),A.error(""));for(let[a,u]of Object.entries(n))typeof u!="string"&&(p.error(`Invalid dependency ${a}: ${u}, expected string, got ${typeof u}`),A.error(""));let i=(0,rt.join)((0,ar.cwd)(),"node_modules");if(!(0,ot.existsSync)(i)){let a=qa(r,"npm"),u=hl(a);p.error(`Missing node_modules folder, please run ${a} ${u}`),A.error("")}let o=!1,s=await Promise.all(Object.entries(n).map(async([a,u])=>{let c=(0,rt.join)(i,a);if(!(0,ot.existsSync)(c)){o=!0;let h=qa(r,"npm"),d=hl(h);return p.error(`Missing dependency ${a}, please run ${h} ${d}`),{name:a,version:u}}let f=!1;try{f=cj(c).some(d=>dse.test(d))}catch(h){p.error(`Error reading node_modules files for ${a} package`),console.error(h),A.error("")}return{name:a,version:u,native:f}})).catch(()=>[]);return(o||s.find(a=>a.native===void 0))&&A.error(""),s}async function bse(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 wse(t,e,r){let{data:n,error:i}=await t.from("channels").select(`version (
248
+ `)}function pe(t=!1){let e=(0,Ah.homedir)(),r,n=`${e}/.capgo`;return(0,ot.existsSync)(n)&&(t||p.info(`Use global API key ${n}`),r=(0,ot.readFileSync)(n,"utf8").trim()),n=".capgo",!r&&(0,ot.existsSync)(n)&&(t||p.info(`Use local API key ${n}`),r=(0,ot.readFileSync)(n,"utf8").trim()),r||(p.error(`Cannot find API key in local folder or global, please login first with ${Nt().runner} @capacitor/cli login`),A.error("")),r}async function*eb(t){let e=await(0,ot.readdirSync)(t,{withFileTypes:!0});for(let r of e){let n=(0,rt.resolve)(t,r.name);r.isDirectory()&&!r.name.startsWith(".")&&!r.name.startsWith("node_modules")&&!r.name.startsWith("dist")?yield*eb(n):yield n}}function pa(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 tb(){let t=(0,ar.cwd)(),e=!1,r=(0,rt.resolve)(t,"tsconfig.json");(0,ot.existsSync)(r)&&(e=!0);for await(let n of eb(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,rt.dirname)(n),o=await jt(i);if(o.dependencies){if(o.dependencies.react)return p.info("Found react project test"),e?"react-ts":"react-js";if(o.dependencies.vue)return p.info("Found vue project"),e?"vue-ts":"vue-js"}}}return"unknown"}function tj(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 rj(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 Te({message:"Do you want to continue?"})||(p.error("Aborted"),A.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 Te({message:"Do you want to continue?"})||(p.error("Aborted"),A.error(""))),"build")}async function nj(){let t=/(main|index)\.(ts|tsx|js|jsx)$/,e="",r=(0,ar.cwd)(),n=r.split("/").length;for await(let i of eb(r))if(i.split("/").length-n<=2&&t.test(i)){e=i,p.info(`Found main file here ${i}`);break}return e}async function rb(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 ij(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 la.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*oj(t){let e=(0,ot.readdirSync)(t,{withFileTypes:!0});for(let r of e){let n=(0,rt.join)(t,r.name);r.isDirectory()?yield*oj(n):yield n}}async function sj(t){let e=[];for await(let r of oj(t)){let n=(0,ot.readFileSync)(r),i=await(0,K6.checksum)(n,"sha256"),o=(0,rt.relative)(t,r);o.startsWith("/")&&(o=o.substring(1)),e.push({file:o,hash:i})}return e}async function Th(t){return(0,Ah.platform)()==="win32"?vse(t):Dse(t)}function Dse(t){let e=new Xv.default;return e.addLocalFolder(t),e.toBuffer()}async function vse(t){p.info("Zipping file windows mode");let e=new Xv.default,r=(n,i)=>{let o=(0,ot.readdirSync)(n);for(let s of o){let a=(0,rt.join)(n,s),u=(0,ot.statSync)(a);if(u.isFile()){let c=(0,ot.readFileSync)(a);e.addFile((0,rt.join)(i,s).split(rt.sep).join("/"),c)}else u.isDirectory()&&r(a,(0,rt.join)(i,s))}};return r(t,""),e.toBuffer()}async function aj(t,e,r,n,i,o,s){return new Promise((a,u)=>{xe(t,{channel:"app",event:"App TUS upload",icon:"\u23EB",user_id:r,tags:{"app-id":n},notify:!1}),new kh.Upload(e,{endpoint:`${s.hostFilesApi}/files/upload/attachments/`,metadataForPartialUploads:{filename:`orgs/${r}/apps/${n}/${i}.zip`,filetype:"application/gzip"},metadata:{filename:`orgs/${r}/apps/${n}/${i}.zip`,filetype:"application/zip"},headers:{Authorization:t},onError(l){if(l instanceof kh.DetailedError){let f=l.originalResponse?.getBody(),h=JSON.parse(f||'{"error": "unknown error"}');u(h.status||h.error||h.message||"unknown error")}else u(l.message||l.toString()||"unknown error")},onProgress(l,f){let h=(l/f*100).toFixed(2);o.message(`Uploaded ${h}%`)},async onSuccess(){await xe(t,{channel:"app",event:"App TUS done",icon:"\u23EB",user_id:r,tags:{"app-id":n},notify:!1}).catch(),a(!0)}}).start()})}async function uj(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 la.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 la.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 Ph(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("enable_progressive_deploy, secondary_version_percentage, second_version").eq("app_id",e.app_id).eq("name",e.name).single();if(r&&!n){if(r.enable_progressive_deploy){if(p.info("Progressive deploy is enabled"),r.secondary_version_percentage!==1&&p.warn("Latest progressive deploy has not finished"),e.second_version=e.version,!r.second_version)return p.error("missing secondVersion"),Promise.reject(new Error("missing secondVersion"));e.version=r.second_version,e.secondary_version_percentage=.1,p.info("Started new progressive upload!")}return t.from("channels").update(e).eq("app_id",e.app_id).eq("name",e.name).select().single()}return t.from("channels").insert(e).select().single()}async function xe(t,e){try{let r=await Qv(),n=await Hr.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 ma(t,e){let{error:r,data:n}=await t.rpc("get_orgs_v5");r&&(p.error("Cannot get the list of organizations - exiting"),p.error(`Error ${JSON.stringify(r)}`),A.error(""));let i=n.filter(u=>!!e.find(c=>c===u.role));i.length===0&&(p.error(`Could not get organization with roles: ${e.join(" or ")} because the user does not have any org`),A.error(""));let o=i.length>1?await Bo({message:"Please pick the organization that you want to insert to",options:i.map(u=>({value:u.gid,label:u.name}))}):i[0].gid;qt(o)&&(p.error("Canceled organization selection, exiting"),A.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 wo=t=>t.replace(/\./g,"--");async function me(t,e,r=["all"]){await hse(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"),A.error("")),o}async function Sr(t,e){let{data:r,error:n}=await t.from("apps").select("owner_org").eq("app_id",e).single();return(!r||n)&&(p.error(`Cannot get organization id for app id ${e}`),Q(n),A.error("")),r.owner_org}function ga(t){return new Date(t||"").toLocaleString()}var W6=!1,ca="npm",$c="install",Jv="npx";function Nt(){if(W6)return{pm:ca,command:$c,installCommand:`${ca} ${$c}`,runner:Jv};let t=Zv((0,ar.cwd)());return ca=qa(t,"npm"),$c=hl(ca),W6=!0,Jv=Vw(t),{pm:ca,command:$c,installCommand:`${ca} ${$c}`,runner:Jv}}function cj(t){return(0,ot.readdirSync)(t,{withFileTypes:!0}).flatMap(n=>{let i=(0,rt.join)(t,n.name);return n.isDirectory()?cj(i):i.split(`node_modules${rt.sep}`)[1]||i})}async function nb(t){let e;try{e=await jt("",t)}catch(a){p.error("Invalid package.json, JSON parsing failed"),console.error("json parse error: ",a),A.error("")}let r=t?rt.default.resolve(t).replace("package.json",""):Zv((0,ar.cwd)()),{dependencies:n}=e;n||(p.error("Missing dependencies section in package.json"),A.error(""));for(let[a,u]of Object.entries(n))typeof u!="string"&&(p.error(`Invalid dependency ${a}: ${u}, expected string, got ${typeof u}`),A.error(""));let i=(0,rt.join)((0,ar.cwd)(),"node_modules");if(!(0,ot.existsSync)(i)){let a=qa(r,"npm"),u=hl(a);p.error(`Missing node_modules folder, please run ${a} ${u}`),A.error("")}let o=!1,s=await Promise.all(Object.entries(n).map(async([a,u])=>{let c=(0,rt.join)(i,a);if(!(0,ot.existsSync)(c)){o=!0;let h=qa(r,"npm"),d=hl(h);return p.error(`Missing dependency ${a}, please run ${h} ${d}`),{name:a,version:u}}let f=!1;try{f=cj(c).some(d=>dse.test(d))}catch(h){p.error(`Error reading node_modules files for ${a} package`),console.error(h),A.error("")}return{name:a,version:u,native:f}})).catch(()=>[]);return(o||s.find(a=>a.native===void 0))&&A.error(""),s}async function bse(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 wse(t,e,r){let{data:n,error:i}=await t.from("channels").select(`version (
249
249
  native_packages
250
250
  )`).eq("name",r).eq("app_id",e).single();i&&(p.error(`Error fetching native packages: ${i.message}`),A.error(""));let o;try{o=n.version.native_packages}catch{p.error("Error parsing native packages"),A.error("")}return o||(p.error("Error parsing native packages, perhaps the metadata does not exist?"),A.error("")),o.forEach(a=>{typeof a!="object"&&(p.error(`Invalid remote native package data: ${a}, expected object, got ${typeof a}`),A.error(""));let{name:u,version:c}=a;(!u||typeof u!="string")&&(p.error(`Invalid remote native package name: ${u}, expected string, got ${typeof u}`),A.error("")),(!c||typeof c!="string")&&(p.error(`Invalid remote native package version: ${c}, expected string, got ${typeof c}`),A.error(""))}),new Map(o.map(a=>[a.name,a]))}async function lj(t,e,r,n){let i=ve();i.start(`Checking bundle checksum compatibility with channel ${r}`);let o=await bse(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.
251
251
  Current bundle checksum matches remote bundle for channel ${r}
252
252
  Did you builded your app before uploading?
253
- PS: You can ignore this check with "--ignore-checksum-check"`),A.error("")),i.stop(`Checksum compatible with ${r} channel`)}async function Rh(t,e,r,n){let i=await ib(n),o=await wse(t,e,r),s=i.filter(u=>!!u.native).map(u=>{let c=o.get(u.name);return c?{name:u.name,localVersion:u.version,remoteVersion:c.version}:{name:u.name,localVersion:u.version,remoteVersion:void 0}}),a=[...o].filter(([u])=>i.find(c=>c.name===u)===void 0).map(([u,c])=>({name:u,localVersion:void 0,remoteVersion:c.version}));return s.push(...a),{finalCompatibility:s,localDependencies:i}}async function fj(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=Nt(),o=await tj(t,e,r);if(!o.okay)switch(o.error){case"INVALID_APIKEY":{p.error("Invalid apikey, such apikey does not exists!"),A.error("");break}case"NO_APP":{p.error(`App ${r} does not exist, run first \`${i.runner} @capgo/cli app add ${r}\` to create it`),A.error("");break}case"NO_ORG":{p.error("Could not find organization, please contact support to resolve this!"),A.error("");break}}let s=o.data;return n>s&&(p.error(`Insuficcent permissions for app ${r}. Current permission: ${Ft[o.data]}, required for this action: ${Ft[n]}.`),A.error("")),o.data}var xr="assets/icon.png";var Ij=le($j(),1);function ub(t){let e=(0,Ij.default)("npm",{registry:"https://registry.npmjs.org/"}),r=e[`${t}:registry`]||e.config_registry||e.registry;return r.slice(-1)==="/"?r:`${r}/`}var I8=le($8(),1),j8=le(Av(),1),wb=class extends Error{constructor(e){super(`Package \`${e}\` could not be found`),this.name="PackageNotFoundError"}},_b=class extends Error{constructor(e,r){super(`Version \`${r}\` for package \`${e}\` could not be found`),this.name="VersionNotFoundError"}};async function Eb(t,e={}){let{version:r="latest"}=e,{omitDeprecated:n=!0}=e,i=t.split("/")[0],o=e.registryUrl??ub(i),s=new URL(encodeURIComponent(t).replace(/^%40/,"@"),o),a=(0,I8.default)(o.toString(),{recursive:!0}),u={accept:"application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*"};e.fullMetadata&&delete u.accept,a&&(u.authorization=`${a.type} ${a.token}`);let c;try{c=await Hr(s,{headers:u,keepalive:!0}).json()}catch(f){throw f?.response?.status===404?new wb(t):f}if(e.allVersions)return c;let l=new _b(t,r);if(c["dist-tags"][r]){let{time:f}=c;c=c.versions[c["dist-tags"][r]],c.time=f}else if(r){let f=!!c.versions[r];if(n&&!f)for(let[d,m]of Object.entries(c.versions))m.deprecated&&delete c.versions[d];if(!f){let d=Object.keys(c.versions);if(r=j8.default.maxSatisfying(d,r),!r)throw l}let{time:h}=c;if(c=c.versions[r],c.time=h,!c)throw l}return c}async function Bc(t,e){let{version:r}=await Eb(t.toLowerCase(),e);return r}async function ye(){let t=await Bc("@capgo/cli").catch(()=>""),e=t?.split(".")[0];t!==Ir.version&&p.warning(`\u{1F6A8} You are using @capgo/cli@${Ir.version} it's not the latest version.
254
- Please use @capgo/cli@${t}" or @capgo/cli@${e} to keep up to date with the latest features and bug fixes.`)}async function Sae(t,e,r=!0){await Cb(t,e,void 0,r)}async function Cb(t,e,r,n=!0){n&&Y("Adding"),await ye(),e.apikey=e.apikey||pe();let i=await ee();t=t||i?.config?.appId,e.apikey||(p.error("Missing API key, you need to provide a API key to upload your bundle"),A.error("")),t||(p.error("Missing argument, you need to provide a appId, or be in a capacitor project"),A.error("")),t.includes("--")&&(p.error('The app id includes illegal symbols. You cannot use "--" in the app id'),A.error(""));let o=await de(e.apikey);await me(o,e.apikey,["write","all"]),await fj(o,t)&&(p.error(`App ${t} already exist`),A.error("")),r||(r=await ma(o,["admin","super_admin"]));let a=r.gid;await ha(o,a,e.apikey,void 0,!1);let{name:u,icon:c}=e;u=u||i.config?.appName||"Unknown",c=c||"resources/icon.png",(!c||!u)&&(p.error("Missing argument, you need to provide a appId and a name, or be in a capacitor project"),A.error("")),n&&p.info(`Adding ${t} to Capgo`);let l=null,f=null;c&&(0,Ca.existsSync)(c)?(l=(0,Ca.readFileSync)(c),f=pa(c)||"image/png",p.warn(`Found app icon ${c}`)):(0,Ca.existsSync)(xr)?(l=(0,Ca.readFileSync)(xr),f=pa(xr)||"image/png",p.warn(`Found app icon ${xr}`)):p.warn(`Cannot find app icon in any of the following locations: ${c}, ${xr}`);let h="icon",d="https://xvwzpoazmxkqosrdewyv.supabase.co/storage/v1/object/public/images/capgo.png";if(l&&f){let{error:g}=await o.storage.from(`images/org/${a}/${t}`).upload(h,l,{contentType:f});g&&(console.error(g),p.error(`Could not add app ${Q(g)}`),A.error(""));let{data:w}=await o.storage.from(`images/org/${a}/${t}`).getPublicUrl(h);d=w?.publicUrl||d}let{error: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)}`),A.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)}`),A.error("")),p.success(`App ${t} added to Capgo. ${n?"You can upload a bundle now":""}`),n&&(X("Done \u2705"),(0,N8.exit)()),!0}async function L8(t,e){Sae(t,e,!0)}var B8=require("node:process");async function q8(t,e){Y("Deleting"),e.apikey=e.apikey||pe();let r=await ee();t=t||r?.config?.appId,e.apikey||(p.error("Missing API key, you need to provide a API key to upload your bundle"),A.error("")),t||(p.error("Missing argument, you need to provide a appId, or be in a capacitor project"),A.error(""));let n=await de(e.apikey),i=await me(n,e.apikey,["write","all"]);await 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 Bo({message:"Do you want to continue?",options:[{label:"Yes",value:"yes"},{label:"No",value:"no"}]});(qt(h)||h==="no")&&(p.error("Canceled deleting the app, exiting"),A.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:c}=await n.storage.from(`apps/${t}/${i}`).remove(["versions"]);c&&p.error("Could not delete app version");let{error:l}=await n.from("apps").delete().eq("app_id",t);l&&(p.error("Could not delete app"),A.error(""));let f=await Sr(n,t);await xe(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"),X("Done \u2705"),(0,B8.exit)()}var Wh=require("node:os"),Sa=require("node:process");async function xae(t){let e={},r=[];for(let n in t)Object.prototype.hasOwnProperty.call(t,n)&&r.push(Bc(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 Fae(){let{dependencies:t}=await jt(),e={"@capgo/cli":Ir.version};for(let r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&r.startsWith("@capgo/")&&r.startsWith("@capawesome/")&&r.startsWith("capacitor")){let n=t[r].replace("^","").replace("~","");e[r]=n}return e}async function M8(t){p.warn(" \u{1F48A} Capgo Doctor \u{1F48A}");let e=await ee(),r=await jt("",t.packageJson),n=e?.config?.plugins?.CapacitorUpdater?.version||r?.version,i=e?.config?.appName||"";p.info(` App Name: ${i}`);let o=e?.config?.appId||"";p.info(` App ID: ${o}`),p.info(` App Version: ${n}`);let s=e?.config?.webDir||"";p.info(` Web Dir: ${s}`),p.info(` OS: ${(0,Wh.platform)()} ${(0,Wh.version)()}`),p.info(` Node: ${Sa.version}`),p.info(" Installed Dependencies:");let a=await Fae();Object.keys(a).length===0&&(p.warning("\x1B[31m%s\x1B[0m \u{1F6A8} No dependencies found"),(0,Sa.exit)(1));for(let l in a)if(Object.prototype.hasOwnProperty.call(a,l)){let f=a[l];p.info(` ${l}: ${f}`)}let u=ve();u.start("Running: Loading latest dependencies");let c=await xae(a);u.stop("Latest Dependencies:");for(let l in c)if(Object.prototype.hasOwnProperty.call(c,l)){let f=c[l];p.info(` ${l}: ${f}`)}JSON.stringify(a)!==JSON.stringify(c)&&(p.warn("\x1B[31m\u{1F6A8} Some dependencies are not up to date\x1B[0m"),(0,Sa.exit)(1)),p.success("\x1B[32m\u2705 All dependencies are up to date\x1B[0m"),(0,Sa.exit)()}var Sb=require("node:process");function U8(t,e){let n=["normal","bold","dim","italic","underline","strikethrough"].indexOf(t),i="\x1B[";return i+n+"m"+e+i+"0m"}var lr=class t{title=null;headers=[];rows=[];static narrowTheme={top:["\u2554","\u2550","\u2564","\u2557"],row:["\u2551"," ","\u2502","\u2551"],div:["\u255F","\u2500","\u253C","\u2562"],bot:["\u255A","\u2550","\u2567","\u255D"]};static wideTheme={top:["\u2554\u2550","\u2550","\u2550\u2564\u2550","\u2550\u2557"],row:["\u2551 "," "," \u2502 "," \u2551"],div:["\u255F\u2500","\u2500","\u2500\u253C\u2500","\u2500\u2562"],bot:["\u255A\u2550","\u2550","\u2550\u2567\u2550","\u2550\u255D"]};static roundTheme={top:["\u256D\u2500","\u2500","\u2500\u252C\u2500","\u2500\u256E"],row:["\u2502 "," "," \u2502 "," \u2502"],div:["\u251C\u2500","\u2500","\u2500\u253C\u2500","\u2500\u2524"],bot:["\u2570\u2500","\u2500","\u2500\u2534\u2500","\u2500\u256F"]};theme=t.wideTheme;columnWidth(){let e=[this.headers,...this.rows].filter(n=>n.length>0),r=e[0].map(n=>this.cast(n).length);for(let n of e.slice(1))for(let i=0;i<r.length;i++){let o=this.cast(n[i]).length;o>r[i]&&(r[i]=o)}return r}cast(e){return typeof e=="object"?"obj":e!==void 0&&typeof e.toString=="function"?e.toString():""}renderTitle(){return"[ "+this.title+" ]"}renderLine(e){let r=this.columnWidth();return e[0]+r.map(n=>e[1].repeat(n)).join(e[2])+e[3]}renderCell(e,r,n=!1){let i=this.cast(e),o=n?U8("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))+U8("italic",i)+a.repeat(Math.floor(s/2));default:return a.repeat(s)}}renderRow(e,r=!1){let n=this.theme.row,i=this.columnWidth();return n[0]+e.map((o,s)=>this.renderCell(o,i[s],r)).join(n[2])+n[3]}toString(){let e=this.theme,r=this.headers.length>0,n=this.rows.length>0;return[this.title?this.renderTitle():"",r||n?this.renderLine(e.top):"",r?this.renderRow(this.headers,!0):"",r&&n?this.renderLine(e.div):"",...this.rows.map(i=>this.renderRow(i)),r||n?this.renderLine(e.bot):""].filter(i=>i.length>0).join(`
255
- `)}};function Oae(t){t.length||(p.error("No apps found"),(0,Sb.exit)(1));let e=new lr;e.headers=["Name","id","Created"],e.rows=[],t.reverse().forEach(r=>{e.rows.push([r.name??"",r.app_id,ga(r.created_at)])}),p.success("Apps"),p.success(e.toString())}async function Aae(t){let{data:e,error:r}=await t.from("apps").select().order("created_at",{ascending:!1});return r&&(p.error("Apps not found"),A.error("")),e}async function V8(t){Y("List apps in Capgo"),await ye(),t.apikey=t.apikey||pe();let e=await de(t.apikey);await me(e,t.apikey,["write","all","read","upload"]),p.info("Getting active bundle in Capgo");let r=await Aae(e);p.info(`Active app in Capgo: ${r?.length}`),Oae(r),X("Done \u2705"),(0,Sb.exit)()}var H8=require("node:crypto"),xa=require("node:fs"),z8=require("node:process");async function G8(t,e){Y("Set app"),e.apikey=e.apikey||pe();let r=await ee();t=t||r?.config?.appId,e.apikey||(p.error("Missing API key, you need to provide a API key to upload your bundle"),A.error("")),t||(p.error("Missing argument, you need to provide a appId, or be in a capacitor project"),A.error(""));let n=await de(e.apikey),o=(await ma(n,["admin","super_admin"])).gid,s=await me(n,e.apikey,["write","all"]);await qe(n,e.apikey,t,4);let{name:a,icon:u,retention:c}=e;c&&Number.isNaN(Number(c))?(p.error("retention value must be a number"),A.error("")):c&&c<0&&(p.error("retention value cannot be less than 0"),A.error(""));let l,f,h=`icon_${(0,H8.randomUUID)()}`,d="https://xvwzpoazmxkqosrdewyv.supabase.co/storage/v1/object/public/images/capgo.png";if(u&&(0,xa.existsSync)(u)?(l=(0,xa.readFileSync)(u),f=pa(u)||"image/png",p.warn(`Found app icon ${u}`)):(0,xa.existsSync)(xr)?(l=(0,xa.readFileSync)(xr),f=pa(xr)||"image/png",p.warn(`Found app icon ${xr}`)):p.warn(`Cannot find app icon in any of the following locations: ${u}, ${xr}`),l&&f){let{error:b}=await n.storage.from(`images/org/${o}/${t}`).upload(h,l,{contentType:f});b&&(p.error(`Could not set app ${Q(b)}`),A.error(""));let{data:g}=await n.storage.from(`images/org/${o}/${t}`).getPublicUrl(h);d=g?.publicUrl||d}let{error:m}=await n.from("apps").update({icon_url:d,name:a,retention:c?c*24*60*60:void 0}).eq("app_id",t).eq("user_id",s);m&&(p.error(`Could not set app ${Q(m)}`),A.error("")),X("Done \u2705"),(0,z8.exit)()}var Fa=require("node:process");async function W8(t,e){Y("Set a specific setting in capacitor config"),e.bool&&e.string&&(p.error("Bool and string CANNOT be set at the same time"),(0,Fa.exit)(1)),!e.bool&&!e.string&&(p.error("You MUST provide either bool or string as the value"),(0,Fa.exit)(1)),e.bool&&e.bool!=="true"&&e.bool!=="false"&&(p.error("Invalid bool"),(0,Fa.exit)(1));try{let r=await ee(),n=r.config,i=t.split(".");i.length===0&&(p.error("Invalid path"),(0,Fa.exit)(1));for(let s of i.slice(0,-1))Object.prototype.hasOwnProperty.call(n,s)||(n[s]={}),n=n[s];let o=e.bool?e.bool==="true":e.string;n[i.at(-1)]=o,await on(r,!0),p.success(`Set "${t}" to "${o}"`)}catch(r){p.error(`Cannot set config in capacitor settings ${Q(r)}`),(0,Fa.exit)(1)}X("Done \u2705")}var Ib=require("node:process");function Kh(t,e){if(isNaN(t)||isNaN(e))throw new Error("Cannot compare against non-numbers");return t===e?0:t<e?-1:1}function J8(t=[],e=[]){return t.length&&!e.length?-1:!t.length&&e.length?1:0}function Fb(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 Oa="0|[1-9]\\d*",kae="\\d*[a-zA-Z-][a-zA-Z0-9-]*",Tae=`(?<major>${Oa})\\.(?<minor>${Oa})\\.(?<patch>${Oa})`,K8=`(?:${Oa}|${kae})`,X8=`(?:-(?<prerelease>${K8}(?:\\.${K8})*))`,Y8="[0-9A-Za-z-]+",Z8=`(?:\\+(?<buildmetadata>${Y8}(?:\\.${Y8})*))`,Q8=`v?${Tae}${X8}?${Z8}?`,eN=new RegExp(`^${Q8}$`),tN="(?:<|>)?=?",Pae="x|X|\\*",xb=`${Oa}|${Pae}`,rN=`[v=\\s]*(?<major>${xb})(?:\\.(?<minor>${xb})(?:\\.(?<patch>${xb})${X8}?${Z8}?)?)?`,Rae=new RegExp(`^(?<operator>~>?|\\^|${tN})\\s*${rN}$`),$ae=new RegExp(`^(?<operator>${tN})\\s*(${Q8})$|^$`);function Ob(t){return typeof t=="number"&&!Number.isNaN(t)&&(!Number.isFinite(t)||0<=t&&t<=Number.MAX_SAFE_INTEGER)}var Ab=256;var Iae=new RegExp(`^${Oa}$`);function kb(t){return t.split(".").filter(Boolean).map(e=>{if(Iae.test(e)){let r=Number(e);if(Ob(r))return r}return e})}function qc(t){return t.split(".").filter(Boolean)}function Mc(t,e){let r=Number(t);if(!Ob(r))throw new TypeError(e);return r}function Fr(t,e){return t===e?0:Kh(t.major,e.major)||Kh(t.minor,e.minor)||Kh(t.patch,e.patch)||J8(t.prerelease,e.prerelease)||Fb(t.prerelease,e.prerelease)}function Tb(t){return t.toFixed(0)}function Aa(t){let e=Tb(t.major),r=Tb(t.minor),n=Tb(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 jae(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 Uc(t=[],e){let r=jae(t);return e&&(r[0]!==e||isNaN(r[1]))&&(r=[e,0]),r}function iN(t,e,r={}){let n=r.build!==void 0?qc(r.build):t.build??[];switch(e){case"premajor":return{major:t.major+1,minor:0,patch:0,prerelease:Uc(t.prerelease,r.prerelease),build:n};case"preminor":return{major:t.major,minor:t.minor+1,patch:0,prerelease:Uc(t.prerelease,r.prerelease),build:n};case"prepatch":return{major:t.major,minor:t.minor,patch:t.patch+1,prerelease:Uc(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:Uc(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:Uc(t.prerelease,r.prerelease),build:n};default:throw new TypeError(`Cannot increment version: invalid argument ${e}`)}}var Pb={major:Number.NaN,minor:Number.NaN,patch:Number.NaN,prerelease:[],build:[]},oN={operator:void 0,...Pb};function Rb(t,e){return Fr(t,e)>0}function ka(t,e){return Fr(t,e)<0}function Bn(t){if(typeof t!="string")throw new TypeError(`Cannot parse version as version must be a string: received ${typeof t}`);if(t.length>Ab)throw new TypeError(`Cannot parse version as version length is too long: length is ${t.length}, max length is ${Ab}`);t=t.trim();let e=t.match(eN)?.groups;if(!e)throw new TypeError(`Cannot parse version: ${t}`);let r=Mc(e.major,`Cannot parse version ${t}: invalid major version`),n=Mc(e.minor,`Cannot parse version ${t}: invalid minor version`),i=Mc(e.patch,`Cannot parse version ${t}: invalid patch version`),o=e.prerelease?kb(e.prerelease):[],s=e.buildmetadata?qc(e.buildmetadata):[];return{major:r,minor:n,patch:i,prerelease:o,build:s}}var mN=require("node:process");var aN=require("node:process");async function uN(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}`),A.error("")),n&&n.length>0){if(Y(`\u274C Version ${e}@${r.name} is used in ${n.length} channel`),await Te({message:"unlink it?"}))for(let o of n){let s=ve();s.start(`Unlinking channel ${o.name}`);let{error:a}=await t.from("channels").update({version:(await $b(t,e))?.id}).eq("id",o.id);a&&(s.stop(`Cannot update channel ${o.name} ${Q(a)}`),(0,aN.exit)(1)),s.stop(`\u2705 Channel ${o.name} unlinked`)}else p.error("Unlink it first"),A.error("");X(`Version unlinked from ${n.length} channel`)}}function $b(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.
253
+ PS: You can ignore this check with "--ignore-checksum-check"`),A.error("")),i.stop(`Checksum compatible with ${r} channel`)}async function Rh(t,e,r,n){let i=await nb(n),o=await wse(t,e,r),s=i.filter(u=>!!u.native).map(u=>{let c=o.get(u.name);return c?{name:u.name,localVersion:u.version,remoteVersion:c.version}:{name:u.name,localVersion:u.version,remoteVersion:void 0}}),a=[...o].filter(([u])=>i.find(c=>c.name===u)===void 0).map(([u,c])=>({name:u,localVersion:void 0,remoteVersion:c.version}));return s.push(...a),{finalCompatibility:s,localDependencies:i}}async function fj(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=Nt(),o=await ej(t,e,r);if(!o.okay)switch(o.error){case"INVALID_APIKEY":{p.error("Invalid apikey, such apikey does not exists!"),A.error("");break}case"NO_APP":{p.error(`App ${r} does not exist, run first \`${i.runner} @capgo/cli app add ${r}\` to create it`),A.error("");break}case"NO_ORG":{p.error("Could not find organization, please contact support to resolve this!"),A.error("");break}}let s=o.data;return n>s&&(p.error(`Insuficcent permissions for app ${r}. Current permission: ${Ft[o.data]}, required for this action: ${Ft[n]}.`),A.error("")),o.data}var xr="assets/icon.png";var Ij=le($j(),1);function ab(t){let e=(0,Ij.default)("npm",{registry:"https://registry.npmjs.org/"}),r=e[`${t}:registry`]||e.config_registry||e.registry;return r.slice(-1)==="/"?r:`${r}/`}var I8=le($8(),1),j8=le(Av(),1),bb=class extends Error{constructor(e){super(`Package \`${e}\` could not be found`),this.name="PackageNotFoundError"}},wb=class extends Error{constructor(e,r){super(`Version \`${r}\` for package \`${e}\` could not be found`),this.name="VersionNotFoundError"}};async function _b(t,e={}){let{version:r="latest"}=e,{omitDeprecated:n=!0}=e,i=t.split("/")[0],o=e.registryUrl??ab(i),s=new URL(encodeURIComponent(t).replace(/^%40/,"@"),o),a=(0,I8.default)(o.toString(),{recursive:!0}),u={accept:"application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*"};e.fullMetadata&&delete u.accept,a&&(u.authorization=`${a.type} ${a.token}`);let c;try{c=await Hr(s,{headers:u,keepalive:!0}).json()}catch(f){throw f?.response?.status===404?new bb(t):f}if(e.allVersions)return c;let l=new wb(t,r);if(c["dist-tags"][r]){let{time:f}=c;c=c.versions[c["dist-tags"][r]],c.time=f}else if(r){let f=!!c.versions[r];if(n&&!f)for(let[d,m]of Object.entries(c.versions))m.deprecated&&delete c.versions[d];if(!f){let d=Object.keys(c.versions);if(r=j8.default.maxSatisfying(d,r),!r)throw l}let{time:h}=c;if(c=c.versions[r],c.time=h,!c)throw l}return c}async function Bc(t,e){let{version:r}=await _b(t.toLowerCase(),e);return r}async function ye(){let t=await Bc("@capgo/cli").catch(()=>""),e=t?.split(".")[0];t!==Ir.version&&p.warning(`\u{1F6A8} You are using @capgo/cli@${Ir.version} it's not the latest version.
254
+ Please use @capgo/cli@${t}" or @capgo/cli@${e} to keep up to date with the latest features and bug fixes.`)}async function Sae(t,e,r=!0){await Eb(t,e,void 0,r)}async function Eb(t,e,r,n=!0){n&&Y("Adding"),await ye(),e.apikey=e.apikey||pe();let i=await ee();t=t||i?.config?.appId,e.apikey||(p.error("Missing API key, you need to provide a API key to upload your bundle"),A.error("")),t||(p.error("Missing argument, you need to provide a appId, or be in a capacitor project"),A.error("")),t.includes("--")&&(p.error('The app id includes illegal symbols. You cannot use "--" in the app id'),A.error(""));let o=await de(e.apikey);await me(o,e.apikey,["write","all"]),await fj(o,t)&&(p.error(`App ${t} already exist`),A.error("")),r||(r=await ma(o,["admin","super_admin"]));let a=r.gid;await ha(o,a,e.apikey,void 0,!1);let{name:u,icon:c}=e;u=u||i.config?.appName||"Unknown",c=c||"resources/icon.png",(!c||!u)&&(p.error("Missing argument, you need to provide a appId and a name, or be in a capacitor project"),A.error("")),n&&p.info(`Adding ${t} to Capgo`);let l=null,f=null;c&&(0,Ca.existsSync)(c)?(l=(0,Ca.readFileSync)(c),f=pa(c)||"image/png",p.warn(`Found app icon ${c}`)):(0,Ca.existsSync)(xr)?(l=(0,Ca.readFileSync)(xr),f=pa(xr)||"image/png",p.warn(`Found app icon ${xr}`)):p.warn(`Cannot find app icon in any of the following locations: ${c}, ${xr}`);let h="icon",d="https://xvwzpoazmxkqosrdewyv.supabase.co/storage/v1/object/public/images/capgo.png";if(l&&f){let{error:g}=await o.storage.from(`images/org/${a}/${t}`).upload(h,l,{contentType:f});g&&(console.error(g),p.error(`Could not add app ${Q(g)}`),A.error(""));let{data:w}=await o.storage.from(`images/org/${a}/${t}`).getPublicUrl(h);d=w?.publicUrl||d}let{error: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)}`),A.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)}`),A.error("")),p.success(`App ${t} added to Capgo. ${n?"You can upload a bundle now":""}`),n&&(X("Done \u2705"),(0,N8.exit)()),!0}async function L8(t,e){Sae(t,e,!0)}var B8=require("node:process");async function q8(t,e){Y("Deleting"),e.apikey=e.apikey||pe();let r=await ee();t=t||r?.config?.appId,e.apikey||(p.error("Missing API key, you need to provide a API key to upload your bundle"),A.error("")),t||(p.error("Missing argument, you need to provide a appId, or be in a capacitor project"),A.error(""));let n=await de(e.apikey),i=await me(n,e.apikey,["write","all"]);await 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 Bo({message:"Do you want to continue?",options:[{label:"Yes",value:"yes"},{label:"No",value:"no"}]});(qt(h)||h==="no")&&(p.error("Canceled deleting the app, exiting"),A.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:c}=await n.storage.from(`apps/${t}/${i}`).remove(["versions"]);c&&p.error("Could not delete app version");let{error:l}=await n.from("apps").delete().eq("app_id",t);l&&(p.error("Could not delete app"),A.error(""));let f=await Sr(n,t);await xe(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"),X("Done \u2705"),(0,B8.exit)()}var Wh=require("node:os"),Sa=require("node:process");async function xae(t){let e={},r=[];for(let n in t)Object.prototype.hasOwnProperty.call(t,n)&&r.push(Bc(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 Fae(){let{dependencies:t}=await jt(),e={"@capgo/cli":Ir.version};for(let r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&r.startsWith("@capgo/")&&r.startsWith("@capawesome/")&&r.startsWith("capacitor")){let n=t[r].replace("^","").replace("~","");e[r]=n}return e}async function M8(t){p.warn(" \u{1F48A} Capgo Doctor \u{1F48A}");let e=await ee(),r=await jt("",t.packageJson),n=e?.config?.plugins?.CapacitorUpdater?.version||r?.version,i=e?.config?.appName||"";p.info(` App Name: ${i}`);let o=e?.config?.appId||"";p.info(` App ID: ${o}`),p.info(` App Version: ${n}`);let s=e?.config?.webDir||"";p.info(` Web Dir: ${s}`),p.info(` OS: ${(0,Wh.platform)()} ${(0,Wh.version)()}`),p.info(` Node: ${Sa.version}`),p.info(" Installed Dependencies:");let a=await Fae();Object.keys(a).length===0&&(p.warning("\x1B[31m%s\x1B[0m \u{1F6A8} No dependencies found"),(0,Sa.exit)(1));for(let l in a)if(Object.prototype.hasOwnProperty.call(a,l)){let f=a[l];p.info(` ${l}: ${f}`)}let u=ve();u.start("Running: Loading latest dependencies");let c=await xae(a);u.stop("Latest Dependencies:");for(let l in c)if(Object.prototype.hasOwnProperty.call(c,l)){let f=c[l];p.info(` ${l}: ${f}`)}JSON.stringify(a)!==JSON.stringify(c)&&(p.warn("\x1B[31m\u{1F6A8} Some dependencies are not up to date\x1B[0m"),(0,Sa.exit)(1)),p.success("\x1B[32m\u2705 All dependencies are up to date\x1B[0m"),(0,Sa.exit)()}var Cb=require("node:process");function U8(t,e){let n=["normal","bold","dim","italic","underline","strikethrough"].indexOf(t),i="\x1B[";return i+n+"m"+e+i+"0m"}var lr=class t{title=null;headers=[];rows=[];static narrowTheme={top:["\u2554","\u2550","\u2564","\u2557"],row:["\u2551"," ","\u2502","\u2551"],div:["\u255F","\u2500","\u253C","\u2562"],bot:["\u255A","\u2550","\u2567","\u255D"]};static wideTheme={top:["\u2554\u2550","\u2550","\u2550\u2564\u2550","\u2550\u2557"],row:["\u2551 "," "," \u2502 "," \u2551"],div:["\u255F\u2500","\u2500","\u2500\u253C\u2500","\u2500\u2562"],bot:["\u255A\u2550","\u2550","\u2550\u2567\u2550","\u2550\u255D"]};static roundTheme={top:["\u256D\u2500","\u2500","\u2500\u252C\u2500","\u2500\u256E"],row:["\u2502 "," "," \u2502 "," \u2502"],div:["\u251C\u2500","\u2500","\u2500\u253C\u2500","\u2500\u2524"],bot:["\u2570\u2500","\u2500","\u2500\u2534\u2500","\u2500\u256F"]};theme=t.wideTheme;columnWidth(){let e=[this.headers,...this.rows].filter(n=>n.length>0),r=e[0].map(n=>this.cast(n).length);for(let n of e.slice(1))for(let i=0;i<r.length;i++){let o=this.cast(n[i]).length;o>r[i]&&(r[i]=o)}return r}cast(e){return typeof e=="object"?"obj":e!==void 0&&typeof e.toString=="function"?e.toString():""}renderTitle(){return"[ "+this.title+" ]"}renderLine(e){let r=this.columnWidth();return e[0]+r.map(n=>e[1].repeat(n)).join(e[2])+e[3]}renderCell(e,r,n=!1){let i=this.cast(e),o=n?U8("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))+U8("italic",i)+a.repeat(Math.floor(s/2));default:return a.repeat(s)}}renderRow(e,r=!1){let n=this.theme.row,i=this.columnWidth();return n[0]+e.map((o,s)=>this.renderCell(o,i[s],r)).join(n[2])+n[3]}toString(){let e=this.theme,r=this.headers.length>0,n=this.rows.length>0;return[this.title?this.renderTitle():"",r||n?this.renderLine(e.top):"",r?this.renderRow(this.headers,!0):"",r&&n?this.renderLine(e.div):"",...this.rows.map(i=>this.renderRow(i)),r||n?this.renderLine(e.bot):""].filter(i=>i.length>0).join(`
255
+ `)}};function Oae(t){t.length||(p.error("No apps found"),(0,Cb.exit)(1));let e=new lr;e.headers=["Name","id","Created"],e.rows=[],t.reverse().forEach(r=>{e.rows.push([r.name??"",r.app_id,ga(r.created_at)])}),p.success("Apps"),p.success(e.toString())}async function Aae(t){let{data:e,error:r}=await t.from("apps").select().order("created_at",{ascending:!1});return r&&(p.error("Apps not found"),A.error("")),e}async function V8(t){Y("List apps in Capgo"),await ye(),t.apikey=t.apikey||pe();let e=await de(t.apikey);await me(e,t.apikey,["write","all","read","upload"]),p.info("Getting active bundle in Capgo");let r=await Aae(e);p.info(`Active app in Capgo: ${r?.length}`),Oae(r),X("Done \u2705"),(0,Cb.exit)()}var H8=require("node:crypto"),xa=require("node:fs"),z8=require("node:process");async function G8(t,e){Y("Set app"),e.apikey=e.apikey||pe();let r=await ee();t=t||r?.config?.appId,e.apikey||(p.error("Missing API key, you need to provide a API key to upload your bundle"),A.error("")),t||(p.error("Missing argument, you need to provide a appId, or be in a capacitor project"),A.error(""));let n=await de(e.apikey),o=(await ma(n,["admin","super_admin"])).gid,s=await me(n,e.apikey,["write","all"]);await qe(n,e.apikey,t,4);let{name:a,icon:u,retention:c}=e;c&&Number.isNaN(Number(c))?(p.error("retention value must be a number"),A.error("")):c&&c<0&&(p.error("retention value cannot be less than 0"),A.error(""));let l,f,h=`icon_${(0,H8.randomUUID)()}`,d="https://xvwzpoazmxkqosrdewyv.supabase.co/storage/v1/object/public/images/capgo.png";if(u&&(0,xa.existsSync)(u)?(l=(0,xa.readFileSync)(u),f=pa(u)||"image/png",p.warn(`Found app icon ${u}`)):(0,xa.existsSync)(xr)?(l=(0,xa.readFileSync)(xr),f=pa(xr)||"image/png",p.warn(`Found app icon ${xr}`)):p.warn(`Cannot find app icon in any of the following locations: ${u}, ${xr}`),l&&f){let{error:b}=await n.storage.from(`images/org/${o}/${t}`).upload(h,l,{contentType:f});b&&(p.error(`Could not set app ${Q(b)}`),A.error(""));let{data:g}=await n.storage.from(`images/org/${o}/${t}`).getPublicUrl(h);d=g?.publicUrl||d}let{error:m}=await n.from("apps").update({icon_url:d,name:a,retention:c?c*24*60*60:void 0}).eq("app_id",t).eq("user_id",s);m&&(p.error(`Could not set app ${Q(m)}`),A.error("")),X("Done \u2705"),(0,z8.exit)()}var Fa=require("node:process");async function W8(t,e){Y("Set a specific setting in capacitor config"),e.bool&&e.string&&(p.error("Bool and string CANNOT be set at the same time"),(0,Fa.exit)(1)),!e.bool&&!e.string&&(p.error("You MUST provide either bool or string as the value"),(0,Fa.exit)(1)),e.bool&&e.bool!=="true"&&e.bool!=="false"&&(p.error("Invalid bool"),(0,Fa.exit)(1));try{let r=await ee(),n=r.config,i=t.split(".");i.length===0&&(p.error("Invalid path"),(0,Fa.exit)(1));for(let s of i.slice(0,-1))Object.prototype.hasOwnProperty.call(n,s)||(n[s]={}),n=n[s];let o=e.bool?e.bool==="true":e.string;n[i.at(-1)]=o,await on(r,!0),p.success(`Set "${t}" to "${o}"`)}catch(r){p.error(`Cannot set config in capacitor settings ${Q(r)}`),(0,Fa.exit)(1)}X("Done \u2705")}var $b=require("node:process");function Kh(t,e){if(isNaN(t)||isNaN(e))throw new Error("Cannot compare against non-numbers");return t===e?0:t<e?-1:1}function J8(t=[],e=[]){return t.length&&!e.length?-1:!t.length&&e.length?1:0}function xb(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 Oa="0|[1-9]\\d*",kae="\\d*[a-zA-Z-][a-zA-Z0-9-]*",Tae=`(?<major>${Oa})\\.(?<minor>${Oa})\\.(?<patch>${Oa})`,K8=`(?:${Oa}|${kae})`,X8=`(?:-(?<prerelease>${K8}(?:\\.${K8})*))`,Y8="[0-9A-Za-z-]+",Z8=`(?:\\+(?<buildmetadata>${Y8}(?:\\.${Y8})*))`,Q8=`v?${Tae}${X8}?${Z8}?`,eN=new RegExp(`^${Q8}$`),tN="(?:<|>)?=?",Pae="x|X|\\*",Sb=`${Oa}|${Pae}`,rN=`[v=\\s]*(?<major>${Sb})(?:\\.(?<minor>${Sb})(?:\\.(?<patch>${Sb})${X8}?${Z8}?)?)?`,Rae=new RegExp(`^(?<operator>~>?|\\^|${tN})\\s*${rN}$`),$ae=new RegExp(`^(?<operator>${tN})\\s*(${Q8})$|^$`);function Fb(t){return typeof t=="number"&&!Number.isNaN(t)&&(!Number.isFinite(t)||0<=t&&t<=Number.MAX_SAFE_INTEGER)}var Ob=256;var Iae=new RegExp(`^${Oa}$`);function Ab(t){return t.split(".").filter(Boolean).map(e=>{if(Iae.test(e)){let r=Number(e);if(Fb(r))return r}return e})}function qc(t){return t.split(".").filter(Boolean)}function Mc(t,e){let r=Number(t);if(!Fb(r))throw new TypeError(e);return r}function Fr(t,e){return t===e?0:Kh(t.major,e.major)||Kh(t.minor,e.minor)||Kh(t.patch,e.patch)||J8(t.prerelease,e.prerelease)||xb(t.prerelease,e.prerelease)}function kb(t){return t.toFixed(0)}function Aa(t){let e=kb(t.major),r=kb(t.minor),n=kb(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 jae(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 Uc(t=[],e){let r=jae(t);return e&&(r[0]!==e||isNaN(r[1]))&&(r=[e,0]),r}function iN(t,e,r={}){let n=r.build!==void 0?qc(r.build):t.build??[];switch(e){case"premajor":return{major:t.major+1,minor:0,patch:0,prerelease:Uc(t.prerelease,r.prerelease),build:n};case"preminor":return{major:t.major,minor:t.minor+1,patch:0,prerelease:Uc(t.prerelease,r.prerelease),build:n};case"prepatch":return{major:t.major,minor:t.minor,patch:t.patch+1,prerelease:Uc(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:Uc(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:Uc(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:[]},oN={operator:void 0,...Tb};function Pb(t,e){return Fr(t,e)>0}function ka(t,e){return Fr(t,e)<0}function Bn(t){if(typeof t!="string")throw new TypeError(`Cannot parse version as version must be a string: received ${typeof t}`);if(t.length>Ob)throw new TypeError(`Cannot parse version as version length is too long: length is ${t.length}, max length is ${Ob}`);t=t.trim();let e=t.match(eN)?.groups;if(!e)throw new TypeError(`Cannot parse version: ${t}`);let r=Mc(e.major,`Cannot parse version ${t}: invalid major version`),n=Mc(e.minor,`Cannot parse version ${t}: invalid minor version`),i=Mc(e.patch,`Cannot parse version ${t}: invalid patch version`),o=e.prerelease?Ab(e.prerelease):[],s=e.buildmetadata?qc(e.buildmetadata):[];return{major:r,minor:n,patch:i,prerelease:o,build:s}}var mN=require("node:process");var aN=require("node:process");async function uN(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}`),A.error("")),n&&n.length>0){if(Y(`\u274C Version ${e}@${r.name} is used in ${n.length} channel`),await Te({message:"unlink it?"}))for(let o of n){let s=ve();s.start(`Unlinking channel ${o.name}`);let{error:a}=await t.from("channels").update({version:(await Rb(t,e))?.id}).eq("id",o.id);a&&(s.stop(`Cannot update channel ${o.name} ${Q(a)}`),(0,aN.exit)(1)),s.stop(`\u2705 Channel ${o.name} unlinked`)}else p.error("Unlink it first"),A.error("");X(`Version unlinked from ${n.length} channel`)}}function Rb(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.
256
256
  ${Q(n)}`),A.error("")),r))}function cN(t,e){return t.from("channels").insert(e).select().single()}function lN(t,e,r,n){return t.from("channels").delete().eq("name",e).eq("app_id",r).single()}function fN(t){let e=new lr;e.theme=lr.roundTheme,e.headers=["Name","Version","Public","iOS","Android","Auto Update","Native Auto Update","Device Self Set","Progressive Deploy","Secondary Version","Secondary Version Percentage","AB Testing","AB Testing Version","AB Testing Percentage","Emulator","Dev"],e.rows=[["a",0,!0],["bb",10,!1]],t.reverse().forEach(r=>{e.rows.push([r.name,r.version?.name,r.public?"\u2705":"\u274C",r.ios?"\u2705":"\u274C",r.android?"\u2705":"\u274C",r.disable_auto_update,r.disable_auto_update_under_native?"\u274C":"\u2705",r.allow_device_self_set?"\u2705":"\u274C",r.enable_progressive_deploy?"\u2705":"\u274C",r.enable_progressive_deploy&&r.second_version?r.second_version.name:void 0,r.enable_progressive_deploy&&r.second_version?r.secondary_version_percentage:void 0,r.enable_ab_testing?"\u2705":"\u274C",r.enable_ab_testing&&r.second_version?r.second_version.name:void 0,r.enable_ab_testing&&r.second_version?`${(1-r.secondary_version_percentage)*100}% / ${r.secondary_version_percentage*100}%`:void 0,r.allow_emulator?"\u2705":"\u274C",r.allow_dev?"\u2705":"\u274C"])}),p.success("Channels"),p.success(e.toString())}async function dN(t,e){let{data:r,error:n}=await t.from("channels").select(`
257
257
  id,
258
258
  name,
@@ -272,31 +272,31 @@ ${Q(n)}`),A.error("")),r))}function cN(t,e){return t.from("channels").insert(e).
272
272
  created_by,
273
273
  app_id,
274
274
  version (id, name)
275
- `).eq("app_id",e).order("created_at",{ascending:!1});return n&&(p.error(`App ${e} not found in database`),A.error("")),r}var hN=require("node:process");async function pN(t,e,r){let{data:n,error:i}=await t.from("devices_override").select().eq("app_id",e).eq("version",r.id);if(i&&(p.error(`Cannot check Device override ${e}@${r.name}`),A.error("")),n&&n.length>0)if(Y(`\u274C Version ${e}@${r.name} is used in ${n.length} device override`),await Te({message:"unlink it?"}))for(let o of n){let s=ve();s.start(`Unlinking device ${o.device_id}`);let{error:a}=await t.from("devices_override").delete().eq("device_id",o.device_id);a&&(s.stop(`Cannot unlink device ${o.device_id} ${Q(a)}`),(0,hN.exit)(1)),s.stop(`\u2705 Device ${o.device_id} unlinked`)}else p.error("Unlink it first"),A.error("")}async function Nae(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`),A.error(""))}async function Jh(t,e,r){let n=await Lae(t,e,r);await uN(t,e,n),await pN(t,e,n),await Nae(t,e,r)}function Xh(t){t.length||(p.error("No bundle found"),(0,mN.exit)(1));let e=new lr;e.theme=lr.roundTheme,e.headers=["Version","Created","Keep"],t.reverse().forEach(r=>{e.rows.push([r.name,ga(r.created_at),r.keep!=null?r.keep:""])}),p.success("Bundles"),p.success(e.toString())}async function Zh(t,e){let{data:r,error:n}=await t.from("app_versions").select().eq("app_id",e).eq("deleted",!1).order("created_at",{ascending:!1});return n&&(p.error(`App ${e} not found in database`),A.error("")),r}async function gN(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`),A.error("")),r.map(i=>i.version)}async function Lae(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`),A.error("")),n}async function Bae(t,e,r){for await(let n of t)p.warn(`Removing ${n.name} created on ${ga(n.created_at)}`),await Jh(e,r,n.name)}function qae(t,e,r){let n=[];return t?.forEach(i=>{let o=Bn(i.name);Rb(o,e)&&ka(o,r)&&n.push(i)}),n}async function yN(t,e){Y("Cleanup versions in Capgo"),await ye(),e.apikey=e.apikey||pe();let{bundle:r,keep:n=4}=e,i=e.force||!1,o=await ee();t=t||o?.config?.appId,e.apikey||(p.error("Missing API key, you need to provide an API key to delete your app"),A.error("")),t||(p.error("Missing argument, you need to provide a appid, or be in a capacitor project"),A.error(""));let s=await de(e.apikey);await me(s,e.apikey,["write","all"]),await qe(s,e.apikey,t,3),p.info("Querying all available versions in Capgo");let a=await Zh(s,t),u=await gN(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=Bn(r),h=iN(f,"major");p.info(`Querying available versions in Capgo between ${Aa(f)} and ${Aa(h)}`),a=qae(a,f,h),p.info(`Active versions in Capgo between ${Aa(f)} and ${Aa(h)}: ${a?.length}`)}let c=[],l=0;if(a.forEach(f=>{let h=u.find(d=>d===f.id);l<n||h?(h?f.keep="\u2705 (Linked to channel)":f.keep="\u2705",l+=1):(f.keep="\u274C",c.push(f))}),c.length===0){p.warn("Nothing to be removed, aborting removal...");return}if(Xh(a),!i){let f=await Te({message:"Do you want to continue removing the versions specified?"});(qt(f)||!f)&&(p.warn("Not confirmed, aborting removal..."),(0,Ib.exit)())}p.success("You have confirmed removal, removing versions now"),await Bae(c,s,t),X("Done \u2705"),(0,Ib.exit)()}var sn=require("node:fs"),_N=require("node:process");var Vc=require("node:buffer"),Lt=require("node:crypto"),DN="aes-128-cbc",vN="sha256",Qh="base64",bN=Lt.constants.RSA_PKCS1_OAEP_PADDING;function wN(t,e,r){let[n,i]=e.split(":"),o=(0,Lt.privateDecrypt)({key:r,padding:bN,oaepHash:vN},Vc.Buffer.from(i,Qh)),s=Vc.Buffer.from(n,Qh),a=(0,Lt.createDecipheriv)(DN,o,s);return a.setAutoPadding(!0),Vc.Buffer.concat([a.update(t),a.final()])}function ep(t,e){let r=(0,Lt.randomBytes)(16),n=(0,Lt.randomBytes)(16),i=(0,Lt.createCipheriv)(DN,n,r);i.setAutoPadding(!0);let o=r.toString(Qh),s=(0,Lt.publicEncrypt)({key:e,padding:bN,oaepHash:vN},n).toString(Qh),a=`${o}:${s}`;return{encryptedData:Vc.Buffer.concat([i.update(t),i.final()]),ivSessionKey:a}}function tp(t="pem",e=2048){let{publicKey:r,privateKey:n}=(0,Lt.generateKeyPairSync)("rsa",{modulusLength:e});return t==="pem"?{publicKey:r.export({type:"pkcs1",format:"pem"}),privateKey:n.export({type:"pkcs1",format:"pem"})}:{publicKey:r.export({type:"spki",format:"der"}).toString("base64"),privateKey:n.export({type:"pkcs1",format:"pem"}).toString("base64")}}async function EN(t,e,r){Y("Decrypt zip file"),await ye(),(0,sn.existsSync)(t)||(p.error(`Zip not found at the path ${t}`),A.error(""));let n=await ee();!r.key&&!(0,sn.existsSync)(tr)&&!n.config.plugins?.CapacitorUpdater?.privateKey&&(p.error(`Private Key not found at the path ${tr} or in ${n.path}`),A.error(""));let i=r.key||tr,o=n.config.plugins?.CapacitorUpdater?.privateKey;!(0,sn.existsSync)(i)&&!o?(p.error(`Cannot find public key ${i} or as keyData option or in ${n.path}`),A.error("")):(0,sn.existsSync)(i)&&(o=(0,sn.readFileSync)(i).toString());let s=(0,sn.readFileSync)(t),a=wN(s,e,r.keyData??o??"");(0,sn.writeFileSync)(`${t}_decrypted.zip`,a),X(`Decrypted zip file at ${t}_decrypted.zip`),(0,_N.exit)()}var an=require("node:fs"),FN=require("node:process");var ON=le(vu());var To=require("node:buffer"),At=require("node:crypto"),CN="aes-128-cbc",wi="base64",rp=At.constants.RSA_PKCS1_PADDING;function SN(t,e,r){let[n,i]=e.split(":"),o=(0,At.publicDecrypt)({key:r,padding:rp},To.Buffer.from(i,wi)),s=To.Buffer.from(n,wi),a=(0,At.createDecipheriv)(CN,o,s);return a.setAutoPadding(!0),To.Buffer.concat([a.update(t),a.final()])}function np(t,e){return(0,At.privateEncrypt)({key:e,padding:rp},To.Buffer.from(t,wi)).toString(wi)}function xN(t,e){return(0,At.publicDecrypt)({key:e,padding:rp},To.Buffer.from(t,wi)).toString(wi)}function ip(t,e){let r=(0,At.randomBytes)(16),n=(0,At.randomBytes)(16),i=(0,At.createCipheriv)(CN,n,r);i.setAutoPadding(!0);let o=r.toString(wi),s=(0,At.privateEncrypt)({key:e,padding:rp},n).toString(wi),a=`${o}:${s}`;return{encryptedData:To.Buffer.concat([i.update(t),i.final()]),ivSessionKey:a}}async function AN(t,e,r){Y("Decrypt zip file"),await ye(),(0,an.existsSync)(t)||(p.error(`Zip not found at the path ${t}`),A.error(""));let n=await ee();!r.key&&!(0,an.existsSync)(jn)&&!n.config.plugins?.CapacitorUpdater?.privateKey&&(p.error(`Private Key not found at the path ${jn} or in ${n.path}`),A.error(""));let i=r.key||jn,o=n.config.plugins?.CapacitorUpdater?.publicKey;!(0,an.existsSync)(i)&&!o?(p.error(`Cannot find public key ${i} or as keyData option or in ${n.path}`),A.error("")):(0,an.existsSync)(i)&&(o=(0,an.readFileSync)(i).toString());let s=(0,an.readFileSync)(t),a=SN(s,e,r.keyData??o??"");if((0,an.writeFileSync)(`${t}_decrypted.zip`,a),p.info(`Decrypted zip file at ${t}_decrypted.zip`),r.checksum){let u=await(0,ON.checksum)(a,"sha256"),c=xN(r.checksum,r.keyData??o??"");u!==c?(p.error(`Checksum does not match ${u} !== ${c}`),A.error("")):p.info("Checksum matches")}X("\u2705 done"),(0,FN.exit)()}var kN=require("node:process");async function TN(t,e,r){Y("Delete bundle"),r.apikey=r.apikey||pe();let n=await ee();e=e||n?.config?.appId,r.apikey||(p.error("Missing API key, you need to provide a API key to upload your bundle"),A.error("")),e||(p.error("Missing argument, you need to provide a appId, or be in a capacitor project"),A.error(""));let i=await de(r.apikey);await me(i,r.apikey,["write","all"]),await qe(i,r.apikey,e,3),r.apikey||(p.error("Missing API key, you need to provide an API key to delete your app"),A.error("")),t||(p.error("Missing argument, you need to provide a bundleId, or be in a capacitor project"),A.error("")),e||(p.error("Missing argument, you need to provide a appId, or be in a capacitor project"),A.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 Jh(i,e,t),p.success(`Bundle ${e}@${t} deleted in Capgo`),X("Done"),(0,kN.exit)()}var _i=require("node:fs"),PN=require("node:process");async function RN(t,e){Y("Encryption"),await ye(),(0,_i.existsSync)(t)||(p.error(`Error: Zip not found at the path ${t}`),A.error(""));let r=e.key||cr,n=e.keyData||"";(0,_i.existsSync)(r)&&(n=(0,_i.readFileSync)(r).toString());let i=(0,_i.readFileSync)(t),o=ep(i,n);p.success(`ivSessionKey: ${o.ivSessionKey}`),(0,_i.writeFileSync)(`${t}_encrypted.zip`,o.encryptedData),p.success(`Encrypted zip saved at ${t}_encrypted.zip`),X("Done \u2705"),(0,PN.exit)()}var qn=require("node:fs"),$N=require("node:process");async function IN(t,e,r){let{json:n}=r;n||(Y("Encryption"),await ye());let i=await ee(),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,qn.existsSync)(t)||(n?console.error(Q({error:"zip_not_found"})):p.error(`Error: Zip not found at the path ${t}`),A.error("")),s||(n?console.error(Q({error:"missing_public_key"})):p.warning("Warning: Missing Public Key in config"),A.error(""));let a=r.key||ur,u=r.keyData||"";!(0,qn.existsSync)(a)&&!u?(n?console.error(Q({error:"missing_key"})):(p.warning(`Cannot find a private key at ${a} or as a keyData option`),p.error("Error: Missing key")),A.error("")):(0,qn.existsSync)(a)&&(u=(0,qn.readFileSync)(a).toString()),u&&!u.startsWith("-----BEGIN RSA PRIVATE KEY-----")&&(n?console.error(Q({error:"invalid_private_key"})):p.error("the private key provided is not a valid RSA Private key"),A.error(""));let c=(0,qn.readFileSync)(t),l=ip(c,u),f=np(e,u),h=`${t}_encrypted.zip`;n?console.log(JSON.stringify({checksum:f,filename:h,ivSessionKey:l.ivSessionKey},null,2)):(p.success(`Encoded Checksum: ${f}`),p.success(`ivSessionKey: ${l.ivSessionKey}`)),(0,qn.writeFileSync)(h,l.encryptedData),n||(p.success(`Encrypted zip saved at ${h}`),X("Done \u2705")),(0,$N.exit)()}var jN=require("node:process");async function NN(t,e){Y("List bundles"),await ye(),e.apikey=e.apikey||pe();let r=await ee();t=t||r?.config?.appId,e.apikey||(p.error("Missing API key, you need to provide a API key to upload your bundle"),A.error("")),t||(p.error("Missing argument, you need to provide a appid, or be in a capacitor project"),A.error(""));let n=await de(e.apikey);await me(n,e.apikey,["write","all","read","upload"]),p.info(`Querying available versions of: ${t} in Capgo`),await qe(n,e.apikey,t,1);let i=await Zh(n,t);p.info(`Active versions in Capgo: ${i?.length}`),Xh(i),X("Done \u2705"),(0,jN.exit)()}var tL=require("node:crypto"),cn=require("node:fs"),rL=require("node:process");function Hc(t,e,r=0){r=Math.max(0,Math.min(r,e.byteLength));let n=e.byteLength-r;return t.byteLength>n&&(t=t.subarray(0,n)),e.set(t,r),t.byteLength}var op=32*1024,jb=2**32-2,sp=class{#e;#t=0;constructor(e){this.#e=e===void 0?new Uint8Array(0):new Uint8Array(e)}bytes(e={copy:!0}){return e.copy===!1?this.#e.subarray(this.#t):this.#e.slice(this.#t)}empty(){return this.#e.byteLength<=this.#t}get length(){return this.#e.byteLength-this.#t}get capacity(){return this.#e.buffer.byteLength}truncate(e){if(e===0){this.reset();return}if(e<0||e>this.length)throw Error("bytes.Buffer: truncation out of range");this.#r(this.#t+e)}reset(){this.#r(0),this.#t=0}#i(e){let r=this.#e.byteLength;return e<=this.capacity-r?(this.#r(r+e),r):-1}#r(e){if(e>this.#e.buffer.byteLength)throw new RangeError("Length is greater than buffer capacity");this.#e=new Uint8Array(this.#e.buffer,0,e)}readSync(e){if(this.empty())return this.reset(),e.byteLength===0?0:null;let r=Hc(this.#e.subarray(this.#t),e);return this.#t+=r,r}read(e){let r=this.readSync(e);return Promise.resolve(r)}writeSync(e){let r=this.#n(e.byteLength);return Hc(e,this.#e,r)}write(e){let r=this.writeSync(e);return Promise.resolve(r)}#n(e){let r=this.length;r===0&&this.#t!==0&&this.reset();let n=this.#i(e);if(n>=0)return n;let i=this.capacity;if(e<=Math.floor(i/2)-r)Hc(this.#e.subarray(this.#t),this.#e);else{if(i+e>jb)throw new Error("The buffer cannot be grown beyond the maximum size.");{let o=new Uint8Array(Math.min(2*i+e,jb));Hc(this.#e.subarray(this.#t),o),this.#e=o}}return this.#t=0,this.#r(Math.min(r+e,jb)),r}grow(e){if(e<0)throw Error("Buffer.grow: negative count");let r=this.#n(e);this.#r(r)}async readFrom(e){let r=0,n=new Uint8Array(op);for(;;){let i=this.capacity-this.length<op,o=i?n:new Uint8Array(this.#e.buffer,this.length),s=await e.read(o);if(s===null)return r;i?this.writeSync(o.subarray(0,s)):this.#r(this.length+s),r+=s}}readFromSync(e){let r=0,n=new Uint8Array(op);for(;;){let i=this.capacity-this.length<op,o=i?n:new Uint8Array(this.#e.buffer,this.length),s=e.readSync(o);if(s===null)return r;i?this.writeSync(o.subarray(0,s)):this.#r(this.length+s),r+=s}}};var ap=class extends TransformStream{constructor(e){let r=new sp;r.grow(e),super({start(){},async transform(n,i){for(r.write(n);r.length>=e;){let o=new Uint8Array(e),s=await r.read(o);if(s!==e)throw new Error(`Unexpectedly read ${s} bytes from transform buffer when trying to read ${e} bytes.`);i.enqueue(o)}},flush(n){r.length&&n.enqueue(r.bytes())}})}};function Ei(t){return t=t.trim(),t=t.replace(/<!--[\s\S]*?-->/g,""),e();function e(){return{declaration:r(),root:n()}}function r(){if(!u(/^<\?xml\s*/))return;let h={attributes:{}};for(;!(c()||l("?>"));){let d=o();if(!d)return h;h.attributes[d.name]=d.value}return u(/\?>\s*/),h}function n(){let f=u(/^<([\w-:.]+)\s*/);if(!f)return;let h={name:f[1],attributes:{},children:[]};for(;!(c()||l(">")||l("?>")||l("/>"));){let 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("&lt;","<").replaceAll("&gt;",">").replaceAll("&amp;","&")}function u(f){let h=t.match(f);if(h)return t=t.slice(h[0].length),h}function c(){return t.length==0}function l(f){return t.indexOf(f)==0}}var un=class extends Error{constructor(e){super(e)}};var Or=class extends un{},up=class extends un{},cp=class extends un{},Mn=class extends un{},Po=class extends un{},zc=class extends un{},Gc=class extends un{},Un=class extends un{statusCode;code;key;bucketName;resource;region;constructor(e,r,n,i={}){super(n),this.statusCode=e,this.code=r,this.key=i.key,this.bucketName=i.bucketName,this.resource=i.resource,this.region=i.region}};async function LN(t){try{let r=Ei(await t.text()).root;if(r?.name!=="Error")throw new Error("Invalid root, expected <Error>");let n=r.children.find(c=>c.name==="Code")?.content??"UnknownErrorCode",i=r.children.find(c=>c.name==="Message")?.content??"The error message could not be determined.",o=r.children.find(c=>c.name==="Key")?.content,s=r.children.find(c=>c.name==="BucketName")?.content,a=r.children.find(c=>c.name==="Resource")?.content,u=r.children.find(c=>c.name==="Region")?.content;return new Un(t.status,n,i,{key:o,bucketName:s,resource:a,region:u})}catch{return new Un(t.status,"UnrecognizedError",`Error: Unexpected response code ${t.status} ${t.statusText}. Unable to parse response as XML.`)}}function BN(t){return typeof t!="number"||isNaN(t)||t<=0?!1:t>=1&&t<=65535}function qN(t){return typeof t!="string"||t.length<3||t.length>63||t.indexOf("..")>-1||t.match(/[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+/)?!1:!!t.match(/^[a-z0-9][a-z0-9.-]+[a-z0-9]$/)}function Ro(t){return!(!Mae(t)||t.length===0)}function Mae(t){return!(typeof t!="string"||t.length>1024)}function lp(t){return Array.from(t).map(e=>e.toString(16).padStart(2,"0")).join("")}function $o(t=""){let e={'"':"","&quot;":"","&#34;":"","&QUOT;":"","&#x00022":""};return t.replace(/^("|&quot;|&#34;)|("|&quot;|&#34;)$/g,r=>e[r])}function Lb(t){return t.get("x-amz-version-id")??null}function Wc(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 Bb(t){t=t||new Date;let e=t.toISOString();return e.substr(0,4)+e.substr(5,2)+e.substr(8,2)}function qb(t,e){return`${Bb(e)}/${t}/s3/aws4_request`}async function fp(t){return t instanceof Uint8Array||(t=new TextEncoder().encode(t)),lp(new Uint8Array(await crypto.subtle.digest("SHA-256",t)))}var Uae=["x-amz-server-side-encryption-customer-algorithm","x-amz-server-side-encryption-customer-key","x-amz-server-side-encryption-customer-key-MD5"],dp=class extends WritableStream{getResult;constructor({client:e,bucketName:r,objectName:n,partSize:i,metadata:o}){let s,a=1,u,c=[],l=[];super({start(){},async write(f,h){let d="PUT",m=a++;try{if(m==1&&f.length<i){let w=await e.makeRequest({method:d,headers:new Headers({...o,"Content-Length":String(f.length)}),bucketName:r,objectName:n,payload:f});s={etag:$o(w.headers.get("etag")??void 0),versionId:Lb(w.headers)};return}m===1&&(u=(await Vae({client:e,bucketName:r,objectName:n,metadata:o})).uploadId);let b={"Content-Length":String(f.length)};for(let w of Uae){let x=o[w];x&&(b[w]=x)}let g=e.makeRequest({method:d,query:{partNumber:m.toString(),uploadId:u},headers:new Headers(b),bucketName:r,objectName:n,payload:f});g.then(w=>{let x=w.headers.get("etag")??"";x&&(x=x.replace(/^"/,"").replace(/"$/,"")),c.push({part:m,etag:x})}),l.push(g)}catch(b){throw b}},async close(){if(!s)if(u)await Promise.all(l),c.sort((f,h)=>f.part>h.part?1:-1),s=await Hae({client:e,bucketName:r,objectName:n,uploadId:u,etags:c});else throw new Error("Stream was closed without uploading any data.")}}),this.getResult=()=>{if(s===void 0)throw new Error("Result is not ready. await the stream first.");return s}}};async function Vae(t){let e="POST",r=new Headers(t.metadata),o=await(await t.client.makeRequest({method:e,bucketName:t.bucketName,objectName:t.objectName,query:"uploads",headers:r,returnBody:!0})).text(),s=Ei(o).root;if(!s||s.name!=="InitiateMultipartUploadResult")throw new Error(`Unexpected response: ${o}`);let a=s.children.find(u=>u.name==="UploadId")?.content;if(!a)throw new Error(`Unable to get UploadId from response: ${o}`);return{uploadId:a}}async function Hae({client:t,bucketName:e,objectName:r,uploadId:n,etags:i}){let o=`
275
+ `).eq("app_id",e).order("created_at",{ascending:!1});return n&&(p.error(`App ${e} not found in database`),A.error("")),r}var hN=require("node:process");async function pN(t,e,r){let{data:n,error:i}=await t.from("devices_override").select().eq("app_id",e).eq("version",r.id);if(i&&(p.error(`Cannot check Device override ${e}@${r.name}`),A.error("")),n&&n.length>0)if(Y(`\u274C Version ${e}@${r.name} is used in ${n.length} device override`),await Te({message:"unlink it?"}))for(let o of n){let s=ve();s.start(`Unlinking device ${o.device_id}`);let{error:a}=await t.from("devices_override").delete().eq("device_id",o.device_id);a&&(s.stop(`Cannot unlink device ${o.device_id} ${Q(a)}`),(0,hN.exit)(1)),s.stop(`\u2705 Device ${o.device_id} unlinked`)}else p.error("Unlink it first"),A.error("")}async function Nae(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`),A.error(""))}async function Jh(t,e,r){let n=await Lae(t,e,r);await uN(t,e,n),await pN(t,e,n),await Nae(t,e,r)}function Xh(t){t.length||(p.error("No bundle found"),(0,mN.exit)(1));let e=new lr;e.theme=lr.roundTheme,e.headers=["Version","Created","Keep"],t.reverse().forEach(r=>{e.rows.push([r.name,ga(r.created_at),r.keep!=null?r.keep:""])}),p.success("Bundles"),p.success(e.toString())}async function Zh(t,e){let{data:r,error:n}=await t.from("app_versions").select().eq("app_id",e).eq("deleted",!1).order("created_at",{ascending:!1});return n&&(p.error(`App ${e} not found in database`),A.error("")),r}async function gN(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`),A.error("")),r.map(i=>i.version)}async function Lae(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`),A.error("")),n}async function Bae(t,e,r){for await(let n of t)p.warn(`Removing ${n.name} created on ${ga(n.created_at)}`),await Jh(e,r,n.name)}function qae(t,e,r){let n=[];return t?.forEach(i=>{let o=Bn(i.name);Pb(o,e)&&ka(o,r)&&n.push(i)}),n}async function yN(t,e){Y("Cleanup versions in Capgo"),await ye(),e.apikey=e.apikey||pe();let{bundle:r,keep:n=4}=e,i=e.force||!1,o=await ee();t=t||o?.config?.appId,e.apikey||(p.error("Missing API key, you need to provide an API key to delete your app"),A.error("")),t||(p.error("Missing argument, you need to provide a appid, or be in a capacitor project"),A.error(""));let s=await de(e.apikey);await me(s,e.apikey,["write","all"]),await qe(s,e.apikey,t,3),p.info("Querying all available versions in Capgo");let a=await Zh(s,t),u=await gN(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=Bn(r),h=iN(f,"major");p.info(`Querying available versions in Capgo between ${Aa(f)} and ${Aa(h)}`),a=qae(a,f,h),p.info(`Active versions in Capgo between ${Aa(f)} and ${Aa(h)}: ${a?.length}`)}let c=[],l=0;if(a.forEach(f=>{let h=u.find(d=>d===f.id);l<n||h?(h?f.keep="\u2705 (Linked to channel)":f.keep="\u2705",l+=1):(f.keep="\u274C",c.push(f))}),c.length===0){p.warn("Nothing to be removed, aborting removal...");return}if(Xh(a),!i){let f=await Te({message:"Do you want to continue removing the versions specified?"});(qt(f)||!f)&&(p.warn("Not confirmed, aborting removal..."),(0,$b.exit)())}p.success("You have confirmed removal, removing versions now"),await Bae(c,s,t),X("Done \u2705"),(0,$b.exit)()}var sn=require("node:fs"),_N=require("node:process");var Vc=require("node:buffer"),Lt=require("node:crypto"),DN="aes-128-cbc",vN="sha256",Qh="base64",bN=Lt.constants.RSA_PKCS1_OAEP_PADDING;function wN(t,e,r){let[n,i]=e.split(":"),o=(0,Lt.privateDecrypt)({key:r,padding:bN,oaepHash:vN},Vc.Buffer.from(i,Qh)),s=Vc.Buffer.from(n,Qh),a=(0,Lt.createDecipheriv)(DN,o,s);return a.setAutoPadding(!0),Vc.Buffer.concat([a.update(t),a.final()])}function ep(t,e){let r=(0,Lt.randomBytes)(16),n=(0,Lt.randomBytes)(16),i=(0,Lt.createCipheriv)(DN,n,r);i.setAutoPadding(!0);let o=r.toString(Qh),s=(0,Lt.publicEncrypt)({key:e,padding:bN,oaepHash:vN},n).toString(Qh),a=`${o}:${s}`;return{encryptedData:Vc.Buffer.concat([i.update(t),i.final()]),ivSessionKey:a}}function tp(t="pem",e=2048){let{publicKey:r,privateKey:n}=(0,Lt.generateKeyPairSync)("rsa",{modulusLength:e});return t==="pem"?{publicKey:r.export({type:"pkcs1",format:"pem"}),privateKey:n.export({type:"pkcs1",format:"pem"})}:{publicKey:r.export({type:"spki",format:"der"}).toString("base64"),privateKey:n.export({type:"pkcs1",format:"pem"}).toString("base64")}}async function EN(t,e,r){Y("Decrypt zip file"),await ye(),(0,sn.existsSync)(t)||(p.error(`Zip not found at the path ${t}`),A.error(""));let n=await ee();!r.key&&!(0,sn.existsSync)(tr)&&!n.config.plugins?.CapacitorUpdater?.privateKey&&(p.error(`Private Key not found at the path ${tr} or in ${n.path}`),A.error(""));let i=r.key||tr,o=n.config.plugins?.CapacitorUpdater?.privateKey;!(0,sn.existsSync)(i)&&!o?(p.error(`Cannot find public key ${i} or as keyData option or in ${n.path}`),A.error("")):(0,sn.existsSync)(i)&&(o=(0,sn.readFileSync)(i).toString());let s=(0,sn.readFileSync)(t),a=wN(s,e,r.keyData??o??"");(0,sn.writeFileSync)(`${t}_decrypted.zip`,a),X(`Decrypted zip file at ${t}_decrypted.zip`),(0,_N.exit)()}var an=require("node:fs"),FN=require("node:process");var ON=le(vu());var To=require("node:buffer"),At=require("node:crypto"),CN="aes-128-cbc",wi="base64",rp=At.constants.RSA_PKCS1_PADDING;function SN(t,e,r){let[n,i]=e.split(":"),o=(0,At.publicDecrypt)({key:r,padding:rp},To.Buffer.from(i,wi)),s=To.Buffer.from(n,wi),a=(0,At.createDecipheriv)(CN,o,s);return a.setAutoPadding(!0),To.Buffer.concat([a.update(t),a.final()])}function np(t,e){return(0,At.privateEncrypt)({key:e,padding:rp},To.Buffer.from(t,wi)).toString(wi)}function xN(t,e){return(0,At.publicDecrypt)({key:e,padding:rp},To.Buffer.from(t,wi)).toString(wi)}function ip(t,e){let r=(0,At.randomBytes)(16),n=(0,At.randomBytes)(16),i=(0,At.createCipheriv)(CN,n,r);i.setAutoPadding(!0);let o=r.toString(wi),s=(0,At.privateEncrypt)({key:e,padding:rp},n).toString(wi),a=`${o}:${s}`;return{encryptedData:To.Buffer.concat([i.update(t),i.final()]),ivSessionKey:a}}async function AN(t,e,r){Y("Decrypt zip file"),await ye(),(0,an.existsSync)(t)||(p.error(`Zip not found at the path ${t}`),A.error(""));let n=await ee();!r.key&&!(0,an.existsSync)(jn)&&!n.config.plugins?.CapacitorUpdater?.privateKey&&(p.error(`Private Key not found at the path ${jn} or in ${n.path}`),A.error(""));let i=r.key||jn,o=n.config.plugins?.CapacitorUpdater?.publicKey;!(0,an.existsSync)(i)&&!o?(p.error(`Cannot find public key ${i} or as keyData option or in ${n.path}`),A.error("")):(0,an.existsSync)(i)&&(o=(0,an.readFileSync)(i).toString());let s=(0,an.readFileSync)(t),a=SN(s,e,r.keyData??o??"");if((0,an.writeFileSync)(`${t}_decrypted.zip`,a),p.info(`Decrypted zip file at ${t}_decrypted.zip`),r.checksum){let u=await(0,ON.checksum)(a,"sha256"),c=xN(r.checksum,r.keyData??o??"");u!==c?(p.error(`Checksum does not match ${u} !== ${c}`),A.error("")):p.info("Checksum matches")}X("\u2705 done"),(0,FN.exit)()}var kN=require("node:process");async function TN(t,e,r){Y("Delete bundle"),r.apikey=r.apikey||pe();let n=await ee();e=e||n?.config?.appId,r.apikey||(p.error("Missing API key, you need to provide a API key to upload your bundle"),A.error("")),e||(p.error("Missing argument, you need to provide a appId, or be in a capacitor project"),A.error(""));let i=await de(r.apikey);await me(i,r.apikey,["write","all"]),await qe(i,r.apikey,e,3),r.apikey||(p.error("Missing API key, you need to provide an API key to delete your app"),A.error("")),t||(p.error("Missing argument, you need to provide a bundleId, or be in a capacitor project"),A.error("")),e||(p.error("Missing argument, you need to provide a appId, or be in a capacitor project"),A.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 Jh(i,e,t),p.success(`Bundle ${e}@${t} deleted in Capgo`),X("Done"),(0,kN.exit)()}var _i=require("node:fs"),PN=require("node:process");async function RN(t,e){Y("Encryption"),await ye(),(0,_i.existsSync)(t)||(p.error(`Error: Zip not found at the path ${t}`),A.error(""));let r=e.key||cr,n=e.keyData||"";(0,_i.existsSync)(r)&&(n=(0,_i.readFileSync)(r).toString());let i=(0,_i.readFileSync)(t),o=ep(i,n);p.success(`ivSessionKey: ${o.ivSessionKey}`),(0,_i.writeFileSync)(`${t}_encrypted.zip`,o.encryptedData),p.success(`Encrypted zip saved at ${t}_encrypted.zip`),X("Done \u2705"),(0,PN.exit)()}var qn=require("node:fs"),$N=require("node:process");async function IN(t,e,r){let{json:n}=r;n||(Y("Encryption"),await ye());let i=await ee(),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,qn.existsSync)(t)||(n?console.error(Q({error:"zip_not_found"})):p.error(`Error: Zip not found at the path ${t}`),A.error("")),s||(n?console.error(Q({error:"missing_public_key"})):p.warning("Warning: Missing Public Key in config"),A.error(""));let a=r.key||ur,u=r.keyData||"";!(0,qn.existsSync)(a)&&!u?(n?console.error(Q({error:"missing_key"})):(p.warning(`Cannot find a private key at ${a} or as a keyData option`),p.error("Error: Missing key")),A.error("")):(0,qn.existsSync)(a)&&(u=(0,qn.readFileSync)(a).toString()),u&&!u.startsWith("-----BEGIN RSA PRIVATE KEY-----")&&(n?console.error(Q({error:"invalid_private_key"})):p.error("the private key provided is not a valid RSA Private key"),A.error(""));let c=(0,qn.readFileSync)(t),l=ip(c,u),f=np(e,u),h=`${t}_encrypted.zip`;n?console.log(JSON.stringify({checksum:f,filename:h,ivSessionKey:l.ivSessionKey},null,2)):(p.success(`Encoded Checksum: ${f}`),p.success(`ivSessionKey: ${l.ivSessionKey}`)),(0,qn.writeFileSync)(h,l.encryptedData),n||(p.success(`Encrypted zip saved at ${h}`),X("Done \u2705")),(0,$N.exit)()}var jN=require("node:process");async function NN(t,e){Y("List bundles"),await ye(),e.apikey=e.apikey||pe();let r=await ee();t=t||r?.config?.appId,e.apikey||(p.error("Missing API key, you need to provide a API key to upload your bundle"),A.error("")),t||(p.error("Missing argument, you need to provide a appid, or be in a capacitor project"),A.error(""));let n=await de(e.apikey);await me(n,e.apikey,["write","all","read","upload"]),p.info(`Querying available versions of: ${t} in Capgo`),await qe(n,e.apikey,t,1);let i=await Zh(n,t);p.info(`Active versions in Capgo: ${i?.length}`),Xh(i),X("Done \u2705"),(0,jN.exit)()}var tL=require("node:crypto"),cn=require("node:fs"),rL=require("node:process");function Hc(t,e,r=0){r=Math.max(0,Math.min(r,e.byteLength));let n=e.byteLength-r;return t.byteLength>n&&(t=t.subarray(0,n)),e.set(t,r),t.byteLength}var op=32*1024,Ib=2**32-2,sp=class{#e;#t=0;constructor(e){this.#e=e===void 0?new Uint8Array(0):new Uint8Array(e)}bytes(e={copy:!0}){return e.copy===!1?this.#e.subarray(this.#t):this.#e.slice(this.#t)}empty(){return this.#e.byteLength<=this.#t}get length(){return this.#e.byteLength-this.#t}get capacity(){return this.#e.buffer.byteLength}truncate(e){if(e===0){this.reset();return}if(e<0||e>this.length)throw Error("bytes.Buffer: truncation out of range");this.#r(this.#t+e)}reset(){this.#r(0),this.#t=0}#i(e){let r=this.#e.byteLength;return e<=this.capacity-r?(this.#r(r+e),r):-1}#r(e){if(e>this.#e.buffer.byteLength)throw new RangeError("Length is greater than buffer capacity");this.#e=new Uint8Array(this.#e.buffer,0,e)}readSync(e){if(this.empty())return this.reset(),e.byteLength===0?0:null;let r=Hc(this.#e.subarray(this.#t),e);return this.#t+=r,r}read(e){let r=this.readSync(e);return Promise.resolve(r)}writeSync(e){let r=this.#n(e.byteLength);return Hc(e,this.#e,r)}write(e){let r=this.writeSync(e);return Promise.resolve(r)}#n(e){let r=this.length;r===0&&this.#t!==0&&this.reset();let n=this.#i(e);if(n>=0)return n;let i=this.capacity;if(e<=Math.floor(i/2)-r)Hc(this.#e.subarray(this.#t),this.#e);else{if(i+e>Ib)throw new Error("The buffer cannot be grown beyond the maximum size.");{let o=new Uint8Array(Math.min(2*i+e,Ib));Hc(this.#e.subarray(this.#t),o),this.#e=o}}return this.#t=0,this.#r(Math.min(r+e,Ib)),r}grow(e){if(e<0)throw Error("Buffer.grow: negative count");let r=this.#n(e);this.#r(r)}async readFrom(e){let r=0,n=new Uint8Array(op);for(;;){let i=this.capacity-this.length<op,o=i?n:new Uint8Array(this.#e.buffer,this.length),s=await e.read(o);if(s===null)return r;i?this.writeSync(o.subarray(0,s)):this.#r(this.length+s),r+=s}}readFromSync(e){let r=0,n=new Uint8Array(op);for(;;){let i=this.capacity-this.length<op,o=i?n:new Uint8Array(this.#e.buffer,this.length),s=e.readSync(o);if(s===null)return r;i?this.writeSync(o.subarray(0,s)):this.#r(this.length+s),r+=s}}};var ap=class extends TransformStream{constructor(e){let r=new sp;r.grow(e),super({start(){},async transform(n,i){for(r.write(n);r.length>=e;){let o=new Uint8Array(e),s=await r.read(o);if(s!==e)throw new Error(`Unexpectedly read ${s} bytes from transform buffer when trying to read ${e} bytes.`);i.enqueue(o)}},flush(n){r.length&&n.enqueue(r.bytes())}})}};function Ei(t){return t=t.trim(),t=t.replace(/<!--[\s\S]*?-->/g,""),e();function e(){return{declaration:r(),root:n()}}function r(){if(!u(/^<\?xml\s*/))return;let h={attributes:{}};for(;!(c()||l("?>"));){let d=o();if(!d)return h;h.attributes[d.name]=d.value}return u(/\?>\s*/),h}function n(){let f=u(/^<([\w-:.]+)\s*/);if(!f)return;let h={name:f[1],attributes:{},children:[]};for(;!(c()||l(">")||l("?>")||l("/>"));){let 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("&lt;","<").replaceAll("&gt;",">").replaceAll("&amp;","&")}function u(f){let h=t.match(f);if(h)return t=t.slice(h[0].length),h}function c(){return t.length==0}function l(f){return t.indexOf(f)==0}}var un=class extends Error{constructor(e){super(e)}};var Or=class extends un{},up=class extends un{},cp=class extends un{},Mn=class extends un{},Po=class extends un{},zc=class extends un{},Gc=class extends un{},Un=class extends un{statusCode;code;key;bucketName;resource;region;constructor(e,r,n,i={}){super(n),this.statusCode=e,this.code=r,this.key=i.key,this.bucketName=i.bucketName,this.resource=i.resource,this.region=i.region}};async function LN(t){try{let r=Ei(await t.text()).root;if(r?.name!=="Error")throw new Error("Invalid root, expected <Error>");let n=r.children.find(c=>c.name==="Code")?.content??"UnknownErrorCode",i=r.children.find(c=>c.name==="Message")?.content??"The error message could not be determined.",o=r.children.find(c=>c.name==="Key")?.content,s=r.children.find(c=>c.name==="BucketName")?.content,a=r.children.find(c=>c.name==="Resource")?.content,u=r.children.find(c=>c.name==="Region")?.content;return new Un(t.status,n,i,{key:o,bucketName:s,resource:a,region:u})}catch{return new Un(t.status,"UnrecognizedError",`Error: Unexpected response code ${t.status} ${t.statusText}. Unable to parse response as XML.`)}}function BN(t){return typeof t!="number"||isNaN(t)||t<=0?!1:t>=1&&t<=65535}function qN(t){return typeof t!="string"||t.length<3||t.length>63||t.indexOf("..")>-1||t.match(/[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+/)?!1:!!t.match(/^[a-z0-9][a-z0-9.-]+[a-z0-9]$/)}function Ro(t){return!(!Mae(t)||t.length===0)}function Mae(t){return!(typeof t!="string"||t.length>1024)}function lp(t){return Array.from(t).map(e=>e.toString(16).padStart(2,"0")).join("")}function $o(t=""){let e={'"':"","&quot;":"","&#34;":"","&QUOT;":"","&#x00022":""};return t.replace(/^("|&quot;|&#34;)|("|&quot;|&#34;)$/g,r=>e[r])}function Nb(t){return t.get("x-amz-version-id")??null}function Wc(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 Lb(t){t=t||new Date;let e=t.toISOString();return e.substr(0,4)+e.substr(5,2)+e.substr(8,2)}function Bb(t,e){return`${Lb(e)}/${t}/s3/aws4_request`}async function fp(t){return t instanceof Uint8Array||(t=new TextEncoder().encode(t)),lp(new Uint8Array(await crypto.subtle.digest("SHA-256",t)))}var Uae=["x-amz-server-side-encryption-customer-algorithm","x-amz-server-side-encryption-customer-key","x-amz-server-side-encryption-customer-key-MD5"],dp=class extends WritableStream{getResult;constructor({client:e,bucketName:r,objectName:n,partSize:i,metadata:o}){let s,a=1,u,c=[],l=[];super({start(){},async write(f,h){let d="PUT",m=a++;try{if(m==1&&f.length<i){let w=await e.makeRequest({method:d,headers:new Headers({...o,"Content-Length":String(f.length)}),bucketName:r,objectName:n,payload:f});s={etag:$o(w.headers.get("etag")??void 0),versionId:Nb(w.headers)};return}m===1&&(u=(await Vae({client:e,bucketName:r,objectName:n,metadata:o})).uploadId);let b={"Content-Length":String(f.length)};for(let w of Uae){let x=o[w];x&&(b[w]=x)}let g=e.makeRequest({method:d,query:{partNumber:m.toString(),uploadId:u},headers:new Headers(b),bucketName:r,objectName:n,payload:f});g.then(w=>{let x=w.headers.get("etag")??"";x&&(x=x.replace(/^"/,"").replace(/"$/,"")),c.push({part:m,etag:x})}),l.push(g)}catch(b){throw b}},async close(){if(!s)if(u)await Promise.all(l),c.sort((f,h)=>f.part>h.part?1:-1),s=await Hae({client:e,bucketName:r,objectName:n,uploadId:u,etags:c});else throw new Error("Stream was closed without uploading any data.")}}),this.getResult=()=>{if(s===void 0)throw new Error("Result is not ready. await the stream first.");return s}}};async function Vae(t){let e="POST",r=new Headers(t.metadata),o=await(await t.client.makeRequest({method:e,bucketName:t.bucketName,objectName:t.objectName,query:"uploads",headers:r,returnBody:!0})).text(),s=Ei(o).root;if(!s||s.name!=="InitiateMultipartUploadResult")throw new Error(`Unexpected response: ${o}`);let a=s.children.find(u=>u.name==="UploadId")?.content;if(!a)throw new Error(`Unable to get UploadId from response: ${o}`);return{uploadId:a}}async function Hae({client:t,bucketName:e,objectName:r,uploadId:n,etags:i}){let o=`
276
276
  <CompleteMultipartUpload xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
277
277
  ${i.map(f=>` <Part><PartNumber>${f.part}</PartNumber><ETag>${f.etag}</ETag></Part>`).join(`
278
278
  `)}
279
279
  </CompleteMultipartUpload>
280
- `,s=await t.makeRequest({method:"POST",bucketName:e,objectName:r,query:`uploadId=${encodeURIComponent(n)}`,payload:new TextEncoder().encode(o),returnBody:!0}),a=await s.text(),u=Ei(a).root;if(!u||u.name!=="CompleteMultipartUploadResult")throw new Error(`Unexpected response: ${a}`);let c=u.children.find(f=>f.name==="ETag")?.content;if(!c)throw new Error(`Unable to get ETag from response: ${a}`);let l=Lb(s.headers);return{etag:$o(c),versionId:l}}var Mb="AWS4-HMAC-SHA256";async function MN(t){if(!t.accessKey)throw new Po("accessKey is required for signing");if(!t.secretKey)throw new zc("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=VN(t.headers),n=HN(t.method,t.path,t.headers,r,e),i=await zN(n,t.date,t.region),o=await GN(t.date,t.region,t.secretKey),s=WN(t.accessKey,t.region,t.date),a=lp(await Ta(o,i)).toLowerCase();return`${Mb} Credential=${s}, SignedHeaders=${r.join(";").toLowerCase()}, Signature=${a}`}async function UN(t){if(!t.accessKey)throw new Po("accessKey is required for signing");if(!t.secretKey)throw new zc("secretKey is required for signing");if(t.expirySeconds<1)throw new Gc("expirySeconds cannot be less than 1 seconds");if(t.expirySeconds>604800)throw new Gc("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=Wc(t.date),i=VN(t.headers),o=WN(t.accessKey,t.region,t.date),s="UNSIGNED-PAYLOAD",a=new URLSearchParams(r);a.set("X-Amz-Algorithm",Mb),a.set("X-Amz-Credential",o),a.set("X-Amz-Date",n),a.set("X-Amz-Expires",t.expirySeconds.toString()),a.set("X-Amz-SignedHeaders",i.join(";").toLowerCase());let u=e+"?"+a.toString().replace("+","%20"),c=HN(t.method,u,t.headers,i,s),l=await zN(c,t.date,t.region),f=await GN(t.date,t.region,t.secretKey),h=lp(await Ta(f,l)).toLowerCase();return`${t.protocol}//${t.headers.get("Host")}${u}&X-Amz-Signature=${h}`}function VN(t){let e=["authorization","content-length","content-type","user-agent"],r=[];for(let n of t.keys())e.includes(n.toLowerCase())||r.push(n);return r.sort(),r}var Io={A:65,Z:90,a:97,z:122,0:48,9:57,"/":47},zae="-._~".split("").map(t=>t.charCodeAt(0));function Gae(t,e=!1){let r=new TextEncoder().encode(t),n="";for(let i of r)i>=Io.A&&i<=Io.Z||i>=Io.a&&i<=Io.z||i>=Io[0]&&i<=Io[9]||zae.includes(i)||i==Io["/"]&&e?n+=String.fromCharCode(i):n+="%"+i.toString(16).padStart(2,"0").toUpperCase();return n}function HN(t,e,r,n,i){let o=n.reduce((c,l)=>{let f=`${r.get(l)}`.replace(/ +/g," ");return c.push(`${l.toLowerCase()}:${f}`),c},[]),s=e.split("?")[0],a=e.split("?")[1];a?a=a.split("&").sort().map(c=>c.indexOf("=")===-1?c+"=":c).join("&"):a="";let u=[];return u.push(t.toUpperCase()),u.push(Gae(s,!0)),u.push(a),u.push(o.join(`
280
+ `,s=await t.makeRequest({method:"POST",bucketName:e,objectName:r,query:`uploadId=${encodeURIComponent(n)}`,payload:new TextEncoder().encode(o),returnBody:!0}),a=await s.text(),u=Ei(a).root;if(!u||u.name!=="CompleteMultipartUploadResult")throw new Error(`Unexpected response: ${a}`);let c=u.children.find(f=>f.name==="ETag")?.content;if(!c)throw new Error(`Unable to get ETag from response: ${a}`);let l=Nb(s.headers);return{etag:$o(c),versionId:l}}var qb="AWS4-HMAC-SHA256";async function MN(t){if(!t.accessKey)throw new Po("accessKey is required for signing");if(!t.secretKey)throw new zc("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=VN(t.headers),n=HN(t.method,t.path,t.headers,r,e),i=await zN(n,t.date,t.region),o=await GN(t.date,t.region,t.secretKey),s=WN(t.accessKey,t.region,t.date),a=lp(await Ta(o,i)).toLowerCase();return`${qb} Credential=${s}, SignedHeaders=${r.join(";").toLowerCase()}, Signature=${a}`}async function UN(t){if(!t.accessKey)throw new Po("accessKey is required for signing");if(!t.secretKey)throw new zc("secretKey is required for signing");if(t.expirySeconds<1)throw new Gc("expirySeconds cannot be less than 1 seconds");if(t.expirySeconds>604800)throw new Gc("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=Wc(t.date),i=VN(t.headers),o=WN(t.accessKey,t.region,t.date),s="UNSIGNED-PAYLOAD",a=new URLSearchParams(r);a.set("X-Amz-Algorithm",qb),a.set("X-Amz-Credential",o),a.set("X-Amz-Date",n),a.set("X-Amz-Expires",t.expirySeconds.toString()),a.set("X-Amz-SignedHeaders",i.join(";").toLowerCase());let u=e+"?"+a.toString().replace("+","%20"),c=HN(t.method,u,t.headers,i,s),l=await zN(c,t.date,t.region),f=await GN(t.date,t.region,t.secretKey),h=lp(await Ta(f,l)).toLowerCase();return`${t.protocol}//${t.headers.get("Host")}${u}&X-Amz-Signature=${h}`}function VN(t){let e=["authorization","content-length","content-type","user-agent"],r=[];for(let n of t.keys())e.includes(n.toLowerCase())||r.push(n);return r.sort(),r}var Io={A:65,Z:90,a:97,z:122,0:48,9:57,"/":47},zae="-._~".split("").map(t=>t.charCodeAt(0));function Gae(t,e=!1){let r=new TextEncoder().encode(t),n="";for(let i of r)i>=Io.A&&i<=Io.Z||i>=Io.a&&i<=Io.z||i>=Io[0]&&i<=Io[9]||zae.includes(i)||i==Io["/"]&&e?n+=String.fromCharCode(i):n+="%"+i.toString(16).padStart(2,"0").toUpperCase();return n}function HN(t,e,r,n,i){let o=n.reduce((c,l)=>{let f=`${r.get(l)}`.replace(/ +/g," ");return c.push(`${l.toLowerCase()}:${f}`),c},[]),s=e.split("?")[0],a=e.split("?")[1];a?a=a.split("&").sort().map(c=>c.indexOf("=")===-1?c+"=":c).join("&"):a="";let u=[];return u.push(t.toUpperCase()),u.push(Gae(s,!0)),u.push(a),u.push(o.join(`
281
281
  `)+`
282
282
  `),u.push(n.join(";").toLowerCase()),u.push(i),u.join(`
283
- `)}async function zN(t,e,r){let n=await fp(t),i=qb(r,e),o=[];return o.push(Mb),o.push(Wc(e)),o.push(i),o.push(n),o.join(`
284
- `)}async function GN(t,e,r){let n=Bb(t),i=await Ta("AWS4"+r,n),o=await Ta(i,e),s=await Ta(o,"s3");return await Ta(s,"aws4_request")}function WN(t,e,r){return`${t}/${qb(e,r)}`}async function Ta(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 Wae=["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"],Kae=5*1024*1024,Yae=5*1024*1024*1024,Ub=5*1024*1024*1024*1024,Kc=class{host;port;protocol;accessKey;#e;sessionToken;defaultBucket;region;userAgent="s3-lite-client";pathStyle;constructor(e){if(e.useSSL===void 0&&(e.useSSL=!0),typeof e.endPoint!="string"||e.endPoint.length===0||e.endPoint.indexOf("/")!==-1)throw new up(`Invalid endPoint : ${e.endPoint}`);if(e.port!==void 0&&!BN(e.port))throw new Or(`Invalid port : ${e.port}`);if(e.accessKey&&!e.secretKey)throw new Or("If specifying access key, secret key must also be provided.");if(e.accessKey&&e.accessKey.startsWith("ASIA")&&!e.sessionToken)throw new Or("If specifying temporary access key, session token must also be provided.");let r=e.useSSL?443:80;this.port=e.port??r,this.host=e.endPoint.toLowerCase()+(this.port!==r?`:${e.port}`:""),this.protocol=e.useSSL?"https:":"http:",this.accessKey=e.accessKey,this.#e=e.secretKey??"",this.sessionToken=e.sessionToken,this.pathStyle=e.pathStyle??!0,this.defaultBucket=e.bucket,this.region=e.region}getBucketName(e){let r=e?.bucketName??this.defaultBucket;if(r===void 0||!qN(r))throw new cp(`Invalid bucket name: ${r}`);return r}buildRequestOptions(e){let r=this.getBucketName(e),n=this.pathStyle?this.host:`${r}.${this.host}`,i=e.headers??new Headers;i.set("host",n);let o=typeof e.query=="object"?new URLSearchParams(e.query).toString().replace("+","%20"):e.query,s=(this.pathStyle?`/${r}/${e.objectName}`:`/${e.objectName}`)+(o?`?${o}`:"");return{headers:i,host:n,path:s}}async makeRequest({method:e,payload:r,...n}){let i=new Date,{headers:o,host:s,path:a}=this.buildRequestOptions(n),u=n.statusCode??200;if(e==="POST"||e==="PUT"||e==="DELETE")r===void 0?r=new Uint8Array:typeof r=="string"&&(r=new TextEncoder().encode(r)),o.set("Content-Length",String(r.length));else if(r)throw new Error(`Unexpected payload on ${e} request.`);let c=await fp(r??new Uint8Array);o.set("x-amz-date",Wc(i)),o.set("x-amz-content-sha256",c),this.accessKey&&(this.sessionToken&&o.set("x-amz-security-token",this.sessionToken),o.set("authorization",await MN({headers:o,method:e,path:a,accessKey:this.accessKey,secretKey:this.#e,region:this.region,date:i})));let l=`${this.protocol}//${s}${a}`,f=await fetch(l,{method:e,headers:o,body:r});if(f.status!==u)throw f.status>=400?await LN(f):f.status===301?new Un(f.status,"UnexpectedRedirect",'The server unexpectedly returned a redirect response. With AWS S3, this usually means you need to use a region-specific endpoint like "s3.us-west-2.amazonaws.com" instead of "s3.amazonaws.com"'):new Un(f.status,"UnexpectedStatusCode",`Unexpected response code from the server (expected ${u}, got ${f.status} ${f.statusText}).`);return n.returnBody||await f.body?.getReader().read(),f}async deleteObject(e,r={}){let n=this.getBucketName(r);if(!Ro(e))throw new Mn(`Invalid object name: ${e}`);let i=r.versionId?{versionId:r.versionId}:{},o=new Headers;r.governanceBypass&&o.set("X-Amz-Bypass-Governance-Retention","true"),await this.makeRequest({method:"DELETE",bucketName:n,objectName:e,headers:o,query:i,statusCode:204})}async exists(e,r){try{return await this.statObject(e,r),!0}catch(n){if(n instanceof Un&&n.statusCode===404)return!1;throw n}}getObject(e,r){return this.getPartialObject(e,{...r,offset:0,length:0})}async getPartialObject(e,{offset:r,length:n,...i}){let o=this.getBucketName(i);if(!Ro(e))throw new Mn(`Invalid object name: ${e}`);let s=new Headers(Object.entries(i.metadata??{})),a=200;if(r||n){let c="";r?c=`bytes=${+r}-`:(c="bytes=0-",r=0),n&&(c+=`${+n+r-1}`),s.set("Range",c),a=206}let u={...i.responseParams,...i.versionId?{versionId:i.versionId}:{}};return await this.makeRequest({method:"GET",bucketName:o,objectName:e,headers:s,query:u,statusCode:a,returnBody:!0})}getPresignedUrl(e,r,n={}){if(!this.accessKey)throw new Po(`Presigned ${e} URLs cannot be generated for anonymous requests. Specify an accessKey and secretKey.`);if(!Ro(r))throw new Mn(`Invalid object name: ${r}`);let{headers:i,path:o}=this.buildRequestOptions({objectName:r,bucketName:n.bucketName,query:n.parameters}),s=n.requestDate??new Date,a=n.expirySeconds??24*60*60*7;return UN({protocol:this.protocol,headers:i,method:e,path:o,accessKey:this.accessKey,secretKey:this.#e,region:this.region,date:s,expirySeconds:a})}presignedGetObject(e,r={}){let{versionId:n,responseParams:i,...o}=r,s={...i,...n?{versionId:n}:{}};return this.getPresignedUrl("GET",e,{parameters:s,...o})}async*listObjects(e={}){for await(let r of this.listObjectsGrouped({...e,delimiter:""}))if(r.type==="Object")yield r;else throw new Error(`Unexpected result from listObjectsGrouped(): ${r}`)}async*listObjectsGrouped(e){let r=this.getBucketName(e),n="",i=e.pageSize??1e3;if(i<1||i>1e3)throw new Or("pageSize must be between 1 and 1,000.");let o=0;for(;;){let s=e.maxResults?Math.min(i,e.maxResults-o):i;if(s===0)return;let u=await(await this.makeRequest({method:"GET",bucketName:r,objectName:"",query:{"list-type":"2",prefix:e.prefix??"",delimiter:e.delimiter,"max-keys":String(s),...n?{"continuation-token":n}:{}},returnBody:!0})).text(),c=Ei(u).root;if(!c||c.name!=="ListBucketResult")throw new Error(`Unexpected response: ${u}`);let l=c.children.filter(d=>d.name==="CommonPrefixes").flatMap(d=>d.children),f=[];for(let d of l)f.push({type:"CommonPrefix",prefix:d.content??""}),o++;for(let d of c.children.filter(m=>m.name==="Contents"))f.push({type:"Object",key:d.children.find(m=>m.name==="Key")?.content??"",etag:$o(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,g=m.type==="Object"?m.key:m.prefix;return b>g?1:b<g?-1:0});for(let d of f)yield d;if(c.children.find(d=>d.name==="IsTruncated")?.content==="true"){let d=c.children.find(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(!Ro(e))throw new Mn(`Invalid object name: ${e}`);let o,s;if(typeof r=="string"){let l=new TextEncoder().encode(r);typeof ReadableStream.from<"u"?s=ReadableStream.from([l]):s=new ReadableStream({start(f){f.enqueue(l),f.close()}}),o=l.length}else if(r instanceof Uint8Array)typeof ReadableStream.from<"u"?s=ReadableStream.from([r]):s=new ReadableStream({start(l){l.enqueue(r),l.close()}}),o=r.byteLength;else if(r instanceof ReadableStream)s=r;else throw new Or("Invalid stream/data type provided.");if(n?.size!==void 0){if(o!==void 0&&n?.size!==o)throw new Or(`size was specified (${n.size}) but doesn't match auto-detected size (${o}).`);if(typeof n.size!="number"||n.size<0||isNaN(n.size))throw new Or(`invalid size specified: ${n.size}`);o=n.size}let a=n?.partSize??this.calculatePartSize(o);if(a<Kae)throw new Or("Part size should be greater than 5MB");if(a>Yae)throw new Or("Part size should be less than 6MB");let u=new ap(a),c=new dp({client:this,bucketName:i,objectName:e,partSize:a,metadata:n?.metadata??{}});return await s.pipeThrough(u).pipeTo(c),c.getResult()}calculatePartSize(e){if(e===void 0&&(e=Ub),e>Ub)throw new TypeError(`size should not be more than ${Ub}`);let r=64*1024*1024;for(;;){if(r*1e4>e)return r;r+=16*1024*1024}}async statObject(e,r){let n=this.getBucketName(r);if(!Ro(e))throw new Mn(`Invalid object name: ${e}`);let i={};r?.versionId&&(i.versionId=r.versionId);let o=await this.makeRequest({method:"HEAD",bucketName:n,objectName:e,query:i}),s={};for(let a of Wae)o.headers.has(a)&&(s[a]=o.headers.get(a));return o.headers.forEach((a,u)=>{u.startsWith("x-amz-meta-")&&(s[u]=o.headers.get(u))}),{type:"Object",key:e,size:parseInt(o.headers.get("content-length")??"",10),metadata:s,lastModified:new Date(o.headers.get("Last-Modified")??"error: missing last modified"),versionId:o.headers.get("x-amz-version-id")||null,etag:$o(o.headers.get("ETag")??"")}}async copyObject(e,r,n){let i=this.getBucketName(n),o=e.sourceBucketName??i;if(!Ro(r))throw new Mn(`Invalid object name: ${r}`);let s=`${o}/${e.sourceKey}`;e.sourceVersionId&&(s+=`?versionId=${e.sourceVersionId}`);let a=new Headers(n?.metadata);n?.metadata!==void 0&&a.set("x-amz-metadata-directive","REPLACE"),a.set("x-amz-copy-source",s);let u=await this.makeRequest({method:"PUT",bucketName:i,objectName:r,headers:a,returnBody:!0}),c=await u.text(),l=Ei(c).root;if(!l||l.name!=="CopyObjectResult")throw new Error(`Unexpected response: ${c}`);let f=l.children.find(d=>d.name==="ETag")?.content??"",h=l.children.find(d=>d.name==="LastModified")?.content;if(h===void 0)throw new Error("Unable to find <LastModified>...</LastModified> from the server.");return{copySourceVersionId:u.headers.get("x-amz-copy-source-version-id")||null,etag:$o(f),lastModified:new Date(h),versionId:u.headers.get("x-amz-version-id")||null}}async bucketExists(e){try{return await this.listObjects({bucketName:e}).next(),!0}catch(r){if(r instanceof Un&&r.statusCode===404)return!1;throw r}}async makeBucket(e){await this.makeRequest({method:"PUT",bucketName:this.getBucketName({bucketName:e}),objectName:"",statusCode:200})}async removeBucket(e){await this.makeRequest({method:"DELETE",bucketName:this.getBucketName({bucketName:e}),objectName:"",statusCode:204})}};var Vb=le(vu());var Ci=require("node:fs"),Yc=require("node:path");function Jae(t,e){return(0,Ci.readFileSync)(t,"utf8").includes(e)}function Jc(t,e){let r=(0,Ci.readdirSync)(t);for(let n of r){let i=(0,Yc.join)(t,n),o=(0,Ci.statSync)(i);if(o.isDirectory()){if(Jc(i,e))return!0}else if(o.isFile()&&(0,Yc.extname)(i)===".js"&&Jae(i,e))return!0}return!1}function Xc(t){let e=(0,Ci.readdirSync)(t);if(e.length===1){let n=(0,Yc.join)(t,e[0]);if((0,Ci.statSync)(n).isDirectory())return Xc(n)}return e.indexOf("index.html")>-1}var KN=require("node:fs"),YN=require("node:path"),JN=require("node:stream/consumers"),XN=require("node:zlib");var ZN=le(eD());async function QN(t,e,r,n){let i=ve();i.start("Generating the update manifest");let o=await aj(t);return i.stop("Manifest generated successfully"),await xe(e,{channel:"partial-update",event:"Generate manifest",icon:"\u{1F4C2}",user_id:r,tags:{"app-id":n},notify:!1}),o}async function eL(t,e,r,n,i,o){let s=ve();s.start("Preparing partial update with TUS protocol");let a=performance.now(),u=await Cr(),c=0,l=e.length,f=e.map(async h=>{let d=(0,YN.join)(r,h.file),m=(0,KN.createReadStream)(d).pipe((0,XN.createBrotliCompress)()),b=await(0,JN.buffer)(m);return new Promise((g,w)=>{new ZN.Upload(b,{endpoint:`${u.hostFilesApi}/files/upload/attachments/`,metadata:{filename:`orgs/${o}/apps/${n}/${i}/${h.file}`},headers:{Authorization:t},onError(D){p.info(`Failed to upload ${h.file}: ${D}`),w(D)},onProgress(){let D=(c/l*100).toFixed(2);s.message(`Uploading partial update: ${D}%`)},onSuccess(){c++,g({file_name:h.file,s3_path:`orgs/${o}/apps/${n}/${i}/${h.file}`,file_hash:h.hash})}}).start()})});try{let h=await Promise.all(f),m=((performance.now()-a)/1e3).toFixed(2);return s.stop(`Partial update uploaded successfully \u{1F4AA} in (${m} seconds)`),await xe(t,{channel:"app",event:"App Partial TUS done",icon:"\u23EB",user_id:o,tags:{"app-id":n},notify:!1}),await xe(t,{channel:"performance",event:"Partial upload performance",icon:"\u{1F684}",user_id:o,tags:{"app-id":n,time:m},notify:!1}),h}catch(h){let m=((performance.now()-a)/1e3).toFixed(2);return s.stop(`Failed to upload Partial bundle ( after ${m} seconds)`),p.info(`Error uploading partial update: ${h}, This is not a critical error, the bundle has been uploaded without the partial files`),null}}async function Xae(t,e){let r=await jt("",e.packageJson),n=e.bundle||t?.plugins?.CapacitorUpdater?.version||r?.version||`0.0.1-beta.${(0,tL.randomUUID)().split("-")[0]}`;return fa.test(n)||(p.error(`Your bundle name ${n}, is not valid it should follow semver convention : https://semver.org/`),A.error("")),n}function Zae(t){let e=t.apikey||pe();return e||(p.error("Missing API key, you need to provide a API key to upload your bundle"),A.error("")),e}function Qae(t,e,r){let n=t||r?.plugins?.CapacitorUpdater?.appId||r?.appId,i=e.path||r?.webDir;return n||(p.error("Missing argument, you need to provide a appid or be in a capacitor project"),A.error("")),i||(p.error("Missing argument, you need to provide a path (--path), or be in a capacitor project"),A.error("")),(0,cn.existsSync)(i)||(p.error(`Path ${i} does not exist, build your app first, or provide a valid path`),A.error("")),{appid:n,path:i}}function eue(t,e){let r=t.codeCheck;(typeof r>"u"||r)&&(Jc(e,"notifyAppReady")||(p.error("notifyAppReady() is missing in the source code. see: https://capgo.app/docs/plugin/api/#notifyappready"),A.error("")),Xc(e)||(p.error("index.html is missing in the root folder or in the only folder in the root folder"),A.error("")))}async function tue(t,e,r,n,i,o){let s=r.ignoreMetadataCheck,a=r.autoMinUpdateVersion,u=r.minUpdateVersion,{data:c,error:l}=await t.from("channels").select("disable_auto_update, version ( min_update_version, native_packages )").eq("name",n).eq("app_id",i).single(),f=!!c&&c.disable_auto_update==="version_number",h,d;if(!l&&c&&c.version&&c.version.native_packages&&!s){let g=ve();g.start(`Checking bundle compatibility with channel ${n}`);let{finalCompatibility:w,localDependencies:x}=await Rh(t,i,n,r.packageJson);if(d=w,h=x,d.find(D=>D.localVersion!==D.remoteVersion))g.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:D}=c.version;(!D||!fa.test(D))&&(p.error("Invalid remote min update version, skipping auto setting compatibility"),A.error("")),u=D,g.stop(`Auto set min-update-version to ${u}`)}catch{p.error(`Cannot auto set compatibility, invalid data ${c}`),A.error("")}else g.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 ib(r.packageJson),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"),A.error("")),u&&(fa.test(u)||(p.error(`Your minimal version update ${u}, is not valid it should follow semver convention : https://semver.org/`),A.error("")));let m=h?new Map(h.filter(g=>!!g.native&&g.native!==void 0).map(g=>[g.name,g])):new Map;return{nativePackages:m.size>0||!r.ignoreMetadataCheck?Array.from(m,([g,w])=>({name:g,version:w.version})):void 0,minUpdateVersion:u}}async function rue(t,e,r){let{data:n,error:i}=await t.rpc("is_trial_org",{orgid:e}).single();(n&&n>0||i)&&(p.warn(`WARNING !!
285
- Trial expires in ${n} days`),p.warn(`Upgrade here: ${r.hostWeb}/dashboard/settings/plans?oid=${e}`))}async function nue(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 already exists ${Q(i)}`),A.error(""))}async function iue(t,e,r,n,i,o){let s,a="",u=null,c=e.key,l=e.keyV2;u=await Th(t);let f=ve();if(f.start("Calculating checksum"),(l||e.keyDataV2||(0,cn.existsSync)(ur))&&c!==!1?a=await(0,Vb.checksum)(u,"sha256"):a=await(0,Vb.checksum)(u,"crc32"),f.stop(`Checksum: ${a}`),c===!1)p.info("Encryption ignored");else if((l||(0,cn.existsSync)(ur)||e.keyDataV2)&&!e.oldEncryption){let d=typeof l=="string"?l:ur,m=e.keyDataV2||"";!m&&!(0,cn.existsSync)(d)&&(p.error(`Cannot find private key ${d}`),A.error("")),await xe(n,{channel:"app",event:"App encryption v2",icon:"\u{1F511}",user_id:i,tags:{"app-id":o},notify:!1}),m||(m=(0,cn.readFileSync)(d).toString()),p.info("Encrypting your bundle with V2");let b=ip(u,m);a=np(a,m),s=b.ivSessionKey,e.displayIvSession&&p.info(`Your Iv Session key is ${s},
283
+ `)}async function zN(t,e,r){let n=await fp(t),i=Bb(r,e),o=[];return o.push(qb),o.push(Wc(e)),o.push(i),o.push(n),o.join(`
284
+ `)}async function GN(t,e,r){let n=Lb(t),i=await Ta("AWS4"+r,n),o=await Ta(i,e),s=await Ta(o,"s3");return await Ta(s,"aws4_request")}function WN(t,e,r){return`${t}/${Bb(e,r)}`}async function Ta(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 Wae=["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"],Kae=5*1024*1024,Yae=5*1024*1024*1024,Mb=5*1024*1024*1024*1024,Kc=class{host;port;protocol;accessKey;#e;sessionToken;defaultBucket;region;userAgent="s3-lite-client";pathStyle;constructor(e){if(e.useSSL===void 0&&(e.useSSL=!0),typeof e.endPoint!="string"||e.endPoint.length===0||e.endPoint.indexOf("/")!==-1)throw new up(`Invalid endPoint : ${e.endPoint}`);if(e.port!==void 0&&!BN(e.port))throw new Or(`Invalid port : ${e.port}`);if(e.accessKey&&!e.secretKey)throw new Or("If specifying access key, secret key must also be provided.");if(e.accessKey&&e.accessKey.startsWith("ASIA")&&!e.sessionToken)throw new Or("If specifying temporary access key, session token must also be provided.");let r=e.useSSL?443:80;this.port=e.port??r,this.host=e.endPoint.toLowerCase()+(this.port!==r?`:${e.port}`:""),this.protocol=e.useSSL?"https:":"http:",this.accessKey=e.accessKey,this.#e=e.secretKey??"",this.sessionToken=e.sessionToken,this.pathStyle=e.pathStyle??!0,this.defaultBucket=e.bucket,this.region=e.region}getBucketName(e){let r=e?.bucketName??this.defaultBucket;if(r===void 0||!qN(r))throw new cp(`Invalid bucket name: ${r}`);return r}buildRequestOptions(e){let r=this.getBucketName(e),n=this.pathStyle?this.host:`${r}.${this.host}`,i=e.headers??new Headers;i.set("host",n);let o=typeof e.query=="object"?new URLSearchParams(e.query).toString().replace("+","%20"):e.query,s=(this.pathStyle?`/${r}/${e.objectName}`:`/${e.objectName}`)+(o?`?${o}`:"");return{headers:i,host:n,path:s}}async makeRequest({method:e,payload:r,...n}){let i=new Date,{headers:o,host:s,path:a}=this.buildRequestOptions(n),u=n.statusCode??200;if(e==="POST"||e==="PUT"||e==="DELETE")r===void 0?r=new Uint8Array:typeof r=="string"&&(r=new TextEncoder().encode(r)),o.set("Content-Length",String(r.length));else if(r)throw new Error(`Unexpected payload on ${e} request.`);let c=await fp(r??new Uint8Array);o.set("x-amz-date",Wc(i)),o.set("x-amz-content-sha256",c),this.accessKey&&(this.sessionToken&&o.set("x-amz-security-token",this.sessionToken),o.set("authorization",await MN({headers:o,method:e,path:a,accessKey:this.accessKey,secretKey:this.#e,region:this.region,date:i})));let l=`${this.protocol}//${s}${a}`,f=await fetch(l,{method:e,headers:o,body:r});if(f.status!==u)throw f.status>=400?await LN(f):f.status===301?new Un(f.status,"UnexpectedRedirect",'The server unexpectedly returned a redirect response. With AWS S3, this usually means you need to use a region-specific endpoint like "s3.us-west-2.amazonaws.com" instead of "s3.amazonaws.com"'):new Un(f.status,"UnexpectedStatusCode",`Unexpected response code from the server (expected ${u}, got ${f.status} ${f.statusText}).`);return n.returnBody||await f.body?.getReader().read(),f}async deleteObject(e,r={}){let n=this.getBucketName(r);if(!Ro(e))throw new Mn(`Invalid object name: ${e}`);let i=r.versionId?{versionId:r.versionId}:{},o=new Headers;r.governanceBypass&&o.set("X-Amz-Bypass-Governance-Retention","true"),await this.makeRequest({method:"DELETE",bucketName:n,objectName:e,headers:o,query:i,statusCode:204})}async exists(e,r){try{return await this.statObject(e,r),!0}catch(n){if(n instanceof Un&&n.statusCode===404)return!1;throw n}}getObject(e,r){return this.getPartialObject(e,{...r,offset:0,length:0})}async getPartialObject(e,{offset:r,length:n,...i}){let o=this.getBucketName(i);if(!Ro(e))throw new Mn(`Invalid object name: ${e}`);let s=new Headers(Object.entries(i.metadata??{})),a=200;if(r||n){let c="";r?c=`bytes=${+r}-`:(c="bytes=0-",r=0),n&&(c+=`${+n+r-1}`),s.set("Range",c),a=206}let u={...i.responseParams,...i.versionId?{versionId:i.versionId}:{}};return await this.makeRequest({method:"GET",bucketName:o,objectName:e,headers:s,query:u,statusCode:a,returnBody:!0})}getPresignedUrl(e,r,n={}){if(!this.accessKey)throw new Po(`Presigned ${e} URLs cannot be generated for anonymous requests. Specify an accessKey and secretKey.`);if(!Ro(r))throw new Mn(`Invalid object name: ${r}`);let{headers:i,path:o}=this.buildRequestOptions({objectName:r,bucketName:n.bucketName,query:n.parameters}),s=n.requestDate??new Date,a=n.expirySeconds??24*60*60*7;return UN({protocol:this.protocol,headers:i,method:e,path:o,accessKey:this.accessKey,secretKey:this.#e,region:this.region,date:s,expirySeconds:a})}presignedGetObject(e,r={}){let{versionId:n,responseParams:i,...o}=r,s={...i,...n?{versionId:n}:{}};return this.getPresignedUrl("GET",e,{parameters:s,...o})}async*listObjects(e={}){for await(let r of this.listObjectsGrouped({...e,delimiter:""}))if(r.type==="Object")yield r;else throw new Error(`Unexpected result from listObjectsGrouped(): ${r}`)}async*listObjectsGrouped(e){let r=this.getBucketName(e),n="",i=e.pageSize??1e3;if(i<1||i>1e3)throw new Or("pageSize must be between 1 and 1,000.");let o=0;for(;;){let s=e.maxResults?Math.min(i,e.maxResults-o):i;if(s===0)return;let u=await(await this.makeRequest({method:"GET",bucketName:r,objectName:"",query:{"list-type":"2",prefix:e.prefix??"",delimiter:e.delimiter,"max-keys":String(s),...n?{"continuation-token":n}:{}},returnBody:!0})).text(),c=Ei(u).root;if(!c||c.name!=="ListBucketResult")throw new Error(`Unexpected response: ${u}`);let l=c.children.filter(d=>d.name==="CommonPrefixes").flatMap(d=>d.children),f=[];for(let d of l)f.push({type:"CommonPrefix",prefix:d.content??""}),o++;for(let d of c.children.filter(m=>m.name==="Contents"))f.push({type:"Object",key:d.children.find(m=>m.name==="Key")?.content??"",etag:$o(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,g=m.type==="Object"?m.key:m.prefix;return b>g?1:b<g?-1:0});for(let d of f)yield d;if(c.children.find(d=>d.name==="IsTruncated")?.content==="true"){let d=c.children.find(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(!Ro(e))throw new Mn(`Invalid object name: ${e}`);let o,s;if(typeof r=="string"){let l=new TextEncoder().encode(r);typeof ReadableStream.from<"u"?s=ReadableStream.from([l]):s=new ReadableStream({start(f){f.enqueue(l),f.close()}}),o=l.length}else if(r instanceof Uint8Array)typeof ReadableStream.from<"u"?s=ReadableStream.from([r]):s=new ReadableStream({start(l){l.enqueue(r),l.close()}}),o=r.byteLength;else if(r instanceof ReadableStream)s=r;else throw new Or("Invalid stream/data type provided.");if(n?.size!==void 0){if(o!==void 0&&n?.size!==o)throw new Or(`size was specified (${n.size}) but doesn't match auto-detected size (${o}).`);if(typeof n.size!="number"||n.size<0||isNaN(n.size))throw new Or(`invalid size specified: ${n.size}`);o=n.size}let a=n?.partSize??this.calculatePartSize(o);if(a<Kae)throw new Or("Part size should be greater than 5MB");if(a>Yae)throw new Or("Part size should be less than 6MB");let u=new ap(a),c=new dp({client:this,bucketName:i,objectName:e,partSize:a,metadata:n?.metadata??{}});return await s.pipeThrough(u).pipeTo(c),c.getResult()}calculatePartSize(e){if(e===void 0&&(e=Mb),e>Mb)throw new TypeError(`size should not be more than ${Mb}`);let r=64*1024*1024;for(;;){if(r*1e4>e)return r;r+=16*1024*1024}}async statObject(e,r){let n=this.getBucketName(r);if(!Ro(e))throw new Mn(`Invalid object name: ${e}`);let i={};r?.versionId&&(i.versionId=r.versionId);let o=await this.makeRequest({method:"HEAD",bucketName:n,objectName:e,query:i}),s={};for(let a of Wae)o.headers.has(a)&&(s[a]=o.headers.get(a));return o.headers.forEach((a,u)=>{u.startsWith("x-amz-meta-")&&(s[u]=o.headers.get(u))}),{type:"Object",key:e,size:parseInt(o.headers.get("content-length")??"",10),metadata:s,lastModified:new Date(o.headers.get("Last-Modified")??"error: missing last modified"),versionId:o.headers.get("x-amz-version-id")||null,etag:$o(o.headers.get("ETag")??"")}}async copyObject(e,r,n){let i=this.getBucketName(n),o=e.sourceBucketName??i;if(!Ro(r))throw new Mn(`Invalid object name: ${r}`);let s=`${o}/${e.sourceKey}`;e.sourceVersionId&&(s+=`?versionId=${e.sourceVersionId}`);let a=new Headers(n?.metadata);n?.metadata!==void 0&&a.set("x-amz-metadata-directive","REPLACE"),a.set("x-amz-copy-source",s);let u=await this.makeRequest({method:"PUT",bucketName:i,objectName:r,headers:a,returnBody:!0}),c=await u.text(),l=Ei(c).root;if(!l||l.name!=="CopyObjectResult")throw new Error(`Unexpected response: ${c}`);let f=l.children.find(d=>d.name==="ETag")?.content??"",h=l.children.find(d=>d.name==="LastModified")?.content;if(h===void 0)throw new Error("Unable to find <LastModified>...</LastModified> from the server.");return{copySourceVersionId:u.headers.get("x-amz-copy-source-version-id")||null,etag:$o(f),lastModified:new Date(h),versionId:u.headers.get("x-amz-version-id")||null}}async bucketExists(e){try{return await this.listObjects({bucketName:e}).next(),!0}catch(r){if(r instanceof Un&&r.statusCode===404)return!1;throw r}}async makeBucket(e){await this.makeRequest({method:"PUT",bucketName:this.getBucketName({bucketName:e}),objectName:"",statusCode:200})}async removeBucket(e){await this.makeRequest({method:"DELETE",bucketName:this.getBucketName({bucketName:e}),objectName:"",statusCode:204})}};var Ub=le(vu());var Ci=require("node:fs"),Yc=require("node:path");function Jae(t,e){return(0,Ci.readFileSync)(t,"utf8").includes(e)}function Jc(t,e){let r=(0,Ci.readdirSync)(t);for(let n of r){let i=(0,Yc.join)(t,n),o=(0,Ci.statSync)(i);if(o.isDirectory()){if(Jc(i,e))return!0}else if(o.isFile()&&(0,Yc.extname)(i)===".js"&&Jae(i,e))return!0}return!1}function Xc(t){let e=(0,Ci.readdirSync)(t);if(e.length===1){let n=(0,Yc.join)(t,e[0]);if((0,Ci.statSync)(n).isDirectory())return Xc(n)}return e.indexOf("index.html")>-1}var KN=require("node:fs"),YN=require("node:path"),JN=require("node:stream/consumers"),XN=require("node:zlib");var ZN=le(eD());async function QN(t,e,r,n){let i=ve();i.start("Generating the update manifest");let o=await sj(t);return i.stop("Manifest generated successfully"),await xe(e,{channel:"partial-update",event:"Generate manifest",icon:"\u{1F4C2}",user_id:r,tags:{"app-id":n},notify:!1}),o}async function eL(t,e,r,n,i,o){let s=ve();s.start("Preparing partial update with TUS protocol");let a=performance.now(),u=await Cr(),c=0,l=e.length,f=e.map(async h=>{let d=(0,YN.join)(r,h.file),m=(0,KN.createReadStream)(d).pipe((0,XN.createBrotliCompress)()),b=await(0,JN.buffer)(m);return new Promise((g,w)=>{new ZN.Upload(b,{endpoint:`${u.hostFilesApi}/files/upload/attachments/`,metadata:{filename:`orgs/${o}/apps/${n}/${i}/${h.file}`},headers:{Authorization:t},onError(D){p.info(`Failed to upload ${h.file}: ${D}`),w(D)},onProgress(){let D=(c/l*100).toFixed(2);s.message(`Uploading partial update: ${D}%`)},onSuccess(){c++,g({file_name:h.file,s3_path:`orgs/${o}/apps/${n}/${i}/${h.file}`,file_hash:h.hash})}}).start()})});try{let h=await Promise.all(f),m=((performance.now()-a)/1e3).toFixed(2);return s.stop(`Partial update uploaded successfully \u{1F4AA} in (${m} seconds)`),await xe(t,{channel:"app",event:"App Partial TUS done",icon:"\u23EB",user_id:o,tags:{"app-id":n},notify:!1}),await xe(t,{channel:"performance",event:"Partial upload performance",icon:"\u{1F684}",user_id:o,tags:{"app-id":n,time:m},notify:!1}),h}catch(h){let m=((performance.now()-a)/1e3).toFixed(2);return s.stop(`Failed to upload Partial bundle ( after ${m} seconds)`),p.info(`Error uploading partial update: ${h}, This is not a critical error, the bundle has been uploaded without the partial files`),null}}async function Xae(t,e){let r=await jt("",e.packageJson),n=e.bundle||t?.plugins?.CapacitorUpdater?.version||r?.version||`0.0.1-beta.${(0,tL.randomUUID)().split("-")[0]}`;return fa.test(n)||(p.error(`Your bundle name ${n}, is not valid it should follow semver convention : https://semver.org/`),A.error("")),n}function Zae(t){let e=t.apikey||pe();return e||(p.error("Missing API key, you need to provide a API key to upload your bundle"),A.error("")),e}function Qae(t,e,r){let n=t||r?.plugins?.CapacitorUpdater?.appId||r?.appId,i=e.path||r?.webDir;return n||(p.error("Missing argument, you need to provide a appid or be in a capacitor project"),A.error("")),i||(p.error("Missing argument, you need to provide a path (--path), or be in a capacitor project"),A.error("")),(0,cn.existsSync)(i)||(p.error(`Path ${i} does not exist, build your app first, or provide a valid path`),A.error("")),{appid:n,path:i}}function eue(t,e){let r=t.codeCheck;(typeof r>"u"||r)&&(Jc(e,"notifyAppReady")||(p.error("notifyAppReady() is missing in the source code. see: https://capgo.app/docs/plugin/api/#notifyappready"),A.error("")),Xc(e)||(p.error("index.html is missing in the root folder or in the only folder in the root folder"),A.error("")))}async function tue(t,e,r,n,i,o){let s=r.ignoreMetadataCheck,a=r.autoMinUpdateVersion,u=r.minUpdateVersion,{data:c,error:l}=await t.from("channels").select("disable_auto_update, version ( min_update_version, native_packages )").eq("name",n).eq("app_id",i).single(),f=!!c&&c.disable_auto_update==="version_number",h,d;if(!l&&c&&c.version&&c.version.native_packages&&!s){let g=ve();g.start(`Checking bundle compatibility with channel ${n}`);let{finalCompatibility:w,localDependencies:x}=await Rh(t,i,n,r.packageJson);if(d=w,h=x,d.find(D=>D.localVersion!==D.remoteVersion))g.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:D}=c.version;(!D||!fa.test(D))&&(p.error("Invalid remote min update version, skipping auto setting compatibility"),A.error("")),u=D,g.stop(`Auto set min-update-version to ${u}`)}catch{p.error(`Cannot auto set compatibility, invalid data ${c}`),A.error("")}else g.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 nb(r.packageJson),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"),A.error("")),u&&(fa.test(u)||(p.error(`Your minimal version update ${u}, is not valid it should follow semver convention : https://semver.org/`),A.error("")));let m=h?new Map(h.filter(g=>!!g.native&&g.native!==void 0).map(g=>[g.name,g])):new Map;return{nativePackages:m.size>0||!r.ignoreMetadataCheck?Array.from(m,([g,w])=>({name:g,version:w.version})):void 0,minUpdateVersion:u}}async function rue(t,e,r){let{data:n,error:i}=await t.rpc("is_trial_org",{orgid:e}).single();(n&&n>0||i)&&(p.warn(`WARNING !!
285
+ Trial expires in ${n} days`),p.warn(`Upgrade here: ${r.hostWeb}/dashboard/settings/plans?oid=${e}`))}async function nue(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 already exists ${Q(i)}`),A.error(""))}async function iue(t,e,r,n,i,o){let s,a="",u=null,c=e.key,l=e.keyV2;u=await Th(t);let f=ve();if(f.start("Calculating checksum"),(l||e.keyDataV2||(0,cn.existsSync)(ur))&&c!==!1?a=await(0,Ub.checksum)(u,"sha256"):a=await(0,Ub.checksum)(u,"crc32"),f.stop(`Checksum: ${a}`),c===!1)p.info("Encryption ignored");else if((l||(0,cn.existsSync)(ur)||e.keyDataV2)&&!e.oldEncryption){let d=typeof l=="string"?l:ur,m=e.keyDataV2||"";!m&&!(0,cn.existsSync)(d)&&(p.error(`Cannot find private key ${d}`),A.error("")),await xe(n,{channel:"app",event:"App encryption v2",icon:"\u{1F511}",user_id:i,tags:{"app-id":o},notify:!1}),m||(m=(0,cn.readFileSync)(d).toString()),p.info("Encrypting your bundle with V2");let b=ip(u,m);a=np(a,m),s=b.ivSessionKey,e.displayIvSession&&p.info(`Your Iv Session key is ${s},
286
286
  keep it safe, you will need it to decrypt your bundle.
287
287
  It will be also visible in your dashboard
288
288
  `),u=b.encryptedData}else if(c||e.keyData||(0,cn.existsSync)(cr)){let d=typeof c=="string"?c:cr,m=e.keyData||"";!m&&!(0,cn.existsSync)(d)&&(p.error(`Cannot find public key ${d}`),A.error("")),await xe(n,{channel:"app",event:"App encryption",icon:"\u{1F511}",user_id:i,tags:{"app-id":o},notify:!1}),m||(m=(0,cn.readFileSync)(d).toString()),p.info("Encrypting your bundle");let b=ep(u,m);s=b.ivSessionKey,e.displayIvSession&&p.info(`Your Iv Session key is ${s},
289
289
  keep it safe, you will need it to decrypt your bundle.
290
290
  It will be also visible in your dashboard
291
- `),u=b.encryptedData}let h=Math.floor((u?.byteLength??0)/1024/1024);return h>X6&&(p.warn(`WARNING !!
291
+ `),u=b.encryptedData}let h=Math.floor((u?.byteLength??0)/1024/1024);return h>J6&&(p.warn(`WARNING !!
292
292
  The app size is ${h} Mb, this may take a while to download for users
293
293
  `),p.info(`Learn how to optimize your assets https://capgo.app/blog/optimise-your-images-for-updates/
294
294
  `),await xe(n,{channel:"app-error",event:"App Too Large",icon:"\u{1F69B}",user_id:i,tags:{"app-id":o},notify:!1})),{zipped:u,sessionKey:s,checksum:a}}async function oue(t,e,r,n,i,o,s){let a=ve();a.start("Uploading Bundle");let u=performance.now(),c=!1;if(s.dryRun){a.stop(`Dry run, bundle not uploaded
295
- Bundle uploaded \u{1F4AA} in 0 seconds`);return}try{let h=await Cr();if(s.tus!==void 0&&s.tus){p.info("Uploading bundle with TUS protocol"),await nb(t,o,i,r,n,a,h),c=!0;let d=`orgs/${i}/apps/${r}/${n}.zip`,{error:m}=await e.from("app_versions").update({r2_path:d}).eq("name",n).eq("app_id",r);m&&(p.error(`Cannot finish TUS upload ${Q(m)}`),Promise.reject(new Error("Cannot finish TUS upload")))}if(s.multipart!==void 0&&s.multipart){p.info("Uploading bundle with TUS protocol, multipart is deprecated"),await nb(t,o,i,r,n,a,h),c=!0;let d=`orgs/${i}/apps/${r}/${n}.zip`,{error:m}=await e.from("app_versions").update({r2_path:d}).eq("name",n).eq("app_id",r);m&&(p.error(`Cannot finish TUS upload ${Q(m)}`),Promise.reject(new Error("Cannot finish TUS upload")))}else{let d=await oj(e,r,n);d||(p.error("Cannot get upload url"),Promise.reject(new Error("Cannot get upload url"))),await Hr.put(d,{timeout:s.timeout||Z6,retry:5,body:o})}}catch(h){let m=((performance.now()-u)/1e3).toFixed(2);if(a.stop(`Failed to upload bundle ( after ${m} seconds)`),h instanceof ti){let b=await h.response.json();p.error(`Response Error: ${b.error||b.status||b.message}`)}else p.error(`Cannot upload bundle ( try again with --tus option) ${Q(h)}`);await uj(e,r,n),A.error("")}let f=((performance.now()-u)/1e3).toFixed(2);a.stop(`Bundle uploaded \u{1F4AA} in (${f} seconds)`),await xe(t,{channel:"performance",event:c?"TUS upload zip performance":"Upload zip performance",icon:"\u{1F684}",user_id:i,tags:{"app-id":r,time:f},notify:!1})}async function sue(t,e,r,n,i,o,s,a,u){let{data:c}=await t.rpc("get_app_versions",{apikey:e,name_version:n,appid:a}).single();c||(p.warn("Cannot get version id, cannot set channel"),A.error(""));let{error:l,data:f}=await Ph(t,{name:i,app_id:a,created_by:o,version:c,owner_org:s});l&&(p.error(`Cannot set channel, the upload key is not allowed to do that, use the "all" for this. ${Q(l)}`),A.error(""));let h=wo(a),d=`${u.hostWeb}/app/p/${h}/channel/${f.id}`;f?.public?p.info("Your update is now available in your public channel \u{1F389}"):f?.id&&p.info(`Link device to this bundle to try it: ${d}`),r?p.info(`Bundle url: ${d}`):c||(p.warn("Cannot set bundle with upload key, use key with more rights for that"),A.error(""))}async function aue(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=wo(t);return p.info(`You can set it here: ${r}/app/p/${o}/settings`),null}return i.default_upload_channel}async function hp(t,e,r=!0){Y(`Uploading with CLI version ${Ir.version}`);let n=Nt();await ye();let{s3Region:i,s3Apikey:o,s3Apisecret:s,s3BucketName:a,s3Endpoint:u,s3Port:c,s3SSL:l}=e,f=Zae(e),h=await ee(),d=await Q6(),{appid:m,path:b}=Qae(t,e,h.config),g=await Xae(h.config,e);e.autoSetBundle&&await da({version:g}),eue(e,b),p.info(`Upload ${m}@${g} started from path "${b}" to Capgo cloud`);let w=await Cr(),x=await de(f),D=await me(x,f,["write","all","upload"]),C=e.channel||await aue(m,x,w.hostWeb)||"dev",k=await Sr(x,m);await ha(x,k,f,m,!0),await rue(x,k,w);let{nativePackages:$,minUpdateVersion:F}=await tue(x,n,e,C,m,g);await nue(x,m,g),e.external&&!e.external.startsWith("https://")&&(p.error(`External link should should start with "https://" current is "${e.external}"`),A.error(""));let L={name:g,app_id:m,session_key:void 0,external_url:e.external,storage_provider:e.external?"external":"r2-direct",min_update_version:F,native_packages:$,owner_org:k,user_id:D,checksum:void 0},S=null;if(e.external)await xe(f,{channel:"app",event:"App external",icon:"\u{1F4E4}",user_id:k,tags:{"app-id":m},notify:!1}),L.session_key=e.ivSessionKey,L.checksum=e.encryptedChecksum;else{let{zipped:q,sessionKey:K,checksum:M}=await iue(b,e,w,f,k,m);L.session_key=K,L.checksum=M,S=q,e.ignoreChecksumCheck||await lj(x,m,C,M)}!d.TUSUpload||e.external?e.tus=!1:e.tus=e.tus||d.TUSUploadForced,!d.partialUpload||e.external?e.partial=!1:e.partial=e.partial||d.partialUploadForced;let I=e.partial?await QN(b,f,k,m):[],{error:R}=await rb(x,L);if(R&&(p.error(`Cannot add bundle ${Q(R)}`),A.error("")),S&&(a||u||i||o||s||c||l)){(!a||!u||!i||!o||!s||!c)&&(p.error("Missing argument, for S3 upload you need to provide a bucket name, endpoint, region, port, API key, and API secret"),A.error("")),p.info("Uploading to S3");let q=new Kc({endPoint:u,region:i,port:c,useSSL:l,bucket:a,accessKey:o,secretKey:s}),K=`${m}-${g}`,M=encodeURIComponent(K);await q.putObject(K,Uint8Array.from(S)),L.external_url=`https://${u}/${M}`,L.storage_provider="external"}else if(S){await oue(f,x,m,g,k,S,e);let q=null;try{e.dryRun&&(e.partial=!1),q=e.partial?await eL(f,I,b,m,g,k):null}catch(M){p.info(`Failed to upload partial files to capgo cloud. Error: ${Q(M)}. This is not a critical error, the bundle has been uploaded without the partial files`)}L.storage_provider="r2",L.manifest=q;let{error:K}=await rb(x,L);K&&(p.error(`Cannot update bundle ${Q(K)}`),A.error(""))}let B=await qe(x,f,m,2);return ej(B,3)?await sue(x,f,!!e.bundleUrl,g,C,D,k,m,w):p.warn("Cannot set channel as a upload organization member"),await xe(f,{channel:"app",event:"App Uploaded",icon:"\u23EB",user_id:k,tags:{"app-id":m},notify:!1}),r&&(X("Time to share your update to the world \u{1F30D}"),(0,rL.exit)()),!0}function nL(t){t.ivSessionKey&&!t.external&&(p.error("You need to provide an external url if you want to use the --iv-session-key option"),A.error("")),t.encryptedChecksum&&!t.external&&(p.error("You need to provide an external url if you want to use the --encrypted-checksum option"),A.error("")),t.partial&&t.external&&(p.error("You cannot use the --partial option with an external url"),A.error("")),t.tus&&t.external&&(p.error("You cannot use the --tus option with an external url"),A.error("")),t.dryRun&&t.external&&(p.error("You cannot use the --dry-run option with an external url"),A.error("")),t.multipart&&t.external&&(p.error("You cannot use the --multipart option with an external url"),A.error("")),t.external&&(t.key||t.keyData||t.keyV2||t.keyDataV2)&&(p.error("You cannot set a key if you are uploading to an external url"),A.error("")),(t.key||t.keyData)&&(t.keyV2||t.keyDataV2)&&(p.error("You cannot set both key and key-v2"),A.error("")),t.key&&t.keyData&&(p.error("You cannot set both key and key-data"),A.error("")),t.keyV2&&t.keyDataV2&&(p.error("You cannot set both key-v2 and key-data-v2"),A.error("")),t.external&&(t.s3Region||t.s3Apikey||t.s3Apisecret||t.s3Endpoint||t.s3BucketName||t.s3Port||t.s3SSL)&&(p.error("You cannot set S3 options if you are uploading to an external url, it's automatically handled"),A.error("")),t.encryptedChecksum&&!t.external&&(p.error("You cannot set the --encrypted-checksum option if you are not uploading to an external url"),A.error("")),t.minUpdateVersion&&t.autoMinUpdateVersion&&(p.error("You cannot set both min-update-version and auto-min-update-version, use only one of them"),A.error(""))}async function iL(t,e){try{nL(e),await hp(t,e,!0)}catch(r){p.error(Q(r)),A.error("")}}async function oL(t,e){let r=Nt();p.warn(`\u26A0\uFE0F This command is deprecated, use "${r.runner} @capgo/cli bundle upload" instead \u26A0\uFE0F`);try{nL(e),await hp(t,e,!0)}catch(n){p.error(Q(n)),A.error("")}}var sL=require("node:crypto"),pp=require("node:fs"),aL=require("node:process");var Hb=le(vu());var uue=20;async function uL(t,e){try{let{bundle:r,path:n}=e,{json:i}=e;i||await ye();let o=await ee();t=t||o?.config?.appId;let s=(0,sL.randomUUID)().split("-")[0],a=await jt("",e.packageJson);r=r||a?.version||`0.0.1-beta.${s}`,i||Y(`Zipping ${t}@${r}`),r&&!fa.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/`),A.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"),A.error("")),i||p.info(`Started from path "${n}"`);let u=e.codeCheck;(typeof u>"u"||u)&&(Jc(n,"notifyAppReady")||(i?console.error(Q({error:"notifyAppReady_not_in_source_code"})):p.error("notifyAppReady() is missing in the source code. see: https://capgo.app/docs/plugin/api/#notifyappready"),A.error("")),Xc(n)||(i?console.error(Q({error:"index_html_not_found"})):p.error("index.html is missing in the root folder or in the only folder in the root folder"),A.error("")));let c=await Th(n);i||p.info(`Zipped ${c.byteLength} bytes`);let l=ve();i||l.start("Calculating checksum");let f="";e.keyV2||(0,pp.existsSync)(ur)?f=await(0,Hb.checksum)(c,"sha256"):f=await(0,Hb.checksum)(c,"crc32"),i||l.stop(`Checksum: ${f}`);let h=Math.floor(c.byteLength/1024/1024);h>uue&&!i&&(p.warn(`WARNING !!
295
+ Bundle uploaded \u{1F4AA} in 0 seconds`);return}try{let h=await Cr();if(s.multipart!==void 0&&s.multipart||s.tus!==void 0&&s.tus){s.multipart?p.info("Uploading bundle with multipart protocol, multipart is deprecated"):p.info("Uploading bundle with TUS protocol"),await aj(t,o,i,r,n,a,h),c=!0;let d=`orgs/${i}/apps/${r}/${n}.zip`,{error:m}=await e.from("app_versions").update({r2_path:d}).eq("name",n).eq("app_id",r);m&&(p.error(`Cannot finish TUS upload ${Q(m)}`),Promise.reject(new Error("Cannot finish TUS upload")))}else{let d=await ij(e,r,n);d||(p.error("Cannot get upload url"),Promise.reject(new Error("Cannot get upload url"))),await Hr.put(d,{timeout:s.timeout||X6,retry:5,body:o})}}catch(h){let m=((performance.now()-u)/1e3).toFixed(2);if(a.stop(`Failed to upload bundle ( after ${m} seconds)`),h instanceof ti){let b=await h.response.json();p.error(`Response Error: ${b.error||b.status||b.message}`)}else p.error(`Cannot upload bundle ( try again with --tus option) ${Q(h)}`);await uj(e,r,n),A.error("")}let f=((performance.now()-u)/1e3).toFixed(2);a.stop(`Bundle uploaded \u{1F4AA} in (${f} seconds)`),await xe(t,{channel:"performance",event:c?"TUS upload zip performance":"Upload zip performance",icon:"\u{1F684}",user_id:i,tags:{"app-id":r,time:f},notify:!1})}async function sue(t,e,r,n,i,o,s,a,u){let{data:c}=await t.rpc("get_app_versions",{apikey:e,name_version:n,appid:a}).single();c||(p.warn("Cannot get version id, cannot set channel"),A.error(""));let{error:l,data:f}=await Ph(t,{name:i,app_id:a,created_by:o,version:c,owner_org:s});l&&(p.error(`Cannot set channel, the upload key is not allowed to do that, use the "all" for this. ${Q(l)}`),A.error(""));let h=wo(a),d=`${u.hostWeb}/app/p/${h}/channel/${f.id}`;f?.public?p.info("Your update is now available in your public channel \u{1F389}"):f?.id&&p.info(`Link device to this bundle to try it: ${d}`),r?p.info(`Bundle url: ${d}`):c||(p.warn("Cannot set bundle with upload key, use key with more rights for that"),A.error(""))}async function aue(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=wo(t);return p.info(`You can set it here: ${r}/app/p/${o}/settings`),null}return i.default_upload_channel}async function hp(t,e,r=!0){Y(`Uploading with CLI version ${Ir.version}`);let n=Nt();await ye();let{s3Region:i,s3Apikey:o,s3Apisecret:s,s3BucketName:a,s3Endpoint:u,s3Port:c,s3SSL:l}=e,f=Zae(e),h=await ee(),d=await Z6(),{appid:m,path:b}=Qae(t,e,h.config),g=await Xae(h.config,e);e.autoSetBundle&&await da({version:g}),eue(e,b),p.info(`Upload ${m}@${g} started from path "${b}" to Capgo cloud`);let w=await Cr(),x=await de(f),D=await me(x,f,["write","all","upload"]),C=e.channel||await aue(m,x,w.hostWeb)||"dev",k=await Sr(x,m);await ha(x,k,f,m,!0),await rue(x,k,w);let{nativePackages:$,minUpdateVersion:F}=await tue(x,n,e,C,m,g);await nue(x,m,g),e.external&&!e.external.startsWith("https://")&&(p.error(`External link should should start with "https://" current is "${e.external}"`),A.error(""));let L={name:g,app_id:m,session_key:void 0,external_url:e.external,storage_provider:e.external?"external":"r2-direct",min_update_version:F,native_packages:$,owner_org:k,user_id:D,checksum:void 0},S=null;if(e.external)await xe(f,{channel:"app",event:"App external",icon:"\u{1F4E4}",user_id:k,tags:{"app-id":m},notify:!1}),L.session_key=e.ivSessionKey,L.checksum=e.encryptedChecksum;else{let{zipped:q,sessionKey:K,checksum:M}=await iue(b,e,w,f,k,m);L.session_key=K,L.checksum=M,S=q,e.ignoreChecksumCheck||await lj(x,m,C,M)}!d.TUSUpload||e.external?e.tus=!1:e.tus=e.tus||d.TUSUploadForced,!d.partialUpload||e.external?e.partial=!1:e.partial=e.partial||d.partialUploadForced;let I=e.partial?await QN(b,f,k,m):[],{error:R}=await rb(x,L);if(R&&(p.error(`Cannot add bundle ${Q(R)}`),A.error("")),S&&(a||u||i||o||s||c||l)){(!a||!u||!i||!o||!s||!c)&&(p.error("Missing argument, for S3 upload you need to provide a bucket name, endpoint, region, port, API key, and API secret"),A.error("")),p.info("Uploading to S3");let q=new Kc({endPoint:u,region:i,port:c,useSSL:l,bucket:a,accessKey:o,secretKey:s}),K=`${m}-${g}`,M=encodeURIComponent(K);await q.putObject(K,Uint8Array.from(S)),L.external_url=`https://${u}/${M}`,L.storage_provider="external"}else if(S){await oue(f,x,m,g,k,S,e);let q=null;try{e.dryRun&&(e.partial=!1),q=e.partial?await eL(f,I,b,m,g,k):null}catch(M){p.info(`Failed to upload partial files to capgo cloud. Error: ${Q(M)}. This is not a critical error, the bundle has been uploaded without the partial files`)}L.storage_provider="r2",L.manifest=q;let{error:K}=await rb(x,L);K&&(p.error(`Cannot update bundle ${Q(K)}`),A.error(""))}let B=await qe(x,f,m,2);return Q6(B,3)?await sue(x,f,!!e.bundleUrl,g,C,D,k,m,w):p.warn("Cannot set channel as a upload organization member"),await xe(f,{channel:"app",event:"App Uploaded",icon:"\u23EB",user_id:k,tags:{"app-id":m},notify:!1}),r&&(X("Time to share your update to the world \u{1F30D}"),(0,rL.exit)()),!0}function nL(t){t.ivSessionKey&&!t.external&&(p.error("You need to provide an external url if you want to use the --iv-session-key option"),A.error("")),t.encryptedChecksum&&!t.external&&(p.error("You need to provide an external url if you want to use the --encrypted-checksum option"),A.error("")),t.partial&&t.external&&(p.error("You cannot use the --partial option with an external url"),A.error("")),t.tus&&t.external&&(p.error("You cannot use the --tus option with an external url"),A.error("")),t.dryRun&&t.external&&(p.error("You cannot use the --dry-run option with an external url"),A.error("")),t.multipart&&t.external&&(p.error("You cannot use the --multipart option with an external url"),A.error("")),t.external&&(t.key||t.keyData||t.keyV2||t.keyDataV2)&&(p.error("You cannot set a key if you are uploading to an external url"),A.error("")),(t.key||t.keyData)&&(t.keyV2||t.keyDataV2)&&(p.error("You cannot set both key and key-v2"),A.error("")),t.key&&t.keyData&&(p.error("You cannot set both key and key-data"),A.error("")),t.keyV2&&t.keyDataV2&&(p.error("You cannot set both key-v2 and key-data-v2"),A.error("")),t.external&&(t.s3Region||t.s3Apikey||t.s3Apisecret||t.s3Endpoint||t.s3BucketName||t.s3Port||t.s3SSL)&&(p.error("You cannot set S3 options if you are uploading to an external url, it's automatically handled"),A.error("")),t.encryptedChecksum&&!t.external&&(p.error("You cannot set the --encrypted-checksum option if you are not uploading to an external url"),A.error("")),t.minUpdateVersion&&t.autoMinUpdateVersion&&(p.error("You cannot set both min-update-version and auto-min-update-version, use only one of them"),A.error(""))}async function iL(t,e){try{nL(e),await hp(t,e,!0)}catch(r){p.error(Q(r)),A.error("")}}async function oL(t,e){let r=Nt();p.warn(`\u26A0\uFE0F This command is deprecated, use "${r.runner} @capgo/cli bundle upload" instead \u26A0\uFE0F`);try{nL(e),await hp(t,e,!0)}catch(n){p.error(Q(n)),A.error("")}}var sL=require("node:crypto"),pp=require("node:fs"),aL=require("node:process");var Vb=le(vu());var uue=20;async function uL(t,e){try{let{bundle:r,path:n}=e,{json:i}=e;i||await ye();let o=await ee();t=t||o?.config?.appId;let s=(0,sL.randomUUID)().split("-")[0],a=await jt("",e.packageJson);r=r||a?.version||`0.0.1-beta.${s}`,i||Y(`Zipping ${t}@${r}`),r&&!fa.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/`),A.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"),A.error("")),i||p.info(`Started from path "${n}"`);let u=e.codeCheck;(typeof u>"u"||u)&&(Jc(n,"notifyAppReady")||(i?console.error(Q({error:"notifyAppReady_not_in_source_code"})):p.error("notifyAppReady() is missing in the source code. see: https://capgo.app/docs/plugin/api/#notifyappready"),A.error("")),Xc(n)||(i?console.error(Q({error:"index_html_not_found"})):p.error("index.html is missing in the root folder or in the only folder in the root folder"),A.error("")));let c=await Th(n);i||p.info(`Zipped ${c.byteLength} bytes`);let l=ve();i||l.start("Calculating checksum");let f="";e.keyV2||(0,pp.existsSync)(ur)?f=await(0,Vb.checksum)(c,"sha256"):f=await(0,Vb.checksum)(c,"crc32"),i||l.stop(`Checksum: ${f}`);let h=Math.floor(c.byteLength/1024/1024);h>uue&&!i&&(p.warn(`WARNING !!
296
296
  The app size is ${h} Mb, this may take a while to download for users
297
297
  `),p.warn(`Learn how to optimize your assets https://capgo.app/blog/optimise-your-images-for-updates/
298
- `));let d=ve(),m=e.name||`${t}_${r}.zip`;i||d.start(`Saving to ${m}`),(0,pp.writeFileSync)(m,c),i||d.stop(`Saved to ${m}`),i||X("Done \u2705"),i&&console.log(JSON.stringify({bundle:r,filename:m,checksum:f},null,2)),(0,aL.exit)()}catch(r){p.error(Q(r)),A.error("")}}var cL=require("node:process");async function zb(t,e,r,n=!0){Y("Create channel"),r.apikey=r.apikey||pe();let i=await ee();e=e||i?.config?.appId,r.apikey||(p.error("Missing API key, you need to provide a API key to upload your bundle"),A.error("")),e||(p.error("Missing argument, you need to provide a appId, or be in a capacitor project"),A.error(""));let o=await de(r.apikey);await me(o,r.apikey,["write","all"]),await qe(o,r.apikey,e,4),p.info(`Creating channel ${e}#${t} to Capgo`);try{let s=await $b(o,e),a=await Sr(o,e);s||(p.error("Cannot find default version for channel creation, please contact Capgo support \u{1F928}"),A.error(""));let u=await cN(o,{name:t,app_id:e,version:s.id,owner_org:a});u.error&&(p.error(`Cannot create Channel \u{1F640}
299
- ${Q(u.error)}`),A.error("")),p.success("Channel created \u2705"),await xe(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&&(X("Done \u2705"),(0,cL.exit)()),!0}async function lL(t,e,r){zb(t,e,r,!0)}var fL=require("node:process");async function dL(t,e,r){let{quiet:n}=r;n||Y("List current bundle"),r.apikey=r.apikey||pe(n);let i=await ee();e=e||i?.config?.appId,r.apikey||(p.error("Missing API key, you need to provide a API key to upload your bundle"),A.error("")),e||(p.error("Missing argument, you need to provide a appId, or be in a capacitor project"),A.error(""));let o=await de(r.apikey),s=await me(o,r.apikey,["write","all","read"]);await qe(o,r.apikey,e,1),t||(p.error("Please provide a channel to get the bundle from."),A.error(""));let{data:a,error:u}=await o.from("channels").select("version ( name )").eq("name",t).eq("app_id",e).limit(1);(u||a.length===0)&&(p.error(`Error retrieving channel ${t} for app ${e}. Perhaps the channel does not exists?`),A.error(""));let{version:c}=a[0];c||(p.error(`Error retrieving channel ${t} for app ${e}. Perhaps the channel does not exists?`),A.error("")),n?p.info(c.name):p.info(`Current bundle for channel ${t} is ${c.name}`),(0,fL.exit)()}var hL=require("node:process");async function pL(t,e,r){Y("Delete channel"),r.apikey=r.apikey||pe();let n=await ee();e=e||n?.config?.appId,r.apikey||(p.error("Missing API key, you need to provide a API key to upload your bundle"),A.error("")),e||(p.error("Missing argument, you need to provide a appId, or be in a capacitor project"),A.error(""));let i=await de(r.apikey),o=await me(i,r.apikey,["write","all"]);await qe(i,r.apikey,e,4),p.info(`Deleting channel ${e}#${t} from Capgo`);try{let s=await lN(i,t,e,o);s.error&&(p.error(`Cannot delete Channel \u{1F640} ${Q(s.error)}`),A.error(""));let a=await Sr(i,e);p.success("Channel deleted"),await xe(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}")}X("Done \u2705"),(0,hL.exit)()}var mL=require("node:process");async function gL(t,e){Y("List channels"),e.apikey=e.apikey||pe();let r=await ee();t=t||r?.config?.appId,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"),A.error(""));let n=await de(e.apikey),i=await me(n,e.apikey,["write","all","read","upload"]);await qe(n,e.apikey,t,1),p.info("Querying available channels in Capgo");let o=await dN(n,t);p.info(`Active channels in Capgo: ${o?.length}`),fN(o),await xe(e.apikey,{channel:"channel",event:"List channel",icon:"\u2705",user_id:i,tags:{"app-id":t},notify:!1}).catch(),X("Done \u2705"),(0,mL.exit)()}var DL=require("node:process");var yL=["major","minor","metadata","patch","none"];async function vL(t,e,r){Y("Set channel"),r.apikey=r.apikey||pe();let n=await ee();e=e||n?.config?.appId,r.apikey||(p.error("Missing API key, you need to provide a API key to upload your bundle"),A.error("")),e||(p.error("Missing argument, you need to provide a appId, or be in a capacitor project"),A.error(""));let i=await de(r.apikey),o=await me(i,r.apikey,["write","all"]);await qe(i,r.apikey,e,4);let s=await Sr(i,e),{bundle:a,state:u,downgrade:c,latest:l,upgrade:f,ios:h,android:d,selfAssign:m,disableAutoUpdate:b,dev:g,emulator:w}=r;t||(p.error("Missing argument, you need to provide a channel"),A.error("")),l&&a&&(p.error("Cannot set latest and bundle at the same time"),A.error("")),a==null&&u==null&&l==null&&c==null&&f==null&&h==null&&d==null&&m==null&&g==null&&w==null&&b==null&&(p.error("Missing argument, you need to provide a option to set"),A.error(""));try{await ha(i,s,r.apikey,e);let x={created_by:o,app_id:e,name:t,owner_org:s,version:void 0},D=await jt("",r.packageJson),C=l?n?.config?.plugins?.CapacitorUpdater?.version||D?.version:a;if(C!=null){let{data:k,error:$}=await i.from("app_versions").select().eq("app_id",e).eq("name",C).eq("user_id",o).eq("deleted",!1).single();($||!k)&&(p.error(`Cannot find version ${C}`),A.error("")),p.info(`Set ${e} channel: ${t} to @${C}`),x.version=k.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"}`),x.public=u==="public"||u==="default"),c!=null&&(p.info(`Set ${e} channel: ${t} to ${c?"allow":"disallow"} downgrade`),x.disable_auto_update_under_native=!c),h!=null&&(p.info(`Set ${e} channel: ${t} to ${h?"allow":"disallow"} ios update`),x.ios=!!h),d!=null&&(p.info(`Set ${e} channel: ${t} to ${d?"allow":"disallow"} android update`),x.android=!!d),m!=null&&(p.info(`Set ${e} channel: ${t} to ${m?"allow":"disallow"} self assign to this channel`),x.allow_device_self_set=!!m),b!=null){let k=b.toLocaleLowerCase();yL.includes(k)||(p.error(`Channel strategy ${k} is not known. The possible values are: ${yL.join(", ")}.`),A.error("")),k==="metadata"&&(k="version_number"),x.disable_auto_update=k,p.info(`Set ${e} channel: ${t} to ${k} disable update strategy to this channel`)}try{let{error:k}=await Ph(i,x);k&&(p.error('Cannot set channel the upload key is not allowed to do that, use the "all" for this.'),A.error(""))}catch{p.error('Cannot set channel the upload key is not allowed to do that, use the "all" for this.'),A.error("")}await xe(r.apikey,{channel:"channel",event:"Set channel",icon:"\u2705",user_id:s,tags:{"app-id":e},notify:!1}).catch()}catch(x){p.error(`Unknow error ${Q(x)}`),A.error("")}X("Done \u2705"),(0,DL.exit)()}var Qc=require("node:child_process"),at=require("node:fs"),yp=require("node:path"),dr=require("node:process");var Dp=le(IL());var Qb=require("node:process");function Sue(t){return new Promise(e=>{setTimeout(e,t)})}async function Hn(t,e,r,n,i="\u2705"){await xe(r,{channel:t,event:n,icon:i,user_id:e,notify:!1})}async function xue(t,e,r,n){qt(e)&&(await Hn(t,r,n,"canceled","\u{1F937}"),(0,Qb.exit)())}async function Fue(t,e,r){try{let n=await Cr(),i=await Hr.post(`${n.hostApi}/private/stats`,{headers:{"Content-Type":"application/json",capgkey:t},body:JSON.stringify(e)}).then(o=>o.json()).catch(o=>(console.error("Cannot get devices",o),[]));if(i?.length>0&&(r===null||r!==i[0].created_at))return i}catch(n){p.error(`Cannot get stats ${Q(n)}`)}return[]}async function Oue(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 Hn(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 Hn(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 Hn(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:
298
+ `));let d=ve(),m=e.name||`${t}_${r}.zip`;i||d.start(`Saving to ${m}`),(0,pp.writeFileSync)(m,c),i||d.stop(`Saved to ${m}`),i||X("Done \u2705"),i&&console.log(JSON.stringify({bundle:r,filename:m,checksum:f},null,2)),(0,aL.exit)()}catch(r){p.error(Q(r)),A.error("")}}var cL=require("node:process");async function Hb(t,e,r,n=!0){Y("Create channel"),r.apikey=r.apikey||pe();let i=await ee();e=e||i?.config?.appId,r.apikey||(p.error("Missing API key, you need to provide a API key to upload your bundle"),A.error("")),e||(p.error("Missing argument, you need to provide a appId, or be in a capacitor project"),A.error(""));let o=await de(r.apikey);await me(o,r.apikey,["write","all"]),await qe(o,r.apikey,e,4),p.info(`Creating channel ${e}#${t} to Capgo`);try{let s=await Rb(o,e),a=await Sr(o,e);s||(p.error("Cannot find default version for channel creation, please contact Capgo support \u{1F928}"),A.error(""));let u=await cN(o,{name:t,app_id:e,version:s.id,owner_org:a});u.error&&(p.error(`Cannot create Channel \u{1F640}
299
+ ${Q(u.error)}`),A.error("")),p.success("Channel created \u2705"),await xe(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&&(X("Done \u2705"),(0,cL.exit)()),!0}async function lL(t,e,r){Hb(t,e,r,!0)}var fL=require("node:process");async function dL(t,e,r){let{quiet:n}=r;n||Y("List current bundle"),r.apikey=r.apikey||pe(n);let i=await ee();e=e||i?.config?.appId,r.apikey||(p.error("Missing API key, you need to provide a API key to upload your bundle"),A.error("")),e||(p.error("Missing argument, you need to provide a appId, or be in a capacitor project"),A.error(""));let o=await de(r.apikey),s=await me(o,r.apikey,["write","all","read"]);await qe(o,r.apikey,e,1),t||(p.error("Please provide a channel to get the bundle from."),A.error(""));let{data:a,error:u}=await o.from("channels").select("version ( name )").eq("name",t).eq("app_id",e).limit(1);(u||a.length===0)&&(p.error(`Error retrieving channel ${t} for app ${e}. Perhaps the channel does not exists?`),A.error(""));let{version:c}=a[0];c||(p.error(`Error retrieving channel ${t} for app ${e}. Perhaps the channel does not exists?`),A.error("")),n?p.info(c.name):p.info(`Current bundle for channel ${t} is ${c.name}`),(0,fL.exit)()}var hL=require("node:process");async function pL(t,e,r){Y("Delete channel"),r.apikey=r.apikey||pe();let n=await ee();e=e||n?.config?.appId,r.apikey||(p.error("Missing API key, you need to provide a API key to upload your bundle"),A.error("")),e||(p.error("Missing argument, you need to provide a appId, or be in a capacitor project"),A.error(""));let i=await de(r.apikey),o=await me(i,r.apikey,["write","all"]);await qe(i,r.apikey,e,4),p.info(`Deleting channel ${e}#${t} from Capgo`);try{let s=await lN(i,t,e,o);s.error&&(p.error(`Cannot delete Channel \u{1F640} ${Q(s.error)}`),A.error(""));let a=await Sr(i,e);p.success("Channel deleted"),await xe(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}")}X("Done \u2705"),(0,hL.exit)()}var mL=require("node:process");async function gL(t,e){Y("List channels"),e.apikey=e.apikey||pe();let r=await ee();t=t||r?.config?.appId,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"),A.error(""));let n=await de(e.apikey),i=await me(n,e.apikey,["write","all","read","upload"]);await qe(n,e.apikey,t,1),p.info("Querying available channels in Capgo");let o=await dN(n,t);p.info(`Active channels in Capgo: ${o?.length}`),fN(o),await xe(e.apikey,{channel:"channel",event:"List channel",icon:"\u2705",user_id:i,tags:{"app-id":t},notify:!1}).catch(),X("Done \u2705"),(0,mL.exit)()}var DL=require("node:process");var yL=["major","minor","metadata","patch","none"];async function vL(t,e,r){Y("Set channel"),r.apikey=r.apikey||pe();let n=await ee();e=e||n?.config?.appId,r.apikey||(p.error("Missing API key, you need to provide a API key to upload your bundle"),A.error("")),e||(p.error("Missing argument, you need to provide a appId, or be in a capacitor project"),A.error(""));let i=await de(r.apikey),o=await me(i,r.apikey,["write","all"]);await qe(i,r.apikey,e,4);let s=await Sr(i,e),{bundle:a,state:u,downgrade:c,latest:l,upgrade:f,ios:h,android:d,selfAssign:m,disableAutoUpdate:b,dev:g,emulator:w}=r;t||(p.error("Missing argument, you need to provide a channel"),A.error("")),l&&a&&(p.error("Cannot set latest and bundle at the same time"),A.error("")),a==null&&u==null&&l==null&&c==null&&f==null&&h==null&&d==null&&m==null&&g==null&&w==null&&b==null&&(p.error("Missing argument, you need to provide a option to set"),A.error(""));try{await ha(i,s,r.apikey,e);let x={created_by:o,app_id:e,name:t,owner_org:s,version:void 0},D=await jt("",r.packageJson),C=l?n?.config?.plugins?.CapacitorUpdater?.version||D?.version:a;if(C!=null){let{data:k,error:$}=await i.from("app_versions").select().eq("app_id",e).eq("name",C).eq("user_id",o).eq("deleted",!1).single();($||!k)&&(p.error(`Cannot find version ${C}`),A.error("")),p.info(`Set ${e} channel: ${t} to @${C}`),x.version=k.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"}`),x.public=u==="public"||u==="default"),c!=null&&(p.info(`Set ${e} channel: ${t} to ${c?"allow":"disallow"} downgrade`),x.disable_auto_update_under_native=!c),h!=null&&(p.info(`Set ${e} channel: ${t} to ${h?"allow":"disallow"} ios update`),x.ios=!!h),d!=null&&(p.info(`Set ${e} channel: ${t} to ${d?"allow":"disallow"} android update`),x.android=!!d),m!=null&&(p.info(`Set ${e} channel: ${t} to ${m?"allow":"disallow"} self assign to this channel`),x.allow_device_self_set=!!m),b!=null){let k=b.toLocaleLowerCase();yL.includes(k)||(p.error(`Channel strategy ${k} is not known. The possible values are: ${yL.join(", ")}.`),A.error("")),k==="metadata"&&(k="version_number"),x.disable_auto_update=k,p.info(`Set ${e} channel: ${t} to ${k} disable update strategy to this channel`)}try{let{error:k}=await Ph(i,x);k&&(p.error('Cannot set channel the upload key is not allowed to do that, use the "all" for this.'),A.error(""))}catch{p.error('Cannot set channel the upload key is not allowed to do that, use the "all" for this.'),A.error("")}await xe(r.apikey,{channel:"channel",event:"Set channel",icon:"\u2705",user_id:s,tags:{"app-id":e},notify:!1}).catch()}catch(x){p.error(`Unknow error ${Q(x)}`),A.error("")}X("Done \u2705"),(0,DL.exit)()}var Qc=require("node:child_process"),at=require("node:fs"),yp=require("node:path"),dr=require("node:process");var Dp=le(IL());var Zb=require("node:process");function Sue(t){return new Promise(e=>{setTimeout(e,t)})}async function Hn(t,e,r,n,i="\u2705"){await xe(r,{channel:t,event:n,icon:i,user_id:e,notify:!1})}async function xue(t,e,r,n){qt(e)&&(await Hn(t,r,n,"canceled","\u{1F937}"),(0,Zb.exit)())}async function Fue(t,e,r){try{let n=await Cr(),i=await Hr.post(`${n.hostApi}/private/stats`,{headers:{"Content-Type":"application/json",capgkey:t},body:JSON.stringify(e)}).then(o=>o.json()).catch(o=>(console.error("Cannot get devices",o),[]));if(i?.length>0&&(r===null||r!==i[0].created_at))return i}catch(n){p.error(`Cannot get stats ${Q(n)}`)}return[]}async function Oue(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 Hn(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 Hn(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 Hn(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:
300
300
  - iOS: keyCFBundleShortVersionString or MARKETING_VERSION
301
301
  - Android: versionName
302
302
  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:
@@ -305,19 +305,19 @@ ${Q(u.error)}`),A.error("")),p.success("Channel created \u2705"),await xe(r.apik
305
305
  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:
306
306
  - iOS: keyCFBundleShortVersionString or MARKETING_VERSION
307
307
  - Android: versionName
308
- 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 ew(t,e,r,n,i){let o=!0,s=wo(r),a=await Cr(),u=`${a.hostWeb}/app/p/${s}`;await Hn(t,n,e,"Use waitlog");let c={appId:r,devicesId:i?[i]:void 0,order:[{key:"created_at",sortable:"desc"}],rangeStart:new Date().toISOString()},l=null,f=ve();for(f.start("Waiting for logs (Expect delay of 30 sec)");o;){await Sue(5e3);let h=await Fue(e,c,l);if(h.length>0){l=h[0].created_at;for(let d of h)if(o=await Oue(d,t,n,e,u,a.hostWeb),!o)break}}return f.stop("Stop watching logs"),Promise.resolve()}async function jL(t,e){Y("Debug Live update in Capgo"),await ye(),e.apikey=e.apikey||pe();let r=await ee();t=t||r?.config?.appId;let n=e.device;e.apikey||(p.error("Missing API key, you need to provide an API key to delete your app"),A.error("")),t||(p.error("Missing argument, you need to provide a appId, or be in a capacitor project"),A.error(""));let i=await de(e.apikey),o=await Sr(i,t),s=await Te({message:"Automatic check if update working in device ?"});await xue("debug",s,o,e.apikey),s?(p.info(`Wait logs sent to Capgo from ${t} device, Please open your app \u{1F4AA}`),await ew("debug",e.apikey,t,o,n),X("Done \u2705")):X("Canceled \u274C"),X("Done \u2705"),(0,Qb.exit)()}var Bt=require("node:fs");async function Aue(t,e=!0){e&&Y("Save keys \u{1F511}");let r=await ee(),n=t.key||jn,i=t.keyData||"";if(!(0,Bt.existsSync)(n)&&!i)if(p)p.error(`Cannot find a public key at ${n} or as keyData option or in ${r.path}`),A.error("");else return!1;else(0,Bt.existsSync)(n)&&(i=(0,Bt.readFileSync)(n).toString());if(i&&!i.startsWith("-----BEGIN RSA PUBLIC KEY-----"))if(p)p.error("the public key provided is not a valid RSA Public key"),A.error("");else return!1;return r?.config&&(r.config.plugins||(r.config.plugins={extConfig:{},CapacitorUpdater:{}}),r.config.plugins.CapacitorUpdater||(r.config.plugins.CapacitorUpdater={}),r.config.plugins.CapacitorUpdater.privateKey&&(delete r.config.plugins.CapacitorUpdater.privateKey,p.info("Old private key deleted from config file"),await Te({message:"Do you want to setup encryption with the new channel in order to support old apps and facilitate the migration?"})&&(r.config.plugins.CapacitorUpdater.defaultChannel="encryption_v2")),r.config.plugins.CapacitorUpdater.publicKey=i,await on(r)),e&&(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 kue(t,e=!0){e&&Y("Deleting old private key \u{1F5D1}\uFE0F");let r=await ee();if(r?.config?.plugins?.CapacitorUpdater?.privateKey){if(delete r.config.plugins.CapacitorUpdater.privateKey,await on(r),(0,Bt.existsSync)(tr))try{(0,Bt.unlinkSync)(tr),e&&p.success(`Old private key file deleted: ${tr}`)}catch{e&&p.error(`Failed to delete old private key file: ${tr}`)}if((0,Bt.existsSync)(cr))try{(0,Bt.unlinkSync)(cr),e&&p.success(`Old public key file deleted: ${cr}`)}catch{e&&p.error(`Failed to delete old public key file: ${jn}`)}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 NL(t){Y("Save keys \u{1F511}"),await ye(),await Aue(t)}async function tw(t,e=!0){e&&Y("Create keys \u{1F511}");let{publicKey:r,privateKey:n}=tp();if((0,Bt.existsSync)(jn)&&!t.force)if(p.error("Public Key already exists, use --force to overwrite"),e)A.error("");else return!1;if((0,Bt.writeFileSync)(jn,r),(0,Bt.existsSync)(ur)&&!t.force)if(p.error("Private Key already exists, use --force to overwrite"),e)A.error("");else return!1;(0,Bt.writeFileSync)(ur,n);let i=await ee();return i&&(i.config.plugins||(i.config.plugins={extConfig:{},CapacitorUpdater:{}}),i.config.plugins.CapacitorUpdater||(i.config.plugins.CapacitorUpdater={}),i.config.plugins.CapacitorUpdater.privateKey&&(delete i.config.plugins.CapacitorUpdater.privateKey,p.info("Old private key deleted from config file"),await Te({message:"Do you want to setup encryption with the new channel in order to support old apps and facilitate the migration?"})&&(i.config.plugins.CapacitorUpdater.defaultChannel="encryption_v2")),i.config.plugins.CapacitorUpdater.publicKey=r,on(i)),p&&(p.success("Your RSA key has been generated"),p.success(`Private key saved in ${ur}`),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"),X("Done \u2705")),!0}async function LL(t){await ye(),await tw(t)}async function BL(t){await ye(),await kue(t)}var zn=require("node:fs"),nw=require("node:os"),rw=require("node:process");async function qL(){let t=(0,nw.homedir)();return(0,zn.existsSync)(`${t}/.capgo`)||(0,zn.existsSync)(".capgo")}async function iw(t,e,r=!0){if(r&&Y("Login to Capgo"),!t)return r&&(p.error("Missing API key, you need to provide a API key to upload your bundle"),A.error("")),!1;await ye();try{let{local:n}=e;if(n)(0,zn.existsSync)(".git")||(p.error("To use local you should be in a git repository"),A.error("")),(0,zn.writeFileSync)(".capgo",`${t}
308
+ 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 Qb(t,e,r,n,i){let o=!0,s=wo(r),a=await Cr(),u=`${a.hostWeb}/app/p/${s}`;await Hn(t,n,e,"Use waitlog");let c={appId:r,devicesId:i?[i]:void 0,order:[{key:"created_at",sortable:"desc"}],rangeStart:new Date().toISOString()},l=null,f=ve();for(f.start("Waiting for logs (Expect delay of 30 sec)");o;){await Sue(5e3);let h=await Fue(e,c,l);if(h.length>0){l=h[0].created_at;for(let d of h)if(o=await Oue(d,t,n,e,u,a.hostWeb),!o)break}}return f.stop("Stop watching logs"),Promise.resolve()}async function jL(t,e){Y("Debug Live update in Capgo"),await ye(),e.apikey=e.apikey||pe();let r=await ee();t=t||r?.config?.appId;let n=e.device;e.apikey||(p.error("Missing API key, you need to provide an API key to delete your app"),A.error("")),t||(p.error("Missing argument, you need to provide a appId, or be in a capacitor project"),A.error(""));let i=await de(e.apikey),o=await Sr(i,t),s=await Te({message:"Automatic check if update working in device ?"});await xue("debug",s,o,e.apikey),s?(p.info(`Wait logs sent to Capgo from ${t} device, Please open your app \u{1F4AA}`),await Qb("debug",e.apikey,t,o,n),X("Done \u2705")):X("Canceled \u274C"),X("Done \u2705"),(0,Zb.exit)()}var Bt=require("node:fs");async function Aue(t,e=!0){e&&Y("Save keys \u{1F511}");let r=await ee(),n=t.key||jn,i=t.keyData||"";if(!(0,Bt.existsSync)(n)&&!i)if(p)p.error(`Cannot find a public key at ${n} or as keyData option or in ${r.path}`),A.error("");else return!1;else(0,Bt.existsSync)(n)&&(i=(0,Bt.readFileSync)(n).toString());if(i&&!i.startsWith("-----BEGIN RSA PUBLIC KEY-----"))if(p)p.error("the public key provided is not a valid RSA Public key"),A.error("");else return!1;return r?.config&&(r.config.plugins||(r.config.plugins={extConfig:{},CapacitorUpdater:{}}),r.config.plugins.CapacitorUpdater||(r.config.plugins.CapacitorUpdater={}),r.config.plugins.CapacitorUpdater.privateKey&&(delete r.config.plugins.CapacitorUpdater.privateKey,p.info("Old private key deleted from config file"),await Te({message:"Do you want to setup encryption with the new channel in order to support old apps and facilitate the migration?"})&&(r.config.plugins.CapacitorUpdater.defaultChannel="encryption_v2")),r.config.plugins.CapacitorUpdater.publicKey=i,await on(r)),e&&(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 kue(t,e=!0){e&&Y("Deleting old private key \u{1F5D1}\uFE0F");let r=await ee();if(r?.config?.plugins?.CapacitorUpdater?.privateKey){if(delete r.config.plugins.CapacitorUpdater.privateKey,await on(r),(0,Bt.existsSync)(tr))try{(0,Bt.unlinkSync)(tr),e&&p.success(`Old private key file deleted: ${tr}`)}catch{e&&p.error(`Failed to delete old private key file: ${tr}`)}if((0,Bt.existsSync)(cr))try{(0,Bt.unlinkSync)(cr),e&&p.success(`Old public key file deleted: ${cr}`)}catch{e&&p.error(`Failed to delete old public key file: ${jn}`)}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 NL(t){Y("Save keys \u{1F511}"),await ye(),await Aue(t)}async function ew(t,e=!0){e&&Y("Create keys \u{1F511}");let{publicKey:r,privateKey:n}=tp();if((0,Bt.existsSync)(jn)&&!t.force)if(p.error("Public Key already exists, use --force to overwrite"),e)A.error("");else return!1;if((0,Bt.writeFileSync)(jn,r),(0,Bt.existsSync)(ur)&&!t.force)if(p.error("Private Key already exists, use --force to overwrite"),e)A.error("");else return!1;(0,Bt.writeFileSync)(ur,n);let i=await ee();return i&&(i.config.plugins||(i.config.plugins={extConfig:{},CapacitorUpdater:{}}),i.config.plugins.CapacitorUpdater||(i.config.plugins.CapacitorUpdater={}),i.config.plugins.CapacitorUpdater.privateKey&&(delete i.config.plugins.CapacitorUpdater.privateKey,p.info("Old private key deleted from config file"),await Te({message:"Do you want to setup encryption with the new channel in order to support old apps and facilitate the migration?"})&&(i.config.plugins.CapacitorUpdater.defaultChannel="encryption_v2")),i.config.plugins.CapacitorUpdater.publicKey=r,on(i)),p&&(p.success("Your RSA key has been generated"),p.success(`Private key saved in ${ur}`),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"),X("Done \u2705")),!0}async function LL(t){await ye(),await ew(t)}async function BL(t){await ye(),await kue(t)}var zn=require("node:fs"),rw=require("node:os"),tw=require("node:process");async function qL(){let t=(0,rw.homedir)();return(0,zn.existsSync)(`${t}/.capgo`)||(0,zn.existsSync)(".capgo")}async function nw(t,e,r=!0){if(r&&Y("Login to Capgo"),!t)return r&&(p.error("Missing API key, you need to provide a API key to upload your bundle"),A.error("")),!1;await ye();try{let{local:n}=e;if(n)(0,zn.existsSync)(".git")||(p.error("To use local you should be in a git repository"),A.error("")),(0,zn.writeFileSync)(".capgo",`${t}
309
309
  `),(0,zn.appendFileSync)(".gitignore",`.capgo
310
- `);else{let s=(0,nw.homedir)();(0,zn.writeFileSync)(`${s}/.capgo`,`${t}
311
- `)}let i=await de(t),o=await me(i,t,["write","all","upload"]);await xe(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,rw.exit)(1)}return r&&(X("Done \u2705"),(0,rw.exit)()),!0}async function ML(t,e){iw(t,e,!0)}var UL="import { CapacitorUpdater } from '@capgo/capacitor-updater'",gp="CapacitorUpdater.notifyAppReady()",Tue=/import.*from.*/g,Zc="production",VL={stdio:"pipe"},$a;function HL(){$a||($a=(0,at.readdirSync)(Dp.default.tmpdir).map(t=>({name:t,full:`${Dp.default.tmpdir}/${t}`})).find(t=>t.name.startsWith("capgocli"))?.full??Dp.default.fileSync({prefix:"capgocli"}).name)}function Si(t){try{HL(),(0,at.writeFileSync)($a,JSON.stringify({step_done:t}))}catch(e){p.error(`Cannot mark step as done in the CLI, error:
310
+ `);else{let s=(0,rw.homedir)();(0,zn.writeFileSync)(`${s}/.capgo`,`${t}
311
+ `)}let i=await de(t),o=await me(i,t,["write","all","upload"]);await xe(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,tw.exit)(1)}return r&&(X("Done \u2705"),(0,tw.exit)()),!0}async function ML(t,e){nw(t,e,!0)}var UL="import { CapacitorUpdater } from '@capgo/capacitor-updater'",gp="CapacitorUpdater.notifyAppReady()",Tue=/import.*from.*/g,Zc="production",VL={stdio:"pipe"},$a;function HL(){$a||($a=(0,at.readdirSync)(Dp.default.tmpdir).map(t=>({name:t,full:`${Dp.default.tmpdir}/${t}`})).find(t=>t.name.startsWith("capgocli"))?.full??Dp.default.fileSync({prefix:"capgocli"}).name)}function Si(t){try{HL(),(0,at.writeFileSync)($a,JSON.stringify({step_done:t}))}catch(e){p.error(`Cannot mark step as done in the CLI, error:
312
312
  ${e}`),p.warn("Onboarding will continue but please report it to the capgo team!")}}async function Pue(t,e){try{HL();let r=(0,at.readFileSync)($a,"utf-8");if(!r||r.length===0)return;let{step_done:n}=JSON.parse(r);p.info(`You have already got to the step ${n}/10 in the previous session`);let i=await Te({message:"Would you like to continue from where you left off?"});return await fn(i,t,e),i?n:void 0}catch(r){p.error(`Cannot read which steps have been compleated, error:
313
313
  ${r}`),p.warn("Onboarding will continue but please report it to the capgo team!");return}}function Rue(){if($a)try{(0,at.rmSync)($a)}catch(t){p.error(`Cannot delete the tmp steps file.
314
- Error: ${t}`)}}async function fn(t,e,r){qt(t)&&(await Hn("onboarding-v2",e,r,"canceled","\u{1F937}"),(0,dr.exit)())}async function $r(t,e,r){return Hn("onboarding-v2",t,e,`onboarding-step-${r}`)}async function $ue(t,e,r,n){let i=Nt(),o=await Te({message:`Add ${r} in Capgo?`});if(await fn(o,t.gid,e),o){let s=ve();s.start(`Running: ${i.runner} @capgo/cli@latest app add ${r}`),await Cb(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 $r(t.gid,e,2)}async function Iue(t,e,r){let n=Nt(),i=await Te({message:`Create default channel ${Zc} for ${r} in Capgo?`});if(await fn(i,t,e),i){let o=ve();o.start(`Running: ${n.runner} @capgo/cli@latest channel add ${Zc} ${r} --default`),await zb(Zc,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 ${Zc} ${r} --default"`);await $r(t,e,3)}var jue="https://capacitorjs.com/docs/updating/6-0",Nue="https://capacitorjs.com/docs/updating/5-0";async function Lue(t,e,r){let n=Nt(),i=await Te({message:`Automatic Install "@capgo/capacitor-updater" dependency in ${r}?`});if(await fn(i,t,e),i){let o=ve();o.start("Checking if @capgo/capacitor-updater is installed");let s="latest",a=await jt(),u=a.dependencies["@capacitor/core"]||a.devDependencies["@capacitor/core"];if(u=Bn(u?.replace("^","").replace("~","")),u?ka(u,Bn("5.0.0"))?(o.stop("Error"),p.warn(`@capacitor/core version is ${u}, please update to Capacitor v5 first: ${Nue}`),X("Bye \u{1F44B}"),(0,dr.exit)()):ka(u,Bn("6.0.0"))&&(o.stop(`@capacitor/core version is ${u}, please update to Capacitor v6: ${jue} 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"),X("Bye \u{1F44B}"),(0,dr.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"),X("Bye \u{1F44B}"),(0,dr.exit)()),a.dependencies["@capgo/capacitor-updater"])o.stop("Capgo already installed \u2705");else{await(0,Qc.execSync)(`${n.installCommand} @capgo/capacitor-updater@${s}`,VL);let c=await jt();await da({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 $r(t,e,4)}async function Bue(t,e,r){let n=await Te({message:`Automatic Add "${gp}" code and import in ${r}?`});if(await fn(n,t,e),n){let i=ve();i.start("Adding @capacitor-updater to your main file");let o=await tb();if(o==="nuxtjs-js"||o==="nuxtjs-ts"){let s=(0,yp.join)("plugins");(0,at.existsSync)(s)||(0,at.mkdirSync)(s,{recursive:!0});let a;o==="nuxtjs-ts"?a=(0,yp.join)(s,"capacitorUpdater.client.ts"):a=(0,yp.join)(s,"capacitorUpdater.client.js");let u=`
314
+ Error: ${t}`)}}async function fn(t,e,r){qt(t)&&(await Hn("onboarding-v2",e,r,"canceled","\u{1F937}"),(0,dr.exit)())}async function $r(t,e,r){return Hn("onboarding-v2",t,e,`onboarding-step-${r}`)}async function $ue(t,e,r,n){let i=Nt(),o=await Te({message:`Add ${r} in Capgo?`});if(await fn(o,t.gid,e),o){let s=ve();s.start(`Running: ${i.runner} @capgo/cli@latest app add ${r}`),await Eb(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 $r(t.gid,e,2)}async function Iue(t,e,r){let n=Nt(),i=await Te({message:`Create default channel ${Zc} for ${r} in Capgo?`});if(await fn(i,t,e),i){let o=ve();o.start(`Running: ${n.runner} @capgo/cli@latest channel add ${Zc} ${r} --default`),await Hb(Zc,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 ${Zc} ${r} --default"`);await $r(t,e,3)}var jue="https://capacitorjs.com/docs/updating/6-0",Nue="https://capacitorjs.com/docs/updating/5-0";async function Lue(t,e,r){let n=Nt(),i=await Te({message:`Automatic Install "@capgo/capacitor-updater" dependency in ${r}?`});if(await fn(i,t,e),i){let o=ve();o.start("Checking if @capgo/capacitor-updater is installed");let s="latest",a=await jt(),u=a.dependencies["@capacitor/core"]||a.devDependencies["@capacitor/core"];if(u=Bn(u?.replace("^","").replace("~","")),u?ka(u,Bn("5.0.0"))?(o.stop("Error"),p.warn(`@capacitor/core version is ${u}, please update to Capacitor v5 first: ${Nue}`),X("Bye \u{1F44B}"),(0,dr.exit)()):ka(u,Bn("6.0.0"))&&(o.stop(`@capacitor/core version is ${u}, please update to Capacitor v6: ${jue} 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"),X("Bye \u{1F44B}"),(0,dr.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"),X("Bye \u{1F44B}"),(0,dr.exit)()),a.dependencies["@capgo/capacitor-updater"])o.stop("Capgo already installed \u2705");else{await(0,Qc.execSync)(`${n.installCommand} @capgo/capacitor-updater@${s}`,VL);let c=await jt();await da({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 $r(t,e,4)}async function Bue(t,e,r){let n=await Te({message:`Automatic Add "${gp}" code and import in ${r}?`});if(await fn(n,t,e),n){let i=ve();i.start("Adding @capacitor-updater to your main file");let o=await tb();if(o==="nuxtjs-js"||o==="nuxtjs-ts"){let s=(0,yp.join)("plugins");(0,at.existsSync)(s)||(0,at.mkdirSync)(s,{recursive:!0});let a;o==="nuxtjs-ts"?a=(0,yp.join)(s,"capacitorUpdater.client.ts"):a=(0,yp.join)(s,"capacitorUpdater.client.js");let u=`
315
315
  import { CapacitorUpdater } from '@capgo/capacitor-updater'
316
316
 
317
317
  export default defineNuxtPlugin(() => {
318
318
  CapacitorUpdater.notifyAppReady()
319
319
  })
320
- `;(0,at.existsSync)(a)?(0,at.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,at.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,at.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 ij();else{let f=o.endsWith("-ts");s=await rj(o,f)}if(!s||!(0,at.existsSync)(s)){i.stop("Cannot find main file to install Updater plugin");let f=await Uw({message:"Provide the correct relative path to your main file (JS or TS):",validate:h=>{if(!(0,at.existsSync)(h))return"File does not exist. Please provide a valid path."}});qt(f)&&(Vw("Operation cancelled."),(0,dr.exit)(1)),s=f}let u=(0,at.readFileSync)(s,"utf8").toString(),l=u.match(Tue)?.pop();if(l||(i.stop("Error"),p.warn("Cannot find import line in main file, use manual installation: https://capgo.app/docs/plugin/cloud-mode/auto-update/"),X("Bye \u{1F44B}"),(0,dr.exit)()),u.includes(gp))i.stop(`Code already added to ${s} \u2705`);else{let f=u.replace(l,`${l}
320
+ `;(0,at.existsSync)(a)?(0,at.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,at.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,at.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 nj();else{let f=o.endsWith("-ts");s=await tj(o,f)}if(!s||!(0,at.existsSync)(s)){i.stop("Cannot find main file to install Updater plugin");let f=await Mw({message:"Provide the correct relative path to your main file (JS or TS):",validate:h=>{if(!(0,at.existsSync)(h))return"File does not exist. Please provide a valid path."}});qt(f)&&(Uw("Operation cancelled."),(0,dr.exit)(1)),s=f}let u=(0,at.readFileSync)(s,"utf8").toString(),l=u.match(Tue)?.pop();if(l||(i.stop("Error"),p.warn("Cannot find import line in main file, use manual installation: https://capgo.app/docs/plugin/cloud-mode/auto-update/"),X("Bye \u{1F44B}"),(0,dr.exit)()),u.includes(gp))i.stop(`Code already added to ${s} \u2705`);else{let f=u.replace(l,`${l}
321
321
  ${UL};
322
322
 
323
323
  ${gp};
@@ -326,7 +326,7 @@ ${gp};
326
326
  ${UL};
327
327
 
328
328
  ${gp};
329
- `)}async function que(t,e,r){let n=Nt(),i=await Te({message:`Automatic configure end-to-end encryption in ${r} updates?`});if(await fn(i,t,e),i){let o=ve();o.start(`Running: ${n.runner} @capgo/cli@latest key create`),await tw({force:!0},!1)?o.stop("key created \u{1F511}"):(o.stop("Error"),p.warn("Cannot create key \u274C"),X("Bye \u{1F44B}"),(0,dr.exit)(1)),Hn("onboarding-v2",t,e,"Use encryption v2")}await $r(t,e,6)}async function Mue(t,e,r){let n=Nt(),i=await Te({message:`Automatic build ${r} with "${n.pm} run build" ?`});if(await fn(i,t,e),i){let o=ve(),s=await tb(),a=await nj(s);o.start(`Running: ${n.pm} run ${a} && ${n.runner} cap sync`),(await jt()).scripts[a]||(o.stop("Error"),p.warn(`Cannot find ${a} script in package.json, please add it and run \`capgo init\` again`),X("Bye \u{1F44B}"),(0,dr.exit)()),(0,Qc.execSync)(`${n.pm} run ${a} && ${n.runner} cap sync`,VL),o.stop("Build & Sync Done \u2705")}else p.info(`Build yourself with command: ${n.pm} run build && ${n.runner} cap sync`);await $r(t,e,7)}async function Uue(t,e,r){let n=Nt(),i=await Te({message:`Automatic upload ${r} bundle to Capgo?`});if(await fn(i,t,e),i){let o=ve();o.start(`Running: ${n.runner} @capgo/cli@latest bundle upload`),await hp(r,{channel:Zc,apikey:e},!1)?o.stop("Upload Done \u2705"):(o.stop("Error"),p.warn("Upload failed \u274C"),X("Bye \u{1F44B}"),(0,dr.exit)())}else p.info(`Upload yourself with command: ${n.runner} @capgo/cli@latest bundle upload`);await $r(t,e,8)}async function Vue(t,e){let r=Nt(),n=await Te({message:"Run in device now ?"});if(await fn(n,t,e),n){let i=await Bo({message:"Pick a platform to run your app",options:[{value:"ios",label:"IOS"},{value:"android",label:"Android"}]});qt(i)&&(X("Bye \u{1F44B}"),(0,dr.exit)());let o=i,s=ve();s.start(`Running: ${r.runner} cap run ${o}`),await(0,Qc.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 $r(t,e,9)}async function Hue(t,e,r,n){let i=await Te({message:"Automatic check if update working in device ?"});if(await fn(i,t,e),i)p.info(`Wait logs sent to Capgo from ${r} device, Please open your app \u{1F4AA}`),await ew("onboarding-v2",e,r,e,t);else{let o=wo(r);p.info(`Check logs in ${n}/app/p/${o}/logs to see if update works.`)}await $r(t,e,10)}async function zL(t,e,r){let n=Nt();Y("Capgo onboarding \u{1F6EB}"),await ye();let i=await ee(),o=await Cr();e=e||i?.config?.appId,r.apikey=t||pe();let s=ve();(!qL()||t)&&(s.start(`Running: ${n.runner} @capgo/cli@latest login ***`),await iw(r.apikey,r,!1),s.stop("Login Done \u2705"));let a=await de(r.apikey);await me(a,r.apikey,["upload","all","read","write"]);let u=await ma(a,["admin","super_admin"]),c=u.gid,l=await Pue(c,r.apikey)??0;try{l<1&&await $r(c,r.apikey,1),l<2&&(await $ue(u,r.apikey,e,r),Si(2)),l<3&&(await Iue(c,r.apikey,e),Si(3)),l<4&&(await Lue(c,r.apikey,e),Si(4)),l<5&&(await Bue(c,r.apikey,e),Si(5)),l<6&&(await que(c,r.apikey,e),Si(6)),l<7&&(await Mue(c,r.apikey,e),Si(7)),l<8&&(await Uue(c,r.apikey,e),Si(8)),l<9&&(await Vue(c,r.apikey),Si(9)),await Hue(c,r.apikey,e,o.hostWeb),await $r(c,r.apikey,0),Rue()}catch(f){console.error(f),p.error("Error during onboarding, please try again later"),(0,dr.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\``),X("Bye \u{1F44B}"),(0,dr.exit)()}var dn=require("node:fs");async function zue(t,e=!0){e&&Y("Save keys \u{1F511}");let r=await ee(),n=t.key||tr,i=t.keyData||"";if(!(0,dn.existsSync)(n)&&!i)if(e)p.error(`Cannot find public key ${n} or as keyData option or in ${r.path}`),A.error("");else return!1;else(0,dn.existsSync)(n)&&(i=(0,dn.readFileSync)(n).toString());return r?.config&&(r.config.plugins||(r.config.plugins={extConfig:{},CapacitorUpdater:{}}),r.config.plugins.CapacitorUpdater||(r.config.plugins.CapacitorUpdater={}),r.config.plugins.CapacitorUpdater.privateKey=i,await on(r)),p&&(p.success(`private key saved into ${r.path} file in local directory`),p.success("your app will decode the zip archive with this key")),!0}async function GL(t){Y("Save keys \u{1F511}"),await ye(),await zue(t)}async function Gue(t,e=!0){e&&Y("Create keys \u{1F511}");let{publicKey:r,privateKey:n}=tp();if((0,dn.existsSync)(cr)&&!t.force)if(p.error("Public Key already exists, use --force to overwrite"),e)A.error("");else return!1;if((0,dn.writeFileSync)(cr,r),(0,dn.existsSync)(tr)&&!t.force)if(p.error("Private Key already exists, use --force to overwrite"),e)A.error("");else return!1;(0,dn.writeFileSync)(tr,n);let i=n.replace(/\\n/g,"\\n"),o=await da({privateKey:i});return e&&(p.success("Your RSA key has been generated"),p.success(`Public key saved in ${cr}`),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(`Private key saved in ${o.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"),X("Done \u2705")),!0}async function WL(t){await ye(),await Gue(t)}async function KL(t){Y("Getting user id"),t.apikey=t.apikey||pe();let e=await de(t.apikey),r=await me(e,t.apikey,["read","all","write"]);X(`Done \u2705: ${r}`)}async function YL(t,e){Y("Check compatibility"),e.apikey=e.apikey||pe();let r=await ee();t=t||r?.config?.appId;let{channel:n}=e;n||(p.error("Missing argument, you need to provide a channel"),A.error("")),e.apikey||(p.error("Missing API key, you need to provide a API key to upload your bundle"),A.error("")),t||(p.error("Missing argument, you need to provide a appId, or be in a capacitor project"),A.error(""));let i=await de(e.apikey);await me(i,e.apikey,["write","all","read","upload"]),await qe(i,e.apikey,t,1);let{finalCompatibility:o}=await Rh(i,t,n,e.packageJson),s=new lr;s.headers=["Package","Local version","Remote version","Compatible"],s.theme=lr.roundTheme,s.rows=[];let a=e.text?"Yes":"\u2705",u=e.text?"No":"\u274C";o.forEach(c=>{let{name:l,localVersion:f,remoteVersion:h}=c,d=h===f?a:u;s.rows.push([l,f,h,d])}),p.success("Compatibility"),p.success(s.toString())}A.name(Ir.name).description("Manage packages and bundle versions in Capgo Cloud").version(Ir.version);A.command("login [apikey]").alias("l").description("Save apikey to your machine or folder").action(ML).option("--local","Only save in local folder");A.command("doctor").description("Get info about your Capgo app install").option("--package-json <packageJson>","A path to package.json. Usefull for monorepos").action(M8);A.command("init [apikey] [appId]").description("Init a new app").action(zL).option("-n, --name <name>","app name").option("-i, --icon <icon>","app icon path");var Ia=A.command("app").description("Manage app");Ia.command("add [appId]").alias("a").description("Add a new app in Capgo Cloud").action(L8).option("-n, --name <name>","app name").option("-i, --icon <icon>","app icon path").option("-a, --apikey <apikey>","apikey to link to your account");Ia.command("delete [appId]").description("Delete an app in Capgo Cloud").action(q8).option("-a, --apikey <apikey>","apikey to link to your account");Ia.command("list").alias("l").description("list apps in Capgo Cloud").action(V8).option("-a, --apikey <apikey>","apikey to link to your account");Ia.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(jL);Ia.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(W8);Ia.command("set [appId]").alias("s").description("Set an app in Capgo Cloud").action(G8).option("-n, --name <name>","app name").option("-i, --icon <icon>","app icon path").option("-a, --apikey <apikey>","apikey to link to your account").option("-r, --retention <retention>","retention period of app bundle in days");var hn=A.command("bundle").description("Manage bundle");hn.command("upload [appId]").alias("u").description("Upload a new bundle in Capgo Cloud").action(iL).option("-a, --apikey <apikey>","apikey to link to your account").option("-p, --path <path>","path of the folder to upload").option("-c, --channel <channel>","channel to link to").option("-e, --external <url>","link to external url intead of upload to Capgo Cloud").option("--iv-session-key <key>","Set the iv and session key for bundle url external").option("--s3-region <region>","Region for your S3 bucket").option("--s3-apikey <apikey>","Apikey for your S3 endpoint").option("--s3-apisecret <apisecret>","Api secret for your S3 endpoint").option("--s3-endoint <s3Endpoint>","Url of S3 endpoint").option("--s3-bucket-name <bucketName>","Name for your AWS S3 bucket").option("--s3-port <port>","Port for your S3 endpoint").option("--no-s3-ssl","Disable SSL for S3 upload").option("--key <key>","custom path for public signing key").option("--key-data <keyData>","public signing key").option("--key-v2 <key>","custom path for private signing key").option("--key-data-v2 <keyDataV2>","private signing key").option("--bundle-url","prints bundle url into stdout").option("--no-key","ignore signing key and send clear update").option("--no-code-check","Ignore checking if notifyAppReady() is called in soure code and index present in root folder").option("--display-iv-session","Show in the console the iv and session key used to encrypt the update").option("-b, --bundle <bundle>","bundle version number of the bundle to upload").option("--min-update-version <minUpdateVersion>","Minimal version required to update to this version. Used only if the disable auto update is set to metadata in channel").option("--auto-min-update-version","Set the min update version based on native packages").option("--ignore-metadata-check","Ignores the metadata (node_modules) check when uploading").option("--ignore-checksum-check","Ignores the checksum check when uploading").option("--timeout <timeout>","Timeout for the upload process in seconds").option("--multipart","Uses multipart protocol to upload data to S3, Deprecated, use tus instead").option("--tus","Upload the bundle using TUS to Capgo cloud").option("--partial","Upload partial files to Capgo cloud").option("--encrypted-checksum <encryptedChecksum>","An encrypted checksum (signature). Used only when uploading an external bundle.").option("--package-json <packageJson>","A path to package.json. Usefull for monorepos").option("--auto-set-bundle","Set the bundle in capacitor.config.json").option("--dry-run","Dry run the upload process");hn.command("compatibility [appId]").action(YL).option("-a, --apikey <apikey>","apikey to link to your account").option("-c, --channel <channel>","channel to check the compatibility with").option("--text","output text instead of emojis").option("--package-json <packageJson>","A path to package.json. Usefull for monorepos");hn.command("delete [bundleId] [appId]").alias("d").description("Delete a bundle in Capgo Cloud").action(TN).option("-a, --apikey <apikey>","apikey to link to your account");hn.command("list [appId]").alias("l").description("List bundle in Capgo Cloud").action(NN).option("-a, --apikey <apikey>","apikey to link to your account");hn.command("cleanup [appId]").alias("c").action(yN).description("Cleanup bundle in Capgo Cloud").option("-b, --bundle <bundle>","bundle version number of the app to delete").option("-a, --apikey <apikey>","apikey to link to your account").option("-k, --keep <keep>","number of version to keep").option("-f, --force","force removal");hn.command("decrypt [zipPath] [sessionKey]").description("Decrypt a signed zip bundle").action(EN).option("--key <key>","custom path for private signing key").option("--key-data <keyData>","private signing key");hn.command("encrypt [zipPath]").description("Encrypt a zip bundle").action(RN).option("--key <key>","custom path for private signing key").option("--key-data <keyData>","private signing key");hn.command("encryptV2 [zipPath] [checksum]").description("Encrypt a zip bundle using the new encryption method").action(IN).option("--key <key>","custom path for private signing key").option("--key-data <keyData>","private signing key").option("-j, --json","output in JSON");hn.command("decryptV2 [zipPath] [checksum]").description("Decrypt a zip bundle using the new encryption method").action(AN).option("--key <key>","custom path for private signing key").option("--key-data <keyData>","private signing key").option("--checksum <checksum>","checksum of the bundle, to verify the integrity of the bundle");hn.command("zip [appId]").description("Zip a bundle").action(uL).option("-p, --path <path>","path of the folder to upload").option("-b, --bundle <bundle>","bundle version number to name the zip file").option("-n, --name <name>","name of the zip file").option("-j, --json","output in JSON").option("--no-code-check","Ignore checking if notifyAppReady() is called in soure code and index present in root folder").option("--key-v2","use encryption v2").option("--package-json <packageJson>","A path to package.json. Usefull for monorepos");var el=A.command("channel").description("Manage channel");el.command("add [channelId] [appId]").alias("a").description("Create channel").action(lL).option("-d, --default","set the channel as default").option("-a, --apikey <apikey>","apikey to link to your account");el.command("delete [channelId] [appId]").alias("d").description("Delete channel").action(pL).option("-a, --apikey <apikey>","apikey to link to your account");el.command("list [appId]").alias("l").description("List channel").action(gL).option("-a, --apikey <apikey>","apikey to link to your account");el.command("currentBundle [channel] [appId]").description("Get current bundle for specific channel in Capgo Cloud").action(dL).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");el.command("set [channelId] [appId]").alias("s").description("Set channel").action(vL).option("-a, --apikey <apikey>","apikey to link to your account").option("-b, --bundle <bundle>","bundle version number of the file to set").option("-s, --state <state>","set the state of the channel, default or normal").option("--latest","get the latest version key in the package.json to set it to the channel").option("--downgrade","Allow to downgrade to version under native one").option("--no-downgrade","Disable downgrade to version under native one").option("--upgrade","Allow to upgrade to version above native one").option("--no-upgrade","Disable upgrade to version above native one").option("--ios","Allow sending update to ios devices").option("--no-ios","Disable sending update to ios devices").option("--android","Allow sending update to android devices").option("--no-android","Disable sending update to android devices").option("--self-assign","Allow to device to self assign to this channel").option("--no-self-assign","Disable devices to self assign to this channel").option("--disable-auto-update <disableAutoUpdate>","Disable auto update strategy for this channel.The possible options are: major, minor, metadata, patch, none").option("--dev","Allow sending update to development devices").option("--no-dev","Disable sending update to development devices").option("--emulator","Allow sending update to emulator devices").option("--no-emulator","Disable sending update to emulator devices").option("--package-json <packageJson>","A path to package.json. Usefull for monorepos");var JL=A.command("key_old").description("Manage old encryption key");JL.command("save").description("Save base64 encryption key in capacitor config, usefull for CI").action(GL).option("-f, --force","force generate a new one").option("--key","key path to save in capacitor config").option("--key-data","key data to save in capacitor config");JL.command("create").description("Create a new encryption key").action(WL).option("-f, --force","force generate a new one");var ow=A.command("key").description("Manage encryption key");ow.command("save").description("Save base64 encryption key in capacitor config, usefull for CI").action(NL).option("-f, --force","force generate a new one").option("--key","key path to save in capacitor config").option("--key-data","key data to save in capacitor config");ow.command("create").description("Create a new encryption key").action(LL).option("-f, --force","force generate a new one");ow.command("delete_old").description("Delete the old encryption key").action(BL);A.command("upload [appId]").alias("u").description("(Deprecated) Upload a new bundle to Capgo Cloud").action(oL).option("-a, --apikey <apikey>","apikey to link to your account").option("-p, --path <path>","path of the folder to upload").option("-c, --channel <channel>","channel to link to").option("-e, --external <url>","link to external url intead of upload to Capgo Cloud").option("--old-encryption","use old encryption").option("--key <key>","custom path for public signing key").option("--key-data <keyData>","public signing key").option("--bundle-url","prints bundle url into stdout").option("--no-key","ignore signing key and send clear update").option("--display-iv-session","Show in the console the iv and session key used to encrypt the update").option("-b, --bundle <bundle>","bundle version number of the file to upload").option("--min-update-version <minUpdateVersion>","Minimal version required to update to this version. Used only if the disable auto update is set to metadata in channel");var Wue=A.command("account").description("Manage account");Wue.command("id").description("Get your account ID").action(KL).option("-a, --apikey <apikey>","apikey to link to your account");A.parseAsync();
329
+ `)}async function que(t,e,r){let n=Nt(),i=await Te({message:`Automatic configure end-to-end encryption in ${r} updates?`});if(await fn(i,t,e),i){let o=ve();o.start(`Running: ${n.runner} @capgo/cli@latest key create`),await ew({force:!0},!1)?o.stop("key created \u{1F511}"):(o.stop("Error"),p.warn("Cannot create key \u274C"),X("Bye \u{1F44B}"),(0,dr.exit)(1)),Hn("onboarding-v2",t,e,"Use encryption v2")}await $r(t,e,6)}async function Mue(t,e,r){let n=Nt(),i=await Te({message:`Automatic build ${r} with "${n.pm} run build" ?`});if(await fn(i,t,e),i){let o=ve(),s=await tb(),a=await rj(s);o.start(`Running: ${n.pm} run ${a} && ${n.runner} cap sync`),(await jt()).scripts[a]||(o.stop("Error"),p.warn(`Cannot find ${a} script in package.json, please add it and run \`capgo init\` again`),X("Bye \u{1F44B}"),(0,dr.exit)()),(0,Qc.execSync)(`${n.pm} run ${a} && ${n.runner} cap sync`,VL),o.stop("Build & Sync Done \u2705")}else p.info(`Build yourself with command: ${n.pm} run build && ${n.runner} cap sync`);await $r(t,e,7)}async function Uue(t,e,r){let n=Nt(),i=await Te({message:`Automatic upload ${r} bundle to Capgo?`});if(await fn(i,t,e),i){let o=ve();o.start(`Running: ${n.runner} @capgo/cli@latest bundle upload`),await hp(r,{channel:Zc,apikey:e},!1)?o.stop("Upload Done \u2705"):(o.stop("Error"),p.warn("Upload failed \u274C"),X("Bye \u{1F44B}"),(0,dr.exit)())}else p.info(`Upload yourself with command: ${n.runner} @capgo/cli@latest bundle upload`);await $r(t,e,8)}async function Vue(t,e){let r=Nt(),n=await Te({message:"Run in device now ?"});if(await fn(n,t,e),n){let i=await Bo({message:"Pick a platform to run your app",options:[{value:"ios",label:"IOS"},{value:"android",label:"Android"}]});qt(i)&&(X("Bye \u{1F44B}"),(0,dr.exit)());let o=i,s=ve();s.start(`Running: ${r.runner} cap run ${o}`),await(0,Qc.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 $r(t,e,9)}async function Hue(t,e,r,n){let i=await Te({message:"Automatic check if update working in device ?"});if(await fn(i,t,e),i)p.info(`Wait logs sent to Capgo from ${r} device, Please open your app \u{1F4AA}`),await Qb("onboarding-v2",e,r,e,t);else{let o=wo(r);p.info(`Check logs in ${n}/app/p/${o}/logs to see if update works.`)}await $r(t,e,10)}async function zL(t,e,r){let n=Nt();Y("Capgo onboarding \u{1F6EB}"),await ye();let i=await ee(),o=await Cr();e=e||i?.config?.appId,r.apikey=t||pe();let s=ve();(!qL()||t)&&(s.start(`Running: ${n.runner} @capgo/cli@latest login ***`),await nw(r.apikey,r,!1),s.stop("Login Done \u2705"));let a=await de(r.apikey);await me(a,r.apikey,["upload","all","read","write"]);let u=await ma(a,["admin","super_admin"]),c=u.gid,l=await Pue(c,r.apikey)??0;try{l<1&&await $r(c,r.apikey,1),l<2&&(await $ue(u,r.apikey,e,r),Si(2)),l<3&&(await Iue(c,r.apikey,e),Si(3)),l<4&&(await Lue(c,r.apikey,e),Si(4)),l<5&&(await Bue(c,r.apikey,e),Si(5)),l<6&&(await que(c,r.apikey,e),Si(6)),l<7&&(await Mue(c,r.apikey,e),Si(7)),l<8&&(await Uue(c,r.apikey,e),Si(8)),l<9&&(await Vue(c,r.apikey),Si(9)),await Hue(c,r.apikey,e,o.hostWeb),await $r(c,r.apikey,0),Rue()}catch(f){console.error(f),p.error("Error during onboarding, please try again later"),(0,dr.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\``),X("Bye \u{1F44B}"),(0,dr.exit)()}var dn=require("node:fs");async function zue(t,e=!0){e&&Y("Save keys \u{1F511}");let r=await ee(),n=t.key||tr,i=t.keyData||"";if(!(0,dn.existsSync)(n)&&!i)if(e)p.error(`Cannot find public key ${n} or as keyData option or in ${r.path}`),A.error("");else return!1;else(0,dn.existsSync)(n)&&(i=(0,dn.readFileSync)(n).toString());return r?.config&&(r.config.plugins||(r.config.plugins={extConfig:{},CapacitorUpdater:{}}),r.config.plugins.CapacitorUpdater||(r.config.plugins.CapacitorUpdater={}),r.config.plugins.CapacitorUpdater.privateKey=i,await on(r)),p&&(p.success(`private key saved into ${r.path} file in local directory`),p.success("your app will decode the zip archive with this key")),!0}async function GL(t){Y("Save keys \u{1F511}"),await ye(),await zue(t)}async function Gue(t,e=!0){e&&Y("Create keys \u{1F511}");let{publicKey:r,privateKey:n}=tp();if((0,dn.existsSync)(cr)&&!t.force)if(p.error("Public Key already exists, use --force to overwrite"),e)A.error("");else return!1;if((0,dn.writeFileSync)(cr,r),(0,dn.existsSync)(tr)&&!t.force)if(p.error("Private Key already exists, use --force to overwrite"),e)A.error("");else return!1;(0,dn.writeFileSync)(tr,n);let i=n.replace(/\\n/g,"\\n"),o=await da({privateKey:i});return e&&(p.success("Your RSA key has been generated"),p.success(`Public key saved in ${cr}`),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(`Private key saved in ${o.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"),X("Done \u2705")),!0}async function WL(t){await ye(),await Gue(t)}async function KL(t){Y("Getting user id"),t.apikey=t.apikey||pe();let e=await de(t.apikey),r=await me(e,t.apikey,["read","all","write"]);X(`Done \u2705: ${r}`)}async function YL(t,e){Y("Check compatibility"),e.apikey=e.apikey||pe();let r=await ee();t=t||r?.config?.appId;let{channel:n}=e;n||(p.error("Missing argument, you need to provide a channel"),A.error("")),e.apikey||(p.error("Missing API key, you need to provide a API key to upload your bundle"),A.error("")),t||(p.error("Missing argument, you need to provide a appId, or be in a capacitor project"),A.error(""));let i=await de(e.apikey);await me(i,e.apikey,["write","all","read","upload"]),await qe(i,e.apikey,t,1);let{finalCompatibility:o}=await Rh(i,t,n,e.packageJson),s=new lr;s.headers=["Package","Local version","Remote version","Compatible"],s.theme=lr.roundTheme,s.rows=[];let a=e.text?"Yes":"\u2705",u=e.text?"No":"\u274C";o.forEach(c=>{let{name:l,localVersion:f,remoteVersion:h}=c,d=h===f?a:u;s.rows.push([l,f,h,d])}),p.success("Compatibility"),p.success(s.toString())}A.name(Ir.name).description("Manage packages and bundle versions in Capgo Cloud").version(Ir.version);A.command("login [apikey]").alias("l").description("Save apikey to your machine or folder").action(ML).option("--local","Only save in local folder");A.command("doctor").description("Get info about your Capgo app install").option("--package-json <packageJson>","A path to package.json. Usefull for monorepos").action(M8);A.command("init [apikey] [appId]").description("Init a new app").action(zL).option("-n, --name <name>","app name").option("-i, --icon <icon>","app icon path");var Ia=A.command("app").description("Manage app");Ia.command("add [appId]").alias("a").description("Add a new app in Capgo Cloud").action(L8).option("-n, --name <name>","app name").option("-i, --icon <icon>","app icon path").option("-a, --apikey <apikey>","apikey to link to your account");Ia.command("delete [appId]").description("Delete an app in Capgo Cloud").action(q8).option("-a, --apikey <apikey>","apikey to link to your account");Ia.command("list").alias("l").description("list apps in Capgo Cloud").action(V8).option("-a, --apikey <apikey>","apikey to link to your account");Ia.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(jL);Ia.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(W8);Ia.command("set [appId]").alias("s").description("Set an app in Capgo Cloud").action(G8).option("-n, --name <name>","app name").option("-i, --icon <icon>","app icon path").option("-a, --apikey <apikey>","apikey to link to your account").option("-r, --retention <retention>","retention period of app bundle in days");var hn=A.command("bundle").description("Manage bundle");hn.command("upload [appId]").alias("u").description("Upload a new bundle in Capgo Cloud").action(iL).option("-a, --apikey <apikey>","apikey to link to your account").option("-p, --path <path>","path of the folder to upload").option("-c, --channel <channel>","channel to link to").option("-e, --external <url>","link to external url intead of upload to Capgo Cloud").option("--iv-session-key <key>","Set the iv and session key for bundle url external").option("--s3-region <region>","Region for your S3 bucket").option("--s3-apikey <apikey>","Apikey for your S3 endpoint").option("--s3-apisecret <apisecret>","Api secret for your S3 endpoint").option("--s3-endoint <s3Endpoint>","Url of S3 endpoint").option("--s3-bucket-name <bucketName>","Name for your AWS S3 bucket").option("--s3-port <port>","Port for your S3 endpoint").option("--no-s3-ssl","Disable SSL for S3 upload").option("--key <key>","custom path for public signing key").option("--key-data <keyData>","public signing key").option("--key-v2 <key>","custom path for private signing key").option("--key-data-v2 <keyDataV2>","private signing key").option("--bundle-url","prints bundle url into stdout").option("--no-key","ignore signing key and send clear update").option("--no-code-check","Ignore checking if notifyAppReady() is called in soure code and index present in root folder").option("--display-iv-session","Show in the console the iv and session key used to encrypt the update").option("-b, --bundle <bundle>","bundle version number of the bundle to upload").option("--min-update-version <minUpdateVersion>","Minimal version required to update to this version. Used only if the disable auto update is set to metadata in channel").option("--auto-min-update-version","Set the min update version based on native packages").option("--ignore-metadata-check","Ignores the metadata (node_modules) check when uploading").option("--ignore-checksum-check","Ignores the checksum check when uploading").option("--timeout <timeout>","Timeout for the upload process in seconds").option("--multipart","Uses multipart protocol to upload data to S3, Deprecated, use tus instead").option("--tus","Upload the bundle using TUS to Capgo cloud").option("--partial","Upload partial files to Capgo cloud").option("--encrypted-checksum <encryptedChecksum>","An encrypted checksum (signature). Used only when uploading an external bundle.").option("--package-json <packageJson>","A path to package.json. Usefull for monorepos").option("--auto-set-bundle","Set the bundle in capacitor.config.json").option("--dry-run","Dry run the upload process");hn.command("compatibility [appId]").action(YL).option("-a, --apikey <apikey>","apikey to link to your account").option("-c, --channel <channel>","channel to check the compatibility with").option("--text","output text instead of emojis").option("--package-json <packageJson>","A path to package.json. Usefull for monorepos");hn.command("delete [bundleId] [appId]").alias("d").description("Delete a bundle in Capgo Cloud").action(TN).option("-a, --apikey <apikey>","apikey to link to your account");hn.command("list [appId]").alias("l").description("List bundle in Capgo Cloud").action(NN).option("-a, --apikey <apikey>","apikey to link to your account");hn.command("cleanup [appId]").alias("c").action(yN).description("Cleanup bundle in Capgo Cloud").option("-b, --bundle <bundle>","bundle version number of the app to delete").option("-a, --apikey <apikey>","apikey to link to your account").option("-k, --keep <keep>","number of version to keep").option("-f, --force","force removal");hn.command("decrypt [zipPath] [sessionKey]").description("Decrypt a signed zip bundle").action(EN).option("--key <key>","custom path for private signing key").option("--key-data <keyData>","private signing key");hn.command("encrypt [zipPath]").description("Encrypt a zip bundle").action(RN).option("--key <key>","custom path for private signing key").option("--key-data <keyData>","private signing key");hn.command("encryptV2 [zipPath] [checksum]").description("Encrypt a zip bundle using the new encryption method").action(IN).option("--key <key>","custom path for private signing key").option("--key-data <keyData>","private signing key").option("-j, --json","output in JSON");hn.command("decryptV2 [zipPath] [checksum]").description("Decrypt a zip bundle using the new encryption method").action(AN).option("--key <key>","custom path for private signing key").option("--key-data <keyData>","private signing key").option("--checksum <checksum>","checksum of the bundle, to verify the integrity of the bundle");hn.command("zip [appId]").description("Zip a bundle").action(uL).option("-p, --path <path>","path of the folder to upload").option("-b, --bundle <bundle>","bundle version number to name the zip file").option("-n, --name <name>","name of the zip file").option("-j, --json","output in JSON").option("--no-code-check","Ignore checking if notifyAppReady() is called in soure code and index present in root folder").option("--key-v2","use encryption v2").option("--package-json <packageJson>","A path to package.json. Usefull for monorepos");var el=A.command("channel").description("Manage channel");el.command("add [channelId] [appId]").alias("a").description("Create channel").action(lL).option("-d, --default","set the channel as default").option("-a, --apikey <apikey>","apikey to link to your account");el.command("delete [channelId] [appId]").alias("d").description("Delete channel").action(pL).option("-a, --apikey <apikey>","apikey to link to your account");el.command("list [appId]").alias("l").description("List channel").action(gL).option("-a, --apikey <apikey>","apikey to link to your account");el.command("currentBundle [channel] [appId]").description("Get current bundle for specific channel in Capgo Cloud").action(dL).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");el.command("set [channelId] [appId]").alias("s").description("Set channel").action(vL).option("-a, --apikey <apikey>","apikey to link to your account").option("-b, --bundle <bundle>","bundle version number of the file to set").option("-s, --state <state>","set the state of the channel, default or normal").option("--latest","get the latest version key in the package.json to set it to the channel").option("--downgrade","Allow to downgrade to version under native one").option("--no-downgrade","Disable downgrade to version under native one").option("--upgrade","Allow to upgrade to version above native one").option("--no-upgrade","Disable upgrade to version above native one").option("--ios","Allow sending update to ios devices").option("--no-ios","Disable sending update to ios devices").option("--android","Allow sending update to android devices").option("--no-android","Disable sending update to android devices").option("--self-assign","Allow to device to self assign to this channel").option("--no-self-assign","Disable devices to self assign to this channel").option("--disable-auto-update <disableAutoUpdate>","Disable auto update strategy for this channel.The possible options are: major, minor, metadata, patch, none").option("--dev","Allow sending update to development devices").option("--no-dev","Disable sending update to development devices").option("--emulator","Allow sending update to emulator devices").option("--no-emulator","Disable sending update to emulator devices").option("--package-json <packageJson>","A path to package.json. Usefull for monorepos");var JL=A.command("key_old").description("Manage old encryption key");JL.command("save").description("Save base64 encryption key in capacitor config, usefull for CI").action(GL).option("-f, --force","force generate a new one").option("--key","key path to save in capacitor config").option("--key-data","key data to save in capacitor config");JL.command("create").description("Create a new encryption key").action(WL).option("-f, --force","force generate a new one");var iw=A.command("key").description("Manage encryption key");iw.command("save").description("Save base64 encryption key in capacitor config, usefull for CI").action(NL).option("-f, --force","force generate a new one").option("--key","key path to save in capacitor config").option("--key-data","key data to save in capacitor config");iw.command("create").description("Create a new encryption key").action(LL).option("-f, --force","force generate a new one");iw.command("delete_old").description("Delete the old encryption key").action(BL);A.command("upload [appId]").alias("u").description("(Deprecated) Upload a new bundle to Capgo Cloud").action(oL).option("-a, --apikey <apikey>","apikey to link to your account").option("-p, --path <path>","path of the folder to upload").option("-c, --channel <channel>","channel to link to").option("-e, --external <url>","link to external url intead of upload to Capgo Cloud").option("--old-encryption","use old encryption").option("--key <key>","custom path for public signing key").option("--key-data <keyData>","public signing key").option("--bundle-url","prints bundle url into stdout").option("--no-key","ignore signing key and send clear update").option("--display-iv-session","Show in the console the iv and session key used to encrypt the update").option("-b, --bundle <bundle>","bundle version number of the file to upload").option("--min-update-version <minUpdateVersion>","Minimal version required to update to this version. Used only if the disable auto update is set to metadata in channel");var Wue=A.command("account").description("Manage account");Wue.command("id").description("Get your account ID").action(KL).option("-a, --apikey <apikey>","apikey to link to your account");A.parseAsync();
330
330
  /*! Bundled license information:
331
331
 
332
332
  safe-buffer/index.js: