You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 line
22 KiB
1 line
22 KiB
3 months ago
|
var VueRouter=function(e,M){"use strict";const s="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag,t=e=>s?Symbol(e):"_vr_"+e,n=t("rvlm"),r=t("rvd"),_=t("r"),T=t("rl"),B=t("rvl"),G="undefined"!=typeof window,F=Object.assign;function I(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 K=()=>{},o=/\/$/;function U(e,t,n="/"){let r,o={},a="",i="";var c=t.indexOf("?"),s=t.indexOf("#",-1<c?c:0);return-1<c&&(r=t.slice(0,c),a=t.slice(c+1,-1<s?s:t.length),o=e(a)),-1<s&&(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 i(e,t){return t&&e.toLowerCase().startsWith(t.toLowerCase())?e.slice(t.length)||"/":e}function V(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function H(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const o in e)if(n=e[o],r=t[o],!(Array.isArray(n)?a(n,r):Array.isArray(r)?a(r,n):n===r))return!1;var n,r;return!0}function a(e,n){return Array.isArray(n)?e.length===n.length&&e.every((e,t)=>e===n[t]):1===e.length&&e[0]===n}var W,f,c;function l(e){if(!e)if(G){const t=document.querySelector("base");e=(e=t&&t.getAttribute("href")||"/").replace(/^\w+:\/\/[^\/]+/,"")}else e="/";return(e="/"!==e[0]&&"#"!==e[0]?"/"+e:e).replace(o,"")}(c=W=W||{}).pop="pop",c.push="push",(c=f=f||{}).back="back",c.forward="forward",c.unknown="";const u=/^[^#]+#/;function p(e,t){return e.replace(u,"#")+t}const D=()=>({left:window.pageXOffset,top:window.pageYOffset});function N(e,t){return(history.state?history.state.position-t:-1)+e}const z=new Map;function h(n,e){const{pathname:t,search:r,hash:o}=e,a=n.indexOf("#");if(-1<a){let e=o.includes(n.slice(a))?n.slice(a).length:1,t=o.slice(e);return"/"!==t[0]&&(t="/"+t),i(t,"")}return i(t,n)+r+o}function d(e,t,n,r=!1,o=!1){return{back:e,current:t,forward:n,replaced:r,position:window.history.length,scroll:o?D():null}}function m(e){const t=function(o){const{history:a,location:i}=window,r={value:h(o,i)},c={value:a.state};function s(t,e,n){var r=o.indexOf("#"),t=-1<r?(i.host&&document.querySelector("base")?o:o.slice(r))+t:location.protocol+"//"+location.host+o+t;try{a[n?"replaceState":"pushState"](e,"",t),c.value=e}catch(e){console.error(e),i[n?"replace":"assign"](t)}}return c.value||s(r.value,{back:null,current:r.value,forward:null,position:a.length-1,replaced:!0,scroll:null},!0),{location:r,state:c,push:function(e,t){var n=F({},c.value,a.state,{forward:e,scroll:D()});s(n.current,n,!0),s(e,F({},d(r.value,e,null),{position:n.position+1},t),!1),r.value=e},replace:function(e,t){s(e,F({},a.state,d(c.value.back,e,c.value.forward,!0),t,{position:c.value.position}),!0),r.value=e}}}(e=l(e)),n=function(a,i,c,s){let l=[],n=[],u=null;const t=({state:e})=>{const t=h(a,location),n=c.value,r=i.value;let o=0;if(e){if(c.value=t,i.value=e,u&&u===n)return void(u=null);o=r?e.position-r.position:0}else s(t);l.forEach(e=>{e(c.value,n,{delta:o,type:W.pop,direction:o?0<o?f.forward:f.back:f.unknown})})};function r(){const e=window["history"];e.state&&e.replaceState(F({},e.state,{scroll:D()}),"")}return window.addEventListener("popstate",t),window.addEventListener("beforeunload",r),{pauseListeners:function(){u=c.value},listen:function(t){l.push(t);var e=()=>{var e=l.indexOf(t);-1<e&&l.splice(e,1)};return n.push(e),e},destroy:function(){for(const e of n)e();n=[],window.removeEventListener("popstate",t),window.removeEventListener("beforeunload",r)}}}(e,t.state,t.location,t.replace);e=F({location:"",base:e,go:function(e,t=!0){t||n.pauseListeners(),history.go(e)},createHref:p.bind(null,e)},t,n);return Object.defineProperty(e,"location",{enumerable:!0,get:()=>t.location.value}),Object.defineProperty(e,"state",{enumerable:!0,get:()=>t.state.value}),e}function Q(e){return"string"==typeof e||"symbol"==typeof e}const X={path:"/",name:void 0,p
|