lepu-test-platform-web/node_modules/vue-router/dist/vue-router.esm.browser.min.js

6 lines
26 KiB
JavaScript

/*!
* vue-router v3.4.3
* (c) 2020 Evan You
* @license MIT
*/
function t(t,e){for(const n in e)t[n]=e[n];return t}var e={name:"RouterView",functional:!0,props:{name:{type:String,default:"default"}},render(e,{props:r,children:o,parent:i,data:s}){s.routerView=!0;const a=i.$createElement,c=r.name,u=i.$route,h=i._routerViewCache||(i._routerViewCache={});let l=0,p=!1;for(;i&&i._routerRoot!==i;){const t=i.$vnode?i.$vnode.data:{};t.routerView&&l++,t.keepAlive&&i._directInactive&&i._inactive&&(p=!0),i=i.$parent}if(s.routerViewDepth=l,p){const t=h[c],e=t&&t.component;return e?(t.configProps&&n(e,s,t.route,t.configProps),a(e,s,o)):a()}const f=u.matched[l],d=f&&f.components[c];if(!f||!d)return h[c]=null,a();h[c]={component:d},s.registerRouteInstance=(t,e)=>{const n=f.instances[c];(e&&n!==t||!e&&n===t)&&(f.instances[c]=e)},(s.hook||(s.hook={})).prepatch=(t,e)=>{f.instances[c]=e.componentInstance},s.hook.init=t=>{t.data.keepAlive&&t.componentInstance&&t.componentInstance!==f.instances[c]&&(f.instances[c]=t.componentInstance)};const y=f.props&&f.props[c];return y&&(t(h[c],{route:u,configProps:y}),n(d,s,u,y)),a(d,s,o)}};function n(e,n,r,o){let i=n.props=function(t,e){switch(typeof e){case"undefined":return;case"object":return e;case"function":return e(t);case"boolean":return e?t.params:void 0}}(r,o);if(i){i=n.props=t({},i);const r=n.attrs=n.attrs||{};for(const t in i)e.props&&t in e.props||(r[t]=i[t],delete i[t])}}const r=/[!'()*]/g,o=t=>"%"+t.charCodeAt(0).toString(16),i=/%2C/g,s=t=>encodeURIComponent(t).replace(r,o).replace(i,","),a=decodeURIComponent;const c=t=>null==t||"object"==typeof t?t:String(t);function u(t){const e={};return(t=t.trim().replace(/^(\?|#|&)/,""))?(t.split("&").forEach(t=>{const n=t.replace(/\+/g," ").split("="),r=a(n.shift()),o=n.length>0?a(n.join("=")):null;void 0===e[r]?e[r]=o:Array.isArray(e[r])?e[r].push(o):e[r]=[e[r],o]}),e):e}function h(t){const e=t?Object.keys(t).map(e=>{const n=t[e];if(void 0===n)return"";if(null===n)return s(e);if(Array.isArray(n)){const t=[];return n.forEach(n=>{void 0!==n&&(null===n?t.push(s(e)):t.push(s(e)+"="+s(n)))}),t.join("&")}return s(e)+"="+s(n)}).filter(t=>t.length>0).join("&"):null;return e?`?${e}`:""}const l=/\/?$/;function p(t,e,n,r){const o=r&&r.options.stringifyQuery;let i=e.query||{};try{i=f(i)}catch(t){}const s={name:e.name||t&&t.name,meta:t&&t.meta||{},path:e.path||"/",hash:e.hash||"",query:i,params:e.params||{},fullPath:m(e,o),matched:t?y(t):[]};return n&&(s.redirectedFrom=m(n,o)),Object.freeze(s)}function f(t){if(Array.isArray(t))return t.map(f);if(t&&"object"==typeof t){const e={};for(const n in t)e[n]=f(t[n]);return e}return t}const d=p(null,{path:"/"});function y(t){const e=[];for(;t;)e.unshift(t),t=t.parent;return e}function m({path:t,query:e={},hash:n=""},r){return(t||"/")+(r||h)(e)+n}function g(t,e){return e===d?t===e:!!e&&(t.path&&e.path?t.path.replace(l,"")===e.path.replace(l,"")&&t.hash===e.hash&&w(t.query,e.query):!(!t.name||!e.name)&&(t.name===e.name&&t.hash===e.hash&&w(t.query,e.query)&&w(t.params,e.params)))}function w(t={},e={}){if(!t||!e)return t===e;const n=Object.keys(t),r=Object.keys(e);return n.length===r.length&&n.every(n=>{const r=t[n],o=e[n];return null==r||null==o?r===o:"object"==typeof r&&"object"==typeof o?w(r,o):String(r)===String(o)})}function v(t,e,n){const r=t.charAt(0);if("/"===r)return t;if("?"===r||"#"===r)return e+t;const o=e.split("/");n&&o[o.length-1]||o.pop();const i=t.replace(/^\//,"").split("/");for(let t=0;t<i.length;t++){const e=i[t];".."===e?o.pop():"."!==e&&o.push(e)}return""!==o[0]&&o.unshift(""),o.join("/")}function b(t){return t.replace(/\/\//g,"/")}var x=Array.isArray||function(t){return"[object Array]"==Object.prototype.toString.call(t)},R=U,k=O,E=function(t,e){return j(O(t,e),e)},$=j,A=q,C=new RegExp(["(\\\\.)","([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))"].join("|"),"g");function O(t,e){for(var n,r=[],o=0,i=0,s="",a=e&&e.delimiter||"/";null!=(n=C.exec(t));){var c=n[0],u=n[1],h=n.index;if(s+=t.slice(i,h),i=h+c.length,u)s+=u[1];else{var l=t[i],p=n[2],f=n[3],d=n[4],y=n[5],m=n[6],g=n[7];s&&(r.push(s),s="");var w=null!=p&&null!=l&&l!==p,v="+"===m||"*"===m,b="?"===m||"*"===m,x=n[2]||a,R=d||y;r.push({name:f||o++,prefix:p||"",delimiter:x,optional:b,repeat:v,partial:w,asterisk:!!g,pattern:R?T(R):g?".*":"[^"+L(x)+"]+?"})}}return i<t.length&&(s+=t.substr(i)),s&&r.push(s),r}function S(t){return encodeURI(t).replace(/[\/?#]/g,function(t){return"%"+t.charCodeAt(0).toString(16).toUpperCase()})}function j(t,e){for(var n=new Array(t.length),r=0;r<t.length;r++)"object"==typeof t[r]&&(n[r]=new RegExp("^(?:"+t[r].pattern+")$",_(e)));return function(e,r){for(var o="",i=e||{},s=(r||{}).pretty?S:encodeURIComponent,a=0;a<t.length;a++){var c=t[a];if("string"!=typeof c){var u,h=i[c.name];if(null==h){if(c.optional){c.partial&&(o+=c.prefix);continue}throw new TypeError('Expected "'+c.name+'" to be defined')}if(x(h)){if(!c.repeat)throw new TypeError('Expected "'+c.name+'" to not repeat, but received `'+JSON.stringify(h)+"`");if(0===h.length){if(c.optional)continue;throw new TypeError('Expected "'+c.name+'" to not be empty')}for(var l=0;l<h.length;l++){if(u=s(h[l]),!n[a].test(u))throw new TypeError('Expected all "'+c.name+'" to match "'+c.pattern+'", but received `'+JSON.stringify(u)+"`");o+=(0===l?c.prefix:c.delimiter)+u}}else{if(u=c.asterisk?encodeURI(h).replace(/[?#]/g,function(t){return"%"+t.charCodeAt(0).toString(16).toUpperCase()}):s(h),!n[a].test(u))throw new TypeError('Expected "'+c.name+'" to match "'+c.pattern+'", but received "'+u+'"');o+=c.prefix+u}}else o+=c}return o}}function L(t){return t.replace(/([.+*?=^!:${}()[\]|\/\\])/g,"\\$1")}function T(t){return t.replace(/([=!:$\/()])/g,"\\$1")}function P(t,e){return t.keys=e,t}function _(t){return t&&t.sensitive?"":"i"}function q(t,e,n){x(e)||(n=e||n,e=[]);for(var r=(n=n||{}).strict,o=!1!==n.end,i="",s=0;s<t.length;s++){var a=t[s];if("string"==typeof a)i+=L(a);else{var c=L(a.prefix),u="(?:"+a.pattern+")";e.push(a),a.repeat&&(u+="(?:"+c+u+")*"),i+=u=a.optional?a.partial?c+"("+u+")?":"(?:"+c+"("+u+"))?":c+"("+u+")"}}var h=L(n.delimiter||"/"),l=i.slice(-h.length)===h;return r||(i=(l?i.slice(0,-h.length):i)+"(?:"+h+"(?=$))?"),i+=o?"$":r&&l?"":"(?="+h+"|$)",P(new RegExp("^"+i,_(n)),e)}function U(t,e,n){return x(e)||(n=e||n,e=[]),n=n||{},t instanceof RegExp?function(t,e){var n=t.source.match(/\((?!\?)/g);if(n)for(var r=0;r<n.length;r++)e.push({name:r,prefix:null,delimiter:null,optional:!1,repeat:!1,partial:!1,asterisk:!1,pattern:null});return P(t,e)}(t,e):x(t)?function(t,e,n){for(var r=[],o=0;o<t.length;o++)r.push(U(t[o],e,n).source);return P(new RegExp("(?:"+r.join("|")+")",_(n)),e)}(t,e,n):function(t,e,n){return q(O(t,n),e,n)}(t,e,n)}R.parse=k,R.compile=E,R.tokensToFunction=$,R.tokensToRegExp=A;const I=Object.create(null);function M(t,e,n){e=e||{};try{const n=I[t]||(I[t]=R.compile(t));return"string"==typeof e.pathMatch&&(e[0]=e.pathMatch),n(e,{pretty:!0})}catch(t){return""}finally{delete e[0]}}function V(e,n,r,o){let i="string"==typeof e?{path:e}:e;if(i._normalized)return i;if(i.name){const n=(i=t({},e)).params;return n&&"object"==typeof n&&(i.params=t({},n)),i}if(!i.path&&i.params&&n){(i=t({},i))._normalized=!0;const e=t(t({},n.params),i.params);if(n.name)i.name=n.name,i.params=e;else if(n.matched.length){const t=n.matched[n.matched.length-1].path;i.path=M(t,e,n.path)}return i}const s=function(t){let e="",n="";const r=t.indexOf("#");r>=0&&(e=t.slice(r),t=t.slice(0,r));const o=t.indexOf("?");return o>=0&&(n=t.slice(o+1),t=t.slice(0,o)),{path:t,query:n,hash:e}}(i.path||""),a=n&&n.path||"/",h=s.path?v(s.path,a,r||i.append):a,l=function(t,e={},n){const r=n||u;let o;try{o=r(t||"")}catch(t){o={}}for(const t in e){const n=e[t];o[t]=Array.isArray(n)?n.map(c):c(n)}return o}(s.query,i.query,o&&o.options.parseQuery);let p=i.hash||s.hash;return p&&"#"!==p.charAt(0)&&(p=`#${p}`),{_normalized:!0,path:h,query:l,hash:p}}const B=[String,Object],F=[String,Array],H=()=>{};var N={name:"RouterLink",props:{to:{type:B,required:!0},tag:{type:String,default:"a"},exact:Boolean,append:Boolean,replace:Boolean,activeClass:String,exactActiveClass:String,ariaCurrentValue:{type:String,default:"page"},event:{type:F,default:"click"}},render(e){const n=this.$router,r=this.$route,{location:o,route:i,href:s}=n.resolve(this.to,r,this.append),a={},c=n.options.linkActiveClass,u=n.options.linkExactActiveClass,h=null==c?"router-link-active":c,f=null==u?"router-link-exact-active":u,d=null==this.activeClass?h:this.activeClass,y=null==this.exactActiveClass?f:this.exactActiveClass,m=i.redirectedFrom?p(null,V(i.redirectedFrom),null,n):i;a[y]=g(r,m),a[d]=this.exact?a[y]:function(t,e){return 0===t.path.replace(l,"/").indexOf(e.path.replace(l,"/"))&&(!e.hash||t.hash===e.hash)&&function(t,e){for(const n in e)if(!(n in t))return!1;return!0}(t.query,e.query)}(r,m);const w=a[y]?this.ariaCurrentValue:null,v=t=>{z(t)&&(this.replace?n.replace(o,H):n.push(o,H))},b={click:z};Array.isArray(this.event)?this.event.forEach(t=>{b[t]=v}):b[this.event]=v;const x={class:a},R=!this.$scopedSlots.$hasNormal&&this.$scopedSlots.default&&this.$scopedSlots.default({href:s,route:i,navigate:v,isActive:a[d],isExactActive:a[y]});if(R){if(1===R.length)return R[0];if(R.length>1||!R.length)return 0===R.length?e():e("span",{},R)}if("a"===this.tag)x.on=b,x.attrs={href:s,"aria-current":w};else{const e=function t(e){if(e){let n;for(let r=0;r<e.length;r++){if("a"===(n=e[r]).tag)return n;if(n.children&&(n=t(n.children)))return n}}}(this.$slots.default);if(e){e.isStatic=!1;const n=e.data=t({},e.data);n.on=n.on||{};for(const t in n.on){const e=n.on[t];t in b&&(n.on[t]=Array.isArray(e)?e:[e])}for(const t in b)t in n.on?n.on[t].push(b[t]):n.on[t]=v;const r=e.data.attrs=t({},e.data.attrs);r.href=s,r["aria-current"]=w}else x.on=b}return e(this.tag,x,this.$slots.default)}};function z(t){if(!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey||t.defaultPrevented||void 0!==t.button&&0!==t.button)){if(t.currentTarget&&t.currentTarget.getAttribute){const e=t.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(e))return}return t.preventDefault&&t.preventDefault(),!0}}let D;const K="undefined"!=typeof window;function J(t,e,n,r){const o=e||[],i=n||Object.create(null),s=r||Object.create(null);t.forEach(t=>{!function t(e,n,r,o,i,s){const{path:a,name:c}=o;const u=o.pathToRegexpOptions||{};const h=function(t,e,n){n||(t=t.replace(/\/$/,""));return"/"===t[0]?t:null==e?t:b(`${e.path}/${t}`)}(a,i,u.strict);"boolean"==typeof o.caseSensitive&&(u.sensitive=o.caseSensitive);const l={path:h,regex:Q(h,u),components:o.components||{default:o.component},instances:{},name:c,parent:i,matchAs:s,redirect:o.redirect,beforeEnter:o.beforeEnter,meta:o.meta||{},props:null==o.props?{}:o.components?o.props:{default:o.props}};o.children&&o.children.forEach(o=>{const i=s?b(`${s}/${o.path}`):void 0;t(e,n,r,o,l,i)});n[l.path]||(e.push(l.path),n[l.path]=l);if(void 0!==o.alias){const s=Array.isArray(o.alias)?o.alias:[o.alias];for(let a=0;a<s.length;++a){const c=s[a],u={path:c,children:o.children};t(e,n,r,u,i,l.path||"/")}}c&&(r[c]||(r[c]=l))}(o,i,s,t)});for(let t=0,e=o.length;t<e;t++)"*"===o[t]&&(o.push(o.splice(t,1)[0]),e--,t--);return{pathList:o,pathMap:i,nameMap:s}}function Q(t,e){return R(t,[],e)}function X(t,e){const{pathList:n,pathMap:r,nameMap:o}=J(t);function i(t,i,s){const c=V(t,i,!1,e),{name:u}=c;if(u){const t=o[u];if(!t)return a(null,c);const e=t.regex.keys.filter(t=>!t.optional).map(t=>t.name);if("object"!=typeof c.params&&(c.params={}),i&&"object"==typeof i.params)for(const t in i.params)!(t in c.params)&&e.indexOf(t)>-1&&(c.params[t]=i.params[t]);return c.path=M(t.path,c.params),a(t,c,s)}if(c.path){c.params={};for(let t=0;t<n.length;t++){const e=n[t],o=r[e];if(Y(o.regex,c.path,c.params))return a(o,c,s)}}return a(null,c)}function s(t,n){const r=t.redirect;let s="function"==typeof r?r(p(t,n,null,e)):r;if("string"==typeof s&&(s={path:s}),!s||"object"!=typeof s)return a(null,n);const c=s,{name:u,path:h}=c;let{query:l,hash:f,params:d}=n;if(l=c.hasOwnProperty("query")?c.query:l,f=c.hasOwnProperty("hash")?c.hash:f,d=c.hasOwnProperty("params")?c.params:d,u){o[u];return i({_normalized:!0,name:u,query:l,hash:f,params:d},void 0,n)}if(h){return i({_normalized:!0,path:M(function(t,e){return v(t,e.parent?e.parent.path:"/",!0)}(h,t),d),query:l,hash:f},void 0,n)}return a(null,n)}function a(t,n,r){return t&&t.redirect?s(t,r||n):t&&t.matchAs?function(t,e,n){const r=i({_normalized:!0,path:M(n,e.params)});if(r){const t=r.matched,n=t[t.length-1];return e.params=r.params,a(n,e)}return a(null,e)}(0,n,t.matchAs):p(t,n,r,e)}return{match:i,addRoutes:function(t){J(t,n,r,o)}}}function Y(t,e,n){const r=e.match(t);if(!r)return!1;if(!n)return!0;for(let e=1,o=r.length;e<o;++e){const o=t.keys[e-1],i="string"==typeof r[e]?decodeURIComponent(r[e]):r[e];o&&(n[o.name||"pathMatch"]=i)}return!0}const W=K&&window.performance&&window.performance.now?window.performance:Date;function G(){return W.now().toFixed(3)}let Z=G();function tt(){return Z}function et(t){return Z=t}const nt=Object.create(null);function rt(){"scrollRestoration"in window.history&&(window.history.scrollRestoration="manual");const e=window.location.protocol+"//"+window.location.host,n=window.location.href.replace(e,""),r=t({},window.history.state);return r.key=tt(),window.history.replaceState(r,"",n),window.addEventListener("popstate",st),()=>{window.removeEventListener("popstate",st)}}function ot(t,e,n,r){if(!t.app)return;const o=t.options.scrollBehavior;o&&t.app.$nextTick(()=>{const i=function(){const t=tt();if(t)return nt[t]}(),s=o.call(t,e,n,r?i:null);s&&("function"==typeof s.then?s.then(t=>{lt(t,i)}).catch(t=>{}):lt(s,i))})}function it(){const t=tt();t&&(nt[t]={x:window.pageXOffset,y:window.pageYOffset})}function st(t){it(),t.state&&t.state.key&&et(t.state.key)}function at(t){return ut(t.x)||ut(t.y)}function ct(t){return{x:ut(t.x)?t.x:window.pageXOffset,y:ut(t.y)?t.y:window.pageYOffset}}function ut(t){return"number"==typeof t}const ht=/^#\d/;function lt(t,e){const n="object"==typeof t;if(n&&"string"==typeof t.selector){const n=ht.test(t.selector)?document.getElementById(t.selector.slice(1)):document.querySelector(t.selector);if(n){let o=t.offset&&"object"==typeof t.offset?t.offset:{};e=function(t,e){const n=document.documentElement.getBoundingClientRect(),r=t.getBoundingClientRect();return{x:r.left-n.left-e.x,y:r.top-n.top-e.y}}(n,o={x:ut((r=o).x)?r.x:0,y:ut(r.y)?r.y:0})}else at(t)&&(e=ct(t))}else n&&at(t)&&(e=ct(t));var r;e&&window.scrollTo(e.x,e.y)}const pt=K&&function(){const t=window.navigator.userAgent;return(-1===t.indexOf("Android 2.")&&-1===t.indexOf("Android 4.0")||-1===t.indexOf("Mobile Safari")||-1!==t.indexOf("Chrome")||-1!==t.indexOf("Windows Phone"))&&(window.history&&"function"==typeof window.history.pushState)}();function ft(e,n){it();const r=window.history;try{if(n){const n=t({},r.state);n.key=tt(),r.replaceState(n,"",e)}else r.pushState({key:et(G())},"",e)}catch(t){window.location[n?"replace":"assign"](e)}}function dt(t){ft(t,!0)}function yt(t,e,n){const r=o=>{o>=t.length?n():t[o]?e(t[o],()=>{r(o+1)}):r(o+1)};r(0)}const mt={redirected:2,aborted:4,cancelled:8,duplicated:16};function gt(t,e){return vt(t,e,mt.redirected,`Redirected when going from "${t.fullPath}" to "${function(t){if("string"==typeof t)return t;if("path"in t)return t.path;const e={};return bt.forEach(n=>{n in t&&(e[n]=t[n])}),JSON.stringify(e,null,2)}(e)}" via a navigation guard.`)}function wt(t,e){return vt(t,e,mt.cancelled,`Navigation cancelled from "${t.fullPath}" to "${e.fullPath}" with a new navigation.`)}function vt(t,e,n,r){const o=new Error(r);return o._isRouter=!0,o.from=t,o.to=e,o.type=n,o}const bt=["params","query","hash"];function xt(t){return Object.prototype.toString.call(t).indexOf("Error")>-1}function Rt(t,e){return xt(t)&&t._isRouter&&(null==e||t.type===e)}function kt(t){return(e,n,r)=>{let o=!1,i=0,s=null;Et(t,(t,e,n,a)=>{if("function"==typeof t&&void 0===t.cid){o=!0,i++;const e=Ct(e=>{(function(t){return t.__esModule||At&&"Module"===t[Symbol.toStringTag]})(e)&&(e=e.default),t.resolved="function"==typeof e?e:D.extend(e),n.components[a]=e,--i<=0&&r()}),c=Ct(t=>{const e=`Failed to resolve async component ${a}: ${t}`;s||(s=xt(t)?t:new Error(e),r(s))});let u;try{u=t(e,c)}catch(t){c(t)}if(u)if("function"==typeof u.then)u.then(e,c);else{const t=u.component;t&&"function"==typeof t.then&&t.then(e,c)}}}),o||r()}}function Et(t,e){return $t(t.map(t=>Object.keys(t.components).map(n=>e(t.components[n],t.instances[n],t,n))))}function $t(t){return Array.prototype.concat.apply([],t)}const At="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;function Ct(t){let e=!1;return function(...n){if(!e)return e=!0,t.apply(this,n)}}class Ot{constructor(t,e){this.router=t,this.base=function(t){if(!t)if(K){const e=document.querySelector("base");t=(t=e&&e.getAttribute("href")||"/").replace(/^https?:\/\/[^\/]+/,"")}else t="/";"/"!==t.charAt(0)&&(t="/"+t);return t.replace(/\/$/,"")}(e),this.current=d,this.pending=null,this.ready=!1,this.readyCbs=[],this.readyErrorCbs=[],this.errorCbs=[],this.listeners=[]}listen(t){this.cb=t}onReady(t,e){this.ready?t():(this.readyCbs.push(t),e&&this.readyErrorCbs.push(e))}onError(t){this.errorCbs.push(t)}transitionTo(t,e,n){let r;try{r=this.router.match(t,this.current)}catch(t){throw this.errorCbs.forEach(e=>{e(t)}),t}this.confirmTransition(r,()=>{const t=this.current;this.updateRoute(r),e&&e(r),this.ensureURL(),this.router.afterHooks.forEach(e=>{e&&e(r,t)}),this.ready||(this.ready=!0,this.readyCbs.forEach(t=>{t(r)}))},t=>{n&&n(t),t&&!this.ready&&(this.ready=!0,Rt(t,mt.redirected)?this.readyCbs.forEach(t=>{t(r)}):this.readyErrorCbs.forEach(e=>{e(t)}))})}confirmTransition(t,e,n){const r=this.current,o=t=>{!Rt(t)&&xt(t)&&(this.errorCbs.length?this.errorCbs.forEach(e=>{e(t)}):console.error(t)),n&&n(t)},i=t.matched.length-1,s=r.matched.length-1;if(g(t,r)&&i===s&&t.matched[i]===r.matched[s])return this.ensureURL(),o(function(t,e){const n=vt(t,e,mt.duplicated,`Avoided redundant navigation to current location: "${t.fullPath}".`);return n.name="NavigationDuplicated",n}(r,t));const{updated:a,deactivated:c,activated:u}=function(t,e){let n;const r=Math.max(t.length,e.length);for(n=0;n<r&&t[n]===e[n];n++);return{updated:e.slice(0,n),activated:e.slice(n),deactivated:t.slice(n)}}(this.current.matched,t.matched),h=[].concat(function(t){return St(t,"beforeRouteLeave",jt,!0)}(c),this.router.beforeHooks,function(t){return St(t,"beforeRouteUpdate",jt)}(a),u.map(t=>t.beforeEnter),kt(u));this.pending=t;const l=(e,n)=>{if(this.pending!==t)return o(wt(r,t));try{e(t,r,e=>{!1===e?(this.ensureURL(!0),o(function(t,e){return vt(t,e,mt.aborted,`Navigation aborted from "${t.fullPath}" to "${e.fullPath}" via a navigation guard.`)}(r,t))):xt(e)?(this.ensureURL(!0),o(e)):"string"==typeof e||"object"==typeof e&&("string"==typeof e.path||"string"==typeof e.name)?(o(gt(r,t)),"object"==typeof e&&e.replace?this.replace(e):this.push(e)):n(e)})}catch(t){o(t)}};yt(h,l,()=>{const n=[];yt(function(t,e,n){return St(t,"beforeRouteEnter",(t,r,o,i)=>(function(t,e,n,r,o){return function(i,s,a){return t(i,s,t=>{"function"==typeof t&&r.push(()=>{!function t(e,n,r,o){n[r]&&!n[r]._isBeingDestroyed?e(n[r]):o()&&setTimeout(()=>{t(e,n,r,o)},16)}(t,e.instances,n,o)}),a(t)})}})(t,o,i,e,n))}(u,n,()=>this.current===t).concat(this.router.resolveHooks),l,()=>{if(this.pending!==t)return o(wt(r,t));this.pending=null,e(t),this.router.app&&this.router.app.$nextTick(()=>{n.forEach(t=>{t()})})})})}updateRoute(t){this.current=t,this.cb&&this.cb(t)}setupListeners(){}teardownListeners(){this.listeners.forEach(t=>{t()}),this.listeners=[]}}function St(t,e,n,r){const o=Et(t,(t,r,o,i)=>{const s=function(t,e){"function"!=typeof t&&(t=D.extend(t));return t.options[e]}(t,e);if(s)return Array.isArray(s)?s.map(t=>n(t,r,o,i)):n(s,r,o,i)});return $t(r?o.reverse():o)}function jt(t,e){if(e)return function(){return t.apply(e,arguments)}}class Lt extends Ot{constructor(t,e){super(t,e),this._startLocation=Tt(this.base)}setupListeners(){if(this.listeners.length>0)return;const t=this.router,e=t.options.scrollBehavior,n=pt&&e;n&&this.listeners.push(rt());const r=()=>{const e=this.current,r=Tt(this.base);this.current===d&&r===this._startLocation||this.transitionTo(r,r=>{n&&ot(t,r,e,!0)})};window.addEventListener("popstate",r),this.listeners.push(()=>{window.removeEventListener("popstate",r)})}go(t){window.history.go(t)}push(t,e,n){const{current:r}=this;this.transitionTo(t,t=>{ft(b(this.base+t.fullPath)),ot(this.router,t,r,!1),e&&e(t)},n)}replace(t,e,n){const{current:r}=this;this.transitionTo(t,t=>{dt(b(this.base+t.fullPath)),ot(this.router,t,r,!1),e&&e(t)},n)}ensureURL(t){if(Tt(this.base)!==this.current.fullPath){const e=b(this.base+this.current.fullPath);t?ft(e):dt(e)}}getCurrentLocation(){return Tt(this.base)}}function Tt(t){let e=decodeURI(window.location.pathname);return t&&0===e.toLowerCase().indexOf(t.toLowerCase())&&(e=e.slice(t.length)),(e||"/")+window.location.search+window.location.hash}class Pt extends Ot{constructor(t,e,n){super(t,e),n&&function(t){const e=Tt(t);if(!/^\/#/.test(e))return window.location.replace(b(t+"/#"+e)),!0}(this.base)||_t()}setupListeners(){if(this.listeners.length>0)return;const t=this.router.options.scrollBehavior,e=pt&&t;e&&this.listeners.push(rt());const n=()=>{const t=this.current;_t()&&this.transitionTo(qt(),n=>{e&&ot(this.router,n,t,!0),pt||Mt(n.fullPath)})},r=pt?"popstate":"hashchange";window.addEventListener(r,n),this.listeners.push(()=>{window.removeEventListener(r,n)})}push(t,e,n){const{current:r}=this;this.transitionTo(t,t=>{It(t.fullPath),ot(this.router,t,r,!1),e&&e(t)},n)}replace(t,e,n){const{current:r}=this;this.transitionTo(t,t=>{Mt(t.fullPath),ot(this.router,t,r,!1),e&&e(t)},n)}go(t){window.history.go(t)}ensureURL(t){const e=this.current.fullPath;qt()!==e&&(t?It(e):Mt(e))}getCurrentLocation(){return qt()}}function _t(){const t=qt();return"/"===t.charAt(0)||(Mt("/"+t),!1)}function qt(){let t=window.location.href;const e=t.indexOf("#");if(e<0)return"";const n=(t=t.slice(e+1)).indexOf("?");if(n<0){const e=t.indexOf("#");t=e>-1?decodeURI(t.slice(0,e))+t.slice(e):decodeURI(t)}else t=decodeURI(t.slice(0,n))+t.slice(n);return t}function Ut(t){const e=window.location.href,n=e.indexOf("#");return`${n>=0?e.slice(0,n):e}#${t}`}function It(t){pt?ft(Ut(t)):window.location.hash=t}function Mt(t){pt?dt(Ut(t)):window.location.replace(Ut(t))}class Vt extends Ot{constructor(t,e){super(t,e),this.stack=[],this.index=-1}push(t,e,n){this.transitionTo(t,t=>{this.stack=this.stack.slice(0,this.index+1).concat(t),this.index++,e&&e(t)},n)}replace(t,e,n){this.transitionTo(t,t=>{this.stack=this.stack.slice(0,this.index).concat(t),e&&e(t)},n)}go(t){const e=this.index+t;if(e<0||e>=this.stack.length)return;const n=this.stack[e];this.confirmTransition(n,()=>{this.index=e,this.updateRoute(n)},t=>{Rt(t,mt.duplicated)&&(this.index=e)})}getCurrentLocation(){const t=this.stack[this.stack.length-1];return t?t.fullPath:"/"}ensureURL(){}}class Bt{constructor(t={}){this.app=null,this.apps=[],this.options=t,this.beforeHooks=[],this.resolveHooks=[],this.afterHooks=[],this.matcher=X(t.routes||[],this);let e=t.mode||"hash";switch(this.fallback="history"===e&&!pt&&!1!==t.fallback,this.fallback&&(e="hash"),K||(e="abstract"),this.mode=e,e){case"history":this.history=new Lt(this,t.base);break;case"hash":this.history=new Pt(this,t.base,this.fallback);break;case"abstract":this.history=new Vt(this,t.base)}}match(t,e,n){return this.matcher.match(t,e,n)}get currentRoute(){return this.history&&this.history.current}init(t){if(this.apps.push(t),t.$once("hook:destroyed",()=>{const e=this.apps.indexOf(t);e>-1&&this.apps.splice(e,1),this.app===t&&(this.app=this.apps[0]||null),this.app||this.history.teardownListeners()}),this.app)return;this.app=t;const e=this.history;if(e instanceof Lt||e instanceof Pt){const t=t=>{const n=e.current,r=this.options.scrollBehavior;pt&&r&&"fullPath"in t&&ot(this,t,n,!1)},n=n=>{e.setupListeners(),t(n)};e.transitionTo(e.getCurrentLocation(),n,n)}e.listen(t=>{this.apps.forEach(e=>{e._route=t})})}beforeEach(t){return Ft(this.beforeHooks,t)}beforeResolve(t){return Ft(this.resolveHooks,t)}afterEach(t){return Ft(this.afterHooks,t)}onReady(t,e){this.history.onReady(t,e)}onError(t){this.history.onError(t)}push(t,e,n){if(!e&&!n&&"undefined"!=typeof Promise)return new Promise((e,n)=>{this.history.push(t,e,n)});this.history.push(t,e,n)}replace(t,e,n){if(!e&&!n&&"undefined"!=typeof Promise)return new Promise((e,n)=>{this.history.replace(t,e,n)});this.history.replace(t,e,n)}go(t){this.history.go(t)}back(){this.go(-1)}forward(){this.go(1)}getMatchedComponents(t){const e=t?t.matched?t:this.resolve(t).route:this.currentRoute;return e?[].concat.apply([],e.matched.map(t=>Object.keys(t.components).map(e=>t.components[e]))):[]}resolve(t,e,n){const r=V(t,e=e||this.history.current,n,this),o=this.match(r,e),i=o.redirectedFrom||o.fullPath;return{location:r,route:o,href:function(t,e,n){var r="hash"===n?"#"+e:e;return t?b(t+"/"+r):r}(this.history.base,i,this.mode),normalizedTo:r,resolved:o}}addRoutes(t){this.matcher.addRoutes(t),this.history.current!==d&&this.history.transitionTo(this.history.getCurrentLocation())}}function Ft(t,e){return t.push(e),()=>{const n=t.indexOf(e);n>-1&&t.splice(n,1)}}Bt.install=function t(n){if(t.installed&&D===n)return;t.installed=!0,D=n;const r=t=>void 0!==t,o=(t,e)=>{let n=t.$options._parentVnode;r(n)&&r(n=n.data)&&r(n=n.registerRouteInstance)&&n(t,e)};n.mixin({beforeCreate(){r(this.$options.router)?(this._routerRoot=this,this._router=this.$options.router,this._router.init(this),n.util.defineReactive(this,"_route",this._router.history.current)):this._routerRoot=this.$parent&&this.$parent._routerRoot||this,o(this,this)},destroyed(){o(this)}}),Object.defineProperty(n.prototype,"$router",{get(){return this._routerRoot._router}}),Object.defineProperty(n.prototype,"$route",{get(){return this._routerRoot._route}}),n.component("RouterView",e),n.component("RouterLink",N);const i=n.config.optionMergeStrategies;i.beforeRouteEnter=i.beforeRouteLeave=i.beforeRouteUpdate=i.created},Bt.version="3.4.3",Bt.isNavigationFailure=Rt,Bt.NavigationFailureType=mt,K&&window.Vue&&window.Vue.use(Bt);export default Bt;