@vtj/utils
Version:
VTJ 是一款基于 Vue3 + Typescript 的低代码页面可视化设计器。内置低代码引擎、渲染器和代码生成器,面向前端开发者,开箱即用。 无缝嵌入本地开发工程,不改变前端开发流程和编码习惯。
12 lines • 52.6 kB
JavaScript
"use strict";var It=Object.defineProperty;var qt=(e,t,n)=>t in e?It(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var _=(e,t,n)=>qt(e,typeof t!="symbol"?t+"":t,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const O=require("@vtj/base"),me=require("vue");(function(){if(typeof window>"u"||typeof EventTarget>"u")return;const e=EventTarget.prototype.addEventListener;EventTarget.prototype.addEventListener=function(t,n,r){typeof r!="boolean"&&(r=r||{},r.passive=!1),e.call(this,t,n,r)}})();/**!
* Copyright (c) 2026, VTJ.PRO All rights reserved.
* @name @vtj/utils
* @author CHC chenhuachun1549@dingtalk.com
* @version 0.14.0
* @license <a href="https://vtj.pro/license.html">MIT License</a>
*/const Mt="0.14.0";function st(e,t){return function(){return e.apply(t,arguments)}}const{toString:Ht}=Object.prototype,{getPrototypeOf:Ce}=Object,{iterator:ce,toStringTag:it}=Symbol,le=(e=>t=>{const n=Ht.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),F=e=>(e=e.toLowerCase(),t=>le(t)===e),ue=e=>t=>typeof t===e,{isArray:$}=Array,H=ue("undefined");function X(e){return e!==null&&!H(e)&&e.constructor!==null&&!H(e.constructor)&&x(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const at=F("ArrayBuffer");function Jt(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&at(e.buffer),t}const $t=ue("string"),x=ue("function"),ct=ue("number"),Q=e=>e!==null&&typeof e=="object",zt=e=>e===!0||e===!1,oe=e=>{if(le(e)!=="object")return!1;const t=Ce(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(it in e)&&!(ce in e)},Wt=e=>{if(!Q(e)||X(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},Vt=F("Date"),Kt=F("File"),Xt=F("Blob"),Qt=F("FileList"),Gt=e=>Q(e)&&x(e.pipe),Yt=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||x(e.append)&&((t=le(e))==="formdata"||t==="object"&&x(e.toString)&&e.toString()==="[object FormData]"))},Zt=F("URLSearchParams"),[en,tn,nn,rn]=["ReadableStream","Request","Response","Headers"].map(F),on=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function G(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,o;if(typeof e!="object"&&(e=[e]),$(e))for(r=0,o=e.length;r<o;r++)t.call(null,e[r],r,e);else{if(X(e))return;const s=n?Object.getOwnPropertyNames(e):Object.keys(e),i=s.length;let a;for(r=0;r<i;r++)a=s[r],t.call(null,e[a],a,e)}}function lt(e,t){if(X(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r=n.length,o;for(;r-- >0;)if(o=n[r],t===o.toLowerCase())return o;return null}const v=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,ut=e=>!H(e)&&e!==v;function Ee(){const{caseless:e,skipUndefined:t}=ut(this)&&this||{},n={},r=(o,s)=>{const i=e&<(n,s)||s;oe(n[i])&&oe(o)?n[i]=Ee(n[i],o):oe(o)?n[i]=Ee({},o):$(o)?n[i]=o.slice():(!t||!H(o))&&(n[i]=o)};for(let o=0,s=arguments.length;o<s;o++)arguments[o]&&G(arguments[o],r);return n}const sn=(e,t,n,{allOwnKeys:r}={})=>(G(t,(o,s)=>{n&&x(o)?e[s]=st(o,n):e[s]=o},{allOwnKeys:r}),e),an=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),cn=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},ln=(e,t,n,r)=>{let o,s,i;const a={};if(t=t||{},e==null)return t;do{for(o=Object.getOwnPropertyNames(e),s=o.length;s-- >0;)i=o[s],(!r||r(i,e,t))&&!a[i]&&(t[i]=e[i],a[i]=!0);e=n!==!1&&Ce(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},un=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},fn=e=>{if(!e)return null;if($(e))return e;let t=e.length;if(!ct(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},dn=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Ce(Uint8Array)),pn=(e,t)=>{const r=(e&&e[ce]).call(e);let o;for(;(o=r.next())&&!o.done;){const s=o.value;t.call(e,s[0],s[1])}},hn=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},mn=F("HTMLFormElement"),gn=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,o){return r.toUpperCase()+o}),qe=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),yn=F("RegExp"),ft=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};G(n,(o,s)=>{let i;(i=t(o,s,e))!==!1&&(r[s]=i||o)}),Object.defineProperties(e,r)},wn=e=>{ft(e,(t,n)=>{if(x(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(x(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},bn=(e,t)=>{const n={},r=o=>{o.forEach(s=>{n[s]=!0})};return $(e)?r(e):r(String(e).split(t)),n},En=()=>{},Sn=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function Rn(e){return!!(e&&x(e.append)&&e[it]==="FormData"&&e[ce])}const On=e=>{const t=new Array(10),n=(r,o)=>{if(Q(r)){if(t.indexOf(r)>=0)return;if(X(r))return r;if(!("toJSON"in r)){t[o]=r;const s=$(r)?[]:{};return G(r,(i,a)=>{const f=n(i,o+1);!H(f)&&(s[a]=f)}),t[o]=void 0,s}}return r};return n(e,0)},Tn=F("AsyncFunction"),An=e=>e&&(Q(e)||x(e))&&x(e.then)&&x(e.catch),dt=((e,t)=>e?setImmediate:t?((n,r)=>(v.addEventListener("message",({source:o,data:s})=>{o===v&&s===n&&r.length&&r.shift()()},!1),o=>{r.push(o),v.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",x(v.postMessage)),xn=typeof queueMicrotask<"u"?queueMicrotask.bind(v):typeof process<"u"&&process.nextTick||dt,Cn=e=>e!=null&&x(e[ce]),c={isArray:$,isArrayBuffer:at,isBuffer:X,isFormData:Yt,isArrayBufferView:Jt,isString:$t,isNumber:ct,isBoolean:zt,isObject:Q,isPlainObject:oe,isEmptyObject:Wt,isReadableStream:en,isRequest:tn,isResponse:nn,isHeaders:rn,isUndefined:H,isDate:Vt,isFile:Kt,isBlob:Xt,isRegExp:yn,isFunction:x,isStream:Gt,isURLSearchParams:Zt,isTypedArray:dn,isFileList:Qt,forEach:G,merge:Ee,extend:sn,trim:on,stripBOM:an,inherits:cn,toFlatObject:ln,kindOf:le,kindOfTest:F,endsWith:un,toArray:fn,forEachEntry:pn,matchAll:hn,isHTMLForm:mn,hasOwnProperty:qe,hasOwnProp:qe,reduceDescriptors:ft,freezeMethods:wn,toObjectSet:bn,toCamelCase:gn,noop:En,toFiniteNumber:Sn,findKey:lt,global:v,isContextDefined:ut,isSpecCompliantForm:Rn,toJSONObject:On,isAsyncFn:Tn,isThenable:An,setImmediate:dt,asap:xn,isIterable:Cn};function g(e,t,n,r,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o,this.status=o.status?o.status:null)}c.inherits(g,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:c.toJSONObject(this.config),code:this.code,status:this.status}}});const pt=g.prototype,ht={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{ht[e]={value:e}});Object.defineProperties(g,ht);Object.defineProperty(pt,"isAxiosError",{value:!0});g.from=(e,t,n,r,o,s)=>{const i=Object.create(pt);c.toFlatObject(e,i,function(l){return l!==Error.prototype},u=>u!=="isAxiosError");const a=e&&e.message?e.message:"Error",f=t==null&&e?e.code:t;return g.call(i,a,f,n,r,o),e&&i.cause==null&&Object.defineProperty(i,"cause",{value:e,configurable:!0}),i.name=e&&e.name||"Error",s&&Object.assign(i,s),i};const _n=null;function Se(e){return c.isPlainObject(e)||c.isArray(e)}function mt(e){return c.endsWith(e,"[]")?e.slice(0,-2):e}function Me(e,t,n){return e?e.concat(t).map(function(o,s){return o=mt(o),!n&&s?"["+o+"]":o}).join(n?".":""):t}function Pn(e){return c.isArray(e)&&!e.some(Se)}const Ln=c.toFlatObject(c,{},null,function(t){return/^is[A-Z]/.test(t)});function fe(e,t,n){if(!c.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=c.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(m,h){return!c.isUndefined(h[m])});const r=n.metaTokens,o=n.visitor||l,s=n.dots,i=n.indexes,f=(n.Blob||typeof Blob<"u"&&Blob)&&c.isSpecCompliantForm(t);if(!c.isFunction(o))throw new TypeError("visitor must be a function");function u(d){if(d===null)return"";if(c.isDate(d))return d.toISOString();if(c.isBoolean(d))return d.toString();if(!f&&c.isBlob(d))throw new g("Blob is not supported. Use a Buffer instead.");return c.isArrayBuffer(d)||c.isTypedArray(d)?f&&typeof Blob=="function"?new Blob([d]):Buffer.from(d):d}function l(d,m,h){let w=d;if(d&&!h&&typeof d=="object"){if(c.endsWith(m,"{}"))m=r?m:m.slice(0,-2),d=JSON.stringify(d);else if(c.isArray(d)&&Pn(d)||(c.isFileList(d)||c.endsWith(m,"[]"))&&(w=c.toArray(d)))return m=mt(m),w.forEach(function(b,T){!(c.isUndefined(b)||b===null)&&t.append(i===!0?Me([m],T,s):i===null?m:m+"[]",u(b))}),!1}return Se(d)?!0:(t.append(Me(h,m,s),u(d)),!1)}const p=[],y=Object.assign(Ln,{defaultVisitor:l,convertValue:u,isVisitable:Se});function E(d,m){if(!c.isUndefined(d)){if(p.indexOf(d)!==-1)throw Error("Circular reference detected in "+m.join("."));p.push(d),c.forEach(d,function(w,R){(!(c.isUndefined(w)||w===null)&&o.call(t,w,c.isString(R)?R.trim():R,m,y))===!0&&E(w,m?m.concat(R):[R])}),p.pop()}}if(!c.isObject(e))throw new TypeError("data must be an object");return E(e),t}function He(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function _e(e,t){this._pairs=[],e&&fe(e,this,t)}const gt=_e.prototype;gt.append=function(t,n){this._pairs.push([t,n])};gt.toString=function(t){const n=t?function(r){return t.call(this,r,He)}:He;return this._pairs.map(function(o){return n(o[0])+"="+n(o[1])},"").join("&")};function Fn(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function yt(e,t,n){if(!t)return e;const r=n&&n.encode||Fn;c.isFunction(n)&&(n={serialize:n});const o=n&&n.serialize;let s;if(o?s=o(t,n):s=c.isURLSearchParams(t)?t.toString():new _e(t,n).toString(r),s){const i=e.indexOf("#");i!==-1&&(e=e.slice(0,i)),e+=(e.indexOf("?")===-1?"?":"&")+s}return e}class Je{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){c.forEach(this.handlers,function(r){r!==null&&t(r)})}}const wt={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Un=typeof URLSearchParams<"u"?URLSearchParams:_e,jn=typeof FormData<"u"?FormData:null,kn=typeof Blob<"u"?Blob:null,Nn={isBrowser:!0,classes:{URLSearchParams:Un,FormData:jn,Blob:kn},protocols:["http","https","file","blob","url","data"]},Pe=typeof window<"u"&&typeof document<"u",Re=typeof navigator=="object"&&navigator||void 0,Dn=Pe&&(!Re||["ReactNative","NativeScript","NS"].indexOf(Re.product)<0),Bn=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",vn=Pe&&window.location.href||"http://localhost",In=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Pe,hasStandardBrowserEnv:Dn,hasStandardBrowserWebWorkerEnv:Bn,navigator:Re,origin:vn},Symbol.toStringTag,{value:"Module"})),A={...In,...Nn};function qn(e,t){return fe(e,new A.classes.URLSearchParams,{visitor:function(n,r,o,s){return A.isNode&&c.isBuffer(n)?(this.append(r,n.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)},...t})}function Mn(e){return c.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function Hn(e){const t={},n=Object.keys(e);let r;const o=n.length;let s;for(r=0;r<o;r++)s=n[r],t[s]=e[s];return t}function bt(e){function t(n,r,o,s){let i=n[s++];if(i==="__proto__")return!0;const a=Number.isFinite(+i),f=s>=n.length;return i=!i&&c.isArray(o)?o.length:i,f?(c.hasOwnProp(o,i)?o[i]=[o[i],r]:o[i]=r,!a):((!o[i]||!c.isObject(o[i]))&&(o[i]=[]),t(n,r,o[i],s)&&c.isArray(o[i])&&(o[i]=Hn(o[i])),!a)}if(c.isFormData(e)&&c.isFunction(e.entries)){const n={};return c.forEachEntry(e,(r,o)=>{t(Mn(r),o,n,0)}),n}return null}function Jn(e,t,n){if(c.isString(e))try{return(t||JSON.parse)(e),c.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const Y={transitional:wt,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",o=r.indexOf("application/json")>-1,s=c.isObject(t);if(s&&c.isHTMLForm(t)&&(t=new FormData(t)),c.isFormData(t))return o?JSON.stringify(bt(t)):t;if(c.isArrayBuffer(t)||c.isBuffer(t)||c.isStream(t)||c.isFile(t)||c.isBlob(t)||c.isReadableStream(t))return t;if(c.isArrayBufferView(t))return t.buffer;if(c.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let a;if(s){if(r.indexOf("application/x-www-form-urlencoded")>-1)return qn(t,this.formSerializer).toString();if((a=c.isFileList(t))||r.indexOf("multipart/form-data")>-1){const f=this.env&&this.env.FormData;return fe(a?{"files[]":t}:t,f&&new f,this.formSerializer)}}return s||o?(n.setContentType("application/json",!1),Jn(t)):t}],transformResponse:[function(t){const n=this.transitional||Y.transitional,r=n&&n.forcedJSONParsing,o=this.responseType==="json";if(c.isResponse(t)||c.isReadableStream(t))return t;if(t&&c.isString(t)&&(r&&!this.responseType||o)){const i=!(n&&n.silentJSONParsing)&&o;try{return JSON.parse(t,this.parseReviver)}catch(a){if(i)throw a.name==="SyntaxError"?g.from(a,g.ERR_BAD_RESPONSE,this,null,this.response):a}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:A.classes.FormData,Blob:A.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};c.forEach(["delete","get","head","post","put","patch"],e=>{Y.headers[e]={}});const $n=c.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"]),zn=e=>{const t={};let n,r,o;return e&&e.split(`
`).forEach(function(i){o=i.indexOf(":"),n=i.substring(0,o).trim().toLowerCase(),r=i.substring(o+1).trim(),!(!n||t[n]&&$n[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},$e=Symbol("internals");function V(e){return e&&String(e).trim().toLowerCase()}function se(e){return e===!1||e==null?e:c.isArray(e)?e.map(se):String(e)}function Wn(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const Vn=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function ge(e,t,n,r,o){if(c.isFunction(r))return r.call(this,t,n);if(o&&(t=n),!!c.isString(t)){if(c.isString(r))return t.indexOf(r)!==-1;if(c.isRegExp(r))return r.test(t)}}function Kn(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function Xn(e,t){const n=c.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(o,s,i){return this[r].call(this,t,o,s,i)},configurable:!0})})}let C=class{constructor(t){t&&this.set(t)}set(t,n,r){const o=this;function s(a,f,u){const l=V(f);if(!l)throw new Error("header name must be a non-empty string");const p=c.findKey(o,l);(!p||o[p]===void 0||u===!0||u===void 0&&o[p]!==!1)&&(o[p||f]=se(a))}const i=(a,f)=>c.forEach(a,(u,l)=>s(u,l,f));if(c.isPlainObject(t)||t instanceof this.constructor)i(t,n);else if(c.isString(t)&&(t=t.trim())&&!Vn(t))i(zn(t),n);else if(c.isObject(t)&&c.isIterable(t)){let a={},f,u;for(const l of t){if(!c.isArray(l))throw TypeError("Object iterator must return a key-value pair");a[u=l[0]]=(f=a[u])?c.isArray(f)?[...f,l[1]]:[f,l[1]]:l[1]}i(a,n)}else t!=null&&s(n,t,r);return this}get(t,n){if(t=V(t),t){const r=c.findKey(this,t);if(r){const o=this[r];if(!n)return o;if(n===!0)return Wn(o);if(c.isFunction(n))return n.call(this,o,r);if(c.isRegExp(n))return n.exec(o);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=V(t),t){const r=c.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||ge(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let o=!1;function s(i){if(i=V(i),i){const a=c.findKey(r,i);a&&(!n||ge(r,r[a],a,n))&&(delete r[a],o=!0)}}return c.isArray(t)?t.forEach(s):s(t),o}clear(t){const n=Object.keys(this);let r=n.length,o=!1;for(;r--;){const s=n[r];(!t||ge(this,this[s],s,t,!0))&&(delete this[s],o=!0)}return o}normalize(t){const n=this,r={};return c.forEach(this,(o,s)=>{const i=c.findKey(r,s);if(i){n[i]=se(o),delete n[s];return}const a=t?Kn(s):String(s).trim();a!==s&&delete n[s],n[a]=se(o),r[a]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return c.forEach(this,(r,o)=>{r!=null&&r!==!1&&(n[o]=t&&c.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
`)}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,...n){const r=new this(t);return n.forEach(o=>r.set(o)),r}static accessor(t){const r=(this[$e]=this[$e]={accessors:{}}).accessors,o=this.prototype;function s(i){const a=V(i);r[a]||(Xn(o,i),r[a]=!0)}return c.isArray(t)?t.forEach(s):s(t),this}};C.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);c.reduceDescriptors(C.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});c.freezeMethods(C);function ye(e,t){const n=this||Y,r=t||n,o=C.from(r.headers);let s=r.data;return c.forEach(e,function(a){s=a.call(n,s,o.normalize(),t?t.status:void 0)}),o.normalize(),s}function Et(e){return!!(e&&e.__CANCEL__)}function z(e,t,n){g.call(this,e??"canceled",g.ERR_CANCELED,t,n),this.name="CanceledError"}c.inherits(z,g,{__CANCEL__:!0});function St(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new g("Request failed with status code "+n.status,[g.ERR_BAD_REQUEST,g.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function Qn(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function Gn(e,t){e=e||10;const n=new Array(e),r=new Array(e);let o=0,s=0,i;return t=t!==void 0?t:1e3,function(f){const u=Date.now(),l=r[s];i||(i=u),n[o]=f,r[o]=u;let p=s,y=0;for(;p!==o;)y+=n[p++],p=p%e;if(o=(o+1)%e,o===s&&(s=(s+1)%e),u-i<t)return;const E=l&&u-l;return E?Math.round(y*1e3/E):void 0}}function Yn(e,t){let n=0,r=1e3/t,o,s;const i=(u,l=Date.now())=>{n=l,o=null,s&&(clearTimeout(s),s=null),e(...u)};return[(...u)=>{const l=Date.now(),p=l-n;p>=r?i(u,l):(o=u,s||(s=setTimeout(()=>{s=null,i(o)},r-p)))},()=>o&&i(o)]}const ae=(e,t,n=3)=>{let r=0;const o=Gn(50,250);return Yn(s=>{const i=s.loaded,a=s.lengthComputable?s.total:void 0,f=i-r,u=o(f),l=i<=a;r=i;const p={loaded:i,total:a,progress:a?i/a:void 0,bytes:f,rate:u||void 0,estimated:u&&a&&l?(a-i)/u:void 0,event:s,lengthComputable:a!=null,[t?"download":"upload"]:!0};e(p)},n)},ze=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},We=e=>(...t)=>c.asap(()=>e(...t)),Zn=A.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,A.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(A.origin),A.navigator&&/(msie|trident)/i.test(A.navigator.userAgent)):()=>!0,er=A.hasStandardBrowserEnv?{write(e,t,n,r,o,s,i){if(typeof document>"u")return;const a=[`${e}=${encodeURIComponent(t)}`];c.isNumber(n)&&a.push(`expires=${new Date(n).toUTCString()}`),c.isString(r)&&a.push(`path=${r}`),c.isString(o)&&a.push(`domain=${o}`),s===!0&&a.push("secure"),c.isString(i)&&a.push(`SameSite=${i}`),document.cookie=a.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function tr(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function nr(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function Rt(e,t,n){let r=!tr(t);return e&&(r||n==!1)?nr(e,t):t}const Ve=e=>e instanceof C?{...e}:e;function q(e,t){t=t||{};const n={};function r(u,l,p,y){return c.isPlainObject(u)&&c.isPlainObject(l)?c.merge.call({caseless:y},u,l):c.isPlainObject(l)?c.merge({},l):c.isArray(l)?l.slice():l}function o(u,l,p,y){if(c.isUndefined(l)){if(!c.isUndefined(u))return r(void 0,u,p,y)}else return r(u,l,p,y)}function s(u,l){if(!c.isUndefined(l))return r(void 0,l)}function i(u,l){if(c.isUndefined(l)){if(!c.isUndefined(u))return r(void 0,u)}else return r(void 0,l)}function a(u,l,p){if(p in t)return r(u,l);if(p in e)return r(void 0,u)}const f={url:s,method:s,data:s,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:a,headers:(u,l,p)=>o(Ve(u),Ve(l),p,!0)};return c.forEach(Object.keys({...e,...t}),function(l){const p=f[l]||o,y=p(e[l],t[l],l);c.isUndefined(y)&&p!==a||(n[l]=y)}),n}const Ot=e=>{const t=q({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:o,xsrfCookieName:s,headers:i,auth:a}=t;if(t.headers=i=C.from(i),t.url=yt(Rt(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),a&&i.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):""))),c.isFormData(n)){if(A.hasStandardBrowserEnv||A.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if(c.isFunction(n.getHeaders)){const f=n.getHeaders(),u=["content-type","content-length"];Object.entries(f).forEach(([l,p])=>{u.includes(l.toLowerCase())&&i.set(l,p)})}}if(A.hasStandardBrowserEnv&&(r&&c.isFunction(r)&&(r=r(t)),r||r!==!1&&Zn(t.url))){const f=o&&s&&er.read(s);f&&i.set(o,f)}return t},rr=typeof XMLHttpRequest<"u",or=rr&&function(e){return new Promise(function(n,r){const o=Ot(e);let s=o.data;const i=C.from(o.headers).normalize();let{responseType:a,onUploadProgress:f,onDownloadProgress:u}=o,l,p,y,E,d;function m(){E&&E(),d&&d(),o.cancelToken&&o.cancelToken.unsubscribe(l),o.signal&&o.signal.removeEventListener("abort",l)}let h=new XMLHttpRequest;h.open(o.method.toUpperCase(),o.url,!0),h.timeout=o.timeout;function w(){if(!h)return;const b=C.from("getAllResponseHeaders"in h&&h.getAllResponseHeaders()),P={data:!a||a==="text"||a==="json"?h.responseText:h.response,status:h.status,statusText:h.statusText,headers:b,config:e,request:h};St(function(L){n(L),m()},function(L){r(L),m()},P),h=null}"onloadend"in h?h.onloadend=w:h.onreadystatechange=function(){!h||h.readyState!==4||h.status===0&&!(h.responseURL&&h.responseURL.indexOf("file:")===0)||setTimeout(w)},h.onabort=function(){h&&(r(new g("Request aborted",g.ECONNABORTED,e,h)),h=null)},h.onerror=function(T){const P=T&&T.message?T.message:"Network Error",D=new g(P,g.ERR_NETWORK,e,h);D.event=T||null,r(D),h=null},h.ontimeout=function(){let T=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";const P=o.transitional||wt;o.timeoutErrorMessage&&(T=o.timeoutErrorMessage),r(new g(T,P.clarifyTimeoutError?g.ETIMEDOUT:g.ECONNABORTED,e,h)),h=null},s===void 0&&i.setContentType(null),"setRequestHeader"in h&&c.forEach(i.toJSON(),function(T,P){h.setRequestHeader(P,T)}),c.isUndefined(o.withCredentials)||(h.withCredentials=!!o.withCredentials),a&&a!=="json"&&(h.responseType=o.responseType),u&&([y,d]=ae(u,!0),h.addEventListener("progress",y)),f&&h.upload&&([p,E]=ae(f),h.upload.addEventListener("progress",p),h.upload.addEventListener("loadend",E)),(o.cancelToken||o.signal)&&(l=b=>{h&&(r(!b||b.type?new z(null,e,h):b),h.abort(),h=null)},o.cancelToken&&o.cancelToken.subscribe(l),o.signal&&(o.signal.aborted?l():o.signal.addEventListener("abort",l)));const R=Qn(o.url);if(R&&A.protocols.indexOf(R)===-1){r(new g("Unsupported protocol "+R+":",g.ERR_BAD_REQUEST,e));return}h.send(s||null)})},sr=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,o;const s=function(u){if(!o){o=!0,a();const l=u instanceof Error?u:this.reason;r.abort(l instanceof g?l:new z(l instanceof Error?l.message:l))}};let i=t&&setTimeout(()=>{i=null,s(new g(`timeout ${t} of ms exceeded`,g.ETIMEDOUT))},t);const a=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach(u=>{u.unsubscribe?u.unsubscribe(s):u.removeEventListener("abort",s)}),e=null)};e.forEach(u=>u.addEventListener("abort",s));const{signal:f}=r;return f.unsubscribe=()=>c.asap(a),f}},ir=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let r=0,o;for(;r<n;)o=r+t,yield e.slice(r,o),r=o},ar=async function*(e,t){for await(const n of cr(e))yield*ir(n,t)},cr=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:r}=await t.read();if(n)break;yield r}}finally{await t.cancel()}},Ke=(e,t,n,r)=>{const o=ar(e,t);let s=0,i,a=f=>{i||(i=!0,r&&r(f))};return new ReadableStream({async pull(f){try{const{done:u,value:l}=await o.next();if(u){a(),f.close();return}let p=l.byteLength;if(n){let y=s+=p;n(y)}f.enqueue(new Uint8Array(l))}catch(u){throw a(u),u}},cancel(f){return a(f),o.return()}},{highWaterMark:2})},Xe=64*1024,{isFunction:ne}=c,lr=(({Request:e,Response:t})=>({Request:e,Response:t}))(c.global),{ReadableStream:Qe,TextEncoder:Ge}=c.global,Ye=(e,...t)=>{try{return!!e(...t)}catch{return!1}},ur=e=>{e=c.merge.call({skipUndefined:!0},lr,e);const{fetch:t,Request:n,Response:r}=e,o=t?ne(t):typeof fetch=="function",s=ne(n),i=ne(r);if(!o)return!1;const a=o&&ne(Qe),f=o&&(typeof Ge=="function"?(d=>m=>d.encode(m))(new Ge):async d=>new Uint8Array(await new n(d).arrayBuffer())),u=s&&a&&Ye(()=>{let d=!1;const m=new n(A.origin,{body:new Qe,method:"POST",get duplex(){return d=!0,"half"}}).headers.has("Content-Type");return d&&!m}),l=i&&a&&Ye(()=>c.isReadableStream(new r("").body)),p={stream:l&&(d=>d.body)};o&&["text","arrayBuffer","blob","formData","stream"].forEach(d=>{!p[d]&&(p[d]=(m,h)=>{let w=m&&m[d];if(w)return w.call(m);throw new g(`Response type '${d}' is not supported`,g.ERR_NOT_SUPPORT,h)})});const y=async d=>{if(d==null)return 0;if(c.isBlob(d))return d.size;if(c.isSpecCompliantForm(d))return(await new n(A.origin,{method:"POST",body:d}).arrayBuffer()).byteLength;if(c.isArrayBufferView(d)||c.isArrayBuffer(d))return d.byteLength;if(c.isURLSearchParams(d)&&(d=d+""),c.isString(d))return(await f(d)).byteLength},E=async(d,m)=>{const h=c.toFiniteNumber(d.getContentLength());return h??y(m)};return async d=>{let{url:m,method:h,data:w,signal:R,cancelToken:b,timeout:T,onDownloadProgress:P,onUploadProgress:D,responseType:L,headers:pe,withCredentials:Z="same-origin",fetchOptions:ke}=Ot(d),Ne=t||fetch;L=L?(L+"").toLowerCase():"text";let ee=sr([R,b&&b.toAbortSignal()],T),W=null;const B=ee&&ee.unsubscribe&&(()=>{ee.unsubscribe()});let De;try{if(D&&u&&h!=="get"&&h!=="head"&&(De=await E(pe,w))!==0){let N=new n(m,{method:"POST",body:w,duplex:"half"}),M;if(c.isFormData(w)&&(M=N.headers.get("content-type"))&&pe.setContentType(M),N.body){const[he,te]=ze(De,ae(We(D)));w=Ke(N.body,Xe,he,te)}}c.isString(Z)||(Z=Z?"include":"omit");const U=s&&"credentials"in n.prototype,Be={...ke,signal:ee,method:h.toUpperCase(),headers:pe.normalize().toJSON(),body:w,duplex:"half",credentials:U?Z:void 0};W=s&&new n(m,Be);let k=await(s?Ne(W,ke):Ne(m,Be));const ve=l&&(L==="stream"||L==="response");if(l&&(P||ve&&B)){const N={};["status","statusText","headers"].forEach(Ie=>{N[Ie]=k[Ie]});const M=c.toFiniteNumber(k.headers.get("content-length")),[he,te]=P&&ze(M,ae(We(P),!0))||[];k=new r(Ke(k.body,Xe,he,()=>{te&&te(),B&&B()}),N)}L=L||"text";let vt=await p[c.findKey(p,L)||"text"](k,d);return!ve&&B&&B(),await new Promise((N,M)=>{St(N,M,{data:vt,headers:C.from(k.headers),status:k.status,statusText:k.statusText,config:d,request:W})})}catch(U){throw B&&B(),U&&U.name==="TypeError"&&/Load failed|fetch/i.test(U.message)?Object.assign(new g("Network Error",g.ERR_NETWORK,d,W),{cause:U.cause||U}):g.from(U,U&&U.code,d,W)}}},fr=new Map,Tt=e=>{let t=e&&e.env||{};const{fetch:n,Request:r,Response:o}=t,s=[r,o,n];let i=s.length,a=i,f,u,l=fr;for(;a--;)f=s[a],u=l.get(f),u===void 0&&l.set(f,u=a?new Map:ur(t)),l=u;return u};Tt();const Le={http:_n,xhr:or,fetch:{get:Tt}};c.forEach(Le,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const Ze=e=>`- ${e}`,dr=e=>c.isFunction(e)||e===null||e===!1;function pr(e,t){e=c.isArray(e)?e:[e];const{length:n}=e;let r,o;const s={};for(let i=0;i<n;i++){r=e[i];let a;if(o=r,!dr(r)&&(o=Le[(a=String(r)).toLowerCase()],o===void 0))throw new g(`Unknown adapter '${a}'`);if(o&&(c.isFunction(o)||(o=o.get(t))))break;s[a||"#"+i]=o}if(!o){const i=Object.entries(s).map(([f,u])=>`adapter ${f} `+(u===!1?"is not supported by the environment":"is not available in the build"));let a=n?i.length>1?`since :
`+i.map(Ze).join(`
`):" "+Ze(i[0]):"as no adapter specified";throw new g("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return o}const At={getAdapter:pr,adapters:Le};function we(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new z(null,e)}function et(e){return we(e),e.headers=C.from(e.headers),e.data=ye.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),At.getAdapter(e.adapter||Y.adapter,e)(e).then(function(r){return we(e),r.data=ye.call(e,e.transformResponse,r),r.headers=C.from(r.headers),r},function(r){return Et(r)||(we(e),r&&r.response&&(r.response.data=ye.call(e,e.transformResponse,r.response),r.response.headers=C.from(r.response.headers))),Promise.reject(r)})}const xt="1.13.2",de={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{de[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const tt={};de.transitional=function(t,n,r){function o(s,i){return"[Axios v"+xt+"] Transitional option '"+s+"'"+i+(r?". "+r:"")}return(s,i,a)=>{if(t===!1)throw new g(o(i," has been removed"+(n?" in "+n:"")),g.ERR_DEPRECATED);return n&&!tt[i]&&(tt[i]=!0,console.warn(o(i," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(s,i,a):!0}};de.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function hr(e,t,n){if(typeof e!="object")throw new g("options must be an object",g.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let o=r.length;for(;o-- >0;){const s=r[o],i=t[s];if(i){const a=e[s],f=a===void 0||i(a,s,e);if(f!==!0)throw new g("option "+s+" must be "+f,g.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new g("Unknown option "+s,g.ERR_BAD_OPTION)}}const ie={assertOptions:hr,validators:de},j=ie.validators;let I=class{constructor(t){this.defaults=t||{},this.interceptors={request:new Je,response:new Je}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let o={};Error.captureStackTrace?Error.captureStackTrace(o):o=new Error;const s=o.stack?o.stack.replace(/^.+\n/,""):"";try{r.stack?s&&!String(r.stack).endsWith(s.replace(/^.+\n.+\n/,""))&&(r.stack+=`
`+s):r.stack=s}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=q(this.defaults,n);const{transitional:r,paramsSerializer:o,headers:s}=n;r!==void 0&&ie.assertOptions(r,{silentJSONParsing:j.transitional(j.boolean),forcedJSONParsing:j.transitional(j.boolean),clarifyTimeoutError:j.transitional(j.boolean)},!1),o!=null&&(c.isFunction(o)?n.paramsSerializer={serialize:o}:ie.assertOptions(o,{encode:j.function,serialize:j.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),ie.assertOptions(n,{baseUrl:j.spelling("baseURL"),withXsrfToken:j.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let i=s&&c.merge(s.common,s[n.method]);s&&c.forEach(["delete","get","head","post","put","patch","common"],d=>{delete s[d]}),n.headers=C.concat(i,s);const a=[];let f=!0;this.interceptors.request.forEach(function(m){typeof m.runWhen=="function"&&m.runWhen(n)===!1||(f=f&&m.synchronous,a.unshift(m.fulfilled,m.rejected))});const u=[];this.interceptors.response.forEach(function(m){u.push(m.fulfilled,m.rejected)});let l,p=0,y;if(!f){const d=[et.bind(this),void 0];for(d.unshift(...a),d.push(...u),y=d.length,l=Promise.resolve(n);p<y;)l=l.then(d[p++],d[p++]);return l}y=a.length;let E=n;for(;p<y;){const d=a[p++],m=a[p++];try{E=d(E)}catch(h){m.call(this,h);break}}try{l=et.call(this,E)}catch(d){return Promise.reject(d)}for(p=0,y=u.length;p<y;)l=l.then(u[p++],u[p++]);return l}getUri(t){t=q(this.defaults,t);const n=Rt(t.baseURL,t.url,t.allowAbsoluteUrls);return yt(n,t.params,t.paramsSerializer)}};c.forEach(["delete","get","head","options"],function(t){I.prototype[t]=function(n,r){return this.request(q(r||{},{method:t,url:n,data:(r||{}).data}))}});c.forEach(["post","put","patch"],function(t){function n(r){return function(s,i,a){return this.request(q(a||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:s,data:i}))}}I.prototype[t]=n(),I.prototype[t+"Form"]=n(!0)});let mr=class Ct{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(s){n=s});const r=this;this.promise.then(o=>{if(!r._listeners)return;let s=r._listeners.length;for(;s-- >0;)r._listeners[s](o);r._listeners=null}),this.promise.then=o=>{let s;const i=new Promise(a=>{r.subscribe(a),s=a}).then(o);return i.cancel=function(){r.unsubscribe(s)},i},t(function(s,i,a){r.reason||(r.reason=new z(s,i,a),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new Ct(function(o){t=o}),cancel:t}}};function gr(e){return function(n){return e.apply(null,n)}}function yr(e){return c.isObject(e)&&e.isAxiosError===!0}const Oe={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(Oe).forEach(([e,t])=>{Oe[t]=e});function _t(e){const t=new I(e),n=st(I.prototype.request,t);return c.extend(n,I.prototype,t,{allOwnKeys:!0}),c.extend(n,t,null,{allOwnKeys:!0}),n.create=function(o){return _t(q(e,o))},n}const S=_t(Y);S.Axios=I;S.CanceledError=z;S.CancelToken=mr;S.isCancel=Et;S.VERSION=xt;S.toFormData=fe;S.AxiosError=g;S.Cancel=S.CanceledError;S.all=function(t){return Promise.all(t)};S.spread=gr;S.isAxiosError=yr;S.mergeConfig=q;S.AxiosHeaders=C;S.formToJSON=e=>bt(c.isHTMLForm(e)?new FormData(e):e);S.getAdapter=At.getAdapter;S.HttpStatusCode=Oe;S.default=S;const{Axios:io,AxiosError:ao,CanceledError:co,isCancel:lo,CancelToken:uo,VERSION:fo,all:po,Cancel:ho,isAxiosError:mo,spread:go,toFormData:yo,AxiosHeaders:wo,HttpStatusCode:bo,formToJSON:Eo,getAdapter:So,mergeConfig:Ro}=S,wr={form:"application/x-www-form-urlencoded",json:"application/json",data:"multipart/form-data"},br=["put","post","patch"],Te="Local-Request-Id",Er=100,Sr=300;class Pt{constructor(t={}){_(this,"axios");_(this,"settings");_(this,"records",{});_(this,"isLoading",!1);_(this,"stopSkipWarn");_(this,"showLoading");_(this,"showError");this.settings=Object.assign({type:"form"},t.settings||{});const n=O.omit(t,["settings","query"]);this.axios=S.create(O.merge({headers:{"Content-Type":"application/x-www-form-urlencoded"},timeout:120*1e3},n)),this.setupSkipWarn(this.settings),this.showLoading=O.debounce(this.openLoading.bind(this),Er),this.showError=O.throttle(this._showError.bind(this),Sr,{leading:!0,trailing:!1})}setConfig(t={}){this.settings=O.merge(this.settings,t.settings||{});const n=O.omit(t,["settings","query"]);this.axios.defaults=O.merge(this.axios.defaults,n),this.setupSkipWarn(this.settings)}cancel(t,n="请求已取消"){if(t){const r=this.records[t];if(!r)return;r.source.cancel(n)}else for(const r of Object.values(this.records))r.source.cancel(n)}createHeaders(t,n,r){const o=n.injectHeaders?typeof n.headers=="function"?n.headers(t,r,n):n.headers||{}:{},s={"Content-Type":wr[n.type||"form"],...r.headers,...o};return n.skipWarn&&(s[Te]=t),s}isJsonType(t){return Object.entries(t).some(([n,r])=>n.toLowerCase()==="content-type"&&String(r).includes("application/json"))}toFormData(t,n="data"){if(t instanceof FormData||t instanceof URLSearchParams)return t;const r=n==="data"?new FormData:new URLSearchParams;return Object.entries(t).forEach(([o,s])=>{r.append(o,s)}),r}createSendData(t,n,r,o,s={}){const{type:i,skipWarn:a}=t,{name:f="skipWarn"}=a||{};let{data:u,params:l={},method:p="get"}=n;const y=o?{[f]:!0}:{};return br.includes(p.toLowerCase())?(u=Object.assign(u||{},y),u=i!=="json"||!this.isJsonType(r)?this.toFormData(u,i):u,l={...s}):i==="form"?l={...u||{},...s,...y}:(u&&(i!=="json"||!this.isJsonType(r))&&(u=this.toFormData(u,i)),l={...s,...y}),{data:u,params:l}}createUrl(t){let{url:n,params:r}=t;if(n){let o=O.isUrl(n)?new URL(n).origin:"";const s=o?n.replace(o,""):n;try{const i=O.pathToRegexpCompile(s,{encode:encodeURIComponent});return o+i(r||{})}catch{console.warn("createUrl","pathToRegexpCompile error",n)}}return n}openLoading(t){const{loading:n,showLoading:r}=t;n&&r&&Object.keys(this.records).length>0&&(this.isLoading=!0,r())}closeLoading(t){const{loading:n,hideLoading:r}=t;if(!n)return;this.isLoading=!1;const o=Object.keys(this.records);r&&o.length===0&&(this.isLoading=!1,r())}_showError(t,n){const{failMessage:r,showError:o}=t;if(r&&o){const s=n?.response?.data,i=s?.message||s?.msg||n?.message||n?.msg||"未知错误";o(i,n)}}validResponse(t,n){const{validSuccess:r,validate:o}=t;return r&&o?!!o(n):!0}isSkipWarnResponse(t){return!!t.promise}send(t={},n=!1){const r=O.merge({},this.settings,t.settings||{}),o=t.query||{},s=O.omit(t,["settings","query"]),i=O.uuid(!1),a=S.CancelToken.source();this.records[i]={settings:r,config:s,source:a};const f=this.createUrl(s),u=this.createHeaders(i,r,s),{data:l,params:p}=this.createSendData(r,s,u,n,o);return this.showLoading(r),new Promise((y,E)=>{this.axios({cancelToken:a.token,...s,url:f,headers:u,data:l,params:p}).then(d=>this.isSkipWarnResponse(d)?y(d.promise):this.validResponse(r,d)?y(r.originResponse?d:d.data?.data):(this.showError(r,d.data),E(d.data))).catch(d=>(this.showError(r,d),E(d))).finally(()=>{delete this.records[i],this.closeLoading(r)})})}useResponse(t,n){const{response:r}=this.axios.interceptors,o=r.use(t,n);return()=>r.eject(o)}useRequest(t,n){const{request:r}=this.axios.interceptors,o=r.use(t,n);return()=>r.eject(o)}setupSkipWarn(t){if(this.stopSkipWarn&&(this.stopSkipWarn(),this.stopSkipWarn=void 0),!t.skipWarn)return;const{code:n,executor:r,callback:o,complete:s}=t.skipWarn;this.stopSkipWarn=this.useResponse(i=>{const f=(i.config.headers||{})[Te],u=this.records[f];if(!u)return i;const{data:l}=i;if(!l||typeof l!="object")return i;if(l?.code===n){o&&o(i);const p=new Promise(r).then(()=>this.send({...u.config,settings:u.settings},!0));p.catch(y=>y).finally(()=>{s&&s()}),i.promise=p}return i})}}function Lt(e={}){const t=new Pt(e),n=t.send.bind(t),r=t.cancel.bind(t),o=t.setConfig.bind(t),s=t.useRequest.bind(t),i=t.useResponse.bind(t);return Object.assign(n,{...t,instance:t,send:n,cancel:r,setConfig:o,useRequest:s,useResponse:i})}const Fe=Lt({settings:{injectHeaders:!0,loading:!0,originResponse:!0}});function Ft(e,t=Fe){const n=typeof e=="string"?{url:e}:e;return(r,o)=>t.send(O.merge({},n,o||{},{data:r}))}function Rr(e,t=Fe){const n={};for(const[r,o]of Object.entries(e))n[r]=Ft(o,t);return n}function Or(e,t){const n=me.ref(null),r=me.ref(),o=me.ref(!0),s=()=>{o.value=!0,r.value=void 0,(typeof e=="function"?e():e).then(a=>{n.value=t?t(a):a}).catch(a=>{r.value=a}).finally(()=>{o.value=!1})};return s(),{data:n,error:r,loading:o,reload:s}}const J=typeof window<"u",Tr=e=>new Promise((t,n)=>{const r=new FileReader;r.readAsDataURL(e),r.onload=()=>{t(r.result)},r.onerror=o=>{n(o)}});function Ar(e){const t={};return e?(e.forEach((n,r)=>{t[r]=typeof n=="string"?decodeURIComponent(n):n}),t):{}}function xr(e){const t=e.split(","),n=t[0].match(/:(.*?);/)?.[1],r=atob(t[1]);let o=r.length;const s=new Uint8Array(o);for(;o--;)s[o]=r.charCodeAt(o);return new Blob([s],{type:n})}function Cr(e,t){const n=e;return n.lastModified=Date.now(),n.lastModifiedDate=new Date,n.name=t,n}const _r=e=>J?window.requestAnimationFrame(e):setTimeout(e,16),Pr=e=>J?window.cancelAnimationFrame(e):clearTimeout(e);class Ut{constructor(t={}){_(this,"options",{type:"cache",expired:0,prefix:"__VTJ_"});_(this,"caches",{});_(this,"types");this.types={local:J?window.localStorage:this.caches,session:J?window.sessionStorage:this.caches,cache:this.caches},this.config(t)}config(t={}){this.options=Object.assign(this.options,t)}save(t,n,r={}){const{type:o,expired:s,prefix:i}={...this.options,...r},a=Date.now(),f=i+t,u=this.types[o]||this.caches,l={value:n,timestamp:a,expired:s};u===this.caches?u[f]=l:u.setItem(f,JSON.stringify(l))}get(t,n={}){const{type:r,prefix:o}={...this.options,...n},s=o+t,i=this.types[r]||this.caches;let a;if(i===this.caches)a=i[s];else{const y=i.getItem(s);if(y)try{a=JSON.parse(y)}catch(E){console.warn("[Storage] JSON.parse",E)}}if(!a)return null;const{value:f,timestamp:u,expired:l}=a;return l>0&&u+l<Date.now()?(this.remove(t,n),null):f}remove(t,n={}){const{type:r,prefix:o}={...this.options,...n},s=this.types[r]||this.caches,i=o+t;s===this.caches?delete s[i]:s.removeItem(i)}clear(t={}){const{type:n}={...this.options,...t},r=this.types[n]||this.caches;r===this.caches?this.caches={}:r.clear()}}const Lr=new Ut;function jt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var K={exports:{}},Fr=K.exports,nt;function Ur(){return nt||(nt=1,(function(e,t){(function(n,r){r(t,e)})(Fr,function(n,r){var o={timeout:5e3,jsonpCallback:"callback"};function s(){return"jsonp_"+Date.now()+"_"+Math.ceil(Math.random()*1e5)}function i(u){try{delete window[u]}catch{window[u]=void 0}}function a(u){var l=document.getElementById(u);l&&document.getElementsByTagName("head")[0].removeChild(l)}function f(u){var l=arguments.length<=1||arguments[1]===void 0?{}:arguments[1],p=u,y=l.timeout||o.timeout,E=l.jsonpCallback||o.jsonpCallback,d=void 0;return new Promise(function(m,h){var w=l.jsonpCallbackFunction||s(),R=E+"_"+w;window[w]=function(T){m({ok:!0,json:function(){return Promise.resolve(T)}}),d&&clearTimeout(d),a(R),i(w)},p+=p.indexOf("?")===-1?"?":"&";var b=document.createElement("script");b.setAttribute("src",""+p+E+"="+w),l.charset&&b.setAttribute("charset",l.charset),l.nonce&&b.setAttribute("nonce",l.nonce),l.referrerPolicy&&b.setAttribute("referrerPolicy",l.referrerPolicy),l.crossorigin&&b.setAttribute("crossorigin","true"),b.id=R,document.getElementsByTagName("head")[0].appendChild(b),d=setTimeout(function(){h(new Error("JSONP request to "+u+" timed out")),i(w),a(R),window[w]=function(){i(w)}},y),b.onerror=function(){h(new Error("JSONP request to "+u+" failed")),i(w),a(R),d&&clearTimeout(d)}})}r.exports=f})})(K,K.exports)),K.exports}var jr=Ur();const kr=jt(jr);function Nr(e){if(J){const{protocol:t,host:n,pathname:r}=location;return`${t}//${n}${e?r:""}`}else return null}function Dr(e=""){const t=e.match(O.rURL);return t?t[0]:""}function kt(e){const t=[];for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push([n,encodeURIComponent(e[n])].join("="));return t.join("&")}function Ae(e,t,n){const r={};e=(e||location.search).replace(/^[^]*\?/,""),t=t||"&",n=n||"=";let o;const s=new RegExp("(?:^|\\"+t+")([^\\"+n+"\\"+t+"]+)(?:\\"+n+"([^\\"+t+"]*))?","g");for(;(o=s.exec(e))!==null;)o[1]!==e&&(r[decodeURIComponent(o[1])]=decodeURIComponent(o[2]||""));return r}function Nt(e,t){t=typeof t=="string"?Ae(t):t;const n=e.split("?")[0],r=Ae(e),o=Object.assign({},r,t),s=kt(o);return s?[n,s].join("?"):e}const Br=Object.freeze(Object.defineProperty({__proto__:null,append:Nt,getCurrentHost:Nr,getHost:Dr,parse:Ae,stringify:kt},Symbol.toStringTag,{value:"Module"}));async function vr(e,t={}){const{query:n={}}=t;e.includes("${")&&(e=O.template(e)(n||{}));const r=Nt(e,n);return await(await kr(r,t)).json()}var be,rt;function Ir(){if(rt)return be;rt=1,be=function(o,s,i){var a=document.head||document.getElementsByTagName("head")[0],f=document.createElement("script");typeof s=="function"&&(i=s,s={}),s=s||{},i=i||function(){},f.type=s.type||"text/javascript",f.charset=s.charset||"utf8",f.async="async"in s?!!s.async:!0,f.src=o,s.attrs&&e(f,s.attrs),s.text&&(f.text=""+s.text);var u="onload"in f?t:n;u(f,i),f.onload||t(f,i),a.appendChild(f)};function e(r,o){for(var s in o)r.setAttribute(s,o[s])}function t(r,o){r.onload=function(){this.onerror=this.onload=null,o(null,r)},r.onerror=function(){this.onerror=this.onload=null,o(new Error("Failed to load "+this.src),r)}}function n(r,o){r.onreadystatechange=function(){this.readyState!="complete"&&this.readyState!="loaded"||(this.onreadystatechange=null,o(null,r))}}return be}var qr=Ir();const Mr=jt(qr);function Hr(e,t={}){return new Promise((n,r)=>{const{library:o}=t;Mr(e,t,(s,i)=>{s?r(s):n(o?window[o]:void 0)})})}const ot={debug:-1,log:0,info:0,warn:1,error:2},Jr=function(e,t,n,r){return function(...o){if(t&&ot[t]<=ot[e]&&console[e].apply&&(r==="*"||n.startsWith(r)))return console[e].apply(console,$r(o,n))}};function $r(e,t){return t!=="*"&&(typeof e[0]=="string"?e[0]=`[${t}] ${e[0]}`:e=["["+t+"]"].concat(e)),e}function zr(e,t){if(!e)return{targetLevel:t.level,targetBizName:t.bizName};if(~e.indexOf(":")){const n=e.split(":");return{targetLevel:n[0],targetBizName:n[1]}}return{targetLevel:e,targetBizName:"*"}}const Wr={level:"warn",bizName:"*"};class Dt{constructor(t){_(this,"config");_(this,"options");this.options={...Wr,...t};const n=typeof location<"u"?location:{},r=(/__(?:logConf|logLevel)__=([^#/&]*)/.exec(n.href)||[])[1];this.config=zr(r,t)}_log(t){const{targetLevel:n,targetBizName:r}=this.config,{bizName:o}=this.options;return Jr(t,n,o,r)}debug(...t){return this._log("debug")(...t)}log(...t){return this._log("log")(...t)}info(...t){return this._log("info")(...t)}warn(...t){return this._log("warn")(...t)}error(...t){return this._log("error")(...t)}}function Bt(e){return new Dt(e)}const Vr=Bt({level:"log",bizName:"VTJ"});/*! js-cookie v3.0.5 | MIT */function re(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)e[r]=n[r]}return e}var Kr={read:function(e){return e[0]==='"'&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function xe(e,t){function n(o,s,i){if(!(typeof document>"u")){i=re({},t,i),typeof i.expires=="number"&&(i.expires=new Date(Date.now()+i.expires*864e5)),i.expires&&(i.expires=i.expires.toUTCString()),o=encodeURIComponent(o).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var a="";for(var f in i)i[f]&&(a+="; "+f,i[f]!==!0&&(a+="="+i[f].split(";")[0]));return document.cookie=o+"="+e.write(s,o)+a}}function r(o){if(!(typeof document>"u"||arguments.length&&!o)){for(var s=document.cookie?document.cookie.split("; "):[],i={},a=0;a<s.length;a++){var f=s[a].split("="),u=f.slice(1).join("=");try{var l=decodeURIComponent(f[0]);if(i[l]=e.read(u,l),o===l)break}catch{}}return o?i[o]:i}}return Object.create({set:n,get:r,remove:function(o,s){n(o,"",re({},s,{expires:-1}))},withAttributes:function(o){return xe(this.converter,re({},this.attributes,o))},withConverter:function(o){return xe(re({},this.converter,o),this.attributes)}},{attributes:{value:Object.freeze(t)},converter:{value:Object.freeze(e)}})}var Ue=xe(Kr,{path:"/"});function Xr(e,t,n){Ue.set(e,t,n)}function Qr(e){return Ue.get(e)}function Gr(e,t){Ue.remove(e,t)}const Yr=Object.freeze(Object.defineProperty({__proto__:null,get:Qr,remove:Gr,set:Xr},Symbol.toStringTag,{value:"Module"}));function Zr(e,t=""){const n=document.createElement("a