yxuse 3.0.33 → 3.0.36
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/lib/index.cjs2.js +11 -11
- package/lib/index.cjs2.js.gz +0 -0
- package/lib/index.cjs5.js +1 -1
- package/lib/index.cjs7.js +3 -3
- package/lib/index.cjs7.js.gz +0 -0
- package/lib/index.es2.js +597 -589
- package/lib/index.es2.js.gz +0 -0
- package/lib/index.es5.js +16 -16
- package/lib/index.es7.js +251 -245
- package/lib/index.es7.js.gz +0 -0
- package/lib/index.es8.js +7 -1
- package/package.json +1 -1
- package/types/utils/http/index.d.ts +13 -5
package/lib/index.cjs2.js.gz
CHANGED
|
Binary file
|
package/lib/index.cjs5.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var n=(t,c,s)=>new Promise((g,o)=>{var L=a=>{try{i(s.next(a))}catch(r){o(r)}},E=a=>{try{i(s.throw(a))}catch(r){o(r)}},i=a=>a.done?g(a.value):Promise.resolve(a.value).then(L,E);i((s=s.apply(t,c)).next())});const e=require("./index.cjs7.js"),R=require("./index.cjs8.js"),
|
|
1
|
+
"use strict";var n=(t,c,s)=>new Promise((g,o)=>{var L=a=>{try{i(s.next(a))}catch(r){o(r)}},E=a=>{try{i(s.throw(a))}catch(r){o(r)}},i=a=>a.done?g(a.value):Promise.resolve(a.value).then(L,E);i((s=s.apply(t,c)).next())});const e=require("./index.cjs7.js"),R=require("./index.cjs8.js"),d=(t="ttc")=>n(exports,null,function*(){return yield e.http.get(`${e.URL[t].INTEGRATED_BASE_URL}/basic/data/satellite/select`)}),l=(t="ttc")=>n(exports,null,function*(){return yield e.http.get(`${e.URL[t].INTEGRATED_BASE_URL}/basic/data/ante/select`)}),u=(t="ttc")=>n(exports,null,function*(){return yield e.http.get(`${e.URL[t].INTEGRATED_BASE_URL}/theme/list`,{},{headers:{noLoading:!0}})}),U=(t="ttc")=>n(exports,null,function*(){return yield e.http.get(`${e.URL[t].INTEGRATED_BASE_URL}/workorder/comment/untreated/count`)}),S=Object.freeze(Object.defineProperty({__proto__:null,assets:R.index,auth:e.index,getCommentUntreatedCount:U,getUserSelectAnteList:l,getUserSelectSatelliteList:d,getUserThemeList:u},Symbol.toStringTag,{value:"Module"}));exports.api2=S;exports.getCommentUntreatedCount=U;exports.getUserSelectAnteList=l;exports.getUserSelectSatelliteList=d;exports.getUserThemeList=u;
|
package/lib/index.cjs7.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";var rt=Object.defineProperty;var Se=Object.getOwnPropertySymbols;var st=Object.prototype.hasOwnProperty,ot=Object.prototype.propertyIsEnumerable;var Z=(e,t,n)=>t in e?rt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,U=(e,t)=>{for(var n in t||(t={}))st.call(t,n)&&Z(e,n,t[n]);if(Se)for(var n of Se(t))ot.call(t,n)&&Z(e,n,t[n]);return e};var be=(e,t,n)=>(Z(e,typeof t!="symbol"?t+"":t,n),n);var j=(e,t,n)=>new Promise((r,s)=>{var i=l=>{try{c(n.next(l))}catch(u){s(u)}},o=l=>{try{c(n.throw(l))}catch(u){s(u)}},c=l=>l.done?r(l.value):Promise.resolve(l.value).then(i,o);c((n=n.apply(e,t)).next())});const S=require("element-plus");function _e(e,t){return function(){return e.apply(t,arguments)}}const{toString:Be}=Object.prototype,{getPrototypeOf:ue}=Object,le=(e=>t=>{const n=Be.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),A=e=>(e=e.toLowerCase(),t=>le(t)===e),G=e=>t=>typeof t===e,{isArray:x}=Array,F=G("undefined");function it(e){return e!==null&&!F(e)&&e.constructor!==null&&!F(e.constructor)&&N(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Fe=A("ArrayBuffer");function at(e){let t;return typeof ArrayBuffer!="undefined"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&Fe(e.buffer),t}const ct=G("string"),N=G("function"),De=G("number"),fe=e=>e!==null&&typeof e=="object",ut=e=>e===!0||e===!1,M=e=>{if(le(e)!=="object")return!1;const t=ue(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},lt=A("Date"),ft=A("File"),dt=A("Blob"),pt=A("FileList"),ht=e=>fe(e)&&N(e.pipe),mt=e=>{const t="[object FormData]";return e&&(typeof FormData=="function"&&e instanceof FormData||Be.call(e)===t||N(e.toString)&&e.toString()===t)},Et=A("URLSearchParams"),yt=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function D(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e=="undefined")return;let r,s;if(typeof e!="object"&&(e=[e]),x(e))for(r=0,s=e.length;r<s;r++)t.call(null,e[r],r,e);else{const i=n?Object.getOwnPropertyNames(e):Object.keys(e),o=i.length;let c;for(r=0;r<o;r++)c=i[r],t.call(null,e[c],c,e)}}function ke(e,t){t=t.toLowerCase();const n=Object.keys(e);let r=n.length,s;for(;r-- >0;)if(s=n[r],t===s.toLowerCase())return s;return null}const Ie=typeof globalThis!="undefined"?globalThis:typeof self!="undefined"?self:typeof window!="undefined"?window:global,je=e=>!F(e)&&e!==Ie;function se(){const{caseless:e}=je(this)&&this||{},t={},n=(r,s)=>{const i=e&&ke(t,s)||s;M(t[i])&&M(r)?t[i]=se(t[i],r):M(r)?t[i]=se({},r):x(r)?t[i]=r.slice():t[i]=r};for(let r=0,s=arguments.length;r<s;r++)arguments[r]&&D(arguments[r],n);return t}const wt=(e,t,n,{allOwnKeys:r}={})=>(D(t,(s,i)=>{n&&N(s)?e[i]=_e(s,n):e[i]=s},{allOwnKeys:r}),e),St=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),bt=(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)},gt=(e,t,n,r)=>{let s,i,o;const c={};if(t=t||{},e==null)return t;do{for(s=Object.getOwnPropertyNames(e),i=s.length;i-- >0;)o=s[i],(!r||r(o,e,t))&&!c[o]&&(t[o]=e[o],c[o]=!0);e=n!==!1&&ue(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},Ot=(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},Rt=e=>{if(!e)return null;if(x(e))return e;let t=e.length;if(!De(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},At=(e=>t=>e&&t instanceof e)(typeof Uint8Array!="undefined"&&ue(Uint8Array)),Tt=(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let s;for(;(s=r.next())&&!s.done;){const i=s.value;t.call(e,i[0],i[1])}},Nt=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},Pt=A("HTMLFormElement"),Ct=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,s){return r.toUpperCase()+s}),ge=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),xt=A("RegExp"),Me=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};D(n,(s,i)=>{t(s,i,e)!==!1&&(r[i]=s)}),Object.defineProperties(e,r)},Lt=e=>{Me(e,(t,n)=>{if(N(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(N(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+"'")})}})},Ut=(e,t)=>{const n={},r=s=>{s.forEach(i=>{n[i]=!0})};return x(e)?r(e):r(String(e).split(t)),n},_t=()=>{},Bt=(e,t)=>(e=+e,Number.isFinite(e)?e:t),ee="abcdefghijklmnopqrstuvwxyz",Oe="0123456789",He={DIGIT:Oe,ALPHA:ee,ALPHA_DIGIT:ee+ee.toUpperCase()+Oe},Ft=(e=16,t=He.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n};function Dt(e){return!!(e&&N(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const kt=e=>{const t=new Array(10),n=(r,s)=>{if(fe(r)){if(t.indexOf(r)>=0)return;if(!("toJSON"in r)){t[s]=r;const i=x(r)?[]:{};return D(r,(o,c)=>{const l=n(o,s+1);!F(l)&&(i[c]=l)}),t[s]=void 0,i}}return r};return n(e,0)},a={isArray:x,isArrayBuffer:Fe,isBuffer:it,isFormData:mt,isArrayBufferView:at,isString:ct,isNumber:De,isBoolean:ut,isObject:fe,isPlainObject:M,isUndefined:F,isDate:lt,isFile:ft,isBlob:dt,isRegExp:xt,isFunction:N,isStream:ht,isURLSearchParams:Et,isTypedArray:At,isFileList:pt,forEach:D,merge:se,extend:wt,trim:yt,stripBOM:St,inherits:bt,toFlatObject:gt,kindOf:le,kindOfTest:A,endsWith:Ot,toArray:Rt,forEachEntry:Tt,matchAll:Nt,isHTMLForm:Pt,hasOwnProperty:ge,hasOwnProp:ge,reduceDescriptors:Me,freezeMethods:Lt,toObjectSet:Ut,toCamelCase:Ct,noop:_t,toFiniteNumber:Bt,findKey:ke,global:Ie,isContextDefined:je,ALPHABET:He,generateString:Ft,isSpecCompliantForm:Dt,toJSONObject:kt};function m(e,t,n,r,s){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),s&&(this.response=s)}a.inherits(m,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:a.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const qe=m.prototype,Je={};["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=>{Je[e]={value:e}});Object.defineProperties(m,Je);Object.defineProperty(qe,"isAxiosError",{value:!0});m.from=(e,t,n,r,s,i)=>{const o=Object.create(qe);return a.toFlatObject(e,o,function(l){return l!==Error.prototype},c=>c!=="isAxiosError"),m.call(o,e.message,t,n,r,s),o.cause=e,o.name=e.name,i&&Object.assign(o,i),o};const It=null;function oe(e){return a.isPlainObject(e)||a.isArray(e)}function ze(e){return a.endsWith(e,"[]")?e.slice(0,-2):e}function Re(e,t,n){return e?e.concat(t).map(function(s,i){return s=ze(s),!n&&i?"["+s+"]":s}).join(n?".":""):t}function jt(e){return a.isArray(e)&&!e.some(oe)}const Mt=a.toFlatObject(a,{},null,function(t){return/^is[A-Z]/.test(t)});function $(e,t,n){if(!a.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=a.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(h,O){return!a.isUndefined(O[h])});const r=n.metaTokens,s=n.visitor||f,i=n.dots,o=n.indexes,l=(n.Blob||typeof Blob!="undefined"&&Blob)&&a.isSpecCompliantForm(t);if(!a.isFunction(s))throw new TypeError("visitor must be a function");function u(d){if(d===null)return"";if(a.isDate(d))return d.toISOString();if(!l&&a.isBlob(d))throw new m("Blob is not supported. Use a Buffer instead.");return a.isArrayBuffer(d)||a.isTypedArray(d)?l&&typeof Blob=="function"?new Blob([d]):Buffer.from(d):d}function f(d,h,O){let b=d;if(d&&!O&&typeof d=="object"){if(a.endsWith(h,"{}"))h=r?h:h.slice(0,-2),d=JSON.stringify(d);else if(a.isArray(d)&&jt(d)||(a.isFileList(d)||a.endsWith(h,"[]"))&&(b=a.toArray(d)))return h=ze(h),b.forEach(function(I,nt){!(a.isUndefined(I)||I===null)&&t.append(o===!0?Re([h],nt,i):o===null?h:h+"[]",u(I))}),!1}return oe(d)?!0:(t.append(Re(O,h,i),u(d)),!1)}const p=[],w=Object.assign(Mt,{defaultVisitor:f,convertValue:u,isVisitable:oe});function E(d,h){if(!a.isUndefined(d)){if(p.indexOf(d)!==-1)throw Error("Circular reference detected in "+h.join("."));p.push(d),a.forEach(d,function(b,P){(!(a.isUndefined(b)||b===null)&&s.call(t,b,a.isString(P)?P.trim():P,h,w))===!0&&E(b,h?h.concat(P):[P])}),p.pop()}}if(!a.isObject(e))throw new TypeError("data must be an object");return E(e),t}function Ae(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function de(e,t){this._pairs=[],e&&$(e,this,t)}const Ve=de.prototype;Ve.append=function(t,n){this._pairs.push([t,n])};Ve.toString=function(t){const n=t?function(r){return t.call(this,r,Ae)}:Ae;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};function Ht(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Ge(e,t,n){if(!t)return e;const r=n&&n.encode||Ht,s=n&&n.serialize;let i;if(s?i=s(t,n):i=a.isURLSearchParams(t)?t.toString():new de(t,n).toString(r),i){const o=e.indexOf("#");o!==-1&&(e=e.slice(0,o)),e+=(e.indexOf("?")===-1?"?":"&")+i}return e}class Te{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){a.forEach(this.handlers,function(r){r!==null&&t(r)})}}const $e={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},qt=typeof URLSearchParams!="undefined"?URLSearchParams:de,Jt=typeof FormData!="undefined"?FormData:null,zt=(()=>{let e;return typeof navigator!="undefined"&&((e=navigator.product)==="ReactNative"||e==="NativeScript"||e==="NS")?!1:typeof window!="undefined"&&typeof document!="undefined"})(),Vt=typeof WorkerGlobalScope!="undefined"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",g={isBrowser:!0,classes:{URLSearchParams:qt,FormData:Jt,Blob},isStandardBrowserEnv:zt,isStandardBrowserWebWorkerEnv:Vt,protocols:["http","https","file","blob","url","data"]};function Gt(e,t){return $(e,new g.classes.URLSearchParams,Object.assign({visitor:function(n,r,s,i){return g.isNode&&a.isBuffer(n)?(this.append(r,n.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)}},t))}function $t(e){return a.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function vt(e){const t={},n=Object.keys(e);let r;const s=n.length;let i;for(r=0;r<s;r++)i=n[r],t[i]=e[i];return t}function ve(e){function t(n,r,s,i){let o=n[i++];const c=Number.isFinite(+o),l=i>=n.length;return o=!o&&a.isArray(s)?s.length:o,l?(a.hasOwnProp(s,o)?s[o]=[s[o],r]:s[o]=r,!c):((!s[o]||!a.isObject(s[o]))&&(s[o]=[]),t(n,r,s[o],i)&&a.isArray(s[o])&&(s[o]=vt(s[o])),!c)}if(a.isFormData(e)&&a.isFunction(e.entries)){const n={};return a.forEachEntry(e,(r,s)=>{t($t(r),s,n,0)}),n}return null}const Kt={"Content-Type":void 0};function Wt(e,t,n){if(a.isString(e))try{return(t||JSON.parse)(e),a.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const v={transitional:$e,adapter:["xhr","http"],transformRequest:[function(t,n){const r=n.getContentType()||"",s=r.indexOf("application/json")>-1,i=a.isObject(t);if(i&&a.isHTMLForm(t)&&(t=new FormData(t)),a.isFormData(t))return s&&s?JSON.stringify(ve(t)):t;if(a.isArrayBuffer(t)||a.isBuffer(t)||a.isStream(t)||a.isFile(t)||a.isBlob(t))return t;if(a.isArrayBufferView(t))return t.buffer;if(a.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let c;if(i){if(r.indexOf("application/x-www-form-urlencoded")>-1)return Gt(t,this.formSerializer).toString();if((c=a.isFileList(t))||r.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return $(c?{"files[]":t}:t,l&&new l,this.formSerializer)}}return i||s?(n.setContentType("application/json",!1),Wt(t)):t}],transformResponse:[function(t){const n=this.transitional||v.transitional,r=n&&n.forcedJSONParsing,s=this.responseType==="json";if(t&&a.isString(t)&&(r&&!this.responseType||s)){const o=!(n&&n.silentJSONParsing)&&s;try{return JSON.parse(t)}catch(c){if(o)throw c.name==="SyntaxError"?m.from(c,m.ERR_BAD_RESPONSE,this,null,this.response):c}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:g.classes.FormData,Blob:g.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};a.forEach(["delete","get","head"],function(t){v.headers[t]={}});a.forEach(["post","put","patch"],function(t){v.headers[t]=a.merge(Kt)});const pe=v,Xt=a.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"]),Qt=e=>{const t={};let n,r,s;return e&&e.split(`
|
|
2
|
-
`).forEach(function(o){s=o.indexOf(":"),n=o.substring(0,s).trim().toLowerCase(),r=o.substring(s+1).trim(),!(!n||t[n]&&Xt[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},
|
|
3
|
-
`)}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(s=>r.set(s)),r}static accessor(t){const r=(this[Ne]=this[Ne]={accessors:{}}).accessors,s=this.prototype;function i(o){const c=_(o);r[c]||(tn(s,o),r[c]=!0)}return a.isArray(t)?t.forEach(i):i(t),this}}K.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);a.freezeMethods(K.prototype);a.freezeMethods(K);const R=K;function ne(e,t){const n=this||pe,r=t||n,s=R.from(r.headers);let i=r.data;return a.forEach(e,function(c){i=c.call(n,i,s.normalize(),t?t.status:void 0)}),s.normalize(),i}function Ke(e){return!!(e&&e.__CANCEL__)}function k(e,t,n){m.call(this,e==null?"canceled":e,m.ERR_CANCELED,t,n),this.name="CanceledError"}a.inherits(k,m,{__CANCEL__:!0});function nn(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new m("Request failed with status code "+n.status,[m.ERR_BAD_REQUEST,m.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}const rn=g.isStandardBrowserEnv?function(){return{write:function(n,r,s,i,o,c){const l=[];l.push(n+"="+encodeURIComponent(r)),a.isNumber(s)&&l.push("expires="+new Date(s).toGMTString()),a.isString(i)&&l.push("path="+i),a.isString(o)&&l.push("domain="+o),c===!0&&l.push("secure"),document.cookie=l.join("; ")},read:function(n){const r=document.cookie.match(new RegExp("(^|;\\s*)("+n+")=([^;]*)"));return r?decodeURIComponent(r[3]):null},remove:function(n){this.write(n,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}();function sn(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function on(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}function We(e,t){return e&&!sn(t)?on(e,t):t}const an=g.isStandardBrowserEnv?function(){const t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");let r;function s(i){let o=i;return t&&(n.setAttribute("href",o),o=n.href),n.setAttribute("href",o),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}return r=s(window.location.href),function(o){const c=a.isString(o)?s(o):o;return c.protocol===r.protocol&&c.host===r.host}}():function(){return function(){return!0}}();function cn(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function un(e,t){e=e||10;const n=new Array(e),r=new Array(e);let s=0,i=0,o;return t=t!==void 0?t:1e3,function(l){const u=Date.now(),f=r[i];o||(o=u),n[s]=l,r[s]=u;let p=i,w=0;for(;p!==s;)w+=n[p++],p=p%e;if(s=(s+1)%e,s===i&&(i=(i+1)%e),u-o<t)return;const E=f&&u-f;return E?Math.round(w*1e3/E):void 0}}function Pe(e,t){let n=0;const r=un(50,250);return s=>{const i=s.loaded,o=s.lengthComputable?s.total:void 0,c=i-n,l=r(c),u=i<=o;n=i;const f={loaded:i,total:o,progress:o?i/o:void 0,bytes:c,rate:l||void 0,estimated:l&&o&&u?(o-i)/l:void 0,event:s};f[t?"download":"upload"]=!0,e(f)}}const ln=typeof XMLHttpRequest!="undefined",fn=ln&&function(e){return new Promise(function(n,r){let s=e.data;const i=R.from(e.headers).normalize(),o=e.responseType;let c;function l(){e.cancelToken&&e.cancelToken.unsubscribe(c),e.signal&&e.signal.removeEventListener("abort",c)}a.isFormData(s)&&(g.isStandardBrowserEnv||g.isStandardBrowserWebWorkerEnv)&&i.setContentType(!1);let u=new XMLHttpRequest;if(e.auth){const E=e.auth.username||"",d=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";i.set("Authorization","Basic "+btoa(E+":"+d))}const f=We(e.baseURL,e.url);u.open(e.method.toUpperCase(),Ge(f,e.params,e.paramsSerializer),!0),u.timeout=e.timeout;function p(){if(!u)return;const E=R.from("getAllResponseHeaders"in u&&u.getAllResponseHeaders()),h={data:!o||o==="text"||o==="json"?u.responseText:u.response,status:u.status,statusText:u.statusText,headers:E,config:e,request:u};nn(function(b){n(b),l()},function(b){r(b),l()},h),u=null}if("onloadend"in u?u.onloadend=p:u.onreadystatechange=function(){!u||u.readyState!==4||u.status===0&&!(u.responseURL&&u.responseURL.indexOf("file:")===0)||setTimeout(p)},u.onabort=function(){u&&(r(new m("Request aborted",m.ECONNABORTED,e,u)),u=null)},u.onerror=function(){r(new m("Network Error",m.ERR_NETWORK,e,u)),u=null},u.ontimeout=function(){let d=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const h=e.transitional||$e;e.timeoutErrorMessage&&(d=e.timeoutErrorMessage),r(new m(d,h.clarifyTimeoutError?m.ETIMEDOUT:m.ECONNABORTED,e,u)),u=null},g.isStandardBrowserEnv){const E=(e.withCredentials||an(f))&&e.xsrfCookieName&&rn.read(e.xsrfCookieName);E&&i.set(e.xsrfHeaderName,E)}s===void 0&&i.setContentType(null),"setRequestHeader"in u&&a.forEach(i.toJSON(),function(d,h){u.setRequestHeader(h,d)}),a.isUndefined(e.withCredentials)||(u.withCredentials=!!e.withCredentials),o&&o!=="json"&&(u.responseType=e.responseType),typeof e.onDownloadProgress=="function"&&u.addEventListener("progress",Pe(e.onDownloadProgress,!0)),typeof e.onUploadProgress=="function"&&u.upload&&u.upload.addEventListener("progress",Pe(e.onUploadProgress)),(e.cancelToken||e.signal)&&(c=E=>{u&&(r(!E||E.type?new k(null,e,u):E),u.abort(),u=null)},e.cancelToken&&e.cancelToken.subscribe(c),e.signal&&(e.signal.aborted?c():e.signal.addEventListener("abort",c)));const w=cn(f);if(w&&g.protocols.indexOf(w)===-1){r(new m("Unsupported protocol "+w+":",m.ERR_BAD_REQUEST,e));return}u.send(s||null)})},q={http:It,xhr:fn};a.forEach(q,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(n){}Object.defineProperty(e,"adapterName",{value:t})}});const dn={getAdapter:e=>{e=a.isArray(e)?e:[e];const{length:t}=e;let n,r;for(let s=0;s<t&&(n=e[s],!(r=a.isString(n)?q[n.toLowerCase()]:n));s++);if(!r)throw r===!1?new m(`Adapter ${n} is not supported by the environment`,"ERR_NOT_SUPPORT"):new Error(a.hasOwnProp(q,n)?`Adapter '${n}' is not available in the build`:`Unknown adapter '${n}'`);if(!a.isFunction(r))throw new TypeError("adapter is not a function");return r},adapters:q};function re(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new k(null,e)}function Ce(e){return re(e),e.headers=R.from(e.headers),e.data=ne.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),dn.getAdapter(e.adapter||pe.adapter)(e).then(function(r){return re(e),r.data=ne.call(e,e.transformResponse,r),r.headers=R.from(r.headers),r},function(r){return Ke(r)||(re(e),r&&r.response&&(r.response.data=ne.call(e,e.transformResponse,r.response),r.response.headers=R.from(r.response.headers))),Promise.reject(r)})}const xe=e=>e instanceof R?e.toJSON():e;function C(e,t){t=t||{};const n={};function r(u,f,p){return a.isPlainObject(u)&&a.isPlainObject(f)?a.merge.call({caseless:p},u,f):a.isPlainObject(f)?a.merge({},f):a.isArray(f)?f.slice():f}function s(u,f,p){if(a.isUndefined(f)){if(!a.isUndefined(u))return r(void 0,u,p)}else return r(u,f,p)}function i(u,f){if(!a.isUndefined(f))return r(void 0,f)}function o(u,f){if(a.isUndefined(f)){if(!a.isUndefined(u))return r(void 0,u)}else return r(void 0,f)}function c(u,f,p){if(p in t)return r(u,f);if(p in e)return r(void 0,u)}const l={url:i,method:i,data:i,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:c,headers:(u,f)=>s(xe(u),xe(f),!0)};return a.forEach(Object.keys(e).concat(Object.keys(t)),function(f){const p=l[f]||s,w=p(e[f],t[f],f);a.isUndefined(w)&&p!==c||(n[f]=w)}),n}const Xe="1.3.3",he={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{he[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const Le={};he.transitional=function(t,n,r){function s(i,o){return"[Axios v"+Xe+"] Transitional option '"+i+"'"+o+(r?". "+r:"")}return(i,o,c)=>{if(t===!1)throw new m(s(o," has been removed"+(n?" in "+n:"")),m.ERR_DEPRECATED);return n&&!Le[o]&&(Le[o]=!0,console.warn(s(o," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(i,o,c):!0}};function pn(e,t,n){if(typeof e!="object")throw new m("options must be an object",m.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let s=r.length;for(;s-- >0;){const i=r[s],o=t[i];if(o){const c=e[i],l=c===void 0||o(c,i,e);if(l!==!0)throw new m("option "+i+" must be "+l,m.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new m("Unknown option "+i,m.ERR_BAD_OPTION)}}const ie={assertOptions:pn,validators:he},T=ie.validators;class z{constructor(t){this.defaults=t,this.interceptors={request:new Te,response:new Te}}request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=C(this.defaults,n);const{transitional:r,paramsSerializer:s,headers:i}=n;r!==void 0&&ie.assertOptions(r,{silentJSONParsing:T.transitional(T.boolean),forcedJSONParsing:T.transitional(T.boolean),clarifyTimeoutError:T.transitional(T.boolean)},!1),s!==void 0&&ie.assertOptions(s,{encode:T.function,serialize:T.function},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let o;o=i&&a.merge(i.common,i[n.method]),o&&a.forEach(["delete","get","head","post","put","patch","common"],d=>{delete i[d]}),n.headers=R.concat(o,i);const c=[];let l=!0;this.interceptors.request.forEach(function(h){typeof h.runWhen=="function"&&h.runWhen(n)===!1||(l=l&&h.synchronous,c.unshift(h.fulfilled,h.rejected))});const u=[];this.interceptors.response.forEach(function(h){u.push(h.fulfilled,h.rejected)});let f,p=0,w;if(!l){const d=[Ce.bind(this),void 0];for(d.unshift.apply(d,c),d.push.apply(d,u),w=d.length,f=Promise.resolve(n);p<w;)f=f.then(d[p++],d[p++]);return f}w=c.length;let E=n;for(p=0;p<w;){const d=c[p++],h=c[p++];try{E=d(E)}catch(O){h.call(this,O);break}}try{f=Ce.call(this,E)}catch(d){return Promise.reject(d)}for(p=0,w=u.length;p<w;)f=f.then(u[p++],u[p++]);return f}getUri(t){t=C(this.defaults,t);const n=We(t.baseURL,t.url);return Ge(n,t.params,t.paramsSerializer)}}a.forEach(["delete","get","head","options"],function(t){z.prototype[t]=function(n,r){return this.request(C(r||{},{method:t,url:n,data:(r||{}).data}))}});a.forEach(["post","put","patch"],function(t){function n(r){return function(i,o,c){return this.request(C(c||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:i,data:o}))}}z.prototype[t]=n(),z.prototype[t+"Form"]=n(!0)});const J=z;class me{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(i){n=i});const r=this;this.promise.then(s=>{if(!r._listeners)return;let i=r._listeners.length;for(;i-- >0;)r._listeners[i](s);r._listeners=null}),this.promise.then=s=>{let i;const o=new Promise(c=>{r.subscribe(c),i=c}).then(s);return o.cancel=function(){r.unsubscribe(i)},o},t(function(i,o,c){r.reason||(r.reason=new k(i,o,c),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)}static source(){let t;return{token:new me(function(s){t=s}),cancel:t}}}const hn=me;function mn(e){return function(n){return e.apply(null,n)}}function En(e){return a.isObject(e)&&e.isAxiosError===!0}const ae={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(ae).forEach(([e,t])=>{ae[t]=e});const yn=ae;function Qe(e){const t=new J(e),n=_e(J.prototype.request,t);return a.extend(n,J.prototype,t,{allOwnKeys:!0}),a.extend(n,t,null,{allOwnKeys:!0}),n.create=function(s){return Qe(C(e,s))},n}const y=Qe(pe);y.Axios=J;y.CanceledError=k;y.CancelToken=hn;y.isCancel=Ke;y.VERSION=Xe;y.toFormData=$;y.AxiosError=m;y.Cancel=y.CanceledError;y.all=function(t){return Promise.all(t)};y.spread=mn;y.isAxiosError=En;y.mergeConfig=C;y.AxiosHeaders=R;y.formToJSON=e=>ve(a.isHTMLForm(e)?new FormData(e):e);y.HttpStatusCode=yn;y.default=y;const wn={LOGIN_URL:`${window.location.origin}/ttc/cloud/#/login`,HOME_URL:`${window.location.origin}/ttc/cloud/#/cloud`,INTEGRATED_BASE_URL:"/gateway/integrated-management/api/v1"},Ee={ttc:wn},Sn=(e="ttc")=>Y.get(`${Ee[e].INTEGRATED_BASE_URL}/account/auth/route/list`),bn=(e="ttc")=>Y.get(`${Ee[e].INTEGRATED_BASE_URL}/account/home/menu`),ye=(e="ttc")=>{Q({token:""})},W=(e="ttc")=>{var s;const t=`${e}GlobalState`,n=(s=localStorage.getItem(t))!=null?s:"{}";return JSON.parse(n)?JSON.parse(n).token:null},Ye=(r,...s)=>j(exports,[r,...s],function*({userName:e,password:t},n="ttc"){const i=L("loginApiUrl"),{data:o}=yield Y.post(i,{userName:e,password:t});o.tokenValue&&S.ElMessage.success("登录成功"),Q({token:o.tokenValue,userInfo:o})}),gn=(e="ttc")=>{var s;const t=`${e}GlobalState`,n=(s=localStorage.getItem(t))!=null?s:"{}";return JSON.parse(n)?JSON.parse(n).userInfo:null},On=()=>j(exports,null,function*(){return W()?yield bn():[]}),X=()=>{if(Ze()){ye();const e=location.pathname;if(e.includes(we())||e.includes(V()))return;window.location.replace(V())}else{console.log("开发环境!!!");const e=window.prompt("当前系统处于开发环境,当前登录过期,请输入登录账号","");if(e!==null){const t=window.prompt("请输入登录密码","");(t===null||t=="")&&window.prompt("请输入登录密码",""),Ye({userName:e,password:t})}}},Rn=()=>{window.location.replace(V())},we=()=>L("loginUrl"),V=()=>L("homeUrl"),Q=e=>{var r;const t=(r=localStorage.getItem("ttcGlobalState"))!=null?r:"{}",n=U(U({},JSON.parse(t)),e);localStorage.setItem("ttcGlobalState",JSON.stringify(n))},L=e=>{var n,r;return(r=JSON.parse((n=localStorage.getItem("ttcGlobalState"))!=null?n:"{}")[e])!=null?r:""},Ze=()=>L("environment")==="production",An=(e,t=!0,n)=>j(exports,null,function*(){if(!W()&&t)return X();try{const{data:r}=yield Sn(n),s=r.filter(c=>c.routeTag.includes(e)),i=s.filter(c=>c.routeType==="VIEW"),o=s.filter(c=>c.routeType==="BTN");return sessionStorage.setItem("ttcUserBtnList",JSON.stringify(o.map(c=>c.routeTag))),{userMenuList:i,userBtnList:o}}catch(r){}}),Tn=(e,t,n)=>{let r=[];return e.forEach(s=>{const i=`/src/views${s.routeView}/config.ts`,o=`/src/views${s.routeView}/index.vue`;if(t[o]&&n[i]){const c=n[i],l={path:s.routeView,name:s.routeView.split("/")[1],meta:{title:c.title,icon:c.icon},component:t[o]};r.push(l)}}),r},et=e=>{var n;if(!e)return!1;const t=(n=sessionStorage.getItem("ttcUserBtnList"))!=null?n:"[]";return JSON.parse(t).includes(e)},Nn=Object.freeze(Object.defineProperty({__proto__:null,autoLogin:Ye,getHomeUrl:V,getLoginUrl:we,getSystemConfig:L,getToken:W,getUserInfo:gn,getUserIsHaveBtnPower:et,getUserPermissions:An,getUserRouteList:On,getUserRouter:Tn,isProduction:Ze,jumpToHome:Rn,jumpToLogin:X,removeToken:ye,setSystemConfig:Q},Symbol.toStringTag,{value:"Module"}));let tt;const Pn={lock:!0,text:"加载中...",fullscreen:!0,background:"rgba(0, 0, 0, 0.6)"},Cn=()=>{tt=S.ElLoading.service(Pn)},xn=()=>{tt.close()};let B=0;const Ln=()=>{B===0&&Cn(),B++},Ue=()=>{B<=0||(B--,B===0&&xn())};var ce=(e=>(e[e.SUCCESS=200]="SUCCESS",e[e.ERROR=500]="ERROR",e[e.OVERDUE=401]="OVERDUE",e[e.TIMEOUT=3e4]="TIMEOUT",e))(ce||{});const Un={timeout:3e4,withCredentials:!0},_n=(e,t)=>{switch(e){case 400:S.ElMessage.error(t||"请求失败!请您稍后重试");break;case 401:location.href.includes(we())||(S.ElMessage.error(t||"登录失效!请您重新登录"),X());break;case 403:S.ElMessage.error(t||"当前账号无权限访问!");break;case 404:S.ElMessage.error("你所访问的资源不存在!");break;case 405:S.ElMessage.error(t||"请求方式错误!请您稍后重试");break;case 408:S.ElMessage.error(t||"请求超时!请您稍后重试");break;case 500:S.ElMessage.error(t||"服务异常!");break;case 502:S.ElMessage.error("网关错误!");break;case 503:S.ElMessage.error("服务不可用!");break;case 504:S.ElMessage.error("网关超时!");break;default:S.ElMessage.error("请求失败!")}};class Bn{constructor(t){be(this,"service");this.service=y.create(t),this.setupInterceptors()}setupInterceptors(){this.service.interceptors.request.use(t=>{var n;return(n=t.headers)!=null&&n.noLoading||Ln(),t.headers.token=W(),t},t=>Promise.reject(t)),this.service.interceptors.response.use(t=>{const{data:n}=t;return Ue(),n.code==ce.OVERDUE?this.handleOverdueResponse(n):n.code!==ce.SUCCESS&&this.handleErrorResponse(n),n},t=>(Ue(),t.message.includes("timeout")?S.ElMessage.error("请求超时!请稍后重试"):t.message.includes("Network Error")&&S.ElMessage.error("网络错误!请稍后重试"),t.response&&_n(t.response.status),window.navigator.onLine||S.ElNotification({title:"提示",message:"当前网络似乎开小差了",type:"warning",duration:5e3}),Promise.reject(t)))}handleOverdueResponse(t){return ye(),X(),S.ElNotification({title:"登录过期提醒",message:t.resultMsg||"当前登录失效",type:"warning",duration:5e3}),Promise.reject(t)}handleErrorResponse(t){return S.ElMessage.error(t.resultMsg),Promise.reject(t)}get(t,n,r={}){return this.service.get(t,U({params:n},r))}post(t,n,r={}){return this.service.post(t,n,r)}put(t,n,r={}){return this.service.put(t,n,r)}delete(t,n,r={}){return this.service.delete(t,U({params:n},r))}}const Y=new Bn(Un);exports.URL=Ee;exports.getSystemConfig=L;exports.getUserIsHaveBtnPower=et;exports.http=Y;exports.index=Nn;exports.setSystemConfig=Q;
|
|
1
|
+
"use strict";var rt=Object.defineProperty;var Se=Object.getOwnPropertySymbols;var st=Object.prototype.hasOwnProperty,ot=Object.prototype.propertyIsEnumerable;var Z=(e,t,n)=>t in e?rt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,_=(e,t)=>{for(var n in t||(t={}))st.call(t,n)&&Z(e,n,t[n]);if(Se)for(var n of Se(t))ot.call(t,n)&&Z(e,n,t[n]);return e};var ee=(e,t,n)=>(Z(e,typeof t!="symbol"?t+"":t,n),n);var j=(e,t,n)=>new Promise((r,s)=>{var i=l=>{try{c(n.next(l))}catch(u){s(u)}},o=l=>{try{c(n.throw(l))}catch(u){s(u)}},c=l=>l.done?r(l.value):Promise.resolve(l.value).then(i,o);c((n=n.apply(e,t)).next())});const S=require("element-plus");function Ue(e,t){return function(){return e.apply(t,arguments)}}const{toString:_e}=Object.prototype,{getPrototypeOf:le}=Object,fe=(e=>t=>{const n=_e.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),A=e=>(e=e.toLowerCase(),t=>fe(t)===e),G=e=>t=>typeof t===e,{isArray:L}=Array,D=G("undefined");function it(e){return e!==null&&!D(e)&&e.constructor!==null&&!D(e.constructor)&&N(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Be=A("ArrayBuffer");function at(e){let t;return typeof ArrayBuffer!="undefined"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&Be(e.buffer),t}const ct=G("string"),N=G("function"),Fe=G("number"),de=e=>e!==null&&typeof e=="object",ut=e=>e===!0||e===!1,H=e=>{if(fe(e)!=="object")return!1;const t=le(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},lt=A("Date"),ft=A("File"),dt=A("Blob"),pt=A("FileList"),ht=e=>de(e)&&N(e.pipe),mt=e=>{const t="[object FormData]";return e&&(typeof FormData=="function"&&e instanceof FormData||_e.call(e)===t||N(e.toString)&&e.toString()===t)},Et=A("URLSearchParams"),yt=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function k(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e=="undefined")return;let r,s;if(typeof e!="object"&&(e=[e]),L(e))for(r=0,s=e.length;r<s;r++)t.call(null,e[r],r,e);else{const i=n?Object.getOwnPropertyNames(e):Object.keys(e),o=i.length;let c;for(r=0;r<o;r++)c=i[r],t.call(null,e[c],c,e)}}function De(e,t){t=t.toLowerCase();const n=Object.keys(e);let r=n.length,s;for(;r-- >0;)if(s=n[r],t===s.toLowerCase())return s;return null}const ke=typeof globalThis!="undefined"?globalThis:typeof self!="undefined"?self:typeof window!="undefined"?window:global,Me=e=>!D(e)&&e!==ke;function oe(){const{caseless:e}=Me(this)&&this||{},t={},n=(r,s)=>{const i=e&&De(t,s)||s;H(t[i])&&H(r)?t[i]=oe(t[i],r):H(r)?t[i]=oe({},r):L(r)?t[i]=r.slice():t[i]=r};for(let r=0,s=arguments.length;r<s;r++)arguments[r]&&k(arguments[r],n);return t}const wt=(e,t,n,{allOwnKeys:r}={})=>(k(t,(s,i)=>{n&&N(s)?e[i]=Ue(s,n):e[i]=s},{allOwnKeys:r}),e),St=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),bt=(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)},gt=(e,t,n,r)=>{let s,i,o;const c={};if(t=t||{},e==null)return t;do{for(s=Object.getOwnPropertyNames(e),i=s.length;i-- >0;)o=s[i],(!r||r(o,e,t))&&!c[o]&&(t[o]=e[o],c[o]=!0);e=n!==!1&&le(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},Rt=(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},Ot=e=>{if(!e)return null;if(L(e))return e;let t=e.length;if(!Fe(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},At=(e=>t=>e&&t instanceof e)(typeof Uint8Array!="undefined"&&le(Uint8Array)),Tt=(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let s;for(;(s=r.next())&&!s.done;){const i=s.value;t.call(e,i[0],i[1])}},Nt=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},Pt=A("HTMLFormElement"),Ct=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,s){return r.toUpperCase()+s}),be=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),xt=A("RegExp"),Ie=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};k(n,(s,i)=>{t(s,i,e)!==!1&&(r[i]=s)}),Object.defineProperties(e,r)},Lt=e=>{Ie(e,(t,n)=>{if(N(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(N(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+"'")})}})},Ut=(e,t)=>{const n={},r=s=>{s.forEach(i=>{n[i]=!0})};return L(e)?r(e):r(String(e).split(t)),n},_t=()=>{},Bt=(e,t)=>(e=+e,Number.isFinite(e)?e:t),te="abcdefghijklmnopqrstuvwxyz",ge="0123456789",je={DIGIT:ge,ALPHA:te,ALPHA_DIGIT:te+te.toUpperCase()+ge},Ft=(e=16,t=je.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n};function Dt(e){return!!(e&&N(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const kt=e=>{const t=new Array(10),n=(r,s)=>{if(de(r)){if(t.indexOf(r)>=0)return;if(!("toJSON"in r)){t[s]=r;const i=L(r)?[]:{};return k(r,(o,c)=>{const l=n(o,s+1);!D(l)&&(i[c]=l)}),t[s]=void 0,i}}return r};return n(e,0)},a={isArray:L,isArrayBuffer:Be,isBuffer:it,isFormData:mt,isArrayBufferView:at,isString:ct,isNumber:Fe,isBoolean:ut,isObject:de,isPlainObject:H,isUndefined:D,isDate:lt,isFile:ft,isBlob:dt,isRegExp:xt,isFunction:N,isStream:ht,isURLSearchParams:Et,isTypedArray:At,isFileList:pt,forEach:k,merge:oe,extend:wt,trim:yt,stripBOM:St,inherits:bt,toFlatObject:gt,kindOf:fe,kindOfTest:A,endsWith:Rt,toArray:Ot,forEachEntry:Tt,matchAll:Nt,isHTMLForm:Pt,hasOwnProperty:be,hasOwnProp:be,reduceDescriptors:Ie,freezeMethods:Lt,toObjectSet:Ut,toCamelCase:Ct,noop:_t,toFiniteNumber:Bt,findKey:De,global:ke,isContextDefined:Me,ALPHABET:je,generateString:Ft,isSpecCompliantForm:Dt,toJSONObject:kt};function m(e,t,n,r,s){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),s&&(this.response=s)}a.inherits(m,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:a.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const He=m.prototype,qe={};["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=>{qe[e]={value:e}});Object.defineProperties(m,qe);Object.defineProperty(He,"isAxiosError",{value:!0});m.from=(e,t,n,r,s,i)=>{const o=Object.create(He);return a.toFlatObject(e,o,function(l){return l!==Error.prototype},c=>c!=="isAxiosError"),m.call(o,e.message,t,n,r,s),o.cause=e,o.name=e.name,i&&Object.assign(o,i),o};const Mt=null;function ie(e){return a.isPlainObject(e)||a.isArray(e)}function Je(e){return a.endsWith(e,"[]")?e.slice(0,-2):e}function Re(e,t,n){return e?e.concat(t).map(function(s,i){return s=Je(s),!n&&i?"["+s+"]":s}).join(n?".":""):t}function It(e){return a.isArray(e)&&!e.some(ie)}const jt=a.toFlatObject(a,{},null,function(t){return/^is[A-Z]/.test(t)});function $(e,t,n){if(!a.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=a.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(h,R){return!a.isUndefined(R[h])});const r=n.metaTokens,s=n.visitor||f,i=n.dots,o=n.indexes,l=(n.Blob||typeof Blob!="undefined"&&Blob)&&a.isSpecCompliantForm(t);if(!a.isFunction(s))throw new TypeError("visitor must be a function");function u(d){if(d===null)return"";if(a.isDate(d))return d.toISOString();if(!l&&a.isBlob(d))throw new m("Blob is not supported. Use a Buffer instead.");return a.isArrayBuffer(d)||a.isTypedArray(d)?l&&typeof Blob=="function"?new Blob([d]):Buffer.from(d):d}function f(d,h,R){let b=d;if(d&&!R&&typeof d=="object"){if(a.endsWith(h,"{}"))h=r?h:h.slice(0,-2),d=JSON.stringify(d);else if(a.isArray(d)&&It(d)||(a.isFileList(d)||a.endsWith(h,"[]"))&&(b=a.toArray(d)))return h=Je(h),b.forEach(function(I,nt){!(a.isUndefined(I)||I===null)&&t.append(o===!0?Re([h],nt,i):o===null?h:h+"[]",u(I))}),!1}return ie(d)?!0:(t.append(Re(R,h,i),u(d)),!1)}const p=[],w=Object.assign(jt,{defaultVisitor:f,convertValue:u,isVisitable:ie});function E(d,h){if(!a.isUndefined(d)){if(p.indexOf(d)!==-1)throw Error("Circular reference detected in "+h.join("."));p.push(d),a.forEach(d,function(b,P){(!(a.isUndefined(b)||b===null)&&s.call(t,b,a.isString(P)?P.trim():P,h,w))===!0&&E(b,h?h.concat(P):[P])}),p.pop()}}if(!a.isObject(e))throw new TypeError("data must be an object");return E(e),t}function Oe(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function pe(e,t){this._pairs=[],e&&$(e,this,t)}const ze=pe.prototype;ze.append=function(t,n){this._pairs.push([t,n])};ze.toString=function(t){const n=t?function(r){return t.call(this,r,Oe)}:Oe;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};function Ht(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Ve(e,t,n){if(!t)return e;const r=n&&n.encode||Ht,s=n&&n.serialize;let i;if(s?i=s(t,n):i=a.isURLSearchParams(t)?t.toString():new pe(t,n).toString(r),i){const o=e.indexOf("#");o!==-1&&(e=e.slice(0,o)),e+=(e.indexOf("?")===-1?"?":"&")+i}return e}class Ae{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){a.forEach(this.handlers,function(r){r!==null&&t(r)})}}const Ge={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},qt=typeof URLSearchParams!="undefined"?URLSearchParams:pe,Jt=typeof FormData!="undefined"?FormData:null,zt=(()=>{let e;return typeof navigator!="undefined"&&((e=navigator.product)==="ReactNative"||e==="NativeScript"||e==="NS")?!1:typeof window!="undefined"&&typeof document!="undefined"})(),Vt=typeof WorkerGlobalScope!="undefined"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",g={isBrowser:!0,classes:{URLSearchParams:qt,FormData:Jt,Blob},isStandardBrowserEnv:zt,isStandardBrowserWebWorkerEnv:Vt,protocols:["http","https","file","blob","url","data"]};function Gt(e,t){return $(e,new g.classes.URLSearchParams,Object.assign({visitor:function(n,r,s,i){return g.isNode&&a.isBuffer(n)?(this.append(r,n.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)}},t))}function $t(e){return a.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function vt(e){const t={},n=Object.keys(e);let r;const s=n.length;let i;for(r=0;r<s;r++)i=n[r],t[i]=e[i];return t}function $e(e){function t(n,r,s,i){let o=n[i++];const c=Number.isFinite(+o),l=i>=n.length;return o=!o&&a.isArray(s)?s.length:o,l?(a.hasOwnProp(s,o)?s[o]=[s[o],r]:s[o]=r,!c):((!s[o]||!a.isObject(s[o]))&&(s[o]=[]),t(n,r,s[o],i)&&a.isArray(s[o])&&(s[o]=vt(s[o])),!c)}if(a.isFormData(e)&&a.isFunction(e.entries)){const n={};return a.forEachEntry(e,(r,s)=>{t($t(r),s,n,0)}),n}return null}const Kt={"Content-Type":void 0};function Wt(e,t,n){if(a.isString(e))try{return(t||JSON.parse)(e),a.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const v={transitional:Ge,adapter:["xhr","http"],transformRequest:[function(t,n){const r=n.getContentType()||"",s=r.indexOf("application/json")>-1,i=a.isObject(t);if(i&&a.isHTMLForm(t)&&(t=new FormData(t)),a.isFormData(t))return s&&s?JSON.stringify($e(t)):t;if(a.isArrayBuffer(t)||a.isBuffer(t)||a.isStream(t)||a.isFile(t)||a.isBlob(t))return t;if(a.isArrayBufferView(t))return t.buffer;if(a.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let c;if(i){if(r.indexOf("application/x-www-form-urlencoded")>-1)return Gt(t,this.formSerializer).toString();if((c=a.isFileList(t))||r.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return $(c?{"files[]":t}:t,l&&new l,this.formSerializer)}}return i||s?(n.setContentType("application/json",!1),Wt(t)):t}],transformResponse:[function(t){const n=this.transitional||v.transitional,r=n&&n.forcedJSONParsing,s=this.responseType==="json";if(t&&a.isString(t)&&(r&&!this.responseType||s)){const o=!(n&&n.silentJSONParsing)&&s;try{return JSON.parse(t)}catch(c){if(o)throw c.name==="SyntaxError"?m.from(c,m.ERR_BAD_RESPONSE,this,null,this.response):c}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:g.classes.FormData,Blob:g.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};a.forEach(["delete","get","head"],function(t){v.headers[t]={}});a.forEach(["post","put","patch"],function(t){v.headers[t]=a.merge(Kt)});const he=v,Xt=a.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"]),Qt=e=>{const t={};let n,r,s;return e&&e.split(`
|
|
2
|
+
`).forEach(function(o){s=o.indexOf(":"),n=o.substring(0,s).trim().toLowerCase(),r=o.substring(s+1).trim(),!(!n||t[n]&&Xt[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},Te=Symbol("internals");function B(e){return e&&String(e).trim().toLowerCase()}function q(e){return e===!1||e==null?e:a.isArray(e)?e.map(q):String(e)}function Yt(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}function Zt(e){return/^[-_a-zA-Z]+$/.test(e.trim())}function ne(e,t,n,r,s){if(a.isFunction(r))return r.call(this,t,n);if(s&&(t=n),!!a.isString(t)){if(a.isString(r))return t.indexOf(r)!==-1;if(a.isRegExp(r))return r.test(t)}}function en(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function tn(e,t){const n=a.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(s,i,o){return this[r].call(this,t,s,i,o)},configurable:!0})})}class K{constructor(t){t&&this.set(t)}set(t,n,r){const s=this;function i(c,l,u){const f=B(l);if(!f)throw new Error("header name must be a non-empty string");const p=a.findKey(s,f);(!p||s[p]===void 0||u===!0||u===void 0&&s[p]!==!1)&&(s[p||l]=q(c))}const o=(c,l)=>a.forEach(c,(u,f)=>i(u,f,l));return a.isPlainObject(t)||t instanceof this.constructor?o(t,n):a.isString(t)&&(t=t.trim())&&!Zt(t)?o(Qt(t),n):t!=null&&i(n,t,r),this}get(t,n){if(t=B(t),t){const r=a.findKey(this,t);if(r){const s=this[r];if(!n)return s;if(n===!0)return Yt(s);if(a.isFunction(n))return n.call(this,s,r);if(a.isRegExp(n))return n.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=B(t),t){const r=a.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||ne(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let s=!1;function i(o){if(o=B(o),o){const c=a.findKey(r,o);c&&(!n||ne(r,r[c],c,n))&&(delete r[c],s=!0)}}return a.isArray(t)?t.forEach(i):i(t),s}clear(t){const n=Object.keys(this);let r=n.length,s=!1;for(;r--;){const i=n[r];(!t||ne(this,this[i],i,t,!0))&&(delete this[i],s=!0)}return s}normalize(t){const n=this,r={};return a.forEach(this,(s,i)=>{const o=a.findKey(r,i);if(o){n[o]=q(s),delete n[i];return}const c=t?en(i):String(i).trim();c!==i&&delete n[i],n[c]=q(s),r[c]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return a.forEach(this,(r,s)=>{r!=null&&r!==!1&&(n[s]=t&&a.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(`
|
|
3
|
+
`)}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(s=>r.set(s)),r}static accessor(t){const r=(this[Te]=this[Te]={accessors:{}}).accessors,s=this.prototype;function i(o){const c=B(o);r[c]||(tn(s,o),r[c]=!0)}return a.isArray(t)?t.forEach(i):i(t),this}}K.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);a.freezeMethods(K.prototype);a.freezeMethods(K);const O=K;function re(e,t){const n=this||he,r=t||n,s=O.from(r.headers);let i=r.data;return a.forEach(e,function(c){i=c.call(n,i,s.normalize(),t?t.status:void 0)}),s.normalize(),i}function ve(e){return!!(e&&e.__CANCEL__)}function M(e,t,n){m.call(this,e==null?"canceled":e,m.ERR_CANCELED,t,n),this.name="CanceledError"}a.inherits(M,m,{__CANCEL__:!0});function nn(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new m("Request failed with status code "+n.status,[m.ERR_BAD_REQUEST,m.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}const rn=g.isStandardBrowserEnv?function(){return{write:function(n,r,s,i,o,c){const l=[];l.push(n+"="+encodeURIComponent(r)),a.isNumber(s)&&l.push("expires="+new Date(s).toGMTString()),a.isString(i)&&l.push("path="+i),a.isString(o)&&l.push("domain="+o),c===!0&&l.push("secure"),document.cookie=l.join("; ")},read:function(n){const r=document.cookie.match(new RegExp("(^|;\\s*)("+n+")=([^;]*)"));return r?decodeURIComponent(r[3]):null},remove:function(n){this.write(n,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}();function sn(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function on(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}function Ke(e,t){return e&&!sn(t)?on(e,t):t}const an=g.isStandardBrowserEnv?function(){const t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");let r;function s(i){let o=i;return t&&(n.setAttribute("href",o),o=n.href),n.setAttribute("href",o),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}return r=s(window.location.href),function(o){const c=a.isString(o)?s(o):o;return c.protocol===r.protocol&&c.host===r.host}}():function(){return function(){return!0}}();function cn(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function un(e,t){e=e||10;const n=new Array(e),r=new Array(e);let s=0,i=0,o;return t=t!==void 0?t:1e3,function(l){const u=Date.now(),f=r[i];o||(o=u),n[s]=l,r[s]=u;let p=i,w=0;for(;p!==s;)w+=n[p++],p=p%e;if(s=(s+1)%e,s===i&&(i=(i+1)%e),u-o<t)return;const E=f&&u-f;return E?Math.round(w*1e3/E):void 0}}function Ne(e,t){let n=0;const r=un(50,250);return s=>{const i=s.loaded,o=s.lengthComputable?s.total:void 0,c=i-n,l=r(c),u=i<=o;n=i;const f={loaded:i,total:o,progress:o?i/o:void 0,bytes:c,rate:l||void 0,estimated:l&&o&&u?(o-i)/l:void 0,event:s};f[t?"download":"upload"]=!0,e(f)}}const ln=typeof XMLHttpRequest!="undefined",fn=ln&&function(e){return new Promise(function(n,r){let s=e.data;const i=O.from(e.headers).normalize(),o=e.responseType;let c;function l(){e.cancelToken&&e.cancelToken.unsubscribe(c),e.signal&&e.signal.removeEventListener("abort",c)}a.isFormData(s)&&(g.isStandardBrowserEnv||g.isStandardBrowserWebWorkerEnv)&&i.setContentType(!1);let u=new XMLHttpRequest;if(e.auth){const E=e.auth.username||"",d=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";i.set("Authorization","Basic "+btoa(E+":"+d))}const f=Ke(e.baseURL,e.url);u.open(e.method.toUpperCase(),Ve(f,e.params,e.paramsSerializer),!0),u.timeout=e.timeout;function p(){if(!u)return;const E=O.from("getAllResponseHeaders"in u&&u.getAllResponseHeaders()),h={data:!o||o==="text"||o==="json"?u.responseText:u.response,status:u.status,statusText:u.statusText,headers:E,config:e,request:u};nn(function(b){n(b),l()},function(b){r(b),l()},h),u=null}if("onloadend"in u?u.onloadend=p:u.onreadystatechange=function(){!u||u.readyState!==4||u.status===0&&!(u.responseURL&&u.responseURL.indexOf("file:")===0)||setTimeout(p)},u.onabort=function(){u&&(r(new m("Request aborted",m.ECONNABORTED,e,u)),u=null)},u.onerror=function(){r(new m("Network Error",m.ERR_NETWORK,e,u)),u=null},u.ontimeout=function(){let d=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const h=e.transitional||Ge;e.timeoutErrorMessage&&(d=e.timeoutErrorMessage),r(new m(d,h.clarifyTimeoutError?m.ETIMEDOUT:m.ECONNABORTED,e,u)),u=null},g.isStandardBrowserEnv){const E=(e.withCredentials||an(f))&&e.xsrfCookieName&&rn.read(e.xsrfCookieName);E&&i.set(e.xsrfHeaderName,E)}s===void 0&&i.setContentType(null),"setRequestHeader"in u&&a.forEach(i.toJSON(),function(d,h){u.setRequestHeader(h,d)}),a.isUndefined(e.withCredentials)||(u.withCredentials=!!e.withCredentials),o&&o!=="json"&&(u.responseType=e.responseType),typeof e.onDownloadProgress=="function"&&u.addEventListener("progress",Ne(e.onDownloadProgress,!0)),typeof e.onUploadProgress=="function"&&u.upload&&u.upload.addEventListener("progress",Ne(e.onUploadProgress)),(e.cancelToken||e.signal)&&(c=E=>{u&&(r(!E||E.type?new M(null,e,u):E),u.abort(),u=null)},e.cancelToken&&e.cancelToken.subscribe(c),e.signal&&(e.signal.aborted?c():e.signal.addEventListener("abort",c)));const w=cn(f);if(w&&g.protocols.indexOf(w)===-1){r(new m("Unsupported protocol "+w+":",m.ERR_BAD_REQUEST,e));return}u.send(s||null)})},J={http:Mt,xhr:fn};a.forEach(J,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(n){}Object.defineProperty(e,"adapterName",{value:t})}});const dn={getAdapter:e=>{e=a.isArray(e)?e:[e];const{length:t}=e;let n,r;for(let s=0;s<t&&(n=e[s],!(r=a.isString(n)?J[n.toLowerCase()]:n));s++);if(!r)throw r===!1?new m(`Adapter ${n} is not supported by the environment`,"ERR_NOT_SUPPORT"):new Error(a.hasOwnProp(J,n)?`Adapter '${n}' is not available in the build`:`Unknown adapter '${n}'`);if(!a.isFunction(r))throw new TypeError("adapter is not a function");return r},adapters:J};function se(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new M(null,e)}function Pe(e){return se(e),e.headers=O.from(e.headers),e.data=re.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),dn.getAdapter(e.adapter||he.adapter)(e).then(function(r){return se(e),r.data=re.call(e,e.transformResponse,r),r.headers=O.from(r.headers),r},function(r){return ve(r)||(se(e),r&&r.response&&(r.response.data=re.call(e,e.transformResponse,r.response),r.response.headers=O.from(r.response.headers))),Promise.reject(r)})}const Ce=e=>e instanceof O?e.toJSON():e;function x(e,t){t=t||{};const n={};function r(u,f,p){return a.isPlainObject(u)&&a.isPlainObject(f)?a.merge.call({caseless:p},u,f):a.isPlainObject(f)?a.merge({},f):a.isArray(f)?f.slice():f}function s(u,f,p){if(a.isUndefined(f)){if(!a.isUndefined(u))return r(void 0,u,p)}else return r(u,f,p)}function i(u,f){if(!a.isUndefined(f))return r(void 0,f)}function o(u,f){if(a.isUndefined(f)){if(!a.isUndefined(u))return r(void 0,u)}else return r(void 0,f)}function c(u,f,p){if(p in t)return r(u,f);if(p in e)return r(void 0,u)}const l={url:i,method:i,data:i,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:c,headers:(u,f)=>s(Ce(u),Ce(f),!0)};return a.forEach(Object.keys(e).concat(Object.keys(t)),function(f){const p=l[f]||s,w=p(e[f],t[f],f);a.isUndefined(w)&&p!==c||(n[f]=w)}),n}const We="1.3.3",me={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{me[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const xe={};me.transitional=function(t,n,r){function s(i,o){return"[Axios v"+We+"] Transitional option '"+i+"'"+o+(r?". "+r:"")}return(i,o,c)=>{if(t===!1)throw new m(s(o," has been removed"+(n?" in "+n:"")),m.ERR_DEPRECATED);return n&&!xe[o]&&(xe[o]=!0,console.warn(s(o," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(i,o,c):!0}};function pn(e,t,n){if(typeof e!="object")throw new m("options must be an object",m.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let s=r.length;for(;s-- >0;){const i=r[s],o=t[i];if(o){const c=e[i],l=c===void 0||o(c,i,e);if(l!==!0)throw new m("option "+i+" must be "+l,m.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new m("Unknown option "+i,m.ERR_BAD_OPTION)}}const ae={assertOptions:pn,validators:me},T=ae.validators;class V{constructor(t){this.defaults=t,this.interceptors={request:new Ae,response:new Ae}}request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=x(this.defaults,n);const{transitional:r,paramsSerializer:s,headers:i}=n;r!==void 0&&ae.assertOptions(r,{silentJSONParsing:T.transitional(T.boolean),forcedJSONParsing:T.transitional(T.boolean),clarifyTimeoutError:T.transitional(T.boolean)},!1),s!==void 0&&ae.assertOptions(s,{encode:T.function,serialize:T.function},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let o;o=i&&a.merge(i.common,i[n.method]),o&&a.forEach(["delete","get","head","post","put","patch","common"],d=>{delete i[d]}),n.headers=O.concat(o,i);const c=[];let l=!0;this.interceptors.request.forEach(function(h){typeof h.runWhen=="function"&&h.runWhen(n)===!1||(l=l&&h.synchronous,c.unshift(h.fulfilled,h.rejected))});const u=[];this.interceptors.response.forEach(function(h){u.push(h.fulfilled,h.rejected)});let f,p=0,w;if(!l){const d=[Pe.bind(this),void 0];for(d.unshift.apply(d,c),d.push.apply(d,u),w=d.length,f=Promise.resolve(n);p<w;)f=f.then(d[p++],d[p++]);return f}w=c.length;let E=n;for(p=0;p<w;){const d=c[p++],h=c[p++];try{E=d(E)}catch(R){h.call(this,R);break}}try{f=Pe.call(this,E)}catch(d){return Promise.reject(d)}for(p=0,w=u.length;p<w;)f=f.then(u[p++],u[p++]);return f}getUri(t){t=x(this.defaults,t);const n=Ke(t.baseURL,t.url);return Ve(n,t.params,t.paramsSerializer)}}a.forEach(["delete","get","head","options"],function(t){V.prototype[t]=function(n,r){return this.request(x(r||{},{method:t,url:n,data:(r||{}).data}))}});a.forEach(["post","put","patch"],function(t){function n(r){return function(i,o,c){return this.request(x(c||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:i,data:o}))}}V.prototype[t]=n(),V.prototype[t+"Form"]=n(!0)});const z=V;class Ee{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(i){n=i});const r=this;this.promise.then(s=>{if(!r._listeners)return;let i=r._listeners.length;for(;i-- >0;)r._listeners[i](s);r._listeners=null}),this.promise.then=s=>{let i;const o=new Promise(c=>{r.subscribe(c),i=c}).then(s);return o.cancel=function(){r.unsubscribe(i)},o},t(function(i,o,c){r.reason||(r.reason=new M(i,o,c),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)}static source(){let t;return{token:new Ee(function(s){t=s}),cancel:t}}}const hn=Ee;function mn(e){return function(n){return e.apply(null,n)}}function En(e){return a.isObject(e)&&e.isAxiosError===!0}const ce={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(ce).forEach(([e,t])=>{ce[t]=e});const yn=ce;function Xe(e){const t=new z(e),n=Ue(z.prototype.request,t);return a.extend(n,z.prototype,t,{allOwnKeys:!0}),a.extend(n,t,null,{allOwnKeys:!0}),n.create=function(s){return Xe(x(e,s))},n}const y=Xe(he);y.Axios=z;y.CanceledError=M;y.CancelToken=hn;y.isCancel=ve;y.VERSION=We;y.toFormData=$;y.AxiosError=m;y.Cancel=y.CanceledError;y.all=function(t){return Promise.all(t)};y.spread=mn;y.isAxiosError=En;y.mergeConfig=x;y.AxiosHeaders=O;y.formToJSON=e=>$e(a.isHTMLForm(e)?new FormData(e):e);y.HttpStatusCode=yn;y.default=y;const wn={LOGIN_URL:`${window.location.origin}/ttc/cloud/#/login`,HOME_URL:`${window.location.origin}/ttc/cloud/#/cloud`,INTEGRATED_BASE_URL:"/gateway/integrated-management/api/v1"},ye={ttc:wn},Sn=(e="ttc")=>Y.get(`${ye[e].INTEGRATED_BASE_URL}/account/auth/route/list`),bn=(e="ttc")=>Y.get(`${ye[e].INTEGRATED_BASE_URL}/account/home/menu`),we=(e="ttc")=>{Q({token:""})},W=(e="ttc")=>{var s;const t=`${e}GlobalState`,n=(s=localStorage.getItem(t))!=null?s:"{}";return JSON.parse(n)?JSON.parse(n).token:null},Qe=(r,...s)=>j(exports,[r,...s],function*({userName:e,password:t},n="ttc"){const i=U("loginApiUrl"),{data:o}=yield Y.post(i,{userName:e,password:t});o.tokenValue&&S.ElMessage.success("登录成功"),Q({token:o.tokenValue,userInfo:o})}),gn=(e="ttc")=>{var s;const t=`${e}GlobalState`,n=(s=localStorage.getItem(t))!=null?s:"{}";return JSON.parse(n)?JSON.parse(n).userInfo:null},Rn=()=>j(exports,null,function*(){return W()?yield bn():[]}),X=()=>{if(Ze()){we();const e=location.pathname;if(console.log("跳转至登录页",e,e.includes(C())),e.includes(C()))return;console.log("跳转至登录页",C()),location.replace(C())}else{console.log("开发环境!!!");const e=window.prompt("当前系统处于开发环境,当前登录过期,请输入登录账号","");if(e!==null){const t=window.prompt("请输入登录密码","");(t===null||t=="")&&window.prompt("请输入登录密码",""),Qe({userName:e,password:t})}}},On=()=>{window.location.replace(Ye())},C=()=>U("loginUrl"),Ye=()=>U("homeUrl"),Q=e=>{var r;const t=(r=localStorage.getItem("ttcGlobalState"))!=null?r:"{}",n=_(_({},JSON.parse(t)),e);localStorage.setItem("ttcGlobalState",JSON.stringify(n))},U=e=>{var n,r;return(r=JSON.parse((n=localStorage.getItem("ttcGlobalState"))!=null?n:"{}")[e])!=null?r:""},Ze=()=>U("environment")==="production",An=(e,t=!0,n)=>j(exports,null,function*(){if(!W()&&t)return X();try{const{data:r}=yield Sn(n),s=r.filter(c=>c.routeTag.includes(e)),i=s.filter(c=>c.routeType==="VIEW"),o=s.filter(c=>c.routeType==="BTN");return sessionStorage.setItem("ttcUserBtnList",JSON.stringify(o.map(c=>c.routeTag))),{userMenuList:i,userBtnList:o}}catch(r){}}),Tn=(e,t,n)=>{let r=[];return e.forEach(s=>{const i=`/src/views${s.routeView}/config.ts`,o=`/src/views${s.routeView}/index.vue`;if(t[o]&&n[i]){const c=n[i],l={path:s.routeView,name:s.routeView.split("/")[1],meta:{title:c.title,icon:c.icon},component:t[o]};r.push(l)}}),r},et=e=>{var n;if(!e)return!1;const t=(n=sessionStorage.getItem("ttcUserBtnList"))!=null?n:"[]";return JSON.parse(t).includes(e)},Nn=Object.freeze(Object.defineProperty({__proto__:null,autoLogin:Qe,getHomeUrl:Ye,getLoginUrl:C,getSystemConfig:U,getToken:W,getUserInfo:gn,getUserIsHaveBtnPower:et,getUserPermissions:An,getUserRouteList:Rn,getUserRouter:Tn,isProduction:Ze,jumpToHome:On,jumpToLogin:X,removeToken:we,setSystemConfig:Q},Symbol.toStringTag,{value:"Module"}));let tt;const Pn={lock:!0,text:"加载中...",fullscreen:!0,background:"rgba(0, 0, 0, 0.6)"},Cn=()=>{tt=S.ElLoading.service(Pn)},xn=()=>{tt.close()};let F=0;const Ln=()=>{F===0&&Cn(),F++},Le=()=>{F<=0||(F--,F===0&&xn())};var ue=(e=>(e[e.SUCCESS=200]="SUCCESS",e[e.ERROR=500]="ERROR",e[e.OVERDUE=401]="OVERDUE",e[e.TIMEOUT=3e4]="TIMEOUT",e))(ue||{});const Un={timeout:3e4,withCredentials:!0},_n=(e,t)=>{switch(e){case 400:S.ElMessage.error(t||"请求失败!请您稍后重试");break;case 401:location.href.includes(C())||(S.ElMessage.error(t||"登录失效!请您重新登录"),X());break;case 403:S.ElMessage.error(t||"当前账号无权限访问!");break;case 404:S.ElMessage.error("你所访问的资源不存在!");break;case 405:S.ElMessage.error(t||"请求方式错误!请您稍后重试");break;case 408:S.ElMessage.error(t||"请求超时!请您稍后重试");break;case 500:S.ElMessage.error(t||"服务异常!");break;case 502:S.ElMessage.error("网关错误!");break;case 503:S.ElMessage.error("服务不可用!");break;case 504:S.ElMessage.error("网关超时!");break;default:S.ElMessage.error("请求失败!")}};class Bn{constructor(t){ee(this,"service");ee(this,"customResMap");this.service=y.create(t),this.setupInterceptors(),this.customResMap={}}setupInterceptors(){this.service.interceptors.request.use(t=>{var n;return(n=t.headers)!=null&&n.noLoading||Ln(),t.headers.token=W(),t!=null&&t.customResHandler&&(t!=null&&t.url)&&(this.customResMap[t==null?void 0:t.url]=t.customResHandler),t},t=>Promise.reject(t)),this.service.interceptors.response.use(t=>{const{data:n,config:r}=t;return Le(),r.url&&this.customResMap[r.url]?this.customResMap[r.url](n):(n.code==ue.OVERDUE?this.handleOverdueResponse(n):n.code!==ue.SUCCESS&&this.handleErrorResponse(n),n)},t=>{Le();const{config:n}=t;return n!=null&&n.url&&this.customResMap[n.url]&&this.customResMap[n.url](t.response),t.message.includes("timeout")?S.ElMessage.error("请求超时!请稍后重试"):t.message.includes("Network Error")&&S.ElMessage.error("网络错误!请稍后重试"),t.response&&_n(t.response.status),window.navigator.onLine||S.ElNotification({title:"提示",message:"当前网络似乎开小差了",type:"warning",duration:5e3}),Promise.reject(t)})}handleOverdueResponse(t){return we(),X(),S.ElNotification({title:"登录过期提醒",message:t.resultMsg||"当前登录失效",type:"warning",duration:5e3}),Promise.reject(t)}handleErrorResponse(t){return S.ElMessage.error(t.resultMsg),Promise.reject(t)}get(t,n,r={}){return this.service.get(t,_({params:n},r))}post(t,n,r={}){return this.service.post(t,n,r)}put(t,n,r={}){return this.service.put(t,n,r)}delete(t,n,r={}){return this.service.delete(t,_({params:n},r))}}const Y=new Bn(Un);exports.URL=ye;exports.getSystemConfig=U;exports.getUserIsHaveBtnPower=et;exports.http=Y;exports.index=Nn;exports.setSystemConfig=Q;
|
package/lib/index.cjs7.js.gz
CHANGED
|
Binary file
|