edgeone 1.2.29-beta.1 → 1.2.29-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -519,7 +519,7 @@ ${A.join(`
519
519
  `;x.forEach(A=>{b+=A}),t.fail(b)}};let f={};s.conflicts=function(g,x){Xn("<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((C,k)=>k.length-C.length);let A=null,I=1/0;for(let C=0,k;(k=x[C])!==void 0;C++){let O=zPe(g,k);O<=3&&O<I&&(I=O,A=k)}A&&t.fail(n("Did you mean %s?",A))},s.reset=function(g){return c=NC(c,x=>!g[x]),f=NC(f,x=>!g[x]),s};let d=[];return s.freeze=function(){d.push({implied:c,conflicting:f})},s.unfreeze=function(){let g=d.pop();im(g,void 0,r),{implied:c,conflicting:f}=g},s}var ei=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,Nk,Z3,ry,Qg,P7,OC,Fk,R7,ny,N7,iy,Hb,Lg,sy,F7,yR,_f,bi,O7,Q7,jg,Ok,vR,Qk,QC,L7,us,Lk,jk,Mk,ws,j7,Vb,Tl;function pRe(e){return(t=[],r=e.process.cwd(),n)=>{let a=new bie(t,r,n,e);return Object.defineProperty(a,"argv",{get:()=>a.parse(),enumerable:!0}),a.help(),a.version(),a}}var $Pe=Symbol("copyDoubleDash"),WPe=Symbol("copyDoubleDash"),pie=Symbol("deleteFromParserHintObject"),GPe=Symbol("emitWarning"),YPe=Symbol("freeze"),JPe=Symbol("getDollarZero"),qk=Symbol("getParserConfiguration"),KPe=Symbol("getUsageConfiguration"),fie=Symbol("guessLocale"),XPe=Symbol("guessVersion"),ZPe=Symbol("parsePositionalNumbers"),die=Symbol("pkgUp"),LC=Symbol("populateParserHintArray"),xR=Symbol("populateParserHintSingleValueDictionary"),hie=Symbol("populateParserHintArrayDictionary"),mie=Symbol("populateParserHintDictionary"),gie=Symbol("sanitizeKey"),Aie=Symbol("setKey"),yie=Symbol("unfreeze"),eRe=Symbol("validateAsync"),tRe=Symbol("getCommandInstance"),rRe=Symbol("getContext"),nRe=Symbol("getHasOutput"),iRe=Symbol("getLoggerInstance"),sRe=Symbol("getParseContext"),aRe=Symbol("getUsageInstance"),oRe=Symbol("getValidationInstance"),M7=Symbol("hasParseCallback"),cRe=Symbol("isGlobalContext"),Uk=Symbol("postProcess"),uRe=Symbol("rebase"),vie=Symbol("reset"),eL=Symbol("runYargsParserAndExecuteCommands"),xie=Symbol("runValidation"),lRe=Symbol("setHasOutput"),zk=Symbol("kTrackManuallySetKeys"),bie=class{constructor(t=[],r,n,a){this.customScriptName=!1,this.parsed=!1,ep.set(this,void 0),Nk.set(this,void 0),Z3.set(this,{commands:[],fullCommands:[]}),ry.set(this,null),Qg.set(this,null),P7.set(this,"show-hidden"),OC.set(this,null),Fk.set(this,!0),R7.set(this,{}),ny.set(this,!0),N7.set(this,[]),iy.set(this,void 0),Hb.set(this,{}),Lg.set(this,!1),sy.set(this,null),F7.set(this,!0),yR.set(this,void 0),_f.set(this,""),bi.set(this,void 0),O7.set(this,void 0),Q7.set(this,{}),jg.set(this,null),Ok.set(this,null),vR.set(this,{}),Qk.set(this,{}),QC.set(this,void 0),L7.set(this,!1),us.set(this,void 0),Lk.set(this,!1),jk.set(this,!1),Mk.set(this,!1),ws.set(this,void 0),j7.set(this,{}),Vb.set(this,null),Tl.set(this,void 0),ei(this,us,a,"f"),ei(this,QC,t,"f"),ei(this,Nk,r,"f"),ei(this,O7,n,"f"),ei(this,iy,new T7(this),"f"),this.$0=this[JPe](),this[vie](),ei(this,ep,qe(this,ep,"f"),"f"),ei(this,ws,qe(this,ws,"f"),"f"),ei(this,Tl,qe(this,Tl,"f"),"f"),ei(this,bi,qe(this,bi,"f"),"f"),qe(this,bi,"f").showHiddenOpt=qe(this,P7,"f"),ei(this,yR,this[WPe](),"f")}addHelpOpt(t,r){let n="help";return Xn("[string|boolean] [string]",[t,r],arguments.length),qe(this,sy,"f")&&(this[pie](qe(this,sy,"f")),ei(this,sy,null,"f")),t===!1&&r===void 0?this:(ei(this,sy,typeof t=="string"?t:n,"f"),this.boolean(qe(this,sy,"f")),this.describe(qe(this,sy,"f"),r||qe(this,ws,"f").deferY18nLookup("Show help")),this)}help(t,r){return this.addHelpOpt(t,r)}addShowHiddenOpt(t,r){if(Xn("[string|boolean] [string]",[t,r],arguments.length),t===!1&&r===void 0)return this;let n=typeof t=="string"?t:qe(this,P7,"f");return this.boolean(n),this.describe(n,r||qe(this,ws,"f").deferY18nLookup("Show hidden options")),qe(this,bi,"f").showHiddenOpt=n,this}showHidden(t,r){return this.addShowHiddenOpt(t,r)}alias(t,r){return Xn("<object|string|array> [string|array]",[t,r],arguments.length),this[hie](this.alias.bind(this),"alias",t,r),this}array(t){return Xn("<array|string>",[t],arguments.length),this[LC]("array",t),this[zk](t),this}boolean(t){return Xn("<array|string>",[t],arguments.length),this[LC]("boolean",t),this[zk](t),this}check(t,r){return Xn("<function> [boolean]",[t,r],arguments.length),this.middleware((n,a)=>Rk(()=>t(n,a.getOptions()),s=>(s?(typeof s=="string"||s instanceof Error)&&qe(this,ws,"f").fail(s.toString(),s):qe(this,ws,"f").fail(qe(this,us,"f").y18n.__("Argument check failed: %s",t.toString())),n),s=>(qe(this,ws,"f").fail(s.message?s.message:s.toString(),s),n)),!1,r),this}choices(t,r){return Xn("<object|string|array> [string|array]",[t,r],arguments.length),this[hie](this.choices.bind(this),"choices",t,r),this}coerce(t,r){if(Xn("<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,bi,"f").key[t]=!0,qe(this,iy,"f").addCoerceMiddleware((n,a)=>{let s;return Object.prototype.hasOwnProperty.call(n,t)?Rk(()=>(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 Xn("<string|object> [string|array]",[t,r],arguments.length),qe(this,Tl,"f").conflicts(t,r),this}config(t="config",r,n){return Xn("[object|string] [string|function] [function]",[t,r,n],arguments.length),typeof t=="object"&&!Array.isArray(t)?(t=J3(t,qe(this,Nk,"f"),this[qk]()["deep-merge-config"]||!1,qe(this,us,"f")),qe(this,bi,"f").configObjects=(qe(this,bi,"f").configObjects||[]).concat(t),this):(typeof r=="function"&&(n=r,r=void 0),this.describe(t,r||qe(this,ws,"f").deferY18nLookup("Path to JSON config file")),(Array.isArray(t)?t:[t]).forEach(a=>{qe(this,bi,"f").config[a]=n||!0}),this)}completion(t,r,n){return Xn("[string] [string|boolean|function] [function]",[t,r,n],arguments.length),typeof r=="function"&&(n=r,r=void 0),ei(this,Qg,t||qe(this,Qg,"f")||"completion","f"),!r&&r!==!1&&(r="generate completion script"),this.command(qe(this,Qg,"f"),r),n&&qe(this,ry,"f").registerFunction(n),this}command(t,r,n,a,s,c){return Xn("<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){Xn("<string> [object]",[t,r],arguments.length);let n=qe(this,O7,"f")||qe(this,us,"f").require;return qe(this,ep,"f").addDirectory(t,n,qe(this,us,"f").getCallerFile(),r),this}count(t){return Xn("<array|string>",[t],arguments.length),this[LC]("count",t),this[zk](t),this}default(t,r,n){return Xn("<object|string|array> [*] [string]",[t,r,n],arguments.length),n&&(aie(t,qe(this,us,"f")),qe(this,bi,"f").defaultDescription[t]=n),typeof r=="function"&&(aie(t,qe(this,us,"f")),qe(this,bi,"f").defaultDescription[t]||(qe(this,bi,"f").defaultDescription[t]=qe(this,ws,"f").functionDescription(r)),r=r.call()),this[xR](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 Xn("[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,bi,"f").demandedCommands._={min:t,max:r,minMsg:n,maxMsg:a},this}demand(t,r,n){return Array.isArray(r)?(r.forEach(a=>{im(n,!0,qe(this,us,"f")),this.demandOption(a,n)}),r=1/0):typeof r!="number"&&(n=r,r=1/0),typeof t=="number"?(im(n,!0,qe(this,us,"f")),this.demandCommand(t,r,n,n)):Array.isArray(t)?t.forEach(a=>{im(n,!0,qe(this,us,"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 Xn("<object|string|array> [string]",[t,r],arguments.length),this[xR](this.demandOption.bind(this),"demandedOptions",t,r),this}deprecateOption(t,r){return Xn("<string> [string|boolean]",[t,r],arguments.length),qe(this,bi,"f").deprecatedOptions[t]=r,this}describe(t,r){return Xn("<object|string|array> [string]",[t,r],arguments.length),this[Aie](t,!0),qe(this,ws,"f").describe(t,r),this}detectLocale(t){return Xn("<boolean>",[t],arguments.length),ei(this,Fk,t,"f"),this}env(t){return Xn("[string|boolean]",[t],arguments.length),t===!1?delete qe(this,bi,"f").envPrefix:qe(this,bi,"f").envPrefix=t||"",this}epilogue(t){return Xn("<string>",[t],arguments.length),qe(this,ws,"f").epilog(t),this}epilog(t){return this.epilogue(t)}example(t,r){return Xn("<string|array> [string]",[t,r],arguments.length),Array.isArray(t)?t.forEach(n=>this.example(...n)):qe(this,ws,"f").example(t,r),this}exit(t,r){ei(this,Lg,!0,"f"),ei(this,OC,r,"f"),qe(this,ny,"f")&&qe(this,us,"f").process.exit(t)}exitProcess(t=!0){return Xn("[boolean]",[t],arguments.length),ei(this,ny,t,"f"),this}fail(t){if(Xn("<function|boolean>",[t],arguments.length),typeof t=="boolean"&&t!==!1)throw new uu("Invalid first argument. Expected function or boolean 'false'");return qe(this,ws,"f").failFn(t),this}getAliases(){return this.parsed?this.parsed.aliases:{}}async getCompletion(t,r){return Xn("<array> [function]",[t,r],arguments.length),r?qe(this,ry,"f").getCompletion(t,r):new Promise((n,a)=>{qe(this,ry,"f").getCompletion(t,(s,c)=>{s?a(s):n(c)})})}getDemandedOptions(){return Xn([],0),qe(this,bi,"f").demandedOptions}getDemandedCommands(){return Xn([],0),qe(this,bi,"f").demandedCommands}getDeprecatedOptions(){return Xn([],0),qe(this,bi,"f").deprecatedOptions}getDetectLocale(){return qe(this,Fk,"f")}getExitProcess(){return qe(this,ny,"f")}getGroups(){return Object.assign({},qe(this,Hb,"f"),qe(this,Qk,"f"))}getHelp(){if(ei(this,Lg,!0,"f"),!qe(this,ws,"f").hasCachedHelpMessage()){if(!this.parsed){let r=this[eL](qe(this,QC,"f"),void 0,void 0,0,!0);if(lu(r))return r.then(()=>qe(this,ws,"f").help())}let t=qe(this,ep,"f").runDefaultBuilderOn(this);if(lu(t))return t.then(()=>qe(this,ws,"f").help())}return Promise.resolve(qe(this,ws,"f").help())}getOptions(){return qe(this,bi,"f")}getStrict(){return qe(this,Lk,"f")}getStrictCommands(){return qe(this,jk,"f")}getStrictOptions(){return qe(this,Mk,"f")}global(t,r){return Xn("<string|array> [boolean]",[t,r],arguments.length),t=[].concat(t),r!==!1?qe(this,bi,"f").local=qe(this,bi,"f").local.filter(n=>t.indexOf(n)===-1):t.forEach(n=>{qe(this,bi,"f").local.includes(n)||qe(this,bi,"f").local.push(n)}),this}group(t,r){Xn("<string|array> <string>",[t,r],arguments.length);let n=qe(this,Qk,"f")[r]||qe(this,Hb,"f")[r];qe(this,Qk,"f")[r]&&delete qe(this,Qk,"f")[r];let a={};return qe(this,Hb,"f")[r]=(n||[]).concat(t).filter(s=>a[s]?!1:a[s]=!0),this}hide(t){return Xn("<string>",[t],arguments.length),qe(this,bi,"f").hiddenOptions.push(t),this}implies(t,r){return Xn("<string|object> [number|string|array]",[t,r],arguments.length),qe(this,Tl,"f").implies(t,r),this}locale(t){return Xn("[string]",[t],arguments.length),t===void 0?(this[fie](),qe(this,us,"f").y18n.getLocale()):(ei(this,Fk,!1,"f"),qe(this,us,"f").y18n.setLocale(t),this)}middleware(t,r,n){return qe(this,iy,"f").addMiddleware(t,!!r,n)}nargs(t,r){return Xn("<string|object|array> [number]",[t,r],arguments.length),this[xR](this.nargs.bind(this),"narg",t,r),this}normalize(t){return Xn("<array|string>",[t],arguments.length),this[LC]("normalize",t),this}number(t){return Xn("<array|string>",[t],arguments.length),this[LC]("number",t),this[zk](t),this}option(t,r){if(Xn("<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[zk](t),qe(this,Vb,"f")&&(t==="version"||(r==null?void 0:r.alias)==="version")&&this[GPe](['"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,bi,"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,bi,"f").defaultDescription[t]=r.defaultDescription),r.skipValidation&&this.skipValidation(t);let s=r.describe||r.description||r.desc,c=qe(this,ws,"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){Xn("[string|array] [function|boolean|object] [function]",[t,r,n],arguments.length),this[YPe](),typeof t>"u"&&(t=qe(this,QC,"f")),typeof r=="object"&&(ei(this,Ok,r,"f"),r=n),typeof r=="function"&&(ei(this,jg,r,"f"),r=!1),r||ei(this,QC,t,"f"),qe(this,jg,"f")&&ei(this,ny,!1,"f");let a=this[eL](t,!!r),s=this.parsed;return qe(this,ry,"f").setParsed(this.parsed),lu(a)?a.then(c=>(qe(this,jg,"f")&&qe(this,jg,"f").call(this,qe(this,OC,"f"),c,qe(this,_f,"f")),c)).catch(c=>{throw qe(this,jg,"f")&&qe(this,jg,"f")(c,this.parsed.argv,qe(this,_f,"f")),c}).finally(()=>{this[yie](),this.parsed=s}):(qe(this,jg,"f")&&qe(this,jg,"f").call(this,qe(this,OC,"f"),a,qe(this,_f,"f")),this[yie](),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 Xn("<object>",[t],arguments.length),ei(this,Q7,t,"f"),this}pkgConf(t,r){Xn("<string> [string]",[t,r],arguments.length);let n=null,a=this[die](r||qe(this,Nk,"f"));return a[t]&&typeof a[t]=="object"&&(n=J3(a[t],r||qe(this,Nk,"f"),this[qk]()["deep-merge-config"]||!1,qe(this,us,"f")),qe(this,bi,"f").configObjects=(qe(this,bi,"f").configObjects||[]).concat(n)),this}positional(t,r){Xn("<string> <object>",[t,r],arguments.length);let n=["default","defaultDescription","implies","normalize","choices","conflicts","coerce","type","describe","desc","description","alias"];r=NC(r,(c,l)=>c==="type"&&!["string","number","boolean"].includes(l)?!1:n.includes(c));let a=qe(this,Z3,"f").fullCommands[qe(this,Z3,"f").fullCommands.length-1],s=a?qe(this,ep,"f").cmdToParseOptions(a):{array:[],alias:{},default:{},demand:{}};return gR(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,ws,"f").getPositionalGroupName()),this.option(t,r)}recommendCommands(t=!0){return Xn("[boolean]",[t],arguments.length),ei(this,L7,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 Xn("<array|string|object> [number]",[t],arguments.length),typeof t=="string"&&qe(this,bi,"f").narg[t]?this:(this[xR](this.requiresArg.bind(this),"narg",t,NaN),this)}showCompletionScript(t,r){return Xn("[string] [string]",[t,r],arguments.length),t=t||this.$0,qe(this,yR,"f").log(qe(this,ry,"f").generateCompletionScript(t,r||qe(this,Qg,"f")||"completion")),this}showHelp(t){if(Xn("[string|function]",[t],arguments.length),ei(this,Lg,!0,"f"),!qe(this,ws,"f").hasCachedHelpMessage()){if(!this.parsed){let n=this[eL](qe(this,QC,"f"),void 0,void 0,0,!0);if(lu(n))return n.then(()=>{qe(this,ws,"f").showHelp(t)}),this}let r=qe(this,ep,"f").runDefaultBuilderOn(this);if(lu(r))return r.then(()=>{qe(this,ws,"f").showHelp(t)}),this}return qe(this,ws,"f").showHelp(t),this}scriptName(t){return this.customScriptName=!0,this.$0=t,this}showHelpOnFail(t,r){return Xn("[boolean|string] [string]",[t,r],arguments.length),qe(this,ws,"f").showHelpOnFail(t,r),this}showVersion(t){return Xn("[string|function]",[t],arguments.length),qe(this,ws,"f").showVersion(t),this}skipValidation(t){return Xn("<array|string>",[t],arguments.length),this[LC]("skipValidation",t),this}strict(t){return Xn("[boolean]",[t],arguments.length),ei(this,Lk,t!==!1,"f"),this}strictCommands(t){return Xn("[boolean]",[t],arguments.length),ei(this,jk,t!==!1,"f"),this}strictOptions(t){return Xn("[boolean]",[t],arguments.length),ei(this,Mk,t!==!1,"f"),this}string(t){return Xn("<array|string>",[t],arguments.length),this[LC]("string",t),this[zk](t),this}terminalWidth(){return Xn([],0),qe(this,us,"f").process.stdColumns}updateLocale(t){return this.updateStrings(t)}updateStrings(t){return Xn("<object>",[t],arguments.length),ei(this,Fk,!1,"f"),qe(this,us,"f").y18n.updateLocale(t),this}usage(t,r,n,a){if(Xn("<string|null|undefined> [string|boolean] [function|object] [function]",[t,r,n,a],arguments.length),r!==void 0){if(im(t,null,qe(this,us,"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,ws,"f").usage(t),this}usageConfiguration(t){return Xn("<object>",[t],arguments.length),ei(this,j7,t,"f"),this}version(t,r,n){let a="version";if(Xn("[boolean|string] [string] [string]",[t,r,n],arguments.length),qe(this,Vb,"f")&&(this[pie](qe(this,Vb,"f")),qe(this,ws,"f").version(void 0),ei(this,Vb,null,"f")),arguments.length===0)n=this[XPe](),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 ei(this,Vb,typeof t=="string"?t:a,"f"),r=r||qe(this,ws,"f").deferY18nLookup("Show version number"),qe(this,ws,"f").version(n||void 0),this.boolean(qe(this,Vb,"f")),this.describe(qe(this,Vb,"f"),r),this}wrap(t){return Xn("<number|null|undefined>",[t],arguments.length),qe(this,ws,"f").wrap(t),this}[(ep=new WeakMap,Nk=new WeakMap,Z3=new WeakMap,ry=new WeakMap,Qg=new WeakMap,P7=new WeakMap,OC=new WeakMap,Fk=new WeakMap,R7=new WeakMap,ny=new WeakMap,N7=new WeakMap,iy=new WeakMap,Hb=new WeakMap,Lg=new WeakMap,sy=new WeakMap,F7=new WeakMap,yR=new WeakMap,_f=new WeakMap,bi=new WeakMap,O7=new WeakMap,Q7=new WeakMap,jg=new WeakMap,Ok=new WeakMap,vR=new WeakMap,Qk=new WeakMap,QC=new WeakMap,L7=new WeakMap,us=new WeakMap,Lk=new WeakMap,jk=new WeakMap,Mk=new WeakMap,ws=new WeakMap,j7=new WeakMap,Vb=new WeakMap,Tl=new WeakMap,$Pe)](t){if(!t._||!t["--"])return t;t._.push.apply(t._,t["--"]);try{delete t["--"]}catch{}return t}[WPe](){return{log:(...t)=>{this[M7]()||console.log(...t),ei(this,Lg,!0,"f"),qe(this,_f,"f").length&&ei(this,_f,qe(this,_f,"f")+`
521
521
  `,"f"),ei(this,_f,qe(this,_f,"f")+t.join(" "),"f")},error:(...t)=>{this[M7]()||console.error(...t),ei(this,Lg,!0,"f"),qe(this,_f,"f").length&&ei(this,_f,qe(this,_f,"f")+`
522
- `,"f"),ei(this,_f,qe(this,_f,"f")+t.join(" "),"f")}}}[pie](t){gR(qe(this,bi,"f")).forEach(r=>{if((a=>a==="configObjects")(r))return;let n=qe(this,bi,"f")[r];Array.isArray(n)?n.includes(t)&&n.splice(n.indexOf(t),1):typeof n=="object"&&delete n[t]}),delete qe(this,ws,"f").getDescriptions()[t]}[GPe](t,r,n){qe(this,R7,"f")[n]||(qe(this,us,"f").process.emitWarning(t,r),qe(this,R7,"f")[n]=!0)}[YPe](){qe(this,N7,"f").push({options:qe(this,bi,"f"),configObjects:qe(this,bi,"f").configObjects.slice(0),exitProcess:qe(this,ny,"f"),groups:qe(this,Hb,"f"),strict:qe(this,Lk,"f"),strictCommands:qe(this,jk,"f"),strictOptions:qe(this,Mk,"f"),completionCommand:qe(this,Qg,"f"),output:qe(this,_f,"f"),exitError:qe(this,OC,"f"),hasOutput:qe(this,Lg,"f"),parsed:this.parsed,parseFn:qe(this,jg,"f"),parseContext:qe(this,Ok,"f")}),qe(this,ws,"f").freeze(),qe(this,Tl,"f").freeze(),qe(this,ep,"f").freeze(),qe(this,iy,"f").freeze()}[JPe](){let t="",r;return/\b(node|iojs|electron)(\.exe)?$/.test(qe(this,us,"f").process.argv()[0])?r=qe(this,us,"f").process.argv().slice(1,2):r=qe(this,us,"f").process.argv().slice(0,1),t=r.map(n=>{let a=this[uRe](qe(this,Nk,"f"),n);return n.match(/^(\/|([a-zA-Z]:)?\\)/)&&a.length<n.length?a:n}).join(" ").trim(),qe(this,us,"f").getEnv("_")&&qe(this,us,"f").getProcessArgvBin()===qe(this,us,"f").getEnv("_")&&(t=qe(this,us,"f").getEnv("_").replace(`${qe(this,us,"f").path.dirname(qe(this,us,"f").process.execPath())}/`,"")),t}[qk](){return qe(this,Q7,"f")}[KPe](){return qe(this,j7,"f")}[fie](){if(!qe(this,Fk,"f"))return;let t=qe(this,us,"f").getEnv("LC_ALL")||qe(this,us,"f").getEnv("LC_MESSAGES")||qe(this,us,"f").getEnv("LANG")||qe(this,us,"f").getEnv("LANGUAGE")||"en_US";this.locale(t.replace(/[.:].*/,""))}[XPe](){return this[die]().version||"unknown"}[ZPe](t){let r=t["--"]?t["--"]:t._;for(let n=0,a;(a=r[n])!==void 0;n++)qe(this,us,"f").Parser.looksLikeNumber(a)&&Number.isSafeInteger(Math.floor(parseFloat(`${a}`)))&&(r[n]=Number(a));return t}[die](t){let r=t||"*";if(qe(this,vR,"f")[r])return qe(this,vR,"f")[r];let n={};try{let a=t||qe(this,us,"f").mainFilename;!t&&qe(this,us,"f").path.extname(a)&&(a=qe(this,us,"f").path.dirname(a));let s=qe(this,us,"f").findUp(a,(c,l)=>{if(l.includes("package.json"))return"package.json"});im(s,void 0,qe(this,us,"f")),n=JSON.parse(qe(this,us,"f").readFileSync(s,"utf8"))}catch{}return qe(this,vR,"f")[r]=n||{},qe(this,vR,"f")[r]}[LC](t,r){r=[].concat(r),r.forEach(n=>{n=this[gie](n),qe(this,bi,"f")[t].push(n)})}[xR](t,r,n,a){this[mie](t,r,n,a,(s,c,l)=>{qe(this,bi,"f")[s][c]=l})}[hie](t,r,n,a){this[mie](t,r,n,a,(s,c,l)=>{qe(this,bi,"f")[s][c]=(qe(this,bi,"f")[s][c]||[]).concat(l)})}[mie](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 gR(n))t(c,n[c]);else s(r,this[gie](n),a)}[gie](t){return t==="__proto__"?"___proto___":t}[Aie](t,r){return this[xR](this[Aie].bind(this),"key",t,r),this}[yie](){var t,r,n,a,s,c,l,f,d,m,g,x;let b=qe(this,N7,"f").pop();im(b,void 0,qe(this,us,"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(I){ei(t,bi,I,"f")}}.value,configObjects:A,exitProcess:{set value(I){ei(r,ny,I,"f")}}.value,groups:{set value(I){ei(n,Hb,I,"f")}}.value,output:{set value(I){ei(a,_f,I,"f")}}.value,exitError:{set value(I){ei(s,OC,I,"f")}}.value,hasOutput:{set value(I){ei(c,Lg,I,"f")}}.value,parsed:this.parsed,strict:{set value(I){ei(l,Lk,I,"f")}}.value,strictCommands:{set value(I){ei(f,jk,I,"f")}}.value,strictOptions:{set value(I){ei(d,Mk,I,"f")}}.value,completionCommand:{set value(I){ei(m,Qg,I,"f")}}.value,parseFn:{set value(I){ei(g,jg,I,"f")}}.value,parseContext:{set value(I){ei(x,Ok,I,"f")}}.value}=b,qe(this,bi,"f").configObjects=A,qe(this,ws,"f").unfreeze(),qe(this,Tl,"f").unfreeze(),qe(this,ep,"f").unfreeze(),qe(this,iy,"f").unfreeze()}[eRe](t,r){return Rk(r,n=>(t(n),n))}getInternalMethods(){return{getCommandInstance:this[tRe].bind(this),getContext:this[rRe].bind(this),getHasOutput:this[nRe].bind(this),getLoggerInstance:this[iRe].bind(this),getParseContext:this[sRe].bind(this),getParserConfiguration:this[qk].bind(this),getUsageConfiguration:this[KPe].bind(this),getUsageInstance:this[aRe].bind(this),getValidationInstance:this[oRe].bind(this),hasParseCallback:this[M7].bind(this),isGlobalContext:this[cRe].bind(this),postProcess:this[Uk].bind(this),reset:this[vie].bind(this),runValidation:this[xie].bind(this),runYargsParserAndExecuteCommands:this[eL].bind(this),setHasOutput:this[lRe].bind(this)}}[tRe](){return qe(this,ep,"f")}[rRe](){return qe(this,Z3,"f")}[nRe](){return qe(this,Lg,"f")}[iRe](){return qe(this,yR,"f")}[sRe](){return qe(this,Ok,"f")||{}}[aRe](){return qe(this,ws,"f")}[oRe](){return qe(this,Tl,"f")}[M7](){return!!qe(this,jg,"f")}[cRe](){return qe(this,F7,"f")}[Uk](t,r,n,a){return n||lu(t)||(r||(t=this[$Pe](t)),(this[qk]()["parse-positional-numbers"]||this[qk]()["parse-positional-numbers"]===void 0)&&(t=this[ZPe](t)),a&&(t=Pk(t,this,qe(this,iy,"f").getMiddleware(),!1))),t}[vie](t={}){ei(this,bi,qe(this,bi,"f")||{},"f");let r={};r.local=qe(this,bi,"f").local||[],r.configObjects=qe(this,bi,"f").configObjects||[];let n={};r.local.forEach(c=>{n[c]=!0,(t[c]||[]).forEach(l=>{n[l]=!0})}),Object.assign(qe(this,Qk,"f"),Object.keys(qe(this,Hb,"f")).reduce((c,l)=>{let f=qe(this,Hb,"f")[l].filter(d=>!(d in n));return f.length>0&&(c[l]=f),c},{})),ei(this,Hb,{},"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,bi,"f")[c]||[]).filter(l=>!n[l])}),s.forEach(c=>{r[c]=NC(qe(this,bi,"f")[c],l=>!n[l])}),r.envPrefix=qe(this,bi,"f").envPrefix,ei(this,bi,r,"f"),ei(this,ws,qe(this,ws,"f")?qe(this,ws,"f").reset(n):jPe(this,qe(this,us,"f")),"f"),ei(this,Tl,qe(this,Tl,"f")?qe(this,Tl,"f").reset(n):VPe(this,qe(this,ws,"f"),qe(this,us,"f")),"f"),ei(this,ep,qe(this,ep,"f")?qe(this,ep,"f").reset():OPe(qe(this,ws,"f"),qe(this,Tl,"f"),qe(this,iy,"f"),qe(this,us,"f")),"f"),qe(this,ry,"f")||ei(this,ry,UPe(this,qe(this,ws,"f"),qe(this,ep,"f"),qe(this,us,"f")),"f"),qe(this,iy,"f").reset(),ei(this,Qg,null,"f"),ei(this,_f,"","f"),ei(this,OC,null,"f"),ei(this,Lg,!1,"f"),this.parsed=!1,this}[uRe](t,r){return qe(this,us,"f").path.relative(t,r)}[eL](t,r,n,a=0,s=!1){let c=!!n||s;t=t||qe(this,QC,"f"),qe(this,bi,"f").__=qe(this,us,"f").y18n.__,qe(this,bi,"f").configuration=this[qk]();let l=!!qe(this,bi,"f").configuration["populate--"],f=Object.assign({},qe(this,bi,"f").configuration,{"populate--":!0}),d=qe(this,us,"f").Parser.detailed(t,Object.assign({},qe(this,bi,"f"),{configuration:{"parse-positional-numbers":!1,...f}})),m=Object.assign(d.argv,qe(this,Ok,"f")),g,x=d.aliases,b=!1,A=!1;Object.keys(m).forEach(I=>{I===qe(this,sy,"f")&&m[I]?b=!0:I===qe(this,Vb,"f")&&m[I]&&(A=!0)}),m.$0=this.$0,this.parsed=d,a===0&&qe(this,ws,"f").clearCachedHelpMessage();try{if(this[fie](),r)return this[Uk](m,l,!!n,!1);qe(this,sy,"f")&&[qe(this,sy,"f")].concat(x[qe(this,sy,"f")]||[]).filter(M=>M.length>1).includes(""+m._[m._.length-1])&&(m._.pop(),b=!0),ei(this,F7,!1,"f");let I=qe(this,ep,"f").getCommands(),C=qe(this,ry,"f").completionKey in m,k=b||C||s;if(m._.length){if(I.length){let O;for(let M=a||0,L;m._[M]!==void 0;M++)if(L=String(m._[M]),I.includes(L)&&L!==qe(this,Qg,"f")){let W=qe(this,ep,"f").runCommand(L,this,d,M+1,s,b||A||s);return this[Uk](W,l,!!n,!1)}else if(!O&&L!==qe(this,Qg,"f")){O=L;break}!qe(this,ep,"f").hasDefaultCommand()&&qe(this,L7,"f")&&O&&!k&&qe(this,Tl,"f").recommendCommands(O,I)}qe(this,Qg,"f")&&m._.includes(qe(this,Qg,"f"))&&!C&&(qe(this,ny,"f")&&FC(!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[Uk](O,l,!!n,!1)}if(C){qe(this,ny,"f")&&FC(!0),t=[].concat(t);let O=t.slice(t.indexOf(`--${qe(this,ry,"f").completionKey}`)+1);return qe(this,ry,"f").getCompletion(O,(M,L)=>{if(M)throw new uu(M.message);(L||[]).forEach(W=>{qe(this,yR,"f").log(W)}),this.exit(0)}),this[Uk](m,!l,!!n,!1)}if(qe(this,Lg,"f")||(b?(qe(this,ny,"f")&&FC(!0),c=!0,this.showHelp("log"),this.exit(0)):A&&(qe(this,ny,"f")&&FC(!0),c=!0,qe(this,ws,"f").showVersion("log"),this.exit(0))),!c&&qe(this,bi,"f").skipValidation.length>0&&(c=Object.keys(m).some(O=>qe(this,bi,"f").skipValidation.indexOf(O)>=0&&m[O]===!0)),!c){if(d.error)throw new uu(d.error.message);if(!C){let O=this[xie](x,{},d.error);n||(g=Pk(m,this,qe(this,iy,"f").getMiddleware(),!0)),g=this[eRe](O,g!=null?g:m),lu(g)&&!n&&(g=g.then(()=>Pk(m,this,qe(this,iy,"f").getMiddleware(),!1)))}}}catch(I){if(I instanceof uu)qe(this,ws,"f").fail(I.message,I);else throw I}return this[Uk](g!=null?g:m,l,!!n,!0)}[xie](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,jk,"f")&&(l=qe(this,Tl,"f").unknownCommands(c)),qe(this,Lk,"f")&&!l?qe(this,Tl,"f").unknownArguments(c,t,r,!!a):qe(this,Mk,"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)}}[lRe](){ei(this,Lg,!0,"f")}[zk](t){if(typeof t=="string")qe(this,bi,"f").key[t]=!0;else for(let r of t)qe(this,bi,"f").key[r]=!0}};function QPe(e){return!!e&&typeof e.getInternalMethods=="function"}var k7t=pRe(sie),fRe=k7t;var Hk={name:"edgeone",version:"1.2.29-beta.1",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 ./libs-kv-client",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 build:kv-client && npm run bundle","build:pages-ai":"node ./scripts/build-pages-ai.js","build:kv-client":"node ./scripts/build-kv-client.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:"vitest run","test:watch":"vitest","test:coverage":"vitest run --coverage"},dependencies:{"@edgeone/framework-detect":"^0.0.2","@edgeone/nuxt-pages":"^1.0.16","@edgeone/opennextjs-pages":"0.1.3",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",vitest:"^4.0.17"},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","@vitest/coverage-v8":"^4.0.17",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 Eie=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}},B7t=new Eie,q7=B7t;var Nqe=vr(Cc()),Fqe=vr(QR()),Oqe=vr(Cae());var fQe=vr(Tae()),Xw=vr(require("fs"));var Bae=vr(require("path"));function yd(e,t){return Bae.default.join(e,t)}function fi(e){return yd(process.cwd(),e)}function eQe(e){return Bae.default.dirname(e)}var Rz=pQe(),Oae=require("path");function Qae(){try{Rz.initSync({dir:iGt()})}catch(e){console.error("[File] initStorage error",e)}}async function MR(e,t,r){Qae(),await Rz.setItem(e,t).catch(n=>{console.error("[File] setLocalData error",n)}),r==null||r()}async function qR(e){return Qae(),await Rz.getItem(e).catch(r=>{console.error("[File] getLocalData error",r)})}async function Nz(e){Qae(),await Rz.removeItem(e).catch(t=>{console.error("[File] removeLocalData error",t)})}function iGt(){try{let e=Oae.parse(process.cwd()).root,t=process.cwd(),n=Oae.relative(e,t).split(Oae.sep).length-2;return`${new Array(Math.max(0,n)).fill("../").join("")}.edgeone`}catch{return".edgeone"}}function dQe(e){return Xw.default.statSync(e)}function sGt(e){return Xw.default.mkdirSync(e,{recursive:!0})}function aGt(e){return Xw.default.existsSync(e)}function ej(e){return Xw.default.existsSync(e)}function Fz(e,t="utf-8"){return Xw.default.readFileSync(e,t)}function I0(e){let t=Fz(e);return JSON.parse(t)}function UR(e){let t=Fz(e);return fQe.default.parse(t)}function ly(e,t,r="utf-8"){let n=eQe(e);return aGt(n)||sGt(n),Xw.default.writeFileSync(e,t,r)}function Lae(e,t){return ej(e)?Xw.default.appendFileSync(e,t):Xw.default.writeFileSync(e,t)}var Ks=vr(QR()),Fs=vr(Cc()),gQe=vr(hQe());function rT({prefix:e="cli"}){return Fs.default.createElement(Ks.Text,{color:"grey"},"[",e,"]")}function Kr(e,t="cli"){let{unmount:r}=(0,Ks.render)(Fs.default.createElement(Ks.Text,null,Fs.default.createElement(rT,{prefix:t}),Fs.default.createElement(Ks.Text,{color:"red"},"[\u2718] "),e));r()}function ha(e,t="cli"){let{unmount:r}=(0,Ks.render)(Fs.default.createElement(Ks.Text,null,Fs.default.createElement(rT,{prefix:t}),Fs.default.createElement(Ks.Text,{color:"green"},"[\u2714] "),e));r()}function Zw(e,t="cli"){let{unmount:r}=(0,Ks.render)(Fs.default.createElement(Ks.Text,null,Fs.default.createElement(rT,{prefix:t}),Fs.default.createElement(Ks.Text,{color:"orange"},"\u2757\uFE0F "),e));r()}function Oc(e,t="cli"){let{unmount:r}=(0,Ks.render)(Fs.default.createElement(Ks.Text,{color:"cyan"},Fs.default.createElement(rT,{prefix:t}),e));r()}function Oz(e){let{unmount:t}=(0,Ks.render)(Fs.default.createElement(Ks.Text,{color:"cyan"},e));t()}function jn(e,t="cli"){let{unmount:r}=(0,Ks.render)(Fs.default.createElement(Ks.Text,{color:"white"},Fs.default.createElement(rT,{prefix:t}),e));r()}function AQe(e,t,r="cli"){let n=t;t.includes("http")&&(n=new URL(t).pathname);let{unmount:a}=(0,Ks.render)(Fs.default.createElement(Ks.Text,{color:"grey"},e," ",n));a()}function Mae({timestamp:e}){return Fs.default.createElement(Ks.Box,{width:13},Fs.default.createElement(Ks.Text,{color:"grey"},(0,gQe.default)(e).format("HH:mm:ss.SSS")))}function yQe(e,t){let{unmount:r}=(0,Ks.render)(Fs.default.createElement(Ks.Box,null,Fs.default.createElement(Mae,{timestamp:t}),Fs.default.createElement(Ks.Text,{color:"white"},e)));r()}function vQe(e,t){let{unmount:r}=(0,Ks.render)(Fs.default.createElement(Ks.Box,null,Fs.default.createElement(Mae,{timestamp:t}),Fs.default.createElement(Ks.Text,{color:"white",backgroundColor:"yellow"},"[WARNING]"),Fs.default.createElement(Ks.Text,null," ",e)));r()}function qae(e,t){let{unmount:r}=(0,Ks.render)(Fs.default.createElement(Ks.Box,null,Fs.default.createElement(Mae,{timestamp:t}),Fs.default.createElement(Ks.Text,{color:"white",backgroundColor:"red"},"[ERROR]"),Fs.default.createElement(Ks.Text,{color:"white"}," ",e)));r()}function oGt({content:e="Loading",prefix:t="cli",intervalMs:r=500,maxDots:n=6}){let[a,s]=(0,Fs.useState)("");return(0,Fs.useEffect)(()=>{let c=setInterval(()=>{s(l=>l.length>=n?"":l+".")},r);return()=>clearInterval(c)},[r,n]),Fs.default.createElement(Ks.Text,{color:"cyan"},Fs.default.createElement(rT,{prefix:t}),e,a)}function xQe(e="Loading",t="cli",r=500,n=6){let a=(0,Ks.render)(Fs.default.createElement(oGt,{content:e,prefix:t,intervalMs:r,maxDots:n}));return{stop:()=>a.unmount()}}function mQe({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 Fs.default.createElement(Ks.Text,null,Fs.default.createElement(rT,{prefix:r}),Fs.default.createElement(Ks.Text,{color:a},n,": "),"[",Fs.default.createElement(Ks.Text,{color:a},f),d,"] ",m,"%")}function bQe(e="Progress",t="cli",r=30,n="cyan"){let a=0,s=(0,Ks.render)(Fs.default.createElement(mQe,{percent:a,width:r,prefix:t,label:e,color:n}));return{update:(c,l)=>{a=c;let f=l!=null?l:e;s.rerender(Fs.default.createElement(mQe,{percent:a,width:r,prefix:t,label:f,color:n}))},stop:()=>s.unmount()}}var Jzn=require("fs"),Kzn=require("path");async function Yv(){return process.env.EDGEONE_PAGES_API_REGION?process.env.EDGEONE_PAGES_API_REGION:await qR("login_region")}function tj(e,t){return function(){return e.apply(t,arguments)}}var{toString:cGt}=Object.prototype,{getPrototypeOf:zae}=Object,{iterator:Lz,toStringTag:wQe}=Symbol,jz=(e=>t=>{let r=cGt.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),Jv=e=>(e=e.toLowerCase(),t=>jz(t)===e),Mz=e=>t=>typeof t===e,{isArray:HR}=Array,rj=Mz("undefined");function nj(e){return e!==null&&!rj(e)&&e.constructor!==null&&!rj(e.constructor)&&k0(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}var SQe=Jv("ArrayBuffer");function uGt(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&SQe(e.buffer),t}var lGt=Mz("string"),k0=Mz("function"),CQe=Mz("number"),ij=e=>e!==null&&typeof e=="object",pGt=e=>e===!0||e===!1,Qz=e=>{if(jz(e)!=="object")return!1;let t=zae(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(wQe in e)&&!(Lz in e)},fGt=e=>{if(!ij(e)||nj(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},dGt=Jv("Date"),hGt=Jv("File"),mGt=Jv("Blob"),gGt=Jv("FileList"),AGt=e=>ij(e)&&k0(e.pipe),yGt=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||k0(e.append)&&((t=jz(e))==="formdata"||t==="object"&&k0(e.toString)&&e.toString()==="[object FormData]"))},vGt=Jv("URLSearchParams"),[xGt,bGt,EGt,wGt]=["ReadableStream","Request","Response","Headers"].map(Jv),SGt=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function sj(e,t,{allOwnKeys:r=!1}={}){if(e===null||typeof e>"u")return;let n,a;if(typeof e!="object"&&(e=[e]),HR(e))for(n=0,a=e.length;n<a;n++)t.call(null,e[n],n,e);else{if(nj(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 _Qe(e,t){if(nj(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 nT=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,IQe=e=>!rj(e)&&e!==nT;function Uae(){let{caseless:e}=IQe(this)&&this||{},t={},r=(n,a)=>{let s=e&&_Qe(t,a)||a;Qz(t[s])&&Qz(n)?t[s]=Uae(t[s],n):Qz(n)?t[s]=Uae({},n):HR(n)?t[s]=n.slice():t[s]=n};for(let n=0,a=arguments.length;n<a;n++)arguments[n]&&sj(arguments[n],r);return t}var CGt=(e,t,r,{allOwnKeys:n}={})=>(sj(t,(a,s)=>{r&&k0(a)?e[s]=tj(a,r):e[s]=a},{allOwnKeys:n}),e),_Gt=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),IGt=(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)},kGt=(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&&zae(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},BGt=e=>{if(!e)return null;if(HR(e))return e;let t=e.length;if(!CQe(t))return null;let r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},DGt=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&zae(Uint8Array)),PGt=(e,t)=>{let n=(e&&e[Lz]).call(e),a;for(;(a=n.next())&&!a.done;){let s=a.value;t.call(e,s[0],s[1])}},RGt=(e,t)=>{let r,n=[];for(;(r=e.exec(t))!==null;)n.push(r);return n},NGt=Jv("HTMLFormElement"),FGt=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,n,a){return n.toUpperCase()+a}),EQe=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),OGt=Jv("RegExp"),kQe=(e,t)=>{let r=Object.getOwnPropertyDescriptors(e),n={};sj(r,(a,s)=>{let c;(c=t(a,s,e))!==!1&&(n[s]=c||a)}),Object.defineProperties(e,n)},QGt=e=>{kQe(e,(t,r)=>{if(k0(e)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;let n=e[r];if(k0(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 HR(e)?n(e):n(String(e).split(t)),r},jGt=()=>{},MGt=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function qGt(e){return!!(e&&k0(e.append)&&e[wQe]==="FormData"&&e[Lz])}var UGt=e=>{let t=new Array(10),r=(n,a)=>{if(ij(n)){if(t.indexOf(n)>=0)return;if(nj(n))return n;if(!("toJSON"in n)){t[a]=n;let s=HR(n)?[]:{};return sj(n,(c,l)=>{let f=r(c,a+1);!rj(f)&&(s[l]=f)}),t[a]=void 0,s}}return n};return r(e,0)},zGt=Jv("AsyncFunction"),HGt=e=>e&&(ij(e)||k0(e))&&k0(e.then)&&k0(e.catch),TQe=((e,t)=>e?setImmediate:t?((r,n)=>(nT.addEventListener("message",({source:a,data:s})=>{a===nT&&s===r&&n.length&&n.shift()()},!1),a=>{n.push(a),nT.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",k0(nT.postMessage)),VGt=typeof queueMicrotask<"u"?queueMicrotask.bind(nT):typeof process<"u"&&process.nextTick||TQe,$Gt=e=>e!=null&&k0(e[Lz]),bt={isArray:HR,isArrayBuffer:SQe,isBuffer:nj,isFormData:yGt,isArrayBufferView:uGt,isString:lGt,isNumber:CQe,isBoolean:pGt,isObject:ij,isPlainObject:Qz,isEmptyObject:fGt,isReadableStream:xGt,isRequest:bGt,isResponse:EGt,isHeaders:wGt,isUndefined:rj,isDate:dGt,isFile:hGt,isBlob:mGt,isRegExp:OGt,isFunction:k0,isStream:AGt,isURLSearchParams:vGt,isTypedArray:DGt,isFileList:gGt,forEach:sj,merge:Uae,extend:CGt,trim:SGt,stripBOM:_Gt,inherits:IGt,toFlatObject:kGt,kindOf:jz,kindOfTest:Jv,endsWith:TGt,toArray:BGt,forEachEntry:PGt,matchAll:RGt,isHTMLForm:NGt,hasOwnProperty:EQe,hasOwnProp:EQe,reduceDescriptors:kQe,freezeMethods:QGt,toObjectSet:LGt,toCamelCase:FGt,noop:jGt,toFiniteNumber:MGt,findKey:_Qe,global:nT,isContextDefined:IQe,isSpecCompliantForm:qGt,toJSONObject:UGt,isAsyncFn:zGt,isThenable:HGt,setImmediate:TQe,asap:VGt,isIterable:$Gt};function VR(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(VR,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 BQe=VR.prototype,DQe={};["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=>{DQe[e]={value:e}});Object.defineProperties(VR,DQe);Object.defineProperty(BQe,"isAxiosError",{value:!0});VR.from=(e,t,r,n,a,s)=>{let c=Object.create(BQe);return bt.toFlatObject(e,c,function(f){return f!==Error.prototype},l=>l!=="isAxiosError"),VR.call(c,e.message,t,r,n,a),c.cause=e,c.name=e.name,s&&Object.assign(c,s),c};var _n=VR;var RLe=vr(PLe(),1),Xz=RLe.default;function loe(e){return bt.isPlainObject(e)||bt.isArray(e)}function FLe(e){return bt.endsWith(e,"[]")?e.slice(0,-2):e}function NLe(e,t,r){return e?e.concat(t).map(function(a,s){return a=FLe(a),!r&&s?"["+a+"]":a}).join(r?".":""):t}function DJt(e){return bt.isArray(e)&&!e.some(loe)}var PJt=bt.toFlatObject(bt,{},null,function(t){return/^is[A-Z]/.test(t)});function RJt(e,t,r){if(!bt.isObject(e))throw new TypeError("target must be an object");t=t||new(Xz||FormData),r=bt.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(I,C){return!bt.isUndefined(C[I])});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 _n("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,I,C){let k=A;if(A&&!C&&typeof A=="object"){if(bt.endsWith(I,"{}"))I=n?I:I.slice(0,-2),A=JSON.stringify(A);else if(bt.isArray(A)&&DJt(A)||(bt.isFileList(A)||bt.endsWith(I,"[]"))&&(k=bt.toArray(A)))return I=FLe(I),k.forEach(function(M,L){!(bt.isUndefined(M)||M===null)&&t.append(c===!0?NLe([I],L,s):c===null?I:I+"[]",d(M))}),!1}return loe(A)?!0:(t.append(NLe(C,I,s),d(A)),!1)}let g=[],x=Object.assign(PJt,{defaultVisitor:m,convertValue:d,isVisitable:loe});function b(A,I){if(!bt.isUndefined(A)){if(g.indexOf(A)!==-1)throw Error("Circular reference detected in "+I.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,I,x))===!0&&b(k,I?I.concat(O):[O])}),g.pop()}}if(!bt.isObject(e))throw new TypeError("data must be an object");return b(e),t}var VC=RJt;function OLe(e){let t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(n){return t[n]})}function QLe(e,t){this._pairs=[],e&&VC(e,this,t)}var LLe=QLe.prototype;LLe.append=function(t,r){this._pairs.push([t,r])};LLe.toString=function(t){let r=t?function(n){return t.call(this,n,OLe)}:OLe;return this._pairs.map(function(a){return r(a[0])+"="+r(a[1])},"").join("&")};var jLe=QLe;function NJt(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function sT(e,t,r){if(!t)return e;let n=r&&r.encode||NJt;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 jLe(t,r).toString(n),s){let c=e.indexOf("#");c!==-1&&(e=e.slice(0,c)),e+=(e.indexOf("?")===-1?"?":"&")+s}return e}var poe=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)})}},foe=poe;var JR={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1};var zLe=vr(require("crypto"),1);var MLe=vr(require("url"),1),qLe=MLe.default.URLSearchParams;var doe="abcdefghijklmnopqrstuvwxyz",ULe="0123456789",HLe={DIGIT:ULe,ALPHA:doe,ALPHA_DIGIT:doe+doe.toUpperCase()+ULe},FJt=(e=16,t=HLe.ALPHA_DIGIT)=>{let r="",{length:n}=t,a=new Uint32Array(e);zLe.default.randomFillSync(a);for(let s=0;s<e;s++)r+=t[a[s]%n];return r},VLe={isNode:!0,classes:{URLSearchParams:qLe,FormData:Xz,Blob:typeof Blob<"u"&&Blob||null},ALPHABET:HLe,generateString:FJt,protocols:["http","https","file","data"]};var goe={};oPe(goe,{hasBrowserEnv:()=>moe,hasStandardBrowserEnv:()=>OJt,hasStandardBrowserWebWorkerEnv:()=>QJt,navigator:()=>hoe,origin:()=>LJt});var moe=typeof window<"u"&&typeof document<"u",hoe=typeof navigator=="object"&&navigator||void 0,OJt=moe&&(!hoe||["ReactNative","NativeScript","NS"].indexOf(hoe.product)<0),QJt=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",LJt=moe&&window.location.href||"http://localhost";var Po={...goe,...VLe};function Aoe(e,t){return VC(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 jJt(e){return bt.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function MJt(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 qJt(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]=MJt(a[c])),!l)}if(bt.isFormData(e)&&bt.isFunction(e.entries)){let r={};return bt.forEachEntry(e,(n,a)=>{t(jJt(n),a,r,0)}),r}return null}var Zz=qJt;function UJt(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 yoe={transitional:JR,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(Zz(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 Aoe(t,this.formSerializer).toString();if((l=bt.isFileList(t))||n.indexOf("multipart/form-data")>-1){let f=this.env&&this.env.FormData;return VC(l?{"files[]":t}:t,f&&new f,this.formSerializer)}}return s||a?(r.setContentType("application/json",!1),UJt(t)):t}],transformResponse:[function(t){let r=this.transitional||yoe.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"?_n.from(l,_n.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=>{yoe.headers[e]={}});var KR=yoe;var zJt=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"]),$Le=e=>{let t={},r,n,a;return e&&e.split(`
522
+ `,"f"),ei(this,_f,qe(this,_f,"f")+t.join(" "),"f")}}}[pie](t){gR(qe(this,bi,"f")).forEach(r=>{if((a=>a==="configObjects")(r))return;let n=qe(this,bi,"f")[r];Array.isArray(n)?n.includes(t)&&n.splice(n.indexOf(t),1):typeof n=="object"&&delete n[t]}),delete qe(this,ws,"f").getDescriptions()[t]}[GPe](t,r,n){qe(this,R7,"f")[n]||(qe(this,us,"f").process.emitWarning(t,r),qe(this,R7,"f")[n]=!0)}[YPe](){qe(this,N7,"f").push({options:qe(this,bi,"f"),configObjects:qe(this,bi,"f").configObjects.slice(0),exitProcess:qe(this,ny,"f"),groups:qe(this,Hb,"f"),strict:qe(this,Lk,"f"),strictCommands:qe(this,jk,"f"),strictOptions:qe(this,Mk,"f"),completionCommand:qe(this,Qg,"f"),output:qe(this,_f,"f"),exitError:qe(this,OC,"f"),hasOutput:qe(this,Lg,"f"),parsed:this.parsed,parseFn:qe(this,jg,"f"),parseContext:qe(this,Ok,"f")}),qe(this,ws,"f").freeze(),qe(this,Tl,"f").freeze(),qe(this,ep,"f").freeze(),qe(this,iy,"f").freeze()}[JPe](){let t="",r;return/\b(node|iojs|electron)(\.exe)?$/.test(qe(this,us,"f").process.argv()[0])?r=qe(this,us,"f").process.argv().slice(1,2):r=qe(this,us,"f").process.argv().slice(0,1),t=r.map(n=>{let a=this[uRe](qe(this,Nk,"f"),n);return n.match(/^(\/|([a-zA-Z]:)?\\)/)&&a.length<n.length?a:n}).join(" ").trim(),qe(this,us,"f").getEnv("_")&&qe(this,us,"f").getProcessArgvBin()===qe(this,us,"f").getEnv("_")&&(t=qe(this,us,"f").getEnv("_").replace(`${qe(this,us,"f").path.dirname(qe(this,us,"f").process.execPath())}/`,"")),t}[qk](){return qe(this,Q7,"f")}[KPe](){return qe(this,j7,"f")}[fie](){if(!qe(this,Fk,"f"))return;let t=qe(this,us,"f").getEnv("LC_ALL")||qe(this,us,"f").getEnv("LC_MESSAGES")||qe(this,us,"f").getEnv("LANG")||qe(this,us,"f").getEnv("LANGUAGE")||"en_US";this.locale(t.replace(/[.:].*/,""))}[XPe](){return this[die]().version||"unknown"}[ZPe](t){let r=t["--"]?t["--"]:t._;for(let n=0,a;(a=r[n])!==void 0;n++)qe(this,us,"f").Parser.looksLikeNumber(a)&&Number.isSafeInteger(Math.floor(parseFloat(`${a}`)))&&(r[n]=Number(a));return t}[die](t){let r=t||"*";if(qe(this,vR,"f")[r])return qe(this,vR,"f")[r];let n={};try{let a=t||qe(this,us,"f").mainFilename;!t&&qe(this,us,"f").path.extname(a)&&(a=qe(this,us,"f").path.dirname(a));let s=qe(this,us,"f").findUp(a,(c,l)=>{if(l.includes("package.json"))return"package.json"});im(s,void 0,qe(this,us,"f")),n=JSON.parse(qe(this,us,"f").readFileSync(s,"utf8"))}catch{}return qe(this,vR,"f")[r]=n||{},qe(this,vR,"f")[r]}[LC](t,r){r=[].concat(r),r.forEach(n=>{n=this[gie](n),qe(this,bi,"f")[t].push(n)})}[xR](t,r,n,a){this[mie](t,r,n,a,(s,c,l)=>{qe(this,bi,"f")[s][c]=l})}[hie](t,r,n,a){this[mie](t,r,n,a,(s,c,l)=>{qe(this,bi,"f")[s][c]=(qe(this,bi,"f")[s][c]||[]).concat(l)})}[mie](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 gR(n))t(c,n[c]);else s(r,this[gie](n),a)}[gie](t){return t==="__proto__"?"___proto___":t}[Aie](t,r){return this[xR](this[Aie].bind(this),"key",t,r),this}[yie](){var t,r,n,a,s,c,l,f,d,m,g,x;let b=qe(this,N7,"f").pop();im(b,void 0,qe(this,us,"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(I){ei(t,bi,I,"f")}}.value,configObjects:A,exitProcess:{set value(I){ei(r,ny,I,"f")}}.value,groups:{set value(I){ei(n,Hb,I,"f")}}.value,output:{set value(I){ei(a,_f,I,"f")}}.value,exitError:{set value(I){ei(s,OC,I,"f")}}.value,hasOutput:{set value(I){ei(c,Lg,I,"f")}}.value,parsed:this.parsed,strict:{set value(I){ei(l,Lk,I,"f")}}.value,strictCommands:{set value(I){ei(f,jk,I,"f")}}.value,strictOptions:{set value(I){ei(d,Mk,I,"f")}}.value,completionCommand:{set value(I){ei(m,Qg,I,"f")}}.value,parseFn:{set value(I){ei(g,jg,I,"f")}}.value,parseContext:{set value(I){ei(x,Ok,I,"f")}}.value}=b,qe(this,bi,"f").configObjects=A,qe(this,ws,"f").unfreeze(),qe(this,Tl,"f").unfreeze(),qe(this,ep,"f").unfreeze(),qe(this,iy,"f").unfreeze()}[eRe](t,r){return Rk(r,n=>(t(n),n))}getInternalMethods(){return{getCommandInstance:this[tRe].bind(this),getContext:this[rRe].bind(this),getHasOutput:this[nRe].bind(this),getLoggerInstance:this[iRe].bind(this),getParseContext:this[sRe].bind(this),getParserConfiguration:this[qk].bind(this),getUsageConfiguration:this[KPe].bind(this),getUsageInstance:this[aRe].bind(this),getValidationInstance:this[oRe].bind(this),hasParseCallback:this[M7].bind(this),isGlobalContext:this[cRe].bind(this),postProcess:this[Uk].bind(this),reset:this[vie].bind(this),runValidation:this[xie].bind(this),runYargsParserAndExecuteCommands:this[eL].bind(this),setHasOutput:this[lRe].bind(this)}}[tRe](){return qe(this,ep,"f")}[rRe](){return qe(this,Z3,"f")}[nRe](){return qe(this,Lg,"f")}[iRe](){return qe(this,yR,"f")}[sRe](){return qe(this,Ok,"f")||{}}[aRe](){return qe(this,ws,"f")}[oRe](){return qe(this,Tl,"f")}[M7](){return!!qe(this,jg,"f")}[cRe](){return qe(this,F7,"f")}[Uk](t,r,n,a){return n||lu(t)||(r||(t=this[$Pe](t)),(this[qk]()["parse-positional-numbers"]||this[qk]()["parse-positional-numbers"]===void 0)&&(t=this[ZPe](t)),a&&(t=Pk(t,this,qe(this,iy,"f").getMiddleware(),!1))),t}[vie](t={}){ei(this,bi,qe(this,bi,"f")||{},"f");let r={};r.local=qe(this,bi,"f").local||[],r.configObjects=qe(this,bi,"f").configObjects||[];let n={};r.local.forEach(c=>{n[c]=!0,(t[c]||[]).forEach(l=>{n[l]=!0})}),Object.assign(qe(this,Qk,"f"),Object.keys(qe(this,Hb,"f")).reduce((c,l)=>{let f=qe(this,Hb,"f")[l].filter(d=>!(d in n));return f.length>0&&(c[l]=f),c},{})),ei(this,Hb,{},"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,bi,"f")[c]||[]).filter(l=>!n[l])}),s.forEach(c=>{r[c]=NC(qe(this,bi,"f")[c],l=>!n[l])}),r.envPrefix=qe(this,bi,"f").envPrefix,ei(this,bi,r,"f"),ei(this,ws,qe(this,ws,"f")?qe(this,ws,"f").reset(n):jPe(this,qe(this,us,"f")),"f"),ei(this,Tl,qe(this,Tl,"f")?qe(this,Tl,"f").reset(n):VPe(this,qe(this,ws,"f"),qe(this,us,"f")),"f"),ei(this,ep,qe(this,ep,"f")?qe(this,ep,"f").reset():OPe(qe(this,ws,"f"),qe(this,Tl,"f"),qe(this,iy,"f"),qe(this,us,"f")),"f"),qe(this,ry,"f")||ei(this,ry,UPe(this,qe(this,ws,"f"),qe(this,ep,"f"),qe(this,us,"f")),"f"),qe(this,iy,"f").reset(),ei(this,Qg,null,"f"),ei(this,_f,"","f"),ei(this,OC,null,"f"),ei(this,Lg,!1,"f"),this.parsed=!1,this}[uRe](t,r){return qe(this,us,"f").path.relative(t,r)}[eL](t,r,n,a=0,s=!1){let c=!!n||s;t=t||qe(this,QC,"f"),qe(this,bi,"f").__=qe(this,us,"f").y18n.__,qe(this,bi,"f").configuration=this[qk]();let l=!!qe(this,bi,"f").configuration["populate--"],f=Object.assign({},qe(this,bi,"f").configuration,{"populate--":!0}),d=qe(this,us,"f").Parser.detailed(t,Object.assign({},qe(this,bi,"f"),{configuration:{"parse-positional-numbers":!1,...f}})),m=Object.assign(d.argv,qe(this,Ok,"f")),g,x=d.aliases,b=!1,A=!1;Object.keys(m).forEach(I=>{I===qe(this,sy,"f")&&m[I]?b=!0:I===qe(this,Vb,"f")&&m[I]&&(A=!0)}),m.$0=this.$0,this.parsed=d,a===0&&qe(this,ws,"f").clearCachedHelpMessage();try{if(this[fie](),r)return this[Uk](m,l,!!n,!1);qe(this,sy,"f")&&[qe(this,sy,"f")].concat(x[qe(this,sy,"f")]||[]).filter(M=>M.length>1).includes(""+m._[m._.length-1])&&(m._.pop(),b=!0),ei(this,F7,!1,"f");let I=qe(this,ep,"f").getCommands(),C=qe(this,ry,"f").completionKey in m,k=b||C||s;if(m._.length){if(I.length){let O;for(let M=a||0,L;m._[M]!==void 0;M++)if(L=String(m._[M]),I.includes(L)&&L!==qe(this,Qg,"f")){let W=qe(this,ep,"f").runCommand(L,this,d,M+1,s,b||A||s);return this[Uk](W,l,!!n,!1)}else if(!O&&L!==qe(this,Qg,"f")){O=L;break}!qe(this,ep,"f").hasDefaultCommand()&&qe(this,L7,"f")&&O&&!k&&qe(this,Tl,"f").recommendCommands(O,I)}qe(this,Qg,"f")&&m._.includes(qe(this,Qg,"f"))&&!C&&(qe(this,ny,"f")&&FC(!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[Uk](O,l,!!n,!1)}if(C){qe(this,ny,"f")&&FC(!0),t=[].concat(t);let O=t.slice(t.indexOf(`--${qe(this,ry,"f").completionKey}`)+1);return qe(this,ry,"f").getCompletion(O,(M,L)=>{if(M)throw new uu(M.message);(L||[]).forEach(W=>{qe(this,yR,"f").log(W)}),this.exit(0)}),this[Uk](m,!l,!!n,!1)}if(qe(this,Lg,"f")||(b?(qe(this,ny,"f")&&FC(!0),c=!0,this.showHelp("log"),this.exit(0)):A&&(qe(this,ny,"f")&&FC(!0),c=!0,qe(this,ws,"f").showVersion("log"),this.exit(0))),!c&&qe(this,bi,"f").skipValidation.length>0&&(c=Object.keys(m).some(O=>qe(this,bi,"f").skipValidation.indexOf(O)>=0&&m[O]===!0)),!c){if(d.error)throw new uu(d.error.message);if(!C){let O=this[xie](x,{},d.error);n||(g=Pk(m,this,qe(this,iy,"f").getMiddleware(),!0)),g=this[eRe](O,g!=null?g:m),lu(g)&&!n&&(g=g.then(()=>Pk(m,this,qe(this,iy,"f").getMiddleware(),!1)))}}}catch(I){if(I instanceof uu)qe(this,ws,"f").fail(I.message,I);else throw I}return this[Uk](g!=null?g:m,l,!!n,!0)}[xie](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,jk,"f")&&(l=qe(this,Tl,"f").unknownCommands(c)),qe(this,Lk,"f")&&!l?qe(this,Tl,"f").unknownArguments(c,t,r,!!a):qe(this,Mk,"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)}}[lRe](){ei(this,Lg,!0,"f")}[zk](t){if(typeof t=="string")qe(this,bi,"f").key[t]=!0;else for(let r of t)qe(this,bi,"f").key[r]=!0}};function QPe(e){return!!e&&typeof e.getInternalMethods=="function"}var k7t=pRe(sie),fRe=k7t;var Hk={name:"edgeone",version:"1.2.29-beta.2",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 ./libs-kv-client",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 build:kv-client && npm run bundle","build:pages-ai":"node ./scripts/build-pages-ai.js","build:kv-client":"node ./scripts/build-kv-client.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:"vitest run","test:watch":"vitest","test:coverage":"vitest run --coverage"},dependencies:{"@edgeone/framework-detect":"^0.0.2","@edgeone/nuxt-pages":"^1.0.16","@edgeone/opennextjs-pages":"0.1.3",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",vitest:"^4.0.17"},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","@vitest/coverage-v8":"^4.0.17",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 Eie=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}},B7t=new Eie,q7=B7t;var Nqe=vr(Cc()),Fqe=vr(QR()),Oqe=vr(Cae());var fQe=vr(Tae()),Xw=vr(require("fs"));var Bae=vr(require("path"));function yd(e,t){return Bae.default.join(e,t)}function fi(e){return yd(process.cwd(),e)}function eQe(e){return Bae.default.dirname(e)}var Rz=pQe(),Oae=require("path");function Qae(){try{Rz.initSync({dir:iGt()})}catch(e){console.error("[File] initStorage error",e)}}async function MR(e,t,r){Qae(),await Rz.setItem(e,t).catch(n=>{console.error("[File] setLocalData error",n)}),r==null||r()}async function qR(e){return Qae(),await Rz.getItem(e).catch(r=>{console.error("[File] getLocalData error",r)})}async function Nz(e){Qae(),await Rz.removeItem(e).catch(t=>{console.error("[File] removeLocalData error",t)})}function iGt(){try{let e=Oae.parse(process.cwd()).root,t=process.cwd(),n=Oae.relative(e,t).split(Oae.sep).length-2;return`${new Array(Math.max(0,n)).fill("../").join("")}.edgeone`}catch{return".edgeone"}}function dQe(e){return Xw.default.statSync(e)}function sGt(e){return Xw.default.mkdirSync(e,{recursive:!0})}function aGt(e){return Xw.default.existsSync(e)}function ej(e){return Xw.default.existsSync(e)}function Fz(e,t="utf-8"){return Xw.default.readFileSync(e,t)}function I0(e){let t=Fz(e);return JSON.parse(t)}function UR(e){let t=Fz(e);return fQe.default.parse(t)}function ly(e,t,r="utf-8"){let n=eQe(e);return aGt(n)||sGt(n),Xw.default.writeFileSync(e,t,r)}function Lae(e,t){return ej(e)?Xw.default.appendFileSync(e,t):Xw.default.writeFileSync(e,t)}var Ks=vr(QR()),Fs=vr(Cc()),gQe=vr(hQe());function rT({prefix:e="cli"}){return Fs.default.createElement(Ks.Text,{color:"grey"},"[",e,"]")}function Kr(e,t="cli"){let{unmount:r}=(0,Ks.render)(Fs.default.createElement(Ks.Text,null,Fs.default.createElement(rT,{prefix:t}),Fs.default.createElement(Ks.Text,{color:"red"},"[\u2718] "),e));r()}function ha(e,t="cli"){let{unmount:r}=(0,Ks.render)(Fs.default.createElement(Ks.Text,null,Fs.default.createElement(rT,{prefix:t}),Fs.default.createElement(Ks.Text,{color:"green"},"[\u2714] "),e));r()}function Zw(e,t="cli"){let{unmount:r}=(0,Ks.render)(Fs.default.createElement(Ks.Text,null,Fs.default.createElement(rT,{prefix:t}),Fs.default.createElement(Ks.Text,{color:"orange"},"\u2757\uFE0F "),e));r()}function Oc(e,t="cli"){let{unmount:r}=(0,Ks.render)(Fs.default.createElement(Ks.Text,{color:"cyan"},Fs.default.createElement(rT,{prefix:t}),e));r()}function Oz(e){let{unmount:t}=(0,Ks.render)(Fs.default.createElement(Ks.Text,{color:"cyan"},e));t()}function jn(e,t="cli"){let{unmount:r}=(0,Ks.render)(Fs.default.createElement(Ks.Text,{color:"white"},Fs.default.createElement(rT,{prefix:t}),e));r()}function AQe(e,t,r="cli"){let n=t;t.includes("http")&&(n=new URL(t).pathname);let{unmount:a}=(0,Ks.render)(Fs.default.createElement(Ks.Text,{color:"grey"},e," ",n));a()}function Mae({timestamp:e}){return Fs.default.createElement(Ks.Box,{width:13},Fs.default.createElement(Ks.Text,{color:"grey"},(0,gQe.default)(e).format("HH:mm:ss.SSS")))}function yQe(e,t){let{unmount:r}=(0,Ks.render)(Fs.default.createElement(Ks.Box,null,Fs.default.createElement(Mae,{timestamp:t}),Fs.default.createElement(Ks.Text,{color:"white"},e)));r()}function vQe(e,t){let{unmount:r}=(0,Ks.render)(Fs.default.createElement(Ks.Box,null,Fs.default.createElement(Mae,{timestamp:t}),Fs.default.createElement(Ks.Text,{color:"white",backgroundColor:"yellow"},"[WARNING]"),Fs.default.createElement(Ks.Text,null," ",e)));r()}function qae(e,t){let{unmount:r}=(0,Ks.render)(Fs.default.createElement(Ks.Box,null,Fs.default.createElement(Mae,{timestamp:t}),Fs.default.createElement(Ks.Text,{color:"white",backgroundColor:"red"},"[ERROR]"),Fs.default.createElement(Ks.Text,{color:"white"}," ",e)));r()}function oGt({content:e="Loading",prefix:t="cli",intervalMs:r=500,maxDots:n=6}){let[a,s]=(0,Fs.useState)("");return(0,Fs.useEffect)(()=>{let c=setInterval(()=>{s(l=>l.length>=n?"":l+".")},r);return()=>clearInterval(c)},[r,n]),Fs.default.createElement(Ks.Text,{color:"cyan"},Fs.default.createElement(rT,{prefix:t}),e,a)}function xQe(e="Loading",t="cli",r=500,n=6){let a=(0,Ks.render)(Fs.default.createElement(oGt,{content:e,prefix:t,intervalMs:r,maxDots:n}));return{stop:()=>a.unmount()}}function mQe({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 Fs.default.createElement(Ks.Text,null,Fs.default.createElement(rT,{prefix:r}),Fs.default.createElement(Ks.Text,{color:a},n,": "),"[",Fs.default.createElement(Ks.Text,{color:a},f),d,"] ",m,"%")}function bQe(e="Progress",t="cli",r=30,n="cyan"){let a=0,s=(0,Ks.render)(Fs.default.createElement(mQe,{percent:a,width:r,prefix:t,label:e,color:n}));return{update:(c,l)=>{a=c;let f=l!=null?l:e;s.rerender(Fs.default.createElement(mQe,{percent:a,width:r,prefix:t,label:f,color:n}))},stop:()=>s.unmount()}}var Jzn=require("fs"),Kzn=require("path");async function Yv(){return process.env.EDGEONE_PAGES_API_REGION?process.env.EDGEONE_PAGES_API_REGION:await qR("login_region")}function tj(e,t){return function(){return e.apply(t,arguments)}}var{toString:cGt}=Object.prototype,{getPrototypeOf:zae}=Object,{iterator:Lz,toStringTag:wQe}=Symbol,jz=(e=>t=>{let r=cGt.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),Jv=e=>(e=e.toLowerCase(),t=>jz(t)===e),Mz=e=>t=>typeof t===e,{isArray:HR}=Array,rj=Mz("undefined");function nj(e){return e!==null&&!rj(e)&&e.constructor!==null&&!rj(e.constructor)&&k0(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}var SQe=Jv("ArrayBuffer");function uGt(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&SQe(e.buffer),t}var lGt=Mz("string"),k0=Mz("function"),CQe=Mz("number"),ij=e=>e!==null&&typeof e=="object",pGt=e=>e===!0||e===!1,Qz=e=>{if(jz(e)!=="object")return!1;let t=zae(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(wQe in e)&&!(Lz in e)},fGt=e=>{if(!ij(e)||nj(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},dGt=Jv("Date"),hGt=Jv("File"),mGt=Jv("Blob"),gGt=Jv("FileList"),AGt=e=>ij(e)&&k0(e.pipe),yGt=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||k0(e.append)&&((t=jz(e))==="formdata"||t==="object"&&k0(e.toString)&&e.toString()==="[object FormData]"))},vGt=Jv("URLSearchParams"),[xGt,bGt,EGt,wGt]=["ReadableStream","Request","Response","Headers"].map(Jv),SGt=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function sj(e,t,{allOwnKeys:r=!1}={}){if(e===null||typeof e>"u")return;let n,a;if(typeof e!="object"&&(e=[e]),HR(e))for(n=0,a=e.length;n<a;n++)t.call(null,e[n],n,e);else{if(nj(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 _Qe(e,t){if(nj(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 nT=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,IQe=e=>!rj(e)&&e!==nT;function Uae(){let{caseless:e}=IQe(this)&&this||{},t={},r=(n,a)=>{let s=e&&_Qe(t,a)||a;Qz(t[s])&&Qz(n)?t[s]=Uae(t[s],n):Qz(n)?t[s]=Uae({},n):HR(n)?t[s]=n.slice():t[s]=n};for(let n=0,a=arguments.length;n<a;n++)arguments[n]&&sj(arguments[n],r);return t}var CGt=(e,t,r,{allOwnKeys:n}={})=>(sj(t,(a,s)=>{r&&k0(a)?e[s]=tj(a,r):e[s]=a},{allOwnKeys:n}),e),_Gt=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),IGt=(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)},kGt=(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&&zae(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},BGt=e=>{if(!e)return null;if(HR(e))return e;let t=e.length;if(!CQe(t))return null;let r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},DGt=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&zae(Uint8Array)),PGt=(e,t)=>{let n=(e&&e[Lz]).call(e),a;for(;(a=n.next())&&!a.done;){let s=a.value;t.call(e,s[0],s[1])}},RGt=(e,t)=>{let r,n=[];for(;(r=e.exec(t))!==null;)n.push(r);return n},NGt=Jv("HTMLFormElement"),FGt=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,n,a){return n.toUpperCase()+a}),EQe=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),OGt=Jv("RegExp"),kQe=(e,t)=>{let r=Object.getOwnPropertyDescriptors(e),n={};sj(r,(a,s)=>{let c;(c=t(a,s,e))!==!1&&(n[s]=c||a)}),Object.defineProperties(e,n)},QGt=e=>{kQe(e,(t,r)=>{if(k0(e)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;let n=e[r];if(k0(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 HR(e)?n(e):n(String(e).split(t)),r},jGt=()=>{},MGt=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function qGt(e){return!!(e&&k0(e.append)&&e[wQe]==="FormData"&&e[Lz])}var UGt=e=>{let t=new Array(10),r=(n,a)=>{if(ij(n)){if(t.indexOf(n)>=0)return;if(nj(n))return n;if(!("toJSON"in n)){t[a]=n;let s=HR(n)?[]:{};return sj(n,(c,l)=>{let f=r(c,a+1);!rj(f)&&(s[l]=f)}),t[a]=void 0,s}}return n};return r(e,0)},zGt=Jv("AsyncFunction"),HGt=e=>e&&(ij(e)||k0(e))&&k0(e.then)&&k0(e.catch),TQe=((e,t)=>e?setImmediate:t?((r,n)=>(nT.addEventListener("message",({source:a,data:s})=>{a===nT&&s===r&&n.length&&n.shift()()},!1),a=>{n.push(a),nT.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",k0(nT.postMessage)),VGt=typeof queueMicrotask<"u"?queueMicrotask.bind(nT):typeof process<"u"&&process.nextTick||TQe,$Gt=e=>e!=null&&k0(e[Lz]),bt={isArray:HR,isArrayBuffer:SQe,isBuffer:nj,isFormData:yGt,isArrayBufferView:uGt,isString:lGt,isNumber:CQe,isBoolean:pGt,isObject:ij,isPlainObject:Qz,isEmptyObject:fGt,isReadableStream:xGt,isRequest:bGt,isResponse:EGt,isHeaders:wGt,isUndefined:rj,isDate:dGt,isFile:hGt,isBlob:mGt,isRegExp:OGt,isFunction:k0,isStream:AGt,isURLSearchParams:vGt,isTypedArray:DGt,isFileList:gGt,forEach:sj,merge:Uae,extend:CGt,trim:SGt,stripBOM:_Gt,inherits:IGt,toFlatObject:kGt,kindOf:jz,kindOfTest:Jv,endsWith:TGt,toArray:BGt,forEachEntry:PGt,matchAll:RGt,isHTMLForm:NGt,hasOwnProperty:EQe,hasOwnProp:EQe,reduceDescriptors:kQe,freezeMethods:QGt,toObjectSet:LGt,toCamelCase:FGt,noop:jGt,toFiniteNumber:MGt,findKey:_Qe,global:nT,isContextDefined:IQe,isSpecCompliantForm:qGt,toJSONObject:UGt,isAsyncFn:zGt,isThenable:HGt,setImmediate:TQe,asap:VGt,isIterable:$Gt};function VR(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(VR,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 BQe=VR.prototype,DQe={};["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=>{DQe[e]={value:e}});Object.defineProperties(VR,DQe);Object.defineProperty(BQe,"isAxiosError",{value:!0});VR.from=(e,t,r,n,a,s)=>{let c=Object.create(BQe);return bt.toFlatObject(e,c,function(f){return f!==Error.prototype},l=>l!=="isAxiosError"),VR.call(c,e.message,t,r,n,a),c.cause=e,c.name=e.name,s&&Object.assign(c,s),c};var _n=VR;var RLe=vr(PLe(),1),Xz=RLe.default;function loe(e){return bt.isPlainObject(e)||bt.isArray(e)}function FLe(e){return bt.endsWith(e,"[]")?e.slice(0,-2):e}function NLe(e,t,r){return e?e.concat(t).map(function(a,s){return a=FLe(a),!r&&s?"["+a+"]":a}).join(r?".":""):t}function DJt(e){return bt.isArray(e)&&!e.some(loe)}var PJt=bt.toFlatObject(bt,{},null,function(t){return/^is[A-Z]/.test(t)});function RJt(e,t,r){if(!bt.isObject(e))throw new TypeError("target must be an object");t=t||new(Xz||FormData),r=bt.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(I,C){return!bt.isUndefined(C[I])});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 _n("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,I,C){let k=A;if(A&&!C&&typeof A=="object"){if(bt.endsWith(I,"{}"))I=n?I:I.slice(0,-2),A=JSON.stringify(A);else if(bt.isArray(A)&&DJt(A)||(bt.isFileList(A)||bt.endsWith(I,"[]"))&&(k=bt.toArray(A)))return I=FLe(I),k.forEach(function(M,L){!(bt.isUndefined(M)||M===null)&&t.append(c===!0?NLe([I],L,s):c===null?I:I+"[]",d(M))}),!1}return loe(A)?!0:(t.append(NLe(C,I,s),d(A)),!1)}let g=[],x=Object.assign(PJt,{defaultVisitor:m,convertValue:d,isVisitable:loe});function b(A,I){if(!bt.isUndefined(A)){if(g.indexOf(A)!==-1)throw Error("Circular reference detected in "+I.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,I,x))===!0&&b(k,I?I.concat(O):[O])}),g.pop()}}if(!bt.isObject(e))throw new TypeError("data must be an object");return b(e),t}var VC=RJt;function OLe(e){let t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(n){return t[n]})}function QLe(e,t){this._pairs=[],e&&VC(e,this,t)}var LLe=QLe.prototype;LLe.append=function(t,r){this._pairs.push([t,r])};LLe.toString=function(t){let r=t?function(n){return t.call(this,n,OLe)}:OLe;return this._pairs.map(function(a){return r(a[0])+"="+r(a[1])},"").join("&")};var jLe=QLe;function NJt(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function sT(e,t,r){if(!t)return e;let n=r&&r.encode||NJt;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 jLe(t,r).toString(n),s){let c=e.indexOf("#");c!==-1&&(e=e.slice(0,c)),e+=(e.indexOf("?")===-1?"?":"&")+s}return e}var poe=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)})}},foe=poe;var JR={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1};var zLe=vr(require("crypto"),1);var MLe=vr(require("url"),1),qLe=MLe.default.URLSearchParams;var doe="abcdefghijklmnopqrstuvwxyz",ULe="0123456789",HLe={DIGIT:ULe,ALPHA:doe,ALPHA_DIGIT:doe+doe.toUpperCase()+ULe},FJt=(e=16,t=HLe.ALPHA_DIGIT)=>{let r="",{length:n}=t,a=new Uint32Array(e);zLe.default.randomFillSync(a);for(let s=0;s<e;s++)r+=t[a[s]%n];return r},VLe={isNode:!0,classes:{URLSearchParams:qLe,FormData:Xz,Blob:typeof Blob<"u"&&Blob||null},ALPHABET:HLe,generateString:FJt,protocols:["http","https","file","data"]};var goe={};oPe(goe,{hasBrowserEnv:()=>moe,hasStandardBrowserEnv:()=>OJt,hasStandardBrowserWebWorkerEnv:()=>QJt,navigator:()=>hoe,origin:()=>LJt});var moe=typeof window<"u"&&typeof document<"u",hoe=typeof navigator=="object"&&navigator||void 0,OJt=moe&&(!hoe||["ReactNative","NativeScript","NS"].indexOf(hoe.product)<0),QJt=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",LJt=moe&&window.location.href||"http://localhost";var Po={...goe,...VLe};function Aoe(e,t){return VC(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 jJt(e){return bt.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function MJt(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 qJt(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]=MJt(a[c])),!l)}if(bt.isFormData(e)&&bt.isFunction(e.entries)){let r={};return bt.forEachEntry(e,(n,a)=>{t(jJt(n),a,r,0)}),r}return null}var Zz=qJt;function UJt(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 yoe={transitional:JR,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(Zz(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 Aoe(t,this.formSerializer).toString();if((l=bt.isFileList(t))||n.indexOf("multipart/form-data")>-1){let f=this.env&&this.env.FormData;return VC(l?{"files[]":t}:t,f&&new f,this.formSerializer)}}return s||a?(r.setContentType("application/json",!1),UJt(t)):t}],transformResponse:[function(t){let r=this.transitional||yoe.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"?_n.from(l,_n.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=>{yoe.headers[e]={}});var KR=yoe;var zJt=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"]),$Le=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]&&zJt[r])&&(r==="set-cookie"?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)}),t};var WLe=Symbol("internals");function lj(e){return e&&String(e).trim().toLowerCase()}function eH(e){return e===!1||e==null?e:bt.isArray(e)?e.map(eH):String(e)}function HJt(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 VJt=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function voe(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 $Jt(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,r,n)=>r.toUpperCase()+n)}function WJt(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 XR=class{constructor(t){t&&this.set(t)}set(t,r,n){let a=this;function s(l,f,d){let m=lj(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]=eH(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())&&!VJt(t))c($Le(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=lj(t),t){let n=bt.findKey(this,t);if(n){let a=this[n];if(!r)return a;if(r===!0)return HJt(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=lj(t),t){let n=bt.findKey(this,t);return!!(n&&this[n]!==void 0&&(!r||voe(this,this[n],n,r)))}return!1}delete(t,r){let n=this,a=!1;function s(c){if(c=lj(c),c){let l=bt.findKey(n,c);l&&(!r||voe(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||voe(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]=eH(a),delete r[s];return}let l=t?$Jt(s):String(s).trim();l!==s&&delete r[s],r[l]=eH(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[WLe]=this[WLe]={accessors:{}}).accessors,a=this.prototype;function s(c){let l=lj(c);n[l]||(WJt(a,c),n[l]=!0)}return bt.isArray(t)?t.forEach(s):s(t),this}};XR.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);bt.reduceDescriptors(XR.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(n){this[r]=n}}});bt.freezeMethods(XR);var el=XR;function pj(e,t){let r=this||KR,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 fj(e){return!!(e&&e.__CANCEL__)}function GLe(e,t,r){_n.call(this,e==null?"canceled":e,_n.ERR_CANCELED,t,r),this.name="CanceledError"}bt.inherits(GLe,_n,{__CANCEL__:!0});var Ug=GLe;function Kb(e,t,r){let n=r.config.validateStatus;!r.status||!n||n(r.status)?e(r):t(new _n("Request failed with status code "+r.status,[_n.ERR_BAD_REQUEST,_n.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}function xoe(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function boe(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function aT(e,t,r){let n=!xoe(t);return e&&(n||r==!1)?boe(e,t):t}var Sje=vr(JLe(),1),Cje=vr(require("http"),1),_je=vr(require("https"),1),Ije=vr(require("util"),1),kje=vr(Ooe(),1),t2=vr(require("zlib"),1);var lT="1.11.0";function Aj(e){let t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}var BKt=/^(?:([^;]+);)?(?:[^;]+;)?(base64|),([\s\S]*)$/;function Qoe(e,t,r){let n=r&&r.Blob||Po.classes.Blob,a=Aj(e);if(t===void 0&&n&&(t=!0),a==="data"){e=a.length?e.slice(a.length+1):e;let s=BKt.exec(e);if(!s)throw new _n("Invalid URL",_n.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 _n("Blob is not supported",_n.ERR_NOT_SUPPORT);return new n([d],{type:c})}return d}throw new _n("Unsupported protocol "+a,_n.ERR_NOT_SUPPORT)}var fT=vr(require("stream"),1);var uje=vr(require("stream"),1);var Loe=Symbol("internals"),joe=class extends uje.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[Loe]={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[Loe];return r.onReadCallback&&r.onReadCallback(),super._read(t)}_transform(t,r,n){let a=this[Loe],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 I=Buffer.byteLength(b);a.bytesSeen+=I,a.bytes+=I,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 I=Buffer.byteLength(b),C=null,k=c,O,M=0;if(s){let L=Date.now();(!a.ts||(M=L-a.ts)>=l)&&(a.ts=L,O=d-a.bytes,a.bytes=O<0?-O:0,M=0),O=d-a.bytes}if(s){if(O<=0)return setTimeout(()=>{A(null,b)},l-M);O<k&&(k=O)}k&&I>k&&I-k>m&&(C=b.subarray(k),b=b.subarray(0,k)),g(b,C?()=>{process.nextTick(A,null,C)}:A)};x(t,function b(A,I){if(A)return n(A);I?x(I,b):n(null)})}},Moe=joe;var Tje=require("events");var pje=vr(require("util"),1),fje=require("stream");var{asyncIterator:lje}=Symbol,DKt=async function*(e){e.stream?yield*e.stream():e.arrayBuffer?yield await e.arrayBuffer():e[lje]?yield*e[lje]():yield e},aH=DKt;var PKt=Po.ALPHABET.ALPHA_DIGIT+"-_",yj=typeof TextEncoder=="function"?new TextEncoder:new pje.default.TextEncoder,pT=`\r
525
525
  `,RKt=yj.encode(pT),NKt=2,qoe=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)}"`:""}${pT}`;a?r=yj.encode(String(r).replace(/\r?\n|\r\n?/g,pT)):s+=`Content-Type: ${r.type||"application/octet-stream"}${pT}`,this.headers=yj.encode(s+pT),this.contentLength=a?r.byteLength:r.size,this.size=this.headers.byteLength+this.contentLength+NKt,this.name=t,this.value=r}async*encode(){yield this.headers;let{value:t}=this;bt.isTypedArray(t)?yield t:yield*aH(t),yield RKt}static escapeName(t){return String(t).replace(/[\r\n"]/g,r=>({"\r":"%0D","\n":"%0A",'"':"%22"})[r])}},FKt=(e,t,r)=>{let{tag:n="form-data-boundary",size:a=25,boundary:s=n+"-"+Po.generateString(a,PKt)}=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=yj.encode("--"+s+pT),l=yj.encode("--"+s+"--"+pT),f=l.byteLength,d=Array.from(e.entries()).map(([g,x])=>{let b=new qoe(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),fje.Readable.from(async function*(){for(let g of d)yield c,yield*g.encode();yield l}())},dje=FKt;var hje=vr(require("stream"),1),Uoe=class extends hje.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)}},mje=Uoe;var OKt=(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,gje=OKt;function QKt(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 Aje=QKt;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 yje=LKt;var e2=(e,t,r=3)=>{let n=0,a=Aje(50,250);return yje(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)},nN=(e,t)=>{let r=e!=null;return[n=>t[0]({lengthComputable:r,total:e,loaded:n}),t[1]]},iN=e=>(...t)=>bt.asap(()=>e(...t));var vje={flush:t2.default.constants.Z_SYNC_FLUSH,finishFlush:t2.default.constants.Z_SYNC_FLUSH},jKt={flush:t2.default.constants.BROTLI_OPERATION_FLUSH,finishFlush:t2.default.constants.BROTLI_OPERATION_FLUSH},xje=bt.isFunction(t2.default.createBrotliDecompress),{http:MKt,https:qKt}=kje.default,UKt=/https:?/,bje=Po.protocols.map(e=>e+":"),Eje=(e,[t,r])=>(e.on("end",r).on("error",r),t);function zKt(e,t){e.beforeRedirects.proxy&&e.beforeRedirects.proxy(e),e.beforeRedirects.config&&e.beforeRedirects.config(e,t)}function Bje(e,t,r){let n=t;if(!n&&n!==!1){let a=Sje.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){Bje(s,t,s.href)}}var HKt=typeof process<"u"&&bt.kindOf(process)==="process",VKt=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)}),$Kt=({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)}},wje=(e,t)=>$Kt(bt.isObject(e)?e:{address:e,family:t}),Dje=HKt&&function(t){return VKt(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 ye=gje(l,Ee=>bt.isArray(Ee)?Ee:[Ee]);l=(Ee,Me,We)=>{ye(Ee,Me,(kt,Vt,mt)=>{if(kt)return We(kt);let it=bt.isArray(Vt)?Vt.map(He=>wje(He)):[wje(Vt,mt)];Me.all?We(kt,it):We(kt,it[0].address,it[0].family)})}}let I=new Tje.EventEmitter,C=()=>{t.cancelToken&&t.cancelToken.unsubscribe(k),t.signal&&t.signal.removeEventListener("abort",k),I.removeAllListeners()};s((ye,Ee)=>{x=!0,Ee&&(b=!0,C())});function k(ye){I.emit("abort",!ye||ye.type?new Ug(null,t,A):ye)}I.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=aT(t.baseURL,t.url,t.allowAbsoluteUrls),M=new URL(O,Po.hasBrowserEnv?Po.origin:void 0),L=M.protocol||bje[0];if(L==="data:"){let ye;if(g!=="GET")return Kb(n,a,{status:405,statusText:"method not allowed",headers:{},config:t});try{ye=Qoe(t.url,d==="blob",{Blob:t.env&&t.env.Blob})}catch(Ee){throw _n.from(Ee,_n.ERR_BAD_REQUEST,t)}return d==="text"?(ye=ye.toString(m),(!m||m==="utf8")&&(ye=bt.stripBOM(ye))):d==="stream"&&(ye=fT.default.Readable.from(ye)),Kb(n,a,{data:ye,status:200,statusText:"OK",headers:new el,config:t})}if(bje.indexOf(L)===-1)return a(new _n("Unsupported protocol "+L,_n.ERR_BAD_REQUEST,t));let W=el.from(t.headers).normalize();W.set("User-Agent","axios/"+lT,!1);let{onUploadProgress:ie,onDownloadProgress:K}=t,xe=t.maxRate,ne,he;if(bt.isSpecCompliantForm(c)){let ye=W.getContentType(/boundary=([-_\w\d]{10,70})/i);c=dje(c,Ee=>{W.set(Ee)},{tag:`axios-${lT}-boundary`,boundary:ye&&ye[1]||void 0})}else if(bt.isFormData(c)&&bt.isFunction(c.getHeaders)){if(W.set(c.getHeaders()),!W.hasContentLength())try{let ye=await Ije.default.promisify(c.getLength).call(c);Number.isFinite(ye)&&ye>=0&&W.setContentLength(ye)}catch{}}else if(bt.isBlob(c)||bt.isFile(c))c.size&&W.setContentType(c.type||"application/octet-stream"),W.setContentLength(c.size||0),c=fT.default.Readable.from(aH(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 _n("Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream",_n.ERR_BAD_REQUEST,t));if(W.setContentLength(c.length,!1),t.maxBodyLength>-1&&c.length>t.maxBodyLength)return a(new _n("Request body larger than maxBodyLength limit",_n.ERR_BAD_REQUEST,t))}let me=bt.toFiniteNumber(W.getContentLength());bt.isArray(xe)?(ne=xe[0],he=xe[1]):ne=he=xe,c&&(ie||ne)&&(bt.isStream(c)||(c=fT.default.Readable.from(c,{objectMode:!1})),c=fT.default.pipeline([c,new Moe({maxRate:bt.toFiniteNumber(ne)})],bt.noop),ie&&c.on("progress",Eje(c,nN(me,e2(iN(ie),!1,3)))));let Ae;if(t.auth){let ye=t.auth.username||"",Ee=t.auth.password||"";Ae=ye+":"+Ee}if(!Ae&&M.username){let ye=M.username,Ee=M.password;Ae=ye+":"+Ee}Ae&&W.delete("authorization");let ce;try{ce=sT(M.pathname+M.search,t.params,t.paramsSerializer).replace(/^\?/,"")}catch(ye){let Ee=new Error(ye.message);return Ee.config=t,Ee.url=t.url,Ee.exists=!0,a(Ee)}W.set("Accept-Encoding","gzip, compress, deflate"+(xje?", br":""),!1);let se={path:ce,method:g,headers:W.toJSON(),agents:{http:t.httpAgent,https:t.httpsAgent},auth:Ae,protocol:L,family:f,beforeRedirect:zKt,beforeRedirects:{}};!bt.isUndefined(l)&&(se.lookup=l),t.socketPath?se.socketPath=t.socketPath:(se.hostname=M.hostname.startsWith("[")?M.hostname.slice(1,-1):M.hostname,se.port=M.port,Bje(se,t.proxy,L+"//"+M.hostname+(M.port?":"+M.port:"")+se.path));let be,$e=UKt.test(se.protocol);if(se.agent=$e?t.httpsAgent:t.httpAgent,t.transport?be=t.transport:t.maxRedirects===0?be=$e?_je.default:Cje.default:(t.maxRedirects&&(se.maxRedirects=t.maxRedirects),t.beforeRedirect&&(se.beforeRedirects.config=t.beforeRedirect),be=$e?qKt:MKt),t.maxBodyLength>-1?se.maxBodyLength=t.maxBodyLength:se.maxBodyLength=1/0,t.insecureHTTPParser&&(se.insecureHTTPParser=t.insecureHTTPParser),A=be.request(se,function(Ee){if(A.destroyed)return;let Me=[Ee],We=+Ee.headers["content-length"];if(K||he){let He=new Moe({maxRate:bt.toFiniteNumber(he)});K&&He.on("progress",Eje(He,nN(We,e2(iN(K),!0,3)))),Me.push(He)}let kt=Ee,Vt=Ee.req||A;if(t.decompress!==!1&&Ee.headers["content-encoding"])switch((g==="HEAD"||Ee.statusCode===204)&&delete Ee.headers["content-encoding"],(Ee.headers["content-encoding"]||"").toLowerCase()){case"gzip":case"x-gzip":case"compress":case"x-compress":Me.push(t2.default.createUnzip(vje)),delete Ee.headers["content-encoding"];break;case"deflate":Me.push(new mje),Me.push(t2.default.createUnzip(vje)),delete Ee.headers["content-encoding"];break;case"br":xje&&(Me.push(t2.default.createBrotliDecompress(jKt)),delete Ee.headers["content-encoding"])}kt=Me.length>1?fT.default.pipeline(Me,bt.noop):Me[0];let mt=fT.default.finished(kt,()=>{mt(),C()}),it={status:Ee.statusCode,statusText:Ee.statusMessage,headers:new el(Ee.headers),config:t,request:Vt};if(d==="stream")it.data=kt,Kb(n,a,it);else{let He=[],rt=0;kt.on("data",function(Wt){He.push(Wt),rt+=Wt.length,t.maxContentLength>-1&&rt>t.maxContentLength&&(b=!0,kt.destroy(),a(new _n("maxContentLength size of "+t.maxContentLength+" exceeded",_n.ERR_BAD_RESPONSE,t,Vt)))}),kt.on("aborted",function(){if(b)return;let Wt=new _n("stream has been aborted",_n.ERR_BAD_RESPONSE,t,Vt);kt.destroy(Wt),a(Wt)}),kt.on("error",function(Wt){A.destroyed||a(_n.from(Wt,null,t,Vt))}),kt.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(_n.from(Wt,null,t,it.request,it))}Kb(n,a,it)})}I.once("abort",He=>{kt.destroyed||(kt.emit("error",He),kt.destroy())})}),I.once("abort",ye=>{a(ye),A.destroy(ye)}),A.on("error",function(Ee){a(_n.from(Ee,null,t,A))}),A.on("socket",function(Ee){Ee.setKeepAlive(!0,1e3*60)}),t.timeout){let ye=parseInt(t.timeout,10);if(Number.isNaN(ye)){a(new _n("error trying to parse `config.timeout` to int",_n.ERR_BAD_OPTION_VALUE,t,A));return}A.setTimeout(ye,function(){if(x)return;let Me=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded",We=t.transitional||JR;t.timeoutErrorMessage&&(Me=t.timeoutErrorMessage),a(new _n(Me,We.clarifyTimeoutError?_n.ETIMEDOUT:_n.ECONNABORTED,t,A)),k()})}if(bt.isStream(c)){let ye=!1,Ee=!1;c.on("end",()=>{ye=!0}),c.once("error",Me=>{Ee=!0,A.destroy(Me)}),c.on("close",()=>{!ye&&!Ee&&k(new Ug("Request stream has been aborted",t,A))}),c.pipe(A)}else A.end(c)})};var Pje=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 Rje=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 Nje=e=>e instanceof el?{...e}:e;function Xv(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(Nje(d),Nje(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 oH=e=>{let t=Xv({},e),{data:r,withXSRFToken:n,xsrfHeaderName:a,xsrfCookieName:s,headers:c,auth:l}=t;t.headers=c=el.from(c),t.url=sT(aT(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&&Pje(t.url))){let d=a&&s&&Rje.read(s);d&&c.set(a,d)}return t};var WKt=typeof XMLHttpRequest<"u",Fje=WKt&&function(e){return new Promise(function(r,n){let a=oH(e),s=a.data,c=el.from(a.headers).normalize(),{responseType:l,onUploadProgress:f,onDownloadProgress:d}=a,m,g,x,b,A;function I(){b&&b(),A&&A(),a.cancelToken&&a.cancelToken.unsubscribe(m),a.signal&&a.signal.removeEventListener("abort",m)}let C=new XMLHttpRequest;C.open(a.method.toUpperCase(),a.url,!0),C.timeout=a.timeout;function k(){if(!C)return;let M=el.from("getAllResponseHeaders"in C&&C.getAllResponseHeaders()),W={data:!l||l==="text"||l==="json"?C.responseText:C.response,status:C.status,statusText:C.statusText,headers:M,config:e,request:C};Kb(function(K){r(K),I()},function(K){n(K),I()},W),C=null}"onloadend"in C?C.onloadend=k:C.onreadystatechange=function(){!C||C.readyState!==4||C.status===0&&!(C.responseURL&&C.responseURL.indexOf("file:")===0)||setTimeout(k)},C.onabort=function(){C&&(n(new _n("Request aborted",_n.ECONNABORTED,e,C)),C=null)},C.onerror=function(){n(new _n("Network Error",_n.ERR_NETWORK,e,C)),C=null},C.ontimeout=function(){let L=a.timeout?"timeout of "+a.timeout+"ms exceeded":"timeout exceeded",W=a.transitional||JR;a.timeoutErrorMessage&&(L=a.timeoutErrorMessage),n(new _n(L,W.clarifyTimeoutError?_n.ETIMEDOUT:_n.ECONNABORTED,e,C)),C=null},s===void 0&&c.setContentType(null),"setRequestHeader"in C&&bt.forEach(c.toJSON(),function(L,W){C.setRequestHeader(W,L)}),bt.isUndefined(a.withCredentials)||(C.withCredentials=!!a.withCredentials),l&&l!=="json"&&(C.responseType=a.responseType),d&&([x,A]=e2(d,!0),C.addEventListener("progress",x)),f&&C.upload&&([g,b]=e2(f),C.upload.addEventListener("progress",g),C.upload.addEventListener("loadend",b)),(a.cancelToken||a.signal)&&(m=M=>{C&&(n(!M||M.type?new Ug(null,e,C):M),C.abort(),C=null)},a.cancelToken&&a.cancelToken.subscribe(m),a.signal&&(a.signal.aborted?m():a.signal.addEventListener("abort",m)));let O=Aj(a.url);if(O&&Po.protocols.indexOf(O)===-1){n(new _n("Unsupported protocol "+O+":",_n.ERR_BAD_REQUEST,e));return}C.send(s||null)})};var GKt=(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 _n?m:new Ug(m instanceof Error?m.message:m))}},c=t&&setTimeout(()=>{c=null,s(new _n(`timeout ${t} of ms exceeded`,_n.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}},Oje=GKt;var YKt=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},JKt=async function*(e,t){for await(let r of KKt(e))yield*YKt(r,t)},KKt=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()}},zoe=(e,t,r,n)=>{let a=JKt(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 uH=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",Lje=uH&&typeof ReadableStream=="function",XKt=uH&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),jje=(e,...t)=>{try{return!!e(...t)}catch{return!1}},ZKt=Lje&&jje(()=>{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}),Qje=64*1024,Hoe=Lje&&jje(()=>bt.isReadableStream(new Response("").body)),cH={stream:Hoe&&(e=>e.body)};uH&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!cH[t]&&(cH[t]=bt.isFunction(e[t])?r=>r[t]():(r,n)=>{throw new _n(`Response type '${t}' is not supported`,_n.ERR_NOT_SUPPORT,n)})})})(new Response);var eXt=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 XKt(e)).byteLength},tXt=async(e,t)=>{let r=bt.toFiniteNumber(e.getContentLength());return r==null?eXt(t):r},Mje=uH&&(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}=oH(e);d=d?(d+"").toLowerCase():"text";let b=Oje([a,s&&s.toAbortSignal()],c),A,I=b&&b.unsubscribe&&(()=>{b.unsubscribe()}),C;try{if(f&&ZKt&&r!=="get"&&r!=="head"&&(C=await tXt(m,n))!==0){let W=new Request(t,{method:"POST",body:n,duplex:"half"}),ie;if(bt.isFormData(n)&&(ie=W.headers.get("content-type"))&&m.setContentType(ie),W.body){let[K,xe]=nN(C,e2(iN(f)));n=zoe(W.body,Qje,K,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),M=Hoe&&(d==="stream"||d==="response");if(Hoe&&(l||M&&I)){let W={};["status","statusText","headers"].forEach(ne=>{W[ne]=O[ne]});let ie=bt.toFiniteNumber(O.headers.get("content-length")),[K,xe]=l&&nN(ie,e2(iN(l),!0))||[];O=new Response(zoe(O.body,Qje,K,()=>{xe&&xe(),I&&I()}),W)}d=d||"text";let L=await cH[bt.findKey(cH,d)||"text"](O,e);return!M&&I&&I(),await new Promise((W,ie)=>{Kb(W,ie,{data:L,headers:el.from(O.headers),status:O.status,statusText:O.statusText,config:e,request:A})})}catch(k){throw I&&I(),k&&k.name==="TypeError"&&/Load failed|fetch/i.test(k.message)?Object.assign(new _n("Network Error",_n.ERR_NETWORK,e,A),{cause:k.cause||k}):_n.from(k,k&&k.code,e,A)}});var Voe={http:Dje,xhr:Fje,fetch:Mje};bt.forEach(Voe,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});var qje=e=>`- ${e}`,rXt=e=>bt.isFunction(e)||e===null||e===!1,lH={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,!rXt(r)&&(n=Voe[(c=String(r)).toLowerCase()],n===void 0))throw new _n(`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 :
@@ -1264,7 +1264,7 @@ export default {
1264
1264
  await kvModule.exports.bootstrap();
1265
1265
  }
1266
1266
  })();
1267
- `;function pLr(){return'/* EdgeKV Runtime Client - Auto-generated, do not edit */\nvar Y=Object.create;var v=Object.defineProperty;var j=Object.getOwnPropertyDescriptor;var F=Object.getOwnPropertyNames;var Z=Object.getPrototypeOf,X=Object.prototype.hasOwnProperty;var J=(t,r)=>{for(var e in r)v(t,e,{get:r[e],enumerable:!0})},A=(t,r,e,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let o of F(r))!X.call(t,o)&&o!==e&&v(t,o,{get:()=>r[o],enumerable:!(n=j(r,o))||n.enumerable});return t};var W=(t,r,e)=>(e=t!=null?Y(Z(t)):{},A(r||!t||!t.__esModule?v(e,"default",{value:t,enumerable:!0}):e,t)),q=t=>A(v({},"__esModule",{value:!0}),t);var ne={};J(ne,{bootstrap:()=>re,createKVClient:()=>S,getConfigs:()=>M,initKVBindings:()=>z});module.exports=q(ne);var x=W(require("net"));var K=class{static encodeCommand(r){let e=[];e.push(`*${r.length}\\r\n`);for(let n of r){let o=Buffer.byteLength(n,"utf8");e.push("$"+o+`\\r\n`+n+`\\r\n`)}return e.join("")}static encodeCommandBuffer(r){let e=[];e.push(Buffer.from(`*${r.length}\\r\n`));for(let n of r){let o=typeof n=="string"?Buffer.from(n,"utf8"):n;e.push(Buffer.from("$"+o.length+`\\r\n`)),e.push(o),e.push(Buffer.from(`\\r\n`))}return Buffer.concat(e)}},w=class{buffer="";append(r){Buffer.isBuffer(r)?this.buffer+=r.toString("utf8"):this.buffer+=r}get bufferLength(){return this.buffer.length}clear(){this.buffer=""}parse(){if(this.buffer.length===0)return null;let r=this.buffer[0],e=this.buffer.indexOf(`\\r\n`);if(e===-1)return null;let n=this.buffer.substring(1,e);switch(r){case"+":return this.buffer=this.buffer.substring(e+2),{type:"simple_string",value:n};case"-":return this.buffer=this.buffer.substring(e+2),{type:"error",value:n};case":":return this.buffer=this.buffer.substring(e+2),{type:"integer",value:parseInt(n,10)};case"$":return this.parseBulkString(n,e);case"*":return this.parseArray(n,e);default:throw new Error(`Unknown RESP type: ${r}`)}}parseBulkString(r,e){let n=parseInt(r,10);if(n===-1)return this.buffer=this.buffer.substring(e+2),{type:"null",value:null};let o=e+2,f=o+n,a=f+2;if(this.buffer.length<a)return null;let u=this.buffer.substring(o,f);return this.buffer=this.buffer.substring(a),{type:"bulk_string",value:u}}parseArray(r,e){let n=parseInt(r,10);if(n===-1)return this.buffer=this.buffer.substring(e+2),{type:"null",value:null};if(n===0)return this.buffer=this.buffer.substring(e+2),{type:"array",value:[]};let o=this.buffer;this.buffer=this.buffer.substring(e+2);let f=[];for(let a=0;a<n;a++){let u=this.parse();if(u===null)return this.buffer=o,null;f.push(u)}return{type:"array",value:f}}};var R="EO_KV_BINDINGS";var k=/^[a-zA-Z0-9_]+$/;var V=class{socket=null;decoder=new w;responseQueue=[];host;port;timeout;debug;connected=!1;constructor(r){this.host=r.host,this.port=r.port,this.timeout=r.timeout??1e4,this.debug=r.debug??!1}log(r,...e){this.debug&&console.log(`[RespConnection] ${r}`,...e)}connect(){return new Promise((r,e)=>{this.log("Connecting to KV service..."),this.socket=x.createConnection({host:this.host,port:this.port}),this.socket.on("connect",()=>{this.log("TCP connection established"),this.connected=!0,r()}),this.socket.on("data",n=>{this.decoder.append(n),this.processResponses()}),this.socket.on("error",n=>{this.log(`Socket error: ${n.message}`),e(new Error("KV connection failed"))}),this.socket.on("close",n=>{for(this.log(`Connection closed (hadError: ${n}, pending: ${this.responseQueue.length})`),this.connected=!1;this.responseQueue.length>0;){let{reject:o}=this.responseQueue.shift();o(new Error("Connection closed by server"))}}),this.socket.setTimeout(this.timeout,()=>{this.log(`Connection timeout after ${this.timeout}ms`),e(new Error("KV connection timeout"))})})}processResponses(){let r;for(;(r=this.decoder.parse())!==null;)if(this.responseQueue.length>0){let{resolve:e,reject:n}=this.responseQueue.shift();r.type==="error"?n(new Error(r.value)):e(r)}}sendCommand(r){return new Promise((e,n)=>{if(!this.socket||!this.connected){n(new Error("Not connected"));return}let o=K.encodeCommand(r);this.log(`Sending command: ${r[0]} (${o.length} bytes)`),this.responseQueue.push({resolve:e,reject:n}),this.socket.write(o,f=>{f&&this.log(`Write error: ${f.message}`)})})}close(){this.socket&&(this.socket.end(),this.socket=null),this.connected=!1}};function P(t){if(!t||typeof t!="string")throw new Error("Key must be a non-empty string");let r=Buffer.byteLength(t,"utf-8");if(r>512)throw new Error(`Key size exceeds maximum limit of ${512} bytes (got ${r} bytes)`);if(!k.test(t))throw new Error("Key can only contain letters, numbers, and underscores")}function L(t){if(t.length>26214400)throw new Error(`Value size exceeds maximum limit of ${26214400} bytes (${Math.round(26214400/1024/1024)} MB), got ${t.length} bytes`)}async function N(t){if(typeof t=="string")return Buffer.from(t,"utf-8");if(t instanceof ArrayBuffer)return Buffer.from(t);if(ArrayBuffer.isView(t))return Buffer.from(t.buffer,t.byteOffset,t.byteLength);if(typeof ReadableStream<"u"&&t instanceof ReadableStream){let r=[],e=t.getReader();try{for(;;){let{done:a,value:u}=await e.read();if(a)break;r.push(u)}}finally{e.releaseLock()}let n=r.reduce((a,u)=>a+u.length,0),o=new Uint8Array(n),f=0;for(let a of r)o.set(a,f),f+=a.length;return Buffer.from(o)}throw new Error(`Unsupported value type: ${typeof t}`)}function U(t,r){switch(r){case"json":try{return JSON.parse(t.toString("utf-8"))}catch{return t.toString("utf-8")}case"arrayBuffer":return t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength);case"stream":{let e=t;return new ReadableStream({start(n){n.enqueue(new Uint8Array(e)),n.close()}})}case"text":default:return t.toString("utf-8")}}function S(t,r){let e=null,n=null,o=(r==null?void 0:r.debug)??!1,f=`${t.userId}@${t.userKey}`,a=`/${t.namespace}/`,u=(s,...i)=>{o&&console.log(`[KVClient] ${s}`,...i)},m=s=>a+s,C=s=>s.startsWith(a)?s.substring(a.length):s,D=async s=>{u("Authenticating...");let i=await s.sendCommand(["AUTH",f]);if(i.type==="simple_string"&&i.value==="OK")u("Authentication successful");else throw new Error("Authentication failed")},Q=async s=>{u("Selecting namespace...");let i=await s.sendCommand(["SELECT",t.namespace]);if(i.type==="simple_string"&&i.value==="OK")u("Namespace selected");else throw new Error("Namespace selection failed")},b=async()=>{if(e&&!e.connected&&(e=null,n=null),e&&e.connected)return e;if(n){if(await n,e&&e.connected)return e;e=null,n=null}let s=typeof t.servicePort=="string"?parseInt(t.servicePort,10):t.servicePort;return e=new V({host:t.serviceName,port:s,timeout:r==null?void 0:r.timeout,debug:o}),n=(async()=>{try{await e.connect(),await D(e),await Q(e)}catch(i){throw e==null||e.close(),e=null,n=null,i}})(),await n,e},G=s=>{if(s.type==="null")return null;if(s.type==="array"&&Array.isArray(s.value)){let i=s.value;if(i.length>0){let l=i[0];return l.type==="null"?null:Buffer.from(l.value,"utf-8")}return null}return s.type==="bulk_string"?Buffer.from(s.value,"utf-8"):null};return{async get(s,i){let l=await b(),c=m(s);u(`GET: ${c}`);let h=await l.sendCommand(["oget",c]),p=G(h);if(p===null)return null;let g=typeof i=="string"?i:(i==null?void 0:i.type)??"text";return U(p,g)},async put(s,i){P(s);let l=await b(),c=m(s),h=await N(i);L(h);let p=h.toString("utf-8");u(`PUT: ${c} = ${p.substring(0,100)}${p.length>100?"...":""}`);let g=["oset",c,p],d=await l.sendCommand(g);if(d.type!=="simple_string"||d.value!=="OK")throw new Error("PUT operation failed")},async delete(s){let i=await b(),l=m(s);u(`DELETE: ${l}`);let c=await i.sendCommand(["odel",l]);if(c.type==="error")throw new Error(`DELETE failed: ${c.value}`);u(`DELETE response: type=${c.type}, value=${c.value}`)},async list(s){var d,T,_;let i=await b(),l=(s==null?void 0:s.prefix)??"",c=(s==null?void 0:s.limit)??10,h=m(l);u(`LIST: ${h}, limit: ${c}`);let p=["list",h,"count",c.toString()];s!=null&&s.cursor&&p.push("cursor",m(s.cursor));let g=await i.sendCommand(p);if(g.type==="array"&&Array.isArray(g.value)){let y=g.value;if(y.length>=2){let $={cursor:C(((d=y[0])==null?void 0:d.value)||"")||void 0,complete:(((T=y[1])==null?void 0:T.value)||"").toLowerCase()==="true",keys:[]};for(let E=2;E+3<=y.length;E+=3){let O={key:C(((_=y[E])==null?void 0:_.value)||"")};$.keys.push(O)}return $}}return{keys:[],complete:!0}}}}function M(){let t=process.env[R];if(!t)return[];delete process.env[R];try{return JSON.parse(t)}catch{try{let r=Buffer.from(t,"base64").toString("utf-8");return JSON.parse(r)}catch{return[]}}}function z(t){for(let r of t)globalThis[r.name]=S(r)}function re(){try{let t=M();t&&t.length>0&&(z(t),console.log(`[cli] Initialized ${t.length} KV binding(s)`))}catch{console.error("[cli] Initialization failed")}}0&&(module.exports={bootstrap,createKVClient,getConfigs,initKVBindings});\n'}function Rhe(){let e=pLr();return lGe.replace("{{KV_CLIENT_BUNDLE}}",e)}function fLr(e){for(var t=[],r=0;r<e.length;){var n=e[r];if(n==="*"||n==="+"||n==="?"){t.push({type:"MODIFIER",index:r,value:e[r++]});continue}if(n==="\\"){t.push({type:"ESCAPED_CHAR",index:r++,value:e[r++]});continue}if(n==="{"){t.push({type:"OPEN",index:r,value:e[r++]});continue}if(n==="}"){t.push({type:"CLOSE",index:r,value:e[r++]});continue}if(n===":"){for(var a="",s=r+1;s<e.length;){var c=e.charCodeAt(s);if(c>=48&&c<=57||c>=65&&c<=90||c>=97&&c<=122||c===95){a+=e[s++];continue}break}if(!a)throw new TypeError("Missing parameter name at "+r);t.push({type:"NAME",index:r,value:a}),r=s;continue}if(n==="("){var l=1,f="",s=r+1;if(e[s]==="?")throw new TypeError('Pattern cannot start with "?" at '+s);for(;s<e.length;){if(e[s]==="\\"){f+=e[s++]+e[s++];continue}if(e[s]===")"){if(l--,l===0){s++;break}}else if(e[s]==="("&&(l++,e[s+1]!=="?"))throw new TypeError("Capturing groups are not allowed at "+s);f+=e[s++]}if(l)throw new TypeError("Unbalanced pattern at "+r);if(!f)throw new TypeError("Missing pattern at "+r);t.push({type:"PATTERN",index:r,value:f}),r=s;continue}t.push({type:"CHAR",index:r,value:e[r++]})}return t.push({type:"END",index:r,value:""}),t}function dLr(e,t){t===void 0&&(t={});for(var r=fLr(e),n=t.prefixes,a=n===void 0?"./":n,s="[^"+tF(t.delimiter||"/#?")+"]+?",c=[],l=0,f=0,d="",m=function(ie){if(f<r.length&&r[f].type===ie)return r[f++].value},g=function(ie){var K=m(ie);if(K!==void 0)return K;var xe=r[f],ne=xe.type,he=xe.index;throw new TypeError("Unexpected "+ne+" at "+he+", expected "+ie)},x=function(){for(var ie="",K;K=m("CHAR")||m("ESCAPED_CHAR");)ie+=K;return ie};f<r.length;){var b=m("CHAR"),A=m("NAME"),I=m("PATTERN");if(A||I){var C=b||"";a.indexOf(C)===-1&&(d+=C,C=""),d&&(c.push(d),d=""),c.push({name:A||l++,prefix:C,suffix:"",pattern:I||s,modifier:m("MODIFIER")||""});continue}var k=b||m("ESCAPED_CHAR");if(k){d+=k;continue}d&&(c.push(d),d="");var O=m("OPEN");if(O){var C=x(),M=m("NAME")||"",L=m("PATTERN")||"",W=x();g("CLOSE"),c.push({name:M||(L?l++:""),pattern:M&&!L?s:L,prefix:C,suffix:W,modifier:m("MODIFIER")||""});continue}g("END")}return c}function tF(e){return e.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1")}function fGe(e){return e&&e.sensitive?"":"i"}function hLr(e,t){if(!t)return e;var r=e.source.match(/\((?!\?)/g);if(r)for(var n=0;n<r.length;n++)t.push({name:n,prefix:"",suffix:"",modifier:"",pattern:""});return e}function mLr(e,t,r){var n=e.map(function(a){return WM(a,t,r).source});return new RegExp("(?:"+n.join("|")+")",fGe(r))}function gLr(e,t,r){return ALr(dLr(e,r),t,r)}function ALr(e,t,r){r===void 0&&(r={});for(var n=r.strict,a=n===void 0?!1:n,s=r.start,c=s===void 0?!0:s,l=r.end,f=l===void 0?!0:l,d=r.encode,m=d===void 0?function(ie){return ie}:d,g="["+tF(r.endsWith||"")+"]|$",x="["+tF(r.delimiter||"/#?")+"]",b=c?"^":"",A=0,I=e;A<I.length;A++){var C=I[A];if(typeof C=="string")b+=tF(m(C));else{var k=tF(m(C.prefix)),O=tF(m(C.suffix));if(C.pattern)if(t&&t.push(C),k||O)if(C.modifier==="+"||C.modifier==="*"){var M=C.modifier==="*"?"?":"";b+="(?:"+k+"((?:"+C.pattern+")(?:"+O+k+"(?:"+C.pattern+"))*)"+O+")"+M}else b+="(?:"+k+"("+C.pattern+")"+O+")"+C.modifier;else b+="("+C.pattern+")"+C.modifier;else b+="(?:"+k+O+")"+C.modifier}}if(f)a||(b+=x+"?"),b+=r.endsWith?"(?="+g+")":"$";else{var L=e[e.length-1],W=typeof L=="string"?x.indexOf(L[L.length-1])>-1:L===void 0;a||(b+="(?:"+x+"(?="+g+"))?"),W||(b+="(?="+x+"|"+g+")")}return new RegExp(b,fGe(r))}function WM(e,t,r){return e instanceof RegExp?hLr(e,t):Array.isArray(e)?mLr(e,t,r):gLr(e,t,r)}var Fhe=vr(A2()),Ohe=vr(WV()),xm=vr(Ss()),Us=vr(require("fs")),mo=vr(require("path")),b_=vr(require("esbuild"));function dGe(){return`
1267
+ `;function pLr(){return'/* EdgeKV Runtime Client - Auto-generated, do not edit */\nvar O=Object.create;var v=Object.defineProperty;var Y=Object.getOwnPropertyDescriptor;var F=Object.getOwnPropertyNames;var Z=Object.getPrototypeOf,X=Object.prototype.hasOwnProperty;var J=(r,e)=>{for(var t in e)v(r,t,{get:e[t],enumerable:!0})},x=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of F(e))!X.call(r,o)&&o!==t&&v(r,o,{get:()=>e[o],enumerable:!(n=Y(e,o))||n.enumerable});return r};var W=(r,e,t)=>(t=r!=null?O(Z(r)):{},x(e||!r||!r.__esModule?v(t,"default",{value:r,enumerable:!0}):t,r)),q=r=>x(v({},"__esModule",{value:!0}),r);var ne={};J(ne,{bootstrap:()=>re,createKVClient:()=>S,getConfigs:()=>M,initKVBindings:()=>z});module.exports=q(ne);var k=W(require("net"));var K=class{static encodeCommand(e){let t=[];t.push(`*${e.length}\\r\n`);for(let n of e){let o=Buffer.byteLength(n,"utf8");t.push("$"+o+`\\r\n`+n+`\\r\n`)}return t.join("")}static encodeCommandBuffer(e){let t=[];t.push(Buffer.from(`*${e.length}\\r\n`));for(let n of e){let o=typeof n=="string"?Buffer.from(n,"utf8"):n;t.push(Buffer.from("$"+o.length+`\\r\n`)),t.push(o),t.push(Buffer.from(`\\r\n`))}return Buffer.concat(t)}},w=class{buffer="";append(e){Buffer.isBuffer(e)?this.buffer+=e.toString("utf8"):this.buffer+=e}get bufferLength(){return this.buffer.length}clear(){this.buffer=""}parse(){var o;if(this.buffer.length===0)return null;let e=this.buffer[0],t=this.buffer.indexOf(`\\r\n`);if(t===-1)return null;let n=this.buffer.substring(1,t);switch(e){case"+":return this.buffer=this.buffer.substring(t+2),{type:"simple_string",value:n};case"-":return this.buffer=this.buffer.substring(t+2),{type:"error",value:n};case":":return this.buffer=this.buffer.substring(t+2),{type:"integer",value:parseInt(n,10)};case"$":return this.parseBulkString(n,t);case"*":return this.parseArray(n,t);default:{let f=e.charCodeAt(0),a=this.buffer.substring(0,100).replace(/\\r/g,"\\\\r").replace(/\\n/g,"\\\\n").replace(/\\t/g,"\\\\t"),u=((o=Buffer.from(this.buffer.substring(0,20)).toString("hex").match(/.{1,2}/g))==null?void 0:o.join(" "))||"";throw new Error(`Unknown RESP type: \'${e}\' (char code: ${f}, hex: 0x${f.toString(16)})\nBuffer length: ${this.buffer.length}\nBuffer preview (first 100 chars): ${a}\nBuffer hex (first 20 bytes): ${u}`)}}}parseBulkString(e,t){let n=parseInt(e,10);if(n===-1)return this.buffer=this.buffer.substring(t+2),{type:"null",value:null};let o=t+2,f=o+n,a=f+2;if(this.buffer.length<a)return null;let u=this.buffer.substring(o,f);return this.buffer=this.buffer.substring(a),{type:"bulk_string",value:u}}parseArray(e,t){let n=parseInt(e,10);if(n===-1)return this.buffer=this.buffer.substring(t+2),{type:"null",value:null};if(n===0)return this.buffer=this.buffer.substring(t+2),{type:"array",value:[]};let o=this.buffer;this.buffer=this.buffer.substring(t+2);let f=[];for(let a=0;a<n;a++){let u=this.parse();if(u===null)return this.buffer=o,null;f.push(u)}return{type:"array",value:f}}};var R="EO_KV_BINDINGS";var A=/^[a-zA-Z0-9_]+$/;var V=class{socket=null;decoder=new w;responseQueue=[];host;port;timeout;debug;connected=!1;constructor(e){this.host=e.host,this.port=e.port,this.timeout=e.timeout??1e4,this.debug=e.debug??!1}log(e,...t){this.debug&&console.log(`[RespConnection] ${e}`,...t)}connect(){return new Promise((e,t)=>{this.log("Connecting to KV service..."),this.socket=k.createConnection({host:this.host,port:this.port}),this.socket.on("connect",()=>{this.log("TCP connection established"),this.connected=!0,e()}),this.socket.on("data",n=>{this.decoder.append(n),this.processResponses()}),this.socket.on("error",n=>{this.log(`Socket error: ${n.message}`),t(new Error("KV connection failed"))}),this.socket.on("close",n=>{for(this.log(`Connection closed (hadError: ${n}, pending: ${this.responseQueue.length})`),this.connected=!1;this.responseQueue.length>0;){let{reject:o}=this.responseQueue.shift();o(new Error("Connection closed by server"))}}),this.socket.setTimeout(this.timeout,()=>{this.log(`Connection timeout after ${this.timeout}ms`),t(new Error("KV connection timeout"))})})}processResponses(){let e;for(;(e=this.decoder.parse())!==null;)if(this.responseQueue.length>0){let{resolve:t,reject:n}=this.responseQueue.shift();e.type==="error"?n(new Error(e.value)):t(e)}}sendCommand(e){return new Promise((t,n)=>{if(!this.socket||!this.connected){n(new Error("Not connected"));return}let o=K.encodeCommand(e);this.log(`Sending command: ${e[0]} (${o.length} bytes)`),this.responseQueue.push({resolve:t,reject:n}),this.socket.write(o,f=>{f&&this.log(`Write error: ${f.message}`)})})}close(){this.socket&&(this.socket.end(),this.socket=null),this.connected=!1}};function I(r){if(!r||typeof r!="string")throw new Error("Key must be a non-empty string");let e=Buffer.byteLength(r,"utf-8");if(e>512)throw new Error(`Key size exceeds maximum limit of ${512} bytes (got ${e} bytes)`);if(!A.test(r))throw new Error("Key can only contain letters, numbers, and underscores")}function L(r){if(r.length>26214400)throw new Error(`Value size exceeds maximum limit of ${26214400} bytes (${Math.round(26214400/1024/1024)} MB), got ${r.length} bytes`)}async function N(r){if(typeof r=="string")return Buffer.from(r,"utf-8");if(r instanceof ArrayBuffer)return Buffer.from(r);if(ArrayBuffer.isView(r))return Buffer.from(r.buffer,r.byteOffset,r.byteLength);if(typeof ReadableStream<"u"&&r instanceof ReadableStream){let e=[],t=r.getReader();try{for(;;){let{done:a,value:u}=await t.read();if(a)break;e.push(u)}}finally{t.releaseLock()}let n=e.reduce((a,u)=>a+u.length,0),o=new Uint8Array(n),f=0;for(let a of e)o.set(a,f),f+=a.length;return Buffer.from(o)}throw new Error(`Unsupported value type: ${typeof r}`)}function U(r,e){switch(e){case"json":try{return JSON.parse(r.toString("utf-8"))}catch{return r.toString("utf-8")}case"arrayBuffer":return r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength);case"stream":{let t=r;return new ReadableStream({start(n){n.enqueue(new Uint8Array(t)),n.close()}})}case"text":default:return r.toString("utf-8")}}function S(r,e){let t=null,n=null,o=(e==null?void 0:e.debug)??!1,f=`${r.userId}@${r.userKey}`,a=`/${r.namespace}/`,u=(s,...i)=>{o&&console.log(`[KVClient] ${s}`,...i)},m=s=>a+s,C=s=>s.startsWith(a)?s.substring(a.length):s,D=async s=>{u("Authenticating...");let i=await s.sendCommand(["AUTH",f]);if(i.type==="simple_string"&&i.value==="OK")u("Authentication successful");else throw new Error("Authentication failed")},Q=async s=>{u("Selecting namespace...");let i=await s.sendCommand(["SELECT",r.namespace]);if(i.type==="simple_string"&&i.value==="OK")u("Namespace selected");else throw new Error("Namespace selection failed")},b=async()=>{if(t&&!t.connected&&(t=null,n=null),t&&t.connected)return t;if(n){if(await n,t&&t.connected)return t;t=null,n=null}let s=typeof r.servicePort=="string"?parseInt(r.servicePort,10):r.servicePort;return t=new V({host:r.serviceName,port:s,timeout:e==null?void 0:e.timeout,debug:o}),n=(async()=>{try{await t.connect(),await D(t),await Q(t)}catch(i){throw t==null||t.close(),t=null,n=null,i}})(),await n,t},j=s=>{if(s.type==="null")return null;if(s.type==="array"&&Array.isArray(s.value)){let i=s.value;if(i.length>0){let l=i[0];return l.type==="null"?null:Buffer.from(l.value,"utf-8")}return null}return s.type==="bulk_string"?Buffer.from(s.value,"utf-8"):null};return{async get(s,i){let l=await b(),c=m(s);u(`GET: ${c}`);let h=await l.sendCommand(["oget",c]),p=j(h);if(p===null)return null;let g=typeof i=="string"?i:(i==null?void 0:i.type)??"text";return U(p,g)},async put(s,i){I(s);let l=await b(),c=m(s),h=await N(i);L(h);let p=h.toString("utf-8");u(`PUT: ${c} = ${p.substring(0,100)}${p.length>100?"...":""}`);let g=["oset",c,p],d=await l.sendCommand(g);if(d.type!=="simple_string"||d.value!=="OK")throw new Error("PUT operation failed")},async delete(s){let i=await b(),l=m(s);u(`DELETE: ${l}`);let c=await i.sendCommand(["odel",l]);if(c.type==="error")throw new Error(`DELETE failed: ${c.value}`);u(`DELETE response: type=${c.type}, value=${c.value}`)},async list(s){var d,$,T;let i=await b(),l=(s==null?void 0:s.prefix)??"",c=(s==null?void 0:s.limit)??10,h=m(l);u(`LIST: ${h}, limit: ${c}`);let p=["list",h,"count",c.toString()];s!=null&&s.cursor&&p.push("cursor",m(s.cursor));let g=await i.sendCommand(p);if(g.type==="array"&&Array.isArray(g.value)){let y=g.value;if(y.length>=2){let _={cursor:C(((d=y[0])==null?void 0:d.value)||"")||void 0,complete:((($=y[1])==null?void 0:$.value)||"").toLowerCase()==="true",keys:[]};for(let E=2;E+3<=y.length;E+=3){let G={key:C(((T=y[E])==null?void 0:T.value)||"")};_.keys.push(G)}return _}}return{keys:[],complete:!0}}}}function M(){let r=process.env[R];if(!r)return[];delete process.env[R];try{return JSON.parse(r)}catch{try{let e=Buffer.from(r,"base64").toString("utf-8");return JSON.parse(e)}catch{return[]}}}function z(r){for(let e of r)globalThis[e.name]=S(e)}function re(){try{let r=M();r&&r.length>0&&(z(r),console.log(`[cli] Initialized ${r.length} KV binding(s)`))}catch{console.error("[cli] Initialization failed")}}0&&(module.exports={bootstrap,createKVClient,getConfigs,initKVBindings});\n'}function Rhe(){let e=pLr();return lGe.replace("{{KV_CLIENT_BUNDLE}}",e)}function fLr(e){for(var t=[],r=0;r<e.length;){var n=e[r];if(n==="*"||n==="+"||n==="?"){t.push({type:"MODIFIER",index:r,value:e[r++]});continue}if(n==="\\"){t.push({type:"ESCAPED_CHAR",index:r++,value:e[r++]});continue}if(n==="{"){t.push({type:"OPEN",index:r,value:e[r++]});continue}if(n==="}"){t.push({type:"CLOSE",index:r,value:e[r++]});continue}if(n===":"){for(var a="",s=r+1;s<e.length;){var c=e.charCodeAt(s);if(c>=48&&c<=57||c>=65&&c<=90||c>=97&&c<=122||c===95){a+=e[s++];continue}break}if(!a)throw new TypeError("Missing parameter name at "+r);t.push({type:"NAME",index:r,value:a}),r=s;continue}if(n==="("){var l=1,f="",s=r+1;if(e[s]==="?")throw new TypeError('Pattern cannot start with "?" at '+s);for(;s<e.length;){if(e[s]==="\\"){f+=e[s++]+e[s++];continue}if(e[s]===")"){if(l--,l===0){s++;break}}else if(e[s]==="("&&(l++,e[s+1]!=="?"))throw new TypeError("Capturing groups are not allowed at "+s);f+=e[s++]}if(l)throw new TypeError("Unbalanced pattern at "+r);if(!f)throw new TypeError("Missing pattern at "+r);t.push({type:"PATTERN",index:r,value:f}),r=s;continue}t.push({type:"CHAR",index:r,value:e[r++]})}return t.push({type:"END",index:r,value:""}),t}function dLr(e,t){t===void 0&&(t={});for(var r=fLr(e),n=t.prefixes,a=n===void 0?"./":n,s="[^"+tF(t.delimiter||"/#?")+"]+?",c=[],l=0,f=0,d="",m=function(ie){if(f<r.length&&r[f].type===ie)return r[f++].value},g=function(ie){var K=m(ie);if(K!==void 0)return K;var xe=r[f],ne=xe.type,he=xe.index;throw new TypeError("Unexpected "+ne+" at "+he+", expected "+ie)},x=function(){for(var ie="",K;K=m("CHAR")||m("ESCAPED_CHAR");)ie+=K;return ie};f<r.length;){var b=m("CHAR"),A=m("NAME"),I=m("PATTERN");if(A||I){var C=b||"";a.indexOf(C)===-1&&(d+=C,C=""),d&&(c.push(d),d=""),c.push({name:A||l++,prefix:C,suffix:"",pattern:I||s,modifier:m("MODIFIER")||""});continue}var k=b||m("ESCAPED_CHAR");if(k){d+=k;continue}d&&(c.push(d),d="");var O=m("OPEN");if(O){var C=x(),M=m("NAME")||"",L=m("PATTERN")||"",W=x();g("CLOSE"),c.push({name:M||(L?l++:""),pattern:M&&!L?s:L,prefix:C,suffix:W,modifier:m("MODIFIER")||""});continue}g("END")}return c}function tF(e){return e.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1")}function fGe(e){return e&&e.sensitive?"":"i"}function hLr(e,t){if(!t)return e;var r=e.source.match(/\((?!\?)/g);if(r)for(var n=0;n<r.length;n++)t.push({name:n,prefix:"",suffix:"",modifier:"",pattern:""});return e}function mLr(e,t,r){var n=e.map(function(a){return WM(a,t,r).source});return new RegExp("(?:"+n.join("|")+")",fGe(r))}function gLr(e,t,r){return ALr(dLr(e,r),t,r)}function ALr(e,t,r){r===void 0&&(r={});for(var n=r.strict,a=n===void 0?!1:n,s=r.start,c=s===void 0?!0:s,l=r.end,f=l===void 0?!0:l,d=r.encode,m=d===void 0?function(ie){return ie}:d,g="["+tF(r.endsWith||"")+"]|$",x="["+tF(r.delimiter||"/#?")+"]",b=c?"^":"",A=0,I=e;A<I.length;A++){var C=I[A];if(typeof C=="string")b+=tF(m(C));else{var k=tF(m(C.prefix)),O=tF(m(C.suffix));if(C.pattern)if(t&&t.push(C),k||O)if(C.modifier==="+"||C.modifier==="*"){var M=C.modifier==="*"?"?":"";b+="(?:"+k+"((?:"+C.pattern+")(?:"+O+k+"(?:"+C.pattern+"))*)"+O+")"+M}else b+="(?:"+k+"("+C.pattern+")"+O+")"+C.modifier;else b+="("+C.pattern+")"+C.modifier;else b+="(?:"+k+O+")"+C.modifier}}if(f)a||(b+=x+"?"),b+=r.endsWith?"(?="+g+")":"$";else{var L=e[e.length-1],W=typeof L=="string"?x.indexOf(L[L.length-1])>-1:L===void 0;a||(b+="(?:"+x+"(?="+g+"))?"),W||(b+="(?="+x+"|"+g+")")}return new RegExp(b,fGe(r))}function WM(e,t,r){return e instanceof RegExp?hLr(e,t):Array.isArray(e)?mLr(e,t,r):gLr(e,t,r)}var Fhe=vr(A2()),Ohe=vr(WV()),xm=vr(Ss()),Us=vr(require("fs")),mo=vr(require("path")),b_=vr(require("esbuild"));function dGe(){return`
1268
1268
  async function handleResponse(res, response, passHeaders = {}) {
1269
1269
  const startTime = Date.now();
1270
1270
 
@@ -1034,7 +1034,7 @@ Source:
1034
1034
  await kvModule.exports.bootstrap();
1035
1035
  }
1036
1036
  })();
1037
- `});function Dft(){return'/* EdgeKV Runtime Client - Auto-generated, do not edit */\nvar Y=Object.create;var v=Object.defineProperty;var j=Object.getOwnPropertyDescriptor;var F=Object.getOwnPropertyNames;var Z=Object.getPrototypeOf,X=Object.prototype.hasOwnProperty;var J=(t,r)=>{for(var e in r)v(t,e,{get:r[e],enumerable:!0})},A=(t,r,e,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let o of F(r))!X.call(t,o)&&o!==e&&v(t,o,{get:()=>r[o],enumerable:!(n=j(r,o))||n.enumerable});return t};var W=(t,r,e)=>(e=t!=null?Y(Z(t)):{},A(r||!t||!t.__esModule?v(e,"default",{value:t,enumerable:!0}):e,t)),q=t=>A(v({},"__esModule",{value:!0}),t);var ne={};J(ne,{bootstrap:()=>re,createKVClient:()=>S,getConfigs:()=>M,initKVBindings:()=>z});module.exports=q(ne);var x=W(require("net"));var K=class{static encodeCommand(r){let e=[];e.push(`*${r.length}\\r\n`);for(let n of r){let o=Buffer.byteLength(n,"utf8");e.push("$"+o+`\\r\n`+n+`\\r\n`)}return e.join("")}static encodeCommandBuffer(r){let e=[];e.push(Buffer.from(`*${r.length}\\r\n`));for(let n of r){let o=typeof n=="string"?Buffer.from(n,"utf8"):n;e.push(Buffer.from("$"+o.length+`\\r\n`)),e.push(o),e.push(Buffer.from(`\\r\n`))}return Buffer.concat(e)}},w=class{buffer="";append(r){Buffer.isBuffer(r)?this.buffer+=r.toString("utf8"):this.buffer+=r}get bufferLength(){return this.buffer.length}clear(){this.buffer=""}parse(){if(this.buffer.length===0)return null;let r=this.buffer[0],e=this.buffer.indexOf(`\\r\n`);if(e===-1)return null;let n=this.buffer.substring(1,e);switch(r){case"+":return this.buffer=this.buffer.substring(e+2),{type:"simple_string",value:n};case"-":return this.buffer=this.buffer.substring(e+2),{type:"error",value:n};case":":return this.buffer=this.buffer.substring(e+2),{type:"integer",value:parseInt(n,10)};case"$":return this.parseBulkString(n,e);case"*":return this.parseArray(n,e);default:throw new Error(`Unknown RESP type: ${r}`)}}parseBulkString(r,e){let n=parseInt(r,10);if(n===-1)return this.buffer=this.buffer.substring(e+2),{type:"null",value:null};let o=e+2,f=o+n,a=f+2;if(this.buffer.length<a)return null;let u=this.buffer.substring(o,f);return this.buffer=this.buffer.substring(a),{type:"bulk_string",value:u}}parseArray(r,e){let n=parseInt(r,10);if(n===-1)return this.buffer=this.buffer.substring(e+2),{type:"null",value:null};if(n===0)return this.buffer=this.buffer.substring(e+2),{type:"array",value:[]};let o=this.buffer;this.buffer=this.buffer.substring(e+2);let f=[];for(let a=0;a<n;a++){let u=this.parse();if(u===null)return this.buffer=o,null;f.push(u)}return{type:"array",value:f}}};var R="EO_KV_BINDINGS";var k=/^[a-zA-Z0-9_]+$/;var V=class{socket=null;decoder=new w;responseQueue=[];host;port;timeout;debug;connected=!1;constructor(r){this.host=r.host,this.port=r.port,this.timeout=r.timeout??1e4,this.debug=r.debug??!1}log(r,...e){this.debug&&console.log(`[RespConnection] ${r}`,...e)}connect(){return new Promise((r,e)=>{this.log("Connecting to KV service..."),this.socket=x.createConnection({host:this.host,port:this.port}),this.socket.on("connect",()=>{this.log("TCP connection established"),this.connected=!0,r()}),this.socket.on("data",n=>{this.decoder.append(n),this.processResponses()}),this.socket.on("error",n=>{this.log(`Socket error: ${n.message}`),e(new Error("KV connection failed"))}),this.socket.on("close",n=>{for(this.log(`Connection closed (hadError: ${n}, pending: ${this.responseQueue.length})`),this.connected=!1;this.responseQueue.length>0;){let{reject:o}=this.responseQueue.shift();o(new Error("Connection closed by server"))}}),this.socket.setTimeout(this.timeout,()=>{this.log(`Connection timeout after ${this.timeout}ms`),e(new Error("KV connection timeout"))})})}processResponses(){let r;for(;(r=this.decoder.parse())!==null;)if(this.responseQueue.length>0){let{resolve:e,reject:n}=this.responseQueue.shift();r.type==="error"?n(new Error(r.value)):e(r)}}sendCommand(r){return new Promise((e,n)=>{if(!this.socket||!this.connected){n(new Error("Not connected"));return}let o=K.encodeCommand(r);this.log(`Sending command: ${r[0]} (${o.length} bytes)`),this.responseQueue.push({resolve:e,reject:n}),this.socket.write(o,f=>{f&&this.log(`Write error: ${f.message}`)})})}close(){this.socket&&(this.socket.end(),this.socket=null),this.connected=!1}};function P(t){if(!t||typeof t!="string")throw new Error("Key must be a non-empty string");let r=Buffer.byteLength(t,"utf-8");if(r>512)throw new Error(`Key size exceeds maximum limit of ${512} bytes (got ${r} bytes)`);if(!k.test(t))throw new Error("Key can only contain letters, numbers, and underscores")}function L(t){if(t.length>26214400)throw new Error(`Value size exceeds maximum limit of ${26214400} bytes (${Math.round(26214400/1024/1024)} MB), got ${t.length} bytes`)}async function N(t){if(typeof t=="string")return Buffer.from(t,"utf-8");if(t instanceof ArrayBuffer)return Buffer.from(t);if(ArrayBuffer.isView(t))return Buffer.from(t.buffer,t.byteOffset,t.byteLength);if(typeof ReadableStream<"u"&&t instanceof ReadableStream){let r=[],e=t.getReader();try{for(;;){let{done:a,value:u}=await e.read();if(a)break;r.push(u)}}finally{e.releaseLock()}let n=r.reduce((a,u)=>a+u.length,0),o=new Uint8Array(n),f=0;for(let a of r)o.set(a,f),f+=a.length;return Buffer.from(o)}throw new Error(`Unsupported value type: ${typeof t}`)}function U(t,r){switch(r){case"json":try{return JSON.parse(t.toString("utf-8"))}catch{return t.toString("utf-8")}case"arrayBuffer":return t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength);case"stream":{let e=t;return new ReadableStream({start(n){n.enqueue(new Uint8Array(e)),n.close()}})}case"text":default:return t.toString("utf-8")}}function S(t,r){let e=null,n=null,o=(r==null?void 0:r.debug)??!1,f=`${t.userId}@${t.userKey}`,a=`/${t.namespace}/`,u=(s,...i)=>{o&&console.log(`[KVClient] ${s}`,...i)},m=s=>a+s,C=s=>s.startsWith(a)?s.substring(a.length):s,D=async s=>{u("Authenticating...");let i=await s.sendCommand(["AUTH",f]);if(i.type==="simple_string"&&i.value==="OK")u("Authentication successful");else throw new Error("Authentication failed")},Q=async s=>{u("Selecting namespace...");let i=await s.sendCommand(["SELECT",t.namespace]);if(i.type==="simple_string"&&i.value==="OK")u("Namespace selected");else throw new Error("Namespace selection failed")},b=async()=>{if(e&&!e.connected&&(e=null,n=null),e&&e.connected)return e;if(n){if(await n,e&&e.connected)return e;e=null,n=null}let s=typeof t.servicePort=="string"?parseInt(t.servicePort,10):t.servicePort;return e=new V({host:t.serviceName,port:s,timeout:r==null?void 0:r.timeout,debug:o}),n=(async()=>{try{await e.connect(),await D(e),await Q(e)}catch(i){throw e==null||e.close(),e=null,n=null,i}})(),await n,e},G=s=>{if(s.type==="null")return null;if(s.type==="array"&&Array.isArray(s.value)){let i=s.value;if(i.length>0){let l=i[0];return l.type==="null"?null:Buffer.from(l.value,"utf-8")}return null}return s.type==="bulk_string"?Buffer.from(s.value,"utf-8"):null};return{async get(s,i){let l=await b(),c=m(s);u(`GET: ${c}`);let h=await l.sendCommand(["oget",c]),p=G(h);if(p===null)return null;let g=typeof i=="string"?i:(i==null?void 0:i.type)??"text";return U(p,g)},async put(s,i){P(s);let l=await b(),c=m(s),h=await N(i);L(h);let p=h.toString("utf-8");u(`PUT: ${c} = ${p.substring(0,100)}${p.length>100?"...":""}`);let g=["oset",c,p],d=await l.sendCommand(g);if(d.type!=="simple_string"||d.value!=="OK")throw new Error("PUT operation failed")},async delete(s){let i=await b(),l=m(s);u(`DELETE: ${l}`);let c=await i.sendCommand(["odel",l]);if(c.type==="error")throw new Error(`DELETE failed: ${c.value}`);u(`DELETE response: type=${c.type}, value=${c.value}`)},async list(s){var d,T,_;let i=await b(),l=(s==null?void 0:s.prefix)??"",c=(s==null?void 0:s.limit)??10,h=m(l);u(`LIST: ${h}, limit: ${c}`);let p=["list",h,"count",c.toString()];s!=null&&s.cursor&&p.push("cursor",m(s.cursor));let g=await i.sendCommand(p);if(g.type==="array"&&Array.isArray(g.value)){let y=g.value;if(y.length>=2){let $={cursor:C(((d=y[0])==null?void 0:d.value)||"")||void 0,complete:(((T=y[1])==null?void 0:T.value)||"").toLowerCase()==="true",keys:[]};for(let E=2;E+3<=y.length;E+=3){let O={key:C(((_=y[E])==null?void 0:_.value)||"")};$.keys.push(O)}return $}}return{keys:[],complete:!0}}}}function M(){let t=process.env[R];if(!t)return[];delete process.env[R];try{return JSON.parse(t)}catch{try{let r=Buffer.from(t,"base64").toString("utf-8");return JSON.parse(r)}catch{return[]}}}function z(t){for(let r of t)globalThis[r.name]=S(r)}function re(){try{let t=M();t&&t.length>0&&(z(t),console.log(`[cli] Initialized ${t.length} KV binding(s)`))}catch{console.error("[cli] Initialization failed")}}0&&(module.exports={bootstrap,createKVClient,getConfigs,initKVBindings});\n'}function wR(){let t=Dft();return mse.replace("{{KV_CLIENT_BUNDLE}}",t)}var zC,gse,vse=mt(()=>{zC=kr(require("fs")),gse=kr(require("path"));yse()});var xse=mt(()=>{uX();_v();dse();$C();ER();_R();hse();TR();vse()});function Cft(t){for(var e=[],n=0;n<t.length;){var o=t[n];if(o==="*"||o==="+"||o==="?"){e.push({type:"MODIFIER",index:n,value:t[n++]});continue}if(o==="\\"){e.push({type:"ESCAPED_CHAR",index:n++,value:t[n++]});continue}if(o==="{"){e.push({type:"OPEN",index:n,value:t[n++]});continue}if(o==="}"){e.push({type:"CLOSE",index:n,value:t[n++]});continue}if(o===":"){for(var u="",r=n+1;r<t.length;){var f=t.charCodeAt(r);if(f>=48&&f<=57||f>=65&&f<=90||f>=97&&f<=122||f===95){u+=t[r++];continue}break}if(!u)throw new TypeError("Missing parameter name at "+n);e.push({type:"NAME",index:n,value:u}),n=r;continue}if(o==="("){var h=1,x="",r=n+1;if(t[r]==="?")throw new TypeError('Pattern cannot start with "?" at '+r);for(;r<t.length;){if(t[r]==="\\"){x+=t[r++]+t[r++];continue}if(t[r]===")"){if(h--,h===0){r++;break}}else if(t[r]==="("&&(h++,t[r+1]!=="?"))throw new TypeError("Capturing groups are not allowed at "+r);x+=t[r++]}if(h)throw new TypeError("Unbalanced pattern at "+n);if(!x)throw new TypeError("Missing pattern at "+n);e.push({type:"PATTERN",index:n,value:x}),n=r;continue}e.push({type:"CHAR",index:n,value:t[n++]})}return e.push({type:"END",index:n,value:""}),e}function Pft(t,e){e===void 0&&(e={});for(var n=Cft(t),o=e.prefixes,u=o===void 0?"./":o,r="[^"+Hv(e.delimiter||"/#?")+"]+?",f=[],h=0,x=0,y="",E=function(Le){if(x<n.length&&n[x].type===Le)return n[x++].value},P=function(Le){var Ye=E(Le);if(Ye!==void 0)return Ye;var lt=n[x],He=lt.type,qt=lt.index;throw new TypeError("Unexpected "+He+" at "+qt+", expected "+Le)},N=function(){for(var Le="",Ye;Ye=E("CHAR")||E("ESCAPED_CHAR");)Le+=Ye;return Le};x<n.length;){var B=E("CHAR"),g=E("NAME"),K=E("PATTERN");if(g||K){var $=B||"";u.indexOf($)===-1&&(y+=$,$=""),y&&(f.push(y),y=""),f.push({name:g||h++,prefix:$,suffix:"",pattern:K||r,modifier:E("MODIFIER")||""});continue}var H=B||E("ESCAPED_CHAR");if(H){y+=H;continue}y&&(f.push(y),y="");var re=E("OPEN");if(re){var $=N(),Ee=E("NAME")||"",me=E("PATTERN")||"",Pe=N();P("CLOSE"),f.push({name:Ee||(me?h++:""),pattern:Ee&&!me?r:me,prefix:$,suffix:Pe,modifier:E("MODIFIER")||""});continue}P("END")}return f}function Hv(t){return t.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1")}function Sse(t){return t&&t.sensitive?"":"i"}function Aft(t,e){if(!e)return t;var n=t.source.match(/\((?!\?)/g);if(n)for(var o=0;o<n.length;o++)e.push({name:o,prefix:"",suffix:"",modifier:"",pattern:""});return t}function kft(t,e,n){var o=t.map(function(u){return bT(u,e,n).source});return new RegExp("(?:"+o.join("|")+")",Sse(n))}function Ift(t,e,n){return Oft(Pft(t,n),e,n)}function Oft(t,e,n){n===void 0&&(n={});for(var o=n.strict,u=o===void 0?!1:o,r=n.start,f=r===void 0?!0:r,h=n.end,x=h===void 0?!0:h,y=n.encode,E=y===void 0?function(Le){return Le}:y,P="["+Hv(n.endsWith||"")+"]|$",N="["+Hv(n.delimiter||"/#?")+"]",B=f?"^":"",g=0,K=t;g<K.length;g++){var $=K[g];if(typeof $=="string")B+=Hv(E($));else{var H=Hv(E($.prefix)),re=Hv(E($.suffix));if($.pattern)if(e&&e.push($),H||re)if($.modifier==="+"||$.modifier==="*"){var Ee=$.modifier==="*"?"?":"";B+="(?:"+H+"((?:"+$.pattern+")(?:"+re+H+"(?:"+$.pattern+"))*)"+re+")"+Ee}else B+="(?:"+H+"("+$.pattern+")"+re+")"+$.modifier;else B+="("+$.pattern+")"+$.modifier;else B+="(?:"+H+re+")"+$.modifier}}if(x)u||(B+=N+"?"),B+=n.endsWith?"(?="+P+")":"$";else{var me=t[t.length-1],Pe=typeof me=="string"?N.indexOf(me[me.length-1])>-1:me===void 0;u||(B+="(?:"+N+"(?="+P+"))?"),Pe||(B+="(?="+N+"|"+P+")")}return new RegExp(B,Sse(n))}function bT(t,e,n){return t instanceof RegExp?Aft(t,e):Array.isArray(t)?kft(t,e,n):Ift(t,e,n)}var bR=mt(()=>{});function Ese(){return`
1037
+ `});function Dft(){return'/* EdgeKV Runtime Client - Auto-generated, do not edit */\nvar O=Object.create;var v=Object.defineProperty;var Y=Object.getOwnPropertyDescriptor;var F=Object.getOwnPropertyNames;var Z=Object.getPrototypeOf,X=Object.prototype.hasOwnProperty;var J=(r,e)=>{for(var t in e)v(r,t,{get:e[t],enumerable:!0})},x=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of F(e))!X.call(r,o)&&o!==t&&v(r,o,{get:()=>e[o],enumerable:!(n=Y(e,o))||n.enumerable});return r};var W=(r,e,t)=>(t=r!=null?O(Z(r)):{},x(e||!r||!r.__esModule?v(t,"default",{value:r,enumerable:!0}):t,r)),q=r=>x(v({},"__esModule",{value:!0}),r);var ne={};J(ne,{bootstrap:()=>re,createKVClient:()=>S,getConfigs:()=>M,initKVBindings:()=>z});module.exports=q(ne);var k=W(require("net"));var K=class{static encodeCommand(e){let t=[];t.push(`*${e.length}\\r\n`);for(let n of e){let o=Buffer.byteLength(n,"utf8");t.push("$"+o+`\\r\n`+n+`\\r\n`)}return t.join("")}static encodeCommandBuffer(e){let t=[];t.push(Buffer.from(`*${e.length}\\r\n`));for(let n of e){let o=typeof n=="string"?Buffer.from(n,"utf8"):n;t.push(Buffer.from("$"+o.length+`\\r\n`)),t.push(o),t.push(Buffer.from(`\\r\n`))}return Buffer.concat(t)}},w=class{buffer="";append(e){Buffer.isBuffer(e)?this.buffer+=e.toString("utf8"):this.buffer+=e}get bufferLength(){return this.buffer.length}clear(){this.buffer=""}parse(){var o;if(this.buffer.length===0)return null;let e=this.buffer[0],t=this.buffer.indexOf(`\\r\n`);if(t===-1)return null;let n=this.buffer.substring(1,t);switch(e){case"+":return this.buffer=this.buffer.substring(t+2),{type:"simple_string",value:n};case"-":return this.buffer=this.buffer.substring(t+2),{type:"error",value:n};case":":return this.buffer=this.buffer.substring(t+2),{type:"integer",value:parseInt(n,10)};case"$":return this.parseBulkString(n,t);case"*":return this.parseArray(n,t);default:{let f=e.charCodeAt(0),a=this.buffer.substring(0,100).replace(/\\r/g,"\\\\r").replace(/\\n/g,"\\\\n").replace(/\\t/g,"\\\\t"),u=((o=Buffer.from(this.buffer.substring(0,20)).toString("hex").match(/.{1,2}/g))==null?void 0:o.join(" "))||"";throw new Error(`Unknown RESP type: \'${e}\' (char code: ${f}, hex: 0x${f.toString(16)})\nBuffer length: ${this.buffer.length}\nBuffer preview (first 100 chars): ${a}\nBuffer hex (first 20 bytes): ${u}`)}}}parseBulkString(e,t){let n=parseInt(e,10);if(n===-1)return this.buffer=this.buffer.substring(t+2),{type:"null",value:null};let o=t+2,f=o+n,a=f+2;if(this.buffer.length<a)return null;let u=this.buffer.substring(o,f);return this.buffer=this.buffer.substring(a),{type:"bulk_string",value:u}}parseArray(e,t){let n=parseInt(e,10);if(n===-1)return this.buffer=this.buffer.substring(t+2),{type:"null",value:null};if(n===0)return this.buffer=this.buffer.substring(t+2),{type:"array",value:[]};let o=this.buffer;this.buffer=this.buffer.substring(t+2);let f=[];for(let a=0;a<n;a++){let u=this.parse();if(u===null)return this.buffer=o,null;f.push(u)}return{type:"array",value:f}}};var R="EO_KV_BINDINGS";var A=/^[a-zA-Z0-9_]+$/;var V=class{socket=null;decoder=new w;responseQueue=[];host;port;timeout;debug;connected=!1;constructor(e){this.host=e.host,this.port=e.port,this.timeout=e.timeout??1e4,this.debug=e.debug??!1}log(e,...t){this.debug&&console.log(`[RespConnection] ${e}`,...t)}connect(){return new Promise((e,t)=>{this.log("Connecting to KV service..."),this.socket=k.createConnection({host:this.host,port:this.port}),this.socket.on("connect",()=>{this.log("TCP connection established"),this.connected=!0,e()}),this.socket.on("data",n=>{this.decoder.append(n),this.processResponses()}),this.socket.on("error",n=>{this.log(`Socket error: ${n.message}`),t(new Error("KV connection failed"))}),this.socket.on("close",n=>{for(this.log(`Connection closed (hadError: ${n}, pending: ${this.responseQueue.length})`),this.connected=!1;this.responseQueue.length>0;){let{reject:o}=this.responseQueue.shift();o(new Error("Connection closed by server"))}}),this.socket.setTimeout(this.timeout,()=>{this.log(`Connection timeout after ${this.timeout}ms`),t(new Error("KV connection timeout"))})})}processResponses(){let e;for(;(e=this.decoder.parse())!==null;)if(this.responseQueue.length>0){let{resolve:t,reject:n}=this.responseQueue.shift();e.type==="error"?n(new Error(e.value)):t(e)}}sendCommand(e){return new Promise((t,n)=>{if(!this.socket||!this.connected){n(new Error("Not connected"));return}let o=K.encodeCommand(e);this.log(`Sending command: ${e[0]} (${o.length} bytes)`),this.responseQueue.push({resolve:t,reject:n}),this.socket.write(o,f=>{f&&this.log(`Write error: ${f.message}`)})})}close(){this.socket&&(this.socket.end(),this.socket=null),this.connected=!1}};function I(r){if(!r||typeof r!="string")throw new Error("Key must be a non-empty string");let e=Buffer.byteLength(r,"utf-8");if(e>512)throw new Error(`Key size exceeds maximum limit of ${512} bytes (got ${e} bytes)`);if(!A.test(r))throw new Error("Key can only contain letters, numbers, and underscores")}function L(r){if(r.length>26214400)throw new Error(`Value size exceeds maximum limit of ${26214400} bytes (${Math.round(26214400/1024/1024)} MB), got ${r.length} bytes`)}async function N(r){if(typeof r=="string")return Buffer.from(r,"utf-8");if(r instanceof ArrayBuffer)return Buffer.from(r);if(ArrayBuffer.isView(r))return Buffer.from(r.buffer,r.byteOffset,r.byteLength);if(typeof ReadableStream<"u"&&r instanceof ReadableStream){let e=[],t=r.getReader();try{for(;;){let{done:a,value:u}=await t.read();if(a)break;e.push(u)}}finally{t.releaseLock()}let n=e.reduce((a,u)=>a+u.length,0),o=new Uint8Array(n),f=0;for(let a of e)o.set(a,f),f+=a.length;return Buffer.from(o)}throw new Error(`Unsupported value type: ${typeof r}`)}function U(r,e){switch(e){case"json":try{return JSON.parse(r.toString("utf-8"))}catch{return r.toString("utf-8")}case"arrayBuffer":return r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength);case"stream":{let t=r;return new ReadableStream({start(n){n.enqueue(new Uint8Array(t)),n.close()}})}case"text":default:return r.toString("utf-8")}}function S(r,e){let t=null,n=null,o=(e==null?void 0:e.debug)??!1,f=`${r.userId}@${r.userKey}`,a=`/${r.namespace}/`,u=(s,...i)=>{o&&console.log(`[KVClient] ${s}`,...i)},m=s=>a+s,C=s=>s.startsWith(a)?s.substring(a.length):s,D=async s=>{u("Authenticating...");let i=await s.sendCommand(["AUTH",f]);if(i.type==="simple_string"&&i.value==="OK")u("Authentication successful");else throw new Error("Authentication failed")},Q=async s=>{u("Selecting namespace...");let i=await s.sendCommand(["SELECT",r.namespace]);if(i.type==="simple_string"&&i.value==="OK")u("Namespace selected");else throw new Error("Namespace selection failed")},b=async()=>{if(t&&!t.connected&&(t=null,n=null),t&&t.connected)return t;if(n){if(await n,t&&t.connected)return t;t=null,n=null}let s=typeof r.servicePort=="string"?parseInt(r.servicePort,10):r.servicePort;return t=new V({host:r.serviceName,port:s,timeout:e==null?void 0:e.timeout,debug:o}),n=(async()=>{try{await t.connect(),await D(t),await Q(t)}catch(i){throw t==null||t.close(),t=null,n=null,i}})(),await n,t},j=s=>{if(s.type==="null")return null;if(s.type==="array"&&Array.isArray(s.value)){let i=s.value;if(i.length>0){let l=i[0];return l.type==="null"?null:Buffer.from(l.value,"utf-8")}return null}return s.type==="bulk_string"?Buffer.from(s.value,"utf-8"):null};return{async get(s,i){let l=await b(),c=m(s);u(`GET: ${c}`);let h=await l.sendCommand(["oget",c]),p=j(h);if(p===null)return null;let g=typeof i=="string"?i:(i==null?void 0:i.type)??"text";return U(p,g)},async put(s,i){I(s);let l=await b(),c=m(s),h=await N(i);L(h);let p=h.toString("utf-8");u(`PUT: ${c} = ${p.substring(0,100)}${p.length>100?"...":""}`);let g=["oset",c,p],d=await l.sendCommand(g);if(d.type!=="simple_string"||d.value!=="OK")throw new Error("PUT operation failed")},async delete(s){let i=await b(),l=m(s);u(`DELETE: ${l}`);let c=await i.sendCommand(["odel",l]);if(c.type==="error")throw new Error(`DELETE failed: ${c.value}`);u(`DELETE response: type=${c.type}, value=${c.value}`)},async list(s){var d,$,T;let i=await b(),l=(s==null?void 0:s.prefix)??"",c=(s==null?void 0:s.limit)??10,h=m(l);u(`LIST: ${h}, limit: ${c}`);let p=["list",h,"count",c.toString()];s!=null&&s.cursor&&p.push("cursor",m(s.cursor));let g=await i.sendCommand(p);if(g.type==="array"&&Array.isArray(g.value)){let y=g.value;if(y.length>=2){let _={cursor:C(((d=y[0])==null?void 0:d.value)||"")||void 0,complete:((($=y[1])==null?void 0:$.value)||"").toLowerCase()==="true",keys:[]};for(let E=2;E+3<=y.length;E+=3){let G={key:C(((T=y[E])==null?void 0:T.value)||"")};_.keys.push(G)}return _}}return{keys:[],complete:!0}}}}function M(){let r=process.env[R];if(!r)return[];delete process.env[R];try{return JSON.parse(r)}catch{try{let e=Buffer.from(r,"base64").toString("utf-8");return JSON.parse(e)}catch{return[]}}}function z(r){for(let e of r)globalThis[e.name]=S(e)}function re(){try{let r=M();r&&r.length>0&&(z(r),console.log(`[cli] Initialized ${r.length} KV binding(s)`))}catch{console.error("[cli] Initialization failed")}}0&&(module.exports={bootstrap,createKVClient,getConfigs,initKVBindings});\n'}function wR(){let t=Dft();return mse.replace("{{KV_CLIENT_BUNDLE}}",t)}var zC,gse,vse=mt(()=>{zC=kr(require("fs")),gse=kr(require("path"));yse()});var xse=mt(()=>{uX();_v();dse();$C();ER();_R();hse();TR();vse()});function Cft(t){for(var e=[],n=0;n<t.length;){var o=t[n];if(o==="*"||o==="+"||o==="?"){e.push({type:"MODIFIER",index:n,value:t[n++]});continue}if(o==="\\"){e.push({type:"ESCAPED_CHAR",index:n++,value:t[n++]});continue}if(o==="{"){e.push({type:"OPEN",index:n,value:t[n++]});continue}if(o==="}"){e.push({type:"CLOSE",index:n,value:t[n++]});continue}if(o===":"){for(var u="",r=n+1;r<t.length;){var f=t.charCodeAt(r);if(f>=48&&f<=57||f>=65&&f<=90||f>=97&&f<=122||f===95){u+=t[r++];continue}break}if(!u)throw new TypeError("Missing parameter name at "+n);e.push({type:"NAME",index:n,value:u}),n=r;continue}if(o==="("){var h=1,x="",r=n+1;if(t[r]==="?")throw new TypeError('Pattern cannot start with "?" at '+r);for(;r<t.length;){if(t[r]==="\\"){x+=t[r++]+t[r++];continue}if(t[r]===")"){if(h--,h===0){r++;break}}else if(t[r]==="("&&(h++,t[r+1]!=="?"))throw new TypeError("Capturing groups are not allowed at "+r);x+=t[r++]}if(h)throw new TypeError("Unbalanced pattern at "+n);if(!x)throw new TypeError("Missing pattern at "+n);e.push({type:"PATTERN",index:n,value:x}),n=r;continue}e.push({type:"CHAR",index:n,value:t[n++]})}return e.push({type:"END",index:n,value:""}),e}function Pft(t,e){e===void 0&&(e={});for(var n=Cft(t),o=e.prefixes,u=o===void 0?"./":o,r="[^"+Hv(e.delimiter||"/#?")+"]+?",f=[],h=0,x=0,y="",E=function(Le){if(x<n.length&&n[x].type===Le)return n[x++].value},P=function(Le){var Ye=E(Le);if(Ye!==void 0)return Ye;var lt=n[x],He=lt.type,qt=lt.index;throw new TypeError("Unexpected "+He+" at "+qt+", expected "+Le)},N=function(){for(var Le="",Ye;Ye=E("CHAR")||E("ESCAPED_CHAR");)Le+=Ye;return Le};x<n.length;){var B=E("CHAR"),g=E("NAME"),K=E("PATTERN");if(g||K){var $=B||"";u.indexOf($)===-1&&(y+=$,$=""),y&&(f.push(y),y=""),f.push({name:g||h++,prefix:$,suffix:"",pattern:K||r,modifier:E("MODIFIER")||""});continue}var H=B||E("ESCAPED_CHAR");if(H){y+=H;continue}y&&(f.push(y),y="");var re=E("OPEN");if(re){var $=N(),Ee=E("NAME")||"",me=E("PATTERN")||"",Pe=N();P("CLOSE"),f.push({name:Ee||(me?h++:""),pattern:Ee&&!me?r:me,prefix:$,suffix:Pe,modifier:E("MODIFIER")||""});continue}P("END")}return f}function Hv(t){return t.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1")}function Sse(t){return t&&t.sensitive?"":"i"}function Aft(t,e){if(!e)return t;var n=t.source.match(/\((?!\?)/g);if(n)for(var o=0;o<n.length;o++)e.push({name:o,prefix:"",suffix:"",modifier:"",pattern:""});return t}function kft(t,e,n){var o=t.map(function(u){return bT(u,e,n).source});return new RegExp("(?:"+o.join("|")+")",Sse(n))}function Ift(t,e,n){return Oft(Pft(t,n),e,n)}function Oft(t,e,n){n===void 0&&(n={});for(var o=n.strict,u=o===void 0?!1:o,r=n.start,f=r===void 0?!0:r,h=n.end,x=h===void 0?!0:h,y=n.encode,E=y===void 0?function(Le){return Le}:y,P="["+Hv(n.endsWith||"")+"]|$",N="["+Hv(n.delimiter||"/#?")+"]",B=f?"^":"",g=0,K=t;g<K.length;g++){var $=K[g];if(typeof $=="string")B+=Hv(E($));else{var H=Hv(E($.prefix)),re=Hv(E($.suffix));if($.pattern)if(e&&e.push($),H||re)if($.modifier==="+"||$.modifier==="*"){var Ee=$.modifier==="*"?"?":"";B+="(?:"+H+"((?:"+$.pattern+")(?:"+re+H+"(?:"+$.pattern+"))*)"+re+")"+Ee}else B+="(?:"+H+"("+$.pattern+")"+re+")"+$.modifier;else B+="("+$.pattern+")"+$.modifier;else B+="(?:"+H+re+")"+$.modifier}}if(x)u||(B+=N+"?"),B+=n.endsWith?"(?="+P+")":"$";else{var me=t[t.length-1],Pe=typeof me=="string"?N.indexOf(me[me.length-1])>-1:me===void 0;u||(B+="(?:"+N+"(?="+P+"))?"),Pe||(B+="(?="+N+"|"+P+")")}return new RegExp(B,Sse(n))}function bT(t,e,n){return t instanceof RegExp?Aft(t,e):Array.isArray(t)?kft(t,e,n):Ift(t,e,n)}var bR=mt(()=>{});function Ese(){return`
1038
1038
  async function handleResponse(res, response, passHeaders = {}) {
1039
1039
  const startTime = Date.now();
1040
1040
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "edgeone",
3
- "version": "1.2.29-beta.1",
3
+ "version": "1.2.29-beta.2",
4
4
  "description": "Command-line interface for TencentCloud Pages Functions",
5
5
  "bin": {
6
6
  "edgeone": "./edgeone-bin/edgeone.js"