Socket
Socket
Sign inDemoInstall

vue-router

Package Overview
Dependencies
Maintainers
2
Versions
185
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-router - npm Package Compare versions

Comparing version 4.0.1 to 4.0.2

11

CHANGELOG.md

@@ -0,1 +1,12 @@

## [4.0.2](https://github.com/vuejs/vue-router-next/compare/v4.0.1...v4.0.2) (2020-12-27)
### Bug Fixes
- **matcher:** clear customRe after consuming buffer ([#680](https://github.com/vuejs/vue-router-next/issues/680)) ([4c0b825](https://github.com/vuejs/vue-router-next/commit/4c0b82507e1f949d55daffd06756615cd704e090)), closes [#679](https://github.com/vuejs/vue-router-next/issues/679)
- **router:** allow replace to have query and hash ([6a8ccb6](https://github.com/vuejs/vue-router-next/commit/6a8ccb6e3b80aef00dda7e73be2afb433d871a32)), closes [#668](https://github.com/vuejs/vue-router-next/issues/668)
- **router:** do not restore history when ... ([db267be](https://github.com/vuejs/vue-router-next/commit/db267be72bace7c99a0c65669ab04ce770e1532c)), closes [#662](https://github.com/vuejs/vue-router-next/issues/662)
- **router-view:** disable inheritAttrs ([1e58574](https://github.com/vuejs/vue-router-next/commit/1e58574e6175f591f7fb24bcfc6e11045e7b0148)), closes [#674](https://github.com/vuejs/vue-router-next/issues/674)
- **types:** add missing exported types ([034c71c](https://github.com/vuejs/vue-router-next/commit/034c71c72ca46d242daf53ae54ab67e6f7800f91))
- spread operator compatible ([a2f3e91](https://github.com/vuejs/vue-router-next/commit/a2f3e91cb3e3ae61118d803ce938d6f4eea76116))
## [4.0.1](https://github.com/vuejs/vue-router-next/compare/v4.0.0...v4.0.1) (2020-12-07)

@@ -2,0 +13,0 @@

69

dist/vue-router.d.ts

@@ -74,3 +74,3 @@ import { AllowedComponentProps } from 'vue';

*/
export declare type ErrorHandler = (error: any) => any;
declare type _ErrorHandler = (error: any) => any;

@@ -90,3 +90,6 @@ /**

declare interface HistoryState {
/**
* Allowed HTML history.state
*/
export declare interface HistoryState {
[x: number]: HistoryStateValue;

@@ -99,2 +102,5 @@ [x: string]: HistoryStateValue;

/**
* Allowed variables in HTML5 history state
*/
declare type HistoryStateValue = string | number | boolean | null | undefined | HistoryState | HistoryStateArray;

@@ -138,3 +144,6 @@

declare interface LocationAsPath {
/**
* @internal
*/
export declare interface LocationAsPath {
path: string;

@@ -147,3 +156,6 @@ }

declare interface LocationAsRelativeRaw {
/**
* @internal
*/
export declare interface LocationAsRelativeRaw {
name?: RouteRecordName;

@@ -270,3 +282,3 @@ params?: RouteParamsRaw;

*/
declare interface NavigationGuardWithThis<T> {
export declare interface NavigationGuardWithThis<T> {
(this: T, to: RouteLocationNormalized, from: RouteLocationNormalized, next: NavigationGuardNext): NavigationGuardReturn | Promise<NavigationGuardReturn>;

@@ -392,5 +404,11 @@ }

/**
* Allowed Component definitions in route records provided by the user
*/
declare type RawRouteComponent = RouteComponent | Lazy<RouteComponent>;
declare type RouteComponent = Component;
/**
* Allowed Component in {@link RouteLocationMatched}
*/
export declare type RouteComponent = Component;

@@ -517,7 +535,16 @@ /**

declare type RouteParamValue = string;
/**
* @internal
*/
export declare type RouteParamValue = string;
/**
* @internal
*/
declare type RouteParamValueRaw = RouteParamValue | number;
declare interface RouteQueryAndHash {
/**
* @internal
*/
export declare interface RouteQueryAndHash {
query?: LocationQueryRaw;

@@ -661,3 +688,3 @@ hash?: string;

*/
onError(handler: ErrorHandler): () => void;
onError(handler: _ErrorHandler): () => void;
/**

@@ -757,3 +784,6 @@ * Returns a Promise that resolves when the router has completed the initial

declare type RouteRecordName = string | symbol;
/**
* Possible values for a user-defined route record's name
*/
export declare type RouteRecordName = string | symbol;

@@ -848,3 +878,6 @@ /**

declare type RouteRecordRedirectOption = RouteLocationRaw | ((to: RouteLocation) => RouteLocationRaw);
/**
* @internal
*/
export declare type RouteRecordRedirectOption = RouteLocationRaw | ((to: RouteLocation) => RouteLocationRaw);

@@ -988,3 +1021,8 @@ /**

declare interface RouterMatcher {
/**
* Internal RouterMatcher
*
* @internal
*/
export declare interface RouterMatcher {
addRoute: (record: RouteRecordRaw, parent?: RouteRecordMatcher) => () => void;

@@ -1189,3 +1227,3 @@ removeRoute: {

declare type UseLinkOptions = VueUseOptions<RouterLinkOptions>;
export declare type UseLinkOptions = VueUseOptions<RouterLinkOptions>;

@@ -1212,2 +1250,7 @@ /**

/**
* Type to transform a static object into one that allows passing Refs as
* values.
* @internal
*/
declare type VueUseOptions<T> = {

@@ -1214,0 +1257,0 @@ [k in keyof T]: Ref<T[k]> | T[k] | ComputedRef<T[k]>;

4

dist/vue-router.global.prod.js
/*!
* vue-router v4.0.1
* vue-router v4.0.2
* (c) 2020 Eduardo San Martin Morote
* @license MIT
*/
var VueRouter=function(e,t){"use strict";const n="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag,r=e=>n?Symbol(e):"_vr_"+e,o=r("rvlm"),a=r("rvd"),i=r("r"),c=r("rl"),s=r("rvl"),l="undefined"!=typeof window;const u=Object.assign;function f(e,t){const n={};for(const r in t){const o=t[r];n[r]=Array.isArray(o)?o.map(e):e(o)}return n}let p=()=>{};const d=/\/$/;function h(e,t,n="/"){let r,o={},a="",i="";const c=t.indexOf("?"),s=t.indexOf("#",c>-1?c:0);return c>-1&&(r=t.slice(0,c),a=t.slice(c+1,s>-1?s:t.length),o=e(a)),s>-1&&(r=r||t.slice(0,s),i=t.slice(s,t.length)),r=function(e,t){if(e.startsWith("/"))return e;if(!e)return t;const n=t.split("/"),r=e.split("/");let o,a,i=n.length-1;for(o=0;o<r.length;o++)if(a=r[o],1!==i&&"."!==a){if(".."!==a)break;i--}return n.slice(0,i).join("/")+"/"+r.slice(o-(o===r.length?1:0)).join("/")}(null!=r?r:t,n),{fullPath:r+(a&&"?")+a+i,path:r,query:o,hash:i}}function m(e,t){return!t||e.toLowerCase().indexOf(t.toLowerCase())?e:e.slice(t.length)||"/"}function v(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function g(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(!y(e[n],t[n]))return!1;return!0}function y(e,t){return Array.isArray(e)?b(e,t):Array.isArray(t)?b(t,e):e===t}function b(e,t){return Array.isArray(t)?e.length===t.length&&e.every(((e,n)=>e===t[n])):1===e.length&&e[0]===t}var E,O;!function(e){e.pop="pop",e.push="push"}(E||(E={})),function(e){e.back="back",e.forward="forward",e.unknown=""}(O||(O={}));function w(e){if(!e)if(l){const t=document.querySelector("base");e=(e=t&&t.getAttribute("href")||"/").replace(/^\w+:\/\/[^\/]+/,"")}else e="/";return"/"!==e[0]&&"#"!==e[0]&&(e="/"+e),e.replace(d,"")}const _=/^[^#]+#/;function P(e,t){return e.replace(_,"#")+t}const R=()=>({left:window.pageXOffset,top:window.pageYOffset});function A(e){let t;if("el"in e){let n=e.el;const r="string"==typeof n&&n.startsWith("#"),o="string"==typeof n?r?document.getElementById(n.slice(1)):document.querySelector(n):n;if(!o)return;t=function(e,t){const n=document.documentElement.getBoundingClientRect(),r=e.getBoundingClientRect();return{behavior:t.behavior,left:r.left-n.left-(t.left||0),top:r.top-n.top-(t.top||0)}}(o,e)}else t=e;"scrollBehavior"in document.documentElement.style?window.scrollTo(t):window.scrollTo(null!=t.left?t.left:window.pageXOffset,null!=t.top?t.top:window.pageYOffset)}function k(e,t){return(history.state?history.state.position-t:-1)+e}const T=new Map;let C=()=>location.protocol+"//"+location.host;function j(e,t){const{pathname:n,search:r,hash:o}=t;if(e.indexOf("#")>-1){let e=o.slice(1);return"/"!==e[0]&&(e="/"+e),m(e,"")}return m(n,e)+r+o}function S(e,t,n,r=!1,o=!1){return{back:e,current:t,forward:n,replaced:r,position:window.history.length,scroll:o?R():null}}function x(e){const t=function(e){const{history:t,location:n}=window;let r={value:j(e,n)},o={value:t.state};function a(r,a,i){const c=e.indexOf("#"),s=c>-1?e.slice(c)+r:C()+e+r;try{t[i?"replaceState":"pushState"](a,"",s),o.value=a}catch(e){console.error(e),n[i?"replace":"assign"](s)}}return o.value||a(r.value,{back:null,current:r.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0),{location:r,state:o,push:function(e,n){const i=u({},o.value,t.state,{forward:e,scroll:R()});a(i.current,i,!0),a(e,u({},S(r.value,e,null),{position:i.position+1},n),!1),r.value=e},replace:function(e,n){a(e,u({},t.state,S(o.value.back,e,o.value.forward,!0),n,{position:o.value.position}),!0),r.value=e}}}(e=w(e)),n=function(e,t,n,r){let o=[],a=[],i=null;const c=({state:a})=>{const c=j(e,location),s=n.value,l=t.value;let u=0;if(a){if(n.value=c,t.value=a,i&&i===s)return void(i=null);u=l?a.position-l.position:0}else r(c);o.forEach((e=>{e(n.value,s,{delta:u,type:E.pop,direction:u?u>0?O.forward:O.back:O.unknown})}))};function s(){const{history:e}=window;e.state&&e.replaceState(u({},e.state,{scroll:R()}),"")}return window.addEventListener("popstate",c),window.addEventListener("beforeunload",s),{pauseListeners:function(){i=n.value},listen:function(e){o.push(e);const t=()=>{const t=o.indexOf(e);t>-1&&o.splice(t,1)};return a.push(t),t},destroy:function(){for(const e of a)e();a=[],window.removeEventListener("popstate",c),window.removeEventListener("beforeunload",s)}}}(e,t.state,t.location,t.replace);const r=u({location:"",base:e,go:function(e,t=!0){t||n.pauseListeners(),history.go(e)},createHref:P.bind(null,e)},t,n);return Object.defineProperty(r,"location",{get:()=>t.location.value}),Object.defineProperty(r,"state",{get:()=>t.state.value}),r}function L(e){return"string"==typeof e||"symbol"==typeof e}const N={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0},M=r("nf");var $;function G(e,t){return u(new Error,{type:e,[M]:!0},t)}function I(e,t){return e instanceof Error&&M in e&&(null==t||!!(e.type&t))}($=e.NavigationFailureType||(e.NavigationFailureType={}))[$.aborted=4]="aborted",$[$.cancelled=8]="cancelled",$[$.duplicated=16]="duplicated";const B="[^/]+?",U={sensitive:!1,strict:!1,start:!0,end:!0},D=/[.+*?^${}()[\]/\\]/g;function q(e,t){let n=0;for(;n<e.length&&n<t.length;){const r=t[n]-e[n];if(r)return r;n++}return e.length<t.length?1===e.length&&80===e[0]?-1:1:e.length>t.length?1===t.length&&80===t[0]?1:-1:0}function V(e,t){let n=0;const r=e.score,o=t.score;for(;n<r.length&&n<o.length;){const e=q(r[n],o[n]);if(e)return e;n++}return o.length-r.length}const H={type:0,value:""},K=/[a-zA-Z0-9_]/;function F(e,t,n){const r=function(e,t){const n=u({},U,t);let r=[],o=n.start?"^":"";const a=[];for(const t of e){const e=t.length?[]:[90];n.strict&&!t.length&&(o+="/");for(let r=0;r<t.length;r++){const i=t[r];let c=40+(n.sensitive?.25:0);if(0===i.type)r||(o+="/"),o+=i.value.replace(D,"\\$&"),c+=40;else if(1===i.type){const{value:e,repeatable:t,optional:n,regexp:s}=i;a.push({name:e,repeatable:t,optional:n});const l=s||B;if(l!==B){c+=10;try{new RegExp(`(${l})`)}catch(t){throw new Error(`Invalid custom RegExp for param "${e}" (${l}): `+t.message)}}let u=t?`((?:${l})(?:/(?:${l}))*)`:`(${l})`;r||(u=n?`(?:/${u})`:"/"+u),n&&(u+="?"),o+=u,c+=20,n&&(c+=-8),t&&(c+=-20),".*"===l&&(c+=-50)}e.push(c)}r.push(e)}if(n.strict&&n.end){const e=r.length-1;r[e][r[e].length-1]+=.7000000000000001}n.strict||(o+="/?"),n.end?o+="$":n.strict&&(o+="(?:/|$)");const i=new RegExp(o,n.sensitive?"":"i");return{re:i,score:r,keys:a,parse:function(e){const t=e.match(i),n={};if(!t)return null;for(let e=1;e<t.length;e++){const r=t[e]||"",o=a[e-1];n[o.name]=r&&o.repeatable?r.split("/"):r}return n},stringify:function(t){let n="",r=!1;for(const o of e){r&&n.endsWith("/")||(n+="/"),r=!1;for(const e of o)if(0===e.type)n+=e.value;else if(1===e.type){const{value:o,repeatable:a,optional:i}=e,c=o in t?t[o]:"";if(Array.isArray(c)&&!a)throw new Error(`Provided param "${o}" is an array but it is not repeatable (* or + modifiers)`);const s=Array.isArray(c)?c.join("/"):c;if(!s){if(!i)throw new Error(`Missing required param "${o}"`);n.endsWith("/")?n=n.slice(0,-1):r=!0}n+=s}}return n}}}(function(e){if(!e)return[[]];if("/"===e)return[[H]];if(!e.startsWith("/"))throw new Error(`Invalid path "${e}"`);function t(e){throw new Error(`ERR (${n})/"${l}": ${e}`)}let n=0,r=n;const o=[];let a;function i(){a&&o.push(a),a=[]}let c,s=0,l="",u="";function f(){l&&(0===n?a.push({type:0,value:l}):1===n||2===n||3===n?(a.length>1&&("*"===c||"+"===c)&&t(`A repeatable param (${l}) must be alone in its segment. eg: '/:ids+.`),a.push({type:1,value:l,regexp:u,repeatable:"*"===c||"+"===c,optional:"*"===c||"?"===c})):t("Invalid state to consume buffer"),l="")}function p(){l+=c}for(;s<e.length;)if(c=e[s++],"\\"!==c||2===n)switch(n){case 0:"/"===c?(l&&f(),i()):":"===c?(f(),n=1):p();break;case 4:p(),n=r;break;case 1:"("===c?(n=2,u=""):K.test(c)?p():(f(),n=0,"*"!==c&&"?"!==c&&"+"!==c&&s--);break;case 2:")"===c?"\\"==u[u.length-1]?u=u.slice(0,-1)+c:n=3:u+=c;break;case 3:f(),n=0,"*"!==c&&"?"!==c&&"+"!==c&&s--;break;default:t("Unknown state")}else r=n,n=4;return 2===n&&t(`Unfinished custom RegExp for param "${l}"`),f(),i(),o}(e.path),n),o=u(r,{record:e,parent:t,children:[],alias:[]});return t&&!o.record.aliasOf==!t.record.aliasOf&&t.children.push(o),o}function W(e,t){const n=[],r=new Map;function o(e,n,r){let c=!r,s=function(e){return{path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:void 0,beforeEnter:e.beforeEnter,props:Q(e),children:e.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in e?e.components||{}:{default:e.component}}}(e);s.aliasOf=r&&r.record;const l=Y(t,e),f=[s];if("alias"in e){const t="string"==typeof e.alias?[e.alias]:e.alias;for(const e of t)f.push(u({},s,{components:r?r.record.components:s.components,path:e,aliasOf:r?r.record:s}))}let d,h;for(const t of f){let{path:u}=t;if(n&&"/"!==u[0]){let e=n.record.path,r="/"===e[e.length-1]?"":"/";t.path=n.record.path+(u&&r+u)}if(d=F(t,n,l),r?r.alias.push(d):(h=h||d,h!==d&&h.alias.push(d),c&&e.name&&!z(d)&&a(e.name)),"children"in s){let e=s.children;for(let t=0;t<e.length;t++)o(e[t],d,r&&r.children[t])}r=r||d,i(d)}return h?()=>{a(h)}:p}function a(e){if(L(e)){const t=r.get(e);t&&(r.delete(e),n.splice(n.indexOf(t),1),t.children.forEach(a),t.alias.forEach(a))}else{let t=n.indexOf(e);t>-1&&(n.splice(t,1),e.record.name&&r.delete(e.record.name),e.children.forEach(a),e.alias.forEach(a))}}function i(e){let t=0;for(;t<n.length&&V(e,n[t])>=0;)t++;n.splice(t,0,e),e.record.name&&!z(e)&&r.set(e.record.name,e)}return t=Y({strict:!1,end:!0,sensitive:!1},t),e.forEach((e=>o(e))),{addRoute:o,resolve:function(e,t){let o,a,i,c={};if("name"in e&&e.name){if(o=r.get(e.name),!o)throw G(1,{location:e});i=o.record.name,c=u(function(e,t){let n={};for(let r of t)r in e&&(n[r]=e[r]);return n}(t.params,o.keys.filter((e=>!e.optional)).map((e=>e.name))),e.params),a=o.stringify(c)}else if("path"in e)a=e.path,o=n.find((e=>e.re.test(a))),o&&(c=o.parse(a),i=o.record.name);else{if(o=t.name?r.get(t.name):n.find((e=>e.re.test(t.path))),!o)throw G(1,{location:e,currentLocation:t});i=o.record.name,c=u({},t.params,e.params),a=o.stringify(c)}const s=[];let l=o;for(;l;)s.unshift(l.record),l=l.parent;return{name:i,path:a,params:c,matched:s,meta:X(s)}},removeRoute:a,getRoutes:function(){return n},getRecordMatcher:function(e){return r.get(e)}}}function Q(e){const t={},n=e.props||!1;if("component"in e)t.default=n;else for(let r in e.components)t[r]="boolean"==typeof n?n:n[r];return t}function z(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function X(e){return e.reduce(((e,t)=>u(e,t.meta)),{})}function Y(e,t){let n={};for(let r in e)n[r]=r in t?t[r]:e[r];return n}const Z=/#/g,J=/&/g,ee=/\//g,te=/=/g,ne=/\?/g,re=/\+/g,oe=/%5B/g,ae=/%5D/g,ie=/%5E/g,ce=/%60/g,se=/%7B/g,le=/%7C/g,ue=/%7D/g,fe=/%20/g;function pe(e){return encodeURI(""+e).replace(le,"|").replace(oe,"[").replace(ae,"]")}function de(e){return pe(e).replace(re,"%2B").replace(fe,"+").replace(Z,"%23").replace(J,"%26").replace(ce,"`").replace(se,"{").replace(ue,"}").replace(ie,"^")}function he(e){return function(e){return pe(e).replace(Z,"%23").replace(ne,"%3F")}(e).replace(ee,"%2F")}function me(e){try{return decodeURIComponent(""+e)}catch(e){}return""+e}function ve(e){const t={};if(""===e||"?"===e)return t;const n=("?"===e[0]?e.slice(1):e).split("&");for(let e=0;e<n.length;++e){const r=n[e].replace(re," ");let o=r.indexOf("="),a=me(o<0?r:r.slice(0,o)),i=o<0?null:me(r.slice(o+1));if(a in t){let e=t[a];Array.isArray(e)||(e=t[a]=[e]),e.push(i)}else t[a]=i}return t}function ge(e){let t="";for(let n in e){t.length&&(t+="&");const r=e[n];if(n=de(n).replace(te,"%3D"),null==r){void 0!==r&&(t+=n);continue}let o=Array.isArray(r)?r.map((e=>e&&de(e))):[r&&de(r)];for(let e=0;e<o.length;e++)t+=(e?"&":"")+n,null!=o[e]&&(t+="="+o[e])}return t}function ye(e){const t={};for(let n in e){let r=e[n];void 0!==r&&(t[n]=Array.isArray(r)?r.map((e=>null==e?null:""+e)):null==r?r:""+r)}return t}function be(){let e=[];return{add:function(t){return e.push(t),()=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)}},list:()=>e,reset:function(){e=[]}}}function Ee(e,n,r){const o=()=>{e[n].delete(r)};t.onUnmounted(o),t.onDeactivated(o),t.onActivated((()=>{e[n].add(r)})),e[n].add(r)}function Oe(e,t,n,r,o){const a=r&&(r.enterCallbacks[o]=r.enterCallbacks[o]||[]);return()=>new Promise(((i,c)=>{const s=e=>{var s;!1===e?c(G(4,{from:n,to:t})):e instanceof Error?c(e):"string"==typeof(s=e)||s&&"object"==typeof s?c(G(2,{from:t,to:e})):(a&&r.enterCallbacks[o]===a&&"function"==typeof e&&a.push(e),i())},l=e.call(r&&r.instances[o],t,n,s);let u=Promise.resolve(l);e.length<3&&(u=u.then(s)),u.catch((e=>c(e)))}))}function we(e,t,r,o){const a=[];for(const i of e)for(const e in i.components){let c=i.components[e];if("beforeRouteEnter"===t||i.instances[e])if(_e(c)){const n=(c.__vccOpts||c)[t];n&&a.push(Oe(n,r,o,i,e))}else{let s=c();s=s.catch(console.error),a.push((()=>s.then((a=>{if(!a)return Promise.reject(new Error(`Couldn't resolve component "${e}" at "${i.path}"`));const c=(s=a).__esModule||n&&"Module"===s[Symbol.toStringTag]?a.default:a;var s;i.components[e]=c;const l=c[t];return l&&Oe(l,r,o,i,e)()}))))}}return a}function _e(e){return"object"==typeof e||"displayName"in e||"props"in e||"__vccOpts"in e}function Pe(e){const n=t.inject(i),r=t.inject(c),o=t.computed((()=>n.resolve(t.unref(e.to)))),a=t.computed((()=>{let{matched:e}=o.value,{length:t}=e;const n=e[t-1];let a=r.matched;if(!n||!a.length)return-1;let i=a.findIndex(v.bind(null,n));if(i>-1)return i;let c=Ae(e[t-2]);return t>1&&Ae(n)===c&&a[a.length-1].path!==c?a.findIndex(v.bind(null,e[t-2])):i})),s=t.computed((()=>a.value>-1&&function(e,t){for(let n in t){let r=t[n],o=e[n];if("string"==typeof r){if(r!==o)return!1}else if(!Array.isArray(o)||o.length!==r.length||r.some(((e,t)=>e!==o[t])))return!1}return!0}(r.params,o.value.params))),l=t.computed((()=>a.value>-1&&a.value===r.matched.length-1&&g(r.params,o.value.params)));return{route:o,href:t.computed((()=>o.value.href)),isActive:s,isExactActive:l,navigate:function(r={}){return function(e){if(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)return;if(e.defaultPrevented)return;if(void 0!==e.button&&0!==e.button)return;if(e.currentTarget&&e.currentTarget.getAttribute){const t=e.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(t))return}e.preventDefault&&e.preventDefault();return!0}(r)?n[t.unref(e.replace)?"replace":"push"](t.unref(e.to)):Promise.resolve()}}}const Re=t.defineComponent({name:"RouterLink",props:{to:{type:[String,Object],required:!0},activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"}},setup(e,{slots:n,attrs:r}){const o=t.reactive(Pe(e)),{options:a}=t.inject(i),c=t.computed((()=>({[ke(e.activeClass,a.linkActiveClass,"router-link-active")]:o.isActive,[ke(e.exactActiveClass,a.linkExactActiveClass,"router-link-exact-active")]:o.isExactActive})));return()=>{const a=n.default&&n.default(o);return e.custom?a:t.h("a",u({"aria-current":o.isExactActive?e.ariaCurrentValue:null,onClick:o.navigate,href:o.href},r,{class:c.value}),a)}}});function Ae(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const ke=(e,t,n)=>null!=e?e:null!=t?t:n;function Te(e,t){if(!e)return null;const n=e(t);return 1===n.length?n[0]:n}const Ce=t.defineComponent({name:"RouterView",props:{name:{type:String,default:"default"},route:Object},setup(e,{attrs:n,slots:r}){const i=t.inject(s),c=t.computed((()=>e.route||i.value)),l=t.inject(a,0),f=t.computed((()=>c.value.matched[l]));t.provide(a,l+1),t.provide(o,f),t.provide(s,c);const p=t.ref();return t.watch((()=>[p.value,f.value,e.name]),(([e,t,n],[r,o,a])=>{t&&(t.instances[n]=e,o&&o!==t&&e&&e===r&&(t.leaveGuards=o.leaveGuards,t.updateGuards=o.updateGuards)),!e||!t||o&&v(t,o)&&r||(t.enterCallbacks[n]||[]).forEach((t=>t(e)))}),{flush:"post"}),()=>{const o=c.value,a=f.value,i=a&&a.components[e.name],s=e.name;if(!i)return Te(r.default,{Component:i,route:o});const l=a.props[e.name],d=l?!0===l?o.params:"function"==typeof l?l(o):l:null,h=t.h(i,u({},d,n,{onVnodeUnmounted:e=>{e.component.isUnmounted&&(a.instances[s]=null)},ref:p}));return Te(r.default,{Component:h,route:o})||h}}});var je="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Se(e,t,n){return e(n={path:t,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}()}},n.exports),n.exports}var xe=Se((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.hook=t.target=t.isBrowser=void 0,t.isBrowser="undefined"!=typeof navigator,t.target=t.isBrowser?window:void 0!==je?je:{},t.hook=t.target.__VUE_DEVTOOLS_GLOBAL_HOOK__})),Le=Se((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.ApiHookEvents=void 0,function(e){e.SETUP_DEVTOOLS_PLUGIN="devtools-plugin:setup"}(t.ApiHookEvents||(t.ApiHookEvents={}))})),Ne=Se((function(e,t){Object.defineProperty(t,"__esModule",{value:!0})})),Me=Se((function(e,t){Object.defineProperty(t,"__esModule",{value:!0})})),$e=Se((function(e,t){Object.defineProperty(t,"__esModule",{value:!0})})),Ge=Se((function(e,t){Object.defineProperty(t,"__esModule",{value:!0})})),Ie=Se((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.Hooks=void 0,function(e){e.TRANSFORM_CALL="transformCall",e.GET_APP_RECORD_NAME="getAppRecordName",e.GET_APP_ROOT_INSTANCE="getAppRootInstance",e.REGISTER_APPLICATION="registerApplication",e.WALK_COMPONENT_TREE="walkComponentTree",e.WALK_COMPONENT_PARENTS="walkComponentParents",e.INSPECT_COMPONENT="inspectComponent",e.GET_COMPONENT_BOUNDS="getComponentBounds",e.GET_COMPONENT_NAME="getComponentName",e.GET_ELEMENT_COMPONENT="getElementComponent",e.GET_INSPECTOR_TREE="getInspectorTree",e.GET_INSPECTOR_STATE="getInspectorState"}(t.Hooks||(t.Hooks={}))})),Be=Se((function(e,t){var n=je&&je.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),r=je&&je.__exportStar||function(e,t){for(var r in e)"default"===r||t.hasOwnProperty(r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),r(Ne,t),r(Me,t),r($e,t),r(Ge,t),r(Ie,t)}));Se((function(e,t){var n=je&&je.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),r=je&&je.__exportStar||function(e,t){for(var r in e)"default"===r||t.hasOwnProperty(r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.setupDevtoolsPlugin=void 0,r(Be,t),t.setupDevtoolsPlugin=function(e,t){if(xe.hook)xe.hook.emit(Le.ApiHookEvents.SETUP_DEVTOOLS_PLUGIN,e,t);else{(xe.target.__VUE_DEVTOOLS_PLUGINS__=xe.target.__VUE_DEVTOOLS_PLUGINS__||[]).push({pluginDescriptor:e,setupFn:t})}}}));function Ue(e){return e.reduce(((e,t)=>e.then((()=>t()))),Promise.resolve())}return e.RouterLink=Re,e.RouterView=Ce,e.START_LOCATION=N,e.createMemoryHistory=function(e=""){let t=[],n=[""],r=0;function o(e){r++,r===n.length||n.splice(r),n.push(e)}const a={location:"",state:{},base:e,createHref:P.bind(null,e),replace(e){n.splice(r--,1),o(e)},push(e,t){o(e)},listen:e=>(t.push(e),()=>{const n=t.indexOf(e);n>-1&&t.splice(n,1)}),destroy(){t=[]},go(e,o=!0){const a=this.location,i=e<0?O.back:O.forward;r=Math.max(0,Math.min(r+e,n.length-1)),o&&function(e,n,{direction:r,delta:o}){const a={direction:r,delta:o,type:E.pop};for(let r of t)r(e,n,a)}(this.location,a,{direction:i,delta:e})}};return Object.defineProperty(a,"location",{get:()=>n[r]}),a},e.createRouter=function(e){const n=W(e.routes,e);let r=e.parseQuery||ve,o=e.stringifyQuery||ge,a=e.history;const d=be(),m=be(),y=be(),b=t.shallowRef(N);let E=N;l&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const O=f.bind(null,(e=>""+e)),w=f.bind(null,he),_=f.bind(null,me);function P(e,t){if(t=u({},t||b.value),"string"==typeof e){let o=h(r,e,t.path),i=n.resolve({path:o.path},t),c=a.createHref(o.fullPath);return u(o,i,{params:_(i.params),hash:me(o.hash),redirectedFrom:void 0,href:c})}let i;"path"in e?i=u({},e,{path:h(r,e.path,t.path).path}):(i=u({},e,{params:w(e.params)}),t.params=w(t.params));let c=n.resolve(i,t);const s=e.hash||"";c.params=O(_(c.params));const l=function(e,t){let n=t.query?e(t.query):"";return t.path+(n&&"?")+n+(t.hash||"")}(o,u({},e,{hash:(f=s,pe(f).replace(se,"{").replace(ue,"}").replace(ie,"^")),path:c.path}));var f;let p=a.createHref(l);return u({fullPath:l,hash:s,query:o===ge?ye(e.query):e.query},c,{redirectedFrom:void 0,href:p})}function C(e){return"string"==typeof e?{path:e}:u({},e)}function j(e,t){if(E!==e)return G(8,{from:t,to:e})}function S(e){return M(e)}function x(e){const t=e.matched[e.matched.length-1];if(t&&t.redirect){const{redirect:n}=t;let r=C("function"==typeof n?n(e):n);return u({query:e.query,hash:e.hash,params:e.params},r)}}function M(e,t){const n=E=P(e),r=b.value,a=e.state,i=e.force,c=!0===e.replace,s=x(n);if(s)return M(u(s,{state:a,force:i,replace:c}),t||n);const l=n;let f;return l.redirectedFrom=t,!i&&function(e,t,n){let r=t.matched.length-1,o=n.matched.length-1;return r>-1&&r===o&&v(t.matched[r],n.matched[o])&&g(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}(o,r,n)&&(f=G(16,{to:l,from:r}),X(r,r,!0,!1)),(f?Promise.resolve(f):B(l,r)).catch((e=>I(e)?e:Q(e))).then((e=>{if(e){if(I(e,2))return M(u(C(e.to),{state:a,force:i,replace:c}),t||l)}else e=D(l,r,!0,c,a);return U(l,r,e),e}))}function $(e,t){const n=j(e,t);return n?Promise.reject(n):Promise.resolve()}function B(e,t){let n;const[r,o,a]=function(e,t){const n=[],r=[],o=[],a=Math.max(t.matched.length,e.matched.length);for(let i=0;i<a;i++){const a=t.matched[i];a&&(e.matched.indexOf(a)<0?n.push(a):r.push(a));const c=e.matched[i];c&&t.matched.indexOf(c)<0&&o.push(c)}return[n,r,o]}(e,t);n=we(r.reverse(),"beforeRouteLeave",e,t);for(const o of r)o.leaveGuards.forEach((r=>{n.push(Oe(r,e,t))}));const i=$.bind(null,e,t);return n.push(i),Ue(n).then((()=>{n=[];for(const r of d.list())n.push(Oe(r,e,t));return n.push(i),Ue(n)})).then((()=>{n=we(o,"beforeRouteUpdate",e,t);for(const r of o)r.updateGuards.forEach((r=>{n.push(Oe(r,e,t))}));return n.push(i),Ue(n)})).then((()=>{n=[];for(const r of e.matched)if(r.beforeEnter&&t.matched.indexOf(r)<0)if(Array.isArray(r.beforeEnter))for(const o of r.beforeEnter)n.push(Oe(o,e,t));else n.push(Oe(r.beforeEnter,e,t));return n.push(i),Ue(n)})).then((()=>(e.matched.forEach((e=>e.enterCallbacks={})),n=we(a,"beforeRouteEnter",e,t),n.push(i),Ue(n)))).then((()=>{n=[];for(const r of m.list())n.push(Oe(r,e,t));return n.push(i),Ue(n)})).catch((e=>I(e,8)?e:Promise.reject(e)))}function U(e,t,n){for(const r of y.list())r(e,t,n)}function D(e,t,n,r,o){const i=j(e,t);if(i)return i;const c=t===N,s=l?history.state:{};n&&(r||c?a.replace(e.fullPath,u({scroll:c&&s&&s.scroll},o)):a.push(e.fullPath,o)),b.value=e,X(e,t,n,c),z()}let q;function V(){q=a.listen(((e,t,n)=>{let r=P(e);const o=x(r);if(o)return void M(u(o,{replace:!0}),r).catch(p);E=r;const i=b.value;var c,s;l&&(c=k(i.fullPath,n.delta),s=R(),T.set(c,s)),B(r,i).catch((e=>I(e,12)?e:I(e,2)?(n.delta&&a.go(-n.delta,!1),M(e.to,r).catch(p),Promise.reject()):(n.delta&&a.go(-n.delta,!1),Q(e)))).then((e=>{(e=e||D(r,i,!1))&&n.delta&&a.go(-n.delta,!1),U(r,i,e)})).catch(p)}))}let H,K=be(),F=be();function Q(e){return z(e),F.list().forEach((t=>t(e))),Promise.reject(e)}function z(e){H||(H=!0,V(),K.list().forEach((([t,n])=>e?n(e):t())),K.reset())}function X(n,r,o,a){const{scrollBehavior:i}=e;if(!l||!i)return Promise.resolve();let c=!o&&function(e){const t=T.get(e);return T.delete(e),t}(k(n.fullPath,0))||(a||!o)&&history.state&&history.state.scroll||null;return t.nextTick().then((()=>i(n,r,c))).then((e=>e&&A(e))).catch(Q)}const Y=e=>a.go(e);let Z;const J=new Set;return{currentRoute:b,addRoute:function(e,t){let r,o;return L(e)?(r=n.getRecordMatcher(e),o=t):o=e,n.addRoute(o,r)},removeRoute:function(e){let t=n.getRecordMatcher(e);t&&n.removeRoute(t)},hasRoute:function(e){return!!n.getRecordMatcher(e)},getRoutes:function(){return n.getRoutes().map((e=>e.record))},resolve:P,options:e,push:S,replace:function(e){return S(u(C(e),{replace:!0}))},go:Y,back:()=>Y(-1),forward:()=>Y(1),beforeEach:d.add,beforeResolve:m.add,afterEach:y.add,onError:F.add,isReady:function(){return H&&b.value!==N?Promise.resolve():new Promise(((e,t)=>{K.add([e,t])}))},install(e){e.component("RouterLink",Re),e.component("RouterView",Ce),e.config.globalProperties.$router=this,Object.defineProperty(e.config.globalProperties,"$route",{get:()=>t.unref(b)}),l&&!Z&&b.value===N&&(Z=!0,S(a.location).catch((e=>{})));const n={};for(let e in N)n[e]=t.computed((()=>b.value[e]));e.provide(i,this),e.provide(c,t.reactive(n)),e.provide(s,b);let r=e.unmount;J.add(e),e.unmount=function(){J.delete(e),J.size<1&&(q(),b.value=N,Z=!1,H=!1),r.call(this,arguments)}}}},e.createRouterMatcher=W,e.createWebHashHistory=function(e){return(e=location.host?e||location.pathname:"").indexOf("#")<0&&(e+="#"),x(e)},e.createWebHistory=x,e.isNavigationFailure=I,e.matchedRouteKey=o,e.onBeforeRouteLeave=function(e){const n=t.inject(o,{}).value;n&&Ee(n,"leaveGuards",e)},e.onBeforeRouteUpdate=function(e){const n=t.inject(o,{}).value;n&&Ee(n,"updateGuards",e)},e.parseQuery=ve,e.routeLocationKey=c,e.routerKey=i,e.routerViewLocationKey=s,e.stringifyQuery=ge,e.useLink=Pe,e.useRoute=function(){return t.inject(c)},e.useRouter=function(){return t.inject(i)},e.viewDepthKey=a,Object.defineProperty(e,"__esModule",{value:!0}),e}({},Vue);
var VueRouter=function(e,t){"use strict";const n="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag,r=e=>n?Symbol(e):"_vr_"+e,o=r("rvlm"),a=r("rvd"),i=r("r"),c=r("rl"),s=r("rvl"),l="undefined"!=typeof window;const u=Object.assign;function f(e,t){const n={};for(const r in t){const o=t[r];n[r]=Array.isArray(o)?o.map(e):e(o)}return n}let p=()=>{};const h=/\/$/;function d(e,t,n="/"){let r,o={},a="",i="";const c=t.indexOf("?"),s=t.indexOf("#",c>-1?c:0);return c>-1&&(r=t.slice(0,c),a=t.slice(c+1,s>-1?s:t.length),o=e(a)),s>-1&&(r=r||t.slice(0,s),i=t.slice(s,t.length)),r=function(e,t){if(e.startsWith("/"))return e;if(!e)return t;const n=t.split("/"),r=e.split("/");let o,a,i=n.length-1;for(o=0;o<r.length;o++)if(a=r[o],1!==i&&"."!==a){if(".."!==a)break;i--}return n.slice(0,i).join("/")+"/"+r.slice(o-(o===r.length?1:0)).join("/")}(null!=r?r:t,n),{fullPath:r+(a&&"?")+a+i,path:r,query:o,hash:i}}function m(e,t){return!t||e.toLowerCase().indexOf(t.toLowerCase())?e:e.slice(t.length)||"/"}function v(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function g(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(!y(e[n],t[n]))return!1;return!0}function y(e,t){return Array.isArray(e)?b(e,t):Array.isArray(t)?b(t,e):e===t}function b(e,t){return Array.isArray(t)?e.length===t.length&&e.every(((e,n)=>e===t[n])):1===e.length&&e[0]===t}var w,E;!function(e){e.pop="pop",e.push="push"}(w||(w={})),function(e){e.back="back",e.forward="forward",e.unknown=""}(E||(E={}));function R(e){if(!e)if(l){const t=document.querySelector("base");e=(e=t&&t.getAttribute("href")||"/").replace(/^\w+:\/\/[^\/]+/,"")}else e="/";return"/"!==e[0]&&"#"!==e[0]&&(e="/"+e),e.replace(h,"")}const O=/^[^#]+#/;function A(e,t){return e.replace(O,"#")+t}const k=()=>({left:window.pageXOffset,top:window.pageYOffset});function x(e){let t;if("el"in e){let n=e.el;const r="string"==typeof n&&n.startsWith("#"),o="string"==typeof n?r?document.getElementById(n.slice(1)):document.querySelector(n):n;if(!o)return;t=function(e,t){const n=document.documentElement.getBoundingClientRect(),r=e.getBoundingClientRect();return{behavior:t.behavior,left:r.left-n.left-(t.left||0),top:r.top-n.top-(t.top||0)}}(o,e)}else t=e;"scrollBehavior"in document.documentElement.style?window.scrollTo(t):window.scrollTo(null!=t.left?t.left:window.pageXOffset,null!=t.top?t.top:window.pageYOffset)}function P(e,t){return(history.state?history.state.position-t:-1)+e}const j=new Map;let C=()=>location.protocol+"//"+location.host;function $(e,t){const{pathname:n,search:r,hash:o}=t;if(e.indexOf("#")>-1){let e=o.slice(1);return"/"!==e[0]&&(e="/"+e),m(e,"")}return m(n,e)+r+o}function S(e,t,n,r=!1,o=!1){return{back:e,current:t,forward:n,replaced:r,position:window.history.length,scroll:o?k():null}}function L(e){const t=function(e){const{history:t,location:n}=window;let r={value:$(e,n)},o={value:t.state};function a(r,a,i){const c=e.indexOf("#"),s=c>-1?e.slice(c)+r:C()+e+r;try{t[i?"replaceState":"pushState"](a,"",s),o.value=a}catch(e){console.error(e),n[i?"replace":"assign"](s)}}return o.value||a(r.value,{back:null,current:r.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0),{location:r,state:o,push:function(e,n){const i=u({},o.value,t.state,{forward:e,scroll:k()});a(i.current,i,!0),a(e,u({},S(r.value,e,null),{position:i.position+1},n),!1),r.value=e},replace:function(e,n){a(e,u({},t.state,S(o.value.back,e,o.value.forward,!0),n,{position:o.value.position}),!0),r.value=e}}}(e=R(e)),n=function(e,t,n,r){let o=[],a=[],i=null;const c=({state:a})=>{const c=$(e,location),s=n.value,l=t.value;let u=0;if(a){if(n.value=c,t.value=a,i&&i===s)return void(i=null);u=l?a.position-l.position:0}else r(c);o.forEach((e=>{e(n.value,s,{delta:u,type:w.pop,direction:u?u>0?E.forward:E.back:E.unknown})}))};function s(){const{history:e}=window;e.state&&e.replaceState(u({},e.state,{scroll:k()}),"")}return window.addEventListener("popstate",c),window.addEventListener("beforeunload",s),{pauseListeners:function(){i=n.value},listen:function(e){o.push(e);const t=()=>{const t=o.indexOf(e);t>-1&&o.splice(t,1)};return a.push(t),t},destroy:function(){for(const e of a)e();a=[],window.removeEventListener("popstate",c),window.removeEventListener("beforeunload",s)}}}(e,t.state,t.location,t.replace);const r=u({location:"",base:e,go:function(e,t=!0){t||n.pauseListeners(),history.go(e)},createHref:A.bind(null,e)},t,n);return Object.defineProperty(r,"location",{get:()=>t.location.value}),Object.defineProperty(r,"state",{get:()=>t.state.value}),r}function q(e){return"string"==typeof e||"symbol"==typeof e}const M={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0},T=r("nf");var _;function B(e,t){return u(new Error,{type:e,[T]:!0},t)}function G(e,t){return e instanceof Error&&T in e&&(null==t||!!(e.type&t))}(_=e.NavigationFailureType||(e.NavigationFailureType={}))[_.aborted=4]="aborted",_[_.cancelled=8]="cancelled",_[_.duplicated=16]="duplicated";const F="[^/]+?",I={sensitive:!1,strict:!1,start:!0,end:!0},K=/[.+*?^${}()[\]/\\]/g;function U(e,t){let n=0;for(;n<e.length&&n<t.length;){const r=t[n]-e[n];if(r)return r;n++}return e.length<t.length?1===e.length&&80===e[0]?-1:1:e.length>t.length?1===t.length&&80===t[0]?1:-1:0}function V(e,t){let n=0;const r=e.score,o=t.score;for(;n<r.length&&n<o.length;){const e=U(r[n],o[n]);if(e)return e;n++}return o.length-r.length}const H={type:0,value:""},D=/[a-zA-Z0-9_]/;function W(e,t,n){const r=function(e,t){const n=u({},I,t);let r=[],o=n.start?"^":"";const a=[];for(const t of e){const e=t.length?[]:[90];n.strict&&!t.length&&(o+="/");for(let r=0;r<t.length;r++){const i=t[r];let c=40+(n.sensitive?.25:0);if(0===i.type)r||(o+="/"),o+=i.value.replace(K,"\\$&"),c+=40;else if(1===i.type){const{value:e,repeatable:t,optional:n,regexp:s}=i;a.push({name:e,repeatable:t,optional:n});const l=s||F;if(l!==F){c+=10;try{new RegExp(`(${l})`)}catch(t){throw new Error(`Invalid custom RegExp for param "${e}" (${l}): `+t.message)}}let u=t?`((?:${l})(?:/(?:${l}))*)`:`(${l})`;r||(u=n?`(?:/${u})`:"/"+u),n&&(u+="?"),o+=u,c+=20,n&&(c+=-8),t&&(c+=-20),".*"===l&&(c+=-50)}e.push(c)}r.push(e)}if(n.strict&&n.end){const e=r.length-1;r[e][r[e].length-1]+=.7000000000000001}n.strict||(o+="/?"),n.end?o+="$":n.strict&&(o+="(?:/|$)");const i=new RegExp(o,n.sensitive?"":"i");return{re:i,score:r,keys:a,parse:function(e){const t=e.match(i),n={};if(!t)return null;for(let e=1;e<t.length;e++){const r=t[e]||"",o=a[e-1];n[o.name]=r&&o.repeatable?r.split("/"):r}return n},stringify:function(t){let n="",r=!1;for(const o of e){r&&n.endsWith("/")||(n+="/"),r=!1;for(const e of o)if(0===e.type)n+=e.value;else if(1===e.type){const{value:o,repeatable:a,optional:i}=e,c=o in t?t[o]:"";if(Array.isArray(c)&&!a)throw new Error(`Provided param "${o}" is an array but it is not repeatable (* or + modifiers)`);const s=Array.isArray(c)?c.join("/"):c;if(!s){if(!i)throw new Error(`Missing required param "${o}"`);n.endsWith("/")?n=n.slice(0,-1):r=!0}n+=s}}return n}}}(function(e){if(!e)return[[]];if("/"===e)return[[H]];if(!e.startsWith("/"))throw new Error(`Invalid path "${e}"`);function t(e){throw new Error(`ERR (${n})/"${l}": ${e}`)}let n=0,r=n;const o=[];let a;function i(){a&&o.push(a),a=[]}let c,s=0,l="",u="";function f(){l&&(0===n?a.push({type:0,value:l}):1===n||2===n||3===n?(a.length>1&&("*"===c||"+"===c)&&t(`A repeatable param (${l}) must be alone in its segment. eg: '/:ids+.`),a.push({type:1,value:l,regexp:u,repeatable:"*"===c||"+"===c,optional:"*"===c||"?"===c})):t("Invalid state to consume buffer"),l="")}function p(){l+=c}for(;s<e.length;)if(c=e[s++],"\\"!==c||2===n)switch(n){case 0:"/"===c?(l&&f(),i()):":"===c?(f(),n=1):p();break;case 4:p(),n=r;break;case 1:"("===c?n=2:D.test(c)?p():(f(),n=0,"*"!==c&&"?"!==c&&"+"!==c&&s--);break;case 2:")"===c?"\\"==u[u.length-1]?u=u.slice(0,-1)+c:n=3:u+=c;break;case 3:f(),n=0,"*"!==c&&"?"!==c&&"+"!==c&&s--,u="";break;default:t("Unknown state")}else r=n,n=4;return 2===n&&t(`Unfinished custom RegExp for param "${l}"`),f(),i(),o}(e.path),n),o=u(r,{record:e,parent:t,children:[],alias:[]});return t&&!o.record.aliasOf==!t.record.aliasOf&&t.children.push(o),o}function N(e,t){const n=[],r=new Map;function o(e,n,r){let c=!r,s=function(e){return{path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:void 0,beforeEnter:e.beforeEnter,props:Q(e),children:e.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in e?e.components||{}:{default:e.component}}}(e);s.aliasOf=r&&r.record;const l=Y(t,e),f=[s];if("alias"in e){const t="string"==typeof e.alias?[e.alias]:e.alias;for(const e of t)f.push(u({},s,{components:r?r.record.components:s.components,path:e,aliasOf:r?r.record:s}))}let h,d;for(const t of f){let{path:u}=t;if(n&&"/"!==u[0]){let e=n.record.path,r="/"===e[e.length-1]?"":"/";t.path=n.record.path+(u&&r+u)}if(h=W(t,n,l),r?r.alias.push(h):(d=d||h,d!==h&&d.alias.push(h),c&&e.name&&!z(h)&&a(e.name)),"children"in s){let e=s.children;for(let t=0;t<e.length;t++)o(e[t],h,r&&r.children[t])}r=r||h,i(h)}return d?()=>{a(d)}:p}function a(e){if(q(e)){const t=r.get(e);t&&(r.delete(e),n.splice(n.indexOf(t),1),t.children.forEach(a),t.alias.forEach(a))}else{let t=n.indexOf(e);t>-1&&(n.splice(t,1),e.record.name&&r.delete(e.record.name),e.children.forEach(a),e.alias.forEach(a))}}function i(e){let t=0;for(;t<n.length&&V(e,n[t])>=0;)t++;n.splice(t,0,e),e.record.name&&!z(e)&&r.set(e.record.name,e)}return t=Y({strict:!1,end:!0,sensitive:!1},t),e.forEach((e=>o(e))),{addRoute:o,resolve:function(e,t){let o,a,i,c={};if("name"in e&&e.name){if(o=r.get(e.name),!o)throw B(1,{location:e});i=o.record.name,c=u(function(e,t){let n={};for(let r of t)r in e&&(n[r]=e[r]);return n}(t.params,o.keys.filter((e=>!e.optional)).map((e=>e.name))),e.params),a=o.stringify(c)}else if("path"in e)a=e.path,o=n.find((e=>e.re.test(a))),o&&(c=o.parse(a),i=o.record.name);else{if(o=t.name?r.get(t.name):n.find((e=>e.re.test(t.path))),!o)throw B(1,{location:e,currentLocation:t});i=o.record.name,c=u({},t.params,e.params),a=o.stringify(c)}const s=[];let l=o;for(;l;)s.unshift(l.record),l=l.parent;return{name:i,path:a,params:c,matched:s,meta:X(s)}},removeRoute:a,getRoutes:function(){return n},getRecordMatcher:function(e){return r.get(e)}}}function Q(e){const t={},n=e.props||!1;if("component"in e)t.default=n;else for(let r in e.components)t[r]="boolean"==typeof n?n:n[r];return t}function z(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function X(e){return e.reduce(((e,t)=>u(e,t.meta)),{})}function Y(e,t){let n={};for(let r in e)n[r]=r in t?t[r]:e[r];return n}const Z=/#/g,J=/&/g,ee=/\//g,te=/=/g,ne=/\?/g,re=/\+/g,oe=/%5B/g,ae=/%5D/g,ie=/%5E/g,ce=/%60/g,se=/%7B/g,le=/%7C/g,ue=/%7D/g,fe=/%20/g;function pe(e){return encodeURI(""+e).replace(le,"|").replace(oe,"[").replace(ae,"]")}function he(e){return pe(e).replace(re,"%2B").replace(fe,"+").replace(Z,"%23").replace(J,"%26").replace(ce,"`").replace(se,"{").replace(ue,"}").replace(ie,"^")}function de(e){return function(e){return pe(e).replace(Z,"%23").replace(ne,"%3F")}(e).replace(ee,"%2F")}function me(e){try{return decodeURIComponent(""+e)}catch(e){}return""+e}function ve(e){const t={};if(""===e||"?"===e)return t;const n=("?"===e[0]?e.slice(1):e).split("&");for(let e=0;e<n.length;++e){const r=n[e].replace(re," ");let o=r.indexOf("="),a=me(o<0?r:r.slice(0,o)),i=o<0?null:me(r.slice(o+1));if(a in t){let e=t[a];Array.isArray(e)||(e=t[a]=[e]),e.push(i)}else t[a]=i}return t}function ge(e){let t="";for(let n in e){t.length&&(t+="&");const r=e[n];if(n=he(n).replace(te,"%3D"),null==r){void 0!==r&&(t+=n);continue}let o=Array.isArray(r)?r.map((e=>e&&he(e))):[r&&he(r)];for(let e=0;e<o.length;e++)t+=(e?"&":"")+n,null!=o[e]&&(t+="="+o[e])}return t}function ye(e){const t={};for(let n in e){let r=e[n];void 0!==r&&(t[n]=Array.isArray(r)?r.map((e=>null==e?null:""+e)):null==r?r:""+r)}return t}function be(){let e=[];return{add:function(t){return e.push(t),()=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)}},list:()=>e,reset:function(){e=[]}}}function we(e,n,r){const o=()=>{e[n].delete(r)};t.onUnmounted(o),t.onDeactivated(o),t.onActivated((()=>{e[n].add(r)})),e[n].add(r)}function Ee(e,t,n,r,o){const a=r&&(r.enterCallbacks[o]=r.enterCallbacks[o]||[]);return()=>new Promise(((i,c)=>{const s=e=>{var s;!1===e?c(B(4,{from:n,to:t})):e instanceof Error?c(e):"string"==typeof(s=e)||s&&"object"==typeof s?c(B(2,{from:t,to:e})):(a&&r.enterCallbacks[o]===a&&"function"==typeof e&&a.push(e),i())},l=e.call(r&&r.instances[o],t,n,s);let u=Promise.resolve(l);e.length<3&&(u=u.then(s)),u.catch((e=>c(e)))}))}function Re(e,t,r,o){const a=[];for(const c of e)for(const e in c.components){let s=c.components[e];if("beforeRouteEnter"===t||c.instances[e])if("object"==typeof(i=s)||"displayName"in i||"props"in i||"__vccOpts"in i){const n=(s.__vccOpts||s)[t];n&&a.push(Ee(n,r,o,c,e))}else{let i=s();i=i.catch(console.error),a.push((()=>i.then((a=>{if(!a)return Promise.reject(new Error(`Couldn't resolve component "${e}" at "${c.path}"`));const i=(s=a).__esModule||n&&"Module"===s[Symbol.toStringTag]?a.default:a;var s;c.components[e]=i;const l=i[t];return l&&Ee(l,r,o,c,e)()}))))}}var i;return a}function Oe(e){const n=t.inject(i),r=t.inject(c),o=t.computed((()=>n.resolve(t.unref(e.to)))),a=t.computed((()=>{let{matched:e}=o.value,{length:t}=e;const n=e[t-1];let a=r.matched;if(!n||!a.length)return-1;let i=a.findIndex(v.bind(null,n));if(i>-1)return i;let c=ke(e[t-2]);return t>1&&ke(n)===c&&a[a.length-1].path!==c?a.findIndex(v.bind(null,e[t-2])):i})),s=t.computed((()=>a.value>-1&&function(e,t){for(let n in t){let r=t[n],o=e[n];if("string"==typeof r){if(r!==o)return!1}else if(!Array.isArray(o)||o.length!==r.length||r.some(((e,t)=>e!==o[t])))return!1}return!0}(r.params,o.value.params))),l=t.computed((()=>a.value>-1&&a.value===r.matched.length-1&&g(r.params,o.value.params)));return{route:o,href:t.computed((()=>o.value.href)),isActive:s,isExactActive:l,navigate:function(r={}){return function(e){if(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)return;if(e.defaultPrevented)return;if(void 0!==e.button&&0!==e.button)return;if(e.currentTarget&&e.currentTarget.getAttribute){const t=e.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(t))return}e.preventDefault&&e.preventDefault();return!0}(r)?n[t.unref(e.replace)?"replace":"push"](t.unref(e.to)):Promise.resolve()}}}const Ae=t.defineComponent({name:"RouterLink",props:{to:{type:[String,Object],required:!0},activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"}},setup(e,{slots:n,attrs:r}){const o=t.reactive(Oe(e)),{options:a}=t.inject(i),c=t.computed((()=>({[xe(e.activeClass,a.linkActiveClass,"router-link-active")]:o.isActive,[xe(e.exactActiveClass,a.linkExactActiveClass,"router-link-exact-active")]:o.isExactActive})));return()=>{const a=n.default&&n.default(o);return e.custom?a:t.h("a",u({"aria-current":o.isExactActive?e.ariaCurrentValue:null,onClick:o.navigate,href:o.href},r,{class:c.value}),a)}}});function ke(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const xe=(e,t,n)=>null!=e?e:null!=t?t:n;function Pe(e,t){if(!e)return null;const n=e(t);return 1===n.length?n[0]:n}const je=t.defineComponent({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},setup(e,{attrs:n,slots:r}){const i=t.inject(s),c=t.computed((()=>e.route||i.value)),l=t.inject(a,0),f=t.computed((()=>c.value.matched[l]));t.provide(a,l+1),t.provide(o,f),t.provide(s,c);const p=t.ref();return t.watch((()=>[p.value,f.value,e.name]),(([e,t,n],[r,o,a])=>{t&&(t.instances[n]=e,o&&o!==t&&e&&e===r&&(t.leaveGuards=o.leaveGuards,t.updateGuards=o.updateGuards)),!e||!t||o&&v(t,o)&&r||(t.enterCallbacks[n]||[]).forEach((t=>t(e)))}),{flush:"post"}),()=>{const o=c.value,a=f.value,i=a&&a.components[e.name],s=e.name;if(!i)return Pe(r.default,{Component:i,route:o});const l=a.props[e.name],h=l?!0===l?o.params:"function"==typeof l?l(o):l:null,d=t.h(i,u({},h,n,{onVnodeUnmounted:e=>{e.component.isUnmounted&&(a.instances[s]=null)},ref:p}));return Pe(r.default,{Component:d,route:o})||d}}});function Ce(e){return e.reduce(((e,t)=>e.then((()=>t()))),Promise.resolve())}return e.RouterLink=Ae,e.RouterView=je,e.START_LOCATION=M,e.createMemoryHistory=function(e=""){let t=[],n=[""],r=0;function o(e){r++,r===n.length||n.splice(r),n.push(e)}const a={location:"",state:{},base:e,createHref:A.bind(null,e),replace(e){n.splice(r--,1),o(e)},push(e,t){o(e)},listen:e=>(t.push(e),()=>{const n=t.indexOf(e);n>-1&&t.splice(n,1)}),destroy(){t=[]},go(e,o=!0){const a=this.location,i=e<0?E.back:E.forward;r=Math.max(0,Math.min(r+e,n.length-1)),o&&function(e,n,{direction:r,delta:o}){const a={direction:r,delta:o,type:w.pop};for(let r of t)r(e,n,a)}(this.location,a,{direction:i,delta:e})}};return Object.defineProperty(a,"location",{get:()=>n[r]}),a},e.createRouter=function(e){const n=N(e.routes,e);let r=e.parseQuery||ve,o=e.stringifyQuery||ge,a=e.history;const h=be(),m=be(),y=be(),b=t.shallowRef(M);let w=M;l&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const E=f.bind(null,(e=>""+e)),R=f.bind(null,de),O=f.bind(null,me);function A(e,t){if(t=u({},t||b.value),"string"==typeof e){let o=d(r,e,t.path),i=n.resolve({path:o.path},t),c=a.createHref(o.fullPath);return u(o,i,{params:O(i.params),hash:me(o.hash),redirectedFrom:void 0,href:c})}let i;"path"in e?i=u({},e,{path:d(r,e.path,t.path).path}):(i=u({},e,{params:R(e.params)}),t.params=R(t.params));let c=n.resolve(i,t);const s=e.hash||"";c.params=E(O(c.params));const l=function(e,t){let n=t.query?e(t.query):"";return t.path+(n&&"?")+n+(t.hash||"")}(o,u({},e,{hash:(f=s,pe(f).replace(se,"{").replace(ue,"}").replace(ie,"^")),path:c.path}));var f;let p=a.createHref(l);return u({fullPath:l,hash:s,query:o===ge?ye(e.query):e.query},c,{redirectedFrom:void 0,href:p})}function C(e){return"string"==typeof e?d(r,e,b.value.path):u({},e)}function $(e,t){if(w!==e)return B(8,{from:t,to:e})}function S(e){return T(e)}function L(e){const t=e.matched[e.matched.length-1];if(t&&t.redirect){const{redirect:n}=t;let r="function"==typeof n?n(e):n;return"string"==typeof r&&(r=r.indexOf("?")>-1||r.indexOf("#")>-1?r=C(r):{path:r}),u({query:e.query,hash:e.hash,params:e.params},r)}}function T(e,t){const n=w=A(e),r=b.value,a=e.state,i=e.force,c=!0===e.replace,s=L(n);if(s)return T(u(C(s),{state:a,force:i,replace:c}),t||n);const l=n;let f;return l.redirectedFrom=t,!i&&function(e,t,n){let r=t.matched.length-1,o=n.matched.length-1;return r>-1&&r===o&&v(t.matched[r],n.matched[o])&&g(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}(o,r,n)&&(f=B(16,{to:l,from:r}),X(r,r,!0,!1)),(f?Promise.resolve(f):F(l,r)).catch((e=>G(e)?e:Q(e))).then((e=>{if(e){if(G(e,2))return T(u(C(e.to),{state:a,force:i,replace:c}),t||l)}else e=K(l,r,!0,c,a);return I(l,r,e),e}))}function _(e,t){const n=$(e,t);return n?Promise.reject(n):Promise.resolve()}function F(e,t){let n;const[r,o,a]=function(e,t){const n=[],r=[],o=[],a=Math.max(t.matched.length,e.matched.length);for(let i=0;i<a;i++){const a=t.matched[i];a&&(e.matched.indexOf(a)<0?n.push(a):r.push(a));const c=e.matched[i];c&&t.matched.indexOf(c)<0&&o.push(c)}return[n,r,o]}(e,t);n=Re(r.reverse(),"beforeRouteLeave",e,t);for(const o of r)o.leaveGuards.forEach((r=>{n.push(Ee(r,e,t))}));const i=_.bind(null,e,t);return n.push(i),Ce(n).then((()=>{n=[];for(const r of h.list())n.push(Ee(r,e,t));return n.push(i),Ce(n)})).then((()=>{n=Re(o,"beforeRouteUpdate",e,t);for(const r of o)r.updateGuards.forEach((r=>{n.push(Ee(r,e,t))}));return n.push(i),Ce(n)})).then((()=>{n=[];for(const r of e.matched)if(r.beforeEnter&&t.matched.indexOf(r)<0)if(Array.isArray(r.beforeEnter))for(const o of r.beforeEnter)n.push(Ee(o,e,t));else n.push(Ee(r.beforeEnter,e,t));return n.push(i),Ce(n)})).then((()=>(e.matched.forEach((e=>e.enterCallbacks={})),n=Re(a,"beforeRouteEnter",e,t),n.push(i),Ce(n)))).then((()=>{n=[];for(const r of m.list())n.push(Ee(r,e,t));return n.push(i),Ce(n)})).catch((e=>G(e,8)?e:Promise.reject(e)))}function I(e,t,n){for(const r of y.list())r(e,t,n)}function K(e,t,n,r,o){const i=$(e,t);if(i)return i;const c=t===M,s=l?history.state:{};n&&(r||c?a.replace(e.fullPath,u({scroll:c&&s&&s.scroll},o)):a.push(e.fullPath,o)),b.value=e,X(e,t,n,c),z()}let U;function V(){U=a.listen(((e,t,n)=>{let r=A(e);const o=L(r);if(o)return void T(u(o,{replace:!0}),r).catch(p);w=r;const i=b.value;var c,s;l&&(c=P(i.fullPath,n.delta),s=k(),j.set(c,s)),F(r,i).catch((e=>G(e,12)?e:G(e,2)?(T(e.to,r).catch(p),Promise.reject()):(n.delta&&a.go(-n.delta,!1),Q(e)))).then((e=>{(e=e||K(r,i,!1))&&n.delta&&a.go(-n.delta,!1),I(r,i,e)})).catch(p)}))}let H,D=be(),W=be();function Q(e){return z(e),W.list().forEach((t=>t(e))),Promise.reject(e)}function z(e){H||(H=!0,V(),D.list().forEach((([t,n])=>e?n(e):t())),D.reset())}function X(n,r,o,a){const{scrollBehavior:i}=e;if(!l||!i)return Promise.resolve();let c=!o&&function(e){const t=j.get(e);return j.delete(e),t}(P(n.fullPath,0))||(a||!o)&&history.state&&history.state.scroll||null;return t.nextTick().then((()=>i(n,r,c))).then((e=>e&&x(e))).catch(Q)}const Y=e=>a.go(e);let Z;const J=new Set;return{currentRoute:b,addRoute:function(e,t){let r,o;return q(e)?(r=n.getRecordMatcher(e),o=t):o=e,n.addRoute(o,r)},removeRoute:function(e){let t=n.getRecordMatcher(e);t&&n.removeRoute(t)},hasRoute:function(e){return!!n.getRecordMatcher(e)},getRoutes:function(){return n.getRoutes().map((e=>e.record))},resolve:A,options:e,push:S,replace:function(e){return S(u(C(e),{replace:!0}))},go:Y,back:()=>Y(-1),forward:()=>Y(1),beforeEach:h.add,beforeResolve:m.add,afterEach:y.add,onError:W.add,isReady:function(){return H&&b.value!==M?Promise.resolve():new Promise(((e,t)=>{D.add([e,t])}))},install(e){e.component("RouterLink",Ae),e.component("RouterView",je),e.config.globalProperties.$router=this,Object.defineProperty(e.config.globalProperties,"$route",{get:()=>t.unref(b)}),l&&!Z&&b.value===M&&(Z=!0,S(a.location).catch((e=>{})));const n={};for(let e in M)n[e]=t.computed((()=>b.value[e]));e.provide(i,this),e.provide(c,t.reactive(n)),e.provide(s,b);let r=e.unmount;J.add(e),e.unmount=function(){J.delete(e),J.size<1&&(U(),b.value=M,Z=!1,H=!1),r.call(this,arguments)}}}},e.createRouterMatcher=N,e.createWebHashHistory=function(e){return(e=location.host?e||location.pathname:"").indexOf("#")<0&&(e+="#"),L(e)},e.createWebHistory=L,e.isNavigationFailure=G,e.matchedRouteKey=o,e.onBeforeRouteLeave=function(e){const n=t.inject(o,{}).value;n&&we(n,"leaveGuards",e)},e.onBeforeRouteUpdate=function(e){const n=t.inject(o,{}).value;n&&we(n,"updateGuards",e)},e.parseQuery=ve,e.routeLocationKey=c,e.routerKey=i,e.routerViewLocationKey=s,e.stringifyQuery=ge,e.useLink=Oe,e.useRoute=function(){return t.inject(c)},e.useRouter=function(){return t.inject(i)},e.viewDepthKey=a,Object.defineProperty(e,"__esModule",{value:!0}),e}({},Vue);
{
"name": "vue-router",
"version": "4.0.1",
"version": "4.0.2",
"main": "dist/vue-router.cjs.js",

@@ -67,5 +67,5 @@ "unpkg": "dist/vue-router.global.js",

"@rollup/plugin-commonjs": "^16.0.0",
"@rollup/plugin-node-resolve": "^11.0.0",
"@rollup/plugin-node-resolve": "^11.0.1",
"@rollup/plugin-replace": "^2.3.4",
"@types/jest": "^26.0.16",
"@types/jest": "^26.0.19",
"@types/jsdom": "^16.2.3",

@@ -75,10 +75,10 @@ "@types/webpack": "^4.41.25",

"@vue/compiler-sfc": "^3.0.3",
"@vue/devtools-api": "^6.0.0-beta.2",
"@vue/devtools-api": "^6.0.0-beta.3",
"@vue/server-renderer": "^3.0.3",
"algoliasearch": "^4.8.3",
"axios": "^0.21.0",
"axios": "^0.21.1",
"brotli": "^1.3.2",
"browserstack-local": "^1.4.5",
"chalk": "^4.1.0",
"chromedriver": "^87.0.2",
"chromedriver": "^87.0.4",
"codecov": "^3.8.0",

@@ -96,3 +96,3 @@ "conventional-changelog-cli": "^2.1.1",

"prettier": "^2.2.1",
"rollup": "^2.34.0",
"rollup": "^2.35.1",
"rollup-plugin-terser": "^7.0.2",

@@ -104,11 +104,11 @@ "rollup-plugin-typescript2": "^0.29.0",

"ts-jest": "^26.4.4",
"ts-loader": "^8.0.11",
"ts-node": "^9.0.0",
"typescript": "^4.1.2",
"ts-loader": "^8.0.12",
"ts-node": "^9.1.1",
"typescript": "^4.1.3",
"vitepress": "^0.8.1",
"vue": "^3.0.3",
"vue-loader": "^16.1.0",
"webpack": "^5.10.0",
"webpack-bundle-analyzer": "^4.2.0",
"webpack-cli": "^4.2.0",
"vue-loader": "^16.1.2",
"webpack": "^5.11.0",
"webpack-bundle-analyzer": "^4.3.0",
"webpack-cli": "^4.3.0",
"webpack-dev-server": "^3.11.0",

@@ -115,0 +115,0 @@ "yorkie": "^2.0.0"

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc