it-tools/dist/client/assets/chunks/chunk-893bf84a.js
2024-04-28 00:48:29 +08:00

5 lines
20 KiB
JavaScript

import{a4 as Ze,q as F,c as T,e as Be,i as H,d as qe,h as He,n as Je,p as ie,r as et,A as tt}from"./chunk-449c23a2.js";/*!
* vue-router v4.1.6
* (c) 2022 Eduardo San Martin Morote
* @license MIT
*/const G=typeof window<"u";function nt(e){return e.__esModule||e[Symbol.toStringTag]==="Module"}const k=Object.assign;function ae(e,t){const n={};for(const r in t){const c=t[r];n[r]=N(c)?c.map(e):e(c)}return n}const W=()=>{},N=Array.isArray,rt=/\/$/,st=e=>e.replace(rt,"");function le(e,t,n="/"){let r,c={},u="",m="";const d=t.indexOf("#");let a=t.indexOf("?");return d<a&&d>=0&&(a=-1),a>-1&&(r=t.slice(0,a),u=t.slice(a+1,d>-1?d:t.length),c=e(u)),d>-1&&(r=r||t.slice(0,d),m=t.slice(d,t.length)),r=at(r??t,n),{fullPath:r+(u&&"?")+u+m,path:r,query:c,hash:m}}function ot(e,t){const n=t.query?e(t.query):"";return t.path+(n&&"?")+n+(t.hash||"")}function ct(e,t,n){const r=t.matched.length-1,c=n.matched.length-1;return r>-1&&r===c&&K(t.matched[r],n.matched[c])&&ze(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}function K(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function ze(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(!it(e[n],t[n]))return!1;return!0}function it(e,t){return N(e)?Se(e,t):N(t)?Se(t,e):e===t}function Se(e,t){return N(t)?e.length===t.length&&e.every((n,r)=>n===t[r]):e.length===1&&e[0]===t}function at(e,t){if(e.startsWith("/"))return e;if(!e)return t;const n=t.split("/"),r=e.split("/");let c=n.length-1,u,m;for(u=0;u<r.length;u++)if(m=r[u],m!==".")if(m==="..")c>1&&c--;else break;return n.slice(0,c).join("/")+"/"+r.slice(u-(u===r.length?1:0)).join("/")}var Y;(function(e){e.pop="pop",e.push="push"})(Y||(Y={}));var Z;(function(e){e.back="back",e.forward="forward",e.unknown=""})(Z||(Z={}));const ue="";function lt(e){if(!e)if(G){const t=document.querySelector("base");e=t&&t.getAttribute("href")||"/",e=e.replace(/^\w+:\/\/[^\/]+/,"")}else e="/";return e[0]!=="/"&&e[0]!=="#"&&(e="/"+e),st(e)}const ut=/^[^#]+#/;function ft(e,t){return e.replace(ut,"#")+t}function ht(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 dt=()=>({left:window.pageXOffset,top:window.pageYOffset});function pt(e){let t;if("el"in e){const n=e.el,r=typeof n=="string"&&n.startsWith("#"),c=typeof n=="string"?r?document.getElementById(n.slice(1)):document.querySelector(n):n;if(!c)return;t=ht(c,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 he=new Map;function mt(e,t){he.set(e,t)}function gt(e){const t=he.get(e);return he.delete(e),t}function nn(e=""){let t=[],n=[ue],r=0;e=lt(e);function c(d){r++,r===n.length||n.splice(r),n.push(d)}function u(d,a,{direction:l,delta:o}){const i={direction:l,delta:o,type:Y.pop};for(const h of t)h(d,a,i)}const m={location:ue,state:{},base:e,createHref:ft.bind(null,e),replace(d){n.splice(r--,1),c(d)},push(d,a){c(d)},listen(d){return t.push(d),()=>{const a=t.indexOf(d);a>-1&&t.splice(a,1)}},destroy(){t=[],n=[ue],r=0},go(d,a=!0){const l=this.location,o=d<0?Z.back:Z.forward;r=Math.max(0,Math.min(r+d,n.length-1)),a&&u(this.location,l,{direction:o,delta:d})}};return Object.defineProperty(m,"location",{enumerable:!0,get:()=>n[r]}),m}function yt(e){return typeof e=="string"||e&&typeof e=="object"}function Ge(e){return typeof e=="string"||typeof e=="symbol"}const j={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0},Ke=Symbol("");var Ce;(function(e){e[e.aborted=4]="aborted",e[e.cancelled=8]="cancelled",e[e.duplicated=16]="duplicated"})(Ce||(Ce={}));function L(e,t){return k(new Error,{type:e,[Ke]:!0},t)}function I(e,t){return e instanceof Error&&Ke in e&&(t==null||!!(e.type&t))}const Ae="[^/]+?",Rt={sensitive:!1,strict:!1,start:!0,end:!0},vt=/[.+*?^${}()[\]/\\]/g;function Et(e,t){const n=k({},Rt,t),r=[];let c=n.start?"^":"";const u=[];for(const l of e){const o=l.length?[]:[90];n.strict&&!l.length&&(c+="/");for(let i=0;i<l.length;i++){const h=l[i];let y=40+(n.sensitive?.25:0);if(h.type===0)i||(c+="/"),c+=h.value.replace(vt,"\\$&"),y+=40;else if(h.type===1){const{value:b,repeatable:_,optional:w,regexp:E}=h;u.push({name:b,repeatable:_,optional:w});const P=E||Ae;if(P!==Ae){y+=10;try{new RegExp(`(${P})`)}catch(M){throw new Error(`Invalid custom RegExp for param "${b}" (${P}): `+M.message)}}let O=_?`((?:${P})(?:/(?:${P}))*)`:`(${P})`;i||(O=w&&l.length<2?`(?:/${O})`:"/"+O),w&&(O+="?"),c+=O,y+=20,w&&(y+=-8),_&&(y+=-20),P===".*"&&(y+=-50)}o.push(y)}r.push(o)}if(n.strict&&n.end){const l=r.length-1;r[l][r[l].length-1]+=.7000000000000001}n.strict||(c+="/?"),n.end?c+="$":n.strict&&(c+="(?:/|$)");const m=new RegExp(c,n.sensitive?"":"i");function d(l){const o=l.match(m),i={};if(!o)return null;for(let h=1;h<o.length;h++){const y=o[h]||"",b=u[h-1];i[b.name]=y&&b.repeatable?y.split("/"):y}return i}function a(l){let o="",i=!1;for(const h of e){(!i||!o.endsWith("/"))&&(o+="/"),i=!1;for(const y of h)if(y.type===0)o+=y.value;else if(y.type===1){const{value:b,repeatable:_,optional:w}=y,E=b in l?l[b]:"";if(N(E)&&!_)throw new Error(`Provided param "${b}" is an array but it is not repeatable (* or + modifiers)`);const P=N(E)?E.join("/"):E;if(!P)if(w)h.length<2&&(o.endsWith("/")?o=o.slice(0,-1):i=!0);else throw new Error(`Missing required param "${b}"`);o+=P}}return o||"/"}return{re:m,score:r,keys:u,parse:d,stringify:a}}function Pt(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 bt(e,t){let n=0;const r=e.score,c=t.score;for(;n<r.length&&n<c.length;){const u=Pt(r[n],c[n]);if(u)return u;n++}if(Math.abs(c.length-r.length)===1){if(we(r))return 1;if(we(c))return-1}return c.length-r.length}function we(e){const t=e[e.length-1];return e.length>0&&t[t.length-1]<0}const St={type:0,value:""},kt=/[a-zA-Z0-9_]/;function Ct(e){if(!e)return[[]];if(e==="/")return[[St]];if(!e.startsWith("/"))throw new Error(`Invalid path "${e}"`);function t(y){throw new Error(`ERR (${n})/"${l}": ${y}`)}let n=0,r=n;const c=[];let u;function m(){u&&c.push(u),u=[]}let d=0,a,l="",o="";function i(){l&&(n===0?u.push({type:0,value:l}):n===1||n===2||n===3?(u.length>1&&(a==="*"||a==="+")&&t(`A repeatable param (${l}) must be alone in its segment. eg: '/:ids+.`),u.push({type:1,value:l,regexp:o,repeatable:a==="*"||a==="+",optional:a==="*"||a==="?"})):t("Invalid state to consume buffer"),l="")}function h(){l+=a}for(;d<e.length;){if(a=e[d++],a==="\\"&&n!==2){r=n,n=4;continue}switch(n){case 0:a==="/"?(l&&i(),m()):a===":"?(i(),n=1):h();break;case 4:h(),n=r;break;case 1:a==="("?n=2:kt.test(a)?h():(i(),n=0,a!=="*"&&a!=="?"&&a!=="+"&&d--);break;case 2:a===")"?o[o.length-1]=="\\"?o=o.slice(0,-1)+a:n=3:o+=a;break;case 3:i(),n=0,a!=="*"&&a!=="?"&&a!=="+"&&d--,o="";break;default:t("Unknown state");break}}return n===2&&t(`Unfinished custom RegExp for param "${l}"`),i(),m(),c}function At(e,t,n){const r=Et(Ct(e.path),n),c=k(r,{record:e,parent:t,children:[],alias:[]});return t&&!c.record.aliasOf==!t.record.aliasOf&&t.children.push(c),c}function wt(e,t){const n=[],r=new Map;t=xe({strict:!1,end:!0,sensitive:!1},t);function c(o){return r.get(o)}function u(o,i,h){const y=!h,b=_t(o);b.aliasOf=h&&h.record;const _=xe(t,o),w=[b];if("alias"in o){const O=typeof o.alias=="string"?[o.alias]:o.alias;for(const M of O)w.push(k({},b,{components:h?h.record.components:b.components,path:M,aliasOf:h?h.record:b}))}let E,P;for(const O of w){const{path:M}=O;if(i&&M[0]!=="/"){const q=i.record.path,$=q[q.length-1]==="/"?"":"/";O.path=i.record.path+(M&&$+M)}if(E=At(O,i,_),h?h.alias.push(E):(P=P||E,P!==E&&P.alias.push(E),y&&o.name&&!Oe(E)&&m(o.name)),b.children){const q=b.children;for(let $=0;$<q.length;$++)u(q[$],E,h&&h.children[$])}h=h||E,(E.record.components&&Object.keys(E.record.components).length||E.record.name||E.record.redirect)&&a(E)}return P?()=>{m(P)}:W}function m(o){if(Ge(o)){const i=r.get(o);i&&(r.delete(o),n.splice(n.indexOf(i),1),i.children.forEach(m),i.alias.forEach(m))}else{const i=n.indexOf(o);i>-1&&(n.splice(i,1),o.record.name&&r.delete(o.record.name),o.children.forEach(m),o.alias.forEach(m))}}function d(){return n}function a(o){let i=0;for(;i<n.length&&bt(o,n[i])>=0&&(o.record.path!==n[i].record.path||!Le(o,n[i]));)i++;n.splice(i,0,o),o.record.name&&!Oe(o)&&r.set(o.record.name,o)}function l(o,i){let h,y={},b,_;if("name"in o&&o.name){if(h=r.get(o.name),!h)throw L(1,{location:o});_=h.record.name,y=k(_e(i.params,h.keys.filter(P=>!P.optional).map(P=>P.name)),o.params&&_e(o.params,h.keys.map(P=>P.name))),b=h.stringify(y)}else if("path"in o)b=o.path,h=n.find(P=>P.re.test(b)),h&&(y=h.parse(b),_=h.record.name);else{if(h=i.name?r.get(i.name):n.find(P=>P.re.test(i.path)),!h)throw L(1,{location:o,currentLocation:i});_=h.record.name,y=k({},i.params,o.params),b=h.stringify(y)}const w=[];let E=h;for(;E;)w.unshift(E.record),E=E.parent;return{name:_,path:b,params:y,matched:w,meta:xt(w)}}return e.forEach(o=>u(o)),{addRoute:u,resolve:l,removeRoute:m,getRoutes:d,getRecordMatcher:c}}function _e(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}function _t(e){return{path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:void 0,beforeEnter:e.beforeEnter,props:Ot(e),children:e.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in e?e.components||null:e.component&&{default:e.component}}}function Ot(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 Oe(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function xt(e){return e.reduce((t,n)=>k(t,n.meta),{})}function xe(e,t){const n={};for(const r in e)n[r]=r in t?t[r]:e[r];return n}function Le(e,t){return t.children.some(n=>n===e||Le(e,n))}const Ve=/#/g,Mt=/&/g,Tt=/\//g,Nt=/=/g,$t=/\?/g,De=/\+/g,It=/%5B/g,jt=/%5D/g,Ue=/%5E/g,Bt=/%60/g,Qe=/%7B/g,qt=/%7C/g,Fe=/%7D/g,Ht=/%20/g;function me(e){return encodeURI(""+e).replace(qt,"|").replace(It,"[").replace(jt,"]")}function zt(e){return me(e).replace(Qe,"{").replace(Fe,"}").replace(Ue,"^")}function de(e){return me(e).replace(De,"%2B").replace(Ht,"+").replace(Ve,"%23").replace(Mt,"%26").replace(Bt,"`").replace(Qe,"{").replace(Fe,"}").replace(Ue,"^")}function Gt(e){return de(e).replace(Nt,"%3D")}function Kt(e){return me(e).replace(Ve,"%23").replace($t,"%3F")}function Lt(e){return e==null?"":Kt(e).replace(Tt,"%2F")}function J(e){try{return decodeURIComponent(""+e)}catch{}return""+e}function Vt(e){const t={};if(e===""||e==="?")return t;const r=(e[0]==="?"?e.slice(1):e).split("&");for(let c=0;c<r.length;++c){const u=r[c].replace(De," "),m=u.indexOf("="),d=J(m<0?u:u.slice(0,m)),a=m<0?null:J(u.slice(m+1));if(d in t){let l=t[d];N(l)||(l=t[d]=[l]),l.push(a)}else t[d]=a}return t}function Me(e){let t="";for(let n in e){const r=e[n];if(n=Gt(n),r==null){r!==void 0&&(t+=(t.length?"&":"")+n);continue}(N(r)?r.map(u=>u&&de(u)):[r&&de(r)]).forEach(u=>{u!==void 0&&(t+=(t.length?"&":"")+n,u!=null&&(t+="="+u))})}return t}function Dt(e){const t={};for(const n in e){const r=e[n];r!==void 0&&(t[n]=N(r)?r.map(c=>c==null?null:""+c):r==null?r:""+r)}return t}const Ut=Symbol(""),Te=Symbol(""),ee=Symbol(""),ge=Symbol(""),pe=Symbol("");function Q(){let e=[];function t(r){return e.push(r),()=>{const c=e.indexOf(r);c>-1&&e.splice(c,1)}}function n(){e=[]}return{add:t,list:()=>e,reset:n}}function B(e,t,n,r,c){const u=r&&(r.enterCallbacks[c]=r.enterCallbacks[c]||[]);return()=>new Promise((m,d)=>{const a=i=>{i===!1?d(L(4,{from:n,to:t})):i instanceof Error?d(i):yt(i)?d(L(2,{from:t,to:i})):(u&&r.enterCallbacks[c]===u&&typeof i=="function"&&u.push(i),m())},l=e.call(r&&r.instances[c],t,n,a);let o=Promise.resolve(l);e.length<3&&(o=o.then(a)),o.catch(i=>d(i))})}function fe(e,t,n,r){const c=[];for(const u of e)for(const m in u.components){let d=u.components[m];if(!(t!=="beforeRouteEnter"&&!u.instances[m]))if(Qt(d)){const l=(d.__vccOpts||d)[t];l&&c.push(B(l,n,r,u,m))}else{let a=d();c.push(()=>a.then(l=>{if(!l)return Promise.reject(new Error(`Couldn't resolve component "${m}" at "${u.path}"`));const o=nt(l)?l.default:l;u.components[m]=o;const h=(o.__vccOpts||o)[t];return h&&B(h,n,r,u,m)()}))}}return c}function Qt(e){return typeof e=="object"||"displayName"in e||"props"in e||"__vccOpts"in e}function Ne(e){const t=H(ee),n=H(ge),r=T(()=>t.resolve(F(e.to))),c=T(()=>{const{matched:a}=r.value,{length:l}=a,o=a[l-1],i=n.matched;if(!o||!i.length)return-1;const h=i.findIndex(K.bind(null,o));if(h>-1)return h;const y=$e(a[l-2]);return l>1&&$e(o)===y&&i[i.length-1].path!==y?i.findIndex(K.bind(null,a[l-2])):h}),u=T(()=>c.value>-1&&Xt(n.params,r.value.params)),m=T(()=>c.value>-1&&c.value===n.matched.length-1&&ze(n.params,r.value.params));function d(a={}){return Yt(a)?t[F(e.replace)?"replace":"push"](F(e.to)).catch(W):Promise.resolve()}return{route:r,href:T(()=>r.value.href),isActive:u,isExactActive:m,navigate:d}}const Ft=qe({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"}},useLink:Ne,setup(e,{slots:t}){const n=Be(Ne(e)),{options:r}=H(ee),c=T(()=>({[Ie(e.activeClass,r.linkActiveClass,"router-link-active")]:n.isActive,[Ie(e.exactActiveClass,r.linkExactActiveClass,"router-link-exact-active")]:n.isExactActive}));return()=>{const u=t.default&&t.default(n);return e.custom?u:He("a",{"aria-current":n.isExactActive?e.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:c.value},u)}}}),Wt=Ft;function Yt(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 Xt(e,t){for(const n in t){const r=t[n],c=e[n];if(typeof r=="string"){if(r!==c)return!1}else if(!N(c)||c.length!==r.length||r.some((u,m)=>u!==c[m]))return!1}return!0}function $e(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const Ie=(e,t,n)=>e??t??n,Zt=qe({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:n}){const r=H(pe),c=T(()=>e.route||r.value),u=H(Te,0),m=T(()=>{let l=F(u);const{matched:o}=c.value;let i;for(;(i=o[l])&&!i.components;)l++;return l}),d=T(()=>c.value.matched[m.value]);ie(Te,T(()=>m.value+1)),ie(Ut,d),ie(pe,c);const a=et();return tt(()=>[a.value,d.value,e.name],([l,o,i],[h,y,b])=>{o&&(o.instances[i]=l,y&&y!==o&&l&&l===h&&(o.leaveGuards.size||(o.leaveGuards=y.leaveGuards),o.updateGuards.size||(o.updateGuards=y.updateGuards))),l&&o&&(!y||!K(o,y)||!h)&&(o.enterCallbacks[i]||[]).forEach(_=>_(l))},{flush:"post"}),()=>{const l=c.value,o=e.name,i=d.value,h=i&&i.components[o];if(!h)return je(n.default,{Component:h,route:l});const y=i.props[o],b=y?y===!0?l.params:typeof y=="function"?y(l):y:null,w=He(h,k({},b,t,{onVnodeUnmounted:E=>{E.component.isUnmounted&&(i.instances[o]=null)},ref:a}));return je(n.default,{Component:w,route:l})||w}}});function je(e,t){if(!e)return null;const n=e(t);return n.length===1?n[0]:n}const Jt=Zt;function rn(e){const t=wt(e.routes,e),n=e.parseQuery||Vt,r=e.stringifyQuery||Me,c=e.history,u=Q(),m=Q(),d=Q(),a=Ze(j);let l=j;G&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const o=ae.bind(null,s=>""+s),i=ae.bind(null,Lt),h=ae.bind(null,J);function y(s,p){let f,g;return Ge(s)?(f=t.getRecordMatcher(s),g=p):g=s,t.addRoute(g,f)}function b(s){const p=t.getRecordMatcher(s);p&&t.removeRoute(p)}function _(){return t.getRoutes().map(s=>s.record)}function w(s){return!!t.getRecordMatcher(s)}function E(s,p){if(p=k({},p||a.value),typeof s=="string"){const R=le(n,s,p.path),A=t.resolve({path:R.path},p),U=c.createHref(R.fullPath);return k(R,A,{params:h(A.params),hash:J(R.hash),redirectedFrom:void 0,href:U})}let f;if("path"in s)f=k({},s,{path:le(n,s.path,p.path).path});else{const R=k({},s.params);for(const A in R)R[A]==null&&delete R[A];f=k({},s,{params:i(s.params)}),p.params=i(p.params)}const g=t.resolve(f,p),S=s.hash||"";g.params=o(h(g.params));const C=ot(r,k({},s,{hash:zt(S),path:g.path})),v=c.createHref(C);return k({fullPath:C,hash:S,query:r===Me?Dt(s.query):s.query||{}},g,{redirectedFrom:void 0,href:v})}function P(s){return typeof s=="string"?le(n,s,a.value.path):k({},s)}function O(s,p){if(l!==s)return L(8,{from:p,to:s})}function M(s){return V(s)}function q(s){return M(k(P(s),{replace:!0}))}function $(s){const p=s.matched[s.matched.length-1];if(p&&p.redirect){const{redirect:f}=p;let g=typeof f=="function"?f(s):f;return typeof g=="string"&&(g=g.includes("?")||g.includes("#")?g=P(g):{path:g},g.params={}),k({query:s.query,hash:s.hash,params:"path"in g?{}:s.params},g)}}function V(s,p){const f=l=E(s),g=a.value,S=s.state,C=s.force,v=s.replace===!0,R=$(f);if(R)return V(k(P(R),{state:typeof R=="object"?k({},S,R.state):S,force:C,replace:v}),p||f);const A=f;A.redirectedFrom=p;let U;return!C&&ct(r,g,f)&&(U=L(16,{to:A,from:g}),Pe(g,g,!0,!1)),(U?Promise.resolve(U):ye(A,g)).catch(x=>I(x)?I(x,2)?x:re(x):ne(x,A,g)).then(x=>{if(x){if(I(x,2))return V(k({replace:v},P(x.to),{state:typeof x.to=="object"?k({},S,x.to.state):S,force:C}),p||A)}else x=ve(A,g,!0,v,S);return Re(A,g,x),x})}function We(s,p){const f=O(s,p);return f?Promise.reject(f):Promise.resolve()}function ye(s,p){let f;const[g,S,C]=en(s,p);f=fe(g.reverse(),"beforeRouteLeave",s,p);for(const R of g)R.leaveGuards.forEach(A=>{f.push(B(A,s,p))});const v=We.bind(null,s,p);return f.push(v),z(f).then(()=>{f=[];for(const R of u.list())f.push(B(R,s,p));return f.push(v),z(f)}).then(()=>{f=fe(S,"beforeRouteUpdate",s,p);for(const R of S)R.updateGuards.forEach(A=>{f.push(B(A,s,p))});return f.push(v),z(f)}).then(()=>{f=[];for(const R of s.matched)if(R.beforeEnter&&!p.matched.includes(R))if(N(R.beforeEnter))for(const A of R.beforeEnter)f.push(B(A,s,p));else f.push(B(R.beforeEnter,s,p));return f.push(v),z(f)}).then(()=>(s.matched.forEach(R=>R.enterCallbacks={}),f=fe(C,"beforeRouteEnter",s,p),f.push(v),z(f))).then(()=>{f=[];for(const R of m.list())f.push(B(R,s,p));return f.push(v),z(f)}).catch(R=>I(R,8)?R:Promise.reject(R))}function Re(s,p,f){for(const g of d.list())g(s,p,f)}function ve(s,p,f,g,S){const C=O(s,p);if(C)return C;const v=p===j,R=G?history.state:{};f&&(g||v?c.replace(s.fullPath,k({scroll:v&&R&&R.scroll},S)):c.push(s.fullPath,S)),a.value=s,Pe(s,p,f,v),re()}let D;function Ye(){D||(D=c.listen((s,p,f)=>{if(!be.listening)return;const g=E(s),S=$(g);if(S){V(k(S,{replace:!0}),g).catch(W);return}l=g;const C=a.value;G&&mt(ke(C.fullPath,f.delta),dt()),ye(g,C).catch(v=>I(v,12)?v:I(v,2)?(V(v.to,g).then(R=>{I(R,20)&&!f.delta&&f.type===Y.pop&&c.go(-1,!1)}).catch(W),Promise.reject()):(f.delta&&c.go(-f.delta,!1),ne(v,g,C))).then(v=>{v=v||ve(g,C,!1),v&&(f.delta&&!I(v,8)?c.go(-f.delta,!1):f.type===Y.pop&&I(v,20)&&c.go(-1,!1)),Re(g,C,v)}).catch(W)}))}let te=Q(),Ee=Q(),X;function ne(s,p,f){re(s);const g=Ee.list();return g.length?g.forEach(S=>S(s,p,f)):console.error(s),Promise.reject(s)}function Xe(){return X&&a.value!==j?Promise.resolve():new Promise((s,p)=>{te.add([s,p])})}function re(s){return X||(X=!s,Ye(),te.list().forEach(([p,f])=>s?f(s):p()),te.reset()),s}function Pe(s,p,f,g){const{scrollBehavior:S}=e;if(!G||!S)return Promise.resolve();const C=!f&&gt(ke(s.fullPath,0))||(g||!f)&&history.state&&history.state.scroll||null;return Je().then(()=>S(s,p,C)).then(v=>v&&pt(v)).catch(v=>ne(v,s,p))}const se=s=>c.go(s);let oe;const ce=new Set,be={currentRoute:a,listening:!0,addRoute:y,removeRoute:b,hasRoute:w,getRoutes:_,resolve:E,options:e,push:M,replace:q,go:se,back:()=>se(-1),forward:()=>se(1),beforeEach:u.add,beforeResolve:m.add,afterEach:d.add,onError:Ee.add,isReady:Xe,install(s){const p=this;s.component("RouterLink",Wt),s.component("RouterView",Jt),s.config.globalProperties.$router=p,Object.defineProperty(s.config.globalProperties,"$route",{enumerable:!0,get:()=>F(a)}),G&&!oe&&a.value===j&&(oe=!0,M(c.location).catch(S=>{}));const f={};for(const S in j)f[S]=T(()=>a.value[S]);s.provide(ee,p),s.provide(ge,Be(f)),s.provide(pe,a);const g=s.unmount;ce.add(s),s.unmount=function(){ce.delete(s),ce.size<1&&(l=j,D&&D(),D=null,a.value=j,oe=!1,X=!1),g()}}};return be}function z(e){return e.reduce((t,n)=>t.then(()=>n()),Promise.resolve())}function en(e,t){const n=[],r=[],c=[],u=Math.max(t.matched.length,e.matched.length);for(let m=0;m<u;m++){const d=t.matched[m];d&&(e.matched.find(l=>K(l,d))?r.push(d):n.push(d));const a=e.matched[m];a&&(t.matched.find(l=>K(l,a))||c.push(a))}return[n,r,c]}function sn(){return H(ee)}function on(){return H(ge)}export{Jt as R,sn as a,Wt as b,rn as c,nn as d,on as u};