@kivii.com/bridge 1.0.6 → 1.0.7
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/core/Kivii.d.ts
CHANGED
package/dist/core/Kivii.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Kivii.d.ts","sourceRoot":"","sources":["../../src/core/Kivii.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAC,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"Kivii.d.ts","sourceRoot":"","sources":["../../src/core/Kivii.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,UAAU,EAAC,MAAM,eAAe,CAAC;AAE7D;;;;GAIG;AACH,qBAAa,KAAK;IAChB;;;;OAIG;IACH,OAAO,CAAC,MAAM,CAAC,SAAS,CAAQ;IAEhC;;;;;OAKG;IACH,OAAO,CAAC,iBAAiB,CAA+B;IAExD;;;;;OAKG;IACH,OAAO,KAAK,gBAAgB,GAY3B;IAED;;;;OAIG;IACH,OAAO,CAAC,OAAO,CAAwB;IAEvC;;;OAGG;IACH,IAAW,MAAM,IAAI,MAAM,CAE1B;IAED;;;;;OAKG;IACH,OAAO,CAAC,UAAU,CAAgC;IAElD;;;OAGG;IACH,IAAW,SAAS,IAAI,UAAU,CAEjC;IACD;;;;;OAKG;IACH,OAAO,CAAC,OAAO,CAA0B;IAEzC;;;OAGG;IACH,IAAW,MAAM,IAAI,OAAO,CAE3B;IAED;;;;;OAKG;IACH,OAAO,CAAC,QAAQ,CAA4B;IAE5C;;;OAGG;IACH,IAAW,OAAO,IAAI,QAAQ,CAE7B;IAED;;;;OAIG;IACI,QAAQ,CAAC,QAAQ,EAAE,GAAG,GAAG,IAAI;IASpC;;;;OAIG;IACI,UAAU,CAAC,CAAC,EAAE,aAAa,EAAE,MAAM,GAAG,CAAC,GAAG,SAAS;IAI1D;;;;OAIG;WACW,WAAW,IAAI,KAAK;CAMnC"}
|
package/dist/kivii.bridge.min.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).Kivii={})}(this,function(e){"use strict";class t{constructor(){this.configs=new Map}init(e){for(const[t,n]of Object.entries(e))this.set(t,n)}set(e,t){e.includes(".")?this.setNestedValue(e,t):this.configs.set(e,t)}get(e){return e.includes(".")?this.getNestedValue(e):this.configs.get(e)}has(e){return e.includes(".")?void 0!==this.getNestedValue(e):this.configs.has(e)}delete(e){if(e.includes(".")){const t=e.split("."),n=t[0],r=t.slice(1).join(".");if(this.configs.has(n)){const e=this.configs.get(n);if("object"==typeof e&&null!==e)return delete e[r],!0}return!1}return this.configs.delete(e)}clear(){this.configs.clear()}getAll(){const e={};for(const[t,n]of this.configs)e[t]=n;return e}setNestedValue(e,t){const n=e.split("."),r=n[0];let o=this.configs.get(r);o&&"object"==typeof o||(o={},this.configs.set(r,o));let s=o;for(let e=1;e<n.length-1;e++)s[n[e]]&&"object"==typeof s[n[e]]||(s[n[e]]={}),s=s[n[e]];s[n[n.length-1]]=t}getNestedValue(e){const t=e.split("."),n=t[0];let r=this.configs.get(n);for(let e=1;e<t.length;e++){if(!r||"object"!=typeof r||!(t[e]in r))return;r=r[t[e]]}return r}}class n{constructor(){this.interfaceType="IRequest"}async send(e){throw new Error("Method not implemented.")}}class r{constructor(){this.interfaceType="ILogger"}debug(e,t){}error(e,t){}info(e,t){}warn(e,t){}}class o{constructor(){this._privateVariables=new Map,this._config=new t,this._navigator=new INavagator,this._logger=new r,this._request=new n}get privateVariables(){if(0===this._privateVariables.size)for(const e of Object.keys(this))if(e.startsWith("_")){const t=this[e];"interfaceType"in t&&this._privateVariables.set(t.interfaceType,t)}return this._privateVariables}get config(){return this._config}get navigator(){return this.privateVariables.get(this._navigator.interfaceType)||this._navigator}get logger(){return this.privateVariables.get(this._logger.interfaceType)||this._logger}get request(){return this.privateVariables.get(this._request.interfaceType)||this._request}register(e){if(!("interfaceType"in e))return void this.logger.warn("无法注入实例:实例必须包含 interfaceType 属性");const t=e.interfaceType;this._privateVariables.set(t,e),this.logger.info(`成功注入实例:${t}`)}tryResolve(e){return this.privateVariables.get(e)}static getInstance(){return o._instance||(o._instance=new o),o._instance}}function s(e,t){return function(){return e.apply(t,arguments)}}const{toString:i}=Object.prototype,{getPrototypeOf:a}=Object,{iterator:c,toStringTag:l}=Symbol,u=(f=Object.create(null),e=>{const t=i.call(e);return f[t]||(f[t]=t.slice(8,-1).toLowerCase())});var f;const d=e=>(e=e.toLowerCase(),t=>u(t)===e),h=e=>t=>typeof t===e,{isArray:p}=Array,m=h("undefined");function g(e){return null!==e&&!m(e)&&null!==e.constructor&&!m(e.constructor)&&w(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const b=d("ArrayBuffer");const y=h("string"),w=h("function"),E=h("number"),O=e=>null!==e&&"object"==typeof e,R=e=>{if("object"!==u(e))return!1;const t=a(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||l in e||c in e)},v=d("Date"),S=d("File"),T=d("Blob"),A=d("FileList"),x=d("URLSearchParams"),[j,C,_,N]=["ReadableStream","Request","Response","Headers"].map(d);function P(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,o;if("object"!=typeof e&&(e=[e]),p(e))for(r=0,o=e.length;r<o;r++)t.call(null,e[r],r,e);else{if(g(e))return;const o=n?Object.getOwnPropertyNames(e):Object.keys(e),s=o.length;let i;for(r=0;r<s;r++)i=o[r],t.call(null,e[i],i,e)}}function U(e,t){if(g(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r,o=n.length;for(;o-- >0;)if(r=n[o],t===r.toLowerCase())return r;return null}const L="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,F=e=>!m(e)&&e!==L;const k=(B="undefined"!=typeof Uint8Array&&a(Uint8Array),e=>B&&e instanceof B);var B;const D=d("HTMLFormElement"),q=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),I=d("RegExp"),M=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};P(n,(n,o)=>{let s;!1!==(s=t(n,o,e))&&(r[o]=s||n)}),Object.defineProperties(e,r)};const V=d("AsyncFunction"),z=(H="function"==typeof setImmediate,J=w(L.postMessage),H?setImmediate:J?(K=`axios@${Math.random()}`,W=[],L.addEventListener("message",({source:e,data:t})=>{e===L&&t===K&&W.length&&W.shift()()},!1),e=>{W.push(e),L.postMessage(K,"*")}):e=>setTimeout(e));var H,J,K,W;const $="undefined"!=typeof queueMicrotask?queueMicrotask.bind(L):"undefined"!=typeof process&&process.nextTick||z;var G={isArray:p,isArrayBuffer:b,isBuffer:g,isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||w(e.append)&&("formdata"===(t=u(e))||"object"===t&&w(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&b(e.buffer),t},isString:y,isNumber:E,isBoolean:e=>!0===e||!1===e,isObject:O,isPlainObject:R,isEmptyObject:e=>{if(!O(e)||g(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:j,isRequest:C,isResponse:_,isHeaders:N,isUndefined:m,isDate:v,isFile:S,isBlob:T,isRegExp:I,isFunction:w,isStream:e=>O(e)&&w(e.pipe),isURLSearchParams:x,isTypedArray:k,isFileList:A,forEach:P,merge:function e(){const{caseless:t,skipUndefined:n}=F(this)&&this||{},r={},o=(o,s)=>{const i=t&&U(r,s)||s;R(r[i])&&R(o)?r[i]=e(r[i],o):R(o)?r[i]=e({},o):p(o)?r[i]=o.slice():n&&m(o)||(r[i]=o)};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&P(arguments[e],o);return r},extend:(e,t,n,{allOwnKeys:r}={})=>(P(t,(t,r)=>{n&&w(t)?e[r]=s(t,n):e[r]=t},{allOwnKeys:r}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(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)},toFlatObject:(e,t,n,r)=>{let o,s,i;const c={};if(t=t||{},null==e)return t;do{for(o=Object.getOwnPropertyNames(e),s=o.length;s-- >0;)i=o[s],r&&!r(i,e,t)||c[i]||(t[i]=e[i],c[i]=!0);e=!1!==n&&a(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:u,kindOfTest:d,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return-1!==r&&r===n},toArray:e=>{if(!e)return null;if(p(e))return e;let t=e.length;if(!E(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[c]).call(e);let r;for(;(r=n.next())&&!r.done;){const n=r.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:D,hasOwnProperty:q,hasOwnProp:q,reduceDescriptors:M,freezeMethods:e=>{M(e,(t,n)=>{if(w(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];w(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))})},toObjectSet:(e,t)=>{const n={},r=e=>{e.forEach(e=>{n[e]=!0})};return p(e)?r(e):r(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,n){return t.toUpperCase()+n}),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:U,global:L,isContextDefined:F,isSpecCompliantForm:function(e){return!!(e&&w(e.append)&&"FormData"===e[l]&&e[c])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(O(e)){if(t.indexOf(e)>=0)return;if(g(e))return e;if(!("toJSON"in e)){t[r]=e;const o=p(e)?[]:{};return P(e,(e,t)=>{const s=n(e,r+1);!m(s)&&(o[t]=s)}),t[r]=void 0,o}}return e};return n(e,0)},isAsyncFn:V,isThenable:e=>e&&(O(e)||w(e))&&w(e.then)&&w(e.catch),setImmediate:z,asap:$,isIterable:e=>null!=e&&w(e[c])};function X(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)}G.inherits(X,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:G.toJSONObject(this.config),code:this.code,status:this.status}}});const Q=X.prototype,Z={};["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=>{Z[e]={value:e}}),Object.defineProperties(X,Z),Object.defineProperty(Q,"isAxiosError",{value:!0}),X.from=(e,t,n,r,o,s)=>{const i=Object.create(Q);G.toFlatObject(e,i,function(e){return e!==Error.prototype},e=>"isAxiosError"!==e);const a=e&&e.message?e.message:"Error",c=null==t&&e?e.code:t;return X.call(i,a,c,n,r,o),e&&null==i.cause&&Object.defineProperty(i,"cause",{value:e,configurable:!0}),i.name=e&&e.name||"Error",s&&Object.assign(i,s),i};function Y(e){return G.isPlainObject(e)||G.isArray(e)}function ee(e){return G.endsWith(e,"[]")?e.slice(0,-2):e}function te(e,t,n){return e?e.concat(t).map(function(e,t){return e=ee(e),!n&&t?"["+e+"]":e}).join(n?".":""):t}const ne=G.toFlatObject(G,{},null,function(e){return/^is[A-Z]/.test(e)});function re(e,t,n){if(!G.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=G.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!G.isUndefined(t[e])})).metaTokens,o=n.visitor||l,s=n.dots,i=n.indexes,a=(n.Blob||"undefined"!=typeof Blob&&Blob)&&G.isSpecCompliantForm(t);if(!G.isFunction(o))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if(G.isDate(e))return e.toISOString();if(G.isBoolean(e))return e.toString();if(!a&&G.isBlob(e))throw new X("Blob is not supported. Use a Buffer instead.");return G.isArrayBuffer(e)||G.isTypedArray(e)?a&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function l(e,n,o){let a=e;if(e&&!o&&"object"==typeof e)if(G.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(G.isArray(e)&&function(e){return G.isArray(e)&&!e.some(Y)}(e)||(G.isFileList(e)||G.endsWith(n,"[]"))&&(a=G.toArray(e)))return n=ee(n),a.forEach(function(e,r){!G.isUndefined(e)&&null!==e&&t.append(!0===i?te([n],r,s):null===i?n:n+"[]",c(e))}),!1;return!!Y(e)||(t.append(te(o,n,s),c(e)),!1)}const u=[],f=Object.assign(ne,{defaultVisitor:l,convertValue:c,isVisitable:Y});if(!G.isObject(e))throw new TypeError("data must be an object");return function e(n,r){if(!G.isUndefined(n)){if(-1!==u.indexOf(n))throw Error("Circular reference detected in "+r.join("."));u.push(n),G.forEach(n,function(n,s){!0===(!(G.isUndefined(n)||null===n)&&o.call(t,n,G.isString(s)?s.trim():s,r,f))&&e(n,r?r.concat(s):[s])}),u.pop()}}(e),t}function oe(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(e){return t[e]})}function se(e,t){this._pairs=[],e&&re(e,this,t)}const ie=se.prototype;function ae(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function ce(e,t,n){if(!t)return e;const r=n&&n.encode||ae;G.isFunction(n)&&(n={serialize:n});const o=n&&n.serialize;let s;if(s=o?o(t,n):G.isURLSearchParams(t)?t.toString():new se(t,n).toString(r),s){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+s}return e}ie.append=function(e,t){this._pairs.push([e,t])},ie.toString=function(e){const t=e?function(t){return e.call(this,t,oe)}:oe;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};class le{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){G.forEach(this.handlers,function(t){null!==t&&e(t)})}}var ue={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},fe={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:se,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]};const de="undefined"!=typeof window&&"undefined"!=typeof document,he="object"==typeof navigator&&navigator||void 0,pe=de&&(!he||["ReactNative","NativeScript","NS"].indexOf(he.product)<0),me="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,ge=de&&window.location.href||"http://localhost";var be={...Object.freeze({__proto__:null,hasBrowserEnv:de,hasStandardBrowserEnv:pe,hasStandardBrowserWebWorkerEnv:me,navigator:he,origin:ge}),...fe};function ye(e){function t(e,n,r,o){let s=e[o++];if("__proto__"===s)return!0;const i=Number.isFinite(+s),a=o>=e.length;if(s=!s&&G.isArray(r)?r.length:s,a)return G.hasOwnProp(r,s)?r[s]=[r[s],n]:r[s]=n,!i;r[s]&&G.isObject(r[s])||(r[s]=[]);return t(e,n,r[s],o)&&G.isArray(r[s])&&(r[s]=function(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}(r[s])),!i}if(G.isFormData(e)&&G.isFunction(e.entries)){const n={};return G.forEachEntry(e,(e,r)=>{t(function(e){return G.matchAll(/\w+|\[(\w*)]/g,e).map(e=>"[]"===e[0]?"":e[1]||e[0])}(e),r,n,0)}),n}return null}const we={transitional:ue,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,o=G.isObject(e);o&&G.isHTMLForm(e)&&(e=new FormData(e));if(G.isFormData(e))return r?JSON.stringify(ye(e)):e;if(G.isArrayBuffer(e)||G.isBuffer(e)||G.isStream(e)||G.isFile(e)||G.isBlob(e)||G.isReadableStream(e))return e;if(G.isArrayBufferView(e))return e.buffer;if(G.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let s;if(o){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return re(e,new be.classes.URLSearchParams,{visitor:function(e,t,n,r){return be.isNode&&G.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)},...t})}(e,this.formSerializer).toString();if((s=G.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return re(s?{"files[]":e}:e,t&&new t,this.formSerializer)}}return o||r?(t.setContentType("application/json",!1),function(e,t,n){if(G.isString(e))try{return(t||JSON.parse)(e),G.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||we.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if(G.isResponse(e)||G.isReadableStream(e))return e;if(e&&G.isString(e)&&(n&&!this.responseType||r)){const n=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e,this.parseReviver)}catch(e){if(n){if("SyntaxError"===e.name)throw X.from(e,X.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:be.classes.FormData,Blob:be.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};G.forEach(["delete","get","head","post","put","patch"],e=>{we.headers[e]={}});const Ee=G.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"]);const Oe=Symbol("internals");function Re(e){return e&&String(e).trim().toLowerCase()}function ve(e){return!1===e||null==e?e:G.isArray(e)?e.map(ve):String(e)}function Se(e,t,n,r,o){return G.isFunction(r)?r.call(this,t,n):(o&&(t=n),G.isString(t)?G.isString(r)?-1!==t.indexOf(r):G.isRegExp(r)?r.test(t):void 0:void 0)}let Te=class{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function o(e,t,n){const o=Re(t);if(!o)throw new Error("header name must be a non-empty string");const s=G.findKey(r,o);(!s||void 0===r[s]||!0===n||void 0===n&&!1!==r[s])&&(r[s||t]=ve(e))}const s=(e,t)=>G.forEach(e,(e,n)=>o(e,n,t));if(G.isPlainObject(e)||e instanceof this.constructor)s(e,t);else if(G.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))s((e=>{const t={};let n,r,o;return e&&e.split("\n").forEach(function(e){o=e.indexOf(":"),n=e.substring(0,o).trim().toLowerCase(),r=e.substring(o+1).trim(),!n||t[n]&&Ee[n]||("set-cookie"===n?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t})(e),t);else if(G.isObject(e)&&G.isIterable(e)){let n,r,o={};for(const t of e){if(!G.isArray(t))throw TypeError("Object iterator must return a key-value pair");o[r=t[0]]=(n=o[r])?G.isArray(n)?[...n,t[1]]:[n,t[1]]:t[1]}s(o,t)}else null!=e&&o(t,e,n);return this}get(e,t){if(e=Re(e)){const n=G.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(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}(e);if(G.isFunction(t))return t.call(this,e,n);if(G.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=Re(e)){const n=G.findKey(this,e);return!(!n||void 0===this[n]||t&&!Se(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function o(e){if(e=Re(e)){const o=G.findKey(n,e);!o||t&&!Se(0,n[o],o,t)||(delete n[o],r=!0)}}return G.isArray(e)?e.forEach(o):o(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const o=t[n];e&&!Se(0,this[o],o,e,!0)||(delete this[o],r=!0)}return r}normalize(e){const t=this,n={};return G.forEach(this,(r,o)=>{const s=G.findKey(n,o);if(s)return t[s]=ve(r),void delete t[o];const i=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,n)=>t.toUpperCase()+n)}(o):String(o).trim();i!==o&&delete t[o],t[i]=ve(r),n[i]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return G.forEach(this,(n,r)=>{null!=n&&!1!==n&&(t[r]=e&&G.isArray(n)?n.join(", "):n)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach(e=>n.set(e)),n}static accessor(e){const t=(this[Oe]=this[Oe]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=Re(e);t[r]||(!function(e,t){const n=G.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(e,n,o){return this[r].call(this,t,e,n,o)},configurable:!0})})}(n,e),t[r]=!0)}return G.isArray(e)?e.forEach(r):r(e),this}};function Ae(e,t){const n=this||we,r=t||n,o=Te.from(r.headers);let s=r.data;return G.forEach(e,function(e){s=e.call(n,s,o.normalize(),t?t.status:void 0)}),o.normalize(),s}function xe(e){return!(!e||!e.__CANCEL__)}function je(e,t,n){X.call(this,null==e?"canceled":e,X.ERR_CANCELED,t,n),this.name="CanceledError"}function Ce(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new X("Request failed with status code "+n.status,[X.ERR_BAD_REQUEST,X.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}Te.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),G.reduceDescriptors(Te.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}}),G.freezeMethods(Te),G.inherits(je,X,{__CANCEL__:!0});const _e=(e,t,n=3)=>{let r=0;const o=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let o,s=0,i=0;return t=void 0!==t?t:1e3,function(a){const c=Date.now(),l=r[i];o||(o=c),n[s]=a,r[s]=c;let u=i,f=0;for(;u!==s;)f+=n[u++],u%=e;if(s=(s+1)%e,s===i&&(i=(i+1)%e),c-o<t)return;const d=l&&c-l;return d?Math.round(1e3*f/d):void 0}}(50,250);return function(e,t){let n,r,o=0,s=1e3/t;const i=(t,s=Date.now())=>{o=s,n=null,r&&(clearTimeout(r),r=null),e(...t)};return[(...e)=>{const t=Date.now(),a=t-o;a>=s?i(e,t):(n=e,r||(r=setTimeout(()=>{r=null,i(n)},s-a)))},()=>n&&i(n)]}(n=>{const s=n.loaded,i=n.lengthComputable?n.total:void 0,a=s-r,c=o(a);r=s;e({loaded:s,total:i,progress:i?s/i:void 0,bytes:a,rate:c||void 0,estimated:c&&i&&s<=i?(i-s)/c:void 0,event:n,lengthComputable:null!=i,[t?"download":"upload"]:!0})},n)},Ne=(e,t)=>{const n=null!=e;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},Pe=e=>(...t)=>G.asap(()=>e(...t));var Ue=be.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,be.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(be.origin),be.navigator&&/(msie|trident)/i.test(be.navigator.userAgent)):()=>!0,Le=be.hasStandardBrowserEnv?{write(e,t,n,r,o,s){const i=[e+"="+encodeURIComponent(t)];G.isNumber(n)&&i.push("expires="+new Date(n).toGMTString()),G.isString(r)&&i.push("path="+r),G.isString(o)&&i.push("domain="+o),!0===s&&i.push("secure"),document.cookie=i.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function Fe(e,t,n){let r=!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t);return e&&(r||0==n)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const ke=e=>e instanceof Te?{...e}:e;function Be(e,t){t=t||{};const n={};function r(e,t,n,r){return G.isPlainObject(e)&&G.isPlainObject(t)?G.merge.call({caseless:r},e,t):G.isPlainObject(t)?G.merge({},t):G.isArray(t)?t.slice():t}function o(e,t,n,o){return G.isUndefined(t)?G.isUndefined(e)?void 0:r(void 0,e,0,o):r(e,t,0,o)}function s(e,t){if(!G.isUndefined(t))return r(void 0,t)}function i(e,t){return G.isUndefined(t)?G.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function a(n,o,s){return s in t?r(n,o):s in e?r(void 0,n):void 0}const c={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:(e,t,n)=>o(ke(e),ke(t),0,!0)};return G.forEach(Object.keys({...e,...t}),function(r){const s=c[r]||o,i=s(e[r],t[r],r);G.isUndefined(i)&&s!==a||(n[r]=i)}),n}var De=e=>{const t=Be({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:o,xsrfCookieName:s,headers:i,auth:a}=t;if(t.headers=i=Te.from(i),t.url=ce(Fe(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),a&&i.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):""))),G.isFormData(n))if(be.hasStandardBrowserEnv||be.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if(G.isFunction(n.getHeaders)){const e=n.getHeaders(),t=["content-type","content-length"];Object.entries(e).forEach(([e,n])=>{t.includes(e.toLowerCase())&&i.set(e,n)})}if(be.hasStandardBrowserEnv&&(r&&G.isFunction(r)&&(r=r(t)),r||!1!==r&&Ue(t.url))){const e=o&&s&&Le.read(s);e&&i.set(o,e)}return t};var qe="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise(function(t,n){const r=De(e);let o=r.data;const s=Te.from(r.headers).normalize();let i,a,c,l,u,{responseType:f,onUploadProgress:d,onDownloadProgress:h}=r;function p(){l&&l(),u&&u(),r.cancelToken&&r.cancelToken.unsubscribe(i),r.signal&&r.signal.removeEventListener("abort",i)}let m=new XMLHttpRequest;function g(){if(!m)return;const r=Te.from("getAllResponseHeaders"in m&&m.getAllResponseHeaders());Ce(function(e){t(e),p()},function(e){n(e),p()},{data:f&&"text"!==f&&"json"!==f?m.response:m.responseText,status:m.status,statusText:m.statusText,headers:r,config:e,request:m}),m=null}m.open(r.method.toUpperCase(),r.url,!0),m.timeout=r.timeout,"onloadend"in m?m.onloadend=g:m.onreadystatechange=function(){m&&4===m.readyState&&(0!==m.status||m.responseURL&&0===m.responseURL.indexOf("file:"))&&setTimeout(g)},m.onabort=function(){m&&(n(new X("Request aborted",X.ECONNABORTED,e,m)),m=null)},m.onerror=function(t){const r=new X(t&&t.message?t.message:"Network Error",X.ERR_NETWORK,e,m);r.event=t||null,n(r),m=null},m.ontimeout=function(){let t=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const o=r.transitional||ue;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new X(t,o.clarifyTimeoutError?X.ETIMEDOUT:X.ECONNABORTED,e,m)),m=null},void 0===o&&s.setContentType(null),"setRequestHeader"in m&&G.forEach(s.toJSON(),function(e,t){m.setRequestHeader(t,e)}),G.isUndefined(r.withCredentials)||(m.withCredentials=!!r.withCredentials),f&&"json"!==f&&(m.responseType=r.responseType),h&&([c,u]=_e(h,!0),m.addEventListener("progress",c)),d&&m.upload&&([a,l]=_e(d),m.upload.addEventListener("progress",a),m.upload.addEventListener("loadend",l)),(r.cancelToken||r.signal)&&(i=t=>{m&&(n(!t||t.type?new je(null,e,m):t),m.abort(),m=null)},r.cancelToken&&r.cancelToken.subscribe(i),r.signal&&(r.signal.aborted?i():r.signal.addEventListener("abort",i)));const b=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(r.url);b&&-1===be.protocols.indexOf(b)?n(new X("Unsupported protocol "+b+":",X.ERR_BAD_REQUEST,e)):m.send(o||null)})};const Ie=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let n,r=new AbortController;const o=function(e){if(!n){n=!0,i();const t=e instanceof Error?e:this.reason;r.abort(t instanceof X?t:new je(t instanceof Error?t.message:t))}};let s=t&&setTimeout(()=>{s=null,o(new X(`timeout ${t} of ms exceeded`,X.ETIMEDOUT))},t);const i=()=>{e&&(s&&clearTimeout(s),s=null,e.forEach(e=>{e.unsubscribe?e.unsubscribe(o):e.removeEventListener("abort",o)}),e=null)};e.forEach(e=>e.addEventListener("abort",o));const{signal:a}=r;return a.unsubscribe=()=>G.asap(i),a}},Me=function*(e,t){let n=e.byteLength;if(n<t)return void(yield e);let r,o=0;for(;o<n;)r=o+t,yield e.slice(o,r),o=r},Ve=async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);const t=e.getReader();try{for(;;){const{done:e,value:n}=await t.read();if(e)break;yield n}}finally{await t.cancel()}},ze=(e,t,n,r)=>{const o=async function*(e,t){for await(const n of Ve(e))yield*Me(n,t)}(e,t);let s,i=0,a=e=>{s||(s=!0,r&&r(e))};return new ReadableStream({async pull(e){try{const{done:t,value:r}=await o.next();if(t)return a(),void e.close();let s=r.byteLength;if(n){let e=i+=s;n(e)}e.enqueue(new Uint8Array(r))}catch(e){throw a(e),e}},cancel:e=>(a(e),o.return())},{highWaterMark:2})},{isFunction:He}=G,Je=(({Request:e,Response:t})=>({Request:e,Response:t}))(G.global),{ReadableStream:Ke,TextEncoder:We}=G.global,$e=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},Ge=e=>{e=G.merge.call({skipUndefined:!0},Je,e);const{fetch:t,Request:n,Response:r}=e,o=t?He(t):"function"==typeof fetch,s=He(n),i=He(r);if(!o)return!1;const a=o&&He(Ke),c=o&&("function"==typeof We?(l=new We,e=>l.encode(e)):async e=>new Uint8Array(await new n(e).arrayBuffer()));var l;const u=s&&a&&$e(()=>{let e=!1;const t=new n(be.origin,{body:new Ke,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),f=i&&a&&$e(()=>G.isReadableStream(new r("").body)),d={stream:f&&(e=>e.body)};o&&["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!d[e]&&(d[e]=(t,n)=>{let r=t&&t[e];if(r)return r.call(t);throw new X(`Response type '${e}' is not supported`,X.ERR_NOT_SUPPORT,n)})});const h=async(e,t)=>{const r=G.toFiniteNumber(e.getContentLength());return null==r?(async e=>{if(null==e)return 0;if(G.isBlob(e))return e.size;if(G.isSpecCompliantForm(e)){const t=new n(be.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return G.isArrayBufferView(e)||G.isArrayBuffer(e)?e.byteLength:(G.isURLSearchParams(e)&&(e+=""),G.isString(e)?(await c(e)).byteLength:void 0)})(t):r};return async e=>{let{url:o,method:i,data:a,signal:c,cancelToken:l,timeout:p,onDownloadProgress:m,onUploadProgress:g,responseType:b,headers:y,withCredentials:w="same-origin",fetchOptions:E}=De(e),O=t||fetch;b=b?(b+"").toLowerCase():"text";let R=Ie([c,l&&l.toAbortSignal()],p),v=null;const S=R&&R.unsubscribe&&(()=>{R.unsubscribe()});let T;try{if(g&&u&&"get"!==i&&"head"!==i&&0!==(T=await h(y,a))){let e,t=new n(o,{method:"POST",body:a,duplex:"half"});if(G.isFormData(a)&&(e=t.headers.get("content-type"))&&y.setContentType(e),t.body){const[e,n]=Ne(T,_e(Pe(g)));a=ze(t.body,65536,e,n)}}G.isString(w)||(w=w?"include":"omit");const t=s&&"credentials"in n.prototype,c={...E,signal:R,method:i.toUpperCase(),headers:y.normalize().toJSON(),body:a,duplex:"half",credentials:t?w:void 0};v=s&&new n(o,c);let l=await(s?O(v,E):O(o,c));const p=f&&("stream"===b||"response"===b);if(f&&(m||p&&S)){const e={};["status","statusText","headers"].forEach(t=>{e[t]=l[t]});const t=G.toFiniteNumber(l.headers.get("content-length")),[n,o]=m&&Ne(t,_e(Pe(m),!0))||[];l=new r(ze(l.body,65536,n,()=>{o&&o(),S&&S()}),e)}b=b||"text";let A=await d[G.findKey(d,b)||"text"](l,e);return!p&&S&&S(),await new Promise((t,n)=>{Ce(t,n,{data:A,headers:Te.from(l.headers),status:l.status,statusText:l.statusText,config:e,request:v})})}catch(t){if(S&&S(),t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message))throw Object.assign(new X("Network Error",X.ERR_NETWORK,e,v),{cause:t.cause||t});throw X.from(t,t&&t.code,e,v)}}},Xe=new Map,Qe=e=>{let t=e?e.env:{};const{fetch:n,Request:r,Response:o}=t,s=[r,o,n];let i,a,c=s.length,l=Xe;for(;c--;)i=s[c],a=l.get(i),void 0===a&&l.set(i,a=c?new Map:Ge(t)),l=a;return a};Qe();const Ze={http:null,xhr:qe,fetch:{get:Qe}};G.forEach(Ze,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}});const Ye=e=>`- ${e}`,et=e=>G.isFunction(e)||null===e||!1===e;var tt=(e,t)=>{e=G.isArray(e)?e:[e];const{length:n}=e;let r,o;const s={};for(let i=0;i<n;i++){let n;if(r=e[i],o=r,!et(r)&&(o=Ze[(n=String(r)).toLowerCase()],void 0===o))throw new X(`Unknown adapter '${n}'`);if(o&&(G.isFunction(o)||(o=o.get(t))))break;s[n||"#"+i]=o}if(!o){const e=Object.entries(s).map(([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build"));throw new X("There is no suitable adapter to dispatch the request "+(n?e.length>1?"since :\n"+e.map(Ye).join("\n"):" "+Ye(e[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return o};function nt(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new je(null,e)}function rt(e){nt(e),e.headers=Te.from(e.headers),e.data=Ae.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return tt(e.adapter||we.adapter,e)(e).then(function(t){return nt(e),t.data=Ae.call(e,e.transformResponse,t),t.headers=Te.from(t.headers),t},function(t){return xe(t)||(nt(e),t&&t.response&&(t.response.data=Ae.call(e,e.transformResponse,t.response),t.response.headers=Te.from(t.response.headers))),Promise.reject(t)})}const ot="1.12.2",st={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{st[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const it={};st.transitional=function(e,t,n){function r(e,t){return"[Axios v"+ot+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,o,s)=>{if(!1===e)throw new X(r(o," has been removed"+(t?" in "+t:"")),X.ERR_DEPRECATED);return t&&!it[o]&&(it[o]=!0,console.warn(r(o," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,o,s)}},st.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};var at={assertOptions:function(e,t,n){if("object"!=typeof e)throw new X("options must be an object",X.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 t=e[s],n=void 0===t||i(t,s,e);if(!0!==n)throw new X("option "+s+" must be "+n,X.ERR_BAD_OPTION_VALUE);continue}if(!0!==n)throw new X("Unknown option "+s,X.ERR_BAD_OPTION)}},validators:st};const ct=at.validators;let lt=class{constructor(e){this.defaults=e||{},this.interceptors={request:new le,response:new le}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=new Error;const n=t.stack?t.stack.replace(/^.+\n/,""):"";try{e.stack?n&&!String(e.stack).endsWith(n.replace(/^.+\n.+\n/,""))&&(e.stack+="\n"+n):e.stack=n}catch(e){}}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=Be(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:o}=t;void 0!==n&&at.assertOptions(n,{silentJSONParsing:ct.transitional(ct.boolean),forcedJSONParsing:ct.transitional(ct.boolean),clarifyTimeoutError:ct.transitional(ct.boolean)},!1),null!=r&&(G.isFunction(r)?t.paramsSerializer={serialize:r}:at.assertOptions(r,{encode:ct.function,serialize:ct.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),at.assertOptions(t,{baseUrl:ct.spelling("baseURL"),withXsrfToken:ct.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let s=o&&G.merge(o.common,o[t.method]);o&&G.forEach(["delete","get","head","post","put","patch","common"],e=>{delete o[e]}),t.headers=Te.concat(s,o);const i=[];let a=!0;this.interceptors.request.forEach(function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(a=a&&e.synchronous,i.unshift(e.fulfilled,e.rejected))});const c=[];let l;this.interceptors.response.forEach(function(e){c.push(e.fulfilled,e.rejected)});let u,f=0;if(!a){const e=[rt.bind(this),void 0];for(e.unshift(...i),e.push(...c),u=e.length,l=Promise.resolve(t);f<u;)l=l.then(e[f++],e[f++]);return l}u=i.length;let d=t;for(;f<u;){const e=i[f++],t=i[f++];try{d=e(d)}catch(e){t.call(this,e);break}}try{l=rt.call(this,d)}catch(e){return Promise.reject(e)}for(f=0,u=c.length;f<u;)l=l.then(c[f++],c[f++]);return l}getUri(e){return ce(Fe((e=Be(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}};G.forEach(["delete","get","head","options"],function(e){lt.prototype[e]=function(t,n){return this.request(Be(n||{},{method:e,url:t,data:(n||{}).data}))}}),G.forEach(["post","put","patch"],function(e){function t(t){return function(n,r,o){return this.request(Be(o||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}lt.prototype[e]=t(),lt.prototype[e+"Form"]=t(!0)});const ut={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};Object.entries(ut).forEach(([e,t])=>{ut[t]=e});const ft=function e(t){const n=new lt(t),r=s(lt.prototype.request,n);return G.extend(r,lt.prototype,n,{allOwnKeys:!0}),G.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(Be(t,n))},r}(we);ft.Axios=lt,ft.CanceledError=je,ft.CancelToken=class e{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise(function(e){t=e});const n=this;this.promise.then(e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null}),this.promise.then=e=>{let t;const r=new Promise(e=>{n.subscribe(e),t=e}).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e(function(e,r,o){n.reason||(n.reason=new je(e,r,o),t(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let t;return{token:new e(function(e){t=e}),cancel:t}}},ft.isCancel=xe,ft.VERSION=ot,ft.toFormData=re,ft.AxiosError=X,ft.Cancel=ft.CanceledError,ft.all=function(e){return Promise.all(e)},ft.spread=function(e){return function(t){return e.apply(null,t)}},ft.isAxiosError=function(e){return G.isObject(e)&&!0===e.isAxiosError},ft.mergeConfig=Be,ft.AxiosHeaders=Te,ft.formToJSON=e=>ye(G.isHTMLForm(e)?new FormData(e):e),ft.getAdapter=tt,ft.HttpStatusCode=ut,ft.default=ft;const{Axios:dt,AxiosError:ht,CanceledError:pt,isCancel:mt,CancelToken:gt,VERSION:bt,all:yt,Cancel:wt,isAxiosError:Et,spread:Ot,toFormData:Rt,AxiosHeaders:vt,HttpStatusCode:St,formToJSON:Tt,getAdapter:At,mergeConfig:xt}=ft;const jt=o.getInstance();jt.register(new class extends r{debug(e,t){this.isLogEnabled()&&console.log(`[DEBUG] ${e}`,t||"")}error(e,t){this.isLogEnabled()&&console.error(`[ERROR] ${e}`,t||"")}info(e,t){this.isLogEnabled()&&console.info(`[INFO] ${e}`,t||"")}warn(e,t){this.isLogEnabled()&&console.warn(`[WARN] ${e}`,t||"")}isLogEnabled(){return!1!==o.getInstance().config.get("logger.enabled")}}),jt.register(new class extends n{constructor(){super(...arguments),this.interceptorsSetup=!1}get axiosInstance(){return this._axiosInstance||(this._axiosInstance=ft.create()),this._axiosInstance}async send(e){const t=o.getInstance().config;this.interceptorsSetup||(this.setupInterceptors(),this.interceptorsSetup=!0);try{const n={...this.getDefaultConfig(t),...this.convertToAxiosConfig(e)},r=await this.axiosInstance.request(n);return this.convertResponse(r)}catch(e){throw this.handleError(e)}}setupInterceptors(){this.axiosInstance.interceptors.request.use(e=>e,e=>Promise.reject(e)),this.axiosInstance.interceptors.response.use(e=>e,e=>Promise.reject(e))}getDefaultConfig(e){const t={},n=e.get("request.baseURL");n&&(t.baseURL=n);const r=e.get("request.timeout");r&&(t.timeout=r);const o=e.get("request.headers");return o&&(t.headers=o),t}convertToAxiosConfig(e){const t={url:e.url,method:e.method||"GET",timeout:e.timeout};return e.header&&Object.keys(e.header).length>0&&(t.headers=e.header),e.params&&Object.keys(e.params).length>0&&(t.params=e.params),e.data&&Object.keys(e.data).length>0&&(t.data=e.data),t}convertResponse(e){return{data:e.data,status:e.status,statusText:e.statusText,headers:e.headers,config:{url:e.config.url,method:e.config.method,timeout:e.config.timeout}}}handleError(e){if(e.response){const t=`请求失败: ${e.response.status} ${e.response.statusText}`;return new Error(t)}return e.request?new Error("网络请求超时或无法连接到服务器"):new Error(`请求配置错误: ${e.message}`)}async get(e,t){return this.send({url:e,method:"GET",header:(null==t?void 0:t.header)||{},params:(null==t?void 0:t.params)||{},data:(null==t?void 0:t.data)||{},timeout:null==t?void 0:t.timeout})}async post(e,t,n){return this.send({url:e,method:"POST",header:(null==n?void 0:n.header)||{},params:(null==n?void 0:n.params)||{},data:t||{},timeout:null==n?void 0:n.timeout})}async put(e,t,n){return this.send({url:e,method:"PUT",header:(null==n?void 0:n.header)||{},params:(null==n?void 0:n.params)||{},data:t||{},timeout:null==n?void 0:n.timeout})}async delete(e,t){return this.send({url:e,method:"DELETE",header:(null==t?void 0:t.header)||{},params:(null==t?void 0:t.params)||{},data:(null==t?void 0:t.data)||{},timeout:null==t?void 0:t.timeout})}async patch(e,t,n){return this.send({url:e,method:"PATCH",header:(null==n?void 0:n.header)||{},params:(null==n?void 0:n.params)||{},data:t||{},timeout:null==n?void 0:n.timeout})}}),"undefined"!=typeof window&&(window.Kivii=jt);var Ct={Kivii:jt};e.Kivii=jt,e.default=Ct,Object.defineProperty(e,"__esModule",{value:!0})});
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).Kivii={})}(this,function(e){"use strict";class t{constructor(){this.configs=new Map}init(e){for(const[t,n]of Object.entries(e))this.set(t,n)}set(e,t){e.includes(".")?this.setNestedValue(e,t):this.configs.set(e,t)}get(e){return e.includes(".")?this.getNestedValue(e):this.configs.get(e)}has(e){return e.includes(".")?void 0!==this.getNestedValue(e):this.configs.has(e)}delete(e){if(e.includes(".")){const t=e.split("."),n=t[0],r=t.slice(1).join(".");if(this.configs.has(n)){const e=this.configs.get(n);if("object"==typeof e&&null!==e)return delete e[r],!0}return!1}return this.configs.delete(e)}clear(){this.configs.clear()}getAll(){const e={};for(const[t,n]of this.configs)e[t]=n;return e}setNestedValue(e,t){const n=e.split("."),r=n[0];let o=this.configs.get(r);o&&"object"==typeof o||(o={},this.configs.set(r,o));let s=o;for(let e=1;e<n.length-1;e++)s[n[e]]&&"object"==typeof s[n[e]]||(s[n[e]]={}),s=s[n[e]];s[n[n.length-1]]=t}getNestedValue(e){const t=e.split("."),n=t[0];let r=this.configs.get(n);for(let e=1;e<t.length;e++){if(!r||"object"!=typeof r||!(t[e]in r))return;r=r[t[e]]}return r}}class n{constructor(){this.interfaceType="IRequest"}async send(e){throw new Error("Method not implemented.")}}class r{constructor(){this.interfaceType="ILogger"}debug(e,t){}error(e,t){}info(e,t){}warn(e,t){}}class o{constructor(){this.interfaceType="INavagator"}go(e,t){}push(e,t){}back(){}replace(e,t){}open(e,t){}}class s{constructor(){this._privateVariables=new Map,this._config=new t,this._navigator=new o,this._logger=new r,this._request=new n}get privateVariables(){if(0===this._privateVariables.size)for(const e of Object.keys(this))if(e.startsWith("_")){const t=this[e];"interfaceType"in t&&this._privateVariables.set(t.interfaceType,t)}return this._privateVariables}get config(){return this._config}get navigator(){return this.privateVariables.get(this._navigator.interfaceType)||this._navigator}get logger(){return this.privateVariables.get(this._logger.interfaceType)||this._logger}get request(){return this.privateVariables.get(this._request.interfaceType)||this._request}register(e){if(!("interfaceType"in e))return void this.logger.warn("无法注入实例:实例必须包含 interfaceType 属性");const t=e.interfaceType;this._privateVariables.set(t,e),this.logger.info(`成功注入实例:${t}`)}tryResolve(e){return this.privateVariables.get(e)}static getInstance(){return s._instance||(s._instance=new s),s._instance}}function i(e,t){return function(){return e.apply(t,arguments)}}const{toString:a}=Object.prototype,{getPrototypeOf:c}=Object,{iterator:l,toStringTag:u}=Symbol,f=(d=Object.create(null),e=>{const t=a.call(e);return d[t]||(d[t]=t.slice(8,-1).toLowerCase())});var d;const h=e=>(e=e.toLowerCase(),t=>f(t)===e),p=e=>t=>typeof t===e,{isArray:m}=Array,g=p("undefined");function b(e){return null!==e&&!g(e)&&null!==e.constructor&&!g(e.constructor)&&E(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const y=h("ArrayBuffer");const w=p("string"),E=p("function"),O=p("number"),R=e=>null!==e&&"object"==typeof e,v=e=>{if("object"!==f(e))return!1;const t=c(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||u in e||l in e)},S=h("Date"),T=h("File"),A=h("Blob"),x=h("FileList"),j=h("URLSearchParams"),[C,_,N,P]=["ReadableStream","Request","Response","Headers"].map(h);function U(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,o;if("object"!=typeof e&&(e=[e]),m(e))for(r=0,o=e.length;r<o;r++)t.call(null,e[r],r,e);else{if(b(e))return;const o=n?Object.getOwnPropertyNames(e):Object.keys(e),s=o.length;let i;for(r=0;r<s;r++)i=o[r],t.call(null,e[i],i,e)}}function L(e,t){if(b(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r,o=n.length;for(;o-- >0;)if(r=n[o],t===r.toLowerCase())return r;return null}const F="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,k=e=>!g(e)&&e!==F;const B=(D="undefined"!=typeof Uint8Array&&c(Uint8Array),e=>D&&e instanceof D);var D;const q=h("HTMLFormElement"),I=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),M=h("RegExp"),V=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};U(n,(n,o)=>{let s;!1!==(s=t(n,o,e))&&(r[o]=s||n)}),Object.defineProperties(e,r)};const z=h("AsyncFunction"),H=(J="function"==typeof setImmediate,K=E(F.postMessage),J?setImmediate:K?(W=`axios@${Math.random()}`,$=[],F.addEventListener("message",({source:e,data:t})=>{e===F&&t===W&&$.length&&$.shift()()},!1),e=>{$.push(e),F.postMessage(W,"*")}):e=>setTimeout(e));var J,K,W,$;const G="undefined"!=typeof queueMicrotask?queueMicrotask.bind(F):"undefined"!=typeof process&&process.nextTick||H;var X={isArray:m,isArrayBuffer:y,isBuffer:b,isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||E(e.append)&&("formdata"===(t=f(e))||"object"===t&&E(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&y(e.buffer),t},isString:w,isNumber:O,isBoolean:e=>!0===e||!1===e,isObject:R,isPlainObject:v,isEmptyObject:e=>{if(!R(e)||b(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:C,isRequest:_,isResponse:N,isHeaders:P,isUndefined:g,isDate:S,isFile:T,isBlob:A,isRegExp:M,isFunction:E,isStream:e=>R(e)&&E(e.pipe),isURLSearchParams:j,isTypedArray:B,isFileList:x,forEach:U,merge:function e(){const{caseless:t,skipUndefined:n}=k(this)&&this||{},r={},o=(o,s)=>{const i=t&&L(r,s)||s;v(r[i])&&v(o)?r[i]=e(r[i],o):v(o)?r[i]=e({},o):m(o)?r[i]=o.slice():n&&g(o)||(r[i]=o)};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&U(arguments[e],o);return r},extend:(e,t,n,{allOwnKeys:r}={})=>(U(t,(t,r)=>{n&&E(t)?e[r]=i(t,n):e[r]=t},{allOwnKeys:r}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(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)},toFlatObject:(e,t,n,r)=>{let o,s,i;const a={};if(t=t||{},null==e)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=!1!==n&&c(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:f,kindOfTest:h,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return-1!==r&&r===n},toArray:e=>{if(!e)return null;if(m(e))return e;let t=e.length;if(!O(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[l]).call(e);let r;for(;(r=n.next())&&!r.done;){const n=r.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:q,hasOwnProperty:I,hasOwnProp:I,reduceDescriptors:V,freezeMethods:e=>{V(e,(t,n)=>{if(E(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];E(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))})},toObjectSet:(e,t)=>{const n={},r=e=>{e.forEach(e=>{n[e]=!0})};return m(e)?r(e):r(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,n){return t.toUpperCase()+n}),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:L,global:F,isContextDefined:k,isSpecCompliantForm:function(e){return!!(e&&E(e.append)&&"FormData"===e[u]&&e[l])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(R(e)){if(t.indexOf(e)>=0)return;if(b(e))return e;if(!("toJSON"in e)){t[r]=e;const o=m(e)?[]:{};return U(e,(e,t)=>{const s=n(e,r+1);!g(s)&&(o[t]=s)}),t[r]=void 0,o}}return e};return n(e,0)},isAsyncFn:z,isThenable:e=>e&&(R(e)||E(e))&&E(e.then)&&E(e.catch),setImmediate:H,asap:G,isIterable:e=>null!=e&&E(e[l])};function Q(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)}X.inherits(Q,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:X.toJSONObject(this.config),code:this.code,status:this.status}}});const Z=Q.prototype,Y={};["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=>{Y[e]={value:e}}),Object.defineProperties(Q,Y),Object.defineProperty(Z,"isAxiosError",{value:!0}),Q.from=(e,t,n,r,o,s)=>{const i=Object.create(Z);X.toFlatObject(e,i,function(e){return e!==Error.prototype},e=>"isAxiosError"!==e);const a=e&&e.message?e.message:"Error",c=null==t&&e?e.code:t;return Q.call(i,a,c,n,r,o),e&&null==i.cause&&Object.defineProperty(i,"cause",{value:e,configurable:!0}),i.name=e&&e.name||"Error",s&&Object.assign(i,s),i};function ee(e){return X.isPlainObject(e)||X.isArray(e)}function te(e){return X.endsWith(e,"[]")?e.slice(0,-2):e}function ne(e,t,n){return e?e.concat(t).map(function(e,t){return e=te(e),!n&&t?"["+e+"]":e}).join(n?".":""):t}const re=X.toFlatObject(X,{},null,function(e){return/^is[A-Z]/.test(e)});function oe(e,t,n){if(!X.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=X.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!X.isUndefined(t[e])})).metaTokens,o=n.visitor||l,s=n.dots,i=n.indexes,a=(n.Blob||"undefined"!=typeof Blob&&Blob)&&X.isSpecCompliantForm(t);if(!X.isFunction(o))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if(X.isDate(e))return e.toISOString();if(X.isBoolean(e))return e.toString();if(!a&&X.isBlob(e))throw new Q("Blob is not supported. Use a Buffer instead.");return X.isArrayBuffer(e)||X.isTypedArray(e)?a&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function l(e,n,o){let a=e;if(e&&!o&&"object"==typeof e)if(X.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(X.isArray(e)&&function(e){return X.isArray(e)&&!e.some(ee)}(e)||(X.isFileList(e)||X.endsWith(n,"[]"))&&(a=X.toArray(e)))return n=te(n),a.forEach(function(e,r){!X.isUndefined(e)&&null!==e&&t.append(!0===i?ne([n],r,s):null===i?n:n+"[]",c(e))}),!1;return!!ee(e)||(t.append(ne(o,n,s),c(e)),!1)}const u=[],f=Object.assign(re,{defaultVisitor:l,convertValue:c,isVisitable:ee});if(!X.isObject(e))throw new TypeError("data must be an object");return function e(n,r){if(!X.isUndefined(n)){if(-1!==u.indexOf(n))throw Error("Circular reference detected in "+r.join("."));u.push(n),X.forEach(n,function(n,s){!0===(!(X.isUndefined(n)||null===n)&&o.call(t,n,X.isString(s)?s.trim():s,r,f))&&e(n,r?r.concat(s):[s])}),u.pop()}}(e),t}function se(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(e){return t[e]})}function ie(e,t){this._pairs=[],e&&oe(e,this,t)}const ae=ie.prototype;function ce(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function le(e,t,n){if(!t)return e;const r=n&&n.encode||ce;X.isFunction(n)&&(n={serialize:n});const o=n&&n.serialize;let s;if(s=o?o(t,n):X.isURLSearchParams(t)?t.toString():new ie(t,n).toString(r),s){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+s}return e}ae.append=function(e,t){this._pairs.push([e,t])},ae.toString=function(e){const t=e?function(t){return e.call(this,t,se)}:se;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};class ue{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){X.forEach(this.handlers,function(t){null!==t&&e(t)})}}var fe={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},de={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:ie,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]};const he="undefined"!=typeof window&&"undefined"!=typeof document,pe="object"==typeof navigator&&navigator||void 0,me=he&&(!pe||["ReactNative","NativeScript","NS"].indexOf(pe.product)<0),ge="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,be=he&&window.location.href||"http://localhost";var ye={...Object.freeze({__proto__:null,hasBrowserEnv:he,hasStandardBrowserEnv:me,hasStandardBrowserWebWorkerEnv:ge,navigator:pe,origin:be}),...de};function we(e){function t(e,n,r,o){let s=e[o++];if("__proto__"===s)return!0;const i=Number.isFinite(+s),a=o>=e.length;if(s=!s&&X.isArray(r)?r.length:s,a)return X.hasOwnProp(r,s)?r[s]=[r[s],n]:r[s]=n,!i;r[s]&&X.isObject(r[s])||(r[s]=[]);return t(e,n,r[s],o)&&X.isArray(r[s])&&(r[s]=function(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}(r[s])),!i}if(X.isFormData(e)&&X.isFunction(e.entries)){const n={};return X.forEachEntry(e,(e,r)=>{t(function(e){return X.matchAll(/\w+|\[(\w*)]/g,e).map(e=>"[]"===e[0]?"":e[1]||e[0])}(e),r,n,0)}),n}return null}const Ee={transitional:fe,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,o=X.isObject(e);o&&X.isHTMLForm(e)&&(e=new FormData(e));if(X.isFormData(e))return r?JSON.stringify(we(e)):e;if(X.isArrayBuffer(e)||X.isBuffer(e)||X.isStream(e)||X.isFile(e)||X.isBlob(e)||X.isReadableStream(e))return e;if(X.isArrayBufferView(e))return e.buffer;if(X.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let s;if(o){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return oe(e,new ye.classes.URLSearchParams,{visitor:function(e,t,n,r){return ye.isNode&&X.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)},...t})}(e,this.formSerializer).toString();if((s=X.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return oe(s?{"files[]":e}:e,t&&new t,this.formSerializer)}}return o||r?(t.setContentType("application/json",!1),function(e,t,n){if(X.isString(e))try{return(t||JSON.parse)(e),X.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||Ee.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if(X.isResponse(e)||X.isReadableStream(e))return e;if(e&&X.isString(e)&&(n&&!this.responseType||r)){const n=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e,this.parseReviver)}catch(e){if(n){if("SyntaxError"===e.name)throw Q.from(e,Q.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ye.classes.FormData,Blob:ye.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};X.forEach(["delete","get","head","post","put","patch"],e=>{Ee.headers[e]={}});const Oe=X.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"]);const Re=Symbol("internals");function ve(e){return e&&String(e).trim().toLowerCase()}function Se(e){return!1===e||null==e?e:X.isArray(e)?e.map(Se):String(e)}function Te(e,t,n,r,o){return X.isFunction(r)?r.call(this,t,n):(o&&(t=n),X.isString(t)?X.isString(r)?-1!==t.indexOf(r):X.isRegExp(r)?r.test(t):void 0:void 0)}let Ae=class{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function o(e,t,n){const o=ve(t);if(!o)throw new Error("header name must be a non-empty string");const s=X.findKey(r,o);(!s||void 0===r[s]||!0===n||void 0===n&&!1!==r[s])&&(r[s||t]=Se(e))}const s=(e,t)=>X.forEach(e,(e,n)=>o(e,n,t));if(X.isPlainObject(e)||e instanceof this.constructor)s(e,t);else if(X.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))s((e=>{const t={};let n,r,o;return e&&e.split("\n").forEach(function(e){o=e.indexOf(":"),n=e.substring(0,o).trim().toLowerCase(),r=e.substring(o+1).trim(),!n||t[n]&&Oe[n]||("set-cookie"===n?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t})(e),t);else if(X.isObject(e)&&X.isIterable(e)){let n,r,o={};for(const t of e){if(!X.isArray(t))throw TypeError("Object iterator must return a key-value pair");o[r=t[0]]=(n=o[r])?X.isArray(n)?[...n,t[1]]:[n,t[1]]:t[1]}s(o,t)}else null!=e&&o(t,e,n);return this}get(e,t){if(e=ve(e)){const n=X.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(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}(e);if(X.isFunction(t))return t.call(this,e,n);if(X.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=ve(e)){const n=X.findKey(this,e);return!(!n||void 0===this[n]||t&&!Te(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function o(e){if(e=ve(e)){const o=X.findKey(n,e);!o||t&&!Te(0,n[o],o,t)||(delete n[o],r=!0)}}return X.isArray(e)?e.forEach(o):o(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const o=t[n];e&&!Te(0,this[o],o,e,!0)||(delete this[o],r=!0)}return r}normalize(e){const t=this,n={};return X.forEach(this,(r,o)=>{const s=X.findKey(n,o);if(s)return t[s]=Se(r),void delete t[o];const i=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,n)=>t.toUpperCase()+n)}(o):String(o).trim();i!==o&&delete t[o],t[i]=Se(r),n[i]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return X.forEach(this,(n,r)=>{null!=n&&!1!==n&&(t[r]=e&&X.isArray(n)?n.join(", "):n)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach(e=>n.set(e)),n}static accessor(e){const t=(this[Re]=this[Re]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=ve(e);t[r]||(!function(e,t){const n=X.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(e,n,o){return this[r].call(this,t,e,n,o)},configurable:!0})})}(n,e),t[r]=!0)}return X.isArray(e)?e.forEach(r):r(e),this}};function xe(e,t){const n=this||Ee,r=t||n,o=Ae.from(r.headers);let s=r.data;return X.forEach(e,function(e){s=e.call(n,s,o.normalize(),t?t.status:void 0)}),o.normalize(),s}function je(e){return!(!e||!e.__CANCEL__)}function Ce(e,t,n){Q.call(this,null==e?"canceled":e,Q.ERR_CANCELED,t,n),this.name="CanceledError"}function _e(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new Q("Request failed with status code "+n.status,[Q.ERR_BAD_REQUEST,Q.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}Ae.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),X.reduceDescriptors(Ae.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}}),X.freezeMethods(Ae),X.inherits(Ce,Q,{__CANCEL__:!0});const Ne=(e,t,n=3)=>{let r=0;const o=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let o,s=0,i=0;return t=void 0!==t?t:1e3,function(a){const c=Date.now(),l=r[i];o||(o=c),n[s]=a,r[s]=c;let u=i,f=0;for(;u!==s;)f+=n[u++],u%=e;if(s=(s+1)%e,s===i&&(i=(i+1)%e),c-o<t)return;const d=l&&c-l;return d?Math.round(1e3*f/d):void 0}}(50,250);return function(e,t){let n,r,o=0,s=1e3/t;const i=(t,s=Date.now())=>{o=s,n=null,r&&(clearTimeout(r),r=null),e(...t)};return[(...e)=>{const t=Date.now(),a=t-o;a>=s?i(e,t):(n=e,r||(r=setTimeout(()=>{r=null,i(n)},s-a)))},()=>n&&i(n)]}(n=>{const s=n.loaded,i=n.lengthComputable?n.total:void 0,a=s-r,c=o(a);r=s;e({loaded:s,total:i,progress:i?s/i:void 0,bytes:a,rate:c||void 0,estimated:c&&i&&s<=i?(i-s)/c:void 0,event:n,lengthComputable:null!=i,[t?"download":"upload"]:!0})},n)},Pe=(e,t)=>{const n=null!=e;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},Ue=e=>(...t)=>X.asap(()=>e(...t));var Le=ye.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,ye.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(ye.origin),ye.navigator&&/(msie|trident)/i.test(ye.navigator.userAgent)):()=>!0,Fe=ye.hasStandardBrowserEnv?{write(e,t,n,r,o,s){const i=[e+"="+encodeURIComponent(t)];X.isNumber(n)&&i.push("expires="+new Date(n).toGMTString()),X.isString(r)&&i.push("path="+r),X.isString(o)&&i.push("domain="+o),!0===s&&i.push("secure"),document.cookie=i.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function ke(e,t,n){let r=!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t);return e&&(r||0==n)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const Be=e=>e instanceof Ae?{...e}:e;function De(e,t){t=t||{};const n={};function r(e,t,n,r){return X.isPlainObject(e)&&X.isPlainObject(t)?X.merge.call({caseless:r},e,t):X.isPlainObject(t)?X.merge({},t):X.isArray(t)?t.slice():t}function o(e,t,n,o){return X.isUndefined(t)?X.isUndefined(e)?void 0:r(void 0,e,0,o):r(e,t,0,o)}function s(e,t){if(!X.isUndefined(t))return r(void 0,t)}function i(e,t){return X.isUndefined(t)?X.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function a(n,o,s){return s in t?r(n,o):s in e?r(void 0,n):void 0}const c={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:(e,t,n)=>o(Be(e),Be(t),0,!0)};return X.forEach(Object.keys({...e,...t}),function(r){const s=c[r]||o,i=s(e[r],t[r],r);X.isUndefined(i)&&s!==a||(n[r]=i)}),n}var qe=e=>{const t=De({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:o,xsrfCookieName:s,headers:i,auth:a}=t;if(t.headers=i=Ae.from(i),t.url=le(ke(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),a&&i.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):""))),X.isFormData(n))if(ye.hasStandardBrowserEnv||ye.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if(X.isFunction(n.getHeaders)){const e=n.getHeaders(),t=["content-type","content-length"];Object.entries(e).forEach(([e,n])=>{t.includes(e.toLowerCase())&&i.set(e,n)})}if(ye.hasStandardBrowserEnv&&(r&&X.isFunction(r)&&(r=r(t)),r||!1!==r&&Le(t.url))){const e=o&&s&&Fe.read(s);e&&i.set(o,e)}return t};var Ie="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise(function(t,n){const r=qe(e);let o=r.data;const s=Ae.from(r.headers).normalize();let i,a,c,l,u,{responseType:f,onUploadProgress:d,onDownloadProgress:h}=r;function p(){l&&l(),u&&u(),r.cancelToken&&r.cancelToken.unsubscribe(i),r.signal&&r.signal.removeEventListener("abort",i)}let m=new XMLHttpRequest;function g(){if(!m)return;const r=Ae.from("getAllResponseHeaders"in m&&m.getAllResponseHeaders());_e(function(e){t(e),p()},function(e){n(e),p()},{data:f&&"text"!==f&&"json"!==f?m.response:m.responseText,status:m.status,statusText:m.statusText,headers:r,config:e,request:m}),m=null}m.open(r.method.toUpperCase(),r.url,!0),m.timeout=r.timeout,"onloadend"in m?m.onloadend=g:m.onreadystatechange=function(){m&&4===m.readyState&&(0!==m.status||m.responseURL&&0===m.responseURL.indexOf("file:"))&&setTimeout(g)},m.onabort=function(){m&&(n(new Q("Request aborted",Q.ECONNABORTED,e,m)),m=null)},m.onerror=function(t){const r=new Q(t&&t.message?t.message:"Network Error",Q.ERR_NETWORK,e,m);r.event=t||null,n(r),m=null},m.ontimeout=function(){let t=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const o=r.transitional||fe;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new Q(t,o.clarifyTimeoutError?Q.ETIMEDOUT:Q.ECONNABORTED,e,m)),m=null},void 0===o&&s.setContentType(null),"setRequestHeader"in m&&X.forEach(s.toJSON(),function(e,t){m.setRequestHeader(t,e)}),X.isUndefined(r.withCredentials)||(m.withCredentials=!!r.withCredentials),f&&"json"!==f&&(m.responseType=r.responseType),h&&([c,u]=Ne(h,!0),m.addEventListener("progress",c)),d&&m.upload&&([a,l]=Ne(d),m.upload.addEventListener("progress",a),m.upload.addEventListener("loadend",l)),(r.cancelToken||r.signal)&&(i=t=>{m&&(n(!t||t.type?new Ce(null,e,m):t),m.abort(),m=null)},r.cancelToken&&r.cancelToken.subscribe(i),r.signal&&(r.signal.aborted?i():r.signal.addEventListener("abort",i)));const b=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(r.url);b&&-1===ye.protocols.indexOf(b)?n(new Q("Unsupported protocol "+b+":",Q.ERR_BAD_REQUEST,e)):m.send(o||null)})};const Me=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let n,r=new AbortController;const o=function(e){if(!n){n=!0,i();const t=e instanceof Error?e:this.reason;r.abort(t instanceof Q?t:new Ce(t instanceof Error?t.message:t))}};let s=t&&setTimeout(()=>{s=null,o(new Q(`timeout ${t} of ms exceeded`,Q.ETIMEDOUT))},t);const i=()=>{e&&(s&&clearTimeout(s),s=null,e.forEach(e=>{e.unsubscribe?e.unsubscribe(o):e.removeEventListener("abort",o)}),e=null)};e.forEach(e=>e.addEventListener("abort",o));const{signal:a}=r;return a.unsubscribe=()=>X.asap(i),a}},Ve=function*(e,t){let n=e.byteLength;if(n<t)return void(yield e);let r,o=0;for(;o<n;)r=o+t,yield e.slice(o,r),o=r},ze=async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);const t=e.getReader();try{for(;;){const{done:e,value:n}=await t.read();if(e)break;yield n}}finally{await t.cancel()}},He=(e,t,n,r)=>{const o=async function*(e,t){for await(const n of ze(e))yield*Ve(n,t)}(e,t);let s,i=0,a=e=>{s||(s=!0,r&&r(e))};return new ReadableStream({async pull(e){try{const{done:t,value:r}=await o.next();if(t)return a(),void e.close();let s=r.byteLength;if(n){let e=i+=s;n(e)}e.enqueue(new Uint8Array(r))}catch(e){throw a(e),e}},cancel:e=>(a(e),o.return())},{highWaterMark:2})},{isFunction:Je}=X,Ke=(({Request:e,Response:t})=>({Request:e,Response:t}))(X.global),{ReadableStream:We,TextEncoder:$e}=X.global,Ge=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},Xe=e=>{e=X.merge.call({skipUndefined:!0},Ke,e);const{fetch:t,Request:n,Response:r}=e,o=t?Je(t):"function"==typeof fetch,s=Je(n),i=Je(r);if(!o)return!1;const a=o&&Je(We),c=o&&("function"==typeof $e?(l=new $e,e=>l.encode(e)):async e=>new Uint8Array(await new n(e).arrayBuffer()));var l;const u=s&&a&&Ge(()=>{let e=!1;const t=new n(ye.origin,{body:new We,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),f=i&&a&&Ge(()=>X.isReadableStream(new r("").body)),d={stream:f&&(e=>e.body)};o&&["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!d[e]&&(d[e]=(t,n)=>{let r=t&&t[e];if(r)return r.call(t);throw new Q(`Response type '${e}' is not supported`,Q.ERR_NOT_SUPPORT,n)})});const h=async(e,t)=>{const r=X.toFiniteNumber(e.getContentLength());return null==r?(async e=>{if(null==e)return 0;if(X.isBlob(e))return e.size;if(X.isSpecCompliantForm(e)){const t=new n(ye.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return X.isArrayBufferView(e)||X.isArrayBuffer(e)?e.byteLength:(X.isURLSearchParams(e)&&(e+=""),X.isString(e)?(await c(e)).byteLength:void 0)})(t):r};return async e=>{let{url:o,method:i,data:a,signal:c,cancelToken:l,timeout:p,onDownloadProgress:m,onUploadProgress:g,responseType:b,headers:y,withCredentials:w="same-origin",fetchOptions:E}=qe(e),O=t||fetch;b=b?(b+"").toLowerCase():"text";let R=Me([c,l&&l.toAbortSignal()],p),v=null;const S=R&&R.unsubscribe&&(()=>{R.unsubscribe()});let T;try{if(g&&u&&"get"!==i&&"head"!==i&&0!==(T=await h(y,a))){let e,t=new n(o,{method:"POST",body:a,duplex:"half"});if(X.isFormData(a)&&(e=t.headers.get("content-type"))&&y.setContentType(e),t.body){const[e,n]=Pe(T,Ne(Ue(g)));a=He(t.body,65536,e,n)}}X.isString(w)||(w=w?"include":"omit");const t=s&&"credentials"in n.prototype,c={...E,signal:R,method:i.toUpperCase(),headers:y.normalize().toJSON(),body:a,duplex:"half",credentials:t?w:void 0};v=s&&new n(o,c);let l=await(s?O(v,E):O(o,c));const p=f&&("stream"===b||"response"===b);if(f&&(m||p&&S)){const e={};["status","statusText","headers"].forEach(t=>{e[t]=l[t]});const t=X.toFiniteNumber(l.headers.get("content-length")),[n,o]=m&&Pe(t,Ne(Ue(m),!0))||[];l=new r(He(l.body,65536,n,()=>{o&&o(),S&&S()}),e)}b=b||"text";let A=await d[X.findKey(d,b)||"text"](l,e);return!p&&S&&S(),await new Promise((t,n)=>{_e(t,n,{data:A,headers:Ae.from(l.headers),status:l.status,statusText:l.statusText,config:e,request:v})})}catch(t){if(S&&S(),t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message))throw Object.assign(new Q("Network Error",Q.ERR_NETWORK,e,v),{cause:t.cause||t});throw Q.from(t,t&&t.code,e,v)}}},Qe=new Map,Ze=e=>{let t=e?e.env:{};const{fetch:n,Request:r,Response:o}=t,s=[r,o,n];let i,a,c=s.length,l=Qe;for(;c--;)i=s[c],a=l.get(i),void 0===a&&l.set(i,a=c?new Map:Xe(t)),l=a;return a};Ze();const Ye={http:null,xhr:Ie,fetch:{get:Ze}};X.forEach(Ye,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}});const et=e=>`- ${e}`,tt=e=>X.isFunction(e)||null===e||!1===e;var nt=(e,t)=>{e=X.isArray(e)?e:[e];const{length:n}=e;let r,o;const s={};for(let i=0;i<n;i++){let n;if(r=e[i],o=r,!tt(r)&&(o=Ye[(n=String(r)).toLowerCase()],void 0===o))throw new Q(`Unknown adapter '${n}'`);if(o&&(X.isFunction(o)||(o=o.get(t))))break;s[n||"#"+i]=o}if(!o){const e=Object.entries(s).map(([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build"));throw new Q("There is no suitable adapter to dispatch the request "+(n?e.length>1?"since :\n"+e.map(et).join("\n"):" "+et(e[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return o};function rt(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Ce(null,e)}function ot(e){rt(e),e.headers=Ae.from(e.headers),e.data=xe.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return nt(e.adapter||Ee.adapter,e)(e).then(function(t){return rt(e),t.data=xe.call(e,e.transformResponse,t),t.headers=Ae.from(t.headers),t},function(t){return je(t)||(rt(e),t&&t.response&&(t.response.data=xe.call(e,e.transformResponse,t.response),t.response.headers=Ae.from(t.response.headers))),Promise.reject(t)})}const st="1.12.2",it={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{it[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const at={};it.transitional=function(e,t,n){function r(e,t){return"[Axios v"+st+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,o,s)=>{if(!1===e)throw new Q(r(o," has been removed"+(t?" in "+t:"")),Q.ERR_DEPRECATED);return t&&!at[o]&&(at[o]=!0,console.warn(r(o," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,o,s)}},it.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};var ct={assertOptions:function(e,t,n){if("object"!=typeof e)throw new Q("options must be an object",Q.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 t=e[s],n=void 0===t||i(t,s,e);if(!0!==n)throw new Q("option "+s+" must be "+n,Q.ERR_BAD_OPTION_VALUE);continue}if(!0!==n)throw new Q("Unknown option "+s,Q.ERR_BAD_OPTION)}},validators:it};const lt=ct.validators;let ut=class{constructor(e){this.defaults=e||{},this.interceptors={request:new ue,response:new ue}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=new Error;const n=t.stack?t.stack.replace(/^.+\n/,""):"";try{e.stack?n&&!String(e.stack).endsWith(n.replace(/^.+\n.+\n/,""))&&(e.stack+="\n"+n):e.stack=n}catch(e){}}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=De(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:o}=t;void 0!==n&&ct.assertOptions(n,{silentJSONParsing:lt.transitional(lt.boolean),forcedJSONParsing:lt.transitional(lt.boolean),clarifyTimeoutError:lt.transitional(lt.boolean)},!1),null!=r&&(X.isFunction(r)?t.paramsSerializer={serialize:r}:ct.assertOptions(r,{encode:lt.function,serialize:lt.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),ct.assertOptions(t,{baseUrl:lt.spelling("baseURL"),withXsrfToken:lt.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let s=o&&X.merge(o.common,o[t.method]);o&&X.forEach(["delete","get","head","post","put","patch","common"],e=>{delete o[e]}),t.headers=Ae.concat(s,o);const i=[];let a=!0;this.interceptors.request.forEach(function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(a=a&&e.synchronous,i.unshift(e.fulfilled,e.rejected))});const c=[];let l;this.interceptors.response.forEach(function(e){c.push(e.fulfilled,e.rejected)});let u,f=0;if(!a){const e=[ot.bind(this),void 0];for(e.unshift(...i),e.push(...c),u=e.length,l=Promise.resolve(t);f<u;)l=l.then(e[f++],e[f++]);return l}u=i.length;let d=t;for(;f<u;){const e=i[f++],t=i[f++];try{d=e(d)}catch(e){t.call(this,e);break}}try{l=ot.call(this,d)}catch(e){return Promise.reject(e)}for(f=0,u=c.length;f<u;)l=l.then(c[f++],c[f++]);return l}getUri(e){return le(ke((e=De(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}};X.forEach(["delete","get","head","options"],function(e){ut.prototype[e]=function(t,n){return this.request(De(n||{},{method:e,url:t,data:(n||{}).data}))}}),X.forEach(["post","put","patch"],function(e){function t(t){return function(n,r,o){return this.request(De(o||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}ut.prototype[e]=t(),ut.prototype[e+"Form"]=t(!0)});const ft={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};Object.entries(ft).forEach(([e,t])=>{ft[t]=e});const dt=function e(t){const n=new ut(t),r=i(ut.prototype.request,n);return X.extend(r,ut.prototype,n,{allOwnKeys:!0}),X.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(De(t,n))},r}(Ee);dt.Axios=ut,dt.CanceledError=Ce,dt.CancelToken=class e{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise(function(e){t=e});const n=this;this.promise.then(e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null}),this.promise.then=e=>{let t;const r=new Promise(e=>{n.subscribe(e),t=e}).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e(function(e,r,o){n.reason||(n.reason=new Ce(e,r,o),t(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let t;return{token:new e(function(e){t=e}),cancel:t}}},dt.isCancel=je,dt.VERSION=st,dt.toFormData=oe,dt.AxiosError=Q,dt.Cancel=dt.CanceledError,dt.all=function(e){return Promise.all(e)},dt.spread=function(e){return function(t){return e.apply(null,t)}},dt.isAxiosError=function(e){return X.isObject(e)&&!0===e.isAxiosError},dt.mergeConfig=De,dt.AxiosHeaders=Ae,dt.formToJSON=e=>we(X.isHTMLForm(e)?new FormData(e):e),dt.getAdapter=nt,dt.HttpStatusCode=ft,dt.default=dt;const{Axios:ht,AxiosError:pt,CanceledError:mt,isCancel:gt,CancelToken:bt,VERSION:yt,all:wt,Cancel:Et,isAxiosError:Ot,spread:Rt,toFormData:vt,AxiosHeaders:St,HttpStatusCode:Tt,formToJSON:At,getAdapter:xt,mergeConfig:jt}=dt;const Ct=s.getInstance();Ct.register(new class extends r{debug(e,t){this.isLogEnabled()&&console.log(`[DEBUG] ${e}`,t||"")}error(e,t){this.isLogEnabled()&&console.error(`[ERROR] ${e}`,t||"")}info(e,t){this.isLogEnabled()&&console.info(`[INFO] ${e}`,t||"")}warn(e,t){this.isLogEnabled()&&console.warn(`[WARN] ${e}`,t||"")}isLogEnabled(){return!1!==s.getInstance().config.get("logger.enabled")}}),Ct.register(new class extends n{constructor(){super(...arguments),this.interceptorsSetup=!1}get axiosInstance(){return this._axiosInstance||(this._axiosInstance=dt.create()),this._axiosInstance}async send(e){const t=s.getInstance().config;this.interceptorsSetup||(this.setupInterceptors(),this.interceptorsSetup=!0);try{const n={...this.getDefaultConfig(t),...this.convertToAxiosConfig(e)},r=await this.axiosInstance.request(n);return this.convertResponse(r)}catch(e){throw this.handleError(e)}}setupInterceptors(){this.axiosInstance.interceptors.request.use(e=>e,e=>Promise.reject(e)),this.axiosInstance.interceptors.response.use(e=>e,e=>Promise.reject(e))}getDefaultConfig(e){const t={},n=e.get("request.baseURL");n&&(t.baseURL=n);const r=e.get("request.timeout");r&&(t.timeout=r);const o=e.get("request.headers");return o&&(t.headers=o),t}convertToAxiosConfig(e){const t={url:e.url,method:e.method||"GET",timeout:e.timeout};return e.header&&Object.keys(e.header).length>0&&(t.headers=e.header),e.params&&Object.keys(e.params).length>0&&(t.params=e.params),e.data&&Object.keys(e.data).length>0&&(t.data=e.data),t}convertResponse(e){return{data:e.data,status:e.status,statusText:e.statusText,headers:e.headers,config:{url:e.config.url,method:e.config.method,timeout:e.config.timeout}}}handleError(e){if(e.response){const t=`请求失败: ${e.response.status} ${e.response.statusText}`;return new Error(t)}return e.request?new Error("网络请求超时或无法连接到服务器"):new Error(`请求配置错误: ${e.message}`)}async get(e,t){return this.send({url:e,method:"GET",header:(null==t?void 0:t.header)||{},params:(null==t?void 0:t.params)||{},data:(null==t?void 0:t.data)||{},timeout:null==t?void 0:t.timeout})}async post(e,t,n){return this.send({url:e,method:"POST",header:(null==n?void 0:n.header)||{},params:(null==n?void 0:n.params)||{},data:t||{},timeout:null==n?void 0:n.timeout})}async put(e,t,n){return this.send({url:e,method:"PUT",header:(null==n?void 0:n.header)||{},params:(null==n?void 0:n.params)||{},data:t||{},timeout:null==n?void 0:n.timeout})}async delete(e,t){return this.send({url:e,method:"DELETE",header:(null==t?void 0:t.header)||{},params:(null==t?void 0:t.params)||{},data:(null==t?void 0:t.data)||{},timeout:null==t?void 0:t.timeout})}async patch(e,t,n){return this.send({url:e,method:"PATCH",header:(null==n?void 0:n.header)||{},params:(null==n?void 0:n.params)||{},data:t||{},timeout:null==n?void 0:n.timeout})}}),"undefined"!=typeof window&&(window.Kivii=Ct);var _t={Kivii:Ct};e.Kivii=Ct,e.default=_t,Object.defineProperty(e,"__esModule",{value:!0})});
|
|
2
2
|
//# sourceMappingURL=kivii.bridge.min.js.map
|