Forked from hermes-frontend, stripped openclaw/bun specifics: - Auth tokens: openclaw_session -> nyx_session - Vite proxy: localhost:3003 -> localhost:8000 (assay) - Prod WS: wss://assay.loop42.de/ws - Workspace paths: removed openclaw-specific paths - Added missing deps: @heroicons/vue, overlayscrollbars-vue - Branding: title -> nyx Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
23 lines
44 KiB
JavaScript
23 lines
44 KiB
JavaScript
/*!
|
|
* vue-router v5.0.3
|
|
* (c) 2026 Eduardo San Martin Morote
|
|
* @license MIT
|
|
*/
|
|
let e=require(`vue`),t=require(`@vue/devtools-api`);const n=typeof document<`u`;function r(e){return typeof e==`object`||`displayName`in e||`props`in e||`__vccOpts`in e}function i(e){return e.__esModule||e[Symbol.toStringTag]===`Module`||e.default&&r(e.default)}const a=Object.assign;function o(e,t){let n={};for(let r in t){let i=t[r];n[r]=c(i)?i.map(e):e(i)}return n}const s=()=>{},c=Array.isArray;function l(e,t){let n={};for(let r in e)n[r]=r in t?t[r]:e[r];return n}function u(e){let t=Array.from(arguments).slice(1);console.warn.apply(console,[`[Vue Router warn]: `+e].concat(t))}const d=/#/g,f=/&/g,p=/\//g,m=/=/g,h=/\?/g,g=/\+/g,_=/%5B/g,ee=/%5D/g,v=/%5E/g,te=/%60/g,ne=/%7B/g,re=/%7C/g,ie=/%7D/g,y=/%20/g;function b(e){return e==null?``:encodeURI(``+e).replace(re,`|`).replace(_,`[`).replace(ee,`]`)}function ae(e){return b(e).replace(ne,`{`).replace(ie,`}`).replace(v,`^`)}function x(e){return b(e).replace(g,`%2B`).replace(y,`+`).replace(d,`%23`).replace(f,`%26`).replace(te,"`").replace(ne,`{`).replace(ie,`}`).replace(v,`^`)}function S(e){return x(e).replace(m,`%3D`)}function oe(e){return b(e).replace(d,`%23`).replace(h,`%3F`)}function se(e){return oe(e).replace(p,`%2F`)}function C(e){if(e==null)return null;try{return decodeURIComponent(``+e)}catch{process.env.NODE_ENV!==`production`&&u(`Error decoding "${e}". Using original value`)}return``+e}const ce=/\/$/,w=e=>e.replace(ce,``);function le(e,t,n=`/`){let r,i={},a=``,o=``,s=t.indexOf(`#`),c=t.indexOf(`?`);return c=s>=0&&c>s?-1:c,c>=0&&(r=t.slice(0,c),a=t.slice(c,s>0?s:t.length),i=e(a.slice(1))),s>=0&&(r||=t.slice(0,s),o=t.slice(s,t.length)),r=O(r??t,n),{fullPath:r+a+o,path:r,query:i,hash:C(o)}}function ue(e,t){let n=t.query?e(t.query):``;return t.path+(n&&`?`)+n+(t.hash||``)}function de(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||`/`}function fe(e,t,n){let r=t.matched.length-1,i=n.matched.length-1;return r>-1&&r===i&&T(t.matched[r],n.matched[i])&&E(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}function T(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function E(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n in e)if(!pe(e[n],t[n]))return!1;return!0}function pe(e,t){return c(e)?D(e,t):c(t)?D(t,e):(e&&e.valueOf())===(t&&t.valueOf())}function D(e,t){return c(t)?e.length===t.length&&e.every((e,n)=>e===t[n]):e.length===1&&e[0]===t}function O(e,t){if(e.startsWith(`/`))return e;if(process.env.NODE_ENV!==`production`&&!t.startsWith(`/`))return u(`Cannot resolve a relative location without an absolute path. Trying to resolve "${e}" from "${t}". It should look like "/${t}".`),e;if(!e)return t;let n=t.split(`/`),r=e.split(`/`),i=r[r.length-1];(i===`..`||i===`.`)&&r.push(``);let a=n.length-1,o,s;for(o=0;o<r.length;o++)if(s=r[o],s!==`.`)if(s===`..`)a>1&&a--;else break;return n.slice(0,a).join(`/`)+`/`+r.slice(o).join(`/`)}const k={path:`/`,name:void 0,params:{},query:{},hash:``,fullPath:`/`,matched:[],meta:{},redirectedFrom:void 0};let A=function(e){return e.pop=`pop`,e.push=`push`,e}({}),j=function(e){return e.back=`back`,e.forward=`forward`,e.unknown=``,e}({});function M(e){if(!e)if(n){let t=document.querySelector(`base`);e=t&&t.getAttribute(`href`)||`/`,e=e.replace(/^\w+:\/\/[^\/]+/,``)}else e=`/`;return e[0]!==`/`&&e[0]!==`#`&&(e=`/`+e),w(e)}const me=/^[^#]+#/;function N(e,t){return e.replace(me,`#`)+t}function he(e,t){let 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)}}const ge=()=>({left:window.scrollX,top:window.scrollY});function _e(e){let t;if(`el`in e){let n=e.el,r=typeof n==`string`&&n.startsWith(`#`);if(process.env.NODE_ENV!==`production`&&typeof e.el==`string`&&(!r||!document.getElementById(e.el.slice(1))))try{let t=document.querySelector(e.el);if(r&&t){u(`The selector "${e.el}" should be passed as "el: document.querySelector('${e.el}')" because it starts with "#".`);return}}catch{u(`The selector "${e.el}" is invalid. If you are using an id selector, make sure to escape it. You can find more information about escaping characters in selectors at https://mathiasbynens.be/notes/css-escapes or use CSS.escape (https://developer.mozilla.org/en-US/docs/Web/API/CSS/escape).`);return}let i=typeof n==`string`?r?document.getElementById(n.slice(1)):document.querySelector(n):n;if(!i){process.env.NODE_ENV!==`production`&&u(`Couldn't find element using selector "${e.el}" returned by scrollBehavior.`);return}t=he(i,e)}else t=e;`scrollBehavior`in document.documentElement.style?window.scrollTo(t):window.scrollTo(t.left==null?window.scrollX:t.left,t.top==null?window.scrollY:t.top)}function ve(e,t){return(history.state?history.state.position-t:-1)+e}const ye=new Map;function be(e,t){ye.set(e,t)}function xe(e){let t=ye.get(e);return ye.delete(e),t}let P=()=>location.protocol+`//`+location.host;function F(e,t){let{pathname:n,search:r,hash:i}=t,a=e.indexOf(`#`);if(a>-1){let t=i.includes(e.slice(a))?e.slice(a).length:1,n=i.slice(t);return n[0]!==`/`&&(n=`/`+n),de(n,``)}return de(n,e)+r+i}function I(e,t,n,r){let i=[],o=[],s=null,c=({state:a})=>{let o=F(e,location),c=n.value,l=t.value,u=0;if(a){if(n.value=o,t.value=a,s&&s===c){s=null;return}u=l?a.position-l.position:0}else r(o);i.forEach(e=>{e(n.value,c,{delta:u,type:A.pop,direction:u?u>0?j.forward:j.back:j.unknown})})};function l(){s=n.value}function u(e){i.push(e);let t=()=>{let t=i.indexOf(e);t>-1&&i.splice(t,1)};return o.push(t),t}function d(){if(document.visibilityState===`hidden`){let{history:e}=window;if(!e.state)return;e.replaceState(a({},e.state,{scroll:ge()}),``)}}function f(){for(let e of o)e();o=[],window.removeEventListener(`popstate`,c),window.removeEventListener(`pagehide`,d),document.removeEventListener(`visibilitychange`,d)}return window.addEventListener(`popstate`,c),window.addEventListener(`pagehide`,d),document.addEventListener(`visibilitychange`,d),{pauseListeners:l,listen:u,destroy:f}}function L(e,t,n,r=!1,i=!1){return{back:e,current:t,forward:n,replaced:r,position:window.history.length,scroll:i?ge():null}}function R(e){let{history:t,location:n}=window,r={value:F(e,n)},i={value:t.state};i.value||o(r.value,{back:null,current:r.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function o(r,a,o){let s=e.indexOf(`#`),c=s>-1?(n.host&&document.querySelector(`base`)?e:e.slice(s))+r:P()+e+r;try{t[o?`replaceState`:`pushState`](a,``,c),i.value=a}catch(e){process.env.NODE_ENV===`production`?console.error(e):u(`Error with push/replace State`,e),n[o?`replace`:`assign`](c)}}function s(e,n){o(e,a({},t.state,L(i.value.back,e,i.value.forward,!0),n,{position:i.value.position}),!0),r.value=e}function c(e,n){let s=a({},i.value,t.state,{forward:e,scroll:ge()});process.env.NODE_ENV!==`production`&&!t.state&&u(`history.state seems to have been manually replaced without preserving the necessary values. Make sure to preserve existing history state if you are manually calling history.replaceState:
|
|
|
|
history.replaceState(history.state, '', url)
|
|
|
|
You can find more information at https://router.vuejs.org/guide/migration/#Usage-of-history-state`),o(s.current,s,!0),o(e,a({},L(r.value,e,null),{position:s.position+1},n),!1),r.value=e}return{location:r,state:i,push:c,replace:s}}function z(e){e=M(e);let t=R(e),n=I(e,t.state,t.location,t.replace);function r(e,t=!0){t||n.pauseListeners(),history.go(e)}let i=a({location:``,base:e,go:r,createHref:N.bind(null,e)},t,n);return Object.defineProperty(i,`location`,{enumerable:!0,get:()=>t.location.value}),Object.defineProperty(i,`state`,{enumerable:!0,get:()=>t.state.value}),i}function B(e=``){let t=[],n=[[``,{}]],r=0;e=M(e);function i(e,t={}){r++,r!==n.length&&n.splice(r),n.push([e,t])}function a(e,n,{direction:r,delta:i}){let a={direction:r,delta:i,type:A.pop};for(let r of t)r(e,n,a)}let o={location:``,state:{},base:e,createHref:N.bind(null,e),replace(e,t){n.splice(r--,1),i(e,t)},push(e,t){i(e,t)},listen(e){return t.push(e),()=>{let n=t.indexOf(e);n>-1&&t.splice(n,1)}},destroy(){t=[],n=[[``,{}]],r=0},go(e,t=!0){let i=this.location,o=e<0?j.back:j.forward;r=Math.max(0,Math.min(r+e,n.length-1)),t&&a(this.location,i,{direction:o,delta:e})}};return Object.defineProperty(o,`location`,{enumerable:!0,get:()=>n[r][0]}),Object.defineProperty(o,`state`,{enumerable:!0,get:()=>n[r][1]}),o}function Se(e){return e=location.host?e||location.pathname+location.search:``,e.includes(`#`)||(e+=`#`),process.env.NODE_ENV!==`production`&&!e.endsWith(`#/`)&&!e.endsWith(`#`)&&u(`A hash base must end with a "#":\n"${e}" should be "${e.replace(/#.*$/,`#`)}".`),z(e)}function V(e){return typeof e==`string`||e&&typeof e==`object`}function Ce(e){return typeof e==`string`||typeof e==`symbol`}let H=function(e){return e[e.MATCHER_NOT_FOUND=1]=`MATCHER_NOT_FOUND`,e[e.NAVIGATION_GUARD_REDIRECT=2]=`NAVIGATION_GUARD_REDIRECT`,e[e.NAVIGATION_ABORTED=4]=`NAVIGATION_ABORTED`,e[e.NAVIGATION_CANCELLED=8]=`NAVIGATION_CANCELLED`,e[e.NAVIGATION_DUPLICATED=16]=`NAVIGATION_DUPLICATED`,e}({});const we=Symbol(process.env.NODE_ENV===`production`?``:`navigation failure`);let Te=function(e){return e[e.aborted=4]=`aborted`,e[e.cancelled=8]=`cancelled`,e[e.duplicated=16]=`duplicated`,e}({});const Ee={[H.MATCHER_NOT_FOUND]({location:e,currentLocation:t}){return`No match for\n ${JSON.stringify(e)}${t?`
|
|
while being at
|
|
`+JSON.stringify(t):``}`},[H.NAVIGATION_GUARD_REDIRECT]({from:e,to:t}){return`Redirected from "${e.fullPath}" to "${Oe(t)}" via a navigation guard.`},[H.NAVIGATION_ABORTED]({from:e,to:t}){return`Navigation aborted from "${e.fullPath}" to "${t.fullPath}" via a navigation guard.`},[H.NAVIGATION_CANCELLED]({from:e,to:t}){return`Navigation cancelled from "${e.fullPath}" to "${t.fullPath}" with a new navigation.`},[H.NAVIGATION_DUPLICATED]({from:e,to:t}){return`Avoided redundant navigation to current location: "${e.fullPath}".`}};function U(e,t){if(process.env.NODE_ENV!==`production`||!0)return a(Error(Ee[e](t)),{type:e,[we]:!0},t)}function W(e,t){return e instanceof Error&&we in e&&(t==null||!!(e.type&t))}const De=[`params`,`query`,`hash`];function Oe(e){if(typeof e==`string`)return e;if(e.path!=null)return e.path;let t={};for(let n of De)n in e&&(t[n]=e[n]);return JSON.stringify(t,null,2)}let G=function(e){return e[e.Static=0]=`Static`,e[e.Param=1]=`Param`,e[e.Group=2]=`Group`,e}({});var K=function(e){return e[e.Static=0]=`Static`,e[e.Param=1]=`Param`,e[e.ParamRegExp=2]=`ParamRegExp`,e[e.ParamRegExpEnd=3]=`ParamRegExpEnd`,e[e.EscapeNext=4]=`EscapeNext`,e}(K||{});const ke={type:G.Static,value:``},Ae=/[a-zA-Z0-9_]/;function je(e){if(!e)return[[]];if(e===`/`)return[[ke]];if(!e.startsWith(`/`))throw Error(process.env.NODE_ENV===`production`?`Invalid path "${e}"`:`Route paths should start with a "/": "${e}" should be "/${e}".`);function t(e){throw Error(`ERR (${n})/"${l}": ${e}`)}let n=K.Static,r=n,i=[],a;function o(){a&&i.push(a),a=[]}let s=0,c,l=``,u=``;function d(){l&&=(n===K.Static?a.push({type:G.Static,value:l}):n===K.Param||n===K.ParamRegExp||n===K.ParamRegExpEnd?(a.length>1&&(c===`*`||c===`+`)&&t(`A repeatable param (${l}) must be alone in its segment. eg: '/:ids+.`),a.push({type:G.Param,value:l,regexp:u,repeatable:c===`*`||c===`+`,optional:c===`*`||c===`?`})):t(`Invalid state to consume buffer`),``)}function f(){l+=c}for(;s<e.length;){if(c=e[s++],c===`\\`&&n!==K.ParamRegExp){r=n,n=K.EscapeNext;continue}switch(n){case K.Static:c===`/`?(l&&d(),o()):c===`:`?(d(),n=K.Param):f();break;case K.EscapeNext:f(),n=r;break;case K.Param:c===`(`?n=K.ParamRegExp:Ae.test(c)?f():(d(),n=K.Static,c!==`*`&&c!==`?`&&c!==`+`&&s--);break;case K.ParamRegExp:c===`)`?u[u.length-1]==`\\`?u=u.slice(0,-1)+c:n=K.ParamRegExpEnd:u+=c;break;case K.ParamRegExpEnd:d(),n=K.Static,c!==`*`&&c!==`?`&&c!==`+`&&s--,u=``;break;default:t(`Unknown state`);break}}return n===K.ParamRegExp&&t(`Unfinished custom RegExp for param "${l}"`),d(),o(),i}const Me=`[^/]+?`,Ne={sensitive:!1,strict:!1,start:!0,end:!0};var q=function(e){return e[e._multiplier=10]=`_multiplier`,e[e.Root=90]=`Root`,e[e.Segment=40]=`Segment`,e[e.SubSegment=30]=`SubSegment`,e[e.Static=40]=`Static`,e[e.Dynamic=20]=`Dynamic`,e[e.BonusCustomRegExp=10]=`BonusCustomRegExp`,e[e.BonusWildcard=-50]=`BonusWildcard`,e[e.BonusRepeatable=-20]=`BonusRepeatable`,e[e.BonusOptional=-8]=`BonusOptional`,e[e.BonusStrict=.7000000000000001]=`BonusStrict`,e[e.BonusCaseSensitive=.25]=`BonusCaseSensitive`,e}(q||{});const Pe=/[.+*?^${}()[\]/\\]/g;function Fe(e,t){let n=a({},Ne,t),r=[],i=n.start?`^`:``,o=[];for(let t of e){let e=t.length?[]:[q.Root];n.strict&&!t.length&&(i+=`/`);for(let r=0;r<t.length;r++){let a=t[r],s=q.Segment+(n.sensitive?q.BonusCaseSensitive:0);if(a.type===G.Static)r||(i+=`/`),i+=a.value.replace(Pe,`\\$&`),s+=q.Static;else if(a.type===G.Param){let{value:e,repeatable:n,optional:c,regexp:l}=a;o.push({name:e,repeatable:n,optional:c});let u=l||Me;if(u!==Me){s+=q.BonusCustomRegExp;try{RegExp(`(${u})`)}catch(t){throw Error(`Invalid custom RegExp for param "${e}" (${u}): `+t.message)}}let d=n?`((?:${u})(?:/(?:${u}))*)`:`(${u})`;r||(d=c&&t.length<2?`(?:/${d})`:`/`+d),c&&(d+=`?`),i+=d,s+=q.Dynamic,c&&(s+=q.BonusOptional),n&&(s+=q.BonusRepeatable),u===`.*`&&(s+=q.BonusWildcard)}e.push(s)}r.push(e)}if(n.strict&&n.end){let e=r.length-1;r[e][r[e].length-1]+=q.BonusStrict}n.strict||(i+=`/?`),n.end?i+=`$`:n.strict&&!i.endsWith(`/`)&&(i+=`(?:/|$)`);let s=new RegExp(i,n.sensitive?``:`i`);function l(e){let t=e.match(s),n={};if(!t)return null;for(let e=1;e<t.length;e++){let r=t[e]||``,i=o[e-1];n[i.name]=r&&i.repeatable?r.split(`/`):r}return n}function u(t){let n=``,r=!1;for(let i of e){(!r||!n.endsWith(`/`))&&(n+=`/`),r=!1;for(let e of i)if(e.type===G.Static)n+=e.value;else if(e.type===G.Param){let{value:a,repeatable:o,optional:s}=e,l=a in t?t[a]:``;if(c(l)&&!o)throw Error(`Provided param "${a}" is an array but it is not repeatable (* or + modifiers)`);let u=c(l)?l.join(`/`):l;if(!u)if(s)i.length<2&&(n.endsWith(`/`)?n=n.slice(0,-1):r=!0);else throw Error(`Missing required param "${a}"`);n+=u}}return n||`/`}return{re:s,score:r,keys:o,parse:l,stringify:u}}function Ie(e,t){let n=0;for(;n<e.length&&n<t.length;){let r=t[n]-e[n];if(r)return r;n++}return e.length<t.length?e.length===1&&e[0]===q.Static+q.Segment?-1:1:e.length>t.length?t.length===1&&t[0]===q.Static+q.Segment?1:-1:0}function Le(e,t){let n=0,r=e.score,i=t.score;for(;n<r.length&&n<i.length;){let e=Ie(r[n],i[n]);if(e)return e;n++}if(Math.abs(i.length-r.length)===1){if(Re(r))return 1;if(Re(i))return-1}return i.length-r.length}function Re(e){let t=e[e.length-1];return e.length>0&&t[t.length-1]<0}const ze={strict:!1,end:!0,sensitive:!1};function Be(e,t,n){let r=Fe(je(e.path),n);if(process.env.NODE_ENV!==`production`){let t=new Set;for(let n of r.keys)t.has(n.name)&&u(`Found duplicated params with name "${n.name}" for path "${e.path}". Only the last one will be available on "$route.params".`),t.add(n.name)}let i=a(r,{record:e,parent:t,children:[],alias:[]});return t&&!i.record.aliasOf==!t.record.aliasOf&&t.children.push(i),i}function Ve(e,t){let n=[],r=new Map;t=l(ze,t);function i(e){return r.get(e)}function o(e,n,r){let i=!r,u=Ue(e);process.env.NODE_ENV!==`production`&&Ye(u,n),u.aliasOf=r&&r.record;let d=l(t,e),p=[u];if(`alias`in e){let t=typeof e.alias==`string`?[e.alias]:e.alias;for(let e of t)p.push(Ue(a({},u,{components:r?r.record.components:u.components,path:e,aliasOf:r?r.record:u})))}let m,h;for(let t of p){let{path:a}=t;if(n&&a[0]!==`/`){let e=n.record.path,r=e[e.length-1]===`/`?``:`/`;t.path=n.record.path+(a&&r+a)}if(process.env.NODE_ENV!==`production`&&t.path===`*`)throw Error(`Catch all routes ("*") must now be defined using a param with a custom regexp.
|
|
See more at https://router.vuejs.org/guide/migration/#Removed-star-or-catch-all-routes.`);if(m=Be(t,n,d),process.env.NODE_ENV!==`production`&&n&&a[0]===`/`&&Ze(m,n),r?(r.alias.push(m),process.env.NODE_ENV!==`production`&&Je(r,m)):(h||=m,h!==m&&h.alias.push(m),i&&e.name&&!Ge(m)&&(process.env.NODE_ENV!==`production`&&Xe(e,n),c(e.name))),et(m)&&f(m),u.children){let e=u.children;for(let t=0;t<e.length;t++)o(e[t],m,r&&r.children[t])}r||=m}return h?()=>{c(h)}:s}function c(e){if(Ce(e)){let t=r.get(e);t&&(r.delete(e),n.splice(n.indexOf(t),1),t.children.forEach(c),t.alias.forEach(c))}else{let t=n.indexOf(e);t>-1&&(n.splice(t,1),e.record.name&&r.delete(e.record.name),e.children.forEach(c),e.alias.forEach(c))}}function d(){return n}function f(e){let t=Qe(e,n);n.splice(t,0,e),e.record.name&&!Ge(e)&&r.set(e.record.name,e)}function p(e,t){let i,o={},s,c;if(`name`in e&&e.name){if(i=r.get(e.name),!i)throw U(H.MATCHER_NOT_FOUND,{location:e});if(process.env.NODE_ENV!==`production`){let t=Object.keys(e.params||{}).filter(e=>!i.keys.find(t=>t.name===e));t.length&&u(`Discarded invalid param(s) "${t.join(`", "`)}" when navigating. See https://github.com/vuejs/router/blob/main/packages/router/CHANGELOG.md#414-2022-08-22 for more details.`)}c=i.record.name,o=a(He(t.params,i.keys.filter(e=>!e.optional).concat(i.parent?i.parent.keys.filter(e=>e.optional):[]).map(e=>e.name)),e.params&&He(e.params,i.keys.map(e=>e.name))),s=i.stringify(o)}else if(e.path!=null)s=e.path,process.env.NODE_ENV!==`production`&&!s.startsWith(`/`)&&u(`The Matcher cannot resolve relative paths but received "${s}". Unless you directly called \`matcher.resolve("${s}")\`, this is probably a bug in vue-router. Please open an issue at https://github.com/vuejs/router/issues/new/choose.`),i=n.find(e=>e.re.test(s)),i&&(o=i.parse(s),c=i.record.name);else{if(i=t.name?r.get(t.name):n.find(e=>e.re.test(t.path)),!i)throw U(H.MATCHER_NOT_FOUND,{location:e,currentLocation:t});c=i.record.name,o=a({},t.params,e.params),s=i.stringify(o)}let l=[],d=i;for(;d;)l.unshift(d.record),d=d.parent;return{name:c,path:s,params:o,matched:l,meta:Ke(l)}}e.forEach(e=>o(e));function m(){n.length=0,r.clear()}return{addRoute:o,resolve:p,removeRoute:c,clearRoutes:m,getRoutes:d,getRecordMatcher:i}}function He(e,t){let n={};for(let r of t)r in e&&(n[r]=e[r]);return n}function Ue(e){let t={path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:e.aliasOf,beforeEnter:e.beforeEnter,props:We(e),children:e.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:`components`in e?e.components||null:e.component&&{default:e.component}};return Object.defineProperty(t,`mods`,{value:{}}),t}function We(e){let t={},n=e.props||!1;if(`component`in e)t.default=n;else for(let r in e.components)t[r]=typeof n==`object`?n[r]:n;return t}function Ge(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function Ke(e){return e.reduce((e,t)=>a(e,t.meta),{})}function qe(e,t){return e.name===t.name&&e.optional===t.optional&&e.repeatable===t.repeatable}function Je(e,t){for(let n of e.keys)if(!n.optional&&!t.keys.find(qe.bind(null,n)))return u(`Alias "${t.record.path}" and the original record: "${e.record.path}" must have the exact same param named "${n.name}"`);for(let n of t.keys)if(!n.optional&&!e.keys.find(qe.bind(null,n)))return u(`Alias "${t.record.path}" and the original record: "${e.record.path}" must have the exact same param named "${n.name}"`)}function Ye(e,t){t&&t.record.name&&!e.name&&!e.path&&e.children.length===0&&u(`The route named "${String(t.record.name)}" has a child without a name, an empty path, and no children. This is probably a mistake: using that name won't render the empty path child so you probably want to move the name to the child instead. If this is intentional, add a name to the child route to silence the warning.`)}function Xe(e,t){for(let n=t;n;n=n.parent)if(n.record.name===e.name)throw Error(`A route named "${String(e.name)}" has been added as a ${t===n?`child`:`descendant`} of a route with the same name. Route names must be unique and a nested route cannot use the same name as an ancestor.`)}function Ze(e,t){for(let n of t.keys)if(!e.keys.find(qe.bind(null,n)))return u(`Absolute path "${e.record.path}" must have the exact same param named "${n.name}" as its parent "${t.record.path}".`)}function Qe(e,t){let n=0,r=t.length;for(;n!==r;){let i=n+r>>1;Le(e,t[i])<0?r=i:n=i+1}let i=$e(e);return i&&(r=t.lastIndexOf(i,r-1),process.env.NODE_ENV!==`production`&&r<0&&u(`Finding ancestor route "${i.record.path}" failed for "${e.record.path}"`)),r}function $e(e){let t=e;for(;t=t.parent;)if(et(t)&&Le(e,t)===0)return t}function et({record:e}){return!!(e.name||e.components&&Object.keys(e.components).length||e.redirect)}function tt(e){let t={};if(e===``||e===`?`)return t;let n=(e[0]===`?`?e.slice(1):e).split(`&`);for(let e=0;e<n.length;++e){let r=n[e].replace(g,` `),i=r.indexOf(`=`),a=C(i<0?r:r.slice(0,i)),o=i<0?null:C(r.slice(i+1));if(a in t){let e=t[a];c(e)||(e=t[a]=[e]),e.push(o)}else t[a]=o}return t}function nt(e){let t=``;for(let n in e){let r=e[n];if(n=S(n),r==null){r!==void 0&&(t+=(t.length?`&`:``)+n);continue}(c(r)?r.map(e=>e&&x(e)):[r&&x(r)]).forEach(e=>{e!==void 0&&(t+=(t.length?`&`:``)+n,e!=null&&(t+=`=`+e))})}return t}function rt(e){let t={};for(let n in e){let r=e[n];r!==void 0&&(t[n]=c(r)?r.map(e=>e==null?null:``+e):r==null?r:``+r)}return t}const J=Symbol(process.env.NODE_ENV===`production`?``:`router view location matched`),it=Symbol(process.env.NODE_ENV===`production`?``:`router view depth`),Y=Symbol(process.env.NODE_ENV===`production`?``:`router`),X=Symbol(process.env.NODE_ENV===`production`?``:`route location`),at=Symbol(process.env.NODE_ENV===`production`?``:`router view location`);function Z(){let e=[];function t(t){return e.push(t),()=>{let n=e.indexOf(t);n>-1&&e.splice(n,1)}}function n(){e=[]}return{add:t,list:()=>e.slice(),reset:n}}function ot(t,n,r){let i=t.value;if(!i){process.env.NODE_ENV!==`production`&&u(`No active route record was found when calling \`${n===`updateGuards`?`onBeforeRouteUpdate`:`onBeforeRouteLeave`}()\`. Make sure you call this function inside a component child of <router-view>. Maybe you called it inside of App.vue?`);return}let a=i,o=()=>{a[n].delete(r)};(0,e.onUnmounted)(o),(0,e.onDeactivated)(o),(0,e.onActivated)(()=>{let e=t.value;process.env.NODE_ENV!==`production`&&!e&&u(`No active route record was found when reactivating component with navigation guard. This is likely a bug in vue-router. Please report it.`),e&&(a=e),a[n].add(r)}),a[n].add(r)}function st(t){if(process.env.NODE_ENV!==`production`&&!(0,e.getCurrentInstance)()){u(`getCurrentInstance() returned null. onBeforeRouteLeave() must be called at the top of a setup function`);return}ot((0,e.inject)(J,{}),`leaveGuards`,t)}function ct(t){if(process.env.NODE_ENV!==`production`&&!(0,e.getCurrentInstance)()){u(`getCurrentInstance() returned null. onBeforeRouteUpdate() must be called at the top of a setup function`);return}ot((0,e.inject)(J,{}),`updateGuards`,t)}function Q(e,t,n,r,i,a=e=>e()){let o=r&&(r.enterCallbacks[i]=r.enterCallbacks[i]||[]);return()=>new Promise((s,c)=>{let l=e=>{e===!1?c(U(H.NAVIGATION_ABORTED,{from:n,to:t})):e instanceof Error?c(e):V(e)?c(U(H.NAVIGATION_GUARD_REDIRECT,{from:t,to:e})):(o&&r.enterCallbacks[i]===o&&typeof e==`function`&&o.push(e),s())},d=a(()=>e.call(r&&r.instances[i],t,n,process.env.NODE_ENV===`production`?l:lt(ut(l,t,n)))),f=Promise.resolve(d);if(e.length<3&&(f=f.then(l)),process.env.NODE_ENV!==`production`&&e.length>2){let t=`The "next" callback was never called inside of ${e.name?`"`+e.name+`"`:``}:\n${e.toString()}\n. If you are returning a value instead of calling "next", make sure to remove the "next" parameter from your function.`;if(typeof d==`object`&&`then`in d)f=f.then(e=>l._called?e:(u(t),Promise.reject(Error(`Invalid navigation guard`))));else if(d!==void 0&&!l._called){u(t),c(Error(`Invalid navigation guard`));return}}f.catch(e=>c(e))})}function lt(e){let t=!1;return function(){return t||(t=!0,u("The `next()` callback in navigation guards is deprecated. Return the value instead of calling `next(value)`.")),e.apply(this,arguments)}}function ut(e,t,n){let r=0;return function(){r++===1&&u(`The "next" callback was called more than once in one navigation guard when going from "${n.fullPath}" to "${t.fullPath}". It should be called exactly one time in each navigation guard. This will fail in production.`),e._called=!0,r===1&&e.apply(null,arguments)}}function dt(e,t,n,a,o=e=>e()){let s=[];for(let c of e)for(let e in process.env.NODE_ENV!==`production`&&!c.components&&c.children&&!c.children.length&&u(`Record with path "${c.path}" is either missing a "component(s)" or "children" property.`),c.components){let l=c.components[e];if(process.env.NODE_ENV!==`production`){if(!l||typeof l!=`object`&&typeof l!=`function`)throw u(`Component "${e}" in record with path "${c.path}" is not a valid component. Received "${String(l)}".`),Error(`Invalid route component`);if(`then`in l){u(`Component "${e}" in record with path "${c.path}" is a Promise instead of a function that returns a Promise. Did you write "import('./MyPage.vue')" instead of "() => import('./MyPage.vue')" ? This will break in production if not fixed.`);let t=l;l=()=>t}else l.__asyncLoader&&!l.__warnedDefineAsync&&(l.__warnedDefineAsync=!0,u(`Component "${e}" in record with path "${c.path}" is defined using "defineAsyncComponent()". Write "() => import('./MyPage.vue')" instead of "defineAsyncComponent(() => import('./MyPage.vue'))".`))}if(!(t!==`beforeRouteEnter`&&!c.instances[e]))if(r(l)){let r=(l.__vccOpts||l)[t];r&&s.push(Q(r,n,a,c,e,o))}else{let r=l();process.env.NODE_ENV!==`production`&&!(`catch`in r)&&(u(`Component "${e}" in record with path "${c.path}" is a function that does not return a Promise. If you were passing a functional component, make sure to add a "displayName" to the component. This will break in production if not fixed.`),r=Promise.resolve(r)),s.push(()=>r.then(r=>{if(!r)throw Error(`Couldn't resolve component "${e}" at "${c.path}"`);let s=i(r)?r.default:r;c.mods[e]=r,c.components[e]=s;let l=(s.__vccOpts||s)[t];return l&&Q(l,n,a,c,e,o)()}))}}return s}function ft(e){return e.matched.every(e=>e.redirect)?Promise.reject(Error(`Cannot load a route that redirects.`)):Promise.all(e.matched.map(e=>e.components&&Promise.all(Object.keys(e.components).reduce((t,n)=>{let r=e.components[n];return typeof r==`function`&&!(`displayName`in r)&&t.push(r().then(t=>{if(!t)return Promise.reject(Error(`Couldn't resolve component "${n}" at "${e.path}". Ensure you passed a function that returns a promise.`));let r=i(t)?t.default:t;e.mods[n]=t,e.components[n]=r})),t},[])))).then(()=>e)}function pt(e,t){let n=[],r=[],i=[],a=Math.max(t.matched.length,e.matched.length);for(let o=0;o<a;o++){let a=t.matched[o];a&&(e.matched.find(e=>T(e,a))?r.push(a):n.push(a));let s=e.matched[o];s&&(t.matched.find(e=>T(e,s))||i.push(s))}return[n,r,i]}function mt(t){let r=(0,e.inject)(Y),i=(0,e.inject)(X),a=!1,o=null,c=(0,e.computed)(()=>{let n=(0,e.unref)(t.to);return process.env.NODE_ENV!==`production`&&(!a||n!==o)&&(V(n)||(a?u(`Invalid value for prop "to" in useLink()
|
|
- to:`,n,`
|
|
- previous to:`,o,`
|
|
- props:`,t):u(`Invalid value for prop "to" in useLink()
|
|
- to:`,n,`
|
|
- props:`,t)),o=n,a=!0),r.resolve(n)}),l=(0,e.computed)(()=>{let{matched:e}=c.value,{length:t}=e,n=e[t-1],r=i.matched;if(!n||!r.length)return-1;let a=r.findIndex(T.bind(null,n));if(a>-1)return a;let o=yt(e[t-2]);return t>1&&yt(n)===o&&r[r.length-1].path!==o?r.findIndex(T.bind(null,e[t-2])):a}),d=(0,e.computed)(()=>l.value>-1&&vt(i.params,c.value.params)),f=(0,e.computed)(()=>l.value>-1&&l.value===i.matched.length-1&&E(i.params,c.value.params));function p(n={}){if(_t(n)){let n=r[(0,e.unref)(t.replace)?`replace`:`push`]((0,e.unref)(t.to)).catch(s);return t.viewTransition&&typeof document<`u`&&`startViewTransition`in document&&document.startViewTransition(()=>n),n}return Promise.resolve()}if(process.env.NODE_ENV!==`production`&&n){let n=(0,e.getCurrentInstance)();if(n){let r={route:c.value,isActive:d.value,isExactActive:f.value,error:null};n.__vrl_devtools=n.__vrl_devtools||[],n.__vrl_devtools.push(r),(0,e.watchEffect)(()=>{r.route=c.value,r.isActive=d.value,r.isExactActive=f.value,r.error=V((0,e.unref)(t.to))?null:`Invalid "to" value`},{flush:`post`})}}return{route:c,href:(0,e.computed)(()=>c.value.href),isActive:d,isExactActive:f,navigate:p}}function ht(e){return e.length===1?e[0]:e}const gt=(0,e.defineComponent)({name:`RouterLink`,compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:`page`},viewTransition:Boolean},useLink:mt,setup(t,{slots:n}){let r=(0,e.reactive)(mt(t)),{options:i}=(0,e.inject)(Y),a=(0,e.computed)(()=>({[bt(t.activeClass,i.linkActiveClass,`router-link-active`)]:r.isActive,[bt(t.exactActiveClass,i.linkExactActiveClass,`router-link-exact-active`)]:r.isExactActive}));return()=>{let i=n.default&&ht(n.default(r));return t.custom?i:(0,e.h)(`a`,{"aria-current":r.isExactActive?t.ariaCurrentValue:null,href:r.href,onClick:r.navigate,class:a.value},i)}}});function _t(e){if(!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)&&!e.defaultPrevented&&!(e.button!==void 0&&e.button!==0)){if(e.currentTarget&&e.currentTarget.getAttribute){let t=e.currentTarget.getAttribute(`target`);if(/\b_blank\b/i.test(t))return}return e.preventDefault&&e.preventDefault(),!0}}function vt(e,t){for(let n in t){let r=t[n],i=e[n];if(typeof r==`string`){if(r!==i)return!1}else if(!c(i)||i.length!==r.length||r.some((e,t)=>e.valueOf()!==i[t].valueOf()))return!1}return!0}function yt(e){return e?e.aliasOf?e.aliasOf.path:e.path:``}const bt=(e,t,n)=>e??t??n,xt=(0,e.defineComponent)({name:`RouterView`,inheritAttrs:!1,props:{name:{type:String,default:`default`},route:Object},compatConfig:{MODE:3},setup(t,{attrs:r,slots:i}){process.env.NODE_ENV!==`production`&&wt();let o=(0,e.inject)(at),s=(0,e.computed)(()=>t.route||o.value),l=(0,e.inject)(it,0),u=(0,e.computed)(()=>{let t=(0,e.unref)(l),{matched:n}=s.value,r;for(;(r=n[t])&&!r.components;)t++;return t}),d=(0,e.computed)(()=>s.value.matched[u.value]);(0,e.provide)(it,(0,e.computed)(()=>u.value+1)),(0,e.provide)(J,d),(0,e.provide)(at,s);let f=(0,e.ref)();return(0,e.watch)(()=>[f.value,d.value,t.name],([e,t,n],[r,i,a])=>{t&&(t.instances[n]=e,i&&i!==t&&e&&e===r&&(t.leaveGuards.size||(t.leaveGuards=i.leaveGuards),t.updateGuards.size||(t.updateGuards=i.updateGuards))),e&&t&&(!i||!T(t,i)||!r)&&(t.enterCallbacks[n]||[]).forEach(t=>t(e))},{flush:`post`}),()=>{let o=s.value,l=t.name,p=d.value,m=p&&p.components[l];if(!m)return St(i.default,{Component:m,route:o});let h=p.props[l],g=h?h===!0?o.params:typeof h==`function`?h(o):h:null,_=(0,e.h)(m,a({},g,r,{onVnodeUnmounted:e=>{e.component.isUnmounted&&(p.instances[l]=null)},ref:f}));if(process.env.NODE_ENV!==`production`&&n&&_.ref){let e={depth:u.value,name:p.name,path:p.path,meta:p.meta};(c(_.ref)?_.ref.map(e=>e.i):[_.ref.i]).forEach(t=>{t.__vrv_devtools=e})}return St(i.default,{Component:_,route:o})||_}}});function St(e,t){if(!e)return null;let n=e(t);return n.length===1?n[0]:n}const Ct=xt;function wt(){let t=(0,e.getCurrentInstance)(),n=t.parent&&t.parent.type.name,r=t.parent&&t.parent.subTree&&t.parent.subTree.type;if(n&&(n===`KeepAlive`||n.includes(`Transition`))&&typeof r==`object`&&r.name===`RouterView`){let e=n===`KeepAlive`?`keep-alive`:`transition`;u(`<router-view> can no longer be used directly inside <transition> or <keep-alive>.
|
|
Use slot props instead:
|
|
|
|
<router-view v-slot="{ Component }">
|
|
<${e}>\n <component :is="Component" />\n </${e}>\n</router-view>`)}}function $(e,t){let n=a({},e,{matched:e.matched.map(e=>Ht(e,[`instances`,`children`,`aliasOf`]))});return{_custom:{type:null,readOnly:!0,display:e.fullPath,tooltip:t,value:n}}}function Tt(e){return{_custom:{display:e}}}let Et=0;function Dt(n,r,i){if(r.__hasDevtools)return;r.__hasDevtools=!0;let a=Et++;(0,t.setupDevtoolsPlugin)({id:`org.vuejs.router`+(a?`.`+a:``),label:`Vue Router`,packageName:`vue-router`,homepage:`https://router.vuejs.org`,logo:`https://router.vuejs.org/logo.png`,componentStateTypes:[`Routing`],app:n},t=>{t.on.inspectComponent(e=>{e.instanceData&&e.instanceData.state.push({type:`Routing`,key:`$route`,editable:!1,value:$(r.currentRoute.value,`Current Route`)})}),t.on.visitComponentTree(({treeNode:e,componentInstance:n})=>{if(n.__vrv_devtools){let t=n.__vrv_devtools;e.tags.push({label:(t.name?`${t.name.toString()}: `:``)+t.path,textColor:0,tooltip:`This component is rendered by <router-view>`,backgroundColor:At})}c(n.__vrl_devtools)&&(n.__devtoolsApi=t,n.__vrl_devtools.forEach(t=>{let n=t.route.path,r=Nt,i=``,a=0;t.error?(n=t.error,r=Pt,a=Ft):t.isExactActive?(r=Mt,i=`This is exactly active`):t.isActive&&(r=jt,i=`This link is active`),e.tags.push({label:n,textColor:a,tooltip:i,backgroundColor:r})}))}),(0,e.watch)(r.currentRoute,()=>{u(),t.notifyComponentUpdate(),t.sendInspectorTree(l),t.sendInspectorState(l)});let o=`router:navigations:`+a;t.addTimelineLayer({id:o,label:`Router${a?` `+a:``} Navigations`,color:4237508}),r.onError((e,n)=>{t.addTimelineEvent({layerId:o,event:{title:`Error during Navigation`,subtitle:n.fullPath,logType:`error`,time:t.now(),data:{error:e},groupId:n.meta.__navigationId}})});let s=0;r.beforeEach((e,n)=>{let r={guard:Tt(`beforeEach`),from:$(n,`Current Location during this navigation`),to:$(e,`Target location`)};Object.defineProperty(e.meta,`__navigationId`,{value:s++}),t.addTimelineEvent({layerId:o,event:{time:t.now(),title:`Start of navigation`,subtitle:e.fullPath,data:r,groupId:e.meta.__navigationId}})}),r.afterEach((e,n,r)=>{let i={guard:Tt(`afterEach`)};r?(i.failure={_custom:{type:Error,readOnly:!0,display:r?r.message:``,tooltip:`Navigation Failure`,value:r}},i.status=Tt(`❌`)):i.status=Tt(`✅`),i.from=$(n,`Current Location during this navigation`),i.to=$(e,`Target location`),t.addTimelineEvent({layerId:o,event:{title:`End of navigation`,subtitle:e.fullPath,time:t.now(),data:i,logType:r?`warning`:`default`,groupId:e.meta.__navigationId}})});let l=`router-inspector:`+a;t.addInspector({id:l,label:`Routes`+(a?` `+a:``),icon:`book`,treeFilterPlaceholder:`Search routes`});function u(){if(!d)return;let e=d,t=i.getRoutes().filter(e=>!e.parent||!e.parent.record.components);t.forEach(Bt),e.filter&&(t=t.filter(t=>Vt(t,e.filter.toLowerCase()))),t.forEach(e=>zt(e,r.currentRoute.value)),e.rootNodes=t.map(It)}let d;t.on.getInspectorTree(e=>{d=e,e.app===n&&e.inspectorId===l&&u()}),t.on.getInspectorState(e=>{if(e.app===n&&e.inspectorId===l){let t=i.getRoutes().find(t=>t.record.__vd_id===e.nodeId);t&&(e.state={options:kt(t)})}}),t.sendInspectorTree(l),t.sendInspectorState(l)})}function Ot(e){return e.optional?e.repeatable?`*`:`?`:e.repeatable?`+`:``}function kt(e){let{record:t}=e,n=[{editable:!1,key:`path`,value:t.path}];return t.name!=null&&n.push({editable:!1,key:`name`,value:t.name}),n.push({editable:!1,key:`regexp`,value:e.re}),e.keys.length&&n.push({editable:!1,key:`keys`,value:{_custom:{type:null,readOnly:!0,display:e.keys.map(e=>`${e.name}${Ot(e)}`).join(` `),tooltip:`Param keys`,value:e.keys}}}),t.redirect!=null&&n.push({editable:!1,key:`redirect`,value:t.redirect}),e.alias.length&&n.push({editable:!1,key:`aliases`,value:e.alias.map(e=>e.record.path)}),Object.keys(e.record.meta).length&&n.push({editable:!1,key:`meta`,value:e.record.meta}),n.push({key:`score`,editable:!1,value:{_custom:{type:null,readOnly:!0,display:e.score.map(e=>e.join(`, `)).join(` | `),tooltip:`Score used to sort routes`,value:e.score}}}),n}const At=15485081,jt=2450411,Mt=8702998,Nt=16486972,Pt=16704226,Ft=12131356;function It(e){let t=[],{record:n}=e;n.name!=null&&t.push({label:String(n.name),textColor:0,backgroundColor:2282478}),n.aliasOf&&t.push({label:`alias`,textColor:0,backgroundColor:Nt}),e.__vd_match&&t.push({label:`matches`,textColor:0,backgroundColor:At}),e.__vd_exactActive&&t.push({label:`exact`,textColor:0,backgroundColor:Mt}),e.__vd_active&&t.push({label:`active`,textColor:0,backgroundColor:jt}),n.redirect&&t.push({label:typeof n.redirect==`string`?`redirect: ${n.redirect}`:`redirects`,textColor:16777215,backgroundColor:6710886});let r=n.__vd_id;return r??(r=String(Lt++),n.__vd_id=r),{id:r,label:n.path,tags:t,children:e.children.map(It)}}let Lt=0;const Rt=/^\/(.*)\/([a-z]*)$/;function zt(e,t){let n=t.matched.length&&T(t.matched[t.matched.length-1],e.record);e.__vd_exactActive=e.__vd_active=n,n||(e.__vd_active=t.matched.some(t=>T(t,e.record))),e.children.forEach(e=>zt(e,t))}function Bt(e){e.__vd_match=!1,e.children.forEach(Bt)}function Vt(e,t){let n=String(e.re).match(Rt);if(e.__vd_match=!1,!n||n.length<3)return!1;if(new RegExp(n[1].replace(/\$$/,``),n[2]).test(t))return e.children.forEach(e=>Vt(e,t)),e.record.path!==`/`||t===`/`?(e.__vd_match=e.re.test(t),!0):!1;let r=e.record.path.toLowerCase(),i=C(r);return!t.startsWith(`/`)&&(i.includes(t)||r.includes(t))||i.startsWith(t)||r.startsWith(t)||e.record.name&&String(e.record.name).includes(t)?!0:e.children.some(e=>Vt(e,t))}function Ht(e,t){let n={};for(let r in e)t.includes(r)||(n[r]=e[r]);return n}function Ut(t){let r=Ve(t.routes,t),i=t.parseQuery||tt,l=t.stringifyQuery||nt,d=t.history;if(process.env.NODE_ENV!==`production`&&!d)throw Error(`Provide the "history" option when calling "createRouter()": https://router.vuejs.org/api/interfaces/RouterOptions.html#history`);let f=Z(),p=Z(),m=Z(),h=(0,e.shallowRef)(k),g=k;n&&t.scrollBehavior&&`scrollRestoration`in history&&(history.scrollRestoration=`manual`);let _=o.bind(null,e=>``+e),ee=o.bind(null,se),v=o.bind(null,C);function te(e,t){let n,i;return Ce(e)?(n=r.getRecordMatcher(e),process.env.NODE_ENV!==`production`&&!n&&u(`Parent route "${String(e)}" not found when adding child route`,t),i=t):i=e,r.addRoute(i,n)}function ne(e){let t=r.getRecordMatcher(e);t?r.removeRoute(t):process.env.NODE_ENV!==`production`&&u(`Cannot remove non-existent route "${String(e)}"`)}function re(){return r.getRoutes().map(e=>e.record)}function ie(e){return!!r.getRecordMatcher(e)}function y(e,t){if(t=a({},t||h.value),typeof e==`string`){let n=le(i,e,t.path),o=r.resolve({path:n.path},t),s=d.createHref(n.fullPath);return process.env.NODE_ENV!==`production`&&(s.startsWith(`//`)?u(`Location "${e}" resolved to "${s}". A resolved location cannot start with multiple slashes.`):o.matched.length||u(`No match found for location with path "${e}"`)),a(n,o,{params:v(o.params),hash:C(n.hash),redirectedFrom:void 0,href:s})}if(process.env.NODE_ENV!==`production`&&!V(e))return u(`router.resolve() was passed an invalid location. This will fail in production.
|
|
- Location:`,e),y({});let n;if(e.path!=null)process.env.NODE_ENV!==`production`&&`params`in e&&!(`name`in e)&&Object.keys(e.params).length&&u(`Path "${e.path}" was passed with params but they will be ignored. Use a named route alongside params instead.`),n=a({},e,{path:le(i,e.path,t.path).path});else{let r=a({},e.params);for(let e in r)r[e]??delete r[e];n=a({},e,{params:ee(r)}),t.params=ee(t.params)}let o=r.resolve(n,t),s=e.hash||``;process.env.NODE_ENV!==`production`&&s&&!s.startsWith(`#`)&&u(`A \`hash\` should always start with the character "#". Replace "${s}" with "#${s}".`),o.params=_(v(o.params));let c=ue(l,a({},e,{hash:ae(s),path:o.path})),f=d.createHref(c);return process.env.NODE_ENV!==`production`&&(f.startsWith(`//`)?u(`Location "${e}" resolved to "${f}". A resolved location cannot start with multiple slashes.`):o.matched.length||u(`No match found for location with path "${e.path==null?e:e.path}"`)),a({fullPath:c,hash:s,query:l===nt?rt(e.query):e.query||{}},o,{redirectedFrom:void 0,href:f})}function b(e){return typeof e==`string`?le(i,e,h.value.path):a({},e)}function x(e,t){if(g!==e)return U(H.NAVIGATION_CANCELLED,{from:t,to:e})}function S(e){return w(e)}function oe(e){return S(a(b(e),{replace:!0}))}function ce(e,t){let n=e.matched[e.matched.length-1];if(n&&n.redirect){let{redirect:r}=n,i=typeof r==`function`?r(e,t):r;if(typeof i==`string`&&(i=i.includes(`?`)||i.includes(`#`)?i=b(i):{path:i},i.params={}),process.env.NODE_ENV!==`production`&&i.path==null&&!(`name`in i))throw u(`Invalid redirect found:\n${JSON.stringify(i,null,2)}\n when navigating to "${e.fullPath}". A redirect must contain a name or path. This will break in production.`),Error(`Invalid redirect`);return a({query:e.query,hash:e.hash,params:i.path==null?e.params:{}},i)}}function w(e,t){let n=g=y(e),r=h.value,i=e.state,o=e.force,s=e.replace===!0,c=ce(n,r);if(c)return w(a(b(c),{state:typeof c==`object`?a({},i,c.state):i,force:o,replace:s}),t||n);let d=n;d.redirectedFrom=t;let f;return!o&&fe(l,r,n)&&(f=U(H.NAVIGATION_DUPLICATED,{to:d,from:r}),F(r,r,!0,!1)),(f?Promise.resolve(f):E(d,r)).catch(e=>W(e)?W(e,H.NAVIGATION_GUARD_REDIRECT)?e:P(e):he(e,d,r)).then(e=>{if(e){if(W(e,H.NAVIGATION_GUARD_REDIRECT))return process.env.NODE_ENV!==`production`&&fe(l,y(e.to),d)&&t&&(t._count=t._count?t._count+1:1)>30?(u(`Detected a possibly infinite redirection in a navigation guard when going from "${r.fullPath}" to "${d.fullPath}". Aborting to avoid a Stack Overflow.\n Are you always returning a new location within a navigation guard? That would lead to this error. Only return when redirecting or aborting, that should fix this. This might break in production if not fixed.`),Promise.reject(Error(`Infinite redirect in navigation guard`))):w(a({replace:s},b(e.to),{state:typeof e.to==`object`?a({},i,e.to.state):i,force:o}),t||d)}else e=D(d,r,!0,s,i);return pe(d,r,e),e})}function de(e,t){let n=x(e,t);return n?Promise.reject(n):Promise.resolve()}function T(e){let t=R.values().next().value;return t&&typeof t.runWithContext==`function`?t.runWithContext(e):e()}function E(e,t){let n,[r,i,a]=pt(e,t);n=dt(r.reverse(),`beforeRouteLeave`,e,t);for(let i of r)i.leaveGuards.forEach(r=>{n.push(Q(r,e,t))});let o=de.bind(null,e,t);return n.push(o),B(n).then(()=>{n=[];for(let r of f.list())n.push(Q(r,e,t));return n.push(o),B(n)}).then(()=>{n=dt(i,`beforeRouteUpdate`,e,t);for(let r of i)r.updateGuards.forEach(r=>{n.push(Q(r,e,t))});return n.push(o),B(n)}).then(()=>{n=[];for(let r of a)if(r.beforeEnter)if(c(r.beforeEnter))for(let i of r.beforeEnter)n.push(Q(i,e,t));else n.push(Q(r.beforeEnter,e,t));return n.push(o),B(n)}).then(()=>(e.matched.forEach(e=>e.enterCallbacks={}),n=dt(a,`beforeRouteEnter`,e,t,T),n.push(o),B(n))).then(()=>{n=[];for(let r of p.list())n.push(Q(r,e,t));return n.push(o),B(n)}).catch(e=>W(e,H.NAVIGATION_CANCELLED)?e:Promise.reject(e))}function pe(e,t,n){m.list().forEach(r=>T(()=>r(e,t,n)))}function D(e,t,r,i,o){let s=x(e,t);if(s)return s;let c=t===k,l=n?history.state:{};r&&(i||c?d.replace(e.fullPath,a({scroll:c&&l&&l.scroll},o)):d.push(e.fullPath,o)),h.value=e,F(e,t,r,c),P()}let O;function j(){O||=d.listen((e,t,r)=>{if(!z.listening)return;let i=y(e),o=ce(i,z.currentRoute.value);if(o){w(a(o,{replace:!0,force:!0}),i).catch(s);return}g=i;let c=h.value;n&&be(ve(c.fullPath,r.delta),ge()),E(i,c).catch(e=>W(e,H.NAVIGATION_ABORTED|H.NAVIGATION_CANCELLED)?e:W(e,H.NAVIGATION_GUARD_REDIRECT)?(w(a(b(e.to),{force:!0}),i).then(e=>{W(e,H.NAVIGATION_ABORTED|H.NAVIGATION_DUPLICATED)&&!r.delta&&r.type===A.pop&&d.go(-1,!1)}).catch(s),Promise.reject()):(r.delta&&d.go(-r.delta,!1),he(e,i,c))).then(e=>{e||=D(i,c,!1),e&&(r.delta&&!W(e,H.NAVIGATION_CANCELLED)?d.go(-r.delta,!1):r.type===A.pop&&W(e,H.NAVIGATION_ABORTED|H.NAVIGATION_DUPLICATED)&&d.go(-1,!1)),pe(i,c,e)}).catch(s)})}let M=Z(),me=Z(),N;function he(e,t,n){P(e);let r=me.list();return r.length?r.forEach(r=>r(e,t,n)):(process.env.NODE_ENV!==`production`&&u(`uncaught error during route navigation:`),console.error(e)),Promise.reject(e)}function ye(){return N&&h.value!==k?Promise.resolve():new Promise((e,t)=>{M.add([e,t])})}function P(e){return N||(N=!e,j(),M.list().forEach(([t,n])=>e?n(e):t()),M.reset()),e}function F(r,i,a,o){let{scrollBehavior:s}=t;if(!n||!s)return Promise.resolve();let c=!a&&xe(ve(r.fullPath,0))||(o||!a)&&history.state&&history.state.scroll||null;return(0,e.nextTick)().then(()=>s(r,i,c)).then(e=>e&&_e(e)).catch(e=>he(e,r,i))}let I=e=>d.go(e),L,R=new Set,z={currentRoute:h,listening:!0,addRoute:te,removeRoute:ne,clearRoutes:r.clearRoutes,hasRoute:ie,getRoutes:re,resolve:y,options:t,push:S,replace:oe,go:I,back:()=>I(-1),forward:()=>I(1),beforeEach:f.add,beforeResolve:p.add,afterEach:m.add,onError:me.add,isReady:ye,install(t){t.component(`RouterLink`,gt),t.component(`RouterView`,Ct),t.config.globalProperties.$router=z,Object.defineProperty(t.config.globalProperties,`$route`,{enumerable:!0,get:()=>(0,e.unref)(h)}),n&&!L&&h.value===k&&(L=!0,S(d.location).catch(e=>{process.env.NODE_ENV!==`production`&&u(`Unexpected error when starting the router:`,e)}));let i={};for(let e in k)Object.defineProperty(i,e,{get:()=>h.value[e],enumerable:!0});t.provide(Y,z),t.provide(X,(0,e.shallowReactive)(i)),t.provide(at,h);let a=t.unmount;R.add(t),t.unmount=function(){R.delete(t),R.size<1&&(g=k,O&&O(),O=null,h.value=k,L=!1,N=!1),a()},process.env.NODE_ENV!==`production`&&n&&Dt(t,z,r)}};function B(e){return e.reduce((e,t)=>e.then(()=>T(t)),Promise.resolve())}return z}function Wt(){return(0,e.inject)(Y)}function Gt(t){return(0,e.inject)(X)}exports.NavigationFailureType=Te,exports.RouterLink=gt,exports.RouterView=Ct,exports.START_LOCATION=k,exports.createMemoryHistory=B,exports.createRouter=Ut,exports.createRouterMatcher=Ve,exports.createWebHashHistory=Se,exports.createWebHistory=z,exports.isNavigationFailure=W,exports.loadRouteLocation=ft,exports.matchedRouteKey=J,exports.onBeforeRouteLeave=st,exports.onBeforeRouteUpdate=ct,exports.parseQuery=tt,exports.routeLocationKey=X,exports.routerKey=Y,exports.routerViewLocationKey=at,exports.stringifyQuery=nt,exports.useLink=mt,exports.useRoute=Gt,exports.useRouter=Wt,exports.viewDepthKey=it; |