@fox-js/fox 3.0.1-3 → 3.0.1-30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/libs/index.cjs.js CHANGED
@@ -1 +1,3 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("vue");const t=Array.isArray,r=e=>"function"==typeof e,n=e=>null!==e&&"object"==typeof e,s=Object.prototype.toString,o=e=>s.call(e),i=e=>"[object Object]"===o(e),l="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;function a(e){return e.__esModule||l&&"Module"===e[Symbol.toStringTag]}const u=typeof Promise<"u"&&-1!==Promise.toString().indexOf("[native code]");function h(...e){let t=void 0!==e[0]&&null!==e[0]?e[0]:{},r=1,n=e.length,s=!1;for("boolean"==typeof t&&(s=t,t=e[r]??{},r++),"object"!=typeof t&&(t={});r<n;r++)if(null!==e[r]&&void 0!==e[r]){let n=e[r];for(let e in n){let r=t[e],o=n[e];if(r!==o)if(!0===s&&o&&"object"==typeof o){let n;n=Array.isArray(o)?r&&Array.isArray(r)?r:[]:r&&"object"==typeof r?r:{},t[e]=h(s,n,o)}else void 0!==o&&(t[e]=o)}}return t}function c(e,t,r=!1){if(r){if("object"!=typeof t)return{};"object"!=typeof e&&(e={});for(let n in t){let s=e[n],o=t[n];if(s!==o)if("object"==typeof o){if(!Array.isArray(o)&&!i(o))continue;s=c(s,o,r),e[n]=s}else{if("function"==typeof o)continue;e[n]=o}}const n=Object.getOwnPropertySymbols(t);for(let s of n){let n=e[s],o=t[s];if(n!==o)if("object"==typeof o){if(!Array.isArray(o)&&!i(o))continue;n=c(n,o,r),e[s]=n}else{if("function"==typeof o)continue;e[s]=o}}}else h(!0,e,t);return e}class f{static seed=(new Date).getTime();static get(){let e=++f.seed;return e>=Number.MAX_VALUE&&(f.seed=0),e}}const p=u?Promise.resolve():null;function d(e,...t){null!==p?t&&t.length>0?p.then((()=>{e(t)})):p.then(e):t&&t.length>0?setTimeout((()=>{e(t)})):setTimeout(e)}function y(e){return null!=e&&("boolean"==typeof e?e:"string"==typeof e?"true"===e.toLocaleLowerCase():Boolean(e))}const m={"[object Boolean]":"boolean","[object Number]":"number","[object String]":"string","[object Function]":"function","[object Array]":"array","[object Date]":"date","[object RegExp]":"regExp","[object Object]":"object"};function g(e){let t=Object.prototype.toString.call(e);return null==e?String(e):m[t]||"object"}function v(e){return e&&"object"==typeof e&&"setInterval"in e}function b(e){let t=!!e&&"length"in e&&e.length,r=g(e);return"function"!==r&&!v(e)&&("array"===r||0===t||"number"==typeof t&&t>0&&t-1 in e)}function x(e,t){let r=+t.length,n=0,s=e.length;for(;n<r;n++)e[s++]=t[n];return e.length=s,e}function w(e,t=[]){let r=t;return null!=e&&(b(Object(e))?x(r,"string"==typeof e?[e]:e):r.push(e)),r}function S(e,t,r){if(b(e))Reflect.apply([].forEach,e,[t]);else for(let n in e)if(r&&e.hasOwnProperty(n)){if(!1===Reflect.apply(t,e,[e[n]]))break}else if(!1===Reflect.apply(t,e,[e[n]]))break;return e}function R(e,t){if(e==t)return!0;if(void 0===e||void 0===t)return!1;let r=g(e);if(r!==g(t))return!1;if("object"===r){let r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(let n=0;n<r.length;n++){let s=r[n];if(!R(e[s],t[s]))return!1}return!0}if("array"===r){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++){if(!R(e[r],t[r]))return!1}return!0}return!1}const A=Symbol("idKey"),E=Symbol("valueKey"),C=Symbol("childrenKey"),j=Symbol("growKey");class P{[j]=!0;[A];[E]=e.ref();[C]=new Map;constructor(e){this[A]=e}}class T{get(e,t){if("value"==t)return e[E].value;if("grow"===t)return e[j];let r=e[C].get(t);return r?$(r):e[j]?(r=O(t),r[j]=e[j],e[C].set(t,r),$(r)):void 0}set(e,t,r){return"value"==t?(e[E].value=r,!0):"grow"===t?(e[j]=y(r),!0):null==r&&(e[C].delete(t),!0)}deleteProperty(e,t){return"value"!==t&&"grow"!=t&&(e[C].delete(t),!0)}}const q="__proxy__";function O(e){let t=new P(e);return Reflect.set(t,q,new Proxy(t,new T)),t}function $(e){return Reflect.get(e,q)}class F extends P{constructor(){super("__root__")}put(...e){let t=e.length;if(t<2)return!1;let r=this;for(let n=0;n<t-1;n++){let t,s=e[n];r[C].has(s)?t=r[C].get(s):(t=O(s),r[C].set(s,t)),r=t}return r[E].value=e[t-1],!0}get(...e){let t=e.length;if(0===t)return;let r=this;for(let n=0;n<t;n++){let t=e[n];if(!r[C].has(t))return;r=r[C].get(t)}return r[E].value}remove(...e){let t=e.length;if(0==t)return!1;let r=this;for(let n=0;n<t-1;n++){let t=e[n];if(!r[C].has(t))return!1;r=r[C].get(t)}let n=e[t-1];return!!r[C].has(n)&&(r[C].delete(n),!0)}contains(...e){let t=e.length;if(0==t)return!1;let r=this;for(let n=0;n<t-1;n++){let t=e[n];if(!r[C].has(t))return!1;r=r[C].get(t)}let n=e[t-1];return r[C].has(n)}clear(){this[C].clear()}}const k=["put","get","contains","remove","clear"];function _(e){return k.includes(e)}class M{get(e,t){if("value"==t)return e[E].value;if("grow"===t)return e[j];if(t===C)return e[C];if("string"==typeof t&&_(t))return e[t];let r=String(t),n=e[C].get(r);return n?$(n):e[j]?(n=O(r),n[j]=e[j],e[C].set(r,n),$(n)):void 0}set(e,t,r){return"value"==t?(e[E].value=r,!0):"grow"===t?(e[j]=y(r),!0):!_(t)&&(null==r&&(e[C].delete(t),!0))}deleteProperty(e,t){return"value"!==t&&"grow"!=t&&(e[C].delete(t),!0)}}let N=new Proxy(F,{construct(e,...t){let r=function(){let e=new F,t=new M,r=new Proxy(e,t);return Object.assign({put:(...t)=>Reflect.apply(e.put,e,t),get:(...t)=>Reflect.apply(e.get,e,t),remove:(...t)=>Reflect.apply(e.remove,e,t),contains:(...t)=>Reflect.apply(e.contains,e,t),clear:()=>Reflect.apply(e.clear,e,[])},r),Reflect.set(e,q,r),e}();return $(r)}});function K(e,t){void 0===t&&(t={});for(var r=function(e){for(var t=[],r=0;r<e.length;){var n=e[r];if("*"!==n&&"+"!==n&&"?"!==n)if("\\"!==n)if("{"!==n)if("}"!==n)if(":"!==n)if("("!==n)t.push({type:"CHAR",index:r,value:e[r++]});else{var s=1,o="";if("?"===e[l=r+1])throw new TypeError('Pattern cannot start with "?" at '.concat(l));for(;l<e.length;)if("\\"!==e[l]){if(")"===e[l]){if(0==--s){l++;break}}else if("("===e[l]&&(s++,"?"!==e[l+1]))throw new TypeError("Capturing groups are not allowed at ".concat(l));o+=e[l++]}else o+=e[l++]+e[l++];if(s)throw new TypeError("Unbalanced pattern at ".concat(r));if(!o)throw new TypeError("Missing pattern at ".concat(r));t.push({type:"PATTERN",index:r,value:o}),r=l}else{for(var i="",l=r+1;l<e.length;){var a=e.charCodeAt(l);if(!(a>=48&&a<=57||a>=65&&a<=90||a>=97&&a<=122||95===a))break;i+=e[l++]}if(!i)throw new TypeError("Missing parameter name at ".concat(r));t.push({type:"NAME",index:r,value:i}),r=l}else t.push({type:"CLOSE",index:r,value:e[r++]});else t.push({type:"OPEN",index:r,value:e[r++]});else t.push({type:"ESCAPED_CHAR",index:r++,value:e[r++]});else t.push({type:"MODIFIER",index:r,value:e[r++]})}return t.push({type:"END",index:r,value:""}),t}(e),n=t.prefixes,s=void 0===n?"./":n,o="[^".concat(D(t.delimiter||"/#?"),"]+?"),i=[],l=0,a=0,u="",h=function(e){if(a<r.length&&r[a].type===e)return r[a++].value},c=function(e){var t=h(e);if(void 0!==t)return t;var n=r[a],s=n.type,o=n.index;throw new TypeError("Unexpected ".concat(s," at ").concat(o,", expected ").concat(e))},f=function(){for(var e,t="";e=h("CHAR")||h("ESCAPED_CHAR");)t+=e;return t};a<r.length;){var p=h("CHAR"),d=h("NAME"),y=h("PATTERN");if(d||y){var m=p||"";-1===s.indexOf(m)&&(u+=m,m=""),u&&(i.push(u),u=""),i.push({name:d||l++,prefix:m,suffix:"",pattern:y||o,modifier:h("MODIFIER")||""})}else{var g=p||h("ESCAPED_CHAR");if(g)u+=g;else if(u&&(i.push(u),u=""),h("OPEN")){m=f();var v=h("NAME")||"",b=h("PATTERN")||"",x=f();c("CLOSE"),i.push({name:v||(b?l++:""),pattern:v&&!b?o:b,prefix:m,suffix:x,modifier:h("MODIFIER")||""})}else c("END")}}return i}function I(e,t){return function(e,t){void 0===t&&(t={});var r=H(t),n=t.encode,s=void 0===n?function(e){return e}:n,o=t.validate,i=void 0===o||o,l=e.map((function(e){if("object"==typeof e)return new RegExp("^(?:".concat(e.pattern,")$"),r)}));return function(t){for(var r="",n=0;n<e.length;n++){var o=e[n];if("string"!=typeof o){var a=t?t[o.name]:void 0,u="?"===o.modifier||"*"===o.modifier,h="*"===o.modifier||"+"===o.modifier;if(Array.isArray(a)){if(!h)throw new TypeError('Expected "'.concat(o.name,'" to not repeat, but got an array'));if(0===a.length){if(u)continue;throw new TypeError('Expected "'.concat(o.name,'" to not be empty'))}for(var c=0;c<a.length;c++){var f=s(a[c],o);if(i&&!l[n].test(f))throw new TypeError('Expected all "'.concat(o.name,'" to match "').concat(o.pattern,'", but got "').concat(f,'"'));r+=o.prefix+f+o.suffix}}else if("string"!=typeof a&&"number"!=typeof a){if(!u){var p=h?"an array":"a string";throw new TypeError('Expected "'.concat(o.name,'" to be ').concat(p))}}else{f=s(String(a),o);if(i&&!l[n].test(f))throw new TypeError('Expected "'.concat(o.name,'" to match "').concat(o.pattern,'", but got "').concat(f,'"'));r+=o.prefix+f+o.suffix}}else r+=o}return r}}(K(e,t),t)}function L(e,t){var r=[];return function(e,t,r){void 0===r&&(r={});var n=r.decode,s=void 0===n?function(e){return e}:n;return function(r){var n=e.exec(r);if(!n)return!1;for(var o=n[0],i=n.index,l=Object.create(null),a=function(e){if(void 0===n[e])return"continue";var r=t[e-1];"*"===r.modifier||"+"===r.modifier?l[r.name]=n[e].split(r.prefix+r.suffix).map((function(e){return s(e,r)})):l[r.name]=s(n[e],r)},u=1;u<n.length;u++)a(u);return{path:o,index:i,params:l}}}(B(e,r,t),r,t)}function D(e){return e.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1")}function H(e){return e&&e.sensitive?"":"i"}function U(e,t,r){return function(e,t,r){void 0===r&&(r={});for(var n=r.strict,s=void 0!==n&&n,o=r.start,i=void 0===o||o,l=r.end,a=void 0===l||l,u=r.encode,h=void 0===u?function(e){return e}:u,c=r.delimiter,f=void 0===c?"/#?":c,p=r.endsWith,d="[".concat(D(void 0===p?"":p),"]|$"),y="[".concat(D(f),"]"),m=i?"^":"",g=0,v=e;g<v.length;g++){var b=v[g];if("string"==typeof b)m+=D(h(b));else{var x=D(h(b.prefix)),w=D(h(b.suffix));if(b.pattern)if(t&&t.push(b),x||w)if("+"===b.modifier||"*"===b.modifier){var S="*"===b.modifier?"?":"";m+="(?:".concat(x,"((?:").concat(b.pattern,")(?:").concat(w).concat(x,"(?:").concat(b.pattern,"))*)").concat(w,")").concat(S)}else m+="(?:".concat(x,"(").concat(b.pattern,")").concat(w,")").concat(b.modifier);else"+"===b.modifier||"*"===b.modifier?m+="((?:".concat(b.pattern,")").concat(b.modifier,")"):m+="(".concat(b.pattern,")").concat(b.modifier);else m+="(?:".concat(x).concat(w,")").concat(b.modifier)}}if(a)s||(m+="".concat(y,"?")),m+=r.endsWith?"(?=".concat(d,")"):"$";else{var R=e[e.length-1],A="string"==typeof R?y.indexOf(R[R.length-1])>-1:void 0===R;s||(m+="(?:".concat(y,"(?=").concat(d,"))?")),A||(m+="(?=".concat(y,"|").concat(d,")"))}return new RegExp(m,H(r))}(K(e,r),t,r)}function B(e,t,r){return e instanceof RegExp?function(e,t){if(!t)return e;for(var r=/\((?:\?<(.*?)>)?(?!\?)/g,n=0,s=r.exec(e.source);s;)t.push({name:s[1]||n++,prefix:"",suffix:"",modifier:"",pattern:""}),s=r.exec(e.source);return e}(e,t):Array.isArray(e)?function(e,t,r){var n=e.map((function(e){return B(e,t,r).source}));return new RegExp("(?:".concat(n.join("|"),")"),H(r))}(e,t,r):U(e,t,r)}const W="default",V=Symbol("sync"),z=Symbol("resolveRoute");function J(e){let t=!1;return function(...r){if(!t)return t=!0,Reflect.apply(e,{},r)}}class G{name;level;rootName;rootIndex=0;constructor(e,t,r,n){this.name=e,this.level=t,this.rootName=r,this.rootIndex=n}}class X{to;routeModel;from;data={};constructor(e,t){this.to=e,this.from=t}static from(e){let t=new X(e.to,e.from),r=e.data??{};return h(!0,t.data,r),t}}class Y{path;get fullPath(){let e=this.path??`/${this.name}`;return`${this.root??W}!${e}`}name;root;params;query;matched;meta;success;error;destroy;opsType;updateType;viewTagAttrs;index;active;slot;session;static clone(e,t){let r=new Y;return c(r,e,t),r}static isSame(e,t){return e===t||!(null==e||null==t||e.path&&e.path!==t.path||e.name&&e.name!==t.name||e.root!==t.root||e.index!==t.index)}static isSameForRouteModel(e,t){return e===t||!(null==e||null==t||e.path&&e.path!=t.path||e.name&&e.name!=t.name)}static from(e){let t=new Y;if(null==e)return t;let r=t;for(let t in e){let n=e[t];r[t]=n}const n=Object.getOwnPropertySymbols(e);if(Array.isArray(n)&&n.length>0)for(let t of n)r[t]=e[t];return t}}class Q{id;name;props;meta;src;component;constructor(e,t,r,n){this.id=f.get(),this.name=e,this.src=t,"function"!=typeof t&&(this.component=t),this.props=r,this.meta=n}get isResolved(){return void 0!==this.component}resolve(){return function(e){let t=e.src;return new Promise(((r,n)=>{const s=J((t=>{a(t)&&(t=t.default),e.component=t,r()})),o=J((e=>{n(e)}));let i;try{i=t(s,o)}catch(e){o(e)}if(i)if("function"==typeof i.then)i.then(s,o);else{const e=i.component;e&&"function"==typeof e.then&&e.then(s,o)}}))}(this)}}class Z{models=[]}class ee{path;match;redirect;name;layers=[]}var te,re=((te=re||{})[te.Push=0]="Push",te[te.Replace=1]="Replace",te[te.Put=2]="Put",te[te.Append=3]="Append",te[te.Open=4]="Open",te),ne=(e=>(e[e.Part=0]="Part",e[e.All=1]="All",e))(ne||{});const se=Symbol("rootKey"),oe=Symbol("rootNodeKey"),ie=Symbol("parentNodeKey"),le=Symbol("nameKey");class ae{instance=null;model;route;active=!0;index=0;constructor(e,t,r=0,n=!0){this.route=e,this.model=t,this.index=r,this.active=n}}class ue{scope=null;set compensation(t){null!==this.scope&&this.scope.stop(),this.scope=e.effectScope(),this.scope.run((()=>{e.watch(this.slots,(()=>{let e=!1;try{e=t()}catch(e){}e&&null!==this.scope&&(this.scope.stop(),this.scope=null)}))}))}_slots;get slots(){return null==this._slots&&(this._slots=e.shallowRef([])),this._slots}get empty(){return null==this._slots||0==this._slots.value.length}[le];[se];[oe]=null;[ie]=null;get name(){return this[le]}constructor(e,t,r){this[le]=e,this[se]=t,r&&(this[oe]=r)}}class he{view;index;level;constructor(e,t,r){this.view=e,this.index=t,this.level=r}static include(e,t){for(let r=0;r<e.length;r++){let n=e[r];if(n.view===t.view&&(-1==t.index||n.index===t.index)&&n.level===t.level)return!0}return!1}}class ce{views=[]}class fe{layers=[]}class pe{time;route}class de{forbidTime=300;submitRecorder=new pe;isSameRoute(e,t){return null!=e&&null!=t&&(e.name===t.name&&e.path===t.path&&e.root===t.root)}acquire(e){let t=(new Date).getTime();if(!(this.isSameRoute(e,this.submitRecorder.route)&&this.submitRecorder.time&&t-this.submitRecorder.time<=this.forbidTime))return this.submitRecorder.route=e,this.submitRecorder.time=t,t;this.submitRecorder.time=t}release(e){this.submitRecorder.time===e&&(this.submitRecorder.route=void 0)}}const ye=typeof window<"u",me=function(){return window},ge=function(){return window.document};function ve(e,t,r){e.addEventListener?e.addEventListener(t,r,!1):e.attachEvent?e.attachEvent(`on${t}`,r):e[`on${t}`]=r}function be(e,t,r){e.removeEventListener?e.removeEventListener(t,r):e.detachEvent?e.detachEvent(`on${t}`,r):e[`on${t}`]=null}let xe=function(){if(!ye)return"/";let e=me().location,t=`${e.protocol}//${e.host}`;return t+=function(e){let t=e,r=t.lastIndexOf("/");return r>0&&r<t.length-1?t=t.substring(0,r+1):0===r&&-1!==t.indexOf(".")?t="/":-1===r&&(t=-1==t.indexOf(".")?`/${t}/`:"/"),0!==t.indexOf("/")&&(t=`/${t}`),t}(e.pathname),t}();const we={method:"POST",headers:{"Content-Type":"application/json; charset=UTF-8"},mode:"cors",credentials:"same-origin",cache:"default",redirect:"follow",keepalive:!0},Se=new Map;async function Re(e){let{id:t,method:r="POST",url:n,headers:s={},data:o,processData:i=!0,timeout:l=-1}=e;if(t&&Se.has(t))throw new Error("resubmit");r=r.toUpperCase();let{contentType:a="application/json; charset=UTF-8"}=s,u=h(!0,{...we},{method:r,headers:s});if("GET"===r?n=function(e,t,r="text"){if(null==t)return e;let n="";if(0===(r=r.trim().toLowerCase()).indexOf("application/x-www-form-urlencoded")||0===r.indexOf("application/json"))if("object"==typeof t)for(let e in t){let r=t[e];if(Array.isArray(r))for(let t=0;t<r.length;t++){let s=`${encodeURIComponent(e)}=${encodeURIComponent(r[t])}`;n.length>0&&(n+="&"),n+=s}else{let t=`${encodeURIComponent(e)}=${encodeURIComponent(r)}`;n.length>0&&(n+="&"),n+=t}}else n=t;else n=t;return n.length>0&&(e=-1===e.indexOf("?")?`${e}?${n}`:`${e}&${n}`),e}(n,o,a):(i&&(o=function(e,t="text"){let r="";if(0===(t=t.trim().toLowerCase()).indexOf("application/x-www-form-urlencoded"))if("object"==typeof e)for(let t in e){let n=e[t];if(Array.isArray(n))for(let e=0;e<n.length;e++){let s=`${encodeURIComponent(t)}=${encodeURIComponent(n[e])}`;r.length>0&&(r+="&"),r+=s}else{let e=`${encodeURIComponent(t)}=${encodeURIComponent(n)}`;r.length>0&&(r+="&"),r+=e}}else r=e;else r=0===t.indexOf("text")?"object"==typeof e?JSON.stringify(e):e:0===t.indexOf("application/json")&&"object"==typeof e?JSON.stringify(e):e;return r}(o,a)),u.body=o),t||l>0){t||(t=`fetch_${f.get()}`);const e=new AbortController;u.signal=e.signal;let r={timer:null,controller:e};if(l>0){const e=setTimeout((()=>{r.timer&&r.controller.abort()}),l);r.timer=e}Se.set(t,r)}try{let e=await fetch(n,u),r={};e.headers.forEach(((e,t)=>{r[e]=t}));let s,o=r["content-type"]??"";return s=-1!==o.indexOf("application/json")?await e.json():-1!=o.indexOf("text")?await e.text():await e.blob(),{ok:e.ok,status:e.status,statusText:e.statusText,headers:r,data:s,response:e}}catch(e){throw e}finally{if(t){let e=Se.get(t);e&&(e.timer&&(clearTimeout(e.timer),e.timer=null),Se.delete(t))}}}class Ae{cache=new Map;constructor(){}async get(e,t=-1){if(this.cache.has(e))return this.cache.get(e);let r=await Re({url:e,method:"GET",timeout:t,heaaders:{"content-type":"text/plain"}});if(r.ok)return this.cache.set(e,r.data),r.data;throw Error(r.statusText)}remove(e){this.cache.delete(e)}}var Ee=(e=>(e[e.Loading=0]="Loading",e[e.Loaded=1]="Loaded",e[e.Defining=2]="Defining",e[e.Defined=3]="Defined",e))(Ee||{});class Ce{exports;status;id;src}class je{register=new Map;constructor(){}get(e){return this.register.get(e)}put(e,t){this.register.set(e,t)}remove(e){let t=this.register.get(e);return this.register.delete(e),t}contains(e){return this.register.has(e)}clear(){this.register.clear()}}var Pe=(e=>(e.Busy="Busy",e.Free="Free",e.Reject="Reject",e.Exception="Exception",e.Finished="Finished",e))(Pe||{});const Te=Symbol("chainKey"),qe=Symbol("cursorKey"),Oe=Symbol("$persistentModeKey"),$e=Symbol("statusKey"),Fe=Symbol("argsKey"),ke=Symbol("exArgsKey"),_e=Symbol("successFnsKey"),Me=Symbol("errorFnsKey"),Ne=Symbol("sessionKey"),Ke=Symbol("_go");class Ie{[Te]=[];[qe]=0;[Oe]=!1;[$e]="Free";[Fe]=[];[ke]=[];[_e]=[];[Me]=[];[Ne];get session(){return this[Ne]}constructor(e,t=!1){this[Ne]=e,this[Oe]=t}[Ke](e,...t){let r=this[$e];if(this[$e]="Busy",this[qe]+=e,this[qe]<0&&(this[qe]=0),this[Fe]=t,"Exception"===r||"Reject"===r){let e=[{session:this[Ne]},...this[ke]];for(;this[Me].length>0;)try{let t=this[Me].shift();"function"==typeof t&&d((()=>{Reflect.apply(t,{},e)}))}catch(e){}return this[$e]=r,this[Te]=[],this[qe]=0,this}if("Finished"===r||this[qe]>=this[Te].length){let e=[{session:this[Ne]},...this[Fe]];for(;this[_e].length>0;){let t=this[_e].shift();"function"==typeof t&&d((()=>{Reflect.apply(t,{},e)}))}return this[$e]="Free",this}if(this[qe]>=this[Te].length)return this[$e]="Free",this;let n=this[Te][this[qe]];this[Oe]||(this[Te].splice(0,this[qe]+1),this[qe]=-1);let s=this[qe]+1;try{let e=!1,t={go:(t,...r)=>{e||(e=!0,Reflect.apply(this[Ke],this,[t,...r]))},resolve:(...t)=>{e||(e=!0,Reflect.apply(this[Ke],this,[1,...t]))},reject:(...t)=>{e||(e=!0,Reflect.apply(this.reject,this,[...t]))},insert:t=>{e||(this[Te].splice(s,0,t),s++)},session:this[Ne]};d((()=>{Reflect.apply(n,{},[t,...this[Fe]])}))}catch(e){this.throw(e)}return this}go(e,...t){return Reflect.apply(this[Ke],this,[e,...t])}finish(...e){return this[$e]="Finished",this[Fe]=e,Reflect.apply(this[Ke],this,[0])}reject(...e){return this[$e]="Reject",this[ke]=e,Reflect.apply(this[Ke],this,[0])}throw(...e){return this[$e]="Exception",this[ke]=e,Reflect.apply(this[Ke],this,[0])}reset(...e){this[$e]="Busy",this[Fe]=e,this[Te]=[],this[qe]=0;let t=[{session:this[Ne]},...this[Fe]];for(;this[_e].length>0;){let e=this[_e].shift();d((()=>{Reflect.apply(e,this,t)}))}return this[$e]="Free",this}post(e){return"Reject"===this[$e]||"Exception"===this[$e]||(Array.isArray(e)?this[Te]=[...this[Te],...e]:this[Te].push(e),"Busy"===this[$e]||Reflect.apply(this[Ke],this,[0,...this[Fe]])),this}wait(e,t){return e&&"function"==typeof e&&this[_e].push(e),t&&"function"==typeof t&&this[Me].push(t),"Busy"===this[$e]||Reflect.apply(this[Ke],this,[0,...this[Fe]]),this}exception(e){return e&&"function"==typeof e&&this[Me].push(e),"Busy"===this[$e]?this:Reflect.apply(this[Ke],this,[0,...this[Fe]])}isFinish(){return"Reject"==this[$e]||"Free"==this[$e]&&this[qe]>=this[Te].length}}class Le{head;isOldWebKit;moduleManager=new je;resource=new Ae;options;_query;set query(e){this._query=e}get query(){return this._query}constructor(e={}){const t=ge();this.head=t.head||t.getElementsByTagName("head")[0]||t.documentElement,this.isOldWebKit=+navigator.userAgent.replace(/.*(?:AppleWebKit|AndroidWebKit)\/(\d+).*/,"$1")<536,this.options=e,this.options.paths||(this.options.paths={}),this.options.alias||(this.options.alias={})}ensure(...e){let t=[],r=e.length-1,n={};"object"==typeof e[r]&&(Object.assign(n,e[r]),r--);let s=null;"function"==typeof e[r]&&(s=e[r],r--);for(let n=0;n<=r;n++)if(Array.isArray(e[n])){let r=e[n];for(let e=0;e<r.length;e++)void 0!==r[e]&&t.push(this.resolvePath(r[e]))}else{let r=e[n].split(",");for(let e=0;e<r.length;e++)void 0!==r[e]&&t.push(this.resolvePath(r[e]))}let o=new He(t.length,((e,t)=>{if(o.isOK())try{"function"==typeof s&&Reflect.apply(s,{},t)}catch(e){}else try{"function"==typeof s&&Reflect.apply(s,{},[])}catch(e){}})),i=new Ie;for(let e=0;e<t.length;e++){let r=new Ue(e,t[e],n,o);this.mount(i,r)}return this}remove(...e){let t=[],r=e.length-1,n={};"object"==typeof e[r]&&(Object.assign(n,e[r]),r--);let s=null;"function"==typeof e[r]&&(s=e[r],r--);for(let n=0;n<=r;n++)if(Array.isArray(e[n])){let r=e[n];for(let e=0;e<r.length;e++)void 0!==r[e]&&t.push(this.resolvePath(r[e]))}else{let r=e[n].split(",");for(let e=0;e<r.length;e++)void 0!==r[e]&&t.push(this.resolvePath(r[e]))}return t.forEach((e=>{this.unmount(e,n)})),"function"==typeof s&&Reflect.apply(s,{},[]),this}mount(e,t){const r=ge();if(this.isNaturePath(t.src,"js")){let r=t.params.jsPoint;return r||(r=this.head),void this.mountJS(e,t,r)}if(this.isNaturePath(t.src,"css")){let r=t.params.cssPoint;return r||(r=this.head),void this.mountCSS(e,t,r)}if(this.isNaturePath(t.src,"html")){let n=t.params.htmlPoint;return n||(n=r.body),void this.mountHTML(e,t,n)}let n=this.getFileNamePostfix(t.src);if("js"===n||0===n.length){let r=t.params.jsPoint;return r||(r=this.head),void this.mountJS(e,t,r)}if("css"===n){let r=t.params.cssPoint;return r||(r=this.head),void this.mountCSS(e,t,r)}{let n=t.params.htmlPoint;return n||(n=r.body),void this.mountHTML(e,t,n)}}mountHTML(e,t,r){e.post((e=>{let n=t.params.timeout??this.options.timeout??3e4,s=t.src;this.resource.get(s,n).then((n=>{r.innerHTML=n,t.progress.work(!0,t.index,n),e.resolve()}),(r=>{t.progress.work(!1,t.index,null),e.reject()}))}))}mountCSS(e,t,r){e.post((e=>{const n=ge(),s=t.src,o=n.createElement("link"),i="onload"in o;if(this.isOldWebKit||!i){const n={timeout:this.options.time||3e3,time:0,isOldWebKit:this.isOldWebKit,success:()=>{t.progress.work(!0,t.index,t.src),e.resolve()},error:()=>{try{r.removeChild(o)}catch(e){}t.progress.work(!1,t.index,null),e.resolve()}};setTimeout((()=>{De(o,n)}),1)}else o.onload=()=>{o.onload=o.onerror=null,t.progress.work(!0,t.index,t.src),e.resolve()},o.onerror=()=>{try{r.removeChild(o)}catch(e){}o.onload=o.onerror=null,t.progress.work(!1,t.index,null),e.reject()};let l=n.getElementById(s);l&&l.parentNode&&l.parentNode.removeChild(l),o.rel="stylesheet",o.type="text/css",o.id=s,o.href=s,r.appendChild(o)}))}mountJS(e,t,r){e.post((e=>{let n=t.src,s=this.moduleManager.get(n);if(s&&(s.status==Ee.Defined||s.status==Ee.Loaded)){if(s.exports)return t.progress.work(!0,t.index,s.exports),void e.resolve();if(document.querySelector(`script[src='${n}`))return t.progress.work(!0,t.index,s.exports),void e.resolve()}s=new Ce,s.id=n,s.src=n,s.status=Ee.Loading,this.moduleManager.put(n,s);const o=ge().createElement("script");if("onload"in o)o.onload=()=>{o.onload=o.onerror=null,s.status==Ee.Loading&&(s.status=Ee.Loaded,t.progress.work(!0,t.index,n)),e.resolve()},o.onerror=()=>{try{r.removeChild(o)}catch(e){}o.onload=o.onerror=null,t.progress.work(!1,t.index,null),e.reject()};else{let r=o;r.onreadystatechange=()=>{/loaded|complete/.test(r.readyState)&&(r.onreadystatechange=null,s.status==Ee.Loading&&(s.status=Ee.Loaded,t.progress.work(!0,t.index,n)),e.resolve())}}o.defer=!0,o.src=n,me().define=this.createDefine(s,t),r.appendChild(o)}))}unmount(e,t={}){const r=ge(),n=this.getFileNamePostfix(e);if("js"===n||0===n.length){const t=r.querySelector(`script[src="${e}"]`);return t&&t.parentNode&&t.parentNode.removeChild(t),void this.moduleManager.remove(e)}if("css"!==n){this.resource.remove(e);let n=t.htmlPoint;return n||(n=r.body),void(n.innerHTML="")}{const t=r.querySelector(`style[href="${e}"]`);t&&t.parentNode&&t.parentNode.removeChild(t)}}trimEmptyElement(e){let t=[];for(let r=0;r<e.length;r++){let n=e[r].trim();0!==n.length&&t.push(n)}return t}createDefine(e,t){let r=this,n=function(...n){e.status=Ee.Defining;let s,o,i,l=n.length;1===l?(i=n[0],s=void 0):2===l?(i=n[1],Array.isArray(n[0])?(o=r.trimEmptyElement(n[0]),s=void 0):o=void 0):(s=n[0],o=r.trimEmptyElement(n[1]),i=n[2]),s&&(e.id=s,r.options.alias[s]=e.src),o&&o.length>0?r.ensure(o,((...r)=>{e.exports="function"==typeof i?Reflect.apply(i,e,r):i,e.status=Ee.Defined,t.progress.work(!0,t.index,e.exports)})):(e.exports="function"==typeof i?Reflect.apply(i,e,[]):i,e.status=Ee.Defined,t.progress.work(!0,t.index,e.exports))};return n.amd=!0,n}resolvePath(e){try{if(this.isNaturePath(e,"all"))return e;e=this.parserPath(e,!0);let t=this.getFileNamePostfix(e);t=t.toLowerCase();let r=this.createSearch(this.query);return-1==e.indexOf("?")?("js"!==t&&"css"!==t&&"html"!==t&&(e+=".js"),r.length>0&&(e+=`?${r}`)):r.length>0&&(e+=`&${r}`),e}catch(e){throw e}}createSearch(e){let t="";if(e){for(let r in e){let n=`${e[r]}`;t+=`${encodeURIComponent(r)}=${encodeURIComponent(n)}&`}t.length>0&&(t=t.substring(0,t.length-1))}return t}getFileNamePostfix(e){let t=e.lastIndexOf("?");-1==t&&(t=e.length);let r=e.lastIndexOf(".",t);return-1==r?"":e.substring(r+1,t)}isNaturePath(e,t){if(null==this.options.nature)return!1;if("all"===t||"js"===t){let t=this.options.nature.js;if(void 0!==t)for(let r=0;r<t.length;r++){let n=t[r];if(0===e.indexOf(n))return!0}}if("all"===t||"css"===t){let t=this.options.nature.css;if(void 0!==t)for(let r=0;r<t.length;r++){let n=t[r];if(0===e.indexOf(n))return!0}}if("all"===t||"html"===t){let t=this.options.nature.html;if(void 0!==t)for(let r=0;r<t.length;r++){let n=t[r];if(0===e.indexOf(n))return!0}}return!1}parserPath(e,t){if(0==e.indexOf("http://")||0==e.indexOf("https://")||0==e.indexOf("file:///"))return e;if(0==e.indexOf("/"))return xe+e.slice(1);if(0==e.indexOf("./"))return xe+e.slice(2);if(t){let t=this.options.alias[e];if(!t){let r=e.indexOf("/");if(-1==r)t=e;else{let n=e.slice(0,r),s=this.options.paths[n];t=s?s+e.slice(r):e}}return this.parserPath(t,!1)}return xe+e}}function De(e,t){let r=e.sheet,n=!1;if(t.isOldWebKit)r&&(n=!0);else if(r)try{r.cssRules&&(n=!0)}catch(e){"NS_ERROR_DOM_SECURITY_ERR"===e.name&&(n=!0)}setTimeout((()=>{t.time+=20,n?t.success():t.time>t.timeout?t.error():De(e,t)}),20)}class He{callback;values;status;size;lastIndex;constructor(e,t){this.size=e,this.callback=t,this.status=!0,this.values=[],this.lastIndex=-1}work(e,t,r){if(this.status=e,!0===this.status&&(this.lastIndex!==t&&this.size--,this.lastIndex=t,this.values.push(r)),0===this.size||!1===this.status)try{Reflect.apply(this.callback,this,[this.status,this.values])}catch(e){}}isOK(){return this.status}}class Ue{index;src;params;progress;constructor(e,t,r,n){this.index=e,this.src=t,this.params=r,this.progress=n}}const Be=Symbol("_notifyChange");class We{currentRoute;routes;constructor(e,t){this.currentRoute=e,this.routes=t}}const Ve=Symbol("_navigateFirstRoute"),ze=Symbol("_getRouteMark"),Je=Symbol("_getUrlSearch"),Ge=Symbol("_generateLocation"),Xe=Symbol("_setRoteMarkhRecorder");class Ye{base;storage;mode;query;firstNavigate=!0;historyMonitor;traceless=!1;changeHandler;historyChange;lastMark;constructor(e="hash",t="",r="",n=!0,s=!0,o=!1,i){this.mode=e,this.base=t,this.query=r,this.firstNavigate=n,this.historyMonitor=s,this.traceless=o,this.storage=i??me().sessionStorage}init(e=!0){const t=me();return"function"!=typeof this.historyChange&&(this.historyChange=()=>{if(!this.historyMonitor)return;const e=t.history.state;this[Be](e)}),ve(t,"popstate",this.historyChange),this.firstNavigate&&e&&this[Ve](),Promise.resolve()}destroy(){if(this.historyChange){be(me(),"popstate",this.historyChange)}}[Ve](){let e=this[ze]()??"/";const t=this.storage.getItem(e);if(t)try{const e=JSON.parse(t);return void this[Be](e)}catch{}const r=e.indexOf("!");let n;n=-1!=r?e.substring(r+1):e;const s=new Y;s.path=n,s.query=this[Je](),this[Be]([s])}[Xe](e,t){if(this.historyMonitor)try{this.lastMark&&this.storage.removeItem(this.lastMark);let r=JSON.stringify(t);this.storage.setItem(e,r),this.lastMark=e}catch(e){}}[Be](e){"function"==typeof this.changeHandler&&this.changeHandler(e)}[ze](){const e=me();if("path"===this.mode){let t=e.location.pathname;this.base&&0==t.indexOf(this.base)&&(t=t.substring(this.base.length));const r=t.indexOf("#");return-1!=r&&(t=t.substring(0,r)),t}{const t=e.location.hash,r=t.indexOf("#");if(-1!=r)return t.substring(r+1)}return null}[Je](){return me().location.search}listen(e){this.changeHandler=e}go(e){me().history.go(e)}push(e){let t=this[Ge](e.currentRoute);this.traceless||me().history.pushState(e.routes,"",t),this[Xe](e.currentRoute.fullPath,e.routes)}replace(e){let t=this[Ge](e.currentRoute);this.traceless||me().history.replaceState(e.routes,"",t),this[Xe](e.currentRoute.fullPath,e.routes)}[Ge](e){const t=me();let r;if(e.query){let t="";if("object"==typeof e.query)for(let r in e.query){let n=encodeURIComponent(e.query[r]),s=`${encodeURIComponent(r)}=${n}`;t.length>0&&(t+="&"),t+=s}else t=e.query;this.query?(r=`${this.query}&${t}`,"?"!==r.charAt(0)&&(r=`?${r}`)):r=`?${t}`}const n=t.location;let s,o=e.fullPath;return o.startsWith(W)&&(o=o.substring(W.length+2)),s=r?"path"==this.mode?`${this.base}/${o}${r}`:`${n.pathname}${r}#${o}`:"path"==this.mode?`${this.base}/${o}`:`${n.pathname}#${o}`,`${n.origin}${s}`}}function Qe(e=!0,t="",r=!0,n=!1,s){return new Ye("hash","",t,e,r,n,s)}class Ze{maxSize=50;cursor=-1;queue=[];changeHandler;base;historyMonitor=!1;traceless=!1;constructor(e,t=50){this.base=e,this.maxSize=t}init(e=!0){return Promise.resolve()}destroy(){this.queue=[]}listen(e){this.changeHandler=e}[Be](e){"function"==typeof this.changeHandler&&this.changeHandler(e)}go(e){if(0==this.queue.length||this.cursor<=0||this.cursor>=this.queue.length-1)return;let t=this.cursor+e;if(t<0?t=0:t>this.queue.length-1&&(t=this.queue.length-1),t!=this.cursor){this.cursor=t;const e=this.queue[t];this[Be](e.routes)}}push(e){this.queue.length>=this.maxSize&&this.queue.splice(0,1),this.queue.push(e),this.cursor=this.queue.length-1}replace(e){let t=this.queue.length-this.cursor;this.queue.splice(this.cursor,t),this.queue[this.cursor]=e}}function et(e="",t=50){return new Ze(e,t)}const tt=Symbol("_constructRouteModel"),rt=Symbol("_findRouteModel"),nt=Symbol("_findRootView"),st=Symbol("_getFirstView"),ot=Symbol("_removeView"),it=Symbol("_buildPage"),lt=Symbol("_resolveComponent"),at=Symbol("_update"),ut=Symbol("_merge"),ht=Symbol("ignoreHistoryChangeOnceKey"),ct=Symbol("_handleHistoryChange"),ft=Symbol("_handleRouteUpdated"),pt=Symbol("routeUpdatedCallback"),dt=Symbol("currentRoutes"),yt=Symbol("current"),mt=Symbol("_addRouteRecorder"),gt=Symbol("_removeRouteRecorder"),vt=Symbol("_cloneRouteRecorder"),bt=Symbol("_hanldeError"),xt=Symbol("errorCallback"),wt=Symbol("registerKey"),St=Symbol("notFoundKey"),Rt=Symbol("notFoundPathKey"),At=Symbol("forestKey"),Et=Symbol("historyKey"),Ct=Symbol("beforeFiltersKey"),jt=Symbol("afterFiltersKey"),Pt=Symbol("destroyFiltersKey"),Tt=Symbol("mainDispatcherKey"),qt=Symbol("initKey"),Ot=Symbol("requireKey"),$t=Symbol("readyKey"),Ft=Symbol("readyHandlersKey"),kt=Symbol("_markReady"),_t=Symbol("_createNextFn"),Mt=Symbol("_start"),Nt=Symbol("_before"),Kt=Symbol("_after"),It=Symbol("_destroy"),Lt=Symbol("_load"),Dt=Symbol("_unload"),Ht=Symbol("_loadDependency"),Ut=Symbol("resolvedModulesKey"),Bt=Symbol("resolveDependencyKey"),Wt=Symbol("routerGuardKey");class Vt{[wt]=new Array;[St];[Rt]="*";[$t]=!1;[Ft]=[];[At]=new fe;[Et];[dt]=new Array;[xt]=null;[pt]=null;[Ct]=new Array;[jt]=new Array;[Pt]=new Array;[Tt]=new Ie;[Ut]=new Map;[Bt]=null;[Wt]=new de;[qt]=!1;[yt]=e.ref(null);[Ot]=null;get require(){return ye?(this[Ot]||(this[Ot]=new Le),this[Ot]):null}get current(){return this[yt].value}options;constructor(e){this.options=e??{},this.options.notFoundPath&&this.setNotFoundPath(this.options.notFoundPath);let t=this.options.routes||[];this.addRoutes(t),this.options.notFound&&this.setNotFoundRoute(this.options.notFound),e.history?this[Et]=e.history:this[Et]=ye?Qe():et(),this[Et]?.listen((async e=>{let t=!0;try{if("string"==typeof e){let t=this[z](e);t&&await this[ct]([t])}else await this[ct](e)}catch(e){t=!1}!1===this[$t]&&this[kt](t)}))}[bt](e="error",t){if(t&&"function"==typeof t.error)try{t.error(e)}catch{}if("function"==typeof this[xt])try{this[xt](e,t)}catch{}}init(){!0!==this[qt]&&(this[Et]?.init(!this[$t]),this[qt]=!0)}isReady(){return this[$t]?Promise.resolve():new Promise(((e,t)=>{this[Ft].push([e,t])}))}[kt](e){this[$t]=!0,this[Ft].forEach((([t,r])=>{try{e?t():r()}catch(e){}}))}[ht]=!1;[ct](e){if(this[ht])return this[ht]=!1,Promise.resolve();try{if(!e){let e=[...this[dt]].reverse();return this[Dt](e),ye&&me().location.reload(),Promise.resolve()}let t=null,r=[],n=[],s=0;for(;s<e.length&&s<this[dt].length&&Y.isSame(e[s],this[dt][s]);s++)e[s].opsType===re.Open&&!0===e[s].active&&e[s].active!==this[dt][s].active&&(t=e[s]);if(s<e.length&&(r=e.slice(s)),s<this[dt].length&&(n=this[dt].slice(s).reverse()),0==n.length&&0==r.length){if(null!==t)return this.restore([t])}else{if(!(n.length>0))return this.restore(r);if(this[Dt](n)){if(r.length>0)return this.restore(r);if(null!==t)return this.restore([t])}}}catch(e){this[bt](e)}return Promise.resolve()}[ft](e){if(e)this[yt].value=e;else{let e=this[dt].length;this[yt].value=e>0?this[dt][e-1]:null}if("function"==typeof this[pt])try{this[pt](this[yt].value)}catch{}}[mt](e,t=-1){t<0||t>=this[dt].length?this[dt].push(e):this[dt].splice(t,0,e)}[vt](){let e=[];for(let t of this[dt]){let r=Y.clone(t,!0);e.push(r)}return e}[gt](e){if(null==this[dt])return;let t=-1;for(let r=0;r<this[dt].length;r++)if(Y.isSame(this[dt][r],e)){t=r;break}if(-1!=t){let e=this[dt][t];this[dt].splice(t,1),this[It](e,e.session)}}set hisotryMonitor(e){this[Et]&&(this[Et].historyMonitor=e)}get historyMonitor(){return!!this[Et]&&this[Et].historyMonitor}set traceless(e){this[Et]&&(this[Et].traceless=e)}get traceless(){return!!this[Et]&&this[Et].traceless}onRouteUpdated(e){this[pt]=e}onError(e){this[xt]=e}beforeEach(e){this[Ct].push(e)}removeBeforeEach(e){const t=this[Ct].indexOf(e);return-1!==t&&(this[Ct].splice(t,1),!0)}afterEach(e){this[jt].push(e)}removeAfterEach(e){const t=this[jt].indexOf(e);return-1!==t&&(this[jt].splice(t,1),!0)}destroyEach(e){this[Pt].push(e)}removeDestroyEach(e){const t=this[Pt].indexOf(e);return-1!==t&&(this[Pt].splice(t,1),!0)}setResolveDependency(e){this[Bt]=e}addRoutes(e){for(let t of e)this.addRoute(t)}addRoute(e,t=-1){if(e.path===this[Rt])return void this.setNotFoundRoute(e);const r=this[tt](e);if(-1==t)this[wt]=[...this[wt],...r];else for(let e=r.length-1;e>=0;e--)this[wt].splice(t,0,r[e])}removeRoute(e){const t=this[z](e);if(null===t)return!1;for(let e=0;e<this[wt].length;e++){const r=this[wt][e];if(t?.path&&r.path===t.path)return this[wt].splice(e,1),!0;if(t?.name&&r.name===t.name)return this[wt].splice(e,1),!0}return!1}hasRoute(e){const t=this[z](e);return null!==t&&-1!==this[wt].findIndex((e=>{if(t?.path&&e.path===t.path||t?.name&&e.name===t.name)return!0}))}setNotFoundPath(e){this[Rt]=e}setNotFoundRoute(e){const t=this[tt](e);this[St]=t[0]}getRoutes(){return[...this[wt]]}[tt](e){let t=e.path??"";t.length>0&&"/"!==t.charAt(0)&&(t=`/${t}`);let r=e.components??(e.component&&{"":e.component});if(null==r){let r=new ee;return r.path=t,r.redirect=e.redirect,[r]}let n=[];for(let t in r){let s=r[t];0===t.length&&(t=W);let o=new Q(t,s,e.props,e.meta);n.push(o)}let s=!1,o=[];if(e.children)for(let r of e.children){let e=this[tt](r);for(let r of e){let e=new ee;e.name=r.name,r.path&&r.path.length>0?e.path="/"!==t?`${t}${r.path}`:r.path:(s=!0,e.path=t);let i=new Z;i.models=[...n],e.layers=[i,...r.layers],o.push(e)}}if(!s){let r=new Z;r.models=n;let s=new ee;s.name=e.name,s.path=t,s.layers=[r],o.splice(0,0,s)}return o}[rt](e){let t=e.route;try{for(let r of this[wt]){if(t.path&&r.path){let n=r.match;n||(n=r.match=L(r.path));let s=n(t.path);if(!s)continue;if(r.redirect){let n=new Y;h(!0,n,t),n.path=r.redirect;let s={route:n,find:void 0};return!!this[rt](s)&&(e.route=s.route,e.find=s.find,!0)}if(t.params=t.params??{},h(!0,t.params,s.params),t.query){let e=t.query;if("string"==typeof e){let r={},n=e.split("&");for(let e of n){let t=e.split("=");if(2!==t.length)continue;let n=decodeURIComponent(t[0].trim()),s=decodeURIComponent(t[1].trim());r[n]=s}h(!0,t.params,r)}else"object"==typeof e&&h(!0,t.params,e)}return e.find=r,!0}if(t.name===r.name){t.params=t.params??{};let n=I(r.path);return t.path=n(t.params),e.find=r,!0}}}catch(e){"function"==typeof t.error&&t.error(e.message)}return!1}[z](e){let t=null;if(Array.isArray(e))if(t=new Y,"object"==typeof e[0])t=Y.from(e[0]);else for(let r=0;r<e.length;r++)0===r?"/"===e[r].charAt(0)?t.path=e[r]:t.name=e[r]:1===r?t.params=e[r]:2===r?t.root=e[r]:3===r&&h(!1,t,e[r]);else"object"==typeof e?t=Y.from(e):"string"==typeof e&&(t=new Y,"/"==e.charAt(0)?t.path=e:t.name=e);if(t){if(t.path){let e=t.path.indexOf("?");-1!==e&&e<t.path.length-1&&(t.query=t.path.substring(e+1),t.path=t.path.substring(0,e))}t.root=t.root??W,t.opsType=t.opsType??this.options.defaultOperationType??re.Push}return t}push(...e){let t=this[z](e);return t?(t.opsType=t.opsType||re.Push,this.to(t)):(this[bt]("resolve route fail",t),this)}put(...e){let t=this[z](e);return t?(t.opsType=re.Put,this.to(t)):(this[bt]("resolve route fail",t),this)}replace(...e){let t=this[z](e);return t?(t.opsType=re.Replace,this.to(t)):(this[bt]("resolve route fail",t),this)}append(...e){let t=this[z](e);return t?(t.opsType=re.Append,this.to(t)):(this[bt]("resolve route fail",t),this)}remove(e){return new Promise((t=>{this[Tt].post((r=>{try{if(0===this[dt].length)return r.resolve(),void t(!1);let n,s=-1,o=[];if(e){if(n=e.root?e.root:this[dt][0].root??W,e.all)for(let e=this[dt].length-1;e>0;e--){let t=this[dt][e];t.opsType===re.Append&&t.root===n&&(o.splice(0,0,t),s=e-1)}else if(e.until)for(let t=this[dt].length-1;t>0;t--){let r=this[dt][t];if(r.opsType===re.Append&&r.root===n){if("/"===e.until.charAt(0)&&e.until===r.path){s=t;break}if(e.until===r.name){s=t;break}o.splice(0,0,r)}}}else{n=W;let e=this[st](this[At]);e&&(n=e.name);for(let e=this[dt].length-1;e>0;e--){let t=this[dt][e];if(t.opsType===re.Append&&t.root===n){o.push(t),s=e-1;break}}}if(0===o.length){let e="can not find route";return r.resolve(e),void t(!1)}let i=0;if(this[dt].forEach((e=>{e.opsType!==re.Put&&i++})),this[Dt](o)){let e=0;this[dt].forEach((t=>{t.opsType!==re.Put&&e++}));let n=i-e;this[ht]=!0,this.back(n),r.resolve(),t(!0)}}catch(e){this[bt](e),r.resolve(),t(!1)}}))}))}open(...e){let t=this[z](e);return t?(t.opsType=re.Open,this.to(t)):(this[bt]("resolve route fail",t),this)}close(e){return this[Tt].post((t=>{try{let r=this[z](e);if(!r)return void t.reject("resolve route fail");let n=[];for(let e=0;e<this[dt].length;e++){let t=this[dt][e];if(t.root===r.root){if(r.path&&r.path===t.path){n.push(t);break}if(r.name&&r.name===t.name){n.push(t);break}}}if(0===n.length)return void t.resolve();if(this[Dt](n)){let e=Y.clone(r,!0);const t=new We(e,this[vt]());this[Et]?.replace(t),this[ft]()}t.resolve()}catch(e){this[bt](e),t.resolve()}})),this}to(...e){let t=this[z](e);if(!t)return this[bt]("resolve route fail",t),this;let r=this[Wt].acquire(t);return null==r?(this[bt]("route forbid",t),this):(this[Tt].post((e=>{try{let n=this[Mt](t);this[Nt](n),!n.session?.routeModel&&this[Bt]&&this[Ht](n),this[Lt](n),this[Kt](n),n.wait(((n,s)=>{let o=n.session.to;try{let e=Y.clone(o,!0);const t=new We(e,this[vt]());o.opsType===re.Replace?this[Et]?.replace(t):this[Et]?.push(t)}catch(e){}if(this[Wt].release(r),this[ft](o),"function"==typeof t.success)try{Reflect.apply(t.success,{},[])}catch(e){}!1===this[$t]&&this[kt](!0),e.resolve()}),((n,s)=>{this[Wt].release(r),this[bt](s,t),!1===this[$t]&&this[kt](!1),e.resolve()}))}catch(n){this[Wt].release(r),this[bt](n,t),e.resolve()}})),this)}back(e=1){this[Et]?.go(-e)}[_t](e){return(t,r)=>{if("boolean"==typeof t)t?e.resolve():e.reject(r);else if(t){let r=this[z](t);if(r){let t=e.session.to;r.success=t.success,r.error=t.error,e.session.to=r,e.session.routeModel=null,e.resolve()}else e.reject("route resolve fail")}else e.resolve()}}[Mt](e){let t=this[dt].length>0?this[dt][0]:void 0,r=new X(e,t),n={route:e,find:null};return this[rt](n),n.find&&(r.routeModel=n.find,e.matched=function(e){let t=[];return e.layers.forEach((e=>{null==e.models||null==e.models||e.models.forEach((e=>{if(null!=e&&null!=e)if("object"==typeof e.meta){let r=h(!0,{},e.meta);t.push(r)}else e.meta&&t.push(e.meta)}))})),t}(n.find),Array.isArray(e.matched)&&e.matched.length>0&&(e.meta=n.find.layers[0].models[0].meta)),new Ie(r)}[Nt](e){for(let t of this[Ct])e.post((e=>{let r=this[_t](e);Reflect.apply(t,{},[e.session.to,e.session.from,r,e.session])}))}[Kt](e){e.post((e=>{for(let t of this[jt])try{Reflect.apply(t,{},[e.session.to,e.session.from,e.session])}catch(e){}e.resolve()}))}[It](e,t){for(let r of this[Pt])try{Reflect.apply(r,{},[e,t])}catch(e){}"function"==typeof e.destroy&&Reflect.apply(e.destroy,e,[])}[Ht](e){let t=e.session,r=Reflect.apply(this[Bt],this,[t?.to]);if(null==r)return;Array.isArray(r)||(r=[r]);let n=[];for(let e of r)this[Ut].has(e)||n.push(e);0!==n.length&&e.post((e=>{this.require.ensure(n,((...t)=>{if(t){for(let e of t){if(!e)continue;let t;t=a(e)?e.default:e,Array.isArray(t)&&this.addRoutes(t)}for(let e of n)this[Ut].set(e,!0);e.resolve()}else e.reject()}))}))}[Lt](e){e.post((e=>{let t=e.session.to,r=e.session.routeModel;if(null==r){let n={route:t,find:null};if(this[rt](n))r=n.find,e.session.routeModel=r;else{if(!this[St])return void e.reject(`not find route model, path:${t.path??t.name}`);r=this[St]}}let n=X.from(e.session);this[it](t,r,n).then((t=>{this[At],e.resolve()}),(t=>{e.reject(t)}))}))}[Dt](e){if(0==e.length)return!0;let t=this[At],r=[];for(let n of e){let e=this[nt](t,n);null!=e&&r.push({...e,route:n})}if(0==r.length){let e="can not find view index";return this[bt](e),!1}for(let e of r.reverse())this[ot](t,{x:e.x,y:e.y},[e.route.index??0],!0);return!0}[nt](e,t){let r,n=t.root??W;for(let t=0;t<e.layers.length;t++){let s=e.layers[t];for(let e=s.views.length-1;e>=0;e--){let o=s.views[e];if(o[se]&&o[le]===n)return r={x:e,y:t},r}}return null}[st](e){return e.layers.length>0&&e.layers[0].views.length>0?e.layers[0].views[0]:null}[ot](e,t,r=null,n=!0){if(t.y>=e.layers.length||t.x>=e.layers[t.y].views.length)return;let s=e.layers[t.y].views[t.x],o=!1,i=[],l=!1,a=s.slots.value;for(let e=a.length-1;e>=0;e--){let n=a[e];(null==r||-1!=r.indexOf(n.index))&&(n.route&&s[se]&&(this[gt](n.route),!0===n.active&&n.route.opsType==re.Append&&(l=!0)),i.push(new he(s,n.index,t.y)),a.splice(e,1))}if(0==a.length)n?s.slots.value=[...a]:e.layers[t.y].views.splice(t.x,1);else{if(l){let e=a[a.length-1];e.active=!0,e.route&&(e.route.active=e.active)}s.slots.value=[...a]}0==e.layers[t.y].views.length&&(o=!0);let u=t.y+1;for(;u<e.layers.length;u++){let t=e.layers[u].views,r=[];for(let n=t.length-1;(o||i.length>0)&&n>=0;n--){let s=t[n];if(s[ie]&&(o||he.include(i,s[ie]))){let t=s.slots.value;for(let e=t.length-1;e>=0;e--){let n=t[e];n.route&&s[se]&&this[gt](n.route),r.push(new he(s,n.index,u)),t.splice(e,1)}e.layers[u].views.splice(n,1)}}i=r,0==e.layers[u].views.length&&(o=!0)}}restore(e){if(e&&0!=this[wt].length)return new Promise(((t,r)=>{for(let t=0;t<e.length;t++){let r=e[t];this[Tt].post((e=>{let t=this[Mt](r);this[Nt](t),!t.session?.routeModel&&this[Bt]&&this[Ht](t),this[Lt](t),this[Kt](t),t.wait(((t,r)=>{e.resolve()}),((t,r)=>{this[bt](r),e.resolve()}))}))}this[Tt].post((e=>{e.resolve(),t()}))}));{let e=this[At];if(e.layers.length>0){let t=e.layers[0].views;t.length>0&&(t[0].slots.value=[])}return this[dt]=[],this[ft](),Promise.resolve()}}[it](e,t,r){let n=e.updateType??ne.Part;return this[lt](t).then((()=>{this[at](t,e,r,n)}))}[lt](e){let t=[];for(let r=0;r<e.layers.length;r++){let n=e.layers[r];for(let e=0;e<n.models.length;e++){let r=n.models[e];r.isResolved||t.push(r.resolve())}}return t.length>0?Promise.all(t):Promise.resolve()}[at](e,t,r,n){if(1!==e.layers[0].models.length)return Promise.reject("illegal route structure(multil root node)");const s=e.layers[0].models[0];let o,i=this[At],l=function(e){return 0==e.layers.length||0==e.layers[0].views.length}(i),a=t.root??W;!l&&n==ne.Part&&(o=this[nt](i,t));let u,h=0;if(null==o||null==o)if(l||n===ne.All){if(0==i.layers.length&&(i.layers[0]=new ce),0==i.layers[0].views.length){let e=t.root??W;u=new ue(e,!0,null),i.layers[0].views=[u]}else u=i.layers[0].views[0];o={x:0,y:0}}else{let e=t.slot;if(!e)return Promise.reject("can not rebuild view(because not route slot)");let r,n=e.level;if(n>i.layers.length)return Promise.reject("can not insert view(override level)");if(e.rootName){let t=i.layers[n-1];for(let s of t.views){if(s[se]&&s.name===e.rootName){r=new he(s,e.rootIndex??0,n-1);break}if(s[oe]&&s[oe].view.name===e.rootName&&s[oe].index===e.rootIndex){r=s[oe];break}}}if(!r)return Promise.reject("can not insert view(not find root node ref)");u=new ue(a,!0,r),i.layers[n].views.push(u),o={x:i.layers[n].views.length-1,y:n}}else u=i.layers[o.y].views[o.x];if(h=o.y,u[se]=!0,t.opsType===re.Append){t.index=f.get();let r=u.slots.value;if(r.length>0){let e=r[r.length-1];e.active=!1,e.route&&(e.route.active=e.active)}let n=new ae(t,s,t.index,!0);u.slots.value=[...r,n];let o=h+1,l=1,a=new he(u,t.index,h);this[ut](i,o,e,l,a)}else if(t.opsType===re.Open){let r=u.slots.value,n=!1;for(let e of r){if(null!==e.route&&Y.isSameForRouteModel(e.route,t)){if(1==e.active)return t.index=e.index,t.active=e.active,e.route=t,Promise.resolve();e.active=!0,n=!0,t.index=e.index,t.active=e.active,e.route=t,this[gt](e.route)}else e.active=!1;e.route&&(e.route.active=e.active)}if(!n){t.index=f.get(),t.active=!0;let n=new ae(t,s,t.index,!0);r.push(n);let o=h+1,l=1,a=new he(u,t.index,h);this[ut](i,o,e,l,a)}u.slots.value=[...r]}else{let r=u.slots.value;if(0==r.length){t.index=f.get(),u.slots.value=[new ae(t,s,t.index)];let r=h+1,n=1,o=new he(u,t.index,h);this[ut](i,r,e,n,o)}else{let n=r[0];if(n.model!==s){this[ot](i,o,null,!0),t.index=f.get(),u.slots.value=[new ae(t,s,t.index)];let r=h+1,n=1,l=new he(u,t.index,h);this[ut](i,r,e,n,l)}else{null!==n.route&&this[gt](n.route);let s=[];for(let e=1;e<r.length;e++)s.push(r[e].index);s.length>0&&this[ot](i,o,s,!0),t.index=n.index,n.route=t;let l=[new he(u,t.index,h)],a=h+1,c=1,f=new he(u,t.index,h);for(;l.length>0&&a<i.layers.length&&c<e.layers.length;a++,c++){let t=[];for(let e=0;e<i.layers[a].views.length;e++){let r=i.layers[a].views[e];r[ie]&&he.include(l,r[ie])&&t.unshift(e)}let r=[];for(let n of t){let t,s=i.layers[a].views[n],o=e.layers[c].models;for(let e=0;e<o.length;e++)if(s.name===o[e].name){t=o[e];break}if(t){let o=s.slots.value;if(0==o.length){let r=0;s.slots.value=[new ae(null,t,r)];let n=a+1,o=c+1;this[ut](i,n,e,o,f)}else{let l=o[0];if(l.model!==t){this[ot](i,{x:n,y:a},null,!0),s.slots.value=[new ae(null,t,0)];let r=a+1,o=c+1;this[ut](i,r,e,o,f)}else{s[se]&&null!==l.route&&this[gt](l.route);let e=[];for(let t=1;t<o.length;t++)e.push(o[t].index);e.length>0&&this[ot](i,{x:n,y:a},e,!0),r.push(new he(s,l.index,a))}}s[se]=!1}else this[ot](i,{x:n,y:a},null,!1)}l=r}this[ut](i,a,e,c,f)}}}if(u&&u[oe]){let e=u[oe];e&&(t.slot=new G(a,h,e?.view.name,e?.index??0))}r.to=void 0,r.routeModel=void 0,t.session=r,this[mt](t)}[ut](e,t,r,n,s){let o=n,i=t;for(;i<e.layers.length&&o<r.layers.length;i++,o++){let t=e.layers[i].views;for(let e of r.layers[o].models){let r=new ue(e.name,!1,s),n=new ae(null,e);r.slots.value=[n],t.push(r)}}for(;o<r.layers.length;o++){let t=new ce;t.views=[];for(let e of r.layers[o].models){let r=new ue(e.name,!1,s),n=new ae(null,e);r.slots.value=[n],t.views.push(r)}e.layers.push(t)}}[V](e,t,r,n,s,o){if(t<0||t>this[At].layers.length)return null;if(t<this[At].layers.length){let i=this[At].layers[t],l=null;for(let a of i.views){let i=!1;if(null!==r?(i=a.name===e&&a[oe]?.view===r,i&&-1!==n&&(i=a[oe]?.index===n)):i=a.name===e,i){null!==s&&(a[ie]={view:s,index:o,level:t-1}),l=a;break}}if(null!==l)return l}let i=null,l=null;null!==s&&(i=s[se]?{view:s,index:o,level:t-1}:s[oe],l={view:s,index:o,level:t-1});let a=new ue(e,!0,i);if(a[ie]=l,t==this[At].layers.length){let e=new ce;e.views=[a],this[At].layers.push(e)}else this[At].layers[t].views.push(a);return a}}var zt=(e=>(e[e.limitless=0]="limitless",e[e.once=1]="once",e))(zt||{});const Jt=Symbol("registerKey");class Gt{policy;callback;constructor(e,t){this.callback=e,this.policy=t}}class Xt{[Jt]=new Map;constructor(){}on(e,t,r=!1){let n=this[Jt].get(e);n||(n=new Array,this[Jt].set(e,n));let s=new Gt(t,!0===r?1:0);return n.push(s),this}off(e,t){if(!t)return this[Jt].delete(e),this;let r=this[Jt].get(e);if(r)for(let e=0;e<r.length;e++)if(r[e].callback===t){r.splice(e,1);break}return this}bind(e,t,r=!1){return this.on(e,t,r)}unbind(e,t){return this.off(e,t)}once(e,t){return this.on(e,t,!0)}all(...e){let t=e.length;if(t<1)return this;let r=e[t-1];if("function"!=typeof r)return this;let n=t-1,s=new Array(n),o=[].splice.call(e,0,n);for(let e=0;e<o.length;e++)this.once(o[e],(t=>{s[e]=t,n-=1,0==n&&Reflect.apply(r,{},s)}));return this}emit(e,...t){let r=this[Jt].get(e);if(!r)return this;for(let e=0;e<r.length;){let n=r[e];if(1==n.policy?r.splice(e,1):e++,"function"==typeof n.callback)try{d((()=>{Reflect.apply(n.callback,{},t)}))}catch(e){}}return this}trigger(e,...t){return Reflect.apply(this.emit,this,[e,...t])}}const Yt=Symbol("registerKey");class Qt{[Yt]=new Map;constructor(){}set(e,t){this[Yt].set(e,t)}get(e){return this[Yt].get(e)}has(e){return this[Yt].has(e)}delete(e){return this[Yt].delete(e)}}const Zt=Symbol("lc");function er(e,t=!1){let r=e,n=r[Zt];if(!n){if(!t)return null;n=new Qt,r[Zt]=n}return n}function tr(e,t){let r=e;for(;null!==r;){let e=r[Zt];if(e&&e.has(t))return e.get(t);r=r.$parent}return null}function rr(e){if(Array.isArray(e.children)&&e.children.length>0){let t=e.children[0];if(null!=t&&null!=t.component&&null!=t.component.proxy)return er(t.component.proxy,!1)}return null}const nr=Symbol("hooksKey");function sr(e,t){let r=e.get(nr);if(null!=r)for(let e=r.length-1;e>=0;e--){let n=r[e];if(n.type===t)try{Reflect.apply(n.hook,n.target,[])}catch(e){}}}var or=(e=>(e.DEACTIVATED="da",e.ACTIVATED="a",e))(or||{});class ir{type;hook;target;constructor(e,t,r){this.target=r,this.hook=t,this.type=e}}function lr(t){return(r,n)=>{let s;if(n)s=n;else{let t=e.getCurrentInstance();if(null==t||null==t.proxy)return;s=t.proxy}let o=tr(s,nr);null!=o&&(e.onUnmounted((()=>{!function(e,t,r,n){let s=-1;for(let o=0;o<e.length;o++){let i=e[o];if(i.type===t&&i.hook===r&&i.target===n){s=o;break}}-1!=s&&e.splice(s,1)}(o,t,r,s)})),function(e,t,r,n){let s=new ir(t,r,n);e.push(s)}(o,t,r,s))}}let ar=lr("a"),ur=lr("da");const hr=Symbol("routeKey");function cr(t,r){let n=t.get(hr);if(n){let e={path:"",name:"",params:{},index:-1,session:{}};Object.assign(e,r),Object.assign(n,e)}else n=function(){let t=new Y;return t.path="",t.name="",t.params={},t.index=-1,e.shallowReactive(t)}(),Object.assign(n,r),t.set(hr,n)}function fr(e){return tr(e,hr)??null}const pr=Symbol("rk"),dr=Symbol("vd"),yr=Symbol("rv"),mr=Symbol("rvi"),gr=Symbol("pv"),vr=Symbol("pvi");function br(e,t=!1){let r=null;return r=t?e.showFromClass??e.enterFromClass:e.enterFromClass,r||(r=e.transitionName,r?t?`${r}-show-from`:`${r}-enter-from`:null)}function xr(e,t=!1){let r=null;return r=t?e.showActiveClass??e.enterActiveClass:e.enterActiveClass,r||(r=e.transitionName,r?t?`${r}-show-active`:`${r}-enter-active`:null)}function wr(e){let t,r=e.duration;return"object"==typeof r?t={enter:r.enter??-1,leave:r.leave??-1,show:r.show??-1,hide:r.hide??-1}:("string"==typeof r&&(r=0==r.length?-1:Number(r)),t={enter:r,leave:r,show:r,hide:r}),t}function Sr(e,t){e.classList.contains(t)||e.classList.add(t)}function Rr(e,t){e.classList.remove(t)}const Ar=ye&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout;function Er(e){Ar(e)}function Cr(e,t,...n){!r(t)||(null==e&&(e={}),Reflect.apply(t,e,n))}function jr(e,t,n,s=-1,o,i,l,a){if(r(i)){if(void 0!==o&&o>=0)return void setTimeout((()=>{Reflect.apply(i,e,[t,n,s]),r(a)&&Reflect.apply(a,e,[])}),o);let l=["animationend","transitionend"],u=r=>{l.forEach((e=>{be(t,e,u)})),Reflect.apply(i,e,[t,n,s]),a&&Reflect.apply(a,e,[])};l.forEach((e=>{ve(t,e,u)}))}if(r(l)){let r="animationcancel",o=i=>{Reflect.apply(l,e,[t,n,s]),be(t,r,o)};ve(t,r,o)}}function Pr(e){return!(!ye||null===e)&&(e.opsType===re.Append||e.opsType===re.Open)}function Tr(e,t,r,n,s={},o,i=-1){if(t&&(r||Pr(o))){let e=br(s,r);e&&Sr(n,e);let t=xr(s,r);t&&Sr(n,t)}else{let t=function(e,t=!1){let r=null;return r=t?e.onBeforeShow??e.onBeforeEnter:e.onBeforeEnter,r}(s,r);Cr(e,t,[n,o,i])}}function qr(e,t,n,s,o={},i,l,a,u){if(Pr(l)||n)if(t){let t=br(o,n),h=xr(o,n),c=function(e,t=!1){let r=null;return r=t?e.showToClass??e.enterToClass:e.enterToClass,r||(r=e.transitionName,r?t?`${r}-show-to`:`${r}-enter-to`:null)}(o,n);Er(c?()=>{jr(e,s,l,a,i,(()=>{h&&Rr(s,h),c&&Rr(s,c),r(u)&&u(e,u,[s])})),t&&Rr(s,t),c&&Sr(s,c)}:()=>{t&&Rr(s,t),h&&Rr(s,h),r(u)&&u(e,u,[s])})}else{let t=function(e,t=!1){let r=null;return r=t?e.onShow??e.onEnter:e.onEnter,r}(o,n),i=function(e,t=!1){let r=null;return r=t?e.onAfterShow??e.onAfterEnter:e.onAfterEnter,r}(o,n),h=function(e,t=!1){let r=null;return r=t?e.onShowCancelled??e.onEnterCancelled:e.onEnterCancelled,r}(o,n),c=t=>{!t&&r(i)?Cr(e,i,[s,l,a]):r(h)&&Cr(e,h,[s,l,a]),r(u)&&u(e,u,[s])};r(t)?Cr(e,t,[s,c,l,a]):c()}else r(u)&&u(e,u,[s])}function Or(e,t,n,s,o={},i,l,a,u,h){if(Pr(a)||n)if(t){let t=function(e,t=!1){let r=null;return r=t?e.hideFromClass??e.leaveFromClass:e.leaveFromClass,r||(r=e.transitionName,r?t?`${r}-hide-from`:`${r}-leave-from`:null)}(o,n),c=function(e,t=!1){let r=null;return r=t?e.hideActiveClass??e.leaveActiveClass:e.leaveActiveClass,r||(r=e.transitionName,r?t?`${r}-hide-active`:`${r}-leave-active`:null)}(o,n),f=function(e,t=!1){let r=null;return r=t?e.hideToClass??e.leaveToClass:e.leaveToClass,r||(r=e.transitionName,r?t?`${r}-hide-to`:`${r}-leave-to`:null)}(o,n);t&&Sr(s,t),c&&Sr(s,c),Er(f?()=>{jr(e,s,a,u,i,(()=>{c&&Rr(s,c),f&&Rr(s,f),r(h)&&Cr(e,h,[s]),!n&&r(l)&&l()})),t&&Rr(s,t),f&&Sr(s,f)}:()=>{t&&Rr(s,t),c&&Rr(s,c),r(h)&&Cr(e,h,[s]),!n&&r(l)&&l()})}else{let t=function(e,t=!1){let r=null;return r=t?e.onHide??e.onLeave:e.onLeave,r}(o,n),i=function(e,t=!1){let r=null;return r=t?e.onAfterHide??e.onAfterLeave:e.onAfterLeave,r}(o,n),c=function(e,t=!1){let r=null;return r=t?e.onHideCancelled??e.onLeaveCancelled:e.onLeaveCancelled,r}(o,n),f=t=>{!t&&r(i)?(Cr(e,i,[s,a,u]),r(h)&&Cr(e,h,[s]),!n&&r(l)&&l()):r(c)&&(Cr(e,c,[s,a,u]),r(h)&&Cr(e,h,[s]))};r(t)?Cr(e,t,[s,f,a,u]):f()}else!n&&r(l)&&l()}function $r(e,t={},r,n=-1){let s=y(t.css),o=t.mode??"default",i=wr(t);return{mode:o,persisted:!1,beforeEnter:o=>{Tr(e,s,!1,o,t,r,n)},enter:o=>{qr(e,s,!1,o,t,i.enter,r,n)},leave:(o,l)=>{Or(e,s,!1,o,t,i.leave,l,r,n)},clone:s=>$r(e,t,r,n)}}function Fr(e){return e.el}function kr(e,t,n={},s,o,i,l){if(i){let i=Fr(t);if(null==i)return;let a=y(n.css),u=wr(n);Tr(e,a,!0,i,n,s,o),qr(e,a,!0,i,n,u.show,s,o,(t=>{r(l)&&Cr(e,l,[t])}))}else r(l)&&Cr(e,l,[])}function _r(e,t,n={},s,o,i,l){if(i){let i=Fr(t);if(null==i)return;let a=y(n.css),u=wr(n);Or(e,a,!0,i,n,u.hide,null,s,o,(t=>{r(l)&&Cr(e,l,[t])}))}else r(l)&&Cr(e,l,[])}function Mr(e,t,r){return"function"==typeof e?Reflect.apply(e,{},[t,r]):e}function Nr(e,t){if(!e)return null;const r=e(t);return 1===r.length?r[0]:r}class Kr{node;state;constructor(e,t){this.node=e,this.state=t}}const Ir=e.defineComponent({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,required:!1,default:"default"},modelSlot:{type:[Object],required:!1},multi:{type:Boolean,required:!1,default:!1},tag:{type:[String,Object,Function],required:!1,default:"div"},viewTag:{type:[String,Object,Function],required:!1,default:"div"},viewTagProps:{type:[Object,Function],required:!1,default:()=>({})},viewClass:{type:[String,Function],required:!1},viewActiveClass:{type:[String,Function],required:!1},viewDeactiveClass:{type:[String,Function],required:!1},css:{type:[Boolean,String],required:!1,default:!0},transition:{type:[Boolean,String],required:!1,default:!1},transitionName:{type:String,required:!1},enterFromClass:{type:String,required:!1},enterActiveClass:{type:String,required:!1},enterToClass:{type:String,required:!1},leaveFromClass:{type:String,required:!1},leaveActiveClass:{type:String,required:!1},leaveToClass:{type:String,required:!1},showFromClass:{type:String,required:!1},showActiveClass:{type:String,required:!1},showToClass:{type:String,required:!1},hideFromClass:{type:String,required:!1},hideActiveClass:{type:String,required:!1},hideToClass:{type:String,required:!1},onBeforeEnter:{type:Function,required:!1},onEnter:{type:Function,required:!1},onAfterEnter:{type:Function,required:!1},onEnterCancelled:{type:Function,required:!1},onBeforeLeave:{type:Function,required:!1},onLeave:{type:Function,required:!1},onAfterLeave:{type:Function,required:!1},onLeaveCancelled:{type:Function,required:!1},onBeforeShow:{type:Function,required:!1},onShow:{type:Function,required:!1},onAfterShow:{type:Function,required:!1},onShowCancelled:{type:Function,required:!1},onBeforeHide:{type:Function,required:!1},onHide:{type:Function,required:!1},onAfterHide:{type:Function,required:!1},onHideCancelled:{type:Function,required:!1}},setup(t,r){const n=e.getCurrentInstance();if(null===n||null===n.proxy)return;const s=!0===t.multi,o=e.inject(pr,null),i=e.inject(dr,0),l=e.inject(yr,null),a=e.inject(mr,-1);let u=!1,c=null;const f=t.modelSlot;if(f){e.provide(dr,i+1),e.provide(mr,f.index),e.provide(vr,f.index);const t=f.route;if(!t)return;const r=er(n.proxy,!0);(function(e){let t=e.get(nr);t||(t=[],e.set(nr,t))})(r),cr(r,t)}else{if(null==o)return;const r=t.name,h=e.inject(gr,null),f=e.inject(vr,0);if(c=o[V](r,i,l,a,h,f),null===c)return;if(e.provide(gr,c),!0===c[se]&&e.provide(yr,c),s)u=y(t.transition??!0);else{u=y(t.transition??!1),e.provide(mr,-1),e.provide(dr,i+1),e.provide(vr,-1);const r=c.slots.value;if(r.length>0){const e=r[0].route;if(e){cr(er(n.proxy,!0),e)}}else{const e=er(n.proxy,!0);c.compensation=()=>{const t=c.slots.value;if(t.length>0){const r=t[0].route;return r&&cr(e,r),!0}return!1}}}}const p={value:new Map};return e.onUnmounted((()=>{p.value&&p.value.clear()})),()=>{if(s){const s=new Map,o=[],i=c?.slots.value,l=[];for(let a=0;a<i.length;a++){const c=i[a],f=`${t.name}-${c.index}`,d={modelSlot:c};let y;y=r.slots.default?e.h(Ir,d,{default:r.slots.default}):e.h(Ir,d);const m={},g=Mr(t.viewClass,c.route,a);"string"==typeof g&&g.length>0&&(m[g]=!0);const v=Mr(t.viewActiveClass,c.route,a),b=Mr(t.viewDeactiveClass,c.route,a),x=p.value.get(f);if("string"==typeof v&&v.length>0&&(m[v]=c.active),"string"==typeof b&&b.length>0&&(m[b]=!c.active),x&&c.active!==x.state){const e=x.node;c.active?l.unshift((()=>{kr(n,e,t,c.route,a,u,(()=>{let t=rr(e);null!=t&&sr(t,or.ACTIVATED)}))})):l.push((()=>{_r(n,e,t,c.route,a,u,(()=>{let t=rr(e);null!=t&&sr(t,or.DEACTIVATED)}))}))}const w={class:m,key:f},S=Mr(t.viewTagProps,c.route,a);null!==S&&"object"==typeof S&&h(!0,w,S),c.route?.viewTagAttrs&&"object"==typeof c.route?.viewTagAttrs&&h(!0,w,c.route.viewTagAttrs);const R=Mr(t.viewTag,c.route,a),A=e.h(R,w,{default:()=>[y]});if(s.set(f,new Kr(A,c.active)),u){const e=$r(n,t,c.route,a);A.transition=e}o.push(A)}p.value=s,function(e,t={}){Er((()=>{for(let r=0;r<e.length;r++)Reflect.apply(e[r],t,[])}))}(l,n);const a=Mr(t.tag,null,-1),f={};return Object.assign(f,r.attrs),e.h(a,f,{default:()=>o})}if(null!=f){const t=f.model,n={};t.props&&("object"==typeof t.props?h(!1,n,t.props):!0===t.props&&"object"==typeof f.route?.params&&h(!1,n,f.route?.params));const s=e.h(t.component,n);return Nr(r.slots.default,{Component:s,route:f.route})??s}{const s=c.slots.value;if(s.length>0){const o=s[0],i=o.model,l={};i.props&&("object"==typeof i.props?h(!1,l,i.props):!0===i.props&&"object"==typeof o.route?.params&&h(!1,l,o.route?.params));const a=e.h(i.component,l);if(u){const e=$r(n,t,o.route,-1);a.transition=e}return Nr(r.slots.default,{Component:a,route:o.route})??a}return Nr(r.slots.fallback,{})}}}});function Lr(e,t){return"function"==typeof e?Reflect.apply(e,{},[t]):e}let Dr=e.defineComponent({name:"RouterLink",inheritAttrs:!1,props:{tag:{type:[String,Object,Function],required:!1,default:"a"},to:{type:[String,Object,Function],required:!0},root:{type:String},activeClass:{type:[String,Function],required:!1,default:"fox-router-link-active"},exact:{type:[String,Boolean,Function],required:!1},exactActiveClass:{type:[String,Function],required:!1,default:"fox-router-link-exact-active"},event:{type:[String,Function],required:!1,default:"onClick"}},setup(t,r){const n=e.inject(pr,null);return()=>{let s=Lr(t.to,null),o=Lr(t.tag,s);if(null==o)return;let i=null,l=null;null!==n&&(i=n[z](s),t.root&&(i.root=t.root),l=n.current);let a={},u=Lr(t.activeClass,i);if("string"==typeof u&&u.length>0&&(a[u]=function(e,t){return null!=e&&null!=t&&!!(e.path&&t.path&&t.path.startsWith(e.path)||e.name&&e.name==t.name)}(i,l)),!0===Lr(t.exact,i)){let e=Lr(t.exactActiveClass,i);"string"==typeof e&&e.length>0&&(a[e]=function(e,t){return null!=e&&null!=t&&!!(e===t||e.path&&e.path===t.path||e.name&&e.name===t.name)}(i,l))}let c={class:a};("a"===o||"A"===o)&&(c.href=i?.path??i?.name??"#"),h(!0,c,r.attrs);let f=Lr(t.event,i);if("string"==typeof f){const e=e=>{null!=n&&null!=i&&function(e){if(!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey||e.defaultPrevented||null!=e.button&&0!==e.button)){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}}(e)&&n.to(i)};c[f]=e}return e.h(o,c,r.slots)}}}),Hr={get each(){return S},get type(){return g},get isFunction(){return r},get isArray(){return t},get isArrayLike(){return b},get makeArray(){return w},get merge(){return x},get isWindow(){return v},get isPlainObject(){return i},get isEqual(){return R}};const Ur=Symbol("fk"),Br=Symbol("fbk"),Wr=Symbol("fepk");function Vr(t){return t?t.$router:e.inject(pr)}exports.Bus=N,exports.EventChain=Ie,exports.EventProxy=Xt,exports.Route=Y,exports.Router=Vt,exports.cancel=function(e){let t=Se.get(e);return!!t&&(t.timer&&(clearTimeout(t.timer),t.timer=null),t.controller.abort(),Se.delete(e),!0)},exports.clone=c,exports.createFox=function(e={}){const t=new Vt(e),r=new N,n=new Xt,s={...Hr,get router(){return t},get bus(){return r},get Bus(){return N},get eventproxy(){return n},get EventProxy(){return Xt},get EventChain(){return Ie},get require(){return t.require},get request(){return Re},get extend(){return h},get clone(){return c},install(e){e.provide(pr,t),e.provide(Ur,s),e.provide(Br,r),e.provide(Wr,n),e.component("fox-router-view",Ir),e.component("fox-router-link",Dr),Reflect.defineProperty(e.config.globalProperties,"$fox",{get:()=>s}),Reflect.defineProperty(e.config.globalProperties,"$router",{get:()=>t}),Reflect.defineProperty(e.config.globalProperties,"$bus",{get:()=>r}),Reflect.defineProperty(e.config.globalProperties,"$bus",{get:()=>r}),Reflect.defineProperty(e.config.globalProperties,"$eventProxy",{get:()=>n}),e.config.globalProperties.$fox_on=function(e,t,r=!1){n.on(e,t,r)},e.config.globalProperties.$fox_off=function(e,t){n.off(e,t)},e.config.globalProperties.$fox_once=function(e,t){n.once(e,t)},e.config.globalProperties.$fox_all=function(...e){let t=n;Reflect.apply(t.all,t,e)},e.config.globalProperties.$fox_trigger=function(e,...t){let r=n;Reflect.apply(r.trigger,r,[e,...t])},e.config.globalProperties.$fox_emit=function(e,...t){let r=n;Reflect.apply(r.trigger,r,[e,...t])},e.mixin({computed:{$route(){return fr(this)}}}),t.init()}};return s},exports.createMemoryHistory=et,exports.createWebHashHistory=Qe,exports.createWebHistory=function(e=!0,t=null,r="",n=!0,s=!1,o){return null!==t&&(t=me().location.pathname),t&&t.endsWith("/")&&(t=t.substring(0,t.length-1)),new Ye("path",t??"",r,e,n,s,o)},exports.extend=h,exports.foxBusKey=Br,exports.foxEventProxyKey=Wr,exports.foxKey=Ur,exports.isArray=t,exports.isDate=e=>e instanceof Date,exports.isESModule=a,exports.isEqual=R,exports.isFunction=r,exports.isMap=e=>"[object Map]"===o(e),exports.isObject=n,exports.isPlainObject=i,exports.isPromise=e=>n(e)&&r(e.then)&&r(e.catch),exports.isSet=e=>"[object Set]"===o(e),exports.isString=e=>"string"==typeof e,exports.isSymbol=e=>"symbol"==typeof e,exports.onAfterRouteUpdate=function(t){const r=Vr(),n=(e,r,n)=>{try{Reflect.apply(t,{},[e,r])}catch(e){}n()};r.afterEach(n),e.onUnmounted((()=>{r.removeAfterEach(n)}))},exports.onBeforeRouteUpdate=function(t){const r=Vr(),n=(e,r,n)=>{try{Reflect.apply(t,{},[e,r])}catch(e){}n()};r.beforeEach(n),e.onUnmounted((()=>{r.removeBeforeEach(n)}))},exports.onFoxActivated=ar,exports.onFoxDeactivated=ur,exports.request=Re,exports.toBoolean=y,exports.toNumber=function(e){return"number"==typeof e?e:Number(e)},exports.toTypeString=o,exports.useBus=function(t){return t?t.$bus:e.inject(Br)},exports.useEventProxy=function(t){return t?t.$eventProxy:e.inject(Wr)},exports.useFox=function(t){return t?t.$fox:e.inject(Ur)},exports.useRoute=function(t){return t||(t=e.getCurrentInstance()?.proxy??void 0),t?fr(t):null},exports.useRouter=Vr;
1
+ "use strict";/*!
2
+ * fox v3.0.0 Mon Oct 30 2023 12:41:11 GMT+0800 (中国标准时间)
3
+ */Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=require("vue"),Pe=typeof window<"u",q=function(){return window},He=function(){return window.document};function Ur(s){let e=s,t=e.lastIndexOf("/");return t>0&&t<e.length-1?e=e.substring(0,t+1):t===0&&e.indexOf(".")!==-1?e="/":t===-1&&(e.indexOf(".")==-1?e=`/${e}/`:e="/"),e.indexOf("/")!==0&&(e=`/${e}`),e}function at(){if(!Pe)return"/";let s=q().location,e=`${s.protocol}//${s.host}`;return e+=Ur(s.pathname),e}function Kt(s,e,t){s.addEventListener?s.addEventListener(e,t,!1):s.attachEvent?s.attachEvent(`on${e}`,t):s[`on${e}`]=t}function Tt(s,e,t){s.removeEventListener?s.removeEventListener(e,t):s.detachEvent?s.detachEvent(`on${e}`,t):s[`on${e}`]=null}const Wr=Array.isArray,zr=s=>st(s)==="[object Map]",Jr=s=>st(s)==="[object Set]",Gr=s=>s instanceof Date,P=s=>typeof s=="function",Qr=s=>typeof s=="string",Xr=s=>typeof s=="symbol",Rr=s=>s!==null&&typeof s=="object",Yr=s=>Rr(s)&&P(s.then)&&P(s.catch),Sr=s=>s==null,Zr=Object.prototype.toString,st=s=>Zr.call(s),Pr=s=>st(s)==="[object Object]",es=typeof Symbol=="function"&&typeof Symbol.toStringTag=="symbol";function Ht(s){return s.__esModule||es&&s[Symbol.toStringTag]==="Module"}const ts=typeof Promise<"u"&&Promise.toString().indexOf("[native code]")!==-1;function K(...s){let e=s[0]!==void 0&&s[0]!==null?s[0]:{},t=1,r=s.length,n=!1;for(typeof e=="boolean"&&(n=e,e=s[t]??{},t++),typeof e!="object"&&(e={});t<r;t++)if(s[t]!==null&&s[t]!==void 0){let i=s[t];for(let o in i){let a=e[o],l=i[o];if(a!==l)if(n===!0&&l&&typeof l=="object"){let u;Array.isArray(l)?u=a&&Array.isArray(a)?a:[]:u=a&&typeof a=="object"?a:{},e[o]=K(n,u,l)}else l!==void 0&&(e[o]=l)}}return e}function nt(s,e,t=!1){if(!t)K(!0,s,e);else{if(typeof e!="object")return{};typeof s!="object"&&(s={});for(let r of Reflect.ownKeys(e)){let n=s[r],i=e[r];if(n!==i)if(typeof i=="object"){if(!Array.isArray(i)&&!Pr(i))continue;n=nt(n,i,t),s[r]=n}else{if(typeof i=="function")continue;s[r]=i}}}return s}class le{static seed=new Date().getTime();static get(){let e=++le.seed;return e>=Number.MAX_VALUE&&(le.seed=0),e}}const ut=ts?Promise.resolve():null;function Me(s,...e){ut!==null?e&&e.length>0?ut.then(()=>{s(e)}):ut.then(s):e&&e.length>0?setTimeout(()=>{s(e)}):setTimeout(s)}function Dt(s){return s==null?!1:typeof s=="boolean"?s:typeof s=="string"?s.toLocaleLowerCase()==="true":!!s}function rs(s){return typeof s=="number"?s:Number(s)}const ss={"[object Boolean]":"boolean","[object Number]":"number","[object String]":"string","[object Function]":"function","[object Array]":"array","[object Date]":"date","[object RegExp]":"regExp","[object Object]":"object"};function $t(s){let t=Object.prototype.toString.call(s);return s==null?String(s):ss[t]||"object"}function jt(s,e){if(s==e)return!0;if(s===void 0||e===void 0)return!1;let t=$t(s),r=$t(e);if(t!==r)return!1;if(t==="object"){let n=Object.keys(s),i=Object.keys(e);if(n.length!==i.length)return!1;for(let o=0;o<n.length;o++){let a=n[o],l=s[a],u=e[a];if(!jt(l,u))return!1}return!0}else if(t==="array"){if(s.length!==e.length)return!1;for(let n=0;n<s.length;n++){let i=s[n],o=e[n];if(!jt(i,o))return!1}return!0}return!1}const Cr=s=>{const e={};for(let t of Reflect.ownKeys(s)){let r=s[t];r&&!Array.isArray(r)&&typeof r=="object"&&(r=Cr(r)),typeof t=="symbol"?e[String(t)]=r:e[t]=r}return e},ns=/^Symbol\((.*)\)$/,Er=s=>{const e={};for(let t of Reflect.ownKeys(s)){let r=s[t];r&&!Array.isArray(r)&&typeof r=="object"&&(r=Er(r));const n=ns.exec(t);if(n&&n[1]){const i=Symbol.for(n[1]);e[i]=r}else e[t]=r}return e},er=Symbol("idKey"),ye=Symbol("valueKey"),R=Symbol("childrenKey"),Q=Symbol("growKey");class Ar{[Q]=!0;[er];[ye]=w.ref();[R]=new Map;constructor(e){this[er]=e}}class is{get(e,t){if(t=="value")return e[ye].value;if(t==="grow")return e[Q];let r=e[R].get(t);if(r)return Ne(r);if(e[Q])return r=Bt(t),r[Q]=e[Q],e[R].set(t,r),Ne(r)}set(e,t,r){return t=="value"?(e[ye].value=r,!0):t==="grow"?(e[Q]=Dt(r),!0):r==null?(e[R].delete(t),!0):(console.error(`illegal property:${t}`),!1)}deleteProperty(e,t){return t==="value"||t=="grow"?(console.error(`can not delete property:${String(t)}`),!1):(e[R].delete(t),!0)}}const Vt="__proxy__";function Bt(s){const e=new Ar(s);return Reflect.set(e,Vt,new Proxy(e,new is)),e}function Ne(s){return Reflect.get(s,Vt)}class os{name="";persistPolicy="momery";storage;initFlag=!1;state={};constructor(e={}){if(e.persistPolicy&&e.persistPolicy!=="momery"&&Sr(e.name))throw new Error("name can not be empty, where persistPolicy is not momery.");this.name=e.name??"",this.persistPolicy=e.persistPolicy??"momery",this.storage=e.storage}init(e){this.restore(e),this.initFlag=!0}getStorage(){if(!this.persistPolicy)return null;let e=null;if(this.persistPolicy==="custom")e=this.storage;else if(Pe){const t=q();e=this.persistPolicy==="session"?t.sessionStorage:t.localStorage}return e}saveState(){if(!this.persistPolicy||this.persistPolicy==="momery")return;let e=this.getStorage();if(e===null||!this.state)return;const t=`_bus_${this.name}`,r=JSON.stringify(this.state??{});e.setItem(t,r)}removeState(){if(!this.persistPolicy||this.persistPolicy==="momery")return;let e=this.getStorage();if(e===null||!this.state)return;const t=`_bus_${this.name}`;e.removeItem(t)}restore(e){if(!this.persistPolicy||this.persistPolicy==="momery")return;let t=this.getStorage();if(t===null)return;const r=`_bus_${this.name}`,n=t.getItem(r);n&&(this.state=JSON.parse(n),Reflect.ownKeys(this.state).forEach(o=>{if(typeof o!="string")return;const a=this.state[o],l=o.split(/\//g);l.push(a),Reflect.apply(e.put,e,l)}))}put(e){if(this.initFlag&&this.persistPolicy!=="momery")try{const t=e.length,r=e.slice(0,t-1).join("/"),n=e[t-1];this.state[r]=n,this.saveState()}catch(t){console.error(t)}}remove(e){if(this.initFlag&&this.persistPolicy!=="momery")try{const t=e.length,r=e.slice(0,t-1).join("/"),n={};Reflect.ownKeys(this.state).forEach(o=>{typeof o=="string"&&(o===r||o.startsWith(r)||(n[o]=this.state[o]))}),this.state=n,this.saveState()}catch(t){console.error(t)}}clear(){if(this.initFlag)try{this.state={},this.removeState()}catch(e){console.error(e)}}}class Fr extends Ar{_persistHandler;constructor(e={}){super("__root__"),this._persistHandler=new os(e),this._persistHandler.init(this)}put(...e){let t=e.length;if(t<2)return console.error("参数至少包括一个(key, value)"),!1;let r=this;for(let n=0;n<t-1;n++){let i=e[n],o;r[R].has(i)?o=r[R].get(i):(o=Bt(i),r[R].set(i,o)),r=o}return r[ye].value=e[t-1],this._persistHandler.put(e),!0}get(...e){let t=e.length;if(t===0)return;let r=this;for(let n=0;n<t;n++){let i=e[n];if(r[R].has(i))r=r[R].get(i);else return}return r[ye].value}remove(...e){let t=e.length;if(t==0)return!1;let r=this;for(let i=0;i<t-1;i++){const o=e[i];if(r[R].has(o))r=r[R].get(o);else return!1}const n=e[t-1];return r[R].has(n)?(r[R].delete(n),this._persistHandler.remove(e),!0):!1}contains(...e){const t=e.length;if(t==0)return!1;let r=this;for(let i=0;i<t-1;i++){let o=e[i];if(r[R].has(o))r=r[R].get(o);else return!1}const n=e[t-1];return r[R].has(n)}clear(){this[R].clear(),this._persistHandler.clear()}}const ls=["put","get","contains","remove","clear","_persistHandler"];function tr(s){return ls.includes(s)}class as{get(e,t){if(t=="value")return e[ye].value;if(t==="grow")return e[Q];if(t===R)return e[R];if(typeof t=="string"&&tr(t))return e[t];let r=String(t),n=e[R].get(r);if(n)return Ne(n);if(e[Q])return n=Bt(r),n[Q]=e[Q],e[R].set(r,n),Ne(n)}set(e,t,r){return t=="value"?(e[ye].value=r,!0):t==="grow"?(e[Q]=Dt(r),!0):tr(t)?!1:r==null?(e[R].delete(t),!0):(console.error(`illegal property:${t}`),!1)}deleteProperty(e,t){return t==="value"||t=="grow"?(console.error(`can not delete property:${String(t)}`),!1):(e[R].delete(t),!0)}}function us(s){const e=new Fr(s),t=new as,r=new Proxy(e,t);return Reflect.set(e,Vt,r),e}const qt=new Proxy(Fr,{construct(s,e){const t=us(e[0]??{});return Ne(t)}}),te="default",_r=Symbol("sync"),H=Symbol("resolveRoute");function rr(s){let e=!1;return function(...t){if(!e)return e=!0,Reflect.apply(s,{},t)}}function fs(s){let e=s.src;return new Promise((t,r)=>{const n=rr(a=>{Ht(a)&&(a=a.default),s.component=a,console.debug("success load async module"),t()}),i=rr(a=>{console.debug("reject load async module"),r(a)});let o;try{o=e(n,i)}catch(a){i(a)}if(o)if(typeof o.then=="function")o.then(n,i);else{const a=o.component;a&&typeof a.then=="function"&&a.then(n,i)}})}class cs{name;level;rootName;rootIndex=0;constructor(e,t,r,n){this.name=e,this.level=t,this.rootName=r,this.rootIndex=n}}class et{to;routeModel;from;data={};constructor(e,t){this.to=e,this.from=t}static from(e){let t=new et(e.to,e.from),r=e.data??{};return K(!0,t.data,r),t}}class S{path;get fullPath(){const e=this.path??`/${this.name}`;return`${this.root??te}!${e}`}alias;name;root;params;query;traceless;template;matched;meta;success;error;destroy;opsType;updateType;viewTagAttrs;index;active;slot;session;static clone(e,t){let r=new S;return nt(r,e,t),r}static isSame(e,t){return e===t?!0:!(e==null||t==null||e.path&&e.path!==t.path||e.name&&e.name!==t.name||e.root!==t.root||e.index!==t.index)}static isSameForRoute(e,t){return e===t?!0:!(e==null||t==null||e.path&&e.path!==t.path||e.name&&e.name!==t.name||e.root!==t.root)}static isSameForRouteModel(e,t){return e===t?!0:!(e==null||t==null||e.path&&e.path!=t.path||e.name&&e.name!=t.name)}static from(e){let t=new S;if(e==null)return t;let r=t;for(let i in e){let o=e[i];r[i]=o}const n=Object.getOwnPropertySymbols(e);if(Array.isArray(n)&&n.length>0)for(let i of n)r[i]=e[i];return t}}class hs{id;name;props;meta;src;component;constructor(e,t,r,n){this.id=le.get(),this.name=e,this.src=t,typeof t!="function"&&(this.component=t),this.props=r,this.meta=n}get isResolved(){return this.component!==void 0}resolve(){return fs(this)}}class sr{models=[]}class ft{path;match;redirect;name;layers=[]}const V=Symbol("chainKey"),I=Symbol("cursorKey"),ct=Symbol("$persistentModeKey"),_=Symbol("statusKey"),Z=Symbol("argsKey"),De=Symbol("exArgsKey"),de=Symbol("successFnsKey"),Ee=Symbol("errorFnsKey"),oe=Symbol("sessionKey"),ee=Symbol("_go");class Ie{[V]=[];[I]=0;[ct]=!1;[_]="Free";[Z]=[];[De]=[];[de]=[];[Ee]=[];[oe];get session(){return this[oe]}constructor(e,t=!1){this[oe]=e,this[ct]=t}[ee](e,...t){let r=this[_];if(this[_]="Busy",this[I]+=e,this[I]<0&&(this[I]=0),this[Z]=t,r==="Exception"||r==="Reject"){let a=[{session:this[oe]},...this[De]];for(;this[Ee].length>0;)try{let l=this[Ee].shift();typeof l=="function"&&Me(()=>{Reflect.apply(l,{},a)})}catch(l){console.error(l.message,l)}return this[_]=r,this[V]=[],this[I]=0,this}else if(r==="Finished"||this[I]>=this[V].length){let a=[{session:this[oe]},...this[Z]];for(;this[de].length>0;){let l=this[de].shift();typeof l=="function"&&Me(()=>{Reflect.apply(l,{},a)})}return this[_]="Free",this}if(this[I]>=this[V].length)return this[_]="Free",this;let n=this[V][this[I]];this[ct]||(this[V].splice(0,this[I]+1),this[I]=-1);let i=this[I]+1;try{let o=!1,a={go:(l,...u)=>{o||(o=!0,Reflect.apply(this[ee],this,[l,...u]))},resolve:(...l)=>{o||(o=!0,Reflect.apply(this[ee],this,[1,...l]))},reject:(...l)=>{o||(o=!0,Reflect.apply(this.reject,this,[...l]))},insert:l=>{o||(this[V].splice(i,0,l),i++)},session:this[oe]};Me(()=>{Reflect.apply(n,{},[a,...this[Z]])})}catch(o){this.throw(o)}return this}go(e,...t){return Reflect.apply(this[ee],this,[e,...t])}finish(...e){return this[_]="Finished",this[Z]=e,Reflect.apply(this[ee],this,[0])}reject(...e){return this[_]="Reject",this[De]=e,Reflect.apply(this[ee],this,[0])}throw(...e){return this[_]="Exception",this[De]=e,Reflect.apply(this[ee],this,[0])}reset(...e){this[_]="Busy",this[Z]=e,this[V]=[],this[I]=0;let r=[{session:this[oe]},...this[Z]];for(;this[de].length>0;){let n=this[de].shift();Me(()=>{Reflect.apply(n,this,r)})}return this[_]="Free",this}post(e){return this[_]==="Reject"||this[_]==="Exception"?this:(Array.isArray(e)?this[V]=[...this[V],...e]:this[V].push(e),this[_]==="Busy"?this:(Reflect.apply(this[ee],this,[0,...this[Z]]),this))}wait(e,t){return e&&typeof e=="function"&&this[de].push(e),t&&typeof t=="function"&&this[Ee].push(t),this[_]==="Busy"?this:(Reflect.apply(this[ee],this,[0,...this[Z]]),this)}exception(e){return e&&typeof e=="function"&&this[Ee].push(e),this[_]==="Busy"?this:Reflect.apply(this[ee],this,[0,...this[Z]])}isFinish(){return this[_]=="Reject"||this[_]=="Free"&&this[I]>=this[V].length}}const pe=Symbol("registerKey");class ys{policy;callback;constructor(e,t){this.callback=e,this.policy=t}}class Ot{[pe]=new Map;constructor(){}on(e,t,r=!1){let n=this[pe].get(e);n||(n=new Array,this[pe].set(e,n));let i=r===!0?1:0,o=new ys(t,i);return n.push(o),this}off(e,t){if(!t)return this[pe].delete(e),this;let r=this[pe].get(e);if(r){for(let n=0;n<r.length;n++)if(r[n].callback===t){r.splice(n,1);break}}return this}bind(e,t,r=!1){return this.on(e,t,r)}unbind(e,t){return this.off(e,t)}once(e,t){return this.on(e,t,!0)}all(...e){let t=e.length;if(t<1)return this;let r=e[t-1];if(typeof r!="function")return console.error("callback can not benn empty"),this;let n=t-1,i=new Array(n),o=[].splice.call(e,0,n);for(let a=0;a<o.length;a++)this.once(o[a],l=>{i[a]=l,n-=1,n==0&&Reflect.apply(r,{},i)});return this}emit(e,...t){let r=this[pe].get(e);if(!r)return this;for(let n=0;n<r.length;){let i=r[n];if(i.policy==1?r.splice(n,1):n++,typeof i.callback=="function")try{Me(()=>{Reflect.apply(i.callback,{},t)})}catch(o){console.error(o.message,o)}}return this}trigger(e,...t){return Reflect.apply(this.emit,this,[e,...t])}}const Ae=Symbol("registerKey");class ds{[Ae]=new Map;constructor(){}set(e,t){this[Ae].set(e,t)}get(e){return this[Ae].get(e)}has(e){return this[Ae].has(e)}delete(e){return this[Ae].delete(e)}}const he=Symbol("lc");function tt(s,e=!1){let t=s;if(Reflect.has(t,he))return t[he];if(e){const r=new ds;return t[he]=r,r}return null}function Kr(s,e=!1){let t=null,r=s;for(;r&&!(Reflect.has(r,he)&&(t=r[he],t));)r=r.$parent;if(!t&&e){const n=s;n&&n.$parent&&(t=tt(n.$parent,e))}return t}function kt(s,e){let t=s;for(;t;){if(Reflect.has(t,he)){const r=t[he];if(r.has(e))return r.get(e)}t=t.$parent}return null}function ps(s,e,t){Kr(s,!0)?.set(e,t)}function ms(s,e){Kr(s,!0)?.delete(e)}function nr(s){if(Array.isArray(s.children)&&s.children.length>0){let e=s.children[0];if(e!=null&&e.component!=null&&e.component.proxy!=null)return tt(e.component.proxy,!1)}return null}const rt=Symbol("hooksKey");function vs(s){let e=s.get(rt);e||(e=[],s.set(rt,e))}function ir(s,e){let t=s.get(rt);if(t!=null)for(let r=t.length-1;r>=0;r--){let n=t[r];if(n.type===e)try{Reflect.apply(n.hook,n.target,[])}catch(i){console.error(i.message,i)}}}var Lt=(s=>(s.DEACTIVATED="da",s.ACTIVATED="a",s))(Lt||{});class gs{type;hook;target;constructor(e,t,r){this.target=r,this.hook=t,this.type=e}}function ws(s,e,t,r){let n=new gs(e,t,r);return s.push(n),!0}function bs(s,e,t,r){let n=-1;for(let i=0;i<s.length;i++){let o=s[i];if(o.type===e&&o.hook===t&&o.target===r){n=i;break}}return n!=-1?(s.splice(n,1),!0):!1}function Tr(s){return(e,t)=>{let r;if(t)r=t;else{const i=w.getCurrentInstance();if(i==null||i.proxy==null){console.error("can not get current instance or proxy");return}r=i.proxy}const n=kt(r,rt);if(n==null){console.warn("can not get hooks context");return}w.onUnmounted(()=>{bs(n,s,e,r)}),ws(n,s,e,r)}}const xs=Tr("a"),Rs=Tr("da"),Mt=Symbol("routeKey");function or(s,e){s.set(Mt,e)}function Ut(s){let e=kt(s,Mt);return typeof e=="function"?e():e??null}const it=Symbol("rk"),ht=Symbol("vd"),lr=Symbol("rv"),yt=Symbol("rvi"),ar=Symbol("pv"),dt=Symbol("pvi");function Ss(s){for(var e=[],t=0;t<s.length;){var r=s[t];if(r==="*"||r==="+"||r==="?"){e.push({type:"MODIFIER",index:t,value:s[t++]});continue}if(r==="\\"){e.push({type:"ESCAPED_CHAR",index:t++,value:s[t++]});continue}if(r==="{"){e.push({type:"OPEN",index:t,value:s[t++]});continue}if(r==="}"){e.push({type:"CLOSE",index:t,value:s[t++]});continue}if(r===":"){for(var n="",i=t+1;i<s.length;){var o=s.charCodeAt(i);if(o>=48&&o<=57||o>=65&&o<=90||o>=97&&o<=122||o===95){n+=s[i++];continue}break}if(!n)throw new TypeError("Missing parameter name at ".concat(t));e.push({type:"NAME",index:t,value:n}),t=i;continue}if(r==="("){var a=1,l="",i=t+1;if(s[i]==="?")throw new TypeError('Pattern cannot start with "?" at '.concat(i));for(;i<s.length;){if(s[i]==="\\"){l+=s[i++]+s[i++];continue}if(s[i]===")"){if(a--,a===0){i++;break}}else if(s[i]==="("&&(a++,s[i+1]!=="?"))throw new TypeError("Capturing groups are not allowed at ".concat(i));l+=s[i++]}if(a)throw new TypeError("Unbalanced pattern at ".concat(t));if(!l)throw new TypeError("Missing pattern at ".concat(t));e.push({type:"PATTERN",index:t,value:l}),t=i;continue}e.push({type:"CHAR",index:t,value:s[t++]})}return e.push({type:"END",index:t,value:""}),e}function $r(s,e){e===void 0&&(e={});for(var t=Ss(s),r=e.prefixes,n=r===void 0?"./":r,i="[^".concat(be(e.delimiter||"/#?"),"]+?"),o=[],a=0,l=0,u="",f=function(F){if(l<t.length&&t[l].type===F)return t[l++].value},c=function(F){var C=f(F);if(C!==void 0)return C;var E=t[l],W=E.type,M=E.index;throw new TypeError("Unexpected ".concat(W," at ").concat(M,", expected ").concat(F))},h=function(){for(var F="",C;C=f("CHAR")||f("ESCAPED_CHAR");)F+=C;return F};l<t.length;){var y=f("CHAR"),d=f("NAME"),m=f("PATTERN");if(d||m){var p=y||"";n.indexOf(p)===-1&&(u+=p,p=""),u&&(o.push(u),u=""),o.push({name:d||a++,prefix:p,suffix:"",pattern:m||i,modifier:f("MODIFIER")||""});continue}var v=y||f("ESCAPED_CHAR");if(v){u+=v;continue}u&&(o.push(u),u="");var g=f("OPEN");if(g){var p=h(),T=f("NAME")||"",x=f("PATTERN")||"",$=h();c("CLOSE"),o.push({name:T||(x?a++:""),pattern:T&&!x?i:x,prefix:p,suffix:$,modifier:f("MODIFIER")||""});continue}c("END")}return o}function Ps(s,e){return Cs($r(s,e),e)}function Cs(s,e){e===void 0&&(e={});var t=Wt(e),r=e.encode,n=r===void 0?function(l){return l}:r,i=e.validate,o=i===void 0?!0:i,a=s.map(function(l){if(typeof l=="object")return new RegExp("^(?:".concat(l.pattern,")$"),t)});return function(l){for(var u="",f=0;f<s.length;f++){var c=s[f];if(typeof c=="string"){u+=c;continue}var h=l?l[c.name]:void 0,y=c.modifier==="?"||c.modifier==="*",d=c.modifier==="*"||c.modifier==="+";if(Array.isArray(h)){if(!d)throw new TypeError('Expected "'.concat(c.name,'" to not repeat, but got an array'));if(h.length===0){if(y)continue;throw new TypeError('Expected "'.concat(c.name,'" to not be empty'))}for(var m=0;m<h.length;m++){var p=n(h[m],c);if(o&&!a[f].test(p))throw new TypeError('Expected all "'.concat(c.name,'" to match "').concat(c.pattern,'", but got "').concat(p,'"'));u+=c.prefix+p+c.suffix}continue}if(typeof h=="string"||typeof h=="number"){var p=n(String(h),c);if(o&&!a[f].test(p))throw new TypeError('Expected "'.concat(c.name,'" to match "').concat(c.pattern,'", but got "').concat(p,'"'));u+=c.prefix+p+c.suffix;continue}if(!y){var v=d?"an array":"a string";throw new TypeError('Expected "'.concat(c.name,'" to be ').concat(v))}}return u}}function Es(s,e){var t=[],r=jr(s,t,e);return As(r,t,e)}function As(s,e,t){t===void 0&&(t={});var r=t.decode,n=r===void 0?function(i){return i}:r;return function(i){var o=s.exec(i);if(!o)return!1;for(var a=o[0],l=o.index,u=Object.create(null),f=function(h){if(o[h]===void 0)return"continue";var y=e[h-1];y.modifier==="*"||y.modifier==="+"?u[y.name]=o[h].split(y.prefix+y.suffix).map(function(d){return n(d,y)}):u[y.name]=n(o[h],y)},c=1;c<o.length;c++)f(c);return{path:a,index:l,params:u}}}function be(s){return s.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1")}function Wt(s){return s&&s.sensitive?"":"i"}function Fs(s,e){if(!e)return s;for(var t=/\((?:\?<(.*?)>)?(?!\?)/g,r=0,n=t.exec(s.source);n;)e.push({name:n[1]||r++,prefix:"",suffix:"",modifier:"",pattern:""}),n=t.exec(s.source);return s}function _s(s,e,t){var r=s.map(function(n){return jr(n,e,t).source});return new RegExp("(?:".concat(r.join("|"),")"),Wt(t))}function Ks(s,e,t){return Ts($r(s,t),e,t)}function Ts(s,e,t){t===void 0&&(t={});for(var r=t.strict,n=r===void 0?!1:r,i=t.start,o=i===void 0?!0:i,a=t.end,l=a===void 0?!0:a,u=t.encode,f=u===void 0?function(M){return M}:u,c=t.delimiter,h=c===void 0?"/#?":c,y=t.endsWith,d=y===void 0?"":y,m="[".concat(be(d),"]|$"),p="[".concat(be(h),"]"),v=o?"^":"",g=0,T=s;g<T.length;g++){var x=T[g];if(typeof x=="string")v+=be(f(x));else{var $=be(f(x.prefix)),F=be(f(x.suffix));if(x.pattern)if(e&&e.push(x),$||F)if(x.modifier==="+"||x.modifier==="*"){var C=x.modifier==="*"?"?":"";v+="(?:".concat($,"((?:").concat(x.pattern,")(?:").concat(F).concat($,"(?:").concat(x.pattern,"))*)").concat(F,")").concat(C)}else v+="(?:".concat($,"(").concat(x.pattern,")").concat(F,")").concat(x.modifier);else x.modifier==="+"||x.modifier==="*"?v+="((?:".concat(x.pattern,")").concat(x.modifier,")"):v+="(".concat(x.pattern,")").concat(x.modifier);else v+="(?:".concat($).concat(F,")").concat(x.modifier)}}if(l)n||(v+="".concat(p,"?")),v+=t.endsWith?"(?=".concat(m,")"):"$";else{var E=s[s.length-1],W=typeof E=="string"?p.indexOf(E[E.length-1])>-1:E===void 0;n||(v+="(?:".concat(p,"(?=").concat(m,"))?")),W||(v+="(?=".concat(p,"|").concat(m,")"))}return new RegExp(v,Wt(t))}function jr(s,e,t){return s instanceof RegExp?Fs(s,e):Array.isArray(s)?_s(s,e,t):Ks(s,e,t)}var j=(s=>(s[s.Push=0]="Push",s[s.Replace=1]="Replace",s[s.Put=2]="Put",s[s.Append=3]="Append",s[s.Open=4]="Open",s))(j||{}),Xe=(s=>(s[s.Part=0]="Part",s[s.All=1]="All",s))(Xe||{});const G=Symbol("rootKey"),J=Symbol("rootNodeKey"),ce=Symbol("parentNodeKey"),Ye=Symbol("nameKey");class se{instance=null;model;route;active=!0;index=0;constructor(e,t,r=0,n=!0){this.route=e,this.model=t,this.index=r,this.active=n}}class Fe{_slots;get slots(){return this._slots==null&&(this._slots=w.shallowRef([])),this._slots}get empty(){return this._slots==null||this._slots.value.length==0}[Ye];[G];[J]=null;[ce]=null;get name(){return this[Ye]}constructor(e,t,r){this[Ye]=e,this[G]=t,r&&(this[J]=r)}}class B{view;index;level;constructor(e,t,r){this.view=e,this.index=t,this.level=r}static include(e,t){for(let r=0;r<e.length;r++){let n=e[r];if(n.view===t.view&&(t.index==-1||n.index===t.index)&&n.level===t.level)return!0}return!1}}class pt{views=[]}class $s{layers=[]}class js{time;route}class qs{forbidTime=300;submitRecorder=new js;isSameRoute(e,t){return e==null||t==null?!1:e.name===t.name&&e.path===t.path&&e.root===t.root}acquire(e){let t=new Date().getTime();if(this.isSameRoute(e,this.submitRecorder.route)&&this.submitRecorder.time&&t-this.submitRecorder.time<=this.forbidTime){this.submitRecorder.time=t;return}return this.submitRecorder.route=e,this.submitRecorder.time=t,t}release(e){this.submitRecorder.time===e&&(this.submitRecorder.route=void 0)}}const xe=Symbol("_notifyChange");class ur{currentRoute;routes;constructor(e,t){this.currentRoute=e,this.routes=t}}const ae=Symbol("historyChangeConsumerKey"),fr=Symbol("_navigateFirstRoute"),Ve=Symbol("_getRouteMark"),mt=Symbol("_getUrlSearch"),vt=Symbol("_generateLocation"),_e=Symbol("_setRouteMarkRecorder"),Ke=Symbol("beforeRestoreFiltersKey"),cr=Symbol("_beforeRestore"),hr="Symbol(_fox_restore_point)";function gt(s,...e){return typeof s=="function"?Reflect.apply(s,null,[...e]):s}function yr(s){if(!Array.isArray(s))return!1;if(s.length===0)return!0;const e=s[0];return!!(Reflect.has(e,"path")&&Reflect.has(e,"root"))}class qr{base;storage;mode;query;firstNavigate=!0;historyMonitor;traceless=!1;changeHandler;historyChange;[ae]=!1;[Ke]=new Array;backTimeout=320;constructor(e="hash",t="",r="",n=!0,i=!0,o=!1,a,l){this.mode=e,this.base=t,this.query=r,this.firstNavigate=n,this.historyMonitor=i,this.traceless=o,this.storage=a??q().sessionStorage,this.backTimeout=l??320}init(e=!0){const t=q();return typeof this.historyChange!="function"&&(this.historyChange=()=>{if(typeof this[ae]=="function"){const r=this[ae]();if(this[ae]=!1,r)return}else if(this[ae]===!0){this[ae]=!1;return}if(gt(this.historyMonitor)){const r=t.history.state;this[xe](r);try{let n=[];if(typeof r=="string"?n=JSON.parse(r):n=r,Array.isArray(n)&&n.length>0){const i=this[Ve]()??"/";this[_e](i,n)}}catch{}}}),Kt(t,"popstate",this.historyChange),this.firstNavigate&&e&&this[fr](),Promise.resolve()}destroy(){if(this.historyChange){const e=q();Tt(e,"popstate",this.historyChange)}}[cr](e,t,r,n){for(let i of this[Ke])try{const o=Reflect.apply(i,{},[e,t,r,n]);if(o===!1)return o}catch(o){console.error(o.message,o)}return!0}beforeRestoreEach(e){this[Ke].push(e)}removeBeforeRestoreEach(e){const t=this[Ke].indexOf(e);return t!==-1?(this[Ke].splice(t,1),!0):!1}[fr](){const e=this[Ve]()??"/",t=this.storage.getItem(hr);if(t)try{const o=JSON.parse(t);if(o.mark===e&&Array.isArray(o.routes)&&o.routes.length>0){const a=o.routes.filter((l,u)=>(l.params=l.params?Er(l.params):{},this[cr](l,u,e,o.routes)));if(a.length>0){const l=this[mt](),u=a.length-1;a[u].query=l||a[u].query,this[xe](a);return}}}catch{}const r=e.indexOf("!");let n;r!=-1?n=e.substring(r+1):n=e;const i=new S;i.path=n,i.query=this[mt](),this[xe]([i])}[_e](e,t){try{t.forEach(i=>{i.params=i.params?Cr(i.params):{}});const n=JSON.stringify({mark:e,routes:t});this.storage.setItem(hr,n)}catch(r){console.error(r.message,r)}}setRestorePoint(e){const t=this[Ve]()??"/";this[_e](t,e)}[xe](e){typeof this.changeHandler=="function"&&this.changeHandler(e)}[Ve](){const e=q();if(this.mode==="path"){let t=e.location.pathname;return this.base&&t.indexOf(this.base)===0&&(t=t.substring(this.base.length)),t}else{const t=e.location.hash,r=t.indexOf("#");if(r!=-1)return t.substring(r+1)}return null}[mt](){let t=q().location.search;return t.length>0&&t.indexOf("?")===0&&(t=t.substring(1)),t}listen(e){this.changeHandler=e}go(e,t=!1){const r=q();this[ae]=t,r.history.go(e)}goBack(e,t){const r=q(),n=r.history.state;if(yr(n)&&n.length>0){let i=0;if(e===null)i=n.length;else for(let c=n.length-1;c>=0;c--){const h=S.from(n[c]);if(S.isSameForRoute(h,e))break;i++}let o=n.length-i;if(e!==null&&o===0){t();return}const a=this.backTimeout;let l=null;const u=()=>{r.history.go(-1),l=setTimeout(u,a)};l=setTimeout(u,a);const f=()=>{clearTimeout(l);const h=q().history.state;if(yr(h)&&h.length>0){let y=h.length;const d=h[y-1],m=S.from(d);if(e==null||S.isSameForRoute(m,e))return t(),!0;if(y>o){let p=0;for(let v=y-1;v>=0;v--){const g=S.from(h[v]);if(S.isSameForRoute(g,e))break;p++}if(o=y-p,o>0)return l=setTimeout(u,a),this.go(-p,f),!0}}return t(),!0};this.go(-i,f)}else t()}push(e){const t=this[vt](e.currentRoute);e.currentRoute.traceless!==!0&&!gt(this.traceless,e.currentRoute)&&q().history.pushState(e.routes,"",t);const r=e.currentRoute.fullPath;this[_e](r,e.routes)}replace(e){const t=this[vt](e.currentRoute);e.currentRoute.traceless!==!0&&!gt(this.traceless,e.currentRoute)&&q().history.replaceState(e.routes,"",t);const r=e.currentRoute.fullPath;this[_e](r,e.routes)}[vt](e){const t=q();let r="";if(e.query){let a="";if(typeof e.query=="object")for(let l of Reflect.ownKeys(e.query)){let u=encodeURIComponent(e.query[l]),f=`${encodeURIComponent(String(l))}=${u}`;a.length>0&&(a+="&"),a+=f}else a=e.query;this.query?(r=a.length>0?`${this.query}&${a}`:this.query,r.length>0&&r.charAt(0)!=="?"&&(r=`?${r}`)):a.length>0&&(r=`?${a}`)}const n=t.location;let i=e.alias??e.fullPath;i.startsWith(te)&&(i=i.substring(te.length+1));let o;return r?this.mode=="path"?i.indexOf("/")===0?o=`${this.base}${i}${r}`:o=`${this.base}/${i}${r}`:o=`${n.pathname}${r}#${i}`:this.mode=="path"?i.indexOf("/")===0?o=`${this.base}${i}`:o=`${this.base}/${i}`:o=`${n.pathname}#${i}`,`${n.origin}${o}`}}function Os(s=!0,e=null,t="",r=!0,n=!1,i){return e!==null&&(e=q().location.pathname),e&&e.endsWith("/")&&(e=e.substring(0,e.length-1)),new qr("path",e??"",t,s,r,n,i)}function Or(s=!0,e="",t=!0,r=!1,n){return new qr("hash","",e,s,t,r,n)}class Ls{maxSize=50;cursor=-1;queue=[];changeHandler;base;historyMonitor=!1;traceless=!1;constructor(e,t=50){this.base=e,this.maxSize=t}init(e=!0){return Promise.resolve()}destroy(){this.queue=[]}beforeRestoreEach(e){}removeBeforeRestoreEach(e){return!1}listen(e){this.changeHandler=e}[xe](e){typeof this.changeHandler=="function"&&this.changeHandler(e)}go(e,t=!1){if(this.queue.length==0||this.cursor<=0)return;let r=this.cursor+e;if(r<0?r=0:r>this.queue.length-1&&(r=this.queue.length-1),r!=this.cursor){this.cursor=r;let n=!1;if(typeof t=="function"?n=t():n=t,!n){const i=this.queue[r];this[xe](i.routes)}}}goBack(e,t){if(this.queue.length==0||this.cursor<=0)return;let r=0;if(e===null)r=this.cursor+1;else for(let n=this.cursor;n>=0;n--){r++;const i=this.queue[n];if(S.isSameForRoute(i.currentRoute,e))break}this.go(-r,()=>(t(),!0))}push(e){this.queue.length>=this.maxSize&&this.queue.splice(0,1),this.queue.push(e),this.cursor=this.queue.length-1}replace(e){let t=this.queue.length-this.cursor;this.queue.splice(this.cursor,t),this.queue[this.cursor]=e}setRestorePoint(e){}}function Lr(s="",e=50){return new Ls(s,e)}const Be=Symbol("_constructRouteModel"),ke=Symbol("_findRouteModel"),wt=Symbol("_findRootView"),dr=Symbol("_getFirstView"),ue=Symbol("_removeView"),pr=Symbol("_buildPage"),mr=Symbol("_resolveComponent"),vr=Symbol("_update"),ne=Symbol("_merge"),bt=Symbol("_handleHistoryChange"),Ue=Symbol("_handleRouteUpdated"),We=Symbol("routeUpdatedCallback"),b=Symbol("currentRoutes"),me=Symbol("current"),gr=Symbol("_addRouteRecorder"),Te=Symbol("_removeRouteRecorder"),ze=Symbol("_cloneRouteRecorder"),O=Symbol("_handleError"),Je=Symbol("errorCallback"),k=Symbol("registerKey"),Ge=Symbol("notFoundKey"),xt=Symbol("notFoundPathKey"),U=Symbol("forestKey"),A=Symbol("historyKey"),$e=Symbol("beforeFiltersKey"),je=Symbol("afterFiltersKey"),qe=Symbol("destroyFiltersKey"),Rt=Symbol("propsFilterKey"),ve=Symbol("mainDispatcherKey"),St=Symbol("initKey"),fe=Symbol("readyKey"),Pt=Symbol("readyHandlersKey"),Qe=Symbol("_markReady"),wr=Symbol("_createNextFn"),Ct=Symbol("_start"),Et=Symbol("_before"),At=Symbol("_after"),br=Symbol("_destroy"),Ft=Symbol("_load"),Oe=Symbol("_unload"),Le=Symbol("routerGuardKey");function Ms(s){return s.layers.length==0||s.layers[0].views.length==0}function Ns(s){let e=[];return s.layers.forEach(t=>{t.models==null||t.models==null||t.models.forEach(r=>{if(!(r==null||r==null))if(typeof r.meta=="object"){let n=K(!0,{},r.meta);e.push(n)}else r.meta&&e.push(r.meta)})}),e}class Is{[k]=new Array;[Ge];[xt]="*";[fe]=!1;[Pt]=[];[U]=new $s;[A];[b]=new Array;[Je]=null;[We]=null;[$e]=new Array;[je]=new Array;[qe]=new Array;[Rt]=null;[ve]=new Ie;[Le]=new qs;[St]=!1;[me]=w.ref(null);get current(){return this[me].value}options;constructor(e){this.options=e??{},this.options.notFoundPath&&this.setNotFoundPath(this.options.notFoundPath);let t=this.options.routes||[];this.addRoutes(t),this.options.notFound&&this.setNotFoundRoute(this.options.notFound),e.history?this[A]=e.history:this[A]=Pe?Or():Lr(),this[A]?.listen(async r=>{let n=!0;try{if(typeof r=="string"){const i=this[H](r);i&&await this[bt]([i])}else await this[bt](r)}catch(i){console.error(i.message,i),n=!1}this[fe]===!1&&this[Qe](n)})}[O](e="error",t){if(t&&typeof t.error=="function")try{t.error(e)}catch{}if(typeof this[Je]=="function")try{this[Je](e,t)}catch{}console.error(e)}init(){this[St]!==!0&&(this[A]?.init(!this[fe]),this[St]=!0)}isReady(){return this[fe]?Promise.resolve():new Promise((e,t)=>{this[Pt].push([e,t])})}[Qe](e){this[fe]=!0,this[Pt].forEach(([t,r])=>{try{e?t():r()}catch(n){console.error(n.message,n)}})}[bt](e){try{if(!e){let o=[...this[b]].reverse();return this[Oe](o),Pe&&q().location.reload(),Promise.resolve()}let t=null,r=[],n=[],i=0;for(;i<e.length&&i<this[b].length&&S.isSame(e[i],this[b][i]);i++)e[i].active===!0&&e[i].active!==this[b][i].active&&(t=e[i]);if(i<e.length&&(r=e.slice(i)),i<this[b].length&&(n=this[b].slice(i).reverse()),n.length===0&&r.length===0){if(t!==null)return this.restore([t])}else if(n.length>0){if(this[Oe](n)){if(r.length>0)return this.restore(r);if(t!==null)return this.restore([t])}}else return this.restore(r)}catch(t){this[O](t)}return Promise.resolve()}[Ue](e){if(e)this[me].value=e;else{let t=this[b].length;t>0?this[me].value=this[b][t-1]:this[me].value=null}if(typeof this[We]=="function")try{this[We](this[me].value)}catch{}}[gr](e){if(e.opsType===j.Open){let t=!1;const r=this[b].length-1;for(let n=r;n>=0;n--){const i=this[b][n];if(e.root==i.root){if(e.path===i.path){this[b].splice(n,1,e),t=!0;continue}e.active&&(i.active=!1)}}t||this[b].push(e)}else this[b].push(e)}[ze](){let e=[];for(let t of this[b]){let r=S.clone(t,!0);e.push(r)}return e}[Te](e){if(!this[b])return;let t=-1;for(let r=0;r<this[b].length;r++)if(S.isSame(this[b][r],e)){t=r;break}if(t!=-1){let r=this[b][t];this[b].splice(t,1),this[br](r,r.session)}}set historyMonitor(e){this[A]&&(this[A].historyMonitor=e)}get historyMonitor(){return this[A]?this[A].historyMonitor:!1}set traceless(e){this[A]&&(this[A].traceless=e)}get traceless(){return this[A]?this[A].traceless:!1}set propsFilter(e){this[Rt]=e}get propsFilter(){return this[Rt]}setRestorePoint(){const e=this[ze]();this[A]?.setRestorePoint(e)}onRouteUpdated(e){this[We]=e}onError(e){this[Je]=e}beforeEach(e){this[$e].push(e)}removeBeforeEach(e){const t=this[$e].indexOf(e);return t!==-1?(this[$e].splice(t,1),!0):!1}afterEach(e){this[je].push(e)}removeAfterEach(e){const t=this[je].indexOf(e);return t!==-1?(this[je].splice(t,1),!0):!1}destroyEach(e){this[qe].push(e)}removeDestroyEach(e){const t=this[qe].indexOf(e);return t!==-1?(this[qe].splice(t,1),!0):!1}beforeRestoreEach(e){this[A]?.beforeRestoreEach(e)}removeBeforeRestoreEach(e){return this[A]?.removeBeforeRestoreEach(e)??!1}addRoutes(e){for(let t of e)this.addRoute(t)}addRoute(e,t=-1){if(e.path===this[xt]){this.setNotFoundRoute(e);return}const r=this[Be](e);if(t==-1)this[k]=[...this[k],...r];else for(let n=r.length-1;n>=0;n--)this[k].splice(t,0,r[n])}removeRoute(e){const t=this[H](e);if(t===null)return console.warn("route格式错误",e),!1;for(let r=0;r<this[k].length;r++){const n=this[k][r];if(t?.path&&n.path===t.path)return this[k].splice(r,1),!0;if(t?.name&&n.name===t.name)return this[k].splice(r,1),!0}return!1}hasRoute(e){const t=this[H](e);return t===null?(console.warn("route格式错误",e),!1):this[k].findIndex(n=>{if(t?.path&&n.path===t.path||t?.name&&n.name===t.name)return!0})!==-1}setNotFoundPath(e){this[xt]=e}setNotFoundRoute(e){const t=this[Be](e);this[Ge]=t[0]}getRoutes(){return[...this[k]]}[Be](e){let t=e.path??"";t.length>0&&t.charAt(0)!=="/"&&(t=`/${t}`);let r=e.components??(e.component&&{"":e.component});if(r==null){const a=new ft;return a.path=t,a.redirect=e.redirect,[a]}let n=[];for(let a in r){let l=r[a];a.length===0&&(a=te);let u=new hs(a,l,e.props,e.meta);n.push(u)}let i=!1,o=[];if(e.children)for(let a of e.children){let l=this[Be](a);for(let u of l){let f=new ft;f.name=u.name,u.path&&u.path.length>0?t!=="/"?f.path=`${t}${u.path}`:f.path=u.path:(i=!0,f.path=t);let c=new sr;c.models=[...n],f.layers=[c,...u.layers],o.push(f)}}if(!i){const a=new sr;a.models=n;const l=new ft;l.name=e.name,l.path=t,l.layers=[a],o.splice(0,0,l)}return o}[ke](e){const t=e.route;try{for(let r of this[k]){const n=t.template??t.path,i=t.template??t.name;if(n&&r.path){let o=r.match;o||(o=r.match=Es(r.path));const a=o(n);if(!a)continue;if(r.redirect){const l=new S;K(!0,l,t),l.path=r.redirect;const u={route:l,find:void 0};return this[ke](u)?(e.route=u.route,e.find=u.find,t.template&&e.find&&(e.find={...e.find},e.find.path=t.path),!0):!1}if(t.params=t.params??{},K(!0,t.params,a.params),t.query){const l=t.query;if(typeof l=="string"){const u={},f=l.split("&");for(let c of f){const h=c.split("=");if(h.length!==2)continue;const y=decodeURIComponent(h[0].trim()),d=decodeURIComponent(h[1].trim());u[y]=d}K(!0,t.params,u)}else typeof l=="object"&&K(!0,t.params,l)}return e.find=r,t.template&&e.find&&(e.find={...e.find},e.find.path=t.path),!0}else if(i===r.name){t.params=t.params??{};const o=Ps(r.path);return t.path=o(t.params),e.find=r,t.template&&e.find&&(e.find={...e.find},e.find.name=t.name),!0}}}catch(r){console.error(r.message,r),typeof t.error=="function"&&t.error(r.message)}return!1}[H](e){let t=null;if(Array.isArray(e))if(t=new S,typeof e[0]=="object")t=S.from(e[0]);else for(let r=0;r<e.length;r++)r===0?e[r].charAt(0)==="/"?t.path=e[r]:t.name=e[r]:r===1?t.params=e[r]:r===2?t.root=e[r]:r===3&&K(!1,t,e[r]);else typeof e=="object"?t=S.from(e):typeof e=="string"&&(t=new S,e.charAt(0)=="/"?t.path=e:t.name=e);if(t){if(t.path){let r=t.path.indexOf("?");r!==-1&&r<t.path.length-1&&(t.query=t.path.substring(r+1),t.path=t.path.substring(0,r))}t.root=t.root??te,t.opsType=t.opsType??this.options.defaultOperationType??j.Push}return t}push(...e){let t=this[H](e);return t?(t.opsType=t.opsType||j.Push,this.to(t)):(this[O]("resolve route fail",t),this)}put(...e){let t=this[H](e);return t?(t.opsType=j.Put,t.traceless=!0,this.to(t)):(this[O]("resolve route fail",t),this)}replace(...e){let t=this[H](e);return t?(t.opsType=j.Replace,this.to(t)):(this[O]("resolve route fail",t),this)}append(...e){let t=this[H](e);return t?(t.opsType=j.Append,this.to(t)):(this[O]("resolve route fail",t),this)}remove(e,t){return new Promise(r=>{this[ve].post(n=>{try{if(this[b].length===0){n.resolve(),r(!1);return}let i=-1,o,a=[];if(e){if(e.root?o=e.root:o=this[b][0].root??te,e.all)for(let u=this[b].length-1;u>0;u--){let f=this[b][u];f.opsType===j.Append&&f.root===o&&(a.splice(0,0,f),i=u-1)}else if(e.until)for(let u=this[b].length-1;u>0;u--){let f=this[b][u];if(f.opsType===j.Append&&f.root===o){if(e.until.charAt(0)==="/"&&e.until===f.path){i=u;break}else if(e.until===f.name){i=u;break}a.splice(0,0,f)}}}else{o=te;let u=this[dr](this[U]);u&&(o=u.name);for(let f=this[b].length-1;f>0;f--){let c=this[b][f];if(c.opsType===j.Append&&c.root===o){a.push(c),i=f-1;break}}}if(a.length===0){let u="can not find route";console.warn(u),n.resolve(u),r(!1);return}let l=null;if(i!==-1&&(l=this[b][i]),this[Oe](a)){if(t===!1)return n.resolve(),r(!0),!0;const u=this[b].length,f=()=>(n.resolve(),r(!0),!0);if(l&&u>0&&S.isSame(l,this[b][u-1])){this[A]?.goBack(l,f);return}if(l===null&&u===0){this[A]?.goBack(null,f);return}f()}}catch(i){this[O](i),n.resolve(),r(!1)}})})}open(...e){let t=this[H](e);return t?(t.opsType=j.Open,this.to(t)):(this[O]("resolve route fail",t),this)}close(e){return this[ve].post(t=>{try{let r=this[H](e);if(!r){t.reject("resolve route fail");return}let n=[];for(let i=0;i<this[b].length;i++){let o=this[b][i];if(o.root===r.root){if(!r.path&&!r.name){n.push(o);continue}if(r.path&&r.path===o.path){n.push(o);break}else if(r.name&&r.name===o.name){n.push(o);break}}}if(n.length===0){t.resolve();return}this[Oe](n)&&this[Ue](),t.resolve()}catch(r){this[O](r),t.resolve()}}),this}to(...e){let t=this[H](e);if(!t)return this[O]("resolve route fail",t),this;let r=this[Le].acquire(t);return r==null?(this[O]("route forbid",t),this):(this[ve].post(n=>{try{let i=this[Ct](t);this[Et](i),this[Ft](i),this[At](i),i.wait((o,a)=>{const l=o.session.to;if(o.session.updateResult&&o.session.updateResult.status==="success")try{let u=S.clone(l,!0);const f=new ur(u,this[ze]());l.opsType===j.Replace?this[A]?.replace(f):this[A]?.push(f)}catch(u){console.error(u.message,u)}if(this[Le].release(r),this[Ue](l),typeof t.success=="function")try{Reflect.apply(t.success,{},[])}catch(u){console.error(u.message,u)}this[fe]===!1&&this[Qe](!0),n.resolve()},(o,a)=>{this[Le].release(r),a!==null&&this[O](a,t),this[fe]===!1&&this[Qe](!1),n.resolve()})}catch(i){this[Le].release(r),this[O](i,t),n.resolve()}}),this)}back(e=1){this[A]?.go(-e,!1)}[wr](e){return(t,r)=>{if(typeof t=="boolean")e.session.redirect=!1,t?e.resolve():e.reject(r??null);else if(t){const n=this[H](t);if(n){const i=e.session.to;n.success=i.success,n.error=i.error,e.session.to=n,e.session.redirect=!0,e.session.routeModel=null,e.resolve()}else e.session.redirect=!1,e.reject("route resolve fail")}else e.session.redirect=!1,e.resolve()}}[Ct](e){let t=this[b].length>0?this[b][0]:void 0,r=new et(e,t),n={route:e,find:null};return this[ke](n),n.find&&(r.routeModel=n.find,e.matched=Ns(n.find),Array.isArray(e.matched)&&e.matched.length>0&&(e.meta=n.find.layers[0].models[0].meta)),new Ie(r)}[Et](e){for(let t of this[$e])e.post(r=>{const n=this[wr](r);Reflect.apply(t,{},[r.session.to,r.session.from,n,r.session])})}[At](e){e.post(t=>{for(let r of this[je])try{Reflect.apply(r,{},[t.session.to,t.session.from,t.session])}catch(n){console.error(n.message,n)}t.resolve()})}[br](e,t){for(let r of this[qe])try{Reflect.apply(r,{},[e,t])}catch(n){console.error(n.message,n)}typeof e.destroy=="function"&&Reflect.apply(e.destroy,e,[])}[Ft](e){e.post(t=>{let r=t.session.to,n=t.session.routeModel;if(n==null){let o={route:r,find:null};if(this[ke](o))n=o.find,t.session.routeModel=n;else if(this[Ge])n=this[Ge];else{t.reject(`not find route model, path:${r.path??r.name}`);return}}let i=et.from(t.session);this[pr](r,n,i).then(o=>{this[U],t.session.updateResult=o??{status:"success",message:""},t.resolve()},o=>{t.reject(o)})})}[Oe](e){if(e.length==0)return!0;let t=this[U],r=[];for(let n of e){let i=this[wt](t,n);i!=null&&r.push({...i,route:n})}if(r.length==0){let n="can not find view index";return this[O](n),!1}for(let n of r.reverse())this[ue](t,{x:n.x,y:n.y},[n.route.index??0],!0);return!0}[wt](e,t){const r=t.root??te;let n;for(let i=0;i<e.layers.length;i++){const o=e.layers[i];for(let a=o.views.length-1;a>=0;a--){const l=o.views[a];if(l[G]&&l[Ye]===r)return n={x:a,y:i},n}}return null}[dr](e){return e.layers.length>0&&e.layers[0].views.length>0?e.layers[0].views[0]:null}[ue](e,t,r=null,n=!0){if(t.y>=e.layers.length||t.x>=e.layers[t.y].views.length)return;let i=e.layers[t.y].views[t.x],o=!1,a=[],l=!1,u=[...i.slots.value];for(let c=u.length-1;c>=0;c--){let h=u[c];(!r||r.indexOf(h.index)!=-1)&&(h.route&&i[G]&&(this[Te](h.route),h.active===!0&&h.route.opsType==j.Append&&(l=!0)),a.push(new B(i,h.index,t.y)),u.splice(c,1))}if(u.length==0)n?i.slots.value=u:e.layers[t.y].views.splice(t.x,1);else{if(l){let c=u.length-1,h=u[c];h.active=!0,h.route&&(h.route.active=h.active)}i.slots.value=u}e.layers[t.y].views.length==0&&(o=!0);let f=t.y+1;for(;f<e.layers.length;f++){let c=e.layers[f].views,h=[];for(let y=c.length-1;(o||a.length>0)&&y>=0;y--){let d=c[y];if(d[ce]&&(o||B.include(a,d[ce]))){let m=d.slots.value;for(let p=m.length-1;p>=0;p--){let v=m[p];v.route&&d[G]&&this[Te](v.route),h.push(new B(d,v.index,f)),m.splice(p,1)}e.layers[f].views.splice(y,1)}}a=h,e.layers[f].views.length==0&&(o=!0)}}restore(e){if(!e||this[k].length==0){let t=this[U];if(t.layers.length>0){let r=t.layers[0].views;r.length>0&&(r[0].slots.value=[])}return this[b]=[],this[Ue](),Promise.resolve()}else return new Promise((r,n)=>{let i=null,o=!1;for(let a=0;a<e.length;a++){const l=e[a];this[ve].post(u=>{const f=this[Ct](l);this[Et](f),this[Ft](f),this[At](f),f.wait((c,h)=>{i=c.session.to,o=c.session.redirect,u.resolve()},(c,h)=>{i=null,h!==null&&this[O](h),u.resolve()})})}this[ve].post(a=>{if(i&&o===!0){const l=S.clone(i,!0),u=new ur(l,this[ze]());this[A]?.replace(u)}a.resolve(),r()})})}[pr](e,t,r){const n=e.updateType??Xe.Part;return this[mr](t).then(()=>{const o=this[vr](t,e,r,n);if(o.status==="error")throw Error(o.message);return o})}[mr](e){let t=[];for(let r=0;r<e.layers.length;r++){let n=e.layers[r];for(let i=0;i<n.models.length;i++){let o=n.models[i];o.isResolved||t.push(o.resolve())}}return t.length>0?Promise.all(t):Promise.resolve()}[vr](e,t,r,n){if(e.layers[0].models.length!==1)return{status:"error",message:"illegal route structure(multi root node)"};const i=e.layers[0].models[0];let o=this[U],a=Ms(o),l=t.root??te,u;!a&&n==Xe.Part&&(u=this[wt](o,t));let f,c=0;if(u==null||u==null)if(a||n===Xe.All){if(o.layers.length==0&&(o.layers[0]=new pt),o.layers[0].views.length==0){let h=t.root??te;f=new Fe(h,!0,null),o.layers[0].views=[f]}else f=o.layers[0].views[0];u={x:0,y:0}}else{let h=t.slot;if(!h)return{status:"error",message:"can not rebuild view(because not route slot)"};let y=h.level;if(y>o.layers.length)return{status:"error",message:"can not insert view(override level)"};let d;if(h.rootName){let m=o.layers[y-1];for(let p of m.views){if(p[G]&&p.name===h.rootName){d=new B(p,h.rootIndex??0,y-1);break}if(p[J]&&p[J].view.name===h.rootName&&p[J].index===h.rootIndex){d=p[J];break}}}if(!d)return{status:"error",message:"can not insert view(not find root node ref)"};f=new Fe(l,!0,d),o.layers[y].views.push(f),u={x:o.layers[y].views.length-1,y}}else f=o.layers[u.y].views[u.x];if(c=u.y,f[G]=!0,t.opsType===j.Append){t.index=le.get(),t.active=!0;let h=f.slots.value;if(h.length>0){let v=h[h.length-1];v.active=!1,v.route&&(v.route.active=v.active)}let y=new se(t,i,t.index,!0);f.slots.value=[...h,y];let d=c+1,m=1,p=new B(f,t.index,c);this[ne](o,d,e,m,p)}else if(t.opsType===j.Open){let h=f.slots.value;const y=t.active??!0;let d=!1;for(let m of h){if(m.route!==null&&S.isSameForRouteModel(m.route,t)){if(m.active===y)return t.index=m.index,t.active=y,m.route=t,{status:"no-change",message:""};m.active=y,d=!0,t.index=m.index,t.active=y,m.route=t}else y&&(m.active=!1);m.route&&(m.route.active=m.active)}if(!d){t.index=le.get(),t.active=y;let m=new se(t,i,t.index,y);h.push(m);let p=c+1,v=1,g=new B(f,t.index,c);this[ne](o,p,e,v,g)}f.slots.value=[...h]}else{let h=f.slots.value;if(h.length==0){t.index=le.get(),t.active=!0,f.slots.value=[new se(t,i,t.index)];let y=c+1,d=1,m=new B(f,t.index,c);this[ne](o,y,e,d,m)}else{let y=h[0];if(y.model!==i){this[ue](o,u,null,!0),t.index=le.get(),t.active=!0,f.slots.value=[new se(t,i,t.index)];let d=c+1,m=1,p=new B(f,t.index,c);this[ne](o,d,e,m,p)}else{y.route!==null&&this[Te](y.route);let d=!1;const m=t.active??!0;y.active!==m&&(y.active=m,d=!0),t.active=m,t.index=y.index,y.route=t;let p=[];for(let $=1;$<h.length;$++)p.push(h[$].index);p.length>0?this[ue](o,u,p,!0):d&&(f.slots.value=[...h]);let v=[new B(f,t.index,c)],g=c+1,T=1,x=new B(f,t.index,c);for(;v.length>0&&g<o.layers.length&&T<e.layers.length;g++,T++){let $=[];for(let C=0;C<o.layers[g].views.length;C++){let E=o.layers[g].views[C];E[ce]&&B.include(v,E[ce])&&$.unshift(C)}let F=[];for(let C of $){let E=o.layers[g].views[C],W=e.layers[T].models,M;for(let N=0;N<W.length;N++)if(E.name===W[N].name){M=W[N];break}if(!M)this[ue](o,{x:C,y:g},null,!1);else{let N=E.slots.value;if(N.length==0){let X=0;E.slots.value=[new se(null,M,X)];let z=g+1,re=T+1;this[ne](o,z,e,re,x)}else{let X=N[0];if(X.model!==M){this[ue](o,{x:C,y:g},null,!0),E.slots.value=[new se(null,M,0)];let z=g+1,re=T+1;this[ne](o,z,e,re,x)}else{E[G]&&X.route!==null&&this[Te](X.route);let z=[];for(let re=1;re<N.length;re++)z.push(N[re].index);z.length>0&&this[ue](o,{x:C,y:g},z,!0),F.push(new B(E,X.index,g))}}E[G]=!1}}v=F}this[ne](o,g,e,T,x)}}}if(f&&f[J]){let h=f[J];h&&(t.slot=new cs(l,c,h?.view.name,h?.index??0))}return r.to=void 0,r.routeModel=void 0,t.session=r,this[gr](t),{status:"success",message:""}}[ne](e,t,r,n,i){let o=n,a=t;for(;a<e.layers.length&&o<r.layers.length;a++,o++){let l=e.layers[a].views;for(let u of r.layers[o].models){let f=new Fe(u.name,!1,i),c=new se(null,u);f.slots.value=[c],l.push(f)}}for(;o<r.layers.length;o++){let l=new pt;l.views=[];for(let u of r.layers[o].models){let f=new Fe(u.name,!1,i),c=new se(null,u);f.slots.value=[c],l.views.push(f)}e.layers.push(l)}}[_r](e,t,r,n,i,o){if(t<0||t>this[U].layers.length)return null;if(t<this[U].layers.length){let f=this[U].layers[t],c=null;for(let h of f.views){let y=!1;if(r!==null?(y=h.name===e&&h[J]?.view===r,y&&n!==-1&&(y=h[J]?.index===n)):y=h.name===e,!!y){i!==null&&(h[ce]={view:i,index:o,level:t-1}),c=h;break}}if(c!==null)return c}let a=null,l=null;i!==null&&(i[G]?a={view:i,index:o,level:t-1}:a=i[J],l={view:i,index:o,level:t-1});let u=new Fe(e,!0,a);if(u[ce]=l,t==this[U].layers.length){let f=new pt;f.views=[u],this[U].layers.push(f)}else this[U].layers[t].views.push(u);return u}}const Hs="fox-router-view",Ds="fox-router-link";function Mr(s,e=!1){let t=null;return e?t=s.showFromClass??s.enterFromClass:t=s.enterFromClass,t||(t=s.transitionName,t?e?`${t}-show-from`:`${t}-enter-from`:null)}function Nr(s,e=!1){let t=null;return e?t=s.showActiveClass??s.enterActiveClass:t=s.enterActiveClass,t||(t=s.transitionName,t?e?`${t}-show-active`:`${t}-enter-active`:null)}function Vs(s,e=!1){let t=null;return e?t=s.showToClass??s.enterToClass:t=s.enterToClass,t||(t=s.transitionName,t?e?`${t}-show-to`:`${t}-enter-to`:null)}function Bs(s,e=!1){let t=null;return e?t=s.hideFromClass??s.leaveFromClass:t=s.leaveFromClass,t||(t=s.transitionName,t?e?`${t}-hide-from`:`${t}-leave-from`:null)}function ks(s,e=!1){let t=null;return e?t=s.hideActiveClass??s.leaveActiveClass:t=s.leaveActiveClass,t||(t=s.transitionName,t?e?`${t}-hide-active`:`${t}-leave-active`:null)}function Us(s,e=!1){let t=null;return e?t=s.hideToClass??s.leaveToClass:t=s.leaveToClass,t||(t=s.transitionName,t?e?`${t}-hide-to`:`${t}-leave-to`:null)}function Ws(s,e=!1){let t=null;return e?t=s.beforeShow??s.beforeEnter:t=s.beforeEnter,t}function zs(s,e=!1){let t=null;return e?t=s.show??s.enter:t=s.enter,t}function Js(s,e=!1){let t=null;return e?t=s.afterShow??s.afterEnter:t=s.afterEnter,t}function Gs(s,e=!1){let t=null;return e?t=s.showCancelled??s.enterCancelled:t=s.enterCancelled,t}function Qs(s,e=!1){let t=null;return e?t=s.hide??s.leave:t=s.leave,t}function Xs(s,e=!1){let t=null;return e?t=s.afterHide??s.afterLeave:t=s.afterLeave,t}function Ys(s,e=!1){let t=null;return e?t=s.hideCancelled??s.leaveCancelled:t=s.leaveCancelled,t}function zt(s){let e,t=s.duration;return typeof t=="object"?e={enter:t.enter??-1,leave:t.leave??-1,show:t.show??-1,hide:t.hide??-1}:(typeof t=="string"&&(t=t.length==0?-1:Number(t)),e={enter:t,leave:t,show:t,hide:t}),e}function Re(s,e){s.classList.contains(e)||s.classList.add(e)}function Se(s,e){s.classList.remove(e)}const Zs=Pe&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout;function Jt(s){Zs(s)}function D(s,e,t){P(e)&&(s==null&&(s={}),Reflect.apply(e,s,t))}function Ir(s,e,t,r=-1,n,i,o,a){if(P(i)){if(n!==void 0&&n>=0){setTimeout(()=>{Reflect.apply(i,s,[e,t,r]),P(a)&&Reflect.apply(a,s,[])},n);return}const l=["animationend","transitionend"],u=f=>{l.forEach(c=>{Tt(e,c,u)}),Reflect.apply(i,s,[e,t,r]),a&&Reflect.apply(a,s,[])};l.forEach(f=>{Kt(e,f,u)})}if(P(o)){const l="animationcancel",u=f=>{Reflect.apply(o,s,[e,t,r]),Tt(e,l,u)};Kt(e,l,u)}}function Gt(s){return!Pe||s===null?!1:s.opsType===j.Append||s.opsType===j.Open}function Hr(s,e,t,r={},n,i=-1){if(e||Gt(n)){const o=Mr(r,e);o&&Re(t,o);const a=Nr(r,e);a&&Re(t,a);const l=Ws(r,e);D(s,l,[t,e,n,i])}}function Dr(s,e,t,r={},n,i,o,a){if(!Gt(i)&&!e){P(a)&&a(s,a,[t]);return}const l=Mr(r,e),u=Nr(r,e),f=Vs(r,e),c=zs(r,e),h=Js(r,e),y=Gs(r,e);Jt(()=>{Ir(s,t,i,o,n,()=>{u&&Se(t,u),f&&Se(t,f),P(h)&&D(s,h,[t,e,i,o]),P(a)&&a(s,a,[t])},()=>{P(y)&&D(s,y,[t,e,i,o])}),l&&Se(t,l),f&&Re(t,f),P(c)&&D(s,c,[t,e,i,o])})}function Vr(s,e,t,r={},n,i,o,a,l){if(!Gt(o)&&!e){!e&&P(i)&&i();return}const u=Bs(r,e),f=ks(r,e),c=Us(r,e),h=Qs(r,e),y=Xs(r,e),d=Ys(r,e);u&&Re(t,u),f&&Re(t,f),P(h)&&D(s,h,[t,e,o,a]),Jt(()=>{Ir(s,t,o,a,n,()=>{f&&Se(t,f),c&&Se(t,c),P(y)&&D(s,y,[t,e,o,a]),P(l)&&D(s,l,[t]),!e&&P(i)&&i()},()=>{P(d)&&D(s,d,[t,e,o,a]),P(l)&&D(s,l,[t]),!e&&P(i)&&i()}),u&&Se(t,u),c&&Re(t,c)})}function Nt(s,e={},t,r=-1){const n=e.mode??"default",i=zt(e);return{mode:n,persisted:!1,beforeEnter:a=>{Hr(s,!1,a,e,t,r)},enter:a=>{Dr(s,!1,a,e,i.enter,t,r)},leave:(a,l)=>{Vr(s,!1,a,e,i.leave,l,t,r)},clone:a=>Nt(s,e,t,r)}}function Br(s){return s.el}function en(s,e,t={},r,n,i,o){if(i){const a=Br(e);if(a==null)return;const l=zt(t);Hr(s,!0,a,t,r,n),Dr(s,!0,a,t,l.show,r,n,u=>{P(o)&&D(s,o,[u])})}else P(o)&&D(s,o,[])}function tn(s,e,t={},r,n,i,o){if(i){const a=Br(e);if(a==null)return;const l=zt(t);Vr(s,!0,a,t,l.hide,null,r,n,u=>{P(o)&&D(s,o,[u])})}else P(o)&&D(s,o,[])}function rn(s,e={}){Jt(()=>{for(let t=0;t<s.length;t++)Reflect.apply(s[t],e,[])})}function ie(s,e,t){return typeof s=="function"?Reflect.apply(s,{},[e,t]):s}function _t(s,e){if(!s)return null;const t=s(e);return t.length===1?t[0]:t}function ge(s,e){return typeof e=="function"?e(s):s}class sn{node;state;constructor(e,t){this.node=e,this.state=t}}const It=w.defineComponent({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,required:!1,default:"default"},modelSlot:{type:[Object],required:!1},multi:{type:Boolean,required:!1,default:!1},tag:{type:[String,Object,Function],required:!1,default:"div"},viewTag:{type:[String,Object,Function],required:!1,default:"div"},viewTagProps:{type:[Object,Function],required:!1,default(){return{}}},viewClass:{type:[String,Function],required:!1},viewActiveClass:{type:[String,Function],required:!1},viewInactiveClass:{type:[String,Function],required:!1},transition:{type:[Boolean,String,Function],required:!1,default:!1},transitionName:{type:String,required:!1},enterFromClass:{type:String,required:!1},enterActiveClass:{type:String,required:!1},enterToClass:{type:String,required:!1},leaveFromClass:{type:String,required:!1},leaveActiveClass:{type:String,required:!1},leaveToClass:{type:String,required:!1},showFromClass:{type:String,required:!1},showActiveClass:{type:String,required:!1},showToClass:{type:String,required:!1},hideFromClass:{type:String,required:!1},hideActiveClass:{type:String,required:!1},hideToClass:{type:String,required:!1},beforeEnter:{type:Function,required:!1},enter:{type:Function,required:!1},afterEnter:{type:Function,required:!1},enterCancelled:{type:Function,required:!1},beforeLeave:{type:Function,required:!1},leave:{type:Function,required:!1},afterLeave:{type:Function,required:!1},leaveCancelled:{type:Function,required:!1},beforeShow:{type:Function,required:!1},show:{type:Function,required:!1},afterShow:{type:Function,required:!1},showCancelled:{type:Function,required:!1},beforeHide:{type:Function,required:!1},hide:{type:Function,required:!1},afterHide:{type:Function,required:!1},hideCancelled:{type:Function,required:!1}},setup(s,e){const t=w.getCurrentInstance();if(t===null||t.proxy===null){console.error("instance or instance.proxy not exist");return}const r=s.multi===!0,n=w.inject(it,null),i=w.inject(ht,0),o=w.inject(lr,null),a=w.inject(yt,-1);let l=null;const u=s.modelSlot;if(u){if(w.provide(ht,i+1),w.provide(yt,u.index),w.provide(dt,u.index),!u.route){console.warn("child view render error, route not exist");return}const h=tt(t.proxy,!0);vs(h),or(h,()=>u.route??null)}else{if(n==null){console.error("router is not been injected");return}const c=s.name,h=w.inject(ar,null),y=w.inject(dt,0);if(l=n[_r](c,i,o,a,h,y),l===null)return;w.provide(ar,l);const d=l[G]===!0;if(d&&w.provide(lr,l),!r&&(w.provide(yt,-1),w.provide(ht,i+1),w.provide(dt,-1),d)){const m=tt(t.proxy,!0);or(m,()=>{const p=l.slots.value;return p.length>0?p[0].route:null})}}const f={value:new Map};return w.onUnmounted(()=>{f.value&&f.value.clear()}),()=>{if(r){const c=new Map,h=[],y=l?.slots.value,d=[];for(let v=0;v<y.length;v++){const g=y[v],T=`${s.name}_${g.index}`,x=ie(s.transition,g.route,v)??!0,$={modelSlot:g};let F;e.slots.default?F=w.h(It,$,{default:e.slots.default}):F=w.h(It,$);const C={},E=ie(s.viewClass,g.route,v);typeof E=="string"&&E.length>0&&(C[E]=!0);const W=ie(s.viewActiveClass,g.route,v),M=ie(s.viewInactiveClass,g.route,v),N=f.value.get(T);if(typeof W=="string"&&W.length>0&&(C[W]=g.active),typeof M=="string"&&M.length>0&&(C[M]=!g.active),N&&g.active!==N.state){const Y=N.node;g.active?d.unshift(()=>{const lt=()=>{let Ce=nr(Y);Ce!=null&&ir(Ce,Lt.ACTIVATED)};en(t,Y,s,g.route,v,x,lt)}):d.push(()=>{const lt=()=>{const Ce=nr(Y);Ce!=null&&ir(Ce,Lt.DEACTIVATED)};tn(t,Y,s,g.route,v,x,lt)})}const X={class:C,key:T},z=ie(s.viewTagProps,g.route,v);if(z!==null&&typeof z=="object"){const Y=ge(z,n?.propsFilter);K(!0,X,Y)}if(g.route?.viewTagAttrs&&typeof g.route?.viewTagAttrs=="object"){const Y=ge(g.route.viewTagAttrs,n?.propsFilter);K(!0,X,Y)}const re=ie(s.viewTag,g.route,v),ot=w.h(re,X,{default:()=>[F]});if(c.set(T,new sn(ot,g.active)),f.value.delete(T),x){const Y=Nt(t,s,g.route,v);ot.transition=Y}h.push(ot)}f.value.forEach(v=>{v.node.transition=null}),f.value=c,rn(d,t);const m=ie(s.tag,null,-1),p={};return Object.assign(p,e.attrs),w.h(m,p,{default:()=>h})}else if(u!=null){const c=u.model,h={};if(c.props){if(typeof c.props=="object"){const d=ge(c.props,n?.propsFilter);K(!1,h,d)}else if(c.props===!0&&typeof u.route?.params=="object"){const d=ge(u.route.params,n?.propsFilter);K(!1,h,d)}}const y=w.h(c.component,h);return _t(e.slots.default,{Component:y,route:u.route})??y}else{const c=l.slots.value;if(c.length>0){const h=c[0],y=h.route??(t.proxy&&Ut(t.proxy))??null,d=h.model,m={};if(d.props){if(typeof d.props=="object"){const g=ge(d.props,n?.propsFilter);K(!1,m,g)}else if(d.props===!0&&typeof y?.params=="object"){const g=ge(y.params,n?.propsFilter);K(!1,m,g)}}const p=w.h(d.component,m);if(ie(s.transition,y,-1)??!0){const g=Nt(t,s,y,-1);p.transition=g}return _t(e.slots.default,{Component:p,route:y})??p}else return _t(e.slots.fallback,{})}}}});function nn(s){if(!(s.metaKey||s.altKey||s.ctrlKey||s.shiftKey)&&!s.defaultPrevented&&!(s.button!=null&&s.button!==0)){if(s.currentTarget&&s.currentTarget.getAttribute){const e=s.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(e))return}return s.preventDefault&&s.preventDefault(),!0}}function on(s,e){return s==null||e==null?!1:!!(s===e||s.path&&s.path===e.path||s.name&&s.name===e.name)}function ln(s,e){return s==null||e==null?!1:!!(s.path&&e.path&&e.path.startsWith(s.path)||s.name&&s.name==e.name)}function we(s,e){return typeof s=="function"?Reflect.apply(s,{},[e]):s}let an=w.defineComponent({name:"RouterLink",inheritAttrs:!1,props:{tag:{type:[String,Object,Function],required:!1,default:"a"},to:{type:[String,Object,Function],required:!0},root:{type:String},activeClass:{type:[String,Function],required:!1,default:"fox-router-link-active"},exact:{type:[String,Boolean,Function],required:!1},exactActiveClass:{type:[String,Function],required:!1,default:"fox-router-link-exact-active"},event:{type:[String,Function],required:!1,default:"onClick"}},setup(s,e){const t=w.inject(it,null);return()=>{let r=we(s.to,null),n=we(s.tag,r);if(n==null){console.warn("can not resolve link tag");return}let i=null,o=null;t!==null&&(i=t[H](r),s.root&&(i.root=s.root),o=t.current);let a={},l=we(s.activeClass,i);if(typeof l=="string"&&l.length>0&&(a[l]=ln(i,o)),we(s.exact,i)===!0){let h=we(s.exactActiveClass,i);typeof h=="string"&&h.length>0&&(a[h]=on(i,o))}let f={class:a};(n==="a"||n==="A")&&(f.href=i?.path??i?.name??"#"),K(!0,f,e.attrs);let c=we(s.event,i);if(typeof c=="string"){const h=y=>{if(t==null){console.warn("router is not been injected");return}if(i==null){console.warn("route is not been resolved");return}nn(y)&&t.to(i)};f[c]=h}return w.h(n,f,e.slots)}}});var L=(s=>(s[s.Loading=0]="Loading",s[s.Loaded=1]="Loaded",s[s.Defining=2]="Defining",s[s.Defined=3]="Defined",s))(L||{}),Ze=(s=>(s[s.normal=0]="normal",s[s.factory=1]="factory",s))(Ze||{});class un{register=new Map;constructor(){}get(e){return this.register.get(e)??null}set(e,t){this.register.set(e,t)}remove(e){let t=this.register.get(e);return this.register.delete(e),t??null}has(e){return this.register.has(e)}clear(){this.register.clear()}}class xr{moduleManager=new un;options={paths:{},alias:{},nature:[],timeout:3e3};set paths(e){this.options.paths=e}get paths(){return this.options.paths}set alias(e){this.options.alias=e}get alias(){return this.options.alias}set naturePaths(e){this.options.nature=e}get naturePaths(){return this.options.nature}set timeout(e){this.options.timeout=e}get timeout(){return this.options.timeout}_query;set query(e){this._query=e}get query(){return this._query}get head(){return He().head}constructor(){}setModule(e,t){const r={id:e,src:"",status:L.Defined};typeof t=="function"?(r.exports=t,r.type=Ze.factory):r.exports=t,this.moduleManager.set(e,r)}removeModule(e){this.moduleManager.remove(e)}ensure(...e){const t=[];let r=e.length-1;const n={};typeof e[r]=="object"&&(Object.assign(n,e[r]),r--);let i=null;typeof e[r]=="function"&&(i=e[r],r--);for(let l=0;l<=r;l++)if(Array.isArray(e[l])){let u=e[l];for(let f=0;f<u.length;f++)u[f]&&t.push(this.resolvePath(u[f]))}else if(typeof e[l]=="string"){let u=e[l].split(",");for(let f=0;f<u.length;f++)u[f]&&t.push(this.resolvePath(u[f]))}const o=new fn(t.length,(l,u)=>{if(o.isOK())try{typeof i=="function"&&Reflect.apply(i,{},u)}catch(f){console.error(f.message,f)}else try{console.error(l),typeof i=="function"&&Reflect.apply(i,{},[])}catch(f){console.error(f.message,f)}}),a=new Ie;for(let l=0;l<t.length;l++){const u=new cn(l,t[l],n,o);this.mount(a,u)}return this}remove(...e){let t=[],r=e.length-1,n={};typeof e[r]=="object"&&(Object.assign(n,e[r]),r--);let i=null;typeof e[r]=="function"&&(i=e[r],r--);for(let o=0;o<=r;o++)if(Array.isArray(e[o])){let a=e[o];for(let l=0;l<a.length;l++)a[l]&&t.push(this.resolvePath(a[l]))}else{let a=e[o].split(",");for(let l=0;l<a.length;l++)a[l]&&t.push(this.resolvePath(a[l]))}return t.forEach(o=>{this.unmount(o,n)}),typeof i=="function"&&Reflect.apply(i,{},[]),this}mount(e,t){if(t.src==="exports"){e.post(n=>{t.progress.work(!0,t.index,"exports"),n.resolve()});return}else if(t.src==="module"){e.post(n=>{t.progress.work(!0,t.index,"module"),n.resolve()});return}if(this.isNaturePath(t.src)){let n=t.params.jsPoint;n||(n=this.head),this.mountJS(e,t,n);return}else if(this.isNaturePath(t.src)){let n=t.params.cssPoint;n||(n=this.head),this.mountCSS(e,t,n);return}let r=this.getFileNamePostfix(t.src);if(r==="js"||r.length===0){let n=t.params.jsPoint;n||(n=this.head),this.mountJS(e,t,n);return}else if(r==="css"){let n=t.params.cssPoint;n||(n=this.head),this.mountCSS(e,t,n);return}}mountCSS(e,t,r){e.post(n=>{const i=t.src,o=this.moduleManager.get(i);if(o&&(o.status==L.Defined||o.status==L.Loaded)&&o.exports){o.type===Ze.factory&&typeof o.exports=="function"?t.progress.work(!0,t.index,o.exports()):t.progress.work(!0,t.index,o.exports),n.resolve();return}const a=He(),l=a.createElement("link");if(Reflect.has(l,"onload"))l.onload=()=>{l.onload=null,l.onerror=null,t.progress.work(!0,t.index,t.src),n.resolve()},l.onerror=()=>{try{r.removeChild(l)}catch(c){console.error(c.message,c)}l.onload=null,l.onerror=null,t.progress.work(!1,t.index,null),n.reject()};else{const c={timeout:this.options.timeout??3e3,time:0,success:()=>{t.progress.work(!0,t.index,t.src),n.resolve()},error:()=>{try{r.removeChild(l)}catch(h){console.error(h.message,h)}t.progress.work(!1,t.index,null),n.resolve()}};setTimeout(()=>{kr(l,c)},1)}let f=a.getElementById(i);f&&f.parentNode&&f.parentNode.removeChild(f),l.rel="stylesheet",l.type="text/css",l.id=i,l.href=i,r.appendChild(l)})}mountJS(e,t,r){e.post(n=>{const i=t.src;let o=this.moduleManager.get(i);if(o&&(o.status==L.Defined||o.status==L.Loaded)){if(o.exports){o.type===Ze.factory&&typeof o.exports=="function"?t.progress.work(!0,t.index,o.exports()):t.progress.work(!0,t.index,o.exports),n.resolve();return}if(document.querySelector(`script[src='${i}`)){t.progress.work(!0,t.index,o.exports),n.resolve();return}}o={id:i,src:i,status:L.Loading},this.moduleManager.set(i,o);const l=He().createElement("script");if("onload"in l)l.onload=()=>{l.onload=null,l.onerror=null,o.status===L.Loading&&(o.status=L.Loaded,t.progress.work(!0,t.index,i)),n.resolve()},l.onerror=()=>{try{r.removeChild(l)}catch(c){console.error(c.message,c)}l.onload=null,l.onerror=null,this.moduleManager.remove(i),t.progress.work(!1,t.index,null),n.resolve()};else{const c=l;c.onreadystatechange=()=>{/loaded|complete/.test(c.readyState)&&(c.onreadystatechange=null,o.status==L.Loading&&(o.status=L.Loaded,t.progress.work(!0,t.index,i)),n.resolve())}}l.defer=!0,l.src=i;const f=q();f.define=this.createDefine(o,t),r.appendChild(l)})}unmount(e,t={}){const r=He(),n=this.getFileNamePostfix(e);if(n==="js"||n.length===0){const i=r.querySelector(`script[src="${e}"]`);i&&i.parentNode&&i.parentNode.removeChild(i),this.moduleManager.remove(e);return}else if(n==="css"){const i=r.querySelector(`style[href="${e}"]`);i&&i.parentNode&&i.parentNode.removeChild(i);return}}trimEmptyElement(e){let t=[];for(let r=0;r<e.length;r++){if(e[r]===void 0||e[r]===null)continue;const n=e[r].trim();n.length!==0&&t.push(n)}return t}createDefine(e,t){const r=this,n=function(...i){e.status=L.Defining;let o,a,l,u=i.length;u===1?(l=i[0],o=void 0):u===2?(l=i[1],Array.isArray(i[0])?(a=r.trimEmptyElement(i[0]),o=void 0):a=void 0):(o=i[0],a=r.trimEmptyElement(i[1]),l=i[2]),o&&(e.id=o,r.options.alias[o]=e.src),a&&a.length>0?r.ensure(a,(...f)=>{const c=f.map(h=>h==="exports"?((!e.exports||typeof e.exports!="object")&&(e.exports={}),e.exports):h==="module"?e:h);if(typeof l=="function"){const h=Reflect.apply(l,e,c);h&&typeof h=="object"&&(e.exports=h)}else e.exports=l;e.status=L.Defined,t.progress.work(!0,t.index,e.exports)}):(typeof l=="function"?e.exports=Reflect.apply(l,e,[]):e.exports=l,e.status=L.Defined,t.progress.work(!0,t.index,e.exports))};return n.amd=!0,n}resolvePath(e){try{if(e==="exports"||e==="module"||this.isNaturePath(e))return e;e=this.parserPath(e,!0);let t=this.getFileNamePostfix(e);t=t.toLowerCase();let r=this.createSearch(this.query);return e.indexOf("?")==-1?(t!=="js"&&t!=="css"&&(e+=".js"),r.length>0&&(e+=`?${r}`)):r.length>0&&(e+=`&${r}`),e}catch(t){throw console.error(`resolve path[${e}] fail`,t),t}}createSearch(e){let t="";if(e){for(let r in e){let n=`${e[r]}`;t+=`${encodeURIComponent(r)}=${encodeURIComponent(n)}&`}t.length>0&&(t=t.substring(0,t.length-1))}return t}getFileNamePostfix(e){let t=e.lastIndexOf("?");t==-1&&(t=e.length);let r=e.lastIndexOf(".",t);return r==-1?"":e.substring(r+1,t)}isNaturePath(e){if(!this.options.nature)return!1;if(typeof this.options.nature=="function")return this.options.nature(e);const t=this.options.nature;if(t&&Array.isArray(t))for(let r=0;r<t.length;r++){const n=t[r];if(e.indexOf(n)===0)return!0}return!1}parserPath(e,t){if(e.indexOf("http://")==0||e.indexOf("https://")==0||e.indexOf("file:///")==0)return e;if(e.indexOf("/")==0)return`${at()}${e.slice(1)}`;if(e.indexOf("./")==0)return`${at()}${e.slice(2)}`;if(e.indexOf("//")==0)return`${q().location.protocol}${e}`;if(t){let n=this.options.alias[e];if(!n){let i=e.indexOf("/");if(i==-1)n=e;else{let o=e.slice(0,i),a=this.options.paths[o];a?n=a+e.slice(i):n=e}}return this.parserPath(n,!1)}return`${at()}${e}`}}function kr(s,e){let t=s.sheet,r=!1;if(e.isOldWebKit)t&&(r=!0);else if(t)try{t.cssRules&&(r=!0)}catch(n){n.name==="NS_ERROR_DOM_SECURITY_ERR"&&(r=!0)}setTimeout(()=>{e.time+=20,r?e.success():e.timeout>e.timeout?e.error():kr(s,e)},20)}class fn{callback;values;status;size;lastIndex;constructor(e,t){this.size=e,this.callback=t,this.status=!0,this.values=[],this.lastIndex=-1}work(e,t,r){if(this.status=e,this.status===!0&&(this.lastIndex!==t&&this.size--,this.lastIndex=t,this.values.push(r)),this.size===0||this.status===!1)try{Reflect.apply(this.callback,this,[this.status,this.values])}catch(n){console.error(n.message,n)}}isOK(){return this.status}}class cn{index;src;params;progress;constructor(e,t,r,n){this.index=e,this.src=t,this.params=r,this.progress=n}}const Qt=Symbol("fk"),Xt=Symbol("fbk"),Yt=Symbol("fepk");function hn(s={}){const e=new Is(s),t=new qt,r=new Ot,n=new xr,i={get router(){return e},get bus(){return t},get Bus(){return qt},get EventProxy(){return Ot},get eventproxy(){return r},get EventChain(){return Ie},get Require(){return xr},get require(){return n},get extend(){return K},get clone(){return nt},get isESModule(){return Ht},install(o){o.provide(it,e),o.provide(Qt,i),o.provide(Xt,t),o.provide(Yt,r),o.component(Hs,It),o.component(Ds,an),Reflect.defineProperty(o.config.globalProperties,"$fox",{get(){return i}}),Reflect.defineProperty(o.config.globalProperties,"$router",{get(){return e}}),Reflect.defineProperty(o.config.globalProperties,"$bus",{get(){return t}}),Reflect.defineProperty(o.config.globalProperties,"$bus",{get(){return t}}),Reflect.defineProperty(o.config.globalProperties,"$eventProxy",{get(){return r}}),o.config.globalProperties.$fox_on=function(a,l,u=!1){r.on(a,l,u)},o.config.globalProperties.$fox_off=function(a,l){r.off(a,l)},o.config.globalProperties.$fox_once=function(a,l){r.once(a,l)},o.config.globalProperties.$fox_all=function(...a){let l=r;Reflect.apply(l.all,l,a)},o.config.globalProperties.$fox_trigger=function(a,...l){let u=r;Reflect.apply(u.trigger,u,[a,...l])},o.config.globalProperties.$fox_emit=function(a,...l){let u=r;Reflect.apply(u.trigger,u,[a,...l])},o.mixin({computed:{$route(){return Ut(this)}}}),e.init()}};return i}function Zt(s){return s?s.$router:w.inject(it)}function yn(s){return s||(s=w.getCurrentInstance()?.proxy??void 0),s?Ut(s):null}function dn(s){return s?s.$fox:w.inject(Qt)}function pn(s){return s?s.$bus:w.inject(Xt)}function mn(s){return s?s.$eventProxy:w.inject(Yt)}function vn(s){const e=Zt(),t=(r,n,i)=>{try{Reflect.apply(s,{},[r,n])}catch(o){console.error(o)}i()};e.beforeEach(t),w.onUnmounted(()=>{e.removeBeforeEach(t)})}function gn(s){const e=Zt(),t=(r,n,i)=>{try{Reflect.apply(s,{},[r,n])}catch(o){console.error(o)}i()};e.afterEach(t),w.onUnmounted(()=>{e.removeAfterEach(t)})}exports.Bus=qt;exports.EventChain=Ie;exports.EventProxy=Ot;exports.Route=S;exports.clone=nt;exports.createFox=hn;exports.createMemoryHistory=Lr;exports.createWebHashHistory=Or;exports.createWebHistory=Os;exports.deleteContextValue=ms;exports.extend=K;exports.foxBusKey=Xt;exports.foxEventProxyKey=Yt;exports.foxKey=Qt;exports.injectContextValue=kt;exports.isArray=Wr;exports.isDate=Gr;exports.isESModule=Ht;exports.isEqual=jt;exports.isFunction=P;exports.isMap=zr;exports.isNil=Sr;exports.isObject=Rr;exports.isPlainObject=Pr;exports.isPromise=Yr;exports.isSet=Jr;exports.isString=Qr;exports.isSymbol=Xr;exports.onAfterRouteUpdate=gn;exports.onBeforeRouteUpdate=vn;exports.onFoxActivated=xs;exports.onFoxInactivated=Rs;exports.provideContextValue=ps;exports.sessionKey=oe;exports.toBoolean=Dt;exports.toNumber=rs;exports.toTypeString=st;exports.typeOf=$t;exports.useBus=pn;exports.useEventProxy=mn;exports.useFox=dn;exports.useRoute=yn;exports.useRouter=Zt;