coding-tool-x 3.6.4 → 3.6.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/web/assets/{Analytics-BTmqXkR-.js → Analytics-CcGKjDkP.js} +1 -1
- package/dist/web/assets/{ConfigTemplates-z3w0kyNl.js → ConfigTemplates-DPOa1w5D.js} +1 -1
- package/dist/web/assets/{Home-DU-NVre0.js → Home-BP1LxGtp.js} +1 -1
- package/dist/web/assets/{PluginManager-44r9LaWV.js → PluginManager-BVbHUdey.js} +1 -1
- package/dist/web/assets/{ProjectList-DW_MEKRy.js → ProjectList-BQrz2FKo.js} +1 -1
- package/dist/web/assets/SessionList-CRGer64T.js +1 -0
- package/dist/web/assets/{SkillManager-DnzRfF_o.js → SkillManager-BhJKtWYM.js} +1 -1
- package/dist/web/assets/{WorkspaceManager-BuRpVJRU.js → WorkspaceManager-pc6tpF3m.js} +1 -1
- package/dist/web/assets/{icons-U50_Cfbe.js → icons-QFXzEgqM.js} +1 -1
- package/dist/web/assets/index-0isNzXNY.css +1 -0
- package/dist/web/assets/index-BsdIJwLf.js +2 -0
- package/dist/web/assets/{naive-ui-Cjh6GLto.js → naive-ui-DM897mIP.js} +1 -1
- package/dist/web/assets/{vendors--KP7Ux0s.js → vendors-DQA4Hw9v.js} +1 -1
- package/dist/web/assets/{vue-vendor-C5aMkRmm.js → vue-vendor-B5RqjEjQ.js} +1 -1
- package/dist/web/index.html +6 -6
- package/package.json +1 -1
- package/src/commands/daemon.js +13 -4
- package/src/server/api/channels.js +4 -2
- package/src/server/api/codex-channels.js +3 -1
- package/src/server/api/codex-sessions.js +24 -1
- package/src/server/api/gemini-channels.js +4 -2
- package/src/server/api/opencode-channels.js +4 -2
- package/src/server/services/channel-balance.js +97 -9
- package/src/server/services/gemini-channels.js +8 -0
- package/src/server/services/opencode-channels.js +6 -0
- package/dist/web/assets/SessionList-B8upyqsp.js +0 -1
- package/dist/web/assets/index-BkLQex1R.css +0 -1
- package/dist/web/assets/index-gIbIMdSO.js +0 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{g as t,a as e,c as n}from"./markdown-BNJfEgCA.js";import{S as r}from"./vue-vendor-C5aMkRmm.js";function o(t,e){return function(){return t.apply(e,arguments)}}const{toString:i}=Object.prototype,{getPrototypeOf:a}=Object,{iterator:s,toStringTag:c}=Symbol,l=(t=>e=>{const n=i.call(e);return t[n]||(t[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),u=t=>(t=t.toLowerCase(),e=>l(e)===t),f=t=>e=>typeof e===t,{isArray:d}=Array,p=f("undefined");function h(t){return null!==t&&!p(t)&&null!==t.constructor&&!p(t.constructor)&&v(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const g=u("ArrayBuffer");const m=f("string"),v=f("function"),b=f("number"),y=t=>null!==t&&"object"==typeof t,w=t=>{if("object"!==l(t))return!1;const e=a(t);return!(null!==e&&e!==Object.prototype&&null!==Object.getPrototypeOf(e)||c in t||s in t)},E=u("Date"),S=u("File"),x=u("Blob"),O=u("FileList");const _="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},T=void 0!==_.FormData?_.FormData:void 0,A=u("URLSearchParams"),[C,D,R,P]=["ReadableStream","Request","Response","Headers"].map(u);function j(t,e,{allOwnKeys:n=!1}={}){if(null==t)return;let r,o;if("object"!=typeof t&&(t=[t]),d(t))for(r=0,o=t.length;r<o;r++)e.call(null,t[r],r,t);else{if(h(t))return;const o=n?Object.getOwnPropertyNames(t):Object.keys(t),i=o.length;let a;for(r=0;r<i;r++)a=o[r],e.call(null,t[a],a,t)}}function N(t,e){if(h(t))return null;e=e.toLowerCase();const n=Object.keys(t);let r,o=n.length;for(;o-- >0;)if(r=n[o],e===r.toLowerCase())return r;return null}const I="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,M=t=>!p(t)&&t!==I;const k=(t=>e=>t&&e instanceof t)("undefined"!=typeof Uint8Array&&a(Uint8Array)),L=u("HTMLFormElement"),F=(({hasOwnProperty:t})=>(e,n)=>t.call(e,n))(Object.prototype),U=u("RegExp"),B=(t,e)=>{const n=Object.getOwnPropertyDescriptors(t),r={};j(n,(n,o)=>{let i;!1!==(i=e(n,o,t))&&(r[o]=i||n)}),Object.defineProperties(t,r)};const q=u("AsyncFunction"),$=(H="function"==typeof setImmediate,X=v(I.postMessage),H?setImmediate:X?(V=`axios@${Math.random()}`,W=[],I.addEventListener("message",({source:t,data:e})=>{t===I&&e===V&&W.length&&W.shift()()},!1),t=>{W.push(t),I.postMessage(V,"*")}):t=>setTimeout(t));var H,X,V,W;const z="undefined"!=typeof queueMicrotask?queueMicrotask.bind(I):"undefined"!=typeof process&&process.nextTick||$,K={isArray:d,isArrayBuffer:g,isBuffer:h,isFormData:t=>{let e;return t&&(T&&t instanceof T||v(t.append)&&("formdata"===(e=l(t))||"object"===e&&v(t.toString)&&"[object FormData]"===t.toString()))},isArrayBufferView:function(t){let e;return e="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&g(t.buffer),e},isString:m,isNumber:b,isBoolean:t=>!0===t||!1===t,isObject:y,isPlainObject:w,isEmptyObject:t=>{if(!y(t)||h(t))return!1;try{return 0===Object.keys(t).length&&Object.getPrototypeOf(t)===Object.prototype}catch(e){return!1}},isReadableStream:C,isRequest:D,isResponse:R,isHeaders:P,isUndefined:p,isDate:E,isFile:S,isReactNativeBlob:t=>!(!t||void 0===t.uri),isReactNative:t=>t&&void 0!==t.getParts,isBlob:x,isRegExp:U,isFunction:v,isStream:t=>y(t)&&v(t.pipe),isURLSearchParams:A,isTypedArray:k,isFileList:O,forEach:j,merge:function t(){const{caseless:e,skipUndefined:n}=M(this)&&this||{},r={},o=(o,i)=>{if("__proto__"===i||"constructor"===i||"prototype"===i)return;const a=e&&N(r,i)||i;w(r[a])&&w(o)?r[a]=t(r[a],o):w(o)?r[a]=t({},o):d(o)?r[a]=o.slice():n&&p(o)||(r[a]=o)};for(let i=0,a=arguments.length;i<a;i++)arguments[i]&&j(arguments[i],o);return r},extend:(t,e,n,{allOwnKeys:r}={})=>(j(e,(e,r)=>{n&&v(e)?Object.defineProperty(t,r,{value:o(e,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(t,r,{value:e,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:r}),t),trim:t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:t=>(65279===t.charCodeAt(0)&&(t=t.slice(1)),t),inherits:(t,e,n,r)=>{t.prototype=Object.create(e.prototype,r),Object.defineProperty(t.prototype,"constructor",{value:t,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(t,"super",{value:e.prototype}),n&&Object.assign(t.prototype,n)},toFlatObject:(t,e,n,r)=>{let o,i,s;const c={};if(e=e||{},null==t)return e;do{for(o=Object.getOwnPropertyNames(t),i=o.length;i-- >0;)s=o[i],r&&!r(s,t,e)||c[s]||(e[s]=t[s],c[s]=!0);t=!1!==n&&a(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e},kindOf:l,kindOfTest:u,endsWith:(t,e,n)=>{t=String(t),(void 0===n||n>t.length)&&(n=t.length),n-=e.length;const r=t.indexOf(e,n);return-1!==r&&r===n},toArray:t=>{if(!t)return null;if(d(t))return t;let e=t.length;if(!b(e))return null;const n=new Array(e);for(;e-- >0;)n[e]=t[e];return n},forEachEntry:(t,e)=>{const n=(t&&t[s]).call(t);let r;for(;(r=n.next())&&!r.done;){const n=r.value;e.call(t,n[0],n[1])}},matchAll:(t,e)=>{let n;const r=[];for(;null!==(n=t.exec(e));)r.push(n);return r},isHTMLForm:L,hasOwnProperty:F,hasOwnProp:F,reduceDescriptors:B,freezeMethods:t=>{B(t,(e,n)=>{if(v(t)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=t[n];v(r)&&(e.enumerable=!1,"writable"in e?e.writable=!1:e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))})},toObjectSet:(t,e)=>{const n={},r=t=>{t.forEach(t=>{n[t]=!0})};return d(t)?r(t):r(String(t).split(e)),n},toCamelCase:t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(t,e,n){return e.toUpperCase()+n}),noop:()=>{},toFiniteNumber:(t,e)=>null!=t&&Number.isFinite(t=+t)?t:e,findKey:N,global:I,isContextDefined:M,isSpecCompliantForm:function(t){return!!(t&&v(t.append)&&"FormData"===t[c]&&t[s])},toJSONObject:t=>{const e=new Array(10),n=(t,r)=>{if(y(t)){if(e.indexOf(t)>=0)return;if(h(t))return t;if(!("toJSON"in t)){e[r]=t;const o=d(t)?[]:{};return j(t,(t,e)=>{const i=n(t,r+1);!p(i)&&(o[e]=i)}),e[r]=void 0,o}}return t};return n(t,0)},isAsyncFn:q,isThenable:t=>t&&(y(t)||v(t))&&v(t.then)&&v(t.catch),setImmediate:$,asap:z,isIterable:t=>null!=t&&v(t[s])};let Y=class t extends Error{static from(e,n,r,o,i,a){const s=new t(e.message,n||e.code,r,o,i);return s.cause=e,s.name=e.name,null!=e.status&&null==s.status&&(s.status=e.status),a&&Object.assign(s,a),s}constructor(t,e,n,r,o){super(t),Object.defineProperty(this,"message",{value:t,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,e&&(this.code=e),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o,this.status=o.status)}toJSON(){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:K.toJSONObject(this.config),code:this.code,status:this.status}}};Y.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",Y.ERR_BAD_OPTION="ERR_BAD_OPTION",Y.ECONNABORTED="ECONNABORTED",Y.ETIMEDOUT="ETIMEDOUT",Y.ERR_NETWORK="ERR_NETWORK",Y.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",Y.ERR_DEPRECATED="ERR_DEPRECATED",Y.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",Y.ERR_BAD_REQUEST="ERR_BAD_REQUEST",Y.ERR_CANCELED="ERR_CANCELED",Y.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",Y.ERR_INVALID_URL="ERR_INVALID_URL";function G(t){return K.isPlainObject(t)||K.isArray(t)}function J(t){return K.endsWith(t,"[]")?t.slice(0,-2):t}function Q(t,e,n){return t?t.concat(e).map(function(t,e){return t=J(t),!n&&e?"["+t+"]":t}).join(n?".":""):e}const Z=K.toFlatObject(K,{},null,function(t){return/^is[A-Z]/.test(t)});function tt(t,e,n){if(!K.isObject(t))throw new TypeError("target must be an object");e=e||new FormData;const r=(n=K.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(t,e){return!K.isUndefined(e[t])})).metaTokens,o=n.visitor||l,i=n.dots,a=n.indexes,s=(n.Blob||"undefined"!=typeof Blob&&Blob)&&K.isSpecCompliantForm(e);if(!K.isFunction(o))throw new TypeError("visitor must be a function");function c(t){if(null===t)return"";if(K.isDate(t))return t.toISOString();if(K.isBoolean(t))return t.toString();if(!s&&K.isBlob(t))throw new Y("Blob is not supported. Use a Buffer instead.");return K.isArrayBuffer(t)||K.isTypedArray(t)?s&&"function"==typeof Blob?new Blob([t]):Buffer.from(t):t}function l(t,n,o){let s=t;if(K.isReactNative(e)&&K.isReactNativeBlob(t))return e.append(Q(o,n,i),c(t)),!1;if(t&&!o&&"object"==typeof t)if(K.endsWith(n,"{}"))n=r?n:n.slice(0,-2),t=JSON.stringify(t);else if(K.isArray(t)&&function(t){return K.isArray(t)&&!t.some(G)}(t)||(K.isFileList(t)||K.endsWith(n,"[]"))&&(s=K.toArray(t)))return n=J(n),s.forEach(function(t,r){!K.isUndefined(t)&&null!==t&&e.append(!0===a?Q([n],r,i):null===a?n:n+"[]",c(t))}),!1;return!!G(t)||(e.append(Q(o,n,i),c(t)),!1)}const u=[],f=Object.assign(Z,{defaultVisitor:l,convertValue:c,isVisitable:G});if(!K.isObject(t))throw new TypeError("data must be an object");return function t(n,r){if(!K.isUndefined(n)){if(-1!==u.indexOf(n))throw Error("Circular reference detected in "+r.join("."));u.push(n),K.forEach(n,function(n,i){!0===(!(K.isUndefined(n)||null===n)&&o.call(e,n,K.isString(i)?i.trim():i,r,f))&&t(n,r?r.concat(i):[i])}),u.pop()}}(t),e}function et(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(t){return e[t]})}function nt(t,e){this._pairs=[],t&&tt(t,this,e)}const rt=nt.prototype;function ot(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function it(t,e,n){if(!e)return t;const r=n&&n.encode||ot,o=K.isFunction(n)?{serialize:n}:n,i=o&&o.serialize;let a;if(a=i?i(e,o):K.isURLSearchParams(e)?e.toString():new nt(e,o).toString(r),a){const e=t.indexOf("#");-1!==e&&(t=t.slice(0,e)),t+=(-1===t.indexOf("?")?"?":"&")+a}return t}rt.append=function(t,e){this._pairs.push([t,e])},rt.toString=function(t){const e=t?function(e){return t.call(this,e,et)}:et;return this._pairs.map(function(t){return e(t[0])+"="+e(t[1])},"").join("&")};class at{constructor(){this.handlers=[]}use(t,e,n){return this.handlers.push({fulfilled:t,rejected:e,synchronous:!!n&&n.synchronous,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){K.forEach(this.handlers,function(e){null!==e&&t(e)})}}const st={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0},ct={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:nt,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},lt="undefined"!=typeof window&&"undefined"!=typeof document,ut="object"==typeof navigator&&navigator||void 0,ft=lt&&(!ut||["ReactNative","NativeScript","NS"].indexOf(ut.product)<0),dt="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,pt=lt&&window.location.href||"http://localhost",ht={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:lt,hasStandardBrowserEnv:ft,hasStandardBrowserWebWorkerEnv:dt,navigator:ut,origin:pt},Symbol.toStringTag,{value:"Module"})),...ct};function gt(t){function e(t,n,r,o){let i=t[o++];if("__proto__"===i)return!0;const a=Number.isFinite(+i),s=o>=t.length;if(i=!i&&K.isArray(r)?r.length:i,s)return K.hasOwnProp(r,i)?r[i]=[r[i],n]:r[i]=n,!a;r[i]&&K.isObject(r[i])||(r[i]=[]);return e(t,n,r[i],o)&&K.isArray(r[i])&&(r[i]=function(t){const e={},n=Object.keys(t);let r;const o=n.length;let i;for(r=0;r<o;r++)i=n[r],e[i]=t[i];return e}(r[i])),!a}if(K.isFormData(t)&&K.isFunction(t.entries)){const n={};return K.forEachEntry(t,(t,r)=>{e(function(t){return K.matchAll(/\w+|\[(\w*)]/g,t).map(t=>"[]"===t[0]?"":t[1]||t[0])}(t),r,n,0)}),n}return null}const mt={transitional:st,adapter:["xhr","http","fetch"],transformRequest:[function(t,e){const n=e.getContentType()||"",r=n.indexOf("application/json")>-1,o=K.isObject(t);o&&K.isHTMLForm(t)&&(t=new FormData(t));if(K.isFormData(t))return r?JSON.stringify(gt(t)):t;if(K.isArrayBuffer(t)||K.isBuffer(t)||K.isStream(t)||K.isFile(t)||K.isBlob(t)||K.isReadableStream(t))return t;if(K.isArrayBufferView(t))return t.buffer;if(K.isURLSearchParams(t))return e.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let i;if(o){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(t,e){return tt(t,new ht.classes.URLSearchParams,{visitor:function(t,e,n,r){return ht.isNode&&K.isBuffer(t)?(this.append(e,t.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)},...e})}(t,this.formSerializer).toString();if((i=K.isFileList(t))||n.indexOf("multipart/form-data")>-1){const e=this.env&&this.env.FormData;return tt(i?{"files[]":t}:t,e&&new e,this.formSerializer)}}return o||r?(e.setContentType("application/json",!1),function(t,e,n){if(K.isString(t))try{return(e||JSON.parse)(t),K.trim(t)}catch(r){if("SyntaxError"!==r.name)throw r}return(n||JSON.stringify)(t)}(t)):t}],transformResponse:[function(t){const e=this.transitional||mt.transitional,n=e&&e.forcedJSONParsing,r="json"===this.responseType;if(K.isResponse(t)||K.isReadableStream(t))return t;if(t&&K.isString(t)&&(n&&!this.responseType||r)){const n=!(e&&e.silentJSONParsing)&&r;try{return JSON.parse(t,this.parseReviver)}catch(o){if(n){if("SyntaxError"===o.name)throw Y.from(o,Y.ERR_BAD_RESPONSE,this,null,this.response);throw o}}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ht.classes.FormData,Blob:ht.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};K.forEach(["delete","get","head","post","put","patch"],t=>{mt.headers[t]={}});const vt=K.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"]),bt=Symbol("internals");function yt(t){return t&&String(t).trim().toLowerCase()}function wt(t){return!1===t||null==t?t:K.isArray(t)?t.map(wt):String(t)}function Et(t,e,n,r,o){return K.isFunction(r)?r.call(this,e,n):(o&&(e=n),K.isString(e)?K.isString(r)?-1!==e.indexOf(r):K.isRegExp(r)?r.test(e):void 0:void 0)}let St=class{constructor(t){t&&this.set(t)}set(t,e,n){const r=this;function o(t,e,n){const o=yt(e);if(!o)throw new Error("header name must be a non-empty string");const i=K.findKey(r,o);(!i||void 0===r[i]||!0===n||void 0===n&&!1!==r[i])&&(r[i||e]=wt(t))}const i=(t,e)=>K.forEach(t,(t,n)=>o(t,n,e));if(K.isPlainObject(t)||t instanceof this.constructor)i(t,e);else if(K.isString(t)&&(t=t.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim()))i((t=>{const e={};let n,r,o;return t&&t.split("\n").forEach(function(t){o=t.indexOf(":"),n=t.substring(0,o).trim().toLowerCase(),r=t.substring(o+1).trim(),!n||e[n]&&vt[n]||("set-cookie"===n?e[n]?e[n].push(r):e[n]=[r]:e[n]=e[n]?e[n]+", "+r:r)}),e})(t),e);else if(K.isObject(t)&&K.isIterable(t)){let n,r,o={};for(const e of t){if(!K.isArray(e))throw TypeError("Object iterator must return a key-value pair");o[r=e[0]]=(n=o[r])?K.isArray(n)?[...n,e[1]]:[n,e[1]]:e[1]}i(o,e)}else null!=t&&o(e,t,n);return this}get(t,e){if(t=yt(t)){const n=K.findKey(this,t);if(n){const t=this[n];if(!e)return t;if(!0===e)return function(t){const e=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(t);)e[r[1]]=r[2];return e}(t);if(K.isFunction(e))return e.call(this,t,n);if(K.isRegExp(e))return e.exec(t);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,e){if(t=yt(t)){const n=K.findKey(this,t);return!(!n||void 0===this[n]||e&&!Et(0,this[n],n,e))}return!1}delete(t,e){const n=this;let r=!1;function o(t){if(t=yt(t)){const o=K.findKey(n,t);!o||e&&!Et(0,n[o],o,e)||(delete n[o],r=!0)}}return K.isArray(t)?t.forEach(o):o(t),r}clear(t){const e=Object.keys(this);let n=e.length,r=!1;for(;n--;){const o=e[n];t&&!Et(0,this[o],o,t,!0)||(delete this[o],r=!0)}return r}normalize(t){const e=this,n={};return K.forEach(this,(r,o)=>{const i=K.findKey(n,o);if(i)return e[i]=wt(r),void delete e[o];const a=t?function(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,e,n)=>e.toUpperCase()+n)}(o):String(o).trim();a!==o&&delete e[o],e[a]=wt(r),n[a]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const e=Object.create(null);return K.forEach(this,(n,r)=>{null!=n&&!1!==n&&(e[r]=t&&K.isArray(n)?n.join(", "):n)}),e}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,e])=>t+": "+e).join("\n")}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,...e){const n=new this(t);return e.forEach(t=>n.set(t)),n}static accessor(t){const e=(this[bt]=this[bt]={accessors:{}}).accessors,n=this.prototype;function r(t){const r=yt(t);e[r]||(!function(t,e){const n=K.toCamelCase(" "+e);["get","set","has"].forEach(r=>{Object.defineProperty(t,r+n,{value:function(t,n,o){return this[r].call(this,e,t,n,o)},configurable:!0})})}(n,t),e[r]=!0)}return K.isArray(t)?t.forEach(r):r(t),this}};function xt(t,e){const n=this||mt,r=e||n,o=St.from(r.headers);let i=r.data;return K.forEach(t,function(t){i=t.call(n,i,o.normalize(),e?e.status:void 0)}),o.normalize(),i}function Ot(t){return!(!t||!t.__CANCEL__)}St.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),K.reduceDescriptors(St.prototype,({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(t){this[n]=t}}}),K.freezeMethods(St);let _t=class extends Y{constructor(t,e,n){super(null==t?"canceled":t,Y.ERR_CANCELED,e,n),this.name="CanceledError",this.__CANCEL__=!0}};function Tt(t,e,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?e(new Y("Request failed with status code "+n.status,[Y.ERR_BAD_REQUEST,Y.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):t(n)}const At=(t,e,n=3)=>{let r=0;const o=function(t,e){t=t||10;const n=new Array(t),r=new Array(t);let o,i=0,a=0;return e=void 0!==e?e:1e3,function(s){const c=Date.now(),l=r[a];o||(o=c),n[i]=s,r[i]=c;let u=a,f=0;for(;u!==i;)f+=n[u++],u%=t;if(i=(i+1)%t,i===a&&(a=(a+1)%t),c-o<e)return;const d=l&&c-l;return d?Math.round(1e3*f/d):void 0}}(50,250);return function(t,e){let n,r,o=0,i=1e3/e;const a=(e,i=Date.now())=>{o=i,n=null,r&&(clearTimeout(r),r=null),t(...e)};return[(...t)=>{const e=Date.now(),s=e-o;s>=i?a(t,e):(n=t,r||(r=setTimeout(()=>{r=null,a(n)},i-s)))},()=>n&&a(n)]}(n=>{const i=n.loaded,a=n.lengthComputable?n.total:void 0,s=i-r,c=o(s);r=i;t({loaded:i,total:a,progress:a?i/a:void 0,bytes:s,rate:c||void 0,estimated:c&&a&&i<=a?(a-i)/c:void 0,event:n,lengthComputable:null!=a,[e?"download":"upload"]:!0})},n)},Ct=(t,e)=>{const n=null!=t;return[r=>e[0]({lengthComputable:n,total:t,loaded:r}),e[1]]},Dt=t=>(...e)=>K.asap(()=>t(...e)),Rt=ht.hasStandardBrowserEnv?((t,e)=>n=>(n=new URL(n,ht.origin),t.protocol===n.protocol&&t.host===n.host&&(e||t.port===n.port)))(new URL(ht.origin),ht.navigator&&/(msie|trident)/i.test(ht.navigator.userAgent)):()=>!0,Pt=ht.hasStandardBrowserEnv?{write(t,e,n,r,o,i,a){if("undefined"==typeof document)return;const s=[`${t}=${encodeURIComponent(e)}`];K.isNumber(n)&&s.push(`expires=${new Date(n).toUTCString()}`),K.isString(r)&&s.push(`path=${r}`),K.isString(o)&&s.push(`domain=${o}`),!0===i&&s.push("secure"),K.isString(a)&&s.push(`SameSite=${a}`),document.cookie=s.join("; ")},read(t){if("undefined"==typeof document)return null;const e=document.cookie.match(new RegExp("(?:^|; )"+t+"=([^;]*)"));return e?decodeURIComponent(e[1]):null},remove(t){this.write(t,"",Date.now()-864e5,"/")}}:{write(){},read:()=>null,remove(){}};function jt(t,e,n){let r=!("string"==typeof(o=e)&&/^([a-z][a-z\d+\-.]*:)?\/\//i.test(o));var o;return t&&(r||0==n)?function(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}(t,e):e}const Nt=t=>t instanceof St?{...t}:t;function It(t,e){e=e||{};const n={};function r(t,e,n,r){return K.isPlainObject(t)&&K.isPlainObject(e)?K.merge.call({caseless:r},t,e):K.isPlainObject(e)?K.merge({},e):K.isArray(e)?e.slice():e}function o(t,e,n,o){return K.isUndefined(e)?K.isUndefined(t)?void 0:r(void 0,t,0,o):r(t,e,0,o)}function i(t,e){if(!K.isUndefined(e))return r(void 0,e)}function a(t,e){return K.isUndefined(e)?K.isUndefined(t)?void 0:r(void 0,t):r(void 0,e)}function s(n,o,i){return i in e?r(n,o):i in t?r(void 0,n):void 0}const c={url:i,method:i,data:i,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:s,headers:(t,e,n)=>o(Nt(t),Nt(e),0,!0)};return K.forEach(Object.keys({...t,...e}),function(r){if("__proto__"===r||"constructor"===r||"prototype"===r)return;const i=K.hasOwnProp(c,r)?c[r]:o,a=i(t[r],e[r],r);K.isUndefined(a)&&i!==s||(n[r]=a)}),n}const Mt=t=>{const e=It({},t);let{data:n,withXSRFToken:r,xsrfHeaderName:o,xsrfCookieName:i,headers:a,auth:s}=e;if(e.headers=a=St.from(a),e.url=it(jt(e.baseURL,e.url,e.allowAbsoluteUrls),t.params,t.paramsSerializer),s&&a.set("Authorization","Basic "+btoa((s.username||"")+":"+(s.password?unescape(encodeURIComponent(s.password)):""))),K.isFormData(n))if(ht.hasStandardBrowserEnv||ht.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if(K.isFunction(n.getHeaders)){const t=n.getHeaders(),e=["content-type","content-length"];Object.entries(t).forEach(([t,n])=>{e.includes(t.toLowerCase())&&a.set(t,n)})}if(ht.hasStandardBrowserEnv&&(r&&K.isFunction(r)&&(r=r(e)),r||!1!==r&&Rt(e.url))){const t=o&&i&&Pt.read(i);t&&a.set(o,t)}return e},kt="undefined"!=typeof XMLHttpRequest&&function(t){return new Promise(function(e,n){const r=Mt(t);let o=r.data;const i=St.from(r.headers).normalize();let a,s,c,l,u,{responseType:f,onUploadProgress:d,onDownloadProgress:p}=r;function h(){l&&l(),u&&u(),r.cancelToken&&r.cancelToken.unsubscribe(a),r.signal&&r.signal.removeEventListener("abort",a)}let g=new XMLHttpRequest;function m(){if(!g)return;const r=St.from("getAllResponseHeaders"in g&&g.getAllResponseHeaders());Tt(function(t){e(t),h()},function(t){n(t),h()},{data:f&&"text"!==f&&"json"!==f?g.response:g.responseText,status:g.status,statusText:g.statusText,headers:r,config:t,request:g}),g=null}g.open(r.method.toUpperCase(),r.url,!0),g.timeout=r.timeout,"onloadend"in g?g.onloadend=m:g.onreadystatechange=function(){g&&4===g.readyState&&(0!==g.status||g.responseURL&&0===g.responseURL.indexOf("file:"))&&setTimeout(m)},g.onabort=function(){g&&(n(new Y("Request aborted",Y.ECONNABORTED,t,g)),g=null)},g.onerror=function(e){const r=e&&e.message?e.message:"Network Error",o=new Y(r,Y.ERR_NETWORK,t,g);o.event=e||null,n(o),g=null},g.ontimeout=function(){let e=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const o=r.transitional||st;r.timeoutErrorMessage&&(e=r.timeoutErrorMessage),n(new Y(e,o.clarifyTimeoutError?Y.ETIMEDOUT:Y.ECONNABORTED,t,g)),g=null},void 0===o&&i.setContentType(null),"setRequestHeader"in g&&K.forEach(i.toJSON(),function(t,e){g.setRequestHeader(e,t)}),K.isUndefined(r.withCredentials)||(g.withCredentials=!!r.withCredentials),f&&"json"!==f&&(g.responseType=r.responseType),p&&([c,u]=At(p,!0),g.addEventListener("progress",c)),d&&g.upload&&([s,l]=At(d),g.upload.addEventListener("progress",s),g.upload.addEventListener("loadend",l)),(r.cancelToken||r.signal)&&(a=e=>{g&&(n(!e||e.type?new _t(null,t,g):e),g.abort(),g=null)},r.cancelToken&&r.cancelToken.subscribe(a),r.signal&&(r.signal.aborted?a():r.signal.addEventListener("abort",a)));const v=function(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}(r.url);v&&-1===ht.protocols.indexOf(v)?n(new Y("Unsupported protocol "+v+":",Y.ERR_BAD_REQUEST,t)):g.send(o||null)})},Lt=(t,e)=>{const{length:n}=t=t?t.filter(Boolean):[];if(e||n){let n,r=new AbortController;const o=function(t){if(!n){n=!0,a();const e=t instanceof Error?t:this.reason;r.abort(e instanceof Y?e:new _t(e instanceof Error?e.message:e))}};let i=e&&setTimeout(()=>{i=null,o(new Y(`timeout of ${e}ms exceeded`,Y.ETIMEDOUT))},e);const a=()=>{t&&(i&&clearTimeout(i),i=null,t.forEach(t=>{t.unsubscribe?t.unsubscribe(o):t.removeEventListener("abort",o)}),t=null)};t.forEach(t=>t.addEventListener("abort",o));const{signal:s}=r;return s.unsubscribe=()=>K.asap(a),s}},Ft=function*(t,e){let n=t.byteLength;if(n<e)return void(yield t);let r,o=0;for(;o<n;)r=o+e,yield t.slice(o,r),o=r},Ut=async function*(t){if(t[Symbol.asyncIterator])return void(yield*t);const e=t.getReader();try{for(;;){const{done:t,value:n}=await e.read();if(t)break;yield n}}finally{await e.cancel()}},Bt=(t,e,n,r)=>{const o=async function*(t,e){for await(const n of Ut(t))yield*Ft(n,e)}(t,e);let i,a=0,s=t=>{i||(i=!0,r&&r(t))};return new ReadableStream({async pull(t){try{const{done:e,value:r}=await o.next();if(e)return s(),void t.close();let i=r.byteLength;if(n){let t=a+=i;n(t)}t.enqueue(new Uint8Array(r))}catch(e){throw s(e),e}},cancel:t=>(s(t),o.return())},{highWaterMark:2})},{isFunction:qt}=K,$t=(({Request:t,Response:e})=>({Request:t,Response:e}))(K.global),{ReadableStream:Ht,TextEncoder:Xt}=K.global,Vt=(t,...e)=>{try{return!!t(...e)}catch(n){return!1}},Wt=t=>{t=K.merge.call({skipUndefined:!0},$t,t);const{fetch:e,Request:n,Response:r}=t,o=e?qt(e):"function"==typeof fetch,i=qt(n),a=qt(r);if(!o)return!1;const s=o&&qt(Ht),c=o&&("function"==typeof Xt?(t=>e=>t.encode(e))(new Xt):async t=>new Uint8Array(await new n(t).arrayBuffer())),l=i&&s&&Vt(()=>{let t=!1;const e=new n(ht.origin,{body:new Ht,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type");return t&&!e}),u=a&&s&&Vt(()=>K.isReadableStream(new r("").body)),f={stream:u&&(t=>t.body)};o&&["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!f[t]&&(f[t]=(e,n)=>{let r=e&&e[t];if(r)return r.call(e);throw new Y(`Response type '${t}' is not supported`,Y.ERR_NOT_SUPPORT,n)})});const d=async(t,e)=>{const r=K.toFiniteNumber(t.getContentLength());return null==r?(async t=>{if(null==t)return 0;if(K.isBlob(t))return t.size;if(K.isSpecCompliantForm(t)){const e=new n(ht.origin,{method:"POST",body:t});return(await e.arrayBuffer()).byteLength}return K.isArrayBufferView(t)||K.isArrayBuffer(t)?t.byteLength:(K.isURLSearchParams(t)&&(t+=""),K.isString(t)?(await c(t)).byteLength:void 0)})(e):r};return async t=>{let{url:o,method:a,data:s,signal:c,cancelToken:p,timeout:h,onDownloadProgress:g,onUploadProgress:m,responseType:v,headers:b,withCredentials:y="same-origin",fetchOptions:w}=Mt(t),E=e||fetch;v=v?(v+"").toLowerCase():"text";let S=Lt([c,p&&p.toAbortSignal()],h),x=null;const O=S&&S.unsubscribe&&(()=>{S.unsubscribe()});let _;try{if(m&&l&&"get"!==a&&"head"!==a&&0!==(_=await d(b,s))){let t,e=new n(o,{method:"POST",body:s,duplex:"half"});if(K.isFormData(s)&&(t=e.headers.get("content-type"))&&b.setContentType(t),e.body){const[t,n]=Ct(_,At(Dt(m)));s=Bt(e.body,65536,t,n)}}K.isString(y)||(y=y?"include":"omit");const e=i&&"credentials"in n.prototype,c={...w,signal:S,method:a.toUpperCase(),headers:b.normalize().toJSON(),body:s,duplex:"half",credentials:e?y:void 0};x=i&&new n(o,c);let p=await(i?E(x,w):E(o,c));const h=u&&("stream"===v||"response"===v);if(u&&(g||h&&O)){const t={};["status","statusText","headers"].forEach(e=>{t[e]=p[e]});const e=K.toFiniteNumber(p.headers.get("content-length")),[n,o]=g&&Ct(e,At(Dt(g),!0))||[];p=new r(Bt(p.body,65536,n,()=>{o&&o(),O&&O()}),t)}v=v||"text";let T=await f[K.findKey(f,v)||"text"](p,t);return!h&&O&&O(),await new Promise((e,n)=>{Tt(e,n,{data:T,headers:St.from(p.headers),status:p.status,statusText:p.statusText,config:t,request:x})})}catch(T){if(O&&O(),T&&"TypeError"===T.name&&/Load failed|fetch/i.test(T.message))throw Object.assign(new Y("Network Error",Y.ERR_NETWORK,t,x,T&&T.response),{cause:T.cause||T});throw Y.from(T,T&&T.code,t,x,T&&T.response)}}},zt=new Map,Kt=t=>{let e=t&&t.env||{};const{fetch:n,Request:r,Response:o}=e,i=[r,o,n];let a,s,c=i.length,l=zt;for(;c--;)a=i[c],s=l.get(a),void 0===s&&l.set(a,s=c?new Map:Wt(e)),l=s;return s};Kt();const Yt={http:null,xhr:kt,fetch:{get:Kt}};K.forEach(Yt,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch(n){}Object.defineProperty(t,"adapterName",{value:e})}});const Gt=t=>`- ${t}`,Jt=t=>K.isFunction(t)||null===t||!1===t;const Qt={getAdapter:function(t,e){t=K.isArray(t)?t:[t];const{length:n}=t;let r,o;const i={};for(let a=0;a<n;a++){let n;if(r=t[a],o=r,!Jt(r)&&(o=Yt[(n=String(r)).toLowerCase()],void 0===o))throw new Y(`Unknown adapter '${n}'`);if(o&&(K.isFunction(o)||(o=o.get(e))))break;i[n||"#"+a]=o}if(!o){const t=Object.entries(i).map(([t,e])=>`adapter ${t} `+(!1===e?"is not supported by the environment":"is not available in the build"));let e=n?t.length>1?"since :\n"+t.map(Gt).join("\n"):" "+Gt(t[0]):"as no adapter specified";throw new Y("There is no suitable adapter to dispatch the request "+e,"ERR_NOT_SUPPORT")}return o},adapters:Yt};function Zt(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new _t(null,t)}function te(t){Zt(t),t.headers=St.from(t.headers),t.data=xt.call(t,t.transformRequest),-1!==["post","put","patch"].indexOf(t.method)&&t.headers.setContentType("application/x-www-form-urlencoded",!1);return Qt.getAdapter(t.adapter||mt.adapter,t)(t).then(function(e){return Zt(t),e.data=xt.call(t,t.transformResponse,e),e.headers=St.from(e.headers),e},function(e){return Ot(e)||(Zt(t),e&&e.response&&(e.response.data=xt.call(t,t.transformResponse,e.response),e.response.headers=St.from(e.response.headers))),Promise.reject(e)})}const ee="1.13.6",ne={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{ne[t]=function(n){return typeof n===t||"a"+(e<1?"n ":" ")+t}});const re={};ne.transitional=function(t,e,n){return(r,o,i)=>{if(!1===t)throw new Y(function(t,e){return"[Axios v"+ee+"] Transitional option '"+t+"'"+e+(n?". "+n:"")}(o," has been removed"+(e?" in "+e:"")),Y.ERR_DEPRECATED);return e&&!re[o]&&(re[o]=!0),!t||t(r,o,i)}},ne.spelling=function(t){return(t,e)=>!0};const oe={assertOptions:function(t,e,n){if("object"!=typeof t)throw new Y("options must be an object",Y.ERR_BAD_OPTION_VALUE);const r=Object.keys(t);let o=r.length;for(;o-- >0;){const i=r[o],a=e[i];if(a){const e=t[i],n=void 0===e||a(e,i,t);if(!0!==n)throw new Y("option "+i+" must be "+n,Y.ERR_BAD_OPTION_VALUE);continue}if(!0!==n)throw new Y("Unknown option "+i,Y.ERR_BAD_OPTION)}},validators:ne},ie=oe.validators;let ae=class{constructor(t){this.defaults=t||{},this.interceptors={request:new at,response:new at}}async request(t,e){try{return await this._request(t,e)}catch(n){if(n instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=new Error;const e=t.stack?t.stack.replace(/^.+\n/,""):"";try{n.stack?e&&!String(n.stack).endsWith(e.replace(/^.+\n.+\n/,""))&&(n.stack+="\n"+e):n.stack=e}catch(r){}}throw n}}_request(t,e){"string"==typeof t?(e=e||{}).url=t:e=t||{},e=It(this.defaults,e);const{transitional:n,paramsSerializer:r,headers:o}=e;void 0!==n&&oe.assertOptions(n,{silentJSONParsing:ie.transitional(ie.boolean),forcedJSONParsing:ie.transitional(ie.boolean),clarifyTimeoutError:ie.transitional(ie.boolean),legacyInterceptorReqResOrdering:ie.transitional(ie.boolean)},!1),null!=r&&(K.isFunction(r)?e.paramsSerializer={serialize:r}:oe.assertOptions(r,{encode:ie.function,serialize:ie.function},!0)),void 0!==e.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?e.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:e.allowAbsoluteUrls=!0),oe.assertOptions(e,{baseUrl:ie.spelling("baseURL"),withXsrfToken:ie.spelling("withXSRFToken")},!0),e.method=(e.method||this.defaults.method||"get").toLowerCase();let i=o&&K.merge(o.common,o[e.method]);o&&K.forEach(["delete","get","head","post","put","patch","common"],t=>{delete o[t]}),e.headers=St.concat(i,o);const a=[];let s=!0;this.interceptors.request.forEach(function(t){if("function"==typeof t.runWhen&&!1===t.runWhen(e))return;s=s&&t.synchronous;const n=e.transitional||st;n&&n.legacyInterceptorReqResOrdering?a.unshift(t.fulfilled,t.rejected):a.push(t.fulfilled,t.rejected)});const c=[];let l;this.interceptors.response.forEach(function(t){c.push(t.fulfilled,t.rejected)});let u,f=0;if(!s){const t=[te.bind(this),void 0];for(t.unshift(...a),t.push(...c),u=t.length,l=Promise.resolve(e);f<u;)l=l.then(t[f++],t[f++]);return l}u=a.length;let d=e;for(;f<u;){const t=a[f++],e=a[f++];try{d=t(d)}catch(p){e.call(this,p);break}}try{l=te.call(this,d)}catch(p){return Promise.reject(p)}for(f=0,u=c.length;f<u;)l=l.then(c[f++],c[f++]);return l}getUri(t){return it(jt((t=It(this.defaults,t)).baseURL,t.url,t.allowAbsoluteUrls),t.params,t.paramsSerializer)}};K.forEach(["delete","get","head","options"],function(t){ae.prototype[t]=function(e,n){return this.request(It(n||{},{method:t,url:e,data:(n||{}).data}))}}),K.forEach(["post","put","patch"],function(t){function e(e){return function(n,r,o){return this.request(It(o||{},{method:t,headers:e?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}ae.prototype[t]=e(),ae.prototype[t+"Form"]=e(!0)});const se={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(se).forEach(([t,e])=>{se[e]=t});const ce=function t(e){const n=new ae(e),r=o(ae.prototype.request,n);return K.extend(r,ae.prototype,n,{allOwnKeys:!0}),K.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return t(It(e,n))},r}(mt);ce.Axios=ae,ce.CanceledError=_t,ce.CancelToken=class t{constructor(t){if("function"!=typeof t)throw new TypeError("executor must be a function.");let e;this.promise=new Promise(function(t){e=t});const n=this;this.promise.then(t=>{if(!n._listeners)return;let e=n._listeners.length;for(;e-- >0;)n._listeners[e](t);n._listeners=null}),this.promise.then=t=>{let e;const r=new Promise(t=>{n.subscribe(t),e=t}).then(t);return r.cancel=function(){n.unsubscribe(e)},r},t(function(t,r,o){n.reason||(n.reason=new _t(t,r,o),e(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){this.reason?t(this.reason):this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const e=this._listeners.indexOf(t);-1!==e&&this._listeners.splice(e,1)}toAbortSignal(){const t=new AbortController,e=e=>{t.abort(e)};return this.subscribe(e),t.signal.unsubscribe=()=>this.unsubscribe(e),t.signal}static source(){let e;return{token:new t(function(t){e=t}),cancel:e}}},ce.isCancel=Ot,ce.VERSION=ee,ce.toFormData=tt,ce.AxiosError=Y,ce.Cancel=ce.CanceledError,ce.all=function(t){return Promise.all(t)},ce.spread=function(t){return function(e){return t.apply(null,e)}},ce.isAxiosError=function(t){return K.isObject(t)&&!0===t.isAxiosError},ce.mergeConfig=It,ce.AxiosHeaders=St,ce.formToJSON=t=>gt(K.isHTMLForm(t)?new FormData(t):t),ce.getAdapter=Qt.getAdapter,ce.HttpStatusCode=se,ce.default=ce;const{Axios:le,AxiosError:ue,CanceledError:fe,isCancel:de,CancelToken:pe,VERSION:he,all:ge,Cancel:me,isAxiosError:ve,spread:be,toFormData:ye,AxiosHeaders:we,HttpStatusCode:Ee,formToJSON:Se,getAdapter:xe,mergeConfig:Oe}=ce;var _e={exports:{}};
|
|
1
|
+
import{g as t,a as e,c as n}from"./markdown-BNJfEgCA.js";import{S as r}from"./vue-vendor-B5RqjEjQ.js";function o(t,e){return function(){return t.apply(e,arguments)}}const{toString:i}=Object.prototype,{getPrototypeOf:a}=Object,{iterator:s,toStringTag:c}=Symbol,l=(t=>e=>{const n=i.call(e);return t[n]||(t[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),u=t=>(t=t.toLowerCase(),e=>l(e)===t),f=t=>e=>typeof e===t,{isArray:d}=Array,p=f("undefined");function h(t){return null!==t&&!p(t)&&null!==t.constructor&&!p(t.constructor)&&v(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const g=u("ArrayBuffer");const m=f("string"),v=f("function"),b=f("number"),y=t=>null!==t&&"object"==typeof t,w=t=>{if("object"!==l(t))return!1;const e=a(t);return!(null!==e&&e!==Object.prototype&&null!==Object.getPrototypeOf(e)||c in t||s in t)},E=u("Date"),S=u("File"),x=u("Blob"),O=u("FileList");const _="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},T=void 0!==_.FormData?_.FormData:void 0,A=u("URLSearchParams"),[C,D,R,P]=["ReadableStream","Request","Response","Headers"].map(u);function j(t,e,{allOwnKeys:n=!1}={}){if(null==t)return;let r,o;if("object"!=typeof t&&(t=[t]),d(t))for(r=0,o=t.length;r<o;r++)e.call(null,t[r],r,t);else{if(h(t))return;const o=n?Object.getOwnPropertyNames(t):Object.keys(t),i=o.length;let a;for(r=0;r<i;r++)a=o[r],e.call(null,t[a],a,t)}}function N(t,e){if(h(t))return null;e=e.toLowerCase();const n=Object.keys(t);let r,o=n.length;for(;o-- >0;)if(r=n[o],e===r.toLowerCase())return r;return null}const I="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,M=t=>!p(t)&&t!==I;const k=(t=>e=>t&&e instanceof t)("undefined"!=typeof Uint8Array&&a(Uint8Array)),L=u("HTMLFormElement"),F=(({hasOwnProperty:t})=>(e,n)=>t.call(e,n))(Object.prototype),U=u("RegExp"),B=(t,e)=>{const n=Object.getOwnPropertyDescriptors(t),r={};j(n,(n,o)=>{let i;!1!==(i=e(n,o,t))&&(r[o]=i||n)}),Object.defineProperties(t,r)};const q=u("AsyncFunction"),$=(H="function"==typeof setImmediate,X=v(I.postMessage),H?setImmediate:X?(V=`axios@${Math.random()}`,W=[],I.addEventListener("message",({source:t,data:e})=>{t===I&&e===V&&W.length&&W.shift()()},!1),t=>{W.push(t),I.postMessage(V,"*")}):t=>setTimeout(t));var H,X,V,W;const z="undefined"!=typeof queueMicrotask?queueMicrotask.bind(I):"undefined"!=typeof process&&process.nextTick||$,K={isArray:d,isArrayBuffer:g,isBuffer:h,isFormData:t=>{let e;return t&&(T&&t instanceof T||v(t.append)&&("formdata"===(e=l(t))||"object"===e&&v(t.toString)&&"[object FormData]"===t.toString()))},isArrayBufferView:function(t){let e;return e="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&g(t.buffer),e},isString:m,isNumber:b,isBoolean:t=>!0===t||!1===t,isObject:y,isPlainObject:w,isEmptyObject:t=>{if(!y(t)||h(t))return!1;try{return 0===Object.keys(t).length&&Object.getPrototypeOf(t)===Object.prototype}catch(e){return!1}},isReadableStream:C,isRequest:D,isResponse:R,isHeaders:P,isUndefined:p,isDate:E,isFile:S,isReactNativeBlob:t=>!(!t||void 0===t.uri),isReactNative:t=>t&&void 0!==t.getParts,isBlob:x,isRegExp:U,isFunction:v,isStream:t=>y(t)&&v(t.pipe),isURLSearchParams:A,isTypedArray:k,isFileList:O,forEach:j,merge:function t(){const{caseless:e,skipUndefined:n}=M(this)&&this||{},r={},o=(o,i)=>{if("__proto__"===i||"constructor"===i||"prototype"===i)return;const a=e&&N(r,i)||i;w(r[a])&&w(o)?r[a]=t(r[a],o):w(o)?r[a]=t({},o):d(o)?r[a]=o.slice():n&&p(o)||(r[a]=o)};for(let i=0,a=arguments.length;i<a;i++)arguments[i]&&j(arguments[i],o);return r},extend:(t,e,n,{allOwnKeys:r}={})=>(j(e,(e,r)=>{n&&v(e)?Object.defineProperty(t,r,{value:o(e,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(t,r,{value:e,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:r}),t),trim:t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:t=>(65279===t.charCodeAt(0)&&(t=t.slice(1)),t),inherits:(t,e,n,r)=>{t.prototype=Object.create(e.prototype,r),Object.defineProperty(t.prototype,"constructor",{value:t,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(t,"super",{value:e.prototype}),n&&Object.assign(t.prototype,n)},toFlatObject:(t,e,n,r)=>{let o,i,s;const c={};if(e=e||{},null==t)return e;do{for(o=Object.getOwnPropertyNames(t),i=o.length;i-- >0;)s=o[i],r&&!r(s,t,e)||c[s]||(e[s]=t[s],c[s]=!0);t=!1!==n&&a(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e},kindOf:l,kindOfTest:u,endsWith:(t,e,n)=>{t=String(t),(void 0===n||n>t.length)&&(n=t.length),n-=e.length;const r=t.indexOf(e,n);return-1!==r&&r===n},toArray:t=>{if(!t)return null;if(d(t))return t;let e=t.length;if(!b(e))return null;const n=new Array(e);for(;e-- >0;)n[e]=t[e];return n},forEachEntry:(t,e)=>{const n=(t&&t[s]).call(t);let r;for(;(r=n.next())&&!r.done;){const n=r.value;e.call(t,n[0],n[1])}},matchAll:(t,e)=>{let n;const r=[];for(;null!==(n=t.exec(e));)r.push(n);return r},isHTMLForm:L,hasOwnProperty:F,hasOwnProp:F,reduceDescriptors:B,freezeMethods:t=>{B(t,(e,n)=>{if(v(t)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=t[n];v(r)&&(e.enumerable=!1,"writable"in e?e.writable=!1:e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))})},toObjectSet:(t,e)=>{const n={},r=t=>{t.forEach(t=>{n[t]=!0})};return d(t)?r(t):r(String(t).split(e)),n},toCamelCase:t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(t,e,n){return e.toUpperCase()+n}),noop:()=>{},toFiniteNumber:(t,e)=>null!=t&&Number.isFinite(t=+t)?t:e,findKey:N,global:I,isContextDefined:M,isSpecCompliantForm:function(t){return!!(t&&v(t.append)&&"FormData"===t[c]&&t[s])},toJSONObject:t=>{const e=new Array(10),n=(t,r)=>{if(y(t)){if(e.indexOf(t)>=0)return;if(h(t))return t;if(!("toJSON"in t)){e[r]=t;const o=d(t)?[]:{};return j(t,(t,e)=>{const i=n(t,r+1);!p(i)&&(o[e]=i)}),e[r]=void 0,o}}return t};return n(t,0)},isAsyncFn:q,isThenable:t=>t&&(y(t)||v(t))&&v(t.then)&&v(t.catch),setImmediate:$,asap:z,isIterable:t=>null!=t&&v(t[s])};let Y=class t extends Error{static from(e,n,r,o,i,a){const s=new t(e.message,n||e.code,r,o,i);return s.cause=e,s.name=e.name,null!=e.status&&null==s.status&&(s.status=e.status),a&&Object.assign(s,a),s}constructor(t,e,n,r,o){super(t),Object.defineProperty(this,"message",{value:t,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,e&&(this.code=e),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o,this.status=o.status)}toJSON(){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:K.toJSONObject(this.config),code:this.code,status:this.status}}};Y.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",Y.ERR_BAD_OPTION="ERR_BAD_OPTION",Y.ECONNABORTED="ECONNABORTED",Y.ETIMEDOUT="ETIMEDOUT",Y.ERR_NETWORK="ERR_NETWORK",Y.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",Y.ERR_DEPRECATED="ERR_DEPRECATED",Y.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",Y.ERR_BAD_REQUEST="ERR_BAD_REQUEST",Y.ERR_CANCELED="ERR_CANCELED",Y.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",Y.ERR_INVALID_URL="ERR_INVALID_URL";function G(t){return K.isPlainObject(t)||K.isArray(t)}function J(t){return K.endsWith(t,"[]")?t.slice(0,-2):t}function Q(t,e,n){return t?t.concat(e).map(function(t,e){return t=J(t),!n&&e?"["+t+"]":t}).join(n?".":""):e}const Z=K.toFlatObject(K,{},null,function(t){return/^is[A-Z]/.test(t)});function tt(t,e,n){if(!K.isObject(t))throw new TypeError("target must be an object");e=e||new FormData;const r=(n=K.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(t,e){return!K.isUndefined(e[t])})).metaTokens,o=n.visitor||l,i=n.dots,a=n.indexes,s=(n.Blob||"undefined"!=typeof Blob&&Blob)&&K.isSpecCompliantForm(e);if(!K.isFunction(o))throw new TypeError("visitor must be a function");function c(t){if(null===t)return"";if(K.isDate(t))return t.toISOString();if(K.isBoolean(t))return t.toString();if(!s&&K.isBlob(t))throw new Y("Blob is not supported. Use a Buffer instead.");return K.isArrayBuffer(t)||K.isTypedArray(t)?s&&"function"==typeof Blob?new Blob([t]):Buffer.from(t):t}function l(t,n,o){let s=t;if(K.isReactNative(e)&&K.isReactNativeBlob(t))return e.append(Q(o,n,i),c(t)),!1;if(t&&!o&&"object"==typeof t)if(K.endsWith(n,"{}"))n=r?n:n.slice(0,-2),t=JSON.stringify(t);else if(K.isArray(t)&&function(t){return K.isArray(t)&&!t.some(G)}(t)||(K.isFileList(t)||K.endsWith(n,"[]"))&&(s=K.toArray(t)))return n=J(n),s.forEach(function(t,r){!K.isUndefined(t)&&null!==t&&e.append(!0===a?Q([n],r,i):null===a?n:n+"[]",c(t))}),!1;return!!G(t)||(e.append(Q(o,n,i),c(t)),!1)}const u=[],f=Object.assign(Z,{defaultVisitor:l,convertValue:c,isVisitable:G});if(!K.isObject(t))throw new TypeError("data must be an object");return function t(n,r){if(!K.isUndefined(n)){if(-1!==u.indexOf(n))throw Error("Circular reference detected in "+r.join("."));u.push(n),K.forEach(n,function(n,i){!0===(!(K.isUndefined(n)||null===n)&&o.call(e,n,K.isString(i)?i.trim():i,r,f))&&t(n,r?r.concat(i):[i])}),u.pop()}}(t),e}function et(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(t){return e[t]})}function nt(t,e){this._pairs=[],t&&tt(t,this,e)}const rt=nt.prototype;function ot(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function it(t,e,n){if(!e)return t;const r=n&&n.encode||ot,o=K.isFunction(n)?{serialize:n}:n,i=o&&o.serialize;let a;if(a=i?i(e,o):K.isURLSearchParams(e)?e.toString():new nt(e,o).toString(r),a){const e=t.indexOf("#");-1!==e&&(t=t.slice(0,e)),t+=(-1===t.indexOf("?")?"?":"&")+a}return t}rt.append=function(t,e){this._pairs.push([t,e])},rt.toString=function(t){const e=t?function(e){return t.call(this,e,et)}:et;return this._pairs.map(function(t){return e(t[0])+"="+e(t[1])},"").join("&")};class at{constructor(){this.handlers=[]}use(t,e,n){return this.handlers.push({fulfilled:t,rejected:e,synchronous:!!n&&n.synchronous,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){K.forEach(this.handlers,function(e){null!==e&&t(e)})}}const st={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0},ct={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:nt,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},lt="undefined"!=typeof window&&"undefined"!=typeof document,ut="object"==typeof navigator&&navigator||void 0,ft=lt&&(!ut||["ReactNative","NativeScript","NS"].indexOf(ut.product)<0),dt="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,pt=lt&&window.location.href||"http://localhost",ht={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:lt,hasStandardBrowserEnv:ft,hasStandardBrowserWebWorkerEnv:dt,navigator:ut,origin:pt},Symbol.toStringTag,{value:"Module"})),...ct};function gt(t){function e(t,n,r,o){let i=t[o++];if("__proto__"===i)return!0;const a=Number.isFinite(+i),s=o>=t.length;if(i=!i&&K.isArray(r)?r.length:i,s)return K.hasOwnProp(r,i)?r[i]=[r[i],n]:r[i]=n,!a;r[i]&&K.isObject(r[i])||(r[i]=[]);return e(t,n,r[i],o)&&K.isArray(r[i])&&(r[i]=function(t){const e={},n=Object.keys(t);let r;const o=n.length;let i;for(r=0;r<o;r++)i=n[r],e[i]=t[i];return e}(r[i])),!a}if(K.isFormData(t)&&K.isFunction(t.entries)){const n={};return K.forEachEntry(t,(t,r)=>{e(function(t){return K.matchAll(/\w+|\[(\w*)]/g,t).map(t=>"[]"===t[0]?"":t[1]||t[0])}(t),r,n,0)}),n}return null}const mt={transitional:st,adapter:["xhr","http","fetch"],transformRequest:[function(t,e){const n=e.getContentType()||"",r=n.indexOf("application/json")>-1,o=K.isObject(t);o&&K.isHTMLForm(t)&&(t=new FormData(t));if(K.isFormData(t))return r?JSON.stringify(gt(t)):t;if(K.isArrayBuffer(t)||K.isBuffer(t)||K.isStream(t)||K.isFile(t)||K.isBlob(t)||K.isReadableStream(t))return t;if(K.isArrayBufferView(t))return t.buffer;if(K.isURLSearchParams(t))return e.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let i;if(o){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(t,e){return tt(t,new ht.classes.URLSearchParams,{visitor:function(t,e,n,r){return ht.isNode&&K.isBuffer(t)?(this.append(e,t.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)},...e})}(t,this.formSerializer).toString();if((i=K.isFileList(t))||n.indexOf("multipart/form-data")>-1){const e=this.env&&this.env.FormData;return tt(i?{"files[]":t}:t,e&&new e,this.formSerializer)}}return o||r?(e.setContentType("application/json",!1),function(t,e,n){if(K.isString(t))try{return(e||JSON.parse)(t),K.trim(t)}catch(r){if("SyntaxError"!==r.name)throw r}return(n||JSON.stringify)(t)}(t)):t}],transformResponse:[function(t){const e=this.transitional||mt.transitional,n=e&&e.forcedJSONParsing,r="json"===this.responseType;if(K.isResponse(t)||K.isReadableStream(t))return t;if(t&&K.isString(t)&&(n&&!this.responseType||r)){const n=!(e&&e.silentJSONParsing)&&r;try{return JSON.parse(t,this.parseReviver)}catch(o){if(n){if("SyntaxError"===o.name)throw Y.from(o,Y.ERR_BAD_RESPONSE,this,null,this.response);throw o}}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ht.classes.FormData,Blob:ht.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};K.forEach(["delete","get","head","post","put","patch"],t=>{mt.headers[t]={}});const vt=K.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"]),bt=Symbol("internals");function yt(t){return t&&String(t).trim().toLowerCase()}function wt(t){return!1===t||null==t?t:K.isArray(t)?t.map(wt):String(t)}function Et(t,e,n,r,o){return K.isFunction(r)?r.call(this,e,n):(o&&(e=n),K.isString(e)?K.isString(r)?-1!==e.indexOf(r):K.isRegExp(r)?r.test(e):void 0:void 0)}let St=class{constructor(t){t&&this.set(t)}set(t,e,n){const r=this;function o(t,e,n){const o=yt(e);if(!o)throw new Error("header name must be a non-empty string");const i=K.findKey(r,o);(!i||void 0===r[i]||!0===n||void 0===n&&!1!==r[i])&&(r[i||e]=wt(t))}const i=(t,e)=>K.forEach(t,(t,n)=>o(t,n,e));if(K.isPlainObject(t)||t instanceof this.constructor)i(t,e);else if(K.isString(t)&&(t=t.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim()))i((t=>{const e={};let n,r,o;return t&&t.split("\n").forEach(function(t){o=t.indexOf(":"),n=t.substring(0,o).trim().toLowerCase(),r=t.substring(o+1).trim(),!n||e[n]&&vt[n]||("set-cookie"===n?e[n]?e[n].push(r):e[n]=[r]:e[n]=e[n]?e[n]+", "+r:r)}),e})(t),e);else if(K.isObject(t)&&K.isIterable(t)){let n,r,o={};for(const e of t){if(!K.isArray(e))throw TypeError("Object iterator must return a key-value pair");o[r=e[0]]=(n=o[r])?K.isArray(n)?[...n,e[1]]:[n,e[1]]:e[1]}i(o,e)}else null!=t&&o(e,t,n);return this}get(t,e){if(t=yt(t)){const n=K.findKey(this,t);if(n){const t=this[n];if(!e)return t;if(!0===e)return function(t){const e=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(t);)e[r[1]]=r[2];return e}(t);if(K.isFunction(e))return e.call(this,t,n);if(K.isRegExp(e))return e.exec(t);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,e){if(t=yt(t)){const n=K.findKey(this,t);return!(!n||void 0===this[n]||e&&!Et(0,this[n],n,e))}return!1}delete(t,e){const n=this;let r=!1;function o(t){if(t=yt(t)){const o=K.findKey(n,t);!o||e&&!Et(0,n[o],o,e)||(delete n[o],r=!0)}}return K.isArray(t)?t.forEach(o):o(t),r}clear(t){const e=Object.keys(this);let n=e.length,r=!1;for(;n--;){const o=e[n];t&&!Et(0,this[o],o,t,!0)||(delete this[o],r=!0)}return r}normalize(t){const e=this,n={};return K.forEach(this,(r,o)=>{const i=K.findKey(n,o);if(i)return e[i]=wt(r),void delete e[o];const a=t?function(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,e,n)=>e.toUpperCase()+n)}(o):String(o).trim();a!==o&&delete e[o],e[a]=wt(r),n[a]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const e=Object.create(null);return K.forEach(this,(n,r)=>{null!=n&&!1!==n&&(e[r]=t&&K.isArray(n)?n.join(", "):n)}),e}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,e])=>t+": "+e).join("\n")}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,...e){const n=new this(t);return e.forEach(t=>n.set(t)),n}static accessor(t){const e=(this[bt]=this[bt]={accessors:{}}).accessors,n=this.prototype;function r(t){const r=yt(t);e[r]||(!function(t,e){const n=K.toCamelCase(" "+e);["get","set","has"].forEach(r=>{Object.defineProperty(t,r+n,{value:function(t,n,o){return this[r].call(this,e,t,n,o)},configurable:!0})})}(n,t),e[r]=!0)}return K.isArray(t)?t.forEach(r):r(t),this}};function xt(t,e){const n=this||mt,r=e||n,o=St.from(r.headers);let i=r.data;return K.forEach(t,function(t){i=t.call(n,i,o.normalize(),e?e.status:void 0)}),o.normalize(),i}function Ot(t){return!(!t||!t.__CANCEL__)}St.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),K.reduceDescriptors(St.prototype,({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(t){this[n]=t}}}),K.freezeMethods(St);let _t=class extends Y{constructor(t,e,n){super(null==t?"canceled":t,Y.ERR_CANCELED,e,n),this.name="CanceledError",this.__CANCEL__=!0}};function Tt(t,e,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?e(new Y("Request failed with status code "+n.status,[Y.ERR_BAD_REQUEST,Y.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):t(n)}const At=(t,e,n=3)=>{let r=0;const o=function(t,e){t=t||10;const n=new Array(t),r=new Array(t);let o,i=0,a=0;return e=void 0!==e?e:1e3,function(s){const c=Date.now(),l=r[a];o||(o=c),n[i]=s,r[i]=c;let u=a,f=0;for(;u!==i;)f+=n[u++],u%=t;if(i=(i+1)%t,i===a&&(a=(a+1)%t),c-o<e)return;const d=l&&c-l;return d?Math.round(1e3*f/d):void 0}}(50,250);return function(t,e){let n,r,o=0,i=1e3/e;const a=(e,i=Date.now())=>{o=i,n=null,r&&(clearTimeout(r),r=null),t(...e)};return[(...t)=>{const e=Date.now(),s=e-o;s>=i?a(t,e):(n=t,r||(r=setTimeout(()=>{r=null,a(n)},i-s)))},()=>n&&a(n)]}(n=>{const i=n.loaded,a=n.lengthComputable?n.total:void 0,s=i-r,c=o(s);r=i;t({loaded:i,total:a,progress:a?i/a:void 0,bytes:s,rate:c||void 0,estimated:c&&a&&i<=a?(a-i)/c:void 0,event:n,lengthComputable:null!=a,[e?"download":"upload"]:!0})},n)},Ct=(t,e)=>{const n=null!=t;return[r=>e[0]({lengthComputable:n,total:t,loaded:r}),e[1]]},Dt=t=>(...e)=>K.asap(()=>t(...e)),Rt=ht.hasStandardBrowserEnv?((t,e)=>n=>(n=new URL(n,ht.origin),t.protocol===n.protocol&&t.host===n.host&&(e||t.port===n.port)))(new URL(ht.origin),ht.navigator&&/(msie|trident)/i.test(ht.navigator.userAgent)):()=>!0,Pt=ht.hasStandardBrowserEnv?{write(t,e,n,r,o,i,a){if("undefined"==typeof document)return;const s=[`${t}=${encodeURIComponent(e)}`];K.isNumber(n)&&s.push(`expires=${new Date(n).toUTCString()}`),K.isString(r)&&s.push(`path=${r}`),K.isString(o)&&s.push(`domain=${o}`),!0===i&&s.push("secure"),K.isString(a)&&s.push(`SameSite=${a}`),document.cookie=s.join("; ")},read(t){if("undefined"==typeof document)return null;const e=document.cookie.match(new RegExp("(?:^|; )"+t+"=([^;]*)"));return e?decodeURIComponent(e[1]):null},remove(t){this.write(t,"",Date.now()-864e5,"/")}}:{write(){},read:()=>null,remove(){}};function jt(t,e,n){let r=!("string"==typeof(o=e)&&/^([a-z][a-z\d+\-.]*:)?\/\//i.test(o));var o;return t&&(r||0==n)?function(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}(t,e):e}const Nt=t=>t instanceof St?{...t}:t;function It(t,e){e=e||{};const n={};function r(t,e,n,r){return K.isPlainObject(t)&&K.isPlainObject(e)?K.merge.call({caseless:r},t,e):K.isPlainObject(e)?K.merge({},e):K.isArray(e)?e.slice():e}function o(t,e,n,o){return K.isUndefined(e)?K.isUndefined(t)?void 0:r(void 0,t,0,o):r(t,e,0,o)}function i(t,e){if(!K.isUndefined(e))return r(void 0,e)}function a(t,e){return K.isUndefined(e)?K.isUndefined(t)?void 0:r(void 0,t):r(void 0,e)}function s(n,o,i){return i in e?r(n,o):i in t?r(void 0,n):void 0}const c={url:i,method:i,data:i,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:s,headers:(t,e,n)=>o(Nt(t),Nt(e),0,!0)};return K.forEach(Object.keys({...t,...e}),function(r){if("__proto__"===r||"constructor"===r||"prototype"===r)return;const i=K.hasOwnProp(c,r)?c[r]:o,a=i(t[r],e[r],r);K.isUndefined(a)&&i!==s||(n[r]=a)}),n}const Mt=t=>{const e=It({},t);let{data:n,withXSRFToken:r,xsrfHeaderName:o,xsrfCookieName:i,headers:a,auth:s}=e;if(e.headers=a=St.from(a),e.url=it(jt(e.baseURL,e.url,e.allowAbsoluteUrls),t.params,t.paramsSerializer),s&&a.set("Authorization","Basic "+btoa((s.username||"")+":"+(s.password?unescape(encodeURIComponent(s.password)):""))),K.isFormData(n))if(ht.hasStandardBrowserEnv||ht.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if(K.isFunction(n.getHeaders)){const t=n.getHeaders(),e=["content-type","content-length"];Object.entries(t).forEach(([t,n])=>{e.includes(t.toLowerCase())&&a.set(t,n)})}if(ht.hasStandardBrowserEnv&&(r&&K.isFunction(r)&&(r=r(e)),r||!1!==r&&Rt(e.url))){const t=o&&i&&Pt.read(i);t&&a.set(o,t)}return e},kt="undefined"!=typeof XMLHttpRequest&&function(t){return new Promise(function(e,n){const r=Mt(t);let o=r.data;const i=St.from(r.headers).normalize();let a,s,c,l,u,{responseType:f,onUploadProgress:d,onDownloadProgress:p}=r;function h(){l&&l(),u&&u(),r.cancelToken&&r.cancelToken.unsubscribe(a),r.signal&&r.signal.removeEventListener("abort",a)}let g=new XMLHttpRequest;function m(){if(!g)return;const r=St.from("getAllResponseHeaders"in g&&g.getAllResponseHeaders());Tt(function(t){e(t),h()},function(t){n(t),h()},{data:f&&"text"!==f&&"json"!==f?g.response:g.responseText,status:g.status,statusText:g.statusText,headers:r,config:t,request:g}),g=null}g.open(r.method.toUpperCase(),r.url,!0),g.timeout=r.timeout,"onloadend"in g?g.onloadend=m:g.onreadystatechange=function(){g&&4===g.readyState&&(0!==g.status||g.responseURL&&0===g.responseURL.indexOf("file:"))&&setTimeout(m)},g.onabort=function(){g&&(n(new Y("Request aborted",Y.ECONNABORTED,t,g)),g=null)},g.onerror=function(e){const r=e&&e.message?e.message:"Network Error",o=new Y(r,Y.ERR_NETWORK,t,g);o.event=e||null,n(o),g=null},g.ontimeout=function(){let e=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const o=r.transitional||st;r.timeoutErrorMessage&&(e=r.timeoutErrorMessage),n(new Y(e,o.clarifyTimeoutError?Y.ETIMEDOUT:Y.ECONNABORTED,t,g)),g=null},void 0===o&&i.setContentType(null),"setRequestHeader"in g&&K.forEach(i.toJSON(),function(t,e){g.setRequestHeader(e,t)}),K.isUndefined(r.withCredentials)||(g.withCredentials=!!r.withCredentials),f&&"json"!==f&&(g.responseType=r.responseType),p&&([c,u]=At(p,!0),g.addEventListener("progress",c)),d&&g.upload&&([s,l]=At(d),g.upload.addEventListener("progress",s),g.upload.addEventListener("loadend",l)),(r.cancelToken||r.signal)&&(a=e=>{g&&(n(!e||e.type?new _t(null,t,g):e),g.abort(),g=null)},r.cancelToken&&r.cancelToken.subscribe(a),r.signal&&(r.signal.aborted?a():r.signal.addEventListener("abort",a)));const v=function(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}(r.url);v&&-1===ht.protocols.indexOf(v)?n(new Y("Unsupported protocol "+v+":",Y.ERR_BAD_REQUEST,t)):g.send(o||null)})},Lt=(t,e)=>{const{length:n}=t=t?t.filter(Boolean):[];if(e||n){let n,r=new AbortController;const o=function(t){if(!n){n=!0,a();const e=t instanceof Error?t:this.reason;r.abort(e instanceof Y?e:new _t(e instanceof Error?e.message:e))}};let i=e&&setTimeout(()=>{i=null,o(new Y(`timeout of ${e}ms exceeded`,Y.ETIMEDOUT))},e);const a=()=>{t&&(i&&clearTimeout(i),i=null,t.forEach(t=>{t.unsubscribe?t.unsubscribe(o):t.removeEventListener("abort",o)}),t=null)};t.forEach(t=>t.addEventListener("abort",o));const{signal:s}=r;return s.unsubscribe=()=>K.asap(a),s}},Ft=function*(t,e){let n=t.byteLength;if(n<e)return void(yield t);let r,o=0;for(;o<n;)r=o+e,yield t.slice(o,r),o=r},Ut=async function*(t){if(t[Symbol.asyncIterator])return void(yield*t);const e=t.getReader();try{for(;;){const{done:t,value:n}=await e.read();if(t)break;yield n}}finally{await e.cancel()}},Bt=(t,e,n,r)=>{const o=async function*(t,e){for await(const n of Ut(t))yield*Ft(n,e)}(t,e);let i,a=0,s=t=>{i||(i=!0,r&&r(t))};return new ReadableStream({async pull(t){try{const{done:e,value:r}=await o.next();if(e)return s(),void t.close();let i=r.byteLength;if(n){let t=a+=i;n(t)}t.enqueue(new Uint8Array(r))}catch(e){throw s(e),e}},cancel:t=>(s(t),o.return())},{highWaterMark:2})},{isFunction:qt}=K,$t=(({Request:t,Response:e})=>({Request:t,Response:e}))(K.global),{ReadableStream:Ht,TextEncoder:Xt}=K.global,Vt=(t,...e)=>{try{return!!t(...e)}catch(n){return!1}},Wt=t=>{t=K.merge.call({skipUndefined:!0},$t,t);const{fetch:e,Request:n,Response:r}=t,o=e?qt(e):"function"==typeof fetch,i=qt(n),a=qt(r);if(!o)return!1;const s=o&&qt(Ht),c=o&&("function"==typeof Xt?(t=>e=>t.encode(e))(new Xt):async t=>new Uint8Array(await new n(t).arrayBuffer())),l=i&&s&&Vt(()=>{let t=!1;const e=new n(ht.origin,{body:new Ht,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type");return t&&!e}),u=a&&s&&Vt(()=>K.isReadableStream(new r("").body)),f={stream:u&&(t=>t.body)};o&&["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!f[t]&&(f[t]=(e,n)=>{let r=e&&e[t];if(r)return r.call(e);throw new Y(`Response type '${t}' is not supported`,Y.ERR_NOT_SUPPORT,n)})});const d=async(t,e)=>{const r=K.toFiniteNumber(t.getContentLength());return null==r?(async t=>{if(null==t)return 0;if(K.isBlob(t))return t.size;if(K.isSpecCompliantForm(t)){const e=new n(ht.origin,{method:"POST",body:t});return(await e.arrayBuffer()).byteLength}return K.isArrayBufferView(t)||K.isArrayBuffer(t)?t.byteLength:(K.isURLSearchParams(t)&&(t+=""),K.isString(t)?(await c(t)).byteLength:void 0)})(e):r};return async t=>{let{url:o,method:a,data:s,signal:c,cancelToken:p,timeout:h,onDownloadProgress:g,onUploadProgress:m,responseType:v,headers:b,withCredentials:y="same-origin",fetchOptions:w}=Mt(t),E=e||fetch;v=v?(v+"").toLowerCase():"text";let S=Lt([c,p&&p.toAbortSignal()],h),x=null;const O=S&&S.unsubscribe&&(()=>{S.unsubscribe()});let _;try{if(m&&l&&"get"!==a&&"head"!==a&&0!==(_=await d(b,s))){let t,e=new n(o,{method:"POST",body:s,duplex:"half"});if(K.isFormData(s)&&(t=e.headers.get("content-type"))&&b.setContentType(t),e.body){const[t,n]=Ct(_,At(Dt(m)));s=Bt(e.body,65536,t,n)}}K.isString(y)||(y=y?"include":"omit");const e=i&&"credentials"in n.prototype,c={...w,signal:S,method:a.toUpperCase(),headers:b.normalize().toJSON(),body:s,duplex:"half",credentials:e?y:void 0};x=i&&new n(o,c);let p=await(i?E(x,w):E(o,c));const h=u&&("stream"===v||"response"===v);if(u&&(g||h&&O)){const t={};["status","statusText","headers"].forEach(e=>{t[e]=p[e]});const e=K.toFiniteNumber(p.headers.get("content-length")),[n,o]=g&&Ct(e,At(Dt(g),!0))||[];p=new r(Bt(p.body,65536,n,()=>{o&&o(),O&&O()}),t)}v=v||"text";let T=await f[K.findKey(f,v)||"text"](p,t);return!h&&O&&O(),await new Promise((e,n)=>{Tt(e,n,{data:T,headers:St.from(p.headers),status:p.status,statusText:p.statusText,config:t,request:x})})}catch(T){if(O&&O(),T&&"TypeError"===T.name&&/Load failed|fetch/i.test(T.message))throw Object.assign(new Y("Network Error",Y.ERR_NETWORK,t,x,T&&T.response),{cause:T.cause||T});throw Y.from(T,T&&T.code,t,x,T&&T.response)}}},zt=new Map,Kt=t=>{let e=t&&t.env||{};const{fetch:n,Request:r,Response:o}=e,i=[r,o,n];let a,s,c=i.length,l=zt;for(;c--;)a=i[c],s=l.get(a),void 0===s&&l.set(a,s=c?new Map:Wt(e)),l=s;return s};Kt();const Yt={http:null,xhr:kt,fetch:{get:Kt}};K.forEach(Yt,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch(n){}Object.defineProperty(t,"adapterName",{value:e})}});const Gt=t=>`- ${t}`,Jt=t=>K.isFunction(t)||null===t||!1===t;const Qt={getAdapter:function(t,e){t=K.isArray(t)?t:[t];const{length:n}=t;let r,o;const i={};for(let a=0;a<n;a++){let n;if(r=t[a],o=r,!Jt(r)&&(o=Yt[(n=String(r)).toLowerCase()],void 0===o))throw new Y(`Unknown adapter '${n}'`);if(o&&(K.isFunction(o)||(o=o.get(e))))break;i[n||"#"+a]=o}if(!o){const t=Object.entries(i).map(([t,e])=>`adapter ${t} `+(!1===e?"is not supported by the environment":"is not available in the build"));let e=n?t.length>1?"since :\n"+t.map(Gt).join("\n"):" "+Gt(t[0]):"as no adapter specified";throw new Y("There is no suitable adapter to dispatch the request "+e,"ERR_NOT_SUPPORT")}return o},adapters:Yt};function Zt(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new _t(null,t)}function te(t){Zt(t),t.headers=St.from(t.headers),t.data=xt.call(t,t.transformRequest),-1!==["post","put","patch"].indexOf(t.method)&&t.headers.setContentType("application/x-www-form-urlencoded",!1);return Qt.getAdapter(t.adapter||mt.adapter,t)(t).then(function(e){return Zt(t),e.data=xt.call(t,t.transformResponse,e),e.headers=St.from(e.headers),e},function(e){return Ot(e)||(Zt(t),e&&e.response&&(e.response.data=xt.call(t,t.transformResponse,e.response),e.response.headers=St.from(e.response.headers))),Promise.reject(e)})}const ee="1.13.6",ne={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{ne[t]=function(n){return typeof n===t||"a"+(e<1?"n ":" ")+t}});const re={};ne.transitional=function(t,e,n){return(r,o,i)=>{if(!1===t)throw new Y(function(t,e){return"[Axios v"+ee+"] Transitional option '"+t+"'"+e+(n?". "+n:"")}(o," has been removed"+(e?" in "+e:"")),Y.ERR_DEPRECATED);return e&&!re[o]&&(re[o]=!0),!t||t(r,o,i)}},ne.spelling=function(t){return(t,e)=>!0};const oe={assertOptions:function(t,e,n){if("object"!=typeof t)throw new Y("options must be an object",Y.ERR_BAD_OPTION_VALUE);const r=Object.keys(t);let o=r.length;for(;o-- >0;){const i=r[o],a=e[i];if(a){const e=t[i],n=void 0===e||a(e,i,t);if(!0!==n)throw new Y("option "+i+" must be "+n,Y.ERR_BAD_OPTION_VALUE);continue}if(!0!==n)throw new Y("Unknown option "+i,Y.ERR_BAD_OPTION)}},validators:ne},ie=oe.validators;let ae=class{constructor(t){this.defaults=t||{},this.interceptors={request:new at,response:new at}}async request(t,e){try{return await this._request(t,e)}catch(n){if(n instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=new Error;const e=t.stack?t.stack.replace(/^.+\n/,""):"";try{n.stack?e&&!String(n.stack).endsWith(e.replace(/^.+\n.+\n/,""))&&(n.stack+="\n"+e):n.stack=e}catch(r){}}throw n}}_request(t,e){"string"==typeof t?(e=e||{}).url=t:e=t||{},e=It(this.defaults,e);const{transitional:n,paramsSerializer:r,headers:o}=e;void 0!==n&&oe.assertOptions(n,{silentJSONParsing:ie.transitional(ie.boolean),forcedJSONParsing:ie.transitional(ie.boolean),clarifyTimeoutError:ie.transitional(ie.boolean),legacyInterceptorReqResOrdering:ie.transitional(ie.boolean)},!1),null!=r&&(K.isFunction(r)?e.paramsSerializer={serialize:r}:oe.assertOptions(r,{encode:ie.function,serialize:ie.function},!0)),void 0!==e.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?e.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:e.allowAbsoluteUrls=!0),oe.assertOptions(e,{baseUrl:ie.spelling("baseURL"),withXsrfToken:ie.spelling("withXSRFToken")},!0),e.method=(e.method||this.defaults.method||"get").toLowerCase();let i=o&&K.merge(o.common,o[e.method]);o&&K.forEach(["delete","get","head","post","put","patch","common"],t=>{delete o[t]}),e.headers=St.concat(i,o);const a=[];let s=!0;this.interceptors.request.forEach(function(t){if("function"==typeof t.runWhen&&!1===t.runWhen(e))return;s=s&&t.synchronous;const n=e.transitional||st;n&&n.legacyInterceptorReqResOrdering?a.unshift(t.fulfilled,t.rejected):a.push(t.fulfilled,t.rejected)});const c=[];let l;this.interceptors.response.forEach(function(t){c.push(t.fulfilled,t.rejected)});let u,f=0;if(!s){const t=[te.bind(this),void 0];for(t.unshift(...a),t.push(...c),u=t.length,l=Promise.resolve(e);f<u;)l=l.then(t[f++],t[f++]);return l}u=a.length;let d=e;for(;f<u;){const t=a[f++],e=a[f++];try{d=t(d)}catch(p){e.call(this,p);break}}try{l=te.call(this,d)}catch(p){return Promise.reject(p)}for(f=0,u=c.length;f<u;)l=l.then(c[f++],c[f++]);return l}getUri(t){return it(jt((t=It(this.defaults,t)).baseURL,t.url,t.allowAbsoluteUrls),t.params,t.paramsSerializer)}};K.forEach(["delete","get","head","options"],function(t){ae.prototype[t]=function(e,n){return this.request(It(n||{},{method:t,url:e,data:(n||{}).data}))}}),K.forEach(["post","put","patch"],function(t){function e(e){return function(n,r,o){return this.request(It(o||{},{method:t,headers:e?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}ae.prototype[t]=e(),ae.prototype[t+"Form"]=e(!0)});const se={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(se).forEach(([t,e])=>{se[e]=t});const ce=function t(e){const n=new ae(e),r=o(ae.prototype.request,n);return K.extend(r,ae.prototype,n,{allOwnKeys:!0}),K.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return t(It(e,n))},r}(mt);ce.Axios=ae,ce.CanceledError=_t,ce.CancelToken=class t{constructor(t){if("function"!=typeof t)throw new TypeError("executor must be a function.");let e;this.promise=new Promise(function(t){e=t});const n=this;this.promise.then(t=>{if(!n._listeners)return;let e=n._listeners.length;for(;e-- >0;)n._listeners[e](t);n._listeners=null}),this.promise.then=t=>{let e;const r=new Promise(t=>{n.subscribe(t),e=t}).then(t);return r.cancel=function(){n.unsubscribe(e)},r},t(function(t,r,o){n.reason||(n.reason=new _t(t,r,o),e(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){this.reason?t(this.reason):this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const e=this._listeners.indexOf(t);-1!==e&&this._listeners.splice(e,1)}toAbortSignal(){const t=new AbortController,e=e=>{t.abort(e)};return this.subscribe(e),t.signal.unsubscribe=()=>this.unsubscribe(e),t.signal}static source(){let e;return{token:new t(function(t){e=t}),cancel:e}}},ce.isCancel=Ot,ce.VERSION=ee,ce.toFormData=tt,ce.AxiosError=Y,ce.Cancel=ce.CanceledError,ce.all=function(t){return Promise.all(t)},ce.spread=function(t){return function(e){return t.apply(null,e)}},ce.isAxiosError=function(t){return K.isObject(t)&&!0===t.isAxiosError},ce.mergeConfig=It,ce.AxiosHeaders=St,ce.formToJSON=t=>gt(K.isHTMLForm(t)?new FormData(t):t),ce.getAdapter=Qt.getAdapter,ce.HttpStatusCode=se,ce.default=ce;const{Axios:le,AxiosError:ue,CanceledError:fe,isCancel:de,CancelToken:pe,VERSION:he,all:ge,Cancel:me,isAxiosError:ve,spread:be,toFormData:ye,AxiosHeaders:we,HttpStatusCode:Ee,formToJSON:Se,getAdapter:xe,mergeConfig:Oe}=ce;var _e={exports:{}};
|
|
2
2
|
/**!
|
|
3
3
|
* Sortable 1.14.0
|
|
4
4
|
* @author RubaXa <trash@rubaxa.org>
|
|
@@ -42,4 +42,4 @@ let rc;const sc=e=>rc=e,ic=Symbol();function lc(e){return e&&"object"==typeof e&
|
|
|
42
42
|
* vue-router v4.6.3
|
|
43
43
|
* (c) 2025 Eduardo San Martin Morote
|
|
44
44
|
* @license MIT
|
|
45
|
-
*/(e,t);n=Oa(o.reverse(),"beforeRouteLeave",e,t);for(const s of o)s.leaveGuards.forEach(o=>{n.push(ka(o,e,t))});const c=y.bind(null,e,t);return n.push(c),M(n).then(()=>{n=[];for(const o of s.list())n.push(ka(o,e,t));return n.push(c),M(n)}).then(()=>{n=Oa(r,"beforeRouteUpdate",e,t);for(const o of r)o.updateGuards.forEach(o=>{n.push(ka(o,e,t))});return n.push(c),M(n)}).then(()=>{n=[];for(const o of l)if(o.beforeEnter)if(Rc(o.beforeEnter))for(const r of o.beforeEnter)n.push(ka(r,e,t));else n.push(ka(o.beforeEnter,e,t));return n.push(c),M(n)}).then(()=>(e.matched.forEach(e=>e.enterCallbacks={}),n=Oa(l,"beforeRouteEnter",e,t,b),n.push(c),M(n))).then(()=>{n=[];for(const o of i.list())n.push(ka(o,e,t));return n.push(c),M(n)}).catch(e=>_a(e,ga.NAVIGATION_CANCELLED)?e:Promise.reject(e))}function S(e,t,n){l.list().forEach(o=>b(()=>o(e,t,n)))}function C(e,t,n,o,s){const i=g(e,t);if(i)return i;const l=t===ra,a=wc?history.state:{};n&&(o||l?r.replace(e.fullPath,Tc({scroll:l&&a&&a.scroll},s)):r.push(e.fullPath,s)),c.value=e,N(e,t,n,l),R()}let x;function w(){x||(x=r.listen((e,t,n)=>{if(!L.listening)return;const o=d(e),s=v(o,L.currentRoute.value);if(s)return void _(Tc(s,{replace:!0,force:!0}),o).catch(Oc);a=o;const i=c.value;var l,u;wc&&(l=pa(i.fullPath,n.delta),u=ua(),da.set(l,u)),E(o,i).catch(e=>_a(e,ga.NAVIGATION_ABORTED|ga.NAVIGATION_CANCELLED)?e:_a(e,ga.NAVIGATION_GUARD_REDIRECT)?(_(Tc(h(e.to),{force:!0}),o).then(e=>{_a(e,ga.NAVIGATION_ABORTED|ga.NAVIGATION_DUPLICATED)&&!n.delta&&n.type===sa.pop&&r.go(-1,!1)}).catch(Oc),Promise.reject()):(n.delta&&r.go(-n.delta,!1),O(e,o,i))).then(e=>{(e=e||C(o,i,!1))&&(n.delta&&!_a(e,ga.NAVIGATION_CANCELLED)?r.go(-n.delta,!1):n.type===sa.pop&&_a(e,ga.NAVIGATION_ABORTED|ga.NAVIGATION_DUPLICATED)&&r.go(-1,!1)),S(o,i,e)}).catch(Oc)}))}let A,T=Ta(),k=Ta();function O(e,t,n){R(e);const o=k.list();return o.length&&o.forEach(o=>o(e,t,n)),Promise.reject(e)}function R(e){return A||(A=!e,w(),T.list().forEach(([t,n])=>e?n(e):t()),T.reset()),e}function N(t,n,o,r){const{scrollBehavior:s}=e;if(!wc||!s)return Promise.resolve();const i=!o&&function(e){const t=da.get(e);return da.delete(e),t}(pa(t.fullPath,0))||(r||!o)&&history.state&&history.state.scroll||null;return an().then(()=>s(t,n,i)).then(e=>e&&fa(e)).catch(e=>O(e,t,n))}const P=e=>r.go(e);let I;const D=new Set,L={currentRoute:c,listening:!0,addRoute:function(e,n){let o,r;return ha(e)?(o=t.getRecordMatcher(e),r=n):r=e,t.addRoute(r,o)},removeRoute:function(e){const n=t.getRecordMatcher(e);n&&t.removeRoute(n)},clearRoutes:t.clearRoutes,hasRoute:function(e){return!!t.getRecordMatcher(e)},getRoutes:function(){return t.getRoutes().map(e=>e.record)},resolve:d,options:e,push:m,replace:function(e){return m(Tc(h(e),{replace:!0}))},go:P,back:()=>P(-1),forward:()=>P(1),beforeEach:s.add,beforeResolve:i.add,afterEach:l.add,onError:k.add,isReady:function(){return A&&c.value!==ra?Promise.resolve():new Promise((e,t)=>{T.add([e,t])})},install(e){e.component("RouterLink",tu),e.component("RouterView",su),e.config.globalProperties.$router=L,Object.defineProperty(e.config.globalProperties,"$route",{enumerable:!0,get:()=>Dt(c)}),wc&&!I&&c.value===ra&&(I=!0,m(r.location).catch(e=>{}));const t={};for(const o in ra)Object.defineProperty(t,o,{get:()=>c.value[o],enumerable:!0});e.provide(xa,L),e.provide(wa,vt(t)),e.provide(Aa,c);const n=e.unmount;D.add(e),e.unmount=function(){D.delete(e),D.size<1&&(a=ra,x&&x(),x=null,c.value=ra,I=!1,A=!1),n()}}};function M(e){return e.reduce((e,t)=>e.then(()=>b(t)),Promise.resolve())}return L}function lu(){return mr(xa)}function cu(e){return mr(wa)}const au=e(oc);export{
|
|
45
|
+
*/(e,t);n=Oa(o.reverse(),"beforeRouteLeave",e,t);for(const s of o)s.leaveGuards.forEach(o=>{n.push(ka(o,e,t))});const c=y.bind(null,e,t);return n.push(c),M(n).then(()=>{n=[];for(const o of s.list())n.push(ka(o,e,t));return n.push(c),M(n)}).then(()=>{n=Oa(r,"beforeRouteUpdate",e,t);for(const o of r)o.updateGuards.forEach(o=>{n.push(ka(o,e,t))});return n.push(c),M(n)}).then(()=>{n=[];for(const o of l)if(o.beforeEnter)if(Rc(o.beforeEnter))for(const r of o.beforeEnter)n.push(ka(r,e,t));else n.push(ka(o.beforeEnter,e,t));return n.push(c),M(n)}).then(()=>(e.matched.forEach(e=>e.enterCallbacks={}),n=Oa(l,"beforeRouteEnter",e,t,b),n.push(c),M(n))).then(()=>{n=[];for(const o of i.list())n.push(ka(o,e,t));return n.push(c),M(n)}).catch(e=>_a(e,ga.NAVIGATION_CANCELLED)?e:Promise.reject(e))}function S(e,t,n){l.list().forEach(o=>b(()=>o(e,t,n)))}function C(e,t,n,o,s){const i=g(e,t);if(i)return i;const l=t===ra,a=wc?history.state:{};n&&(o||l?r.replace(e.fullPath,Tc({scroll:l&&a&&a.scroll},s)):r.push(e.fullPath,s)),c.value=e,N(e,t,n,l),R()}let x;function w(){x||(x=r.listen((e,t,n)=>{if(!L.listening)return;const o=d(e),s=v(o,L.currentRoute.value);if(s)return void _(Tc(s,{replace:!0,force:!0}),o).catch(Oc);a=o;const i=c.value;var l,u;wc&&(l=pa(i.fullPath,n.delta),u=ua(),da.set(l,u)),E(o,i).catch(e=>_a(e,ga.NAVIGATION_ABORTED|ga.NAVIGATION_CANCELLED)?e:_a(e,ga.NAVIGATION_GUARD_REDIRECT)?(_(Tc(h(e.to),{force:!0}),o).then(e=>{_a(e,ga.NAVIGATION_ABORTED|ga.NAVIGATION_DUPLICATED)&&!n.delta&&n.type===sa.pop&&r.go(-1,!1)}).catch(Oc),Promise.reject()):(n.delta&&r.go(-n.delta,!1),O(e,o,i))).then(e=>{(e=e||C(o,i,!1))&&(n.delta&&!_a(e,ga.NAVIGATION_CANCELLED)?r.go(-n.delta,!1):n.type===sa.pop&&_a(e,ga.NAVIGATION_ABORTED|ga.NAVIGATION_DUPLICATED)&&r.go(-1,!1)),S(o,i,e)}).catch(Oc)}))}let A,T=Ta(),k=Ta();function O(e,t,n){R(e);const o=k.list();return o.length&&o.forEach(o=>o(e,t,n)),Promise.reject(e)}function R(e){return A||(A=!e,w(),T.list().forEach(([t,n])=>e?n(e):t()),T.reset()),e}function N(t,n,o,r){const{scrollBehavior:s}=e;if(!wc||!s)return Promise.resolve();const i=!o&&function(e){const t=da.get(e);return da.delete(e),t}(pa(t.fullPath,0))||(r||!o)&&history.state&&history.state.scroll||null;return an().then(()=>s(t,n,i)).then(e=>e&&fa(e)).catch(e=>O(e,t,n))}const P=e=>r.go(e);let I;const D=new Set,L={currentRoute:c,listening:!0,addRoute:function(e,n){let o,r;return ha(e)?(o=t.getRecordMatcher(e),r=n):r=e,t.addRoute(r,o)},removeRoute:function(e){const n=t.getRecordMatcher(e);n&&t.removeRoute(n)},clearRoutes:t.clearRoutes,hasRoute:function(e){return!!t.getRecordMatcher(e)},getRoutes:function(){return t.getRoutes().map(e=>e.record)},resolve:d,options:e,push:m,replace:function(e){return m(Tc(h(e),{replace:!0}))},go:P,back:()=>P(-1),forward:()=>P(1),beforeEach:s.add,beforeResolve:i.add,afterEach:l.add,onError:k.add,isReady:function(){return A&&c.value!==ra?Promise.resolve():new Promise((e,t)=>{T.add([e,t])})},install(e){e.component("RouterLink",tu),e.component("RouterView",su),e.config.globalProperties.$router=L,Object.defineProperty(e.config.globalProperties,"$route",{enumerable:!0,get:()=>Dt(c)}),wc&&!I&&c.value===ra&&(I=!0,m(r.location).catch(e=>{}));const t={};for(const o in ra)Object.defineProperty(t,o,{get:()=>c.value[o],enumerable:!0});e.provide(xa,L),e.provide(wa,vt(t)),e.provide(Aa,c);const n=e.unmount;D.add(e),e.unmount=function(){D.delete(e),D.size<1&&(a=ra,x&&x(),x=null,c.value=ra,I=!1,A=!1),n()}}};function M(e){return e.reduce((e,t)=>e.then(()=>b(t)),Promise.resolve())}return L}function lu(){return mr(xa)}function cu(e){return mr(wa)}const au=e(oc);export{$o as $,Nt as A,Gr as B,ms as C,Oi as D,El as E,hs as F,Wi as G,Ds as H,gs as I,At as J,No as K,K as L,Zl as M,Dt as N,xt as O,wt as P,jt as Q,B as R,au as S,Dn as T,iu as U,Ia as V,Fs as W,Ps as X,Sn as Y,Hl as Z,Z as _,Ns as a,As as a0,Cc as a1,Ho as a2,jo as a3,xc as a4,cu as a5,Wl as a6,Fo as a7,lu as a8,uc as a9,Ot as aa,Ms as b,ws as c,Xn as d,_t as e,ai as f,qs as g,To as h,Ro as i,Ao as j,mt as k,mr as l,_o as m,yo as n,bs as o,Ls as p,gr as q,Rt as r,Cn as s,ui as t,$t as u,an as v,Kr as w,Go as x,Bs as y,Ts as z};
|
package/dist/web/index.html
CHANGED
|
@@ -5,14 +5,14 @@
|
|
|
5
5
|
<link rel="icon" href="/favicon.ico">
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
7
7
|
<title>coding-tool-x · AI 编程工作台</title>
|
|
8
|
-
<script type="module" crossorigin src="/assets/index-
|
|
8
|
+
<script type="module" crossorigin src="/assets/index-BsdIJwLf.js"></script>
|
|
9
9
|
<link rel="modulepreload" crossorigin href="/assets/markdown-BNJfEgCA.js">
|
|
10
|
-
<link rel="modulepreload" crossorigin href="/assets/vue-vendor-
|
|
11
|
-
<link rel="modulepreload" crossorigin href="/assets/naive-ui-
|
|
12
|
-
<link rel="modulepreload" crossorigin href="/assets/icons-
|
|
13
|
-
<link rel="modulepreload" crossorigin href="/assets/vendors
|
|
10
|
+
<link rel="modulepreload" crossorigin href="/assets/vue-vendor-B5RqjEjQ.js">
|
|
11
|
+
<link rel="modulepreload" crossorigin href="/assets/naive-ui-DM897mIP.js">
|
|
12
|
+
<link rel="modulepreload" crossorigin href="/assets/icons-QFXzEgqM.js">
|
|
13
|
+
<link rel="modulepreload" crossorigin href="/assets/vendors-DQA4Hw9v.js">
|
|
14
14
|
<link rel="stylesheet" crossorigin href="/assets/markdown-BfC0goYb.css">
|
|
15
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
15
|
+
<link rel="stylesheet" crossorigin href="/assets/index-0isNzXNY.css">
|
|
16
16
|
</head>
|
|
17
17
|
<body>
|
|
18
18
|
<div id="app"></div>
|
package/package.json
CHANGED
package/src/commands/daemon.js
CHANGED
|
@@ -181,7 +181,10 @@ function updatePM2Daemon() {
|
|
|
181
181
|
});
|
|
182
182
|
}
|
|
183
183
|
|
|
184
|
-
function dumpPM2State(
|
|
184
|
+
function dumpPM2State(options = {}) {
|
|
185
|
+
const timeoutMs = options.timeoutMs || 2000;
|
|
186
|
+
const force = options.force === true;
|
|
187
|
+
|
|
185
188
|
return new Promise((resolve) => {
|
|
186
189
|
let settled = false;
|
|
187
190
|
const timer = setTimeout(() => {
|
|
@@ -192,7 +195,7 @@ function dumpPM2State(timeoutMs = 2000) {
|
|
|
192
195
|
resolve({ timedOut: true, err: null });
|
|
193
196
|
}, timeoutMs);
|
|
194
197
|
|
|
195
|
-
pm2.dump((err) => {
|
|
198
|
+
pm2.dump(force, (err) => {
|
|
196
199
|
if (settled) {
|
|
197
200
|
return;
|
|
198
201
|
}
|
|
@@ -206,7 +209,10 @@ function dumpPM2State(timeoutMs = 2000) {
|
|
|
206
209
|
async function finalizePM2Session(options = {}) {
|
|
207
210
|
const shouldPersist = options.persist === true;
|
|
208
211
|
if (shouldPersist) {
|
|
209
|
-
const result = await dumpPM2State(
|
|
212
|
+
const result = await dumpPM2State({
|
|
213
|
+
timeoutMs: options.timeoutMs,
|
|
214
|
+
force: options.force === true
|
|
215
|
+
});
|
|
210
216
|
if (result.err) {
|
|
211
217
|
console.log(chalk.yellow(`[WARN] 保存 PM2 状态失败: ${result.err.message}`));
|
|
212
218
|
} else if (result.timedOut) {
|
|
@@ -593,7 +599,10 @@ async function handleStop() {
|
|
|
593
599
|
const stopResult = await stopAllManagedInstances(existing, config);
|
|
594
600
|
printStopResult(stopResult);
|
|
595
601
|
|
|
596
|
-
await finalizePM2Session({
|
|
602
|
+
await finalizePM2Session({
|
|
603
|
+
persist: stopResult.hadPM2Process,
|
|
604
|
+
force: true
|
|
605
|
+
});
|
|
597
606
|
} catch (error) {
|
|
598
607
|
console.error(chalk.red('停止失败:'), error.message);
|
|
599
608
|
disconnectPM2();
|
|
@@ -109,7 +109,8 @@ router.post('/', (req, res) => {
|
|
|
109
109
|
speedTestModel,
|
|
110
110
|
gatewaySourceType,
|
|
111
111
|
targetApi,
|
|
112
|
-
balanceToken
|
|
112
|
+
balanceToken,
|
|
113
|
+
balanceUserId
|
|
113
114
|
} = req.body;
|
|
114
115
|
|
|
115
116
|
if (!name || !baseUrl) {
|
|
@@ -131,7 +132,8 @@ router.post('/', (req, res) => {
|
|
|
131
132
|
speedTestModel: speedTestModel || null,
|
|
132
133
|
gatewaySourceType,
|
|
133
134
|
targetApi,
|
|
134
|
-
balanceToken: balanceToken || ''
|
|
135
|
+
balanceToken: balanceToken || '',
|
|
136
|
+
balanceUserId: balanceUserId || null
|
|
135
137
|
});
|
|
136
138
|
res.json({ channel });
|
|
137
139
|
broadcastSchedulerState('claude', getSchedulerState('claude'));
|
|
@@ -142,7 +142,8 @@ module.exports = (config) => {
|
|
|
142
142
|
speedTestModel,
|
|
143
143
|
presetId,
|
|
144
144
|
gatewaySourceType,
|
|
145
|
-
balanceToken
|
|
145
|
+
balanceToken,
|
|
146
|
+
balanceUserId
|
|
146
147
|
} = req.body;
|
|
147
148
|
|
|
148
149
|
if (!name || !providerKey || !baseUrl) {
|
|
@@ -169,6 +170,7 @@ module.exports = (config) => {
|
|
|
169
170
|
presetId: presetId || null,
|
|
170
171
|
gatewaySourceType,
|
|
171
172
|
balanceToken: balanceToken || '',
|
|
173
|
+
balanceUserId: balanceUserId || null,
|
|
172
174
|
requiresOpenaiAuth: false
|
|
173
175
|
});
|
|
174
176
|
res.json(channel);
|
|
@@ -39,6 +39,29 @@ function normalizeForkOptions(body = {}) {
|
|
|
39
39
|
};
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
+
function withUserAnchorContext(paginatedMessages, sortedMessages) {
|
|
43
|
+
if (paginatedMessages.length === 0 || paginatedMessages.some(message => message.type === 'user')) {
|
|
44
|
+
return paginatedMessages;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
const userAnchor = sortedMessages.find(message => message.type === 'user' && message.userMessageNumber);
|
|
48
|
+
if (!userAnchor) {
|
|
49
|
+
return paginatedMessages;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
return [
|
|
53
|
+
...paginatedMessages,
|
|
54
|
+
{
|
|
55
|
+
type: 'user',
|
|
56
|
+
content: '',
|
|
57
|
+
timestamp: userAnchor.timestamp || null,
|
|
58
|
+
model: null,
|
|
59
|
+
userMessageNumber: userAnchor.userMessageNumber,
|
|
60
|
+
anchorOnly: true
|
|
61
|
+
}
|
|
62
|
+
];
|
|
63
|
+
}
|
|
64
|
+
|
|
42
65
|
module.exports = (config) => {
|
|
43
66
|
// ============================================
|
|
44
67
|
// 静态路由必须放在参数路由之前
|
|
@@ -389,7 +412,7 @@ module.exports = (config) => {
|
|
|
389
412
|
const totalMessages = messages.length;
|
|
390
413
|
const start = (pageNum - 1) * limitNum;
|
|
391
414
|
const end = start + limitNum;
|
|
392
|
-
const paginatedMessages = messages.slice(start, end);
|
|
415
|
+
const paginatedMessages = withUserAnchorContext(messages.slice(start, end), messages);
|
|
393
416
|
|
|
394
417
|
res.json({
|
|
395
418
|
messages: paginatedMessages,
|
|
@@ -123,7 +123,8 @@ module.exports = (config) => {
|
|
|
123
123
|
speedTestModel,
|
|
124
124
|
presetId,
|
|
125
125
|
gatewaySourceType,
|
|
126
|
-
balanceToken
|
|
126
|
+
balanceToken,
|
|
127
|
+
balanceUserId
|
|
127
128
|
} = req.body;
|
|
128
129
|
|
|
129
130
|
if (!name || !baseUrl) {
|
|
@@ -143,7 +144,8 @@ module.exports = (config) => {
|
|
|
143
144
|
speedTestModel: speedTestModel || null,
|
|
144
145
|
presetId: presetId || null,
|
|
145
146
|
gatewaySourceType,
|
|
146
|
-
balanceToken: balanceToken || ''
|
|
147
|
+
balanceToken: balanceToken || '',
|
|
148
|
+
balanceUserId: balanceUserId || null
|
|
147
149
|
});
|
|
148
150
|
res.json(channel);
|
|
149
151
|
broadcastSchedulerState('gemini', getSchedulerState('gemini'));
|
|
@@ -262,7 +262,8 @@ module.exports = (config) => {
|
|
|
262
262
|
speedTestModel,
|
|
263
263
|
presetId,
|
|
264
264
|
websiteUrl,
|
|
265
|
-
balanceToken
|
|
265
|
+
balanceToken,
|
|
266
|
+
balanceUserId
|
|
266
267
|
} = req.body;
|
|
267
268
|
|
|
268
269
|
if (!name || !baseUrl) {
|
|
@@ -284,7 +285,8 @@ module.exports = (config) => {
|
|
|
284
285
|
speedTestModel: speedTestModel || null,
|
|
285
286
|
presetId,
|
|
286
287
|
websiteUrl,
|
|
287
|
-
balanceToken: balanceToken || ''
|
|
288
|
+
balanceToken: balanceToken || '',
|
|
289
|
+
balanceUserId: balanceUserId || null
|
|
288
290
|
});
|
|
289
291
|
|
|
290
292
|
res.json(channel);
|
|
@@ -38,6 +38,29 @@ function resolveBalanceToken(channel = {}) {
|
|
|
38
38
|
);
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
+
function resolveBalanceUserId(channel = {}) {
|
|
42
|
+
const raw = channel.balanceUserId
|
|
43
|
+
?? channel.platformUserId
|
|
44
|
+
?? channel.newApiUserId
|
|
45
|
+
?? null;
|
|
46
|
+
const parsed = parseFiniteNumber(raw);
|
|
47
|
+
if (parsed == null || parsed <= 0) return null;
|
|
48
|
+
return Math.trunc(parsed);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function buildUserIdHeaders(userId) {
|
|
52
|
+
if (!userId) return {};
|
|
53
|
+
const value = String(userId);
|
|
54
|
+
return {
|
|
55
|
+
'New-Api-User': value,
|
|
56
|
+
'Veloera-User': value,
|
|
57
|
+
'voapi-user': value,
|
|
58
|
+
'User-id': value,
|
|
59
|
+
'Rix-Api-User': value,
|
|
60
|
+
'neo-api-user': value
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
|
|
41
64
|
function buildAuthHeaders(token, extra = {}) {
|
|
42
65
|
return {
|
|
43
66
|
Accept: 'application/json',
|
|
@@ -46,6 +69,38 @@ function buildAuthHeaders(token, extra = {}) {
|
|
|
46
69
|
};
|
|
47
70
|
}
|
|
48
71
|
|
|
72
|
+
function hasDedicatedBalanceToken(channel = {}) {
|
|
73
|
+
return !!String(
|
|
74
|
+
channel.balanceToken
|
|
75
|
+
|| channel.balanceApiKey
|
|
76
|
+
|| channel.balanceAuthToken
|
|
77
|
+
|| ''
|
|
78
|
+
).trim();
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
function buildCookieCandidates(token) {
|
|
82
|
+
const raw = stripBearer(token);
|
|
83
|
+
if (!raw) return [];
|
|
84
|
+
|
|
85
|
+
const candidates = [];
|
|
86
|
+
const normalized = raw.replace(/^cookie:\s*/i, '').trim();
|
|
87
|
+
if (!normalized) return [];
|
|
88
|
+
if (normalized.includes('=')) {
|
|
89
|
+
candidates.push(normalized);
|
|
90
|
+
}
|
|
91
|
+
candidates.push(`session=${normalized}`);
|
|
92
|
+
candidates.push(`token=${normalized}`);
|
|
93
|
+
return Array.from(new Set(candidates));
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
function shouldTryCookieAuth(token, channel = {}, hintedPlatform = null) {
|
|
97
|
+
const raw = stripBearer(token);
|
|
98
|
+
if (!raw) return false;
|
|
99
|
+
return hasDedicatedBalanceToken(channel)
|
|
100
|
+
|| raw.includes('=')
|
|
101
|
+
|| (hintedPlatform === 'anyrouter' && !isLikelyModelApiKey(raw));
|
|
102
|
+
}
|
|
103
|
+
|
|
49
104
|
function isLikelyModelApiKey(token) {
|
|
50
105
|
return /^sk-[a-z0-9]/i.test(stripBearer(token));
|
|
51
106
|
}
|
|
@@ -887,7 +942,9 @@ function buildBalanceProbeStrategies(baseUrl, channel = {}, token = '') {
|
|
|
887
942
|
type: 'hub-user-self',
|
|
888
943
|
baseUrl,
|
|
889
944
|
platform: HUB_PLATFORMS.has(hintedPlatform) ? hintedPlatform : null,
|
|
890
|
-
hintedPlatform
|
|
945
|
+
hintedPlatform,
|
|
946
|
+
userId: resolveBalanceUserId(channel),
|
|
947
|
+
allowCookieAuth: shouldTryCookieAuth(token, channel, hintedPlatform)
|
|
891
948
|
});
|
|
892
949
|
};
|
|
893
950
|
const addNewApiTokenUsageStrategy = () => {
|
|
@@ -991,8 +1048,29 @@ async function runSub2ApiUsageStrategy(strategy, token) {
|
|
|
991
1048
|
return buildSub2ApiUsageSnapshot(payload);
|
|
992
1049
|
}
|
|
993
1050
|
|
|
1051
|
+
async function fetchHubUserSelfWithCookie(baseUrl, token, platform, quotaUnit, userId) {
|
|
1052
|
+
for (const cookie of buildCookieCandidates(token)) {
|
|
1053
|
+
const payload = await tryRequestJson(joinUrl(baseUrl, '/api/user/self'), {
|
|
1054
|
+
headers: {
|
|
1055
|
+
Accept: 'application/json',
|
|
1056
|
+
Cookie: cookie,
|
|
1057
|
+
...buildUserIdHeaders(userId)
|
|
1058
|
+
}
|
|
1059
|
+
});
|
|
1060
|
+
const snapshot = buildHubBalanceSnapshot(platform, {
|
|
1061
|
+
...payload,
|
|
1062
|
+
data: payload?.data && typeof payload.data === 'object'
|
|
1063
|
+
? { ...payload.data, quota_per_unit: quotaUnit || payload.data.quota_per_unit }
|
|
1064
|
+
: payload?.data
|
|
1065
|
+
});
|
|
1066
|
+
if (snapshot.visible) return snapshot;
|
|
1067
|
+
}
|
|
1068
|
+
return makeHiddenSnapshot(platform);
|
|
1069
|
+
}
|
|
1070
|
+
|
|
994
1071
|
async function runHubUserSelfStrategy(strategy, token) {
|
|
995
|
-
const
|
|
1072
|
+
const userId = strategy.userId || null;
|
|
1073
|
+
const headers = buildAuthHeaders(token, buildUserIdHeaders(userId));
|
|
996
1074
|
let platform = strategy.platform;
|
|
997
1075
|
let quotaUnit = null;
|
|
998
1076
|
if (!HUB_PLATFORMS.has(platform)) {
|
|
@@ -1002,13 +1080,21 @@ async function runHubUserSelfStrategy(strategy, token) {
|
|
|
1002
1080
|
}
|
|
1003
1081
|
if (!HUB_PLATFORMS.has(platform)) return { snapshot: makeHiddenSnapshot(platform), strategy };
|
|
1004
1082
|
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
: payload?.data
|
|
1011
|
-
|
|
1083
|
+
let snapshot = makeHiddenSnapshot(platform);
|
|
1084
|
+
try {
|
|
1085
|
+
const payload = await requestJson(joinUrl(strategy.baseUrl, '/api/user/self'), { headers });
|
|
1086
|
+
snapshot = buildHubBalanceSnapshot(platform, {
|
|
1087
|
+
...payload,
|
|
1088
|
+
data: payload?.data && typeof payload.data === 'object'
|
|
1089
|
+
? { ...payload.data, quota_per_unit: quotaUnit || payload.data.quota_per_unit }
|
|
1090
|
+
: payload?.data
|
|
1091
|
+
});
|
|
1092
|
+
} catch (error) {
|
|
1093
|
+
if (!strategy.allowCookieAuth) throw error;
|
|
1094
|
+
}
|
|
1095
|
+
if (!snapshot.visible && strategy.allowCookieAuth) {
|
|
1096
|
+
snapshot = await fetchHubUserSelfWithCookie(strategy.baseUrl, token, platform, quotaUnit, userId);
|
|
1097
|
+
}
|
|
1012
1098
|
return {
|
|
1013
1099
|
snapshot,
|
|
1014
1100
|
strategy: {
|
|
@@ -1341,6 +1427,8 @@ module.exports = {
|
|
|
1341
1427
|
buildSub2ApiUsageSnapshot,
|
|
1342
1428
|
resolveStatusPlatform,
|
|
1343
1429
|
resolveBalanceToken,
|
|
1430
|
+
resolveBalanceUserId,
|
|
1431
|
+
buildCookieCandidates,
|
|
1344
1432
|
build88CodeApiBaseCandidates,
|
|
1345
1433
|
buildOpenRouterApiBaseCandidates,
|
|
1346
1434
|
buildSiliconFlowApiBaseCandidates,
|
|
@@ -114,6 +114,8 @@ function loadChannels() {
|
|
|
114
114
|
enabled: ch.enabled !== false, // 默认启用
|
|
115
115
|
weight: ch.weight || 1,
|
|
116
116
|
maxConcurrency: ch.maxConcurrency || null,
|
|
117
|
+
balanceToken: ch.balanceToken || '',
|
|
118
|
+
balanceUserId: ch.balanceUserId || null,
|
|
117
119
|
modelRedirects: ch.modelRedirects || [],
|
|
118
120
|
speedTestModel: ch.speedTestModel || null,
|
|
119
121
|
gatewaySourceType: normalizeGatewaySourceType(ch.gatewaySourceType, 'gemini')
|
|
@@ -165,6 +167,8 @@ function initializeFromEnv() {
|
|
|
165
167
|
enabled: true,
|
|
166
168
|
weight: 1,
|
|
167
169
|
maxConcurrency: null,
|
|
170
|
+
balanceToken: '',
|
|
171
|
+
balanceUserId: null,
|
|
168
172
|
gatewaySourceType: 'gemini',
|
|
169
173
|
createdAt: Date.now(),
|
|
170
174
|
updatedAt: Date.now()
|
|
@@ -222,6 +226,8 @@ function createChannel(name, baseUrl, apiKey, model = 'gemini-2.5-pro', extraCon
|
|
|
222
226
|
enabled: extraConfig.enabled !== false, // 默认启用
|
|
223
227
|
weight: extraConfig.weight || 1,
|
|
224
228
|
maxConcurrency: extraConfig.maxConcurrency || null,
|
|
229
|
+
balanceToken: extraConfig.balanceToken || '',
|
|
230
|
+
balanceUserId: extraConfig.balanceUserId || null,
|
|
225
231
|
modelRedirects: extraConfig.modelRedirects || [],
|
|
226
232
|
speedTestModel: extraConfig.speedTestModel || null,
|
|
227
233
|
gatewaySourceType: normalizeGatewaySourceType(extraConfig.gatewaySourceType, 'gemini'),
|
|
@@ -269,6 +275,8 @@ function updateChannel(channelId, updates) {
|
|
|
269
275
|
createdAt: oldChannel.createdAt, // 保持创建时间
|
|
270
276
|
modelRedirects: updates.modelRedirects !== undefined ? updates.modelRedirects : (oldChannel.modelRedirects || []),
|
|
271
277
|
speedTestModel: updates.speedTestModel !== undefined ? updates.speedTestModel : (oldChannel.speedTestModel || null),
|
|
278
|
+
balanceToken: updates.balanceToken !== undefined ? updates.balanceToken : (oldChannel.balanceToken || ''),
|
|
279
|
+
balanceUserId: updates.balanceUserId !== undefined ? updates.balanceUserId : (oldChannel.balanceUserId || null),
|
|
272
280
|
gatewaySourceType: normalizeGatewaySourceType(merged.gatewaySourceType, 'gemini'),
|
|
273
281
|
updatedAt: Date.now()
|
|
274
282
|
};
|
|
@@ -77,6 +77,8 @@ function loadChannels() {
|
|
|
77
77
|
enabled: ch.enabled !== false,
|
|
78
78
|
weight: ch.weight || 1,
|
|
79
79
|
maxConcurrency: ch.maxConcurrency || null,
|
|
80
|
+
balanceToken: ch.balanceToken || '',
|
|
81
|
+
balanceUserId: ch.balanceUserId || null,
|
|
80
82
|
modelRedirects: ch.modelRedirects || [],
|
|
81
83
|
speedTestModel: ch.speedTestModel || null,
|
|
82
84
|
wireApi: ch.wireApi || 'openai', // OpenCode 默认使用 OpenAI 兼容格式
|
|
@@ -155,6 +157,8 @@ function createChannel(name, baseUrl, apiKey, extraConfig = {}) {
|
|
|
155
157
|
enabled: extraConfig.enabled !== false,
|
|
156
158
|
weight: extraConfig.weight || 1,
|
|
157
159
|
maxConcurrency: extraConfig.maxConcurrency || null,
|
|
160
|
+
balanceToken: extraConfig.balanceToken || '',
|
|
161
|
+
balanceUserId: extraConfig.balanceUserId || null,
|
|
158
162
|
modelRedirects: extraConfig.modelRedirects || [],
|
|
159
163
|
speedTestModel: extraConfig.speedTestModel || null,
|
|
160
164
|
model: extraConfig.model || null,
|
|
@@ -207,6 +211,8 @@ function updateChannel(channelId, updates) {
|
|
|
207
211
|
createdAt: oldChannel.createdAt,
|
|
208
212
|
modelRedirects: updates.modelRedirects !== undefined ? updates.modelRedirects : (oldChannel.modelRedirects || []),
|
|
209
213
|
speedTestModel: updates.speedTestModel !== undefined ? updates.speedTestModel : (oldChannel.speedTestModel || null),
|
|
214
|
+
balanceToken: updates.balanceToken !== undefined ? updates.balanceToken : (oldChannel.balanceToken || ''),
|
|
215
|
+
balanceUserId: updates.balanceUserId !== undefined ? updates.balanceUserId : (oldChannel.balanceUserId || null),
|
|
210
216
|
gatewaySourceType: normalizeGatewaySourceType(
|
|
211
217
|
updates.gatewaySourceType !== undefined
|
|
212
218
|
? updates.gatewaySourceType
|