edgeone 1.2.20 → 1.2.21
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/edgeone-dist/cli.js
CHANGED
|
@@ -519,7 +519,7 @@ ${A.join(`
|
|
|
519
519
|
`;x.forEach(A=>{b+=A}),t.fail(b)}};let f={};s.conflicts=function(g,x){Kn("<string|object> [array|string]",[g,x],arguments.length),typeof g=="object"?Object.keys(g).forEach(b=>{s.conflicts(b,g[b])}):(e.global(g),f[g]||(f[g]=[]),Array.isArray(x)?x.forEach(b=>s.conflicts(g,b)):f[g].push(x))},s.getConflicting=()=>f,s.conflicting=function(g){Object.keys(g).forEach(x=>{f[x]&&f[x].forEach(b=>{b&&g[x]!==void 0&&g[b]!==void 0&&t.fail(n("Arguments %s and %s are mutually exclusive",x,b))})}),e.getInternalMethods().getParserConfiguration()["strip-dashed"]&&Object.keys(f).forEach(x=>{f[x].forEach(b=>{b&&g[r.Parser.camelCase(x)]!==void 0&&g[r.Parser.camelCase(b)]!==void 0&&t.fail(n("Arguments %s and %s are mutually exclusive",x,b))})})},s.recommendCommands=function(g,x){x=x.sort((I,k)=>k.length-I.length);let A=null,C=1/0;for(let I=0,k;(k=x[I])!==void 0;I++){let O=BPe(g,k);O<=3&&O<C&&(C=O,A=k)}A&&t.fail(n("Did you mean %s?",A))},s.reset=function(g){return c=DC(c,x=>!g[x]),f=DC(f,x=>!g[x]),s};let d=[];return s.freeze=function(){d.push({implied:c,conflicting:f})},s.unfreeze=function(){let g=d.pop();tm(g,void 0,r),{implied:c,conflicting:f}=g},s}var Zn=function(e,t,r,n,a){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?a.call(e,r):a?a.value=r:t.set(e,r),r},qe=function(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)},ep,Dk,V3,ZA,Ng,S7,RC,Pk,C7,ey,_7,ty,Ub,Fg,ry,I7,fR,_f,wi,k7,T7,Og,Rk,dR,Nk,NC,B7,ls,Fk,Ok,Qk,bs,D7,zb,Tl;function XPe(e){return(t=[],r=e.process.cwd(),n)=>{let a=new cie(t,r,n,e);return Object.defineProperty(a,"argv",{get:()=>a.parse(),enumerable:!0}),a.help(),a.version(),a}}var RPe=Symbol("copyDoubleDash"),NPe=Symbol("copyDoubleDash"),Xne=Symbol("deleteFromParserHintObject"),FPe=Symbol("emitWarning"),OPe=Symbol("freeze"),QPe=Symbol("getDollarZero"),Lk=Symbol("getParserConfiguration"),LPe=Symbol("getUsageConfiguration"),Zne=Symbol("guessLocale"),jPe=Symbol("guessVersion"),MPe=Symbol("parsePositionalNumbers"),eie=Symbol("pkgUp"),FC=Symbol("populateParserHintArray"),hR=Symbol("populateParserHintSingleValueDictionary"),tie=Symbol("populateParserHintArrayDictionary"),rie=Symbol("populateParserHintDictionary"),nie=Symbol("sanitizeKey"),iie=Symbol("setKey"),sie=Symbol("unfreeze"),qPe=Symbol("validateAsync"),UPe=Symbol("getCommandInstance"),zPe=Symbol("getContext"),HPe=Symbol("getHasOutput"),VPe=Symbol("getLoggerInstance"),$Pe=Symbol("getParseContext"),WPe=Symbol("getUsageInstance"),GPe=Symbol("getValidationInstance"),P7=Symbol("hasParseCallback"),YPe=Symbol("isGlobalContext"),jk=Symbol("postProcess"),JPe=Symbol("rebase"),aie=Symbol("reset"),$3=Symbol("runYargsParserAndExecuteCommands"),oie=Symbol("runValidation"),KPe=Symbol("setHasOutput"),Mk=Symbol("kTrackManuallySetKeys"),cie=class{constructor(t=[],r,n,a){this.customScriptName=!1,this.parsed=!1,ep.set(this,void 0),Dk.set(this,void 0),V3.set(this,{commands:[],fullCommands:[]}),ZA.set(this,null),Ng.set(this,null),S7.set(this,"show-hidden"),RC.set(this,null),Pk.set(this,!0),C7.set(this,{}),ey.set(this,!0),_7.set(this,[]),ty.set(this,void 0),Ub.set(this,{}),Fg.set(this,!1),ry.set(this,null),I7.set(this,!0),fR.set(this,void 0),_f.set(this,""),wi.set(this,void 0),k7.set(this,void 0),T7.set(this,{}),Og.set(this,null),Rk.set(this,null),dR.set(this,{}),Nk.set(this,{}),NC.set(this,void 0),B7.set(this,!1),ls.set(this,void 0),Fk.set(this,!1),Ok.set(this,!1),Qk.set(this,!1),bs.set(this,void 0),D7.set(this,{}),zb.set(this,null),Tl.set(this,void 0),Zn(this,ls,a,"f"),Zn(this,NC,t,"f"),Zn(this,Dk,r,"f"),Zn(this,k7,n,"f"),Zn(this,ty,new b7(this),"f"),this.$0=this[QPe](),this[aie](),Zn(this,ep,qe(this,ep,"f"),"f"),Zn(this,bs,qe(this,bs,"f"),"f"),Zn(this,Tl,qe(this,Tl,"f"),"f"),Zn(this,wi,qe(this,wi,"f"),"f"),qe(this,wi,"f").showHiddenOpt=qe(this,S7,"f"),Zn(this,fR,this[NPe](),"f")}addHelpOpt(t,r){let n="help";return Kn("[string|boolean] [string]",[t,r],arguments.length),qe(this,ry,"f")&&(this[Xne](qe(this,ry,"f")),Zn(this,ry,null,"f")),t===!1&&r===void 0?this:(Zn(this,ry,typeof t=="string"?t:n,"f"),this.boolean(qe(this,ry,"f")),this.describe(qe(this,ry,"f"),r||qe(this,bs,"f").deferY18nLookup("Show help")),this)}help(t,r){return this.addHelpOpt(t,r)}addShowHiddenOpt(t,r){if(Kn("[string|boolean] [string]",[t,r],arguments.length),t===!1&&r===void 0)return this;let n=typeof t=="string"?t:qe(this,S7,"f");return this.boolean(n),this.describe(n,r||qe(this,bs,"f").deferY18nLookup("Show hidden options")),qe(this,wi,"f").showHiddenOpt=n,this}showHidden(t,r){return this.addShowHiddenOpt(t,r)}alias(t,r){return Kn("<object|string|array> [string|array]",[t,r],arguments.length),this[tie](this.alias.bind(this),"alias",t,r),this}array(t){return Kn("<array|string>",[t],arguments.length),this[FC]("array",t),this[Mk](t),this}boolean(t){return Kn("<array|string>",[t],arguments.length),this[FC]("boolean",t),this[Mk](t),this}check(t,r){return Kn("<function> [boolean]",[t,r],arguments.length),this.middleware((n,a)=>Bk(()=>t(n,a.getOptions()),s=>(s?(typeof s=="string"||s instanceof Error)&&qe(this,bs,"f").fail(s.toString(),s):qe(this,bs,"f").fail(qe(this,ls,"f").y18n.__("Argument check failed: %s",t.toString())),n),s=>(qe(this,bs,"f").fail(s.message?s.message:s.toString(),s),n)),!1,r),this}choices(t,r){return Kn("<object|string|array> [string|array]",[t,r],arguments.length),this[tie](this.choices.bind(this),"choices",t,r),this}coerce(t,r){if(Kn("<object|string|array> [function]",[t,r],arguments.length),Array.isArray(t)){if(!r)throw new uu("coerce callback must be provided");for(let n of t)this.coerce(n,r);return this}else if(typeof t=="object"){for(let n of Object.keys(t))this.coerce(n,t[n]);return this}if(!r)throw new uu("coerce callback must be provided");return qe(this,wi,"f").key[t]=!0,qe(this,ty,"f").addCoerceMiddleware((n,a)=>{let s;return Object.prototype.hasOwnProperty.call(n,t)?Bk(()=>(s=a.getAliases(),r(n[t])),l=>{n[t]=l;let f=a.getInternalMethods().getParserConfiguration()["strip-aliased"];if(s[t]&&f!==!0)for(let d of s[t])n[d]=l;return n},l=>{throw new uu(l.message)}):n},t),this}conflicts(t,r){return Kn("<string|object> [string|array]",[t,r],arguments.length),qe(this,Tl,"f").conflicts(t,r),this}config(t="config",r,n){return Kn("[object|string] [string|function] [function]",[t,r,n],arguments.length),typeof t=="object"&&!Array.isArray(t)?(t=U3(t,qe(this,Dk,"f"),this[Lk]()["deep-merge-config"]||!1,qe(this,ls,"f")),qe(this,wi,"f").configObjects=(qe(this,wi,"f").configObjects||[]).concat(t),this):(typeof r=="function"&&(n=r,r=void 0),this.describe(t,r||qe(this,bs,"f").deferY18nLookup("Path to JSON config file")),(Array.isArray(t)?t:[t]).forEach(a=>{qe(this,wi,"f").config[a]=n||!0}),this)}completion(t,r,n){return Kn("[string] [string|boolean|function] [function]",[t,r,n],arguments.length),typeof r=="function"&&(n=r,r=void 0),Zn(this,Ng,t||qe(this,Ng,"f")||"completion","f"),!r&&r!==!1&&(r="generate completion script"),this.command(qe(this,Ng,"f"),r),n&&qe(this,ZA,"f").registerFunction(n),this}command(t,r,n,a,s,c){return Kn("<string|array|object> [string|boolean] [function|object] [function] [array] [boolean|string]",[t,r,n,a,s,c],arguments.length),qe(this,ep,"f").addHandler(t,r,n,a,s,c),this}commands(t,r,n,a,s,c){return this.command(t,r,n,a,s,c)}commandDir(t,r){Kn("<string> [object]",[t,r],arguments.length);let n=qe(this,k7,"f")||qe(this,ls,"f").require;return qe(this,ep,"f").addDirectory(t,n,qe(this,ls,"f").getCallerFile(),r),this}count(t){return Kn("<array|string>",[t],arguments.length),this[FC]("count",t),this[Mk](t),this}default(t,r,n){return Kn("<object|string|array> [*] [string]",[t,r,n],arguments.length),n&&(Wne(t,qe(this,ls,"f")),qe(this,wi,"f").defaultDescription[t]=n),typeof r=="function"&&(Wne(t,qe(this,ls,"f")),qe(this,wi,"f").defaultDescription[t]||(qe(this,wi,"f").defaultDescription[t]=qe(this,bs,"f").functionDescription(r)),r=r.call()),this[hR](this.default.bind(this),"default",t,r),this}defaults(t,r,n){return this.default(t,r,n)}demandCommand(t=1,r,n,a){return Kn("[number] [number|string] [string|null|undefined] [string|null|undefined]",[t,r,n,a],arguments.length),typeof r!="number"&&(n=r,r=1/0),this.global("_",!1),qe(this,wi,"f").demandedCommands._={min:t,max:r,minMsg:n,maxMsg:a},this}demand(t,r,n){return Array.isArray(r)?(r.forEach(a=>{tm(n,!0,qe(this,ls,"f")),this.demandOption(a,n)}),r=1/0):typeof r!="number"&&(n=r,r=1/0),typeof t=="number"?(tm(n,!0,qe(this,ls,"f")),this.demandCommand(t,r,n,n)):Array.isArray(t)?t.forEach(a=>{tm(n,!0,qe(this,ls,"f")),this.demandOption(a,n)}):typeof n=="string"?this.demandOption(t,n):(n===!0||typeof n>"u")&&this.demandOption(t),this}demandOption(t,r){return Kn("<object|string|array> [string]",[t,r],arguments.length),this[hR](this.demandOption.bind(this),"demandedOptions",t,r),this}deprecateOption(t,r){return Kn("<string> [string|boolean]",[t,r],arguments.length),qe(this,wi,"f").deprecatedOptions[t]=r,this}describe(t,r){return Kn("<object|string|array> [string]",[t,r],arguments.length),this[iie](t,!0),qe(this,bs,"f").describe(t,r),this}detectLocale(t){return Kn("<boolean>",[t],arguments.length),Zn(this,Pk,t,"f"),this}env(t){return Kn("[string|boolean]",[t],arguments.length),t===!1?delete qe(this,wi,"f").envPrefix:qe(this,wi,"f").envPrefix=t||"",this}epilogue(t){return Kn("<string>",[t],arguments.length),qe(this,bs,"f").epilog(t),this}epilog(t){return this.epilogue(t)}example(t,r){return Kn("<string|array> [string]",[t,r],arguments.length),Array.isArray(t)?t.forEach(n=>this.example(...n)):qe(this,bs,"f").example(t,r),this}exit(t,r){Zn(this,Fg,!0,"f"),Zn(this,RC,r,"f"),qe(this,ey,"f")&&qe(this,ls,"f").process.exit(t)}exitProcess(t=!0){return Kn("[boolean]",[t],arguments.length),Zn(this,ey,t,"f"),this}fail(t){if(Kn("<function|boolean>",[t],arguments.length),typeof t=="boolean"&&t!==!1)throw new uu("Invalid first argument. Expected function or boolean 'false'");return qe(this,bs,"f").failFn(t),this}getAliases(){return this.parsed?this.parsed.aliases:{}}async getCompletion(t,r){return Kn("<array> [function]",[t,r],arguments.length),r?qe(this,ZA,"f").getCompletion(t,r):new Promise((n,a)=>{qe(this,ZA,"f").getCompletion(t,(s,c)=>{s?a(s):n(c)})})}getDemandedOptions(){return Kn([],0),qe(this,wi,"f").demandedOptions}getDemandedCommands(){return Kn([],0),qe(this,wi,"f").demandedCommands}getDeprecatedOptions(){return Kn([],0),qe(this,wi,"f").deprecatedOptions}getDetectLocale(){return qe(this,Pk,"f")}getExitProcess(){return qe(this,ey,"f")}getGroups(){return Object.assign({},qe(this,Ub,"f"),qe(this,Nk,"f"))}getHelp(){if(Zn(this,Fg,!0,"f"),!qe(this,bs,"f").hasCachedHelpMessage()){if(!this.parsed){let r=this[$3](qe(this,NC,"f"),void 0,void 0,0,!0);if(lu(r))return r.then(()=>qe(this,bs,"f").help())}let t=qe(this,ep,"f").runDefaultBuilderOn(this);if(lu(t))return t.then(()=>qe(this,bs,"f").help())}return Promise.resolve(qe(this,bs,"f").help())}getOptions(){return qe(this,wi,"f")}getStrict(){return qe(this,Fk,"f")}getStrictCommands(){return qe(this,Ok,"f")}getStrictOptions(){return qe(this,Qk,"f")}global(t,r){return Kn("<string|array> [boolean]",[t,r],arguments.length),t=[].concat(t),r!==!1?qe(this,wi,"f").local=qe(this,wi,"f").local.filter(n=>t.indexOf(n)===-1):t.forEach(n=>{qe(this,wi,"f").local.includes(n)||qe(this,wi,"f").local.push(n)}),this}group(t,r){Kn("<string|array> <string>",[t,r],arguments.length);let n=qe(this,Nk,"f")[r]||qe(this,Ub,"f")[r];qe(this,Nk,"f")[r]&&delete qe(this,Nk,"f")[r];let a={};return qe(this,Ub,"f")[r]=(n||[]).concat(t).filter(s=>a[s]?!1:a[s]=!0),this}hide(t){return Kn("<string>",[t],arguments.length),qe(this,wi,"f").hiddenOptions.push(t),this}implies(t,r){return Kn("<string|object> [number|string|array]",[t,r],arguments.length),qe(this,Tl,"f").implies(t,r),this}locale(t){return Kn("[string]",[t],arguments.length),t===void 0?(this[Zne](),qe(this,ls,"f").y18n.getLocale()):(Zn(this,Pk,!1,"f"),qe(this,ls,"f").y18n.setLocale(t),this)}middleware(t,r,n){return qe(this,ty,"f").addMiddleware(t,!!r,n)}nargs(t,r){return Kn("<string|object|array> [number]",[t,r],arguments.length),this[hR](this.nargs.bind(this),"narg",t,r),this}normalize(t){return Kn("<array|string>",[t],arguments.length),this[FC]("normalize",t),this}number(t){return Kn("<array|string>",[t],arguments.length),this[FC]("number",t),this[Mk](t),this}option(t,r){if(Kn("<string|object> [object]",[t,r],arguments.length),typeof t=="object")Object.keys(t).forEach(n=>{this.options(n,t[n])});else{typeof r!="object"&&(r={}),this[Mk](t),qe(this,zb,"f")&&(t==="version"||(r==null?void 0:r.alias)==="version")&&this[FPe](['"version" is a reserved word.',"Please do one of the following:",'- Disable version with `yargs.version(false)` if using "version" as an option',"- Use the built-in `yargs.version` method instead (if applicable)","- Use a different option key","https://yargs.js.org/docs/#api-reference-version"].join(`
|
|
520
520
|
`),void 0,"versionWarning"),qe(this,wi,"f").key[t]=!0,r.alias&&this.alias(t,r.alias);let n=r.deprecate||r.deprecated;n&&this.deprecateOption(t,n);let a=r.demand||r.required||r.require;a&&this.demand(t,a),r.demandOption&&this.demandOption(t,typeof r.demandOption=="string"?r.demandOption:void 0),r.conflicts&&this.conflicts(t,r.conflicts),"default"in r&&this.default(t,r.default),r.implies!==void 0&&this.implies(t,r.implies),r.nargs!==void 0&&this.nargs(t,r.nargs),r.config&&this.config(t,r.configParser),r.normalize&&this.normalize(t),r.choices&&this.choices(t,r.choices),r.coerce&&this.coerce(t,r.coerce),r.group&&this.group(t,r.group),(r.boolean||r.type==="boolean")&&(this.boolean(t),r.alias&&this.boolean(r.alias)),(r.array||r.type==="array")&&(this.array(t),r.alias&&this.array(r.alias)),(r.number||r.type==="number")&&(this.number(t),r.alias&&this.number(r.alias)),(r.string||r.type==="string")&&(this.string(t),r.alias&&this.string(r.alias)),(r.count||r.type==="count")&&this.count(t),typeof r.global=="boolean"&&this.global(t,r.global),r.defaultDescription&&(qe(this,wi,"f").defaultDescription[t]=r.defaultDescription),r.skipValidation&&this.skipValidation(t);let s=r.describe||r.description||r.desc,c=qe(this,bs,"f").getDescriptions();(!Object.prototype.hasOwnProperty.call(c,t)||typeof s=="string")&&this.describe(t,s),r.hidden&&this.hide(t),r.requiresArg&&this.requiresArg(t)}return this}options(t,r){return this.option(t,r)}parse(t,r,n){Kn("[string|array] [function|boolean|object] [function]",[t,r,n],arguments.length),this[OPe](),typeof t>"u"&&(t=qe(this,NC,"f")),typeof r=="object"&&(Zn(this,Rk,r,"f"),r=n),typeof r=="function"&&(Zn(this,Og,r,"f"),r=!1),r||Zn(this,NC,t,"f"),qe(this,Og,"f")&&Zn(this,ey,!1,"f");let a=this[$3](t,!!r),s=this.parsed;return qe(this,ZA,"f").setParsed(this.parsed),lu(a)?a.then(c=>(qe(this,Og,"f")&&qe(this,Og,"f").call(this,qe(this,RC,"f"),c,qe(this,_f,"f")),c)).catch(c=>{throw qe(this,Og,"f")&&qe(this,Og,"f")(c,this.parsed.argv,qe(this,_f,"f")),c}).finally(()=>{this[sie](),this.parsed=s}):(qe(this,Og,"f")&&qe(this,Og,"f").call(this,qe(this,RC,"f"),a,qe(this,_f,"f")),this[sie](),this.parsed=s,a)}parseAsync(t,r,n){let a=this.parse(t,r,n);return lu(a)?a:Promise.resolve(a)}parseSync(t,r,n){let a=this.parse(t,r,n);if(lu(a))throw new uu(".parseSync() must not be used with asynchronous builders, handlers, or middleware");return a}parserConfiguration(t){return Kn("<object>",[t],arguments.length),Zn(this,T7,t,"f"),this}pkgConf(t,r){Kn("<string> [string]",[t,r],arguments.length);let n=null,a=this[eie](r||qe(this,Dk,"f"));return a[t]&&typeof a[t]=="object"&&(n=U3(a[t],r||qe(this,Dk,"f"),this[Lk]()["deep-merge-config"]||!1,qe(this,ls,"f")),qe(this,wi,"f").configObjects=(qe(this,wi,"f").configObjects||[]).concat(n)),this}positional(t,r){Kn("<string> <object>",[t,r],arguments.length);let n=["default","defaultDescription","implies","normalize","choices","conflicts","coerce","type","describe","desc","description","alias"];r=DC(r,(c,l)=>c==="type"&&!["string","number","boolean"].includes(l)?!1:n.includes(c));let a=qe(this,V3,"f").fullCommands[qe(this,V3,"f").fullCommands.length-1],s=a?qe(this,ep,"f").cmdToParseOptions(a):{array:[],alias:{},default:{},demand:{}};return lR(s).forEach(c=>{let l=s[c];Array.isArray(l)?l.indexOf(t)!==-1&&(r[c]=!0):l[t]&&!(c in r)&&(r[c]=l[t])}),this.group(t,qe(this,bs,"f").getPositionalGroupName()),this.option(t,r)}recommendCommands(t=!0){return Kn("[boolean]",[t],arguments.length),Zn(this,B7,t,"f"),this}required(t,r,n){return this.demand(t,r,n)}require(t,r,n){return this.demand(t,r,n)}requiresArg(t){return Kn("<array|string|object> [number]",[t],arguments.length),typeof t=="string"&&qe(this,wi,"f").narg[t]?this:(this[hR](this.requiresArg.bind(this),"narg",t,NaN),this)}showCompletionScript(t,r){return Kn("[string] [string]",[t,r],arguments.length),t=t||this.$0,qe(this,fR,"f").log(qe(this,ZA,"f").generateCompletionScript(t,r||qe(this,Ng,"f")||"completion")),this}showHelp(t){if(Kn("[string|function]",[t],arguments.length),Zn(this,Fg,!0,"f"),!qe(this,bs,"f").hasCachedHelpMessage()){if(!this.parsed){let n=this[$3](qe(this,NC,"f"),void 0,void 0,0,!0);if(lu(n))return n.then(()=>{qe(this,bs,"f").showHelp(t)}),this}let r=qe(this,ep,"f").runDefaultBuilderOn(this);if(lu(r))return r.then(()=>{qe(this,bs,"f").showHelp(t)}),this}return qe(this,bs,"f").showHelp(t),this}scriptName(t){return this.customScriptName=!0,this.$0=t,this}showHelpOnFail(t,r){return Kn("[boolean|string] [string]",[t,r],arguments.length),qe(this,bs,"f").showHelpOnFail(t,r),this}showVersion(t){return Kn("[string|function]",[t],arguments.length),qe(this,bs,"f").showVersion(t),this}skipValidation(t){return Kn("<array|string>",[t],arguments.length),this[FC]("skipValidation",t),this}strict(t){return Kn("[boolean]",[t],arguments.length),Zn(this,Fk,t!==!1,"f"),this}strictCommands(t){return Kn("[boolean]",[t],arguments.length),Zn(this,Ok,t!==!1,"f"),this}strictOptions(t){return Kn("[boolean]",[t],arguments.length),Zn(this,Qk,t!==!1,"f"),this}string(t){return Kn("<array|string>",[t],arguments.length),this[FC]("string",t),this[Mk](t),this}terminalWidth(){return Kn([],0),qe(this,ls,"f").process.stdColumns}updateLocale(t){return this.updateStrings(t)}updateStrings(t){return Kn("<object>",[t],arguments.length),Zn(this,Pk,!1,"f"),qe(this,ls,"f").y18n.updateLocale(t),this}usage(t,r,n,a){if(Kn("<string|null|undefined> [string|boolean] [function|object] [function]",[t,r,n,a],arguments.length),r!==void 0){if(tm(t,null,qe(this,ls,"f")),(t||"").match(/^\$0( |$)/))return this.command(t,r,n,a);throw new uu(".usage() description must start with $0 if being used as alias for .command()")}else return qe(this,bs,"f").usage(t),this}usageConfiguration(t){return Kn("<object>",[t],arguments.length),Zn(this,D7,t,"f"),this}version(t,r,n){let a="version";if(Kn("[boolean|string] [string] [string]",[t,r,n],arguments.length),qe(this,zb,"f")&&(this[Xne](qe(this,zb,"f")),qe(this,bs,"f").version(void 0),Zn(this,zb,null,"f")),arguments.length===0)n=this[jPe](),t=a;else if(arguments.length===1){if(t===!1)return this;n=t,t=a}else arguments.length===2&&(n=r,r=void 0);return Zn(this,zb,typeof t=="string"?t:a,"f"),r=r||qe(this,bs,"f").deferY18nLookup("Show version number"),qe(this,bs,"f").version(n||void 0),this.boolean(qe(this,zb,"f")),this.describe(qe(this,zb,"f"),r),this}wrap(t){return Kn("<number|null|undefined>",[t],arguments.length),qe(this,bs,"f").wrap(t),this}[(ep=new WeakMap,Dk=new WeakMap,V3=new WeakMap,ZA=new WeakMap,Ng=new WeakMap,S7=new WeakMap,RC=new WeakMap,Pk=new WeakMap,C7=new WeakMap,ey=new WeakMap,_7=new WeakMap,ty=new WeakMap,Ub=new WeakMap,Fg=new WeakMap,ry=new WeakMap,I7=new WeakMap,fR=new WeakMap,_f=new WeakMap,wi=new WeakMap,k7=new WeakMap,T7=new WeakMap,Og=new WeakMap,Rk=new WeakMap,dR=new WeakMap,Nk=new WeakMap,NC=new WeakMap,B7=new WeakMap,ls=new WeakMap,Fk=new WeakMap,Ok=new WeakMap,Qk=new WeakMap,bs=new WeakMap,D7=new WeakMap,zb=new WeakMap,Tl=new WeakMap,RPe)](t){if(!t._||!t["--"])return t;t._.push.apply(t._,t["--"]);try{delete t["--"]}catch{}return t}[NPe](){return{log:(...t)=>{this[P7]()||console.log(...t),Zn(this,Fg,!0,"f"),qe(this,_f,"f").length&&Zn(this,_f,qe(this,_f,"f")+`
|
|
521
521
|
`,"f"),Zn(this,_f,qe(this,_f,"f")+t.join(" "),"f")},error:(...t)=>{this[P7]()||console.error(...t),Zn(this,Fg,!0,"f"),qe(this,_f,"f").length&&Zn(this,_f,qe(this,_f,"f")+`
|
|
522
|
-
`,"f"),Zn(this,_f,qe(this,_f,"f")+t.join(" "),"f")}}}[Xne](t){lR(qe(this,wi,"f")).forEach(r=>{if((a=>a==="configObjects")(r))return;let n=qe(this,wi,"f")[r];Array.isArray(n)?n.includes(t)&&n.splice(n.indexOf(t),1):typeof n=="object"&&delete n[t]}),delete qe(this,bs,"f").getDescriptions()[t]}[FPe](t,r,n){qe(this,C7,"f")[n]||(qe(this,ls,"f").process.emitWarning(t,r),qe(this,C7,"f")[n]=!0)}[OPe](){qe(this,_7,"f").push({options:qe(this,wi,"f"),configObjects:qe(this,wi,"f").configObjects.slice(0),exitProcess:qe(this,ey,"f"),groups:qe(this,Ub,"f"),strict:qe(this,Fk,"f"),strictCommands:qe(this,Ok,"f"),strictOptions:qe(this,Qk,"f"),completionCommand:qe(this,Ng,"f"),output:qe(this,_f,"f"),exitError:qe(this,RC,"f"),hasOutput:qe(this,Fg,"f"),parsed:this.parsed,parseFn:qe(this,Og,"f"),parseContext:qe(this,Rk,"f")}),qe(this,bs,"f").freeze(),qe(this,Tl,"f").freeze(),qe(this,ep,"f").freeze(),qe(this,ty,"f").freeze()}[QPe](){let t="",r;return/\b(node|iojs|electron)(\.exe)?$/.test(qe(this,ls,"f").process.argv()[0])?r=qe(this,ls,"f").process.argv().slice(1,2):r=qe(this,ls,"f").process.argv().slice(0,1),t=r.map(n=>{let a=this[JPe](qe(this,Dk,"f"),n);return n.match(/^(\/|([a-zA-Z]:)?\\)/)&&a.length<n.length?a:n}).join(" ").trim(),qe(this,ls,"f").getEnv("_")&&qe(this,ls,"f").getProcessArgvBin()===qe(this,ls,"f").getEnv("_")&&(t=qe(this,ls,"f").getEnv("_").replace(`${qe(this,ls,"f").path.dirname(qe(this,ls,"f").process.execPath())}/`,"")),t}[Lk](){return qe(this,T7,"f")}[LPe](){return qe(this,D7,"f")}[Zne](){if(!qe(this,Pk,"f"))return;let t=qe(this,ls,"f").getEnv("LC_ALL")||qe(this,ls,"f").getEnv("LC_MESSAGES")||qe(this,ls,"f").getEnv("LANG")||qe(this,ls,"f").getEnv("LANGUAGE")||"en_US";this.locale(t.replace(/[.:].*/,""))}[jPe](){return this[eie]().version||"unknown"}[MPe](t){let r=t["--"]?t["--"]:t._;for(let n=0,a;(a=r[n])!==void 0;n++)qe(this,ls,"f").Parser.looksLikeNumber(a)&&Number.isSafeInteger(Math.floor(parseFloat(`${a}`)))&&(r[n]=Number(a));return t}[eie](t){let r=t||"*";if(qe(this,dR,"f")[r])return qe(this,dR,"f")[r];let n={};try{let a=t||qe(this,ls,"f").mainFilename;!t&&qe(this,ls,"f").path.extname(a)&&(a=qe(this,ls,"f").path.dirname(a));let s=qe(this,ls,"f").findUp(a,(c,l)=>{if(l.includes("package.json"))return"package.json"});tm(s,void 0,qe(this,ls,"f")),n=JSON.parse(qe(this,ls,"f").readFileSync(s,"utf8"))}catch{}return qe(this,dR,"f")[r]=n||{},qe(this,dR,"f")[r]}[FC](t,r){r=[].concat(r),r.forEach(n=>{n=this[nie](n),qe(this,wi,"f")[t].push(n)})}[hR](t,r,n,a){this[rie](t,r,n,a,(s,c,l)=>{qe(this,wi,"f")[s][c]=l})}[tie](t,r,n,a){this[rie](t,r,n,a,(s,c,l)=>{qe(this,wi,"f")[s][c]=(qe(this,wi,"f")[s][c]||[]).concat(l)})}[rie](t,r,n,a,s){if(Array.isArray(n))n.forEach(c=>{t(c,a)});else if((c=>typeof c=="object")(n))for(let c of lR(n))t(c,n[c]);else s(r,this[nie](n),a)}[nie](t){return t==="__proto__"?"___proto___":t}[iie](t,r){return this[hR](this[iie].bind(this),"key",t,r),this}[sie](){var t,r,n,a,s,c,l,f,d,m,g,x;let b=qe(this,_7,"f").pop();tm(b,void 0,qe(this,ls,"f"));let A;t=this,r=this,n=this,a=this,s=this,c=this,l=this,f=this,d=this,m=this,g=this,x=this,{options:{set value(C){Zn(t,wi,C,"f")}}.value,configObjects:A,exitProcess:{set value(C){Zn(r,ey,C,"f")}}.value,groups:{set value(C){Zn(n,Ub,C,"f")}}.value,output:{set value(C){Zn(a,_f,C,"f")}}.value,exitError:{set value(C){Zn(s,RC,C,"f")}}.value,hasOutput:{set value(C){Zn(c,Fg,C,"f")}}.value,parsed:this.parsed,strict:{set value(C){Zn(l,Fk,C,"f")}}.value,strictCommands:{set value(C){Zn(f,Ok,C,"f")}}.value,strictOptions:{set value(C){Zn(d,Qk,C,"f")}}.value,completionCommand:{set value(C){Zn(m,Ng,C,"f")}}.value,parseFn:{set value(C){Zn(g,Og,C,"f")}}.value,parseContext:{set value(C){Zn(x,Rk,C,"f")}}.value}=b,qe(this,wi,"f").configObjects=A,qe(this,bs,"f").unfreeze(),qe(this,Tl,"f").unfreeze(),qe(this,ep,"f").unfreeze(),qe(this,ty,"f").unfreeze()}[qPe](t,r){return Bk(r,n=>(t(n),n))}getInternalMethods(){return{getCommandInstance:this[UPe].bind(this),getContext:this[zPe].bind(this),getHasOutput:this[HPe].bind(this),getLoggerInstance:this[VPe].bind(this),getParseContext:this[$Pe].bind(this),getParserConfiguration:this[Lk].bind(this),getUsageConfiguration:this[LPe].bind(this),getUsageInstance:this[WPe].bind(this),getValidationInstance:this[GPe].bind(this),hasParseCallback:this[P7].bind(this),isGlobalContext:this[YPe].bind(this),postProcess:this[jk].bind(this),reset:this[aie].bind(this),runValidation:this[oie].bind(this),runYargsParserAndExecuteCommands:this[$3].bind(this),setHasOutput:this[KPe].bind(this)}}[UPe](){return qe(this,ep,"f")}[zPe](){return qe(this,V3,"f")}[HPe](){return qe(this,Fg,"f")}[VPe](){return qe(this,fR,"f")}[$Pe](){return qe(this,Rk,"f")||{}}[WPe](){return qe(this,bs,"f")}[GPe](){return qe(this,Tl,"f")}[P7](){return!!qe(this,Og,"f")}[YPe](){return qe(this,I7,"f")}[jk](t,r,n,a){return n||lu(t)||(r||(t=this[RPe](t)),(this[Lk]()["parse-positional-numbers"]||this[Lk]()["parse-positional-numbers"]===void 0)&&(t=this[MPe](t)),a&&(t=Tk(t,this,qe(this,ty,"f").getMiddleware(),!1))),t}[aie](t={}){Zn(this,wi,qe(this,wi,"f")||{},"f");let r={};r.local=qe(this,wi,"f").local||[],r.configObjects=qe(this,wi,"f").configObjects||[];let n={};r.local.forEach(c=>{n[c]=!0,(t[c]||[]).forEach(l=>{n[l]=!0})}),Object.assign(qe(this,Nk,"f"),Object.keys(qe(this,Ub,"f")).reduce((c,l)=>{let f=qe(this,Ub,"f")[l].filter(d=>!(d in n));return f.length>0&&(c[l]=f),c},{})),Zn(this,Ub,{},"f");let a=["array","boolean","string","skipValidation","count","normalize","number","hiddenOptions"],s=["narg","key","alias","default","defaultDescription","config","choices","demandedOptions","demandedCommands","deprecatedOptions"];return a.forEach(c=>{r[c]=(qe(this,wi,"f")[c]||[]).filter(l=>!n[l])}),s.forEach(c=>{r[c]=DC(qe(this,wi,"f")[c],l=>!n[l])}),r.envPrefix=qe(this,wi,"f").envPrefix,Zn(this,wi,r,"f"),Zn(this,bs,qe(this,bs,"f")?qe(this,bs,"f").reset(n):_Pe(this,qe(this,ls,"f")),"f"),Zn(this,Tl,qe(this,Tl,"f")?qe(this,Tl,"f").reset(n):PPe(this,qe(this,bs,"f"),qe(this,ls,"f")),"f"),Zn(this,ep,qe(this,ep,"f")?qe(this,ep,"f").reset():wPe(qe(this,bs,"f"),qe(this,Tl,"f"),qe(this,ty,"f"),qe(this,ls,"f")),"f"),qe(this,ZA,"f")||Zn(this,ZA,TPe(this,qe(this,bs,"f"),qe(this,ep,"f"),qe(this,ls,"f")),"f"),qe(this,ty,"f").reset(),Zn(this,Ng,null,"f"),Zn(this,_f,"","f"),Zn(this,RC,null,"f"),Zn(this,Fg,!1,"f"),this.parsed=!1,this}[JPe](t,r){return qe(this,ls,"f").path.relative(t,r)}[$3](t,r,n,a=0,s=!1){let c=!!n||s;t=t||qe(this,NC,"f"),qe(this,wi,"f").__=qe(this,ls,"f").y18n.__,qe(this,wi,"f").configuration=this[Lk]();let l=!!qe(this,wi,"f").configuration["populate--"],f=Object.assign({},qe(this,wi,"f").configuration,{"populate--":!0}),d=qe(this,ls,"f").Parser.detailed(t,Object.assign({},qe(this,wi,"f"),{configuration:{"parse-positional-numbers":!1,...f}})),m=Object.assign(d.argv,qe(this,Rk,"f")),g,x=d.aliases,b=!1,A=!1;Object.keys(m).forEach(C=>{C===qe(this,ry,"f")&&m[C]?b=!0:C===qe(this,zb,"f")&&m[C]&&(A=!0)}),m.$0=this.$0,this.parsed=d,a===0&&qe(this,bs,"f").clearCachedHelpMessage();try{if(this[Zne](),r)return this[jk](m,l,!!n,!1);qe(this,ry,"f")&&[qe(this,ry,"f")].concat(x[qe(this,ry,"f")]||[]).filter(j=>j.length>1).includes(""+m._[m._.length-1])&&(m._.pop(),b=!0),Zn(this,I7,!1,"f");let C=qe(this,ep,"f").getCommands(),I=qe(this,ZA,"f").completionKey in m,k=b||I||s;if(m._.length){if(C.length){let O;for(let j=a||0,M;m._[j]!==void 0;j++)if(M=String(m._[j]),C.includes(M)&&M!==qe(this,Ng,"f")){let W=qe(this,ep,"f").runCommand(M,this,d,j+1,s,b||A||s);return this[jk](W,l,!!n,!1)}else if(!O&&M!==qe(this,Ng,"f")){O=M;break}!qe(this,ep,"f").hasDefaultCommand()&&qe(this,B7,"f")&&O&&!k&&qe(this,Tl,"f").recommendCommands(O,C)}qe(this,Ng,"f")&&m._.includes(qe(this,Ng,"f"))&&!I&&(qe(this,ey,"f")&&PC(!0),this.showCompletionScript(),this.exit(0))}if(qe(this,ep,"f").hasDefaultCommand()&&!k){let O=qe(this,ep,"f").runCommand(null,this,d,0,s,b||A||s);return this[jk](O,l,!!n,!1)}if(I){qe(this,ey,"f")&&PC(!0),t=[].concat(t);let O=t.slice(t.indexOf(`--${qe(this,ZA,"f").completionKey}`)+1);return qe(this,ZA,"f").getCompletion(O,(j,M)=>{if(j)throw new uu(j.message);(M||[]).forEach(W=>{qe(this,fR,"f").log(W)}),this.exit(0)}),this[jk](m,!l,!!n,!1)}if(qe(this,Fg,"f")||(b?(qe(this,ey,"f")&&PC(!0),c=!0,this.showHelp("log"),this.exit(0)):A&&(qe(this,ey,"f")&&PC(!0),c=!0,qe(this,bs,"f").showVersion("log"),this.exit(0))),!c&&qe(this,wi,"f").skipValidation.length>0&&(c=Object.keys(m).some(O=>qe(this,wi,"f").skipValidation.indexOf(O)>=0&&m[O]===!0)),!c){if(d.error)throw new uu(d.error.message);if(!I){let O=this[oie](x,{},d.error);n||(g=Tk(m,this,qe(this,ty,"f").getMiddleware(),!0)),g=this[qPe](O,g!=null?g:m),lu(g)&&!n&&(g=g.then(()=>Tk(m,this,qe(this,ty,"f").getMiddleware(),!1)))}}}catch(C){if(C instanceof uu)qe(this,bs,"f").fail(C.message,C);else throw C}return this[jk](g!=null?g:m,l,!!n,!0)}[oie](t,r,n,a){let s={...this.getDemandedOptions()};return c=>{if(n)throw new uu(n.message);qe(this,Tl,"f").nonOptionCount(c),qe(this,Tl,"f").requiredArguments(c,s);let l=!1;qe(this,Ok,"f")&&(l=qe(this,Tl,"f").unknownCommands(c)),qe(this,Fk,"f")&&!l?qe(this,Tl,"f").unknownArguments(c,t,r,!!a):qe(this,Qk,"f")&&qe(this,Tl,"f").unknownArguments(c,t,{},!1,!1),qe(this,Tl,"f").limitedChoices(c),qe(this,Tl,"f").implications(c),qe(this,Tl,"f").conflicting(c)}}[KPe](){Zn(this,Fg,!0,"f")}[Mk](t){if(typeof t=="string")qe(this,wi,"f").key[t]=!0;else for(let r of t)qe(this,wi,"f").key[r]=!0}};function SPe(e){return!!e&&typeof e.getInternalMethods=="function"}var t7t=XPe($ne),ZPe=t7t;var qk={name:"edgeone",version:"1.2.20",description:"Command-line interface for TencentCloud Pages Functions",bin:{edgeone:"./edgeone-bin/edgeone.js"},files:["./edgeone-bin/edgeone.js","./edgeone-dist/cli.js","./edgeone-dist/templates","./edgeone-dist/pages/dev/runner-worker.js"],author:"",keywords:["tencent","edgeone","edgefunctions","edgeone","cli","typescript"],scripts:{clean:"rimraf ./edgeone-dist ./edgeone-bin ./libs-node-ai",bundle:"node -r esbuild-register ./scripts/bundle.ts",watch:"node -r esbuild-register ./scripts/bundle.ts watch",build:"npm run clean && npm run build:pages-ai && npm run bundle","build:pages-ai":"node ./scripts/build-pages-ai.js",format:'prettier --write "src/**/*.{ts,tsx,js,jsx,json,md}" "scripts/**/*.{ts,js}" "*.{json,md}"',prepack:"npm run build",prepublishOnly:"npm run build","test:compression":"node test-compression.js"},dependencies:{"@edgeone/framework-detect":"^0.0.2","@edgeone/nuxt-pages":"^1.0.13","@edgeone/opennextjs-pages":"0.0.5",archiver:"^7.0.1",chokidar:"^4.0.1","common-path-prefix":"^1.0.0","cos-nodejs-sdk-v5":"^2.14.7","cross-spawn":"^7.0.6",crypto:"^1.0.1","detect-port":"^2.1.0",esbuild:"^0.19.2","esbuild-plugin-polyfill-node":"^0.3.0","esbuild-plugin-vue":"^0.2.4","fast-glob":"^3.3.0","fs-extra":"^11.3.1","ink-table":"^3.1.0",inquirer:"^8.2.4",install:"^0.13.0",lodash:"^4.17.21","mime-types":"^3.0.1",minimatch:"^9.0.5","node-persist":"^4.0.3",npm:"^10.9.1",open:"^8.4.2","p-map":"^5.5.0","parse-gitignore":"^2.0.0",portfinder:"^1.0.32",undici:"^5.29.0"},devDependencies:{"@babel/generator":"^7.28.0","@babel/parser":"^7.28.0","@babel/traverse":"^7.28.0","@babel/types":"^7.28.0","@tencent/capi-nodejs-sdk":"^2.3.2","@types/http-proxy":"^1.17.12","@types/inquirer":"^9.0.8","@types/ip":"^1.1.0","@types/lodash":"^4.14.198","@types/prompts":"^2.4.4","@types/react":"^17.0.2","@types/uuid":"^9.0.3","@types/ws":"^8.5.7","@types/yargs":"^17.0.24",axios:"^1.7.9",chalk:"^5.3.0",cookie:"^1.0.2",dotenv:"^16.3.1","esbuild-register":"^3.6.0",execa:"^7.1.1","http-proxy":"^1.18.1",husky:"^8.0.3",ink:"^3.2.0",ip:"^2.0.1",json5:"^2.2.3","lint-staged":"^15.2.0",lodash:"^4.17.21",moment:"^2.30.1","node-fetch":"^3.3.2",prettier:"^3.1.1",prompts:"^2.4.2",react:"^17.0.2",rimraf:"^6.0.1",semiver:"^1.1.0",sirv:"^2.0.3","tencentcloud-cls-sdk-js-web":"^1.0.13","ts-node":"^10.9.2",typescript:"^5.9.3","update-check":"^1.5.4",uuid:"^9.0.0",ws:"^8.14.2",yargs:"^17.6.2",zod:"^3.23.8","zod-to-json-schema":"^3.23.5"},engines:{node:">=12"},"lint-staged":{"*.{ts,tsx,js,jsx,json,md}":["prettier --write"]}};var uie=class{log(t,r){try{let n=this.format(r),a=JSON.stringify({key:t,value:n});process.send(a)}catch{}}format(t){return typeof t=="object"?JSON.stringify(t):typeof t=="number"?String(t):t}},n7t=new uie,R7=n7t;var bqe=_r(Cc()),Eqe=_r(DR()),wqe=_r(fae());var Z4e=_r(gae()),Jw=_r(require("fs"));var Aae=_r(require("path"));function S0(e,t){return Aae.default.join(e,t)}function di(e){return S0(process.cwd(),e)}function q4e(e){return Aae.default.dirname(e)}var Cz=X4e(),wae=require("path");function Sae(){try{Cz.initSync({dir:DWt()})}catch(e){console.error("[File] initStorage error",e)}}async function NR(e,t,r){Sae(),await Cz.setItem(e,t).catch(n=>{console.error("[File] setLocalData error",n)}),r==null||r()}async function FR(e){return Sae(),await Cz.getItem(e).catch(r=>{console.error("[File] getLocalData error",r)})}async function _z(e){Sae(),await Cz.removeItem(e).catch(t=>{console.error("[File] removeLocalData error",t)})}function DWt(){try{let e=wae.parse(process.cwd()).root,t=process.cwd(),n=wae.relative(e,t).split(wae.sep).length-2;return`${new Array(Math.max(0,n)).fill("../").join("")}.edgeone`}catch{return".edgeone"}}function eQe(e){return Jw.default.statSync(e)}function PWt(e){return Jw.default.mkdirSync(e,{recursive:!0})}function Cae(e){return Jw.default.existsSync(e)}function VL(e){return Jw.default.existsSync(e)}function Iz(e,t="utf-8"){return Jw.default.readFileSync(e,t)}function jg(e){let t=Iz(e);return JSON.parse(t)}function OR(e){let t=Iz(e);return Z4e.default.parse(t)}function Yb(e,t,r="utf-8"){let n=q4e(e);return Cae(n)||PWt(n),Jw.default.writeFileSync(e,t,r)}function _ae(e,t){return VL(e)?Jw.default.appendFileSync(e,t):Jw.default.writeFileSync(e,t)}var Ks=_r(DR()),Rs=_r(Cc()),nQe=_r(tQe());function Zk({prefix:e="cli"}){return Rs.default.createElement(Ks.Text,{color:"grey"},"[",e,"]")}function Zr(e,t="cli"){let{unmount:r}=(0,Ks.render)(Rs.default.createElement(Ks.Text,null,Rs.default.createElement(Zk,{prefix:t}),Rs.default.createElement(Ks.Text,{color:"red"},"[\u2718] "),e));r()}function ma(e,t="cli"){let{unmount:r}=(0,Ks.render)(Rs.default.createElement(Ks.Text,null,Rs.default.createElement(Zk,{prefix:t}),Rs.default.createElement(Ks.Text,{color:"green"},"[\u2714] "),e));r()}function Kw(e,t="cli"){let{unmount:r}=(0,Ks.render)(Rs.default.createElement(Ks.Text,null,Rs.default.createElement(Zk,{prefix:t}),Rs.default.createElement(Ks.Text,{color:"orange"},"\u2757\uFE0F "),e));r()}function Oc(e,t="cli"){let{unmount:r}=(0,Ks.render)(Rs.default.createElement(Ks.Text,{color:"cyan"},Rs.default.createElement(Zk,{prefix:t}),e));r()}function kz(e){let{unmount:t}=(0,Ks.render)(Rs.default.createElement(Ks.Text,{color:"cyan"},e));t()}function ei(e,t="cli"){let{unmount:r}=(0,Ks.render)(Rs.default.createElement(Ks.Text,{color:"white"},Rs.default.createElement(Zk,{prefix:t}),e));r()}function iQe(e,t,r="cli"){let n=t;t.includes("http")&&(n=new URL(t).pathname);let{unmount:a}=(0,Ks.render)(Rs.default.createElement(Ks.Text,{color:"grey"},e," ",n));a()}function kae({timestamp:e}){return Rs.default.createElement(Ks.Box,{width:13},Rs.default.createElement(Ks.Text,{color:"grey"},(0,nQe.default)(e).format("HH:mm:ss.SSS")))}function sQe(e,t){let{unmount:r}=(0,Ks.render)(Rs.default.createElement(Ks.Box,null,Rs.default.createElement(kae,{timestamp:t}),Rs.default.createElement(Ks.Text,{color:"white"},e)));r()}function aQe(e,t){let{unmount:r}=(0,Ks.render)(Rs.default.createElement(Ks.Box,null,Rs.default.createElement(kae,{timestamp:t}),Rs.default.createElement(Ks.Text,{color:"white",backgroundColor:"yellow"},"[WARNING]"),Rs.default.createElement(Ks.Text,null," ",e)));r()}function Tae(e,t){let{unmount:r}=(0,Ks.render)(Rs.default.createElement(Ks.Box,null,Rs.default.createElement(kae,{timestamp:t}),Rs.default.createElement(Ks.Text,{color:"white",backgroundColor:"red"},"[ERROR]"),Rs.default.createElement(Ks.Text,{color:"white"}," ",e)));r()}function RWt({content:e="Loading",prefix:t="cli",intervalMs:r=500,maxDots:n=6}){let[a,s]=(0,Rs.useState)("");return(0,Rs.useEffect)(()=>{let c=setInterval(()=>{s(l=>l.length>=n?"":l+".")},r);return()=>clearInterval(c)},[r,n]),Rs.default.createElement(Ks.Text,{color:"cyan"},Rs.default.createElement(Zk,{prefix:t}),e,a)}function oQe(e="Loading",t="cli",r=500,n=6){let a=(0,Ks.render)(Rs.default.createElement(RWt,{content:e,prefix:t,intervalMs:r,maxDots:n}));return{stop:()=>a.unmount()}}function rQe({percent:e,width:t=30,prefix:r="cli",label:n="Progress",color:a="cyan"}){let s=Math.max(0,Math.min(100,Math.round(e))),c=Math.round(s/100*t),l=t-c,f="\u2593".repeat(c),d="\u2591".repeat(Math.max(0,l)),m=String(s).padStart(3," ");return Rs.default.createElement(Ks.Text,null,Rs.default.createElement(Zk,{prefix:r}),Rs.default.createElement(Ks.Text,{color:a},n,": "),"[",Rs.default.createElement(Ks.Text,{color:a},f),d,"] ",m,"%")}function cQe(e="Progress",t="cli",r=30,n="cyan"){let a=0,s=(0,Ks.render)(Rs.default.createElement(rQe,{percent:a,width:r,prefix:t,label:e,color:n}));return{update:(c,l)=>{a=c;let f=l!=null?l:e;s.rerender(Rs.default.createElement(rQe,{percent:a,width:r,prefix:t,label:f,color:n}))},stop:()=>s.unmount()}}var izn=require("fs"),szn=require("path");async function $v(){return await FR("login_region")}function $L(e,t){return function(){return e.apply(t,arguments)}}var{toString:NWt}=Object.prototype,{getPrototypeOf:Dae}=Object,{iterator:Bz,toStringTag:lQe}=Symbol,Dz=(e=>t=>{let r=NWt.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),Wv=e=>(e=e.toLowerCase(),t=>Dz(t)===e),Pz=e=>t=>typeof t===e,{isArray:LR}=Array,WL=Pz("undefined");function YL(e){return e!==null&&!WL(e)&&e.constructor!==null&&!WL(e.constructor)&&C0(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}var pQe=Wv("ArrayBuffer");function FWt(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&pQe(e.buffer),t}var OWt=Pz("string"),C0=Pz("function"),fQe=Pz("number"),JL=e=>e!==null&&typeof e=="object",QWt=e=>e===!0||e===!1,Tz=e=>{if(Dz(e)!=="object")return!1;let t=Dae(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(lQe in e)&&!(Bz in e)},LWt=e=>{if(!JL(e)||YL(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},jWt=Wv("Date"),MWt=Wv("File"),qWt=Wv("Blob"),UWt=Wv("FileList"),zWt=e=>JL(e)&&C0(e.pipe),HWt=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||C0(e.append)&&((t=Dz(e))==="formdata"||t==="object"&&C0(e.toString)&&e.toString()==="[object FormData]"))},VWt=Wv("URLSearchParams"),[$Wt,WWt,GWt,YWt]=["ReadableStream","Request","Response","Headers"].map(Wv),JWt=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function KL(e,t,{allOwnKeys:r=!1}={}){if(e===null||typeof e>"u")return;let n,a;if(typeof e!="object"&&(e=[e]),LR(e))for(n=0,a=e.length;n<a;n++)t.call(null,e[n],n,e);else{if(YL(e))return;let s=r?Object.getOwnPropertyNames(e):Object.keys(e),c=s.length,l;for(n=0;n<c;n++)l=s[n],t.call(null,e[l],l,e)}}function dQe(e,t){if(YL(e))return null;t=t.toLowerCase();let r=Object.keys(e),n=r.length,a;for(;n-- >0;)if(a=r[n],t===a.toLowerCase())return a;return null}var eT=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,hQe=e=>!WL(e)&&e!==eT;function Bae(){let{caseless:e}=hQe(this)&&this||{},t={},r=(n,a)=>{let s=e&&dQe(t,a)||a;Tz(t[s])&&Tz(n)?t[s]=Bae(t[s],n):Tz(n)?t[s]=Bae({},n):LR(n)?t[s]=n.slice():t[s]=n};for(let n=0,a=arguments.length;n<a;n++)arguments[n]&&KL(arguments[n],r);return t}var KWt=(e,t,r,{allOwnKeys:n}={})=>(KL(t,(a,s)=>{r&&C0(a)?e[s]=$L(a,r):e[s]=a},{allOwnKeys:n}),e),XWt=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),ZWt=(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},eGt=(e,t,r,n)=>{let a,s,c,l={};if(t=t||{},e==null)return t;do{for(a=Object.getOwnPropertyNames(e),s=a.length;s-- >0;)c=a[s],(!n||n(c,e,t))&&!l[c]&&(t[c]=e[c],l[c]=!0);e=r!==!1&&Dae(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},tGt=(e,t,r)=>{e=String(e),(r===void 0||r>e.length)&&(r=e.length),r-=t.length;let n=e.indexOf(t,r);return n!==-1&&n===r},rGt=e=>{if(!e)return null;if(LR(e))return e;let t=e.length;if(!fQe(t))return null;let r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},nGt=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Dae(Uint8Array)),iGt=(e,t)=>{let n=(e&&e[Bz]).call(e),a;for(;(a=n.next())&&!a.done;){let s=a.value;t.call(e,s[0],s[1])}},sGt=(e,t)=>{let r,n=[];for(;(r=e.exec(t))!==null;)n.push(r);return n},aGt=Wv("HTMLFormElement"),oGt=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,n,a){return n.toUpperCase()+a}),uQe=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),cGt=Wv("RegExp"),mQe=(e,t)=>{let r=Object.getOwnPropertyDescriptors(e),n={};KL(r,(a,s)=>{let c;(c=t(a,s,e))!==!1&&(n[s]=c||a)}),Object.defineProperties(e,n)},uGt=e=>{mQe(e,(t,r)=>{if(C0(e)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;let n=e[r];if(C0(n)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},lGt=(e,t)=>{let r={},n=a=>{a.forEach(s=>{r[s]=!0})};return LR(e)?n(e):n(String(e).split(t)),r},pGt=()=>{},fGt=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function dGt(e){return!!(e&&C0(e.append)&&e[lQe]==="FormData"&&e[Bz])}var hGt=e=>{let t=new Array(10),r=(n,a)=>{if(JL(n)){if(t.indexOf(n)>=0)return;if(YL(n))return n;if(!("toJSON"in n)){t[a]=n;let s=LR(n)?[]:{};return KL(n,(c,l)=>{let f=r(c,a+1);!WL(f)&&(s[l]=f)}),t[a]=void 0,s}}return n};return r(e,0)},mGt=Wv("AsyncFunction"),gGt=e=>e&&(JL(e)||C0(e))&&C0(e.then)&&C0(e.catch),gQe=((e,t)=>e?setImmediate:t?((r,n)=>(eT.addEventListener("message",({source:a,data:s})=>{a===eT&&s===r&&n.length&&n.shift()()},!1),a=>{n.push(a),eT.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",C0(eT.postMessage)),AGt=typeof queueMicrotask<"u"?queueMicrotask.bind(eT):typeof process<"u"&&process.nextTick||gQe,yGt=e=>e!=null&&C0(e[Bz]),bt={isArray:LR,isArrayBuffer:pQe,isBuffer:YL,isFormData:HWt,isArrayBufferView:FWt,isString:OWt,isNumber:fQe,isBoolean:QWt,isObject:JL,isPlainObject:Tz,isEmptyObject:LWt,isReadableStream:$Wt,isRequest:WWt,isResponse:GWt,isHeaders:YWt,isUndefined:WL,isDate:jWt,isFile:MWt,isBlob:qWt,isRegExp:cGt,isFunction:C0,isStream:zWt,isURLSearchParams:VWt,isTypedArray:nGt,isFileList:UWt,forEach:KL,merge:Bae,extend:KWt,trim:JWt,stripBOM:XWt,inherits:ZWt,toFlatObject:eGt,kindOf:Dz,kindOfTest:Wv,endsWith:tGt,toArray:rGt,forEachEntry:iGt,matchAll:sGt,isHTMLForm:aGt,hasOwnProperty:uQe,hasOwnProp:uQe,reduceDescriptors:mQe,freezeMethods:uGt,toObjectSet:lGt,toCamelCase:oGt,noop:pGt,toFiniteNumber:fGt,findKey:dQe,global:eT,isContextDefined:hQe,isSpecCompliantForm:dGt,toJSONObject:hGt,isAsyncFn:mGt,isThenable:gGt,setImmediate:gQe,asap:AGt,isIterable:yGt};function jR(e,t,r,n,a){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),n&&(this.request=n),a&&(this.response=a,this.status=a.status?a.status:null)}bt.inherits(jR,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:bt.toJSONObject(this.config),code:this.code,status:this.status}}});var AQe=jR.prototype,yQe={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{yQe[e]={value:e}});Object.defineProperties(jR,yQe);Object.defineProperty(AQe,"isAxiosError",{value:!0});jR.from=(e,t,r,n,a,s)=>{let c=Object.create(AQe);return bt.toFlatObject(e,c,function(f){return f!==Error.prototype},l=>l!=="isAxiosError"),jR.call(c,e.message,t,r,n,a),c.cause=e,c.name=e.name,s&&Object.assign(c,s),c};var Cn=jR;var xLe=_r(vLe(),1),Hz=xLe.default;function Xae(e){return bt.isPlainObject(e)||bt.isArray(e)}function ELe(e){return bt.endsWith(e,"[]")?e.slice(0,-2):e}function bLe(e,t,r){return e?e.concat(t).map(function(a,s){return a=ELe(a),!r&&s?"["+a+"]":a}).join(r?".":""):t}function nJt(e){return bt.isArray(e)&&!e.some(Xae)}var iJt=bt.toFlatObject(bt,{},null,function(t){return/^is[A-Z]/.test(t)});function sJt(e,t,r){if(!bt.isObject(e))throw new TypeError("target must be an object");t=t||new(Hz||FormData),r=bt.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(C,I){return!bt.isUndefined(I[C])});let n=r.metaTokens,a=r.visitor||m,s=r.dots,c=r.indexes,f=(r.Blob||typeof Blob<"u"&&Blob)&&bt.isSpecCompliantForm(t);if(!bt.isFunction(a))throw new TypeError("visitor must be a function");function d(A){if(A===null)return"";if(bt.isDate(A))return A.toISOString();if(bt.isBoolean(A))return A.toString();if(!f&&bt.isBlob(A))throw new Cn("Blob is not supported. Use a Buffer instead.");return bt.isArrayBuffer(A)||bt.isTypedArray(A)?f&&typeof Blob=="function"?new Blob([A]):Buffer.from(A):A}function m(A,C,I){let k=A;if(A&&!I&&typeof A=="object"){if(bt.endsWith(C,"{}"))C=n?C:C.slice(0,-2),A=JSON.stringify(A);else if(bt.isArray(A)&&nJt(A)||(bt.isFileList(A)||bt.endsWith(C,"[]"))&&(k=bt.toArray(A)))return C=ELe(C),k.forEach(function(j,M){!(bt.isUndefined(j)||j===null)&&t.append(c===!0?bLe([C],M,s):c===null?C:C+"[]",d(j))}),!1}return Xae(A)?!0:(t.append(bLe(I,C,s),d(A)),!1)}let g=[],x=Object.assign(iJt,{defaultVisitor:m,convertValue:d,isVisitable:Xae});function b(A,C){if(!bt.isUndefined(A)){if(g.indexOf(A)!==-1)throw Error("Circular reference detected in "+C.join("."));g.push(A),bt.forEach(A,function(k,O){(!(bt.isUndefined(k)||k===null)&&a.call(t,k,bt.isString(O)?O.trim():O,C,x))===!0&&b(k,C?C.concat(O):[O])}),g.pop()}}if(!bt.isObject(e))throw new TypeError("data must be an object");return b(e),t}var UC=sJt;function wLe(e){let t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(n){return t[n]})}function SLe(e,t){this._pairs=[],e&&UC(e,this,t)}var CLe=SLe.prototype;CLe.append=function(t,r){this._pairs.push([t,r])};CLe.toString=function(t){let r=t?function(n){return t.call(this,n,wLe)}:wLe;return this._pairs.map(function(a){return r(a[0])+"="+r(a[1])},"").join("&")};var _Le=SLe;function aJt(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function rT(e,t,r){if(!t)return e;let n=r&&r.encode||aJt;bt.isFunction(r)&&(r={serialize:r});let a=r&&r.serialize,s;if(a?s=a(t,r):s=bt.isURLSearchParams(t)?t.toString():new _Le(t,r).toString(n),s){let c=e.indexOf("#");c!==-1&&(e=e.slice(0,c)),e+=(e.indexOf("?")===-1?"?":"&")+s}return e}var Zae=class{constructor(){this.handlers=[]}use(t,r,n){return this.handlers.push({fulfilled:t,rejected:r,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){bt.forEach(this.handlers,function(n){n!==null&&t(n)})}},eoe=Zae;var HR={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1};var BLe=_r(require("crypto"),1);var ILe=_r(require("url"),1),kLe=ILe.default.URLSearchParams;var toe="abcdefghijklmnopqrstuvwxyz",TLe="0123456789",DLe={DIGIT:TLe,ALPHA:toe,ALPHA_DIGIT:toe+toe.toUpperCase()+TLe},oJt=(e=16,t=DLe.ALPHA_DIGIT)=>{let r="",{length:n}=t,a=new Uint32Array(e);BLe.default.randomFillSync(a);for(let s=0;s<e;s++)r+=t[a[s]%n];return r},PLe={isNode:!0,classes:{URLSearchParams:kLe,FormData:Hz,Blob:typeof Blob<"u"&&Blob||null},ALPHABET:DLe,generateString:oJt,protocols:["http","https","file","data"]};var ioe={};GDe(ioe,{hasBrowserEnv:()=>noe,hasStandardBrowserEnv:()=>cJt,hasStandardBrowserWebWorkerEnv:()=>uJt,navigator:()=>roe,origin:()=>lJt});var noe=typeof window<"u"&&typeof document<"u",roe=typeof navigator=="object"&&navigator||void 0,cJt=noe&&(!roe||["ReactNative","NativeScript","NS"].indexOf(roe.product)<0),uJt=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",lJt=noe&&window.location.href||"http://localhost";var Po={...ioe,...PLe};function soe(e,t){return UC(e,new Po.classes.URLSearchParams,{visitor:function(r,n,a,s){return Po.isNode&&bt.isBuffer(r)?(this.append(n,r.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)},...t})}function pJt(e){return bt.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function fJt(e){let t={},r=Object.keys(e),n,a=r.length,s;for(n=0;n<a;n++)s=r[n],t[s]=e[s];return t}function dJt(e){function t(r,n,a,s){let c=r[s++];if(c==="__proto__")return!0;let l=Number.isFinite(+c),f=s>=r.length;return c=!c&&bt.isArray(a)?a.length:c,f?(bt.hasOwnProp(a,c)?a[c]=[a[c],n]:a[c]=n,!l):((!a[c]||!bt.isObject(a[c]))&&(a[c]=[]),t(r,n,a[c],s)&&bt.isArray(a[c])&&(a[c]=fJt(a[c])),!l)}if(bt.isFormData(e)&&bt.isFunction(e.entries)){let r={};return bt.forEachEntry(e,(n,a)=>{t(pJt(n),a,r,0)}),r}return null}var Vz=dJt;function hJt(e,t,r){if(bt.isString(e))try{return(t||JSON.parse)(e),bt.trim(e)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(e)}var aoe={transitional:HR,adapter:["xhr","http","fetch"],transformRequest:[function(t,r){let n=r.getContentType()||"",a=n.indexOf("application/json")>-1,s=bt.isObject(t);if(s&&bt.isHTMLForm(t)&&(t=new FormData(t)),bt.isFormData(t))return a?JSON.stringify(Vz(t)):t;if(bt.isArrayBuffer(t)||bt.isBuffer(t)||bt.isStream(t)||bt.isFile(t)||bt.isBlob(t)||bt.isReadableStream(t))return t;if(bt.isArrayBufferView(t))return t.buffer;if(bt.isURLSearchParams(t))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let l;if(s){if(n.indexOf("application/x-www-form-urlencoded")>-1)return soe(t,this.formSerializer).toString();if((l=bt.isFileList(t))||n.indexOf("multipart/form-data")>-1){let f=this.env&&this.env.FormData;return UC(l?{"files[]":t}:t,f&&new f,this.formSerializer)}}return s||a?(r.setContentType("application/json",!1),hJt(t)):t}],transformResponse:[function(t){let r=this.transitional||aoe.transitional,n=r&&r.forcedJSONParsing,a=this.responseType==="json";if(bt.isResponse(t)||bt.isReadableStream(t))return t;if(t&&bt.isString(t)&&(n&&!this.responseType||a)){let c=!(r&&r.silentJSONParsing)&&a;try{return JSON.parse(t)}catch(l){if(c)throw l.name==="SyntaxError"?Cn.from(l,Cn.ERR_BAD_RESPONSE,this,null,this.response):l}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Po.classes.FormData,Blob:Po.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};bt.forEach(["delete","get","head","post","put","patch"],e=>{aoe.headers[e]={}});var VR=aoe;var mJt=bt.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),RLe=e=>{let t={},r,n,a;return e&&e.split(`
|
|
522
|
+
`,"f"),Zn(this,_f,qe(this,_f,"f")+t.join(" "),"f")}}}[Xne](t){lR(qe(this,wi,"f")).forEach(r=>{if((a=>a==="configObjects")(r))return;let n=qe(this,wi,"f")[r];Array.isArray(n)?n.includes(t)&&n.splice(n.indexOf(t),1):typeof n=="object"&&delete n[t]}),delete qe(this,bs,"f").getDescriptions()[t]}[FPe](t,r,n){qe(this,C7,"f")[n]||(qe(this,ls,"f").process.emitWarning(t,r),qe(this,C7,"f")[n]=!0)}[OPe](){qe(this,_7,"f").push({options:qe(this,wi,"f"),configObjects:qe(this,wi,"f").configObjects.slice(0),exitProcess:qe(this,ey,"f"),groups:qe(this,Ub,"f"),strict:qe(this,Fk,"f"),strictCommands:qe(this,Ok,"f"),strictOptions:qe(this,Qk,"f"),completionCommand:qe(this,Ng,"f"),output:qe(this,_f,"f"),exitError:qe(this,RC,"f"),hasOutput:qe(this,Fg,"f"),parsed:this.parsed,parseFn:qe(this,Og,"f"),parseContext:qe(this,Rk,"f")}),qe(this,bs,"f").freeze(),qe(this,Tl,"f").freeze(),qe(this,ep,"f").freeze(),qe(this,ty,"f").freeze()}[QPe](){let t="",r;return/\b(node|iojs|electron)(\.exe)?$/.test(qe(this,ls,"f").process.argv()[0])?r=qe(this,ls,"f").process.argv().slice(1,2):r=qe(this,ls,"f").process.argv().slice(0,1),t=r.map(n=>{let a=this[JPe](qe(this,Dk,"f"),n);return n.match(/^(\/|([a-zA-Z]:)?\\)/)&&a.length<n.length?a:n}).join(" ").trim(),qe(this,ls,"f").getEnv("_")&&qe(this,ls,"f").getProcessArgvBin()===qe(this,ls,"f").getEnv("_")&&(t=qe(this,ls,"f").getEnv("_").replace(`${qe(this,ls,"f").path.dirname(qe(this,ls,"f").process.execPath())}/`,"")),t}[Lk](){return qe(this,T7,"f")}[LPe](){return qe(this,D7,"f")}[Zne](){if(!qe(this,Pk,"f"))return;let t=qe(this,ls,"f").getEnv("LC_ALL")||qe(this,ls,"f").getEnv("LC_MESSAGES")||qe(this,ls,"f").getEnv("LANG")||qe(this,ls,"f").getEnv("LANGUAGE")||"en_US";this.locale(t.replace(/[.:].*/,""))}[jPe](){return this[eie]().version||"unknown"}[MPe](t){let r=t["--"]?t["--"]:t._;for(let n=0,a;(a=r[n])!==void 0;n++)qe(this,ls,"f").Parser.looksLikeNumber(a)&&Number.isSafeInteger(Math.floor(parseFloat(`${a}`)))&&(r[n]=Number(a));return t}[eie](t){let r=t||"*";if(qe(this,dR,"f")[r])return qe(this,dR,"f")[r];let n={};try{let a=t||qe(this,ls,"f").mainFilename;!t&&qe(this,ls,"f").path.extname(a)&&(a=qe(this,ls,"f").path.dirname(a));let s=qe(this,ls,"f").findUp(a,(c,l)=>{if(l.includes("package.json"))return"package.json"});tm(s,void 0,qe(this,ls,"f")),n=JSON.parse(qe(this,ls,"f").readFileSync(s,"utf8"))}catch{}return qe(this,dR,"f")[r]=n||{},qe(this,dR,"f")[r]}[FC](t,r){r=[].concat(r),r.forEach(n=>{n=this[nie](n),qe(this,wi,"f")[t].push(n)})}[hR](t,r,n,a){this[rie](t,r,n,a,(s,c,l)=>{qe(this,wi,"f")[s][c]=l})}[tie](t,r,n,a){this[rie](t,r,n,a,(s,c,l)=>{qe(this,wi,"f")[s][c]=(qe(this,wi,"f")[s][c]||[]).concat(l)})}[rie](t,r,n,a,s){if(Array.isArray(n))n.forEach(c=>{t(c,a)});else if((c=>typeof c=="object")(n))for(let c of lR(n))t(c,n[c]);else s(r,this[nie](n),a)}[nie](t){return t==="__proto__"?"___proto___":t}[iie](t,r){return this[hR](this[iie].bind(this),"key",t,r),this}[sie](){var t,r,n,a,s,c,l,f,d,m,g,x;let b=qe(this,_7,"f").pop();tm(b,void 0,qe(this,ls,"f"));let A;t=this,r=this,n=this,a=this,s=this,c=this,l=this,f=this,d=this,m=this,g=this,x=this,{options:{set value(C){Zn(t,wi,C,"f")}}.value,configObjects:A,exitProcess:{set value(C){Zn(r,ey,C,"f")}}.value,groups:{set value(C){Zn(n,Ub,C,"f")}}.value,output:{set value(C){Zn(a,_f,C,"f")}}.value,exitError:{set value(C){Zn(s,RC,C,"f")}}.value,hasOutput:{set value(C){Zn(c,Fg,C,"f")}}.value,parsed:this.parsed,strict:{set value(C){Zn(l,Fk,C,"f")}}.value,strictCommands:{set value(C){Zn(f,Ok,C,"f")}}.value,strictOptions:{set value(C){Zn(d,Qk,C,"f")}}.value,completionCommand:{set value(C){Zn(m,Ng,C,"f")}}.value,parseFn:{set value(C){Zn(g,Og,C,"f")}}.value,parseContext:{set value(C){Zn(x,Rk,C,"f")}}.value}=b,qe(this,wi,"f").configObjects=A,qe(this,bs,"f").unfreeze(),qe(this,Tl,"f").unfreeze(),qe(this,ep,"f").unfreeze(),qe(this,ty,"f").unfreeze()}[qPe](t,r){return Bk(r,n=>(t(n),n))}getInternalMethods(){return{getCommandInstance:this[UPe].bind(this),getContext:this[zPe].bind(this),getHasOutput:this[HPe].bind(this),getLoggerInstance:this[VPe].bind(this),getParseContext:this[$Pe].bind(this),getParserConfiguration:this[Lk].bind(this),getUsageConfiguration:this[LPe].bind(this),getUsageInstance:this[WPe].bind(this),getValidationInstance:this[GPe].bind(this),hasParseCallback:this[P7].bind(this),isGlobalContext:this[YPe].bind(this),postProcess:this[jk].bind(this),reset:this[aie].bind(this),runValidation:this[oie].bind(this),runYargsParserAndExecuteCommands:this[$3].bind(this),setHasOutput:this[KPe].bind(this)}}[UPe](){return qe(this,ep,"f")}[zPe](){return qe(this,V3,"f")}[HPe](){return qe(this,Fg,"f")}[VPe](){return qe(this,fR,"f")}[$Pe](){return qe(this,Rk,"f")||{}}[WPe](){return qe(this,bs,"f")}[GPe](){return qe(this,Tl,"f")}[P7](){return!!qe(this,Og,"f")}[YPe](){return qe(this,I7,"f")}[jk](t,r,n,a){return n||lu(t)||(r||(t=this[RPe](t)),(this[Lk]()["parse-positional-numbers"]||this[Lk]()["parse-positional-numbers"]===void 0)&&(t=this[MPe](t)),a&&(t=Tk(t,this,qe(this,ty,"f").getMiddleware(),!1))),t}[aie](t={}){Zn(this,wi,qe(this,wi,"f")||{},"f");let r={};r.local=qe(this,wi,"f").local||[],r.configObjects=qe(this,wi,"f").configObjects||[];let n={};r.local.forEach(c=>{n[c]=!0,(t[c]||[]).forEach(l=>{n[l]=!0})}),Object.assign(qe(this,Nk,"f"),Object.keys(qe(this,Ub,"f")).reduce((c,l)=>{let f=qe(this,Ub,"f")[l].filter(d=>!(d in n));return f.length>0&&(c[l]=f),c},{})),Zn(this,Ub,{},"f");let a=["array","boolean","string","skipValidation","count","normalize","number","hiddenOptions"],s=["narg","key","alias","default","defaultDescription","config","choices","demandedOptions","demandedCommands","deprecatedOptions"];return a.forEach(c=>{r[c]=(qe(this,wi,"f")[c]||[]).filter(l=>!n[l])}),s.forEach(c=>{r[c]=DC(qe(this,wi,"f")[c],l=>!n[l])}),r.envPrefix=qe(this,wi,"f").envPrefix,Zn(this,wi,r,"f"),Zn(this,bs,qe(this,bs,"f")?qe(this,bs,"f").reset(n):_Pe(this,qe(this,ls,"f")),"f"),Zn(this,Tl,qe(this,Tl,"f")?qe(this,Tl,"f").reset(n):PPe(this,qe(this,bs,"f"),qe(this,ls,"f")),"f"),Zn(this,ep,qe(this,ep,"f")?qe(this,ep,"f").reset():wPe(qe(this,bs,"f"),qe(this,Tl,"f"),qe(this,ty,"f"),qe(this,ls,"f")),"f"),qe(this,ZA,"f")||Zn(this,ZA,TPe(this,qe(this,bs,"f"),qe(this,ep,"f"),qe(this,ls,"f")),"f"),qe(this,ty,"f").reset(),Zn(this,Ng,null,"f"),Zn(this,_f,"","f"),Zn(this,RC,null,"f"),Zn(this,Fg,!1,"f"),this.parsed=!1,this}[JPe](t,r){return qe(this,ls,"f").path.relative(t,r)}[$3](t,r,n,a=0,s=!1){let c=!!n||s;t=t||qe(this,NC,"f"),qe(this,wi,"f").__=qe(this,ls,"f").y18n.__,qe(this,wi,"f").configuration=this[Lk]();let l=!!qe(this,wi,"f").configuration["populate--"],f=Object.assign({},qe(this,wi,"f").configuration,{"populate--":!0}),d=qe(this,ls,"f").Parser.detailed(t,Object.assign({},qe(this,wi,"f"),{configuration:{"parse-positional-numbers":!1,...f}})),m=Object.assign(d.argv,qe(this,Rk,"f")),g,x=d.aliases,b=!1,A=!1;Object.keys(m).forEach(C=>{C===qe(this,ry,"f")&&m[C]?b=!0:C===qe(this,zb,"f")&&m[C]&&(A=!0)}),m.$0=this.$0,this.parsed=d,a===0&&qe(this,bs,"f").clearCachedHelpMessage();try{if(this[Zne](),r)return this[jk](m,l,!!n,!1);qe(this,ry,"f")&&[qe(this,ry,"f")].concat(x[qe(this,ry,"f")]||[]).filter(j=>j.length>1).includes(""+m._[m._.length-1])&&(m._.pop(),b=!0),Zn(this,I7,!1,"f");let C=qe(this,ep,"f").getCommands(),I=qe(this,ZA,"f").completionKey in m,k=b||I||s;if(m._.length){if(C.length){let O;for(let j=a||0,M;m._[j]!==void 0;j++)if(M=String(m._[j]),C.includes(M)&&M!==qe(this,Ng,"f")){let W=qe(this,ep,"f").runCommand(M,this,d,j+1,s,b||A||s);return this[jk](W,l,!!n,!1)}else if(!O&&M!==qe(this,Ng,"f")){O=M;break}!qe(this,ep,"f").hasDefaultCommand()&&qe(this,B7,"f")&&O&&!k&&qe(this,Tl,"f").recommendCommands(O,C)}qe(this,Ng,"f")&&m._.includes(qe(this,Ng,"f"))&&!I&&(qe(this,ey,"f")&&PC(!0),this.showCompletionScript(),this.exit(0))}if(qe(this,ep,"f").hasDefaultCommand()&&!k){let O=qe(this,ep,"f").runCommand(null,this,d,0,s,b||A||s);return this[jk](O,l,!!n,!1)}if(I){qe(this,ey,"f")&&PC(!0),t=[].concat(t);let O=t.slice(t.indexOf(`--${qe(this,ZA,"f").completionKey}`)+1);return qe(this,ZA,"f").getCompletion(O,(j,M)=>{if(j)throw new uu(j.message);(M||[]).forEach(W=>{qe(this,fR,"f").log(W)}),this.exit(0)}),this[jk](m,!l,!!n,!1)}if(qe(this,Fg,"f")||(b?(qe(this,ey,"f")&&PC(!0),c=!0,this.showHelp("log"),this.exit(0)):A&&(qe(this,ey,"f")&&PC(!0),c=!0,qe(this,bs,"f").showVersion("log"),this.exit(0))),!c&&qe(this,wi,"f").skipValidation.length>0&&(c=Object.keys(m).some(O=>qe(this,wi,"f").skipValidation.indexOf(O)>=0&&m[O]===!0)),!c){if(d.error)throw new uu(d.error.message);if(!I){let O=this[oie](x,{},d.error);n||(g=Tk(m,this,qe(this,ty,"f").getMiddleware(),!0)),g=this[qPe](O,g!=null?g:m),lu(g)&&!n&&(g=g.then(()=>Tk(m,this,qe(this,ty,"f").getMiddleware(),!1)))}}}catch(C){if(C instanceof uu)qe(this,bs,"f").fail(C.message,C);else throw C}return this[jk](g!=null?g:m,l,!!n,!0)}[oie](t,r,n,a){let s={...this.getDemandedOptions()};return c=>{if(n)throw new uu(n.message);qe(this,Tl,"f").nonOptionCount(c),qe(this,Tl,"f").requiredArguments(c,s);let l=!1;qe(this,Ok,"f")&&(l=qe(this,Tl,"f").unknownCommands(c)),qe(this,Fk,"f")&&!l?qe(this,Tl,"f").unknownArguments(c,t,r,!!a):qe(this,Qk,"f")&&qe(this,Tl,"f").unknownArguments(c,t,{},!1,!1),qe(this,Tl,"f").limitedChoices(c),qe(this,Tl,"f").implications(c),qe(this,Tl,"f").conflicting(c)}}[KPe](){Zn(this,Fg,!0,"f")}[Mk](t){if(typeof t=="string")qe(this,wi,"f").key[t]=!0;else for(let r of t)qe(this,wi,"f").key[r]=!0}};function SPe(e){return!!e&&typeof e.getInternalMethods=="function"}var t7t=XPe($ne),ZPe=t7t;var qk={name:"edgeone",version:"1.2.21",description:"Command-line interface for TencentCloud Pages Functions",bin:{edgeone:"./edgeone-bin/edgeone.js"},files:["./edgeone-bin/edgeone.js","./edgeone-dist/cli.js","./edgeone-dist/templates","./edgeone-dist/pages/dev/runner-worker.js"],author:"",keywords:["tencent","edgeone","edgefunctions","edgeone","cli","typescript"],scripts:{clean:"rimraf ./edgeone-dist ./edgeone-bin ./libs-node-ai",bundle:"node -r esbuild-register ./scripts/bundle.ts",watch:"node -r esbuild-register ./scripts/bundle.ts watch",build:"npm run clean && npm run build:pages-ai && npm run bundle","build:pages-ai":"node ./scripts/build-pages-ai.js",format:'prettier --write "src/**/*.{ts,tsx,js,jsx,json,md}" "scripts/**/*.{ts,js}" "*.{json,md}"',prepack:"npm run build",prepublishOnly:"npm run build","test:compression":"node test-compression.js"},dependencies:{"@edgeone/framework-detect":"^0.0.2","@edgeone/nuxt-pages":"^1.0.13","@edgeone/opennextjs-pages":"0.0.5",archiver:"^7.0.1",chokidar:"^4.0.1","common-path-prefix":"^1.0.0","cos-nodejs-sdk-v5":"^2.14.7","cross-spawn":"^7.0.6",crypto:"^1.0.1","detect-port":"^2.1.0",esbuild:"^0.19.2","esbuild-plugin-polyfill-node":"^0.3.0","esbuild-plugin-vue":"^0.2.4","fast-glob":"^3.3.0","fs-extra":"^11.3.1","ink-table":"^3.1.0",inquirer:"^8.2.4",install:"^0.13.0",lodash:"^4.17.21","mime-types":"^3.0.1",minimatch:"^9.0.5","node-persist":"^4.0.3",npm:"^10.9.1",open:"^8.4.2","p-map":"^5.5.0","parse-gitignore":"^2.0.0",portfinder:"^1.0.32",undici:"^5.29.0"},devDependencies:{"@babel/generator":"^7.28.0","@babel/parser":"^7.28.0","@babel/traverse":"^7.28.0","@babel/types":"^7.28.0","@tencent/capi-nodejs-sdk":"^2.3.2","@types/http-proxy":"^1.17.12","@types/inquirer":"^9.0.8","@types/ip":"^1.1.0","@types/lodash":"^4.14.198","@types/prompts":"^2.4.4","@types/react":"^17.0.2","@types/uuid":"^9.0.3","@types/ws":"^8.5.7","@types/yargs":"^17.0.24",axios:"^1.7.9",chalk:"^5.3.0",cookie:"^1.0.2",dotenv:"^16.3.1","esbuild-register":"^3.6.0",execa:"^7.1.1","http-proxy":"^1.18.1",husky:"^8.0.3",ink:"^3.2.0",ip:"^2.0.1",json5:"^2.2.3","lint-staged":"^15.2.0",lodash:"^4.17.21",moment:"^2.30.1","node-fetch":"^3.3.2",prettier:"^3.1.1",prompts:"^2.4.2",react:"^17.0.2",rimraf:"^6.0.1",semiver:"^1.1.0",sirv:"^2.0.3","tencentcloud-cls-sdk-js-web":"^1.0.13","ts-node":"^10.9.2",typescript:"^5.9.3","update-check":"^1.5.4",uuid:"^9.0.0",ws:"^8.14.2",yargs:"^17.6.2",zod:"^3.23.8","zod-to-json-schema":"^3.23.5"},engines:{node:">=12"},"lint-staged":{"*.{ts,tsx,js,jsx,json,md}":["prettier --write"]}};var uie=class{log(t,r){try{let n=this.format(r),a=JSON.stringify({key:t,value:n});process.send(a)}catch{}}format(t){return typeof t=="object"?JSON.stringify(t):typeof t=="number"?String(t):t}},n7t=new uie,R7=n7t;var bqe=_r(Cc()),Eqe=_r(DR()),wqe=_r(fae());var Z4e=_r(gae()),Jw=_r(require("fs"));var Aae=_r(require("path"));function S0(e,t){return Aae.default.join(e,t)}function di(e){return S0(process.cwd(),e)}function q4e(e){return Aae.default.dirname(e)}var Cz=X4e(),wae=require("path");function Sae(){try{Cz.initSync({dir:DWt()})}catch(e){console.error("[File] initStorage error",e)}}async function NR(e,t,r){Sae(),await Cz.setItem(e,t).catch(n=>{console.error("[File] setLocalData error",n)}),r==null||r()}async function FR(e){return Sae(),await Cz.getItem(e).catch(r=>{console.error("[File] getLocalData error",r)})}async function _z(e){Sae(),await Cz.removeItem(e).catch(t=>{console.error("[File] removeLocalData error",t)})}function DWt(){try{let e=wae.parse(process.cwd()).root,t=process.cwd(),n=wae.relative(e,t).split(wae.sep).length-2;return`${new Array(Math.max(0,n)).fill("../").join("")}.edgeone`}catch{return".edgeone"}}function eQe(e){return Jw.default.statSync(e)}function PWt(e){return Jw.default.mkdirSync(e,{recursive:!0})}function Cae(e){return Jw.default.existsSync(e)}function VL(e){return Jw.default.existsSync(e)}function Iz(e,t="utf-8"){return Jw.default.readFileSync(e,t)}function jg(e){let t=Iz(e);return JSON.parse(t)}function OR(e){let t=Iz(e);return Z4e.default.parse(t)}function Yb(e,t,r="utf-8"){let n=q4e(e);return Cae(n)||PWt(n),Jw.default.writeFileSync(e,t,r)}function _ae(e,t){return VL(e)?Jw.default.appendFileSync(e,t):Jw.default.writeFileSync(e,t)}var Ks=_r(DR()),Rs=_r(Cc()),nQe=_r(tQe());function Zk({prefix:e="cli"}){return Rs.default.createElement(Ks.Text,{color:"grey"},"[",e,"]")}function Zr(e,t="cli"){let{unmount:r}=(0,Ks.render)(Rs.default.createElement(Ks.Text,null,Rs.default.createElement(Zk,{prefix:t}),Rs.default.createElement(Ks.Text,{color:"red"},"[\u2718] "),e));r()}function ma(e,t="cli"){let{unmount:r}=(0,Ks.render)(Rs.default.createElement(Ks.Text,null,Rs.default.createElement(Zk,{prefix:t}),Rs.default.createElement(Ks.Text,{color:"green"},"[\u2714] "),e));r()}function Kw(e,t="cli"){let{unmount:r}=(0,Ks.render)(Rs.default.createElement(Ks.Text,null,Rs.default.createElement(Zk,{prefix:t}),Rs.default.createElement(Ks.Text,{color:"orange"},"\u2757\uFE0F "),e));r()}function Oc(e,t="cli"){let{unmount:r}=(0,Ks.render)(Rs.default.createElement(Ks.Text,{color:"cyan"},Rs.default.createElement(Zk,{prefix:t}),e));r()}function kz(e){let{unmount:t}=(0,Ks.render)(Rs.default.createElement(Ks.Text,{color:"cyan"},e));t()}function ei(e,t="cli"){let{unmount:r}=(0,Ks.render)(Rs.default.createElement(Ks.Text,{color:"white"},Rs.default.createElement(Zk,{prefix:t}),e));r()}function iQe(e,t,r="cli"){let n=t;t.includes("http")&&(n=new URL(t).pathname);let{unmount:a}=(0,Ks.render)(Rs.default.createElement(Ks.Text,{color:"grey"},e," ",n));a()}function kae({timestamp:e}){return Rs.default.createElement(Ks.Box,{width:13},Rs.default.createElement(Ks.Text,{color:"grey"},(0,nQe.default)(e).format("HH:mm:ss.SSS")))}function sQe(e,t){let{unmount:r}=(0,Ks.render)(Rs.default.createElement(Ks.Box,null,Rs.default.createElement(kae,{timestamp:t}),Rs.default.createElement(Ks.Text,{color:"white"},e)));r()}function aQe(e,t){let{unmount:r}=(0,Ks.render)(Rs.default.createElement(Ks.Box,null,Rs.default.createElement(kae,{timestamp:t}),Rs.default.createElement(Ks.Text,{color:"white",backgroundColor:"yellow"},"[WARNING]"),Rs.default.createElement(Ks.Text,null," ",e)));r()}function Tae(e,t){let{unmount:r}=(0,Ks.render)(Rs.default.createElement(Ks.Box,null,Rs.default.createElement(kae,{timestamp:t}),Rs.default.createElement(Ks.Text,{color:"white",backgroundColor:"red"},"[ERROR]"),Rs.default.createElement(Ks.Text,{color:"white"}," ",e)));r()}function RWt({content:e="Loading",prefix:t="cli",intervalMs:r=500,maxDots:n=6}){let[a,s]=(0,Rs.useState)("");return(0,Rs.useEffect)(()=>{let c=setInterval(()=>{s(l=>l.length>=n?"":l+".")},r);return()=>clearInterval(c)},[r,n]),Rs.default.createElement(Ks.Text,{color:"cyan"},Rs.default.createElement(Zk,{prefix:t}),e,a)}function oQe(e="Loading",t="cli",r=500,n=6){let a=(0,Ks.render)(Rs.default.createElement(RWt,{content:e,prefix:t,intervalMs:r,maxDots:n}));return{stop:()=>a.unmount()}}function rQe({percent:e,width:t=30,prefix:r="cli",label:n="Progress",color:a="cyan"}){let s=Math.max(0,Math.min(100,Math.round(e))),c=Math.round(s/100*t),l=t-c,f="\u2593".repeat(c),d="\u2591".repeat(Math.max(0,l)),m=String(s).padStart(3," ");return Rs.default.createElement(Ks.Text,null,Rs.default.createElement(Zk,{prefix:r}),Rs.default.createElement(Ks.Text,{color:a},n,": "),"[",Rs.default.createElement(Ks.Text,{color:a},f),d,"] ",m,"%")}function cQe(e="Progress",t="cli",r=30,n="cyan"){let a=0,s=(0,Ks.render)(Rs.default.createElement(rQe,{percent:a,width:r,prefix:t,label:e,color:n}));return{update:(c,l)=>{a=c;let f=l!=null?l:e;s.rerender(Rs.default.createElement(rQe,{percent:a,width:r,prefix:t,label:f,color:n}))},stop:()=>s.unmount()}}var izn=require("fs"),szn=require("path");async function $v(){return await FR("login_region")}function $L(e,t){return function(){return e.apply(t,arguments)}}var{toString:NWt}=Object.prototype,{getPrototypeOf:Dae}=Object,{iterator:Bz,toStringTag:lQe}=Symbol,Dz=(e=>t=>{let r=NWt.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),Wv=e=>(e=e.toLowerCase(),t=>Dz(t)===e),Pz=e=>t=>typeof t===e,{isArray:LR}=Array,WL=Pz("undefined");function YL(e){return e!==null&&!WL(e)&&e.constructor!==null&&!WL(e.constructor)&&C0(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}var pQe=Wv("ArrayBuffer");function FWt(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&pQe(e.buffer),t}var OWt=Pz("string"),C0=Pz("function"),fQe=Pz("number"),JL=e=>e!==null&&typeof e=="object",QWt=e=>e===!0||e===!1,Tz=e=>{if(Dz(e)!=="object")return!1;let t=Dae(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(lQe in e)&&!(Bz in e)},LWt=e=>{if(!JL(e)||YL(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},jWt=Wv("Date"),MWt=Wv("File"),qWt=Wv("Blob"),UWt=Wv("FileList"),zWt=e=>JL(e)&&C0(e.pipe),HWt=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||C0(e.append)&&((t=Dz(e))==="formdata"||t==="object"&&C0(e.toString)&&e.toString()==="[object FormData]"))},VWt=Wv("URLSearchParams"),[$Wt,WWt,GWt,YWt]=["ReadableStream","Request","Response","Headers"].map(Wv),JWt=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function KL(e,t,{allOwnKeys:r=!1}={}){if(e===null||typeof e>"u")return;let n,a;if(typeof e!="object"&&(e=[e]),LR(e))for(n=0,a=e.length;n<a;n++)t.call(null,e[n],n,e);else{if(YL(e))return;let s=r?Object.getOwnPropertyNames(e):Object.keys(e),c=s.length,l;for(n=0;n<c;n++)l=s[n],t.call(null,e[l],l,e)}}function dQe(e,t){if(YL(e))return null;t=t.toLowerCase();let r=Object.keys(e),n=r.length,a;for(;n-- >0;)if(a=r[n],t===a.toLowerCase())return a;return null}var eT=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,hQe=e=>!WL(e)&&e!==eT;function Bae(){let{caseless:e}=hQe(this)&&this||{},t={},r=(n,a)=>{let s=e&&dQe(t,a)||a;Tz(t[s])&&Tz(n)?t[s]=Bae(t[s],n):Tz(n)?t[s]=Bae({},n):LR(n)?t[s]=n.slice():t[s]=n};for(let n=0,a=arguments.length;n<a;n++)arguments[n]&&KL(arguments[n],r);return t}var KWt=(e,t,r,{allOwnKeys:n}={})=>(KL(t,(a,s)=>{r&&C0(a)?e[s]=$L(a,r):e[s]=a},{allOwnKeys:n}),e),XWt=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),ZWt=(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},eGt=(e,t,r,n)=>{let a,s,c,l={};if(t=t||{},e==null)return t;do{for(a=Object.getOwnPropertyNames(e),s=a.length;s-- >0;)c=a[s],(!n||n(c,e,t))&&!l[c]&&(t[c]=e[c],l[c]=!0);e=r!==!1&&Dae(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},tGt=(e,t,r)=>{e=String(e),(r===void 0||r>e.length)&&(r=e.length),r-=t.length;let n=e.indexOf(t,r);return n!==-1&&n===r},rGt=e=>{if(!e)return null;if(LR(e))return e;let t=e.length;if(!fQe(t))return null;let r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},nGt=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Dae(Uint8Array)),iGt=(e,t)=>{let n=(e&&e[Bz]).call(e),a;for(;(a=n.next())&&!a.done;){let s=a.value;t.call(e,s[0],s[1])}},sGt=(e,t)=>{let r,n=[];for(;(r=e.exec(t))!==null;)n.push(r);return n},aGt=Wv("HTMLFormElement"),oGt=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,n,a){return n.toUpperCase()+a}),uQe=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),cGt=Wv("RegExp"),mQe=(e,t)=>{let r=Object.getOwnPropertyDescriptors(e),n={};KL(r,(a,s)=>{let c;(c=t(a,s,e))!==!1&&(n[s]=c||a)}),Object.defineProperties(e,n)},uGt=e=>{mQe(e,(t,r)=>{if(C0(e)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;let n=e[r];if(C0(n)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},lGt=(e,t)=>{let r={},n=a=>{a.forEach(s=>{r[s]=!0})};return LR(e)?n(e):n(String(e).split(t)),r},pGt=()=>{},fGt=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function dGt(e){return!!(e&&C0(e.append)&&e[lQe]==="FormData"&&e[Bz])}var hGt=e=>{let t=new Array(10),r=(n,a)=>{if(JL(n)){if(t.indexOf(n)>=0)return;if(YL(n))return n;if(!("toJSON"in n)){t[a]=n;let s=LR(n)?[]:{};return KL(n,(c,l)=>{let f=r(c,a+1);!WL(f)&&(s[l]=f)}),t[a]=void 0,s}}return n};return r(e,0)},mGt=Wv("AsyncFunction"),gGt=e=>e&&(JL(e)||C0(e))&&C0(e.then)&&C0(e.catch),gQe=((e,t)=>e?setImmediate:t?((r,n)=>(eT.addEventListener("message",({source:a,data:s})=>{a===eT&&s===r&&n.length&&n.shift()()},!1),a=>{n.push(a),eT.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",C0(eT.postMessage)),AGt=typeof queueMicrotask<"u"?queueMicrotask.bind(eT):typeof process<"u"&&process.nextTick||gQe,yGt=e=>e!=null&&C0(e[Bz]),bt={isArray:LR,isArrayBuffer:pQe,isBuffer:YL,isFormData:HWt,isArrayBufferView:FWt,isString:OWt,isNumber:fQe,isBoolean:QWt,isObject:JL,isPlainObject:Tz,isEmptyObject:LWt,isReadableStream:$Wt,isRequest:WWt,isResponse:GWt,isHeaders:YWt,isUndefined:WL,isDate:jWt,isFile:MWt,isBlob:qWt,isRegExp:cGt,isFunction:C0,isStream:zWt,isURLSearchParams:VWt,isTypedArray:nGt,isFileList:UWt,forEach:KL,merge:Bae,extend:KWt,trim:JWt,stripBOM:XWt,inherits:ZWt,toFlatObject:eGt,kindOf:Dz,kindOfTest:Wv,endsWith:tGt,toArray:rGt,forEachEntry:iGt,matchAll:sGt,isHTMLForm:aGt,hasOwnProperty:uQe,hasOwnProp:uQe,reduceDescriptors:mQe,freezeMethods:uGt,toObjectSet:lGt,toCamelCase:oGt,noop:pGt,toFiniteNumber:fGt,findKey:dQe,global:eT,isContextDefined:hQe,isSpecCompliantForm:dGt,toJSONObject:hGt,isAsyncFn:mGt,isThenable:gGt,setImmediate:gQe,asap:AGt,isIterable:yGt};function jR(e,t,r,n,a){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),n&&(this.request=n),a&&(this.response=a,this.status=a.status?a.status:null)}bt.inherits(jR,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:bt.toJSONObject(this.config),code:this.code,status:this.status}}});var AQe=jR.prototype,yQe={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{yQe[e]={value:e}});Object.defineProperties(jR,yQe);Object.defineProperty(AQe,"isAxiosError",{value:!0});jR.from=(e,t,r,n,a,s)=>{let c=Object.create(AQe);return bt.toFlatObject(e,c,function(f){return f!==Error.prototype},l=>l!=="isAxiosError"),jR.call(c,e.message,t,r,n,a),c.cause=e,c.name=e.name,s&&Object.assign(c,s),c};var Cn=jR;var xLe=_r(vLe(),1),Hz=xLe.default;function Xae(e){return bt.isPlainObject(e)||bt.isArray(e)}function ELe(e){return bt.endsWith(e,"[]")?e.slice(0,-2):e}function bLe(e,t,r){return e?e.concat(t).map(function(a,s){return a=ELe(a),!r&&s?"["+a+"]":a}).join(r?".":""):t}function nJt(e){return bt.isArray(e)&&!e.some(Xae)}var iJt=bt.toFlatObject(bt,{},null,function(t){return/^is[A-Z]/.test(t)});function sJt(e,t,r){if(!bt.isObject(e))throw new TypeError("target must be an object");t=t||new(Hz||FormData),r=bt.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(C,I){return!bt.isUndefined(I[C])});let n=r.metaTokens,a=r.visitor||m,s=r.dots,c=r.indexes,f=(r.Blob||typeof Blob<"u"&&Blob)&&bt.isSpecCompliantForm(t);if(!bt.isFunction(a))throw new TypeError("visitor must be a function");function d(A){if(A===null)return"";if(bt.isDate(A))return A.toISOString();if(bt.isBoolean(A))return A.toString();if(!f&&bt.isBlob(A))throw new Cn("Blob is not supported. Use a Buffer instead.");return bt.isArrayBuffer(A)||bt.isTypedArray(A)?f&&typeof Blob=="function"?new Blob([A]):Buffer.from(A):A}function m(A,C,I){let k=A;if(A&&!I&&typeof A=="object"){if(bt.endsWith(C,"{}"))C=n?C:C.slice(0,-2),A=JSON.stringify(A);else if(bt.isArray(A)&&nJt(A)||(bt.isFileList(A)||bt.endsWith(C,"[]"))&&(k=bt.toArray(A)))return C=ELe(C),k.forEach(function(j,M){!(bt.isUndefined(j)||j===null)&&t.append(c===!0?bLe([C],M,s):c===null?C:C+"[]",d(j))}),!1}return Xae(A)?!0:(t.append(bLe(I,C,s),d(A)),!1)}let g=[],x=Object.assign(iJt,{defaultVisitor:m,convertValue:d,isVisitable:Xae});function b(A,C){if(!bt.isUndefined(A)){if(g.indexOf(A)!==-1)throw Error("Circular reference detected in "+C.join("."));g.push(A),bt.forEach(A,function(k,O){(!(bt.isUndefined(k)||k===null)&&a.call(t,k,bt.isString(O)?O.trim():O,C,x))===!0&&b(k,C?C.concat(O):[O])}),g.pop()}}if(!bt.isObject(e))throw new TypeError("data must be an object");return b(e),t}var UC=sJt;function wLe(e){let t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(n){return t[n]})}function SLe(e,t){this._pairs=[],e&&UC(e,this,t)}var CLe=SLe.prototype;CLe.append=function(t,r){this._pairs.push([t,r])};CLe.toString=function(t){let r=t?function(n){return t.call(this,n,wLe)}:wLe;return this._pairs.map(function(a){return r(a[0])+"="+r(a[1])},"").join("&")};var _Le=SLe;function aJt(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function rT(e,t,r){if(!t)return e;let n=r&&r.encode||aJt;bt.isFunction(r)&&(r={serialize:r});let a=r&&r.serialize,s;if(a?s=a(t,r):s=bt.isURLSearchParams(t)?t.toString():new _Le(t,r).toString(n),s){let c=e.indexOf("#");c!==-1&&(e=e.slice(0,c)),e+=(e.indexOf("?")===-1?"?":"&")+s}return e}var Zae=class{constructor(){this.handlers=[]}use(t,r,n){return this.handlers.push({fulfilled:t,rejected:r,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){bt.forEach(this.handlers,function(n){n!==null&&t(n)})}},eoe=Zae;var HR={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1};var BLe=_r(require("crypto"),1);var ILe=_r(require("url"),1),kLe=ILe.default.URLSearchParams;var toe="abcdefghijklmnopqrstuvwxyz",TLe="0123456789",DLe={DIGIT:TLe,ALPHA:toe,ALPHA_DIGIT:toe+toe.toUpperCase()+TLe},oJt=(e=16,t=DLe.ALPHA_DIGIT)=>{let r="",{length:n}=t,a=new Uint32Array(e);BLe.default.randomFillSync(a);for(let s=0;s<e;s++)r+=t[a[s]%n];return r},PLe={isNode:!0,classes:{URLSearchParams:kLe,FormData:Hz,Blob:typeof Blob<"u"&&Blob||null},ALPHABET:DLe,generateString:oJt,protocols:["http","https","file","data"]};var ioe={};GDe(ioe,{hasBrowserEnv:()=>noe,hasStandardBrowserEnv:()=>cJt,hasStandardBrowserWebWorkerEnv:()=>uJt,navigator:()=>roe,origin:()=>lJt});var noe=typeof window<"u"&&typeof document<"u",roe=typeof navigator=="object"&&navigator||void 0,cJt=noe&&(!roe||["ReactNative","NativeScript","NS"].indexOf(roe.product)<0),uJt=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",lJt=noe&&window.location.href||"http://localhost";var Po={...ioe,...PLe};function soe(e,t){return UC(e,new Po.classes.URLSearchParams,{visitor:function(r,n,a,s){return Po.isNode&&bt.isBuffer(r)?(this.append(n,r.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)},...t})}function pJt(e){return bt.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function fJt(e){let t={},r=Object.keys(e),n,a=r.length,s;for(n=0;n<a;n++)s=r[n],t[s]=e[s];return t}function dJt(e){function t(r,n,a,s){let c=r[s++];if(c==="__proto__")return!0;let l=Number.isFinite(+c),f=s>=r.length;return c=!c&&bt.isArray(a)?a.length:c,f?(bt.hasOwnProp(a,c)?a[c]=[a[c],n]:a[c]=n,!l):((!a[c]||!bt.isObject(a[c]))&&(a[c]=[]),t(r,n,a[c],s)&&bt.isArray(a[c])&&(a[c]=fJt(a[c])),!l)}if(bt.isFormData(e)&&bt.isFunction(e.entries)){let r={};return bt.forEachEntry(e,(n,a)=>{t(pJt(n),a,r,0)}),r}return null}var Vz=dJt;function hJt(e,t,r){if(bt.isString(e))try{return(t||JSON.parse)(e),bt.trim(e)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(e)}var aoe={transitional:HR,adapter:["xhr","http","fetch"],transformRequest:[function(t,r){let n=r.getContentType()||"",a=n.indexOf("application/json")>-1,s=bt.isObject(t);if(s&&bt.isHTMLForm(t)&&(t=new FormData(t)),bt.isFormData(t))return a?JSON.stringify(Vz(t)):t;if(bt.isArrayBuffer(t)||bt.isBuffer(t)||bt.isStream(t)||bt.isFile(t)||bt.isBlob(t)||bt.isReadableStream(t))return t;if(bt.isArrayBufferView(t))return t.buffer;if(bt.isURLSearchParams(t))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let l;if(s){if(n.indexOf("application/x-www-form-urlencoded")>-1)return soe(t,this.formSerializer).toString();if((l=bt.isFileList(t))||n.indexOf("multipart/form-data")>-1){let f=this.env&&this.env.FormData;return UC(l?{"files[]":t}:t,f&&new f,this.formSerializer)}}return s||a?(r.setContentType("application/json",!1),hJt(t)):t}],transformResponse:[function(t){let r=this.transitional||aoe.transitional,n=r&&r.forcedJSONParsing,a=this.responseType==="json";if(bt.isResponse(t)||bt.isReadableStream(t))return t;if(t&&bt.isString(t)&&(n&&!this.responseType||a)){let c=!(r&&r.silentJSONParsing)&&a;try{return JSON.parse(t)}catch(l){if(c)throw l.name==="SyntaxError"?Cn.from(l,Cn.ERR_BAD_RESPONSE,this,null,this.response):l}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Po.classes.FormData,Blob:Po.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};bt.forEach(["delete","get","head","post","put","patch"],e=>{aoe.headers[e]={}});var VR=aoe;var mJt=bt.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),RLe=e=>{let t={},r,n,a;return e&&e.split(`
|
|
523
523
|
`).forEach(function(c){a=c.indexOf(":"),r=c.substring(0,a).trim().toLowerCase(),n=c.substring(a+1).trim(),!(!r||t[r]&&mJt[r])&&(r==="set-cookie"?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)}),t};var NLe=Symbol("internals");function rj(e){return e&&String(e).trim().toLowerCase()}function $z(e){return e===!1||e==null?e:bt.isArray(e)?e.map($z):String(e)}function gJt(e){let t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g,n;for(;n=r.exec(e);)t[n[1]]=n[2];return t}var AJt=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function ooe(e,t,r,n,a){if(bt.isFunction(n))return n.call(this,t,r);if(a&&(t=r),!!bt.isString(t)){if(bt.isString(n))return t.indexOf(n)!==-1;if(bt.isRegExp(n))return n.test(t)}}function yJt(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,r,n)=>r.toUpperCase()+n)}function vJt(e,t){let r=bt.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(e,n+r,{value:function(a,s,c){return this[n].call(this,t,a,s,c)},configurable:!0})})}var $R=class{constructor(t){t&&this.set(t)}set(t,r,n){let a=this;function s(l,f,d){let m=rj(f);if(!m)throw new Error("header name must be a non-empty string");let g=bt.findKey(a,m);(!g||a[g]===void 0||d===!0||d===void 0&&a[g]!==!1)&&(a[g||f]=$z(l))}let c=(l,f)=>bt.forEach(l,(d,m)=>s(d,m,f));if(bt.isPlainObject(t)||t instanceof this.constructor)c(t,r);else if(bt.isString(t)&&(t=t.trim())&&!AJt(t))c(RLe(t),r);else if(bt.isObject(t)&&bt.isIterable(t)){let l={},f,d;for(let m of t){if(!bt.isArray(m))throw TypeError("Object iterator must return a key-value pair");l[d=m[0]]=(f=l[d])?bt.isArray(f)?[...f,m[1]]:[f,m[1]]:m[1]}c(l,r)}else t!=null&&s(r,t,n);return this}get(t,r){if(t=rj(t),t){let n=bt.findKey(this,t);if(n){let a=this[n];if(!r)return a;if(r===!0)return gJt(a);if(bt.isFunction(r))return r.call(this,a,n);if(bt.isRegExp(r))return r.exec(a);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,r){if(t=rj(t),t){let n=bt.findKey(this,t);return!!(n&&this[n]!==void 0&&(!r||ooe(this,this[n],n,r)))}return!1}delete(t,r){let n=this,a=!1;function s(c){if(c=rj(c),c){let l=bt.findKey(n,c);l&&(!r||ooe(n,n[l],l,r))&&(delete n[l],a=!0)}}return bt.isArray(t)?t.forEach(s):s(t),a}clear(t){let r=Object.keys(this),n=r.length,a=!1;for(;n--;){let s=r[n];(!t||ooe(this,this[s],s,t,!0))&&(delete this[s],a=!0)}return a}normalize(t){let r=this,n={};return bt.forEach(this,(a,s)=>{let c=bt.findKey(n,s);if(c){r[c]=$z(a),delete r[s];return}let l=t?yJt(s):String(s).trim();l!==s&&delete r[s],r[l]=$z(a),n[l]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){let r=Object.create(null);return bt.forEach(this,(n,a)=>{n!=null&&n!==!1&&(r[a]=t&&bt.isArray(n)?n.join(", "):n)}),r}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,r])=>t+": "+r).join(`
|
|
524
524
|
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...r){let n=new this(t);return r.forEach(a=>n.set(a)),n}static accessor(t){let n=(this[NLe]=this[NLe]={accessors:{}}).accessors,a=this.prototype;function s(c){let l=rj(c);n[l]||(vJt(a,c),n[l]=!0)}return bt.isArray(t)?t.forEach(s):s(t),this}};$R.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);bt.reduceDescriptors($R.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(n){this[r]=n}}});bt.freezeMethods($R);var el=$R;function nj(e,t){let r=this||VR,n=t||r,a=el.from(n.headers),s=n.data;return bt.forEach(e,function(l){s=l.call(r,s,a.normalize(),t?t.status:void 0)}),a.normalize(),s}function ij(e){return!!(e&&e.__CANCEL__)}function FLe(e,t,r){Cn.call(this,e==null?"canceled":e,Cn.ERR_CANCELED,t,r),this.name="CanceledError"}bt.inherits(FLe,Cn,{__CANCEL__:!0});var Mg=FLe;function Jb(e,t,r){let n=r.config.validateStatus;!r.status||!n||n(r.status)?e(r):t(new Cn("Request failed with status code "+r.status,[Cn.ERR_BAD_REQUEST,Cn.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}function coe(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function uoe(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function nT(e,t,r){let n=!coe(t);return e&&(n||r==!1)?uoe(e,t):t}var pje=_r(QLe(),1),fje=_r(require("http"),1),dje=_r(require("https"),1),hje=_r(require("util"),1),mje=_r(Soe(),1),Zw=_r(require("zlib"),1);var oT="1.11.0";function uj(e){let t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}var rKt=/^(?:([^;]+);)?(?:[^;]+;)?(base64|),([\s\S]*)$/;function Coe(e,t,r){let n=r&&r.Blob||Po.classes.Blob,a=uj(e);if(t===void 0&&n&&(t=!0),a==="data"){e=a.length?e.slice(a.length+1):e;let s=rKt.exec(e);if(!s)throw new Cn("Invalid URL",Cn.ERR_INVALID_URL);let c=s[1],l=s[2],f=s[3],d=Buffer.from(decodeURIComponent(f),l?"base64":"utf8");if(t){if(!n)throw new Cn("Blob is not supported",Cn.ERR_NOT_SUPPORT);return new n([d],{type:c})}return d}throw new Cn("Unsupported protocol "+a,Cn.ERR_NOT_SUPPORT)}var uT=_r(require("stream"),1);var JLe=_r(require("stream"),1);var _oe=Symbol("internals"),Ioe=class extends JLe.default.Transform{constructor(t){t=bt.toFlatObject(t,{maxRate:0,chunkSize:64*1024,minChunkSize:100,timeWindow:500,ticksRate:2,samplesCount:15},null,(n,a)=>!bt.isUndefined(a[n])),super({readableHighWaterMark:t.chunkSize});let r=this[_oe]={timeWindow:t.timeWindow,chunkSize:t.chunkSize,maxRate:t.maxRate,minChunkSize:t.minChunkSize,bytesSeen:0,isCaptured:!1,notifiedBytesLoaded:0,ts:Date.now(),bytes:0,onReadCallback:null};this.on("newListener",n=>{n==="progress"&&(r.isCaptured||(r.isCaptured=!0))})}_read(t){let r=this[_oe];return r.onReadCallback&&r.onReadCallback(),super._read(t)}_transform(t,r,n){let a=this[_oe],s=a.maxRate,c=this.readableHighWaterMark,l=a.timeWindow,f=1e3/l,d=s/f,m=a.minChunkSize!==!1?Math.max(a.minChunkSize,d*.01):0,g=(b,A)=>{let C=Buffer.byteLength(b);a.bytesSeen+=C,a.bytes+=C,a.isCaptured&&this.emit("progress",a.bytesSeen),this.push(b)?process.nextTick(A):a.onReadCallback=()=>{a.onReadCallback=null,process.nextTick(A)}},x=(b,A)=>{let C=Buffer.byteLength(b),I=null,k=c,O,j=0;if(s){let M=Date.now();(!a.ts||(j=M-a.ts)>=l)&&(a.ts=M,O=d-a.bytes,a.bytes=O<0?-O:0,j=0),O=d-a.bytes}if(s){if(O<=0)return setTimeout(()=>{A(null,b)},l-j);O<k&&(k=O)}k&&C>k&&C-k>m&&(I=b.subarray(k),b=b.subarray(0,k)),g(b,I?()=>{process.nextTick(A,null,I)}:A)};x(t,function b(A,C){if(A)return n(A);C?x(C,b):n(null)})}},koe=Ioe;var gje=require("events");var XLe=_r(require("util"),1),ZLe=require("stream");var{asyncIterator:KLe}=Symbol,nKt=async function*(e){e.stream?yield*e.stream():e.arrayBuffer?yield await e.arrayBuffer():e[KLe]?yield*e[KLe]():yield e},Xz=nKt;var iKt=Po.ALPHABET.ALPHA_DIGIT+"-_",lj=typeof TextEncoder=="function"?new TextEncoder:new XLe.default.TextEncoder,cT=`\r
|
|
525
525
|
`,sKt=lj.encode(cT),aKt=2,Toe=class{constructor(t,r){let{escapeName:n}=this.constructor,a=bt.isString(r),s=`Content-Disposition: form-data; name="${n(t)}"${!a&&r.name?`; filename="${n(r.name)}"`:""}${cT}`;a?r=lj.encode(String(r).replace(/\r?\n|\r\n?/g,cT)):s+=`Content-Type: ${r.type||"application/octet-stream"}${cT}`,this.headers=lj.encode(s+cT),this.contentLength=a?r.byteLength:r.size,this.size=this.headers.byteLength+this.contentLength+aKt,this.name=t,this.value=r}async*encode(){yield this.headers;let{value:t}=this;bt.isTypedArray(t)?yield t:yield*Xz(t),yield sKt}static escapeName(t){return String(t).replace(/[\r\n"]/g,r=>({"\r":"%0D","\n":"%0A",'"':"%22"})[r])}},oKt=(e,t,r)=>{let{tag:n="form-data-boundary",size:a=25,boundary:s=n+"-"+Po.generateString(a,iKt)}=r||{};if(!bt.isFormData(e))throw TypeError("FormData instance required");if(s.length<1||s.length>70)throw Error("boundary must be 10-70 characters long");let c=lj.encode("--"+s+cT),l=lj.encode("--"+s+"--"+cT),f=l.byteLength,d=Array.from(e.entries()).map(([g,x])=>{let b=new Toe(g,x);return f+=b.size,b});f+=c.byteLength*d.length,f=bt.toFiniteNumber(f);let m={"Content-Type":`multipart/form-data; boundary=${s}`};return Number.isFinite(f)&&(m["Content-Length"]=f),t&&t(m),ZLe.Readable.from(async function*(){for(let g of d)yield c,yield*g.encode();yield l}())},eje=oKt;var tje=_r(require("stream"),1),Boe=class extends tje.default.Transform{__transform(t,r,n){this.push(t),n()}_transform(t,r,n){if(t.length!==0&&(this._transform=this.__transform,t[0]!==120)){let a=Buffer.alloc(2);a[0]=120,a[1]=156,this.push(a,r)}this.__transform(t,r,n)}},rje=Boe;var cKt=(e,t)=>bt.isAsyncFn(e)?function(...r){let n=r.pop();e.apply(this,r).then(a=>{try{t?n(null,...t(a)):n(null,a)}catch(s){n(s)}},n)}:e,nje=cKt;function uKt(e,t){e=e||10;let r=new Array(e),n=new Array(e),a=0,s=0,c;return t=t!==void 0?t:1e3,function(f){let d=Date.now(),m=n[s];c||(c=d),r[a]=f,n[a]=d;let g=s,x=0;for(;g!==a;)x+=r[g++],g=g%e;if(a=(a+1)%e,a===s&&(s=(s+1)%e),d-c<t)return;let b=m&&d-m;return b?Math.round(x*1e3/b):void 0}}var ije=uKt;function lKt(e,t){let r=0,n=1e3/t,a,s,c=(d,m=Date.now())=>{r=m,a=null,s&&(clearTimeout(s),s=null),e(...d)};return[(...d)=>{let m=Date.now(),g=m-r;g>=n?c(d,m):(a=d,s||(s=setTimeout(()=>{s=null,c(a)},n-g)))},()=>a&&c(a)]}var sje=lKt;var Xw=(e,t,r=3)=>{let n=0,a=ije(50,250);return sje(s=>{let c=s.loaded,l=s.lengthComputable?s.total:void 0,f=c-n,d=a(f),m=c<=l;n=c;let g={loaded:c,total:l,progress:l?c/l:void 0,bytes:f,rate:d||void 0,estimated:d&&l&&m?(l-c)/d:void 0,event:s,lengthComputable:l!=null,[t?"download":"upload"]:!0};e(g)},r)},KR=(e,t)=>{let r=e!=null;return[n=>t[0]({lengthComputable:r,total:e,loaded:n}),t[1]]},XR=e=>(...t)=>bt.asap(()=>e(...t));var aje={flush:Zw.default.constants.Z_SYNC_FLUSH,finishFlush:Zw.default.constants.Z_SYNC_FLUSH},pKt={flush:Zw.default.constants.BROTLI_OPERATION_FLUSH,finishFlush:Zw.default.constants.BROTLI_OPERATION_FLUSH},oje=bt.isFunction(Zw.default.createBrotliDecompress),{http:fKt,https:dKt}=mje.default,hKt=/https:?/,cje=Po.protocols.map(e=>e+":"),uje=(e,[t,r])=>(e.on("end",r).on("error",r),t);function mKt(e,t){e.beforeRedirects.proxy&&e.beforeRedirects.proxy(e),e.beforeRedirects.config&&e.beforeRedirects.config(e,t)}function Aje(e,t,r){let n=t;if(!n&&n!==!1){let a=pje.default.getProxyForUrl(r);a&&(n=new URL(a))}if(n){if(n.username&&(n.auth=(n.username||"")+":"+(n.password||"")),n.auth){(n.auth.username||n.auth.password)&&(n.auth=(n.auth.username||"")+":"+(n.auth.password||""));let s=Buffer.from(n.auth,"utf8").toString("base64");e.headers["Proxy-Authorization"]="Basic "+s}e.headers.host=e.hostname+(e.port?":"+e.port:"");let a=n.hostname||n.host;e.hostname=a,e.host=a,e.port=n.port,e.path=r,n.protocol&&(e.protocol=n.protocol.includes(":")?n.protocol:`${n.protocol}:`)}e.beforeRedirects.proxy=function(s){Aje(s,t,s.href)}}var gKt=typeof process<"u"&&bt.kindOf(process)==="process",AKt=e=>new Promise((t,r)=>{let n,a,s=(f,d)=>{a||(a=!0,n&&n(f,d))},c=f=>{s(f),t(f)},l=f=>{s(f,!0),r(f)};e(c,l,f=>n=f).catch(l)}),yKt=({address:e,family:t})=>{if(!bt.isString(e))throw TypeError("address must be a string");return{address:e,family:t||(e.indexOf(".")<0?6:4)}},lje=(e,t)=>yKt(bt.isObject(e)?e:{address:e,family:t}),yje=gKt&&function(t){return AKt(async function(n,a,s){let{data:c,lookup:l,family:f}=t,{responseType:d,responseEncoding:m}=t,g=t.method.toUpperCase(),x,b=!1,A;if(l){let Ae=nje(l,we=>bt.isArray(we)?we:[we]);l=(we,Me,We)=>{Ae(we,Me,(Tt,Vt,ht)=>{if(Tt)return We(Tt);let it=bt.isArray(Vt)?Vt.map(He=>lje(He)):[lje(Vt,ht)];Me.all?We(Tt,it):We(Tt,it[0].address,it[0].family)})}}let C=new gje.EventEmitter,I=()=>{t.cancelToken&&t.cancelToken.unsubscribe(k),t.signal&&t.signal.removeEventListener("abort",k),C.removeAllListeners()};s((Ae,we)=>{x=!0,we&&(b=!0,I())});function k(Ae){C.emit("abort",!Ae||Ae.type?new Mg(null,t,A):Ae)}C.once("abort",a),(t.cancelToken||t.signal)&&(t.cancelToken&&t.cancelToken.subscribe(k),t.signal&&(t.signal.aborted?k():t.signal.addEventListener("abort",k)));let O=nT(t.baseURL,t.url,t.allowAbsoluteUrls),j=new URL(O,Po.hasBrowserEnv?Po.origin:void 0),M=j.protocol||cje[0];if(M==="data:"){let Ae;if(g!=="GET")return Jb(n,a,{status:405,statusText:"method not allowed",headers:{},config:t});try{Ae=Coe(t.url,d==="blob",{Blob:t.env&&t.env.Blob})}catch(we){throw Cn.from(we,Cn.ERR_BAD_REQUEST,t)}return d==="text"?(Ae=Ae.toString(m),(!m||m==="utf8")&&(Ae=bt.stripBOM(Ae))):d==="stream"&&(Ae=uT.default.Readable.from(Ae)),Jb(n,a,{data:Ae,status:200,statusText:"OK",headers:new el,config:t})}if(cje.indexOf(M)===-1)return a(new Cn("Unsupported protocol "+M,Cn.ERR_BAD_REQUEST,t));let W=el.from(t.headers).normalize();W.set("User-Agent","axios/"+oT,!1);let{onUploadProgress:ae,onDownloadProgress:X}=t,xe=t.maxRate,se,he;if(bt.isSpecCompliantForm(c)){let Ae=W.getContentType(/boundary=([-_\w\d]{10,70})/i);c=eje(c,we=>{W.set(we)},{tag:`axios-${oT}-boundary`,boundary:Ae&&Ae[1]||void 0})}else if(bt.isFormData(c)&&bt.isFunction(c.getHeaders)){if(W.set(c.getHeaders()),!W.hasContentLength())try{let Ae=await hje.default.promisify(c.getLength).call(c);Number.isFinite(Ae)&&Ae>=0&&W.setContentLength(Ae)}catch{}}else if(bt.isBlob(c)||bt.isFile(c))c.size&&W.setContentType(c.type||"application/octet-stream"),W.setContentLength(c.size||0),c=uT.default.Readable.from(Xz(c));else if(c&&!bt.isStream(c)){if(!Buffer.isBuffer(c))if(bt.isArrayBuffer(c))c=Buffer.from(new Uint8Array(c));else if(bt.isString(c))c=Buffer.from(c,"utf-8");else return a(new Cn("Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream",Cn.ERR_BAD_REQUEST,t));if(W.setContentLength(c.length,!1),t.maxBodyLength>-1&&c.length>t.maxBodyLength)return a(new Cn("Request body larger than maxBodyLength limit",Cn.ERR_BAD_REQUEST,t))}let me=bt.toFiniteNumber(W.getContentLength());bt.isArray(xe)?(se=xe[0],he=xe[1]):se=he=xe,c&&(ae||se)&&(bt.isStream(c)||(c=uT.default.Readable.from(c,{objectMode:!1})),c=uT.default.pipeline([c,new koe({maxRate:bt.toFiniteNumber(se)})],bt.noop),ae&&c.on("progress",uje(c,KR(me,Xw(XR(ae),!1,3)))));let ye;if(t.auth){let Ae=t.auth.username||"",we=t.auth.password||"";ye=Ae+":"+we}if(!ye&&j.username){let Ae=j.username,we=j.password;ye=Ae+":"+we}ye&&W.delete("authorization");let ue;try{ue=rT(j.pathname+j.search,t.params,t.paramsSerializer).replace(/^\?/,"")}catch(Ae){let we=new Error(Ae.message);return we.config=t,we.url=t.url,we.exists=!0,a(we)}W.set("Accept-Encoding","gzip, compress, deflate"+(oje?", br":""),!1);let ne={path:ue,method:g,headers:W.toJSON(),agents:{http:t.httpAgent,https:t.httpsAgent},auth:ye,protocol:M,family:f,beforeRedirect:mKt,beforeRedirects:{}};!bt.isUndefined(l)&&(ne.lookup=l),t.socketPath?ne.socketPath=t.socketPath:(ne.hostname=j.hostname.startsWith("[")?j.hostname.slice(1,-1):j.hostname,ne.port=j.port,Aje(ne,t.proxy,M+"//"+j.hostname+(j.port?":"+j.port:"")+ne.path));let be,$e=hKt.test(ne.protocol);if(ne.agent=$e?t.httpsAgent:t.httpAgent,t.transport?be=t.transport:t.maxRedirects===0?be=$e?dje.default:fje.default:(t.maxRedirects&&(ne.maxRedirects=t.maxRedirects),t.beforeRedirect&&(ne.beforeRedirects.config=t.beforeRedirect),be=$e?dKt:fKt),t.maxBodyLength>-1?ne.maxBodyLength=t.maxBodyLength:ne.maxBodyLength=1/0,t.insecureHTTPParser&&(ne.insecureHTTPParser=t.insecureHTTPParser),A=be.request(ne,function(we){if(A.destroyed)return;let Me=[we],We=+we.headers["content-length"];if(X||he){let He=new koe({maxRate:bt.toFiniteNumber(he)});X&&He.on("progress",uje(He,KR(We,Xw(XR(X),!0,3)))),Me.push(He)}let Tt=we,Vt=we.req||A;if(t.decompress!==!1&&we.headers["content-encoding"])switch((g==="HEAD"||we.statusCode===204)&&delete we.headers["content-encoding"],(we.headers["content-encoding"]||"").toLowerCase()){case"gzip":case"x-gzip":case"compress":case"x-compress":Me.push(Zw.default.createUnzip(aje)),delete we.headers["content-encoding"];break;case"deflate":Me.push(new rje),Me.push(Zw.default.createUnzip(aje)),delete we.headers["content-encoding"];break;case"br":oje&&(Me.push(Zw.default.createBrotliDecompress(pKt)),delete we.headers["content-encoding"])}Tt=Me.length>1?uT.default.pipeline(Me,bt.noop):Me[0];let ht=uT.default.finished(Tt,()=>{ht(),I()}),it={status:we.statusCode,statusText:we.statusMessage,headers:new el(we.headers),config:t,request:Vt};if(d==="stream")it.data=Tt,Jb(n,a,it);else{let He=[],rt=0;Tt.on("data",function(Wt){He.push(Wt),rt+=Wt.length,t.maxContentLength>-1&&rt>t.maxContentLength&&(b=!0,Tt.destroy(),a(new Cn("maxContentLength size of "+t.maxContentLength+" exceeded",Cn.ERR_BAD_RESPONSE,t,Vt)))}),Tt.on("aborted",function(){if(b)return;let Wt=new Cn("stream has been aborted",Cn.ERR_BAD_RESPONSE,t,Vt);Tt.destroy(Wt),a(Wt)}),Tt.on("error",function(Wt){A.destroyed||a(Cn.from(Wt,null,t,Vt))}),Tt.on("end",function(){try{let Wt=He.length===1?He[0]:Buffer.concat(He);d!=="arraybuffer"&&(Wt=Wt.toString(m),(!m||m==="utf8")&&(Wt=bt.stripBOM(Wt))),it.data=Wt}catch(Wt){return a(Cn.from(Wt,null,t,it.request,it))}Jb(n,a,it)})}C.once("abort",He=>{Tt.destroyed||(Tt.emit("error",He),Tt.destroy())})}),C.once("abort",Ae=>{a(Ae),A.destroy(Ae)}),A.on("error",function(we){a(Cn.from(we,null,t,A))}),A.on("socket",function(we){we.setKeepAlive(!0,1e3*60)}),t.timeout){let Ae=parseInt(t.timeout,10);if(Number.isNaN(Ae)){a(new Cn("error trying to parse `config.timeout` to int",Cn.ERR_BAD_OPTION_VALUE,t,A));return}A.setTimeout(Ae,function(){if(x)return;let Me=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded",We=t.transitional||HR;t.timeoutErrorMessage&&(Me=t.timeoutErrorMessage),a(new Cn(Me,We.clarifyTimeoutError?Cn.ETIMEDOUT:Cn.ECONNABORTED,t,A)),k()})}if(bt.isStream(c)){let Ae=!1,we=!1;c.on("end",()=>{Ae=!0}),c.once("error",Me=>{we=!0,A.destroy(Me)}),c.on("close",()=>{!Ae&&!we&&k(new Mg("Request stream has been aborted",t,A))}),c.pipe(A)}else A.end(c)})};var vje=Po.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,Po.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(Po.origin),Po.navigator&&/(msie|trident)/i.test(Po.navigator.userAgent)):()=>!0;var xje=Po.hasStandardBrowserEnv?{write(e,t,r,n,a,s){let c=[e+"="+encodeURIComponent(t)];bt.isNumber(r)&&c.push("expires="+new Date(r).toGMTString()),bt.isString(n)&&c.push("path="+n),bt.isString(a)&&c.push("domain="+a),s===!0&&c.push("secure"),document.cookie=c.join("; ")},read(e){let t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};var bje=e=>e instanceof el?{...e}:e;function Yv(e,t){t=t||{};let r={};function n(d,m,g,x){return bt.isPlainObject(d)&&bt.isPlainObject(m)?bt.merge.call({caseless:x},d,m):bt.isPlainObject(m)?bt.merge({},m):bt.isArray(m)?m.slice():m}function a(d,m,g,x){if(bt.isUndefined(m)){if(!bt.isUndefined(d))return n(void 0,d,g,x)}else return n(d,m,g,x)}function s(d,m){if(!bt.isUndefined(m))return n(void 0,m)}function c(d,m){if(bt.isUndefined(m)){if(!bt.isUndefined(d))return n(void 0,d)}else return n(void 0,m)}function l(d,m,g){if(g in t)return n(d,m);if(g in e)return n(void 0,d)}let f={url:s,method:s,data:s,baseURL:c,transformRequest:c,transformResponse:c,paramsSerializer:c,timeout:c,timeoutMessage:c,withCredentials:c,withXSRFToken:c,adapter:c,responseType:c,xsrfCookieName:c,xsrfHeaderName:c,onUploadProgress:c,onDownloadProgress:c,decompress:c,maxContentLength:c,maxBodyLength:c,beforeRedirect:c,transport:c,httpAgent:c,httpsAgent:c,cancelToken:c,socketPath:c,responseEncoding:c,validateStatus:l,headers:(d,m,g)=>a(bje(d),bje(m),g,!0)};return bt.forEach(Object.keys({...e,...t}),function(m){let g=f[m]||a,x=g(e[m],t[m],m);bt.isUndefined(x)&&g!==l||(r[m]=x)}),r}var Zz=e=>{let t=Yv({},e),{data:r,withXSRFToken:n,xsrfHeaderName:a,xsrfCookieName:s,headers:c,auth:l}=t;t.headers=c=el.from(c),t.url=rT(nT(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),l&&c.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):"")));let f;if(bt.isFormData(r)){if(Po.hasStandardBrowserEnv||Po.hasStandardBrowserWebWorkerEnv)c.setContentType(void 0);else if((f=c.getContentType())!==!1){let[d,...m]=f?f.split(";").map(g=>g.trim()).filter(Boolean):[];c.setContentType([d||"multipart/form-data",...m].join("; "))}}if(Po.hasStandardBrowserEnv&&(n&&bt.isFunction(n)&&(n=n(t)),n||n!==!1&&vje(t.url))){let d=a&&s&&xje.read(s);d&&c.set(a,d)}return t};var vKt=typeof XMLHttpRequest<"u",Eje=vKt&&function(e){return new Promise(function(r,n){let a=Zz(e),s=a.data,c=el.from(a.headers).normalize(),{responseType:l,onUploadProgress:f,onDownloadProgress:d}=a,m,g,x,b,A;function C(){b&&b(),A&&A(),a.cancelToken&&a.cancelToken.unsubscribe(m),a.signal&&a.signal.removeEventListener("abort",m)}let I=new XMLHttpRequest;I.open(a.method.toUpperCase(),a.url,!0),I.timeout=a.timeout;function k(){if(!I)return;let j=el.from("getAllResponseHeaders"in I&&I.getAllResponseHeaders()),W={data:!l||l==="text"||l==="json"?I.responseText:I.response,status:I.status,statusText:I.statusText,headers:j,config:e,request:I};Jb(function(X){r(X),C()},function(X){n(X),C()},W),I=null}"onloadend"in I?I.onloadend=k:I.onreadystatechange=function(){!I||I.readyState!==4||I.status===0&&!(I.responseURL&&I.responseURL.indexOf("file:")===0)||setTimeout(k)},I.onabort=function(){I&&(n(new Cn("Request aborted",Cn.ECONNABORTED,e,I)),I=null)},I.onerror=function(){n(new Cn("Network Error",Cn.ERR_NETWORK,e,I)),I=null},I.ontimeout=function(){let M=a.timeout?"timeout of "+a.timeout+"ms exceeded":"timeout exceeded",W=a.transitional||HR;a.timeoutErrorMessage&&(M=a.timeoutErrorMessage),n(new Cn(M,W.clarifyTimeoutError?Cn.ETIMEDOUT:Cn.ECONNABORTED,e,I)),I=null},s===void 0&&c.setContentType(null),"setRequestHeader"in I&&bt.forEach(c.toJSON(),function(M,W){I.setRequestHeader(W,M)}),bt.isUndefined(a.withCredentials)||(I.withCredentials=!!a.withCredentials),l&&l!=="json"&&(I.responseType=a.responseType),d&&([x,A]=Xw(d,!0),I.addEventListener("progress",x)),f&&I.upload&&([g,b]=Xw(f),I.upload.addEventListener("progress",g),I.upload.addEventListener("loadend",b)),(a.cancelToken||a.signal)&&(m=j=>{I&&(n(!j||j.type?new Mg(null,e,I):j),I.abort(),I=null)},a.cancelToken&&a.cancelToken.subscribe(m),a.signal&&(a.signal.aborted?m():a.signal.addEventListener("abort",m)));let O=uj(a.url);if(O&&Po.protocols.indexOf(O)===-1){n(new Cn("Unsupported protocol "+O+":",Cn.ERR_BAD_REQUEST,e));return}I.send(s||null)})};var xKt=(e,t)=>{let{length:r}=e=e?e.filter(Boolean):[];if(t||r){let n=new AbortController,a,s=function(d){if(!a){a=!0,l();let m=d instanceof Error?d:this.reason;n.abort(m instanceof Cn?m:new Mg(m instanceof Error?m.message:m))}},c=t&&setTimeout(()=>{c=null,s(new Cn(`timeout ${t} of ms exceeded`,Cn.ETIMEDOUT))},t),l=()=>{e&&(c&&clearTimeout(c),c=null,e.forEach(d=>{d.unsubscribe?d.unsubscribe(s):d.removeEventListener("abort",s)}),e=null)};e.forEach(d=>d.addEventListener("abort",s));let{signal:f}=n;return f.unsubscribe=()=>bt.asap(l),f}},wje=xKt;var bKt=function*(e,t){let r=e.byteLength;if(!t||r<t){yield e;return}let n=0,a;for(;n<r;)a=n+t,yield e.slice(n,a),n=a},EKt=async function*(e,t){for await(let r of wKt(e))yield*bKt(r,t)},wKt=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}let t=e.getReader();try{for(;;){let{done:r,value:n}=await t.read();if(r)break;yield n}}finally{await t.cancel()}},Doe=(e,t,r,n)=>{let a=EKt(e,t),s=0,c,l=f=>{c||(c=!0,n&&n(f))};return new ReadableStream({async pull(f){try{let{done:d,value:m}=await a.next();if(d){l(),f.close();return}let g=m.byteLength;if(r){let x=s+=g;r(x)}f.enqueue(new Uint8Array(m))}catch(d){throw l(d),d}},cancel(f){return l(f),a.return()}},{highWaterMark:2})};var tH=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",Cje=tH&&typeof ReadableStream=="function",SKt=tH&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),_je=(e,...t)=>{try{return!!e(...t)}catch{return!1}},CKt=Cje&&_je(()=>{let e=!1,t=new Request(Po.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),Sje=64*1024,Poe=Cje&&_je(()=>bt.isReadableStream(new Response("").body)),eH={stream:Poe&&(e=>e.body)};tH&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!eH[t]&&(eH[t]=bt.isFunction(e[t])?r=>r[t]():(r,n)=>{throw new Cn(`Response type '${t}' is not supported`,Cn.ERR_NOT_SUPPORT,n)})})})(new Response);var _Kt=async e=>{if(e==null)return 0;if(bt.isBlob(e))return e.size;if(bt.isSpecCompliantForm(e))return(await new Request(Po.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(bt.isArrayBufferView(e)||bt.isArrayBuffer(e))return e.byteLength;if(bt.isURLSearchParams(e)&&(e=e+""),bt.isString(e))return(await SKt(e)).byteLength},IKt=async(e,t)=>{let r=bt.toFiniteNumber(e.getContentLength());return r==null?_Kt(t):r},Ije=tH&&(async e=>{let{url:t,method:r,data:n,signal:a,cancelToken:s,timeout:c,onDownloadProgress:l,onUploadProgress:f,responseType:d,headers:m,withCredentials:g="same-origin",fetchOptions:x}=Zz(e);d=d?(d+"").toLowerCase():"text";let b=wje([a,s&&s.toAbortSignal()],c),A,C=b&&b.unsubscribe&&(()=>{b.unsubscribe()}),I;try{if(f&&CKt&&r!=="get"&&r!=="head"&&(I=await IKt(m,n))!==0){let W=new Request(t,{method:"POST",body:n,duplex:"half"}),ae;if(bt.isFormData(n)&&(ae=W.headers.get("content-type"))&&m.setContentType(ae),W.body){let[X,xe]=KR(I,Xw(XR(f)));n=Doe(W.body,Sje,X,xe)}}bt.isString(g)||(g=g?"include":"omit");let k="credentials"in Request.prototype;A=new Request(t,{...x,signal:b,method:r.toUpperCase(),headers:m.normalize().toJSON(),body:n,duplex:"half",credentials:k?g:void 0});let O=await fetch(A,x),j=Poe&&(d==="stream"||d==="response");if(Poe&&(l||j&&C)){let W={};["status","statusText","headers"].forEach(se=>{W[se]=O[se]});let ae=bt.toFiniteNumber(O.headers.get("content-length")),[X,xe]=l&&KR(ae,Xw(XR(l),!0))||[];O=new Response(Doe(O.body,Sje,X,()=>{xe&&xe(),C&&C()}),W)}d=d||"text";let M=await eH[bt.findKey(eH,d)||"text"](O,e);return!j&&C&&C(),await new Promise((W,ae)=>{Jb(W,ae,{data:M,headers:el.from(O.headers),status:O.status,statusText:O.statusText,config:e,request:A})})}catch(k){throw C&&C(),k&&k.name==="TypeError"&&/Load failed|fetch/i.test(k.message)?Object.assign(new Cn("Network Error",Cn.ERR_NETWORK,e,A),{cause:k.cause||k}):Cn.from(k,k&&k.code,e,A)}});var Roe={http:yje,xhr:Eje,fetch:Ije};bt.forEach(Roe,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});var kje=e=>`- ${e}`,kKt=e=>bt.isFunction(e)||e===null||e===!1,rH={getAdapter:e=>{e=bt.isArray(e)?e:[e];let{length:t}=e,r,n,a={};for(let s=0;s<t;s++){r=e[s];let c;if(n=r,!kKt(r)&&(n=Roe[(c=String(r)).toLowerCase()],n===void 0))throw new Cn(`Unknown adapter '${c}'`);if(n)break;a[c||"#"+s]=n}if(!n){let s=Object.entries(a).map(([l,f])=>`adapter ${l} `+(f===!1?"is not supported by the environment":"is not available in the build")),c=t?s.length>1?`since :
|
|
@@ -536,7 +536,7 @@ ${A.join(`
|
|
|
536
536
|
If you want to switch user, please run "edgeone switch".`),eN("Login Res","Already logged in "))}),e.command("whoami","Get user information.",{},async t=>{let r=await T0("DescribeUserInfo",{}).catch(c=>{yd("Run whoami command failed.",{message:c.errorMessage,stack:c}),Zr("You are not authenticated. Please run `edgeone login`."),process.exit(1)}),{AppId:n,Uin:a,UserName:s}=r.Data;console.log("Your Tencent Cloud account information:"),(0,Eqe.render)(bqe.default.createElement(wqe.default,{data:[{Key:"Account Name",Value:s},{Key:"Account ID",Value:a},{Key:"APPID",Value:n}]}))}),e.command("switch","Switch user.",{},async t=>{await Cqe(),CH(),ma("User switch successfully."),process.exit(1)}),e.command("logout","Logout from Edgeone.",{},async t=>{await _z("eo_token"),await _z("EDGEONE_PAGES_API_TOKEN"),await _z("env_vars_pull_prompt"),ma("Logout successfully!")})}var l5e=_r(Qqe()),zH=_r(require("path"));var Wer=_r(require("crypto")),Ger=require("lodash"),Lqe=_r(require("fs")),jqe=_r(require("path"));async function BH(e){var t,r;try{let n=JSON.parse(await Lqe.default.promises.readFile(jqe.default.join(e,"package.json"),"utf-8"));return((t=n.dependencies)==null?void 0:t.nuxt)||((r=n.devDependencies)==null?void 0:r.nuxt)||"latest"}catch{return"latest"}}function cue(){return process.env.LANG==="zh_CN.UTF-8"}var po;(function(e){e.assertEqual=a=>a;function t(a){}e.assertIs=t;function r(a){throw new Error}e.assertNever=r,e.arrayToEnum=a=>{let s={};for(let c of a)s[c]=c;return s},e.getValidEnumValues=a=>{let s=e.objectKeys(a).filter(l=>typeof a[a[l]]!="number"),c={};for(let l of s)c[l]=a[l];return e.objectValues(c)},e.objectValues=a=>e.objectKeys(a).map(function(s){return a[s]}),e.objectKeys=typeof Object.keys=="function"?a=>Object.keys(a):a=>{let s=[];for(let c in a)Object.prototype.hasOwnProperty.call(a,c)&&s.push(c);return s},e.find=(a,s)=>{for(let c of a)if(s(c))return c},e.isInteger=typeof Number.isInteger=="function"?a=>Number.isInteger(a):a=>typeof a=="number"&&isFinite(a)&&Math.floor(a)===a;function n(a,s=" | "){return a.map(c=>typeof c=="string"?`'${c}'`:c).join(s)}e.joinValues=n,e.jsonStringifyReplacer=(a,s)=>typeof s=="bigint"?s.toString():s})(po||(po={}));var lue;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(lue||(lue={}));var Mn=po.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),p2=e=>{switch(typeof e){case"undefined":return Mn.undefined;case"string":return Mn.string;case"number":return isNaN(e)?Mn.nan:Mn.number;case"boolean":return Mn.boolean;case"function":return Mn.function;case"bigint":return Mn.bigint;case"symbol":return Mn.symbol;case"object":return Array.isArray(e)?Mn.array:e===null?Mn.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?Mn.promise:typeof Map<"u"&&e instanceof Map?Mn.map:typeof Set<"u"&&e instanceof Set?Mn.set:typeof Date<"u"&&e instanceof Date?Mn.date:Mn.object;default:return Mn.unknown}},Yr=po.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),Yer=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),qg=class e extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=t}format(t){let r=t||function(s){return s.message},n={_errors:[]},a=s=>{for(let c of s.issues)if(c.code==="invalid_union")c.unionErrors.map(a);else if(c.code==="invalid_return_type")a(c.returnTypeError);else if(c.code==="invalid_arguments")a(c.argumentsError);else if(c.path.length===0)n._errors.push(r(c));else{let l=n,f=0;for(;f<c.path.length;){let d=c.path[f];f===c.path.length-1?(l[d]=l[d]||{_errors:[]},l[d]._errors.push(r(c))):l[d]=l[d]||{_errors:[]},l=l[d],f++}}};return a(this),n}static assert(t){if(!(t instanceof e))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,po.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=r=>r.message){let r={},n=[];for(let a of this.issues)a.path.length>0?(r[a.path[0]]=r[a.path[0]]||[],r[a.path[0]].push(t(a))):n.push(t(a));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};qg.create=e=>new qg(e);var cN=(e,t)=>{let r;switch(e.code){case Yr.invalid_type:e.received===Mn.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case Yr.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,po.jsonStringifyReplacer)}`;break;case Yr.unrecognized_keys:r=`Unrecognized key(s) in object: ${po.joinValues(e.keys,", ")}`;break;case Yr.invalid_union:r="Invalid input";break;case Yr.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${po.joinValues(e.options)}`;break;case Yr.invalid_enum_value:r=`Invalid enum value. Expected ${po.joinValues(e.options)}, received '${e.received}'`;break;case Yr.invalid_arguments:r="Invalid function arguments";break;case Yr.invalid_return_type:r="Invalid function return type";break;case Yr.invalid_date:r="Invalid date";break;case Yr.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:po.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case Yr.too_small:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:r="Invalid input";break;case Yr.too_big:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?r=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:r="Invalid input";break;case Yr.custom:r="Invalid input";break;case Yr.invalid_intersection_types:r="Intersection results could not be merged";break;case Yr.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case Yr.not_finite:r="Number must be finite";break;default:r=t.defaultError,po.assertNever(e)}return{message:r}},zqe=cN;function Jer(e){zqe=e}function DH(){return zqe}var PH=e=>{let{data:t,path:r,errorMaps:n,issueData:a}=e,s=[...r,...a.path||[]],c={...a,path:s};if(a.message!==void 0)return{...a,path:s,message:a.message};let l="",f=n.filter(d=>!!d).slice().reverse();for(let d of f)l=d(c,{data:t,defaultError:l}).message;return{...a,path:s,message:l}},Ker=[];function _n(e,t){let r=DH(),n=PH({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===cN?void 0:cN].filter(a=>!!a)});e.common.issues.push(n)}var ch=class e{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,r){let n=[];for(let a of r){if(a.status==="aborted")return ps;a.status==="dirty"&&t.dirty(),n.push(a.value)}return{status:t.value,value:n}}static async mergeObjectAsync(t,r){let n=[];for(let a of r){let s=await a.key,c=await a.value;n.push({key:s,value:c})}return e.mergeObjectSync(t,n)}static mergeObjectSync(t,r){let n={};for(let a of r){let{key:s,value:c}=a;if(s.status==="aborted"||c.status==="aborted")return ps;s.status==="dirty"&&t.dirty(),c.status==="dirty"&&t.dirty(),s.value!=="__proto__"&&(typeof c.value<"u"||a.alwaysSet)&&(n[s.value]=c.value)}return{status:t.value,value:n}}},ps=Object.freeze({status:"aborted"}),oN=e=>({status:"dirty",value:e}),nm=e=>({status:"valid",value:e}),pue=e=>e.status==="aborted",fue=e=>e.status==="dirty",mT=e=>e.status==="valid",Dj=e=>typeof Promise<"u"&&e instanceof Promise;function RH(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)}function Hqe(e,t,r,n,a){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?a.call(e,r):a?a.value=r:t.set(e,r),r}var mi;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(mi||(mi={}));var Tj,Bj,ly=class{constructor(t,r,n,a){this._cachedPath=[],this.parent=t,this.data=r,this._path=n,this._key=a}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},Mqe=(e,t)=>{if(mT(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new qg(e.common.issues);return this._error=r,this._error}}};function js(e){if(!e)return{};let{errorMap:t,invalid_type_error:r,required_error:n,description:a}=e;if(t&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:a}:{errorMap:(c,l)=>{var f,d;let{message:m}=e;return c.code==="invalid_enum_value"?{message:m!=null?m:l.defaultError}:typeof l.data>"u"?{message:(f=m!=null?m:n)!==null&&f!==void 0?f:l.defaultError}:c.code!=="invalid_type"?{message:l.defaultError}:{message:(d=m!=null?m:r)!==null&&d!==void 0?d:l.defaultError}},description:a}}var Ms=class{get description(){return this._def.description}_getType(t){return p2(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:p2(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new ch,ctx:{common:t.parent.common,data:t.data,parsedType:p2(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let r=this._parse(t);if(Dj(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(t){let r=this._parse(t);return Promise.resolve(r)}parse(t,r){let n=this.safeParse(t,r);if(n.success)return n.data;throw n.error}safeParse(t,r){var n;let a={common:{issues:[],async:(n=r==null?void 0:r.async)!==null&&n!==void 0?n:!1,contextualErrorMap:r==null?void 0:r.errorMap},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:p2(t)},s=this._parseSync({data:t,path:a.path,parent:a});return Mqe(a,s)}"~validate"(t){var r,n;let a={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:p2(t)};if(!this["~standard"].async)try{let s=this._parseSync({data:t,path:[],parent:a});return mT(s)?{value:s.value}:{issues:a.common.issues}}catch(s){!((n=(r=s==null?void 0:s.message)===null||r===void 0?void 0:r.toLowerCase())===null||n===void 0)&&n.includes("encountered")&&(this["~standard"].async=!0),a.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:a}).then(s=>mT(s)?{value:s.value}:{issues:a.common.issues})}async parseAsync(t,r){let n=await this.safeParseAsync(t,r);if(n.success)return n.data;throw n.error}async safeParseAsync(t,r){let n={common:{issues:[],contextualErrorMap:r==null?void 0:r.errorMap,async:!0},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:p2(t)},a=this._parse({data:t,path:n.path,parent:n}),s=await(Dj(a)?a:Promise.resolve(a));return Mqe(n,s)}refine(t,r){let n=a=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(a):r;return this._refinement((a,s)=>{let c=t(a),l=()=>s.addIssue({code:Yr.custom,...n(a)});return typeof Promise<"u"&&c instanceof Promise?c.then(f=>f?!0:(l(),!1)):c?!0:(l(),!1)})}refinement(t,r){return this._refinement((n,a)=>t(n)?!0:(a.addIssue(typeof r=="function"?r(n,a):r),!1))}_refinement(t){return new Ug({schema:this,typeName:os.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:r=>this["~validate"](r)}}optional(){return uy.create(this,this._def)}nullable(){return sE.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return d2.create(this)}promise(){return JC.create(this,this._def)}or(t){return ET.create([this,t],this._def)}and(t){return wT.create(this,t,this._def)}transform(t){return new Ug({...js(this._def),schema:this,typeName:os.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let r=typeof t=="function"?t:()=>t;return new kT({...js(this._def),innerType:this,defaultValue:r,typeName:os.ZodDefault})}brand(){return new Pj({typeName:os.ZodBranded,type:this,...js(this._def)})}catch(t){let r=typeof t=="function"?t:()=>t;return new TT({...js(this._def),innerType:this,catchValue:r,typeName:os.ZodCatch})}describe(t){let r=this.constructor;return new r({...this._def,description:t})}pipe(t){return Rj.create(this,t)}readonly(){return BT.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},Xer=/^c[^\s-]{8,}$/i,Zer=/^[0-9a-z]+$/,etr=/^[0-9A-HJKMNP-TV-Z]{26}$/i,ttr=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,rtr=/^[a-z0-9_-]{21}$/i,ntr=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,itr=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,str=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,atr="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",uue,otr=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ctr=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,utr=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,ltr=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,ftr=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,dtr=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Vqe="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",htr=new RegExp(`^${Vqe}$`);function $qe(e){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`),t}function mtr(e){return new RegExp(`^${$qe(e)}$`)}function Wqe(e){let t=`${Vqe}T${$qe(e)}`,r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function gtr(e,t){return!!((t==="v4"||!t)&&otr.test(e)||(t==="v6"||!t)&&utr.test(e))}function Atr(e,t){if(!ntr.test(e))return!1;try{let[r]=e.split("."),n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),a=JSON.parse(atob(n));return!(typeof a!="object"||a===null||!a.typ||!a.alg||t&&a.alg!==t)}catch{return!1}}function ytr(e,t){return!!((t==="v4"||!t)&&ctr.test(e)||(t==="v6"||!t)&<r.test(e))}var GC=class e extends Ms{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==Mn.string){let s=this._getOrReturnCtx(t);return _n(s,{code:Yr.invalid_type,expected:Mn.string,received:s.parsedType}),ps}let n=new ch,a;for(let s of this._def.checks)if(s.kind==="min")t.data.length<s.value&&(a=this._getOrReturnCtx(t,a),_n(a,{code:Yr.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="max")t.data.length>s.value&&(a=this._getOrReturnCtx(t,a),_n(a,{code:Yr.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="length"){let c=t.data.length>s.value,l=t.data.length<s.value;(c||l)&&(a=this._getOrReturnCtx(t,a),c?_n(a,{code:Yr.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):l&&_n(a,{code:Yr.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),n.dirty())}else if(s.kind==="email")str.test(t.data)||(a=this._getOrReturnCtx(t,a),_n(a,{validation:"email",code:Yr.invalid_string,message:s.message}),n.dirty());else if(s.kind==="emoji")uue||(uue=new RegExp(atr,"u")),uue.test(t.data)||(a=this._getOrReturnCtx(t,a),_n(a,{validation:"emoji",code:Yr.invalid_string,message:s.message}),n.dirty());else if(s.kind==="uuid")ttr.test(t.data)||(a=this._getOrReturnCtx(t,a),_n(a,{validation:"uuid",code:Yr.invalid_string,message:s.message}),n.dirty());else if(s.kind==="nanoid")rtr.test(t.data)||(a=this._getOrReturnCtx(t,a),_n(a,{validation:"nanoid",code:Yr.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid")Xer.test(t.data)||(a=this._getOrReturnCtx(t,a),_n(a,{validation:"cuid",code:Yr.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid2")Zer.test(t.data)||(a=this._getOrReturnCtx(t,a),_n(a,{validation:"cuid2",code:Yr.invalid_string,message:s.message}),n.dirty());else if(s.kind==="ulid")etr.test(t.data)||(a=this._getOrReturnCtx(t,a),_n(a,{validation:"ulid",code:Yr.invalid_string,message:s.message}),n.dirty());else if(s.kind==="url")try{new URL(t.data)}catch{a=this._getOrReturnCtx(t,a),_n(a,{validation:"url",code:Yr.invalid_string,message:s.message}),n.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(t.data)||(a=this._getOrReturnCtx(t,a),_n(a,{validation:"regex",code:Yr.invalid_string,message:s.message}),n.dirty())):s.kind==="trim"?t.data=t.data.trim():s.kind==="includes"?t.data.includes(s.value,s.position)||(a=this._getOrReturnCtx(t,a),_n(a,{code:Yr.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),n.dirty()):s.kind==="toLowerCase"?t.data=t.data.toLowerCase():s.kind==="toUpperCase"?t.data=t.data.toUpperCase():s.kind==="startsWith"?t.data.startsWith(s.value)||(a=this._getOrReturnCtx(t,a),_n(a,{code:Yr.invalid_string,validation:{startsWith:s.value},message:s.message}),n.dirty()):s.kind==="endsWith"?t.data.endsWith(s.value)||(a=this._getOrReturnCtx(t,a),_n(a,{code:Yr.invalid_string,validation:{endsWith:s.value},message:s.message}),n.dirty()):s.kind==="datetime"?Wqe(s).test(t.data)||(a=this._getOrReturnCtx(t,a),_n(a,{code:Yr.invalid_string,validation:"datetime",message:s.message}),n.dirty()):s.kind==="date"?htr.test(t.data)||(a=this._getOrReturnCtx(t,a),_n(a,{code:Yr.invalid_string,validation:"date",message:s.message}),n.dirty()):s.kind==="time"?mtr(s).test(t.data)||(a=this._getOrReturnCtx(t,a),_n(a,{code:Yr.invalid_string,validation:"time",message:s.message}),n.dirty()):s.kind==="duration"?itr.test(t.data)||(a=this._getOrReturnCtx(t,a),_n(a,{validation:"duration",code:Yr.invalid_string,message:s.message}),n.dirty()):s.kind==="ip"?gtr(t.data,s.version)||(a=this._getOrReturnCtx(t,a),_n(a,{validation:"ip",code:Yr.invalid_string,message:s.message}),n.dirty()):s.kind==="jwt"?Atr(t.data,s.alg)||(a=this._getOrReturnCtx(t,a),_n(a,{validation:"jwt",code:Yr.invalid_string,message:s.message}),n.dirty()):s.kind==="cidr"?ytr(t.data,s.version)||(a=this._getOrReturnCtx(t,a),_n(a,{validation:"cidr",code:Yr.invalid_string,message:s.message}),n.dirty()):s.kind==="base64"?ftr.test(t.data)||(a=this._getOrReturnCtx(t,a),_n(a,{validation:"base64",code:Yr.invalid_string,message:s.message}),n.dirty()):s.kind==="base64url"?dtr.test(t.data)||(a=this._getOrReturnCtx(t,a),_n(a,{validation:"base64url",code:Yr.invalid_string,message:s.message}),n.dirty()):po.assertNever(s);return{status:n.value,value:t.data}}_regex(t,r,n){return this.refinement(a=>t.test(a),{validation:r,code:Yr.invalid_string,...mi.errToObj(n)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...mi.errToObj(t)})}url(t){return this._addCheck({kind:"url",...mi.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...mi.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...mi.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...mi.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...mi.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...mi.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...mi.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...mi.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...mi.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...mi.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...mi.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...mi.errToObj(t)})}datetime(t){var r,n;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(r=t==null?void 0:t.offset)!==null&&r!==void 0?r:!1,local:(n=t==null?void 0:t.local)!==null&&n!==void 0?n:!1,...mi.errToObj(t==null?void 0:t.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,...mi.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...mi.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...mi.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r==null?void 0:r.position,...mi.errToObj(r==null?void 0:r.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...mi.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...mi.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...mi.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...mi.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...mi.errToObj(r)})}nonempty(t){return this.min(1,mi.errToObj(t))}trim(){return new e({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxLength(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};GC.create=e=>{var t;return new GC({checks:[],typeName:os.ZodString,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...js(e)})};function vtr(e,t){let r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,a=r>n?r:n,s=parseInt(e.toFixed(a).replace(".","")),c=parseInt(t.toFixed(a).replace(".",""));return s%c/Math.pow(10,a)}var gT=class e extends Ms{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==Mn.number){let s=this._getOrReturnCtx(t);return _n(s,{code:Yr.invalid_type,expected:Mn.number,received:s.parsedType}),ps}let n,a=new ch;for(let s of this._def.checks)s.kind==="int"?po.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),_n(n,{code:Yr.invalid_type,expected:"integer",received:"float",message:s.message}),a.dirty()):s.kind==="min"?(s.inclusive?t.data<s.value:t.data<=s.value)&&(n=this._getOrReturnCtx(t,n),_n(n,{code:Yr.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),a.dirty()):s.kind==="max"?(s.inclusive?t.data>s.value:t.data>=s.value)&&(n=this._getOrReturnCtx(t,n),_n(n,{code:Yr.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),a.dirty()):s.kind==="multipleOf"?vtr(t.data,s.value)!==0&&(n=this._getOrReturnCtx(t,n),_n(n,{code:Yr.not_multiple_of,multipleOf:s.value,message:s.message}),a.dirty()):s.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),_n(n,{code:Yr.not_finite,message:s.message}),a.dirty()):po.assertNever(s);return{status:a.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,mi.toString(r))}gt(t,r){return this.setLimit("min",t,!1,mi.toString(r))}lte(t,r){return this.setLimit("max",t,!0,mi.toString(r))}lt(t,r){return this.setLimit("max",t,!1,mi.toString(r))}setLimit(t,r,n,a){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:mi.toString(a)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:mi.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:mi.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:mi.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:mi.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:mi.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:mi.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:mi.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:mi.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:mi.toString(t)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&po.isInteger(t.value))}get isFinite(){let t=null,r=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(t===null||n.value<t)&&(t=n.value)}return Number.isFinite(r)&&Number.isFinite(t)}};gT.create=e=>new gT({checks:[],typeName:os.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...js(e)});var AT=class e extends Ms{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==Mn.bigint)return this._getInvalidInput(t);let n,a=new ch;for(let s of this._def.checks)s.kind==="min"?(s.inclusive?t.data<s.value:t.data<=s.value)&&(n=this._getOrReturnCtx(t,n),_n(n,{code:Yr.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),a.dirty()):s.kind==="max"?(s.inclusive?t.data>s.value:t.data>=s.value)&&(n=this._getOrReturnCtx(t,n),_n(n,{code:Yr.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),a.dirty()):s.kind==="multipleOf"?t.data%s.value!==BigInt(0)&&(n=this._getOrReturnCtx(t,n),_n(n,{code:Yr.not_multiple_of,multipleOf:s.value,message:s.message}),a.dirty()):po.assertNever(s);return{status:a.value,value:t.data}}_getInvalidInput(t){let r=this._getOrReturnCtx(t);return _n(r,{code:Yr.invalid_type,expected:Mn.bigint,received:r.parsedType}),ps}gte(t,r){return this.setLimit("min",t,!0,mi.toString(r))}gt(t,r){return this.setLimit("min",t,!1,mi.toString(r))}lte(t,r){return this.setLimit("max",t,!0,mi.toString(r))}lt(t,r){return this.setLimit("max",t,!1,mi.toString(r))}setLimit(t,r,n,a){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:mi.toString(a)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:mi.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:mi.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:mi.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:mi.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:mi.toString(r)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};AT.create=e=>{var t;return new AT({checks:[],typeName:os.ZodBigInt,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...js(e)})};var yT=class extends Ms{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==Mn.boolean){let n=this._getOrReturnCtx(t);return _n(n,{code:Yr.invalid_type,expected:Mn.boolean,received:n.parsedType}),ps}return nm(t.data)}};yT.create=e=>new yT({typeName:os.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...js(e)});var vT=class e extends Ms{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==Mn.date){let s=this._getOrReturnCtx(t);return _n(s,{code:Yr.invalid_type,expected:Mn.date,received:s.parsedType}),ps}if(isNaN(t.data.getTime())){let s=this._getOrReturnCtx(t);return _n(s,{code:Yr.invalid_date}),ps}let n=new ch,a;for(let s of this._def.checks)s.kind==="min"?t.data.getTime()<s.value&&(a=this._getOrReturnCtx(t,a),_n(a,{code:Yr.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),n.dirty()):s.kind==="max"?t.data.getTime()>s.value&&(a=this._getOrReturnCtx(t,a),_n(a,{code:Yr.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),n.dirty()):po.assertNever(s);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:mi.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:mi.toString(r)})}get minDate(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t!=null?new Date(t):null}};vT.create=e=>new vT({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:os.ZodDate,...js(e)});var uN=class extends Ms{_parse(t){if(this._getType(t)!==Mn.symbol){let n=this._getOrReturnCtx(t);return _n(n,{code:Yr.invalid_type,expected:Mn.symbol,received:n.parsedType}),ps}return nm(t.data)}};uN.create=e=>new uN({typeName:os.ZodSymbol,...js(e)});var xT=class extends Ms{_parse(t){if(this._getType(t)!==Mn.undefined){let n=this._getOrReturnCtx(t);return _n(n,{code:Yr.invalid_type,expected:Mn.undefined,received:n.parsedType}),ps}return nm(t.data)}};xT.create=e=>new xT({typeName:os.ZodUndefined,...js(e)});var bT=class extends Ms{_parse(t){if(this._getType(t)!==Mn.null){let n=this._getOrReturnCtx(t);return _n(n,{code:Yr.invalid_type,expected:Mn.null,received:n.parsedType}),ps}return nm(t.data)}};bT.create=e=>new bT({typeName:os.ZodNull,...js(e)});var YC=class extends Ms{constructor(){super(...arguments),this._any=!0}_parse(t){return nm(t.data)}};YC.create=e=>new YC({typeName:os.ZodAny,...js(e)});var f2=class extends Ms{constructor(){super(...arguments),this._unknown=!0}_parse(t){return nm(t.data)}};f2.create=e=>new f2({typeName:os.ZodUnknown,...js(e)});var Zv=class extends Ms{_parse(t){let r=this._getOrReturnCtx(t);return _n(r,{code:Yr.invalid_type,expected:Mn.never,received:r.parsedType}),ps}};Zv.create=e=>new Zv({typeName:os.ZodNever,...js(e)});var lN=class extends Ms{_parse(t){if(this._getType(t)!==Mn.undefined){let n=this._getOrReturnCtx(t);return _n(n,{code:Yr.invalid_type,expected:Mn.void,received:n.parsedType}),ps}return nm(t.data)}};lN.create=e=>new lN({typeName:os.ZodVoid,...js(e)});var d2=class e extends Ms{_parse(t){let{ctx:r,status:n}=this._processInputParams(t),a=this._def;if(r.parsedType!==Mn.array)return _n(r,{code:Yr.invalid_type,expected:Mn.array,received:r.parsedType}),ps;if(a.exactLength!==null){let c=r.data.length>a.exactLength.value,l=r.data.length<a.exactLength.value;(c||l)&&(_n(r,{code:c?Yr.too_big:Yr.too_small,minimum:l?a.exactLength.value:void 0,maximum:c?a.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:a.exactLength.message}),n.dirty())}if(a.minLength!==null&&r.data.length<a.minLength.value&&(_n(r,{code:Yr.too_small,minimum:a.minLength.value,type:"array",inclusive:!0,exact:!1,message:a.minLength.message}),n.dirty()),a.maxLength!==null&&r.data.length>a.maxLength.value&&(_n(r,{code:Yr.too_big,maximum:a.maxLength.value,type:"array",inclusive:!0,exact:!1,message:a.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((c,l)=>a.type._parseAsync(new ly(r,c,r.path,l)))).then(c=>ch.mergeArray(n,c));let s=[...r.data].map((c,l)=>a.type._parseSync(new ly(r,c,r.path,l)));return ch.mergeArray(n,s)}get element(){return this._def.type}min(t,r){return new e({...this._def,minLength:{value:t,message:mi.toString(r)}})}max(t,r){return new e({...this._def,maxLength:{value:t,message:mi.toString(r)}})}length(t,r){return new e({...this._def,exactLength:{value:t,message:mi.toString(r)}})}nonempty(t){return this.min(1,t)}};d2.create=(e,t)=>new d2({type:e,minLength:null,maxLength:null,exactLength:null,typeName:os.ZodArray,...js(t)});function aN(e){if(e instanceof P0){let t={};for(let r in e.shape){let n=e.shape[r];t[r]=uy.create(aN(n))}return new P0({...e._def,shape:()=>t})}else return e instanceof d2?new d2({...e._def,type:aN(e.element)}):e instanceof uy?uy.create(aN(e.unwrap())):e instanceof sE?sE.create(aN(e.unwrap())):e instanceof iE?iE.create(e.items.map(t=>aN(t))):e}var P0=class e extends Ms{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let t=this._def.shape(),r=po.objectKeys(t);return this._cached={shape:t,keys:r}}_parse(t){if(this._getType(t)!==Mn.object){let d=this._getOrReturnCtx(t);return _n(d,{code:Yr.invalid_type,expected:Mn.object,received:d.parsedType}),ps}let{status:n,ctx:a}=this._processInputParams(t),{shape:s,keys:c}=this._getCached(),l=[];if(!(this._def.catchall instanceof Zv&&this._def.unknownKeys==="strip"))for(let d in a.data)c.includes(d)||l.push(d);let f=[];for(let d of c){let m=s[d],g=a.data[d];f.push({key:{status:"valid",value:d},value:m._parse(new ly(a,g,a.path,d)),alwaysSet:d in a.data})}if(this._def.catchall instanceof Zv){let d=this._def.unknownKeys;if(d==="passthrough")for(let m of l)f.push({key:{status:"valid",value:m},value:{status:"valid",value:a.data[m]}});else if(d==="strict")l.length>0&&(_n(a,{code:Yr.unrecognized_keys,keys:l}),n.dirty());else if(d!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let d=this._def.catchall;for(let m of l){let g=a.data[m];f.push({key:{status:"valid",value:m},value:d._parse(new ly(a,g,a.path,m)),alwaysSet:m in a.data})}}return a.common.async?Promise.resolve().then(async()=>{let d=[];for(let m of f){let g=await m.key,x=await m.value;d.push({key:g,value:x,alwaysSet:m.alwaysSet})}return d}).then(d=>ch.mergeObjectSync(n,d)):ch.mergeObjectSync(n,f)}get shape(){return this._def.shape()}strict(t){return mi.errToObj,new e({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(r,n)=>{var a,s,c,l;let f=(c=(s=(a=this._def).errorMap)===null||s===void 0?void 0:s.call(a,r,n).message)!==null&&c!==void 0?c:n.defaultError;return r.code==="unrecognized_keys"?{message:(l=mi.errToObj(t).message)!==null&&l!==void 0?l:f}:{message:f}}}:{}})}strip(){return new e({...this._def,unknownKeys:"strip"})}passthrough(){return new e({...this._def,unknownKeys:"passthrough"})}extend(t){return new e({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:os.ZodObject})}setKey(t,r){return this.augment({[t]:r})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let r={};return po.objectKeys(t).forEach(n=>{t[n]&&this.shape[n]&&(r[n]=this.shape[n])}),new e({...this._def,shape:()=>r})}omit(t){let r={};return po.objectKeys(this.shape).forEach(n=>{t[n]||(r[n]=this.shape[n])}),new e({...this._def,shape:()=>r})}deepPartial(){return aN(this)}partial(t){let r={};return po.objectKeys(this.shape).forEach(n=>{let a=this.shape[n];t&&!t[n]?r[n]=a:r[n]=a.optional()}),new e({...this._def,shape:()=>r})}required(t){let r={};return po.objectKeys(this.shape).forEach(n=>{if(t&&!t[n])r[n]=this.shape[n];else{let s=this.shape[n];for(;s instanceof uy;)s=s._def.innerType;r[n]=s}}),new e({...this._def,shape:()=>r})}keyof(){return Gqe(po.objectKeys(this.shape))}};P0.create=(e,t)=>new P0({shape:()=>e,unknownKeys:"strip",catchall:Zv.create(),typeName:os.ZodObject,...js(t)});P0.strictCreate=(e,t)=>new P0({shape:()=>e,unknownKeys:"strict",catchall:Zv.create(),typeName:os.ZodObject,...js(t)});P0.lazycreate=(e,t)=>new P0({shape:e,unknownKeys:"strip",catchall:Zv.create(),typeName:os.ZodObject,...js(t)});var ET=class extends Ms{_parse(t){let{ctx:r}=this._processInputParams(t),n=this._def.options;function a(s){for(let l of s)if(l.result.status==="valid")return l.result;for(let l of s)if(l.result.status==="dirty")return r.common.issues.push(...l.ctx.common.issues),l.result;let c=s.map(l=>new qg(l.ctx.common.issues));return _n(r,{code:Yr.invalid_union,unionErrors:c}),ps}if(r.common.async)return Promise.all(n.map(async s=>{let c={...r,common:{...r.common,issues:[]},parent:null};return{result:await s._parseAsync({data:r.data,path:r.path,parent:c}),ctx:c}})).then(a);{let s,c=[];for(let f of n){let d={...r,common:{...r.common,issues:[]},parent:null},m=f._parseSync({data:r.data,path:r.path,parent:d});if(m.status==="valid")return m;m.status==="dirty"&&!s&&(s={result:m,ctx:d}),d.common.issues.length&&c.push(d.common.issues)}if(s)return r.common.issues.push(...s.ctx.common.issues),s.result;let l=c.map(f=>new qg(f));return _n(r,{code:Yr.invalid_union,unionErrors:l}),ps}}get options(){return this._def.options}};ET.create=(e,t)=>new ET({options:e,typeName:os.ZodUnion,...js(t)});var l2=e=>e instanceof ST?l2(e.schema):e instanceof Ug?l2(e.innerType()):e instanceof CT?[e.value]:e instanceof _T?e.options:e instanceof IT?po.objectValues(e.enum):e instanceof kT?l2(e._def.innerType):e instanceof xT?[void 0]:e instanceof bT?[null]:e instanceof uy?[void 0,...l2(e.unwrap())]:e instanceof sE?[null,...l2(e.unwrap())]:e instanceof Pj||e instanceof BT?l2(e.unwrap()):e instanceof TT?l2(e._def.innerType):[],NH=class e extends Ms{_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==Mn.object)return _n(r,{code:Yr.invalid_type,expected:Mn.object,received:r.parsedType}),ps;let n=this.discriminator,a=r.data[n],s=this.optionsMap.get(a);return s?r.common.async?s._parseAsync({data:r.data,path:r.path,parent:r}):s._parseSync({data:r.data,path:r.path,parent:r}):(_n(r,{code:Yr.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),ps)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,r,n){let a=new Map;for(let s of r){let c=l2(s.shape[t]);if(!c.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let l of c){if(a.has(l))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(l)}`);a.set(l,s)}}return new e({typeName:os.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:a,...js(n)})}};function due(e,t){let r=p2(e),n=p2(t);if(e===t)return{valid:!0,data:e};if(r===Mn.object&&n===Mn.object){let a=po.objectKeys(t),s=po.objectKeys(e).filter(l=>a.indexOf(l)!==-1),c={...e,...t};for(let l of s){let f=due(e[l],t[l]);if(!f.valid)return{valid:!1};c[l]=f.data}return{valid:!0,data:c}}else if(r===Mn.array&&n===Mn.array){if(e.length!==t.length)return{valid:!1};let a=[];for(let s=0;s<e.length;s++){let c=e[s],l=t[s],f=due(c,l);if(!f.valid)return{valid:!1};a.push(f.data)}return{valid:!0,data:a}}else return r===Mn.date&&n===Mn.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}var wT=class extends Ms{_parse(t){let{status:r,ctx:n}=this._processInputParams(t),a=(s,c)=>{if(pue(s)||pue(c))return ps;let l=due(s.value,c.value);return l.valid?((fue(s)||fue(c))&&r.dirty(),{status:r.value,value:l.data}):(_n(n,{code:Yr.invalid_intersection_types}),ps)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([s,c])=>a(s,c)):a(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};wT.create=(e,t,r)=>new wT({left:e,right:t,typeName:os.ZodIntersection,...js(r)});var iE=class e extends Ms{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==Mn.array)return _n(n,{code:Yr.invalid_type,expected:Mn.array,received:n.parsedType}),ps;if(n.data.length<this._def.items.length)return _n(n,{code:Yr.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),ps;!this._def.rest&&n.data.length>this._def.items.length&&(_n(n,{code:Yr.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let s=[...n.data].map((c,l)=>{let f=this._def.items[l]||this._def.rest;return f?f._parse(new ly(n,c,n.path,l)):null}).filter(c=>!!c);return n.common.async?Promise.all(s).then(c=>ch.mergeArray(r,c)):ch.mergeArray(r,s)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};iE.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new iE({items:e,typeName:os.ZodTuple,rest:null,...js(t)})};var FH=class e extends Ms{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==Mn.object)return _n(n,{code:Yr.invalid_type,expected:Mn.object,received:n.parsedType}),ps;let a=[],s=this._def.keyType,c=this._def.valueType;for(let l in n.data)a.push({key:s._parse(new ly(n,l,n.path,l)),value:c._parse(new ly(n,n.data[l],n.path,l)),alwaysSet:l in n.data});return n.common.async?ch.mergeObjectAsync(r,a):ch.mergeObjectSync(r,a)}get element(){return this._def.valueType}static create(t,r,n){return r instanceof Ms?new e({keyType:t,valueType:r,typeName:os.ZodRecord,...js(n)}):new e({keyType:GC.create(),valueType:t,typeName:os.ZodRecord,...js(r)})}},pN=class extends Ms{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==Mn.map)return _n(n,{code:Yr.invalid_type,expected:Mn.map,received:n.parsedType}),ps;let a=this._def.keyType,s=this._def.valueType,c=[...n.data.entries()].map(([l,f],d)=>({key:a._parse(new ly(n,l,n.path,[d,"key"])),value:s._parse(new ly(n,f,n.path,[d,"value"]))}));if(n.common.async){let l=new Map;return Promise.resolve().then(async()=>{for(let f of c){let d=await f.key,m=await f.value;if(d.status==="aborted"||m.status==="aborted")return ps;(d.status==="dirty"||m.status==="dirty")&&r.dirty(),l.set(d.value,m.value)}return{status:r.value,value:l}})}else{let l=new Map;for(let f of c){let d=f.key,m=f.value;if(d.status==="aborted"||m.status==="aborted")return ps;(d.status==="dirty"||m.status==="dirty")&&r.dirty(),l.set(d.value,m.value)}return{status:r.value,value:l}}}};pN.create=(e,t,r)=>new pN({valueType:t,keyType:e,typeName:os.ZodMap,...js(r)});var fN=class e extends Ms{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==Mn.set)return _n(n,{code:Yr.invalid_type,expected:Mn.set,received:n.parsedType}),ps;let a=this._def;a.minSize!==null&&n.data.size<a.minSize.value&&(_n(n,{code:Yr.too_small,minimum:a.minSize.value,type:"set",inclusive:!0,exact:!1,message:a.minSize.message}),r.dirty()),a.maxSize!==null&&n.data.size>a.maxSize.value&&(_n(n,{code:Yr.too_big,maximum:a.maxSize.value,type:"set",inclusive:!0,exact:!1,message:a.maxSize.message}),r.dirty());let s=this._def.valueType;function c(f){let d=new Set;for(let m of f){if(m.status==="aborted")return ps;m.status==="dirty"&&r.dirty(),d.add(m.value)}return{status:r.value,value:d}}let l=[...n.data.values()].map((f,d)=>s._parse(new ly(n,f,n.path,d)));return n.common.async?Promise.all(l).then(f=>c(f)):c(l)}min(t,r){return new e({...this._def,minSize:{value:t,message:mi.toString(r)}})}max(t,r){return new e({...this._def,maxSize:{value:t,message:mi.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}};fN.create=(e,t)=>new fN({valueType:e,minSize:null,maxSize:null,typeName:os.ZodSet,...js(t)});var OH=class e extends Ms{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==Mn.function)return _n(r,{code:Yr.invalid_type,expected:Mn.function,received:r.parsedType}),ps;function n(l,f){return PH({data:l,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,DH(),cN].filter(d=>!!d),issueData:{code:Yr.invalid_arguments,argumentsError:f}})}function a(l,f){return PH({data:l,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,DH(),cN].filter(d=>!!d),issueData:{code:Yr.invalid_return_type,returnTypeError:f}})}let s={errorMap:r.common.contextualErrorMap},c=r.data;if(this._def.returns instanceof JC){let l=this;return nm(async function(...f){let d=new qg([]),m=await l._def.args.parseAsync(f,s).catch(b=>{throw d.addIssue(n(f,b)),d}),g=await Reflect.apply(c,this,m);return await l._def.returns._def.type.parseAsync(g,s).catch(b=>{throw d.addIssue(a(g,b)),d})})}else{let l=this;return nm(function(...f){let d=l._def.args.safeParse(f,s);if(!d.success)throw new qg([n(f,d.error)]);let m=Reflect.apply(c,this,d.data),g=l._def.returns.safeParse(m,s);if(!g.success)throw new qg([a(m,g.error)]);return g.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:iE.create(t).rest(f2.create())})}returns(t){return new e({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,r,n){return new e({args:t||iE.create([]).rest(f2.create()),returns:r||f2.create(),typeName:os.ZodFunction,...js(n)})}},ST=class extends Ms{get schema(){return this._def.getter()}_parse(t){let{ctx:r}=this._processInputParams(t);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};ST.create=(e,t)=>new ST({getter:e,typeName:os.ZodLazy,...js(t)});var CT=class extends Ms{_parse(t){if(t.data!==this._def.value){let r=this._getOrReturnCtx(t);return _n(r,{received:r.data,code:Yr.invalid_literal,expected:this._def.value}),ps}return{status:"valid",value:t.data}}get value(){return this._def.value}};CT.create=(e,t)=>new CT({value:e,typeName:os.ZodLiteral,...js(t)});function Gqe(e,t){return new _T({values:e,typeName:os.ZodEnum,...js(t)})}var _T=class e extends Ms{constructor(){super(...arguments),Tj.set(this,void 0)}_parse(t){if(typeof t.data!="string"){let r=this._getOrReturnCtx(t),n=this._def.values;return _n(r,{expected:po.joinValues(n),received:r.parsedType,code:Yr.invalid_type}),ps}if(RH(this,Tj,"f")||Hqe(this,Tj,new Set(this._def.values),"f"),!RH(this,Tj,"f").has(t.data)){let r=this._getOrReturnCtx(t),n=this._def.values;return _n(r,{received:r.data,code:Yr.invalid_enum_value,options:n}),ps}return nm(t.data)}get options(){return this._def.values}get enum(){let t={};for(let r of this._def.values)t[r]=r;return t}get Values(){let t={};for(let r of this._def.values)t[r]=r;return t}get Enum(){let t={};for(let r of this._def.values)t[r]=r;return t}extract(t,r=this._def){return e.create(t,{...this._def,...r})}exclude(t,r=this._def){return e.create(this.options.filter(n=>!t.includes(n)),{...this._def,...r})}};Tj=new WeakMap;_T.create=Gqe;var IT=class extends Ms{constructor(){super(...arguments),Bj.set(this,void 0)}_parse(t){let r=po.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==Mn.string&&n.parsedType!==Mn.number){let a=po.objectValues(r);return _n(n,{expected:po.joinValues(a),received:n.parsedType,code:Yr.invalid_type}),ps}if(RH(this,Bj,"f")||Hqe(this,Bj,new Set(po.getValidEnumValues(this._def.values)),"f"),!RH(this,Bj,"f").has(t.data)){let a=po.objectValues(r);return _n(n,{received:n.data,code:Yr.invalid_enum_value,options:a}),ps}return nm(t.data)}get enum(){return this._def.values}};Bj=new WeakMap;IT.create=(e,t)=>new IT({values:e,typeName:os.ZodNativeEnum,...js(t)});var JC=class extends Ms{unwrap(){return this._def.type}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==Mn.promise&&r.common.async===!1)return _n(r,{code:Yr.invalid_type,expected:Mn.promise,received:r.parsedType}),ps;let n=r.parsedType===Mn.promise?r.data:Promise.resolve(r.data);return nm(n.then(a=>this._def.type.parseAsync(a,{path:r.path,errorMap:r.common.contextualErrorMap})))}};JC.create=(e,t)=>new JC({type:e,typeName:os.ZodPromise,...js(t)});var Ug=class extends Ms{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===os.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){let{status:r,ctx:n}=this._processInputParams(t),a=this._def.effect||null,s={addIssue:c=>{_n(n,c),c.fatal?r.abort():r.dirty()},get path(){return n.path}};if(s.addIssue=s.addIssue.bind(s),a.type==="preprocess"){let c=a.transform(n.data,s);if(n.common.async)return Promise.resolve(c).then(async l=>{if(r.value==="aborted")return ps;let f=await this._def.schema._parseAsync({data:l,path:n.path,parent:n});return f.status==="aborted"?ps:f.status==="dirty"||r.value==="dirty"?oN(f.value):f});{if(r.value==="aborted")return ps;let l=this._def.schema._parseSync({data:c,path:n.path,parent:n});return l.status==="aborted"?ps:l.status==="dirty"||r.value==="dirty"?oN(l.value):l}}if(a.type==="refinement"){let c=l=>{let f=a.refinement(l,s);if(n.common.async)return Promise.resolve(f);if(f instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return l};if(n.common.async===!1){let l=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return l.status==="aborted"?ps:(l.status==="dirty"&&r.dirty(),c(l.value),{status:r.value,value:l.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(l=>l.status==="aborted"?ps:(l.status==="dirty"&&r.dirty(),c(l.value).then(()=>({status:r.value,value:l.value}))))}if(a.type==="transform")if(n.common.async===!1){let c=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!mT(c))return c;let l=a.transform(c.value,s);if(l instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:l}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(c=>mT(c)?Promise.resolve(a.transform(c.value,s)).then(l=>({status:r.value,value:l})):c);po.assertNever(a)}};Ug.create=(e,t,r)=>new Ug({schema:e,typeName:os.ZodEffects,effect:t,...js(r)});Ug.createWithPreprocess=(e,t,r)=>new Ug({schema:t,effect:{type:"preprocess",transform:e},typeName:os.ZodEffects,...js(r)});var uy=class extends Ms{_parse(t){return this._getType(t)===Mn.undefined?nm(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};uy.create=(e,t)=>new uy({innerType:e,typeName:os.ZodOptional,...js(t)});var sE=class extends Ms{_parse(t){return this._getType(t)===Mn.null?nm(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};sE.create=(e,t)=>new sE({innerType:e,typeName:os.ZodNullable,...js(t)});var kT=class extends Ms{_parse(t){let{ctx:r}=this._processInputParams(t),n=r.data;return r.parsedType===Mn.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};kT.create=(e,t)=>new kT({innerType:e,typeName:os.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...js(t)});var TT=class extends Ms{_parse(t){let{ctx:r}=this._processInputParams(t),n={...r,common:{...r.common,issues:[]}},a=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return Dj(a)?a.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new qg(n.common.issues)},input:n.data})})):{status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new qg(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};TT.create=(e,t)=>new TT({innerType:e,typeName:os.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...js(t)});var dN=class extends Ms{_parse(t){if(this._getType(t)!==Mn.nan){let n=this._getOrReturnCtx(t);return _n(n,{code:Yr.invalid_type,expected:Mn.nan,received:n.parsedType}),ps}return{status:"valid",value:t.data}}};dN.create=e=>new dN({typeName:os.ZodNaN,...js(e)});var xtr=Symbol("zod_brand"),Pj=class extends Ms{_parse(t){let{ctx:r}=this._processInputParams(t),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}},Rj=class e extends Ms{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.common.async)return(async()=>{let s=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?ps:s.status==="dirty"?(r.dirty(),oN(s.value)):this._def.out._parseAsync({data:s.value,path:n.path,parent:n})})();{let a=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?ps:a.status==="dirty"?(r.dirty(),{status:"dirty",value:a.value}):this._def.out._parseSync({data:a.value,path:n.path,parent:n})}}static create(t,r){return new e({in:t,out:r,typeName:os.ZodPipeline})}},BT=class extends Ms{_parse(t){let r=this._def.innerType._parse(t),n=a=>(mT(a)&&(a.value=Object.freeze(a.value)),a);return Dj(r)?r.then(a=>n(a)):n(r)}unwrap(){return this._def.innerType}};BT.create=(e,t)=>new BT({innerType:e,typeName:os.ZodReadonly,...js(t)});function qqe(e,t){let r=typeof e=="function"?e(t):typeof e=="string"?{message:e}:e;return typeof r=="string"?{message:r}:r}function Yqe(e,t={},r){return e?YC.create().superRefine((n,a)=>{var s,c;let l=e(n);if(l instanceof Promise)return l.then(f=>{var d,m;if(!f){let g=qqe(t,n),x=(m=(d=g.fatal)!==null&&d!==void 0?d:r)!==null&&m!==void 0?m:!0;a.addIssue({code:"custom",...g,fatal:x})}});if(!l){let f=qqe(t,n),d=(c=(s=f.fatal)!==null&&s!==void 0?s:r)!==null&&c!==void 0?c:!0;a.addIssue({code:"custom",...f,fatal:d})}}):YC.create()}var btr={object:P0.lazycreate},os;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(os||(os={}));var Etr=(e,t={message:`Input not instance of ${e.name}`})=>Yqe(r=>r instanceof e,t),Jqe=GC.create,Kqe=gT.create,wtr=dN.create,Str=AT.create,Xqe=yT.create,Ctr=vT.create,_tr=uN.create,Itr=xT.create,ktr=bT.create,Ttr=YC.create,Btr=f2.create,Dtr=Zv.create,Ptr=lN.create,Rtr=d2.create,Ntr=P0.create,Ftr=P0.strictCreate,Otr=ET.create,Qtr=NH.create,Ltr=wT.create,jtr=iE.create,Mtr=FH.create,qtr=pN.create,Utr=fN.create,ztr=OH.create,Htr=ST.create,Vtr=CT.create,$tr=_T.create,Wtr=IT.create,Gtr=JC.create,Uqe=Ug.create,Ytr=uy.create,Jtr=sE.create,Ktr=Ug.createWithPreprocess,Xtr=Rj.create,Ztr=()=>Jqe().optional(),trr=()=>Kqe().optional(),rrr=()=>Xqe().optional(),nrr={string:e=>GC.create({...e,coerce:!0}),number:e=>gT.create({...e,coerce:!0}),boolean:e=>yT.create({...e,coerce:!0}),bigint:e=>AT.create({...e,coerce:!0}),date:e=>vT.create({...e,coerce:!0})},irr=ps,Or=Object.freeze({__proto__:null,defaultErrorMap:cN,setErrorMap:Jer,getErrorMap:DH,makeIssue:PH,EMPTY_PATH:Ker,addIssueToContext:_n,ParseStatus:ch,INVALID:ps,DIRTY:oN,OK:nm,isAborted:pue,isDirty:fue,isValid:mT,isAsync:Dj,get util(){return po},get objectUtil(){return lue},ZodParsedType:Mn,getParsedType:p2,ZodType:Ms,datetimeRegex:Wqe,ZodString:GC,ZodNumber:gT,ZodBigInt:AT,ZodBoolean:yT,ZodDate:vT,ZodSymbol:uN,ZodUndefined:xT,ZodNull:bT,ZodAny:YC,ZodUnknown:f2,ZodNever:Zv,ZodVoid:lN,ZodArray:d2,ZodObject:P0,ZodUnion:ET,ZodDiscriminatedUnion:NH,ZodIntersection:wT,ZodTuple:iE,ZodRecord:FH,ZodMap:pN,ZodSet:fN,ZodFunction:OH,ZodLazy:ST,ZodLiteral:CT,ZodEnum:_T,ZodNativeEnum:IT,ZodPromise:JC,ZodEffects:Ug,ZodTransformer:Ug,ZodOptional:uy,ZodNullable:sE,ZodDefault:kT,ZodCatch:TT,ZodNaN:dN,BRAND:xtr,ZodBranded:Pj,ZodPipeline:Rj,ZodReadonly:BT,custom:Yqe,Schema:Ms,ZodSchema:Ms,late:btr,get ZodFirstPartyTypeKind(){return os},coerce:nrr,any:Ttr,array:Rtr,bigint:Str,boolean:Xqe,date:Ctr,discriminatedUnion:Qtr,effect:Uqe,enum:$tr,function:ztr,instanceof:Etr,intersection:Ltr,lazy:Htr,literal:Vtr,map:qtr,nan:wtr,nativeEnum:Wtr,never:Dtr,null:ktr,nullable:Jtr,number:Kqe,object:Ntr,oboolean:rrr,onumber:trr,optional:Ytr,ostring:Ztr,pipeline:Xtr,preprocess:Ktr,promise:Gtr,record:Mtr,set:Utr,strictObject:Ftr,string:Jqe,symbol:_tr,transformer:Uqe,tuple:jtr,undefined:Itr,union:Otr,unknown:Btr,void:Ptr,NEVER:irr,ZodIssueCode:Yr,quotelessJson:Yer,ZodError:qg});var sJn=Or.object({monitor:Or.array(Or.string()).optional(),command:Or.string().optional(),cwd:Or.string().optional(),target_file:Or.string()}),srr=Or.object({assets_dir:Or.string().optional(),proxy_path:Or.string().optional()}),aJn=Or.object({port:Or.union([Or.number(),Or.string()]).optional(),origin:Or.string().optional(),timeout:Or.union([Or.number(),Or.string()]).optional(),sandbox:Or.boolean().optional(),favicon:Or.boolean().optional(),minify:Or.boolean().optional(),site:srr.optional()}),arr=Or.object({target:Or.string(),operator:Or.union([Or.literal("equal"),Or.literal("notequal")]),values:Or.array(Or.string())}),orr=Or.object({condition:Or.array(arr)}),oJn=Or.object({minify:Or.boolean().optional(),rule:Or.array(orr).optional()}),crr=Or.object({maxDuration:Or.number().optional()}),cJn=Or.object({type:Or.enum(["header","cookie","host","query"]),key:Or.string(),value:Or.string().optional()}),gue=(e,t)=>{var a;let r=e.replace(/\\([?*])/g,"$1");return r.length===0?t.addIssue({code:Or.ZodIssueCode.custom,message:"length match error"}):/[^a-zA-Z0-9_\-/:*.~=?#!$&+,;%@ ]/.test(r)?t.addIssue({code:Or.ZodIssueCode.custom,message:"char match error"}):((a=r.match(/\*/g))==null?void 0:a.length)>1?t.addIssue({code:Or.ZodIssueCode.custom,message:"* match error"}):/[^a-zA-Z0-9_\-/:*.~=?#!$&+,;%@ ]:/.test(r)||/:(?![a-zA-Z0-9]+)/.test(r)?t.addIssue({code:Or.ZodIssueCode.custom,message:": match error"}):!0},LH=Or.object({source:Or.string().superRefine(gue)});function urr(e){let t=e.split(",").map(r=>r.trim()).filter(Boolean);for(let r of t){let n=r.indexOf("="),a=n===-1?r.trim().toLowerCase():r.slice(0,n).trim().toLowerCase();if(a==="stale-while-revalidate"||a==="stale-if-error"){let s=`${a}=86400`;if(n===-1)return`value match error: Cache-Control directive "${a}" must be in k=v form (e.g. ${s})`;if(!r.slice(n+1).trim())return`value match error: Cache-Control directive "${r}" must have a value (e.g. ${s})`}}}var lrr=Or.object({key:Or.string().min(1).max(100).superRefine((e,t)=>/[^a-zA-Z0-9-]/.test(e)?t.addIssue({code:Or.ZodIssueCode.custom,message:"char match error"}):!0),value:Or.string().min(1).max(1e3).superRefine((e,t)=>/[\u4e00-\u9fa5]/.test(e)?t.addIssue({code:Or.ZodIssueCode.custom,message:"char match error"}):!0)}).superRefine((e,t)=>{if(e.key.toLowerCase()==="cache-control"){let r=urr(e.value);r&&t.addIssue({code:Or.ZodIssueCode.custom,path:["value"],message:r})}}),prr=lrr.array().min(1),frr=LH.merge(Or.object({headers:prr})).array(),drr=Or.union([Or.literal(307),Or.literal(301),Or.literal(302),Or.literal(308),Or.literal(303),Or.literal(304)]),hrr=LH.merge(Or.object({destination:Or.string().superRefine(gue),permanent:Or.boolean().optional(),statusCode:drr.optional()})).array();var mrr=LH.merge(Or.object({destination:Or.string().superRefine(gue)})).array(),grr=LH.merge(Or.object({cacheTtl:Or.number()})).array(),Zqe=Or.object({included_files:Or.array(Or.string()).optional().describe("Glob patterns for files to include in the function bundle"),included_files_base_path:Or.string().optional().describe("Base path for included_files patterns, defaults to project root"),external_node_modules:Or.array(Or.string()).optional().describe("Node modules to be treated as external dependencies")}),e5e=Or.object({$schema:Or.string().transform(e=>"").optional(),outputDirectory:Or.string().optional().describe("the output directory relative to project root directory after run build command."),installCommand:Or.string().optional().describe("the install command to run."),buildCommand:Or.string().optional().describe("the build command to run."),nodeVersion:Or.string().optional().describe("the node version to use."),nodeFunctionsConfig:crr.optional(),headers:frr.optional(),redirects:hrr.optional(),rewrites:mrr.optional(),caches:grr.optional(),"node-functions":Zqe.optional().describe("Node function specific configuration"),"edge-functions":Zqe.optional().describe("Edge function specific configuration")}),hue=Symbol("filteredSchema"),QH=Symbol("symFilteredValue"),t5e=mue(e5e);function Arr(e){return e.errors.map(t=>`${t.message}`).join(`
|
|
537
537
|
`)}function py(){return!0}function mue(e,t=["root"]){if(e[hue])return e;let r=e;if((e instanceof Or.ZodOptional||e instanceof Or.ZodNullable||e instanceof Or.ZodReadonly||e instanceof Or.ZodPromise||e instanceof Or.ZodBranded)&&(r=e.unwrap()),r[hue])return r;let n=null;try{if(r instanceof Or.ZodArray){let a=mue(r.element,[...t,"[]"]);return n=Or.array(Or.any()).optional().transform(s=>{if(t.length===4&&t.includes("headers")&&(s?s!=null&&s.length||console.warn('"error in root.headers.[].headers": length is invalid, min 1 length error'):console.warn('"error in root.headers.[].headers": undefined is invalid, Required')),!s)return;if(!s.length)return[];let c=[];for(let f=0;f<s.length;f++){let d=s[f];if(d===QH)continue;let m=a.safeParse(d,{path:[...t,`[${f}]`]});if(!m.success){py();continue}!m.data||m.data===QH||c.push(m.data)}let l=30;return t.length===4&&t[3]==="headers"&&c.length>3?(console.warn(`"error in root.headers.[].headers": length is invalid, max ${l} length error`),c.slice(0,l)):c}),n}return r instanceof Or.ZodObject?(n=Or.object(Object.fromEntries(Object.entries(r.shape).map(([a,s])=>[a,mue(s,[...t,a])]))).transform(a=>{let s=e.safeParse(a,{path:t});return s.success?s.data:(py(),QH)}),n):(n=Or.any().transform(a=>{if(a===QH)return;let s=e.safeParse(a,{path:t});if(!s.success){py()&&console.warn(`"error in ${t.join(".")}": ${JSON.stringify(a)} is invalid, ${Arr(s.error)}`);return}return s.data}),n)}catch(a){py()&&console.error("%c [ e ]-220","font-size:13px; background:pink; color:#bf2c9f;",a)}finally{n&&(n[hue]=!0)}}var yrr=Or.object({TENCENT_SECRET_KEY:Or.string(),TENCENT_SECRET_ID:Or.string(),DEV_SERVER_ENDPOINT:Or.string().optional(),DEV_SERVER_PORT:Or.union([Or.number(),Or.string()]).optional()}),r5e={tefConfigSchema:e5e,envConfigSchema:yrr};var jH=class extends Error{handled;constructor(t){super(t),this.handled=!0,this.name=this.constructor.name}};var MH=class extends jH{constructor(t){super(`[ConfigLoadError] ${t}`)}};function vrr(e){return e.length===1?e[0].toString():e.reduce((t,r)=>{if(typeof r=="number")return`${t}[${r.toString()}]`;if(r.includes('"'))return`${t}["${r.replace(/"/g,'\\"')}"]`;if(!/[$_\p{ID_Start}][$\u200c\u200d\p{ID_Continue}]*/u.test(r))return`${t}["${r}"]`;let n=t.length===0?"":".";return t+n+r},"")}function n5e(e,t,r){var n;if(e.code==="invalid_union")return e.unionErrors.reduce((a,s)=>{let c=s.issues.map(l=>n5e(l,t,r)).join(t);return a.includes(c)||a.push(c),a},[]).join(r);if(((n=e.path)==null?void 0:n.length)!==0){if(e.path.length===1){let a=e.path[0];if(typeof a=="number")return`${e.message} at index ${a}`}return`${e.message} at "${vrr(e.path)}"`}return e.message}function xrr(e,t,r){return e.length>0?[t,e].join(r):t}function brr(e,t){let{issueSeparator:r=`
|
|
538
538
|
`,unionSeparator:n=", or ",prefixSeparator:a=`
|
|
539
|
-
`,prefix:s}=t,c=e.errors.map(l=>n5e(l,r,n)).join(r);return xrr(c,s,a)}var qH=class extends jH{details;constructor(t,r){let n=brr(r,{prefix:`${t}:`});super(`[ValidationError] ${n}`),this.details=r.errors}};var Xi={invalid_type:"invalid type error",max_length:"max length error",min_length:"min length error",min_string:"string min error",max_string:"string max error",char_match:"char match error",value_match:"value match error"};function hN(e){return Object.prototype.toString.call(e)==="[object Object]"}function Nj(e){return Object.prototype.toString.call(e)==="[object Array]"}function KC(e){return Object.prototype.toString.call(e)==="[object String]"}function i5e(e){return Object.prototype.toString.call(e)==="[object Number]"}function UH(e){var n;let t=e.replace(/\\([?*])/g,"$1");if(e.length===0)return Xi.min_string;if(t.length>500)return Xi.max_string;if(/[^a-zA-Z0-9_\-/:*.~=?#!$&+,;%@ ]/.test(t)||((n=t.match(/\*/g))==null?void 0:n.length)>1||/[^a-zA-Z0-9_\-/:*.~=?#!$&+,;%@ ]:/.test(t)||/:(?![a-zA-Z0-9]+)/.test(t))return Xi.char_match;if(t.length){let a=t.split("/");if(a.some(l=>l.includes(":")&&(l.includes("*")||l.includes(".")))||a.some(l=>l.split(":").length>2))return Xi.char_match}}function s5e(e){var r;if(e=e.replace(/^https?:\/\//,""),e.length===0)return Xi.min_string;if(e.length>500)return Xi.max_string;if(/[^a-zA-Z0-9_\-/:*.~=?#!$&+,;%@ ]/.test(e)||((r=e.match(/\*/g))==null?void 0:r.length)>=1||/[^a-zA-Z0-9_\-/:*.~=?#!$&+,;%@ ]:/.test(e)||/:(?![a-zA-Z0-9]+)/.test(e))return Xi.char_match}function Err(e){if(e.length===0)return Xi.min_string;if(e.length>100)return Xi.max_string;if(/[^a-zA-Z0-9-]/.test(e))return Xi.char_match}function wrr(e){if(e.length===0)return Xi.min_string;if(e.length>1e3)return Xi.max_string;if(/[\u4e00-\u9fa5]/.test(e))return Xi.char_match}function Srr(e){let t=e.split(",").map(r=>r.trim()).filter(Boolean);for(let r of t){let n=r.indexOf("="),a=n===-1?r.trim().toLowerCase():r.slice(0,n).trim().toLowerCase();if(a==="stale-while-revalidate"||a==="stale-if-error"){let s=`${a}=86400`;if(n===-1)return`${Xi.value_match}: Cache-Control directive "${a}" must be in k=v form (e.g. ${s})`;if(!r.slice(n+1).trim())return`${Xi.value_match}: Cache-Control directive "${r}" must have a value (e.g. ${s})`}}}function Crr(e){if(![301,302,303,304,307,308].includes(e))return Xi.value_match}function _rr(e){if(typeof e!="number"||!Number.isInteger(e)||e<0)return Xi.value_match}function Irr(e,t){let r=[],n=[];if(!Nj(e))return n.push({path:[...t],message:Xi.invalid_type}),[r,n];for(let a in e){let s=e[a];if(!hN(s)){n.push({path:[...t,`[${a}]`],message:Xi.invalid_type});continue}let{key:c,value:l}=s;if(!KC(c)){n.push({path:[...t,`[${a}]`,"key"],message:Xi.invalid_type});continue}let f=Err(c);if(f){n.push({path:[...t,`[${a}]`,"key"],message:f});continue}if(!KC(l)){n.push({path:[...t,`[${a}]`,"value"],message:Xi.invalid_type});continue}let d=wrr(l);if(d){n.push({path:[...t,`[${a}]`,"value"],message:d});continue}if(c.toLowerCase()==="cache-control"){let m=Srr(l);if(m){n.push({path:[...t,`[${a}]`,"value"],message:m});continue}}r.push({key:c,value:l})}return[r,n]}function krr(e,t){let r=[],n=[];if(!Nj(e))return n.push({path:[...t],message:Xi.invalid_type}),[r,n];for(let a in e){let s=e[a];if(!hN(s)){n.push({path:[...t,`[${a}]`],message:Xi.invalid_type});continue}let{source:c,headers:l}=s;if(!KC(c)){n.push({path:[...t,`[${a}]`,"source"],message:Xi.invalid_type});continue}let f=UH(c);if(f){n.push({path:[...t,`[${a}]`,"source"],message:f});continue}let[d,m]=Irr(l,[...t,`[${a}]`,"headers"]);d.length>
|
|
539
|
+
`,prefix:s}=t,c=e.errors.map(l=>n5e(l,r,n)).join(r);return xrr(c,s,a)}var qH=class extends jH{details;constructor(t,r){let n=brr(r,{prefix:`${t}:`});super(`[ValidationError] ${n}`),this.details=r.errors}};var Xi={invalid_type:"invalid type error",max_length:"max length error",min_length:"min length error",min_string:"string min error",max_string:"string max error",char_match:"char match error",value_match:"value match error"};function hN(e){return Object.prototype.toString.call(e)==="[object Object]"}function Nj(e){return Object.prototype.toString.call(e)==="[object Array]"}function KC(e){return Object.prototype.toString.call(e)==="[object String]"}function i5e(e){return Object.prototype.toString.call(e)==="[object Number]"}function UH(e){var n;let t=e.replace(/\\([?*])/g,"$1");if(e.length===0)return Xi.min_string;if(t.length>500)return Xi.max_string;if(/[^a-zA-Z0-9_\-/:*.~=?#!$&+,;%@ ]/.test(t)||((n=t.match(/\*/g))==null?void 0:n.length)>1||/[^a-zA-Z0-9_\-/:*.~=?#!$&+,;%@ ]:/.test(t)||/:(?![a-zA-Z0-9]+)/.test(t))return Xi.char_match;if(t.length){let a=t.split("/");if(a.some(l=>l.includes(":")&&(l.includes("*")||l.includes(".")))||a.some(l=>l.split(":").length>2))return Xi.char_match}}function s5e(e){var r;if(e=e.replace(/^https?:\/\//,""),e.length===0)return Xi.min_string;if(e.length>500)return Xi.max_string;if(/[^a-zA-Z0-9_\-/:*.~=?#!$&+,;%@ ]/.test(e)||((r=e.match(/\*/g))==null?void 0:r.length)>=1||/[^a-zA-Z0-9_\-/:*.~=?#!$&+,;%@ ]:/.test(e)||/:(?![a-zA-Z0-9]+)/.test(e))return Xi.char_match}function Err(e){if(e.length===0)return Xi.min_string;if(e.length>100)return Xi.max_string;if(/[^a-zA-Z0-9-]/.test(e))return Xi.char_match}function wrr(e){if(e.length===0)return Xi.min_string;if(e.length>1e3)return Xi.max_string;if(/[\u4e00-\u9fa5]/.test(e))return Xi.char_match}function Srr(e){let t=e.split(",").map(r=>r.trim()).filter(Boolean);for(let r of t){let n=r.indexOf("="),a=n===-1?r.trim().toLowerCase():r.slice(0,n).trim().toLowerCase();if(a==="stale-while-revalidate"||a==="stale-if-error"){let s=`${a}=86400`;if(n===-1)return`${Xi.value_match}: Cache-Control directive "${a}" must be in k=v form (e.g. ${s})`;if(!r.slice(n+1).trim())return`${Xi.value_match}: Cache-Control directive "${r}" must have a value (e.g. ${s})`}}}function Crr(e){if(![301,302,303,304,307,308].includes(e))return Xi.value_match}function _rr(e){if(typeof e!="number"||!Number.isInteger(e)||e<0)return Xi.value_match}function Irr(e,t){let r=[],n=[];if(!Nj(e))return n.push({path:[...t],message:Xi.invalid_type}),[r,n];for(let a in e){let s=e[a];if(!hN(s)){n.push({path:[...t,`[${a}]`],message:Xi.invalid_type});continue}let{key:c,value:l}=s;if(!KC(c)){n.push({path:[...t,`[${a}]`,"key"],message:Xi.invalid_type});continue}let f=Err(c);if(f){n.push({path:[...t,`[${a}]`,"key"],message:f});continue}if(!KC(l)){n.push({path:[...t,`[${a}]`,"value"],message:Xi.invalid_type});continue}let d=wrr(l);if(d){n.push({path:[...t,`[${a}]`,"value"],message:d});continue}if(c.toLowerCase()==="cache-control"){let m=Srr(l);if(m){n.push({path:[...t,`[${a}]`,"value"],message:m});continue}}r.push({key:c,value:l})}return[r,n]}function krr(e,t){let r=[],n=[];if(!Nj(e))return n.push({path:[...t],message:Xi.invalid_type}),[r,n];for(let a in e){let s=e[a];if(!hN(s)){n.push({path:[...t,`[${a}]`],message:Xi.invalid_type});continue}let{source:c,headers:l}=s;if(!KC(c)){n.push({path:[...t,`[${a}]`,"source"],message:Xi.invalid_type});continue}let f=UH(c);if(f){n.push({path:[...t,`[${a}]`,"source"],message:f});continue}let[d,m]=Irr(l,[...t,`[${a}]`,"headers"]);d.length>100&&(m.push({path:[...t,`[${a}]`,"headers"],message:Xi.max_length}),d=d.slice(0,100)),(l==null?void 0:l.length)<1&&d.length<1&&m.push({path:[...t,`[${a}]`,"headers"],message:Xi.min_length}),d.length&&r.push({source:c,headers:d}),n.push(...m)}return r.length>100&&(n.push({path:[...t],message:Xi.max_length}),r=r.slice(0,100)),[r,n]}function Trr(e,t){let r=[],n=[];if(!Nj(e))return n.push({path:[...t],message:Xi.invalid_type}),[r,n];for(let a in e){let s=e[a];if(!hN(s)){n.push({path:[...t,`[${a}]`],message:Xi.invalid_type});continue}let{source:c,destination:l,statusCode:f}=s;if(!KC(c)){n.push({path:[...t,`[${a}]`,"source"],message:Xi.invalid_type});continue}let d=UH(c);if(d){n.push({path:[...t,`[${a}]`,"source"],message:d});continue}if(!KC(l)){n.push({path:[...t,`[${a}]`,"destination"],message:Xi.invalid_type});continue}let m=s5e(l);if(m){n.push({path:[...t,`[${a}]`,"destination"],message:m});continue}if(!i5e(f)){n.push({path:[...t,`[${a}]`,"statusCode"],message:Xi.invalid_type});continue}let g=Crr(f);if(g){n.push({path:[...t,`[${a}]`,"statusCode"],message:g});continue}r.push({source:c,destination:l,statusCode:f})}return r.length>100&&(n.push({path:[...t],message:Xi.max_length}),r=r.slice(0,100)),[r,n]}function Brr(e,t){let r=[],n=[];if(!Nj(e))return n.push({path:[...t],message:Xi.invalid_type}),[r,n];for(let a in e){let s=e[a];if(!hN(s)){n.push({path:[...t,`[${a}]`],message:Xi.invalid_type});continue}let{source:c,destination:l}=s;if(!KC(c)){n.push({path:[...t,`[${a}]`,"source"],message:Xi.invalid_type});continue}let f=UH(c);if(f){n.push({path:[...t,`[${a}]`,"source"],message:f});continue}if(!KC(l)){n.push({path:[...t,`[${a}]`,"destination"],message:Xi.invalid_type});continue}let d=s5e(l);if(d){n.push({path:[...t,`[${a}]`,"destination"],message:d});continue}r.push({source:c,destination:l})}return r.length>100&&(n.push({path:[...t],message:Xi.max_length}),r=r.slice(0,100)),[r,n]}function Drr(e,t){let r=[],n=[];if(!Nj(e))return n.push({path:[...t],message:Xi.invalid_type}),[r,n];for(let a in e){let s=e[a];if(!hN(s)){n.push({path:[...t,`[${a}]`],message:Xi.invalid_type});continue}let{source:c,cacheTtl:l}=s;if(!KC(c)){n.push({path:[...t,`[${a}]`,"source"],message:Xi.invalid_type});continue}let f=UH(c);if(f){n.push({path:[...t,`[${a}]`,"source"],message:f});continue}if(!i5e(l)){n.push({path:[...t,`[${a}]`,"cacheTtl"],message:Xi.invalid_type});continue}let d=_rr(l);if(d){n.push({path:[...t,`[${a}]`,"cacheTtl"],message:d});continue}r.push({source:c,cacheTtl:l})}return r.length>100&&(n.push({path:[...t],message:Xi.max_length}),r=r.slice(0,100)),[r,n]}function a5e(e,t){let r={headers:[],redirects:[],rewrites:[],caches:[]},n=[];if(!hN(e))return n.push({path:[...t],message:Xi.invalid_type}),[r,n];let{headers:a=[],redirects:s=[],rewrites:c=[],caches:l=[]}=e,[f,d]=krr(a,[...t,"headers"]),[m,g]=Trr(s,[...t,"redirects"]),[x,b]=Brr(c,[...t,"rewrites"]),[A,C]=Drr(l,[...t,"caches"]);r.headers=f,r.redirects=m,r.rewrites=x,r.caches=A,r["node-functions"]=e["node-functions"],r["edge-functions"]=e["edge-functions"];let I=["outputDirectory","installCommand","buildCommand","nodeVersion","nodeFunctionsConfig"];for(let k in e)I.includes(k)&&e[k]&&(r[k]=e[k]);return n.push(...d,...g,...b,...C),[r,n]}var Prr=/^(?=.{2,30}$)[a-z0-9]+(-[a-z0-9]+)*-?[a-z0-9]+$/,o5e=Or.string().refine(e=>Prr.test(e)),Rrr=Or.enum(["vps-react-ts","vps-react","vps-vue-ts","vps-vue","manaia-demo","manaia-demo-ts"]),Nrr=Or.object({name:o5e}),Frr=Or.object({name:o5e,template:Rrr}),Orr=Or.object({script:Or.string().optional()}),Qrr=Or.object({script:Or.string().optional()}),Lrr=Or.object({}),jrr=Or.object({}),c5e={initArgsSchema:Nrr,generateArgsSchema:Frr,devArgsSchema:Orr,publishArgsSchema:Qrr,deleteArgsSchema:Lrr,testArgsSchema:jrr};function Mrr(e,t){return r=>{try{e.parse(r)}catch(n){throw new qH(`Failed to validate ${t}`,n)}}}function qrr(){let e={};return Object.entries({...c5e,...r5e}).forEach(([t,r])=>{let n=t.replace("Schema","");e[n]=Mrr(r,n)}),e}var AJn=qrr();function Urr(e="",t={confPath:""}){try{e=e||process.cwd();let[r,n]=zrr(e);if(t.exists=n,!n)return t.showError||py(),{headers:[],redirects:[],rewrites:[]};t.confPath=r;let a=Iz(r);return l5e.default.parse(a)}catch{t.showError||py()}}var u5e="edgeone";async function p5e(e=!1){var s,c,l,f,d,m,g,x,b;!e&&console.log(`
|
|
540
540
|
> Start validating the configuration file:`);let t={confPath:"",exists:!1},r=await Urr("",t);try{let[A,C]=a5e(r,["root"]);return C!=null&&C.length&&!e?C.map(I=>{console.log(`error in ${I.path.join(".")}: ${I.message}`)}):!e&&console.log("none error in configuration file"),!e&&console.log(`End validating!
|
|
541
541
|
`),A}catch{!e&&console.log(`Failure validating!
|
|
542
542
|
`)}return{headers:[],redirects:[],rewrites:[],caches:[]}}function zrr(e){let t="",r=eQe(e),n=!1;if(r.isDirectory()){let a=[];for(let s of[`${u5e}.json`,`${u5e}.json5`]){let c=zH.default.normalize(zH.default.resolve(e,s));if(a.push(c),n=VL(c),n){t=c;break}}n||(t=a[0])}else r.isFile()&&(t=zH.default.normalize(e),n=!0);return[t,n]}function mN(e){try{if(!e.endsWith(".env")&&!e.endsWith(".local"))throw new Error(`Invalid .env path: ${e}`);let t=OR(e);for(let[r,n]of Object.entries(t))r in process.env||(process.env[r]=n);return t}catch(t){throw new MH(`Failed to load .env:
|
|
@@ -136,7 +136,7 @@ Arguments: `+Array.prototype.slice.call(H).join("")+`
|
|
|
136
136
|
`),n=n.replace(/\\r/g,"\r")),t[o]=n}return t}function JPe(e){let t=Bz(e),r=Jo.configDotenv({path:t});if(!r.parsed){let l=new Error(`MISSING_DATA: Cannot parse ${t} for an unknown reason`);throw l.code="MISSING_DATA",l}let a=Mz(e).split(","),o=a.length,n;for(let l=0;l<o;l++)try{let f=a[l].trim(),y=QPe(r,f);n=Jo.decrypt(y.ciphertext,y.key);break}catch(f){if(l+1>=o)throw f}return Jo.parse(n)}function XPe(e){console.log(`[dotenv@${d3}][INFO] ${e}`)}function ZPe(e){console.log(`[dotenv@${d3}][WARN] ${e}`)}function rC(e){console.log(`[dotenv@${d3}][DEBUG] ${e}`)}function Mz(e){return e&&e.DOTENV_KEY&&e.DOTENV_KEY.length>0?e.DOTENV_KEY:process.env.DOTENV_KEY&&process.env.DOTENV_KEY.length>0?process.env.DOTENV_KEY:""}function QPe(e,t){let r;try{r=new URL(t)}catch(f){if(f.code==="ERR_INVALID_URL"){let y=new Error("INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=development");throw y.code="INVALID_DOTENV_KEY",y}throw f}let a=r.password;if(!a){let f=new Error("INVALID_DOTENV_KEY: Missing key part");throw f.code="INVALID_DOTENV_KEY",f}let o=r.searchParams.get("environment");if(!o){let f=new Error("INVALID_DOTENV_KEY: Missing environment part");throw f.code="INVALID_DOTENV_KEY",f}let n=`DOTENV_VAULT_${o.toUpperCase()}`,l=e.parsed[n];if(!l){let f=new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${n} in your .env.vault file.`);throw f.code="NOT_FOUND_DOTENV_ENVIRONMENT",f}return{ciphertext:l,key:a}}function Bz(e){let t=null;if(e&&e.path&&e.path.length>0)if(Array.isArray(e.path))for(let r of e.path)p3.existsSync(r)&&(t=r.endsWith(".vault")?r:`${r}.vault`);else t=e.path.endsWith(".vault")?e.path:`${e.path}.vault`;else t=f3.resolve(process.cwd(),".env.vault");return p3.existsSync(t)?t:null}function Lz(e){return e[0]==="~"?f3.join($Pe.homedir(),e.slice(1)):e}function eAe(e){XPe("Loading env from encrypted .env.vault");let t=Jo._parseVault(e),r=process.env;return e&&e.processEnv!=null&&(r=e.processEnv),Jo.populate(r,t,e),{parsed:t}}function tAe(e){let t=f3.resolve(process.cwd(),".env"),r="utf8",a=!!(e&&e.debug);e&&e.encoding?r=e.encoding:a&&rC("No encoding is specified. UTF-8 is used by default");let o=[t];if(e&&e.path)if(!Array.isArray(e.path))o=[Lz(e.path)];else{o=[];for(let y of e.path)o.push(Lz(y))}let n,l={};for(let y of o)try{let m=Jo.parse(p3.readFileSync(y,{encoding:r}));Jo.populate(l,m,e)}catch(m){a&&rC(`Failed to load ${y} ${m.message}`),n=m}let f=process.env;return e&&e.processEnv!=null&&(f=e.processEnv),Jo.populate(f,l,e),n?{parsed:l,error:n}:{parsed:l}}function rAe(e){if(Mz(e).length===0)return Jo.configDotenv(e);let t=Bz(e);return t?Jo._configVault(e):(ZPe(`You set DOTENV_KEY but you are missing a .env.vault file at ${t}. Did you forget to build it?`),Jo.configDotenv(e))}function nAe(e,t){let r=Buffer.from(t.slice(-64),"hex"),a=Buffer.from(e,"base64"),o=a.subarray(0,12),n=a.subarray(-16);a=a.subarray(12,-16);try{let l=HPe.createDecipheriv("aes-256-gcm",r,o);return l.setAuthTag(n),`${l.update(a)}${l.final()}`}catch(l){let f=l instanceof RangeError,y=l.message==="Invalid key length",m=l.message==="Unsupported state or unable to authenticate data";if(f||y){let b=new Error("INVALID_DOTENV_KEY: It must be 64 characters long (or more)");throw b.code="INVALID_DOTENV_KEY",b}else if(m){let b=new Error("DECRYPTION_FAILED: Please check your DOTENV_KEY");throw b.code="DECRYPTION_FAILED",b}else throw l}}function iAe(e,t,r={}){let a=!!(r&&r.debug),o=!!(r&&r.override);if(typeof t!="object"){let n=new Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate");throw n.code="OBJECT_REQUIRED",n}for(let n of Object.keys(t))Object.prototype.hasOwnProperty.call(e,n)?(o===!0&&(e[n]=t[n]),a&&rC(o===!0?`"${n}" is already defined and WAS overwritten`:`"${n}" is already defined and was NOT overwritten`)):e[n]=t[n]}var Jo={configDotenv:tAe,_configVault:eAe,_parseVault:JPe,config:rAe,decrypt:nAe,parse:GPe,populate:iAe};km.exports.configDotenv=Jo.configDotenv;km.exports._configVault=Jo._configVault;km.exports._parseVault=Jo._parseVault;km.exports.config=Jo.config;km.exports.decrypt=Jo.decrypt;km.exports.parse=Jo.parse;km.exports.populate=Jo.populate;km.exports=Jo});function qz(e,t){return h3.default.join(e,t)}function Io(e){return qz(process.cwd(),e)}function Uz(e){return h3.default.dirname(e)}var h3,Im=Pt(()=>{h3=hr(require("path"))});var Wz=Y((B_t,Vz)=>{var m3=class{constructor(t){this.value=t,this.next=void 0}},y3=class{constructor(){this.clear()}enqueue(t){let r=new m3(t);this._head?(this._tail.next=r,this._tail=r):(this._head=r,this._tail=r),this._size++}dequeue(){let t=this._head;if(t)return this._head=this._head.next,this._size--,t.value}clear(){this._head=void 0,this._tail=void 0,this._size=0}get size(){return this._size}*[Symbol.iterator](){let t=this._head;for(;t;)yield t.value,t=t.next}};Vz.exports=y3});var $z=Y((j_t,zz)=>{"use strict";var sAe=Wz(),aAe=e=>{if(!((Number.isInteger(e)||e===1/0)&&e>0))throw new TypeError("Expected `concurrency` to be a number from 1 and up");let t=new sAe,r=0,a=()=>{r--,t.size>0&&t.dequeue()()},o=async(f,y,...m)=>{r++;let b=(async()=>f(...m))();y(b);try{await b}catch{}a()},n=(f,y,...m)=>{t.enqueue(o.bind(null,f,y,...m)),(async()=>(await Promise.resolve(),r<e&&t.size>0&&t.dequeue()()))()},l=(f,...y)=>new Promise(m=>{n(f,m,...y)});return Object.defineProperties(l,{activeCount:{get:()=>r},pendingCount:{get:()=>t.size},clearQueue:{value:()=>{t.clear()}}}),l};zz.exports=aAe});var Hz=Y((q_t,oAe)=>{oAe.exports={name:"node-persist",version:"4.0.4",description:"Super-easy (and fast) persistent data structures in Node.js, modeled after HTML5 localStorage",main:"./src/node-persist.js",directories:{example:"examples"},scripts:{test:"./node_modules/.bin/mocha tests/"},repository:{type:"git",url:"https://github.com/simonlast/node-persist"},keywords:["node","persist","storage"],engines:{node:">=10.12.0"},contributors:[{name:"Simon Last",email:"hello@simonlast.org",url:"http://simonlast.org/"},{name:"Ben Monro",url:"https://github.com/benmonro"},{name:"Aziz Khoury",url:"https://github.com/akhoury"}],license:"MIT",readmeFilename:"README.md",dependencies:{"p-limit":"^3.1.0"},devDependencies:{chai:"^4.1.2",mocha:"^10.2.0",rimraf:"^2.4.3"}}});var Jz=Y((U_t,Gz)=>{var zh=require("fs"),zb=require("path"),uAe=require("crypto"),{nextTick:cAe}=require("process"),lAe=$z(),pAe=Hz(),g3={ttl:!1,logging:!1,encoding:"utf8",parse:JSON.parse,stringify:JSON.stringify,forgiveParseErrors:!1,expiredInterval:2*60*1e3,dir:"."+pAe.name+"/storage",writeQueue:!0,writeQueueIntervalMs:1e3,writeQueueWriteOnlyLast:!0,maxFileDescriptors:1/0},v3=24*60*60*1e3,fAe=function(e){return typeof e=="function"},Yz=function(e){return!isNaN(parseFloat(e))&&isFinite(e)},Kz=function(e){return Object.prototype.toString.call(e)==="[object Date]"},dAe=function(e){return Kz(e)&&!isNaN(e)},hAe=function(e){return dAe(e)&&e.getTime()>+new Date},mAe=function(e){return uAe.createHash("sha256").update(e).digest("hex")},yAe=function(e){return e&&e.key},x3=function(e){return e&&e.ttl&&e.ttl<new Date().getTime()},gAe=function(e){return!x3(e)},vAe=function(e){return e=zb.normalize(e),zb.isAbsolute(e)?e:zb.join(process.cwd(),e)},nC=function(e){if(!(this instanceof nC))return new nC(e);this.setOptions(e)};nC.prototype={init:async function(e){return e&&this.setOptions(e),await this.ensureDirectory(this.options.dir),this.options.expiredInterval&&this.startExpiredKeysInterval(),this.q={},this.startWriteQueueInterval(),this.options},initSync:function(e){return e&&this.setOptions(e),this.ensureDirectorySync(this.options.dir),this.options.expiredInterval&&this.startExpiredKeysInterval(),this.q={},this.startWriteQueueInterval(),this.options},setOptions:function(e){var r;let t={};if(!e)t=g3;else{for(let a in g3)e.hasOwnProperty(a)?t[a]=e[a]:t[a]=this.options&&this.options[a]!=null?this.options[a]:g3[a];t.dir=vAe(t.dir),t.ttl=t.ttl?Yz(t.ttl)&&t.ttl>0?t.ttl:v3:!1}fAe(t.logging)&&(this.log=t.logging,t.logging=!0),(!this.limit||t.maxFileDescriptors!==((r=this.options)==null?void 0:r.maxFileDescriptors))&&(this.limit=lAe(t.maxFileDescriptors)),this.options=t},data:function(){return this.readDirectory(this.options.dir)},keys:async function(e){let t=await this.data();return e&&(t=t.filter(e)),t.map(r=>r.key)},values:async function(e){let t=await this.data();return e&&(t=t.filter(e)),t.map(r=>r.value)},length:async function(e){let t=await this.data();return e&&(t=t.filter(e)),t.length},forEach:async function(e){let t=await this.data();for(let r of t)await e(r)},valuesWithKeyMatch:function(e){e=e||/.*/;let t=e instanceof RegExp?r=>e.test(r.key):r=>r.key.indexOf(e)!==-1;return this.values(t)},set:function(e,t,r={}){return this.setItem(e,t,r)},setItem:function(e,t,r={}){let a=this.copy(t),o=this.calcTTL(r.ttl);this.log(`set ('${e}': '${this.stringify(a)}')`);let n={key:e,value:a,ttl:o};return this.queueWriteFile(this.getDatumPath(e),n)},update:function(e,t,r={}){return this.updateItem(e,t,r)},updateItem:async function(e,t,r={}){let a=await this.getDatum(e);if(a&&gAe(a)){let o=this.copy(t),n;r.ttl?n=this.calcTTL(r.ttl):n=a.ttl,this.log(`update ('${e}': '${this.stringify(o)}')`);let l={key:e,value:o,ttl:n};return this.queueWriteFile(this.getDatumPath(e),l)}else return this.setItem(e,t,r)},get:function(e){return this.getItem(e)},getItem:async function(e){let t=await this.getDatum(e);if(x3(t))this.log(`${e} has expired`),await this.removeItem(e);else return t.value},getDatum:function(e){return this.readFile(this.getDatumPath(e))},getRawDatum:function(e){return this.readFile(this.getDatumPath(e),{raw:!0})},getDatumValue:async function(e){let t=await this.getDatum(e);return t&&t.value},getDatumPath:function(e){return zb.join(this.options.dir,mAe(e))},del:function(e){return this.removeItem(e)},rm:function(e){return this.removeItem(e)},removeItem:function(e){return this.deleteFile(this.getDatumPath(e))},removeExpiredItems:async function(){let e=await this.keys(x3);for(let t of e)await this.removeItem(t)},clear:async function(){let e=await this.data();for(let t of e)await this.removeItem(t.key)},ensureDirectory:function(e){return new Promise((t,r)=>{let a={dir:e};zh.access(e,o=>{if(o)zh.mkdir(e,{recursive:!0},n=>{if(n)return r(n);this.log("created "+e),t(a)});else return t(a)})})},ensureDirectorySync:function(e){let t={dir:e};try{return zh.accessSync(e),t}catch{return zh.mkdirSync(e,{recursive:!0}),this.log("created "+e),t}},readDirectory:function(e){return new Promise((t,r)=>{zh.access(e,a=>{a?r(new Error(`[node-persist][readDirectory] ${e} does not exists!`)):zh.readdir(e,async(o,n)=>{if(o)return r(o);let l=[];try{for(let f of n)f[0]!=="."&&l.push(await this.limit(()=>this.readFile(zb.join(this.options.dir,f))))}catch(f){r(f)}t(l)})})})},readFile:function(e,t={}){return this.limit(()=>new Promise((r,a)=>{zh.readFile(e,this.options.encoding,(o,n)=>{if(o)if(o.code==="ENOENT")this.log(`${e} does not exist, returning undefined value`),r(t.raw?"{}":{});else return a(o);let l=t.raw?n:this.parse(n);if(!t.raw&&!yAe(l))return this.options.forgiveParseErrors?r(t.raw?"{}":{}):a(new Error(`[node-persist][readFile] ${e} does not look like a valid storage file!`));r(l)})}))},queueWriteFile:async function(e,t){return this.options.writeQueue===!1?this.writeFile(e,t):(this.q[e]=this.q[e]||[],cAe(()=>{this.startWriteQueueInterval()}),new Promise((r,a)=>{this.q[e].push({content:t,resolve:r,reject:a})}))},processWriteQueue:async function(){if(this.processingWriteQueue){this.log("Still processing write queue, waiting...");return}this.processingWriteQueue=!0;let e=Object.keys(this.q).map(async t=>{let r;this.options.writeQueueWriteOnlyLast?r=this.q[t].pop():r=this.q[t].shift();try{let a=await this.writeFile(t,r.content);if(this.options.writeQueueWriteOnlyLast)for(;this.q[t].length;)this.q[t].shift().resolve(a);r.resolve(a)}catch(a){for(;this.q[t].length;)this.q[t].shift().reject(a);r.reject(a)}(!this.q[t]||!this.q[t].length)&&delete this.q[t]});try{await Promise.all(e)}finally{this.processingWriteQueue=!1}},startWriteQueueInterval:function(){this.processWriteQueue(),this._writeQueueInterval||(this._writeQueueInterval=setInterval(()=>this.processWriteQueue(),this.options.writeQueueIntervalMs||1e3),this._writeQueueInterval.unref&&this._writeQueueInterval.unref())},stopWriteQueueInterval:function(){clearInterval(this._writeQueueInterval)},writeFile:async function(e,t){return this.limit(()=>new Promise((r,a)=>{zh.writeFile(e,this.stringify(t),this.options.encoding,o=>{if(o)return a(o);r({file:e,content:t}),this.log("wrote: "+e)})}))},deleteFile:function(e){return this.limit(()=>new Promise((t,r)=>{zh.access(e,a=>{a?(this.log(`Not removing file:${e} because it doesn't exist`),t({file:e,removed:!1,existed:!1})):(this.log(`Removing file:${e}`),zh.unlink(e,o=>{if(o&&o.code!=="ENOENT")return r(o);let n={file:e,removed:!o,existed:!a};o&&this.log(`Failed to remove file:${e} because it doesn't exist anymore.`),t(n)}))})}))},stringify:function(e){return this.options.stringify(e)},parse:function(e){if(e!=null)try{return this.options.parse(e)}catch(t){this.log("parse error: ",this.stringify(t),"for:",e);return}},copy:function(e){return typeof e!="object"?e:this.parse(this.stringify(e))},startExpiredKeysInterval:function(){this.stopExpiredKeysInterval(),this._expiredKeysInterval=setInterval(this.removeExpiredItems.bind(this),this.options.expiredInterval),this._expiredKeysInterval.unref&&this._expiredKeysInterval.unref()},stopExpiredKeysInterval:function(){clearInterval(this._expiredKeysInterval)},log:function(){this.options&&this.options.logging&&console.log.apply(console,arguments)},calcTTL:function(e){let r=new Date().getTime();if(typeof e>"u"&&(e=this.options.ttl),e)return Kz(e)?(hAe(e)||(e=v3),e=e.getTime?e.getTime():e):e=e?Yz(e)&&e>0?r+e:v3:void 0,e}};Gz.exports=nC});var Zz=Y((V_t,Xz)=>{var xAe=Jz();(function(e){e.create=function(r){return xAe(r)},e.init=async function(r){let a=e.defaultInstance=e.create(r),o=await a.init(r);return t(e,a,{skip:["init","initSync","create"]}),o},e.initSync=function(r){let a=e.defaultInstance=e.create(r),o=a.initSync(r);return t(e,a,{skip:["init","initSync","create"]}),o};function t(r,a,o){o=o||{},o.skip=o.skip||[];for(let n in a)typeof a[n]=="function"&&n.indexOf("_")!==0&&o.skip.indexOf(n)===-1&&(r[n]=a[n].bind(a))}})(Xz.exports)});function e$(){try{b3.initSync({dir:SAe()})}catch(e){console.error("[File] initStorage error",e)}}async function iC(e,t,r){e$(),await b3.setItem(e,t).catch(a=>{console.error("[File] setLocalData error",a)}),r==null||r()}async function sC(e){return e$(),await b3.getItem(e).catch(r=>{console.error("[File] getLocalData error",r)})}function SAe(){try{let e=S3.parse(process.cwd()).root,t=process.cwd(),a=S3.relative(e,t).split(S3.sep).length-2;return`${new Array(Math.max(0,a)).fill("../").join("")}.edgeone`}catch{return".edgeone"}}function t$(e){return Om.default.statSync(e)}function bAe(e){return Om.default.mkdirSync(e,{recursive:!0})}function EAe(e){return Om.default.existsSync(e)}function E3(e){return Om.default.existsSync(e)}function _3(e,t="utf-8"){return Om.default.readFileSync(e,t)}function r$(e){let t=_3(e);return Qz.default.parse(t)}function aC(e,t,r="utf-8"){let a=Uz(e);return EAe(a)||bAe(a),Om.default.writeFileSync(e,t,r)}function T3(e,t){return E3(e)?Om.default.appendFileSync(e,t):Om.default.writeFileSync(e,t)}var Qz,Om,b3,S3,r1=Pt(()=>{Qz=hr(jz()),Om=hr(require("fs"));Im();b3=Zz(),S3=require("path")});function w3(){return process.env.LANG==="zh_CN.UTF-8"}var _Ae,TAe,C3=Pt(()=>{_Ae=hr(require("crypto")),TAe=require("lodash")});function CAe(e){a$=e}function oC(){return a$}function xr(e,t){let r=oC(),a=uC({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===N2?void 0:N2].filter(o=>!!o)});e.common.issues.push(a)}function cC(e,t,r,a){if(r==="a"&&!a)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!a:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?a:r==="a"?a.call(e):a?a.value:t.get(e)}function o$(e,t,r,a,o){if(a==="m")throw new TypeError("Private method is not writable");if(a==="a"&&!o)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return a==="a"?o.call(e,r):o?o.value=r:t.set(e,r),r}function ni(e){if(!e)return{};let{errorMap:t,invalid_type_error:r,required_error:a,description:o}=e;if(t&&(r||a))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:o}:{errorMap:(l,f)=>{var y,m;let{message:b}=e;return l.code==="invalid_enum_value"?{message:b!=null?b:f.defaultError}:typeof f.data>"u"?{message:(y=b!=null?b:a)!==null&&y!==void 0?y:f.defaultError}:l.code!=="invalid_type"?{message:f.defaultError}:{message:(m=b!=null?b:r)!==null&&m!==void 0?m:f.defaultError}},description:o}}function c$(e){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`),t}function zAe(e){return new RegExp(`^${c$(e)}$`)}function l$(e){let t=`${u$}T${c$(e)}`,r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function $Ae(e,t){return!!((t==="v4"||!t)&&MAe.test(e)||(t==="v6"||!t)&&jAe.test(e))}function HAe(e,t){if(!NAe.test(e))return!1;try{let[r]=e.split("."),a=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),o=JSON.parse(atob(a));return!(typeof o!="object"||o===null||!o.typ||!o.alg||t&&o.alg!==t)}catch{return!1}}function YAe(e,t){return!!((t==="v4"||!t)&&BAe.test(e)||(t==="v6"||!t)&&qAe.test(e))}function KAe(e,t){let r=(e.toString().split(".")[1]||"").length,a=(t.toString().split(".")[1]||"").length,o=r>a?r:a,n=parseInt(e.toFixed(o).replace(".","")),l=parseInt(t.toFixed(o).replace(".",""));return n%l/Math.pow(10,o)}function I2(e){if(e instanceof Wl){let t={};for(let r in e.shape){let a=e.shape[r];t[r]=Lf.create(I2(a))}return new Wl({...e._def,shape:()=>t})}else return e instanceof Lm?new Lm({...e._def,type:I2(e.element)}):e instanceof Lf?Lf.create(I2(e.unwrap())):e instanceof Hh?Hh.create(I2(e.unwrap())):e instanceof $h?$h.create(e.items.map(t=>I2(t))):e}function I3(e,t){let r=Fm(e),a=Fm(t);if(e===t)return{valid:!0,data:e};if(r===Ir.object&&a===Ir.object){let o=Ji.objectKeys(t),n=Ji.objectKeys(e).filter(f=>o.indexOf(f)!==-1),l={...e,...t};for(let f of n){let y=I3(e[f],t[f]);if(!y.valid)return{valid:!1};l[f]=y.data}return{valid:!0,data:l}}else if(r===Ir.array&&a===Ir.array){if(e.length!==t.length)return{valid:!1};let o=[];for(let n=0;n<e.length;n++){let l=e[n],f=t[n],y=I3(l,f);if(!y.valid)return{valid:!1};o.push(y.data)}return{valid:!0,data:o}}else return r===Ir.date&&a===Ir.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}function p$(e,t){return new Rg({values:e,typeName:On.ZodEnum,...ni(t)})}function i$(e,t){let r=typeof e=="function"?e(t):typeof e=="string"?{message:e}:e;return typeof r=="string"?{message:r}:r}function f$(e,t={},r){return e?i1.create().superRefine((a,o)=>{var n,l;let f=e(a);if(f instanceof Promise)return f.then(y=>{var m,b;if(!y){let w=i$(t,a),A=(b=(m=w.fatal)!==null&&m!==void 0?m:r)!==null&&b!==void 0?b:!0;o.addIssue({code:"custom",...w,fatal:A})}});if(!f){let y=i$(t,a),m=(l=(n=y.fatal)!==null&&n!==void 0?n:r)!==null&&l!==void 0?l:!0;o.addIssue({code:"custom",...y,fatal:m})}}):i1.create()}var Ji,P3,Ir,Fm,Kt,wAe,Up,N2,a$,uC,DAe,wc,Ln,O2,Gc,A3,k3,Tg,Yb,Zr,$b,Hb,Mf,n$,ii,PAe,AAe,kAe,IAe,OAe,NAe,FAe,RAe,LAe,D3,MAe,BAe,jAe,qAe,UAe,VAe,u$,WAe,n1,wg,Cg,Dg,Pg,F2,Ag,kg,i1,Rm,jd,R2,Lm,Wl,Ig,Nm,lC,Og,$h,pC,L2,M2,fC,Ng,Fg,Rg,Lg,s1,Vp,Lf,Hh,Mg,Bg,B2,GAe,Kb,Gb,jg,JAe,On,XAe,d$,h$,ZAe,QAe,m$,eke,tke,rke,nke,ike,ske,ake,oke,uke,cke,lke,pke,fke,dke,hke,mke,yke,gke,vke,xke,Ske,bke,Eke,_ke,s$,Tke,wke,Cke,Dke,Pke,Ake,kke,Ike,Oke,Bt,O3=Pt(()=>{(function(e){e.assertEqual=o=>o;function t(o){}e.assertIs=t;function r(o){throw new Error}e.assertNever=r,e.arrayToEnum=o=>{let n={};for(let l of o)n[l]=l;return n},e.getValidEnumValues=o=>{let n=e.objectKeys(o).filter(f=>typeof o[o[f]]!="number"),l={};for(let f of n)l[f]=o[f];return e.objectValues(l)},e.objectValues=o=>e.objectKeys(o).map(function(n){return o[n]}),e.objectKeys=typeof Object.keys=="function"?o=>Object.keys(o):o=>{let n=[];for(let l in o)Object.prototype.hasOwnProperty.call(o,l)&&n.push(l);return n},e.find=(o,n)=>{for(let l of o)if(n(l))return l},e.isInteger=typeof Number.isInteger=="function"?o=>Number.isInteger(o):o=>typeof o=="number"&&isFinite(o)&&Math.floor(o)===o;function a(o,n=" | "){return o.map(l=>typeof l=="string"?`'${l}'`:l).join(n)}e.joinValues=a,e.jsonStringifyReplacer=(o,n)=>typeof n=="bigint"?n.toString():n})(Ji||(Ji={}));(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(P3||(P3={}));Ir=Ji.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Fm=e=>{switch(typeof e){case"undefined":return Ir.undefined;case"string":return Ir.string;case"number":return isNaN(e)?Ir.nan:Ir.number;case"boolean":return Ir.boolean;case"function":return Ir.function;case"bigint":return Ir.bigint;case"symbol":return Ir.symbol;case"object":return Array.isArray(e)?Ir.array:e===null?Ir.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?Ir.promise:typeof Map<"u"&&e instanceof Map?Ir.map:typeof Set<"u"&&e instanceof Set?Ir.set:typeof Date<"u"&&e instanceof Date?Ir.date:Ir.object;default:return Ir.unknown}},Kt=Ji.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),wAe=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),Up=class e extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=a=>{this.issues=[...this.issues,a]},this.addIssues=(a=[])=>{this.issues=[...this.issues,...a]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=t}format(t){let r=t||function(n){return n.message},a={_errors:[]},o=n=>{for(let l of n.issues)if(l.code==="invalid_union")l.unionErrors.map(o);else if(l.code==="invalid_return_type")o(l.returnTypeError);else if(l.code==="invalid_arguments")o(l.argumentsError);else if(l.path.length===0)a._errors.push(r(l));else{let f=a,y=0;for(;y<l.path.length;){let m=l.path[y];y===l.path.length-1?(f[m]=f[m]||{_errors:[]},f[m]._errors.push(r(l))):f[m]=f[m]||{_errors:[]},f=f[m],y++}}};return o(this),a}static assert(t){if(!(t instanceof e))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Ji.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=r=>r.message){let r={},a=[];for(let o of this.issues)o.path.length>0?(r[o.path[0]]=r[o.path[0]]||[],r[o.path[0]].push(t(o))):a.push(t(o));return{formErrors:a,fieldErrors:r}}get formErrors(){return this.flatten()}};Up.create=e=>new Up(e);N2=(e,t)=>{let r;switch(e.code){case Kt.invalid_type:e.received===Ir.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case Kt.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,Ji.jsonStringifyReplacer)}`;break;case Kt.unrecognized_keys:r=`Unrecognized key(s) in object: ${Ji.joinValues(e.keys,", ")}`;break;case Kt.invalid_union:r="Invalid input";break;case Kt.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${Ji.joinValues(e.options)}`;break;case Kt.invalid_enum_value:r=`Invalid enum value. Expected ${Ji.joinValues(e.options)}, received '${e.received}'`;break;case Kt.invalid_arguments:r="Invalid function arguments";break;case Kt.invalid_return_type:r="Invalid function return type";break;case Kt.invalid_date:r="Invalid date";break;case Kt.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:Ji.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case Kt.too_small:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:r="Invalid input";break;case Kt.too_big:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?r=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:r="Invalid input";break;case Kt.custom:r="Invalid input";break;case Kt.invalid_intersection_types:r="Intersection results could not be merged";break;case Kt.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case Kt.not_finite:r="Number must be finite";break;default:r=t.defaultError,Ji.assertNever(e)}return{message:r}},a$=N2;uC=e=>{let{data:t,path:r,errorMaps:a,issueData:o}=e,n=[...r,...o.path||[]],l={...o,path:n};if(o.message!==void 0)return{...o,path:n,message:o.message};let f="",y=a.filter(m=>!!m).slice().reverse();for(let m of y)f=m(l,{data:t,defaultError:f}).message;return{...o,path:n,message:f}},DAe=[];wc=class e{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,r){let a=[];for(let o of r){if(o.status==="aborted")return Ln;o.status==="dirty"&&t.dirty(),a.push(o.value)}return{status:t.value,value:a}}static async mergeObjectAsync(t,r){let a=[];for(let o of r){let n=await o.key,l=await o.value;a.push({key:n,value:l})}return e.mergeObjectSync(t,a)}static mergeObjectSync(t,r){let a={};for(let o of r){let{key:n,value:l}=o;if(n.status==="aborted"||l.status==="aborted")return Ln;n.status==="dirty"&&t.dirty(),l.status==="dirty"&&t.dirty(),n.value!=="__proto__"&&(typeof l.value<"u"||o.alwaysSet)&&(a[n.value]=l.value)}return{status:t.value,value:a}}},Ln=Object.freeze({status:"aborted"}),O2=e=>({status:"dirty",value:e}),Gc=e=>({status:"valid",value:e}),A3=e=>e.status==="aborted",k3=e=>e.status==="dirty",Tg=e=>e.status==="valid",Yb=e=>typeof Promise<"u"&&e instanceof Promise;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(Zr||(Zr={}));Mf=class{constructor(t,r,a,o){this._cachedPath=[],this.parent=t,this.data=r,this._path=a,this._key=o}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},n$=(e,t)=>{if(Tg(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new Up(e.common.issues);return this._error=r,this._error}}};ii=class{get description(){return this._def.description}_getType(t){return Fm(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:Fm(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new wc,ctx:{common:t.parent.common,data:t.data,parsedType:Fm(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let r=this._parse(t);if(Yb(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(t){let r=this._parse(t);return Promise.resolve(r)}parse(t,r){let a=this.safeParse(t,r);if(a.success)return a.data;throw a.error}safeParse(t,r){var a;let o={common:{issues:[],async:(a=r==null?void 0:r.async)!==null&&a!==void 0?a:!1,contextualErrorMap:r==null?void 0:r.errorMap},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Fm(t)},n=this._parseSync({data:t,path:o.path,parent:o});return n$(o,n)}"~validate"(t){var r,a;let o={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Fm(t)};if(!this["~standard"].async)try{let n=this._parseSync({data:t,path:[],parent:o});return Tg(n)?{value:n.value}:{issues:o.common.issues}}catch(n){!((a=(r=n==null?void 0:n.message)===null||r===void 0?void 0:r.toLowerCase())===null||a===void 0)&&a.includes("encountered")&&(this["~standard"].async=!0),o.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:o}).then(n=>Tg(n)?{value:n.value}:{issues:o.common.issues})}async parseAsync(t,r){let a=await this.safeParseAsync(t,r);if(a.success)return a.data;throw a.error}async safeParseAsync(t,r){let a={common:{issues:[],contextualErrorMap:r==null?void 0:r.errorMap,async:!0},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Fm(t)},o=this._parse({data:t,path:a.path,parent:a}),n=await(Yb(o)?o:Promise.resolve(o));return n$(a,n)}refine(t,r){let a=o=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(o):r;return this._refinement((o,n)=>{let l=t(o),f=()=>n.addIssue({code:Kt.custom,...a(o)});return typeof Promise<"u"&&l instanceof Promise?l.then(y=>y?!0:(f(),!1)):l?!0:(f(),!1)})}refinement(t,r){return this._refinement((a,o)=>t(a)?!0:(o.addIssue(typeof r=="function"?r(a,o):r),!1))}_refinement(t){return new Vp({schema:this,typeName:On.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:r=>this["~validate"](r)}}optional(){return Lf.create(this,this._def)}nullable(){return Hh.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Lm.create(this)}promise(){return s1.create(this,this._def)}or(t){return Ig.create([this,t],this._def)}and(t){return Og.create(this,t,this._def)}transform(t){return new Vp({...ni(this._def),schema:this,typeName:On.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let r=typeof t=="function"?t:()=>t;return new Mg({...ni(this._def),innerType:this,defaultValue:r,typeName:On.ZodDefault})}brand(){return new Kb({typeName:On.ZodBranded,type:this,...ni(this._def)})}catch(t){let r=typeof t=="function"?t:()=>t;return new Bg({...ni(this._def),innerType:this,catchValue:r,typeName:On.ZodCatch})}describe(t){let r=this.constructor;return new r({...this._def,description:t})}pipe(t){return Gb.create(this,t)}readonly(){return jg.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},PAe=/^c[^\s-]{8,}$/i,AAe=/^[0-9a-z]+$/,kAe=/^[0-9A-HJKMNP-TV-Z]{26}$/i,IAe=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,OAe=/^[a-z0-9_-]{21}$/i,NAe=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,FAe=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,RAe=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,LAe="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",MAe=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,BAe=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,jAe=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,qAe=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,UAe=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,VAe=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,u$="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",WAe=new RegExp(`^${u$}$`);n1=class e extends ii{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==Ir.string){let n=this._getOrReturnCtx(t);return xr(n,{code:Kt.invalid_type,expected:Ir.string,received:n.parsedType}),Ln}let a=new wc,o;for(let n of this._def.checks)if(n.kind==="min")t.data.length<n.value&&(o=this._getOrReturnCtx(t,o),xr(o,{code:Kt.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),a.dirty());else if(n.kind==="max")t.data.length>n.value&&(o=this._getOrReturnCtx(t,o),xr(o,{code:Kt.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),a.dirty());else if(n.kind==="length"){let l=t.data.length>n.value,f=t.data.length<n.value;(l||f)&&(o=this._getOrReturnCtx(t,o),l?xr(o,{code:Kt.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message}):f&&xr(o,{code:Kt.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message}),a.dirty())}else if(n.kind==="email")RAe.test(t.data)||(o=this._getOrReturnCtx(t,o),xr(o,{validation:"email",code:Kt.invalid_string,message:n.message}),a.dirty());else if(n.kind==="emoji")D3||(D3=new RegExp(LAe,"u")),D3.test(t.data)||(o=this._getOrReturnCtx(t,o),xr(o,{validation:"emoji",code:Kt.invalid_string,message:n.message}),a.dirty());else if(n.kind==="uuid")IAe.test(t.data)||(o=this._getOrReturnCtx(t,o),xr(o,{validation:"uuid",code:Kt.invalid_string,message:n.message}),a.dirty());else if(n.kind==="nanoid")OAe.test(t.data)||(o=this._getOrReturnCtx(t,o),xr(o,{validation:"nanoid",code:Kt.invalid_string,message:n.message}),a.dirty());else if(n.kind==="cuid")PAe.test(t.data)||(o=this._getOrReturnCtx(t,o),xr(o,{validation:"cuid",code:Kt.invalid_string,message:n.message}),a.dirty());else if(n.kind==="cuid2")AAe.test(t.data)||(o=this._getOrReturnCtx(t,o),xr(o,{validation:"cuid2",code:Kt.invalid_string,message:n.message}),a.dirty());else if(n.kind==="ulid")kAe.test(t.data)||(o=this._getOrReturnCtx(t,o),xr(o,{validation:"ulid",code:Kt.invalid_string,message:n.message}),a.dirty());else if(n.kind==="url")try{new URL(t.data)}catch{o=this._getOrReturnCtx(t,o),xr(o,{validation:"url",code:Kt.invalid_string,message:n.message}),a.dirty()}else n.kind==="regex"?(n.regex.lastIndex=0,n.regex.test(t.data)||(o=this._getOrReturnCtx(t,o),xr(o,{validation:"regex",code:Kt.invalid_string,message:n.message}),a.dirty())):n.kind==="trim"?t.data=t.data.trim():n.kind==="includes"?t.data.includes(n.value,n.position)||(o=this._getOrReturnCtx(t,o),xr(o,{code:Kt.invalid_string,validation:{includes:n.value,position:n.position},message:n.message}),a.dirty()):n.kind==="toLowerCase"?t.data=t.data.toLowerCase():n.kind==="toUpperCase"?t.data=t.data.toUpperCase():n.kind==="startsWith"?t.data.startsWith(n.value)||(o=this._getOrReturnCtx(t,o),xr(o,{code:Kt.invalid_string,validation:{startsWith:n.value},message:n.message}),a.dirty()):n.kind==="endsWith"?t.data.endsWith(n.value)||(o=this._getOrReturnCtx(t,o),xr(o,{code:Kt.invalid_string,validation:{endsWith:n.value},message:n.message}),a.dirty()):n.kind==="datetime"?l$(n).test(t.data)||(o=this._getOrReturnCtx(t,o),xr(o,{code:Kt.invalid_string,validation:"datetime",message:n.message}),a.dirty()):n.kind==="date"?WAe.test(t.data)||(o=this._getOrReturnCtx(t,o),xr(o,{code:Kt.invalid_string,validation:"date",message:n.message}),a.dirty()):n.kind==="time"?zAe(n).test(t.data)||(o=this._getOrReturnCtx(t,o),xr(o,{code:Kt.invalid_string,validation:"time",message:n.message}),a.dirty()):n.kind==="duration"?FAe.test(t.data)||(o=this._getOrReturnCtx(t,o),xr(o,{validation:"duration",code:Kt.invalid_string,message:n.message}),a.dirty()):n.kind==="ip"?$Ae(t.data,n.version)||(o=this._getOrReturnCtx(t,o),xr(o,{validation:"ip",code:Kt.invalid_string,message:n.message}),a.dirty()):n.kind==="jwt"?HAe(t.data,n.alg)||(o=this._getOrReturnCtx(t,o),xr(o,{validation:"jwt",code:Kt.invalid_string,message:n.message}),a.dirty()):n.kind==="cidr"?YAe(t.data,n.version)||(o=this._getOrReturnCtx(t,o),xr(o,{validation:"cidr",code:Kt.invalid_string,message:n.message}),a.dirty()):n.kind==="base64"?UAe.test(t.data)||(o=this._getOrReturnCtx(t,o),xr(o,{validation:"base64",code:Kt.invalid_string,message:n.message}),a.dirty()):n.kind==="base64url"?VAe.test(t.data)||(o=this._getOrReturnCtx(t,o),xr(o,{validation:"base64url",code:Kt.invalid_string,message:n.message}),a.dirty()):Ji.assertNever(n);return{status:a.value,value:t.data}}_regex(t,r,a){return this.refinement(o=>t.test(o),{validation:r,code:Kt.invalid_string,...Zr.errToObj(a)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...Zr.errToObj(t)})}url(t){return this._addCheck({kind:"url",...Zr.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...Zr.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...Zr.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...Zr.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...Zr.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...Zr.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...Zr.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...Zr.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...Zr.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...Zr.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...Zr.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...Zr.errToObj(t)})}datetime(t){var r,a;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(r=t==null?void 0:t.offset)!==null&&r!==void 0?r:!1,local:(a=t==null?void 0:t.local)!==null&&a!==void 0?a:!1,...Zr.errToObj(t==null?void 0:t.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,...Zr.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...Zr.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...Zr.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r==null?void 0:r.position,...Zr.errToObj(r==null?void 0:r.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...Zr.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...Zr.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...Zr.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...Zr.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...Zr.errToObj(r)})}nonempty(t){return this.min(1,Zr.errToObj(t))}trim(){return new e({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxLength(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};n1.create=e=>{var t;return new n1({checks:[],typeName:On.ZodString,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...ni(e)})};wg=class e extends ii{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==Ir.number){let n=this._getOrReturnCtx(t);return xr(n,{code:Kt.invalid_type,expected:Ir.number,received:n.parsedType}),Ln}let a,o=new wc;for(let n of this._def.checks)n.kind==="int"?Ji.isInteger(t.data)||(a=this._getOrReturnCtx(t,a),xr(a,{code:Kt.invalid_type,expected:"integer",received:"float",message:n.message}),o.dirty()):n.kind==="min"?(n.inclusive?t.data<n.value:t.data<=n.value)&&(a=this._getOrReturnCtx(t,a),xr(a,{code:Kt.too_small,minimum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),o.dirty()):n.kind==="max"?(n.inclusive?t.data>n.value:t.data>=n.value)&&(a=this._getOrReturnCtx(t,a),xr(a,{code:Kt.too_big,maximum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),o.dirty()):n.kind==="multipleOf"?KAe(t.data,n.value)!==0&&(a=this._getOrReturnCtx(t,a),xr(a,{code:Kt.not_multiple_of,multipleOf:n.value,message:n.message}),o.dirty()):n.kind==="finite"?Number.isFinite(t.data)||(a=this._getOrReturnCtx(t,a),xr(a,{code:Kt.not_finite,message:n.message}),o.dirty()):Ji.assertNever(n);return{status:o.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,Zr.toString(r))}gt(t,r){return this.setLimit("min",t,!1,Zr.toString(r))}lte(t,r){return this.setLimit("max",t,!0,Zr.toString(r))}lt(t,r){return this.setLimit("max",t,!1,Zr.toString(r))}setLimit(t,r,a,o){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:a,message:Zr.toString(o)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:Zr.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Zr.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Zr.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Zr.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Zr.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:Zr.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:Zr.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Zr.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Zr.toString(t)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&Ji.isInteger(t.value))}get isFinite(){let t=null,r=null;for(let a of this._def.checks){if(a.kind==="finite"||a.kind==="int"||a.kind==="multipleOf")return!0;a.kind==="min"?(r===null||a.value>r)&&(r=a.value):a.kind==="max"&&(t===null||a.value<t)&&(t=a.value)}return Number.isFinite(r)&&Number.isFinite(t)}};wg.create=e=>new wg({checks:[],typeName:On.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...ni(e)});Cg=class e extends ii{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==Ir.bigint)return this._getInvalidInput(t);let a,o=new wc;for(let n of this._def.checks)n.kind==="min"?(n.inclusive?t.data<n.value:t.data<=n.value)&&(a=this._getOrReturnCtx(t,a),xr(a,{code:Kt.too_small,type:"bigint",minimum:n.value,inclusive:n.inclusive,message:n.message}),o.dirty()):n.kind==="max"?(n.inclusive?t.data>n.value:t.data>=n.value)&&(a=this._getOrReturnCtx(t,a),xr(a,{code:Kt.too_big,type:"bigint",maximum:n.value,inclusive:n.inclusive,message:n.message}),o.dirty()):n.kind==="multipleOf"?t.data%n.value!==BigInt(0)&&(a=this._getOrReturnCtx(t,a),xr(a,{code:Kt.not_multiple_of,multipleOf:n.value,message:n.message}),o.dirty()):Ji.assertNever(n);return{status:o.value,value:t.data}}_getInvalidInput(t){let r=this._getOrReturnCtx(t);return xr(r,{code:Kt.invalid_type,expected:Ir.bigint,received:r.parsedType}),Ln}gte(t,r){return this.setLimit("min",t,!0,Zr.toString(r))}gt(t,r){return this.setLimit("min",t,!1,Zr.toString(r))}lte(t,r){return this.setLimit("max",t,!0,Zr.toString(r))}lt(t,r){return this.setLimit("max",t,!1,Zr.toString(r))}setLimit(t,r,a,o){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:a,message:Zr.toString(o)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Zr.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Zr.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Zr.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Zr.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:Zr.toString(r)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};Cg.create=e=>{var t;return new Cg({checks:[],typeName:On.ZodBigInt,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...ni(e)})};Dg=class extends ii{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==Ir.boolean){let a=this._getOrReturnCtx(t);return xr(a,{code:Kt.invalid_type,expected:Ir.boolean,received:a.parsedType}),Ln}return Gc(t.data)}};Dg.create=e=>new Dg({typeName:On.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...ni(e)});Pg=class e extends ii{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==Ir.date){let n=this._getOrReturnCtx(t);return xr(n,{code:Kt.invalid_type,expected:Ir.date,received:n.parsedType}),Ln}if(isNaN(t.data.getTime())){let n=this._getOrReturnCtx(t);return xr(n,{code:Kt.invalid_date}),Ln}let a=new wc,o;for(let n of this._def.checks)n.kind==="min"?t.data.getTime()<n.value&&(o=this._getOrReturnCtx(t,o),xr(o,{code:Kt.too_small,message:n.message,inclusive:!0,exact:!1,minimum:n.value,type:"date"}),a.dirty()):n.kind==="max"?t.data.getTime()>n.value&&(o=this._getOrReturnCtx(t,o),xr(o,{code:Kt.too_big,message:n.message,inclusive:!0,exact:!1,maximum:n.value,type:"date"}),a.dirty()):Ji.assertNever(n);return{status:a.value,value:new Date(t.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:Zr.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:Zr.toString(r)})}get minDate(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t!=null?new Date(t):null}};Pg.create=e=>new Pg({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:On.ZodDate,...ni(e)});F2=class extends ii{_parse(t){if(this._getType(t)!==Ir.symbol){let a=this._getOrReturnCtx(t);return xr(a,{code:Kt.invalid_type,expected:Ir.symbol,received:a.parsedType}),Ln}return Gc(t.data)}};F2.create=e=>new F2({typeName:On.ZodSymbol,...ni(e)});Ag=class extends ii{_parse(t){if(this._getType(t)!==Ir.undefined){let a=this._getOrReturnCtx(t);return xr(a,{code:Kt.invalid_type,expected:Ir.undefined,received:a.parsedType}),Ln}return Gc(t.data)}};Ag.create=e=>new Ag({typeName:On.ZodUndefined,...ni(e)});kg=class extends ii{_parse(t){if(this._getType(t)!==Ir.null){let a=this._getOrReturnCtx(t);return xr(a,{code:Kt.invalid_type,expected:Ir.null,received:a.parsedType}),Ln}return Gc(t.data)}};kg.create=e=>new kg({typeName:On.ZodNull,...ni(e)});i1=class extends ii{constructor(){super(...arguments),this._any=!0}_parse(t){return Gc(t.data)}};i1.create=e=>new i1({typeName:On.ZodAny,...ni(e)});Rm=class extends ii{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Gc(t.data)}};Rm.create=e=>new Rm({typeName:On.ZodUnknown,...ni(e)});jd=class extends ii{_parse(t){let r=this._getOrReturnCtx(t);return xr(r,{code:Kt.invalid_type,expected:Ir.never,received:r.parsedType}),Ln}};jd.create=e=>new jd({typeName:On.ZodNever,...ni(e)});R2=class extends ii{_parse(t){if(this._getType(t)!==Ir.undefined){let a=this._getOrReturnCtx(t);return xr(a,{code:Kt.invalid_type,expected:Ir.void,received:a.parsedType}),Ln}return Gc(t.data)}};R2.create=e=>new R2({typeName:On.ZodVoid,...ni(e)});Lm=class e extends ii{_parse(t){let{ctx:r,status:a}=this._processInputParams(t),o=this._def;if(r.parsedType!==Ir.array)return xr(r,{code:Kt.invalid_type,expected:Ir.array,received:r.parsedType}),Ln;if(o.exactLength!==null){let l=r.data.length>o.exactLength.value,f=r.data.length<o.exactLength.value;(l||f)&&(xr(r,{code:l?Kt.too_big:Kt.too_small,minimum:f?o.exactLength.value:void 0,maximum:l?o.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:o.exactLength.message}),a.dirty())}if(o.minLength!==null&&r.data.length<o.minLength.value&&(xr(r,{code:Kt.too_small,minimum:o.minLength.value,type:"array",inclusive:!0,exact:!1,message:o.minLength.message}),a.dirty()),o.maxLength!==null&&r.data.length>o.maxLength.value&&(xr(r,{code:Kt.too_big,maximum:o.maxLength.value,type:"array",inclusive:!0,exact:!1,message:o.maxLength.message}),a.dirty()),r.common.async)return Promise.all([...r.data].map((l,f)=>o.type._parseAsync(new Mf(r,l,r.path,f)))).then(l=>wc.mergeArray(a,l));let n=[...r.data].map((l,f)=>o.type._parseSync(new Mf(r,l,r.path,f)));return wc.mergeArray(a,n)}get element(){return this._def.type}min(t,r){return new e({...this._def,minLength:{value:t,message:Zr.toString(r)}})}max(t,r){return new e({...this._def,maxLength:{value:t,message:Zr.toString(r)}})}length(t,r){return new e({...this._def,exactLength:{value:t,message:Zr.toString(r)}})}nonempty(t){return this.min(1,t)}};Lm.create=(e,t)=>new Lm({type:e,minLength:null,maxLength:null,exactLength:null,typeName:On.ZodArray,...ni(t)});Wl=class e extends ii{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let t=this._def.shape(),r=Ji.objectKeys(t);return this._cached={shape:t,keys:r}}_parse(t){if(this._getType(t)!==Ir.object){let m=this._getOrReturnCtx(t);return xr(m,{code:Kt.invalid_type,expected:Ir.object,received:m.parsedType}),Ln}let{status:a,ctx:o}=this._processInputParams(t),{shape:n,keys:l}=this._getCached(),f=[];if(!(this._def.catchall instanceof jd&&this._def.unknownKeys==="strip"))for(let m in o.data)l.includes(m)||f.push(m);let y=[];for(let m of l){let b=n[m],w=o.data[m];y.push({key:{status:"valid",value:m},value:b._parse(new Mf(o,w,o.path,m)),alwaysSet:m in o.data})}if(this._def.catchall instanceof jd){let m=this._def.unknownKeys;if(m==="passthrough")for(let b of f)y.push({key:{status:"valid",value:b},value:{status:"valid",value:o.data[b]}});else if(m==="strict")f.length>0&&(xr(o,{code:Kt.unrecognized_keys,keys:f}),a.dirty());else if(m!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let m=this._def.catchall;for(let b of f){let w=o.data[b];y.push({key:{status:"valid",value:b},value:m._parse(new Mf(o,w,o.path,b)),alwaysSet:b in o.data})}}return o.common.async?Promise.resolve().then(async()=>{let m=[];for(let b of y){let w=await b.key,A=await b.value;m.push({key:w,value:A,alwaysSet:b.alwaysSet})}return m}).then(m=>wc.mergeObjectSync(a,m)):wc.mergeObjectSync(a,y)}get shape(){return this._def.shape()}strict(t){return Zr.errToObj,new e({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(r,a)=>{var o,n,l,f;let y=(l=(n=(o=this._def).errorMap)===null||n===void 0?void 0:n.call(o,r,a).message)!==null&&l!==void 0?l:a.defaultError;return r.code==="unrecognized_keys"?{message:(f=Zr.errToObj(t).message)!==null&&f!==void 0?f:y}:{message:y}}}:{}})}strip(){return new e({...this._def,unknownKeys:"strip"})}passthrough(){return new e({...this._def,unknownKeys:"passthrough"})}extend(t){return new e({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:On.ZodObject})}setKey(t,r){return this.augment({[t]:r})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let r={};return Ji.objectKeys(t).forEach(a=>{t[a]&&this.shape[a]&&(r[a]=this.shape[a])}),new e({...this._def,shape:()=>r})}omit(t){let r={};return Ji.objectKeys(this.shape).forEach(a=>{t[a]||(r[a]=this.shape[a])}),new e({...this._def,shape:()=>r})}deepPartial(){return I2(this)}partial(t){let r={};return Ji.objectKeys(this.shape).forEach(a=>{let o=this.shape[a];t&&!t[a]?r[a]=o:r[a]=o.optional()}),new e({...this._def,shape:()=>r})}required(t){let r={};return Ji.objectKeys(this.shape).forEach(a=>{if(t&&!t[a])r[a]=this.shape[a];else{let n=this.shape[a];for(;n instanceof Lf;)n=n._def.innerType;r[a]=n}}),new e({...this._def,shape:()=>r})}keyof(){return p$(Ji.objectKeys(this.shape))}};Wl.create=(e,t)=>new Wl({shape:()=>e,unknownKeys:"strip",catchall:jd.create(),typeName:On.ZodObject,...ni(t)});Wl.strictCreate=(e,t)=>new Wl({shape:()=>e,unknownKeys:"strict",catchall:jd.create(),typeName:On.ZodObject,...ni(t)});Wl.lazycreate=(e,t)=>new Wl({shape:e,unknownKeys:"strip",catchall:jd.create(),typeName:On.ZodObject,...ni(t)});Ig=class extends ii{_parse(t){let{ctx:r}=this._processInputParams(t),a=this._def.options;function o(n){for(let f of n)if(f.result.status==="valid")return f.result;for(let f of n)if(f.result.status==="dirty")return r.common.issues.push(...f.ctx.common.issues),f.result;let l=n.map(f=>new Up(f.ctx.common.issues));return xr(r,{code:Kt.invalid_union,unionErrors:l}),Ln}if(r.common.async)return Promise.all(a.map(async n=>{let l={...r,common:{...r.common,issues:[]},parent:null};return{result:await n._parseAsync({data:r.data,path:r.path,parent:l}),ctx:l}})).then(o);{let n,l=[];for(let y of a){let m={...r,common:{...r.common,issues:[]},parent:null},b=y._parseSync({data:r.data,path:r.path,parent:m});if(b.status==="valid")return b;b.status==="dirty"&&!n&&(n={result:b,ctx:m}),m.common.issues.length&&l.push(m.common.issues)}if(n)return r.common.issues.push(...n.ctx.common.issues),n.result;let f=l.map(y=>new Up(y));return xr(r,{code:Kt.invalid_union,unionErrors:f}),Ln}}get options(){return this._def.options}};Ig.create=(e,t)=>new Ig({options:e,typeName:On.ZodUnion,...ni(t)});Nm=e=>e instanceof Ng?Nm(e.schema):e instanceof Vp?Nm(e.innerType()):e instanceof Fg?[e.value]:e instanceof Rg?e.options:e instanceof Lg?Ji.objectValues(e.enum):e instanceof Mg?Nm(e._def.innerType):e instanceof Ag?[void 0]:e instanceof kg?[null]:e instanceof Lf?[void 0,...Nm(e.unwrap())]:e instanceof Hh?[null,...Nm(e.unwrap())]:e instanceof Kb||e instanceof jg?Nm(e.unwrap()):e instanceof Bg?Nm(e._def.innerType):[],lC=class e extends ii{_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==Ir.object)return xr(r,{code:Kt.invalid_type,expected:Ir.object,received:r.parsedType}),Ln;let a=this.discriminator,o=r.data[a],n=this.optionsMap.get(o);return n?r.common.async?n._parseAsync({data:r.data,path:r.path,parent:r}):n._parseSync({data:r.data,path:r.path,parent:r}):(xr(r,{code:Kt.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[a]}),Ln)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,r,a){let o=new Map;for(let n of r){let l=Nm(n.shape[t]);if(!l.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let f of l){if(o.has(f))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(f)}`);o.set(f,n)}}return new e({typeName:On.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:o,...ni(a)})}};Og=class extends ii{_parse(t){let{status:r,ctx:a}=this._processInputParams(t),o=(n,l)=>{if(A3(n)||A3(l))return Ln;let f=I3(n.value,l.value);return f.valid?((k3(n)||k3(l))&&r.dirty(),{status:r.value,value:f.data}):(xr(a,{code:Kt.invalid_intersection_types}),Ln)};return a.common.async?Promise.all([this._def.left._parseAsync({data:a.data,path:a.path,parent:a}),this._def.right._parseAsync({data:a.data,path:a.path,parent:a})]).then(([n,l])=>o(n,l)):o(this._def.left._parseSync({data:a.data,path:a.path,parent:a}),this._def.right._parseSync({data:a.data,path:a.path,parent:a}))}};Og.create=(e,t,r)=>new Og({left:e,right:t,typeName:On.ZodIntersection,...ni(r)});$h=class e extends ii{_parse(t){let{status:r,ctx:a}=this._processInputParams(t);if(a.parsedType!==Ir.array)return xr(a,{code:Kt.invalid_type,expected:Ir.array,received:a.parsedType}),Ln;if(a.data.length<this._def.items.length)return xr(a,{code:Kt.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Ln;!this._def.rest&&a.data.length>this._def.items.length&&(xr(a,{code:Kt.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let n=[...a.data].map((l,f)=>{let y=this._def.items[f]||this._def.rest;return y?y._parse(new Mf(a,l,a.path,f)):null}).filter(l=>!!l);return a.common.async?Promise.all(n).then(l=>wc.mergeArray(r,l)):wc.mergeArray(r,n)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};$h.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new $h({items:e,typeName:On.ZodTuple,rest:null,...ni(t)})};pC=class e extends ii{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:a}=this._processInputParams(t);if(a.parsedType!==Ir.object)return xr(a,{code:Kt.invalid_type,expected:Ir.object,received:a.parsedType}),Ln;let o=[],n=this._def.keyType,l=this._def.valueType;for(let f in a.data)o.push({key:n._parse(new Mf(a,f,a.path,f)),value:l._parse(new Mf(a,a.data[f],a.path,f)),alwaysSet:f in a.data});return a.common.async?wc.mergeObjectAsync(r,o):wc.mergeObjectSync(r,o)}get element(){return this._def.valueType}static create(t,r,a){return r instanceof ii?new e({keyType:t,valueType:r,typeName:On.ZodRecord,...ni(a)}):new e({keyType:n1.create(),valueType:t,typeName:On.ZodRecord,...ni(r)})}},L2=class extends ii{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:a}=this._processInputParams(t);if(a.parsedType!==Ir.map)return xr(a,{code:Kt.invalid_type,expected:Ir.map,received:a.parsedType}),Ln;let o=this._def.keyType,n=this._def.valueType,l=[...a.data.entries()].map(([f,y],m)=>({key:o._parse(new Mf(a,f,a.path,[m,"key"])),value:n._parse(new Mf(a,y,a.path,[m,"value"]))}));if(a.common.async){let f=new Map;return Promise.resolve().then(async()=>{for(let y of l){let m=await y.key,b=await y.value;if(m.status==="aborted"||b.status==="aborted")return Ln;(m.status==="dirty"||b.status==="dirty")&&r.dirty(),f.set(m.value,b.value)}return{status:r.value,value:f}})}else{let f=new Map;for(let y of l){let m=y.key,b=y.value;if(m.status==="aborted"||b.status==="aborted")return Ln;(m.status==="dirty"||b.status==="dirty")&&r.dirty(),f.set(m.value,b.value)}return{status:r.value,value:f}}}};L2.create=(e,t,r)=>new L2({valueType:t,keyType:e,typeName:On.ZodMap,...ni(r)});M2=class e extends ii{_parse(t){let{status:r,ctx:a}=this._processInputParams(t);if(a.parsedType!==Ir.set)return xr(a,{code:Kt.invalid_type,expected:Ir.set,received:a.parsedType}),Ln;let o=this._def;o.minSize!==null&&a.data.size<o.minSize.value&&(xr(a,{code:Kt.too_small,minimum:o.minSize.value,type:"set",inclusive:!0,exact:!1,message:o.minSize.message}),r.dirty()),o.maxSize!==null&&a.data.size>o.maxSize.value&&(xr(a,{code:Kt.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),r.dirty());let n=this._def.valueType;function l(y){let m=new Set;for(let b of y){if(b.status==="aborted")return Ln;b.status==="dirty"&&r.dirty(),m.add(b.value)}return{status:r.value,value:m}}let f=[...a.data.values()].map((y,m)=>n._parse(new Mf(a,y,a.path,m)));return a.common.async?Promise.all(f).then(y=>l(y)):l(f)}min(t,r){return new e({...this._def,minSize:{value:t,message:Zr.toString(r)}})}max(t,r){return new e({...this._def,maxSize:{value:t,message:Zr.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}};M2.create=(e,t)=>new M2({valueType:e,minSize:null,maxSize:null,typeName:On.ZodSet,...ni(t)});fC=class e extends ii{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==Ir.function)return xr(r,{code:Kt.invalid_type,expected:Ir.function,received:r.parsedType}),Ln;function a(f,y){return uC({data:f,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,oC(),N2].filter(m=>!!m),issueData:{code:Kt.invalid_arguments,argumentsError:y}})}function o(f,y){return uC({data:f,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,oC(),N2].filter(m=>!!m),issueData:{code:Kt.invalid_return_type,returnTypeError:y}})}let n={errorMap:r.common.contextualErrorMap},l=r.data;if(this._def.returns instanceof s1){let f=this;return Gc(async function(...y){let m=new Up([]),b=await f._def.args.parseAsync(y,n).catch(R=>{throw m.addIssue(a(y,R)),m}),w=await Reflect.apply(l,this,b);return await f._def.returns._def.type.parseAsync(w,n).catch(R=>{throw m.addIssue(o(w,R)),m})})}else{let f=this;return Gc(function(...y){let m=f._def.args.safeParse(y,n);if(!m.success)throw new Up([a(y,m.error)]);let b=Reflect.apply(l,this,m.data),w=f._def.returns.safeParse(b,n);if(!w.success)throw new Up([o(b,w.error)]);return w.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:$h.create(t).rest(Rm.create())})}returns(t){return new e({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,r,a){return new e({args:t||$h.create([]).rest(Rm.create()),returns:r||Rm.create(),typeName:On.ZodFunction,...ni(a)})}},Ng=class extends ii{get schema(){return this._def.getter()}_parse(t){let{ctx:r}=this._processInputParams(t);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};Ng.create=(e,t)=>new Ng({getter:e,typeName:On.ZodLazy,...ni(t)});Fg=class extends ii{_parse(t){if(t.data!==this._def.value){let r=this._getOrReturnCtx(t);return xr(r,{received:r.data,code:Kt.invalid_literal,expected:this._def.value}),Ln}return{status:"valid",value:t.data}}get value(){return this._def.value}};Fg.create=(e,t)=>new Fg({value:e,typeName:On.ZodLiteral,...ni(t)});Rg=class e extends ii{constructor(){super(...arguments),$b.set(this,void 0)}_parse(t){if(typeof t.data!="string"){let r=this._getOrReturnCtx(t),a=this._def.values;return xr(r,{expected:Ji.joinValues(a),received:r.parsedType,code:Kt.invalid_type}),Ln}if(cC(this,$b,"f")||o$(this,$b,new Set(this._def.values),"f"),!cC(this,$b,"f").has(t.data)){let r=this._getOrReturnCtx(t),a=this._def.values;return xr(r,{received:r.data,code:Kt.invalid_enum_value,options:a}),Ln}return Gc(t.data)}get options(){return this._def.values}get enum(){let t={};for(let r of this._def.values)t[r]=r;return t}get Values(){let t={};for(let r of this._def.values)t[r]=r;return t}get Enum(){let t={};for(let r of this._def.values)t[r]=r;return t}extract(t,r=this._def){return e.create(t,{...this._def,...r})}exclude(t,r=this._def){return e.create(this.options.filter(a=>!t.includes(a)),{...this._def,...r})}};$b=new WeakMap;Rg.create=p$;Lg=class extends ii{constructor(){super(...arguments),Hb.set(this,void 0)}_parse(t){let r=Ji.getValidEnumValues(this._def.values),a=this._getOrReturnCtx(t);if(a.parsedType!==Ir.string&&a.parsedType!==Ir.number){let o=Ji.objectValues(r);return xr(a,{expected:Ji.joinValues(o),received:a.parsedType,code:Kt.invalid_type}),Ln}if(cC(this,Hb,"f")||o$(this,Hb,new Set(Ji.getValidEnumValues(this._def.values)),"f"),!cC(this,Hb,"f").has(t.data)){let o=Ji.objectValues(r);return xr(a,{received:a.data,code:Kt.invalid_enum_value,options:o}),Ln}return Gc(t.data)}get enum(){return this._def.values}};Hb=new WeakMap;Lg.create=(e,t)=>new Lg({values:e,typeName:On.ZodNativeEnum,...ni(t)});s1=class extends ii{unwrap(){return this._def.type}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==Ir.promise&&r.common.async===!1)return xr(r,{code:Kt.invalid_type,expected:Ir.promise,received:r.parsedType}),Ln;let a=r.parsedType===Ir.promise?r.data:Promise.resolve(r.data);return Gc(a.then(o=>this._def.type.parseAsync(o,{path:r.path,errorMap:r.common.contextualErrorMap})))}};s1.create=(e,t)=>new s1({type:e,typeName:On.ZodPromise,...ni(t)});Vp=class extends ii{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===On.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){let{status:r,ctx:a}=this._processInputParams(t),o=this._def.effect||null,n={addIssue:l=>{xr(a,l),l.fatal?r.abort():r.dirty()},get path(){return a.path}};if(n.addIssue=n.addIssue.bind(n),o.type==="preprocess"){let l=o.transform(a.data,n);if(a.common.async)return Promise.resolve(l).then(async f=>{if(r.value==="aborted")return Ln;let y=await this._def.schema._parseAsync({data:f,path:a.path,parent:a});return y.status==="aborted"?Ln:y.status==="dirty"||r.value==="dirty"?O2(y.value):y});{if(r.value==="aborted")return Ln;let f=this._def.schema._parseSync({data:l,path:a.path,parent:a});return f.status==="aborted"?Ln:f.status==="dirty"||r.value==="dirty"?O2(f.value):f}}if(o.type==="refinement"){let l=f=>{let y=o.refinement(f,n);if(a.common.async)return Promise.resolve(y);if(y instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return f};if(a.common.async===!1){let f=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});return f.status==="aborted"?Ln:(f.status==="dirty"&&r.dirty(),l(f.value),{status:r.value,value:f.value})}else return this._def.schema._parseAsync({data:a.data,path:a.path,parent:a}).then(f=>f.status==="aborted"?Ln:(f.status==="dirty"&&r.dirty(),l(f.value).then(()=>({status:r.value,value:f.value}))))}if(o.type==="transform")if(a.common.async===!1){let l=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});if(!Tg(l))return l;let f=o.transform(l.value,n);if(f instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:f}}else return this._def.schema._parseAsync({data:a.data,path:a.path,parent:a}).then(l=>Tg(l)?Promise.resolve(o.transform(l.value,n)).then(f=>({status:r.value,value:f})):l);Ji.assertNever(o)}};Vp.create=(e,t,r)=>new Vp({schema:e,typeName:On.ZodEffects,effect:t,...ni(r)});Vp.createWithPreprocess=(e,t,r)=>new Vp({schema:t,effect:{type:"preprocess",transform:e},typeName:On.ZodEffects,...ni(r)});Lf=class extends ii{_parse(t){return this._getType(t)===Ir.undefined?Gc(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};Lf.create=(e,t)=>new Lf({innerType:e,typeName:On.ZodOptional,...ni(t)});Hh=class extends ii{_parse(t){return this._getType(t)===Ir.null?Gc(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};Hh.create=(e,t)=>new Hh({innerType:e,typeName:On.ZodNullable,...ni(t)});Mg=class extends ii{_parse(t){let{ctx:r}=this._processInputParams(t),a=r.data;return r.parsedType===Ir.undefined&&(a=this._def.defaultValue()),this._def.innerType._parse({data:a,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};Mg.create=(e,t)=>new Mg({innerType:e,typeName:On.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...ni(t)});Bg=class extends ii{_parse(t){let{ctx:r}=this._processInputParams(t),a={...r,common:{...r.common,issues:[]}},o=this._def.innerType._parse({data:a.data,path:a.path,parent:{...a}});return Yb(o)?o.then(n=>({status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new Up(a.common.issues)},input:a.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Up(a.common.issues)},input:a.data})}}removeCatch(){return this._def.innerType}};Bg.create=(e,t)=>new Bg({innerType:e,typeName:On.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...ni(t)});B2=class extends ii{_parse(t){if(this._getType(t)!==Ir.nan){let a=this._getOrReturnCtx(t);return xr(a,{code:Kt.invalid_type,expected:Ir.nan,received:a.parsedType}),Ln}return{status:"valid",value:t.data}}};B2.create=e=>new B2({typeName:On.ZodNaN,...ni(e)});GAe=Symbol("zod_brand"),Kb=class extends ii{_parse(t){let{ctx:r}=this._processInputParams(t),a=r.data;return this._def.type._parse({data:a,path:r.path,parent:r})}unwrap(){return this._def.type}},Gb=class e extends ii{_parse(t){let{status:r,ctx:a}=this._processInputParams(t);if(a.common.async)return(async()=>{let n=await this._def.in._parseAsync({data:a.data,path:a.path,parent:a});return n.status==="aborted"?Ln:n.status==="dirty"?(r.dirty(),O2(n.value)):this._def.out._parseAsync({data:n.value,path:a.path,parent:a})})();{let o=this._def.in._parseSync({data:a.data,path:a.path,parent:a});return o.status==="aborted"?Ln:o.status==="dirty"?(r.dirty(),{status:"dirty",value:o.value}):this._def.out._parseSync({data:o.value,path:a.path,parent:a})}}static create(t,r){return new e({in:t,out:r,typeName:On.ZodPipeline})}},jg=class extends ii{_parse(t){let r=this._def.innerType._parse(t),a=o=>(Tg(o)&&(o.value=Object.freeze(o.value)),o);return Yb(r)?r.then(o=>a(o)):a(r)}unwrap(){return this._def.innerType}};jg.create=(e,t)=>new jg({innerType:e,typeName:On.ZodReadonly,...ni(t)});JAe={object:Wl.lazycreate};(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(On||(On={}));XAe=(e,t={message:`Input not instance of ${e.name}`})=>f$(r=>r instanceof e,t),d$=n1.create,h$=wg.create,ZAe=B2.create,QAe=Cg.create,m$=Dg.create,eke=Pg.create,tke=F2.create,rke=Ag.create,nke=kg.create,ike=i1.create,ske=Rm.create,ake=jd.create,oke=R2.create,uke=Lm.create,cke=Wl.create,lke=Wl.strictCreate,pke=Ig.create,fke=lC.create,dke=Og.create,hke=$h.create,mke=pC.create,yke=L2.create,gke=M2.create,vke=fC.create,xke=Ng.create,Ske=Fg.create,bke=Rg.create,Eke=Lg.create,_ke=s1.create,s$=Vp.create,Tke=Lf.create,wke=Hh.create,Cke=Vp.createWithPreprocess,Dke=Gb.create,Pke=()=>d$().optional(),Ake=()=>h$().optional(),kke=()=>m$().optional(),Ike={string:e=>n1.create({...e,coerce:!0}),number:e=>wg.create({...e,coerce:!0}),boolean:e=>Dg.create({...e,coerce:!0}),bigint:e=>Cg.create({...e,coerce:!0}),date:e=>Pg.create({...e,coerce:!0})},Oke=Ln,Bt=Object.freeze({__proto__:null,defaultErrorMap:N2,setErrorMap:CAe,getErrorMap:oC,makeIssue:uC,EMPTY_PATH:DAe,addIssueToContext:xr,ParseStatus:wc,INVALID:Ln,DIRTY:O2,OK:Gc,isAborted:A3,isDirty:k3,isValid:Tg,isAsync:Yb,get util(){return Ji},get objectUtil(){return P3},ZodParsedType:Ir,getParsedType:Fm,ZodType:ii,datetimeRegex:l$,ZodString:n1,ZodNumber:wg,ZodBigInt:Cg,ZodBoolean:Dg,ZodDate:Pg,ZodSymbol:F2,ZodUndefined:Ag,ZodNull:kg,ZodAny:i1,ZodUnknown:Rm,ZodNever:jd,ZodVoid:R2,ZodArray:Lm,ZodObject:Wl,ZodUnion:Ig,ZodDiscriminatedUnion:lC,ZodIntersection:Og,ZodTuple:$h,ZodRecord:pC,ZodMap:L2,ZodSet:M2,ZodFunction:fC,ZodLazy:Ng,ZodLiteral:Fg,ZodEnum:Rg,ZodNativeEnum:Lg,ZodPromise:s1,ZodEffects:Vp,ZodTransformer:Vp,ZodOptional:Lf,ZodNullable:Hh,ZodDefault:Mg,ZodCatch:Bg,ZodNaN:B2,BRAND:GAe,ZodBranded:Kb,ZodPipeline:Gb,ZodReadonly:jg,custom:f$,Schema:ii,ZodSchema:ii,late:JAe,get ZodFirstPartyTypeKind(){return On},coerce:Ike,any:ike,array:uke,bigint:QAe,boolean:m$,date:eke,discriminatedUnion:fke,effect:s$,enum:bke,function:vke,instanceof:XAe,intersection:dke,lazy:xke,literal:Ske,map:yke,nan:ZAe,nativeEnum:Eke,never:ake,null:nke,nullable:wke,number:h$,object:cke,oboolean:kke,onumber:Ake,optional:Tke,ostring:Pke,pipeline:Dke,preprocess:Cke,promise:_ke,record:mke,set:gke,strictObject:lke,string:d$,symbol:tke,transformer:s$,tuple:hke,undefined:rke,union:pke,unknown:ske,void:oke,NEVER:Oke,ZodIssueCode:Kt,quotelessJson:wAe,ZodError:Up})});function Mke(e){let t=e.split(",").map(r=>r.trim()).filter(Boolean);for(let r of t){let a=r.indexOf("="),o=a===-1?r.trim().toLowerCase():r.slice(0,a).trim().toLowerCase();if(o==="stale-while-revalidate"||o==="stale-if-error"){let n=`${o}=86400`;if(a===-1)return`value match error: Cache-Control directive "${o}" must be in k=v form (e.g. ${n})`;if(!r.slice(a+1).trim())return`value match error: Cache-Control directive "${r}" must have a value (e.g. ${n})`}}}function $ke(e){return e.errors.map(t=>`${t.message}`).join(`
|
|
137
137
|
`)}function Bf(){return!0}function F3(e,t=["root"]){if(e[N3])return e;let r=e;if((e instanceof Bt.ZodOptional||e instanceof Bt.ZodNullable||e instanceof Bt.ZodReadonly||e instanceof Bt.ZodPromise||e instanceof Bt.ZodBranded)&&(r=e.unwrap()),r[N3])return r;let a=null;try{if(r instanceof Bt.ZodArray){let o=F3(r.element,[...t,"[]"]);return a=Bt.array(Bt.any()).optional().transform(n=>{if(t.length===4&&t.includes("headers")&&(n?n!=null&&n.length||console.warn('"error in root.headers.[].headers": length is invalid, min 1 length error'):console.warn('"error in root.headers.[].headers": undefined is invalid, Required')),!n)return;if(!n.length)return[];let l=[];for(let y=0;y<n.length;y++){let m=n[y];if(m===dC)continue;let b=o.safeParse(m,{path:[...t,`[${y}]`]});if(!b.success){Bf();continue}!b.data||b.data===dC||l.push(b.data)}let f=30;return t.length===4&&t[3]==="headers"&&l.length>3?(console.warn(`"error in root.headers.[].headers": length is invalid, max ${f} length error`),l.slice(0,f)):l}),a}return r instanceof Bt.ZodObject?(a=Bt.object(Object.fromEntries(Object.entries(r.shape).map(([o,n])=>[o,F3(n,[...t,o])]))).transform(o=>{let n=e.safeParse(o,{path:t});return n.success?n.data:(Bf(),dC)}),a):(a=Bt.any().transform(o=>{if(o===dC)return;let n=e.safeParse(o,{path:t});if(!n.success){Bf()&&console.warn(`"error in ${t.join(".")}": ${JSON.stringify(o)} is invalid, ${$ke(n.error)}`);return}return n.data}),a)}catch(o){Bf()&&console.error("%c [ e ]-220","font-size:13px; background:pink; color:#bf2c9f;",o)}finally{a&&(a[N3]=!0)}}var K_t,Nke,G_t,Fke,Rke,J_t,Lke,X_t,R3,hC,Bke,jke,qke,Uke,Vke,Wke,zke,y$,g$,N3,dC,v$,Hke,x$,mC=Pt(()=>{O3();K_t=Bt.object({monitor:Bt.array(Bt.string()).optional(),command:Bt.string().optional(),cwd:Bt.string().optional(),target_file:Bt.string()}),Nke=Bt.object({assets_dir:Bt.string().optional(),proxy_path:Bt.string().optional()}),G_t=Bt.object({port:Bt.union([Bt.number(),Bt.string()]).optional(),origin:Bt.string().optional(),timeout:Bt.union([Bt.number(),Bt.string()]).optional(),sandbox:Bt.boolean().optional(),favicon:Bt.boolean().optional(),minify:Bt.boolean().optional(),site:Nke.optional()}),Fke=Bt.object({target:Bt.string(),operator:Bt.union([Bt.literal("equal"),Bt.literal("notequal")]),values:Bt.array(Bt.string())}),Rke=Bt.object({condition:Bt.array(Fke)}),J_t=Bt.object({minify:Bt.boolean().optional(),rule:Bt.array(Rke).optional()}),Lke=Bt.object({maxDuration:Bt.number().optional()}),X_t=Bt.object({type:Bt.enum(["header","cookie","host","query"]),key:Bt.string(),value:Bt.string().optional()}),R3=(e,t)=>{var o;let r=e.replace(/\\([?*])/g,"$1");return r.length===0?t.addIssue({code:Bt.ZodIssueCode.custom,message:"length match error"}):/[^a-zA-Z0-9_\-/:*.~=?#!$&+,;%@ ]/.test(r)?t.addIssue({code:Bt.ZodIssueCode.custom,message:"char match error"}):((o=r.match(/\*/g))==null?void 0:o.length)>1?t.addIssue({code:Bt.ZodIssueCode.custom,message:"* match error"}):/[^a-zA-Z0-9_\-/:*.~=?#!$&+,;%@ ]:/.test(r)||/:(?![a-zA-Z0-9]+)/.test(r)?t.addIssue({code:Bt.ZodIssueCode.custom,message:": match error"}):!0},hC=Bt.object({source:Bt.string().superRefine(R3)});Bke=Bt.object({key:Bt.string().min(1).max(100).superRefine((e,t)=>/[^a-zA-Z0-9-]/.test(e)?t.addIssue({code:Bt.ZodIssueCode.custom,message:"char match error"}):!0),value:Bt.string().min(1).max(1e3).superRefine((e,t)=>/[\u4e00-\u9fa5]/.test(e)?t.addIssue({code:Bt.ZodIssueCode.custom,message:"char match error"}):!0)}).superRefine((e,t)=>{if(e.key.toLowerCase()==="cache-control"){let r=Mke(e.value);r&&t.addIssue({code:Bt.ZodIssueCode.custom,path:["value"],message:r})}}),jke=Bke.array().min(1),qke=hC.merge(Bt.object({headers:jke})).array(),Uke=Bt.union([Bt.literal(307),Bt.literal(301),Bt.literal(302),Bt.literal(308),Bt.literal(303),Bt.literal(304)]),Vke=hC.merge(Bt.object({destination:Bt.string().superRefine(R3),permanent:Bt.boolean().optional(),statusCode:Uke.optional()})).array(),Wke=hC.merge(Bt.object({destination:Bt.string().superRefine(R3)})).array(),zke=hC.merge(Bt.object({cacheTtl:Bt.number()})).array(),y$=Bt.object({included_files:Bt.array(Bt.string()).optional().describe("Glob patterns for files to include in the function bundle"),included_files_base_path:Bt.string().optional().describe("Base path for included_files patterns, defaults to project root"),external_node_modules:Bt.array(Bt.string()).optional().describe("Node modules to be treated as external dependencies")}),g$=Bt.object({$schema:Bt.string().transform(e=>"").optional(),outputDirectory:Bt.string().optional().describe("the output directory relative to project root directory after run build command."),installCommand:Bt.string().optional().describe("the install command to run."),buildCommand:Bt.string().optional().describe("the build command to run."),nodeVersion:Bt.string().optional().describe("the node version to use."),nodeFunctionsConfig:Lke.optional(),headers:qke.optional(),redirects:Vke.optional(),rewrites:Wke.optional(),caches:zke.optional(),"node-functions":y$.optional().describe("Node function specific configuration"),"edge-functions":y$.optional().describe("Edge function specific configuration")}),N3=Symbol("filteredSchema"),dC=Symbol("symFilteredValue"),v$=F3(g$);Hke=Bt.object({TENCENT_SECRET_KEY:Bt.string(),TENCENT_SECRET_ID:Bt.string(),DEV_SERVER_ENDPOINT:Bt.string().optional(),DEV_SERVER_PORT:Bt.union([Bt.number(),Bt.string()]).optional()}),x$={tefConfigSchema:g$,envConfigSchema:Hke}});function Yke(e){return e.length===1?e[0].toString():e.reduce((t,r)=>{if(typeof r=="number")return`${t}[${r.toString()}]`;if(r.includes('"'))return`${t}["${r.replace(/"/g,'\\"')}"]`;if(!/[$_\p{ID_Start}][$\u200c\u200d\p{ID_Continue}]*/u.test(r))return`${t}["${r}"]`;let a=t.length===0?"":".";return t+a+r},"")}function S$(e,t,r){var a;if(e.code==="invalid_union")return e.unionErrors.reduce((o,n)=>{let l=n.issues.map(f=>S$(f,t,r)).join(t);return o.includes(l)||o.push(l),o},[]).join(r);if(((a=e.path)==null?void 0:a.length)!==0){if(e.path.length===1){let o=e.path[0];if(typeof o=="number")return`${e.message} at index ${o}`}return`${e.message} at "${Yke(e.path)}"`}return e.message}function Kke(e,t,r){return e.length>0?[t,e].join(r):t}function Gke(e,t){let{issueSeparator:r=`
|
|
138
138
|
`,unionSeparator:a=", or ",prefixSeparator:o=`
|
|
139
|
-
`,prefix:n}=t,l=e.errors.map(f=>S$(f,r,a)).join(r);return Kke(l,n,o)}var yC,gC,vC,L3=Pt(()=>{yC=class extends Error{handled;constructor(t){super(t),this.handled=!0,this.name=this.constructor.name}},gC=class extends yC{constructor(t){super(`[ConfigLoadError] ${t}`)}};vC=class extends yC{details;constructor(t,r){let a=Gke(r,{prefix:`${t}:`});super(`[ValidationError] ${a}`),this.details=r.errors}}});var M3,eTt,b$=Pt(()=>{M3=class{log(t,r){try{let a=this.format(r),o=JSON.stringify({key:t,value:a});process.send(o)}catch{}}format(t){return typeof t=="object"?JSON.stringify(t):typeof t=="number"?String(t):t}},eTt=new M3});function j2(e){return Object.prototype.toString.call(e)==="[object Object]"}function Jb(e){return Object.prototype.toString.call(e)==="[object Array]"}function a1(e){return Object.prototype.toString.call(e)==="[object String]"}function E$(e){return Object.prototype.toString.call(e)==="[object Number]"}function xC(e){var a;let t=e.replace(/\\([?*])/g,"$1");if(e.length===0)return wn.min_string;if(t.length>500)return wn.max_string;if(/[^a-zA-Z0-9_\-/:*.~=?#!$&+,;%@ ]/.test(t)||((a=t.match(/\*/g))==null?void 0:a.length)>1||/[^a-zA-Z0-9_\-/:*.~=?#!$&+,;%@ ]:/.test(t)||/:(?![a-zA-Z0-9]+)/.test(t))return wn.char_match;if(t.length){let o=t.split("/");if(o.some(f=>f.includes(":")&&(f.includes("*")||f.includes(".")))||o.some(f=>f.split(":").length>2))return wn.char_match}}function _$(e){var r;if(e=e.replace(/^https?:\/\//,""),e.length===0)return wn.min_string;if(e.length>500)return wn.max_string;if(/[^a-zA-Z0-9_\-/:*.~=?#!$&+,;%@ ]/.test(e)||((r=e.match(/\*/g))==null?void 0:r.length)>=1||/[^a-zA-Z0-9_\-/:*.~=?#!$&+,;%@ ]:/.test(e)||/:(?![a-zA-Z0-9]+)/.test(e))return wn.char_match}function Jke(e){if(e.length===0)return wn.min_string;if(e.length>100)return wn.max_string;if(/[^a-zA-Z0-9-]/.test(e))return wn.char_match}function Xke(e){if(e.length===0)return wn.min_string;if(e.length>1e3)return wn.max_string;if(/[\u4e00-\u9fa5]/.test(e))return wn.char_match}function Zke(e){let t=e.split(",").map(r=>r.trim()).filter(Boolean);for(let r of t){let a=r.indexOf("="),o=a===-1?r.trim().toLowerCase():r.slice(0,a).trim().toLowerCase();if(o==="stale-while-revalidate"||o==="stale-if-error"){let n=`${o}=86400`;if(a===-1)return`${wn.value_match}: Cache-Control directive "${o}" must be in k=v form (e.g. ${n})`;if(!r.slice(a+1).trim())return`${wn.value_match}: Cache-Control directive "${r}" must have a value (e.g. ${n})`}}}function Qke(e){if(![301,302,303,304,307,308].includes(e))return wn.value_match}function e4e(e){if(typeof e!="number"||!Number.isInteger(e)||e<0)return wn.value_match}function t4e(e,t){let r=[],a=[];if(!Jb(e))return a.push({path:[...t],message:wn.invalid_type}),[r,a];for(let o in e){let n=e[o];if(!j2(n)){a.push({path:[...t,`[${o}]`],message:wn.invalid_type});continue}let{key:l,value:f}=n;if(!a1(l)){a.push({path:[...t,`[${o}]`,"key"],message:wn.invalid_type});continue}let y=Jke(l);if(y){a.push({path:[...t,`[${o}]`,"key"],message:y});continue}if(!a1(f)){a.push({path:[...t,`[${o}]`,"value"],message:wn.invalid_type});continue}let m=Xke(f);if(m){a.push({path:[...t,`[${o}]`,"value"],message:m});continue}if(l.toLowerCase()==="cache-control"){let b=Zke(f);if(b){a.push({path:[...t,`[${o}]`,"value"],message:b});continue}}r.push({key:l,value:f})}return[r,a]}function r4e(e,t){let r=[],a=[];if(!Jb(e))return a.push({path:[...t],message:wn.invalid_type}),[r,a];for(let o in e){let n=e[o];if(!j2(n)){a.push({path:[...t,`[${o}]`],message:wn.invalid_type});continue}let{source:l,headers:f}=n;if(!a1(l)){a.push({path:[...t,`[${o}]`,"source"],message:wn.invalid_type});continue}let y=xC(l);if(y){a.push({path:[...t,`[${o}]`,"source"],message:y});continue}let[m,b]=t4e(f,[...t,`[${o}]`,"headers"]);m.length>
|
|
139
|
+
`,prefix:n}=t,l=e.errors.map(f=>S$(f,r,a)).join(r);return Kke(l,n,o)}var yC,gC,vC,L3=Pt(()=>{yC=class extends Error{handled;constructor(t){super(t),this.handled=!0,this.name=this.constructor.name}},gC=class extends yC{constructor(t){super(`[ConfigLoadError] ${t}`)}};vC=class extends yC{details;constructor(t,r){let a=Gke(r,{prefix:`${t}:`});super(`[ValidationError] ${a}`),this.details=r.errors}}});var M3,eTt,b$=Pt(()=>{M3=class{log(t,r){try{let a=this.format(r),o=JSON.stringify({key:t,value:a});process.send(o)}catch{}}format(t){return typeof t=="object"?JSON.stringify(t):typeof t=="number"?String(t):t}},eTt=new M3});function j2(e){return Object.prototype.toString.call(e)==="[object Object]"}function Jb(e){return Object.prototype.toString.call(e)==="[object Array]"}function a1(e){return Object.prototype.toString.call(e)==="[object String]"}function E$(e){return Object.prototype.toString.call(e)==="[object Number]"}function xC(e){var a;let t=e.replace(/\\([?*])/g,"$1");if(e.length===0)return wn.min_string;if(t.length>500)return wn.max_string;if(/[^a-zA-Z0-9_\-/:*.~=?#!$&+,;%@ ]/.test(t)||((a=t.match(/\*/g))==null?void 0:a.length)>1||/[^a-zA-Z0-9_\-/:*.~=?#!$&+,;%@ ]:/.test(t)||/:(?![a-zA-Z0-9]+)/.test(t))return wn.char_match;if(t.length){let o=t.split("/");if(o.some(f=>f.includes(":")&&(f.includes("*")||f.includes(".")))||o.some(f=>f.split(":").length>2))return wn.char_match}}function _$(e){var r;if(e=e.replace(/^https?:\/\//,""),e.length===0)return wn.min_string;if(e.length>500)return wn.max_string;if(/[^a-zA-Z0-9_\-/:*.~=?#!$&+,;%@ ]/.test(e)||((r=e.match(/\*/g))==null?void 0:r.length)>=1||/[^a-zA-Z0-9_\-/:*.~=?#!$&+,;%@ ]:/.test(e)||/:(?![a-zA-Z0-9]+)/.test(e))return wn.char_match}function Jke(e){if(e.length===0)return wn.min_string;if(e.length>100)return wn.max_string;if(/[^a-zA-Z0-9-]/.test(e))return wn.char_match}function Xke(e){if(e.length===0)return wn.min_string;if(e.length>1e3)return wn.max_string;if(/[\u4e00-\u9fa5]/.test(e))return wn.char_match}function Zke(e){let t=e.split(",").map(r=>r.trim()).filter(Boolean);for(let r of t){let a=r.indexOf("="),o=a===-1?r.trim().toLowerCase():r.slice(0,a).trim().toLowerCase();if(o==="stale-while-revalidate"||o==="stale-if-error"){let n=`${o}=86400`;if(a===-1)return`${wn.value_match}: Cache-Control directive "${o}" must be in k=v form (e.g. ${n})`;if(!r.slice(a+1).trim())return`${wn.value_match}: Cache-Control directive "${r}" must have a value (e.g. ${n})`}}}function Qke(e){if(![301,302,303,304,307,308].includes(e))return wn.value_match}function e4e(e){if(typeof e!="number"||!Number.isInteger(e)||e<0)return wn.value_match}function t4e(e,t){let r=[],a=[];if(!Jb(e))return a.push({path:[...t],message:wn.invalid_type}),[r,a];for(let o in e){let n=e[o];if(!j2(n)){a.push({path:[...t,`[${o}]`],message:wn.invalid_type});continue}let{key:l,value:f}=n;if(!a1(l)){a.push({path:[...t,`[${o}]`,"key"],message:wn.invalid_type});continue}let y=Jke(l);if(y){a.push({path:[...t,`[${o}]`,"key"],message:y});continue}if(!a1(f)){a.push({path:[...t,`[${o}]`,"value"],message:wn.invalid_type});continue}let m=Xke(f);if(m){a.push({path:[...t,`[${o}]`,"value"],message:m});continue}if(l.toLowerCase()==="cache-control"){let b=Zke(f);if(b){a.push({path:[...t,`[${o}]`,"value"],message:b});continue}}r.push({key:l,value:f})}return[r,a]}function r4e(e,t){let r=[],a=[];if(!Jb(e))return a.push({path:[...t],message:wn.invalid_type}),[r,a];for(let o in e){let n=e[o];if(!j2(n)){a.push({path:[...t,`[${o}]`],message:wn.invalid_type});continue}let{source:l,headers:f}=n;if(!a1(l)){a.push({path:[...t,`[${o}]`,"source"],message:wn.invalid_type});continue}let y=xC(l);if(y){a.push({path:[...t,`[${o}]`,"source"],message:y});continue}let[m,b]=t4e(f,[...t,`[${o}]`,"headers"]);m.length>100&&(b.push({path:[...t,`[${o}]`,"headers"],message:wn.max_length}),m=m.slice(0,100)),(f==null?void 0:f.length)<1&&m.length<1&&b.push({path:[...t,`[${o}]`,"headers"],message:wn.min_length}),m.length&&r.push({source:l,headers:m}),a.push(...b)}return r.length>100&&(a.push({path:[...t],message:wn.max_length}),r=r.slice(0,100)),[r,a]}function n4e(e,t){let r=[],a=[];if(!Jb(e))return a.push({path:[...t],message:wn.invalid_type}),[r,a];for(let o in e){let n=e[o];if(!j2(n)){a.push({path:[...t,`[${o}]`],message:wn.invalid_type});continue}let{source:l,destination:f,statusCode:y}=n;if(!a1(l)){a.push({path:[...t,`[${o}]`,"source"],message:wn.invalid_type});continue}let m=xC(l);if(m){a.push({path:[...t,`[${o}]`,"source"],message:m});continue}if(!a1(f)){a.push({path:[...t,`[${o}]`,"destination"],message:wn.invalid_type});continue}let b=_$(f);if(b){a.push({path:[...t,`[${o}]`,"destination"],message:b});continue}if(!E$(y)){a.push({path:[...t,`[${o}]`,"statusCode"],message:wn.invalid_type});continue}let w=Qke(y);if(w){a.push({path:[...t,`[${o}]`,"statusCode"],message:w});continue}r.push({source:l,destination:f,statusCode:y})}return r.length>100&&(a.push({path:[...t],message:wn.max_length}),r=r.slice(0,100)),[r,a]}function i4e(e,t){let r=[],a=[];if(!Jb(e))return a.push({path:[...t],message:wn.invalid_type}),[r,a];for(let o in e){let n=e[o];if(!j2(n)){a.push({path:[...t,`[${o}]`],message:wn.invalid_type});continue}let{source:l,destination:f}=n;if(!a1(l)){a.push({path:[...t,`[${o}]`,"source"],message:wn.invalid_type});continue}let y=xC(l);if(y){a.push({path:[...t,`[${o}]`,"source"],message:y});continue}if(!a1(f)){a.push({path:[...t,`[${o}]`,"destination"],message:wn.invalid_type});continue}let m=_$(f);if(m){a.push({path:[...t,`[${o}]`,"destination"],message:m});continue}r.push({source:l,destination:f})}return r.length>100&&(a.push({path:[...t],message:wn.max_length}),r=r.slice(0,100)),[r,a]}function s4e(e,t){let r=[],a=[];if(!Jb(e))return a.push({path:[...t],message:wn.invalid_type}),[r,a];for(let o in e){let n=e[o];if(!j2(n)){a.push({path:[...t,`[${o}]`],message:wn.invalid_type});continue}let{source:l,cacheTtl:f}=n;if(!a1(l)){a.push({path:[...t,`[${o}]`,"source"],message:wn.invalid_type});continue}let y=xC(l);if(y){a.push({path:[...t,`[${o}]`,"source"],message:y});continue}if(!E$(f)){a.push({path:[...t,`[${o}]`,"cacheTtl"],message:wn.invalid_type});continue}let m=e4e(f);if(m){a.push({path:[...t,`[${o}]`,"cacheTtl"],message:m});continue}r.push({source:l,cacheTtl:f})}return r.length>100&&(a.push({path:[...t],message:wn.max_length}),r=r.slice(0,100)),[r,a]}function T$(e,t){let r={headers:[],redirects:[],rewrites:[],caches:[]},a=[];if(!j2(e))return a.push({path:[...t],message:wn.invalid_type}),[r,a];let{headers:o=[],redirects:n=[],rewrites:l=[],caches:f=[]}=e,[y,m]=r4e(o,[...t,"headers"]),[b,w]=n4e(n,[...t,"redirects"]),[A,R]=i4e(l,[...t,"rewrites"]),[g,z]=s4e(f,[...t,"caches"]);r.headers=y,r.redirects=b,r.rewrites=A,r.caches=g,r["node-functions"]=e["node-functions"],r["edge-functions"]=e["edge-functions"];let q=["outputDirectory","installCommand","buildCommand","nodeVersion","nodeFunctionsConfig"];for(let V in e)q.includes(V)&&e[V]&&(r[V]=e[V]);return a.push(...m,...w,...R,...z),[r,a]}var wn,w$=Pt(()=>{wn={invalid_type:"invalid type error",max_length:"max length error",min_length:"min length error",min_string:"string min error",max_string:"string max error",char_match:"char match error",value_match:"value match error"}});var a4e,C$,o4e,u4e,c4e,l4e,p4e,f4e,d4e,D$,P$=Pt(()=>{O3();a4e=/^(?=.{2,30}$)[a-z0-9]+(-[a-z0-9]+)*-?[a-z0-9]+$/,C$=Bt.string().refine(e=>a4e.test(e)),o4e=Bt.enum(["vps-react-ts","vps-react","vps-vue-ts","vps-vue","manaia-demo","manaia-demo-ts"]),u4e=Bt.object({name:C$}),c4e=Bt.object({name:C$,template:o4e}),l4e=Bt.object({script:Bt.string().optional()}),p4e=Bt.object({script:Bt.string().optional()}),f4e=Bt.object({}),d4e=Bt.object({}),D$={initArgsSchema:u4e,generateArgsSchema:c4e,devArgsSchema:l4e,publishArgsSchema:p4e,deleteArgsSchema:f4e,testArgsSchema:d4e}});function h4e(e,t){return r=>{try{e.parse(r)}catch(a){throw new vC(`Failed to validate ${t}`,a)}}}function m4e(){let e={};return Object.entries({...D$,...x$}).forEach(([t,r])=>{let a=t.replace("Schema","");e[a]=h4e(r,a)}),e}var uTt,A$=Pt(()=>{P$();mC();L3();uTt=m4e()});function y4e(e="",t={confPath:""}){try{e=e||process.cwd();let[r,a]=g4e(e);if(t.exists=a,!a)return t.showError||Bf(),{headers:[],redirects:[],rewrites:[]};t.confPath=r;let o=_3(r);return O$.default.parse(o)}catch{t.showError||Bf()}}async function N$(e=!1){var n,l,f,y,m,b,w,A,R;!e&&console.log(`
|
|
140
140
|
> Start validating the configuration file:`);let t={confPath:"",exists:!1},r=await y4e("",t);try{let[g,z]=T$(r,["root"]);return z!=null&&z.length&&!e?z.map(q=>{console.log(`error in ${q.path.join(".")}: ${q.message}`)}):!e&&console.log("none error in configuration file"),!e&&console.log(`End validating!
|
|
141
141
|
`),g}catch{!e&&console.log(`Failure validating!
|
|
142
142
|
`)}return{headers:[],redirects:[],rewrites:[],caches:[]}}function g4e(e){let t="",r=t$(e),a=!1;if(r.isDirectory()){let o=[];for(let n of[`${k$}.json`,`${k$}.json5`]){let l=SC.default.normalize(SC.default.resolve(e,n));if(o.push(l),a=E3(l),a){t=l;break}}a||(t=o[0])}else r.isFile()&&(t=SC.default.normalize(e),a=!0);return[t,a]}function bC(e){try{if(!e.endsWith(".env")&&!e.endsWith(".local"))throw new Error(`Invalid .env path: ${e}`);let t=r$(e);for(let[r,a]of Object.entries(t))r in process.env||(process.env[r]=a);return t}catch(t){throw new gC(`Failed to load .env:
|