mirror of
https://github.com/un-pany/v3-admin-vite.git
synced 2025-04-23 04:19:20 +08:00
2 lines
43 KiB
JavaScript
2 lines
43 KiB
JavaScript
var e=Object.defineProperty,t=(t,n,r)=>(((t,n,r)=>{n in t?e(t,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[n]=r})(t,"symbol"!=typeof n?n+"":n,r),r);import{a as n,k as r,m as o,a9 as s,af as i,aY as a,r as c,f as u,b as l,t as f,u as d,g as p,o as h,al as m,v as g,Q as b}from"./runtime-core.esm-bundler-9099a418.js";import{c as y,a as E}from"./vue-router-d7411128.js";import{bs as w,N as O}from"./index-1c00c85b.js";const _="v3-admin-vite";class v{}t(v,"TOKEN",`${_}-token-key`),t(v,"SIDEBAR_STATUS",`${_}-sidebar-status-key`),t(v,"ACTIVE_THEME_NAME",`${_}-active-theme-name-key`);let R;const S=e=>R=e,j=Symbol();function T(e){return e&&"object"==typeof e&&"[object Object]"===Object.prototype.toString.call(e)&&"function"!=typeof e.toJSON}var A,P;(P=A||(A={})).direct="direct",P.patchObject="patch object",P.patchFunction="patch function";const x=()=>{};function C(e,t,n,r=x){e.push(t);const o=()=>{const n=e.indexOf(t);n>-1&&(e.splice(n,1),r())};return!n&&p()&&h(o),o}function N(e,...t){e.slice().forEach((e=>{e(...t)}))}function k(e,t){e instanceof Map&&t instanceof Map&&t.forEach(((t,n)=>e.set(n,t))),e instanceof Set&&t instanceof Set&&t.forEach(e.add,e);for(const n in t){if(!t.hasOwnProperty(n))continue;const r=t[n],o=e[n];T(o)&&T(r)&&e.hasOwnProperty(n)&&!u(r)&&!l(r)?e[n]=k(o,r):e[n]=r}return e}const D=Symbol();const{assign:L}=Object;function U(e,t,s={},i,d,p){let h;const g=L({actions:{}},s),b={deep:!0};let y,E,w,O=o([]),_=o([]);const v=i.state.value[e];let R;function j(t){let n;y=E=!1,"function"==typeof t?(t(i.state.value[e]),n={type:A.patchFunction,storeId:e,events:w}):(k(i.state.value[e],t),n={type:A.patchObject,payload:t,storeId:e,events:w});const r=R=Symbol();m().then((()=>{R===r&&(y=!0)})),E=!0,N(O,n,i.state.value[e])}p||v||(i.state.value[e]={}),r({});const P=x;function U(t,n){return function(){S(i);const r=Array.from(arguments),o=[],s=[];function a(e){o.push(e)}function c(e){s.push(e)}let u;N(_,{args:r,name:t,store:B,after:a,onError:c});try{u=n.apply(this&&this.$id===e?this:B,r)}catch(l){throw N(s,l),l}return u instanceof Promise?u.then((e=>(N(o,e),e))).catch((e=>(N(s,e),Promise.reject(e)))):(N(o,u),u)}}const F={_p:i,$id:e,$onAction:C.bind(null,_),$patch:j,$reset:P,$subscribe(t,n={}){const r=C(O,t,n.detached,(()=>o())),o=h.run((()=>a((()=>i.state.value[e]),(r=>{("sync"===n.flush?E:y)&&t({storeId:e,type:A.direct,events:w},r)}),L({},b,n))));return r},$dispose:function(){h.stop(),O=[],_=[],i._s.delete(e)}},B=c(F);i._s.set(e,B);const I=i._e.run((()=>(h=n(),h.run((()=>t())))));for(const n in I){const t=I[n];if(u(t)&&(!u(V=t)||!V.effect)||l(t))p||(!v||T(M=t)&&M.hasOwnProperty(D)||(u(t)?t.value=v[n]:k(t,v[n])),i.state.value[e][n]=t);else if("function"==typeof t){const e=U(n,t);I[n]=e,g.actions[n]=t}}var M,V;return L(B,I),L(f(B),I),Object.defineProperty(B,"$state",{get:()=>i.state.value[e],set:e=>{j((t=>{L(t,e)}))}}),i._p.forEach((e=>{L(B,h.run((()=>e({store:B,app:i._a,pinia:i,options:g}))))})),v&&p&&s.hydrate&&s.hydrate(B.$state,v),y=!0,E=!0,B}function F(e,t,n){let r,a;const c="function"==typeof t;function u(e,n){const u=s();(e=e||u&&i(j,null))&&S(e),(e=R)._s.has(r)||(c?U(r,t,a,e):function(e,t,n,r){const{state:s,actions:i,getters:a}=t,c=n.state.value[e];let u;u=U(e,(function(){c||(n.state.value[e]=s?s():{});const t=g(n.state.value[e]);return L(t,i,Object.keys(a||{}).reduce(((t,r)=>(t[r]=o(b((()=>{S(n);const t=n._s.get(e);return a[r].call(t,t)}))),t)),{}))}),t,n,0,!0),u.$reset=function(){const e=s?s():{};this.$patch((t=>{L(t,e)}))}}(r,a,e));return e._s.get(r)}return"string"==typeof e?(r=e,a=c?n:t):(a=e,r=e.id),u.$id=r,u}function B(e){{e=f(e);const t={};for(const n in e){const r=e[n];(u(r)||l(r))&&(t[n]=d(e,n))}return t}}const I=function(){const e=n(!0),t=e.run((()=>r({})));let s=[],i=[];const a=o({install(e){S(a),a._a=e,e.provide(j,a),e.config.globalProperties.$pinia=a,i.forEach((e=>s.push(e))),i=[]},use(e){return this._a?s.push(e):i.push(e),this},_p:s,_a:null,_e:e,_s:new Map,state:t});return a}(),M={},V=function(e,t,n){if(!t||0===t.length)return e();const r=document.getElementsByTagName("link");return Promise.all(t.map((e=>{if((e=function(e){return"/v3-admin-vite/"+e}(e))in M)return;M[e]=!0;const t=e.endsWith(".css"),o=t?'[rel="stylesheet"]':"";if(!!n)for(let n=r.length-1;n>=0;n--){const o=r[n];if(o.href===e&&(!t||"stylesheet"===o.rel))return}else if(document.querySelector(`link[href="${e}"]${o}`))return;const s=document.createElement("link");return s.rel=t?"stylesheet":"modulepreload",t||(s.as="script",s.crossOrigin=""),s.href=e,document.head.appendChild(s),t?new Promise(((t,n)=>{s.addEventListener("load",t),s.addEventListener("error",(()=>n(new Error(`Unable to preload CSS for ${e}`))))})):void 0}))).then((()=>e()))},q=()=>V((()=>import("./index-839585ba.js")),["static/index-839585ba.js","static/useTheme-9f07de96.js","static/runtime-core.esm-bundler-9099a418.js","static/index-1c00c85b.js","static/vue-router-d7411128.js","static/_plugin-vue_export-helper-1b428a4d.js","static/index.vue_vue_type_script_setup_true_lang-3fee5e30.js","static/dayjs.min-fa1307e3.js","static/error-c58402b8.js","static/index-48d9e173.css"]),z=[{path:"/redirect",component:q,meta:{hidden:!0},children:[{path:"/redirect/:path(.*)",component:()=>V((()=>import("./index-d397d67f.js")),["static/index-d397d67f.js","static/vue-router-d7411128.js","static/runtime-core.esm-bundler-9099a418.js"])}]},{path:"/403",component:()=>V((()=>import("./403-fa612333.js")),["static/403-fa612333.js","static/ErrorPageLayout-7e5a4480.js","static/_plugin-vue_export-helper-1b428a4d.js","static/runtime-core.esm-bundler-9099a418.js","static/ErrorPageLayout-155a3ef2.css"]),meta:{hidden:!0}},{path:"/404",component:()=>V((()=>import("./404-1bf181a2.js")),["static/404-1bf181a2.js","static/ErrorPageLayout-7e5a4480.js","static/_plugin-vue_export-helper-1b428a4d.js","static/runtime-core.esm-bundler-9099a418.js","static/ErrorPageLayout-155a3ef2.css"]),meta:{hidden:!0},alias:"/:pathMatch(.*)*"},{path:"/login",component:()=>V((()=>import("./index-05b98b0c.js")),["static/index-05b98b0c.js","static/index-1c00c85b.js","static/runtime-core.esm-bundler-9099a418.js","static/vue-router-d7411128.js","static/index.vue_vue_type_script_setup_true_lang-3fee5e30.js","static/useTheme-9f07de96.js","static/_plugin-vue_export-helper-1b428a4d.js","static/index-a41b6b05.css"]),meta:{hidden:!0}},{path:"/",component:q,redirect:"/dashboard",children:[{path:"dashboard",component:()=>V((()=>import("./index-a1da44ef.js")),["static/index-a1da44ef.js","static/_plugin-vue_export-helper-1b428a4d.js","static/runtime-core.esm-bundler-9099a418.js","static/index-09d7b862.js","static/index-1c00c85b.js","static/vue-router-d7411128.js","static/index-fde86043.css"]),name:"Dashboard",meta:{title:"首页",svgIcon:"dashboard",affix:!0}}]},{path:"/unocss",component:q,redirect:"/unocss/index",children:[{path:"index",component:()=>V((()=>import("./index-90f7b2cc.js")),["static/index-90f7b2cc.js","static/_plugin-vue_export-helper-1b428a4d.js","static/runtime-core.esm-bundler-9099a418.js"]),name:"UnoCSS",meta:{title:"unocss",svgIcon:"unocss"}}]},{path:"/link",component:q,children:[{path:"https://juejin.cn/post/7089377403717287972",component:()=>{},name:"Link",meta:{title:"外链",svgIcon:"link"}}]},{path:"/table",component:q,redirect:"/table/element-plus",name:"Table",meta:{title:"表格",elIcon:"Grid"},children:[{path:"element-plus",component:()=>V((()=>import("./index-66cd894a.js")),["static/index-66cd894a.js","static/table-a229b996.js","static/index-1c00c85b.js","static/runtime-core.esm-bundler-9099a418.js","static/index-098af104.js","static/error-c58402b8.js","static/_plugin-vue_export-helper-1b428a4d.js","static/vue-router-d7411128.js","static/index-3a8f857e.css"]),name:"ElementPlus",meta:{title:"Element Plus"}},{path:"vxe-table",component:()=>V((()=>import("./index-8879eb74.js")),["static/index-8879eb74.js","static/table-a229b996.js","static/runtime-core.esm-bundler-9099a418.js","static/index-098af104.js","static/index-1c00c85b.js","static/error-c58402b8.js","static/vue-router-d7411128.js"]),name:"VxeTable",meta:{title:"Vxe Table"}}]},{path:"/menu",component:q,redirect:"/menu/menu1",name:"Menu",meta:{title:"多级菜单",svgIcon:"menu"},children:[{path:"menu1",component:()=>V((()=>import("./index-f86f6c14.js")),["static/index-f86f6c14.js","static/_plugin-vue_export-helper-1b428a4d.js","static/runtime-core.esm-bundler-9099a418.js"]),redirect:"/menu/menu1/menu1-1",name:"Menu1",meta:{title:"menu1"},children:[{path:"menu1-1",component:()=>V((()=>import("./index-4a114086.js")),["static/index-4a114086.js","static/_plugin-vue_export-helper-1b428a4d.js","static/runtime-core.esm-bundler-9099a418.js"]),name:"Menu1-1",meta:{title:"menu1-1"}},{path:"menu1-2",component:()=>V((()=>import("./index-ec4cabfa.js")),["static/index-ec4cabfa.js","static/_plugin-vue_export-helper-1b428a4d.js","static/runtime-core.esm-bundler-9099a418.js"]),redirect:"/menu/menu1/menu1-2/menu1-2-1",name:"Menu1-2",meta:{title:"menu1-2"},children:[{path:"menu1-2-1",component:()=>V((()=>import("./index-bd2a9f5e.js")),["static/index-bd2a9f5e.js","static/_plugin-vue_export-helper-1b428a4d.js","static/runtime-core.esm-bundler-9099a418.js"]),name:"Menu1-2-1",meta:{title:"menu1-2-1"}},{path:"menu1-2-2",component:()=>V((()=>import("./index-50eb39d4.js")),["static/index-50eb39d4.js","static/_plugin-vue_export-helper-1b428a4d.js","static/runtime-core.esm-bundler-9099a418.js"]),name:"Menu1-2-2",meta:{title:"menu1-2-2"}}]},{path:"menu1-3",component:()=>V((()=>import("./index-70bed940.js")),["static/index-70bed940.js","static/_plugin-vue_export-helper-1b428a4d.js","static/runtime-core.esm-bundler-9099a418.js"]),name:"Menu1-3",meta:{title:"menu1-3"}}]},{path:"menu2",component:()=>V((()=>import("./index-2672f2a5.js")),["static/index-2672f2a5.js","static/_plugin-vue_export-helper-1b428a4d.js","static/runtime-core.esm-bundler-9099a418.js"]),name:"Menu2",meta:{title:"menu2"}}]},{path:"/hooks",component:q,redirect:"/hooks/use-fetch-select",name:"Hooks",meta:{title:"hooks",elIcon:"Menu",alwaysShow:!0},children:[{path:"use-fetch-select",component:()=>V((()=>import("./use-fetch-select-7b14f780.js")),["static/use-fetch-select-7b14f780.js","static/mock-5ab86b79.js","static/runtime-core.esm-bundler-9099a418.js"]),name:"UseFetchSelect",meta:{title:"useFetchSelect"}},{path:"use-fullscreen-loading",component:()=>V((()=>import("./use-fullscreen-loading-29628eb7.js")),["static/use-fullscreen-loading-29628eb7.js","static/mock-5ab86b79.js","static/index-5f3aab4a.js","static/runtime-core.esm-bundler-9099a418.js","static/index-1c00c85b.js"]),name:"UseFullscreenLoading",meta:{title:"useFullscreenLoading"}}]}],$=[{path:"/permission",component:q,redirect:"/permission/page",name:"Permission",meta:{title:"权限管理",svgIcon:"lock",roles:["admin","editor"],alwaysShow:!0},children:[{path:"page",component:()=>V((()=>import("./page-4791bd69.js")),["static/page-4791bd69.js","static/vue-router-d7411128.js","static/runtime-core.esm-bundler-9099a418.js","static/SwitchRoles-876dde4c.js","static/_plugin-vue_export-helper-1b428a4d.js","static/SwitchRoles-0c18308f.css","static/index-1c00c85b.js","static/page-3081310b.css"]),name:"PagePermission",meta:{title:"页面权限",roles:["admin"]}},{path:"directive",component:()=>V((()=>import("./directive-efb13054.js")),["static/directive-efb13054.js","static/SwitchRoles-876dde4c.js","static/runtime-core.esm-bundler-9099a418.js","static/_plugin-vue_export-helper-1b428a4d.js","static/SwitchRoles-0c18308f.css","static/vue-router-d7411128.js","static/index-1c00c85b.js","static/directive-2d230132.css"]),name:"DirectivePermission",meta:{title:"指令权限"}}]},{path:"/:pathMatch(.*)*",redirect:"/404",name:"ErrorPage",meta:{hidden:!0}}],H=y({history:E("/v3-admin-vite/"),routes:z});function J(){try{H.getRoutes().forEach((e=>{var t;const{name:n,meta:r}=e;n&&(null==(t=r.roles)?void 0:t.length)&&H.hasRoute(n)&&H.removeRoute(n)}))}catch(e){window.location.reload()}}const K=(e,t)=>{const n=[];return e.forEach((e=>{const r={...e};((e,t)=>!t.meta||!t.meta.roles||e.some((e=>{var n;return void 0!==(null==(n=t.meta)?void 0:n.roles)&&t.meta.roles.includes(e)})))(t,r)&&(r.children&&(r.children=K(r.children,t)),n.push(r))})),n},W=F("permission",(()=>{const e=r([]),t=r([]);return{routes:e,dynamicRoutes:t,setRoutes:n=>{let r;r=n.includes("admin")?$:K($,n),e.value=z.concat(r),t.value=r}}}));function G(){return W(I)}function X(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)e[r]=n[r]}return e}var Q=function e(t,n){function r(e,r,o){if("undefined"!=typeof document){"number"==typeof(o=X({},n,o)).expires&&(o.expires=new Date(Date.now()+864e5*o.expires)),o.expires&&(o.expires=o.expires.toUTCString()),e=encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var s="";for(var i in o)o[i]&&(s+="; "+i,!0!==o[i]&&(s+="="+o[i].split(";")[0]));return document.cookie=e+"="+t.write(r,e)+s}}return Object.create({set:r,get:function(e){if("undefined"!=typeof document&&(!arguments.length||e)){for(var n=document.cookie?document.cookie.split("; "):[],r={},o=0;o<n.length;o++){var s=n[o].split("="),i=s.slice(1).join("=");try{var a=decodeURIComponent(s[0]);if(r[a]=t.read(i,a),e===a)break}catch(c){}}return e?r[e]:r}},remove:function(e,t){r(e,"",X({},t,{expires:-1}))},withAttributes:function(t){return e(this.converter,X({},this.attributes,t))},withConverter:function(t){return e(X({},this.converter,t),this.attributes)}},{attributes:{value:Object.freeze(n)},converter:{value:Object.freeze(t)}})}({read:function(e){return'"'===e[0]&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}},{path:"/"});const Y=()=>Q.get(v.TOKEN),Z=e=>{Q.set(v.TOKEN,e)},ee=()=>{Q.remove(v.TOKEN)};function te(e,t){return function(){return e.apply(t,arguments)}}const{toString:ne}=Object.prototype,{getPrototypeOf:re}=Object,oe=(se=Object.create(null),e=>{const t=ne.call(e);return se[t]||(se[t]=t.slice(8,-1).toLowerCase())});var se;const ie=e=>(e=e.toLowerCase(),t=>oe(t)===e),ae=e=>t=>typeof t===e,{isArray:ce}=Array,ue=ae("undefined");const le=ie("ArrayBuffer");const fe=ae("string"),de=ae("function"),pe=ae("number"),he=e=>null!==e&&"object"==typeof e,me=e=>{if("object"!==oe(e))return!1;const t=re(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)},ge=ie("Date"),be=ie("File"),ye=ie("Blob"),Ee=ie("FileList"),we=ie("URLSearchParams");function Oe(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,o;if("object"!=typeof e&&(e=[e]),ce(e))for(r=0,o=e.length;r<o;r++)t.call(null,e[r],r,e);else{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 _e(e,t){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 ve="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,Re=e=>!ue(e)&&e!==ve;const Se=(je="undefined"!=typeof Uint8Array&&re(Uint8Array),e=>je&&e instanceof je);var je;const Te=ie("HTMLFormElement"),Ae=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),Pe=ie("RegExp"),xe=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};Oe(n,((n,o)=>{!1!==t(n,o,e)&&(r[o]=n)})),Object.defineProperties(e,r)},Ce={isArray:ce,isArrayBuffer:le,isBuffer:function(e){return null!==e&&!ue(e)&&null!==e.constructor&&!ue(e.constructor)&&de(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:e=>{const t="[object FormData]";return e&&("function"==typeof FormData&&e instanceof FormData||ne.call(e)===t||de(e.toString)&&e.toString()===t)},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&le(e.buffer),t},isString:fe,isNumber:pe,isBoolean:e=>!0===e||!1===e,isObject:he,isPlainObject:me,isUndefined:ue,isDate:ge,isFile:be,isBlob:ye,isRegExp:Pe,isFunction:de,isStream:e=>he(e)&&de(e.pipe),isURLSearchParams:we,isTypedArray:Se,isFileList:Ee,forEach:Oe,merge:function e(){const{caseless:t}=Re(this)&&this||{},n={},r=(r,o)=>{const s=t&&_e(n,o)||o;me(n[s])&&me(r)?n[s]=e(n[s],r):me(r)?n[s]=e({},r):ce(r)?n[s]=r.slice():n[s]=r};for(let o=0,s=arguments.length;o<s;o++)arguments[o]&&Oe(arguments[o],r);return n},extend:(e,t,n,{allOwnKeys:r}={})=>(Oe(t,((t,r)=>{n&&de(t)?e[r]=te(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&&re(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:oe,kindOfTest:ie,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(ce(e))return e;let t=e.length;if(!pe(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[Symbol.iterator]).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:Te,hasOwnProperty:Ae,hasOwnProp:Ae,reduceDescriptors:xe,freezeMethods:e=>{xe(e,((t,n)=>{if(de(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];de(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 ce(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)=>(e=+e,Number.isFinite(e)?e:t),findKey:_e,global:ve,isContextDefined:Re,toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(he(e)){if(t.indexOf(e)>=0)return;if(!("toJSON"in e)){t[r]=e;const o=ce(e)?[]:{};return Oe(e,((e,t)=>{const s=n(e,r+1);!ue(s)&&(o[t]=s)})),t[r]=void 0,o}}return e};return n(e,0)}};function Ne(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)}Ce.inherits(Ne,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:Ce.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const ke=Ne.prototype,De={};["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=>{De[e]={value:e}})),Object.defineProperties(Ne,De),Object.defineProperty(ke,"isAxiosError",{value:!0}),Ne.from=(e,t,n,r,o,s)=>{const i=Object.create(ke);return Ce.toFlatObject(e,i,(function(e){return e!==Error.prototype}),(e=>"isAxiosError"!==e)),Ne.call(i,e.message,t,n,r,o),i.cause=e,i.name=e.name,s&&Object.assign(i,s),i};const Le="object"==typeof self?self.FormData:window.FormData;function Ue(e){return Ce.isPlainObject(e)||Ce.isArray(e)}function Fe(e){return Ce.endsWith(e,"[]")?e.slice(0,-2):e}function Be(e,t,n){return e?e.concat(t).map((function(e,t){return e=Fe(e),!n&&t?"["+e+"]":e})).join(n?".":""):t}const Ie=Ce.toFlatObject(Ce,{},null,(function(e){return/^is[A-Z]/.test(e)}));function Me(e,t,n){if(!Ce.isObject(e))throw new TypeError("target must be an object");t=t||new(Le||FormData);const r=(n=Ce.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!Ce.isUndefined(t[e])}))).metaTokens,o=n.visitor||l,s=n.dots,i=n.indexes,a=(n.Blob||"undefined"!=typeof Blob&&Blob)&&((c=t)&&Ce.isFunction(c.append)&&"FormData"===c[Symbol.toStringTag]&&c[Symbol.iterator]);var c;if(!Ce.isFunction(o))throw new TypeError("visitor must be a function");function u(e){if(null===e)return"";if(Ce.isDate(e))return e.toISOString();if(!a&&Ce.isBlob(e))throw new Ne("Blob is not supported. Use a Buffer instead.");return Ce.isArrayBuffer(e)||Ce.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(Ce.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(Ce.isArray(e)&&function(e){return Ce.isArray(e)&&!e.some(Ue)}(e)||Ce.isFileList(e)||Ce.endsWith(n,"[]")&&(a=Ce.toArray(e)))return n=Fe(n),a.forEach((function(e,r){!Ce.isUndefined(e)&&null!==e&&t.append(!0===i?Be([n],r,s):null===i?n:n+"[]",u(e))})),!1;return!!Ue(e)||(t.append(Be(o,n,s),u(e)),!1)}const f=[],d=Object.assign(Ie,{defaultVisitor:l,convertValue:u,isVisitable:Ue});if(!Ce.isObject(e))throw new TypeError("data must be an object");return function e(n,r){if(!Ce.isUndefined(n)){if(-1!==f.indexOf(n))throw Error("Circular reference detected in "+r.join("."));f.push(n),Ce.forEach(n,(function(n,s){!0===(!(Ce.isUndefined(n)||null===n)&&o.call(t,n,Ce.isString(s)?s.trim():s,r,d))&&e(n,r?r.concat(s):[s])})),f.pop()}}(e),t}function Ve(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function qe(e,t){this._pairs=[],e&&Me(e,this,t)}const ze=qe.prototype;function $e(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function He(e,t,n){if(!t)return e;const r=n&&n.encode||$e,o=n&&n.serialize;let s;if(s=o?o(t,n):Ce.isURLSearchParams(t)?t.toString():new qe(t,n).toString(r),s){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+s}return e}ze.append=function(e,t){this._pairs.push([e,t])},ze.toString=function(e){const t=e?function(t){return e.call(this,t,Ve)}:Ve;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};const Je=class{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){Ce.forEach(this.handlers,(function(t){null!==t&&e(t)}))}},Ke={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},We="undefined"!=typeof URLSearchParams?URLSearchParams:qe,Ge=FormData,Xe=(()=>{let e;return("undefined"==typeof navigator||"ReactNative"!==(e=navigator.product)&&"NativeScript"!==e&&"NS"!==e)&&("undefined"!=typeof window&&"undefined"!=typeof document)})(),Qe="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,Ye={isBrowser:!0,classes:{URLSearchParams:We,FormData:Ge,Blob:Blob},isStandardBrowserEnv:Xe,isStandardBrowserWebWorkerEnv:Qe,protocols:["http","https","file","blob","url","data"]};function Ze(e){function t(e,n,r,o){let s=e[o++];const i=Number.isFinite(+s),a=o>=e.length;if(s=!s&&Ce.isArray(r)?r.length:s,a)return Ce.hasOwnProp(r,s)?r[s]=[r[s],n]:r[s]=n,!i;r[s]&&Ce.isObject(r[s])||(r[s]=[]);return t(e,n,r[s],o)&&Ce.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(Ce.isFormData(e)&&Ce.isFunction(e.entries)){const n={};return Ce.forEachEntry(e,((e,r)=>{t(function(e){return Ce.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),r,n,0)})),n}return null}const et={"Content-Type":void 0};const tt={transitional:Ke,adapter:["xhr","http"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,o=Ce.isObject(e);o&&Ce.isHTMLForm(e)&&(e=new FormData(e));if(Ce.isFormData(e))return r&&r?JSON.stringify(Ze(e)):e;if(Ce.isArrayBuffer(e)||Ce.isBuffer(e)||Ce.isStream(e)||Ce.isFile(e)||Ce.isBlob(e))return e;if(Ce.isArrayBufferView(e))return e.buffer;if(Ce.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 Me(e,new Ye.classes.URLSearchParams,Object.assign({visitor:function(e,t,n,r){return Ye.isNode&&Ce.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((s=Ce.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return Me(s?{"files[]":e}:e,t&&new t,this.formSerializer)}}return o||r?(t.setContentType("application/json",!1),function(e,t,n){if(Ce.isString(e))try{return(t||JSON.parse)(e),Ce.trim(e)}catch(r){if("SyntaxError"!==r.name)throw r}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||tt.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if(e&&Ce.isString(e)&&(n&&!this.responseType||r)){const n=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e)}catch(o){if(n){if("SyntaxError"===o.name)throw Ne.from(o,Ne.ERR_BAD_RESPONSE,this,null,this.response);throw o}}}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, */*"}}};Ce.forEach(["delete","get","head"],(function(e){tt.headers[e]={}})),Ce.forEach(["post","put","patch"],(function(e){tt.headers[e]=Ce.merge(et)}));const nt=tt,rt=Ce.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"]),ot=Symbol("internals");function st(e){return e&&String(e).trim().toLowerCase()}function it(e){return!1===e||null==e?e:Ce.isArray(e)?e.map(it):String(e)}function at(e,t,n,r){return Ce.isFunction(r)?r.call(this,t,n):Ce.isString(t)?Ce.isString(r)?-1!==t.indexOf(r):Ce.isRegExp(r)?r.test(t):void 0:void 0}class ct{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function o(e,t,n){const o=st(t);if(!o)throw new Error("header name must be a non-empty string");const s=Ce.findKey(r,o);(!s||void 0===r[s]||!0===n||void 0===n&&!1!==r[s])&&(r[s||t]=it(e))}const s=(e,t)=>Ce.forEach(e,((e,n)=>o(e,n,t)));return Ce.isPlainObject(e)||e instanceof this.constructor?s(e,t):Ce.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z]+$/.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]&&rt[n]||("set-cookie"===n?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)})),t})(e),t):null!=e&&o(t,e,n),this}get(e,t){if(e=st(e)){const n=Ce.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(Ce.isFunction(t))return t.call(this,e,n);if(Ce.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=st(e)){const n=Ce.findKey(this,e);return!(!n||t&&!at(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function o(e){if(e=st(e)){const o=Ce.findKey(n,e);!o||t&&!at(0,n[o],o,t)||(delete n[o],r=!0)}}return Ce.isArray(e)?e.forEach(o):o(e),r}clear(){return Object.keys(this).forEach(this.delete.bind(this))}normalize(e){const t=this,n={};return Ce.forEach(this,((r,o)=>{const s=Ce.findKey(n,o);if(s)return t[s]=it(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]=it(r),n[i]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return Ce.forEach(this,((n,r)=>{null!=n&&!1!==n&&(t[r]=e&&Ce.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")}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[ot]=this[ot]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=st(e);t[r]||(!function(e,t){const n=Ce.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 Ce.isArray(e)?e.forEach(r):r(e),this}}ct.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent"]),Ce.freezeMethods(ct.prototype),Ce.freezeMethods(ct);const ut=ct;function lt(e,t){const n=this||nt,r=t||n,o=ut.from(r.headers);let s=r.data;return Ce.forEach(e,(function(e){s=e.call(n,s,o.normalize(),t?t.status:void 0)})),o.normalize(),s}function ft(e){return!(!e||!e.__CANCEL__)}function dt(e,t,n){Ne.call(this,null==e?"canceled":e,Ne.ERR_CANCELED,t,n),this.name="CanceledError"}Ce.inherits(dt,Ne,{__CANCEL__:!0});const pt=Ye.isStandardBrowserEnv?{write:function(e,t,n,r,o,s){const i=[];i.push(e+"="+encodeURIComponent(t)),Ce.isNumber(n)&&i.push("expires="+new Date(n).toGMTString()),Ce.isString(r)&&i.push("path="+r),Ce.isString(o)&&i.push("domain="+o),!0===s&&i.push("secure"),document.cookie=i.join("; ")},read:function(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}};function ht(e,t){return e&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)?function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const mt=Ye.isStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),t=document.createElement("a");let n;function r(n){let r=n;return e&&(t.setAttribute("href",r),r=t.href),t.setAttribute("href",r),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:"/"===t.pathname.charAt(0)?t.pathname:"/"+t.pathname}}return n=r(window.location.href),function(e){const t=Ce.isString(e)?r(e):e;return t.protocol===n.protocol&&t.host===n.host}}():function(){return!0};function gt(e,t){let n=0;const r=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(),u=r[i];o||(o=c),n[s]=a,r[s]=c;let l=i,f=0;for(;l!==s;)f+=n[l++],l%=e;if(s=(s+1)%e,s===i&&(i=(i+1)%e),c-o<t)return;const d=u&&c-u;return d?Math.round(1e3*f/d):void 0}}(50,250);return o=>{const s=o.loaded,i=o.lengthComputable?o.total:void 0,a=s-n,c=r(a);n=s;const u={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:o};u[t?"download":"upload"]=!0,e(u)}}const bt={http:null,xhr:"undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,n){let r=e.data;const o=ut.from(e.headers).normalize(),s=e.responseType;let i;function a(){e.cancelToken&&e.cancelToken.unsubscribe(i),e.signal&&e.signal.removeEventListener("abort",i)}Ce.isFormData(r)&&(Ye.isStandardBrowserEnv||Ye.isStandardBrowserWebWorkerEnv)&&o.setContentType(!1);let c=new XMLHttpRequest;if(e.auth){const t=e.auth.username||"",n=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";o.set("Authorization","Basic "+btoa(t+":"+n))}const u=ht(e.baseURL,e.url);function l(){if(!c)return;const r=ut.from("getAllResponseHeaders"in c&&c.getAllResponseHeaders());!function(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new Ne("Request failed with status code "+n.status,[Ne.ERR_BAD_REQUEST,Ne.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}((function(e){t(e),a()}),(function(e){n(e),a()}),{data:s&&"text"!==s&&"json"!==s?c.response:c.responseText,status:c.status,statusText:c.statusText,headers:r,config:e,request:c}),c=null}if(c.open(e.method.toUpperCase(),He(u,e.params,e.paramsSerializer),!0),c.timeout=e.timeout,"onloadend"in c?c.onloadend=l:c.onreadystatechange=function(){c&&4===c.readyState&&(0!==c.status||c.responseURL&&0===c.responseURL.indexOf("file:"))&&setTimeout(l)},c.onabort=function(){c&&(n(new Ne("Request aborted",Ne.ECONNABORTED,e,c)),c=null)},c.onerror=function(){n(new Ne("Network Error",Ne.ERR_NETWORK,e,c)),c=null},c.ontimeout=function(){let t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const r=e.transitional||Ke;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),n(new Ne(t,r.clarifyTimeoutError?Ne.ETIMEDOUT:Ne.ECONNABORTED,e,c)),c=null},Ye.isStandardBrowserEnv){const t=(e.withCredentials||mt(u))&&e.xsrfCookieName&&pt.read(e.xsrfCookieName);t&&o.set(e.xsrfHeaderName,t)}void 0===r&&o.setContentType(null),"setRequestHeader"in c&&Ce.forEach(o.toJSON(),(function(e,t){c.setRequestHeader(t,e)})),Ce.isUndefined(e.withCredentials)||(c.withCredentials=!!e.withCredentials),s&&"json"!==s&&(c.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&c.addEventListener("progress",gt(e.onDownloadProgress,!0)),"function"==typeof e.onUploadProgress&&c.upload&&c.upload.addEventListener("progress",gt(e.onUploadProgress)),(e.cancelToken||e.signal)&&(i=t=>{c&&(n(!t||t.type?new dt(null,e,c):t),c.abort(),c=null)},e.cancelToken&&e.cancelToken.subscribe(i),e.signal&&(e.signal.aborted?i():e.signal.addEventListener("abort",i)));const f=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(u);f&&-1===Ye.protocols.indexOf(f)?n(new Ne("Unsupported protocol "+f+":",Ne.ERR_BAD_REQUEST,e)):c.send(r||null)}))}};Ce.forEach(bt,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(n){}Object.defineProperty(e,"adapterName",{value:t})}}));const yt=e=>{e=Ce.isArray(e)?e:[e];const{length:t}=e;let n,r;for(let o=0;o<t&&(n=e[o],!(r=Ce.isString(n)?bt[n.toLowerCase()]:n));o++);if(!r){if(!1===r)throw new Ne(`Adapter ${n} is not supported by the environment`,"ERR_NOT_SUPPORT");throw new Error(Ce.hasOwnProp(bt,n)?`Adapter '${n}' is not available in the build`:`Unknown adapter '${n}'`)}if(!Ce.isFunction(r))throw new TypeError("adapter is not a function");return r};function Et(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new dt(null,e)}function wt(e){Et(e),e.headers=ut.from(e.headers),e.data=lt.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return yt(e.adapter||nt.adapter)(e).then((function(t){return Et(e),t.data=lt.call(e,e.transformResponse,t),t.headers=ut.from(t.headers),t}),(function(t){return ft(t)||(Et(e),t&&t.response&&(t.response.data=lt.call(e,e.transformResponse,t.response),t.response.headers=ut.from(t.response.headers))),Promise.reject(t)}))}const Ot=e=>e instanceof ut?e.toJSON():e;function _t(e,t){t=t||{};const n={};function r(e,t,n){return Ce.isPlainObject(e)&&Ce.isPlainObject(t)?Ce.merge.call({caseless:n},e,t):Ce.isPlainObject(t)?Ce.merge({},t):Ce.isArray(t)?t.slice():t}function o(e,t,n){return Ce.isUndefined(t)?Ce.isUndefined(e)?void 0:r(void 0,e,n):r(e,t,n)}function s(e,t){if(!Ce.isUndefined(t))return r(void 0,t)}function i(e,t){return Ce.isUndefined(t)?Ce.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,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)=>o(Ot(e),Ot(t),!0)};return Ce.forEach(Object.keys(e).concat(Object.keys(t)),(function(r){const s=c[r]||o,i=s(e[r],t[r],r);Ce.isUndefined(i)&&s!==a||(n[r]=i)})),n}const vt="1.2.2",Rt={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{Rt[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));const St={};Rt.transitional=function(e,t,n){function r(e,t){return"[Axios v1.2.2] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,o,s)=>{if(!1===e)throw new Ne(r(o," has been removed"+(t?" in "+t:"")),Ne.ERR_DEPRECATED);return t&&!St[o]&&(St[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)}};const jt={assertOptions:function(e,t,n){if("object"!=typeof e)throw new Ne("options must be an object",Ne.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 Ne("option "+s+" must be "+n,Ne.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new Ne("Unknown option "+s,Ne.ERR_BAD_OPTION)}},validators:Rt},Tt=jt.validators;class At{constructor(e){this.defaults=e,this.interceptors={request:new Je,response:new Je}}request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=_t(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:o}=t;let s;void 0!==n&&jt.assertOptions(n,{silentJSONParsing:Tt.transitional(Tt.boolean),forcedJSONParsing:Tt.transitional(Tt.boolean),clarifyTimeoutError:Tt.transitional(Tt.boolean)},!1),void 0!==r&&jt.assertOptions(r,{encode:Tt.function,serialize:Tt.function},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase(),s=o&&Ce.merge(o.common,o[t.method]),s&&Ce.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete o[e]})),t.headers=ut.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 u;this.interceptors.response.forEach((function(e){c.push(e.fulfilled,e.rejected)}));let l,f=0;if(!a){const e=[wt.bind(this),void 0];for(e.unshift.apply(e,i),e.push.apply(e,c),l=e.length,u=Promise.resolve(t);f<l;)u=u.then(e[f++],e[f++]);return u}l=i.length;let d=t;for(f=0;f<l;){const e=i[f++],t=i[f++];try{d=e(d)}catch(p){t.call(this,p);break}}try{u=wt.call(this,d)}catch(p){return Promise.reject(p)}for(f=0,l=c.length;f<l;)u=u.then(c[f++],c[f++]);return u}getUri(e){return He(ht((e=_t(this.defaults,e)).baseURL,e.url),e.params,e.paramsSerializer)}}Ce.forEach(["delete","get","head","options"],(function(e){At.prototype[e]=function(t,n){return this.request(_t(n||{},{method:e,url:t,data:(n||{}).data}))}})),Ce.forEach(["post","put","patch"],(function(e){function t(t){return function(n,r,o){return this.request(_t(o||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}At.prototype[e]=t(),At.prototype[e+"Form"]=t(!0)}));const Pt=At;class xt{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 dt(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)}static source(){let e;return{token:new xt((function(t){e=t})),cancel:e}}}const Ct=xt;const Nt={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(Nt).forEach((([e,t])=>{Nt[t]=e}));const kt=Nt;const Dt=function e(t){const n=new Pt(t),r=te(Pt.prototype.request,n);return Ce.extend(r,Pt.prototype,n,{allOwnKeys:!0}),Ce.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(_t(t,n))},r}(nt);Dt.Axios=Pt,Dt.CanceledError=dt,Dt.CancelToken=Ct,Dt.isCancel=ft,Dt.VERSION=vt,Dt.toFormData=Me,Dt.AxiosError=Ne,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 Ce.isObject(e)&&!0===e.isAxiosError},Dt.mergeConfig=_t,Dt.AxiosHeaders=ut,Dt.formToJSON=e=>Ze(Ce.isHTMLForm(e)?new FormData(e):e),Dt.HttpStatusCode=kt,Dt.default=Dt;const Lt=Dt;const Ut=function(){const e=Lt.create();return e.interceptors.request.use((e=>e),(e=>Promise.reject(e))),e.interceptors.response.use((e=>{const t=e.data,n=t.code;return void 0===n?(w.error("非本系统的接口"),Promise.reject(new Error("非本系统的接口"))):0===n?t:(w.error(t.message||"Error"),Promise.reject(new Error("Error")))}),(e=>{switch(O(e,"response.status")){case 400:e.message="请求错误";break;case 401:Vt().logout(),location.reload();break;case 403:e.message="拒绝访问";break;case 404:e.message="请求地址出错";break;case 408:e.message="请求超时";break;case 500:e.message="服务器内部错误";break;case 501:e.message="服务未实现";break;case 502:e.message="网关错误";break;case 503:e.message="服务不可用";break;case 504:e.message="网关超时";break;case 505:e.message="HTTP 版本不受支持"}return w.error(e.message),Promise.reject(e)})),e}(),Ft=(Bt=Ut,function(e){const t={headers:{Authorization:"Bearer "+Y(),"Content-Type":O(e,"headers.Content-Type","application/json")},timeout:5e3,baseURL:"https://mock.mengxuegu.com/mock/63218b5fb4c53348ed2bc212/api/v1",data:{}};return Bt(Object.assign(t,e))});var Bt;function It(){return Ft({url:"login/code",method:"get"})}const Mt=F("user",(()=>{const e=r(Y()||""),t=r([]),n=r(""),o=()=>new Promise(((e,r)=>{Ft({url:"users/info",method:"get"}).then((r=>{t.value=r.data.roles,n.value=r.data.username,e(r)})).catch((e=>{r(e)}))}));return{token:e,roles:t,username:n,setRoles:e=>{t.value=e},login:t=>new Promise(((n,r)=>{var o;(o={username:t.username,password:t.password,code:t.code},Ft({url:"users/login",method:"post",data:o})).then((t=>{Z(t.data.token),e.value=t.data.token,n(!0)})).catch((e=>{r(e)}))})),getInfo:o,changeRoles:async n=>{const r="token-"+n;e.value=r,Z(r),await o();const s=W();s.setRoutes(t.value),J(),s.dynamicRoutes.forEach((e=>{H.addRoute(e)}))},logout:()=>{ee(),e.value="",t.value=[],J()},resetToken:()=>{ee(),e.value="",t.value=[]}}}));function Vt(){return Mt(I)}export{v as C,G as a,Mt as b,W as c,F as d,B as e,It as f,Y as g,Ft as h,H as r,I as s,Vt as u};
|