6 lines
28 KiB
JavaScript
6 lines
28 KiB
JavaScript
import"./vue.db505ee4.js";import{s as lt,u as ee,p as $,q as He,B as D,bv as ut,n as ft,d as De,h as qe,A as le,r as dt,w as ze,x as ht,f as pt}from"./@vue.cb43a243.js";/*!
|
|
* vue-router v4.0.12
|
|
* (c) 2021 Eduardo San Martin Morote
|
|
* @license MIT
|
|
*/const Ge=typeof Symbol=="function"&&typeof Symbol.toStringTag=="symbol",G=e=>Ge?Symbol(e):"_vr_"+e,mt=G("rvlm"),we=G("rvd"),te=G("r"),ve=G("rl"),he=G("rvl"),N=typeof window!="undefined";function gt(e){return e.__esModule||Ge&&e[Symbol.toStringTag]==="Module"}const A=Object.assign;function ue(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}const W=()=>{},vt=/\/$/,yt=e=>e.replace(vt,"");function fe(e,t,n="/"){let r,o={},u="",d="";const m=t.indexOf("?"),i=t.indexOf("#",m>-1?m:0);return m>-1&&(r=t.slice(0,m),u=t.slice(m+1,i>-1?i:t.length),o=e(u)),i>-1&&(r=r||t.slice(0,i),d=t.slice(i,t.length)),r=bt(r!=null?r:t,n),{fullPath:r+(u&&"?")+u+d,path:r,query:o,hash:d}}function Et(e,t){const n=t.query?e(t.query):"";return t.path+(n&&"?")+n+(t.hash||"")}function Ce(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||"/"}function Rt(e,t,n){const r=t.matched.length-1,o=n.matched.length-1;return r>-1&&r===o&&j(t.matched[r],n.matched[o])&&Ke(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}function j(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function Ke(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(!_t(e[n],t[n]))return!1;return!0}function _t(e,t){return Array.isArray(e)?Se(e,t):Array.isArray(t)?Se(t,e):e===t}function Se(e,t){return Array.isArray(t)?e.length===t.length&&e.every((n,r)=>n===t[r]):e.length===1&&e[0]===t}function bt(e,t){if(e.startsWith("/"))return e;if(!e)return t;const n=t.split("/"),r=e.split("/");let o=n.length-1,u,d;for(u=0;u<r.length;u++)if(d=r[u],!(o===1||d==="."))if(d==="..")o--;else break;return n.slice(0,o).join("/")+"/"+r.slice(u-(u===r.length?1:0)).join("/")}var X;(function(e){e.pop="pop",e.push="push"})(X||(X={}));var Q;(function(e){e.back="back",e.forward="forward",e.unknown=""})(Q||(Q={}));function At(e){if(!e)if(N){const t=document.querySelector("base");e=t&&t.getAttribute("href")||"/",e=e.replace(/^\w+:\/\/[^\/]+/,"")}else e="/";return e[0]!=="/"&&e[0]!=="#"&&(e="/"+e),yt(e)}const Pt=/^[^#]+#/;function wt(e,t){return e.replace(Pt,"#")+t}function Ct(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)}}const ne=()=>({left:window.pageXOffset,top:window.pageYOffset});function St(e){let t;if("el"in e){const n=e.el,r=typeof n=="string"&&n.startsWith("#"),o=typeof n=="string"?r?document.getElementById(n.slice(1)):document.querySelector(n):n;if(!o)return;t=Ct(o,e)}else t=e;"scrollBehavior"in document.documentElement.style?window.scrollTo(t):window.scrollTo(t.left!=null?t.left:window.pageXOffset,t.top!=null?t.top:window.pageYOffset)}function ke(e,t){return(history.state?history.state.position-t:-1)+e}const pe=new Map;function kt(e,t){pe.set(e,t)}function xt(e){const t=pe.get(e);return pe.delete(e),t}let Ot=()=>location.protocol+"//"+location.host;function Ve(e,t){const{pathname:n,search:r,hash:o}=t,u=e.indexOf("#");if(u>-1){let m=o.includes(e.slice(u))?e.slice(u).length:1,i=o.slice(m);return i[0]!=="/"&&(i="/"+i),Ce(i,"")}return Ce(n,e)+r+o}function It(e,t,n,r){let o=[],u=[],d=null;const m=({state:a})=>{const g=Ve(e,location),y=n.value,P=t.value;let w=0;if(a){if(n.value=g,t.value=a,d&&d===y){d=null;return}w=P?a.position-P.position:0}else r(g);o.forEach(b=>{b(n.value,y,{delta:w,type:X.pop,direction:w?w>0?Q.forward:Q.back:Q.unknown})})};function i(){d=n.value}function f(a){o.push(a);const g=()=>{const y=o.indexOf(a);y>-1&&o.splice(y,1)};return u.push(g),g}function s(){const{history:a}=window;!a.state||a.replaceState(A({},a.state,{scroll:ne()}),"")}function l(){for(const a of u)a();u=[],window.removeEventListener("popstate",m),window.removeEventListener("beforeunload",s)}return window.addEventListener("popstate",m),window.addEventListener("beforeunload",s),{pauseListeners:i,listen:f,destroy:l}}function xe(e,t,n,r=!1,o=!1){return{back:e,current:t,forward:n,replaced:r,position:window.history.length,scroll:o?ne():null}}function Tt(e){const{history:t,location:n}=window,r={value:Ve(e,n)},o={value:t.state};o.value||u(r.value,{back:null,current:r.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function u(i,f,s){const l=e.indexOf("#"),a=l>-1?(n.host&&document.querySelector("base")?e:e.slice(l))+i:Ot()+e+i;try{t[s?"replaceState":"pushState"](f,"",a),o.value=f}catch(g){console.error(g),n[s?"replace":"assign"](a)}}function d(i,f){const s=A({},t.state,xe(o.value.back,i,o.value.forward,!0),f,{position:o.value.position});u(i,s,!0),r.value=i}function m(i,f){const s=A({},o.value,t.state,{forward:i,scroll:ne()});u(s.current,s,!0);const l=A({},xe(r.value,i,null),{position:s.position+1},f);u(i,l,!1),r.value=i}return{location:r,state:o,push:m,replace:d}}function Nt(e){e=At(e);const t=Tt(e),n=It(e,t.state,t.location,t.replace);function r(u,d=!0){d||n.pauseListeners(),history.go(u)}const o=A({location:"",base:e,go:r,createHref:wt.bind(null,e)},t,n);return Object.defineProperty(o,"location",{enumerable:!0,get:()=>t.location.value}),Object.defineProperty(o,"state",{enumerable:!0,get:()=>t.state.value}),o}function In(e){return e=location.host?e||location.pathname+location.search:"",e.includes("#")||(e+="#"),Nt(e)}function $t(e){return typeof e=="string"||e&&typeof e=="object"}function Ue(e){return typeof e=="string"||typeof e=="symbol"}const M={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0},Fe=G("nf");var Oe;(function(e){e[e.aborted=4]="aborted",e[e.cancelled=8]="cancelled",e[e.duplicated=16]="duplicated"})(Oe||(Oe={}));function z(e,t){return A(new Error,{type:e,[Fe]:!0},t)}function H(e,t){return e instanceof Error&&Fe in e&&(t==null||!!(e.type&t))}const Ie="[^/]+?",Mt={sensitive:!1,strict:!1,start:!0,end:!0},Lt=/[.+*?^${}()[\]/\\]/g;function jt(e,t){const n=A({},Mt,t),r=[];let o=n.start?"^":"";const u=[];for(const f of e){const s=f.length?[]:[90];n.strict&&!f.length&&(o+="/");for(let l=0;l<f.length;l++){const a=f[l];let g=40+(n.sensitive?.25:0);if(a.type===0)l||(o+="/"),o+=a.value.replace(Lt,"\\$&"),g+=40;else if(a.type===1){const{value:y,repeatable:P,optional:w,regexp:b}=a;u.push({name:y,repeatable:P,optional:w});const R=b||Ie;if(R!==Ie){g+=10;try{new RegExp(`(${R})`)}catch(O){throw new Error(`Invalid custom RegExp for param "${y}" (${R}): `+O.message)}}let x=P?`((?:${R})(?:/(?:${R}))*)`:`(${R})`;l||(x=w&&f.length<2?`(?:/${x})`:"/"+x),w&&(x+="?"),o+=x,g+=20,w&&(g+=-8),P&&(g+=-20),R===".*"&&(g+=-50)}s.push(g)}r.push(s)}if(n.strict&&n.end){const f=r.length-1;r[f][r[f].length-1]+=.7000000000000001}n.strict||(o+="/?"),n.end?o+="$":n.strict&&(o+="(?:/|$)");const d=new RegExp(o,n.sensitive?"":"i");function m(f){const s=f.match(d),l={};if(!s)return null;for(let a=1;a<s.length;a++){const g=s[a]||"",y=u[a-1];l[y.name]=g&&y.repeatable?g.split("/"):g}return l}function i(f){let s="",l=!1;for(const a of e){(!l||!s.endsWith("/"))&&(s+="/"),l=!1;for(const g of a)if(g.type===0)s+=g.value;else if(g.type===1){const{value:y,repeatable:P,optional:w}=g,b=y in f?f[y]:"";if(Array.isArray(b)&&!P)throw new Error(`Provided param "${y}" is an array but it is not repeatable (* or + modifiers)`);const R=Array.isArray(b)?b.join("/"):b;if(!R)if(w)a.length<2&&(s.endsWith("/")?s=s.slice(0,-1):l=!0);else throw new Error(`Missing required param "${y}"`);s+=R}}return s}return{re:d,score:r,keys:u,parse:m,stringify:i}}function Bt(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?e.length===1&&e[0]===40+40?-1:1:e.length>t.length?t.length===1&&t[0]===40+40?1:-1:0}function Ht(e,t){let n=0;const r=e.score,o=t.score;for(;n<r.length&&n<o.length;){const u=Bt(r[n],o[n]);if(u)return u;n++}return o.length-r.length}const Dt={type:0,value:""},qt=/[a-zA-Z0-9_]/;function zt(e){if(!e)return[[]];if(e==="/")return[[Dt]];if(!e.startsWith("/"))throw new Error(`Invalid path "${e}"`);function t(g){throw new Error(`ERR (${n})/"${f}": ${g}`)}let n=0,r=n;const o=[];let u;function d(){u&&o.push(u),u=[]}let m=0,i,f="",s="";function l(){!f||(n===0?u.push({type:0,value:f}):n===1||n===2||n===3?(u.length>1&&(i==="*"||i==="+")&&t(`A repeatable param (${f}) must be alone in its segment. eg: '/:ids+.`),u.push({type:1,value:f,regexp:s,repeatable:i==="*"||i==="+",optional:i==="*"||i==="?"})):t("Invalid state to consume buffer"),f="")}function a(){f+=i}for(;m<e.length;){if(i=e[m++],i==="\\"&&n!==2){r=n,n=4;continue}switch(n){case 0:i==="/"?(f&&l(),d()):i===":"?(l(),n=1):a();break;case 4:a(),n=r;break;case 1:i==="("?n=2:qt.test(i)?a():(l(),n=0,i!=="*"&&i!=="?"&&i!=="+"&&m--);break;case 2:i===")"?s[s.length-1]=="\\"?s=s.slice(0,-1)+i:n=3:s+=i;break;case 3:l(),n=0,i!=="*"&&i!=="?"&&i!=="+"&&m--,s="";break;default:t("Unknown state");break}}return n===2&&t(`Unfinished custom RegExp for param "${f}"`),l(),d(),o}function Gt(e,t,n){const r=jt(zt(e.path),n),o=A(r,{record:e,parent:t,children:[],alias:[]});return t&&!o.record.aliasOf==!t.record.aliasOf&&t.children.push(o),o}function Kt(e,t){const n=[],r=new Map;t=Ne({strict:!1,end:!0,sensitive:!1},t);function o(s){return r.get(s)}function u(s,l,a){const g=!a,y=Ut(s);y.aliasOf=a&&a.record;const P=Ne(t,s),w=[y];if("alias"in s){const x=typeof s.alias=="string"?[s.alias]:s.alias;for(const O of x)w.push(A({},y,{components:a?a.record.components:y.components,path:O,aliasOf:a?a.record:y}))}let b,R;for(const x of w){const{path:O}=x;if(l&&O[0]!=="/"){const B=l.record.path,T=B[B.length-1]==="/"?"":"/";x.path=l.record.path+(O&&T+O)}if(b=Gt(x,l,P),a?a.alias.push(b):(R=R||b,R!==b&&R.alias.push(b),g&&s.name&&!Te(b)&&d(s.name)),"children"in y){const B=y.children;for(let T=0;T<B.length;T++)u(B[T],b,a&&a.children[T])}a=a||b,i(b)}return R?()=>{d(R)}:W}function d(s){if(Ue(s)){const l=r.get(s);l&&(r.delete(s),n.splice(n.indexOf(l),1),l.children.forEach(d),l.alias.forEach(d))}else{const l=n.indexOf(s);l>-1&&(n.splice(l,1),s.record.name&&r.delete(s.record.name),s.children.forEach(d),s.alias.forEach(d))}}function m(){return n}function i(s){let l=0;for(;l<n.length&&Ht(s,n[l])>=0;)l++;n.splice(l,0,s),s.record.name&&!Te(s)&&r.set(s.record.name,s)}function f(s,l){let a,g={},y,P;if("name"in s&&s.name){if(a=r.get(s.name),!a)throw z(1,{location:s});P=a.record.name,g=A(Vt(l.params,a.keys.filter(R=>!R.optional).map(R=>R.name)),s.params),y=a.stringify(g)}else if("path"in s)y=s.path,a=n.find(R=>R.re.test(y)),a&&(g=a.parse(y),P=a.record.name);else{if(a=l.name?r.get(l.name):n.find(R=>R.re.test(l.path)),!a)throw z(1,{location:s,currentLocation:l});P=a.record.name,g=A({},l.params,s.params),y=a.stringify(g)}const w=[];let b=a;for(;b;)w.unshift(b.record),b=b.parent;return{name:P,path:y,params:g,matched:w,meta:Wt(w)}}return e.forEach(s=>u(s)),{addRoute:u,resolve:f,removeRoute:d,getRoutes:m,getRecordMatcher:o}}function Vt(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}function Ut(e){return{path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:void 0,beforeEnter:e.beforeEnter,props:Ft(e),children:e.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in e?e.components||{}:{default:e.component}}}function Ft(e){const t={},n=e.props||!1;if("component"in e)t.default=n;else for(const r in e.components)t[r]=typeof n=="boolean"?n:n[r];return t}function Te(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function Wt(e){return e.reduce((t,n)=>A(t,n.meta),{})}function Ne(e,t){const n={};for(const r in e)n[r]=r in t?t[r]:e[r];return n}const We=/#/g,Qt=/&/g,Xt=/\//g,Yt=/=/g,Zt=/\?/g,Qe=/\+/g,Jt=/%5B/g,en=/%5D/g,Xe=/%5E/g,tn=/%60/g,Ye=/%7B/g,nn=/%7C/g,Ze=/%7D/g,rn=/%20/g;function ye(e){return encodeURI(""+e).replace(nn,"|").replace(Jt,"[").replace(en,"]")}function on(e){return ye(e).replace(Ye,"{").replace(Ze,"}").replace(Xe,"^")}function me(e){return ye(e).replace(Qe,"%2B").replace(rn,"+").replace(We,"%23").replace(Qt,"%26").replace(tn,"`").replace(Ye,"{").replace(Ze,"}").replace(Xe,"^")}function sn(e){return me(e).replace(Yt,"%3D")}function an(e){return ye(e).replace(We,"%23").replace(Zt,"%3F")}function cn(e){return e==null?"":an(e).replace(Xt,"%2F")}function Y(e){try{return decodeURIComponent(""+e)}catch{}return""+e}function ln(e){const t={};if(e===""||e==="?")return t;const r=(e[0]==="?"?e.slice(1):e).split("&");for(let o=0;o<r.length;++o){const u=r[o].replace(Qe," "),d=u.indexOf("="),m=Y(d<0?u:u.slice(0,d)),i=d<0?null:Y(u.slice(d+1));if(m in t){let f=t[m];Array.isArray(f)||(f=t[m]=[f]),f.push(i)}else t[m]=i}return t}function $e(e){let t="";for(let n in e){const r=e[n];if(n=sn(n),r==null){r!==void 0&&(t+=(t.length?"&":"")+n);continue}(Array.isArray(r)?r.map(u=>u&&me(u)):[r&&me(r)]).forEach(u=>{u!==void 0&&(t+=(t.length?"&":"")+n,u!=null&&(t+="="+u))})}return t}function un(e){const t={};for(const n in e){const r=e[n];r!==void 0&&(t[n]=Array.isArray(r)?r.map(o=>o==null?null:""+o):r==null?r:""+r)}return t}function U(){let e=[];function t(r){return e.push(r),()=>{const o=e.indexOf(r);o>-1&&e.splice(o,1)}}function n(){e=[]}return{add:t,list:()=>e,reset:n}}function L(e,t,n,r,o){const u=r&&(r.enterCallbacks[o]=r.enterCallbacks[o]||[]);return()=>new Promise((d,m)=>{const i=l=>{l===!1?m(z(4,{from:n,to:t})):l instanceof Error?m(l):$t(l)?m(z(2,{from:t,to:l})):(u&&r.enterCallbacks[o]===u&&typeof l=="function"&&u.push(l),d())},f=e.call(r&&r.instances[o],t,n,i);let s=Promise.resolve(f);e.length<3&&(s=s.then(i)),s.catch(l=>m(l))})}function de(e,t,n,r){const o=[];for(const u of e)for(const d in u.components){let m=u.components[d];if(!(t!=="beforeRouteEnter"&&!u.instances[d]))if(fn(m)){const f=(m.__vccOpts||m)[t];f&&o.push(L(f,n,r,u,d))}else{let i=m();o.push(()=>i.then(f=>{if(!f)return Promise.reject(new Error(`Couldn't resolve component "${d}" at "${u.path}"`));const s=gt(f)?f.default:f;u.components[d]=s;const a=(s.__vccOpts||s)[t];return a&&L(a,n,r,u,d)()}))}}return o}function fn(e){return typeof e=="object"||"displayName"in e||"props"in e||"__vccOpts"in e}function Me(e){const t=D(te),n=D(ve),r=$(()=>t.resolve(ee(e.to))),o=$(()=>{const{matched:i}=r.value,{length:f}=i,s=i[f-1],l=n.matched;if(!s||!l.length)return-1;const a=l.findIndex(j.bind(null,s));if(a>-1)return a;const g=Le(i[f-2]);return f>1&&Le(s)===g&&l[l.length-1].path!==g?l.findIndex(j.bind(null,i[f-2])):a}),u=$(()=>o.value>-1&&mn(n.params,r.value.params)),d=$(()=>o.value>-1&&o.value===n.matched.length-1&&Ke(n.params,r.value.params));function m(i={}){return pn(i)?t[ee(e.replace)?"replace":"push"](ee(e.to)).catch(W):Promise.resolve()}if(N){const i=ht();if(i){const f={route:r.value,isActive:u.value,isExactActive:d.value};i.__vrl_devtools=i.__vrl_devtools||[],i.__vrl_devtools.push(f),pt(()=>{f.route=r.value,f.isActive=u.value,f.isExactActive=d.value},{flush:"post"})}}return{route:r,href:$(()=>r.value.href),isActive:u,isExactActive:d,navigate:m}}const dn=De({name:"RouterLink",props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"}},useLink:Me,setup(e,{slots:t}){const n=He(Me(e)),{options:r}=D(te),o=$(()=>({[je(e.activeClass,r.linkActiveClass,"router-link-active")]:n.isActive,[je(e.exactActiveClass,r.linkExactActiveClass,"router-link-exact-active")]:n.isExactActive}));return()=>{const u=t.default&&t.default(n);return e.custom?u:qe("a",{"aria-current":n.isExactActive?e.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:o.value},u)}}}),hn=dn;function pn(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){const t=e.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(t))return}return e.preventDefault&&e.preventDefault(),!0}}function mn(e,t){for(const n in t){const r=t[n],o=e[n];if(typeof r=="string"){if(r!==o)return!1}else if(!Array.isArray(o)||o.length!==r.length||r.some((u,d)=>u!==o[d]))return!1}return!0}function Le(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const je=(e,t,n)=>e!=null?e:t!=null?t:n,gn=De({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},setup(e,{attrs:t,slots:n}){const r=D(he),o=$(()=>e.route||r.value),u=D(we,0),d=$(()=>o.value.matched[u]);le(we,u+1),le(mt,d),le(he,o);const m=dt();return ze(()=>[m.value,d.value,e.name],([i,f,s],[l,a,g])=>{f&&(f.instances[s]=i,a&&a!==f&&i&&i===l&&(f.leaveGuards.size||(f.leaveGuards=a.leaveGuards),f.updateGuards.size||(f.updateGuards=a.updateGuards))),i&&f&&(!a||!j(f,a)||!l)&&(f.enterCallbacks[s]||[]).forEach(y=>y(i))},{flush:"post"}),()=>{const i=o.value,f=d.value,s=f&&f.components[e.name],l=e.name;if(!s)return Be(n.default,{Component:s,route:i});const a=f.props[e.name],g=a?a===!0?i.params:typeof a=="function"?a(i):a:null,P=qe(s,A({},g,t,{onVnodeUnmounted:w=>{w.component.isUnmounted&&(f.instances[l]=null)},ref:m}));if(N&&P.ref){const w={depth:u,name:f.name,path:f.path,meta:f.meta};(Array.isArray(P.ref)?P.ref.map(R=>R.i):[P.ref.i]).forEach(R=>{R.__vrv_devtools=w})}return Be(n.default,{Component:P,route:i})||P}}});function Be(e,t){if(!e)return null;const n=e(t);return n.length===1?n[0]:n}const vn=gn;function F(e,t){const n=A({},e,{matched:e.matched.map(r=>Cn(r,["instances","children","aliasOf"]))});return{_custom:{type:null,readOnly:!0,display:e.fullPath,tooltip:t,value:n}}}function J(e){return{_custom:{display:e}}}let yn=0;function En(e,t,n){if(t.__hasDevtools)return;t.__hasDevtools=!0;const r=yn++;ut({id:"org.vuejs.router"+(r?"."+r:""),label:"Vue Router",packageName:"vue-router",homepage:"https://next.router.vuejs.org/",logo:"https://vuejs.org/images/icons/favicon-96x96.png",componentStateTypes:["Routing"],app:e},o=>{o.on.inspectComponent((s,l)=>{s.instanceData&&s.instanceData.state.push({type:"Routing",key:"$route",editable:!1,value:F(t.currentRoute.value,"Current Route")})}),o.on.visitComponentTree(({treeNode:s,componentInstance:l})=>{if(l.__vrv_devtools){const a=l.__vrv_devtools;s.tags.push({label:(a.name?`${a.name.toString()}: `:"")+a.path,textColor:0,tooltip:"This component is rendered by <router-view>",backgroundColor:Je})}Array.isArray(l.__vrl_devtools)&&(l.__devtoolsApi=o,l.__vrl_devtools.forEach(a=>{let g=nt,y="";a.isExactActive?(g=tt,y="This is exactly active"):a.isActive&&(g=et,y="This link is active"),s.tags.push({label:a.route.path,textColor:0,tooltip:y,backgroundColor:g})}))}),ze(t.currentRoute,()=>{i(),o.notifyComponentUpdate(),o.sendInspectorTree(m),o.sendInspectorState(m)});const u="router:navigations:"+r;o.addTimelineLayer({id:u,label:`Router${r?" "+r:""} Navigations`,color:4237508}),t.onError((s,l)=>{o.addTimelineEvent({layerId:u,event:{title:"Error during Navigation",subtitle:l.fullPath,logType:"error",time:Date.now(),data:{error:s},groupId:l.meta.__navigationId}})});let d=0;t.beforeEach((s,l)=>{const a={guard:J("beforeEach"),from:F(l,"Current Location during this navigation"),to:F(s,"Target location")};Object.defineProperty(s.meta,"__navigationId",{value:d++}),o.addTimelineEvent({layerId:u,event:{time:Date.now(),title:"Start of navigation",subtitle:s.fullPath,data:a,groupId:s.meta.__navigationId}})}),t.afterEach((s,l,a)=>{const g={guard:J("afterEach")};a?(g.failure={_custom:{type:Error,readOnly:!0,display:a?a.message:"",tooltip:"Navigation Failure",value:a}},g.status=J("\u274C")):g.status=J("\u2705"),g.from=F(l,"Current Location during this navigation"),g.to=F(s,"Target location"),o.addTimelineEvent({layerId:u,event:{title:"End of navigation",subtitle:s.fullPath,time:Date.now(),data:g,logType:a?"warning":"default",groupId:s.meta.__navigationId}})});const m="router-inspector:"+r;o.addInspector({id:m,label:"Routes"+(r?" "+r:""),icon:"book",treeFilterPlaceholder:"Search routes"});function i(){if(!f)return;const s=f;let l=n.getRoutes().filter(a=>!a.parent);l.forEach(st),s.filter&&(l=l.filter(a=>ge(a,s.filter.toLowerCase()))),l.forEach(a=>ot(a,t.currentRoute.value)),s.rootNodes=l.map(rt)}let f;o.on.getInspectorTree(s=>{f=s,s.app===e&&s.inspectorId===m&&i()}),o.on.getInspectorState(s=>{if(s.app===e&&s.inspectorId===m){const a=n.getRoutes().find(g=>g.record.__vd_id===s.nodeId);a&&(s.state={options:_n(a)})}}),o.sendInspectorTree(m),o.sendInspectorState(m)})}function Rn(e){return e.optional?e.repeatable?"*":"?":e.repeatable?"+":""}function _n(e){const{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(r=>`${r.name}${Rn(r)}`).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(r=>r.record.path)}),n.push({key:"score",editable:!1,value:{_custom:{type:null,readOnly:!0,display:e.score.map(r=>r.join(", ")).join(" | "),tooltip:"Score used to sort routes",value:e.score}}}),n}const Je=15485081,et=2450411,tt=8702998,bn=2282478,nt=16486972,An=6710886;function rt(e){const t=[],{record:n}=e;n.name!=null&&t.push({label:String(n.name),textColor:0,backgroundColor:bn}),n.aliasOf&&t.push({label:"alias",textColor:0,backgroundColor:nt}),e.__vd_match&&t.push({label:"matches",textColor:0,backgroundColor:Je}),e.__vd_exactActive&&t.push({label:"exact",textColor:0,backgroundColor:tt}),e.__vd_active&&t.push({label:"active",textColor:0,backgroundColor:et}),n.redirect&&t.push({label:"redirect: "+(typeof n.redirect=="string"?n.redirect:"Object"),textColor:16777215,backgroundColor:An});let r=n.__vd_id;return r==null&&(r=String(Pn++),n.__vd_id=r),{id:r,label:n.path,tags:t,children:e.children.map(rt)}}let Pn=0;const wn=/^\/(.*)\/([a-z]*)$/;function ot(e,t){const n=t.matched.length&&j(t.matched[t.matched.length-1],e.record);e.__vd_exactActive=e.__vd_active=n,n||(e.__vd_active=t.matched.some(r=>j(r,e.record))),e.children.forEach(r=>ot(r,t))}function st(e){e.__vd_match=!1,e.children.forEach(st)}function ge(e,t){const n=String(e.re).match(wn);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(d=>ge(d,t)),e.record.path!=="/"||t==="/"?(e.__vd_match=e.re.test(t),!0):!1;const o=e.record.path.toLowerCase(),u=Y(o);return!t.startsWith("/")&&(u.includes(t)||o.includes(t))||u.startsWith(t)||o.startsWith(t)||e.record.name&&String(e.record.name).includes(t)?!0:e.children.some(d=>ge(d,t))}function Cn(e,t){const n={};for(const r in e)t.includes(r)||(n[r]=e[r]);return n}function Tn(e){const t=Kt(e.routes,e),n=e.parseQuery||ln,r=e.stringifyQuery||$e,o=e.history,u=U(),d=U(),m=U(),i=lt(M);let f=M;N&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const s=ue.bind(null,c=>""+c),l=ue.bind(null,cn),a=ue.bind(null,Y);function g(c,p){let h,v;return Ue(c)?(h=t.getRecordMatcher(c),v=p):v=c,t.addRoute(v,h)}function y(c){const p=t.getRecordMatcher(c);p&&t.removeRoute(p)}function P(){return t.getRoutes().map(c=>c.record)}function w(c){return!!t.getRecordMatcher(c)}function b(c,p){if(p=A({},p||i.value),typeof c=="string"){const E=fe(n,c,p.path),k=t.resolve({path:E.path},p),V=o.createHref(E.fullPath);return A(E,k,{params:a(k.params),hash:Y(E.hash),redirectedFrom:void 0,href:V})}let h;if("path"in c)h=A({},c,{path:fe(n,c.path,p.path).path});else{const E=A({},c.params);for(const k in E)E[k]==null&&delete E[k];h=A({},c,{params:l(c.params)}),p.params=l(p.params)}const v=t.resolve(h,p),C=c.hash||"";v.params=s(a(v.params));const S=Et(r,A({},c,{hash:on(C),path:v.path})),_=o.createHref(S);return A({fullPath:S,hash:C,query:r===$e?un(c.query):c.query||{}},v,{redirectedFrom:void 0,href:_})}function R(c){return typeof c=="string"?fe(n,c,i.value.path):A({},c)}function x(c,p){if(f!==c)return z(8,{from:p,to:c})}function O(c){return K(c)}function B(c){return O(A(R(c),{replace:!0}))}function T(c){const p=c.matched[c.matched.length-1];if(p&&p.redirect){const{redirect:h}=p;let v=typeof h=="function"?h(c):h;return typeof v=="string"&&(v=v.includes("?")||v.includes("#")?v=R(v):{path:v},v.params={}),A({query:c.query,hash:c.hash,params:c.params},v)}}function K(c,p){const h=f=b(c),v=i.value,C=c.state,S=c.force,_=c.replace===!0,E=T(h);if(E)return K(A(R(E),{state:C,force:S,replace:_}),p||h);const k=h;k.redirectedFrom=p;let V;return!S&&Rt(r,v,h)&&(V=z(16,{to:k,from:v}),Pe(v,v,!0,!1)),(V?Promise.resolve(V):Ee(k,v)).catch(I=>H(I)?I:se(I,k,v)).then(I=>{if(I){if(H(I,2))return K(A(R(I.to),{state:C,force:S,replace:_}),p||k)}else I=_e(k,v,!0,_,C);return Re(k,v,I),I})}function at(c,p){const h=x(c,p);return h?Promise.reject(h):Promise.resolve()}function Ee(c,p){let h;const[v,C,S]=Sn(c,p);h=de(v.reverse(),"beforeRouteLeave",c,p);for(const E of v)E.leaveGuards.forEach(k=>{h.push(L(k,c,p))});const _=at.bind(null,c,p);return h.push(_),q(h).then(()=>{h=[];for(const E of u.list())h.push(L(E,c,p));return h.push(_),q(h)}).then(()=>{h=de(C,"beforeRouteUpdate",c,p);for(const E of C)E.updateGuards.forEach(k=>{h.push(L(k,c,p))});return h.push(_),q(h)}).then(()=>{h=[];for(const E of c.matched)if(E.beforeEnter&&!p.matched.includes(E))if(Array.isArray(E.beforeEnter))for(const k of E.beforeEnter)h.push(L(k,c,p));else h.push(L(E.beforeEnter,c,p));return h.push(_),q(h)}).then(()=>(c.matched.forEach(E=>E.enterCallbacks={}),h=de(S,"beforeRouteEnter",c,p),h.push(_),q(h))).then(()=>{h=[];for(const E of d.list())h.push(L(E,c,p));return h.push(_),q(h)}).catch(E=>H(E,8)?E:Promise.reject(E))}function Re(c,p,h){for(const v of m.list())v(c,p,h)}function _e(c,p,h,v,C){const S=x(c,p);if(S)return S;const _=p===M,E=N?history.state:{};h&&(v||_?o.replace(c.fullPath,A({scroll:_&&E&&E.scroll},C)):o.push(c.fullPath,C)),i.value=c,Pe(c,p,h,_),Ae()}let re;function it(){re=o.listen((c,p,h)=>{const v=b(c),C=T(v);if(C){K(A(C,{replace:!0}),v).catch(W);return}f=v;const S=i.value;N&&kt(ke(S.fullPath,h.delta),ne()),Ee(v,S).catch(_=>H(_,12)?_:H(_,2)?(K(_.to,v).then(E=>{H(E,20)&&!h.delta&&h.type===X.pop&&o.go(-1,!1)}).catch(W),Promise.reject()):(h.delta&&o.go(-h.delta,!1),se(_,v,S))).then(_=>{_=_||_e(v,S,!1),_&&(h.delta?o.go(-h.delta,!1):h.type===X.pop&&H(_,20)&&o.go(-1,!1)),Re(v,S,_)}).catch(W)})}let oe=U(),be=U(),Z;function se(c,p,h){Ae(c);const v=be.list();return v.length?v.forEach(C=>C(c,p,h)):console.error(c),Promise.reject(c)}function ct(){return Z&&i.value!==M?Promise.resolve():new Promise((c,p)=>{oe.add([c,p])})}function Ae(c){Z||(Z=!0,it(),oe.list().forEach(([p,h])=>c?h(c):p()),oe.reset())}function Pe(c,p,h,v){const{scrollBehavior:C}=e;if(!N||!C)return Promise.resolve();const S=!h&&xt(ke(c.fullPath,0))||(v||!h)&&history.state&&history.state.scroll||null;return ft().then(()=>C(c,p,S)).then(_=>_&&St(_)).catch(_=>se(_,c,p))}const ae=c=>o.go(c);let ie;const ce=new Set;return{currentRoute:i,addRoute:g,removeRoute:y,hasRoute:w,getRoutes:P,resolve:b,options:e,push:O,replace:B,go:ae,back:()=>ae(-1),forward:()=>ae(1),beforeEach:u.add,beforeResolve:d.add,afterEach:m.add,onError:be.add,isReady:ct,install(c){const p=this;c.component("RouterLink",hn),c.component("RouterView",vn),c.config.globalProperties.$router=p,Object.defineProperty(c.config.globalProperties,"$route",{enumerable:!0,get:()=>ee(i)}),N&&!ie&&i.value===M&&(ie=!0,O(o.location).catch(C=>{}));const h={};for(const C in M)h[C]=$(()=>i.value[C]);c.provide(te,p),c.provide(ve,He(h)),c.provide(he,i);const v=c.unmount;ce.add(c),c.unmount=function(){ce.delete(c),ce.size<1&&(f=M,re&&re(),i.value=M,ie=!1,Z=!1),v()},N&&En(c,p,t)}}}function q(e){return e.reduce((t,n)=>t.then(()=>n()),Promise.resolve())}function Sn(e,t){const n=[],r=[],o=[],u=Math.max(t.matched.length,e.matched.length);for(let d=0;d<u;d++){const m=t.matched[d];m&&(e.matched.find(f=>j(f,m))?r.push(m):n.push(m));const i=e.matched[d];i&&(t.matched.find(f=>j(f,i))||o.push(i))}return[n,r,o]}function Nn(){return D(te)}function $n(){return D(ve)}export{Nn as a,In as b,Tn as c,$n as u};
|