@fox-js/fox 3.1.1-5 → 3.1.1-7
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 +2 -2
- package/libs/index.esm.d.ts +151 -4
- package/libs/index.esm.js +1593 -1553
- package/libs/index.umd.js +3 -3
- package/package.json +1 -1
package/libs/index.cjs.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use strict";/*!
|
|
2
|
-
* fox v3.1.0
|
|
3
|
-
*/Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=require("vue"),ye=typeof window<"u",K=function(){return window},Ue=function(){return window.document};function is(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 mt(){if(!ye)return"/";let s=K().location,e=`${s.protocol}//${s.host}`;return e+=is(s.pathname),e}function it(s,e,t,r=!1){s.addEventListener?s.addEventListener(e,t,r):s.attachEvent?s.attachEvent(`on${e}`,t):s[`on${e}`]=t}function Bt(s,e,t){s.removeEventListener?s.removeEventListener(e,t):s.detachEvent?s.detachEvent(`on${e}`,t):s[`on${e}`]=null}const Be=(s,e,t)=>{e=e??{bubbles:!1,cancelable:!1,detail:void 0};const r=document.createEvent("Events");let n=!0,i=!0;for(let a in e)a==="bubbles"?n=!!e[a]:a==="cancelable"?i=!!e[a]:r[a]=e[a];r.initEvent(s,n,i),(t??document).dispatchEvent(r)},os=Array.isArray,ls=s=>ut(s)==="[object Map]",as=s=>ut(s)==="[object Set]",us=s=>s instanceof Date,R=s=>typeof s=="function",cs=s=>typeof s=="string",fs=s=>typeof s=="symbol",Er=s=>s!==null&&typeof s=="object",hs=s=>Er(s)&&R(s.then)&&R(s.catch),De=s=>s==null,ys=Object.prototype.toString,ut=s=>ys.call(s),Cr=s=>ut(s)==="[object Object]",ds=typeof Symbol=="function"&&typeof Symbol.toStringTag=="symbol";function kt(s){return s.__esModule||ds&&s[Symbol.toStringTag]==="Module"}const ms=typeof Promise<"u"&&Promise.toString().indexOf("[native code]")!==-1;function T(...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]=T(n,u,l)}else l!==void 0&&(e[o]=l)}}return e}function ct(s,e,t=!1){if(!t)T(!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)&&!Cr(i))continue;n=ct(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 pt=ms?Promise.resolve():null;function Ie(s,...e){pt!==null?e&&e.length>0?pt.then(()=>{s(e)}):pt.then(s):e&&e.length>0?setTimeout(()=>{s(e)}):setTimeout(s)}function Vt(s){return s==null?!1:typeof s=="boolean"?s:typeof s=="string"?s.toLocaleLowerCase()==="true":!!s}function ps(s){return typeof s=="number"?s:Number(s)}const vs={"[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 Ot(s){let t=Object.prototype.toString.call(s);return s==null?String(s):vs[t]||"object"}function Mt(s,e){if(s==e)return!0;if(s===void 0||e===void 0)return!1;let t=Ot(s),r=Ot(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(!Mt(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(!Mt(i,o))return!1}return!0}return!1}const Fr=s=>{const e={};for(let t of Reflect.ownKeys(s)){let r=s[t];r&&!Array.isArray(r)&&typeof r=="object"&&(r=Fr(r)),typeof t=="symbol"?e[String(t)]=r:e[t]=r}return e},gs=/^Symbol\((.*)\)$/,Ar=s=>{const e={};for(let t of Reflect.ownKeys(s)){let r=s[t];r&&!Array.isArray(r)&&typeof r=="object"&&(r=Ar(r));const n=gs.exec(t);if(n&&n[1]){const i=Symbol.for(n[1]);e[i]=r}else e[t]=r}return e};function _r(s,e){let t=null;return function(...r){t&&clearTimeout(t),t=setTimeout(()=>{t=null,Reflect.apply(s,null,[...r])},e)}}const sr=Symbol("idKey"),de=Symbol("valueKey"),S=Symbol("childrenKey"),X=Symbol("growKey");class Kr{[X]=!0;[sr];[de]=w.ref();[S]=new Map;constructor(e){this[sr]=e}}class ws{get(e,t){if(t=="value")return e[de].value;if(t==="grow")return e[X];let r=e[S].get(t);if(r)return Ne(r);if(e[X])return r=zt(t),r[X]=e[X],e[S].set(t,r),Ne(r)}set(e,t,r){return t=="value"?(e[de].value=r,!0):t==="grow"?(e[X]=Vt(r),!0):r==null?(e[S].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[S].delete(t),!0)}}const Wt="__proxy__";function zt(s){const e=new Kr(s);return Reflect.set(e,Wt,new Proxy(e,new ws)),e}function Ne(s){return Reflect.get(s,Wt)}let bs=class{name="";persistPolicy="memory";storage;initFlag=!1;state={};constructor(e={},t){if(e.persistPolicy&&e.persistPolicy!=="memory"&&De(e.name))throw new Error("name can not be empty, where persistPolicy is not memory.");this.name=e.name??"",this.persistPolicy=e.persistPolicy??"memory",this.storage=e.storage,t&&typeof t=="object"&&Object.assign(this.state,t)}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(ye){const t=K();e=this.persistPolicy==="session"?t.sessionStorage:t.localStorage}return e}saveState(){if(!this.persistPolicy||this.persistPolicy==="memory")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==="memory")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==="memory")return;let t=this.getStorage();if(t===null)return;const r=`_bus_${this.name}`,n=t.getItem(r);if(n){const i=JSON.parse(n);Object.assign(this.state,i),Reflect.ownKeys(this.state).forEach(a=>{if(typeof a!="string")return;const l=this.state[a],u=a.split(/\//g);u.push(l),Reflect.apply(e.put,e,u)})}}put(e){if(this.initFlag&&this.persistPolicy!=="memory")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!=="memory")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 Tr extends Kr{_persistHandler;constructor(e={},t){super("__root__"),this._persistHandler=new bs(e,t),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[S].has(i)?o=r[S].get(i):(o=zt(i),r[S].set(i,o)),r=o}return r[de].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[S].has(i))r=r[S].get(i);else return}return r[de].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[S].has(o))r=r[S].get(o);else return!1}const n=e[t-1];return r[S].has(n)?(r[S].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[S].has(o))r=r[S].get(o);else return!1}const n=e[t-1];return r[S].has(n)}clear(){this[S].clear(),this._persistHandler.clear()}}const xs=["put","get","contains","remove","clear","_persistHandler"];function nr(s){return xs.includes(s)}class Rs{get(e,t){if(t=="value")return e[de].value;if(t==="grow")return e[X];if(t===S)return e[S];if(typeof t=="string"&&nr(t))return e[t];const r=String(t);let n=e[S].get(r);if(n)return Ne(n);if(e[X])return n=zt(r),n[X]=e[X],e[S].set(r,n),Ne(n)}set(e,t,r){return t=="value"?(e[de].value=r,!0):t==="grow"?(e[X]=Vt(r),!0):nr(t)?!1:r==null?(e[S].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[S].delete(t),!0)}}function Ss(s,e){const t=new Tr(s,e),r=new Rs,n=new Proxy(t,r);return Reflect.set(t,Wt,n),t}const It=new Proxy(Tr,{construct(s,e){const t=e[0]??{},r=e[1],n=Ss(t,r);return Ne(n)}}),Jt=s=>!s||typeof s!="object"?!0:Reflect.ownKeys(s).length===0;class $r{name="";persistPolicy="memory";storage;constructor(e={}){if(e.persistPolicy&&e.persistPolicy!=="memory"&&De(e.name))throw new Error("name can not be empty, where persistPolicy is not memory.");this.name=e.name??"",this.persistPolicy=e.persistPolicy??"memory",this.storage=e.storage}getStorage(){if(!this.persistPolicy)return null;let e=null;if(this.persistPolicy==="custom")e=this.storage;else if(ye){const t=K();e=this.persistPolicy==="session"?t.sessionStorage:t.localStorage}return e}saveState(e){if(!this.persistPolicy||this.persistPolicy==="memory")return;let t=this.getStorage();if(t===null||Jt(e))return;const r=`_state_${this.name}`,n=JSON.stringify(e??{});t.setItem(r,n)}removeState(){if(!this.persistPolicy||this.persistPolicy==="memory")return;let e=this.getStorage();if(e===null)return;const t=`_state_${this.name}`;e.removeItem(t)}restore(e){if(!this.persistPolicy||this.persistPolicy==="memory")return;let t=this.getStorage();if(t===null)return;const r=`_state_${this.name}`,n=t.getItem(r);if(n){const i=JSON.parse(n);Object.assign(e,i)}}}function jr(s,e,t){const r=new $r(t);r.restore(e);const n=l=>{const u=w.toRaw(l),c={};for(let f in u){const h=u[f];De(h)||(c[f]=h)}Jt(c)?r.removeState():r.saveState(c)};let i=null;if(t&&t.debounce===!1)i=n;else{const l=t&&t.debounceDelay?t.debounceDelay:250;i=_r(n,l)}const o=s?w.shallowReactive(e):w.reactive(e);return w.effectScope(!0).run(()=>{w.watch(o,l=>{const u=w.toRaw(l);i(u)})}),o}function Ps(s,e){return jr(!1,s,e)}function Es(s,e){return jr(!0,s,e)}function Cs(s,e){const t=new $r(e);t.restore(s);const r=a=>{const l=w.toRaw(a),u={};for(let c in l){const f=l[c];De(f)||(u[c]=f)}Jt(u)?t.removeState():t.saveState(u)};let n=null;if(e&&e.debounce===!1)n=r;else{const a=e&&e.debounceDelay?e.debounceDelay:250;n=_r(r,a)}const i={get(a,l){return a[l]},set(a,l,u){return a[l]=u,n(a),!0}};return new Proxy(s,i)}function Fs(s,e){return Cs(s,e)}const te="default",qr=Symbol("sync"),D=Symbol("resolveRoute");function ir(s){let e=!1;return function(...t){if(!e)return e=!0,Reflect.apply(s,{},t)}}function As(s){let e=s.src;return new Promise((t,r)=>{const n=ir(a=>{kt(a)&&(a=a.default),s.component=a,console.debug("success load async module"),t()}),i=ir(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 _s{name;level;rootName;rootIndex=0;constructor(e,t,r,n){this.name=e,this.level=t,this.rootName=r,this.rootIndex=n}}class Re{to;routeModel;from;data={};constructor(e,t){this.to=e,this.from=t}static from(e){const t=new Re(e.to,e.from),r=e.data??{};return T(!0,t.data,r),t}static clear(e){for(let t in e)e[t]=void 0}}class P{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;historyUpdatePolicy;viewTagAttrs;index;active;slot;static clone(e,t){let r=new P;return ct(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 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 P;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 Ks{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 As(this)}}class or{models=[]}class vt{path;match;redirect;name;layers=[]}var q=(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))(q||{});const Lr="FoxBeforeEnter",Or="FoxEnter",Mr="FoxLeave",Ir="FoxLeave",ot="FoxLeaveEnd",B=Symbol("chainKey"),H=Symbol("cursorKey"),gt=Symbol("$persistentModeKey"),_=Symbol("statusKey"),Z=Symbol("argsKey"),ke=Symbol("exArgsKey"),pe=Symbol("successFnsKey"),Fe=Symbol("errorFnsKey"),oe=Symbol("sessionKey"),ee=Symbol("_go");class He{[B]=[];[H]=0;[gt]=!1;[_]="Free";[Z]=[];[ke]=[];[pe]=[];[Fe]=[];[oe];get session(){return this[oe]}constructor(e,t=!1){this[oe]=e,this[gt]=t}[ee](e,...t){let r=this[_];if(this[_]="Busy",this[H]+=e,this[H]<0&&(this[H]=0),this[Z]=t,r==="Exception"||r==="Reject"){let a=[{session:this[oe]},...this[ke]];for(;this[Fe].length>0;)try{let l=this[Fe].shift();typeof l=="function"&&Ie(()=>{Reflect.apply(l,{},a)})}catch(l){console.error(l.message,l)}return this[_]=r,this[B]=[],this[H]=0,this}else if(r==="Finished"||this[H]>=this[B].length){let a=[{session:this[oe]},...this[Z]];for(;this[pe].length>0;){let l=this[pe].shift();typeof l=="function"&&Ie(()=>{Reflect.apply(l,{},a)})}return this[_]="Free",this}if(this[H]>=this[B].length)return this[_]="Free",this;let n=this[B][this[H]];this[gt]||(this[B].splice(0,this[H]+1),this[H]=-1);let i=this[H]+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[B].splice(i,0,l),i++)},session:this[oe]};Ie(()=>{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[ke]=e,Reflect.apply(this[ee],this,[0])}throw(...e){return this[_]="Exception",this[ke]=e,Reflect.apply(this[ee],this,[0])}reset(...e){this[_]="Busy",this[Z]=e,this[B]=[],this[H]=0;let r=[{session:this[oe]},...this[Z]];for(;this[pe].length>0;){let n=this[pe].shift();Ie(()=>{Reflect.apply(n,this,r)})}return this[_]="Free",this}post(e){return this[_]==="Reject"||this[_]==="Exception"?this:(Array.isArray(e)?this[B]=[...this[B],...e]:this[B].push(e),this[_]==="Busy"?this:(Reflect.apply(this[ee],this,[0,...this[Z]]),this))}wait(e,t){return e&&typeof e=="function"&&this[pe].push(e),t&&typeof t=="function"&&this[Fe].push(t),this[_]==="Busy"?this:(Reflect.apply(this[ee],this,[0,...this[Z]]),this)}exception(e){return e&&typeof e=="function"&&this[Fe].push(e),this[_]==="Busy"?this:Reflect.apply(this[ee],this,[0,...this[Z]])}isFinish(){return this[_]=="Reject"||this[_]=="Free"&&this[H]>=this[B].length}}const ve=Symbol("registerKey");class Ts{policy;callback;constructor(e,t){this.callback=e,this.policy=t}}class Nt{[ve]=new Map;constructor(){}on(e,t,r=!1){let n=this[ve].get(e);n||(n=new Array,this[ve].set(e,n));let i=r===!0?1:0,o=new Ts(t,i);return n.push(o),this}off(e,t){if(!t)return this[ve].delete(e),this;let r=this[ve].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[ve].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{Ie(()=>{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 $s{[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 lt(s,e=!1){let t=s;if(Reflect.has(t,he))return t[he];if(e){const r=new $s;return t[he]=r,r}return null}function Nr(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=lt(n.$parent,e))}return t}function Gt(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 js(s,e,t){Nr(s,!0)?.set(e,t)}function qs(s,e){Nr(s,!0)?.delete(e)}function lr(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 lt(e.component.proxy,!1)}return null}const at=Symbol("hooksKey");function Ls(s){let e=s.get(at);e||(e=[],s.set(at,e))}function ar(s,e){let t=s.get(at);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 Ht=(s=>(s.DEACTIVATED="da",s.ACTIVATED="a",s))(Ht||{});class Os{type;hook;target;constructor(e,t,r){this.target=r,this.hook=t,this.type=e}}function Ms(s,e,t,r){let n=new Os(e,t,r);return s.push(n),!0}function Is(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 Hr(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=Gt(r,at);if(n==null){console.warn("hooks context not found");return}w.onUnmounted(()=>{Is(n,s,e,r)}),Ms(n,s,e,r)}}const Ns=Hr("a"),Hs=Hr("da"),Dr=Symbol("routeKey");function ur(s,e){s.set(Dr,e)}function Qt(s){let e=Gt(s,Dr);return typeof e=="function"?e():e??null}const ft=Symbol("rk"),wt=Symbol("vd"),cr=Symbol("rv"),bt=Symbol("rvi"),fr=Symbol("pv"),xt=Symbol("pvi");function Ds(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 Ur(s,e){e===void 0&&(e={});for(var t=Ds(s),r=e.prefixes,n=r===void 0?"./":r,i="[^".concat(xe(e.delimiter||"/#?"),"]+?"),o=[],a=0,l=0,u="",c=function(A){if(l<t.length&&t[l].type===A)return t[l++].value},f=function(A){var E=c(A);if(E!==void 0)return E;var C=t[l],z=C.type,I=C.index;throw new TypeError("Unexpected ".concat(z," at ").concat(I,", expected ").concat(A))},h=function(){for(var A="",E;E=c("CHAR")||c("ESCAPED_CHAR");)A+=E;return A};l<t.length;){var y=c("CHAR"),d=c("NAME"),p=c("PATTERN");if(d||p){var m=y||"";n.indexOf(m)===-1&&(u+=m,m=""),u&&(o.push(u),u=""),o.push({name:d||a++,prefix:m,suffix:"",pattern:p||i,modifier:c("MODIFIER")||""});continue}var v=y||c("ESCAPED_CHAR");if(v){u+=v;continue}u&&(o.push(u),u="");var g=c("OPEN");if(g){var m=h(),$=c("NAME")||"",x=c("PATTERN")||"",j=h();f("CLOSE"),o.push({name:$||(x?a++:""),pattern:$&&!x?i:x,prefix:m,suffix:j,modifier:c("MODIFIER")||""});continue}f("END")}return o}function Us(s,e){return Bs(Ur(s,e),e)}function Bs(s,e){e===void 0&&(e={});var t=Xt(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="",c=0;c<s.length;c++){var f=s[c];if(typeof f=="string"){u+=f;continue}var h=l?l[f.name]:void 0,y=f.modifier==="?"||f.modifier==="*",d=f.modifier==="*"||f.modifier==="+";if(Array.isArray(h)){if(!d)throw new TypeError('Expected "'.concat(f.name,'" to not repeat, but got an array'));if(h.length===0){if(y)continue;throw new TypeError('Expected "'.concat(f.name,'" to not be empty'))}for(var p=0;p<h.length;p++){var m=n(h[p],f);if(o&&!a[c].test(m))throw new TypeError('Expected all "'.concat(f.name,'" to match "').concat(f.pattern,'", but got "').concat(m,'"'));u+=f.prefix+m+f.suffix}continue}if(typeof h=="string"||typeof h=="number"){var m=n(String(h),f);if(o&&!a[c].test(m))throw new TypeError('Expected "'.concat(f.name,'" to match "').concat(f.pattern,'", but got "').concat(m,'"'));u+=f.prefix+m+f.suffix;continue}if(!y){var v=d?"an array":"a string";throw new TypeError('Expected "'.concat(f.name,'" to be ').concat(v))}}return u}}function ks(s,e){var t=[],r=Br(s,t,e);return Vs(r,t,e)}function Vs(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),c=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)},f=1;f<o.length;f++)c(f);return{path:a,index:l,params:u}}}function xe(s){return s.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1")}function Xt(s){return s&&s.sensitive?"":"i"}function Ws(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 zs(s,e,t){var r=s.map(function(n){return Br(n,e,t).source});return new RegExp("(?:".concat(r.join("|"),")"),Xt(t))}function Js(s,e,t){return Gs(Ur(s,t),e,t)}function Gs(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,c=u===void 0?function(I){return I}:u,f=t.delimiter,h=f===void 0?"/#?":f,y=t.endsWith,d=y===void 0?"":y,p="[".concat(xe(d),"]|$"),m="[".concat(xe(h),"]"),v=o?"^":"",g=0,$=s;g<$.length;g++){var x=$[g];if(typeof x=="string")v+=xe(c(x));else{var j=xe(c(x.prefix)),A=xe(c(x.suffix));if(x.pattern)if(e&&e.push(x),j||A)if(x.modifier==="+"||x.modifier==="*"){var E=x.modifier==="*"?"?":"";v+="(?:".concat(j,"((?:").concat(x.pattern,")(?:").concat(A).concat(j,"(?:").concat(x.pattern,"))*)").concat(A,")").concat(E)}else v+="(?:".concat(j,"(").concat(x.pattern,")").concat(A,")").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(j).concat(A,")").concat(x.modifier)}}if(l)n||(v+="".concat(m,"?")),v+=t.endsWith?"(?=".concat(p,")"):"$";else{var C=s[s.length-1],z=typeof C=="string"?m.indexOf(C[C.length-1])>-1:C===void 0;n||(v+="(?:".concat(m,"(?=").concat(p,"))?")),z||(v+="(?=".concat(m,"|").concat(p,")"))}return new RegExp(v,Xt(t))}function Br(s,e,t){return s instanceof RegExp?Ws(s,e):Array.isArray(s)?zs(s,e,t):Js(s,e,t)}var rt=(s=>(s[s.Part=0]="Part",s[s.All=1]="All",s))(rt||{});const Q=Symbol("rootKey"),G=Symbol("rootNodeKey"),fe=Symbol("parentNodeKey"),st=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 _e{_slots;get slots(){return this._slots==null&&(this._slots=w.shallowRef([])),this._slots}get empty(){return this._slots==null||this._slots.value.length==0}[st];[Q];[G]=null;[fe]=null;get name(){return this[st]}constructor(e,t,r){this[st]=e,this[Q]=t,r&&(this[G]=r)}}class k{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 Rt{views=[]}class Qs{layers=[]}class Xs{time;route}class Ys{forbidTime=300;submitRecorder=new Xs;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 Se=Symbol("_notifyChange");class hr{currentRoute;routes;constructor(e,t){this.currentRoute=e,this.routes=t}}const ae=Symbol("historyChangeConsumerKey"),yr=Symbol("_navigateFirstRoute"),Ve=Symbol("_getRouteMark"),St=Symbol("_getUrlSearch"),Pt=Symbol("_generateLocation"),We=Symbol("_setRouteMarkRecorder"),Ke=Symbol("beforeRestoreFiltersKey"),dr=Symbol("_beforeRestore"),mr="Symbol(_fox_restore_point)";function Te(s,...e){return typeof s=="function"?Reflect.apply(s,null,[...e]):s}function pr(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 kr{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??K().sessionStorage,this.backTimeout=l??320}init(e=!0){const t=K();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(Te(this.historyMonitor)){const r=t.history.state;this[Se](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[We](i,n)}}catch{}}}),it(t,"popstate",this.historyChange),this.firstNavigate&&e&&this[yr](),Promise.resolve()}destroy(){if(this.historyChange){const e=K();Bt(e,"popstate",this.historyChange)}}[dr](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}[yr](){const e=this[Ve]()??"/",t=this.storage.getItem(mr);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?Ar(l.params):{},this[dr](l,u,e,o.routes)));if(a.length>0){const l=this[St](),u=a.length-1;a[u].query=l||a[u].query,this[Se](a);return}}}catch{}const r=e.indexOf("!");let n;r!=-1?n=e.substring(r+1):n=e;const i=new P;i.path=n,i.query=this[St](),this[Se]([i])}[We](e,t){try{t.forEach(i=>{i.params=i.params?Fr(i.params):{}});const n=JSON.stringify({mark:e,routes:t});this.storage.setItem(mr,n)}catch(r){console.error(r.message,r)}}setRestorePoint(e){const t=this[Ve]()??"/";this[We](t,e)}[Se](e){typeof this.changeHandler=="function"&&this.changeHandler(e)}[Ve](){const e=K();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}[St](){let t=K().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=K();this[ae]=t,r.history.go(e)}goBack(e,t){const r=K(),n=r.history.state;if(pr(n)&&n.length>0){let i=!1;for(let c=n.length-1;c>=0;c--){const f=P.from(n[c]);if(!(f.historyUpdatePolicy==="traceless"||Te(this.traceless,f))&&P.isSame(f,e)){i=!0;break}}if(!i){t();return}const o=this.backTimeout;let a=null;const l=()=>{r.history.go(-1),a=setTimeout(l,o)},u=()=>{clearTimeout(a);const f=K().history.state;if(pr(f)&&f.length>0){let h=f.length;const y=f[h-1],d=P.from(y);if(P.isSame(d,e))return t(),!0;if(h>0){let p=!1;for(let m=h-1;m>=0;m--){const v=P.from(f[m]);if(!(v.traceless===!0||Te(this.traceless,v))&&P.isSame(v,e)){p=!0;break}}return p?(setTimeout(()=>{a=setTimeout(l,o),this.go(-1,u)},0),!0):(t(),!0)}}return t(),!0};a=setTimeout(l,o),this.go(-1,u)}else t()}setRouteMark(e){const t=e.currentRoute.fullPath;this[We](t,e.routes)}push(e){const t=this[Pt](e.currentRoute);e.currentRoute.historyUpdatePolicy!=="traceless"&&!Te(this.traceless,e.currentRoute)&&K().history.pushState(e.routes,"",t),this.setRouteMark(e)}replace(e){const t=this[Pt](e.currentRoute);(e.currentRoute.historyUpdatePolicy!=="traceless"||!Te(this.traceless,e.currentRoute))&&K().history.replaceState(e.routes,"",t),this.setRouteMark(e)}[Pt](e){const t=K();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]),c=`${encodeURIComponent(String(l))}=${u}`;a.length>0&&(a+="&"),a+=c}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 Zs(s=!0,e=null,t="",r=!0,n=!1,i){return e!==null&&(e=K().location.pathname),e&&e.endsWith("/")&&(e=e.substring(0,e.length-1)),new kr("path",e??"",t,s,r,n,i)}function Vr(s=!0,e="",t=!0,r=!1,n){return new kr("hash","",e,s,t,r,n)}class en{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}[Se](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[Se](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--){const i=this.queue[n];if(P.isSame(i.currentRoute,e))break;r++}if(r===0){t();return}this.go(-r,()=>(t(),!0))}setRouteMark(e){}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 Wr(s="",e=50){return new en(s,e)}const ze=Symbol("_constructRouteModel"),Je=Symbol("_findRouteModel"),Et=Symbol("_findRootView"),vr=Symbol("_getFirstView"),ue=Symbol("_removeView"),gr=Symbol("_buildPage"),wr=Symbol("_resolveComponent"),br=Symbol("_update"),ne=Symbol("_merge"),Ct=Symbol("_handleHistoryChange"),Ge=Symbol("_handleRouteUpdated"),Qe=Symbol("routeUpdatedCallback"),b=Symbol("currentRoutes"),Xe=Symbol("routeSessionCacheKey"),xr=Symbol("_addRouteRecorder"),$e=Symbol("_removeRouteRecorder"),Ye=Symbol("_cloneRouteRecorder"),O=Symbol("_handleError"),Ze=Symbol("errorCallback"),V=Symbol("registerKey"),et=Symbol("notFoundKey"),Ft=Symbol("notFoundPathKey"),W=Symbol("forestKey"),F=Symbol("historyKey"),je=Symbol("beforeFiltersKey"),qe=Symbol("afterFiltersKey"),Le=Symbol("destroyFiltersKey"),At=Symbol("propsFilterKey"),ge=Symbol("mainDispatcherKey"),_t=Symbol("initKey"),ce=Symbol("readyKey"),Kt=Symbol("readyHandlersKey"),tt=Symbol("_markReady"),Rr=Symbol("_createNextFn"),Tt=Symbol("_start"),$t=Symbol("_before"),jt=Symbol("_after"),Sr=Symbol("_destroy"),qt=Symbol("_load"),Oe=Symbol("_unload"),Me=Symbol("routerGuardKey");function tn(s){return s.layers.length==0||s.layers[0].views.length==0}function rn(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=T(!0,{},r.meta);e.push(n)}else r.meta&&e.push(r.meta)})}),e}class sn{[V]=new Array;[et];[Ft]="*";[ce]=!1;[Kt]=[];[W]=new Qs;[F];[b]=new Array;[Xe]=new WeakMap;[Ze]=null;[Qe]=null;[je]=new Array;[qe]=new Array;[Le]=new Array;[At]=null;[ge]=new He;[Me]=new Ys;[_t]=!1;get current(){const e=this[b].length;return e>0?this[b][e-1]:null}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[F]=e.history:this[F]=ye?Vr():Wr(),this[F]?.listen(async r=>{let n=!0;try{if(typeof r=="string"){const i=this[D](r);i&&await this[Ct]([i])}else await this[Ct](r)}catch(i){console.error(i.message,i),n=!1}this[ce]===!1&&this[tt](n)})}[O](e="error",t){if(t&&typeof t.error=="function")try{t.error(e)}catch{}if(typeof this[Ze]=="function")try{this[Ze](e,t)}catch{}console.error(e)}init(){this[_t]!==!0&&(this[F]?.init(!this[ce]),this[_t]=!0)}isReady(){return this[ce]?Promise.resolve():new Promise((e,t)=>{this[Kt].push([e,t])})}[tt](e){this[ce]=!0,this[Kt].forEach(([t,r])=>{try{e?t():r()}catch(n){console.error(n.message,n)}})}[Ct](e){try{if(!e){let o=[...this[b]].reverse();return this[Oe](o),ye&&K().location.reload(),Promise.resolve()}let t=null,r=[],n=[],i=0;for(;i<e.length&&i<this[b].length&&P.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()}[Ge](e=null){if(e||(e=this.current),typeof this[Qe]=="function")try{this[Qe](e)}catch{}}[xr](e,t){if(e.opsType===q.Open){let r=!1;const n=this[b].length-1;for(let i=n;i>=0;i--){const o=this[b][i];if(e.root==o.root){if(e.path===o.path){this[b].splice(i,1,e),r=!0;continue}e.active&&(o.active=!1)}}r||this[b].push(e)}else this[b].push(e);this[Xe].set(e,t)}[Ye](){let e=[];for(let t of this[b]){let r=P.clone(t,!0);e.push(r)}return e}[$e](e){if(!this[b])return;let t=-1;for(let r=0;r<this[b].length;r++)if(P.isSame(this[b][r],e)){t=r;break}if(t!=-1){let r=this[b][t];this[b].splice(t,1);const n=this[Xe].get(r);this[Xe].delete(r),this[Sr](r,n)}}set historyMonitor(e){this[F]&&(this[F].historyMonitor=e)}get historyMonitor(){return this[F]?this[F].historyMonitor:!1}set traceless(e){this[F]&&(this[F].traceless=e)}get traceless(){return this[F]?this[F].traceless:!1}set propsFilter(e){this[At]=e}get propsFilter(){return this[At]}setRestorePoint(){const e=this[Ye]();this[F]?.setRestorePoint(e)}onRouteUpdated(e){this[Qe]=e}onError(e){this[Ze]=e}beforeEach(e){this[je].push(e)}removeBeforeEach(e){const t=this[je].indexOf(e);return t!==-1?(this[je].splice(t,1),!0):!1}afterEach(e){this[qe].push(e)}removeAfterEach(e){const t=this[qe].indexOf(e);return t!==-1?(this[qe].splice(t,1),!0):!1}destroyEach(e){this[Le].push(e)}removeDestroyEach(e){const t=this[Le].indexOf(e);return t!==-1?(this[Le].splice(t,1),!0):!1}beforeRestoreEach(e){this[F]?.beforeRestoreEach(e)}removeBeforeRestoreEach(e){return this[F]?.removeBeforeRestoreEach(e)??!1}addRoutes(e){for(let t of e)this.addRoute(t)}addRoute(e,t=-1){if(e.path===this[Ft]){this.setNotFoundRoute(e);return}const r=this[ze](e);if(t==-1)this[V]=[...this[V],...r];else for(let n=r.length-1;n>=0;n--)this[V].splice(t,0,r[n])}removeRoute(e){const t=this[D](e);if(t===null)return console.warn("route格式错误",e),!1;for(let r=0;r<this[V].length;r++){const n=this[V][r];if(t?.path&&n.path===t.path)return this[V].splice(r,1),!0;if(t?.name&&n.name===t.name)return this[V].splice(r,1),!0}return!1}hasRoute(e){const t=this[D](e);return t===null?(console.warn("route格式错误",e),!1):this[V].findIndex(n=>{if(t?.path&&n.path===t.path||t?.name&&n.name===t.name)return!0})!==-1}setNotFoundPath(e){this[Ft]=e}setNotFoundRoute(e){const t=this[ze](e);this[et]=t[0]}getRoutes(){return[...this[V]]}[ze](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 vt;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 Ks(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[ze](a);for(let u of l){let c=new vt;c.name=u.name,u.path&&u.path.length>0?t!=="/"?c.path=`${t}${u.path}`:c.path=u.path:(i=!0,c.path=t);let f=new or;f.models=[...n],c.layers=[f,...u.layers],o.push(c)}}if(!i){const a=new or;a.models=n;const l=new vt;l.name=e.name,l.path=t,l.layers=[a],o.splice(0,0,l)}return o}[Je](e){const t=e.route;try{for(let r of this[V]){const n=t.template??t.path,i=t.template??t.name;if(n&&r.path){let o=r.match;o||(o=r.match=ks(r.path));const a=o(n);if(!a)continue;if(r.redirect){const l=new P;T(!0,l,t),l.path=r.redirect;const u={route:l,find:void 0};return this[Je](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??{},T(!0,t.params,a.params),t.query){const l=t.query;if(typeof l=="string"){const u={},c=l.split("&");for(let f of c){const h=f.split("=");if(h.length!==2)continue;const y=decodeURIComponent(h[0].trim()),d=decodeURIComponent(h[1].trim());u[y]=d}T(!0,t.params,u)}else typeof l=="object"&&T(!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=Us(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}[D](e){let t=null;if(Array.isArray(e))if(t=new P,typeof e[0]=="object")t=P.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&&T(!1,t,e[r]);else typeof e=="object"?t=P.from(e):typeof e=="string"&&(t=new P,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??q.Push,t.traceless&&!t.historyUpdatePolicy&&(t.historyUpdatePolicy="traceless")}return t}push(...e){const t=this[D](e);return t?(t.opsType=q.Push,t.historyUpdatePolicy=t.historyUpdatePolicy??"push",this.to(t)):(this[O]("resolve route fail",t),this)}put(...e){const t=this[D](e);return t?(t.opsType=q.Put,t.historyUpdatePolicy=t.historyUpdatePolicy??"traceless",this.to(t)):(this[O]("resolve route fail",t),this)}replace(...e){const t=this[D](e);return t?(t.opsType=q.Replace,t.historyUpdatePolicy=t.historyUpdatePolicy??"replace",this.to(t)):(this[O]("resolve route fail",t),this)}append(...e){const t=this[D](e);return t?(t.opsType=q.Append,t.historyUpdatePolicy=t.historyUpdatePolicy??"push",this.to(t)):(this[O]("resolve route fail",t),this)}remove(e,t){return new Promise(r=>{this[ge].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 c=this[b][u];c.opsType===q.Append&&c.root===o&&(a.splice(0,0,c),i=u-1)}else if(e.until)for(let u=this[b].length-1;u>0;u--){let c=this[b][u];if(c.opsType===q.Append&&c.root===o){if(e.until.charAt(0)==="/"&&e.until===c.path){i=u;break}else if(e.until===c.name){i=u;break}a.splice(0,0,c)}}}else{o=te;let u=this[vr](this[W]);u&&(o=u.name);for(let c=this[b].length-1;c>0;c--){let f=this[b][c];if(f.opsType===q.Append&&f.root===o){a.push(f),i=c-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=()=>(n.resolve(),r(!0),!0),c=this[b].length;if(l&&P.isSame(l,this[b][c-1])){this[F]?.goBack(l,u);return}u()}}catch(i){this[O](i),n.resolve(),r(!1)}})})}open(...e){let t=this[D](e);return t?(t.opsType=q.Open,t.historyUpdatePolicy=t.historyUpdatePolicy??"push",this.to(t)):(this[O]("resolve route fail",t),this)}close(e){return this[ge].post(t=>{try{let r=this[D](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[Ge](),t.resolve()}catch(r){this[O](r),t.resolve()}}),this}to(...e){let t=this[D](e);if(!t)return this[O]("resolve route fail",t),this;let r=this[Me].acquire(t);return r==null?(this[O]("route forbid",t),this):(this[ge].post(n=>{try{let i=this[Tt](t);this[$t](i),this[qt](i),this[jt](i),i.wait((o,a)=>{const l=o.session.to;if(o.session.updateResult&&o.session.updateResult.status==="success")try{let u=P.clone(l,!0);const c=new hr(u,this[Ye]());l.historyUpdatePolicy==="replace"?this[F]?.replace(c):l.historyUpdatePolicy==="traceless"?this[F]?.setRouteMark(c):this[F]?.push(c)}catch(u){console.error(u.message,u)}if(Re.clear(o.session),this[Me].release(r),this[Ge](l),typeof t.success=="function")try{Reflect.apply(t.success,{},[])}catch(u){console.error(u.message,u)}this[ce]===!1&&this[tt](!0),i=null,n.resolve()},(o,a)=>{this[Me].release(r),a!==null&&this[O](a,t),this[ce]===!1&&this[tt](!1),Re.clear(o.session),i=null,n.resolve()})}catch(i){this[Me].release(r),this[O](i,t),n.resolve()}}),this)}back(e=1){this[F]?.go(-e,!1)}[Rr](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[D](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()}}[Tt](e){const t=this[b].length>0?this[b][this[b].length-1]:void 0,r=new Re(e,t),n={route:e,find:null};return this[Je](n),n.find&&(r.routeModel=n.find,e.matched=rn(n.find),Array.isArray(e.matched)&&e.matched.length>0&&(e.meta=n.find.layers[0].models[0].meta)),new He(r)}[$t](e){for(let t of this[je])e.post(r=>{const n=this[Rr](r);Reflect.apply(t,{},[r.session.to,r.session.from,n,r.session])})}[jt](e){e.post(t=>{for(let r of this[qe])try{Reflect.apply(r,{},[t.session.to,t.session.from,t.session])}catch(n){console.error(n.message,n)}t.resolve()})}[Sr](e,t){for(let r of this[Le])try{Reflect.apply(r,{},[e,t])}catch(n){console.error(n.message,n)}typeof e.destroy=="function"&&Reflect.apply(e.destroy,e,[])}[qt](e){e.post(t=>{const r=t.session.to;let n=t.session.routeModel;if(n==null){let o={route:r,find:null};if(this[Je](o))n=o.find,t.session.routeModel=n;else if(this[et])n=this[et];else{t.reject(`not find route model, path:${r.path??r.name}`);return}}const i=Re.from(t.session);this[gr](r,n,i).then(o=>{this[W],t.session.updateResult=o??{status:"success",message:""},t.resolve()},o=>{t.reject(o)})})}[Oe](e){if(e.length==0)return!0;let t=this[W],r=[];for(let n of e){let i=this[Et](t,n);i!=null&&r.push({...i,route:n})}if(r.length==0)return this[O]("can not find view index"),!1;for(let n of r.reverse())this[ue](t,{x:n.x,y:n.y},[n.route.index??0],!0);return!0}[Et](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[Q]&&l[st]===r)return n={x:a,y:i},n}}return null}[vr](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 f=u.length-1;f>=0;f--){let h=u[f];(!r||r.indexOf(h.index)!=-1)&&(h.route&&i[Q]&&(this[$e](h.route),h.active===!0&&h.route.opsType==q.Append&&(l=!0)),a.push(new k(i,h.index,t.y)),u.splice(f,1))}if(u.length==0)n?i.slots.value=u:e.layers[t.y].views.splice(t.x,1);else{if(l){let f=u.length-1,h=u[f];h.active=!0,h.route&&(h.route.active=h.active)}i.slots.value=u}e.layers[t.y].views.length==0&&(o=!0);let c=t.y+1;for(;c<e.layers.length;c++){let f=e.layers[c].views,h=[];for(let y=f.length-1;(o||a.length>0)&&y>=0;y--){let d=f[y];if(d[fe]&&(o||k.include(a,d[fe]))){let p=d.slots.value;for(let m=p.length-1;m>=0;m--){let v=p[m];v.route&&d[Q]&&this[$e](v.route),h.push(new k(d,v.index,c)),p.splice(m,1)}e.layers[c].views.splice(y,1)}}a=h,e.layers[c].views.length==0&&(o=!0)}}restore(e){if(!e||this[V].length==0){let t=this[W];if(t.layers.length>0){let r=t.layers[0].views;r.length>0&&(r[0].slots.value=[])}return this[b]=[],this[Ge](),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[ge].post(u=>{const c=this[Tt](l);this[$t](c),this[qt](c),this[jt](c),c.wait((f,h)=>{i=f.session.to,o=f.session.redirect,u.resolve()},(f,h)=>{i=null,h!==null&&this[O](h),u.resolve()})})}this[ge].post(a=>{if(i&&o===!0){const l=P.clone(i,!0),u=new hr(l,this[Ye]());this[F]?.replace(u)}a.resolve(),r()})})}[gr](e,t,r){const n=e.updateType??rt.Part;return this[wr](t).then(()=>{const o=this[br](t,e,r,n);if(o.status==="error")throw Error(o.message);return o})}[wr](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()}[br](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[W],a=tn(o),l=t.root??te,u;!a&&n==rt.Part&&(u=this[Et](o,t));let c,f=0;if(u==null||u==null)if(a||n===rt.All){if(o.layers.length==0&&(o.layers[0]=new Rt),o.layers[0].views.length==0){let h=t.root??te;c=new _e(h,!0,null),o.layers[0].views=[c]}else c=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 p=o.layers[y-1];for(let m of p.views){if(m[Q]&&m.name===h.rootName){d=new k(m,h.rootIndex??0,y-1);break}if(m[G]&&m[G].view.name===h.rootName&&m[G].index===h.rootIndex){d=m[G];break}}}if(!d)return{status:"error",message:"can not insert view(not find root node ref)"};c=new _e(l,!0,d),o.layers[y].views.push(c),u={x:o.layers[y].views.length-1,y}}else c=o.layers[u.y].views[u.x];if(f=u.y,c[Q]=!0,t.opsType===q.Append){t.index=t.index??le.get(),t.active=!0;let h=c.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);c.slots.value=[...h,y];let d=f+1,p=1,m=new k(c,t.index,f);this[ne](o,d,e,p,m)}else if(t.opsType===q.Open){let h=c.slots.value;const y=t.active??!0;let d=!1;for(let p of h){if(p.route!==null&&P.isSameForRouteModel(p.route,t)){if(p.active===y)return t.index=p.index,t.active=y,p.route=t,{status:"no-change",message:""};p.active=y,d=!0,t.index=p.index,t.active=y,p.route=t}else y&&(p.active=!1);p.route&&(p.route.active=p.active)}if(!d){t.index=t.index??le.get(),t.active=y;let p=new se(t,i,t.index,y);h.push(p);let m=f+1,v=1,g=new k(c,t.index,f);this[ne](o,m,e,v,g)}c.slots.value=[...h]}else{let h=c.slots.value;if(h.length==0){t.index=t.index??le.get(),t.active=!0,c.slots.value=[new se(t,i,t.index)];let y=f+1,d=1,p=new k(c,t.index,f);this[ne](o,y,e,d,p)}else{let y=h[0];if(y.model!==i){this[ue](o,u,null,!0),t.index=t.index??le.get(),t.active=!0,c.slots.value=[new se(t,i,t.index)];let d=f+1,p=1,m=new k(c,t.index,f);this[ne](o,d,e,p,m)}else{y.route!==null&&this[$e](y.route);let d=!1;const p=t.active??!0;y.active!==p&&(y.active=p,d=!0),t.active=p,t.index=y.index,y.route=t;let m=[];for(let j=1;j<h.length;j++)m.push(h[j].index);m.length>0?this[ue](o,u,m,!0):d&&(c.slots.value=[...h]);let v=[new k(c,t.index,f)],g=f+1,$=1,x=new k(c,t.index,f);for(;v.length>0&&g<o.layers.length&&$<e.layers.length;g++,$++){let j=[];for(let E=0;E<o.layers[g].views.length;E++){let C=o.layers[g].views[E];C[fe]&&k.include(v,C[fe])&&j.unshift(E)}let A=[];for(let E of j){let C=o.layers[g].views[E],z=e.layers[$].models,I;for(let N=0;N<z.length;N++)if(C.name===z[N].name){I=z[N];break}if(!I)this[ue](o,{x:E,y:g},null,!1);else{let N=C.slots.value;if(N.length==0){let Y=0;C.slots.value=[new se(null,I,Y)];let J=g+1,re=$+1;this[ne](o,J,e,re,x)}else{let Y=N[0];if(Y.model!==I){this[ue](o,{x:E,y:g},null,!0),C.slots.value=[new se(null,I,0)];let J=g+1,re=$+1;this[ne](o,J,e,re,x)}else{C[Q]&&Y.route!==null&&this[$e](Y.route);let J=[];for(let re=1;re<N.length;re++)J.push(N[re].index);J.length>0&&this[ue](o,{x:E,y:g},J,!0),A.push(new k(C,Y.index,g))}}C[Q]=!1}}v=A}this[ne](o,g,e,$,x)}}}if(c&&c[G]){let h=c[G];h&&(t.slot=new _s(l,f,h?.view.name,h?.index??0))}return r.to=void 0,r.routeModel=void 0,this[xr](t,r),{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 c=new _e(u.name,!1,i),f=new se(null,u);c.slots.value=[f],l.push(c)}}for(;o<r.layers.length;o++){let l=new Rt;l.views=[];for(let u of r.layers[o].models){let c=new _e(u.name,!1,i),f=new se(null,u);c.slots.value=[f],l.views.push(c)}e.layers.push(l)}}[qr](e,t,r,n,i,o){if(t<0||t>this[W].layers.length)return null;if(t<this[W].layers.length){let c=this[W].layers[t],f=null;for(let h of c.views){let y=!1;if(r!==null?(y=h.name===e&&h[G]?.view===r,y&&n!==-1&&(y=h[G]?.index===n)):y=h.name===e,!!y){i!==null&&(h[fe]={view:i,index:o,level:t-1}),f=h;break}}if(f!==null)return f}let a=null,l=null;i!==null&&(i[Q]?a={view:i,index:o,level:t-1}:a=i[G],l={view:i,index:o,level:t-1});let u=new _e(e,!0,a);if(u[fe]=l,t==this[W].layers.length){let c=new Rt;c.views=[u],this[W].layers.push(c)}else this[W].layers[t].views.push(u);return u}}const nn="fox-router-view",on="fox-router-link";function zr(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 Jr(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 ln(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 Gr(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 Qr(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 an(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 un(s,e=!1){let t=null;return e?t=s.beforeShow??s.beforeEnter:t=s.beforeEnter,t}function cn(s,e=!1){let t=null;return e?t=s.show??s.enter:t=s.enter,t}function fn(s,e=!1){let t=null;return e?t=s.afterShow??s.afterEnter:t=s.afterEnter,t}function hn(s,e=!1){let t=null;return e?t=s.showCancelled??s.enterCancelled:t=s.enterCancelled,t}function yn(s,e=!1){let t=null;return e?t=s.beforeHide??s.beforeLeave:t=s.beforeLeave,t}function dn(s,e=!1){let t=null;return e?t=s.hide??s.leave:t=s.leave,t}function mn(s,e=!1){let t=null;return e?t=s.afterHide??s.afterLeave:t=s.afterLeave,t}function pn(s,e=!1){let t=null;return e?t=s.hideCancelled??s.leaveCancelled:t=s.leaveCancelled,t}function Yt(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 Ee(s,e){s.classList.contains(e)||s.classList.add(e)}function Pe(s,e){s.classList.remove(e)}const vn=ye&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout;function ht(s){vn(s)}function L(s,e,t){R(e)&&(s==null&&(s={}),Reflect.apply(e,s,t))}function Xr(s,e,t,r=-1,n,i,o,a){let l=[];const u=()=>{for(let c of l)Bt(e,c.type,c.listener);l=[]};if(R(i)){if(n!==void 0&&n>=0){setTimeout(()=>{Reflect.apply(i,s,[e,t,r]),R(a)&&Reflect.apply(a,s,[])},n);return}const c=["animationend","transitionend",ot],f=h=>{const y=h.target||h.srcElement,d=h.currentTarget;y===d&&(u(),Reflect.apply(i,s,[e,t,r]))};c.forEach(h=>{it(e,h,f),l.push({type:h,listener:f})})}if(R(o)){const c="animationcancel",f=h=>{const y=h.target||h.srcElement,d=h.currentTarget;y===d&&(u(),Reflect.apply(o,s,[e,t,r]))};it(e,c,f),l.push({type:c,listener:f})}}function yt(s){return!ye||s===null?!1:s.opsType===q.Append||s.opsType===q.Open}function Yr(s,e,t,r={},n,i=-1){if(e||yt(n)){const o=zr(r,e);o&&Ee(t,o);const a=Jr(r,e);a&&Ee(t,a);const l=un(r,e);L(s,l,[t,e,n,i])}}function Zr(s,e,t,r={},n,i,o,a){if(!yt(i)&&!e){R(a)&&a(s,a,[t]);return}const l=zr(r,e),u=Jr(r,e),c=ln(r,e),f=cn(r,e),h=fn(r,e),y=hn(r,e);if(!l&&!u&&!c&&!f){R(a)&&a(s,a,[t]);return}ht(()=>{Xr(s,t,i,o,n,()=>{u&&Pe(t,u),c&&Pe(t,c),R(h)&&L(s,h,[t,e,i,o]),R(a)&&a(s,a,[t])},()=>{R(y)&&L(s,y,[t,e,i,o])}),l&&Pe(t,l),c&&Ee(t,c),R(f)&&L(s,f,[t,e,i,o])})}function es(s,e,t,r={},n,i=-1){if(e||yt(n)){const o=Gr(r,e);o&&Ee(t,o);const a=Qr(r,e);a&&Ee(t,a);const l=yn(r,e);L(s,l,[t,e,n,i])}}function ts(s,e,t,r={},n,i,o,a,l){if(!yt(o)&&!e){R(l)&&L(s,l,[t]),!e&&R(i)&&i();return}const u=Gr(r,e),c=Qr(r,e),f=an(r,e),h=dn(r,e),y=mn(r,e),d=pn(r,e);if(!u&&!c&&!f&&!h){R(l)&&L(s,l,[t]),!e&&R(i)&&i();return}ht(()=>{Xr(s,t,o,a,n,()=>{c&&Pe(t,c),f&&Pe(t,f),R(y)&&L(s,y,[t,e,o,a]),R(l)&&L(s,l,[t]),!e&&R(i)&&i()},()=>{R(d)&&L(s,d,[t,e,o,a]),R(l)&&L(s,l,[t]),!e&&R(i)&&i()}),u&&Pe(t,u),f&&Ee(t,f),R(h)&&L(s,h,[t,e,o,a])})}function Dt(s,e,t={},r,n=-1){const i=t.mode??"default",o=Yt(t);return{mode:i,persisted:!1,beforeEnter:l=>{Yr(s,!1,l,t,r,n)},enter:l=>{Zr(s,!1,l,t,o.enter,r,n)},leave:(l,u)=>{es(s,!1,l,t,r,n),ts(s,!1,l,t,o.leave,u,r,n,()=>{e.transition=null,e=null})},clone:l=>Dt(s,e,t,r,n)}}function rs(s){return s.el}function gn(s,e,t={},r,n,i,o){if(i===!0){const a=rs(e);if(a==null)return;const l=Yt(t);Yr(s,!0,a,t,r,n),Zr(s,!0,a,t,l.show,r,n,u=>{R(o)&&L(s,o,[u])})}else R(o)&&L(s,o,[])}function wn(s,e,t={},r,n,i,o){if(i===!0){const a=rs(e);if(a==null)return;const l=Yt(t);es(s,!0,a,t,r,n),ts(s,!0,a,t,l.hide,null,r,n,u=>{R(o)&&L(s,o,[u])})}else R(o)&&L(s,o,[])}function bn(s,e={}){ht(()=>{for(let t=0;t<s.length;t++)Reflect.apply(s[t],e,[])})}function ss(s,e,t={},r,n=-1){return{mode:t.mode??"default",persisted:!1,beforeEnter:a=>{Be(Lr,{},a)},enter:a=>{Be(Or,{},a)},leave:(a,l)=>{Be(Mr,{},a),ht(()=>{const u=c=>{const f=c.target||c.srcElement,h=c.currentTarget;f===h&&(Bt(a,ot,u),l&&Reflect.apply(l,s,[]),e.transition=null,e=null)};it(a,ot,u),Be(Ir,{},a)})},clone:a=>ss(s,t,r,n)}}function ie(s,e,t){return typeof s=="function"?Reflect.apply(s,{},[e,t]):s}function Lt(s,e){if(!s)return null;const t=s(e);return t.length===1?t[0]:t}function we(s,e){return typeof e=="function"?e(s):s}class xn{node;state;constructor(e,t){this.node=e,this.state=t}}const Ut=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(ft,null),i=w.inject(wt,0),o=w.inject(cr,null),a=w.inject(bt,-1);let l=null,u=s.modelSlot;if(u){if(w.provide(wt,i+1),w.provide(bt,u.index),w.provide(xt,u.index),!u.route){console.warn("child view render error, route not exist");return}const h=lt(t.proxy,!0);Ls(h),ur(h,()=>u?.route??null)}else{if(n==null){console.error("router is not been injected");return}const f=s.name,h=w.inject(fr,null),y=w.inject(xt,0);if(l=n[qr](f,i,o,a,h,y),l===null)return;w.provide(fr,l);const d=l[Q]===!0;if(d&&w.provide(cr,l),!r&&(w.provide(bt,-1),w.provide(wt,i+1),w.provide(xt,-1),d)){const p=lt(t.proxy,!0);ur(p,()=>{const m=l.slots.value;return m.length>0?m[0].route:null})}}const c={value:new Map};return w.onUnmounted(()=>{if(c.value&&c.value.clear(),u){const f=u;f.route=null,f.model=null,f.instance=null,u=void 0}}),()=>{if(r){const f=new Map,h=[],y=l?.slots.value,d=[];for(let v=0;v<y.length;v++){const g=y[v],$=`${s.name}_${g.index}`,x=ie(s.transition,g.route,v)??!0,j={modelSlot:g};let A;e.slots.default?A=w.h(Ut,j,{default:e.slots.default}):A=w.h(Ut,j);const E={},C=ie(s.viewClass,g.route,v);typeof C=="string"&&C.length>0&&(E[C]=!0);const z=ie(s.viewActiveClass,g.route,v),I=ie(s.viewInactiveClass,g.route,v),N=c.value.get($);if(typeof z=="string"&&z.length>0&&(E[z]=g.active),typeof I=="string"&&I.length>0&&(E[I]=!g.active),N&&g.active!==N.state){const U=N.node;g.active?d.unshift(()=>{const dt=()=>{let Ce=lr(U);Ce!=null&&ar(Ce,Ht.ACTIVATED)};gn(t,U,s,g.route,v,x,dt)}):d.push(()=>{const dt=()=>{const Ce=lr(U);Ce!=null&&ar(Ce,Ht.DEACTIVATED)};wn(t,U,s,g.route,v,x,dt)})}const Y={class:E,key:$},J=ie(s.viewTagProps,g.route,v);if(J!==null&&typeof J=="object"){const U=we(J,n?.propsFilter);T(!0,Y,U)}if(g.route?.viewTagAttrs&&typeof g.route?.viewTagAttrs=="object"){const U=we(g.route.viewTagAttrs,n?.propsFilter);T(!0,Y,U)}const re=ie(s.viewTag,g.route,v),me=w.h(re,Y,{default:()=>[A]});if(f.set($,new xn(me,g.active)),c.value.delete($),x===!0){const U=Dt(t,me,s,g.route,v);me.transition=U}else if(x==="custom"){const U=ss(t,me,s,g.route,v);me.transition=U}h.push(me)}c.value=f,bn(d,t);const p=ie(s.tag,null,-1),m={};return Object.assign(m,e.attrs),w.h(p,m,{default:()=>h})}else if(u!=null){const f=u.model,h={};if(f.props){if(typeof f.props=="object"){const d=we(f.props,n?.propsFilter);T(!1,h,d)}else if(f.props===!0&&typeof u.route?.params=="object"){const d=we(u.route.params,n?.propsFilter);T(!1,h,d)}}const y=w.h(f.component,h);return Lt(e.slots.default,{Component:y,route:u.route})??y}else{const f=l.slots.value;if(f.length>0){const h=f[0],y=h.route??(t.proxy&&Qt(t.proxy))??null,d=h.model,p={};if(d.props){if(typeof d.props=="object"){const g=we(d.props,n?.propsFilter);T(!1,p,g)}else if(d.props===!0&&typeof y?.params=="object"){const g=we(y.params,n?.propsFilter);T(!1,p,g)}}const m=w.h(d.component,p);if(ie(s.transition,y,-1)??!0){const g=Dt(t,m,s,y,-1);m.transition=g}return Lt(e.slots.default,{Component:m,route:y})??m}else return Lt(e.slots.fallback,{})}}}});function Rn(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 Sn(s,e){return s==null||e==null?!1:!!(s===e||s.path&&s.path===e.path||s.name&&s.name===e.name)}function Pn(s,e){return s==null||e==null?!1:!!(s.path&&e.path&&e.path.startsWith(s.path)||s.name&&s.name==e.name)}function be(s,e){return typeof s=="function"?Reflect.apply(s,{},[e]):s}let En=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(ft,null);return()=>{let r=be(s.to,null),n=be(s.tag,r);if(n==null){console.warn("can not resolve link tag");return}let i=null,o=null;t!==null&&(i=t[D](r),s.root&&(i.root=s.root),o=t.current);let a={},l=be(s.activeClass,i);if(typeof l=="string"&&l.length>0&&(a[l]=Pn(i,o)),be(s.exact,i)===!0){let h=be(s.exactActiveClass,i);typeof h=="string"&&h.length>0&&(a[h]=Sn(i,o))}let c={class:a};(n==="a"||n==="A")&&(c.href=i?.path??i?.name??"#"),T(!0,c,e.attrs);let f=be(s.event,i);if(typeof f=="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}Rn(y)&&t.to(i)};c[f]=h}return w.h(n,c,e.slots)}}});var M=(s=>(s[s.Loading=0]="Loading",s[s.Loaded=1]="Loaded",s[s.Defining=2]="Defining",s[s.Defined=3]="Defined",s))(M||{}),nt=(s=>(s[s.normal=0]="normal",s[s.factory=1]="factory",s))(nt||{});class Cn{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 Pr{moduleManager=new Cn;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 Ue().head}constructor(){}setModule(e,t){const r={id:e,src:"",status:M.Defined};typeof t=="function"?(r.exports=t,r.type=nt.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 c=0;c<u.length;c++)u[c]&&t.push(this.resolvePath(u[c]))}else if(typeof e[l]=="string"){let u=e[l].split(",");for(let c=0;c<u.length;c++)u[c]&&t.push(this.resolvePath(u[c]))}const o=new Fn(t.length,(l,u)=>{if(o.isOK())try{typeof i=="function"&&Reflect.apply(i,{},u)}catch(c){console.error(c.message,c)}else try{console.error(l),typeof i=="function"&&Reflect.apply(i,{},[])}catch(c){console.error(c.message,c)}}),a=new He;for(let l=0;l<t.length;l++){const u=new An(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==M.Defined||o.status==M.Loaded)&&o.exports){o.type===nt.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=Ue(),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(f){console.error(f.message,f)}l.onload=null,l.onerror=null,t.progress.work(!1,t.index,null),n.reject()};else{const f={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(()=>{ns(l,f)},1)}let c=a.getElementById(i);c&&c.parentNode&&c.parentNode.removeChild(c),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==M.Defined||o.status==M.Loaded)){if(o.exports){o.type===nt.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:M.Loading},this.moduleManager.set(i,o);const l=Ue().createElement("script");if("onload"in l)l.onload=()=>{l.onload=null,l.onerror=null,o.status===M.Loading&&(o.status=M.Loaded,t.progress.work(!0,t.index,i)),n.resolve()},l.onerror=()=>{try{r.removeChild(l)}catch(f){console.error(f.message,f)}l.onload=null,l.onerror=null,this.moduleManager.remove(i),t.progress.work(!1,t.index,null),n.resolve()};else{const f=l;f.onreadystatechange=()=>{/loaded|complete/.test(f.readyState)&&(f.onreadystatechange=null,o.status==M.Loading&&(o.status=M.Loaded,t.progress.work(!0,t.index,i)),n.resolve())}}l.defer=!0,l.src=i;const c=K();c.define=this.createDefine(o,t),r.appendChild(l)})}unmount(e,t={}){const r=Ue(),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=M.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,(...c)=>{const f=c.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,f);h&&typeof h=="object"&&(e.exports=h)}else e.exports=l;e.status=M.Defined,t.progress.work(!0,t.index,e.exports)}):(typeof l=="function"?e.exports=Reflect.apply(l,e,[]):e.exports=l,e.status=M.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`${mt()}${e.slice(1)}`;if(e.indexOf("./")==0)return`${mt()}${e.slice(2)}`;if(e.indexOf("//")==0)return`${K().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`${mt()}${e}`}}function ns(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():ns(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 An{index;src;params;progress;constructor(e,t,r,n){this.index=e,this.src=t,this.params=r,this.progress=n}}const Zt=Symbol("fk"),er=Symbol("fbk"),tr=Symbol("fepk");function _n(s={}){const e=new sn(s),t=new It,r=new Nt,n=new Pr,i={get router(){return e},get bus(){return t},get Bus(){return It},get EventProxy(){return Nt},get eventproxy(){return r},get EventChain(){return He},get Require(){return Pr},get require(){return n},get extend(){return T},get clone(){return ct},get isESModule(){return kt},install(o){o.provide(ft,e),o.provide(Zt,i),o.provide(er,t),o.provide(tr,r),o.component(nn,Ut),o.component(on,En),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 Qt(this)}}}),e.init()}};return i}function rr(s){return s?s.$router:w.inject(ft)}function Kn(s){return s||(s=w.getCurrentInstance()?.proxy??void 0),s?Qt(s):null}function Tn(s){return s?s.$fox:w.inject(Zt)}function $n(s){return s?s.$bus:w.inject(er)}function jn(s){return s?s.$eventProxy:w.inject(tr)}function qn(s){const e=rr(),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 Ln(s){const e=rr(),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=It;exports.EventChain=He;exports.EventProxy=Nt;exports.FoxBeforeEnter=Lr;exports.FoxBeforeLeave=Mr;exports.FoxEnter=Or;exports.FoxLeave=Ir;exports.FoxLeaveEnd=ot;exports.OperationType=q;exports.Route=P;exports.clone=ct;exports.createFox=_n;exports.createMemoryHistory=Wr;exports.createWebHashHistory=Vr;exports.createWebHistory=Zs;exports.deleteContextValue=qs;exports.extend=T;exports.foxBusKey=er;exports.foxEventProxyKey=tr;exports.foxKey=Zt;exports.injectContextValue=Gt;exports.isArray=os;exports.isDate=us;exports.isESModule=kt;exports.isEqual=Mt;exports.isFunction=R;exports.isMap=ls;exports.isNil=De;exports.isObject=Er;exports.isPlainObject=Cr;exports.isPromise=hs;exports.isSet=as;exports.isString=cs;exports.isSymbol=fs;exports.onAfterRouteUpdate=Ln;exports.onBeforeRouteUpdate=qn;exports.onFoxActivated=Ns;exports.onFoxInactivated=Hs;exports.provideContextValue=js;exports.rawState=Fs;exports.reactiveState=Ps;exports.sessionKey=oe;exports.shallowReactiveState=Es;exports.toBoolean=Vt;exports.toNumber=ps;exports.toTypeString=ut;exports.typeOf=Ot;exports.useBus=$n;exports.useEventProxy=jn;exports.useFox=Tn;exports.useRoute=Kn;exports.useRouter=rr;
|
|
2
|
+
* fox v3.1.0 Tue Oct 08 2024 15:04:13 GMT+0800 (中国标准时间)
|
|
3
|
+
*/Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("vue"),he=typeof window<"u",$=function(){return window},Ve=function(){return window.document};function hr(r){let e=r,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 wt(){if(!he)return"/";let r=$().location,e=`${r.protocol}//${r.host}`;return e+=hr(r.pathname),e}function at(r,e,t,s=!1){r.addEventListener?r.addEventListener(e,t,s):r.attachEvent?r.attachEvent(`on${e}`,t):r[`on${e}`]=t}function zt(r,e,t){r.removeEventListener?r.removeEventListener(e,t):r.detachEvent?r.detachEvent(`on${e}`,t):r[`on${e}`]=null}const Je=(r,e,t)=>{e=e??{bubbles:!1,cancelable:!1,detail:void 0};const s=document.createEvent("Events");let n=!0,i=!0;for(let a in e)a==="bubbles"?n=!!e[a]:a==="cancelable"?i=!!e[a]:s[a]=e[a];s.initEvent(r,n,i),(t??document).dispatchEvent(s)},yr=Array.isArray,dr=r=>ht(r)==="[object Map]",pr=r=>ht(r)==="[object Set]",mr=r=>r instanceof Date,x=r=>typeof r=="function",gr=r=>typeof r=="string",vr=r=>typeof r=="symbol",_s=r=>r!==null&&typeof r=="object",wr=r=>_s(r)&&x(r.then)&&x(r.catch),Ue=r=>r==null,br=Object.prototype.toString,ht=r=>br.call(r),Ks=r=>ht(r)==="[object Object]",xr=typeof Symbol=="function"&&typeof Symbol.toStringTag=="symbol";function Gt(r){return r.__esModule||xr&&r[Symbol.toStringTag]==="Module"}const Rr=typeof Promise<"u"&&Promise.toString().indexOf("[native code]")!==-1;function F(...r){let e=r[0]!==void 0&&r[0]!==null?r[0]:{},t=1,s=r.length,n=!1;for(typeof e=="boolean"&&(n=e,e=r[t]??{},t++),typeof e!="object"&&(e={});t<s;t++)if(r[t]!==null&&r[t]!==void 0){let i=r[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]=F(n,u,l)}else l!==void 0&&(e[o]=l)}}return e}function yt(r,e,t=!1){if(!t)F(!0,r,e);else{if(typeof e!="object")return{};typeof r!="object"&&(r={});for(let s of Reflect.ownKeys(e)){let n=r[s],i=e[s];if(n!==i)if(typeof i=="object"){if(!Array.isArray(i)&&!Ks(i))continue;n=yt(n,i,t),r[s]=n}else{if(typeof i=="function")continue;r[s]=i}}}return r}class ie{static seed=new Date().getTime();static get(){let e=++ie.seed;return e>=Number.MAX_VALUE&&(ie.seed=0),e}}const bt=Rr?Promise.resolve():null;function Ie(r,...e){bt!==null?e&&e.length>0?bt.then(()=>{r(e)}):bt.then(r):e&&e.length>0?setTimeout(()=>{r(e)}):setTimeout(r)}function Xt(r){return r==null?!1:typeof r=="boolean"?r:typeof r=="string"?r.toLocaleLowerCase()==="true":!!r}function Sr(r){return typeof r=="number"?r:Number(r)}const Pr={"[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 Dt(r){let t=Object.prototype.toString.call(r);return r==null?String(r):Pr[t]||"object"}function Ht(r,e){if(r==e)return!0;if(r===void 0||e===void 0)return!1;let t=Dt(r),s=Dt(e);if(t!==s)return!1;if(t==="object"){let n=Object.keys(r),i=Object.keys(e);if(n.length!==i.length)return!1;for(let o=0;o<n.length;o++){let a=n[o],l=r[a],u=e[a];if(!Ht(l,u))return!1}return!0}else if(t==="array"){if(r.length!==e.length)return!1;for(let n=0;n<r.length;n++){let i=r[n],o=e[n];if(!Ht(i,o))return!1}return!0}return!1}const js=r=>{const e={};for(let t of Reflect.ownKeys(r)){let s=r[t];s&&!Array.isArray(s)&&typeof s=="object"&&(s=js(s)),typeof t=="symbol"?e[String(t)]=s:e[t]=s}return e},Cr=/^Symbol\((.*)\)$/,qs=r=>{const e={};for(let t of Reflect.ownKeys(r)){let s=r[t];s&&!Array.isArray(s)&&typeof s=="object"&&(s=qs(s));const n=Cr.exec(t);if(n&&n[1]){const i=Symbol.for(n[1]);e[i]=s}else e[t]=s}return e};function Ls(r,e){let t=null;return function(...s){t&&clearTimeout(t),t=setTimeout(()=>{t=null,Reflect.apply(r,null,[...s])},e)}}const us=Symbol("idKey"),ye=Symbol("valueKey"),R=Symbol("childrenKey"),J=Symbol("growKey");class ks{[J]=!0;[us];[ye]=g.ref();[R]=new Map;constructor(e){this[us]=e}}class Er{get(e,t){if(t=="value")return e[ye].value;if(t==="grow")return e[J];let s=e[R].get(t);if(s)return De(s);if(e[J])return s=Yt(t),s[J]=e[J],e[R].set(t,s),De(s)}set(e,t,s){return t=="value"?(e[ye].value=s,!0):t==="grow"?(e[J]=Xt(s),!0):s==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 Qt="__proxy__";function Yt(r){const e=new ks(r);return Reflect.set(e,Qt,new Proxy(e,new Er)),e}function De(r){return Reflect.get(r,Qt)}let $r=class{name="";persistPolicy="memory";storage;initFlag=!1;state={};constructor(e={},t){if(e.persistPolicy&&e.persistPolicy!=="memory"&&Ue(e.name))throw new Error("name can not be empty, where persistPolicy is not memory.");this.name=e.name??"",this.persistPolicy=e.persistPolicy??"memory",this.storage=e.storage,t&&typeof t=="object"&&Object.assign(this.state,t)}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(he){const t=$();e=this.persistPolicy==="session"?t.sessionStorage:t.localStorage}return e}saveState(){if(!this.persistPolicy||this.persistPolicy==="memory")return;let e=this.getStorage();if(e===null||!this.state)return;const t=`_bus_${this.name}`,s=JSON.stringify(this.state??{});e.setItem(t,s)}removeState(){if(!this.persistPolicy||this.persistPolicy==="memory")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==="memory")return;let t=this.getStorage();if(t===null)return;const s=`_bus_${this.name}`,n=t.getItem(s);if(n){const i=JSON.parse(n);Object.assign(this.state,i),Reflect.ownKeys(this.state).forEach(a=>{if(typeof a!="string")return;const l=this.state[a],u=a.split(/\//g);u.push(l),Reflect.apply(e.put,e,u)})}}put(e){if(this.initFlag&&this.persistPolicy!=="memory")try{const t=e.length,s=e.slice(0,t-1).join("/"),n=e[t-1];this.state[s]=n,this.saveState()}catch(t){console.error(t)}}remove(e){if(this.initFlag&&this.persistPolicy!=="memory")try{const t=e.length,s=e.slice(0,t-1).join("/"),n={};Reflect.ownKeys(this.state).forEach(o=>{typeof o=="string"&&(o===s||o.startsWith(s)||(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 Os extends ks{_persistHandler;constructor(e={},t){super("__root__"),this._persistHandler=new $r(e,t),this._persistHandler.init(this)}put(...e){let t=e.length;if(t<2)return console.error("参数至少包括一个(key, value)"),!1;let s=this;for(let n=0;n<t-1;n++){let i=e[n],o;s[R].has(i)?o=s[R].get(i):(o=Yt(i),s[R].set(i,o)),s=o}return s[ye].value=e[t-1],this._persistHandler.put(e),!0}get(...e){let t=e.length;if(t===0)return;let s=this;for(let n=0;n<t;n++){let i=e[n];if(s[R].has(i))s=s[R].get(i);else return}return s[ye].value}remove(...e){let t=e.length;if(t==0)return!1;let s=this;for(let i=0;i<t-1;i++){const o=e[i];if(s[R].has(o))s=s[R].get(o);else return!1}const n=e[t-1];return s[R].has(n)?(s[R].delete(n),this._persistHandler.remove(e),!0):!1}contains(...e){const t=e.length;if(t==0)return!1;let s=this;for(let i=0;i<t-1;i++){let o=e[i];if(s[R].has(o))s=s[R].get(o);else return!1}const n=e[t-1];return s[R].has(n)}clear(){this[R].clear(),this._persistHandler.clear()}}const Fr=["put","get","contains","remove","clear","_persistHandler"];function cs(r){return Fr.includes(r)}class Ar{get(e,t){if(t=="value")return e[ye].value;if(t==="grow")return e[J];if(t===R)return e[R];if(typeof t=="string"&&cs(t))return e[t];const s=String(t);let n=e[R].get(s);if(n)return De(n);if(e[J])return n=Yt(s),n[J]=e[J],e[R].set(s,n),De(n)}set(e,t,s){return t=="value"?(e[ye].value=s,!0):t==="grow"?(e[J]=Xt(s),!0):cs(t)?!1:s==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 Tr(r,e){const t=new Os(r,e),s=new Ar,n=new Proxy(t,s);return Reflect.set(t,Qt,n),t}const Ut=new Proxy(Os,{construct(r,e){const t=e[0]??{},s=e[1],n=Tr(t,s);return De(n)}}),Zt=r=>!r||typeof r!="object"?!0:Reflect.ownKeys(r).length===0;class Ms{name="";persistPolicy="memory";storage;constructor(e={}){if(e.persistPolicy&&e.persistPolicy!=="memory"&&Ue(e.name))throw new Error("name can not be empty, where persistPolicy is not memory.");this.name=e.name??"",this.persistPolicy=e.persistPolicy??"memory",this.storage=e.storage}getStorage(){if(!this.persistPolicy)return null;let e=null;if(this.persistPolicy==="custom")e=this.storage;else if(he){const t=$();e=this.persistPolicy==="session"?t.sessionStorage:t.localStorage}return e}saveState(e){if(!this.persistPolicy||this.persistPolicy==="memory")return;let t=this.getStorage();if(t===null||Zt(e))return;const s=`_state_${this.name}`,n=JSON.stringify(e??{});t.setItem(s,n)}removeState(){if(!this.persistPolicy||this.persistPolicy==="memory")return;let e=this.getStorage();if(e===null)return;const t=`_state_${this.name}`;e.removeItem(t)}restore(e){if(!this.persistPolicy||this.persistPolicy==="memory")return;let t=this.getStorage();if(t===null)return;const s=`_state_${this.name}`,n=t.getItem(s);if(n){const i=JSON.parse(n);Object.assign(e,i)}}}function Is(r,e,t){const s=new Ms(t);s.restore(e);const n=l=>{const u=g.toRaw(l),c={};for(let f in u){const h=u[f];Ue(h)||(c[f]=h)}Zt(c)?s.removeState():s.saveState(c)};let i=null;if(t&&t.debounce===!1)i=n;else{const l=t&&t.debounceDelay?t.debounceDelay:250;i=Ls(n,l)}const o=r?g.shallowReactive(e):g.reactive(e);return g.effectScope(!0).run(()=>{g.watch(o,l=>{const u=g.toRaw(l);i(u)})}),o}function _r(r,e){return Is(!1,r,e)}function Kr(r,e){return Is(!0,r,e)}function jr(r,e){const t=new Ms(e);t.restore(r);const s=a=>{const l=g.toRaw(a),u={};for(let c in l){const f=l[c];Ue(f)||(u[c]=f)}Zt(u)?t.removeState():t.saveState(u)};let n=null;if(e&&e.debounce===!1)n=s;else{const a=e&&e.debounceDelay?e.debounceDelay:250;n=Ls(s,a)}const i={get(a,l){return a[l]},set(a,l,u){return a[l]=u,n(a),!0}};return new Proxy(r,i)}function qr(r,e){return jr(r,e)}const X="default",Ns=Symbol("sync"),O=Symbol("resolveRoute");function fs(r){let e=!1;return function(...t){if(!e)return e=!0,Reflect.apply(r,{},t)}}function Lr(r){let e=r.src;return new Promise((t,s)=>{const n=fs(a=>{Gt(a)&&(a=a.default),r.component=a,console.debug("success load async module"),t()}),i=fs(a=>{console.debug("reject load async module"),s(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 kr{name;level;rootName;rootIndex=0;constructor(e,t,s,n){this.name=e,this.level=t,this.rootName=s,this.rootIndex=n}}class Re{to;routeModel;from;data={};constructor(e,t){this.to=e,this.from=t}static from(e){const t=new Re(e.to,e.from),s=e.data??{};return F(!0,t.data,s),t}static clear(e){for(let t in e)e[t]=void 0}}class S{path;get fullPath(){const e=this.path??`/${this.name}`;return`${this.root??X}!${e}`}alias;name;root;params;query;traceless;template;matched;meta;success;error;destroy;opsType;updateType;historyUpdatePolicy;viewTagAttrs;index;active;slot;static clone(e,t){let s=new S;return yt(s,e,t),s}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 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 s=t;for(let i in e){let o=e[i];s[i]=o}const n=Object.getOwnPropertySymbols(e);if(Array.isArray(n)&&n.length>0)for(let i of n)s[i]=e[i];return t}}class Or{id;name;props;meta;src;component;constructor(e,t,s,n){this.id=ie.get(),this.name=e,this.src=t,typeof t!="function"&&(this.component=t),this.props=s,this.meta=n}get isResolved(){return this.component!==void 0}resolve(){return Lr(this)}}class hs{models=[]}class xt{path;match;redirect;name;layers=[]}var E=(r=>(r[r.Push=0]="Push",r[r.Replace=1]="Replace",r[r.Put=2]="Put",r[r.Append=3]="Append",r[r.Open=4]="Open",r))(E||{});const Ds="FoxBeforeEnter",Hs="FoxEnter",Us="FoxLeave",Bs="FoxLeave",ut="FoxLeaveEnd",I=Symbol("chainKey"),k=Symbol("cursorKey"),Rt=Symbol("$persistentModeKey"),C=Symbol("statusKey"),z=Symbol("argsKey"),We=Symbol("exArgsKey"),ge=Symbol("successFnsKey"),Fe=Symbol("errorFnsKey"),ne=Symbol("sessionKey"),G=Symbol("_go");class He{[I]=[];[k]=0;[Rt]=!1;[C]="Free";[z]=[];[We]=[];[ge]=[];[Fe]=[];[ne];get session(){return this[ne]}constructor(e,t=!1){this[ne]=e,this[Rt]=t}[G](e,...t){let s=this[C];if(this[C]="Busy",this[k]+=e,this[k]<0&&(this[k]=0),this[z]=t,s==="Exception"||s==="Reject"){let a=[{session:this[ne]},...this[We]];for(;this[Fe].length>0;)try{let l=this[Fe].shift();typeof l=="function"&&Ie(()=>{Reflect.apply(l,{},a)})}catch(l){console.error(l.message,l)}return this[C]=s,this[I]=[],this[k]=0,this}else if(s==="Finished"||this[k]>=this[I].length){let a=[{session:this[ne]},...this[z]];for(;this[ge].length>0;){let l=this[ge].shift();typeof l=="function"&&Ie(()=>{Reflect.apply(l,{},a)})}return this[C]="Free",this}if(this[k]>=this[I].length)return this[C]="Free",this;let n=this[I][this[k]];this[Rt]||(this[I].splice(0,this[k]+1),this[k]=-1);let i=this[k]+1;try{let o=!1,a={go:(l,...u)=>{o||(o=!0,Reflect.apply(this[G],this,[l,...u]))},resolve:(...l)=>{o||(o=!0,Reflect.apply(this[G],this,[1,...l]))},reject:(...l)=>{o||(o=!0,Reflect.apply(this.reject,this,[...l]))},insert:l=>{o||(this[I].splice(i,0,l),i++)},session:this[ne]};Ie(()=>{Reflect.apply(n,{},[a,...this[z]])})}catch(o){this.throw(o)}return this}go(e,...t){return Reflect.apply(this[G],this,[e,...t])}finish(...e){return this[C]="Finished",this[z]=e,Reflect.apply(this[G],this,[0])}reject(...e){return this[C]="Reject",this[We]=e,Reflect.apply(this[G],this,[0])}throw(...e){return this[C]="Exception",this[We]=e,Reflect.apply(this[G],this,[0])}reset(...e){this[C]="Busy",this[z]=e,this[I]=[],this[k]=0;let s=[{session:this[ne]},...this[z]];for(;this[ge].length>0;){let n=this[ge].shift();Ie(()=>{Reflect.apply(n,this,s)})}return this[C]="Free",this}post(e){return this[C]==="Reject"||this[C]==="Exception"?this:(Array.isArray(e)?this[I]=[...this[I],...e]:this[I].push(e),this[C]==="Busy"?this:(Reflect.apply(this[G],this,[0,...this[z]]),this))}wait(e,t){return e&&typeof e=="function"&&this[ge].push(e),t&&typeof t=="function"&&this[Fe].push(t),this[C]==="Busy"?this:(Reflect.apply(this[G],this,[0,...this[z]]),this)}exception(e){return e&&typeof e=="function"&&this[Fe].push(e),this[C]==="Busy"?this:Reflect.apply(this[G],this,[0,...this[z]])}isFinish(){return this[C]=="Reject"||this[C]=="Free"&&this[k]>=this[I].length}}const ve=Symbol("registerKey");class Mr{policy;callback;constructor(e,t){this.callback=e,this.policy=t}}class Bt{[ve]=new Map;constructor(){}on(e,t,s=!1){let n=this[ve].get(e);n||(n=new Array,this[ve].set(e,n));let i=s===!0?1:0,o=new Mr(t,i);return n.push(o),this}off(e,t){if(!t)return this[ve].delete(e),this;let s=this[ve].get(e);if(s){for(let n=0;n<s.length;n++)if(s[n].callback===t){s.splice(n,1);break}}return this}bind(e,t,s=!1){return this.on(e,t,s)}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 s=e[t-1];if(typeof s!="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(s,{},i)});return this}emit(e,...t){let s=this[ve].get(e);if(!s)return this;for(let n=0;n<s.length;){let i=s[n];if(i.policy==1?s.splice(n,1):n++,typeof i.callback=="function")try{Ie(()=>{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 Ir{[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 fe=Symbol("lc");function ct(r,e=!1){let t=r;if(Reflect.has(t,fe))return t[fe];if(e){const s=new Ir;return t[fe]=s,s}return null}function Vs(r,e=!1){let t=null,s=r;for(;s&&!(Reflect.has(s,fe)&&(t=s[fe],t));)s=s.$parent;if(!t&&e){const n=r;n&&n.$parent&&(t=ct(n.$parent,e))}return t}function es(r,e){let t=r;for(;t;){if(Reflect.has(t,fe)){const s=t[fe];if(s.has(e))return s.get(e)}t=t.$parent}return null}function Nr(r,e,t){Vs(r,!0)?.set(e,t)}function Dr(r,e){Vs(r,!0)?.delete(e)}function ys(r){if(Array.isArray(r.children)&&r.children.length>0){let e=r.children[0];if(e!=null&&e.component!=null&&e.component.proxy!=null)return ct(e.component.proxy,!1)}return null}const ft=Symbol("hooksKey");function Hr(r){let e=r.get(ft);e||(e=[],r.set(ft,e))}function ds(r,e){let t=r.get(ft);if(t!=null)for(let s=t.length-1;s>=0;s--){let n=t[s];if(n.type===e)try{Reflect.apply(n.hook,n.target,[])}catch(i){console.error(i.message,i)}}}var Vt=(r=>(r.DEACTIVATED="da",r.ACTIVATED="a",r))(Vt||{});class Ur{type;hook;target;constructor(e,t,s){this.target=s,this.hook=t,this.type=e}}function Br(r,e,t,s){let n=new Ur(e,t,s);return r.push(n),!0}function Vr(r,e,t,s){let n=-1;for(let i=0;i<r.length;i++){let o=r[i];if(o.type===e&&o.hook===t&&o.target===s){n=i;break}}return n!=-1?(r.splice(n,1),!0):!1}function Js(r){return(e,t)=>{let s;if(t)s=t;else{const i=g.getCurrentInstance();if(i==null||i.proxy==null){console.error("can not get current instance or proxy");return}s=i.proxy}const n=es(s,ft);if(n==null){console.warn("hooks context not found");return}g.onUnmounted(()=>{Vr(n,r,e,s)}),Br(n,r,e,s)}}const Jr=Js("a"),Wr=Js("da"),Ws=Symbol("routeKey");function ps(r,e){r.set(Ws,e)}function ts(r){let e=es(r,Ws);return typeof e=="function"?e():e??null}const dt=Symbol("rk"),St=Symbol("vd"),ms=Symbol("rv"),Pt=Symbol("rvi"),gs=Symbol("pv"),Ct=Symbol("pvi");var de={};Object.defineProperty(de,"__esModule",{value:!0});de.TokenData=void 0;de.parse=pt;var zr=de.compile=tn,Gr=de.match=nn;de.pathToRegexp=an;const Xr="/",ss=r=>r,Qr=/^\p{XID_Continue}$/u,Ne="https://git.new/pathToRegexpError",Yr={"!":"!","@":"@",";":";",",":",","*":"*","+":"+","?":"?","{":"{","}":"}"};function Zr(r){const e=[...r],t=[];let s=0;for(;s<e.length;){const n=e[s],i=Yr[n];if(i){t.push({type:i,index:s++,value:n});continue}if(n==="\\"){t.push({type:"ESCAPED",index:s++,value:e[s++]});continue}if(n===":"){let o="";for(;Qr.test(e[++s]);)o+=e[s];if(!o)throw new TypeError(`Missing parameter name at ${s}`);t.push({type:"NAME",index:s,value:o});continue}if(n==="("){const o=s++;let a=1,l="";if(e[s]==="?")throw new TypeError(`Pattern cannot start with "?" at ${s}`);for(;s<e.length;){if(e[s]==="\\"){l+=e[s++]+e[s++];continue}if(e[s]===")"){if(a--,a===0){s++;break}}else if(e[s]==="("&&(a++,e[s+1]!=="?"))throw new TypeError(`Capturing groups are not allowed at ${s}`);l+=e[s++]}if(a)throw new TypeError(`Unbalanced pattern at ${o}`);if(!l)throw new TypeError(`Missing pattern at ${o}`);t.push({type:"PATTERN",index:s,value:l});continue}t.push({type:"CHAR",index:s,value:e[s++]})}return t.push({type:"END",index:s,value:""}),new en(t)}class en{constructor(e){this.tokens=e,this.index=0}peek(){return this.tokens[this.index]}tryConsume(e){const t=this.peek();if(t.type===e)return this.index++,t.value}consume(e){const t=this.tryConsume(e);if(t!==void 0)return t;const{type:s,index:n}=this.peek();throw new TypeError(`Unexpected ${s} at ${n}, expected ${e}: ${Ne}`)}text(){let e="",t;for(;t=this.tryConsume("CHAR")||this.tryConsume("ESCAPED");)e+=t;return e}modifier(){return this.tryConsume("?")||this.tryConsume("*")||this.tryConsume("+")}}class Be{constructor(e,t){this.tokens=e,this.delimiter=t}}de.TokenData=Be;function pt(r,e={}){const{encodePath:t=ss,delimiter:s=t(Xr)}=e,n=[],i=Zr(r);let o=0;do{const a=i.text();a&&n.push(t(a));const l=i.tryConsume("NAME"),u=i.tryConsume("PATTERN");if(l||u){n.push({name:l||String(o++),pattern:u});const h=i.peek();if(h.type==="*")throw new TypeError(`Unexpected * at ${h.index}, you probably want \`/*\` or \`{/:foo}*\`: ${Ne}`);continue}if(i.tryConsume("*")){n.push({name:String(o++),pattern:`(?:(?!${Ce(s)}).)*`,modifier:"*",separator:s});continue}if(i.tryConsume("{")){const h=i.text(),y=i.tryConsume("NAME"),d=i.tryConsume("PATTERN"),p=i.text(),m=i.tryConsume(";")&&i.text();i.consume("}");const w=i.modifier();n.push({name:y||(d?String(o++):""),prefix:t(h),suffix:t(p),pattern:d,modifier:w,separator:m});continue}i.consume("END");break}while(!0);return new Be(n,s)}function tn(r,e={}){const t=r instanceof Be?r:pt(r,e);return rn(t,e)}function sn(r,e){if(typeof r=="string")return()=>r;const t=e||ss,s=r.modifier==="+"||r.modifier==="*",n=r.modifier==="?"||r.modifier==="*",{prefix:i="",suffix:o="",separator:a=o+i}=r;if(e&&s){const u=(f,h)=>{if(typeof f!="string")throw new TypeError(`Expected "${r.name}/${h}" to be a string`);return t(f)},c=f=>{if(!Array.isArray(f))throw new TypeError(`Expected "${r.name}" to be an array`);return f.length===0?"":i+f.map(u).join(a)+o};return n?f=>{const h=f[r.name];return h==null?"":h.length?c(h):""}:f=>{const h=f[r.name];return c(h)}}const l=u=>{if(typeof u!="string")throw new TypeError(`Expected "${r.name}" to be a string`);return i+t(u)+o};return n?u=>{const c=u[r.name];return c==null?"":l(c)}:u=>{const c=u[r.name];return l(c)}}function rn(r,e){const{encode:t=encodeURIComponent,loose:s=!0,validate:n=!0,strict:i=!1}=e,o=zs(e),a=rs(s,r.delimiter),l=Xs(r,a,[],o,i),u=r.tokens.map((c,f)=>{const h=sn(c,t);if(!n||typeof c=="string")return h;const y=new RegExp(`^${l[f]}$`,o);return d=>{const p=h(d);if(!y.test(p))throw new TypeError(`Invalid value for "${c.name}": ${JSON.stringify(p)}`);return p}});return function(f={}){let h="";for(const y of u)h+=y(f);return h}}function nn(r,e={}){const{decode:t=decodeURIComponent,loose:s=!0}=e,n=r instanceof Be?r:pt(r,e),i=rs(s,n.delimiter),o=[],a=Gs(n,o,e),l=o.map(u=>{if(t&&(u.modifier==="+"||u.modifier==="*")){const{prefix:c="",suffix:f="",separator:h=f+c}=u,y=new RegExp(i(h),"g");return d=>d.split(y).map(t)}return t||ss});return function(c){const f=a.exec(c);if(!f)return!1;const{0:h,index:y}=f,d=Object.create(null);for(let p=1;p<f.length;p++){if(f[p]===void 0)continue;const m=o[p-1],w=l[p-1];d[m.name]=w(f[p])}return{path:h,index:y,params:d}}}function Ce(r){return r.replace(/([.+*?^${}()[\]|/\\])/g,"\\$1")}function on(r,e){const t=Ce(r);return e?`(?:${t})+(?!${t})`:t}function rs(r,e){if(!r)return Ce;const t=new RegExp(`(?:(?!${Ce(e)}).)+|(.)`,"g");return s=>s.replace(t,on)}function zs(r){return r.sensitive?"":"i"}function Gs(r,e,t){const{trailing:s=!0,loose:n=!0,start:i=!0,end:o=!0,strict:a=!1}=t,l=zs(t),u=rs(n,r.delimiter),c=Xs(r,u,e,l,a);let f=i?"^":"";return f+=c.join(""),s&&(f+=`(?:${u(r.delimiter)})?`),f+=o?"$":`(?=${Ce(r.delimiter)}|$)`,new RegExp(f,l)}function Xs(r,e,t,s,n){const i=`(?:(?!${Ce(r.delimiter)}).)+?`;let o="",a=!0;return r.tokens.map((l,u)=>{if(typeof l=="string")return o=l,e(l);const{prefix:c="",suffix:f="",separator:h=f+c,modifier:y=""}=l,d=e(c),p=e(f);if(l.name){const m=l.pattern?`(?:${l.pattern})`:i,w=ln(m,l.name,s);if(a||(a=Et(w,c||o)),!a)throw new TypeError(`Ambiguous pattern for "${l.name}": ${Ne}`);if(a=!n||Et(w,f),o="",t.push(l),y==="+"||y==="*"){const v=y==="*"?"?":"",_=e(h);if(!_)throw new TypeError(`Missing separator for "${l.name}": ${Ne}`);if(a||(a=!n||Et(w,h)),!a)throw new TypeError(`Ambiguous pattern for "${l.name}" separator: ${Ne}`);return a=!n,`(?:${d}(${m}(?:${_}${m})*)${p})${v}`}return`(?:${d}(${m})${p})${y}`}return`(?:${d}${p})${y}`})}function ln(r,e,t){try{return new RegExp(`^${r}$`,t)}catch(s){throw new TypeError(`Invalid pattern for "${e}": ${s.message}`)}}function Et(r,e){return e?!r.test(e):!1}function an(r,e={}){const t=r instanceof Be?r:pt(r,e),s=[],n=Gs(t,s,e);return Object.assign(n,{keys:s})}var it=(r=>(r[r.Part=0]="Part",r[r.All=1]="All",r))(it||{});const V=Symbol("rootKey"),B=Symbol("rootNodeKey"),ce=Symbol("parentNodeKey"),ot=Symbol("nameKey");class te{instance=null;model;route;active=!0;index=0;constructor(e,t,s=0,n=!0){this.route=e,this.model=t,this.index=s,this.active=n}}class Te{_slots;get slots(){return this._slots==null&&(this._slots=g.shallowRef([])),this._slots}get empty(){return this._slots==null||this._slots.value.length==0}[ot];[V];[B]=null;[ce]=null;get name(){return this[ot]}constructor(e,t,s){this[ot]=e,this[V]=t,s&&(this[B]=s)}}class N{view;index;level;constructor(e,t,s){this.view=e,this.index=t,this.level=s}static include(e,t){for(let s=0;s<e.length;s++){let n=e[s];if(n.view===t.view&&(t.index==-1||n.index===t.index)&&n.level===t.level)return!0}return!1}}class $t{views=[]}class un{layers=[]}class cn{time;route}class fn{forbidTime=300;submitRecorder=new cn;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 Se=Symbol("_notifyChange");class vs{currentRoute;routes;constructor(e,t){this.currentRoute=e,this.routes=t}}const le=Symbol("historyChangeConsumerKey"),ws=Symbol("_navigateFirstRoute"),ze=Symbol("_getRouteMark"),Ft=Symbol("_getUrlSearch"),At=Symbol("_generateLocation"),Ge=Symbol("_setRouteMarkRecorder"),_e=Symbol("beforeRestoreFiltersKey"),bs=Symbol("_beforeRestore"),xs="Symbol(_fox_restore_point)";function Ke(r,...e){return typeof r=="function"?Reflect.apply(r,null,[...e]):r}function Rs(r){if(!Array.isArray(r))return!1;if(r.length===0)return!0;const e=r[0];return!!(Reflect.has(e,"path")&&Reflect.has(e,"root"))}class Qs{base;storage;mode;query;firstNavigate=!0;historyMonitor;traceless=!1;changeHandler;historyChange;[le]=!1;[_e]=new Array;backTimeout=320;constructor(e="hash",t="",s="",n=!0,i=!0,o=!1,a,l){this.mode=e,this.base=t,this.query=s,this.firstNavigate=n,this.historyMonitor=i,this.traceless=o,this.storage=a??$().sessionStorage,this.backTimeout=l??320}init(e=!0){const t=$();return typeof this.historyChange!="function"&&(this.historyChange=()=>{if(typeof this[le]=="function"){const s=this[le]();if(this[le]=!1,s)return}else if(this[le]===!0){this[le]=!1;return}if(Ke(this.historyMonitor)){const s=t.history.state;this[Se](s);try{let n=[];if(typeof s=="string"?n=JSON.parse(s):n=s,Array.isArray(n)&&n.length>0){const i=this[ze]()??"/";this[Ge](i,n)}}catch{}}}),at(t,"popstate",this.historyChange),this.firstNavigate&&e&&this[ws](),Promise.resolve()}destroy(){if(this.historyChange){const e=$();zt(e,"popstate",this.historyChange)}}[bs](e,t,s,n){for(let i of this[_e])try{const o=Reflect.apply(i,{},[e,t,s,n]);if(o===!1)return o}catch(o){console.error(o.message,o)}return!0}beforeRestoreEach(e){this[_e].push(e)}removeBeforeRestoreEach(e){const t=this[_e].indexOf(e);return t!==-1?(this[_e].splice(t,1),!0):!1}[ws](){const e=this[ze]()??"/",t=this.storage.getItem(xs);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?qs(l.params):{},this[bs](l,u,e,o.routes)));if(a.length>0){const l=this[Ft](),u=a.length-1;a[u].query=l||a[u].query,this[Se](a);return}}}catch{}const s=e.indexOf("!");let n;s!=-1?n=e.substring(s+1):n=e;const i=new S;i.path=n,i.query=this[Ft](),this[Se]([i])}[Ge](e,t){try{t.forEach(i=>{i.params=i.params?js(i.params):{}});const n=JSON.stringify({mark:e,routes:t});this.storage.setItem(xs,n)}catch(s){console.error(s.message,s)}}setRestorePoint(e){const t=this[ze]()??"/";this[Ge](t,e)}[Se](e){typeof this.changeHandler=="function"&&this.changeHandler(e)}[ze](){const e=$();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,s=t.indexOf("#");if(s!=-1)return t.substring(s+1)}return null}[Ft](){let t=$().location.search;return t.length>0&&t.indexOf("?")===0&&(t=t.substring(1)),t}listen(e){this.changeHandler=e}go(e,t=!1){const s=$();this[le]=t,s.history.go(e)}goBack(e,t){const s=$(),n=s.history.state;if(Rs(n)&&n.length>0){let i=!1;for(let c=n.length-1;c>=0;c--){const f=S.from(n[c]);if(!(f.historyUpdatePolicy==="traceless"||Ke(this.traceless,f))&&S.isSame(f,e)){i=!0;break}}if(!i){t();return}const o=this.backTimeout;let a=null;const l=()=>{s.history.go(-1),a=setTimeout(l,o)},u=()=>{clearTimeout(a);const f=$().history.state;if(Rs(f)&&f.length>0){let h=f.length;const y=f[h-1],d=S.from(y);if(S.isSame(d,e))return t(),!0;if(h>0){let p=!1;for(let m=h-1;m>=0;m--){const w=S.from(f[m]);if(!(w.traceless===!0||Ke(this.traceless,w))&&S.isSame(w,e)){p=!0;break}}return p?(setTimeout(()=>{a=setTimeout(l,o),this.go(-1,u)},0),!0):(t(),!0)}}return t(),!0};a=setTimeout(l,o),this.go(-1,u)}else t()}setRouteMark(e){const t=e.currentRoute.fullPath;this[Ge](t,e.routes)}push(e){const t=this[At](e.currentRoute);e.currentRoute.historyUpdatePolicy!=="traceless"&&!Ke(this.traceless,e.currentRoute)&&$().history.pushState(e.routes,"",t),this.setRouteMark(e)}replace(e){const t=this[At](e.currentRoute);(e.currentRoute.historyUpdatePolicy!=="traceless"||!Ke(this.traceless,e.currentRoute))&&$().history.replaceState(e.routes,"",t),this.setRouteMark(e)}[At](e){const t=$();let s="";if(e.query){let a="";if(typeof e.query=="object")for(let l of Reflect.ownKeys(e.query)){let u=encodeURIComponent(e.query[l]),c=`${encodeURIComponent(String(l))}=${u}`;a.length>0&&(a+="&"),a+=c}else a=e.query;this.query?(s=a.length>0?`${this.query}&${a}`:this.query,s.length>0&&s.charAt(0)!=="?"&&(s=`?${s}`)):a.length>0&&(s=`?${a}`)}const n=t.location;let i=e.alias??e.fullPath;i.startsWith(X)&&(i=i.substring(X.length+1));let o;return s?this.mode=="path"?i.indexOf("/")===0?o=`${this.base}${i}${s}`:o=`${this.base}/${i}${s}`:o=`${n.pathname}${s}#${i}`:this.mode=="path"?i.indexOf("/")===0?o=`${this.base}${i}`:o=`${this.base}/${i}`:o=`${n.pathname}#${i}`,`${n.origin}${o}`}}function hn(r=!0,e=null,t="",s=!0,n=!1,i){return e!==null&&(e=$().location.pathname),e&&e.endsWith("/")&&(e=e.substring(0,e.length-1)),new Qs("path",e??"",t,r,s,n,i)}function Ys(r=!0,e="",t=!0,s=!1,n){return new Qs("hash","",e,r,t,s,n)}class yn{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}[Se](e){typeof this.changeHandler=="function"&&this.changeHandler(e)}go(e,t=!1){if(this.queue.length==0||this.cursor<=0)return;let s=this.cursor+e;if(s<0?s=0:s>this.queue.length-1&&(s=this.queue.length-1),s!=this.cursor){this.cursor=s;let n=!1;if(typeof t=="function"?n=t():n=t,!n){const i=this.queue[s];this[Se](i.routes)}}}goBack(e,t){if(this.queue.length==0||this.cursor<=0)return;let s=0;if(e===null)s=this.cursor+1;else for(let n=this.cursor;n>=0;n--){const i=this.queue[n];if(S.isSame(i.currentRoute,e))break;s++}if(s===0){t();return}this.go(-s,()=>(t(),!0))}setRouteMark(e){}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 Zs(r="",e=50){return new yn(r,e)}const Xe=Symbol("_constructRouteModel"),Qe=Symbol("_findRouteModel"),Tt=Symbol("_findRootView"),Ss=Symbol("_getFirstView"),ae=Symbol("_removeView"),Ps=Symbol("_buildPage"),Cs=Symbol("_resolveComponent"),Es=Symbol("_update"),se=Symbol("_merge"),_t=Symbol("_handleHistoryChange"),Ye=Symbol("_handleRouteUpdated"),Ze=Symbol("routeUpdatedCallback"),b=Symbol("currentRoutes"),et=Symbol("routeSessionCacheKey"),$s=Symbol("_addRouteRecorder"),je=Symbol("_removeRouteRecorder"),tt=Symbol("_cloneRouteRecorder"),T=Symbol("_handleError"),st=Symbol("errorCallback"),D=Symbol("registerKey"),rt=Symbol("notFoundKey"),Kt=Symbol("notFoundPathKey"),H=Symbol("forestKey"),P=Symbol("historyKey"),qe=Symbol("beforeFiltersKey"),Le=Symbol("afterFiltersKey"),ke=Symbol("destroyFiltersKey"),jt=Symbol("propsFilterKey"),we=Symbol("mainDispatcherKey"),qt=Symbol("initKey"),ue=Symbol("readyKey"),Lt=Symbol("readyHandlersKey"),nt=Symbol("_markReady"),Fs=Symbol("_createNextFn"),kt=Symbol("_start"),Ot=Symbol("_before"),Mt=Symbol("_after"),As=Symbol("_destroy"),It=Symbol("_load"),Oe=Symbol("_unload"),Me=Symbol("routerGuardKey");function dn(r){return r.layers.length==0||r.layers[0].views.length==0}function pn(r){let e=[];return r.layers.forEach(t=>{t.models==null||t.models==null||t.models.forEach(s=>{if(!(s==null||s==null))if(typeof s.meta=="object"){let n=F(!0,{},s.meta);e.push(n)}else s.meta&&e.push(s.meta)})}),e}class mn{[D]=new Array;[rt];[Kt]="*";[ue]=!1;[Lt]=[];[H]=new un;[P];[b]=new Array;[et]=new WeakMap;[st]=null;[Ze]=null;[qe]=new Array;[Le]=new Array;[ke]=new Array;[jt]=null;[we]=new He;[Me]=new fn;[qt]=!1;get current(){const e=this[b].length;return e>0?this[b][e-1]:null}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[P]=e.history:this[P]=he?Ys():Zs(),this[P]?.listen(async s=>{let n=!0;try{if(typeof s=="string"){const i=this[O](s);i&&await this[_t]([i])}else await this[_t](s)}catch(i){console.error(i.message,i),n=!1}this[ue]===!1&&this[nt](n)})}[T](e="error",t){if(t&&typeof t.error=="function")try{t.error(e)}catch{}if(typeof this[st]=="function")try{this[st](e,t)}catch{}console.error(e)}init(){this[qt]!==!0&&(this[P]?.init(!this[ue]),this[qt]=!0)}isReady(){return this[ue]?Promise.resolve():new Promise((e,t)=>{this[Lt].push([e,t])})}[nt](e){this[ue]=!0,this[Lt].forEach(([t,s])=>{try{e?t():s()}catch(n){console.error(n.message,n)}})}[_t](e){try{if(!e){let o=[...this[b]].reverse();return this[Oe](o),he&&$().location.reload(),Promise.resolve()}let t=null,s=[],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&&(s=e.slice(i)),i<this[b].length&&(n=this[b].slice(i).reverse()),n.length===0&&s.length===0){if(t!==null)return this.restore([t])}else if(n.length>0){if(this[Oe](n)){if(s.length>0)return this.restore(s);if(t!==null)return this.restore([t])}}else return this.restore(s)}catch(t){this[T](t)}return Promise.resolve()}[Ye](e=null){if(e||(e=this.current),typeof this[Ze]=="function")try{this[Ze](e)}catch{}}[$s](e,t){if(e.opsType===E.Open){let s=!1;const n=this[b].length-1;for(let i=n;i>=0;i--){const o=this[b][i];if(e.root==o.root){if(e.path===o.path){this[b].splice(i,1,e),s=!0;continue}e.active&&(o.active=!1)}}s||this[b].push(e)}else this[b].push(e);this[et].set(e,t)}[tt](){let e=[];for(let t of this[b]){let s=S.clone(t,!0);e.push(s)}return e}[je](e){if(!this[b])return;let t=-1;for(let s=0;s<this[b].length;s++)if(S.isSame(this[b][s],e)){t=s;break}if(t!=-1){let s=this[b][t];this[b].splice(t,1);const n=this[et].get(s);this[et].delete(s),this[As](s,n)}}set historyMonitor(e){this[P]&&(this[P].historyMonitor=e)}get historyMonitor(){return this[P]?this[P].historyMonitor:!1}set traceless(e){this[P]&&(this[P].traceless=e)}get traceless(){return this[P]?this[P].traceless:!1}set propsFilter(e){this[jt]=e}get propsFilter(){return this[jt]}setRestorePoint(){const e=this[tt]();this[P]?.setRestorePoint(e)}onRouteUpdated(e){this[Ze]=e}onError(e){this[st]=e}beforeEach(e){this[qe].push(e)}removeBeforeEach(e){const t=this[qe].indexOf(e);return t!==-1?(this[qe].splice(t,1),!0):!1}afterEach(e){this[Le].push(e)}removeAfterEach(e){const t=this[Le].indexOf(e);return t!==-1?(this[Le].splice(t,1),!0):!1}destroyEach(e){this[ke].push(e)}removeDestroyEach(e){const t=this[ke].indexOf(e);return t!==-1?(this[ke].splice(t,1),!0):!1}beforeRestoreEach(e){this[P]?.beforeRestoreEach(e)}removeBeforeRestoreEach(e){return this[P]?.removeBeforeRestoreEach(e)??!1}addRoutes(e){for(let t of e)this.addRoute(t)}addRoute(e,t=-1){if(e.path===this[Kt]){this.setNotFoundRoute(e);return}const s=this[Xe](e);if(t==-1)this[D]=[...this[D],...s];else for(let n=s.length-1;n>=0;n--)this[D].splice(t,0,s[n])}removeRoute(e){const t=this[O](e);if(t===null)return console.warn("route格式错误",e),!1;for(let s=0;s<this[D].length;s++){const n=this[D][s];if(t?.path&&n.path===t.path)return this[D].splice(s,1),!0;if(t?.name&&n.name===t.name)return this[D].splice(s,1),!0}return!1}hasRoute(e){const t=this[O](e);return t===null?(console.warn("route格式错误",e),!1):this[D].findIndex(n=>{if(t?.path&&n.path===t.path||t?.name&&n.name===t.name)return!0})!==-1}setNotFoundPath(e){this[Kt]=e}setNotFoundRoute(e){const t=this[Xe](e);this[rt]=t[0]}getRoutes(){return[...this[D]]}[Xe](e){let t=e.path??"";t.length>0&&t.charAt(0)!=="/"&&(t=`/${t}`);let s=e.components??(e.component&&{"":e.component});if(s==null){const a=new xt;return a.path=t,a.redirect=e.redirect,[a]}let n=[];for(let a in s){let l=s[a];a.length===0&&(a=X);let u=new Or(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[Xe](a);for(let u of l){let c=new xt;c.name=u.name,u.path&&u.path.length>0?t!=="/"?c.path=`${t}${u.path}`:c.path=u.path:(i=!0,c.path=t);let f=new hs;f.models=[...n],c.layers=[f,...u.layers],o.push(c)}}if(!i){const a=new hs;a.models=n;const l=new xt;l.name=e.name,l.path=t,l.layers=[a],o.splice(0,0,l)}return o}[Qe](e){const t=e.route;try{for(let s of this[D]){const n=t.template??t.path,i=t.template??t.name;if(n&&s.path){let o=s.match;o||(o=s.match=Gr(s.path));const a=o(n);if(!a)continue;if(s.redirect){const l=new S;F(!0,l,t),l.path=s.redirect;const u={route:l,find:void 0};return this[Qe](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??{},F(!0,t.params,a.params),t.query){const l=t.query;if(typeof l=="string"){const u={},c=l.split("&");for(let f of c){const h=f.split("=");if(h.length!==2)continue;const y=decodeURIComponent(h[0].trim()),d=decodeURIComponent(h[1].trim());u[y]=d}F(!0,t.params,u)}else typeof l=="object"&&F(!0,t.params,l)}return e.find=s,t.template&&e.find&&(e.find={...e.find},e.find.path=t.path),!0}else if(i===s.name){t.params=t.params??{};const o=zr(s.path);return t.path=o(t.params),e.find=s,t.template&&e.find&&(e.find={...e.find},e.find.name=t.name),!0}}}catch(s){console.error(s.message,s),typeof t.error=="function"&&t.error(s.message)}return!1}[O](e){let t=null;if(Array.isArray(e))if(t=new S,typeof e[0]=="object")t=S.from(e[0]);else for(let s=0;s<e.length;s++)s===0?e[s].charAt(0)==="/"?t.path=e[s]:t.name=e[s]:s===1?t.params=e[s]:s===2?t.root=e[s]:s===3&&F(!1,t,e[s]);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 s=t.path.indexOf("?");s!==-1&&s<t.path.length-1&&(t.query=t.path.substring(s+1),t.path=t.path.substring(0,s))}t.root=t.root??X,t.opsType=t.opsType??this.options.defaultOperationType??E.Push,t.traceless&&!t.historyUpdatePolicy&&(t.historyUpdatePolicy="traceless")}return t}push(...e){const t=this[O](e);return t?(t.opsType=E.Push,t.historyUpdatePolicy=t.historyUpdatePolicy??"push",this.to(t)):(this[T]("resolve route fail",t),this)}put(...e){const t=this[O](e);return t?(t.opsType=E.Put,t.historyUpdatePolicy=t.historyUpdatePolicy??"traceless",this.to(t)):(this[T]("resolve route fail",t),this)}replace(...e){const t=this[O](e);return t?(t.opsType=E.Replace,t.historyUpdatePolicy=t.historyUpdatePolicy??"replace",this.to(t)):(this[T]("resolve route fail",t),this)}append(...e){const t=this[O](e);return t?(t.opsType=E.Append,t.historyUpdatePolicy=t.historyUpdatePolicy??"push",this.to(t)):(this[T]("resolve route fail",t),this)}remove(e,t){return new Promise(s=>{this[we].post(n=>{try{if(this[b].length===0){n.resolve(),s(!1);return}let i=-1,o,a=[];if(e){if(e.root?o=e.root:o=this[b][0].root??X,e.all)for(let u=this[b].length-1;u>0;u--){let c=this[b][u];c.opsType===E.Append&&c.root===o&&(a.splice(0,0,c),i=u-1)}else if(e.until)for(let u=this[b].length-1;u>0;u--){let c=this[b][u];if(c.opsType===E.Append&&c.root===o){if(e.until.charAt(0)==="/"&&e.until===c.path){i=u;break}else if(e.until===c.name){i=u;break}a.splice(0,0,c)}}else if(e.to)for(let u=this[b].length-1;u>0;u--){let c=this[b][u];if(c.opsType===E.Append&&c.root===o){if(a.splice(0,0,c),e.to.charAt(0)==="/"&&e.to===c.path){i=u-1;break}else if(e.to===c.name){i=u-1;break}}}}else{o=X;let u=this[Ss](this[H]);u&&(o=u.name);for(let c=this[b].length-1;c>0;c--){let f=this[b][c];if(f.opsType===E.Append&&f.root===o){a.push(f),i=c-1;break}}}if(i===-1||a.length===0){let u="can not find route";console.warn(u),n.resolve(u),s(!1);return}let l=null;if(i!==-1&&(l=this[b][i]),this[Oe](a)){if(t===!1)return n.resolve(),s(!0),!0;const u=()=>(n.resolve(),s(!0),!0),c=this[b].length;if(l&&S.isSame(l,this[b][c-1])){this[P]?.goBack(l,u);return}u()}}catch(i){this[T](i),n.resolve(),s(!1)}})})}open(...e){let t=this[O](e);return t?(t.opsType=E.Open,t.historyUpdatePolicy=t.historyUpdatePolicy??"push",this.to(t)):(this[T]("resolve route fail",t),this)}close(e){return this[we].post(t=>{try{let s=this[O](e);if(!s){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===s.root){if(!s.path&&!s.name){n.push(o);continue}if(s.path&&s.path===o.path){n.push(o);break}else if(s.name&&s.name===o.name){n.push(o);break}}}if(n.length===0){t.resolve();return}this[Oe](n)&&this[Ye](),t.resolve()}catch(s){this[T](s),t.resolve()}}),this}to(...e){let t=this[O](e);if(!t)return this[T]("resolve route fail",t),this;let s=this[Me].acquire(t);return s==null?(this[T]("route forbid",t),this):(this[we].post(n=>{try{let i=this[kt](t);this[Ot](i),this[It](i),this[Mt](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 c=new vs(u,this[tt]());l.historyUpdatePolicy==="replace"?this[P]?.replace(c):l.historyUpdatePolicy==="traceless"?this[P]?.setRouteMark(c):this[P]?.push(c)}catch(u){console.error(u.message,u)}if(Re.clear(o.session),this[Me].release(s),this[Ye](l),typeof t.success=="function")try{Reflect.apply(t.success,{},[])}catch(u){console.error(u.message,u)}this[ue]===!1&&this[nt](!0),i=null,n.resolve()},(o,a)=>{this[Me].release(s),a!==null&&this[T](a,t),this[ue]===!1&&this[nt](!1),Re.clear(o.session),i=null,n.resolve()})}catch(i){this[Me].release(s),this[T](i,t),n.resolve()}}),this)}back(e=1){this[P]?.go(-e,!1)}[Fs](e){return(t,s)=>{if(typeof t=="boolean")e.session.redirect=!1,t?e.resolve():e.reject(s??null);else if(t){const n=this[O](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()}}[kt](e){const t=this[b].length>0?this[b][this[b].length-1]:void 0,s=new Re(e,t),n={route:e,find:null};return this[Qe](n),n.find&&(s.routeModel=n.find,e.matched=pn(n.find),Array.isArray(e.matched)&&e.matched.length>0&&(e.meta=n.find.layers[0].models[0].meta)),new He(s)}[Ot](e){for(let t of this[qe])e.post(s=>{const n=this[Fs](s);Reflect.apply(t,{},[s.session.to,s.session.from,n,s.session])})}[Mt](e){e.post(t=>{for(let s of this[Le])try{Reflect.apply(s,{},[t.session.to,t.session.from,t.session])}catch(n){console.error(n.message,n)}t.resolve()})}[As](e,t){for(let s of this[ke])try{Reflect.apply(s,{},[e,t])}catch(n){console.error(n.message,n)}typeof e.destroy=="function"&&Reflect.apply(e.destroy,e,[])}[It](e){e.post(t=>{const s=t.session.to;let n=t.session.routeModel;if(n==null){let o={route:s,find:null};if(this[Qe](o))n=o.find,t.session.routeModel=n;else if(this[rt])n=this[rt];else{t.reject(`not find route model, path:${s.path??s.name}`);return}}const i=Re.from(t.session);this[Ps](s,n,i).then(o=>{this[H],t.session.updateResult=o??{status:"success",message:""},t.resolve()},o=>{t.reject(o)})})}[Oe](e){if(e.length==0)return!0;let t=this[H],s=[];for(let n of e){let i=this[Tt](t,n);i!=null&&s.push({...i,route:n})}if(s.length==0)return this[T]("can not find view index"),!1;for(let n of s.reverse())this[ae](t,{x:n.x,y:n.y},[n.route.index??0],!0);return!0}[Tt](e,t){const s=t.root??X;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[V]&&l[ot]===s)return n={x:a,y:i},n}}return null}[Ss](e){return e.layers.length>0&&e.layers[0].views.length>0?e.layers[0].views[0]:null}[ae](e,t,s=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 f=u.length-1;f>=0;f--){let h=u[f];(!s||s.indexOf(h.index)!=-1)&&(h.route&&i[V]&&(this[je](h.route),h.active===!0&&h.route.opsType==E.Append&&(l=!0)),a.push(new N(i,h.index,t.y)),u.splice(f,1))}if(u.length==0)n?i.slots.value=u:e.layers[t.y].views.splice(t.x,1);else{if(l){let f=u.length-1,h=u[f];h.active=!0,h.route&&(h.route.active=h.active)}i.slots.value=u}e.layers[t.y].views.length==0&&(o=!0);let c=t.y+1;for(;c<e.layers.length;c++){let f=e.layers[c].views,h=[];for(let y=f.length-1;(o||a.length>0)&&y>=0;y--){let d=f[y];if(d[ce]&&(o||N.include(a,d[ce]))){let p=d.slots.value;for(let m=p.length-1;m>=0;m--){let w=p[m];w.route&&d[V]&&this[je](w.route),h.push(new N(d,w.index,c)),p.splice(m,1)}e.layers[c].views.splice(y,1)}}a=h,e.layers[c].views.length==0&&(o=!0)}}restore(e){if(!e||this[D].length==0){let t=this[H];if(t.layers.length>0){let s=t.layers[0].views;s.length>0&&(s[0].slots.value=[])}return this[b]=[],this[Ye](),Promise.resolve()}else return new Promise((s,n)=>{let i=null,o=!1;for(let a=0;a<e.length;a++){const l=e[a];this[we].post(u=>{const c=this[kt](l);this[Ot](c),this[It](c),this[Mt](c),c.wait((f,h)=>{i=f.session.to,o=f.session.redirect,u.resolve()},(f,h)=>{i=null,h!==null&&this[T](h),u.resolve()})})}this[we].post(a=>{if(i&&o===!0){const l=S.clone(i,!0),u=new vs(l,this[tt]());this[P]?.replace(u)}a.resolve(),s()})})}[Ps](e,t,s){const n=e.updateType??it.Part;return this[Cs](t).then(()=>{const o=this[Es](t,e,s,n);if(o.status==="error")throw Error(o.message);return o})}[Cs](e){let t=[];for(let s=0;s<e.layers.length;s++){let n=e.layers[s];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()}[Es](e,t,s,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[H],a=dn(o),l=t.root??X,u;!a&&n==it.Part&&(u=this[Tt](o,t));let c,f=0;if(u==null||u==null)if(a||n===it.All){if(o.layers.length==0&&(o.layers[0]=new $t),o.layers[0].views.length==0){let h=t.root??X;c=new Te(h,!0,null),o.layers[0].views=[c]}else c=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 p=o.layers[y-1];for(let m of p.views){if(m[V]&&m.name===h.rootName){d=new N(m,h.rootIndex??0,y-1);break}if(m[B]&&m[B].view.name===h.rootName&&m[B].index===h.rootIndex){d=m[B];break}}}if(!d)return{status:"error",message:"can not insert view(not find root node ref)"};c=new Te(l,!0,d),o.layers[y].views.push(c),u={x:o.layers[y].views.length-1,y}}else c=o.layers[u.y].views[u.x];if(f=u.y,c[V]=!0,t.opsType===E.Append){t.index=t.index??ie.get(),t.active=!0;let h=c.slots.value;if(h.length>0){let w=h[h.length-1];w.active=!1,w.route&&(w.route.active=w.active)}let y=new te(t,i,t.index,!0);c.slots.value=[...h,y];let d=f+1,p=1,m=new N(c,t.index,f);this[se](o,d,e,p,m)}else if(t.opsType===E.Open){let h=c.slots.value;const y=t.active??!0;let d=!1;for(let p of h){if(p.route!==null&&S.isSameForRouteModel(p.route,t)){if(p.active===y)return t.index=p.index,t.active=y,p.route=t,{status:"no-change",message:""};p.active=y,d=!0,t.index=p.index,t.active=y,p.route=t}else y&&(p.active=!1);p.route&&(p.route.active=p.active)}if(!d){t.index=t.index??ie.get(),t.active=y;let p=new te(t,i,t.index,y);h.push(p);let m=f+1,w=1,v=new N(c,t.index,f);this[se](o,m,e,w,v)}c.slots.value=[...h]}else{let h=c.slots.value;if(h.length==0){t.index=t.index??ie.get(),t.active=!0,c.slots.value=[new te(t,i,t.index)];let y=f+1,d=1,p=new N(c,t.index,f);this[se](o,y,e,d,p)}else{let y=h[0];if(y.model!==i){this[ae](o,u,null,!0),t.index=t.index??ie.get(),t.active=!0,c.slots.value=[new te(t,i,t.index)];let d=f+1,p=1,m=new N(c,t.index,f);this[se](o,d,e,p,m)}else{y.route!==null&&this[je](y.route);let d=!1;const p=t.active??!0;y.active!==p&&(y.active=p,d=!0),t.active=p,t.index=y.index,y.route=t;let m=[];for(let Q=1;Q<h.length;Q++)m.push(h[Q].index);m.length>0?this[ae](o,u,m,!0):d&&(c.slots.value=[...h]);let w=[new N(c,t.index,f)],v=f+1,_=1,ee=new N(c,t.index,f);for(;w.length>0&&v<o.layers.length&&_<e.layers.length;v++,_++){let Q=[];for(let K=0;K<o.layers[v].views.length;K++){let j=o.layers[v].views[K];j[ce]&&N.include(w,j[ce])&&Q.unshift(K)}let pe=[];for(let K of Q){let j=o.layers[v].views[K],oe=e.layers[_].models,Y;for(let L=0;L<oe.length;L++)if(j.name===oe[L].name){Y=oe[L];break}if(!Y)this[ae](o,{x:K,y:v},null,!1);else{let L=j.slots.value;if(L.length==0){let W=0;j.slots.value=[new te(null,Y,W)];let U=v+1,Z=_+1;this[se](o,U,e,Z,ee)}else{let W=L[0];if(W.model!==Y){this[ae](o,{x:K,y:v},null,!0),j.slots.value=[new te(null,Y,0)];let U=v+1,Z=_+1;this[se](o,U,e,Z,ee)}else{j[V]&&W.route!==null&&this[je](W.route);let U=[];for(let Z=1;Z<L.length;Z++)U.push(L[Z].index);U.length>0&&this[ae](o,{x:K,y:v},U,!0),pe.push(new N(j,W.index,v))}}j[V]=!1}}w=pe}this[se](o,v,e,_,ee)}}}if(c&&c[B]){let h=c[B];h&&(t.slot=new kr(l,f,h?.view.name,h?.index??0))}return s.to=void 0,s.routeModel=void 0,this[$s](t,s),{status:"success",message:""}}[se](e,t,s,n,i){let o=n,a=t;for(;a<e.layers.length&&o<s.layers.length;a++,o++){let l=e.layers[a].views;for(let u of s.layers[o].models){let c=new Te(u.name,!1,i),f=new te(null,u);c.slots.value=[f],l.push(c)}}for(;o<s.layers.length;o++){let l=new $t;l.views=[];for(let u of s.layers[o].models){let c=new Te(u.name,!1,i),f=new te(null,u);c.slots.value=[f],l.views.push(c)}e.layers.push(l)}}[Ns](e,t,s,n,i,o){if(t<0||t>this[H].layers.length)return null;if(t<this[H].layers.length){let c=this[H].layers[t],f=null;for(let h of c.views){let y=!1;if(s!==null?(y=h.name===e&&h[B]?.view===s,y&&n!==-1&&(y=h[B]?.index===n)):y=h.name===e,!!y){i!==null&&(h[ce]={view:i,index:o,level:t-1}),f=h;break}}if(f!==null)return f}let a=null,l=null;i!==null&&(i[V]?a={view:i,index:o,level:t-1}:a=i[B],l={view:i,index:o,level:t-1});let u=new Te(e,!0,a);if(u[ce]=l,t==this[H].layers.length){let c=new $t;c.views=[u],this[H].layers.push(c)}else this[H].layers[t].views.push(u);return u}}const gn="fox-router-view",vn="fox-router-link";function er(r,e=!1){let t=null;return e?t=r.showFromClass??r.enterFromClass:t=r.enterFromClass,t||(t=r.transitionName,t?e?`${t}-show-from`:`${t}-enter-from`:null)}function tr(r,e=!1){let t=null;return e?t=r.showActiveClass??r.enterActiveClass:t=r.enterActiveClass,t||(t=r.transitionName,t?e?`${t}-show-active`:`${t}-enter-active`:null)}function wn(r,e=!1){let t=null;return e?t=r.showToClass??r.enterToClass:t=r.enterToClass,t||(t=r.transitionName,t?e?`${t}-show-to`:`${t}-enter-to`:null)}function sr(r,e=!1){let t=null;return e?t=r.hideFromClass??r.leaveFromClass:t=r.leaveFromClass,t||(t=r.transitionName,t?e?`${t}-hide-from`:`${t}-leave-from`:null)}function rr(r,e=!1){let t=null;return e?t=r.hideActiveClass??r.leaveActiveClass:t=r.leaveActiveClass,t||(t=r.transitionName,t?e?`${t}-hide-active`:`${t}-leave-active`:null)}function bn(r,e=!1){let t=null;return e?t=r.hideToClass??r.leaveToClass:t=r.leaveToClass,t||(t=r.transitionName,t?e?`${t}-hide-to`:`${t}-leave-to`:null)}function xn(r,e=!1){let t=null;return e?t=r.beforeShow??r.beforeEnter:t=r.beforeEnter,t}function Rn(r,e=!1){let t=null;return e?t=r.show??r.enter:t=r.enter,t}function Sn(r,e=!1){let t=null;return e?t=r.afterShow??r.afterEnter:t=r.afterEnter,t}function Pn(r,e=!1){let t=null;return e?t=r.showCancelled??r.enterCancelled:t=r.enterCancelled,t}function Cn(r,e=!1){let t=null;return e?t=r.beforeHide??r.beforeLeave:t=r.beforeLeave,t}function En(r,e=!1){let t=null;return e?t=r.hide??r.leave:t=r.leave,t}function $n(r,e=!1){let t=null;return e?t=r.afterHide??r.afterLeave:t=r.afterLeave,t}function Fn(r,e=!1){let t=null;return e?t=r.hideCancelled??r.leaveCancelled:t=r.leaveCancelled,t}function ns(r){let e,t=r.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 Ee(r,e){r.classList.contains(e)||r.classList.add(e)}function Pe(r,e){r.classList.remove(e)}const An=he&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout;function mt(r){An(r)}function A(r,e,t){x(e)&&(r==null&&(r={}),Reflect.apply(e,r,t))}function nr(r,e,t,s=-1,n,i,o,a){let l=[];const u=()=>{for(let c of l)zt(e,c.type,c.listener);l=[]};if(x(i)){if(n!==void 0&&n>=0){setTimeout(()=>{Reflect.apply(i,r,[e,t,s]),x(a)&&Reflect.apply(a,r,[])},n);return}const c=["animationend","transitionend",ut],f=h=>{const y=h.target||h.srcElement,d=h.currentTarget;y===d&&(u(),Reflect.apply(i,r,[e,t,s]))};c.forEach(h=>{at(e,h,f),l.push({type:h,listener:f})})}if(x(o)){const c="animationcancel",f=h=>{const y=h.target||h.srcElement,d=h.currentTarget;y===d&&(u(),Reflect.apply(o,r,[e,t,s]))};at(e,c,f),l.push({type:c,listener:f})}}function gt(r){return!he||r===null?!1:r.opsType===E.Append||r.opsType===E.Open}function ir(r,e,t,s={},n,i=-1){if(e||gt(n)){const o=er(s,e);o&&Ee(t,o);const a=tr(s,e);a&&Ee(t,a);const l=xn(s,e);A(r,l,[t,e,n,i])}}function or(r,e,t,s={},n,i,o,a){if(!gt(i)&&!e){x(a)&&a(r,a,[t]);return}const l=er(s,e),u=tr(s,e),c=wn(s,e),f=Rn(s,e),h=Sn(s,e),y=Pn(s,e);if(!l&&!u&&!c&&!f){x(a)&&a(r,a,[t]);return}mt(()=>{nr(r,t,i,o,n,()=>{u&&Pe(t,u),c&&Pe(t,c),x(h)&&A(r,h,[t,e,i,o]),x(a)&&a(r,a,[t])},()=>{x(y)&&A(r,y,[t,e,i,o])}),l&&Pe(t,l),c&&Ee(t,c),x(f)&&A(r,f,[t,e,i,o])})}function lr(r,e,t,s={},n,i=-1){if(e||gt(n)){const o=sr(s,e);o&&Ee(t,o);const a=rr(s,e);a&&Ee(t,a);const l=Cn(s,e);A(r,l,[t,e,n,i])}}function ar(r,e,t,s={},n,i,o,a,l){if(!gt(o)&&!e){x(l)&&A(r,l,[t]),!e&&x(i)&&i();return}const u=sr(s,e),c=rr(s,e),f=bn(s,e),h=En(s,e),y=$n(s,e),d=Fn(s,e);if(!u&&!c&&!f&&!h){x(l)&&A(r,l,[t]),!e&&x(i)&&i();return}mt(()=>{nr(r,t,o,a,n,()=>{c&&Pe(t,c),f&&Pe(t,f),x(y)&&A(r,y,[t,e,o,a]),x(l)&&A(r,l,[t]),!e&&x(i)&&i()},()=>{x(d)&&A(r,d,[t,e,o,a]),x(l)&&A(r,l,[t]),!e&&x(i)&&i()}),u&&Pe(t,u),f&&Ee(t,f),x(h)&&A(r,h,[t,e,o,a])})}function Jt(r,e,t={},s,n=-1){const i=t.mode??"default",o=ns(t);return{mode:i,persisted:!1,beforeEnter:l=>{ir(r,!1,l,t,s,n)},enter:l=>{or(r,!1,l,t,o.enter,s,n)},leave:(l,u)=>{lr(r,!1,l,t,s,n),ar(r,!1,l,t,o.leave,u,s,n,()=>{e.transition=null,e=null})},clone:l=>Jt(r,e,t,s,n)}}function ur(r){return r.el}function Tn(r,e,t={},s,n,i,o){if(i===!0){const a=ur(e);if(a==null)return;const l=ns(t);ir(r,!0,a,t,s,n),or(r,!0,a,t,l.show,s,n,u=>{x(o)&&A(r,o,[u])})}else x(o)&&A(r,o,[])}function _n(r,e,t={},s,n,i,o){if(i===!0){const a=ur(e);if(a==null)return;const l=ns(t);lr(r,!0,a,t,s,n),ar(r,!0,a,t,l.hide,null,s,n,u=>{x(o)&&A(r,o,[u])})}else x(o)&&A(r,o,[])}function Kn(r,e={}){mt(()=>{for(let t=0;t<r.length;t++)Reflect.apply(r[t],e,[])})}function cr(r,e,t={},s,n=-1){return{mode:t.mode??"default",persisted:!1,beforeEnter:a=>{Je(Ds,{},a)},enter:a=>{Je(Hs,{},a)},leave:(a,l)=>{Je(Us,{},a),mt(()=>{const u=c=>{const f=c.target||c.srcElement,h=c.currentTarget;f===h&&(zt(a,ut,u),l&&Reflect.apply(l,r,[]),e.transition=null,e=null)};at(a,ut,u),Je(Bs,{},a)})},clone:a=>cr(r,e,t,s,n)}}function re(r,e,t){return typeof r=="function"?Reflect.apply(r,{},[e,t]):r}function Nt(r,e){if(!r)return null;const t=r(e);return t.length===1?t[0]:t}function be(r,e){return typeof e=="function"?e(r):r}class jn{node;state;constructor(e,t){this.node=e,this.state=t}}const Wt=g.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(r,e){const t=g.getCurrentInstance();if(t===null||t.proxy===null){console.error("instance or instance.proxy not exist");return}const s=r.multi===!0,n=g.inject(dt,null),i=g.inject(St,0),o=g.inject(ms,null),a=g.inject(Pt,-1);let l=null,u=r.modelSlot;if(u){if(g.provide(St,i+1),g.provide(Pt,u.index),g.provide(Ct,u.index),!u.route){console.warn("child view render error, route not exist");return}const h=ct(t.proxy,!0);Hr(h),ps(h,()=>u?.route??null)}else{if(n==null){console.error("router is not been injected");return}const f=r.name,h=g.inject(gs,null),y=g.inject(Ct,0);if(l=n[Ns](f,i,o,a,h,y),l===null)return;g.provide(gs,l);const d=l[V]===!0;if(d&&g.provide(ms,l),!s&&(g.provide(Pt,-1),g.provide(St,i+1),g.provide(Ct,-1),d)){const p=ct(t.proxy,!0);ps(p,()=>{const m=l.slots.value;return m.length>0?m[0].route:null})}}const c={value:new Map};return g.onUnmounted(()=>{if(c.value&&c.value.clear(),u){const f=u;f.route=null,f.model=null,f.instance=null,u=void 0}}),()=>{if(s){const f=new Map,h=[],y=l?.slots.value,d=[];for(let w=0;w<y.length;w++){const v=y[w],_=`${r.name}_${v.index}`,ee=re(r.transition,v.route,w)??!0,Q={modelSlot:v};let pe;e.slots.default?pe=g.h(Wt,Q,{default:e.slots.default}):pe=g.h(Wt,Q);const K={},j=re(r.viewClass,v.route,w);typeof j=="string"&&j.length>0&&(K[j]=!0);const oe=re(r.viewActiveClass,v.route,w),Y=re(r.viewInactiveClass,v.route,w),L=c.value.get(_);if(typeof oe=="string"&&oe.length>0&&(K[oe]=v.active),typeof Y=="string"&&Y.length>0&&(K[Y]=!v.active),L&&v.active!==L.state){const M=L.node;v.active?d.unshift(()=>{const vt=()=>{let $e=ys(M);$e!=null&&ds($e,Vt.ACTIVATED)};Tn(t,M,r,v.route,w,ee,vt)}):d.push(()=>{const vt=()=>{const $e=ys(M);$e!=null&&ds($e,Vt.DEACTIVATED)};_n(t,M,r,v.route,w,ee,vt)})}const W={class:K,key:_},U=re(r.viewTagProps,v.route,w);if(U!==null&&typeof U=="object"){const M=be(U,n?.propsFilter);F(!0,W,M)}if(v.route?.viewTagAttrs&&typeof v.route?.viewTagAttrs=="object"){const M=be(v.route.viewTagAttrs,n?.propsFilter);F(!0,W,M)}const Z=re(r.viewTag,v.route,w),me=g.h(Z,W,{default:()=>[pe]});if(f.set(_,new jn(me,v.active)),c.value.delete(_),ee===!0){const M=Jt(t,me,r,v.route,w);me.transition=M}else if(ee==="custom"){const M=cr(t,me,r,v.route,w);me.transition=M}h.push(me)}c.value=f,Kn(d,t);const p=re(r.tag,null,-1),m={};return Object.assign(m,e.attrs),g.h(p,m,{default:()=>h})}else if(u!=null){const f=u.model,h={};if(f.props){if(typeof f.props=="object"){const d=be(f.props,n?.propsFilter);F(!1,h,d)}else if(f.props===!0&&typeof u.route?.params=="object"){const d=be(u.route.params,n?.propsFilter);F(!1,h,d)}}const y=g.h(f.component,h);return Nt(e.slots.default,{Component:y,route:u.route})??y}else{const f=l.slots.value;if(f.length>0){const h=f[0],y=h.route??(t.proxy&&ts(t.proxy))??null,d=h.model,p={};if(d.props){if(typeof d.props=="object"){const v=be(d.props,n?.propsFilter);F(!1,p,v)}else if(d.props===!0&&typeof y?.params=="object"){const v=be(y.params,n?.propsFilter);F(!1,p,v)}}const m=g.h(d.component,p);if(re(r.transition,y,-1)??!0){const v=Jt(t,m,r,y,-1);m.transition=v}return Nt(e.slots.default,{Component:m,route:y})??m}else return Nt(e.slots.fallback,{})}}}});function qn(r){if(!(r.metaKey||r.altKey||r.ctrlKey||r.shiftKey)&&!r.defaultPrevented&&!(r.button!=null&&r.button!==0)){if(r.currentTarget&&r.currentTarget.getAttribute){const e=r.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(e))return}return r.preventDefault&&r.preventDefault(),!0}}function Ln(r,e){return r==null||e==null?!1:!!(r===e||r.path&&r.path===e.path||r.name&&r.name===e.name)}function kn(r,e){return r==null||e==null?!1:!!(r.path&&e.path&&e.path.startsWith(r.path)||r.name&&r.name==e.name)}function xe(r,e){return typeof r=="function"?Reflect.apply(r,{},[e]):r}let On=g.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(r,e){const t=g.inject(dt,null);return()=>{let s=xe(r.to,null),n=xe(r.tag,s);if(n==null){console.warn("can not resolve link tag");return}let i=null,o=null;t!==null&&(i=t[O](s),r.root&&(i.root=r.root),o=t.current);let a={},l=xe(r.activeClass,i);if(typeof l=="string"&&l.length>0&&(a[l]=kn(i,o)),xe(r.exact,i)===!0){let h=xe(r.exactActiveClass,i);typeof h=="string"&&h.length>0&&(a[h]=Ln(i,o))}let c={class:a};(n==="a"||n==="A")&&(c.href=i?.path??i?.name??"#"),F(!0,c,e.attrs);let f=xe(r.event,i);if(typeof f=="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}qn(y)&&t.to(i)};c[f]=h}return g.h(n,c,e.slots)}}});var q=(r=>(r[r.Loading=0]="Loading",r[r.Loaded=1]="Loaded",r[r.Defining=2]="Defining",r[r.Defined=3]="Defined",r))(q||{}),lt=(r=>(r[r.normal=0]="normal",r[r.factory=1]="factory",r))(lt||{});class Mn{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 Ts{moduleManager=new Mn;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 Ve().head}constructor(){}setModule(e,t){const s={id:e,src:"",status:q.Defined};typeof t=="function"?(s.exports=t,s.type=lt.factory):s.exports=t,this.moduleManager.set(e,s)}removeModule(e){this.moduleManager.remove(e)}ensure(...e){const t=[];let s=e.length-1;const n={};typeof e[s]=="object"&&(Object.assign(n,e[s]),s--);let i=null;typeof e[s]=="function"&&(i=e[s],s--);for(let l=0;l<=s;l++)if(Array.isArray(e[l])){let u=e[l];for(let c=0;c<u.length;c++)u[c]&&t.push(this.resolvePath(u[c]))}else if(typeof e[l]=="string"){let u=e[l].split(",");for(let c=0;c<u.length;c++)u[c]&&t.push(this.resolvePath(u[c]))}const o=new In(t.length,(l,u)=>{if(o.isOK())try{typeof i=="function"&&Reflect.apply(i,{},u)}catch(c){console.error(c.message,c)}else try{console.error(l),typeof i=="function"&&Reflect.apply(i,{},[])}catch(c){console.error(c.message,c)}}),a=new He;for(let l=0;l<t.length;l++){const u=new Nn(l,t[l],n,o);this.mount(a,u)}return this}remove(...e){let t=[],s=e.length-1,n={};typeof e[s]=="object"&&(Object.assign(n,e[s]),s--);let i=null;typeof e[s]=="function"&&(i=e[s],s--);for(let o=0;o<=s;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 s=this.getFileNamePostfix(t.src);if(s==="js"||s.length===0){let n=t.params.jsPoint;n||(n=this.head),this.mountJS(e,t,n);return}else if(s==="css"){let n=t.params.cssPoint;n||(n=this.head),this.mountCSS(e,t,n);return}}mountCSS(e,t,s){e.post(n=>{const i=t.src,o=this.moduleManager.get(i);if(o&&(o.status==q.Defined||o.status==q.Loaded)&&o.exports){o.type===lt.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=Ve(),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{s.removeChild(l)}catch(f){console.error(f.message,f)}l.onload=null,l.onerror=null,t.progress.work(!1,t.index,null),n.reject()};else{const f={timeout:this.options.timeout??3e3,time:0,success:()=>{t.progress.work(!0,t.index,t.src),n.resolve()},error:()=>{try{s.removeChild(l)}catch(h){console.error(h.message,h)}t.progress.work(!1,t.index,null),n.resolve()}};setTimeout(()=>{fr(l,f)},1)}let c=a.getElementById(i);c&&c.parentNode&&c.parentNode.removeChild(c),l.rel="stylesheet",l.type="text/css",l.id=i,l.href=i,s.appendChild(l)})}mountJS(e,t,s){e.post(n=>{const i=t.src;let o=this.moduleManager.get(i);if(o&&(o.status==q.Defined||o.status==q.Loaded)){if(o.exports){o.type===lt.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:q.Loading},this.moduleManager.set(i,o);const l=Ve().createElement("script");if("onload"in l)l.onload=()=>{l.onload=null,l.onerror=null,o.status===q.Loading&&(o.status=q.Loaded,t.progress.work(!0,t.index,i)),n.resolve()},l.onerror=()=>{try{s.removeChild(l)}catch(f){console.error(f.message,f)}l.onload=null,l.onerror=null,this.moduleManager.remove(i),t.progress.work(!1,t.index,null),n.resolve()};else{const f=l;f.onreadystatechange=()=>{/loaded|complete/.test(f.readyState)&&(f.onreadystatechange=null,o.status==q.Loading&&(o.status=q.Loaded,t.progress.work(!0,t.index,i)),n.resolve())}}l.defer=!0,l.src=i;const c=$();c.define=this.createDefine(o,t),s.appendChild(l)})}unmount(e,t={}){const s=Ve(),n=this.getFileNamePostfix(e);if(n==="js"||n.length===0){const i=s.querySelector(`script[src="${e}"]`);i&&i.parentNode&&i.parentNode.removeChild(i),this.moduleManager.remove(e);return}else if(n==="css"){const i=s.querySelector(`style[href="${e}"]`);i&&i.parentNode&&i.parentNode.removeChild(i);return}}trimEmptyElement(e){let t=[];for(let s=0;s<e.length;s++){if(e[s]===void 0||e[s]===null)continue;const n=e[s].trim();n.length!==0&&t.push(n)}return t}createDefine(e,t){const s=this,n=function(...i){e.status=q.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=s.trimEmptyElement(i[0]),o=void 0):a=void 0):(o=i[0],a=s.trimEmptyElement(i[1]),l=i[2]),o&&(e.id=o,s.options.alias[o]=e.src),a&&a.length>0?s.ensure(a,(...c)=>{const f=c.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,f);h&&typeof h=="object"&&(e.exports=h)}else e.exports=l;e.status=q.Defined,t.progress.work(!0,t.index,e.exports)}):(typeof l=="function"?e.exports=Reflect.apply(l,e,[]):e.exports=l,e.status=q.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 s=this.createSearch(this.query);return e.indexOf("?")==-1?(t!=="js"&&t!=="css"&&(e+=".js"),s.length>0&&(e+=`?${s}`)):s.length>0&&(e+=`&${s}`),e}catch(t){throw console.error(`resolve path[${e}] fail`,t),t}}createSearch(e){let t="";if(e){for(let s in e){let n=`${e[s]}`;t+=`${encodeURIComponent(s)}=${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 s=e.lastIndexOf(".",t);return s==-1?"":e.substring(s+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 s=0;s<t.length;s++){const n=t[s];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`${wt()}${e.slice(1)}`;if(e.indexOf("./")==0)return`${wt()}${e.slice(2)}`;if(e.indexOf("//")==0)return`${$().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`${wt()}${e}`}}function fr(r,e){let t=r.sheet,s=!1;if(e.isOldWebKit)t&&(s=!0);else if(t)try{t.cssRules&&(s=!0)}catch(n){n.name==="NS_ERROR_DOM_SECURITY_ERR"&&(s=!0)}setTimeout(()=>{e.time+=20,s?e.success():e.timeout>e.timeout?e.error():fr(r,e)},20)}class In{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,s){if(this.status=e,this.status===!0&&(this.lastIndex!==t&&this.size--,this.lastIndex=t,this.values.push(s)),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 Nn{index;src;params;progress;constructor(e,t,s,n){this.index=e,this.src=t,this.params=s,this.progress=n}}const is=Symbol("fk"),os=Symbol("fbk"),ls=Symbol("fepk");function Dn(r={}){const e=new mn(r),t=new Ut,s=new Bt,n=new Ts,i={get router(){return e},get bus(){return t},get Bus(){return Ut},get EventProxy(){return Bt},get eventproxy(){return s},get EventChain(){return He},get Require(){return Ts},get require(){return n},get extend(){return F},get clone(){return yt},get isESModule(){return Gt},install(o){o.provide(dt,e),o.provide(is,i),o.provide(os,t),o.provide(ls,s),o.component(gn,Wt),o.component(vn,On),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 s}}),o.config.globalProperties.$fox_on=function(a,l,u=!1){s.on(a,l,u)},o.config.globalProperties.$fox_off=function(a,l){s.off(a,l)},o.config.globalProperties.$fox_once=function(a,l){s.once(a,l)},o.config.globalProperties.$fox_all=function(...a){let l=s;Reflect.apply(l.all,l,a)},o.config.globalProperties.$fox_trigger=function(a,...l){let u=s;Reflect.apply(u.trigger,u,[a,...l])},o.config.globalProperties.$fox_emit=function(a,...l){let u=s;Reflect.apply(u.trigger,u,[a,...l])},o.mixin({computed:{$route(){return ts(this)}}}),e.init()}};return i}function as(r){return r?r.$router:g.inject(dt)}function Hn(r){return r||(r=g.getCurrentInstance()?.proxy??void 0),r?ts(r):null}function Un(r){return r?r.$fox:g.inject(is)}function Bn(r){return r?r.$bus:g.inject(os)}function Vn(r){return r?r.$eventProxy:g.inject(ls)}function Jn(r){const e=as(),t=(s,n,i)=>{try{Reflect.apply(r,{},[s,n])}catch(o){console.error(o)}i()};e.beforeEach(t),g.onUnmounted(()=>{e.removeBeforeEach(t)})}function Wn(r){const e=as(),t=(s,n,i)=>{try{Reflect.apply(r,{},[s,n])}catch(o){console.error(o)}i()};e.afterEach(t),g.onUnmounted(()=>{e.removeAfterEach(t)})}exports.Bus=Ut;exports.EventChain=He;exports.EventProxy=Bt;exports.FoxBeforeEnter=Ds;exports.FoxBeforeLeave=Us;exports.FoxEnter=Hs;exports.FoxLeave=Bs;exports.FoxLeaveEnd=ut;exports.OperationType=E;exports.Route=S;exports.clone=yt;exports.createFox=Dn;exports.createMemoryHistory=Zs;exports.createWebHashHistory=Ys;exports.createWebHistory=hn;exports.deleteContextValue=Dr;exports.extend=F;exports.foxBusKey=os;exports.foxEventProxyKey=ls;exports.foxKey=is;exports.injectContextValue=es;exports.isArray=yr;exports.isDate=mr;exports.isESModule=Gt;exports.isEqual=Ht;exports.isFunction=x;exports.isMap=dr;exports.isNil=Ue;exports.isObject=_s;exports.isPlainObject=Ks;exports.isPromise=wr;exports.isSet=pr;exports.isString=gr;exports.isSymbol=vr;exports.onAfterRouteUpdate=Wn;exports.onBeforeRouteUpdate=Jn;exports.onFoxActivated=Jr;exports.onFoxInactivated=Wr;exports.provideContextValue=Nr;exports.rawState=qr;exports.reactiveState=_r;exports.sessionKey=ne;exports.shallowReactiveState=Kr;exports.toBoolean=Xt;exports.toNumber=Sr;exports.toTypeString=ht;exports.typeOf=Dt;exports.useBus=Bn;exports.useEventProxy=Vn;exports.useFox=Un;exports.useRoute=Hn;exports.useRouter=as;
|
package/libs/index.esm.d.ts
CHANGED
|
@@ -3,7 +3,6 @@ import { ComponentInternalInstance } from 'vue';
|
|
|
3
3
|
import { ComponentPublicInstance } from 'vue';
|
|
4
4
|
import { InjectionKey } from 'vue';
|
|
5
5
|
import { Ref } from 'vue';
|
|
6
|
-
import { Require } from './require';
|
|
7
6
|
|
|
8
7
|
declare const _addRouteRecorder: unique symbol;
|
|
9
8
|
|
|
@@ -336,7 +335,7 @@ export declare class EventProxy {
|
|
|
336
335
|
* @param callback
|
|
337
336
|
* @returns
|
|
338
337
|
*/
|
|
339
|
-
off(key: string, callback
|
|
338
|
+
off(key: string, callback?: Callback): EventProxy;
|
|
340
339
|
/**
|
|
341
340
|
* 绑定事件
|
|
342
341
|
* @param key
|
|
@@ -351,7 +350,7 @@ export declare class EventProxy {
|
|
|
351
350
|
* @param callback
|
|
352
351
|
* @returns
|
|
353
352
|
*/
|
|
354
|
-
unbind(key: string, callback
|
|
353
|
+
unbind(key: string, callback?: Callback): EventProxy;
|
|
355
354
|
/**
|
|
356
355
|
* 绑定一次性触发函数
|
|
357
356
|
* @param key
|
|
@@ -596,7 +595,7 @@ export declare const isMap: (val: unknown) => val is Map<any, any>;
|
|
|
596
595
|
* @param val
|
|
597
596
|
* @returns
|
|
598
597
|
*/
|
|
599
|
-
export declare const isNil: (val: unknown) => val is null;
|
|
598
|
+
export declare const isNil: (val: unknown) => val is null | undefined;
|
|
600
599
|
|
|
601
600
|
/**
|
|
602
601
|
* 是否为object
|
|
@@ -895,6 +894,154 @@ declare const _removeRouteRecorder: unique symbol;
|
|
|
895
894
|
|
|
896
895
|
declare const _removeView: unique symbol;
|
|
897
896
|
|
|
897
|
+
/**
|
|
898
|
+
* AMD加载器
|
|
899
|
+
*/
|
|
900
|
+
declare class Require {
|
|
901
|
+
/**
|
|
902
|
+
* module manager
|
|
903
|
+
*/
|
|
904
|
+
private moduleManager;
|
|
905
|
+
/**
|
|
906
|
+
* 参数配置
|
|
907
|
+
*/
|
|
908
|
+
private options;
|
|
909
|
+
/**
|
|
910
|
+
* 设置路径映射
|
|
911
|
+
*/
|
|
912
|
+
set paths(paths: Record<string, string>);
|
|
913
|
+
/**
|
|
914
|
+
* 获取路径映射
|
|
915
|
+
*/
|
|
916
|
+
get paths(): Record<string, string>;
|
|
917
|
+
/**
|
|
918
|
+
* 设置路径别名
|
|
919
|
+
*/
|
|
920
|
+
set alias(alias: Record<string, string>);
|
|
921
|
+
/**
|
|
922
|
+
* 获取路径别名
|
|
923
|
+
*/
|
|
924
|
+
get alias(): Record<string, string>;
|
|
925
|
+
/**
|
|
926
|
+
* 设置不需要解析路径或判断函数
|
|
927
|
+
*/
|
|
928
|
+
set naturePaths(nature: string[] | {
|
|
929
|
+
(path: string): boolean;
|
|
930
|
+
});
|
|
931
|
+
/**
|
|
932
|
+
* 获取不需要解析路径或判断函数
|
|
933
|
+
*/
|
|
934
|
+
get naturePaths(): string[] | {
|
|
935
|
+
(path: string): boolean;
|
|
936
|
+
};
|
|
937
|
+
/**
|
|
938
|
+
* 设置超时时间
|
|
939
|
+
*/
|
|
940
|
+
set timeout(t: number);
|
|
941
|
+
/**
|
|
942
|
+
* 获取超时时间
|
|
943
|
+
*/
|
|
944
|
+
get timeout(): number;
|
|
945
|
+
/**
|
|
946
|
+
* 设置query
|
|
947
|
+
*/
|
|
948
|
+
private _query?;
|
|
949
|
+
set query(val: Record<string, string | number> | undefined);
|
|
950
|
+
get query(): Record<string, string | number> | undefined;
|
|
951
|
+
/**
|
|
952
|
+
* 获取document head
|
|
953
|
+
*/
|
|
954
|
+
get head(): any;
|
|
955
|
+
/**
|
|
956
|
+
* 构造函数
|
|
957
|
+
*/
|
|
958
|
+
constructor();
|
|
959
|
+
/**
|
|
960
|
+
* 安装module
|
|
961
|
+
*/
|
|
962
|
+
setModule(id: string, exports: Record<string, any> | {
|
|
963
|
+
(): Record<string, any>;
|
|
964
|
+
}): void;
|
|
965
|
+
/**
|
|
966
|
+
* 移除module
|
|
967
|
+
*/
|
|
968
|
+
removeModule(id: string): void;
|
|
969
|
+
/**
|
|
970
|
+
* 加载
|
|
971
|
+
* @params args
|
|
972
|
+
*/
|
|
973
|
+
ensure(...args: any[]): Require;
|
|
974
|
+
/**
|
|
975
|
+
* 卸载
|
|
976
|
+
*/
|
|
977
|
+
remove(...args: any): Require;
|
|
978
|
+
/**
|
|
979
|
+
* 加载
|
|
980
|
+
*
|
|
981
|
+
* @param chain
|
|
982
|
+
* @param taskNode
|
|
983
|
+
*/
|
|
984
|
+
private mount;
|
|
985
|
+
/**
|
|
986
|
+
* 加载css
|
|
987
|
+
* @param chain
|
|
988
|
+
* @param task
|
|
989
|
+
* @param point
|
|
990
|
+
*/
|
|
991
|
+
private mountCSS;
|
|
992
|
+
/**
|
|
993
|
+
* 加载js
|
|
994
|
+
*
|
|
995
|
+
* @param chain
|
|
996
|
+
* @param task
|
|
997
|
+
* @param point
|
|
998
|
+
*/
|
|
999
|
+
private mountJS;
|
|
1000
|
+
/**
|
|
1001
|
+
* 卸载资源
|
|
1002
|
+
*/
|
|
1003
|
+
private unmount;
|
|
1004
|
+
/**
|
|
1005
|
+
* 去掉空元素
|
|
1006
|
+
*/
|
|
1007
|
+
private trimEmptyElement;
|
|
1008
|
+
/**
|
|
1009
|
+
* 创建define函数
|
|
1010
|
+
* @param module
|
|
1011
|
+
* @param task
|
|
1012
|
+
* @returns
|
|
1013
|
+
*/
|
|
1014
|
+
private createDefine;
|
|
1015
|
+
/**
|
|
1016
|
+
* 解析路径
|
|
1017
|
+
* @param uri
|
|
1018
|
+
* @returns
|
|
1019
|
+
*/
|
|
1020
|
+
private resolvePath;
|
|
1021
|
+
/**
|
|
1022
|
+
* 创建search字符串
|
|
1023
|
+
*/
|
|
1024
|
+
private createSearch;
|
|
1025
|
+
/**
|
|
1026
|
+
* 获取文件名后缀
|
|
1027
|
+
* @param name
|
|
1028
|
+
* @returns {string}
|
|
1029
|
+
*/
|
|
1030
|
+
private getFileNamePostfix;
|
|
1031
|
+
/**
|
|
1032
|
+
* 是否为不处理的路径
|
|
1033
|
+
* @param uri
|
|
1034
|
+
* @return
|
|
1035
|
+
*/
|
|
1036
|
+
private isNaturePath;
|
|
1037
|
+
/**
|
|
1038
|
+
* 解析路径
|
|
1039
|
+
* @param uri
|
|
1040
|
+
* @param replace
|
|
1041
|
+
*/
|
|
1042
|
+
private parserPath;
|
|
1043
|
+
}
|
|
1044
|
+
|
|
898
1045
|
declare const _resolveComponent: unique symbol;
|
|
899
1046
|
|
|
900
1047
|
declare const resolveRoute: unique symbol;
|