@capgo/cli 7.0.5 → 7.0.8

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,11 +1,11 @@
1
1
  #!/usr/bin/env node
2
- "use strict";var G8=Object.create;var Ml=Object.defineProperty;var W8=Object.getOwnPropertyDescriptor;var K8=Object.getOwnPropertyNames;var Y8=Object.getPrototypeOf,J8=Object.prototype.hasOwnProperty;var Ct=(t,e)=>()=>(t&&(e=t(t=0)),e);var y=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),gi=(t,e)=>{for(var r in e)Ml(t,r,{get:e[r],enumerable:!0})},kb=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of K8(e))!J8.call(t,i)&&i!==r&&Ml(t,i,{get:()=>e[i],enumerable:!(n=W8(e,i))||n.enumerable});return t};var ue=(t,e,r)=>(r=t!=null?G8(Y8(t)):{},kb(e||!t||!t.__esModule?Ml(r,"default",{value:t,enumerable:!0}):r,t)),je=t=>kb(Ml({},"__esModule",{value:!0}),t);var Oa=y(Kh=>{var Ul=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}},Wh=class extends Ul{constructor(e){super(1,"commander.invalidArgument",e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};Kh.CommanderError=Ul;Kh.InvalidArgumentError=Wh});var Hl=y(Jh=>{var{InvalidArgumentError:X8}=Oa(),Yh=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 X8(`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 Z8(t){let e=t.name()+(t.variadic===!0?"...":"");return t.required?"<"+e+">":"["+e+"]"}Jh.Argument=Yh;Jh.humanReadableArgName=Z8});var Qh=y(Zh=>{var{humanReadableArgName:Q8}=Hl(),Xh=class{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(e){this.helpWidth=this.helpWidth??e.helpWidth??80}visibleCommands(e){let r=e.commands.filter(i=>!i._hidden),n=e._getHelpCommand();return n&&!n._hidden&&r.push(n),this.sortSubcommands&&r.sort((i,o)=>i.name().localeCompare(o.name())),r}compareOptions(e,r){let n=i=>i.short?i.short.replace(/^-/,""):i.long.replace(/^--/,"");return n(e).localeCompare(n(r))}visibleOptions(e){let r=e.options.filter(i=>!i.hidden),n=e._getHelpOption();if(n&&!n.hidden){let i=n.short&&e._findOption(n.short),o=n.long&&e._findOption(n.long);!i&&!o?r.push(n):n.long&&!o?r.push(e.createOption(n.long,n.description)):n.short&&!i&&r.push(e.createOption(n.short,n.description))}return this.sortOptions&&r.sort(this.compareOptions),r}visibleGlobalOptions(e){if(!this.showGlobalOptions)return[];let r=[];for(let n=e.parent;n;n=n.parent){let i=n.options.filter(o=>!o.hidden);r.push(...i)}return this.sortOptions&&r.sort(this.compareOptions),r}visibleArguments(e){return e._argsDescription&&e.registeredArguments.forEach(r=>{r.description=r.description||e._argsDescription[r.name()]||""}),e.registeredArguments.find(r=>r.description)?e.registeredArguments:[]}subcommandTerm(e){let r=e.registeredArguments.map(n=>Q8(n)).join(" ");return e._name+(e._aliases[0]?"|"+e._aliases[0]:"")+(e.options.length?" [options]":"")+(r?" "+r:"")}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,r){return r.visibleCommands(e).reduce((n,i)=>Math.max(n,this.displayWidth(r.styleSubcommandTerm(r.subcommandTerm(i)))),0)}longestOptionTermLength(e,r){return r.visibleOptions(e).reduce((n,i)=>Math.max(n,this.displayWidth(r.styleOptionTerm(r.optionTerm(i)))),0)}longestGlobalOptionTermLength(e,r){return r.visibleGlobalOptions(e).reduce((n,i)=>Math.max(n,this.displayWidth(r.styleOptionTerm(r.optionTerm(i)))),0)}longestArgumentTermLength(e,r){return r.visibleArguments(e).reduce((n,i)=>Math.max(n,this.displayWidth(r.styleArgumentTerm(r.argumentTerm(i)))),0)}commandUsage(e){let r=e._name;e._aliases[0]&&(r=r+"|"+e._aliases[0]);let n="";for(let i=e.parent;i;i=i.parent)n=i.name()+" "+n;return n+r+" "+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.summary()||e.description()}optionDescription(e){let r=[];return e.argChoices&&r.push(`choices: ${e.argChoices.map(n=>JSON.stringify(n)).join(", ")}`),e.defaultValue!==void 0&&(e.required||e.optional||e.isBoolean()&&typeof e.defaultValue=="boolean")&&r.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),e.presetArg!==void 0&&e.optional&&r.push(`preset: ${JSON.stringify(e.presetArg)}`),e.envVar!==void 0&&r.push(`env: ${e.envVar}`),r.length>0?`${e.description} (${r.join(", ")})`:e.description}argumentDescription(e){let r=[];if(e.argChoices&&r.push(`choices: ${e.argChoices.map(n=>JSON.stringify(n)).join(", ")}`),e.defaultValue!==void 0&&r.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),r.length>0){let n=`(${r.join(", ")})`;return e.description?`${e.description} ${n}`:n}return e.description}formatHelp(e,r){let n=r.padWidth(e,r),i=r.helpWidth??80;function o(f,h){return r.formatItem(f,n,h,r)}let s=[`${r.styleTitle("Usage:")} ${r.styleUsage(r.commandUsage(e))}`,""],a=r.commandDescription(e);a.length>0&&(s=s.concat([r.boxWrap(r.styleCommandDescription(a),i),""]));let u=r.visibleArguments(e).map(f=>o(r.styleArgumentTerm(r.argumentTerm(f)),r.styleArgumentDescription(r.argumentDescription(f))));u.length>0&&(s=s.concat([r.styleTitle("Arguments:"),...u,""]));let l=r.visibleOptions(e).map(f=>o(r.styleOptionTerm(r.optionTerm(f)),r.styleOptionDescription(r.optionDescription(f))));if(l.length>0&&(s=s.concat([r.styleTitle("Options:"),...l,""])),r.showGlobalOptions){let f=r.visibleGlobalOptions(e).map(h=>o(r.styleOptionTerm(r.optionTerm(h)),r.styleOptionDescription(r.optionDescription(h))));f.length>0&&(s=s.concat([r.styleTitle("Global Options:"),...f,""]))}let c=r.visibleCommands(e).map(f=>o(r.styleSubcommandTerm(r.subcommandTerm(f)),r.styleSubcommandDescription(r.subcommandDescription(f))));return c.length>0&&(s=s.concat([r.styleTitle("Commands:"),...c,""])),s.join(`
2
+ "use strict";var G8=Object.create;var Ml=Object.defineProperty;var W8=Object.getOwnPropertyDescriptor;var K8=Object.getOwnPropertyNames;var Y8=Object.getPrototypeOf,J8=Object.prototype.hasOwnProperty;var Ct=(t,e)=>()=>(t&&(e=t(t=0)),e);var D=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),gi=(t,e)=>{for(var r in e)Ml(t,r,{get:e[r],enumerable:!0})},kb=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of K8(e))!J8.call(t,i)&&i!==r&&Ml(t,i,{get:()=>e[i],enumerable:!(n=W8(e,i))||n.enumerable});return t};var ue=(t,e,r)=>(r=t!=null?G8(Y8(t)):{},kb(e||!t||!t.__esModule?Ml(r,"default",{value:t,enumerable:!0}):r,t)),je=t=>kb(Ml({},"__esModule",{value:!0}),t);var Oa=D(Kh=>{var Ul=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}},Wh=class extends Ul{constructor(e){super(1,"commander.invalidArgument",e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};Kh.CommanderError=Ul;Kh.InvalidArgumentError=Wh});var Hl=D(Jh=>{var{InvalidArgumentError:X8}=Oa(),Yh=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 X8(`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 Z8(t){let e=t.name()+(t.variadic===!0?"...":"");return t.required?"<"+e+">":"["+e+"]"}Jh.Argument=Yh;Jh.humanReadableArgName=Z8});var Qh=D(Zh=>{var{humanReadableArgName:Q8}=Hl(),Xh=class{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(e){this.helpWidth=this.helpWidth??e.helpWidth??80}visibleCommands(e){let r=e.commands.filter(i=>!i._hidden),n=e._getHelpCommand();return n&&!n._hidden&&r.push(n),this.sortSubcommands&&r.sort((i,o)=>i.name().localeCompare(o.name())),r}compareOptions(e,r){let n=i=>i.short?i.short.replace(/^-/,""):i.long.replace(/^--/,"");return n(e).localeCompare(n(r))}visibleOptions(e){let r=e.options.filter(i=>!i.hidden),n=e._getHelpOption();if(n&&!n.hidden){let i=n.short&&e._findOption(n.short),o=n.long&&e._findOption(n.long);!i&&!o?r.push(n):n.long&&!o?r.push(e.createOption(n.long,n.description)):n.short&&!i&&r.push(e.createOption(n.short,n.description))}return this.sortOptions&&r.sort(this.compareOptions),r}visibleGlobalOptions(e){if(!this.showGlobalOptions)return[];let r=[];for(let n=e.parent;n;n=n.parent){let i=n.options.filter(o=>!o.hidden);r.push(...i)}return this.sortOptions&&r.sort(this.compareOptions),r}visibleArguments(e){return e._argsDescription&&e.registeredArguments.forEach(r=>{r.description=r.description||e._argsDescription[r.name()]||""}),e.registeredArguments.find(r=>r.description)?e.registeredArguments:[]}subcommandTerm(e){let r=e.registeredArguments.map(n=>Q8(n)).join(" ");return e._name+(e._aliases[0]?"|"+e._aliases[0]:"")+(e.options.length?" [options]":"")+(r?" "+r:"")}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,r){return r.visibleCommands(e).reduce((n,i)=>Math.max(n,this.displayWidth(r.styleSubcommandTerm(r.subcommandTerm(i)))),0)}longestOptionTermLength(e,r){return r.visibleOptions(e).reduce((n,i)=>Math.max(n,this.displayWidth(r.styleOptionTerm(r.optionTerm(i)))),0)}longestGlobalOptionTermLength(e,r){return r.visibleGlobalOptions(e).reduce((n,i)=>Math.max(n,this.displayWidth(r.styleOptionTerm(r.optionTerm(i)))),0)}longestArgumentTermLength(e,r){return r.visibleArguments(e).reduce((n,i)=>Math.max(n,this.displayWidth(r.styleArgumentTerm(r.argumentTerm(i)))),0)}commandUsage(e){let r=e._name;e._aliases[0]&&(r=r+"|"+e._aliases[0]);let n="";for(let i=e.parent;i;i=i.parent)n=i.name()+" "+n;return n+r+" "+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.summary()||e.description()}optionDescription(e){let r=[];return e.argChoices&&r.push(`choices: ${e.argChoices.map(n=>JSON.stringify(n)).join(", ")}`),e.defaultValue!==void 0&&(e.required||e.optional||e.isBoolean()&&typeof e.defaultValue=="boolean")&&r.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),e.presetArg!==void 0&&e.optional&&r.push(`preset: ${JSON.stringify(e.presetArg)}`),e.envVar!==void 0&&r.push(`env: ${e.envVar}`),r.length>0?`${e.description} (${r.join(", ")})`:e.description}argumentDescription(e){let r=[];if(e.argChoices&&r.push(`choices: ${e.argChoices.map(n=>JSON.stringify(n)).join(", ")}`),e.defaultValue!==void 0&&r.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),r.length>0){let n=`(${r.join(", ")})`;return e.description?`${e.description} ${n}`:n}return e.description}formatHelp(e,r){let n=r.padWidth(e,r),i=r.helpWidth??80;function o(f,h){return r.formatItem(f,n,h,r)}let s=[`${r.styleTitle("Usage:")} ${r.styleUsage(r.commandUsage(e))}`,""],a=r.commandDescription(e);a.length>0&&(s=s.concat([r.boxWrap(r.styleCommandDescription(a),i),""]));let u=r.visibleArguments(e).map(f=>o(r.styleArgumentTerm(r.argumentTerm(f)),r.styleArgumentDescription(r.argumentDescription(f))));u.length>0&&(s=s.concat([r.styleTitle("Arguments:"),...u,""]));let l=r.visibleOptions(e).map(f=>o(r.styleOptionTerm(r.optionTerm(f)),r.styleOptionDescription(r.optionDescription(f))));if(l.length>0&&(s=s.concat([r.styleTitle("Options:"),...l,""])),r.showGlobalOptions){let f=r.visibleGlobalOptions(e).map(h=>o(r.styleOptionTerm(r.optionTerm(h)),r.styleOptionDescription(r.optionDescription(h))));f.length>0&&(s=s.concat([r.styleTitle("Global Options:"),...f,""]))}let c=r.visibleCommands(e).map(f=>o(r.styleSubcommandTerm(r.subcommandTerm(f)),r.styleSubcommandDescription(r.subcommandDescription(f))));return c.length>0&&(s=s.concat([r.styleTitle("Commands:"),...c,""])),s.join(`
3
3
  `)}displayWidth(e){return Tb(e).length}styleTitle(e){return e}styleUsage(e){return e.split(" ").map(r=>r==="[options]"?this.styleOptionText(r):r==="[command]"?this.styleSubcommandText(r):r[0]==="["||r[0]==="<"?this.styleArgumentText(r):this.styleCommandText(r)).join(" ")}styleCommandDescription(e){return this.styleDescriptionText(e)}styleOptionDescription(e){return this.styleDescriptionText(e)}styleSubcommandDescription(e){return this.styleDescriptionText(e)}styleArgumentDescription(e){return this.styleDescriptionText(e)}styleDescriptionText(e){return e}styleOptionTerm(e){return this.styleOptionText(e)}styleSubcommandTerm(e){return e.split(" ").map(r=>r==="[options]"?this.styleOptionText(r):r[0]==="["||r[0]==="<"?this.styleArgumentText(r):this.styleSubcommandText(r)).join(" ")}styleArgumentTerm(e){return this.styleArgumentText(e)}styleOptionText(e){return e}styleArgumentText(e){return e}styleSubcommandText(e){return e}styleCommandText(e){return e}padWidth(e,r){return Math.max(r.longestOptionTermLength(e,r),r.longestGlobalOptionTermLength(e,r),r.longestSubcommandTermLength(e,r),r.longestArgumentTermLength(e,r))}preformatted(e){return/\n[^\S\r\n]/.test(e)}formatItem(e,r,n,i){let s=" ".repeat(2);if(!n)return s+e;let a=e.padEnd(r+e.length-i.displayWidth(e)),u=2,c=(this.helpWidth??80)-r-u-2,f;return c<this.minWidthToWrap||i.preformatted(n)?f=n:f=i.boxWrap(n,c).replace(/\n/g,`
4
4
  `+" ".repeat(r+u)),s+a+" ".repeat(u)+f.replace(/\n/g,`
5
5
  ${s}`)}boxWrap(e,r){if(r<this.minWidthToWrap)return e;let n=e.split(/\r\n|\n/),i=/[\s]*[^\s]+/g,o=[];return n.forEach(s=>{let a=s.match(i);if(a===null){o.push("");return}let u=[a.shift()],l=this.displayWidth(u[0]);a.forEach(c=>{let f=this.displayWidth(c);if(l+f<=r){u.push(c),l+=f;return}o.push(u.join(""));let h=c.trimStart();u=[h],l=this.displayWidth(h)}),o.push(u.join(""))}),o.join(`
6
- `)}};function Tb(t){let e=/\x1b\[\d*(;\d*)*m/g;return t.replace(e,"")}Zh.Help=Xh;Zh.stripColor=Tb});var np=y(rp=>{var{InvalidArgumentError:eN}=Oa(),ep=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=tN(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 eN(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(r,n):r},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return this.negate?Pb(this.name().replace(/^no-/,"")):Pb(this.name())}is(e){return this.short===e||this.long===e}isBoolean(){return!this.required&&!this.optional&&!this.negate}},tp=class{constructor(e){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,e.forEach(r=>{r.negate?this.negativeOptions.set(r.attributeName(),r):this.positiveOptions.set(r.attributeName(),r)}),this.negativeOptions.forEach((r,n)=>{this.positiveOptions.has(n)&&this.dualOptions.add(n)})}valueFromOption(e,r){let n=r.attributeName();if(!this.dualOptions.has(n))return!0;let i=this.negativeOptions.get(n).presetArg,o=i!==void 0?i:!1;return r.negate===(o===e)}};function Pb(t){return t.split("-").reduce((e,r)=>e+r[0].toUpperCase()+r.slice(1))}function tN(t){let e,r,n=/^-[^-]$/,i=/^--[^-]/,o=t.split(/[ |,]+/).concat("guard");if(n.test(o[0])&&(e=o.shift()),i.test(o[0])&&(r=o.shift()),/^-[^-][^-]/.test(o[0]))throw new Error(`invalid Option flags, short option is dash and single character: '${t}'`);if(e&&n.test(o[0]))throw new Error(`invalid Option flags, more than one short flag: '${t}'`);if(r&&i.test(o[0]))throw new Error(`invalid Option flags, more than one long flag: '${t}'`);if(!(e||r)||o[0].startsWith("-"))throw new Error(`invalid Option flags: '${t}'`);return{shortFlag:e,longFlag:r}}rp.Option=ep;rp.DualOptions=tp});var $b=y(Rb=>{function rN(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 nN(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=rN(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?`
6
+ `)}};function Tb(t){let e=/\x1b\[\d*(;\d*)*m/g;return t.replace(e,"")}Zh.Help=Xh;Zh.stripColor=Tb});var np=D(rp=>{var{InvalidArgumentError:eN}=Oa(),ep=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=tN(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 eN(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(r,n):r},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return this.negate?Pb(this.name().replace(/^no-/,"")):Pb(this.name())}is(e){return this.short===e||this.long===e}isBoolean(){return!this.required&&!this.optional&&!this.negate}},tp=class{constructor(e){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,e.forEach(r=>{r.negate?this.negativeOptions.set(r.attributeName(),r):this.positiveOptions.set(r.attributeName(),r)}),this.negativeOptions.forEach((r,n)=>{this.positiveOptions.has(n)&&this.dualOptions.add(n)})}valueFromOption(e,r){let n=r.attributeName();if(!this.dualOptions.has(n))return!0;let i=this.negativeOptions.get(n).presetArg,o=i!==void 0?i:!1;return r.negate===(o===e)}};function Pb(t){return t.split("-").reduce((e,r)=>e+r[0].toUpperCase()+r.slice(1))}function tN(t){let e,r,n=/^-[^-]$/,i=/^--[^-]/,o=t.split(/[ |,]+/).concat("guard");if(n.test(o[0])&&(e=o.shift()),i.test(o[0])&&(r=o.shift()),/^-[^-][^-]/.test(o[0]))throw new Error(`invalid Option flags, short option is dash and single character: '${t}'`);if(e&&n.test(o[0]))throw new Error(`invalid Option flags, more than one short flag: '${t}'`);if(r&&i.test(o[0]))throw new Error(`invalid Option flags, more than one long flag: '${t}'`);if(!(e||r)||o[0].startsWith("-"))throw new Error(`invalid Option flags: '${t}'`);return{shortFlag:e,longFlag:r}}rp.Option=ep;rp.DualOptions=tp});var $b=D(Rb=>{function rN(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 nN(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=rN(t,s),u=Math.max(t.length,s.length);(u-a)/u>o&&(a<i?(i=a,n=[s]):a===i&&n.push(s))}),n.sort((s,a)=>s.localeCompare(a)),r&&(n=n.map(s=>`--${s}`)),n.length>1?`
7
7
  (Did you mean one of ${n.join(", ")}?)`:n.length===1?`
8
- (Did you mean ${n[0]}?)`:""}Rb.suggestSimilar=nN});var Lb=y(up=>{var iN=require("node:events").EventEmitter,ip=require("node:child_process"),cn=require("node:path"),Vl=require("node:fs"),De=require("node:process"),{Argument:oN,humanReadableArgName:sN}=Hl(),{CommanderError:op}=Oa(),{Help:aN,stripColor:uN}=Qh(),{Option:Ib,DualOptions:lN}=np(),{suggestSimilar:jb}=$b(),sp=class t extends iN{constructor(e){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!1,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=e||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._savedState=null,this._outputConfiguration={writeOut:r=>De.stdout.write(r),writeErr:r=>De.stderr.write(r),outputError:(r,n)=>n(r),getOutHelpWidth:()=>De.stdout.isTTY?De.stdout.columns:void 0,getErrHelpWidth:()=>De.stderr.isTTY?De.stderr.columns:void 0,getOutHasColors:()=>ap()??(De.stdout.isTTY&&De.stdout.hasColors?.()),getErrHasColors:()=>ap()??(De.stderr.isTTY&&De.stderr.hasColors?.()),stripColor:r=>uN(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 aN,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
8
+ (Did you mean ${n[0]}?)`:""}Rb.suggestSimilar=nN});var Lb=D(up=>{var iN=require("node:events").EventEmitter,ip=require("node:child_process"),cn=require("node:path"),Vl=require("node:fs"),De=require("node:process"),{Argument:oN,humanReadableArgName:sN}=Hl(),{CommanderError:op}=Oa(),{Help:aN,stripColor:uN}=Qh(),{Option:Ib,DualOptions:lN}=np(),{suggestSimilar:jb}=$b(),sp=class t extends iN{constructor(e){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!1,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=e||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._savedState=null,this._outputConfiguration={writeOut:r=>De.stdout.write(r),writeErr:r=>De.stderr.write(r),outputError:(r,n)=>n(r),getOutHelpWidth:()=>De.stdout.isTTY?De.stdout.columns:void 0,getErrHelpWidth:()=>De.stderr.isTTY?De.stderr.columns:void 0,getOutHasColors:()=>ap()??(De.stdout.isTTY&&De.stdout.hasColors?.()),getErrHasColors:()=>ap()??(De.stderr.isTTY&&De.stderr.hasColors?.()),stripColor:r=>uN(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 aN,this.configureHelp())}configureHelp(e){return e===void 0?this._helpConfiguration:(this._helpConfiguration=e,this)}configureOutput(e){return e===void 0?this._outputConfiguration:(Object.assign(this._outputConfiguration,e),this)}showHelpAfterError(e=!0){return typeof e!="string"&&(e=!!e),this._showHelpAfterError=e,this}showSuggestionAfterError(e=!0){return this._showSuggestionAfterError=!!e,this}addCommand(e,r){if(!e._name)throw new Error(`Command passed to .addCommand() must have a name
9
9
  - specify the name in Command constructor or using .name()`);return r=r||{},r.isDefault&&(this._defaultCommandName=e._name),(r.noHelp||r.hidden)&&(e._hidden=!0),this._registerCommand(e),e.parent=this,e._checkForBrokenPassThrough(),this}createArgument(e,r){return new oN(e,r)}argument(e,r,n,i){let o=this.createArgument(e,r);return typeof n=="function"?o.default(i).argParser(n):o.default(n),this.addArgument(o),this}arguments(e){return e.trim().split(/ +/).forEach(r=>{this.argument(r)}),this}addArgument(e){let r=this.registeredArguments.slice(-1)[0];if(r&&r.variadic)throw new Error(`only the last argument can be variadic '${r.name()}'`);if(e.required&&e.defaultValue!==void 0&&e.parseArg===void 0)throw new Error(`a default value for a required argument is never used: '${e.name()}'`);return this.registeredArguments.push(e),this}helpCommand(e,r){if(typeof e=="boolean")return this._addImplicitHelpCommand=e,this;e=e??"help [command]";let[,n,i]=e.match(/([^ ]+) *(.*)/),o=r??"display help for command",s=this.createCommand(n);return s.helpOption(!1),i&&s.arguments(i),o&&s.description(o),this._addImplicitHelpCommand=!0,this._helpCommand=s,this}addHelpCommand(e,r){return typeof e!="object"?(this.helpCommand(e,r),this):(this._addImplicitHelpCommand=!0,this._helpCommand=e,this)}_getHelpCommand(){return this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"))?(this._helpCommand===void 0&&this.helpCommand(void 0,void 0),this._helpCommand):null}hook(e,r){let n=["preSubcommand","preAction","postAction"];if(!n.includes(e))throw new Error(`Unexpected value for event passed to hook : '${e}'.
10
10
  Expecting one of '${n.join("', '")}'`);return this._lifeCycleHooks[e]?this._lifeCycleHooks[e].push(r):this._lifeCycleHooks[e]=[r],this}exitOverride(e){return e?this._exitCallback=e:this._exitCallback=r=>{if(r.code!=="commander.executeSubCommandAsync")throw r},this}_exit(e,r,n){this._exitCallback&&this._exitCallback(new op(e,r,n)),De.exit(e)}action(e){let r=n=>{let i=this.registeredArguments.length,o=n.slice(0,i);return this._storeOptionsAsProperties?o[i]=this:o[i]=this.opts(),o.push(this),e.apply(this,o)};return this._actionHandler=r,this}createOption(e,r){return new Ib(e,r)}_callParseArg(e,r,n,i){try{return e.parseArg(r,n)}catch(o){if(o.code==="commander.invalidArgument"){let s=`${i} ${o.message}`;this.error(s,{exitCode:o.exitCode,code:o.code})}throw o}}_registerOption(e){let r=e.short&&this._findOption(e.short)||e.long&&this._findOption(e.long);if(r){let n=e.long&&this._findOption(e.long)?e.long:e.short;throw new Error(`Cannot add option '${e.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${n}'
11
11
  - already used by option '${r.flags}'`)}this.options.push(e)}_registerCommand(e){let r=i=>[i.name()].concat(i.aliases()),n=r(e).find(i=>this._findCommand(i));if(n){let i=r(this._findCommand(n)).join("|"),o=r(e).join("|");throw new Error(`cannot add command '${o}' as already have command '${i}'`)}this.commands.push(e)}addOption(e){this._registerOption(e);let r=e.name(),n=e.attributeName();if(e.negate){let o=e.long.replace(/^--no-/,"--");this._findOption(o)||this.setOptionValueWithSource(n,e.defaultValue===void 0?!0:e.defaultValue,"default")}else e.defaultValue!==void 0&&this.setOptionValueWithSource(n,e.defaultValue,"default");let i=(o,s,a)=>{o==null&&e.presetArg!==void 0&&(o=e.presetArg);let u=this.getOptionValue(n);o!==null&&e.parseArg?o=this._callParseArg(e,o,u,s):o!==null&&e.variadic&&(o=e._concatValue(o,u)),o==null&&(e.negate?o=!1:e.isBoolean()||e.optional?o=!0:o=""),this.setOptionValueWithSource(n,o,a)};return this.on("option:"+r,o=>{let s=`error: option '${e.flags}' argument '${o}' is invalid.`;i(o,s,"cli")}),e.envVar&&this.on("optionEnv:"+r,o=>{let s=`error: option '${e.flags}' value '${o}' from env '${e.envVar}' is invalid.`;i(o,s,"env")}),this}_optionEx(e,r,n,i,o){if(typeof r=="object"&&r instanceof Ib)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");let s=this.createOption(r,n);if(s.makeOptionMandatory(!!e.mandatory),typeof i=="function")s.default(o).argParser(i);else if(i instanceof RegExp){let a=i;i=(u,l)=>{let c=a.exec(u);return c?c[0]:l},s.default(o).argParser(i)}else s.default(i);return this.addOption(s)}option(e,r,n,i){return this._optionEx({},e,r,n,i)}requiredOption(e,r,n,i){return this._optionEx({mandatory:!0},e,r,n,i)}combineFlagAndOptionalValue(e=!0){return this._combineFlagAndOptionalValue=!!e,this}allowUnknownOption(e=!0){return this._allowUnknownOption=!!e,this}allowExcessArguments(e=!0){return this._allowExcessArguments=!!e,this}enablePositionalOptions(e=!0){return this._enablePositionalOptions=!!e,this}passThroughOptions(e=!0){return this._passThroughOptions=!!e,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw new Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties(e=!0){if(this.options.length)throw new Error("call .storeOptionsAsProperties() before adding options");if(Object.keys(this._optionValues).length)throw new Error("call .storeOptionsAsProperties() before setting option values");return this._storeOptionsAsProperties=!!e,this}getOptionValue(e){return this._storeOptionsAsProperties?this[e]:this._optionValues[e]}setOptionValue(e,r){return this.setOptionValueWithSource(e,r,void 0)}setOptionValueWithSource(e,r,n){return this._storeOptionsAsProperties?this[e]=r:this._optionValues[e]=r,this._optionValueSources[e]=n,this}getOptionValueSource(e){return this._optionValueSources[e]}getOptionValueSourceWithGlobals(e){let r;return this._getCommandAndAncestors().forEach(n=>{n.getOptionValueSource(e)!==void 0&&(r=n.getOptionValueSource(e))}),r}_prepareUserArgs(e,r){if(e!==void 0&&!Array.isArray(e))throw new Error("first parameter to parse must be array or undefined");if(r=r||{},e===void 0&&r.from===void 0){De.versions?.electron&&(r.from="electron");let i=De.execArgv??[];(i.includes("-e")||i.includes("--eval")||i.includes("-p")||i.includes("--print"))&&(r.from="eval")}e===void 0&&(e=De.argv),this.rawArgs=e.slice();let n;switch(r.from){case void 0:case"node":this._scriptPath=e[1],n=e.slice(2);break;case"electron":De.defaultApp?(this._scriptPath=e[1],n=e.slice(2)):n=e.slice(1);break;case"user":n=e.slice(0);break;case"eval":n=e.slice(1);break;default:throw new Error(`unexpected parse option { from: '${r.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||"program",n}parse(e,r){this._prepareForParse();let n=this._prepareUserArgs(e,r);return this._parseCommand([],n),this}async parseAsync(e,r){this._prepareForParse();let n=this._prepareUserArgs(e,r);return await this._parseCommand([],n),this}_prepareForParse(){this._savedState===null?this.saveStateBeforeParse():this.restoreStateBeforeParse()}saveStateBeforeParse(){this._savedState={_name:this._name,_optionValues:{...this._optionValues},_optionValueSources:{...this._optionValueSources}}}restoreStateBeforeParse(){if(this._storeOptionsAsProperties)throw new Error(`Can not call parse again when storeOptionsAsProperties is true.
@@ -18,66 +18,66 @@ Expecting one of '${n.join("', '")}'`);return this._lifeCycleHooks[e]?this._life
18
18
  `),this.outputHelp({error:!0}));let n=r||{},i=n.exitCode||1,o=n.code||"commander.error";this._exit(i,o,e)}_parseOptionsEnv(){this.options.forEach(e=>{if(e.envVar&&e.envVar in De.env){let r=e.attributeName();(this.getOptionValue(r)===void 0||["default","config","env"].includes(this.getOptionValueSource(r)))&&(e.required||e.optional?this.emit(`optionEnv:${e.name()}`,De.env[e.envVar]):this.emit(`optionEnv:${e.name()}`))}})}_parseOptionsImplied(){let e=new lN(this.options),r=n=>this.getOptionValue(n)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(n));this.options.filter(n=>n.implied!==void 0&&r(n.attributeName())&&e.valueFromOption(this.getOptionValue(n.attributeName()),n)).forEach(n=>{Object.keys(n.implied).filter(i=>!r(i)).forEach(i=>{this.setOptionValueWithSource(i,n.implied[i],"implied")})})}missingArgument(e){let r=`error: missing required argument '${e}'`;this.error(r,{code:"commander.missingArgument"})}optionMissingArgument(e){let r=`error: option '${e.flags}' argument missing`;this.error(r,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(e){let r=`error: required option '${e.flags}' not specified`;this.error(r,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(e,r){let n=s=>{let a=s.attributeName(),u=this.getOptionValue(a),l=this.options.find(f=>f.negate&&a===f.attributeName()),c=this.options.find(f=>!f.negate&&a===f.attributeName());return l&&(l.presetArg===void 0&&u===!1||l.presetArg!==void 0&&u===l.presetArg)?l:c||s},i=s=>{let a=n(s),u=a.attributeName();return this.getOptionValueSource(u)==="env"?`environment variable '${a.envVar}'`:`option '${a.flags}'`},o=`error: ${i(e)} cannot be used with ${i(r)}`;this.error(o,{code:"commander.conflictingOption"})}unknownOption(e){if(this._allowUnknownOption)return;let r="";if(e.startsWith("--")&&this._showSuggestionAfterError){let i=[],o=this;do{let s=o.createHelp().visibleOptions(o).filter(a=>a.long).map(a=>a.long);i=i.concat(s),o=o.parent}while(o&&!o._enablePositionalOptions);r=jb(e,i)}let n=`error: unknown option '${e}'${r}`;this.error(n,{code:"commander.unknownOption"})}_excessArguments(e){if(this._allowExcessArguments)return;let r=this.registeredArguments.length,n=r===1?"":"s",o=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${r} argument${n} but got ${e.length}.`;this.error(o,{code:"commander.excessArguments"})}unknownCommand(){let e=this.args[0],r="";if(this._showSuggestionAfterError){let i=[];this.createHelp().visibleCommands(this).forEach(o=>{i.push(o.name()),o.alias()&&i.push(o.alias())}),r=jb(e,i)}let n=`error: unknown command '${e}'${r}`;this.error(n,{code:"commander.unknownCommand"})}version(e,r,n){if(e===void 0)return this._version;this._version=e,r=r||"-V, --version",n=n||"output the version number";let i=this.createOption(r,n);return this._versionOptionName=i.attributeName(),this._registerOption(i),this.on("option:"+i.name(),()=>{this._outputConfiguration.writeOut(`${e}
19
19
  `),this._exit(0,"commander.version",e)}),this}description(e,r){return e===void 0&&r===void 0?this._description:(this._description=e,r&&(this._argsDescription=r),this)}summary(e){return e===void 0?this._summary:(this._summary=e,this)}alias(e){if(e===void 0)return this._aliases[0];let r=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(r=this.commands[this.commands.length-1]),e===r._name)throw new Error("Command alias can't be the same as its name");let n=this.parent?._findCommand(e);if(n){let i=[n.name()].concat(n.aliases()).join("|");throw new Error(`cannot add alias '${e}' to command '${this.name()}' as already have command '${i}'`)}return r._aliases.push(e),this}aliases(e){return e===void 0?this._aliases:(e.forEach(r=>this.alias(r)),this)}usage(e){if(e===void 0){if(this._usage)return this._usage;let r=this.registeredArguments.map(n=>sN(n));return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?r:[]).join(" ")}return this._usage=e,this}name(e){return e===void 0?this._name:(this._name=e,this)}nameFromFilename(e){return this._name=cn.basename(e,cn.extname(e)),this}executableDir(e){return e===void 0?this._executableDir:(this._executableDir=e,this)}helpInformation(e){let r=this.createHelp(),n=this._getOutputContext(e);r.prepareContext({error:n.error,helpWidth:n.helpWidth,outputHasColors:n.hasColors});let i=r.formatHelp(this,r);return n.hasColors?i:this._outputConfiguration.stripColor(i)}_getOutputContext(e){e=e||{};let r=!!e.error,n,i,o;return r?(n=a=>this._outputConfiguration.writeErr(a),i=this._outputConfiguration.getErrHasColors(),o=this._outputConfiguration.getErrHelpWidth()):(n=a=>this._outputConfiguration.writeOut(a),i=this._outputConfiguration.getOutHasColors(),o=this._outputConfiguration.getOutHelpWidth()),{error:r,write:a=>(i||(a=this._outputConfiguration.stripColor(a)),n(a)),hasColors:i,helpWidth:o}}outputHelp(e){let r;typeof e=="function"&&(r=e,e=void 0);let n=this._getOutputContext(e),i={error:n.error,write:n.write,command:this};this._getCommandAndAncestors().reverse().forEach(s=>s.emit("beforeAllHelp",i)),this.emit("beforeHelp",i);let o=this.helpInformation({error:n.error});if(r&&(o=r(o),typeof o!="string"&&!Buffer.isBuffer(o)))throw new Error("outputHelp callback must return a string or a Buffer");n.write(o),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit("afterHelp",i),this._getCommandAndAncestors().forEach(s=>s.emit("afterAllHelp",i))}helpOption(e,r){return typeof e=="boolean"?(e?this._helpOption=this._helpOption??void 0:this._helpOption=null,this):(e=e??"-h, --help",r=r??"display help for command",this._helpOption=this.createOption(e,r),this)}_getHelpOption(){return this._helpOption===void 0&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(e){return this._helpOption=e,this}help(e){this.outputHelp(e);let r=Number(De.exitCode??0);r===0&&e&&typeof e!="function"&&e.error&&(r=1),this._exit(r,"commander.help","(outputHelp)")}addHelpText(e,r){let n=["beforeAll","before","after","afterAll"];if(!n.includes(e))throw new Error(`Unexpected value for position to addHelpText.
20
20
  Expecting one of '${n.join("', '")}'`);let i=`${e}Help`;return this.on(i,o=>{let s;typeof r=="function"?s=r({error:o.error,command:o.command}):s=r,s&&o.write(`${s}
21
- `)}),this}_outputHelpIfRequested(e){let r=this._getHelpOption();r&&e.find(i=>r.is(i))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function Nb(t){return t.map(e=>{if(!e.startsWith("--inspect"))return e;let r,n="127.0.0.1",i="9229",o;return(o=e.match(/^(--inspect(-brk)?)$/))!==null?r=o[1]:(o=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(r=o[1],/^\d+$/.test(o[3])?i=o[3]:n=o[3]):(o=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(r=o[1],n=o[3],i=o[4]),r&&i!=="0"?`${r}=${n}:${parseInt(i)+1}`:e})}function ap(){if(De.env.NO_COLOR||De.env.FORCE_COLOR==="0"||De.env.FORCE_COLOR==="false")return!1;if(De.env.FORCE_COLOR||De.env.CLICOLOR_FORCE!==void 0)return!0}up.Command=sp;up.useColor=ap});var Ub=y(lr=>{var{Argument:Bb}=Hl(),{Command:lp}=Lb(),{CommanderError:cN,InvalidArgumentError:qb}=Oa(),{Help:fN}=Qh(),{Option:Mb}=np();lr.program=new lp;lr.createCommand=t=>new lp(t);lr.createOption=(t,e)=>new Mb(t,e);lr.createArgument=(t,e)=>new Bb(t,e);lr.Command=lp;lr.Option=Mb;lr.Argument=Bb;lr.Help=fN;lr.CommanderError=cN;lr.InvalidArgumentError=qb;lr.InvalidOptionArgumentError=qb});var Te=y((_se,Vb)=>{"use strict";var cp="\x1B",Me=`${cp}[`,hN="\x07",fp={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:`${cp}7`,restore:`${cp}8`},pN={up:(t=1)=>`${Me}S`.repeat(t),down:(t=1)=>`${Me}T`.repeat(t)},mN={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?fp.up():"");return t&&(e+=fp.left),e}};Vb.exports={cursor:fp,scroll:pN,erase:mN,beep:hN}});var hp=y((Ese,dp)=>{var Gl=process||{},zb=Gl.argv||[],zl=Gl.env||{},gN=!(zl.NO_COLOR||zb.includes("--no-color"))&&(!!zl.FORCE_COLOR||zb.includes("--color")||Gl.platform==="win32"||(Gl.stdout||{}).isTTY&&zl.TERM!=="dumb"||!!zl.CI),yN=(t,e,r=t)=>n=>{let i=""+n,o=i.indexOf(e,t.length);return~o?t+DN(i,e,r,o)+e:t+i+e},DN=(t,e,r,n)=>{let i="",o=0;do i+=t.substring(o,n)+r,o=n+e.length,n=t.indexOf(e,o);while(~n);return i+t.substring(o)},Gb=(t=gN)=>{let e=t?yN:()=>String;return{isColorSupported:t,reset:e("\x1B[0m","\x1B[0m"),bold:e("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:e("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:e("\x1B[3m","\x1B[23m"),underline:e("\x1B[4m","\x1B[24m"),inverse:e("\x1B[7m","\x1B[27m"),hidden:e("\x1B[8m","\x1B[28m"),strikethrough:e("\x1B[9m","\x1B[29m"),black:e("\x1B[30m","\x1B[39m"),red:e("\x1B[31m","\x1B[39m"),green:e("\x1B[32m","\x1B[39m"),yellow:e("\x1B[33m","\x1B[39m"),blue:e("\x1B[34m","\x1B[39m"),magenta:e("\x1B[35m","\x1B[39m"),cyan:e("\x1B[36m","\x1B[39m"),white:e("\x1B[37m","\x1B[39m"),gray:e("\x1B[90m","\x1B[39m"),bgBlack:e("\x1B[40m","\x1B[49m"),bgRed:e("\x1B[41m","\x1B[49m"),bgGreen:e("\x1B[42m","\x1B[49m"),bgYellow:e("\x1B[43m","\x1B[49m"),bgBlue:e("\x1B[44m","\x1B[49m"),bgMagenta:e("\x1B[45m","\x1B[49m"),bgCyan:e("\x1B[46m","\x1B[49m"),bgWhite:e("\x1B[47m","\x1B[49m"),blackBright:e("\x1B[90m","\x1B[39m"),redBright:e("\x1B[91m","\x1B[39m"),greenBright:e("\x1B[92m","\x1B[39m"),yellowBright:e("\x1B[93m","\x1B[39m"),blueBright:e("\x1B[94m","\x1B[39m"),magentaBright:e("\x1B[95m","\x1B[39m"),cyanBright:e("\x1B[96m","\x1B[39m"),whiteBright:e("\x1B[97m","\x1B[39m"),bgBlackBright:e("\x1B[100m","\x1B[49m"),bgRedBright:e("\x1B[101m","\x1B[49m"),bgGreenBright:e("\x1B[102m","\x1B[49m"),bgYellowBright:e("\x1B[103m","\x1B[49m"),bgBlueBright:e("\x1B[104m","\x1B[49m"),bgMagentaBright:e("\x1B[105m","\x1B[49m"),bgCyanBright:e("\x1B[106m","\x1B[49m"),bgWhiteBright:e("\x1B[107m","\x1B[49m")}};dp.exports=Gb();dp.exports.createColors=Gb});var rc=y(Bt=>{"use strict";Object.defineProperty(Bt,"__esModule",{value:!0});Bt.isNXMonorepo=Bt.isMonorepo=Bt.findPackageRelativePathInMonorepo=Bt.findPackagePath=Bt.findNXMonorepoRoot=Bt.findMonorepoRoot=void 0;var Ta=require("node:fs"),Bn=require("node:path");function tc(t){let e=(0,Bn.join)(t,"package.json"),r=(0,Bn.join)(t,"pnpm-workspace.yaml");if((0,Ta.existsSync)(r)||(0,Ta.existsSync)(e)&&JSON.parse((0,Ta.readFileSync)(e,"utf-8")).workspaces)return t;let n=(0,Bn.dirname)(t);if(n===t)throw new Error("Monorepo root not found");return tc(n)}Bt.findMonorepoRoot=tc;function xp(t){let e=(0,Bn.join)(t,"nx.json");if((0,Ta.existsSync)(e))return t;let r=(0,Bn.dirname)(t);if(r===t)throw new Error("Monorepo root not found");return xp(r)}Bt.findNXMonorepoRoot=xp;function Fp(t,e,r){let n=(0,Bn.join)(e,"node_modules",t);if((0,Ta.existsSync)(n))return n;if(e===r)return null;let i=(0,Bn.dirname)(e);return Fp(t,i,r)}Bt.findPackagePath=Fp;function YN(t,e){let r=tc(e),n=Fp(t,e,r);return n?(0,Bn.relative)(e,n):null}Bt.findPackageRelativePathInMonorepo=YN;function JN(t){try{return tc(t),!0}catch{return!1}}Bt.isMonorepo=JN;function XN(t){try{return xp(t),!0}catch{return!1}}Bt.isNXMonorepo=XN});var vi={};gi(vi,{default:()=>ZN});var ZN,bi=Ct(()=>{ZN={}});var fw=y(Pr=>{"use strict";var QN=Pr&&Pr.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),eL=Pr&&Pr.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),tL=Pr&&Pr.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&QN(e,t,r);return eL(e,t),e};Object.defineProperty(Pr,"__esModule",{value:!0});Pr.resolveFetch=void 0;var rL=t=>{let e;return t?e=t:typeof fetch>"u"?e=(...r)=>Promise.resolve().then(()=>tL((bi(),je(vi)))).then(({default:n})=>n(...r)):e=fetch,(...r)=>e(...r)};Pr.resolveFetch=rL});var Tp=y(er=>{"use strict";Object.defineProperty(er,"__esModule",{value:!0});er.FunctionRegion=er.FunctionsHttpError=er.FunctionsRelayError=er.FunctionsFetchError=er.FunctionsError=void 0;var jo=class extends Error{constructor(e,r="FunctionsError",n){super(e),this.name=r,this.context=n}};er.FunctionsError=jo;var Op=class extends jo{constructor(e){super("Failed to send a request to the Edge Function","FunctionsFetchError",e)}};er.FunctionsFetchError=Op;var Ap=class extends jo{constructor(e){super("Relay Error invoking the Edge Function","FunctionsRelayError",e)}};er.FunctionsRelayError=Ap;var kp=class extends jo{constructor(e){super("Edge Function returned a non-2xx status code","FunctionsHttpError",e)}};er.FunctionsHttpError=kp;var nL;(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"})(nL=er.FunctionRegion||(er.FunctionRegion={}))});var dw=y(No=>{"use strict";var iL=No&&No.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(c){try{l(n.next(c))}catch(f){s(f)}}function u(c){try{l(n.throw(c))}catch(f){s(f)}}function l(c){c.done?o(c.value):i(c.value).then(a,u)}l((n=n.apply(t,e||[])).next())})};Object.defineProperty(No,"__esModule",{value:!0});No.FunctionsClient=void 0;var oL=fw(),ic=Tp(),Pp=class{constructor(e,{headers:r={},customFetch:n,region:i=ic.FunctionRegion.Any}={}){this.url=e,this.headers=r,this.region=i,this.fetch=(0,oL.resolveFetch)(n)}setAuth(e){this.headers.Authorization=`Bearer ${e}`}invoke(e,r={}){var n;return iL(this,void 0,void 0,function*(){try{let{headers:i,method:o,body:s}=r,a={},{region:u}=r;u||(u=this.region),u&&u!=="any"&&(a["x-region"]=u);let l;s&&(i&&!Object.prototype.hasOwnProperty.call(i,"Content-Type")||!i)&&(typeof Blob<"u"&&s instanceof Blob||s instanceof ArrayBuffer?(a["Content-Type"]="application/octet-stream",l=s):typeof s=="string"?(a["Content-Type"]="text/plain",l=s):typeof FormData<"u"&&s instanceof FormData?l=s:(a["Content-Type"]="application/json",l=JSON.stringify(s)));let c=yield this.fetch(`${this.url}/${e}`,{method:o||"POST",headers:Object.assign(Object.assign(Object.assign({},a),this.headers),i),body:l}).catch(m=>{throw new ic.FunctionsFetchError(m)}),f=c.headers.get("x-relay-error");if(f&&f==="true")throw new ic.FunctionsRelayError(c);if(!c.ok)throw new ic.FunctionsHttpError(c);let h=((n=c.headers.get("Content-Type"))!==null&&n!==void 0?n:"text/plain").split(";")[0].trim(),d;return h==="application/json"?d=yield c.json():h==="application/octet-stream"?d=yield c.blob():h==="text/event-stream"?d=c:h==="multipart/form-data"?d=yield c.formData():d=yield c.text(),{data:d,error:null}}catch(i){return{data:null,error:i}}})}};No.FunctionsClient=Pp});var Rp=y(qt=>{"use strict";Object.defineProperty(qt,"__esModule",{value:!0});qt.FunctionRegion=qt.FunctionsRelayError=qt.FunctionsHttpError=qt.FunctionsFetchError=qt.FunctionsError=qt.FunctionsClient=void 0;var sL=dw();Object.defineProperty(qt,"FunctionsClient",{enumerable:!0,get:function(){return sL.FunctionsClient}});var Ra=Tp();Object.defineProperty(qt,"FunctionsError",{enumerable:!0,get:function(){return Ra.FunctionsError}});Object.defineProperty(qt,"FunctionsFetchError",{enumerable:!0,get:function(){return Ra.FunctionsFetchError}});Object.defineProperty(qt,"FunctionsHttpError",{enumerable:!0,get:function(){return Ra.FunctionsHttpError}});Object.defineProperty(qt,"FunctionsRelayError",{enumerable:!0,get:function(){return Ra.FunctionsRelayError}});Object.defineProperty(qt,"FunctionRegion",{enumerable:!0,get:function(){return Ra.FunctionRegion}})});var jp=y(Ip=>{"use strict";Object.defineProperty(Ip,"__esModule",{value:!0});var $p=class extends Error{constructor(e){super(e.message),this.name="PostgrestError",this.details=e.details,this.hint=e.hint,this.code=e.code}};Ip.default=$p});var Lp=y($a=>{"use strict";var hw=$a&&$a.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty($a,"__esModule",{value:!0});var aL=hw((bi(),je(vi))),uL=hw(jp()),Np=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=aL.default:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(e,r){return this.headers=Object.assign({},this.headers),this.headers[e]=r,this}then(e,r){this.schema===void 0||(["GET","HEAD"].includes(this.method)?this.headers["Accept-Profile"]=this.schema:this.headers["Content-Profile"]=this.schema),this.method!=="GET"&&this.method!=="HEAD"&&(this.headers["Content-Type"]="application/json");let n=this.fetch,i=n(this.url.toString(),{method:this.method,headers:this.headers,body:JSON.stringify(this.body),signal:this.signal}).then(async o=>{var s,a,u;let l=null,c=null,f=null,h=o.status,d=o.statusText;if(o.ok){if(this.method!=="HEAD"){let _=await o.text();_===""||(this.headers.Accept==="text/csv"||this.headers.Accept&&this.headers.Accept.includes("application/vnd.pgrst.plan+text")?c=_:c=JSON.parse(_))}let b=(s=this.headers.Prefer)===null||s===void 0?void 0:s.match(/count=(exact|planned|estimated)/),D=(a=o.headers.get("content-range"))===null||a===void 0?void 0:a.split("/");b&&D&&D.length>1&&(f=parseInt(D[1])),this.isMaybeSingle&&this.method==="GET"&&Array.isArray(c)&&(c.length>1?(l={code:"PGRST116",details:`Results contain ${c.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},c=null,f=null,h=406,d="Not Acceptable"):c.length===1?c=c[0]:c=null)}else{let b=await o.text();try{l=JSON.parse(b),Array.isArray(l)&&o.status===404&&(c=[],l=null,h=200,d="OK")}catch{o.status===404&&b===""?(h=204,d="No Content"):l={message:b}}if(l&&this.isMaybeSingle&&(!((u=l?.details)===null||u===void 0)&&u.includes("0 rows"))&&(l=null,h=200,d="OK"),l&&this.shouldThrowOnError)throw new uL.default(l)}return{error:l,data:c,count:f,status:h,statusText:d}});return this.shouldThrowOnError||(i=i.catch(o=>{var s,a,u;return{error:{message:`${(s=o?.name)!==null&&s!==void 0?s:"FetchError"}: ${o?.message}`,details:`${(a=o?.stack)!==null&&a!==void 0?a:""}`,hint:"",code:`${(u=o?.code)!==null&&u!==void 0?u:""}`},data:null,count:null,status:0,statusText:""}})),i.then(e,r)}};$a.default=Np});var qp=y(Ia=>{"use strict";var lL=Ia&&Ia.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ia,"__esModule",{value:!0});var cL=lL(Lp()),Bp=class extends cL.default{select(e){let r=!1,n=(e??"*").split("").map(i=>/\s/.test(i)&&!r?"":(i==='"'&&(r=!r),i)).join("");return this.url.searchParams.set("select",n),this.headers.Prefer&&(this.headers.Prefer+=","),this.headers.Prefer+="return=representation",this}order(e,{ascending:r=!0,nullsFirst:n,foreignTable:i,referencedTable:o=i}={}){let s=o?`${o}.order`:"order",a=this.url.searchParams.get(s);return this.url.searchParams.set(s,`${a?`${a},`:""}${e}.${r?"asc":"desc"}${n===void 0?"":n?".nullsfirst":".nullslast"}`),this}limit(e,{foreignTable:r,referencedTable:n=r}={}){let i=typeof n>"u"?"limit":`${n}.limit`;return this.url.searchParams.set(i,`${e}`),this}range(e,r,{foreignTable:n,referencedTable:i=n}={}){let o=typeof i>"u"?"offset":`${i}.offset`,s=typeof i>"u"?"limit":`${i}.limit`;return this.url.searchParams.set(o,`${e}`),this.url.searchParams.set(s,`${r-e+1}`),this}abortSignal(e){return this.signal=e,this}single(){return this.headers.Accept="application/vnd.pgrst.object+json",this}maybeSingle(){return this.method==="GET"?this.headers.Accept="application/json":this.headers.Accept="application/vnd.pgrst.object+json",this.isMaybeSingle=!0,this}csv(){return this.headers.Accept="text/csv",this}geojson(){return this.headers.Accept="application/geo+json",this}explain({analyze:e=!1,verbose:r=!1,settings:n=!1,buffers:i=!1,wal:o=!1,format:s="text"}={}){var a;let u=[e?"analyze":null,r?"verbose":null,n?"settings":null,i?"buffers":null,o?"wal":null].filter(Boolean).join("|"),l=(a=this.headers.Accept)!==null&&a!==void 0?a:"application/json";return this.headers.Accept=`application/vnd.pgrst.plan+${s}; for="${l}"; options=${u};`,s==="json"?this:this}rollback(){var e;return((e=this.headers.Prefer)!==null&&e!==void 0?e:"").trim().length>0?this.headers.Prefer+=",tx=rollback":this.headers.Prefer="tx=rollback",this}returns(){return this}};Ia.default=Bp});var oc=y(ja=>{"use strict";var fL=ja&&ja.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ja,"__esModule",{value:!0});var dL=fL(qp()),Mp=class extends dL.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}};ja.default=Mp});var Hp=y(La=>{"use strict";var hL=La&&La.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(La,"__esModule",{value:!0});var Na=hL(oc()),Up=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 Na.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 Na.default({method:i,url:this.url,headers:this.headers,schema:this.schema,body:e,fetch:this.fetch,allowEmpty:!1})}upsert(e,{onConflict:r,ignoreDuplicates:n=!1,count:i,defaultToNull:o=!0}={}){let s="POST",a=[`resolution=${n?"ignore":"merge"}-duplicates`];if(r!==void 0&&this.url.searchParams.set("on_conflict",r),this.headers.Prefer&&a.push(this.headers.Prefer),i&&a.push(`count=${i}`),o||a.push("missing=default"),this.headers.Prefer=a.join(","),Array.isArray(e)){let u=e.reduce((l,c)=>l.concat(Object.keys(c)),[]);if(u.length>0){let l=[...new Set(u)].map(c=>`"${c}"`);this.url.searchParams.set("columns",l.join(","))}}return new Na.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 Na.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 Na.default({method:r,url:this.url,headers:this.headers,schema:this.schema,fetch:this.fetch,allowEmpty:!1})}};La.default=Up});var pw=y(sc=>{"use strict";Object.defineProperty(sc,"__esModule",{value:!0});sc.version=void 0;sc.version="0.0.0-automated"});var mw=y(ac=>{"use strict";Object.defineProperty(ac,"__esModule",{value:!0});ac.DEFAULT_HEADERS=void 0;var pL=pw();ac.DEFAULT_HEADERS={"X-Client-Info":`postgrest-js/${pL.version}`}});var yw=y(Ba=>{"use strict";var gw=Ba&&Ba.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ba,"__esModule",{value:!0});var mL=gw(Hp()),gL=gw(oc()),yL=mw(),Vp=class t{constructor(e,{headers:r={},schema:n,fetch:i}={}){this.url=e,this.headers=Object.assign(Object.assign({},yL.DEFAULT_HEADERS),r),this.schemaName=n,this.fetch=i}from(e){let r=new URL(`${this.url}/${e}`);return new mL.default(r,{headers:Object.assign({},this.headers),schema:this.schemaName,fetch:this.fetch})}schema(e){return new t(this.url,{headers:this.headers,schema:e,fetch:this.fetch})}rpc(e,r={},{head:n=!1,get:i=!1,count:o}={}){let s,a=new URL(`${this.url}/rpc/${e}`),u;n||i?(s=n?"HEAD":"GET",Object.entries(r).filter(([c,f])=>f!==void 0).map(([c,f])=>[c,Array.isArray(f)?`{${f.join(",")}}`:`${f}`]).forEach(([c,f])=>{a.searchParams.append(c,f)})):(s="POST",u=r);let l=Object.assign({},this.headers);return o&&(l.Prefer=`count=${o}`),new gL.default({method:s,url:a,headers:l,schema:this.schemaName,body:u,fetch:this.fetch,allowEmpty:!1})}};Ba.default=Vp});var zp=y(Dt=>{"use strict";var Lo=Dt&&Dt.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Dt,"__esModule",{value:!0});Dt.PostgrestError=Dt.PostgrestBuilder=Dt.PostgrestTransformBuilder=Dt.PostgrestFilterBuilder=Dt.PostgrestQueryBuilder=Dt.PostgrestClient=void 0;var Dw=Lo(yw());Dt.PostgrestClient=Dw.default;var vw=Lo(Hp());Dt.PostgrestQueryBuilder=vw.default;var bw=Lo(oc());Dt.PostgrestFilterBuilder=bw.default;var ww=Lo(qp());Dt.PostgrestTransformBuilder=ww.default;var _w=Lo(Lp());Dt.PostgrestBuilder=_w.default;var Ew=Lo(jp());Dt.PostgrestError=Ew.default;Dt.default={PostgrestClient:Dw.default,PostgrestQueryBuilder:vw.default,PostgrestFilterBuilder:bw.default,PostgrestTransformBuilder:ww.default,PostgrestBuilder:_w.default,PostgrestError:Ew.default}});var Wp={};gi(Wp,{RealtimeClient:()=>Gp});var Gp,Kp=Ct(()=>{Gp=class{constructor(){}connect(){}disconnect(){}}});var Ma=y(Rr=>{"use strict";Object.defineProperty(Rr,"__esModule",{value:!0});Rr.StorageUnknownError=Rr.StorageApiError=Rr.isStorageError=Rr.StorageError=void 0;var qa=class extends Error{constructor(e){super(e),this.__isStorageError=!0,this.name="StorageError"}};Rr.StorageError=qa;function DL(t){return typeof t=="object"&&t!==null&&"__isStorageError"in t}Rr.isStorageError=DL;var Yp=class extends qa{constructor(e,r){super(e),this.name="StorageApiError",this.status=r}toJSON(){return{name:this.name,message:this.message,status:this.status}}};Rr.StorageApiError=Yp;var Jp=class extends qa{constructor(e,r){super(e),this.name="StorageUnknownError",this.originalError=r}};Rr.StorageUnknownError=Jp});var uc=y(ut=>{"use strict";var vL=ut&&ut.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),bL=ut&&ut.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Cw=ut&&ut.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&vL(e,t,r);return bL(e,t),e},wL=ut&&ut.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(c){try{l(n.next(c))}catch(f){s(f)}}function u(c){try{l(n.throw(c))}catch(f){s(f)}}function l(c){c.done?o(c.value):i(c.value).then(a,u)}l((n=n.apply(t,e||[])).next())})};Object.defineProperty(ut,"__esModule",{value:!0});ut.recursiveToCamel=ut.resolveResponse=ut.resolveFetch=void 0;var _L=t=>{let e;return t?e=t:typeof fetch>"u"?e=(...r)=>Promise.resolve().then(()=>Cw((bi(),je(vi)))).then(({default:n})=>n(...r)):e=fetch,(...r)=>e(...r)};ut.resolveFetch=_L;var EL=()=>wL(void 0,void 0,void 0,function*(){return typeof Response>"u"?(yield Promise.resolve().then(()=>Cw((bi(),je(vi))))).Response:Response});ut.resolveResponse=EL;var CL=t=>{if(Array.isArray(t))return t.map(r=>(0,ut.recursiveToCamel)(r));if(typeof t=="function"||t!==Object(t))return t;let e={};return Object.entries(t).forEach(([r,n])=>{let i=r.replace(/([-_][a-z])/gi,o=>o.toUpperCase().replace(/[-_]/g,""));e[i]=(0,ut.recursiveToCamel)(n)}),e};ut.recursiveToCamel=CL});var Qp=y(Mt=>{"use strict";var wi=Mt&&Mt.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(c){try{l(n.next(c))}catch(f){s(f)}}function u(c){try{l(n.throw(c))}catch(f){s(f)}}function l(c){c.done?o(c.value):i(c.value).then(a,u)}l((n=n.apply(t,e||[])).next())})};Object.defineProperty(Mt,"__esModule",{value:!0});Mt.remove=Mt.head=Mt.put=Mt.post=Mt.get=void 0;var Xp=Ma(),SL=uc(),Zp=t=>t.msg||t.message||t.error_description||t.error||JSON.stringify(t),xL=(t,e,r)=>wi(void 0,void 0,void 0,function*(){let n=yield(0,SL.resolveResponse)();t instanceof n&&!r?.noResolveJson?t.json().then(i=>{e(new Xp.StorageApiError(Zp(i),t.status||500))}).catch(i=>{e(new Xp.StorageUnknownError(Zp(i),i))}):e(new Xp.StorageUnknownError(Zp(t),t))}),FL=(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 Ua(t,e,r,n,i,o){return wi(this,void 0,void 0,function*(){return new Promise((s,a)=>{t(r,FL(e,n,i,o)).then(u=>{if(!u.ok)throw u;return n?.noResolveJson?u:u.json()}).then(u=>s(u)).catch(u=>xL(u,a,n))})})}function OL(t,e,r,n){return wi(this,void 0,void 0,function*(){return Ua(t,"GET",e,r,n)})}Mt.get=OL;function AL(t,e,r,n,i){return wi(this,void 0,void 0,function*(){return Ua(t,"POST",e,n,i,r)})}Mt.post=AL;function kL(t,e,r,n,i){return wi(this,void 0,void 0,function*(){return Ua(t,"PUT",e,n,i,r)})}Mt.put=kL;function TL(t,e,r,n){return wi(this,void 0,void 0,function*(){return Ua(t,"HEAD",e,Object.assign(Object.assign({},r),{noResolveJson:!0}),n)})}Mt.head=TL;function PL(t,e,r,n,i){return wi(this,void 0,void 0,function*(){return Ua(t,"DELETE",e,n,i,r)})}Mt.remove=PL});var Fw=y(Ha=>{"use strict";var Ut=Ha&&Ha.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(c){try{l(n.next(c))}catch(f){s(f)}}function u(c){try{l(n.throw(c))}catch(f){s(f)}}function l(c){c.done?o(c.value):i(c.value).then(a,u)}l((n=n.apply(t,e||[])).next())})};Object.defineProperty(Ha,"__esModule",{value:!0});var Ht=Ma(),$r=Qp(),Sw=uc(),RL={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},xw={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,Sw.resolveFetch)(i)}uploadOrUpdate(e,r,n,i){return Ut(this,void 0,void 0,function*(){try{let o,s=Object.assign(Object.assign({},xw),i),a=Object.assign(Object.assign({},this.headers),e==="POST"&&{"x-upsert":String(s.upsert)}),u=s.metadata;typeof Blob<"u"&&n instanceof Blob?(o=new FormData,o.append("cacheControl",s.cacheControl),u&&o.append("metadata",this.encodeMetadata(u)),o.append("",n)):typeof FormData<"u"&&n instanceof FormData?(o=n,o.append("cacheControl",s.cacheControl),u&&o.append("metadata",this.encodeMetadata(u))):(o=n,a["cache-control"]=`max-age=${s.cacheControl}`,a["content-type"]=s.contentType,u&&(a["x-metadata"]=this.toBase64(this.encodeMetadata(u)))),i?.headers&&(a=Object.assign(Object.assign({},a),i.headers));let l=this._removeEmptyFolders(r),c=this._getFinalPath(l),f=yield this.fetch(`${this.url}/object/${c}`,Object.assign({method:e,body:o,headers:a},s?.duplex?{duplex:s.duplex}:{})),h=yield f.json();return f.ok?{data:{path:l,id:h.Id,fullPath:h.Key},error:null}:{data:null,error:h}}catch(o){if((0,Ht.isStorageError)(o))return{data:null,error:o};throw o}})}upload(e,r,n){return Ut(this,void 0,void 0,function*(){return this.uploadOrUpdate("POST",e,r,n)})}uploadToSignedUrl(e,r,n,i){return Ut(this,void 0,void 0,function*(){let o=this._removeEmptyFolders(e),s=this._getFinalPath(o),a=new URL(this.url+`/object/upload/sign/${s}`);a.searchParams.set("token",r);try{let u,l=Object.assign({upsert:xw.upsert},i),c=Object.assign(Object.assign({},this.headers),{"x-upsert":String(l.upsert)});typeof Blob<"u"&&n instanceof Blob?(u=new FormData,u.append("cacheControl",l.cacheControl),u.append("",n)):typeof FormData<"u"&&n instanceof FormData?(u=n,u.append("cacheControl",l.cacheControl)):(u=n,c["cache-control"]=`max-age=${l.cacheControl}`,c["content-type"]=l.contentType);let f=yield this.fetch(a.toString(),{method:"PUT",body:u,headers:c}),h=yield f.json();return f.ok?{data:{path:o,fullPath:h.Key},error:null}:{data:null,error:h}}catch(u){if((0,Ht.isStorageError)(u))return{data:null,error:u};throw u}})}createSignedUploadUrl(e,r){return Ut(this,void 0,void 0,function*(){try{let n=this._getFinalPath(e),i=Object.assign({},this.headers);r?.upsert&&(i["x-upsert"]="true");let o=yield(0,$r.post)(this.fetch,`${this.url}/object/upload/sign/${n}`,{},{headers:i}),s=new URL(this.url+o.url),a=s.searchParams.get("token");if(!a)throw new Ht.StorageError("No token returned by API");return{data:{signedUrl:s.toString(),path:e,token:a},error:null}}catch(n){if((0,Ht.isStorageError)(n))return{data:null,error:n};throw n}})}update(e,r,n){return Ut(this,void 0,void 0,function*(){return this.uploadOrUpdate("PUT",e,r,n)})}move(e,r,n){return Ut(this,void 0,void 0,function*(){try{return{data:yield(0,$r.post)(this.fetch,`${this.url}/object/move`,{bucketId:this.bucketId,sourceKey:e,destinationKey:r,destinationBucket:n?.destinationBucket},{headers:this.headers}),error:null}}catch(i){if((0,Ht.isStorageError)(i))return{data:null,error:i};throw i}})}copy(e,r,n){return Ut(this,void 0,void 0,function*(){try{return{data:{path:(yield(0,$r.post)(this.fetch,`${this.url}/object/copy`,{bucketId:this.bucketId,sourceKey:e,destinationKey:r,destinationBucket:n?.destinationBucket},{headers:this.headers})).Key},error:null}}catch(i){if((0,Ht.isStorageError)(i))return{data:null,error:i};throw i}})}createSignedUrl(e,r,n){return Ut(this,void 0,void 0,function*(){try{let i=this._getFinalPath(e),o=yield(0,$r.post)(this.fetch,`${this.url}/object/sign/${i}`,Object.assign({expiresIn:r},n?.transform?{transform:n.transform}:{}),{headers:this.headers}),s=n?.download?`&download=${n.download===!0?"":n.download}`:"";return o={signedUrl:encodeURI(`${this.url}${o.signedURL}${s}`)},{data:o,error:null}}catch(i){if((0,Ht.isStorageError)(i))return{data:null,error:i};throw i}})}createSignedUrls(e,r,n){return Ut(this,void 0,void 0,function*(){try{let i=yield(0,$r.post)(this.fetch,`${this.url}/object/sign/${this.bucketId}`,{expiresIn:r,paths:e},{headers:this.headers}),o=n?.download?`&download=${n.download===!0?"":n.download}`:"";return{data:i.map(s=>Object.assign(Object.assign({},s),{signedUrl:s.signedURL?encodeURI(`${this.url}${s.signedURL}${o}`):null})),error:null}}catch(i){if((0,Ht.isStorageError)(i))return{data:null,error:i};throw i}})}download(e,r){return Ut(this,void 0,void 0,function*(){let i=typeof r?.transform<"u"?"render/image/authenticated":"object",o=this.transformOptsToQueryString(r?.transform||{}),s=o?`?${o}`:"";try{let a=this._getFinalPath(e);return{data:yield(yield(0,$r.get)(this.fetch,`${this.url}/${i}/${a}${s}`,{headers:this.headers,noResolveJson:!0})).blob(),error:null}}catch(a){if((0,Ht.isStorageError)(a))return{data:null,error:a};throw a}})}info(e){return Ut(this,void 0,void 0,function*(){let r=this._getFinalPath(e);try{let n=yield(0,$r.get)(this.fetch,`${this.url}/object/info/${r}`,{headers:this.headers});return{data:(0,Sw.recursiveToCamel)(n),error:null}}catch(n){if((0,Ht.isStorageError)(n))return{data:null,error:n};throw n}})}exists(e){return Ut(this,void 0,void 0,function*(){let r=this._getFinalPath(e);try{return yield(0,$r.head)(this.fetch,`${this.url}/object/${r}`,{headers:this.headers}),{data:!0,error:null}}catch(n){if((0,Ht.isStorageError)(n)&&n instanceof Ht.StorageUnknownError){let i=n.originalError;if([400,404].includes(i?.status))return{data:!1,error:n}}throw n}})}getPublicUrl(e,r){let n=this._getFinalPath(e),i=[],o=r?.download?`download=${r.download===!0?"":r.download}`:"";o!==""&&i.push(o);let a=typeof r?.transform<"u"?"render/image":"object",u=this.transformOptsToQueryString(r?.transform||{});u!==""&&i.push(u);let l=i.join("&");return l!==""&&(l=`?${l}`),{data:{publicUrl:encodeURI(`${this.url}/${a}/public/${n}${l}`)}}}remove(e){return Ut(this,void 0,void 0,function*(){try{return{data:yield(0,$r.remove)(this.fetch,`${this.url}/object/${this.bucketId}`,{prefixes:e},{headers:this.headers}),error:null}}catch(r){if((0,Ht.isStorageError)(r))return{data:null,error:r};throw r}})}list(e,r,n){return Ut(this,void 0,void 0,function*(){try{let i=Object.assign(Object.assign(Object.assign({},RL),r),{prefix:e||""});return{data:yield(0,$r.post)(this.fetch,`${this.url}/object/list/${this.bucketId}`,i,{headers:this.headers},n),error:null}}catch(i){if((0,Ht.isStorageError)(i))return{data:null,error:i};throw i}})}encodeMetadata(e){return JSON.stringify(e)}toBase64(e){return typeof Buffer<"u"?Buffer.from(e).toString("base64"):btoa(e)}_getFinalPath(e){return`${this.bucketId}/${e}`}_removeEmptyFolders(e){return e.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")}transformOptsToQueryString(e){let r=[];return e.width&&r.push(`width=${e.width}`),e.height&&r.push(`height=${e.height}`),e.resize&&r.push(`resize=${e.resize}`),e.format&&r.push(`format=${e.format}`),e.quality&&r.push(`quality=${e.quality}`),r.join("&")}};Ha.default=em});var Ow=y(lc=>{"use strict";Object.defineProperty(lc,"__esModule",{value:!0});lc.version=void 0;lc.version="2.7.1"});var Aw=y(cc=>{"use strict";Object.defineProperty(cc,"__esModule",{value:!0});cc.DEFAULT_HEADERS=void 0;var $L=Ow();cc.DEFAULT_HEADERS={"X-Client-Info":`storage-js/${$L.version}`}});var kw=y(Va=>{"use strict";var Bo=Va&&Va.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(c){try{l(n.next(c))}catch(f){s(f)}}function u(c){try{l(n.throw(c))}catch(f){s(f)}}function l(c){c.done?o(c.value):i(c.value).then(a,u)}l((n=n.apply(t,e||[])).next())})};Object.defineProperty(Va,"__esModule",{value:!0});var IL=Aw(),qo=Ma(),Mo=Qp(),jL=uc(),tm=class{constructor(e,r={},n){this.url=e,this.headers=Object.assign(Object.assign({},IL.DEFAULT_HEADERS),r),this.fetch=(0,jL.resolveFetch)(n)}listBuckets(){return Bo(this,void 0,void 0,function*(){try{return{data:yield(0,Mo.get)(this.fetch,`${this.url}/bucket`,{headers:this.headers}),error:null}}catch(e){if((0,qo.isStorageError)(e))return{data:null,error:e};throw e}})}getBucket(e){return Bo(this,void 0,void 0,function*(){try{return{data:yield(0,Mo.get)(this.fetch,`${this.url}/bucket/${e}`,{headers:this.headers}),error:null}}catch(r){if((0,qo.isStorageError)(r))return{data:null,error:r};throw r}})}createBucket(e,r={public:!1}){return Bo(this,void 0,void 0,function*(){try{return{data:yield(0,Mo.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,qo.isStorageError)(n))return{data:null,error:n};throw n}})}updateBucket(e,r){return Bo(this,void 0,void 0,function*(){try{return{data:yield(0,Mo.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,qo.isStorageError)(n))return{data:null,error:n};throw n}})}emptyBucket(e){return Bo(this,void 0,void 0,function*(){try{return{data:yield(0,Mo.post)(this.fetch,`${this.url}/bucket/${e}/empty`,{},{headers:this.headers}),error:null}}catch(r){if((0,qo.isStorageError)(r))return{data:null,error:r};throw r}})}deleteBucket(e){return Bo(this,void 0,void 0,function*(){try{return{data:yield(0,Mo.remove)(this.fetch,`${this.url}/bucket/${e}`,{},{headers:this.headers}),error:null}}catch(r){if((0,qo.isStorageError)(r))return{data:null,error:r};throw r}})}};Va.default=tm});var Pw=y(Uo=>{"use strict";var Tw=Uo&&Uo.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Uo,"__esModule",{value:!0});Uo.StorageClient=void 0;var NL=Tw(Fw()),LL=Tw(kw()),rm=class extends LL.default{constructor(e,r={},n){super(e,r,n)}from(e){return new NL.default(this.url,this.headers,e,this.fetch)}};Uo.StorageClient=rm});var $w=y(Rw=>{"use strict";Object.defineProperty(Rw,"__esModule",{value:!0})});var jw=y(Ir=>{"use strict";var BL=Ir&&Ir.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),Iw=Ir&&Ir.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&BL(e,t,r)};Object.defineProperty(Ir,"__esModule",{value:!0});Ir.StorageClient=void 0;var qL=Pw();Object.defineProperty(Ir,"StorageClient",{enumerable:!0,get:function(){return qL.StorageClient}});Iw($w(),Ir);Iw(Ma(),Ir)});var Nw=y(fc=>{"use strict";Object.defineProperty(fc,"__esModule",{value:!0});fc.version=void 0;fc.version="2.48.1"});var Lw=y(tr=>{"use strict";Object.defineProperty(tr,"__esModule",{value:!0});tr.DEFAULT_REALTIME_OPTIONS=tr.DEFAULT_AUTH_OPTIONS=tr.DEFAULT_DB_OPTIONS=tr.DEFAULT_GLOBAL_OPTIONS=tr.DEFAULT_HEADERS=void 0;var ML=Nw(),za="";typeof Deno<"u"?za="deno":typeof document<"u"?za="web":typeof navigator<"u"&&navigator.product==="ReactNative"?za="react-native":za="node";tr.DEFAULT_HEADERS={"X-Client-Info":`supabase-js-${za}/${ML.version}`};tr.DEFAULT_GLOBAL_OPTIONS={headers:tr.DEFAULT_HEADERS};tr.DEFAULT_DB_OPTIONS={schema:"public"};tr.DEFAULT_AUTH_OPTIONS={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"};tr.DEFAULT_REALTIME_OPTIONS={}});var qw=y(lt=>{"use strict";var UL=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]}),HL=lt&&lt.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),VL=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)&&UL(e,t,r);return HL(e,t),e},zL=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(c){try{l(n.next(c))}catch(f){s(f)}}function u(c){try{l(n.throw(c))}catch(f){s(f)}}function l(c){c.done?o(c.value):i(c.value).then(a,u)}l((n=n.apply(t,e||[])).next())})};Object.defineProperty(lt,"__esModule",{value:!0});lt.fetchWithAuth=lt.resolveHeadersConstructor=lt.resolveFetch=void 0;var Bw=VL((bi(),je(vi))),GL=t=>{let e;return t?e=t:typeof fetch>"u"?e=Bw.default:e=fetch,(...r)=>e(...r)};lt.resolveFetch=GL;var WL=()=>typeof Headers>"u"?Bw.Headers:Headers;lt.resolveHeadersConstructor=WL;var KL=(t,e,r)=>{let n=(0,lt.resolveFetch)(r),i=(0,lt.resolveHeadersConstructor)();return(o,s)=>zL(void 0,void 0,void 0,function*(){var a;let u=(a=yield e())!==null&&a!==void 0?a:t,l=new i(s?.headers);return l.has("apikey")||l.set("apikey",t),l.has("Authorization")||l.set("Authorization",`Bearer ${u}`),n(o,Object.assign(Object.assign({},s),{headers:l}))})};lt.fetchWithAuth=KL});var Mw=y(fr=>{"use strict";var YL=fr&&fr.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(c){try{l(n.next(c))}catch(f){s(f)}}function u(c){try{l(n.throw(c))}catch(f){s(f)}}function l(c){c.done?o(c.value):i(c.value).then(a,u)}l((n=n.apply(t,e||[])).next())})};Object.defineProperty(fr,"__esModule",{value:!0});fr.applySettingDefaults=fr.isBrowser=fr.stripTrailingSlash=fr.uuid=void 0;function JL(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var e=Math.random()*16|0,r=t=="x"?e:e&3|8;return r.toString(16)})}fr.uuid=JL;function XL(t){return t.replace(/\/$/,"")}fr.stripTrailingSlash=XL;var ZL=()=>typeof window<"u";fr.isBrowser=ZL;function QL(t,e){let{db:r,auth:n,realtime:i,global:o}=t,{db:s,auth:a,realtime:u,global:l}=e,c={db:Object.assign(Object.assign({},s),r),auth:Object.assign(Object.assign({},a),n),realtime:Object.assign(Object.assign({},u),i),global:Object.assign(Object.assign({},l),o),accessToken:()=>YL(this,void 0,void 0,function*(){return""})};return t.accessToken?c.accessToken=t.accessToken:delete c.accessToken,c}fr.applySettingDefaults=QL});var nm=y(dc=>{"use strict";Object.defineProperty(dc,"__esModule",{value:!0});dc.version=void 0;dc.version="2.67.3"});var hc=y(ct=>{"use strict";Object.defineProperty(ct,"__esModule",{value:!0});ct.API_VERSIONS=ct.API_VERSION_HEADER_NAME=ct.NETWORK_FAILURE=ct.EXPIRY_MARGIN=ct.DEFAULT_HEADERS=ct.AUDIENCE=ct.STORAGE_KEY=ct.GOTRUE_URL=void 0;var eB=nm();ct.GOTRUE_URL="http://localhost:9999";ct.STORAGE_KEY="supabase.auth.token";ct.AUDIENCE="";ct.DEFAULT_HEADERS={"X-Client-Info":`gotrue-js/${eB.version}`};ct.EXPIRY_MARGIN=10;ct.NETWORK_FAILURE={MAX_RETRIES:10,RETRY_INTERVAL:2};ct.API_VERSION_HEADER_NAME="X-Supabase-Api-Version";ct.API_VERSIONS={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}}});var Ho=y(ee=>{"use strict";var tB=ee&&ee.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),rB=ee&&ee.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),nB=ee&&ee.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&tB(e,t,r);return rB(e,t),e};Object.defineProperty(ee,"__esModule",{value:!0});ee.parseResponseAPIVersion=ee.getCodeChallengeAndMethod=ee.generatePKCEChallenge=ee.generatePKCEVerifier=ee.retryable=ee.sleep=ee.decodeJWTPayload=ee.Deferred=ee.decodeBase64URL=ee.removeItemAsync=ee.getItemAsync=ee.setItemAsync=ee.looksLikeFetchResponse=ee.resolveFetch=ee.parseParametersFromURL=ee.supportsLocalStorage=ee.isBrowser=ee.uuid=ee.expiresAt=void 0;var iB=hc();function oB(t){return Math.round(Date.now()/1e3)+t}ee.expiresAt=oB;function sB(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){let e=Math.random()*16|0;return(t=="x"?e:e&3|8).toString(16)})}ee.uuid=sB;var aB=()=>typeof window<"u"&&typeof document<"u";ee.isBrowser=aB;var _i={tested:!1,writable:!1},uB=()=>{if(!(0,ee.isBrowser)())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(_i.tested)return _i.writable;let t=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(t,t),globalThis.localStorage.removeItem(t),_i.tested=!0,_i.writable=!0}catch{_i.tested=!0,_i.writable=!1}return _i.writable};ee.supportsLocalStorage=uB;function lB(t){let e={},r=new URL(t);if(r.hash&&r.hash[0]==="#")try{new URLSearchParams(r.hash.substring(1)).forEach((i,o)=>{e[o]=i})}catch{}return r.searchParams.forEach((n,i)=>{e[i]=n}),e}ee.parseParametersFromURL=lB;var cB=t=>{let e;return t?e=t:typeof fetch>"u"?e=(...r)=>Promise.resolve().then(()=>nB((bi(),je(vi)))).then(({default:n})=>n(...r)):e=fetch,(...r)=>e(...r)};ee.resolveFetch=cB;var fB=t=>typeof t=="object"&&t!==null&&"status"in t&&"ok"in t&&"json"in t&&typeof t.json=="function";ee.looksLikeFetchResponse=fB;var dB=async(t,e,r)=>{await t.setItem(e,JSON.stringify(r))};ee.setItemAsync=dB;var hB=async(t,e)=>{let r=await t.getItem(e);if(!r)return null;try{return JSON.parse(r)}catch{return r}};ee.getItemAsync=hB;var pB=async(t,e)=>{await t.removeItem(e)};ee.removeItemAsync=pB;function Uw(t){let e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",r="",n,i,o,s,a,u,l,c=0;for(t=t.replace("-","+").replace("_","/");c<t.length;)s=e.indexOf(t.charAt(c++)),a=e.indexOf(t.charAt(c++)),u=e.indexOf(t.charAt(c++)),l=e.indexOf(t.charAt(c++)),n=s<<2|a>>4,i=(a&15)<<4|u>>2,o=(u&3)<<6|l,r=r+String.fromCharCode(n),u!=64&&i!=0&&(r=r+String.fromCharCode(i)),l!=64&&o!=0&&(r=r+String.fromCharCode(o));return r}ee.decodeBase64URL=Uw;var pc=class t{constructor(){this.promise=new t.promiseConstructor((e,r)=>{this.resolve=e,this.reject=r})}};ee.Deferred=pc;pc.promiseConstructor=Promise;function mB(t){let e=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}=?$|[a-z0-9_-]{2}(==)?$)$/i,r=t.split(".");if(r.length!==3)throw new Error("JWT is not valid: not a JWT structure");if(!e.test(r[1]))throw new Error("JWT is not valid: payload is not in base64url format");let n=r[1];return JSON.parse(Uw(n))}ee.decodeJWTPayload=mB;async function gB(t){return await new Promise(e=>{setTimeout(()=>e(null),t)})}ee.sleep=gB;function yB(t,e){return new Promise((n,i)=>{(async()=>{for(let o=0;o<1/0;o++)try{let s=await t(o);if(!e(o,null,s)){n(s);return}}catch(s){if(!e(o,s)){i(s);return}}})()})}ee.retryable=yB;function DB(t){return("0"+t.toString(16)).substr(-2)}function Hw(){let e=new Uint32Array(56);if(typeof crypto>"u"){let r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",n=r.length,i="";for(let o=0;o<56;o++)i+=r.charAt(Math.floor(Math.random()*n));return i}return crypto.getRandomValues(e),Array.from(e,DB).join("")}ee.generatePKCEVerifier=Hw;async function vB(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 bB(t){return btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function Vw(t){if(!(typeof crypto<"u"&&typeof crypto.subtle<"u"&&typeof TextEncoder<"u"))return console.warn("WebCrypto API is not supported. Code challenge method will default to use plain instead of sha256."),t;let r=await vB(t);return bB(r)}ee.generatePKCEChallenge=Vw;async function wB(t,e,r=!1){let n=Hw(),i=n;r&&(i+="/PASSWORD_RECOVERY"),await(0,ee.setItemAsync)(t,`${e}-code-verifier`,i);let o=await Vw(n);return[o,n===o?"plain":"s256"]}ee.getCodeChallengeAndMethod=wB;var _B=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function EB(t){let e=t.headers.get(iB.API_VERSION_HEADER_NAME);if(!e||!e.match(_B))return null;try{return new Date(`${e}T00:00:00.0Z`)}catch{return null}}ee.parseResponseAPIVersion=EB});var Ga=y(ce=>{"use strict";Object.defineProperty(ce,"__esModule",{value:!0});ce.isAuthWeakPasswordError=ce.AuthWeakPasswordError=ce.isAuthRetryableFetchError=ce.AuthRetryableFetchError=ce.AuthPKCEGrantCodeExchangeError=ce.isAuthImplicitGrantRedirectError=ce.AuthImplicitGrantRedirectError=ce.AuthInvalidCredentialsError=ce.AuthInvalidTokenResponseError=ce.isAuthSessionMissingError=ce.AuthSessionMissingError=ce.CustomAuthError=ce.AuthUnknownError=ce.isAuthApiError=ce.AuthApiError=ce.isAuthError=ce.AuthError=void 0;var Vo=class extends Error{constructor(e,r,n){super(e),this.__isAuthError=!0,this.name="AuthError",this.status=r,this.code=n}};ce.AuthError=Vo;function zo(t){return typeof t=="object"&&t!==null&&"__isAuthError"in t}ce.isAuthError=zo;var im=class extends Vo{constructor(e,r,n){super(e,r,n),this.name="AuthApiError",this.status=r,this.code=n}};ce.AuthApiError=im;function CB(t){return zo(t)&&t.name==="AuthApiError"}ce.isAuthApiError=CB;var om=class extends Vo{constructor(e,r){super(e),this.name="AuthUnknownError",this.originalError=r}};ce.AuthUnknownError=om;var jr=class extends Vo{constructor(e,r,n,i){super(e,n,i),this.name=r,this.status=n}};ce.CustomAuthError=jr;var sm=class extends jr{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}};ce.AuthSessionMissingError=sm;function SB(t){return zo(t)&&t.name==="AuthSessionMissingError"}ce.isAuthSessionMissingError=SB;var am=class extends jr{constructor(){super("Auth session or user missing","AuthInvalidTokenResponseError",500,void 0)}};ce.AuthInvalidTokenResponseError=am;var um=class extends jr{constructor(e){super(e,"AuthInvalidCredentialsError",400,void 0)}};ce.AuthInvalidCredentialsError=um;var lm=class extends jr{constructor(e,r=null){super(e,"AuthImplicitGrantRedirectError",500,void 0),this.details=null,this.details=r}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}};ce.AuthImplicitGrantRedirectError=lm;function xB(t){return zo(t)&&t.name==="AuthImplicitGrantRedirectError"}ce.isAuthImplicitGrantRedirectError=xB;var cm=class extends jr{constructor(e,r=null){super(e,"AuthPKCEGrantCodeExchangeError",500,void 0),this.details=null,this.details=r}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}};ce.AuthPKCEGrantCodeExchangeError=cm;var fm=class extends jr{constructor(e,r){super(e,"AuthRetryableFetchError",r,void 0)}};ce.AuthRetryableFetchError=fm;function FB(t){return zo(t)&&t.name==="AuthRetryableFetchError"}ce.isAuthRetryableFetchError=FB;var dm=class extends jr{constructor(e,r,n){super(e,"AuthWeakPasswordError",r,"weak_password"),this.reasons=n}};ce.AuthWeakPasswordError=dm;function OB(t){return zo(t)&&t.name==="AuthWeakPasswordError"}ce.isAuthWeakPasswordError=OB});var mm=y(nt=>{"use strict";var AB=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 mc=hc(),hm=Ho(),qn=Ga(),Ei=t=>t.msg||t.message||t.error_description||t.error||JSON.stringify(t),kB=[502,503,504];async function pm(t){var e;if(!(0,hm.looksLikeFetchResponse)(t))throw new qn.AuthRetryableFetchError(Ei(t),0);if(kB.includes(t.status))throw new qn.AuthRetryableFetchError(Ei(t),t.status);let r;try{r=await t.json()}catch(o){throw new qn.AuthUnknownError(Ei(o),o)}let n,i=(0,hm.parseResponseAPIVersion)(t);if(i&&i.getTime()>=mc.API_VERSIONS["2024-01-01"].timestamp&&typeof r=="object"&&r&&typeof r.code=="string"?n=r.code:typeof r=="object"&&r&&typeof r.error_code=="string"&&(n=r.error_code),n){if(n==="weak_password")throw new qn.AuthWeakPasswordError(Ei(r),t.status,((e=r.weak_password)===null||e===void 0?void 0:e.reasons)||[]);if(n==="session_not_found")throw new qn.AuthSessionMissingError}else if(typeof r=="object"&&r&&typeof r.weak_password=="object"&&r.weak_password&&Array.isArray(r.weak_password.reasons)&&r.weak_password.reasons.length&&r.weak_password.reasons.reduce((o,s)=>o&&typeof s=="string",!0))throw new qn.AuthWeakPasswordError(Ei(r),t.status,r.weak_password.reasons);throw new qn.AuthApiError(Ei(r),t.status||500,n)}nt.handleError=pm;var TB=(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 PB(t,e,r,n){var i;let o=Object.assign({},n?.headers);o[mc.API_VERSION_HEADER_NAME]||(o[mc.API_VERSION_HEADER_NAME]=mc.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 RB(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=PB;async function RB(t,e,r,n,i,o){let s=TB(e,n,i,o),a;try{a=await t(r,Object.assign({},s))}catch(u){throw console.error(u),new qn.AuthRetryableFetchError(Ei(u),0)}if(a.ok||await pm(a),n?.noResolveJson)return a;try{return await a.json()}catch(u){await pm(u)}}function zw(t){var e;let r=null;BB(t)&&(r=Object.assign({},t),t.expires_at||(r.expires_at=(0,hm.expiresAt)(t.expires_in)));let n=(e=t.user)!==null&&e!==void 0?e:t;return{data:{session:r,user:n},error:null}}nt._sessionResponse=zw;function $B(t){let e=zw(t);return!e.error&&t.weak_password&&typeof t.weak_password=="object"&&Array.isArray(t.weak_password.reasons)&&t.weak_password.reasons.length&&t.weak_password.message&&typeof t.weak_password.message=="string"&&t.weak_password.reasons.reduce((r,n)=>r&&typeof n=="string",!0)&&(e.data.weak_password=t.weak_password),e}nt._sessionResponsePassword=$B;function IB(t){var e;return{data:{user:(e=t.user)!==null&&e!==void 0?e:t},error:null}}nt._userResponse=IB;function jB(t){return{data:t,error:null}}nt._ssoResponse=jB;function NB(t){let{action_link:e,email_otp:r,hashed_token:n,redirect_to:i,verification_type:o}=t,s=AB(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=NB;function LB(t){return t}nt._noResolveJsonResponse=LB;function BB(t){return t.access_token&&t.refresh_token&&t.expires_in}});var gc=y(Wa=>{"use strict";var qB=Wa&&Wa.__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(Wa,"__esModule",{value:!0});var vt=mm(),MB=Ho(),Nr=Ga(),gm=class{constructor({url:e="",headers:r={},fetch:n}){this.url=e,this.headers=r,this.fetch=(0,MB.resolveFetch)(n),this.mfa={listFactors:this._listFactors.bind(this),deleteFactor:this._deleteFactor.bind(this)}}async signOut(e,r="global"){try{return await(0,vt._request)(this.fetch,"POST",`${this.url}/logout?scope=${r}`,{headers:this.headers,jwt:e,noResolveJson:!0}),{data:null,error:null}}catch(n){if((0,Nr.isAuthError)(n))return{data:null,error:n};throw n}}async inviteUserByEmail(e,r={}){try{return await(0,vt._request)(this.fetch,"POST",`${this.url}/invite`,{body:{email:e,data:r.data},headers:this.headers,redirectTo:r.redirectTo,xform:vt._userResponse})}catch(n){if((0,Nr.isAuthError)(n))return{data:{user:null},error:n};throw n}}async generateLink(e){try{let{options:r}=e,n=qB(e,["options"]),i=Object.assign(Object.assign({},n),r);return"newEmail"in n&&(i.new_email=n?.newEmail,delete i.newEmail),await(0,vt._request)(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:i,headers:this.headers,xform:vt._generateLinkResponse,redirectTo:r?.redirectTo})}catch(r){if((0,Nr.isAuthError)(r))return{data:{properties:null,user:null},error:r};throw r}}async createUser(e){try{return await(0,vt._request)(this.fetch,"POST",`${this.url}/admin/users`,{body:e,headers:this.headers,xform:vt._userResponse})}catch(r){if((0,Nr.isAuthError)(r))return{data:{user:null},error:r};throw r}}async listUsers(e){var r,n,i,o,s,a,u;try{let l={nextPage:null,lastPage:0,total:0},c=await(0,vt._request)(this.fetch,"GET",`${this.url}/admin/users`,{headers:this.headers,noResolveJson:!0,query:{page:(n=(r=e?.page)===null||r===void 0?void 0:r.toString())!==null&&n!==void 0?n:"",per_page:(o=(i=e?.perPage)===null||i===void 0?void 0:i.toString())!==null&&o!==void 0?o:""},xform:vt._noResolveJsonResponse});if(c.error)throw c.error;let f=await c.json(),h=(s=c.headers.get("x-total-count"))!==null&&s!==void 0?s:0,d=(u=(a=c.headers.get("link"))===null||a===void 0?void 0:a.split(","))!==null&&u!==void 0?u:[];return d.length>0&&(d.forEach(m=>{let b=parseInt(m.split(";")[0].split("=")[1].substring(0,1)),D=JSON.parse(m.split(";")[1].split("=")[1]);l[`${D}Page`]=b}),l.total=parseInt(h)),{data:Object.assign(Object.assign({},f),l),error:null}}catch(l){if((0,Nr.isAuthError)(l))return{data:{users:[]},error:l};throw l}}async getUserById(e){try{return await(0,vt._request)(this.fetch,"GET",`${this.url}/admin/users/${e}`,{headers:this.headers,xform:vt._userResponse})}catch(r){if((0,Nr.isAuthError)(r))return{data:{user:null},error:r};throw r}}async updateUserById(e,r){try{return await(0,vt._request)(this.fetch,"PUT",`${this.url}/admin/users/${e}`,{body:r,headers:this.headers,xform:vt._userResponse})}catch(n){if((0,Nr.isAuthError)(n))return{data:{user:null},error:n};throw n}}async deleteUser(e,r=!1){try{return await(0,vt._request)(this.fetch,"DELETE",`${this.url}/admin/users/${e}`,{headers:this.headers,body:{should_soft_delete:r},xform:vt._userResponse})}catch(n){if((0,Nr.isAuthError)(n))return{data:{user:null},error:n};throw n}}async _listFactors(e){try{let{data:r,error:n}=await(0,vt._request)(this.fetch,"GET",`${this.url}/admin/users/${e.userId}/factors`,{headers:this.headers,xform:i=>({data:{factors:i},error:null})});return{data:r,error:n}}catch(r){if((0,Nr.isAuthError)(r))return{data:null,error:r};throw r}}async _deleteFactor(e){try{return{data:await(0,vt._request)(this.fetch,"DELETE",`${this.url}/admin/users/${e.userId}/factors/${e.id}`,{headers:this.headers}),error:null}}catch(r){if((0,Nr.isAuthError)(r))return{data:null,error:r};throw r}}};Wa.default=gm});var Gw=y(Go=>{"use strict";Object.defineProperty(Go,"__esModule",{value:!0});Go.memoryLocalStorageAdapter=Go.localStorageAdapter=void 0;var ym=Ho();Go.localStorageAdapter={getItem:t=>(0,ym.supportsLocalStorage)()?globalThis.localStorage.getItem(t):null,setItem:(t,e)=>{(0,ym.supportsLocalStorage)()&&globalThis.localStorage.setItem(t,e)},removeItem:t=>{(0,ym.supportsLocalStorage)()&&globalThis.localStorage.removeItem(t)}};function UB(t={}){return{getItem:e=>t[e]||null,setItem:(e,r)=>{t[e]=r},removeItem:e=>{delete t[e]}}}Go.memoryLocalStorageAdapter=UB});var Ww=y(yc=>{"use strict";Object.defineProperty(yc,"__esModule",{value:!0});yc.polyfillGlobalThis=void 0;function HB(){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)}}yc.polyfillGlobalThis=HB});var Dm=y(it=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0});it.processLock=it.navigatorLock=it.ProcessLockAcquireTimeoutError=it.NavigatorLockAcquireTimeoutError=it.LockAcquireTimeoutError=it.internals=void 0;var VB=Ho();it.internals={debug:!!(globalThis&&(0,VB.supportsLocalStorage)()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug")==="true")};var Ka=class extends Error{constructor(e){super(e),this.isAcquireTimeout=!0}};it.LockAcquireTimeoutError=Ka;var Dc=class extends Ka{};it.NavigatorLockAcquireTimeoutError=Dc;var vc=class extends Ka{};it.ProcessLockAcquireTimeoutError=vc;async function zB(t,e,r){it.internals.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire lock",t,e);let n=new globalThis.AbortController;return e>0&&setTimeout(()=>{n.abort(),it.internals.debug&&console.log("@supabase/gotrue-js: navigatorLock acquire timed out",t)},e),await Promise.resolve().then(()=>globalThis.navigator.locks.request(t,e===0?{mode:"exclusive",ifAvailable:!0}:{mode:"exclusive",signal:n.signal},async i=>{if(i){it.internals.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquired",t,i.name);try{return await r()}finally{it.internals.debug&&console.log("@supabase/gotrue-js: navigatorLock: released",t,i.name)}}else{if(e===0)throw it.internals.debug&&console.log("@supabase/gotrue-js: navigatorLock: not immediately available",t),new Dc(`Acquiring an exclusive Navigator LockManager lock "${t}" immediately failed`);if(it.internals.debug)try{let o=await globalThis.navigator.locks.query();console.log("@supabase/gotrue-js: Navigator LockManager state",JSON.stringify(o,null," "))}catch(o){console.warn("@supabase/gotrue-js: Error when querying Navigator LockManager state",o)}return console.warn("@supabase/gotrue-js: Navigator LockManager returned a null lock when using #request without ifAvailable set to true, it appears this browser is not following the LockManager spec https://developer.mozilla.org/en-US/docs/Web/API/LockManager/request"),await r()}}))}it.navigatorLock=zB;var Kw={};async function GB(t,e,r){var n;let i=(n=Kw[t])!==null&&n!==void 0?n:Promise.resolve(),o=Promise.race([i.catch(()=>null),e>=0?new Promise((s,a)=>{setTimeout(()=>{a(new vc(`Acquring process lock with name "${t}" timed out`))},e)}):null].filter(s=>s)).catch(s=>{if(s&&s.isAcquireTimeout)throw s;return null}).then(async()=>await r());return Kw[t]=o.catch(async s=>{if(s&&s.isAcquireTimeout)return await i,null;throw s}),await o}it.processLock=GB});var bm=y(Xa=>{"use strict";var WB=Xa&&Xa.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Xa,"__esModule",{value:!0});var KB=WB(gc()),Ja=hc(),X=Ga(),se=mm(),me=Ho(),vm=Gw(),YB=Ww(),JB=nm(),Yw=Dm();(0,YB.polyfillGlobalThis)();var XB={url:Ja.GOTRUE_URL,storageKey:Ja.STORAGE_KEY,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:Ja.DEFAULT_HEADERS,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1},Ya=30*1e3,Jw=3;async function Xw(t,e,r){return await r()}var bc=class t{constructor(e){var r,n;this.memoryStorage=null,this.stateChangeEmitters=new Map,this.autoRefreshTicker=null,this.visibilityChangedCallback=null,this.refreshingDeferred=null,this.initializePromise=null,this.detectSessionInUrl=!0,this.hasCustomAuthorizationHeader=!1,this.suppressGetSessionWarning=!1,this.lockAcquired=!1,this.pendingInLock=[],this.broadcastChannel=null,this.logger=console.log,this.instanceID=t.nextInstanceID,t.nextInstanceID+=1,this.instanceID>0&&(0,me.isBrowser)()&&console.warn("Multiple GoTrueClient instances detected in the same browser context. It is not an error, but this should be avoided as it may produce undefined behavior when used concurrently under the same storage key.");let i=Object.assign(Object.assign({},XB),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 KB.default({url:i.url,headers:i.headers,fetch:i.fetch}),this.url=i.url,this.headers=i.headers,this.fetch=(0,me.resolveFetch)(i.fetch),this.lock=i.lock||Xw,this.detectSessionInUrl=i.detectSessionInUrl,this.flowType=i.flowType,this.hasCustomAuthorizationHeader=i.hasCustomAuthorizationHeader,i.lock?this.lock=i.lock:(0,me.isBrowser)()&&(!((r=globalThis?.navigator)===null||r===void 0)&&r.locks)?this.lock=Yw.navigatorLock:this.lock=Xw,this.mfa={verify:this._verify.bind(this),enroll:this._enroll.bind(this),unenroll:this._unenroll.bind(this),challenge:this._challenge.bind(this),listFactors:this._listFactors.bind(this),challengeAndVerify:this._challengeAndVerify.bind(this),getAuthenticatorAssuranceLevel:this._getAuthenticatorAssuranceLevel.bind(this)},this.persistSession?i.storage?this.storage=i.storage:(0,me.supportsLocalStorage)()?this.storage=vm.localStorageAdapter:(this.memoryStorage={},this.storage=(0,vm.memoryLocalStorageAdapter)(this.memoryStorage)):(this.memoryStorage={},this.storage=(0,vm.memoryLocalStorageAdapter)(this.memoryStorage)),(0,me.isBrowser)()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(o){console.error("Failed to create a new BroadcastChannel, multi-tab state changes will not be available",o)}(n=this.broadcastChannel)===null||n===void 0||n.addEventListener("message",async o=>{this._debug("received broadcast notification from other tab or client",o),await this._notifyAllSubscribers(o.data.event,o.data.session,!1)})}this.initialize()}_debug(...e){return this.logDebugMessages&&this.logger(`GoTrueClient@${this.instanceID} (${JB.version}) ${new Date().toISOString()}`,...e),this}async initialize(){return this.initializePromise?await this.initializePromise:(this.initializePromise=(async()=>await this._acquireLock(-1,async()=>await this._initialize()))(),await this.initializePromise)}async _initialize(){var e;try{let r=(0,me.parseParametersFromURL)(window.location.href),n="none";if(this._isImplicitGrantCallback(r)?n="implicit":await this._isPKCECallback(r)&&(n="pkce"),(0,me.isBrowser)()&&this.detectSessionInUrl&&n!=="none"){let{data:i,error:o}=await this._getSessionFromURL(r,n);if(o){if(this._debug("#_initialize()","error detecting session from URL",o),(0,X.isAuthImplicitGrantRedirectError)(o)){let u=(e=o.details)===null||e===void 0?void 0:e.code;if(u==="identity_already_exists"||u==="identity_not_found"||u==="single_identity_not_deletable")return{error:o}}return await this._removeSession(),{error:o}}let{session:s,redirectType:a}=i;return this._debug("#_initialize()","detected session in URL",s,"redirect type",a),await this._saveSession(s),setTimeout(async()=>{a==="recovery"?await this._notifyAllSubscribers("PASSWORD_RECOVERY",s):await this._notifyAllSubscribers("SIGNED_IN",s)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(r){return(0,X.isAuthError)(r)?{error:r}:{error:new X.AuthUnknownError("Unexpected error during initialization",r)}}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(e){var r,n,i;try{let o=await(0,se._request)(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{data:(n=(r=e?.options)===null||r===void 0?void 0:r.data)!==null&&n!==void 0?n:{},gotrue_meta_security:{captcha_token:(i=e?.options)===null||i===void 0?void 0:i.captchaToken}},xform:se._sessionResponse}),{data:s,error:a}=o;if(a||!s)return{data:{user:null,session:null},error:a};let u=s.session,l=s.user;return s.session&&(await this._saveSession(s.session),await this._notifyAllSubscribers("SIGNED_IN",u)),{data:{user:l,session:u},error:null}}catch(o){if((0,X.isAuthError)(o))return{data:{user:null,session:null},error:o};throw o}}async signUp(e){var r,n,i;try{let o;if("email"in e){let{email:c,password:f,options:h}=e,d=null,m=null;this.flowType==="pkce"&&([d,m]=await(0,me.getCodeChallengeAndMethod)(this.storage,this.storageKey)),o=await(0,se._request)(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:h?.emailRedirectTo,body:{email:c,password:f,data:(r=h?.data)!==null&&r!==void 0?r:{},gotrue_meta_security:{captcha_token:h?.captchaToken},code_challenge:d,code_challenge_method:m},xform:se._sessionResponse})}else if("phone"in e){let{phone:c,password:f,options:h}=e;o=await(0,se._request)(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:c,password:f,data:(n=h?.data)!==null&&n!==void 0?n:{},channel:(i=h?.channel)!==null&&i!==void 0?i:"sms",gotrue_meta_security:{captcha_token:h?.captchaToken}},xform:se._sessionResponse})}else throw new X.AuthInvalidCredentialsError("You must provide either an email or phone number and a password");let{data:s,error:a}=o;if(a||!s)return{data:{user:null,session:null},error:a};let u=s.session,l=s.user;return s.session&&(await this._saveSession(s.session),await this._notifyAllSubscribers("SIGNED_IN",u)),{data:{user:l,session:u},error:null}}catch(o){if((0,X.isAuthError)(o))return{data:{user:null,session:null},error:o};throw o}}async signInWithPassword(e){try{let r;if("email"in e){let{email:o,password:s,options:a}=e;r=await(0,se._request)(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:o,password:s,gotrue_meta_security:{captcha_token:a?.captchaToken}},xform:se._sessionResponsePassword})}else if("phone"in e){let{phone:o,password:s,options:a}=e;r=await(0,se._request)(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:o,password:s,gotrue_meta_security:{captcha_token:a?.captchaToken}},xform:se._sessionResponsePassword})}else throw new X.AuthInvalidCredentialsError("You must provide either an email or phone number and a password");let{data:n,error:i}=r;return i?{data:{user:null,session:null},error:i}:!n||!n.session||!n.user?{data:{user:null,session:null},error:new X.AuthInvalidTokenResponseError}:(n.session&&(await this._saveSession(n.session),await this._notifyAllSubscribers("SIGNED_IN",n.session)),{data:Object.assign({user:n.user,session:n.session},n.weak_password?{weakPassword:n.weak_password}:null),error:i})}catch(r){if((0,X.isAuthError)(r))return{data:{user:null,session:null},error:r};throw r}}async signInWithOAuth(e){var r,n,i,o;return await this._handleProviderSignIn(e.provider,{redirectTo:(r=e.options)===null||r===void 0?void 0:r.redirectTo,scopes:(n=e.options)===null||n===void 0?void 0:n.scopes,queryParams:(i=e.options)===null||i===void 0?void 0:i.queryParams,skipBrowserRedirect:(o=e.options)===null||o===void 0?void 0:o.skipBrowserRedirect})}async exchangeCodeForSession(e){return await this.initializePromise,this._acquireLock(-1,async()=>this._exchangeCodeForSession(e))}async _exchangeCodeForSession(e){let r=await(0,me.getItemAsync)(this.storage,`${this.storageKey}-code-verifier`),[n,i]=(r??"").split("/");try{let{data:o,error:s}=await(0,se._request)(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:e,code_verifier:n},xform:se._sessionResponse});if(await(0,me.removeItemAsync)(this.storage,`${this.storageKey}-code-verifier`),s)throw s;return!o||!o.session||!o.user?{data:{user:null,session:null,redirectType:null},error:new X.AuthInvalidTokenResponseError}:(o.session&&(await this._saveSession(o.session),await this._notifyAllSubscribers("SIGNED_IN",o.session)),{data:Object.assign(Object.assign({},o),{redirectType:i??null}),error:s})}catch(o){if((0,X.isAuthError)(o))return{data:{user:null,session:null,redirectType:null},error:o};throw o}}async signInWithIdToken(e){try{let{options:r,provider:n,token:i,access_token:o,nonce:s}=e,a=await(0,se._request)(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:n,id_token:i,access_token:o,nonce:s,gotrue_meta_security:{captcha_token:r?.captchaToken}},xform:se._sessionResponse}),{data:u,error:l}=a;return l?{data:{user:null,session:null},error:l}:!u||!u.session||!u.user?{data:{user:null,session:null},error:new X.AuthInvalidTokenResponseError}:(u.session&&(await this._saveSession(u.session),await this._notifyAllSubscribers("SIGNED_IN",u.session)),{data:u,error:l})}catch(r){if((0,X.isAuthError)(r))return{data:{user:null,session:null},error:r};throw r}}async signInWithOtp(e){var r,n,i,o,s;try{if("email"in e){let{email:a,options:u}=e,l=null,c=null;this.flowType==="pkce"&&([l,c]=await(0,me.getCodeChallengeAndMethod)(this.storage,this.storageKey));let{error:f}=await(0,se._request)(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:a,data:(r=u?.data)!==null&&r!==void 0?r:{},create_user:(n=u?.shouldCreateUser)!==null&&n!==void 0?n:!0,gotrue_meta_security:{captcha_token:u?.captchaToken},code_challenge:l,code_challenge_method:c},redirectTo:u?.emailRedirectTo});return{data:{user:null,session:null},error:f}}if("phone"in e){let{phone:a,options:u}=e,{data:l,error:c}=await(0,se._request)(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:a,data:(i=u?.data)!==null&&i!==void 0?i:{},create_user:(o=u?.shouldCreateUser)!==null&&o!==void 0?o:!0,gotrue_meta_security:{captcha_token:u?.captchaToken},channel:(s=u?.channel)!==null&&s!==void 0?s:"sms"}});return{data:{user:null,session:null,messageId:l?.message_id},error:c}}throw new X.AuthInvalidCredentialsError("You must provide either an email or phone number.")}catch(a){if((0,X.isAuthError)(a))return{data:{user:null,session:null},error:a};throw a}}async verifyOtp(e){var r,n;try{let i,o;"options"in e&&(i=(r=e.options)===null||r===void 0?void 0:r.redirectTo,o=(n=e.options)===null||n===void 0?void 0:n.captchaToken);let{data:s,error:a}=await(0,se._request)(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},e),{gotrue_meta_security:{captcha_token:o}}),redirectTo:i,xform:se._sessionResponse});if(a)throw a;if(!s)throw new Error("An error occurred on token verification.");let u=s.session,l=s.user;return u?.access_token&&(await this._saveSession(u),await this._notifyAllSubscribers(e.type=="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",u)),{data:{user:l,session:u},error:null}}catch(i){if((0,X.isAuthError)(i))return{data:{user:null,session:null},error:i};throw i}}async signInWithSSO(e){var r,n,i;try{let o=null,s=null;return this.flowType==="pkce"&&([o,s]=await(0,me.getCodeChallengeAndMethod)(this.storage,this.storageKey)),await(0,se._request)(this.fetch,"POST",`${this.url}/sso`,{body:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},"providerId"in e?{provider_id:e.providerId}:null),"domain"in e?{domain:e.domain}:null),{redirect_to:(n=(r=e.options)===null||r===void 0?void 0:r.redirectTo)!==null&&n!==void 0?n:void 0}),!((i=e?.options)===null||i===void 0)&&i.captchaToken?{gotrue_meta_security:{captcha_token:e.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:o,code_challenge_method:s}),headers:this.headers,xform:se._ssoResponse})}catch(o){if((0,X.isAuthError)(o))return{data:null,error:o};throw o}}async reauthenticate(){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._reauthenticate())}async _reauthenticate(){try{return await this._useSession(async e=>{let{data:{session:r},error:n}=e;if(n)throw n;if(!r)throw new X.AuthSessionMissingError;let{error:i}=await(0,se._request)(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:r.access_token});return{data:{user:null,session:null},error:i}})}catch(e){if((0,X.isAuthError)(e))return{data:{user:null,session:null},error:e};throw e}}async resend(e){try{let r=`${this.url}/resend`;if("email"in e){let{email:n,type:i,options:o}=e,{error:s}=await(0,se._request)(this.fetch,"POST",r,{headers:this.headers,body:{email:n,type:i,gotrue_meta_security:{captcha_token:o?.captchaToken}},redirectTo:o?.emailRedirectTo});return{data:{user:null,session:null},error:s}}else if("phone"in e){let{phone:n,type:i,options:o}=e,{data:s,error:a}=await(0,se._request)(this.fetch,"POST",r,{headers:this.headers,body:{phone:n,type:i,gotrue_meta_security:{captcha_token:o?.captchaToken}}});return{data:{user:null,session:null,messageId:s?.message_id},error:a}}throw new X.AuthInvalidCredentialsError("You must provide either an email or phone number and a type")}catch(r){if((0,X.isAuthError)(r))return{data:{user:null,session:null},error:r};throw r}}async getSession(){return await this.initializePromise,await this._acquireLock(-1,async()=>this._useSession(async r=>r))}async _acquireLock(e,r){this._debug("#_acquireLock","begin",e);try{if(this.lockAcquired){let n=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),i=(async()=>(await n,await r()))();return this.pendingInLock.push((async()=>{try{await i}catch{}})()),i}return await this.lock(`lock:${this.storageKey}`,e,async()=>{this._debug("#_acquireLock","lock acquired for storage key",this.storageKey);try{this.lockAcquired=!0;let n=r();for(this.pendingInLock.push((async()=>{try{await n}catch{}})()),await n;this.pendingInLock.length;){let i=[...this.pendingInLock];await Promise.all(i),this.pendingInLock.splice(0,i.length)}return await n}finally{this._debug("#_acquireLock","lock released for storage key",this.storageKey),this.lockAcquired=!1}})}finally{this._debug("#_acquireLock","end")}}async _useSession(e){this._debug("#_useSession","begin");try{let r=await this.__loadSession();return await e(r)}finally{this._debug("#_useSession","end")}}async __loadSession(){this._debug("#__loadSession()","begin"),this.lockAcquired||this._debug("#__loadSession()","used outside of an acquired lock!",new Error().stack);try{let e=null,r=await(0,me.getItemAsync)(this.storage,this.storageKey);if(this._debug("#getSession()","session from storage",r),r!==null&&(this._isValidSession(r)?e=r:(this._debug("#getSession()","session from storage is not valid"),await this._removeSession())),!e)return{data:{session:null},error:null};let n=e.expires_at?e.expires_at<=Date.now()/1e3:!1;if(this._debug("#__loadSession()",`session has${n?"":" not"} expired`,"expires_at",e.expires_at),!n){if(this.storage.isServer){let s=this.suppressGetSessionWarning;e=new Proxy(e,{get:(u,l,c)=>(!s&&l==="user"&&(console.warn("Using the user object as returned from supabase.auth.getSession() or from some supabase.auth.onAuthStateChange() events could be insecure! This value comes directly from the storage medium (usually cookies on the server) and may not be authentic. Use supabase.auth.getUser() instead which authenticates the data by contacting the Supabase Auth server."),s=!0,this.suppressGetSessionWarning=!0),Reflect.get(u,l,c))})}return{data:{session:e},error:null}}let{session:i,error:o}=await this._callRefreshToken(e.refresh_token);return o?{data:{session:null},error:o}:{data:{session:i},error:null}}finally{this._debug("#__loadSession()","end")}}async getUser(e){return e?await this._getUser(e):(await this.initializePromise,await this._acquireLock(-1,async()=>await this._getUser()))}async _getUser(e){try{return e?await(0,se._request)(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:e,xform:se._userResponse}):await this._useSession(async r=>{var n,i,o;let{data:s,error:a}=r;if(a)throw a;return!(!((n=s.session)===null||n===void 0)&&n.access_token)&&!this.hasCustomAuthorizationHeader?{data:{user:null},error:new X.AuthSessionMissingError}:await(0,se._request)(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:(o=(i=s.session)===null||i===void 0?void 0:i.access_token)!==null&&o!==void 0?o:void 0,xform:se._userResponse})})}catch(r){if((0,X.isAuthError)(r))return(0,X.isAuthSessionMissingError)(r)&&(await this._removeSession(),await(0,me.removeItemAsync)(this.storage,`${this.storageKey}-code-verifier`)),{data:{user:null},error:r};throw r}}async updateUser(e,r={}){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._updateUser(e,r))}async _updateUser(e,r={}){try{return await this._useSession(async n=>{let{data:i,error:o}=n;if(o)throw o;if(!i.session)throw new X.AuthSessionMissingError;let s=i.session,a=null,u=null;this.flowType==="pkce"&&e.email!=null&&([a,u]=await(0,me.getCodeChallengeAndMethod)(this.storage,this.storageKey));let{data:l,error:c}=await(0,se._request)(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:r?.emailRedirectTo,body:Object.assign(Object.assign({},e),{code_challenge:a,code_challenge_method:u}),jwt:s.access_token,xform:se._userResponse});if(c)throw c;return s.user=l.user,await this._saveSession(s),await this._notifyAllSubscribers("USER_UPDATED",s),{data:{user:s.user},error:null}})}catch(n){if((0,X.isAuthError)(n))return{data:{user:null},error:n};throw n}}_decodeJWT(e){return(0,me.decodeJWTPayload)(e)}async setSession(e){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._setSession(e))}async _setSession(e){try{if(!e.access_token||!e.refresh_token)throw new X.AuthSessionMissingError;let r=Date.now()/1e3,n=r,i=!0,o=null,s=(0,me.decodeJWTPayload)(e.access_token);if(s.exp&&(n=s.exp,i=n<=r),i){let{session:a,error:u}=await this._callRefreshToken(e.refresh_token);if(u)return{data:{user:null,session:null},error:u};if(!a)return{data:{user:null,session:null},error:null};o=a}else{let{data:a,error:u}=await this._getUser(e.access_token);if(u)throw u;o={access_token:e.access_token,refresh_token:e.refresh_token,user:a.user,token_type:"bearer",expires_in:n-r,expires_at:n},await this._saveSession(o),await this._notifyAllSubscribers("SIGNED_IN",o)}return{data:{user:o.user,session:o},error:null}}catch(r){if((0,X.isAuthError)(r))return{data:{session:null,user:null},error:r};throw r}}async refreshSession(e){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._refreshSession(e))}async _refreshSession(e){try{return await this._useSession(async r=>{var n;if(!e){let{data:s,error:a}=r;if(a)throw a;e=(n=s.session)!==null&&n!==void 0?n:void 0}if(!e?.refresh_token)throw new X.AuthSessionMissingError;let{session:i,error:o}=await this._callRefreshToken(e.refresh_token);return o?{data:{user:null,session:null},error:o}:i?{data:{user:i.user,session:i},error:null}:{data:{user:null,session:null},error:null}})}catch(r){if((0,X.isAuthError)(r))return{data:{user:null,session:null},error:r};throw r}}async _getSessionFromURL(e,r){try{if(!(0,me.isBrowser)())throw new X.AuthImplicitGrantRedirectError("No browser detected.");if(e.error||e.error_description||e.error_code)throw new X.AuthImplicitGrantRedirectError(e.error_description||"Error in URL with unspecified error_description",{error:e.error||"unspecified_error",code:e.error_code||"unspecified_code"});switch(r){case"implicit":if(this.flowType==="pkce")throw new X.AuthPKCEGrantCodeExchangeError("Not a valid PKCE flow url.");break;case"pkce":if(this.flowType==="implicit")throw new X.AuthImplicitGrantRedirectError("Not a valid implicit grant flow url.");break;default:}if(r==="pkce"){if(this._debug("#_initialize()","begin","is PKCE flow",!0),!e.code)throw new X.AuthPKCEGrantCodeExchangeError("No code detected.");let{data:F,error:g}=await this._exchangeCodeForSession(e.code);if(g)throw g;let C=new URL(window.location.href);return C.searchParams.delete("code"),window.history.replaceState(window.history.state,"",C.toString()),{data:{session:F.session,redirectType:null},error:null}}let{provider_token:n,provider_refresh_token:i,access_token:o,refresh_token:s,expires_in:a,expires_at:u,token_type:l}=e;if(!o||!a||!s||!l)throw new X.AuthImplicitGrantRedirectError("No session defined in URL");let c=Math.round(Date.now()/1e3),f=parseInt(a),h=c+f;u&&(h=parseInt(u));let d=h-c;d*1e3<=Ya&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${d}s, should have been closer to ${f}s`);let m=h-f;c-m>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",m,h,c):c-m<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew",m,h,c);let{data:b,error:D}=await this._getUser(o);if(D)throw D;let _={provider_token:n,provider_refresh_token:i,access_token:o,expires_in:f,expires_at:h,refresh_token:s,token_type:l,user:b.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),{data:{session:_,redirectType:e.type},error:null}}catch(n){if((0,X.isAuthError)(n))return{data:{session:null,redirectType:null},error:n};throw n}}_isImplicitGrantCallback(e){return!!(e.access_token||e.error_description)}async _isPKCECallback(e){let r=await(0,me.getItemAsync)(this.storage,`${this.storageKey}-code-verifier`);return!!(e.code&&r)}async signOut(e={scope:"global"}){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._signOut(e))}async _signOut({scope:e}={scope:"global"}){return await this._useSession(async r=>{var n;let{data:i,error:o}=r;if(o)return{error:o};let s=(n=i.session)===null||n===void 0?void 0:n.access_token;if(s){let{error:a}=await this.admin.signOut(s,e);if(a&&!((0,X.isAuthApiError)(a)&&(a.status===404||a.status===401||a.status===403)))return{error:a}}return e!=="others"&&(await this._removeSession(),await(0,me.removeItemAsync)(this.storage,`${this.storageKey}-code-verifier`)),{error:null}})}onAuthStateChange(e){let r=(0,me.uuid)(),n={id:r,callback:e,unsubscribe:()=>{this._debug("#unsubscribe()","state change callback with id removed",r),this.stateChangeEmitters.delete(r)}};return this._debug("#onAuthStateChange()","registered callback with id",r),this.stateChangeEmitters.set(r,n),(async()=>(await this.initializePromise,await this._acquireLock(-1,async()=>{this._emitInitialSession(r)})))(),{data:{subscription:n}}}async _emitInitialSession(e){return await this._useSession(async r=>{var n,i;try{let{data:{session:o},error:s}=r;if(s)throw s;await((n=this.stateChangeEmitters.get(e))===null||n===void 0?void 0:n.callback("INITIAL_SESSION",o)),this._debug("INITIAL_SESSION","callback id",e,"session",o)}catch(o){await((i=this.stateChangeEmitters.get(e))===null||i===void 0?void 0:i.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",e,"error",o),console.error(o)}})}async resetPasswordForEmail(e,r={}){let n=null,i=null;this.flowType==="pkce"&&([n,i]=await(0,me.getCodeChallengeAndMethod)(this.storage,this.storageKey,!0));try{return await(0,se._request)(this.fetch,"POST",`${this.url}/recover`,{body:{email:e,code_challenge:n,code_challenge_method:i,gotrue_meta_security:{captcha_token:r.captchaToken}},headers:this.headers,redirectTo:r.redirectTo})}catch(o){if((0,X.isAuthError)(o))return{data:null,error:o};throw o}}async getUserIdentities(){var e;try{let{data:r,error:n}=await this.getUser();if(n)throw n;return{data:{identities:(e=r.user.identities)!==null&&e!==void 0?e:[]},error:null}}catch(r){if((0,X.isAuthError)(r))return{data:null,error:r};throw r}}async linkIdentity(e){var r;try{let{data:n,error:i}=await this._useSession(async o=>{var s,a,u,l,c;let{data:f,error:h}=o;if(h)throw h;let d=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,e.provider,{redirectTo:(s=e.options)===null||s===void 0?void 0:s.redirectTo,scopes:(a=e.options)===null||a===void 0?void 0:a.scopes,queryParams:(u=e.options)===null||u===void 0?void 0:u.queryParams,skipBrowserRedirect:!0});return await(0,se._request)(this.fetch,"GET",d,{headers:this.headers,jwt:(c=(l=f.session)===null||l===void 0?void 0:l.access_token)!==null&&c!==void 0?c:void 0})});if(i)throw i;return(0,me.isBrowser)()&&!(!((r=e.options)===null||r===void 0)&&r.skipBrowserRedirect)&&window.location.assign(n?.url),{data:{provider:e.provider,url:n?.url},error:null}}catch(n){if((0,X.isAuthError)(n))return{data:{provider:e.provider,url:null},error:n};throw n}}async unlinkIdentity(e){try{return await this._useSession(async r=>{var n,i;let{data:o,error:s}=r;if(s)throw s;return await(0,se._request)(this.fetch,"DELETE",`${this.url}/user/identities/${e.identity_id}`,{headers:this.headers,jwt:(i=(n=o.session)===null||n===void 0?void 0:n.access_token)!==null&&i!==void 0?i:void 0})})}catch(r){if((0,X.isAuthError)(r))return{data:null,error:r};throw r}}async _refreshAccessToken(e){let r=`#_refreshAccessToken(${e.substring(0,5)}...)`;this._debug(r,"begin");try{let n=Date.now();return await(0,me.retryable)(async i=>(i>0&&await(0,me.sleep)(200*Math.pow(2,i-1)),this._debug(r,"refreshing attempt",i),await(0,se._request)(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:e},headers:this.headers,xform:se._sessionResponse})),(i,o)=>{let s=200*Math.pow(2,i);return o&&(0,X.isAuthRetryableFetchError)(o)&&Date.now()+s-n<Ya})}catch(n){if(this._debug(r,"error",n),(0,X.isAuthError)(n))return{data:{session:null,user:null},error:n};throw n}finally{this._debug(r,"end")}}_isValidSession(e){return typeof e=="object"&&e!==null&&"access_token"in e&&"refresh_token"in e&&"expires_at"in e}async _handleProviderSignIn(e,r){let n=await this._getUrlForProvider(`${this.url}/authorize`,e,{redirectTo:r.redirectTo,scopes:r.scopes,queryParams:r.queryParams});return this._debug("#_handleProviderSignIn()","provider",e,"options",r,"url",n),(0,me.isBrowser)()&&!r.skipBrowserRedirect&&window.location.assign(n),{data:{provider:e,url:n},error:null}}async _recoverAndRefresh(){var e;let r="#_recoverAndRefresh()";this._debug(r,"begin");try{let n=await(0,me.getItemAsync)(this.storage,this.storageKey);if(this._debug(r,"session from storage",n),!this._isValidSession(n)){this._debug(r,"session is not valid"),n!==null&&await this._removeSession();return}let i=Math.round(Date.now()/1e3),o=((e=n.expires_at)!==null&&e!==void 0?e:1/0)<i+Ja.EXPIRY_MARGIN;if(this._debug(r,`session has${o?"":" not"} expired with margin of ${Ja.EXPIRY_MARGIN}s`),o){if(this.autoRefreshToken&&n.refresh_token){let{error:s}=await this._callRefreshToken(n.refresh_token);s&&(console.error(s),(0,X.isAuthRetryableFetchError)(s)||(this._debug(r,"refresh failed with a non-retryable error, removing the session",s),await this._removeSession()))}}else await this._notifyAllSubscribers("SIGNED_IN",n)}catch(n){this._debug(r,"error",n),console.error(n);return}finally{this._debug(r,"end")}}async _callRefreshToken(e){var r,n;if(!e)throw new X.AuthSessionMissingError;if(this.refreshingDeferred)return this.refreshingDeferred.promise;let i=`#_callRefreshToken(${e.substring(0,5)}...)`;this._debug(i,"begin");try{this.refreshingDeferred=new me.Deferred;let{data:o,error:s}=await this._refreshAccessToken(e);if(s)throw s;if(!o.session)throw new X.AuthSessionMissingError;await this._saveSession(o.session),await this._notifyAllSubscribers("TOKEN_REFRESHED",o.session);let a={session:o.session,error:null};return this.refreshingDeferred.resolve(a),a}catch(o){if(this._debug(i,"error",o),(0,X.isAuthError)(o)){let s={session:null,error:o};return(0,X.isAuthRetryableFetchError)(o)||await this._removeSession(),(r=this.refreshingDeferred)===null||r===void 0||r.resolve(s),s}throw(n=this.refreshingDeferred)===null||n===void 0||n.reject(o),o}finally{this.refreshingDeferred=null,this._debug(i,"end")}}async _notifyAllSubscribers(e,r,n=!0){let i=`#_notifyAllSubscribers(${e})`;this._debug(i,"begin",r,`broadcast = ${n}`);try{this.broadcastChannel&&n&&this.broadcastChannel.postMessage({event:e,session:r});let o=[],s=Array.from(this.stateChangeEmitters.values()).map(async a=>{try{await a.callback(e,r)}catch(u){o.push(u)}});if(await Promise.all(s),o.length>0){for(let a=0;a<o.length;a+=1)console.error(o[a]);throw o[0]}}finally{this._debug(i,"end")}}async _saveSession(e){this._debug("#_saveSession()",e),this.suppressGetSessionWarning=!0,await(0,me.setItemAsync)(this.storage,this.storageKey,e)}async _removeSession(){this._debug("#_removeSession()"),await(0,me.removeItemAsync)(this.storage,this.storageKey),await this._notifyAllSubscribers("SIGNED_OUT",null)}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()");let e=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{e&&(0,me.isBrowser)()&&window?.removeEventListener&&window.removeEventListener("visibilitychange",e)}catch(r){console.error("removing visibilitychange callback failed",r)}}async _startAutoRefresh(){await this._stopAutoRefresh(),this._debug("#_startAutoRefresh()");let e=setInterval(()=>this._autoRefreshTokenTick(),Ya);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)/Ya);this._debug("#_autoRefreshTokenTick()",`access token expires in ${i} ticks, a tick lasts ${Ya}ms, refresh threshold is ${Jw} ticks`),i<=Jw&&await this._callRefreshToken(n.refresh_token)})}catch(r){console.error("Auto refresh tick failed with error. This is likely a transient error.",r)}}finally{this._debug("#_autoRefreshTokenTick()","end")}})}catch(e){if(e.isAcquireTimeout||e instanceof Yw.LockAcquireTimeoutError)this._debug("auto refresh token tick lock not available");else throw e}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!(0,me.isBrowser)()||!window?.addEventListener)return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>await this._onVisibilityChanged(!1),window?.addEventListener("visibilitychange",this.visibilityChangedCallback),await this._onVisibilityChanged(!0)}catch(e){console.error("_handleVisibilityChange",e)}}async _onVisibilityChanged(e){let r=`#_onVisibilityChanged(${e})`;this._debug(r,"visibilityState",document.visibilityState),document.visibilityState==="visible"?(this.autoRefreshToken&&this._startAutoRefresh(),e||(await this.initializePromise,await this._acquireLock(-1,async()=>{if(document.visibilityState!=="visible"){this._debug(r,"acquired the lock to recover the session, but the browser visibilityState is no longer visible, aborting");return}await this._recoverAndRefresh()}))):document.visibilityState==="hidden"&&this.autoRefreshToken&&this._stopAutoRefresh()}async _getUrlForProvider(e,r,n){let i=[`provider=${encodeURIComponent(r)}`];if(n?.redirectTo&&i.push(`redirect_to=${encodeURIComponent(n.redirectTo)}`),n?.scopes&&i.push(`scopes=${encodeURIComponent(n.scopes)}`),this.flowType==="pkce"){let[o,s]=await(0,me.getCodeChallengeAndMethod)(this.storage,this.storageKey),a=new URLSearchParams({code_challenge:`${encodeURIComponent(o)}`,code_challenge_method:`${encodeURIComponent(s)}`});i.push(a.toString())}if(n?.queryParams){let o=new URLSearchParams(n.queryParams);i.push(o.toString())}return n?.skipBrowserRedirect&&i.push(`skip_http_redirect=${n.skipBrowserRedirect}`),`${e}?${i.join("&")}`}async _unenroll(e){try{return await this._useSession(async r=>{var n;let{data:i,error:o}=r;return o?{data:null,error:o}:await(0,se._request)(this.fetch,"DELETE",`${this.url}/factors/${e.factorId}`,{headers:this.headers,jwt:(n=i?.session)===null||n===void 0?void 0:n.access_token})})}catch(r){if((0,X.isAuthError)(r))return{data:null,error:r};throw r}}async _enroll(e){try{return await this._useSession(async r=>{var n,i;let{data:o,error:s}=r;if(s)return{data:null,error:s};let a=Object.assign({friendly_name:e.friendlyName,factor_type:e.factorType},e.factorType==="phone"?{phone:e.phone}:{issuer:e.issuer}),{data:u,error:l}=await(0,se._request)(this.fetch,"POST",`${this.url}/factors`,{body:a,headers:this.headers,jwt:(n=o?.session)===null||n===void 0?void 0:n.access_token});return l?{data:null,error:l}:(e.factorType==="totp"&&(!((i=u?.totp)===null||i===void 0)&&i.qr_code)&&(u.totp.qr_code=`data:image/svg+xml;utf-8,${u.totp.qr_code}`),{data:u,error:null})})}catch(r){if((0,X.isAuthError)(r))return{data:null,error:r};throw r}}async _verify(e){return this._acquireLock(-1,async()=>{try{return await this._useSession(async r=>{var n;let{data:i,error:o}=r;if(o)return{data:null,error:o};let{data:s,error:a}=await(0,se._request)(this.fetch,"POST",`${this.url}/factors/${e.factorId}/verify`,{body:{code:e.code,challenge_id:e.challengeId},headers:this.headers,jwt:(n=i?.session)===null||n===void 0?void 0:n.access_token});return a?{data:null,error:a}:(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+s.expires_in},s)),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",s),{data:s,error:a})})}catch(r){if((0,X.isAuthError)(r))return{data:null,error:r};throw r}})}async _challenge(e){return this._acquireLock(-1,async()=>{try{return await this._useSession(async r=>{var n;let{data:i,error:o}=r;return o?{data:null,error:o}:await(0,se._request)(this.fetch,"POST",`${this.url}/factors/${e.factorId}/challenge`,{body:{channel:e.channel},headers:this.headers,jwt:(n=i?.session)===null||n===void 0?void 0:n.access_token})})}catch(r){if((0,X.isAuthError)(r))return{data:null,error:r};throw r}})}async _challengeAndVerify(e){let{data:r,error:n}=await this._challenge({factorId:e.factorId});return n?{data:null,error:n}:await this._verify({factorId:e.factorId,challengeId:r.id,code:e.code})}async _listFactors(){let{data:{user:e},error:r}=await this.getUser();if(r)return{data:null,error:r};let n=e?.factors||[],i=n.filter(s=>s.factor_type==="totp"&&s.status==="verified"),o=n.filter(s=>s.factor_type==="phone"&&s.status==="verified");return{data:{all:n,totp:i,phone:o},error:null}}async _getAuthenticatorAssuranceLevel(){return this._acquireLock(-1,async()=>await this._useSession(async e=>{var r,n;let{data:{session:i},error:o}=e;if(o)return{data:null,error:o};if(!i)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};let s=this._decodeJWT(i.access_token),a=null;s.aal&&(a=s.aal);let u=a;((n=(r=i.user.factors)===null||r===void 0?void 0:r.filter(f=>f.status==="verified"))!==null&&n!==void 0?n:[]).length>0&&(u="aal2");let c=s.amr||[];return{data:{currentLevel:a,nextLevel:u,currentAuthenticationMethods:c},error:null}}))}};Xa.default=bc;bc.nextInstanceID=0});var Zw=y(Za=>{"use strict";var ZB=Za&&Za.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Za,"__esModule",{value:!0});var QB=ZB(gc()),eq=QB.default;Za.default=eq});var Qw=y(Qa=>{"use strict";var tq=Qa&&Qa.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Qa,"__esModule",{value:!0});var rq=tq(bm()),nq=rq.default;Qa.default=nq});var t_=y(e_=>{"use strict";Object.defineProperty(e_,"__esModule",{value:!0})});var _m=y(Le=>{"use strict";var iq=Le&&Le.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),r_=Le&&Le.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&iq(e,t,r)},wc=Le&&Le.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Le,"__esModule",{value:!0});Le.lockInternals=Le.NavigatorLockAcquireTimeoutError=Le.navigatorLock=Le.AuthClient=Le.AuthAdminApi=Le.GoTrueClient=Le.GoTrueAdminApi=void 0;var oq=wc(gc());Le.GoTrueAdminApi=oq.default;var sq=wc(bm());Le.GoTrueClient=sq.default;var aq=wc(Zw());Le.AuthAdminApi=aq.default;var uq=wc(Qw());Le.AuthClient=uq.default;r_(t_(),Le);r_(Ga(),Le);var wm=Dm();Object.defineProperty(Le,"navigatorLock",{enumerable:!0,get:function(){return wm.navigatorLock}});Object.defineProperty(Le,"NavigatorLockAcquireTimeoutError",{enumerable:!0,get:function(){return wm.NavigatorLockAcquireTimeoutError}});Object.defineProperty(Le,"lockInternals",{enumerable:!0,get:function(){return wm.internals}})});var n_=y(_c=>{"use strict";Object.defineProperty(_c,"__esModule",{value:!0});_c.SupabaseAuthClient=void 0;var lq=_m(),Em=class extends lq.AuthClient{constructor(e){super(e)}};_c.SupabaseAuthClient=Em});var Sm=y(eu=>{"use strict";var cq=eu&&eu.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(c){try{l(n.next(c))}catch(f){s(f)}}function u(c){try{l(n.throw(c))}catch(f){s(f)}}function l(c){c.done?o(c.value):i(c.value).then(a,u)}l((n=n.apply(t,e||[])).next())})};Object.defineProperty(eu,"__esModule",{value:!0});var fq=Rp(),dq=zp(),hq=(Kp(),je(Wp)),pq=jw(),Ec=Lw(),mq=qw(),i_=Mw(),gq=n_(),Cm=class{constructor(e,r,n){var i,o,s;if(this.supabaseUrl=e,this.supabaseKey=r,!e)throw new Error("supabaseUrl is required.");if(!r)throw new Error("supabaseKey is required.");let a=(0,i_.stripTrailingSlash)(e);this.realtimeUrl=`${a}/realtime/v1`.replace(/^http/i,"ws"),this.authUrl=`${a}/auth/v1`,this.storageUrl=`${a}/storage/v1`,this.functionsUrl=`${a}/functions/v1`;let u=`sb-${new URL(this.authUrl).hostname.split(".")[0]}-auth-token`,l={db:Ec.DEFAULT_DB_OPTIONS,realtime:Ec.DEFAULT_REALTIME_OPTIONS,auth:Object.assign(Object.assign({},Ec.DEFAULT_AUTH_OPTIONS),{storageKey:u}),global:Ec.DEFAULT_GLOBAL_OPTIONS},c=(0,i_.applySettingDefaults)(n??{},l);this.storageKey=(i=c.auth.storageKey)!==null&&i!==void 0?i:"",this.headers=(o=c.global.headers)!==null&&o!==void 0?o:{},c.accessToken?(this.accessToken=c.accessToken,this.auth=new Proxy({},{get:(f,h)=>{throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(h)} is not possible`)}})):this.auth=this._initSupabaseAuthClient((s=c.auth)!==null&&s!==void 0?s:{},this.headers,c.global.fetch),this.fetch=(0,mq.fetchWithAuth)(r,this._getAccessToken.bind(this),c.global.fetch),this.realtime=this._initRealtimeClient(Object.assign({headers:this.headers,accessToken:this._getAccessToken.bind(this)},c.realtime)),this.rest=new dq.PostgrestClient(`${a}/rest/v1`,{headers:this.headers,schema:c.db.schema,fetch:this.fetch}),c.accessToken||this._listenForAuthEvents()}get functions(){return new fq.FunctionsClient(this.functionsUrl,{headers:this.headers,customFetch:this.fetch})}get storage(){return new pq.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 cq(this,void 0,void 0,function*(){if(this.accessToken)return yield this.accessToken();let{data:n}=yield this.auth.getSession();return(r=(e=n.session)===null||e===void 0?void 0:e.access_token)!==null&&r!==void 0?r:null})}_initSupabaseAuthClient({autoRefreshToken:e,persistSession:r,detectSessionInUrl:n,storage:i,storageKey:o,flowType:s,lock:a,debug:u},l,c){let f={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new gq.SupabaseAuthClient({url:this.authUrl,headers:Object.assign(Object.assign({},f),l),storageKey:o,autoRefreshToken:e,persistSession:r,detectSessionInUrl:n,storage:i,flowType:s,lock:a,debug:u,fetch:c,hasCustomAuthorizationHeader:"Authorization"in this.headers})}_initRealtimeClient(e){return new hq.RealtimeClient(this.realtimeUrl,Object.assign(Object.assign({},e),{params:Object.assign({apikey:this.supabaseKey},e?.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((r,n)=>{this._handleTokenChanged(r,"CLIENT",n?.access_token)})}_handleTokenChanged(e,r,n){(e==="TOKEN_REFRESHED"||e==="SIGNED_IN")&&this.changedAccessToken!==n?this.changedAccessToken=n:e==="SIGNED_OUT"&&(this.realtime.setAuth(),r=="STORAGE"&&this.auth.signOut(),this.changedAccessToken=void 0)}};eu.default=Cm});var a_=y(Se=>{"use strict";var yq=Se&&Se.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),o_=Se&&Se.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&yq(e,t,r)},s_=Se&&Se.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Se,"__esModule",{value:!0});Se.createClient=Se.SupabaseClient=Se.FunctionRegion=Se.FunctionsError=Se.FunctionsRelayError=Se.FunctionsFetchError=Se.FunctionsHttpError=Se.PostgrestError=void 0;var Dq=s_(Sm());o_(_m(),Se);var vq=zp();Object.defineProperty(Se,"PostgrestError",{enumerable:!0,get:function(){return vq.PostgrestError}});var tu=Rp();Object.defineProperty(Se,"FunctionsHttpError",{enumerable:!0,get:function(){return tu.FunctionsHttpError}});Object.defineProperty(Se,"FunctionsFetchError",{enumerable:!0,get:function(){return tu.FunctionsFetchError}});Object.defineProperty(Se,"FunctionsRelayError",{enumerable:!0,get:function(){return tu.FunctionsRelayError}});Object.defineProperty(Se,"FunctionsError",{enumerable:!0,get:function(){return tu.FunctionsError}});Object.defineProperty(Se,"FunctionRegion",{enumerable:!0,get:function(){return tu.FunctionRegion}});o_((Kp(),je(Wp)),Se);var bq=Sm();Object.defineProperty(Se,"SupabaseClient",{enumerable:!0,get:function(){return s_(bq).default}});var wq=(t,e,r)=>new Dq.default(t,e,r);Se.createClient=wq});var xm=y(($ae,u_)=>{u_.exports=require("stream")});var p_=y((Iae,h_)=>{"use strict";function l_(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function c_(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?l_(Object(r),!0).forEach(function(n){_q(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):l_(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function _q(t,e,r){return e=d_(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Eq(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function f_(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,d_(n.key),n)}}function Cq(t,e,r){return e&&f_(t.prototype,e),r&&f_(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function d_(t){var e=Sq(t,"string");return typeof e=="symbol"?e:String(e)}function Sq(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 xq=require("buffer"),Cc=xq.Buffer,Fq=require("util"),Fm=Fq.inspect,Oq=Fm&&Fm.custom||"inspect";function Aq(t,e,r){Cc.prototype.copy.call(t,e,r)}h_.exports=function(){function t(){Eq(this,t),this.head=null,this.tail=null,this.length=0}return Cq(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 Cc.alloc(0);for(var n=Cc.allocUnsafe(r>>>0),i=this.head,o=0;i;)Aq(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=Cc.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:Oq,value:function(r,n){return Fm(this,c_(c_({},n),{},{depth:0,customInspect:!1}))}}]),t}()});var Am=y((jae,g_)=>{"use strict";function kq(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(Om,this,t)):process.nextTick(Om,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(Sc,r):(r._writableState.errorEmitted=!0,process.nextTick(m_,r,o)):process.nextTick(m_,r,o):e?(process.nextTick(Sc,r),e(o)):process.nextTick(Sc,r)}),this)}function m_(t,e){Om(t,e),Sc(t)}function Sc(t){t._writableState&&!t._writableState.emitClose||t._readableState&&!t._readableState.emitClose||t.emit("close")}function Tq(){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 Om(t,e){t.emit("error",e)}function Pq(t,e){var r=t._readableState,n=t._writableState;r&&r.autoDestroy||n&&n.autoDestroy?t.destroy(e):t.emit("error",e)}g_.exports={destroy:kq,undestroy:Tq,errorOrDestroy:Pq}});var Mn=y((Nae,v_)=>{"use strict";var D_={};function dr(t,e,r){r||(r=Error);function n(o,s,a){return typeof e=="string"?e:e(o,s,a)}class i extends r{constructor(s,a,u){super(n(s,a,u))}}i.prototype.name=r.name,i.prototype.code=t,D_[t]=i}function y_(t,e){if(Array.isArray(t)){let r=t.length;return t=t.map(n=>String(n)),r>2?`one of ${e} ${t.slice(0,r-1).join(", ")}, or `+t[r-1]:r===2?`one of ${e} ${t[0]} or ${t[1]}`:`of ${e} ${t[0]}`}else return`of ${e} ${String(t)}`}function Rq(t,e,r){return t.substr(!r||r<0?0:+r,e.length)===e}function $q(t,e,r){return(r===void 0||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}function Iq(t,e,r){return typeof r!="number"&&(r=0),r+e.length>t.length?!1:t.indexOf(e,r)!==-1}dr("ERR_INVALID_OPT_VALUE",function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'},TypeError);dr("ERR_INVALID_ARG_TYPE",function(t,e,r){let n;typeof e=="string"&&Rq(e,"not ")?(n="must not be",e=e.replace(/^not /,"")):n="must be";let i;if($q(t," argument"))i=`The ${t} ${n} ${y_(e,"type")}`;else{let o=Iq(t,".")?"property":"argument";i=`The "${t}" ${o} ${n} ${y_(e,"type")}`}return i+=`. Received type ${typeof r}`,i},TypeError);dr("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");dr("ERR_METHOD_NOT_IMPLEMENTED",function(t){return"The "+t+" method is not implemented"});dr("ERR_STREAM_PREMATURE_CLOSE","Premature close");dr("ERR_STREAM_DESTROYED",function(t){return"Cannot call "+t+" after a stream was destroyed"});dr("ERR_MULTIPLE_CALLBACK","Callback called multiple times");dr("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");dr("ERR_STREAM_WRITE_AFTER_END","write after end");dr("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);dr("ERR_UNKNOWN_ENCODING",function(t){return"Unknown encoding: "+t},TypeError);dr("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");v_.exports.codes=D_});var km=y((Lae,b_)=>{"use strict";var jq=Mn().codes.ERR_INVALID_OPT_VALUE;function Nq(t,e,r){return t.highWaterMark!=null?t.highWaterMark:e?t[r]:null}function Lq(t,e,r,n){var i=Nq(e,n,r);if(i!=null){if(!(isFinite(i)&&Math.floor(i)===i)||i<0){var o=n?r:"highWaterMark";throw new jq(o,i)}return Math.floor(i)}return t.objectMode?16:16*1024}b_.exports={getHighWaterMark:Lq}});var w_=y((Bae,Tm)=>{typeof Object.create=="function"?Tm.exports=function(e,r){r&&(e.super_=r,e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:Tm.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 Wo=y((qae,Rm)=>{try{if(Pm=require("util"),typeof Pm.inherits!="function")throw"";Rm.exports=Pm.inherits}catch{Rm.exports=w_()}var Pm});var E_=y((Mae,__)=>{__.exports=require("util").deprecate});var jm=y((Uae,A_)=>{"use strict";A_.exports=Ye;function S_(t){var e=this;this.next=null,this.entry=null,this.finish=function(){fM(e,t)}}var Ko;Ye.WritableState=nu;var Bq={deprecate:E_()},x_=xm(),Fc=require("buffer").Buffer,qq=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function Mq(t){return Fc.from(t)}function Uq(t){return Fc.isBuffer(t)||t instanceof qq}var Im=Am(),Hq=km(),Vq=Hq.getHighWaterMark,Un=Mn().codes,zq=Un.ERR_INVALID_ARG_TYPE,Gq=Un.ERR_METHOD_NOT_IMPLEMENTED,Wq=Un.ERR_MULTIPLE_CALLBACK,Kq=Un.ERR_STREAM_CANNOT_PIPE,Yq=Un.ERR_STREAM_DESTROYED,Jq=Un.ERR_STREAM_NULL_VALUES,Xq=Un.ERR_STREAM_WRITE_AFTER_END,Zq=Un.ERR_UNKNOWN_ENCODING,Yo=Im.errorOrDestroy;Wo()(Ye,x_);function Qq(){}function nu(t,e,r){Ko=Ko||Ci(),t=t||{},typeof r!="boolean"&&(r=e instanceof Ko),this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=Vq(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){sM(e,i)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=t.emitClose!==!1,this.autoDestroy=!!t.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new S_(this)}nu.prototype.getBuffer=function(){for(var e=this.bufferedRequest,r=[];e;)r.push(e),e=e.next;return r};(function(){try{Object.defineProperty(nu.prototype,"buffer",{get:Bq.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var xc;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(xc=Function.prototype[Symbol.hasInstance],Object.defineProperty(Ye,Symbol.hasInstance,{value:function(e){return xc.call(this,e)?!0:this!==Ye?!1:e&&e._writableState instanceof nu}})):xc=function(e){return e instanceof this};function Ye(t){Ko=Ko||Ci();var e=this instanceof Ko;if(!e&&!xc.call(Ye,this))return new Ye(t);this._writableState=new nu(t,this,e),this.writable=!0,t&&(typeof t.write=="function"&&(this._write=t.write),typeof t.writev=="function"&&(this._writev=t.writev),typeof t.destroy=="function"&&(this._destroy=t.destroy),typeof t.final=="function"&&(this._final=t.final)),x_.call(this)}Ye.prototype.pipe=function(){Yo(this,new Kq)};function eM(t,e){var r=new Xq;Yo(t,r),process.nextTick(e,r)}function tM(t,e,r,n){var i;return r===null?i=new Jq:typeof r!="string"&&!e.objectMode&&(i=new zq("chunk",["string","Buffer"],r)),i?(Yo(t,i),process.nextTick(n,i),!1):!0}Ye.prototype.write=function(t,e,r){var n=this._writableState,i=!1,o=!n.objectMode&&Uq(t);return o&&!Fc.isBuffer(t)&&(t=Mq(t)),typeof e=="function"&&(r=e,e=null),o?e="buffer":e||(e=n.defaultEncoding),typeof r!="function"&&(r=Qq),n.ending?eM(this,r):(o||tM(this,n,t,r))&&(n.pendingcb++,i=nM(this,n,o,t,e,r)),i};Ye.prototype.cork=function(){this._writableState.corked++};Ye.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,!t.writing&&!t.corked&&!t.bufferProcessing&&t.bufferedRequest&&F_(this,t))};Ye.prototype.setDefaultEncoding=function(e){if(typeof e=="string"&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new Zq(e);return this._writableState.defaultEncoding=e,this};Object.defineProperty(Ye.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function rM(t,e,r){return!t.objectMode&&t.decodeStrings!==!1&&typeof e=="string"&&(e=Fc.from(e,r)),e}Object.defineProperty(Ye.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function nM(t,e,r,n,i,o){if(!r){var s=rM(e,n,i);n!==s&&(r=!0,i="buffer",n=s)}var a=e.objectMode?1:n.length;e.length+=a;var u=e.length<e.highWaterMark;if(u||(e.needDrain=!0),e.writing||e.corked){var l=e.lastBufferedRequest;e.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:o,next:null},l?l.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1}else $m(t,e,!1,a,n,i,o);return u}function $m(t,e,r,n,i,o,s){e.writelen=n,e.writecb=s,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new Yq("write")):r?t._writev(i,e.onwrite):t._write(i,o,e.onwrite),e.sync=!1}function iM(t,e,r,n,i){--e.pendingcb,r?(process.nextTick(i,n),process.nextTick(ru,t,e),t._writableState.errorEmitted=!0,Yo(t,n)):(i(n),t._writableState.errorEmitted=!0,Yo(t,n),ru(t,e))}function oM(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}function sM(t,e){var r=t._writableState,n=r.sync,i=r.writecb;if(typeof i!="function")throw new Wq;if(oM(r),e)iM(t,r,n,e,i);else{var o=O_(r)||t.destroyed;!o&&!r.corked&&!r.bufferProcessing&&r.bufferedRequest&&F_(t,r),n?process.nextTick(C_,t,r,o,i):C_(t,r,o,i)}}function C_(t,e,r,n){r||aM(t,e),e.pendingcb--,n(),ru(t,e)}function aM(t,e){e.length===0&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}function F_(t,e){e.bufferProcessing=!0;var r=e.bufferedRequest;if(t._writev&&r&&r.next){var n=e.bufferedRequestCount,i=new Array(n),o=e.corkedRequestsFree;o.entry=r;for(var s=0,a=!0;r;)i[s]=r,r.isBuf||(a=!1),r=r.next,s+=1;i.allBuffers=a,$m(t,e,!0,e.length,i,"",o.finish),e.pendingcb++,e.lastBufferedRequest=null,o.next?(e.corkedRequestsFree=o.next,o.next=null):e.corkedRequestsFree=new S_(e),e.bufferedRequestCount=0}else{for(;r;){var u=r.chunk,l=r.encoding,c=r.callback,f=e.objectMode?1:u.length;if($m(t,e,!1,f,u,l,c),r=r.next,e.bufferedRequestCount--,e.writing)break}r===null&&(e.lastBufferedRequest=null)}e.bufferedRequest=r,e.bufferProcessing=!1}Ye.prototype._write=function(t,e,r){r(new Gq("_write()"))};Ye.prototype._writev=null;Ye.prototype.end=function(t,e,r){var n=this._writableState;return typeof t=="function"?(r=t,t=null,e=null):typeof e=="function"&&(r=e,e=null),t!=null&&this.write(t,e),n.corked&&(n.corked=1,this.uncork()),n.ending||cM(this,n,r),this};Object.defineProperty(Ye.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function O_(t){return t.ending&&t.length===0&&t.bufferedRequest===null&&!t.finished&&!t.writing}function uM(t,e){t._final(function(r){e.pendingcb--,r&&Yo(t,r),e.prefinished=!0,t.emit("prefinish"),ru(t,e)})}function lM(t,e){!e.prefinished&&!e.finalCalled&&(typeof t._final=="function"&&!e.destroyed?(e.pendingcb++,e.finalCalled=!0,process.nextTick(uM,t,e)):(e.prefinished=!0,t.emit("prefinish")))}function ru(t,e){var r=O_(e);if(r&&(lM(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 cM(t,e,r){e.ending=!0,ru(t,e),r&&(e.finished?process.nextTick(r):t.once("finish",r)),e.ended=!0,t.writable=!1}function fM(t,e,r){var n=t.entry;for(t.entry=null;n;){var i=n.callback;e.pendingcb--,i(r),n=n.next}e.corkedRequestsFree.next=t}Object.defineProperty(Ye.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}});Ye.prototype.destroy=Im.destroy;Ye.prototype._undestroy=Im.undestroy;Ye.prototype._destroy=function(t,e){e(t)}});var Ci=y((Hae,T_)=>{"use strict";var dM=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};T_.exports=Lr;var k_=Bm(),Lm=jm();Wo()(Lr,k_);for(Nm=dM(Lm.prototype),Oc=0;Oc<Nm.length;Oc++)Ac=Nm[Oc],Lr.prototype[Ac]||(Lr.prototype[Ac]=Lm.prototype[Ac]);var Nm,Ac,Oc;function Lr(t){if(!(this instanceof Lr))return new Lr(t);k_.call(this,t),Lm.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",hM)))}Object.defineProperty(Lr.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});Object.defineProperty(Lr.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});Object.defineProperty(Lr.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function hM(){this._writableState.ended||process.nextTick(pM,this)}function pM(t){t.end()}Object.defineProperty(Lr.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(e){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=e,this._writableState.destroyed=e)}})});var $_=y((qm,R_)=>{var kc=require("buffer"),Br=kc.Buffer;function P_(t,e){for(var r in t)e[r]=t[r]}Br.from&&Br.alloc&&Br.allocUnsafe&&Br.allocUnsafeSlow?R_.exports=kc:(P_(kc,qm),qm.Buffer=Si);function Si(t,e,r){return Br(t,e,r)}Si.prototype=Object.create(Br.prototype);P_(Br,Si);Si.from=function(t,e,r){if(typeof t=="number")throw new TypeError("Argument must not be a number");return Br(t,e,r)};Si.alloc=function(t,e,r){if(typeof t!="number")throw new TypeError("Argument must be a number");var n=Br(t);return e!==void 0?typeof r=="string"?n.fill(e,r):n.fill(e):n.fill(0),n};Si.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return Br(t)};Si.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return kc.SlowBuffer(t)}});var Hm=y(j_=>{"use strict";var Um=$_().Buffer,I_=Um.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 mM(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 gM(t){var e=mM(t);if(typeof e!="string"&&(Um.isEncoding===I_||!I_(t)))throw new Error("Unknown encoding: "+t);return e||t}j_.StringDecoder=iu;function iu(t){this.encoding=gM(t);var e;switch(this.encoding){case"utf16le":this.text=_M,this.end=EM,e=4;break;case"utf8":this.fillLast=vM,e=4;break;case"base64":this.text=CM,this.end=SM,e=3;break;default:this.write=xM,this.end=FM;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=Um.allocUnsafe(e)}iu.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||""};iu.prototype.end=wM;iu.prototype.text=bM;iu.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 Mm(t){return t<=127?0:t>>5===6?2:t>>4===14?3:t>>3===30?4:t>>6===2?-1:-2}function yM(t,e,r){var n=e.length-1;if(n<r)return 0;var i=Mm(e[n]);return i>=0?(i>0&&(t.lastNeed=i-1),i):--n<r||i===-2?0:(i=Mm(e[n]),i>=0?(i>0&&(t.lastNeed=i-2),i):--n<r||i===-2?0:(i=Mm(e[n]),i>=0?(i>0&&(i===2?i=0:t.lastNeed=i-3),i):0))}function DM(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 vM(t){var e=this.lastTotal-this.lastNeed,r=DM(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 bM(t,e){var r=yM(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 wM(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"\uFFFD":e}function _M(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 EM(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 CM(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 SM(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function xM(t){return t.toString(this.encoding)}function FM(t){return t&&t.length?this.write(t):""}});var Tc=y((zae,B_)=>{"use strict";var N_=Mn().codes.ERR_STREAM_PREMATURE_CLOSE;function OM(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 AM(){}function kM(t){return t.setHeader&&typeof t.abort=="function"}function L_(t,e,r){if(typeof e=="function")return L_(t,null,e);e||(e={}),r=OM(r||AM);var n=e.readable||e.readable!==!1&&t.readable,i=e.writable||e.writable!==!1&&t.writable,o=function(){t.writable||a()},s=t._writableState&&t._writableState.finished,a=function(){i=!1,s=!0,n||r.call(t)},u=t._readableState&&t._readableState.endEmitted,l=function(){n=!1,u=!0,i||r.call(t)},c=function(m){r.call(t,m)},f=function(){var m;if(n&&!u)return(!t._readableState||!t._readableState.ended)&&(m=new N_),r.call(t,m);if(i&&!s)return(!t._writableState||!t._writableState.ended)&&(m=new N_),r.call(t,m)},h=function(){t.req.on("finish",a)};return kM(t)?(t.on("complete",a),t.on("abort",f),t.req?h():t.on("request",h)):i&&!t._writableState&&(t.on("end",o),t.on("close",o)),t.on("end",l),t.on("finish",a),e.error!==!1&&t.on("error",c),t.on("close",f),function(){t.removeListener("complete",a),t.removeListener("abort",f),t.removeListener("request",h),t.req&&t.req.removeListener("finish",a),t.removeListener("end",o),t.removeListener("close",o),t.removeListener("finish",a),t.removeListener("end",l),t.removeListener("error",c),t.removeListener("close",f)}}B_.exports=L_});var M_=y((Gae,q_)=>{"use strict";var Pc;function Hn(t,e,r){return e=TM(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function TM(t){var e=PM(t,"string");return typeof e=="symbol"?e:String(e)}function PM(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 RM=Tc(),Vn=Symbol("lastResolve"),xi=Symbol("lastReject"),ou=Symbol("error"),Rc=Symbol("ended"),Fi=Symbol("lastPromise"),Vm=Symbol("handlePromise"),Oi=Symbol("stream");function zn(t,e){return{value:t,done:e}}function $M(t){var e=t[Vn];if(e!==null){var r=t[Oi].read();r!==null&&(t[Fi]=null,t[Vn]=null,t[xi]=null,e(zn(r,!1)))}}function IM(t){process.nextTick($M,t)}function jM(t,e){return function(r,n){t.then(function(){if(e[Rc]){r(zn(void 0,!0));return}e[Vm](r,n)},n)}}var NM=Object.getPrototypeOf(function(){}),LM=Object.setPrototypeOf((Pc={get stream(){return this[Oi]},next:function(){var e=this,r=this[ou];if(r!==null)return Promise.reject(r);if(this[Rc])return Promise.resolve(zn(void 0,!0));if(this[Oi].destroyed)return new Promise(function(s,a){process.nextTick(function(){e[ou]?a(e[ou]):s(zn(void 0,!0))})});var n=this[Fi],i;if(n)i=new Promise(jM(n,this));else{var o=this[Oi].read();if(o!==null)return Promise.resolve(zn(o,!1));i=new Promise(this[Vm])}return this[Fi]=i,i}},Hn(Pc,Symbol.asyncIterator,function(){return this}),Hn(Pc,"return",function(){var e=this;return new Promise(function(r,n){e[Oi].destroy(null,function(i){if(i){n(i);return}r(zn(void 0,!0))})})}),Pc),NM),BM=function(e){var r,n=Object.create(LM,(r={},Hn(r,Oi,{value:e,writable:!0}),Hn(r,Vn,{value:null,writable:!0}),Hn(r,xi,{value:null,writable:!0}),Hn(r,ou,{value:null,writable:!0}),Hn(r,Rc,{value:e._readableState.endEmitted,writable:!0}),Hn(r,Vm,{value:function(o,s){var a=n[Oi].read();a?(n[Fi]=null,n[Vn]=null,n[xi]=null,o(zn(a,!1))):(n[Vn]=o,n[xi]=s)},writable:!0}),r));return n[Fi]=null,RM(e,function(i){if(i&&i.code!=="ERR_STREAM_PREMATURE_CLOSE"){var o=n[xi];o!==null&&(n[Fi]=null,n[Vn]=null,n[xi]=null,o(i)),n[ou]=i;return}var s=n[Vn];s!==null&&(n[Fi]=null,n[Vn]=null,n[xi]=null,s(zn(void 0,!0))),n[Rc]=!0}),e.on("readable",IM.bind(null,n)),n};q_.exports=BM});var z_=y((Wae,V_)=>{"use strict";function U_(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(l){r(l);return}a.done?e(u):Promise.resolve(u).then(n,i)}function qM(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function s(u){U_(o,n,i,s,a,"next",u)}function a(u){U_(o,n,i,s,a,"throw",u)}s(void 0)})}}function H_(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function MM(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?H_(Object(r),!0).forEach(function(n){UM(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):H_(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function UM(t,e,r){return e=HM(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function HM(t){var e=VM(t,"string");return typeof e=="symbol"?e:String(e)}function VM(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 zM=Mn().codes.ERR_INVALID_ARG_TYPE;function GM(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 zM("iterable",["Iterable"],e);var i=new t(MM({objectMode:!0},r)),o=!1;i._read=function(){o||(o=!0,s())};function s(){return a.apply(this,arguments)}function a(){return a=qM(function*(){try{var u=yield n.next(),l=u.value,c=u.done;c?i.push(null):i.push(yield l)?s():o=!1}catch(f){i.destroy(f)}}),a.apply(this,arguments)}return i}V_.exports=GM});var Bm=y((Yae,tE)=>{"use strict";tE.exports=ge;var Jo;ge.ReadableState=Y_;var Kae=require("events").EventEmitter,K_=function(e,r){return e.listeners(r).length},au=xm(),$c=require("buffer").Buffer,WM=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function KM(t){return $c.from(t)}function YM(t){return $c.isBuffer(t)||t instanceof WM}var zm=require("util"),ae;zm&&zm.debuglog?ae=zm.debuglog("stream"):ae=function(){};var JM=p_(),Zm=Am(),XM=km(),ZM=XM.getHighWaterMark,Ic=Mn().codes,QM=Ic.ERR_INVALID_ARG_TYPE,e4=Ic.ERR_STREAM_PUSH_AFTER_EOF,t4=Ic.ERR_METHOD_NOT_IMPLEMENTED,r4=Ic.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,Xo,Gm,Wm;Wo()(ge,au);var su=Zm.errorOrDestroy,Km=["error","close","destroy","pause","resume"];function n4(t,e,r){if(typeof t.prependListener=="function")return t.prependListener(e,r);!t._events||!t._events[e]?t.on(e,r):Array.isArray(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]}function Y_(t,e,r){Jo=Jo||Ci(),t=t||{},typeof r!="boolean"&&(r=e instanceof Jo),this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=ZM(this,t,"readableHighWaterMark",r),this.buffer=new JM,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&&(Xo||(Xo=Hm().StringDecoder),this.decoder=new Xo(t.encoding),this.encoding=t.encoding)}function ge(t){if(Jo=Jo||Ci(),!(this instanceof ge))return new ge(t);var e=this instanceof Jo;this._readableState=new Y_(t,this,e),this.readable=!0,t&&(typeof t.read=="function"&&(this._read=t.read),typeof t.destroy=="function"&&(this._destroy=t.destroy)),au.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=Zm.destroy;ge.prototype._undestroy=Zm.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=$c.from(t,e),e=""),n=!0),J_(this,t,e,!1,n)};ge.prototype.unshift=function(t){return J_(this,t,null,!0,!1)};function J_(t,e,r,n,i){ae("readableAddChunk",e);var o=t._readableState;if(e===null)o.reading=!1,s4(t,o);else{var s;if(i||(s=i4(o,e)),s)su(t,s);else if(o.objectMode||e&&e.length>0)if(typeof e!="string"&&!o.objectMode&&Object.getPrototypeOf(e)!==$c.prototype&&(e=KM(e)),n)o.endEmitted?su(t,new r4):Ym(t,o,e,!0);else if(o.ended)su(t,new e4);else{if(o.destroyed)return!1;o.reading=!1,o.decoder&&!r?(e=o.decoder.write(e),o.objectMode||e.length!==0?Ym(t,o,e,!1):Xm(t,o)):Ym(t,o,e,!1)}else n||(o.reading=!1,Xm(t,o))}return!o.ended&&(o.length<o.highWaterMark||o.length===0)}function Ym(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&&jc(t)),Xm(t,e)}function i4(t,e){var r;return!YM(e)&&typeof e!="string"&&e!==void 0&&!t.objectMode&&(r=new QM("chunk",["string","Buffer","Uint8Array"],e)),r}ge.prototype.isPaused=function(){return this._readableState.flowing===!1};ge.prototype.setEncoding=function(t){Xo||(Xo=Hm().StringDecoder);var e=new Xo(t);this._readableState.decoder=e,this._readableState.encoding=this._readableState.decoder.encoding;for(var r=this._readableState.buffer.head,n="";r!==null;)n+=e.write(r.data),r=r.next;return this._readableState.buffer.clear(),n!==""&&this._readableState.buffer.push(n),this._readableState.length=n.length,this};var G_=1073741824;function o4(t){return t>=G_?t=G_:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}function W_(t,e){return t<=0||e.length===0&&e.ended?0:e.objectMode?1:t!==t?e.flowing&&e.length?e.buffer.head.data.length:e.length:(t>e.highWaterMark&&(e.highWaterMark=o4(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}ge.prototype.read=function(t){ae("read",t),t=parseInt(t,10);var e=this._readableState,r=t;if(t!==0&&(e.emittedReadable=!1),t===0&&e.needReadable&&((e.highWaterMark!==0?e.length>=e.highWaterMark:e.length>0)||e.ended))return ae("read: emitReadable",e.length,e.ended),e.length===0&&e.ended?Jm(this):jc(this),null;if(t=W_(t,e),t===0&&e.ended)return e.length===0&&Jm(this),null;var n=e.needReadable;ae("need readable",n),(e.length===0||e.length-t<e.highWaterMark)&&(n=!0,ae("length less than watermark",n)),e.ended||e.reading?(n=!1,ae("reading or ended",n)):n&&(ae("do read"),e.reading=!0,e.sync=!0,e.length===0&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1,e.reading||(t=W_(r,e)));var i;return t>0?i=Q_(t,e):i=null,i===null?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.awaitDrain=0),e.length===0&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&Jm(this)),i!==null&&this.emit("data",i),i};function s4(t,e){if(ae("onEofChunk"),!e.ended){if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,e.sync?jc(t):(e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,X_(t)))}}function jc(t){var e=t._readableState;ae("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(ae("emitReadable",e.flowing),e.emittedReadable=!0,process.nextTick(X_,t))}function X_(t){var e=t._readableState;ae("emitReadable_",e.destroyed,e.length,e.ended),!e.destroyed&&(e.length||e.ended)&&(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,Qm(t)}function Xm(t,e){e.readingMore||(e.readingMore=!0,process.nextTick(a4,t,e))}function a4(t,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&e.length===0);){var r=e.length;if(ae("maybeReadMore read 0"),t.read(0),r===e.length)break}e.readingMore=!1}ge.prototype._read=function(t){su(this,new t4("_read()"))};ge.prototype.pipe=function(t,e){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=t;break;case 1:n.pipes=[n.pipes,t];break;default:n.pipes.push(t);break}n.pipesCount+=1,ae("pipe count=%d opts=%j",n.pipesCount,e);var i=(!e||e.end!==!1)&&t!==process.stdout&&t!==process.stderr,o=i?a:b;n.endEmitted?process.nextTick(o):r.once("end",o),t.on("unpipe",s);function s(D,_){ae("onunpipe"),D===r&&_&&_.hasUnpiped===!1&&(_.hasUnpiped=!0,c())}function a(){ae("onend"),t.end()}var u=u4(r);t.on("drain",u);var l=!1;function c(){ae("cleanup"),t.removeListener("close",d),t.removeListener("finish",m),t.removeListener("drain",u),t.removeListener("error",h),t.removeListener("unpipe",s),r.removeListener("end",a),r.removeListener("end",b),r.removeListener("data",f),l=!0,n.awaitDrain&&(!t._writableState||t._writableState.needDrain)&&u()}r.on("data",f);function f(D){ae("ondata");var _=t.write(D);ae("dest.write",_),_===!1&&((n.pipesCount===1&&n.pipes===t||n.pipesCount>1&&eE(n.pipes,t)!==-1)&&!l&&(ae("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function h(D){ae("onerror",D),b(),t.removeListener("error",h),K_(t,"error")===0&&su(t,D)}n4(t,"error",h);function d(){t.removeListener("finish",m),b()}t.once("close",d);function m(){ae("onfinish"),t.removeListener("close",d),b()}t.once("finish",m);function b(){ae("unpipe"),r.unpipe(t)}return t.emit("pipe",r),n.flowing||(ae("pipe resume"),r.resume()),t};function u4(t){return function(){var r=t._readableState;ae("pipeOnDrain",r.awaitDrain),r.awaitDrain&&r.awaitDrain--,r.awaitDrain===0&&K_(t,"data")&&(r.flowing=!0,Qm(t))}}ge.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(e.pipesCount===0)return this;if(e.pipesCount===1)return t&&t!==e.pipes?this:(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r),this);if(!t){var n=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o<i;o++)n[o].emit("unpipe",this,{hasUnpiped:!1});return this}var s=eE(e.pipes,t);return s===-1?this:(e.pipes.splice(s,1),e.pipesCount-=1,e.pipesCount===1&&(e.pipes=e.pipes[0]),t.emit("unpipe",this,r),this)};ge.prototype.on=function(t,e){var r=au.prototype.on.call(this,t,e),n=this._readableState;return t==="data"?(n.readableListening=this.listenerCount("readable")>0,n.flowing!==!1&&this.resume()):t==="readable"&&!n.endEmitted&&!n.readableListening&&(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,ae("on readable",n.length,n.reading),n.length?jc(this):n.reading||process.nextTick(l4,this)),r};ge.prototype.addListener=ge.prototype.on;ge.prototype.removeListener=function(t,e){var r=au.prototype.removeListener.call(this,t,e);return t==="readable"&&process.nextTick(Z_,this),r};ge.prototype.removeAllListeners=function(t){var e=au.prototype.removeAllListeners.apply(this,arguments);return(t==="readable"||t===void 0)&&process.nextTick(Z_,this),e};function Z_(t){var e=t._readableState;e.readableListening=t.listenerCount("readable")>0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}function l4(t){ae("readable nexttick read 0"),t.read(0)}ge.prototype.resume=function(){var t=this._readableState;return t.flowing||(ae("resume"),t.flowing=!t.readableListening,c4(this,t)),t.paused=!1,this};function c4(t,e){e.resumeScheduled||(e.resumeScheduled=!0,process.nextTick(f4,t,e))}function f4(t,e){ae("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),Qm(t),e.flowing&&!e.reading&&t.read(0)}ge.prototype.pause=function(){return ae("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(ae("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function Qm(t){var e=t._readableState;for(ae("flow",e.flowing);e.flowing&&t.read()!==null;);}ge.prototype.wrap=function(t){var e=this,r=this._readableState,n=!1;t.on("end",function(){if(ae("wrapped end"),r.decoder&&!r.ended){var s=r.decoder.end();s&&s.length&&e.push(s)}e.push(null)}),t.on("data",function(s){if(ae("wrapped data"),r.decoder&&(s=r.decoder.write(s)),!(r.objectMode&&s==null)&&!(!r.objectMode&&(!s||!s.length))){var a=e.push(s);a||(n=!0,t.pause())}});for(var i in t)this[i]===void 0&&typeof t[i]=="function"&&(this[i]=function(a){return function(){return t[a].apply(t,arguments)}}(i));for(var o=0;o<Km.length;o++)t.on(Km[o],this.emit.bind(this,Km[o]));return this._read=function(s){ae("wrapped _read",s),n&&(n=!1,t.resume())},this};typeof Symbol=="function"&&(ge.prototype[Symbol.asyncIterator]=function(){return Gm===void 0&&(Gm=M_()),Gm(this)});Object.defineProperty(ge.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}});Object.defineProperty(ge.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}});Object.defineProperty(ge.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}});ge._fromList=Q_;Object.defineProperty(ge.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function Q_(t,e){if(e.length===0)return null;var r;return e.objectMode?r=e.buffer.shift():!t||t>=e.length?(e.decoder?r=e.buffer.join(""):e.buffer.length===1?r=e.buffer.first():r=e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r}function Jm(t){var e=t._readableState;ae("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,process.nextTick(d4,e,t))}function d4(t,e){if(ae("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&t.length===0&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var r=e._writableState;(!r||r.autoDestroy&&r.finished)&&e.destroy()}}typeof Symbol=="function"&&(ge.from=function(t,e){return Wm===void 0&&(Wm=z_()),Wm(ge,t,e)});function eE(t,e){for(var r=0,n=t.length;r<n;r++)if(t[r]===e)return r;return-1}});var eg=y((Jae,nE)=>{"use strict";nE.exports=dn;var Nc=Mn().codes,h4=Nc.ERR_METHOD_NOT_IMPLEMENTED,p4=Nc.ERR_MULTIPLE_CALLBACK,m4=Nc.ERR_TRANSFORM_ALREADY_TRANSFORMING,g4=Nc.ERR_TRANSFORM_WITH_LENGTH_0,Lc=Ci();Wo()(dn,Lc);function y4(t,e){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(n===null)return this.emit("error",new p4);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);Lc.call(this,t),this._transformState={afterTransform:y4.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",D4)}function D4(){var t=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(e,r){rE(t,e,r)}):rE(this,null,null)}dn.prototype.push=function(t,e){return this._transformState.needTransform=!1,Lc.prototype.push.call(this,t,e)};dn.prototype._transform=function(t,e,r){r(new h4("_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){Lc.prototype._destroy.call(this,t,function(r){e(r)})};function rE(t,e,r){if(e)return t.emit("error",e);if(r!=null&&t.push(r),t._writableState.length)throw new g4;if(t._transformState.transforming)throw new m4;return t.push(null)}});var sE=y((Xae,oE)=>{"use strict";oE.exports=uu;var iE=eg();Wo()(uu,iE);function uu(t){if(!(this instanceof uu))return new uu(t);iE.call(this,t)}uu.prototype._transform=function(t,e,r){r(null,t)}});var fE=y((Zae,cE)=>{"use strict";var tg;function v4(t){var e=!1;return function(){e||(e=!0,t.apply(void 0,arguments))}}var lE=Mn().codes,b4=lE.ERR_MISSING_ARGS,w4=lE.ERR_STREAM_DESTROYED;function aE(t){if(t)throw t}function _4(t){return t.setHeader&&typeof t.abort=="function"}function E4(t,e,r,n){n=v4(n);var i=!1;t.on("close",function(){i=!0}),tg===void 0&&(tg=Tc()),tg(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,_4(t))return t.abort();if(typeof t.destroy=="function")return t.destroy();n(s||new w4("pipe"))}}}function uE(t){t()}function C4(t,e){return t.pipe(e)}function S4(t){return!t.length||typeof t[t.length-1]!="function"?aE:t.pop()}function x4(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];var n=S4(e);if(Array.isArray(e[0])&&(e=e[0]),e.length<2)throw new b4("streams");var i,o=e.map(function(s,a){var u=a<e.length-1,l=a>0;return E4(s,u,l,function(c){i||(i=c),c&&o.forEach(uE),!u&&(o.forEach(uE),n(i))})});return e.reduce(C4)}cE.exports=x4});var dE=y((hr,cu)=>{var lu=require("stream");process.env.READABLE_STREAM==="disable"&&lu?(cu.exports=lu.Readable,Object.assign(cu.exports,lu),cu.exports.Stream=lu):(hr=cu.exports=Bm(),hr.Stream=lu||hr,hr.Readable=hr,hr.Writable=jm(),hr.Duplex=Ci(),hr.Transform=eg(),hr.PassThrough=sE(),hr.finished=Tc(),hr.pipeline=fE())});var ng=y(rg=>{var hE;(function(t){typeof DO_NOT_EXPORT_CRC>"u"?typeof rg=="object"?t(rg):typeof define=="function"&&define.amd?define(function(){var e={};return t(e),e}):t(hE={}):t(hE={})})(function(t){t.version="1.2.2";function e(){for(var x=0,L=new Array(256),S=0;S!=256;++S)x=S,x=x&1?-306674912^x>>>1:x>>>1,x=x&1?-306674912^x>>>1:x>>>1,x=x&1?-306674912^x>>>1:x>>>1,x=x&1?-306674912^x>>>1:x>>>1,x=x&1?-306674912^x>>>1:x>>>1,x=x&1?-306674912^x>>>1:x>>>1,x=x&1?-306674912^x>>>1:x>>>1,x=x&1?-306674912^x>>>1:x>>>1,L[S]=x;return typeof Int32Array<"u"?new Int32Array(L):L}var r=e();function n(x){var L=0,S=0,I=0,$=typeof Int32Array<"u"?new Int32Array(4096):new Array(4096);for(I=0;I!=256;++I)$[I]=x[I];for(I=0;I!=256;++I)for(S=x[I],L=256+I;L<4096;L+=256)S=$[L]=S>>>8^x[S&255];var B=[];for(I=1;I!=16;++I)B[I-1]=typeof Int32Array<"u"?$.subarray(I*256,I*256+256):$.slice(I*256,I*256+256);return B}var i=n(r),o=i[0],s=i[1],a=i[2],u=i[3],l=i[4],c=i[5],f=i[6],h=i[7],d=i[8],m=i[9],b=i[10],D=i[11],_=i[12],F=i[13],g=i[14];function C(x,L){for(var S=L^-1,I=0,$=x.length;I<$;)S=S>>>8^r[(S^x.charCodeAt(I++))&255];return~S}function A(x,L){for(var S=L^-1,I=x.length-15,$=0;$<I;)S=g[x[$++]^S&255]^F[x[$++]^S>>8&255]^_[x[$++]^S>>16&255]^D[x[$++]^S>>>24]^b[x[$++]]^m[x[$++]]^d[x[$++]]^h[x[$++]]^f[x[$++]]^c[x[$++]]^l[x[$++]]^u[x[$++]]^a[x[$++]]^s[x[$++]]^o[x[$++]]^r[x[$++]];for(I+=15;$<I;)S=S>>>8^r[(S^x[$++])&255];return~S}function T(x,L){for(var S=L^-1,I=0,$=x.length,B=0,q=0;I<$;)B=x.charCodeAt(I++),B<128?S=S>>>8^r[(S^B)&255]:B<2048?(S=S>>>8^r[(S^(192|B>>6&31))&255],S=S>>>8^r[(S^(128|B&63))&255]):B>=55296&&B<57344?(B=(B&1023)+64,q=x.charCodeAt(I++)&1023,S=S>>>8^r[(S^(240|B>>8&7))&255],S=S>>>8^r[(S^(128|B>>2&63))&255],S=S>>>8^r[(S^(128|q>>6&15|(B&3)<<4))&255],S=S>>>8^r[(S^(128|q&63))&255]):(S=S>>>8^r[(S^(224|B>>12&15))&255],S=S>>>8^r[(S^(128|B>>6&63))&255],S=S>>>8^r[(S^(128|B&63))&255]);return~S}t.table=r,t.bstr=C,t.buf=A,t.str=T})});var mE=y((eue,pE)=>{"use strict";var{Transform:F4}=dE(),O4=ng(),ig=class extends F4{constructor(e){super(e),this.checksum=Buffer.allocUnsafe(4),this.checksum.writeInt32BE(0,0),this.rawSize=0}_transform(e,r,n){e&&(this.checksum=O4.buf(e,this.checksum)>>>0,this.rawSize+=e.length),n(null,e)}digest(e){let r=Buffer.allocUnsafe(4);return r.writeUInt32BE(this.checksum>>>0,0),e?r.toString(e):r}hex(){return this.digest("hex").toUpperCase()}size(){return this.rawSize}};pE.exports=ig});var yE=y((tue,gE)=>{"use strict";var{DeflateRaw:A4}=require("zlib"),k4=ng(),og=class extends A4{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=k4.buf(e,this.checksum)>>>0,this.rawSize+=e.length),super._transform(e,r,n)}digest(e){let r=Buffer.allocUnsafe(4);return r.writeUInt32BE(this.checksum>>>0,0),e?r.toString(e):r}hex(){return this.digest("hex").toUpperCase()}size(e=!1){return e?this.compressedSize:this.rawSize}};gE.exports=og});var vE=y((rue,DE)=>{"use strict";DE.exports={CRC32Stream:mE(),DeflateCRC32Stream:yE()}});var fu=y(Zo=>{"use strict";Object.defineProperty(Zo,"__esModule",{value:!0});Zo.checksum=Zo.checksumFile=void 0;var T4=require("fs"),P4=require("crypto"),wE=require("stream"),R4=require("util"),{CRC32Stream:$4}=vE(),bE=(0,R4.promisify)(wE.pipeline),I4=(t,e,r)=>_E(T4.createReadStream(t),e,r);Zo.checksumFile=I4;async function _E(t,e,r="hex"){let n=N4(t);if(e==="crc32"){let o=new $4,s=bE(n,o);return o.resume(),await s,o.end(),Buffer.from(o.digest()).toString(r)}let i=(0,P4.createHash)(e);return await bE(n,i),i.end(),i.digest(r)}Zo.checksum=_E;function j4(t){return t!=null&&typeof t=="object"&&typeof t.read=="function"&&typeof t.pipe=="function"}var N4=t=>j4(t)?t:new wE.Readable({read(){this.push(t),this.push(null)}})});var sg=y((iue,EE)=>{EE.exports={LOCHDR:30,LOCSIG:67324752,LOCVER:4,LOCFLG:6,LOCHOW:8,LOCTIM:10,LOCCRC:14,LOCSIZ:18,LOCLEN:22,LOCNAM:26,LOCEXT:28,EXTSIG:134695760,EXTHDR:16,EXTCRC:4,EXTSIZ:8,EXTLEN:12,CENHDR:46,CENSIG:33639248,CENVEM:4,CENVER:6,CENFLG:8,CENHOW:10,CENTIM:12,CENCRC:16,CENSIZ:20,CENLEN:24,CENNAM:28,CENEXT:30,CENCOM:32,CENDSK:34,CENATT:36,CENATX:38,CENOFF:42,ENDHDR:22,ENDSIG:101010256,ENDSUB:8,ENDTOT:10,ENDSIZ:12,ENDOFF:16,ENDCOM:20,END64HDR:20,END64SIG:117853008,END64START:4,END64OFF:8,END64NUMDISKS:16,ZIP64SIG:101075792,ZIP64HDR:56,ZIP64LEAD:12,ZIP64SIZE:4,ZIP64VEM:12,ZIP64VER:14,ZIP64DSK:16,ZIP64DSKDIR:20,ZIP64SUB:24,ZIP64TOT:32,ZIP64SIZB:40,ZIP64OFF:48,ZIP64EXTRA:56,STORED:0,SHRUNK:1,REDUCED1:2,REDUCED2:3,REDUCED3:4,REDUCED4:5,IMPLODED:6,DEFLATED:8,ENHANCED_DEFLATED:9,PKWARE:10,BZIP2:12,LZMA:14,IBM_TERSE:18,IBM_LZ77:19,AES_ENCRYPT:99,FLG_ENC:1,FLG_COMP1:2,FLG_COMP2:4,FLG_DESC:8,FLG_ENH:16,FLG_PATCH:32,FLG_STR:64,FLG_EFS:2048,FLG_MSK:4096,FILE:2,BUFFER:1,NONE:0,EF_ID:0,EF_SIZE:2,ID_ZIP64:1,ID_AVINFO:7,ID_PFS:8,ID_OS2:9,ID_NTFS:10,ID_OPENVMS:12,ID_UNIX:13,ID_FORK:14,ID_PATCH:15,ID_X509_PKCS7:20,ID_X509_CERTID_F:21,ID_X509_CERTID_C:22,ID_STRONGENC:23,ID_RECORD_MGT:24,ID_X509_PKCS7_RL:25,ID_IBM1:101,ID_IBM2:102,ID_POSZIP:18064,EF_ZIP64_OR_32:4294967295,EF_ZIP64_OR_16:65535,EF_ZIP64_SUNCOMP:0,EF_ZIP64_SCOMP:8,EF_ZIP64_RHO:16,EF_ZIP64_DSN:24}});var Bc=y(SE=>{var CE={INVALID_LOC:"Invalid LOC header (bad signature)",INVALID_CEN:"Invalid CEN header (bad signature)",INVALID_END:"Invalid END header (bad signature)",DESCRIPTOR_NOT_EXIST:"No descriptor present",DESCRIPTOR_UNKNOWN:"Unknown descriptor format",DESCRIPTOR_FAULTY:"Descriptor data is malformed",NO_DATA:"Nothing to decompress",BAD_CRC:"CRC32 checksum failed {0}",FILE_IN_THE_WAY:"There is a file in the way: {0}",UNKNOWN_METHOD:"Invalid/unsupported compression method",AVAIL_DATA:"inflate::Available inflate data did not terminate",INVALID_DISTANCE:"inflate::Invalid literal/length or distance code in fixed or dynamic block",TO_MANY_CODES:"inflate::Dynamic block code description: too many length or distance codes",INVALID_REPEAT_LEN:"inflate::Dynamic block code description: repeat more than specified lengths",INVALID_REPEAT_FIRST:"inflate::Dynamic block code description: repeat lengths with no first length",INCOMPLETE_CODES:"inflate::Dynamic block code description: code lengths codes incomplete",INVALID_DYN_DISTANCE:"inflate::Dynamic block code description: invalid distance code lengths",INVALID_CODES_LEN:"inflate::Dynamic block code description: invalid literal/length code lengths",INVALID_STORE_BLOCK:"inflate::Stored block length did not match one's complement",INVALID_BLOCK_TYPE:"inflate::Invalid block type (type == 3)",CANT_EXTRACT_FILE:"Could not extract the file",CANT_OVERRIDE:"Target file already exists",DISK_ENTRY_TOO_LARGE:"Number of disk entries is too large",NO_ZIP:"No zip file was loaded",NO_ENTRY:"Entry doesn't exist",DIRECTORY_CONTENT_ERROR:"A directory cannot have content",FILE_NOT_FOUND:'File not found: "{0}"',NOT_IMPLEMENTED:"Not implemented",INVALID_FILENAME:"Invalid filename",INVALID_FORMAT:"Invalid or unsupported zip format. No END header found",INVALID_PASS_PARAM:"Incompatible password parameter",WRONG_PASSWORD:"Wrong Password",COMMENT_TOO_LONG:"Comment is too long",EXTRA_FIELD_PARSE_ERROR:"Extra field parsing error"};function L4(t){return function(...e){return e.length&&(t=t.replace(/\{(\d)\}/g,(r,n)=>e[n]||"")),new Error("ADM-ZIP: "+t)}}for(let t of Object.keys(CE))SE[t]=L4(CE[t])});var kE=y((sue,AE)=>{var B4=require("fs"),at=require("path"),xE=sg(),q4=Bc(),M4=typeof process=="object"&&process.platform==="win32",FE=t=>typeof t=="object"&&t!==null,OE=new Uint32Array(256).map((t,e)=>{for(let r=0;r<8;r++)(e&1)!==0?e=3988292384^e>>>1:e>>>=1;return e>>>0});function Je(t){this.sep=at.sep,this.fs=B4,FE(t)&&FE(t.fs)&&typeof t.fs.statSync=="function"&&(this.fs=t.fs)}AE.exports=Je;Je.prototype.makeDir=function(t){let e=this;function r(n){let i=n.split(e.sep)[0];n.split(e.sep).forEach(function(o){if(!(!o||o.substr(-1,1)===":")){i+=e.sep+o;var s;try{s=e.fs.statSync(i)}catch{e.fs.mkdirSync(i)}if(s&&s.isFile())throw q4.FILE_IN_THE_WAY(`"${i}"`)}})}r(t)};Je.prototype.writeFileTo=function(t,e,r,n){let i=this;if(i.fs.existsSync(t)){if(!r)return!1;var o=i.fs.statSync(t);if(o.isDirectory())return!1}var s=at.dirname(t);i.fs.existsSync(s)||i.makeDir(s);var a;try{a=i.fs.openSync(t,"w",438)}catch{i.fs.chmodSync(t,438),a=i.fs.openSync(t,"w",438)}if(a)try{i.fs.writeSync(a,e,0,e.length,0)}finally{i.fs.closeSync(a)}return i.fs.chmodSync(t,n||438),!0};Je.prototype.writeFileToAsync=function(t,e,r,n,i){typeof n=="function"&&(i=n,n=void 0);let o=this;o.fs.exists(t,function(s){if(s&&!r)return i(!1);o.fs.stat(t,function(a,u){if(s&&u.isDirectory())return i(!1);var l=at.dirname(t);o.fs.exists(l,function(c){c||o.makeDir(l),o.fs.open(t,"w",438,function(f,h){f?o.fs.chmod(t,438,function(){o.fs.open(t,"w",438,function(d,m){o.fs.write(m,e,0,e.length,0,function(){o.fs.close(m,function(){o.fs.chmod(t,n||438,function(){i(!0)})})})})}):h?o.fs.write(h,e,0,e.length,0,function(){o.fs.close(h,function(){o.fs.chmod(t,n||438,function(){i(!0)})})}):o.fs.chmod(t,n||438,function(){i(!0)})})})})})};Je.prototype.findFiles=function(t){let e=this;function r(n,i,o){typeof i=="boolean"&&(o=i,i=void 0);let s=[];return e.fs.readdirSync(n).forEach(function(a){let u=at.join(n,a),l=e.fs.statSync(u);(!i||i.test(u))&&s.push(at.normalize(u)+(l.isDirectory()?e.sep:"")),l.isDirectory()&&o&&(s=s.concat(r(u,i,o)))}),s}return r(t,void 0,!0)};Je.prototype.findFilesAsync=function(t,e){let r=this,n=[];r.fs.readdir(t,function(i,o){if(i)return e(i);let s=o.length;if(!s)return e(null,n);o.forEach(function(a){a=at.join(t,a),r.fs.stat(a,function(u,l){if(u)return e(u);l&&(n.push(at.normalize(a)+(l.isDirectory()?r.sep:"")),l.isDirectory()?r.findFilesAsync(a,function(c,f){if(c)return e(c);n=n.concat(f),--s||e(null,n)}):--s||e(null,n))})})})};Je.prototype.getAttributes=function(){};Je.prototype.setAttributes=function(){};Je.crc32update=function(t,e){return OE[(t^e)&255]^t>>>8};Je.crc32=function(t){typeof t=="string"&&(t=Buffer.from(t,"utf8"));let e=t.length,r=-1;for(let n=0;n<e;)r=Je.crc32update(r,t[n++]);return~r>>>0};Je.methodToString=function(t){switch(t){case xE.STORED:return"STORED ("+t+")";case xE.DEFLATED:return"DEFLATED ("+t+")";default:return"UNSUPPORTED ("+t+")"}};Je.canonical=function(t){if(!t)return"";let e=at.posix.normalize("/"+t.split("\\").join("/"));return at.join(".",e)};Je.zipnamefix=function(t){if(!t)return"";let e=at.posix.normalize("/"+t.split("\\").join("/"));return at.posix.join(".",e)};Je.findLast=function(t,e){if(!Array.isArray(t))throw new TypeError("arr is not array");let r=t.length>>>0;for(let n=r-1;n>=0;n--)if(e(t[n],n,t))return t[n]};Je.sanitize=function(t,e){t=at.resolve(at.normalize(t));for(var r=e.split("/"),n=0,i=r.length;n<i;n++){var o=at.normalize(at.join(t,r.slice(n,i).join(at.sep)));if(o.indexOf(t)===0)return o}return at.normalize(at.join(t,at.basename(e)))};Je.toBuffer=function(e,r){return Buffer.isBuffer(e)?e:e instanceof Uint8Array?Buffer.from(e):typeof e=="string"?r(e):Buffer.alloc(0)};Je.readBigUInt64LE=function(t,e){var r=Buffer.from(t.slice(e,e+8));return r.swap64(),parseInt(`0x${r.toString("hex")}`)};Je.fromDOS2Date=function(t){return new Date((t>>25&127)+1980,Math.max((t>>21&15)-1,0),Math.max(t>>16&31,1),t>>11&31,t>>5&63,(t&31)<<1)};Je.fromDate2DOS=function(t){let e=0,r=0;return t.getFullYear()>1979&&(e=(t.getFullYear()-1980&127)<<9|t.getMonth()+1<<5|t.getDate(),r=t.getHours()<<11|t.getMinutes()<<5|t.getSeconds()>>1),e<<16|r};Je.isWin=M4;Je.crcTable=OE});var PE=y((aue,TE)=>{var U4=require("path");TE.exports=function(t,{fs:e}){var r=t||"",n=o(),i=null;function o(){return{directory:!1,readonly:!1,hidden:!1,executable:!1,mtime:0,atime:0}}return r&&e.existsSync(r)?(i=e.statSync(r),n.directory=i.isDirectory(),n.mtime=i.mtime,n.atime=i.atime,n.executable=(73&i.mode)!==0,n.readonly=(128&i.mode)===0,n.hidden=U4.basename(r)[0]==="."):console.warn("Invalid path: "+r),{get directory(){return n.directory},get readOnly(){return n.readonly},get hidden(){return n.hidden},get mtime(){return n.mtime},get atime(){return n.atime},get executable(){return n.executable},decodeAttributes:function(){},encodeAttributes:function(){},toJSON:function(){return{path:r,isDirectory:n.directory,isReadOnly:n.readonly,isHidden:n.hidden,isExecutable:n.executable,mTime:n.mtime,aTime:n.atime}},toString:function(){return JSON.stringify(this.toJSON(),null," ")}}}});var $E=y((uue,RE)=>{RE.exports={efs:!0,encode:t=>Buffer.from(t,"utf8"),decode:t=>t.toString("utf8")}});var es=y((lue,Qo)=>{Qo.exports=kE();Qo.exports.Constants=sg();Qo.exports.Errors=Bc();Qo.exports.FileAttr=PE();Qo.exports.decoder=$E()});var jE=y((cue,IE)=>{var Gn=es(),H=Gn.Constants;IE.exports=function(){var t=20,e=10,r=0,n=0,i=0,o=0,s=0,a=0,u=0,l=0,c=0,f=0,h=0,d=0,m=0;t|=Gn.isWin?2560:768,r|=H.FLG_EFS;let b={extraLen:0},D=g=>Math.max(0,g)>>>0,_=g=>Math.max(0,g)&65535,F=g=>Math.max(0,g)&255;return i=Gn.fromDate2DOS(new Date),{get made(){return t},set made(g){t=g},get version(){return e},set version(g){e=g},get flags(){return r},set flags(g){r=g},get flags_efs(){return(r&H.FLG_EFS)>0},set flags_efs(g){g?r|=H.FLG_EFS:r&=~H.FLG_EFS},get flags_desc(){return(r&H.FLG_DESC)>0},set flags_desc(g){g?r|=H.FLG_DESC:r&=~H.FLG_DESC},get method(){return n},set method(g){switch(g){case H.STORED:this.version=10;case H.DEFLATED:default:this.version=20}n=g},get time(){return Gn.fromDOS2Date(this.timeval)},set time(g){this.timeval=Gn.fromDate2DOS(g)},get timeval(){return i},set timeval(g){i=D(g)},get timeHighByte(){return F(i>>>8)},get crc(){return o},set crc(g){o=D(g)},get compressedSize(){return s},set compressedSize(g){s=D(g)},get size(){return a},set size(g){a=D(g)},get fileNameLength(){return u},set fileNameLength(g){u=g},get extraLength(){return l},set extraLength(g){l=g},get extraLocalLength(){return b.extraLen},set extraLocalLength(g){b.extraLen=g},get commentLength(){return c},set commentLength(g){c=g},get diskNumStart(){return f},set diskNumStart(g){f=D(g)},get inAttr(){return h},set inAttr(g){h=D(g)},get attr(){return d},set attr(g){d=D(g)},get fileAttr(){return(d||0)>>16&4095},get offset(){return m},set offset(g){m=D(g)},get encrypted(){return(r&H.FLG_ENC)===H.FLG_ENC},get centralHeaderSize(){return H.CENHDR+u+l+c},get realDataOffset(){return m+H.LOCHDR+b.fnameLen+b.extraLen},get localHeader(){return b},loadLocalHeaderFromBinary:function(g){var C=g.slice(m,m+H.LOCHDR);if(C.readUInt32LE(0)!==H.LOCSIG)throw Gn.Errors.INVALID_LOC();b.version=C.readUInt16LE(H.LOCVER),b.flags=C.readUInt16LE(H.LOCFLG),b.method=C.readUInt16LE(H.LOCHOW),b.time=C.readUInt32LE(H.LOCTIM),b.crc=C.readUInt32LE(H.LOCCRC),b.compressedSize=C.readUInt32LE(H.LOCSIZ),b.size=C.readUInt32LE(H.LOCLEN),b.fnameLen=C.readUInt16LE(H.LOCNAM),b.extraLen=C.readUInt16LE(H.LOCEXT);let A=m+H.LOCHDR+b.fnameLen,T=A+b.extraLen;return g.slice(A,T)},loadFromBinary:function(g){if(g.length!==H.CENHDR||g.readUInt32LE(0)!==H.CENSIG)throw Gn.Errors.INVALID_CEN();t=g.readUInt16LE(H.CENVEM),e=g.readUInt16LE(H.CENVER),r=g.readUInt16LE(H.CENFLG),n=g.readUInt16LE(H.CENHOW),i=g.readUInt32LE(H.CENTIM),o=g.readUInt32LE(H.CENCRC),s=g.readUInt32LE(H.CENSIZ),a=g.readUInt32LE(H.CENLEN),u=g.readUInt16LE(H.CENNAM),l=g.readUInt16LE(H.CENEXT),c=g.readUInt16LE(H.CENCOM),f=g.readUInt16LE(H.CENDSK),h=g.readUInt16LE(H.CENATT),d=g.readUInt32LE(H.CENATX),m=g.readUInt32LE(H.CENOFF)},localHeaderToBinary:function(){var g=Buffer.alloc(H.LOCHDR);return g.writeUInt32LE(H.LOCSIG,0),g.writeUInt16LE(e,H.LOCVER),g.writeUInt16LE(r,H.LOCFLG),g.writeUInt16LE(n,H.LOCHOW),g.writeUInt32LE(i,H.LOCTIM),g.writeUInt32LE(o,H.LOCCRC),g.writeUInt32LE(s,H.LOCSIZ),g.writeUInt32LE(a,H.LOCLEN),g.writeUInt16LE(u,H.LOCNAM),g.writeUInt16LE(b.extraLen,H.LOCEXT),g},centralHeaderToBinary:function(){var g=Buffer.alloc(H.CENHDR+u+l+c);return g.writeUInt32LE(H.CENSIG,0),g.writeUInt16LE(t,H.CENVEM),g.writeUInt16LE(e,H.CENVER),g.writeUInt16LE(r,H.CENFLG),g.writeUInt16LE(n,H.CENHOW),g.writeUInt32LE(i,H.CENTIM),g.writeUInt32LE(o,H.CENCRC),g.writeUInt32LE(s,H.CENSIZ),g.writeUInt32LE(a,H.CENLEN),g.writeUInt16LE(u,H.CENNAM),g.writeUInt16LE(l,H.CENEXT),g.writeUInt16LE(c,H.CENCOM),g.writeUInt16LE(f,H.CENDSK),g.writeUInt16LE(h,H.CENATT),g.writeUInt32LE(d,H.CENATX),g.writeUInt32LE(m,H.CENOFF),g},toJSON:function(){let g=function(C){return C+" bytes"};return{made:t,version:e,flags:r,method:Gn.methodToString(n),time:this.time,crc:"0x"+o.toString(16).toUpperCase(),compressedSize:g(s),size:g(a),fileNameLength:g(u),extraLength:g(l),commentLength:g(c),diskNumStart:f,inAttr:h,attr:d,offset:m,centralHeaderSize:g(H.CENHDR+u+l+c)}},toString:function(){return JSON.stringify(this.toJSON(),null," ")}}}});var LE=y((fue,NE)=>{var ts=es(),He=ts.Constants;NE.exports=function(){var t=0,e=0,r=0,n=0,i=0;return{get diskEntries(){return t},set diskEntries(o){t=e=o},get totalEntries(){return e},set totalEntries(o){e=t=o},get size(){return r},set size(o){r=o},get offset(){return n},set offset(o){n=o},get commentLength(){return i},set commentLength(o){i=o},get mainHeaderSize(){return He.ENDHDR+i},loadFromBinary:function(o){if((o.length!==He.ENDHDR||o.readUInt32LE(0)!==He.ENDSIG)&&(o.length<He.ZIP64HDR||o.readUInt32LE(0)!==He.ZIP64SIG))throw ts.Errors.INVALID_END();o.readUInt32LE(0)===He.ENDSIG?(t=o.readUInt16LE(He.ENDSUB),e=o.readUInt16LE(He.ENDTOT),r=o.readUInt32LE(He.ENDSIZ),n=o.readUInt32LE(He.ENDOFF),i=o.readUInt16LE(He.ENDCOM)):(t=ts.readBigUInt64LE(o,He.ZIP64SUB),e=ts.readBigUInt64LE(o,He.ZIP64TOT),r=ts.readBigUInt64LE(o,He.ZIP64SIZE),n=ts.readBigUInt64LE(o,He.ZIP64OFF),i=0)},toBinary:function(){var o=Buffer.alloc(He.ENDHDR+i);return o.writeUInt32LE(He.ENDSIG,0),o.writeUInt32LE(0,4),o.writeUInt16LE(t,He.ENDSUB),o.writeUInt16LE(e,He.ENDTOT),o.writeUInt32LE(r,He.ENDSIZ),o.writeUInt32LE(n,He.ENDOFF),o.writeUInt16LE(i,He.ENDCOM),o.fill(" ",He.ENDHDR),o},toJSON:function(){let o=function(s,a){let u=s.toString(16).toUpperCase();for(;u.length<a;)u="0"+u;return"0x"+u};return{diskEntries:t,totalEntries:e,size:r+" bytes",offset:o(n,4),commentLength:i}},toString:function(){return JSON.stringify(this.toJSON(),null," ")}}}});var ug=y(ag=>{ag.EntryHeader=jE();ag.MainHeader=LE()});var qE=y((hue,BE)=>{BE.exports=function(t){var e=require("zlib"),r={chunkSize:(parseInt(t.length/1024)+1)*1024};return{deflate:function(){return e.deflateRawSync(t,r)},deflateAsync:function(n){var i=e.createDeflateRaw(r),o=[],s=0;i.on("data",function(a){o.push(a),s+=a.length}),i.on("end",function(){var a=Buffer.alloc(s),u=0;a.fill(0);for(var l=0;l<o.length;l++){var c=o[l];c.copy(a,u),u+=c.length}n&&n(a)}),i.end(t)}}}});var UE=y((pue,ME)=>{var H4=+(process.versions?process.versions.node:"").split(".")[0]||0;ME.exports=function(t,e){var r=require("zlib");let n=H4>=15&&e>0?{maxOutputLength:e}:{};return{inflate:function(){return r.inflateRawSync(t,n)},inflateAsync:function(i){var o=r.createInflateRaw(n),s=[],a=0;o.on("data",function(u){s.push(u),a+=u.length}),o.on("end",function(){var u=Buffer.alloc(a),l=0;u.fill(0);for(var c=0;c<s.length;c++){var f=s[c];f.copy(u,l),l+=f.length}i&&i(u)}),o.end(t)}}}});var WE=y((mue,GE)=>{"use strict";var{randomFillSync:HE}=require("crypto"),V4=Bc(),z4=new Uint32Array(256).map((t,e)=>{for(let r=0;r<8;r++)(e&1)!==0?e=e>>>1^3988292384:e>>>=1;return e>>>0}),zE=(t,e)=>Math.imul(t,e)>>>0,VE=(t,e)=>z4[(t^e)&255]^t>>>8,du=()=>typeof HE=="function"?HE(Buffer.alloc(12)):du.node();du.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 qc={genSalt:du};function Mc(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])}Mc.prototype.updateKeys=function(t){let e=this.keys;return e[0]=VE(e[0],t),e[1]+=e[0]&255,e[1]=zE(e[1],134775813)+1,e[2]=VE(e[2],e[1]>>>24),t};Mc.prototype.next=function(){let t=(this.keys[2]|2)>>>0;return zE(t,t^1)>>8&255};function G4(t){let e=new Mc(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 W4(t){let e=new Mc(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 K4(t,e,r){if(!t||!Buffer.isBuffer(t)||t.length<12)return Buffer.alloc(0);let n=G4(r),i=n(t.slice(0,12)),o=(e.flags&8)===8?e.timeHighByte:e.crc>>>24;if(i[11]!==o)throw V4.WRONG_PASSWORD();return n(t.slice(12))}function Y4(t){Buffer.isBuffer(t)&&t.length>=12?qc.genSalt=function(){return t.slice(0,12)}:t==="node"?qc.genSalt=du.node:qc.genSalt=du}function J4(t,e,r,n=!1){t==null&&(t=Buffer.alloc(0)),Buffer.isBuffer(t)||(t=Buffer.from(t.toString()));let i=W4(r),o=qc.genSalt();o[11]=e.crc>>>24&255,n&&(o[10]=e.crc>>>16&255);let s=Buffer.alloc(t.length+12);return i(o,s),i(t,s,12)}GE.exports={decrypt:K4,encrypt:J4,_salter:Y4}});var KE=y(Uc=>{Uc.Deflater=qE();Uc.Inflater=UE();Uc.ZipCrypto=WE()});var cg=y((yue,YE)=>{var ve=es(),X4=ug(),Xe=ve.Constants,lg=KE();YE.exports=function(t,e){var r=new X4.EntryHeader,n=Buffer.alloc(0),i=Buffer.alloc(0),o=!1,s=null,a=Buffer.alloc(0),u=Buffer.alloc(0),l=!0;let c=t,f=typeof c.decoder=="object"?c.decoder:ve.decoder;l=f.hasOwnProperty("efs")?f.efs:!1;function h(){return!e||!(e instanceof Uint8Array)?Buffer.alloc(0):(u=r.loadLocalHeaderFromBinary(e),e.slice(r.realDataOffset,r.realDataOffset+r.compressedSize))}function d(g){if(r.flags_desc){let C={},A=r.realDataOffset+r.compressedSize;if(e.readUInt32LE(A)==Xe.LOCSIG||e.readUInt32LE(A)==Xe.CENSIG)throw ve.Errors.DESCRIPTOR_NOT_EXIST();if(e.readUInt32LE(A)==Xe.EXTSIG)C.crc=e.readUInt32LE(A+Xe.EXTCRC),C.compressedSize=e.readUInt32LE(A+Xe.EXTSIZ),C.size=e.readUInt32LE(A+Xe.EXTLEN);else if(e.readUInt16LE(A+12)===19280)C.crc=e.readUInt32LE(A+Xe.EXTCRC-4),C.compressedSize=e.readUInt32LE(A+Xe.EXTSIZ-4),C.size=e.readUInt32LE(A+Xe.EXTLEN-4);else throw ve.Errors.DESCRIPTOR_UNKNOWN();if(C.compressedSize!==r.compressedSize||C.size!==r.size||C.crc!==r.crc)throw ve.Errors.DESCRIPTOR_FAULTY();if(ve.crc32(g)!==C.crc)return!1}else if(ve.crc32(g)!==r.localHeader.crc)return!1;return!0}function m(g,C,A){if(typeof C>"u"&&typeof g=="string"&&(A=g,g=void 0),o)return g&&C&&C(Buffer.alloc(0),ve.Errors.DIRECTORY_CONTENT_ERROR()),Buffer.alloc(0);var T=h();if(T.length===0)return g&&C&&C(T),T;if(r.encrypted){if(typeof A!="string"&&!Buffer.isBuffer(A))throw ve.Errors.INVALID_PASS_PARAM();T=lg.ZipCrypto.decrypt(T,r,A)}var x=Buffer.alloc(r.size);switch(r.method){case ve.Constants.STORED:if(T.copy(x),d(x))return g&&C&&C(x),x;throw g&&C&&C(x,ve.Errors.BAD_CRC()),ve.Errors.BAD_CRC();case ve.Constants.DEFLATED:var L=new lg.Inflater(T,r.size);if(g)L.inflateAsync(function(S){S.copy(S,0),C&&(d(S)?C(S):C(S,ve.Errors.BAD_CRC()))});else{if(L.inflate(x).copy(x,0),!d(x))throw ve.Errors.BAD_CRC(`"${f.decode(n)}"`);return x}break;default:throw g&&C&&C(Buffer.alloc(0),ve.Errors.UNKNOWN_METHOD()),ve.Errors.UNKNOWN_METHOD()}}function b(g,C){if((!s||!s.length)&&Buffer.isBuffer(e))return g&&C&&C(h()),h();if(s.length&&!o){var A;switch(r.method){case ve.Constants.STORED:return r.compressedSize=r.size,A=Buffer.alloc(s.length),s.copy(A),g&&C&&C(A),A;default:case ve.Constants.DEFLATED:var T=new lg.Deflater(s);if(g)T.deflateAsync(function(L){A=Buffer.alloc(L.length),r.compressedSize=L.length,L.copy(A),C&&C(A)});else{var x=T.deflate();return r.compressedSize=x.length,x}T=null;break}}else if(g&&C)C(Buffer.alloc(0));else return Buffer.alloc(0)}function D(g,C){return(g.readUInt32LE(C+4)<<4)+g.readUInt32LE(C)}function _(g){try{for(var C=0,A,T,x;C+4<g.length;)A=g.readUInt16LE(C),C+=2,T=g.readUInt16LE(C),C+=2,x=g.slice(C,C+T),C+=T,Xe.ID_ZIP64===A&&F(x)}catch{throw ve.Errors.EXTRA_FIELD_PARSE_ERROR()}}function F(g){var C,A,T,x;g.length>=Xe.EF_ZIP64_SCOMP&&(C=D(g,Xe.EF_ZIP64_SUNCOMP),r.size===Xe.EF_ZIP64_OR_32&&(r.size=C)),g.length>=Xe.EF_ZIP64_RHO&&(A=D(g,Xe.EF_ZIP64_SCOMP),r.compressedSize===Xe.EF_ZIP64_OR_32&&(r.compressedSize=A)),g.length>=Xe.EF_ZIP64_DSN&&(T=D(g,Xe.EF_ZIP64_RHO),r.offset===Xe.EF_ZIP64_OR_32&&(r.offset=T)),g.length>=Xe.EF_ZIP64_DSN+4&&(x=g.readUInt32LE(Xe.EF_ZIP64_DSN),r.diskNumStart===Xe.EF_ZIP64_OR_16&&(r.diskNumStart=x))}return{get entryName(){return f.decode(n)},get rawEntryName(){return n},set entryName(g){n=ve.toBuffer(g,f.encode);var C=n[n.length-1];o=C===47||C===92,r.fileNameLength=n.length},get efs(){return typeof l=="function"?l(this.entryName):l},get extra(){return a},set extra(g){a=g,r.extraLength=g.length,_(g)},get comment(){return f.decode(i)},set comment(g){if(i=ve.toBuffer(g,f.encode),r.commentLength=i.length,i.length>65535)throw ve.Errors.COMMENT_TOO_LONG()},get name(){var g=f.decode(n);return o?g.substr(g.length-1).split("/").pop():g.split("/").pop()},get isDirectory(){return o},getCompressedData:function(){return b(!1,null)},getCompressedDataAsync:function(g){b(!0,g)},setData:function(g){s=ve.toBuffer(g,ve.decoder.encode),!o&&s.length?(r.size=s.length,r.method=ve.Constants.DEFLATED,r.crc=ve.crc32(g),r.changed=!0):r.method=ve.Constants.STORED},getData:function(g){return r.changed?s:m(!1,null,g)},getDataAsync:function(g,C){r.changed?g(s):m(!0,g,C)},set attr(g){r.attr=g},get attr(){return r.attr},set header(g){r.loadFromBinary(g)},get header(){return r},packCentralHeader:function(){r.flags_efs=this.efs,r.extraLength=a.length;var g=r.centralHeaderToBinary(),C=ve.Constants.CENHDR;return n.copy(g,C),C+=n.length,a.copy(g,C),C+=r.extraLength,i.copy(g,C),g},packLocalHeader:function(){let g=0;r.flags_efs=this.efs,r.extraLocalLength=u.length;let C=r.localHeaderToBinary(),A=Buffer.alloc(C.length+n.length+r.extraLocalLength);return C.copy(A,g),g+=C.length,n.copy(A,g),g+=n.length,u.copy(A,g),g+=u.length,A},toJSON:function(){let g=function(C){return"<"+(C&&C.length+" bytes buffer"||"null")+">"};return{entryName:this.entryName,name:this.name,comment:this.comment,isDirectory:this.isDirectory,header:r.toJSON(),compressedData:g(e),data:g(s)}},toString:function(){return JSON.stringify(this.toJSON(),null," ")}}}});var ZE=y((Due,XE)=>{var JE=cg(),Z4=ug(),bt=es();XE.exports=function(t,e){var r=[],n={},i=Buffer.alloc(0),o=new Z4.MainHeader,s=!1,a=null;let u=new Set,l=e,{noSort:c,decoder:f}=l;t?m(l.readEntries):s=!0;function h(){let D=new Set;for(let _ of Object.keys(n)){let F=_.split("/");if(F.pop(),!!F.length)for(let g=0;g<F.length;g++){let C=F.slice(0,g+1).join("/")+"/";D.add(C)}}for(let _ of D)if(!(_ in n)){let F=new JE(l);F.entryName=_,F.attr=16,F.temporary=!0,r.push(F),n[F.entryName]=F,u.add(F)}}function d(){if(s=!0,n={},o.diskEntries>(t.length-o.offset)/bt.Constants.CENHDR)throw bt.Errors.DISK_ENTRY_TOO_LARGE();r=new Array(o.diskEntries);for(var D=o.offset,_=0;_<r.length;_++){var F=D,g=new JE(l,t);g.header=t.slice(F,F+=bt.Constants.CENHDR),g.entryName=t.slice(F,F+=g.header.fileNameLength),g.header.extraLength&&(g.extra=t.slice(F,F+=g.header.extraLength)),g.header.commentLength&&(g.comment=t.slice(F,F+g.header.commentLength)),D+=g.header.centralHeaderSize,r[_]=g,n[g.entryName]=g}u.clear(),h()}function m(D){var _=t.length-bt.Constants.ENDHDR,F=Math.max(0,_-65535),g=F,C=t.length,A=-1,T=0;for((typeof l.trailingSpace=="boolean"?l.trailingSpace:!1)&&(F=0),_;_>=g;_--)if(t[_]===80){if(t.readUInt32LE(_)===bt.Constants.ENDSIG){A=_,T=_,C=_+bt.Constants.ENDHDR,g=_-bt.Constants.END64HDR;continue}if(t.readUInt32LE(_)===bt.Constants.END64SIG){g=F;continue}if(t.readUInt32LE(_)===bt.Constants.ZIP64SIG){A=_,C=_+bt.readBigUInt64LE(t,_+bt.Constants.ZIP64SIZE)+bt.Constants.ZIP64LEAD;break}}if(A==-1)throw bt.Errors.INVALID_FORMAT();o.loadFromBinary(t.slice(A,C)),o.commentLength&&(i=t.slice(T+bt.Constants.ENDHDR)),D&&d()}function b(){r.length>1&&!c&&r.sort((D,_)=>D.entryName.toLowerCase().localeCompare(_.entryName.toLowerCase()))}return{get entries(){return s||d(),r.filter(D=>!u.has(D))},get comment(){return f.decode(i)},set comment(D){i=bt.toBuffer(D,f.encode),o.commentLength=i.length},getEntryCount:function(){return s?r.length:o.diskEntries},forEach:function(D){this.entries.forEach(D)},getEntry:function(D){return s||d(),n[D]||null},setEntry:function(D){s||d(),r.push(D),n[D.entryName]=D,o.totalEntries=r.length},deleteFile:function(D,_=!0){s||d();let F=n[D];this.getEntryChildren(F,_).map(C=>C.entryName).forEach(this.deleteEntry)},deleteEntry:function(D){s||d();let _=n[D],F=r.indexOf(_);F>=0&&(r.splice(F,1),delete n[D],o.totalEntries=r.length)},getEntryChildren:function(D,_=!0){if(s||d(),typeof D=="object")if(D.isDirectory&&_){let F=[],g=D.entryName;for(let C of r)C.entryName.startsWith(g)&&F.push(C);return F}else return[D];return[]},getChildCount:function(D){if(D&&D.isDirectory){let _=this.getEntryChildren(D);return _.includes(D)?_.length-1:_.length}return 0},compressToBuffer:function(){s||d(),b();let D=[],_=[],F=0,g=0;o.size=0,o.offset=0;let C=0;for(let x of this.entries){let L=x.getCompressedData();x.header.offset=g;let S=x.packLocalHeader(),I=S.length+L.length;g+=I,D.push(S),D.push(L);let $=x.packCentralHeader();_.push($),o.size+=$.length,F+=I+$.length,C++}F+=o.mainHeaderSize,o.offset=g,o.totalEntries=C,g=0;let A=Buffer.alloc(F);for(let x of D)x.copy(A,g),g+=x.length;for(let x of _)x.copy(A,g),g+=x.length;let T=o.toBinary();return i&&i.copy(T,bt.Constants.ENDHDR),T.copy(A,g),t=A,s=!1,A},toAsyncBuffer:function(D,_,F,g){try{s||d(),b();let C=[],A=[],T=0,x=0,L=0;o.size=0,o.offset=0;let S=function(I){if(I.length>0){let $=I.shift(),B=$.entryName+$.extra.toString();F&&F(B),$.getCompressedDataAsync(function(q){g&&g(B),$.header.offset=x;let K=$.packLocalHeader(),V=K.length+q.length;x+=V,C.push(K),C.push(q);let E=$.packCentralHeader();A.push(E),o.size+=E.length,T+=V+E.length,L++,S(I)})}else{T+=o.mainHeaderSize,o.offset=x,o.totalEntries=L,x=0;let $=Buffer.alloc(T);C.forEach(function(q){q.copy($,x),x+=q.length}),A.forEach(function(q){q.copy($,x),x+=q.length});let B=o.toBinary();i&&i.copy(B,bt.Constants.ENDHDR),B.copy($,x),t=$,s=!1,D($)}};S(Array.from(this.entries))}catch(C){_(C)}}}}});var tC=y((vue,eC)=>{var Ve=es(),Ze=require("path"),Q4=cg(),e5=ZE(),Ai=(...t)=>Ve.findLast(t,e=>typeof e=="boolean"),QE=(...t)=>Ve.findLast(t,e=>typeof e=="string"),t5=(...t)=>Ve.findLast(t,e=>typeof e=="function"),r5={noSort:!1,readEntries:!1,method:Ve.Constants.NONE,fs:null};eC.exports=function(t,e){let r=null,n=Object.assign(Object.create(null),r5);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 e5(r,n),{canonical:s,sanitize:a,zipnamefix:u}=Ve;function l(d){if(d&&o){var m;if(typeof d=="string"&&(m=o.getEntry(Ze.posix.normalize(d))),typeof d=="object"&&typeof d.entryName<"u"&&typeof d.header<"u"&&(m=o.getEntry(d.entryName)),m)return m}return null}function c(d){let{join:m,normalize:b,sep:D}=Ze.posix;return m(".",b(D+d.split("\\").join(D)+D))}function f(d){return d instanceof RegExp?function(m){return function(b){return m.test(b)}}(d):typeof d!="function"?()=>!0:d}let h=(d,m)=>{let b=m.slice(-1);return b=b===i.sep?i.sep:"",Ze.relative(d,m)+b};return{readFile:function(d,m){var b=l(d);return b&&b.getData(m)||null},childCount:function(d){let m=l(d);if(m)return o.getChildCount(m)},readFileAsync:function(d,m){var b=l(d);b?b.getDataAsync(m):m(null,"getEntry failed for:"+d)},readAsText:function(d,m){var b=l(d);if(b){var D=b.getData();if(D&&D.length)return D.toString(m||"utf8")}return""},readAsTextAsync:function(d,m,b){var D=l(d);D?D.getDataAsync(function(_,F){if(F){m(_,F);return}_&&_.length?m(_.toString(b||"utf8")):m("")}):m("")},deleteFile:function(d,m=!0){var b=l(d);b&&o.deleteFile(b.entryName,m)},deleteEntry:function(d){var m=l(d);m&&o.deleteEntry(m.entryName)},addZipComment:function(d){o.comment=d},getZipComment:function(){return o.comment||""},addZipEntryComment:function(d,m){var b=l(d);b&&(b.comment=m)},getZipEntryComment:function(d){var m=l(d);return m&&m.comment||""},updateFile:function(d,m){var b=l(d);b&&b.setData(m)},addLocalFile:function(d,m,b,D){if(i.fs.existsSync(d)){m=m?c(m):"";let _=Ze.win32.basename(Ze.win32.normalize(d));m+=b||_;let F=i.fs.statSync(d),g=F.isFile()?i.fs.readFileSync(d):Buffer.alloc(0);F.isDirectory()&&(m+=i.sep),this.addFile(m,g,D,F)}else throw Ve.Errors.FILE_NOT_FOUND(d)},addLocalFileAsync:function(d,m){d=typeof d=="object"?d:{localPath:d};let b=Ze.resolve(d.localPath),{comment:D}=d,{zipPath:_,zipName:F}=d,g=this;i.fs.stat(b,function(C,A){if(C)return m(C,!1);_=_?c(_):"";let T=Ze.win32.basename(Ze.win32.normalize(b));if(_+=F||T,A.isFile())i.fs.readFile(b,function(x,L){return x?m(x,!1):(g.addFile(_,L,D,A),setImmediate(m,void 0,!0))});else if(A.isDirectory())return _+=i.sep,g.addFile(_,Buffer.alloc(0),D,A),setImmediate(m,void 0,!0)})},addLocalFolder:function(d,m,b){if(b=f(b),m=m?c(m):"",d=Ze.normalize(d),i.fs.existsSync(d)){let D=i.findFiles(d),_=this;if(D.length)for(let F of D){let g=Ze.join(m,h(d,F));b(g)&&_.addLocalFile(F,Ze.dirname(g))}}else throw Ve.Errors.FILE_NOT_FOUND(d)},addLocalFolderAsync:function(d,m,b,D){D=f(D),b=b?c(b):"",d=Ze.normalize(d);var _=this;i.fs.open(d,"r",function(F){if(F&&F.code==="ENOENT")m(void 0,Ve.Errors.FILE_NOT_FOUND(d));else if(F)m(void 0,F);else{var g=i.findFiles(d),C=-1,A=function(){if(C+=1,C<g.length){var T=g[C],x=h(d,T).split("\\").join("/");x=x.normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/[^\x20-\x7E]/g,""),D(x)?i.fs.stat(T,function(L,S){L&&m(void 0,L),S.isFile()?i.fs.readFile(T,function(I,$){I?m(void 0,I):(_.addFile(b+x,$,"",S),A())}):(_.addFile(b+x+"/",Buffer.alloc(0),"",S),A())}):process.nextTick(()=>{A()})}else m(!0,void 0)};A()}})},addLocalFolderAsync2:function(d,m){let b=this;d=typeof d=="object"?d:{localPath:d},localPath=Ze.resolve(c(d.localPath));let{zipPath:D,filter:_,namefix:F}=d;_ instanceof RegExp?_=function(A){return function(T){return A.test(T)}}(_):typeof _!="function"&&(_=function(){return!0}),D=D?c(D):"",F=="latin1"&&(F=A=>A.normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/[^\x20-\x7E]/g,"")),typeof F!="function"&&(F=A=>A);let g=A=>Ze.join(D,F(h(localPath,A))),C=A=>Ze.win32.basename(Ze.win32.normalize(F(A)));i.fs.open(localPath,"r",function(A){A&&A.code==="ENOENT"?m(void 0,Ve.Errors.FILE_NOT_FOUND(localPath)):A?m(void 0,A):i.findFilesAsync(localPath,function(T,x){if(T)return m(T);x=x.filter(L=>_(g(L))),x.length||m(void 0,!1),setImmediate(x.reverse().reduce(function(L,S){return function(I,$){if(I||$===!1)return setImmediate(L,I,!1);b.addLocalFileAsync({localPath:S,zipPath:Ze.dirname(g(S)),zipName:C(S)},L)}},m))})})},addLocalFolderPromise:function(d,m){return new Promise((b,D)=>{this.addLocalFolderAsync2(Object.assign({localPath:d},m),(_,F)=>{_&&D(_),F&&b(this)})})},addFile:function(d,m,b,D){d=u(d);let _=l(d),F=_!=null;F||(_=new Q4(n),_.entryName=d),_.comment=b||"";let g=typeof D=="object"&&D instanceof i.fs.Stats;g&&(_.header.time=D.mtime);var C=_.isDirectory?16:0;let A=_.isDirectory?16384:32768;return g?A|=4095&D.mode:typeof D=="number"?A|=4095&D:A|=_.isDirectory?493:420,C=(C|A<<16)>>>0,_.attr=C,_.setData(m),F||o.setEntry(_),_},getEntries:function(d){return o.password=d,o?o.entries:[]},getEntry:function(d){return l(d)},getEntryCount:function(){return o.getEntryCount()},forEach:function(d){return o.forEach(d)},extractEntryTo:function(d,m,b,D,_,F){D=Ai(!1,D),_=Ai(!1,_),b=Ai(!0,b),F=QE(_,F);var g=l(d);if(!g)throw Ve.Errors.NO_ENTRY();var C=s(g.entryName),A=a(m,F&&!g.isDirectory?F:b?C:Ze.basename(C));if(g.isDirectory){var T=o.getEntryChildren(g);return T.forEach(function(S){if(S.isDirectory)return;var I=S.getData();if(!I)throw Ve.Errors.CANT_EXTRACT_FILE();var $=s(S.entryName),B=a(m,b?$:Ze.basename($));let q=_?S.header.fileAttr:void 0;i.writeFileTo(B,I,D,q)}),!0}var x=g.getData(o.password);if(!x)throw Ve.Errors.CANT_EXTRACT_FILE();if(i.fs.existsSync(A)&&!D)throw Ve.Errors.CANT_OVERRIDE();let L=_?d.header.fileAttr:void 0;return i.writeFileTo(A,x,D,L),!0},test:function(d){if(!o)return!1;for(var m in o.entries)try{if(m.isDirectory)continue;var b=o.entries[m].getData(d);if(!b)return!1}catch{return!1}return!0},extractAllTo:function(d,m,b,D){if(b=Ai(!1,b),D=QE(b,D),m=Ai(!1,m),!o)throw Ve.Errors.NO_ZIP();o.entries.forEach(function(_){var F=a(d,s(_.entryName));if(_.isDirectory){i.makeDir(F);return}var g=_.getData(D);if(!g)throw Ve.Errors.CANT_EXTRACT_FILE();let C=b?_.header.fileAttr:void 0;i.writeFileTo(F,g,m,C);try{i.fs.utimesSync(F,_.header.time,_.header.time)}catch{throw Ve.Errors.CANT_EXTRACT_FILE()}})},extractAllToAsync:function(d,m,b,D){if(D=t5(m,b,D),b=Ai(!1,b),m=Ai(!1,m),!D)return new Promise((A,T)=>{this.extractAllToAsync(d,m,b,function(x){x?T(x):A(this)})});if(!o){D(Ve.Errors.NO_ZIP());return}d=Ze.resolve(d);let _=A=>a(d,Ze.normalize(s(A.entryName))),F=(A,T)=>new Error(A+': "'+T+'"'),g=[],C=[];o.entries.forEach(A=>{A.isDirectory?g.push(A):C.push(A)});for(let A of g){let T=_(A),x=b?A.header.fileAttr:void 0;try{i.makeDir(T),x&&i.fs.chmodSync(T,x),i.fs.utimesSync(T,A.header.time,A.header.time)}catch{D(F("Unable to create folder",T))}}C.reverse().reduce(function(A,T){return function(x){if(x)A(x);else{let L=Ze.normalize(s(T.entryName)),S=a(d,L);T.getDataAsync(function(I,$){if($)A($);else if(!I)A(Ve.Errors.CANT_EXTRACT_FILE());else{let B=b?T.header.fileAttr:void 0;i.writeFileToAsync(S,I,m,B,function(q){q||A(F("Unable to write file",S)),i.fs.utimes(S,T.header.time,T.header.time,function(K){K?A(F("Unable to set times",S)):A()})})}})}}},D)()},writeZip:function(d,m){if(arguments.length===1&&typeof d=="function"&&(m=d,d=""),!d&&n.filename&&(d=n.filename),!!d){var b=o.compressToBuffer();if(b){var D=i.writeFileTo(d,b,!0);typeof m=="function"&&m(D?null:new Error("failed"),"")}}},writeZipPromise:function(d,m){let{overwrite:b,perm:D}=Object.assign({overwrite:!0},m);return new Promise((_,F)=>{!d&&n.filename&&(d=n.filename),d||F("ADM-ZIP: ZIP File Name Missing"),this.toBufferPromise().then(g=>{let C=A=>A?_(A):F("ADM-ZIP: Wasn't able to write zip file");i.writeFileToAsync(d,g,b,D,C)},F)})},toBufferPromise:function(){return new Promise((d,m)=>{o.toAsyncBuffer(d,m)})},toBuffer:function(d,m,b,D){return typeof d=="function"?(o.toAsyncBuffer(d,m,b,D),null):o.compressToBuffer()}}}});var gC=y((Wue,mC)=>{var pC={};mC.exports=pC;var hC={reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29],black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],gray:[90,39],grey:[90,39],brightRed:[91,39],brightGreen:[92,39],brightYellow:[93,39],brightBlue:[94,39],brightMagenta:[95,39],brightCyan:[96,39],brightWhite:[97,39],bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgGray:[100,49],bgGrey:[100,49],bgBrightRed:[101,49],bgBrightGreen:[102,49],bgBrightYellow:[103,49],bgBrightBlue:[104,49],bgBrightMagenta:[105,49],bgBrightCyan:[106,49],bgBrightWhite:[107,49],blackBG:[40,49],redBG:[41,49],greenBG:[42,49],yellowBG:[43,49],blueBG:[44,49],magentaBG:[45,49],cyanBG:[46,49],whiteBG:[47,49]};Object.keys(hC).forEach(function(t){var e=hC[t],r=pC[t]=[];r.open="\x1B["+e[0]+"m",r.close="\x1B["+e[1]+"m"})});var DC=y((Kue,yC)=>{"use strict";yC.exports=function(t,e){e=e||process.argv;var r=e.indexOf("--"),n=/^-{1,2}/.test(t)?"":"--",i=e.indexOf(n+t);return i!==-1&&(r===-1?!0:i<r)}});var bC=y((Yue,vC)=>{"use strict";var u5=require("os"),Sr=DC(),kt=process.env,is=void 0;Sr("no-color")||Sr("no-colors")||Sr("color=false")?is=!1:(Sr("color")||Sr("colors")||Sr("color=true")||Sr("color=always"))&&(is=!0);"FORCE_COLOR"in kt&&(is=kt.FORCE_COLOR.length===0||parseInt(kt.FORCE_COLOR,10)!==0);function l5(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}function c5(t){if(is===!1)return 0;if(Sr("color=16m")||Sr("color=full")||Sr("color=truecolor"))return 3;if(Sr("color=256"))return 2;if(t&&!t.isTTY&&is!==!0)return 0;var e=is?1:0;if(process.platform==="win32"){var r=u5.release().split(".");return Number(process.versions.node.split(".")[0])>=8&&Number(r[0])>=10&&Number(r[2])>=10586?Number(r[2])>=14931?3:2:1}if("CI"in kt)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some(function(i){return i in kt})||kt.CI_NAME==="codeship"?1:e;if("TEAMCITY_VERSION"in kt)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(kt.TEAMCITY_VERSION)?1:0;if("TERM_PROGRAM"in kt){var n=parseInt((kt.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(kt.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Hyper":return 3;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(kt.TERM)?2:/^screen|^xterm|^vt100|^rxvt|color|ansi|cygwin|linux/i.test(kt.TERM)||"COLORTERM"in kt?1:(kt.TERM==="dumb",e)}function yg(t){var e=c5(t);return l5(e)}vC.exports={supportsColor:yg,stdout:yg(process.stdout),stderr:yg(process.stderr)}});var _C=y((Jue,wC)=>{wC.exports=function(e,r){var n="";e=e||"Run the trap, drop the bass",e=e.split("");var i={a:["@","\u0104","\u023A","\u0245","\u0394","\u039B","\u0414"],b:["\xDF","\u0181","\u0243","\u026E","\u03B2","\u0E3F"],c:["\xA9","\u023B","\u03FE"],d:["\xD0","\u018A","\u0500","\u0501","\u0502","\u0503"],e:["\xCB","\u0115","\u018E","\u0258","\u03A3","\u03BE","\u04BC","\u0A6C"],f:["\u04FA"],g:["\u0262"],h:["\u0126","\u0195","\u04A2","\u04BA","\u04C7","\u050A"],i:["\u0F0F"],j:["\u0134"],k:["\u0138","\u04A0","\u04C3","\u051E"],l:["\u0139"],m:["\u028D","\u04CD","\u04CE","\u0520","\u0521","\u0D69"],n:["\xD1","\u014B","\u019D","\u0376","\u03A0","\u048A"],o:["\xD8","\xF5","\xF8","\u01FE","\u0298","\u047A","\u05DD","\u06DD","\u0E4F"],p:["\u01F7","\u048E"],q:["\u09CD"],r:["\xAE","\u01A6","\u0210","\u024C","\u0280","\u042F"],s:["\xA7","\u03DE","\u03DF","\u03E8"],t:["\u0141","\u0166","\u0373"],u:["\u01B1","\u054D"],v:["\u05D8"],w:["\u0428","\u0460","\u047C","\u0D70"],x:["\u04B2","\u04FE","\u04FC","\u04FD"],y:["\xA5","\u04B0","\u04CB"],z:["\u01B5","\u0240"]};return e.forEach(function(o){o=o.toLowerCase();var s=i[o]||[" "],a=Math.floor(Math.random()*s.length);typeof i[o]<"u"?n+=i[o][a]:n+=o}),n}});var CC=y((Xue,EC)=>{EC.exports=function(e,r){e=e||" he is here ";var n={up:["\u030D","\u030E","\u0304","\u0305","\u033F","\u0311","\u0306","\u0310","\u0352","\u0357","\u0351","\u0307","\u0308","\u030A","\u0342","\u0313","\u0308","\u034A","\u034B","\u034C","\u0303","\u0302","\u030C","\u0350","\u0300","\u0301","\u030B","\u030F","\u0312","\u0313","\u0314","\u033D","\u0309","\u0363","\u0364","\u0365","\u0366","\u0367","\u0368","\u0369","\u036A","\u036B","\u036C","\u036D","\u036E","\u036F","\u033E","\u035B","\u0346","\u031A"],down:["\u0316","\u0317","\u0318","\u0319","\u031C","\u031D","\u031E","\u031F","\u0320","\u0324","\u0325","\u0326","\u0329","\u032A","\u032B","\u032C","\u032D","\u032E","\u032F","\u0330","\u0331","\u0332","\u0333","\u0339","\u033A","\u033B","\u033C","\u0345","\u0347","\u0348","\u0349","\u034D","\u034E","\u0353","\u0354","\u0355","\u0356","\u0359","\u035A","\u0323"],mid:["\u0315","\u031B","\u0300","\u0301","\u0358","\u0321","\u0322","\u0327","\u0328","\u0334","\u0335","\u0336","\u035C","\u035D","\u035E","\u035F","\u0360","\u0362","\u0338","\u0337","\u0361"," \u0489"]},i=[].concat(n.up,n.down,n.mid);function o(u){var l=Math.floor(Math.random()*u);return l}function s(u){var l=!1;return i.filter(function(c){l=c===u}),l}function a(u,l){var c="",f,h;l=l||{},l.up=typeof l.up<"u"?l.up:!0,l.mid=typeof l.mid<"u"?l.mid:!0,l.down=typeof l.down<"u"?l.down:!0,l.size=typeof l.size<"u"?l.size:"maxi",u=u.split("");for(h in u)if(!s(h)){switch(c=c+u[h],f={up:0,down:0,mid:0},l.size){case"mini":f.up=o(8),f.mid=o(2),f.down=o(8);break;case"maxi":f.up=o(16)+3,f.mid=o(4)+1,f.down=o(64)+3;break;default:f.up=o(8)+1,f.mid=o(6)/2,f.down=o(8)+1;break}var d=["up","mid","down"];for(var m in d)for(var b=d[m],D=0;D<=f[b];D++)l[b]&&(c=c+n[b][o(n[b].length)])}return c}return a(e,r)}});var xC=y((Zue,SC)=>{SC.exports=function(t){return function(e,r,n){if(e===" ")return e;switch(r%3){case 0:return t.red(e);case 1:return t.white(e);case 2:return t.blue(e)}}}});var OC=y((Que,FC)=>{FC.exports=function(t){return function(e,r,n){return r%2===0?e:t.inverse(e)}}});var kC=y((ele,AC)=>{AC.exports=function(t){var e=["red","yellow","green","blue","magenta"];return function(r,n,i){return r===" "?r:t[e[n++%e.length]](r)}}});var PC=y((tle,TC)=>{TC.exports=function(t){var e=["underline","inverse","grey","yellow","red","green","blue","white","cyan","magenta","brightYellow","brightRed","brightGreen","brightBlue","brightWhite","brightCyan","brightMagenta"];return function(r,n,i){return r===" "?r:t[e[Math.round(Math.random()*(e.length-2))]](r)}}});var LC=y((nle,NC)=>{var le={};NC.exports=le;le.themes={};var f5=require("util"),ki=le.styles=gC(),$C=Object.defineProperties,d5=new RegExp(/[\r\n]+/g);le.supportsColor=bC().supportsColor;typeof le.enabled>"u"&&(le.enabled=le.supportsColor()!==!1);le.enable=function(){le.enabled=!0};le.disable=function(){le.enabled=!1};le.stripColors=le.strip=function(t){return(""+t).replace(/\x1B\[\d+m/g,"")};var rle=le.stylize=function(e,r){if(!le.enabled)return e+"";var n=ki[r];return!n&&r in le?le[r](e):n.open+e+n.close},h5=/[|\\{}()[\]^$+*?.]/g,p5=function(t){if(typeof t!="string")throw new TypeError("Expected a string");return t.replace(h5,"\\$&")};function IC(t){var e=function r(){return g5.apply(r,arguments)};return e._styles=t,e.__proto__=m5,e}var jC=function(){var t={};return ki.grey=ki.gray,Object.keys(ki).forEach(function(e){ki[e].closeRe=new RegExp(p5(ki[e].close),"g"),t[e]={get:function(){return IC(this._styles.concat(e))}}}),t}(),m5=$C(function(){},jC);function g5(){var t=Array.prototype.slice.call(arguments),e=t.map(function(s){return s!=null&&s.constructor===String?s:f5.inspect(s)}).join(" ");if(!le.enabled||!e)return e;for(var r=e.indexOf(`
22
- `)!=-1,n=this._styles,i=n.length;i--;){var o=ki[n[i]];e=o.open+e.replace(o.closeRe,o.open)+o.close,r&&(e=e.replace(d5,function(s){return o.close+s+o.open}))}return e}le.setTheme=function(t){if(typeof t=="string"){console.log("colors.setTheme now only accepts an object, not a string. If you are trying to set a theme from a file, it is now your (the caller's) responsibility to require the file. The old syntax looked like colors.setTheme(__dirname + '/../themes/generic-logging.js'); The new syntax looks like colors.setTheme(require(__dirname + '/../themes/generic-logging.js'));");return}for(var e in t)(function(r){le[r]=function(n){if(typeof t[r]=="object"){var i=n;for(var o in t[r])i=le[t[r][o]](i);return i}return le[t[r]](n)}})(e)};function y5(){var t={};return Object.keys(jC).forEach(function(e){t[e]={get:function(){return IC([e])}}}),t}var D5=function(e,r){var n=r.split("");return n=n.map(e),n.join("")};le.trap=_C();le.zalgo=CC();le.maps={};le.maps.america=xC()(le);le.maps.zebra=OC()(le);le.maps.rainbow=kC()(le);le.maps.random=PC()(le);for(RC in le.maps)(function(t){le[t]=function(e){return D5(le.maps[t],e)}})(RC);var RC;$C(le,y5())});var qC=y((ile,BC)=>{var v5=LC();BC.exports=v5});var MC=y(Dg=>{"use strict";Dg.indent=function(e){return new Array(e+1).join(" ")};Dg.getMaxIndexLength=function(t){var e=0;return Object.getOwnPropertyNames(t).forEach(function(r){t[r]!==void 0&&(e=Math.max(e,r.length))}),e}});var UC=y((sle,b5)=>{b5.exports={author:"Rafael de Oleza <rafeca@gmail.com> (https://github.com/rafeca)",name:"prettyjson",description:"Package for formatting JSON data in a coloured YAML-style, perfect for CLI output",version:"1.2.5",homepage:"http://rafeca.com/prettyjson",keywords:["json","cli","formatting","colors"],repository:{type:"git",url:"https://github.com/rafeca/prettyjson.git"},bugs:{url:"https://github.com/rafeca/prettyjson/issues"},main:"./lib/prettyjson",files:["bin/prettyjson","lib/*.js"],license:"MIT",scripts:{test:"npm run jshint && mocha --reporter spec",testwin:"node ./node_modules/mocha/bin/mocha --reporter spec",jshint:"jshint lib/*.js test/*.js",coverage:"istanbul cover _mocha --report lcovonly -- -R spec",coveralls:"npm run coverage && cat ./coverage/lcov.info | coveralls && rm -rf ./coverage",changelog:"git log $(git describe --tags --abbrev=0)..HEAD --pretty='* %s' --first-parent"},bin:{prettyjson:"./bin/prettyjson"},dependencies:{colors:"1.4.0",minimist:"^1.2.0"},devDependencies:{coveralls:"^2.11.15",istanbul:"^0.4.5",jshint:"^2.9.4",mocha:"^3.1.2","mocha-lcov-reporter":"^1.2.0",should:"^11.1.1"}}});var HC=y(mu=>{"use strict";var Mr=qC(),Kn=MC(),w5=/[^\w\s\n\r\v\t\.,]/i;mu.version=UC().version;var vg=function(t,e){return t!==void 0||e.renderUndefined},Wc=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(`
21
+ `)}),this}_outputHelpIfRequested(e){let r=this._getHelpOption();r&&e.find(i=>r.is(i))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function Nb(t){return t.map(e=>{if(!e.startsWith("--inspect"))return e;let r,n="127.0.0.1",i="9229",o;return(o=e.match(/^(--inspect(-brk)?)$/))!==null?r=o[1]:(o=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(r=o[1],/^\d+$/.test(o[3])?i=o[3]:n=o[3]):(o=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(r=o[1],n=o[3],i=o[4]),r&&i!=="0"?`${r}=${n}:${parseInt(i)+1}`:e})}function ap(){if(De.env.NO_COLOR||De.env.FORCE_COLOR==="0"||De.env.FORCE_COLOR==="false")return!1;if(De.env.FORCE_COLOR||De.env.CLICOLOR_FORCE!==void 0)return!0}up.Command=sp;up.useColor=ap});var Ub=D(lr=>{var{Argument:Bb}=Hl(),{Command:lp}=Lb(),{CommanderError:cN,InvalidArgumentError:qb}=Oa(),{Help:fN}=Qh(),{Option:Mb}=np();lr.program=new lp;lr.createCommand=t=>new lp(t);lr.createOption=(t,e)=>new Mb(t,e);lr.createArgument=(t,e)=>new Bb(t,e);lr.Command=lp;lr.Option=Mb;lr.Argument=Bb;lr.Help=fN;lr.CommanderError=cN;lr.InvalidArgumentError=qb;lr.InvalidOptionArgumentError=qb});var Te=D((_se,Vb)=>{"use strict";var cp="\x1B",Me=`${cp}[`,hN="\x07",fp={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:`${cp}7`,restore:`${cp}8`},pN={up:(t=1)=>`${Me}S`.repeat(t),down:(t=1)=>`${Me}T`.repeat(t)},mN={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?fp.up():"");return t&&(e+=fp.left),e}};Vb.exports={cursor:fp,scroll:pN,erase:mN,beep:hN}});var hp=D((Ese,dp)=>{var Gl=process||{},zb=Gl.argv||[],zl=Gl.env||{},gN=!(zl.NO_COLOR||zb.includes("--no-color"))&&(!!zl.FORCE_COLOR||zb.includes("--color")||Gl.platform==="win32"||(Gl.stdout||{}).isTTY&&zl.TERM!=="dumb"||!!zl.CI),yN=(t,e,r=t)=>n=>{let i=""+n,o=i.indexOf(e,t.length);return~o?t+DN(i,e,r,o)+e:t+i+e},DN=(t,e,r,n)=>{let i="",o=0;do i+=t.substring(o,n)+r,o=n+e.length,n=t.indexOf(e,o);while(~n);return i+t.substring(o)},Gb=(t=gN)=>{let e=t?yN:()=>String;return{isColorSupported:t,reset:e("\x1B[0m","\x1B[0m"),bold:e("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:e("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:e("\x1B[3m","\x1B[23m"),underline:e("\x1B[4m","\x1B[24m"),inverse:e("\x1B[7m","\x1B[27m"),hidden:e("\x1B[8m","\x1B[28m"),strikethrough:e("\x1B[9m","\x1B[29m"),black:e("\x1B[30m","\x1B[39m"),red:e("\x1B[31m","\x1B[39m"),green:e("\x1B[32m","\x1B[39m"),yellow:e("\x1B[33m","\x1B[39m"),blue:e("\x1B[34m","\x1B[39m"),magenta:e("\x1B[35m","\x1B[39m"),cyan:e("\x1B[36m","\x1B[39m"),white:e("\x1B[37m","\x1B[39m"),gray:e("\x1B[90m","\x1B[39m"),bgBlack:e("\x1B[40m","\x1B[49m"),bgRed:e("\x1B[41m","\x1B[49m"),bgGreen:e("\x1B[42m","\x1B[49m"),bgYellow:e("\x1B[43m","\x1B[49m"),bgBlue:e("\x1B[44m","\x1B[49m"),bgMagenta:e("\x1B[45m","\x1B[49m"),bgCyan:e("\x1B[46m","\x1B[49m"),bgWhite:e("\x1B[47m","\x1B[49m"),blackBright:e("\x1B[90m","\x1B[39m"),redBright:e("\x1B[91m","\x1B[39m"),greenBright:e("\x1B[92m","\x1B[39m"),yellowBright:e("\x1B[93m","\x1B[39m"),blueBright:e("\x1B[94m","\x1B[39m"),magentaBright:e("\x1B[95m","\x1B[39m"),cyanBright:e("\x1B[96m","\x1B[39m"),whiteBright:e("\x1B[97m","\x1B[39m"),bgBlackBright:e("\x1B[100m","\x1B[49m"),bgRedBright:e("\x1B[101m","\x1B[49m"),bgGreenBright:e("\x1B[102m","\x1B[49m"),bgYellowBright:e("\x1B[103m","\x1B[49m"),bgBlueBright:e("\x1B[104m","\x1B[49m"),bgMagentaBright:e("\x1B[105m","\x1B[49m"),bgCyanBright:e("\x1B[106m","\x1B[49m"),bgWhiteBright:e("\x1B[107m","\x1B[49m")}};dp.exports=Gb();dp.exports.createColors=Gb});var rc=D(Bt=>{"use strict";Object.defineProperty(Bt,"__esModule",{value:!0});Bt.isNXMonorepo=Bt.isMonorepo=Bt.findPackageRelativePathInMonorepo=Bt.findPackagePath=Bt.findNXMonorepoRoot=Bt.findMonorepoRoot=void 0;var Ta=require("node:fs"),Bn=require("node:path");function tc(t){let e=(0,Bn.join)(t,"package.json"),r=(0,Bn.join)(t,"pnpm-workspace.yaml");if((0,Ta.existsSync)(r)||(0,Ta.existsSync)(e)&&JSON.parse((0,Ta.readFileSync)(e,"utf-8")).workspaces)return t;let n=(0,Bn.dirname)(t);if(n===t)throw new Error("Monorepo root not found");return tc(n)}Bt.findMonorepoRoot=tc;function xp(t){let e=(0,Bn.join)(t,"nx.json");if((0,Ta.existsSync)(e))return t;let r=(0,Bn.dirname)(t);if(r===t)throw new Error("Monorepo root not found");return xp(r)}Bt.findNXMonorepoRoot=xp;function Fp(t,e,r){let n=(0,Bn.join)(e,"node_modules",t);if((0,Ta.existsSync)(n))return n;if(e===r)return null;let i=(0,Bn.dirname)(e);return Fp(t,i,r)}Bt.findPackagePath=Fp;function YN(t,e){let r=tc(e),n=Fp(t,e,r);return n?(0,Bn.relative)(e,n):null}Bt.findPackageRelativePathInMonorepo=YN;function JN(t){try{return tc(t),!0}catch{return!1}}Bt.isMonorepo=JN;function XN(t){try{return xp(t),!0}catch{return!1}}Bt.isNXMonorepo=XN});var vi={};gi(vi,{default:()=>ZN});var ZN,bi=Ct(()=>{ZN={}});var fw=D(Pr=>{"use strict";var QN=Pr&&Pr.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),eL=Pr&&Pr.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),tL=Pr&&Pr.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&QN(e,t,r);return eL(e,t),e};Object.defineProperty(Pr,"__esModule",{value:!0});Pr.resolveFetch=void 0;var rL=t=>{let e;return t?e=t:typeof fetch>"u"?e=(...r)=>Promise.resolve().then(()=>tL((bi(),je(vi)))).then(({default:n})=>n(...r)):e=fetch,(...r)=>e(...r)};Pr.resolveFetch=rL});var Tp=D(er=>{"use strict";Object.defineProperty(er,"__esModule",{value:!0});er.FunctionRegion=er.FunctionsHttpError=er.FunctionsRelayError=er.FunctionsFetchError=er.FunctionsError=void 0;var jo=class extends Error{constructor(e,r="FunctionsError",n){super(e),this.name=r,this.context=n}};er.FunctionsError=jo;var Op=class extends jo{constructor(e){super("Failed to send a request to the Edge Function","FunctionsFetchError",e)}};er.FunctionsFetchError=Op;var Ap=class extends jo{constructor(e){super("Relay Error invoking the Edge Function","FunctionsRelayError",e)}};er.FunctionsRelayError=Ap;var kp=class extends jo{constructor(e){super("Edge Function returned a non-2xx status code","FunctionsHttpError",e)}};er.FunctionsHttpError=kp;var nL;(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"})(nL=er.FunctionRegion||(er.FunctionRegion={}))});var dw=D(No=>{"use strict";var iL=No&&No.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(c){try{l(n.next(c))}catch(f){s(f)}}function u(c){try{l(n.throw(c))}catch(f){s(f)}}function l(c){c.done?o(c.value):i(c.value).then(a,u)}l((n=n.apply(t,e||[])).next())})};Object.defineProperty(No,"__esModule",{value:!0});No.FunctionsClient=void 0;var oL=fw(),ic=Tp(),Pp=class{constructor(e,{headers:r={},customFetch:n,region:i=ic.FunctionRegion.Any}={}){this.url=e,this.headers=r,this.region=i,this.fetch=(0,oL.resolveFetch)(n)}setAuth(e){this.headers.Authorization=`Bearer ${e}`}invoke(e,r={}){var n;return iL(this,void 0,void 0,function*(){try{let{headers:i,method:o,body:s}=r,a={},{region:u}=r;u||(u=this.region),u&&u!=="any"&&(a["x-region"]=u);let l;s&&(i&&!Object.prototype.hasOwnProperty.call(i,"Content-Type")||!i)&&(typeof Blob<"u"&&s instanceof Blob||s instanceof ArrayBuffer?(a["Content-Type"]="application/octet-stream",l=s):typeof s=="string"?(a["Content-Type"]="text/plain",l=s):typeof FormData<"u"&&s instanceof FormData?l=s:(a["Content-Type"]="application/json",l=JSON.stringify(s)));let c=yield this.fetch(`${this.url}/${e}`,{method:o||"POST",headers:Object.assign(Object.assign(Object.assign({},a),this.headers),i),body:l}).catch(m=>{throw new ic.FunctionsFetchError(m)}),f=c.headers.get("x-relay-error");if(f&&f==="true")throw new ic.FunctionsRelayError(c);if(!c.ok)throw new ic.FunctionsHttpError(c);let h=((n=c.headers.get("Content-Type"))!==null&&n!==void 0?n:"text/plain").split(";")[0].trim(),d;return h==="application/json"?d=yield c.json():h==="application/octet-stream"?d=yield c.blob():h==="text/event-stream"?d=c:h==="multipart/form-data"?d=yield c.formData():d=yield c.text(),{data:d,error:null}}catch(i){return{data:null,error:i}}})}};No.FunctionsClient=Pp});var Rp=D(qt=>{"use strict";Object.defineProperty(qt,"__esModule",{value:!0});qt.FunctionRegion=qt.FunctionsRelayError=qt.FunctionsHttpError=qt.FunctionsFetchError=qt.FunctionsError=qt.FunctionsClient=void 0;var sL=dw();Object.defineProperty(qt,"FunctionsClient",{enumerable:!0,get:function(){return sL.FunctionsClient}});var Ra=Tp();Object.defineProperty(qt,"FunctionsError",{enumerable:!0,get:function(){return Ra.FunctionsError}});Object.defineProperty(qt,"FunctionsFetchError",{enumerable:!0,get:function(){return Ra.FunctionsFetchError}});Object.defineProperty(qt,"FunctionsHttpError",{enumerable:!0,get:function(){return Ra.FunctionsHttpError}});Object.defineProperty(qt,"FunctionsRelayError",{enumerable:!0,get:function(){return Ra.FunctionsRelayError}});Object.defineProperty(qt,"FunctionRegion",{enumerable:!0,get:function(){return Ra.FunctionRegion}})});var jp=D(Ip=>{"use strict";Object.defineProperty(Ip,"__esModule",{value:!0});var $p=class extends Error{constructor(e){super(e.message),this.name="PostgrestError",this.details=e.details,this.hint=e.hint,this.code=e.code}};Ip.default=$p});var Lp=D($a=>{"use strict";var hw=$a&&$a.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty($a,"__esModule",{value:!0});var aL=hw((bi(),je(vi))),uL=hw(jp()),Np=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=aL.default:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(e,r){return this.headers=Object.assign({},this.headers),this.headers[e]=r,this}then(e,r){this.schema===void 0||(["GET","HEAD"].includes(this.method)?this.headers["Accept-Profile"]=this.schema:this.headers["Content-Profile"]=this.schema),this.method!=="GET"&&this.method!=="HEAD"&&(this.headers["Content-Type"]="application/json");let n=this.fetch,i=n(this.url.toString(),{method:this.method,headers:this.headers,body:JSON.stringify(this.body),signal:this.signal}).then(async o=>{var s,a,u;let l=null,c=null,f=null,h=o.status,d=o.statusText;if(o.ok){if(this.method!=="HEAD"){let E=await o.text();E===""||(this.headers.Accept==="text/csv"||this.headers.Accept&&this.headers.Accept.includes("application/vnd.pgrst.plan+text")?c=E:c=JSON.parse(E))}let b=(s=this.headers.Prefer)===null||s===void 0?void 0:s.match(/count=(exact|planned|estimated)/),y=(a=o.headers.get("content-range"))===null||a===void 0?void 0:a.split("/");b&&y&&y.length>1&&(f=parseInt(y[1])),this.isMaybeSingle&&this.method==="GET"&&Array.isArray(c)&&(c.length>1?(l={code:"PGRST116",details:`Results contain ${c.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},c=null,f=null,h=406,d="Not Acceptable"):c.length===1?c=c[0]:c=null)}else{let b=await o.text();try{l=JSON.parse(b),Array.isArray(l)&&o.status===404&&(c=[],l=null,h=200,d="OK")}catch{o.status===404&&b===""?(h=204,d="No Content"):l={message:b}}if(l&&this.isMaybeSingle&&(!((u=l?.details)===null||u===void 0)&&u.includes("0 rows"))&&(l=null,h=200,d="OK"),l&&this.shouldThrowOnError)throw new uL.default(l)}return{error:l,data:c,count:f,status:h,statusText:d}});return this.shouldThrowOnError||(i=i.catch(o=>{var s,a,u;return{error:{message:`${(s=o?.name)!==null&&s!==void 0?s:"FetchError"}: ${o?.message}`,details:`${(a=o?.stack)!==null&&a!==void 0?a:""}`,hint:"",code:`${(u=o?.code)!==null&&u!==void 0?u:""}`},data:null,count:null,status:0,statusText:""}})),i.then(e,r)}};$a.default=Np});var qp=D(Ia=>{"use strict";var lL=Ia&&Ia.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ia,"__esModule",{value:!0});var cL=lL(Lp()),Bp=class extends cL.default{select(e){let r=!1,n=(e??"*").split("").map(i=>/\s/.test(i)&&!r?"":(i==='"'&&(r=!r),i)).join("");return this.url.searchParams.set("select",n),this.headers.Prefer&&(this.headers.Prefer+=","),this.headers.Prefer+="return=representation",this}order(e,{ascending:r=!0,nullsFirst:n,foreignTable:i,referencedTable:o=i}={}){let s=o?`${o}.order`:"order",a=this.url.searchParams.get(s);return this.url.searchParams.set(s,`${a?`${a},`:""}${e}.${r?"asc":"desc"}${n===void 0?"":n?".nullsfirst":".nullslast"}`),this}limit(e,{foreignTable:r,referencedTable:n=r}={}){let i=typeof n>"u"?"limit":`${n}.limit`;return this.url.searchParams.set(i,`${e}`),this}range(e,r,{foreignTable:n,referencedTable:i=n}={}){let o=typeof i>"u"?"offset":`${i}.offset`,s=typeof i>"u"?"limit":`${i}.limit`;return this.url.searchParams.set(o,`${e}`),this.url.searchParams.set(s,`${r-e+1}`),this}abortSignal(e){return this.signal=e,this}single(){return this.headers.Accept="application/vnd.pgrst.object+json",this}maybeSingle(){return this.method==="GET"?this.headers.Accept="application/json":this.headers.Accept="application/vnd.pgrst.object+json",this.isMaybeSingle=!0,this}csv(){return this.headers.Accept="text/csv",this}geojson(){return this.headers.Accept="application/geo+json",this}explain({analyze:e=!1,verbose:r=!1,settings:n=!1,buffers:i=!1,wal:o=!1,format:s="text"}={}){var a;let u=[e?"analyze":null,r?"verbose":null,n?"settings":null,i?"buffers":null,o?"wal":null].filter(Boolean).join("|"),l=(a=this.headers.Accept)!==null&&a!==void 0?a:"application/json";return this.headers.Accept=`application/vnd.pgrst.plan+${s}; for="${l}"; options=${u};`,s==="json"?this:this}rollback(){var e;return((e=this.headers.Prefer)!==null&&e!==void 0?e:"").trim().length>0?this.headers.Prefer+=",tx=rollback":this.headers.Prefer="tx=rollback",this}returns(){return this}};Ia.default=Bp});var oc=D(ja=>{"use strict";var fL=ja&&ja.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ja,"__esModule",{value:!0});var dL=fL(qp()),Mp=class extends dL.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}};ja.default=Mp});var Hp=D(La=>{"use strict";var hL=La&&La.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(La,"__esModule",{value:!0});var Na=hL(oc()),Up=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 Na.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 Na.default({method:i,url:this.url,headers:this.headers,schema:this.schema,body:e,fetch:this.fetch,allowEmpty:!1})}upsert(e,{onConflict:r,ignoreDuplicates:n=!1,count:i,defaultToNull:o=!0}={}){let s="POST",a=[`resolution=${n?"ignore":"merge"}-duplicates`];if(r!==void 0&&this.url.searchParams.set("on_conflict",r),this.headers.Prefer&&a.push(this.headers.Prefer),i&&a.push(`count=${i}`),o||a.push("missing=default"),this.headers.Prefer=a.join(","),Array.isArray(e)){let u=e.reduce((l,c)=>l.concat(Object.keys(c)),[]);if(u.length>0){let l=[...new Set(u)].map(c=>`"${c}"`);this.url.searchParams.set("columns",l.join(","))}}return new Na.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 Na.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 Na.default({method:r,url:this.url,headers:this.headers,schema:this.schema,fetch:this.fetch,allowEmpty:!1})}};La.default=Up});var pw=D(sc=>{"use strict";Object.defineProperty(sc,"__esModule",{value:!0});sc.version=void 0;sc.version="0.0.0-automated"});var mw=D(ac=>{"use strict";Object.defineProperty(ac,"__esModule",{value:!0});ac.DEFAULT_HEADERS=void 0;var pL=pw();ac.DEFAULT_HEADERS={"X-Client-Info":`postgrest-js/${pL.version}`}});var yw=D(Ba=>{"use strict";var gw=Ba&&Ba.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ba,"__esModule",{value:!0});var mL=gw(Hp()),gL=gw(oc()),yL=mw(),Vp=class t{constructor(e,{headers:r={},schema:n,fetch:i}={}){this.url=e,this.headers=Object.assign(Object.assign({},yL.DEFAULT_HEADERS),r),this.schemaName=n,this.fetch=i}from(e){let r=new URL(`${this.url}/${e}`);return new mL.default(r,{headers:Object.assign({},this.headers),schema:this.schemaName,fetch:this.fetch})}schema(e){return new t(this.url,{headers:this.headers,schema:e,fetch:this.fetch})}rpc(e,r={},{head:n=!1,get:i=!1,count:o}={}){let s,a=new URL(`${this.url}/rpc/${e}`),u;n||i?(s=n?"HEAD":"GET",Object.entries(r).filter(([c,f])=>f!==void 0).map(([c,f])=>[c,Array.isArray(f)?`{${f.join(",")}}`:`${f}`]).forEach(([c,f])=>{a.searchParams.append(c,f)})):(s="POST",u=r);let l=Object.assign({},this.headers);return o&&(l.Prefer=`count=${o}`),new gL.default({method:s,url:a,headers:l,schema:this.schemaName,body:u,fetch:this.fetch,allowEmpty:!1})}};Ba.default=Vp});var zp=D(Dt=>{"use strict";var Lo=Dt&&Dt.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Dt,"__esModule",{value:!0});Dt.PostgrestError=Dt.PostgrestBuilder=Dt.PostgrestTransformBuilder=Dt.PostgrestFilterBuilder=Dt.PostgrestQueryBuilder=Dt.PostgrestClient=void 0;var Dw=Lo(yw());Dt.PostgrestClient=Dw.default;var vw=Lo(Hp());Dt.PostgrestQueryBuilder=vw.default;var bw=Lo(oc());Dt.PostgrestFilterBuilder=bw.default;var ww=Lo(qp());Dt.PostgrestTransformBuilder=ww.default;var _w=Lo(Lp());Dt.PostgrestBuilder=_w.default;var Ew=Lo(jp());Dt.PostgrestError=Ew.default;Dt.default={PostgrestClient:Dw.default,PostgrestQueryBuilder:vw.default,PostgrestFilterBuilder:bw.default,PostgrestTransformBuilder:ww.default,PostgrestBuilder:_w.default,PostgrestError:Ew.default}});var Wp={};gi(Wp,{RealtimeClient:()=>Gp});var Gp,Kp=Ct(()=>{Gp=class{constructor(){}connect(){}disconnect(){}}});var Ma=D(Rr=>{"use strict";Object.defineProperty(Rr,"__esModule",{value:!0});Rr.StorageUnknownError=Rr.StorageApiError=Rr.isStorageError=Rr.StorageError=void 0;var qa=class extends Error{constructor(e){super(e),this.__isStorageError=!0,this.name="StorageError"}};Rr.StorageError=qa;function DL(t){return typeof t=="object"&&t!==null&&"__isStorageError"in t}Rr.isStorageError=DL;var Yp=class extends qa{constructor(e,r){super(e),this.name="StorageApiError",this.status=r}toJSON(){return{name:this.name,message:this.message,status:this.status}}};Rr.StorageApiError=Yp;var Jp=class extends qa{constructor(e,r){super(e),this.name="StorageUnknownError",this.originalError=r}};Rr.StorageUnknownError=Jp});var uc=D(ut=>{"use strict";var vL=ut&&ut.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),bL=ut&&ut.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Cw=ut&&ut.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&vL(e,t,r);return bL(e,t),e},wL=ut&&ut.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(c){try{l(n.next(c))}catch(f){s(f)}}function u(c){try{l(n.throw(c))}catch(f){s(f)}}function l(c){c.done?o(c.value):i(c.value).then(a,u)}l((n=n.apply(t,e||[])).next())})};Object.defineProperty(ut,"__esModule",{value:!0});ut.recursiveToCamel=ut.resolveResponse=ut.resolveFetch=void 0;var _L=t=>{let e;return t?e=t:typeof fetch>"u"?e=(...r)=>Promise.resolve().then(()=>Cw((bi(),je(vi)))).then(({default:n})=>n(...r)):e=fetch,(...r)=>e(...r)};ut.resolveFetch=_L;var EL=()=>wL(void 0,void 0,void 0,function*(){return typeof Response>"u"?(yield Promise.resolve().then(()=>Cw((bi(),je(vi))))).Response:Response});ut.resolveResponse=EL;var CL=t=>{if(Array.isArray(t))return t.map(r=>(0,ut.recursiveToCamel)(r));if(typeof t=="function"||t!==Object(t))return t;let e={};return Object.entries(t).forEach(([r,n])=>{let i=r.replace(/([-_][a-z])/gi,o=>o.toUpperCase().replace(/[-_]/g,""));e[i]=(0,ut.recursiveToCamel)(n)}),e};ut.recursiveToCamel=CL});var Qp=D(Mt=>{"use strict";var wi=Mt&&Mt.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(c){try{l(n.next(c))}catch(f){s(f)}}function u(c){try{l(n.throw(c))}catch(f){s(f)}}function l(c){c.done?o(c.value):i(c.value).then(a,u)}l((n=n.apply(t,e||[])).next())})};Object.defineProperty(Mt,"__esModule",{value:!0});Mt.remove=Mt.head=Mt.put=Mt.post=Mt.get=void 0;var Xp=Ma(),SL=uc(),Zp=t=>t.msg||t.message||t.error_description||t.error||JSON.stringify(t),xL=(t,e,r)=>wi(void 0,void 0,void 0,function*(){let n=yield(0,SL.resolveResponse)();t instanceof n&&!r?.noResolveJson?t.json().then(i=>{e(new Xp.StorageApiError(Zp(i),t.status||500))}).catch(i=>{e(new Xp.StorageUnknownError(Zp(i),i))}):e(new Xp.StorageUnknownError(Zp(t),t))}),FL=(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 Ua(t,e,r,n,i,o){return wi(this,void 0,void 0,function*(){return new Promise((s,a)=>{t(r,FL(e,n,i,o)).then(u=>{if(!u.ok)throw u;return n?.noResolveJson?u:u.json()}).then(u=>s(u)).catch(u=>xL(u,a,n))})})}function OL(t,e,r,n){return wi(this,void 0,void 0,function*(){return Ua(t,"GET",e,r,n)})}Mt.get=OL;function AL(t,e,r,n,i){return wi(this,void 0,void 0,function*(){return Ua(t,"POST",e,n,i,r)})}Mt.post=AL;function kL(t,e,r,n,i){return wi(this,void 0,void 0,function*(){return Ua(t,"PUT",e,n,i,r)})}Mt.put=kL;function TL(t,e,r,n){return wi(this,void 0,void 0,function*(){return Ua(t,"HEAD",e,Object.assign(Object.assign({},r),{noResolveJson:!0}),n)})}Mt.head=TL;function PL(t,e,r,n,i){return wi(this,void 0,void 0,function*(){return Ua(t,"DELETE",e,n,i,r)})}Mt.remove=PL});var Fw=D(Ha=>{"use strict";var Ut=Ha&&Ha.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(c){try{l(n.next(c))}catch(f){s(f)}}function u(c){try{l(n.throw(c))}catch(f){s(f)}}function l(c){c.done?o(c.value):i(c.value).then(a,u)}l((n=n.apply(t,e||[])).next())})};Object.defineProperty(Ha,"__esModule",{value:!0});var Ht=Ma(),$r=Qp(),Sw=uc(),RL={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},xw={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,Sw.resolveFetch)(i)}uploadOrUpdate(e,r,n,i){return Ut(this,void 0,void 0,function*(){try{let o,s=Object.assign(Object.assign({},xw),i),a=Object.assign(Object.assign({},this.headers),e==="POST"&&{"x-upsert":String(s.upsert)}),u=s.metadata;typeof Blob<"u"&&n instanceof Blob?(o=new FormData,o.append("cacheControl",s.cacheControl),u&&o.append("metadata",this.encodeMetadata(u)),o.append("",n)):typeof FormData<"u"&&n instanceof FormData?(o=n,o.append("cacheControl",s.cacheControl),u&&o.append("metadata",this.encodeMetadata(u))):(o=n,a["cache-control"]=`max-age=${s.cacheControl}`,a["content-type"]=s.contentType,u&&(a["x-metadata"]=this.toBase64(this.encodeMetadata(u)))),i?.headers&&(a=Object.assign(Object.assign({},a),i.headers));let l=this._removeEmptyFolders(r),c=this._getFinalPath(l),f=yield this.fetch(`${this.url}/object/${c}`,Object.assign({method:e,body:o,headers:a},s?.duplex?{duplex:s.duplex}:{})),h=yield f.json();return f.ok?{data:{path:l,id:h.Id,fullPath:h.Key},error:null}:{data:null,error:h}}catch(o){if((0,Ht.isStorageError)(o))return{data:null,error:o};throw o}})}upload(e,r,n){return Ut(this,void 0,void 0,function*(){return this.uploadOrUpdate("POST",e,r,n)})}uploadToSignedUrl(e,r,n,i){return Ut(this,void 0,void 0,function*(){let o=this._removeEmptyFolders(e),s=this._getFinalPath(o),a=new URL(this.url+`/object/upload/sign/${s}`);a.searchParams.set("token",r);try{let u,l=Object.assign({upsert:xw.upsert},i),c=Object.assign(Object.assign({},this.headers),{"x-upsert":String(l.upsert)});typeof Blob<"u"&&n instanceof Blob?(u=new FormData,u.append("cacheControl",l.cacheControl),u.append("",n)):typeof FormData<"u"&&n instanceof FormData?(u=n,u.append("cacheControl",l.cacheControl)):(u=n,c["cache-control"]=`max-age=${l.cacheControl}`,c["content-type"]=l.contentType);let f=yield this.fetch(a.toString(),{method:"PUT",body:u,headers:c}),h=yield f.json();return f.ok?{data:{path:o,fullPath:h.Key},error:null}:{data:null,error:h}}catch(u){if((0,Ht.isStorageError)(u))return{data:null,error:u};throw u}})}createSignedUploadUrl(e,r){return Ut(this,void 0,void 0,function*(){try{let n=this._getFinalPath(e),i=Object.assign({},this.headers);r?.upsert&&(i["x-upsert"]="true");let o=yield(0,$r.post)(this.fetch,`${this.url}/object/upload/sign/${n}`,{},{headers:i}),s=new URL(this.url+o.url),a=s.searchParams.get("token");if(!a)throw new Ht.StorageError("No token returned by API");return{data:{signedUrl:s.toString(),path:e,token:a},error:null}}catch(n){if((0,Ht.isStorageError)(n))return{data:null,error:n};throw n}})}update(e,r,n){return Ut(this,void 0,void 0,function*(){return this.uploadOrUpdate("PUT",e,r,n)})}move(e,r,n){return Ut(this,void 0,void 0,function*(){try{return{data:yield(0,$r.post)(this.fetch,`${this.url}/object/move`,{bucketId:this.bucketId,sourceKey:e,destinationKey:r,destinationBucket:n?.destinationBucket},{headers:this.headers}),error:null}}catch(i){if((0,Ht.isStorageError)(i))return{data:null,error:i};throw i}})}copy(e,r,n){return Ut(this,void 0,void 0,function*(){try{return{data:{path:(yield(0,$r.post)(this.fetch,`${this.url}/object/copy`,{bucketId:this.bucketId,sourceKey:e,destinationKey:r,destinationBucket:n?.destinationBucket},{headers:this.headers})).Key},error:null}}catch(i){if((0,Ht.isStorageError)(i))return{data:null,error:i};throw i}})}createSignedUrl(e,r,n){return Ut(this,void 0,void 0,function*(){try{let i=this._getFinalPath(e),o=yield(0,$r.post)(this.fetch,`${this.url}/object/sign/${i}`,Object.assign({expiresIn:r},n?.transform?{transform:n.transform}:{}),{headers:this.headers}),s=n?.download?`&download=${n.download===!0?"":n.download}`:"";return o={signedUrl:encodeURI(`${this.url}${o.signedURL}${s}`)},{data:o,error:null}}catch(i){if((0,Ht.isStorageError)(i))return{data:null,error:i};throw i}})}createSignedUrls(e,r,n){return Ut(this,void 0,void 0,function*(){try{let i=yield(0,$r.post)(this.fetch,`${this.url}/object/sign/${this.bucketId}`,{expiresIn:r,paths:e},{headers:this.headers}),o=n?.download?`&download=${n.download===!0?"":n.download}`:"";return{data:i.map(s=>Object.assign(Object.assign({},s),{signedUrl:s.signedURL?encodeURI(`${this.url}${s.signedURL}${o}`):null})),error:null}}catch(i){if((0,Ht.isStorageError)(i))return{data:null,error:i};throw i}})}download(e,r){return Ut(this,void 0,void 0,function*(){let i=typeof r?.transform<"u"?"render/image/authenticated":"object",o=this.transformOptsToQueryString(r?.transform||{}),s=o?`?${o}`:"";try{let a=this._getFinalPath(e);return{data:yield(yield(0,$r.get)(this.fetch,`${this.url}/${i}/${a}${s}`,{headers:this.headers,noResolveJson:!0})).blob(),error:null}}catch(a){if((0,Ht.isStorageError)(a))return{data:null,error:a};throw a}})}info(e){return Ut(this,void 0,void 0,function*(){let r=this._getFinalPath(e);try{let n=yield(0,$r.get)(this.fetch,`${this.url}/object/info/${r}`,{headers:this.headers});return{data:(0,Sw.recursiveToCamel)(n),error:null}}catch(n){if((0,Ht.isStorageError)(n))return{data:null,error:n};throw n}})}exists(e){return Ut(this,void 0,void 0,function*(){let r=this._getFinalPath(e);try{return yield(0,$r.head)(this.fetch,`${this.url}/object/${r}`,{headers:this.headers}),{data:!0,error:null}}catch(n){if((0,Ht.isStorageError)(n)&&n instanceof Ht.StorageUnknownError){let i=n.originalError;if([400,404].includes(i?.status))return{data:!1,error:n}}throw n}})}getPublicUrl(e,r){let n=this._getFinalPath(e),i=[],o=r?.download?`download=${r.download===!0?"":r.download}`:"";o!==""&&i.push(o);let a=typeof r?.transform<"u"?"render/image":"object",u=this.transformOptsToQueryString(r?.transform||{});u!==""&&i.push(u);let l=i.join("&");return l!==""&&(l=`?${l}`),{data:{publicUrl:encodeURI(`${this.url}/${a}/public/${n}${l}`)}}}remove(e){return Ut(this,void 0,void 0,function*(){try{return{data:yield(0,$r.remove)(this.fetch,`${this.url}/object/${this.bucketId}`,{prefixes:e},{headers:this.headers}),error:null}}catch(r){if((0,Ht.isStorageError)(r))return{data:null,error:r};throw r}})}list(e,r,n){return Ut(this,void 0,void 0,function*(){try{let i=Object.assign(Object.assign(Object.assign({},RL),r),{prefix:e||""});return{data:yield(0,$r.post)(this.fetch,`${this.url}/object/list/${this.bucketId}`,i,{headers:this.headers},n),error:null}}catch(i){if((0,Ht.isStorageError)(i))return{data:null,error:i};throw i}})}encodeMetadata(e){return JSON.stringify(e)}toBase64(e){return typeof Buffer<"u"?Buffer.from(e).toString("base64"):btoa(e)}_getFinalPath(e){return`${this.bucketId}/${e}`}_removeEmptyFolders(e){return e.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")}transformOptsToQueryString(e){let r=[];return e.width&&r.push(`width=${e.width}`),e.height&&r.push(`height=${e.height}`),e.resize&&r.push(`resize=${e.resize}`),e.format&&r.push(`format=${e.format}`),e.quality&&r.push(`quality=${e.quality}`),r.join("&")}};Ha.default=em});var Ow=D(lc=>{"use strict";Object.defineProperty(lc,"__esModule",{value:!0});lc.version=void 0;lc.version="2.7.1"});var Aw=D(cc=>{"use strict";Object.defineProperty(cc,"__esModule",{value:!0});cc.DEFAULT_HEADERS=void 0;var $L=Ow();cc.DEFAULT_HEADERS={"X-Client-Info":`storage-js/${$L.version}`}});var kw=D(Va=>{"use strict";var Bo=Va&&Va.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(c){try{l(n.next(c))}catch(f){s(f)}}function u(c){try{l(n.throw(c))}catch(f){s(f)}}function l(c){c.done?o(c.value):i(c.value).then(a,u)}l((n=n.apply(t,e||[])).next())})};Object.defineProperty(Va,"__esModule",{value:!0});var IL=Aw(),qo=Ma(),Mo=Qp(),jL=uc(),tm=class{constructor(e,r={},n){this.url=e,this.headers=Object.assign(Object.assign({},IL.DEFAULT_HEADERS),r),this.fetch=(0,jL.resolveFetch)(n)}listBuckets(){return Bo(this,void 0,void 0,function*(){try{return{data:yield(0,Mo.get)(this.fetch,`${this.url}/bucket`,{headers:this.headers}),error:null}}catch(e){if((0,qo.isStorageError)(e))return{data:null,error:e};throw e}})}getBucket(e){return Bo(this,void 0,void 0,function*(){try{return{data:yield(0,Mo.get)(this.fetch,`${this.url}/bucket/${e}`,{headers:this.headers}),error:null}}catch(r){if((0,qo.isStorageError)(r))return{data:null,error:r};throw r}})}createBucket(e,r={public:!1}){return Bo(this,void 0,void 0,function*(){try{return{data:yield(0,Mo.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,qo.isStorageError)(n))return{data:null,error:n};throw n}})}updateBucket(e,r){return Bo(this,void 0,void 0,function*(){try{return{data:yield(0,Mo.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,qo.isStorageError)(n))return{data:null,error:n};throw n}})}emptyBucket(e){return Bo(this,void 0,void 0,function*(){try{return{data:yield(0,Mo.post)(this.fetch,`${this.url}/bucket/${e}/empty`,{},{headers:this.headers}),error:null}}catch(r){if((0,qo.isStorageError)(r))return{data:null,error:r};throw r}})}deleteBucket(e){return Bo(this,void 0,void 0,function*(){try{return{data:yield(0,Mo.remove)(this.fetch,`${this.url}/bucket/${e}`,{},{headers:this.headers}),error:null}}catch(r){if((0,qo.isStorageError)(r))return{data:null,error:r};throw r}})}};Va.default=tm});var Pw=D(Uo=>{"use strict";var Tw=Uo&&Uo.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Uo,"__esModule",{value:!0});Uo.StorageClient=void 0;var NL=Tw(Fw()),LL=Tw(kw()),rm=class extends LL.default{constructor(e,r={},n){super(e,r,n)}from(e){return new NL.default(this.url,this.headers,e,this.fetch)}};Uo.StorageClient=rm});var $w=D(Rw=>{"use strict";Object.defineProperty(Rw,"__esModule",{value:!0})});var jw=D(Ir=>{"use strict";var BL=Ir&&Ir.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),Iw=Ir&&Ir.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&BL(e,t,r)};Object.defineProperty(Ir,"__esModule",{value:!0});Ir.StorageClient=void 0;var qL=Pw();Object.defineProperty(Ir,"StorageClient",{enumerable:!0,get:function(){return qL.StorageClient}});Iw($w(),Ir);Iw(Ma(),Ir)});var Nw=D(fc=>{"use strict";Object.defineProperty(fc,"__esModule",{value:!0});fc.version=void 0;fc.version="2.48.1"});var Lw=D(tr=>{"use strict";Object.defineProperty(tr,"__esModule",{value:!0});tr.DEFAULT_REALTIME_OPTIONS=tr.DEFAULT_AUTH_OPTIONS=tr.DEFAULT_DB_OPTIONS=tr.DEFAULT_GLOBAL_OPTIONS=tr.DEFAULT_HEADERS=void 0;var ML=Nw(),za="";typeof Deno<"u"?za="deno":typeof document<"u"?za="web":typeof navigator<"u"&&navigator.product==="ReactNative"?za="react-native":za="node";tr.DEFAULT_HEADERS={"X-Client-Info":`supabase-js-${za}/${ML.version}`};tr.DEFAULT_GLOBAL_OPTIONS={headers:tr.DEFAULT_HEADERS};tr.DEFAULT_DB_OPTIONS={schema:"public"};tr.DEFAULT_AUTH_OPTIONS={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"};tr.DEFAULT_REALTIME_OPTIONS={}});var qw=D(lt=>{"use strict";var UL=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]}),HL=lt&&lt.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),VL=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)&&UL(e,t,r);return HL(e,t),e},zL=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(c){try{l(n.next(c))}catch(f){s(f)}}function u(c){try{l(n.throw(c))}catch(f){s(f)}}function l(c){c.done?o(c.value):i(c.value).then(a,u)}l((n=n.apply(t,e||[])).next())})};Object.defineProperty(lt,"__esModule",{value:!0});lt.fetchWithAuth=lt.resolveHeadersConstructor=lt.resolveFetch=void 0;var Bw=VL((bi(),je(vi))),GL=t=>{let e;return t?e=t:typeof fetch>"u"?e=Bw.default:e=fetch,(...r)=>e(...r)};lt.resolveFetch=GL;var WL=()=>typeof Headers>"u"?Bw.Headers:Headers;lt.resolveHeadersConstructor=WL;var KL=(t,e,r)=>{let n=(0,lt.resolveFetch)(r),i=(0,lt.resolveHeadersConstructor)();return(o,s)=>zL(void 0,void 0,void 0,function*(){var a;let u=(a=yield e())!==null&&a!==void 0?a:t,l=new i(s?.headers);return l.has("apikey")||l.set("apikey",t),l.has("Authorization")||l.set("Authorization",`Bearer ${u}`),n(o,Object.assign(Object.assign({},s),{headers:l}))})};lt.fetchWithAuth=KL});var Mw=D(fr=>{"use strict";var YL=fr&&fr.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(c){try{l(n.next(c))}catch(f){s(f)}}function u(c){try{l(n.throw(c))}catch(f){s(f)}}function l(c){c.done?o(c.value):i(c.value).then(a,u)}l((n=n.apply(t,e||[])).next())})};Object.defineProperty(fr,"__esModule",{value:!0});fr.applySettingDefaults=fr.isBrowser=fr.stripTrailingSlash=fr.uuid=void 0;function JL(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var e=Math.random()*16|0,r=t=="x"?e:e&3|8;return r.toString(16)})}fr.uuid=JL;function XL(t){return t.replace(/\/$/,"")}fr.stripTrailingSlash=XL;var ZL=()=>typeof window<"u";fr.isBrowser=ZL;function QL(t,e){let{db:r,auth:n,realtime:i,global:o}=t,{db:s,auth:a,realtime:u,global:l}=e,c={db:Object.assign(Object.assign({},s),r),auth:Object.assign(Object.assign({},a),n),realtime:Object.assign(Object.assign({},u),i),global:Object.assign(Object.assign({},l),o),accessToken:()=>YL(this,void 0,void 0,function*(){return""})};return t.accessToken?c.accessToken=t.accessToken:delete c.accessToken,c}fr.applySettingDefaults=QL});var nm=D(dc=>{"use strict";Object.defineProperty(dc,"__esModule",{value:!0});dc.version=void 0;dc.version="2.67.3"});var hc=D(ct=>{"use strict";Object.defineProperty(ct,"__esModule",{value:!0});ct.API_VERSIONS=ct.API_VERSION_HEADER_NAME=ct.NETWORK_FAILURE=ct.EXPIRY_MARGIN=ct.DEFAULT_HEADERS=ct.AUDIENCE=ct.STORAGE_KEY=ct.GOTRUE_URL=void 0;var eB=nm();ct.GOTRUE_URL="http://localhost:9999";ct.STORAGE_KEY="supabase.auth.token";ct.AUDIENCE="";ct.DEFAULT_HEADERS={"X-Client-Info":`gotrue-js/${eB.version}`};ct.EXPIRY_MARGIN=10;ct.NETWORK_FAILURE={MAX_RETRIES:10,RETRY_INTERVAL:2};ct.API_VERSION_HEADER_NAME="X-Supabase-Api-Version";ct.API_VERSIONS={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}}});var Ho=D(ee=>{"use strict";var tB=ee&&ee.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),rB=ee&&ee.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),nB=ee&&ee.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&tB(e,t,r);return rB(e,t),e};Object.defineProperty(ee,"__esModule",{value:!0});ee.parseResponseAPIVersion=ee.getCodeChallengeAndMethod=ee.generatePKCEChallenge=ee.generatePKCEVerifier=ee.retryable=ee.sleep=ee.decodeJWTPayload=ee.Deferred=ee.decodeBase64URL=ee.removeItemAsync=ee.getItemAsync=ee.setItemAsync=ee.looksLikeFetchResponse=ee.resolveFetch=ee.parseParametersFromURL=ee.supportsLocalStorage=ee.isBrowser=ee.uuid=ee.expiresAt=void 0;var iB=hc();function oB(t){return Math.round(Date.now()/1e3)+t}ee.expiresAt=oB;function sB(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){let e=Math.random()*16|0;return(t=="x"?e:e&3|8).toString(16)})}ee.uuid=sB;var aB=()=>typeof window<"u"&&typeof document<"u";ee.isBrowser=aB;var _i={tested:!1,writable:!1},uB=()=>{if(!(0,ee.isBrowser)())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(_i.tested)return _i.writable;let t=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(t,t),globalThis.localStorage.removeItem(t),_i.tested=!0,_i.writable=!0}catch{_i.tested=!0,_i.writable=!1}return _i.writable};ee.supportsLocalStorage=uB;function lB(t){let e={},r=new URL(t);if(r.hash&&r.hash[0]==="#")try{new URLSearchParams(r.hash.substring(1)).forEach((i,o)=>{e[o]=i})}catch{}return r.searchParams.forEach((n,i)=>{e[i]=n}),e}ee.parseParametersFromURL=lB;var cB=t=>{let e;return t?e=t:typeof fetch>"u"?e=(...r)=>Promise.resolve().then(()=>nB((bi(),je(vi)))).then(({default:n})=>n(...r)):e=fetch,(...r)=>e(...r)};ee.resolveFetch=cB;var fB=t=>typeof t=="object"&&t!==null&&"status"in t&&"ok"in t&&"json"in t&&typeof t.json=="function";ee.looksLikeFetchResponse=fB;var dB=async(t,e,r)=>{await t.setItem(e,JSON.stringify(r))};ee.setItemAsync=dB;var hB=async(t,e)=>{let r=await t.getItem(e);if(!r)return null;try{return JSON.parse(r)}catch{return r}};ee.getItemAsync=hB;var pB=async(t,e)=>{await t.removeItem(e)};ee.removeItemAsync=pB;function Uw(t){let e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",r="",n,i,o,s,a,u,l,c=0;for(t=t.replace("-","+").replace("_","/");c<t.length;)s=e.indexOf(t.charAt(c++)),a=e.indexOf(t.charAt(c++)),u=e.indexOf(t.charAt(c++)),l=e.indexOf(t.charAt(c++)),n=s<<2|a>>4,i=(a&15)<<4|u>>2,o=(u&3)<<6|l,r=r+String.fromCharCode(n),u!=64&&i!=0&&(r=r+String.fromCharCode(i)),l!=64&&o!=0&&(r=r+String.fromCharCode(o));return r}ee.decodeBase64URL=Uw;var pc=class t{constructor(){this.promise=new t.promiseConstructor((e,r)=>{this.resolve=e,this.reject=r})}};ee.Deferred=pc;pc.promiseConstructor=Promise;function mB(t){let e=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}=?$|[a-z0-9_-]{2}(==)?$)$/i,r=t.split(".");if(r.length!==3)throw new Error("JWT is not valid: not a JWT structure");if(!e.test(r[1]))throw new Error("JWT is not valid: payload is not in base64url format");let n=r[1];return JSON.parse(Uw(n))}ee.decodeJWTPayload=mB;async function gB(t){return await new Promise(e=>{setTimeout(()=>e(null),t)})}ee.sleep=gB;function yB(t,e){return new Promise((n,i)=>{(async()=>{for(let o=0;o<1/0;o++)try{let s=await t(o);if(!e(o,null,s)){n(s);return}}catch(s){if(!e(o,s)){i(s);return}}})()})}ee.retryable=yB;function DB(t){return("0"+t.toString(16)).substr(-2)}function Hw(){let e=new Uint32Array(56);if(typeof crypto>"u"){let r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",n=r.length,i="";for(let o=0;o<56;o++)i+=r.charAt(Math.floor(Math.random()*n));return i}return crypto.getRandomValues(e),Array.from(e,DB).join("")}ee.generatePKCEVerifier=Hw;async function vB(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 bB(t){return btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function Vw(t){if(!(typeof crypto<"u"&&typeof crypto.subtle<"u"&&typeof TextEncoder<"u"))return console.warn("WebCrypto API is not supported. Code challenge method will default to use plain instead of sha256."),t;let r=await vB(t);return bB(r)}ee.generatePKCEChallenge=Vw;async function wB(t,e,r=!1){let n=Hw(),i=n;r&&(i+="/PASSWORD_RECOVERY"),await(0,ee.setItemAsync)(t,`${e}-code-verifier`,i);let o=await Vw(n);return[o,n===o?"plain":"s256"]}ee.getCodeChallengeAndMethod=wB;var _B=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function EB(t){let e=t.headers.get(iB.API_VERSION_HEADER_NAME);if(!e||!e.match(_B))return null;try{return new Date(`${e}T00:00:00.0Z`)}catch{return null}}ee.parseResponseAPIVersion=EB});var Ga=D(ce=>{"use strict";Object.defineProperty(ce,"__esModule",{value:!0});ce.isAuthWeakPasswordError=ce.AuthWeakPasswordError=ce.isAuthRetryableFetchError=ce.AuthRetryableFetchError=ce.AuthPKCEGrantCodeExchangeError=ce.isAuthImplicitGrantRedirectError=ce.AuthImplicitGrantRedirectError=ce.AuthInvalidCredentialsError=ce.AuthInvalidTokenResponseError=ce.isAuthSessionMissingError=ce.AuthSessionMissingError=ce.CustomAuthError=ce.AuthUnknownError=ce.isAuthApiError=ce.AuthApiError=ce.isAuthError=ce.AuthError=void 0;var Vo=class extends Error{constructor(e,r,n){super(e),this.__isAuthError=!0,this.name="AuthError",this.status=r,this.code=n}};ce.AuthError=Vo;function zo(t){return typeof t=="object"&&t!==null&&"__isAuthError"in t}ce.isAuthError=zo;var im=class extends Vo{constructor(e,r,n){super(e,r,n),this.name="AuthApiError",this.status=r,this.code=n}};ce.AuthApiError=im;function CB(t){return zo(t)&&t.name==="AuthApiError"}ce.isAuthApiError=CB;var om=class extends Vo{constructor(e,r){super(e),this.name="AuthUnknownError",this.originalError=r}};ce.AuthUnknownError=om;var jr=class extends Vo{constructor(e,r,n,i){super(e,n,i),this.name=r,this.status=n}};ce.CustomAuthError=jr;var sm=class extends jr{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}};ce.AuthSessionMissingError=sm;function SB(t){return zo(t)&&t.name==="AuthSessionMissingError"}ce.isAuthSessionMissingError=SB;var am=class extends jr{constructor(){super("Auth session or user missing","AuthInvalidTokenResponseError",500,void 0)}};ce.AuthInvalidTokenResponseError=am;var um=class extends jr{constructor(e){super(e,"AuthInvalidCredentialsError",400,void 0)}};ce.AuthInvalidCredentialsError=um;var lm=class extends jr{constructor(e,r=null){super(e,"AuthImplicitGrantRedirectError",500,void 0),this.details=null,this.details=r}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}};ce.AuthImplicitGrantRedirectError=lm;function xB(t){return zo(t)&&t.name==="AuthImplicitGrantRedirectError"}ce.isAuthImplicitGrantRedirectError=xB;var cm=class extends jr{constructor(e,r=null){super(e,"AuthPKCEGrantCodeExchangeError",500,void 0),this.details=null,this.details=r}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}};ce.AuthPKCEGrantCodeExchangeError=cm;var fm=class extends jr{constructor(e,r){super(e,"AuthRetryableFetchError",r,void 0)}};ce.AuthRetryableFetchError=fm;function FB(t){return zo(t)&&t.name==="AuthRetryableFetchError"}ce.isAuthRetryableFetchError=FB;var dm=class extends jr{constructor(e,r,n){super(e,"AuthWeakPasswordError",r,"weak_password"),this.reasons=n}};ce.AuthWeakPasswordError=dm;function OB(t){return zo(t)&&t.name==="AuthWeakPasswordError"}ce.isAuthWeakPasswordError=OB});var mm=D(nt=>{"use strict";var AB=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 mc=hc(),hm=Ho(),qn=Ga(),Ei=t=>t.msg||t.message||t.error_description||t.error||JSON.stringify(t),kB=[502,503,504];async function pm(t){var e;if(!(0,hm.looksLikeFetchResponse)(t))throw new qn.AuthRetryableFetchError(Ei(t),0);if(kB.includes(t.status))throw new qn.AuthRetryableFetchError(Ei(t),t.status);let r;try{r=await t.json()}catch(o){throw new qn.AuthUnknownError(Ei(o),o)}let n,i=(0,hm.parseResponseAPIVersion)(t);if(i&&i.getTime()>=mc.API_VERSIONS["2024-01-01"].timestamp&&typeof r=="object"&&r&&typeof r.code=="string"?n=r.code:typeof r=="object"&&r&&typeof r.error_code=="string"&&(n=r.error_code),n){if(n==="weak_password")throw new qn.AuthWeakPasswordError(Ei(r),t.status,((e=r.weak_password)===null||e===void 0?void 0:e.reasons)||[]);if(n==="session_not_found")throw new qn.AuthSessionMissingError}else if(typeof r=="object"&&r&&typeof r.weak_password=="object"&&r.weak_password&&Array.isArray(r.weak_password.reasons)&&r.weak_password.reasons.length&&r.weak_password.reasons.reduce((o,s)=>o&&typeof s=="string",!0))throw new qn.AuthWeakPasswordError(Ei(r),t.status,r.weak_password.reasons);throw new qn.AuthApiError(Ei(r),t.status||500,n)}nt.handleError=pm;var TB=(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 PB(t,e,r,n){var i;let o=Object.assign({},n?.headers);o[mc.API_VERSION_HEADER_NAME]||(o[mc.API_VERSION_HEADER_NAME]=mc.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 RB(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=PB;async function RB(t,e,r,n,i,o){let s=TB(e,n,i,o),a;try{a=await t(r,Object.assign({},s))}catch(u){throw console.error(u),new qn.AuthRetryableFetchError(Ei(u),0)}if(a.ok||await pm(a),n?.noResolveJson)return a;try{return await a.json()}catch(u){await pm(u)}}function zw(t){var e;let r=null;BB(t)&&(r=Object.assign({},t),t.expires_at||(r.expires_at=(0,hm.expiresAt)(t.expires_in)));let n=(e=t.user)!==null&&e!==void 0?e:t;return{data:{session:r,user:n},error:null}}nt._sessionResponse=zw;function $B(t){let e=zw(t);return!e.error&&t.weak_password&&typeof t.weak_password=="object"&&Array.isArray(t.weak_password.reasons)&&t.weak_password.reasons.length&&t.weak_password.message&&typeof t.weak_password.message=="string"&&t.weak_password.reasons.reduce((r,n)=>r&&typeof n=="string",!0)&&(e.data.weak_password=t.weak_password),e}nt._sessionResponsePassword=$B;function IB(t){var e;return{data:{user:(e=t.user)!==null&&e!==void 0?e:t},error:null}}nt._userResponse=IB;function jB(t){return{data:t,error:null}}nt._ssoResponse=jB;function NB(t){let{action_link:e,email_otp:r,hashed_token:n,redirect_to:i,verification_type:o}=t,s=AB(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=NB;function LB(t){return t}nt._noResolveJsonResponse=LB;function BB(t){return t.access_token&&t.refresh_token&&t.expires_in}});var gc=D(Wa=>{"use strict";var qB=Wa&&Wa.__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(Wa,"__esModule",{value:!0});var vt=mm(),MB=Ho(),Nr=Ga(),gm=class{constructor({url:e="",headers:r={},fetch:n}){this.url=e,this.headers=r,this.fetch=(0,MB.resolveFetch)(n),this.mfa={listFactors:this._listFactors.bind(this),deleteFactor:this._deleteFactor.bind(this)}}async signOut(e,r="global"){try{return await(0,vt._request)(this.fetch,"POST",`${this.url}/logout?scope=${r}`,{headers:this.headers,jwt:e,noResolveJson:!0}),{data:null,error:null}}catch(n){if((0,Nr.isAuthError)(n))return{data:null,error:n};throw n}}async inviteUserByEmail(e,r={}){try{return await(0,vt._request)(this.fetch,"POST",`${this.url}/invite`,{body:{email:e,data:r.data},headers:this.headers,redirectTo:r.redirectTo,xform:vt._userResponse})}catch(n){if((0,Nr.isAuthError)(n))return{data:{user:null},error:n};throw n}}async generateLink(e){try{let{options:r}=e,n=qB(e,["options"]),i=Object.assign(Object.assign({},n),r);return"newEmail"in n&&(i.new_email=n?.newEmail,delete i.newEmail),await(0,vt._request)(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:i,headers:this.headers,xform:vt._generateLinkResponse,redirectTo:r?.redirectTo})}catch(r){if((0,Nr.isAuthError)(r))return{data:{properties:null,user:null},error:r};throw r}}async createUser(e){try{return await(0,vt._request)(this.fetch,"POST",`${this.url}/admin/users`,{body:e,headers:this.headers,xform:vt._userResponse})}catch(r){if((0,Nr.isAuthError)(r))return{data:{user:null},error:r};throw r}}async listUsers(e){var r,n,i,o,s,a,u;try{let l={nextPage:null,lastPage:0,total:0},c=await(0,vt._request)(this.fetch,"GET",`${this.url}/admin/users`,{headers:this.headers,noResolveJson:!0,query:{page:(n=(r=e?.page)===null||r===void 0?void 0:r.toString())!==null&&n!==void 0?n:"",per_page:(o=(i=e?.perPage)===null||i===void 0?void 0:i.toString())!==null&&o!==void 0?o:""},xform:vt._noResolveJsonResponse});if(c.error)throw c.error;let f=await c.json(),h=(s=c.headers.get("x-total-count"))!==null&&s!==void 0?s:0,d=(u=(a=c.headers.get("link"))===null||a===void 0?void 0:a.split(","))!==null&&u!==void 0?u:[];return d.length>0&&(d.forEach(m=>{let b=parseInt(m.split(";")[0].split("=")[1].substring(0,1)),y=JSON.parse(m.split(";")[1].split("=")[1]);l[`${y}Page`]=b}),l.total=parseInt(h)),{data:Object.assign(Object.assign({},f),l),error:null}}catch(l){if((0,Nr.isAuthError)(l))return{data:{users:[]},error:l};throw l}}async getUserById(e){try{return await(0,vt._request)(this.fetch,"GET",`${this.url}/admin/users/${e}`,{headers:this.headers,xform:vt._userResponse})}catch(r){if((0,Nr.isAuthError)(r))return{data:{user:null},error:r};throw r}}async updateUserById(e,r){try{return await(0,vt._request)(this.fetch,"PUT",`${this.url}/admin/users/${e}`,{body:r,headers:this.headers,xform:vt._userResponse})}catch(n){if((0,Nr.isAuthError)(n))return{data:{user:null},error:n};throw n}}async deleteUser(e,r=!1){try{return await(0,vt._request)(this.fetch,"DELETE",`${this.url}/admin/users/${e}`,{headers:this.headers,body:{should_soft_delete:r},xform:vt._userResponse})}catch(n){if((0,Nr.isAuthError)(n))return{data:{user:null},error:n};throw n}}async _listFactors(e){try{let{data:r,error:n}=await(0,vt._request)(this.fetch,"GET",`${this.url}/admin/users/${e.userId}/factors`,{headers:this.headers,xform:i=>({data:{factors:i},error:null})});return{data:r,error:n}}catch(r){if((0,Nr.isAuthError)(r))return{data:null,error:r};throw r}}async _deleteFactor(e){try{return{data:await(0,vt._request)(this.fetch,"DELETE",`${this.url}/admin/users/${e.userId}/factors/${e.id}`,{headers:this.headers}),error:null}}catch(r){if((0,Nr.isAuthError)(r))return{data:null,error:r};throw r}}};Wa.default=gm});var Gw=D(Go=>{"use strict";Object.defineProperty(Go,"__esModule",{value:!0});Go.memoryLocalStorageAdapter=Go.localStorageAdapter=void 0;var ym=Ho();Go.localStorageAdapter={getItem:t=>(0,ym.supportsLocalStorage)()?globalThis.localStorage.getItem(t):null,setItem:(t,e)=>{(0,ym.supportsLocalStorage)()&&globalThis.localStorage.setItem(t,e)},removeItem:t=>{(0,ym.supportsLocalStorage)()&&globalThis.localStorage.removeItem(t)}};function UB(t={}){return{getItem:e=>t[e]||null,setItem:(e,r)=>{t[e]=r},removeItem:e=>{delete t[e]}}}Go.memoryLocalStorageAdapter=UB});var Ww=D(yc=>{"use strict";Object.defineProperty(yc,"__esModule",{value:!0});yc.polyfillGlobalThis=void 0;function HB(){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)}}yc.polyfillGlobalThis=HB});var Dm=D(it=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0});it.processLock=it.navigatorLock=it.ProcessLockAcquireTimeoutError=it.NavigatorLockAcquireTimeoutError=it.LockAcquireTimeoutError=it.internals=void 0;var VB=Ho();it.internals={debug:!!(globalThis&&(0,VB.supportsLocalStorage)()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug")==="true")};var Ka=class extends Error{constructor(e){super(e),this.isAcquireTimeout=!0}};it.LockAcquireTimeoutError=Ka;var Dc=class extends Ka{};it.NavigatorLockAcquireTimeoutError=Dc;var vc=class extends Ka{};it.ProcessLockAcquireTimeoutError=vc;async function zB(t,e,r){it.internals.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire lock",t,e);let n=new globalThis.AbortController;return e>0&&setTimeout(()=>{n.abort(),it.internals.debug&&console.log("@supabase/gotrue-js: navigatorLock acquire timed out",t)},e),await Promise.resolve().then(()=>globalThis.navigator.locks.request(t,e===0?{mode:"exclusive",ifAvailable:!0}:{mode:"exclusive",signal:n.signal},async i=>{if(i){it.internals.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquired",t,i.name);try{return await r()}finally{it.internals.debug&&console.log("@supabase/gotrue-js: navigatorLock: released",t,i.name)}}else{if(e===0)throw it.internals.debug&&console.log("@supabase/gotrue-js: navigatorLock: not immediately available",t),new Dc(`Acquiring an exclusive Navigator LockManager lock "${t}" immediately failed`);if(it.internals.debug)try{let o=await globalThis.navigator.locks.query();console.log("@supabase/gotrue-js: Navigator LockManager state",JSON.stringify(o,null," "))}catch(o){console.warn("@supabase/gotrue-js: Error when querying Navigator LockManager state",o)}return console.warn("@supabase/gotrue-js: Navigator LockManager returned a null lock when using #request without ifAvailable set to true, it appears this browser is not following the LockManager spec https://developer.mozilla.org/en-US/docs/Web/API/LockManager/request"),await r()}}))}it.navigatorLock=zB;var Kw={};async function GB(t,e,r){var n;let i=(n=Kw[t])!==null&&n!==void 0?n:Promise.resolve(),o=Promise.race([i.catch(()=>null),e>=0?new Promise((s,a)=>{setTimeout(()=>{a(new vc(`Acquring process lock with name "${t}" timed out`))},e)}):null].filter(s=>s)).catch(s=>{if(s&&s.isAcquireTimeout)throw s;return null}).then(async()=>await r());return Kw[t]=o.catch(async s=>{if(s&&s.isAcquireTimeout)return await i,null;throw s}),await o}it.processLock=GB});var bm=D(Xa=>{"use strict";var WB=Xa&&Xa.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Xa,"__esModule",{value:!0});var KB=WB(gc()),Ja=hc(),X=Ga(),se=mm(),me=Ho(),vm=Gw(),YB=Ww(),JB=nm(),Yw=Dm();(0,YB.polyfillGlobalThis)();var XB={url:Ja.GOTRUE_URL,storageKey:Ja.STORAGE_KEY,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:Ja.DEFAULT_HEADERS,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1},Ya=30*1e3,Jw=3;async function Xw(t,e,r){return await r()}var bc=class t{constructor(e){var r,n;this.memoryStorage=null,this.stateChangeEmitters=new Map,this.autoRefreshTicker=null,this.visibilityChangedCallback=null,this.refreshingDeferred=null,this.initializePromise=null,this.detectSessionInUrl=!0,this.hasCustomAuthorizationHeader=!1,this.suppressGetSessionWarning=!1,this.lockAcquired=!1,this.pendingInLock=[],this.broadcastChannel=null,this.logger=console.log,this.instanceID=t.nextInstanceID,t.nextInstanceID+=1,this.instanceID>0&&(0,me.isBrowser)()&&console.warn("Multiple GoTrueClient instances detected in the same browser context. It is not an error, but this should be avoided as it may produce undefined behavior when used concurrently under the same storage key.");let i=Object.assign(Object.assign({},XB),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 KB.default({url:i.url,headers:i.headers,fetch:i.fetch}),this.url=i.url,this.headers=i.headers,this.fetch=(0,me.resolveFetch)(i.fetch),this.lock=i.lock||Xw,this.detectSessionInUrl=i.detectSessionInUrl,this.flowType=i.flowType,this.hasCustomAuthorizationHeader=i.hasCustomAuthorizationHeader,i.lock?this.lock=i.lock:(0,me.isBrowser)()&&(!((r=globalThis?.navigator)===null||r===void 0)&&r.locks)?this.lock=Yw.navigatorLock:this.lock=Xw,this.mfa={verify:this._verify.bind(this),enroll:this._enroll.bind(this),unenroll:this._unenroll.bind(this),challenge:this._challenge.bind(this),listFactors:this._listFactors.bind(this),challengeAndVerify:this._challengeAndVerify.bind(this),getAuthenticatorAssuranceLevel:this._getAuthenticatorAssuranceLevel.bind(this)},this.persistSession?i.storage?this.storage=i.storage:(0,me.supportsLocalStorage)()?this.storage=vm.localStorageAdapter:(this.memoryStorage={},this.storage=(0,vm.memoryLocalStorageAdapter)(this.memoryStorage)):(this.memoryStorage={},this.storage=(0,vm.memoryLocalStorageAdapter)(this.memoryStorage)),(0,me.isBrowser)()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(o){console.error("Failed to create a new BroadcastChannel, multi-tab state changes will not be available",o)}(n=this.broadcastChannel)===null||n===void 0||n.addEventListener("message",async o=>{this._debug("received broadcast notification from other tab or client",o),await this._notifyAllSubscribers(o.data.event,o.data.session,!1)})}this.initialize()}_debug(...e){return this.logDebugMessages&&this.logger(`GoTrueClient@${this.instanceID} (${JB.version}) ${new Date().toISOString()}`,...e),this}async initialize(){return this.initializePromise?await this.initializePromise:(this.initializePromise=(async()=>await this._acquireLock(-1,async()=>await this._initialize()))(),await this.initializePromise)}async _initialize(){var e;try{let r=(0,me.parseParametersFromURL)(window.location.href),n="none";if(this._isImplicitGrantCallback(r)?n="implicit":await this._isPKCECallback(r)&&(n="pkce"),(0,me.isBrowser)()&&this.detectSessionInUrl&&n!=="none"){let{data:i,error:o}=await this._getSessionFromURL(r,n);if(o){if(this._debug("#_initialize()","error detecting session from URL",o),(0,X.isAuthImplicitGrantRedirectError)(o)){let u=(e=o.details)===null||e===void 0?void 0:e.code;if(u==="identity_already_exists"||u==="identity_not_found"||u==="single_identity_not_deletable")return{error:o}}return await this._removeSession(),{error:o}}let{session:s,redirectType:a}=i;return this._debug("#_initialize()","detected session in URL",s,"redirect type",a),await this._saveSession(s),setTimeout(async()=>{a==="recovery"?await this._notifyAllSubscribers("PASSWORD_RECOVERY",s):await this._notifyAllSubscribers("SIGNED_IN",s)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(r){return(0,X.isAuthError)(r)?{error:r}:{error:new X.AuthUnknownError("Unexpected error during initialization",r)}}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(e){var r,n,i;try{let o=await(0,se._request)(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{data:(n=(r=e?.options)===null||r===void 0?void 0:r.data)!==null&&n!==void 0?n:{},gotrue_meta_security:{captcha_token:(i=e?.options)===null||i===void 0?void 0:i.captchaToken}},xform:se._sessionResponse}),{data:s,error:a}=o;if(a||!s)return{data:{user:null,session:null},error:a};let u=s.session,l=s.user;return s.session&&(await this._saveSession(s.session),await this._notifyAllSubscribers("SIGNED_IN",u)),{data:{user:l,session:u},error:null}}catch(o){if((0,X.isAuthError)(o))return{data:{user:null,session:null},error:o};throw o}}async signUp(e){var r,n,i;try{let o;if("email"in e){let{email:c,password:f,options:h}=e,d=null,m=null;this.flowType==="pkce"&&([d,m]=await(0,me.getCodeChallengeAndMethod)(this.storage,this.storageKey)),o=await(0,se._request)(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:h?.emailRedirectTo,body:{email:c,password:f,data:(r=h?.data)!==null&&r!==void 0?r:{},gotrue_meta_security:{captcha_token:h?.captchaToken},code_challenge:d,code_challenge_method:m},xform:se._sessionResponse})}else if("phone"in e){let{phone:c,password:f,options:h}=e;o=await(0,se._request)(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:c,password:f,data:(n=h?.data)!==null&&n!==void 0?n:{},channel:(i=h?.channel)!==null&&i!==void 0?i:"sms",gotrue_meta_security:{captcha_token:h?.captchaToken}},xform:se._sessionResponse})}else throw new X.AuthInvalidCredentialsError("You must provide either an email or phone number and a password");let{data:s,error:a}=o;if(a||!s)return{data:{user:null,session:null},error:a};let u=s.session,l=s.user;return s.session&&(await this._saveSession(s.session),await this._notifyAllSubscribers("SIGNED_IN",u)),{data:{user:l,session:u},error:null}}catch(o){if((0,X.isAuthError)(o))return{data:{user:null,session:null},error:o};throw o}}async signInWithPassword(e){try{let r;if("email"in e){let{email:o,password:s,options:a}=e;r=await(0,se._request)(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:o,password:s,gotrue_meta_security:{captcha_token:a?.captchaToken}},xform:se._sessionResponsePassword})}else if("phone"in e){let{phone:o,password:s,options:a}=e;r=await(0,se._request)(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:o,password:s,gotrue_meta_security:{captcha_token:a?.captchaToken}},xform:se._sessionResponsePassword})}else throw new X.AuthInvalidCredentialsError("You must provide either an email or phone number and a password");let{data:n,error:i}=r;return i?{data:{user:null,session:null},error:i}:!n||!n.session||!n.user?{data:{user:null,session:null},error:new X.AuthInvalidTokenResponseError}:(n.session&&(await this._saveSession(n.session),await this._notifyAllSubscribers("SIGNED_IN",n.session)),{data:Object.assign({user:n.user,session:n.session},n.weak_password?{weakPassword:n.weak_password}:null),error:i})}catch(r){if((0,X.isAuthError)(r))return{data:{user:null,session:null},error:r};throw r}}async signInWithOAuth(e){var r,n,i,o;return await this._handleProviderSignIn(e.provider,{redirectTo:(r=e.options)===null||r===void 0?void 0:r.redirectTo,scopes:(n=e.options)===null||n===void 0?void 0:n.scopes,queryParams:(i=e.options)===null||i===void 0?void 0:i.queryParams,skipBrowserRedirect:(o=e.options)===null||o===void 0?void 0:o.skipBrowserRedirect})}async exchangeCodeForSession(e){return await this.initializePromise,this._acquireLock(-1,async()=>this._exchangeCodeForSession(e))}async _exchangeCodeForSession(e){let r=await(0,me.getItemAsync)(this.storage,`${this.storageKey}-code-verifier`),[n,i]=(r??"").split("/");try{let{data:o,error:s}=await(0,se._request)(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:e,code_verifier:n},xform:se._sessionResponse});if(await(0,me.removeItemAsync)(this.storage,`${this.storageKey}-code-verifier`),s)throw s;return!o||!o.session||!o.user?{data:{user:null,session:null,redirectType:null},error:new X.AuthInvalidTokenResponseError}:(o.session&&(await this._saveSession(o.session),await this._notifyAllSubscribers("SIGNED_IN",o.session)),{data:Object.assign(Object.assign({},o),{redirectType:i??null}),error:s})}catch(o){if((0,X.isAuthError)(o))return{data:{user:null,session:null,redirectType:null},error:o};throw o}}async signInWithIdToken(e){try{let{options:r,provider:n,token:i,access_token:o,nonce:s}=e,a=await(0,se._request)(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:n,id_token:i,access_token:o,nonce:s,gotrue_meta_security:{captcha_token:r?.captchaToken}},xform:se._sessionResponse}),{data:u,error:l}=a;return l?{data:{user:null,session:null},error:l}:!u||!u.session||!u.user?{data:{user:null,session:null},error:new X.AuthInvalidTokenResponseError}:(u.session&&(await this._saveSession(u.session),await this._notifyAllSubscribers("SIGNED_IN",u.session)),{data:u,error:l})}catch(r){if((0,X.isAuthError)(r))return{data:{user:null,session:null},error:r};throw r}}async signInWithOtp(e){var r,n,i,o,s;try{if("email"in e){let{email:a,options:u}=e,l=null,c=null;this.flowType==="pkce"&&([l,c]=await(0,me.getCodeChallengeAndMethod)(this.storage,this.storageKey));let{error:f}=await(0,se._request)(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:a,data:(r=u?.data)!==null&&r!==void 0?r:{},create_user:(n=u?.shouldCreateUser)!==null&&n!==void 0?n:!0,gotrue_meta_security:{captcha_token:u?.captchaToken},code_challenge:l,code_challenge_method:c},redirectTo:u?.emailRedirectTo});return{data:{user:null,session:null},error:f}}if("phone"in e){let{phone:a,options:u}=e,{data:l,error:c}=await(0,se._request)(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:a,data:(i=u?.data)!==null&&i!==void 0?i:{},create_user:(o=u?.shouldCreateUser)!==null&&o!==void 0?o:!0,gotrue_meta_security:{captcha_token:u?.captchaToken},channel:(s=u?.channel)!==null&&s!==void 0?s:"sms"}});return{data:{user:null,session:null,messageId:l?.message_id},error:c}}throw new X.AuthInvalidCredentialsError("You must provide either an email or phone number.")}catch(a){if((0,X.isAuthError)(a))return{data:{user:null,session:null},error:a};throw a}}async verifyOtp(e){var r,n;try{let i,o;"options"in e&&(i=(r=e.options)===null||r===void 0?void 0:r.redirectTo,o=(n=e.options)===null||n===void 0?void 0:n.captchaToken);let{data:s,error:a}=await(0,se._request)(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},e),{gotrue_meta_security:{captcha_token:o}}),redirectTo:i,xform:se._sessionResponse});if(a)throw a;if(!s)throw new Error("An error occurred on token verification.");let u=s.session,l=s.user;return u?.access_token&&(await this._saveSession(u),await this._notifyAllSubscribers(e.type=="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",u)),{data:{user:l,session:u},error:null}}catch(i){if((0,X.isAuthError)(i))return{data:{user:null,session:null},error:i};throw i}}async signInWithSSO(e){var r,n,i;try{let o=null,s=null;return this.flowType==="pkce"&&([o,s]=await(0,me.getCodeChallengeAndMethod)(this.storage,this.storageKey)),await(0,se._request)(this.fetch,"POST",`${this.url}/sso`,{body:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},"providerId"in e?{provider_id:e.providerId}:null),"domain"in e?{domain:e.domain}:null),{redirect_to:(n=(r=e.options)===null||r===void 0?void 0:r.redirectTo)!==null&&n!==void 0?n:void 0}),!((i=e?.options)===null||i===void 0)&&i.captchaToken?{gotrue_meta_security:{captcha_token:e.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:o,code_challenge_method:s}),headers:this.headers,xform:se._ssoResponse})}catch(o){if((0,X.isAuthError)(o))return{data:null,error:o};throw o}}async reauthenticate(){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._reauthenticate())}async _reauthenticate(){try{return await this._useSession(async e=>{let{data:{session:r},error:n}=e;if(n)throw n;if(!r)throw new X.AuthSessionMissingError;let{error:i}=await(0,se._request)(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:r.access_token});return{data:{user:null,session:null},error:i}})}catch(e){if((0,X.isAuthError)(e))return{data:{user:null,session:null},error:e};throw e}}async resend(e){try{let r=`${this.url}/resend`;if("email"in e){let{email:n,type:i,options:o}=e,{error:s}=await(0,se._request)(this.fetch,"POST",r,{headers:this.headers,body:{email:n,type:i,gotrue_meta_security:{captcha_token:o?.captchaToken}},redirectTo:o?.emailRedirectTo});return{data:{user:null,session:null},error:s}}else if("phone"in e){let{phone:n,type:i,options:o}=e,{data:s,error:a}=await(0,se._request)(this.fetch,"POST",r,{headers:this.headers,body:{phone:n,type:i,gotrue_meta_security:{captcha_token:o?.captchaToken}}});return{data:{user:null,session:null,messageId:s?.message_id},error:a}}throw new X.AuthInvalidCredentialsError("You must provide either an email or phone number and a type")}catch(r){if((0,X.isAuthError)(r))return{data:{user:null,session:null},error:r};throw r}}async getSession(){return await this.initializePromise,await this._acquireLock(-1,async()=>this._useSession(async r=>r))}async _acquireLock(e,r){this._debug("#_acquireLock","begin",e);try{if(this.lockAcquired){let n=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),i=(async()=>(await n,await r()))();return this.pendingInLock.push((async()=>{try{await i}catch{}})()),i}return await this.lock(`lock:${this.storageKey}`,e,async()=>{this._debug("#_acquireLock","lock acquired for storage key",this.storageKey);try{this.lockAcquired=!0;let n=r();for(this.pendingInLock.push((async()=>{try{await n}catch{}})()),await n;this.pendingInLock.length;){let i=[...this.pendingInLock];await Promise.all(i),this.pendingInLock.splice(0,i.length)}return await n}finally{this._debug("#_acquireLock","lock released for storage key",this.storageKey),this.lockAcquired=!1}})}finally{this._debug("#_acquireLock","end")}}async _useSession(e){this._debug("#_useSession","begin");try{let r=await this.__loadSession();return await e(r)}finally{this._debug("#_useSession","end")}}async __loadSession(){this._debug("#__loadSession()","begin"),this.lockAcquired||this._debug("#__loadSession()","used outside of an acquired lock!",new Error().stack);try{let e=null,r=await(0,me.getItemAsync)(this.storage,this.storageKey);if(this._debug("#getSession()","session from storage",r),r!==null&&(this._isValidSession(r)?e=r:(this._debug("#getSession()","session from storage is not valid"),await this._removeSession())),!e)return{data:{session:null},error:null};let n=e.expires_at?e.expires_at<=Date.now()/1e3:!1;if(this._debug("#__loadSession()",`session has${n?"":" not"} expired`,"expires_at",e.expires_at),!n){if(this.storage.isServer){let s=this.suppressGetSessionWarning;e=new Proxy(e,{get:(u,l,c)=>(!s&&l==="user"&&(console.warn("Using the user object as returned from supabase.auth.getSession() or from some supabase.auth.onAuthStateChange() events could be insecure! This value comes directly from the storage medium (usually cookies on the server) and may not be authentic. Use supabase.auth.getUser() instead which authenticates the data by contacting the Supabase Auth server."),s=!0,this.suppressGetSessionWarning=!0),Reflect.get(u,l,c))})}return{data:{session:e},error:null}}let{session:i,error:o}=await this._callRefreshToken(e.refresh_token);return o?{data:{session:null},error:o}:{data:{session:i},error:null}}finally{this._debug("#__loadSession()","end")}}async getUser(e){return e?await this._getUser(e):(await this.initializePromise,await this._acquireLock(-1,async()=>await this._getUser()))}async _getUser(e){try{return e?await(0,se._request)(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:e,xform:se._userResponse}):await this._useSession(async r=>{var n,i,o;let{data:s,error:a}=r;if(a)throw a;return!(!((n=s.session)===null||n===void 0)&&n.access_token)&&!this.hasCustomAuthorizationHeader?{data:{user:null},error:new X.AuthSessionMissingError}:await(0,se._request)(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:(o=(i=s.session)===null||i===void 0?void 0:i.access_token)!==null&&o!==void 0?o:void 0,xform:se._userResponse})})}catch(r){if((0,X.isAuthError)(r))return(0,X.isAuthSessionMissingError)(r)&&(await this._removeSession(),await(0,me.removeItemAsync)(this.storage,`${this.storageKey}-code-verifier`)),{data:{user:null},error:r};throw r}}async updateUser(e,r={}){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._updateUser(e,r))}async _updateUser(e,r={}){try{return await this._useSession(async n=>{let{data:i,error:o}=n;if(o)throw o;if(!i.session)throw new X.AuthSessionMissingError;let s=i.session,a=null,u=null;this.flowType==="pkce"&&e.email!=null&&([a,u]=await(0,me.getCodeChallengeAndMethod)(this.storage,this.storageKey));let{data:l,error:c}=await(0,se._request)(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:r?.emailRedirectTo,body:Object.assign(Object.assign({},e),{code_challenge:a,code_challenge_method:u}),jwt:s.access_token,xform:se._userResponse});if(c)throw c;return s.user=l.user,await this._saveSession(s),await this._notifyAllSubscribers("USER_UPDATED",s),{data:{user:s.user},error:null}})}catch(n){if((0,X.isAuthError)(n))return{data:{user:null},error:n};throw n}}_decodeJWT(e){return(0,me.decodeJWTPayload)(e)}async setSession(e){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._setSession(e))}async _setSession(e){try{if(!e.access_token||!e.refresh_token)throw new X.AuthSessionMissingError;let r=Date.now()/1e3,n=r,i=!0,o=null,s=(0,me.decodeJWTPayload)(e.access_token);if(s.exp&&(n=s.exp,i=n<=r),i){let{session:a,error:u}=await this._callRefreshToken(e.refresh_token);if(u)return{data:{user:null,session:null},error:u};if(!a)return{data:{user:null,session:null},error:null};o=a}else{let{data:a,error:u}=await this._getUser(e.access_token);if(u)throw u;o={access_token:e.access_token,refresh_token:e.refresh_token,user:a.user,token_type:"bearer",expires_in:n-r,expires_at:n},await this._saveSession(o),await this._notifyAllSubscribers("SIGNED_IN",o)}return{data:{user:o.user,session:o},error:null}}catch(r){if((0,X.isAuthError)(r))return{data:{session:null,user:null},error:r};throw r}}async refreshSession(e){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._refreshSession(e))}async _refreshSession(e){try{return await this._useSession(async r=>{var n;if(!e){let{data:s,error:a}=r;if(a)throw a;e=(n=s.session)!==null&&n!==void 0?n:void 0}if(!e?.refresh_token)throw new X.AuthSessionMissingError;let{session:i,error:o}=await this._callRefreshToken(e.refresh_token);return o?{data:{user:null,session:null},error:o}:i?{data:{user:i.user,session:i},error:null}:{data:{user:null,session:null},error:null}})}catch(r){if((0,X.isAuthError)(r))return{data:{user:null,session:null},error:r};throw r}}async _getSessionFromURL(e,r){try{if(!(0,me.isBrowser)())throw new X.AuthImplicitGrantRedirectError("No browser detected.");if(e.error||e.error_description||e.error_code)throw new X.AuthImplicitGrantRedirectError(e.error_description||"Error in URL with unspecified error_description",{error:e.error||"unspecified_error",code:e.error_code||"unspecified_code"});switch(r){case"implicit":if(this.flowType==="pkce")throw new X.AuthPKCEGrantCodeExchangeError("Not a valid PKCE flow url.");break;case"pkce":if(this.flowType==="implicit")throw new X.AuthImplicitGrantRedirectError("Not a valid implicit grant flow url.");break;default:}if(r==="pkce"){if(this._debug("#_initialize()","begin","is PKCE flow",!0),!e.code)throw new X.AuthPKCEGrantCodeExchangeError("No code detected.");let{data:F,error:g}=await this._exchangeCodeForSession(e.code);if(g)throw g;let C=new URL(window.location.href);return C.searchParams.delete("code"),window.history.replaceState(window.history.state,"",C.toString()),{data:{session:F.session,redirectType:null},error:null}}let{provider_token:n,provider_refresh_token:i,access_token:o,refresh_token:s,expires_in:a,expires_at:u,token_type:l}=e;if(!o||!a||!s||!l)throw new X.AuthImplicitGrantRedirectError("No session defined in URL");let c=Math.round(Date.now()/1e3),f=parseInt(a),h=c+f;u&&(h=parseInt(u));let d=h-c;d*1e3<=Ya&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${d}s, should have been closer to ${f}s`);let m=h-f;c-m>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",m,h,c):c-m<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew",m,h,c);let{data:b,error:y}=await this._getUser(o);if(y)throw y;let E={provider_token:n,provider_refresh_token:i,access_token:o,expires_in:f,expires_at:h,refresh_token:s,token_type:l,user:b.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),{data:{session:E,redirectType:e.type},error:null}}catch(n){if((0,X.isAuthError)(n))return{data:{session:null,redirectType:null},error:n};throw n}}_isImplicitGrantCallback(e){return!!(e.access_token||e.error_description)}async _isPKCECallback(e){let r=await(0,me.getItemAsync)(this.storage,`${this.storageKey}-code-verifier`);return!!(e.code&&r)}async signOut(e={scope:"global"}){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._signOut(e))}async _signOut({scope:e}={scope:"global"}){return await this._useSession(async r=>{var n;let{data:i,error:o}=r;if(o)return{error:o};let s=(n=i.session)===null||n===void 0?void 0:n.access_token;if(s){let{error:a}=await this.admin.signOut(s,e);if(a&&!((0,X.isAuthApiError)(a)&&(a.status===404||a.status===401||a.status===403)))return{error:a}}return e!=="others"&&(await this._removeSession(),await(0,me.removeItemAsync)(this.storage,`${this.storageKey}-code-verifier`)),{error:null}})}onAuthStateChange(e){let r=(0,me.uuid)(),n={id:r,callback:e,unsubscribe:()=>{this._debug("#unsubscribe()","state change callback with id removed",r),this.stateChangeEmitters.delete(r)}};return this._debug("#onAuthStateChange()","registered callback with id",r),this.stateChangeEmitters.set(r,n),(async()=>(await this.initializePromise,await this._acquireLock(-1,async()=>{this._emitInitialSession(r)})))(),{data:{subscription:n}}}async _emitInitialSession(e){return await this._useSession(async r=>{var n,i;try{let{data:{session:o},error:s}=r;if(s)throw s;await((n=this.stateChangeEmitters.get(e))===null||n===void 0?void 0:n.callback("INITIAL_SESSION",o)),this._debug("INITIAL_SESSION","callback id",e,"session",o)}catch(o){await((i=this.stateChangeEmitters.get(e))===null||i===void 0?void 0:i.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",e,"error",o),console.error(o)}})}async resetPasswordForEmail(e,r={}){let n=null,i=null;this.flowType==="pkce"&&([n,i]=await(0,me.getCodeChallengeAndMethod)(this.storage,this.storageKey,!0));try{return await(0,se._request)(this.fetch,"POST",`${this.url}/recover`,{body:{email:e,code_challenge:n,code_challenge_method:i,gotrue_meta_security:{captcha_token:r.captchaToken}},headers:this.headers,redirectTo:r.redirectTo})}catch(o){if((0,X.isAuthError)(o))return{data:null,error:o};throw o}}async getUserIdentities(){var e;try{let{data:r,error:n}=await this.getUser();if(n)throw n;return{data:{identities:(e=r.user.identities)!==null&&e!==void 0?e:[]},error:null}}catch(r){if((0,X.isAuthError)(r))return{data:null,error:r};throw r}}async linkIdentity(e){var r;try{let{data:n,error:i}=await this._useSession(async o=>{var s,a,u,l,c;let{data:f,error:h}=o;if(h)throw h;let d=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,e.provider,{redirectTo:(s=e.options)===null||s===void 0?void 0:s.redirectTo,scopes:(a=e.options)===null||a===void 0?void 0:a.scopes,queryParams:(u=e.options)===null||u===void 0?void 0:u.queryParams,skipBrowserRedirect:!0});return await(0,se._request)(this.fetch,"GET",d,{headers:this.headers,jwt:(c=(l=f.session)===null||l===void 0?void 0:l.access_token)!==null&&c!==void 0?c:void 0})});if(i)throw i;return(0,me.isBrowser)()&&!(!((r=e.options)===null||r===void 0)&&r.skipBrowserRedirect)&&window.location.assign(n?.url),{data:{provider:e.provider,url:n?.url},error:null}}catch(n){if((0,X.isAuthError)(n))return{data:{provider:e.provider,url:null},error:n};throw n}}async unlinkIdentity(e){try{return await this._useSession(async r=>{var n,i;let{data:o,error:s}=r;if(s)throw s;return await(0,se._request)(this.fetch,"DELETE",`${this.url}/user/identities/${e.identity_id}`,{headers:this.headers,jwt:(i=(n=o.session)===null||n===void 0?void 0:n.access_token)!==null&&i!==void 0?i:void 0})})}catch(r){if((0,X.isAuthError)(r))return{data:null,error:r};throw r}}async _refreshAccessToken(e){let r=`#_refreshAccessToken(${e.substring(0,5)}...)`;this._debug(r,"begin");try{let n=Date.now();return await(0,me.retryable)(async i=>(i>0&&await(0,me.sleep)(200*Math.pow(2,i-1)),this._debug(r,"refreshing attempt",i),await(0,se._request)(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:e},headers:this.headers,xform:se._sessionResponse})),(i,o)=>{let s=200*Math.pow(2,i);return o&&(0,X.isAuthRetryableFetchError)(o)&&Date.now()+s-n<Ya})}catch(n){if(this._debug(r,"error",n),(0,X.isAuthError)(n))return{data:{session:null,user:null},error:n};throw n}finally{this._debug(r,"end")}}_isValidSession(e){return typeof e=="object"&&e!==null&&"access_token"in e&&"refresh_token"in e&&"expires_at"in e}async _handleProviderSignIn(e,r){let n=await this._getUrlForProvider(`${this.url}/authorize`,e,{redirectTo:r.redirectTo,scopes:r.scopes,queryParams:r.queryParams});return this._debug("#_handleProviderSignIn()","provider",e,"options",r,"url",n),(0,me.isBrowser)()&&!r.skipBrowserRedirect&&window.location.assign(n),{data:{provider:e,url:n},error:null}}async _recoverAndRefresh(){var e;let r="#_recoverAndRefresh()";this._debug(r,"begin");try{let n=await(0,me.getItemAsync)(this.storage,this.storageKey);if(this._debug(r,"session from storage",n),!this._isValidSession(n)){this._debug(r,"session is not valid"),n!==null&&await this._removeSession();return}let i=Math.round(Date.now()/1e3),o=((e=n.expires_at)!==null&&e!==void 0?e:1/0)<i+Ja.EXPIRY_MARGIN;if(this._debug(r,`session has${o?"":" not"} expired with margin of ${Ja.EXPIRY_MARGIN}s`),o){if(this.autoRefreshToken&&n.refresh_token){let{error:s}=await this._callRefreshToken(n.refresh_token);s&&(console.error(s),(0,X.isAuthRetryableFetchError)(s)||(this._debug(r,"refresh failed with a non-retryable error, removing the session",s),await this._removeSession()))}}else await this._notifyAllSubscribers("SIGNED_IN",n)}catch(n){this._debug(r,"error",n),console.error(n);return}finally{this._debug(r,"end")}}async _callRefreshToken(e){var r,n;if(!e)throw new X.AuthSessionMissingError;if(this.refreshingDeferred)return this.refreshingDeferred.promise;let i=`#_callRefreshToken(${e.substring(0,5)}...)`;this._debug(i,"begin");try{this.refreshingDeferred=new me.Deferred;let{data:o,error:s}=await this._refreshAccessToken(e);if(s)throw s;if(!o.session)throw new X.AuthSessionMissingError;await this._saveSession(o.session),await this._notifyAllSubscribers("TOKEN_REFRESHED",o.session);let a={session:o.session,error:null};return this.refreshingDeferred.resolve(a),a}catch(o){if(this._debug(i,"error",o),(0,X.isAuthError)(o)){let s={session:null,error:o};return(0,X.isAuthRetryableFetchError)(o)||await this._removeSession(),(r=this.refreshingDeferred)===null||r===void 0||r.resolve(s),s}throw(n=this.refreshingDeferred)===null||n===void 0||n.reject(o),o}finally{this.refreshingDeferred=null,this._debug(i,"end")}}async _notifyAllSubscribers(e,r,n=!0){let i=`#_notifyAllSubscribers(${e})`;this._debug(i,"begin",r,`broadcast = ${n}`);try{this.broadcastChannel&&n&&this.broadcastChannel.postMessage({event:e,session:r});let o=[],s=Array.from(this.stateChangeEmitters.values()).map(async a=>{try{await a.callback(e,r)}catch(u){o.push(u)}});if(await Promise.all(s),o.length>0){for(let a=0;a<o.length;a+=1)console.error(o[a]);throw o[0]}}finally{this._debug(i,"end")}}async _saveSession(e){this._debug("#_saveSession()",e),this.suppressGetSessionWarning=!0,await(0,me.setItemAsync)(this.storage,this.storageKey,e)}async _removeSession(){this._debug("#_removeSession()"),await(0,me.removeItemAsync)(this.storage,this.storageKey),await this._notifyAllSubscribers("SIGNED_OUT",null)}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()");let e=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{e&&(0,me.isBrowser)()&&window?.removeEventListener&&window.removeEventListener("visibilitychange",e)}catch(r){console.error("removing visibilitychange callback failed",r)}}async _startAutoRefresh(){await this._stopAutoRefresh(),this._debug("#_startAutoRefresh()");let e=setInterval(()=>this._autoRefreshTokenTick(),Ya);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)/Ya);this._debug("#_autoRefreshTokenTick()",`access token expires in ${i} ticks, a tick lasts ${Ya}ms, refresh threshold is ${Jw} ticks`),i<=Jw&&await this._callRefreshToken(n.refresh_token)})}catch(r){console.error("Auto refresh tick failed with error. This is likely a transient error.",r)}}finally{this._debug("#_autoRefreshTokenTick()","end")}})}catch(e){if(e.isAcquireTimeout||e instanceof Yw.LockAcquireTimeoutError)this._debug("auto refresh token tick lock not available");else throw e}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!(0,me.isBrowser)()||!window?.addEventListener)return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>await this._onVisibilityChanged(!1),window?.addEventListener("visibilitychange",this.visibilityChangedCallback),await this._onVisibilityChanged(!0)}catch(e){console.error("_handleVisibilityChange",e)}}async _onVisibilityChanged(e){let r=`#_onVisibilityChanged(${e})`;this._debug(r,"visibilityState",document.visibilityState),document.visibilityState==="visible"?(this.autoRefreshToken&&this._startAutoRefresh(),e||(await this.initializePromise,await this._acquireLock(-1,async()=>{if(document.visibilityState!=="visible"){this._debug(r,"acquired the lock to recover the session, but the browser visibilityState is no longer visible, aborting");return}await this._recoverAndRefresh()}))):document.visibilityState==="hidden"&&this.autoRefreshToken&&this._stopAutoRefresh()}async _getUrlForProvider(e,r,n){let i=[`provider=${encodeURIComponent(r)}`];if(n?.redirectTo&&i.push(`redirect_to=${encodeURIComponent(n.redirectTo)}`),n?.scopes&&i.push(`scopes=${encodeURIComponent(n.scopes)}`),this.flowType==="pkce"){let[o,s]=await(0,me.getCodeChallengeAndMethod)(this.storage,this.storageKey),a=new URLSearchParams({code_challenge:`${encodeURIComponent(o)}`,code_challenge_method:`${encodeURIComponent(s)}`});i.push(a.toString())}if(n?.queryParams){let o=new URLSearchParams(n.queryParams);i.push(o.toString())}return n?.skipBrowserRedirect&&i.push(`skip_http_redirect=${n.skipBrowserRedirect}`),`${e}?${i.join("&")}`}async _unenroll(e){try{return await this._useSession(async r=>{var n;let{data:i,error:o}=r;return o?{data:null,error:o}:await(0,se._request)(this.fetch,"DELETE",`${this.url}/factors/${e.factorId}`,{headers:this.headers,jwt:(n=i?.session)===null||n===void 0?void 0:n.access_token})})}catch(r){if((0,X.isAuthError)(r))return{data:null,error:r};throw r}}async _enroll(e){try{return await this._useSession(async r=>{var n,i;let{data:o,error:s}=r;if(s)return{data:null,error:s};let a=Object.assign({friendly_name:e.friendlyName,factor_type:e.factorType},e.factorType==="phone"?{phone:e.phone}:{issuer:e.issuer}),{data:u,error:l}=await(0,se._request)(this.fetch,"POST",`${this.url}/factors`,{body:a,headers:this.headers,jwt:(n=o?.session)===null||n===void 0?void 0:n.access_token});return l?{data:null,error:l}:(e.factorType==="totp"&&(!((i=u?.totp)===null||i===void 0)&&i.qr_code)&&(u.totp.qr_code=`data:image/svg+xml;utf-8,${u.totp.qr_code}`),{data:u,error:null})})}catch(r){if((0,X.isAuthError)(r))return{data:null,error:r};throw r}}async _verify(e){return this._acquireLock(-1,async()=>{try{return await this._useSession(async r=>{var n;let{data:i,error:o}=r;if(o)return{data:null,error:o};let{data:s,error:a}=await(0,se._request)(this.fetch,"POST",`${this.url}/factors/${e.factorId}/verify`,{body:{code:e.code,challenge_id:e.challengeId},headers:this.headers,jwt:(n=i?.session)===null||n===void 0?void 0:n.access_token});return a?{data:null,error:a}:(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+s.expires_in},s)),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",s),{data:s,error:a})})}catch(r){if((0,X.isAuthError)(r))return{data:null,error:r};throw r}})}async _challenge(e){return this._acquireLock(-1,async()=>{try{return await this._useSession(async r=>{var n;let{data:i,error:o}=r;return o?{data:null,error:o}:await(0,se._request)(this.fetch,"POST",`${this.url}/factors/${e.factorId}/challenge`,{body:{channel:e.channel},headers:this.headers,jwt:(n=i?.session)===null||n===void 0?void 0:n.access_token})})}catch(r){if((0,X.isAuthError)(r))return{data:null,error:r};throw r}})}async _challengeAndVerify(e){let{data:r,error:n}=await this._challenge({factorId:e.factorId});return n?{data:null,error:n}:await this._verify({factorId:e.factorId,challengeId:r.id,code:e.code})}async _listFactors(){let{data:{user:e},error:r}=await this.getUser();if(r)return{data:null,error:r};let n=e?.factors||[],i=n.filter(s=>s.factor_type==="totp"&&s.status==="verified"),o=n.filter(s=>s.factor_type==="phone"&&s.status==="verified");return{data:{all:n,totp:i,phone:o},error:null}}async _getAuthenticatorAssuranceLevel(){return this._acquireLock(-1,async()=>await this._useSession(async e=>{var r,n;let{data:{session:i},error:o}=e;if(o)return{data:null,error:o};if(!i)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};let s=this._decodeJWT(i.access_token),a=null;s.aal&&(a=s.aal);let u=a;((n=(r=i.user.factors)===null||r===void 0?void 0:r.filter(f=>f.status==="verified"))!==null&&n!==void 0?n:[]).length>0&&(u="aal2");let c=s.amr||[];return{data:{currentLevel:a,nextLevel:u,currentAuthenticationMethods:c},error:null}}))}};Xa.default=bc;bc.nextInstanceID=0});var Zw=D(Za=>{"use strict";var ZB=Za&&Za.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Za,"__esModule",{value:!0});var QB=ZB(gc()),eq=QB.default;Za.default=eq});var Qw=D(Qa=>{"use strict";var tq=Qa&&Qa.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Qa,"__esModule",{value:!0});var rq=tq(bm()),nq=rq.default;Qa.default=nq});var t_=D(e_=>{"use strict";Object.defineProperty(e_,"__esModule",{value:!0})});var _m=D(Le=>{"use strict";var iq=Le&&Le.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),r_=Le&&Le.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&iq(e,t,r)},wc=Le&&Le.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Le,"__esModule",{value:!0});Le.lockInternals=Le.NavigatorLockAcquireTimeoutError=Le.navigatorLock=Le.AuthClient=Le.AuthAdminApi=Le.GoTrueClient=Le.GoTrueAdminApi=void 0;var oq=wc(gc());Le.GoTrueAdminApi=oq.default;var sq=wc(bm());Le.GoTrueClient=sq.default;var aq=wc(Zw());Le.AuthAdminApi=aq.default;var uq=wc(Qw());Le.AuthClient=uq.default;r_(t_(),Le);r_(Ga(),Le);var wm=Dm();Object.defineProperty(Le,"navigatorLock",{enumerable:!0,get:function(){return wm.navigatorLock}});Object.defineProperty(Le,"NavigatorLockAcquireTimeoutError",{enumerable:!0,get:function(){return wm.NavigatorLockAcquireTimeoutError}});Object.defineProperty(Le,"lockInternals",{enumerable:!0,get:function(){return wm.internals}})});var n_=D(_c=>{"use strict";Object.defineProperty(_c,"__esModule",{value:!0});_c.SupabaseAuthClient=void 0;var lq=_m(),Em=class extends lq.AuthClient{constructor(e){super(e)}};_c.SupabaseAuthClient=Em});var Sm=D(eu=>{"use strict";var cq=eu&&eu.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(c){try{l(n.next(c))}catch(f){s(f)}}function u(c){try{l(n.throw(c))}catch(f){s(f)}}function l(c){c.done?o(c.value):i(c.value).then(a,u)}l((n=n.apply(t,e||[])).next())})};Object.defineProperty(eu,"__esModule",{value:!0});var fq=Rp(),dq=zp(),hq=(Kp(),je(Wp)),pq=jw(),Ec=Lw(),mq=qw(),i_=Mw(),gq=n_(),Cm=class{constructor(e,r,n){var i,o,s;if(this.supabaseUrl=e,this.supabaseKey=r,!e)throw new Error("supabaseUrl is required.");if(!r)throw new Error("supabaseKey is required.");let a=(0,i_.stripTrailingSlash)(e);this.realtimeUrl=`${a}/realtime/v1`.replace(/^http/i,"ws"),this.authUrl=`${a}/auth/v1`,this.storageUrl=`${a}/storage/v1`,this.functionsUrl=`${a}/functions/v1`;let u=`sb-${new URL(this.authUrl).hostname.split(".")[0]}-auth-token`,l={db:Ec.DEFAULT_DB_OPTIONS,realtime:Ec.DEFAULT_REALTIME_OPTIONS,auth:Object.assign(Object.assign({},Ec.DEFAULT_AUTH_OPTIONS),{storageKey:u}),global:Ec.DEFAULT_GLOBAL_OPTIONS},c=(0,i_.applySettingDefaults)(n??{},l);this.storageKey=(i=c.auth.storageKey)!==null&&i!==void 0?i:"",this.headers=(o=c.global.headers)!==null&&o!==void 0?o:{},c.accessToken?(this.accessToken=c.accessToken,this.auth=new Proxy({},{get:(f,h)=>{throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(h)} is not possible`)}})):this.auth=this._initSupabaseAuthClient((s=c.auth)!==null&&s!==void 0?s:{},this.headers,c.global.fetch),this.fetch=(0,mq.fetchWithAuth)(r,this._getAccessToken.bind(this),c.global.fetch),this.realtime=this._initRealtimeClient(Object.assign({headers:this.headers,accessToken:this._getAccessToken.bind(this)},c.realtime)),this.rest=new dq.PostgrestClient(`${a}/rest/v1`,{headers:this.headers,schema:c.db.schema,fetch:this.fetch}),c.accessToken||this._listenForAuthEvents()}get functions(){return new fq.FunctionsClient(this.functionsUrl,{headers:this.headers,customFetch:this.fetch})}get storage(){return new pq.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 cq(this,void 0,void 0,function*(){if(this.accessToken)return yield this.accessToken();let{data:n}=yield this.auth.getSession();return(r=(e=n.session)===null||e===void 0?void 0:e.access_token)!==null&&r!==void 0?r:null})}_initSupabaseAuthClient({autoRefreshToken:e,persistSession:r,detectSessionInUrl:n,storage:i,storageKey:o,flowType:s,lock:a,debug:u},l,c){let f={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new gq.SupabaseAuthClient({url:this.authUrl,headers:Object.assign(Object.assign({},f),l),storageKey:o,autoRefreshToken:e,persistSession:r,detectSessionInUrl:n,storage:i,flowType:s,lock:a,debug:u,fetch:c,hasCustomAuthorizationHeader:"Authorization"in this.headers})}_initRealtimeClient(e){return new hq.RealtimeClient(this.realtimeUrl,Object.assign(Object.assign({},e),{params:Object.assign({apikey:this.supabaseKey},e?.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((r,n)=>{this._handleTokenChanged(r,"CLIENT",n?.access_token)})}_handleTokenChanged(e,r,n){(e==="TOKEN_REFRESHED"||e==="SIGNED_IN")&&this.changedAccessToken!==n?this.changedAccessToken=n:e==="SIGNED_OUT"&&(this.realtime.setAuth(),r=="STORAGE"&&this.auth.signOut(),this.changedAccessToken=void 0)}};eu.default=Cm});var a_=D(Se=>{"use strict";var yq=Se&&Se.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),o_=Se&&Se.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&yq(e,t,r)},s_=Se&&Se.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Se,"__esModule",{value:!0});Se.createClient=Se.SupabaseClient=Se.FunctionRegion=Se.FunctionsError=Se.FunctionsRelayError=Se.FunctionsFetchError=Se.FunctionsHttpError=Se.PostgrestError=void 0;var Dq=s_(Sm());o_(_m(),Se);var vq=zp();Object.defineProperty(Se,"PostgrestError",{enumerable:!0,get:function(){return vq.PostgrestError}});var tu=Rp();Object.defineProperty(Se,"FunctionsHttpError",{enumerable:!0,get:function(){return tu.FunctionsHttpError}});Object.defineProperty(Se,"FunctionsFetchError",{enumerable:!0,get:function(){return tu.FunctionsFetchError}});Object.defineProperty(Se,"FunctionsRelayError",{enumerable:!0,get:function(){return tu.FunctionsRelayError}});Object.defineProperty(Se,"FunctionsError",{enumerable:!0,get:function(){return tu.FunctionsError}});Object.defineProperty(Se,"FunctionRegion",{enumerable:!0,get:function(){return tu.FunctionRegion}});o_((Kp(),je(Wp)),Se);var bq=Sm();Object.defineProperty(Se,"SupabaseClient",{enumerable:!0,get:function(){return s_(bq).default}});var wq=(t,e,r)=>new Dq.default(t,e,r);Se.createClient=wq});var xm=D(($ae,u_)=>{u_.exports=require("stream")});var p_=D((Iae,h_)=>{"use strict";function l_(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function c_(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?l_(Object(r),!0).forEach(function(n){_q(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):l_(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function _q(t,e,r){return e=d_(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Eq(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function f_(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,d_(n.key),n)}}function Cq(t,e,r){return e&&f_(t.prototype,e),r&&f_(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function d_(t){var e=Sq(t,"string");return typeof e=="symbol"?e:String(e)}function Sq(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 xq=require("buffer"),Cc=xq.Buffer,Fq=require("util"),Fm=Fq.inspect,Oq=Fm&&Fm.custom||"inspect";function Aq(t,e,r){Cc.prototype.copy.call(t,e,r)}h_.exports=function(){function t(){Eq(this,t),this.head=null,this.tail=null,this.length=0}return Cq(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 Cc.alloc(0);for(var n=Cc.allocUnsafe(r>>>0),i=this.head,o=0;i;)Aq(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=Cc.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:Oq,value:function(r,n){return Fm(this,c_(c_({},n),{},{depth:0,customInspect:!1}))}}]),t}()});var Am=D((jae,g_)=>{"use strict";function kq(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(Om,this,t)):process.nextTick(Om,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(Sc,r):(r._writableState.errorEmitted=!0,process.nextTick(m_,r,o)):process.nextTick(m_,r,o):e?(process.nextTick(Sc,r),e(o)):process.nextTick(Sc,r)}),this)}function m_(t,e){Om(t,e),Sc(t)}function Sc(t){t._writableState&&!t._writableState.emitClose||t._readableState&&!t._readableState.emitClose||t.emit("close")}function Tq(){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 Om(t,e){t.emit("error",e)}function Pq(t,e){var r=t._readableState,n=t._writableState;r&&r.autoDestroy||n&&n.autoDestroy?t.destroy(e):t.emit("error",e)}g_.exports={destroy:kq,undestroy:Tq,errorOrDestroy:Pq}});var Mn=D((Nae,v_)=>{"use strict";var D_={};function dr(t,e,r){r||(r=Error);function n(o,s,a){return typeof e=="string"?e:e(o,s,a)}class i extends r{constructor(s,a,u){super(n(s,a,u))}}i.prototype.name=r.name,i.prototype.code=t,D_[t]=i}function y_(t,e){if(Array.isArray(t)){let r=t.length;return t=t.map(n=>String(n)),r>2?`one of ${e} ${t.slice(0,r-1).join(", ")}, or `+t[r-1]:r===2?`one of ${e} ${t[0]} or ${t[1]}`:`of ${e} ${t[0]}`}else return`of ${e} ${String(t)}`}function Rq(t,e,r){return t.substr(!r||r<0?0:+r,e.length)===e}function $q(t,e,r){return(r===void 0||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}function Iq(t,e,r){return typeof r!="number"&&(r=0),r+e.length>t.length?!1:t.indexOf(e,r)!==-1}dr("ERR_INVALID_OPT_VALUE",function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'},TypeError);dr("ERR_INVALID_ARG_TYPE",function(t,e,r){let n;typeof e=="string"&&Rq(e,"not ")?(n="must not be",e=e.replace(/^not /,"")):n="must be";let i;if($q(t," argument"))i=`The ${t} ${n} ${y_(e,"type")}`;else{let o=Iq(t,".")?"property":"argument";i=`The "${t}" ${o} ${n} ${y_(e,"type")}`}return i+=`. Received type ${typeof r}`,i},TypeError);dr("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");dr("ERR_METHOD_NOT_IMPLEMENTED",function(t){return"The "+t+" method is not implemented"});dr("ERR_STREAM_PREMATURE_CLOSE","Premature close");dr("ERR_STREAM_DESTROYED",function(t){return"Cannot call "+t+" after a stream was destroyed"});dr("ERR_MULTIPLE_CALLBACK","Callback called multiple times");dr("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");dr("ERR_STREAM_WRITE_AFTER_END","write after end");dr("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);dr("ERR_UNKNOWN_ENCODING",function(t){return"Unknown encoding: "+t},TypeError);dr("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");v_.exports.codes=D_});var km=D((Lae,b_)=>{"use strict";var jq=Mn().codes.ERR_INVALID_OPT_VALUE;function Nq(t,e,r){return t.highWaterMark!=null?t.highWaterMark:e?t[r]:null}function Lq(t,e,r,n){var i=Nq(e,n,r);if(i!=null){if(!(isFinite(i)&&Math.floor(i)===i)||i<0){var o=n?r:"highWaterMark";throw new jq(o,i)}return Math.floor(i)}return t.objectMode?16:16*1024}b_.exports={getHighWaterMark:Lq}});var w_=D((Bae,Tm)=>{typeof Object.create=="function"?Tm.exports=function(e,r){r&&(e.super_=r,e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:Tm.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 Wo=D((qae,Rm)=>{try{if(Pm=require("util"),typeof Pm.inherits!="function")throw"";Rm.exports=Pm.inherits}catch{Rm.exports=w_()}var Pm});var E_=D((Mae,__)=>{__.exports=require("util").deprecate});var jm=D((Uae,A_)=>{"use strict";A_.exports=Ye;function S_(t){var e=this;this.next=null,this.entry=null,this.finish=function(){fM(e,t)}}var Ko;Ye.WritableState=nu;var Bq={deprecate:E_()},x_=xm(),Fc=require("buffer").Buffer,qq=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function Mq(t){return Fc.from(t)}function Uq(t){return Fc.isBuffer(t)||t instanceof qq}var Im=Am(),Hq=km(),Vq=Hq.getHighWaterMark,Un=Mn().codes,zq=Un.ERR_INVALID_ARG_TYPE,Gq=Un.ERR_METHOD_NOT_IMPLEMENTED,Wq=Un.ERR_MULTIPLE_CALLBACK,Kq=Un.ERR_STREAM_CANNOT_PIPE,Yq=Un.ERR_STREAM_DESTROYED,Jq=Un.ERR_STREAM_NULL_VALUES,Xq=Un.ERR_STREAM_WRITE_AFTER_END,Zq=Un.ERR_UNKNOWN_ENCODING,Yo=Im.errorOrDestroy;Wo()(Ye,x_);function Qq(){}function nu(t,e,r){Ko=Ko||Ci(),t=t||{},typeof r!="boolean"&&(r=e instanceof Ko),this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=Vq(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){sM(e,i)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=t.emitClose!==!1,this.autoDestroy=!!t.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new S_(this)}nu.prototype.getBuffer=function(){for(var e=this.bufferedRequest,r=[];e;)r.push(e),e=e.next;return r};(function(){try{Object.defineProperty(nu.prototype,"buffer",{get:Bq.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var xc;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(xc=Function.prototype[Symbol.hasInstance],Object.defineProperty(Ye,Symbol.hasInstance,{value:function(e){return xc.call(this,e)?!0:this!==Ye?!1:e&&e._writableState instanceof nu}})):xc=function(e){return e instanceof this};function Ye(t){Ko=Ko||Ci();var e=this instanceof Ko;if(!e&&!xc.call(Ye,this))return new Ye(t);this._writableState=new nu(t,this,e),this.writable=!0,t&&(typeof t.write=="function"&&(this._write=t.write),typeof t.writev=="function"&&(this._writev=t.writev),typeof t.destroy=="function"&&(this._destroy=t.destroy),typeof t.final=="function"&&(this._final=t.final)),x_.call(this)}Ye.prototype.pipe=function(){Yo(this,new Kq)};function eM(t,e){var r=new Xq;Yo(t,r),process.nextTick(e,r)}function tM(t,e,r,n){var i;return r===null?i=new Jq:typeof r!="string"&&!e.objectMode&&(i=new zq("chunk",["string","Buffer"],r)),i?(Yo(t,i),process.nextTick(n,i),!1):!0}Ye.prototype.write=function(t,e,r){var n=this._writableState,i=!1,o=!n.objectMode&&Uq(t);return o&&!Fc.isBuffer(t)&&(t=Mq(t)),typeof e=="function"&&(r=e,e=null),o?e="buffer":e||(e=n.defaultEncoding),typeof r!="function"&&(r=Qq),n.ending?eM(this,r):(o||tM(this,n,t,r))&&(n.pendingcb++,i=nM(this,n,o,t,e,r)),i};Ye.prototype.cork=function(){this._writableState.corked++};Ye.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,!t.writing&&!t.corked&&!t.bufferProcessing&&t.bufferedRequest&&F_(this,t))};Ye.prototype.setDefaultEncoding=function(e){if(typeof e=="string"&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new Zq(e);return this._writableState.defaultEncoding=e,this};Object.defineProperty(Ye.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function rM(t,e,r){return!t.objectMode&&t.decodeStrings!==!1&&typeof e=="string"&&(e=Fc.from(e,r)),e}Object.defineProperty(Ye.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function nM(t,e,r,n,i,o){if(!r){var s=rM(e,n,i);n!==s&&(r=!0,i="buffer",n=s)}var a=e.objectMode?1:n.length;e.length+=a;var u=e.length<e.highWaterMark;if(u||(e.needDrain=!0),e.writing||e.corked){var l=e.lastBufferedRequest;e.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:o,next:null},l?l.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1}else $m(t,e,!1,a,n,i,o);return u}function $m(t,e,r,n,i,o,s){e.writelen=n,e.writecb=s,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new Yq("write")):r?t._writev(i,e.onwrite):t._write(i,o,e.onwrite),e.sync=!1}function iM(t,e,r,n,i){--e.pendingcb,r?(process.nextTick(i,n),process.nextTick(ru,t,e),t._writableState.errorEmitted=!0,Yo(t,n)):(i(n),t._writableState.errorEmitted=!0,Yo(t,n),ru(t,e))}function oM(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}function sM(t,e){var r=t._writableState,n=r.sync,i=r.writecb;if(typeof i!="function")throw new Wq;if(oM(r),e)iM(t,r,n,e,i);else{var o=O_(r)||t.destroyed;!o&&!r.corked&&!r.bufferProcessing&&r.bufferedRequest&&F_(t,r),n?process.nextTick(C_,t,r,o,i):C_(t,r,o,i)}}function C_(t,e,r,n){r||aM(t,e),e.pendingcb--,n(),ru(t,e)}function aM(t,e){e.length===0&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}function F_(t,e){e.bufferProcessing=!0;var r=e.bufferedRequest;if(t._writev&&r&&r.next){var n=e.bufferedRequestCount,i=new Array(n),o=e.corkedRequestsFree;o.entry=r;for(var s=0,a=!0;r;)i[s]=r,r.isBuf||(a=!1),r=r.next,s+=1;i.allBuffers=a,$m(t,e,!0,e.length,i,"",o.finish),e.pendingcb++,e.lastBufferedRequest=null,o.next?(e.corkedRequestsFree=o.next,o.next=null):e.corkedRequestsFree=new S_(e),e.bufferedRequestCount=0}else{for(;r;){var u=r.chunk,l=r.encoding,c=r.callback,f=e.objectMode?1:u.length;if($m(t,e,!1,f,u,l,c),r=r.next,e.bufferedRequestCount--,e.writing)break}r===null&&(e.lastBufferedRequest=null)}e.bufferedRequest=r,e.bufferProcessing=!1}Ye.prototype._write=function(t,e,r){r(new Gq("_write()"))};Ye.prototype._writev=null;Ye.prototype.end=function(t,e,r){var n=this._writableState;return typeof t=="function"?(r=t,t=null,e=null):typeof e=="function"&&(r=e,e=null),t!=null&&this.write(t,e),n.corked&&(n.corked=1,this.uncork()),n.ending||cM(this,n,r),this};Object.defineProperty(Ye.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function O_(t){return t.ending&&t.length===0&&t.bufferedRequest===null&&!t.finished&&!t.writing}function uM(t,e){t._final(function(r){e.pendingcb--,r&&Yo(t,r),e.prefinished=!0,t.emit("prefinish"),ru(t,e)})}function lM(t,e){!e.prefinished&&!e.finalCalled&&(typeof t._final=="function"&&!e.destroyed?(e.pendingcb++,e.finalCalled=!0,process.nextTick(uM,t,e)):(e.prefinished=!0,t.emit("prefinish")))}function ru(t,e){var r=O_(e);if(r&&(lM(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 cM(t,e,r){e.ending=!0,ru(t,e),r&&(e.finished?process.nextTick(r):t.once("finish",r)),e.ended=!0,t.writable=!1}function fM(t,e,r){var n=t.entry;for(t.entry=null;n;){var i=n.callback;e.pendingcb--,i(r),n=n.next}e.corkedRequestsFree.next=t}Object.defineProperty(Ye.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}});Ye.prototype.destroy=Im.destroy;Ye.prototype._undestroy=Im.undestroy;Ye.prototype._destroy=function(t,e){e(t)}});var Ci=D((Hae,T_)=>{"use strict";var dM=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};T_.exports=Lr;var k_=Bm(),Lm=jm();Wo()(Lr,k_);for(Nm=dM(Lm.prototype),Oc=0;Oc<Nm.length;Oc++)Ac=Nm[Oc],Lr.prototype[Ac]||(Lr.prototype[Ac]=Lm.prototype[Ac]);var Nm,Ac,Oc;function Lr(t){if(!(this instanceof Lr))return new Lr(t);k_.call(this,t),Lm.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",hM)))}Object.defineProperty(Lr.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});Object.defineProperty(Lr.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});Object.defineProperty(Lr.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function hM(){this._writableState.ended||process.nextTick(pM,this)}function pM(t){t.end()}Object.defineProperty(Lr.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(e){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=e,this._writableState.destroyed=e)}})});var $_=D((qm,R_)=>{var kc=require("buffer"),Br=kc.Buffer;function P_(t,e){for(var r in t)e[r]=t[r]}Br.from&&Br.alloc&&Br.allocUnsafe&&Br.allocUnsafeSlow?R_.exports=kc:(P_(kc,qm),qm.Buffer=Si);function Si(t,e,r){return Br(t,e,r)}Si.prototype=Object.create(Br.prototype);P_(Br,Si);Si.from=function(t,e,r){if(typeof t=="number")throw new TypeError("Argument must not be a number");return Br(t,e,r)};Si.alloc=function(t,e,r){if(typeof t!="number")throw new TypeError("Argument must be a number");var n=Br(t);return e!==void 0?typeof r=="string"?n.fill(e,r):n.fill(e):n.fill(0),n};Si.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return Br(t)};Si.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return kc.SlowBuffer(t)}});var Hm=D(j_=>{"use strict";var Um=$_().Buffer,I_=Um.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 mM(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 gM(t){var e=mM(t);if(typeof e!="string"&&(Um.isEncoding===I_||!I_(t)))throw new Error("Unknown encoding: "+t);return e||t}j_.StringDecoder=iu;function iu(t){this.encoding=gM(t);var e;switch(this.encoding){case"utf16le":this.text=_M,this.end=EM,e=4;break;case"utf8":this.fillLast=vM,e=4;break;case"base64":this.text=CM,this.end=SM,e=3;break;default:this.write=xM,this.end=FM;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=Um.allocUnsafe(e)}iu.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||""};iu.prototype.end=wM;iu.prototype.text=bM;iu.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 Mm(t){return t<=127?0:t>>5===6?2:t>>4===14?3:t>>3===30?4:t>>6===2?-1:-2}function yM(t,e,r){var n=e.length-1;if(n<r)return 0;var i=Mm(e[n]);return i>=0?(i>0&&(t.lastNeed=i-1),i):--n<r||i===-2?0:(i=Mm(e[n]),i>=0?(i>0&&(t.lastNeed=i-2),i):--n<r||i===-2?0:(i=Mm(e[n]),i>=0?(i>0&&(i===2?i=0:t.lastNeed=i-3),i):0))}function DM(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 vM(t){var e=this.lastTotal-this.lastNeed,r=DM(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 bM(t,e){var r=yM(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 wM(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"\uFFFD":e}function _M(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 EM(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 CM(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 SM(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function xM(t){return t.toString(this.encoding)}function FM(t){return t&&t.length?this.write(t):""}});var Tc=D((zae,B_)=>{"use strict";var N_=Mn().codes.ERR_STREAM_PREMATURE_CLOSE;function OM(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 AM(){}function kM(t){return t.setHeader&&typeof t.abort=="function"}function L_(t,e,r){if(typeof e=="function")return L_(t,null,e);e||(e={}),r=OM(r||AM);var n=e.readable||e.readable!==!1&&t.readable,i=e.writable||e.writable!==!1&&t.writable,o=function(){t.writable||a()},s=t._writableState&&t._writableState.finished,a=function(){i=!1,s=!0,n||r.call(t)},u=t._readableState&&t._readableState.endEmitted,l=function(){n=!1,u=!0,i||r.call(t)},c=function(m){r.call(t,m)},f=function(){var m;if(n&&!u)return(!t._readableState||!t._readableState.ended)&&(m=new N_),r.call(t,m);if(i&&!s)return(!t._writableState||!t._writableState.ended)&&(m=new N_),r.call(t,m)},h=function(){t.req.on("finish",a)};return kM(t)?(t.on("complete",a),t.on("abort",f),t.req?h():t.on("request",h)):i&&!t._writableState&&(t.on("end",o),t.on("close",o)),t.on("end",l),t.on("finish",a),e.error!==!1&&t.on("error",c),t.on("close",f),function(){t.removeListener("complete",a),t.removeListener("abort",f),t.removeListener("request",h),t.req&&t.req.removeListener("finish",a),t.removeListener("end",o),t.removeListener("close",o),t.removeListener("finish",a),t.removeListener("end",l),t.removeListener("error",c),t.removeListener("close",f)}}B_.exports=L_});var M_=D((Gae,q_)=>{"use strict";var Pc;function Hn(t,e,r){return e=TM(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function TM(t){var e=PM(t,"string");return typeof e=="symbol"?e:String(e)}function PM(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 RM=Tc(),Vn=Symbol("lastResolve"),xi=Symbol("lastReject"),ou=Symbol("error"),Rc=Symbol("ended"),Fi=Symbol("lastPromise"),Vm=Symbol("handlePromise"),Oi=Symbol("stream");function zn(t,e){return{value:t,done:e}}function $M(t){var e=t[Vn];if(e!==null){var r=t[Oi].read();r!==null&&(t[Fi]=null,t[Vn]=null,t[xi]=null,e(zn(r,!1)))}}function IM(t){process.nextTick($M,t)}function jM(t,e){return function(r,n){t.then(function(){if(e[Rc]){r(zn(void 0,!0));return}e[Vm](r,n)},n)}}var NM=Object.getPrototypeOf(function(){}),LM=Object.setPrototypeOf((Pc={get stream(){return this[Oi]},next:function(){var e=this,r=this[ou];if(r!==null)return Promise.reject(r);if(this[Rc])return Promise.resolve(zn(void 0,!0));if(this[Oi].destroyed)return new Promise(function(s,a){process.nextTick(function(){e[ou]?a(e[ou]):s(zn(void 0,!0))})});var n=this[Fi],i;if(n)i=new Promise(jM(n,this));else{var o=this[Oi].read();if(o!==null)return Promise.resolve(zn(o,!1));i=new Promise(this[Vm])}return this[Fi]=i,i}},Hn(Pc,Symbol.asyncIterator,function(){return this}),Hn(Pc,"return",function(){var e=this;return new Promise(function(r,n){e[Oi].destroy(null,function(i){if(i){n(i);return}r(zn(void 0,!0))})})}),Pc),NM),BM=function(e){var r,n=Object.create(LM,(r={},Hn(r,Oi,{value:e,writable:!0}),Hn(r,Vn,{value:null,writable:!0}),Hn(r,xi,{value:null,writable:!0}),Hn(r,ou,{value:null,writable:!0}),Hn(r,Rc,{value:e._readableState.endEmitted,writable:!0}),Hn(r,Vm,{value:function(o,s){var a=n[Oi].read();a?(n[Fi]=null,n[Vn]=null,n[xi]=null,o(zn(a,!1))):(n[Vn]=o,n[xi]=s)},writable:!0}),r));return n[Fi]=null,RM(e,function(i){if(i&&i.code!=="ERR_STREAM_PREMATURE_CLOSE"){var o=n[xi];o!==null&&(n[Fi]=null,n[Vn]=null,n[xi]=null,o(i)),n[ou]=i;return}var s=n[Vn];s!==null&&(n[Fi]=null,n[Vn]=null,n[xi]=null,s(zn(void 0,!0))),n[Rc]=!0}),e.on("readable",IM.bind(null,n)),n};q_.exports=BM});var z_=D((Wae,V_)=>{"use strict";function U_(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(l){r(l);return}a.done?e(u):Promise.resolve(u).then(n,i)}function qM(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function s(u){U_(o,n,i,s,a,"next",u)}function a(u){U_(o,n,i,s,a,"throw",u)}s(void 0)})}}function H_(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function MM(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?H_(Object(r),!0).forEach(function(n){UM(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):H_(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function UM(t,e,r){return e=HM(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function HM(t){var e=VM(t,"string");return typeof e=="symbol"?e:String(e)}function VM(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 zM=Mn().codes.ERR_INVALID_ARG_TYPE;function GM(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 zM("iterable",["Iterable"],e);var i=new t(MM({objectMode:!0},r)),o=!1;i._read=function(){o||(o=!0,s())};function s(){return a.apply(this,arguments)}function a(){return a=qM(function*(){try{var u=yield n.next(),l=u.value,c=u.done;c?i.push(null):i.push(yield l)?s():o=!1}catch(f){i.destroy(f)}}),a.apply(this,arguments)}return i}V_.exports=GM});var Bm=D((Yae,tE)=>{"use strict";tE.exports=ge;var Jo;ge.ReadableState=Y_;var Kae=require("events").EventEmitter,K_=function(e,r){return e.listeners(r).length},au=xm(),$c=require("buffer").Buffer,WM=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function KM(t){return $c.from(t)}function YM(t){return $c.isBuffer(t)||t instanceof WM}var zm=require("util"),ae;zm&&zm.debuglog?ae=zm.debuglog("stream"):ae=function(){};var JM=p_(),Zm=Am(),XM=km(),ZM=XM.getHighWaterMark,Ic=Mn().codes,QM=Ic.ERR_INVALID_ARG_TYPE,e4=Ic.ERR_STREAM_PUSH_AFTER_EOF,t4=Ic.ERR_METHOD_NOT_IMPLEMENTED,r4=Ic.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,Xo,Gm,Wm;Wo()(ge,au);var su=Zm.errorOrDestroy,Km=["error","close","destroy","pause","resume"];function n4(t,e,r){if(typeof t.prependListener=="function")return t.prependListener(e,r);!t._events||!t._events[e]?t.on(e,r):Array.isArray(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]}function Y_(t,e,r){Jo=Jo||Ci(),t=t||{},typeof r!="boolean"&&(r=e instanceof Jo),this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=ZM(this,t,"readableHighWaterMark",r),this.buffer=new JM,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&&(Xo||(Xo=Hm().StringDecoder),this.decoder=new Xo(t.encoding),this.encoding=t.encoding)}function ge(t){if(Jo=Jo||Ci(),!(this instanceof ge))return new ge(t);var e=this instanceof Jo;this._readableState=new Y_(t,this,e),this.readable=!0,t&&(typeof t.read=="function"&&(this._read=t.read),typeof t.destroy=="function"&&(this._destroy=t.destroy)),au.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=Zm.destroy;ge.prototype._undestroy=Zm.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=$c.from(t,e),e=""),n=!0),J_(this,t,e,!1,n)};ge.prototype.unshift=function(t){return J_(this,t,null,!0,!1)};function J_(t,e,r,n,i){ae("readableAddChunk",e);var o=t._readableState;if(e===null)o.reading=!1,s4(t,o);else{var s;if(i||(s=i4(o,e)),s)su(t,s);else if(o.objectMode||e&&e.length>0)if(typeof e!="string"&&!o.objectMode&&Object.getPrototypeOf(e)!==$c.prototype&&(e=KM(e)),n)o.endEmitted?su(t,new r4):Ym(t,o,e,!0);else if(o.ended)su(t,new e4);else{if(o.destroyed)return!1;o.reading=!1,o.decoder&&!r?(e=o.decoder.write(e),o.objectMode||e.length!==0?Ym(t,o,e,!1):Xm(t,o)):Ym(t,o,e,!1)}else n||(o.reading=!1,Xm(t,o))}return!o.ended&&(o.length<o.highWaterMark||o.length===0)}function Ym(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&&jc(t)),Xm(t,e)}function i4(t,e){var r;return!YM(e)&&typeof e!="string"&&e!==void 0&&!t.objectMode&&(r=new QM("chunk",["string","Buffer","Uint8Array"],e)),r}ge.prototype.isPaused=function(){return this._readableState.flowing===!1};ge.prototype.setEncoding=function(t){Xo||(Xo=Hm().StringDecoder);var e=new Xo(t);this._readableState.decoder=e,this._readableState.encoding=this._readableState.decoder.encoding;for(var r=this._readableState.buffer.head,n="";r!==null;)n+=e.write(r.data),r=r.next;return this._readableState.buffer.clear(),n!==""&&this._readableState.buffer.push(n),this._readableState.length=n.length,this};var G_=1073741824;function o4(t){return t>=G_?t=G_:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}function W_(t,e){return t<=0||e.length===0&&e.ended?0:e.objectMode?1:t!==t?e.flowing&&e.length?e.buffer.head.data.length:e.length:(t>e.highWaterMark&&(e.highWaterMark=o4(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}ge.prototype.read=function(t){ae("read",t),t=parseInt(t,10);var e=this._readableState,r=t;if(t!==0&&(e.emittedReadable=!1),t===0&&e.needReadable&&((e.highWaterMark!==0?e.length>=e.highWaterMark:e.length>0)||e.ended))return ae("read: emitReadable",e.length,e.ended),e.length===0&&e.ended?Jm(this):jc(this),null;if(t=W_(t,e),t===0&&e.ended)return e.length===0&&Jm(this),null;var n=e.needReadable;ae("need readable",n),(e.length===0||e.length-t<e.highWaterMark)&&(n=!0,ae("length less than watermark",n)),e.ended||e.reading?(n=!1,ae("reading or ended",n)):n&&(ae("do read"),e.reading=!0,e.sync=!0,e.length===0&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1,e.reading||(t=W_(r,e)));var i;return t>0?i=Q_(t,e):i=null,i===null?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.awaitDrain=0),e.length===0&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&Jm(this)),i!==null&&this.emit("data",i),i};function s4(t,e){if(ae("onEofChunk"),!e.ended){if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,e.sync?jc(t):(e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,X_(t)))}}function jc(t){var e=t._readableState;ae("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(ae("emitReadable",e.flowing),e.emittedReadable=!0,process.nextTick(X_,t))}function X_(t){var e=t._readableState;ae("emitReadable_",e.destroyed,e.length,e.ended),!e.destroyed&&(e.length||e.ended)&&(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,Qm(t)}function Xm(t,e){e.readingMore||(e.readingMore=!0,process.nextTick(a4,t,e))}function a4(t,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&e.length===0);){var r=e.length;if(ae("maybeReadMore read 0"),t.read(0),r===e.length)break}e.readingMore=!1}ge.prototype._read=function(t){su(this,new t4("_read()"))};ge.prototype.pipe=function(t,e){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=t;break;case 1:n.pipes=[n.pipes,t];break;default:n.pipes.push(t);break}n.pipesCount+=1,ae("pipe count=%d opts=%j",n.pipesCount,e);var i=(!e||e.end!==!1)&&t!==process.stdout&&t!==process.stderr,o=i?a:b;n.endEmitted?process.nextTick(o):r.once("end",o),t.on("unpipe",s);function s(y,E){ae("onunpipe"),y===r&&E&&E.hasUnpiped===!1&&(E.hasUnpiped=!0,c())}function a(){ae("onend"),t.end()}var u=u4(r);t.on("drain",u);var l=!1;function c(){ae("cleanup"),t.removeListener("close",d),t.removeListener("finish",m),t.removeListener("drain",u),t.removeListener("error",h),t.removeListener("unpipe",s),r.removeListener("end",a),r.removeListener("end",b),r.removeListener("data",f),l=!0,n.awaitDrain&&(!t._writableState||t._writableState.needDrain)&&u()}r.on("data",f);function f(y){ae("ondata");var E=t.write(y);ae("dest.write",E),E===!1&&((n.pipesCount===1&&n.pipes===t||n.pipesCount>1&&eE(n.pipes,t)!==-1)&&!l&&(ae("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function h(y){ae("onerror",y),b(),t.removeListener("error",h),K_(t,"error")===0&&su(t,y)}n4(t,"error",h);function d(){t.removeListener("finish",m),b()}t.once("close",d);function m(){ae("onfinish"),t.removeListener("close",d),b()}t.once("finish",m);function b(){ae("unpipe"),r.unpipe(t)}return t.emit("pipe",r),n.flowing||(ae("pipe resume"),r.resume()),t};function u4(t){return function(){var r=t._readableState;ae("pipeOnDrain",r.awaitDrain),r.awaitDrain&&r.awaitDrain--,r.awaitDrain===0&&K_(t,"data")&&(r.flowing=!0,Qm(t))}}ge.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(e.pipesCount===0)return this;if(e.pipesCount===1)return t&&t!==e.pipes?this:(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r),this);if(!t){var n=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o<i;o++)n[o].emit("unpipe",this,{hasUnpiped:!1});return this}var s=eE(e.pipes,t);return s===-1?this:(e.pipes.splice(s,1),e.pipesCount-=1,e.pipesCount===1&&(e.pipes=e.pipes[0]),t.emit("unpipe",this,r),this)};ge.prototype.on=function(t,e){var r=au.prototype.on.call(this,t,e),n=this._readableState;return t==="data"?(n.readableListening=this.listenerCount("readable")>0,n.flowing!==!1&&this.resume()):t==="readable"&&!n.endEmitted&&!n.readableListening&&(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,ae("on readable",n.length,n.reading),n.length?jc(this):n.reading||process.nextTick(l4,this)),r};ge.prototype.addListener=ge.prototype.on;ge.prototype.removeListener=function(t,e){var r=au.prototype.removeListener.call(this,t,e);return t==="readable"&&process.nextTick(Z_,this),r};ge.prototype.removeAllListeners=function(t){var e=au.prototype.removeAllListeners.apply(this,arguments);return(t==="readable"||t===void 0)&&process.nextTick(Z_,this),e};function Z_(t){var e=t._readableState;e.readableListening=t.listenerCount("readable")>0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}function l4(t){ae("readable nexttick read 0"),t.read(0)}ge.prototype.resume=function(){var t=this._readableState;return t.flowing||(ae("resume"),t.flowing=!t.readableListening,c4(this,t)),t.paused=!1,this};function c4(t,e){e.resumeScheduled||(e.resumeScheduled=!0,process.nextTick(f4,t,e))}function f4(t,e){ae("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),Qm(t),e.flowing&&!e.reading&&t.read(0)}ge.prototype.pause=function(){return ae("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(ae("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function Qm(t){var e=t._readableState;for(ae("flow",e.flowing);e.flowing&&t.read()!==null;);}ge.prototype.wrap=function(t){var e=this,r=this._readableState,n=!1;t.on("end",function(){if(ae("wrapped end"),r.decoder&&!r.ended){var s=r.decoder.end();s&&s.length&&e.push(s)}e.push(null)}),t.on("data",function(s){if(ae("wrapped data"),r.decoder&&(s=r.decoder.write(s)),!(r.objectMode&&s==null)&&!(!r.objectMode&&(!s||!s.length))){var a=e.push(s);a||(n=!0,t.pause())}});for(var i in t)this[i]===void 0&&typeof t[i]=="function"&&(this[i]=function(a){return function(){return t[a].apply(t,arguments)}}(i));for(var o=0;o<Km.length;o++)t.on(Km[o],this.emit.bind(this,Km[o]));return this._read=function(s){ae("wrapped _read",s),n&&(n=!1,t.resume())},this};typeof Symbol=="function"&&(ge.prototype[Symbol.asyncIterator]=function(){return Gm===void 0&&(Gm=M_()),Gm(this)});Object.defineProperty(ge.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}});Object.defineProperty(ge.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}});Object.defineProperty(ge.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}});ge._fromList=Q_;Object.defineProperty(ge.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function Q_(t,e){if(e.length===0)return null;var r;return e.objectMode?r=e.buffer.shift():!t||t>=e.length?(e.decoder?r=e.buffer.join(""):e.buffer.length===1?r=e.buffer.first():r=e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r}function Jm(t){var e=t._readableState;ae("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,process.nextTick(d4,e,t))}function d4(t,e){if(ae("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&t.length===0&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var r=e._writableState;(!r||r.autoDestroy&&r.finished)&&e.destroy()}}typeof Symbol=="function"&&(ge.from=function(t,e){return Wm===void 0&&(Wm=z_()),Wm(ge,t,e)});function eE(t,e){for(var r=0,n=t.length;r<n;r++)if(t[r]===e)return r;return-1}});var eg=D((Jae,nE)=>{"use strict";nE.exports=dn;var Nc=Mn().codes,h4=Nc.ERR_METHOD_NOT_IMPLEMENTED,p4=Nc.ERR_MULTIPLE_CALLBACK,m4=Nc.ERR_TRANSFORM_ALREADY_TRANSFORMING,g4=Nc.ERR_TRANSFORM_WITH_LENGTH_0,Lc=Ci();Wo()(dn,Lc);function y4(t,e){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(n===null)return this.emit("error",new p4);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);Lc.call(this,t),this._transformState={afterTransform:y4.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",D4)}function D4(){var t=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(e,r){rE(t,e,r)}):rE(this,null,null)}dn.prototype.push=function(t,e){return this._transformState.needTransform=!1,Lc.prototype.push.call(this,t,e)};dn.prototype._transform=function(t,e,r){r(new h4("_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){Lc.prototype._destroy.call(this,t,function(r){e(r)})};function rE(t,e,r){if(e)return t.emit("error",e);if(r!=null&&t.push(r),t._writableState.length)throw new g4;if(t._transformState.transforming)throw new m4;return t.push(null)}});var sE=D((Xae,oE)=>{"use strict";oE.exports=uu;var iE=eg();Wo()(uu,iE);function uu(t){if(!(this instanceof uu))return new uu(t);iE.call(this,t)}uu.prototype._transform=function(t,e,r){r(null,t)}});var fE=D((Zae,cE)=>{"use strict";var tg;function v4(t){var e=!1;return function(){e||(e=!0,t.apply(void 0,arguments))}}var lE=Mn().codes,b4=lE.ERR_MISSING_ARGS,w4=lE.ERR_STREAM_DESTROYED;function aE(t){if(t)throw t}function _4(t){return t.setHeader&&typeof t.abort=="function"}function E4(t,e,r,n){n=v4(n);var i=!1;t.on("close",function(){i=!0}),tg===void 0&&(tg=Tc()),tg(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,_4(t))return t.abort();if(typeof t.destroy=="function")return t.destroy();n(s||new w4("pipe"))}}}function uE(t){t()}function C4(t,e){return t.pipe(e)}function S4(t){return!t.length||typeof t[t.length-1]!="function"?aE:t.pop()}function x4(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];var n=S4(e);if(Array.isArray(e[0])&&(e=e[0]),e.length<2)throw new b4("streams");var i,o=e.map(function(s,a){var u=a<e.length-1,l=a>0;return E4(s,u,l,function(c){i||(i=c),c&&o.forEach(uE),!u&&(o.forEach(uE),n(i))})});return e.reduce(C4)}cE.exports=x4});var dE=D((hr,cu)=>{var lu=require("stream");process.env.READABLE_STREAM==="disable"&&lu?(cu.exports=lu.Readable,Object.assign(cu.exports,lu),cu.exports.Stream=lu):(hr=cu.exports=Bm(),hr.Stream=lu||hr,hr.Readable=hr,hr.Writable=jm(),hr.Duplex=Ci(),hr.Transform=eg(),hr.PassThrough=sE(),hr.finished=Tc(),hr.pipeline=fE())});var ng=D(rg=>{var hE;(function(t){typeof DO_NOT_EXPORT_CRC>"u"?typeof rg=="object"?t(rg):typeof define=="function"&&define.amd?define(function(){var e={};return t(e),e}):t(hE={}):t(hE={})})(function(t){t.version="1.2.2";function e(){for(var x=0,L=new Array(256),S=0;S!=256;++S)x=S,x=x&1?-306674912^x>>>1:x>>>1,x=x&1?-306674912^x>>>1:x>>>1,x=x&1?-306674912^x>>>1:x>>>1,x=x&1?-306674912^x>>>1:x>>>1,x=x&1?-306674912^x>>>1:x>>>1,x=x&1?-306674912^x>>>1:x>>>1,x=x&1?-306674912^x>>>1:x>>>1,x=x&1?-306674912^x>>>1:x>>>1,L[S]=x;return typeof Int32Array<"u"?new Int32Array(L):L}var r=e();function n(x){var L=0,S=0,I=0,$=typeof Int32Array<"u"?new Int32Array(4096):new Array(4096);for(I=0;I!=256;++I)$[I]=x[I];for(I=0;I!=256;++I)for(S=x[I],L=256+I;L<4096;L+=256)S=$[L]=S>>>8^x[S&255];var B=[];for(I=1;I!=16;++I)B[I-1]=typeof Int32Array<"u"?$.subarray(I*256,I*256+256):$.slice(I*256,I*256+256);return B}var i=n(r),o=i[0],s=i[1],a=i[2],u=i[3],l=i[4],c=i[5],f=i[6],h=i[7],d=i[8],m=i[9],b=i[10],y=i[11],E=i[12],F=i[13],g=i[14];function C(x,L){for(var S=L^-1,I=0,$=x.length;I<$;)S=S>>>8^r[(S^x.charCodeAt(I++))&255];return~S}function A(x,L){for(var S=L^-1,I=x.length-15,$=0;$<I;)S=g[x[$++]^S&255]^F[x[$++]^S>>8&255]^E[x[$++]^S>>16&255]^y[x[$++]^S>>>24]^b[x[$++]]^m[x[$++]]^d[x[$++]]^h[x[$++]]^f[x[$++]]^c[x[$++]]^l[x[$++]]^u[x[$++]]^a[x[$++]]^s[x[$++]]^o[x[$++]]^r[x[$++]];for(I+=15;$<I;)S=S>>>8^r[(S^x[$++])&255];return~S}function T(x,L){for(var S=L^-1,I=0,$=x.length,B=0,q=0;I<$;)B=x.charCodeAt(I++),B<128?S=S>>>8^r[(S^B)&255]:B<2048?(S=S>>>8^r[(S^(192|B>>6&31))&255],S=S>>>8^r[(S^(128|B&63))&255]):B>=55296&&B<57344?(B=(B&1023)+64,q=x.charCodeAt(I++)&1023,S=S>>>8^r[(S^(240|B>>8&7))&255],S=S>>>8^r[(S^(128|B>>2&63))&255],S=S>>>8^r[(S^(128|q>>6&15|(B&3)<<4))&255],S=S>>>8^r[(S^(128|q&63))&255]):(S=S>>>8^r[(S^(224|B>>12&15))&255],S=S>>>8^r[(S^(128|B>>6&63))&255],S=S>>>8^r[(S^(128|B&63))&255]);return~S}t.table=r,t.bstr=C,t.buf=A,t.str=T})});var mE=D((eue,pE)=>{"use strict";var{Transform:F4}=dE(),O4=ng(),ig=class extends F4{constructor(e){super(e),this.checksum=Buffer.allocUnsafe(4),this.checksum.writeInt32BE(0,0),this.rawSize=0}_transform(e,r,n){e&&(this.checksum=O4.buf(e,this.checksum)>>>0,this.rawSize+=e.length),n(null,e)}digest(e){let r=Buffer.allocUnsafe(4);return r.writeUInt32BE(this.checksum>>>0,0),e?r.toString(e):r}hex(){return this.digest("hex").toUpperCase()}size(){return this.rawSize}};pE.exports=ig});var yE=D((tue,gE)=>{"use strict";var{DeflateRaw:A4}=require("zlib"),k4=ng(),og=class extends A4{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=k4.buf(e,this.checksum)>>>0,this.rawSize+=e.length),super._transform(e,r,n)}digest(e){let r=Buffer.allocUnsafe(4);return r.writeUInt32BE(this.checksum>>>0,0),e?r.toString(e):r}hex(){return this.digest("hex").toUpperCase()}size(e=!1){return e?this.compressedSize:this.rawSize}};gE.exports=og});var vE=D((rue,DE)=>{"use strict";DE.exports={CRC32Stream:mE(),DeflateCRC32Stream:yE()}});var fu=D(Zo=>{"use strict";Object.defineProperty(Zo,"__esModule",{value:!0});Zo.checksum=Zo.checksumFile=void 0;var T4=require("fs"),P4=require("crypto"),wE=require("stream"),R4=require("util"),{CRC32Stream:$4}=vE(),bE=(0,R4.promisify)(wE.pipeline),I4=(t,e,r)=>_E(T4.createReadStream(t),e,r);Zo.checksumFile=I4;async function _E(t,e,r="hex"){let n=N4(t);if(e==="crc32"){let o=new $4,s=bE(n,o);return o.resume(),await s,o.end(),Buffer.from(o.digest()).toString(r)}let i=(0,P4.createHash)(e);return await bE(n,i),i.end(),i.digest(r)}Zo.checksum=_E;function j4(t){return t!=null&&typeof t=="object"&&typeof t.read=="function"&&typeof t.pipe=="function"}var N4=t=>j4(t)?t:new wE.Readable({read(){this.push(t),this.push(null)}})});var sg=D((iue,EE)=>{EE.exports={LOCHDR:30,LOCSIG:67324752,LOCVER:4,LOCFLG:6,LOCHOW:8,LOCTIM:10,LOCCRC:14,LOCSIZ:18,LOCLEN:22,LOCNAM:26,LOCEXT:28,EXTSIG:134695760,EXTHDR:16,EXTCRC:4,EXTSIZ:8,EXTLEN:12,CENHDR:46,CENSIG:33639248,CENVEM:4,CENVER:6,CENFLG:8,CENHOW:10,CENTIM:12,CENCRC:16,CENSIZ:20,CENLEN:24,CENNAM:28,CENEXT:30,CENCOM:32,CENDSK:34,CENATT:36,CENATX:38,CENOFF:42,ENDHDR:22,ENDSIG:101010256,ENDSUB:8,ENDTOT:10,ENDSIZ:12,ENDOFF:16,ENDCOM:20,END64HDR:20,END64SIG:117853008,END64START:4,END64OFF:8,END64NUMDISKS:16,ZIP64SIG:101075792,ZIP64HDR:56,ZIP64LEAD:12,ZIP64SIZE:4,ZIP64VEM:12,ZIP64VER:14,ZIP64DSK:16,ZIP64DSKDIR:20,ZIP64SUB:24,ZIP64TOT:32,ZIP64SIZB:40,ZIP64OFF:48,ZIP64EXTRA:56,STORED:0,SHRUNK:1,REDUCED1:2,REDUCED2:3,REDUCED3:4,REDUCED4:5,IMPLODED:6,DEFLATED:8,ENHANCED_DEFLATED:9,PKWARE:10,BZIP2:12,LZMA:14,IBM_TERSE:18,IBM_LZ77:19,AES_ENCRYPT:99,FLG_ENC:1,FLG_COMP1:2,FLG_COMP2:4,FLG_DESC:8,FLG_ENH:16,FLG_PATCH:32,FLG_STR:64,FLG_EFS:2048,FLG_MSK:4096,FILE:2,BUFFER:1,NONE:0,EF_ID:0,EF_SIZE:2,ID_ZIP64:1,ID_AVINFO:7,ID_PFS:8,ID_OS2:9,ID_NTFS:10,ID_OPENVMS:12,ID_UNIX:13,ID_FORK:14,ID_PATCH:15,ID_X509_PKCS7:20,ID_X509_CERTID_F:21,ID_X509_CERTID_C:22,ID_STRONGENC:23,ID_RECORD_MGT:24,ID_X509_PKCS7_RL:25,ID_IBM1:101,ID_IBM2:102,ID_POSZIP:18064,EF_ZIP64_OR_32:4294967295,EF_ZIP64_OR_16:65535,EF_ZIP64_SUNCOMP:0,EF_ZIP64_SCOMP:8,EF_ZIP64_RHO:16,EF_ZIP64_DSN:24}});var Bc=D(SE=>{var CE={INVALID_LOC:"Invalid LOC header (bad signature)",INVALID_CEN:"Invalid CEN header (bad signature)",INVALID_END:"Invalid END header (bad signature)",DESCRIPTOR_NOT_EXIST:"No descriptor present",DESCRIPTOR_UNKNOWN:"Unknown descriptor format",DESCRIPTOR_FAULTY:"Descriptor data is malformed",NO_DATA:"Nothing to decompress",BAD_CRC:"CRC32 checksum failed {0}",FILE_IN_THE_WAY:"There is a file in the way: {0}",UNKNOWN_METHOD:"Invalid/unsupported compression method",AVAIL_DATA:"inflate::Available inflate data did not terminate",INVALID_DISTANCE:"inflate::Invalid literal/length or distance code in fixed or dynamic block",TO_MANY_CODES:"inflate::Dynamic block code description: too many length or distance codes",INVALID_REPEAT_LEN:"inflate::Dynamic block code description: repeat more than specified lengths",INVALID_REPEAT_FIRST:"inflate::Dynamic block code description: repeat lengths with no first length",INCOMPLETE_CODES:"inflate::Dynamic block code description: code lengths codes incomplete",INVALID_DYN_DISTANCE:"inflate::Dynamic block code description: invalid distance code lengths",INVALID_CODES_LEN:"inflate::Dynamic block code description: invalid literal/length code lengths",INVALID_STORE_BLOCK:"inflate::Stored block length did not match one's complement",INVALID_BLOCK_TYPE:"inflate::Invalid block type (type == 3)",CANT_EXTRACT_FILE:"Could not extract the file",CANT_OVERRIDE:"Target file already exists",DISK_ENTRY_TOO_LARGE:"Number of disk entries is too large",NO_ZIP:"No zip file was loaded",NO_ENTRY:"Entry doesn't exist",DIRECTORY_CONTENT_ERROR:"A directory cannot have content",FILE_NOT_FOUND:'File not found: "{0}"',NOT_IMPLEMENTED:"Not implemented",INVALID_FILENAME:"Invalid filename",INVALID_FORMAT:"Invalid or unsupported zip format. No END header found",INVALID_PASS_PARAM:"Incompatible password parameter",WRONG_PASSWORD:"Wrong Password",COMMENT_TOO_LONG:"Comment is too long",EXTRA_FIELD_PARSE_ERROR:"Extra field parsing error"};function L4(t){return function(...e){return e.length&&(t=t.replace(/\{(\d)\}/g,(r,n)=>e[n]||"")),new Error("ADM-ZIP: "+t)}}for(let t of Object.keys(CE))SE[t]=L4(CE[t])});var kE=D((sue,AE)=>{var B4=require("fs"),at=require("path"),xE=sg(),q4=Bc(),M4=typeof process=="object"&&process.platform==="win32",FE=t=>typeof t=="object"&&t!==null,OE=new Uint32Array(256).map((t,e)=>{for(let r=0;r<8;r++)(e&1)!==0?e=3988292384^e>>>1:e>>>=1;return e>>>0});function Je(t){this.sep=at.sep,this.fs=B4,FE(t)&&FE(t.fs)&&typeof t.fs.statSync=="function"&&(this.fs=t.fs)}AE.exports=Je;Je.prototype.makeDir=function(t){let e=this;function r(n){let i=n.split(e.sep)[0];n.split(e.sep).forEach(function(o){if(!(!o||o.substr(-1,1)===":")){i+=e.sep+o;var s;try{s=e.fs.statSync(i)}catch{e.fs.mkdirSync(i)}if(s&&s.isFile())throw q4.FILE_IN_THE_WAY(`"${i}"`)}})}r(t)};Je.prototype.writeFileTo=function(t,e,r,n){let i=this;if(i.fs.existsSync(t)){if(!r)return!1;var o=i.fs.statSync(t);if(o.isDirectory())return!1}var s=at.dirname(t);i.fs.existsSync(s)||i.makeDir(s);var a;try{a=i.fs.openSync(t,"w",438)}catch{i.fs.chmodSync(t,438),a=i.fs.openSync(t,"w",438)}if(a)try{i.fs.writeSync(a,e,0,e.length,0)}finally{i.fs.closeSync(a)}return i.fs.chmodSync(t,n||438),!0};Je.prototype.writeFileToAsync=function(t,e,r,n,i){typeof n=="function"&&(i=n,n=void 0);let o=this;o.fs.exists(t,function(s){if(s&&!r)return i(!1);o.fs.stat(t,function(a,u){if(s&&u.isDirectory())return i(!1);var l=at.dirname(t);o.fs.exists(l,function(c){c||o.makeDir(l),o.fs.open(t,"w",438,function(f,h){f?o.fs.chmod(t,438,function(){o.fs.open(t,"w",438,function(d,m){o.fs.write(m,e,0,e.length,0,function(){o.fs.close(m,function(){o.fs.chmod(t,n||438,function(){i(!0)})})})})}):h?o.fs.write(h,e,0,e.length,0,function(){o.fs.close(h,function(){o.fs.chmod(t,n||438,function(){i(!0)})})}):o.fs.chmod(t,n||438,function(){i(!0)})})})})})};Je.prototype.findFiles=function(t){let e=this;function r(n,i,o){typeof i=="boolean"&&(o=i,i=void 0);let s=[];return e.fs.readdirSync(n).forEach(function(a){let u=at.join(n,a),l=e.fs.statSync(u);(!i||i.test(u))&&s.push(at.normalize(u)+(l.isDirectory()?e.sep:"")),l.isDirectory()&&o&&(s=s.concat(r(u,i,o)))}),s}return r(t,void 0,!0)};Je.prototype.findFilesAsync=function(t,e){let r=this,n=[];r.fs.readdir(t,function(i,o){if(i)return e(i);let s=o.length;if(!s)return e(null,n);o.forEach(function(a){a=at.join(t,a),r.fs.stat(a,function(u,l){if(u)return e(u);l&&(n.push(at.normalize(a)+(l.isDirectory()?r.sep:"")),l.isDirectory()?r.findFilesAsync(a,function(c,f){if(c)return e(c);n=n.concat(f),--s||e(null,n)}):--s||e(null,n))})})})};Je.prototype.getAttributes=function(){};Je.prototype.setAttributes=function(){};Je.crc32update=function(t,e){return OE[(t^e)&255]^t>>>8};Je.crc32=function(t){typeof t=="string"&&(t=Buffer.from(t,"utf8"));let e=t.length,r=-1;for(let n=0;n<e;)r=Je.crc32update(r,t[n++]);return~r>>>0};Je.methodToString=function(t){switch(t){case xE.STORED:return"STORED ("+t+")";case xE.DEFLATED:return"DEFLATED ("+t+")";default:return"UNSUPPORTED ("+t+")"}};Je.canonical=function(t){if(!t)return"";let e=at.posix.normalize("/"+t.split("\\").join("/"));return at.join(".",e)};Je.zipnamefix=function(t){if(!t)return"";let e=at.posix.normalize("/"+t.split("\\").join("/"));return at.posix.join(".",e)};Je.findLast=function(t,e){if(!Array.isArray(t))throw new TypeError("arr is not array");let r=t.length>>>0;for(let n=r-1;n>=0;n--)if(e(t[n],n,t))return t[n]};Je.sanitize=function(t,e){t=at.resolve(at.normalize(t));for(var r=e.split("/"),n=0,i=r.length;n<i;n++){var o=at.normalize(at.join(t,r.slice(n,i).join(at.sep)));if(o.indexOf(t)===0)return o}return at.normalize(at.join(t,at.basename(e)))};Je.toBuffer=function(e,r){return Buffer.isBuffer(e)?e:e instanceof Uint8Array?Buffer.from(e):typeof e=="string"?r(e):Buffer.alloc(0)};Je.readBigUInt64LE=function(t,e){var r=Buffer.from(t.slice(e,e+8));return r.swap64(),parseInt(`0x${r.toString("hex")}`)};Je.fromDOS2Date=function(t){return new Date((t>>25&127)+1980,Math.max((t>>21&15)-1,0),Math.max(t>>16&31,1),t>>11&31,t>>5&63,(t&31)<<1)};Je.fromDate2DOS=function(t){let e=0,r=0;return t.getFullYear()>1979&&(e=(t.getFullYear()-1980&127)<<9|t.getMonth()+1<<5|t.getDate(),r=t.getHours()<<11|t.getMinutes()<<5|t.getSeconds()>>1),e<<16|r};Je.isWin=M4;Je.crcTable=OE});var PE=D((aue,TE)=>{var U4=require("path");TE.exports=function(t,{fs:e}){var r=t||"",n=o(),i=null;function o(){return{directory:!1,readonly:!1,hidden:!1,executable:!1,mtime:0,atime:0}}return r&&e.existsSync(r)?(i=e.statSync(r),n.directory=i.isDirectory(),n.mtime=i.mtime,n.atime=i.atime,n.executable=(73&i.mode)!==0,n.readonly=(128&i.mode)===0,n.hidden=U4.basename(r)[0]==="."):console.warn("Invalid path: "+r),{get directory(){return n.directory},get readOnly(){return n.readonly},get hidden(){return n.hidden},get mtime(){return n.mtime},get atime(){return n.atime},get executable(){return n.executable},decodeAttributes:function(){},encodeAttributes:function(){},toJSON:function(){return{path:r,isDirectory:n.directory,isReadOnly:n.readonly,isHidden:n.hidden,isExecutable:n.executable,mTime:n.mtime,aTime:n.atime}},toString:function(){return JSON.stringify(this.toJSON(),null," ")}}}});var $E=D((uue,RE)=>{RE.exports={efs:!0,encode:t=>Buffer.from(t,"utf8"),decode:t=>t.toString("utf8")}});var es=D((lue,Qo)=>{Qo.exports=kE();Qo.exports.Constants=sg();Qo.exports.Errors=Bc();Qo.exports.FileAttr=PE();Qo.exports.decoder=$E()});var jE=D((cue,IE)=>{var Gn=es(),H=Gn.Constants;IE.exports=function(){var t=20,e=10,r=0,n=0,i=0,o=0,s=0,a=0,u=0,l=0,c=0,f=0,h=0,d=0,m=0;t|=Gn.isWin?2560:768,r|=H.FLG_EFS;let b={extraLen:0},y=g=>Math.max(0,g)>>>0,E=g=>Math.max(0,g)&65535,F=g=>Math.max(0,g)&255;return i=Gn.fromDate2DOS(new Date),{get made(){return t},set made(g){t=g},get version(){return e},set version(g){e=g},get flags(){return r},set flags(g){r=g},get flags_efs(){return(r&H.FLG_EFS)>0},set flags_efs(g){g?r|=H.FLG_EFS:r&=~H.FLG_EFS},get flags_desc(){return(r&H.FLG_DESC)>0},set flags_desc(g){g?r|=H.FLG_DESC:r&=~H.FLG_DESC},get method(){return n},set method(g){switch(g){case H.STORED:this.version=10;case H.DEFLATED:default:this.version=20}n=g},get time(){return Gn.fromDOS2Date(this.timeval)},set time(g){this.timeval=Gn.fromDate2DOS(g)},get timeval(){return i},set timeval(g){i=y(g)},get timeHighByte(){return F(i>>>8)},get crc(){return o},set crc(g){o=y(g)},get compressedSize(){return s},set compressedSize(g){s=y(g)},get size(){return a},set size(g){a=y(g)},get fileNameLength(){return u},set fileNameLength(g){u=g},get extraLength(){return l},set extraLength(g){l=g},get extraLocalLength(){return b.extraLen},set extraLocalLength(g){b.extraLen=g},get commentLength(){return c},set commentLength(g){c=g},get diskNumStart(){return f},set diskNumStart(g){f=y(g)},get inAttr(){return h},set inAttr(g){h=y(g)},get attr(){return d},set attr(g){d=y(g)},get fileAttr(){return(d||0)>>16&4095},get offset(){return m},set offset(g){m=y(g)},get encrypted(){return(r&H.FLG_ENC)===H.FLG_ENC},get centralHeaderSize(){return H.CENHDR+u+l+c},get realDataOffset(){return m+H.LOCHDR+b.fnameLen+b.extraLen},get localHeader(){return b},loadLocalHeaderFromBinary:function(g){var C=g.slice(m,m+H.LOCHDR);if(C.readUInt32LE(0)!==H.LOCSIG)throw Gn.Errors.INVALID_LOC();b.version=C.readUInt16LE(H.LOCVER),b.flags=C.readUInt16LE(H.LOCFLG),b.method=C.readUInt16LE(H.LOCHOW),b.time=C.readUInt32LE(H.LOCTIM),b.crc=C.readUInt32LE(H.LOCCRC),b.compressedSize=C.readUInt32LE(H.LOCSIZ),b.size=C.readUInt32LE(H.LOCLEN),b.fnameLen=C.readUInt16LE(H.LOCNAM),b.extraLen=C.readUInt16LE(H.LOCEXT);let A=m+H.LOCHDR+b.fnameLen,T=A+b.extraLen;return g.slice(A,T)},loadFromBinary:function(g){if(g.length!==H.CENHDR||g.readUInt32LE(0)!==H.CENSIG)throw Gn.Errors.INVALID_CEN();t=g.readUInt16LE(H.CENVEM),e=g.readUInt16LE(H.CENVER),r=g.readUInt16LE(H.CENFLG),n=g.readUInt16LE(H.CENHOW),i=g.readUInt32LE(H.CENTIM),o=g.readUInt32LE(H.CENCRC),s=g.readUInt32LE(H.CENSIZ),a=g.readUInt32LE(H.CENLEN),u=g.readUInt16LE(H.CENNAM),l=g.readUInt16LE(H.CENEXT),c=g.readUInt16LE(H.CENCOM),f=g.readUInt16LE(H.CENDSK),h=g.readUInt16LE(H.CENATT),d=g.readUInt32LE(H.CENATX),m=g.readUInt32LE(H.CENOFF)},localHeaderToBinary:function(){var g=Buffer.alloc(H.LOCHDR);return g.writeUInt32LE(H.LOCSIG,0),g.writeUInt16LE(e,H.LOCVER),g.writeUInt16LE(r,H.LOCFLG),g.writeUInt16LE(n,H.LOCHOW),g.writeUInt32LE(i,H.LOCTIM),g.writeUInt32LE(o,H.LOCCRC),g.writeUInt32LE(s,H.LOCSIZ),g.writeUInt32LE(a,H.LOCLEN),g.writeUInt16LE(u,H.LOCNAM),g.writeUInt16LE(b.extraLen,H.LOCEXT),g},centralHeaderToBinary:function(){var g=Buffer.alloc(H.CENHDR+u+l+c);return g.writeUInt32LE(H.CENSIG,0),g.writeUInt16LE(t,H.CENVEM),g.writeUInt16LE(e,H.CENVER),g.writeUInt16LE(r,H.CENFLG),g.writeUInt16LE(n,H.CENHOW),g.writeUInt32LE(i,H.CENTIM),g.writeUInt32LE(o,H.CENCRC),g.writeUInt32LE(s,H.CENSIZ),g.writeUInt32LE(a,H.CENLEN),g.writeUInt16LE(u,H.CENNAM),g.writeUInt16LE(l,H.CENEXT),g.writeUInt16LE(c,H.CENCOM),g.writeUInt16LE(f,H.CENDSK),g.writeUInt16LE(h,H.CENATT),g.writeUInt32LE(d,H.CENATX),g.writeUInt32LE(m,H.CENOFF),g},toJSON:function(){let g=function(C){return C+" bytes"};return{made:t,version:e,flags:r,method:Gn.methodToString(n),time:this.time,crc:"0x"+o.toString(16).toUpperCase(),compressedSize:g(s),size:g(a),fileNameLength:g(u),extraLength:g(l),commentLength:g(c),diskNumStart:f,inAttr:h,attr:d,offset:m,centralHeaderSize:g(H.CENHDR+u+l+c)}},toString:function(){return JSON.stringify(this.toJSON(),null," ")}}}});var LE=D((fue,NE)=>{var ts=es(),He=ts.Constants;NE.exports=function(){var t=0,e=0,r=0,n=0,i=0;return{get diskEntries(){return t},set diskEntries(o){t=e=o},get totalEntries(){return e},set totalEntries(o){e=t=o},get size(){return r},set size(o){r=o},get offset(){return n},set offset(o){n=o},get commentLength(){return i},set commentLength(o){i=o},get mainHeaderSize(){return He.ENDHDR+i},loadFromBinary:function(o){if((o.length!==He.ENDHDR||o.readUInt32LE(0)!==He.ENDSIG)&&(o.length<He.ZIP64HDR||o.readUInt32LE(0)!==He.ZIP64SIG))throw ts.Errors.INVALID_END();o.readUInt32LE(0)===He.ENDSIG?(t=o.readUInt16LE(He.ENDSUB),e=o.readUInt16LE(He.ENDTOT),r=o.readUInt32LE(He.ENDSIZ),n=o.readUInt32LE(He.ENDOFF),i=o.readUInt16LE(He.ENDCOM)):(t=ts.readBigUInt64LE(o,He.ZIP64SUB),e=ts.readBigUInt64LE(o,He.ZIP64TOT),r=ts.readBigUInt64LE(o,He.ZIP64SIZE),n=ts.readBigUInt64LE(o,He.ZIP64OFF),i=0)},toBinary:function(){var o=Buffer.alloc(He.ENDHDR+i);return o.writeUInt32LE(He.ENDSIG,0),o.writeUInt32LE(0,4),o.writeUInt16LE(t,He.ENDSUB),o.writeUInt16LE(e,He.ENDTOT),o.writeUInt32LE(r,He.ENDSIZ),o.writeUInt32LE(n,He.ENDOFF),o.writeUInt16LE(i,He.ENDCOM),o.fill(" ",He.ENDHDR),o},toJSON:function(){let o=function(s,a){let u=s.toString(16).toUpperCase();for(;u.length<a;)u="0"+u;return"0x"+u};return{diskEntries:t,totalEntries:e,size:r+" bytes",offset:o(n,4),commentLength:i}},toString:function(){return JSON.stringify(this.toJSON(),null," ")}}}});var ug=D(ag=>{ag.EntryHeader=jE();ag.MainHeader=LE()});var qE=D((hue,BE)=>{BE.exports=function(t){var e=require("zlib"),r={chunkSize:(parseInt(t.length/1024)+1)*1024};return{deflate:function(){return e.deflateRawSync(t,r)},deflateAsync:function(n){var i=e.createDeflateRaw(r),o=[],s=0;i.on("data",function(a){o.push(a),s+=a.length}),i.on("end",function(){var a=Buffer.alloc(s),u=0;a.fill(0);for(var l=0;l<o.length;l++){var c=o[l];c.copy(a,u),u+=c.length}n&&n(a)}),i.end(t)}}}});var UE=D((pue,ME)=>{var H4=+(process.versions?process.versions.node:"").split(".")[0]||0;ME.exports=function(t,e){var r=require("zlib");let n=H4>=15&&e>0?{maxOutputLength:e}:{};return{inflate:function(){return r.inflateRawSync(t,n)},inflateAsync:function(i){var o=r.createInflateRaw(n),s=[],a=0;o.on("data",function(u){s.push(u),a+=u.length}),o.on("end",function(){var u=Buffer.alloc(a),l=0;u.fill(0);for(var c=0;c<s.length;c++){var f=s[c];f.copy(u,l),l+=f.length}i&&i(u)}),o.end(t)}}}});var WE=D((mue,GE)=>{"use strict";var{randomFillSync:HE}=require("crypto"),V4=Bc(),z4=new Uint32Array(256).map((t,e)=>{for(let r=0;r<8;r++)(e&1)!==0?e=e>>>1^3988292384:e>>>=1;return e>>>0}),zE=(t,e)=>Math.imul(t,e)>>>0,VE=(t,e)=>z4[(t^e)&255]^t>>>8,du=()=>typeof HE=="function"?HE(Buffer.alloc(12)):du.node();du.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 qc={genSalt:du};function Mc(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])}Mc.prototype.updateKeys=function(t){let e=this.keys;return e[0]=VE(e[0],t),e[1]+=e[0]&255,e[1]=zE(e[1],134775813)+1,e[2]=VE(e[2],e[1]>>>24),t};Mc.prototype.next=function(){let t=(this.keys[2]|2)>>>0;return zE(t,t^1)>>8&255};function G4(t){let e=new Mc(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 W4(t){let e=new Mc(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 K4(t,e,r){if(!t||!Buffer.isBuffer(t)||t.length<12)return Buffer.alloc(0);let n=G4(r),i=n(t.slice(0,12)),o=(e.flags&8)===8?e.timeHighByte:e.crc>>>24;if(i[11]!==o)throw V4.WRONG_PASSWORD();return n(t.slice(12))}function Y4(t){Buffer.isBuffer(t)&&t.length>=12?qc.genSalt=function(){return t.slice(0,12)}:t==="node"?qc.genSalt=du.node:qc.genSalt=du}function J4(t,e,r,n=!1){t==null&&(t=Buffer.alloc(0)),Buffer.isBuffer(t)||(t=Buffer.from(t.toString()));let i=W4(r),o=qc.genSalt();o[11]=e.crc>>>24&255,n&&(o[10]=e.crc>>>16&255);let s=Buffer.alloc(t.length+12);return i(o,s),i(t,s,12)}GE.exports={decrypt:K4,encrypt:J4,_salter:Y4}});var KE=D(Uc=>{Uc.Deflater=qE();Uc.Inflater=UE();Uc.ZipCrypto=WE()});var cg=D((yue,YE)=>{var ve=es(),X4=ug(),Xe=ve.Constants,lg=KE();YE.exports=function(t,e){var r=new X4.EntryHeader,n=Buffer.alloc(0),i=Buffer.alloc(0),o=!1,s=null,a=Buffer.alloc(0),u=Buffer.alloc(0),l=!0;let c=t,f=typeof c.decoder=="object"?c.decoder:ve.decoder;l=f.hasOwnProperty("efs")?f.efs:!1;function h(){return!e||!(e instanceof Uint8Array)?Buffer.alloc(0):(u=r.loadLocalHeaderFromBinary(e),e.slice(r.realDataOffset,r.realDataOffset+r.compressedSize))}function d(g){if(r.flags_desc){let C={},A=r.realDataOffset+r.compressedSize;if(e.readUInt32LE(A)==Xe.LOCSIG||e.readUInt32LE(A)==Xe.CENSIG)throw ve.Errors.DESCRIPTOR_NOT_EXIST();if(e.readUInt32LE(A)==Xe.EXTSIG)C.crc=e.readUInt32LE(A+Xe.EXTCRC),C.compressedSize=e.readUInt32LE(A+Xe.EXTSIZ),C.size=e.readUInt32LE(A+Xe.EXTLEN);else if(e.readUInt16LE(A+12)===19280)C.crc=e.readUInt32LE(A+Xe.EXTCRC-4),C.compressedSize=e.readUInt32LE(A+Xe.EXTSIZ-4),C.size=e.readUInt32LE(A+Xe.EXTLEN-4);else throw ve.Errors.DESCRIPTOR_UNKNOWN();if(C.compressedSize!==r.compressedSize||C.size!==r.size||C.crc!==r.crc)throw ve.Errors.DESCRIPTOR_FAULTY();if(ve.crc32(g)!==C.crc)return!1}else if(ve.crc32(g)!==r.localHeader.crc)return!1;return!0}function m(g,C,A){if(typeof C>"u"&&typeof g=="string"&&(A=g,g=void 0),o)return g&&C&&C(Buffer.alloc(0),ve.Errors.DIRECTORY_CONTENT_ERROR()),Buffer.alloc(0);var T=h();if(T.length===0)return g&&C&&C(T),T;if(r.encrypted){if(typeof A!="string"&&!Buffer.isBuffer(A))throw ve.Errors.INVALID_PASS_PARAM();T=lg.ZipCrypto.decrypt(T,r,A)}var x=Buffer.alloc(r.size);switch(r.method){case ve.Constants.STORED:if(T.copy(x),d(x))return g&&C&&C(x),x;throw g&&C&&C(x,ve.Errors.BAD_CRC()),ve.Errors.BAD_CRC();case ve.Constants.DEFLATED:var L=new lg.Inflater(T,r.size);if(g)L.inflateAsync(function(S){S.copy(S,0),C&&(d(S)?C(S):C(S,ve.Errors.BAD_CRC()))});else{if(L.inflate(x).copy(x,0),!d(x))throw ve.Errors.BAD_CRC(`"${f.decode(n)}"`);return x}break;default:throw g&&C&&C(Buffer.alloc(0),ve.Errors.UNKNOWN_METHOD()),ve.Errors.UNKNOWN_METHOD()}}function b(g,C){if((!s||!s.length)&&Buffer.isBuffer(e))return g&&C&&C(h()),h();if(s.length&&!o){var A;switch(r.method){case ve.Constants.STORED:return r.compressedSize=r.size,A=Buffer.alloc(s.length),s.copy(A),g&&C&&C(A),A;default:case ve.Constants.DEFLATED:var T=new lg.Deflater(s);if(g)T.deflateAsync(function(L){A=Buffer.alloc(L.length),r.compressedSize=L.length,L.copy(A),C&&C(A)});else{var x=T.deflate();return r.compressedSize=x.length,x}T=null;break}}else if(g&&C)C(Buffer.alloc(0));else return Buffer.alloc(0)}function y(g,C){return(g.readUInt32LE(C+4)<<4)+g.readUInt32LE(C)}function E(g){try{for(var C=0,A,T,x;C+4<g.length;)A=g.readUInt16LE(C),C+=2,T=g.readUInt16LE(C),C+=2,x=g.slice(C,C+T),C+=T,Xe.ID_ZIP64===A&&F(x)}catch{throw ve.Errors.EXTRA_FIELD_PARSE_ERROR()}}function F(g){var C,A,T,x;g.length>=Xe.EF_ZIP64_SCOMP&&(C=y(g,Xe.EF_ZIP64_SUNCOMP),r.size===Xe.EF_ZIP64_OR_32&&(r.size=C)),g.length>=Xe.EF_ZIP64_RHO&&(A=y(g,Xe.EF_ZIP64_SCOMP),r.compressedSize===Xe.EF_ZIP64_OR_32&&(r.compressedSize=A)),g.length>=Xe.EF_ZIP64_DSN&&(T=y(g,Xe.EF_ZIP64_RHO),r.offset===Xe.EF_ZIP64_OR_32&&(r.offset=T)),g.length>=Xe.EF_ZIP64_DSN+4&&(x=g.readUInt32LE(Xe.EF_ZIP64_DSN),r.diskNumStart===Xe.EF_ZIP64_OR_16&&(r.diskNumStart=x))}return{get entryName(){return f.decode(n)},get rawEntryName(){return n},set entryName(g){n=ve.toBuffer(g,f.encode);var C=n[n.length-1];o=C===47||C===92,r.fileNameLength=n.length},get efs(){return typeof l=="function"?l(this.entryName):l},get extra(){return a},set extra(g){a=g,r.extraLength=g.length,E(g)},get comment(){return f.decode(i)},set comment(g){if(i=ve.toBuffer(g,f.encode),r.commentLength=i.length,i.length>65535)throw ve.Errors.COMMENT_TOO_LONG()},get name(){var g=f.decode(n);return o?g.substr(g.length-1).split("/").pop():g.split("/").pop()},get isDirectory(){return o},getCompressedData:function(){return b(!1,null)},getCompressedDataAsync:function(g){b(!0,g)},setData:function(g){s=ve.toBuffer(g,ve.decoder.encode),!o&&s.length?(r.size=s.length,r.method=ve.Constants.DEFLATED,r.crc=ve.crc32(g),r.changed=!0):r.method=ve.Constants.STORED},getData:function(g){return r.changed?s:m(!1,null,g)},getDataAsync:function(g,C){r.changed?g(s):m(!0,g,C)},set attr(g){r.attr=g},get attr(){return r.attr},set header(g){r.loadFromBinary(g)},get header(){return r},packCentralHeader:function(){r.flags_efs=this.efs,r.extraLength=a.length;var g=r.centralHeaderToBinary(),C=ve.Constants.CENHDR;return n.copy(g,C),C+=n.length,a.copy(g,C),C+=r.extraLength,i.copy(g,C),g},packLocalHeader:function(){let g=0;r.flags_efs=this.efs,r.extraLocalLength=u.length;let C=r.localHeaderToBinary(),A=Buffer.alloc(C.length+n.length+r.extraLocalLength);return C.copy(A,g),g+=C.length,n.copy(A,g),g+=n.length,u.copy(A,g),g+=u.length,A},toJSON:function(){let g=function(C){return"<"+(C&&C.length+" bytes buffer"||"null")+">"};return{entryName:this.entryName,name:this.name,comment:this.comment,isDirectory:this.isDirectory,header:r.toJSON(),compressedData:g(e),data:g(s)}},toString:function(){return JSON.stringify(this.toJSON(),null," ")}}}});var ZE=D((Due,XE)=>{var JE=cg(),Z4=ug(),bt=es();XE.exports=function(t,e){var r=[],n={},i=Buffer.alloc(0),o=new Z4.MainHeader,s=!1,a=null;let u=new Set,l=e,{noSort:c,decoder:f}=l;t?m(l.readEntries):s=!0;function h(){let y=new Set;for(let E of Object.keys(n)){let F=E.split("/");if(F.pop(),!!F.length)for(let g=0;g<F.length;g++){let C=F.slice(0,g+1).join("/")+"/";y.add(C)}}for(let E of y)if(!(E in n)){let F=new JE(l);F.entryName=E,F.attr=16,F.temporary=!0,r.push(F),n[F.entryName]=F,u.add(F)}}function d(){if(s=!0,n={},o.diskEntries>(t.length-o.offset)/bt.Constants.CENHDR)throw bt.Errors.DISK_ENTRY_TOO_LARGE();r=new Array(o.diskEntries);for(var y=o.offset,E=0;E<r.length;E++){var F=y,g=new JE(l,t);g.header=t.slice(F,F+=bt.Constants.CENHDR),g.entryName=t.slice(F,F+=g.header.fileNameLength),g.header.extraLength&&(g.extra=t.slice(F,F+=g.header.extraLength)),g.header.commentLength&&(g.comment=t.slice(F,F+g.header.commentLength)),y+=g.header.centralHeaderSize,r[E]=g,n[g.entryName]=g}u.clear(),h()}function m(y){var E=t.length-bt.Constants.ENDHDR,F=Math.max(0,E-65535),g=F,C=t.length,A=-1,T=0;for((typeof l.trailingSpace=="boolean"?l.trailingSpace:!1)&&(F=0),E;E>=g;E--)if(t[E]===80){if(t.readUInt32LE(E)===bt.Constants.ENDSIG){A=E,T=E,C=E+bt.Constants.ENDHDR,g=E-bt.Constants.END64HDR;continue}if(t.readUInt32LE(E)===bt.Constants.END64SIG){g=F;continue}if(t.readUInt32LE(E)===bt.Constants.ZIP64SIG){A=E,C=E+bt.readBigUInt64LE(t,E+bt.Constants.ZIP64SIZE)+bt.Constants.ZIP64LEAD;break}}if(A==-1)throw bt.Errors.INVALID_FORMAT();o.loadFromBinary(t.slice(A,C)),o.commentLength&&(i=t.slice(T+bt.Constants.ENDHDR)),y&&d()}function b(){r.length>1&&!c&&r.sort((y,E)=>y.entryName.toLowerCase().localeCompare(E.entryName.toLowerCase()))}return{get entries(){return s||d(),r.filter(y=>!u.has(y))},get comment(){return f.decode(i)},set comment(y){i=bt.toBuffer(y,f.encode),o.commentLength=i.length},getEntryCount:function(){return s?r.length:o.diskEntries},forEach:function(y){this.entries.forEach(y)},getEntry:function(y){return s||d(),n[y]||null},setEntry:function(y){s||d(),r.push(y),n[y.entryName]=y,o.totalEntries=r.length},deleteFile:function(y,E=!0){s||d();let F=n[y];this.getEntryChildren(F,E).map(C=>C.entryName).forEach(this.deleteEntry)},deleteEntry:function(y){s||d();let E=n[y],F=r.indexOf(E);F>=0&&(r.splice(F,1),delete n[y],o.totalEntries=r.length)},getEntryChildren:function(y,E=!0){if(s||d(),typeof y=="object")if(y.isDirectory&&E){let F=[],g=y.entryName;for(let C of r)C.entryName.startsWith(g)&&F.push(C);return F}else return[y];return[]},getChildCount:function(y){if(y&&y.isDirectory){let E=this.getEntryChildren(y);return E.includes(y)?E.length-1:E.length}return 0},compressToBuffer:function(){s||d(),b();let y=[],E=[],F=0,g=0;o.size=0,o.offset=0;let C=0;for(let x of this.entries){let L=x.getCompressedData();x.header.offset=g;let S=x.packLocalHeader(),I=S.length+L.length;g+=I,y.push(S),y.push(L);let $=x.packCentralHeader();E.push($),o.size+=$.length,F+=I+$.length,C++}F+=o.mainHeaderSize,o.offset=g,o.totalEntries=C,g=0;let A=Buffer.alloc(F);for(let x of y)x.copy(A,g),g+=x.length;for(let x of E)x.copy(A,g),g+=x.length;let T=o.toBinary();return i&&i.copy(T,bt.Constants.ENDHDR),T.copy(A,g),t=A,s=!1,A},toAsyncBuffer:function(y,E,F,g){try{s||d(),b();let C=[],A=[],T=0,x=0,L=0;o.size=0,o.offset=0;let S=function(I){if(I.length>0){let $=I.shift(),B=$.entryName+$.extra.toString();F&&F(B),$.getCompressedDataAsync(function(q){g&&g(B),$.header.offset=x;let K=$.packLocalHeader(),V=K.length+q.length;x+=V,C.push(K),C.push(q);let _=$.packCentralHeader();A.push(_),o.size+=_.length,T+=V+_.length,L++,S(I)})}else{T+=o.mainHeaderSize,o.offset=x,o.totalEntries=L,x=0;let $=Buffer.alloc(T);C.forEach(function(q){q.copy($,x),x+=q.length}),A.forEach(function(q){q.copy($,x),x+=q.length});let B=o.toBinary();i&&i.copy(B,bt.Constants.ENDHDR),B.copy($,x),t=$,s=!1,y($)}};S(Array.from(this.entries))}catch(C){E(C)}}}}});var tC=D((vue,eC)=>{var Ve=es(),Ze=require("path"),Q4=cg(),e5=ZE(),Ai=(...t)=>Ve.findLast(t,e=>typeof e=="boolean"),QE=(...t)=>Ve.findLast(t,e=>typeof e=="string"),t5=(...t)=>Ve.findLast(t,e=>typeof e=="function"),r5={noSort:!1,readEntries:!1,method:Ve.Constants.NONE,fs:null};eC.exports=function(t,e){let r=null,n=Object.assign(Object.create(null),r5);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 e5(r,n),{canonical:s,sanitize:a,zipnamefix:u}=Ve;function l(d){if(d&&o){var m;if(typeof d=="string"&&(m=o.getEntry(Ze.posix.normalize(d))),typeof d=="object"&&typeof d.entryName<"u"&&typeof d.header<"u"&&(m=o.getEntry(d.entryName)),m)return m}return null}function c(d){let{join:m,normalize:b,sep:y}=Ze.posix;return m(".",b(y+d.split("\\").join(y)+y))}function f(d){return d instanceof RegExp?function(m){return function(b){return m.test(b)}}(d):typeof d!="function"?()=>!0:d}let h=(d,m)=>{let b=m.slice(-1);return b=b===i.sep?i.sep:"",Ze.relative(d,m)+b};return{readFile:function(d,m){var b=l(d);return b&&b.getData(m)||null},childCount:function(d){let m=l(d);if(m)return o.getChildCount(m)},readFileAsync:function(d,m){var b=l(d);b?b.getDataAsync(m):m(null,"getEntry failed for:"+d)},readAsText:function(d,m){var b=l(d);if(b){var y=b.getData();if(y&&y.length)return y.toString(m||"utf8")}return""},readAsTextAsync:function(d,m,b){var y=l(d);y?y.getDataAsync(function(E,F){if(F){m(E,F);return}E&&E.length?m(E.toString(b||"utf8")):m("")}):m("")},deleteFile:function(d,m=!0){var b=l(d);b&&o.deleteFile(b.entryName,m)},deleteEntry:function(d){var m=l(d);m&&o.deleteEntry(m.entryName)},addZipComment:function(d){o.comment=d},getZipComment:function(){return o.comment||""},addZipEntryComment:function(d,m){var b=l(d);b&&(b.comment=m)},getZipEntryComment:function(d){var m=l(d);return m&&m.comment||""},updateFile:function(d,m){var b=l(d);b&&b.setData(m)},addLocalFile:function(d,m,b,y){if(i.fs.existsSync(d)){m=m?c(m):"";let E=Ze.win32.basename(Ze.win32.normalize(d));m+=b||E;let F=i.fs.statSync(d),g=F.isFile()?i.fs.readFileSync(d):Buffer.alloc(0);F.isDirectory()&&(m+=i.sep),this.addFile(m,g,y,F)}else throw Ve.Errors.FILE_NOT_FOUND(d)},addLocalFileAsync:function(d,m){d=typeof d=="object"?d:{localPath:d};let b=Ze.resolve(d.localPath),{comment:y}=d,{zipPath:E,zipName:F}=d,g=this;i.fs.stat(b,function(C,A){if(C)return m(C,!1);E=E?c(E):"";let T=Ze.win32.basename(Ze.win32.normalize(b));if(E+=F||T,A.isFile())i.fs.readFile(b,function(x,L){return x?m(x,!1):(g.addFile(E,L,y,A),setImmediate(m,void 0,!0))});else if(A.isDirectory())return E+=i.sep,g.addFile(E,Buffer.alloc(0),y,A),setImmediate(m,void 0,!0)})},addLocalFolder:function(d,m,b){if(b=f(b),m=m?c(m):"",d=Ze.normalize(d),i.fs.existsSync(d)){let y=i.findFiles(d),E=this;if(y.length)for(let F of y){let g=Ze.join(m,h(d,F));b(g)&&E.addLocalFile(F,Ze.dirname(g))}}else throw Ve.Errors.FILE_NOT_FOUND(d)},addLocalFolderAsync:function(d,m,b,y){y=f(y),b=b?c(b):"",d=Ze.normalize(d);var E=this;i.fs.open(d,"r",function(F){if(F&&F.code==="ENOENT")m(void 0,Ve.Errors.FILE_NOT_FOUND(d));else if(F)m(void 0,F);else{var g=i.findFiles(d),C=-1,A=function(){if(C+=1,C<g.length){var T=g[C],x=h(d,T).split("\\").join("/");x=x.normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/[^\x20-\x7E]/g,""),y(x)?i.fs.stat(T,function(L,S){L&&m(void 0,L),S.isFile()?i.fs.readFile(T,function(I,$){I?m(void 0,I):(E.addFile(b+x,$,"",S),A())}):(E.addFile(b+x+"/",Buffer.alloc(0),"",S),A())}):process.nextTick(()=>{A()})}else m(!0,void 0)};A()}})},addLocalFolderAsync2:function(d,m){let b=this;d=typeof d=="object"?d:{localPath:d},localPath=Ze.resolve(c(d.localPath));let{zipPath:y,filter:E,namefix:F}=d;E instanceof RegExp?E=function(A){return function(T){return A.test(T)}}(E):typeof E!="function"&&(E=function(){return!0}),y=y?c(y):"",F=="latin1"&&(F=A=>A.normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/[^\x20-\x7E]/g,"")),typeof F!="function"&&(F=A=>A);let g=A=>Ze.join(y,F(h(localPath,A))),C=A=>Ze.win32.basename(Ze.win32.normalize(F(A)));i.fs.open(localPath,"r",function(A){A&&A.code==="ENOENT"?m(void 0,Ve.Errors.FILE_NOT_FOUND(localPath)):A?m(void 0,A):i.findFilesAsync(localPath,function(T,x){if(T)return m(T);x=x.filter(L=>E(g(L))),x.length||m(void 0,!1),setImmediate(x.reverse().reduce(function(L,S){return function(I,$){if(I||$===!1)return setImmediate(L,I,!1);b.addLocalFileAsync({localPath:S,zipPath:Ze.dirname(g(S)),zipName:C(S)},L)}},m))})})},addLocalFolderPromise:function(d,m){return new Promise((b,y)=>{this.addLocalFolderAsync2(Object.assign({localPath:d},m),(E,F)=>{E&&y(E),F&&b(this)})})},addFile:function(d,m,b,y){d=u(d);let E=l(d),F=E!=null;F||(E=new Q4(n),E.entryName=d),E.comment=b||"";let g=typeof y=="object"&&y instanceof i.fs.Stats;g&&(E.header.time=y.mtime);var C=E.isDirectory?16:0;let A=E.isDirectory?16384:32768;return g?A|=4095&y.mode:typeof y=="number"?A|=4095&y:A|=E.isDirectory?493:420,C=(C|A<<16)>>>0,E.attr=C,E.setData(m),F||o.setEntry(E),E},getEntries:function(d){return o.password=d,o?o.entries:[]},getEntry:function(d){return l(d)},getEntryCount:function(){return o.getEntryCount()},forEach:function(d){return o.forEach(d)},extractEntryTo:function(d,m,b,y,E,F){y=Ai(!1,y),E=Ai(!1,E),b=Ai(!0,b),F=QE(E,F);var g=l(d);if(!g)throw Ve.Errors.NO_ENTRY();var C=s(g.entryName),A=a(m,F&&!g.isDirectory?F:b?C:Ze.basename(C));if(g.isDirectory){var T=o.getEntryChildren(g);return T.forEach(function(S){if(S.isDirectory)return;var I=S.getData();if(!I)throw Ve.Errors.CANT_EXTRACT_FILE();var $=s(S.entryName),B=a(m,b?$:Ze.basename($));let q=E?S.header.fileAttr:void 0;i.writeFileTo(B,I,y,q)}),!0}var x=g.getData(o.password);if(!x)throw Ve.Errors.CANT_EXTRACT_FILE();if(i.fs.existsSync(A)&&!y)throw Ve.Errors.CANT_OVERRIDE();let L=E?d.header.fileAttr:void 0;return i.writeFileTo(A,x,y,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,y){if(b=Ai(!1,b),y=QE(b,y),m=Ai(!1,m),!o)throw Ve.Errors.NO_ZIP();o.entries.forEach(function(E){var F=a(d,s(E.entryName));if(E.isDirectory){i.makeDir(F);return}var g=E.getData(y);if(!g)throw Ve.Errors.CANT_EXTRACT_FILE();let C=b?E.header.fileAttr:void 0;i.writeFileTo(F,g,m,C);try{i.fs.utimesSync(F,E.header.time,E.header.time)}catch{throw Ve.Errors.CANT_EXTRACT_FILE()}})},extractAllToAsync:function(d,m,b,y){if(y=t5(m,b,y),b=Ai(!1,b),m=Ai(!1,m),!y)return new Promise((A,T)=>{this.extractAllToAsync(d,m,b,function(x){x?T(x):A(this)})});if(!o){y(Ve.Errors.NO_ZIP());return}d=Ze.resolve(d);let E=A=>a(d,Ze.normalize(s(A.entryName))),F=(A,T)=>new Error(A+': "'+T+'"'),g=[],C=[];o.entries.forEach(A=>{A.isDirectory?g.push(A):C.push(A)});for(let A of g){let T=E(A),x=b?A.header.fileAttr:void 0;try{i.makeDir(T),x&&i.fs.chmodSync(T,x),i.fs.utimesSync(T,A.header.time,A.header.time)}catch{y(F("Unable to create folder",T))}}C.reverse().reduce(function(A,T){return function(x){if(x)A(x);else{let L=Ze.normalize(s(T.entryName)),S=a(d,L);T.getDataAsync(function(I,$){if($)A($);else if(!I)A(Ve.Errors.CANT_EXTRACT_FILE());else{let B=b?T.header.fileAttr:void 0;i.writeFileToAsync(S,I,m,B,function(q){q||A(F("Unable to write file",S)),i.fs.utimes(S,T.header.time,T.header.time,function(K){K?A(F("Unable to set times",S)):A()})})}})}}},y)()},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 y=i.writeFileTo(d,b,!0);typeof m=="function"&&m(y?null:new Error("failed"),"")}}},writeZipPromise:function(d,m){let{overwrite:b,perm:y}=Object.assign({overwrite:!0},m);return new Promise((E,F)=>{!d&&n.filename&&(d=n.filename),d||F("ADM-ZIP: ZIP File Name Missing"),this.toBufferPromise().then(g=>{let C=A=>A?E(A):F("ADM-ZIP: Wasn't able to write zip file");i.writeFileToAsync(d,g,b,y,C)},F)})},toBufferPromise:function(){return new Promise((d,m)=>{o.toAsyncBuffer(d,m)})},toBuffer:function(d,m,b,y){return typeof d=="function"?(o.toAsyncBuffer(d,m,b,y),null):o.compressToBuffer()}}}});var gC=D((Wue,mC)=>{var pC={};mC.exports=pC;var hC={reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29],black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],gray:[90,39],grey:[90,39],brightRed:[91,39],brightGreen:[92,39],brightYellow:[93,39],brightBlue:[94,39],brightMagenta:[95,39],brightCyan:[96,39],brightWhite:[97,39],bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgGray:[100,49],bgGrey:[100,49],bgBrightRed:[101,49],bgBrightGreen:[102,49],bgBrightYellow:[103,49],bgBrightBlue:[104,49],bgBrightMagenta:[105,49],bgBrightCyan:[106,49],bgBrightWhite:[107,49],blackBG:[40,49],redBG:[41,49],greenBG:[42,49],yellowBG:[43,49],blueBG:[44,49],magentaBG:[45,49],cyanBG:[46,49],whiteBG:[47,49]};Object.keys(hC).forEach(function(t){var e=hC[t],r=pC[t]=[];r.open="\x1B["+e[0]+"m",r.close="\x1B["+e[1]+"m"})});var DC=D((Kue,yC)=>{"use strict";yC.exports=function(t,e){e=e||process.argv;var r=e.indexOf("--"),n=/^-{1,2}/.test(t)?"":"--",i=e.indexOf(n+t);return i!==-1&&(r===-1?!0:i<r)}});var bC=D((Yue,vC)=>{"use strict";var u5=require("os"),Sr=DC(),kt=process.env,is=void 0;Sr("no-color")||Sr("no-colors")||Sr("color=false")?is=!1:(Sr("color")||Sr("colors")||Sr("color=true")||Sr("color=always"))&&(is=!0);"FORCE_COLOR"in kt&&(is=kt.FORCE_COLOR.length===0||parseInt(kt.FORCE_COLOR,10)!==0);function l5(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}function c5(t){if(is===!1)return 0;if(Sr("color=16m")||Sr("color=full")||Sr("color=truecolor"))return 3;if(Sr("color=256"))return 2;if(t&&!t.isTTY&&is!==!0)return 0;var e=is?1:0;if(process.platform==="win32"){var r=u5.release().split(".");return Number(process.versions.node.split(".")[0])>=8&&Number(r[0])>=10&&Number(r[2])>=10586?Number(r[2])>=14931?3:2:1}if("CI"in kt)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some(function(i){return i in kt})||kt.CI_NAME==="codeship"?1:e;if("TEAMCITY_VERSION"in kt)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(kt.TEAMCITY_VERSION)?1:0;if("TERM_PROGRAM"in kt){var n=parseInt((kt.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(kt.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Hyper":return 3;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(kt.TERM)?2:/^screen|^xterm|^vt100|^rxvt|color|ansi|cygwin|linux/i.test(kt.TERM)||"COLORTERM"in kt?1:(kt.TERM==="dumb",e)}function yg(t){var e=c5(t);return l5(e)}vC.exports={supportsColor:yg,stdout:yg(process.stdout),stderr:yg(process.stderr)}});var _C=D((Jue,wC)=>{wC.exports=function(e,r){var n="";e=e||"Run the trap, drop the bass",e=e.split("");var i={a:["@","\u0104","\u023A","\u0245","\u0394","\u039B","\u0414"],b:["\xDF","\u0181","\u0243","\u026E","\u03B2","\u0E3F"],c:["\xA9","\u023B","\u03FE"],d:["\xD0","\u018A","\u0500","\u0501","\u0502","\u0503"],e:["\xCB","\u0115","\u018E","\u0258","\u03A3","\u03BE","\u04BC","\u0A6C"],f:["\u04FA"],g:["\u0262"],h:["\u0126","\u0195","\u04A2","\u04BA","\u04C7","\u050A"],i:["\u0F0F"],j:["\u0134"],k:["\u0138","\u04A0","\u04C3","\u051E"],l:["\u0139"],m:["\u028D","\u04CD","\u04CE","\u0520","\u0521","\u0D69"],n:["\xD1","\u014B","\u019D","\u0376","\u03A0","\u048A"],o:["\xD8","\xF5","\xF8","\u01FE","\u0298","\u047A","\u05DD","\u06DD","\u0E4F"],p:["\u01F7","\u048E"],q:["\u09CD"],r:["\xAE","\u01A6","\u0210","\u024C","\u0280","\u042F"],s:["\xA7","\u03DE","\u03DF","\u03E8"],t:["\u0141","\u0166","\u0373"],u:["\u01B1","\u054D"],v:["\u05D8"],w:["\u0428","\u0460","\u047C","\u0D70"],x:["\u04B2","\u04FE","\u04FC","\u04FD"],y:["\xA5","\u04B0","\u04CB"],z:["\u01B5","\u0240"]};return e.forEach(function(o){o=o.toLowerCase();var s=i[o]||[" "],a=Math.floor(Math.random()*s.length);typeof i[o]<"u"?n+=i[o][a]:n+=o}),n}});var CC=D((Xue,EC)=>{EC.exports=function(e,r){e=e||" he is here ";var n={up:["\u030D","\u030E","\u0304","\u0305","\u033F","\u0311","\u0306","\u0310","\u0352","\u0357","\u0351","\u0307","\u0308","\u030A","\u0342","\u0313","\u0308","\u034A","\u034B","\u034C","\u0303","\u0302","\u030C","\u0350","\u0300","\u0301","\u030B","\u030F","\u0312","\u0313","\u0314","\u033D","\u0309","\u0363","\u0364","\u0365","\u0366","\u0367","\u0368","\u0369","\u036A","\u036B","\u036C","\u036D","\u036E","\u036F","\u033E","\u035B","\u0346","\u031A"],down:["\u0316","\u0317","\u0318","\u0319","\u031C","\u031D","\u031E","\u031F","\u0320","\u0324","\u0325","\u0326","\u0329","\u032A","\u032B","\u032C","\u032D","\u032E","\u032F","\u0330","\u0331","\u0332","\u0333","\u0339","\u033A","\u033B","\u033C","\u0345","\u0347","\u0348","\u0349","\u034D","\u034E","\u0353","\u0354","\u0355","\u0356","\u0359","\u035A","\u0323"],mid:["\u0315","\u031B","\u0300","\u0301","\u0358","\u0321","\u0322","\u0327","\u0328","\u0334","\u0335","\u0336","\u035C","\u035D","\u035E","\u035F","\u0360","\u0362","\u0338","\u0337","\u0361"," \u0489"]},i=[].concat(n.up,n.down,n.mid);function o(u){var l=Math.floor(Math.random()*u);return l}function s(u){var l=!1;return i.filter(function(c){l=c===u}),l}function a(u,l){var c="",f,h;l=l||{},l.up=typeof l.up<"u"?l.up:!0,l.mid=typeof l.mid<"u"?l.mid:!0,l.down=typeof l.down<"u"?l.down:!0,l.size=typeof l.size<"u"?l.size:"maxi",u=u.split("");for(h in u)if(!s(h)){switch(c=c+u[h],f={up:0,down:0,mid:0},l.size){case"mini":f.up=o(8),f.mid=o(2),f.down=o(8);break;case"maxi":f.up=o(16)+3,f.mid=o(4)+1,f.down=o(64)+3;break;default:f.up=o(8)+1,f.mid=o(6)/2,f.down=o(8)+1;break}var d=["up","mid","down"];for(var m in d)for(var b=d[m],y=0;y<=f[b];y++)l[b]&&(c=c+n[b][o(n[b].length)])}return c}return a(e,r)}});var xC=D((Zue,SC)=>{SC.exports=function(t){return function(e,r,n){if(e===" ")return e;switch(r%3){case 0:return t.red(e);case 1:return t.white(e);case 2:return t.blue(e)}}}});var OC=D((Que,FC)=>{FC.exports=function(t){return function(e,r,n){return r%2===0?e:t.inverse(e)}}});var kC=D((ele,AC)=>{AC.exports=function(t){var e=["red","yellow","green","blue","magenta"];return function(r,n,i){return r===" "?r:t[e[n++%e.length]](r)}}});var PC=D((tle,TC)=>{TC.exports=function(t){var e=["underline","inverse","grey","yellow","red","green","blue","white","cyan","magenta","brightYellow","brightRed","brightGreen","brightBlue","brightWhite","brightCyan","brightMagenta"];return function(r,n,i){return r===" "?r:t[e[Math.round(Math.random()*(e.length-2))]](r)}}});var LC=D((nle,NC)=>{var le={};NC.exports=le;le.themes={};var f5=require("util"),ki=le.styles=gC(),$C=Object.defineProperties,d5=new RegExp(/[\r\n]+/g);le.supportsColor=bC().supportsColor;typeof le.enabled>"u"&&(le.enabled=le.supportsColor()!==!1);le.enable=function(){le.enabled=!0};le.disable=function(){le.enabled=!1};le.stripColors=le.strip=function(t){return(""+t).replace(/\x1B\[\d+m/g,"")};var rle=le.stylize=function(e,r){if(!le.enabled)return e+"";var n=ki[r];return!n&&r in le?le[r](e):n.open+e+n.close},h5=/[|\\{}()[\]^$+*?.]/g,p5=function(t){if(typeof t!="string")throw new TypeError("Expected a string");return t.replace(h5,"\\$&")};function IC(t){var e=function r(){return g5.apply(r,arguments)};return e._styles=t,e.__proto__=m5,e}var jC=function(){var t={};return ki.grey=ki.gray,Object.keys(ki).forEach(function(e){ki[e].closeRe=new RegExp(p5(ki[e].close),"g"),t[e]={get:function(){return IC(this._styles.concat(e))}}}),t}(),m5=$C(function(){},jC);function g5(){var t=Array.prototype.slice.call(arguments),e=t.map(function(s){return s!=null&&s.constructor===String?s:f5.inspect(s)}).join(" ");if(!le.enabled||!e)return e;for(var r=e.indexOf(`
22
+ `)!=-1,n=this._styles,i=n.length;i--;){var o=ki[n[i]];e=o.open+e.replace(o.closeRe,o.open)+o.close,r&&(e=e.replace(d5,function(s){return o.close+s+o.open}))}return e}le.setTheme=function(t){if(typeof t=="string"){console.log("colors.setTheme now only accepts an object, not a string. If you are trying to set a theme from a file, it is now your (the caller's) responsibility to require the file. The old syntax looked like colors.setTheme(__dirname + '/../themes/generic-logging.js'); The new syntax looks like colors.setTheme(require(__dirname + '/../themes/generic-logging.js'));");return}for(var e in t)(function(r){le[r]=function(n){if(typeof t[r]=="object"){var i=n;for(var o in t[r])i=le[t[r][o]](i);return i}return le[t[r]](n)}})(e)};function y5(){var t={};return Object.keys(jC).forEach(function(e){t[e]={get:function(){return IC([e])}}}),t}var D5=function(e,r){var n=r.split("");return n=n.map(e),n.join("")};le.trap=_C();le.zalgo=CC();le.maps={};le.maps.america=xC()(le);le.maps.zebra=OC()(le);le.maps.rainbow=kC()(le);le.maps.random=PC()(le);for(RC in le.maps)(function(t){le[t]=function(e){return D5(le.maps[t],e)}})(RC);var RC;$C(le,y5())});var qC=D((ile,BC)=>{var v5=LC();BC.exports=v5});var MC=D(Dg=>{"use strict";Dg.indent=function(e){return new Array(e+1).join(" ")};Dg.getMaxIndexLength=function(t){var e=0;return Object.getOwnPropertyNames(t).forEach(function(r){t[r]!==void 0&&(e=Math.max(e,r.length))}),e}});var UC=D((sle,b5)=>{b5.exports={author:"Rafael de Oleza <rafeca@gmail.com> (https://github.com/rafeca)",name:"prettyjson",description:"Package for formatting JSON data in a coloured YAML-style, perfect for CLI output",version:"1.2.5",homepage:"http://rafeca.com/prettyjson",keywords:["json","cli","formatting","colors"],repository:{type:"git",url:"https://github.com/rafeca/prettyjson.git"},bugs:{url:"https://github.com/rafeca/prettyjson/issues"},main:"./lib/prettyjson",files:["bin/prettyjson","lib/*.js"],license:"MIT",scripts:{test:"npm run jshint && mocha --reporter spec",testwin:"node ./node_modules/mocha/bin/mocha --reporter spec",jshint:"jshint lib/*.js test/*.js",coverage:"istanbul cover _mocha --report lcovonly -- -R spec",coveralls:"npm run coverage && cat ./coverage/lcov.info | coveralls && rm -rf ./coverage",changelog:"git log $(git describe --tags --abbrev=0)..HEAD --pretty='* %s' --first-parent"},bin:{prettyjson:"./bin/prettyjson"},dependencies:{colors:"1.4.0",minimist:"^1.2.0"},devDependencies:{coveralls:"^2.11.15",istanbul:"^0.4.5",jshint:"^2.9.4",mocha:"^3.1.2","mocha-lcov-reporter":"^1.2.0",should:"^11.1.1"}}});var HC=D(mu=>{"use strict";var Mr=qC(),Kn=MC(),w5=/[^\w\s\n\r\v\t\.,]/i;mu.version=UC().version;var vg=function(t,e){return t!==void 0||e.renderUndefined},Wc=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
23
  `)===-1||r.inlineArrays&&!e&&Array.isArray(t)&&Wc(t[0],!0,r))},_5=function(t,e){if(e.noColor)return t;if(typeof t=="string")return e.stringColor?Mr[e.stringColor](t):t;var r=t+"";return t===!0?Mr.green(r):t===!1?Mr.red(r):t==null?Mr.grey(r):typeof t=="number"?t>=0?Mr[e.positiveNumberColor](r):Mr[e.negativeNumberColor](r):typeof t=="function"?"function() {}":Array.isArray(t)?t.join(", "):r},bg=function(t,e){return t.multilineStringColor===null||t.noColor?e:Mr[t.multilineStringColor](e)},E5=function(t,e,r){var n=t.split(`
24
24
  `);return n=n.map(function(i){return Kn.indent(e)+bg(r,i)}),n.join(`
25
25
  `)},os=function(t,e,r){if(typeof t=="string"&&t.match(w5)&&e.escape&&(t=JSON.stringify(t)),!vg(t,e))return[];if(Wc(t,!1,e))return[Kn.indent(r)+_5(t,e)];if(typeof t=="string")return[Kn.indent(r)+bg(e,'"""'),E5(t,r+e.defaultIndentation,e),Kn.indent(r)+bg(e,'"""')];if(Array.isArray(t)){if(t.length===0)return[Kn.indent(r)+e.emptyArrayMsg];var n=[];return t.forEach(function(a){if(vg(a,e)){var u="- ";e.noColor||(u=Mr[e.dashColor](u)),u=Kn.indent(r)+u,Wc(a,!1,e)?(u+=os(a,e,0)[0],n.push(u)):(n.push(u),n.push.apply(n,os(a,e,r+e.defaultIndentation)))}}),n}if(t instanceof Error)return os({message:t.message,stack:t.stack.split(`
26
26
  `)},e,r);var i=e.noAlign?0:Kn.getMaxIndexLength(t),o,s=[];return Object.getOwnPropertyNames(t).forEach(function(a){if(vg(t[a],e))if(o=a+": ",e.noColor||(o=Mr[e.keysColor](o)),o=Kn.indent(r)+o,Wc(t[a],!1,e)){var u=e.noAlign?0:i-a.length;o+=os(t[a],e,u)[0],s.push(o)}else s.push(o),s.push.apply(s,os(t[a],e,r+e.defaultIndentation))}),s};mu.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,os(e,r,n).join(`
27
27
  `)};mu.renderString=function(e,r,n){var i="",o;if(typeof e!="string"||e==="")return"";if(e[0]!=="{"&&e[0]!=="["){var s;e.indexOf("{")===-1?s=e.indexOf("["):e.indexOf("[")===-1||e.indexOf("{")<e.indexOf("[")?s=e.indexOf("{"):s=e.indexOf("["),i+=e.substr(0,s)+`
28
- `,e=e.substr(s)}try{o=JSON.parse(e)}catch{return Mr.red("Error:")+" Not valid JSON!"}return i+=mu.render(o,r,n),i}});var Eg=y(Kc=>{"use strict";Object.defineProperty(Kc,"__esModule",{value:!0});Kc.default=void 0;function ss(t){"@babel/helpers - typeof";return ss=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},ss(t)}function VC(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,S5(n.key),n)}}function C5(t,e,r){return e&&VC(t.prototype,e),r&&VC(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function S5(t){var e=x5(t,"string");return ss(e)=="symbol"?e:e+""}function x5(t,e){if(ss(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(ss(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function F5(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function O5(t,e,r){return e=yu(e),A5(t,_g()?Reflect.construct(e,r||[],yu(t).constructor):e.apply(t,r))}function A5(t,e){if(e&&(ss(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return k5(t)}function k5(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function T5(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&&gu(t,e)}function wg(t){var e=typeof Map=="function"?new Map:void 0;return wg=function(n){if(n===null||!R5(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 P5(n,arguments,yu(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),gu(i,n)},wg(t)}function P5(t,e,r){if(_g())return Reflect.construct.apply(null,arguments);var n=[null];n.push.apply(n,e);var i=new(t.bind.apply(t,n));return r&&gu(i,r.prototype),i}function _g(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(_g=function(){return!!t})()}function R5(t){try{return Function.toString.call(t).indexOf("[native code]")!==-1}catch{return typeof t=="function"}}function gu(t,e){return gu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},gu(t,e)}function yu(t){return yu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},yu(t)}var $5=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(F5(this,e),n=O5(this,e,[r]),n.originalRequest=o,n.originalResponse=s,n.causingError=i,i!=null&&(r+=", caused by ".concat(i.toString())),o!=null){var a=o.getHeader("X-Request-ID")||"n/a",u=o.getMethod(),l=o.getURL(),c=s?s.getStatus():"n/a",f=s?s.getBody()||"":"n/a";r+=", originated from request (method: ".concat(u,", url: ").concat(l,", response code: ").concat(c,", response text: ").concat(f,", request id: ").concat(a,")")}return n.message=r,n}return T5(e,t),C5(e)}(wg(Error)),ule=Kc.default=$5});var Cg=y(Yc=>{"use strict";Object.defineProperty(Yc,"__esModule",{value:!0});Yc.enableDebugLog=I5;Yc.log=j5;var zC=!1;function I5(){zC=!0}function j5(t){zC&&console.log(t)}});var WC=y(Jc=>{"use strict";Object.defineProperty(Jc,"__esModule",{value:!0});Jc.default=void 0;function Du(t){"@babel/helpers - typeof";return Du=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},Du(t)}function N5(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function GC(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,B5(n.key),n)}}function L5(t,e,r){return e&&GC(t.prototype,e),r&&GC(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function B5(t){var e=q5(t,"string");return Du(e)=="symbol"?e:e+""}function q5(t,e){if(Du(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Du(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var fle=Jc.default=function(){function t(){N5(this,t)}return L5(t,[{key:"listAllUploads",value:function(){return Promise.resolve([])}},{key:"findUploadsByFingerprint",value:function(r){return Promise.resolve([])}},{key:"removeUpload",value:function(r){return Promise.resolve()}},{key:"addUpload",value:function(r,n){return Promise.resolve(null)}}])}()});var KC=y((Sg,xg)=>{(function(t,e){typeof Sg=="object"&&typeof xg<"u"?xg.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:Sg,function(){"use strict";var t="3.7.7",e=t,r=typeof Buffer=="function",n=typeof TextDecoder=="function"?new TextDecoder:void 0,i=typeof TextEncoder=="function"?new TextEncoder:void 0,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",s=Array.prototype.slice.call(o),a=function(P){var N={};return P.forEach(function(ie,oe){return N[ie]=oe}),N}(s),u=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,l=String.fromCharCode.bind(String),c=typeof Uint8Array.from=="function"?Uint8Array.from.bind(Uint8Array):function(P){return new Uint8Array(Array.prototype.slice.call(P,0))},f=function(P){return P.replace(/=/g,"").replace(/[+\/]/g,function(N){return N=="+"?"-":"_"})},h=function(P){return P.replace(/[^A-Za-z0-9\+\/]/g,"")},d=function(P){for(var N,ie,oe,ye,ln="",Gh=P.length%3,ql=0;ql<P.length;){if((ie=P.charCodeAt(ql++))>255||(oe=P.charCodeAt(ql++))>255||(ye=P.charCodeAt(ql++))>255)throw new TypeError("invalid character found");N=ie<<16|oe<<8|ye,ln+=s[N>>18&63]+s[N>>12&63]+s[N>>6&63]+s[N&63]}return Gh?ln.slice(0,Gh-3)+"===".substring(Gh):ln},m=typeof btoa=="function"?function(P){return btoa(P)}:r?function(P){return Buffer.from(P,"binary").toString("base64")}:d,b=r?function(P){return Buffer.from(P).toString("base64")}:function(P){for(var N=4096,ie=[],oe=0,ye=P.length;oe<ye;oe+=N)ie.push(l.apply(null,P.subarray(oe,oe+N)));return m(ie.join(""))},D=function(P,N){return N===void 0&&(N=!1),N?f(b(P)):b(P)},_=function(P){if(P.length<2){var N=P.charCodeAt(0);return N<128?P:N<2048?l(192|N>>>6)+l(128|N&63):l(224|N>>>12&15)+l(128|N>>>6&63)+l(128|N&63)}else{var N=65536+(P.charCodeAt(0)-55296)*1024+(P.charCodeAt(1)-56320);return l(240|N>>>18&7)+l(128|N>>>12&63)+l(128|N>>>6&63)+l(128|N&63)}},F=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,g=function(P){return P.replace(F,_)},C=r?function(P){return Buffer.from(P,"utf8").toString("base64")}:i?function(P){return b(i.encode(P))}:function(P){return m(g(P))},A=function(P,N){return N===void 0&&(N=!1),N?f(C(P)):C(P)},T=function(P){return A(P,!0)},x=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,L=function(P){switch(P.length){case 4:var N=(7&P.charCodeAt(0))<<18|(63&P.charCodeAt(1))<<12|(63&P.charCodeAt(2))<<6|63&P.charCodeAt(3),ie=N-65536;return l((ie>>>10)+55296)+l((ie&1023)+56320);case 3:return l((15&P.charCodeAt(0))<<12|(63&P.charCodeAt(1))<<6|63&P.charCodeAt(2));default:return l((31&P.charCodeAt(0))<<6|63&P.charCodeAt(1))}},S=function(P){return P.replace(x,L)},I=function(P){if(P=P.replace(/\s+/g,""),!u.test(P))throw new TypeError("malformed base64.");P+="==".slice(2-(P.length&3));for(var N,ie="",oe,ye,ln=0;ln<P.length;)N=a[P.charAt(ln++)]<<18|a[P.charAt(ln++)]<<12|(oe=a[P.charAt(ln++)])<<6|(ye=a[P.charAt(ln++)]),ie+=oe===64?l(N>>16&255):ye===64?l(N>>16&255,N>>8&255):l(N>>16&255,N>>8&255,N&255);return ie},$=typeof atob=="function"?function(P){return atob(h(P))}:r?function(P){return Buffer.from(P,"base64").toString("binary")}:I,B=r?function(P){return c(Buffer.from(P,"base64"))}:function(P){return c($(P).split("").map(function(N){return N.charCodeAt(0)}))},q=function(P){return B(V(P))},K=r?function(P){return Buffer.from(P,"base64").toString("utf8")}:n?function(P){return n.decode(B(P))}:function(P){return S($(P))},V=function(P){return h(P.replace(/[-_]/g,function(N){return N=="-"?"+":"/"}))},E=function(P){return K(V(P))},v=function(P){if(typeof P!="string")return!1;var N=P.replace(/\s+/g,"").replace(/={0,2}$/,"");return!/[^\s0-9a-zA-Z\+/]/.test(N)||!/[^\s0-9a-zA-Z\-_]/.test(N)},w=function(P){return{value:P,enumerable:!1,writable:!0,configurable:!0}},O=function(){var P=function(N,ie){return Object.defineProperty(String.prototype,N,w(ie))};P("fromBase64",function(){return E(this)}),P("toBase64",function(N){return A(this,N)}),P("toBase64URI",function(){return A(this,!0)}),P("toBase64URL",function(){return A(this,!0)}),P("toUint8Array",function(){return q(this)})},j=function(){var P=function(N,ie){return Object.defineProperty(Uint8Array.prototype,N,w(ie))};P("toBase64",function(N){return D(this,N)}),P("toBase64URI",function(){return D(this,!0)}),P("toBase64URL",function(){return D(this,!0)})},R=function(){O(),j()},M={version:t,VERSION:e,atob:$,atobPolyfill:I,btoa:m,btoaPolyfill:d,fromBase64:E,toBase64:A,encode:A,encodeURI:T,encodeURL:T,utob:g,btou:S,decode:E,isValid:v,fromUint8Array:D,toUint8Array:q,extendString:O,extendUint8Array:j,extendBuiltins:R};return M.Base64={},Object.keys(M).forEach(function(P){return M.Base64[P]=M[P]}),M})});var JC=y((hle,YC)=>{"use strict";YC.exports=function(e,r){if(r=r.split(":")[0],e=+e,!e)return!1;switch(r){case"http":case"ws":return e!==80;case"https":case"wss":return e!==443;case"ftp":return e!==21;case"gopher":return e!==70;case"file":return!1}return e!==0}});var QC=y(Fg=>{"use strict";var M5=Object.prototype.hasOwnProperty,U5;function XC(t){try{return decodeURIComponent(t.replace(/\+/g," "))}catch{return null}}function ZC(t){try{return encodeURIComponent(t)}catch{return null}}function H5(t){for(var e=/([^=?#&]+)=?([^&]*)/g,r={},n;n=e.exec(t);){var i=XC(n[1]),o=XC(n[2]);i===null||o===null||i in r||(r[i]=o)}return r}function V5(t,e){e=e||"";var r=[],n,i;typeof e!="string"&&(e="?");for(i in t)if(M5.call(t,i)){if(n=t[i],!n&&(n===null||n===U5||isNaN(n))&&(n=""),i=ZC(i),n=ZC(n),i===null||n===null)continue;r.push(i+"="+n)}return r.length?e+r.join("&"):""}Fg.stringify=V5;Fg.parse=H5});var aS=y((mle,sS)=>{"use strict";var tS=JC(),Xc=QC(),z5=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,rS=/[\n\r\t]/g,G5=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,nS=/:\d+$/,W5=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i,K5=/^[a-zA-Z]:/;function Ag(t){return(t||"").toString().replace(z5,"")}var Og=[["#","hash"],["?","query"],function(e,r){return Ur(r.protocol)?e.replace(/\\/g,"/"):e},["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d*)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],eS={hash:1,query:1};function iS(t){var e;typeof window<"u"?e=window:typeof global<"u"?e=global:typeof self<"u"?e=self:e={};var r=e.location||{};t=t||r;var n={},i=typeof t,o;if(t.protocol==="blob:")n=new Hr(unescape(t.pathname),{});else if(i==="string"){n=new Hr(t,{});for(o in eS)delete n[o]}else if(i==="object"){for(o in t)o in eS||(n[o]=t[o]);n.slashes===void 0&&(n.slashes=G5.test(t.href))}return n}function Ur(t){return t==="file:"||t==="ftp:"||t==="http:"||t==="https:"||t==="ws:"||t==="wss:"}function oS(t,e){t=Ag(t),t=t.replace(rS,""),e=e||{};var r=W5.exec(t),n=r[1]?r[1].toLowerCase():"",i=!!r[2],o=!!r[3],s=0,a;return i?o?(a=r[2]+r[3]+r[4],s=r[2].length+r[3].length):(a=r[2]+r[4],s=r[2].length):o?(a=r[3]+r[4],s=r[3].length):a=r[4],n==="file:"?s>=2&&(a=a.slice(2)):Ur(n)?a=r[4]:n?i&&(a=a.slice(2)):s>=2&&Ur(e.protocol)&&(a=r[4]),{protocol:n,slashes:i||Ur(n),slashesCount:s,rest:a}}function Y5(t,e){if(t==="")return e;for(var r=(e||"/").split("/").slice(0,-1).concat(t.split("/")),n=r.length,i=r[n-1],o=!1,s=0;n--;)r[n]==="."?r.splice(n,1):r[n]===".."?(r.splice(n,1),s++):s&&(n===0&&(o=!0),r.splice(n,1),s--);return o&&r.unshift(""),(i==="."||i==="..")&&r.push(""),r.join("/")}function Hr(t,e,r){if(t=Ag(t),t=t.replace(rS,""),!(this instanceof Hr))return new Hr(t,e,r);var n,i,o,s,a,u,l=Og.slice(),c=typeof e,f=this,h=0;for(c!=="object"&&c!=="string"&&(r=e,e=null),r&&typeof r!="function"&&(r=Xc.parse),e=iS(e),i=oS(t||"",e),n=!i.protocol&&!i.slashes,f.slashes=i.slashes||n&&e.slashes,f.protocol=i.protocol||e.protocol||"",t=i.rest,(i.protocol==="file:"&&(i.slashesCount!==2||K5.test(t))||!i.slashes&&(i.protocol||i.slashesCount<2||!Ur(f.protocol)))&&(l[3]=[/(.*)/,"pathname"]);h<l.length;h++){if(s=l[h],typeof s=="function"){t=s(t,f);continue}o=s[0],u=s[1],o!==o?f[u]=t:typeof o=="string"?(a=o==="@"?t.lastIndexOf(o):t.indexOf(o),~a&&(typeof s[2]=="number"?(f[u]=t.slice(0,a),t=t.slice(a+s[2])):(f[u]=t.slice(a),t=t.slice(0,a)))):(a=o.exec(t))&&(f[u]=a[1],t=t.slice(0,a.index)),f[u]=f[u]||n&&s[3]&&e[u]||"",s[4]&&(f[u]=f[u].toLowerCase())}r&&(f.query=r(f.query)),n&&e.slashes&&f.pathname.charAt(0)!=="/"&&(f.pathname!==""||e.pathname!=="")&&(f.pathname=Y5(f.pathname,e.pathname)),f.pathname.charAt(0)!=="/"&&Ur(f.protocol)&&(f.pathname="/"+f.pathname),tS(f.port,f.protocol)||(f.host=f.hostname,f.port=""),f.username=f.password="",f.auth&&(a=f.auth.indexOf(":"),~a?(f.username=f.auth.slice(0,a),f.username=encodeURIComponent(decodeURIComponent(f.username)),f.password=f.auth.slice(a+1),f.password=encodeURIComponent(decodeURIComponent(f.password))):f.username=encodeURIComponent(decodeURIComponent(f.auth)),f.auth=f.password?f.username+":"+f.password:f.username),f.origin=f.protocol!=="file:"&&Ur(f.protocol)&&f.host?f.protocol+"//"+f.host:"null",f.href=f.toString()}function J5(t,e,r){var n=this;switch(t){case"query":typeof e=="string"&&e.length&&(e=(r||Xc.parse)(e)),n[t]=e;break;case"port":n[t]=e,tS(e,n.protocol)?e&&(n.host=n.hostname+":"+e):(n.host=n.hostname,n[t]="");break;case"hostname":n[t]=e,n.port&&(e+=":"+n.port),n.host=e;break;case"host":n[t]=e,nS.test(e)?(e=e.split(":"),n.port=e.pop(),n.hostname=e.join(":")):(n.hostname=e,n.port="");break;case"protocol":n.protocol=e.toLowerCase(),n.slashes=!r;break;case"pathname":case"hash":if(e){var i=t==="pathname"?"/":"#";n[t]=e.charAt(0)!==i?i+e:e}else n[t]=e;break;case"username":case"password":n[t]=encodeURIComponent(e);break;case"auth":var o=e.indexOf(":");~o?(n.username=e.slice(0,o),n.username=encodeURIComponent(decodeURIComponent(n.username)),n.password=e.slice(o+1),n.password=encodeURIComponent(decodeURIComponent(n.password))):n.username=encodeURIComponent(decodeURIComponent(e))}for(var s=0;s<Og.length;s++){var a=Og[s];a[4]&&(n[a[1]]=n[a[1]].toLowerCase())}return n.auth=n.password?n.username+":"+n.password:n.username,n.origin=n.protocol!=="file:"&&Ur(n.protocol)&&n.host?n.protocol+"//"+n.host:"null",n.href=n.toString(),n}function X5(t){(!t||typeof t!="function")&&(t=Xc.stringify);var e,r=this,n=r.host,i=r.protocol;i&&i.charAt(i.length-1)!==":"&&(i+=":");var o=i+(r.protocol&&r.slashes||Ur(r.protocol)?"//":"");return r.username?(o+=r.username,r.password&&(o+=":"+r.password),o+="@"):r.password?(o+=":"+r.password,o+="@"):r.protocol!=="file:"&&Ur(r.protocol)&&!n&&r.pathname!=="/"&&(o+="@"),(n[n.length-1]===":"||nS.test(r.hostname)&&!r.port)&&(n+=":"),o+=n+r.pathname,e=typeof r.query=="object"?t(r.query):r.query,e&&(o+=e.charAt(0)!=="?"?"?"+e:e),r.hash&&(o+=r.hash),o}Hr.prototype={set:J5,toString:X5};Hr.extractProtocol=oS;Hr.location=iS;Hr.trimLeft=Ag;Hr.qs=Xc;sS.exports=Hr});var uS=y(kg=>{"use strict";Object.defineProperty(kg,"__esModule",{value:!0});kg.default=Z5;function Z5(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var e=Math.random()*16|0,r=t==="x"?e:e&3|8;return r.toString(16)})}});var ES=y(tf=>{"use strict";Object.defineProperty(tf,"__esModule",{value:!0});tf.default=void 0;var Q5=KC(),eU=Rg(aS()),Zc=Rg(Eg()),Ti=Cg(),tU=Rg(uS());function Rg(t){return t&&t.__esModule?t:{default:t}}function Tg(){"use strict";Tg=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(E,v,w){E[v]=w.value},o=typeof Symbol=="function"?Symbol:{},s=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function l(E,v,w){return Object.defineProperty(E,v,{value:w,enumerable:!0,configurable:!0,writable:!0}),E[v]}try{l({},"")}catch{l=function(w,O,j){return w[O]=j}}function c(E,v,w,O){var j=v&&v.prototype instanceof _?v:_,R=Object.create(j.prototype),M=new K(O||[]);return i(R,"_invoke",{value:I(E,w,M)}),R}function f(E,v,w){try{return{type:"normal",arg:E.call(v,w)}}catch(O){return{type:"throw",arg:O}}}e.wrap=c;var h="suspendedStart",d="suspendedYield",m="executing",b="completed",D={};function _(){}function F(){}function g(){}var C={};l(C,s,function(){return this});var A=Object.getPrototypeOf,T=A&&A(A(V([])));T&&T!==r&&n.call(T,s)&&(C=T);var x=g.prototype=_.prototype=Object.create(C);function L(E){["next","throw","return"].forEach(function(v){l(E,v,function(w){return this._invoke(v,w)})})}function S(E,v){function w(j,R,M,P){var N=f(E[j],E,R);if(N.type!=="throw"){var ie=N.arg,oe=ie.value;return oe&&Pi(oe)=="object"&&n.call(oe,"__await")?v.resolve(oe.__await).then(function(ye){w("next",ye,M,P)},function(ye){w("throw",ye,M,P)}):v.resolve(oe).then(function(ye){ie.value=ye,M(ie)},function(ye){return w("throw",ye,M,P)})}P(N.arg)}var O;i(this,"_invoke",{value:function(R,M){function P(){return new v(function(N,ie){w(R,M,N,ie)})}return O=O?O.then(P,P):P()}})}function I(E,v,w){var O=h;return function(j,R){if(O===m)throw Error("Generator is already running");if(O===b){if(j==="throw")throw R;return{value:t,done:!0}}for(w.method=j,w.arg=R;;){var M=w.delegate;if(M){var P=$(M,w);if(P){if(P===D)continue;return P}}if(w.method==="next")w.sent=w._sent=w.arg;else if(w.method==="throw"){if(O===h)throw O=b,w.arg;w.dispatchException(w.arg)}else w.method==="return"&&w.abrupt("return",w.arg);O=m;var N=f(E,v,w);if(N.type==="normal"){if(O=w.done?b:d,N.arg===D)continue;return{value:N.arg,done:w.done}}N.type==="throw"&&(O=b,w.method="throw",w.arg=N.arg)}}}function $(E,v){var w=v.method,O=E.iterator[w];if(O===t)return v.delegate=null,w==="throw"&&E.iterator.return&&(v.method="return",v.arg=t,$(E,v),v.method==="throw")||w!=="return"&&(v.method="throw",v.arg=new TypeError("The iterator does not provide a '"+w+"' method")),D;var j=f(O,E.iterator,v.arg);if(j.type==="throw")return v.method="throw",v.arg=j.arg,v.delegate=null,D;var R=j.arg;return R?R.done?(v[E.resultName]=R.value,v.next=E.nextLoc,v.method!=="return"&&(v.method="next",v.arg=t),v.delegate=null,D):R:(v.method="throw",v.arg=new TypeError("iterator result is not an object"),v.delegate=null,D)}function B(E){var v={tryLoc:E[0]};1 in E&&(v.catchLoc=E[1]),2 in E&&(v.finallyLoc=E[2],v.afterLoc=E[3]),this.tryEntries.push(v)}function q(E){var v=E.completion||{};v.type="normal",delete v.arg,E.completion=v}function K(E){this.tryEntries=[{tryLoc:"root"}],E.forEach(B,this),this.reset(!0)}function V(E){if(E||E===""){var v=E[s];if(v)return v.call(E);if(typeof E.next=="function")return E;if(!isNaN(E.length)){var w=-1,O=function j(){for(;++w<E.length;)if(n.call(E,w))return j.value=E[w],j.done=!1,j;return j.value=t,j.done=!0,j};return O.next=O}}throw new TypeError(Pi(E)+" is not iterable")}return F.prototype=g,i(x,"constructor",{value:g,configurable:!0}),i(g,"constructor",{value:F,configurable:!0}),F.displayName=l(g,u,"GeneratorFunction"),e.isGeneratorFunction=function(E){var v=typeof E=="function"&&E.constructor;return!!v&&(v===F||(v.displayName||v.name)==="GeneratorFunction")},e.mark=function(E){return Object.setPrototypeOf?Object.setPrototypeOf(E,g):(E.__proto__=g,l(E,u,"GeneratorFunction")),E.prototype=Object.create(x),E},e.awrap=function(E){return{__await:E}},L(S.prototype),l(S.prototype,a,function(){return this}),e.AsyncIterator=S,e.async=function(E,v,w,O,j){j===void 0&&(j=Promise);var R=new S(c(E,v,w,O),j);return e.isGeneratorFunction(v)?R:R.next().then(function(M){return M.done?M.value:R.next()})},L(x),l(x,u,"Generator"),l(x,s,function(){return this}),l(x,"toString",function(){return"[object Generator]"}),e.keys=function(E){var v=Object(E),w=[];for(var O in v)w.push(O);return w.reverse(),function j(){for(;w.length;){var R=w.pop();if(R in v)return j.value=R,j.done=!1,j}return j.done=!0,j}},e.values=V,K.prototype={constructor:K,reset:function(v){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(q),!v)for(var w in this)w.charAt(0)==="t"&&n.call(this,w)&&!isNaN(+w.slice(1))&&(this[w]=t)},stop:function(){this.done=!0;var v=this.tryEntries[0].completion;if(v.type==="throw")throw v.arg;return this.rval},dispatchException:function(v){if(this.done)throw v;var w=this;function O(ie,oe){return M.type="throw",M.arg=v,w.next=ie,oe&&(w.method="next",w.arg=t),!!oe}for(var j=this.tryEntries.length-1;j>=0;--j){var R=this.tryEntries[j],M=R.completion;if(R.tryLoc==="root")return O("end");if(R.tryLoc<=this.prev){var P=n.call(R,"catchLoc"),N=n.call(R,"finallyLoc");if(P&&N){if(this.prev<R.catchLoc)return O(R.catchLoc,!0);if(this.prev<R.finallyLoc)return O(R.finallyLoc)}else if(P){if(this.prev<R.catchLoc)return O(R.catchLoc,!0)}else{if(!N)throw Error("try statement without catch or finally");if(this.prev<R.finallyLoc)return O(R.finallyLoc)}}}},abrupt:function(v,w){for(var O=this.tryEntries.length-1;O>=0;--O){var j=this.tryEntries[O];if(j.tryLoc<=this.prev&&n.call(j,"finallyLoc")&&this.prev<j.finallyLoc){var R=j;break}}R&&(v==="break"||v==="continue")&&R.tryLoc<=w&&w<=R.finallyLoc&&(R=null);var M=R?R.completion:{};return M.type=v,M.arg=w,R?(this.method="next",this.next=R.finallyLoc,D):this.complete(M)},complete:function(v,w){if(v.type==="throw")throw v.arg;return v.type==="break"||v.type==="continue"?this.next=v.arg:v.type==="return"?(this.rval=this.arg=v.arg,this.method="return",this.next="end"):v.type==="normal"&&w&&(this.next=w),D},finish:function(v){for(var w=this.tryEntries.length-1;w>=0;--w){var O=this.tryEntries[w];if(O.finallyLoc===v)return this.complete(O.completion,O.afterLoc),q(O),D}},catch:function(v){for(var w=this.tryEntries.length-1;w>=0;--w){var O=this.tryEntries[w];if(O.tryLoc===v){var j=O.completion;if(j.type==="throw"){var R=j.arg;q(O)}return R}}throw Error("illegal catch attempt")},delegateYield:function(v,w,O){return this.delegate={iterator:V(v),resultName:w,nextLoc:O},this.method==="next"&&(this.arg=t),D}},e}function lS(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(l){r(l);return}a.done?e(u):Promise.resolve(u).then(n,i)}function rU(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function s(u){lS(o,n,i,s,a,"next",u)}function a(u){lS(o,n,i,s,a,"throw",u)}s(void 0)})}}function DS(t,e){return oU(t)||iU(t,e)||vS(t,e)||nU()}function nU(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
28
+ `,e=e.substr(s)}try{o=JSON.parse(e)}catch{return Mr.red("Error:")+" Not valid JSON!"}return i+=mu.render(o,r,n),i}});var Eg=D(Kc=>{"use strict";Object.defineProperty(Kc,"__esModule",{value:!0});Kc.default=void 0;function ss(t){"@babel/helpers - typeof";return ss=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},ss(t)}function VC(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,S5(n.key),n)}}function C5(t,e,r){return e&&VC(t.prototype,e),r&&VC(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function S5(t){var e=x5(t,"string");return ss(e)=="symbol"?e:e+""}function x5(t,e){if(ss(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(ss(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function F5(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function O5(t,e,r){return e=yu(e),A5(t,_g()?Reflect.construct(e,r||[],yu(t).constructor):e.apply(t,r))}function A5(t,e){if(e&&(ss(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return k5(t)}function k5(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function T5(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&&gu(t,e)}function wg(t){var e=typeof Map=="function"?new Map:void 0;return wg=function(n){if(n===null||!R5(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 P5(n,arguments,yu(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),gu(i,n)},wg(t)}function P5(t,e,r){if(_g())return Reflect.construct.apply(null,arguments);var n=[null];n.push.apply(n,e);var i=new(t.bind.apply(t,n));return r&&gu(i,r.prototype),i}function _g(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(_g=function(){return!!t})()}function R5(t){try{return Function.toString.call(t).indexOf("[native code]")!==-1}catch{return typeof t=="function"}}function gu(t,e){return gu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},gu(t,e)}function yu(t){return yu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},yu(t)}var $5=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(F5(this,e),n=O5(this,e,[r]),n.originalRequest=o,n.originalResponse=s,n.causingError=i,i!=null&&(r+=", caused by ".concat(i.toString())),o!=null){var a=o.getHeader("X-Request-ID")||"n/a",u=o.getMethod(),l=o.getURL(),c=s?s.getStatus():"n/a",f=s?s.getBody()||"":"n/a";r+=", originated from request (method: ".concat(u,", url: ").concat(l,", response code: ").concat(c,", response text: ").concat(f,", request id: ").concat(a,")")}return n.message=r,n}return T5(e,t),C5(e)}(wg(Error)),ule=Kc.default=$5});var Cg=D(Yc=>{"use strict";Object.defineProperty(Yc,"__esModule",{value:!0});Yc.enableDebugLog=I5;Yc.log=j5;var zC=!1;function I5(){zC=!0}function j5(t){zC&&console.log(t)}});var WC=D(Jc=>{"use strict";Object.defineProperty(Jc,"__esModule",{value:!0});Jc.default=void 0;function Du(t){"@babel/helpers - typeof";return Du=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},Du(t)}function N5(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function GC(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,B5(n.key),n)}}function L5(t,e,r){return e&&GC(t.prototype,e),r&&GC(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function B5(t){var e=q5(t,"string");return Du(e)=="symbol"?e:e+""}function q5(t,e){if(Du(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Du(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var fle=Jc.default=function(){function t(){N5(this,t)}return L5(t,[{key:"listAllUploads",value:function(){return Promise.resolve([])}},{key:"findUploadsByFingerprint",value:function(r){return Promise.resolve([])}},{key:"removeUpload",value:function(r){return Promise.resolve()}},{key:"addUpload",value:function(r,n){return Promise.resolve(null)}}])}()});var KC=D((Sg,xg)=>{(function(t,e){typeof Sg=="object"&&typeof xg<"u"?xg.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:Sg,function(){"use strict";var t="3.7.7",e=t,r=typeof Buffer=="function",n=typeof TextDecoder=="function"?new TextDecoder:void 0,i=typeof TextEncoder=="function"?new TextEncoder:void 0,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",s=Array.prototype.slice.call(o),a=function(P){var N={};return P.forEach(function(ie,oe){return N[ie]=oe}),N}(s),u=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,l=String.fromCharCode.bind(String),c=typeof Uint8Array.from=="function"?Uint8Array.from.bind(Uint8Array):function(P){return new Uint8Array(Array.prototype.slice.call(P,0))},f=function(P){return P.replace(/=/g,"").replace(/[+\/]/g,function(N){return N=="+"?"-":"_"})},h=function(P){return P.replace(/[^A-Za-z0-9\+\/]/g,"")},d=function(P){for(var N,ie,oe,ye,ln="",Gh=P.length%3,ql=0;ql<P.length;){if((ie=P.charCodeAt(ql++))>255||(oe=P.charCodeAt(ql++))>255||(ye=P.charCodeAt(ql++))>255)throw new TypeError("invalid character found");N=ie<<16|oe<<8|ye,ln+=s[N>>18&63]+s[N>>12&63]+s[N>>6&63]+s[N&63]}return Gh?ln.slice(0,Gh-3)+"===".substring(Gh):ln},m=typeof btoa=="function"?function(P){return btoa(P)}:r?function(P){return Buffer.from(P,"binary").toString("base64")}:d,b=r?function(P){return Buffer.from(P).toString("base64")}:function(P){for(var N=4096,ie=[],oe=0,ye=P.length;oe<ye;oe+=N)ie.push(l.apply(null,P.subarray(oe,oe+N)));return m(ie.join(""))},y=function(P,N){return N===void 0&&(N=!1),N?f(b(P)):b(P)},E=function(P){if(P.length<2){var N=P.charCodeAt(0);return N<128?P:N<2048?l(192|N>>>6)+l(128|N&63):l(224|N>>>12&15)+l(128|N>>>6&63)+l(128|N&63)}else{var N=65536+(P.charCodeAt(0)-55296)*1024+(P.charCodeAt(1)-56320);return l(240|N>>>18&7)+l(128|N>>>12&63)+l(128|N>>>6&63)+l(128|N&63)}},F=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,g=function(P){return P.replace(F,E)},C=r?function(P){return Buffer.from(P,"utf8").toString("base64")}:i?function(P){return b(i.encode(P))}:function(P){return m(g(P))},A=function(P,N){return N===void 0&&(N=!1),N?f(C(P)):C(P)},T=function(P){return A(P,!0)},x=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,L=function(P){switch(P.length){case 4:var N=(7&P.charCodeAt(0))<<18|(63&P.charCodeAt(1))<<12|(63&P.charCodeAt(2))<<6|63&P.charCodeAt(3),ie=N-65536;return l((ie>>>10)+55296)+l((ie&1023)+56320);case 3:return l((15&P.charCodeAt(0))<<12|(63&P.charCodeAt(1))<<6|63&P.charCodeAt(2));default:return l((31&P.charCodeAt(0))<<6|63&P.charCodeAt(1))}},S=function(P){return P.replace(x,L)},I=function(P){if(P=P.replace(/\s+/g,""),!u.test(P))throw new TypeError("malformed base64.");P+="==".slice(2-(P.length&3));for(var N,ie="",oe,ye,ln=0;ln<P.length;)N=a[P.charAt(ln++)]<<18|a[P.charAt(ln++)]<<12|(oe=a[P.charAt(ln++)])<<6|(ye=a[P.charAt(ln++)]),ie+=oe===64?l(N>>16&255):ye===64?l(N>>16&255,N>>8&255):l(N>>16&255,N>>8&255,N&255);return ie},$=typeof atob=="function"?function(P){return atob(h(P))}:r?function(P){return Buffer.from(P,"base64").toString("binary")}:I,B=r?function(P){return c(Buffer.from(P,"base64"))}:function(P){return c($(P).split("").map(function(N){return N.charCodeAt(0)}))},q=function(P){return B(V(P))},K=r?function(P){return Buffer.from(P,"base64").toString("utf8")}:n?function(P){return n.decode(B(P))}:function(P){return S($(P))},V=function(P){return h(P.replace(/[-_]/g,function(N){return N=="-"?"+":"/"}))},_=function(P){return K(V(P))},v=function(P){if(typeof P!="string")return!1;var N=P.replace(/\s+/g,"").replace(/={0,2}$/,"");return!/[^\s0-9a-zA-Z\+/]/.test(N)||!/[^\s0-9a-zA-Z\-_]/.test(N)},w=function(P){return{value:P,enumerable:!1,writable:!0,configurable:!0}},O=function(){var P=function(N,ie){return Object.defineProperty(String.prototype,N,w(ie))};P("fromBase64",function(){return _(this)}),P("toBase64",function(N){return A(this,N)}),P("toBase64URI",function(){return A(this,!0)}),P("toBase64URL",function(){return A(this,!0)}),P("toUint8Array",function(){return q(this)})},j=function(){var P=function(N,ie){return Object.defineProperty(Uint8Array.prototype,N,w(ie))};P("toBase64",function(N){return y(this,N)}),P("toBase64URI",function(){return y(this,!0)}),P("toBase64URL",function(){return y(this,!0)})},R=function(){O(),j()},M={version:t,VERSION:e,atob:$,atobPolyfill:I,btoa:m,btoaPolyfill:d,fromBase64:_,toBase64:A,encode:A,encodeURI:T,encodeURL:T,utob:g,btou:S,decode:_,isValid:v,fromUint8Array:y,toUint8Array:q,extendString:O,extendUint8Array:j,extendBuiltins:R};return M.Base64={},Object.keys(M).forEach(function(P){return M.Base64[P]=M[P]}),M})});var JC=D((hle,YC)=>{"use strict";YC.exports=function(e,r){if(r=r.split(":")[0],e=+e,!e)return!1;switch(r){case"http":case"ws":return e!==80;case"https":case"wss":return e!==443;case"ftp":return e!==21;case"gopher":return e!==70;case"file":return!1}return e!==0}});var QC=D(Fg=>{"use strict";var M5=Object.prototype.hasOwnProperty,U5;function XC(t){try{return decodeURIComponent(t.replace(/\+/g," "))}catch{return null}}function ZC(t){try{return encodeURIComponent(t)}catch{return null}}function H5(t){for(var e=/([^=?#&]+)=?([^&]*)/g,r={},n;n=e.exec(t);){var i=XC(n[1]),o=XC(n[2]);i===null||o===null||i in r||(r[i]=o)}return r}function V5(t,e){e=e||"";var r=[],n,i;typeof e!="string"&&(e="?");for(i in t)if(M5.call(t,i)){if(n=t[i],!n&&(n===null||n===U5||isNaN(n))&&(n=""),i=ZC(i),n=ZC(n),i===null||n===null)continue;r.push(i+"="+n)}return r.length?e+r.join("&"):""}Fg.stringify=V5;Fg.parse=H5});var aS=D((mle,sS)=>{"use strict";var tS=JC(),Xc=QC(),z5=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,rS=/[\n\r\t]/g,G5=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,nS=/:\d+$/,W5=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i,K5=/^[a-zA-Z]:/;function Ag(t){return(t||"").toString().replace(z5,"")}var Og=[["#","hash"],["?","query"],function(e,r){return Ur(r.protocol)?e.replace(/\\/g,"/"):e},["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d*)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],eS={hash:1,query:1};function iS(t){var e;typeof window<"u"?e=window:typeof global<"u"?e=global:typeof self<"u"?e=self:e={};var r=e.location||{};t=t||r;var n={},i=typeof t,o;if(t.protocol==="blob:")n=new Hr(unescape(t.pathname),{});else if(i==="string"){n=new Hr(t,{});for(o in eS)delete n[o]}else if(i==="object"){for(o in t)o in eS||(n[o]=t[o]);n.slashes===void 0&&(n.slashes=G5.test(t.href))}return n}function Ur(t){return t==="file:"||t==="ftp:"||t==="http:"||t==="https:"||t==="ws:"||t==="wss:"}function oS(t,e){t=Ag(t),t=t.replace(rS,""),e=e||{};var r=W5.exec(t),n=r[1]?r[1].toLowerCase():"",i=!!r[2],o=!!r[3],s=0,a;return i?o?(a=r[2]+r[3]+r[4],s=r[2].length+r[3].length):(a=r[2]+r[4],s=r[2].length):o?(a=r[3]+r[4],s=r[3].length):a=r[4],n==="file:"?s>=2&&(a=a.slice(2)):Ur(n)?a=r[4]:n?i&&(a=a.slice(2)):s>=2&&Ur(e.protocol)&&(a=r[4]),{protocol:n,slashes:i||Ur(n),slashesCount:s,rest:a}}function Y5(t,e){if(t==="")return e;for(var r=(e||"/").split("/").slice(0,-1).concat(t.split("/")),n=r.length,i=r[n-1],o=!1,s=0;n--;)r[n]==="."?r.splice(n,1):r[n]===".."?(r.splice(n,1),s++):s&&(n===0&&(o=!0),r.splice(n,1),s--);return o&&r.unshift(""),(i==="."||i==="..")&&r.push(""),r.join("/")}function Hr(t,e,r){if(t=Ag(t),t=t.replace(rS,""),!(this instanceof Hr))return new Hr(t,e,r);var n,i,o,s,a,u,l=Og.slice(),c=typeof e,f=this,h=0;for(c!=="object"&&c!=="string"&&(r=e,e=null),r&&typeof r!="function"&&(r=Xc.parse),e=iS(e),i=oS(t||"",e),n=!i.protocol&&!i.slashes,f.slashes=i.slashes||n&&e.slashes,f.protocol=i.protocol||e.protocol||"",t=i.rest,(i.protocol==="file:"&&(i.slashesCount!==2||K5.test(t))||!i.slashes&&(i.protocol||i.slashesCount<2||!Ur(f.protocol)))&&(l[3]=[/(.*)/,"pathname"]);h<l.length;h++){if(s=l[h],typeof s=="function"){t=s(t,f);continue}o=s[0],u=s[1],o!==o?f[u]=t:typeof o=="string"?(a=o==="@"?t.lastIndexOf(o):t.indexOf(o),~a&&(typeof s[2]=="number"?(f[u]=t.slice(0,a),t=t.slice(a+s[2])):(f[u]=t.slice(a),t=t.slice(0,a)))):(a=o.exec(t))&&(f[u]=a[1],t=t.slice(0,a.index)),f[u]=f[u]||n&&s[3]&&e[u]||"",s[4]&&(f[u]=f[u].toLowerCase())}r&&(f.query=r(f.query)),n&&e.slashes&&f.pathname.charAt(0)!=="/"&&(f.pathname!==""||e.pathname!=="")&&(f.pathname=Y5(f.pathname,e.pathname)),f.pathname.charAt(0)!=="/"&&Ur(f.protocol)&&(f.pathname="/"+f.pathname),tS(f.port,f.protocol)||(f.host=f.hostname,f.port=""),f.username=f.password="",f.auth&&(a=f.auth.indexOf(":"),~a?(f.username=f.auth.slice(0,a),f.username=encodeURIComponent(decodeURIComponent(f.username)),f.password=f.auth.slice(a+1),f.password=encodeURIComponent(decodeURIComponent(f.password))):f.username=encodeURIComponent(decodeURIComponent(f.auth)),f.auth=f.password?f.username+":"+f.password:f.username),f.origin=f.protocol!=="file:"&&Ur(f.protocol)&&f.host?f.protocol+"//"+f.host:"null",f.href=f.toString()}function J5(t,e,r){var n=this;switch(t){case"query":typeof e=="string"&&e.length&&(e=(r||Xc.parse)(e)),n[t]=e;break;case"port":n[t]=e,tS(e,n.protocol)?e&&(n.host=n.hostname+":"+e):(n.host=n.hostname,n[t]="");break;case"hostname":n[t]=e,n.port&&(e+=":"+n.port),n.host=e;break;case"host":n[t]=e,nS.test(e)?(e=e.split(":"),n.port=e.pop(),n.hostname=e.join(":")):(n.hostname=e,n.port="");break;case"protocol":n.protocol=e.toLowerCase(),n.slashes=!r;break;case"pathname":case"hash":if(e){var i=t==="pathname"?"/":"#";n[t]=e.charAt(0)!==i?i+e:e}else n[t]=e;break;case"username":case"password":n[t]=encodeURIComponent(e);break;case"auth":var o=e.indexOf(":");~o?(n.username=e.slice(0,o),n.username=encodeURIComponent(decodeURIComponent(n.username)),n.password=e.slice(o+1),n.password=encodeURIComponent(decodeURIComponent(n.password))):n.username=encodeURIComponent(decodeURIComponent(e))}for(var s=0;s<Og.length;s++){var a=Og[s];a[4]&&(n[a[1]]=n[a[1]].toLowerCase())}return n.auth=n.password?n.username+":"+n.password:n.username,n.origin=n.protocol!=="file:"&&Ur(n.protocol)&&n.host?n.protocol+"//"+n.host:"null",n.href=n.toString(),n}function X5(t){(!t||typeof t!="function")&&(t=Xc.stringify);var e,r=this,n=r.host,i=r.protocol;i&&i.charAt(i.length-1)!==":"&&(i+=":");var o=i+(r.protocol&&r.slashes||Ur(r.protocol)?"//":"");return r.username?(o+=r.username,r.password&&(o+=":"+r.password),o+="@"):r.password?(o+=":"+r.password,o+="@"):r.protocol!=="file:"&&Ur(r.protocol)&&!n&&r.pathname!=="/"&&(o+="@"),(n[n.length-1]===":"||nS.test(r.hostname)&&!r.port)&&(n+=":"),o+=n+r.pathname,e=typeof r.query=="object"?t(r.query):r.query,e&&(o+=e.charAt(0)!=="?"?"?"+e:e),r.hash&&(o+=r.hash),o}Hr.prototype={set:J5,toString:X5};Hr.extractProtocol=oS;Hr.location=iS;Hr.trimLeft=Ag;Hr.qs=Xc;sS.exports=Hr});var uS=D(kg=>{"use strict";Object.defineProperty(kg,"__esModule",{value:!0});kg.default=Z5;function Z5(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var e=Math.random()*16|0,r=t==="x"?e:e&3|8;return r.toString(16)})}});var ES=D(tf=>{"use strict";Object.defineProperty(tf,"__esModule",{value:!0});tf.default=void 0;var Q5=KC(),eU=Rg(aS()),Zc=Rg(Eg()),Ti=Cg(),tU=Rg(uS());function Rg(t){return t&&t.__esModule?t:{default:t}}function Tg(){"use strict";Tg=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(_,v,w){_[v]=w.value},o=typeof Symbol=="function"?Symbol:{},s=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function l(_,v,w){return Object.defineProperty(_,v,{value:w,enumerable:!0,configurable:!0,writable:!0}),_[v]}try{l({},"")}catch{l=function(w,O,j){return w[O]=j}}function c(_,v,w,O){var j=v&&v.prototype instanceof E?v:E,R=Object.create(j.prototype),M=new K(O||[]);return i(R,"_invoke",{value:I(_,w,M)}),R}function f(_,v,w){try{return{type:"normal",arg:_.call(v,w)}}catch(O){return{type:"throw",arg:O}}}e.wrap=c;var h="suspendedStart",d="suspendedYield",m="executing",b="completed",y={};function E(){}function F(){}function g(){}var C={};l(C,s,function(){return this});var A=Object.getPrototypeOf,T=A&&A(A(V([])));T&&T!==r&&n.call(T,s)&&(C=T);var x=g.prototype=E.prototype=Object.create(C);function L(_){["next","throw","return"].forEach(function(v){l(_,v,function(w){return this._invoke(v,w)})})}function S(_,v){function w(j,R,M,P){var N=f(_[j],_,R);if(N.type!=="throw"){var ie=N.arg,oe=ie.value;return oe&&Pi(oe)=="object"&&n.call(oe,"__await")?v.resolve(oe.__await).then(function(ye){w("next",ye,M,P)},function(ye){w("throw",ye,M,P)}):v.resolve(oe).then(function(ye){ie.value=ye,M(ie)},function(ye){return w("throw",ye,M,P)})}P(N.arg)}var O;i(this,"_invoke",{value:function(R,M){function P(){return new v(function(N,ie){w(R,M,N,ie)})}return O=O?O.then(P,P):P()}})}function I(_,v,w){var O=h;return function(j,R){if(O===m)throw Error("Generator is already running");if(O===b){if(j==="throw")throw R;return{value:t,done:!0}}for(w.method=j,w.arg=R;;){var M=w.delegate;if(M){var P=$(M,w);if(P){if(P===y)continue;return P}}if(w.method==="next")w.sent=w._sent=w.arg;else if(w.method==="throw"){if(O===h)throw O=b,w.arg;w.dispatchException(w.arg)}else w.method==="return"&&w.abrupt("return",w.arg);O=m;var N=f(_,v,w);if(N.type==="normal"){if(O=w.done?b:d,N.arg===y)continue;return{value:N.arg,done:w.done}}N.type==="throw"&&(O=b,w.method="throw",w.arg=N.arg)}}}function $(_,v){var w=v.method,O=_.iterator[w];if(O===t)return v.delegate=null,w==="throw"&&_.iterator.return&&(v.method="return",v.arg=t,$(_,v),v.method==="throw")||w!=="return"&&(v.method="throw",v.arg=new TypeError("The iterator does not provide a '"+w+"' method")),y;var j=f(O,_.iterator,v.arg);if(j.type==="throw")return v.method="throw",v.arg=j.arg,v.delegate=null,y;var R=j.arg;return R?R.done?(v[_.resultName]=R.value,v.next=_.nextLoc,v.method!=="return"&&(v.method="next",v.arg=t),v.delegate=null,y):R:(v.method="throw",v.arg=new TypeError("iterator result is not an object"),v.delegate=null,y)}function B(_){var v={tryLoc:_[0]};1 in _&&(v.catchLoc=_[1]),2 in _&&(v.finallyLoc=_[2],v.afterLoc=_[3]),this.tryEntries.push(v)}function q(_){var v=_.completion||{};v.type="normal",delete v.arg,_.completion=v}function K(_){this.tryEntries=[{tryLoc:"root"}],_.forEach(B,this),this.reset(!0)}function V(_){if(_||_===""){var v=_[s];if(v)return v.call(_);if(typeof _.next=="function")return _;if(!isNaN(_.length)){var w=-1,O=function j(){for(;++w<_.length;)if(n.call(_,w))return j.value=_[w],j.done=!1,j;return j.value=t,j.done=!0,j};return O.next=O}}throw new TypeError(Pi(_)+" is not iterable")}return F.prototype=g,i(x,"constructor",{value:g,configurable:!0}),i(g,"constructor",{value:F,configurable:!0}),F.displayName=l(g,u,"GeneratorFunction"),e.isGeneratorFunction=function(_){var v=typeof _=="function"&&_.constructor;return!!v&&(v===F||(v.displayName||v.name)==="GeneratorFunction")},e.mark=function(_){return Object.setPrototypeOf?Object.setPrototypeOf(_,g):(_.__proto__=g,l(_,u,"GeneratorFunction")),_.prototype=Object.create(x),_},e.awrap=function(_){return{__await:_}},L(S.prototype),l(S.prototype,a,function(){return this}),e.AsyncIterator=S,e.async=function(_,v,w,O,j){j===void 0&&(j=Promise);var R=new S(c(_,v,w,O),j);return e.isGeneratorFunction(v)?R:R.next().then(function(M){return M.done?M.value:R.next()})},L(x),l(x,u,"Generator"),l(x,s,function(){return this}),l(x,"toString",function(){return"[object Generator]"}),e.keys=function(_){var v=Object(_),w=[];for(var O in v)w.push(O);return w.reverse(),function j(){for(;w.length;){var R=w.pop();if(R in v)return j.value=R,j.done=!1,j}return j.done=!0,j}},e.values=V,K.prototype={constructor:K,reset:function(v){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(q),!v)for(var w in this)w.charAt(0)==="t"&&n.call(this,w)&&!isNaN(+w.slice(1))&&(this[w]=t)},stop:function(){this.done=!0;var v=this.tryEntries[0].completion;if(v.type==="throw")throw v.arg;return this.rval},dispatchException:function(v){if(this.done)throw v;var w=this;function O(ie,oe){return M.type="throw",M.arg=v,w.next=ie,oe&&(w.method="next",w.arg=t),!!oe}for(var j=this.tryEntries.length-1;j>=0;--j){var R=this.tryEntries[j],M=R.completion;if(R.tryLoc==="root")return O("end");if(R.tryLoc<=this.prev){var P=n.call(R,"catchLoc"),N=n.call(R,"finallyLoc");if(P&&N){if(this.prev<R.catchLoc)return O(R.catchLoc,!0);if(this.prev<R.finallyLoc)return O(R.finallyLoc)}else if(P){if(this.prev<R.catchLoc)return O(R.catchLoc,!0)}else{if(!N)throw Error("try statement without catch or finally");if(this.prev<R.finallyLoc)return O(R.finallyLoc)}}}},abrupt:function(v,w){for(var O=this.tryEntries.length-1;O>=0;--O){var j=this.tryEntries[O];if(j.tryLoc<=this.prev&&n.call(j,"finallyLoc")&&this.prev<j.finallyLoc){var R=j;break}}R&&(v==="break"||v==="continue")&&R.tryLoc<=w&&w<=R.finallyLoc&&(R=null);var M=R?R.completion:{};return M.type=v,M.arg=w,R?(this.method="next",this.next=R.finallyLoc,y):this.complete(M)},complete:function(v,w){if(v.type==="throw")throw v.arg;return v.type==="break"||v.type==="continue"?this.next=v.arg:v.type==="return"?(this.rval=this.arg=v.arg,this.method="return",this.next="end"):v.type==="normal"&&w&&(this.next=w),y},finish:function(v){for(var w=this.tryEntries.length-1;w>=0;--w){var O=this.tryEntries[w];if(O.finallyLoc===v)return this.complete(O.completion,O.afterLoc),q(O),y}},catch:function(v){for(var w=this.tryEntries.length-1;w>=0;--w){var O=this.tryEntries[w];if(O.tryLoc===v){var j=O.completion;if(j.type==="throw"){var R=j.arg;q(O)}return R}}throw Error("illegal catch attempt")},delegateYield:function(v,w,O){return this.delegate={iterator:V(v),resultName:w,nextLoc:O},this.method==="next"&&(this.arg=t),y}},e}function lS(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(l){r(l);return}a.done?e(u):Promise.resolve(u).then(n,i)}function rU(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function s(u){lS(o,n,i,s,a,"next",u)}function a(u){lS(o,n,i,s,a,"throw",u)}s(void 0)})}}function DS(t,e){return oU(t)||iU(t,e)||vS(t,e)||nU()}function nU(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
29
29
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function iU(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,o,s,a=[],u=!0,l=!1;try{if(o=(r=r.call(t)).next,e===0){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=o.call(r)).done)&&(a.push(n.value),a.length!==e);u=!0);}catch(c){l=!0,i=c}finally{try{if(!u&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(l)throw i}}return a}}function oU(t){if(Array.isArray(t))return t}function Pi(t){"@babel/helpers - typeof";return Pi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Pi(t)}function sU(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=vS(t))||e&&t&&typeof t.length=="number"){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
30
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,s=!1,a;return{s:function(){r=r.call(t)},n:function(){var l=r.next();return o=l.done,l},e:function(l){s=!0,a=l},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(s)throw a}}}}function vS(t,e){if(t){if(typeof t=="string")return cS(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return cS(t,e)}}function cS(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function fS(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function as(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?fS(Object(r),!0).forEach(function(n){aU(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):fS(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function aU(t,e,r){return e=bS(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function uU(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function dS(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,bS(n.key),n)}}function lU(t,e,r){return e&&dS(t.prototype,e),r&&dS(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function bS(t){var e=cU(t,"string");return Pi(e)=="symbol"?e:e+""}function cU(t,e){if(Pi(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Pi(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Qc="tus-v1",ef="ietf-draft-03",vu="ietf-draft-05",fU={endpoint:null,uploadUrl:null,metadata:{},metadataForPartialUploads:{},fingerprint:null,uploadSize:null,onProgress:null,onChunkComplete:null,onSuccess:null,onError:null,onUploadUrlAvailable:null,overridePatchMethod:!1,headers:{},addRequestId:!1,onBeforeRequest:null,onAfterResponse:null,onShouldRetry:_S,chunkSize:Number.POSITIVE_INFINITY,retryDelays:[0,1e3,3e3,5e3],parallelUploads:1,parallelUploadBoundaries:null,storeFingerprintForResuming:!0,removeFingerprintOnSuccess:!1,uploadLengthDeferred:!1,uploadDataDuringCreation:!1,urlStorage:null,fileReader:null,httpStack:null,protocol:Qc},wS=function(){function t(e,r){uU(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 lU(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(![Qc,ef,vu].includes(this.options.protocol)){this._emitError(new Error("tus: unsupported protocol ".concat(this.options.protocol)));return}if(!this.options.endpoint&&!this.options.uploadUrl&&!this.url){this._emitError(new Error("tus: neither an endpoint or an upload URL is provided"));return}var i=this.options.retryDelays;if(i!=null&&Object.prototype.toString.call(i)!=="[object Array]"){this._emitError(new Error("tus: the `retryDelays` option must either be an array or null"));return}if(this.options.parallelUploads>1)for(var o=0,s=["uploadUrl","uploadSize","uploadLengthDeferred"];o<s.length;o++){var a=s[o];if(this.options[a]){this._emitError(new Error("tus: cannot use the ".concat(a," option when parallelUploads is enabled")));return}}if(this.options.parallelUploadBoundaries){if(this.options.parallelUploads<=1){this._emitError(new Error("tus: cannot use the `parallelUploadBoundaries` option when `parallelUploads` is disabled"));return}if(this.options.parallelUploads!==this.options.parallelUploadBoundaries.length){this._emitError(new Error("tus: the `parallelUploadBoundaries` must have the same length as the value of `parallelUploads`"));return}}this.options.fingerprint(n,this.options).then(function(u){return u==null?(0,Ti.log)("No fingerprint was calculated meaning that the upload cannot be stored in the URL storage."):(0,Ti.log)("Calculated fingerprint: ".concat(u)),r._fingerprint=u,r._source?r._source:r.options.fileReader.openFile(n,r.options.chunkSize)}).then(function(u){if(r._source=u,r.options.uploadLengthDeferred)r._size=null;else if(r.options.uploadSize!=null){if(r._size=Number(r.options.uploadSize),Number.isNaN(r._size)){r._emitError(new Error("tus: cannot convert `uploadSize` option into a number"));return}}else if(r._size=r._source.size,r._size==null){r._emitError(new Error("tus: cannot automatically derive upload's size from input. Specify it manually using the `uploadSize` option or use the `uploadLengthDeferred` option"));return}r.options.parallelUploads>1||r._parallelUploadUrls!=null?r._startParallelUpload():r._startSingleUpload()}).catch(function(u){r._emitError(u)})}},{key:"_startParallelUpload",value:function(){var r,n=this,i=this._size,o=0;this._parallelUploads=[];var s=this._parallelUploadUrls!=null?this._parallelUploadUrls.length:this.options.parallelUploads,a=(r=this.options.parallelUploadBoundaries)!==null&&r!==void 0?r:hU(this._source.size,s);this._parallelUploadUrls&&a.forEach(function(c,f){c.uploadUrl=n._parallelUploadUrls[f]||null}),this._parallelUploadUrls=new Array(a.length);var u=a.map(function(c,f){var h=0;return n._source.slice(c.start,c.end).then(function(d){var m=d.value;return new Promise(function(b,D){var _=as(as({},n.options),{},{uploadUrl:c.uploadUrl||null,storeFingerprintForResuming:!1,removeFingerprintOnSuccess:!1,parallelUploads:1,parallelUploadBoundaries:null,metadata:n.options.metadataForPartialUploads,headers:as(as({},n.options.headers),{},{"Upload-Concat":"partial"}),onSuccess:b,onError:D,onProgress:function(C){o=o-h+C,h=C,n._emitProgress(o,i)},onUploadUrlAvailable:function(){n._parallelUploadUrls[f]=F.url,n._parallelUploadUrls.filter(function(C){return!!C}).length===a.length&&n._saveUploadInUrlStorage()}}),F=new t(m,_);F.start(),n._parallelUploads.push(F)})})}),l;Promise.all(u).then(function(){l=n._openRequest("POST",n.options.endpoint),l.setHeader("Upload-Concat","final;".concat(n._parallelUploadUrls.join(" ")));var c=hS(n.options.metadata);return c!==""&&l.setHeader("Upload-Metadata",c),n._sendRequest(l,null)}).then(function(c){if(!us(c.getStatus(),200)){n._emitHttpError(l,c,"tus: unexpected response while creating upload");return}var f=c.getHeader("Location");if(f==null){n._emitHttpError(l,c,"tus: invalid or missing Location header");return}n.url=yS(n.options.endpoint,f),(0,Ti.log)("Created upload at ".concat(n.url)),n._emitSuccess(c)}).catch(function(c){n._emitError(c)})}},{key:"_startSingleUpload",value:function(){if(this._aborted=!1,this.url!=null){(0,Ti.log)("Resuming upload from previous URL: ".concat(this.url)),this._resumeUpload();return}if(this.options.uploadUrl!=null){(0,Ti.log)("Resuming upload from provided URL: ".concat(this.options.uploadUrl)),this.url=this.options.uploadUrl,this._resumeUpload();return}(0,Ti.log)("Creating a new upload"),this._createUpload()}},{key:"abort",value:function(r){var n=this;if(this._parallelUploads!=null){var i=sU(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 Zc.default(i,o,r,n))}},{key:"_emitError",value:function(r){var n=this;if(!this._aborted){if(this.options.retryDelays!=null){var i=this._offset!=null&&this._offset>this._offsetBeforeRetry;if(i&&(this._retryAttempt=0),gS(r,this._retryAttempt,this.options)){var o=this.options.retryDelays[this._retryAttempt++];this._offsetBeforeRetry=this._offset,this._retryTimeout=setTimeout(function(){n.start()},o);return}}if(typeof this.options.onError=="function")this.options.onError(r);else throw r}}},{key:"_emitSuccess",value:function(r){this.options.removeFingerprintOnSuccess&&this._removeFromUrlStorage(),typeof this.options.onSuccess=="function"&&this.options.onSuccess({lastResponse:r})}},{key:"_emitProgress",value:function(r,n){typeof this.options.onProgress=="function"&&this.options.onProgress(r,n)}},{key:"_emitChunkComplete",value:function(r,n,i){typeof this.options.onChunkComplete=="function"&&this.options.onChunkComplete(r,n,i)}},{key:"_createUpload",value:function(){var r=this;if(!this.options.endpoint){this._emitError(new Error("tus: unable to create upload because no endpoint is provided"));return}var n=this._openRequest("POST",this.options.endpoint);this.options.uploadLengthDeferred?n.setHeader("Upload-Defer-Length","1"):n.setHeader("Upload-Length","".concat(this._size));var i=hS(this.options.metadata);i!==""&&n.setHeader("Upload-Metadata",i);var o;this.options.uploadDataDuringCreation&&!this.options.uploadLengthDeferred?(this._offset=0,o=this._addChunkToRequest(n)):((this.options.protocol===ef||this.options.protocol===vu)&&n.setHeader("Upload-Complete","?0"),o=this._sendRequest(n,null)),o.then(function(s){if(!us(s.getStatus(),200)){r._emitHttpError(n,s,"tus: unexpected response while creating upload");return}var a=s.getHeader("Location");if(a==null){r._emitHttpError(n,s,"tus: invalid or missing Location header");return}if(r.url=yS(r.options.endpoint,a),(0,Ti.log)("Created upload at ".concat(r.url)),typeof r.options.onUploadUrlAvailable=="function"&&r.options.onUploadUrlAvailable(),r._size===0){r._emitSuccess(s),r._source.close();return}r._saveUploadInUrlStorage().then(function(){r.options.uploadDataDuringCreation?r._handleUploadResponse(n,s):(r._offset=0,r._performUpload())})}).catch(function(s){r._emitHttpError(n,null,"tus: failed to create upload",s)})}},{key:"_resumeUpload",value:function(){var r=this,n=this._openRequest("HEAD",this.url),i=this._sendRequest(n,null);i.then(function(o){var s=o.getStatus();if(!us(s,200)){if(s===423){r._emitHttpError(n,o,"tus: upload is currently locked; retry later");return}if(us(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===Qc){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(!us(o.getStatus(),200)){r._emitHttpError(n,o,"tus: unexpected response while uploading chunk");return}r._handleUploadResponse(n,o)}).catch(function(o){r._aborted||r._emitHttpError(n,null,"tus: failed to upload chunk at offset ".concat(r._offset),o)})}}},{key:"_addChunkToRequest",value:function(r){var n=this,i=this._offset,o=this._offset+this.options.chunkSize;return r.setProgressHandler(function(s){n._emitProgress(i+s,n._size)}),this.options.protocol===Qc?r.setHeader("Content-Type","application/offset+octet-stream"):this.options.protocol===vu&&r.setHeader("Content-Type","application/partial-upload"),(o===Number.POSITIVE_INFINITY||o>this._size)&&!this.options.uploadLengthDeferred&&(o=this._size),this._source.slice(i,o).then(function(s){var a=s.value,u=s.done,l=a!=null&&a.size?a.size:0;n.options.uploadLengthDeferred&&u&&(n._size=n._offset+l,r.setHeader("Upload-Length","".concat(n._size)));var c=n._offset+l;return!n.options.uploadLengthDeferred&&u&&c!==n._size?Promise.reject(new Error("upload was configured with a size of ".concat(n._size," bytes, but the source is done after ").concat(c," bytes"))):a===null?n._sendRequest(r):((n.options.protocol===ef||n.options.protocol===vu)&&r.setHeader("Upload-Complete",u?"?1":"?0"),n._emitProgress(n._offset,n._size),n._sendRequest(r,a))})}},{key:"_handleUploadResponse",value:function(r,n){var i=Number.parseInt(n.getHeader("Upload-Offset"),10);if(Number.isNaN(i)){this._emitHttpError(r,n,"tus: invalid or missing offset value");return}if(this._emitProgress(i,this._size),this._emitChunkComplete(i-this._offset,i,this._size),this._offset=i,i===this._size){this._emitSuccess(n),this._source.close();return}this._performUpload()}},{key:"_openRequest",value:function(r,n){var i=pS(r,n,this.options);return this._req=i,i}},{key:"_removeFromUrlStorage",value:function(){var r=this;this._urlStorageKey&&(this._urlStorage.removeUpload(this._urlStorageKey).catch(function(n){r._emitError(n)}),this._urlStorageKey=null)}},{key:"_saveUploadInUrlStorage",value:function(){var r=this;if(!this.options.storeFingerprintForResuming||!this._fingerprint||this._urlStorageKey!==null)return Promise.resolve();var n={size:this._size,metadata:this.options.metadata,creationTime:new Date().toString()};return this._parallelUploads?n.parallelUploadUrls=this._parallelUploadUrls:n.uploadUrl=this.url,this._urlStorage.addUpload(this._fingerprint,n).then(function(i){r._urlStorageKey=i})}},{key:"_sendRequest",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return mS(r,n,this.options)}}],[{key:"terminate",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=pS("DELETE",r,n);return mS(i,null,n).then(function(o){if(o.getStatus()!==204)throw new Zc.default("tus: unexpected response while terminating upload",null,i,o)}).catch(function(o){if(o instanceof Zc.default||(o=new Zc.default("tus: failed to terminate upload",o,i,null)),!gS(o,0,n))throw o;var s=n.retryDelays[0],a=n.retryDelays.slice(1),u=as(as({},n),{},{retryDelays:a});return new Promise(function(l){return setTimeout(l,s)}).then(function(){return t.terminate(r,u)})})}}])}();function hS(t){return Object.entries(t).map(function(e){var r=DS(e,2),n=r[0],i=r[1];return"".concat(n," ").concat(Q5.Base64.encode(String(i)))}).join(",")}function us(t,e){return t>=e&&t<e+100}function pS(t,e,r){var n=r.httpStack.createRequest(t,e);r.protocol===ef?n.setHeader("Upload-Draft-Interop-Version","5"):r.protocol===vu?n.setHeader("Upload-Draft-Interop-Version","6"):n.setHeader("Tus-Resumable","1.0.0");for(var i=r.headers||{},o=0,s=Object.entries(i);o<s.length;o++){var a=DS(s[o],2),u=a[0],l=a[1];n.setHeader(u,l)}if(r.addRequestId){var c=(0,tU.default)();n.setHeader("X-Request-ID",c)}return n}function mS(t,e,r){return Pg.apply(this,arguments)}function Pg(){return Pg=rU(Tg().mark(function t(e,r,n){var i;return Tg().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)})),Pg.apply(this,arguments)}function dU(){var t=!0;return typeof navigator<"u"&&navigator.onLine===!1&&(t=!1),t}function gS(t,e,r){return r.retryDelays==null||e>=r.retryDelays.length||t.originalRequest==null?!1:r&&typeof r.onShouldRetry=="function"?r.onShouldRetry(t,e,r):_S(t)}function _S(t){var e=t.originalResponse?t.originalResponse.getStatus():0;return(!us(e,400)||e===409||e===423)&&dU()}function yS(t,e){return new eU.default(e,t).toString()}function hU(t,e){for(var r=Math.floor(t/e),n=[],i=0;i<e;i++)n.push({start:r*i,end:r*(i+1)});return n[e-1].end=t,n}wS.defaultOptions=fU;var yle=tf.default=wS});var SS=y((vle,CS)=>{"use strict";var Vr=t=>t!==null&&typeof t=="object"&&typeof t.pipe=="function";Vr.writable=t=>Vr(t)&&t.writable!==!1&&typeof t._write=="function"&&typeof t._writableState=="object";Vr.readable=t=>Vr(t)&&t.readable!==!1&&typeof t._read=="function"&&typeof t._readableState=="object";Vr.duplex=t=>Vr.writable(t)&&Vr.readable(t);Vr.transform=t=>Vr.duplex(t)&&typeof t._transform=="function";CS.exports=Vr});var FS=y(rf=>{"use strict";Object.defineProperty(rf,"__esModule",{value:!0});rf.default=void 0;function bu(t){"@babel/helpers - typeof";return bu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},bu(t)}function pU(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,gU(n.key),n)}}function mU(t,e,r){return e&&xS(t.prototype,e),r&&xS(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function gU(t){var e=yU(t,"string");return bu(e)=="symbol"?e:e+""}function yU(t,e){if(bu(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(bu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var ble=rf.default=function(){function t(e){pU(this,t),this._buffer=e,this.size=e.length}return mU(t,[{key:"slice",value:function(r,n){var i=this._buffer.slice(r,n);i.size=i.length;var o=n>=this.size;return Promise.resolve({value:i,done:o})}},{key:"close",value:function(){}}])}()});var TS=y(jg=>{"use strict";Object.defineProperty(jg,"__esModule",{value:!0});jg.default=EU;var kS=require("fs");function Ri(t){"@babel/helpers - typeof";return Ri=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ri(t)}function $g(){"use strict";$g=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(E,v,w){E[v]=w.value},o=typeof Symbol=="function"?Symbol:{},s=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function l(E,v,w){return Object.defineProperty(E,v,{value:w,enumerable:!0,configurable:!0,writable:!0}),E[v]}try{l({},"")}catch{l=function(w,O,j){return w[O]=j}}function c(E,v,w,O){var j=v&&v.prototype instanceof _?v:_,R=Object.create(j.prototype),M=new K(O||[]);return i(R,"_invoke",{value:I(E,w,M)}),R}function f(E,v,w){try{return{type:"normal",arg:E.call(v,w)}}catch(O){return{type:"throw",arg:O}}}e.wrap=c;var h="suspendedStart",d="suspendedYield",m="executing",b="completed",D={};function _(){}function F(){}function g(){}var C={};l(C,s,function(){return this});var A=Object.getPrototypeOf,T=A&&A(A(V([])));T&&T!==r&&n.call(T,s)&&(C=T);var x=g.prototype=_.prototype=Object.create(C);function L(E){["next","throw","return"].forEach(function(v){l(E,v,function(w){return this._invoke(v,w)})})}function S(E,v){function w(j,R,M,P){var N=f(E[j],E,R);if(N.type!=="throw"){var ie=N.arg,oe=ie.value;return oe&&Ri(oe)=="object"&&n.call(oe,"__await")?v.resolve(oe.__await).then(function(ye){w("next",ye,M,P)},function(ye){w("throw",ye,M,P)}):v.resolve(oe).then(function(ye){ie.value=ye,M(ie)},function(ye){return w("throw",ye,M,P)})}P(N.arg)}var O;i(this,"_invoke",{value:function(R,M){function P(){return new v(function(N,ie){w(R,M,N,ie)})}return O=O?O.then(P,P):P()}})}function I(E,v,w){var O=h;return function(j,R){if(O===m)throw Error("Generator is already running");if(O===b){if(j==="throw")throw R;return{value:t,done:!0}}for(w.method=j,w.arg=R;;){var M=w.delegate;if(M){var P=$(M,w);if(P){if(P===D)continue;return P}}if(w.method==="next")w.sent=w._sent=w.arg;else if(w.method==="throw"){if(O===h)throw O=b,w.arg;w.dispatchException(w.arg)}else w.method==="return"&&w.abrupt("return",w.arg);O=m;var N=f(E,v,w);if(N.type==="normal"){if(O=w.done?b:d,N.arg===D)continue;return{value:N.arg,done:w.done}}N.type==="throw"&&(O=b,w.method="throw",w.arg=N.arg)}}}function $(E,v){var w=v.method,O=E.iterator[w];if(O===t)return v.delegate=null,w==="throw"&&E.iterator.return&&(v.method="return",v.arg=t,$(E,v),v.method==="throw")||w!=="return"&&(v.method="throw",v.arg=new TypeError("The iterator does not provide a '"+w+"' method")),D;var j=f(O,E.iterator,v.arg);if(j.type==="throw")return v.method="throw",v.arg=j.arg,v.delegate=null,D;var R=j.arg;return R?R.done?(v[E.resultName]=R.value,v.next=E.nextLoc,v.method!=="return"&&(v.method="next",v.arg=t),v.delegate=null,D):R:(v.method="throw",v.arg=new TypeError("iterator result is not an object"),v.delegate=null,D)}function B(E){var v={tryLoc:E[0]};1 in E&&(v.catchLoc=E[1]),2 in E&&(v.finallyLoc=E[2],v.afterLoc=E[3]),this.tryEntries.push(v)}function q(E){var v=E.completion||{};v.type="normal",delete v.arg,E.completion=v}function K(E){this.tryEntries=[{tryLoc:"root"}],E.forEach(B,this),this.reset(!0)}function V(E){if(E||E===""){var v=E[s];if(v)return v.call(E);if(typeof E.next=="function")return E;if(!isNaN(E.length)){var w=-1,O=function j(){for(;++w<E.length;)if(n.call(E,w))return j.value=E[w],j.done=!1,j;return j.value=t,j.done=!0,j};return O.next=O}}throw new TypeError(Ri(E)+" is not iterable")}return F.prototype=g,i(x,"constructor",{value:g,configurable:!0}),i(g,"constructor",{value:F,configurable:!0}),F.displayName=l(g,u,"GeneratorFunction"),e.isGeneratorFunction=function(E){var v=typeof E=="function"&&E.constructor;return!!v&&(v===F||(v.displayName||v.name)==="GeneratorFunction")},e.mark=function(E){return Object.setPrototypeOf?Object.setPrototypeOf(E,g):(E.__proto__=g,l(E,u,"GeneratorFunction")),E.prototype=Object.create(x),E},e.awrap=function(E){return{__await:E}},L(S.prototype),l(S.prototype,a,function(){return this}),e.AsyncIterator=S,e.async=function(E,v,w,O,j){j===void 0&&(j=Promise);var R=new S(c(E,v,w,O),j);return e.isGeneratorFunction(v)?R:R.next().then(function(M){return M.done?M.value:R.next()})},L(x),l(x,u,"Generator"),l(x,s,function(){return this}),l(x,"toString",function(){return"[object Generator]"}),e.keys=function(E){var v=Object(E),w=[];for(var O in v)w.push(O);return w.reverse(),function j(){for(;w.length;){var R=w.pop();if(R in v)return j.value=R,j.done=!1,j}return j.done=!0,j}},e.values=V,K.prototype={constructor:K,reset:function(v){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(q),!v)for(var w in this)w.charAt(0)==="t"&&n.call(this,w)&&!isNaN(+w.slice(1))&&(this[w]=t)},stop:function(){this.done=!0;var v=this.tryEntries[0].completion;if(v.type==="throw")throw v.arg;return this.rval},dispatchException:function(v){if(this.done)throw v;var w=this;function O(ie,oe){return M.type="throw",M.arg=v,w.next=ie,oe&&(w.method="next",w.arg=t),!!oe}for(var j=this.tryEntries.length-1;j>=0;--j){var R=this.tryEntries[j],M=R.completion;if(R.tryLoc==="root")return O("end");if(R.tryLoc<=this.prev){var P=n.call(R,"catchLoc"),N=n.call(R,"finallyLoc");if(P&&N){if(this.prev<R.catchLoc)return O(R.catchLoc,!0);if(this.prev<R.finallyLoc)return O(R.finallyLoc)}else if(P){if(this.prev<R.catchLoc)return O(R.catchLoc,!0)}else{if(!N)throw Error("try statement without catch or finally");if(this.prev<R.finallyLoc)return O(R.finallyLoc)}}}},abrupt:function(v,w){for(var O=this.tryEntries.length-1;O>=0;--O){var j=this.tryEntries[O];if(j.tryLoc<=this.prev&&n.call(j,"finallyLoc")&&this.prev<j.finallyLoc){var R=j;break}}R&&(v==="break"||v==="continue")&&R.tryLoc<=w&&w<=R.finallyLoc&&(R=null);var M=R?R.completion:{};return M.type=v,M.arg=w,R?(this.method="next",this.next=R.finallyLoc,D):this.complete(M)},complete:function(v,w){if(v.type==="throw")throw v.arg;return v.type==="break"||v.type==="continue"?this.next=v.arg:v.type==="return"?(this.rval=this.arg=v.arg,this.method="return",this.next="end"):v.type==="normal"&&w&&(this.next=w),D},finish:function(v){for(var w=this.tryEntries.length-1;w>=0;--w){var O=this.tryEntries[w];if(O.finallyLoc===v)return this.complete(O.completion,O.afterLoc),q(O),D}},catch:function(v){for(var w=this.tryEntries.length-1;w>=0;--w){var O=this.tryEntries[w];if(O.tryLoc===v){var j=O.completion;if(j.type==="throw"){var R=j.arg;q(O)}return R}}throw Error("illegal catch attempt")},delegateYield:function(v,w,O){return this.delegate={iterator:V(v),resultName:w,nextLoc:O},this.method==="next"&&(this.arg=t),D}},e}function DU(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function OS(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,bU(n.key),n)}}function vU(t,e,r){return e&&OS(t.prototype,e),r&&OS(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function bU(t){var e=wU(t,"string");return Ri(e)=="symbol"?e:e+""}function wU(t,e){if(Ri(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Ri(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function AS(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(l){r(l);return}a.done?e(u):Promise.resolve(u).then(n,i)}function _U(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function s(u){AS(o,n,i,s,a,"next",u)}function a(u){AS(o,n,i,s,a,"throw",u)}s(void 0)})}}function EU(t){return Ig.apply(this,arguments)}function Ig(){return Ig=_U($g().mark(function t(e){var r,n,i,o,s,a,u;return $g().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return n=e.path.toString(),c.next=3,kS.promises.stat(n);case 3:return i=c.sent,o=i.size,s=(r=e.start)!==null&&r!==void 0?r:0,a=Number.isFinite(e.end)?e.end+1:o,u=a-s,c.abrupt("return",new CU(e,n,u));case 9:case"end":return c.stop()}},t)})),Ig.apply(this,arguments)}var CU=function(){function t(e,r,n){DU(this,t),this._stream=e,this._path=r,this.size=n}return vU(t,[{key:"slice",value:function(r,n){var i,o=(i=this._stream.start)!==null&&i!==void 0?i:0,s=(0,kS.createReadStream)(this._path,{start:o+r,end:o+n-1,autoClose:!0});s.size=Math.min(n-r,this.size);var a=s.size>=this.size;return Promise.resolve({value:s,done:a})}},{key:"close",value:function(){this._stream.destroy()}}])}()});var Lg=y(nf=>{"use strict";Object.defineProperty(nf,"__esModule",{value:!0});nf.default=void 0;function $i(t){"@babel/helpers - typeof";return $i=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},$i(t)}function wu(){"use strict";wu=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(E,v,w){E[v]=w.value},o=typeof Symbol=="function"?Symbol:{},s=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function l(E,v,w){return Object.defineProperty(E,v,{value:w,enumerable:!0,configurable:!0,writable:!0}),E[v]}try{l({},"")}catch{l=function(w,O,j){return w[O]=j}}function c(E,v,w,O){var j=v&&v.prototype instanceof _?v:_,R=Object.create(j.prototype),M=new K(O||[]);return i(R,"_invoke",{value:I(E,w,M)}),R}function f(E,v,w){try{return{type:"normal",arg:E.call(v,w)}}catch(O){return{type:"throw",arg:O}}}e.wrap=c;var h="suspendedStart",d="suspendedYield",m="executing",b="completed",D={};function _(){}function F(){}function g(){}var C={};l(C,s,function(){return this});var A=Object.getPrototypeOf,T=A&&A(A(V([])));T&&T!==r&&n.call(T,s)&&(C=T);var x=g.prototype=_.prototype=Object.create(C);function L(E){["next","throw","return"].forEach(function(v){l(E,v,function(w){return this._invoke(v,w)})})}function S(E,v){function w(j,R,M,P){var N=f(E[j],E,R);if(N.type!=="throw"){var ie=N.arg,oe=ie.value;return oe&&$i(oe)=="object"&&n.call(oe,"__await")?v.resolve(oe.__await).then(function(ye){w("next",ye,M,P)},function(ye){w("throw",ye,M,P)}):v.resolve(oe).then(function(ye){ie.value=ye,M(ie)},function(ye){return w("throw",ye,M,P)})}P(N.arg)}var O;i(this,"_invoke",{value:function(R,M){function P(){return new v(function(N,ie){w(R,M,N,ie)})}return O=O?O.then(P,P):P()}})}function I(E,v,w){var O=h;return function(j,R){if(O===m)throw Error("Generator is already running");if(O===b){if(j==="throw")throw R;return{value:t,done:!0}}for(w.method=j,w.arg=R;;){var M=w.delegate;if(M){var P=$(M,w);if(P){if(P===D)continue;return P}}if(w.method==="next")w.sent=w._sent=w.arg;else if(w.method==="throw"){if(O===h)throw O=b,w.arg;w.dispatchException(w.arg)}else w.method==="return"&&w.abrupt("return",w.arg);O=m;var N=f(E,v,w);if(N.type==="normal"){if(O=w.done?b:d,N.arg===D)continue;return{value:N.arg,done:w.done}}N.type==="throw"&&(O=b,w.method="throw",w.arg=N.arg)}}}function $(E,v){var w=v.method,O=E.iterator[w];if(O===t)return v.delegate=null,w==="throw"&&E.iterator.return&&(v.method="return",v.arg=t,$(E,v),v.method==="throw")||w!=="return"&&(v.method="throw",v.arg=new TypeError("The iterator does not provide a '"+w+"' method")),D;var j=f(O,E.iterator,v.arg);if(j.type==="throw")return v.method="throw",v.arg=j.arg,v.delegate=null,D;var R=j.arg;return R?R.done?(v[E.resultName]=R.value,v.next=E.nextLoc,v.method!=="return"&&(v.method="next",v.arg=t),v.delegate=null,D):R:(v.method="throw",v.arg=new TypeError("iterator result is not an object"),v.delegate=null,D)}function B(E){var v={tryLoc:E[0]};1 in E&&(v.catchLoc=E[1]),2 in E&&(v.finallyLoc=E[2],v.afterLoc=E[3]),this.tryEntries.push(v)}function q(E){var v=E.completion||{};v.type="normal",delete v.arg,E.completion=v}function K(E){this.tryEntries=[{tryLoc:"root"}],E.forEach(B,this),this.reset(!0)}function V(E){if(E||E===""){var v=E[s];if(v)return v.call(E);if(typeof E.next=="function")return E;if(!isNaN(E.length)){var w=-1,O=function j(){for(;++w<E.length;)if(n.call(E,w))return j.value=E[w],j.done=!1,j;return j.value=t,j.done=!0,j};return O.next=O}}throw new TypeError($i(E)+" is not iterable")}return F.prototype=g,i(x,"constructor",{value:g,configurable:!0}),i(g,"constructor",{value:F,configurable:!0}),F.displayName=l(g,u,"GeneratorFunction"),e.isGeneratorFunction=function(E){var v=typeof E=="function"&&E.constructor;return!!v&&(v===F||(v.displayName||v.name)==="GeneratorFunction")},e.mark=function(E){return Object.setPrototypeOf?Object.setPrototypeOf(E,g):(E.__proto__=g,l(E,u,"GeneratorFunction")),E.prototype=Object.create(x),E},e.awrap=function(E){return{__await:E}},L(S.prototype),l(S.prototype,a,function(){return this}),e.AsyncIterator=S,e.async=function(E,v,w,O,j){j===void 0&&(j=Promise);var R=new S(c(E,v,w,O),j);return e.isGeneratorFunction(v)?R:R.next().then(function(M){return M.done?M.value:R.next()})},L(x),l(x,u,"Generator"),l(x,s,function(){return this}),l(x,"toString",function(){return"[object Generator]"}),e.keys=function(E){var v=Object(E),w=[];for(var O in v)w.push(O);return w.reverse(),function j(){for(;w.length;){var R=w.pop();if(R in v)return j.value=R,j.done=!1,j}return j.done=!0,j}},e.values=V,K.prototype={constructor:K,reset:function(v){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(q),!v)for(var w in this)w.charAt(0)==="t"&&n.call(this,w)&&!isNaN(+w.slice(1))&&(this[w]=t)},stop:function(){this.done=!0;var v=this.tryEntries[0].completion;if(v.type==="throw")throw v.arg;return this.rval},dispatchException:function(v){if(this.done)throw v;var w=this;function O(ie,oe){return M.type="throw",M.arg=v,w.next=ie,oe&&(w.method="next",w.arg=t),!!oe}for(var j=this.tryEntries.length-1;j>=0;--j){var R=this.tryEntries[j],M=R.completion;if(R.tryLoc==="root")return O("end");if(R.tryLoc<=this.prev){var P=n.call(R,"catchLoc"),N=n.call(R,"finallyLoc");if(P&&N){if(this.prev<R.catchLoc)return O(R.catchLoc,!0);if(this.prev<R.finallyLoc)return O(R.finallyLoc)}else if(P){if(this.prev<R.catchLoc)return O(R.catchLoc,!0)}else{if(!N)throw Error("try statement without catch or finally");if(this.prev<R.finallyLoc)return O(R.finallyLoc)}}}},abrupt:function(v,w){for(var O=this.tryEntries.length-1;O>=0;--O){var j=this.tryEntries[O];if(j.tryLoc<=this.prev&&n.call(j,"finallyLoc")&&this.prev<j.finallyLoc){var R=j;break}}R&&(v==="break"||v==="continue")&&R.tryLoc<=w&&w<=R.finallyLoc&&(R=null);var M=R?R.completion:{};return M.type=v,M.arg=w,R?(this.method="next",this.next=R.finallyLoc,D):this.complete(M)},complete:function(v,w){if(v.type==="throw")throw v.arg;return v.type==="break"||v.type==="continue"?this.next=v.arg:v.type==="return"?(this.rval=this.arg=v.arg,this.method="return",this.next="end"):v.type==="normal"&&w&&(this.next=w),D},finish:function(v){for(var w=this.tryEntries.length-1;w>=0;--w){var O=this.tryEntries[w];if(O.finallyLoc===v)return this.complete(O.completion,O.afterLoc),q(O),D}},catch:function(v){for(var w=this.tryEntries.length-1;w>=0;--w){var O=this.tryEntries[w];if(O.tryLoc===v){var j=O.completion;if(j.type==="throw"){var R=j.arg;q(O)}return R}}throw Error("illegal catch attempt")},delegateYield:function(v,w,O){return this.delegate={iterator:V(v),resultName:w,nextLoc:O},this.method==="next"&&(this.arg=t),D}},e}function SU(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function PS(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,FU(n.key),n)}}function xU(t,e,r){return e&&PS(t.prototype,e),r&&PS(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function FU(t){var e=OU(t,"string");return $i(e)=="symbol"?e:e+""}function OU(t,e){if($i(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if($i(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function RS(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(l){r(l);return}a.done?e(u):Promise.resolve(u).then(n,i)}function $S(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function s(u){RS(o,n,i,s,a,"next",u)}function a(u){RS(o,n,i,s,a,"throw",u)}s(void 0)})}}function AU(t,e){return Ng.apply(this,arguments)}function Ng(){return Ng=$S(wu().mark(function t(e,r){return wu().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return i.abrupt("return",new Promise(function(o,s){var a=function(c){e.off("readable",u),s(c)},u=function l(){var c=e.read(r);c!==null&&(e.off("error",a),e.off("readable",l),o(c))};e.once("error",a),e.on("readable",u)}));case 1:case"end":return i.stop()}},t)})),Ng.apply(this,arguments)}var Ele=nf.default=function(){function t(e){var r=this;SU(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 xU(t,[{key:"slice",value:function(){var e=$S(wu().mark(function n(i,o){var s,a,u,l,c;return wu().wrap(function(h){for(;;)switch(h.prev=h.next){case 0:if(!(i<this._bufPos)){h.next=2;break}throw new Error("cannot slice from position which we already seeked away");case 2:if(!(i>this._bufPos+this._buf.length)){h.next=4;break}throw new Error("slice start is outside of buffer (currently not implemented)");case 4:if(!this._error){h.next=6;break}throw this._error;case 6:if(i<this._bufPos+this._buf.length?(a=i-this._bufPos,u=Math.min(this._buf.length,o-this._bufPos),s=this._buf.slice(a,u)):s=Buffer.alloc(0),!this._ended){h.next=10;break}return s.size=s.length,h.abrupt("return",{value:s,done:!0});case 10:if(l=o-i,!(l>s.length)){h.next=16;break}return h.next=14,AU(this._stream,l-s.length);case 14:c=h.sent,s=Buffer.concat([s,c]);case 16:return this._buf=s,this._bufPos=i,s.size=s.length,h.abrupt("return",{value:s,done:this._ended});case 20:case"end":return h.stop()}},n,this)}));function r(n,i){return e.apply(this,arguments)}return r}()},{key:"close",value:function(){this._stream.destroy()}}])}()});var jS=y(sf=>{"use strict";Object.defineProperty(sf,"__esModule",{value:!0});sf.default=void 0;var kU=require("fs"),TU=of(SS()),PU=of(FS()),RU=of(TS()),$U=of(Lg());function of(t){return t&&t.__esModule?t:{default:t}}function _u(t){"@babel/helpers - typeof";return _u=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},_u(t)}function IU(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function IS(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,NU(n.key),n)}}function jU(t,e,r){return e&&IS(t.prototype,e),r&&IS(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function NU(t){var e=LU(t,"string");return _u(e)=="symbol"?e:e+""}function LU(t,e){if(_u(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(_u(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Sle=sf.default=function(){function t(){IU(this,t)}return jU(t,[{key:"openFile",value:function(r,n){return Buffer.isBuffer(r)?Promise.resolve(new PU.default(r)):r instanceof kU.ReadStream&&r.path!=null?(0,RU.default)(r):TU.default.readable(r)?(n=Number(n),Number.isFinite(n)?Promise.resolve(new $U.default(r)):Promise.reject(new Error("cannot create source for stream without a finite value for the `chunkSize` option; specify a chunkSize to control the memory consumption"))):Promise.reject(new Error("source object may only be an instance of Buffer or Readable in this environment"))}}])}()});var qS=y(Bg=>{"use strict";Object.defineProperty(Bg,"__esModule",{value:!0});Bg.default=MU;var BU=require("crypto"),NS=BS(require("fs")),qU=BS(require("path"));function LS(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,r=new WeakMap;return(LS=function(n){return n?r:e})(t)}function BS(t,e){if(!e&&t&&t.__esModule)return t;if(t===null||typeof t!="object"&&typeof t!="function")return{default:t};var r=LS(e);if(r&&r.has(t))return r.get(t);var n={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in t)if(o!=="default"&&{}.hasOwnProperty.call(t,o)){var s=i?Object.getOwnPropertyDescriptor(t,o):null;s&&(s.get||s.set)?Object.defineProperty(n,o,s):n[o]=t[o]}return n.default=t,r&&r.set(t,n),n}function MU(t,e){if(Buffer.isBuffer(t)){var r=65536,n=t.slice(0,Math.min(r,t.length)),i=(0,BU.createHash)("md5").update(n).digest("hex"),o=["node-buffer",i,t.length,e.endpoint].join("-");return Promise.resolve(o)}return t instanceof NS.ReadStream&&t.path!=null?new Promise(function(s,a){var u=qU.resolve(t.path);NS.stat(t.path,function(l,c){if(l){a(l);return}var f=["node-file",u,c.size,c.mtime.getTime(),e.endpoint].join("-");s(f)})}):Promise.resolve(null)}});var zS=y((Ole,VS)=>{var HS="Expected a function",MS=NaN,UU="[object Symbol]",HU=/^\s+|\s+$/g,VU=/^[-+]0x[0-9a-f]+$/i,zU=/^0b[01]+$/i,GU=/^0o[0-7]+$/i,WU=parseInt,KU=typeof global=="object"&&global&&global.Object===Object&&global,YU=typeof self=="object"&&self&&self.Object===Object&&self,JU=KU||YU||Function("return this")(),XU=Object.prototype,ZU=XU.toString,QU=Math.max,e9=Math.min,qg=function(){return JU.Date.now()};function t9(t,e,r){var n,i,o,s,a,u,l=0,c=!1,f=!1,h=!0;if(typeof t!="function")throw new TypeError(HS);e=US(e)||0,af(r)&&(c=!!r.leading,f="maxWait"in r,o=f?QU(US(r.maxWait)||0,e):o,h="trailing"in r?!!r.trailing:h);function d(T){var x=n,L=i;return n=i=void 0,l=T,s=t.apply(L,x),s}function m(T){return l=T,a=setTimeout(_,e),c?d(T):s}function b(T){var x=T-u,L=T-l,S=e-x;return f?e9(S,o-L):S}function D(T){var x=T-u,L=T-l;return u===void 0||x>=e||x<0||f&&L>=o}function _(){var T=qg();if(D(T))return F(T);a=setTimeout(_,b(T))}function F(T){return a=void 0,h&&n?d(T):(n=i=void 0,s)}function g(){a!==void 0&&clearTimeout(a),l=0,n=u=i=a=void 0}function C(){return a===void 0?s:F(qg())}function A(){var T=qg(),x=D(T);if(n=arguments,i=this,u=T,x){if(a===void 0)return m(u);if(f)return a=setTimeout(_,e),d(u)}return a===void 0&&(a=setTimeout(_,e)),s}return A.cancel=g,A.flush=C,A}function r9(t,e,r){var n=!0,i=!0;if(typeof t!="function")throw new TypeError(HS);return af(r)&&(n="leading"in r?!!r.leading:n,i="trailing"in r?!!r.trailing:i),t9(t,e,{leading:n,maxWait:e,trailing:i})}function af(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function n9(t){return!!t&&typeof t=="object"}function i9(t){return typeof t=="symbol"||n9(t)&&ZU.call(t)==UU}function US(t){if(typeof t=="number")return t;if(i9(t))return MS;if(af(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=af(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=t.replace(HU,"");var r=zU.test(t);return r||GU.test(t)?WU(t.slice(2),r?2:8):VU.test(t)?MS:+t}VS.exports=r9});var e1=y(ff=>{"use strict";Object.defineProperty(ff,"__esModule",{value:!0});ff.default=void 0;var o9=XS(require("http")),s9=XS(require("https")),KS=require("stream"),a9=require("url"),YS=u9(zS());function u9(t){return t&&t.__esModule?t:{default:t}}function JS(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,r=new WeakMap;return(JS=function(n){return n?r:e})(t)}function XS(t,e){if(!e&&t&&t.__esModule)return t;if(t===null||typeof t!="object"&&typeof t!="function")return{default:t};var r=JS(e);if(r&&r.has(t))return r.get(t);var n={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in t)if(o!=="default"&&{}.hasOwnProperty.call(t,o)){var s=i?Object.getOwnPropertyDescriptor(t,o):null;s&&(s.get||s.set)?Object.defineProperty(n,o,s):n[o]=t[o]}return n.default=t,r&&r.set(t,n),n}function l9(t,e,r){return e=uf(e),c9(t,ZS()?Reflect.construct(e,r||[],uf(t).constructor):e.apply(t,r))}function c9(t,e){if(e&&(ls(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return f9(t)}function f9(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function ZS(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(ZS=function(){return!!t})()}function uf(t){return uf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},uf(t)}function d9(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&&Mg(t,e)}function Mg(t,e){return Mg=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Mg(t,e)}function GS(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Eu(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?GS(Object(r),!0).forEach(function(n){h9(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):GS(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function h9(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 ls(t){"@babel/helpers - typeof";return ls=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},ls(t)}function lf(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function WS(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,QS(n.key),n)}}function cf(t,e,r){return e&&WS(t.prototype,e),r&&WS(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function QS(t){var e=p9(t,"string");return ls(e)=="symbol"?e:e+""}function p9(t,e){if(ls(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(ls(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Ale=ff.default=function(){function t(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};lf(this,t),this._requestOptions=e}return cf(t,[{key:"createRequest",value:function(r,n){return new m9(r,n,this._requestOptions)}},{key:"getName",value:function(){return"NodeHttpStack"}}])}(),m9=function(){function t(e,r,n){lf(this,t),this._method=e,this._url=r,this._headers={},this._request=null,this._progressHandler=function(){},this._requestOptions=n||{}}return cf(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=Eu(Eu(Eu({},(0,a9.parse)(r._url)),r._requestOptions),{},{method:r._method,headers:Eu(Eu({},r._requestOptions.headers||{}),r._headers)});n!=null&&n.size&&(s.headers["Content-Length"]=n.size);var a=s.protocol==="https:"?s9:o9;r._request=a.request(s);var u=r._request;u.on("response",function(l){var c=[];l.on("data",function(f){c.push(f)}),l.on("end",function(){var f=Buffer.concat(c).toString("utf8");i(new g9(l,f))})}),u.on("error",function(l){o(l)}),n instanceof KS.Readable?n.pipe(new y9(r._progressHandler)).pipe(u):n instanceof Uint8Array?D9(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}}])}(),g9=function(){function t(e,r){lf(this,t),this._response=e,this._body=r}return cf(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}}])}(),y9=function(t){function e(r){var n;return lf(this,e),n=l9(this,e),n._onprogress=(0,YS.default)(r,100,{leading:!0,trailing:!1}),n._position=0,n}return d9(e,t),cf(e,[{key:"_transform",value:function(n,i,o){this._position+=n.length,this._onprogress(this._position),o(null,n)}}])}(KS.Transform),D9=function(e,r,n){n=(0,YS.default)(n,100,{leading:!0,trailing:!1});var i=0;function o(){var s=Math.min(e.writableHighWaterMark,r.length-i),a=r.subarray(i,i+s);i+=a.length;var u=e.write(a);u?i<r.length?o():e.end():(e.once("drain",o),n(i))}o()}});var t1=y(Ug=>{"use strict";Ug.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};Ug.root=function(t,e,r){var n=this,i,o={stackLength:Error.stackTraceLimit,rootOnly:!0},s="",a=Error.stackTraceLimit,u;function l(){u[0]=n.toString(),n.stack=u.join(`
30
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,s=!1,a;return{s:function(){r=r.call(t)},n:function(){var l=r.next();return o=l.done,l},e:function(l){s=!0,a=l},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(s)throw a}}}}function vS(t,e){if(t){if(typeof t=="string")return cS(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return cS(t,e)}}function cS(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function fS(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function as(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?fS(Object(r),!0).forEach(function(n){aU(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):fS(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function aU(t,e,r){return e=bS(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function uU(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function dS(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,bS(n.key),n)}}function lU(t,e,r){return e&&dS(t.prototype,e),r&&dS(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function bS(t){var e=cU(t,"string");return Pi(e)=="symbol"?e:e+""}function cU(t,e){if(Pi(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Pi(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Qc="tus-v1",ef="ietf-draft-03",vu="ietf-draft-05",fU={endpoint:null,uploadUrl:null,metadata:{},metadataForPartialUploads:{},fingerprint:null,uploadSize:null,onProgress:null,onChunkComplete:null,onSuccess:null,onError:null,onUploadUrlAvailable:null,overridePatchMethod:!1,headers:{},addRequestId:!1,onBeforeRequest:null,onAfterResponse:null,onShouldRetry:_S,chunkSize:Number.POSITIVE_INFINITY,retryDelays:[0,1e3,3e3,5e3],parallelUploads:1,parallelUploadBoundaries:null,storeFingerprintForResuming:!0,removeFingerprintOnSuccess:!1,uploadLengthDeferred:!1,uploadDataDuringCreation:!1,urlStorage:null,fileReader:null,httpStack:null,protocol:Qc},wS=function(){function t(e,r){uU(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 lU(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(![Qc,ef,vu].includes(this.options.protocol)){this._emitError(new Error("tus: unsupported protocol ".concat(this.options.protocol)));return}if(!this.options.endpoint&&!this.options.uploadUrl&&!this.url){this._emitError(new Error("tus: neither an endpoint or an upload URL is provided"));return}var i=this.options.retryDelays;if(i!=null&&Object.prototype.toString.call(i)!=="[object Array]"){this._emitError(new Error("tus: the `retryDelays` option must either be an array or null"));return}if(this.options.parallelUploads>1)for(var o=0,s=["uploadUrl","uploadSize","uploadLengthDeferred"];o<s.length;o++){var a=s[o];if(this.options[a]){this._emitError(new Error("tus: cannot use the ".concat(a," option when parallelUploads is enabled")));return}}if(this.options.parallelUploadBoundaries){if(this.options.parallelUploads<=1){this._emitError(new Error("tus: cannot use the `parallelUploadBoundaries` option when `parallelUploads` is disabled"));return}if(this.options.parallelUploads!==this.options.parallelUploadBoundaries.length){this._emitError(new Error("tus: the `parallelUploadBoundaries` must have the same length as the value of `parallelUploads`"));return}}this.options.fingerprint(n,this.options).then(function(u){return u==null?(0,Ti.log)("No fingerprint was calculated meaning that the upload cannot be stored in the URL storage."):(0,Ti.log)("Calculated fingerprint: ".concat(u)),r._fingerprint=u,r._source?r._source:r.options.fileReader.openFile(n,r.options.chunkSize)}).then(function(u){if(r._source=u,r.options.uploadLengthDeferred)r._size=null;else if(r.options.uploadSize!=null){if(r._size=Number(r.options.uploadSize),Number.isNaN(r._size)){r._emitError(new Error("tus: cannot convert `uploadSize` option into a number"));return}}else if(r._size=r._source.size,r._size==null){r._emitError(new Error("tus: cannot automatically derive upload's size from input. Specify it manually using the `uploadSize` option or use the `uploadLengthDeferred` option"));return}r.options.parallelUploads>1||r._parallelUploadUrls!=null?r._startParallelUpload():r._startSingleUpload()}).catch(function(u){r._emitError(u)})}},{key:"_startParallelUpload",value:function(){var r,n=this,i=this._size,o=0;this._parallelUploads=[];var s=this._parallelUploadUrls!=null?this._parallelUploadUrls.length:this.options.parallelUploads,a=(r=this.options.parallelUploadBoundaries)!==null&&r!==void 0?r:hU(this._source.size,s);this._parallelUploadUrls&&a.forEach(function(c,f){c.uploadUrl=n._parallelUploadUrls[f]||null}),this._parallelUploadUrls=new Array(a.length);var u=a.map(function(c,f){var h=0;return n._source.slice(c.start,c.end).then(function(d){var m=d.value;return new Promise(function(b,y){var E=as(as({},n.options),{},{uploadUrl:c.uploadUrl||null,storeFingerprintForResuming:!1,removeFingerprintOnSuccess:!1,parallelUploads:1,parallelUploadBoundaries:null,metadata:n.options.metadataForPartialUploads,headers:as(as({},n.options.headers),{},{"Upload-Concat":"partial"}),onSuccess:b,onError:y,onProgress:function(C){o=o-h+C,h=C,n._emitProgress(o,i)},onUploadUrlAvailable:function(){n._parallelUploadUrls[f]=F.url,n._parallelUploadUrls.filter(function(C){return!!C}).length===a.length&&n._saveUploadInUrlStorage()}}),F=new t(m,E);F.start(),n._parallelUploads.push(F)})})}),l;Promise.all(u).then(function(){l=n._openRequest("POST",n.options.endpoint),l.setHeader("Upload-Concat","final;".concat(n._parallelUploadUrls.join(" ")));var c=hS(n.options.metadata);return c!==""&&l.setHeader("Upload-Metadata",c),n._sendRequest(l,null)}).then(function(c){if(!us(c.getStatus(),200)){n._emitHttpError(l,c,"tus: unexpected response while creating upload");return}var f=c.getHeader("Location");if(f==null){n._emitHttpError(l,c,"tus: invalid or missing Location header");return}n.url=yS(n.options.endpoint,f),(0,Ti.log)("Created upload at ".concat(n.url)),n._emitSuccess(c)}).catch(function(c){n._emitError(c)})}},{key:"_startSingleUpload",value:function(){if(this._aborted=!1,this.url!=null){(0,Ti.log)("Resuming upload from previous URL: ".concat(this.url)),this._resumeUpload();return}if(this.options.uploadUrl!=null){(0,Ti.log)("Resuming upload from provided URL: ".concat(this.options.uploadUrl)),this.url=this.options.uploadUrl,this._resumeUpload();return}(0,Ti.log)("Creating a new upload"),this._createUpload()}},{key:"abort",value:function(r){var n=this;if(this._parallelUploads!=null){var i=sU(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 Zc.default(i,o,r,n))}},{key:"_emitError",value:function(r){var n=this;if(!this._aborted){if(this.options.retryDelays!=null){var i=this._offset!=null&&this._offset>this._offsetBeforeRetry;if(i&&(this._retryAttempt=0),gS(r,this._retryAttempt,this.options)){var o=this.options.retryDelays[this._retryAttempt++];this._offsetBeforeRetry=this._offset,this._retryTimeout=setTimeout(function(){n.start()},o);return}}if(typeof this.options.onError=="function")this.options.onError(r);else throw r}}},{key:"_emitSuccess",value:function(r){this.options.removeFingerprintOnSuccess&&this._removeFromUrlStorage(),typeof this.options.onSuccess=="function"&&this.options.onSuccess({lastResponse:r})}},{key:"_emitProgress",value:function(r,n){typeof this.options.onProgress=="function"&&this.options.onProgress(r,n)}},{key:"_emitChunkComplete",value:function(r,n,i){typeof this.options.onChunkComplete=="function"&&this.options.onChunkComplete(r,n,i)}},{key:"_createUpload",value:function(){var r=this;if(!this.options.endpoint){this._emitError(new Error("tus: unable to create upload because no endpoint is provided"));return}var n=this._openRequest("POST",this.options.endpoint);this.options.uploadLengthDeferred?n.setHeader("Upload-Defer-Length","1"):n.setHeader("Upload-Length","".concat(this._size));var i=hS(this.options.metadata);i!==""&&n.setHeader("Upload-Metadata",i);var o;this.options.uploadDataDuringCreation&&!this.options.uploadLengthDeferred?(this._offset=0,o=this._addChunkToRequest(n)):((this.options.protocol===ef||this.options.protocol===vu)&&n.setHeader("Upload-Complete","?0"),o=this._sendRequest(n,null)),o.then(function(s){if(!us(s.getStatus(),200)){r._emitHttpError(n,s,"tus: unexpected response while creating upload");return}var a=s.getHeader("Location");if(a==null){r._emitHttpError(n,s,"tus: invalid or missing Location header");return}if(r.url=yS(r.options.endpoint,a),(0,Ti.log)("Created upload at ".concat(r.url)),typeof r.options.onUploadUrlAvailable=="function"&&r.options.onUploadUrlAvailable(),r._size===0){r._emitSuccess(s),r._source.close();return}r._saveUploadInUrlStorage().then(function(){r.options.uploadDataDuringCreation?r._handleUploadResponse(n,s):(r._offset=0,r._performUpload())})}).catch(function(s){r._emitHttpError(n,null,"tus: failed to create upload",s)})}},{key:"_resumeUpload",value:function(){var r=this,n=this._openRequest("HEAD",this.url),i=this._sendRequest(n,null);i.then(function(o){var s=o.getStatus();if(!us(s,200)){if(s===423){r._emitHttpError(n,o,"tus: upload is currently locked; retry later");return}if(us(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===Qc){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(!us(o.getStatus(),200)){r._emitHttpError(n,o,"tus: unexpected response while uploading chunk");return}r._handleUploadResponse(n,o)}).catch(function(o){r._aborted||r._emitHttpError(n,null,"tus: failed to upload chunk at offset ".concat(r._offset),o)})}}},{key:"_addChunkToRequest",value:function(r){var n=this,i=this._offset,o=this._offset+this.options.chunkSize;return r.setProgressHandler(function(s){n._emitProgress(i+s,n._size)}),this.options.protocol===Qc?r.setHeader("Content-Type","application/offset+octet-stream"):this.options.protocol===vu&&r.setHeader("Content-Type","application/partial-upload"),(o===Number.POSITIVE_INFINITY||o>this._size)&&!this.options.uploadLengthDeferred&&(o=this._size),this._source.slice(i,o).then(function(s){var a=s.value,u=s.done,l=a!=null&&a.size?a.size:0;n.options.uploadLengthDeferred&&u&&(n._size=n._offset+l,r.setHeader("Upload-Length","".concat(n._size)));var c=n._offset+l;return!n.options.uploadLengthDeferred&&u&&c!==n._size?Promise.reject(new Error("upload was configured with a size of ".concat(n._size," bytes, but the source is done after ").concat(c," bytes"))):a===null?n._sendRequest(r):((n.options.protocol===ef||n.options.protocol===vu)&&r.setHeader("Upload-Complete",u?"?1":"?0"),n._emitProgress(n._offset,n._size),n._sendRequest(r,a))})}},{key:"_handleUploadResponse",value:function(r,n){var i=Number.parseInt(n.getHeader("Upload-Offset"),10);if(Number.isNaN(i)){this._emitHttpError(r,n,"tus: invalid or missing offset value");return}if(this._emitProgress(i,this._size),this._emitChunkComplete(i-this._offset,i,this._size),this._offset=i,i===this._size){this._emitSuccess(n),this._source.close();return}this._performUpload()}},{key:"_openRequest",value:function(r,n){var i=pS(r,n,this.options);return this._req=i,i}},{key:"_removeFromUrlStorage",value:function(){var r=this;this._urlStorageKey&&(this._urlStorage.removeUpload(this._urlStorageKey).catch(function(n){r._emitError(n)}),this._urlStorageKey=null)}},{key:"_saveUploadInUrlStorage",value:function(){var r=this;if(!this.options.storeFingerprintForResuming||!this._fingerprint||this._urlStorageKey!==null)return Promise.resolve();var n={size:this._size,metadata:this.options.metadata,creationTime:new Date().toString()};return this._parallelUploads?n.parallelUploadUrls=this._parallelUploadUrls:n.uploadUrl=this.url,this._urlStorage.addUpload(this._fingerprint,n).then(function(i){r._urlStorageKey=i})}},{key:"_sendRequest",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return mS(r,n,this.options)}}],[{key:"terminate",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=pS("DELETE",r,n);return mS(i,null,n).then(function(o){if(o.getStatus()!==204)throw new Zc.default("tus: unexpected response while terminating upload",null,i,o)}).catch(function(o){if(o instanceof Zc.default||(o=new Zc.default("tus: failed to terminate upload",o,i,null)),!gS(o,0,n))throw o;var s=n.retryDelays[0],a=n.retryDelays.slice(1),u=as(as({},n),{},{retryDelays:a});return new Promise(function(l){return setTimeout(l,s)}).then(function(){return t.terminate(r,u)})})}}])}();function hS(t){return Object.entries(t).map(function(e){var r=DS(e,2),n=r[0],i=r[1];return"".concat(n," ").concat(Q5.Base64.encode(String(i)))}).join(",")}function us(t,e){return t>=e&&t<e+100}function pS(t,e,r){var n=r.httpStack.createRequest(t,e);r.protocol===ef?n.setHeader("Upload-Draft-Interop-Version","5"):r.protocol===vu?n.setHeader("Upload-Draft-Interop-Version","6"):n.setHeader("Tus-Resumable","1.0.0");for(var i=r.headers||{},o=0,s=Object.entries(i);o<s.length;o++){var a=DS(s[o],2),u=a[0],l=a[1];n.setHeader(u,l)}if(r.addRequestId){var c=(0,tU.default)();n.setHeader("X-Request-ID",c)}return n}function mS(t,e,r){return Pg.apply(this,arguments)}function Pg(){return Pg=rU(Tg().mark(function t(e,r,n){var i;return Tg().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)})),Pg.apply(this,arguments)}function dU(){var t=!0;return typeof navigator<"u"&&navigator.onLine===!1&&(t=!1),t}function gS(t,e,r){return r.retryDelays==null||e>=r.retryDelays.length||t.originalRequest==null?!1:r&&typeof r.onShouldRetry=="function"?r.onShouldRetry(t,e,r):_S(t)}function _S(t){var e=t.originalResponse?t.originalResponse.getStatus():0;return(!us(e,400)||e===409||e===423)&&dU()}function yS(t,e){return new eU.default(e,t).toString()}function hU(t,e){for(var r=Math.floor(t/e),n=[],i=0;i<e;i++)n.push({start:r*i,end:r*(i+1)});return n[e-1].end=t,n}wS.defaultOptions=fU;var yle=tf.default=wS});var SS=D((vle,CS)=>{"use strict";var Vr=t=>t!==null&&typeof t=="object"&&typeof t.pipe=="function";Vr.writable=t=>Vr(t)&&t.writable!==!1&&typeof t._write=="function"&&typeof t._writableState=="object";Vr.readable=t=>Vr(t)&&t.readable!==!1&&typeof t._read=="function"&&typeof t._readableState=="object";Vr.duplex=t=>Vr.writable(t)&&Vr.readable(t);Vr.transform=t=>Vr.duplex(t)&&typeof t._transform=="function";CS.exports=Vr});var FS=D(rf=>{"use strict";Object.defineProperty(rf,"__esModule",{value:!0});rf.default=void 0;function bu(t){"@babel/helpers - typeof";return bu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},bu(t)}function pU(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,gU(n.key),n)}}function mU(t,e,r){return e&&xS(t.prototype,e),r&&xS(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function gU(t){var e=yU(t,"string");return bu(e)=="symbol"?e:e+""}function yU(t,e){if(bu(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(bu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var ble=rf.default=function(){function t(e){pU(this,t),this._buffer=e,this.size=e.length}return mU(t,[{key:"slice",value:function(r,n){var i=this._buffer.slice(r,n);i.size=i.length;var o=n>=this.size;return Promise.resolve({value:i,done:o})}},{key:"close",value:function(){}}])}()});var TS=D(jg=>{"use strict";Object.defineProperty(jg,"__esModule",{value:!0});jg.default=EU;var kS=require("fs");function Ri(t){"@babel/helpers - typeof";return Ri=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ri(t)}function $g(){"use strict";$g=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(_,v,w){_[v]=w.value},o=typeof Symbol=="function"?Symbol:{},s=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function l(_,v,w){return Object.defineProperty(_,v,{value:w,enumerable:!0,configurable:!0,writable:!0}),_[v]}try{l({},"")}catch{l=function(w,O,j){return w[O]=j}}function c(_,v,w,O){var j=v&&v.prototype instanceof E?v:E,R=Object.create(j.prototype),M=new K(O||[]);return i(R,"_invoke",{value:I(_,w,M)}),R}function f(_,v,w){try{return{type:"normal",arg:_.call(v,w)}}catch(O){return{type:"throw",arg:O}}}e.wrap=c;var h="suspendedStart",d="suspendedYield",m="executing",b="completed",y={};function E(){}function F(){}function g(){}var C={};l(C,s,function(){return this});var A=Object.getPrototypeOf,T=A&&A(A(V([])));T&&T!==r&&n.call(T,s)&&(C=T);var x=g.prototype=E.prototype=Object.create(C);function L(_){["next","throw","return"].forEach(function(v){l(_,v,function(w){return this._invoke(v,w)})})}function S(_,v){function w(j,R,M,P){var N=f(_[j],_,R);if(N.type!=="throw"){var ie=N.arg,oe=ie.value;return oe&&Ri(oe)=="object"&&n.call(oe,"__await")?v.resolve(oe.__await).then(function(ye){w("next",ye,M,P)},function(ye){w("throw",ye,M,P)}):v.resolve(oe).then(function(ye){ie.value=ye,M(ie)},function(ye){return w("throw",ye,M,P)})}P(N.arg)}var O;i(this,"_invoke",{value:function(R,M){function P(){return new v(function(N,ie){w(R,M,N,ie)})}return O=O?O.then(P,P):P()}})}function I(_,v,w){var O=h;return function(j,R){if(O===m)throw Error("Generator is already running");if(O===b){if(j==="throw")throw R;return{value:t,done:!0}}for(w.method=j,w.arg=R;;){var M=w.delegate;if(M){var P=$(M,w);if(P){if(P===y)continue;return P}}if(w.method==="next")w.sent=w._sent=w.arg;else if(w.method==="throw"){if(O===h)throw O=b,w.arg;w.dispatchException(w.arg)}else w.method==="return"&&w.abrupt("return",w.arg);O=m;var N=f(_,v,w);if(N.type==="normal"){if(O=w.done?b:d,N.arg===y)continue;return{value:N.arg,done:w.done}}N.type==="throw"&&(O=b,w.method="throw",w.arg=N.arg)}}}function $(_,v){var w=v.method,O=_.iterator[w];if(O===t)return v.delegate=null,w==="throw"&&_.iterator.return&&(v.method="return",v.arg=t,$(_,v),v.method==="throw")||w!=="return"&&(v.method="throw",v.arg=new TypeError("The iterator does not provide a '"+w+"' method")),y;var j=f(O,_.iterator,v.arg);if(j.type==="throw")return v.method="throw",v.arg=j.arg,v.delegate=null,y;var R=j.arg;return R?R.done?(v[_.resultName]=R.value,v.next=_.nextLoc,v.method!=="return"&&(v.method="next",v.arg=t),v.delegate=null,y):R:(v.method="throw",v.arg=new TypeError("iterator result is not an object"),v.delegate=null,y)}function B(_){var v={tryLoc:_[0]};1 in _&&(v.catchLoc=_[1]),2 in _&&(v.finallyLoc=_[2],v.afterLoc=_[3]),this.tryEntries.push(v)}function q(_){var v=_.completion||{};v.type="normal",delete v.arg,_.completion=v}function K(_){this.tryEntries=[{tryLoc:"root"}],_.forEach(B,this),this.reset(!0)}function V(_){if(_||_===""){var v=_[s];if(v)return v.call(_);if(typeof _.next=="function")return _;if(!isNaN(_.length)){var w=-1,O=function j(){for(;++w<_.length;)if(n.call(_,w))return j.value=_[w],j.done=!1,j;return j.value=t,j.done=!0,j};return O.next=O}}throw new TypeError(Ri(_)+" is not iterable")}return F.prototype=g,i(x,"constructor",{value:g,configurable:!0}),i(g,"constructor",{value:F,configurable:!0}),F.displayName=l(g,u,"GeneratorFunction"),e.isGeneratorFunction=function(_){var v=typeof _=="function"&&_.constructor;return!!v&&(v===F||(v.displayName||v.name)==="GeneratorFunction")},e.mark=function(_){return Object.setPrototypeOf?Object.setPrototypeOf(_,g):(_.__proto__=g,l(_,u,"GeneratorFunction")),_.prototype=Object.create(x),_},e.awrap=function(_){return{__await:_}},L(S.prototype),l(S.prototype,a,function(){return this}),e.AsyncIterator=S,e.async=function(_,v,w,O,j){j===void 0&&(j=Promise);var R=new S(c(_,v,w,O),j);return e.isGeneratorFunction(v)?R:R.next().then(function(M){return M.done?M.value:R.next()})},L(x),l(x,u,"Generator"),l(x,s,function(){return this}),l(x,"toString",function(){return"[object Generator]"}),e.keys=function(_){var v=Object(_),w=[];for(var O in v)w.push(O);return w.reverse(),function j(){for(;w.length;){var R=w.pop();if(R in v)return j.value=R,j.done=!1,j}return j.done=!0,j}},e.values=V,K.prototype={constructor:K,reset:function(v){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(q),!v)for(var w in this)w.charAt(0)==="t"&&n.call(this,w)&&!isNaN(+w.slice(1))&&(this[w]=t)},stop:function(){this.done=!0;var v=this.tryEntries[0].completion;if(v.type==="throw")throw v.arg;return this.rval},dispatchException:function(v){if(this.done)throw v;var w=this;function O(ie,oe){return M.type="throw",M.arg=v,w.next=ie,oe&&(w.method="next",w.arg=t),!!oe}for(var j=this.tryEntries.length-1;j>=0;--j){var R=this.tryEntries[j],M=R.completion;if(R.tryLoc==="root")return O("end");if(R.tryLoc<=this.prev){var P=n.call(R,"catchLoc"),N=n.call(R,"finallyLoc");if(P&&N){if(this.prev<R.catchLoc)return O(R.catchLoc,!0);if(this.prev<R.finallyLoc)return O(R.finallyLoc)}else if(P){if(this.prev<R.catchLoc)return O(R.catchLoc,!0)}else{if(!N)throw Error("try statement without catch or finally");if(this.prev<R.finallyLoc)return O(R.finallyLoc)}}}},abrupt:function(v,w){for(var O=this.tryEntries.length-1;O>=0;--O){var j=this.tryEntries[O];if(j.tryLoc<=this.prev&&n.call(j,"finallyLoc")&&this.prev<j.finallyLoc){var R=j;break}}R&&(v==="break"||v==="continue")&&R.tryLoc<=w&&w<=R.finallyLoc&&(R=null);var M=R?R.completion:{};return M.type=v,M.arg=w,R?(this.method="next",this.next=R.finallyLoc,y):this.complete(M)},complete:function(v,w){if(v.type==="throw")throw v.arg;return v.type==="break"||v.type==="continue"?this.next=v.arg:v.type==="return"?(this.rval=this.arg=v.arg,this.method="return",this.next="end"):v.type==="normal"&&w&&(this.next=w),y},finish:function(v){for(var w=this.tryEntries.length-1;w>=0;--w){var O=this.tryEntries[w];if(O.finallyLoc===v)return this.complete(O.completion,O.afterLoc),q(O),y}},catch:function(v){for(var w=this.tryEntries.length-1;w>=0;--w){var O=this.tryEntries[w];if(O.tryLoc===v){var j=O.completion;if(j.type==="throw"){var R=j.arg;q(O)}return R}}throw Error("illegal catch attempt")},delegateYield:function(v,w,O){return this.delegate={iterator:V(v),resultName:w,nextLoc:O},this.method==="next"&&(this.arg=t),y}},e}function DU(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function OS(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,bU(n.key),n)}}function vU(t,e,r){return e&&OS(t.prototype,e),r&&OS(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function bU(t){var e=wU(t,"string");return Ri(e)=="symbol"?e:e+""}function wU(t,e){if(Ri(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Ri(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function AS(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(l){r(l);return}a.done?e(u):Promise.resolve(u).then(n,i)}function _U(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function s(u){AS(o,n,i,s,a,"next",u)}function a(u){AS(o,n,i,s,a,"throw",u)}s(void 0)})}}function EU(t){return Ig.apply(this,arguments)}function Ig(){return Ig=_U($g().mark(function t(e){var r,n,i,o,s,a,u;return $g().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return n=e.path.toString(),c.next=3,kS.promises.stat(n);case 3:return i=c.sent,o=i.size,s=(r=e.start)!==null&&r!==void 0?r:0,a=Number.isFinite(e.end)?e.end+1:o,u=a-s,c.abrupt("return",new CU(e,n,u));case 9:case"end":return c.stop()}},t)})),Ig.apply(this,arguments)}var CU=function(){function t(e,r,n){DU(this,t),this._stream=e,this._path=r,this.size=n}return vU(t,[{key:"slice",value:function(r,n){var i,o=(i=this._stream.start)!==null&&i!==void 0?i:0,s=(0,kS.createReadStream)(this._path,{start:o+r,end:o+n-1,autoClose:!0});s.size=Math.min(n-r,this.size);var a=s.size>=this.size;return Promise.resolve({value:s,done:a})}},{key:"close",value:function(){this._stream.destroy()}}])}()});var Lg=D(nf=>{"use strict";Object.defineProperty(nf,"__esModule",{value:!0});nf.default=void 0;function $i(t){"@babel/helpers - typeof";return $i=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},$i(t)}function wu(){"use strict";wu=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(_,v,w){_[v]=w.value},o=typeof Symbol=="function"?Symbol:{},s=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function l(_,v,w){return Object.defineProperty(_,v,{value:w,enumerable:!0,configurable:!0,writable:!0}),_[v]}try{l({},"")}catch{l=function(w,O,j){return w[O]=j}}function c(_,v,w,O){var j=v&&v.prototype instanceof E?v:E,R=Object.create(j.prototype),M=new K(O||[]);return i(R,"_invoke",{value:I(_,w,M)}),R}function f(_,v,w){try{return{type:"normal",arg:_.call(v,w)}}catch(O){return{type:"throw",arg:O}}}e.wrap=c;var h="suspendedStart",d="suspendedYield",m="executing",b="completed",y={};function E(){}function F(){}function g(){}var C={};l(C,s,function(){return this});var A=Object.getPrototypeOf,T=A&&A(A(V([])));T&&T!==r&&n.call(T,s)&&(C=T);var x=g.prototype=E.prototype=Object.create(C);function L(_){["next","throw","return"].forEach(function(v){l(_,v,function(w){return this._invoke(v,w)})})}function S(_,v){function w(j,R,M,P){var N=f(_[j],_,R);if(N.type!=="throw"){var ie=N.arg,oe=ie.value;return oe&&$i(oe)=="object"&&n.call(oe,"__await")?v.resolve(oe.__await).then(function(ye){w("next",ye,M,P)},function(ye){w("throw",ye,M,P)}):v.resolve(oe).then(function(ye){ie.value=ye,M(ie)},function(ye){return w("throw",ye,M,P)})}P(N.arg)}var O;i(this,"_invoke",{value:function(R,M){function P(){return new v(function(N,ie){w(R,M,N,ie)})}return O=O?O.then(P,P):P()}})}function I(_,v,w){var O=h;return function(j,R){if(O===m)throw Error("Generator is already running");if(O===b){if(j==="throw")throw R;return{value:t,done:!0}}for(w.method=j,w.arg=R;;){var M=w.delegate;if(M){var P=$(M,w);if(P){if(P===y)continue;return P}}if(w.method==="next")w.sent=w._sent=w.arg;else if(w.method==="throw"){if(O===h)throw O=b,w.arg;w.dispatchException(w.arg)}else w.method==="return"&&w.abrupt("return",w.arg);O=m;var N=f(_,v,w);if(N.type==="normal"){if(O=w.done?b:d,N.arg===y)continue;return{value:N.arg,done:w.done}}N.type==="throw"&&(O=b,w.method="throw",w.arg=N.arg)}}}function $(_,v){var w=v.method,O=_.iterator[w];if(O===t)return v.delegate=null,w==="throw"&&_.iterator.return&&(v.method="return",v.arg=t,$(_,v),v.method==="throw")||w!=="return"&&(v.method="throw",v.arg=new TypeError("The iterator does not provide a '"+w+"' method")),y;var j=f(O,_.iterator,v.arg);if(j.type==="throw")return v.method="throw",v.arg=j.arg,v.delegate=null,y;var R=j.arg;return R?R.done?(v[_.resultName]=R.value,v.next=_.nextLoc,v.method!=="return"&&(v.method="next",v.arg=t),v.delegate=null,y):R:(v.method="throw",v.arg=new TypeError("iterator result is not an object"),v.delegate=null,y)}function B(_){var v={tryLoc:_[0]};1 in _&&(v.catchLoc=_[1]),2 in _&&(v.finallyLoc=_[2],v.afterLoc=_[3]),this.tryEntries.push(v)}function q(_){var v=_.completion||{};v.type="normal",delete v.arg,_.completion=v}function K(_){this.tryEntries=[{tryLoc:"root"}],_.forEach(B,this),this.reset(!0)}function V(_){if(_||_===""){var v=_[s];if(v)return v.call(_);if(typeof _.next=="function")return _;if(!isNaN(_.length)){var w=-1,O=function j(){for(;++w<_.length;)if(n.call(_,w))return j.value=_[w],j.done=!1,j;return j.value=t,j.done=!0,j};return O.next=O}}throw new TypeError($i(_)+" is not iterable")}return F.prototype=g,i(x,"constructor",{value:g,configurable:!0}),i(g,"constructor",{value:F,configurable:!0}),F.displayName=l(g,u,"GeneratorFunction"),e.isGeneratorFunction=function(_){var v=typeof _=="function"&&_.constructor;return!!v&&(v===F||(v.displayName||v.name)==="GeneratorFunction")},e.mark=function(_){return Object.setPrototypeOf?Object.setPrototypeOf(_,g):(_.__proto__=g,l(_,u,"GeneratorFunction")),_.prototype=Object.create(x),_},e.awrap=function(_){return{__await:_}},L(S.prototype),l(S.prototype,a,function(){return this}),e.AsyncIterator=S,e.async=function(_,v,w,O,j){j===void 0&&(j=Promise);var R=new S(c(_,v,w,O),j);return e.isGeneratorFunction(v)?R:R.next().then(function(M){return M.done?M.value:R.next()})},L(x),l(x,u,"Generator"),l(x,s,function(){return this}),l(x,"toString",function(){return"[object Generator]"}),e.keys=function(_){var v=Object(_),w=[];for(var O in v)w.push(O);return w.reverse(),function j(){for(;w.length;){var R=w.pop();if(R in v)return j.value=R,j.done=!1,j}return j.done=!0,j}},e.values=V,K.prototype={constructor:K,reset:function(v){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(q),!v)for(var w in this)w.charAt(0)==="t"&&n.call(this,w)&&!isNaN(+w.slice(1))&&(this[w]=t)},stop:function(){this.done=!0;var v=this.tryEntries[0].completion;if(v.type==="throw")throw v.arg;return this.rval},dispatchException:function(v){if(this.done)throw v;var w=this;function O(ie,oe){return M.type="throw",M.arg=v,w.next=ie,oe&&(w.method="next",w.arg=t),!!oe}for(var j=this.tryEntries.length-1;j>=0;--j){var R=this.tryEntries[j],M=R.completion;if(R.tryLoc==="root")return O("end");if(R.tryLoc<=this.prev){var P=n.call(R,"catchLoc"),N=n.call(R,"finallyLoc");if(P&&N){if(this.prev<R.catchLoc)return O(R.catchLoc,!0);if(this.prev<R.finallyLoc)return O(R.finallyLoc)}else if(P){if(this.prev<R.catchLoc)return O(R.catchLoc,!0)}else{if(!N)throw Error("try statement without catch or finally");if(this.prev<R.finallyLoc)return O(R.finallyLoc)}}}},abrupt:function(v,w){for(var O=this.tryEntries.length-1;O>=0;--O){var j=this.tryEntries[O];if(j.tryLoc<=this.prev&&n.call(j,"finallyLoc")&&this.prev<j.finallyLoc){var R=j;break}}R&&(v==="break"||v==="continue")&&R.tryLoc<=w&&w<=R.finallyLoc&&(R=null);var M=R?R.completion:{};return M.type=v,M.arg=w,R?(this.method="next",this.next=R.finallyLoc,y):this.complete(M)},complete:function(v,w){if(v.type==="throw")throw v.arg;return v.type==="break"||v.type==="continue"?this.next=v.arg:v.type==="return"?(this.rval=this.arg=v.arg,this.method="return",this.next="end"):v.type==="normal"&&w&&(this.next=w),y},finish:function(v){for(var w=this.tryEntries.length-1;w>=0;--w){var O=this.tryEntries[w];if(O.finallyLoc===v)return this.complete(O.completion,O.afterLoc),q(O),y}},catch:function(v){for(var w=this.tryEntries.length-1;w>=0;--w){var O=this.tryEntries[w];if(O.tryLoc===v){var j=O.completion;if(j.type==="throw"){var R=j.arg;q(O)}return R}}throw Error("illegal catch attempt")},delegateYield:function(v,w,O){return this.delegate={iterator:V(v),resultName:w,nextLoc:O},this.method==="next"&&(this.arg=t),y}},e}function SU(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function PS(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,FU(n.key),n)}}function xU(t,e,r){return e&&PS(t.prototype,e),r&&PS(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function FU(t){var e=OU(t,"string");return $i(e)=="symbol"?e:e+""}function OU(t,e){if($i(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if($i(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function RS(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(l){r(l);return}a.done?e(u):Promise.resolve(u).then(n,i)}function $S(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function s(u){RS(o,n,i,s,a,"next",u)}function a(u){RS(o,n,i,s,a,"throw",u)}s(void 0)})}}function AU(t,e){return Ng.apply(this,arguments)}function Ng(){return Ng=$S(wu().mark(function t(e,r){return wu().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return i.abrupt("return",new Promise(function(o,s){var a=function(c){e.off("readable",u),s(c)},u=function l(){var c=e.read(r);c!==null&&(e.off("error",a),e.off("readable",l),o(c))};e.once("error",a),e.on("readable",u)}));case 1:case"end":return i.stop()}},t)})),Ng.apply(this,arguments)}var Ele=nf.default=function(){function t(e){var r=this;SU(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 xU(t,[{key:"slice",value:function(){var e=$S(wu().mark(function n(i,o){var s,a,u,l,c;return wu().wrap(function(h){for(;;)switch(h.prev=h.next){case 0:if(!(i<this._bufPos)){h.next=2;break}throw new Error("cannot slice from position which we already seeked away");case 2:if(!(i>this._bufPos+this._buf.length)){h.next=4;break}throw new Error("slice start is outside of buffer (currently not implemented)");case 4:if(!this._error){h.next=6;break}throw this._error;case 6:if(i<this._bufPos+this._buf.length?(a=i-this._bufPos,u=Math.min(this._buf.length,o-this._bufPos),s=this._buf.slice(a,u)):s=Buffer.alloc(0),!this._ended){h.next=10;break}return s.size=s.length,h.abrupt("return",{value:s,done:!0});case 10:if(l=o-i,!(l>s.length)){h.next=16;break}return h.next=14,AU(this._stream,l-s.length);case 14:c=h.sent,s=Buffer.concat([s,c]);case 16:return this._buf=s,this._bufPos=i,s.size=s.length,h.abrupt("return",{value:s,done:this._ended});case 20:case"end":return h.stop()}},n,this)}));function r(n,i){return e.apply(this,arguments)}return r}()},{key:"close",value:function(){this._stream.destroy()}}])}()});var jS=D(sf=>{"use strict";Object.defineProperty(sf,"__esModule",{value:!0});sf.default=void 0;var kU=require("fs"),TU=of(SS()),PU=of(FS()),RU=of(TS()),$U=of(Lg());function of(t){return t&&t.__esModule?t:{default:t}}function _u(t){"@babel/helpers - typeof";return _u=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},_u(t)}function IU(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function IS(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,NU(n.key),n)}}function jU(t,e,r){return e&&IS(t.prototype,e),r&&IS(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function NU(t){var e=LU(t,"string");return _u(e)=="symbol"?e:e+""}function LU(t,e){if(_u(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(_u(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Sle=sf.default=function(){function t(){IU(this,t)}return jU(t,[{key:"openFile",value:function(r,n){return Buffer.isBuffer(r)?Promise.resolve(new PU.default(r)):r instanceof kU.ReadStream&&r.path!=null?(0,RU.default)(r):TU.default.readable(r)?(n=Number(n),Number.isFinite(n)?Promise.resolve(new $U.default(r)):Promise.reject(new Error("cannot create source for stream without a finite value for the `chunkSize` option; specify a chunkSize to control the memory consumption"))):Promise.reject(new Error("source object may only be an instance of Buffer or Readable in this environment"))}}])}()});var qS=D(Bg=>{"use strict";Object.defineProperty(Bg,"__esModule",{value:!0});Bg.default=MU;var BU=require("crypto"),NS=BS(require("fs")),qU=BS(require("path"));function LS(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,r=new WeakMap;return(LS=function(n){return n?r:e})(t)}function BS(t,e){if(!e&&t&&t.__esModule)return t;if(t===null||typeof t!="object"&&typeof t!="function")return{default:t};var r=LS(e);if(r&&r.has(t))return r.get(t);var n={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in t)if(o!=="default"&&{}.hasOwnProperty.call(t,o)){var s=i?Object.getOwnPropertyDescriptor(t,o):null;s&&(s.get||s.set)?Object.defineProperty(n,o,s):n[o]=t[o]}return n.default=t,r&&r.set(t,n),n}function MU(t,e){if(Buffer.isBuffer(t)){var r=65536,n=t.slice(0,Math.min(r,t.length)),i=(0,BU.createHash)("md5").update(n).digest("hex"),o=["node-buffer",i,t.length,e.endpoint].join("-");return Promise.resolve(o)}return t instanceof NS.ReadStream&&t.path!=null?new Promise(function(s,a){var u=qU.resolve(t.path);NS.stat(t.path,function(l,c){if(l){a(l);return}var f=["node-file",u,c.size,c.mtime.getTime(),e.endpoint].join("-");s(f)})}):Promise.resolve(null)}});var zS=D((Ole,VS)=>{var HS="Expected a function",MS=NaN,UU="[object Symbol]",HU=/^\s+|\s+$/g,VU=/^[-+]0x[0-9a-f]+$/i,zU=/^0b[01]+$/i,GU=/^0o[0-7]+$/i,WU=parseInt,KU=typeof global=="object"&&global&&global.Object===Object&&global,YU=typeof self=="object"&&self&&self.Object===Object&&self,JU=KU||YU||Function("return this")(),XU=Object.prototype,ZU=XU.toString,QU=Math.max,e9=Math.min,qg=function(){return JU.Date.now()};function t9(t,e,r){var n,i,o,s,a,u,l=0,c=!1,f=!1,h=!0;if(typeof t!="function")throw new TypeError(HS);e=US(e)||0,af(r)&&(c=!!r.leading,f="maxWait"in r,o=f?QU(US(r.maxWait)||0,e):o,h="trailing"in r?!!r.trailing:h);function d(T){var x=n,L=i;return n=i=void 0,l=T,s=t.apply(L,x),s}function m(T){return l=T,a=setTimeout(E,e),c?d(T):s}function b(T){var x=T-u,L=T-l,S=e-x;return f?e9(S,o-L):S}function y(T){var x=T-u,L=T-l;return u===void 0||x>=e||x<0||f&&L>=o}function E(){var T=qg();if(y(T))return F(T);a=setTimeout(E,b(T))}function F(T){return a=void 0,h&&n?d(T):(n=i=void 0,s)}function g(){a!==void 0&&clearTimeout(a),l=0,n=u=i=a=void 0}function C(){return a===void 0?s:F(qg())}function A(){var T=qg(),x=y(T);if(n=arguments,i=this,u=T,x){if(a===void 0)return m(u);if(f)return a=setTimeout(E,e),d(u)}return a===void 0&&(a=setTimeout(E,e)),s}return A.cancel=g,A.flush=C,A}function r9(t,e,r){var n=!0,i=!0;if(typeof t!="function")throw new TypeError(HS);return af(r)&&(n="leading"in r?!!r.leading:n,i="trailing"in r?!!r.trailing:i),t9(t,e,{leading:n,maxWait:e,trailing:i})}function af(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function n9(t){return!!t&&typeof t=="object"}function i9(t){return typeof t=="symbol"||n9(t)&&ZU.call(t)==UU}function US(t){if(typeof t=="number")return t;if(i9(t))return MS;if(af(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=af(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=t.replace(HU,"");var r=zU.test(t);return r||GU.test(t)?WU(t.slice(2),r?2:8):VU.test(t)?MS:+t}VS.exports=r9});var e1=D(ff=>{"use strict";Object.defineProperty(ff,"__esModule",{value:!0});ff.default=void 0;var o9=XS(require("http")),s9=XS(require("https")),KS=require("stream"),a9=require("url"),YS=u9(zS());function u9(t){return t&&t.__esModule?t:{default:t}}function JS(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,r=new WeakMap;return(JS=function(n){return n?r:e})(t)}function XS(t,e){if(!e&&t&&t.__esModule)return t;if(t===null||typeof t!="object"&&typeof t!="function")return{default:t};var r=JS(e);if(r&&r.has(t))return r.get(t);var n={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in t)if(o!=="default"&&{}.hasOwnProperty.call(t,o)){var s=i?Object.getOwnPropertyDescriptor(t,o):null;s&&(s.get||s.set)?Object.defineProperty(n,o,s):n[o]=t[o]}return n.default=t,r&&r.set(t,n),n}function l9(t,e,r){return e=uf(e),c9(t,ZS()?Reflect.construct(e,r||[],uf(t).constructor):e.apply(t,r))}function c9(t,e){if(e&&(ls(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return f9(t)}function f9(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function ZS(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(ZS=function(){return!!t})()}function uf(t){return uf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},uf(t)}function d9(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&&Mg(t,e)}function Mg(t,e){return Mg=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Mg(t,e)}function GS(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Eu(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?GS(Object(r),!0).forEach(function(n){h9(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):GS(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function h9(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 ls(t){"@babel/helpers - typeof";return ls=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},ls(t)}function lf(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function WS(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,QS(n.key),n)}}function cf(t,e,r){return e&&WS(t.prototype,e),r&&WS(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function QS(t){var e=p9(t,"string");return ls(e)=="symbol"?e:e+""}function p9(t,e){if(ls(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(ls(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Ale=ff.default=function(){function t(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};lf(this,t),this._requestOptions=e}return cf(t,[{key:"createRequest",value:function(r,n){return new m9(r,n,this._requestOptions)}},{key:"getName",value:function(){return"NodeHttpStack"}}])}(),m9=function(){function t(e,r,n){lf(this,t),this._method=e,this._url=r,this._headers={},this._request=null,this._progressHandler=function(){},this._requestOptions=n||{}}return cf(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=Eu(Eu(Eu({},(0,a9.parse)(r._url)),r._requestOptions),{},{method:r._method,headers:Eu(Eu({},r._requestOptions.headers||{}),r._headers)});n!=null&&n.size&&(s.headers["Content-Length"]=n.size);var a=s.protocol==="https:"?s9:o9;r._request=a.request(s);var u=r._request;u.on("response",function(l){var c=[];l.on("data",function(f){c.push(f)}),l.on("end",function(){var f=Buffer.concat(c).toString("utf8");i(new g9(l,f))})}),u.on("error",function(l){o(l)}),n instanceof KS.Readable?n.pipe(new y9(r._progressHandler)).pipe(u):n instanceof Uint8Array?D9(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}}])}(),g9=function(){function t(e,r){lf(this,t),this._response=e,this._body=r}return cf(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}}])}(),y9=function(t){function e(r){var n;return lf(this,e),n=l9(this,e),n._onprogress=(0,YS.default)(r,100,{leading:!0,trailing:!1}),n._position=0,n}return d9(e,t),cf(e,[{key:"_transform",value:function(n,i,o){this._position+=n.length,this._onprogress(this._position),o(null,n)}}])}(KS.Transform),D9=function(e,r,n){n=(0,YS.default)(n,100,{leading:!0,trailing:!1});var i=0;function o(){var s=Math.min(e.writableHighWaterMark,r.length-i),a=r.subarray(i,i+s);i+=a.length;var u=e.write(a);u?i<r.length?o():e.end():(e.once("drain",o),n(i))}o()}});var t1=D(Ug=>{"use strict";Ug.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};Ug.root=function(t,e,r){var n=this,i,o={stackLength:Error.stackTraceLimit,rootOnly:!0},s="",a=Error.stackTraceLimit,u;function l(){u[0]=n.toString(),n.stack=u.join(`
31
31
  `)}(!e||typeof e!="object")&&(e={}),e.hasOwnProperty("stackLength")&&typeof e.stackLength=="number"&&!isNaN(e.stackLength)&&e.stackLength>=0&&(o.stackLength=e.stackLength),e.hasOwnProperty("rootOnly")||(o.rootOnly=e.rootOnly),(!o.rootOnly||this.CustomError.parent===Error)&&(Object.keys(t).forEach(function(c){switch(c){case"code":i=t.code||void 0;break;case"message":s=t.message||"";break;default:n[c]=t[c]}}),Error.stackTraceLimit=o.stackLength+2,u=new Error().stack.split(`
32
32
  `),u.splice(0,3),u.unshift(""),Error.stackTraceLimit=a,this.stack=u.join(`
33
- `),Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,get:function(){return i},set:function(c){i=c,l()}}),Object.defineProperty(this,"message",{configurable:!0,enumerable:!0,get:function(){return s},set:function(c){s=c,l()}}),l())}});var i1=y((Ple,n1)=>{"use strict";n1.exports=Ii;Ii.factory=t1();var zg=Ii("CustomError");zg.order=Ii(zg,{message:"Arguments out of order.",code:"EOARG"});function Ii(t,e,r,n){var i,o;return e=df(arguments,1,Error,r1,[Hg,hf]),r=df(arguments,2,{},Hg,[hf]),n=df(arguments,3,Vg,hf,[]),t=df(arguments,0,e===Error?"Error":e.prototype.CustomError.name,v9,[r1,Hg,hf]),o=e===Error,o&&n===Vg&&(n=Ii.factory.root),i=function(s,a){var u,l,c,f,h,d;if(!(this instanceof i))return new i(s,a);for(delete this.constructor.name,Object.defineProperty(this.constructor,"name",{enumerable:!1,configurable:!0,value:t,writable:!1}),typeof s=="string"&&(s={message:s}),s||(s={}),l=this.CustomError.chain.slice(0).reverse().map(function(m){return m.properties}),l.push(s),l.unshift({}),d=Object.assign.apply(Object,l),u=this,c={},Object.keys(Ii.factory).forEach(function(m){c[m]=function(b,D){Ii.factory[m].call(u,b,D,c)}}),f=this.CustomError.chain.length-1;f>=0;f--)h=this.CustomError.chain[f],h.factory!==Vg&&h.factory.call(this,d,a,c)},i.prototype=Object.create(e.prototype),i.prototype.constructor=i,i.prototype.name=t,i.prototype.CustomError={chain:o?[]:e.prototype.CustomError.chain.slice(0),factory:n,name:t,parent:e,properties:r},i.prototype.CustomError.chain.unshift(i.prototype.CustomError),i.prototype.toString=function(){var s=this.CustomError.chain[this.CustomError.chain.length-1].name;return this.code&&(s+=" "+this.code),this.message&&(s+=": "+this.message),s},i}function df(t,e,r,n,i){var o=-1,s=-1,a,u,l=e<t.length?e:t.length,c;for(a=0;a<=l;a++){if(c=t[a],o===-1)for(u=0;u<i.length;u++)i[u](c)&&(o=a);s===-1&&n(c)&&(s=a)}if(s!==-1&&o!==-1&&o<s)throw new zg.order;return s!==-1?t[s]:r}function hf(t){return typeof t=="function"&&t!==Error&&!t.prototype.CustomError}function v9(t){return typeof t=="string"}function r1(t){return typeof t=="function"&&(t===Error||t.prototype.CustomError)}function Hg(t){return t&&typeof t=="object"}function Vg(){}});var s1=y((Rle,o1)=>{o1.exports=i1()});var f1=y((ji,cs)=>{var b9=1/0,w9="[object Symbol]",Cu={function:!0,object:!0},_9=Cu[typeof ji]&&ji&&!ji.nodeType?ji:void 0,E9=Cu[typeof cs]&&cs&&!cs.nodeType?cs:void 0,C9=pf(_9&&E9&&typeof global=="object"&&global),S9=pf(Cu[typeof self]&&self),a1=pf(Cu[typeof window]&&window),Gg=pf(Cu[typeof ji]&&ji),x9=C9||a1!==(Gg&&Gg.window)&&a1||S9||Gg||Function("return this")();function pf(t){return t&&t.Object===Object?t:null}var F9=Object.prototype,O9=F9.toString,u1=x9.Symbol,l1=u1?u1.prototype:void 0,c1=l1?l1.toString:void 0;function A9(t){if(typeof t=="string")return t;if(T9(t))return c1?c1.call(t):"";var e=t+"";return e=="0"&&1/t==-b9?"-0":e}function k9(t){return!!t&&typeof t=="object"}function T9(t){return typeof t=="symbol"||k9(t)&&O9.call(t)==w9}cs.exports=A9});var D1=y((Ni,fs)=>{var P9=f1(),R9="Expected a function",h1="__lodash_hash_undefined__",$9="[object Function]",I9="[object GeneratorFunction]",j9=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]/g,N9=/[\\^$.*+?()[\]{}|]/g,L9=/\\(\\)?/g,B9=/^\[object .+?Constructor\]$/,xu={function:!0,object:!0},q9=xu[typeof Ni]&&Ni&&!Ni.nodeType?Ni:void 0,M9=xu[typeof fs]&&fs&&!fs.nodeType?fs:void 0,U9=mf(q9&&M9&&typeof global=="object"&&global),H9=mf(xu[typeof self]&&self),d1=mf(xu[typeof window]&&window),Wg=mf(xu[typeof Ni]&&Ni),V9=U9||d1!==(Wg&&Wg.window)&&d1||H9||Wg||Function("return this")();function mf(t){return t&&t.Object===Object?t:null}function z9(t){var e=!1;if(t!=null&&typeof t.toString!="function")try{e=!!(t+"")}catch{}return e}var G9=Array.prototype,p1=Object.prototype,m1=Function.prototype.toString,Kg=p1.hasOwnProperty,W9=p1.toString,K9=RegExp("^"+m1.call(Kg).replace(N9,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Y9=G9.splice,J9=g1(V9,"Map"),Su=g1(Object,"create");function Li(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function X9(){this.__data__=Su?Su(null):{}}function Z9(t){return this.has(t)&&delete this.__data__[t]}function Q9(t){var e=this.__data__;if(Su){var r=e[t];return r===h1?void 0:r}return Kg.call(e,t)?e[t]:void 0}function e7(t){var e=this.__data__;return Su?e[t]!==void 0:Kg.call(e,t)}function t7(t,e){var r=this.__data__;return r[t]=Su&&e===void 0?h1:e,this}Li.prototype.clear=X9;Li.prototype.delete=Z9;Li.prototype.get=Q9;Li.prototype.has=e7;Li.prototype.set=t7;function ds(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 r7(){this.__data__=[]}function n7(t){var e=this.__data__,r=gf(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():Y9.call(e,r,1),!0}function i7(t){var e=this.__data__,r=gf(e,t);return r<0?void 0:e[r][1]}function o7(t){return gf(this.__data__,t)>-1}function s7(t,e){var r=this.__data__,n=gf(r,t);return n<0?r.push([t,e]):r[n][1]=e,this}ds.prototype.clear=r7;ds.prototype.delete=n7;ds.prototype.get=i7;ds.prototype.has=o7;ds.prototype.set=s7;function Bi(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function a7(){this.__data__={hash:new Li,map:new(J9||ds),string:new Li}}function u7(t){return yf(this,t).delete(t)}function l7(t){return yf(this,t).get(t)}function c7(t){return yf(this,t).has(t)}function f7(t,e){return yf(this,t).set(t,e),this}Bi.prototype.clear=a7;Bi.prototype.delete=u7;Bi.prototype.get=l7;Bi.prototype.has=c7;Bi.prototype.set=f7;function gf(t,e){for(var r=t.length;r--;)if(m7(t[r][0],e))return r;return-1}function yf(t,e){var r=t.__data__;return d7(e)?r[typeof e=="string"?"string":"hash"]:r.map}function g1(t,e){var r=t[e];return y7(r)?r:void 0}function d7(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}var h7=Yg(function(t){var e=[];return D7(t).replace(j9,function(r,n,i,o){e.push(i?o.replace(L9,"$1"):n||r)}),e});function p7(t){if(t!=null){try{return m1.call(t)}catch{}try{return t+""}catch{}}return""}function Yg(t,e){if(typeof t!="function"||e&&typeof e!="function")throw new TypeError(R9);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(Yg.Cache||Bi),r}Yg.Cache=Bi;function m7(t,e){return t===e||t!==t&&e!==e}function g7(t){var e=y1(t)?W9.call(t):"";return e==$9||e==I9}function y1(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function y7(t){if(!y1(t))return!1;var e=g7(t)||z9(t)?K9:B9;return e.test(p7(t))}function D7(t){return t==null?"":P9(t)}fs.exports=h7});var K1=y((qi,ps)=>{var v7=D1(),b7=200,sy="__lodash_hash_undefined__",_f=1,ms=2,w7=1/0,C1=9007199254740991,Df="[object Arguments]",Zg="[object Array]",S1="[object Boolean]",x1="[object Date]",F1="[object Error]",O1="[object Function]",_7="[object GeneratorFunction]",Fu="[object Map]",A1="[object Number]",hs="[object Object]",v1="[object Promise]",k1="[object RegExp]",Ou="[object Set]",ay="[object String]",T1="[object Symbol]",Qg="[object WeakMap]",P1="[object ArrayBuffer]",vf="[object DataView]",E7="[object Float32Array]",C7="[object Float64Array]",S7="[object Int8Array]",x7="[object Int16Array]",F7="[object Int32Array]",O7="[object Uint8Array]",A7="[object Uint8ClampedArray]",k7="[object Uint16Array]",T7="[object Uint32Array]",P7=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,R7=/^\w*$/,$7=/[\\^$.*+?()[\]{}|]/g,I7=/^\[object .+?Constructor\]$/,j7=/^(?:0|[1-9]\d*)$/,Re={};Re[E7]=Re[C7]=Re[S7]=Re[x7]=Re[F7]=Re[O7]=Re[A7]=Re[k7]=Re[T7]=!0;Re[Df]=Re[Zg]=Re[P1]=Re[S1]=Re[vf]=Re[x1]=Re[F1]=Re[O1]=Re[Fu]=Re[A1]=Re[hs]=Re[k1]=Re[Ou]=Re[ay]=Re[Qg]=!1;var ku={function:!0,object:!0},N7=ku[typeof qi]&&qi&&!qi.nodeType?qi:void 0,L7=ku[typeof ps]&&ps&&!ps.nodeType?ps:void 0,B7=Ef(N7&&L7&&typeof global=="object"&&global),q7=Ef(ku[typeof self]&&self),b1=Ef(ku[typeof window]&&window),Jg=Ef(ku[typeof qi]&&qi),Hi=B7||b1!==(Jg&&Jg.window)&&b1||q7||Jg||Function("return this")();function M7(t,e){for(var r=-1,n=t.length,i=Array(n);++r<n;)i[r]=e(t[r],r,t);return i}function U7(t,e){for(var r=-1,n=t.length;++r<n;)if(e(t[r],r,t))return!0;return!1}function H7(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}function V7(t,e){return M7(e,function(r){return[r,t[r]]})}function Ef(t){return t&&t.Object===Object?t:null}function ey(t){var e=!1;if(t!=null&&typeof t.toString!="function")try{e=!!(t+"")}catch{}return e}function R1(t){var e=-1,r=Array(t.size);return t.forEach(function(n,i){r[++e]=[i,n]}),r}function z7(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}function G7(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=[n,n]}),r}var W7=Array.prototype,Cf=Object.prototype,$1=Function.prototype.toString,Mi=Cf.hasOwnProperty,Vi=Cf.toString,K7=RegExp("^"+$1.call(Mi).replace($7,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),w1=Hi.Symbol,_1=Hi.Uint8Array,Y7=Cf.propertyIsEnumerable,J7=W7.splice,X7=Object.getPrototypeOf,Z7=Object.keys,ty=gs(Hi,"DataView"),bf=gs(Hi,"Map"),ry=gs(Hi,"Promise"),ny=gs(Hi,"Set"),iy=gs(Hi,"WeakMap"),Au=gs(Object,"create"),Q7=Gi(ty),eH=Gi(bf),tH=Gi(ry),rH=Gi(ny),nH=Gi(iy),E1=w1?w1.prototype:void 0,Xg=E1?E1.valueOf:void 0;function Ui(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function iH(){this.__data__=Au?Au(null):{}}function oH(t){return this.has(t)&&delete this.__data__[t]}function sH(t){var e=this.__data__;if(Au){var r=e[t];return r===sy?void 0:r}return Mi.call(e,t)?e[t]:void 0}function aH(t){var e=this.__data__;return Au?e[t]!==void 0:Mi.call(e,t)}function uH(t,e){var r=this.__data__;return r[t]=Au&&e===void 0?sy:e,this}Ui.prototype.clear=iH;Ui.prototype.delete=oH;Ui.prototype.get=sH;Ui.prototype.has=aH;Ui.prototype.set=uH;function mn(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function lH(){this.__data__=[]}function cH(t){var e=this.__data__,r=Sf(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():J7.call(e,r,1),!0}function fH(t){var e=this.__data__,r=Sf(e,t);return r<0?void 0:e[r][1]}function dH(t){return Sf(this.__data__,t)>-1}function hH(t,e){var r=this.__data__,n=Sf(r,t);return n<0?r.push([t,e]):r[n][1]=e,this}mn.prototype.clear=lH;mn.prototype.delete=cH;mn.prototype.get=fH;mn.prototype.has=dH;mn.prototype.set=hH;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 pH(){this.__data__={hash:new Ui,map:new(bf||mn),string:new Ui}}function mH(t){return xf(this,t).delete(t)}function gH(t){return xf(this,t).get(t)}function yH(t){return xf(this,t).has(t)}function DH(t,e){return xf(this,t).set(t,e),this}zi.prototype.clear=pH;zi.prototype.delete=mH;zi.prototype.get=gH;zi.prototype.has=yH;zi.prototype.set=DH;function wf(t){var e=-1,r=t?t.length:0;for(this.__data__=new zi;++e<r;)this.add(t[e])}function vH(t){return this.__data__.set(t,sy),this}function bH(t){return this.__data__.has(t)}wf.prototype.add=wf.prototype.push=vH;wf.prototype.has=bH;function pn(t){this.__data__=new mn(t)}function wH(){this.__data__=new mn}function _H(t){return this.__data__.delete(t)}function EH(t){return this.__data__.get(t)}function CH(t){return this.__data__.has(t)}function SH(t,e){var r=this.__data__;return r instanceof mn&&r.__data__.length==b7&&(r=this.__data__=new zi(r.__data__)),r.set(t,e),this}pn.prototype.clear=wH;pn.prototype.delete=_H;pn.prototype.get=EH;pn.prototype.has=CH;pn.prototype.set=SH;function Sf(t,e){for(var r=t.length;r--;)if(VH(t[r][0],e))return r;return-1}function I1(t,e){e=Ff(e,t)?[e]:L1(e);for(var r=0,n=e.length;t!=null&&r<n;)t=t[Of(e[r++])];return r&&r==n?t:void 0}function j1(t,e){return Mi.call(t,e)||typeof t=="object"&&e in t&&BH(t)===null}function xH(t,e){return e in Object(t)}function uy(t,e,r,n,i){return t===e?!0:t==null||e==null||!kf(t)&&!Tu(e)?t!==t&&e!==e:FH(t,e,uy,r,n,i)}function FH(t,e,r,n,i,o){var s=Yn(t),a=Yn(e),u=Zg,l=Zg;s||(u=hn(t),u=u==Df?hs:u),a||(l=hn(e),l=l==Df?hs:l);var c=u==hs&&!ey(t),f=l==hs&&!ey(e),h=u==l;if(h&&!c)return o||(o=new pn),s||WH(t)?B1(t,e,r,n,i,o):IH(t,e,u,r,n,i,o);if(!(i&ms)){var d=c&&Mi.call(t,"__wrapped__"),m=f&&Mi.call(e,"__wrapped__");if(d||m){var b=d?t.value():t,D=m?e.value():e;return o||(o=new pn),r(b,D,n,i,o)}}return h?(o||(o=new pn),jH(t,e,r,n,i,o)):!1}function OH(t,e,r,n){var i=r.length,o=i,s=!n;if(t==null)return!o;for(t=Object(t);i--;){var a=r[i];if(s&&a[2]?a[1]!==t[a[0]]:!(a[0]in t))return!1}for(;++i<o;){a=r[i];var u=a[0],l=t[u],c=a[1];if(s&&a[2]){if(l===void 0&&!(u in t))return!1}else{var f=new pn;if(n)var h=n(l,c,u,t,e,f);if(!(h===void 0?uy(c,l,n,_f|ms,f):h))return!1}}return!0}function AH(t){return typeof t=="function"?t:t==null?XH:typeof t=="object"?Yn(t)?PH(t[0],t[1]):TH(t):ZH(t)}function kH(t){return Z7(Object(t))}function TH(t){var e=LH(t);return e.length==1&&e[0][2]?U1(e[0][0],e[0][1]):function(r){return r===t||OH(r,t,e)}}function PH(t,e){return Ff(t)&&M1(e)?U1(Of(t),e):function(r){var n=KH(r,t);return n===void 0&&n===e?YH(r,t):uy(e,n,void 0,_f|ms)}}function N1(t){return function(e){return e?.[t]}}function RH(t){return function(e){return I1(e,t)}}function L1(t){return Yn(t)?t:v7(t)}function $H(t){return function(e){var r=hn(e);return r==Fu?R1(e):r==Ou?G7(e):V7(e,t(e))}}function B1(t,e,r,n,i,o){var s=i&ms,a=t.length,u=e.length;if(a!=u&&!(s&&u>a))return!1;var l=o.get(t);if(l)return l==e;var c=-1,f=!0,h=i&_f?new wf:void 0;for(o.set(t,e);++c<a;){var d=t[c],m=e[c];if(n)var b=s?n(m,d,c,e,t,o):n(d,m,c,t,e,o);if(b!==void 0){if(b)continue;f=!1;break}if(h){if(!U7(e,function(D,_){if(!h.has(_)&&(d===D||r(d,D,n,i,o)))return h.add(_)})){f=!1;break}}else if(!(d===m||r(d,m,n,i,o))){f=!1;break}}return o.delete(t),f}function IH(t,e,r,n,i,o,s){switch(r){case vf:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case P1:return!(t.byteLength!=e.byteLength||!n(new _1(t),new _1(e)));case S1:case x1:return+t==+e;case F1:return t.name==e.name&&t.message==e.message;case A1:return t!=+t?e!=+e:t==+e;case k1:case ay:return t==e+"";case Fu:var a=R1;case Ou:var u=o&ms;if(a||(a=z7),t.size!=e.size&&!u)return!1;var l=s.get(t);return l?l==e:(o|=_f,s.set(t,e),B1(a(t),a(e),n,i,o,s));case T1:if(Xg)return Xg.call(t)==Xg.call(e)}return!1}function jH(t,e,r,n,i,o){var s=i&ms,a=oy(t),u=a.length,l=oy(e),c=l.length;if(u!=c&&!s)return!1;for(var f=u;f--;){var h=a[f];if(!(s?h in e:j1(e,h)))return!1}var d=o.get(t);if(d)return d==e;var m=!0;o.set(t,e);for(var b=s;++f<u;){h=a[f];var D=t[h],_=e[h];if(n)var F=s?n(_,D,h,e,t,o):n(D,_,h,t,e,o);if(!(F===void 0?D===_||r(D,_,n,i,o):F)){m=!1;break}b||(b=h=="constructor")}if(m&&!b){var g=t.constructor,C=e.constructor;g!=C&&"constructor"in t&&"constructor"in e&&!(typeof g=="function"&&g instanceof g&&typeof C=="function"&&C instanceof C)&&(m=!1)}return o.delete(t),m}var NH=N1("length");function xf(t,e){var r=t.__data__;return UH(e)?r[typeof e=="string"?"string":"hash"]:r.map}function LH(t){for(var e=JH(t),r=e.length;r--;)e[r][2]=M1(e[r][1]);return e}function gs(t,e){var r=t[e];return GH(r)?r:void 0}function BH(t){return X7(Object(t))}function hn(t){return Vi.call(t)}(ty&&hn(new ty(new ArrayBuffer(1)))!=vf||bf&&hn(new bf)!=Fu||ry&&hn(ry.resolve())!=v1||ny&&hn(new ny)!=Ou||iy&&hn(new iy)!=Qg)&&(hn=function(t){var e=Vi.call(t),r=e==hs?t.constructor:void 0,n=r?Gi(r):void 0;if(n)switch(n){case Q7:return vf;case eH:return Fu;case tH:return v1;case rH:return Ou;case nH:return Qg}return e});function qH(t,e,r){e=Ff(e,t)?[e]:L1(e);for(var n,i=-1,s=e.length;++i<s;){var o=Of(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&&Af(s)&&q1(o,s)&&(Yn(t)||G1(t)||H1(t))}function MH(t){var e=t?t.length:void 0;return Af(e)&&(Yn(t)||G1(t)||H1(t))?H7(e,String):null}function q1(t,e){return e=e??C1,!!e&&(typeof t=="number"||j7.test(t))&&t>-1&&t%1==0&&t<e}function Ff(t,e){if(Yn(t))return!1;var r=typeof t;return r=="number"||r=="symbol"||r=="boolean"||t==null||W1(t)?!0:R7.test(t)||!P7.test(t)||e!=null&&t in Object(e)}function UH(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function HH(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||Cf;return t===r}function M1(t){return t===t&&!kf(t)}function U1(t,e){return function(r){return r==null?!1:r[t]===e&&(e!==void 0||t in Object(r))}}function Of(t){if(typeof t=="string"||W1(t))return t;var e=t+"";return e=="0"&&1/t==-w7?"-0":e}function Gi(t){if(t!=null){try{return $1.call(t)}catch{}try{return t+""}catch{}}return""}function VH(t,e){return t===e||t!==t&&e!==e}function H1(t){return zH(t)&&Mi.call(t,"callee")&&(!Y7.call(t,"callee")||Vi.call(t)==Df)}var Yn=Array.isArray;function V1(t){return t!=null&&Af(NH(t))&&!z1(t)}function zH(t){return Tu(t)&&V1(t)}function z1(t){var e=kf(t)?Vi.call(t):"";return e==O1||e==_7}function Af(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=C1}function kf(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function Tu(t){return!!t&&typeof t=="object"}function GH(t){if(!kf(t))return!1;var e=z1(t)||ey(t)?K7:I7;return e.test(Gi(t))}function G1(t){return typeof t=="string"||!Yn(t)&&Tu(t)&&Vi.call(t)==ay}function W1(t){return typeof t=="symbol"||Tu(t)&&Vi.call(t)==T1}function WH(t){return Tu(t)&&Af(t.length)&&!!Re[Vi.call(t)]}function KH(t,e,r){var n=t==null?void 0:I1(t,e);return n===void 0?r:n}function YH(t,e){return t!=null&&qH(t,e,xH)}function oy(t){var e=HH(t);if(!(e||V1(t)))return kH(t);var r=MH(t),n=!!r,i=r||[],o=i.length;for(var s in t)j1(t,s)&&!(n&&(s=="length"||q1(s,o)))&&!(e&&s=="constructor")&&i.push(s);return i}var JH=$H(oy);function XH(t){return t}function ZH(t){return Ff(t)?N1(Of(t)):RH(t)}ps.exports=AH});var Q1=y((Wi,ys)=>{var QH=1/0,eV="[object Function]",tV="[object GeneratorFunction]",rV=/[\\^$.*+?()[\]{}|]/g,nV=/^\[object .+?Constructor\]$/,Pu={function:!0,object:!0},iV=Pu[typeof Wi]&&Wi&&!Wi.nodeType?Wi:void 0,oV=Pu[typeof ys]&&ys&&!ys.nodeType?ys:void 0,sV=Tf(iV&&oV&&typeof global=="object"&&global),aV=Tf(Pu[typeof self]&&self),Y1=Tf(Pu[typeof window]&&window),ly=Tf(Pu[typeof Wi]&&Wi),uV=sV||Y1!==(ly&&ly.window)&&Y1||aV||ly||Function("return this")();function Tf(t){return t&&t.Object===Object?t:null}function lV(t){var e=!1;if(t!=null&&typeof t.toString!="function")try{e=!!(t+"")}catch{}return e}function cV(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}var J1=Object.prototype,X1=Function.prototype.toString,fV=J1.hasOwnProperty,dV=J1.toString,hV=RegExp("^"+X1.call(fV).replace(rV,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),cy=mV(uV,"Set"),pV=cy&&1/cV(new cy([,-0]))[1]==QH?function(t){return new cy(t)}:vV;function mV(t,e){var r=t[e];return DV(r)?r:void 0}function gV(t){if(t!=null){try{return X1.call(t)}catch{}try{return t+""}catch{}}return""}function yV(t){var e=Z1(t)?dV.call(t):"";return e==eV||e==tV}function Z1(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function DV(t){if(!Z1(t))return!1;var e=yV(t)||lV(t)?hV:nV;return e.test(gV(t))}function vV(){}ys.exports=pV});var tx=y((Ki,Ds)=>{var Ru={function:!0,object:!0},bV=Ru[typeof Ki]&&Ki&&!Ki.nodeType?Ki:void 0,wV=Ru[typeof Ds]&&Ds&&!Ds.nodeType?Ds:void 0,_V=Pf(bV&&wV&&typeof global=="object"&&global),EV=Pf(Ru[typeof self]&&self),ex=Pf(Ru[typeof window]&&window),fy=Pf(Ru[typeof Ki]&&Ki),CV=_V||ex!==(fy&&fy.window)&&ex||EV||fy||Function("return this")();function Pf(t){return t&&t.Object===Object?t:null}Ds.exports=CV});var ax=y(($le,sx)=>{var SV=Q1(),xV=tx(),FV=200,dy="__lodash_hash_undefined__",OV="[object Function]",AV="[object GeneratorFunction]",kV=/[\\^$.*+?()[\]{}|]/g,TV=/^\[object .+?Constructor\]$/;function PV(t,e){return!!t.length&&$V(t,e,0)>-1}function RV(t,e,r){for(var n=-1,i=t.length;++n<i;)if(r(e,t[n]))return!0;return!1}function $V(t,e,r){if(e!==e)return jV(t,r);for(var n=r-1,i=t.length;++n<i;)if(t[n]===e)return n;return-1}function IV(t,e){return t.has(e)}function jV(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 NV(t){var e=!1;if(t!=null&&typeof t.toString!="function")try{e=!!(t+"")}catch{}return e}function LV(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}var BV=Array.prototype,rx=Object.prototype,nx=Function.prototype.toString,hy=rx.hasOwnProperty,qV=rx.toString,MV=RegExp("^"+nx.call(hy).replace(kV,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),UV=BV.splice,HV=ix(xV,"Map"),$u=ix(Object,"create");function Yi(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function VV(){this.__data__=$u?$u(null):{}}function zV(t){return this.has(t)&&delete this.__data__[t]}function GV(t){var e=this.__data__;if($u){var r=e[t];return r===dy?void 0:r}return hy.call(e,t)?e[t]:void 0}function WV(t){var e=this.__data__;return $u?e[t]!==void 0:hy.call(e,t)}function KV(t,e){var r=this.__data__;return r[t]=$u&&e===void 0?dy:e,this}Yi.prototype.clear=VV;Yi.prototype.delete=zV;Yi.prototype.get=GV;Yi.prototype.has=WV;Yi.prototype.set=KV;function vs(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 YV(){this.__data__=[]}function JV(t){var e=this.__data__,r=$f(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():UV.call(e,r,1),!0}function XV(t){var e=this.__data__,r=$f(e,t);return r<0?void 0:e[r][1]}function ZV(t){return $f(this.__data__,t)>-1}function QV(t,e){var r=this.__data__,n=$f(r,t);return n<0?r.push([t,e]):r[n][1]=e,this}vs.prototype.clear=YV;vs.prototype.delete=JV;vs.prototype.get=XV;vs.prototype.has=ZV;vs.prototype.set=QV;function bs(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function ez(){this.__data__={hash:new Yi,map:new(HV||vs),string:new Yi}}function tz(t){return If(this,t).delete(t)}function rz(t){return If(this,t).get(t)}function nz(t){return If(this,t).has(t)}function iz(t,e){return If(this,t).set(t,e),this}bs.prototype.clear=ez;bs.prototype.delete=tz;bs.prototype.get=rz;bs.prototype.has=nz;bs.prototype.set=iz;function Rf(t){var e=-1,r=t?t.length:0;for(this.__data__=new bs;++e<r;)this.add(t[e])}function oz(t){return this.__data__.set(t,dy),this}function sz(t){return this.__data__.has(t)}Rf.prototype.add=Rf.prototype.push=oz;Rf.prototype.has=sz;function $f(t,e){for(var r=t.length;r--;)if(cz(t[r][0],e))return r;return-1}function az(t,e,r){var n=-1,i=PV,o=t.length,s=!0,a=[],u=a;if(r)s=!1,i=RV;else if(o>=FV){var l=e?null:SV(t);if(l)return LV(l);s=!1,i=IV,u=new Rf}else u=e?[]:a;e:for(;++n<o;){var c=t[n],f=e?e(c):c;if(c=r||c!==0?c:0,s&&f===f){for(var h=u.length;h--;)if(u[h]===f)continue e;e&&u.push(f),a.push(c)}else i(u,f,r)||(u!==a&&u.push(f),a.push(c))}return a}function If(t,e){var r=t.__data__;return uz(e)?r[typeof e=="string"?"string":"hash"]:r.map}function ix(t,e){var r=t[e];return dz(r)?r:void 0}function uz(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function lz(t){if(t!=null){try{return nx.call(t)}catch{}try{return t+""}catch{}}return""}function cz(t,e){return t===e||t!==t&&e!==e}function fz(t){var e=ox(t)?qV.call(t):"";return e==OV||e==AV}function ox(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function dz(t){if(!ox(t))return!1;var e=fz(t)||NV(t)?MV:TV;return e.test(lz(t))}sx.exports=az});var lx=y((Ile,ux)=>{var hz=K1(),pz=ax();function mz(t,e){return t&&t.length?pz(t,hz(e)):[]}ux.exports=mz});var fx=y((jle,cx)=>{"use strict";var gz=s1(),yz=lx(),Dz=gz("MultiError");cx.exports=py;function py(t){if(!(this instanceof py))return new py(t);if(t=Array.isArray(t)?t:[t],t=yz(t,function(r){return r.stack}),t.length===1)return t[0];var e=new Dz({message:t.map(function(r){return r.message}).join("; "),errors:t.reduce(function(r,n){return r.concat(n.errors||n)},[])});return e.__defineGetter__("stack",function(){return t.map(function(r){return r.stack}).join(`
33
+ `),Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,get:function(){return i},set:function(c){i=c,l()}}),Object.defineProperty(this,"message",{configurable:!0,enumerable:!0,get:function(){return s},set:function(c){s=c,l()}}),l())}});var i1=D((Ple,n1)=>{"use strict";n1.exports=Ii;Ii.factory=t1();var zg=Ii("CustomError");zg.order=Ii(zg,{message:"Arguments out of order.",code:"EOARG"});function Ii(t,e,r,n){var i,o;return e=df(arguments,1,Error,r1,[Hg,hf]),r=df(arguments,2,{},Hg,[hf]),n=df(arguments,3,Vg,hf,[]),t=df(arguments,0,e===Error?"Error":e.prototype.CustomError.name,v9,[r1,Hg,hf]),o=e===Error,o&&n===Vg&&(n=Ii.factory.root),i=function(s,a){var u,l,c,f,h,d;if(!(this instanceof i))return new i(s,a);for(delete this.constructor.name,Object.defineProperty(this.constructor,"name",{enumerable:!1,configurable:!0,value:t,writable:!1}),typeof s=="string"&&(s={message:s}),s||(s={}),l=this.CustomError.chain.slice(0).reverse().map(function(m){return m.properties}),l.push(s),l.unshift({}),d=Object.assign.apply(Object,l),u=this,c={},Object.keys(Ii.factory).forEach(function(m){c[m]=function(b,y){Ii.factory[m].call(u,b,y,c)}}),f=this.CustomError.chain.length-1;f>=0;f--)h=this.CustomError.chain[f],h.factory!==Vg&&h.factory.call(this,d,a,c)},i.prototype=Object.create(e.prototype),i.prototype.constructor=i,i.prototype.name=t,i.prototype.CustomError={chain:o?[]:e.prototype.CustomError.chain.slice(0),factory:n,name:t,parent:e,properties:r},i.prototype.CustomError.chain.unshift(i.prototype.CustomError),i.prototype.toString=function(){var s=this.CustomError.chain[this.CustomError.chain.length-1].name;return this.code&&(s+=" "+this.code),this.message&&(s+=": "+this.message),s},i}function df(t,e,r,n,i){var o=-1,s=-1,a,u,l=e<t.length?e:t.length,c;for(a=0;a<=l;a++){if(c=t[a],o===-1)for(u=0;u<i.length;u++)i[u](c)&&(o=a);s===-1&&n(c)&&(s=a)}if(s!==-1&&o!==-1&&o<s)throw new zg.order;return s!==-1?t[s]:r}function hf(t){return typeof t=="function"&&t!==Error&&!t.prototype.CustomError}function v9(t){return typeof t=="string"}function r1(t){return typeof t=="function"&&(t===Error||t.prototype.CustomError)}function Hg(t){return t&&typeof t=="object"}function Vg(){}});var s1=D((Rle,o1)=>{o1.exports=i1()});var f1=D((ji,cs)=>{var b9=1/0,w9="[object Symbol]",Cu={function:!0,object:!0},_9=Cu[typeof ji]&&ji&&!ji.nodeType?ji:void 0,E9=Cu[typeof cs]&&cs&&!cs.nodeType?cs:void 0,C9=pf(_9&&E9&&typeof global=="object"&&global),S9=pf(Cu[typeof self]&&self),a1=pf(Cu[typeof window]&&window),Gg=pf(Cu[typeof ji]&&ji),x9=C9||a1!==(Gg&&Gg.window)&&a1||S9||Gg||Function("return this")();function pf(t){return t&&t.Object===Object?t:null}var F9=Object.prototype,O9=F9.toString,u1=x9.Symbol,l1=u1?u1.prototype:void 0,c1=l1?l1.toString:void 0;function A9(t){if(typeof t=="string")return t;if(T9(t))return c1?c1.call(t):"";var e=t+"";return e=="0"&&1/t==-b9?"-0":e}function k9(t){return!!t&&typeof t=="object"}function T9(t){return typeof t=="symbol"||k9(t)&&O9.call(t)==w9}cs.exports=A9});var D1=D((Ni,fs)=>{var P9=f1(),R9="Expected a function",h1="__lodash_hash_undefined__",$9="[object Function]",I9="[object GeneratorFunction]",j9=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]/g,N9=/[\\^$.*+?()[\]{}|]/g,L9=/\\(\\)?/g,B9=/^\[object .+?Constructor\]$/,xu={function:!0,object:!0},q9=xu[typeof Ni]&&Ni&&!Ni.nodeType?Ni:void 0,M9=xu[typeof fs]&&fs&&!fs.nodeType?fs:void 0,U9=mf(q9&&M9&&typeof global=="object"&&global),H9=mf(xu[typeof self]&&self),d1=mf(xu[typeof window]&&window),Wg=mf(xu[typeof Ni]&&Ni),V9=U9||d1!==(Wg&&Wg.window)&&d1||H9||Wg||Function("return this")();function mf(t){return t&&t.Object===Object?t:null}function z9(t){var e=!1;if(t!=null&&typeof t.toString!="function")try{e=!!(t+"")}catch{}return e}var G9=Array.prototype,p1=Object.prototype,m1=Function.prototype.toString,Kg=p1.hasOwnProperty,W9=p1.toString,K9=RegExp("^"+m1.call(Kg).replace(N9,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Y9=G9.splice,J9=g1(V9,"Map"),Su=g1(Object,"create");function Li(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function X9(){this.__data__=Su?Su(null):{}}function Z9(t){return this.has(t)&&delete this.__data__[t]}function Q9(t){var e=this.__data__;if(Su){var r=e[t];return r===h1?void 0:r}return Kg.call(e,t)?e[t]:void 0}function e7(t){var e=this.__data__;return Su?e[t]!==void 0:Kg.call(e,t)}function t7(t,e){var r=this.__data__;return r[t]=Su&&e===void 0?h1:e,this}Li.prototype.clear=X9;Li.prototype.delete=Z9;Li.prototype.get=Q9;Li.prototype.has=e7;Li.prototype.set=t7;function ds(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 r7(){this.__data__=[]}function n7(t){var e=this.__data__,r=gf(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():Y9.call(e,r,1),!0}function i7(t){var e=this.__data__,r=gf(e,t);return r<0?void 0:e[r][1]}function o7(t){return gf(this.__data__,t)>-1}function s7(t,e){var r=this.__data__,n=gf(r,t);return n<0?r.push([t,e]):r[n][1]=e,this}ds.prototype.clear=r7;ds.prototype.delete=n7;ds.prototype.get=i7;ds.prototype.has=o7;ds.prototype.set=s7;function Bi(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function a7(){this.__data__={hash:new Li,map:new(J9||ds),string:new Li}}function u7(t){return yf(this,t).delete(t)}function l7(t){return yf(this,t).get(t)}function c7(t){return yf(this,t).has(t)}function f7(t,e){return yf(this,t).set(t,e),this}Bi.prototype.clear=a7;Bi.prototype.delete=u7;Bi.prototype.get=l7;Bi.prototype.has=c7;Bi.prototype.set=f7;function gf(t,e){for(var r=t.length;r--;)if(m7(t[r][0],e))return r;return-1}function yf(t,e){var r=t.__data__;return d7(e)?r[typeof e=="string"?"string":"hash"]:r.map}function g1(t,e){var r=t[e];return y7(r)?r:void 0}function d7(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}var h7=Yg(function(t){var e=[];return D7(t).replace(j9,function(r,n,i,o){e.push(i?o.replace(L9,"$1"):n||r)}),e});function p7(t){if(t!=null){try{return m1.call(t)}catch{}try{return t+""}catch{}}return""}function Yg(t,e){if(typeof t!="function"||e&&typeof e!="function")throw new TypeError(R9);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(Yg.Cache||Bi),r}Yg.Cache=Bi;function m7(t,e){return t===e||t!==t&&e!==e}function g7(t){var e=y1(t)?W9.call(t):"";return e==$9||e==I9}function y1(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function y7(t){if(!y1(t))return!1;var e=g7(t)||z9(t)?K9:B9;return e.test(p7(t))}function D7(t){return t==null?"":P9(t)}fs.exports=h7});var K1=D((qi,ps)=>{var v7=D1(),b7=200,sy="__lodash_hash_undefined__",_f=1,ms=2,w7=1/0,C1=9007199254740991,Df="[object Arguments]",Zg="[object Array]",S1="[object Boolean]",x1="[object Date]",F1="[object Error]",O1="[object Function]",_7="[object GeneratorFunction]",Fu="[object Map]",A1="[object Number]",hs="[object Object]",v1="[object Promise]",k1="[object RegExp]",Ou="[object Set]",ay="[object String]",T1="[object Symbol]",Qg="[object WeakMap]",P1="[object ArrayBuffer]",vf="[object DataView]",E7="[object Float32Array]",C7="[object Float64Array]",S7="[object Int8Array]",x7="[object Int16Array]",F7="[object Int32Array]",O7="[object Uint8Array]",A7="[object Uint8ClampedArray]",k7="[object Uint16Array]",T7="[object Uint32Array]",P7=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,R7=/^\w*$/,$7=/[\\^$.*+?()[\]{}|]/g,I7=/^\[object .+?Constructor\]$/,j7=/^(?:0|[1-9]\d*)$/,Re={};Re[E7]=Re[C7]=Re[S7]=Re[x7]=Re[F7]=Re[O7]=Re[A7]=Re[k7]=Re[T7]=!0;Re[Df]=Re[Zg]=Re[P1]=Re[S1]=Re[vf]=Re[x1]=Re[F1]=Re[O1]=Re[Fu]=Re[A1]=Re[hs]=Re[k1]=Re[Ou]=Re[ay]=Re[Qg]=!1;var ku={function:!0,object:!0},N7=ku[typeof qi]&&qi&&!qi.nodeType?qi:void 0,L7=ku[typeof ps]&&ps&&!ps.nodeType?ps:void 0,B7=Ef(N7&&L7&&typeof global=="object"&&global),q7=Ef(ku[typeof self]&&self),b1=Ef(ku[typeof window]&&window),Jg=Ef(ku[typeof qi]&&qi),Hi=B7||b1!==(Jg&&Jg.window)&&b1||q7||Jg||Function("return this")();function M7(t,e){for(var r=-1,n=t.length,i=Array(n);++r<n;)i[r]=e(t[r],r,t);return i}function U7(t,e){for(var r=-1,n=t.length;++r<n;)if(e(t[r],r,t))return!0;return!1}function H7(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}function V7(t,e){return M7(e,function(r){return[r,t[r]]})}function Ef(t){return t&&t.Object===Object?t:null}function ey(t){var e=!1;if(t!=null&&typeof t.toString!="function")try{e=!!(t+"")}catch{}return e}function R1(t){var e=-1,r=Array(t.size);return t.forEach(function(n,i){r[++e]=[i,n]}),r}function z7(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}function G7(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=[n,n]}),r}var W7=Array.prototype,Cf=Object.prototype,$1=Function.prototype.toString,Mi=Cf.hasOwnProperty,Vi=Cf.toString,K7=RegExp("^"+$1.call(Mi).replace($7,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),w1=Hi.Symbol,_1=Hi.Uint8Array,Y7=Cf.propertyIsEnumerable,J7=W7.splice,X7=Object.getPrototypeOf,Z7=Object.keys,ty=gs(Hi,"DataView"),bf=gs(Hi,"Map"),ry=gs(Hi,"Promise"),ny=gs(Hi,"Set"),iy=gs(Hi,"WeakMap"),Au=gs(Object,"create"),Q7=Gi(ty),eH=Gi(bf),tH=Gi(ry),rH=Gi(ny),nH=Gi(iy),E1=w1?w1.prototype:void 0,Xg=E1?E1.valueOf:void 0;function Ui(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function iH(){this.__data__=Au?Au(null):{}}function oH(t){return this.has(t)&&delete this.__data__[t]}function sH(t){var e=this.__data__;if(Au){var r=e[t];return r===sy?void 0:r}return Mi.call(e,t)?e[t]:void 0}function aH(t){var e=this.__data__;return Au?e[t]!==void 0:Mi.call(e,t)}function uH(t,e){var r=this.__data__;return r[t]=Au&&e===void 0?sy:e,this}Ui.prototype.clear=iH;Ui.prototype.delete=oH;Ui.prototype.get=sH;Ui.prototype.has=aH;Ui.prototype.set=uH;function mn(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function lH(){this.__data__=[]}function cH(t){var e=this.__data__,r=Sf(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():J7.call(e,r,1),!0}function fH(t){var e=this.__data__,r=Sf(e,t);return r<0?void 0:e[r][1]}function dH(t){return Sf(this.__data__,t)>-1}function hH(t,e){var r=this.__data__,n=Sf(r,t);return n<0?r.push([t,e]):r[n][1]=e,this}mn.prototype.clear=lH;mn.prototype.delete=cH;mn.prototype.get=fH;mn.prototype.has=dH;mn.prototype.set=hH;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 pH(){this.__data__={hash:new Ui,map:new(bf||mn),string:new Ui}}function mH(t){return xf(this,t).delete(t)}function gH(t){return xf(this,t).get(t)}function yH(t){return xf(this,t).has(t)}function DH(t,e){return xf(this,t).set(t,e),this}zi.prototype.clear=pH;zi.prototype.delete=mH;zi.prototype.get=gH;zi.prototype.has=yH;zi.prototype.set=DH;function wf(t){var e=-1,r=t?t.length:0;for(this.__data__=new zi;++e<r;)this.add(t[e])}function vH(t){return this.__data__.set(t,sy),this}function bH(t){return this.__data__.has(t)}wf.prototype.add=wf.prototype.push=vH;wf.prototype.has=bH;function pn(t){this.__data__=new mn(t)}function wH(){this.__data__=new mn}function _H(t){return this.__data__.delete(t)}function EH(t){return this.__data__.get(t)}function CH(t){return this.__data__.has(t)}function SH(t,e){var r=this.__data__;return r instanceof mn&&r.__data__.length==b7&&(r=this.__data__=new zi(r.__data__)),r.set(t,e),this}pn.prototype.clear=wH;pn.prototype.delete=_H;pn.prototype.get=EH;pn.prototype.has=CH;pn.prototype.set=SH;function Sf(t,e){for(var r=t.length;r--;)if(VH(t[r][0],e))return r;return-1}function I1(t,e){e=Ff(e,t)?[e]:L1(e);for(var r=0,n=e.length;t!=null&&r<n;)t=t[Of(e[r++])];return r&&r==n?t:void 0}function j1(t,e){return Mi.call(t,e)||typeof t=="object"&&e in t&&BH(t)===null}function xH(t,e){return e in Object(t)}function uy(t,e,r,n,i){return t===e?!0:t==null||e==null||!kf(t)&&!Tu(e)?t!==t&&e!==e:FH(t,e,uy,r,n,i)}function FH(t,e,r,n,i,o){var s=Yn(t),a=Yn(e),u=Zg,l=Zg;s||(u=hn(t),u=u==Df?hs:u),a||(l=hn(e),l=l==Df?hs:l);var c=u==hs&&!ey(t),f=l==hs&&!ey(e),h=u==l;if(h&&!c)return o||(o=new pn),s||WH(t)?B1(t,e,r,n,i,o):IH(t,e,u,r,n,i,o);if(!(i&ms)){var d=c&&Mi.call(t,"__wrapped__"),m=f&&Mi.call(e,"__wrapped__");if(d||m){var b=d?t.value():t,y=m?e.value():e;return o||(o=new pn),r(b,y,n,i,o)}}return h?(o||(o=new pn),jH(t,e,r,n,i,o)):!1}function OH(t,e,r,n){var i=r.length,o=i,s=!n;if(t==null)return!o;for(t=Object(t);i--;){var a=r[i];if(s&&a[2]?a[1]!==t[a[0]]:!(a[0]in t))return!1}for(;++i<o;){a=r[i];var u=a[0],l=t[u],c=a[1];if(s&&a[2]){if(l===void 0&&!(u in t))return!1}else{var f=new pn;if(n)var h=n(l,c,u,t,e,f);if(!(h===void 0?uy(c,l,n,_f|ms,f):h))return!1}}return!0}function AH(t){return typeof t=="function"?t:t==null?XH:typeof t=="object"?Yn(t)?PH(t[0],t[1]):TH(t):ZH(t)}function kH(t){return Z7(Object(t))}function TH(t){var e=LH(t);return e.length==1&&e[0][2]?U1(e[0][0],e[0][1]):function(r){return r===t||OH(r,t,e)}}function PH(t,e){return Ff(t)&&M1(e)?U1(Of(t),e):function(r){var n=KH(r,t);return n===void 0&&n===e?YH(r,t):uy(e,n,void 0,_f|ms)}}function N1(t){return function(e){return e?.[t]}}function RH(t){return function(e){return I1(e,t)}}function L1(t){return Yn(t)?t:v7(t)}function $H(t){return function(e){var r=hn(e);return r==Fu?R1(e):r==Ou?G7(e):V7(e,t(e))}}function B1(t,e,r,n,i,o){var s=i&ms,a=t.length,u=e.length;if(a!=u&&!(s&&u>a))return!1;var l=o.get(t);if(l)return l==e;var c=-1,f=!0,h=i&_f?new wf:void 0;for(o.set(t,e);++c<a;){var d=t[c],m=e[c];if(n)var b=s?n(m,d,c,e,t,o):n(d,m,c,t,e,o);if(b!==void 0){if(b)continue;f=!1;break}if(h){if(!U7(e,function(y,E){if(!h.has(E)&&(d===y||r(d,y,n,i,o)))return h.add(E)})){f=!1;break}}else if(!(d===m||r(d,m,n,i,o))){f=!1;break}}return o.delete(t),f}function IH(t,e,r,n,i,o,s){switch(r){case vf:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case P1:return!(t.byteLength!=e.byteLength||!n(new _1(t),new _1(e)));case S1:case x1:return+t==+e;case F1:return t.name==e.name&&t.message==e.message;case A1:return t!=+t?e!=+e:t==+e;case k1:case ay:return t==e+"";case Fu:var a=R1;case Ou:var u=o&ms;if(a||(a=z7),t.size!=e.size&&!u)return!1;var l=s.get(t);return l?l==e:(o|=_f,s.set(t,e),B1(a(t),a(e),n,i,o,s));case T1:if(Xg)return Xg.call(t)==Xg.call(e)}return!1}function jH(t,e,r,n,i,o){var s=i&ms,a=oy(t),u=a.length,l=oy(e),c=l.length;if(u!=c&&!s)return!1;for(var f=u;f--;){var h=a[f];if(!(s?h in e:j1(e,h)))return!1}var d=o.get(t);if(d)return d==e;var m=!0;o.set(t,e);for(var b=s;++f<u;){h=a[f];var y=t[h],E=e[h];if(n)var F=s?n(E,y,h,e,t,o):n(y,E,h,t,e,o);if(!(F===void 0?y===E||r(y,E,n,i,o):F)){m=!1;break}b||(b=h=="constructor")}if(m&&!b){var g=t.constructor,C=e.constructor;g!=C&&"constructor"in t&&"constructor"in e&&!(typeof g=="function"&&g instanceof g&&typeof C=="function"&&C instanceof C)&&(m=!1)}return o.delete(t),m}var NH=N1("length");function xf(t,e){var r=t.__data__;return UH(e)?r[typeof e=="string"?"string":"hash"]:r.map}function LH(t){for(var e=JH(t),r=e.length;r--;)e[r][2]=M1(e[r][1]);return e}function gs(t,e){var r=t[e];return GH(r)?r:void 0}function BH(t){return X7(Object(t))}function hn(t){return Vi.call(t)}(ty&&hn(new ty(new ArrayBuffer(1)))!=vf||bf&&hn(new bf)!=Fu||ry&&hn(ry.resolve())!=v1||ny&&hn(new ny)!=Ou||iy&&hn(new iy)!=Qg)&&(hn=function(t){var e=Vi.call(t),r=e==hs?t.constructor:void 0,n=r?Gi(r):void 0;if(n)switch(n){case Q7:return vf;case eH:return Fu;case tH:return v1;case rH:return Ou;case nH:return Qg}return e});function qH(t,e,r){e=Ff(e,t)?[e]:L1(e);for(var n,i=-1,s=e.length;++i<s;){var o=Of(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&&Af(s)&&q1(o,s)&&(Yn(t)||G1(t)||H1(t))}function MH(t){var e=t?t.length:void 0;return Af(e)&&(Yn(t)||G1(t)||H1(t))?H7(e,String):null}function q1(t,e){return e=e??C1,!!e&&(typeof t=="number"||j7.test(t))&&t>-1&&t%1==0&&t<e}function Ff(t,e){if(Yn(t))return!1;var r=typeof t;return r=="number"||r=="symbol"||r=="boolean"||t==null||W1(t)?!0:R7.test(t)||!P7.test(t)||e!=null&&t in Object(e)}function UH(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function HH(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||Cf;return t===r}function M1(t){return t===t&&!kf(t)}function U1(t,e){return function(r){return r==null?!1:r[t]===e&&(e!==void 0||t in Object(r))}}function Of(t){if(typeof t=="string"||W1(t))return t;var e=t+"";return e=="0"&&1/t==-w7?"-0":e}function Gi(t){if(t!=null){try{return $1.call(t)}catch{}try{return t+""}catch{}}return""}function VH(t,e){return t===e||t!==t&&e!==e}function H1(t){return zH(t)&&Mi.call(t,"callee")&&(!Y7.call(t,"callee")||Vi.call(t)==Df)}var Yn=Array.isArray;function V1(t){return t!=null&&Af(NH(t))&&!z1(t)}function zH(t){return Tu(t)&&V1(t)}function z1(t){var e=kf(t)?Vi.call(t):"";return e==O1||e==_7}function Af(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=C1}function kf(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function Tu(t){return!!t&&typeof t=="object"}function GH(t){if(!kf(t))return!1;var e=z1(t)||ey(t)?K7:I7;return e.test(Gi(t))}function G1(t){return typeof t=="string"||!Yn(t)&&Tu(t)&&Vi.call(t)==ay}function W1(t){return typeof t=="symbol"||Tu(t)&&Vi.call(t)==T1}function WH(t){return Tu(t)&&Af(t.length)&&!!Re[Vi.call(t)]}function KH(t,e,r){var n=t==null?void 0:I1(t,e);return n===void 0?r:n}function YH(t,e){return t!=null&&qH(t,e,xH)}function oy(t){var e=HH(t);if(!(e||V1(t)))return kH(t);var r=MH(t),n=!!r,i=r||[],o=i.length;for(var s in t)j1(t,s)&&!(n&&(s=="length"||q1(s,o)))&&!(e&&s=="constructor")&&i.push(s);return i}var JH=$H(oy);function XH(t){return t}function ZH(t){return Ff(t)?N1(Of(t)):RH(t)}ps.exports=AH});var Q1=D((Wi,ys)=>{var QH=1/0,eV="[object Function]",tV="[object GeneratorFunction]",rV=/[\\^$.*+?()[\]{}|]/g,nV=/^\[object .+?Constructor\]$/,Pu={function:!0,object:!0},iV=Pu[typeof Wi]&&Wi&&!Wi.nodeType?Wi:void 0,oV=Pu[typeof ys]&&ys&&!ys.nodeType?ys:void 0,sV=Tf(iV&&oV&&typeof global=="object"&&global),aV=Tf(Pu[typeof self]&&self),Y1=Tf(Pu[typeof window]&&window),ly=Tf(Pu[typeof Wi]&&Wi),uV=sV||Y1!==(ly&&ly.window)&&Y1||aV||ly||Function("return this")();function Tf(t){return t&&t.Object===Object?t:null}function lV(t){var e=!1;if(t!=null&&typeof t.toString!="function")try{e=!!(t+"")}catch{}return e}function cV(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}var J1=Object.prototype,X1=Function.prototype.toString,fV=J1.hasOwnProperty,dV=J1.toString,hV=RegExp("^"+X1.call(fV).replace(rV,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),cy=mV(uV,"Set"),pV=cy&&1/cV(new cy([,-0]))[1]==QH?function(t){return new cy(t)}:vV;function mV(t,e){var r=t[e];return DV(r)?r:void 0}function gV(t){if(t!=null){try{return X1.call(t)}catch{}try{return t+""}catch{}}return""}function yV(t){var e=Z1(t)?dV.call(t):"";return e==eV||e==tV}function Z1(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function DV(t){if(!Z1(t))return!1;var e=yV(t)||lV(t)?hV:nV;return e.test(gV(t))}function vV(){}ys.exports=pV});var tx=D((Ki,Ds)=>{var Ru={function:!0,object:!0},bV=Ru[typeof Ki]&&Ki&&!Ki.nodeType?Ki:void 0,wV=Ru[typeof Ds]&&Ds&&!Ds.nodeType?Ds:void 0,_V=Pf(bV&&wV&&typeof global=="object"&&global),EV=Pf(Ru[typeof self]&&self),ex=Pf(Ru[typeof window]&&window),fy=Pf(Ru[typeof Ki]&&Ki),CV=_V||ex!==(fy&&fy.window)&&ex||EV||fy||Function("return this")();function Pf(t){return t&&t.Object===Object?t:null}Ds.exports=CV});var ax=D(($le,sx)=>{var SV=Q1(),xV=tx(),FV=200,dy="__lodash_hash_undefined__",OV="[object Function]",AV="[object GeneratorFunction]",kV=/[\\^$.*+?()[\]{}|]/g,TV=/^\[object .+?Constructor\]$/;function PV(t,e){return!!t.length&&$V(t,e,0)>-1}function RV(t,e,r){for(var n=-1,i=t.length;++n<i;)if(r(e,t[n]))return!0;return!1}function $V(t,e,r){if(e!==e)return jV(t,r);for(var n=r-1,i=t.length;++n<i;)if(t[n]===e)return n;return-1}function IV(t,e){return t.has(e)}function jV(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 NV(t){var e=!1;if(t!=null&&typeof t.toString!="function")try{e=!!(t+"")}catch{}return e}function LV(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}var BV=Array.prototype,rx=Object.prototype,nx=Function.prototype.toString,hy=rx.hasOwnProperty,qV=rx.toString,MV=RegExp("^"+nx.call(hy).replace(kV,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),UV=BV.splice,HV=ix(xV,"Map"),$u=ix(Object,"create");function Yi(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function VV(){this.__data__=$u?$u(null):{}}function zV(t){return this.has(t)&&delete this.__data__[t]}function GV(t){var e=this.__data__;if($u){var r=e[t];return r===dy?void 0:r}return hy.call(e,t)?e[t]:void 0}function WV(t){var e=this.__data__;return $u?e[t]!==void 0:hy.call(e,t)}function KV(t,e){var r=this.__data__;return r[t]=$u&&e===void 0?dy:e,this}Yi.prototype.clear=VV;Yi.prototype.delete=zV;Yi.prototype.get=GV;Yi.prototype.has=WV;Yi.prototype.set=KV;function vs(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 YV(){this.__data__=[]}function JV(t){var e=this.__data__,r=$f(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():UV.call(e,r,1),!0}function XV(t){var e=this.__data__,r=$f(e,t);return r<0?void 0:e[r][1]}function ZV(t){return $f(this.__data__,t)>-1}function QV(t,e){var r=this.__data__,n=$f(r,t);return n<0?r.push([t,e]):r[n][1]=e,this}vs.prototype.clear=YV;vs.prototype.delete=JV;vs.prototype.get=XV;vs.prototype.has=ZV;vs.prototype.set=QV;function bs(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function ez(){this.__data__={hash:new Yi,map:new(HV||vs),string:new Yi}}function tz(t){return If(this,t).delete(t)}function rz(t){return If(this,t).get(t)}function nz(t){return If(this,t).has(t)}function iz(t,e){return If(this,t).set(t,e),this}bs.prototype.clear=ez;bs.prototype.delete=tz;bs.prototype.get=rz;bs.prototype.has=nz;bs.prototype.set=iz;function Rf(t){var e=-1,r=t?t.length:0;for(this.__data__=new bs;++e<r;)this.add(t[e])}function oz(t){return this.__data__.set(t,dy),this}function sz(t){return this.__data__.has(t)}Rf.prototype.add=Rf.prototype.push=oz;Rf.prototype.has=sz;function $f(t,e){for(var r=t.length;r--;)if(cz(t[r][0],e))return r;return-1}function az(t,e,r){var n=-1,i=PV,o=t.length,s=!0,a=[],u=a;if(r)s=!1,i=RV;else if(o>=FV){var l=e?null:SV(t);if(l)return LV(l);s=!1,i=IV,u=new Rf}else u=e?[]:a;e:for(;++n<o;){var c=t[n],f=e?e(c):c;if(c=r||c!==0?c:0,s&&f===f){for(var h=u.length;h--;)if(u[h]===f)continue e;e&&u.push(f),a.push(c)}else i(u,f,r)||(u!==a&&u.push(f),a.push(c))}return a}function If(t,e){var r=t.__data__;return uz(e)?r[typeof e=="string"?"string":"hash"]:r.map}function ix(t,e){var r=t[e];return dz(r)?r:void 0}function uz(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function lz(t){if(t!=null){try{return nx.call(t)}catch{}try{return t+""}catch{}}return""}function cz(t,e){return t===e||t!==t&&e!==e}function fz(t){var e=ox(t)?qV.call(t):"";return e==OV||e==AV}function ox(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function dz(t){if(!ox(t))return!1;var e=fz(t)||NV(t)?MV:TV;return e.test(lz(t))}sx.exports=az});var lx=D((Ile,ux)=>{var hz=K1(),pz=ax();function mz(t,e){return t&&t.length?pz(t,hz(e)):[]}ux.exports=mz});var fx=D((jle,cx)=>{"use strict";var gz=s1(),yz=lx(),Dz=gz("MultiError");cx.exports=py;function py(t){if(!(this instanceof py))return new py(t);if(t=Array.isArray(t)?t:[t],t=yz(t,function(r){return r.stack}),t.length===1)return t[0];var e=new Dz({message:t.map(function(r){return r.message}).join("; "),errors:t.reduce(function(r,n){return r.concat(n.errors||n)},[])});return e.__defineGetter__("stack",function(){return t.map(function(r){return r.stack}).join(`
34
34
 
35
35
  `)}),e.__defineSetter__("stack",function(r){return[r].concat(e.stack).join(`
36
36
 
37
- `)}),e}});var hx=y((Nle,dx)=>{var Jn=require("constants"),vz=process.cwd,jf=null,bz=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return jf||(jf=vz.call(process)),jf};try{process.cwd()}catch{}typeof process.chdir=="function"&&(my=process.chdir,process.chdir=function(t){jf=null,my.call(process,t)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,my));var my;dx.exports=wz;function wz(t){Jn.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&e(t),t.lutimes||r(t),t.chown=o(t.chown),t.fchown=o(t.fchown),t.lchown=o(t.lchown),t.chmod=n(t.chmod),t.fchmod=n(t.fchmod),t.lchmod=n(t.lchmod),t.chownSync=s(t.chownSync),t.fchownSync=s(t.fchownSync),t.lchownSync=s(t.lchownSync),t.chmodSync=i(t.chmodSync),t.fchmodSync=i(t.fchmodSync),t.lchmodSync=i(t.lchmodSync),t.stat=a(t.stat),t.fstat=a(t.fstat),t.lstat=a(t.lstat),t.statSync=u(t.statSync),t.fstatSync=u(t.fstatSync),t.lstatSync=u(t.lstatSync),t.chmod&&!t.lchmod&&(t.lchmod=function(c,f,h){h&&process.nextTick(h)},t.lchmodSync=function(){}),t.chown&&!t.lchown&&(t.lchown=function(c,f,h,d){d&&process.nextTick(d)},t.lchownSync=function(){}),bz==="win32"&&(t.rename=typeof t.rename!="function"?t.rename:function(c){function f(h,d,m){var b=Date.now(),D=0;c(h,d,function _(F){if(F&&(F.code==="EACCES"||F.code==="EPERM"||F.code==="EBUSY")&&Date.now()-b<6e4){setTimeout(function(){t.stat(d,function(g,C){g&&g.code==="ENOENT"?c(h,d,_):m(F)})},D),D<100&&(D+=10);return}m&&m(F)})}return Object.setPrototypeOf&&Object.setPrototypeOf(f,c),f}(t.rename)),t.read=typeof t.read!="function"?t.read:function(c){function f(h,d,m,b,D,_){var F;if(_&&typeof _=="function"){var g=0;F=function(C,A,T){if(C&&C.code==="EAGAIN"&&g<10)return g++,c.call(t,h,d,m,b,D,F);_.apply(this,arguments)}}return c.call(t,h,d,m,b,D,F)}return Object.setPrototypeOf&&Object.setPrototypeOf(f,c),f}(t.read),t.readSync=typeof t.readSync!="function"?t.readSync:function(c){return function(f,h,d,m,b){for(var D=0;;)try{return c.call(t,f,h,d,m,b)}catch(_){if(_.code==="EAGAIN"&&D<10){D++;continue}throw _}}}(t.readSync);function e(c){c.lchmod=function(f,h,d){c.open(f,Jn.O_WRONLY|Jn.O_SYMLINK,h,function(m,b){if(m){d&&d(m);return}c.fchmod(b,h,function(D){c.close(b,function(_){d&&d(D||_)})})})},c.lchmodSync=function(f,h){var d=c.openSync(f,Jn.O_WRONLY|Jn.O_SYMLINK,h),m=!0,b;try{b=c.fchmodSync(d,h),m=!1}finally{if(m)try{c.closeSync(d)}catch{}else c.closeSync(d)}return b}}function r(c){Jn.hasOwnProperty("O_SYMLINK")&&c.futimes?(c.lutimes=function(f,h,d,m){c.open(f,Jn.O_SYMLINK,function(b,D){if(b){m&&m(b);return}c.futimes(D,h,d,function(_){c.close(D,function(F){m&&m(_||F)})})})},c.lutimesSync=function(f,h,d){var m=c.openSync(f,Jn.O_SYMLINK),b,D=!0;try{b=c.futimesSync(m,h,d),D=!1}finally{if(D)try{c.closeSync(m)}catch{}else c.closeSync(m)}return b}):c.futimes&&(c.lutimes=function(f,h,d,m){m&&process.nextTick(m)},c.lutimesSync=function(){})}function n(c){return c&&function(f,h,d){return c.call(t,f,h,function(m){l(m)&&(m=null),d&&d.apply(this,arguments)})}}function i(c){return c&&function(f,h){try{return c.call(t,f,h)}catch(d){if(!l(d))throw d}}}function o(c){return c&&function(f,h,d,m){return c.call(t,f,h,d,function(b){l(b)&&(b=null),m&&m.apply(this,arguments)})}}function s(c){return c&&function(f,h,d){try{return c.call(t,f,h,d)}catch(m){if(!l(m))throw m}}}function a(c){return c&&function(f,h,d){typeof h=="function"&&(d=h,h=null);function m(b,D){D&&(D.uid<0&&(D.uid+=4294967296),D.gid<0&&(D.gid+=4294967296)),d&&d.apply(this,arguments)}return h?c.call(t,f,h,m):c.call(t,f,m)}}function u(c){return c&&function(f,h){var d=h?c.call(t,f,h):c.call(t,f);return d&&(d.uid<0&&(d.uid+=4294967296),d.gid<0&&(d.gid+=4294967296)),d}}function l(c){if(!c||c.code==="ENOSYS")return!0;var f=!process.getuid||process.getuid()!==0;return!!(f&&(c.code==="EINVAL"||c.code==="EPERM"))}}});var gx=y((Lle,mx)=>{var px=require("stream").Stream;mx.exports=_z;function _z(t){return{ReadStream:e,WriteStream:r};function e(n,i){if(!(this instanceof e))return new e(n,i);px.call(this);var o=this;this.path=n,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=64*1024,i=i||{};for(var s=Object.keys(i),a=0,u=s.length;a<u;a++){var l=s[a];this[l]=i[l]}if(this.encoding&&this.setEncoding(this.encoding),this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.end===void 0)this.end=1/0;else if(typeof this.end!="number")throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}if(this.fd!==null){process.nextTick(function(){o._read()});return}t.open(this.path,this.flags,this.mode,function(c,f){if(c){o.emit("error",c),o.readable=!1;return}o.fd=f,o.emit("open",f),o._read()})}function r(n,i){if(!(this instanceof r))return new r(n,i);px.call(this),this.path=n,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,i=i||{};for(var o=Object.keys(i),s=0,a=o.length;s<a;s++){var u=o[s];this[u]=i[u]}if(this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start}this.busy=!1,this._queue=[],this.fd===null&&(this._open=t.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}});var Dx=y((Ble,yx)=>{"use strict";yx.exports=Cz;var Ez=Object.getPrototypeOf||function(t){return t.__proto__};function Cz(t){if(t===null||typeof t!="object")return t;if(t instanceof Object)var e={__proto__:Ez(t)};else var e=Object.create(null);return Object.getOwnPropertyNames(t).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}});var Xn=y((qle,Dy)=>{var ze=require("fs"),Sz=hx(),xz=gx(),Fz=Dx(),Nf=require("util"),wt,Bf;typeof Symbol=="function"&&typeof Symbol.for=="function"?(wt=Symbol.for("graceful-fs.queue"),Bf=Symbol.for("graceful-fs.previous")):(wt="___graceful-fs.queue",Bf="___graceful-fs.previous");function Oz(){}function wx(t,e){Object.defineProperty(t,wt,{get:function(){return e}})}var Ji=Oz;Nf.debuglog?Ji=Nf.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(Ji=function(){var t=Nf.format.apply(Nf,arguments);t="GFS4: "+t.split(/\n/).join(`
38
- GFS4: `),console.error(t)});ze[wt]||(vx=global[wt]||[],wx(ze,vx),ze.close=function(t){function e(r,n){return t.call(ze,r,function(i){i||bx(),typeof n=="function"&&n.apply(this,arguments)})}return Object.defineProperty(e,Bf,{value:t}),e}(ze.close),ze.closeSync=function(t){function e(r){t.apply(ze,arguments),bx()}return Object.defineProperty(e,Bf,{value:t}),e}(ze.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){Ji(ze[wt]),require("assert").equal(ze[wt].length,0)}));var vx;global[wt]||wx(global,ze[wt]);Dy.exports=gy(Fz(ze));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!ze.__patched&&(Dy.exports=gy(ze),ze.__patched=!0);function gy(t){Sz(t),t.gracefulify=gy,t.createReadStream=A,t.createWriteStream=T;var e=t.readFile;t.readFile=r;function r(S,I,$){return typeof I=="function"&&($=I,I=null),B(S,I,$);function B(q,K,V,E){return e(q,K,function(v){v&&(v.code==="EMFILE"||v.code==="ENFILE")?ws([B,[q,K,V],v,E||Date.now(),Date.now()]):typeof V=="function"&&V.apply(this,arguments)})}}var n=t.writeFile;t.writeFile=i;function i(S,I,$,B){return typeof $=="function"&&(B=$,$=null),q(S,I,$,B);function q(K,V,E,v,w){return n(K,V,E,function(O){O&&(O.code==="EMFILE"||O.code==="ENFILE")?ws([q,[K,V,E,v],O,w||Date.now(),Date.now()]):typeof v=="function"&&v.apply(this,arguments)})}}var o=t.appendFile;o&&(t.appendFile=s);function s(S,I,$,B){return typeof $=="function"&&(B=$,$=null),q(S,I,$,B);function q(K,V,E,v,w){return o(K,V,E,function(O){O&&(O.code==="EMFILE"||O.code==="ENFILE")?ws([q,[K,V,E,v],O,w||Date.now(),Date.now()]):typeof v=="function"&&v.apply(this,arguments)})}}var a=t.copyFile;a&&(t.copyFile=u);function u(S,I,$,B){return typeof $=="function"&&(B=$,$=0),q(S,I,$,B);function q(K,V,E,v,w){return a(K,V,E,function(O){O&&(O.code==="EMFILE"||O.code==="ENFILE")?ws([q,[K,V,E,v],O,w||Date.now(),Date.now()]):typeof v=="function"&&v.apply(this,arguments)})}}var l=t.readdir;t.readdir=f;var c=/^v[0-5]\./;function f(S,I,$){typeof I=="function"&&($=I,I=null);var B=c.test(process.version)?function(V,E,v,w){return l(V,q(V,E,v,w))}:function(V,E,v,w){return l(V,E,q(V,E,v,w))};return B(S,I,$);function q(K,V,E,v){return function(w,O){w&&(w.code==="EMFILE"||w.code==="ENFILE")?ws([B,[K,V,E],w,v||Date.now(),Date.now()]):(O&&O.sort&&O.sort(),typeof E=="function"&&E.call(this,w,O))}}}if(process.version.substr(0,4)==="v0.8"){var h=xz(t);_=h.ReadStream,g=h.WriteStream}var d=t.ReadStream;d&&(_.prototype=Object.create(d.prototype),_.prototype.open=F);var m=t.WriteStream;m&&(g.prototype=Object.create(m.prototype),g.prototype.open=C),Object.defineProperty(t,"ReadStream",{get:function(){return _},set:function(S){_=S},enumerable:!0,configurable:!0}),Object.defineProperty(t,"WriteStream",{get:function(){return g},set:function(S){g=S},enumerable:!0,configurable:!0});var b=_;Object.defineProperty(t,"FileReadStream",{get:function(){return b},set:function(S){b=S},enumerable:!0,configurable:!0});var D=g;Object.defineProperty(t,"FileWriteStream",{get:function(){return D},set:function(S){D=S},enumerable:!0,configurable:!0});function _(S,I){return this instanceof _?(d.apply(this,arguments),this):_.apply(Object.create(_.prototype),arguments)}function F(){var S=this;L(S.path,S.flags,S.mode,function(I,$){I?(S.autoClose&&S.destroy(),S.emit("error",I)):(S.fd=$,S.emit("open",$),S.read())})}function g(S,I){return this instanceof g?(m.apply(this,arguments),this):g.apply(Object.create(g.prototype),arguments)}function C(){var S=this;L(S.path,S.flags,S.mode,function(I,$){I?(S.destroy(),S.emit("error",I)):(S.fd=$,S.emit("open",$))})}function A(S,I){return new t.ReadStream(S,I)}function T(S,I){return new t.WriteStream(S,I)}var x=t.open;t.open=L;function L(S,I,$,B){return typeof $=="function"&&(B=$,$=null),q(S,I,$,B);function q(K,V,E,v,w){return x(K,V,E,function(O,j){O&&(O.code==="EMFILE"||O.code==="ENFILE")?ws([q,[K,V,E,v],O,w||Date.now(),Date.now()]):typeof v=="function"&&v.apply(this,arguments)})}}return t}function ws(t){Ji("ENQUEUE",t[0].name,t[1]),ze[wt].push(t),yy()}var Lf;function bx(){for(var t=Date.now(),e=0;e<ze[wt].length;++e)ze[wt][e].length>2&&(ze[wt][e][3]=t,ze[wt][e][4]=t);yy()}function yy(){if(clearTimeout(Lf),Lf=void 0,ze[wt].length!==0){var t=ze[wt].shift(),e=t[0],r=t[1],n=t[2],i=t[3],o=t[4];if(i===void 0)Ji("RETRY",e.name,r),e.apply(null,r);else if(Date.now()-i>=6e4){Ji("TIMEOUT",e.name,r);var s=r.pop();typeof s=="function"&&s.call(null,n)}else{var a=Date.now()-o,u=Math.max(o-i,1),l=Math.min(u*1.2,100);a>=l?(Ji("RETRY",e.name,r),e.apply(null,r.concat([i]))):ze[wt].push(t)}Lf===void 0&&(Lf=setTimeout(yy,0))}}});var Ex=y((Mle,_x)=>{function pr(t,e){typeof e=="boolean"&&(e={forever:e}),this._originalTimeouts=JSON.parse(JSON.stringify(t)),this._timeouts=t,this._options=e||{},this._maxRetryTime=e&&e.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}_x.exports=pr;pr.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts};pr.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timeouts=[],this._cachedTimeouts=null};pr.prototype.retry=function(t){if(this._timeout&&clearTimeout(this._timeout),!t)return!1;var e=new Date().getTime();if(t&&e-this._operationStart>=this._maxRetryTime)return this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(t);var r=this._timeouts.shift();if(r===void 0)if(this._cachedTimeouts)this._errors.splice(this._errors.length-1,this._errors.length),this._timeouts=this._cachedTimeouts.slice(0),r=this._timeouts.shift();else return!1;var n=this,i=setTimeout(function(){n._attempts++,n._operationTimeoutCb&&(n._timeout=setTimeout(function(){n._operationTimeoutCb(n._attempts)},n._operationTimeout),n._options.unref&&n._timeout.unref()),n._fn(n._attempts)},r);return this._options.unref&&i.unref(),!0};pr.prototype.attempt=function(t,e){this._fn=t,e&&(e.timeout&&(this._operationTimeout=e.timeout),e.cb&&(this._operationTimeoutCb=e.cb));var r=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){r._operationTimeoutCb()},r._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)};pr.prototype.try=function(t){console.log("Using RetryOperation.try() is deprecated"),this.attempt(t)};pr.prototype.start=function(t){console.log("Using RetryOperation.start() is deprecated"),this.attempt(t)};pr.prototype.start=pr.prototype.try;pr.prototype.errors=function(){return this._errors};pr.prototype.attempts=function(){return this._attempts};pr.prototype.mainError=function(){if(this._errors.length===0)return null;for(var t={},e=null,r=0,n=0;n<this._errors.length;n++){var i=this._errors[n],o=i.message,s=(t[o]||0)+1;t[o]=s,s>=r&&(e=i,r=s)}return e}});var Cx=y(Xi=>{var Az=Ex();Xi.operation=function(t){var e=Xi.timeouts(t);return new Az(e,{forever:t&&t.forever,unref:t&&t.unref,maxRetryTime:t&&t.maxRetryTime})};Xi.timeouts=function(t){if(t instanceof Array)return[].concat(t);var e={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var r in t)e[r]=t[r];if(e.minTimeout>e.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var n=[],i=0;i<e.retries;i++)n.push(this.createTimeout(i,e));return t&&t.forever&&!n.length&&n.push(this.createTimeout(i,e)),n.sort(function(o,s){return o-s}),n};Xi.createTimeout=function(t,e){var r=e.randomize?Math.random()+1:1,n=Math.round(r*e.minTimeout*Math.pow(e.factor,t));return n=Math.min(n,e.maxTimeout),n};Xi.wrap=function(t,e,r){if(e instanceof Array&&(r=e,e=null),!r){r=[];for(var n in t)typeof t[n]=="function"&&r.push(n)}for(var i=0;i<r.length;i++){var o=r[i],s=t[o];t[o]=function(u){var l=Xi.operation(e),c=Array.prototype.slice.call(arguments,1),f=c.pop();c.push(function(h){l.retry(h)||(h&&(arguments[0]=l.mainError()),f.apply(this,arguments))}),l.attempt(function(){u.apply(t,c)})}.bind(t,s),t[o].options=e}}});var xx=y((Hle,Sx)=>{Sx.exports=Cx()});var Fx=y((Vle,qf)=>{qf.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];process.platform!=="win32"&&qf.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&qf.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")});var wy=y((zle,Cs)=>{var Be=global.process,Zi=function(t){return t&&typeof t=="object"&&typeof t.removeListener=="function"&&typeof t.emit=="function"&&typeof t.reallyExit=="function"&&typeof t.listeners=="function"&&typeof t.kill=="function"&&typeof t.pid=="number"&&typeof t.on=="function"};Zi(Be)?(Ox=require("assert"),_s=Fx(),Ax=/^win/i.test(Be.platform),Iu=require("events"),typeof Iu!="function"&&(Iu=Iu.EventEmitter),Be.__signal_exit_emitter__?ft=Be.__signal_exit_emitter__:(ft=Be.__signal_exit_emitter__=new Iu,ft.count=0,ft.emitted={}),ft.infinite||(ft.setMaxListeners(1/0),ft.infinite=!0),Cs.exports=function(t,e){if(!Zi(global.process))return function(){};Ox.equal(typeof t,"function","a callback must be provided for exit handler"),Es===!1&&vy();var r="exit";e&&e.alwaysLast&&(r="afterexit");var n=function(){ft.removeListener(r,t),ft.listeners("exit").length===0&&ft.listeners("afterexit").length===0&&Mf()};return ft.on(r,t),n},Mf=function(){!Es||!Zi(global.process)||(Es=!1,_s.forEach(function(e){try{Be.removeListener(e,Uf[e])}catch{}}),Be.emit=Hf,Be.reallyExit=by,ft.count-=1)},Cs.exports.unload=Mf,Qi=function(e,r,n){ft.emitted[e]||(ft.emitted[e]=!0,ft.emit(e,r,n))},Uf={},_s.forEach(function(t){Uf[t]=function(){if(Zi(global.process)){var r=Be.listeners(t);r.length===ft.count&&(Mf(),Qi("exit",null,t),Qi("afterexit",null,t),Ax&&t==="SIGHUP"&&(t="SIGINT"),Be.kill(Be.pid,t))}}}),Cs.exports.signals=function(){return _s},Es=!1,vy=function(){Es||!Zi(global.process)||(Es=!0,ft.count+=1,_s=_s.filter(function(e){try{return Be.on(e,Uf[e]),!0}catch{return!1}}),Be.emit=Tx,Be.reallyExit=kx)},Cs.exports.load=vy,by=Be.reallyExit,kx=function(e){Zi(global.process)&&(Be.exitCode=e||0,Qi("exit",Be.exitCode,null),Qi("afterexit",Be.exitCode,null),by.call(Be,Be.exitCode))},Hf=Be.emit,Tx=function(e,r){if(e==="exit"&&Zi(global.process)){r!==void 0&&(Be.exitCode=r);var n=Hf.apply(this,arguments);return Qi("exit",Be.exitCode,null),Qi("afterexit",Be.exitCode,null),n}else return Hf.apply(this,arguments)}):Cs.exports=function(){return function(){}};var Ox,_s,Ax,Iu,ft,Mf,Qi,Uf,Es,vy,by,kx,Hf,Tx});var Rx=y((Gle,_y)=>{"use strict";var Px=Symbol();function kz(t,e,r){let n=e[Px];if(n)return e.stat(t,(o,s)=>{if(o)return r(o);r(null,s.mtime,n)});let i=new Date(Math.ceil(Date.now()/1e3)*1e3+5);e.utimes(t,i,i,o=>{if(o)return r(o);e.stat(t,(s,a)=>{if(s)return r(s);let u=a.mtime.getTime()%1e3===0?"s":"ms";Object.defineProperty(e,Px,{value:u}),r(null,a.mtime,u)})})}function Tz(t){let e=Date.now();return t==="s"&&(e=Math.ceil(e/1e3)*1e3),new Date(e)}_y.exports.probe=kz;_y.exports.getMtime=Tz});var Lx=y((Wle,Nu)=>{"use strict";var Pz=require("path"),Sy=Xn(),Rz=xx(),$z=wy(),$x=Rx(),gn={};function ju(t,e){return e.lockfilePath||`${t}.lock`}function xy(t,e,r){if(!e.realpath)return r(null,Pz.resolve(t));e.fs.realpath(t,r)}function Cy(t,e,r){let n=ju(t,e);e.fs.mkdir(n,i=>{if(!i)return $x.probe(n,e.fs,(o,s,a)=>{if(o)return e.fs.rmdir(n,()=>{}),r(o);r(null,s,a)});if(i.code!=="EEXIST")return r(i);if(e.stale<=0)return r(Object.assign(new Error("Lock file is already being held"),{code:"ELOCKED",file:t}));e.fs.stat(n,(o,s)=>{if(o)return o.code==="ENOENT"?Cy(t,{...e,stale:0},r):r(o);if(!Ix(s,e))return r(Object.assign(new Error("Lock file is already being held"),{code:"ELOCKED",file:t}));jx(t,e,a=>{if(a)return r(a);Cy(t,{...e,stale:0},r)})})})}function Ix(t,e){return t.mtime.getTime()<Date.now()-e.stale}function jx(t,e,r){e.fs.rmdir(ju(t,e),n=>{if(n&&n.code!=="ENOENT")return r(n);r()})}function Vf(t,e){let r=gn[t];r.updateTimeout||(r.updateDelay=r.updateDelay||e.update,r.updateTimeout=setTimeout(()=>{r.updateTimeout=null,e.fs.stat(r.lockfilePath,(n,i)=>{let o=r.lastUpdate+e.stale<Date.now();if(n)return n.code==="ENOENT"||o?Ey(t,r,Object.assign(n,{code:"ECOMPROMISED"})):(r.updateDelay=1e3,Vf(t,e));if(!(r.mtime.getTime()===i.mtime.getTime()))return Ey(t,r,Object.assign(new Error("Unable to update lock within the stale threshold"),{code:"ECOMPROMISED"}));let a=$x.getMtime(r.mtimePrecision);e.fs.utimes(r.lockfilePath,a,a,u=>{let l=r.lastUpdate+e.stale<Date.now();if(!r.released){if(u)return u.code==="ENOENT"||l?Ey(t,r,Object.assign(u,{code:"ECOMPROMISED"})):(r.updateDelay=1e3,Vf(t,e));r.mtime=a,r.lastUpdate=Date.now(),r.updateDelay=null,Vf(t,e)}})})},r.updateDelay),r.updateTimeout.unref&&r.updateTimeout.unref())}function Ey(t,e,r){e.released=!0,e.updateTimeout&&clearTimeout(e.updateTimeout),gn[t]===e&&delete gn[t],e.options.onCompromised(r)}function Iz(t,e,r){e={stale:1e4,update:null,realpath:!0,retries:0,fs:Sy,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),xy(t,e,(n,i)=>{if(n)return r(n);let o=Rz.operation(e.retries);o.attempt(()=>{Cy(i,e,(s,a,u)=>{if(o.retry(s))return;if(s)return r(o.mainError());let l=gn[i]={lockfilePath:ju(i,e),mtime:a,mtimePrecision:u,options:e,lastUpdate:Date.now()};Vf(i,e),r(null,c=>{if(l.released)return c&&c(Object.assign(new Error("Lock is already released"),{code:"ERELEASED"}));Nx(i,{...e,realpath:!1},c)})})})})}function Nx(t,e,r){e={fs:Sy,realpath:!0,...e},xy(t,e,(n,i)=>{if(n)return r(n);let o=gn[i];if(!o)return r(Object.assign(new Error("Lock is not acquired/owned by you"),{code:"ENOTACQUIRED"}));o.updateTimeout&&clearTimeout(o.updateTimeout),o.released=!0,delete gn[i],jx(i,e,r)})}function jz(t,e,r){e={stale:1e4,realpath:!0,fs:Sy,...e},e.stale=Math.max(e.stale||0,2e3),xy(t,e,(n,i)=>{if(n)return r(n);e.fs.stat(ju(i,e),(o,s)=>o?o.code==="ENOENT"?r(null,!1):r(o):r(null,!Ix(s,e)))})}function Nz(){return gn}$z(()=>{for(let t in gn){let e=gn[t].options;try{e.fs.rmdirSync(ju(t,e))}catch{}}});Nu.exports.lock=Iz;Nu.exports.unlock=Nx;Nu.exports.check=jz;Nu.exports.getLocks=Nz});var qx=y((Kle,Bx)=>{"use strict";var Lz=Xn();function Bz(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 qz(t){return(...e)=>new Promise((r,n)=>{e.push((i,o)=>{i?n(i):r(o)}),t(...e)})}function Mz(t){return(...e)=>{let r,n;if(e.push((i,o)=>{r=i,n=o}),t(...e),r)throw r;return n}}function Uz(t){if(t={...t},t.fs=Bz(t.fs||Lz),typeof t.retries=="number"&&t.retries>0||t.retries&&typeof t.retries.retries=="number"&&t.retries.retries>0)throw Object.assign(new Error("Cannot use retries with the sync api"),{code:"ESYNC"});return t}Bx.exports={toPromise:qz,toSync:Mz,toSyncOptions:Uz}});var Ux=y((Yle,Zn)=>{"use strict";var Ss=Lx(),{toPromise:zf,toSync:Gf,toSyncOptions:Fy}=qx();async function Mx(t,e){let r=await zf(Ss.lock)(t,e);return zf(r)}function Hz(t,e){let r=Gf(Ss.lock)(t,Fy(e));return Gf(r)}function Vz(t,e){return zf(Ss.unlock)(t,e)}function zz(t,e){return Gf(Ss.unlock)(t,Fy(e))}function Gz(t,e){return zf(Ss.check)(t,e)}function Wz(t,e){return Gf(Ss.check)(t,Fy(e))}Zn.exports=Mx;Zn.exports.lock=Mx;Zn.exports.unlock=Vz;Zn.exports.lockSync=Hz;Zn.exports.unlockSync=zz;Zn.exports.check=Gz;Zn.exports.checkSync=Wz});var Wx=y(xs=>{"use strict";Object.defineProperty(xs,"__esModule",{value:!0});xs.canStoreURLs=xs.FileUrlStorage=void 0;var Hx=require("fs"),Kz=Jz(fx()),Vx=Yz(Ux());function Gx(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,r=new WeakMap;return(Gx=function(n){return n?r:e})(t)}function Yz(t,e){if(!e&&t&&t.__esModule)return t;if(t===null||typeof t!="object"&&typeof t!="function")return{default:t};var r=Gx(e);if(r&&r.has(t))return r.get(t);var n={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in t)if(o!=="default"&&{}.hasOwnProperty.call(t,o)){var s=i?Object.getOwnPropertyDescriptor(t,o):null;s&&(s.get||s.set)?Object.defineProperty(n,o,s):n[o]=t[o]}return n.default=t,r&&r.set(t,n),n}function Jz(t){return t&&t.__esModule?t:{default:t}}function Lu(t){"@babel/helpers - typeof";return Lu=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},Lu(t)}function Xz(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function zx(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Qz(n.key),n)}}function Zz(t,e,r){return e&&zx(t.prototype,e),r&&zx(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function Qz(t){var e=eG(t,"string");return Lu(e)=="symbol"?e:e+""}function eG(t,e){if(Lu(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Lu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Jle=xs.canStoreURLs=!0,Xle=xs.FileUrlStorage=function(){function t(e){Xz(this,t),this.path=e}return Zz(t,[{key:"findAllUploads",value:function(){var r=this;return new Promise(function(n,i){r._getItems("tus::",function(o,s){o?i(o):n(s)})})}},{key:"findUploadsByFingerprint",value:function(r){var n=this;return new Promise(function(i,o){n._getItems("tus::".concat(r),function(s,a){s?o(s):i(a)})})}},{key:"removeUpload",value:function(r){var n=this;return new Promise(function(i,o){n._removeItem(r,function(s){s?o(s):i()})})}},{key:"addUpload",value:function(r,n){var i=this,o=Math.round(Math.random()*1e12),s="tus::".concat(r,"::").concat(o);return new Promise(function(a,u){i._setItem(s,n,function(l){l?u(l):a(s)})})}},{key:"_setItem",value:function(r,n,i){var o=this;Vx.lock(this.path,this._lockfileOptions()).then(function(s){i=o._releaseAndCb(s,i),o._getData(function(a,u){if(a){i(a);return}u[r]=n,o._writeData(u,function(l){return i(l)})})}).catch(i)}},{key:"_getItems",value:function(r,n){this._getData(function(i,o){if(i){n(i);return}var s=Object.keys(o).filter(function(a){return a.startsWith(r)}).map(function(a){var u=o[a];return u.urlStorageKey=a,u});n(null,s)})}},{key:"_removeItem",value:function(r,n){var i=this;Vx.lock(this.path,this._lockfileOptions()).then(function(o){n=i._releaseAndCb(o,n),i._getData(function(s,a){if(s){n(s);return}delete a[r],i._writeData(a,function(u){return n(u)})})}).catch(n)}},{key:"_lockfileOptions",value:function(){return{realpath:!1,retries:{retries:5,minTimeout:20}}}},{key:"_releaseAndCb",value:function(r,n){return function(i){if(i){r().then(function(){return n(i)}).catch(function(o){return n((0,Kz.default)([i,o]))});return}r().then(n).catch(n)}}},{key:"_writeData",value:function(r,n){var i={encoding:"utf8",mode:432,flag:"w"};(0,Hx.writeFile)(this.path,JSON.stringify(r),i,function(o){return n(o)})}},{key:"_getData",value:function(r){(0,Hx.readFile)(this.path,"utf8",function(n,i){if(n){n.code==="ENOENT"?r(null,{}):r(n);return}try{i=i.trim().length?JSON.parse(i):{}}catch(o){r(o);return}r(null,i)})}}])}()});var ky=y(Vt=>{"use strict";Object.defineProperty(Vt,"__esModule",{value:!0});Object.defineProperty(Vt,"DefaultHttpStack",{enumerable:!0,get:function(){return Xx.default}});Object.defineProperty(Vt,"DetailedError",{enumerable:!0,get:function(){return tG.default}});Object.defineProperty(Vt,"FileUrlStorage",{enumerable:!0,get:function(){return Zx.FileUrlStorage}});Object.defineProperty(Vt,"StreamSource",{enumerable:!0,get:function(){return sG.default}});Vt.Upload=void 0;Object.defineProperty(Vt,"canStoreURLs",{enumerable:!0,get:function(){return Zx.canStoreURLs}});Vt.defaultOptions=void 0;Object.defineProperty(Vt,"enableDebugLog",{enumerable:!0,get:function(){return rG.enableDebugLog}});Vt.isSupported=void 0;var tG=eo(Eg()),rG=Cg(),nG=eo(WC()),Oy=eo(ES()),iG=eo(jS()),oG=eo(qS()),Xx=eo(e1()),sG=eo(Lg()),Zx=Wx();function eo(t){return t&&t.__esModule?t:{default:t}}function Os(t){"@babel/helpers - typeof";return Os=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},Os(t)}function aG(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Kx(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,eF(n.key),n)}}function uG(t,e,r){return e&&Kx(t.prototype,e),r&&Kx(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function lG(t,e,r){return e=Wf(e),cG(t,Qx()?Reflect.construct(e,r||[],Wf(t).constructor):e.apply(t,r))}function cG(t,e){if(e&&(Os(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return fG(t)}function fG(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Qx(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Qx=function(){return!!t})()}function Wf(t){return Wf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Wf(t)}function dG(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&&Ay(t,e)}function Ay(t,e){return Ay=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Ay(t,e)}function Yx(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Fs(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Yx(Object(r),!0).forEach(function(n){hG(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Yx(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function hG(t,e,r){return e=eF(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function eF(t){var e=pG(t,"string");return Os(e)=="symbol"?e:e+""}function pG(t,e){if(Os(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Os(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Jx=Vt.defaultOptions=Fs(Fs({},Oy.default.defaultOptions),{},{httpStack:new Xx.default,fileReader:new iG.default,urlStorage:new nG.default,fingerprint:oG.default}),Qle=Vt.Upload=function(t){function e(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return aG(this,e),n=Fs(Fs({},Jx),n),lG(this,e,[r,n])}return dG(e,t),uG(e,null,[{key:"terminate",value:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return i=Fs(Fs({},Jx),i),Oy.default.terminate(n,i)}}])}(Oy.default),ece=Vt.isSupported=!0});var rr={};gi(rr,{__addDisposableResource:()=>SF,__assign:()=>Kf,__asyncDelegator:()=>yF,__asyncGenerator:()=>gF,__asyncValues:()=>DF,__await:()=>As,__awaiter:()=>cF,__classPrivateFieldGet:()=>_F,__classPrivateFieldIn:()=>CF,__classPrivateFieldSet:()=>EF,__createBinding:()=>Jf,__decorate:()=>nF,__disposeResources:()=>xF,__esDecorate:()=>oF,__exportStar:()=>dF,__extends:()=>tF,__generator:()=>fF,__importDefault:()=>wF,__importStar:()=>bF,__makeTemplateObject:()=>vF,__metadata:()=>lF,__param:()=>iF,__propKey:()=>aF,__read:()=>Ry,__rest:()=>rF,__rewriteRelativeImportExtension:()=>FF,__runInitializers:()=>sF,__setFunctionName:()=>uF,__spread:()=>hF,__spreadArray:()=>mF,__spreadArrays:()=>pF,__values:()=>Yf,default:()=>yG});function tF(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Ty(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}function rF(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}function nF(t,e,r,n){var i=arguments.length,o=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,r,o):s(e,r))||o);return i>3&&o&&Object.defineProperty(e,r,o),o}function iF(t,e){return function(r,n){e(r,n,t)}}function oF(t,e,r,n,i,o){function s(_){if(_!==void 0&&typeof _!="function")throw new TypeError("Function expected");return _}for(var a=n.kind,u=a==="getter"?"get":a==="setter"?"set":"value",l=!e&&t?n.static?t:t.prototype:null,c=e||(l?Object.getOwnPropertyDescriptor(l,n.name):{}),f,h=!1,d=r.length-1;d>=0;d--){var m={};for(var b in n)m[b]=b==="access"?{}:n[b];for(var b in n.access)m.access[b]=n.access[b];m.addInitializer=function(_){if(h)throw new TypeError("Cannot add initializers after decoration has completed");o.push(s(_||null))};var D=(0,r[d])(a==="accessor"?{get:c.get,set:c.set}:c[u],m);if(a==="accessor"){if(D===void 0)continue;if(D===null||typeof D!="object")throw new TypeError("Object expected");(f=s(D.get))&&(c.get=f),(f=s(D.set))&&(c.set=f),(f=s(D.init))&&i.unshift(f)}else(f=s(D))&&(a==="field"?i.unshift(f):c[u]=f)}l&&Object.defineProperty(l,n.name,c),h=!0}function sF(t,e,r){for(var n=arguments.length>2,i=0;i<e.length;i++)r=n?e[i].call(t,r):e[i].call(t);return n?r:void 0}function aF(t){return typeof t=="symbol"?t:"".concat(t)}function uF(t,e,r){return typeof e=="symbol"&&(e=e.description?"[".concat(e.description,"]"):""),Object.defineProperty(t,"name",{configurable:!0,value:r?"".concat(r," ",e):e})}function lF(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function cF(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(c){try{l(n.next(c))}catch(f){s(f)}}function u(c){try{l(n.throw(c))}catch(f){s(f)}}function l(c){c.done?o(c.value):i(c.value).then(a,u)}l((n=n.apply(t,e||[])).next())})}function fF(t,e){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,s=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(l){return function(c){return u([l,c])}}function u(l){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,l[0]&&(r=0)),r;)try{if(n=1,i&&(o=l[0]&2?i.return:l[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,l[1])).done)return o;switch(i=0,o&&(l=[l[0]&2,o.value]),l[0]){case 0:case 1:o=l;break;case 4:return r.label++,{value:l[1],done:!1};case 5:r.label++,i=l[1],l=[0];continue;case 7:l=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(l[0]===6||l[0]===2)){r=0;continue}if(l[0]===3&&(!o||l[1]>o[0]&&l[1]<o[3])){r.label=l[1];break}if(l[0]===6&&r.label<o[1]){r.label=o[1],o=l;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(l);break}o[2]&&r.ops.pop(),r.trys.pop();continue}l=e.call(t,r)}catch(c){l=[6,c],i=0}finally{n=o=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}function dF(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Jf(e,t,r)}function Yf(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 Ry(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,o=[],s;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(a){s={error:a}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return o}function hF(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(Ry(arguments[e]));return t}function pF(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var n=Array(t),i=0,e=0;e<r;e++)for(var o=arguments[e],s=0,a=o.length;s<a;s++,i++)n[i]=o[s];return n}function mF(t,e,r){if(r||arguments.length===2)for(var n=0,i=e.length,o;n<i;n++)(o||!(n in e))&&(o||(o=Array.prototype.slice.call(e,0,n)),o[n]=e[n]);return t.concat(o||Array.prototype.slice.call(e))}function As(t){return this instanceof As?(this.v=t,this):new As(t)}function gF(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(t,e||[]),i,o=[];return i=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),a("next"),a("throw"),a("return",s),i[Symbol.asyncIterator]=function(){return this},i;function s(d){return function(m){return Promise.resolve(m).then(d,f)}}function a(d,m){n[d]&&(i[d]=function(b){return new Promise(function(D,_){o.push([d,b,D,_])>1||u(d,b)})},m&&(i[d]=m(i[d])))}function u(d,m){try{l(n[d](m))}catch(b){h(o[0][3],b)}}function l(d){d.value instanceof As?Promise.resolve(d.value.v).then(c,f):h(o[0][2],d)}function c(d){u("next",d)}function f(d){u("throw",d)}function h(d,m){d(m),o.shift(),o.length&&u(o[0][0],o[0][1])}}function yF(t){var e,r;return e={},n("next"),n("throw",function(i){throw i}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(i,o){e[i]=t[i]?function(s){return(r=!r)?{value:As(t[i](s)),done:!1}:o?o(s):s}:o}}function DF(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof Yf=="function"?Yf(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(o){r[o]=t[o]&&function(s){return new Promise(function(a,u){s=t[o](s),i(a,u,s.done,s.value)})}}function i(o,s,a,u){Promise.resolve(u).then(function(l){o({value:l,done:a})},s)}}function vF(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function bF(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r=Py(t),n=0;n<r.length;n++)r[n]!=="default"&&Jf(e,t,r[n]);return mG(e,t),e}function wF(t){return t&&t.__esModule?t:{default:t}}function _F(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)}function EF(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r}function CF(t,e){if(e===null||typeof e!="object"&&typeof e!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof t=="function"?e===t:t.has(e)}function SF(t,e,r){if(e!=null){if(typeof e!="object"&&typeof e!="function")throw new TypeError("Object expected.");var n,i;if(r){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");n=e[Symbol.asyncDispose]}if(n===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");n=e[Symbol.dispose],r&&(i=n)}if(typeof n!="function")throw new TypeError("Object not disposable.");i&&(n=function(){try{i.call(this)}catch(o){return Promise.reject(o)}}),t.stack.push({value:e,dispose:n,async:r})}else r&&t.stack.push({async:!0});return e}function xF(t){function e(o){t.error=t.hasError?new gG(o,t.error,"An error was suppressed during disposal."):o,t.hasError=!0}var r,n=0;function i(){for(;r=t.stack.pop();)try{if(!r.async&&n===1)return n=0,t.stack.push(r),Promise.resolve().then(i);if(r.dispose){var o=r.dispose.call(r.value);if(r.async)return n|=2,Promise.resolve(o).then(i,function(s){return e(s),i()})}else n|=1}catch(s){e(s)}if(n===1)return t.hasError?Promise.reject(t.error):Promise.resolve();if(t.hasError)throw t.error}return i()}function FF(t,e){return typeof t=="string"&&/^\.\.?\//.test(t)?t.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(r,n,i,o,s){return n?e?".jsx":".js":i&&(!o||!s)?r:i+o+"."+s.toLowerCase()+"js"}):t}var Ty,Kf,Jf,mG,Py,gG,yG,nr=Ct(()=>{Ty=function(t,e){return Ty=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])},Ty(t,e)};Kf=function(){return Kf=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},Kf.apply(this,arguments)};Jf=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]};mG=Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e},Py=function(t){return Py=Object.getOwnPropertyNames||function(e){var r=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(r[r.length]=n);return r},Py(t)};gG=typeof SuppressedError=="function"?SuppressedError:function(t,e,r){var n=new Error(r);return n.name="SuppressedError",n.error=t,n.suppressed=e,n};yG={__extends:tF,__assign:Kf,__rest:rF,__decorate:nF,__param:iF,__esDecorate:oF,__runInitializers:sF,__propKey:aF,__setFunctionName:uF,__metadata:lF,__awaiter:cF,__generator:fF,__createBinding:Jf,__exportStar:dF,__values:Yf,__read:Ry,__spread:hF,__spreadArrays:pF,__spreadArray:mF,__await:As,__asyncGenerator:gF,__asyncDelegator:yF,__asyncValues:DF,__makeTemplateObject:vF,__importStar:bF,__importDefault:wF,__classPrivateFieldGet:_F,__classPrivateFieldSet:EF,__classPrivateFieldIn:CF,__addDisposableResource:SF,__disposeResources:xF,__rewriteRelativeImportExtension:FF}});var AF=y((rce,OF)=>{var ks=1e3,Ts=ks*60,Ps=Ts*60,to=Ps*24,DG=to*7,vG=to*365.25;OF.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return bG(t);if(r==="number"&&isFinite(t))return e.long?_G(t):wG(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function bG(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*vG;case"weeks":case"week":case"w":return r*DG;case"days":case"day":case"d":return r*to;case"hours":case"hour":case"hrs":case"hr":case"h":return r*Ps;case"minutes":case"minute":case"mins":case"min":case"m":return r*Ts;case"seconds":case"second":case"secs":case"sec":case"s":return r*ks;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}function wG(t){var e=Math.abs(t);return e>=to?Math.round(t/to)+"d":e>=Ps?Math.round(t/Ps)+"h":e>=Ts?Math.round(t/Ts)+"m":e>=ks?Math.round(t/ks)+"s":t+"ms"}function _G(t){var e=Math.abs(t);return e>=to?Xf(t,e,to,"day"):e>=Ps?Xf(t,e,Ps,"hour"):e>=Ts?Xf(t,e,Ts,"minute"):e>=ks?Xf(t,e,ks,"second"):t+" ms"}function Xf(t,e,r,n){var i=e>=r*1.5;return Math.round(t/r)+" "+n+(i?"s":"")}});var $y=y((nce,kF)=>{function EG(t){r.debug=r,r.default=r,r.coerce=u,r.disable=s,r.enable=i,r.enabled=a,r.humanize=AF(),r.destroy=l,Object.keys(t).forEach(c=>{r[c]=t[c]}),r.names=[],r.skips=[],r.formatters={};function e(c){let f=0;for(let h=0;h<c.length;h++)f=(f<<5)-f+c.charCodeAt(h),f|=0;return r.colors[Math.abs(f)%r.colors.length]}r.selectColor=e;function r(c){let f,h=null,d,m;function b(...D){if(!b.enabled)return;let _=b,F=Number(new Date),g=F-(f||F);_.diff=g,_.prev=f,_.curr=F,f=F,D[0]=r.coerce(D[0]),typeof D[0]!="string"&&D.unshift("%O");let C=0;D[0]=D[0].replace(/%([a-zA-Z%])/g,(T,x)=>{if(T==="%%")return"%";C++;let L=r.formatters[x];if(typeof L=="function"){let S=D[C];T=L.call(_,S),D.splice(C,1),C--}return T}),r.formatArgs.call(_,D),(_.log||r.log).apply(_,D)}return b.namespace=c,b.useColors=r.useColors(),b.color=r.selectColor(c),b.extend=n,b.destroy=r.destroy,Object.defineProperty(b,"enabled",{enumerable:!0,configurable:!1,get:()=>h!==null?h:(d!==r.namespaces&&(d=r.namespaces,m=r.enabled(c)),m),set:D=>{h=D}}),typeof r.init=="function"&&r.init(b),b}function n(c,f){let h=r(this.namespace+(typeof f>"u"?":":f)+c);return h.log=this.log,h}function i(c){r.save(c),r.namespaces=c,r.names=[],r.skips=[];let f=(typeof c=="string"?c:"").trim().replace(" ",",").split(",").filter(Boolean);for(let h of f)h[0]==="-"?r.skips.push(h.slice(1)):r.names.push(h)}function o(c,f){let h=0,d=0,m=-1,b=0;for(;h<c.length;)if(d<f.length&&(f[d]===c[h]||f[d]==="*"))f[d]==="*"?(m=d,b=h,d++):(h++,d++);else if(m!==-1)d=m+1,b++,h=b;else return!1;for(;d<f.length&&f[d]==="*";)d++;return d===f.length}function s(){let c=[...r.names,...r.skips.map(f=>"-"+f)].join(",");return r.enable(""),c}function a(c){for(let f of r.skips)if(o(c,f))return!1;for(let f of r.names)if(o(c,f))return!0;return!1}function u(c){return c instanceof Error?c.stack||c.message:c}function l(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return r.enable(r.load()),r}kF.exports=EG});var TF=y((ir,Zf)=>{ir.formatArgs=SG;ir.save=xG;ir.load=FG;ir.useColors=CG;ir.storage=OG();ir.destroy=(()=>{let t=!1;return()=>{t||(t=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();ir.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function CG(){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 SG(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+Zf.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;t.splice(1,0,e,"color: inherit");let r=0,n=0;t[0].replace(/%[a-zA-Z%]/g,i=>{i!=="%%"&&(r++,i==="%c"&&(n=r))}),t.splice(n,0,e)}ir.log=console.debug||console.log||(()=>{});function xG(t){try{t?ir.storage.setItem("debug",t):ir.storage.removeItem("debug")}catch{}}function FG(){let t;try{t=ir.storage.getItem("debug")}catch{}return!t&&typeof process<"u"&&"env"in process&&(t=process.env.DEBUG),t}function OG(){try{return localStorage}catch{}}Zf.exports=$y()(ir);var{formatters:AG}=Zf.exports;AG.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var RF=y((ice,PF)=>{"use strict";PF.exports=(t,e=process.argv)=>{let r=t.startsWith("-")?"":t.length===1?"-":"--",n=e.indexOf(r+t),i=e.indexOf("--");return n!==-1&&(i===-1||n<i)}});var jF=y((oce,IF)=>{"use strict";var kG=require("os"),$F=require("tty"),mr=RF(),{env:dt}=process,Qn;mr("no-color")||mr("no-colors")||mr("color=false")||mr("color=never")?Qn=0:(mr("color")||mr("colors")||mr("color=true")||mr("color=always"))&&(Qn=1);"FORCE_COLOR"in dt&&(dt.FORCE_COLOR==="true"?Qn=1:dt.FORCE_COLOR==="false"?Qn=0:Qn=dt.FORCE_COLOR.length===0?1:Math.min(parseInt(dt.FORCE_COLOR,10),3));function Iy(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}function jy(t,e){if(Qn===0)return 0;if(mr("color=16m")||mr("color=full")||mr("color=truecolor"))return 3;if(mr("color=256"))return 2;if(t&&!e&&Qn===void 0)return 0;let r=Qn||0;if(dt.TERM==="dumb")return r;if(process.platform==="win32"){let n=kG.release().split(".");return Number(n[0])>=10&&Number(n[2])>=10586?Number(n[2])>=14931?3:2:1}if("CI"in dt)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(n=>n in dt)||dt.CI_NAME==="codeship"?1:r;if("TEAMCITY_VERSION"in dt)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(dt.TEAMCITY_VERSION)?1:0;if(dt.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in dt){let n=parseInt((dt.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(dt.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(dt.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(dt.TERM)||"COLORTERM"in dt?1:r}function TG(t){let e=jy(t,t&&t.isTTY);return Iy(e)}IF.exports={supportsColor:TG,stdout:Iy(jy(!0,$F.isatty(1))),stderr:Iy(jy(!0,$F.isatty(2)))}});var LF=y((ht,ed)=>{var PG=require("tty"),Qf=require("util");ht.init=BG;ht.log=jG;ht.formatArgs=$G;ht.save=NG;ht.load=LG;ht.useColors=RG;ht.destroy=Qf.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");ht.colors=[6,2,3,4,5,1];try{let t=jF();t&&(t.stderr||t).level>=2&&(ht.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}ht.inspectOpts=Object.keys(process.env).filter(t=>/^debug_/i.test(t)).reduce((t,e)=>{let r=e.substring(6).toLowerCase().replace(/_([a-z])/g,(i,o)=>o.toUpperCase()),n=process.env[e];return/^(yes|on|true|enabled)$/i.test(n)?n=!0:/^(no|off|false|disabled)$/i.test(n)?n=!1:n==="null"?n=null:n=Number(n),t[r]=n,t},{});function RG(){return"colors"in ht.inspectOpts?!!ht.inspectOpts.colors:PG.isatty(process.stderr.fd)}function $G(t){let{namespace:e,useColors:r}=this;if(r){let n=this.color,i="\x1B[3"+(n<8?n:"8;5;"+n),o=` ${i};1m${e} \x1B[0m`;t[0]=o+t[0].split(`
37
+ `)}),e}});var hx=D((Nle,dx)=>{var Jn=require("constants"),vz=process.cwd,jf=null,bz=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return jf||(jf=vz.call(process)),jf};try{process.cwd()}catch{}typeof process.chdir=="function"&&(my=process.chdir,process.chdir=function(t){jf=null,my.call(process,t)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,my));var my;dx.exports=wz;function wz(t){Jn.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&e(t),t.lutimes||r(t),t.chown=o(t.chown),t.fchown=o(t.fchown),t.lchown=o(t.lchown),t.chmod=n(t.chmod),t.fchmod=n(t.fchmod),t.lchmod=n(t.lchmod),t.chownSync=s(t.chownSync),t.fchownSync=s(t.fchownSync),t.lchownSync=s(t.lchownSync),t.chmodSync=i(t.chmodSync),t.fchmodSync=i(t.fchmodSync),t.lchmodSync=i(t.lchmodSync),t.stat=a(t.stat),t.fstat=a(t.fstat),t.lstat=a(t.lstat),t.statSync=u(t.statSync),t.fstatSync=u(t.fstatSync),t.lstatSync=u(t.lstatSync),t.chmod&&!t.lchmod&&(t.lchmod=function(c,f,h){h&&process.nextTick(h)},t.lchmodSync=function(){}),t.chown&&!t.lchown&&(t.lchown=function(c,f,h,d){d&&process.nextTick(d)},t.lchownSync=function(){}),bz==="win32"&&(t.rename=typeof t.rename!="function"?t.rename:function(c){function f(h,d,m){var b=Date.now(),y=0;c(h,d,function E(F){if(F&&(F.code==="EACCES"||F.code==="EPERM"||F.code==="EBUSY")&&Date.now()-b<6e4){setTimeout(function(){t.stat(d,function(g,C){g&&g.code==="ENOENT"?c(h,d,E):m(F)})},y),y<100&&(y+=10);return}m&&m(F)})}return Object.setPrototypeOf&&Object.setPrototypeOf(f,c),f}(t.rename)),t.read=typeof t.read!="function"?t.read:function(c){function f(h,d,m,b,y,E){var F;if(E&&typeof E=="function"){var g=0;F=function(C,A,T){if(C&&C.code==="EAGAIN"&&g<10)return g++,c.call(t,h,d,m,b,y,F);E.apply(this,arguments)}}return c.call(t,h,d,m,b,y,F)}return Object.setPrototypeOf&&Object.setPrototypeOf(f,c),f}(t.read),t.readSync=typeof t.readSync!="function"?t.readSync:function(c){return function(f,h,d,m,b){for(var y=0;;)try{return c.call(t,f,h,d,m,b)}catch(E){if(E.code==="EAGAIN"&&y<10){y++;continue}throw E}}}(t.readSync);function e(c){c.lchmod=function(f,h,d){c.open(f,Jn.O_WRONLY|Jn.O_SYMLINK,h,function(m,b){if(m){d&&d(m);return}c.fchmod(b,h,function(y){c.close(b,function(E){d&&d(y||E)})})})},c.lchmodSync=function(f,h){var d=c.openSync(f,Jn.O_WRONLY|Jn.O_SYMLINK,h),m=!0,b;try{b=c.fchmodSync(d,h),m=!1}finally{if(m)try{c.closeSync(d)}catch{}else c.closeSync(d)}return b}}function r(c){Jn.hasOwnProperty("O_SYMLINK")&&c.futimes?(c.lutimes=function(f,h,d,m){c.open(f,Jn.O_SYMLINK,function(b,y){if(b){m&&m(b);return}c.futimes(y,h,d,function(E){c.close(y,function(F){m&&m(E||F)})})})},c.lutimesSync=function(f,h,d){var m=c.openSync(f,Jn.O_SYMLINK),b,y=!0;try{b=c.futimesSync(m,h,d),y=!1}finally{if(y)try{c.closeSync(m)}catch{}else c.closeSync(m)}return b}):c.futimes&&(c.lutimes=function(f,h,d,m){m&&process.nextTick(m)},c.lutimesSync=function(){})}function n(c){return c&&function(f,h,d){return c.call(t,f,h,function(m){l(m)&&(m=null),d&&d.apply(this,arguments)})}}function i(c){return c&&function(f,h){try{return c.call(t,f,h)}catch(d){if(!l(d))throw d}}}function o(c){return c&&function(f,h,d,m){return c.call(t,f,h,d,function(b){l(b)&&(b=null),m&&m.apply(this,arguments)})}}function s(c){return c&&function(f,h,d){try{return c.call(t,f,h,d)}catch(m){if(!l(m))throw m}}}function a(c){return c&&function(f,h,d){typeof h=="function"&&(d=h,h=null);function m(b,y){y&&(y.uid<0&&(y.uid+=4294967296),y.gid<0&&(y.gid+=4294967296)),d&&d.apply(this,arguments)}return h?c.call(t,f,h,m):c.call(t,f,m)}}function u(c){return c&&function(f,h){var d=h?c.call(t,f,h):c.call(t,f);return d&&(d.uid<0&&(d.uid+=4294967296),d.gid<0&&(d.gid+=4294967296)),d}}function l(c){if(!c||c.code==="ENOSYS")return!0;var f=!process.getuid||process.getuid()!==0;return!!(f&&(c.code==="EINVAL"||c.code==="EPERM"))}}});var gx=D((Lle,mx)=>{var px=require("stream").Stream;mx.exports=_z;function _z(t){return{ReadStream:e,WriteStream:r};function e(n,i){if(!(this instanceof e))return new e(n,i);px.call(this);var o=this;this.path=n,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=64*1024,i=i||{};for(var s=Object.keys(i),a=0,u=s.length;a<u;a++){var l=s[a];this[l]=i[l]}if(this.encoding&&this.setEncoding(this.encoding),this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.end===void 0)this.end=1/0;else if(typeof this.end!="number")throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}if(this.fd!==null){process.nextTick(function(){o._read()});return}t.open(this.path,this.flags,this.mode,function(c,f){if(c){o.emit("error",c),o.readable=!1;return}o.fd=f,o.emit("open",f),o._read()})}function r(n,i){if(!(this instanceof r))return new r(n,i);px.call(this),this.path=n,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,i=i||{};for(var o=Object.keys(i),s=0,a=o.length;s<a;s++){var u=o[s];this[u]=i[u]}if(this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start}this.busy=!1,this._queue=[],this.fd===null&&(this._open=t.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}});var Dx=D((Ble,yx)=>{"use strict";yx.exports=Cz;var Ez=Object.getPrototypeOf||function(t){return t.__proto__};function Cz(t){if(t===null||typeof t!="object")return t;if(t instanceof Object)var e={__proto__:Ez(t)};else var e=Object.create(null);return Object.getOwnPropertyNames(t).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}});var Xn=D((qle,Dy)=>{var ze=require("fs"),Sz=hx(),xz=gx(),Fz=Dx(),Nf=require("util"),wt,Bf;typeof Symbol=="function"&&typeof Symbol.for=="function"?(wt=Symbol.for("graceful-fs.queue"),Bf=Symbol.for("graceful-fs.previous")):(wt="___graceful-fs.queue",Bf="___graceful-fs.previous");function Oz(){}function wx(t,e){Object.defineProperty(t,wt,{get:function(){return e}})}var Ji=Oz;Nf.debuglog?Ji=Nf.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(Ji=function(){var t=Nf.format.apply(Nf,arguments);t="GFS4: "+t.split(/\n/).join(`
38
+ GFS4: `),console.error(t)});ze[wt]||(vx=global[wt]||[],wx(ze,vx),ze.close=function(t){function e(r,n){return t.call(ze,r,function(i){i||bx(),typeof n=="function"&&n.apply(this,arguments)})}return Object.defineProperty(e,Bf,{value:t}),e}(ze.close),ze.closeSync=function(t){function e(r){t.apply(ze,arguments),bx()}return Object.defineProperty(e,Bf,{value:t}),e}(ze.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){Ji(ze[wt]),require("assert").equal(ze[wt].length,0)}));var vx;global[wt]||wx(global,ze[wt]);Dy.exports=gy(Fz(ze));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!ze.__patched&&(Dy.exports=gy(ze),ze.__patched=!0);function gy(t){Sz(t),t.gracefulify=gy,t.createReadStream=A,t.createWriteStream=T;var e=t.readFile;t.readFile=r;function r(S,I,$){return typeof I=="function"&&($=I,I=null),B(S,I,$);function B(q,K,V,_){return e(q,K,function(v){v&&(v.code==="EMFILE"||v.code==="ENFILE")?ws([B,[q,K,V],v,_||Date.now(),Date.now()]):typeof V=="function"&&V.apply(this,arguments)})}}var n=t.writeFile;t.writeFile=i;function i(S,I,$,B){return typeof $=="function"&&(B=$,$=null),q(S,I,$,B);function q(K,V,_,v,w){return n(K,V,_,function(O){O&&(O.code==="EMFILE"||O.code==="ENFILE")?ws([q,[K,V,_,v],O,w||Date.now(),Date.now()]):typeof v=="function"&&v.apply(this,arguments)})}}var o=t.appendFile;o&&(t.appendFile=s);function s(S,I,$,B){return typeof $=="function"&&(B=$,$=null),q(S,I,$,B);function q(K,V,_,v,w){return o(K,V,_,function(O){O&&(O.code==="EMFILE"||O.code==="ENFILE")?ws([q,[K,V,_,v],O,w||Date.now(),Date.now()]):typeof v=="function"&&v.apply(this,arguments)})}}var a=t.copyFile;a&&(t.copyFile=u);function u(S,I,$,B){return typeof $=="function"&&(B=$,$=0),q(S,I,$,B);function q(K,V,_,v,w){return a(K,V,_,function(O){O&&(O.code==="EMFILE"||O.code==="ENFILE")?ws([q,[K,V,_,v],O,w||Date.now(),Date.now()]):typeof v=="function"&&v.apply(this,arguments)})}}var l=t.readdir;t.readdir=f;var c=/^v[0-5]\./;function f(S,I,$){typeof I=="function"&&($=I,I=null);var B=c.test(process.version)?function(V,_,v,w){return l(V,q(V,_,v,w))}:function(V,_,v,w){return l(V,_,q(V,_,v,w))};return B(S,I,$);function q(K,V,_,v){return function(w,O){w&&(w.code==="EMFILE"||w.code==="ENFILE")?ws([B,[K,V,_],w,v||Date.now(),Date.now()]):(O&&O.sort&&O.sort(),typeof _=="function"&&_.call(this,w,O))}}}if(process.version.substr(0,4)==="v0.8"){var h=xz(t);E=h.ReadStream,g=h.WriteStream}var d=t.ReadStream;d&&(E.prototype=Object.create(d.prototype),E.prototype.open=F);var m=t.WriteStream;m&&(g.prototype=Object.create(m.prototype),g.prototype.open=C),Object.defineProperty(t,"ReadStream",{get:function(){return E},set:function(S){E=S},enumerable:!0,configurable:!0}),Object.defineProperty(t,"WriteStream",{get:function(){return g},set:function(S){g=S},enumerable:!0,configurable:!0});var b=E;Object.defineProperty(t,"FileReadStream",{get:function(){return b},set:function(S){b=S},enumerable:!0,configurable:!0});var y=g;Object.defineProperty(t,"FileWriteStream",{get:function(){return y},set:function(S){y=S},enumerable:!0,configurable:!0});function E(S,I){return this instanceof E?(d.apply(this,arguments),this):E.apply(Object.create(E.prototype),arguments)}function F(){var S=this;L(S.path,S.flags,S.mode,function(I,$){I?(S.autoClose&&S.destroy(),S.emit("error",I)):(S.fd=$,S.emit("open",$),S.read())})}function g(S,I){return this instanceof g?(m.apply(this,arguments),this):g.apply(Object.create(g.prototype),arguments)}function C(){var S=this;L(S.path,S.flags,S.mode,function(I,$){I?(S.destroy(),S.emit("error",I)):(S.fd=$,S.emit("open",$))})}function A(S,I){return new t.ReadStream(S,I)}function T(S,I){return new t.WriteStream(S,I)}var x=t.open;t.open=L;function L(S,I,$,B){return typeof $=="function"&&(B=$,$=null),q(S,I,$,B);function q(K,V,_,v,w){return x(K,V,_,function(O,j){O&&(O.code==="EMFILE"||O.code==="ENFILE")?ws([q,[K,V,_,v],O,w||Date.now(),Date.now()]):typeof v=="function"&&v.apply(this,arguments)})}}return t}function ws(t){Ji("ENQUEUE",t[0].name,t[1]),ze[wt].push(t),yy()}var Lf;function bx(){for(var t=Date.now(),e=0;e<ze[wt].length;++e)ze[wt][e].length>2&&(ze[wt][e][3]=t,ze[wt][e][4]=t);yy()}function yy(){if(clearTimeout(Lf),Lf=void 0,ze[wt].length!==0){var t=ze[wt].shift(),e=t[0],r=t[1],n=t[2],i=t[3],o=t[4];if(i===void 0)Ji("RETRY",e.name,r),e.apply(null,r);else if(Date.now()-i>=6e4){Ji("TIMEOUT",e.name,r);var s=r.pop();typeof s=="function"&&s.call(null,n)}else{var a=Date.now()-o,u=Math.max(o-i,1),l=Math.min(u*1.2,100);a>=l?(Ji("RETRY",e.name,r),e.apply(null,r.concat([i]))):ze[wt].push(t)}Lf===void 0&&(Lf=setTimeout(yy,0))}}});var Ex=D((Mle,_x)=>{function pr(t,e){typeof e=="boolean"&&(e={forever:e}),this._originalTimeouts=JSON.parse(JSON.stringify(t)),this._timeouts=t,this._options=e||{},this._maxRetryTime=e&&e.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}_x.exports=pr;pr.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts};pr.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timeouts=[],this._cachedTimeouts=null};pr.prototype.retry=function(t){if(this._timeout&&clearTimeout(this._timeout),!t)return!1;var e=new Date().getTime();if(t&&e-this._operationStart>=this._maxRetryTime)return this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(t);var r=this._timeouts.shift();if(r===void 0)if(this._cachedTimeouts)this._errors.splice(this._errors.length-1,this._errors.length),this._timeouts=this._cachedTimeouts.slice(0),r=this._timeouts.shift();else return!1;var n=this,i=setTimeout(function(){n._attempts++,n._operationTimeoutCb&&(n._timeout=setTimeout(function(){n._operationTimeoutCb(n._attempts)},n._operationTimeout),n._options.unref&&n._timeout.unref()),n._fn(n._attempts)},r);return this._options.unref&&i.unref(),!0};pr.prototype.attempt=function(t,e){this._fn=t,e&&(e.timeout&&(this._operationTimeout=e.timeout),e.cb&&(this._operationTimeoutCb=e.cb));var r=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){r._operationTimeoutCb()},r._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)};pr.prototype.try=function(t){console.log("Using RetryOperation.try() is deprecated"),this.attempt(t)};pr.prototype.start=function(t){console.log("Using RetryOperation.start() is deprecated"),this.attempt(t)};pr.prototype.start=pr.prototype.try;pr.prototype.errors=function(){return this._errors};pr.prototype.attempts=function(){return this._attempts};pr.prototype.mainError=function(){if(this._errors.length===0)return null;for(var t={},e=null,r=0,n=0;n<this._errors.length;n++){var i=this._errors[n],o=i.message,s=(t[o]||0)+1;t[o]=s,s>=r&&(e=i,r=s)}return e}});var Cx=D(Xi=>{var Az=Ex();Xi.operation=function(t){var e=Xi.timeouts(t);return new Az(e,{forever:t&&t.forever,unref:t&&t.unref,maxRetryTime:t&&t.maxRetryTime})};Xi.timeouts=function(t){if(t instanceof Array)return[].concat(t);var e={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var r in t)e[r]=t[r];if(e.minTimeout>e.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var n=[],i=0;i<e.retries;i++)n.push(this.createTimeout(i,e));return t&&t.forever&&!n.length&&n.push(this.createTimeout(i,e)),n.sort(function(o,s){return o-s}),n};Xi.createTimeout=function(t,e){var r=e.randomize?Math.random()+1:1,n=Math.round(r*e.minTimeout*Math.pow(e.factor,t));return n=Math.min(n,e.maxTimeout),n};Xi.wrap=function(t,e,r){if(e instanceof Array&&(r=e,e=null),!r){r=[];for(var n in t)typeof t[n]=="function"&&r.push(n)}for(var i=0;i<r.length;i++){var o=r[i],s=t[o];t[o]=function(u){var l=Xi.operation(e),c=Array.prototype.slice.call(arguments,1),f=c.pop();c.push(function(h){l.retry(h)||(h&&(arguments[0]=l.mainError()),f.apply(this,arguments))}),l.attempt(function(){u.apply(t,c)})}.bind(t,s),t[o].options=e}}});var xx=D((Hle,Sx)=>{Sx.exports=Cx()});var Fx=D((Vle,qf)=>{qf.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];process.platform!=="win32"&&qf.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&qf.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")});var wy=D((zle,Cs)=>{var Be=global.process,Zi=function(t){return t&&typeof t=="object"&&typeof t.removeListener=="function"&&typeof t.emit=="function"&&typeof t.reallyExit=="function"&&typeof t.listeners=="function"&&typeof t.kill=="function"&&typeof t.pid=="number"&&typeof t.on=="function"};Zi(Be)?(Ox=require("assert"),_s=Fx(),Ax=/^win/i.test(Be.platform),Iu=require("events"),typeof Iu!="function"&&(Iu=Iu.EventEmitter),Be.__signal_exit_emitter__?ft=Be.__signal_exit_emitter__:(ft=Be.__signal_exit_emitter__=new Iu,ft.count=0,ft.emitted={}),ft.infinite||(ft.setMaxListeners(1/0),ft.infinite=!0),Cs.exports=function(t,e){if(!Zi(global.process))return function(){};Ox.equal(typeof t,"function","a callback must be provided for exit handler"),Es===!1&&vy();var r="exit";e&&e.alwaysLast&&(r="afterexit");var n=function(){ft.removeListener(r,t),ft.listeners("exit").length===0&&ft.listeners("afterexit").length===0&&Mf()};return ft.on(r,t),n},Mf=function(){!Es||!Zi(global.process)||(Es=!1,_s.forEach(function(e){try{Be.removeListener(e,Uf[e])}catch{}}),Be.emit=Hf,Be.reallyExit=by,ft.count-=1)},Cs.exports.unload=Mf,Qi=function(e,r,n){ft.emitted[e]||(ft.emitted[e]=!0,ft.emit(e,r,n))},Uf={},_s.forEach(function(t){Uf[t]=function(){if(Zi(global.process)){var r=Be.listeners(t);r.length===ft.count&&(Mf(),Qi("exit",null,t),Qi("afterexit",null,t),Ax&&t==="SIGHUP"&&(t="SIGINT"),Be.kill(Be.pid,t))}}}),Cs.exports.signals=function(){return _s},Es=!1,vy=function(){Es||!Zi(global.process)||(Es=!0,ft.count+=1,_s=_s.filter(function(e){try{return Be.on(e,Uf[e]),!0}catch{return!1}}),Be.emit=Tx,Be.reallyExit=kx)},Cs.exports.load=vy,by=Be.reallyExit,kx=function(e){Zi(global.process)&&(Be.exitCode=e||0,Qi("exit",Be.exitCode,null),Qi("afterexit",Be.exitCode,null),by.call(Be,Be.exitCode))},Hf=Be.emit,Tx=function(e,r){if(e==="exit"&&Zi(global.process)){r!==void 0&&(Be.exitCode=r);var n=Hf.apply(this,arguments);return Qi("exit",Be.exitCode,null),Qi("afterexit",Be.exitCode,null),n}else return Hf.apply(this,arguments)}):Cs.exports=function(){return function(){}};var Ox,_s,Ax,Iu,ft,Mf,Qi,Uf,Es,vy,by,kx,Hf,Tx});var Rx=D((Gle,_y)=>{"use strict";var Px=Symbol();function kz(t,e,r){let n=e[Px];if(n)return e.stat(t,(o,s)=>{if(o)return r(o);r(null,s.mtime,n)});let i=new Date(Math.ceil(Date.now()/1e3)*1e3+5);e.utimes(t,i,i,o=>{if(o)return r(o);e.stat(t,(s,a)=>{if(s)return r(s);let u=a.mtime.getTime()%1e3===0?"s":"ms";Object.defineProperty(e,Px,{value:u}),r(null,a.mtime,u)})})}function Tz(t){let e=Date.now();return t==="s"&&(e=Math.ceil(e/1e3)*1e3),new Date(e)}_y.exports.probe=kz;_y.exports.getMtime=Tz});var Lx=D((Wle,Nu)=>{"use strict";var Pz=require("path"),Sy=Xn(),Rz=xx(),$z=wy(),$x=Rx(),gn={};function ju(t,e){return e.lockfilePath||`${t}.lock`}function xy(t,e,r){if(!e.realpath)return r(null,Pz.resolve(t));e.fs.realpath(t,r)}function Cy(t,e,r){let n=ju(t,e);e.fs.mkdir(n,i=>{if(!i)return $x.probe(n,e.fs,(o,s,a)=>{if(o)return e.fs.rmdir(n,()=>{}),r(o);r(null,s,a)});if(i.code!=="EEXIST")return r(i);if(e.stale<=0)return r(Object.assign(new Error("Lock file is already being held"),{code:"ELOCKED",file:t}));e.fs.stat(n,(o,s)=>{if(o)return o.code==="ENOENT"?Cy(t,{...e,stale:0},r):r(o);if(!Ix(s,e))return r(Object.assign(new Error("Lock file is already being held"),{code:"ELOCKED",file:t}));jx(t,e,a=>{if(a)return r(a);Cy(t,{...e,stale:0},r)})})})}function Ix(t,e){return t.mtime.getTime()<Date.now()-e.stale}function jx(t,e,r){e.fs.rmdir(ju(t,e),n=>{if(n&&n.code!=="ENOENT")return r(n);r()})}function Vf(t,e){let r=gn[t];r.updateTimeout||(r.updateDelay=r.updateDelay||e.update,r.updateTimeout=setTimeout(()=>{r.updateTimeout=null,e.fs.stat(r.lockfilePath,(n,i)=>{let o=r.lastUpdate+e.stale<Date.now();if(n)return n.code==="ENOENT"||o?Ey(t,r,Object.assign(n,{code:"ECOMPROMISED"})):(r.updateDelay=1e3,Vf(t,e));if(!(r.mtime.getTime()===i.mtime.getTime()))return Ey(t,r,Object.assign(new Error("Unable to update lock within the stale threshold"),{code:"ECOMPROMISED"}));let a=$x.getMtime(r.mtimePrecision);e.fs.utimes(r.lockfilePath,a,a,u=>{let l=r.lastUpdate+e.stale<Date.now();if(!r.released){if(u)return u.code==="ENOENT"||l?Ey(t,r,Object.assign(u,{code:"ECOMPROMISED"})):(r.updateDelay=1e3,Vf(t,e));r.mtime=a,r.lastUpdate=Date.now(),r.updateDelay=null,Vf(t,e)}})})},r.updateDelay),r.updateTimeout.unref&&r.updateTimeout.unref())}function Ey(t,e,r){e.released=!0,e.updateTimeout&&clearTimeout(e.updateTimeout),gn[t]===e&&delete gn[t],e.options.onCompromised(r)}function Iz(t,e,r){e={stale:1e4,update:null,realpath:!0,retries:0,fs:Sy,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),xy(t,e,(n,i)=>{if(n)return r(n);let o=Rz.operation(e.retries);o.attempt(()=>{Cy(i,e,(s,a,u)=>{if(o.retry(s))return;if(s)return r(o.mainError());let l=gn[i]={lockfilePath:ju(i,e),mtime:a,mtimePrecision:u,options:e,lastUpdate:Date.now()};Vf(i,e),r(null,c=>{if(l.released)return c&&c(Object.assign(new Error("Lock is already released"),{code:"ERELEASED"}));Nx(i,{...e,realpath:!1},c)})})})})}function Nx(t,e,r){e={fs:Sy,realpath:!0,...e},xy(t,e,(n,i)=>{if(n)return r(n);let o=gn[i];if(!o)return r(Object.assign(new Error("Lock is not acquired/owned by you"),{code:"ENOTACQUIRED"}));o.updateTimeout&&clearTimeout(o.updateTimeout),o.released=!0,delete gn[i],jx(i,e,r)})}function jz(t,e,r){e={stale:1e4,realpath:!0,fs:Sy,...e},e.stale=Math.max(e.stale||0,2e3),xy(t,e,(n,i)=>{if(n)return r(n);e.fs.stat(ju(i,e),(o,s)=>o?o.code==="ENOENT"?r(null,!1):r(o):r(null,!Ix(s,e)))})}function Nz(){return gn}$z(()=>{for(let t in gn){let e=gn[t].options;try{e.fs.rmdirSync(ju(t,e))}catch{}}});Nu.exports.lock=Iz;Nu.exports.unlock=Nx;Nu.exports.check=jz;Nu.exports.getLocks=Nz});var qx=D((Kle,Bx)=>{"use strict";var Lz=Xn();function Bz(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 qz(t){return(...e)=>new Promise((r,n)=>{e.push((i,o)=>{i?n(i):r(o)}),t(...e)})}function Mz(t){return(...e)=>{let r,n;if(e.push((i,o)=>{r=i,n=o}),t(...e),r)throw r;return n}}function Uz(t){if(t={...t},t.fs=Bz(t.fs||Lz),typeof t.retries=="number"&&t.retries>0||t.retries&&typeof t.retries.retries=="number"&&t.retries.retries>0)throw Object.assign(new Error("Cannot use retries with the sync api"),{code:"ESYNC"});return t}Bx.exports={toPromise:qz,toSync:Mz,toSyncOptions:Uz}});var Ux=D((Yle,Zn)=>{"use strict";var Ss=Lx(),{toPromise:zf,toSync:Gf,toSyncOptions:Fy}=qx();async function Mx(t,e){let r=await zf(Ss.lock)(t,e);return zf(r)}function Hz(t,e){let r=Gf(Ss.lock)(t,Fy(e));return Gf(r)}function Vz(t,e){return zf(Ss.unlock)(t,e)}function zz(t,e){return Gf(Ss.unlock)(t,Fy(e))}function Gz(t,e){return zf(Ss.check)(t,e)}function Wz(t,e){return Gf(Ss.check)(t,Fy(e))}Zn.exports=Mx;Zn.exports.lock=Mx;Zn.exports.unlock=Vz;Zn.exports.lockSync=Hz;Zn.exports.unlockSync=zz;Zn.exports.check=Gz;Zn.exports.checkSync=Wz});var Wx=D(xs=>{"use strict";Object.defineProperty(xs,"__esModule",{value:!0});xs.canStoreURLs=xs.FileUrlStorage=void 0;var Hx=require("fs"),Kz=Jz(fx()),Vx=Yz(Ux());function Gx(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,r=new WeakMap;return(Gx=function(n){return n?r:e})(t)}function Yz(t,e){if(!e&&t&&t.__esModule)return t;if(t===null||typeof t!="object"&&typeof t!="function")return{default:t};var r=Gx(e);if(r&&r.has(t))return r.get(t);var n={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in t)if(o!=="default"&&{}.hasOwnProperty.call(t,o)){var s=i?Object.getOwnPropertyDescriptor(t,o):null;s&&(s.get||s.set)?Object.defineProperty(n,o,s):n[o]=t[o]}return n.default=t,r&&r.set(t,n),n}function Jz(t){return t&&t.__esModule?t:{default:t}}function Lu(t){"@babel/helpers - typeof";return Lu=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},Lu(t)}function Xz(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function zx(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Qz(n.key),n)}}function Zz(t,e,r){return e&&zx(t.prototype,e),r&&zx(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function Qz(t){var e=eG(t,"string");return Lu(e)=="symbol"?e:e+""}function eG(t,e){if(Lu(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Lu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Jle=xs.canStoreURLs=!0,Xle=xs.FileUrlStorage=function(){function t(e){Xz(this,t),this.path=e}return Zz(t,[{key:"findAllUploads",value:function(){var r=this;return new Promise(function(n,i){r._getItems("tus::",function(o,s){o?i(o):n(s)})})}},{key:"findUploadsByFingerprint",value:function(r){var n=this;return new Promise(function(i,o){n._getItems("tus::".concat(r),function(s,a){s?o(s):i(a)})})}},{key:"removeUpload",value:function(r){var n=this;return new Promise(function(i,o){n._removeItem(r,function(s){s?o(s):i()})})}},{key:"addUpload",value:function(r,n){var i=this,o=Math.round(Math.random()*1e12),s="tus::".concat(r,"::").concat(o);return new Promise(function(a,u){i._setItem(s,n,function(l){l?u(l):a(s)})})}},{key:"_setItem",value:function(r,n,i){var o=this;Vx.lock(this.path,this._lockfileOptions()).then(function(s){i=o._releaseAndCb(s,i),o._getData(function(a,u){if(a){i(a);return}u[r]=n,o._writeData(u,function(l){return i(l)})})}).catch(i)}},{key:"_getItems",value:function(r,n){this._getData(function(i,o){if(i){n(i);return}var s=Object.keys(o).filter(function(a){return a.startsWith(r)}).map(function(a){var u=o[a];return u.urlStorageKey=a,u});n(null,s)})}},{key:"_removeItem",value:function(r,n){var i=this;Vx.lock(this.path,this._lockfileOptions()).then(function(o){n=i._releaseAndCb(o,n),i._getData(function(s,a){if(s){n(s);return}delete a[r],i._writeData(a,function(u){return n(u)})})}).catch(n)}},{key:"_lockfileOptions",value:function(){return{realpath:!1,retries:{retries:5,minTimeout:20}}}},{key:"_releaseAndCb",value:function(r,n){return function(i){if(i){r().then(function(){return n(i)}).catch(function(o){return n((0,Kz.default)([i,o]))});return}r().then(n).catch(n)}}},{key:"_writeData",value:function(r,n){var i={encoding:"utf8",mode:432,flag:"w"};(0,Hx.writeFile)(this.path,JSON.stringify(r),i,function(o){return n(o)})}},{key:"_getData",value:function(r){(0,Hx.readFile)(this.path,"utf8",function(n,i){if(n){n.code==="ENOENT"?r(null,{}):r(n);return}try{i=i.trim().length?JSON.parse(i):{}}catch(o){r(o);return}r(null,i)})}}])}()});var ky=D(Vt=>{"use strict";Object.defineProperty(Vt,"__esModule",{value:!0});Object.defineProperty(Vt,"DefaultHttpStack",{enumerable:!0,get:function(){return Xx.default}});Object.defineProperty(Vt,"DetailedError",{enumerable:!0,get:function(){return tG.default}});Object.defineProperty(Vt,"FileUrlStorage",{enumerable:!0,get:function(){return Zx.FileUrlStorage}});Object.defineProperty(Vt,"StreamSource",{enumerable:!0,get:function(){return sG.default}});Vt.Upload=void 0;Object.defineProperty(Vt,"canStoreURLs",{enumerable:!0,get:function(){return Zx.canStoreURLs}});Vt.defaultOptions=void 0;Object.defineProperty(Vt,"enableDebugLog",{enumerable:!0,get:function(){return rG.enableDebugLog}});Vt.isSupported=void 0;var tG=eo(Eg()),rG=Cg(),nG=eo(WC()),Oy=eo(ES()),iG=eo(jS()),oG=eo(qS()),Xx=eo(e1()),sG=eo(Lg()),Zx=Wx();function eo(t){return t&&t.__esModule?t:{default:t}}function Os(t){"@babel/helpers - typeof";return Os=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},Os(t)}function aG(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Kx(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,eF(n.key),n)}}function uG(t,e,r){return e&&Kx(t.prototype,e),r&&Kx(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function lG(t,e,r){return e=Wf(e),cG(t,Qx()?Reflect.construct(e,r||[],Wf(t).constructor):e.apply(t,r))}function cG(t,e){if(e&&(Os(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return fG(t)}function fG(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Qx(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Qx=function(){return!!t})()}function Wf(t){return Wf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Wf(t)}function dG(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&&Ay(t,e)}function Ay(t,e){return Ay=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Ay(t,e)}function Yx(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Fs(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Yx(Object(r),!0).forEach(function(n){hG(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Yx(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function hG(t,e,r){return e=eF(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function eF(t){var e=pG(t,"string");return Os(e)=="symbol"?e:e+""}function pG(t,e){if(Os(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Os(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Jx=Vt.defaultOptions=Fs(Fs({},Oy.default.defaultOptions),{},{httpStack:new Xx.default,fileReader:new iG.default,urlStorage:new nG.default,fingerprint:oG.default}),Qle=Vt.Upload=function(t){function e(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return aG(this,e),n=Fs(Fs({},Jx),n),lG(this,e,[r,n])}return dG(e,t),uG(e,null,[{key:"terminate",value:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return i=Fs(Fs({},Jx),i),Oy.default.terminate(n,i)}}])}(Oy.default),ece=Vt.isSupported=!0});var rr={};gi(rr,{__addDisposableResource:()=>SF,__assign:()=>Kf,__asyncDelegator:()=>yF,__asyncGenerator:()=>gF,__asyncValues:()=>DF,__await:()=>As,__awaiter:()=>cF,__classPrivateFieldGet:()=>_F,__classPrivateFieldIn:()=>CF,__classPrivateFieldSet:()=>EF,__createBinding:()=>Jf,__decorate:()=>nF,__disposeResources:()=>xF,__esDecorate:()=>oF,__exportStar:()=>dF,__extends:()=>tF,__generator:()=>fF,__importDefault:()=>wF,__importStar:()=>bF,__makeTemplateObject:()=>vF,__metadata:()=>lF,__param:()=>iF,__propKey:()=>aF,__read:()=>Ry,__rest:()=>rF,__rewriteRelativeImportExtension:()=>FF,__runInitializers:()=>sF,__setFunctionName:()=>uF,__spread:()=>hF,__spreadArray:()=>mF,__spreadArrays:()=>pF,__values:()=>Yf,default:()=>yG});function tF(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Ty(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}function rF(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}function nF(t,e,r,n){var i=arguments.length,o=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,r,o):s(e,r))||o);return i>3&&o&&Object.defineProperty(e,r,o),o}function iF(t,e){return function(r,n){e(r,n,t)}}function oF(t,e,r,n,i,o){function s(E){if(E!==void 0&&typeof E!="function")throw new TypeError("Function expected");return E}for(var a=n.kind,u=a==="getter"?"get":a==="setter"?"set":"value",l=!e&&t?n.static?t:t.prototype:null,c=e||(l?Object.getOwnPropertyDescriptor(l,n.name):{}),f,h=!1,d=r.length-1;d>=0;d--){var m={};for(var b in n)m[b]=b==="access"?{}:n[b];for(var b in n.access)m.access[b]=n.access[b];m.addInitializer=function(E){if(h)throw new TypeError("Cannot add initializers after decoration has completed");o.push(s(E||null))};var y=(0,r[d])(a==="accessor"?{get:c.get,set:c.set}:c[u],m);if(a==="accessor"){if(y===void 0)continue;if(y===null||typeof y!="object")throw new TypeError("Object expected");(f=s(y.get))&&(c.get=f),(f=s(y.set))&&(c.set=f),(f=s(y.init))&&i.unshift(f)}else(f=s(y))&&(a==="field"?i.unshift(f):c[u]=f)}l&&Object.defineProperty(l,n.name,c),h=!0}function sF(t,e,r){for(var n=arguments.length>2,i=0;i<e.length;i++)r=n?e[i].call(t,r):e[i].call(t);return n?r:void 0}function aF(t){return typeof t=="symbol"?t:"".concat(t)}function uF(t,e,r){return typeof e=="symbol"&&(e=e.description?"[".concat(e.description,"]"):""),Object.defineProperty(t,"name",{configurable:!0,value:r?"".concat(r," ",e):e})}function lF(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function cF(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(c){try{l(n.next(c))}catch(f){s(f)}}function u(c){try{l(n.throw(c))}catch(f){s(f)}}function l(c){c.done?o(c.value):i(c.value).then(a,u)}l((n=n.apply(t,e||[])).next())})}function fF(t,e){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,s=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(l){return function(c){return u([l,c])}}function u(l){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,l[0]&&(r=0)),r;)try{if(n=1,i&&(o=l[0]&2?i.return:l[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,l[1])).done)return o;switch(i=0,o&&(l=[l[0]&2,o.value]),l[0]){case 0:case 1:o=l;break;case 4:return r.label++,{value:l[1],done:!1};case 5:r.label++,i=l[1],l=[0];continue;case 7:l=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(l[0]===6||l[0]===2)){r=0;continue}if(l[0]===3&&(!o||l[1]>o[0]&&l[1]<o[3])){r.label=l[1];break}if(l[0]===6&&r.label<o[1]){r.label=o[1],o=l;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(l);break}o[2]&&r.ops.pop(),r.trys.pop();continue}l=e.call(t,r)}catch(c){l=[6,c],i=0}finally{n=o=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}function dF(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Jf(e,t,r)}function Yf(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 Ry(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,o=[],s;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(a){s={error:a}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return o}function hF(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(Ry(arguments[e]));return t}function pF(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var n=Array(t),i=0,e=0;e<r;e++)for(var o=arguments[e],s=0,a=o.length;s<a;s++,i++)n[i]=o[s];return n}function mF(t,e,r){if(r||arguments.length===2)for(var n=0,i=e.length,o;n<i;n++)(o||!(n in e))&&(o||(o=Array.prototype.slice.call(e,0,n)),o[n]=e[n]);return t.concat(o||Array.prototype.slice.call(e))}function As(t){return this instanceof As?(this.v=t,this):new As(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(y,E){o.push([d,b,y,E])>1||u(d,b)})},m&&(i[d]=m(i[d])))}function u(d,m){try{l(n[d](m))}catch(b){h(o[0][3],b)}}function l(d){d.value instanceof As?Promise.resolve(d.value.v).then(c,f):h(o[0][2],d)}function c(d){u("next",d)}function f(d){u("throw",d)}function h(d,m){d(m),o.shift(),o.length&&u(o[0][0],o[0][1])}}function yF(t){var e,r;return e={},n("next"),n("throw",function(i){throw i}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(i,o){e[i]=t[i]?function(s){return(r=!r)?{value:As(t[i](s)),done:!1}:o?o(s):s}:o}}function DF(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof Yf=="function"?Yf(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(o){r[o]=t[o]&&function(s){return new Promise(function(a,u){s=t[o](s),i(a,u,s.done,s.value)})}}function i(o,s,a,u){Promise.resolve(u).then(function(l){o({value:l,done:a})},s)}}function vF(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function bF(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r=Py(t),n=0;n<r.length;n++)r[n]!=="default"&&Jf(e,t,r[n]);return mG(e,t),e}function wF(t){return t&&t.__esModule?t:{default:t}}function _F(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)}function EF(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r}function CF(t,e){if(e===null||typeof e!="object"&&typeof e!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof t=="function"?e===t:t.has(e)}function SF(t,e,r){if(e!=null){if(typeof e!="object"&&typeof e!="function")throw new TypeError("Object expected.");var n,i;if(r){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");n=e[Symbol.asyncDispose]}if(n===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");n=e[Symbol.dispose],r&&(i=n)}if(typeof n!="function")throw new TypeError("Object not disposable.");i&&(n=function(){try{i.call(this)}catch(o){return Promise.reject(o)}}),t.stack.push({value:e,dispose:n,async:r})}else r&&t.stack.push({async:!0});return e}function xF(t){function e(o){t.error=t.hasError?new gG(o,t.error,"An error was suppressed during disposal."):o,t.hasError=!0}var r,n=0;function i(){for(;r=t.stack.pop();)try{if(!r.async&&n===1)return n=0,t.stack.push(r),Promise.resolve().then(i);if(r.dispose){var o=r.dispose.call(r.value);if(r.async)return n|=2,Promise.resolve(o).then(i,function(s){return e(s),i()})}else n|=1}catch(s){e(s)}if(n===1)return t.hasError?Promise.reject(t.error):Promise.resolve();if(t.hasError)throw t.error}return i()}function FF(t,e){return typeof t=="string"&&/^\.\.?\//.test(t)?t.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(r,n,i,o,s){return n?e?".jsx":".js":i&&(!o||!s)?r:i+o+"."+s.toLowerCase()+"js"}):t}var Ty,Kf,Jf,mG,Py,gG,yG,nr=Ct(()=>{Ty=function(t,e){return Ty=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])},Ty(t,e)};Kf=function(){return Kf=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},Kf.apply(this,arguments)};Jf=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]};mG=Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e},Py=function(t){return Py=Object.getOwnPropertyNames||function(e){var r=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(r[r.length]=n);return r},Py(t)};gG=typeof SuppressedError=="function"?SuppressedError:function(t,e,r){var n=new Error(r);return n.name="SuppressedError",n.error=t,n.suppressed=e,n};yG={__extends:tF,__assign:Kf,__rest:rF,__decorate:nF,__param:iF,__esDecorate:oF,__runInitializers:sF,__propKey:aF,__setFunctionName:uF,__metadata:lF,__awaiter:cF,__generator:fF,__createBinding:Jf,__exportStar:dF,__values:Yf,__read:Ry,__spread:hF,__spreadArrays:pF,__spreadArray:mF,__await:As,__asyncGenerator:gF,__asyncDelegator:yF,__asyncValues:DF,__makeTemplateObject:vF,__importStar:bF,__importDefault:wF,__classPrivateFieldGet:_F,__classPrivateFieldSet:EF,__classPrivateFieldIn:CF,__addDisposableResource:SF,__disposeResources:xF,__rewriteRelativeImportExtension:FF}});var AF=D((rce,OF)=>{var ks=1e3,Ts=ks*60,Ps=Ts*60,to=Ps*24,DG=to*7,vG=to*365.25;OF.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return bG(t);if(r==="number"&&isFinite(t))return e.long?_G(t):wG(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function bG(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*vG;case"weeks":case"week":case"w":return r*DG;case"days":case"day":case"d":return r*to;case"hours":case"hour":case"hrs":case"hr":case"h":return r*Ps;case"minutes":case"minute":case"mins":case"min":case"m":return r*Ts;case"seconds":case"second":case"secs":case"sec":case"s":return r*ks;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}function wG(t){var e=Math.abs(t);return e>=to?Math.round(t/to)+"d":e>=Ps?Math.round(t/Ps)+"h":e>=Ts?Math.round(t/Ts)+"m":e>=ks?Math.round(t/ks)+"s":t+"ms"}function _G(t){var e=Math.abs(t);return e>=to?Xf(t,e,to,"day"):e>=Ps?Xf(t,e,Ps,"hour"):e>=Ts?Xf(t,e,Ts,"minute"):e>=ks?Xf(t,e,ks,"second"):t+" ms"}function Xf(t,e,r,n){var i=e>=r*1.5;return Math.round(t/r)+" "+n+(i?"s":"")}});var $y=D((nce,kF)=>{function EG(t){r.debug=r,r.default=r,r.coerce=u,r.disable=s,r.enable=i,r.enabled=a,r.humanize=AF(),r.destroy=l,Object.keys(t).forEach(c=>{r[c]=t[c]}),r.names=[],r.skips=[],r.formatters={};function e(c){let f=0;for(let h=0;h<c.length;h++)f=(f<<5)-f+c.charCodeAt(h),f|=0;return r.colors[Math.abs(f)%r.colors.length]}r.selectColor=e;function r(c){let f,h=null,d,m;function b(...y){if(!b.enabled)return;let E=b,F=Number(new Date),g=F-(f||F);E.diff=g,E.prev=f,E.curr=F,f=F,y[0]=r.coerce(y[0]),typeof y[0]!="string"&&y.unshift("%O");let C=0;y[0]=y[0].replace(/%([a-zA-Z%])/g,(T,x)=>{if(T==="%%")return"%";C++;let L=r.formatters[x];if(typeof L=="function"){let S=y[C];T=L.call(E,S),y.splice(C,1),C--}return T}),r.formatArgs.call(E,y),(E.log||r.log).apply(E,y)}return b.namespace=c,b.useColors=r.useColors(),b.color=r.selectColor(c),b.extend=n,b.destroy=r.destroy,Object.defineProperty(b,"enabled",{enumerable:!0,configurable:!1,get:()=>h!==null?h:(d!==r.namespaces&&(d=r.namespaces,m=r.enabled(c)),m),set:y=>{h=y}}),typeof r.init=="function"&&r.init(b),b}function n(c,f){let h=r(this.namespace+(typeof f>"u"?":":f)+c);return h.log=this.log,h}function i(c){r.save(c),r.namespaces=c,r.names=[],r.skips=[];let f=(typeof c=="string"?c:"").trim().replace(" ",",").split(",").filter(Boolean);for(let h of f)h[0]==="-"?r.skips.push(h.slice(1)):r.names.push(h)}function o(c,f){let h=0,d=0,m=-1,b=0;for(;h<c.length;)if(d<f.length&&(f[d]===c[h]||f[d]==="*"))f[d]==="*"?(m=d,b=h,d++):(h++,d++);else if(m!==-1)d=m+1,b++,h=b;else return!1;for(;d<f.length&&f[d]==="*";)d++;return d===f.length}function s(){let c=[...r.names,...r.skips.map(f=>"-"+f)].join(",");return r.enable(""),c}function a(c){for(let f of r.skips)if(o(c,f))return!1;for(let f of r.names)if(o(c,f))return!0;return!1}function u(c){return c instanceof Error?c.stack||c.message:c}function l(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return r.enable(r.load()),r}kF.exports=EG});var TF=D((ir,Zf)=>{ir.formatArgs=SG;ir.save=xG;ir.load=FG;ir.useColors=CG;ir.storage=OG();ir.destroy=(()=>{let t=!1;return()=>{t||(t=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();ir.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function CG(){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 SG(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+Zf.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;t.splice(1,0,e,"color: inherit");let r=0,n=0;t[0].replace(/%[a-zA-Z%]/g,i=>{i!=="%%"&&(r++,i==="%c"&&(n=r))}),t.splice(n,0,e)}ir.log=console.debug||console.log||(()=>{});function xG(t){try{t?ir.storage.setItem("debug",t):ir.storage.removeItem("debug")}catch{}}function FG(){let t;try{t=ir.storage.getItem("debug")}catch{}return!t&&typeof process<"u"&&"env"in process&&(t=process.env.DEBUG),t}function OG(){try{return localStorage}catch{}}Zf.exports=$y()(ir);var{formatters:AG}=Zf.exports;AG.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var RF=D((ice,PF)=>{"use strict";PF.exports=(t,e=process.argv)=>{let r=t.startsWith("-")?"":t.length===1?"-":"--",n=e.indexOf(r+t),i=e.indexOf("--");return n!==-1&&(i===-1||n<i)}});var jF=D((oce,IF)=>{"use strict";var kG=require("os"),$F=require("tty"),mr=RF(),{env:dt}=process,Qn;mr("no-color")||mr("no-colors")||mr("color=false")||mr("color=never")?Qn=0:(mr("color")||mr("colors")||mr("color=true")||mr("color=always"))&&(Qn=1);"FORCE_COLOR"in dt&&(dt.FORCE_COLOR==="true"?Qn=1:dt.FORCE_COLOR==="false"?Qn=0:Qn=dt.FORCE_COLOR.length===0?1:Math.min(parseInt(dt.FORCE_COLOR,10),3));function Iy(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}function jy(t,e){if(Qn===0)return 0;if(mr("color=16m")||mr("color=full")||mr("color=truecolor"))return 3;if(mr("color=256"))return 2;if(t&&!e&&Qn===void 0)return 0;let r=Qn||0;if(dt.TERM==="dumb")return r;if(process.platform==="win32"){let n=kG.release().split(".");return Number(n[0])>=10&&Number(n[2])>=10586?Number(n[2])>=14931?3:2:1}if("CI"in dt)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(n=>n in dt)||dt.CI_NAME==="codeship"?1:r;if("TEAMCITY_VERSION"in dt)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(dt.TEAMCITY_VERSION)?1:0;if(dt.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in dt){let n=parseInt((dt.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(dt.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(dt.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(dt.TERM)||"COLORTERM"in dt?1:r}function TG(t){let e=jy(t,t&&t.isTTY);return Iy(e)}IF.exports={supportsColor:TG,stdout:Iy(jy(!0,$F.isatty(1))),stderr:Iy(jy(!0,$F.isatty(2)))}});var LF=D((ht,ed)=>{var PG=require("tty"),Qf=require("util");ht.init=BG;ht.log=jG;ht.formatArgs=$G;ht.save=NG;ht.load=LG;ht.useColors=RG;ht.destroy=Qf.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");ht.colors=[6,2,3,4,5,1];try{let t=jF();t&&(t.stderr||t).level>=2&&(ht.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}ht.inspectOpts=Object.keys(process.env).filter(t=>/^debug_/i.test(t)).reduce((t,e)=>{let r=e.substring(6).toLowerCase().replace(/_([a-z])/g,(i,o)=>o.toUpperCase()),n=process.env[e];return/^(yes|on|true|enabled)$/i.test(n)?n=!0:/^(no|off|false|disabled)$/i.test(n)?n=!1:n==="null"?n=null:n=Number(n),t[r]=n,t},{});function RG(){return"colors"in ht.inspectOpts?!!ht.inspectOpts.colors:PG.isatty(process.stderr.fd)}function $G(t){let{namespace:e,useColors:r}=this;if(r){let n=this.color,i="\x1B[3"+(n<8?n:"8;5;"+n),o=` ${i};1m${e} \x1B[0m`;t[0]=o+t[0].split(`
39
39
  `).join(`
40
40
  `+o),t.push(i+"m+"+ed.exports.humanize(this.diff)+"\x1B[0m")}else t[0]=IG()+e+" "+t[0]}function IG(){return ht.inspectOpts.hideDate?"":new Date().toISOString()+" "}function jG(...t){return process.stderr.write(Qf.formatWithOptions(ht.inspectOpts,...t)+`
41
41
  `)}function NG(t){t?process.env.DEBUG=t:delete process.env.DEBUG}function LG(){return process.env.DEBUG}function BG(t){t.inspectOpts={};let e=Object.keys(ht.inspectOpts);for(let r=0;r<e.length;r++)t.inspectOpts[e[r]]=ht.inspectOpts[e[r]]}ed.exports=$y()(ht);var{formatters:NF}=ed.exports;NF.o=function(t){return this.inspectOpts.colors=this.useColors,Qf.inspect(t,this.inspectOpts).split(`
42
- `).map(e=>e.trim()).join(" ")};NF.O=function(t){return this.inspectOpts.colors=this.useColors,Qf.inspect(t,this.inspectOpts)}});var Ly=y((sce,Ny)=>{typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?Ny.exports=TF():Ny.exports=LF()});var pt=y(By=>{"use strict";By.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})};By.fromPromise=function(t){return Object.defineProperty(function(...e){let r=e[e.length-1];if(typeof r!="function")return t.apply(this,e);e.pop(),t.apply(this,e).then(n=>r(null,n),r)},"name",{value:t.name})}});var Pt=y(yn=>{"use strict";var BF=pt().fromCallback,Tt=Xn(),qG=["access","appendFile","chmod","chown","close","copyFile","cp","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","glob","lchmod","lchown","lutimes","link","lstat","mkdir","mkdtemp","open","opendir","readdir","readFile","readlink","realpath","rename","rm","rmdir","stat","statfs","symlink","truncate","unlink","utimes","writeFile"].filter(t=>typeof Tt[t]=="function");Object.assign(yn,Tt);qG.forEach(t=>{yn[t]=BF(Tt[t])});yn.exists=function(t,e){return typeof e=="function"?Tt.exists(t,e):new Promise(r=>Tt.exists(t,r))};yn.read=function(t,e,r,n,i,o){return typeof o=="function"?Tt.read(t,e,r,n,i,o):new Promise((s,a)=>{Tt.read(t,e,r,n,i,(u,l,c)=>{if(u)return a(u);s({bytesRead:l,buffer:c})})})};yn.write=function(t,e,...r){return typeof r[r.length-1]=="function"?Tt.write(t,e,...r):new Promise((n,i)=>{Tt.write(t,e,...r,(o,s,a)=>{if(o)return i(o);n({bytesWritten:s,buffer:a})})})};yn.readv=function(t,e,...r){return typeof r[r.length-1]=="function"?Tt.readv(t,e,...r):new Promise((n,i)=>{Tt.readv(t,e,...r,(o,s,a)=>{if(o)return i(o);n({bytesRead:s,buffers:a})})})};yn.writev=function(t,e,...r){return typeof r[r.length-1]=="function"?Tt.writev(t,e,...r):new Promise((n,i)=>{Tt.writev(t,e,...r,(o,s,a)=>{if(o)return i(o);n({bytesWritten:s,buffers:a})})})};typeof Tt.realpath.native=="function"?yn.realpath.native=BF(Tt.realpath.native):process.emitWarning("fs.realpath.native is not a function. Is fs being monkey-patched?","Warning","fs-extra-WARN0003")});var MF=y((lce,qF)=>{"use strict";var MG=require("path");qF.exports.checkPath=function(e){if(process.platform==="win32"&&/[<>:"|?*]/.test(e.replace(MG.parse(e).root,""))){let n=new Error(`Path contains invalid characters: ${e}`);throw n.code="EINVAL",n}}});var zF=y((cce,qy)=>{"use strict";var UF=Pt(),{checkPath:HF}=MF(),VF=t=>{let e={mode:511};return typeof t=="number"?t:{...e,...t}.mode};qy.exports.makeDir=async(t,e)=>(HF(t),UF.mkdir(t,{mode:VF(e),recursive:!0}));qy.exports.makeDirSync=(t,e)=>(HF(t),UF.mkdirSync(t,{mode:VF(e),recursive:!0}))});var xr=y((fce,GF)=>{"use strict";var UG=pt().fromPromise,{makeDir:HG,makeDirSync:My}=zF(),Uy=UG(HG);GF.exports={mkdirs:Uy,mkdirsSync:My,mkdirp:Uy,mkdirpSync:My,ensureDir:Uy,ensureDirSync:My}});var ei=y((dce,KF)=>{"use strict";var VG=pt().fromPromise,WF=Pt();function zG(t){return WF.access(t).then(()=>!0).catch(()=>!1)}KF.exports={pathExists:VG(zG),pathExistsSync:WF.existsSync}});var Hy=y((hce,YF)=>{"use strict";var Rs=Pt(),GG=pt().fromPromise;async function WG(t,e,r){let n=await Rs.open(t,"r+"),i=null;try{await Rs.futimes(n,e,r)}finally{try{await Rs.close(n)}catch(o){i=o}}if(i)throw i}function KG(t,e,r){let n=Rs.openSync(t,"r+");return Rs.futimesSync(n,e,r),Rs.closeSync(n)}YF.exports={utimesMillis:GG(WG),utimesMillisSync:KG}});var ro=y((pce,QF)=>{"use strict";var $s=Pt(),mt=require("path"),JF=pt().fromPromise;function YG(t,e,r){let n=r.dereference?i=>$s.stat(i,{bigint:!0}):i=>$s.lstat(i,{bigint:!0});return Promise.all([n(t),n(e).catch(i=>{if(i.code==="ENOENT")return null;throw i})]).then(([i,o])=>({srcStat:i,destStat:o}))}function JG(t,e,r){let n,i=r.dereference?s=>$s.statSync(s,{bigint:!0}):s=>$s.lstatSync(s,{bigint:!0}),o=i(t);try{n=i(e)}catch(s){if(s.code==="ENOENT")return{srcStat:o,destStat:null};throw s}return{srcStat:o,destStat:n}}async function XG(t,e,r,n){let{srcStat:i,destStat:o}=await YG(t,e,n);if(o){if(Bu(i,o)){let s=mt.basename(t),a=mt.basename(e);if(r==="move"&&s!==a&&s.toLowerCase()===a.toLowerCase())return{srcStat:i,destStat:o,isChangingCase:!0};throw new Error("Source and destination must not be the same.")}if(i.isDirectory()&&!o.isDirectory())throw new Error(`Cannot overwrite non-directory '${e}' with directory '${t}'.`);if(!i.isDirectory()&&o.isDirectory())throw new Error(`Cannot overwrite directory '${e}' with non-directory '${t}'.`)}if(i.isDirectory()&&Vy(t,e))throw new Error(td(t,e,r));return{srcStat:i,destStat:o}}function ZG(t,e,r,n){let{srcStat:i,destStat:o}=JG(t,e,n);if(o){if(Bu(i,o)){let s=mt.basename(t),a=mt.basename(e);if(r==="move"&&s!==a&&s.toLowerCase()===a.toLowerCase())return{srcStat:i,destStat:o,isChangingCase:!0};throw new Error("Source and destination must not be the same.")}if(i.isDirectory()&&!o.isDirectory())throw new Error(`Cannot overwrite non-directory '${e}' with directory '${t}'.`);if(!i.isDirectory()&&o.isDirectory())throw new Error(`Cannot overwrite directory '${e}' with non-directory '${t}'.`)}if(i.isDirectory()&&Vy(t,e))throw new Error(td(t,e,r));return{srcStat:i,destStat:o}}async function XF(t,e,r,n){let i=mt.resolve(mt.dirname(t)),o=mt.resolve(mt.dirname(r));if(o===i||o===mt.parse(o).root)return;let s;try{s=await $s.stat(o,{bigint:!0})}catch(a){if(a.code==="ENOENT")return;throw a}if(Bu(e,s))throw new Error(td(t,r,n));return XF(t,e,o,n)}function ZF(t,e,r,n){let i=mt.resolve(mt.dirname(t)),o=mt.resolve(mt.dirname(r));if(o===i||o===mt.parse(o).root)return;let s;try{s=$s.statSync(o,{bigint:!0})}catch(a){if(a.code==="ENOENT")return;throw a}if(Bu(e,s))throw new Error(td(t,r,n));return ZF(t,e,o,n)}function Bu(t,e){return e.ino&&e.dev&&e.ino===t.ino&&e.dev===t.dev}function Vy(t,e){let r=mt.resolve(t).split(mt.sep).filter(i=>i),n=mt.resolve(e).split(mt.sep).filter(i=>i);return r.every((i,o)=>n[o]===i)}function td(t,e,r){return`Cannot ${r} '${t}' to a subdirectory of itself, '${e}'.`}QF.exports={checkPaths:JF(XG),checkPathsSync:ZG,checkParentPaths:JF(XF),checkParentPathsSync:ZF,isSrcSubdir:Vy,areIdentical:Bu}});var i2=y((mce,n2)=>{"use strict";var xt=Pt(),qu=require("path"),{mkdirs:QG}=xr(),{pathExists:eW}=ei(),{utimesMillis:tW}=Hy(),Mu=ro();async function rW(t,e,r={}){typeof r=="function"&&(r={filter:r}),r.clobber="clobber"in r?!!r.clobber:!0,r.overwrite="overwrite"in r?!!r.overwrite:r.clobber,r.preserveTimestamps&&process.arch==="ia32"&&process.emitWarning(`Using the preserveTimestamps option in 32-bit node is not recommended;
42
+ `).map(e=>e.trim()).join(" ")};NF.O=function(t){return this.inspectOpts.colors=this.useColors,Qf.inspect(t,this.inspectOpts)}});var Ly=D((sce,Ny)=>{typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?Ny.exports=TF():Ny.exports=LF()});var pt=D(By=>{"use strict";By.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})};By.fromPromise=function(t){return Object.defineProperty(function(...e){let r=e[e.length-1];if(typeof r!="function")return t.apply(this,e);e.pop(),t.apply(this,e).then(n=>r(null,n),r)},"name",{value:t.name})}});var Pt=D(yn=>{"use strict";var BF=pt().fromCallback,Tt=Xn(),qG=["access","appendFile","chmod","chown","close","copyFile","cp","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","glob","lchmod","lchown","lutimes","link","lstat","mkdir","mkdtemp","open","opendir","readdir","readFile","readlink","realpath","rename","rm","rmdir","stat","statfs","symlink","truncate","unlink","utimes","writeFile"].filter(t=>typeof Tt[t]=="function");Object.assign(yn,Tt);qG.forEach(t=>{yn[t]=BF(Tt[t])});yn.exists=function(t,e){return typeof e=="function"?Tt.exists(t,e):new Promise(r=>Tt.exists(t,r))};yn.read=function(t,e,r,n,i,o){return typeof o=="function"?Tt.read(t,e,r,n,i,o):new Promise((s,a)=>{Tt.read(t,e,r,n,i,(u,l,c)=>{if(u)return a(u);s({bytesRead:l,buffer:c})})})};yn.write=function(t,e,...r){return typeof r[r.length-1]=="function"?Tt.write(t,e,...r):new Promise((n,i)=>{Tt.write(t,e,...r,(o,s,a)=>{if(o)return i(o);n({bytesWritten:s,buffer:a})})})};yn.readv=function(t,e,...r){return typeof r[r.length-1]=="function"?Tt.readv(t,e,...r):new Promise((n,i)=>{Tt.readv(t,e,...r,(o,s,a)=>{if(o)return i(o);n({bytesRead:s,buffers:a})})})};yn.writev=function(t,e,...r){return typeof r[r.length-1]=="function"?Tt.writev(t,e,...r):new Promise((n,i)=>{Tt.writev(t,e,...r,(o,s,a)=>{if(o)return i(o);n({bytesWritten:s,buffers:a})})})};typeof Tt.realpath.native=="function"?yn.realpath.native=BF(Tt.realpath.native):process.emitWarning("fs.realpath.native is not a function. Is fs being monkey-patched?","Warning","fs-extra-WARN0003")});var MF=D((lce,qF)=>{"use strict";var MG=require("path");qF.exports.checkPath=function(e){if(process.platform==="win32"&&/[<>:"|?*]/.test(e.replace(MG.parse(e).root,""))){let n=new Error(`Path contains invalid characters: ${e}`);throw n.code="EINVAL",n}}});var zF=D((cce,qy)=>{"use strict";var UF=Pt(),{checkPath:HF}=MF(),VF=t=>{let e={mode:511};return typeof t=="number"?t:{...e,...t}.mode};qy.exports.makeDir=async(t,e)=>(HF(t),UF.mkdir(t,{mode:VF(e),recursive:!0}));qy.exports.makeDirSync=(t,e)=>(HF(t),UF.mkdirSync(t,{mode:VF(e),recursive:!0}))});var xr=D((fce,GF)=>{"use strict";var UG=pt().fromPromise,{makeDir:HG,makeDirSync:My}=zF(),Uy=UG(HG);GF.exports={mkdirs:Uy,mkdirsSync:My,mkdirp:Uy,mkdirpSync:My,ensureDir:Uy,ensureDirSync:My}});var ei=D((dce,KF)=>{"use strict";var VG=pt().fromPromise,WF=Pt();function zG(t){return WF.access(t).then(()=>!0).catch(()=>!1)}KF.exports={pathExists:VG(zG),pathExistsSync:WF.existsSync}});var Hy=D((hce,YF)=>{"use strict";var Rs=Pt(),GG=pt().fromPromise;async function WG(t,e,r){let n=await Rs.open(t,"r+"),i=null;try{await Rs.futimes(n,e,r)}finally{try{await Rs.close(n)}catch(o){i=o}}if(i)throw i}function KG(t,e,r){let n=Rs.openSync(t,"r+");return Rs.futimesSync(n,e,r),Rs.closeSync(n)}YF.exports={utimesMillis:GG(WG),utimesMillisSync:KG}});var ro=D((pce,QF)=>{"use strict";var $s=Pt(),mt=require("path"),JF=pt().fromPromise;function YG(t,e,r){let n=r.dereference?i=>$s.stat(i,{bigint:!0}):i=>$s.lstat(i,{bigint:!0});return Promise.all([n(t),n(e).catch(i=>{if(i.code==="ENOENT")return null;throw i})]).then(([i,o])=>({srcStat:i,destStat:o}))}function JG(t,e,r){let n,i=r.dereference?s=>$s.statSync(s,{bigint:!0}):s=>$s.lstatSync(s,{bigint:!0}),o=i(t);try{n=i(e)}catch(s){if(s.code==="ENOENT")return{srcStat:o,destStat:null};throw s}return{srcStat:o,destStat:n}}async function XG(t,e,r,n){let{srcStat:i,destStat:o}=await YG(t,e,n);if(o){if(Bu(i,o)){let s=mt.basename(t),a=mt.basename(e);if(r==="move"&&s!==a&&s.toLowerCase()===a.toLowerCase())return{srcStat:i,destStat:o,isChangingCase:!0};throw new Error("Source and destination must not be the same.")}if(i.isDirectory()&&!o.isDirectory())throw new Error(`Cannot overwrite non-directory '${e}' with directory '${t}'.`);if(!i.isDirectory()&&o.isDirectory())throw new Error(`Cannot overwrite directory '${e}' with non-directory '${t}'.`)}if(i.isDirectory()&&Vy(t,e))throw new Error(td(t,e,r));return{srcStat:i,destStat:o}}function ZG(t,e,r,n){let{srcStat:i,destStat:o}=JG(t,e,n);if(o){if(Bu(i,o)){let s=mt.basename(t),a=mt.basename(e);if(r==="move"&&s!==a&&s.toLowerCase()===a.toLowerCase())return{srcStat:i,destStat:o,isChangingCase:!0};throw new Error("Source and destination must not be the same.")}if(i.isDirectory()&&!o.isDirectory())throw new Error(`Cannot overwrite non-directory '${e}' with directory '${t}'.`);if(!i.isDirectory()&&o.isDirectory())throw new Error(`Cannot overwrite directory '${e}' with non-directory '${t}'.`)}if(i.isDirectory()&&Vy(t,e))throw new Error(td(t,e,r));return{srcStat:i,destStat:o}}async function XF(t,e,r,n){let i=mt.resolve(mt.dirname(t)),o=mt.resolve(mt.dirname(r));if(o===i||o===mt.parse(o).root)return;let s;try{s=await $s.stat(o,{bigint:!0})}catch(a){if(a.code==="ENOENT")return;throw a}if(Bu(e,s))throw new Error(td(t,r,n));return XF(t,e,o,n)}function ZF(t,e,r,n){let i=mt.resolve(mt.dirname(t)),o=mt.resolve(mt.dirname(r));if(o===i||o===mt.parse(o).root)return;let s;try{s=$s.statSync(o,{bigint:!0})}catch(a){if(a.code==="ENOENT")return;throw a}if(Bu(e,s))throw new Error(td(t,r,n));return ZF(t,e,o,n)}function Bu(t,e){return e.ino&&e.dev&&e.ino===t.ino&&e.dev===t.dev}function Vy(t,e){let r=mt.resolve(t).split(mt.sep).filter(i=>i),n=mt.resolve(e).split(mt.sep).filter(i=>i);return r.every((i,o)=>n[o]===i)}function td(t,e,r){return`Cannot ${r} '${t}' to a subdirectory of itself, '${e}'.`}QF.exports={checkPaths:JF(XG),checkPathsSync:ZG,checkParentPaths:JF(XF),checkParentPathsSync:ZF,isSrcSubdir:Vy,areIdentical:Bu}});var i2=D((mce,n2)=>{"use strict";var xt=Pt(),qu=require("path"),{mkdirs:QG}=xr(),{pathExists:eW}=ei(),{utimesMillis:tW}=Hy(),Mu=ro();async function rW(t,e,r={}){typeof r=="function"&&(r={filter:r}),r.clobber="clobber"in r?!!r.clobber:!0,r.overwrite="overwrite"in r?!!r.overwrite:r.clobber,r.preserveTimestamps&&process.arch==="ia32"&&process.emitWarning(`Using the preserveTimestamps option in 32-bit node is not recommended;
43
43
 
44
- see https://github.com/jprichardson/node-fs-extra/issues/269`,"Warning","fs-extra-WARN0001");let{srcStat:n,destStat:i}=await Mu.checkPaths(t,e,"copy",r);if(await Mu.checkParentPaths(t,n,e,"copy"),!await t2(t,e,r))return;let s=qu.dirname(e);await eW(s)||await QG(s),await r2(i,t,e,r)}async function t2(t,e,r){return r.filter?r.filter(t,e):!0}async function r2(t,e,r,n){let o=await(n.dereference?xt.stat:xt.lstat)(e);if(o.isDirectory())return sW(o,t,e,r,n);if(o.isFile()||o.isCharacterDevice()||o.isBlockDevice())return nW(o,t,e,r,n);if(o.isSymbolicLink())return aW(t,e,r,n);throw o.isSocket()?new Error(`Cannot copy a socket file: ${e}`):o.isFIFO()?new Error(`Cannot copy a FIFO pipe: ${e}`):new Error(`Unknown file: ${e}`)}async function nW(t,e,r,n,i){if(!e)return e2(t,r,n,i);if(i.overwrite)return await xt.unlink(n),e2(t,r,n,i);if(i.errorOnExist)throw new Error(`'${n}' already exists`)}async function e2(t,e,r,n){if(await xt.copyFile(e,r),n.preserveTimestamps){iW(t.mode)&&await oW(r,t.mode);let i=await xt.stat(e);await tW(r,i.atime,i.mtime)}return xt.chmod(r,t.mode)}function iW(t){return(t&128)===0}function oW(t,e){return xt.chmod(t,e|128)}async function sW(t,e,r,n,i){e||await xt.mkdir(n);let o=[];for await(let s of await xt.opendir(r)){let a=qu.join(r,s.name),u=qu.join(n,s.name);o.push(t2(a,u,i).then(l=>{if(l)return Mu.checkPaths(a,u,"copy",i).then(({destStat:c})=>r2(c,a,u,i))}))}await Promise.all(o),e||await xt.chmod(n,t.mode)}async function aW(t,e,r,n){let i=await xt.readlink(e);if(n.dereference&&(i=qu.resolve(process.cwd(),i)),!t)return xt.symlink(i,r);let o=null;try{o=await xt.readlink(r)}catch(s){if(s.code==="EINVAL"||s.code==="UNKNOWN")return xt.symlink(i,r);throw s}if(n.dereference&&(o=qu.resolve(process.cwd(),o)),Mu.isSrcSubdir(i,o))throw new Error(`Cannot copy '${i}' to a subdirectory of itself, '${o}'.`);if(Mu.isSrcSubdir(o,i))throw new Error(`Cannot overwrite '${o}' with '${i}'.`);return await xt.unlink(r),xt.symlink(i,r)}n2.exports=rW});var l2=y((gce,u2)=>{"use strict";var Rt=Xn(),Uu=require("path"),uW=xr().mkdirsSync,lW=Hy().utimesMillisSync,Hu=ro();function cW(t,e,r){typeof r=="function"&&(r={filter:r}),r=r||{},r.clobber="clobber"in r?!!r.clobber:!0,r.overwrite="overwrite"in r?!!r.overwrite:r.clobber,r.preserveTimestamps&&process.arch==="ia32"&&process.emitWarning(`Using the preserveTimestamps option in 32-bit node is not recommended;
44
+ see https://github.com/jprichardson/node-fs-extra/issues/269`,"Warning","fs-extra-WARN0001");let{srcStat:n,destStat:i}=await Mu.checkPaths(t,e,"copy",r);if(await Mu.checkParentPaths(t,n,e,"copy"),!await t2(t,e,r))return;let s=qu.dirname(e);await eW(s)||await QG(s),await r2(i,t,e,r)}async function t2(t,e,r){return r.filter?r.filter(t,e):!0}async function r2(t,e,r,n){let o=await(n.dereference?xt.stat:xt.lstat)(e);if(o.isDirectory())return sW(o,t,e,r,n);if(o.isFile()||o.isCharacterDevice()||o.isBlockDevice())return nW(o,t,e,r,n);if(o.isSymbolicLink())return aW(t,e,r,n);throw o.isSocket()?new Error(`Cannot copy a socket file: ${e}`):o.isFIFO()?new Error(`Cannot copy a FIFO pipe: ${e}`):new Error(`Unknown file: ${e}`)}async function nW(t,e,r,n,i){if(!e)return e2(t,r,n,i);if(i.overwrite)return await xt.unlink(n),e2(t,r,n,i);if(i.errorOnExist)throw new Error(`'${n}' already exists`)}async function e2(t,e,r,n){if(await xt.copyFile(e,r),n.preserveTimestamps){iW(t.mode)&&await oW(r,t.mode);let i=await xt.stat(e);await tW(r,i.atime,i.mtime)}return xt.chmod(r,t.mode)}function iW(t){return(t&128)===0}function oW(t,e){return xt.chmod(t,e|128)}async function sW(t,e,r,n,i){e||await xt.mkdir(n);let o=[];for await(let s of await xt.opendir(r)){let a=qu.join(r,s.name),u=qu.join(n,s.name);o.push(t2(a,u,i).then(l=>{if(l)return Mu.checkPaths(a,u,"copy",i).then(({destStat:c})=>r2(c,a,u,i))}))}await Promise.all(o),e||await xt.chmod(n,t.mode)}async function aW(t,e,r,n){let i=await xt.readlink(e);if(n.dereference&&(i=qu.resolve(process.cwd(),i)),!t)return xt.symlink(i,r);let o=null;try{o=await xt.readlink(r)}catch(s){if(s.code==="EINVAL"||s.code==="UNKNOWN")return xt.symlink(i,r);throw s}if(n.dereference&&(o=qu.resolve(process.cwd(),o)),Mu.isSrcSubdir(i,o))throw new Error(`Cannot copy '${i}' to a subdirectory of itself, '${o}'.`);if(Mu.isSrcSubdir(o,i))throw new Error(`Cannot overwrite '${o}' with '${i}'.`);return await xt.unlink(r),xt.symlink(i,r)}n2.exports=rW});var l2=D((gce,u2)=>{"use strict";var Rt=Xn(),Uu=require("path"),uW=xr().mkdirsSync,lW=Hy().utimesMillisSync,Hu=ro();function cW(t,e,r){typeof r=="function"&&(r={filter:r}),r=r||{},r.clobber="clobber"in r?!!r.clobber:!0,r.overwrite="overwrite"in r?!!r.overwrite:r.clobber,r.preserveTimestamps&&process.arch==="ia32"&&process.emitWarning(`Using the preserveTimestamps option in 32-bit node is not recommended;
45
45
 
46
- see https://github.com/jprichardson/node-fs-extra/issues/269`,"Warning","fs-extra-WARN0002");let{srcStat:n,destStat:i}=Hu.checkPathsSync(t,e,"copy",r);if(Hu.checkParentPathsSync(t,n,e,"copy"),r.filter&&!r.filter(t,e))return;let o=Uu.dirname(e);return Rt.existsSync(o)||uW(o),o2(i,t,e,r)}function o2(t,e,r,n){let o=(n.dereference?Rt.statSync:Rt.lstatSync)(e);if(o.isDirectory())return yW(o,t,e,r,n);if(o.isFile()||o.isCharacterDevice()||o.isBlockDevice())return fW(o,t,e,r,n);if(o.isSymbolicLink())return bW(t,e,r,n);throw o.isSocket()?new Error(`Cannot copy a socket file: ${e}`):o.isFIFO()?new Error(`Cannot copy a FIFO pipe: ${e}`):new Error(`Unknown file: ${e}`)}function fW(t,e,r,n,i){return e?dW(t,r,n,i):s2(t,r,n,i)}function dW(t,e,r,n){if(n.overwrite)return Rt.unlinkSync(r),s2(t,e,r,n);if(n.errorOnExist)throw new Error(`'${r}' already exists`)}function s2(t,e,r,n){return Rt.copyFileSync(e,r),n.preserveTimestamps&&hW(t.mode,e,r),zy(r,t.mode)}function hW(t,e,r){return pW(t)&&mW(r,t),gW(e,r)}function pW(t){return(t&128)===0}function mW(t,e){return zy(t,e|128)}function zy(t,e){return Rt.chmodSync(t,e)}function gW(t,e){let r=Rt.statSync(t);return lW(e,r.atime,r.mtime)}function yW(t,e,r,n,i){return e?a2(r,n,i):DW(t.mode,r,n,i)}function DW(t,e,r,n){return Rt.mkdirSync(r),a2(e,r,n),zy(r,t)}function a2(t,e,r){let n=Rt.opendirSync(t);try{let i;for(;(i=n.readSync())!==null;)vW(i.name,t,e,r)}finally{n.closeSync()}}function vW(t,e,r,n){let i=Uu.join(e,t),o=Uu.join(r,t);if(n.filter&&!n.filter(i,o))return;let{destStat:s}=Hu.checkPathsSync(i,o,"copy",n);return o2(s,i,o,n)}function bW(t,e,r,n){let i=Rt.readlinkSync(e);if(n.dereference&&(i=Uu.resolve(process.cwd(),i)),t){let o;try{o=Rt.readlinkSync(r)}catch(s){if(s.code==="EINVAL"||s.code==="UNKNOWN")return Rt.symlinkSync(i,r);throw s}if(n.dereference&&(o=Uu.resolve(process.cwd(),o)),Hu.isSrcSubdir(i,o))throw new Error(`Cannot copy '${i}' to a subdirectory of itself, '${o}'.`);if(Hu.isSrcSubdir(o,i))throw new Error(`Cannot overwrite '${o}' with '${i}'.`);return wW(i,r)}else return Rt.symlinkSync(i,r)}function wW(t,e){return Rt.unlinkSync(e),Rt.symlinkSync(t,e)}u2.exports=cW});var rd=y((yce,c2)=>{"use strict";var _W=pt().fromPromise;c2.exports={copy:_W(i2()),copySync:l2()}});var Vu=y((Dce,d2)=>{"use strict";var f2=Xn(),EW=pt().fromCallback;function CW(t,e){f2.rm(t,{recursive:!0,force:!0},e)}function SW(t){f2.rmSync(t,{recursive:!0,force:!0})}d2.exports={remove:EW(CW),removeSync:SW}});var b2=y((vce,v2)=>{"use strict";var xW=pt().fromPromise,m2=Pt(),g2=require("path"),y2=xr(),D2=Vu(),h2=xW(async function(e){let r;try{r=await m2.readdir(e)}catch{return y2.mkdirs(e)}return Promise.all(r.map(n=>D2.remove(g2.join(e,n))))});function p2(t){let e;try{e=m2.readdirSync(t)}catch{return y2.mkdirsSync(t)}e.forEach(r=>{r=g2.join(t,r),D2.removeSync(r)})}v2.exports={emptyDirSync:p2,emptydirSync:p2,emptyDir:h2,emptydir:h2}});var C2=y((bce,E2)=>{"use strict";var FW=pt().fromPromise,w2=require("path"),Dn=Pt(),_2=xr();async function OW(t){let e;try{e=await Dn.stat(t)}catch{}if(e&&e.isFile())return;let r=w2.dirname(t),n=null;try{n=await Dn.stat(r)}catch(i){if(i.code==="ENOENT"){await _2.mkdirs(r),await Dn.writeFile(t,"");return}else throw i}n.isDirectory()?await Dn.writeFile(t,""):await Dn.readdir(r)}function AW(t){let e;try{e=Dn.statSync(t)}catch{}if(e&&e.isFile())return;let r=w2.dirname(t);try{Dn.statSync(r).isDirectory()||Dn.readdirSync(r)}catch(n){if(n&&n.code==="ENOENT")_2.mkdirsSync(r);else throw n}Dn.writeFileSync(t,"")}E2.exports={createFile:FW(OW),createFileSync:AW}});var A2=y((wce,O2)=>{"use strict";var kW=pt().fromPromise,S2=require("path"),ti=Pt(),x2=xr(),{pathExists:TW}=ei(),{areIdentical:F2}=ro();async function PW(t,e){let r;try{r=await ti.lstat(e)}catch{}let n;try{n=await ti.lstat(t)}catch(s){throw s.message=s.message.replace("lstat","ensureLink"),s}if(r&&F2(n,r))return;let i=S2.dirname(e);await TW(i)||await x2.mkdirs(i),await ti.link(t,e)}function RW(t,e){let r;try{r=ti.lstatSync(e)}catch{}try{let o=ti.lstatSync(t);if(r&&F2(o,r))return}catch(o){throw o.message=o.message.replace("lstat","ensureLink"),o}let n=S2.dirname(e);return ti.existsSync(n)||x2.mkdirsSync(n),ti.linkSync(t,e)}O2.exports={createLink:kW(PW),createLinkSync:RW}});var T2=y((_ce,k2)=>{"use strict";var ri=require("path"),zu=Pt(),{pathExists:$W}=ei(),IW=pt().fromPromise;async function jW(t,e){if(ri.isAbsolute(t)){try{await zu.lstat(t)}catch(o){throw o.message=o.message.replace("lstat","ensureSymlink"),o}return{toCwd:t,toDst:t}}let r=ri.dirname(e),n=ri.join(r,t);if(await $W(n))return{toCwd:n,toDst:t};try{await zu.lstat(t)}catch(o){throw o.message=o.message.replace("lstat","ensureSymlink"),o}return{toCwd:t,toDst:ri.relative(r,t)}}function NW(t,e){if(ri.isAbsolute(t)){if(!zu.existsSync(t))throw new Error("absolute srcpath does not exist");return{toCwd:t,toDst:t}}let r=ri.dirname(e),n=ri.join(r,t);if(zu.existsSync(n))return{toCwd:n,toDst:t};if(!zu.existsSync(t))throw new Error("relative srcpath does not exist");return{toCwd:t,toDst:ri.relative(r,t)}}k2.exports={symlinkPaths:IW(jW),symlinkPathsSync:NW}});var $2=y((Ece,R2)=>{"use strict";var P2=Pt(),LW=pt().fromPromise;async function BW(t,e){if(e)return e;let r;try{r=await P2.lstat(t)}catch{return"file"}return r&&r.isDirectory()?"dir":"file"}function qW(t,e){if(e)return e;let r;try{r=P2.lstatSync(t)}catch{return"file"}return r&&r.isDirectory()?"dir":"file"}R2.exports={symlinkType:LW(BW),symlinkTypeSync:qW}});var L2=y((Cce,N2)=>{"use strict";var MW=pt().fromPromise,I2=require("path"),zr=Pt(),{mkdirs:UW,mkdirsSync:HW}=xr(),{symlinkPaths:VW,symlinkPathsSync:zW}=T2(),{symlinkType:GW,symlinkTypeSync:WW}=$2(),{pathExists:KW}=ei(),{areIdentical:j2}=ro();async function YW(t,e,r){let n;try{n=await zr.lstat(e)}catch{}if(n&&n.isSymbolicLink()){let[a,u]=await Promise.all([zr.stat(t),zr.stat(e)]);if(j2(a,u))return}let i=await VW(t,e);t=i.toDst;let o=await GW(i.toCwd,r),s=I2.dirname(e);return await KW(s)||await UW(s),zr.symlink(t,e,o)}function JW(t,e,r){let n;try{n=zr.lstatSync(e)}catch{}if(n&&n.isSymbolicLink()){let a=zr.statSync(t),u=zr.statSync(e);if(j2(a,u))return}let i=zW(t,e);t=i.toDst,r=WW(i.toCwd,r);let o=I2.dirname(e);return zr.existsSync(o)||HW(o),zr.symlinkSync(t,e,r)}N2.exports={createSymlink:MW(YW),createSymlinkSync:JW}});var G2=y((Sce,z2)=>{"use strict";var{createFile:B2,createFileSync:q2}=C2(),{createLink:M2,createLinkSync:U2}=A2(),{createSymlink:H2,createSymlinkSync:V2}=L2();z2.exports={createFile:B2,createFileSync:q2,ensureFile:B2,ensureFileSync:q2,createLink:M2,createLinkSync:U2,ensureLink:M2,ensureLinkSync:U2,createSymlink:H2,createSymlinkSync:V2,ensureSymlink:H2,ensureSymlinkSync:V2}});var nd=y((xce,W2)=>{function XW(t,{EOL:e=`
47
- `,finalEOL:r=!0,replacer:n=null,spaces:i}={}){let o=r?e:"";return JSON.stringify(t,n,i).replace(/\n/g,e)+o}function ZW(t){return Buffer.isBuffer(t)&&(t=t.toString("utf8")),t.replace(/^\uFEFF/,"")}W2.exports={stringify:XW,stripBom:ZW}});var X2=y((Fce,J2)=>{var Is;try{Is=Xn()}catch{Is=require("fs")}var id=pt(),{stringify:K2,stripBom:Y2}=nd();async function QW(t,e={}){typeof e=="string"&&(e={encoding:e});let r=e.fs||Is,n="throws"in e?e.throws:!0,i=await id.fromCallback(r.readFile)(t,e);i=Y2(i);let o;try{o=JSON.parse(i,e?e.reviver:null)}catch(s){if(n)throw s.message=`${t}: ${s.message}`,s;return null}return o}var eK=id.fromPromise(QW);function tK(t,e={}){typeof e=="string"&&(e={encoding:e});let r=e.fs||Is,n="throws"in e?e.throws:!0;try{let i=r.readFileSync(t,e);return i=Y2(i),JSON.parse(i,e.reviver)}catch(i){if(n)throw i.message=`${t}: ${i.message}`,i;return null}}async function rK(t,e,r={}){let n=r.fs||Is,i=K2(e,r);await id.fromCallback(n.writeFile)(t,i,r)}var nK=id.fromPromise(rK);function iK(t,e,r={}){let n=r.fs||Is,i=K2(e,r);return n.writeFileSync(t,i,r)}var oK={readFile:eK,readFileSync:tK,writeFile:nK,writeFileSync:iK};J2.exports=oK});var Q2=y((Oce,Z2)=>{"use strict";var od=X2();Z2.exports={readJson:od.readFile,readJsonSync:od.readFileSync,writeJson:od.writeFile,writeJsonSync:od.writeFileSync}});var sd=y((Ace,rO)=>{"use strict";var sK=pt().fromPromise,Gy=Pt(),eO=require("path"),tO=xr(),aK=ei().pathExists;async function uK(t,e,r="utf-8"){let n=eO.dirname(t);return await aK(n)||await tO.mkdirs(n),Gy.writeFile(t,e,r)}function lK(t,...e){let r=eO.dirname(t);Gy.existsSync(r)||tO.mkdirsSync(r),Gy.writeFileSync(t,...e)}rO.exports={outputFile:sK(uK),outputFileSync:lK}});var iO=y((kce,nO)=>{"use strict";var{stringify:cK}=nd(),{outputFile:fK}=sd();async function dK(t,e,r={}){let n=cK(e,r);await fK(t,n,r)}nO.exports=dK});var sO=y((Tce,oO)=>{"use strict";var{stringify:hK}=nd(),{outputFileSync:pK}=sd();function mK(t,e,r){let n=hK(e,r);pK(t,n,r)}oO.exports=mK});var uO=y((Pce,aO)=>{"use strict";var gK=pt().fromPromise,$t=Q2();$t.outputJson=gK(iO());$t.outputJsonSync=sO();$t.outputJSON=$t.outputJson;$t.outputJSONSync=$t.outputJsonSync;$t.writeJSON=$t.writeJson;$t.writeJSONSync=$t.writeJsonSync;$t.readJSON=$t.readJson;$t.readJSONSync=$t.readJsonSync;aO.exports=$t});var hO=y((Rce,dO)=>{"use strict";var yK=Pt(),lO=require("path"),{copy:DK}=rd(),{remove:fO}=Vu(),{mkdirp:vK}=xr(),{pathExists:bK}=ei(),cO=ro();async function wK(t,e,r={}){let n=r.overwrite||r.clobber||!1,{srcStat:i,isChangingCase:o=!1}=await cO.checkPaths(t,e,"move",r);await cO.checkParentPaths(t,i,e,"move");let s=lO.dirname(e);return lO.parse(s).root!==s&&await vK(s),_K(t,e,n,o)}async function _K(t,e,r,n){if(!n){if(r)await fO(e);else if(await bK(e))throw new Error("dest already exists.")}try{await yK.rename(t,e)}catch(i){if(i.code!=="EXDEV")throw i;await EK(t,e,r)}}async function EK(t,e,r){return await DK(t,e,{overwrite:r,errorOnExist:!0,preserveTimestamps:!0}),fO(t)}dO.exports=wK});var DO=y(($ce,yO)=>{"use strict";var mO=Xn(),Ky=require("path"),CK=rd().copySync,gO=Vu().removeSync,SK=xr().mkdirpSync,pO=ro();function xK(t,e,r){r=r||{};let n=r.overwrite||r.clobber||!1,{srcStat:i,isChangingCase:o=!1}=pO.checkPathsSync(t,e,"move",r);return pO.checkParentPathsSync(t,i,e,"move"),FK(e)||SK(Ky.dirname(e)),OK(t,e,n,o)}function FK(t){let e=Ky.dirname(t);return Ky.parse(e).root===e}function OK(t,e,r,n){if(n)return Wy(t,e,r);if(r)return gO(e),Wy(t,e,r);if(mO.existsSync(e))throw new Error("dest already exists.");return Wy(t,e,r)}function Wy(t,e,r){try{mO.renameSync(t,e)}catch(n){if(n.code!=="EXDEV")throw n;return AK(t,e,r)}}function AK(t,e,r){return CK(t,e,{overwrite:r,errorOnExist:!0,preserveTimestamps:!0}),gO(t)}yO.exports=xK});var bO=y((Ice,vO)=>{"use strict";var kK=pt().fromPromise;vO.exports={move:kK(hO()),moveSync:DO()}});var js=y((jce,wO)=>{"use strict";wO.exports={...Pt(),...rd(),...b2(),...G2(),...uO(),...xr(),...bO(),...sd(),...ei(),...Vu()}});var OO=y((Nce,FO)=>{"use strict";var Yy,EO,CO,SO,xO=!0;typeof process<"u"&&({FORCE_COLOR:Yy,NODE_DISABLE_COLORS:EO,NO_COLOR:CO,TERM:SO}=process.env||{},xO=process.stdout&&process.stdout.isTTY);var be={enabled:!EO&&CO==null&&SO!=="dumb"&&(Yy!=null&&Yy!=="0"||xO),reset:xe(0,0),bold:xe(1,22),dim:xe(2,22),italic:xe(3,23),underline:xe(4,24),inverse:xe(7,27),hidden:xe(8,28),strikethrough:xe(9,29),black:xe(30,39),red:xe(31,39),green:xe(32,39),yellow:xe(33,39),blue:xe(34,39),magenta:xe(35,39),cyan:xe(36,39),white:xe(37,39),gray:xe(90,39),grey:xe(90,39),bgBlack:xe(40,49),bgRed:xe(41,49),bgGreen:xe(42,49),bgYellow:xe(43,49),bgBlue:xe(44,49),bgMagenta:xe(45,49),bgCyan:xe(46,49),bgWhite:xe(47,49)};function _O(t,e){let r=0,n,i="",o="";for(;r<t.length;r++)n=t[r],i+=n.open,o+=n.close,~e.indexOf(n.close)&&(e=e.replace(n.rgx,n.close+n.open));return i+e+o}function TK(t,e){let r={has:t,keys:e};return r.reset=be.reset.bind(r),r.bold=be.bold.bind(r),r.dim=be.dim.bind(r),r.italic=be.italic.bind(r),r.underline=be.underline.bind(r),r.inverse=be.inverse.bind(r),r.hidden=be.hidden.bind(r),r.strikethrough=be.strikethrough.bind(r),r.black=be.black.bind(r),r.red=be.red.bind(r),r.green=be.green.bind(r),r.yellow=be.yellow.bind(r),r.blue=be.blue.bind(r),r.magenta=be.magenta.bind(r),r.cyan=be.cyan.bind(r),r.white=be.white.bind(r),r.gray=be.gray.bind(r),r.grey=be.grey.bind(r),r.bgBlack=be.bgBlack.bind(r),r.bgRed=be.bgRed.bind(r),r.bgGreen=be.bgGreen.bind(r),r.bgYellow=be.bgYellow.bind(r),r.bgBlue=be.bgBlue.bind(r),r.bgMagenta=be.bgMagenta.bind(r),r.bgCyan=be.bgCyan.bind(r),r.bgWhite=be.bgWhite.bind(r),r}function xe(t,e){let r={open:`\x1B[${t}m`,close:`\x1B[${e}m`,rgx:new RegExp(`\\x1b\\[${e}m`,"g")};return function(n){return this!==void 0&&this.has!==void 0?(~this.has.indexOf(t)||(this.has.push(t),this.keys.push(r)),n===void 0?this:be.enabled?_O(this.keys,n+""):n+""):n===void 0?TK([t],[r]):be.enabled?_O([r],n+""):n+""}}FO.exports=be});var Ns=y(rt=>{"use strict";Object.defineProperty(rt,"__esModule",{value:!0});rt.ancillary=rt.failure=rt.success=rt.input=rt.weak=rt.strong=void 0;var PK=(nr(),je(rr)),Gr=PK.__importDefault(OO());rt.strong=Gr.default.bold;rt.weak=Gr.default.dim;rt.input=Gr.default.cyan;rt.success=Gr.default.green;rt.failure=Gr.default.red;rt.ancillary=Gr.default.cyan;var RK={strong:rt.strong,weak:rt.weak,input:rt.input,success:rt.success,failure:rt.failure,ancillary:rt.ancillary,log:{DEBUG:Gr.default.magenta,INFO:Gr.default.cyan,WARN:Gr.default.yellow,ERROR:Gr.default.red}};rt.default=RK});var Jy=y(ad=>{"use strict";Object.defineProperty(ad,"__esModule",{value:!0});ad.EscapeCode=void 0;var Fr="\x1B[",gt=class{};ad.EscapeCode=gt;gt.cursorLeft=()=>`${Fr}G`;gt.cursorUp=(t=1)=>`${Fr}${t}A`;gt.cursorDown=(t=1)=>`${Fr}${t}B`;gt.cursorForward=(t=1)=>`${Fr}${t}C`;gt.cursorBackward=(t=1)=>`${Fr}${t}D`;gt.cursorHide=()=>`${Fr}?25l`;gt.cursorShow=()=>`${Fr}?25h`;gt.eraseLine=()=>`${Fr}2K`;gt.eraseLines=t=>{let e="";for(let r=0;r<t;r++)e+=gt.eraseLine(),r<t-1&&(e+=gt.cursorUp());return`${e}${gt.cursorLeft()}`};gt.eraseUp=()=>`${Fr}1J`;gt.eraseDown=()=>`${Fr}J`;gt.eraseScreen=()=>`${Fr}2J`});var kO=y(ud=>{"use strict";Object.defineProperty(ud,"__esModule",{value:!0});ud.Cursor=void 0;var $K=(nr(),je(rr)),IK=$K.__importDefault(wy()),AO=Jy(),Ls=class t{static show(){t.stream.isTTY&&(t._isVisible=!0,t.stream.write(AO.EscapeCode.cursorShow()))}static hide(){t.stream.isTTY&&(t._listenerAttached||((0,IK.default)(()=>{t.show()}),t._listenerAttached=!0),t._isVisible=!1,t.stream.write(AO.EscapeCode.cursorHide()))}static toggle(){t._isVisible?t.hide():t.show()}};ud.Cursor=Ls;Ls.stream=process.stderr;Ls._isVisible=!0;Ls._listenerAttached=!1});var Zy=y((Mce,Xy)=>{"use strict";var TO=t=>Number.isNaN(t)?!1:t>=4352&&(t<=4447||t===9001||t===9002||11904<=t&&t<=12871&&t!==12351||12880<=t&&t<=19903||19968<=t&&t<=42182||43360<=t&&t<=43388||44032<=t&&t<=55203||63744<=t&&t<=64255||65040<=t&&t<=65049||65072<=t&&t<=65131||65281<=t&&t<=65376||65504<=t&&t<=65510||110592<=t&&t<=110593||127488<=t&&t<=127569||131072<=t&&t<=262141);Xy.exports=TO;Xy.exports.default=TO});var $O=y((Uce,RO)=>{"use strict";var PO="[\uD800-\uDBFF][\uDC00-\uDFFF]",jK=t=>t&&t.exact?new RegExp(`^${PO}$`):new RegExp(PO,"g");RO.exports=jK});var jO=y((Hce,IO)=>{"use strict";IO.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}});var Qy=y((Vce,LO)=>{var Gu=jO(),NO={};for(let t of Object.keys(Gu))NO[Gu[t]]=t;var Y={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};LO.exports=Y;for(let t of Object.keys(Y)){if(!("channels"in Y[t]))throw new Error("missing channels property: "+t);if(!("labels"in Y[t]))throw new Error("missing channel labels property: "+t);if(Y[t].labels.length!==Y[t].channels)throw new Error("channel and label counts mismatch: "+t);let{channels:e,labels:r}=Y[t];delete Y[t].channels,delete Y[t].labels,Object.defineProperty(Y[t],"channels",{value:e}),Object.defineProperty(Y[t],"labels",{value:r})}Y.rgb.hsl=function(t){let e=t[0]/255,r=t[1]/255,n=t[2]/255,i=Math.min(e,r,n),o=Math.max(e,r,n),s=o-i,a,u;o===i?a=0:e===o?a=(r-n)/s:r===o?a=2+(n-e)/s:n===o&&(a=4+(e-r)/s),a=Math.min(a*60,360),a<0&&(a+=360);let l=(i+o)/2;return o===i?u=0:l<=.5?u=s/(o+i):u=s/(2-o-i),[a,u*100,l*100]};Y.rgb.hsv=function(t){let e,r,n,i,o,s=t[0]/255,a=t[1]/255,u=t[2]/255,l=Math.max(s,a,u),c=l-Math.min(s,a,u),f=function(h){return(l-h)/6/c+1/2};return c===0?(i=0,o=0):(o=c/l,e=f(s),r=f(a),n=f(u),s===l?i=n-r:a===l?i=1/3+e-n:u===l&&(i=2/3+r-e),i<0?i+=1:i>1&&(i-=1)),[i*360,o*100,l*100]};Y.rgb.hwb=function(t){let e=t[0],r=t[1],n=t[2],i=Y.rgb.hsl(t)[0],o=1/255*Math.min(e,Math.min(r,n));return n=1-1/255*Math.max(e,Math.max(r,n)),[i,o*100,n*100]};Y.rgb.cmyk=function(t){let e=t[0]/255,r=t[1]/255,n=t[2]/255,i=Math.min(1-e,1-r,1-n),o=(1-e-i)/(1-i)||0,s=(1-r-i)/(1-i)||0,a=(1-n-i)/(1-i)||0;return[o*100,s*100,a*100,i*100]};function NK(t,e){return(t[0]-e[0])**2+(t[1]-e[1])**2+(t[2]-e[2])**2}Y.rgb.keyword=function(t){let e=NO[t];if(e)return e;let r=1/0,n;for(let i of Object.keys(Gu)){let o=Gu[i],s=NK(t,o);s<r&&(r=s,n=i)}return n};Y.keyword.rgb=function(t){return Gu[t]};Y.rgb.xyz=function(t){let e=t[0]/255,r=t[1]/255,n=t[2]/255;e=e>.04045?((e+.055)/1.055)**2.4:e/12.92,r=r>.04045?((r+.055)/1.055)**2.4:r/12.92,n=n>.04045?((n+.055)/1.055)**2.4:n/12.92;let i=e*.4124+r*.3576+n*.1805,o=e*.2126+r*.7152+n*.0722,s=e*.0193+r*.1192+n*.9505;return[i*100,o*100,s*100]};Y.rgb.lab=function(t){let e=Y.rgb.xyz(t),r=e[0],n=e[1],i=e[2];r/=95.047,n/=100,i/=108.883,r=r>.008856?r**(1/3):7.787*r+16/116,n=n>.008856?n**(1/3):7.787*n+16/116,i=i>.008856?i**(1/3):7.787*i+16/116;let o=116*n-16,s=500*(r-n),a=200*(n-i);return[o,s,a]};Y.hsl.rgb=function(t){let e=t[0]/360,r=t[1]/100,n=t[2]/100,i,o,s;if(r===0)return s=n*255,[s,s,s];n<.5?i=n*(1+r):i=n+r-n*r;let a=2*n-i,u=[0,0,0];for(let l=0;l<3;l++)o=e+1/3*-(l-1),o<0&&o++,o>1&&o--,6*o<1?s=a+(i-a)*6*o:2*o<1?s=i:3*o<2?s=a+(i-a)*(2/3-o)*6:s=a,u[l]=s*255;return u};Y.hsl.hsv=function(t){let e=t[0],r=t[1]/100,n=t[2]/100,i=r,o=Math.max(n,.01);n*=2,r*=n<=1?n:2-n,i*=o<=1?o:2-o;let s=(n+r)/2,a=n===0?2*i/(o+i):2*r/(n+r);return[e,a*100,s*100]};Y.hsv.rgb=function(t){let e=t[0]/60,r=t[1]/100,n=t[2]/100,i=Math.floor(e)%6,o=e-Math.floor(e),s=255*n*(1-r),a=255*n*(1-r*o),u=255*n*(1-r*(1-o));switch(n*=255,i){case 0:return[n,u,s];case 1:return[a,n,s];case 2:return[s,n,u];case 3:return[s,a,n];case 4:return[u,s,n];case 5:return[n,s,a]}};Y.hsv.hsl=function(t){let e=t[0],r=t[1]/100,n=t[2]/100,i=Math.max(n,.01),o,s;s=(2-r)*n;let a=(2-r)*i;return o=r*i,o/=a<=1?a:2-a,o=o||0,s/=2,[e,o*100,s*100]};Y.hwb.rgb=function(t){let e=t[0]/360,r=t[1]/100,n=t[2]/100,i=r+n,o;i>1&&(r/=i,n/=i);let s=Math.floor(6*e),a=1-n;o=6*e-s,(s&1)!==0&&(o=1-o);let u=r+o*(a-r),l,c,f;switch(s){default:case 6:case 0:l=a,c=u,f=r;break;case 1:l=u,c=a,f=r;break;case 2:l=r,c=a,f=u;break;case 3:l=r,c=u,f=a;break;case 4:l=u,c=r,f=a;break;case 5:l=a,c=r,f=u;break}return[l*255,c*255,f*255]};Y.cmyk.rgb=function(t){let e=t[0]/100,r=t[1]/100,n=t[2]/100,i=t[3]/100,o=1-Math.min(1,e*(1-i)+i),s=1-Math.min(1,r*(1-i)+i),a=1-Math.min(1,n*(1-i)+i);return[o*255,s*255,a*255]};Y.xyz.rgb=function(t){let e=t[0]/100,r=t[1]/100,n=t[2]/100,i,o,s;return i=e*3.2406+r*-1.5372+n*-.4986,o=e*-.9689+r*1.8758+n*.0415,s=e*.0557+r*-.204+n*1.057,i=i>.0031308?1.055*i**(1/2.4)-.055:i*12.92,o=o>.0031308?1.055*o**(1/2.4)-.055:o*12.92,s=s>.0031308?1.055*s**(1/2.4)-.055:s*12.92,i=Math.min(Math.max(0,i),1),o=Math.min(Math.max(0,o),1),s=Math.min(Math.max(0,s),1),[i*255,o*255,s*255]};Y.xyz.lab=function(t){let e=t[0],r=t[1],n=t[2];e/=95.047,r/=100,n/=108.883,e=e>.008856?e**(1/3):7.787*e+16/116,r=r>.008856?r**(1/3):7.787*r+16/116,n=n>.008856?n**(1/3):7.787*n+16/116;let i=116*r-16,o=500*(e-r),s=200*(r-n);return[i,o,s]};Y.lab.xyz=function(t){let e=t[0],r=t[1],n=t[2],i,o,s;o=(e+16)/116,i=r/500+o,s=o-n/200;let a=o**3,u=i**3,l=s**3;return o=a>.008856?a:(o-16/116)/7.787,i=u>.008856?u:(i-16/116)/7.787,s=l>.008856?l:(s-16/116)/7.787,i*=95.047,o*=100,s*=108.883,[i,o,s]};Y.lab.lch=function(t){let e=t[0],r=t[1],n=t[2],i;i=Math.atan2(n,r)*360/2/Math.PI,i<0&&(i+=360);let s=Math.sqrt(r*r+n*n);return[e,s,i]};Y.lch.lab=function(t){let e=t[0],r=t[1],i=t[2]/360*2*Math.PI,o=r*Math.cos(i),s=r*Math.sin(i);return[e,o,s]};Y.rgb.ansi16=function(t,e=null){let[r,n,i]=t,o=e===null?Y.rgb.hsv(t)[2]:e;if(o=Math.round(o/50),o===0)return 30;let s=30+(Math.round(i/255)<<2|Math.round(n/255)<<1|Math.round(r/255));return o===2&&(s+=60),s};Y.hsv.ansi16=function(t){return Y.rgb.ansi16(Y.hsv.rgb(t),t[2])};Y.rgb.ansi256=function(t){let e=t[0],r=t[1],n=t[2];return e===r&&r===n?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5)};Y.ansi16.rgb=function(t){let e=t%10;if(e===0||e===7)return t>50&&(e+=3.5),e=e/10.5*255,[e,e,e];let r=(~~(t>50)+1)*.5,n=(e&1)*r*255,i=(e>>1&1)*r*255,o=(e>>2&1)*r*255;return[n,i,o]};Y.ansi256.rgb=function(t){if(t>=232){let o=(t-232)*10+8;return[o,o,o]}t-=16;let e,r=Math.floor(t/36)/5*255,n=Math.floor((e=t%36)/6)/5*255,i=e%6/5*255;return[r,n,i]};Y.rgb.hex=function(t){let r=(((Math.round(t[0])&255)<<16)+((Math.round(t[1])&255)<<8)+(Math.round(t[2])&255)).toString(16).toUpperCase();return"000000".substring(r.length)+r};Y.hex.rgb=function(t){let e=t.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!e)return[0,0,0];let r=e[0];e[0].length===3&&(r=r.split("").map(a=>a+a).join(""));let n=parseInt(r,16),i=n>>16&255,o=n>>8&255,s=n&255;return[i,o,s]};Y.rgb.hcg=function(t){let e=t[0]/255,r=t[1]/255,n=t[2]/255,i=Math.max(Math.max(e,r),n),o=Math.min(Math.min(e,r),n),s=i-o,a,u;return s<1?a=o/(1-s):a=0,s<=0?u=0:i===e?u=(r-n)/s%6:i===r?u=2+(n-e)/s:u=4+(e-r)/s,u/=6,u%=1,[u*360,s*100,a*100]};Y.hsl.hcg=function(t){let e=t[1]/100,r=t[2]/100,n=r<.5?2*e*r:2*e*(1-r),i=0;return n<1&&(i=(r-.5*n)/(1-n)),[t[0],n*100,i*100]};Y.hsv.hcg=function(t){let e=t[1]/100,r=t[2]/100,n=e*r,i=0;return n<1&&(i=(r-n)/(1-n)),[t[0],n*100,i*100]};Y.hcg.rgb=function(t){let e=t[0]/360,r=t[1]/100,n=t[2]/100;if(r===0)return[n*255,n*255,n*255];let i=[0,0,0],o=e%1*6,s=o%1,a=1-s,u=0;switch(Math.floor(o)){case 0:i[0]=1,i[1]=s,i[2]=0;break;case 1:i[0]=a,i[1]=1,i[2]=0;break;case 2:i[0]=0,i[1]=1,i[2]=s;break;case 3:i[0]=0,i[1]=a,i[2]=1;break;case 4:i[0]=s,i[1]=0,i[2]=1;break;default:i[0]=1,i[1]=0,i[2]=a}return u=(1-r)*n,[(r*i[0]+u)*255,(r*i[1]+u)*255,(r*i[2]+u)*255]};Y.hcg.hsv=function(t){let e=t[1]/100,r=t[2]/100,n=e+r*(1-e),i=0;return n>0&&(i=e/n),[t[0],i*100,n*100]};Y.hcg.hsl=function(t){let e=t[1]/100,n=t[2]/100*(1-e)+.5*e,i=0;return n>0&&n<.5?i=e/(2*n):n>=.5&&n<1&&(i=e/(2*(1-n))),[t[0],i*100,n*100]};Y.hcg.hwb=function(t){let e=t[1]/100,r=t[2]/100,n=e+r*(1-e);return[t[0],(n-e)*100,(1-n)*100]};Y.hwb.hcg=function(t){let e=t[1]/100,n=1-t[2]/100,i=n-e,o=0;return i<1&&(o=(n-i)/(1-i)),[t[0],i*100,o*100]};Y.apple.rgb=function(t){return[t[0]/65535*255,t[1]/65535*255,t[2]/65535*255]};Y.rgb.apple=function(t){return[t[0]/255*65535,t[1]/255*65535,t[2]/255*65535]};Y.gray.rgb=function(t){return[t[0]/100*255,t[0]/100*255,t[0]/100*255]};Y.gray.hsl=function(t){return[0,0,t[0]]};Y.gray.hsv=Y.gray.hsl;Y.gray.hwb=function(t){return[0,100,t[0]]};Y.gray.cmyk=function(t){return[0,0,0,t[0]]};Y.gray.lab=function(t){return[t[0],0,0]};Y.gray.hex=function(t){let e=Math.round(t[0]/100*255)&255,n=((e<<16)+(e<<8)+e).toString(16).toUpperCase();return"000000".substring(n.length)+n};Y.rgb.gray=function(t){return[(t[0]+t[1]+t[2])/3/255*100]}});var qO=y((zce,BO)=>{var ld=Qy();function LK(){let t={},e=Object.keys(ld);for(let r=e.length,n=0;n<r;n++)t[e[n]]={distance:-1,parent:null};return t}function BK(t){let e=LK(),r=[t];for(e[t].distance=0;r.length;){let n=r.pop(),i=Object.keys(ld[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 qK(t,e){return function(r){return e(t(r))}}function MK(t,e){let r=[e[t].parent,t],n=ld[e[t].parent][t],i=e[t].parent;for(;e[i].parent;)r.unshift(e[i].parent),n=qK(ld[e[i].parent][i],n),i=e[i].parent;return n.conversion=r,n}BO.exports=function(t){let e=BK(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]=MK(s,e))}return r}});var UO=y((Gce,MO)=>{var eD=Qy(),UK=qO(),Bs={},HK=Object.keys(eD);function VK(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 zK(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}HK.forEach(t=>{Bs[t]={},Object.defineProperty(Bs[t],"channels",{value:eD[t].channels}),Object.defineProperty(Bs[t],"labels",{value:eD[t].labels});let e=UK(t);Object.keys(e).forEach(n=>{let i=e[n];Bs[t][n]=zK(i),Bs[t][n].raw=VK(i)})});MO.exports=Bs});var rD=y((Wce,WO)=>{"use strict";var HO=(t,e)=>(...r)=>`\x1B[${t(...r)+e}m`,VO=(t,e)=>(...r)=>{let n=t(...r);return`\x1B[${38+e};5;${n}m`},zO=(t,e)=>(...r)=>{let n=t(...r);return`\x1B[${38+e};2;${n[0]};${n[1]};${n[2]}m`},cd=t=>t,GO=(t,e,r)=>[t,e,r],qs=(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})},tD,Ms=(t,e,r,n)=>{tD===void 0&&(tD=UO());let i=n?10:0,o={};for(let[s,a]of Object.entries(tD)){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 GK(){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",qs(e.color,"ansi",()=>Ms(HO,"ansi16",cd,!1)),qs(e.color,"ansi256",()=>Ms(VO,"ansi256",cd,!1)),qs(e.color,"ansi16m",()=>Ms(zO,"rgb",GO,!1)),qs(e.bgColor,"ansi",()=>Ms(HO,"ansi16",cd,!0)),qs(e.bgColor,"ansi256",()=>Ms(VO,"ansi256",cd,!0)),qs(e.bgColor,"ansi16m",()=>Ms(zO,"rgb",GO,!0)),e}Object.defineProperty(WO,"exports",{enumerable:!0,get:GK})});var ZO=y((Kce,XO)=>{"use strict";var WK=Zy(),KK=$O(),KO=rD(),JO=["\x1B","\x9B"],fd=t=>`${JO[0]}[${t}m`,YO=(t,e,r)=>{let n=[];t=[...t];for(let i of t){let o=i;i.includes(";")&&(i=i.split(";")[0][0]+"0");let s=KO.codes.get(Number.parseInt(i,10));if(s){let a=t.indexOf(s.toString());a===-1?n.push(fd(e?s:o)):t.splice(a,1)}else if(e){n.push(fd(0));break}else n.push(fd(o))}if(e&&(n=n.filter((i,o)=>n.indexOf(i)===o),r!==void 0)){let i=fd(KO.codes.get(Number.parseInt(r,10)));n=n.reduce((o,s)=>s===i?[s,...o]:[...o,s],[])}return n.join("")};XO.exports=(t,e,r)=>{let n=[...t],i=[],o=typeof r=="number"?r:n.length,s=!1,a,u=0,l="";for(let[c,f]of n.entries()){let h=!1;if(JO.includes(f)){let d=/\d[^m]*/.exec(t.slice(c,c+18));a=d&&d.length>0?d[0]:void 0,u<o&&(s=!0,a!==void 0&&i.push(a))}else s&&f==="m"&&(s=!1,h=!0);if(!s&&!h&&u++,!KK({exact:!0}).test(f)&&WK(f.codePointAt())&&(u++,typeof r!="number"&&o++),u>e&&u<=o)l+=f;else if(u===e&&!s&&a!==void 0)l=YO(i);else if(u>=o){l+=YO(i,!0,a);break}}return l}});var eA=y((Yce,QO)=>{"use strict";QO.exports=({onlyFirst:t=!1}={})=>{let e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(e,t?void 0:"g")}});var dd=y((Jce,tA)=>{"use strict";var YK=eA();tA.exports=t=>typeof t=="string"?t.replace(YK(),""):t});var nA=y((Xce,rA)=>{"use strict";rA.exports=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFD])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83C\uDFF4\u200D\u2620)\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDF6\uD83C\uDDE6|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDBB\uDDD2-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5\uDEEB\uDEEC\uDEF4-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g}});var iD=y((Zce,nD)=>{"use strict";var JK=dd(),XK=Zy(),ZK=nA(),iA=t=>{if(typeof t!="string"||t.length===0||(t=JK(t),t.length===0))return 0;t=t.replace(ZK()," ");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+=XK(n)?2:1)}return e};nD.exports=iA;nD.exports.default=iA});var cA=y((Qce,lA)=>{"use strict";var Wu=iD(),QK=dd(),eY=rD(),hd=new Set(["\x1B","\x9B"]),tY=39,sD="\x07",aA="[",rY="]",uA="m",aD=`${rY}8;;`,oA=t=>`${hd.values().next().value}${aA}${t}${uA}`,sA=t=>`${hd.values().next().value}${aD}${t}${sD}`,nY=t=>t.split(" ").map(e=>Wu(e)),oD=(t,e,r)=>{let n=[...e],i=!1,o=!1,s=Wu(QK(t[t.length-1]));for(let[a,u]of n.entries()){let l=Wu(u);if(s+l<=r?t[t.length-1]+=u:(t.push(u),s=0),hd.has(u)&&(i=!0,o=n.slice(a+1).join("").startsWith(aD)),i){o?u===sD&&(i=!1,o=!1):u===uA&&(i=!1);continue}s+=l,s===r&&a<n.length-1&&(t.push(""),s=0)}!s&&t[t.length-1].length>0&&t.length>1&&(t[t.length-2]+=t.pop())},iY=t=>{let e=t.split(" "),r=e.length;for(;r>0&&!(Wu(e[r-1])>0);)r--;return r===e.length?t:e.slice(0,r).join(" ")+e.slice(r).join("")},oY=(t,e,r={})=>{if(r.trim!==!1&&t.trim()==="")return"";let n="",i,o,s=nY(t),a=[""];for(let[l,c]of t.split(" ").entries()){r.trim!==!1&&(a[a.length-1]=a[a.length-1].trimStart());let f=Wu(a[a.length-1]);if(l!==0&&(f>=e&&(r.wordWrap===!1||r.trim===!1)&&(a.push(""),f=0),(f>0||r.trim===!1)&&(a[a.length-1]+=" ",f++)),r.hard&&s[l]>e){let h=e-f,d=1+Math.floor((s[l]-h-1)/e);Math.floor((s[l]-1)/e)<d&&a.push(""),oD(a,c,e);continue}if(f+s[l]>e&&f>0&&s[l]>0){if(r.wordWrap===!1&&f<e){oD(a,c,e);continue}a.push("")}if(f+s[l]>e&&r.wordWrap===!1){oD(a,c,e);continue}a[a.length-1]+=c}r.trim!==!1&&(a=a.map(iY));let u=[...a.join(`
46
+ see https://github.com/jprichardson/node-fs-extra/issues/269`,"Warning","fs-extra-WARN0002");let{srcStat:n,destStat:i}=Hu.checkPathsSync(t,e,"copy",r);if(Hu.checkParentPathsSync(t,n,e,"copy"),r.filter&&!r.filter(t,e))return;let o=Uu.dirname(e);return Rt.existsSync(o)||uW(o),o2(i,t,e,r)}function o2(t,e,r,n){let o=(n.dereference?Rt.statSync:Rt.lstatSync)(e);if(o.isDirectory())return yW(o,t,e,r,n);if(o.isFile()||o.isCharacterDevice()||o.isBlockDevice())return fW(o,t,e,r,n);if(o.isSymbolicLink())return bW(t,e,r,n);throw o.isSocket()?new Error(`Cannot copy a socket file: ${e}`):o.isFIFO()?new Error(`Cannot copy a FIFO pipe: ${e}`):new Error(`Unknown file: ${e}`)}function fW(t,e,r,n,i){return e?dW(t,r,n,i):s2(t,r,n,i)}function dW(t,e,r,n){if(n.overwrite)return Rt.unlinkSync(r),s2(t,e,r,n);if(n.errorOnExist)throw new Error(`'${r}' already exists`)}function s2(t,e,r,n){return Rt.copyFileSync(e,r),n.preserveTimestamps&&hW(t.mode,e,r),zy(r,t.mode)}function hW(t,e,r){return pW(t)&&mW(r,t),gW(e,r)}function pW(t){return(t&128)===0}function mW(t,e){return zy(t,e|128)}function zy(t,e){return Rt.chmodSync(t,e)}function gW(t,e){let r=Rt.statSync(t);return lW(e,r.atime,r.mtime)}function yW(t,e,r,n,i){return e?a2(r,n,i):DW(t.mode,r,n,i)}function DW(t,e,r,n){return Rt.mkdirSync(r),a2(e,r,n),zy(r,t)}function a2(t,e,r){let n=Rt.opendirSync(t);try{let i;for(;(i=n.readSync())!==null;)vW(i.name,t,e,r)}finally{n.closeSync()}}function vW(t,e,r,n){let i=Uu.join(e,t),o=Uu.join(r,t);if(n.filter&&!n.filter(i,o))return;let{destStat:s}=Hu.checkPathsSync(i,o,"copy",n);return o2(s,i,o,n)}function bW(t,e,r,n){let i=Rt.readlinkSync(e);if(n.dereference&&(i=Uu.resolve(process.cwd(),i)),t){let o;try{o=Rt.readlinkSync(r)}catch(s){if(s.code==="EINVAL"||s.code==="UNKNOWN")return Rt.symlinkSync(i,r);throw s}if(n.dereference&&(o=Uu.resolve(process.cwd(),o)),Hu.isSrcSubdir(i,o))throw new Error(`Cannot copy '${i}' to a subdirectory of itself, '${o}'.`);if(Hu.isSrcSubdir(o,i))throw new Error(`Cannot overwrite '${o}' with '${i}'.`);return wW(i,r)}else return Rt.symlinkSync(i,r)}function wW(t,e){return Rt.unlinkSync(e),Rt.symlinkSync(t,e)}u2.exports=cW});var rd=D((yce,c2)=>{"use strict";var _W=pt().fromPromise;c2.exports={copy:_W(i2()),copySync:l2()}});var Vu=D((Dce,d2)=>{"use strict";var f2=Xn(),EW=pt().fromCallback;function CW(t,e){f2.rm(t,{recursive:!0,force:!0},e)}function SW(t){f2.rmSync(t,{recursive:!0,force:!0})}d2.exports={remove:EW(CW),removeSync:SW}});var b2=D((vce,v2)=>{"use strict";var xW=pt().fromPromise,m2=Pt(),g2=require("path"),y2=xr(),D2=Vu(),h2=xW(async function(e){let r;try{r=await m2.readdir(e)}catch{return y2.mkdirs(e)}return Promise.all(r.map(n=>D2.remove(g2.join(e,n))))});function p2(t){let e;try{e=m2.readdirSync(t)}catch{return y2.mkdirsSync(t)}e.forEach(r=>{r=g2.join(t,r),D2.removeSync(r)})}v2.exports={emptyDirSync:p2,emptydirSync:p2,emptyDir:h2,emptydir:h2}});var C2=D((bce,E2)=>{"use strict";var FW=pt().fromPromise,w2=require("path"),Dn=Pt(),_2=xr();async function OW(t){let e;try{e=await Dn.stat(t)}catch{}if(e&&e.isFile())return;let r=w2.dirname(t),n=null;try{n=await Dn.stat(r)}catch(i){if(i.code==="ENOENT"){await _2.mkdirs(r),await Dn.writeFile(t,"");return}else throw i}n.isDirectory()?await Dn.writeFile(t,""):await Dn.readdir(r)}function AW(t){let e;try{e=Dn.statSync(t)}catch{}if(e&&e.isFile())return;let r=w2.dirname(t);try{Dn.statSync(r).isDirectory()||Dn.readdirSync(r)}catch(n){if(n&&n.code==="ENOENT")_2.mkdirsSync(r);else throw n}Dn.writeFileSync(t,"")}E2.exports={createFile:FW(OW),createFileSync:AW}});var A2=D((wce,O2)=>{"use strict";var kW=pt().fromPromise,S2=require("path"),ti=Pt(),x2=xr(),{pathExists:TW}=ei(),{areIdentical:F2}=ro();async function PW(t,e){let r;try{r=await ti.lstat(e)}catch{}let n;try{n=await ti.lstat(t)}catch(s){throw s.message=s.message.replace("lstat","ensureLink"),s}if(r&&F2(n,r))return;let i=S2.dirname(e);await TW(i)||await x2.mkdirs(i),await ti.link(t,e)}function RW(t,e){let r;try{r=ti.lstatSync(e)}catch{}try{let o=ti.lstatSync(t);if(r&&F2(o,r))return}catch(o){throw o.message=o.message.replace("lstat","ensureLink"),o}let n=S2.dirname(e);return ti.existsSync(n)||x2.mkdirsSync(n),ti.linkSync(t,e)}O2.exports={createLink:kW(PW),createLinkSync:RW}});var T2=D((_ce,k2)=>{"use strict";var ri=require("path"),zu=Pt(),{pathExists:$W}=ei(),IW=pt().fromPromise;async function jW(t,e){if(ri.isAbsolute(t)){try{await zu.lstat(t)}catch(o){throw o.message=o.message.replace("lstat","ensureSymlink"),o}return{toCwd:t,toDst:t}}let r=ri.dirname(e),n=ri.join(r,t);if(await $W(n))return{toCwd:n,toDst:t};try{await zu.lstat(t)}catch(o){throw o.message=o.message.replace("lstat","ensureSymlink"),o}return{toCwd:t,toDst:ri.relative(r,t)}}function NW(t,e){if(ri.isAbsolute(t)){if(!zu.existsSync(t))throw new Error("absolute srcpath does not exist");return{toCwd:t,toDst:t}}let r=ri.dirname(e),n=ri.join(r,t);if(zu.existsSync(n))return{toCwd:n,toDst:t};if(!zu.existsSync(t))throw new Error("relative srcpath does not exist");return{toCwd:t,toDst:ri.relative(r,t)}}k2.exports={symlinkPaths:IW(jW),symlinkPathsSync:NW}});var $2=D((Ece,R2)=>{"use strict";var P2=Pt(),LW=pt().fromPromise;async function BW(t,e){if(e)return e;let r;try{r=await P2.lstat(t)}catch{return"file"}return r&&r.isDirectory()?"dir":"file"}function qW(t,e){if(e)return e;let r;try{r=P2.lstatSync(t)}catch{return"file"}return r&&r.isDirectory()?"dir":"file"}R2.exports={symlinkType:LW(BW),symlinkTypeSync:qW}});var L2=D((Cce,N2)=>{"use strict";var MW=pt().fromPromise,I2=require("path"),zr=Pt(),{mkdirs:UW,mkdirsSync:HW}=xr(),{symlinkPaths:VW,symlinkPathsSync:zW}=T2(),{symlinkType:GW,symlinkTypeSync:WW}=$2(),{pathExists:KW}=ei(),{areIdentical:j2}=ro();async function YW(t,e,r){let n;try{n=await zr.lstat(e)}catch{}if(n&&n.isSymbolicLink()){let[a,u]=await Promise.all([zr.stat(t),zr.stat(e)]);if(j2(a,u))return}let i=await VW(t,e);t=i.toDst;let o=await GW(i.toCwd,r),s=I2.dirname(e);return await KW(s)||await UW(s),zr.symlink(t,e,o)}function JW(t,e,r){let n;try{n=zr.lstatSync(e)}catch{}if(n&&n.isSymbolicLink()){let a=zr.statSync(t),u=zr.statSync(e);if(j2(a,u))return}let i=zW(t,e);t=i.toDst,r=WW(i.toCwd,r);let o=I2.dirname(e);return zr.existsSync(o)||HW(o),zr.symlinkSync(t,e,r)}N2.exports={createSymlink:MW(YW),createSymlinkSync:JW}});var G2=D((Sce,z2)=>{"use strict";var{createFile:B2,createFileSync:q2}=C2(),{createLink:M2,createLinkSync:U2}=A2(),{createSymlink:H2,createSymlinkSync:V2}=L2();z2.exports={createFile:B2,createFileSync:q2,ensureFile:B2,ensureFileSync:q2,createLink:M2,createLinkSync:U2,ensureLink:M2,ensureLinkSync:U2,createSymlink:H2,createSymlinkSync:V2,ensureSymlink:H2,ensureSymlinkSync:V2}});var nd=D((xce,W2)=>{function XW(t,{EOL:e=`
47
+ `,finalEOL:r=!0,replacer:n=null,spaces:i}={}){let o=r?e:"";return JSON.stringify(t,n,i).replace(/\n/g,e)+o}function ZW(t){return Buffer.isBuffer(t)&&(t=t.toString("utf8")),t.replace(/^\uFEFF/,"")}W2.exports={stringify:XW,stripBom:ZW}});var X2=D((Fce,J2)=>{var Is;try{Is=Xn()}catch{Is=require("fs")}var id=pt(),{stringify:K2,stripBom:Y2}=nd();async function QW(t,e={}){typeof e=="string"&&(e={encoding:e});let r=e.fs||Is,n="throws"in e?e.throws:!0,i=await id.fromCallback(r.readFile)(t,e);i=Y2(i);let o;try{o=JSON.parse(i,e?e.reviver:null)}catch(s){if(n)throw s.message=`${t}: ${s.message}`,s;return null}return o}var eK=id.fromPromise(QW);function tK(t,e={}){typeof e=="string"&&(e={encoding:e});let r=e.fs||Is,n="throws"in e?e.throws:!0;try{let i=r.readFileSync(t,e);return i=Y2(i),JSON.parse(i,e.reviver)}catch(i){if(n)throw i.message=`${t}: ${i.message}`,i;return null}}async function rK(t,e,r={}){let n=r.fs||Is,i=K2(e,r);await id.fromCallback(n.writeFile)(t,i,r)}var nK=id.fromPromise(rK);function iK(t,e,r={}){let n=r.fs||Is,i=K2(e,r);return n.writeFileSync(t,i,r)}var oK={readFile:eK,readFileSync:tK,writeFile:nK,writeFileSync:iK};J2.exports=oK});var Q2=D((Oce,Z2)=>{"use strict";var od=X2();Z2.exports={readJson:od.readFile,readJsonSync:od.readFileSync,writeJson:od.writeFile,writeJsonSync:od.writeFileSync}});var sd=D((Ace,rO)=>{"use strict";var sK=pt().fromPromise,Gy=Pt(),eO=require("path"),tO=xr(),aK=ei().pathExists;async function uK(t,e,r="utf-8"){let n=eO.dirname(t);return await aK(n)||await tO.mkdirs(n),Gy.writeFile(t,e,r)}function lK(t,...e){let r=eO.dirname(t);Gy.existsSync(r)||tO.mkdirsSync(r),Gy.writeFileSync(t,...e)}rO.exports={outputFile:sK(uK),outputFileSync:lK}});var iO=D((kce,nO)=>{"use strict";var{stringify:cK}=nd(),{outputFile:fK}=sd();async function dK(t,e,r={}){let n=cK(e,r);await fK(t,n,r)}nO.exports=dK});var sO=D((Tce,oO)=>{"use strict";var{stringify:hK}=nd(),{outputFileSync:pK}=sd();function mK(t,e,r){let n=hK(e,r);pK(t,n,r)}oO.exports=mK});var uO=D((Pce,aO)=>{"use strict";var gK=pt().fromPromise,$t=Q2();$t.outputJson=gK(iO());$t.outputJsonSync=sO();$t.outputJSON=$t.outputJson;$t.outputJSONSync=$t.outputJsonSync;$t.writeJSON=$t.writeJson;$t.writeJSONSync=$t.writeJsonSync;$t.readJSON=$t.readJson;$t.readJSONSync=$t.readJsonSync;aO.exports=$t});var hO=D((Rce,dO)=>{"use strict";var yK=Pt(),lO=require("path"),{copy:DK}=rd(),{remove:fO}=Vu(),{mkdirp:vK}=xr(),{pathExists:bK}=ei(),cO=ro();async function wK(t,e,r={}){let n=r.overwrite||r.clobber||!1,{srcStat:i,isChangingCase:o=!1}=await cO.checkPaths(t,e,"move",r);await cO.checkParentPaths(t,i,e,"move");let s=lO.dirname(e);return lO.parse(s).root!==s&&await vK(s),_K(t,e,n,o)}async function _K(t,e,r,n){if(!n){if(r)await fO(e);else if(await bK(e))throw new Error("dest already exists.")}try{await yK.rename(t,e)}catch(i){if(i.code!=="EXDEV")throw i;await EK(t,e,r)}}async function EK(t,e,r){return await DK(t,e,{overwrite:r,errorOnExist:!0,preserveTimestamps:!0}),fO(t)}dO.exports=wK});var DO=D(($ce,yO)=>{"use strict";var mO=Xn(),Ky=require("path"),CK=rd().copySync,gO=Vu().removeSync,SK=xr().mkdirpSync,pO=ro();function xK(t,e,r){r=r||{};let n=r.overwrite||r.clobber||!1,{srcStat:i,isChangingCase:o=!1}=pO.checkPathsSync(t,e,"move",r);return pO.checkParentPathsSync(t,i,e,"move"),FK(e)||SK(Ky.dirname(e)),OK(t,e,n,o)}function FK(t){let e=Ky.dirname(t);return Ky.parse(e).root===e}function OK(t,e,r,n){if(n)return Wy(t,e,r);if(r)return gO(e),Wy(t,e,r);if(mO.existsSync(e))throw new Error("dest already exists.");return Wy(t,e,r)}function Wy(t,e,r){try{mO.renameSync(t,e)}catch(n){if(n.code!=="EXDEV")throw n;return AK(t,e,r)}}function AK(t,e,r){return CK(t,e,{overwrite:r,errorOnExist:!0,preserveTimestamps:!0}),gO(t)}yO.exports=xK});var bO=D((Ice,vO)=>{"use strict";var kK=pt().fromPromise;vO.exports={move:kK(hO()),moveSync:DO()}});var js=D((jce,wO)=>{"use strict";wO.exports={...Pt(),...rd(),...b2(),...G2(),...uO(),...xr(),...bO(),...sd(),...ei(),...Vu()}});var OO=D((Nce,FO)=>{"use strict";var Yy,EO,CO,SO,xO=!0;typeof process<"u"&&({FORCE_COLOR:Yy,NODE_DISABLE_COLORS:EO,NO_COLOR:CO,TERM:SO}=process.env||{},xO=process.stdout&&process.stdout.isTTY);var be={enabled:!EO&&CO==null&&SO!=="dumb"&&(Yy!=null&&Yy!=="0"||xO),reset:xe(0,0),bold:xe(1,22),dim:xe(2,22),italic:xe(3,23),underline:xe(4,24),inverse:xe(7,27),hidden:xe(8,28),strikethrough:xe(9,29),black:xe(30,39),red:xe(31,39),green:xe(32,39),yellow:xe(33,39),blue:xe(34,39),magenta:xe(35,39),cyan:xe(36,39),white:xe(37,39),gray:xe(90,39),grey:xe(90,39),bgBlack:xe(40,49),bgRed:xe(41,49),bgGreen:xe(42,49),bgYellow:xe(43,49),bgBlue:xe(44,49),bgMagenta:xe(45,49),bgCyan:xe(46,49),bgWhite:xe(47,49)};function _O(t,e){let r=0,n,i="",o="";for(;r<t.length;r++)n=t[r],i+=n.open,o+=n.close,~e.indexOf(n.close)&&(e=e.replace(n.rgx,n.close+n.open));return i+e+o}function TK(t,e){let r={has:t,keys:e};return r.reset=be.reset.bind(r),r.bold=be.bold.bind(r),r.dim=be.dim.bind(r),r.italic=be.italic.bind(r),r.underline=be.underline.bind(r),r.inverse=be.inverse.bind(r),r.hidden=be.hidden.bind(r),r.strikethrough=be.strikethrough.bind(r),r.black=be.black.bind(r),r.red=be.red.bind(r),r.green=be.green.bind(r),r.yellow=be.yellow.bind(r),r.blue=be.blue.bind(r),r.magenta=be.magenta.bind(r),r.cyan=be.cyan.bind(r),r.white=be.white.bind(r),r.gray=be.gray.bind(r),r.grey=be.grey.bind(r),r.bgBlack=be.bgBlack.bind(r),r.bgRed=be.bgRed.bind(r),r.bgGreen=be.bgGreen.bind(r),r.bgYellow=be.bgYellow.bind(r),r.bgBlue=be.bgBlue.bind(r),r.bgMagenta=be.bgMagenta.bind(r),r.bgCyan=be.bgCyan.bind(r),r.bgWhite=be.bgWhite.bind(r),r}function xe(t,e){let r={open:`\x1B[${t}m`,close:`\x1B[${e}m`,rgx:new RegExp(`\\x1b\\[${e}m`,"g")};return function(n){return this!==void 0&&this.has!==void 0?(~this.has.indexOf(t)||(this.has.push(t),this.keys.push(r)),n===void 0?this:be.enabled?_O(this.keys,n+""):n+""):n===void 0?TK([t],[r]):be.enabled?_O([r],n+""):n+""}}FO.exports=be});var Ns=D(rt=>{"use strict";Object.defineProperty(rt,"__esModule",{value:!0});rt.ancillary=rt.failure=rt.success=rt.input=rt.weak=rt.strong=void 0;var PK=(nr(),je(rr)),Gr=PK.__importDefault(OO());rt.strong=Gr.default.bold;rt.weak=Gr.default.dim;rt.input=Gr.default.cyan;rt.success=Gr.default.green;rt.failure=Gr.default.red;rt.ancillary=Gr.default.cyan;var RK={strong:rt.strong,weak:rt.weak,input:rt.input,success:rt.success,failure:rt.failure,ancillary:rt.ancillary,log:{DEBUG:Gr.default.magenta,INFO:Gr.default.cyan,WARN:Gr.default.yellow,ERROR:Gr.default.red}};rt.default=RK});var Jy=D(ad=>{"use strict";Object.defineProperty(ad,"__esModule",{value:!0});ad.EscapeCode=void 0;var Fr="\x1B[",gt=class{};ad.EscapeCode=gt;gt.cursorLeft=()=>`${Fr}G`;gt.cursorUp=(t=1)=>`${Fr}${t}A`;gt.cursorDown=(t=1)=>`${Fr}${t}B`;gt.cursorForward=(t=1)=>`${Fr}${t}C`;gt.cursorBackward=(t=1)=>`${Fr}${t}D`;gt.cursorHide=()=>`${Fr}?25l`;gt.cursorShow=()=>`${Fr}?25h`;gt.eraseLine=()=>`${Fr}2K`;gt.eraseLines=t=>{let e="";for(let r=0;r<t;r++)e+=gt.eraseLine(),r<t-1&&(e+=gt.cursorUp());return`${e}${gt.cursorLeft()}`};gt.eraseUp=()=>`${Fr}1J`;gt.eraseDown=()=>`${Fr}J`;gt.eraseScreen=()=>`${Fr}2J`});var kO=D(ud=>{"use strict";Object.defineProperty(ud,"__esModule",{value:!0});ud.Cursor=void 0;var $K=(nr(),je(rr)),IK=$K.__importDefault(wy()),AO=Jy(),Ls=class t{static show(){t.stream.isTTY&&(t._isVisible=!0,t.stream.write(AO.EscapeCode.cursorShow()))}static hide(){t.stream.isTTY&&(t._listenerAttached||((0,IK.default)(()=>{t.show()}),t._listenerAttached=!0),t._isVisible=!1,t.stream.write(AO.EscapeCode.cursorHide()))}static toggle(){t._isVisible?t.hide():t.show()}};ud.Cursor=Ls;Ls.stream=process.stderr;Ls._isVisible=!0;Ls._listenerAttached=!1});var Zy=D((Mce,Xy)=>{"use strict";var TO=t=>Number.isNaN(t)?!1:t>=4352&&(t<=4447||t===9001||t===9002||11904<=t&&t<=12871&&t!==12351||12880<=t&&t<=19903||19968<=t&&t<=42182||43360<=t&&t<=43388||44032<=t&&t<=55203||63744<=t&&t<=64255||65040<=t&&t<=65049||65072<=t&&t<=65131||65281<=t&&t<=65376||65504<=t&&t<=65510||110592<=t&&t<=110593||127488<=t&&t<=127569||131072<=t&&t<=262141);Xy.exports=TO;Xy.exports.default=TO});var $O=D((Uce,RO)=>{"use strict";var PO="[\uD800-\uDBFF][\uDC00-\uDFFF]",jK=t=>t&&t.exact?new RegExp(`^${PO}$`):new RegExp(PO,"g");RO.exports=jK});var jO=D((Hce,IO)=>{"use strict";IO.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}});var Qy=D((Vce,LO)=>{var Gu=jO(),NO={};for(let t of Object.keys(Gu))NO[Gu[t]]=t;var Y={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};LO.exports=Y;for(let t of Object.keys(Y)){if(!("channels"in Y[t]))throw new Error("missing channels property: "+t);if(!("labels"in Y[t]))throw new Error("missing channel labels property: "+t);if(Y[t].labels.length!==Y[t].channels)throw new Error("channel and label counts mismatch: "+t);let{channels:e,labels:r}=Y[t];delete Y[t].channels,delete Y[t].labels,Object.defineProperty(Y[t],"channels",{value:e}),Object.defineProperty(Y[t],"labels",{value:r})}Y.rgb.hsl=function(t){let e=t[0]/255,r=t[1]/255,n=t[2]/255,i=Math.min(e,r,n),o=Math.max(e,r,n),s=o-i,a,u;o===i?a=0:e===o?a=(r-n)/s:r===o?a=2+(n-e)/s:n===o&&(a=4+(e-r)/s),a=Math.min(a*60,360),a<0&&(a+=360);let l=(i+o)/2;return o===i?u=0:l<=.5?u=s/(o+i):u=s/(2-o-i),[a,u*100,l*100]};Y.rgb.hsv=function(t){let e,r,n,i,o,s=t[0]/255,a=t[1]/255,u=t[2]/255,l=Math.max(s,a,u),c=l-Math.min(s,a,u),f=function(h){return(l-h)/6/c+1/2};return c===0?(i=0,o=0):(o=c/l,e=f(s),r=f(a),n=f(u),s===l?i=n-r:a===l?i=1/3+e-n:u===l&&(i=2/3+r-e),i<0?i+=1:i>1&&(i-=1)),[i*360,o*100,l*100]};Y.rgb.hwb=function(t){let e=t[0],r=t[1],n=t[2],i=Y.rgb.hsl(t)[0],o=1/255*Math.min(e,Math.min(r,n));return n=1-1/255*Math.max(e,Math.max(r,n)),[i,o*100,n*100]};Y.rgb.cmyk=function(t){let e=t[0]/255,r=t[1]/255,n=t[2]/255,i=Math.min(1-e,1-r,1-n),o=(1-e-i)/(1-i)||0,s=(1-r-i)/(1-i)||0,a=(1-n-i)/(1-i)||0;return[o*100,s*100,a*100,i*100]};function NK(t,e){return(t[0]-e[0])**2+(t[1]-e[1])**2+(t[2]-e[2])**2}Y.rgb.keyword=function(t){let e=NO[t];if(e)return e;let r=1/0,n;for(let i of Object.keys(Gu)){let o=Gu[i],s=NK(t,o);s<r&&(r=s,n=i)}return n};Y.keyword.rgb=function(t){return Gu[t]};Y.rgb.xyz=function(t){let e=t[0]/255,r=t[1]/255,n=t[2]/255;e=e>.04045?((e+.055)/1.055)**2.4:e/12.92,r=r>.04045?((r+.055)/1.055)**2.4:r/12.92,n=n>.04045?((n+.055)/1.055)**2.4:n/12.92;let i=e*.4124+r*.3576+n*.1805,o=e*.2126+r*.7152+n*.0722,s=e*.0193+r*.1192+n*.9505;return[i*100,o*100,s*100]};Y.rgb.lab=function(t){let e=Y.rgb.xyz(t),r=e[0],n=e[1],i=e[2];r/=95.047,n/=100,i/=108.883,r=r>.008856?r**(1/3):7.787*r+16/116,n=n>.008856?n**(1/3):7.787*n+16/116,i=i>.008856?i**(1/3):7.787*i+16/116;let o=116*n-16,s=500*(r-n),a=200*(n-i);return[o,s,a]};Y.hsl.rgb=function(t){let e=t[0]/360,r=t[1]/100,n=t[2]/100,i,o,s;if(r===0)return s=n*255,[s,s,s];n<.5?i=n*(1+r):i=n+r-n*r;let a=2*n-i,u=[0,0,0];for(let l=0;l<3;l++)o=e+1/3*-(l-1),o<0&&o++,o>1&&o--,6*o<1?s=a+(i-a)*6*o:2*o<1?s=i:3*o<2?s=a+(i-a)*(2/3-o)*6:s=a,u[l]=s*255;return u};Y.hsl.hsv=function(t){let e=t[0],r=t[1]/100,n=t[2]/100,i=r,o=Math.max(n,.01);n*=2,r*=n<=1?n:2-n,i*=o<=1?o:2-o;let s=(n+r)/2,a=n===0?2*i/(o+i):2*r/(n+r);return[e,a*100,s*100]};Y.hsv.rgb=function(t){let e=t[0]/60,r=t[1]/100,n=t[2]/100,i=Math.floor(e)%6,o=e-Math.floor(e),s=255*n*(1-r),a=255*n*(1-r*o),u=255*n*(1-r*(1-o));switch(n*=255,i){case 0:return[n,u,s];case 1:return[a,n,s];case 2:return[s,n,u];case 3:return[s,a,n];case 4:return[u,s,n];case 5:return[n,s,a]}};Y.hsv.hsl=function(t){let e=t[0],r=t[1]/100,n=t[2]/100,i=Math.max(n,.01),o,s;s=(2-r)*n;let a=(2-r)*i;return o=r*i,o/=a<=1?a:2-a,o=o||0,s/=2,[e,o*100,s*100]};Y.hwb.rgb=function(t){let e=t[0]/360,r=t[1]/100,n=t[2]/100,i=r+n,o;i>1&&(r/=i,n/=i);let s=Math.floor(6*e),a=1-n;o=6*e-s,(s&1)!==0&&(o=1-o);let u=r+o*(a-r),l,c,f;switch(s){default:case 6:case 0:l=a,c=u,f=r;break;case 1:l=u,c=a,f=r;break;case 2:l=r,c=a,f=u;break;case 3:l=r,c=u,f=a;break;case 4:l=u,c=r,f=a;break;case 5:l=a,c=r,f=u;break}return[l*255,c*255,f*255]};Y.cmyk.rgb=function(t){let e=t[0]/100,r=t[1]/100,n=t[2]/100,i=t[3]/100,o=1-Math.min(1,e*(1-i)+i),s=1-Math.min(1,r*(1-i)+i),a=1-Math.min(1,n*(1-i)+i);return[o*255,s*255,a*255]};Y.xyz.rgb=function(t){let e=t[0]/100,r=t[1]/100,n=t[2]/100,i,o,s;return i=e*3.2406+r*-1.5372+n*-.4986,o=e*-.9689+r*1.8758+n*.0415,s=e*.0557+r*-.204+n*1.057,i=i>.0031308?1.055*i**(1/2.4)-.055:i*12.92,o=o>.0031308?1.055*o**(1/2.4)-.055:o*12.92,s=s>.0031308?1.055*s**(1/2.4)-.055:s*12.92,i=Math.min(Math.max(0,i),1),o=Math.min(Math.max(0,o),1),s=Math.min(Math.max(0,s),1),[i*255,o*255,s*255]};Y.xyz.lab=function(t){let e=t[0],r=t[1],n=t[2];e/=95.047,r/=100,n/=108.883,e=e>.008856?e**(1/3):7.787*e+16/116,r=r>.008856?r**(1/3):7.787*r+16/116,n=n>.008856?n**(1/3):7.787*n+16/116;let i=116*r-16,o=500*(e-r),s=200*(r-n);return[i,o,s]};Y.lab.xyz=function(t){let e=t[0],r=t[1],n=t[2],i,o,s;o=(e+16)/116,i=r/500+o,s=o-n/200;let a=o**3,u=i**3,l=s**3;return o=a>.008856?a:(o-16/116)/7.787,i=u>.008856?u:(i-16/116)/7.787,s=l>.008856?l:(s-16/116)/7.787,i*=95.047,o*=100,s*=108.883,[i,o,s]};Y.lab.lch=function(t){let e=t[0],r=t[1],n=t[2],i;i=Math.atan2(n,r)*360/2/Math.PI,i<0&&(i+=360);let s=Math.sqrt(r*r+n*n);return[e,s,i]};Y.lch.lab=function(t){let e=t[0],r=t[1],i=t[2]/360*2*Math.PI,o=r*Math.cos(i),s=r*Math.sin(i);return[e,o,s]};Y.rgb.ansi16=function(t,e=null){let[r,n,i]=t,o=e===null?Y.rgb.hsv(t)[2]:e;if(o=Math.round(o/50),o===0)return 30;let s=30+(Math.round(i/255)<<2|Math.round(n/255)<<1|Math.round(r/255));return o===2&&(s+=60),s};Y.hsv.ansi16=function(t){return Y.rgb.ansi16(Y.hsv.rgb(t),t[2])};Y.rgb.ansi256=function(t){let e=t[0],r=t[1],n=t[2];return e===r&&r===n?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5)};Y.ansi16.rgb=function(t){let e=t%10;if(e===0||e===7)return t>50&&(e+=3.5),e=e/10.5*255,[e,e,e];let r=(~~(t>50)+1)*.5,n=(e&1)*r*255,i=(e>>1&1)*r*255,o=(e>>2&1)*r*255;return[n,i,o]};Y.ansi256.rgb=function(t){if(t>=232){let o=(t-232)*10+8;return[o,o,o]}t-=16;let e,r=Math.floor(t/36)/5*255,n=Math.floor((e=t%36)/6)/5*255,i=e%6/5*255;return[r,n,i]};Y.rgb.hex=function(t){let r=(((Math.round(t[0])&255)<<16)+((Math.round(t[1])&255)<<8)+(Math.round(t[2])&255)).toString(16).toUpperCase();return"000000".substring(r.length)+r};Y.hex.rgb=function(t){let e=t.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!e)return[0,0,0];let r=e[0];e[0].length===3&&(r=r.split("").map(a=>a+a).join(""));let n=parseInt(r,16),i=n>>16&255,o=n>>8&255,s=n&255;return[i,o,s]};Y.rgb.hcg=function(t){let e=t[0]/255,r=t[1]/255,n=t[2]/255,i=Math.max(Math.max(e,r),n),o=Math.min(Math.min(e,r),n),s=i-o,a,u;return s<1?a=o/(1-s):a=0,s<=0?u=0:i===e?u=(r-n)/s%6:i===r?u=2+(n-e)/s:u=4+(e-r)/s,u/=6,u%=1,[u*360,s*100,a*100]};Y.hsl.hcg=function(t){let e=t[1]/100,r=t[2]/100,n=r<.5?2*e*r:2*e*(1-r),i=0;return n<1&&(i=(r-.5*n)/(1-n)),[t[0],n*100,i*100]};Y.hsv.hcg=function(t){let e=t[1]/100,r=t[2]/100,n=e*r,i=0;return n<1&&(i=(r-n)/(1-n)),[t[0],n*100,i*100]};Y.hcg.rgb=function(t){let e=t[0]/360,r=t[1]/100,n=t[2]/100;if(r===0)return[n*255,n*255,n*255];let i=[0,0,0],o=e%1*6,s=o%1,a=1-s,u=0;switch(Math.floor(o)){case 0:i[0]=1,i[1]=s,i[2]=0;break;case 1:i[0]=a,i[1]=1,i[2]=0;break;case 2:i[0]=0,i[1]=1,i[2]=s;break;case 3:i[0]=0,i[1]=a,i[2]=1;break;case 4:i[0]=s,i[1]=0,i[2]=1;break;default:i[0]=1,i[1]=0,i[2]=a}return u=(1-r)*n,[(r*i[0]+u)*255,(r*i[1]+u)*255,(r*i[2]+u)*255]};Y.hcg.hsv=function(t){let e=t[1]/100,r=t[2]/100,n=e+r*(1-e),i=0;return n>0&&(i=e/n),[t[0],i*100,n*100]};Y.hcg.hsl=function(t){let e=t[1]/100,n=t[2]/100*(1-e)+.5*e,i=0;return n>0&&n<.5?i=e/(2*n):n>=.5&&n<1&&(i=e/(2*(1-n))),[t[0],i*100,n*100]};Y.hcg.hwb=function(t){let e=t[1]/100,r=t[2]/100,n=e+r*(1-e);return[t[0],(n-e)*100,(1-n)*100]};Y.hwb.hcg=function(t){let e=t[1]/100,n=1-t[2]/100,i=n-e,o=0;return i<1&&(o=(n-i)/(1-i)),[t[0],i*100,o*100]};Y.apple.rgb=function(t){return[t[0]/65535*255,t[1]/65535*255,t[2]/65535*255]};Y.rgb.apple=function(t){return[t[0]/255*65535,t[1]/255*65535,t[2]/255*65535]};Y.gray.rgb=function(t){return[t[0]/100*255,t[0]/100*255,t[0]/100*255]};Y.gray.hsl=function(t){return[0,0,t[0]]};Y.gray.hsv=Y.gray.hsl;Y.gray.hwb=function(t){return[0,100,t[0]]};Y.gray.cmyk=function(t){return[0,0,0,t[0]]};Y.gray.lab=function(t){return[t[0],0,0]};Y.gray.hex=function(t){let e=Math.round(t[0]/100*255)&255,n=((e<<16)+(e<<8)+e).toString(16).toUpperCase();return"000000".substring(n.length)+n};Y.rgb.gray=function(t){return[(t[0]+t[1]+t[2])/3/255*100]}});var qO=D((zce,BO)=>{var ld=Qy();function LK(){let t={},e=Object.keys(ld);for(let r=e.length,n=0;n<r;n++)t[e[n]]={distance:-1,parent:null};return t}function BK(t){let e=LK(),r=[t];for(e[t].distance=0;r.length;){let n=r.pop(),i=Object.keys(ld[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 qK(t,e){return function(r){return e(t(r))}}function MK(t,e){let r=[e[t].parent,t],n=ld[e[t].parent][t],i=e[t].parent;for(;e[i].parent;)r.unshift(e[i].parent),n=qK(ld[e[i].parent][i],n),i=e[i].parent;return n.conversion=r,n}BO.exports=function(t){let e=BK(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]=MK(s,e))}return r}});var UO=D((Gce,MO)=>{var eD=Qy(),UK=qO(),Bs={},HK=Object.keys(eD);function VK(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 zK(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}HK.forEach(t=>{Bs[t]={},Object.defineProperty(Bs[t],"channels",{value:eD[t].channels}),Object.defineProperty(Bs[t],"labels",{value:eD[t].labels});let e=UK(t);Object.keys(e).forEach(n=>{let i=e[n];Bs[t][n]=zK(i),Bs[t][n].raw=VK(i)})});MO.exports=Bs});var rD=D((Wce,WO)=>{"use strict";var HO=(t,e)=>(...r)=>`\x1B[${t(...r)+e}m`,VO=(t,e)=>(...r)=>{let n=t(...r);return`\x1B[${38+e};5;${n}m`},zO=(t,e)=>(...r)=>{let n=t(...r);return`\x1B[${38+e};2;${n[0]};${n[1]};${n[2]}m`},cd=t=>t,GO=(t,e,r)=>[t,e,r],qs=(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})},tD,Ms=(t,e,r,n)=>{tD===void 0&&(tD=UO());let i=n?10:0,o={};for(let[s,a]of Object.entries(tD)){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 GK(){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",qs(e.color,"ansi",()=>Ms(HO,"ansi16",cd,!1)),qs(e.color,"ansi256",()=>Ms(VO,"ansi256",cd,!1)),qs(e.color,"ansi16m",()=>Ms(zO,"rgb",GO,!1)),qs(e.bgColor,"ansi",()=>Ms(HO,"ansi16",cd,!0)),qs(e.bgColor,"ansi256",()=>Ms(VO,"ansi256",cd,!0)),qs(e.bgColor,"ansi16m",()=>Ms(zO,"rgb",GO,!0)),e}Object.defineProperty(WO,"exports",{enumerable:!0,get:GK})});var ZO=D((Kce,XO)=>{"use strict";var WK=Zy(),KK=$O(),KO=rD(),JO=["\x1B","\x9B"],fd=t=>`${JO[0]}[${t}m`,YO=(t,e,r)=>{let n=[];t=[...t];for(let i of t){let o=i;i.includes(";")&&(i=i.split(";")[0][0]+"0");let s=KO.codes.get(Number.parseInt(i,10));if(s){let a=t.indexOf(s.toString());a===-1?n.push(fd(e?s:o)):t.splice(a,1)}else if(e){n.push(fd(0));break}else n.push(fd(o))}if(e&&(n=n.filter((i,o)=>n.indexOf(i)===o),r!==void 0)){let i=fd(KO.codes.get(Number.parseInt(r,10)));n=n.reduce((o,s)=>s===i?[s,...o]:[...o,s],[])}return n.join("")};XO.exports=(t,e,r)=>{let n=[...t],i=[],o=typeof r=="number"?r:n.length,s=!1,a,u=0,l="";for(let[c,f]of n.entries()){let h=!1;if(JO.includes(f)){let d=/\d[^m]*/.exec(t.slice(c,c+18));a=d&&d.length>0?d[0]:void 0,u<o&&(s=!0,a!==void 0&&i.push(a))}else s&&f==="m"&&(s=!1,h=!0);if(!s&&!h&&u++,!KK({exact:!0}).test(f)&&WK(f.codePointAt())&&(u++,typeof r!="number"&&o++),u>e&&u<=o)l+=f;else if(u===e&&!s&&a!==void 0)l=YO(i);else if(u>=o){l+=YO(i,!0,a);break}}return l}});var eA=D((Yce,QO)=>{"use strict";QO.exports=({onlyFirst:t=!1}={})=>{let e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(e,t?void 0:"g")}});var dd=D((Jce,tA)=>{"use strict";var YK=eA();tA.exports=t=>typeof t=="string"?t.replace(YK(),""):t});var nA=D((Xce,rA)=>{"use strict";rA.exports=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFD])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83C\uDFF4\u200D\u2620)\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDF6\uD83C\uDDE6|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDBB\uDDD2-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5\uDEEB\uDEEC\uDEF4-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g}});var iD=D((Zce,nD)=>{"use strict";var JK=dd(),XK=Zy(),ZK=nA(),iA=t=>{if(typeof t!="string"||t.length===0||(t=JK(t),t.length===0))return 0;t=t.replace(ZK()," ");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+=XK(n)?2:1)}return e};nD.exports=iA;nD.exports.default=iA});var cA=D((Qce,lA)=>{"use strict";var Wu=iD(),QK=dd(),eY=rD(),hd=new Set(["\x1B","\x9B"]),tY=39,sD="\x07",aA="[",rY="]",uA="m",aD=`${rY}8;;`,oA=t=>`${hd.values().next().value}${aA}${t}${uA}`,sA=t=>`${hd.values().next().value}${aD}${t}${sD}`,nY=t=>t.split(" ").map(e=>Wu(e)),oD=(t,e,r)=>{let n=[...e],i=!1,o=!1,s=Wu(QK(t[t.length-1]));for(let[a,u]of n.entries()){let l=Wu(u);if(s+l<=r?t[t.length-1]+=u:(t.push(u),s=0),hd.has(u)&&(i=!0,o=n.slice(a+1).join("").startsWith(aD)),i){o?u===sD&&(i=!1,o=!1):u===uA&&(i=!1);continue}s+=l,s===r&&a<n.length-1&&(t.push(""),s=0)}!s&&t[t.length-1].length>0&&t.length>1&&(t[t.length-2]+=t.pop())},iY=t=>{let e=t.split(" "),r=e.length;for(;r>0&&!(Wu(e[r-1])>0);)r--;return r===e.length?t:e.slice(0,r).join(" ")+e.slice(r).join("")},oY=(t,e,r={})=>{if(r.trim!==!1&&t.trim()==="")return"";let n="",i,o,s=nY(t),a=[""];for(let[l,c]of t.split(" ").entries()){r.trim!==!1&&(a[a.length-1]=a[a.length-1].trimStart());let f=Wu(a[a.length-1]);if(l!==0&&(f>=e&&(r.wordWrap===!1||r.trim===!1)&&(a.push(""),f=0),(f>0||r.trim===!1)&&(a[a.length-1]+=" ",f++)),r.hard&&s[l]>e){let h=e-f,d=1+Math.floor((s[l]-h-1)/e);Math.floor((s[l]-1)/e)<d&&a.push(""),oD(a,c,e);continue}if(f+s[l]>e&&f>0&&s[l]>0){if(r.wordWrap===!1&&f<e){oD(a,c,e);continue}a.push("")}if(f+s[l]>e&&r.wordWrap===!1){oD(a,c,e);continue}a[a.length-1]+=c}r.trim!==!1&&(a=a.map(iY));let u=[...a.join(`
48
48
  `)];for(let[l,c]of u.entries()){if(n+=c,hd.has(c)){let{groups:h}=new RegExp(`(?:\\${aA}(?<code>\\d+)m|\\${aD}(?<uri>.*)${sD})`).exec(u.slice(l).join(""))||{groups:{}};if(h.code!==void 0){let d=Number.parseFloat(h.code);i=d===tY?void 0:d}else h.uri!==void 0&&(o=h.uri.length===0?void 0:h.uri)}let f=eY.codes.get(Number(i));u[l+1]===`
49
49
  `?(o&&(n+=sA("")),i&&f&&(n+=oA(f))):c===`
50
50
  `&&(i&&f&&(n+=oA(i)),o&&(n+=sA(o)))}return n};lA.exports=(t,e,r)=>String(t).normalize().replace(/\r\n/g,`
51
51
  `).split(`
52
52
  `).map(n=>oY(n,e,r)).join(`
53
- `)});var hA=y((efe,dA)=>{"use strict";var sY=require("os"),fA=sY.homedir();dA.exports=t=>{if(typeof t!="string")throw new TypeError(`Expected a string, got ${typeof t}`);return fA?t.replace(/^~(?=$|\/|\\)/,fA):t}});var vA=y(Ge=>{"use strict";Object.defineProperty(Ge,"__esModule",{value:!0});Ge.columnar=Ge.generateFillSpaceStringList=Ge.expandPath=Ge.prettyPath=Ge.wordWrap=Ge.indent=Ge.TTY_WIDTH=Ge.stripAnsi=Ge.stringWidth=Ge.sliceAnsi=void 0;var pA=(nr(),je(rr)),aY=pA.__importStar(require("os")),vn=pA.__importStar(require("path")),mA=ZO();Ge.sliceAnsi=mA;var pd=iD();Ge.stringWidth=pd;var uY=dd();Ge.stripAnsi=uY;var lY=cA(),cY=hA(),fY=80,dY=120;Ge.TTY_WIDTH=process.stdout.columns?Math.max(fY,Math.min(process.stdout.columns,dY)):1/0;function gA(t=4){return" ".repeat(t)}Ge.indent=gA;function hY(t,{width:e=Ge.TTY_WIDTH,indentation:r=0,append:n=""}){return lY(t,e-r-n.length,{trim:!0}).split(`
53
+ `)});var hA=D((efe,dA)=>{"use strict";var sY=require("os"),fA=sY.homedir();dA.exports=t=>{if(typeof t!="string")throw new TypeError(`Expected a string, got ${typeof t}`);return fA?t.replace(/^~(?=$|\/|\\)/,fA):t}});var vA=D(Ge=>{"use strict";Object.defineProperty(Ge,"__esModule",{value:!0});Ge.columnar=Ge.generateFillSpaceStringList=Ge.expandPath=Ge.prettyPath=Ge.wordWrap=Ge.indent=Ge.TTY_WIDTH=Ge.stripAnsi=Ge.stringWidth=Ge.sliceAnsi=void 0;var pA=(nr(),je(rr)),aY=pA.__importStar(require("os")),vn=pA.__importStar(require("path")),mA=ZO();Ge.sliceAnsi=mA;var pd=iD();Ge.stringWidth=pd;var uY=dd();Ge.stripAnsi=uY;var lY=cA(),cY=hA(),fY=80,dY=120;Ge.TTY_WIDTH=process.stdout.columns?Math.max(fY,Math.min(process.stdout.columns,dY)):1/0;function gA(t=4){return" ".repeat(t)}Ge.indent=gA;function hY(t,{width:e=Ge.TTY_WIDTH,indentation:r=0,append:n=""}){return lY(t,e-r-n.length,{trim:!0}).split(`
54
54
  `).join(`${n}
55
55
  ${gA(r)}`)}Ge.wordWrap=hY;function pY(t){t=yA(t);let e=process.cwd(),r=vn.dirname(t),n=aY.homedir(),i=Math.abs(r.split(vn.sep).length-e.split(vn.sep).length);if(e===r)return"."+vn.sep+vn.basename(t);if(r.startsWith(e))return"."+vn.sep+t.substring(e.length+1);if(i<=2){let o=vn.relative(e,t);return o||"."}else{if(t===n)return"~";if(t.indexOf(n)===0)return"~"+vn.sep+t.substring(n.length+1)}return t}Ge.prettyPath=pY;function yA(t){return vn.resolve(cY(t))}Ge.expandPath=yA;function DA(t,e=1,r=" "){e<2&&(e=2);let n=Math.max(...t.map(s=>pd(s))),i=n>e?n+1:e,o=r.repeat(i);return t.map(s=>mA(o,0,i-pd(s)))}Ge.generateFillSpaceStringList=DA;function mY(t,{hsep:e="-",vsep:r="|",headers:n}){let i=!!n;if(!t[0])return"";let o=n?n.length:t[0].length,s=n?n.map(c=>[c]):t[0].map(()=>[]);for(let c of t){let f=0,h=c.map(d=>{let m=d.split(`
56
56
  `);return f=Math.max(f,m.length),m});for(let d in c)s[d]&&s[d].push(...h[d],...Array(f-h[d].length).fill(""))}let a=s.map((c,f)=>{if(f<o-1){let h=DA(c);return c.map((d,m)=>`${d}${h[m]}${r===""?"":`${r} `}`)}else return c}),u=0,l=a.reduce((c,f)=>c.map((h,d)=>{let m=c[d]+f[d];return u=Math.max(u,pd(m)),m}));return i&&e!==""&&l.splice(1,0,e.repeat(u)),l.join(`
57
- `)}Ge.columnar=mY});var bA=y(gr=>{"use strict";Object.defineProperty(gr,"__esModule",{value:!0});gr.TERMINAL_INFO=gr.CI_ENVIRONMENT_VARIABLES_DETECTED=gr.CI_ENVIRONMENT_VARIABLES=void 0;var gY=(nr(),je(rr)),yY=Ly(),DY=gY.__importStar(require("os")),vY=(0,yY.debug)("ionic:utils-terminal:info");gr.CI_ENVIRONMENT_VARIABLES=["CI","BUILD_ID","BUILD_NUMBER","BITBUCKET_COMMIT","CODEBUILD_BUILD_ARN","GITHUB_ACTIONS"];gr.CI_ENVIRONMENT_VARIABLES_DETECTED=gr.CI_ENVIRONMENT_VARIABLES.filter(t=>!!process.env[t]);function bY(){let{shell:t}=DY.userInfo();return t||(process.env.SHELL?process.env.SHELL:process.platform==="darwin"?"/bin/bash":process.platform==="win32"?process.env.COMSPEC?process.env.COMSPEC:"cmd.exe":"/bin/sh")}gr.CI_ENVIRONMENT_VARIABLES_DETECTED.length>0&&vY(`Environment variables for CI detected: ${gr.CI_ENVIRONMENT_VARIABLES_DETECTED.join(", ")}`);gr.TERMINAL_INFO=Object.freeze({ci:gr.CI_ENVIRONMENT_VARIABLES_DETECTED.length>0,shell:bY(),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 uD=y(Us=>{"use strict";Object.defineProperty(Us,"__esModule",{value:!0});var md=(nr(),je(rr));md.__exportStar(Jy(),Us);md.__exportStar(kO(),Us);md.__exportStar(vA(),Us);md.__exportStar(bA(),Us)});var yd=y(Wr=>{"use strict";Object.defineProperty(Wr,"__esModule",{value:!0});Wr.isFatal=Wr.fatal=Wr.FatalException=Wr.BaseException=void 0;var gd=class extends Error{constructor(e,r){super(e),this.message=e,this.code=r}};Wr.BaseException=gd;var Ku=class extends gd{constructor(e,r=1){super(e,"FATAL"),this.message=e,this.exitCode=r}};Wr.FatalException=Ku;function wY(t){throw new Ku(t)}Wr.fatal=wY;function _Y(t){return t&&t instanceof Ku}Wr.isFatal=_Y});var fD={};gi(fD,{LOGGER_LEVELS:()=>kY,Logger:()=>cD,NO_COLORS:()=>wA,StreamOutputStrategy:()=>Dd,TTYOutputStrategy:()=>lD,TTY_WIDTH:()=>EY,createDefaultLogger:()=>AY,indent:()=>CY,sliceAnsi:()=>SY,stringWidth:()=>xY,stripAnsi:()=>FY,wordWrap:()=>OY});var EY,CY,SY,xY,FY,OY,AY,wA,Dd,lD,cD,kY,dD=Ct(()=>{EY=80,CY=t=>t,SY=t=>t,xY=t=>t.length,FY=t=>t,OY=t=>t,AY=()=>({info:console.log,warn:console.warn,error:console.error,debug:console.debug}),wA={},Dd=class{constructor(){this.colors=wA,this.stream=process.stdout}},lD=class extends Dd{constructor(e){super(),this.options=e}},cD=class{constructor(){}info(){}warn(){}error(){}debug(){}},kY={DEBUG:"DEBUG",INFO:"INFO",WARN:"WARN",ERROR:"ERROR"}});var EA=y(no=>{"use strict";Object.defineProperty(no,"__esModule",{value:!0});no.isInteractive=no.checkInteractive=void 0;var TY=(nr(),je(rr)),_A=uD(),PY=TY.__importDefault(Ns()),RY=Yu(),$Y=(...t)=>(0,no.isInteractive)()?!0:t.length?t.filter(e=>!e).length?(RY.logger.error(`Non-interactive shell detected.
58
- Run the command with ${PY.default.input("--help")} to see a list of arguments that must be provided.`),!1):!0:!1;no.checkInteractive=$Y;var IY=()=>_A.TERMINAL_INFO.tty&&!_A.TERMINAL_INFO.ci;no.isInteractive=IY});var We=y((sfe,SA)=>{"use strict";var{FORCE_COLOR:jY,NODE_DISABLE_COLORS:NY,TERM:LY}=process.env,we={enabled:!NY&&LY!=="dumb"&&jY!=="0",reset:Fe(0,0),bold:Fe(1,22),dim:Fe(2,22),italic:Fe(3,23),underline:Fe(4,24),inverse:Fe(7,27),hidden:Fe(8,28),strikethrough:Fe(9,29),black:Fe(30,39),red:Fe(31,39),green:Fe(32,39),yellow:Fe(33,39),blue:Fe(34,39),magenta:Fe(35,39),cyan:Fe(36,39),white:Fe(37,39),gray:Fe(90,39),grey:Fe(90,39),bgBlack:Fe(40,49),bgRed:Fe(41,49),bgGreen:Fe(42,49),bgYellow:Fe(43,49),bgBlue:Fe(44,49),bgMagenta:Fe(45,49),bgCyan:Fe(46,49),bgWhite:Fe(47,49)};function CA(t,e){let r=0,n,i="",o="";for(;r<t.length;r++)n=t[r],i+=n.open,o+=n.close,e.includes(n.close)&&(e=e.replace(n.rgx,n.close+n.open));return i+e+o}function BY(t,e){let r={has:t,keys:e};return r.reset=we.reset.bind(r),r.bold=we.bold.bind(r),r.dim=we.dim.bind(r),r.italic=we.italic.bind(r),r.underline=we.underline.bind(r),r.inverse=we.inverse.bind(r),r.hidden=we.hidden.bind(r),r.strikethrough=we.strikethrough.bind(r),r.black=we.black.bind(r),r.red=we.red.bind(r),r.green=we.green.bind(r),r.yellow=we.yellow.bind(r),r.blue=we.blue.bind(r),r.magenta=we.magenta.bind(r),r.cyan=we.cyan.bind(r),r.white=we.white.bind(r),r.gray=we.gray.bind(r),r.grey=we.grey.bind(r),r.bgBlack=we.bgBlack.bind(r),r.bgRed=we.bgRed.bind(r),r.bgGreen=we.bgGreen.bind(r),r.bgYellow=we.bgYellow.bind(r),r.bgBlue=we.bgBlue.bind(r),r.bgMagenta=we.bgMagenta.bind(r),r.bgCyan=we.bgCyan.bind(r),r.bgWhite=we.bgWhite.bind(r),r}function Fe(t,e){let r={open:`\x1B[${t}m`,close:`\x1B[${e}m`,rgx:new RegExp(`\\x1b\\[${e}m`,"g")};return function(n){return this!==void 0&&this.has!==void 0?(this.has.includes(t)||(this.has.push(t),this.keys.push(r)),n===void 0?this:we.enabled?CA(this.keys,n+""):n+""):n===void 0?BY([t],[r]):we.enabled?CA([r],n+""):n+""}}SA.exports=we});var FA=y((afe,xA)=>{"use strict";xA.exports=(t,e)=>{if(!(t.meta&&t.name!=="escape")){if(t.ctrl){if(t.name==="a")return"first";if(t.name==="c"||t.name==="d")return"abort";if(t.name==="e")return"last";if(t.name==="g")return"reset"}if(e){if(t.name==="j")return"down";if(t.name==="k")return"up"}return t.name==="return"||t.name==="enter"?"submit":t.name==="backspace"?"delete":t.name==="delete"?"deleteForward":t.name==="abort"?"abort":t.name==="escape"?"exit":t.name==="tab"?"next":t.name==="pagedown"?"nextPage":t.name==="pageup"?"prevPage":t.name==="home"?"home":t.name==="end"?"end":t.name==="up"?"up":t.name==="down"?"down":t.name==="right"?"right":t.name==="left"?"left":!1}}});var vd=y((ufe,OA)=>{"use strict";OA.exports=t=>{let e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))"].join("|"),r=new RegExp(e,"g");return typeof t=="string"?t.replace(r,""):t}});var RA=y((lfe,PA)=>{"use strict";function qY(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=MY(t))||e&&t&&typeof t.length=="number"){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
59
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,s=!1,a;return{s:function(){r=r.call(t)},n:function(){var l=r.next();return o=l.done,l},e:function(l){s=!0,a=l},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(s)throw a}}}}function MY(t,e){if(t){if(typeof t=="string")return AA(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return AA(t,e)}}function AA(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var UY=vd(),TA=Te(),kA=TA.erase,HY=TA.cursor,VY=t=>[...UY(t)].length;PA.exports=function(t,e){if(!e)return kA.line+HY.to(0);let r=0,n=t.split(/\r?\n/);var i=qY(n),o;try{for(i.s();!(o=i.n()).done;){let s=o.value;r+=1+Math.floor(Math.max(VY(s)-1,0)/e)}}catch(s){i.e(s)}finally{i.f()}return kA.lines(r)}});var hD=y((cfe,$A)=>{"use strict";var Ju={arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",radioOn:"\u25C9",radioOff:"\u25EF",tick:"\u2714",cross:"\u2716",ellipsis:"\u2026",pointerSmall:"\u203A",line:"\u2500",pointer:"\u276F"},zY={arrowUp:Ju.arrowUp,arrowDown:Ju.arrowDown,arrowLeft:Ju.arrowLeft,arrowRight:Ju.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"\u221A",cross:"\xD7",ellipsis:"...",pointerSmall:"\xBB",line:"\u2500",pointer:">"},GY=process.platform==="win32"?zY:Ju;$A.exports=GY});var jA=y((ffe,IA)=>{"use strict";var Hs=We(),io=hD(),pD=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}`}}),WY=t=>pD[t]||pD.default,Xu=Object.freeze({aborted:Hs.red(io.cross),done:Hs.green(io.tick),exited:Hs.yellow(io.cross),default:Hs.cyan("?")}),KY=(t,e,r)=>e?Xu.aborted:r?Xu.exited:t?Xu.done:Xu.default,YY=t=>Hs.gray(t?io.ellipsis:io.pointerSmall),JY=(t,e)=>Hs.gray(t?e?io.pointerSmall:"+":io.line);IA.exports={styles:pD,render:WY,symbols:Xu,symbol:KY,delimiter:YY,item:JY}});var LA=y((dfe,NA)=>{"use strict";var XY=vd();NA.exports=function(t,e){let r=String(XY(t)||"").split(/\r?\n/);return e?r.map(n=>Math.ceil(n.length/e)).reduce((n,i)=>n+i):r.length}});var qA=y((hfe,BA)=>{"use strict";BA.exports=(t,e={})=>{let r=Number.isSafeInteger(parseInt(e.margin))?new Array(parseInt(e.margin)).fill(" ").join(""):e.margin||"",n=e.width;return(t||"").split(/\r?\n/g).map(i=>i.split(/\s+/g).reduce((o,s)=>(s.length+r.length>=n||o[o.length-1].length+s.length+1<n?o[o.length-1]+=` ${s}`:o.push(`${r}${s}`),o),[r]).join(`
57
+ `)}Ge.columnar=mY});var bA=D(gr=>{"use strict";Object.defineProperty(gr,"__esModule",{value:!0});gr.TERMINAL_INFO=gr.CI_ENVIRONMENT_VARIABLES_DETECTED=gr.CI_ENVIRONMENT_VARIABLES=void 0;var gY=(nr(),je(rr)),yY=Ly(),DY=gY.__importStar(require("os")),vY=(0,yY.debug)("ionic:utils-terminal:info");gr.CI_ENVIRONMENT_VARIABLES=["CI","BUILD_ID","BUILD_NUMBER","BITBUCKET_COMMIT","CODEBUILD_BUILD_ARN","GITHUB_ACTIONS"];gr.CI_ENVIRONMENT_VARIABLES_DETECTED=gr.CI_ENVIRONMENT_VARIABLES.filter(t=>!!process.env[t]);function bY(){let{shell:t}=DY.userInfo();return t||(process.env.SHELL?process.env.SHELL:process.platform==="darwin"?"/bin/bash":process.platform==="win32"?process.env.COMSPEC?process.env.COMSPEC:"cmd.exe":"/bin/sh")}gr.CI_ENVIRONMENT_VARIABLES_DETECTED.length>0&&vY(`Environment variables for CI detected: ${gr.CI_ENVIRONMENT_VARIABLES_DETECTED.join(", ")}`);gr.TERMINAL_INFO=Object.freeze({ci:gr.CI_ENVIRONMENT_VARIABLES_DETECTED.length>0,shell:bY(),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 uD=D(Us=>{"use strict";Object.defineProperty(Us,"__esModule",{value:!0});var md=(nr(),je(rr));md.__exportStar(Jy(),Us);md.__exportStar(kO(),Us);md.__exportStar(vA(),Us);md.__exportStar(bA(),Us)});var yd=D(Wr=>{"use strict";Object.defineProperty(Wr,"__esModule",{value:!0});Wr.isFatal=Wr.fatal=Wr.FatalException=Wr.BaseException=void 0;var gd=class extends Error{constructor(e,r){super(e),this.message=e,this.code=r}};Wr.BaseException=gd;var Ku=class extends gd{constructor(e,r=1){super(e,"FATAL"),this.message=e,this.exitCode=r}};Wr.FatalException=Ku;function wY(t){throw new Ku(t)}Wr.fatal=wY;function _Y(t){return t&&t instanceof Ku}Wr.isFatal=_Y});var fD={};gi(fD,{LOGGER_LEVELS:()=>kY,Logger:()=>cD,NO_COLORS:()=>wA,StreamOutputStrategy:()=>Dd,TTYOutputStrategy:()=>lD,TTY_WIDTH:()=>EY,createDefaultLogger:()=>AY,indent:()=>CY,sliceAnsi:()=>SY,stringWidth:()=>xY,stripAnsi:()=>FY,wordWrap:()=>OY});var EY,CY,SY,xY,FY,OY,AY,wA,Dd,lD,cD,kY,dD=Ct(()=>{EY=80,CY=t=>t,SY=t=>t,xY=t=>t.length,FY=t=>t,OY=t=>t,AY=()=>({info:console.log,warn:console.warn,error:console.error,debug:console.debug}),wA={},Dd=class{constructor(){this.colors=wA,this.stream=process.stdout}},lD=class extends Dd{constructor(e){super(),this.options=e}},cD=class{constructor(){}info(){}warn(){}error(){}debug(){}},kY={DEBUG:"DEBUG",INFO:"INFO",WARN:"WARN",ERROR:"ERROR"}});var EA=D(no=>{"use strict";Object.defineProperty(no,"__esModule",{value:!0});no.isInteractive=no.checkInteractive=void 0;var TY=(nr(),je(rr)),_A=uD(),PY=TY.__importDefault(Ns()),RY=Yu(),$Y=(...t)=>(0,no.isInteractive)()?!0:t.length?t.filter(e=>!e).length?(RY.logger.error(`Non-interactive shell detected.
58
+ Run the command with ${PY.default.input("--help")} to see a list of arguments that must be provided.`),!1):!0:!1;no.checkInteractive=$Y;var IY=()=>_A.TERMINAL_INFO.tty&&!_A.TERMINAL_INFO.ci;no.isInteractive=IY});var We=D((sfe,SA)=>{"use strict";var{FORCE_COLOR:jY,NODE_DISABLE_COLORS:NY,TERM:LY}=process.env,we={enabled:!NY&&LY!=="dumb"&&jY!=="0",reset:Fe(0,0),bold:Fe(1,22),dim:Fe(2,22),italic:Fe(3,23),underline:Fe(4,24),inverse:Fe(7,27),hidden:Fe(8,28),strikethrough:Fe(9,29),black:Fe(30,39),red:Fe(31,39),green:Fe(32,39),yellow:Fe(33,39),blue:Fe(34,39),magenta:Fe(35,39),cyan:Fe(36,39),white:Fe(37,39),gray:Fe(90,39),grey:Fe(90,39),bgBlack:Fe(40,49),bgRed:Fe(41,49),bgGreen:Fe(42,49),bgYellow:Fe(43,49),bgBlue:Fe(44,49),bgMagenta:Fe(45,49),bgCyan:Fe(46,49),bgWhite:Fe(47,49)};function CA(t,e){let r=0,n,i="",o="";for(;r<t.length;r++)n=t[r],i+=n.open,o+=n.close,e.includes(n.close)&&(e=e.replace(n.rgx,n.close+n.open));return i+e+o}function BY(t,e){let r={has:t,keys:e};return r.reset=we.reset.bind(r),r.bold=we.bold.bind(r),r.dim=we.dim.bind(r),r.italic=we.italic.bind(r),r.underline=we.underline.bind(r),r.inverse=we.inverse.bind(r),r.hidden=we.hidden.bind(r),r.strikethrough=we.strikethrough.bind(r),r.black=we.black.bind(r),r.red=we.red.bind(r),r.green=we.green.bind(r),r.yellow=we.yellow.bind(r),r.blue=we.blue.bind(r),r.magenta=we.magenta.bind(r),r.cyan=we.cyan.bind(r),r.white=we.white.bind(r),r.gray=we.gray.bind(r),r.grey=we.grey.bind(r),r.bgBlack=we.bgBlack.bind(r),r.bgRed=we.bgRed.bind(r),r.bgGreen=we.bgGreen.bind(r),r.bgYellow=we.bgYellow.bind(r),r.bgBlue=we.bgBlue.bind(r),r.bgMagenta=we.bgMagenta.bind(r),r.bgCyan=we.bgCyan.bind(r),r.bgWhite=we.bgWhite.bind(r),r}function Fe(t,e){let r={open:`\x1B[${t}m`,close:`\x1B[${e}m`,rgx:new RegExp(`\\x1b\\[${e}m`,"g")};return function(n){return this!==void 0&&this.has!==void 0?(this.has.includes(t)||(this.has.push(t),this.keys.push(r)),n===void 0?this:we.enabled?CA(this.keys,n+""):n+""):n===void 0?BY([t],[r]):we.enabled?CA([r],n+""):n+""}}SA.exports=we});var FA=D((afe,xA)=>{"use strict";xA.exports=(t,e)=>{if(!(t.meta&&t.name!=="escape")){if(t.ctrl){if(t.name==="a")return"first";if(t.name==="c"||t.name==="d")return"abort";if(t.name==="e")return"last";if(t.name==="g")return"reset"}if(e){if(t.name==="j")return"down";if(t.name==="k")return"up"}return t.name==="return"||t.name==="enter"?"submit":t.name==="backspace"?"delete":t.name==="delete"?"deleteForward":t.name==="abort"?"abort":t.name==="escape"?"exit":t.name==="tab"?"next":t.name==="pagedown"?"nextPage":t.name==="pageup"?"prevPage":t.name==="home"?"home":t.name==="end"?"end":t.name==="up"?"up":t.name==="down"?"down":t.name==="right"?"right":t.name==="left"?"left":!1}}});var vd=D((ufe,OA)=>{"use strict";OA.exports=t=>{let e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))"].join("|"),r=new RegExp(e,"g");return typeof t=="string"?t.replace(r,""):t}});var RA=D((lfe,PA)=>{"use strict";function qY(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=MY(t))||e&&t&&typeof t.length=="number"){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
59
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,s=!1,a;return{s:function(){r=r.call(t)},n:function(){var l=r.next();return o=l.done,l},e:function(l){s=!0,a=l},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(s)throw a}}}}function MY(t,e){if(t){if(typeof t=="string")return AA(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return AA(t,e)}}function AA(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var UY=vd(),TA=Te(),kA=TA.erase,HY=TA.cursor,VY=t=>[...UY(t)].length;PA.exports=function(t,e){if(!e)return kA.line+HY.to(0);let r=0,n=t.split(/\r?\n/);var i=qY(n),o;try{for(i.s();!(o=i.n()).done;){let s=o.value;r+=1+Math.floor(Math.max(VY(s)-1,0)/e)}}catch(s){i.e(s)}finally{i.f()}return kA.lines(r)}});var hD=D((cfe,$A)=>{"use strict";var Ju={arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",radioOn:"\u25C9",radioOff:"\u25EF",tick:"\u2714",cross:"\u2716",ellipsis:"\u2026",pointerSmall:"\u203A",line:"\u2500",pointer:"\u276F"},zY={arrowUp:Ju.arrowUp,arrowDown:Ju.arrowDown,arrowLeft:Ju.arrowLeft,arrowRight:Ju.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"\u221A",cross:"\xD7",ellipsis:"...",pointerSmall:"\xBB",line:"\u2500",pointer:">"},GY=process.platform==="win32"?zY:Ju;$A.exports=GY});var jA=D((ffe,IA)=>{"use strict";var Hs=We(),io=hD(),pD=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}`}}),WY=t=>pD[t]||pD.default,Xu=Object.freeze({aborted:Hs.red(io.cross),done:Hs.green(io.tick),exited:Hs.yellow(io.cross),default:Hs.cyan("?")}),KY=(t,e,r)=>e?Xu.aborted:r?Xu.exited:t?Xu.done:Xu.default,YY=t=>Hs.gray(t?io.ellipsis:io.pointerSmall),JY=(t,e)=>Hs.gray(t?e?io.pointerSmall:"+":io.line);IA.exports={styles:pD,render:WY,symbols:Xu,symbol:KY,delimiter:YY,item:JY}});var LA=D((dfe,NA)=>{"use strict";var XY=vd();NA.exports=function(t,e){let r=String(XY(t)||"").split(/\r?\n/);return e?r.map(n=>Math.ceil(n.length/e)).reduce((n,i)=>n+i):r.length}});var qA=D((hfe,BA)=>{"use strict";BA.exports=(t,e={})=>{let r=Number.isSafeInteger(parseInt(e.margin))?new Array(parseInt(e.margin)).fill(" ").join(""):e.margin||"",n=e.width;return(t||"").split(/\r?\n/g).map(i=>i.split(/\s+/g).reduce((o,s)=>(s.length+r.length>=n||o[o.length-1].length+s.length+1<n?o[o.length-1]+=` ${s}`:o.push(`${r}${s}`),o),[r]).join(`
60
60
  `)).join(`
61
- `)}});var UA=y((pfe,MA)=>{"use strict";MA.exports=(t,e,r)=>{r=r||e;let n=Math.min(e-r,t-Math.floor(r/2));n<0&&(n=0);let i=Math.min(n+r,e);return{startIndex:n,endIndex:i}}});var Or=y((mfe,HA)=>{"use strict";HA.exports={action:FA(),clear:RA(),style:jA(),strip:vd(),figures:hD(),lines:LA(),wrap:qA(),entriesToDisplay:UA()}});var bn=y((gfe,GA)=>{"use strict";var VA=require("readline"),ZY=Or(),QY=ZY.action,eJ=require("events"),zA=Te(),tJ=zA.beep,rJ=zA.cursor,nJ=We(),mD=class extends eJ{constructor(e={}){super(),this.firstRender=!0,this.in=e.stdin||process.stdin,this.out=e.stdout||process.stdout,this.onRender=(e.onRender||(()=>{})).bind(this);let r=VA.createInterface({input:this.in,escapeCodeTimeout:50});VA.emitKeypressEvents(this.in,r),this.in.isTTY&&this.in.setRawMode(!0);let n=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1,i=(o,s)=>{let a=QY(s,n);a===!1?this._&&this._(o,s):typeof this[a]=="function"?this[a](s):this.bell()};this.close=()=>{this.out.write(rJ.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(tJ)}render(){this.onRender(nJ),this.firstRender&&(this.firstRender=!1)}};GA.exports=mD});var XA=y((yfe,JA)=>{"use strict";function WA(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(l){r(l);return}a.done?e(u):Promise.resolve(u).then(n,i)}function KA(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function s(u){WA(o,n,i,s,a,"next",u)}function a(u){WA(o,n,i,s,a,"throw",u)}s(void 0)})}}var bd=We(),iJ=bn(),YA=Te(),oJ=YA.erase,Zu=YA.cursor,wd=Or(),gD=wd.style,yD=wd.clear,sJ=wd.lines,aJ=wd.figures,DD=class extends iJ{constructor(e={}){super(e),this.transform=gD.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=yD("",this.out.columns),this.render()}set value(e){!e&&this.initial?(this.placeholder=!0,this.rendered=bd.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(`
61
+ `)}});var UA=D((pfe,MA)=>{"use strict";MA.exports=(t,e,r)=>{r=r||e;let n=Math.min(e-r,t-Math.floor(r/2));n<0&&(n=0);let i=Math.min(n+r,e);return{startIndex:n,endIndex:i}}});var Or=D((mfe,HA)=>{"use strict";HA.exports={action:FA(),clear:RA(),style:jA(),strip:vd(),figures:hD(),lines:LA(),wrap:qA(),entriesToDisplay:UA()}});var bn=D((gfe,GA)=>{"use strict";var VA=require("readline"),ZY=Or(),QY=ZY.action,eJ=require("events"),zA=Te(),tJ=zA.beep,rJ=zA.cursor,nJ=We(),mD=class extends eJ{constructor(e={}){super(),this.firstRender=!0,this.in=e.stdin||process.stdin,this.out=e.stdout||process.stdout,this.onRender=(e.onRender||(()=>{})).bind(this);let r=VA.createInterface({input:this.in,escapeCodeTimeout:50});VA.emitKeypressEvents(this.in,r),this.in.isTTY&&this.in.setRawMode(!0);let n=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1,i=(o,s)=>{let a=QY(s,n);a===!1?this._&&this._(o,s):typeof this[a]=="function"?this[a](s):this.bell()};this.close=()=>{this.out.write(rJ.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(tJ)}render(){this.onRender(nJ),this.firstRender&&(this.firstRender=!1)}};GA.exports=mD});var XA=D((yfe,JA)=>{"use strict";function WA(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(l){r(l);return}a.done?e(u):Promise.resolve(u).then(n,i)}function KA(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function s(u){WA(o,n,i,s,a,"next",u)}function a(u){WA(o,n,i,s,a,"throw",u)}s(void 0)})}}var bd=We(),iJ=bn(),YA=Te(),oJ=YA.erase,Zu=YA.cursor,wd=Or(),gD=wd.style,yD=wd.clear,sJ=wd.lines,aJ=wd.figures,DD=class extends iJ{constructor(e={}){super(e),this.transform=gD.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=yD("",this.out.columns),this.render()}set value(e){!e&&this.initial?(this.placeholder=!0,this.rendered=bd.gray(this.transform.render(this.initial))):(this.placeholder=!1,this.rendered=this.transform.render(e)),this._value=e,this.fire()}get value(){return this._value}reset(){this.value="",this.cursor=+!!this.initial,this.cursorOffset=0,this.fire(),this.render()}exit(){this.abort()}abort(){this.value=this.value||this.initial,this.done=this.aborted=!0,this.error=!1,this.red=!1,this.fire(),this.render(),this.out.write(`
62
62
  `),this.close()}validate(){var e=this;return KA(function*(){let r=yield e.validator(e.value);typeof r=="string"&&(e.errorMsg=r,r=!1),e.error=!r})()}submit(){var e=this;return KA(function*(){if(e.value=e.value||e.initial,e.cursorOffset=0,e.cursor=e.rendered.length,yield e.validate(),e.error){e.red=!0,e.fire(),e.render();return}e.done=!0,e.aborted=!1,e.fire(),e.render(),e.out.write(`
63
63
  `),e.close()})()}next(){if(!this.placeholder)return this.bell();this.value=this.initial,this.cursor=this.rendered.length,this.fire(),this.render()}moveCursor(e){this.placeholder||(this.cursor=this.cursor+e,this.cursorOffset+=e)}_(e,r){let n=this.value.slice(0,this.cursor),i=this.value.slice(this.cursor);this.value=`${n}${e}${i}`,this.red=!1,this.cursor=this.placeholder?0:n.length+1,this.render()}delete(){if(this.isCursorAtStart())return this.bell();let e=this.value.slice(0,this.cursor-1),r=this.value.slice(this.cursor);this.value=`${e}${r}`,this.red=!1,this.isCursorAtStart()?this.cursorOffset=0:(this.cursorOffset++,this.moveCursor(-1)),this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();let e=this.value.slice(0,this.cursor),r=this.value.slice(this.cursor+1);this.value=`${e}${r}`,this.red=!1,this.isCursorAtEnd()?this.cursorOffset=0:this.cursorOffset++,this.render()}first(){this.cursor=0,this.render()}last(){this.cursor=this.value.length,this.render()}left(){if(this.cursor<=0||this.placeholder)return this.bell();this.moveCursor(-1),this.render()}right(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();this.moveCursor(1),this.render()}isCursorAtStart(){return this.cursor===0||this.placeholder&&this.cursor===1}isCursorAtEnd(){return this.cursor===this.rendered.length||this.placeholder&&this.cursor===this.rendered.length+1}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(Zu.down(sJ(this.outputError,this.out.columns)-1)+yD(this.outputError,this.out.columns)),this.out.write(yD(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[gD.symbol(this.done,this.aborted),bd.bold(this.msg),gD.delimiter(this.done),this.red?bd.red(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
64
64
  `).reduce((e,r,n)=>e+`
65
- ${n?" ":aJ.pointerSmall} ${bd.red().italic(r)}`,"")),this.out.write(oJ.line+Zu.to(0)+this.outputText+Zu.save+this.outputError+Zu.restore+Zu.move(this.cursorOffset,0)))}};JA.exports=DD});var tk=y((Dfe,ek)=>{"use strict";var wn=We(),uJ=bn(),Qu=Or(),ZA=Qu.style,QA=Qu.clear,_d=Qu.figures,lJ=Qu.wrap,cJ=Qu.entriesToDisplay,fJ=Te(),dJ=fJ.cursor,vD=class extends uJ{constructor(e={}){super(e),this.msg=e.message,this.hint=e.hint||"- Use arrow-keys. Return to submit.",this.warn=e.warn||"- This option is disabled",this.cursor=e.initial||0,this.choices=e.choices.map((r,n)=>(typeof r=="string"&&(r={title:r,value:n}),{title:r&&(r.title||r.value||r),value:r&&(r.value===void 0?n:r.value),description:r&&r.description,selected:r&&r.selected,disabled:r&&r.disabled})),this.optionsPerPage=e.optionsPerPage||10,this.value=(this.choices[this.cursor]||{}).value,this.clear=QA("",this.out.columns),this.render()}moveCursor(e){this.cursor=e,this.value=this.choices[e].value,this.fire()}reset(){this.moveCursor(0),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
65
+ ${n?" ":aJ.pointerSmall} ${bd.red().italic(r)}`,"")),this.out.write(oJ.line+Zu.to(0)+this.outputText+Zu.save+this.outputError+Zu.restore+Zu.move(this.cursorOffset,0)))}};JA.exports=DD});var tk=D((Dfe,ek)=>{"use strict";var wn=We(),uJ=bn(),Qu=Or(),ZA=Qu.style,QA=Qu.clear,_d=Qu.figures,lJ=Qu.wrap,cJ=Qu.entriesToDisplay,fJ=Te(),dJ=fJ.cursor,vD=class extends uJ{constructor(e={}){super(e),this.msg=e.message,this.hint=e.hint||"- Use arrow-keys. Return to submit.",this.warn=e.warn||"- This option is disabled",this.cursor=e.initial||0,this.choices=e.choices.map((r,n)=>(typeof r=="string"&&(r={title:r,value:n}),{title:r&&(r.title||r.value||r),value:r&&(r.value===void 0?n:r.value),description:r&&r.description,selected:r&&r.selected,disabled:r&&r.disabled})),this.optionsPerPage=e.optionsPerPage||10,this.value=(this.choices[this.cursor]||{}).value,this.clear=QA("",this.out.columns),this.render()}moveCursor(e){this.cursor=e,this.value=this.choices[e].value,this.fire()}reset(){this.moveCursor(0),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
66
66
  `),this.close()}submit(){this.selection.disabled?this.bell():(this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
67
67
  `),this.close())}first(){this.moveCursor(0),this.render()}last(){this.moveCursor(this.choices.length-1),this.render()}up(){this.cursor===0?this.moveCursor(this.choices.length-1):this.moveCursor(this.cursor-1),this.render()}down(){this.cursor===this.choices.length-1?this.moveCursor(0):this.moveCursor(this.cursor+1),this.render()}next(){this.moveCursor((this.cursor+1)%this.choices.length),this.render()}_(e,r){if(e===" ")return this.submit()}get selection(){return this.choices[this.cursor]}render(){if(this.closed)return;this.firstRender?this.out.write(dJ.hide):this.out.write(QA(this.outputText,this.out.columns)),super.render();let e=cJ(this.cursor,this.choices.length,this.optionsPerPage),r=e.startIndex,n=e.endIndex;if(this.outputText=[ZA.symbol(this.done,this.aborted),wn.bold(this.msg),ZA.delimiter(!1),this.done?this.selection.title:this.selection.disabled?wn.yellow(this.warn):wn.gray(this.hint)].join(" "),!this.done){this.outputText+=`
68
68
  `;for(let i=r;i<n;i++){let o,s,a="",u=this.choices[i];i===r&&r>0?s=_d.arrowUp:i===n-1&&n<this.choices.length?s=_d.arrowDown:s=" ",u.disabled?(o=this.cursor===i?wn.gray().underline(u.title):wn.strikethrough().gray(u.title),s=(this.cursor===i?wn.bold().gray(_d.pointer)+" ":" ")+s):(o=this.cursor===i?wn.cyan().underline(u.title):u.title,s=(this.cursor===i?wn.cyan(_d.pointer)+" ":" ")+s,u.description&&this.cursor===i&&(a=` - ${u.description}`,(s.length+o.length+a.length>=this.out.columns||u.description.split(/\r?\n/).length>1)&&(a=`
69
69
  `+lJ(u.description,{margin:3,width:this.out.columns})))),this.outputText+=`${s} ${o}${wn.gray(a)}
70
- `}}this.out.write(this.outputText)}};ek.exports=vD});var ak=y((vfe,sk)=>{"use strict";var Ed=We(),hJ=bn(),ik=Or(),rk=ik.style,pJ=ik.clear,ok=Te(),nk=ok.cursor,mJ=ok.erase,bD=class extends hJ{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(`
70
+ `}}this.out.write(this.outputText)}};ek.exports=vD});var ak=D((vfe,sk)=>{"use strict";var Ed=We(),hJ=bn(),ik=Or(),rk=ik.style,pJ=ik.clear,ok=Te(),nk=ok.cursor,mJ=ok.erase,bD=class extends hJ{constructor(e={}){super(e),this.msg=e.message,this.value=!!e.initial,this.active=e.active||"on",this.inactive=e.inactive||"off",this.initialValue=this.value,this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
71
71
  `),this.close()}submit(){this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
72
- `),this.close()}deactivate(){if(this.value===!1)return this.bell();this.value=!1,this.render()}activate(){if(this.value===!0)return this.bell();this.value=!0,this.render()}delete(){this.deactivate()}left(){this.deactivate()}right(){this.activate()}down(){this.deactivate()}up(){this.activate()}next(){this.value=!this.value,this.fire(),this.render()}_(e,r){if(e===" ")this.value=!this.value;else if(e==="1")this.value=!0;else if(e==="0")this.value=!1;else return this.bell();this.render()}render(){this.closed||(this.firstRender?this.out.write(nk.hide):this.out.write(pJ(this.outputText,this.out.columns)),super.render(),this.outputText=[rk.symbol(this.done,this.aborted),Ed.bold(this.msg),rk.delimiter(this.done),this.value?this.inactive:Ed.cyan().underline(this.inactive),Ed.gray("/"),this.value?Ed.cyan().underline(this.active):this.active].join(" "),this.out.write(mJ.line+nk.to(0)+this.outputText))}};sk.exports=bD});var Kr=y((bfe,uk)=>{"use strict";var wD=class t{constructor({token:e,date:r,parts:n,locales:i}){this.token=e,this.date=r||new Date,this.parts=n||[this],this.locales=i||{}}up(){}down(){}next(){let e=this.parts.indexOf(this);return this.parts.find((r,n)=>n>e&&r instanceof t)}setTo(e){}prev(){let e=[].concat(this.parts).reverse(),r=e.indexOf(this);return e.find((n,i)=>i>r&&n instanceof t)}toString(){return String(this.date)}};uk.exports=wD});var ck=y((wfe,lk)=>{"use strict";var gJ=Kr(),_D=class extends gJ{constructor(e={}){super(e)}up(){this.date.setHours((this.date.getHours()+12)%24)}down(){this.up()}toString(){let e=this.date.getHours()>12?"pm":"am";return/\A/.test(this.token)?e.toUpperCase():e}};lk.exports=_D});var dk=y((_fe,fk)=>{"use strict";var yJ=Kr(),DJ=t=>(t=t%10,t===1?"st":t===2?"nd":t===3?"rd":"th"),ED=class extends yJ{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+DJ(e):this.token==="d"?r+1:this.token==="ddd"?this.locales.weekdaysShort[r]:this.token==="dddd"?this.locales.weekdays[r]:e}};fk.exports=ED});var pk=y((Efe,hk)=>{"use strict";var vJ=Kr(),CD=class extends vJ{constructor(e={}){super(e)}up(){this.date.setHours(this.date.getHours()+1)}down(){this.date.setHours(this.date.getHours()-1)}setTo(e){this.date.setHours(parseInt(e.substr(-2)))}toString(){let e=this.date.getHours();return/h/.test(this.token)&&(e=e%12||12),this.token.length>1?String(e).padStart(2,"0"):e}};hk.exports=CD});var gk=y((Cfe,mk)=>{"use strict";var bJ=Kr(),SD=class extends bJ{constructor(e={}){super(e)}up(){this.date.setMilliseconds(this.date.getMilliseconds()+1)}down(){this.date.setMilliseconds(this.date.getMilliseconds()-1)}setTo(e){this.date.setMilliseconds(parseInt(e.substr(-this.token.length)))}toString(){return String(this.date.getMilliseconds()).padStart(4,"0").substr(0,this.token.length)}};mk.exports=SD});var Dk=y((Sfe,yk)=>{"use strict";var wJ=Kr(),xD=class extends wJ{constructor(e={}){super(e)}up(){this.date.setMinutes(this.date.getMinutes()+1)}down(){this.date.setMinutes(this.date.getMinutes()-1)}setTo(e){this.date.setMinutes(parseInt(e.substr(-2)))}toString(){let e=this.date.getMinutes();return this.token.length>1?String(e).padStart(2,"0"):e}};yk.exports=xD});var bk=y((xfe,vk)=>{"use strict";var _J=Kr(),FD=class extends _J{constructor(e={}){super(e)}up(){this.date.setMonth(this.date.getMonth()+1)}down(){this.date.setMonth(this.date.getMonth()-1)}setTo(e){e=parseInt(e.substr(-2))-1,this.date.setMonth(e<0?0:e)}toString(){let e=this.date.getMonth(),r=this.token.length;return r===2?String(e+1).padStart(2,"0"):r===3?this.locales.monthsShort[e]:r===4?this.locales.months[e]:String(e+1)}};vk.exports=FD});var _k=y((Ffe,wk)=>{"use strict";var EJ=Kr(),OD=class extends EJ{constructor(e={}){super(e)}up(){this.date.setSeconds(this.date.getSeconds()+1)}down(){this.date.setSeconds(this.date.getSeconds()-1)}setTo(e){this.date.setSeconds(parseInt(e.substr(-2)))}toString(){let e=this.date.getSeconds();return this.token.length>1?String(e).padStart(2,"0"):e}};wk.exports=OD});var Ck=y((Ofe,Ek)=>{"use strict";var CJ=Kr(),AD=class extends CJ{constructor(e={}){super(e)}up(){this.date.setFullYear(this.date.getFullYear()+1)}down(){this.date.setFullYear(this.date.getFullYear()-1)}setTo(e){this.date.setFullYear(e.substr(-4))}toString(){let e=String(this.date.getFullYear()).padStart(4,"0");return this.token.length===2?e.substr(-2):e}};Ek.exports=AD});var xk=y((Afe,Sk)=>{"use strict";Sk.exports={DatePart:Kr(),Meridiem:ck(),Day:dk(),Hours:pk(),Milliseconds:gk(),Minutes:Dk(),Month:bk(),Seconds:_k(),Year:Ck()}});var jk=y((kfe,Ik)=>{"use strict";function Fk(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(l){r(l);return}a.done?e(u):Promise.resolve(u).then(n,i)}function Ok(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function s(u){Fk(o,n,i,s,a,"next",u)}function a(u){Fk(o,n,i,s,a,"throw",u)}s(void 0)})}}var kD=We(),SJ=bn(),PD=Or(),Ak=PD.style,kk=PD.clear,xJ=PD.figures,$k=Te(),FJ=$k.erase,Tk=$k.cursor,_n=xk(),Pk=_n.DatePart,OJ=_n.Meridiem,AJ=_n.Day,kJ=_n.Hours,TJ=_n.Milliseconds,PJ=_n.Minutes,RJ=_n.Month,$J=_n.Seconds,IJ=_n.Year,jJ=/\\(.)|"((?:\\["\\]|[^"])+)"|(D[Do]?|d{3,4}|d)|(M{1,4})|(YY(?:YY)?)|([aA])|([Hh]{1,2})|(m{1,2})|(s{1,2})|(S{1,4})|./g,Rk={1:({token:t})=>t.replace(/\\(.)/g,"$1"),2:t=>new AJ(t),3:t=>new RJ(t),4:t=>new IJ(t),5:t=>new OJ(t),6:t=>new kJ(t),7:t=>new PJ(t),8:t=>new $J(t),9:t=>new TJ(t)},NJ={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(",")},TD=class extends SJ{constructor(e={}){super(e),this.msg=e.message,this.cursor=0,this.typed="",this.locales=Object.assign(NJ,e.locales),this._date=e.initial||new Date,this.errorMsg=e.error||"Please Enter A Valid Value",this.validator=e.validate||(()=>!0),this.mask=e.mask||"YYYY-MM-DD HH:mm:ss",this.clear=kk("",this.out.columns),this.render()}get value(){return this.date}get date(){return this._date}set date(e){e&&this._date.setTime(e.getTime())}set mask(e){let r;for(this.parts=[];r=jJ.exec(e);){let i=r.shift(),o=r.findIndex(s=>s!=null);this.parts.push(o in Rk?Rk[o]({token:r[o]||i,date:this.date,parts:this.parts,locales:this.locales}):r[o]||i)}let n=this.parts.reduce((i,o)=>(typeof o=="string"&&typeof i[i.length-1]=="string"?i[i.length-1]+=o:i.push(o),i),[]);this.parts.splice(0),this.parts.push(...n),this.reset()}moveCursor(e){this.typed="",this.cursor=e,this.fire()}reset(){this.moveCursor(this.parts.findIndex(e=>e instanceof Pk)),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
72
+ `),this.close()}deactivate(){if(this.value===!1)return this.bell();this.value=!1,this.render()}activate(){if(this.value===!0)return this.bell();this.value=!0,this.render()}delete(){this.deactivate()}left(){this.deactivate()}right(){this.activate()}down(){this.deactivate()}up(){this.activate()}next(){this.value=!this.value,this.fire(),this.render()}_(e,r){if(e===" ")this.value=!this.value;else if(e==="1")this.value=!0;else if(e==="0")this.value=!1;else return this.bell();this.render()}render(){this.closed||(this.firstRender?this.out.write(nk.hide):this.out.write(pJ(this.outputText,this.out.columns)),super.render(),this.outputText=[rk.symbol(this.done,this.aborted),Ed.bold(this.msg),rk.delimiter(this.done),this.value?this.inactive:Ed.cyan().underline(this.inactive),Ed.gray("/"),this.value?Ed.cyan().underline(this.active):this.active].join(" "),this.out.write(mJ.line+nk.to(0)+this.outputText))}};sk.exports=bD});var Kr=D((bfe,uk)=>{"use strict";var wD=class t{constructor({token:e,date:r,parts:n,locales:i}){this.token=e,this.date=r||new Date,this.parts=n||[this],this.locales=i||{}}up(){}down(){}next(){let e=this.parts.indexOf(this);return this.parts.find((r,n)=>n>e&&r instanceof t)}setTo(e){}prev(){let e=[].concat(this.parts).reverse(),r=e.indexOf(this);return e.find((n,i)=>i>r&&n instanceof t)}toString(){return String(this.date)}};uk.exports=wD});var ck=D((wfe,lk)=>{"use strict";var gJ=Kr(),_D=class extends gJ{constructor(e={}){super(e)}up(){this.date.setHours((this.date.getHours()+12)%24)}down(){this.up()}toString(){let e=this.date.getHours()>12?"pm":"am";return/\A/.test(this.token)?e.toUpperCase():e}};lk.exports=_D});var dk=D((_fe,fk)=>{"use strict";var yJ=Kr(),DJ=t=>(t=t%10,t===1?"st":t===2?"nd":t===3?"rd":"th"),ED=class extends yJ{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+DJ(e):this.token==="d"?r+1:this.token==="ddd"?this.locales.weekdaysShort[r]:this.token==="dddd"?this.locales.weekdays[r]:e}};fk.exports=ED});var pk=D((Efe,hk)=>{"use strict";var vJ=Kr(),CD=class extends vJ{constructor(e={}){super(e)}up(){this.date.setHours(this.date.getHours()+1)}down(){this.date.setHours(this.date.getHours()-1)}setTo(e){this.date.setHours(parseInt(e.substr(-2)))}toString(){let e=this.date.getHours();return/h/.test(this.token)&&(e=e%12||12),this.token.length>1?String(e).padStart(2,"0"):e}};hk.exports=CD});var gk=D((Cfe,mk)=>{"use strict";var bJ=Kr(),SD=class extends bJ{constructor(e={}){super(e)}up(){this.date.setMilliseconds(this.date.getMilliseconds()+1)}down(){this.date.setMilliseconds(this.date.getMilliseconds()-1)}setTo(e){this.date.setMilliseconds(parseInt(e.substr(-this.token.length)))}toString(){return String(this.date.getMilliseconds()).padStart(4,"0").substr(0,this.token.length)}};mk.exports=SD});var Dk=D((Sfe,yk)=>{"use strict";var wJ=Kr(),xD=class extends wJ{constructor(e={}){super(e)}up(){this.date.setMinutes(this.date.getMinutes()+1)}down(){this.date.setMinutes(this.date.getMinutes()-1)}setTo(e){this.date.setMinutes(parseInt(e.substr(-2)))}toString(){let e=this.date.getMinutes();return this.token.length>1?String(e).padStart(2,"0"):e}};yk.exports=xD});var bk=D((xfe,vk)=>{"use strict";var _J=Kr(),FD=class extends _J{constructor(e={}){super(e)}up(){this.date.setMonth(this.date.getMonth()+1)}down(){this.date.setMonth(this.date.getMonth()-1)}setTo(e){e=parseInt(e.substr(-2))-1,this.date.setMonth(e<0?0:e)}toString(){let e=this.date.getMonth(),r=this.token.length;return r===2?String(e+1).padStart(2,"0"):r===3?this.locales.monthsShort[e]:r===4?this.locales.months[e]:String(e+1)}};vk.exports=FD});var _k=D((Ffe,wk)=>{"use strict";var EJ=Kr(),OD=class extends EJ{constructor(e={}){super(e)}up(){this.date.setSeconds(this.date.getSeconds()+1)}down(){this.date.setSeconds(this.date.getSeconds()-1)}setTo(e){this.date.setSeconds(parseInt(e.substr(-2)))}toString(){let e=this.date.getSeconds();return this.token.length>1?String(e).padStart(2,"0"):e}};wk.exports=OD});var Ck=D((Ofe,Ek)=>{"use strict";var CJ=Kr(),AD=class extends CJ{constructor(e={}){super(e)}up(){this.date.setFullYear(this.date.getFullYear()+1)}down(){this.date.setFullYear(this.date.getFullYear()-1)}setTo(e){this.date.setFullYear(e.substr(-4))}toString(){let e=String(this.date.getFullYear()).padStart(4,"0");return this.token.length===2?e.substr(-2):e}};Ek.exports=AD});var xk=D((Afe,Sk)=>{"use strict";Sk.exports={DatePart:Kr(),Meridiem:ck(),Day:dk(),Hours:pk(),Milliseconds:gk(),Minutes:Dk(),Month:bk(),Seconds:_k(),Year:Ck()}});var jk=D((kfe,Ik)=>{"use strict";function Fk(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(l){r(l);return}a.done?e(u):Promise.resolve(u).then(n,i)}function Ok(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function s(u){Fk(o,n,i,s,a,"next",u)}function a(u){Fk(o,n,i,s,a,"throw",u)}s(void 0)})}}var kD=We(),SJ=bn(),PD=Or(),Ak=PD.style,kk=PD.clear,xJ=PD.figures,$k=Te(),FJ=$k.erase,Tk=$k.cursor,_n=xk(),Pk=_n.DatePart,OJ=_n.Meridiem,AJ=_n.Day,kJ=_n.Hours,TJ=_n.Milliseconds,PJ=_n.Minutes,RJ=_n.Month,$J=_n.Seconds,IJ=_n.Year,jJ=/\\(.)|"((?:\\["\\]|[^"])+)"|(D[Do]?|d{3,4}|d)|(M{1,4})|(YY(?:YY)?)|([aA])|([Hh]{1,2})|(m{1,2})|(s{1,2})|(S{1,4})|./g,Rk={1:({token:t})=>t.replace(/\\(.)/g,"$1"),2:t=>new AJ(t),3:t=>new RJ(t),4:t=>new IJ(t),5:t=>new OJ(t),6:t=>new kJ(t),7:t=>new PJ(t),8:t=>new $J(t),9:t=>new TJ(t)},NJ={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(",")},TD=class extends SJ{constructor(e={}){super(e),this.msg=e.message,this.cursor=0,this.typed="",this.locales=Object.assign(NJ,e.locales),this._date=e.initial||new Date,this.errorMsg=e.error||"Please Enter A Valid Value",this.validator=e.validate||(()=>!0),this.mask=e.mask||"YYYY-MM-DD HH:mm:ss",this.clear=kk("",this.out.columns),this.render()}get value(){return this.date}get date(){return this._date}set date(e){e&&this._date.setTime(e.getTime())}set mask(e){let r;for(this.parts=[];r=jJ.exec(e);){let i=r.shift(),o=r.findIndex(s=>s!=null);this.parts.push(o in Rk?Rk[o]({token:r[o]||i,date:this.date,parts:this.parts,locales:this.locales}):r[o]||i)}let n=this.parts.reduce((i,o)=>(typeof o=="string"&&typeof i[i.length-1]=="string"?i[i.length-1]+=o:i.push(o),i),[]);this.parts.splice(0),this.parts.push(...n),this.reset()}moveCursor(e){this.typed="",this.cursor=e,this.fire()}reset(){this.moveCursor(this.parts.findIndex(e=>e instanceof Pk)),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
73
73
  `),this.close()}validate(){var e=this;return Ok(function*(){let r=yield e.validator(e.value);typeof r=="string"&&(e.errorMsg=r,r=!1),e.error=!r})()}submit(){var e=this;return Ok(function*(){if(yield e.validate(),e.error){e.color="red",e.fire(),e.render();return}e.done=!0,e.aborted=!1,e.fire(),e.render(),e.out.write(`
74
74
  `),e.close()})()}up(){this.typed="",this.parts[this.cursor].up(),this.render()}down(){this.typed="",this.parts[this.cursor].down(),this.render()}left(){let e=this.parts[this.cursor].prev();if(e==null)return this.bell();this.moveCursor(this.parts.indexOf(e)),this.render()}right(){let e=this.parts[this.cursor].next();if(e==null)return this.bell();this.moveCursor(this.parts.indexOf(e)),this.render()}next(){let e=this.parts[this.cursor].next();this.moveCursor(e?this.parts.indexOf(e):this.parts.findIndex(r=>r instanceof Pk)),this.render()}_(e){/\d/.test(e)&&(this.typed+=e,this.parts[this.cursor].setTo(this.typed),this.render())}render(){this.closed||(this.firstRender?this.out.write(Tk.hide):this.out.write(kk(this.outputText,this.out.columns)),super.render(),this.outputText=[Ak.symbol(this.done,this.aborted),kD.bold(this.msg),Ak.delimiter(!1),this.parts.reduce((e,r,n)=>e.concat(n===this.cursor&&!this.done?kD.cyan().underline(r.toString()):r),[]).join("")].join(" "),this.error&&(this.outputText+=this.errorMsg.split(`
75
75
  `).reduce((e,r,n)=>e+`
76
- ${n?" ":xJ.pointerSmall} ${kD.red().italic(r)}`,"")),this.out.write(FJ.line+Tk.to(0)+this.outputText))}};Ik.exports=TD});var Hk=y((Tfe,Uk)=>{"use strict";function Nk(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(l){r(l);return}a.done?e(u):Promise.resolve(u).then(n,i)}function Lk(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function s(u){Nk(o,n,i,s,a,"next",u)}function a(u){Nk(o,n,i,s,a,"throw",u)}s(void 0)})}}var Cd=We(),LJ=bn(),Mk=Te(),Sd=Mk.cursor,BJ=Mk.erase,xd=Or(),RD=xd.style,qJ=xd.figures,Bk=xd.clear,MJ=xd.lines,UJ=/[0-9]/,$D=t=>t!==void 0,qk=(t,e)=>{let r=Math.pow(10,e);return Math.round(t*r)/r},ID=class extends LJ{constructor(e={}){super(e),this.transform=RD.render(e.style),this.msg=e.message,this.initial=$D(e.initial)?e.initial:"",this.float=!!e.float,this.round=e.round||2,this.inc=e.increment||1,this.min=$D(e.min)?e.min:-1/0,this.max=$D(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=Cd.gray(this.transform.render(`${this.initial}`)),this._value=""):(this.placeholder=!1,this.rendered=this.transform.render(`${qk(e,this.round)}`),this._value=qk(e,this.round)),this.fire()}get value(){return this._value}parse(e){return this.float?parseFloat(e):parseInt(e)}valid(e){return e==="-"||e==="."&&this.float||UJ.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(`
76
+ ${n?" ":xJ.pointerSmall} ${kD.red().italic(r)}`,"")),this.out.write(FJ.line+Tk.to(0)+this.outputText))}};Ik.exports=TD});var Hk=D((Tfe,Uk)=>{"use strict";function Nk(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(l){r(l);return}a.done?e(u):Promise.resolve(u).then(n,i)}function Lk(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function s(u){Nk(o,n,i,s,a,"next",u)}function a(u){Nk(o,n,i,s,a,"throw",u)}s(void 0)})}}var Cd=We(),LJ=bn(),Mk=Te(),Sd=Mk.cursor,BJ=Mk.erase,xd=Or(),RD=xd.style,qJ=xd.figures,Bk=xd.clear,MJ=xd.lines,UJ=/[0-9]/,$D=t=>t!==void 0,qk=(t,e)=>{let r=Math.pow(10,e);return Math.round(t*r)/r},ID=class extends LJ{constructor(e={}){super(e),this.transform=RD.render(e.style),this.msg=e.message,this.initial=$D(e.initial)?e.initial:"",this.float=!!e.float,this.round=e.round||2,this.inc=e.increment||1,this.min=$D(e.min)?e.min:-1/0,this.max=$D(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=Cd.gray(this.transform.render(`${this.initial}`)),this._value=""):(this.placeholder=!1,this.rendered=this.transform.render(`${qk(e,this.round)}`),this._value=qk(e,this.round)),this.fire()}get value(){return this._value}parse(e){return this.float?parseFloat(e):parseInt(e)}valid(e){return e==="-"||e==="."&&this.float||UJ.test(e)}reset(){this.typed="",this.value="",this.fire(),this.render()}exit(){this.abort()}abort(){let e=this.value;this.value=e!==""?e:this.initial,this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
77
77
  `),this.close()}validate(){var e=this;return Lk(function*(){let r=yield e.validator(e.value);typeof r=="string"&&(e.errorMsg=r,r=!1),e.error=!r})()}submit(){var e=this;return Lk(function*(){if(yield e.validate(),e.error){e.color="red",e.fire(),e.render();return}let r=e.value;e.value=r!==""?r:e.initial,e.done=!0,e.aborted=!1,e.error=!1,e.fire(),e.render(),e.out.write(`
78
78
  `),e.close()})()}up(){if(this.typed="",this.value===""&&(this.value=this.min-this.inc),this.value>=this.max)return this.bell();this.value+=this.inc,this.color="cyan",this.fire(),this.render()}down(){if(this.typed="",this.value===""&&(this.value=this.min+this.inc),this.value<=this.min)return this.bell();this.value-=this.inc,this.color="cyan",this.fire(),this.render()}delete(){let e=this.value.toString();if(e.length===0)return this.bell();this.value=this.parse(e=e.slice(0,-1))||"",this.value!==""&&this.value<this.min&&(this.value=this.min),this.color="cyan",this.fire(),this.render()}next(){this.value=this.initial,this.fire(),this.render()}_(e,r){if(!this.valid(e))return this.bell();let n=Date.now();if(n-this.lastHit>1e3&&(this.typed=""),this.typed+=e,this.lastHit=n,this.color="cyan",e===".")return this.fire();this.value=Math.min(this.parse(this.typed),this.max),this.value>this.max&&(this.value=this.max),this.value<this.min&&(this.value=this.min),this.fire(),this.render()}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(Sd.down(MJ(this.outputError,this.out.columns)-1)+Bk(this.outputError,this.out.columns)),this.out.write(Bk(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[RD.symbol(this.done,this.aborted),Cd.bold(this.msg),RD.delimiter(this.done),!this.done||!this.done&&!this.placeholder?Cd[this.color]().underline(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
79
79
  `).reduce((e,r,n)=>e+`
80
- ${n?" ":qJ.pointerSmall} ${Cd.red().italic(r)}`,"")),this.out.write(BJ.line+Sd.to(0)+this.outputText+Sd.save+this.outputError+Sd.restore))}};Uk.exports=ID});var ND=y((Pfe,Gk)=>{"use strict";var Yr=We(),HJ=Te(),VJ=HJ.cursor,zJ=bn(),el=Or(),Vk=el.clear,ni=el.figures,zk=el.style,GJ=el.wrap,WJ=el.entriesToDisplay,jD=class extends zJ{constructor(e={}){super(e),this.msg=e.message,this.cursor=e.cursor||0,this.scrollIndex=e.cursor||0,this.hint=e.hint||"",this.warn=e.warn||"- This option is disabled -",this.minSelected=e.min,this.showMinError=!1,this.maxChoices=e.max,this.instructions=e.instructions,this.optionsPerPage=e.optionsPerPage||10,this.value=e.choices.map((r,n)=>(typeof r=="string"&&(r={title:r,value:n}),{title:r&&(r.title||r.value||r),description:r&&r.description,value:r&&(r.value===void 0?n:r.value),selected:r&&r.selected,disabled:r&&r.disabled})),this.clear=Vk("",this.out.columns),e.overrideRender||this.render()}reset(){this.value.map(e=>!e.selected),this.cursor=0,this.fire(),this.render()}selected(){return this.value.filter(e=>e.selected)}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
80
+ ${n?" ":qJ.pointerSmall} ${Cd.red().italic(r)}`,"")),this.out.write(BJ.line+Sd.to(0)+this.outputText+Sd.save+this.outputError+Sd.restore))}};Uk.exports=ID});var ND=D((Pfe,Gk)=>{"use strict";var Yr=We(),HJ=Te(),VJ=HJ.cursor,zJ=bn(),el=Or(),Vk=el.clear,ni=el.figures,zk=el.style,GJ=el.wrap,WJ=el.entriesToDisplay,jD=class extends zJ{constructor(e={}){super(e),this.msg=e.message,this.cursor=e.cursor||0,this.scrollIndex=e.cursor||0,this.hint=e.hint||"",this.warn=e.warn||"- This option is disabled -",this.minSelected=e.min,this.showMinError=!1,this.maxChoices=e.max,this.instructions=e.instructions,this.optionsPerPage=e.optionsPerPage||10,this.value=e.choices.map((r,n)=>(typeof r=="string"&&(r={title:r,value:n}),{title:r&&(r.title||r.value||r),description:r&&r.description,value:r&&(r.value===void 0?n:r.value),selected:r&&r.selected,disabled:r&&r.disabled})),this.clear=Vk("",this.out.columns),e.overrideRender||this.render()}reset(){this.value.map(e=>!e.selected),this.cursor=0,this.fire(),this.render()}selected(){return this.value.filter(e=>e.selected)}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
81
81
  `),this.close()}submit(){let e=this.value.filter(r=>r.selected);this.minSelected&&e.length<this.minSelected?(this.showMinError=!0,this.render()):(this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
82
82
  `),this.close())}first(){this.cursor=0,this.render()}last(){this.cursor=this.value.length-1,this.render()}next(){this.cursor=(this.cursor+1)%this.value.length,this.render()}up(){this.cursor===0?this.cursor=this.value.length-1:this.cursor--,this.render()}down(){this.cursor===this.value.length-1?this.cursor=0:this.cursor++,this.render()}left(){this.value[this.cursor].selected=!1,this.render()}right(){if(this.value.filter(e=>e.selected).length>=this.maxChoices)return this.bell();this.value[this.cursor].selected=!0,this.render()}handleSpaceToggle(){let e=this.value[this.cursor];if(e.selected)e.selected=!1,this.render();else{if(e.disabled||this.value.filter(r=>r.selected).length>=this.maxChoices)return this.bell();e.selected=!0,this.render()}}toggleAll(){if(this.maxChoices!==void 0||this.value[this.cursor].disabled)return this.bell();let e=!this.value[this.cursor].selected;this.value.filter(r=>!r.disabled).forEach(r=>r.selected=e),this.render()}_(e,r){if(e===" ")this.handleSpaceToggle();else if(e==="a")this.toggleAll();else return this.bell()}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
83
83
  Instructions:
@@ -87,13 +87,13 @@ Instructions:
87
87
  `:"")+" enter/return: Complete answer":""}renderOption(e,r,n,i){let o=(r.selected?Yr.green(ni.radioOn):ni.radioOff)+" "+i+" ",s,a;return r.disabled?s=e===n?Yr.gray().underline(r.title):Yr.strikethrough().gray(r.title):(s=e===n?Yr.cyan().underline(r.title):r.title,e===n&&r.description&&(a=` - ${r.description}`,(o.length+s.length+a.length>=this.out.columns||r.description.split(/\r?\n/).length>1)&&(a=`
88
88
  `+GJ(r.description,{margin:o.length,width:this.out.columns})))),o+s+Yr.gray(a||"")}paginateOptions(e){if(e.length===0)return Yr.red("No matches for this query.");let r=WJ(this.cursor,e.length,this.optionsPerPage),n=r.startIndex,i=r.endIndex,o,s=[];for(let a=n;a<i;a++)a===n&&n>0?o=ni.arrowUp:a===i-1&&i<e.length?o=ni.arrowDown:o=" ",s.push(this.renderOption(this.cursor,e[a],a,o));return`
89
89
  `+s.join(`
90
- `)}renderOptions(e){return this.done?"":this.paginateOptions(e)}renderDoneOrInstructions(){if(this.done)return this.value.filter(r=>r.selected).map(r=>r.title).join(", ");let e=[Yr.gray(this.hint),this.renderInstructions()];return this.value[this.cursor].disabled&&e.push(Yr.yellow(this.warn)),e.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(VJ.hide),super.render();let e=[zk.symbol(this.done,this.aborted),Yr.bold(this.msg),zk.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(e+=Yr.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),e+=this.renderOptions(this.value),this.out.write(this.clear+e),this.clear=Vk(e,this.out.columns)}};Gk.exports=jD});var Qk=y((Rfe,Zk)=>{"use strict";function Wk(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(l){r(l);return}a.done?e(u):Promise.resolve(u).then(n,i)}function KJ(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function s(u){Wk(o,n,i,s,a,"next",u)}function a(u){Wk(o,n,i,s,a,"throw",u)}s(void 0)})}}var tl=We(),YJ=bn(),Xk=Te(),JJ=Xk.erase,Kk=Xk.cursor,rl=Or(),LD=rl.style,Yk=rl.clear,BD=rl.figures,XJ=rl.wrap,ZJ=rl.entriesToDisplay,Jk=(t,e)=>t[e]&&(t[e].value||t[e].title||t[e]),QJ=(t,e)=>t[e]&&(t[e].title||t[e].value||t[e]),eX=(t,e)=>{let r=t.findIndex(n=>n.value===e||n.title===e);return r>-1?r:void 0},qD=class extends YJ{constructor(e={}){super(e),this.msg=e.message,this.suggest=e.suggest,this.choices=e.choices,this.initial=typeof e.initial=="number"?e.initial:eX(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=LD.render(e.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=Yk("",this.out.columns),this.complete(this.render),this.render()}set fallback(e){this._fb=Number.isSafeInteger(parseInt(e))?parseInt(e):e}get fallback(){let e;return typeof this._fb=="number"?e=this.choices[this._fb]:typeof this._fb=="string"&&(e={title:this._fb}),e||this._fb||{title:this.i18n.noMatches}}moveSelect(e){this.select=e,this.suggestions.length>0?this.value=Jk(this.suggestions,e):this.value=this.fallback.value,this.fire()}complete(e){var r=this;return KJ(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:QJ(u,a),value:Jk(u,a),description:s.description})),r.completing=!1;let o=Math.max(i.length-1,0);r.moveSelect(Math.min(o,r.select)),e&&e()})()}reset(){this.input="",this.complete(()=>{this.moveSelect(this.initial!==void 0?this.initial:0),this.render()}),this.render()}exit(){this.clearFirst&&this.input.length>0?this.reset():(this.done=this.exited=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
90
+ `)}renderOptions(e){return this.done?"":this.paginateOptions(e)}renderDoneOrInstructions(){if(this.done)return this.value.filter(r=>r.selected).map(r=>r.title).join(", ");let e=[Yr.gray(this.hint),this.renderInstructions()];return this.value[this.cursor].disabled&&e.push(Yr.yellow(this.warn)),e.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(VJ.hide),super.render();let e=[zk.symbol(this.done,this.aborted),Yr.bold(this.msg),zk.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(e+=Yr.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),e+=this.renderOptions(this.value),this.out.write(this.clear+e),this.clear=Vk(e,this.out.columns)}};Gk.exports=jD});var Qk=D((Rfe,Zk)=>{"use strict";function Wk(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(l){r(l);return}a.done?e(u):Promise.resolve(u).then(n,i)}function KJ(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function s(u){Wk(o,n,i,s,a,"next",u)}function a(u){Wk(o,n,i,s,a,"throw",u)}s(void 0)})}}var tl=We(),YJ=bn(),Xk=Te(),JJ=Xk.erase,Kk=Xk.cursor,rl=Or(),LD=rl.style,Yk=rl.clear,BD=rl.figures,XJ=rl.wrap,ZJ=rl.entriesToDisplay,Jk=(t,e)=>t[e]&&(t[e].value||t[e].title||t[e]),QJ=(t,e)=>t[e]&&(t[e].title||t[e].value||t[e]),eX=(t,e)=>{let r=t.findIndex(n=>n.value===e||n.title===e);return r>-1?r:void 0},qD=class extends YJ{constructor(e={}){super(e),this.msg=e.message,this.suggest=e.suggest,this.choices=e.choices,this.initial=typeof e.initial=="number"?e.initial:eX(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=LD.render(e.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=Yk("",this.out.columns),this.complete(this.render),this.render()}set fallback(e){this._fb=Number.isSafeInteger(parseInt(e))?parseInt(e):e}get fallback(){let e;return typeof this._fb=="number"?e=this.choices[this._fb]:typeof this._fb=="string"&&(e={title:this._fb}),e||this._fb||{title:this.i18n.noMatches}}moveSelect(e){this.select=e,this.suggestions.length>0?this.value=Jk(this.suggestions,e):this.value=this.fallback.value,this.fire()}complete(e){var r=this;return KJ(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:QJ(u,a),value:Jk(u,a),description:s.description})),r.completing=!1;let o=Math.max(i.length-1,0);r.moveSelect(Math.min(o,r.select)),e&&e()})()}reset(){this.input="",this.complete(()=>{this.moveSelect(this.initial!==void 0?this.initial:0),this.render()}),this.render()}exit(){this.clearFirst&&this.input.length>0?this.reset():(this.done=this.exited=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
91
91
  `),this.close())}abort(){this.done=this.aborted=!0,this.exited=!1,this.fire(),this.render(),this.out.write(`
92
92
  `),this.close()}submit(){this.done=!0,this.aborted=this.exited=!1,this.fire(),this.render(),this.out.write(`
93
93
  `),this.close()}_(e,r){let n=this.input.slice(0,this.cursor),i=this.input.slice(this.cursor);this.input=`${n}${e}${i}`,this.cursor=n.length+1,this.complete(this.render),this.render()}delete(){if(this.cursor===0)return this.bell();let e=this.input.slice(0,this.cursor-1),r=this.input.slice(this.cursor);this.input=`${e}${r}`,this.complete(this.render),this.cursor=this.cursor-1,this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();let e=this.input.slice(0,this.cursor),r=this.input.slice(this.cursor+1);this.input=`${e}${r}`,this.complete(this.render),this.render()}first(){this.moveSelect(0),this.render()}last(){this.moveSelect(this.suggestions.length-1),this.render()}up(){this.select===0?this.moveSelect(this.suggestions.length-1):this.moveSelect(this.select-1),this.render()}down(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render()}next(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render()}nextPage(){this.moveSelect(Math.min(this.select+this.limit,this.suggestions.length-1)),this.render()}prevPage(){this.moveSelect(Math.max(this.select-this.limit,0)),this.render()}left(){if(this.cursor<=0)return this.bell();this.cursor=this.cursor-1,this.render()}right(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();this.cursor=this.cursor+1,this.render()}renderOption(e,r,n,i){let o,s=n?BD.arrowUp:i?BD.arrowDown:" ",a=r?tl.cyan().underline(e.title):e.title;return s=(r?tl.cyan(BD.pointer)+" ":" ")+s,e.description&&(o=` - ${e.description}`,(s.length+a.length+o.length>=this.out.columns||e.description.split(/\r?\n/).length>1)&&(o=`
94
94
  `+XJ(e.description,{margin:3,width:this.out.columns}))),s+" "+a+tl.gray(o||"")}render(){if(this.closed)return;this.firstRender?this.out.write(Kk.hide):this.out.write(Yk(this.outputText,this.out.columns)),super.render();let e=ZJ(this.select,this.choices.length,this.limit),r=e.startIndex,n=e.endIndex;if(this.outputText=[LD.symbol(this.done,this.aborted,this.exited),tl.bold(this.msg),LD.delimiter(this.completing),this.done&&this.suggestions[this.select]?this.suggestions[this.select].title:this.rendered=this.transform.render(this.input)].join(" "),!this.done){let i=this.suggestions.slice(r,n).map((o,s)=>this.renderOption(o,this.select===s+r,s===0&&r>0,s+r===n-1&&n<this.choices.length)).join(`
95
95
  `);this.outputText+=`
96
- `+(i||tl.gray(this.fallback.title))}this.out.write(JJ.line+Kk.to(0)+this.outputText)}};Zk.exports=qD});var nT=y(($fe,rT)=>{"use strict";var En=We(),tX=Te(),rX=tX.cursor,nX=ND(),UD=Or(),eT=UD.clear,tT=UD.style,Vs=UD.figures,MD=class extends nX{constructor(e={}){e.overrideRender=!0,super(e),this.inputValue="",this.clear=eT("",this.out.columns),this.filteredOptions=this.value,this.render()}last(){this.cursor=this.filteredOptions.length-1,this.render()}next(){this.cursor=(this.cursor+1)%this.filteredOptions.length,this.render()}up(){this.cursor===0?this.cursor=this.filteredOptions.length-1:this.cursor--,this.render()}down(){this.cursor===this.filteredOptions.length-1?this.cursor=0:this.cursor++,this.render()}left(){this.filteredOptions[this.cursor].selected=!1,this.render()}right(){if(this.value.filter(e=>e.selected).length>=this.maxChoices)return this.bell();this.filteredOptions[this.cursor].selected=!0,this.render()}delete(){this.inputValue.length&&(this.inputValue=this.inputValue.substr(0,this.inputValue.length-1),this.updateFilteredOptions())}updateFilteredOptions(){let e=this.filteredOptions[this.cursor];this.filteredOptions=this.value.filter(n=>this.inputValue?!!(typeof n.title=="string"&&n.title.toLowerCase().includes(this.inputValue.toLowerCase())||typeof n.value=="string"&&n.value.toLowerCase().includes(this.inputValue.toLowerCase())):!0);let r=this.filteredOptions.findIndex(n=>n===e);this.cursor=r<0?0:r,this.render()}handleSpaceToggle(){let e=this.filteredOptions[this.cursor];if(e.selected)e.selected=!1,this.render();else{if(e.disabled||this.value.filter(r=>r.selected).length>=this.maxChoices)return this.bell();e.selected=!0,this.render()}}handleInputChange(e){this.inputValue=this.inputValue+e,this.updateFilteredOptions()}_(e,r){e===" "?this.handleSpaceToggle():this.handleInputChange(e)}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
96
+ `+(i||tl.gray(this.fallback.title))}this.out.write(JJ.line+Kk.to(0)+this.outputText)}};Zk.exports=qD});var nT=D(($fe,rT)=>{"use strict";var En=We(),tX=Te(),rX=tX.cursor,nX=ND(),UD=Or(),eT=UD.clear,tT=UD.style,Vs=UD.figures,MD=class extends nX{constructor(e={}){e.overrideRender=!0,super(e),this.inputValue="",this.clear=eT("",this.out.columns),this.filteredOptions=this.value,this.render()}last(){this.cursor=this.filteredOptions.length-1,this.render()}next(){this.cursor=(this.cursor+1)%this.filteredOptions.length,this.render()}up(){this.cursor===0?this.cursor=this.filteredOptions.length-1:this.cursor--,this.render()}down(){this.cursor===this.filteredOptions.length-1?this.cursor=0:this.cursor++,this.render()}left(){this.filteredOptions[this.cursor].selected=!1,this.render()}right(){if(this.value.filter(e=>e.selected).length>=this.maxChoices)return this.bell();this.filteredOptions[this.cursor].selected=!0,this.render()}delete(){this.inputValue.length&&(this.inputValue=this.inputValue.substr(0,this.inputValue.length-1),this.updateFilteredOptions())}updateFilteredOptions(){let e=this.filteredOptions[this.cursor];this.filteredOptions=this.value.filter(n=>this.inputValue?!!(typeof n.title=="string"&&n.title.toLowerCase().includes(this.inputValue.toLowerCase())||typeof n.value=="string"&&n.value.toLowerCase().includes(this.inputValue.toLowerCase())):!0);let r=this.filteredOptions.findIndex(n=>n===e);this.cursor=r<0?0:r,this.render()}handleSpaceToggle(){let e=this.filteredOptions[this.cursor];if(e.selected)e.selected=!1,this.render();else{if(e.disabled||this.value.filter(r=>r.selected).length>=this.maxChoices)return this.bell();e.selected=!0,this.render()}}handleInputChange(e){this.inputValue=this.inputValue+e,this.updateFilteredOptions()}_(e,r){e===" "?this.handleSpaceToggle():this.handleInputChange(e)}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
97
97
  Instructions:
98
98
  ${Vs.arrowUp}/${Vs.arrowDown}: Highlight option
99
99
  ${Vs.arrowLeft}/${Vs.arrowRight}/[space]: Toggle selection
@@ -101,31 +101,31 @@ Instructions:
101
101
  enter/return: Complete answer
102
102
  `:""}renderCurrentInput(){return`
103
103
  Filtered results for: ${this.inputValue?this.inputValue:En.gray("Enter something to filter")}
104
- `}renderOption(e,r,n){let i;return r.disabled?i=e===n?En.gray().underline(r.title):En.strikethrough().gray(r.title):i=e===n?En.cyan().underline(r.title):r.title,(r.selected?En.green(Vs.radioOn):Vs.radioOff)+" "+i}renderDoneOrInstructions(){if(this.done)return this.value.filter(r=>r.selected).map(r=>r.title).join(", ");let e=[En.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&e.push(En.yellow(this.warn)),e.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(rX.hide),super.render();let e=[tT.symbol(this.done,this.aborted),En.bold(this.msg),tT.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(e+=En.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),e+=this.renderOptions(this.filteredOptions),this.out.write(this.clear+e),this.clear=eT(e,this.out.columns)}};rT.exports=MD});var cT=y((Ife,lT)=>{"use strict";var iT=We(),iX=bn(),aT=Or(),oT=aT.style,oX=aT.clear,uT=Te(),sX=uT.erase,sT=uT.cursor,HD=class extends iX{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(`
104
+ `}renderOption(e,r,n){let i;return r.disabled?i=e===n?En.gray().underline(r.title):En.strikethrough().gray(r.title):i=e===n?En.cyan().underline(r.title):r.title,(r.selected?En.green(Vs.radioOn):Vs.radioOff)+" "+i}renderDoneOrInstructions(){if(this.done)return this.value.filter(r=>r.selected).map(r=>r.title).join(", ");let e=[En.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&e.push(En.yellow(this.warn)),e.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(rX.hide),super.render();let e=[tT.symbol(this.done,this.aborted),En.bold(this.msg),tT.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(e+=En.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),e+=this.renderOptions(this.filteredOptions),this.out.write(this.clear+e),this.clear=eT(e,this.out.columns)}};rT.exports=MD});var cT=D((Ife,lT)=>{"use strict";var iT=We(),iX=bn(),aT=Or(),oT=aT.style,oX=aT.clear,uT=Te(),sX=uT.erase,sT=uT.cursor,HD=class extends iX{constructor(e={}){super(e),this.msg=e.message,this.value=e.initial,this.initialValue=!!e.initial,this.yesMsg=e.yes||"yes",this.yesOption=e.yesOption||"(Y/n)",this.noMsg=e.no||"no",this.noOption=e.noOption||"(y/N)",this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
105
105
  `),this.close()}submit(){this.value=this.value||!1,this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
106
- `),this.close()}_(e,r){return e.toLowerCase()==="y"?(this.value=!0,this.submit()):e.toLowerCase()==="n"?(this.value=!1,this.submit()):this.bell()}render(){this.closed||(this.firstRender?this.out.write(sT.hide):this.out.write(oX(this.outputText,this.out.columns)),super.render(),this.outputText=[oT.symbol(this.done,this.aborted),iT.bold(this.msg),oT.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:iT.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(sX.line+sT.to(0)+this.outputText))}};lT.exports=HD});var dT=y((jfe,fT)=>{"use strict";fT.exports={TextPrompt:XA(),SelectPrompt:tk(),TogglePrompt:ak(),DatePrompt:jk(),NumberPrompt:Hk(),MultiselectPrompt:ND(),AutocompletePrompt:Qk(),AutocompleteMultiselectPrompt:nT(),ConfirmPrompt:cT()}});var pT=y(hT=>{"use strict";var zt=hT,aX=dT(),Fd=t=>t;function Jr(t,e,r={}){return new Promise((n,i)=>{let o=new aX[t](e),s=r.onAbort||Fd,a=r.onSubmit||Fd,u=r.onExit||Fd;o.on("state",e.onState||Fd),o.on("submit",l=>n(a(l))),o.on("exit",l=>n(u(l))),o.on("abort",l=>i(s(l)))})}zt.text=t=>Jr("TextPrompt",t);zt.password=t=>(t.style="password",zt.text(t));zt.invisible=t=>(t.style="invisible",zt.text(t));zt.number=t=>Jr("NumberPrompt",t);zt.date=t=>Jr("DatePrompt",t);zt.confirm=t=>Jr("ConfirmPrompt",t);zt.list=t=>{let e=t.separator||",";return Jr("TextPrompt",t,{onSubmit:r=>r.split(e).map(n=>n.trim())})};zt.toggle=t=>Jr("TogglePrompt",t);zt.select=t=>Jr("SelectPrompt",t);zt.multiselect=t=>{t.choices=[].concat(t.choices||[]);let e=r=>r.filter(n=>n.selected).map(n=>n.value);return Jr("MultiselectPrompt",t,{onAbort:e,onSubmit:e})};zt.autocompleteMultiselect=t=>{t.choices=[].concat(t.choices||[]);let e=r=>r.filter(n=>n.selected).map(n=>n.value);return Jr("AutocompleteMultiselectPrompt",t,{onAbort:e,onSubmit:e})};var uX=(t,e)=>Promise.resolve(e.filter(r=>r.title.slice(0,t.length).toLowerCase()===t.toLowerCase()));zt.autocomplete=t=>(t.suggest=t.suggest||uX,t.choices=[].concat(t.choices||[]),Jr("AutocompletePrompt",t))});var _T=y((Lfe,wT)=>{"use strict";function mT(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function gT(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?mT(Object(r),!0).forEach(function(n){lX(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):mT(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function lX(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function cX(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=fX(t))||e&&t&&typeof t.length=="number"){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
107
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,s=!1,a;return{s:function(){r=r.call(t)},n:function(){var l=r.next();return o=l.done,l},e:function(l){s=!0,a=l},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(s)throw a}}}}function fX(t,e){if(t){if(typeof t=="string")return yT(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return yT(t,e)}}function yT(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function DT(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(l){r(l);return}a.done?e(u):Promise.resolve(u).then(n,i)}function vT(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function s(u){DT(o,n,i,s,a,"next",u)}function a(u){DT(o,n,i,s,a,"throw",u)}s(void 0)})}}var VD=pT(),dX=["suggest","format","onState","validate","onRender","type"],bT=()=>{};function ii(){return zD.apply(this,arguments)}function zD(){return zD=vT(function*(t=[],{onSubmit:e=bT,onCancel:r=bT}={}){let n={},i=ii._override||{};t=[].concat(t);let o,s,a,u,l,c,f=function(){var D=vT(function*(_,F,g=!1){if(!(!g&&_.validate&&_.validate(F)!==!0))return _.format?yield _.format(F,n):F});return function(F,g){return D.apply(this,arguments)}}();var h=cX(t),d;try{for(h.s();!(d=h.n()).done;){s=d.value;var m=s;if(u=m.name,l=m.type,typeof l=="function"&&(l=yield l(o,gT({},n),s),s.type=l),!!l){for(let D in s){if(dX.includes(D))continue;let _=s[D];s[D]=typeof _=="function"?yield _(o,gT({},n),c):_}if(c=s,typeof s.message!="string")throw new Error("prompt message is required");var b=s;if(u=b.name,l=b.type,VD[l]===void 0)throw new Error(`prompt type (${l}) is not defined`);if(i[s.name]!==void 0&&(o=yield f(s,i[s.name]),o!==void 0)){n[u]=o;continue}try{o=ii._injected?hX(ii._injected,s.initial):yield VD[l](s),n[u]=o=yield f(s,o,!0),a=yield e(s,o,n)}catch{a=!(yield r(s,n))}if(a)return n}}}catch(D){h.e(D)}finally{h.f()}return n}),zD.apply(this,arguments)}function hX(t,e){let r=t.shift();if(r instanceof Error)throw r;return r===void 0?e:r}function pX(t){ii._injected=(ii._injected||[]).concat(t)}function mX(t){ii._override=Object.assign({},t)}wT.exports=Object.assign(ii,{prompt:ii,prompts:VD,inject:pX,override:mX})});var CT=y((Bfe,ET)=>{"use strict";ET.exports=(t,e)=>{if(!(t.meta&&t.name!=="escape")){if(t.ctrl){if(t.name==="a")return"first";if(t.name==="c"||t.name==="d")return"abort";if(t.name==="e")return"last";if(t.name==="g")return"reset"}if(e){if(t.name==="j")return"down";if(t.name==="k")return"up"}return t.name==="return"||t.name==="enter"?"submit":t.name==="backspace"?"delete":t.name==="delete"?"deleteForward":t.name==="abort"?"abort":t.name==="escape"?"exit":t.name==="tab"?"next":t.name==="pagedown"?"nextPage":t.name==="pageup"?"prevPage":t.name==="home"?"home":t.name==="end"?"end":t.name==="up"?"up":t.name==="down"?"down":t.name==="right"?"right":t.name==="left"?"left":!1}}});var Od=y((qfe,ST)=>{"use strict";ST.exports=t=>{let e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))"].join("|"),r=new RegExp(e,"g");return typeof t=="string"?t.replace(r,""):t}});var OT=y((Mfe,FT)=>{"use strict";var gX=Od(),{erase:xT,cursor:yX}=Te(),DX=t=>[...gX(t)].length;FT.exports=function(t,e){if(!e)return xT.line+yX.to(0);let r=0,n=t.split(/\r?\n/);for(let i of n)r+=1+Math.floor(Math.max(DX(i)-1,0)/e);return xT.lines(r)}});var GD=y((Ufe,AT)=>{"use strict";var nl={arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",radioOn:"\u25C9",radioOff:"\u25EF",tick:"\u2714",cross:"\u2716",ellipsis:"\u2026",pointerSmall:"\u203A",line:"\u2500",pointer:"\u276F"},vX={arrowUp:nl.arrowUp,arrowDown:nl.arrowDown,arrowLeft:nl.arrowLeft,arrowRight:nl.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"\u221A",cross:"\xD7",ellipsis:"...",pointerSmall:"\xBB",line:"\u2500",pointer:">"},bX=process.platform==="win32"?vX:nl;AT.exports=bX});var TT=y((Hfe,kT)=>{"use strict";var zs=We(),oo=GD(),WD=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}`}}),wX=t=>WD[t]||WD.default,il=Object.freeze({aborted:zs.red(oo.cross),done:zs.green(oo.tick),exited:zs.yellow(oo.cross),default:zs.cyan("?")}),_X=(t,e,r)=>e?il.aborted:r?il.exited:t?il.done:il.default,EX=t=>zs.gray(t?oo.ellipsis:oo.pointerSmall),CX=(t,e)=>zs.gray(t?e?oo.pointerSmall:"+":oo.line);kT.exports={styles:WD,render:wX,symbols:il,symbol:_X,delimiter:EX,item:CX}});var RT=y((Vfe,PT)=>{"use strict";var SX=Od();PT.exports=function(t,e){let r=String(SX(t)||"").split(/\r?\n/);return e?r.map(n=>Math.ceil(n.length/e)).reduce((n,i)=>n+i):r.length}});var IT=y((zfe,$T)=>{"use strict";$T.exports=(t,e={})=>{let r=Number.isSafeInteger(parseInt(e.margin))?new Array(parseInt(e.margin)).fill(" ").join(""):e.margin||"",n=e.width;return(t||"").split(/\r?\n/g).map(i=>i.split(/\s+/g).reduce((o,s)=>(s.length+r.length>=n||o[o.length-1].length+s.length+1<n?o[o.length-1]+=` ${s}`:o.push(`${r}${s}`),o),[r]).join(`
106
+ `),this.close()}_(e,r){return e.toLowerCase()==="y"?(this.value=!0,this.submit()):e.toLowerCase()==="n"?(this.value=!1,this.submit()):this.bell()}render(){this.closed||(this.firstRender?this.out.write(sT.hide):this.out.write(oX(this.outputText,this.out.columns)),super.render(),this.outputText=[oT.symbol(this.done,this.aborted),iT.bold(this.msg),oT.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:iT.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(sX.line+sT.to(0)+this.outputText))}};lT.exports=HD});var dT=D((jfe,fT)=>{"use strict";fT.exports={TextPrompt:XA(),SelectPrompt:tk(),TogglePrompt:ak(),DatePrompt:jk(),NumberPrompt:Hk(),MultiselectPrompt:ND(),AutocompletePrompt:Qk(),AutocompleteMultiselectPrompt:nT(),ConfirmPrompt:cT()}});var pT=D(hT=>{"use strict";var zt=hT,aX=dT(),Fd=t=>t;function Jr(t,e,r={}){return new Promise((n,i)=>{let o=new aX[t](e),s=r.onAbort||Fd,a=r.onSubmit||Fd,u=r.onExit||Fd;o.on("state",e.onState||Fd),o.on("submit",l=>n(a(l))),o.on("exit",l=>n(u(l))),o.on("abort",l=>i(s(l)))})}zt.text=t=>Jr("TextPrompt",t);zt.password=t=>(t.style="password",zt.text(t));zt.invisible=t=>(t.style="invisible",zt.text(t));zt.number=t=>Jr("NumberPrompt",t);zt.date=t=>Jr("DatePrompt",t);zt.confirm=t=>Jr("ConfirmPrompt",t);zt.list=t=>{let e=t.separator||",";return Jr("TextPrompt",t,{onSubmit:r=>r.split(e).map(n=>n.trim())})};zt.toggle=t=>Jr("TogglePrompt",t);zt.select=t=>Jr("SelectPrompt",t);zt.multiselect=t=>{t.choices=[].concat(t.choices||[]);let e=r=>r.filter(n=>n.selected).map(n=>n.value);return Jr("MultiselectPrompt",t,{onAbort:e,onSubmit:e})};zt.autocompleteMultiselect=t=>{t.choices=[].concat(t.choices||[]);let e=r=>r.filter(n=>n.selected).map(n=>n.value);return Jr("AutocompleteMultiselectPrompt",t,{onAbort:e,onSubmit:e})};var uX=(t,e)=>Promise.resolve(e.filter(r=>r.title.slice(0,t.length).toLowerCase()===t.toLowerCase()));zt.autocomplete=t=>(t.suggest=t.suggest||uX,t.choices=[].concat(t.choices||[]),Jr("AutocompletePrompt",t))});var _T=D((Lfe,wT)=>{"use strict";function mT(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function gT(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?mT(Object(r),!0).forEach(function(n){lX(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):mT(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function lX(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function cX(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=fX(t))||e&&t&&typeof t.length=="number"){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
107
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,s=!1,a;return{s:function(){r=r.call(t)},n:function(){var l=r.next();return o=l.done,l},e:function(l){s=!0,a=l},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(s)throw a}}}}function fX(t,e){if(t){if(typeof t=="string")return yT(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return yT(t,e)}}function yT(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function DT(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(l){r(l);return}a.done?e(u):Promise.resolve(u).then(n,i)}function vT(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function s(u){DT(o,n,i,s,a,"next",u)}function a(u){DT(o,n,i,s,a,"throw",u)}s(void 0)})}}var VD=pT(),dX=["suggest","format","onState","validate","onRender","type"],bT=()=>{};function ii(){return zD.apply(this,arguments)}function zD(){return zD=vT(function*(t=[],{onSubmit:e=bT,onCancel:r=bT}={}){let n={},i=ii._override||{};t=[].concat(t);let o,s,a,u,l,c,f=function(){var y=vT(function*(E,F,g=!1){if(!(!g&&E.validate&&E.validate(F)!==!0))return E.format?yield E.format(F,n):F});return function(F,g){return y.apply(this,arguments)}}();var h=cX(t),d;try{for(h.s();!(d=h.n()).done;){s=d.value;var m=s;if(u=m.name,l=m.type,typeof l=="function"&&(l=yield l(o,gT({},n),s),s.type=l),!!l){for(let y in s){if(dX.includes(y))continue;let E=s[y];s[y]=typeof E=="function"?yield E(o,gT({},n),c):E}if(c=s,typeof s.message!="string")throw new Error("prompt message is required");var b=s;if(u=b.name,l=b.type,VD[l]===void 0)throw new Error(`prompt type (${l}) is not defined`);if(i[s.name]!==void 0&&(o=yield f(s,i[s.name]),o!==void 0)){n[u]=o;continue}try{o=ii._injected?hX(ii._injected,s.initial):yield VD[l](s),n[u]=o=yield f(s,o,!0),a=yield e(s,o,n)}catch{a=!(yield r(s,n))}if(a)return n}}}catch(y){h.e(y)}finally{h.f()}return n}),zD.apply(this,arguments)}function hX(t,e){let r=t.shift();if(r instanceof Error)throw r;return r===void 0?e:r}function pX(t){ii._injected=(ii._injected||[]).concat(t)}function mX(t){ii._override=Object.assign({},t)}wT.exports=Object.assign(ii,{prompt:ii,prompts:VD,inject:pX,override:mX})});var CT=D((Bfe,ET)=>{"use strict";ET.exports=(t,e)=>{if(!(t.meta&&t.name!=="escape")){if(t.ctrl){if(t.name==="a")return"first";if(t.name==="c"||t.name==="d")return"abort";if(t.name==="e")return"last";if(t.name==="g")return"reset"}if(e){if(t.name==="j")return"down";if(t.name==="k")return"up"}return t.name==="return"||t.name==="enter"?"submit":t.name==="backspace"?"delete":t.name==="delete"?"deleteForward":t.name==="abort"?"abort":t.name==="escape"?"exit":t.name==="tab"?"next":t.name==="pagedown"?"nextPage":t.name==="pageup"?"prevPage":t.name==="home"?"home":t.name==="end"?"end":t.name==="up"?"up":t.name==="down"?"down":t.name==="right"?"right":t.name==="left"?"left":!1}}});var Od=D((qfe,ST)=>{"use strict";ST.exports=t=>{let e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))"].join("|"),r=new RegExp(e,"g");return typeof t=="string"?t.replace(r,""):t}});var OT=D((Mfe,FT)=>{"use strict";var gX=Od(),{erase:xT,cursor:yX}=Te(),DX=t=>[...gX(t)].length;FT.exports=function(t,e){if(!e)return xT.line+yX.to(0);let r=0,n=t.split(/\r?\n/);for(let i of n)r+=1+Math.floor(Math.max(DX(i)-1,0)/e);return xT.lines(r)}});var GD=D((Ufe,AT)=>{"use strict";var nl={arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",radioOn:"\u25C9",radioOff:"\u25EF",tick:"\u2714",cross:"\u2716",ellipsis:"\u2026",pointerSmall:"\u203A",line:"\u2500",pointer:"\u276F"},vX={arrowUp:nl.arrowUp,arrowDown:nl.arrowDown,arrowLeft:nl.arrowLeft,arrowRight:nl.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"\u221A",cross:"\xD7",ellipsis:"...",pointerSmall:"\xBB",line:"\u2500",pointer:">"},bX=process.platform==="win32"?vX:nl;AT.exports=bX});var TT=D((Hfe,kT)=>{"use strict";var zs=We(),oo=GD(),WD=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}`}}),wX=t=>WD[t]||WD.default,il=Object.freeze({aborted:zs.red(oo.cross),done:zs.green(oo.tick),exited:zs.yellow(oo.cross),default:zs.cyan("?")}),_X=(t,e,r)=>e?il.aborted:r?il.exited:t?il.done:il.default,EX=t=>zs.gray(t?oo.ellipsis:oo.pointerSmall),CX=(t,e)=>zs.gray(t?e?oo.pointerSmall:"+":oo.line);kT.exports={styles:WD,render:wX,symbols:il,symbol:_X,delimiter:EX,item:CX}});var RT=D((Vfe,PT)=>{"use strict";var SX=Od();PT.exports=function(t,e){let r=String(SX(t)||"").split(/\r?\n/);return e?r.map(n=>Math.ceil(n.length/e)).reduce((n,i)=>n+i):r.length}});var IT=D((zfe,$T)=>{"use strict";$T.exports=(t,e={})=>{let r=Number.isSafeInteger(parseInt(e.margin))?new Array(parseInt(e.margin)).fill(" ").join(""):e.margin||"",n=e.width;return(t||"").split(/\r?\n/g).map(i=>i.split(/\s+/g).reduce((o,s)=>(s.length+r.length>=n||o[o.length-1].length+s.length+1<n?o[o.length-1]+=` ${s}`:o.push(`${r}${s}`),o),[r]).join(`
108
108
  `)).join(`
109
- `)}});var NT=y((Gfe,jT)=>{"use strict";jT.exports=(t,e,r)=>{r=r||e;let n=Math.min(e-r,t-Math.floor(r/2));n<0&&(n=0);let i=Math.min(n+r,e);return{startIndex:n,endIndex:i}}});var Ar=y((Wfe,LT)=>{"use strict";LT.exports={action:CT(),clear:OT(),style:TT(),strip:Od(),figures:GD(),lines:RT(),wrap:IT(),entriesToDisplay:NT()}});var Cn=y((Kfe,qT)=>{"use strict";var BT=require("readline"),{action:xX}=Ar(),FX=require("events"),{beep:OX,cursor:AX}=Te(),kX=We(),KD=class extends FX{constructor(e={}){super(),this.firstRender=!0,this.in=e.stdin||process.stdin,this.out=e.stdout||process.stdout,this.onRender=(e.onRender||(()=>{})).bind(this);let r=BT.createInterface({input:this.in,escapeCodeTimeout:50});BT.emitKeypressEvents(this.in,r),this.in.isTTY&&this.in.setRawMode(!0);let n=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1,i=(o,s)=>{let a=xX(s,n);a===!1?this._&&this._(o,s):typeof this[a]=="function"?this[a](s):this.bell()};this.close=()=>{this.out.write(AX.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(OX)}render(){this.onRender(kX),this.firstRender&&(this.firstRender=!1)}};qT.exports=KD});var UT=y((Yfe,MT)=>{var Ad=We(),TX=Cn(),{erase:PX,cursor:ol}=Te(),{style:YD,clear:JD,lines:RX,figures:$X}=Ar(),XD=class extends TX{constructor(e={}){super(e),this.transform=YD.render(e.style),this.scale=this.transform.scale,this.msg=e.message,this.initial=e.initial||"",this.validator=e.validate||(()=>!0),this.value="",this.errorMsg=e.error||"Please Enter A Valid Value",this.cursor=+!!this.initial,this.cursorOffset=0,this.clear=JD("",this.out.columns),this.render()}set value(e){!e&&this.initial?(this.placeholder=!0,this.rendered=Ad.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(`
109
+ `)}});var NT=D((Gfe,jT)=>{"use strict";jT.exports=(t,e,r)=>{r=r||e;let n=Math.min(e-r,t-Math.floor(r/2));n<0&&(n=0);let i=Math.min(n+r,e);return{startIndex:n,endIndex:i}}});var Ar=D((Wfe,LT)=>{"use strict";LT.exports={action:CT(),clear:OT(),style:TT(),strip:Od(),figures:GD(),lines:RT(),wrap:IT(),entriesToDisplay:NT()}});var Cn=D((Kfe,qT)=>{"use strict";var BT=require("readline"),{action:xX}=Ar(),FX=require("events"),{beep:OX,cursor:AX}=Te(),kX=We(),KD=class extends FX{constructor(e={}){super(),this.firstRender=!0,this.in=e.stdin||process.stdin,this.out=e.stdout||process.stdout,this.onRender=(e.onRender||(()=>{})).bind(this);let r=BT.createInterface({input:this.in,escapeCodeTimeout:50});BT.emitKeypressEvents(this.in,r),this.in.isTTY&&this.in.setRawMode(!0);let n=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1,i=(o,s)=>{let a=xX(s,n);a===!1?this._&&this._(o,s):typeof this[a]=="function"?this[a](s):this.bell()};this.close=()=>{this.out.write(AX.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(OX)}render(){this.onRender(kX),this.firstRender&&(this.firstRender=!1)}};qT.exports=KD});var UT=D((Yfe,MT)=>{var Ad=We(),TX=Cn(),{erase:PX,cursor:ol}=Te(),{style:YD,clear:JD,lines:RX,figures:$X}=Ar(),XD=class extends TX{constructor(e={}){super(e),this.transform=YD.render(e.style),this.scale=this.transform.scale,this.msg=e.message,this.initial=e.initial||"",this.validator=e.validate||(()=>!0),this.value="",this.errorMsg=e.error||"Please Enter A Valid Value",this.cursor=+!!this.initial,this.cursorOffset=0,this.clear=JD("",this.out.columns),this.render()}set value(e){!e&&this.initial?(this.placeholder=!0,this.rendered=Ad.gray(this.transform.render(this.initial))):(this.placeholder=!1,this.rendered=this.transform.render(e)),this._value=e,this.fire()}get value(){return this._value}reset(){this.value="",this.cursor=+!!this.initial,this.cursorOffset=0,this.fire(),this.render()}exit(){this.abort()}abort(){this.value=this.value||this.initial,this.done=this.aborted=!0,this.error=!1,this.red=!1,this.fire(),this.render(),this.out.write(`
110
110
  `),this.close()}async validate(){let e=await this.validator(this.value);typeof e=="string"&&(this.errorMsg=e,e=!1),this.error=!e}async submit(){if(this.value=this.value||this.initial,this.cursorOffset=0,this.cursor=this.rendered.length,await this.validate(),this.error){this.red=!0,this.fire(),this.render();return}this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
111
111
  `),this.close()}next(){if(!this.placeholder)return this.bell();this.value=this.initial,this.cursor=this.rendered.length,this.fire(),this.render()}moveCursor(e){this.placeholder||(this.cursor=this.cursor+e,this.cursorOffset+=e)}_(e,r){let n=this.value.slice(0,this.cursor),i=this.value.slice(this.cursor);this.value=`${n}${e}${i}`,this.red=!1,this.cursor=this.placeholder?0:n.length+1,this.render()}delete(){if(this.isCursorAtStart())return this.bell();let e=this.value.slice(0,this.cursor-1),r=this.value.slice(this.cursor);this.value=`${e}${r}`,this.red=!1,this.isCursorAtStart()?this.cursorOffset=0:(this.cursorOffset++,this.moveCursor(-1)),this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();let e=this.value.slice(0,this.cursor),r=this.value.slice(this.cursor+1);this.value=`${e}${r}`,this.red=!1,this.isCursorAtEnd()?this.cursorOffset=0:this.cursorOffset++,this.render()}first(){this.cursor=0,this.render()}last(){this.cursor=this.value.length,this.render()}left(){if(this.cursor<=0||this.placeholder)return this.bell();this.moveCursor(-1),this.render()}right(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();this.moveCursor(1),this.render()}isCursorAtStart(){return this.cursor===0||this.placeholder&&this.cursor===1}isCursorAtEnd(){return this.cursor===this.rendered.length||this.placeholder&&this.cursor===this.rendered.length+1}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(ol.down(RX(this.outputError,this.out.columns)-1)+JD(this.outputError,this.out.columns)),this.out.write(JD(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[YD.symbol(this.done,this.aborted),Ad.bold(this.msg),YD.delimiter(this.done),this.red?Ad.red(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
112
112
  `).reduce((e,r,n)=>e+`
113
- ${n?" ":$X.pointerSmall} ${Ad.red().italic(r)}`,"")),this.out.write(PX.line+ol.to(0)+this.outputText+ol.save+this.outputError+ol.restore+ol.move(this.cursorOffset,0)))}};MT.exports=XD});var GT=y((Jfe,zT)=>{"use strict";var Sn=We(),IX=Cn(),{style:HT,clear:VT,figures:kd,wrap:jX,entriesToDisplay:NX}=Ar(),{cursor:LX}=Te(),ZD=class extends IX{constructor(e={}){super(e),this.msg=e.message,this.hint=e.hint||"- Use arrow-keys. Return to submit.",this.warn=e.warn||"- This option is disabled",this.cursor=e.initial||0,this.choices=e.choices.map((r,n)=>(typeof r=="string"&&(r={title:r,value:n}),{title:r&&(r.title||r.value||r),value:r&&(r.value===void 0?n:r.value),description:r&&r.description,selected:r&&r.selected,disabled:r&&r.disabled})),this.optionsPerPage=e.optionsPerPage||10,this.value=(this.choices[this.cursor]||{}).value,this.clear=VT("",this.out.columns),this.render()}moveCursor(e){this.cursor=e,this.value=this.choices[e].value,this.fire()}reset(){this.moveCursor(0),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
113
+ ${n?" ":$X.pointerSmall} ${Ad.red().italic(r)}`,"")),this.out.write(PX.line+ol.to(0)+this.outputText+ol.save+this.outputError+ol.restore+ol.move(this.cursorOffset,0)))}};MT.exports=XD});var GT=D((Jfe,zT)=>{"use strict";var Sn=We(),IX=Cn(),{style:HT,clear:VT,figures:kd,wrap:jX,entriesToDisplay:NX}=Ar(),{cursor:LX}=Te(),ZD=class extends IX{constructor(e={}){super(e),this.msg=e.message,this.hint=e.hint||"- Use arrow-keys. Return to submit.",this.warn=e.warn||"- This option is disabled",this.cursor=e.initial||0,this.choices=e.choices.map((r,n)=>(typeof r=="string"&&(r={title:r,value:n}),{title:r&&(r.title||r.value||r),value:r&&(r.value===void 0?n:r.value),description:r&&r.description,selected:r&&r.selected,disabled:r&&r.disabled})),this.optionsPerPage=e.optionsPerPage||10,this.value=(this.choices[this.cursor]||{}).value,this.clear=VT("",this.out.columns),this.render()}moveCursor(e){this.cursor=e,this.value=this.choices[e].value,this.fire()}reset(){this.moveCursor(0),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
114
114
  `),this.close()}submit(){this.selection.disabled?this.bell():(this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
115
115
  `),this.close())}first(){this.moveCursor(0),this.render()}last(){this.moveCursor(this.choices.length-1),this.render()}up(){this.cursor===0?this.moveCursor(this.choices.length-1):this.moveCursor(this.cursor-1),this.render()}down(){this.cursor===this.choices.length-1?this.moveCursor(0):this.moveCursor(this.cursor+1),this.render()}next(){this.moveCursor((this.cursor+1)%this.choices.length),this.render()}_(e,r){if(e===" ")return this.submit()}get selection(){return this.choices[this.cursor]}render(){if(this.closed)return;this.firstRender?this.out.write(LX.hide):this.out.write(VT(this.outputText,this.out.columns)),super.render();let{startIndex:e,endIndex:r}=NX(this.cursor,this.choices.length,this.optionsPerPage);if(this.outputText=[HT.symbol(this.done,this.aborted),Sn.bold(this.msg),HT.delimiter(!1),this.done?this.selection.title:this.selection.disabled?Sn.yellow(this.warn):Sn.gray(this.hint)].join(" "),!this.done){this.outputText+=`
116
116
  `;for(let n=e;n<r;n++){let i,o,s="",a=this.choices[n];n===e&&e>0?o=kd.arrowUp:n===r-1&&r<this.choices.length?o=kd.arrowDown:o=" ",a.disabled?(i=this.cursor===n?Sn.gray().underline(a.title):Sn.strikethrough().gray(a.title),o=(this.cursor===n?Sn.bold().gray(kd.pointer)+" ":" ")+o):(i=this.cursor===n?Sn.cyan().underline(a.title):a.title,o=(this.cursor===n?Sn.cyan(kd.pointer)+" ":" ")+o,a.description&&this.cursor===n&&(s=` - ${a.description}`,(o.length+i.length+s.length>=this.out.columns||a.description.split(/\r?\n/).length>1)&&(s=`
117
117
  `+jX(a.description,{margin:3,width:this.out.columns})))),this.outputText+=`${o} ${i}${Sn.gray(s)}
118
- `}}this.out.write(this.outputText)}};zT.exports=ZD});var JT=y((Xfe,YT)=>{var Td=We(),BX=Cn(),{style:WT,clear:qX}=Ar(),{cursor:KT,erase:MX}=Te(),QD=class extends BX{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(`
118
+ `}}this.out.write(this.outputText)}};zT.exports=ZD});var JT=D((Xfe,YT)=>{var Td=We(),BX=Cn(),{style:WT,clear:qX}=Ar(),{cursor:KT,erase:MX}=Te(),QD=class extends BX{constructor(e={}){super(e),this.msg=e.message,this.value=!!e.initial,this.active=e.active||"on",this.inactive=e.inactive||"off",this.initialValue=this.value,this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
119
119
  `),this.close()}submit(){this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
120
- `),this.close()}deactivate(){if(this.value===!1)return this.bell();this.value=!1,this.render()}activate(){if(this.value===!0)return this.bell();this.value=!0,this.render()}delete(){this.deactivate()}left(){this.deactivate()}right(){this.activate()}down(){this.deactivate()}up(){this.activate()}next(){this.value=!this.value,this.fire(),this.render()}_(e,r){if(e===" ")this.value=!this.value;else if(e==="1")this.value=!0;else if(e==="0")this.value=!1;else return this.bell();this.render()}render(){this.closed||(this.firstRender?this.out.write(KT.hide):this.out.write(qX(this.outputText,this.out.columns)),super.render(),this.outputText=[WT.symbol(this.done,this.aborted),Td.bold(this.msg),WT.delimiter(this.done),this.value?this.inactive:Td.cyan().underline(this.inactive),Td.gray("/"),this.value?Td.cyan().underline(this.active):this.active].join(" "),this.out.write(MX.line+KT.to(0)+this.outputText))}};YT.exports=QD});var Xr=y((Zfe,XT)=>{"use strict";var e0=class t{constructor({token:e,date:r,parts:n,locales:i}){this.token=e,this.date=r||new Date,this.parts=n||[this],this.locales=i||{}}up(){}down(){}next(){let e=this.parts.indexOf(this);return this.parts.find((r,n)=>n>e&&r instanceof t)}setTo(e){}prev(){let e=[].concat(this.parts).reverse(),r=e.indexOf(this);return e.find((n,i)=>i>r&&n instanceof t)}toString(){return String(this.date)}};XT.exports=e0});var QT=y((Qfe,ZT)=>{"use strict";var UX=Xr(),t0=class extends UX{constructor(e={}){super(e)}up(){this.date.setHours((this.date.getHours()+12)%24)}down(){this.up()}toString(){let e=this.date.getHours()>12?"pm":"am";return/\A/.test(this.token)?e.toUpperCase():e}};ZT.exports=t0});var tP=y((ede,eP)=>{"use strict";var HX=Xr(),VX=t=>(t=t%10,t===1?"st":t===2?"nd":t===3?"rd":"th"),r0=class extends HX{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+VX(e):this.token==="d"?r+1:this.token==="ddd"?this.locales.weekdaysShort[r]:this.token==="dddd"?this.locales.weekdays[r]:e}};eP.exports=r0});var nP=y((tde,rP)=>{"use strict";var zX=Xr(),n0=class extends zX{constructor(e={}){super(e)}up(){this.date.setHours(this.date.getHours()+1)}down(){this.date.setHours(this.date.getHours()-1)}setTo(e){this.date.setHours(parseInt(e.substr(-2)))}toString(){let e=this.date.getHours();return/h/.test(this.token)&&(e=e%12||12),this.token.length>1?String(e).padStart(2,"0"):e}};rP.exports=n0});var oP=y((rde,iP)=>{"use strict";var GX=Xr(),i0=class extends GX{constructor(e={}){super(e)}up(){this.date.setMilliseconds(this.date.getMilliseconds()+1)}down(){this.date.setMilliseconds(this.date.getMilliseconds()-1)}setTo(e){this.date.setMilliseconds(parseInt(e.substr(-this.token.length)))}toString(){return String(this.date.getMilliseconds()).padStart(4,"0").substr(0,this.token.length)}};iP.exports=i0});var aP=y((nde,sP)=>{"use strict";var WX=Xr(),o0=class extends WX{constructor(e={}){super(e)}up(){this.date.setMinutes(this.date.getMinutes()+1)}down(){this.date.setMinutes(this.date.getMinutes()-1)}setTo(e){this.date.setMinutes(parseInt(e.substr(-2)))}toString(){let e=this.date.getMinutes();return this.token.length>1?String(e).padStart(2,"0"):e}};sP.exports=o0});var lP=y((ide,uP)=>{"use strict";var KX=Xr(),s0=class extends KX{constructor(e={}){super(e)}up(){this.date.setMonth(this.date.getMonth()+1)}down(){this.date.setMonth(this.date.getMonth()-1)}setTo(e){e=parseInt(e.substr(-2))-1,this.date.setMonth(e<0?0:e)}toString(){let e=this.date.getMonth(),r=this.token.length;return r===2?String(e+1).padStart(2,"0"):r===3?this.locales.monthsShort[e]:r===4?this.locales.months[e]:String(e+1)}};uP.exports=s0});var fP=y((ode,cP)=>{"use strict";var YX=Xr(),a0=class extends YX{constructor(e={}){super(e)}up(){this.date.setSeconds(this.date.getSeconds()+1)}down(){this.date.setSeconds(this.date.getSeconds()-1)}setTo(e){this.date.setSeconds(parseInt(e.substr(-2)))}toString(){let e=this.date.getSeconds();return this.token.length>1?String(e).padStart(2,"0"):e}};cP.exports=a0});var hP=y((sde,dP)=>{"use strict";var JX=Xr(),u0=class extends JX{constructor(e={}){super(e)}up(){this.date.setFullYear(this.date.getFullYear()+1)}down(){this.date.setFullYear(this.date.getFullYear()-1)}setTo(e){this.date.setFullYear(e.substr(-4))}toString(){let e=String(this.date.getFullYear()).padStart(4,"0");return this.token.length===2?e.substr(-2):e}};dP.exports=u0});var mP=y((ade,pP)=>{"use strict";pP.exports={DatePart:Xr(),Meridiem:QT(),Day:tP(),Hours:nP(),Milliseconds:oP(),Minutes:aP(),Month:lP(),Seconds:fP(),Year:hP()}});var _P=y((ude,wP)=>{"use strict";var l0=We(),XX=Cn(),{style:gP,clear:yP,figures:ZX}=Ar(),{erase:QX,cursor:DP}=Te(),{DatePart:vP,Meridiem:eZ,Day:tZ,Hours:rZ,Milliseconds:nZ,Minutes:iZ,Month:oZ,Seconds:sZ,Year:aZ}=mP(),uZ=/\\(.)|"((?:\\["\\]|[^"])+)"|(D[Do]?|d{3,4}|d)|(M{1,4})|(YY(?:YY)?)|([aA])|([Hh]{1,2})|(m{1,2})|(s{1,2})|(S{1,4})|./g,bP={1:({token:t})=>t.replace(/\\(.)/g,"$1"),2:t=>new tZ(t),3:t=>new oZ(t),4:t=>new aZ(t),5:t=>new eZ(t),6:t=>new rZ(t),7:t=>new iZ(t),8:t=>new sZ(t),9:t=>new nZ(t)},lZ={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(",")},c0=class extends XX{constructor(e={}){super(e),this.msg=e.message,this.cursor=0,this.typed="",this.locales=Object.assign(lZ,e.locales),this._date=e.initial||new Date,this.errorMsg=e.error||"Please Enter A Valid Value",this.validator=e.validate||(()=>!0),this.mask=e.mask||"YYYY-MM-DD HH:mm:ss",this.clear=yP("",this.out.columns),this.render()}get value(){return this.date}get date(){return this._date}set date(e){e&&this._date.setTime(e.getTime())}set mask(e){let r;for(this.parts=[];r=uZ.exec(e);){let i=r.shift(),o=r.findIndex(s=>s!=null);this.parts.push(o in bP?bP[o]({token:r[o]||i,date:this.date,parts:this.parts,locales:this.locales}):r[o]||i)}let n=this.parts.reduce((i,o)=>(typeof o=="string"&&typeof i[i.length-1]=="string"?i[i.length-1]+=o:i.push(o),i),[]);this.parts.splice(0),this.parts.push(...n),this.reset()}moveCursor(e){this.typed="",this.cursor=e,this.fire()}reset(){this.moveCursor(this.parts.findIndex(e=>e instanceof vP)),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
120
+ `),this.close()}deactivate(){if(this.value===!1)return this.bell();this.value=!1,this.render()}activate(){if(this.value===!0)return this.bell();this.value=!0,this.render()}delete(){this.deactivate()}left(){this.deactivate()}right(){this.activate()}down(){this.deactivate()}up(){this.activate()}next(){this.value=!this.value,this.fire(),this.render()}_(e,r){if(e===" ")this.value=!this.value;else if(e==="1")this.value=!0;else if(e==="0")this.value=!1;else return this.bell();this.render()}render(){this.closed||(this.firstRender?this.out.write(KT.hide):this.out.write(qX(this.outputText,this.out.columns)),super.render(),this.outputText=[WT.symbol(this.done,this.aborted),Td.bold(this.msg),WT.delimiter(this.done),this.value?this.inactive:Td.cyan().underline(this.inactive),Td.gray("/"),this.value?Td.cyan().underline(this.active):this.active].join(" "),this.out.write(MX.line+KT.to(0)+this.outputText))}};YT.exports=QD});var Xr=D((Zfe,XT)=>{"use strict";var e0=class t{constructor({token:e,date:r,parts:n,locales:i}){this.token=e,this.date=r||new Date,this.parts=n||[this],this.locales=i||{}}up(){}down(){}next(){let e=this.parts.indexOf(this);return this.parts.find((r,n)=>n>e&&r instanceof t)}setTo(e){}prev(){let e=[].concat(this.parts).reverse(),r=e.indexOf(this);return e.find((n,i)=>i>r&&n instanceof t)}toString(){return String(this.date)}};XT.exports=e0});var QT=D((Qfe,ZT)=>{"use strict";var UX=Xr(),t0=class extends UX{constructor(e={}){super(e)}up(){this.date.setHours((this.date.getHours()+12)%24)}down(){this.up()}toString(){let e=this.date.getHours()>12?"pm":"am";return/\A/.test(this.token)?e.toUpperCase():e}};ZT.exports=t0});var tP=D((ede,eP)=>{"use strict";var HX=Xr(),VX=t=>(t=t%10,t===1?"st":t===2?"nd":t===3?"rd":"th"),r0=class extends HX{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+VX(e):this.token==="d"?r+1:this.token==="ddd"?this.locales.weekdaysShort[r]:this.token==="dddd"?this.locales.weekdays[r]:e}};eP.exports=r0});var nP=D((tde,rP)=>{"use strict";var zX=Xr(),n0=class extends zX{constructor(e={}){super(e)}up(){this.date.setHours(this.date.getHours()+1)}down(){this.date.setHours(this.date.getHours()-1)}setTo(e){this.date.setHours(parseInt(e.substr(-2)))}toString(){let e=this.date.getHours();return/h/.test(this.token)&&(e=e%12||12),this.token.length>1?String(e).padStart(2,"0"):e}};rP.exports=n0});var oP=D((rde,iP)=>{"use strict";var GX=Xr(),i0=class extends GX{constructor(e={}){super(e)}up(){this.date.setMilliseconds(this.date.getMilliseconds()+1)}down(){this.date.setMilliseconds(this.date.getMilliseconds()-1)}setTo(e){this.date.setMilliseconds(parseInt(e.substr(-this.token.length)))}toString(){return String(this.date.getMilliseconds()).padStart(4,"0").substr(0,this.token.length)}};iP.exports=i0});var aP=D((nde,sP)=>{"use strict";var WX=Xr(),o0=class extends WX{constructor(e={}){super(e)}up(){this.date.setMinutes(this.date.getMinutes()+1)}down(){this.date.setMinutes(this.date.getMinutes()-1)}setTo(e){this.date.setMinutes(parseInt(e.substr(-2)))}toString(){let e=this.date.getMinutes();return this.token.length>1?String(e).padStart(2,"0"):e}};sP.exports=o0});var lP=D((ide,uP)=>{"use strict";var KX=Xr(),s0=class extends KX{constructor(e={}){super(e)}up(){this.date.setMonth(this.date.getMonth()+1)}down(){this.date.setMonth(this.date.getMonth()-1)}setTo(e){e=parseInt(e.substr(-2))-1,this.date.setMonth(e<0?0:e)}toString(){let e=this.date.getMonth(),r=this.token.length;return r===2?String(e+1).padStart(2,"0"):r===3?this.locales.monthsShort[e]:r===4?this.locales.months[e]:String(e+1)}};uP.exports=s0});var fP=D((ode,cP)=>{"use strict";var YX=Xr(),a0=class extends YX{constructor(e={}){super(e)}up(){this.date.setSeconds(this.date.getSeconds()+1)}down(){this.date.setSeconds(this.date.getSeconds()-1)}setTo(e){this.date.setSeconds(parseInt(e.substr(-2)))}toString(){let e=this.date.getSeconds();return this.token.length>1?String(e).padStart(2,"0"):e}};cP.exports=a0});var hP=D((sde,dP)=>{"use strict";var JX=Xr(),u0=class extends JX{constructor(e={}){super(e)}up(){this.date.setFullYear(this.date.getFullYear()+1)}down(){this.date.setFullYear(this.date.getFullYear()-1)}setTo(e){this.date.setFullYear(e.substr(-4))}toString(){let e=String(this.date.getFullYear()).padStart(4,"0");return this.token.length===2?e.substr(-2):e}};dP.exports=u0});var mP=D((ade,pP)=>{"use strict";pP.exports={DatePart:Xr(),Meridiem:QT(),Day:tP(),Hours:nP(),Milliseconds:oP(),Minutes:aP(),Month:lP(),Seconds:fP(),Year:hP()}});var _P=D((ude,wP)=>{"use strict";var l0=We(),XX=Cn(),{style:gP,clear:yP,figures:ZX}=Ar(),{erase:QX,cursor:DP}=Te(),{DatePart:vP,Meridiem:eZ,Day:tZ,Hours:rZ,Milliseconds:nZ,Minutes:iZ,Month:oZ,Seconds:sZ,Year:aZ}=mP(),uZ=/\\(.)|"((?:\\["\\]|[^"])+)"|(D[Do]?|d{3,4}|d)|(M{1,4})|(YY(?:YY)?)|([aA])|([Hh]{1,2})|(m{1,2})|(s{1,2})|(S{1,4})|./g,bP={1:({token:t})=>t.replace(/\\(.)/g,"$1"),2:t=>new tZ(t),3:t=>new oZ(t),4:t=>new aZ(t),5:t=>new eZ(t),6:t=>new rZ(t),7:t=>new iZ(t),8:t=>new sZ(t),9:t=>new nZ(t)},lZ={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(",")},c0=class extends XX{constructor(e={}){super(e),this.msg=e.message,this.cursor=0,this.typed="",this.locales=Object.assign(lZ,e.locales),this._date=e.initial||new Date,this.errorMsg=e.error||"Please Enter A Valid Value",this.validator=e.validate||(()=>!0),this.mask=e.mask||"YYYY-MM-DD HH:mm:ss",this.clear=yP("",this.out.columns),this.render()}get value(){return this.date}get date(){return this._date}set date(e){e&&this._date.setTime(e.getTime())}set mask(e){let r;for(this.parts=[];r=uZ.exec(e);){let i=r.shift(),o=r.findIndex(s=>s!=null);this.parts.push(o in bP?bP[o]({token:r[o]||i,date:this.date,parts:this.parts,locales:this.locales}):r[o]||i)}let n=this.parts.reduce((i,o)=>(typeof o=="string"&&typeof i[i.length-1]=="string"?i[i.length-1]+=o:i.push(o),i),[]);this.parts.splice(0),this.parts.push(...n),this.reset()}moveCursor(e){this.typed="",this.cursor=e,this.fire()}reset(){this.moveCursor(this.parts.findIndex(e=>e instanceof vP)),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
121
121
  `),this.close()}async validate(){let e=await this.validator(this.value);typeof e=="string"&&(this.errorMsg=e,e=!1),this.error=!e}async submit(){if(await this.validate(),this.error){this.color="red",this.fire(),this.render();return}this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
122
122
  `),this.close()}up(){this.typed="",this.parts[this.cursor].up(),this.render()}down(){this.typed="",this.parts[this.cursor].down(),this.render()}left(){let e=this.parts[this.cursor].prev();if(e==null)return this.bell();this.moveCursor(this.parts.indexOf(e)),this.render()}right(){let e=this.parts[this.cursor].next();if(e==null)return this.bell();this.moveCursor(this.parts.indexOf(e)),this.render()}next(){let e=this.parts[this.cursor].next();this.moveCursor(e?this.parts.indexOf(e):this.parts.findIndex(r=>r instanceof vP)),this.render()}_(e){/\d/.test(e)&&(this.typed+=e,this.parts[this.cursor].setTo(this.typed),this.render())}render(){this.closed||(this.firstRender?this.out.write(DP.hide):this.out.write(yP(this.outputText,this.out.columns)),super.render(),this.outputText=[gP.symbol(this.done,this.aborted),l0.bold(this.msg),gP.delimiter(!1),this.parts.reduce((e,r,n)=>e.concat(n===this.cursor&&!this.done?l0.cyan().underline(r.toString()):r),[]).join("")].join(" "),this.error&&(this.outputText+=this.errorMsg.split(`
123
123
  `).reduce((e,r,n)=>e+`
124
- ${n?" ":ZX.pointerSmall} ${l0.red().italic(r)}`,"")),this.out.write(QX.line+DP.to(0)+this.outputText))}};wP.exports=c0});var xP=y((lde,SP)=>{var Pd=We(),cZ=Cn(),{cursor:Rd,erase:fZ}=Te(),{style:f0,figures:dZ,clear:EP,lines:hZ}=Ar(),pZ=/[0-9]/,d0=t=>t!==void 0,CP=(t,e)=>{let r=Math.pow(10,e);return Math.round(t*r)/r},h0=class extends cZ{constructor(e={}){super(e),this.transform=f0.render(e.style),this.msg=e.message,this.initial=d0(e.initial)?e.initial:"",this.float=!!e.float,this.round=e.round||2,this.inc=e.increment||1,this.min=d0(e.min)?e.min:-1/0,this.max=d0(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=Pd.gray(this.transform.render(`${this.initial}`)),this._value=""):(this.placeholder=!1,this.rendered=this.transform.render(`${CP(e,this.round)}`),this._value=CP(e,this.round)),this.fire()}get value(){return this._value}parse(e){return this.float?parseFloat(e):parseInt(e)}valid(e){return e==="-"||e==="."&&this.float||pZ.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(`
124
+ ${n?" ":ZX.pointerSmall} ${l0.red().italic(r)}`,"")),this.out.write(QX.line+DP.to(0)+this.outputText))}};wP.exports=c0});var xP=D((lde,SP)=>{var Pd=We(),cZ=Cn(),{cursor:Rd,erase:fZ}=Te(),{style:f0,figures:dZ,clear:EP,lines:hZ}=Ar(),pZ=/[0-9]/,d0=t=>t!==void 0,CP=(t,e)=>{let r=Math.pow(10,e);return Math.round(t*r)/r},h0=class extends cZ{constructor(e={}){super(e),this.transform=f0.render(e.style),this.msg=e.message,this.initial=d0(e.initial)?e.initial:"",this.float=!!e.float,this.round=e.round||2,this.inc=e.increment||1,this.min=d0(e.min)?e.min:-1/0,this.max=d0(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=Pd.gray(this.transform.render(`${this.initial}`)),this._value=""):(this.placeholder=!1,this.rendered=this.transform.render(`${CP(e,this.round)}`),this._value=CP(e,this.round)),this.fire()}get value(){return this._value}parse(e){return this.float?parseFloat(e):parseInt(e)}valid(e){return e==="-"||e==="."&&this.float||pZ.test(e)}reset(){this.typed="",this.value="",this.fire(),this.render()}exit(){this.abort()}abort(){let e=this.value;this.value=e!==""?e:this.initial,this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
125
125
  `),this.close()}async validate(){let e=await this.validator(this.value);typeof e=="string"&&(this.errorMsg=e,e=!1),this.error=!e}async submit(){if(await this.validate(),this.error){this.color="red",this.fire(),this.render();return}let e=this.value;this.value=e!==""?e:this.initial,this.done=!0,this.aborted=!1,this.error=!1,this.fire(),this.render(),this.out.write(`
126
126
  `),this.close()}up(){if(this.typed="",this.value===""&&(this.value=this.min-this.inc),this.value>=this.max)return this.bell();this.value+=this.inc,this.color="cyan",this.fire(),this.render()}down(){if(this.typed="",this.value===""&&(this.value=this.min+this.inc),this.value<=this.min)return this.bell();this.value-=this.inc,this.color="cyan",this.fire(),this.render()}delete(){let e=this.value.toString();if(e.length===0)return this.bell();this.value=this.parse(e=e.slice(0,-1))||"",this.value!==""&&this.value<this.min&&(this.value=this.min),this.color="cyan",this.fire(),this.render()}next(){this.value=this.initial,this.fire(),this.render()}_(e,r){if(!this.valid(e))return this.bell();let n=Date.now();if(n-this.lastHit>1e3&&(this.typed=""),this.typed+=e,this.lastHit=n,this.color="cyan",e===".")return this.fire();this.value=Math.min(this.parse(this.typed),this.max),this.value>this.max&&(this.value=this.max),this.value<this.min&&(this.value=this.min),this.fire(),this.render()}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(Rd.down(hZ(this.outputError,this.out.columns)-1)+EP(this.outputError,this.out.columns)),this.out.write(EP(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[f0.symbol(this.done,this.aborted),Pd.bold(this.msg),f0.delimiter(this.done),!this.done||!this.done&&!this.placeholder?Pd[this.color]().underline(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
127
127
  `).reduce((e,r,n)=>e+`
128
- ${n?" ":dZ.pointerSmall} ${Pd.red().italic(r)}`,"")),this.out.write(fZ.line+Rd.to(0)+this.outputText+Rd.save+this.outputError+Rd.restore))}};SP.exports=h0});var m0=y((cde,AP)=>{"use strict";var Zr=We(),{cursor:mZ}=Te(),gZ=Cn(),{clear:FP,figures:oi,style:OP,wrap:yZ,entriesToDisplay:DZ}=Ar(),p0=class extends gZ{constructor(e={}){super(e),this.msg=e.message,this.cursor=e.cursor||0,this.scrollIndex=e.cursor||0,this.hint=e.hint||"",this.warn=e.warn||"- This option is disabled -",this.minSelected=e.min,this.showMinError=!1,this.maxChoices=e.max,this.instructions=e.instructions,this.optionsPerPage=e.optionsPerPage||10,this.value=e.choices.map((r,n)=>(typeof r=="string"&&(r={title:r,value:n}),{title:r&&(r.title||r.value||r),description:r&&r.description,value:r&&(r.value===void 0?n:r.value),selected:r&&r.selected,disabled:r&&r.disabled})),this.clear=FP("",this.out.columns),e.overrideRender||this.render()}reset(){this.value.map(e=>!e.selected),this.cursor=0,this.fire(),this.render()}selected(){return this.value.filter(e=>e.selected)}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
128
+ ${n?" ":dZ.pointerSmall} ${Pd.red().italic(r)}`,"")),this.out.write(fZ.line+Rd.to(0)+this.outputText+Rd.save+this.outputError+Rd.restore))}};SP.exports=h0});var m0=D((cde,AP)=>{"use strict";var Zr=We(),{cursor:mZ}=Te(),gZ=Cn(),{clear:FP,figures:oi,style:OP,wrap:yZ,entriesToDisplay:DZ}=Ar(),p0=class extends gZ{constructor(e={}){super(e),this.msg=e.message,this.cursor=e.cursor||0,this.scrollIndex=e.cursor||0,this.hint=e.hint||"",this.warn=e.warn||"- This option is disabled -",this.minSelected=e.min,this.showMinError=!1,this.maxChoices=e.max,this.instructions=e.instructions,this.optionsPerPage=e.optionsPerPage||10,this.value=e.choices.map((r,n)=>(typeof r=="string"&&(r={title:r,value:n}),{title:r&&(r.title||r.value||r),description:r&&r.description,value:r&&(r.value===void 0?n:r.value),selected:r&&r.selected,disabled:r&&r.disabled})),this.clear=FP("",this.out.columns),e.overrideRender||this.render()}reset(){this.value.map(e=>!e.selected),this.cursor=0,this.fire(),this.render()}selected(){return this.value.filter(e=>e.selected)}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
129
129
  `),this.close()}submit(){let e=this.value.filter(r=>r.selected);this.minSelected&&e.length<this.minSelected?(this.showMinError=!0,this.render()):(this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
130
130
  `),this.close())}first(){this.cursor=0,this.render()}last(){this.cursor=this.value.length-1,this.render()}next(){this.cursor=(this.cursor+1)%this.value.length,this.render()}up(){this.cursor===0?this.cursor=this.value.length-1:this.cursor--,this.render()}down(){this.cursor===this.value.length-1?this.cursor=0:this.cursor++,this.render()}left(){this.value[this.cursor].selected=!1,this.render()}right(){if(this.value.filter(e=>e.selected).length>=this.maxChoices)return this.bell();this.value[this.cursor].selected=!0,this.render()}handleSpaceToggle(){let e=this.value[this.cursor];if(e.selected)e.selected=!1,this.render();else{if(e.disabled||this.value.filter(r=>r.selected).length>=this.maxChoices)return this.bell();e.selected=!0,this.render()}}toggleAll(){if(this.maxChoices!==void 0||this.value[this.cursor].disabled)return this.bell();let e=!this.value[this.cursor].selected;this.value.filter(r=>!r.disabled).forEach(r=>r.selected=e),this.render()}_(e,r){if(e===" ")this.handleSpaceToggle();else if(e==="a")this.toggleAll();else return this.bell()}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
131
131
  Instructions:
@@ -135,13 +135,13 @@ Instructions:
135
135
  `:"")+" enter/return: Complete answer":""}renderOption(e,r,n,i){let o=(r.selected?Zr.green(oi.radioOn):oi.radioOff)+" "+i+" ",s,a;return r.disabled?s=e===n?Zr.gray().underline(r.title):Zr.strikethrough().gray(r.title):(s=e===n?Zr.cyan().underline(r.title):r.title,e===n&&r.description&&(a=` - ${r.description}`,(o.length+s.length+a.length>=this.out.columns||r.description.split(/\r?\n/).length>1)&&(a=`
136
136
  `+yZ(r.description,{margin:o.length,width:this.out.columns})))),o+s+Zr.gray(a||"")}paginateOptions(e){if(e.length===0)return Zr.red("No matches for this query.");let{startIndex:r,endIndex:n}=DZ(this.cursor,e.length,this.optionsPerPage),i,o=[];for(let s=r;s<n;s++)s===r&&r>0?i=oi.arrowUp:s===n-1&&n<e.length?i=oi.arrowDown:i=" ",o.push(this.renderOption(this.cursor,e[s],s,i));return`
137
137
  `+o.join(`
138
- `)}renderOptions(e){return this.done?"":this.paginateOptions(e)}renderDoneOrInstructions(){if(this.done)return this.value.filter(r=>r.selected).map(r=>r.title).join(", ");let e=[Zr.gray(this.hint),this.renderInstructions()];return this.value[this.cursor].disabled&&e.push(Zr.yellow(this.warn)),e.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(mZ.hide),super.render();let e=[OP.symbol(this.done,this.aborted),Zr.bold(this.msg),OP.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(e+=Zr.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),e+=this.renderOptions(this.value),this.out.write(this.clear+e),this.clear=FP(e,this.out.columns)}};AP.exports=p0});var $P=y((fde,RP)=>{"use strict";var sl=We(),vZ=Cn(),{erase:bZ,cursor:kP}=Te(),{style:g0,clear:TP,figures:y0,wrap:wZ,entriesToDisplay:_Z}=Ar(),PP=(t,e)=>t[e]&&(t[e].value||t[e].title||t[e]),EZ=(t,e)=>t[e]&&(t[e].title||t[e].value||t[e]),CZ=(t,e)=>{let r=t.findIndex(n=>n.value===e||n.title===e);return r>-1?r:void 0},D0=class extends vZ{constructor(e={}){super(e),this.msg=e.message,this.suggest=e.suggest,this.choices=e.choices,this.initial=typeof e.initial=="number"?e.initial:CZ(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=g0.render(e.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=TP("",this.out.columns),this.complete(this.render),this.render()}set fallback(e){this._fb=Number.isSafeInteger(parseInt(e))?parseInt(e):e}get fallback(){let e;return typeof this._fb=="number"?e=this.choices[this._fb]:typeof this._fb=="string"&&(e={title:this._fb}),e||this._fb||{title:this.i18n.noMatches}}moveSelect(e){this.select=e,this.suggestions.length>0?this.value=PP(this.suggestions,e):this.value=this.fallback.value,this.fire()}async complete(e){let r=this.completing=this.suggest(this.input,this.choices),n=await r;if(this.completing!==r)return;this.suggestions=n.map((o,s,a)=>({title:EZ(a,s),value:PP(a,s),description:o.description})),this.completing=!1;let i=Math.max(n.length-1,0);this.moveSelect(Math.min(i,this.select)),e&&e()}reset(){this.input="",this.complete(()=>{this.moveSelect(this.initial!==void 0?this.initial:0),this.render()}),this.render()}exit(){this.clearFirst&&this.input.length>0?this.reset():(this.done=this.exited=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
138
+ `)}renderOptions(e){return this.done?"":this.paginateOptions(e)}renderDoneOrInstructions(){if(this.done)return this.value.filter(r=>r.selected).map(r=>r.title).join(", ");let e=[Zr.gray(this.hint),this.renderInstructions()];return this.value[this.cursor].disabled&&e.push(Zr.yellow(this.warn)),e.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(mZ.hide),super.render();let e=[OP.symbol(this.done,this.aborted),Zr.bold(this.msg),OP.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(e+=Zr.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),e+=this.renderOptions(this.value),this.out.write(this.clear+e),this.clear=FP(e,this.out.columns)}};AP.exports=p0});var $P=D((fde,RP)=>{"use strict";var sl=We(),vZ=Cn(),{erase:bZ,cursor:kP}=Te(),{style:g0,clear:TP,figures:y0,wrap:wZ,entriesToDisplay:_Z}=Ar(),PP=(t,e)=>t[e]&&(t[e].value||t[e].title||t[e]),EZ=(t,e)=>t[e]&&(t[e].title||t[e].value||t[e]),CZ=(t,e)=>{let r=t.findIndex(n=>n.value===e||n.title===e);return r>-1?r:void 0},D0=class extends vZ{constructor(e={}){super(e),this.msg=e.message,this.suggest=e.suggest,this.choices=e.choices,this.initial=typeof e.initial=="number"?e.initial:CZ(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=g0.render(e.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=TP("",this.out.columns),this.complete(this.render),this.render()}set fallback(e){this._fb=Number.isSafeInteger(parseInt(e))?parseInt(e):e}get fallback(){let e;return typeof this._fb=="number"?e=this.choices[this._fb]:typeof this._fb=="string"&&(e={title:this._fb}),e||this._fb||{title:this.i18n.noMatches}}moveSelect(e){this.select=e,this.suggestions.length>0?this.value=PP(this.suggestions,e):this.value=this.fallback.value,this.fire()}async complete(e){let r=this.completing=this.suggest(this.input,this.choices),n=await r;if(this.completing!==r)return;this.suggestions=n.map((o,s,a)=>({title:EZ(a,s),value:PP(a,s),description:o.description})),this.completing=!1;let i=Math.max(n.length-1,0);this.moveSelect(Math.min(i,this.select)),e&&e()}reset(){this.input="",this.complete(()=>{this.moveSelect(this.initial!==void 0?this.initial:0),this.render()}),this.render()}exit(){this.clearFirst&&this.input.length>0?this.reset():(this.done=this.exited=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
139
139
  `),this.close())}abort(){this.done=this.aborted=!0,this.exited=!1,this.fire(),this.render(),this.out.write(`
140
140
  `),this.close()}submit(){this.done=!0,this.aborted=this.exited=!1,this.fire(),this.render(),this.out.write(`
141
141
  `),this.close()}_(e,r){let n=this.input.slice(0,this.cursor),i=this.input.slice(this.cursor);this.input=`${n}${e}${i}`,this.cursor=n.length+1,this.complete(this.render),this.render()}delete(){if(this.cursor===0)return this.bell();let e=this.input.slice(0,this.cursor-1),r=this.input.slice(this.cursor);this.input=`${e}${r}`,this.complete(this.render),this.cursor=this.cursor-1,this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();let e=this.input.slice(0,this.cursor),r=this.input.slice(this.cursor+1);this.input=`${e}${r}`,this.complete(this.render),this.render()}first(){this.moveSelect(0),this.render()}last(){this.moveSelect(this.suggestions.length-1),this.render()}up(){this.select===0?this.moveSelect(this.suggestions.length-1):this.moveSelect(this.select-1),this.render()}down(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render()}next(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render()}nextPage(){this.moveSelect(Math.min(this.select+this.limit,this.suggestions.length-1)),this.render()}prevPage(){this.moveSelect(Math.max(this.select-this.limit,0)),this.render()}left(){if(this.cursor<=0)return this.bell();this.cursor=this.cursor-1,this.render()}right(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();this.cursor=this.cursor+1,this.render()}renderOption(e,r,n,i){let o,s=n?y0.arrowUp:i?y0.arrowDown:" ",a=r?sl.cyan().underline(e.title):e.title;return s=(r?sl.cyan(y0.pointer)+" ":" ")+s,e.description&&(o=` - ${e.description}`,(s.length+a.length+o.length>=this.out.columns||e.description.split(/\r?\n/).length>1)&&(o=`
142
142
  `+wZ(e.description,{margin:3,width:this.out.columns}))),s+" "+a+sl.gray(o||"")}render(){if(this.closed)return;this.firstRender?this.out.write(kP.hide):this.out.write(TP(this.outputText,this.out.columns)),super.render();let{startIndex:e,endIndex:r}=_Z(this.select,this.choices.length,this.limit);if(this.outputText=[g0.symbol(this.done,this.aborted,this.exited),sl.bold(this.msg),g0.delimiter(this.completing),this.done&&this.suggestions[this.select]?this.suggestions[this.select].title:this.rendered=this.transform.render(this.input)].join(" "),!this.done){let n=this.suggestions.slice(e,r).map((i,o)=>this.renderOption(i,this.select===o+e,o===0&&e>0,o+e===r-1&&r<this.choices.length)).join(`
143
143
  `);this.outputText+=`
144
- `+(n||sl.gray(this.fallback.title))}this.out.write(bZ.line+kP.to(0)+this.outputText)}};RP.exports=D0});var LP=y((dde,NP)=>{"use strict";var xn=We(),{cursor:SZ}=Te(),xZ=m0(),{clear:IP,style:jP,figures:Gs}=Ar(),v0=class extends xZ{constructor(e={}){e.overrideRender=!0,super(e),this.inputValue="",this.clear=IP("",this.out.columns),this.filteredOptions=this.value,this.render()}last(){this.cursor=this.filteredOptions.length-1,this.render()}next(){this.cursor=(this.cursor+1)%this.filteredOptions.length,this.render()}up(){this.cursor===0?this.cursor=this.filteredOptions.length-1:this.cursor--,this.render()}down(){this.cursor===this.filteredOptions.length-1?this.cursor=0:this.cursor++,this.render()}left(){this.filteredOptions[this.cursor].selected=!1,this.render()}right(){if(this.value.filter(e=>e.selected).length>=this.maxChoices)return this.bell();this.filteredOptions[this.cursor].selected=!0,this.render()}delete(){this.inputValue.length&&(this.inputValue=this.inputValue.substr(0,this.inputValue.length-1),this.updateFilteredOptions())}updateFilteredOptions(){let e=this.filteredOptions[this.cursor];this.filteredOptions=this.value.filter(n=>this.inputValue?!!(typeof n.title=="string"&&n.title.toLowerCase().includes(this.inputValue.toLowerCase())||typeof n.value=="string"&&n.value.toLowerCase().includes(this.inputValue.toLowerCase())):!0);let r=this.filteredOptions.findIndex(n=>n===e);this.cursor=r<0?0:r,this.render()}handleSpaceToggle(){let e=this.filteredOptions[this.cursor];if(e.selected)e.selected=!1,this.render();else{if(e.disabled||this.value.filter(r=>r.selected).length>=this.maxChoices)return this.bell();e.selected=!0,this.render()}}handleInputChange(e){this.inputValue=this.inputValue+e,this.updateFilteredOptions()}_(e,r){e===" "?this.handleSpaceToggle():this.handleInputChange(e)}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
144
+ `+(n||sl.gray(this.fallback.title))}this.out.write(bZ.line+kP.to(0)+this.outputText)}};RP.exports=D0});var LP=D((dde,NP)=>{"use strict";var xn=We(),{cursor:SZ}=Te(),xZ=m0(),{clear:IP,style:jP,figures:Gs}=Ar(),v0=class extends xZ{constructor(e={}){e.overrideRender=!0,super(e),this.inputValue="",this.clear=IP("",this.out.columns),this.filteredOptions=this.value,this.render()}last(){this.cursor=this.filteredOptions.length-1,this.render()}next(){this.cursor=(this.cursor+1)%this.filteredOptions.length,this.render()}up(){this.cursor===0?this.cursor=this.filteredOptions.length-1:this.cursor--,this.render()}down(){this.cursor===this.filteredOptions.length-1?this.cursor=0:this.cursor++,this.render()}left(){this.filteredOptions[this.cursor].selected=!1,this.render()}right(){if(this.value.filter(e=>e.selected).length>=this.maxChoices)return this.bell();this.filteredOptions[this.cursor].selected=!0,this.render()}delete(){this.inputValue.length&&(this.inputValue=this.inputValue.substr(0,this.inputValue.length-1),this.updateFilteredOptions())}updateFilteredOptions(){let e=this.filteredOptions[this.cursor];this.filteredOptions=this.value.filter(n=>this.inputValue?!!(typeof n.title=="string"&&n.title.toLowerCase().includes(this.inputValue.toLowerCase())||typeof n.value=="string"&&n.value.toLowerCase().includes(this.inputValue.toLowerCase())):!0);let r=this.filteredOptions.findIndex(n=>n===e);this.cursor=r<0?0:r,this.render()}handleSpaceToggle(){let e=this.filteredOptions[this.cursor];if(e.selected)e.selected=!1,this.render();else{if(e.disabled||this.value.filter(r=>r.selected).length>=this.maxChoices)return this.bell();e.selected=!0,this.render()}}handleInputChange(e){this.inputValue=this.inputValue+e,this.updateFilteredOptions()}_(e,r){e===" "?this.handleSpaceToggle():this.handleInputChange(e)}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
145
145
  Instructions:
146
146
  ${Gs.arrowUp}/${Gs.arrowDown}: Highlight option
147
147
  ${Gs.arrowLeft}/${Gs.arrowRight}/[space]: Toggle selection
@@ -149,14 +149,14 @@ Instructions:
149
149
  enter/return: Complete answer
150
150
  `:""}renderCurrentInput(){return`
151
151
  Filtered results for: ${this.inputValue?this.inputValue:xn.gray("Enter something to filter")}
152
- `}renderOption(e,r,n){let i;return r.disabled?i=e===n?xn.gray().underline(r.title):xn.strikethrough().gray(r.title):i=e===n?xn.cyan().underline(r.title):r.title,(r.selected?xn.green(Gs.radioOn):Gs.radioOff)+" "+i}renderDoneOrInstructions(){if(this.done)return this.value.filter(r=>r.selected).map(r=>r.title).join(", ");let e=[xn.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&e.push(xn.yellow(this.warn)),e.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(SZ.hide),super.render();let e=[jP.symbol(this.done,this.aborted),xn.bold(this.msg),jP.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(e+=xn.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),e+=this.renderOptions(this.filteredOptions),this.out.write(this.clear+e),this.clear=IP(e,this.out.columns)}};NP.exports=v0});var HP=y((hde,UP)=>{var BP=We(),FZ=Cn(),{style:qP,clear:OZ}=Ar(),{erase:AZ,cursor:MP}=Te(),b0=class extends FZ{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(`
152
+ `}renderOption(e,r,n){let i;return r.disabled?i=e===n?xn.gray().underline(r.title):xn.strikethrough().gray(r.title):i=e===n?xn.cyan().underline(r.title):r.title,(r.selected?xn.green(Gs.radioOn):Gs.radioOff)+" "+i}renderDoneOrInstructions(){if(this.done)return this.value.filter(r=>r.selected).map(r=>r.title).join(", ");let e=[xn.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&e.push(xn.yellow(this.warn)),e.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(SZ.hide),super.render();let e=[jP.symbol(this.done,this.aborted),xn.bold(this.msg),jP.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(e+=xn.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),e+=this.renderOptions(this.filteredOptions),this.out.write(this.clear+e),this.clear=IP(e,this.out.columns)}};NP.exports=v0});var HP=D((hde,UP)=>{var BP=We(),FZ=Cn(),{style:qP,clear:OZ}=Ar(),{erase:AZ,cursor:MP}=Te(),b0=class extends FZ{constructor(e={}){super(e),this.msg=e.message,this.value=e.initial,this.initialValue=!!e.initial,this.yesMsg=e.yes||"yes",this.yesOption=e.yesOption||"(Y/n)",this.noMsg=e.no||"no",this.noOption=e.noOption||"(y/N)",this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
153
153
  `),this.close()}submit(){this.value=this.value||!1,this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
154
- `),this.close()}_(e,r){return e.toLowerCase()==="y"?(this.value=!0,this.submit()):e.toLowerCase()==="n"?(this.value=!1,this.submit()):this.bell()}render(){this.closed||(this.firstRender?this.out.write(MP.hide):this.out.write(OZ(this.outputText,this.out.columns)),super.render(),this.outputText=[qP.symbol(this.done,this.aborted),BP.bold(this.msg),qP.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:BP.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(AZ.line+MP.to(0)+this.outputText))}};UP.exports=b0});var zP=y((pde,VP)=>{"use strict";VP.exports={TextPrompt:UT(),SelectPrompt:GT(),TogglePrompt:JT(),DatePrompt:_P(),NumberPrompt:xP(),MultiselectPrompt:m0(),AutocompletePrompt:$P(),AutocompleteMultiselectPrompt:LP(),ConfirmPrompt:HP()}});var WP=y(GP=>{"use strict";var Gt=GP,kZ=zP(),$d=t=>t;function Qr(t,e,r={}){return new Promise((n,i)=>{let o=new kZ[t](e),s=r.onAbort||$d,a=r.onSubmit||$d,u=r.onExit||$d;o.on("state",e.onState||$d),o.on("submit",l=>n(a(l))),o.on("exit",l=>n(u(l))),o.on("abort",l=>i(s(l)))})}Gt.text=t=>Qr("TextPrompt",t);Gt.password=t=>(t.style="password",Gt.text(t));Gt.invisible=t=>(t.style="invisible",Gt.text(t));Gt.number=t=>Qr("NumberPrompt",t);Gt.date=t=>Qr("DatePrompt",t);Gt.confirm=t=>Qr("ConfirmPrompt",t);Gt.list=t=>{let e=t.separator||",";return Qr("TextPrompt",t,{onSubmit:r=>r.split(e).map(n=>n.trim())})};Gt.toggle=t=>Qr("TogglePrompt",t);Gt.select=t=>Qr("SelectPrompt",t);Gt.multiselect=t=>{t.choices=[].concat(t.choices||[]);let e=r=>r.filter(n=>n.selected).map(n=>n.value);return Qr("MultiselectPrompt",t,{onAbort:e,onSubmit:e})};Gt.autocompleteMultiselect=t=>{t.choices=[].concat(t.choices||[]);let e=r=>r.filter(n=>n.selected).map(n=>n.value);return Qr("AutocompleteMultiselectPrompt",t,{onAbort:e,onSubmit:e})};var TZ=(t,e)=>Promise.resolve(e.filter(r=>r.title.slice(0,t.length).toLowerCase()===t.toLowerCase()));Gt.autocomplete=t=>(t.suggest=t.suggest||TZ,t.choices=[].concat(t.choices||[]),Qr("AutocompletePrompt",t))});var JP=y((gde,YP)=>{"use strict";var w0=WP(),PZ=["suggest","format","onState","validate","onRender","type"],KP=()=>{};async function si(t=[],{onSubmit:e=KP,onCancel:r=KP}={}){let n={},i=si._override||{};t=[].concat(t);let o,s,a,u,l,c,f=async(h,d,m=!1)=>{if(!(!m&&h.validate&&h.validate(d)!==!0))return h.format?await h.format(d,n):d};for(s of t)if({name:u,type:l}=s,typeof l=="function"&&(l=await l(o,{...n},s),s.type=l),!!l){for(let h in s){if(PZ.includes(h))continue;let d=s[h];s[h]=typeof d=="function"?await d(o,{...n},c):d}if(c=s,typeof s.message!="string")throw new Error("prompt message is required");if({name:u,type:l}=s,w0[l]===void 0)throw new Error(`prompt type (${l}) is not defined`);if(i[s.name]!==void 0&&(o=await f(s,i[s.name]),o!==void 0)){n[u]=o;continue}try{o=si._injected?RZ(si._injected,s.initial):await w0[l](s),n[u]=o=await f(s,o,!0),a=await e(s,o,n)}catch{a=!await r(s,n)}if(a)return n}return n}function RZ(t,e){let r=t.shift();if(r instanceof Error)throw r;return r===void 0?e:r}function $Z(t){si._injected=(si._injected||[]).concat(t)}function IZ(t){si._override=Object.assign({},t)}YP.exports=Object.assign(si,{prompt:si,prompts:w0,inject:$Z,override:IZ})});var Id=y((yde,XP)=>{function jZ(t){t=(Array.isArray(t)?t:t.split(".")).map(Number);let e=0,r=process.versions.node.split(".").map(Number);for(;e<t.length;e++){if(r[e]>t[e])return!1;if(t[e]>r[e])return!0}return!1}XP.exports=jZ("8.6.0")?_T():JP()});var Yu=y(Wt=>{"use strict";Object.defineProperty(Wt,"__esModule",{value:!0});Wt.logSuccess=Wt.logPrompt=Wt.logger=Wt.output=void 0;var _0=(nr(),je(rr)),so=(dD(),je(fD)),ao=_0.__importDefault(Ns()),NZ=EA(),ZP={colors:ao.default,stream:process.argv.includes("--json")?process.stderr:process.stdout};Wt.output=(0,NZ.isInteractive)()?new so.TTYOutputStrategy(ZP):new so.StreamOutputStrategy(ZP);Wt.logger=(0,so.createDefaultLogger)({output:Wt.output,formatterOptions:{titleize:!1,tags:new Map([[so.LOGGER_LEVELS.DEBUG,ao.default.log.DEBUG("[debug]")],[so.LOGGER_LEVELS.INFO,ao.default.log.INFO("[info]")],[so.LOGGER_LEVELS.WARN,ao.default.log.WARN("[warn]")],[so.LOGGER_LEVELS.ERROR,ao.default.log.ERROR("[error]")]])}});async function LZ(t,e){let{wordWrap:r}=await Promise.resolve().then(()=>_0.__importStar((dD(),je(fD)))),{prompt:n}=await Promise.resolve().then(()=>_0.__importStar(Id()));return Wt.logger.log({msg:`${ao.default.input("[?]")} ${r(t,{indentation:4})}`,logger:Wt.logger,format:!1}),n(e,{onCancel:()=>process.exit(1)})}Wt.logPrompt=LZ;function BZ(t){Wt.logger.msg(`${ao.default.success("[success]")} ${t}`)}Wt.logSuccess=BZ});var jd=y(Ws=>{"use strict";Object.defineProperty(Ws,"__esModule",{value:!0});Ws.resolveNode=Ws.requireTS=void 0;var qZ=require("fs"),MZ=js(),UZ=require("path"),HZ=(t,e)=>{let r=(0,UZ.resolve)(e);delete require.cache[r],require.extensions[".ts"]=(i,o)=>{var s;let a=(0,MZ.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};Ws.requireTS=HZ;function VZ(t,...e){try{return require.resolve(e.join("/"),{paths:[t]})}catch{let n=[t,"node_modules",...e].join("/");return(0,qZ.existsSync)(n)?n:null}}Ws.resolveNode=VZ});var QP={};gi(QP,{default:()=>zZ});var zZ,e3=Ct(()=>{zZ={}});var t3=y(en=>{"use strict";Object.defineProperty(en,"__esModule",{value:!0});en.buildXmlElement=en.writeXML=en.parseXML=en.readXML=void 0;var GZ=(nr(),je(rr)),WZ=js(),al=GZ.__importDefault((e3(),je(QP)));async function KZ(t){var e;try{let r=await(0,WZ.readFile)(t,{encoding:"utf-8"});try{return await al.default.parseStringPromise(r)}catch(n){throw`Error parsing: ${t}, ${(e=n.stack)!==null&&e!==void 0?e:n}`}}catch{throw`Unable to read: ${t}`}}en.readXML=KZ;function YZ(t,e){let r=e!==void 0?new al.default.Parser({...e}):new al.default.Parser,n;return r.parseString(t,(i,o)=>{i||(n=o)}),n}en.parseXML=YZ;async function JZ(t){return new Promise(e=>{let n=new al.default.Builder({headless:!0,explicitRoot:!1,rootName:"deleteme"}).buildObject(t);n=n.replace("<deleteme>","").replace("</deleteme>",""),e(n)})}en.writeXML=JZ;function XZ(t,e){return new al.default.Builder({headless:!0,explicitRoot:!1,rootName:e}).buildObject(t)}en.buildXmlElement=XZ});var s3=y(Ee=>{"use strict";Object.defineProperty(Ee,"__esModule",{value:!0});Ee.getAllElements=Ee.getFilePath=Ee.getAssets=Ee.getJSModules=Ee.getPluginType=Ee.getPlatformElement=Ee.getPluginPlatform=Ee.printPlugins=Ee.fixName=Ee.getDependencies=Ee.resolvePlugin=Ee.getPlugins=Ee.getIncludedPluginPackages=void 0;var ZZ=(nr(),je(rr)),QZ=js(),E0=require("path"),Ks=ZZ.__importDefault(Ns()),eQ=yd(),tQ=Yu(),r3=jd(),rQ=t3();function n3(t,e){var r,n,i,o;let{extConfig:s}=t.app;switch(e){case"android":return(n=(r=s.android)===null||r===void 0?void 0:r.includePlugins)!==null&&n!==void 0?n:s.includePlugins;case"ios":return(o=(i=s.ios)===null||i===void 0?void 0:i.includePlugins)!==null&&o!==void 0?o:s.includePlugins}}Ee.getIncludedPluginPackages=n3;async function nQ(t,e){var r;let n=(r=n3(t,e))!==null&&r!==void 0?r:o3(t);return(await Promise.all(n.map(async o=>i3(t,o)))).filter(o=>!!o)}Ee.getPlugins=nQ;async function i3(t,e){try{let r=(0,r3.resolveNode)(t.app.rootDir,e,"package.json");r||(0,eQ.fatal)(`Unable to find ${Ks.default.strong(`node_modules/${e}`)}.
154
+ `),this.close()}_(e,r){return e.toLowerCase()==="y"?(this.value=!0,this.submit()):e.toLowerCase()==="n"?(this.value=!1,this.submit()):this.bell()}render(){this.closed||(this.firstRender?this.out.write(MP.hide):this.out.write(OZ(this.outputText,this.out.columns)),super.render(),this.outputText=[qP.symbol(this.done,this.aborted),BP.bold(this.msg),qP.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:BP.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(AZ.line+MP.to(0)+this.outputText))}};UP.exports=b0});var zP=D((pde,VP)=>{"use strict";VP.exports={TextPrompt:UT(),SelectPrompt:GT(),TogglePrompt:JT(),DatePrompt:_P(),NumberPrompt:xP(),MultiselectPrompt:m0(),AutocompletePrompt:$P(),AutocompleteMultiselectPrompt:LP(),ConfirmPrompt:HP()}});var WP=D(GP=>{"use strict";var Gt=GP,kZ=zP(),$d=t=>t;function Qr(t,e,r={}){return new Promise((n,i)=>{let o=new kZ[t](e),s=r.onAbort||$d,a=r.onSubmit||$d,u=r.onExit||$d;o.on("state",e.onState||$d),o.on("submit",l=>n(a(l))),o.on("exit",l=>n(u(l))),o.on("abort",l=>i(s(l)))})}Gt.text=t=>Qr("TextPrompt",t);Gt.password=t=>(t.style="password",Gt.text(t));Gt.invisible=t=>(t.style="invisible",Gt.text(t));Gt.number=t=>Qr("NumberPrompt",t);Gt.date=t=>Qr("DatePrompt",t);Gt.confirm=t=>Qr("ConfirmPrompt",t);Gt.list=t=>{let e=t.separator||",";return Qr("TextPrompt",t,{onSubmit:r=>r.split(e).map(n=>n.trim())})};Gt.toggle=t=>Qr("TogglePrompt",t);Gt.select=t=>Qr("SelectPrompt",t);Gt.multiselect=t=>{t.choices=[].concat(t.choices||[]);let e=r=>r.filter(n=>n.selected).map(n=>n.value);return Qr("MultiselectPrompt",t,{onAbort:e,onSubmit:e})};Gt.autocompleteMultiselect=t=>{t.choices=[].concat(t.choices||[]);let e=r=>r.filter(n=>n.selected).map(n=>n.value);return Qr("AutocompleteMultiselectPrompt",t,{onAbort:e,onSubmit:e})};var TZ=(t,e)=>Promise.resolve(e.filter(r=>r.title.slice(0,t.length).toLowerCase()===t.toLowerCase()));Gt.autocomplete=t=>(t.suggest=t.suggest||TZ,t.choices=[].concat(t.choices||[]),Qr("AutocompletePrompt",t))});var JP=D((gde,YP)=>{"use strict";var w0=WP(),PZ=["suggest","format","onState","validate","onRender","type"],KP=()=>{};async function si(t=[],{onSubmit:e=KP,onCancel:r=KP}={}){let n={},i=si._override||{};t=[].concat(t);let o,s,a,u,l,c,f=async(h,d,m=!1)=>{if(!(!m&&h.validate&&h.validate(d)!==!0))return h.format?await h.format(d,n):d};for(s of t)if({name:u,type:l}=s,typeof l=="function"&&(l=await l(o,{...n},s),s.type=l),!!l){for(let h in s){if(PZ.includes(h))continue;let d=s[h];s[h]=typeof d=="function"?await d(o,{...n},c):d}if(c=s,typeof s.message!="string")throw new Error("prompt message is required");if({name:u,type:l}=s,w0[l]===void 0)throw new Error(`prompt type (${l}) is not defined`);if(i[s.name]!==void 0&&(o=await f(s,i[s.name]),o!==void 0)){n[u]=o;continue}try{o=si._injected?RZ(si._injected,s.initial):await w0[l](s),n[u]=o=await f(s,o,!0),a=await e(s,o,n)}catch{a=!await r(s,n)}if(a)return n}return n}function RZ(t,e){let r=t.shift();if(r instanceof Error)throw r;return r===void 0?e:r}function $Z(t){si._injected=(si._injected||[]).concat(t)}function IZ(t){si._override=Object.assign({},t)}YP.exports=Object.assign(si,{prompt:si,prompts:w0,inject:$Z,override:IZ})});var Id=D((yde,XP)=>{function jZ(t){t=(Array.isArray(t)?t:t.split(".")).map(Number);let e=0,r=process.versions.node.split(".").map(Number);for(;e<t.length;e++){if(r[e]>t[e])return!1;if(t[e]>r[e])return!0}return!1}XP.exports=jZ("8.6.0")?_T():JP()});var Yu=D(Wt=>{"use strict";Object.defineProperty(Wt,"__esModule",{value:!0});Wt.logSuccess=Wt.logPrompt=Wt.logger=Wt.output=void 0;var _0=(nr(),je(rr)),so=(dD(),je(fD)),ao=_0.__importDefault(Ns()),NZ=EA(),ZP={colors:ao.default,stream:process.argv.includes("--json")?process.stderr:process.stdout};Wt.output=(0,NZ.isInteractive)()?new so.TTYOutputStrategy(ZP):new so.StreamOutputStrategy(ZP);Wt.logger=(0,so.createDefaultLogger)({output:Wt.output,formatterOptions:{titleize:!1,tags:new Map([[so.LOGGER_LEVELS.DEBUG,ao.default.log.DEBUG("[debug]")],[so.LOGGER_LEVELS.INFO,ao.default.log.INFO("[info]")],[so.LOGGER_LEVELS.WARN,ao.default.log.WARN("[warn]")],[so.LOGGER_LEVELS.ERROR,ao.default.log.ERROR("[error]")]])}});async function LZ(t,e){let{wordWrap:r}=await Promise.resolve().then(()=>_0.__importStar((dD(),je(fD)))),{prompt:n}=await Promise.resolve().then(()=>_0.__importStar(Id()));return Wt.logger.log({msg:`${ao.default.input("[?]")} ${r(t,{indentation:4})}`,logger:Wt.logger,format:!1}),n(e,{onCancel:()=>process.exit(1)})}Wt.logPrompt=LZ;function BZ(t){Wt.logger.msg(`${ao.default.success("[success]")} ${t}`)}Wt.logSuccess=BZ});var jd=D(Ws=>{"use strict";Object.defineProperty(Ws,"__esModule",{value:!0});Ws.resolveNode=Ws.requireTS=void 0;var qZ=require("fs"),MZ=js(),UZ=require("path"),HZ=(t,e)=>{let r=(0,UZ.resolve)(e);delete require.cache[r],require.extensions[".ts"]=(i,o)=>{var s;let a=(0,MZ.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};Ws.requireTS=HZ;function VZ(t,...e){try{return require.resolve(e.join("/"),{paths:[t]})}catch{let n=[t,"node_modules",...e].join("/");return(0,qZ.existsSync)(n)?n:null}}Ws.resolveNode=VZ});var QP={};gi(QP,{default:()=>zZ});var zZ,e3=Ct(()=>{zZ={}});var t3=D(en=>{"use strict";Object.defineProperty(en,"__esModule",{value:!0});en.buildXmlElement=en.writeXML=en.parseXML=en.readXML=void 0;var GZ=(nr(),je(rr)),WZ=js(),al=GZ.__importDefault((e3(),je(QP)));async function KZ(t){var e;try{let r=await(0,WZ.readFile)(t,{encoding:"utf-8"});try{return await al.default.parseStringPromise(r)}catch(n){throw`Error parsing: ${t}, ${(e=n.stack)!==null&&e!==void 0?e:n}`}}catch{throw`Unable to read: ${t}`}}en.readXML=KZ;function YZ(t,e){let r=e!==void 0?new al.default.Parser({...e}):new al.default.Parser,n;return r.parseString(t,(i,o)=>{i||(n=o)}),n}en.parseXML=YZ;async function JZ(t){return new Promise(e=>{let n=new al.default.Builder({headless:!0,explicitRoot:!1,rootName:"deleteme"}).buildObject(t);n=n.replace("<deleteme>","").replace("</deleteme>",""),e(n)})}en.writeXML=JZ;function XZ(t,e){return new al.default.Builder({headless:!0,explicitRoot:!1,rootName:e}).buildObject(t)}en.buildXmlElement=XZ});var s3=D(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 ZZ=(nr(),je(rr)),QZ=js(),E0=require("path"),Ks=ZZ.__importDefault(Ns()),eQ=yd(),tQ=Yu(),r3=jd(),rQ=t3();function n3(t,e){var r,n,i,o;let{extConfig:s}=t.app;switch(e){case"android":return(n=(r=s.android)===null||r===void 0?void 0:r.includePlugins)!==null&&n!==void 0?n:s.includePlugins;case"ios":return(o=(i=s.ios)===null||i===void 0?void 0:i.includePlugins)!==null&&o!==void 0?o:s.includePlugins}}Ee.getIncludedPluginPackages=n3;async function nQ(t,e){var r;let n=(r=n3(t,e))!==null&&r!==void 0?r:o3(t);return(await Promise.all(n.map(async o=>i3(t,o)))).filter(o=>!!o)}Ee.getPlugins=nQ;async function i3(t,e){try{let r=(0,r3.resolveNode)(t.app.rootDir,e,"package.json");r||(0,eQ.fatal)(`Unable to find ${Ks.default.strong(`node_modules/${e}`)}.
155
155
  Are you sure ${Ks.default.strong(e)} is installed?`);let n=(0,E0.dirname)(r),i=await(0,QZ.readJSON)(r);if(!i)return null;if(i.capacitor)return{id:e,name:C0(e),version:i.version,rootPath:n,repository:i.repository,manifest:i.capacitor};let o=(0,E0.join)(n,"plugin.xml"),s=await(0,rQ.readXML)(o);return{id:e,name:C0(e),version:i.version,rootPath:n,repository:i.repository,xml:s.plugin}}catch{}return null}Ee.resolvePlugin=i3;function o3(t){var e,r;return[...Object.keys((e=t.app.package.dependencies)!==null&&e!==void 0?e:{}),...Object.keys((r=t.app.package.devDependencies)!==null&&r!==void 0?r:{})]}Ee.getDependencies=o3;function C0(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=C0;function iQ(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 ${Ks.default.strong(e)}:
156
156
  `;break;case"incompatible":n=`Found ${t.length} incompatible Cordova plugin${i} for ${Ks.default.strong(e)}, skipped install:
157
157
  `;break;case"capacitor":n=`Found ${t.length} Capacitor plugin${i} for ${Ks.default.strong(e)}:
158
158
  `;break}n+=t.map(o=>`${o.id}${Ks.default.weak(`@${o.version}`)}`).join(`
159
- `),tQ.logger.info(n)}Ee.printPlugins=iQ;function S0(t,e){return t.xml.platform?t.xml.platform.filter(function(i){return i.$.name===e})[0]:[]}Ee.getPluginPlatform=S0;function oQ(t,e,r){let n=S0(t,e);if(n){let i=n[r];if(i)return i}return[]}Ee.getPlatformElement=oQ;function sQ(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=sQ;function aQ(t,e){return x0(t,e,"js-module")}Ee.getJSModules=aQ;function uQ(t,e){return x0(t,e,"asset")}Ee.getAssets=uQ;function lQ(t,e,r){if(r.startsWith("node_modules")){let n=r.split("/").slice(1);n[0].startsWith("@")&&(n=[n[0]+"/"+n[1],...n.slice(2)]);let i=(0,r3.resolveNode)(t.app.rootDir,...n);if(!i)throw new Error(`Can't resolve module ${n[0]}`);return i}return(0,E0.join)(e.rootPath,r)}Ee.getFilePath=lQ;function x0(t,e,r){let n=[];t.xml[r]&&(n=n.concat(t.xml[r]));let i=S0(t,e);return i?.[r]&&(n=n.concat(i[r])),n}Ee.getAllElements=x0});var a3={};gi(a3,{default:()=>cQ});var cQ,u3=Ct(()=>{cQ={}});var Nd=y(ai=>{"use strict";Object.defineProperty(ai,"__esModule",{value:!0});ai.isInstalled=ai.getCommandOutput=ai.runCommand=void 0;var F0=(u3(),je(a3));async function l3(t,e,r={}){let n=new F0.Subprocess(t,e,r);try{return await n.output()}catch(i){throw i instanceof F0.SubprocessError?i.output?i.output:i.cause?`${i.message} ${i.cause.toString()}`:i.code?i.code:"Unknown error":i}}ai.runCommand=l3;async function fQ(t,e,r={}){try{return(await l3(t,e,r)).trim()}catch{return null}}ai.getCommandOutput=fQ;async function dQ(t){try{await(0,F0.which)(t)}catch{return!1}return!0}ai.isInstalled=dQ});var ul=y((Ede,c3)=>{var hQ="2.0.0",pQ=Number.MAX_SAFE_INTEGER||9007199254740991,mQ=16,gQ=250,yQ=["major","premajor","minor","preminor","patch","prepatch","prerelease"];c3.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:mQ,MAX_SAFE_BUILD_LENGTH:gQ,MAX_SAFE_INTEGER:pQ,RELEASE_TYPES:yQ,SEMVER_SPEC_VERSION:hQ,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var ll=y((Cde,f3)=>{var DQ=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{};f3.exports=DQ});var Ys=y((tn,d3)=>{var{MAX_SAFE_COMPONENT_LENGTH:O0,MAX_SAFE_BUILD_LENGTH:vQ,MAX_LENGTH:bQ}=ul(),wQ=ll();tn=d3.exports={};var _Q=tn.re=[],EQ=tn.safeRe=[],z=tn.src=[],CQ=tn.safeSrc=[],G=tn.t={},SQ=0,A0="[a-zA-Z0-9-]",xQ=[["\\s",1],["\\d",bQ],[A0,vQ]],FQ=t=>{for(let[e,r]of xQ)t=t.split(`${e}*`).join(`${e}{0,${r}}`).split(`${e}+`).join(`${e}{1,${r}}`);return t},re=(t,e,r)=>{let n=FQ(e),i=SQ++;wQ(t,i,e),G[t]=i,z[i]=e,CQ[i]=n,_Q[i]=new RegExp(e,r?"g":void 0),EQ[i]=new RegExp(n,r?"g":void 0)};re("NUMERICIDENTIFIER","0|[1-9]\\d*");re("NUMERICIDENTIFIERLOOSE","\\d+");re("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${A0}*`);re("MAINVERSION",`(${z[G.NUMERICIDENTIFIER]})\\.(${z[G.NUMERICIDENTIFIER]})\\.(${z[G.NUMERICIDENTIFIER]})`);re("MAINVERSIONLOOSE",`(${z[G.NUMERICIDENTIFIERLOOSE]})\\.(${z[G.NUMERICIDENTIFIERLOOSE]})\\.(${z[G.NUMERICIDENTIFIERLOOSE]})`);re("PRERELEASEIDENTIFIER",`(?:${z[G.NUMERICIDENTIFIER]}|${z[G.NONNUMERICIDENTIFIER]})`);re("PRERELEASEIDENTIFIERLOOSE",`(?:${z[G.NUMERICIDENTIFIERLOOSE]}|${z[G.NONNUMERICIDENTIFIER]})`);re("PRERELEASE",`(?:-(${z[G.PRERELEASEIDENTIFIER]}(?:\\.${z[G.PRERELEASEIDENTIFIER]})*))`);re("PRERELEASELOOSE",`(?:-?(${z[G.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${z[G.PRERELEASEIDENTIFIERLOOSE]})*))`);re("BUILDIDENTIFIER",`${A0}+`);re("BUILD",`(?:\\+(${z[G.BUILDIDENTIFIER]}(?:\\.${z[G.BUILDIDENTIFIER]})*))`);re("FULLPLAIN",`v?${z[G.MAINVERSION]}${z[G.PRERELEASE]}?${z[G.BUILD]}?`);re("FULL",`^${z[G.FULLPLAIN]}$`);re("LOOSEPLAIN",`[v=\\s]*${z[G.MAINVERSIONLOOSE]}${z[G.PRERELEASELOOSE]}?${z[G.BUILD]}?`);re("LOOSE",`^${z[G.LOOSEPLAIN]}$`);re("GTLT","((?:<|>)?=?)");re("XRANGEIDENTIFIERLOOSE",`${z[G.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);re("XRANGEIDENTIFIER",`${z[G.NUMERICIDENTIFIER]}|x|X|\\*`);re("XRANGEPLAIN",`[v=\\s]*(${z[G.XRANGEIDENTIFIER]})(?:\\.(${z[G.XRANGEIDENTIFIER]})(?:\\.(${z[G.XRANGEIDENTIFIER]})(?:${z[G.PRERELEASE]})?${z[G.BUILD]}?)?)?`);re("XRANGEPLAINLOOSE",`[v=\\s]*(${z[G.XRANGEIDENTIFIERLOOSE]})(?:\\.(${z[G.XRANGEIDENTIFIERLOOSE]})(?:\\.(${z[G.XRANGEIDENTIFIERLOOSE]})(?:${z[G.PRERELEASELOOSE]})?${z[G.BUILD]}?)?)?`);re("XRANGE",`^${z[G.GTLT]}\\s*${z[G.XRANGEPLAIN]}$`);re("XRANGELOOSE",`^${z[G.GTLT]}\\s*${z[G.XRANGEPLAINLOOSE]}$`);re("COERCEPLAIN",`(^|[^\\d])(\\d{1,${O0}})(?:\\.(\\d{1,${O0}}))?(?:\\.(\\d{1,${O0}}))?`);re("COERCE",`${z[G.COERCEPLAIN]}(?:$|[^\\d])`);re("COERCEFULL",z[G.COERCEPLAIN]+`(?:${z[G.PRERELEASE]})?(?:${z[G.BUILD]})?(?:$|[^\\d])`);re("COERCERTL",z[G.COERCE],!0);re("COERCERTLFULL",z[G.COERCEFULL],!0);re("LONETILDE","(?:~>?)");re("TILDETRIM",`(\\s*)${z[G.LONETILDE]}\\s+`,!0);tn.tildeTrimReplace="$1~";re("TILDE",`^${z[G.LONETILDE]}${z[G.XRANGEPLAIN]}$`);re("TILDELOOSE",`^${z[G.LONETILDE]}${z[G.XRANGEPLAINLOOSE]}$`);re("LONECARET","(?:\\^)");re("CARETTRIM",`(\\s*)${z[G.LONECARET]}\\s+`,!0);tn.caretTrimReplace="$1^";re("CARET",`^${z[G.LONECARET]}${z[G.XRANGEPLAIN]}$`);re("CARETLOOSE",`^${z[G.LONECARET]}${z[G.XRANGEPLAINLOOSE]}$`);re("COMPARATORLOOSE",`^${z[G.GTLT]}\\s*(${z[G.LOOSEPLAIN]})$|^$`);re("COMPARATOR",`^${z[G.GTLT]}\\s*(${z[G.FULLPLAIN]})$|^$`);re("COMPARATORTRIM",`(\\s*)${z[G.GTLT]}\\s*(${z[G.LOOSEPLAIN]}|${z[G.XRANGEPLAIN]})`,!0);tn.comparatorTrimReplace="$1$2$3";re("HYPHENRANGE",`^\\s*(${z[G.XRANGEPLAIN]})\\s+-\\s+(${z[G.XRANGEPLAIN]})\\s*$`);re("HYPHENRANGELOOSE",`^\\s*(${z[G.XRANGEPLAINLOOSE]})\\s+-\\s+(${z[G.XRANGEPLAINLOOSE]})\\s*$`);re("STAR","(<|>)?=?\\s*\\*");re("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");re("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var Ld=y((Sde,h3)=>{var OQ=Object.freeze({loose:!0}),AQ=Object.freeze({}),kQ=t=>t?typeof t!="object"?OQ:t:AQ;h3.exports=kQ});var k0=y((xde,g3)=>{var p3=/^[0-9]+$/,m3=(t,e)=>{let r=p3.test(t),n=p3.test(e);return r&&n&&(t=+t,e=+e),t===e?0:r&&!n?-1:n&&!r?1:t<e?-1:1},TQ=(t,e)=>m3(e,t);g3.exports={compareIdentifiers:m3,rcompareIdentifiers:TQ}});var Ft=y((Fde,b3)=>{var Bd=ll(),{MAX_LENGTH:y3,MAX_SAFE_INTEGER:qd}=ul(),{safeRe:D3,safeSrc:v3,t:Md}=Ys(),PQ=Ld(),{compareIdentifiers:Js}=k0(),T0=class t{constructor(e,r){if(r=PQ(r),e instanceof t){if(e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease)return e;e=e.version}else if(typeof e!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>y3)throw new TypeError(`version is longer than ${y3} characters`);Bd("SemVer",e,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;let n=e.trim().match(r.loose?D3[Md.LOOSE]:D3[Md.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>qd||this.major<0)throw new TypeError("Invalid major version");if(this.minor>qd||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>qd||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<qd)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(Bd("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)),Js(this.major,e.major)||Js(this.minor,e.minor)||Js(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(Bd("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 Js(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(Bd("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 Js(n,i)}while(++r)}inc(e,r,n){if(e.startsWith("pre")){if(!r&&n===!1)throw new Error("invalid increment argument: identifier is empty");if(r){let i=new RegExp(`^${this.options.loose?v3[Md.PRERELEASELOOSE]:v3[Md.PRERELEASE]}$`),o=`-${r}`.match(i);if(!o||o[1]!==r)throw new Error(`invalid identifier: ${r}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",r,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",r,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",r,n),this.inc("pre",r,n);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",r,n),this.inc("pre",r,n);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{let i=Number(n)?1:0;if(this.prerelease.length===0)this.prerelease=[i];else{let o=this.prerelease.length;for(;--o>=0;)typeof this.prerelease[o]=="number"&&(this.prerelease[o]++,o=-2);if(o===-1){if(r===this.prerelease.join(".")&&n===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(i)}}if(r){let o=[r,i];n===!1&&(o=[r]),Js(this.prerelease[0],r)===0?isNaN(this.prerelease[1])&&(this.prerelease=o):this.prerelease=o}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};b3.exports=T0});var uo=y((Ode,_3)=>{var w3=Ft(),RQ=(t,e,r=!1)=>{if(t instanceof w3)return t;try{return new w3(t,e)}catch(n){if(!r)return null;throw n}};_3.exports=RQ});var C3=y((Ade,E3)=>{var $Q=uo(),IQ=(t,e)=>{let r=$Q(t,e);return r?r.version:null};E3.exports=IQ});var x3=y((kde,S3)=>{var jQ=uo(),NQ=(t,e)=>{let r=jQ(t.trim().replace(/^[=v]+/,""),e);return r?r.version:null};S3.exports=NQ});var A3=y((Tde,O3)=>{var F3=Ft(),LQ=(t,e,r,n,i)=>{typeof r=="string"&&(i=n,n=r,r=void 0);try{return new F3(t instanceof F3?t.version:t,r).inc(e,n,i).version}catch{return null}};O3.exports=LQ});var P3=y((Pde,T3)=>{var k3=uo(),BQ=(t,e)=>{let r=k3(t,null,!0),n=k3(e,null,!0),i=r.compare(n);if(i===0)return null;let o=i>0,s=o?r:n,a=o?n:r,u=!!s.prerelease.length;if(!!a.prerelease.length&&!u){if(!a.patch&&!a.minor)return"major";if(a.compareMain(s)===0)return a.minor&&!a.patch?"minor":"patch"}let c=u?"pre":"";return r.major!==n.major?c+"major":r.minor!==n.minor?c+"minor":r.patch!==n.patch?c+"patch":"prerelease"};T3.exports=BQ});var $3=y((Rde,R3)=>{var qQ=Ft(),MQ=(t,e)=>new qQ(t,e).major;R3.exports=MQ});var j3=y(($de,I3)=>{var UQ=Ft(),HQ=(t,e)=>new UQ(t,e).minor;I3.exports=HQ});var L3=y((Ide,N3)=>{var VQ=Ft(),zQ=(t,e)=>new VQ(t,e).patch;N3.exports=zQ});var q3=y((jde,B3)=>{var GQ=uo(),WQ=(t,e)=>{let r=GQ(t,e);return r&&r.prerelease.length?r.prerelease:null};B3.exports=WQ});var yr=y((Nde,U3)=>{var M3=Ft(),KQ=(t,e,r)=>new M3(t,r).compare(new M3(e,r));U3.exports=KQ});var V3=y((Lde,H3)=>{var YQ=yr(),JQ=(t,e,r)=>YQ(e,t,r);H3.exports=JQ});var G3=y((Bde,z3)=>{var XQ=yr(),ZQ=(t,e)=>XQ(t,e,!0);z3.exports=ZQ});var Ud=y((qde,K3)=>{var W3=Ft(),QQ=(t,e,r)=>{let n=new W3(t,r),i=new W3(e,r);return n.compare(i)||n.compareBuild(i)};K3.exports=QQ});var J3=y((Mde,Y3)=>{var eee=Ud(),tee=(t,e)=>t.sort((r,n)=>eee(r,n,e));Y3.exports=tee});var Z3=y((Ude,X3)=>{var ree=Ud(),nee=(t,e)=>t.sort((r,n)=>ree(n,r,e));X3.exports=nee});var cl=y((Hde,Q3)=>{var iee=yr(),oee=(t,e,r)=>iee(t,e,r)>0;Q3.exports=oee});var Hd=y((Vde,eR)=>{var see=yr(),aee=(t,e,r)=>see(t,e,r)<0;eR.exports=aee});var P0=y((zde,tR)=>{var uee=yr(),lee=(t,e,r)=>uee(t,e,r)===0;tR.exports=lee});var R0=y((Gde,rR)=>{var cee=yr(),fee=(t,e,r)=>cee(t,e,r)!==0;rR.exports=fee});var Vd=y((Wde,nR)=>{var dee=yr(),hee=(t,e,r)=>dee(t,e,r)>=0;nR.exports=hee});var zd=y((Kde,iR)=>{var pee=yr(),mee=(t,e,r)=>pee(t,e,r)<=0;iR.exports=mee});var $0=y((Yde,oR)=>{var gee=P0(),yee=R0(),Dee=cl(),vee=Vd(),bee=Hd(),wee=zd(),_ee=(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 gee(t,r,n);case"!=":return yee(t,r,n);case">":return Dee(t,r,n);case">=":return vee(t,r,n);case"<":return bee(t,r,n);case"<=":return wee(t,r,n);default:throw new TypeError(`Invalid operator: ${e}`)}};oR.exports=_ee});var aR=y((Jde,sR)=>{var Eee=Ft(),Cee=uo(),{safeRe:Gd,t:Wd}=Ys(),See=(t,e)=>{if(t instanceof Eee)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?Gd[Wd.COERCEFULL]:Gd[Wd.COERCE]);else{let u=e.includePrerelease?Gd[Wd.COERCERTLFULL]:Gd[Wd.COERCERTL],l;for(;(l=u.exec(t))&&(!r||r.index+r[0].length!==t.length);)(!r||l.index+l[0].length!==r.index+r[0].length)&&(r=l),u.lastIndex=l.index+l[1].length+l[2].length;u.lastIndex=-1}if(r===null)return null;let n=r[2],i=r[3]||"0",o=r[4]||"0",s=e.includePrerelease&&r[5]?`-${r[5]}`:"",a=e.includePrerelease&&r[6]?`+${r[6]}`:"";return Cee(`${n}.${i}.${o}${s}${a}`,e)};sR.exports=See});var lR=y((Xde,uR)=>{var I0=class{constructor(){this.max=1e3,this.map=new Map}get(e){let r=this.map.get(e);if(r!==void 0)return this.map.delete(e),this.map.set(e,r),r}delete(e){return this.map.delete(e)}set(e,r){if(!this.delete(e)&&r!==void 0){if(this.map.size>=this.max){let i=this.map.keys().next().value;this.delete(i)}this.map.set(e,r)}return this}};uR.exports=I0});var Dr=y((Zde,hR)=>{var xee=/\s+/g,j0=class t{constructor(e,r){if(r=Oee(r),e instanceof t)return e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease?e:new t(e.raw,r);if(e instanceof N0)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(xee," "),this.set=this.raw.split("||").map(n=>this.parseRange(n.trim())).filter(n=>n.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let n=this.set[0];if(this.set=this.set.filter(i=>!fR(i[0])),this.set.length===0)this.set=[n];else if(this.set.length>1){for(let i of this.set)if(i.length===1&&Iee(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&&Ree)|(this.options.loose&&$ee))+":"+e,i=cR.get(n);if(i)return i;let o=this.options.loose,s=o?Kt[It.HYPHENRANGELOOSE]:Kt[It.HYPHENRANGE];e=e.replace(s,zee(this.options.includePrerelease)),$e("hyphen replace",e),e=e.replace(Kt[It.COMPARATORTRIM],kee),$e("comparator trim",e),e=e.replace(Kt[It.TILDETRIM],Tee),$e("tilde trim",e),e=e.replace(Kt[It.CARETTRIM],Pee),$e("caret trim",e);let a=e.split(" ").map(f=>jee(f,this.options)).join(" ").split(/\s+/).map(f=>Vee(f,this.options));o&&(a=a.filter(f=>($e("loose invalid filter",f,this.options),!!f.match(Kt[It.COMPARATORLOOSE])))),$e("range list",a);let u=new Map,l=a.map(f=>new N0(f,this.options));for(let f of l){if(fR(f))return[f];u.set(f.value,f)}u.size>1&&u.has("")&&u.delete("");let c=[...u.values()];return cR.set(n,c),c}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Range is required");return this.set.some(n=>dR(n,r)&&e.set.some(i=>dR(i,r)&&n.every(o=>i.every(s=>o.intersects(s,r)))))}test(e){if(!e)return!1;if(typeof e=="string")try{e=new Aee(e,this.options)}catch{return!1}for(let r=0;r<this.set.length;r++)if(Gee(this.set[r],e,this.options))return!0;return!1}};hR.exports=j0;var Fee=lR(),cR=new Fee,Oee=Ld(),N0=fl(),$e=ll(),Aee=Ft(),{safeRe:Kt,t:It,comparatorTrimReplace:kee,tildeTrimReplace:Tee,caretTrimReplace:Pee}=Ys(),{FLAG_INCLUDE_PRERELEASE:Ree,FLAG_LOOSE:$ee}=ul(),fR=t=>t.value==="<0.0.0-0",Iee=t=>t.value==="",dR=(t,e)=>{let r=!0,n=t.slice(),i=n.pop();for(;r&&n.length;)r=n.every(o=>i.intersects(o,e)),i=n.pop();return r},jee=(t,e)=>($e("comp",t,e),t=Bee(t,e),$e("caret",t),t=Nee(t,e),$e("tildes",t),t=Mee(t,e),$e("xrange",t),t=Hee(t,e),$e("stars",t),t),jt=t=>!t||t.toLowerCase()==="x"||t==="*",Nee=(t,e)=>t.trim().split(/\s+/).map(r=>Lee(r,e)).join(" "),Lee=(t,e)=>{let r=e.loose?Kt[It.TILDELOOSE]:Kt[It.TILDE];return t.replace(r,(n,i,o,s,a)=>{$e("tilde",t,n,i,o,s,a);let u;return jt(i)?u="":jt(o)?u=`>=${i}.0.0 <${+i+1}.0.0-0`:jt(s)?u=`>=${i}.${o}.0 <${i}.${+o+1}.0-0`:a?($e("replaceTilde pr",a),u=`>=${i}.${o}.${s}-${a} <${i}.${+o+1}.0-0`):u=`>=${i}.${o}.${s} <${i}.${+o+1}.0-0`,$e("tilde return",u),u})},Bee=(t,e)=>t.trim().split(/\s+/).map(r=>qee(r,e)).join(" "),qee=(t,e)=>{$e("caret",t,e);let r=e.loose?Kt[It.CARETLOOSE]:Kt[It.CARET],n=e.includePrerelease?"-0":"";return t.replace(r,(i,o,s,a,u)=>{$e("caret",t,i,o,s,a,u);let l;return jt(o)?l="":jt(s)?l=`>=${o}.0.0${n} <${+o+1}.0.0-0`:jt(a)?o==="0"?l=`>=${o}.${s}.0${n} <${o}.${+s+1}.0-0`:l=`>=${o}.${s}.0${n} <${+o+1}.0.0-0`:u?($e("replaceCaret pr",u),o==="0"?s==="0"?l=`>=${o}.${s}.${a}-${u} <${o}.${s}.${+a+1}-0`:l=`>=${o}.${s}.${a}-${u} <${o}.${+s+1}.0-0`:l=`>=${o}.${s}.${a}-${u} <${+o+1}.0.0-0`):($e("no pr"),o==="0"?s==="0"?l=`>=${o}.${s}.${a}${n} <${o}.${s}.${+a+1}-0`:l=`>=${o}.${s}.${a}${n} <${o}.${+s+1}.0-0`:l=`>=${o}.${s}.${a} <${+o+1}.0.0-0`),$e("caret return",l),l})},Mee=(t,e)=>($e("replaceXRanges",t,e),t.split(/\s+/).map(r=>Uee(r,e)).join(" ")),Uee=(t,e)=>{t=t.trim();let r=e.loose?Kt[It.XRANGELOOSE]:Kt[It.XRANGE];return t.replace(r,(n,i,o,s,a,u)=>{$e("xRange",t,n,i,o,s,a,u);let l=jt(o),c=l||jt(s),f=c||jt(a),h=f;return i==="="&&h&&(i=""),u=e.includePrerelease?"-0":"",l?i===">"||i==="<"?n="<0.0.0-0":n="*":i&&h?(c&&(s=0),a=0,i===">"?(i=">=",c?(o=+o+1,s=0,a=0):(s=+s+1,a=0)):i==="<="&&(i="<",c?o=+o+1:s=+s+1),i==="<"&&(u="-0"),n=`${i+o}.${s}.${a}${u}`):c?n=`>=${o}.0.0${u} <${+o+1}.0.0-0`:f&&(n=`>=${o}.${s}.0${u} <${o}.${+s+1}.0-0`),$e("xRange return",n),n})},Hee=(t,e)=>($e("replaceStars",t,e),t.trim().replace(Kt[It.STAR],"")),Vee=(t,e)=>($e("replaceGTE0",t,e),t.trim().replace(Kt[e.includePrerelease?It.GTE0PRE:It.GTE0],"")),zee=t=>(e,r,n,i,o,s,a,u,l,c,f,h)=>(jt(n)?r="":jt(i)?r=`>=${n}.0.0${t?"-0":""}`:jt(o)?r=`>=${n}.${i}.0${t?"-0":""}`:s?r=`>=${r}`:r=`>=${r}${t?"-0":""}`,jt(l)?u="":jt(c)?u=`<${+l+1}.0.0-0`:jt(f)?u=`<${l}.${+c+1}.0-0`:h?u=`<=${l}.${c}.${f}-${h}`:t?u=`<${l}.${c}.${+f+1}-0`:u=`<=${u}`,`${r} ${u}`.trim()),Gee=(t,e,r)=>{for(let n=0;n<t.length;n++)if(!t[n].test(e))return!1;if(e.prerelease.length&&!r.includePrerelease){for(let n=0;n<t.length;n++)if($e(t[n].semver),t[n].semver!==N0.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 fl=y((Qde,vR)=>{var dl=Symbol("SemVer ANY"),q0=class t{static get ANY(){return dl}constructor(e,r){if(r=pR(r),e instanceof t){if(e.loose===!!r.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),B0("comparator",e,r),this.options=r,this.loose=!!r.loose,this.parse(e),this.semver===dl?this.value="":this.value=this.operator+this.semver.version,B0("comp",this)}parse(e){let r=this.options.loose?mR[gR.COMPARATORLOOSE]:mR[gR.COMPARATOR],n=e.match(r);if(!n)throw new TypeError(`Invalid comparator: ${e}`);this.operator=n[1]!==void 0?n[1]:"",this.operator==="="&&(this.operator=""),n[2]?this.semver=new yR(n[2],this.options.loose):this.semver=dl}toString(){return this.value}test(e){if(B0("Comparator.test",e,this.options.loose),this.semver===dl||e===dl)return!0;if(typeof e=="string")try{e=new yR(e,this.options)}catch{return!1}return L0(e,this.operator,this.semver,this.options)}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new DR(e.value,r).test(this.value):e.operator===""?e.value===""?!0:new DR(this.value,r).test(e.semver):(r=pR(r),r.includePrerelease&&(this.value==="<0.0.0-0"||e.value==="<0.0.0-0")||!r.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&e.operator.startsWith(">")||this.operator.startsWith("<")&&e.operator.startsWith("<")||this.semver.version===e.semver.version&&this.operator.includes("=")&&e.operator.includes("=")||L0(this.semver,"<",e.semver,r)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||L0(this.semver,">",e.semver,r)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}};vR.exports=q0;var pR=Ld(),{safeRe:mR,t:gR}=Ys(),L0=$0(),B0=ll(),yR=Ft(),DR=Dr()});var hl=y((ehe,bR)=>{var Wee=Dr(),Kee=(t,e,r)=>{try{e=new Wee(e,r)}catch{return!1}return e.test(t)};bR.exports=Kee});var _R=y((the,wR)=>{var Yee=Dr(),Jee=(t,e)=>new Yee(t,e).set.map(r=>r.map(n=>n.value).join(" ").trim().split(" "));wR.exports=Jee});var CR=y((rhe,ER)=>{var Xee=Ft(),Zee=Dr(),Qee=(t,e,r)=>{let n=null,i=null,o=null;try{o=new Zee(e,r)}catch{return null}return t.forEach(s=>{o.test(s)&&(!n||i.compare(s)===-1)&&(n=s,i=new Xee(n,r))}),n};ER.exports=Qee});var xR=y((nhe,SR)=>{var ete=Ft(),tte=Dr(),rte=(t,e,r)=>{let n=null,i=null,o=null;try{o=new tte(e,r)}catch{return null}return t.forEach(s=>{o.test(s)&&(!n||i.compare(s)===1)&&(n=s,i=new ete(n,r))}),n};SR.exports=rte});var AR=y((ihe,OR)=>{var M0=Ft(),nte=Dr(),FR=cl(),ite=(t,e)=>{t=new nte(t,e);let r=new M0("0.0.0");if(t.test(r)||(r=new M0("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 M0(s.semver.version);switch(s.operator){case">":a.prerelease.length===0?a.patch++:a.prerelease.push(0),a.raw=a.format();case"":case">=":(!o||FR(a,o))&&(o=a);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${s.operator}`)}}),o&&(!r||FR(r,o))&&(r=o)}return r&&t.test(r)?r:null};OR.exports=ite});var TR=y((ohe,kR)=>{var ote=Dr(),ste=(t,e)=>{try{return new ote(t,e).range||"*"}catch{return null}};kR.exports=ste});var Kd=y((she,IR)=>{var ate=Ft(),$R=fl(),{ANY:ute}=$R,lte=Dr(),cte=hl(),PR=cl(),RR=Hd(),fte=zd(),dte=Vd(),hte=(t,e,r,n)=>{t=new ate(t,n),e=new lte(e,n);let i,o,s,a,u;switch(r){case">":i=PR,o=fte,s=RR,a=">",u=">=";break;case"<":i=RR,o=dte,s=PR,a="<",u="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(cte(t,e,n))return!1;for(let l=0;l<e.set.length;++l){let c=e.set[l],f=null,h=null;if(c.forEach(d=>{d.semver===ute&&(d=new $R(">=0.0.0")),f=f||d,h=h||d,i(d.semver,f.semver,n)?f=d:s(d.semver,h.semver,n)&&(h=d)}),f.operator===a||f.operator===u||(!h.operator||h.operator===a)&&o(t,h.semver))return!1;if(h.operator===u&&s(t,h.semver))return!1}return!0};IR.exports=hte});var NR=y((ahe,jR)=>{var pte=Kd(),mte=(t,e,r)=>pte(t,e,">",r);jR.exports=mte});var BR=y((uhe,LR)=>{var gte=Kd(),yte=(t,e,r)=>gte(t,e,"<",r);LR.exports=yte});var UR=y((lhe,MR)=>{var qR=Dr(),Dte=(t,e,r)=>(t=new qR(t,r),e=new qR(e,r),t.intersects(e,r));MR.exports=Dte});var VR=y((che,HR)=>{var vte=hl(),bte=yr();HR.exports=(t,e,r)=>{let n=[],i=null,o=null,s=t.sort((c,f)=>bte(c,f,r));for(let c of s)vte(c,e,r)?(o=c,i||(i=c)):(o&&n.push([i,o]),o=null,i=null);i&&n.push([i,null]);let a=[];for(let[c,f]of n)c===f?a.push(c):!f&&c===s[0]?a.push("*"):f?c===s[0]?a.push(`<=${f}`):a.push(`${c} - ${f}`):a.push(`>=${c}`);let u=a.join(" || "),l=typeof e.raw=="string"?e.raw:String(e);return u.length<l.length?u:e}});var z0=y((fhe,YR)=>{var zR=Dr(),H0=fl(),{ANY:U0}=H0,pl=hl(),V0=yr(),wte=(t,e,r={})=>{if(t===e)return!0;t=new zR(t,r),e=new zR(e,r);let n=!1;e:for(let i of t.set){for(let o of e.set){let s=Ete(i,o,r);if(n=n||s!==null,s)continue e}if(n)return!1}return!0},_te=[new H0(">=0.0.0-0")],GR=[new H0(">=0.0.0")],Ete=(t,e,r)=>{if(t===e)return!0;if(t.length===1&&t[0].semver===U0){if(e.length===1&&e[0].semver===U0)return!0;r.includePrerelease?t=_te:t=GR}if(e.length===1&&e[0].semver===U0){if(r.includePrerelease)return!0;e=GR}let n=new Set,i,o;for(let d of t)d.operator===">"||d.operator===">="?i=WR(i,d,r):d.operator==="<"||d.operator==="<="?o=KR(o,d,r):n.add(d.semver);if(n.size>1)return null;let s;if(i&&o){if(s=V0(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&&!pl(d,String(i),r)||o&&!pl(d,String(o),r))return null;for(let m of e)if(!pl(d,String(m),r))return!1;return!0}let a,u,l,c,f=o&&!r.includePrerelease&&o.semver.prerelease.length?o.semver:!1,h=i&&!r.includePrerelease&&i.semver.prerelease.length?i.semver:!1;f&&f.prerelease.length===1&&o.operator==="<"&&f.prerelease[0]===0&&(f=!1);for(let d of e){if(c=c||d.operator===">"||d.operator===">=",l=l||d.operator==="<"||d.operator==="<=",i){if(h&&d.semver.prerelease&&d.semver.prerelease.length&&d.semver.major===h.major&&d.semver.minor===h.minor&&d.semver.patch===h.patch&&(h=!1),d.operator===">"||d.operator===">="){if(a=WR(i,d,r),a===d&&a!==i)return!1}else if(i.operator===">="&&!pl(i.semver,String(d),r))return!1}if(o){if(f&&d.semver.prerelease&&d.semver.prerelease.length&&d.semver.major===f.major&&d.semver.minor===f.minor&&d.semver.patch===f.patch&&(f=!1),d.operator==="<"||d.operator==="<="){if(u=KR(o,d,r),u===d&&u!==o)return!1}else if(o.operator==="<="&&!pl(o.semver,String(d),r))return!1}if(!d.operator&&(o||i)&&s!==0)return!1}return!(i&&l&&!o&&s!==0||o&&c&&!i&&s!==0||h||f)},WR=(t,e,r)=>{if(!t)return e;let n=V0(t.semver,e.semver,r);return n>0?t:n<0||e.operator===">"&&t.operator===">="?e:t},KR=(t,e,r)=>{if(!t)return e;let n=V0(t.semver,e.semver,r);return n<0?t:n>0||e.operator==="<"&&t.operator==="<="?e:t};YR.exports=wte});var W0=y((dhe,ZR)=>{var G0=Ys(),JR=ul(),Cte=Ft(),XR=k0(),Ste=uo(),xte=C3(),Fte=x3(),Ote=A3(),Ate=P3(),kte=$3(),Tte=j3(),Pte=L3(),Rte=q3(),$te=yr(),Ite=V3(),jte=G3(),Nte=Ud(),Lte=J3(),Bte=Z3(),qte=cl(),Mte=Hd(),Ute=P0(),Hte=R0(),Vte=Vd(),zte=zd(),Gte=$0(),Wte=aR(),Kte=fl(),Yte=Dr(),Jte=hl(),Xte=_R(),Zte=CR(),Qte=xR(),ere=AR(),tre=TR(),rre=Kd(),nre=NR(),ire=BR(),ore=UR(),sre=VR(),are=z0();ZR.exports={parse:Ste,valid:xte,clean:Fte,inc:Ote,diff:Ate,major:kte,minor:Tte,patch:Pte,prerelease:Rte,compare:$te,rcompare:Ite,compareLoose:jte,compareBuild:Nte,sort:Lte,rsort:Bte,gt:qte,lt:Mte,eq:Ute,neq:Hte,gte:Vte,lte:zte,cmp:Gte,coerce:Wte,Comparator:Kte,Range:Yte,satisfies:Jte,toComparators:Xte,maxSatisfying:Zte,minSatisfying:Qte,minVersion:ere,validRange:tre,outside:rre,gtr:nre,ltr:ire,intersects:ore,simplifyRange:sre,subset:are,SemVer:Cte,re:G0.re,src:G0.src,tokens:G0.t,SEMVER_SPEC_VERSION:JR.SEMVER_SPEC_VERSION,RELEASE_TYPES:JR.RELEASE_TYPES,compareIdentifiers:XR.compareIdentifiers,rcompareIdentifiers:XR.rcompareIdentifiers}});var c$=y(W=>{"use strict";Object.defineProperty(W,"__esModule",{value:!0});W.parseApkNameFromFlavor=W.checkJDKMajorVersion=W.resolvePlatform=W.checkPlatformVersions=W.getAddedPlatforms=W.getPlatformTargetName=W.promptForPlatformTarget=W.promptForPlatform=W.isValidEnterprisePlatform=W.getKnownEnterprisePlatforms=W.isValidCommunityPlatform=W.getKnownCommunityPlatforms=W.isValidPlatform=W.getKnownPlatforms=W.selectPlatforms=W.getProjectPlatformDirectory=W.getCLIVersion=W.getCoreVersion=W.getCapacitorPackageVersion=W.requireCapacitorPackage=W.getCapacitorPackage=W.runTask=W.runPlatformHook=W.runHooks=W.wait=W.checkAppName=W.checkAppId=W.checkAppDir=W.checkAppConfig=W.checkCapacitorPlatform=W.checkPackage=W.checkWebDir=W.check=void 0;var gl=(nr(),je(rr)),QR=uD(),ui=js(),lo=require("path"),Ce=gl.__importDefault(Ns()),Xs=yd(),t$=Yu(),ure=s3(),e$=rc(),ml=jd(),lre=Nd();async function cre(t){let r=(await Promise.all(t.map(n=>n()))).filter(n=>n!=null);if(r.length>0)throw r.join(`
159
+ `),tQ.logger.info(n)}Ee.printPlugins=iQ;function S0(t,e){return t.xml.platform?t.xml.platform.filter(function(i){return i.$.name===e})[0]:[]}Ee.getPluginPlatform=S0;function oQ(t,e,r){let n=S0(t,e);if(n){let i=n[r];if(i)return i}return[]}Ee.getPlatformElement=oQ;function sQ(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=sQ;function aQ(t,e){return x0(t,e,"js-module")}Ee.getJSModules=aQ;function uQ(t,e){return x0(t,e,"asset")}Ee.getAssets=uQ;function lQ(t,e,r){if(r.startsWith("node_modules")){let n=r.split("/").slice(1);n[0].startsWith("@")&&(n=[n[0]+"/"+n[1],...n.slice(2)]);let i=(0,r3.resolveNode)(t.app.rootDir,...n);if(!i)throw new Error(`Can't resolve module ${n[0]}`);return i}return(0,E0.join)(e.rootPath,r)}Ee.getFilePath=lQ;function x0(t,e,r){let n=[];t.xml[r]&&(n=n.concat(t.xml[r]));let i=S0(t,e);return i?.[r]&&(n=n.concat(i[r])),n}Ee.getAllElements=x0});var a3={};gi(a3,{default:()=>cQ});var cQ,u3=Ct(()=>{cQ={}});var Nd=D(ai=>{"use strict";Object.defineProperty(ai,"__esModule",{value:!0});ai.isInstalled=ai.getCommandOutput=ai.runCommand=void 0;var F0=(u3(),je(a3));async function l3(t,e,r={}){let n=new F0.Subprocess(t,e,r);try{return await n.output()}catch(i){throw i instanceof F0.SubprocessError?i.output?i.output:i.cause?`${i.message} ${i.cause.toString()}`:i.code?i.code:"Unknown error":i}}ai.runCommand=l3;async function fQ(t,e,r={}){try{return(await l3(t,e,r)).trim()}catch{return null}}ai.getCommandOutput=fQ;async function dQ(t){try{await(0,F0.which)(t)}catch{return!1}return!0}ai.isInstalled=dQ});var ul=D((Ede,c3)=>{var hQ="2.0.0",pQ=Number.MAX_SAFE_INTEGER||9007199254740991,mQ=16,gQ=250,yQ=["major","premajor","minor","preminor","patch","prepatch","prerelease"];c3.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:mQ,MAX_SAFE_BUILD_LENGTH:gQ,MAX_SAFE_INTEGER:pQ,RELEASE_TYPES:yQ,SEMVER_SPEC_VERSION:hQ,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var ll=D((Cde,f3)=>{var DQ=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{};f3.exports=DQ});var Ys=D((tn,d3)=>{var{MAX_SAFE_COMPONENT_LENGTH:O0,MAX_SAFE_BUILD_LENGTH:vQ,MAX_LENGTH:bQ}=ul(),wQ=ll();tn=d3.exports={};var _Q=tn.re=[],EQ=tn.safeRe=[],z=tn.src=[],CQ=tn.safeSrc=[],G=tn.t={},SQ=0,A0="[a-zA-Z0-9-]",xQ=[["\\s",1],["\\d",bQ],[A0,vQ]],FQ=t=>{for(let[e,r]of xQ)t=t.split(`${e}*`).join(`${e}{0,${r}}`).split(`${e}+`).join(`${e}{1,${r}}`);return t},re=(t,e,r)=>{let n=FQ(e),i=SQ++;wQ(t,i,e),G[t]=i,z[i]=e,CQ[i]=n,_Q[i]=new RegExp(e,r?"g":void 0),EQ[i]=new RegExp(n,r?"g":void 0)};re("NUMERICIDENTIFIER","0|[1-9]\\d*");re("NUMERICIDENTIFIERLOOSE","\\d+");re("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${A0}*`);re("MAINVERSION",`(${z[G.NUMERICIDENTIFIER]})\\.(${z[G.NUMERICIDENTIFIER]})\\.(${z[G.NUMERICIDENTIFIER]})`);re("MAINVERSIONLOOSE",`(${z[G.NUMERICIDENTIFIERLOOSE]})\\.(${z[G.NUMERICIDENTIFIERLOOSE]})\\.(${z[G.NUMERICIDENTIFIERLOOSE]})`);re("PRERELEASEIDENTIFIER",`(?:${z[G.NUMERICIDENTIFIER]}|${z[G.NONNUMERICIDENTIFIER]})`);re("PRERELEASEIDENTIFIERLOOSE",`(?:${z[G.NUMERICIDENTIFIERLOOSE]}|${z[G.NONNUMERICIDENTIFIER]})`);re("PRERELEASE",`(?:-(${z[G.PRERELEASEIDENTIFIER]}(?:\\.${z[G.PRERELEASEIDENTIFIER]})*))`);re("PRERELEASELOOSE",`(?:-?(${z[G.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${z[G.PRERELEASEIDENTIFIERLOOSE]})*))`);re("BUILDIDENTIFIER",`${A0}+`);re("BUILD",`(?:\\+(${z[G.BUILDIDENTIFIER]}(?:\\.${z[G.BUILDIDENTIFIER]})*))`);re("FULLPLAIN",`v?${z[G.MAINVERSION]}${z[G.PRERELEASE]}?${z[G.BUILD]}?`);re("FULL",`^${z[G.FULLPLAIN]}$`);re("LOOSEPLAIN",`[v=\\s]*${z[G.MAINVERSIONLOOSE]}${z[G.PRERELEASELOOSE]}?${z[G.BUILD]}?`);re("LOOSE",`^${z[G.LOOSEPLAIN]}$`);re("GTLT","((?:<|>)?=?)");re("XRANGEIDENTIFIERLOOSE",`${z[G.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);re("XRANGEIDENTIFIER",`${z[G.NUMERICIDENTIFIER]}|x|X|\\*`);re("XRANGEPLAIN",`[v=\\s]*(${z[G.XRANGEIDENTIFIER]})(?:\\.(${z[G.XRANGEIDENTIFIER]})(?:\\.(${z[G.XRANGEIDENTIFIER]})(?:${z[G.PRERELEASE]})?${z[G.BUILD]}?)?)?`);re("XRANGEPLAINLOOSE",`[v=\\s]*(${z[G.XRANGEIDENTIFIERLOOSE]})(?:\\.(${z[G.XRANGEIDENTIFIERLOOSE]})(?:\\.(${z[G.XRANGEIDENTIFIERLOOSE]})(?:${z[G.PRERELEASELOOSE]})?${z[G.BUILD]}?)?)?`);re("XRANGE",`^${z[G.GTLT]}\\s*${z[G.XRANGEPLAIN]}$`);re("XRANGELOOSE",`^${z[G.GTLT]}\\s*${z[G.XRANGEPLAINLOOSE]}$`);re("COERCEPLAIN",`(^|[^\\d])(\\d{1,${O0}})(?:\\.(\\d{1,${O0}}))?(?:\\.(\\d{1,${O0}}))?`);re("COERCE",`${z[G.COERCEPLAIN]}(?:$|[^\\d])`);re("COERCEFULL",z[G.COERCEPLAIN]+`(?:${z[G.PRERELEASE]})?(?:${z[G.BUILD]})?(?:$|[^\\d])`);re("COERCERTL",z[G.COERCE],!0);re("COERCERTLFULL",z[G.COERCEFULL],!0);re("LONETILDE","(?:~>?)");re("TILDETRIM",`(\\s*)${z[G.LONETILDE]}\\s+`,!0);tn.tildeTrimReplace="$1~";re("TILDE",`^${z[G.LONETILDE]}${z[G.XRANGEPLAIN]}$`);re("TILDELOOSE",`^${z[G.LONETILDE]}${z[G.XRANGEPLAINLOOSE]}$`);re("LONECARET","(?:\\^)");re("CARETTRIM",`(\\s*)${z[G.LONECARET]}\\s+`,!0);tn.caretTrimReplace="$1^";re("CARET",`^${z[G.LONECARET]}${z[G.XRANGEPLAIN]}$`);re("CARETLOOSE",`^${z[G.LONECARET]}${z[G.XRANGEPLAINLOOSE]}$`);re("COMPARATORLOOSE",`^${z[G.GTLT]}\\s*(${z[G.LOOSEPLAIN]})$|^$`);re("COMPARATOR",`^${z[G.GTLT]}\\s*(${z[G.FULLPLAIN]})$|^$`);re("COMPARATORTRIM",`(\\s*)${z[G.GTLT]}\\s*(${z[G.LOOSEPLAIN]}|${z[G.XRANGEPLAIN]})`,!0);tn.comparatorTrimReplace="$1$2$3";re("HYPHENRANGE",`^\\s*(${z[G.XRANGEPLAIN]})\\s+-\\s+(${z[G.XRANGEPLAIN]})\\s*$`);re("HYPHENRANGELOOSE",`^\\s*(${z[G.XRANGEPLAINLOOSE]})\\s+-\\s+(${z[G.XRANGEPLAINLOOSE]})\\s*$`);re("STAR","(<|>)?=?\\s*\\*");re("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");re("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var Ld=D((Sde,h3)=>{var OQ=Object.freeze({loose:!0}),AQ=Object.freeze({}),kQ=t=>t?typeof t!="object"?OQ:t:AQ;h3.exports=kQ});var k0=D((xde,g3)=>{var p3=/^[0-9]+$/,m3=(t,e)=>{let r=p3.test(t),n=p3.test(e);return r&&n&&(t=+t,e=+e),t===e?0:r&&!n?-1:n&&!r?1:t<e?-1:1},TQ=(t,e)=>m3(e,t);g3.exports={compareIdentifiers:m3,rcompareIdentifiers:TQ}});var Ft=D((Fde,b3)=>{var Bd=ll(),{MAX_LENGTH:y3,MAX_SAFE_INTEGER:qd}=ul(),{safeRe:D3,safeSrc:v3,t:Md}=Ys(),PQ=Ld(),{compareIdentifiers:Js}=k0(),T0=class t{constructor(e,r){if(r=PQ(r),e instanceof t){if(e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease)return e;e=e.version}else if(typeof e!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>y3)throw new TypeError(`version is longer than ${y3} characters`);Bd("SemVer",e,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;let n=e.trim().match(r.loose?D3[Md.LOOSE]:D3[Md.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>qd||this.major<0)throw new TypeError("Invalid major version");if(this.minor>qd||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>qd||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<qd)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(Bd("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)),Js(this.major,e.major)||Js(this.minor,e.minor)||Js(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(Bd("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 Js(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(Bd("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 Js(n,i)}while(++r)}inc(e,r,n){if(e.startsWith("pre")){if(!r&&n===!1)throw new Error("invalid increment argument: identifier is empty");if(r){let i=new RegExp(`^${this.options.loose?v3[Md.PRERELEASELOOSE]:v3[Md.PRERELEASE]}$`),o=`-${r}`.match(i);if(!o||o[1]!==r)throw new Error(`invalid identifier: ${r}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",r,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",r,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",r,n),this.inc("pre",r,n);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",r,n),this.inc("pre",r,n);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{let i=Number(n)?1:0;if(this.prerelease.length===0)this.prerelease=[i];else{let o=this.prerelease.length;for(;--o>=0;)typeof this.prerelease[o]=="number"&&(this.prerelease[o]++,o=-2);if(o===-1){if(r===this.prerelease.join(".")&&n===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(i)}}if(r){let o=[r,i];n===!1&&(o=[r]),Js(this.prerelease[0],r)===0?isNaN(this.prerelease[1])&&(this.prerelease=o):this.prerelease=o}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};b3.exports=T0});var uo=D((Ode,_3)=>{var w3=Ft(),RQ=(t,e,r=!1)=>{if(t instanceof w3)return t;try{return new w3(t,e)}catch(n){if(!r)return null;throw n}};_3.exports=RQ});var C3=D((Ade,E3)=>{var $Q=uo(),IQ=(t,e)=>{let r=$Q(t,e);return r?r.version:null};E3.exports=IQ});var x3=D((kde,S3)=>{var jQ=uo(),NQ=(t,e)=>{let r=jQ(t.trim().replace(/^[=v]+/,""),e);return r?r.version:null};S3.exports=NQ});var A3=D((Tde,O3)=>{var F3=Ft(),LQ=(t,e,r,n,i)=>{typeof r=="string"&&(i=n,n=r,r=void 0);try{return new F3(t instanceof F3?t.version:t,r).inc(e,n,i).version}catch{return null}};O3.exports=LQ});var P3=D((Pde,T3)=>{var k3=uo(),BQ=(t,e)=>{let r=k3(t,null,!0),n=k3(e,null,!0),i=r.compare(n);if(i===0)return null;let o=i>0,s=o?r:n,a=o?n:r,u=!!s.prerelease.length;if(!!a.prerelease.length&&!u){if(!a.patch&&!a.minor)return"major";if(a.compareMain(s)===0)return a.minor&&!a.patch?"minor":"patch"}let c=u?"pre":"";return r.major!==n.major?c+"major":r.minor!==n.minor?c+"minor":r.patch!==n.patch?c+"patch":"prerelease"};T3.exports=BQ});var $3=D((Rde,R3)=>{var qQ=Ft(),MQ=(t,e)=>new qQ(t,e).major;R3.exports=MQ});var j3=D(($de,I3)=>{var UQ=Ft(),HQ=(t,e)=>new UQ(t,e).minor;I3.exports=HQ});var L3=D((Ide,N3)=>{var VQ=Ft(),zQ=(t,e)=>new VQ(t,e).patch;N3.exports=zQ});var q3=D((jde,B3)=>{var GQ=uo(),WQ=(t,e)=>{let r=GQ(t,e);return r&&r.prerelease.length?r.prerelease:null};B3.exports=WQ});var yr=D((Nde,U3)=>{var M3=Ft(),KQ=(t,e,r)=>new M3(t,r).compare(new M3(e,r));U3.exports=KQ});var V3=D((Lde,H3)=>{var YQ=yr(),JQ=(t,e,r)=>YQ(e,t,r);H3.exports=JQ});var G3=D((Bde,z3)=>{var XQ=yr(),ZQ=(t,e)=>XQ(t,e,!0);z3.exports=ZQ});var Ud=D((qde,K3)=>{var W3=Ft(),QQ=(t,e,r)=>{let n=new W3(t,r),i=new W3(e,r);return n.compare(i)||n.compareBuild(i)};K3.exports=QQ});var J3=D((Mde,Y3)=>{var eee=Ud(),tee=(t,e)=>t.sort((r,n)=>eee(r,n,e));Y3.exports=tee});var Z3=D((Ude,X3)=>{var ree=Ud(),nee=(t,e)=>t.sort((r,n)=>ree(n,r,e));X3.exports=nee});var cl=D((Hde,Q3)=>{var iee=yr(),oee=(t,e,r)=>iee(t,e,r)>0;Q3.exports=oee});var Hd=D((Vde,eR)=>{var see=yr(),aee=(t,e,r)=>see(t,e,r)<0;eR.exports=aee});var P0=D((zde,tR)=>{var uee=yr(),lee=(t,e,r)=>uee(t,e,r)===0;tR.exports=lee});var R0=D((Gde,rR)=>{var cee=yr(),fee=(t,e,r)=>cee(t,e,r)!==0;rR.exports=fee});var Vd=D((Wde,nR)=>{var dee=yr(),hee=(t,e,r)=>dee(t,e,r)>=0;nR.exports=hee});var zd=D((Kde,iR)=>{var pee=yr(),mee=(t,e,r)=>pee(t,e,r)<=0;iR.exports=mee});var $0=D((Yde,oR)=>{var gee=P0(),yee=R0(),Dee=cl(),vee=Vd(),bee=Hd(),wee=zd(),_ee=(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 gee(t,r,n);case"!=":return yee(t,r,n);case">":return Dee(t,r,n);case">=":return vee(t,r,n);case"<":return bee(t,r,n);case"<=":return wee(t,r,n);default:throw new TypeError(`Invalid operator: ${e}`)}};oR.exports=_ee});var aR=D((Jde,sR)=>{var Eee=Ft(),Cee=uo(),{safeRe:Gd,t:Wd}=Ys(),See=(t,e)=>{if(t instanceof Eee)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?Gd[Wd.COERCEFULL]:Gd[Wd.COERCE]);else{let u=e.includePrerelease?Gd[Wd.COERCERTLFULL]:Gd[Wd.COERCERTL],l;for(;(l=u.exec(t))&&(!r||r.index+r[0].length!==t.length);)(!r||l.index+l[0].length!==r.index+r[0].length)&&(r=l),u.lastIndex=l.index+l[1].length+l[2].length;u.lastIndex=-1}if(r===null)return null;let n=r[2],i=r[3]||"0",o=r[4]||"0",s=e.includePrerelease&&r[5]?`-${r[5]}`:"",a=e.includePrerelease&&r[6]?`+${r[6]}`:"";return Cee(`${n}.${i}.${o}${s}${a}`,e)};sR.exports=See});var lR=D((Xde,uR)=>{var I0=class{constructor(){this.max=1e3,this.map=new Map}get(e){let r=this.map.get(e);if(r!==void 0)return this.map.delete(e),this.map.set(e,r),r}delete(e){return this.map.delete(e)}set(e,r){if(!this.delete(e)&&r!==void 0){if(this.map.size>=this.max){let i=this.map.keys().next().value;this.delete(i)}this.map.set(e,r)}return this}};uR.exports=I0});var Dr=D((Zde,hR)=>{var xee=/\s+/g,j0=class t{constructor(e,r){if(r=Oee(r),e instanceof t)return e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease?e:new t(e.raw,r);if(e instanceof N0)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(xee," "),this.set=this.raw.split("||").map(n=>this.parseRange(n.trim())).filter(n=>n.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let n=this.set[0];if(this.set=this.set.filter(i=>!fR(i[0])),this.set.length===0)this.set=[n];else if(this.set.length>1){for(let i of this.set)if(i.length===1&&Iee(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&&Ree)|(this.options.loose&&$ee))+":"+e,i=cR.get(n);if(i)return i;let o=this.options.loose,s=o?Kt[It.HYPHENRANGELOOSE]:Kt[It.HYPHENRANGE];e=e.replace(s,zee(this.options.includePrerelease)),$e("hyphen replace",e),e=e.replace(Kt[It.COMPARATORTRIM],kee),$e("comparator trim",e),e=e.replace(Kt[It.TILDETRIM],Tee),$e("tilde trim",e),e=e.replace(Kt[It.CARETTRIM],Pee),$e("caret trim",e);let a=e.split(" ").map(f=>jee(f,this.options)).join(" ").split(/\s+/).map(f=>Vee(f,this.options));o&&(a=a.filter(f=>($e("loose invalid filter",f,this.options),!!f.match(Kt[It.COMPARATORLOOSE])))),$e("range list",a);let u=new Map,l=a.map(f=>new N0(f,this.options));for(let f of l){if(fR(f))return[f];u.set(f.value,f)}u.size>1&&u.has("")&&u.delete("");let c=[...u.values()];return cR.set(n,c),c}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Range is required");return this.set.some(n=>dR(n,r)&&e.set.some(i=>dR(i,r)&&n.every(o=>i.every(s=>o.intersects(s,r)))))}test(e){if(!e)return!1;if(typeof e=="string")try{e=new Aee(e,this.options)}catch{return!1}for(let r=0;r<this.set.length;r++)if(Gee(this.set[r],e,this.options))return!0;return!1}};hR.exports=j0;var Fee=lR(),cR=new Fee,Oee=Ld(),N0=fl(),$e=ll(),Aee=Ft(),{safeRe:Kt,t:It,comparatorTrimReplace:kee,tildeTrimReplace:Tee,caretTrimReplace:Pee}=Ys(),{FLAG_INCLUDE_PRERELEASE:Ree,FLAG_LOOSE:$ee}=ul(),fR=t=>t.value==="<0.0.0-0",Iee=t=>t.value==="",dR=(t,e)=>{let r=!0,n=t.slice(),i=n.pop();for(;r&&n.length;)r=n.every(o=>i.intersects(o,e)),i=n.pop();return r},jee=(t,e)=>($e("comp",t,e),t=Bee(t,e),$e("caret",t),t=Nee(t,e),$e("tildes",t),t=Mee(t,e),$e("xrange",t),t=Hee(t,e),$e("stars",t),t),jt=t=>!t||t.toLowerCase()==="x"||t==="*",Nee=(t,e)=>t.trim().split(/\s+/).map(r=>Lee(r,e)).join(" "),Lee=(t,e)=>{let r=e.loose?Kt[It.TILDELOOSE]:Kt[It.TILDE];return t.replace(r,(n,i,o,s,a)=>{$e("tilde",t,n,i,o,s,a);let u;return jt(i)?u="":jt(o)?u=`>=${i}.0.0 <${+i+1}.0.0-0`:jt(s)?u=`>=${i}.${o}.0 <${i}.${+o+1}.0-0`:a?($e("replaceTilde pr",a),u=`>=${i}.${o}.${s}-${a} <${i}.${+o+1}.0-0`):u=`>=${i}.${o}.${s} <${i}.${+o+1}.0-0`,$e("tilde return",u),u})},Bee=(t,e)=>t.trim().split(/\s+/).map(r=>qee(r,e)).join(" "),qee=(t,e)=>{$e("caret",t,e);let r=e.loose?Kt[It.CARETLOOSE]:Kt[It.CARET],n=e.includePrerelease?"-0":"";return t.replace(r,(i,o,s,a,u)=>{$e("caret",t,i,o,s,a,u);let l;return jt(o)?l="":jt(s)?l=`>=${o}.0.0${n} <${+o+1}.0.0-0`:jt(a)?o==="0"?l=`>=${o}.${s}.0${n} <${o}.${+s+1}.0-0`:l=`>=${o}.${s}.0${n} <${+o+1}.0.0-0`:u?($e("replaceCaret pr",u),o==="0"?s==="0"?l=`>=${o}.${s}.${a}-${u} <${o}.${s}.${+a+1}-0`:l=`>=${o}.${s}.${a}-${u} <${o}.${+s+1}.0-0`:l=`>=${o}.${s}.${a}-${u} <${+o+1}.0.0-0`):($e("no pr"),o==="0"?s==="0"?l=`>=${o}.${s}.${a}${n} <${o}.${s}.${+a+1}-0`:l=`>=${o}.${s}.${a}${n} <${o}.${+s+1}.0-0`:l=`>=${o}.${s}.${a} <${+o+1}.0.0-0`),$e("caret return",l),l})},Mee=(t,e)=>($e("replaceXRanges",t,e),t.split(/\s+/).map(r=>Uee(r,e)).join(" ")),Uee=(t,e)=>{t=t.trim();let r=e.loose?Kt[It.XRANGELOOSE]:Kt[It.XRANGE];return t.replace(r,(n,i,o,s,a,u)=>{$e("xRange",t,n,i,o,s,a,u);let l=jt(o),c=l||jt(s),f=c||jt(a),h=f;return i==="="&&h&&(i=""),u=e.includePrerelease?"-0":"",l?i===">"||i==="<"?n="<0.0.0-0":n="*":i&&h?(c&&(s=0),a=0,i===">"?(i=">=",c?(o=+o+1,s=0,a=0):(s=+s+1,a=0)):i==="<="&&(i="<",c?o=+o+1:s=+s+1),i==="<"&&(u="-0"),n=`${i+o}.${s}.${a}${u}`):c?n=`>=${o}.0.0${u} <${+o+1}.0.0-0`:f&&(n=`>=${o}.${s}.0${u} <${o}.${+s+1}.0-0`),$e("xRange return",n),n})},Hee=(t,e)=>($e("replaceStars",t,e),t.trim().replace(Kt[It.STAR],"")),Vee=(t,e)=>($e("replaceGTE0",t,e),t.trim().replace(Kt[e.includePrerelease?It.GTE0PRE:It.GTE0],"")),zee=t=>(e,r,n,i,o,s,a,u,l,c,f,h)=>(jt(n)?r="":jt(i)?r=`>=${n}.0.0${t?"-0":""}`:jt(o)?r=`>=${n}.${i}.0${t?"-0":""}`:s?r=`>=${r}`:r=`>=${r}${t?"-0":""}`,jt(l)?u="":jt(c)?u=`<${+l+1}.0.0-0`:jt(f)?u=`<${l}.${+c+1}.0-0`:h?u=`<=${l}.${c}.${f}-${h}`:t?u=`<${l}.${c}.${+f+1}-0`:u=`<=${u}`,`${r} ${u}`.trim()),Gee=(t,e,r)=>{for(let n=0;n<t.length;n++)if(!t[n].test(e))return!1;if(e.prerelease.length&&!r.includePrerelease){for(let n=0;n<t.length;n++)if($e(t[n].semver),t[n].semver!==N0.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 fl=D((Qde,vR)=>{var dl=Symbol("SemVer ANY"),q0=class t{static get ANY(){return dl}constructor(e,r){if(r=pR(r),e instanceof t){if(e.loose===!!r.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),B0("comparator",e,r),this.options=r,this.loose=!!r.loose,this.parse(e),this.semver===dl?this.value="":this.value=this.operator+this.semver.version,B0("comp",this)}parse(e){let r=this.options.loose?mR[gR.COMPARATORLOOSE]:mR[gR.COMPARATOR],n=e.match(r);if(!n)throw new TypeError(`Invalid comparator: ${e}`);this.operator=n[1]!==void 0?n[1]:"",this.operator==="="&&(this.operator=""),n[2]?this.semver=new yR(n[2],this.options.loose):this.semver=dl}toString(){return this.value}test(e){if(B0("Comparator.test",e,this.options.loose),this.semver===dl||e===dl)return!0;if(typeof e=="string")try{e=new yR(e,this.options)}catch{return!1}return L0(e,this.operator,this.semver,this.options)}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new DR(e.value,r).test(this.value):e.operator===""?e.value===""?!0:new DR(this.value,r).test(e.semver):(r=pR(r),r.includePrerelease&&(this.value==="<0.0.0-0"||e.value==="<0.0.0-0")||!r.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&e.operator.startsWith(">")||this.operator.startsWith("<")&&e.operator.startsWith("<")||this.semver.version===e.semver.version&&this.operator.includes("=")&&e.operator.includes("=")||L0(this.semver,"<",e.semver,r)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||L0(this.semver,">",e.semver,r)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}};vR.exports=q0;var pR=Ld(),{safeRe:mR,t:gR}=Ys(),L0=$0(),B0=ll(),yR=Ft(),DR=Dr()});var hl=D((ehe,bR)=>{var Wee=Dr(),Kee=(t,e,r)=>{try{e=new Wee(e,r)}catch{return!1}return e.test(t)};bR.exports=Kee});var _R=D((the,wR)=>{var Yee=Dr(),Jee=(t,e)=>new Yee(t,e).set.map(r=>r.map(n=>n.value).join(" ").trim().split(" "));wR.exports=Jee});var CR=D((rhe,ER)=>{var Xee=Ft(),Zee=Dr(),Qee=(t,e,r)=>{let n=null,i=null,o=null;try{o=new Zee(e,r)}catch{return null}return t.forEach(s=>{o.test(s)&&(!n||i.compare(s)===-1)&&(n=s,i=new Xee(n,r))}),n};ER.exports=Qee});var xR=D((nhe,SR)=>{var ete=Ft(),tte=Dr(),rte=(t,e,r)=>{let n=null,i=null,o=null;try{o=new tte(e,r)}catch{return null}return t.forEach(s=>{o.test(s)&&(!n||i.compare(s)===1)&&(n=s,i=new ete(n,r))}),n};SR.exports=rte});var AR=D((ihe,OR)=>{var M0=Ft(),nte=Dr(),FR=cl(),ite=(t,e)=>{t=new nte(t,e);let r=new M0("0.0.0");if(t.test(r)||(r=new M0("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 M0(s.semver.version);switch(s.operator){case">":a.prerelease.length===0?a.patch++:a.prerelease.push(0),a.raw=a.format();case"":case">=":(!o||FR(a,o))&&(o=a);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${s.operator}`)}}),o&&(!r||FR(r,o))&&(r=o)}return r&&t.test(r)?r:null};OR.exports=ite});var TR=D((ohe,kR)=>{var ote=Dr(),ste=(t,e)=>{try{return new ote(t,e).range||"*"}catch{return null}};kR.exports=ste});var Kd=D((she,IR)=>{var ate=Ft(),$R=fl(),{ANY:ute}=$R,lte=Dr(),cte=hl(),PR=cl(),RR=Hd(),fte=zd(),dte=Vd(),hte=(t,e,r,n)=>{t=new ate(t,n),e=new lte(e,n);let i,o,s,a,u;switch(r){case">":i=PR,o=fte,s=RR,a=">",u=">=";break;case"<":i=RR,o=dte,s=PR,a="<",u="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(cte(t,e,n))return!1;for(let l=0;l<e.set.length;++l){let c=e.set[l],f=null,h=null;if(c.forEach(d=>{d.semver===ute&&(d=new $R(">=0.0.0")),f=f||d,h=h||d,i(d.semver,f.semver,n)?f=d:s(d.semver,h.semver,n)&&(h=d)}),f.operator===a||f.operator===u||(!h.operator||h.operator===a)&&o(t,h.semver))return!1;if(h.operator===u&&s(t,h.semver))return!1}return!0};IR.exports=hte});var NR=D((ahe,jR)=>{var pte=Kd(),mte=(t,e,r)=>pte(t,e,">",r);jR.exports=mte});var BR=D((uhe,LR)=>{var gte=Kd(),yte=(t,e,r)=>gte(t,e,"<",r);LR.exports=yte});var UR=D((lhe,MR)=>{var qR=Dr(),Dte=(t,e,r)=>(t=new qR(t,r),e=new qR(e,r),t.intersects(e,r));MR.exports=Dte});var VR=D((che,HR)=>{var vte=hl(),bte=yr();HR.exports=(t,e,r)=>{let n=[],i=null,o=null,s=t.sort((c,f)=>bte(c,f,r));for(let c of s)vte(c,e,r)?(o=c,i||(i=c)):(o&&n.push([i,o]),o=null,i=null);i&&n.push([i,null]);let a=[];for(let[c,f]of n)c===f?a.push(c):!f&&c===s[0]?a.push("*"):f?c===s[0]?a.push(`<=${f}`):a.push(`${c} - ${f}`):a.push(`>=${c}`);let u=a.join(" || "),l=typeof e.raw=="string"?e.raw:String(e);return u.length<l.length?u:e}});var z0=D((fhe,YR)=>{var zR=Dr(),H0=fl(),{ANY:U0}=H0,pl=hl(),V0=yr(),wte=(t,e,r={})=>{if(t===e)return!0;t=new zR(t,r),e=new zR(e,r);let n=!1;e:for(let i of t.set){for(let o of e.set){let s=Ete(i,o,r);if(n=n||s!==null,s)continue e}if(n)return!1}return!0},_te=[new H0(">=0.0.0-0")],GR=[new H0(">=0.0.0")],Ete=(t,e,r)=>{if(t===e)return!0;if(t.length===1&&t[0].semver===U0){if(e.length===1&&e[0].semver===U0)return!0;r.includePrerelease?t=_te:t=GR}if(e.length===1&&e[0].semver===U0){if(r.includePrerelease)return!0;e=GR}let n=new Set,i,o;for(let d of t)d.operator===">"||d.operator===">="?i=WR(i,d,r):d.operator==="<"||d.operator==="<="?o=KR(o,d,r):n.add(d.semver);if(n.size>1)return null;let s;if(i&&o){if(s=V0(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&&!pl(d,String(i),r)||o&&!pl(d,String(o),r))return null;for(let m of e)if(!pl(d,String(m),r))return!1;return!0}let a,u,l,c,f=o&&!r.includePrerelease&&o.semver.prerelease.length?o.semver:!1,h=i&&!r.includePrerelease&&i.semver.prerelease.length?i.semver:!1;f&&f.prerelease.length===1&&o.operator==="<"&&f.prerelease[0]===0&&(f=!1);for(let d of e){if(c=c||d.operator===">"||d.operator===">=",l=l||d.operator==="<"||d.operator==="<=",i){if(h&&d.semver.prerelease&&d.semver.prerelease.length&&d.semver.major===h.major&&d.semver.minor===h.minor&&d.semver.patch===h.patch&&(h=!1),d.operator===">"||d.operator===">="){if(a=WR(i,d,r),a===d&&a!==i)return!1}else if(i.operator===">="&&!pl(i.semver,String(d),r))return!1}if(o){if(f&&d.semver.prerelease&&d.semver.prerelease.length&&d.semver.major===f.major&&d.semver.minor===f.minor&&d.semver.patch===f.patch&&(f=!1),d.operator==="<"||d.operator==="<="){if(u=KR(o,d,r),u===d&&u!==o)return!1}else if(o.operator==="<="&&!pl(o.semver,String(d),r))return!1}if(!d.operator&&(o||i)&&s!==0)return!1}return!(i&&l&&!o&&s!==0||o&&c&&!i&&s!==0||h||f)},WR=(t,e,r)=>{if(!t)return e;let n=V0(t.semver,e.semver,r);return n>0?t:n<0||e.operator===">"&&t.operator===">="?e:t},KR=(t,e,r)=>{if(!t)return e;let n=V0(t.semver,e.semver,r);return n<0?t:n>0||e.operator==="<"&&t.operator==="<="?e:t};YR.exports=wte});var W0=D((dhe,ZR)=>{var G0=Ys(),JR=ul(),Cte=Ft(),XR=k0(),Ste=uo(),xte=C3(),Fte=x3(),Ote=A3(),Ate=P3(),kte=$3(),Tte=j3(),Pte=L3(),Rte=q3(),$te=yr(),Ite=V3(),jte=G3(),Nte=Ud(),Lte=J3(),Bte=Z3(),qte=cl(),Mte=Hd(),Ute=P0(),Hte=R0(),Vte=Vd(),zte=zd(),Gte=$0(),Wte=aR(),Kte=fl(),Yte=Dr(),Jte=hl(),Xte=_R(),Zte=CR(),Qte=xR(),ere=AR(),tre=TR(),rre=Kd(),nre=NR(),ire=BR(),ore=UR(),sre=VR(),are=z0();ZR.exports={parse:Ste,valid:xte,clean:Fte,inc:Ote,diff:Ate,major:kte,minor:Tte,patch:Pte,prerelease:Rte,compare:$te,rcompare:Ite,compareLoose:jte,compareBuild:Nte,sort:Lte,rsort:Bte,gt:qte,lt:Mte,eq:Ute,neq:Hte,gte:Vte,lte:zte,cmp:Gte,coerce:Wte,Comparator:Kte,Range:Yte,satisfies:Jte,toComparators:Xte,maxSatisfying:Zte,minSatisfying:Qte,minVersion:ere,validRange:tre,outside:rre,gtr:nre,ltr:ire,intersects:ore,simplifyRange:sre,subset:are,SemVer:Cte,re:G0.re,src:G0.src,tokens:G0.t,SEMVER_SPEC_VERSION:JR.SEMVER_SPEC_VERSION,RELEASE_TYPES:JR.RELEASE_TYPES,compareIdentifiers:XR.compareIdentifiers,rcompareIdentifiers:XR.rcompareIdentifiers}});var c$=D(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 gl=(nr(),je(rr)),QR=uD(),ui=js(),lo=require("path"),Ce=gl.__importDefault(Ns()),Xs=yd(),t$=Yu(),ure=s3(),e$=rc(),ml=jd(),lre=Nd();async function cre(t){let r=(await Promise.all(t.map(n=>n()))).filter(n=>n!=null);if(r.length>0)throw r.join(`
160
160
  `)}W.check=cre;async function fre(t){var e;return!((e=t.app.extConfig.server)===null||e===void 0)&&e.url?null:["",".","..","../","./"].includes(t.app.webDir)?`"${t.app.webDir}" is not a valid value for webDir`:await(0,ui.pathExists)(t.app.webDirAbs)?await(0,ui.pathExists)((0,lo.join)(t.app.webDirAbs,"index.html"))?null:`The web assets directory (${Ce.default.strong((0,QR.prettyPath)(t.app.webDirAbs))}) must contain an ${Ce.default.strong("index.html")} file.
161
161
  It will be the entry point for the web portion of the Capacitor app.`:`Could not find the web assets directory: ${Ce.default.strong((0,QR.prettyPath)(t.app.webDirAbs))}.
162
162
  Please create it and make sure it has an ${Ce.default.strong("index.html")} file. You can change the path of this directory in ${Ce.default.strong(t.app.extConfigName)} (${Ce.default.input("webDir")} option). You may need to compile the web assets for your app (typically ${Ce.default.input("npm run build")}). More info: ${Ce.default.strong("https://capacitorjs.com/docs/basics/workflow#sync-your-project")}`}W.checkWebDir=fre;async function dre(){return await(0,ui.pathExists)("package.json")||await(0,ui.pathExists)("project.json")?null:`The Capacitor CLI needs to run at the root of an npm package or in a valid NX monorepo.
@@ -178,30 +178,30 @@ Make sure ${Ce.default.strong(t.app.webDir)} exists.`),(0,Xs.fatal)(`${Ce.defaul
178
178
  See the docs for adding the ${Ce.default.strong(r)} platform: ${Ce.default.strong(`https://capacitorjs.com/docs/${r}#adding-the-${r}-platform`)}`)):(0,Xs.fatal)(`Invalid platform: ${Ce.default.input(r)}`),[r]}return l$(t)}W.selectPlatforms=wre;async function J0(){return["web","android","ios"]}W.getKnownPlatforms=J0;async function X0(t){return(await J0()).includes(t)}W.isValidPlatform=X0;async function s$(){return["electron"]}W.getKnownCommunityPlatforms=s$;async function _re(t){return(await s$()).includes(t)}W.isValidCommunityPlatform=_re;async function a$(){return["windows"]}W.getKnownEnterprisePlatforms=a$;async function Ere(t){return(await a$()).includes(t)}W.isValidEnterprisePlatform=Ere;async function Cre(t,e,r){let{prompt:n}=await Promise.resolve().then(()=>gl.__importStar(Id()));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 X0(i)){let o=await J0();(0,Xs.fatal)(`Invalid platform: ${Ce.default.input(i)}.
179
179
  Valid platforms include: ${o.join(", ")}`)}return i}W.promptForPlatform=Cre;async function Sre(t,e){let{prompt:r}=await Promise.resolve().then(()=>gl.__importStar(Id())),n=t.filter(s=>s.id!==void 0);if(!e)return n.length===1?n[0]:(await r([{type:"select",name:"target",message:"Please choose a target device:",choices:n.map(a=>({title:`${u$(a)} (${a.id})`,value:a}))}],{onCancel:()=>process.exit(1)})).target;let i=e.trim(),o=t.find(s=>s.id===i);return o||(0,Xs.fatal)(`Invalid target ID: ${Ce.default.input(i)}.
180
180
  Valid targets are: ${t.map(s=>s.id).join(", ")}`),o}W.promptForPlatformTarget=Sre;function u$(t){var e,r,n;return`${(n=(r=(e=t.name)!==null&&e!==void 0?e:t.model)!==null&&r!==void 0?r:t.id)!==null&&n!==void 0?n:"?"}${t.virtual?` (${t.platform==="ios"?"simulator":"emulator"})`:""}`}W.getPlatformTargetName=u$;async function l$(t){let e=[];return await Yd(t,t.android.name)&&e.push(t.android.name),await Yd(t,t.ios.name)&&e.push(t.ios.name),e.push(t.web.name),e}W.getAddedPlatforms=l$;async function xre(t,e){let r=await Promise.resolve().then(()=>gl.__importStar(W0())),n=await o$(t),i=await Jd(t,e);(r.diff(n,i)==="minor"||r.diff(n,i)==="major")&&t$.logger.warn(`${Ce.default.strong("@capacitor/core")}${Ce.default.weak(`@${n}`)} version doesn't match ${Ce.default.strong(`@capacitor/${e}`)}${Ce.default.weak(`@${i}`)} version.
181
- Consider updating to a matching version, e.g. w/ ${Ce.default.input(`npm install @capacitor/core@${i}`)}`)}W.checkPlatformVersions=xre;function Fre(t,e){if(e[0]!=="@"){let n=(0,ml.resolveNode)(t.app.rootDir,`@capacitor/${e}`,"package.json");if(n)return(0,lo.dirname)(n);let i=(0,ml.resolveNode)(t.app.rootDir,`@capacitor-community/${e}`,"package.json");if(i)return(0,lo.dirname)(i);let o=(0,ml.resolveNode)(t.app.rootDir,`@ionic-enterprise/capacitor-${e}`,"package.json");if(o)return(0,lo.dirname)(o)}let r=(0,ml.resolveNode)(t.app.rootDir,e,"package.json");return r?(0,lo.dirname)(r):null}W.resolvePlatform=Fre;async function Ore(){try{let t=await(0,lre.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=Ore;function Are(t){let e=t.replace(/([A-Z])/g,"$1").toLowerCase();return`app-${e?`${e}-`:""}debug.apk`}W.parseApkNameFromFlavor=Are});var f$=y(Xd=>{"use strict";Object.defineProperty(Xd,"__esModule",{value:!0});Xd.tryFn=void 0;var kre=async(t,...e)=>{try{return await t(...e)}catch{}return null};Xd.tryFn=kre});var d$=y(Zd=>{"use strict";Object.defineProperty(Zd,"__esModule",{value:!0});Zd.formatJSObject=void 0;var Tre=(nr(),je(rr)),Pre=Tre.__importDefault(require("util"));function Rre(t){try{t=JSON.parse(JSON.stringify(t))}catch(e){throw new Error(`Cannot parse object as JSON: ${e.stack?e.stack:e}`)}return Pre.default.inspect(t,{compact:!1,breakLength:1/0,depth:1/0,maxArrayLength:1/0,maxStringLength:1/0})}Zd.formatJSObject=Rre});var h$=y(li=>{"use strict";Object.defineProperty(li,"__esModule",{value:!0});li.lazy=li.LazyPromise=li.allSerial=void 0;function $re(t){return t.reduce((e,r)=>e.then(n=>r().then(i=>n.concat(i))),Promise.resolve([]))}li.allSerial=$re;var Qd=class extends Promise{constructor(e){super(()=>{}),this._executor=e}then(e,r){return this._promise=this._promise||new Promise(this._executor),this._promise.then(e,r)}catch(e){return this._promise=this._promise||new Promise(this._executor),this._promise.catch(e)}};li.LazyPromise=Qd;function Ire(t){return new Qd(async(e,r)=>{try{e(await t())}catch(n){r(n)}})}li.lazy=Ire});var y$=y(yt=>{"use strict";Object.defineProperty(yt,"__esModule",{value:!0});yt.writeConfig=yt.loadConfig=yt.CONFIG_FILE_NAME_JSON=yt.CONFIG_FILE_NAME_JS=yt.CONFIG_FILE_NAME_TS=void 0;var Q0=(nr(),je(rr)),jre=Q0.__importDefault(Ly()),Yt=js(),ne=require("path"),co=Q0.__importDefault(Ns()),Nre=c$(),eh=yd(),Lre=Yu(),Z0=f$(),Bre=d$(),p$=rc(),m$=jd(),Zs=h$(),qre=Nd(),g$=(0,jre.default)("capacitor:config");yt.CONFIG_FILE_NAME_TS="capacitor.config.ts";yt.CONFIG_FILE_NAME_JS="capacitor.config.js";yt.CONFIG_FILE_NAME_JSON="capacitor.config.json";async function Mre(){var t,e,r,n;let i=process.cwd(),o=(0,ne.dirname)(__dirname),s=await zre(i),a=await(async()=>{var d,m;if((0,p$.isNXMonorepo)(i)){let b=(0,p$.findNXMonorepoRoot)(i),D=await(0,Z0.tryFn)(Yt.readJSON,(0,ne.resolve)(b,"package.json")),_=(d=D?.devDependencies)!==null&&d!==void 0?d:{},F=(m=D?.dependencies)!==null&&m!==void 0?m:{};return{devDependencies:_,dependencies:F}}return{}})(),u=(t=s.extConfig.appId)!==null&&t!==void 0?t:"",l=(e=s.extConfig.appName)!==null&&e!==void 0?e:"",c=(r=s.extConfig.webDir)!==null&&r!==void 0?r:"www",f=await Gre(o),h={android:await Wre(i,s.extConfig,f),ios:await Kre(i,s.extConfig),web:await Yre(i,c),cli:f,app:{rootDir:i,appId:u,appName:l,webDir:c,webDirAbs:(0,ne.resolve)(i,c),package:(n=await(0,Z0.tryFn)(Yt.readJSON,(0,ne.resolve)(i,"package.json")))!==null&&n!==void 0?n:{name:l,version:"1.0.0",...a},...s}};return g$("config: %O",h),h}yt.loadConfig=Mre;async function Ure(t,e){switch((0,ne.extname)(e)){case".json":{await(0,Yt.writeJSON)(e,t,{spaces:2});break}case".ts":{await(0,Yt.writeFile)(e,tne(t));break}}}yt.writeConfig=Ure;async function Hre(t,e,r){var n;try{let i=(0,m$.resolveNode)(t,"typescript");i||(0,eh.fatal)(`Could not find installation of TypeScript.
181
+ Consider updating to a matching version, e.g. w/ ${Ce.default.input(`npm install @capacitor/core@${i}`)}`)}W.checkPlatformVersions=xre;function Fre(t,e){if(e[0]!=="@"){let n=(0,ml.resolveNode)(t.app.rootDir,`@capacitor/${e}`,"package.json");if(n)return(0,lo.dirname)(n);let i=(0,ml.resolveNode)(t.app.rootDir,`@capacitor-community/${e}`,"package.json");if(i)return(0,lo.dirname)(i);let o=(0,ml.resolveNode)(t.app.rootDir,`@ionic-enterprise/capacitor-${e}`,"package.json");if(o)return(0,lo.dirname)(o)}let r=(0,ml.resolveNode)(t.app.rootDir,e,"package.json");return r?(0,lo.dirname)(r):null}W.resolvePlatform=Fre;async function Ore(){try{let t=await(0,lre.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=Ore;function Are(t){let e=t.replace(/([A-Z])/g,"$1").toLowerCase();return`app-${e?`${e}-`:""}debug.apk`}W.parseApkNameFromFlavor=Are});var f$=D(Xd=>{"use strict";Object.defineProperty(Xd,"__esModule",{value:!0});Xd.tryFn=void 0;var kre=async(t,...e)=>{try{return await t(...e)}catch{}return null};Xd.tryFn=kre});var d$=D(Zd=>{"use strict";Object.defineProperty(Zd,"__esModule",{value:!0});Zd.formatJSObject=void 0;var Tre=(nr(),je(rr)),Pre=Tre.__importDefault(require("util"));function Rre(t){try{t=JSON.parse(JSON.stringify(t))}catch(e){throw new Error(`Cannot parse object as JSON: ${e.stack?e.stack:e}`)}return Pre.default.inspect(t,{compact:!1,breakLength:1/0,depth:1/0,maxArrayLength:1/0,maxStringLength:1/0})}Zd.formatJSObject=Rre});var h$=D(li=>{"use strict";Object.defineProperty(li,"__esModule",{value:!0});li.lazy=li.LazyPromise=li.allSerial=void 0;function $re(t){return t.reduce((e,r)=>e.then(n=>r().then(i=>n.concat(i))),Promise.resolve([]))}li.allSerial=$re;var Qd=class extends Promise{constructor(e){super(()=>{}),this._executor=e}then(e,r){return this._promise=this._promise||new Promise(this._executor),this._promise.then(e,r)}catch(e){return this._promise=this._promise||new Promise(this._executor),this._promise.catch(e)}};li.LazyPromise=Qd;function Ire(t){return new Qd(async(e,r)=>{try{e(await t())}catch(n){r(n)}})}li.lazy=Ire});var y$=D(yt=>{"use strict";Object.defineProperty(yt,"__esModule",{value:!0});yt.writeConfig=yt.loadConfig=yt.CONFIG_FILE_NAME_JSON=yt.CONFIG_FILE_NAME_JS=yt.CONFIG_FILE_NAME_TS=void 0;var Q0=(nr(),je(rr)),jre=Q0.__importDefault(Ly()),Yt=js(),ne=require("path"),co=Q0.__importDefault(Ns()),Nre=c$(),eh=yd(),Lre=Yu(),Z0=f$(),Bre=d$(),p$=rc(),m$=jd(),Zs=h$(),qre=Nd(),g$=(0,jre.default)("capacitor:config");yt.CONFIG_FILE_NAME_TS="capacitor.config.ts";yt.CONFIG_FILE_NAME_JS="capacitor.config.js";yt.CONFIG_FILE_NAME_JSON="capacitor.config.json";async function Mre(){var t,e,r,n;let i=process.cwd(),o=(0,ne.dirname)(__dirname),s=await zre(i),a=await(async()=>{var d,m;if((0,p$.isNXMonorepo)(i)){let b=(0,p$.findNXMonorepoRoot)(i),y=await(0,Z0.tryFn)(Yt.readJSON,(0,ne.resolve)(b,"package.json")),E=(d=y?.devDependencies)!==null&&d!==void 0?d:{},F=(m=y?.dependencies)!==null&&m!==void 0?m:{};return{devDependencies:E,dependencies:F}}return{}})(),u=(t=s.extConfig.appId)!==null&&t!==void 0?t:"",l=(e=s.extConfig.appName)!==null&&e!==void 0?e:"",c=(r=s.extConfig.webDir)!==null&&r!==void 0?r:"www",f=await Gre(o),h={android:await Wre(i,s.extConfig,f),ios:await Kre(i,s.extConfig),web:await Yre(i,c),cli:f,app:{rootDir:i,appId:u,appName:l,webDir:c,webDirAbs:(0,ne.resolve)(i,c),package:(n=await(0,Z0.tryFn)(Yt.readJSON,(0,ne.resolve)(i,"package.json")))!==null&&n!==void 0?n:{name:l,version:"1.0.0",...a},...s}};return g$("config: %O",h),h}yt.loadConfig=Mre;async function Ure(t,e){switch((0,ne.extname)(e)){case".json":{await(0,Yt.writeJSON)(e,t,{spaces:2});break}case".ts":{await(0,Yt.writeFile)(e,tne(t));break}}}yt.writeConfig=Ure;async function Hre(t,e,r){var n;try{let i=(0,m$.resolveNode)(t,"typescript");i||(0,eh.fatal)(`Could not find installation of TypeScript.
182
182
  To use ${co.default.strong(e)} files, you must install TypeScript in your project, e.g. w/ ${co.default.input("npm install -D typescript")}`);let o=require(i),s=(0,m$.requireTS)(o,r),a=s.default?await s.default:s;return{extConfigType:"ts",extConfigName:e,extConfigFilePath:r,extConfig:a}}catch(i){throw(0,eh.isFatal)(i)||(0,eh.fatal)(`Parsing ${co.default.strong(e)} failed.
183
183
 
184
184
  ${(n=i.stack)!==null&&n!==void 0?n:i}`),i}}async function Vre(t,e,r){var n;try{return{extConfigType:"js",extConfigName:e,extConfigFilePath:r,extConfig:await require(r)}}catch(i){(0,eh.fatal)(`Parsing ${co.default.strong(e)} failed.
185
185
 
186
- ${(n=i.stack)!==null&&n!==void 0?n:i}`)}}async function zre(t){var e;let r=(0,ne.resolve)(t,yt.CONFIG_FILE_NAME_TS);if(await(0,Yt.pathExists)(r))return Hre(t,yt.CONFIG_FILE_NAME_TS,r);let n=(0,ne.resolve)(t,yt.CONFIG_FILE_NAME_JS);if(await(0,Yt.pathExists)(n))return Vre(t,yt.CONFIG_FILE_NAME_JS,n);let i=(0,ne.resolve)(t,yt.CONFIG_FILE_NAME_JSON);return{extConfigType:"json",extConfigName:yt.CONFIG_FILE_NAME_JSON,extConfigFilePath:i,extConfig:(e=await(0,Z0.tryFn)(Yt.readJSON,i))!==null&&e!==void 0?e:{}}}async function Gre(t){let e="assets",r=(0,ne.join)(t,e),n="ios-pods-template.tar.gz",i="capacitor-cordova-ios-plugins.tar.gz",o="android-template.tar.gz",s="capacitor-cordova-android-plugins.tar.gz";return{rootDir:t,assetsDir:e,assetsDirAbs:r,assets:{ios:{platformTemplateArchive:n,platformTemplateArchiveAbs:(0,ne.resolve)(r,n),cordovaPluginsTemplateArchive:i,cordovaPluginsTemplateArchiveAbs:(0,ne.resolve)(r,i)},android:{platformTemplateArchive:o,platformTemplateArchiveAbs:(0,ne.resolve)(r,o),cordovaPluginsTemplateArchive:s,cordovaPluginsTemplateArchiveAbs:(0,ne.resolve)(r,s)}},package:await(0,Yt.readJSON)((0,ne.resolve)(t,"package.json")),os:Jre(process.platform)}}async function Wre(t,e,r){var n,i,o,s,a,u,l,c,f,h,d,m,b,D,_,F,g;let C="android",A=(i=(n=e.android)===null||n===void 0?void 0:n.path)!==null&&i!==void 0?i:"android",T=(0,ne.resolve)(t,A),x="app",L=`${x}/src`,S=`${L}/main`,I=`${S}/assets`,$=`${I}/public`,B=`${S}/res`,q=`${x}/build/outputs/apk/`,K=((o=e.android)===null||o===void 0?void 0:o.flavor)||"";!((s=e.android)===null||s===void 0)&&s.flavor&&(q=`${q}/${(a=e.android)===null||a===void 0?void 0:a.flavor}`);let V=(0,Nre.parseApkNameFromFlavor)(K),E=`${q}/debug`,v="capacitor-cordova-android-plugins",w=(0,Zs.lazy)(()=>Qre(r.os)),O={keystorePath:(l=(u=e.android)===null||u===void 0?void 0:u.buildOptions)===null||l===void 0?void 0:l.keystorePath,keystorePassword:(f=(c=e.android)===null||c===void 0?void 0:c.buildOptions)===null||f===void 0?void 0:f.keystorePassword,keystoreAlias:(d=(h=e.android)===null||h===void 0?void 0:h.buildOptions)===null||d===void 0?void 0:d.keystoreAlias,keystoreAliasPassword:(b=(m=e.android)===null||m===void 0?void 0:m.buildOptions)===null||b===void 0?void 0:b.keystoreAliasPassword,signingType:(_=(D=e.android)===null||D===void 0?void 0:D.buildOptions)===null||_===void 0?void 0:_.signingType,releaseType:(g=(F=e.android)===null||F===void 0?void 0:F.buildOptions)===null||g===void 0?void 0:g.releaseType};return{name:C,minVersion:"23",studioPath:w,platformDir:A,platformDirAbs:T,cordovaPluginsDir:v,cordovaPluginsDirAbs:(0,ne.resolve)(T,v),appDir:x,appDirAbs:(0,ne.resolve)(T,x),srcDir:L,srcDirAbs:(0,ne.resolve)(T,L),srcMainDir:S,srcMainDirAbs:(0,ne.resolve)(T,S),assetsDir:I,assetsDirAbs:(0,ne.resolve)(T,I),webDir:$,webDirAbs:(0,ne.resolve)(T,$),resDir:B,resDirAbs:(0,ne.resolve)(T,B),apkName:V,buildOutputDir:E,buildOutputDirAbs:(0,ne.resolve)(T,E),flavor:K,buildOptions:O}}async function Kre(t,e){var r,n,i,o;let s="ios",a=(n=(r=e.ios)===null||r===void 0?void 0:r.path)!==null&&n!==void 0?n:"ios",u=(0,ne.resolve)(t,a),l=(o=(i=e.ios)===null||i===void 0?void 0:i.scheme)!==null&&o!==void 0?o:"App",c="App",f=(0,ne.resolve)(u,c),h=`${c}/App`,d=(0,ne.resolve)(u,h),m=`${c}/App.xcodeproj`,b=(0,ne.resolve)(u,m),D=(0,Zs.lazy)(()=>Xre(f)),_=(0,Zs.lazy)(()=>ene(t,u,f)),F=(0,Zs.lazy)(()=>Zre(f,d,b)),g="capacitor-cordova-ios-plugins";return{name:s,minVersion:"14.0",platformDir:a,platformDirAbs:u,scheme:l,cordovaPluginsDir:g,cordovaPluginsDirAbs:(0,ne.resolve)(u,g),nativeProjectDir:c,nativeProjectDirAbs:f,nativeTargetDir:h,nativeTargetDirAbs:d,nativeXcodeProjDir:m,nativeXcodeProjDirAbs:b,nativeXcodeWorkspaceDir:(0,Zs.lazy)(async()=>(0,ne.relative)(u,await D)),nativeXcodeWorkspaceDirAbs:D,webDir:(0,Zs.lazy)(async()=>(0,ne.relative)(u,await F)),webDirAbs:F,podPath:_}}async function Yre(t,e){let r=e,n=(0,ne.resolve)(t,r);return{name:"web",platformDir:r,platformDirAbs:n}}function Jre(t){switch(t){case"darwin":return"mac";case"win32":return"windows";case"linux":return"linux"}return"unknown"}async function Xre(t){return(0,ne.resolve)(t,"App.xcworkspace")}async function Zre(t,e,r){let n=/path\s=\spublic[\s\S]+?sourceTree\s=\s([^;]+)/,i=(0,ne.resolve)(r,"project.pbxproj");try{let s=(await(0,Yt.readFile)(i,{encoding:"utf8"})).match(n);if(s&&s[1]==="SOURCE_ROOT")return Lre.logger.warn(`Using the iOS project root for the ${co.default.strong("public")} directory is deprecated.
186
+ ${(n=i.stack)!==null&&n!==void 0?n:i}`)}}async function zre(t){var e;let r=(0,ne.resolve)(t,yt.CONFIG_FILE_NAME_TS);if(await(0,Yt.pathExists)(r))return Hre(t,yt.CONFIG_FILE_NAME_TS,r);let n=(0,ne.resolve)(t,yt.CONFIG_FILE_NAME_JS);if(await(0,Yt.pathExists)(n))return Vre(t,yt.CONFIG_FILE_NAME_JS,n);let i=(0,ne.resolve)(t,yt.CONFIG_FILE_NAME_JSON);return{extConfigType:"json",extConfigName:yt.CONFIG_FILE_NAME_JSON,extConfigFilePath:i,extConfig:(e=await(0,Z0.tryFn)(Yt.readJSON,i))!==null&&e!==void 0?e:{}}}async function Gre(t){let e="assets",r=(0,ne.join)(t,e),n="ios-pods-template.tar.gz",i="capacitor-cordova-ios-plugins.tar.gz",o="android-template.tar.gz",s="capacitor-cordova-android-plugins.tar.gz";return{rootDir:t,assetsDir:e,assetsDirAbs:r,assets:{ios:{platformTemplateArchive:n,platformTemplateArchiveAbs:(0,ne.resolve)(r,n),cordovaPluginsTemplateArchive:i,cordovaPluginsTemplateArchiveAbs:(0,ne.resolve)(r,i)},android:{platformTemplateArchive:o,platformTemplateArchiveAbs:(0,ne.resolve)(r,o),cordovaPluginsTemplateArchive:s,cordovaPluginsTemplateArchiveAbs:(0,ne.resolve)(r,s)}},package:await(0,Yt.readJSON)((0,ne.resolve)(t,"package.json")),os:Jre(process.platform)}}async function Wre(t,e,r){var n,i,o,s,a,u,l,c,f,h,d,m,b,y,E,F,g;let C="android",A=(i=(n=e.android)===null||n===void 0?void 0:n.path)!==null&&i!==void 0?i:"android",T=(0,ne.resolve)(t,A),x="app",L=`${x}/src`,S=`${L}/main`,I=`${S}/assets`,$=`${I}/public`,B=`${S}/res`,q=`${x}/build/outputs/apk/`,K=((o=e.android)===null||o===void 0?void 0:o.flavor)||"";!((s=e.android)===null||s===void 0)&&s.flavor&&(q=`${q}/${(a=e.android)===null||a===void 0?void 0:a.flavor}`);let V=(0,Nre.parseApkNameFromFlavor)(K),_=`${q}/debug`,v="capacitor-cordova-android-plugins",w=(0,Zs.lazy)(()=>Qre(r.os)),O={keystorePath:(l=(u=e.android)===null||u===void 0?void 0:u.buildOptions)===null||l===void 0?void 0:l.keystorePath,keystorePassword:(f=(c=e.android)===null||c===void 0?void 0:c.buildOptions)===null||f===void 0?void 0:f.keystorePassword,keystoreAlias:(d=(h=e.android)===null||h===void 0?void 0:h.buildOptions)===null||d===void 0?void 0:d.keystoreAlias,keystoreAliasPassword:(b=(m=e.android)===null||m===void 0?void 0:m.buildOptions)===null||b===void 0?void 0:b.keystoreAliasPassword,signingType:(E=(y=e.android)===null||y===void 0?void 0:y.buildOptions)===null||E===void 0?void 0:E.signingType,releaseType:(g=(F=e.android)===null||F===void 0?void 0:F.buildOptions)===null||g===void 0?void 0:g.releaseType};return{name:C,minVersion:"23",studioPath:w,platformDir:A,platformDirAbs:T,cordovaPluginsDir:v,cordovaPluginsDirAbs:(0,ne.resolve)(T,v),appDir:x,appDirAbs:(0,ne.resolve)(T,x),srcDir:L,srcDirAbs:(0,ne.resolve)(T,L),srcMainDir:S,srcMainDirAbs:(0,ne.resolve)(T,S),assetsDir:I,assetsDirAbs:(0,ne.resolve)(T,I),webDir:$,webDirAbs:(0,ne.resolve)(T,$),resDir:B,resDirAbs:(0,ne.resolve)(T,B),apkName:V,buildOutputDir:_,buildOutputDirAbs:(0,ne.resolve)(T,_),flavor:K,buildOptions:O}}async function Kre(t,e){var r,n,i,o;let s="ios",a=(n=(r=e.ios)===null||r===void 0?void 0:r.path)!==null&&n!==void 0?n:"ios",u=(0,ne.resolve)(t,a),l=(o=(i=e.ios)===null||i===void 0?void 0:i.scheme)!==null&&o!==void 0?o:"App",c="App",f=(0,ne.resolve)(u,c),h=`${c}/App`,d=(0,ne.resolve)(u,h),m=`${c}/App.xcodeproj`,b=(0,ne.resolve)(u,m),y=(0,Zs.lazy)(()=>Xre(f)),E=(0,Zs.lazy)(()=>ene(t,u,f)),F=(0,Zs.lazy)(()=>Zre(f,d,b)),g="capacitor-cordova-ios-plugins";return{name:s,minVersion:"14.0",platformDir:a,platformDirAbs:u,scheme:l,cordovaPluginsDir:g,cordovaPluginsDirAbs:(0,ne.resolve)(u,g),nativeProjectDir:c,nativeProjectDirAbs:f,nativeTargetDir:h,nativeTargetDirAbs:d,nativeXcodeProjDir:m,nativeXcodeProjDirAbs:b,nativeXcodeWorkspaceDir:(0,Zs.lazy)(async()=>(0,ne.relative)(u,await y)),nativeXcodeWorkspaceDirAbs:y,webDir:(0,Zs.lazy)(async()=>(0,ne.relative)(u,await F)),webDirAbs:F,podPath:E}}async function Yre(t,e){let r=e,n=(0,ne.resolve)(t,r);return{name:"web",platformDir:r,platformDirAbs:n}}function Jre(t){switch(t){case"darwin":return"mac";case"win32":return"windows";case"linux":return"linux"}return"unknown"}async function Xre(t){return(0,ne.resolve)(t,"App.xcworkspace")}async function Zre(t,e,r){let n=/path\s=\spublic[\s\S]+?sourceTree\s=\s([^;]+)/,i=(0,ne.resolve)(r,"project.pbxproj");try{let s=(await(0,Yt.readFile)(i,{encoding:"utf8"})).match(n);if(s&&s[1]==="SOURCE_ROOT")return Lre.logger.warn(`Using the iOS project root for the ${co.default.strong("public")} directory is deprecated.
187
187
  Please follow the Upgrade Guide to move ${co.default.strong("public")} inside the iOS target directory: ${co.default.strong("https://capacitorjs.com/docs/updating/3-0#move-public-into-the-ios-target-directory")}`),(0,ne.resolve)(t,"public")}catch{}return(0,ne.resolve)(e,"public")}async function Qre(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(()=>Q0.__importStar(Nd())),r="C:\\Program Files\\Android\\Android Studio\\bin\\studio64.exe";try{if(!await(0,Yt.pathExists)(r)){let n=await e("REG",["QUERY","HKEY_LOCAL_MACHINE\\SOFTWARE\\Android Studio","/v","Path"]);n=n.replace(/(\r\n|\n|\r)/gm,"");let i=n.indexOf("REG_SZ");i>0&&(r=n.substring(i+6).trim()+"\\bin\\studio64.exe")}}catch(n){g$("Error checking registry for Android Studio path: %O",n);break}return r}case"linux":return"/usr/local/android-studio/bin/studio.sh"}return""}async function ene(t,e,r){if(process.env.CAPACITOR_COCOAPODS_PATH)return process.env.CAPACITOR_COCOAPODS_PATH;let n="";if(await(0,Yt.pathExists)((0,ne.resolve)(t,"Gemfile"))?n=(0,ne.resolve)(t,"Gemfile"):await(0,Yt.pathExists)((0,ne.resolve)(e,"Gemfile"))?n=(0,ne.resolve)(e,"Gemfile"):await(0,Yt.pathExists)((0,ne.resolve)(r,"Gemfile"))&&(n=(0,ne.resolve)(r,"Gemfile")),!(n!=""))try{let o=await(0,qre.getCommandOutput)("git",["rev-parse","--show-toplevel"],{cwd:t});o!=null&&(n=(0,ne.resolve)(o,"Gemfile"))}catch{}try{let o=(await(0,Yt.readFile)(n)).toString();return o&&new RegExp(/gem\s+['"]cocoapods/).test(o)?"bundle exec pod":"pod"}catch{return"pod"}}function tne(t){return`import type { CapacitorConfig } from '@capacitor/cli';
188
188
 
189
189
  const config: CapacitorConfig = ${(0,Bre.formatJSObject)(t)};
190
190
 
191
191
  export default config;
192
192
  `}});function rne(){try{return tv.default.statSync("/.dockerenv"),!0}catch{return!1}}function nne(){try{return tv.default.readFileSync("/proc/self/cgroup","utf8").includes("docker")}catch{return!1}}function rv(){return ev===void 0&&(ev=rne()||nne()),ev}var tv,ev,v$=Ct(()=>{tv=ue(require("node:fs"),1)});function Qs(){return nv===void 0&&(nv=ine()||rv()),nv}var b$,nv,ine,iv=Ct(()=>{b$=ue(require("node:fs"),1);v$();ine=()=>{try{return b$.default.statSync("/run/.containerenv"),!0}catch{return!1}}});var ov,_$,E$,w$,Dl,C$=Ct(()=>{ov=ue(require("node:process"),1),_$=ue(require("node:os"),1),E$=ue(require("node:fs"),1);iv();w$=()=>{if(ov.default.platform!=="linux")return!1;if(_$.default.release().toLowerCase().includes("microsoft"))return!Qs();try{return E$.default.readFileSync("/proc/version","utf8").toLowerCase().includes("microsoft")?!Qs():!1}catch{return!1}},Dl=ov.default.env.__IS_WSL_TEST__?w$:w$()});function fo(t,e,r){let n=i=>Object.defineProperty(t,e,{value:i,enumerable:!0,writable:!0});return Object.defineProperty(t,e,{configurable:!0,enumerable:!0,get(){let i=r();return n(i),i},set(i){n(i)}}),t}var S$=Ct(()=>{});async function sv(){if(F$.default.platform!=="darwin")throw new Error("macOS only");let{stdout:t}=await one("defaults",["read","com.apple.LaunchServices/com.apple.launchservices.secure","LSHandlers"]);return/LSHandlerRoleAll = "(?!-)(?<id>[^"]+?)";\s+?LSHandlerURLScheme = (?:http|https);/.exec(t)?.groups.id??"com.apple.Safari"}var x$,F$,O$,one,A$=Ct(()=>{x$=require("node:util"),F$=ue(require("node:process"),1),O$=require("node:child_process"),one=(0,x$.promisify)(O$.execFile)});async function P$(t,{humanReadableOutput:e=!0}={}){if(k$.default.platform!=="darwin")throw new Error("macOS only");let r=e?[]:["-ss"],{stdout:n}=await sne("osascript",["-e",t,r]);return n.trim()}var k$,T$,av,sne,R$=Ct(()=>{k$=ue(require("node:process"),1),T$=require("node:util"),av=require("node:child_process"),sne=(0,T$.promisify)(av.execFile)});async function uv(t){return P$(`tell application "Finder" to set app_path to application file id "${t}" as string
193
- tell application "System Events" to get value of property list item "CFBundleName" of property list file (app_path & ":Contents:Info.plist")`)}var $$=Ct(()=>{R$()});async function lv(t=ane){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 th(`Cannot find Windows browser in stdout: ${JSON.stringify(e)}`);let{id:n}=r.groups,i=une[n];if(!i)throw new th(`Unknown browser ID: ${n}`);return i}var I$,j$,ane,une,th,N$=Ct(()=>{I$=require("node:util"),j$=require("node:child_process"),ane=(0,I$.promisify)(j$.execFile),une={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"}},th=class extends Error{}});async function cv(){if(rh.default.platform==="darwin"){let t=await sv();return{name:await uv(t),id:t}}if(rh.default.platform==="linux"){let{stdout:t}=await lne("xdg-mime",["query","default","x-scheme-handler/http"]),e=t.trim();return{name:cne(e.replace(/.desktop$/,"").replace("-"," ")),id:e}}if(rh.default.platform==="win32")return lv();throw new Error("Only macOS, Linux, and Windows are supported")}var L$,rh,B$,lne,cne,q$=Ct(()=>{L$=require("node:util"),rh=ue(require("node:process"),1),B$=require("node:child_process");A$();$$();N$();lne=(0,L$.promisify)(B$.execFile),cne=t=>t.toLowerCase().replaceAll(/(?:^|\s|-)\S/g,e=>e.toUpperCase())});var pv={};gi(pv,{apps:()=>po,default:()=>pne,openApp:()=>hne});function V$(t){if(typeof t=="string"||Array.isArray(t))return t;let{[U$]:e}=t;if(!e)throw new Error(`${U$} is not supported`);return e}function hv({[ea]:t},{wsl:e}){if(e&&Dl)return V$(e);if(!t)throw new Error(`${ea} is not supported`);return V$(t)}var vl,z$,dv,G$,W$,ho,mne,fv,M$,ea,U$,fne,H$,bl,dne,hne,po,pne,mv=Ct(()=>{vl=ue(require("node:process"),1),z$=require("node:buffer"),dv=ue(require("node:path"),1),G$=require("node:url"),W$=ue(require("node:child_process"),1),ho=ue(require("node:fs/promises"),1);C$();S$();q$();iv();mne={},fv=dv.default.dirname((0,G$.fileURLToPath)(mne.url)),M$=dv.default.join(fv,"xdg-open"),{platform:ea,arch:U$}=vl.default,fne=(()=>{let t="/mnt/",e;return async function(){if(e)return e;let r="/etc/wsl.conf",n=!1;try{await ho.default.access(r,ho.constants.F_OK),n=!0}catch{}if(!n)return t;let i=await ho.default.readFile(r,{encoding:"utf8"}),o=/(?<!#.*)root\s*=\s*(?<mountPoint>.*)/g.exec(i);return o?(e=o.groups.mountPoint.trim(),e=e.endsWith("/")?e:`${e}/`,e):t}})(),H$=async(t,e)=>{let r;for(let n of t)try{return await e(n)}catch(i){r=i}throw r},bl=async t=>{if(t={wait:!1,background:!1,newInstance:!1,allowNonzeroExitCode:!1,...t},Array.isArray(t.app))return H$(t.app,a=>bl({...t,app:a}));let{name:e,arguments:r=[]}=t.app??{};if(r=[...r],Array.isArray(e))return H$(e,a=>bl({...t,app:{name:a,arguments:r}}));if(e==="browser"||e==="browserPrivate"){let a={"com.google.chrome":"chrome","google-chrome.desktop":"chrome","org.mozilla.firefox":"firefox","firefox.desktop":"firefox","com.microsoft.msedge":"edge","com.microsoft.edge":"edge","microsoft-edge.desktop":"edge"},u={chrome:"--incognito",firefox:"--private-window",edge:"--inPrivate"},l=await cv();if(l.id in a){let c=a[l.id];return e==="browserPrivate"&&r.push(u[c]),bl({...t,app:{name:po[c],arguments:r}})}throw new Error(`${l.name} is not supported as a default browser`)}let n,i=[],o={};if(ea==="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(ea==="win32"||Dl&&!Qs()&&!e){let a=await fne();n=Dl?`${a}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe`:`${vl.default.env.SYSTEMROOT||vl.default.env.windir||"C:\\Windows"}\\System32\\WindowsPowerShell\\v1.0\\powershell`,i.push("-NoProfile","-NonInteractive","-ExecutionPolicy","Bypass","-EncodedCommand"),Dl||(o.windowsVerbatimArguments=!0);let u=["Start"];t.wait&&u.push("-Wait"),e?(u.push(`"\`"${e}\`""`),t.target&&r.push(t.target)):t.target&&u.push(`"${t.target}"`),r.length>0&&(r=r.map(l=>`"\`"${l}\`""`),u.push("-ArgumentList",r.join(","))),t.target=z$.Buffer.from(u.join(" "),"utf16le").toString("base64")}else{if(e)n=e;else{let a=!fv||fv==="/",u=!1;try{await ho.default.access(M$,ho.constants.X_OK),u=!0}catch{}n=vl.default.versions.electron??(ea==="android"||a||!u)?"xdg-open":M$}r.length>0&&i.push(...r),t.wait||(o.stdio="ignore",o.detached=!0)}ea==="darwin"&&r.length>0&&i.push("--args",...r),t.target&&i.push(t.target);let s=W$.default.spawn(n,i,o);return t.wait?new Promise((a,u)=>{s.once("error",u),s.once("close",l=>{if(!t.allowNonzeroExitCode&&l>0){u(new Error(`Exited with code ${l}`));return}a(s)})}):(s.unref(),s)},dne=(t,e)=>{if(typeof t!="string")throw new TypeError("Expected a `target`");return bl({...e,target:t})},hne=(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 bl({...e,app:{name:t,arguments:r}})};po={};fo(po,"chrome",()=>hv({darwin:"google chrome",win32:"chrome",linux:["google-chrome","google-chrome-stable","chromium"]},{wsl:{ia32:"/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe",x64:["/mnt/c/Program Files/Google/Chrome/Application/chrome.exe","/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe"]}}));fo(po,"firefox",()=>hv({darwin:"firefox",win32:"C:\\Program Files\\Mozilla Firefox\\firefox.exe",linux:"firefox"},{wsl:"/mnt/c/Program Files/Mozilla Firefox/firefox.exe"}));fo(po,"edge",()=>hv({darwin:"microsoft edge",win32:"msedge",linux:["microsoft-edge","microsoft-edge-dev"]},{wsl:"/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe"}));fo(po,"browser",()=>"browser");fo(po,"browserPrivate",()=>"browserPrivate");pne=dne});var CI=y(go=>{go.parse=go.decode=Fne;go.stringify=go.encode=wI;go.safe=ua;go.unsafe=dh;var Ev=typeof process<"u"&&process.platform==="win32"?`\r
193
+ tell application "System Events" to get value of property list item "CFBundleName" of property list file (app_path & ":Contents:Info.plist")`)}var $$=Ct(()=>{R$()});async function lv(t=ane){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 th(`Cannot find Windows browser in stdout: ${JSON.stringify(e)}`);let{id:n}=r.groups,i=une[n];if(!i)throw new th(`Unknown browser ID: ${n}`);return i}var I$,j$,ane,une,th,N$=Ct(()=>{I$=require("node:util"),j$=require("node:child_process"),ane=(0,I$.promisify)(j$.execFile),une={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"}},th=class extends Error{}});async function cv(){if(rh.default.platform==="darwin"){let t=await sv();return{name:await uv(t),id:t}}if(rh.default.platform==="linux"){let{stdout:t}=await lne("xdg-mime",["query","default","x-scheme-handler/http"]),e=t.trim();return{name:cne(e.replace(/.desktop$/,"").replace("-"," ")),id:e}}if(rh.default.platform==="win32")return lv();throw new Error("Only macOS, Linux, and Windows are supported")}var L$,rh,B$,lne,cne,q$=Ct(()=>{L$=require("node:util"),rh=ue(require("node:process"),1),B$=require("node:child_process");A$();$$();N$();lne=(0,L$.promisify)(B$.execFile),cne=t=>t.toLowerCase().replaceAll(/(?:^|\s|-)\S/g,e=>e.toUpperCase())});var pv={};gi(pv,{apps:()=>po,default:()=>pne,openApp:()=>hne});function V$(t){if(typeof t=="string"||Array.isArray(t))return t;let{[U$]:e}=t;if(!e)throw new Error(`${U$} is not supported`);return e}function hv({[ea]:t},{wsl:e}){if(e&&Dl)return V$(e);if(!t)throw new Error(`${ea} is not supported`);return V$(t)}var vl,z$,dv,G$,W$,ho,mne,fv,M$,ea,U$,fne,H$,bl,dne,hne,po,pne,mv=Ct(()=>{vl=ue(require("node:process"),1),z$=require("node:buffer"),dv=ue(require("node:path"),1),G$=require("node:url"),W$=ue(require("node:child_process"),1),ho=ue(require("node:fs/promises"),1);C$();S$();q$();iv();mne={},fv=dv.default.dirname((0,G$.fileURLToPath)(mne.url)),M$=dv.default.join(fv,"xdg-open"),{platform:ea,arch:U$}=vl.default,fne=(()=>{let t="/mnt/",e;return async function(){if(e)return e;let r="/etc/wsl.conf",n=!1;try{await ho.default.access(r,ho.constants.F_OK),n=!0}catch{}if(!n)return t;let i=await ho.default.readFile(r,{encoding:"utf8"}),o=/(?<!#.*)root\s*=\s*(?<mountPoint>.*)/g.exec(i);return o?(e=o.groups.mountPoint.trim(),e=e.endsWith("/")?e:`${e}/`,e):t}})(),H$=async(t,e)=>{let r;for(let n of t)try{return await e(n)}catch(i){r=i}throw r},bl=async t=>{if(t={wait:!1,background:!1,newInstance:!1,allowNonzeroExitCode:!1,...t},Array.isArray(t.app))return H$(t.app,a=>bl({...t,app:a}));let{name:e,arguments:r=[]}=t.app??{};if(r=[...r],Array.isArray(e))return H$(e,a=>bl({...t,app:{name:a,arguments:r}}));if(e==="browser"||e==="browserPrivate"){let a={"com.google.chrome":"chrome","google-chrome.desktop":"chrome","org.mozilla.firefox":"firefox","firefox.desktop":"firefox","com.microsoft.msedge":"edge","com.microsoft.edge":"edge","microsoft-edge.desktop":"edge"},u={chrome:"--incognito",firefox:"--private-window",edge:"--inPrivate"},l=await cv();if(l.id in a){let c=a[l.id];return e==="browserPrivate"&&r.push(u[c]),bl({...t,app:{name:po[c],arguments:r}})}throw new Error(`${l.name} is not supported as a default browser`)}let n,i=[],o={};if(ea==="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(ea==="win32"||Dl&&!Qs()&&!e){let a=await fne();n=Dl?`${a}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe`:`${vl.default.env.SYSTEMROOT||vl.default.env.windir||"C:\\Windows"}\\System32\\WindowsPowerShell\\v1.0\\powershell`,i.push("-NoProfile","-NonInteractive","-ExecutionPolicy","Bypass","-EncodedCommand"),Dl||(o.windowsVerbatimArguments=!0);let u=["Start"];t.wait&&u.push("-Wait"),e?(u.push(`"\`"${e}\`""`),t.target&&r.push(t.target)):t.target&&u.push(`"${t.target}"`),r.length>0&&(r=r.map(l=>`"\`"${l}\`""`),u.push("-ArgumentList",r.join(","))),t.target=z$.Buffer.from(u.join(" "),"utf16le").toString("base64")}else{if(e)n=e;else{let a=!fv||fv==="/",u=!1;try{await ho.default.access(M$,ho.constants.X_OK),u=!0}catch{}n=vl.default.versions.electron??(ea==="android"||a||!u)?"xdg-open":M$}r.length>0&&i.push(...r),t.wait||(o.stdio="ignore",o.detached=!0)}ea==="darwin"&&r.length>0&&i.push("--args",...r),t.target&&i.push(t.target);let s=W$.default.spawn(n,i,o);return t.wait?new Promise((a,u)=>{s.once("error",u),s.once("close",l=>{if(!t.allowNonzeroExitCode&&l>0){u(new Error(`Exited with code ${l}`));return}a(s)})}):(s.unref(),s)},dne=(t,e)=>{if(typeof t!="string")throw new TypeError("Expected a `target`");return bl({...e,target:t})},hne=(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 bl({...e,app:{name:t,arguments:r}})};po={};fo(po,"chrome",()=>hv({darwin:"google chrome",win32:"chrome",linux:["google-chrome","google-chrome-stable","chromium"]},{wsl:{ia32:"/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe",x64:["/mnt/c/Program Files/Google/Chrome/Application/chrome.exe","/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe"]}}));fo(po,"firefox",()=>hv({darwin:"firefox",win32:"C:\\Program Files\\Mozilla Firefox\\firefox.exe",linux:"firefox"},{wsl:"/mnt/c/Program Files/Mozilla Firefox/firefox.exe"}));fo(po,"edge",()=>hv({darwin:"microsoft edge",win32:"msedge",linux:["microsoft-edge","microsoft-edge-dev"]},{wsl:"/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe"}));fo(po,"browser",()=>"browser");fo(po,"browserPrivate",()=>"browserPrivate");pne=dne});var CI=D(go=>{go.parse=go.decode=Fne;go.stringify=go.encode=wI;go.safe=ua;go.unsafe=dh;var Ev=typeof process<"u"&&process.platform==="win32"?`\r
194
194
  `:`
195
195
  `;function wI(t,e){var r=[],n="";typeof e=="string"?e={section:e,whitespace:!1}:(e=e||{},e.whitespace=e.whitespace===!0);var i=e.whitespace?" = ":"=";return Object.keys(t).forEach(function(o,s,a){var u=t[o];u&&Array.isArray(u)?u.forEach(function(l){n+=ua(o+"[]")+i+ua(l)+`
196
- `}):u&&typeof u=="object"?r.push(o):n+=ua(o)+i+ua(u)+Ev}),e.section&&n.length&&(n="["+ua(e.section)+"]"+Ev+n),r.forEach(function(o,s,a){var u=_I(o).join("\\."),l=(e.section?e.section+".":"")+u,c=wI(t[o],{section:l,whitespace:e.whitespace});n.length&&c.length&&(n+=Ev),n+=c}),n}function _I(t){return t.replace(/\1/g,"LITERAL\\1LITERAL").replace(/\\\./g,"").split(/\./).map(function(e){return e.replace(/\1/g,"\\.").replace(/\2LITERAL\\1LITERAL\2/g,"")})}function Fne(t){var e={},r=e,n=null,i=/^\[([^\]]*)\]$|^([^=]+)(=(.*))?$/i,o=t.split(/[\r\n]+/g);return o.forEach(function(s,a,u){if(!(!s||s.match(/^\s*[;#]/))){var l=s.match(i);if(l){if(l[1]!==void 0){if(n=dh(l[1]),n==="__proto__"){r={};return}r=e[n]=e[n]||{};return}var c=dh(l[2]);if(c!=="__proto__"){var f=l[3]?dh(l[4]):!0;switch(f){case"true":case"false":case"null":f=JSON.parse(f)}if(c.length>2&&c.slice(-2)==="[]"){if(c=c.substring(0,c.length-2),c==="__proto__")return;r[c]?Array.isArray(r[c])||(r[c]=[r[c]]):r[c]=[]}Array.isArray(r[c])?r[c].push(f):r[c]=f}}}}),Object.keys(e).filter(function(s,a,u){if(!e[s]||typeof e[s]!="object"||Array.isArray(e[s]))return!1;var l=_I(s),c=e,f=l.pop(),h=f.replace(/\\\./g,".");return l.forEach(function(d,m,b){d!=="__proto__"&&((!c[d]||typeof c[d]!="object")&&(c[d]={}),c=c[d])}),c===e&&h===f?!1:(c[h]=e[s],!0)}).forEach(function(s,a,u){delete e[s]}),e}function EI(t){return t.charAt(0)==='"'&&t.slice(-1)==='"'||t.charAt(0)==="'"&&t.slice(-1)==="'"}function ua(t){return typeof t!="string"||t.match(/[=\r\n]/)||t.match(/^\[/)||t.length>1&&EI(t)||t!==t.trim()?JSON.stringify(t):t.replace(/;/g,"\\;").replace(/#/g,"\\#")}function dh(t,e){if(t=(t||"").trim(),EI(t)){t.charAt(0)==="'"&&(t=t.substr(1,t.length-2));try{t=JSON.parse(t)}catch{}}else{for(var r=!1,n="",i=0,o=t.length;i<o;i++){var s=t.charAt(i);if(r)"\\;#".indexOf(s)!==-1?n+=s:n+="\\"+s,r=!1;else{if(";#".indexOf(s)!==-1)break;s==="\\"?r=!0:n+=s}}return r&&(n+="\\"),n.trim()}return t}});var FI=y((Yhe,xI)=>{"use strict";var Cv=1,SI=2;function One(){return""}function Ane(t,e,r){return t.slice(e,r).replace(/\S/g," ")}xI.exports=function(t,e){e=e||{};for(var r,n,i=!1,o=!1,s=0,a="",u=e.whitespace===!1?One:Ane,l=0;l<t.length;l++){if(r=t[l],n=t[l+1],!o&&r==='"'){var c=t[l-1]==="\\"&&t[l-2]!=="\\";c||(i=!i)}if(!i){if(!o&&r+n==="//")a+=t.slice(s,l),s=l,o=Cv,l++;else if(o===Cv&&r+n===`\r
196
+ `}):u&&typeof u=="object"?r.push(o):n+=ua(o)+i+ua(u)+Ev}),e.section&&n.length&&(n="["+ua(e.section)+"]"+Ev+n),r.forEach(function(o,s,a){var u=_I(o).join("\\."),l=(e.section?e.section+".":"")+u,c=wI(t[o],{section:l,whitespace:e.whitespace});n.length&&c.length&&(n+=Ev),n+=c}),n}function _I(t){return t.replace(/\1/g,"LITERAL\\1LITERAL").replace(/\\\./g,"").split(/\./).map(function(e){return e.replace(/\1/g,"\\.").replace(/\2LITERAL\\1LITERAL\2/g,"")})}function Fne(t){var e={},r=e,n=null,i=/^\[([^\]]*)\]$|^([^=]+)(=(.*))?$/i,o=t.split(/[\r\n]+/g);return o.forEach(function(s,a,u){if(!(!s||s.match(/^\s*[;#]/))){var l=s.match(i);if(l){if(l[1]!==void 0){if(n=dh(l[1]),n==="__proto__"){r={};return}r=e[n]=e[n]||{};return}var c=dh(l[2]);if(c!=="__proto__"){var f=l[3]?dh(l[4]):!0;switch(f){case"true":case"false":case"null":f=JSON.parse(f)}if(c.length>2&&c.slice(-2)==="[]"){if(c=c.substring(0,c.length-2),c==="__proto__")return;r[c]?Array.isArray(r[c])||(r[c]=[r[c]]):r[c]=[]}Array.isArray(r[c])?r[c].push(f):r[c]=f}}}}),Object.keys(e).filter(function(s,a,u){if(!e[s]||typeof e[s]!="object"||Array.isArray(e[s]))return!1;var l=_I(s),c=e,f=l.pop(),h=f.replace(/\\\./g,".");return l.forEach(function(d,m,b){d!=="__proto__"&&((!c[d]||typeof c[d]!="object")&&(c[d]={}),c=c[d])}),c===e&&h===f?!1:(c[h]=e[s],!0)}).forEach(function(s,a,u){delete e[s]}),e}function EI(t){return t.charAt(0)==='"'&&t.slice(-1)==='"'||t.charAt(0)==="'"&&t.slice(-1)==="'"}function ua(t){return typeof t!="string"||t.match(/[=\r\n]/)||t.match(/^\[/)||t.length>1&&EI(t)||t!==t.trim()?JSON.stringify(t):t.replace(/;/g,"\\;").replace(/#/g,"\\#")}function dh(t,e){if(t=(t||"").trim(),EI(t)){t.charAt(0)==="'"&&(t=t.substr(1,t.length-2));try{t=JSON.parse(t)}catch{}}else{for(var r=!1,n="",i=0,o=t.length;i<o;i++){var s=t.charAt(i);if(r)"\\;#".indexOf(s)!==-1?n+=s:n+="\\"+s,r=!1;else{if(";#".indexOf(s)!==-1)break;s==="\\"?r=!0:n+=s}}return r&&(n+="\\"),n.trim()}return t}});var FI=D((Yhe,xI)=>{"use strict";var Cv=1,SI=2;function One(){return""}function Ane(t,e,r){return t.slice(e,r).replace(/\S/g," ")}xI.exports=function(t,e){e=e||{};for(var r,n,i=!1,o=!1,s=0,a="",u=e.whitespace===!1?One:Ane,l=0;l<t.length;l++){if(r=t[l],n=t[l+1],!o&&r==='"'){var c=t[l-1]==="\\"&&t[l-2]!=="\\";c||(i=!i)}if(!i){if(!o&&r+n==="//")a+=t.slice(s,l),s=l,o=Cv,l++;else if(o===Cv&&r+n===`\r
197
197
  `){l++,o=!1,a+=u(t,s,l),s=l;continue}else if(o===Cv&&r===`
198
- `)o=!1,a+=u(t,s,l),s=l;else if(!o&&r+n==="/*"){a+=t.slice(s,l),s=l,o=SI,l++;continue}else if(o===SI&&r+n==="*/"){l++,o=!1,a+=u(t,s,l+1),s=l+1;continue}}}return a+(o?u(t.substr(s)):t.substr(s))}});var AI=y(la=>{"use strict";var OI=require("fs"),kne=CI(),El=require("path"),Tne=FI(),Pne=la.parse=function(t){return/^\s*{/.test(t)?JSON.parse(Tne(t)):kne.parse(t)},Rne=la.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=El.join.apply(null,t),n;try{return OI.readFileSync(r,"utf-8")}catch{return}},Jhe=la.json=function(){var t=Rne.apply(null,arguments);return t?Pne(t):null},Xhe=la.env=function(t,e){e=e||process.env;var r={},n=t.length;for(var i in e)if(i.toLowerCase().indexOf(t.toLowerCase())===0){for(var o=i.substring(n).split("__"),s;(s=o.indexOf(""))>-1;)o.splice(s,1);var a=r;o.forEach(function(l,c){!l||typeof a!="object"||(c===o.length-1&&(a[l]=e[i]),a[l]===void 0&&(a[l]={}),a=a[l])})}return r},Zhe=la.find=function(){var t=El.join.apply(null,[].slice.call(arguments));function e(r,n){var i=El.join(r,n);try{return OI.statSync(i),i}catch{if(El.dirname(r)!==r)return e(El.dirname(r),n)}}return e(process.cwd(),t)}});var II=y((epe,$I)=>{"use strict";function TI(t){return t instanceof Buffer||t instanceof Date||t instanceof RegExp}function PI(t){if(t instanceof Buffer){var e=Buffer.alloc?Buffer.alloc(t.length):new Buffer(t.length);return t.copy(e),e}else{if(t instanceof Date)return new Date(t.getTime());if(t instanceof RegExp)return new RegExp(t);throw new Error("Unexpected situation")}}function RI(t){var e=[];return t.forEach(function(r,n){typeof r=="object"&&r!==null?Array.isArray(r)?e[n]=RI(r):TI(r)?e[n]=PI(r):e[n]=Sv({},r):e[n]=r}),e}function kI(t,e){return e==="__proto__"?void 0:t[e]}var Sv=$I.exports=function(){if(arguments.length<1||typeof arguments[0]!="object")return!1;if(arguments.length<2)return arguments[0];var t=arguments[0],e=Array.prototype.slice.call(arguments,1),r,n,i;return e.forEach(function(o){typeof o!="object"||o===null||Array.isArray(o)||Object.keys(o).forEach(function(s){if(n=kI(t,s),r=kI(o,s),r!==t)if(typeof r!="object"||r===null){t[s]=r;return}else if(Array.isArray(r)){t[s]=RI(r);return}else if(TI(r)){t[s]=PI(r);return}else if(typeof n!="object"||n===null||Array.isArray(n)){t[s]=Sv({},r);return}else{t[s]=Sv(n,r);return}})}),t}});var BI=y((tpe,LI)=>{"use strict";function $ne(t,e){var r=t;e.slice(0,-1).forEach(function(i){r=r[i]||{}});var n=e[e.length-1];return n in r}function jI(t){return typeof t=="number"||/^0x[0-9a-f]+$/i.test(t)?!0:/^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(t)}function NI(t,e){return e==="constructor"&&typeof t[e]=="function"||e==="__proto__"}LI.exports=function(t,e){e||(e={});var r={bools:{},strings:{},unknownFn:null};typeof e.unknown=="function"&&(r.unknownFn=e.unknown),typeof e.boolean=="boolean"&&e.boolean?r.allBools=!0:[].concat(e.boolean).filter(Boolean).forEach(function(C){r.bools[C]=!0});var n={};function i(C){return n[C].some(function(A){return r.bools[A]})}Object.keys(e.alias||{}).forEach(function(C){n[C]=[].concat(e.alias[C]),n[C].forEach(function(A){n[A]=[C].concat(n[C].filter(function(T){return A!==T}))})}),[].concat(e.string).filter(Boolean).forEach(function(C){r.strings[C]=!0,n[C]&&[].concat(n[C]).forEach(function(A){r.strings[A]=!0})});var o=e.default||{},s={_:[]};function a(C,A){return r.allBools&&/^--[^=]+$/.test(A)||r.strings[C]||r.bools[C]||n[C]}function u(C,A,T){for(var x=C,L=0;L<A.length-1;L++){var S=A[L];if(NI(x,S))return;x[S]===void 0&&(x[S]={}),(x[S]===Object.prototype||x[S]===Number.prototype||x[S]===String.prototype)&&(x[S]={}),x[S]===Array.prototype&&(x[S]=[]),x=x[S]}var I=A[A.length-1];NI(x,I)||((x===Object.prototype||x===Number.prototype||x===String.prototype)&&(x={}),x===Array.prototype&&(x=[]),x[I]===void 0||r.bools[I]||typeof x[I]=="boolean"?x[I]=T:Array.isArray(x[I])?x[I].push(T):x[I]=[x[I],T])}function l(C,A,T){if(!(T&&r.unknownFn&&!a(C,T)&&r.unknownFn(T)===!1)){var x=!r.strings[C]&&jI(A)?Number(A):A;u(s,C.split("."),x),(n[C]||[]).forEach(function(L){u(s,L.split("."),x)})}}Object.keys(r.bools).forEach(function(C){l(C,o[C]===void 0?!1:o[C])});var c=[];t.indexOf("--")!==-1&&(c=t.slice(t.indexOf("--")+1),t=t.slice(0,t.indexOf("--")));for(var f=0;f<t.length;f++){var h=t[f],d,m;if(/^--.+=/.test(h)){var b=h.match(/^--([^=]+)=([\s\S]*)$/);d=b[1];var D=b[2];r.bools[d]&&(D=D!=="false"),l(d,D,h)}else if(/^--no-.+/.test(h))d=h.match(/^--no-(.+)/)[1],l(d,!1,h);else if(/^--.+/.test(h))d=h.match(/^--(.+)/)[1],m=t[f+1],m!==void 0&&!/^(-|--)[^-]/.test(m)&&!r.bools[d]&&!r.allBools&&(!n[d]||!i(d))?(l(d,m,h),f+=1):/^(true|false)$/.test(m)?(l(d,m==="true",h),f+=1):l(d,r.strings[d]?"":!0,h);else if(/^-[^-]+/.test(h)){for(var _=h.slice(1,-1).split(""),F=!1,g=0;g<_.length;g++){if(m=h.slice(g+2),m==="-"){l(_[g],m,h);continue}if(/[A-Za-z]/.test(_[g])&&m[0]==="="){l(_[g],m.slice(1),h),F=!0;break}if(/[A-Za-z]/.test(_[g])&&/-?\d+(\.\d*)?(e-?\d+)?$/.test(m)){l(_[g],m,h),F=!0;break}if(_[g+1]&&_[g+1].match(/\W/)){l(_[g],h.slice(g+2),h),F=!0;break}else l(_[g],r.strings[_[g]]?"":!0,h)}d=h.slice(-1)[0],!F&&d!=="-"&&(t[f+1]&&!/^(-|--)[^-]/.test(t[f+1])&&!r.bools[d]&&(!n[d]||!i(d))?(l(d,t[f+1],h),f+=1):t[f+1]&&/^(true|false)$/.test(t[f+1])?(l(d,t[f+1]==="true",h),f+=1):l(d,r.strings[d]?"":!0,h))}else if((!r.unknownFn||r.unknownFn(h)!==!1)&&s._.push(r.strings._||!jI(h)?h:Number(h)),e.stopEarly){s._.push.apply(s._,t.slice(f+1));break}}return Object.keys(o).forEach(function(C){$ne(s,C.split("."))||(u(s,C.split("."),o[C]),(n[C]||[]).forEach(function(A){u(s,A.split("."),o[C])}))}),e["--"]?s["--"]=c.slice():c.forEach(function(C){s._.push(C)}),s}});var HI=y((rpe,UI)=>{var Cl=AI(),ca=require("path").join,Ine=II(),qI="/etc",MI=process.platform==="win32",Sl=MI?process.env.USERPROFILE:process.env.HOME;UI.exports=function(t,e,r,n){if(typeof t!="string")throw new Error("rc(name): name *must* be string");r||(r=BI()(process.argv.slice(2))),e=(typeof e=="string"?Cl.json(e):e)||{},n=n||Cl.parse;var i=Cl.env(t+"_"),o=[e],s=[];function a(u){if(!(s.indexOf(u)>=0)){var l=Cl.file(u);l&&(o.push(n(l)),s.push(u))}}return MI||[ca(qI,t,"config"),ca(qI,t+"rc")].forEach(a),Sl&&[ca(Sl,".config",t,"config"),ca(Sl,".config",t),ca(Sl,"."+t,"config"),ca(Sl,"."+t+"rc")].forEach(a),a(Cl.find("."+t+"rc")),i.config&&a(i.config),r.config&&a(r.config),Ine.apply(null,o.concat([i,r,s.length?{configs:s,config:s[s.length-1]}:void 0]))}});var GI=y((ipe,zI)=>{var fi=require("constants"),jne=process.cwd,hh=null,Nne=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return hh||(hh=jne.call(process)),hh};try{process.cwd()}catch{}typeof process.chdir=="function"&&(Fv=process.chdir,process.chdir=function(t){hh=null,Fv.call(process,t)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,Fv));var Fv;zI.exports=Lne;function Lne(t){fi.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&e(t),t.lutimes||r(t),t.chown=o(t.chown),t.fchown=o(t.fchown),t.lchown=o(t.lchown),t.chmod=n(t.chmod),t.fchmod=n(t.fchmod),t.lchmod=n(t.lchmod),t.chownSync=s(t.chownSync),t.fchownSync=s(t.fchownSync),t.lchownSync=s(t.lchownSync),t.chmodSync=i(t.chmodSync),t.fchmodSync=i(t.fchmodSync),t.lchmodSync=i(t.lchmodSync),t.stat=a(t.stat),t.fstat=a(t.fstat),t.lstat=a(t.lstat),t.statSync=u(t.statSync),t.fstatSync=u(t.fstatSync),t.lstatSync=u(t.lstatSync),t.chmod&&!t.lchmod&&(t.lchmod=function(c,f,h){h&&process.nextTick(h)},t.lchmodSync=function(){}),t.chown&&!t.lchown&&(t.lchown=function(c,f,h,d){d&&process.nextTick(d)},t.lchownSync=function(){}),Nne==="win32"&&(t.rename=typeof t.rename!="function"?t.rename:function(c){function f(h,d,m){var b=Date.now(),D=0;c(h,d,function _(F){if(F&&(F.code==="EACCES"||F.code==="EPERM")&&Date.now()-b<6e4){setTimeout(function(){t.stat(d,function(g,C){g&&g.code==="ENOENT"?c(h,d,_):m(F)})},D),D<100&&(D+=10);return}m&&m(F)})}return Object.setPrototypeOf&&Object.setPrototypeOf(f,c),f}(t.rename)),t.read=typeof t.read!="function"?t.read:function(c){function f(h,d,m,b,D,_){var F;if(_&&typeof _=="function"){var g=0;F=function(C,A,T){if(C&&C.code==="EAGAIN"&&g<10)return g++,c.call(t,h,d,m,b,D,F);_.apply(this,arguments)}}return c.call(t,h,d,m,b,D,F)}return Object.setPrototypeOf&&Object.setPrototypeOf(f,c),f}(t.read),t.readSync=typeof t.readSync!="function"?t.readSync:function(c){return function(f,h,d,m,b){for(var D=0;;)try{return c.call(t,f,h,d,m,b)}catch(_){if(_.code==="EAGAIN"&&D<10){D++;continue}throw _}}}(t.readSync);function e(c){c.lchmod=function(f,h,d){c.open(f,fi.O_WRONLY|fi.O_SYMLINK,h,function(m,b){if(m){d&&d(m);return}c.fchmod(b,h,function(D){c.close(b,function(_){d&&d(D||_)})})})},c.lchmodSync=function(f,h){var d=c.openSync(f,fi.O_WRONLY|fi.O_SYMLINK,h),m=!0,b;try{b=c.fchmodSync(d,h),m=!1}finally{if(m)try{c.closeSync(d)}catch{}else c.closeSync(d)}return b}}function r(c){fi.hasOwnProperty("O_SYMLINK")&&c.futimes?(c.lutimes=function(f,h,d,m){c.open(f,fi.O_SYMLINK,function(b,D){if(b){m&&m(b);return}c.futimes(D,h,d,function(_){c.close(D,function(F){m&&m(_||F)})})})},c.lutimesSync=function(f,h,d){var m=c.openSync(f,fi.O_SYMLINK),b,D=!0;try{b=c.futimesSync(m,h,d),D=!1}finally{if(D)try{c.closeSync(m)}catch{}else c.closeSync(m)}return b}):c.futimes&&(c.lutimes=function(f,h,d,m){m&&process.nextTick(m)},c.lutimesSync=function(){})}function n(c){return c&&function(f,h,d){return c.call(t,f,h,function(m){l(m)&&(m=null),d&&d.apply(this,arguments)})}}function i(c){return c&&function(f,h){try{return c.call(t,f,h)}catch(d){if(!l(d))throw d}}}function o(c){return c&&function(f,h,d,m){return c.call(t,f,h,d,function(b){l(b)&&(b=null),m&&m.apply(this,arguments)})}}function s(c){return c&&function(f,h,d){try{return c.call(t,f,h,d)}catch(m){if(!l(m))throw m}}}function a(c){return c&&function(f,h,d){typeof h=="function"&&(d=h,h=null);function m(b,D){D&&(D.uid<0&&(D.uid+=4294967296),D.gid<0&&(D.gid+=4294967296)),d&&d.apply(this,arguments)}return h?c.call(t,f,h,m):c.call(t,f,m)}}function u(c){return c&&function(f,h){var d=h?c.call(t,f,h):c.call(t,f);return d&&(d.uid<0&&(d.uid+=4294967296),d.gid<0&&(d.gid+=4294967296)),d}}function l(c){if(!c||c.code==="ENOSYS")return!0;var f=!process.getuid||process.getuid()!==0;return!!(f&&(c.code==="EINVAL"||c.code==="EPERM"))}}});var YI=y((ope,KI)=>{var WI=require("stream").Stream;KI.exports=Bne;function Bne(t){return{ReadStream:e,WriteStream:r};function e(n,i){if(!(this instanceof e))return new e(n,i);WI.call(this);var o=this;this.path=n,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=64*1024,i=i||{};for(var s=Object.keys(i),a=0,u=s.length;a<u;a++){var l=s[a];this[l]=i[l]}if(this.encoding&&this.setEncoding(this.encoding),this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.end===void 0)this.end=1/0;else if(typeof this.end!="number")throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}if(this.fd!==null){process.nextTick(function(){o._read()});return}t.open(this.path,this.flags,this.mode,function(c,f){if(c){o.emit("error",c),o.readable=!1;return}o.fd=f,o.emit("open",f),o._read()})}function r(n,i){if(!(this instanceof r))return new r(n,i);WI.call(this),this.path=n,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,i=i||{};for(var o=Object.keys(i),s=0,a=o.length;s<a;s++){var u=o[s];this[u]=i[u]}if(this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start}this.busy=!1,this._queue=[],this.fd===null&&(this._open=t.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}});var XI=y((spe,JI)=>{"use strict";JI.exports=Mne;var qne=Object.getPrototypeOf||function(t){return t.__proto__};function Mne(t){if(t===null||typeof t!="object")return t;if(t instanceof Object)var e={__proto__:qne(t)};else var e=Object.create(null);return Object.getOwnPropertyNames(t).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}});var tj=y((ape,kv)=>{var Ke=require("fs"),Une=GI(),Hne=YI(),Vne=XI(),ph=require("util"),_t,gh;typeof Symbol=="function"&&typeof Symbol.for=="function"?(_t=Symbol.for("graceful-fs.queue"),gh=Symbol.for("graceful-fs.previous")):(_t="___graceful-fs.queue",gh="___graceful-fs.previous");function zne(){}function ej(t,e){Object.defineProperty(t,_t,{get:function(){return e}})}var yo=zne;ph.debuglog?yo=ph.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(yo=function(){var t=ph.format.apply(ph,arguments);t="GFS4: "+t.split(/\n/).join(`
199
- GFS4: `),console.error(t)});Ke[_t]||(ZI=global[_t]||[],ej(Ke,ZI),Ke.close=function(t){function e(r,n){return t.call(Ke,r,function(i){i||QI(),typeof n=="function"&&n.apply(this,arguments)})}return Object.defineProperty(e,gh,{value:t}),e}(Ke.close),Ke.closeSync=function(t){function e(r){t.apply(Ke,arguments),QI()}return Object.defineProperty(e,gh,{value:t}),e}(Ke.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){yo(Ke[_t]),require("assert").equal(Ke[_t].length,0)}));var ZI;global[_t]||ej(global,Ke[_t]);kv.exports=Ov(Vne(Ke));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!Ke.__patched&&(kv.exports=Ov(Ke),Ke.__patched=!0);function Ov(t){Une(t),t.gracefulify=Ov,t.createReadStream=A,t.createWriteStream=T;var e=t.readFile;t.readFile=r;function r(S,I,$){return typeof I=="function"&&($=I,I=null),B(S,I,$);function B(q,K,V,E){return e(q,K,function(v){v&&(v.code==="EMFILE"||v.code==="ENFILE")?fa([B,[q,K,V],v,E||Date.now(),Date.now()]):typeof V=="function"&&V.apply(this,arguments)})}}var n=t.writeFile;t.writeFile=i;function i(S,I,$,B){return typeof $=="function"&&(B=$,$=null),q(S,I,$,B);function q(K,V,E,v,w){return n(K,V,E,function(O){O&&(O.code==="EMFILE"||O.code==="ENFILE")?fa([q,[K,V,E,v],O,w||Date.now(),Date.now()]):typeof v=="function"&&v.apply(this,arguments)})}}var o=t.appendFile;o&&(t.appendFile=s);function s(S,I,$,B){return typeof $=="function"&&(B=$,$=null),q(S,I,$,B);function q(K,V,E,v,w){return o(K,V,E,function(O){O&&(O.code==="EMFILE"||O.code==="ENFILE")?fa([q,[K,V,E,v],O,w||Date.now(),Date.now()]):typeof v=="function"&&v.apply(this,arguments)})}}var a=t.copyFile;a&&(t.copyFile=u);function u(S,I,$,B){return typeof $=="function"&&(B=$,$=0),q(S,I,$,B);function q(K,V,E,v,w){return a(K,V,E,function(O){O&&(O.code==="EMFILE"||O.code==="ENFILE")?fa([q,[K,V,E,v],O,w||Date.now(),Date.now()]):typeof v=="function"&&v.apply(this,arguments)})}}var l=t.readdir;t.readdir=f;var c=/^v[0-5]\./;function f(S,I,$){typeof I=="function"&&($=I,I=null);var B=c.test(process.version)?function(V,E,v,w){return l(V,q(V,E,v,w))}:function(V,E,v,w){return l(V,E,q(V,E,v,w))};return B(S,I,$);function q(K,V,E,v){return function(w,O){w&&(w.code==="EMFILE"||w.code==="ENFILE")?fa([B,[K,V,E],w,v||Date.now(),Date.now()]):(O&&O.sort&&O.sort(),typeof E=="function"&&E.call(this,w,O))}}}if(process.version.substr(0,4)==="v0.8"){var h=Hne(t);_=h.ReadStream,g=h.WriteStream}var d=t.ReadStream;d&&(_.prototype=Object.create(d.prototype),_.prototype.open=F);var m=t.WriteStream;m&&(g.prototype=Object.create(m.prototype),g.prototype.open=C),Object.defineProperty(t,"ReadStream",{get:function(){return _},set:function(S){_=S},enumerable:!0,configurable:!0}),Object.defineProperty(t,"WriteStream",{get:function(){return g},set:function(S){g=S},enumerable:!0,configurable:!0});var b=_;Object.defineProperty(t,"FileReadStream",{get:function(){return b},set:function(S){b=S},enumerable:!0,configurable:!0});var D=g;Object.defineProperty(t,"FileWriteStream",{get:function(){return D},set:function(S){D=S},enumerable:!0,configurable:!0});function _(S,I){return this instanceof _?(d.apply(this,arguments),this):_.apply(Object.create(_.prototype),arguments)}function F(){var S=this;L(S.path,S.flags,S.mode,function(I,$){I?(S.autoClose&&S.destroy(),S.emit("error",I)):(S.fd=$,S.emit("open",$),S.read())})}function g(S,I){return this instanceof g?(m.apply(this,arguments),this):g.apply(Object.create(g.prototype),arguments)}function C(){var S=this;L(S.path,S.flags,S.mode,function(I,$){I?(S.destroy(),S.emit("error",I)):(S.fd=$,S.emit("open",$))})}function A(S,I){return new t.ReadStream(S,I)}function T(S,I){return new t.WriteStream(S,I)}var x=t.open;t.open=L;function L(S,I,$,B){return typeof $=="function"&&(B=$,$=null),q(S,I,$,B);function q(K,V,E,v,w){return x(K,V,E,function(O,j){O&&(O.code==="EMFILE"||O.code==="ENFILE")?fa([q,[K,V,E,v],O,w||Date.now(),Date.now()]):typeof v=="function"&&v.apply(this,arguments)})}}return t}function fa(t){yo("ENQUEUE",t[0].name,t[1]),Ke[_t].push(t),Av()}var mh;function QI(){for(var t=Date.now(),e=0;e<Ke[_t].length;++e)Ke[_t][e].length>2&&(Ke[_t][e][3]=t,Ke[_t][e][4]=t);Av()}function Av(){if(clearTimeout(mh),mh=void 0,Ke[_t].length!==0){var t=Ke[_t].shift(),e=t[0],r=t[1],n=t[2],i=t[3],o=t[4];if(i===void 0)yo("RETRY",e.name,r),e.apply(null,r);else if(Date.now()-i>=6e4){yo("TIMEOUT",e.name,r);var s=r.pop();typeof s=="function"&&s.call(null,n)}else{var a=Date.now()-o,u=Math.max(o-i,1),l=Math.min(u*1.2,100);a>=l?(yo("RETRY",e.name,r),e.apply(null,r.concat([i]))):Ke[_t].push(t)}mh===void 0&&(mh=setTimeout(Av,0))}}});var rj=y(da=>{"use strict";var Gne=da&&da.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(da,"__esModule",{value:!0});da.readCAFileSync=void 0;var Wne=Gne(tj());function Kne(t){try{let e=Wne.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}}da.readCAFileSync=Kne});var nj=y(Do=>{"use strict";var Yne=Do&&Do.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),Jne=Do&&Do.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Yne(e,t,r)};Object.defineProperty(Do,"__esModule",{value:!0});Jne(rj(),Do)});var sj=y((cpe,oj)=>{oj.exports=ij;function vo(t,e){if(typeof Object.setPrototypeOf=="function")return Object.setPrototypeOf(t,e);t.__proto__=e}function ij(){this.list=[];var t=null;Object.defineProperty(this,"root",{get:function(){return t},set:function(e){t=e,this.list.length&&vo(this.list[this.list.length-1],e)},enumerable:!0,configurable:!0})}ij.prototype={get length(){return this.list.length},get keys(){var t=[];for(var e in this.list[0])t.push(e);return t},get snapshot(){var t={};return this.keys.forEach(function(e){t[e]=this.get(e)},this),t},get store(){return this.list[0]},push:function(t){return typeof t!="object"&&(t={valueOf:t}),this.list.length>=1&&vo(this.list[this.list.length-1],t),vo(t,this.root),this.list.push(t)},pop:function(){return this.list.length>=2&&vo(this.list[this.list.length-2],this.root),this.list.pop()},unshift:function(t){return vo(t,this.list[0]||this.root),this.list.unshift(t)},shift:function(){return this.list.length===1&&vo(this.list[0],this.root),this.list.shift()},get:function(t){return this.list[0][t]},set:function(t,e,r){return this.length||this.push({}),r&&this.list[0].hasOwnProperty(t)&&this.push({}),this.list[0][t]=e},forEach:function(t,e){for(var r in this.list[0])t.call(e,r,this.list[0][r])},slice:function(){return this.list.slice.apply(this.list,arguments)},splice:function(){for(var t=this.list.splice.apply(this.list,arguments),e=0,r=this.list.length;e<r;e++)vo(this.list[e],this.list[e+1]||this.root);return t}}});var cj=y(bo=>{bo.parse=bo.decode=Xne;bo.stringify=bo.encode=aj;bo.safe=ha;bo.unsafe=yh;var Tv=typeof process<"u"&&process.platform==="win32"?`\r
198
+ `)o=!1,a+=u(t,s,l),s=l;else if(!o&&r+n==="/*"){a+=t.slice(s,l),s=l,o=SI,l++;continue}else if(o===SI&&r+n==="*/"){l++,o=!1,a+=u(t,s,l+1),s=l+1;continue}}}return a+(o?u(t.substr(s)):t.substr(s))}});var AI=D(la=>{"use strict";var OI=require("fs"),kne=CI(),El=require("path"),Tne=FI(),Pne=la.parse=function(t){return/^\s*{/.test(t)?JSON.parse(Tne(t)):kne.parse(t)},Rne=la.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=El.join.apply(null,t),n;try{return OI.readFileSync(r,"utf-8")}catch{return}},Jhe=la.json=function(){var t=Rne.apply(null,arguments);return t?Pne(t):null},Xhe=la.env=function(t,e){e=e||process.env;var r={},n=t.length;for(var i in e)if(i.toLowerCase().indexOf(t.toLowerCase())===0){for(var o=i.substring(n).split("__"),s;(s=o.indexOf(""))>-1;)o.splice(s,1);var a=r;o.forEach(function(l,c){!l||typeof a!="object"||(c===o.length-1&&(a[l]=e[i]),a[l]===void 0&&(a[l]={}),a=a[l])})}return r},Zhe=la.find=function(){var t=El.join.apply(null,[].slice.call(arguments));function e(r,n){var i=El.join(r,n);try{return OI.statSync(i),i}catch{if(El.dirname(r)!==r)return e(El.dirname(r),n)}}return e(process.cwd(),t)}});var II=D((epe,$I)=>{"use strict";function TI(t){return t instanceof Buffer||t instanceof Date||t instanceof RegExp}function PI(t){if(t instanceof Buffer){var e=Buffer.alloc?Buffer.alloc(t.length):new Buffer(t.length);return t.copy(e),e}else{if(t instanceof Date)return new Date(t.getTime());if(t instanceof RegExp)return new RegExp(t);throw new Error("Unexpected situation")}}function RI(t){var e=[];return t.forEach(function(r,n){typeof r=="object"&&r!==null?Array.isArray(r)?e[n]=RI(r):TI(r)?e[n]=PI(r):e[n]=Sv({},r):e[n]=r}),e}function kI(t,e){return e==="__proto__"?void 0:t[e]}var Sv=$I.exports=function(){if(arguments.length<1||typeof arguments[0]!="object")return!1;if(arguments.length<2)return arguments[0];var t=arguments[0],e=Array.prototype.slice.call(arguments,1),r,n,i;return e.forEach(function(o){typeof o!="object"||o===null||Array.isArray(o)||Object.keys(o).forEach(function(s){if(n=kI(t,s),r=kI(o,s),r!==t)if(typeof r!="object"||r===null){t[s]=r;return}else if(Array.isArray(r)){t[s]=RI(r);return}else if(TI(r)){t[s]=PI(r);return}else if(typeof n!="object"||n===null||Array.isArray(n)){t[s]=Sv({},r);return}else{t[s]=Sv(n,r);return}})}),t}});var BI=D((tpe,LI)=>{"use strict";function $ne(t,e){var r=t;e.slice(0,-1).forEach(function(i){r=r[i]||{}});var n=e[e.length-1];return n in r}function jI(t){return typeof t=="number"||/^0x[0-9a-f]+$/i.test(t)?!0:/^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(t)}function NI(t,e){return e==="constructor"&&typeof t[e]=="function"||e==="__proto__"}LI.exports=function(t,e){e||(e={});var r={bools:{},strings:{},unknownFn:null};typeof e.unknown=="function"&&(r.unknownFn=e.unknown),typeof e.boolean=="boolean"&&e.boolean?r.allBools=!0:[].concat(e.boolean).filter(Boolean).forEach(function(C){r.bools[C]=!0});var n={};function i(C){return n[C].some(function(A){return r.bools[A]})}Object.keys(e.alias||{}).forEach(function(C){n[C]=[].concat(e.alias[C]),n[C].forEach(function(A){n[A]=[C].concat(n[C].filter(function(T){return A!==T}))})}),[].concat(e.string).filter(Boolean).forEach(function(C){r.strings[C]=!0,n[C]&&[].concat(n[C]).forEach(function(A){r.strings[A]=!0})});var o=e.default||{},s={_:[]};function a(C,A){return r.allBools&&/^--[^=]+$/.test(A)||r.strings[C]||r.bools[C]||n[C]}function u(C,A,T){for(var x=C,L=0;L<A.length-1;L++){var S=A[L];if(NI(x,S))return;x[S]===void 0&&(x[S]={}),(x[S]===Object.prototype||x[S]===Number.prototype||x[S]===String.prototype)&&(x[S]={}),x[S]===Array.prototype&&(x[S]=[]),x=x[S]}var I=A[A.length-1];NI(x,I)||((x===Object.prototype||x===Number.prototype||x===String.prototype)&&(x={}),x===Array.prototype&&(x=[]),x[I]===void 0||r.bools[I]||typeof x[I]=="boolean"?x[I]=T:Array.isArray(x[I])?x[I].push(T):x[I]=[x[I],T])}function l(C,A,T){if(!(T&&r.unknownFn&&!a(C,T)&&r.unknownFn(T)===!1)){var x=!r.strings[C]&&jI(A)?Number(A):A;u(s,C.split("."),x),(n[C]||[]).forEach(function(L){u(s,L.split("."),x)})}}Object.keys(r.bools).forEach(function(C){l(C,o[C]===void 0?!1:o[C])});var c=[];t.indexOf("--")!==-1&&(c=t.slice(t.indexOf("--")+1),t=t.slice(0,t.indexOf("--")));for(var f=0;f<t.length;f++){var h=t[f],d,m;if(/^--.+=/.test(h)){var b=h.match(/^--([^=]+)=([\s\S]*)$/);d=b[1];var y=b[2];r.bools[d]&&(y=y!=="false"),l(d,y,h)}else if(/^--no-.+/.test(h))d=h.match(/^--no-(.+)/)[1],l(d,!1,h);else if(/^--.+/.test(h))d=h.match(/^--(.+)/)[1],m=t[f+1],m!==void 0&&!/^(-|--)[^-]/.test(m)&&!r.bools[d]&&!r.allBools&&(!n[d]||!i(d))?(l(d,m,h),f+=1):/^(true|false)$/.test(m)?(l(d,m==="true",h),f+=1):l(d,r.strings[d]?"":!0,h);else if(/^-[^-]+/.test(h)){for(var E=h.slice(1,-1).split(""),F=!1,g=0;g<E.length;g++){if(m=h.slice(g+2),m==="-"){l(E[g],m,h);continue}if(/[A-Za-z]/.test(E[g])&&m[0]==="="){l(E[g],m.slice(1),h),F=!0;break}if(/[A-Za-z]/.test(E[g])&&/-?\d+(\.\d*)?(e-?\d+)?$/.test(m)){l(E[g],m,h),F=!0;break}if(E[g+1]&&E[g+1].match(/\W/)){l(E[g],h.slice(g+2),h),F=!0;break}else l(E[g],r.strings[E[g]]?"":!0,h)}d=h.slice(-1)[0],!F&&d!=="-"&&(t[f+1]&&!/^(-|--)[^-]/.test(t[f+1])&&!r.bools[d]&&(!n[d]||!i(d))?(l(d,t[f+1],h),f+=1):t[f+1]&&/^(true|false)$/.test(t[f+1])?(l(d,t[f+1]==="true",h),f+=1):l(d,r.strings[d]?"":!0,h))}else if((!r.unknownFn||r.unknownFn(h)!==!1)&&s._.push(r.strings._||!jI(h)?h:Number(h)),e.stopEarly){s._.push.apply(s._,t.slice(f+1));break}}return Object.keys(o).forEach(function(C){$ne(s,C.split("."))||(u(s,C.split("."),o[C]),(n[C]||[]).forEach(function(A){u(s,A.split("."),o[C])}))}),e["--"]?s["--"]=c.slice():c.forEach(function(C){s._.push(C)}),s}});var HI=D((rpe,UI)=>{var Cl=AI(),ca=require("path").join,Ine=II(),qI="/etc",MI=process.platform==="win32",Sl=MI?process.env.USERPROFILE:process.env.HOME;UI.exports=function(t,e,r,n){if(typeof t!="string")throw new Error("rc(name): name *must* be string");r||(r=BI()(process.argv.slice(2))),e=(typeof e=="string"?Cl.json(e):e)||{},n=n||Cl.parse;var i=Cl.env(t+"_"),o=[e],s=[];function a(u){if(!(s.indexOf(u)>=0)){var l=Cl.file(u);l&&(o.push(n(l)),s.push(u))}}return MI||[ca(qI,t,"config"),ca(qI,t+"rc")].forEach(a),Sl&&[ca(Sl,".config",t,"config"),ca(Sl,".config",t),ca(Sl,"."+t,"config"),ca(Sl,"."+t+"rc")].forEach(a),a(Cl.find("."+t+"rc")),i.config&&a(i.config),r.config&&a(r.config),Ine.apply(null,o.concat([i,r,s.length?{configs:s,config:s[s.length-1]}:void 0]))}});var GI=D((ipe,zI)=>{var fi=require("constants"),jne=process.cwd,hh=null,Nne=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return hh||(hh=jne.call(process)),hh};try{process.cwd()}catch{}typeof process.chdir=="function"&&(Fv=process.chdir,process.chdir=function(t){hh=null,Fv.call(process,t)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,Fv));var Fv;zI.exports=Lne;function Lne(t){fi.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&e(t),t.lutimes||r(t),t.chown=o(t.chown),t.fchown=o(t.fchown),t.lchown=o(t.lchown),t.chmod=n(t.chmod),t.fchmod=n(t.fchmod),t.lchmod=n(t.lchmod),t.chownSync=s(t.chownSync),t.fchownSync=s(t.fchownSync),t.lchownSync=s(t.lchownSync),t.chmodSync=i(t.chmodSync),t.fchmodSync=i(t.fchmodSync),t.lchmodSync=i(t.lchmodSync),t.stat=a(t.stat),t.fstat=a(t.fstat),t.lstat=a(t.lstat),t.statSync=u(t.statSync),t.fstatSync=u(t.fstatSync),t.lstatSync=u(t.lstatSync),t.chmod&&!t.lchmod&&(t.lchmod=function(c,f,h){h&&process.nextTick(h)},t.lchmodSync=function(){}),t.chown&&!t.lchown&&(t.lchown=function(c,f,h,d){d&&process.nextTick(d)},t.lchownSync=function(){}),Nne==="win32"&&(t.rename=typeof t.rename!="function"?t.rename:function(c){function f(h,d,m){var b=Date.now(),y=0;c(h,d,function E(F){if(F&&(F.code==="EACCES"||F.code==="EPERM")&&Date.now()-b<6e4){setTimeout(function(){t.stat(d,function(g,C){g&&g.code==="ENOENT"?c(h,d,E):m(F)})},y),y<100&&(y+=10);return}m&&m(F)})}return Object.setPrototypeOf&&Object.setPrototypeOf(f,c),f}(t.rename)),t.read=typeof t.read!="function"?t.read:function(c){function f(h,d,m,b,y,E){var F;if(E&&typeof E=="function"){var g=0;F=function(C,A,T){if(C&&C.code==="EAGAIN"&&g<10)return g++,c.call(t,h,d,m,b,y,F);E.apply(this,arguments)}}return c.call(t,h,d,m,b,y,F)}return Object.setPrototypeOf&&Object.setPrototypeOf(f,c),f}(t.read),t.readSync=typeof t.readSync!="function"?t.readSync:function(c){return function(f,h,d,m,b){for(var y=0;;)try{return c.call(t,f,h,d,m,b)}catch(E){if(E.code==="EAGAIN"&&y<10){y++;continue}throw E}}}(t.readSync);function e(c){c.lchmod=function(f,h,d){c.open(f,fi.O_WRONLY|fi.O_SYMLINK,h,function(m,b){if(m){d&&d(m);return}c.fchmod(b,h,function(y){c.close(b,function(E){d&&d(y||E)})})})},c.lchmodSync=function(f,h){var d=c.openSync(f,fi.O_WRONLY|fi.O_SYMLINK,h),m=!0,b;try{b=c.fchmodSync(d,h),m=!1}finally{if(m)try{c.closeSync(d)}catch{}else c.closeSync(d)}return b}}function r(c){fi.hasOwnProperty("O_SYMLINK")&&c.futimes?(c.lutimes=function(f,h,d,m){c.open(f,fi.O_SYMLINK,function(b,y){if(b){m&&m(b);return}c.futimes(y,h,d,function(E){c.close(y,function(F){m&&m(E||F)})})})},c.lutimesSync=function(f,h,d){var m=c.openSync(f,fi.O_SYMLINK),b,y=!0;try{b=c.futimesSync(m,h,d),y=!1}finally{if(y)try{c.closeSync(m)}catch{}else c.closeSync(m)}return b}):c.futimes&&(c.lutimes=function(f,h,d,m){m&&process.nextTick(m)},c.lutimesSync=function(){})}function n(c){return c&&function(f,h,d){return c.call(t,f,h,function(m){l(m)&&(m=null),d&&d.apply(this,arguments)})}}function i(c){return c&&function(f,h){try{return c.call(t,f,h)}catch(d){if(!l(d))throw d}}}function o(c){return c&&function(f,h,d,m){return c.call(t,f,h,d,function(b){l(b)&&(b=null),m&&m.apply(this,arguments)})}}function s(c){return c&&function(f,h,d){try{return c.call(t,f,h,d)}catch(m){if(!l(m))throw m}}}function a(c){return c&&function(f,h,d){typeof h=="function"&&(d=h,h=null);function m(b,y){y&&(y.uid<0&&(y.uid+=4294967296),y.gid<0&&(y.gid+=4294967296)),d&&d.apply(this,arguments)}return h?c.call(t,f,h,m):c.call(t,f,m)}}function u(c){return c&&function(f,h){var d=h?c.call(t,f,h):c.call(t,f);return d&&(d.uid<0&&(d.uid+=4294967296),d.gid<0&&(d.gid+=4294967296)),d}}function l(c){if(!c||c.code==="ENOSYS")return!0;var f=!process.getuid||process.getuid()!==0;return!!(f&&(c.code==="EINVAL"||c.code==="EPERM"))}}});var YI=D((ope,KI)=>{var WI=require("stream").Stream;KI.exports=Bne;function Bne(t){return{ReadStream:e,WriteStream:r};function e(n,i){if(!(this instanceof e))return new e(n,i);WI.call(this);var o=this;this.path=n,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=64*1024,i=i||{};for(var s=Object.keys(i),a=0,u=s.length;a<u;a++){var l=s[a];this[l]=i[l]}if(this.encoding&&this.setEncoding(this.encoding),this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.end===void 0)this.end=1/0;else if(typeof this.end!="number")throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}if(this.fd!==null){process.nextTick(function(){o._read()});return}t.open(this.path,this.flags,this.mode,function(c,f){if(c){o.emit("error",c),o.readable=!1;return}o.fd=f,o.emit("open",f),o._read()})}function r(n,i){if(!(this instanceof r))return new r(n,i);WI.call(this),this.path=n,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,i=i||{};for(var o=Object.keys(i),s=0,a=o.length;s<a;s++){var u=o[s];this[u]=i[u]}if(this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start}this.busy=!1,this._queue=[],this.fd===null&&(this._open=t.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}});var XI=D((spe,JI)=>{"use strict";JI.exports=Mne;var qne=Object.getPrototypeOf||function(t){return t.__proto__};function Mne(t){if(t===null||typeof t!="object")return t;if(t instanceof Object)var e={__proto__:qne(t)};else var e=Object.create(null);return Object.getOwnPropertyNames(t).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}});var tj=D((ape,kv)=>{var Ke=require("fs"),Une=GI(),Hne=YI(),Vne=XI(),ph=require("util"),_t,gh;typeof Symbol=="function"&&typeof Symbol.for=="function"?(_t=Symbol.for("graceful-fs.queue"),gh=Symbol.for("graceful-fs.previous")):(_t="___graceful-fs.queue",gh="___graceful-fs.previous");function zne(){}function ej(t,e){Object.defineProperty(t,_t,{get:function(){return e}})}var yo=zne;ph.debuglog?yo=ph.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(yo=function(){var t=ph.format.apply(ph,arguments);t="GFS4: "+t.split(/\n/).join(`
199
+ GFS4: `),console.error(t)});Ke[_t]||(ZI=global[_t]||[],ej(Ke,ZI),Ke.close=function(t){function e(r,n){return t.call(Ke,r,function(i){i||QI(),typeof n=="function"&&n.apply(this,arguments)})}return Object.defineProperty(e,gh,{value:t}),e}(Ke.close),Ke.closeSync=function(t){function e(r){t.apply(Ke,arguments),QI()}return Object.defineProperty(e,gh,{value:t}),e}(Ke.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){yo(Ke[_t]),require("assert").equal(Ke[_t].length,0)}));var ZI;global[_t]||ej(global,Ke[_t]);kv.exports=Ov(Vne(Ke));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!Ke.__patched&&(kv.exports=Ov(Ke),Ke.__patched=!0);function Ov(t){Une(t),t.gracefulify=Ov,t.createReadStream=A,t.createWriteStream=T;var e=t.readFile;t.readFile=r;function r(S,I,$){return typeof I=="function"&&($=I,I=null),B(S,I,$);function B(q,K,V,_){return e(q,K,function(v){v&&(v.code==="EMFILE"||v.code==="ENFILE")?fa([B,[q,K,V],v,_||Date.now(),Date.now()]):typeof V=="function"&&V.apply(this,arguments)})}}var n=t.writeFile;t.writeFile=i;function i(S,I,$,B){return typeof $=="function"&&(B=$,$=null),q(S,I,$,B);function q(K,V,_,v,w){return n(K,V,_,function(O){O&&(O.code==="EMFILE"||O.code==="ENFILE")?fa([q,[K,V,_,v],O,w||Date.now(),Date.now()]):typeof v=="function"&&v.apply(this,arguments)})}}var o=t.appendFile;o&&(t.appendFile=s);function s(S,I,$,B){return typeof $=="function"&&(B=$,$=null),q(S,I,$,B);function q(K,V,_,v,w){return o(K,V,_,function(O){O&&(O.code==="EMFILE"||O.code==="ENFILE")?fa([q,[K,V,_,v],O,w||Date.now(),Date.now()]):typeof v=="function"&&v.apply(this,arguments)})}}var a=t.copyFile;a&&(t.copyFile=u);function u(S,I,$,B){return typeof $=="function"&&(B=$,$=0),q(S,I,$,B);function q(K,V,_,v,w){return a(K,V,_,function(O){O&&(O.code==="EMFILE"||O.code==="ENFILE")?fa([q,[K,V,_,v],O,w||Date.now(),Date.now()]):typeof v=="function"&&v.apply(this,arguments)})}}var l=t.readdir;t.readdir=f;var c=/^v[0-5]\./;function f(S,I,$){typeof I=="function"&&($=I,I=null);var B=c.test(process.version)?function(V,_,v,w){return l(V,q(V,_,v,w))}:function(V,_,v,w){return l(V,_,q(V,_,v,w))};return B(S,I,$);function q(K,V,_,v){return function(w,O){w&&(w.code==="EMFILE"||w.code==="ENFILE")?fa([B,[K,V,_],w,v||Date.now(),Date.now()]):(O&&O.sort&&O.sort(),typeof _=="function"&&_.call(this,w,O))}}}if(process.version.substr(0,4)==="v0.8"){var h=Hne(t);E=h.ReadStream,g=h.WriteStream}var d=t.ReadStream;d&&(E.prototype=Object.create(d.prototype),E.prototype.open=F);var m=t.WriteStream;m&&(g.prototype=Object.create(m.prototype),g.prototype.open=C),Object.defineProperty(t,"ReadStream",{get:function(){return E},set:function(S){E=S},enumerable:!0,configurable:!0}),Object.defineProperty(t,"WriteStream",{get:function(){return g},set:function(S){g=S},enumerable:!0,configurable:!0});var b=E;Object.defineProperty(t,"FileReadStream",{get:function(){return b},set:function(S){b=S},enumerable:!0,configurable:!0});var y=g;Object.defineProperty(t,"FileWriteStream",{get:function(){return y},set:function(S){y=S},enumerable:!0,configurable:!0});function E(S,I){return this instanceof E?(d.apply(this,arguments),this):E.apply(Object.create(E.prototype),arguments)}function F(){var S=this;L(S.path,S.flags,S.mode,function(I,$){I?(S.autoClose&&S.destroy(),S.emit("error",I)):(S.fd=$,S.emit("open",$),S.read())})}function g(S,I){return this instanceof g?(m.apply(this,arguments),this):g.apply(Object.create(g.prototype),arguments)}function C(){var S=this;L(S.path,S.flags,S.mode,function(I,$){I?(S.destroy(),S.emit("error",I)):(S.fd=$,S.emit("open",$))})}function A(S,I){return new t.ReadStream(S,I)}function T(S,I){return new t.WriteStream(S,I)}var x=t.open;t.open=L;function L(S,I,$,B){return typeof $=="function"&&(B=$,$=null),q(S,I,$,B);function q(K,V,_,v,w){return x(K,V,_,function(O,j){O&&(O.code==="EMFILE"||O.code==="ENFILE")?fa([q,[K,V,_,v],O,w||Date.now(),Date.now()]):typeof v=="function"&&v.apply(this,arguments)})}}return t}function fa(t){yo("ENQUEUE",t[0].name,t[1]),Ke[_t].push(t),Av()}var mh;function QI(){for(var t=Date.now(),e=0;e<Ke[_t].length;++e)Ke[_t][e].length>2&&(Ke[_t][e][3]=t,Ke[_t][e][4]=t);Av()}function Av(){if(clearTimeout(mh),mh=void 0,Ke[_t].length!==0){var t=Ke[_t].shift(),e=t[0],r=t[1],n=t[2],i=t[3],o=t[4];if(i===void 0)yo("RETRY",e.name,r),e.apply(null,r);else if(Date.now()-i>=6e4){yo("TIMEOUT",e.name,r);var s=r.pop();typeof s=="function"&&s.call(null,n)}else{var a=Date.now()-o,u=Math.max(o-i,1),l=Math.min(u*1.2,100);a>=l?(yo("RETRY",e.name,r),e.apply(null,r.concat([i]))):Ke[_t].push(t)}mh===void 0&&(mh=setTimeout(Av,0))}}});var rj=D(da=>{"use strict";var Gne=da&&da.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(da,"__esModule",{value:!0});da.readCAFileSync=void 0;var Wne=Gne(tj());function Kne(t){try{let e=Wne.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}}da.readCAFileSync=Kne});var nj=D(Do=>{"use strict";var Yne=Do&&Do.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),Jne=Do&&Do.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Yne(e,t,r)};Object.defineProperty(Do,"__esModule",{value:!0});Jne(rj(),Do)});var sj=D((cpe,oj)=>{oj.exports=ij;function vo(t,e){if(typeof Object.setPrototypeOf=="function")return Object.setPrototypeOf(t,e);t.__proto__=e}function ij(){this.list=[];var t=null;Object.defineProperty(this,"root",{get:function(){return t},set:function(e){t=e,this.list.length&&vo(this.list[this.list.length-1],e)},enumerable:!0,configurable:!0})}ij.prototype={get length(){return this.list.length},get keys(){var t=[];for(var e in this.list[0])t.push(e);return t},get snapshot(){var t={};return this.keys.forEach(function(e){t[e]=this.get(e)},this),t},get store(){return this.list[0]},push:function(t){return typeof t!="object"&&(t={valueOf:t}),this.list.length>=1&&vo(this.list[this.list.length-1],t),vo(t,this.root),this.list.push(t)},pop:function(){return this.list.length>=2&&vo(this.list[this.list.length-2],this.root),this.list.pop()},unshift:function(t){return vo(t,this.list[0]||this.root),this.list.unshift(t)},shift:function(){return this.list.length===1&&vo(this.list[0],this.root),this.list.shift()},get:function(t){return this.list[0][t]},set:function(t,e,r){return this.length||this.push({}),r&&this.list[0].hasOwnProperty(t)&&this.push({}),this.list[0][t]=e},forEach:function(t,e){for(var r in this.list[0])t.call(e,r,this.list[0][r])},slice:function(){return this.list.slice.apply(this.list,arguments)},splice:function(){for(var t=this.list.splice.apply(this.list,arguments),e=0,r=this.list.length;e<r;e++)vo(this.list[e],this.list[e+1]||this.root);return t}}});var cj=D(bo=>{bo.parse=bo.decode=Xne;bo.stringify=bo.encode=aj;bo.safe=ha;bo.unsafe=yh;var Tv=typeof process<"u"&&process.platform==="win32"?`\r
200
200
  `:`
201
201
  `;function aj(t,e){var r=[],n="";typeof e=="string"?e={section:e,whitespace:!1}:(e=e||{},e.whitespace=e.whitespace===!0);var i=e.whitespace?" = ":"=";return Object.keys(t).forEach(function(o,s,a){var u=t[o];u&&Array.isArray(u)?u.forEach(function(l){n+=ha(o+"[]")+i+ha(l)+`
202
- `}):u&&typeof u=="object"?r.push(o):n+=ha(o)+i+ha(u)+Tv}),e.section&&n.length&&(n="["+ha(e.section)+"]"+Tv+n),r.forEach(function(o,s,a){var u=uj(o).join("\\."),l=(e.section?e.section+".":"")+u,c=aj(t[o],{section:l,whitespace:e.whitespace});n.length&&c.length&&(n+=Tv),n+=c}),n}function uj(t){return t.replace(/\1/g,"LITERAL\\1LITERAL").replace(/\\\./g,"").split(/\./).map(function(e){return e.replace(/\1/g,"\\.").replace(/\2LITERAL\\1LITERAL\2/g,"")})}function Xne(t){var e={},r=e,n=null,i=/^\[([^\]]*)\]$|^([^=]+)(=(.*))?$/i,o=t.split(/[\r\n]+/g);return o.forEach(function(s,a,u){if(!(!s||s.match(/^\s*[;#]/))){var l=s.match(i);if(l){if(l[1]!==void 0){if(n=yh(l[1]),n==="__proto__"){r={};return}r=e[n]=e[n]||{};return}var c=yh(l[2]);if(c!=="__proto__"){var f=l[3]?yh(l[4]):!0;switch(f){case"true":case"false":case"null":f=JSON.parse(f)}if(c.length>2&&c.slice(-2)==="[]"){if(c=c.substring(0,c.length-2),c==="__proto__")return;r[c]?Array.isArray(r[c])||(r[c]=[r[c]]):r[c]=[]}Array.isArray(r[c])?r[c].push(f):r[c]=f}}}}),Object.keys(e).filter(function(s,a,u){if(!e[s]||typeof e[s]!="object"||Array.isArray(e[s]))return!1;var l=uj(s),c=e,f=l.pop(),h=f.replace(/\\\./g,".");return l.forEach(function(d,m,b){d!=="__proto__"&&((!c[d]||typeof c[d]!="object")&&(c[d]={}),c=c[d])}),c===e&&h===f?!1:(c[h]=e[s],!0)}).forEach(function(s,a,u){delete e[s]}),e}function lj(t){return t.charAt(0)==='"'&&t.slice(-1)==='"'||t.charAt(0)==="'"&&t.slice(-1)==="'"}function ha(t){return typeof t!="string"||t.match(/[=\r\n]/)||t.match(/^\[/)||t.length>1&&lj(t)||t!==t.trim()?JSON.stringify(t):t.replace(/;/g,"\\;").replace(/#/g,"\\#")}function yh(t,e){if(t=(t||"").trim(),lj(t)){t.charAt(0)==="'"&&(t=t.substr(1,t.length-2));try{t=JSON.parse(t)}catch{}}else{for(var r=!1,n="",i=0,o=t.length;i<o;i++){var s=t.charAt(i);if(r)"\\;#".indexOf(s)!==-1?n+=s:n+="\\"+s,r=!1;else{if(";#".indexOf(s)!==-1)break;s==="\\"?r=!0:n+=s}}return r&&(n+="\\"),n.trim()}return t}});var pj=y((An,hj)=>{var fj=sj(),xl=require("path"),Dh=require("fs"),Pv=cj(),Rv=require("events").EventEmitter,Zne=require("url"),Qne=require("http"),An=hj.exports=function(){for(var t=[].slice.call(arguments),e=new At;t.length;){var r=t.shift();r&&e.push(typeof r=="string"?tie(r):r)}return e},dpe=An.find=function(){var t=xl.join.apply(null,[].slice.call(arguments));function e(r,n){var i=xl.join(r,n);try{return Dh.statSync(i),i}catch{if(xl.dirname(r)!==r)return e(xl.dirname(r),n)}}return e(__dirname,t)},eie=An.parse=function(t,e,r){if(t=""+t,r)if(r==="json")if(this.emit)try{return JSON.parse(t)}catch(n){this.emit("error",n)}else return JSON.parse(t);else return Pv.parse(t);else try{return JSON.parse(t)}catch{return Pv.parse(t)}},tie=An.json=function(){var t=[].slice.call(arguments).filter(function(n){return n!=null}),e=xl.join.apply(null,t),r;try{r=Dh.readFileSync(e,"utf-8")}catch{return}return eie(r,e,"json")},hpe=An.env=function(t,e){e=e||process.env;var r={},n=t.length;for(var i in e)i.indexOf(t)===0&&(r[i.substring(n)]=e[i]);return r};An.ConfigChain=At;function At(){Rv.apply(this),fj.apply(this,arguments),this._awaiting=0,this._saving=0,this.sources={}}var dj={constructor:{value:At}};Object.keys(Rv.prototype).forEach(function(t){dj[t]=Object.getOwnPropertyDescriptor(Rv.prototype,t)});At.prototype=Object.create(fj.prototype,dj);At.prototype.del=function(t,e){if(e){var r=this.sources[e];if(r=r&&r.data,!r)return this.emit("error",new Error("not found "+e));delete r[t]}else for(var n=0,i=this.list.length;n<i;n++)delete this.list[n][t];return this};At.prototype.set=function(t,e,r){var n;if(r){if(n=this.sources[r],n=n&&n.data,!n)return this.emit("error",new Error("not found "+r))}else if(n=this.list[0],!n)return this.emit("error",new Error("cannot set, no confs!"));return n[t]=e,this};At.prototype.get=function(t,e){return e?(e=this.sources[e],e&&(e=e.data),e&&Object.hasOwnProperty.call(e,t)?e[t]:void 0):this.list[0][t]};At.prototype.save=function(t,o,r){typeof o=="function"&&(r=o,o=null);var n=this.sources[t];if(!n||!(n.path||n.source)||!n.data)return this.emit("error",new Error("bad save target: "+t));if(n.source){var i=n.prefix||"";return Object.keys(n.data).forEach(function(a){n.source[i+a]=n.data[a]}),this}var o=o||n.type,s=n.data;return n.type==="json"?s=JSON.stringify(s):s=Pv.stringify(s),this._saving++,Dh.writeFile(n.path,s,"utf8",function(a){if(this._saving--,a)return r?r(a):this.emit("error",a);this._saving===0&&(r&&r(),this.emit("save"))}.bind(this)),this};At.prototype.addFile=function(t,e,r){r=r||t;var n={__source__:r};return this.sources[r]={path:t,type:e},this.push(n),this._await(),Dh.readFile(t,"utf8",function(i,o){i&&this.emit("error",i),this.addString(o,t,e,n)}.bind(this)),this};At.prototype.addEnv=function(t,e,r){r=r||"env";var n=An.env(t,e);return this.sources[r]={data:n,source:e,prefix:t},this.add(n,r)};At.prototype.addUrl=function(t,e,r){this._await();var n=Zne.format(t);r=r||n;var i={__source__:r};return this.sources[r]={href:n,type:e},this.push(i),Qne.request(t,function(o){var s=[],a=o.headers["content-type"];e||(e=a.indexOf("json")!==-1?"json":a.indexOf("ini")!==-1?"ini":n.match(/\.json$/)?"json":n.match(/\.ini$/)?"ini":null,i.type=e),o.on("data",s.push.bind(s)).on("end",function(){this.addString(Buffer.concat(s),n,e,i)}.bind(this)).on("error",this.emit.bind(this,"error"))}.bind(this)).on("error",this.emit.bind(this,"error")).end(),this};At.prototype.addString=function(t,e,r,n){return t=this.parse(t,e,r),this.add(t,n),this};At.prototype.add=function(t,e){if(e&&typeof e=="object"){var r=this.list.indexOf(e);if(r===-1)return this.emit("error",new Error("bad marker"));this.splice(r,1,t),e=e.__source__,this.sources[e]=this.sources[e]||{},this.sources[e].data=t,this._resolve()}else typeof e=="string"&&(this.sources[e]=this.sources[e]||{},this.sources[e].data=t),this._await(),this.push(t),process.nextTick(this._resolve.bind(this));return this};At.prototype.parse=An.parse;At.prototype._await=function(){this._awaiting++};At.prototype._resolve=function(){this._awaiting--,this._awaiting===0&&this.emit("load",this)}});var gj=y((ppe,mj)=>{mj.exports=function(t){let e=t.indexOf(":");if(e===-1)return $v(t);let r=t.substr(0,e),n=t.substr(e+1);return`${$v(r)}:${$v(n)}`};function $v(t){if(t=t.toLowerCase(),t==="_authtoken")return"_authToken";let e=t[0];for(let r=1;r<t.length;r++)e+=t[r]==="_"?"-":t[r];return e}});var yj=y(vh=>{"use strict";Object.defineProperty(vh,"__esModule",{value:!0});vh.envReplace=void 0;var rie=/(?<!\\)(\\*)\$\{([^${}]+)\}/g;function nie(t,e){return t.replace(rie,iie.bind(null,e))}vh.envReplace=nie;function iie(t,e,r,n){if(r.length%2)return e.slice((r.length+1)/2);let i=sie(t,n);if(i===void 0)throw new Error(`Failed to replace env in config: ${e}`);return`${r.slice(r.length/2)}${i}`}var oie=/([^:-]+)(:?)-(.+)/;function sie(t,e){let r=e.match(oie);if(!r)return t[e];let[,n,i,o]=r;return Object.prototype.hasOwnProperty.call(t,n)?!t[n]&&i?o:t[n]:o}});var Dj=y(bh=>{"use strict";Object.defineProperty(bh,"__esModule",{value:!0});bh.envReplace=void 0;var aie=yj();Object.defineProperty(bh,"envReplace",{enumerable:!0,get:function(){return aie.envReplace}})});var vj=y(Fl=>{"use strict";var uie=require("fs"),wo=require("path"),{envReplace:Iv}=Dj(),lie=t=>typeof t!="string"?t:Iv(t,process.env),cie=(t,e,r)=>{if(typeof e!="string")return e;let n=[].concat(t[r]),i=n.indexOf(wo)!==-1,o=n.indexOf(Boolean)!==-1,s=n.indexOf(String)!==-1,a=n.indexOf(Number)!==-1;if(e=`${e}`.trim(),/^".*"$/.test(e))try{e=JSON.parse(e)}catch{throw new Error(`Failed parsing JSON config key ${r}: ${e}`)}if(o&&!s&&e==="")return!0;switch(e){case"true":return!0;case"false":return!1;case"null":return null;case"undefined":return}return e=Iv(e,process.env),i&&((process.platform==="win32"?/^~(\/|\\)/:/^~\//).test(e)&&process.env.HOME&&(e=wo.resolve(process.env.HOME,e.substr(2))),e=wo.resolve(e)),a&&!isNaN(e)&&(e=Number(e)),e},fie=t=>{t=wo.resolve(t);let e=!1;for(;wo.basename(t)==="node_modules";)t=wo.dirname(t),e=!0;if(e)return t;let r=(n,i)=>{let o=/^[a-zA-Z]:(\\|\/)?$/;if(n==="/"||process.platform==="win32"&&o.test(n))return i;try{let s=uie.readdirSync(n);if(s.includes("node_modules")||s.includes("package.json")||s.includes("package.json5")||s.includes("package.yaml")||s.includes("pnpm-workspace.yaml"))return n;let a=wo.dirname(n);return a===n?i:r(a,i)}catch(s){if(n===i){if(s.code==="ENOENT")return i;throw s}return i}};return r(t,t)};Fl.envReplace=Iv;Fl.findPrefix=fie;Fl.parseField=cie;Fl.parseKey=lie});var _j=y(wj=>{"use strict";var _o=require("path"),die=require("stream").Stream,wh=require("url"),hie=()=>{},pie=()=>[],bj=()=>{};wj.types={access:[null,"restricted","public"],"allow-same-version":Boolean,"always-auth":Boolean,also:[null,"dev","development"],audit:Boolean,"auth-type":["legacy","sso","saml","oauth"],"bin-links":Boolean,browser:[null,String],ca:[null,String,Array],cafile:_o,cache:_o,"cache-lock-stale":Number,"cache-lock-retries":Number,"cache-lock-wait":Number,"cache-max":Number,"cache-min":Number,cert:[null,String],cidr:[null,String,Array],color:["always",Boolean],depth:Number,description:Boolean,dev:Boolean,"dry-run":Boolean,editor:String,"engine-strict":Boolean,force:Boolean,"fetch-retries":Number,"fetch-retry-factor":Number,"fetch-retry-mintimeout":Number,"fetch-retry-maxtimeout":Number,git:String,"git-tag-version":Boolean,"commit-hooks":Boolean,global:Boolean,globalconfig:_o,"global-style":Boolean,group:[Number,String],"https-proxy":[null,wh],"user-agent":String,"ham-it-up":Boolean,heading:String,"if-present":Boolean,"ignore-prepublish":Boolean,"ignore-scripts":Boolean,"init-module":_o,"init-author-name":String,"init-author-email":String,"init-author-url":["",wh],"init-license":String,"init-version":bj,json:Boolean,key:[null,String],"legacy-bundling":Boolean,link:Boolean,"local-address":pie(),loglevel:["silent","error","warn","notice","http","timing","info","verbose","silly"],logstream:die,"logs-max":Number,long:Boolean,maxsockets:Number,message:String,"metrics-registry":[null,String],"node-options":[null,String],"node-version":[null,bj],"no-proxy":[null,String,Array],offline:Boolean,"onload-script":[null,String],only:[null,"dev","development","prod","production"],optional:Boolean,"package-lock":Boolean,otp:[null,String],"package-lock-only":Boolean,parseable:Boolean,"prefer-offline":Boolean,"prefer-online":Boolean,prefix:_o,production:Boolean,progress:Boolean,proxy:[null,!1,wh],provenance:Boolean,"read-only":Boolean,"rebuild-bundle":Boolean,registry:[null,wh],rollback:Boolean,save:Boolean,"save-bundle":Boolean,"save-dev":Boolean,"save-exact":Boolean,"save-optional":Boolean,"save-prefix":String,"save-prod":Boolean,scope:String,"script-shell":[null,String],"scripts-prepend-node-path":[!1,!0,"auto","warn-only"],searchopts:String,searchexclude:[null,String],searchlimit:Number,searchstaleness:Number,"send-metrics":Boolean,shell:String,shrinkwrap:Boolean,"sign-git-tag":Boolean,"sso-poll-frequency":Number,"sso-type":[null,"oauth","saml"],"strict-ssl":Boolean,tag:String,timing:Boolean,tmp:_o,unicode:Boolean,"unsafe-perm":Boolean,usage:Boolean,user:[Number,String],userconfig:_o,umask:hie,version:Boolean,"tag-version-prefix":String,versions:Boolean,viewer:String,_exit:Boolean}});var Sj=y((vpe,Cj)=>{"use strict";var{readCAFileSync:mie}=nj(),Ej=require("fs"),jv=require("path"),{ConfigChain:gie}=pj(),yie=gj(),Nv=vj(),Lv=class extends gie{constructor(e,r){super(e),this.root=e,this._parseField=Nv.parseField.bind(null,r||_j())}add(e,r){try{for(let[n,i]of Object.entries(e)){let o=Nv.parseKey(n);o!==n&&delete e[n],e[o]=this._parseField(i,o)}}catch(n){throw n}return super.add(e,r)}addFile(e,r){r=r||e;let n={__source__:r};this.sources[r]={path:e,type:"ini"},this.push(n),this._await();try{let i=Ej.readFileSync(e,"utf8");this.addString(i,e,"ini",n)}catch(i){if(i.code==="ENOENT")this.add({},n);else if(i.code!=="EISDIR")return`Issue while reading "${e}". ${i.message}`}}addEnv(e){e=e||process.env;let r={};return Object.keys(e).filter(n=>/^npm_config_/i.test(n)).forEach(n=>{if(!e[n])return;let i=yie(n.substr(11)),o=e[n];r[i]=Die(i,o)}),super.addEnv("",r,"env")}loadPrefix(){let e=this.list[0];Object.defineProperty(this,"prefix",{enumerable:!0,set:n=>{let i=this.get("global");this[i?"globalPrefix":"localPrefix"]=n},get:()=>this.get("global")?this.globalPrefix:this.localPrefix}),Object.defineProperty(this,"globalPrefix",{enumerable:!0,set:n=>{this.set("prefix",n)},get:()=>jv.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=jv.resolve(e.prefix);else try{r=Nv.findPrefix(process.cwd())}catch(n){throw n}return r}loadCAFile(e){if(!e)return;let r=mie(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=jv.resolve(this.get("prefix"));try{let n=Ej.statSync(r);e.user=n.uid}catch(n){if(n.code==="ENOENT")return;throw n}}};function Die(t,e){function r(n){let i=`
202
+ `}):u&&typeof u=="object"?r.push(o):n+=ha(o)+i+ha(u)+Tv}),e.section&&n.length&&(n="["+ha(e.section)+"]"+Tv+n),r.forEach(function(o,s,a){var u=uj(o).join("\\."),l=(e.section?e.section+".":"")+u,c=aj(t[o],{section:l,whitespace:e.whitespace});n.length&&c.length&&(n+=Tv),n+=c}),n}function uj(t){return t.replace(/\1/g,"LITERAL\\1LITERAL").replace(/\\\./g,"").split(/\./).map(function(e){return e.replace(/\1/g,"\\.").replace(/\2LITERAL\\1LITERAL\2/g,"")})}function Xne(t){var e={},r=e,n=null,i=/^\[([^\]]*)\]$|^([^=]+)(=(.*))?$/i,o=t.split(/[\r\n]+/g);return o.forEach(function(s,a,u){if(!(!s||s.match(/^\s*[;#]/))){var l=s.match(i);if(l){if(l[1]!==void 0){if(n=yh(l[1]),n==="__proto__"){r={};return}r=e[n]=e[n]||{};return}var c=yh(l[2]);if(c!=="__proto__"){var f=l[3]?yh(l[4]):!0;switch(f){case"true":case"false":case"null":f=JSON.parse(f)}if(c.length>2&&c.slice(-2)==="[]"){if(c=c.substring(0,c.length-2),c==="__proto__")return;r[c]?Array.isArray(r[c])||(r[c]=[r[c]]):r[c]=[]}Array.isArray(r[c])?r[c].push(f):r[c]=f}}}}),Object.keys(e).filter(function(s,a,u){if(!e[s]||typeof e[s]!="object"||Array.isArray(e[s]))return!1;var l=uj(s),c=e,f=l.pop(),h=f.replace(/\\\./g,".");return l.forEach(function(d,m,b){d!=="__proto__"&&((!c[d]||typeof c[d]!="object")&&(c[d]={}),c=c[d])}),c===e&&h===f?!1:(c[h]=e[s],!0)}).forEach(function(s,a,u){delete e[s]}),e}function lj(t){return t.charAt(0)==='"'&&t.slice(-1)==='"'||t.charAt(0)==="'"&&t.slice(-1)==="'"}function ha(t){return typeof t!="string"||t.match(/[=\r\n]/)||t.match(/^\[/)||t.length>1&&lj(t)||t!==t.trim()?JSON.stringify(t):t.replace(/;/g,"\\;").replace(/#/g,"\\#")}function yh(t,e){if(t=(t||"").trim(),lj(t)){t.charAt(0)==="'"&&(t=t.substr(1,t.length-2));try{t=JSON.parse(t)}catch{}}else{for(var r=!1,n="",i=0,o=t.length;i<o;i++){var s=t.charAt(i);if(r)"\\;#".indexOf(s)!==-1?n+=s:n+="\\"+s,r=!1;else{if(";#".indexOf(s)!==-1)break;s==="\\"?r=!0:n+=s}}return r&&(n+="\\"),n.trim()}return t}});var pj=D((An,hj)=>{var fj=sj(),xl=require("path"),Dh=require("fs"),Pv=cj(),Rv=require("events").EventEmitter,Zne=require("url"),Qne=require("http"),An=hj.exports=function(){for(var t=[].slice.call(arguments),e=new At;t.length;){var r=t.shift();r&&e.push(typeof r=="string"?tie(r):r)}return e},dpe=An.find=function(){var t=xl.join.apply(null,[].slice.call(arguments));function e(r,n){var i=xl.join(r,n);try{return Dh.statSync(i),i}catch{if(xl.dirname(r)!==r)return e(xl.dirname(r),n)}}return e(__dirname,t)},eie=An.parse=function(t,e,r){if(t=""+t,r)if(r==="json")if(this.emit)try{return JSON.parse(t)}catch(n){this.emit("error",n)}else return JSON.parse(t);else return Pv.parse(t);else try{return JSON.parse(t)}catch{return Pv.parse(t)}},tie=An.json=function(){var t=[].slice.call(arguments).filter(function(n){return n!=null}),e=xl.join.apply(null,t),r;try{r=Dh.readFileSync(e,"utf-8")}catch{return}return eie(r,e,"json")},hpe=An.env=function(t,e){e=e||process.env;var r={},n=t.length;for(var i in e)i.indexOf(t)===0&&(r[i.substring(n)]=e[i]);return r};An.ConfigChain=At;function At(){Rv.apply(this),fj.apply(this,arguments),this._awaiting=0,this._saving=0,this.sources={}}var dj={constructor:{value:At}};Object.keys(Rv.prototype).forEach(function(t){dj[t]=Object.getOwnPropertyDescriptor(Rv.prototype,t)});At.prototype=Object.create(fj.prototype,dj);At.prototype.del=function(t,e){if(e){var r=this.sources[e];if(r=r&&r.data,!r)return this.emit("error",new Error("not found "+e));delete r[t]}else for(var n=0,i=this.list.length;n<i;n++)delete this.list[n][t];return this};At.prototype.set=function(t,e,r){var n;if(r){if(n=this.sources[r],n=n&&n.data,!n)return this.emit("error",new Error("not found "+r))}else if(n=this.list[0],!n)return this.emit("error",new Error("cannot set, no confs!"));return n[t]=e,this};At.prototype.get=function(t,e){return e?(e=this.sources[e],e&&(e=e.data),e&&Object.hasOwnProperty.call(e,t)?e[t]:void 0):this.list[0][t]};At.prototype.save=function(t,o,r){typeof o=="function"&&(r=o,o=null);var n=this.sources[t];if(!n||!(n.path||n.source)||!n.data)return this.emit("error",new Error("bad save target: "+t));if(n.source){var i=n.prefix||"";return Object.keys(n.data).forEach(function(a){n.source[i+a]=n.data[a]}),this}var o=o||n.type,s=n.data;return n.type==="json"?s=JSON.stringify(s):s=Pv.stringify(s),this._saving++,Dh.writeFile(n.path,s,"utf8",function(a){if(this._saving--,a)return r?r(a):this.emit("error",a);this._saving===0&&(r&&r(),this.emit("save"))}.bind(this)),this};At.prototype.addFile=function(t,e,r){r=r||t;var n={__source__:r};return this.sources[r]={path:t,type:e},this.push(n),this._await(),Dh.readFile(t,"utf8",function(i,o){i&&this.emit("error",i),this.addString(o,t,e,n)}.bind(this)),this};At.prototype.addEnv=function(t,e,r){r=r||"env";var n=An.env(t,e);return this.sources[r]={data:n,source:e,prefix:t},this.add(n,r)};At.prototype.addUrl=function(t,e,r){this._await();var n=Zne.format(t);r=r||n;var i={__source__:r};return this.sources[r]={href:n,type:e},this.push(i),Qne.request(t,function(o){var s=[],a=o.headers["content-type"];e||(e=a.indexOf("json")!==-1?"json":a.indexOf("ini")!==-1?"ini":n.match(/\.json$/)?"json":n.match(/\.ini$/)?"ini":null,i.type=e),o.on("data",s.push.bind(s)).on("end",function(){this.addString(Buffer.concat(s),n,e,i)}.bind(this)).on("error",this.emit.bind(this,"error"))}.bind(this)).on("error",this.emit.bind(this,"error")).end(),this};At.prototype.addString=function(t,e,r,n){return t=this.parse(t,e,r),this.add(t,n),this};At.prototype.add=function(t,e){if(e&&typeof e=="object"){var r=this.list.indexOf(e);if(r===-1)return this.emit("error",new Error("bad marker"));this.splice(r,1,t),e=e.__source__,this.sources[e]=this.sources[e]||{},this.sources[e].data=t,this._resolve()}else typeof e=="string"&&(this.sources[e]=this.sources[e]||{},this.sources[e].data=t),this._await(),this.push(t),process.nextTick(this._resolve.bind(this));return this};At.prototype.parse=An.parse;At.prototype._await=function(){this._awaiting++};At.prototype._resolve=function(){this._awaiting--,this._awaiting===0&&this.emit("load",this)}});var gj=D((ppe,mj)=>{mj.exports=function(t){let e=t.indexOf(":");if(e===-1)return $v(t);let r=t.substr(0,e),n=t.substr(e+1);return`${$v(r)}:${$v(n)}`};function $v(t){if(t=t.toLowerCase(),t==="_authtoken")return"_authToken";let e=t[0];for(let r=1;r<t.length;r++)e+=t[r]==="_"?"-":t[r];return e}});var yj=D(vh=>{"use strict";Object.defineProperty(vh,"__esModule",{value:!0});vh.envReplace=void 0;var rie=/(?<!\\)(\\*)\$\{([^${}]+)\}/g;function nie(t,e){return t.replace(rie,iie.bind(null,e))}vh.envReplace=nie;function iie(t,e,r,n){if(r.length%2)return e.slice((r.length+1)/2);let i=sie(t,n);if(i===void 0)throw new Error(`Failed to replace env in config: ${e}`);return`${r.slice(r.length/2)}${i}`}var oie=/([^:-]+)(:?)-(.+)/;function sie(t,e){let r=e.match(oie);if(!r)return t[e];let[,n,i,o]=r;return Object.prototype.hasOwnProperty.call(t,n)?!t[n]&&i?o:t[n]:o}});var Dj=D(bh=>{"use strict";Object.defineProperty(bh,"__esModule",{value:!0});bh.envReplace=void 0;var aie=yj();Object.defineProperty(bh,"envReplace",{enumerable:!0,get:function(){return aie.envReplace}})});var vj=D(Fl=>{"use strict";var uie=require("fs"),wo=require("path"),{envReplace:Iv}=Dj(),lie=t=>typeof t!="string"?t:Iv(t,process.env),cie=(t,e,r)=>{if(typeof e!="string")return e;let n=[].concat(t[r]),i=n.indexOf(wo)!==-1,o=n.indexOf(Boolean)!==-1,s=n.indexOf(String)!==-1,a=n.indexOf(Number)!==-1;if(e=`${e}`.trim(),/^".*"$/.test(e))try{e=JSON.parse(e)}catch{throw new Error(`Failed parsing JSON config key ${r}: ${e}`)}if(o&&!s&&e==="")return!0;switch(e){case"true":return!0;case"false":return!1;case"null":return null;case"undefined":return}return e=Iv(e,process.env),i&&((process.platform==="win32"?/^~(\/|\\)/:/^~\//).test(e)&&process.env.HOME&&(e=wo.resolve(process.env.HOME,e.substr(2))),e=wo.resolve(e)),a&&!isNaN(e)&&(e=Number(e)),e},fie=t=>{t=wo.resolve(t);let e=!1;for(;wo.basename(t)==="node_modules";)t=wo.dirname(t),e=!0;if(e)return t;let r=(n,i)=>{let o=/^[a-zA-Z]:(\\|\/)?$/;if(n==="/"||process.platform==="win32"&&o.test(n))return i;try{let s=uie.readdirSync(n);if(s.includes("node_modules")||s.includes("package.json")||s.includes("package.json5")||s.includes("package.yaml")||s.includes("pnpm-workspace.yaml"))return n;let a=wo.dirname(n);return a===n?i:r(a,i)}catch(s){if(n===i){if(s.code==="ENOENT")return i;throw s}return i}};return r(t,t)};Fl.envReplace=Iv;Fl.findPrefix=fie;Fl.parseField=cie;Fl.parseKey=lie});var _j=D(wj=>{"use strict";var _o=require("path"),die=require("stream").Stream,wh=require("url"),hie=()=>{},pie=()=>[],bj=()=>{};wj.types={access:[null,"restricted","public"],"allow-same-version":Boolean,"always-auth":Boolean,also:[null,"dev","development"],audit:Boolean,"auth-type":["legacy","sso","saml","oauth"],"bin-links":Boolean,browser:[null,String],ca:[null,String,Array],cafile:_o,cache:_o,"cache-lock-stale":Number,"cache-lock-retries":Number,"cache-lock-wait":Number,"cache-max":Number,"cache-min":Number,cert:[null,String],cidr:[null,String,Array],color:["always",Boolean],depth:Number,description:Boolean,dev:Boolean,"dry-run":Boolean,editor:String,"engine-strict":Boolean,force:Boolean,"fetch-retries":Number,"fetch-retry-factor":Number,"fetch-retry-mintimeout":Number,"fetch-retry-maxtimeout":Number,git:String,"git-tag-version":Boolean,"commit-hooks":Boolean,global:Boolean,globalconfig:_o,"global-style":Boolean,group:[Number,String],"https-proxy":[null,wh],"user-agent":String,"ham-it-up":Boolean,heading:String,"if-present":Boolean,"ignore-prepublish":Boolean,"ignore-scripts":Boolean,"init-module":_o,"init-author-name":String,"init-author-email":String,"init-author-url":["",wh],"init-license":String,"init-version":bj,json:Boolean,key:[null,String],"legacy-bundling":Boolean,link:Boolean,"local-address":pie(),loglevel:["silent","error","warn","notice","http","timing","info","verbose","silly"],logstream:die,"logs-max":Number,long:Boolean,maxsockets:Number,message:String,"metrics-registry":[null,String],"node-options":[null,String],"node-version":[null,bj],"no-proxy":[null,String,Array],offline:Boolean,"onload-script":[null,String],only:[null,"dev","development","prod","production"],optional:Boolean,"package-lock":Boolean,otp:[null,String],"package-lock-only":Boolean,parseable:Boolean,"prefer-offline":Boolean,"prefer-online":Boolean,prefix:_o,production:Boolean,progress:Boolean,proxy:[null,!1,wh],provenance:Boolean,"read-only":Boolean,"rebuild-bundle":Boolean,registry:[null,wh],rollback:Boolean,save:Boolean,"save-bundle":Boolean,"save-dev":Boolean,"save-exact":Boolean,"save-optional":Boolean,"save-prefix":String,"save-prod":Boolean,scope:String,"script-shell":[null,String],"scripts-prepend-node-path":[!1,!0,"auto","warn-only"],searchopts:String,searchexclude:[null,String],searchlimit:Number,searchstaleness:Number,"send-metrics":Boolean,shell:String,shrinkwrap:Boolean,"sign-git-tag":Boolean,"sso-poll-frequency":Number,"sso-type":[null,"oauth","saml"],"strict-ssl":Boolean,tag:String,timing:Boolean,tmp:_o,unicode:Boolean,"unsafe-perm":Boolean,usage:Boolean,user:[Number,String],userconfig:_o,umask:hie,version:Boolean,"tag-version-prefix":String,versions:Boolean,viewer:String,_exit:Boolean}});var Sj=D((vpe,Cj)=>{"use strict";var{readCAFileSync:mie}=nj(),Ej=require("fs"),jv=require("path"),{ConfigChain:gie}=pj(),yie=gj(),Nv=vj(),Lv=class extends gie{constructor(e,r){super(e),this.root=e,this._parseField=Nv.parseField.bind(null,r||_j())}add(e,r){try{for(let[n,i]of Object.entries(e)){let o=Nv.parseKey(n);o!==n&&delete e[n],e[o]=this._parseField(i,o)}}catch(n){throw n}return super.add(e,r)}addFile(e,r){r=r||e;let n={__source__:r};this.sources[r]={path:e,type:"ini"},this.push(n),this._await();try{let i=Ej.readFileSync(e,"utf8");this.addString(i,e,"ini",n)}catch(i){if(i.code==="ENOENT")this.add({},n);else if(i.code!=="EISDIR")return`Issue while reading "${e}". ${i.message}`}}addEnv(e){e=e||process.env;let r={};return Object.keys(e).filter(n=>/^npm_config_/i.test(n)).forEach(n=>{if(!e[n])return;let i=yie(n.substr(11)),o=e[n];r[i]=Die(i,o)}),super.addEnv("",r,"env")}loadPrefix(){let e=this.list[0];Object.defineProperty(this,"prefix",{enumerable:!0,set:n=>{let i=this.get("global");this[i?"globalPrefix":"localPrefix"]=n},get:()=>this.get("global")?this.globalPrefix:this.localPrefix}),Object.defineProperty(this,"globalPrefix",{enumerable:!0,set:n=>{this.set("prefix",n)},get:()=>jv.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=jv.resolve(e.prefix);else try{r=Nv.findPrefix(process.cwd())}catch(n){throw n}return r}loadCAFile(e){if(!e)return;let r=mie(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=jv.resolve(this.get("prefix"));try{let n=Ej.statSync(r);e.user=n.uid}catch(n){if(n.code==="ENOENT")return;throw n}}};function Die(t,e){function r(n){let i=`
203
203
 
204
- `;return n.indexOf(i)?n.split(i):n.split(",")}switch(t){case"hoist-pattern":case"public-hoist-pattern":return r(e)}return e}Cj.exports=Lv});var Tj=y(kj=>{"use strict";var Oj=require("os"),kn=require("path"),Aj=Oj.tmpdir(),vie=process.getuid?process.getuid():process.pid,bie=()=>!0,xj=process.platform==="win32",Fj={editor:()=>process.env.EDITOR||process.env.VISUAL||(xj?"notepad.exe":"vi"),shell:()=>xj?process.env.COMSPEC||"cmd.exe":process.env.SHELL||"/bin/bash"},wie={fromString:()=>process.umask()},pa=Oj.homedir();pa?process.env.HOME=pa:pa=kn.resolve(Aj,"npm-"+vie);var _ie=process.platform==="win32"?"npm-cache":".npm",Eie=process.platform==="win32"&&process.env.APPDATA||pa,Cie=kn.resolve(Eie,_ie),_h,Eo;Object.defineProperty(kj,"defaults",{get:function(){return _h||(process.env.PREFIX?Eo=process.env.PREFIX:process.platform==="win32"?Eo=kn.dirname(process.execPath):(Eo=kn.dirname(kn.dirname(process.execPath)),process.env.DESTDIR&&(Eo=kn.join(process.env.DESTDIR,Eo))),_h={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:Cie,"cache-lock-stale":6e4,"cache-lock-retries":10,"cache-lock-wait":1e4,"cache-max":1/0,"cache-min":10,cert:null,cidr:null,color:process.env.NO_COLOR==null,depth:1/0,description:!0,dev:!1,"dry-run":!1,editor:Fj.editor(),"engine-strict":!1,force:!1,"fetch-retries":2,"fetch-retry-factor":10,"fetch-retry-mintimeout":1e4,"fetch-retry-maxtimeout":6e4,git:"git","git-tag-version":!0,"commit-hooks":!0,global:!1,globalconfig:kn.resolve(Eo,"etc","npmrc"),"global-style":!1,group:process.platform==="win32"?0:process.env.SUDO_GID||process.getgid&&process.getgid(),"ham-it-up":!1,heading:"npm","if-present":!1,"ignore-prepublish":!1,"ignore-scripts":!1,"init-module":kn.resolve(pa,".npm-init.js"),"init-author-name":"","init-author-email":"","init-author-url":"","init-version":"1.0.0","init-license":"ISC",json:!1,key:null,"legacy-bundling":!1,link:!1,"local-address":void 0,loglevel:"notice",logstream:process.stderr,"logs-max":10,long:!1,maxsockets:50,message:"%s","metrics-registry":null,"node-options":null,offline:!1,"onload-script":!1,only:null,optional:!0,otp:null,"package-lock":!0,"package-lock-only":!1,parseable:!1,"prefer-offline":!1,"prefer-online":!1,prefix:Eo,production:process.env.NODE_ENV==="production",progress:!process.env.TRAVIS&&!process.env.CI,provenance:!1,proxy:null,"https-proxy":null,"no-proxy":null,"user-agent":"npm/{npm-version} node/{node-version} {platform} {arch}","read-only":!1,"rebuild-bundle":!0,registry:"https://registry.npmjs.org/",rollback:!0,save:!0,"save-bundle":!1,"save-dev":!1,"save-exact":!1,"save-optional":!1,"save-prefix":"^","save-prod":!1,scope:"","script-shell":null,"scripts-prepend-node-path":"warn-only",searchopts:"",searchexclude:null,searchlimit:20,searchstaleness:15*60,"send-metrics":!1,shell:Fj.shell(),shrinkwrap:!0,"sign-git-tag":!1,"sso-poll-frequency":500,"sso-type":"oauth","strict-ssl":!0,tag:"latest","tag-version-prefix":"v",timing:!1,tmp:Aj,unicode:bie(),"unsafe-perm":process.platform==="win32"||process.platform==="cygwin"||!(process.getuid&&process.setuid&&process.getgid&&process.setgid)||process.getuid()!==0,usage:!1,user:process.platform==="win32"?0:"nobody",userconfig:kn.resolve(pa,".npmrc"),umask:process.umask?process.umask():wie.fromString("022"),version:!1,versions:!1,viewer:process.platform==="win32"?"browser":"man",_exit:!0},_h)}})});var Rj=y((wpe,Bv)=>{"use strict";var Co=require("path"),Sie=Sj(),Pj=Tj();Bv.exports=(t,e,r)=>{let n=new Sie(Object.assign({},Pj.defaults,r),e);n.add(Object.assign({},t),"cli");let i=[],o=!1;if(require.resolve.paths){let l=require.resolve.paths("npm"),c;try{c=require.resolve("npm",{paths:l.slice(-1)})}catch{o=!0}c&&i.push(n.addFile(Co.resolve(Co.dirname(c),"..","npmrc"),"builtin"))}n.addEnv(),n.loadPrefix();let s=Co.resolve(n.localPrefix,".npmrc"),a=n.get("userconfig");if(!n.get("global")&&s!==a?i.push(n.addFile(s,"project")):n.add({},"project"),n.get("workspace-prefix")&&n.get("workspace-prefix")!==s){let l=Co.resolve(n.get("workspace-prefix"),".npmrc");i.push(n.addFile(l,"workspace"))}if(i.push(n.addFile(n.get("userconfig"),"user")),n.get("prefix")){let l=Co.resolve(n.get("prefix"),"etc");n.root.globalconfig=Co.resolve(l,"npmrc"),n.root.globalignorefile=Co.resolve(l,"npmignore")}i.push(n.addFile(n.get("globalconfig"),"global")),n.loadUser();let u=n.get("cafile");return u&&n.loadCAFile(u),{config:n,warnings:i.filter(Boolean),failedToLoadBuiltInConfig:o}};Object.defineProperty(Bv.exports,"defaults",{get(){return Pj.defaults},enumerable:!0})});var Mj=y((_pe,qj)=>{var qv=require("url"),$j=Rj(),Ij=":_authToken",jj=":_auth",Nj=":username",Lj=":_password";qj.exports=function(){let e,r;arguments.length>=2?(e=arguments[0],r=Object.assign({},arguments[1])):typeof arguments[0]=="string"?e=arguments[0]:r=Object.assign({},arguments[0]),r=r||{};let n=r.npmrc;return r.npmrc=(r.npmrc?{config:{get:i=>n[i]}}:$j()).config,e=e||r.npmrc.get("registry")||$j.defaults.registry,Bj(e,r)||xie(r.npmrc)};function Bj(t,e){let r=qv.parse(t,!1,!0),n;for(;n!=="/"&&r.pathname!==n;){n=r.pathname||"/";let i="//"+r.host+n.replace(/\/$/,""),o=Oie(i,e.npmrc);if(o)return o;if(!e.recursive)return/\/$/.test(t)?void 0:Bj(qv.resolve(t,"."),e);r.pathname=qv.resolve(Fie(n),"..")||"/"}}function xie(t){return t.get("_auth")?{token:Eh(t.get("_auth")),type:"Basic"}:void 0}function Fie(t){return t[t.length-1]==="/"?t:t+"/"}function Oie(t,e){let r=Aie(e.get(t+Ij)||e.get(t+"/"+Ij));if(r)return r;let n=e.get(t+Nj)||e.get(t+"/"+Nj),i=e.get(t+Lj)||e.get(t+"/"+Lj),o=kie(n,i);if(o)return o;let s=Tie(e.get(t+jj)||e.get(t+"/"+jj));if(s)return s}function Eh(t){return t.replace(/^\$\{?([^}]*)\}?$/,function(e,r){return process.env[r]})}function Aie(t){return t?{token:Eh(t),type:"Bearer"}:void 0}function kie(t,e){if(!t||!e)return;let r=Buffer.from(Eh(e),"base64").toString("utf8");return{token:Buffer.from(t+":"+r,"utf8").toString("base64"),type:"Basic",password:r,username:t}}function Tie(t){return t?{token:Eh(t),type:"Basic"}:void 0}});var I8=y((v0e,jn)=>{var ot=require("fs"),_b=require("os"),ur=require("path"),b8=require("crypto"),sn={fs:ot.constants,os:_b.constants},w8="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",E8=/XXXXXX/,_oe=3,C8=(sn.O_CREAT||sn.fs.O_CREAT)|(sn.O_EXCL||sn.fs.O_EXCL)|(sn.O_RDWR||sn.fs.O_RDWR),Eoe=_b.platform()==="win32",Coe=sn.EBADF||sn.os.errno.EBADF,Soe=sn.ENOENT||sn.os.errno.ENOENT,S8=448,x8=384,xoe="exit",Ca=[],F8=ot.rmdirSync.bind(ot),O8=!1;function Foe(t,e){return ot.rm(t,{recursive:!0},e)}function A8(t){return ot.rmSync(t,{recursive:!0})}function Eb(t,e){let r=Sa(t,e),n=r[0],i=r[1];try{P8(n)}catch(s){return i(s)}let o=n.tries;(function s(){try{let a=T8(n);ot.stat(a,function(u){if(!u)return o-- >0?s():i(new Error("Could not get a unique tmp filename, max tries reached "+a));i(null,a)})}catch(a){i(a)}})()}function Cb(t){let e=Sa(t),r=e[0];P8(r);let n=r.tries;do{let i=T8(r);try{ot.statSync(i)}catch{return i}}while(n-- >0);throw new Error("Could not get a unique tmp filename, max tries reached")}function Ooe(t,e){let r=Sa(t,e),n=r[0],i=r[1];Eb(n,function(s,a){if(s)return i(s);ot.open(a,C8,n.mode||x8,function(l,c){if(l)return i(l);if(n.discardDescriptor)return ot.close(c,function(h){return i(h,a,void 0,vb(a,-1,n,!1))});{let f=n.discardDescriptor||n.detachDescriptor;i(null,a,c,vb(a,f?-1:c,n,!1))}})})}function Aoe(t){let e=Sa(t),r=e[0],n=r.discardDescriptor||r.detachDescriptor,i=Cb(r);var o=ot.openSync(i,C8,r.mode||x8);return r.discardDescriptor&&(ot.closeSync(o),o=void 0),{name:i,fd:o,removeCallback:vb(i,n?-1:o,r,!0)}}function koe(t,e){let r=Sa(t,e),n=r[0],i=r[1];Eb(n,function(s,a){if(s)return i(s);ot.mkdir(a,n.mode||S8,function(l){if(l)return i(l);i(null,a,k8(a,n,!1))})})}function Toe(t){let e=Sa(t),r=e[0],n=Cb(r);return ot.mkdirSync(n,r.mode||S8),{name:n,removeCallback:k8(n,r,!0)}}function Poe(t,e){let r=function(n){if(n&&!wb(n))return e(n);e()};0<=t[0]?ot.close(t[0],function(){ot.unlink(t[1],r)}):ot.unlink(t[1],r)}function Roe(t){let e=null;try{0<=t[0]&&ot.closeSync(t[0])}catch(r){if(!joe(r)&&!wb(r))throw r}finally{try{ot.unlinkSync(t[1])}catch(r){wb(r)||(e=r)}}if(e!==null)throw e}function vb(t,e,r,n){let i=Hh(Roe,[e,t],n),o=Hh(Poe,[e,t],n,i);return r.keep||Ca.unshift(i),n?i:o}function k8(t,e,r){let n=e.unsafeCleanup?Foe:ot.rmdir.bind(ot),i=e.unsafeCleanup?A8:F8,o=Hh(i,t,r),s=Hh(n,t,r,o);return e.keep||Ca.unshift(o),r?o:s}function Hh(t,e,r,n){let i=!1;return function o(s){if(!i){let a=n||o,u=Ca.indexOf(a);return u>=0&&Ca.splice(u,1),i=!0,r||t===F8||t===A8?t(e):t(e,s||function(){})}}}function $oe(){if(O8)for(;Ca.length;)try{Ca[0]()}catch{}}function _8(t){let e=[],r=null;try{r=b8.randomBytes(t)}catch{r=b8.pseudoRandomBytes(t)}for(var n=0;n<t;n++)e.push(w8[r[n]%w8.length]);return e.join("")}function Ioe(t){return t===null||Zt(t)||!t.trim()}function Zt(t){return typeof t>"u"}function Sa(t,e){if(typeof t=="function")return[{},t];if(Zt(t))return[{},e];let r={};for(let n of Object.getOwnPropertyNames(t))r[n]=t[n];return[r,e]}function T8(t){let e=t.tmpdir;if(!Zt(t.name))return ur.join(e,t.dir,t.name);if(!Zt(t.template))return ur.join(e,t.dir,t.template).replace(E8,_8(6));let r=[t.prefix?t.prefix:"tmp","-",process.pid,"-",_8(12),t.postfix?"-"+t.postfix:""].join("");return ur.join(e,t.dir,r)}function P8(t){t.tmpdir=$8(t);let e=t.tmpdir;if(Zt(t.name)||Db(t.name,"name",e),Zt(t.dir)||Db(t.dir,"dir",e),!Zt(t.template)&&(Db(t.template,"template",e),!t.template.match(E8)))throw new Error(`Invalid template, found "${t.template}".`);if(!Zt(t.tries)&&isNaN(t.tries)||t.tries<0)throw new Error(`Invalid tries, found "${t.tries}".`);t.tries=Zt(t.name)?t.tries||_oe:1,t.keep=!!t.keep,t.detachDescriptor=!!t.detachDescriptor,t.discardDescriptor=!!t.discardDescriptor,t.unsafeCleanup=!!t.unsafeCleanup,t.dir=Zt(t.dir)?"":ur.relative(e,bb(t.dir,e)),t.template=Zt(t.template)?void 0:ur.relative(e,bb(t.template,e)),t.template=Ioe(t.template)?void 0:ur.relative(t.dir,t.template),t.name=Zt(t.name)?void 0:t.name,t.prefix=Zt(t.prefix)?"":t.prefix,t.postfix=Zt(t.postfix)?"":t.postfix}function bb(t,e){return t.startsWith(e)?ur.resolve(t):ur.resolve(ur.join(e,t))}function Db(t,e,r){if(e==="name"){if(ur.isAbsolute(t))throw new Error(`${e} option must not contain an absolute path, found "${t}".`);let n=ur.basename(t);if(n===".."||n==="."||n!==t)throw new Error(`${e} option must not contain a path, found "${t}".`)}else{if(ur.isAbsolute(t)&&!t.startsWith(r))throw new Error(`${e} option must be relative to "${r}", found "${t}".`);let n=bb(t,r);if(!n.startsWith(r))throw new Error(`${e} option must be relative to "${r}", found "${n}".`)}}function joe(t){return R8(t,-Coe,"EBADF")}function wb(t){return R8(t,-Soe,"ENOENT")}function R8(t,e,r){return Eoe?t.code===r:t.code===r&&t.errno===e}function Noe(){O8=!0}function $8(t){return ur.resolve(t&&t.tmpdir||_b.tmpdir())}process.addListener(xoe,$oe);Object.defineProperty(jn.exports,"tmpdir",{enumerable:!0,configurable:!1,get:function(){return $8()}});jn.exports.dir=koe;jn.exports.dirSync=Toe;jn.exports.file=Ooe;jn.exports.fileSync=Aoe;jn.exports.tmpName=Eb;jn.exports.tmpNameSync=Cb;jn.exports.setGracefulCleanup=Noe});var Hb=ue(Ub(),1),{program:k,createCommand:cse,createArgument:fse,createOption:dse,CommanderError:hse,InvalidArgumentError:pse,InvalidOptionArgumentError:mse,Command:gse,Argument:yse,Option:Dse,Help:vse}=Hb.default;var Cr={name:"@capgo/cli",version:"7.0.5",description:"A CLI to upload to capgo servers",author:"github.com/riderx",license:"Apache 2.0",homepage:"https://github.com/Cap-go/CLIl#readme",repository:{type:"git",url:"git+https://github.com/Cap-go/CLI.git"},bugs:{url:"https://github.com/Cap-go/CLI/issues"},keywords:["appflow alternative","ionic","capacitor","auto update","live update","capgo","cli","upload","capgo-cli"],main:"dist/index.js",bin:{capgo:"dist/index.js"},engines:{npm:">=8.0.0",node:">=20.0.0"},scripts:{build:"tsc && node build.mjs",dev:"NODE_ENV=development ncc build","no-debug":"node dist/index.js",test:"npx --yes ts-node -T src/index.ts","dev-build":"SUPA_DB=development ncc build",pack:"pkg",types:"npx --yes supabase gen types typescript --project-id=xvwzpoazmxkqosrdewyv > src/types/supabase.types.ts",test_rls:"ts-node ./test/test_headers_rls.ts",lint:'eslint "src/**/*.ts" --fix',"check-posix-paths":"node test/check-posix-paths.js"},devDependencies:{"@antfu/eslint-config":"^4.1.1","@bradenmacdonald/s3-lite-client":"npm:@jsr/bradenmacdonald__s3-lite-client","@capacitor/cli":"^7.0.1","@capgo/find-package-manager":"^0.0.17","@clack/prompts":"^0.10.0","@sauber/table":"npm:@jsr/sauber__table","@std/semver":"npm:@jsr/std__semver","@supabase/supabase-js":"^2.48.1","@tomasklaen/checksum":"^1.1.0","@types/adm-zip":"^0.5.7","@types/node":"^22.13.1","@types/prettyjson":"^0.0.33","@types/tmp":"^0.2.6","@vercel/ncc":"^0.38.3","adm-zip":"^0.5.16","ci-info":"^4.1.0",commander:"13.0.0",esbuild:"^0.25.0",eslint:"9.18.0","git-format-staged":"3.1.1",husky:"^9.1.7","is-wsl":"^3.1.0",ky:"^1.7.4","latest-version":"^9.0.0",open:"^10.1.0",pkg:"5.8.1",prettyjson:"^1.2.5",tmp:"^0.2.3","ts-loader":"^9.5.2","ts-node":"^10.9.2","tsconfig-paths":"4.2.0","tus-js-client":"^4.3.1",typescript:"5.7.3"},dependencies:{"@types/semver":"^7.5.8",semver:"^7.7.1"}};var ma=require("node:fs"),Vj=require("node:process");var St=ue(Te(),1),$o=require("node:process"),Ln=ue(require("node:readline"),1),gp=ue(require("node:readline"),1),ew=require("node:tty"),tw=ue(hp(),1);function vN({onlyFirst:t=!1}={}){let e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");return new RegExp(e,t?void 0:"g")}var bN=vN();function rw(t){if(typeof t!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);return t.replace(bN,"")}function nw(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var iw={exports:{}};(function(t){var e={};t.exports=e,e.eastAsianWidth=function(n){var i=n.charCodeAt(0),o=n.length==2?n.charCodeAt(1):0,s=i;return 55296<=i&&i<=56319&&56320<=o&&o<=57343&&(i&=1023,o&=1023,s=i<<10|o,s+=65536),s==12288||65281<=s&&s<=65376||65504<=s&&s<=65510?"F":s==8361||65377<=s&&s<=65470||65474<=s&&s<=65479||65482<=s&&s<=65487||65490<=s&&s<=65495||65498<=s&&s<=65500||65512<=s&&s<=65518?"H":4352<=s&&s<=4447||4515<=s&&s<=4519||4602<=s&&s<=4607||9001<=s&&s<=9002||11904<=s&&s<=11929||11931<=s&&s<=12019||12032<=s&&s<=12245||12272<=s&&s<=12283||12289<=s&&s<=12350||12353<=s&&s<=12438||12441<=s&&s<=12543||12549<=s&&s<=12589||12593<=s&&s<=12686||12688<=s&&s<=12730||12736<=s&&s<=12771||12784<=s&&s<=12830||12832<=s&&s<=12871||12880<=s&&s<=13054||13056<=s&&s<=19903||19968<=s&&s<=42124||42128<=s&&s<=42182||43360<=s&&s<=43388||44032<=s&&s<=55203||55216<=s&&s<=55238||55243<=s&&s<=55291||63744<=s&&s<=64255||65040<=s&&s<=65049||65072<=s&&s<=65106||65108<=s&&s<=65126||65128<=s&&s<=65131||110592<=s&&s<=110593||127488<=s&&s<=127490||127504<=s&&s<=127546||127552<=s&&s<=127560||127568<=s&&s<=127569||131072<=s&&s<=194367||177984<=s&&s<=196605||196608<=s&&s<=262141?"W":32<=s&&s<=126||162<=s&&s<=163||165<=s&&s<=166||s==172||s==175||10214<=s&&s<=10221||10629<=s&&s<=10630?"Na":s==161||s==164||167<=s&&s<=168||s==170||173<=s&&s<=174||176<=s&&s<=180||182<=s&&s<=186||188<=s&&s<=191||s==198||s==208||215<=s&&s<=216||222<=s&&s<=225||s==230||232<=s&&s<=234||236<=s&&s<=237||s==240||242<=s&&s<=243||247<=s&&s<=250||s==252||s==254||s==257||s==273||s==275||s==283||294<=s&&s<=295||s==299||305<=s&&s<=307||s==312||319<=s&&s<=322||s==324||328<=s&&s<=331||s==333||338<=s&&s<=339||358<=s&&s<=359||s==363||s==462||s==464||s==466||s==468||s==470||s==472||s==474||s==476||s==593||s==609||s==708||s==711||713<=s&&s<=715||s==717||s==720||728<=s&&s<=731||s==733||s==735||768<=s&&s<=879||913<=s&&s<=929||931<=s&&s<=937||945<=s&&s<=961||963<=s&&s<=969||s==1025||1040<=s&&s<=1103||s==1105||s==8208||8211<=s&&s<=8214||8216<=s&&s<=8217||8220<=s&&s<=8221||8224<=s&&s<=8226||8228<=s&&s<=8231||s==8240||8242<=s&&s<=8243||s==8245||s==8251||s==8254||s==8308||s==8319||8321<=s&&s<=8324||s==8364||s==8451||s==8453||s==8457||s==8467||s==8470||8481<=s&&s<=8482||s==8486||s==8491||8531<=s&&s<=8532||8539<=s&&s<=8542||8544<=s&&s<=8555||8560<=s&&s<=8569||s==8585||8592<=s&&s<=8601||8632<=s&&s<=8633||s==8658||s==8660||s==8679||s==8704||8706<=s&&s<=8707||8711<=s&&s<=8712||s==8715||s==8719||s==8721||s==8725||s==8730||8733<=s&&s<=8736||s==8739||s==8741||8743<=s&&s<=8748||s==8750||8756<=s&&s<=8759||8764<=s&&s<=8765||s==8776||s==8780||s==8786||8800<=s&&s<=8801||8804<=s&&s<=8807||8810<=s&&s<=8811||8814<=s&&s<=8815||8834<=s&&s<=8835||8838<=s&&s<=8839||s==8853||s==8857||s==8869||s==8895||s==8978||9312<=s&&s<=9449||9451<=s&&s<=9547||9552<=s&&s<=9587||9600<=s&&s<=9615||9618<=s&&s<=9621||9632<=s&&s<=9633||9635<=s&&s<=9641||9650<=s&&s<=9651||9654<=s&&s<=9655||9660<=s&&s<=9661||9664<=s&&s<=9665||9670<=s&&s<=9672||s==9675||9678<=s&&s<=9681||9698<=s&&s<=9701||s==9711||9733<=s&&s<=9734||s==9737||9742<=s&&s<=9743||9748<=s&&s<=9749||s==9756||s==9758||s==9792||s==9794||9824<=s&&s<=9825||9827<=s&&s<=9829||9831<=s&&s<=9834||9836<=s&&s<=9837||s==9839||9886<=s&&s<=9887||9918<=s&&s<=9919||9924<=s&&s<=9933||9935<=s&&s<=9953||s==9955||9960<=s&&s<=9983||s==10045||s==10071||10102<=s&&s<=10111||11093<=s&&s<=11097||12872<=s&&s<=12879||57344<=s&&s<=63743||65024<=s&&s<=65039||s==65533||127232<=s&&s<=127242||127248<=s&&s<=127277||127280<=s&&s<=127337||127344<=s&&s<=127386||917760<=s&&s<=917999||983040<=s&&s<=1048573||1048576<=s&&s<=1114109?"A":"N"},e.characterLength=function(n){var i=this.eastAsianWidth(n);return i=="F"||i=="W"||i=="A"?2:1};function r(n){return n.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}e.length=function(n){for(var i=r(n),o=0,s=0;s<i.length;s++)o=o+this.characterLength(i[s]);return o},e.slice=function(n,i,o){textLen=e.length(n),i=i||0,o=o||1,i<0&&(i=textLen+i),o<0&&(o=textLen+o);for(var s="",a=0,u=r(n),l=0;l<u.length;l++){var c=u[l],f=e.length(c);if(a>=i-(f==2?1:0))if(a+f<=o)s+=c;else break;a+=f}return s}})(iw);var wN=iw.exports,_N=nw(wN),EN=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},CN=nw(EN);function Aa(t,e={}){if(typeof t!="string"||t.length===0||(e={ambiguousIsNarrow:!0,...e},t=rw(t),t.length===0))return 0;t=t.replace(CN()," ");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(_N.eastAsianWidth(i)){case"F":case"W":n+=2;break;case"A":n+=r;break;default:n+=1}}return n}var pp=10,Wb=(t=0)=>e=>`\x1B[${e+t}m`,Kb=(t=0)=>e=>`\x1B[${38+t};5;${e}m`,Yb=(t=0)=>(e,r,n)=>`\x1B[${38+t};2;${e};${r};${n}m`,Ne={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};Object.keys(Ne.modifier);var SN=Object.keys(Ne.color),xN=Object.keys(Ne.bgColor);[...SN,...xN];function FN(){let t=new Map;for(let[e,r]of Object.entries(Ne)){for(let[n,i]of Object.entries(r))Ne[n]={open:`\x1B[${i[0]}m`,close:`\x1B[${i[1]}m`},r[n]=Ne[n],t.set(i[0],i[1]);Object.defineProperty(Ne,e,{value:r,enumerable:!1})}return Object.defineProperty(Ne,"codes",{value:t,enumerable:!1}),Ne.color.close="\x1B[39m",Ne.bgColor.close="\x1B[49m",Ne.color.ansi=Wb(),Ne.color.ansi256=Kb(),Ne.color.ansi16m=Yb(),Ne.bgColor.ansi=Wb(pp),Ne.bgColor.ansi256=Kb(pp),Ne.bgColor.ansi16m=Yb(pp),Object.defineProperties(Ne,{rgbToAnsi256:{value:(e,r,n)=>e===r&&r===n?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5),enumerable:!1},hexToRgb:{value:e=>{let r=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!r)return[0,0,0];let[n]=r;n.length===3&&(n=[...n].map(o=>o+o).join(""));let i=Number.parseInt(n,16);return[i>>16&255,i>>8&255,i&255]},enumerable:!1},hexToAnsi256:{value:e=>Ne.rgbToAnsi256(...Ne.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value:e=>{if(e<8)return 30+e;if(e<16)return 90+(e-8);let r,n,i;if(e>=232)r=((e-232)*10+8)/255,n=r,i=r;else{e-=16;let a=e%36;r=Math.floor(e/36)/5,n=Math.floor(a/6)/5,i=a%6/5}let o=Math.max(r,n,i)*2;if(o===0)return 30;let s=30+(Math.round(i)<<2|Math.round(n)<<1|Math.round(r));return o===2&&(s+=60),s},enumerable:!1},rgbToAnsi:{value:(e,r,n)=>Ne.ansi256ToAnsi(Ne.rgbToAnsi256(e,r,n)),enumerable:!1},hexToAnsi:{value:e=>Ne.ansi256ToAnsi(Ne.hexToAnsi256(e)),enumerable:!1}}),Ne}var ON=FN(),Zl=new Set(["\x1B","\x9B"]),AN=39,Dp="\x07",ow="[",kN="]",sw="m",vp=`${kN}8;;`,Jb=t=>`${Zl.values().next().value}${ow}${t}${sw}`,Xb=t=>`${Zl.values().next().value}${vp}${t}${Dp}`,TN=t=>t.split(" ").map(e=>Aa(e)),mp=(t,e,r)=>{let n=[...e],i=!1,o=!1,s=Aa(rw(t[t.length-1]));for(let[a,u]of n.entries()){let l=Aa(u);if(s+l<=r?t[t.length-1]+=u:(t.push(u),s=0),Zl.has(u)&&(i=!0,o=n.slice(a+1).join("").startsWith(vp)),i){o?u===Dp&&(i=!1,o=!1):u===sw&&(i=!1);continue}s+=l,s===r&&a<n.length-1&&(t.push(""),s=0)}!s&&t[t.length-1].length>0&&t.length>1&&(t[t.length-2]+=t.pop())},PN=t=>{let e=t.split(" "),r=e.length;for(;r>0&&!(Aa(e[r-1])>0);)r--;return r===e.length?t:e.slice(0,r).join(" ")+e.slice(r).join("")},RN=(t,e,r={})=>{if(r.trim!==!1&&t.trim()==="")return"";let n="",i,o,s=TN(t),a=[""];for(let[l,c]of t.split(" ").entries()){r.trim!==!1&&(a[a.length-1]=a[a.length-1].trimStart());let f=Aa(a[a.length-1]);if(l!==0&&(f>=e&&(r.wordWrap===!1||r.trim===!1)&&(a.push(""),f=0),(f>0||r.trim===!1)&&(a[a.length-1]+=" ",f++)),r.hard&&s[l]>e){let h=e-f,d=1+Math.floor((s[l]-h-1)/e);Math.floor((s[l]-1)/e)<d&&a.push(""),mp(a,c,e);continue}if(f+s[l]>e&&f>0&&s[l]>0){if(r.wordWrap===!1&&f<e){mp(a,c,e);continue}a.push("")}if(f+s[l]>e&&r.wordWrap===!1){mp(a,c,e);continue}a[a.length-1]+=c}r.trim!==!1&&(a=a.map(l=>PN(l)));let u=[...a.join(`
204
+ `;return n.indexOf(i)?n.split(i):n.split(",")}switch(t){case"hoist-pattern":case"public-hoist-pattern":return r(e)}return e}Cj.exports=Lv});var Tj=D(kj=>{"use strict";var Oj=require("os"),kn=require("path"),Aj=Oj.tmpdir(),vie=process.getuid?process.getuid():process.pid,bie=()=>!0,xj=process.platform==="win32",Fj={editor:()=>process.env.EDITOR||process.env.VISUAL||(xj?"notepad.exe":"vi"),shell:()=>xj?process.env.COMSPEC||"cmd.exe":process.env.SHELL||"/bin/bash"},wie={fromString:()=>process.umask()},pa=Oj.homedir();pa?process.env.HOME=pa:pa=kn.resolve(Aj,"npm-"+vie);var _ie=process.platform==="win32"?"npm-cache":".npm",Eie=process.platform==="win32"&&process.env.APPDATA||pa,Cie=kn.resolve(Eie,_ie),_h,Eo;Object.defineProperty(kj,"defaults",{get:function(){return _h||(process.env.PREFIX?Eo=process.env.PREFIX:process.platform==="win32"?Eo=kn.dirname(process.execPath):(Eo=kn.dirname(kn.dirname(process.execPath)),process.env.DESTDIR&&(Eo=kn.join(process.env.DESTDIR,Eo))),_h={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:Cie,"cache-lock-stale":6e4,"cache-lock-retries":10,"cache-lock-wait":1e4,"cache-max":1/0,"cache-min":10,cert:null,cidr:null,color:process.env.NO_COLOR==null,depth:1/0,description:!0,dev:!1,"dry-run":!1,editor:Fj.editor(),"engine-strict":!1,force:!1,"fetch-retries":2,"fetch-retry-factor":10,"fetch-retry-mintimeout":1e4,"fetch-retry-maxtimeout":6e4,git:"git","git-tag-version":!0,"commit-hooks":!0,global:!1,globalconfig:kn.resolve(Eo,"etc","npmrc"),"global-style":!1,group:process.platform==="win32"?0:process.env.SUDO_GID||process.getgid&&process.getgid(),"ham-it-up":!1,heading:"npm","if-present":!1,"ignore-prepublish":!1,"ignore-scripts":!1,"init-module":kn.resolve(pa,".npm-init.js"),"init-author-name":"","init-author-email":"","init-author-url":"","init-version":"1.0.0","init-license":"ISC",json:!1,key:null,"legacy-bundling":!1,link:!1,"local-address":void 0,loglevel:"notice",logstream:process.stderr,"logs-max":10,long:!1,maxsockets:50,message:"%s","metrics-registry":null,"node-options":null,offline:!1,"onload-script":!1,only:null,optional:!0,otp:null,"package-lock":!0,"package-lock-only":!1,parseable:!1,"prefer-offline":!1,"prefer-online":!1,prefix:Eo,production:process.env.NODE_ENV==="production",progress:!process.env.TRAVIS&&!process.env.CI,provenance:!1,proxy:null,"https-proxy":null,"no-proxy":null,"user-agent":"npm/{npm-version} node/{node-version} {platform} {arch}","read-only":!1,"rebuild-bundle":!0,registry:"https://registry.npmjs.org/",rollback:!0,save:!0,"save-bundle":!1,"save-dev":!1,"save-exact":!1,"save-optional":!1,"save-prefix":"^","save-prod":!1,scope:"","script-shell":null,"scripts-prepend-node-path":"warn-only",searchopts:"",searchexclude:null,searchlimit:20,searchstaleness:15*60,"send-metrics":!1,shell:Fj.shell(),shrinkwrap:!0,"sign-git-tag":!1,"sso-poll-frequency":500,"sso-type":"oauth","strict-ssl":!0,tag:"latest","tag-version-prefix":"v",timing:!1,tmp:Aj,unicode:bie(),"unsafe-perm":process.platform==="win32"||process.platform==="cygwin"||!(process.getuid&&process.setuid&&process.getgid&&process.setgid)||process.getuid()!==0,usage:!1,user:process.platform==="win32"?0:"nobody",userconfig:kn.resolve(pa,".npmrc"),umask:process.umask?process.umask():wie.fromString("022"),version:!1,versions:!1,viewer:process.platform==="win32"?"browser":"man",_exit:!0},_h)}})});var Rj=D((wpe,Bv)=>{"use strict";var Co=require("path"),Sie=Sj(),Pj=Tj();Bv.exports=(t,e,r)=>{let n=new Sie(Object.assign({},Pj.defaults,r),e);n.add(Object.assign({},t),"cli");let i=[],o=!1;if(require.resolve.paths){let l=require.resolve.paths("npm"),c;try{c=require.resolve("npm",{paths:l.slice(-1)})}catch{o=!0}c&&i.push(n.addFile(Co.resolve(Co.dirname(c),"..","npmrc"),"builtin"))}n.addEnv(),n.loadPrefix();let s=Co.resolve(n.localPrefix,".npmrc"),a=n.get("userconfig");if(!n.get("global")&&s!==a?i.push(n.addFile(s,"project")):n.add({},"project"),n.get("workspace-prefix")&&n.get("workspace-prefix")!==s){let l=Co.resolve(n.get("workspace-prefix"),".npmrc");i.push(n.addFile(l,"workspace"))}if(i.push(n.addFile(n.get("userconfig"),"user")),n.get("prefix")){let l=Co.resolve(n.get("prefix"),"etc");n.root.globalconfig=Co.resolve(l,"npmrc"),n.root.globalignorefile=Co.resolve(l,"npmignore")}i.push(n.addFile(n.get("globalconfig"),"global")),n.loadUser();let u=n.get("cafile");return u&&n.loadCAFile(u),{config:n,warnings:i.filter(Boolean),failedToLoadBuiltInConfig:o}};Object.defineProperty(Bv.exports,"defaults",{get(){return Pj.defaults},enumerable:!0})});var Mj=D((_pe,qj)=>{var qv=require("url"),$j=Rj(),Ij=":_authToken",jj=":_auth",Nj=":username",Lj=":_password";qj.exports=function(){let e,r;arguments.length>=2?(e=arguments[0],r=Object.assign({},arguments[1])):typeof arguments[0]=="string"?e=arguments[0]:r=Object.assign({},arguments[0]),r=r||{};let n=r.npmrc;return r.npmrc=(r.npmrc?{config:{get:i=>n[i]}}:$j()).config,e=e||r.npmrc.get("registry")||$j.defaults.registry,Bj(e,r)||xie(r.npmrc)};function Bj(t,e){let r=qv.parse(t,!1,!0),n;for(;n!=="/"&&r.pathname!==n;){n=r.pathname||"/";let i="//"+r.host+n.replace(/\/$/,""),o=Oie(i,e.npmrc);if(o)return o;if(!e.recursive)return/\/$/.test(t)?void 0:Bj(qv.resolve(t,"."),e);r.pathname=qv.resolve(Fie(n),"..")||"/"}}function xie(t){return t.get("_auth")?{token:Eh(t.get("_auth")),type:"Basic"}:void 0}function Fie(t){return t[t.length-1]==="/"?t:t+"/"}function Oie(t,e){let r=Aie(e.get(t+Ij)||e.get(t+"/"+Ij));if(r)return r;let n=e.get(t+Nj)||e.get(t+"/"+Nj),i=e.get(t+Lj)||e.get(t+"/"+Lj),o=kie(n,i);if(o)return o;let s=Tie(e.get(t+jj)||e.get(t+"/"+jj));if(s)return s}function Eh(t){return t.replace(/^\$\{?([^}]*)\}?$/,function(e,r){return process.env[r]})}function Aie(t){return t?{token:Eh(t),type:"Bearer"}:void 0}function kie(t,e){if(!t||!e)return;let r=Buffer.from(Eh(e),"base64").toString("utf8");return{token:Buffer.from(t+":"+r,"utf8").toString("base64"),type:"Basic",password:r,username:t}}function Tie(t){return t?{token:Eh(t),type:"Basic"}:void 0}});var I8=D((v0e,jn)=>{var ot=require("fs"),_b=require("os"),ur=require("path"),b8=require("crypto"),sn={fs:ot.constants,os:_b.constants},w8="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",E8=/XXXXXX/,_oe=3,C8=(sn.O_CREAT||sn.fs.O_CREAT)|(sn.O_EXCL||sn.fs.O_EXCL)|(sn.O_RDWR||sn.fs.O_RDWR),Eoe=_b.platform()==="win32",Coe=sn.EBADF||sn.os.errno.EBADF,Soe=sn.ENOENT||sn.os.errno.ENOENT,S8=448,x8=384,xoe="exit",Ca=[],F8=ot.rmdirSync.bind(ot),O8=!1;function Foe(t,e){return ot.rm(t,{recursive:!0},e)}function A8(t){return ot.rmSync(t,{recursive:!0})}function Eb(t,e){let r=Sa(t,e),n=r[0],i=r[1];try{P8(n)}catch(s){return i(s)}let o=n.tries;(function s(){try{let a=T8(n);ot.stat(a,function(u){if(!u)return o-- >0?s():i(new Error("Could not get a unique tmp filename, max tries reached "+a));i(null,a)})}catch(a){i(a)}})()}function Cb(t){let e=Sa(t),r=e[0];P8(r);let n=r.tries;do{let i=T8(r);try{ot.statSync(i)}catch{return i}}while(n-- >0);throw new Error("Could not get a unique tmp filename, max tries reached")}function Ooe(t,e){let r=Sa(t,e),n=r[0],i=r[1];Eb(n,function(s,a){if(s)return i(s);ot.open(a,C8,n.mode||x8,function(l,c){if(l)return i(l);if(n.discardDescriptor)return ot.close(c,function(h){return i(h,a,void 0,vb(a,-1,n,!1))});{let f=n.discardDescriptor||n.detachDescriptor;i(null,a,c,vb(a,f?-1:c,n,!1))}})})}function Aoe(t){let e=Sa(t),r=e[0],n=r.discardDescriptor||r.detachDescriptor,i=Cb(r);var o=ot.openSync(i,C8,r.mode||x8);return r.discardDescriptor&&(ot.closeSync(o),o=void 0),{name:i,fd:o,removeCallback:vb(i,n?-1:o,r,!0)}}function koe(t,e){let r=Sa(t,e),n=r[0],i=r[1];Eb(n,function(s,a){if(s)return i(s);ot.mkdir(a,n.mode||S8,function(l){if(l)return i(l);i(null,a,k8(a,n,!1))})})}function Toe(t){let e=Sa(t),r=e[0],n=Cb(r);return ot.mkdirSync(n,r.mode||S8),{name:n,removeCallback:k8(n,r,!0)}}function Poe(t,e){let r=function(n){if(n&&!wb(n))return e(n);e()};0<=t[0]?ot.close(t[0],function(){ot.unlink(t[1],r)}):ot.unlink(t[1],r)}function Roe(t){let e=null;try{0<=t[0]&&ot.closeSync(t[0])}catch(r){if(!joe(r)&&!wb(r))throw r}finally{try{ot.unlinkSync(t[1])}catch(r){wb(r)||(e=r)}}if(e!==null)throw e}function vb(t,e,r,n){let i=Hh(Roe,[e,t],n),o=Hh(Poe,[e,t],n,i);return r.keep||Ca.unshift(i),n?i:o}function k8(t,e,r){let n=e.unsafeCleanup?Foe:ot.rmdir.bind(ot),i=e.unsafeCleanup?A8:F8,o=Hh(i,t,r),s=Hh(n,t,r,o);return e.keep||Ca.unshift(o),r?o:s}function Hh(t,e,r,n){let i=!1;return function o(s){if(!i){let a=n||o,u=Ca.indexOf(a);return u>=0&&Ca.splice(u,1),i=!0,r||t===F8||t===A8?t(e):t(e,s||function(){})}}}function $oe(){if(O8)for(;Ca.length;)try{Ca[0]()}catch{}}function _8(t){let e=[],r=null;try{r=b8.randomBytes(t)}catch{r=b8.pseudoRandomBytes(t)}for(var n=0;n<t;n++)e.push(w8[r[n]%w8.length]);return e.join("")}function Ioe(t){return t===null||Zt(t)||!t.trim()}function Zt(t){return typeof t>"u"}function Sa(t,e){if(typeof t=="function")return[{},t];if(Zt(t))return[{},e];let r={};for(let n of Object.getOwnPropertyNames(t))r[n]=t[n];return[r,e]}function T8(t){let e=t.tmpdir;if(!Zt(t.name))return ur.join(e,t.dir,t.name);if(!Zt(t.template))return ur.join(e,t.dir,t.template).replace(E8,_8(6));let r=[t.prefix?t.prefix:"tmp","-",process.pid,"-",_8(12),t.postfix?"-"+t.postfix:""].join("");return ur.join(e,t.dir,r)}function P8(t){t.tmpdir=$8(t);let e=t.tmpdir;if(Zt(t.name)||Db(t.name,"name",e),Zt(t.dir)||Db(t.dir,"dir",e),!Zt(t.template)&&(Db(t.template,"template",e),!t.template.match(E8)))throw new Error(`Invalid template, found "${t.template}".`);if(!Zt(t.tries)&&isNaN(t.tries)||t.tries<0)throw new Error(`Invalid tries, found "${t.tries}".`);t.tries=Zt(t.name)?t.tries||_oe:1,t.keep=!!t.keep,t.detachDescriptor=!!t.detachDescriptor,t.discardDescriptor=!!t.discardDescriptor,t.unsafeCleanup=!!t.unsafeCleanup,t.dir=Zt(t.dir)?"":ur.relative(e,bb(t.dir,e)),t.template=Zt(t.template)?void 0:ur.relative(e,bb(t.template,e)),t.template=Ioe(t.template)?void 0:ur.relative(t.dir,t.template),t.name=Zt(t.name)?void 0:t.name,t.prefix=Zt(t.prefix)?"":t.prefix,t.postfix=Zt(t.postfix)?"":t.postfix}function bb(t,e){return t.startsWith(e)?ur.resolve(t):ur.resolve(ur.join(e,t))}function Db(t,e,r){if(e==="name"){if(ur.isAbsolute(t))throw new Error(`${e} option must not contain an absolute path, found "${t}".`);let n=ur.basename(t);if(n===".."||n==="."||n!==t)throw new Error(`${e} option must not contain a path, found "${t}".`)}else{if(ur.isAbsolute(t)&&!t.startsWith(r))throw new Error(`${e} option must be relative to "${r}", found "${t}".`);let n=bb(t,r);if(!n.startsWith(r))throw new Error(`${e} option must be relative to "${r}", found "${n}".`)}}function joe(t){return R8(t,-Coe,"EBADF")}function wb(t){return R8(t,-Soe,"ENOENT")}function R8(t,e,r){return Eoe?t.code===r:t.code===r&&t.errno===e}function Noe(){O8=!0}function $8(t){return ur.resolve(t&&t.tmpdir||_b.tmpdir())}process.addListener(xoe,$oe);Object.defineProperty(jn.exports,"tmpdir",{enumerable:!0,configurable:!1,get:function(){return $8()}});jn.exports.dir=koe;jn.exports.dirSync=Toe;jn.exports.file=Ooe;jn.exports.fileSync=Aoe;jn.exports.tmpName=Eb;jn.exports.tmpNameSync=Cb;jn.exports.setGracefulCleanup=Noe});var Hb=ue(Ub(),1),{program:k,createCommand:cse,createArgument:fse,createOption:dse,CommanderError:hse,InvalidArgumentError:pse,InvalidOptionArgumentError:mse,Command:gse,Argument:yse,Option:Dse,Help:vse}=Hb.default;var Cr={name:"@capgo/cli",version:"7.0.8",description:"A CLI to upload to capgo servers",author:"github.com/riderx",license:"Apache 2.0",homepage:"https://github.com/Cap-go/CLIl#readme",repository:{type:"git",url:"git+https://github.com/Cap-go/CLI.git"},bugs:{url:"https://github.com/Cap-go/CLI/issues"},keywords:["appflow alternative","ionic","capacitor","auto update","live update","capgo","cli","upload","capgo-cli"],main:"dist/index.js",bin:{capgo:"dist/index.js"},engines:{npm:">=8.0.0",node:">=20.0.0"},scripts:{build:"tsc && node build.mjs",dev:"NODE_ENV=development ncc build","no-debug":"node dist/index.js",test:"npx --yes ts-node -T src/index.ts","dev-build":"SUPA_DB=development ncc build",pack:"pkg",types:"npx --yes supabase gen types typescript --project-id=xvwzpoazmxkqosrdewyv > src/types/supabase.types.ts",test_rls:"ts-node ./test/test_headers_rls.ts",lint:'eslint "src/**/*.ts" --fix',"check-posix-paths":"node test/check-posix-paths.js"},devDependencies:{"@antfu/eslint-config":"^4.1.1","@bradenmacdonald/s3-lite-client":"npm:@jsr/bradenmacdonald__s3-lite-client","@capacitor/cli":"^7.0.1","@capgo/find-package-manager":"^0.0.17","@clack/prompts":"^0.10.0","@sauber/table":"npm:@jsr/sauber__table","@std/semver":"npm:@jsr/std__semver","@supabase/supabase-js":"^2.48.1","@tomasklaen/checksum":"^1.1.0","@types/adm-zip":"^0.5.7","@types/node":"^22.13.1","@types/prettyjson":"^0.0.33","@types/tmp":"^0.2.6","@vercel/ncc":"^0.38.3","adm-zip":"^0.5.16","ci-info":"^4.1.0",commander:"13.0.0",esbuild:"^0.25.0",eslint:"9.18.0","git-format-staged":"3.1.1",husky:"^9.1.7","is-wsl":"^3.1.0",ky:"^1.7.4","latest-version":"^9.0.0",open:"^10.1.0",pkg:"5.8.1",prettyjson:"^1.2.5",tmp:"^0.2.3","ts-loader":"^9.5.2","ts-node":"^10.9.2","tsconfig-paths":"4.2.0","tus-js-client":"^4.3.1",typescript:"5.7.3"},dependencies:{"@types/semver":"^7.5.8",semver:"^7.7.1"}};var ma=require("node:fs"),Vj=require("node:process");var St=ue(Te(),1),$o=require("node:process"),Ln=ue(require("node:readline"),1),gp=ue(require("node:readline"),1),ew=require("node:tty"),tw=ue(hp(),1);function vN({onlyFirst:t=!1}={}){let e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");return new RegExp(e,t?void 0:"g")}var bN=vN();function rw(t){if(typeof t!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);return t.replace(bN,"")}function nw(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var iw={exports:{}};(function(t){var e={};t.exports=e,e.eastAsianWidth=function(n){var i=n.charCodeAt(0),o=n.length==2?n.charCodeAt(1):0,s=i;return 55296<=i&&i<=56319&&56320<=o&&o<=57343&&(i&=1023,o&=1023,s=i<<10|o,s+=65536),s==12288||65281<=s&&s<=65376||65504<=s&&s<=65510?"F":s==8361||65377<=s&&s<=65470||65474<=s&&s<=65479||65482<=s&&s<=65487||65490<=s&&s<=65495||65498<=s&&s<=65500||65512<=s&&s<=65518?"H":4352<=s&&s<=4447||4515<=s&&s<=4519||4602<=s&&s<=4607||9001<=s&&s<=9002||11904<=s&&s<=11929||11931<=s&&s<=12019||12032<=s&&s<=12245||12272<=s&&s<=12283||12289<=s&&s<=12350||12353<=s&&s<=12438||12441<=s&&s<=12543||12549<=s&&s<=12589||12593<=s&&s<=12686||12688<=s&&s<=12730||12736<=s&&s<=12771||12784<=s&&s<=12830||12832<=s&&s<=12871||12880<=s&&s<=13054||13056<=s&&s<=19903||19968<=s&&s<=42124||42128<=s&&s<=42182||43360<=s&&s<=43388||44032<=s&&s<=55203||55216<=s&&s<=55238||55243<=s&&s<=55291||63744<=s&&s<=64255||65040<=s&&s<=65049||65072<=s&&s<=65106||65108<=s&&s<=65126||65128<=s&&s<=65131||110592<=s&&s<=110593||127488<=s&&s<=127490||127504<=s&&s<=127546||127552<=s&&s<=127560||127568<=s&&s<=127569||131072<=s&&s<=194367||177984<=s&&s<=196605||196608<=s&&s<=262141?"W":32<=s&&s<=126||162<=s&&s<=163||165<=s&&s<=166||s==172||s==175||10214<=s&&s<=10221||10629<=s&&s<=10630?"Na":s==161||s==164||167<=s&&s<=168||s==170||173<=s&&s<=174||176<=s&&s<=180||182<=s&&s<=186||188<=s&&s<=191||s==198||s==208||215<=s&&s<=216||222<=s&&s<=225||s==230||232<=s&&s<=234||236<=s&&s<=237||s==240||242<=s&&s<=243||247<=s&&s<=250||s==252||s==254||s==257||s==273||s==275||s==283||294<=s&&s<=295||s==299||305<=s&&s<=307||s==312||319<=s&&s<=322||s==324||328<=s&&s<=331||s==333||338<=s&&s<=339||358<=s&&s<=359||s==363||s==462||s==464||s==466||s==468||s==470||s==472||s==474||s==476||s==593||s==609||s==708||s==711||713<=s&&s<=715||s==717||s==720||728<=s&&s<=731||s==733||s==735||768<=s&&s<=879||913<=s&&s<=929||931<=s&&s<=937||945<=s&&s<=961||963<=s&&s<=969||s==1025||1040<=s&&s<=1103||s==1105||s==8208||8211<=s&&s<=8214||8216<=s&&s<=8217||8220<=s&&s<=8221||8224<=s&&s<=8226||8228<=s&&s<=8231||s==8240||8242<=s&&s<=8243||s==8245||s==8251||s==8254||s==8308||s==8319||8321<=s&&s<=8324||s==8364||s==8451||s==8453||s==8457||s==8467||s==8470||8481<=s&&s<=8482||s==8486||s==8491||8531<=s&&s<=8532||8539<=s&&s<=8542||8544<=s&&s<=8555||8560<=s&&s<=8569||s==8585||8592<=s&&s<=8601||8632<=s&&s<=8633||s==8658||s==8660||s==8679||s==8704||8706<=s&&s<=8707||8711<=s&&s<=8712||s==8715||s==8719||s==8721||s==8725||s==8730||8733<=s&&s<=8736||s==8739||s==8741||8743<=s&&s<=8748||s==8750||8756<=s&&s<=8759||8764<=s&&s<=8765||s==8776||s==8780||s==8786||8800<=s&&s<=8801||8804<=s&&s<=8807||8810<=s&&s<=8811||8814<=s&&s<=8815||8834<=s&&s<=8835||8838<=s&&s<=8839||s==8853||s==8857||s==8869||s==8895||s==8978||9312<=s&&s<=9449||9451<=s&&s<=9547||9552<=s&&s<=9587||9600<=s&&s<=9615||9618<=s&&s<=9621||9632<=s&&s<=9633||9635<=s&&s<=9641||9650<=s&&s<=9651||9654<=s&&s<=9655||9660<=s&&s<=9661||9664<=s&&s<=9665||9670<=s&&s<=9672||s==9675||9678<=s&&s<=9681||9698<=s&&s<=9701||s==9711||9733<=s&&s<=9734||s==9737||9742<=s&&s<=9743||9748<=s&&s<=9749||s==9756||s==9758||s==9792||s==9794||9824<=s&&s<=9825||9827<=s&&s<=9829||9831<=s&&s<=9834||9836<=s&&s<=9837||s==9839||9886<=s&&s<=9887||9918<=s&&s<=9919||9924<=s&&s<=9933||9935<=s&&s<=9953||s==9955||9960<=s&&s<=9983||s==10045||s==10071||10102<=s&&s<=10111||11093<=s&&s<=11097||12872<=s&&s<=12879||57344<=s&&s<=63743||65024<=s&&s<=65039||s==65533||127232<=s&&s<=127242||127248<=s&&s<=127277||127280<=s&&s<=127337||127344<=s&&s<=127386||917760<=s&&s<=917999||983040<=s&&s<=1048573||1048576<=s&&s<=1114109?"A":"N"},e.characterLength=function(n){var i=this.eastAsianWidth(n);return i=="F"||i=="W"||i=="A"?2:1};function r(n){return n.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}e.length=function(n){for(var i=r(n),o=0,s=0;s<i.length;s++)o=o+this.characterLength(i[s]);return o},e.slice=function(n,i,o){textLen=e.length(n),i=i||0,o=o||1,i<0&&(i=textLen+i),o<0&&(o=textLen+o);for(var s="",a=0,u=r(n),l=0;l<u.length;l++){var c=u[l],f=e.length(c);if(a>=i-(f==2?1:0))if(a+f<=o)s+=c;else break;a+=f}return s}})(iw);var wN=iw.exports,_N=nw(wN),EN=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},CN=nw(EN);function Aa(t,e={}){if(typeof t!="string"||t.length===0||(e={ambiguousIsNarrow:!0,...e},t=rw(t),t.length===0))return 0;t=t.replace(CN()," ");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(_N.eastAsianWidth(i)){case"F":case"W":n+=2;break;case"A":n+=r;break;default:n+=1}}return n}var pp=10,Wb=(t=0)=>e=>`\x1B[${e+t}m`,Kb=(t=0)=>e=>`\x1B[${38+t};5;${e}m`,Yb=(t=0)=>(e,r,n)=>`\x1B[${38+t};2;${e};${r};${n}m`,Ne={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};Object.keys(Ne.modifier);var SN=Object.keys(Ne.color),xN=Object.keys(Ne.bgColor);[...SN,...xN];function FN(){let t=new Map;for(let[e,r]of Object.entries(Ne)){for(let[n,i]of Object.entries(r))Ne[n]={open:`\x1B[${i[0]}m`,close:`\x1B[${i[1]}m`},r[n]=Ne[n],t.set(i[0],i[1]);Object.defineProperty(Ne,e,{value:r,enumerable:!1})}return Object.defineProperty(Ne,"codes",{value:t,enumerable:!1}),Ne.color.close="\x1B[39m",Ne.bgColor.close="\x1B[49m",Ne.color.ansi=Wb(),Ne.color.ansi256=Kb(),Ne.color.ansi16m=Yb(),Ne.bgColor.ansi=Wb(pp),Ne.bgColor.ansi256=Kb(pp),Ne.bgColor.ansi16m=Yb(pp),Object.defineProperties(Ne,{rgbToAnsi256:{value:(e,r,n)=>e===r&&r===n?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5),enumerable:!1},hexToRgb:{value:e=>{let r=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!r)return[0,0,0];let[n]=r;n.length===3&&(n=[...n].map(o=>o+o).join(""));let i=Number.parseInt(n,16);return[i>>16&255,i>>8&255,i&255]},enumerable:!1},hexToAnsi256:{value:e=>Ne.rgbToAnsi256(...Ne.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value:e=>{if(e<8)return 30+e;if(e<16)return 90+(e-8);let r,n,i;if(e>=232)r=((e-232)*10+8)/255,n=r,i=r;else{e-=16;let a=e%36;r=Math.floor(e/36)/5,n=Math.floor(a/6)/5,i=a%6/5}let o=Math.max(r,n,i)*2;if(o===0)return 30;let s=30+(Math.round(i)<<2|Math.round(n)<<1|Math.round(r));return o===2&&(s+=60),s},enumerable:!1},rgbToAnsi:{value:(e,r,n)=>Ne.ansi256ToAnsi(Ne.rgbToAnsi256(e,r,n)),enumerable:!1},hexToAnsi:{value:e=>Ne.ansi256ToAnsi(Ne.hexToAnsi256(e)),enumerable:!1}}),Ne}var ON=FN(),Zl=new Set(["\x1B","\x9B"]),AN=39,Dp="\x07",ow="[",kN="]",sw="m",vp=`${kN}8;;`,Jb=t=>`${Zl.values().next().value}${ow}${t}${sw}`,Xb=t=>`${Zl.values().next().value}${vp}${t}${Dp}`,TN=t=>t.split(" ").map(e=>Aa(e)),mp=(t,e,r)=>{let n=[...e],i=!1,o=!1,s=Aa(rw(t[t.length-1]));for(let[a,u]of n.entries()){let l=Aa(u);if(s+l<=r?t[t.length-1]+=u:(t.push(u),s=0),Zl.has(u)&&(i=!0,o=n.slice(a+1).join("").startsWith(vp)),i){o?u===Dp&&(i=!1,o=!1):u===sw&&(i=!1);continue}s+=l,s===r&&a<n.length-1&&(t.push(""),s=0)}!s&&t[t.length-1].length>0&&t.length>1&&(t[t.length-2]+=t.pop())},PN=t=>{let e=t.split(" "),r=e.length;for(;r>0&&!(Aa(e[r-1])>0);)r--;return r===e.length?t:e.slice(0,r).join(" ")+e.slice(r).join("")},RN=(t,e,r={})=>{if(r.trim!==!1&&t.trim()==="")return"";let n="",i,o,s=TN(t),a=[""];for(let[l,c]of t.split(" ").entries()){r.trim!==!1&&(a[a.length-1]=a[a.length-1].trimStart());let f=Aa(a[a.length-1]);if(l!==0&&(f>=e&&(r.wordWrap===!1||r.trim===!1)&&(a.push(""),f=0),(f>0||r.trim===!1)&&(a[a.length-1]+=" ",f++)),r.hard&&s[l]>e){let h=e-f,d=1+Math.floor((s[l]-h-1)/e);Math.floor((s[l]-1)/e)<d&&a.push(""),mp(a,c,e);continue}if(f+s[l]>e&&f>0&&s[l]>0){if(r.wordWrap===!1&&f<e){mp(a,c,e);continue}a.push("")}if(f+s[l]>e&&r.wordWrap===!1){mp(a,c,e);continue}a[a.length-1]+=c}r.trim!==!1&&(a=a.map(l=>PN(l)));let u=[...a.join(`
205
205
  `)];for(let[l,c]of u.entries()){if(n+=c,Zl.has(c)){let{groups:h}=new RegExp(`(?:\\${ow}(?<code>\\d+)m|\\${vp}(?<uri>.*)${Dp})`).exec(u.slice(l).join(""))||{groups:{}};if(h.code!==void 0){let d=Number.parseFloat(h.code);i=d===AN?void 0:d}else h.uri!==void 0&&(o=h.uri.length===0?void 0:h.uri)}let f=ON.codes.get(Number(i));u[l+1]===`
206
206
  `?(o&&(n+=Xb("")),i&&f&&(n+=Jb(f))):c===`
207
207
  `&&(i&&f&&(n+=Jb(i)),o&&(n+=Xb(o)))}return n};function Zb(t,e,r){return String(t).normalize().replace(/\r\n/g,`
@@ -244,10 +244,10 @@ ${U.default.gray(Io)} ${t}
244
244
  `)}
245
245
  `)},info:t=>{p.message(t,{symbol:U.default.blue(VN)})},success:t=>{p.message(t,{symbol:U.default.green(zN)})},step:t=>{p.message(t,{symbol:U.default.green(Cp)})},warn:t=>{p.message(t,{symbol:U.default.yellow(GN)})},warning:t=>{p.warn(t)},error:t=>{p.message(t,{symbol:U.default.red(WN)})}},Bse=`${U.default.gray(Ue)} `;var _e=({indicator:t="dots"}={})=>{let e=wp?["\u25D2","\u25D0","\u25D3","\u25D1"]:["\u2022","o","O","0"],r=wp?80:120,n=process.env.CI==="true",i,o,s=!1,a="",u,l=performance.now(),c=C=>{let A=C>1?"Something went wrong":"Canceled";s&&g(A,C)},f=()=>c(2),h=()=>c(1),d=()=>{process.on("uncaughtExceptionMonitor",f),process.on("unhandledRejection",f),process.on("SIGINT",h),process.on("SIGTERM",h),process.on("exit",c)},m=()=>{process.removeListener("uncaughtExceptionMonitor",f),process.removeListener("unhandledRejection",f),process.removeListener("SIGINT",h),process.removeListener("SIGTERM",h),process.removeListener("exit",c)},b=()=>{if(u===void 0)return;n&&process.stdout.write(`
246
246
  `);let C=u.split(`
247
- `);process.stdout.write(Ql.cursor.move(-999,C.length-1)),process.stdout.write(Ql.erase.down(C.length))},D=C=>C.replace(/\.+$/,""),_=C=>{let A=(performance.now()-C)/1e3,T=Math.floor(A/60),x=Math.floor(A%60);return T>0?`[${T}m ${x}s]`:`[${x}s]`},F=(C="")=>{s=!0,i=aw(),a=D(C),l=performance.now(),process.stdout.write(`${U.default.gray(Ue)}
248
- `);let A=0,T=0;d(),o=setInterval(()=>{if(n&&a===u)return;b(),u=a;let x=U.default.magenta(e[A]);if(n)process.stdout.write(`${x} ${a}...`);else if(t==="timer")process.stdout.write(`${x} ${a} ${_(l)}`);else{let L=".".repeat(Math.floor(T)).slice(0,3);process.stdout.write(`${x} ${a}${L}`)}A=A+1<e.length?A+1:0,T=T<e.length?T+.125:0},r)},g=(C="",A=0)=>{s=!1,clearInterval(o),b();let T=A===0?U.default.green(Cp):A===1?U.default.red(uw):U.default.red(lw);a=D(C??a),t==="timer"?process.stdout.write(`${T} ${a} ${_(l)}
247
+ `);process.stdout.write(Ql.cursor.move(-999,C.length-1)),process.stdout.write(Ql.erase.down(C.length))},y=C=>C.replace(/\.+$/,""),E=C=>{let A=(performance.now()-C)/1e3,T=Math.floor(A/60),x=Math.floor(A%60);return T>0?`[${T}m ${x}s]`:`[${x}s]`},F=(C="")=>{s=!0,i=aw(),a=y(C),l=performance.now(),process.stdout.write(`${U.default.gray(Ue)}
248
+ `);let A=0,T=0;d(),o=setInterval(()=>{if(n&&a===u)return;b(),u=a;let x=U.default.magenta(e[A]);if(n)process.stdout.write(`${x} ${a}...`);else if(t==="timer")process.stdout.write(`${x} ${a} ${E(l)}`);else{let L=".".repeat(Math.floor(T)).slice(0,3);process.stdout.write(`${x} ${a}${L}`)}A=A+1<e.length?A+1:0,T=T<e.length?T+.125:0},r)},g=(C="",A=0)=>{s=!1,clearInterval(o),b();let T=A===0?U.default.green(Cp):A===1?U.default.red(uw):U.default.red(lw);a=y(C??a),t==="timer"?process.stdout.write(`${T} ${a} ${E(l)}
249
249
  `):process.stdout.write(`${T} ${a}
250
- `),m(),i()};return{start:F,stop:g,message:(C="")=>{a=D(C??a)}}};var et=require("node:fs"),ih=require("node:os"),Qe=ue(require("node:path")),Nt=require("node:process"),rn=ue(rc());var fn=require("fs"),Pa=(t=".",e="unknown")=>{let r=`${t}/bun.lockb`,n=`${t}/pnpm-lock.yaml`,i=`${t}/yarn.lock`,o=`${t}/package-lock.json`;return(0,fn.existsSync)(r)?"bun":(0,fn.existsSync)(n)?"pnpm":(0,fn.existsSync)(i)?"yarn":(0,fn.existsSync)(o)?"npm":e},nc=(t=Pa(),e=!1)=>{switch(t){case"bun":return e?"bun install":"install";case"pnpm":return e?"pnpm install":"install";case"yarn":return e?"yarn install":"install";case"npm":return e?"npm install":"install";case"unknown":return e?"unknown unknown":"unknown";default:return e?"npm install":"install"}},cw=(t=".",e="npx")=>{let r=`${t}/bun.lockb`,n=`${t}/pnpm-lock.yaml`,i=`${t}/yarn.lock`,o=`${t}/package-lock.json`;return(0,fn.existsSync)(r)?"bunx":(0,fn.existsSync)(n)?"pnpm exec":(0,fn.existsSync)(i)?"yarn dlx":(0,fn.existsSync)(o)?"npx":e};var ra=ue(a_()),Q$=ue(fu()),yv=ue(tC());var Wn=class extends Error{response;request;options;constructor(e,r,n){let i=e.status||e.status===0?e.status:"",o=e.statusText||"",s=`${i} ${o}`.trim(),a=s?`status code ${s}`:"an unknown error";super(`Request failed with ${a}: ${r.method} ${r.url}`),this.name="HTTPError",this.response=e,this.request=r,this.options=n}};var rs=class extends Error{request;constructor(e){super(`Request timed out: ${e.method} ${e.url}`),this.name="TimeoutError",this.request=e}};var ns=t=>t!==null&&typeof t=="object";var hu=(...t)=>{for(let e of t)if((!ns(e)||Array.isArray(e))&&e!==void 0)throw new TypeError("The `options` argument must be an object");return hg({},...t)},fg=(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 Hc(t,e,r){return Object.hasOwn(e,r)&&e[r]===void 0?[]:hg(t[r]??[],e[r]??[])}var dg=(t={},e={})=>({beforeRequest:Hc(t,e,"beforeRequest"),beforeRetry:Hc(t,e,"beforeRetry"),afterResponse:Hc(t,e,"afterResponse"),beforeError:Hc(t,e,"beforeError")}),hg=(...t)=>{let e={},r={},n={};for(let i of t)if(Array.isArray(i))Array.isArray(e)||(e=[]),e=[...e,...i];else if(ns(i)){for(let[o,s]of Object.entries(i))ns(s)&&o in e&&(s=hg(e[o],s)),e={...e,[o]:s};ns(i.hooks)&&(n=dg(n,i.hooks),e.hooks=n),ns(i.headers)&&(r=fg(r,i.headers),e.headers=r)}return e};var rC=(()=>{let t=!1,e=!1,r=typeof globalThis.ReadableStream=="function",n=typeof globalThis.Request=="function";if(r&&n)try{e=new globalThis.Request("https://empty.invalid",{body:new globalThis.ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type")}catch(i){if(i instanceof Error&&i.message==="unsupported BodyInit type")return!1;throw i}return t&&!e})(),nC=typeof globalThis.AbortController=="function",iC=typeof globalThis.ReadableStream=="function",oC=typeof globalThis.FormData=="function",Vc=["get","post","put","patch","head","delete"],n5=()=>{};n5();var sC={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*"},zc=2147483647,Gc=Symbol("stop"),aC={json:!0,parseJson:!0,stringifyJson:!0,searchParams:!0,prefixUrl:!0,retry:!0,timeout:!0,hooks:!0,throwHttpErrors:!0,onDownloadProgress:!0,fetch:!0},uC={method:!0,headers:!0,body:!0,mode:!0,credentials:!0,cache:!0,redirect:!0,referrer:!0,referrerPolicy:!0,integrity:!0,keepalive:!0,signal:!0,window:!0,dispatcher:!0,duplex:!0,priority:!0};var cC=t=>Vc.includes(t)?t.toUpperCase():t,i5=["get","put","head","delete","options","trace"],o5=[408,413,429,500,502,503,504],s5=[413,429,503],lC={limit:2,methods:i5,statusCodes:o5,afterStatusCodes:s5,maxRetryAfter:Number.POSITIVE_INFINITY,backoffLimit:Number.POSITIVE_INFINITY,delay:t=>.3*2**(t-1)*1e3},fC=(t={})=>{if(typeof t=="number")return{...lC,limit:t};if(t.methods&&!Array.isArray(t.methods))throw new Error("retry.methods must be an array");if(t.statusCodes&&!Array.isArray(t.statusCodes))throw new Error("retry.statusCodes must be an array");return{...lC,...t}};async function pg(t,e,r,n){return new Promise((i,o)=>{let s=setTimeout(()=>{r&&r.abort(),o(new rs(t))},n.timeout);n.fetch(t,e).then(i).catch(o).then(()=>{clearTimeout(s)})})}async function mg(t,{signal:e}){return new Promise((r,n)=>{e&&(e.throwIfAborted(),e.addEventListener("abort",i,{once:!0}));function i(){clearTimeout(o),n(e.reason)}let o=setTimeout(()=>{e?.removeEventListener("abort",i),r()},t)})}var dC=(t,e)=>{let r={};for(let n in e)!(n in uC)&&!(n in aC)&&!(n in t)&&(r[n]=e[n]);return r};var pu=class t{static create(e,r){let n=new t(e,r),i=async()=>{if(typeof n._options.timeout=="number"&&n._options.timeout>zc)throw new RangeError(`The \`timeout\` option cannot be greater than ${zc}`);await Promise.resolve();let a=await n._fetch();for(let u of n._options.hooks.afterResponse){let l=await u(n.request,n._options,n._decorateResponse(a.clone()));l instanceof globalThis.Response&&(a=l)}if(n._decorateResponse(a),!a.ok&&n._options.throwHttpErrors){let u=new Wn(a,n.request,n._options);for(let l of n._options.hooks.beforeError)u=await l(u);throw u}if(n._options.onDownloadProgress){if(typeof n._options.onDownloadProgress!="function")throw new TypeError("The `onDownloadProgress` option must be a function");if(!iC)throw new Error("Streams are not supported in your environment. `ReadableStream` is missing.");return n._stream(a.clone(),n._options.onDownloadProgress)}return a},s=n._options.retry.methods.includes(n.request.method.toLowerCase())?n._retry(i):i();for(let[a,u]of Object.entries(sC))s[a]=async()=>{n.request.headers.set("accept",n.request.headers.get("accept")||u);let l=await s;if(a==="json"){if(l.status===204||(await l.clone().arrayBuffer()).byteLength===0)return"";if(r.parseJson)return r.parseJson(await l.text())}return l[a]()};return s}request;abortController;_retryCount=0;_input;_options;constructor(e,r={}){if(this._input=e,this._options={...r,headers:fg(this._input.headers,r.headers),hooks:dg({beforeRequest:[],beforeRetry:[],beforeError:[],afterResponse:[]},r.hooks),method:cC(r.method??this._input.method),prefixUrl:String(r.prefixUrl||""),retry:fC(r.retry),throwHttpErrors:r.throwHttpErrors!==!1,timeout:r.timeout??1e4,fetch:r.fetch??globalThis.fetch.bind(globalThis)},typeof this._input!="string"&&!(this._input instanceof URL||this._input instanceof globalThis.Request))throw new TypeError("`input` must be a string, URL, or Request");if(this._options.prefixUrl&&typeof this._input=="string"){if(this._input.startsWith("/"))throw new Error("`input` must not begin with a slash when using `prefixUrl`");this._options.prefixUrl.endsWith("/")||(this._options.prefixUrl+="/"),this._input=this._options.prefixUrl+this._input}if(nC){this.abortController=new globalThis.AbortController;let n=this._options.signal??this._input.signal;n?.aborted&&this.abortController.abort(n?.reason),n?.addEventListener("abort",()=>{this.abortController.abort(n.reason)}),this._options.signal=this.abortController.signal}if(rC&&(this._options.duplex="half"),this._options.json!==void 0&&(this._options.body=this._options.stringifyJson?.(this._options.json)??JSON.stringify(this._options.json),this._options.headers.set("content-type",this._options.headers.get("content-type")??"application/json")),this.request=new globalThis.Request(this._input,this._options),this._options.searchParams){let i="?"+(typeof this._options.searchParams=="string"?this._options.searchParams.replace(/^\?/,""):new URLSearchParams(this._options.searchParams).toString()),o=this.request.url.replace(/(?:\?.*?)?(?=#|$)/,i);(oC&&this._options.body instanceof globalThis.FormData||this._options.body instanceof URLSearchParams)&&!(this._options.headers&&this._options.headers["content-type"])&&this.request.headers.delete("content-type"),this.request=new globalThis.Request(new globalThis.Request(o,{...this.request}),this._options)}}_calculateRetryDelay(e){if(this._retryCount++,this._retryCount>this._options.retry.limit||e instanceof rs)throw e;if(e instanceof Wn){if(!this._options.retry.statusCodes.includes(e.response.status))throw e;let n=e.response.headers.get("Retry-After")??e.response.headers.get("RateLimit-Reset")??e.response.headers.get("X-RateLimit-Reset")??e.response.headers.get("X-Rate-Limit-Reset");if(n&&this._options.retry.afterStatusCodes.includes(e.response.status)){let i=Number(n)*1e3;Number.isNaN(i)?i=Date.parse(n)-Date.now():i>=Date.parse("2024-01-01")&&(i-=Date.now());let o=this._options.retry.maxRetryAfter??i;return i<o?i:o}if(e.response.status===413)throw e}let r=this._options.retry.delay(this._retryCount);return Math.min(this._options.retry.backoffLimit,r)}_decorateResponse(e){return this._options.parseJson&&(e.json=async()=>this._options.parseJson(await e.text())),e}async _retry(e){try{return await e()}catch(r){let n=Math.min(this._calculateRetryDelay(r),zc);if(this._retryCount<1)throw r;await mg(n,{signal:this._options.signal});for(let i of this._options.hooks.beforeRetry)if(await i({request:this.request,options:this._options,error:r,retryCount:this._retryCount})===Gc)return;return this._retry(e)}}async _fetch(){for(let n of this._options.hooks.beforeRequest){let i=await n(this.request,this._options);if(i instanceof Request){this.request=i;break}if(i instanceof Response)return i}let e=dC(this.request,this._options),r=this.request;return this.request=r.clone(),this._options.timeout===!1?this._options.fetch(r,e):pg(r,e,this.abortController,this._options)}_stream(e,r){let n=Number(e.headers.get("content-length"))||0,i=0;return e.status===204?(r&&r({percent:1,totalBytes:n,transferredBytes:i},new Uint8Array),new globalThis.Response(null,{status:e.status,statusText:e.statusText,headers:e.headers})):new globalThis.Response(new globalThis.ReadableStream({async start(o){let s=e.body.getReader();r&&r({percent:0,transferredBytes:0,totalBytes:n},new Uint8Array);async function a(){let{done:u,value:l}=await s.read();if(u){o.close();return}if(r){i+=l.byteLength;let c=n===0?0:i/n;r({percent:c,transferredBytes:i,totalBytes:n},l)}o.enqueue(l),await a()}await a()}}),{status:e.status,statusText:e.statusText,headers:e.headers})}};var gg=t=>{let e=(r,n)=>pu.create(r,hu(t,n));for(let r of Vc)e[r]=(n,i)=>pu.create(n,hu(t,i,{method:r}));return e.create=r=>gg(hu(r)),e.extend=r=>(typeof r=="function"&&(r=r(t??{})),gg(hu(t,r))),e.stop=Gc,e},a5=gg(),qr=a5;var eI=ue(HC()),oh=ue(ky());var yl=ue(y$());async function D$(){let t=await(0,yl.loadConfig)();return{config:t.app.extConfig,path:t.app.extConfigFilePath}}async function ci(t,e=!1){let r=await(0,yl.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,yl.writeConfig)(n,r.app.extConfigFilePath))}var na=".capgo_key",or=".capgo_key_v2",sh=`${na}.pub`,Fn=`${or}.pub`,K$="https://capgo.app",Y$="https://files.capgo.app",J$="https://api.capgo.app",X$="https://web.capgo.app",tI=12e4,gne=1024*1024*20,yne=1024*1024*1024,Dne=1024*1024*99,rI="package.json",ia=/^(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?`
250
+ `),m(),i()};return{start:F,stop:g,message:(C="")=>{a=y(C??a)}}};var et=require("node:fs"),ih=require("node:os"),Qe=ue(require("node:path")),Nt=require("node:process"),rn=ue(rc());var fn=require("fs"),Pa=(t=".",e="unknown")=>{let r=`${t}/bun.lockb`,n=`${t}/pnpm-lock.yaml`,i=`${t}/yarn.lock`,o=`${t}/package-lock.json`;return(0,fn.existsSync)(r)?"bun":(0,fn.existsSync)(n)?"pnpm":(0,fn.existsSync)(i)?"yarn":(0,fn.existsSync)(o)?"npm":e},nc=(t=Pa(),e=!1)=>{switch(t){case"bun":return e?"bun install":"install";case"pnpm":return e?"pnpm install":"install";case"yarn":return e?"yarn install":"install";case"npm":return e?"npm install":"install";case"unknown":return e?"unknown unknown":"unknown";default:return e?"npm install":"install"}},cw=(t=".",e="npx")=>{let r=`${t}/bun.lockb`,n=`${t}/pnpm-lock.yaml`,i=`${t}/yarn.lock`,o=`${t}/package-lock.json`;return(0,fn.existsSync)(r)?"bunx":(0,fn.existsSync)(n)?"pnpm exec":(0,fn.existsSync)(i)?"yarn dlx":(0,fn.existsSync)(o)?"npx":e};var ra=ue(a_()),Q$=ue(fu()),yv=ue(tC());var Wn=class extends Error{response;request;options;constructor(e,r,n){let i=e.status||e.status===0?e.status:"",o=e.statusText||"",s=`${i} ${o}`.trim(),a=s?`status code ${s}`:"an unknown error";super(`Request failed with ${a}: ${r.method} ${r.url}`),this.name="HTTPError",this.response=e,this.request=r,this.options=n}};var rs=class extends Error{request;constructor(e){super(`Request timed out: ${e.method} ${e.url}`),this.name="TimeoutError",this.request=e}};var ns=t=>t!==null&&typeof t=="object";var hu=(...t)=>{for(let e of t)if((!ns(e)||Array.isArray(e))&&e!==void 0)throw new TypeError("The `options` argument must be an object");return hg({},...t)},fg=(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 Hc(t,e,r){return Object.hasOwn(e,r)&&e[r]===void 0?[]:hg(t[r]??[],e[r]??[])}var dg=(t={},e={})=>({beforeRequest:Hc(t,e,"beforeRequest"),beforeRetry:Hc(t,e,"beforeRetry"),afterResponse:Hc(t,e,"afterResponse"),beforeError:Hc(t,e,"beforeError")}),hg=(...t)=>{let e={},r={},n={};for(let i of t)if(Array.isArray(i))Array.isArray(e)||(e=[]),e=[...e,...i];else if(ns(i)){for(let[o,s]of Object.entries(i))ns(s)&&o in e&&(s=hg(e[o],s)),e={...e,[o]:s};ns(i.hooks)&&(n=dg(n,i.hooks),e.hooks=n),ns(i.headers)&&(r=fg(r,i.headers),e.headers=r)}return e};var rC=(()=>{let t=!1,e=!1,r=typeof globalThis.ReadableStream=="function",n=typeof globalThis.Request=="function";if(r&&n)try{e=new globalThis.Request("https://empty.invalid",{body:new globalThis.ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type")}catch(i){if(i instanceof Error&&i.message==="unsupported BodyInit type")return!1;throw i}return t&&!e})(),nC=typeof globalThis.AbortController=="function",iC=typeof globalThis.ReadableStream=="function",oC=typeof globalThis.FormData=="function",Vc=["get","post","put","patch","head","delete"],n5=()=>{};n5();var sC={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*"},zc=2147483647,Gc=Symbol("stop"),aC={json:!0,parseJson:!0,stringifyJson:!0,searchParams:!0,prefixUrl:!0,retry:!0,timeout:!0,hooks:!0,throwHttpErrors:!0,onDownloadProgress:!0,fetch:!0},uC={method:!0,headers:!0,body:!0,mode:!0,credentials:!0,cache:!0,redirect:!0,referrer:!0,referrerPolicy:!0,integrity:!0,keepalive:!0,signal:!0,window:!0,dispatcher:!0,duplex:!0,priority:!0};var cC=t=>Vc.includes(t)?t.toUpperCase():t,i5=["get","put","head","delete","options","trace"],o5=[408,413,429,500,502,503,504],s5=[413,429,503],lC={limit:2,methods:i5,statusCodes:o5,afterStatusCodes:s5,maxRetryAfter:Number.POSITIVE_INFINITY,backoffLimit:Number.POSITIVE_INFINITY,delay:t=>.3*2**(t-1)*1e3},fC=(t={})=>{if(typeof t=="number")return{...lC,limit:t};if(t.methods&&!Array.isArray(t.methods))throw new Error("retry.methods must be an array");if(t.statusCodes&&!Array.isArray(t.statusCodes))throw new Error("retry.statusCodes must be an array");return{...lC,...t}};async function pg(t,e,r,n){return new Promise((i,o)=>{let s=setTimeout(()=>{r&&r.abort(),o(new rs(t))},n.timeout);n.fetch(t,e).then(i).catch(o).then(()=>{clearTimeout(s)})})}async function mg(t,{signal:e}){return new Promise((r,n)=>{e&&(e.throwIfAborted(),e.addEventListener("abort",i,{once:!0}));function i(){clearTimeout(o),n(e.reason)}let o=setTimeout(()=>{e?.removeEventListener("abort",i),r()},t)})}var dC=(t,e)=>{let r={};for(let n in e)!(n in uC)&&!(n in aC)&&!(n in t)&&(r[n]=e[n]);return r};var pu=class t{static create(e,r){let n=new t(e,r),i=async()=>{if(typeof n._options.timeout=="number"&&n._options.timeout>zc)throw new RangeError(`The \`timeout\` option cannot be greater than ${zc}`);await Promise.resolve();let a=await n._fetch();for(let u of n._options.hooks.afterResponse){let l=await u(n.request,n._options,n._decorateResponse(a.clone()));l instanceof globalThis.Response&&(a=l)}if(n._decorateResponse(a),!a.ok&&n._options.throwHttpErrors){let u=new Wn(a,n.request,n._options);for(let l of n._options.hooks.beforeError)u=await l(u);throw u}if(n._options.onDownloadProgress){if(typeof n._options.onDownloadProgress!="function")throw new TypeError("The `onDownloadProgress` option must be a function");if(!iC)throw new Error("Streams are not supported in your environment. `ReadableStream` is missing.");return n._stream(a.clone(),n._options.onDownloadProgress)}return a},s=n._options.retry.methods.includes(n.request.method.toLowerCase())?n._retry(i):i();for(let[a,u]of Object.entries(sC))s[a]=async()=>{n.request.headers.set("accept",n.request.headers.get("accept")||u);let l=await s;if(a==="json"){if(l.status===204||(await l.clone().arrayBuffer()).byteLength===0)return"";if(r.parseJson)return r.parseJson(await l.text())}return l[a]()};return s}request;abortController;_retryCount=0;_input;_options;constructor(e,r={}){if(this._input=e,this._options={...r,headers:fg(this._input.headers,r.headers),hooks:dg({beforeRequest:[],beforeRetry:[],beforeError:[],afterResponse:[]},r.hooks),method:cC(r.method??this._input.method),prefixUrl:String(r.prefixUrl||""),retry:fC(r.retry),throwHttpErrors:r.throwHttpErrors!==!1,timeout:r.timeout??1e4,fetch:r.fetch??globalThis.fetch.bind(globalThis)},typeof this._input!="string"&&!(this._input instanceof URL||this._input instanceof globalThis.Request))throw new TypeError("`input` must be a string, URL, or Request");if(this._options.prefixUrl&&typeof this._input=="string"){if(this._input.startsWith("/"))throw new Error("`input` must not begin with a slash when using `prefixUrl`");this._options.prefixUrl.endsWith("/")||(this._options.prefixUrl+="/"),this._input=this._options.prefixUrl+this._input}if(nC){this.abortController=new globalThis.AbortController;let n=this._options.signal??this._input.signal;n?.aborted&&this.abortController.abort(n?.reason),n?.addEventListener("abort",()=>{this.abortController.abort(n.reason)}),this._options.signal=this.abortController.signal}if(rC&&(this._options.duplex="half"),this._options.json!==void 0&&(this._options.body=this._options.stringifyJson?.(this._options.json)??JSON.stringify(this._options.json),this._options.headers.set("content-type",this._options.headers.get("content-type")??"application/json")),this.request=new globalThis.Request(this._input,this._options),this._options.searchParams){let i="?"+(typeof this._options.searchParams=="string"?this._options.searchParams.replace(/^\?/,""):new URLSearchParams(this._options.searchParams).toString()),o=this.request.url.replace(/(?:\?.*?)?(?=#|$)/,i);(oC&&this._options.body instanceof globalThis.FormData||this._options.body instanceof URLSearchParams)&&!(this._options.headers&&this._options.headers["content-type"])&&this.request.headers.delete("content-type"),this.request=new globalThis.Request(new globalThis.Request(o,{...this.request}),this._options)}}_calculateRetryDelay(e){if(this._retryCount++,this._retryCount>this._options.retry.limit||e instanceof rs)throw e;if(e instanceof Wn){if(!this._options.retry.statusCodes.includes(e.response.status))throw e;let n=e.response.headers.get("Retry-After")??e.response.headers.get("RateLimit-Reset")??e.response.headers.get("X-RateLimit-Reset")??e.response.headers.get("X-Rate-Limit-Reset");if(n&&this._options.retry.afterStatusCodes.includes(e.response.status)){let i=Number(n)*1e3;Number.isNaN(i)?i=Date.parse(n)-Date.now():i>=Date.parse("2024-01-01")&&(i-=Date.now());let o=this._options.retry.maxRetryAfter??i;return i<o?i:o}if(e.response.status===413)throw e}let r=this._options.retry.delay(this._retryCount);return Math.min(this._options.retry.backoffLimit,r)}_decorateResponse(e){return this._options.parseJson&&(e.json=async()=>this._options.parseJson(await e.text())),e}async _retry(e){try{return await e()}catch(r){let n=Math.min(this._calculateRetryDelay(r),zc);if(this._retryCount<1)throw r;await mg(n,{signal:this._options.signal});for(let i of this._options.hooks.beforeRetry)if(await i({request:this.request,options:this._options,error:r,retryCount:this._retryCount})===Gc)return;return this._retry(e)}}async _fetch(){for(let n of this._options.hooks.beforeRequest){let i=await n(this.request,this._options);if(i instanceof Request){this.request=i;break}if(i instanceof Response)return i}let e=dC(this.request,this._options),r=this.request;return this.request=r.clone(),this._options.timeout===!1?this._options.fetch(r,e):pg(r,e,this.abortController,this._options)}_stream(e,r){let n=Number(e.headers.get("content-length"))||0,i=0;return e.status===204?(r&&r({percent:1,totalBytes:n,transferredBytes:i},new Uint8Array),new globalThis.Response(null,{status:e.status,statusText:e.statusText,headers:e.headers})):new globalThis.Response(new globalThis.ReadableStream({async start(o){let s=e.body.getReader();r&&r({percent:0,transferredBytes:0,totalBytes:n},new Uint8Array);async function a(){let{done:u,value:l}=await s.read();if(u){o.close();return}if(r){i+=l.byteLength;let c=n===0?0:i/n;r({percent:c,transferredBytes:i,totalBytes:n},l)}o.enqueue(l),await a()}await a()}}),{status:e.status,statusText:e.statusText,headers:e.headers})}};var gg=t=>{let e=(r,n)=>pu.create(r,hu(t,n));for(let r of Vc)e[r]=(n,i)=>pu.create(n,hu(t,i,{method:r}));return e.create=r=>gg(hu(r)),e.extend=r=>(typeof r=="function"&&(r=r(t??{})),gg(hu(t,r))),e.stop=Gc,e},a5=gg(),qr=a5;var eI=ue(HC()),oh=ue(ky());var yl=ue(y$());async function D$(){let t=await(0,yl.loadConfig)();return{config:t.app.extConfig,path:t.app.extConfigFilePath}}async function ci(t,e=!1){let r=await(0,yl.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,yl.writeConfig)(n,r.app.extConfigFilePath))}var na=".capgo_key",or=".capgo_key_v2",sh=`${na}.pub`,Fn=`${or}.pub`,K$="https://capgo.app",Y$="https://files.capgo.app",J$="https://api.capgo.app",X$="https://web.capgo.app",tI=12e4,gne=1024*1024*20,yne=1024*1024*1024,Dne=1024*1024*99,rI="package.json",ia=/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-z-][0-9a-z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-z-][0-9a-z-]*))*))?(?:\+([0-9a-z-]+(?:\.[0-9a-z-]+)*))?$/i,Q=t=>t?`
251
251
  ${eI.default.render(t)}`:"";function nh(t){return new Promise(e=>{setTimeout(e,t)})}function nI(t){return(0,rn.isMonorepo)(t)||(0,rn.isNXMonorepo)(t)}function On(t){return(0,rn.isMonorepo)(t)?(0,rn.findMonorepoRoot)(t):(0,rn.isNXMonorepo)(t)?(0,rn.findNXMonorepoRoot)(t):t}async function vr(t=On((0,Nt.cwd)()),e=void 0){let r=e?.split(",")[0];r&&((0,et.existsSync)(r)||(p.error(`Package.json at ${r} does not exist`),(0,Nt.exit)(1)));let n=(0,et.readFileSync)(r||(0,Qe.join)(t,rI));return JSON.parse(n)}async function kr(t=On((0,Nt.cwd)()),e=void 0){let r=e?.split(",");if(r||(r=[(0,Qe.join)(t,rI)]),r)for(let i of r)(0,et.existsSync)(i)||(p.error(`Package.json at ${i} does not exist`),(0,Nt.exit)(1));let n=new Map;for(let i of r){let o=(0,et.readFileSync)(i),s=JSON.parse(o);for(let a in s.dependencies)n.set(a,s.dependencies[a]);for(let a in s.devDependencies)n.set(a,s.devDependencies[a])}return n}async function te(){try{let t=await D$();return t||(p.error("No capacitor config file found, run `cap init` first"),k.error("")),t}catch(t){p.error(`No capacitor config file found, run \`cap init\` first ${Q(t)}`),k.error("")}}async function _l(t){let e=await te();return e?.config&&(e.config.plugins||(e.config.plugins={extConfig:{},CapacitorUpdater:{}}),e.config.plugins.CapacitorUpdater||(e.config.plugins.CapacitorUpdater={}),e.config.plugins.CapacitorUpdater={...e.config.plugins.CapacitorUpdater,...t},ci(e)),e}async function br(){try{let t=await te(),e={host:t?.config?.plugins?.CapacitorUpdater?.localHost||K$,hostWeb:t?.config?.plugins?.CapacitorUpdater?.localWebHost||X$,hostFilesApi:t?.config?.plugins?.CapacitorUpdater?.localApiFiles||Y$,hostApi:t?.config?.plugins?.CapacitorUpdater?.localApi||J$};return t?.config?.plugins?.CapacitorUpdater?.localSupa&&t?.config?.plugins?.CapacitorUpdater?.localSupaAnon&&(p.info("Using custom supabase instance from capacitor.config.json"),e.supaKey=t?.config?.plugins?.CapacitorUpdater?.localSupaAnon,e.supaHost=t?.config?.plugins?.CapacitorUpdater?.localSupa),e}catch{return{host:K$,hostWeb:X$,hostFilesApi:Y$,hostApi:J$}}}var vne=/([A-Za-z0-9]+)\.(java|swift|kt|scala)$/;async function ah(){let t=await br();return qr.get(`${t.hostApi}/private/config`).then(e=>e.json()).then(e=>({...e,...t})).catch(()=>(p.info(`Local config ${Q(t)}`),t))}async function iI(){let t=await br();return qr.get(`${t.hostFilesApi}/files/config`).then(e=>e.json()).catch(()=>({partialUpload:!1,TUSUpload:!1,partialUploadForced:!1,TUSUploadForced:!1,maxUploadLength:yne,maxChunkSize:Dne,alertUploadSize:gne}))}async function fe(t){let e=await ah();return(!e.supaHost||!e.supaKey)&&(p.error("Cannot connect to server please try again later"),k.error("")),(0,ra.createClient)(e.supaHost,e.supaKey,{auth:{persistSession:!1},global:{headers:{capgkey:t}}})}async function bne(t,e,r){let{data:n}=await t.rpc("is_allowed_capgkey",{apikey:e,keymode:r}).single();if(!n){p.error("Invalid API key or insufficient permissions.");let i=r.map((o,s)=>r.length===1?`"${o}"`:s===r.length-1?`or "${o}"`:`"${o}", `).join("");p.error(`Your key should be: ${i} mode.`),k.error("")}}async function oI(t,e){let{data:r}=await t.rpc("is_paying_org",{orgid:e}).single();return r||!1}async function sI(t,e){let{data:r}=await t.rpc("is_trial_org",{orgid:e}).single();return r||0}async function wne(t,e){let{data:r}=await t.rpc("is_allowed_action_org",{orgid:e}).single();return!!r}async function _ne(t,e,r){let{data:n}=await t.rpc("is_allowed_action",{apikey:r,appid:e}).single();return!!n}var Ot=(s=>(s[s.none=0]="none",s[s.read=1]="read",s[s.upload=2]="upload",s[s.write=3]="write",s[s.admin=4]="admin",s[s.super_admin=5]="super_admin",s))(Ot||{}),Dv=(t,e)=>t>=e;async function aI(t,e,r){let{data:n,error:i}=await t.rpc("get_org_perm_for_apikey",{apikey:e,app_id:r}).single();if(i&&(p.error("Cannot get permissions for organization!"),console.error(i),(0,Nt.exit)(1)),n.includes("perm")){let a=null;switch(n){case"perm_none":{a=0;break}case"perm_read":{a=1;break}case"perm_upload":{a=2;break}case"perm_write":{a=3;break}case"perm_admin":{a=4;break}case"perm_owner":{a=5;break}default:n.includes("invite")&&(p.info("Please accept/deny the organization invitation before trying to access the app"),(0,Nt.exit)(1)),p.error(`Invalid output when fetching organization permission. Response: ${n}`),(0,Nt.exit)(1)}return{okay:!0,data:a}}let s=null;switch(n){case"INVALID_APIKEY":{s="INVALID_APIKEY";break}case"NO_APP":{s="NO_APP";break}case"NO_ORG":{s="NO_ORG";break}default:p.error(`Invalid error when fetching organization permission. Response: ${n}`),(0,Nt.exit)(1)}return{okay:!1,error:s}}async function uI(t,e,r){let{data:n,error:i}=await t.rpc("get_organization_cli_warnings",{orgid:e,cli_version:r});if(i){p.error(`Cannot get cli warnings: ${Q(i)}`);return}if(n.length>0){p.warn(`Found ${n.length} cli warnings for your organization.`);let o=!1;for(let s of n){if(typeof s!="object"||typeof s.message!="string"||typeof s.fatal!="boolean"){p.error(`Invalid cli warning: ${s}`);continue}let a=s;a.fatal?(o=!0,p.error(`${a.message.replaceAll("\\n",`
252
252
  `)}`)):p.warn(`${a.message.replaceAll("\\n",`
253
253
  `)}`)}o&&(p.error("Please fix the warnings and try again."),k.error("")),p.info("End of cli warnings.")}}async function uh(t,e,r,n,i=!0){let o=await ah();await(n?_ne(t,n,r):wne(t,e))||(p.error(`You need to upgrade your plan to continue to use capgo.
@@ -258,13 +258,13 @@ Trial expires in ${a} days, upgrade here: ${o.hostWeb}/dashboard/settings/plans
258
258
  Upgrade here: ${o.hostWeb}/dashboard/settings/plans
259
259
  `),nh(100),Promise.resolve().then(()=>(mv(),pv)).then(l=>{l.default(`${o.hostWeb}/dashboard/settings/plans`)}),nh(500),k.error(""));let[a,u]=await Promise.all([sI(t,e),oI(t,e)]);a>0&&i&&!u&&p.warn(`WARNING !!
260
260
  Trial expires in ${a} days, upgrade here: ${o.hostWeb}/dashboard/settings/plans
261
- `)}function de(t=!1){let e=(0,ih.homedir)(),r,n=`${e}/.capgo`;return(0,et.existsSync)(n)&&(t||p.info(`Use global API key ${n}`),r=(0,et.readFileSync)(n,"utf8").trim()),n=".capgo",!r&&(0,et.existsSync)(n)&&(t||p.info(`Use local API key ${n}`),r=(0,et.readFileSync)(n,"utf8").trim()),r||(p.error(`Cannot find API key in local folder or global, please login first with ${Jt().runner} @capacitor/cli login`),k.error("")),r}async function*vv(t){let e=await(0,et.readdirSync)(t,{withFileTypes:!0});for(let r of e){let n=(0,Qe.resolve)(t,r.name);r.isDirectory()&&!r.name.startsWith(".")&&!r.name.startsWith("node_modules")&&!r.name.startsWith("dist")?yield*vv(n):yield n}}function oa(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 bv(){let t=(0,Nt.cwd)(),e=!1,r=(0,Qe.resolve)(t,"tsconfig.json");(0,et.existsSync)(r)&&(e=!0);for await(let n of vv(t)){if(n.includes("angular.json"))return p.info("Found angular project"),e?"angular-ts":"angular-js";if(n.includes("nuxt.config.js")||n.includes("nuxt.config.ts"))return p.info("Found nuxtjs project"),e?"nuxtjs-ts":"nuxtjs-js";if(n.includes("next.config.js")||n.includes("next.config.mjs"))return p.info("Found nextjs project"),e?"nextjs-ts":"nextjs-js";if(n.includes("svelte.config.js"))return p.info("Found sveltekit project"),e?"sveltekit-ts":"sveltekit-js";if(n.includes("rolluconfig.js"))return p.info("Found svelte project"),e?"svelte-ts":"svelte-js";if(n.includes("vue.config.js"))return p.info("Found vue project"),e?"vue-ts":"vue-js";if(n.includes("package.json")){let i=(0,Qe.dirname)(n),o=await kr(i);if(o){if(o.get("react"))return p.info("Found react project test"),e?"react-ts":"react-js";if(o.get("vue"))return p.info("Found vue project"),e?"vue-ts":"vue-js"}}}return"unknown"}function cI(t,e){return t==="angular-js"||t==="angular-ts"?e?"src/main.ts":"src/main.js":t==="nextjs-js"||t==="nextjs-ts"?e?"src/app/layout.tsx":"src/app/layout.js":t==="svelte-js"||t==="svelte-ts"||t==="vue-js"||t==="vue-ts"?e?"src/main.ts":"src/main.js":t==="react-js"||t==="react-ts"?e?"src/index.tsx":"src/index.js":null}async function fI(t){return t==="angular"?(p.info("Angular project detected"),"build"):t==="nuxtjs"?(p.info("Nuxtjs project detected"),"generate"):t==="nextjs"?(p.info("Nextjs project detected"),p.warn("Please make sure you have configured static export in your next.config.js: https://nextjs.org/docs/pages/building-your-application/deploying/static-exports"),p.warn("Please make sure you have the output: 'export' and distDir: 'dist' in your next.config.js"),await Pe({message:"Do you want to continue?"})||(p.error("Aborted"),k.error("")),"build"):(t==="sveltekit"&&(p.info("Sveltekit project detected"),p.warn("Please make sure you have the adapter-static installed: https://kit.svelte.dev/docs/adapter-static"),p.warn("Please make sure you have the pages: 'dist' and assets: 'dest', in your svelte.config.js adaptater"),await Pe({message:"Do you want to continue?"})||(p.error("Aborted"),k.error(""))),"build")}async function dI(){let t=/(main|index)\.(ts|tsx|js|jsx)$/,e="",r=(0,Nt.cwd)(),n=r.split("/").length;for await(let i of vv(r))if(i.split("/").length-n<=2&&t.test(i)){e=i,p.info(`Found main file here ${i}`);break}return e}async function wv(t,e){return t.from("app_versions").upsert(e,{onConflict:"name,app_id"}).eq("app_id",e.app_id).eq("name",e.name)}async function hI(t,e,r){let n={app_id:e,name:r,version:0};try{let o=await t.functions.invoke("private/upload_link",{body:JSON.stringify(n)});if(o.error){if(o.error instanceof ra.FunctionsHttpError){let s=await o.error.context.json();p.error(`Upload URL error: ${s.status||JSON.stringify(s)}`)}else p.error(`Cannot get upload url: ${o.error.message}`);return""}return o.data.url}catch(i){p.error(`Cannot get upload url ${Q(i)}`)}return""}async function*pI(t){let e=(0,et.readdirSync)(t,{withFileTypes:!0});for(let r of e){let n=(0,Qe.join)(t,r.name);r.isDirectory()?yield*pI(n):yield n}}async function mI(t){let e=[];for await(let r of pI(t)){let n=(0,et.readFileSync)(r),i=await(0,Q$.checksum)(n,"sha256"),o=(0,Qe.relative)(t,r);o.startsWith("/")&&(o=o.substring(1)),e.push({file:o,hash:i})}return e}async function lh(t){return(0,ih.platform)()==="win32"?Cne(t):Ene(t)}function Ene(t){let e=new yv.default;return e.addLocalFolder(t),e.toBuffer()}async function Cne(t){p.info("Zipping file windows mode");let e=new yv.default,r=(n,i)=>{let o=(0,et.readdirSync)(n);for(let s of o){let a=(0,Qe.join)(n,s),u=(0,et.statSync)(a);if(u.isFile()){let l=(0,et.readFileSync)(a);e.addFile((0,Qe.join)(i,s).split(Qe.sep).join("/"),l)}else u.isDirectory()&&r(a,(0,Qe.join)(i,s))}};return r(t,""),e.toBuffer()}async function gI(t,e,r,n,i,o,s,a){return new Promise((u,l)=>{Oe(t,{channel:"app",event:"App TUS upload",icon:"\u23EB",user_id:r,tags:{"app-id":n},notify:!1}),new oh.Upload(e,{endpoint:`${s.hostFilesApi}/files/upload/attachments/`,chunkSize:a,metadataForPartialUploads:{filename:`orgs/${r}/apps/${n}/${i}.zip`,filetype:"application/gzip"},metadata:{filename:`orgs/${r}/apps/${n}/${i}.zip`,filetype:"application/zip"},headers:{Authorization:t},onError(f){if(p.error(`Error uploading bundle: ${f.message}`),f instanceof oh.DetailedError){let h=f.originalResponse?.getBody(),d=JSON.parse(h||'{"error": "unknown error"}');l(d.status||d.error||d.message||"unknown error")}else l(f.message||f.toString()||"unknown error")},onProgress(f,h){let d=(f/h*100).toFixed(2);o.message(`Uploaded ${d}%`)},async onSuccess(){await Oe(t,{channel:"app",event:"App TUS done",icon:"\u23EB",user_id:r,tags:{"app-id":n},notify:!1}).catch(),u(!0)}}).start()})}async function yI(t,e,r){let n={app_id:e,name:r};try{let o=await t.functions.invoke("private/delete_failed_version",{body:JSON.stringify(n),method:"DELETE"});if(o.error){if(o.error instanceof ra.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 ra.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 ch(t,e){if(!e.app_id||!e.name||!e.created_by)return p.error("missing app_id, name, or created_by"),Promise.reject(new Error("missing app_id, name, or created_by"));let{data:r,error:n}=await t.from("channels").select().eq("app_id",e.app_id).eq("name",e.name).single();return r&&!n?t.from("channels").update(e).eq("app_id",e.app_id).eq("name",e.name).select().single():t.from("channels").insert(e).select().single()}async function Oe(t,e){try{let r=await ah(),n=await qr.post(`${r.host}/private/events`,{json:e,headers:{capgkey:t},timeout:1e4,retry:3}).json();n.error&&p.error(`Failed to send LogSnag event: ${n.error}`)}catch{}}async function sa(t,e){let{error:r,data:n}=await t.rpc("get_orgs_v6");r&&(p.error("Cannot get the list of organizations - exiting"),p.error(`Error ${JSON.stringify(r)}`),k.error(""));let i=n.filter(u=>!!e.find(l=>l===u.role));i.length===0&&(p.error(`Could not get organization with roles: ${e.join(" or ")} because the user does not have any org`),k.error(""));let o=i.length>1?await yi({message:"Please pick the organization that you want to insert to",options:i.map(u=>({value:u.gid,label:u.name}))}):i[0].gid;st(o)&&(p.error("Canceled organization selection, exiting"),k.error(""));let s=o,a=n.find(u=>u.gid===s);return p.info(`Using the organization "${a.name}" as the app owner`),a}var mo=t=>t.replace(/\./g,"--");async function he(t,e,r=["all"]){await bne(t,e,r);let{data:n,error:i}=await t.rpc("get_user_id",{apikey:e}).single(),o=(n||"").toString();return(!o||i)&&(p.error("Cannot auth user with apikey"),k.error("")),o}async function wr(t,e){let{data:r,error:n}=await t.from("apps").select("owner_org").eq("app_id",e).single();return(!r||n)&&(p.error(`Cannot get organization id for app id ${e}`),Q(n),k.error("")),r.owner_org}function aa(t){return new Date(t||"").toLocaleString()}var Z$=!1,ta="npm",wl="install",gv="npx";function Jt(){if(Z$)return{pm:ta,command:wl,installCommand:`${ta} ${wl}`,runner:gv};let t=On((0,Nt.cwd)());return ta=Pa(t,"npm"),wl=nc(ta),Z$=!0,gv=cw(t),{pm:ta,command:wl,installCommand:`${ta} ${wl}`,runner:gv}}function DI(t){return(0,et.readdirSync)(t,{withFileTypes:!0}).flatMap(n=>{let i=(0,Qe.join)(t,n.name);return n.isDirectory()?DI(i):i.split(`node_modules${Qe.sep}`)[1]||i})}async function _v(t,e){let r=e?e.split(","):[],n;try{n=await kr("",t)}catch(c){p.error("Invalid package.json, JSON parsing failed"),console.error("json parse error: ",c),k.error("")}let i=t?.split(",")[0],o=i?Qe.default.resolve(i).replace("package.json",""):On((0,Nt.cwd)());n||(p.error("Missing dependencies section in package.json"),k.error(""));for(let[c,f]of Object.entries(n))typeof f!="string"&&(p.error(`Invalid dependency ${c}: ${f}, expected string, got ${typeof f}`),k.error(""));let s=r.length===0?[(0,Qe.join)((0,Nt.cwd)(),"node_modules")]:r;if(!s.some(c=>(0,et.existsSync)(c))){let c=Pa(o,"npm"),f=nc(c);p.error(`Missing node_modules folder at ${s.join(", ")}, please run ${c} ${f}`),k.error("")}let u=!1,l=await Promise.all(Array.from(n.entries()).map(async([c,f])=>{let h=!1,d=!1;for(let m of s){let b=(0,Qe.join)(m,c);if((0,et.existsSync)(b)){h=!0;try{if(DI(b).some(_=>vne.test(_))){d=!0;break}}catch(D){p.error(`Error reading node_modules files for ${c} package in ${m}`),console.error(D),k.error("")}}}if(!h){u=!0;let m=Pa(o,"npm"),b=nc(m);return p.error(`Missing dependency ${c}, please run ${m} ${b}`),{name:c,version:f}}return{name:c,version:f,native:d}})).catch(()=>[]);return(u||l.find(c=>c.native===void 0))&&(p.error("Missing dependencies or invalid dependencies"),p.error("If you use monorepo, workspace or any special package manager you can use the --package-json [path,] and --node-modules [path,] options to make the command work properly"),k.error("")),l}async function Sne(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 xne(t,e,r){let{data:n,error:i}=await t.from("channels").select(`version (
261
+ `)}function de(t=!1){let e=(0,ih.homedir)(),r,n=`${e}/.capgo`;return(0,et.existsSync)(n)&&(t||p.info(`Use global API key ${n}`),r=(0,et.readFileSync)(n,"utf8").trim()),n=".capgo",!r&&(0,et.existsSync)(n)&&(t||p.info(`Use local API key ${n}`),r=(0,et.readFileSync)(n,"utf8").trim()),r||(p.error(`Cannot find API key in local folder or global, please login first with ${Jt().runner} @capacitor/cli login`),k.error("")),r}async function*vv(t){let e=await(0,et.readdirSync)(t,{withFileTypes:!0});for(let r of e){let n=(0,Qe.resolve)(t,r.name);r.isDirectory()&&!r.name.startsWith(".")&&!r.name.startsWith("node_modules")&&!r.name.startsWith("dist")?yield*vv(n):yield n}}function oa(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 bv(){let t=(0,Nt.cwd)(),e=!1,r=(0,Qe.resolve)(t,"tsconfig.json");(0,et.existsSync)(r)&&(e=!0);for await(let n of vv(t)){if(n.includes("angular.json"))return p.info("Found angular project"),e?"angular-ts":"angular-js";if(n.includes("nuxt.config.js")||n.includes("nuxt.config.ts"))return p.info("Found nuxtjs project"),e?"nuxtjs-ts":"nuxtjs-js";if(n.includes("next.config.js")||n.includes("next.config.mjs"))return p.info("Found nextjs project"),e?"nextjs-ts":"nextjs-js";if(n.includes("svelte.config.js"))return p.info("Found sveltekit project"),e?"sveltekit-ts":"sveltekit-js";if(n.includes("rolluconfig.js"))return p.info("Found svelte project"),e?"svelte-ts":"svelte-js";if(n.includes("vue.config.js"))return p.info("Found vue project"),e?"vue-ts":"vue-js";if(n.includes("package.json")){let i=(0,Qe.dirname)(n),o=await kr(i);if(o){if(o.get("react"))return p.info("Found react project test"),e?"react-ts":"react-js";if(o.get("vue"))return p.info("Found vue project"),e?"vue-ts":"vue-js"}}}return"unknown"}function cI(t,e){return t==="angular-js"||t==="angular-ts"?e?"src/main.ts":"src/main.js":t==="nextjs-js"||t==="nextjs-ts"?e?"src/app/layout.tsx":"src/app/layout.js":t==="svelte-js"||t==="svelte-ts"||t==="vue-js"||t==="vue-ts"?e?"src/main.ts":"src/main.js":t==="react-js"||t==="react-ts"?e?"src/index.tsx":"src/index.js":null}async function fI(t){return t==="angular"?(p.info("Angular project detected"),"build"):t==="nuxtjs"?(p.info("Nuxtjs project detected"),"generate"):t==="nextjs"?(p.info("Nextjs project detected"),p.warn("Please make sure you have configured static export in your next.config.js: https://nextjs.org/docs/pages/building-your-application/deploying/static-exports"),p.warn("Please make sure you have the output: 'export' and distDir: 'dist' in your next.config.js"),await Pe({message:"Do you want to continue?"})||(p.error("Aborted"),k.error("")),"build"):(t==="sveltekit"&&(p.info("Sveltekit project detected"),p.warn("Please make sure you have the adapter-static installed: https://kit.svelte.dev/docs/adapter-static"),p.warn("Please make sure you have the pages: 'dist' and assets: 'dest', in your svelte.config.js adaptater"),await Pe({message:"Do you want to continue?"})||(p.error("Aborted"),k.error(""))),"build")}async function dI(){let t=/(main|index)\.(ts|tsx|js|jsx)$/,e="",r=(0,Nt.cwd)(),n=r.split("/").length;for await(let i of vv(r))if(i.split("/").length-n<=2&&t.test(i)){e=i,p.info(`Found main file here ${i}`);break}return e}async function wv(t,e){return t.from("app_versions").upsert(e,{onConflict:"name,app_id"}).eq("app_id",e.app_id).eq("name",e.name)}async function hI(t,e,r){let n={app_id:e,name:r,version:0};try{let o=await t.functions.invoke("private/upload_link",{body:JSON.stringify(n)});if(o.error){if(o.error instanceof ra.FunctionsHttpError){let s=await o.error.context.json();p.error(`Upload URL error: ${s.status||JSON.stringify(s)}`)}else p.error(`Cannot get upload url: ${o.error.message}`);return""}return o.data.url}catch(i){p.error(`Cannot get upload url ${Q(i)}`)}return""}async function*pI(t){let e=(0,et.readdirSync)(t,{withFileTypes:!0});for(let r of e){let n=(0,Qe.join)(t,r.name);r.isDirectory()?yield*pI(n):yield n}}async function mI(t){let e=[];for await(let r of pI(t)){let n=(0,et.readFileSync)(r),i=await(0,Q$.checksum)(n,"sha256"),o=(0,Qe.relative)(t,r);o.startsWith("/")&&(o=o.substring(1)),e.push({file:o,hash:i})}return e}async function lh(t){return(0,ih.platform)()==="win32"?Cne(t):Ene(t)}function Ene(t){let e=new yv.default;return e.addLocalFolder(t),e.toBuffer()}async function Cne(t){p.info("Zipping file windows mode");let e=new yv.default,r=(n,i)=>{let o=(0,et.readdirSync)(n);for(let s of o){let a=(0,Qe.join)(n,s),u=(0,et.statSync)(a);if(u.isFile()){let l=(0,et.readFileSync)(a);e.addFile((0,Qe.join)(i,s).split(Qe.sep).join("/"),l)}else u.isDirectory()&&r(a,(0,Qe.join)(i,s))}};return r(t,""),e.toBuffer()}async function gI(t,e,r,n,i,o,s,a){return new Promise((u,l)=>{Oe(t,{channel:"app",event:"App TUS upload",icon:"\u23EB",user_id:r,tags:{"app-id":n},notify:!1}),new oh.Upload(e,{endpoint:`${s.hostFilesApi}/files/upload/attachments/`,chunkSize:a,metadataForPartialUploads:{filename:`orgs/${r}/apps/${n}/${i}.zip`,filetype:"application/gzip"},metadata:{filename:`orgs/${r}/apps/${n}/${i}.zip`,filetype:"application/zip"},headers:{Authorization:t},onError(f){if(p.error(`Error uploading bundle: ${f.message}`),f instanceof oh.DetailedError){let h=f.originalResponse?.getBody(),d=JSON.parse(h||'{"error": "unknown error"}');l(d.status||d.error||d.message||"unknown error")}else l(f.message||f.toString()||"unknown error")},onProgress(f,h){let d=(f/h*100).toFixed(2);o.message(`Uploaded ${d}%`)},async onSuccess(){await Oe(t,{channel:"app",event:"App TUS done",icon:"\u23EB",user_id:r,tags:{"app-id":n},notify:!1}).catch(),u(!0)}}).start()})}async function yI(t,e,r){let n={app_id:e,name:r};try{let o=await t.functions.invoke("private/delete_failed_version",{body:JSON.stringify(n),method:"DELETE"});if(o.error){if(o.error instanceof ra.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 ra.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 ch(t,e){if(!e.app_id||!e.name||!e.created_by)return p.error("missing app_id, name, or created_by"),Promise.reject(new Error("missing app_id, name, or created_by"));let{data:r,error:n}=await t.from("channels").select().eq("app_id",e.app_id).eq("name",e.name).single();return r&&!n?t.from("channels").update(e).eq("app_id",e.app_id).eq("name",e.name).select().single():t.from("channels").insert(e).select().single()}async function Oe(t,e){try{let r=await ah(),n=await qr.post(`${r.host}/private/events`,{json:e,headers:{capgkey:t},timeout:1e4,retry:3}).json();n.error&&p.error(`Failed to send LogSnag event: ${n.error}`)}catch{}}async function sa(t,e){let{error:r,data:n}=await t.rpc("get_orgs_v6");r&&(p.error("Cannot get the list of organizations - exiting"),p.error(`Error ${JSON.stringify(r)}`),k.error(""));let i=n.filter(u=>!!e.find(l=>l===u.role));i.length===0&&(p.error(`Could not get organization with roles: ${e.join(" or ")} because the user does not have any org`),k.error(""));let o=i.length>1?await yi({message:"Please pick the organization that you want to insert to",options:i.map(u=>({value:u.gid,label:u.name}))}):i[0].gid;st(o)&&(p.error("Canceled organization selection, exiting"),k.error(""));let s=o,a=n.find(u=>u.gid===s);return p.info(`Using the organization "${a.name}" as the app owner`),a}var mo=t=>t.replace(/\./g,"--");async function he(t,e,r=["all"]){await bne(t,e,r);let{data:n,error:i}=await t.rpc("get_user_id",{apikey:e}).single(),o=(n||"").toString();return(!o||i)&&(p.error("Cannot auth user with apikey"),k.error("")),o}async function wr(t,e){let{data:r,error:n}=await t.from("apps").select("owner_org").eq("app_id",e).single();return(!r||n)&&(p.error(`Cannot get organization id for app id ${e}`),Q(n),k.error("")),r.owner_org}function aa(t){return new Date(t||"").toLocaleString()}var Z$=!1,ta="npm",wl="install",gv="npx";function Jt(){if(Z$)return{pm:ta,command:wl,installCommand:`${ta} ${wl}`,runner:gv};let t=On((0,Nt.cwd)());return ta=Pa(t,"npm"),wl=nc(ta),Z$=!0,gv=cw(t),{pm:ta,command:wl,installCommand:`${ta} ${wl}`,runner:gv}}function DI(t){return(0,et.readdirSync)(t,{withFileTypes:!0}).flatMap(n=>{let i=(0,Qe.join)(t,n.name);return n.isDirectory()?DI(i):i.split(`node_modules${Qe.sep}`)[1]||i})}async function _v(t,e){let r=e?e.split(","):[],n;try{n=await kr("",t)}catch(c){p.error("Invalid package.json, JSON parsing failed"),console.error("json parse error: ",c),k.error("")}let i=t?.split(",")[0],o=i?Qe.default.resolve(i).replace("package.json",""):On((0,Nt.cwd)());n||(p.error("Missing dependencies section in package.json"),k.error(""));for(let[c,f]of Object.entries(n))typeof f!="string"&&(p.error(`Invalid dependency ${c}: ${f}, expected string, got ${typeof f}`),k.error(""));let s=r.length===0?[(0,Qe.join)((0,Nt.cwd)(),"node_modules")]:r;if(!s.some(c=>(0,et.existsSync)(c))){let c=Pa(o,"npm"),f=nc(c);p.error(`Missing node_modules folder at ${s.join(", ")}, please run ${c} ${f}`),k.error("")}let u=!1,l=await Promise.all(Array.from(n.entries()).map(async([c,f])=>{let h=!1,d=!1;for(let m of s){let b=(0,Qe.join)(m,c);if((0,et.existsSync)(b)){h=!0;try{if(DI(b).some(E=>vne.test(E))){d=!0;break}}catch(y){p.error(`Error reading node_modules files for ${c} package in ${m}`),console.error(y),k.error("")}}}if(!h){u=!0;let m=Pa(o,"npm"),b=nc(m);return p.error(`Missing dependency ${c}, please run ${m} ${b}`),{name:c,version:f}}return{name:c,version:f,native:d}})).catch(()=>[]);return(u||l.find(c=>c.native===void 0))&&(p.error("Missing dependencies or invalid dependencies"),p.error("If you use monorepo, workspace or any special package manager you can use the --package-json [path,] and --node-modules [path,] options to make the command work properly"),k.error("")),l}async function Sne(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 xne(t,e,r){let{data:n,error:i}=await t.from("channels").select(`version (
262
262
  native_packages
263
263
  )`).eq("name",r).eq("app_id",e).single();i&&(p.error(`Error fetching native packages: ${i.message}`),k.error(""));let o;try{o=n.version.native_packages}catch{p.error("Error parsing native packages"),k.error("")}return o||(p.error("Error parsing native packages, perhaps the metadata does not exist?"),k.error("")),o.forEach(a=>{typeof a!="object"&&(p.error(`Invalid remote native package data: ${a}, expected object, got ${typeof a}`),k.error(""));let{name:u,version:l}=a;(!u||typeof u!="string")&&(p.error(`Invalid remote native package name: ${u}, expected string, got ${typeof u}`),k.error("")),(!l||typeof l!="string")&&(p.error(`Invalid remote native package version: ${l}, expected string, got ${typeof l}`),k.error(""))}),new Map(o.map(a=>[a.name,a]))}async function vI(t,e,r,n){let i=_e();i.start(`Checking bundle checksum compatibility with channel ${r}`);let o=await Sne(t,e,r);if(!o){i.stop(`No checksum found for channel ${r}, the bundle will be uploaded`);return}o&&o===n&&(p.error(`Cannot upload the same bundle content.
264
264
  Current bundle checksum matches remote bundle for channel ${r}
265
265
  Did you builded your app before uploading?
266
266
  PS: You can ignore this check with "--ignore-checksum-check"`),k.error("")),i.stop(`Checksum compatible with ${r} channel`)}function pe(t,e){return t||e?.plugins?.CapacitorUpdater?.appId||e?.appId}async function fh(t,e,r,n,i){let o=await _v(n,i),s=await xne(t,e,r),a=o.filter(l=>!!l.native).map(l=>{let c=s.get(l.name);return c?{name:l.name,localVersion:l.version,remoteVersion:c.version}:{name:l.name,localVersion:l.version,remoteVersion:void 0}}),u=[...s].filter(([l])=>o.find(c=>c.name===l)===void 0).map(([l,c])=>({name:l,localVersion:void 0,remoteVersion:c.version}));return a.push(...u),{finalCompatibility:a,localDependencies:o}}async function bI(t,e){let{data:r}=await t.rpc("exist_app_v2",{appid:e}).single();return!!r}async function qe(t,e,r,n){let i=Jt(),o=await aI(t,e,r);if(!o.okay)switch(o.error){case"INVALID_APIKEY":{p.error("Invalid apikey, such apikey does not exists!"),k.error("");break}case"NO_APP":{p.error(`App ${r} does not exist, run first \`${i.runner} @capgo/cli app add ${r}\` to create it`),k.error("");break}case"NO_ORG":{p.error("Could not find organization, please contact support to resolve this!"),k.error("");break}}let s=o.data;return n>s&&(p.error(`Insuficcent permissions for app ${r}. Current permission: ${Ot[o.data]}, required for this action: ${Ot[n]}.`),k.error("")),o.data}var _r="assets/icon.png";var VI=ue(HI(),1);function xv(t){let e=(0,VI.default)("npm",{registry:"https://registry.npmjs.org/"}),r=e[`${t}:registry`]||e.config_registry||e.registry;return r.slice(-1)==="/"?r:`${r}/`}var Uj=ue(Mj(),1),Hj=ue(W0(),1),Mv=class extends Error{constructor(e){super(`Package \`${e}\` could not be found`),this.name="PackageNotFoundError"}},Uv=class extends Error{constructor(e,r){super(`Version \`${r}\` for package \`${e}\` could not be found`),this.name="VersionNotFoundError"}};async function Hv(t,e={}){let{version:r="latest"}=e,{omitDeprecated:n=!0}=e,i=t.split("/")[0],o=e.registryUrl??xv(i),s=new URL(encodeURIComponent(t).replace(/^%40/,"@"),o),a=(0,Uj.default)(o.toString(),{recursive:!0}),u={accept:"application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*"};e.fullMetadata&&delete u.accept,a&&(u.authorization=`${a.type} ${a.token}`);let l;try{l=await qr(s,{headers:u,keepalive:!0}).json()}catch(f){throw f?.response?.status===404?new Mv(t):f}if(e.allVersions)return l;let c=new Uv(t,r);if(l["dist-tags"][r]){let{time:f}=l;l=l.versions[l["dist-tags"][r]],l.time=f}else if(r){let f=!!l.versions[r];if(n&&!f)for(let[d,m]of Object.entries(l.versions))m.deprecated&&delete l.versions[d];if(!f){let d=Object.keys(l.versions);if(r=Hj.default.maxSatisfying(d,r),!r)throw c}let{time:h}=l;if(l=l.versions[r],l.time=h,!l)throw c}return l}async function Ol(t,e){let{version:r}=await Hv(t.toLowerCase(),e);return r}async function Ae(){let t=await Ol("@capgo/cli").catch(()=>""),e=t?.split(".")[0];t!==Cr.version&&p.warning(`\u{1F6A8} You are using @capgo/cli@${Cr.version} it's not the latest version.
267
- Please use @capgo/cli@${t}" or @capgo/cli@${e} to keep up to date with the latest features and bug fixes.`)}async function Pie(t,e,r=!0){await Vv(t,e,void 0,r)}async function Vv(t,e,r,n=!0){n&&Z("Adding"),await Ae(),e.apikey=e.apikey||de();let i=await te();t=pe(t,i?.config),e.apikey||(p.error("Missing API key, you need to provide a API key to upload your bundle"),k.error("")),t||(p.error("Missing argument, you need to provide a appId, or be in a capacitor project"),k.error("")),t.includes("--")&&(p.error('The app id includes illegal symbols. You cannot use "--" in the app id'),k.error(""));let o=await fe(e.apikey);await he(o,e.apikey,["write","all"]),await bI(o,t)&&(t==="io.ionic.starter"?p.error(`This appId ${t} cannot be used it's reserved, please change it in your capacitor config.`):p.error(`App ${t} already exist`),k.error("")),r||(r=await sa(o,["admin","super_admin"]));let a=r.gid;await uh(o,a,e.apikey,void 0,!1);let{name:u,icon:l}=e;u=u||i.config?.appName||"Unknown",l=l||"resources/icon.png",(!l||!u)&&(p.error("Missing argument, you need to provide a appId and a name, or be in a capacitor project"),k.error("")),n&&p.info(`Adding ${t} to Capgo`);let c=null,f=null;l&&(0,ma.existsSync)(l)?(c=(0,ma.readFileSync)(l),f=oa(l)||"image/png",p.warn(`Found app icon ${l}`)):(0,ma.existsSync)(_r)?(c=(0,ma.readFileSync)(_r),f=oa(_r)||"image/png",p.warn(`Found app icon ${_r}`)):p.warn(`Cannot find app icon in any of the following locations: ${l}, ${_r}`);let h="icon",d="https://xvwzpoazmxkqosrdewyv.supabase.co/storage/v1/object/public/images/capgo.png";if(c&&f){let{error:D}=await o.storage.from(`images/org/${a}/${t}`).upload(h,c,{contentType:f});D&&(console.error(D),p.error(`Could not add app ${Q(D)}`),k.error(""));let{data:_}=await o.storage.from(`images/org/${a}/${t}`).getPublicUrl(h);d=_?.publicUrl||d}let{error:m}=await o.from("apps").insert({icon_url:d,owner_org:a,name:u,app_id:t});m&&(p.error(`Could not add app ${Q(m)}`),k.error(""));let{error:b}=await o.from("app_versions").insert([{owner_org:a,deleted:!0,name:"unknown",app_id:t},{owner_org:a,deleted:!0,name:"builtin",app_id:t}]);return b&&(p.error(`Could not add app ${Q(b)}`),k.error("")),p.success(`App ${t} added to Capgo. ${n?"You can upload a bundle now":""}`),n&&(J("Done \u2705"),(0,Vj.exit)()),!0}async function zj(t,e){Pie(t,e,!0)}var zv=require("node:process");function Rie(t){return new Promise(e=>{setTimeout(e,t)})}async function Tn(t,e,r,n,i="\u2705"){await Oe(r,{channel:t,event:n,icon:i,user_id:e,notify:!1})}async function $ie(t,e,r,n){st(e)&&(await Tn(t,r,n,"canceled","\u{1F937}"),(0,zv.exit)())}async function Iie(t,e,r){try{let n=await br(),i=await qr.post(`${n.hostApi}/private/stats`,{headers:{"Content-Type":"application/json",capgkey:t},body:JSON.stringify(e)}).then(o=>o.json()).catch(o=>(console.error("Cannot get devices",o),[]));if(i?.length>0&&(r===null||r!==i[0].created_at))return i}catch(n){p.error(`Cannot get stats ${Q(n)}`)}return[]}async function jie(t,e,r,n,i,o){if(p.info(`Log from Device: ${t.device_id}`),t.action==="get")p.info("Update Sent your your device, wait until event download complete"),await Tn(e,r,n,"done");else if(t.action.startsWith("download_")){let s=t.action.split("_")[1];s==="complete"?(p.info("Your bundle has been downloaded on your device, background the app now and open it again to see the update"),await Tn(e,r,n,"downloaded")):s==="fail"?(p.error("Your bundle has failed to download on your device."),p.error("Please check if you have network connection and try again")):p.info(`Your bundle is downloading ${s}% ...`)}else{if(t.action==="set")return p.info("Your bundle has been set on your device \u2764\uFE0F"),await Tn(e,r,n,"set"),!1;t.action==="NoChannelOrOverride"?p.error(`No default channel or override (channel/device) found, please create it here ${i}`):t.action==="needPlanUpgrade"?p.error(`Your are out of quota, please upgrade your plan here ${o}/dashboard/settings/plans`):t.action==="missingBundle"?p.error("Your bundle is missing, please check how you build your app"):t.action==="noNew"?(p.error(`The version number you uploaded to your default channel in Capgo, is the same as the present in the device ${t.device_id}.`),p.error(`To fix it, ensure the variable:
267
+ Please use @capgo/cli@${t}" or @capgo/cli@${e} to keep up to date with the latest features and bug fixes.`)}async function Pie(t,e,r=!0){await Vv(t,e,void 0,r)}async function Vv(t,e,r,n=!0){n&&Z("Adding"),await Ae(),e.apikey=e.apikey||de();let i=await te();t=pe(t,i?.config),e.apikey||(p.error("Missing API key, you need to provide a API key to upload your bundle"),k.error("")),t||(p.error("Missing argument, you need to provide a appId, or be in a capacitor project"),k.error("")),t.includes("--")&&(p.error('The app id includes illegal symbols. You cannot use "--" in the app id'),k.error(""));let o=await fe(e.apikey);await he(o,e.apikey,["write","all"]),await bI(o,t)&&(t==="io.ionic.starter"?p.error(`This appId ${t} cannot be used it's reserved, please change it in your capacitor config.`):p.error(`App ${t} already exist`),k.error("")),r||(r=await sa(o,["admin","super_admin"]));let a=r.gid;await uh(o,a,e.apikey,void 0,!1);let{name:u,icon:l}=e;u=u||i.config?.appName||"Unknown",l=l||"resources/icon.png",(!l||!u)&&(p.error("Missing argument, you need to provide a appId and a name, or be in a capacitor project"),k.error("")),n&&p.info(`Adding ${t} to Capgo`);let c=null,f=null;l&&(0,ma.existsSync)(l)?(c=(0,ma.readFileSync)(l),f=oa(l)||"image/png",p.warn(`Found app icon ${l}`)):(0,ma.existsSync)(_r)?(c=(0,ma.readFileSync)(_r),f=oa(_r)||"image/png",p.warn(`Found app icon ${_r}`)):p.warn(`Cannot find app icon in any of the following locations: ${l}, ${_r}`);let h="icon",d="https://xvwzpoazmxkqosrdewyv.supabase.co/storage/v1/object/public/images/capgo.png";if(c&&f){let{error:y}=await o.storage.from(`images/org/${a}/${t}`).upload(h,c,{contentType:f});y&&(console.error(y),p.error(`Could not add app ${Q(y)}`),k.error(""));let{data:E}=await o.storage.from(`images/org/${a}/${t}`).getPublicUrl(h);d=E?.publicUrl||d}let{error:m}=await o.from("apps").insert({icon_url:d,owner_org:a,name:u,app_id:t});m&&(p.error(`Could not add app ${Q(m)}`),k.error(""));let{error:b}=await o.from("app_versions").insert([{owner_org:a,deleted:!0,name:"unknown",app_id:t},{owner_org:a,deleted:!0,name:"builtin",app_id:t}]);return b&&(p.error(`Could not add app ${Q(b)}`),k.error("")),p.success(`App ${t} added to Capgo. ${n?"You can upload a bundle now":""}`),n&&(J("Done \u2705"),(0,Vj.exit)()),!0}async function zj(t,e){Pie(t,e,!0)}var zv=require("node:process");function Rie(t){return new Promise(e=>{setTimeout(e,t)})}async function Tn(t,e,r,n,i="\u2705"){await Oe(r,{channel:t,event:n,icon:i,user_id:e,notify:!1})}async function $ie(t,e,r,n){st(e)&&(await Tn(t,r,n,"canceled","\u{1F937}"),(0,zv.exit)())}async function Iie(t,e,r){try{let n=await br(),i=await qr.post(`${n.hostApi}/private/stats`,{headers:{"Content-Type":"application/json",capgkey:t},body:JSON.stringify(e)}).then(o=>o.json()).catch(o=>(console.error("Cannot get devices",o),[]));if(i?.length>0&&(r===null||r!==i[0].created_at))return i}catch(n){p.error(`Cannot get stats ${Q(n)}`)}return[]}async function jie(t,e,r,n,i,o){if(p.info(`Log from Device: ${t.device_id}`),t.action==="get")p.info("Update Sent your your device, wait until event download complete"),await Tn(e,r,n,"done");else if(t.action.startsWith("download_")){let s=t.action.split("_")[1];s==="complete"?(p.info("Your bundle has been downloaded on your device, background the app now and open it again to see the update"),await Tn(e,r,n,"downloaded")):s==="fail"?(p.error("Your bundle has failed to download on your device."),p.error("Please check if you have network connection and try again")):p.info(`Your bundle is downloading ${s}% ...`)}else{if(t.action==="set")return p.info("Your bundle has been set on your device \u2764\uFE0F"),await Tn(e,r,n,"set"),!1;t.action==="NoChannelOrOverride"?p.error(`No default channel or override (channel/device) found, please create it here ${i}`):t.action==="needPlanUpgrade"?p.error(`Your are out of quota, please upgrade your plan here ${o}/dashboard/settings/plans`):t.action==="missingBundle"?p.error("Your bundle is missing, please check how you build your app"):t.action==="noNew"?(p.error(`The version number you uploaded to your default channel in Capgo, is the same as the present in the device ${t.device_id}.`),p.error(`To fix it, ensure the variable:
268
268
  - iOS: keyCFBundleShortVersionString or MARKETING_VERSION
269
269
  - Android: versionName
270
270
  Are lower than the version number you uploaded to Capgo.`),p.error("More info here: https://capgo.app/blog/how-version-work-in-capgo/#versioning-system")):t.action==="disablePlatformIos"?p.error(`iOS is disabled in the default channel and your device ${t.device_id} is an iOS device ${i}`):t.action==="disablePlatformAndroid"?p.error(`Android is disabled in the default channel and your device ${t.device_id} is an Android device ${i}`):t.action==="disableAutoUpdateToMajor"?(p.error(`The version number you uploaded to your default channel in Capgo, is a major version higher (ex: 1.0.0 in device to 2.0.0 in Capgo) than the present in the device ${t.device_id}.`),p.error("Capgo is set by default to protect you from this, and avoid sending breaking changes incompatible with the native code present in the device."),p.error(`To fix it, ensure the variable:
@@ -274,7 +274,7 @@ Are lower than the version number you uploaded to Capgo.`),p.error("More info he
274
274
  - iOS: keyCFBundleShortVersionString or MARKETING_VERSION
275
275
  - Android: versionName
276
276
  Are lower than the version number you uploaded to Capgo.`),p.error("More info here: https://capgo.app/blog/how-version-work-in-capgo/#versioning-system")):t.action==="disableDevBuild"?(p.error(`Dev build is disabled in the default channel. ${i}`),p.error("Set your channel to allow it if you wanna test your app")):t.action==="disableEmulator"?(p.error(`Emulator is disabled in the default channel. ${i}`),p.error("Set your channel to allow it if you wanna test your app")):t.action==="cannotGetBundle"?(p.error(`We cannot get your bundle from the default channel. ${i}`),p.error("Are you sure your default channel has a bundle set?")):t.action==="set_fail"?p.error(`Your bundle seems to be corrupted, try to download from ${i} to identify the issue`):t.action==="reset"?p.error("Your device has been reset to the builtin bundle, did notifyAppReady() is present in the code builded and uploaded to Capgo ?"):t.action==="update_fail"?(p.error("Your bundle has been installed but failed to call notifyAppReady()"),p.error("Please check if you have network connection and try again")):t.action==="checksum_fail"?p.error("Your bundle has failed to validate checksum, please check your code and send it again to Capgo"):p.error(`Log from Capgo ${t.action}`)}return!0}async function Gv(t,e,r,n,i){let o=!0,s=mo(r),a=await br(),u=`${a.hostWeb}/app/p/${s}`;await Tn(t,n,e,"Use waitlog");let l={appId:r,devicesId:i?[i]:void 0,order:[{key:"created_at",sortable:"desc"}],rangeStart:new Date().toISOString()},c=null,f=_e();for(f.start("Waiting for logs (Expect delay of 30 sec)");o;){await Rie(5e3);let h=await Iie(e,l,c);if(h.length>0){c=h[0].created_at;for(let d of h)if(o=await jie(d,t,n,e,u,a.hostWeb),!o)break}}return f.stop("Stop watching logs"),Promise.resolve()}async function Gj(t,e){Z("Debug Live update in Capgo"),await Ae(),e.apikey=e.apikey||de();let r=await te();t=pe(t,r?.config);let n=e.device;e.apikey||(p.error("Missing API key, you need to provide an API key to delete your app"),k.error("")),t||(p.error("Missing argument, you need to provide a appId, or be in a capacitor project"),k.error(""));let i=await fe(e.apikey),o=await wr(i,t),s=await Pe({message:"Automatic check if update working in device ?"});await $ie("debug",s,o,e.apikey),s?(p.info(`Wait logs sent to Capgo from ${t} device, Please open your app \u{1F4AA}`),await Gv("debug",e.apikey,t,o,n),J("Done \u2705")):J("Canceled \u274C"),J("Done \u2705"),(0,zv.exit)()}var Wj=require("node:process");async function Kj(t,e){Z("Deleting"),e.apikey=e.apikey||de();let r=await te();t=pe(t,r?.config),e.apikey||(p.error("Missing API key, you need to provide a API key to upload your bundle"),k.error("")),t||(p.error("Missing argument, you need to provide a appId, or be in a capacitor project"),k.error(""));let n=await fe(e.apikey),i=await he(n,e.apikey,["write","all"]);await qe(n,e.apikey,t,5);let{data:o,error:s}=await n.from("apps").select("owner_org ( created_by, id )").eq("app_id",t).single(),a=o;if(!s&&(a?.owner_org.created_by??"")!==i){p.warn("Deleting the app is not recomended for users that are not the organization owner"),p.warn("You are invited as a super_admin but your are not the owner"),p.warn("It's strongly recomended that you do not continue!");let h=await yi({message:"Do you want to continue?",options:[{label:"Yes",value:"yes"},{label:"No",value:"no"}]});(st(h)||h==="no")&&(p.error("Canceled deleting the app, exiting"),k.error(""))}else s&&p.warn(`Cannot get the app owner ${Q(s)}`);let{error:u}=await n.storage.from("images").remove([`org/${a?.owner_org.id}/${t}/icon`]);u&&(console.error(u,`images/org/${a?.owner_org.id}/${t}`),p.error("Could not delete app logo"));let{error:l}=await n.storage.from(`apps/${t}/${i}`).remove(["versions"]);l&&p.error("Could not delete app version");let{error:c}=await n.from("apps").delete().eq("app_id",t);c&&(p.error("Could not delete app"),k.error(""));let f=await wr(n,t);await Oe(e.apikey,{channel:"app",event:"App Deleted",icon:"\u{1F5D1}\uFE0F",user_id:f,tags:{"app-id":t},notify:!1}).catch(),p.success("App deleted in Capgo"),J("Done \u2705"),(0,Wj.exit)()}var Ch=require("node:os"),ga=require("node:process");async function Nie(t){let e={},r=[];for(let n in t)Object.prototype.hasOwnProperty.call(t,n)&&r.push(Ol(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 Lie(){let{dependencies:t}=await vr(),e={"@capgo/cli":Cr.version};for(let r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&r.startsWith("@capgo/")&&r.startsWith("@capawesome/")&&r.startsWith("capacitor")){let n=t[r].replace("^","").replace("~","");e[r]=n}return e}async function Yj(t){p.warn(" \u{1F48A} Capgo Doctor \u{1F48A}");let e=await te(),r=await vr("",t.packageJson),n=e?.config?.plugins?.CapacitorUpdater?.version||r?.version,i=e?.config?.appName||"";p.info(` App Name: ${i}`);let o=pe("",e?.config);p.info(` App ID: ${o}`),p.info(` App Version: ${n}`);let s=e?.config?.webDir||"";p.info(` Web Dir: ${s}`),p.info(` OS: ${(0,Ch.platform)()} ${(0,Ch.version)()}`),p.info(` Node: ${ga.version}`),p.info(" Installed Dependencies:");let a=await Lie();Object.keys(a).length===0&&(p.warning("\x1B[31m%s\x1B[0m \u{1F6A8} No dependencies found"),(0,ga.exit)(1));for(let c in a)if(Object.prototype.hasOwnProperty.call(a,c)){let f=a[c];p.info(` ${c}: ${f}`)}let u=_e();u.start("Running: Loading latest dependencies");let l=await Nie(a);u.stop("Latest Dependencies:");for(let c in l)if(Object.prototype.hasOwnProperty.call(l,c)){let f=l[c];p.info(` ${c}: ${f}`)}JSON.stringify(a)!==JSON.stringify(l)&&(p.warn("\x1B[31m\u{1F6A8} Some dependencies are not up to date\x1B[0m"),(0,ga.exit)(1)),p.success("\x1B[32m\u2705 All dependencies are up to date\x1B[0m"),(0,ga.exit)()}var Wv=require("node:process");function Jj(t,e){let n=["normal","bold","dim","italic","underline","strikethrough"].indexOf(t),i="\x1B[";return i+n+"m"+e+i+"0m"}var sr=class t{title=null;headers=[];rows=[];static narrowTheme={top:["\u2554","\u2550","\u2564","\u2557"],row:["\u2551"," ","\u2502","\u2551"],div:["\u255F","\u2500","\u253C","\u2562"],bot:["\u255A","\u2550","\u2567","\u255D"]};static wideTheme={top:["\u2554\u2550","\u2550","\u2550\u2564\u2550","\u2550\u2557"],row:["\u2551 "," "," \u2502 "," \u2551"],div:["\u255F\u2500","\u2500","\u2500\u253C\u2500","\u2500\u2562"],bot:["\u255A\u2550","\u2550","\u2550\u2567\u2550","\u2550\u255D"]};static roundTheme={top:["\u256D\u2500","\u2500","\u2500\u252C\u2500","\u2500\u256E"],row:["\u2502 "," "," \u2502 "," \u2502"],div:["\u251C\u2500","\u2500","\u2500\u253C\u2500","\u2500\u2524"],bot:["\u2570\u2500","\u2500","\u2500\u2534\u2500","\u2500\u256F"]};theme=t.wideTheme;columnWidth(){let e=[this.headers,...this.rows].filter(n=>n.length>0),r=e[0].map(n=>this.cast(n).length);for(let n of e.slice(1))for(let i=0;i<r.length;i++){let o=this.cast(n[i]).length;o>r[i]&&(r[i]=o)}return r}cast(e){return typeof e=="object"?"obj":e!==void 0&&typeof e.toString=="function"?e.toString():""}renderTitle(){return"[ "+this.title+" ]"}renderLine(e){let r=this.columnWidth();return e[0]+r.map(n=>e[1].repeat(n)).join(e[2])+e[3]}renderCell(e,r,n=!1){let i=this.cast(e),o=n?Jj("bold",i):i,s=r-i.length,a=this.theme.row[1];switch(typeof e){case"number":return a.repeat(s)+o;case"string":return o+a.repeat(s);case"boolean":case"object":return a.repeat(Math.ceil(s/2))+Jj("italic",i)+a.repeat(Math.floor(s/2));default:return a.repeat(s)}}renderRow(e,r=!1){let n=this.theme.row,i=this.columnWidth();return n[0]+e.map((o,s)=>this.renderCell(o,i[s],r)).join(n[2])+n[3]}toString(){let e=this.theme,r=this.headers.length>0,n=this.rows.length>0;return[this.title?this.renderTitle():"",r||n?this.renderLine(e.top):"",r?this.renderRow(this.headers,!0):"",r&&n?this.renderLine(e.div):"",...this.rows.map(i=>this.renderRow(i)),r||n?this.renderLine(e.bot):""].filter(i=>i.length>0).join(`
277
- `)}};function Bie(t){t.length||(p.error("No apps found"),(0,Wv.exit)(1));let e=new sr;e.headers=["Name","id","Created"],e.rows=[],t.reverse().forEach(r=>{e.rows.push([r.name??"",r.app_id,aa(r.created_at)])}),p.success("Apps"),p.success(e.toString())}async function qie(t){let{data:e,error:r}=await t.from("apps").select().order("created_at",{ascending:!1});return r&&(p.error("Apps not found"),k.error("")),e}async function Xj(t){Z("List apps in Capgo"),await Ae(),t.apikey=t.apikey||de();let e=await fe(t.apikey);await he(e,t.apikey,["write","all","read","upload"]),p.info("Getting active bundle in Capgo");let r=await qie(e);p.info(`Active app in Capgo: ${r?.length}`),Bie(r),J("Done \u2705"),(0,Wv.exit)()}var Zj=require("node:crypto"),ya=require("node:fs"),Qj=require("node:process");async function e6(t,e){Z("Set app"),e.apikey=e.apikey||de();let r=await te();t=pe(t,r?.config),e.apikey||(p.error("Missing API key, you need to provide a API key to upload your bundle"),k.error("")),t||(p.error("Missing argument, you need to provide a appId, or be in a capacitor project"),k.error(""));let n=await fe(e.apikey),o=(await sa(n,["admin","super_admin"])).gid,s=await he(n,e.apikey,["write","all"]);await qe(n,e.apikey,t,4);let{name:a,icon:u,retention:l}=e;l&&Number.isNaN(Number(l))?(p.error("retention value must be a number"),k.error("")):l&&l<0&&(p.error("retention value cannot be less than 0"),k.error(""));let c,f,h=`icon_${(0,Zj.randomUUID)()}`,d="https://xvwzpoazmxkqosrdewyv.supabase.co/storage/v1/object/public/images/capgo.png";if(u&&(0,ya.existsSync)(u)?(c=(0,ya.readFileSync)(u),f=oa(u)||"image/png",p.warn(`Found app icon ${u}`)):(0,ya.existsSync)(_r)?(c=(0,ya.readFileSync)(_r),f=oa(_r)||"image/png",p.warn(`Found app icon ${_r}`)):p.warn(`Cannot find app icon in any of the following locations: ${u}, ${_r}`),c&&f){let{error:b}=await n.storage.from(`images/org/${o}/${t}`).upload(h,c,{contentType:f});b&&(p.error(`Could not set app ${Q(b)}`),k.error(""));let{data:D}=await n.storage.from(`images/org/${o}/${t}`).getPublicUrl(h);d=D?.publicUrl||d}let{error:m}=await n.from("apps").update({icon_url:d,name:a,retention:l?l*24*60*60:void 0}).eq("app_id",t).eq("user_id",s);m&&(p.error(`Could not set app ${Q(m)}`),k.error("")),J("Done \u2705"),(0,Qj.exit)()}var Da=require("node:process");async function t6(t,e){Z("Set a specific setting in capacitor config"),e.bool&&e.string&&(p.error("Bool and string CANNOT be set at the same time"),(0,Da.exit)(1)),!e.bool&&!e.string&&(p.error("You MUST provide either bool or string as the value"),(0,Da.exit)(1)),e.bool&&e.bool!=="true"&&e.bool!=="false"&&(p.error("Invalid bool"),(0,Da.exit)(1));try{let r=await te(),n=r.config,i=t.split(".");i.length===0&&(p.error("Invalid path"),(0,Da.exit)(1));for(let s of i.slice(0,-1))Object.prototype.hasOwnProperty.call(n,s)||(n[s]={}),n=n[s];let o=e.bool?e.bool==="true":e.string;n[i.at(-1)]=o,await ci(r,!0),p.success(`Set "${t}" to "${o}"`)}catch(r){p.error(`Cannot set config in capacitor settings ${Q(r)}`),(0,Da.exit)(1)}J("Done \u2705")}var ib=require("node:process");function Sh(t,e){if(isNaN(t)||isNaN(e))throw new Error("Cannot compare against non-numbers");return t===e?0:t<e?-1:1}function i6(t=[],e=[]){return t.length&&!e.length?-1:!t.length&&e.length?1:0}function Yv(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 va="0|[1-9]\\d*",Mie="\\d*[a-zA-Z-][a-zA-Z0-9-]*",Uie=`(?<major>${va})\\.(?<minor>${va})\\.(?<patch>${va})`,r6=`(?:${va}|${Mie})`,o6=`(?:-(?<prerelease>${r6}(?:\\.${r6})*))`,n6="[0-9A-Za-z-]+",s6=`(?:\\+(?<buildmetadata>${n6}(?:\\.${n6})*))`,a6=`v?${Uie}${o6}?${s6}?`,u6=new RegExp(`^${a6}$`),l6="(?:<|>)?=?",Hie="x|X|\\*",Kv=`${va}|${Hie}`,c6=`[v=\\s]*(?<major>${Kv})(?:\\.(?<minor>${Kv})(?:\\.(?<patch>${Kv})${o6}?${s6}?)?)?`,Vie=new RegExp(`^(?<operator>~>?|\\^|${l6})\\s*${c6}$`),zie=new RegExp(`^(?<operator>${l6})\\s*(${a6})$|^$`);function Jv(t){return typeof t=="number"&&!Number.isNaN(t)&&(!Number.isFinite(t)||0<=t&&t<=Number.MAX_SAFE_INTEGER)}var Xv=256;var Gie=new RegExp(`^${va}$`);function Zv(t){return t.split(".").filter(Boolean).map(e=>{if(Gie.test(e)){let r=Number(e);if(Jv(r))return r}return e})}function Al(t){return t.split(".").filter(Boolean)}function kl(t,e){let r=Number(t);if(!Jv(r))throw new TypeError(e);return r}function ar(t,e){return t===e?0:Sh(t.major,e.major)||Sh(t.minor,e.minor)||Sh(t.patch,e.patch)||i6(t.prerelease,e.prerelease)||Yv(t.prerelease,e.prerelease)}function Qv(t){return t.toFixed(0)}function ba(t){let e=Qv(t.major),r=Qv(t.minor),n=Qv(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 Wie(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 Tl(t=[],e){let r=Wie(t);return e&&(r[0]!==e||isNaN(r[1]))&&(r=[e,0]),r}function d6(t,e,r={}){let n=r.build!==void 0?Al(r.build):t.build??[];switch(e){case"premajor":return{major:t.major+1,minor:0,patch:0,prerelease:Tl(t.prerelease,r.prerelease),build:n};case"preminor":return{major:t.major,minor:t.minor+1,patch:0,prerelease:Tl(t.prerelease,r.prerelease),build:n};case"prepatch":return{major:t.major,minor:t.minor,patch:t.patch+1,prerelease:Tl(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:Tl(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:Tl(t.prerelease,r.prerelease),build:n};default:throw new TypeError(`Cannot increment version: invalid argument ${e}`)}}var eb={major:Number.NaN,minor:Number.NaN,patch:Number.NaN,prerelease:[],build:[]},h6={operator:void 0,...eb};function tb(t,e){return ar(t,e)>0}function So(t,e){return ar(t,e)<0}function Xt(t){if(typeof t!="string")throw new TypeError(`Cannot parse version as version must be a string: received ${typeof t}`);if(t.length>Xv)throw new TypeError(`Cannot parse version as version length is too long: length is ${t.length}, max length is ${Xv}`);t=t.trim();let e=t.match(u6)?.groups;if(!e)throw new TypeError(`Cannot parse version: ${t}`);let r=kl(e.major,`Cannot parse version ${t}: invalid major version`),n=kl(e.minor,`Cannot parse version ${t}: invalid minor version`),i=kl(e.patch,`Cannot parse version ${t}: invalid patch version`),o=e.prerelease?Zv(e.prerelease):[],s=e.buildmetadata?Al(e.buildmetadata):[];return{major:r,minor:n,patch:i,prerelease:o,build:s}}function m6(t,e){return ar(t,e)>=0}var E6=require("node:process");var g6=require("node:process");async function y6(t,e,r){let{data:n,error:i}=await t.from("channels").select().eq("app_id",e).eq("version",r.id);if(i&&(p.error(`Cannot check Version ${e}@${r.name}`),k.error("")),n&&n.length>0){if(Z(`\u274C Version ${e}@${r.name} is used in ${n.length} channel`),await Pe({message:"unlink it?"}))for(let o of n){let s=_e();s.start(`Unlinking channel ${o.name}`);let{error:a}=await t.from("channels").update({version:(await rb(t,e))?.id}).eq("id",o.id);a&&(s.stop(`Cannot update channel ${o.name} ${Q(a)}`),(0,g6.exit)(1)),s.stop(`\u2705 Channel ${o.name} unlinked`)}else p.error("Unlink it first"),k.error("");J(`Version unlinked from ${n.length} channel`)}}function 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.
277
+ `)}};function Bie(t){t.length||(p.error("No apps found"),(0,Wv.exit)(1));let e=new sr;e.headers=["Name","id","Created"],e.rows=[],t.reverse().forEach(r=>{e.rows.push([r.name??"",r.app_id,aa(r.created_at)])}),p.success("Apps"),p.success(e.toString())}async function qie(t){let{data:e,error:r}=await t.from("apps").select().order("created_at",{ascending:!1});return r&&(p.error("Apps not found"),k.error("")),e}async function Xj(t){Z("List apps in Capgo"),await Ae(),t.apikey=t.apikey||de();let e=await fe(t.apikey);await he(e,t.apikey,["write","all","read","upload"]),p.info("Getting active bundle in Capgo");let r=await qie(e);p.info(`Active app in Capgo: ${r?.length}`),Bie(r),J("Done \u2705"),(0,Wv.exit)()}var Zj=require("node:crypto"),ya=require("node:fs"),Qj=require("node:process");async function e6(t,e){Z("Set app"),e.apikey=e.apikey||de();let r=await te();t=pe(t,r?.config),e.apikey||(p.error("Missing API key, you need to provide a API key to upload your bundle"),k.error("")),t||(p.error("Missing argument, you need to provide a appId, or be in a capacitor project"),k.error(""));let n=await fe(e.apikey),o=(await sa(n,["admin","super_admin"])).gid,s=await he(n,e.apikey,["write","all"]);await qe(n,e.apikey,t,4);let{name:a,icon:u,retention:l}=e;l&&Number.isNaN(Number(l))?(p.error("retention value must be a number"),k.error("")):l&&l<0&&(p.error("retention value cannot be less than 0"),k.error(""));let c,f,h=`icon_${(0,Zj.randomUUID)()}`,d="https://xvwzpoazmxkqosrdewyv.supabase.co/storage/v1/object/public/images/capgo.png";if(u&&(0,ya.existsSync)(u)?(c=(0,ya.readFileSync)(u),f=oa(u)||"image/png",p.warn(`Found app icon ${u}`)):(0,ya.existsSync)(_r)?(c=(0,ya.readFileSync)(_r),f=oa(_r)||"image/png",p.warn(`Found app icon ${_r}`)):p.warn(`Cannot find app icon in any of the following locations: ${u}, ${_r}`),c&&f){let{error:b}=await n.storage.from(`images/org/${o}/${t}`).upload(h,c,{contentType:f});b&&(p.error(`Could not set app ${Q(b)}`),k.error(""));let{data:y}=await n.storage.from(`images/org/${o}/${t}`).getPublicUrl(h);d=y?.publicUrl||d}let{error:m}=await n.from("apps").update({icon_url:d,name:a,retention:l?l*24*60*60:void 0}).eq("app_id",t).eq("user_id",s);m&&(p.error(`Could not set app ${Q(m)}`),k.error("")),J("Done \u2705"),(0,Qj.exit)()}var Da=require("node:process");async function t6(t,e){Z("Set a specific setting in capacitor config"),e.bool&&e.string&&(p.error("Bool and string CANNOT be set at the same time"),(0,Da.exit)(1)),!e.bool&&!e.string&&(p.error("You MUST provide either bool or string as the value"),(0,Da.exit)(1)),e.bool&&e.bool!=="true"&&e.bool!=="false"&&(p.error("Invalid bool"),(0,Da.exit)(1));try{let r=await te(),n=r.config,i=t.split(".");i.length===0&&(p.error("Invalid path"),(0,Da.exit)(1));for(let s of i.slice(0,-1))Object.prototype.hasOwnProperty.call(n,s)||(n[s]={}),n=n[s];let o=e.bool?e.bool==="true":e.string;n[i.at(-1)]=o,await ci(r,!0),p.success(`Set "${t}" to "${o}"`)}catch(r){p.error(`Cannot set config in capacitor settings ${Q(r)}`),(0,Da.exit)(1)}J("Done \u2705")}var ib=require("node:process");function Sh(t,e){if(isNaN(t)||isNaN(e))throw new Error("Cannot compare against non-numbers");return t===e?0:t<e?-1:1}function i6(t=[],e=[]){return t.length&&!e.length?-1:!t.length&&e.length?1:0}function Yv(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 va="0|[1-9]\\d*",Mie="\\d*[a-zA-Z-][a-zA-Z0-9-]*",Uie=`(?<major>${va})\\.(?<minor>${va})\\.(?<patch>${va})`,r6=`(?:${va}|${Mie})`,o6=`(?:-(?<prerelease>${r6}(?:\\.${r6})*))`,n6="[0-9A-Za-z-]+",s6=`(?:\\+(?<buildmetadata>${n6}(?:\\.${n6})*))`,a6=`v?${Uie}${o6}?${s6}?`,u6=new RegExp(`^${a6}$`),l6="(?:<|>)?=?",Hie="x|X|\\*",Kv=`${va}|${Hie}`,c6=`[v=\\s]*(?<major>${Kv})(?:\\.(?<minor>${Kv})(?:\\.(?<patch>${Kv})${o6}?${s6}?)?)?`,Vie=new RegExp(`^(?<operator>~>?|\\^|${l6})\\s*${c6}$`),zie=new RegExp(`^(?<operator>${l6})\\s*(${a6})$|^$`);function Jv(t){return typeof t=="number"&&!Number.isNaN(t)&&(!Number.isFinite(t)||0<=t&&t<=Number.MAX_SAFE_INTEGER)}var Xv=256;var Gie=new RegExp(`^${va}$`);function Zv(t){return t.split(".").filter(Boolean).map(e=>{if(Gie.test(e)){let r=Number(e);if(Jv(r))return r}return e})}function Al(t){return t.split(".").filter(Boolean)}function kl(t,e){let r=Number(t);if(!Jv(r))throw new TypeError(e);return r}function ar(t,e){return t===e?0:Sh(t.major,e.major)||Sh(t.minor,e.minor)||Sh(t.patch,e.patch)||i6(t.prerelease,e.prerelease)||Yv(t.prerelease,e.prerelease)}function Qv(t){return t.toFixed(0)}function ba(t){let e=Qv(t.major),r=Qv(t.minor),n=Qv(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 Wie(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 Tl(t=[],e){let r=Wie(t);return e&&(r[0]!==e||isNaN(r[1]))&&(r=[e,0]),r}function d6(t,e,r={}){let n=r.build!==void 0?Al(r.build):t.build??[];switch(e){case"premajor":return{major:t.major+1,minor:0,patch:0,prerelease:Tl(t.prerelease,r.prerelease),build:n};case"preminor":return{major:t.major,minor:t.minor+1,patch:0,prerelease:Tl(t.prerelease,r.prerelease),build:n};case"prepatch":return{major:t.major,minor:t.minor,patch:t.patch+1,prerelease:Tl(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:Tl(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:Tl(t.prerelease,r.prerelease),build:n};default:throw new TypeError(`Cannot increment version: invalid argument ${e}`)}}var eb={major:Number.NaN,minor:Number.NaN,patch:Number.NaN,prerelease:[],build:[]},h6={operator:void 0,...eb};function tb(t,e){return ar(t,e)>0}function So(t,e){return ar(t,e)<0}function Xt(t){if(typeof t!="string")throw new TypeError(`Cannot parse version as version must be a string: received ${typeof t}`);if(t.length>Xv)throw new TypeError(`Cannot parse version as version length is too long: length is ${t.length}, max length is ${Xv}`);t=t.trim();let e=t.match(u6)?.groups;if(!e)throw new TypeError(`Cannot parse version: ${t}`);let r=kl(e.major,`Cannot parse version ${t}: invalid major version`),n=kl(e.minor,`Cannot parse version ${t}: invalid minor version`),i=kl(e.patch,`Cannot parse version ${t}: invalid patch version`),o=e.prerelease?Zv(e.prerelease):[],s=e.buildmetadata?Al(e.buildmetadata):[];return{major:r,minor:n,patch:i,prerelease:o,build:s}}function m6(t,e){return ar(t,e)>=0}var E6=require("node:process");var g6=require("node:process");async function y6(t,e,r){let{data:n,error:i}=await t.from("channels").select().eq("app_id",e).eq("version",r.id);if(i&&(p.error(`Cannot check Version ${e}@${r.name}`),k.error("")),n&&n.length>0){if(Z(`\u274C Version ${e}@${r.name} is used in ${n.length} channel`),await Pe({message:"unlink it?"}))for(let o of n){let s=_e();s.start(`Unlinking channel ${o.name}`);let{error:a}=await t.from("channels").update({version:(await rb(t,e))?.id}).eq("id",o.id);a&&(s.stop(`Cannot update channel ${o.name} ${Q(a)}`),(0,g6.exit)(1)),s.stop(`\u2705 Channel ${o.name} unlinked`)}else p.error("Unlink it first"),k.error("");J(`Version unlinked from ${n.length} channel`)}}function 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.
278
278
  ${Q(n)}`),k.error("")),r))}function D6(t,e){return t.from("channels").insert(e).select().single()}function v6(t,e,r,n){return t.from("channels").delete().eq("name",e).eq("app_id",r).single()}function b6(t,e,r){return t.from("channels").select(`
279
279
  id,
280
280
  version (id, name)
@@ -293,7 +293,7 @@ ${Q(n)}`),k.error("")),r))}function D6(t,e){return t.from("channels").insert(e).
293
293
  created_by,
294
294
  app_id,
295
295
  version (id, name)
296
- `).eq("app_id",e).order("created_at",{ascending:!1});return n&&(p.error(`App ${e} not found in database`),k.error("")),r}async function nb(t,e,r){let{error:n}=await t.from("app_versions").update({deleted:!0}).eq("app_id",e).eq("deleted",!1).eq("name",r);n&&(p.error(`App Version ${e}@${r} not found in database`),k.error(""))}async function Fh(t,e,r){let n=await Kie(t,e,r);await y6(t,e,n),await nb(t,e,r)}function Oh(t){t.length||(p.error("No bundle found"),(0,E6.exit)(1));let e=new sr;e.theme=sr.roundTheme,e.headers=["Version","Created","Keep"],t.reverse().forEach(r=>{e.rows.push([r.name,aa(r.created_at),r.keep!=null?r.keep:""])}),p.success("Bundles"),p.success(e.toString())}async function Ah(t,e){let{data:r,error:n}=await t.from("app_versions").select().eq("app_id",e).eq("deleted",!1).order("created_at",{ascending:!1});return n&&(p.error(`App ${e} not found in database`),k.error("")),r}async function C6(t,e){let{data:r,error:n}=await t.from("channels").select("version").eq("app_id",e);return n&&(p.error(`App ${e} not found in database`),k.error("")),r.map(i=>i.version)}async function Kie(t,e,r){let{data:n,error:i}=await t.from("app_versions").select().eq("app_id",e).eq("name",r).eq("deleted",!1).single();return(!n||i)&&(p.error(`App Version ${e}@${r} doesn't exist`),k.error("")),n}async function Yie(t,e,r){for await(let n of t)p.warn(`Removing ${n.name} created on ${aa(n.created_at)}`),await Fh(e,r,n.name)}function Jie(t,e,r){let n=[];return t?.forEach(i=>{let o=Xt(i.name);tb(o,e)&&So(o,r)&&n.push(i)}),n}async function S6(t,e){Z("Cleanup versions in Capgo"),await Ae(),e.apikey=e.apikey||de();let{bundle:r,keep:n=4}=e,i=e.force||!1,o=await te();t=pe(t,o?.config),e.apikey||(p.error("Missing API key, you need to provide an API key to delete your app"),k.error("")),t||(p.error("Missing argument, you need to provide a appid, or be in a capacitor project"),k.error(""));let s=await fe(e.apikey);await he(s,e.apikey,["write","all"]),await qe(s,e.apikey,t,3),p.info("Querying all available versions in Capgo");let a=await Ah(s,t),u=await C6(s,t);if(p.info(`Total active versions in Capgo: ${a?.length}`),a?.length===0){p.error("No versions found, aborting cleanup");return}if(r){let f=Xt(r),h=d6(f,"major");p.info(`Querying available versions in Capgo between ${ba(f)} and ${ba(h)}`),a=Jie(a,f,h),p.info(`Active versions in Capgo between ${ba(f)} and ${ba(h)}: ${a?.length}`)}let l=[],c=0;if(a.forEach(f=>{let h=u.find(d=>d===f.id);c<n||h?(h?f.keep="\u2705 (Linked to channel)":f.keep="\u2705",c+=1):(f.keep="\u274C",l.push(f))}),l.length===0){p.warn("Nothing to be removed, aborting removal...");return}if(Oh(a),!i){let f=await Pe({message:"Do you want to continue removing the versions specified?"});(st(f)||!f)&&(p.warn("Not confirmed, aborting removal..."),(0,ib.exit)())}p.success("You have confirmed removal, removing versions now"),await Yie(l,s,t),J("Done \u2705"),(0,ib.exit)()}var x6=ue(z0());async function F6(t,e){Z("Check compatibility"),e.apikey=e.apikey||de();let r=await te();t=pe(t,r?.config);let{channel:n}=e;n||(p.error("Missing argument, you need to provide a channel"),k.error("")),e.apikey||(p.error("Missing API key, you need to provide a API key to upload your bundle"),k.error("")),t||(p.error("Missing argument, you need to provide a appId, or be in a capacitor project"),k.error(""));let i=await fe(e.apikey);await he(i,e.apikey,["write","all","read","upload"]),await qe(i,e.apikey,t,1);let{finalCompatibility:o}=await fh(i,t,n,e.packageJson,e.nodeModules),s=new sr;s.headers=["Package","Local version","Remote version","Compatible"],s.theme=sr.roundTheme,s.rows=[];let a=e.text?"Yes":"\u2705",u=e.text?"No":"\u274C";o.forEach(l=>{let{name:c,localVersion:f,remoteVersion:h}=l,d=u;try{d=(0,x6.default)(f??"",h??"")?a:u}catch(m){p.error(`Fail when compare. Error: ${m}`)}s.rows.push([c,f,h,d])}),p.success("Compatibility"),p.success(s.toString())}var nn=require("node:fs"),P6=require("node:process");var R6=ue(fu());var di=require("node:buffer"),Et=require("node:crypto"),O6="aes-128-cbc",Pn="base64",kh=Et.constants.RSA_PKCS1_PADDING;function Th(t){let e=(0,Et.randomBytes)(16),r=(0,Et.randomBytes)(16),n=e.toString(Pn),i=(0,Et.privateEncrypt)({key:t,padding:kh},r).toString(Pn);return{sessionKey:r,ivSessionKey:`${n}:${i}`}}function wa(t,e,r){let[n]=r.split(":"),i=di.Buffer.from(n,Pn),o=(0,Et.createCipheriv)(O6,e,i);return o.setAutoPadding(!0),di.Buffer.concat([o.update(t),o.final()])}function A6(t,e,r){let[n,i]=e.split(":"),o=(0,Et.publicDecrypt)({key:r,padding:kh},di.Buffer.from(i,Pn)),s=di.Buffer.from(n,Pn),a=(0,Et.createDecipheriv)(O6,o,s);return a.setAutoPadding(!0),di.Buffer.concat([a.update(t),a.final()])}function _a(t,e){return(0,Et.privateEncrypt)({key:e,padding:kh},di.Buffer.from(t,Pn)).toString(Pn)}function k6(t="pem",e=2048){let{publicKey:r,privateKey:n}=(0,Et.generateKeyPairSync)("rsa",{modulusLength:e});return t==="pem"?{publicKey:r.export({type:"pkcs1",format:"pem"}),privateKey:n.export({type:"pkcs1",format:"pem"})}:{publicKey:r.export({type:"spki",format:"der"}).toString("base64"),privateKey:n.export({type:"pkcs1",format:"pem"}).toString("base64")}}function T6(t,e){return(0,Et.publicDecrypt)({key:e,padding:kh},di.Buffer.from(t,Pn)).toString(Pn)}async function $6(t,e,r){Z("Decrypt zip file"),await Ae(),(0,nn.existsSync)(t)||(p.error(`Zip not found at the path ${t}`),k.error(""));let n=await te();!r.key&&!(0,nn.existsSync)(Fn)&&!n.config.plugins?.CapacitorUpdater?.privateKey&&(p.error(`Private Key not found at the path ${Fn} or in ${n.path}`),k.error(""));let i=r.key||Fn,o=n.config.plugins?.CapacitorUpdater?.publicKey;!(0,nn.existsSync)(i)&&!o?(p.error(`Cannot find public key ${i} or as keyData option or in ${n.path}`),k.error("")):(0,nn.existsSync)(i)&&(o=(0,nn.readFileSync)(i).toString());let s=(0,nn.readFileSync)(t),a=A6(s,e,r.keyData??o??"");if((0,nn.writeFileSync)(`${t}_decrypted.zip`,a),p.info(`Decrypted zip file at ${t}_decrypted.zip`),r.checksum){let u=await(0,R6.checksum)(a,"sha256"),l=T6(r.checksum,r.keyData??o??"");u!==l?(p.error(`Checksum does not match ${u} !== ${l}`),k.error("")):p.info("Checksum matches")}J("\u2705 done"),(0,P6.exit)()}var I6=require("node:process");async function j6(t,e,r){Z("Delete bundle"),r.apikey=r.apikey||de();let n=await te();e=pe(e,n?.config),r.apikey||(p.error("Missing API key, you need to provide a API key to upload your bundle"),k.error("")),e||(p.error("Missing argument, you need to provide a appId, or be in a capacitor project"),k.error(""));let i=await fe(r.apikey);await he(i,r.apikey,["write","all"]),await qe(i,r.apikey,e,3),r.apikey||(p.error("Missing API key, you need to provide an API key to delete your app"),k.error("")),t||(p.error("Missing argument, you need to provide a bundleId, or be in a capacitor project"),k.error("")),e||(p.error("Missing argument, you need to provide a appId, or be in a capacitor project"),k.error("")),p.info(`Deleting bundle ${e}@${t} from Capgo`),p.info("Keep in mind that you will not be able to reuse this bundle version, it's gone forever"),await Fh(i,e,t),p.success(`Bundle ${e}@${t} deleted in Capgo`),J("Done"),(0,I6.exit)()}var Rn=require("node:fs"),N6=require("node:process");async function L6(t,e,r){let{json:n}=r;n||(Z("Encryption"),await Ae());let i=await te(),o=!!i.config.plugins?.CapacitorUpdater?.privateKey,s=!!i.config.plugins?.CapacitorUpdater?.publicKey;o&&!n&&p.warning("There is still a privateKey in the config"),(0,Rn.existsSync)(t)||(n?console.error(Q({error:"zip_not_found"})):p.error(`Error: Zip not found at the path ${t}`),k.error("")),s||(n?console.error(Q({error:"missing_public_key"})):p.warning("Warning: Missing Public Key in config"),k.error(""));let a=r.key||or,u=r.keyData||"";!(0,Rn.existsSync)(a)&&!u?(n?console.error(Q({error:"missing_key"})):(p.warning(`Cannot find a private key at ${a} or as a keyData option`),p.error("Error: Missing key")),k.error("")):(0,Rn.existsSync)(a)&&(u=(0,Rn.readFileSync)(a).toString()),u&&!u.startsWith("-----BEGIN RSA PRIVATE KEY-----")&&(n?console.error(Q({error:"invalid_private_key"})):p.error("the private key provided is not a valid RSA Private key"),k.error(""));let l=(0,Rn.readFileSync)(t),{sessionKey:c,ivSessionKey:f}=Th(u),h=wa(l,c,f),d=_a(e,u),m=`${t}_encrypted.zip`;n?console.log(JSON.stringify({checksum:d,filename:m,ivSessionKey:f},null,2)):(p.success(`Encoded Checksum: ${d}`),p.success(`ivSessionKey: ${f}`)),(0,Rn.writeFileSync)(m,h),n||(p.success(`Encrypted zip saved at ${m}`),J("Done \u2705")),(0,N6.exit)()}var B6=require("node:process");async function q6(t,e){Z("List bundles"),await Ae(),e.apikey=e.apikey||de();let r=await te();t=pe(t,r?.config),e.apikey||(p.error("Missing API key, you need to provide a API key to upload your bundle"),k.error("")),t||(p.error("Missing argument, you need to provide a appid, or be in a capacitor project"),k.error(""));let n=await fe(e.apikey);await he(n,e.apikey,["write","all","read","upload"]),p.info(`Querying available versions of: ${t} in Capgo`),await qe(n,e.apikey,t,1);let i=await Ah(n,t);p.info(`Active versions in Capgo: ${i?.length}`),Oh(i),J("Done \u2705"),(0,B6.exit)()}var n8=require("node:crypto"),Po=require("node:fs"),i8=require("node:path/posix"),Mh=require("node:process");var Ph=class extends TransformStream{outChunkSize;constructor(e){let r=new Uint8Array(e),n=0;super({transform(i,o){let s=0;for(;s<i.length;){let a=e-n,u=Math.min(a,i.length-s);r.set(i.subarray(s,s+u),n),s+=u,n+=u,n===e&&(o.enqueue(r),r=new Uint8Array(e),n=0)}},flush(i){n>0&&i.enqueue(r.subarray(0,n))}}),this.outChunkSize=e}};function hi(t){return t=t.trim(),t=t.replace(/<!--[\s\S]*?-->/g,""),e();function e(){return{declaration:r(),root:n()}}function r(){if(!u(/^<\?xml\s*/))return;let h={attributes:{}};for(;!(l()||c("?>"));){let d=o();if(!d)return h;h.attributes[d.name]=d.value}return u(/\?>\s*/),h}function n(){let f=u(/^<([\w-:.]+)\s*/);if(!f)return;let h={name:f[1],attributes:{},children:[]};for(;!(l()||c(">")||c("?>")||c("/>"));){let m=o();if(!m)return h;h.attributes[m.name]=m.value}if(u(/^\s*\/>\s*/))return h;u(/\??>\s*/),h.content=i();let d;for(;d=n();)h.children.push(d);return u(/^<\/[\w-:.]+>\s*/),h}function i(){let f=u(/^([^<]*)/);return f?a(f[1]):""}function o(){let f=u(/([\w:-]+)\s*=\s*("[^"]*"|'[^']*'|\w+)\s*/);if(f)return{name:f[1],value:a(s(f[2]))}}function s(f){return f.replace(/^['"]|['"]$/g,"")}function a(f){return f.replaceAll("&lt;","<").replaceAll("&gt;",">").replaceAll("&amp;","&")}function u(f){let h=t.match(f);if(h)return t=t.slice(h[0].length),h}function l(){return t.length==0}function c(f){return t.indexOf(f)==0}}var on=class extends Error{constructor(e){super(e)}};var Er=class extends on{},Rh=class extends on{},$h=class extends on{},$n=class extends on{},xo=class extends on{},Pl=class extends on{},Rl=class extends on{},In=class extends on{statusCode;code;key;bucketName;resource;region;constructor(e,r,n,i={}){super(n),this.statusCode=e,this.code=r,this.key=i.key,this.bucketName=i.bucketName,this.resource=i.resource,this.region=i.region}};async function M6(t){try{let r=hi(await t.text()).root;if(r?.name!=="Error")throw new Error("Invalid root, expected <Error>");let n=r.children.find(l=>l.name==="Code")?.content??"UnknownErrorCode",i=r.children.find(l=>l.name==="Message")?.content??"The error message could not be determined.",o=r.children.find(l=>l.name==="Key")?.content,s=r.children.find(l=>l.name==="BucketName")?.content,a=r.children.find(l=>l.name==="Resource")?.content,u=r.children.find(l=>l.name==="Region")?.content;return new In(t.status,n,i,{key:o,bucketName:s,resource:a,region:u})}catch{return new In(t.status,"UnrecognizedError",`Error: Unexpected response code ${t.status} ${t.statusText}. Unable to parse response as XML.`)}}function U6(t){return typeof t!="number"||isNaN(t)||t<=0?!1:t>=1&&t<=65535}function H6(t){return typeof t!="string"||t.length<3||t.length>63||t.indexOf("..")>-1||t.match(/[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+/)?!1:!!t.match(/^[a-z0-9][a-z0-9.-]+[a-z0-9]$/)}function Fo(t){return!(!Xie(t)||t.length===0)}function Xie(t){return!(typeof t!="string"||t.length>1024)}function Ih(t){return Array.from(t).map(e=>e.toString(16).padStart(2,"0")).join("")}function Oo(t=""){let e={'"':"","&quot;":"","&#34;":"","&QUOT;":"","&#x00022":""};return t.replace(/^("|&quot;|&#34;)|("|&quot;|&#34;)$/g,r=>e[r])}function sb(t){return t.get("x-amz-version-id")??null}function $l(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 ab(t){t=t||new Date;let e=t.toISOString();return e.substr(0,4)+e.substr(5,2)+e.substr(8,2)}function ub(t,e){return`${ab(e)}/${t}/s3/aws4_request`}async function jh(t){return t instanceof Uint8Array||(t=new TextEncoder().encode(t)),Ih(new Uint8Array(await crypto.subtle.digest("SHA-256",t)))}var Zie=["x-amz-server-side-encryption-customer-algorithm","x-amz-server-side-encryption-customer-key","x-amz-server-side-encryption-customer-key-MD5"],Nh=class extends WritableStream{getResult;constructor({client:e,bucketName:r,objectName:n,partSize:i,metadata:o}){let s,a=1,u,l=[],c=[];super({start(){},async write(f,h){let d="PUT",m=a++;try{if(m==1&&f.length<i){let _=await e.makeRequest({method:d,headers:new Headers({...o,"Content-Length":String(f.length)}),bucketName:r,objectName:n,payload:f});s={etag:Oo(_.headers.get("etag")??void 0),versionId:sb(_.headers)};return}m===1&&(u=(await Qie({client:e,bucketName:r,objectName:n,metadata:o})).uploadId);let b={"Content-Length":String(f.length)};for(let _ of Zie){let F=o[_];F&&(b[_]=F)}let D=e.makeRequest({method:d,query:{partNumber:m.toString(),uploadId:u},headers:new Headers(b),bucketName:r,objectName:n,payload:f});D.then(_=>{let F=_.headers.get("etag")??"";F&&(F=F.replace(/^"/,"").replace(/"$/,"")),l.push({part:m,etag:F})}),c.push(D)}catch(b){throw b}},async close(){if(!s)if(u)await Promise.all(c),l.sort((f,h)=>f.part>h.part?1:-1),s=await eoe({client:e,bucketName:r,objectName:n,uploadId:u,etags:l});else throw new Error("Stream was closed without uploading any data.")}}),this.getResult=()=>{if(s===void 0)throw new Error("Result is not ready. await the stream first.");return s}}};async function Qie(t){let e="POST",r=new Headers(t.metadata),o=await(await t.client.makeRequest({method:e,bucketName:t.bucketName,objectName:t.objectName,query:"uploads",headers:r,returnBody:!0})).text(),s=hi(o).root;if(!s||s.name!=="InitiateMultipartUploadResult")throw new Error(`Unexpected response: ${o}`);let a=s.children.find(u=>u.name==="UploadId")?.content;if(!a)throw new Error(`Unable to get UploadId from response: ${o}`);return{uploadId:a}}async function eoe({client:t,bucketName:e,objectName:r,uploadId:n,etags:i}){let o=`
296
+ `).eq("app_id",e).order("created_at",{ascending:!1});return n&&(p.error(`App ${e} not found in database`),k.error("")),r}async function nb(t,e,r){let{error:n}=await t.from("app_versions").update({deleted:!0}).eq("app_id",e).eq("deleted",!1).eq("name",r);n&&(p.error(`App Version ${e}@${r} not found in database`),k.error(""))}async function Fh(t,e,r){let n=await Kie(t,e,r);await y6(t,e,n),await nb(t,e,r)}function Oh(t){t.length||(p.error("No bundle found"),(0,E6.exit)(1));let e=new sr;e.theme=sr.roundTheme,e.headers=["Version","Created","Keep"],t.reverse().forEach(r=>{e.rows.push([r.name,aa(r.created_at),r.keep!=null?r.keep:""])}),p.success("Bundles"),p.success(e.toString())}async function Ah(t,e){let{data:r,error:n}=await t.from("app_versions").select().eq("app_id",e).eq("deleted",!1).order("created_at",{ascending:!1});return n&&(p.error(`App ${e} not found in database`),k.error("")),r}async function C6(t,e){let{data:r,error:n}=await t.from("channels").select("version").eq("app_id",e);return n&&(p.error(`App ${e} not found in database`),k.error("")),r.map(i=>i.version)}async function Kie(t,e,r){let{data:n,error:i}=await t.from("app_versions").select().eq("app_id",e).eq("name",r).eq("deleted",!1).single();return(!n||i)&&(p.error(`App Version ${e}@${r} doesn't exist`),k.error("")),n}async function Yie(t,e,r){for await(let n of t)p.warn(`Removing ${n.name} created on ${aa(n.created_at)}`),await Fh(e,r,n.name)}function Jie(t,e,r){let n=[];return t?.forEach(i=>{let o=Xt(i.name);tb(o,e)&&So(o,r)&&n.push(i)}),n}async function S6(t,e){Z("Cleanup versions in Capgo"),await Ae(),e.apikey=e.apikey||de();let{bundle:r,keep:n=4}=e,i=e.force||!1,o=await te();t=pe(t,o?.config),e.apikey||(p.error("Missing API key, you need to provide an API key to delete your app"),k.error("")),t||(p.error("Missing argument, you need to provide a appid, or be in a capacitor project"),k.error(""));let s=await fe(e.apikey);await he(s,e.apikey,["write","all"]),await qe(s,e.apikey,t,3),p.info("Querying all available versions in Capgo");let a=await Ah(s,t),u=await C6(s,t);if(p.info(`Total active versions in Capgo: ${a?.length}`),a?.length===0){p.error("No versions found, aborting cleanup");return}if(r){let f=Xt(r),h=d6(f,"major");p.info(`Querying available versions in Capgo between ${ba(f)} and ${ba(h)}`),a=Jie(a,f,h),p.info(`Active versions in Capgo between ${ba(f)} and ${ba(h)}: ${a?.length}`)}let l=[],c=0;if(a.forEach(f=>{let h=u.find(d=>d===f.id);c<n||h?(h?f.keep="\u2705 (Linked to channel)":f.keep="\u2705",c+=1):(f.keep="\u274C",l.push(f))}),l.length===0){p.warn("Nothing to be removed, aborting removal...");return}if(Oh(a),!i){let f=await Pe({message:"Do you want to continue removing the versions specified?"});(st(f)||!f)&&(p.warn("Not confirmed, aborting removal..."),(0,ib.exit)())}p.success("You have confirmed removal, removing versions now"),await Yie(l,s,t),J("Done \u2705"),(0,ib.exit)()}var x6=ue(z0());async function F6(t,e){Z("Check compatibility"),e.apikey=e.apikey||de();let r=await te();t=pe(t,r?.config);let{channel:n}=e;n||(p.error("Missing argument, you need to provide a channel"),k.error("")),e.apikey||(p.error("Missing API key, you need to provide a API key to upload your bundle"),k.error("")),t||(p.error("Missing argument, you need to provide a appId, or be in a capacitor project"),k.error(""));let i=await fe(e.apikey);await he(i,e.apikey,["write","all","read","upload"]),await qe(i,e.apikey,t,1);let{finalCompatibility:o}=await fh(i,t,n,e.packageJson,e.nodeModules),s=new sr;s.headers=["Package","Local version","Remote version","Compatible"],s.theme=sr.roundTheme,s.rows=[];let a=e.text?"Yes":"\u2705",u=e.text?"No":"\u274C";o.forEach(l=>{let{name:c,localVersion:f,remoteVersion:h}=l,d=u;try{d=(0,x6.default)(f??"",h??"")?a:u}catch(m){p.error(`Fail when compare. Error: ${m}`)}s.rows.push([c,f,h,d])}),p.success("Compatibility"),p.success(s.toString())}var nn=require("node:fs"),P6=require("node:process");var R6=ue(fu());var di=require("node:buffer"),Et=require("node:crypto"),O6="aes-128-cbc",Pn="base64",kh=Et.constants.RSA_PKCS1_PADDING;function Th(t){let e=(0,Et.randomBytes)(16),r=(0,Et.randomBytes)(16),n=e.toString(Pn),i=(0,Et.privateEncrypt)({key:t,padding:kh},r).toString(Pn);return{sessionKey:r,ivSessionKey:`${n}:${i}`}}function wa(t,e,r){let[n]=r.split(":"),i=di.Buffer.from(n,Pn),o=(0,Et.createCipheriv)(O6,e,i);return o.setAutoPadding(!0),di.Buffer.concat([o.update(t),o.final()])}function A6(t,e,r){let[n,i]=e.split(":"),o=(0,Et.publicDecrypt)({key:r,padding:kh},di.Buffer.from(i,Pn)),s=di.Buffer.from(n,Pn),a=(0,Et.createDecipheriv)(O6,o,s);return a.setAutoPadding(!0),di.Buffer.concat([a.update(t),a.final()])}function _a(t,e){return(0,Et.privateEncrypt)({key:e,padding:kh},di.Buffer.from(t,Pn)).toString(Pn)}function k6(t="pem",e=2048){let{publicKey:r,privateKey:n}=(0,Et.generateKeyPairSync)("rsa",{modulusLength:e});return t==="pem"?{publicKey:r.export({type:"pkcs1",format:"pem"}),privateKey:n.export({type:"pkcs1",format:"pem"})}:{publicKey:r.export({type:"spki",format:"der"}).toString("base64"),privateKey:n.export({type:"pkcs1",format:"pem"}).toString("base64")}}function T6(t,e){return(0,Et.publicDecrypt)({key:e,padding:kh},di.Buffer.from(t,Pn)).toString(Pn)}async function $6(t,e,r){Z("Decrypt zip file"),await Ae(),(0,nn.existsSync)(t)||(p.error(`Zip not found at the path ${t}`),k.error(""));let n=await te();!r.key&&!(0,nn.existsSync)(Fn)&&!n.config.plugins?.CapacitorUpdater?.privateKey&&(p.error(`Private Key not found at the path ${Fn} or in ${n.path}`),k.error(""));let i=r.key||Fn,o=n.config.plugins?.CapacitorUpdater?.publicKey;!(0,nn.existsSync)(i)&&!o?(p.error(`Cannot find public key ${i} or as keyData option or in ${n.path}`),k.error("")):(0,nn.existsSync)(i)&&(o=(0,nn.readFileSync)(i).toString());let s=(0,nn.readFileSync)(t),a=A6(s,e,r.keyData??o??"");if((0,nn.writeFileSync)(`${t}_decrypted.zip`,a),p.info(`Decrypted zip file at ${t}_decrypted.zip`),r.checksum){let u=await(0,R6.checksum)(a,"sha256"),l=T6(r.checksum,r.keyData??o??"");u!==l?(p.error(`Checksum does not match ${u} !== ${l}`),k.error("")):p.info("Checksum matches")}J("\u2705 done"),(0,P6.exit)()}var I6=require("node:process");async function j6(t,e,r){Z("Delete bundle"),r.apikey=r.apikey||de();let n=await te();e=pe(e,n?.config),r.apikey||(p.error("Missing API key, you need to provide a API key to upload your bundle"),k.error("")),e||(p.error("Missing argument, you need to provide a appId, or be in a capacitor project"),k.error(""));let i=await fe(r.apikey);await he(i,r.apikey,["write","all"]),await qe(i,r.apikey,e,3),r.apikey||(p.error("Missing API key, you need to provide an API key to delete your app"),k.error("")),t||(p.error("Missing argument, you need to provide a bundleId, or be in a capacitor project"),k.error("")),e||(p.error("Missing argument, you need to provide a appId, or be in a capacitor project"),k.error("")),p.info(`Deleting bundle ${e}@${t} from Capgo`),p.info("Keep in mind that you will not be able to reuse this bundle version, it's gone forever"),await Fh(i,e,t),p.success(`Bundle ${e}@${t} deleted in Capgo`),J("Done"),(0,I6.exit)()}var Rn=require("node:fs"),N6=require("node:process");async function L6(t,e,r){let{json:n}=r;n||(Z("Encryption"),await Ae());let i=await te(),o=!!i.config.plugins?.CapacitorUpdater?.privateKey,s=!!i.config.plugins?.CapacitorUpdater?.publicKey;o&&!n&&p.warning("There is still a privateKey in the config"),(0,Rn.existsSync)(t)||(n?console.error(Q({error:"zip_not_found"})):p.error(`Error: Zip not found at the path ${t}`),k.error("")),s||(n?console.error(Q({error:"missing_public_key"})):p.warning("Warning: Missing Public Key in config"),k.error(""));let a=r.key||or,u=r.keyData||"";!(0,Rn.existsSync)(a)&&!u?(n?console.error(Q({error:"missing_key"})):(p.warning(`Cannot find a private key at ${a} or as a keyData option`),p.error("Error: Missing key")),k.error("")):(0,Rn.existsSync)(a)&&(u=(0,Rn.readFileSync)(a).toString()),u&&!u.startsWith("-----BEGIN RSA PRIVATE KEY-----")&&(n?console.error(Q({error:"invalid_private_key"})):p.error("the private key provided is not a valid RSA Private key"),k.error(""));let l=(0,Rn.readFileSync)(t),{sessionKey:c,ivSessionKey:f}=Th(u),h=wa(l,c,f),d=_a(e,u),m=`${t}_encrypted.zip`;n?console.log(JSON.stringify({checksum:d,filename:m,ivSessionKey:f},null,2)):(p.success(`Encoded Checksum: ${d}`),p.success(`ivSessionKey: ${f}`)),(0,Rn.writeFileSync)(m,h),n||(p.success(`Encrypted zip saved at ${m}`),J("Done \u2705")),(0,N6.exit)()}var B6=require("node:process");async function q6(t,e){Z("List bundles"),await Ae(),e.apikey=e.apikey||de();let r=await te();t=pe(t,r?.config),e.apikey||(p.error("Missing API key, you need to provide a API key to upload your bundle"),k.error("")),t||(p.error("Missing argument, you need to provide a appid, or be in a capacitor project"),k.error(""));let n=await fe(e.apikey);await he(n,e.apikey,["write","all","read","upload"]),p.info(`Querying available versions of: ${t} in Capgo`),await qe(n,e.apikey,t,1);let i=await Ah(n,t);p.info(`Active versions in Capgo: ${i?.length}`),Oh(i),J("Done \u2705"),(0,B6.exit)()}var n8=require("node:crypto"),Po=require("node:fs"),i8=require("node:path/posix"),Mh=require("node:process");var Ph=class extends TransformStream{outChunkSize;constructor(e){let r=new Uint8Array(e),n=0;super({transform(i,o){let s=0;for(;s<i.length;){let a=e-n,u=Math.min(a,i.length-s);r.set(i.subarray(s,s+u),n),s+=u,n+=u,n===e&&(o.enqueue(r),r=new Uint8Array(e),n=0)}},flush(i){n>0&&i.enqueue(r.subarray(0,n))}}),this.outChunkSize=e}};function hi(t){return t=t.trim(),t=t.replace(/<!--[\s\S]*?-->/g,""),e();function e(){return{declaration:r(),root:n()}}function r(){if(!u(/^<\?xml\s*/))return;let h={attributes:{}};for(;!(l()||c("?>"));){let d=o();if(!d)return h;h.attributes[d.name]=d.value}return u(/\?>\s*/),h}function n(){let f=u(/^<([\w-:.]+)\s*/);if(!f)return;let h={name:f[1],attributes:{},children:[]};for(;!(l()||c(">")||c("?>")||c("/>"));){let m=o();if(!m)return h;h.attributes[m.name]=m.value}if(u(/^\s*\/>\s*/))return h;u(/\??>\s*/),h.content=i();let d;for(;d=n();)h.children.push(d);return u(/^<\/[\w-:.]+>\s*/),h}function i(){let f=u(/^([^<]*)/);return f?a(f[1]):""}function o(){let f=u(/([\w:-]+)\s*=\s*("[^"]*"|'[^']*'|\w+)\s*/);if(f)return{name:f[1],value:a(s(f[2]))}}function s(f){return f.replace(/^['"]|['"]$/g,"")}function a(f){return f.replaceAll("&lt;","<").replaceAll("&gt;",">").replaceAll("&amp;","&")}function u(f){let h=t.match(f);if(h)return t=t.slice(h[0].length),h}function l(){return t.length==0}function c(f){return t.indexOf(f)==0}}var on=class extends Error{constructor(e){super(e)}};var Er=class extends on{},Rh=class extends on{},$h=class extends on{},$n=class extends on{},xo=class extends on{},Pl=class extends on{},Rl=class extends on{},In=class extends on{statusCode;code;key;bucketName;resource;region;constructor(e,r,n,i={}){super(n),this.statusCode=e,this.code=r,this.key=i.key,this.bucketName=i.bucketName,this.resource=i.resource,this.region=i.region}};async function M6(t){try{let r=hi(await t.text()).root;if(r?.name!=="Error")throw new Error("Invalid root, expected <Error>");let n=r.children.find(l=>l.name==="Code")?.content??"UnknownErrorCode",i=r.children.find(l=>l.name==="Message")?.content??"The error message could not be determined.",o=r.children.find(l=>l.name==="Key")?.content,s=r.children.find(l=>l.name==="BucketName")?.content,a=r.children.find(l=>l.name==="Resource")?.content,u=r.children.find(l=>l.name==="Region")?.content;return new In(t.status,n,i,{key:o,bucketName:s,resource:a,region:u})}catch{return new In(t.status,"UnrecognizedError",`Error: Unexpected response code ${t.status} ${t.statusText}. Unable to parse response as XML.`)}}function U6(t){return typeof t!="number"||isNaN(t)||t<=0?!1:t>=1&&t<=65535}function H6(t){return typeof t!="string"||t.length<3||t.length>63||t.indexOf("..")>-1||t.match(/[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+/)?!1:!!t.match(/^[a-z0-9][a-z0-9.-]+[a-z0-9]$/)}function Fo(t){return!(!Xie(t)||t.length===0)}function Xie(t){return!(typeof t!="string"||t.length>1024)}function Ih(t){return Array.from(t).map(e=>e.toString(16).padStart(2,"0")).join("")}function Oo(t=""){let e={'"':"","&quot;":"","&#34;":"","&QUOT;":"","&#x00022":""};return t.replace(/^("|&quot;|&#34;)|("|&quot;|&#34;)$/g,r=>e[r])}function sb(t){return t.get("x-amz-version-id")??null}function $l(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 ab(t){t=t||new Date;let e=t.toISOString();return e.substr(0,4)+e.substr(5,2)+e.substr(8,2)}function ub(t,e){return`${ab(e)}/${t}/s3/aws4_request`}async function jh(t){return t instanceof Uint8Array||(t=new TextEncoder().encode(t)),Ih(new Uint8Array(await crypto.subtle.digest("SHA-256",t)))}var Zie=["x-amz-server-side-encryption-customer-algorithm","x-amz-server-side-encryption-customer-key","x-amz-server-side-encryption-customer-key-MD5"],Nh=class extends WritableStream{getResult;constructor({client:e,bucketName:r,objectName:n,partSize:i,metadata:o}){let s,a=1,u,l=[],c=[];super({start(){},async write(f,h){let d="PUT",m=a++;try{if(m==1&&f.length<i){let E=await e.makeRequest({method:d,headers:new Headers({...o,"Content-Length":String(f.length)}),bucketName:r,objectName:n,payload:f});s={etag:Oo(E.headers.get("etag")??void 0),versionId:sb(E.headers)};return}m===1&&(u=(await Qie({client:e,bucketName:r,objectName:n,metadata:o})).uploadId);let b={"Content-Length":String(f.length)};for(let E of Zie){let F=o[E];F&&(b[E]=F)}let y=e.makeRequest({method:d,query:{partNumber:m.toString(),uploadId:u},headers:new Headers(b),bucketName:r,objectName:n,payload:f});y.then(E=>{let F=E.headers.get("etag")??"";F&&(F=F.replace(/^"/,"").replace(/"$/,"")),l.push({part:m,etag:F})}),c.push(y)}catch(b){throw b}},async close(){if(!s)if(u)await Promise.all(c),l.sort((f,h)=>f.part>h.part?1:-1),s=await eoe({client:e,bucketName:r,objectName:n,uploadId:u,etags:l});else throw new Error("Stream was closed without uploading any data.")}}),this.getResult=()=>{if(s===void 0)throw new Error("Result is not ready. await the stream first.");return s}}};async function Qie(t){let e="POST",r=new Headers(t.metadata),o=await(await t.client.makeRequest({method:e,bucketName:t.bucketName,objectName:t.objectName,query:"uploads",headers:r,returnBody:!0})).text(),s=hi(o).root;if(!s||s.name!=="InitiateMultipartUploadResult")throw new Error(`Unexpected response: ${o}`);let a=s.children.find(u=>u.name==="UploadId")?.content;if(!a)throw new Error(`Unable to get UploadId from response: ${o}`);return{uploadId:a}}async function eoe({client:t,bucketName:e,objectName:r,uploadId:n,etags:i}){let o=`
297
297
  <CompleteMultipartUpload xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
298
298
  ${i.map(f=>` <Part><PartNumber>${f.part}</PartNumber><ETag>${f.etag}</ETag></Part>`).join(`
299
299
  `)}
@@ -302,19 +302,19 @@ ${Q(n)}`),k.error("")),r))}function D6(t,e){return t.from("channels").insert(e).
302
302
  `)+`
303
303
  `),u.push(n.join(";").toLowerCase()),u.push(i),u.join(`
304
304
  `)}async function K6(t,e,r){let n=await jh(t),i=ub(r,e),o=[];return o.push(lb),o.push($l(e)),o.push(i),o.push(n),o.join(`
305
- `)}async function Y6(t,e,r){let n=ab(t),i=await Ea("AWS4"+r,n),o=await Ea(i,e),s=await Ea(o,"s3");return await Ea(s,"aws4_request")}function J6(t,e,r){return`${t}/${ub(e,r)}`}async function Ea(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 noe=["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"],ioe=5*1024*1024,ooe=5*1024*1024*1024,cb=5*1024*1024*1024*1024,Il=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 Rh(`Invalid endPoint : ${e.endPoint}`);if(e.port!==void 0&&!U6(e.port))throw new Er(`Invalid port : ${e.port}`);if(e.accessKey&&!e.secretKey)throw new Er("If specifying access key, secret key must also be provided.");if(e.accessKey&&e.accessKey.startsWith("ASIA")&&!e.sessionToken)throw new Er("If specifying temporary access key, session token must also be provided.");let r=e.useSSL?443:80;this.port=e.port??r,this.host=e.endPoint.toLowerCase()+(this.port!==r?`:${e.port}`:""),this.protocol=e.useSSL?"https:":"http:",this.accessKey=e.accessKey,this.#e=e.secretKey??"",this.sessionToken=e.sessionToken,this.pathStyle=e.pathStyle??!0,this.defaultBucket=e.bucket,this.region=e.region}getBucketName(e){let r=e?.bucketName??this.defaultBucket;if(r===void 0||!H6(r))throw new $h(`Invalid bucket name: ${r}`);return r}buildRequestOptions(e){let r=this.getBucketName(e),n=this.pathStyle?this.host:`${r}.${this.host}`,i=e.headers??new Headers;i.set("host",n);let o=typeof e.query=="object"?new URLSearchParams(e.query).toString().replace("+","%20"):e.query,s=(this.pathStyle?`/${r}/${e.objectName}`:`/${e.objectName}`)+(o?`?${o}`:"");return{headers:i,host:n,path:s}}async makeRequest({method:e,payload:r,...n}){let i=new Date,{headers:o,host:s,path:a}=this.buildRequestOptions(n),u=n.statusCode??200;if(e==="POST"||e==="PUT"||e==="DELETE")r===void 0?r=new Uint8Array:typeof r=="string"&&(r=new TextEncoder().encode(r)),o.set("Content-Length",String(r.length));else if(r)throw new Error(`Unexpected payload on ${e} request.`);let l=await jh(r??new Uint8Array);o.set("x-amz-date",$l(i)),o.set("x-amz-content-sha256",l),this.accessKey&&(this.sessionToken&&o.set("x-amz-security-token",this.sessionToken),o.set("authorization",await V6({headers:o,method:e,path:a,accessKey:this.accessKey,secretKey:this.#e,region:this.region,date:i})));let c=`${this.protocol}//${s}${a}`,f=await fetch(c,{method:e,headers:o,body:r});if(f.status!==u)throw f.status>=400?await M6(f):f.status===301?new In(f.status,"UnexpectedRedirect",'The server unexpectedly returned a redirect response. With AWS S3, this usually means you need to use a region-specific endpoint like "s3.us-west-2.amazonaws.com" instead of "s3.amazonaws.com"'):new In(f.status,"UnexpectedStatusCode",`Unexpected response code from the server (expected ${u}, got ${f.status} ${f.statusText}).`);return n.returnBody||await f.body?.getReader().read(),f}async deleteObject(e,r={}){let n=this.getBucketName(r);if(!Fo(e))throw new $n(`Invalid object name: ${e}`);let i=r.versionId?{versionId:r.versionId}:{},o=new Headers;r.governanceBypass&&o.set("X-Amz-Bypass-Governance-Retention","true"),await this.makeRequest({method:"DELETE",bucketName:n,objectName:e,headers:o,query:i,statusCode:204})}async exists(e,r){try{return await this.statObject(e,r),!0}catch(n){if(n instanceof In&&n.statusCode===404)return!1;throw n}}getObject(e,r){return this.getPartialObject(e,{...r,offset:0,length:0})}async getPartialObject(e,{offset:r,length:n,...i}){let o=this.getBucketName(i);if(!Fo(e))throw new $n(`Invalid object name: ${e}`);let s=new Headers(Object.entries(i.metadata??{})),a=200;if(r||n){let l="";r?l=`bytes=${+r}-`:(l="bytes=0-",r=0),n&&(l+=`${+n+r-1}`),s.set("Range",l),a=206}let u={...i.responseParams,...i.versionId?{versionId:i.versionId}:{}};return await this.makeRequest({method:"GET",bucketName:o,objectName:e,headers:s,query:u,statusCode:a,returnBody:!0})}getPresignedUrl(e,r,n={}){if(!this.accessKey)throw new xo(`Presigned ${e} URLs cannot be generated for anonymous requests. Specify an accessKey and secretKey.`);if(!Fo(r))throw new $n(`Invalid object name: ${r}`);let{headers:i,path:o}=this.buildRequestOptions({objectName:r,bucketName:n.bucketName,query:n.parameters}),s=n.requestDate??new Date,a=n.expirySeconds??24*60*60*7;return z6({protocol:this.protocol,headers:i,method:e,path:o,accessKey:this.accessKey,secretKey:this.#e,region:this.region,date:s,expirySeconds:a})}presignedGetObject(e,r={}){let{versionId:n,responseParams:i,...o}=r,s={...i,...n?{versionId:n}:{}};return this.getPresignedUrl("GET",e,{parameters:s,...o})}async*listObjects(e={}){for await(let r of this.listObjectsGrouped({...e,delimiter:""}))if(r.type==="Object")yield r;else throw new Error(`Unexpected result from listObjectsGrouped(): ${r}`)}async*listObjectsGrouped(e){let r=this.getBucketName(e),n="",i=e.pageSize??1e3;if(i<1||i>1e3)throw new Er("pageSize must be between 1 and 1,000.");let o=0;for(;;){let s=e.maxResults?Math.min(i,e.maxResults-o):i;if(s===0)return;let u=await(await this.makeRequest({method:"GET",bucketName:r,objectName:"",query:{"list-type":"2",prefix:e.prefix??"",delimiter:e.delimiter,"max-keys":String(s),...n?{"continuation-token":n}:{}},returnBody:!0})).text(),l=hi(u).root;if(!l||l.name!=="ListBucketResult")throw new Error(`Unexpected response: ${u}`);let c=l.children.filter(d=>d.name==="CommonPrefixes").flatMap(d=>d.children),f=[];for(let d of c)f.push({type:"CommonPrefix",prefix:d.content??""}),o++;for(let d of l.children.filter(m=>m.name==="Contents"))f.push({type:"Object",key:d.children.find(m=>m.name==="Key")?.content??"",etag:Oo(d.children.find(m=>m.name==="ETag")?.content??""),size:parseInt(d.children.find(m=>m.name==="Size")?.content??"",10),lastModified:new Date(d.children.find(m=>m.name==="LastModified")?.content??"invalid")}),o++;f.sort((d,m)=>{let b=d.type==="Object"?d.key:d.prefix,D=m.type==="Object"?m.key:m.prefix;return b>D?1:b<D?-1:0});for(let d of f)yield d;if(l.children.find(d=>d.name==="IsTruncated")?.content==="true"){let d=l.children.find(m=>m.name==="NextContinuationToken")?.content;if(!d)throw new Error("Unexpectedly missing continuation token, but server said there are more results.");n=d}else return}}async putObject(e,r,n){let i=this.getBucketName(n);if(!Fo(e))throw new $n(`Invalid object name: ${e}`);let o,s;if(typeof r=="string"){let c=new TextEncoder().encode(r);typeof ReadableStream.from<"u"?s=ReadableStream.from([c]):s=new ReadableStream({start(f){f.enqueue(c),f.close()}}),o=c.length}else if(r instanceof Uint8Array)typeof ReadableStream.from<"u"?s=ReadableStream.from([r]):s=new ReadableStream({start(c){c.enqueue(r),c.close()}}),o=r.byteLength;else if(r instanceof ReadableStream)s=r;else throw new Er("Invalid stream/data type provided.");if(n?.size!==void 0){if(o!==void 0&&n?.size!==o)throw new Er(`size was specified (${n.size}) but doesn't match auto-detected size (${o}).`);if(typeof n.size!="number"||n.size<0||isNaN(n.size))throw new Er(`invalid size specified: ${n.size}`);o=n.size}let a=n?.partSize??this.calculatePartSize(o);if(a<ioe)throw new Er("Part size should be greater than 5MB");if(a>ooe)throw new Er("Part size should be less than 6MB");let u=new Ph(a),l=new Nh({client:this,bucketName:i,objectName:e,partSize:a,metadata:n?.metadata??{}});return await s.pipeThrough(u).pipeTo(l),l.getResult()}calculatePartSize(e){if(e===void 0&&(e=cb),e>cb)throw new TypeError(`size should not be more than ${cb}`);let r=64*1024*1024;for(;;){if(r*1e4>e)return r;r+=16*1024*1024}}async statObject(e,r){let n=this.getBucketName(r);if(!Fo(e))throw new $n(`Invalid object name: ${e}`);let i={};r?.versionId&&(i.versionId=r.versionId);let o=await this.makeRequest({method:"HEAD",bucketName:n,objectName:e,query:i}),s={};for(let a of noe)o.headers.has(a)&&(s[a]=o.headers.get(a));return o.headers.forEach((a,u)=>{u.startsWith("x-amz-meta-")&&(s[u]=o.headers.get(u))}),{type:"Object",key:e,size:parseInt(o.headers.get("content-length")??"",10),metadata:s,lastModified:new Date(o.headers.get("Last-Modified")??"error: missing last modified"),versionId:o.headers.get("x-amz-version-id")||null,etag:Oo(o.headers.get("ETag")??"")}}async copyObject(e,r,n){let i=this.getBucketName(n),o=e.sourceBucketName??i;if(!Fo(r))throw new $n(`Invalid object name: ${r}`);let s=`${o}/${e.sourceKey}`;e.sourceVersionId&&(s+=`?versionId=${e.sourceVersionId}`);let a=new Headers(n?.metadata);n?.metadata!==void 0&&a.set("x-amz-metadata-directive","REPLACE"),a.set("x-amz-copy-source",s);let u=await this.makeRequest({method:"PUT",bucketName:i,objectName:r,headers:a,returnBody:!0}),l=await u.text(),c=hi(l).root;if(!c||c.name!=="CopyObjectResult")throw new Error(`Unexpected response: ${l}`);let f=c.children.find(d=>d.name==="ETag")?.content??"",h=c.children.find(d=>d.name==="LastModified")?.content;if(h===void 0)throw new Error("Unable to find <LastModified>...</LastModified> from the server.");return{copySourceVersionId:u.headers.get("x-amz-copy-source-version-id")||null,etag:Oo(f),lastModified:new Date(h),versionId:u.headers.get("x-amz-version-id")||null}}async bucketExists(e){try{return await this.listObjects({bucketName:e}).next(),!0}catch(r){if(r instanceof In&&r.statusCode===404)return!1;throw r}}async makeBucket(e){await this.makeRequest({method:"PUT",bucketName:this.getBucketName({bucketName:e}),objectName:"",statusCode:200})}async removeBucket(e){await this.makeRequest({method:"DELETE",bucketName:this.getBucketName({bucketName:e}),objectName:"",statusCode:204})}};var pb=ue(fu());var ko=require("node:fs"),Lh=require("node:path");function soe(t,e){return(0,ko.readFileSync)(t,"utf8").includes(e)}function jl(t,e){let r=(0,ko.readdirSync)(t);for(let n of r){let i=(0,Lh.join)(t,n),o=(0,ko.statSync)(i);if(o.isDirectory()){if(jl(i,e))return!0}else if(o.isFile()&&(0,Lh.extname)(i)===".js"&&soe(i,e))return!0}return!1}function Bh(t){return(0,ko.readdirSync)(t).indexOf("index.html")>-1}var fb=require("node:buffer"),qh=require("node:fs"),X6=require("node:os"),To=require("node:path"),Z6=require("node:stream"),db=require("node:stream/consumers"),Q6=require("node:zlib");var e8=ue(ky());var hb=class extends Z6.Transform{isFirstChunk=!0;_transform(e,r,n){this.isFirstChunk&&(this.push(fb.Buffer.from([139,0,128])),this.isFirstChunk=!1),this.push(e),n()}_flush(e){this.push(fb.Buffer.from([3])),e()}};async function t8(t,e,r,n,i,o){let s=_e();s.start(i!=="v2"?"Generating the update manifest":"Generating the update manifest with v2 encryption");let a=await mI(t);return i==="v2"&&a.forEach(u=>{u.hash=_a(u.hash,o)}),s.stop("Manifest generated successfully"),await Oe(e,{channel:"partial-update",event:"Generate manifest",icon:"\u{1F4C2}",user_id:r,tags:{"app-id":n},notify:!1}),a}function aoe(t){return(0,X6.platform)()!=="win32"?t:To.win32.normalize(t).split(To.win32.sep).join(To.posix.sep)}async function r8(t,e,r,n,i,o,s,a){let u=_e();u.start("Preparing partial update with TUS protocol");let l=performance.now(),c=await br(),f=0,h=e.length,d=e.map(async m=>{let b=(0,To.join)(r,m.file),D=aoe(m.file),F=(await(0,db.buffer)((0,qh.createReadStream)(b))).length<16?(0,qh.createReadStream)(b).pipe(new hb):(0,qh.createReadStream)(b).pipe((0,Q6.createBrotliCompress)()),g=await(0,db.buffer)(F),C=g;return s&&(C=wa(g,s.sessionKey,s.ivSessionKey)),new Promise((A,T)=>{new e8.Upload(C,{endpoint:`${c.hostFilesApi}/files/upload/attachments/`,chunkSize:a,metadata:{filename:`orgs/${o}/apps/${n}/${i}/${D}`},headers:{Authorization:t},onError(L){p.info(`Failed to upload ${D}: ${L}`),T(L)},onProgress(){let L=(f/h*100).toFixed(2);u.message(`Uploading partial update: ${L}%`)},onSuccess(){f++,A({file_name:D,s3_path:`orgs/${o}/apps/${n}/${i}/${D}`,file_hash:m.hash})}}).start()})});try{let m=await Promise.all(d),D=((performance.now()-l)/1e3).toFixed(2);return u.stop(`Partial update uploaded successfully \u{1F4AA} in (${D} seconds)`),await Oe(t,{channel:"app",event:"App Partial TUS done",icon:"\u23EB",user_id:o,tags:{"app-id":n},notify:!1}),await Oe(t,{channel:"performance",event:"Partial upload performance",icon:"\u{1F684}",user_id:o,tags:{"app-id":n,time:D},notify:!1}),m}catch(m){let D=((performance.now()-l)/1e3).toFixed(2);return u.stop(`Failed to upload Partial bundle ( after ${D} seconds)`),p.info(`Error uploading partial update: ${m}, This is not a critical error, the bundle has been uploaded without the partial files`),null}}async function uoe(t,e){let r=await vr("",e.packageJson),n=e.bundle||t?.plugins?.CapacitorUpdater?.version||r?.version||`0.0.1-beta.${(0,n8.randomUUID)().split("-")[0]}`;return ia.test(n)||(p.error(`Your bundle name ${n}, is not valid it should follow semver convention : https://semver.org/`),k.error("")),n}function loe(t){let e=t.apikey||de();return e||(p.error("Missing API key, you need to provide a API key to upload your bundle"),k.error("")),e}function coe(t,e,r){let n=pe(t,r),i=e.path||r?.webDir;return n||(p.error("Missing argument, you need to provide a appid or be in a capacitor project"),k.error("")),i||(p.error("Missing argument, you need to provide a path (--path), or be in a capacitor project"),k.error("")),(0,Po.existsSync)(i)||(p.error(`Path ${i} does not exist, build your app first, or provide a valid path`),k.error("")),{appid:n,path:i}}function foe(t,e){let r=t.codeCheck;(typeof r>"u"||r)&&(jl(e,"notifyAppReady")||(p.error("notifyAppReady() is missing in the build folder of your app. see: https://capgo.app/docs/plugin/api/#notifyappready"),k.error("")),Bh(e)||(p.error(`index.html is missing in the root folder of ${e}`),k.error("")))}async function doe(t,e,r,n,i,o){let s=r.ignoreMetadataCheck,a=r.autoMinUpdateVersion,u=r.minUpdateVersion,{data:l,error:c}=await t.from("channels").select("disable_auto_update, version ( min_update_version, native_packages )").eq("name",n).eq("app_id",i).single(),f=!!l&&l.disable_auto_update==="version_number",h,d;if(!c&&l&&l.version&&l.version.native_packages&&!s){let D=_e();D.start(`Checking bundle compatibility with channel ${n}`);let{finalCompatibility:_,localDependencies:F}=await fh(t,i,n,r.packageJson,r.nodeModules);if(d=_,h=F,d.find(g=>g.localVersion!==g.remoteVersion))D.stop(`Bundle NOT compatible with ${n} channel`),p.warn(`You can check compatibility with "${e.runner} @capgo/cli bundle compatibility"`),a&&(u=o,p.info(`Auto set min-update-version to ${u}`));else if(a)try{let{min_update_version:g}=l.version;(!g||!ia.test(g))&&(p.error("Invalid remote min update version, skipping auto setting compatibility"),k.error("")),u=g,D.stop(`Auto set min-update-version to ${u}`)}catch{p.error(`Cannot auto set compatibility, invalid data ${l}`),k.error("")}else D.stop(`Bundle compatible with ${n} channel`)}else s||(p.warn(`Channel ${n} is new or it's your first upload with compatibility check, it will be ignored this time`),h=await _v(r.packageJson,r.nodeModules),a&&(u=o,p.info(`Auto set min-update-version to ${u}`)));f&&!u&&!s&&(p.error("You need to provide a min-update-version to upload a bundle to this channel"),k.error("")),u&&(ia.test(u)||(p.error(`Your minimal version update ${u}, is not valid it should follow semver convention : https://semver.org/`),k.error("")));let m=h?new Map(h.filter(D=>!!D.native&&D.native!==void 0).map(D=>[D.name,D])):new Map;return{nativePackages:m.size>0||!r.ignoreMetadataCheck?Array.from(m,([D,_])=>({name:D,version:_.version})):void 0,minUpdateVersion:u}}async function hoe(t,e,r){let{data:n,error:i}=await t.rpc("is_trial_org",{orgid:e}).single();(n&&n>0||i)&&(p.warn(`WARNING !!
306
- Trial expires in ${n} days`),p.warn(`Upgrade here: ${r.hostWeb}/dashboard/settings/plans?oid=${e}`))}async function poe(t,e,r){let{data:n,error:i}=await t.rpc("exist_app_versions",{appid:e,apikey:"",name_version:r}).single();(n||i)&&(p.error(`Version ${r} already exists ${Q(i)}`),k.error(""))}async function moe(t,e,r,n,i,o,s){let a,u,l="",c=null,f="none",h="",d=e.keyV2;c=await lh(t);let m=_e();m.start("Calculating checksum");let b=(0,i8.join)(On((0,Mh.cwd)()),"package.json"),_=(await kr(void 0,b)).get("@capgo/capacitor-updater");_=_?.replace("^","").replace("~","");let F=!1;if(_?F=m6(Xt(_),Xt("7.0.0")):(p.warn("Cannot find @capgo/capacitor-updater in your package.json, assuming it is v7"),F=!0),(d||e.keyDataV2||(0,Po.existsSync)(or))&&d!==!1||F?l=await(0,pb.checksum)(c,"sha256"):l=await(0,pb.checksum)(c,"crc32"),m.stop(`Checksum: ${l}`),d===!1)p.info("Encryption ignored");else if((d||(0,Po.existsSync)(or)||e.keyDataV2)&&!e.oldEncryption){let A=typeof d=="string"?d:or,T=e.keyDataV2||"";!T&&!(0,Po.existsSync)(A)&&(p.error(`Cannot find private key ${A}`),k.error("")),await Oe(r,{channel:"app",event:"App encryption v2",icon:"\u{1F511}",user_id:n,tags:{"app-id":i},notify:!1}),T||(T=(0,Po.readFileSync)(A).toString()),p.info("Encrypting your bundle with V2");let{sessionKey:x,ivSessionKey:L}=Th(T),S=wa(c,x,L);l=_a(l,T),a=L,u=x,f="v2",h=T,e.displayIvSession&&p.info(`Your Iv Session key is ${a},
305
+ `)}async function Y6(t,e,r){let n=ab(t),i=await Ea("AWS4"+r,n),o=await Ea(i,e),s=await Ea(o,"s3");return await Ea(s,"aws4_request")}function J6(t,e,r){return`${t}/${ub(e,r)}`}async function Ea(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 noe=["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"],ioe=5*1024*1024,ooe=5*1024*1024*1024,cb=5*1024*1024*1024*1024,Il=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 Rh(`Invalid endPoint : ${e.endPoint}`);if(e.port!==void 0&&!U6(e.port))throw new Er(`Invalid port : ${e.port}`);if(e.accessKey&&!e.secretKey)throw new Er("If specifying access key, secret key must also be provided.");if(e.accessKey&&e.accessKey.startsWith("ASIA")&&!e.sessionToken)throw new Er("If specifying temporary access key, session token must also be provided.");let r=e.useSSL?443:80;this.port=e.port??r,this.host=e.endPoint.toLowerCase()+(this.port!==r?`:${e.port}`:""),this.protocol=e.useSSL?"https:":"http:",this.accessKey=e.accessKey,this.#e=e.secretKey??"",this.sessionToken=e.sessionToken,this.pathStyle=e.pathStyle??!0,this.defaultBucket=e.bucket,this.region=e.region}getBucketName(e){let r=e?.bucketName??this.defaultBucket;if(r===void 0||!H6(r))throw new $h(`Invalid bucket name: ${r}`);return r}buildRequestOptions(e){let r=this.getBucketName(e),n=this.pathStyle?this.host:`${r}.${this.host}`,i=e.headers??new Headers;i.set("host",n);let o=typeof e.query=="object"?new URLSearchParams(e.query).toString().replace("+","%20"):e.query,s=(this.pathStyle?`/${r}/${e.objectName}`:`/${e.objectName}`)+(o?`?${o}`:"");return{headers:i,host:n,path:s}}async makeRequest({method:e,payload:r,...n}){let i=new Date,{headers:o,host:s,path:a}=this.buildRequestOptions(n),u=n.statusCode??200;if(e==="POST"||e==="PUT"||e==="DELETE")r===void 0?r=new Uint8Array:typeof r=="string"&&(r=new TextEncoder().encode(r)),o.set("Content-Length",String(r.length));else if(r)throw new Error(`Unexpected payload on ${e} request.`);let l=await jh(r??new Uint8Array);o.set("x-amz-date",$l(i)),o.set("x-amz-content-sha256",l),this.accessKey&&(this.sessionToken&&o.set("x-amz-security-token",this.sessionToken),o.set("authorization",await V6({headers:o,method:e,path:a,accessKey:this.accessKey,secretKey:this.#e,region:this.region,date:i})));let c=`${this.protocol}//${s}${a}`,f=await fetch(c,{method:e,headers:o,body:r});if(f.status!==u)throw f.status>=400?await M6(f):f.status===301?new In(f.status,"UnexpectedRedirect",'The server unexpectedly returned a redirect response. With AWS S3, this usually means you need to use a region-specific endpoint like "s3.us-west-2.amazonaws.com" instead of "s3.amazonaws.com"'):new In(f.status,"UnexpectedStatusCode",`Unexpected response code from the server (expected ${u}, got ${f.status} ${f.statusText}).`);return n.returnBody||await f.body?.getReader().read(),f}async deleteObject(e,r={}){let n=this.getBucketName(r);if(!Fo(e))throw new $n(`Invalid object name: ${e}`);let i=r.versionId?{versionId:r.versionId}:{},o=new Headers;r.governanceBypass&&o.set("X-Amz-Bypass-Governance-Retention","true"),await this.makeRequest({method:"DELETE",bucketName:n,objectName:e,headers:o,query:i,statusCode:204})}async exists(e,r){try{return await this.statObject(e,r),!0}catch(n){if(n instanceof In&&n.statusCode===404)return!1;throw n}}getObject(e,r){return this.getPartialObject(e,{...r,offset:0,length:0})}async getPartialObject(e,{offset:r,length:n,...i}){let o=this.getBucketName(i);if(!Fo(e))throw new $n(`Invalid object name: ${e}`);let s=new Headers(Object.entries(i.metadata??{})),a=200;if(r||n){let l="";r?l=`bytes=${+r}-`:(l="bytes=0-",r=0),n&&(l+=`${+n+r-1}`),s.set("Range",l),a=206}let u={...i.responseParams,...i.versionId?{versionId:i.versionId}:{}};return await this.makeRequest({method:"GET",bucketName:o,objectName:e,headers:s,query:u,statusCode:a,returnBody:!0})}getPresignedUrl(e,r,n={}){if(!this.accessKey)throw new xo(`Presigned ${e} URLs cannot be generated for anonymous requests. Specify an accessKey and secretKey.`);if(!Fo(r))throw new $n(`Invalid object name: ${r}`);let{headers:i,path:o}=this.buildRequestOptions({objectName:r,bucketName:n.bucketName,query:n.parameters}),s=n.requestDate??new Date,a=n.expirySeconds??24*60*60*7;return z6({protocol:this.protocol,headers:i,method:e,path:o,accessKey:this.accessKey,secretKey:this.#e,region:this.region,date:s,expirySeconds:a})}presignedGetObject(e,r={}){let{versionId:n,responseParams:i,...o}=r,s={...i,...n?{versionId:n}:{}};return this.getPresignedUrl("GET",e,{parameters:s,...o})}async*listObjects(e={}){for await(let r of this.listObjectsGrouped({...e,delimiter:""}))if(r.type==="Object")yield r;else throw new Error(`Unexpected result from listObjectsGrouped(): ${r}`)}async*listObjectsGrouped(e){let r=this.getBucketName(e),n="",i=e.pageSize??1e3;if(i<1||i>1e3)throw new Er("pageSize must be between 1 and 1,000.");let o=0;for(;;){let s=e.maxResults?Math.min(i,e.maxResults-o):i;if(s===0)return;let u=await(await this.makeRequest({method:"GET",bucketName:r,objectName:"",query:{"list-type":"2",prefix:e.prefix??"",delimiter:e.delimiter,"max-keys":String(s),...n?{"continuation-token":n}:{}},returnBody:!0})).text(),l=hi(u).root;if(!l||l.name!=="ListBucketResult")throw new Error(`Unexpected response: ${u}`);let c=l.children.filter(d=>d.name==="CommonPrefixes").flatMap(d=>d.children),f=[];for(let d of c)f.push({type:"CommonPrefix",prefix:d.content??""}),o++;for(let d of l.children.filter(m=>m.name==="Contents"))f.push({type:"Object",key:d.children.find(m=>m.name==="Key")?.content??"",etag:Oo(d.children.find(m=>m.name==="ETag")?.content??""),size:parseInt(d.children.find(m=>m.name==="Size")?.content??"",10),lastModified:new Date(d.children.find(m=>m.name==="LastModified")?.content??"invalid")}),o++;f.sort((d,m)=>{let b=d.type==="Object"?d.key:d.prefix,y=m.type==="Object"?m.key:m.prefix;return b>y?1:b<y?-1:0});for(let d of f)yield d;if(l.children.find(d=>d.name==="IsTruncated")?.content==="true"){let d=l.children.find(m=>m.name==="NextContinuationToken")?.content;if(!d)throw new Error("Unexpectedly missing continuation token, but server said there are more results.");n=d}else return}}async putObject(e,r,n){let i=this.getBucketName(n);if(!Fo(e))throw new $n(`Invalid object name: ${e}`);let o,s;if(typeof r=="string"){let c=new TextEncoder().encode(r);typeof ReadableStream.from<"u"?s=ReadableStream.from([c]):s=new ReadableStream({start(f){f.enqueue(c),f.close()}}),o=c.length}else if(r instanceof Uint8Array)typeof ReadableStream.from<"u"?s=ReadableStream.from([r]):s=new ReadableStream({start(c){c.enqueue(r),c.close()}}),o=r.byteLength;else if(r instanceof ReadableStream)s=r;else throw new Er("Invalid stream/data type provided.");if(n?.size!==void 0){if(o!==void 0&&n?.size!==o)throw new Er(`size was specified (${n.size}) but doesn't match auto-detected size (${o}).`);if(typeof n.size!="number"||n.size<0||isNaN(n.size))throw new Er(`invalid size specified: ${n.size}`);o=n.size}let a=n?.partSize??this.calculatePartSize(o);if(a<ioe)throw new Er("Part size should be greater than 5MB");if(a>ooe)throw new Er("Part size should be less than 6MB");let u=new Ph(a),l=new Nh({client:this,bucketName:i,objectName:e,partSize:a,metadata:n?.metadata??{}});return await s.pipeThrough(u).pipeTo(l),l.getResult()}calculatePartSize(e){if(e===void 0&&(e=cb),e>cb)throw new TypeError(`size should not be more than ${cb}`);let r=64*1024*1024;for(;;){if(r*1e4>e)return r;r+=16*1024*1024}}async statObject(e,r){let n=this.getBucketName(r);if(!Fo(e))throw new $n(`Invalid object name: ${e}`);let i={};r?.versionId&&(i.versionId=r.versionId);let o=await this.makeRequest({method:"HEAD",bucketName:n,objectName:e,query:i}),s={};for(let a of noe)o.headers.has(a)&&(s[a]=o.headers.get(a));return o.headers.forEach((a,u)=>{u.startsWith("x-amz-meta-")&&(s[u]=o.headers.get(u))}),{type:"Object",key:e,size:parseInt(o.headers.get("content-length")??"",10),metadata:s,lastModified:new Date(o.headers.get("Last-Modified")??"error: missing last modified"),versionId:o.headers.get("x-amz-version-id")||null,etag:Oo(o.headers.get("ETag")??"")}}async copyObject(e,r,n){let i=this.getBucketName(n),o=e.sourceBucketName??i;if(!Fo(r))throw new $n(`Invalid object name: ${r}`);let s=`${o}/${e.sourceKey}`;e.sourceVersionId&&(s+=`?versionId=${e.sourceVersionId}`);let a=new Headers(n?.metadata);n?.metadata!==void 0&&a.set("x-amz-metadata-directive","REPLACE"),a.set("x-amz-copy-source",s);let u=await this.makeRequest({method:"PUT",bucketName:i,objectName:r,headers:a,returnBody:!0}),l=await u.text(),c=hi(l).root;if(!c||c.name!=="CopyObjectResult")throw new Error(`Unexpected response: ${l}`);let f=c.children.find(d=>d.name==="ETag")?.content??"",h=c.children.find(d=>d.name==="LastModified")?.content;if(h===void 0)throw new Error("Unable to find <LastModified>...</LastModified> from the server.");return{copySourceVersionId:u.headers.get("x-amz-copy-source-version-id")||null,etag:Oo(f),lastModified:new Date(h),versionId:u.headers.get("x-amz-version-id")||null}}async bucketExists(e){try{return await this.listObjects({bucketName:e}).next(),!0}catch(r){if(r instanceof In&&r.statusCode===404)return!1;throw r}}async makeBucket(e){await this.makeRequest({method:"PUT",bucketName:this.getBucketName({bucketName:e}),objectName:"",statusCode:200})}async removeBucket(e){await this.makeRequest({method:"DELETE",bucketName:this.getBucketName({bucketName:e}),objectName:"",statusCode:204})}};var pb=ue(fu());var ko=require("node:fs"),Lh=require("node:path");function soe(t,e){return(0,ko.readFileSync)(t,"utf8").includes(e)}function jl(t,e){let r=(0,ko.readdirSync)(t);for(let n of r){let i=(0,Lh.join)(t,n),o=(0,ko.statSync)(i);if(o.isDirectory()){if(jl(i,e))return!0}else if(o.isFile()&&(0,Lh.extname)(i)===".js"&&soe(i,e))return!0}return!1}function Bh(t){return(0,ko.readdirSync)(t).indexOf("index.html")>-1}var fb=require("node:buffer"),qh=require("node:fs"),X6=require("node:os"),To=require("node:path"),Z6=require("node:stream"),db=require("node:stream/consumers"),Q6=require("node:zlib");var e8=ue(ky());var hb=class extends Z6.Transform{isFirstChunk=!0;_transform(e,r,n){this.isFirstChunk&&(this.push(fb.Buffer.from([139,0,128])),this.isFirstChunk=!1),this.push(e),n()}_flush(e){this.push(fb.Buffer.from([3])),e()}};async function t8(t,e,r,n,i,o){let s=_e();s.start(i!=="v2"?"Generating the update manifest":"Generating the update manifest with v2 encryption");let a=await mI(t);return i==="v2"&&a.forEach(u=>{u.hash=_a(u.hash,o)}),s.stop("Manifest generated successfully"),await Oe(e,{channel:"partial-update",event:"Generate manifest",icon:"\u{1F4C2}",user_id:r,tags:{"app-id":n},notify:!1}),a}function aoe(t){return(0,X6.platform)()!=="win32"?t:To.win32.normalize(t).split(To.win32.sep).join(To.posix.sep)}async function r8(t,e,r,n,i,o,s,a){let u=_e();u.start("Preparing partial update with TUS protocol");let l=performance.now(),c=await br(),f=0,h=e.length,d=e.map(async m=>{let b=(0,To.join)(r,m.file),y=aoe(m.file),F=(await(0,db.buffer)((0,qh.createReadStream)(b))).length<16?(0,qh.createReadStream)(b).pipe(new hb):(0,qh.createReadStream)(b).pipe((0,Q6.createBrotliCompress)()),g=await(0,db.buffer)(F),C=g;return s&&(C=wa(g,s.sessionKey,s.ivSessionKey)),new Promise((A,T)=>{new e8.Upload(C,{endpoint:`${c.hostFilesApi}/files/upload/attachments/`,chunkSize:a,metadata:{filename:`orgs/${o}/apps/${n}/${i}/${y}`},headers:{Authorization:t},onError(L){p.info(`Failed to upload ${y}: ${L}`),T(L)},onProgress(){let L=(f/h*100).toFixed(2);u.message(`Uploading partial update: ${L}%`)},onSuccess(){f++,A({file_name:y,s3_path:`orgs/${o}/apps/${n}/${i}/${y}`,file_hash:m.hash})}}).start()})});try{let m=await Promise.all(d),y=((performance.now()-l)/1e3).toFixed(2);return u.stop(`Partial update uploaded successfully \u{1F4AA} in (${y} seconds)`),await Oe(t,{channel:"app",event:"App Partial TUS done",icon:"\u23EB",user_id:o,tags:{"app-id":n},notify:!1}),await Oe(t,{channel:"performance",event:"Partial upload performance",icon:"\u{1F684}",user_id:o,tags:{"app-id":n,time:y},notify:!1}),m}catch(m){let y=((performance.now()-l)/1e3).toFixed(2);return u.stop(`Failed to upload Partial bundle ( after ${y} seconds)`),p.info(`Error uploading partial update: ${m}, This is not a critical error, the bundle has been uploaded without the partial files`),null}}async function uoe(t,e){let r=await vr("",e.packageJson),n=e.bundle||t?.plugins?.CapacitorUpdater?.version||r?.version||`0.0.1-beta.${(0,n8.randomUUID)().split("-")[0]}`;return ia.test(n)||(p.error(`Your bundle name ${n}, is not valid it should follow semver convention : https://semver.org/`),k.error("")),n}function loe(t){let e=t.apikey||de();return e||(p.error("Missing API key, you need to provide a API key to upload your bundle"),k.error("")),e}function coe(t,e,r){let n=pe(t,r),i=e.path||r?.webDir;return n||(p.error("Missing argument, you need to provide a appid or be in a capacitor project"),k.error("")),i||(p.error("Missing argument, you need to provide a path (--path), or be in a capacitor project"),k.error("")),(0,Po.existsSync)(i)||(p.error(`Path ${i} does not exist, build your app first, or provide a valid path`),k.error("")),{appid:n,path:i}}function foe(t,e){let r=t.codeCheck;(typeof r>"u"||r)&&(jl(e,"notifyAppReady")||(p.error("notifyAppReady() is missing in the build folder of your app. see: https://capgo.app/docs/plugin/api/#notifyappready"),k.error("")),Bh(e)||(p.error(`index.html is missing in the root folder of ${e}`),k.error("")))}async function doe(t,e,r,n,i,o){let s=r.ignoreMetadataCheck,a=r.autoMinUpdateVersion,u=r.minUpdateVersion,{data:l,error:c}=await t.from("channels").select("disable_auto_update, version ( min_update_version, native_packages )").eq("name",n).eq("app_id",i).single(),f=!!l&&l.disable_auto_update==="version_number",h,d;if(!c&&l&&l.version&&l.version.native_packages&&!s){let y=_e();y.start(`Checking bundle compatibility with channel ${n}`);let{finalCompatibility:E,localDependencies:F}=await fh(t,i,n,r.packageJson,r.nodeModules);if(d=E,h=F,d.find(g=>g.localVersion!==g.remoteVersion))y.stop(`Bundle NOT compatible with ${n} channel`),p.warn(`You can check compatibility with "${e.runner} @capgo/cli bundle compatibility"`),a&&(u=o,p.info(`Auto set min-update-version to ${u}`));else if(a)try{let{min_update_version:g}=l.version;(!g||!ia.test(g))&&(p.error("Invalid remote min update version, skipping auto setting compatibility"),k.error("")),u=g,y.stop(`Auto set min-update-version to ${u}`)}catch{p.error(`Cannot auto set compatibility, invalid data ${l}`),k.error("")}else y.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 _v(r.packageJson,r.nodeModules),a&&(u=o,p.info(`Auto set min-update-version to ${u}`)));f&&!u&&!s&&(p.error("You need to provide a min-update-version to upload a bundle to this channel"),k.error("")),u&&(ia.test(u)||(p.error(`Your minimal version update ${u}, is not valid it should follow semver convention : https://semver.org/`),k.error("")));let m=h?new Map(h.filter(y=>!!y.native&&y.native!==void 0).map(y=>[y.name,y])):new Map;return{nativePackages:m.size>0||!r.ignoreMetadataCheck?Array.from(m,([y,E])=>({name:y,version:E.version})):void 0,minUpdateVersion:u}}async function hoe(t,e,r){let{data:n,error:i}=await t.rpc("is_trial_org",{orgid:e}).single();(n&&n>0||i)&&(p.warn(`WARNING !!
306
+ Trial expires in ${n} days`),p.warn(`Upgrade here: ${r.hostWeb}/dashboard/settings/plans?oid=${e}`))}async function poe(t,e,r){let{data:n,error:i}=await t.rpc("exist_app_versions",{appid:e,apikey:"",name_version:r}).single();(n||i)&&(p.error(`Version ${r} already exists ${Q(i)}`),k.error(""))}async function moe(t,e,r,n,i,o,s){let a,u,l="",c=null,f="none",h="",d=e.keyV2,m=e.key===!1;c=await lh(t);let b=_e();b.start("Calculating checksum");let y=(0,i8.join)(On((0,Mh.cwd)()),"package.json"),F=(await kr(void 0,y)).get("@capgo/capacitor-updater");F=F?.replace("^","").replace("~","");let g=!1;if(F?g=m6(Xt(F),Xt("7.0.0")):(p.warn("Cannot find @capgo/capacitor-updater in your package.json, assuming it is v7"),g=!0),(d||e.keyDataV2||(0,Po.existsSync)(or))&&!m||g?l=await(0,pb.checksum)(c,"sha256"):l=await(0,pb.checksum)(c,"crc32"),b.stop(`Checksum: ${l}`),m===!1)p.info("Encryption ignored");else if((d||(0,Po.existsSync)(or)||e.keyDataV2)&&!e.oldEncryption){let T=typeof d=="string"?d:or,x=e.keyDataV2||"";!x&&!(0,Po.existsSync)(T)&&(p.error(`Cannot find private key ${T}`),k.error("")),await Oe(r,{channel:"app",event:"App encryption v2",icon:"\u{1F511}",user_id:n,tags:{"app-id":i},notify:!1}),x||(x=(0,Po.readFileSync)(T).toString()),p.info("Encrypting your bundle with V2");let{sessionKey:L,ivSessionKey:S}=Th(x),I=wa(c,L,S);l=_a(l,x),a=S,u=L,f="v2",h=x,e.displayIvSession&&p.info(`Your Iv Session key is ${a},
307
307
  keep it safe, you will need it to decrypt your bundle.
308
308
  It will be also visible in your dashboard
309
- `),c=S}let g=Math.floor((c?.byteLength??0)/1024/1024),C=Math.floor(o/1024/1024);return c?.byteLength>o?(p.error(`The bundle size is ${g} Mb, this is greater than the maximum upload length ${C} Mb, please reduce the size of your bundle`),k.error("")):c?.byteLength>s&&(p.warn(`WARNING !!
310
- The bundle size is ${g} Mb, this may take a while to download for users
309
+ `),c=I}let C=Math.floor((c?.byteLength??0)/1024/1024),A=Math.floor(o/1024/1024);return c?.byteLength>o?(p.error(`The bundle size is ${C} Mb, this is greater than the maximum upload length ${A} Mb, please reduce the size of your bundle`),k.error("")):c?.byteLength>s&&(p.warn(`WARNING !!
310
+ The bundle size is ${C} Mb, this may take a while to download for users
311
311
  `),p.info(`Learn how to optimize your assets https://capgo.app/blog/optimise-your-images-for-updates/
312
312
  `),await Oe(r,{channel:"app-error",event:"App Too Large",icon:"\u{1F69B}",user_id:n,tags:{"app-id":i},notify:!1})),{zipped:c,ivSessionKey:a,sessionKey:u,checksum:l,encryptionMethod:f,finalKeyData:h}}async function goe(t,e,r,n,i,o,s,a){let u=_e();u.start("Uploading Bundle");let l=performance.now(),c=!1;if(s.dryUpload){u.stop(`Dry run, bundle not uploaded
313
- Bundle uploaded \u{1F4AA} in 0 seconds`);return}try{let d=await br();if(s.multipart!==void 0&&s.multipart||s.tus!==void 0&&s.tus){s.multipart?p.info("Uploading bundle with multipart is deprecated, we upload with TUS instead"):p.info("Uploading bundle with TUS protocol"),await gI(t,o,i,r,n,u,d,a),c=!0;let m=`orgs/${i}/apps/${r}/${n}.zip`,{error:b}=await e.from("app_versions").update({r2_path:m}).eq("name",n).eq("app_id",r);if(b)return p.error(`Cannot finish TUS upload ${Q(b)}`),Promise.reject(new Error("Cannot finish TUS upload"))}else{let m=await hI(e,r,n);if(!m)return p.error("Cannot get upload url"),Promise.reject(new Error("Cannot get upload url"));await qr.put(m,{timeout:s.timeout||tI,retry:5,body:o})}}catch(d){let b=((performance.now()-l)/1e3).toFixed(2);if(u.stop(`Failed to upload bundle ( after ${b} seconds)`),d instanceof Wn){let D=await d.response.json();p.error(`Response Error: ${D.error||D.status||D.message}`)}else s.tus?p.error(`Cannot upload bundle please contact support if the issue persists ${Q(d)}`):p.error(`Cannot upload bundle ( try again with --tus option) ${Q(d)}`);await yI(e,r,n),k.error("")}let h=((performance.now()-l)/1e3).toFixed(2);u.stop(`Bundle uploaded \u{1F4AA} in (${h} seconds)`),await Oe(t,{channel:"performance",event:c?"TUS upload zip performance":"Upload zip performance",icon:"\u{1F684}",user_id:i,tags:{"app-id":r,time:h},notify:!1})}async function yoe(t,e,r){let{data:n,error:i}=await t.from("channels").select("version ( id, name, deleted )").eq("app_id",e).eq("name",r);if(i){p.error(`Cannot delete linked bundle on upload ${Q(i)}`);return}if(n.length===0){p.warn("No linked bundle found in the channel you are trying to upload to");return}let o=n[0].version;if(o.deleted){p.warn("The linked bundle is already deleted");return}let{error:s}=await t.from("app_versions").update({deleted:!0}).eq("id",o.id);if(s){p.error(`Cannot delete linked bundle on upload ${Q(s)}`);return}p.info("Linked bundle deleted")}async function Doe(t,e,r,n,i,o,s,a,u){let{data:l}=await t.rpc("get_app_versions",{apikey:e,name_version:n,appid:a}).single();l||(p.warn("Cannot get version id, cannot set channel"),k.error(""));let{data:c}=await t.rpc("is_allowed_capgkey",{apikey:e,keymode:["write","all"]}).single();if(c){let{error:f,data:h}=await ch(t,{name:i,app_id:a,created_by:o,version:l,owner_org:s});f&&(p.error(`Cannot set channel, the upload key is not allowed to do that, use the "all" for this. ${Q(f)}`),k.error(""));let d=mo(a),m=`${u.hostWeb}/app/p/${d}/channel/${h.id}`;h?.public?p.info("Your update is now available in your public channel \u{1F389}"):h?.id&&p.info(`Link device to this bundle to try it: ${m}`),r?p.info(`Bundle url: ${m}`):l||(p.warn("Cannot set bundle with upload key, use key with more rights for that"),k.error(""))}else p.warn("The upload key is not allowed to set the version in the channel")}async function voe(t,e,r){let{error:n,data:i}=await e.from("apps").select("default_upload_channel").single();if(n){p.warn("Cannot find default upload channel");let o=mo(t);return p.info(`You can set it here: ${r}/app/p/${o}/settings`),null}return i.default_upload_channel}async function mb(t,e,r=!0){Z(`Uploading with CLI version ${Cr.version}`);let n,i=Jt();await Ae();let{s3Region:o,s3Apikey:s,s3Apisecret:a,s3BucketName:u,s3Endpoint:l,s3Port:c,s3SSL:f}=e,h=loe(e),d=await te(),m=await iI(),{appid:b,path:D}=coe(t,e,d.config),_=await uoe(d.config,e);e.autoSetBundle&&await _l({version:_}),foe(e,D),p.info(`Upload ${b}@${_} started from path "${D}" to Capgo cloud`);let F=await br(),g=await fe(h),C=await he(g,h,["write","all","upload"]),A=e.channel||await voe(b,g,F.hostWeb)||"dev",T=await wr(g,b);await uI(g,T,Cr.version),await lI(g,T,h,b,!0),await hoe(g,T,F);let{nativePackages:x,minUpdateVersion:L}=await doe(g,i,e,A,b,_);await poe(g,b,_),e.external&&!e.external.startsWith("https://")&&(p.error(`External link should should start with "https://" current is "${e.external}"`),k.error("")),e.deleteLinkedBundleOnUpload&&(p.warn("Deleting linked bundle on upload is destructive, it will delete the currently linked bundle in the channel you are trying to upload to."),p.warn("Please make sure you want to do this, if you are not sure, please do not use this option."));let S={name:_,app_id:b,session_key:void 0,external_url:e.external,storage_provider:e.external?"external":"r2-direct",min_update_version:L,native_packages:x,owner_org:T,user_id:C,checksum:void 0},I=null,$="none",B="";if(e.external)await Oe(h,{channel:"app",event:"App external",icon:"\u{1F4E4}",user_id:T,tags:{"app-id":b},notify:!1}),S.session_key=e.ivSessionKey,S.checksum=e.encryptedChecksum;else{let{zipped:E,ivSessionKey:v,checksum:w,sessionKey:O,encryptionMethod:j,finalKeyData:R}=await moe(D,e,h,T,b,m.maxUploadLength,m.alertUploadSize);S.session_key=v,S.checksum=w,n=O,I=E,$=j,B=R,e.ignoreChecksumCheck||await vI(g,b,A,w)}!m.TUSUpload||e.external?e.tus=!1:e.tus=e.tus||m.TUSUploadForced,!m.partialUpload||e.external?e.partial=!1:e.partial=e.partial||e.partialOnly||m.partialUploadForced,e.encryptPartial&&$==="v1"&&(p.error("You cannot encrypt the partial update if you are not using the v2 encryption method"),k.error(""));let q=e.partial?await t8(D,h,T,b,e.encryptPartial?$:"none",B):[],{error:K}=await wv(g,S);if(K&&(p.error(`Cannot add bundle ${Q(K)}`),k.error("")),e.tusChunkSize&&e.tusChunkSize>m.maxChunkSize?(p.error(`Chunk size ${e.tusChunkSize} is greater than the maximum chunk size ${m.maxChunkSize}, using the maximum chunk size`),e.tusChunkSize=m.maxChunkSize):e.tusChunkSize||(e.tusChunkSize=m.maxChunkSize),I&&(u||l||o||s||a||c||f)){(!u||!l||!o||!s||!a||!c)&&(p.error("Missing argument, for S3 upload you need to provide a bucket name, endpoint, region, port, API key, and API secret"),k.error("")),p.info("Uploading to S3");let E=new Il({endPoint:l,region:o,port:c,useSSL:f,bucket:u,accessKey:s,secretKey:a}),v=`${b}-${_}`,w=encodeURIComponent(v);await E.putObject(v,Uint8Array.from(I)),S.external_url=`https://${l}/${w}`,S.storage_provider="external"}else if(I){e.partialOnly||await goe(h,g,b,_,T,I,e,e.tusChunkSize);let E=null;try{e.dryUpload&&(e.partial=!1);let w=S.session_key&&e.encryptPartial&&n?{sessionKey:n,ivSessionKey:S.session_key}:void 0;E=e.partial?await r8(h,q,D,b,_,T,w,e.tusChunkSize):null}catch(w){p.info(`Failed to upload partial files to capgo cloud. Error: ${Q(w)}. This is not a critical error, the bundle has been uploaded without the partial files`)}S.storage_provider="r2",S.manifest=E;let{error:v}=await wv(g,S);v&&(p.error(`Cannot update bundle ${Q(v)}`),k.error(""))}let V=await qe(g,h,b,2);return e.deleteLinkedBundleOnUpload&&Dv(V,3)?await yoe(g,b,A):e.deleteLinkedBundleOnUpload&&p.warn("Cannot delete linked bundle on upload as a upload organization member"),Dv(V,3)?await Doe(g,h,!!e.bundleUrl,_,A,C,T,b,F):p.warn("Cannot set channel as a upload organization member"),await Oe(h,{channel:"app",event:"App Uploaded",icon:"\u23EB",user_id:T,tags:{"app-id":b},notify:!1}),r&&(J("Time to share your update to the world \u{1F30D}"),(0,Mh.exit)()),!0}function boe(t){t.ivSessionKey&&!t.external&&(p.error("You need to provide an external url if you want to use the --iv-session-key option"),k.error("")),t.encryptedChecksum&&!t.external&&(p.error("You need to provide an external url if you want to use the --encrypted-checksum option"),k.error("")),t.partial&&t.external&&(p.error("You cannot use the --partial option with an external url"),k.error("")),t.tus&&t.external&&(p.error("You cannot use the --tus option with an external url"),k.error("")),t.dryUpload&&t.external&&(p.error("You cannot use the --dry-upload option with an external url"),k.error("")),t.multipart&&t.external&&(p.error("You cannot use the --multipart option with an external url"),k.error("")),t.external&&(t.keyV2||t.keyDataV2)&&(p.error("You cannot set a key if you are uploading to an external url"),k.error("")),t.keyV2&&t.keyDataV2&&(p.error("You cannot set both key-v2 and key-data-v2"),k.error("")),t.external&&(t.s3Region||t.s3Apikey||t.s3Apisecret||t.s3Endpoint||t.s3BucketName||t.s3Port||t.s3SSL)&&(p.error("You cannot set S3 options if you are uploading to an external url, it's automatically handled"),k.error("")),t.encryptedChecksum&&!t.external&&(p.error("You cannot set the --encrypted-checksum option if you are not uploading to an external url"),k.error("")),t.minUpdateVersion&&t.autoMinUpdateVersion&&(p.error("You cannot set both min-update-version and auto-min-update-version, use only one of them"),k.error(""))}async function o8(t,e){try{boe(e),await mb(t,e,!0)}catch(r){p.error(Q(r)),k.error("")}}var s8=require("node:crypto"),Uh=require("node:fs"),a8=require("node:process");var gb=ue(fu());var woe=20;async function u8(t,e){try{let{bundle:r,path:n}=e,{json:i}=e;i||await Ae();let o=await te();t=pe(t,o?.config);let s=(0,s8.randomUUID)().split("-")[0],a=await vr("",e.packageJson);r=r||a?.version||`0.0.1-beta.${s}`,i||Z(`Zipping ${t}@${r}`),r&&!ia.test(r)&&(i?console.error(Q({error:"invalid_semver"})):p.error(`Your bundle name ${r}, is not valid it should follow semver convention : https://semver.org/`),k.error("")),n=n||o?.config?.webDir,(!t||!r||!n)&&(i?console.error(Q({error:"missing_argument"})):p.error("Missing argument, you need to provide a appId and a bundle and a path, or be in a capacitor project"),k.error("")),i||p.info(`Started from path "${n}"`);let u=e.codeCheck;(typeof u>"u"||u)&&(jl(n,"notifyAppReady")||(i?console.error(Q({error:"notifyAppReady_not_in_source_code"})):p.error("notifyAppReady() is missing in the build folder of your app. see: https://capgo.app/docs/plugin/api/#notifyappready"),k.error("")),Bh(n)||(i?console.error(Q({error:"index_html_not_found"})):p.error(`index.html is missing in the root folder of ${n}`),k.error("")));let l=await lh(n);i||p.info(`Zipped ${l.byteLength} bytes`);let c=_e();i||c.start("Calculating checksum");let f="";e.keyV2||(0,Uh.existsSync)(or)?f=await(0,gb.checksum)(l,"sha256"):f=await(0,gb.checksum)(l,"crc32"),i||c.stop(`Checksum: ${f}`);let h=Math.floor(l.byteLength/1024/1024);h>woe&&!i&&(p.warn(`WARNING !!
313
+ Bundle uploaded \u{1F4AA} in 0 seconds`);return}try{let d=await br();if(s.multipart!==void 0&&s.multipart||s.tus!==void 0&&s.tus){s.multipart?p.info("Uploading bundle with multipart is deprecated, we upload with TUS instead"):p.info("Uploading bundle with TUS protocol"),await gI(t,o,i,r,n,u,d,a),c=!0;let m=`orgs/${i}/apps/${r}/${n}.zip`,{error:b}=await e.from("app_versions").update({r2_path:m}).eq("name",n).eq("app_id",r);if(b)return p.error(`Cannot finish TUS upload ${Q(b)}`),Promise.reject(new Error("Cannot finish TUS upload"))}else{let m=await hI(e,r,n);if(!m)return p.error("Cannot get upload url"),Promise.reject(new Error("Cannot get upload url"));await qr.put(m,{timeout:s.timeout||tI,retry:5,body:o})}}catch(d){let b=((performance.now()-l)/1e3).toFixed(2);if(u.stop(`Failed to upload bundle ( after ${b} seconds)`),d instanceof Wn){let y=await d.response.json();p.error(`Response Error: ${y.error||y.status||y.message}`)}else s.tus?p.error(`Cannot upload bundle please contact support if the issue persists ${Q(d)}`):p.error(`Cannot upload bundle ( try again with --tus option) ${Q(d)}`);await yI(e,r,n),k.error("")}let h=((performance.now()-l)/1e3).toFixed(2);u.stop(`Bundle uploaded \u{1F4AA} in (${h} seconds)`),await Oe(t,{channel:"performance",event:c?"TUS upload zip performance":"Upload zip performance",icon:"\u{1F684}",user_id:i,tags:{"app-id":r,time:h},notify:!1})}async function yoe(t,e,r){let{data:n,error:i}=await t.from("channels").select("version ( id, name, deleted )").eq("app_id",e).eq("name",r);if(i){p.error(`Cannot delete linked bundle on upload ${Q(i)}`);return}if(n.length===0){p.warn("No linked bundle found in the channel you are trying to upload to");return}let o=n[0].version;if(o.deleted){p.warn("The linked bundle is already deleted");return}let{error:s}=await t.from("app_versions").update({deleted:!0}).eq("id",o.id);if(s){p.error(`Cannot delete linked bundle on upload ${Q(s)}`);return}p.info("Linked bundle deleted")}async function Doe(t,e,r,n,i,o,s,a,u){let{data:l}=await t.rpc("get_app_versions",{apikey:e,name_version:n,appid:a}).single();l||(p.warn("Cannot get version id, cannot set channel"),k.error(""));let{data:c}=await t.rpc("is_allowed_capgkey",{apikey:e,keymode:["write","all"]}).single();if(c){let{error:f,data:h}=await ch(t,{name:i,app_id:a,created_by:o,version:l,owner_org:s});f&&(p.error(`Cannot set channel, the upload key is not allowed to do that, use the "all" for this. ${Q(f)}`),k.error(""));let d=mo(a),m=`${u.hostWeb}/app/p/${d}/channel/${h.id}`;h?.public?p.info("Your update is now available in your public channel \u{1F389}"):h?.id&&p.info(`Link device to this bundle to try it: ${m}`),r?p.info(`Bundle url: ${m}`):l||(p.warn("Cannot set bundle with upload key, use key with more rights for that"),k.error(""))}else p.warn("The upload key is not allowed to set the version in the channel")}async function voe(t,e,r){let{error:n,data:i}=await e.from("apps").select("default_upload_channel").single();if(n){p.warn("Cannot find default upload channel");let o=mo(t);return p.info(`You can set it here: ${r}/app/p/${o}/settings`),null}return i.default_upload_channel}async function mb(t,e,r=!0){Z(`Uploading with CLI version ${Cr.version}`);let n,i=Jt();await Ae();let{s3Region:o,s3Apikey:s,s3Apisecret:a,s3BucketName:u,s3Endpoint:l,s3Port:c,s3SSL:f}=e,h=loe(e),d=await te(),m=await iI(),{appid:b,path:y}=coe(t,e,d.config),E=await uoe(d.config,e);e.autoSetBundle&&await _l({version:E}),foe(e,y),p.info(`Upload ${b}@${E} started from path "${y}" to Capgo cloud`);let F=await br(),g=await fe(h),C=await he(g,h,["write","all","upload"]),A=e.channel||await voe(b,g,F.hostWeb)||"dev",T=await wr(g,b);await uI(g,T,Cr.version),await lI(g,T,h,b,!0),await hoe(g,T,F);let{nativePackages:x,minUpdateVersion:L}=await doe(g,i,e,A,b,E);await poe(g,b,E),e.external&&!e.external.startsWith("https://")&&(p.error(`External link should should start with "https://" current is "${e.external}"`),k.error("")),e.deleteLinkedBundleOnUpload&&(p.warn("Deleting linked bundle on upload is destructive, it will delete the currently linked bundle in the channel you are trying to upload to."),p.warn("Please make sure you want to do this, if you are not sure, please do not use this option."));let S={name:E,app_id:b,session_key:void 0,external_url:e.external,storage_provider:e.external?"external":"r2-direct",min_update_version:L,native_packages:x,owner_org:T,user_id:C,checksum:void 0},I=null,$="none",B="";if(e.external)await Oe(h,{channel:"app",event:"App external",icon:"\u{1F4E4}",user_id:T,tags:{"app-id":b},notify:!1}),S.session_key=e.ivSessionKey,S.checksum=e.encryptedChecksum;else{let{zipped:_,ivSessionKey:v,checksum:w,sessionKey:O,encryptionMethod:j,finalKeyData:R}=await moe(y,e,h,T,b,m.maxUploadLength,m.alertUploadSize);S.session_key=v,S.checksum=w,n=O,I=_,$=j,B=R,e.ignoreChecksumCheck||await vI(g,b,A,w)}!m.TUSUpload||e.external?e.tus=!1:e.tus=e.tus||m.TUSUploadForced,!m.partialUpload||e.external?e.partial=!1:e.partial=e.partial||e.partialOnly||m.partialUploadForced,e.encryptPartial&&$==="v1"&&(p.error("You cannot encrypt the partial update if you are not using the v2 encryption method"),k.error(""));let q=e.partial?await t8(y,h,T,b,e.encryptPartial?$:"none",B):[],{error:K}=await wv(g,S);if(K&&(p.error(`Cannot add bundle ${Q(K)}`),k.error("")),e.tusChunkSize&&e.tusChunkSize>m.maxChunkSize?(p.error(`Chunk size ${e.tusChunkSize} is greater than the maximum chunk size ${m.maxChunkSize}, using the maximum chunk size`),e.tusChunkSize=m.maxChunkSize):e.tusChunkSize||(e.tusChunkSize=m.maxChunkSize),I&&(u||l||o||s||a||c||f)){(!u||!l||!o||!s||!a||!c)&&(p.error("Missing argument, for S3 upload you need to provide a bucket name, endpoint, region, port, API key, and API secret"),k.error("")),p.info("Uploading to S3");let _=new Il({endPoint:l,region:o,port:c,useSSL:f,bucket:u,accessKey:s,secretKey:a}),v=`${b}-${E}`,w=encodeURIComponent(v);await _.putObject(v,Uint8Array.from(I)),S.external_url=`https://${l}/${w}`,S.storage_provider="external"}else if(I){e.partialOnly||await goe(h,g,b,E,T,I,e,e.tusChunkSize);let _=null;try{e.dryUpload&&(e.partial=!1);let w=S.session_key&&e.encryptPartial&&n?{sessionKey:n,ivSessionKey:S.session_key}:void 0;_=e.partial?await r8(h,q,y,b,E,T,w,e.tusChunkSize):null}catch(w){p.info(`Failed to upload partial files to capgo cloud. Error: ${Q(w)}. This is not a critical error, the bundle has been uploaded without the partial files`)}S.storage_provider="r2",S.manifest=_;let{error:v}=await wv(g,S);v&&(p.error(`Cannot update bundle ${Q(v)}`),k.error(""))}let V=await qe(g,h,b,2);return e.deleteLinkedBundleOnUpload&&Dv(V,3)?await yoe(g,b,A):e.deleteLinkedBundleOnUpload&&p.warn("Cannot delete linked bundle on upload as a upload organization member"),Dv(V,3)?await Doe(g,h,!!e.bundleUrl,E,A,C,T,b,F):p.warn("Cannot set channel as a upload organization member"),await Oe(h,{channel:"app",event:"App Uploaded",icon:"\u23EB",user_id:T,tags:{"app-id":b},notify:!1}),r&&(J("Time to share your update to the world \u{1F30D}"),(0,Mh.exit)()),!0}function boe(t){t.ivSessionKey&&!t.external&&(p.error("You need to provide an external url if you want to use the --iv-session-key option"),k.error("")),t.encryptedChecksum&&!t.external&&(p.error("You need to provide an external url if you want to use the --encrypted-checksum option"),k.error("")),t.partial&&t.external&&(p.error("You cannot use the --partial option with an external url"),k.error("")),t.tus&&t.external&&(p.error("You cannot use the --tus option with an external url"),k.error("")),t.dryUpload&&t.external&&(p.error("You cannot use the --dry-upload option with an external url"),k.error("")),t.multipart&&t.external&&(p.error("You cannot use the --multipart option with an external url"),k.error("")),t.external&&(t.keyV2||t.keyDataV2)&&(p.error("You cannot set a key if you are uploading to an external url"),k.error("")),t.keyV2&&t.keyDataV2&&(p.error("You cannot set both key-v2 and key-data-v2"),k.error("")),t.external&&(t.s3Region||t.s3Apikey||t.s3Apisecret||t.s3Endpoint||t.s3BucketName||t.s3Port||t.s3SSL)&&(p.error("You cannot set S3 options if you are uploading to an external url, it's automatically handled"),k.error("")),t.encryptedChecksum&&!t.external&&(p.error("You cannot set the --encrypted-checksum option if you are not uploading to an external url"),k.error("")),t.minUpdateVersion&&t.autoMinUpdateVersion&&(p.error("You cannot set both min-update-version and auto-min-update-version, use only one of them"),k.error(""))}async function o8(t,e){try{boe(e),await mb(t,e,!0)}catch(r){p.error(Q(r)),k.error("")}}var s8=require("node:crypto"),Uh=require("node:fs"),a8=require("node:process");var gb=ue(fu());var woe=20;async function u8(t,e){try{let{bundle:r,path:n}=e,{json:i}=e;i||await Ae();let o=await te();t=pe(t,o?.config);let s=(0,s8.randomUUID)().split("-")[0],a=await vr("",e.packageJson);r=r||a?.version||`0.0.1-beta.${s}`,i||Z(`Zipping ${t}@${r}`),r&&!ia.test(r)&&(i?console.error(Q({error:"invalid_semver"})):p.error(`Your bundle name ${r}, is not valid it should follow semver convention : https://semver.org/`),k.error("")),n=n||o?.config?.webDir,(!t||!r||!n)&&(i?console.error(Q({error:"missing_argument"})):p.error("Missing argument, you need to provide a appId and a bundle and a path, or be in a capacitor project"),k.error("")),i||p.info(`Started from path "${n}"`);let u=e.codeCheck;(typeof u>"u"||u)&&(jl(n,"notifyAppReady")||(i?console.error(Q({error:"notifyAppReady_not_in_source_code"})):p.error("notifyAppReady() is missing in the build folder of your app. see: https://capgo.app/docs/plugin/api/#notifyappready"),k.error("")),Bh(n)||(i?console.error(Q({error:"index_html_not_found"})):p.error(`index.html is missing in the root folder of ${n}`),k.error("")));let l=await lh(n);i||p.info(`Zipped ${l.byteLength} bytes`);let c=_e();i||c.start("Calculating checksum");let f="";e.keyV2||(0,Uh.existsSync)(or)?f=await(0,gb.checksum)(l,"sha256"):f=await(0,gb.checksum)(l,"crc32"),i||c.stop(`Checksum: ${f}`);let h=Math.floor(l.byteLength/1024/1024);h>woe&&!i&&(p.warn(`WARNING !!
314
314
  The bundle size is ${h} Mb, this may take a while to download for users
315
315
  `),p.warn(`Learn how to optimize your assets https://capgo.app/blog/optimise-your-images-for-updates/
316
316
  `));let d=_e(),m=e.name||`${t}_${r}.zip`;i||d.start(`Saving to ${m}`),(0,Uh.writeFileSync)(m,l),i||d.stop(`Saved to ${m}`),i||J("Done \u2705"),i&&console.log(JSON.stringify({bundle:r,filename:m,checksum:f},null,2)),(0,a8.exit)()}catch(r){p.error(Q(r)),k.error("")}}var l8=require("node:process");async function yb(t,e,r,n=!0){Z("Create channel"),r.apikey=r.apikey||de();let i=await te();e=pe(e,i?.config),r.apikey||(p.error("Missing API key, you need to provide a API key to upload your bundle"),k.error("")),e||(p.error("Missing argument, you need to provide a appId, or be in a capacitor project"),k.error(""));let o=await fe(r.apikey);await he(o,r.apikey,["write","all"]),await qe(o,r.apikey,e,4),p.info(`Creating channel ${e}#${t} to Capgo`);try{let s=await rb(o,e),a=await wr(o,e);s||(p.error("Cannot find default version for channel creation, please contact Capgo support \u{1F928}"),k.error(""));let u=await D6(o,{name:t,app_id:e,version:s.id,owner_org:a});u.error&&(p.error(`Cannot create Channel \u{1F640}
317
- ${Q(u.error)}`),k.error("")),p.success("Channel created \u2705"),await Oe(r.apikey,{channel:"channel",event:"Create channel",icon:"\u2705",user_id:a,tags:{"app-id":e,channel:t},notify:!1}).catch()}catch{return p.error("Cannot create Channel \u{1F640}"),!1}return n&&(J("Done \u2705"),(0,l8.exit)()),!0}async function c8(t,e,r){yb(t,e,r,!0)}var f8=require("node:process");async function d8(t,e,r){let{quiet:n}=r;n||Z("List current bundle"),r.apikey=r.apikey||de(n);let i=await te();e=pe(e,i?.config),r.apikey||(p.error("Missing API key, you need to provide a API key to upload your bundle"),k.error("")),e||(p.error("Missing argument, you need to provide a appId, or be in a capacitor project"),k.error(""));let o=await fe(r.apikey),s=await he(o,r.apikey,["write","all","read"]);await qe(o,r.apikey,e,1),t||(p.error("Please provide a channel to get the bundle from."),k.error(""));let{data:a,error:u}=await o.from("channels").select("version ( name )").eq("name",t).eq("app_id",e).limit(1);(u||a.length===0)&&(p.error(`Error retrieving channel ${t} for app ${e}. Perhaps the channel does not exists?`),k.error(""));let{version:l}=a[0];l||(p.error(`Error retrieving channel ${t} for app ${e}. Perhaps the channel does not exists?`),k.error("")),n?p.info(l.name):p.info(`Current bundle for channel ${t} is ${l.name}`),(0,f8.exit)()}var h8=require("node:process");async function p8(t,e,r){Z("Delete channel"),r.apikey=r.apikey||de();let n=await te();e=pe(e,n?.config),r.apikey||(p.error("Missing API key, you need to provide a API key to upload your bundle"),k.error("")),e||(p.error("Missing argument, you need to provide a appId, or be in a capacitor project"),k.error(""));let i=await fe(r.apikey),o=await he(i,r.apikey,["all"]);if(await qe(i,r.apikey,e,4),r.deleteBundle){p.info(`Deleting bundle ${e}#${t} from Capgo`);let s=await b6(i,e,t);s&&s.name&&(p.info(`Deleting bundle ${s.name} from Capgo`),await nb(i,e,s.name))}p.info(`Deleting channel ${e}#${t} from Capgo`);try{let s=await v6(i,t,e,o);s.error&&(p.error(`Cannot delete Channel \u{1F640} ${Q(s.error)}`),k.error(""));let a=await wr(i,e);p.success("Channel deleted"),await Oe(r.apikey,{channel:"channel",event:"Delete channel",icon:"\u2705",user_id:a,tags:{"user-id":o,"app-id":e,channel:t},notify:!1}).catch()}catch{p.error("Cannot delete Channel \u{1F640}")}J("Done \u2705"),(0,h8.exit)()}var m8=require("node:process");async function g8(t,e){Z("List channels"),e.apikey=e.apikey||de();let r=await te();t=pe(t,r?.config),e.apikey||p.error("Missing API key, you need to provide a API key to upload your bundle"),t||(p.error("Missing argument, you need to provide a appId, or be in a capacitor project"),k.error(""));let n=await fe(e.apikey),i=await he(n,e.apikey,["write","all","read","upload"]);await qe(n,e.apikey,t,1),p.info("Querying available channels in Capgo");let o=await _6(n,t);p.info(`Active channels in Capgo: ${o?.length}`),w6(o),await Oe(e.apikey,{channel:"channel",event:"List channel",icon:"\u2705",user_id:i,tags:{"app-id":t},notify:!1}).catch(),J("Done \u2705"),(0,m8.exit)()}var D8=require("node:process");var y8=["major","minor","metadata","patch","none"];async function v8(t,e,r){Z("Set channel"),r.apikey=r.apikey||de();let n=await te();e=pe(e,n?.config),r.apikey||(p.error("Missing API key, you need to provide a API key to upload your bundle"),k.error("")),e||(p.error("Missing argument, you need to provide a appId, or be in a capacitor project"),k.error(""));let i=await fe(r.apikey),o=await he(i,r.apikey,["write","all"]);await qe(i,r.apikey,e,4);let s=await wr(i,e),{bundle:a,state:u,downgrade:l,latest:c,upgrade:f,ios:h,android:d,selfAssign:m,disableAutoUpdate:b,dev:D,emulator:_}=r;t||(p.error("Missing argument, you need to provide a channel"),k.error("")),c&&a&&(p.error("Cannot set latest and bundle at the same time"),k.error("")),a==null&&u==null&&c==null&&l==null&&f==null&&h==null&&d==null&&m==null&&D==null&&_==null&&b==null&&(p.error("Missing argument, you need to provide a option to set"),k.error(""));try{await uh(i,s,r.apikey,e);let F={created_by:o,app_id:e,name:t,owner_org:s,version:void 0},g=await vr("",r.packageJson),C=c?n?.config?.plugins?.CapacitorUpdater?.version||g?.version:a;if(C!=null){let{data:A,error:T}=await i.from("app_versions").select().eq("app_id",e).eq("name",C).eq("user_id",o).eq("deleted",!1).single();(T||!A)&&(p.error(`Cannot find version ${C}`),k.error("")),p.info(`Set ${e} channel: ${t} to @${C}`),F.version=A.id}if(u!=null&&((u==="public"||u==="private")&&p.info(`Set ${e} channel: ${t} to public or private is deprecated, use default or normal instead`),p.info(`Set ${e} channel: ${t} to ${u==="public"||u==="default"?"default":"normal"}`),F.public=u==="public"||u==="default"),l!=null&&(p.info(`Set ${e} channel: ${t} to ${l?"allow":"disallow"} downgrade`),F.disable_auto_update_under_native=!l),h!=null&&(p.info(`Set ${e} channel: ${t} to ${h?"allow":"disallow"} ios update`),F.ios=!!h),d!=null&&(p.info(`Set ${e} channel: ${t} to ${d?"allow":"disallow"} android update`),F.android=!!d),m!=null&&(p.info(`Set ${e} channel: ${t} to ${m?"allow":"disallow"} self assign to this channel`),F.allow_device_self_set=!!m),b!=null){let A=b.toLocaleLowerCase();y8.includes(A)||(p.error(`Channel strategy ${A} is not known. The possible values are: ${y8.join(", ")}.`),k.error("")),A==="metadata"&&(A="version_number"),F.disable_auto_update=A,p.info(`Set ${e} channel: ${t} to ${A} disable update strategy to this channel`)}try{let{error:A}=await ch(i,F);A&&(p.error('Cannot set channel the upload key is not allowed to do that, use the "all" for this.'),k.error(""))}catch{p.error('Cannot set channel the upload key is not allowed to do that, use the "all" for this.'),k.error("")}await Oe(r.apikey,{channel:"channel",event:"Set channel",icon:"\u2705",user_id:s,tags:{"app-id":e},notify:!1}).catch()}catch(F){p.error(`Unknow error ${Q(F)}`),k.error("")}J("Done \u2705"),(0,D8.exit)()}var Ll=require("node:child_process"),Ie=require("node:fs"),pi=require("node:path"),ke=require("node:process");var zh=ue(I8());var Lt=require("node:fs");async function Loe(t,e=!0){e&&Z("Save keys \u{1F511}");let r=await te(),n=t.key||Fn,i=t.keyData||"";if(!(0,Lt.existsSync)(n)&&!i)if(p)p.error(`Cannot find a public key at ${n} or as keyData option or in ${r.path}`),k.error("");else return!1;else(0,Lt.existsSync)(n)&&(i=(0,Lt.readFileSync)(n).toString());if(i&&!i.startsWith("-----BEGIN RSA PUBLIC KEY-----"))if(p)p.error("the public key provided is not a valid RSA Public key"),k.error("");else return!1;return r?.config&&(r.config.plugins||(r.config.plugins={extConfig:{},CapacitorUpdater:{}}),r.config.plugins.CapacitorUpdater||(r.config.plugins.CapacitorUpdater={}),r.config.plugins.CapacitorUpdater.privateKey&&(delete r.config.plugins.CapacitorUpdater.privateKey,p.info("Old private key deleted from config file"),await Pe({message:"Do you want to setup encryption with the new channel in order to support old apps and facilitate the migration?"})&&(r.config.plugins.CapacitorUpdater.defaultChannel="encryption_v2")),r.config.plugins.CapacitorUpdater.publicKey=i,await ci(r)),e&&(p.success(`public key saved into ${r.path} file in local directory`),p.success("your app will decode the zip archive with this key")),!0}async function Boe(t,e=!0){e&&Z("Deleting old private key \u{1F5D1}\uFE0F");let r=await te();if(r?.config?.plugins?.CapacitorUpdater?.privateKey){if(delete r.config.plugins.CapacitorUpdater.privateKey,await ci(r),(0,Lt.existsSync)(na))try{(0,Lt.unlinkSync)(na),e&&p.success(`Old private key file deleted: ${na}`)}catch{e&&p.error(`Failed to delete old private key file: ${na}`)}if((0,Lt.existsSync)(sh))try{(0,Lt.unlinkSync)(sh),e&&p.success(`Old public key file deleted: ${sh}`)}catch{e&&p.error(`Failed to delete old public key file: ${Fn}`)}return e&&p.success(`Old private key deleted from ${r.path} file`),!0}else return e&&p.info("No old private key found in config file"),!1}async function j8(t){Z("Save keys \u{1F511}"),await Ae(),await Loe(t)}async function Sb(t,e=!0){e&&Z("Create keys \u{1F511}");let{publicKey:r,privateKey:n}=k6();if((0,Lt.existsSync)(Fn)&&!t.force)if(p.error("Public Key already exists, use --force to overwrite"),e)k.error("");else return!1;if((0,Lt.writeFileSync)(Fn,r),(0,Lt.existsSync)(or)&&!t.force)if(p.error("Private Key already exists, use --force to overwrite"),e)k.error("");else return!1;(0,Lt.writeFileSync)(or,n);let i=await te();return i&&(i.config.plugins||(i.config.plugins={extConfig:{},CapacitorUpdater:{}}),i.config.plugins.CapacitorUpdater||(i.config.plugins.CapacitorUpdater={}),i.config.plugins.CapacitorUpdater.privateKey&&(delete i.config.plugins.CapacitorUpdater.privateKey,p.info("Old private key deleted from config file"),await Pe({message:"Do you want to setup encryption with the new channel in order to support old apps and facilitate the migration?"})&&(i.config.plugins.CapacitorUpdater.defaultChannel="encryption_v2")),i.config.plugins.CapacitorUpdater.publicKey=r,ci(i)),p&&(p.success("Your RSA key has been generated"),p.success(`Private key saved in ${or}`),p.success("This key will be use to encrypt your bundle before sending it to Capgo"),p.success("Keep it safe"),p.success("Than make it unreadable by Capgo and unmodifiable by anyone"),p.success(`Public key saved in ${i.path}`),p.success("Your app will be the only one having it"),p.success("Only your users can decrypt your update"),p.success("Only you can send them an update"),J("Done \u2705")),!0}async function N8(t){await Ae(),await Sb(t)}async function L8(t){await Ae(),await Boe(t)}var Nn=require("node:fs"),Fb=require("node:os"),xb=require("node:process");async function B8(){let t=(0,Fb.homedir)();return(0,Nn.existsSync)(`${t}/.capgo`)||(0,Nn.existsSync)(".capgo")}async function Ob(t,e,r=!0){if(r&&Z("Login to Capgo"),!t)return r&&(p.error("Missing API key, you need to provide a API key to upload your bundle"),k.error("")),!1;await Ae();try{let{local:n}=e;if(n)(0,Nn.existsSync)(".git")||(p.error("To use local you should be in a git repository"),k.error("")),(0,Nn.writeFileSync)(".capgo",`${t}
317
+ ${Q(u.error)}`),k.error("")),p.success("Channel created \u2705"),await Oe(r.apikey,{channel:"channel",event:"Create channel",icon:"\u2705",user_id:a,tags:{"app-id":e,channel:t},notify:!1}).catch()}catch{return p.error("Cannot create Channel \u{1F640}"),!1}return n&&(J("Done \u2705"),(0,l8.exit)()),!0}async function c8(t,e,r){yb(t,e,r,!0)}var f8=require("node:process");async function d8(t,e,r){let{quiet:n}=r;n||Z("List current bundle"),r.apikey=r.apikey||de(n);let i=await te();e=pe(e,i?.config),r.apikey||(p.error("Missing API key, you need to provide a API key to upload your bundle"),k.error("")),e||(p.error("Missing argument, you need to provide a appId, or be in a capacitor project"),k.error(""));let o=await fe(r.apikey),s=await he(o,r.apikey,["write","all","read"]);await qe(o,r.apikey,e,1),t||(p.error("Please provide a channel to get the bundle from."),k.error(""));let{data:a,error:u}=await o.from("channels").select("version ( name )").eq("name",t).eq("app_id",e).limit(1);(u||a.length===0)&&(p.error(`Error retrieving channel ${t} for app ${e}. Perhaps the channel does not exists?`),k.error(""));let{version:l}=a[0];l||(p.error(`Error retrieving channel ${t} for app ${e}. Perhaps the channel does not exists?`),k.error("")),n?p.info(l.name):p.info(`Current bundle for channel ${t} is ${l.name}`),(0,f8.exit)()}var h8=require("node:process");async function p8(t,e,r){Z("Delete channel"),r.apikey=r.apikey||de();let n=await te();e=pe(e,n?.config),r.apikey||(p.error("Missing API key, you need to provide a API key to upload your bundle"),k.error("")),e||(p.error("Missing argument, you need to provide a appId, or be in a capacitor project"),k.error(""));let i=await fe(r.apikey),o=await he(i,r.apikey,["all"]);if(await qe(i,r.apikey,e,4),r.deleteBundle){p.info(`Deleting bundle ${e}#${t} from Capgo`);let s=await b6(i,e,t);s&&s.name&&(p.info(`Deleting bundle ${s.name} from Capgo`),await nb(i,e,s.name))}p.info(`Deleting channel ${e}#${t} from Capgo`);try{let s=await v6(i,t,e,o);s.error&&(p.error(`Cannot delete Channel \u{1F640} ${Q(s.error)}`),k.error(""));let a=await wr(i,e);p.success("Channel deleted"),await Oe(r.apikey,{channel:"channel",event:"Delete channel",icon:"\u2705",user_id:a,tags:{"user-id":o,"app-id":e,channel:t},notify:!1}).catch()}catch{p.error("Cannot delete Channel \u{1F640}")}J("Done \u2705"),(0,h8.exit)()}var m8=require("node:process");async function g8(t,e){Z("List channels"),e.apikey=e.apikey||de();let r=await te();t=pe(t,r?.config),e.apikey||p.error("Missing API key, you need to provide a API key to upload your bundle"),t||(p.error("Missing argument, you need to provide a appId, or be in a capacitor project"),k.error(""));let n=await fe(e.apikey),i=await he(n,e.apikey,["write","all","read","upload"]);await qe(n,e.apikey,t,1),p.info("Querying available channels in Capgo");let o=await _6(n,t);p.info(`Active channels in Capgo: ${o?.length}`),w6(o),await Oe(e.apikey,{channel:"channel",event:"List channel",icon:"\u2705",user_id:i,tags:{"app-id":t},notify:!1}).catch(),J("Done \u2705"),(0,m8.exit)()}var D8=require("node:process");var y8=["major","minor","metadata","patch","none"];async function v8(t,e,r){Z("Set channel"),r.apikey=r.apikey||de();let n=await te();e=pe(e,n?.config),r.apikey||(p.error("Missing API key, you need to provide a API key to upload your bundle"),k.error("")),e||(p.error("Missing argument, you need to provide a appId, or be in a capacitor project"),k.error(""));let i=await fe(r.apikey),o=await he(i,r.apikey,["write","all"]);await qe(i,r.apikey,e,4);let s=await wr(i,e),{bundle:a,state:u,downgrade:l,latest:c,upgrade:f,ios:h,android:d,selfAssign:m,disableAutoUpdate:b,dev:y,emulator:E}=r;t||(p.error("Missing argument, you need to provide a channel"),k.error("")),c&&a&&(p.error("Cannot set latest and bundle at the same time"),k.error("")),a==null&&u==null&&c==null&&l==null&&f==null&&h==null&&d==null&&m==null&&y==null&&E==null&&b==null&&(p.error("Missing argument, you need to provide a option to set"),k.error(""));try{await uh(i,s,r.apikey,e);let F={created_by:o,app_id:e,name:t,owner_org:s,version:void 0},g=await vr("",r.packageJson),C=c?n?.config?.plugins?.CapacitorUpdater?.version||g?.version:a;if(C!=null){let{data:A,error:T}=await i.from("app_versions").select().eq("app_id",e).eq("name",C).eq("user_id",o).eq("deleted",!1).single();(T||!A)&&(p.error(`Cannot find version ${C}`),k.error("")),p.info(`Set ${e} channel: ${t} to @${C}`),F.version=A.id}if(u!=null&&((u==="public"||u==="private")&&p.info(`Set ${e} channel: ${t} to public or private is deprecated, use default or normal instead`),p.info(`Set ${e} channel: ${t} to ${u==="public"||u==="default"?"default":"normal"}`),F.public=u==="public"||u==="default"),l!=null&&(p.info(`Set ${e} channel: ${t} to ${l?"allow":"disallow"} downgrade`),F.disable_auto_update_under_native=!l),h!=null&&(p.info(`Set ${e} channel: ${t} to ${h?"allow":"disallow"} ios update`),F.ios=!!h),d!=null&&(p.info(`Set ${e} channel: ${t} to ${d?"allow":"disallow"} android update`),F.android=!!d),m!=null&&(p.info(`Set ${e} channel: ${t} to ${m?"allow":"disallow"} self assign to this channel`),F.allow_device_self_set=!!m),b!=null){let A=b.toLocaleLowerCase();y8.includes(A)||(p.error(`Channel strategy ${A} is not known. The possible values are: ${y8.join(", ")}.`),k.error("")),A==="metadata"&&(A="version_number"),F.disable_auto_update=A,p.info(`Set ${e} channel: ${t} to ${A} disable update strategy to this channel`)}try{let{error:A}=await ch(i,F);A&&(p.error('Cannot set channel the upload key is not allowed to do that, use the "all" for this.'),k.error(""))}catch{p.error('Cannot set channel the upload key is not allowed to do that, use the "all" for this.'),k.error("")}await Oe(r.apikey,{channel:"channel",event:"Set channel",icon:"\u2705",user_id:s,tags:{"app-id":e},notify:!1}).catch()}catch(F){p.error(`Unknow error ${Q(F)}`),k.error("")}J("Done \u2705"),(0,D8.exit)()}var Ll=require("node:child_process"),Ie=require("node:fs"),pi=require("node:path"),ke=require("node:process");var zh=ue(I8());var Lt=require("node:fs");async function Loe(t,e=!0){e&&Z("Save keys \u{1F511}");let r=await te(),n=t.key||Fn,i=t.keyData||"";if(!(0,Lt.existsSync)(n)&&!i)if(p)p.error(`Cannot find a public key at ${n} or as keyData option or in ${r.path}`),k.error("");else return!1;else(0,Lt.existsSync)(n)&&(i=(0,Lt.readFileSync)(n).toString());if(i&&!i.startsWith("-----BEGIN RSA PUBLIC KEY-----"))if(p)p.error("the public key provided is not a valid RSA Public key"),k.error("");else return!1;return r?.config&&(r.config.plugins||(r.config.plugins={extConfig:{},CapacitorUpdater:{}}),r.config.plugins.CapacitorUpdater||(r.config.plugins.CapacitorUpdater={}),r.config.plugins.CapacitorUpdater.privateKey&&(delete r.config.plugins.CapacitorUpdater.privateKey,p.info("Old private key deleted from config file"),await Pe({message:"Do you want to setup encryption with the new channel in order to support old apps and facilitate the migration?"})&&(r.config.plugins.CapacitorUpdater.defaultChannel="encryption_v2")),r.config.plugins.CapacitorUpdater.publicKey=i,await ci(r)),e&&(p.success(`public key saved into ${r.path} file in local directory`),p.success("your app will decode the zip archive with this key")),!0}async function Boe(t,e=!0){e&&Z("Deleting old private key \u{1F5D1}\uFE0F");let r=await te();if(r?.config?.plugins?.CapacitorUpdater?.privateKey){if(delete r.config.plugins.CapacitorUpdater.privateKey,await ci(r),(0,Lt.existsSync)(na))try{(0,Lt.unlinkSync)(na),e&&p.success(`Old private key file deleted: ${na}`)}catch{e&&p.error(`Failed to delete old private key file: ${na}`)}if((0,Lt.existsSync)(sh))try{(0,Lt.unlinkSync)(sh),e&&p.success(`Old public key file deleted: ${sh}`)}catch{e&&p.error(`Failed to delete old public key file: ${Fn}`)}return e&&p.success(`Old private key deleted from ${r.path} file`),!0}else return e&&p.info("No old private key found in config file"),!1}async function j8(t){Z("Save keys \u{1F511}"),await Ae(),await Loe(t)}async function Sb(t,e=!0){e&&Z("Create keys \u{1F511}");let{publicKey:r,privateKey:n}=k6();if((0,Lt.existsSync)(Fn)&&!t.force)if(p.error("Public Key already exists, use --force to overwrite"),e)k.error("");else return!1;if((0,Lt.writeFileSync)(Fn,r),(0,Lt.existsSync)(or)&&!t.force)if(p.error("Private Key already exists, use --force to overwrite"),e)k.error("");else return!1;(0,Lt.writeFileSync)(or,n);let i=await te();return i&&(i.config.plugins||(i.config.plugins={extConfig:{},CapacitorUpdater:{}}),i.config.plugins.CapacitorUpdater||(i.config.plugins.CapacitorUpdater={}),i.config.plugins.CapacitorUpdater.privateKey&&(delete i.config.plugins.CapacitorUpdater.privateKey,p.info("Old private key deleted from config file"),await Pe({message:"Do you want to setup encryption with the new channel in order to support old apps and facilitate the migration?"})&&(i.config.plugins.CapacitorUpdater.defaultChannel="encryption_v2")),i.config.plugins.CapacitorUpdater.publicKey=r,ci(i)),p&&(p.success("Your RSA key has been generated"),p.success(`Private key saved in ${or}`),p.success("This key will be use to encrypt your bundle before sending it to Capgo"),p.success("Keep it safe"),p.success("Than make it unreadable by Capgo and unmodifiable by anyone"),p.success(`Public key saved in ${i.path}`),p.success("Your app will be the only one having it"),p.success("Only your users can decrypt your update"),p.success("Only you can send them an update"),J("Done \u2705")),!0}async function N8(t){await Ae(),await Sb(t)}async function L8(t){await Ae(),await Boe(t)}var Nn=require("node:fs"),Fb=require("node:os"),xb=require("node:process");async function B8(){let t=(0,Fb.homedir)();return(0,Nn.existsSync)(`${t}/.capgo`)||(0,Nn.existsSync)(".capgo")}async function Ob(t,e,r=!0){if(r&&Z("Login to Capgo"),!t)return r&&(p.error("Missing API key, you need to provide a API key to upload your bundle"),k.error("")),!1;await Ae();try{let{local:n}=e;if(n)(0,Nn.existsSync)(".git")||(p.error("To use local you should be in a git repository"),k.error("")),(0,Nn.writeFileSync)(".capgo",`${t}
318
318
  `),(0,Nn.appendFileSync)(".gitignore",`.capgo
319
319
  `);else{let s=(0,Fb.homedir)();(0,Nn.writeFileSync)(`${s}/.capgo`,`${t}
320
320
  `)}let i=await fe(t),o=await he(i,t,["write","all","upload"]);await Oe(t,{channel:"user-login",event:"User CLI login",icon:"\u2705",user_id:o,notify:!1}).catch(),p.success(`login saved into .capgo file in ${n?"local":"home"} directory`)}catch{p.error("Error while saving login"),(0,xb.exit)(1)}return r&&(J("Done \u2705"),(0,xb.exit)()),!0}async function q8(t,e){Ob(t,e,!0)}var M8="import { CapacitorUpdater } from '@capgo/capacitor-updater'",Vh="CapacitorUpdater.notifyAppReady()",qoe=/import.*from.*/g,Nl="production",U8={stdio:"pipe"},xa,Ro;function H8(){xa||(xa=(0,Ie.readdirSync)(zh.default.tmpdir).map(t=>({name:t,full:`${zh.default.tmpdir}/${t}`})).find(t=>t.name.startsWith("capgocli"))?.full??zh.default.fileSync({prefix:"capgocli"}).name)}function an(t,e){try{H8(),(0,Ie.writeFileSync)(xa,JSON.stringify(e?{step_done:t,pathToPackageJson:e}:{step_done:t,pathToPackageJson:Ro})),e&&(Ro=e)}catch(r){p.error(`Cannot mark step as done in the CLI, error: