@fox-js/fox 3.1.1-24 → 3.1.1-26
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 +1 -1
- package/libs/index.esm.d.ts +109 -45
- package/libs/index.esm.js +2615 -2617
- package/libs/index.umd.js +1 -1
- package/package.json +3 -2
package/libs/index.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(m,v){typeof exports=="object"&&typeof module<"u"?v(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],v):(m=typeof globalThis<"u"?globalThis:m||self,v(m.Fox={},m.Vue))})(this,function(m,v){Object.defineProperty(m,Symbol.toStringTag,{value:"Module"});var me=typeof window<"u",K=function(){return window},Ne=function(){return window.document};function Ue(e,t,r,s=!1){e.addEventListener?e.addEventListener(t,r,s):e.attachEvent?e.attachEvent(`on${t}`,r):e[`on${t}`]=r}function pt(e,t,r){e.removeEventListener?e.removeEventListener(t,r):e.detachEvent?e.detachEvent(`on${t}`,r):e[`on${t}`]=null}var Ve=(e,t,r)=>{t=t??{bubbles:!1,cancelable:!1,detail:void 0};const s=document.createEvent("Events");let i=!0,n=!0;for(let a in t)a==="bubbles"?i=!!t[a]:a==="cancelable"?n=!!t[a]:s[a]=t[a];s.initEvent(e,i,n),(r??document).dispatchEvent(s)},gt=Array.isArray,cs=e=>We(e)==="[object Map]",hs=e=>We(e)==="[object Set]",ys=e=>e instanceof Date,S=e=>typeof e=="function",ds=e=>typeof e=="string",ms=e=>typeof e=="symbol",lr=e=>e!==null&&typeof e=="object",vs=e=>lr(e)&&S(e.then)&&S(e.catch),ve=e=>e==null,ps=Object.prototype.toString,We=e=>ps.call(e),ar=e=>We(e)==="[object Object]",gs=typeof Symbol=="function"&&typeof Symbol.toStringTag=="symbol";function Je(e){return e.__esModule||gs&&e[Symbol.toStringTag]==="Module"}var bs=typeof Promise<"u"&&Promise.toString().indexOf("[native code]")!==-1;function q(...e){let t=e[0]!==void 0&&e[0]!==null?e[0]:{},r=1,s=e.length,i=!1;for(typeof t=="boolean"&&(i=t,t=e[r]??{},r++),typeof t!="object"&&(t={});r<s;r++)if(e[r]!==null&&e[r]!==void 0){let n=e[r];for(let a in n){let l=t[a],o=n[a];if(l!==o)if(i===!0&&o&&typeof o=="object"){let u;Array.isArray(o)?u=l&&Array.isArray(l)?l:[]:u=l&&typeof l=="object"?l:{},t[a]=q(i,u,o)}else o!==void 0&&(t[a]=o)}}return t}function ur(e,t,r=!1){if(typeof t!="object")return{};typeof e!="object"&&(e={});for(let s of Reflect.ownKeys(t)){let i=e[s],n=t[s];if(i!==n)if(typeof n=="object"){if(!Array.isArray(n)&&!ar(n))continue;i=ur(i,n,r),e[s]=i}else{if(typeof n=="function")continue;e[s]=n}}return e}var _e=class nr{static seed=new Date().getTime();static get(){let t=++nr.seed;return t>=Number.MAX_VALUE&&(nr.seed=0),t}},bt=bs?Promise.resolve():null;function Fe(e,...t){bt!==null?t&&t.length>0?bt.then(()=>{e(t)}):bt.then(e):t&&t.length>0?setTimeout(()=>{e(t)}):setTimeout(e)}function wt(e){return e==null?!1:typeof e=="boolean"?e:typeof e=="string"?e.toLocaleLowerCase()==="true":!!e}function ws(e){return typeof e=="number"?e:Number(e)}var Rs={"[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 Rt(e){let t=Object.prototype.toString.call(e);return e==null?String(e):Rs[t]||"object"}function St(e,t){if(e==t)return!0;if(e===void 0||t===void 0)return!1;let r=Rt(e);if(r!==Rt(t))return!1;if(r==="object"){let s=Object.keys(e),i=Object.keys(t);if(s.length!==i.length)return!1;for(let n=0;n<s.length;n++){let a=s[n],l=e[a],o=t[a];if(!St(l,o))return!1}return!0}else if(r==="array"){if(e.length!==t.length)return!1;for(let s=0;s<e.length;s++){let i=e[s],n=t[s];if(!St(i,n))return!1}return!0}return!1}var fr=e=>{const t={};for(let r of Reflect.ownKeys(e)){let s=e[r];s&&!Array.isArray(s)&&typeof s=="object"&&(s=fr(s)),typeof r=="symbol"?t[String(r)]=s:t[r]=s}return t},Ss=/^Symbol\((.*)\)$/,cr=e=>{const t={};for(let r of Reflect.ownKeys(e)){let s=e[r];s&&!Array.isArray(s)&&typeof s=="object"&&(s=cr(s));const i=Ss.exec(r);if(i&&i[1]){const n=Symbol.for(i[1]);t[n]=s}else t[r]=s}return t};function hr(e,t){let r=null;return function(...s){r&&clearTimeout(r),r=setTimeout(()=>{r=null,Reflect.apply(e,null,[...s])},t)}}var yr=Symbol("idKey"),oe=Symbol("valueKey"),x=Symbol("childrenKey"),V=Symbol("growKey"),dr=class{[V]=!0;[yr];[oe]=(0,v.ref)();[x]=new Map;constructor(e){this[yr]=e}},xs=class{get(e,t){if(t=="value")return e[oe].value;if(t==="grow")return e[V];let r=e[x].get(t);if(r)return Ce(r);if(e[V])return r=Pt(t),r[V]=e[V],e[x].set(t,r),Ce(r)}set(e,t,r){return t=="value"?(e[oe].value=r,!0):t==="grow"?(e[V]=wt(r),!0):r==null?(e[x].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[x].delete(t),!0)}},xt="__proxy__";function Pt(e){const t=new dr(e);return Reflect.set(t,xt,new Proxy(t,new xs)),t}function Ce(e){return Reflect.get(e,xt)}var Ps=class{name="";persistPolicy="memory";storage;initFlag=!1;state={};constructor(e={},t){if(e.persistPolicy&&e.persistPolicy!=="memory"&&ve(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||this.persistPolicy==="memory")return null;let e=null;if(this.persistPolicy==="custom")e=this.storage;else if(me){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}`,s=t.getItem(r);if(s){const i=JSON.parse(s);Object.assign(this.state,i),Reflect.ownKeys(this.state).forEach(n=>{if(typeof n!="string")return;const a=this.state[n],l=n.split(/\//g);l.push(a),Reflect.apply(e.put,e,l)})}}put(e){if(this.initFlag&&this.persistPolicy!=="memory")try{const t=e.length,r=e.slice(0,t-1).join("/"),s=e[t-1];this.state[r]=s,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("/"),s={};Reflect.ownKeys(this.state).forEach(i=>{typeof i=="string"&&(i===r||i.startsWith(r)||(s[i]=this.state[i]))}),this.state=s,this.saveState()}catch(t){console.error(t)}}clear(){if(this.initFlag)try{this.state={},this.removeState()}catch(e){console.error(e)}}},mr=class extends dr{_persistHandler;constructor(e={},t){super("__root__"),this._persistHandler=new Ps(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 s=0;s<t-1;s++){let i=e[s],n;r[x].has(i)?n=r[x].get(i):(n=Pt(i),r[x].set(i,n)),r=n}return r[oe].value=e[t-1],this._persistHandler.put(e),!0}get(...e){let t=e.length;if(t===0)return;let r=this;for(let s=0;s<t;s++){let i=e[s];if(r[x].has(i))r=r[x].get(i);else return}return r[oe].value}remove(...e){let t=e.length;if(t==0)return!1;let r=this;for(let i=0;i<t-1;i++){const n=e[i];if(r[x].has(n))r=r[x].get(n);else return!1}const s=e[t-1];return r[x].has(s)?(r[x].delete(s),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 n=e[i];if(r[x].has(n))r=r[x].get(n);else return!1}const s=e[t-1];return r[x].has(s)}clear(){this[x].clear(),this._persistHandler.clear()}},Es=["put","get","contains","remove","clear","_persistHandler"];function vr(e){return Es.includes(e)}var _s=class{get(e,t){if(t=="value")return e[oe].value;if(t==="grow")return e[V];if(t===x)return e[x];if(typeof t=="string"&&vr(t))return e[t];const r=String(t);let s=e[x].get(r);if(s)return Ce(s);if(e[V])return s=Pt(r),s[V]=e[V],e[x].set(r,s),Ce(s)}set(e,t,r){return t=="value"?(e[oe].value=r,!0):t==="grow"?(e[V]=wt(r),!0):vr(t)?!1:r==null?(e[x].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[x].delete(t),!0)}};function Fs(e,t){const r=new mr(e,t),s=new _s,i=new Proxy(r,s);return Reflect.set(r,xt,i),r}var Et=new Proxy(mr,{construct(e,t){const r=t[0]??{},s=t[1];return Ce(Fs(r,s))}}),_t=e=>!e||typeof e!="object"?!0:Reflect.ownKeys(e).length===0,pr=class{name="";persistPolicy="memory";storage;constructor(e={}){if(e.persistPolicy&&e.persistPolicy!=="memory"&&ve(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||this.persistPolicy==="memory")return null;let e=null;if(this.persistPolicy==="custom")e=this.storage;else if(me){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||_t(e))return;const r=`_state_${this.name}`,s=JSON.stringify(e??{});t.setItem(r,s)}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}`,s=t.getItem(r);if(s){const i=JSON.parse(s);Object.assign(e,i)}}};function gr(e,t,r){const s=new pr(r);s.restore(t);const i=l=>{const o=(0,v.toRaw)(l),u={};for(let f in o){const c=o[f];ve(c)||(u[f]=c)}_t(u)?s.removeState():s.saveState(u)};let n=null;r&&r.debounce===!1?n=i:n=hr(i,r&&r.debounceDelay?r.debounceDelay:250);const a=e?(0,v.shallowReactive)(t):(0,v.reactive)(t);return(0,v.effectScope)(!0).run(()=>{(0,v.watch)(a,l=>{const o=(0,v.toRaw)(l);n(o)})}),a}function Cs(e,t){return gr(!1,e,t)}function As(e,t){return gr(!0,e,t)}function Ks(e,t){const r=new pr(t);r.restore(e);const s=n=>{const a=(0,v.toRaw)(n),l={};for(let o in a){const u=a[o];ve(u)||(l[o]=u)}_t(l)?r.removeState():r.saveState(l)};let i=null;return t&&t.debounce===!1?i=s:i=hr(s,t&&t.debounceDelay?t.debounceDelay:250),new Proxy(e,{get(n,a){return n[a]},set(n,a,l){return n[a]=l,i(n),!0}})}function qs(e,t){return Ks(e,t)}var br="default",wr=Symbol("sync"),M=Symbol("normalizeRoute");function Rr(e){let t=!1;return function(...r){if(!t)return t=!0,Reflect.apply(e,{},r)}}function js(e){let t=e.src;return new Promise((r,s)=>{const i=Rr(l=>{Je(l)&&(l=l.default),e.component=l,console.debug("success load async module"),r()}),n=Rr(l=>{`${l}`,console.debug("reject load async module"),s(l)});let a;try{a=t(i,n)}catch(l){n(l)}if(a)if(typeof a.then=="function")a.then(i,n);else{const l=a.component;l&&typeof l.then=="function"&&l.then(i,n)}})}var $s=class{name;level;rootName;rootIndex=0;constructor(e,t,r,s){this.name=e,this.level=t,this.rootName=r,this.rootIndex=s}},ze=class fs{to;routeModel;from;data={};constructor(t,r){this.to=t,this.from=r}static from(t){const r=new fs(t.to,t.from),s=t.data??{};return q(!0,r.data,s),r}static clear(t){for(let r in t)t[r]=void 0}},P=class or{path;get fullPath(){const t=this.path??`${this.name}`;return`${this.root??"default"}!${t}`}alias;name;root;params;query;traceless;template;matched;meta;success;error;destroy;opsType;updateType;historyUpdatePolicy;viewTagAttrs;index;active;slot;static clone(t,r){let s=new or;return ur(s,t,r),s}static isSame(t,r){return!t||!r?!1:t===r?!0:t.root!==r.root||t.index!==r.index?!1:t.path&&r.path&&t.path===r.path?!0:!!(t.name&&r.name&&t.name===r.name)}static isSamePathForRoute(t,r){return!t||!r?!1:t===r||t.path&&r.path&&t.path===r.path?!0:!!(t.name&&r.name&&t.name===r.name)}static from(t){let r=new or;if(t==null)return r;let s=r;for(let n in t)s[n]=t[n];const i=Object.getOwnPropertySymbols(t);if(Array.isArray(i)&&i.length>0)for(let n of i)s[n]=t[n];return r}},Ls=class{id;name;props;src;component;constructor(e,t,r){this.id=_e.get(),this.name=e,this.src=t,typeof t!="function"&&(this.component=t),this.props=r}get isResolved(){return this.component!==void 0}resolve(){return js(this)}},Sr=class{models=[]},Ft=class{path;match;redirect;name;meta;matchedRoutes;layers=[]},C=(function(e){return e[e.Push=0]="Push",e[e.Replace=1]="Replace",e[e.Put=2]="Put",e[e.Append=3]="Append",e[e.Open=4]="Open",e})({}),xr="FoxBeforeEnter",Pr="FoxEnter",Er="FoxLeave",_r="FoxLeave",Ge="FoxLeaveEnd",Xe=Symbol("rk"),Ct=Symbol("vd"),Fr=Symbol("rv"),At=Symbol("rvi"),Cr=Symbol("pv"),Kt=Symbol("pvi"),Ae=Symbol("registerKey"),Ts=class{[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)}},le=Symbol("lc");function Qe(e,t=!1){let r=e;if(Reflect.has(r,le))return r[le];if(t){const s=new Ts;return r[le]=s,s}return null}function Ar(e,t=!1){let r=null,s=e;for(;s&&!(Reflect.has(s,le)&&(r=s[le],r));)s=s.$parent;if(!r&&t){const i=e;i&&i.$parent&&(r=Qe(i.$parent,t))}return r}function qt(e,t){let r=e;for(;r;){if(Reflect.has(r,le)){const s=r[le];if(s.has(t))return s.get(t)}r=r.$parent}return null}function Ms(e,t,r){Ar(e,!0)?.set(t,r)}function ks(e,t){Ar(e,!0)?.delete(t)}function Kr(e){if(Array.isArray(e.children)&&e.children.length>0){let t=e.children[0];if(t!=null&&t.component!=null&&t.component.proxy!=null)return Qe(t.component.proxy,!1)}return null}var Ze=Symbol("hooksKey");function Is(e){let t=e.get(Ze);t||(t=[],e.set(Ze,t))}function qr(e,t){let r=e.get(Ze);if(r!=null)for(let s=r.length-1;s>=0;s--){let i=r[s];if(i.type===t)try{Reflect.apply(i.hook,i.target,[])}catch(n){console.error(n.message,n)}}}var Ye=(function(e){return e.DEACTIVATED="da",e.ACTIVATED="a",e})({}),Bs=class{type;hook;target;constructor(e,t,r){this.target=r,this.hook=t,this.type=e}};function Os(e,t,r,s){let i=new Bs(t,r,s);return e.push(i),!0}function Ds(e,t,r,s){let i=-1;for(let n=0;n<e.length;n++){let a=e[n];if(a.type===t&&a.hook===r&&a.target===s){i=n;break}}return i!=-1?(e.splice(i,1),!0):!1}function jr(e){return(t,r)=>{let s;if(r)s=r;else{const n=(0,v.getCurrentInstance)();if(n==null||n.proxy==null){console.error("can not get current instance or proxy");return}s=n.proxy}const i=qt(s,Ze);if(i==null){console.warn("hooks context not found");return}(0,v.onUnmounted)(()=>{Ds(i,e,t,s)}),Os(i,e,t,s)}}var Hs=jr(Ye.ACTIVATED),Ns=jr(Ye.DEACTIVATED),$r=Symbol("routeKey");function Lr(e,t){e.set($r,t)}function jt(e){let t=qt(e,$r);return typeof t=="function"?t():t??null}function Tr(e,t=!1){let r=null;return t?r=e.showFromClass??e.enterFromClass:r=e.enterFromClass,r||(r=e.transitionName,r?t?`${r}-show-from`:`${r}-enter-from`:null)}function Mr(e,t=!1){let r=null;return t?r=e.showActiveClass??e.enterActiveClass:r=e.enterActiveClass,r||(r=e.transitionName,r?t?`${r}-show-active`:`${r}-enter-active`:null)}function Us(e,t=!1){let r=null;return t?r=e.showToClass??e.enterToClass:r=e.enterToClass,r||(r=e.transitionName,r?t?`${r}-show-to`:`${r}-enter-to`:null)}function kr(e,t=!1){let r=null;return t?r=e.hideFromClass??e.leaveFromClass:r=e.leaveFromClass,r||(r=e.transitionName,r?t?`${r}-hide-from`:`${r}-leave-from`:null)}function Ir(e,t=!1){let r=null;return t?r=e.hideActiveClass??e.leaveActiveClass:r=e.leaveActiveClass,r||(r=e.transitionName,r?t?`${r}-hide-active`:`${r}-leave-active`:null)}function Vs(e,t=!1){let r=null;return t?r=e.hideToClass??e.leaveToClass:r=e.leaveToClass,r||(r=e.transitionName,r?t?`${r}-hide-to`:`${r}-leave-to`:null)}function Ws(e,t=!1){let r=null;return t?r=e.beforeShow??e.beforeEnter:r=e.beforeEnter,r}function Js(e,t=!1){let r=null;return t?r=e.show??e.enter:r=e.enter,r}function zs(e,t=!1){let r=null;return t?r=e.afterShow??e.afterEnter:r=e.afterEnter,r}function Gs(e,t=!1){let r=null;return t?r=e.showCancelled??e.enterCancelled:r=e.enterCancelled,r}function Xs(e,t=!1){let r=null;return t?r=e.beforeHide??e.beforeLeave:r=e.beforeLeave,r}function Qs(e,t=!1){let r=null;return t?r=e.hide??e.leave:r=e.leave,r}function Zs(e,t=!1){let r=null;return t?r=e.afterHide??e.afterLeave:r=e.afterLeave,r}function Ys(e,t=!1){let r=null;return t?r=e.hideCancelled??e.leaveCancelled:r=e.leaveCancelled,r}function $t(e){let t,r=e.transitionDuration;return typeof r=="object"?t={enter:r.enter??-1,leave:r.leave??-1,show:r.show??-1,hide:r.hide??-1}:(typeof r=="string"&&(r=r.length==0?-1:Number(r)),t={enter:r,leave:r,show:r,hide:r}),t}function pe(e,t){e.classList.contains(t)||e.classList.add(t)}function ge(e,t){e.classList.remove(t)}var ei=me&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout;function et(e){ei(e)}function j(e,t,r){S(t)&&(e==null&&(e={}),Reflect.apply(t,e,r))}function Br(e,t,r,s=-1,i,n,a){let l=[];const o=()=>{for(let u of l)pt(t,u.type,u.listener);l=[]};if(S(n)){if(i!==void 0&&i>=0){setTimeout(()=>{Reflect.apply(n,e,[t,r,s])},i);return}const u=["animationend","transitionend",Ge],f=c=>{(c.target||c.srcElement)===c.currentTarget&&(o(),Reflect.apply(n,e,[t,r,s]))};u.forEach(c=>{Ue(t,c,f),l.push({type:c,listener:f})})}if(S(a)){const u="animationcancel",f=c=>{(c.target||c.srcElement)===c.currentTarget&&(o(),Reflect.apply(a,e,[t,r,s]))};Ue(t,u,f),l.push({type:u,listener:f})}}function tt(e){return!me||e===null?!1:e.opsType===C.Append||e.opsType===C.Open}function Or(e,t,r,s={},i,n=-1){if(t||tt(i)){const a=Tr(s,t);a&&pe(r,a);const l=Mr(s,t);l&&pe(r,l),j(e,Ws(s,t),[r,t,i,n])}}function Dr(e,t,r,s={},i,n,a,l){if(!tt(n)&&!t){S(l)&&l(e,l,[r]);return}const o=Tr(s,t),u=Mr(s,t),f=Us(s,t),c=Js(s,t),h=zs(s,t),y=Gs(s,t);if(!o&&!u&&!f&&!c){S(l)&&l(e,l,[r]);return}et(()=>{Br(e,r,n,a,i,()=>{u&&ge(r,u),f&&ge(r,f),S(h)&&j(e,h,[r,t,n,a]),S(l)&&l(e,l,[r])},()=>{S(y)&&j(e,y,[r,t,n,a])}),o&&ge(r,o),f&&pe(r,f),S(c)&&j(e,c,[r,t,n,a])})}function Hr(e,t,r,s={},i,n=-1){if(t||tt(i)){const a=kr(s,t);a&&pe(r,a);const l=Ir(s,t);l&&pe(r,l),j(e,Xs(s,t),[r,t,i,n])}}function Nr(e,t,r,s={},i,n,a,l,o){if(!tt(a)&&!t){S(o)&&j(e,o,[r]),!t&&S(n)&&n();return}const u=kr(s,t),f=Ir(s,t),c=Vs(s,t),h=Qs(s,t),y=Zs(s,t),d=Ys(s,t);if(!u&&!f&&!c&&!h){S(o)&&j(e,o,[r]),!t&&S(n)&&n();return}et(()=>{Br(e,r,a,l,i,()=>{try{f&&ge(r,f),c&&ge(r,c),S(y)&&j(e,y,[r,t,a,l]),S(o)&&j(e,o,[r])}finally{!t&&S(n)&&n()}},()=>{try{S(d)&&j(e,d,[r,t,a,l]),S(o)&&j(e,o,[r])}finally{!t&&S(n)&&n()}}),u&&ge(r,u),c&&pe(r,c),S(h)&&j(e,h,[r,t,a,l])})}function Lt(e,t,r={},s,i=-1){const n=r.mode??"default",a=$t(r);return{mode:n,persisted:!1,beforeEnter:l=>{Or(e,!1,l,r,s,i)},enter:l=>{Dr(e,!1,l,r,a.enter,s,i)},leave:(l,o)=>{Hr(e,!1,l,r,s,i),Nr(e,!1,l,r,a.leave,o,s,i,()=>{t.transition=null,t=null})},clone:l=>Lt(e,t,r,s,i)}}function Ur(e){return e.el}function ti(e,t,r={},s,i,n,a){if(n===!0){const l=Ur(t);if(l==null)return;const o=$t(r);Or(e,!0,l,r,s,i),Dr(e,!0,l,r,o.show,s,i,u=>{S(a)&&j(e,a,[u])})}else S(a)&&j(e,a,[])}function ri(e,t,r={},s,i,n,a){if(n===!0){const l=Ur(t);if(l==null)return;const o=$t(r);Hr(e,!0,l,r,s,i),Nr(e,!0,l,r,o.hide,null,s,i,u=>{S(a)&&j(e,a,[u])})}else S(a)&&j(e,a,[])}function si(e,t={}){et(()=>{for(let r=0;r<e.length;r++)Reflect.apply(e[r],t,[])})}function Vr(e,t,r={},s,i=-1){return{mode:r.mode??"default",persisted:!1,beforeEnter:n=>{Ve(xr,{},n)},enter:n=>{Ve(Pr,{},n)},leave:(n,a)=>{Ve(Er,{},n),et(()=>{const l=o=>{(o.target||o.srcElement)===o.currentTarget&&(pt(n,Ge,l),a&&Reflect.apply(a,e,[]),t.transition=null,t=null)};Ue(n,Ge,l),Ve(_r,{},n)})},clone:n=>Vr(e,t,r,s,i)}}var W=Symbol("rootKey"),J=Symbol("rootNodeKey"),ae=Symbol("parentNodeKey"),rt=Symbol("nameKey"),re=class{instance=null;model;route;active=!0;index=0;constructor(e,t,r=0,s=!0){this.route=e,this.model=t,this.index=r,this.active=s}},Ke=class{_slots;get slots(){return this._slots==null&&(this._slots=(0,v.shallowRef)([])),this._slots}get empty(){return this._slots==null||this._slots.value.length==0}[rt];[W];[J]=null;[ae]=null;get name(){return this[rt]}constructor(e,t,r){this[rt]=e,this[W]=t,r&&(this[J]=r)}},D=class{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 s=e[r];if(s.view===t.view&&(t.index==-1||s.index===t.index)&&s.level===t.level)return!0}return!1}},Tt=class{views=[]},ii=class{layers=[]};function se(e,t,r){return typeof e=="function"?Reflect.apply(e,{},[t,r]):e}function Mt(e,t){if(!e)return null;const r=e(t);return r.length===1?r[0]:r}function be(e,t){return typeof t=="function"?t(e):e}var ni=class{node;state;constructor(e,t){this.node=e,this.state=t}},st=(0,v.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},transitionDuration:{type:[String,Number,Object],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(e,t){const r=(0,v.getCurrentInstance)();if(r===null||r.proxy===null){console.error("instance or instance.proxy not exist");return}const s=e.multi===!0,i=(0,v.inject)(Xe,null),n=(0,v.inject)(Ct,0),a=(0,v.inject)(Fr,null),l=(0,v.inject)(At,-1);let o=null,u=e.modelSlot;if(u){if((0,v.provide)(Ct,n+1),(0,v.provide)(At,u.index),(0,v.provide)(Kt,u.index),!u.route){console.warn("child view render error, route not exist");return}const c=Qe(r.proxy,!0);Is(c),Lr(c,()=>u?.route??null)}else{if(i==null){console.error("router is not been injected");return}const c=e.name,h=(0,v.inject)(Cr,null),y=(0,v.inject)(Kt,0);if(o=i[wr](c,n,a,l,h,y),o===null)return;(0,v.provide)(Cr,o);const d=o[W]===!0;d&&(0,v.provide)(Fr,o),s||((0,v.provide)(At,-1),(0,v.provide)(Ct,n+1),(0,v.provide)(Kt,-1),d&&Lr(Qe(r.proxy,!0),()=>{const p=o.slots.value;return p.length>0?p[0].route:null}))}const f={value:new Map};return(0,v.onUnmounted)(()=>{if(f.value&&f.value.clear(),u){const c=u;c.route=null,c.model=null,c.instance=null,u=void 0}}),()=>{if(s){const c=new Map,h=[],y=o?.slots.value,d=[];for(let w=0;w<y.length;w++){const b=y[w],T=`${e.name}_${b.index}`,I=se(e.transition,b.route,w)??!0,De={modelSlot:b};let B;t.slots.default?B=(0,v.h)(st,De,{default:t.slots.default}):B=(0,v.h)(st,De);const L={},de=se(e.viewClass,b.route,w);typeof de=="string"&&de.length>0&&(L[de]=!0);const te=se(e.viewActiveClass,b.route,w),O=se(e.viewInactiveClass,b.route,w),ee=f.value.get(T);if(typeof te=="string"&&te.length>0&&(L[te]=b.active),typeof O=="string"&&O.length>0&&(L[O]=!b.active),ee&&b.active!==ee.state){const vt=ee.node;b.active?d.unshift(()=>{const ir=()=>{let He=Kr(vt);He!=null&&qr(He,Ye.ACTIVATED)};ti(r,vt,e,b.route,w,I,ir)}):d.push(()=>{const ir=()=>{const He=Kr(vt);He!=null&&qr(He,Ye.DEACTIVATED)};ri(r,vt,e,b.route,w,I,ir)})}const X={class:L,key:T},Q=se(e.viewTagProps,b.route,w);Q!==null&&typeof Q=="object"&&q(!0,X,be(Q,i?.propsFilter)),b.route?.viewTagAttrs&&typeof b.route?.viewTagAttrs=="object"&&q(!0,X,be(b.route.viewTagAttrs,i?.propsFilter));const Ee=(0,v.h)(se(e.viewTag,b.route,w),X,{default:()=>[B]});c.set(T,new ni(Ee,b.active)),f.value.delete(T),I===!0?Ee.transition=Lt(r,Ee,e,b.route,w):I==="custom"&&(Ee.transition=Vr(r,Ee,e,b.route,w)),h.push(Ee)}f.value=c,si(d,r);const p=se(e.tag,null,-1),R={};return Object.assign(R,t.attrs),(0,v.h)(p,R,{default:()=>h})}else if(u!=null){const c=u.model,h={};c.props&&(typeof c.props=="object"?q(!1,h,be(c.props,i?.propsFilter)):c.props===!0&&typeof u.route?.params=="object"&&q(!1,h,be(u.route.params,i?.propsFilter)));const y=(0,v.h)(c.component,h);return Mt(t.slots.default,{Component:y,route:u.route})??y}else{const c=o.slots.value;if(c.length>0){const h=c[0],y=h.route??(r.proxy&&jt(r.proxy))??null,d=h.model,p={};d.props&&(typeof d.props=="object"?q(!1,p,be(d.props,i?.propsFilter)):d.props===!0&&typeof y?.params=="object"&&q(!1,p,be(y.params,i?.propsFilter)));const R=(0,v.h)(d.component,p);return(se(e.transition,y,-1)??!0)&&(R.transition=Lt(r,R,e,y,-1)),Mt(t.slots.default,{Component:R,route:y})??R}else return Mt(t.slots.fallback,{})}}}});function oi(e){if(!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)&&!e.defaultPrevented&&!(e.button!=null&&e.button!==0)){if(e.currentTarget&&e.currentTarget.getAttribute){const t=e.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(t))return}return e.preventDefault&&e.preventDefault(),!0}}function li(e,t){return e==null||t==null?!1:!!(e===t||e.path&&e.path===t.path||e.name&&e.name===t.name)}function ai(e,t){return e==null||t==null?!1:!!(e.path&&t.path&&t.path.startsWith(e.path)||e.name&&e.name==t.name)}function we(e,t){return typeof e=="function"?Reflect.apply(e,{},[t]):e}var Wr=(0,v.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(e,t){const r=(0,v.inject)(Xe,null);return()=>{let s=we(e.to,null),i=we(e.tag,s);if(i==null){console.warn("can not resolve link tag");return}let n=null,a=null;r!==null&&(n=r[M](s),e.root&&(n.root=e.root),a=r.currentRoute.value);let l={},o=we(e.activeClass,n);if(typeof o=="string"&&o.length>0&&(l[o]=ai(n,a)),we(e.exact,n)===!0){let c=we(e.exactActiveClass,n);typeof c=="string"&&c.length>0&&(l[c]=li(n,a))}let u={class:l};(i==="a"||i==="A")&&(u.href=n?.path??n?.name??"#"),q(!0,u,t.attrs);let f=we(e.event,n);if(typeof f=="string"){const c=h=>{if(r==null){console.warn("router is not been injected");return}if(n==null){console.warn("route is not been resolved");return}oi(h)&&r.to(n)};u[f]=c}return(0,v.h)(i,u,t.slots)}}}),_=(function(e){return e.Busy="Busy",e.Free="Free",e.Reject="Reject",e.Exception="Exception",e.Finished="Finished",e})(_||{}),H=Symbol("chainKey"),k=Symbol("cursorKey"),kt=Symbol("$persistentModeKey"),A=Symbol("statusKey"),Z=Symbol("argsKey"),it=Symbol("exArgsKey"),Re=Symbol("successFnsKey"),qe=Symbol("errorFnsKey"),ie=Symbol("sessionKey"),Y=Symbol("_go"),je=class{[H]=[];[k]=0;[kt]=!1;[A]=_.Free;[Z]=[];[it]=[];[Re]=[];[qe]=[];[ie];get session(){return this[ie]}constructor(e,t=!1){this[ie]=e,this[kt]=t}[Y](e,...t){let r=this[A];if(this[A]=_.Busy,this[k]+=e,this[k]<0&&(this[k]=0),this[Z]=t,r===_.Exception||r===_.Reject){let n=[{session:this[ie]},...this[it]];for(;this[qe].length>0;)try{let a=this[qe].shift();typeof a=="function"&&Fe(()=>{Reflect.apply(a,{},n)})}catch(a){console.error(a.message,a)}return this[A]=r,this[H]=[],this[k]=0,this}else if(r===_.Finished||this[k]>=this[H].length){let n=[{session:this[ie]},...this[Z]];for(;this[Re].length>0;){let a=this[Re].shift();typeof a=="function"&&Fe(()=>{Reflect.apply(a,{},n)})}return this[A]=_.Free,this}if(this[k]>=this[H].length)return this[A]=_.Free,this;let s=this[H][this[k]];this[kt]||(this[H].splice(0,this[k]+1),this[k]=-1);let i=this[k]+1;try{let n=!1,a={go:(l,...o)=>{n||(n=!0,Reflect.apply(this[Y],this,[l,...o]))},resolve:(...l)=>{n||(n=!0,Reflect.apply(this[Y],this,[1,...l]))},reject:(...l)=>{n||(n=!0,Reflect.apply(this.reject,this,[...l]))},insert:l=>{n||(this[H].splice(i,0,l),i++)},session:this[ie]};Fe(()=>{Reflect.apply(s,{},[a,...this[Z]])})}catch(n){this.throw(n)}return this}go(e,...t){return Reflect.apply(this[Y],this,[e,...t])}finish(...e){return this[A]=_.Finished,this[Z]=e,Reflect.apply(this[Y],this,[0])}reject(...e){return this[A]=_.Reject,this[it]=e,Reflect.apply(this[Y],this,[0])}throw(...e){return this[A]=_.Exception,this[it]=e,Reflect.apply(this[Y],this,[0])}reset(...e){this[A]=_.Busy,this[Z]=e,this[H]=[],this[k]=0;let t=[{session:this[ie]},...this[Z]];for(;this[Re].length>0;){let r=this[Re].shift();Fe(()=>{Reflect.apply(r,this,t)})}return this[A]=_.Free,this}post(e){return this[A]===_.Reject||this[A]===_.Exception?this:(Array.isArray(e)?this[H]=[...this[H],...e]:this[H].push(e),this[A]===_.Busy?this:(Reflect.apply(this[Y],this,[0,...this[Z]]),this))}wait(e,t){return e&&typeof e=="function"&&this[Re].push(e),t&&typeof t=="function"&&this[qe].push(t),this[A]===_.Busy?this:(Reflect.apply(this[Y],this,[0,...this[Z]]),this)}exception(e){return e&&typeof e=="function"&&this[qe].push(e),this[A]===_.Busy?this:Reflect.apply(this[Y],this,[0,...this[Z]])}isFinish(){return this[A]==_.Reject||this[A]==_.Free&&this[k]>=this[H].length}},nt=(function(e){return e[e.limitless=0]="limitless",e[e.once=1]="once",e})(nt||{}),Se=Symbol("registerKey"),ui=class{policy;callback;constructor(e,t){this.callback=e,this.policy=t}},It=class{[Se]=new Map;constructor(){}on(e,t,r=!1){let s=this[Se].get(e);s||(s=new Array,this[Se].set(e,s));let i=new ui(t,r===!0?nt.once:nt.limitless);return s.push(i),this}off(e,t){if(!t)return this[Se].delete(e),this;let r=this[Se].get(e);if(r){for(let s=0;s<r.length;s++)if(r[s].callback===t){r.splice(s,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 s=t-1,i=new Array(s),n=[].splice.call(e,0,s);for(let a=0;a<n.length;a++)this.once(n[a],l=>{i[a]=l,s-=1,s==0&&Reflect.apply(r,{},i)});return this}emit(e,...t){let r=this[Se].get(e);if(!r)return this;for(let s=0;s<r.length;){let i=r[s];if(i.policy==nt.once?r.splice(s,1):s++,typeof i.callback=="function")try{Fe(()=>{Reflect.apply(i.callback,{},t)})}catch(n){console.error(n.message,n)}}return this}trigger(e,...t){return Reflect.apply(this.emit,this,[e,...t])}},ue=(function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.Group=2]="Group",e})({}),F=(function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.ParamRegExp=2]="ParamRegExp",e[e.ParamRegExpEnd=3]="ParamRegExpEnd",e[e.EscapeNext=4]="EscapeNext",e})(F||{}),fi={type:ue.Static,value:""},ci=/[a-zA-Z0-9_]/;function hi(e){if(!e)return[[]];if(e==="/")return[[fi]];if(!e.startsWith("/"))throw new Error(`Invalid path "${e}"`);function t(y){throw new Error(`ERR (${r})/"${u}": ${y}`)}let r=F.Static,s=r;const i=[];let n;function a(){n&&i.push(n),n=[]}let l=0,o,u="",f="";function c(){u&&(r===F.Static?n.push({type:ue.Static,value:u}):r===F.Param||r===F.ParamRegExp||r===F.ParamRegExpEnd?(n.length>1&&(o==="*"||o==="+")&&t(`A repeatable param (${u}) must be alone in its segment. eg: '/:ids+.`),n.push({type:ue.Param,value:u,regexp:f,repeatable:o==="*"||o==="+",optional:o==="*"||o==="?"})):t("Invalid state to consume buffer"),u="")}function h(){u+=o}for(;l<e.length;){if(o=e[l++],o==="\\"&&r!==F.ParamRegExp){s=r,r=F.EscapeNext;continue}switch(r){case F.Static:o==="/"?(u&&c(),a()):o===":"?(c(),r=F.Param):h();break;case F.EscapeNext:h(),r=s;break;case F.Param:o==="("?r=F.ParamRegExp:ci.test(o)?h():(c(),r=F.Static,o!=="*"&&o!=="?"&&o!=="+"&&l--);break;case F.ParamRegExp:o===")"?f[f.length-1]=="\\"?f=f.slice(0,-1)+o:r=F.ParamRegExpEnd:f+=o;break;case F.ParamRegExpEnd:c(),r=F.Static,o!=="*"&&o!=="?"&&o!=="+"&&l--,f="";break;default:t("Unknown state");break}}return r===F.ParamRegExp&&t(`Unfinished custom RegExp for param "${u}"`),c(),a(),i}var Jr="[^/]+?",yi={sensitive:!1,strict:!1,start:!0,end:!0},z=(function(e){return e[e._multiplier=10]="_multiplier",e[e.Root=90]="Root",e[e.Segment=40]="Segment",e[e.SubSegment=30]="SubSegment",e[e.Static=40]="Static",e[e.Dynamic=20]="Dynamic",e[e.BonusCustomRegExp=10]="BonusCustomRegExp",e[e.BonusWildcard=-50]="BonusWildcard",e[e.BonusRepeatable=-20]="BonusRepeatable",e[e.BonusOptional=-8]="BonusOptional",e[e.BonusStrict=.7000000000000001]="BonusStrict",e[e.BonusCaseSensitive=.25]="BonusCaseSensitive",e})(z||{}),di=/[.+*?^${}()[\]/\\]/g;function mi(e,t){const r=q(!0,{},yi,t),s=[];let i=r.start?"^":"";const n=[];for(const u of e){const f=u.length?[]:[z.Root];r.strict&&!u.length&&(i+="/");for(let c=0;c<u.length;c++){const h=u[c];let y=z.Segment+(r.sensitive?z.BonusCaseSensitive:0);if(h.type===ue.Static)c||(i+="/"),i+=h.value.replace(di,"\\$&"),y+=z.Static;else if(h.type===ue.Param){const{value:d,repeatable:p,optional:R,regexp:w}=h;n.push({name:d,repeatable:p,optional:R});const b=w||Jr;if(b!==Jr){y+=z.BonusCustomRegExp;try{new RegExp(`(${b})`)}catch(I){throw new Error(`Invalid custom RegExp for param "${d}" (${b}): `+I.message)}}let T=p?`((?:${b})(?:/(?:${b}))*)`:`(${b})`;c||(T=R&&u.length<2?`(?:/${T})`:"/"+T),R&&(T+="?"),i+=T,y+=z.Dynamic,R&&(y+=z.BonusOptional),p&&(y+=z.BonusRepeatable),b===".*"&&(y+=z.BonusWildcard)}f.push(y)}s.push(f)}if(r.strict&&r.end){const u=s.length-1;s[u][s[u].length-1]+=z.BonusStrict}r.strict||(i+="/?"),r.end?i+="$":r.strict&&!i.endsWith("/")&&(i+="(?:/|$)");const a=new RegExp(i,r.sensitive?"":"i");function l(u){const f=u.match(a),c={};if(!f)return null;for(let h=1;h<f.length;h++){const y=f[h]||"",d=n[h-1];c[d.name]=y&&d.repeatable?y.split("/"):y}return c}function o(u){let f="",c=!1;for(const h of e){(!c||!f.endsWith("/"))&&(f+="/"),c=!1;for(const y of h)if(y.type===ue.Static)f+=y.value;else if(y.type===ue.Param){const{value:d,repeatable:p,optional:R}=y,w=d in u?u[d]:"";if(gt(w)&&!p)throw new Error(`Provided param "${d}" is an array but it is not repeatable (* or + modifiers)`);const b=gt(w)?w.join("/"):w;if(!b)if(R)h.length<2&&(f.endsWith("/")?f=f.slice(0,-1):c=!0);else throw new Error(`Missing required param "${d}"`);f+=b}}return f||"/"}return{re:a,score:s,keys:n,parse:l,stringify:o}}function vi(e,t){const r=mi(hi(e),t);return function(s){const i=r.parse(s);return i?{path:s,params:i}:null}}var Bt=(function(e){return e[e.Part=0]="Part",e[e.All=1]="All",e})({}),pi=class{time;route},gi=class{forbidTime=300;submitRecorder=new pi;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)}},xe=Symbol("_notifyChange"),zr=class{currentRoute;routes;constructor(e,t){this.currentRoute=e,this.routes=t}},fe=Symbol("historyChangeConsumerKey"),Gr=Symbol("_navigateFirstRoute"),ot=Symbol("_getRouteMark"),Ot=Symbol("_getUrlSearch"),Dt=Symbol("_generateLocation"),lt=Symbol("_setRouteMarkRecorder"),$e=Symbol("beforeRestoreFiltersKey"),Xr=Symbol("_beforeRestore"),Qr="Symbol(_fox_restore_point)";function Le(e,...t){return typeof e=="function"?Reflect.apply(e,null,[...t]):e}function Zr(e){if(!Array.isArray(e))return!1;if(e.length===0)return!0;const t=e[0];return!!(Reflect.has(t,"path")&&Reflect.has(t,"root"))}var Yr=class{base;storage;mode;query;firstNavigate=!0;historyMonitor;traceless=!1;changeHandler;historyChange;[fe]=!1;[$e]=new Array;backTimeout=320;constructor(e="hash",t="",r="",s=!0,i=!0,n=!1,a,l){this.mode=e,this.base=t,this.query=r,this.firstNavigate=s,this.historyMonitor=i,this.traceless=n,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[fe]=="function"){const r=this[fe]();if(this[fe]=!1,r)return}else if(this[fe]===!0){this[fe]=!1;return}if(Le(this.historyMonitor)){const r=t.history.state;this[xe](r);try{let s=[];if(typeof r=="string"?s=JSON.parse(r):s=r,Array.isArray(s)&&s.length>0){const i=this[ot]()??"/";this[lt](i,s)}}catch{}}}),Ue(t,"popstate",this.historyChange),this.firstNavigate&&e&&this[Gr](),Promise.resolve()}destroy(){this.historyChange&&pt(K(),"popstate",this.historyChange)}[Xr](e,t,r,s){for(let i of this[$e])try{const n=Reflect.apply(i,{},[e,t,r,s]);if(n===!1)return n}catch(n){console.error(n.message,n)}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}[Gr](){const e=this[ot]()??"/",t=this.storage.getItem(Qr);if(t)try{const n=JSON.parse(t);if(n.mark===e&&Array.isArray(n.routes)&&n.routes.length>0){const a=n.routes.filter((l,o)=>(l.params=l.params?cr(l.params):{},this[Xr](l,o,e,n.routes)));if(a.length>0){const l=this[Ot](),o=a.length-1;a[o].query=l||a[o].query,this[xe](a);return}}}catch{}const r=e.indexOf("!");let s;r!=-1?s=e.substring(r+1):s=e;const i=new P;i.path=s,i.query=this[Ot](),this[xe]([i])}[lt](e,t){try{t.forEach(s=>{s.params=s.params?fr(s.params):{}});const r=JSON.stringify({mark:e,routes:t});this.storage.setItem(Qr,r)}catch(r){console.error(r.message,r)}}setRestorePoint(e){const t=this[ot]()??"/";this[lt](t,e)}[xe](e){typeof this.changeHandler=="function"&&this.changeHandler(e)}[ot](){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}[Ot](){let e=K().location.search;return e.length>0&&e.indexOf("?")===0&&(e=e.substring(1)),e}listen(e){this.changeHandler=e}go(e,t=!1){const r=K();this[fe]=t,r.history.go(e)}goBack(e,t){const r=K(),s=r.history.state;if(Zr(s)&&s.length>0){let i=!1;for(let u=s.length-1;u>=0;u--){const f=P.from(s[u]);if(!(f.historyUpdatePolicy==="traceless"||Le(this.traceless,f))&&P.isSame(f,e)){i=!0;break}}if(!i){t();return}const n=this.backTimeout;let a=null;const l=()=>{r.history.go(-1),a=setTimeout(l,n)},o=()=>{clearTimeout(a);const u=K().history.state;if(Zr(u)&&u.length>0){let f=u.length;const c=u[f-1],h=P.from(c);if(P.isSame(h,e))return t(),!0;if(f>0){let y=!1;for(let d=f-1;d>=0;d--){const p=P.from(u[d]);if(!(p.traceless===!0||Le(this.traceless,p))&&P.isSame(p,e)){y=!0;break}}return y?(setTimeout(()=>{a=setTimeout(l,n),this.go(-1,o)},0),!0):(t(),!0)}}return t(),!0};a=setTimeout(l,n),this.go(-1,o)}else t()}setRouteMark(e){const t=e.currentRoute.fullPath;this[lt](t,e.routes)}push(e){const t=this[Dt](e.currentRoute);e.currentRoute.historyUpdatePolicy!=="traceless"&&!Le(this.traceless,e.currentRoute)&&K().history.pushState(e.routes,"",t),this.setRouteMark(e)}replace(e){const t=this[Dt](e.currentRoute);(e.currentRoute.historyUpdatePolicy!=="traceless"||!Le(this.traceless,e.currentRoute))&&K().history.replaceState(e.routes,"",t),this.setRouteMark(e)}[Dt](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 o=encodeURIComponent(e.query[l]),u=`${encodeURIComponent(String(l))}=${o}`;a.length>0&&(a+="&"),a+=u}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 s=t.location;let i=e.alias??e.fullPath;i.startsWith("default")&&(i=i.substring(br.length+1));let n;return r?this.mode=="path"?i.indexOf("/")===0?n=`${this.base}${i}${r}`:n=`${this.base}/${i}${r}`:n=`${s.pathname}${r}#${i}`:this.mode=="path"?i.indexOf("/")===0?n=`${this.base}${i}`:n=`${this.base}/${i}`:n=`${s.pathname}#${i}`,`${s.origin}${n}`}};function bi(e=!0,t=null,r="",s=!0,i=!1,n){return t!==null&&(t=K().location.pathname),t&&t.endsWith("/")&&(t=t.substring(0,t.length-1)),new Yr("path",t??"",r,e,s,i,n)}function es(e=!0,t="",r=!0,s=!1,i){return new Yr("hash","",t,e,r,s,i)}var wi=class{maxSize=50;cursor=-1;queue=[];changeHandler;base;historyMonitor=!1;traceless=!1;constructor(e,t=50){this.base=e,this.maxSize=t}init(e=!0){return Promise.resolve()}destroy(){this.queue=[]}beforeRestoreEach(e){}removeBeforeRestoreEach(e){return!1}listen(e){this.changeHandler=e}[xe](e){typeof this.changeHandler=="function"&&this.changeHandler(e)}go(e,t=!1){if(this.queue.length==0||this.cursor<=0)return;let r=this.cursor+e;if(r<0?r=0:r>this.queue.length-1&&(r=this.queue.length-1),r!=this.cursor){this.cursor=r;let s=!1;if(typeof t=="function"?s=t():s=t,!s){const i=this.queue[r];this[xe](i.routes)}}}goBack(e,t){if(this.queue.length==0||this.cursor<=0)return;let r=0;if(e===null)r=this.cursor+1;else for(let s=this.cursor;s>=0;s--){const i=this.queue[s];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 ts(e="",t=50){return new wi(e,t)}function Ii(e){}var at=Symbol("_constructRouteModel"),ut=Symbol("_findRouteModel"),Ht=Symbol("_findRootView"),Ri=Symbol("_getFirstView"),ce=Symbol("_removeView"),rs=Symbol("_buildPage"),ss=Symbol("_resolveComponent"),is=Symbol("_update"),ne=Symbol("_merge"),Nt=Symbol("_handleHistoryChange"),he=Symbol("_handleRouteUpdated"),ft=Symbol("routeUpdatedCallback"),Ut=Symbol("currentRoute"),g=Symbol("currentRoutes"),ct=Symbol("routeSessionCacheKey"),ns=Symbol("_addRouteRecorder"),Te=Symbol("_removeRouteRecorder"),ht=Symbol("_cloneRouteRecorder"),$=Symbol("_handleError"),yt=Symbol("errorCallback"),N=Symbol("registerKey"),dt=Symbol("notFoundKey"),Vt=Symbol("notFoundPathKey"),G=Symbol("forestKey"),E=Symbol("historyKey"),Me=Symbol("beforeFiltersKey"),ke=Symbol("afterFiltersKey"),Ie=Symbol("destroyFiltersKey"),Wt=Symbol("propsFilterKey"),Pe=Symbol("mainDispatcherKey"),Jt=Symbol("initKey"),ye=Symbol("readyKey"),zt=Symbol("readyHandlersKey"),mt=Symbol("_markReady"),os=Symbol("_createNextFn"),Gt=Symbol("_start"),Xt=Symbol("_before"),Qt=Symbol("_after"),ls=Symbol("_destroy"),Zt=Symbol("_load"),Be=Symbol("_unload"),Oe=Symbol("routerGuardKey");function Si(e){return e.layers.length==0||e.layers[0].views.length==0}var xi=class{[N]=new Array;[dt];[Vt]="*";[ye]=!1;[zt]=[];[G]=new ii;[E];[g]=new Array;[Ut]=(0,v.shallowRef)(null);[ct]=new WeakMap;[yt]=null;[ft]=null;[Me]=new Array;[ke]=new Array;[Ie]=new Array;[Wt]=null;[Pe]=new je;[Oe]=new gi;[Jt]=!1;get currentRoute(){return(0,v.readonly)(this[Ut])}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[E]=e.history:this[E]=me?es():ts(),this[E]?.listen(async r=>{let s=!0;try{if(typeof r=="string"){const i=this[M](r);i&&await this[Nt]([i])}else await this[Nt](r)}catch(i){console.error(i.message,i),s=!1}this[ye]===!1&&this[mt](s)})}[$](e="error",t){if(t&&typeof t.error=="function")try{t.error(e)}catch{}if(typeof this[yt]=="function")try{this[yt](e,t)}catch{}console.error(e)}init(){this[Jt]!==!0&&(this[E]?.init(!this[ye]),this[Jt]=!0)}isReady(){return this[ye]?Promise.resolve():new Promise((e,t)=>{this[zt].push([e,t])})}[mt](e){this[ye]=!0,this[zt].forEach(([t,r])=>{try{e?t():r()}catch(s){console.error(s.message,s)}})}[Nt](e){try{if(!e){let n=[...this[g]].reverse();return this[Be](n),me&&K().location.reload(),Promise.resolve()}let t=null,r=[],s=[],i=0;for(;i<e.length&&i<this[g].length&&P.isSame(e[i],this[g][i]);i++)e[i].active===!0&&e[i].active!==this[g][i].active&&(t=e[i]);if(i<e.length&&(r=e.slice(i)),i<this[g].length&&(s=this[g].slice(i).reverse()),s.length===0&&r.length===0){if(t!==null)return this.restore([t])}else if(s.length>0){if(this[Be](s)){if(r.length>0)return this.restore(r);if(t!==null)return this.restore([t])}}else return this.restore(r)}catch(t){this[$](t)}return Promise.resolve()}[he](e=null){if(this[Ut].value=e,typeof this[ft]=="function")try{this[ft](e)}catch{}}[ns](e,t){if(e.opsType===C.Open){let r=!1;const s=this[g].length-1;for(let i=s;i>=0;i--){const n=this[g][i];if(e.root==n.root){if(e.path===n.path){this[g].splice(i,1,e),r=!0;continue}e.active&&(n.active=!1)}}r||this[g].push(e)}else this[g].push(e);this[ct].set(e,t),this[he](e)}[ht](){let e=[];for(let t of this[g]){let r=P.clone(t,!0);e.push(r)}return e}[Te](e){if(!this[g]){this[he](null);return}let t=-1;for(let r=0;r<this[g].length;r++)if(P.isSame(this[g][r],e)){t=r;break}if(t!=-1){const r=this[g][t];this[g].splice(t,1);const s=this[ct].get(r);if(this[ct].delete(r),this[ls](r,s),r.opsType===C.Append){const i=this[g].length-1;this[he](this[g][i]??null)}else this[he](null)}else this[he](null)}set historyMonitor(e){this[E]&&(this[E].historyMonitor=e)}get historyMonitor(){return this[E]?this[E].historyMonitor:!1}set traceless(e){this[E]&&(this[E].traceless=e)}get traceless(){return this[E]?this[E].traceless:!1}set propsFilter(e){this[Wt]=e}get propsFilter(){return this[Wt]}setRestorePoint(){const e=this[ht]();this[E]?.setRestorePoint(e)}onRouteUpdated(e){this[ft]=e}onError(e){this[yt]=e}beforeEach(e){this[Me].push(e)}removeBeforeEach(e){const t=this[Me].indexOf(e);return t!==-1?(this[Me].splice(t,1),!0):!1}afterEach(e){this[ke].push(e)}removeAfterEach(e){const t=this[ke].indexOf(e);return t!==-1?(this[ke].splice(t,1),!0):!1}destroyEach(e){this[Ie].push(e)}removeDestroyEach(e){const t=this[Ie].indexOf(e);return t!==-1?(this[Ie].splice(t,1),!0):!1}beforeRestoreEach(e){this[E]?.beforeRestoreEach(e)}removeBeforeRestoreEach(e){return this[E]?.removeBeforeRestoreEach(e)??!1}addRoutes(e){for(let t of e)this.addRoute(t)}addRoute(e,t=-1){if(e.path===this[Vt]){this.setNotFoundRoute(e);return}const r=this[at](e);if(t==-1)this[N]=[...this[N],...r];else for(let s=r.length-1;s>=0;s--)this[N].splice(t,0,r[s])}removeRoute(e){const t=this[M](e);if(t===null)return console.warn("route格式错误",e),!1;for(let r=0;r<this[N].length;r++){const s=this[N][r];if(t?.path&&s.path===t.path)return this[N].splice(r,1),!0;if(t?.name&&s.name===t.name)return this[N].splice(r,1),!0}return!1}hasRoute(e){const t=this[M](e);return t===null?(console.warn("route格式错误",e),!1):this[N].findIndex(r=>{if(t?.path&&r.path===t.path||t?.name&&r.name===t.name)return!0})!==-1}setNotFoundPath(e){this[Vt]=e}setNotFoundRoute(e){this[dt]=this[at](e)[0]}getRoutes(){return[...this[N]]}[at](e){let t=e.path??"";t.length>0&&t.charAt(0)!=="/"&&(t=`/${t}`);let r=e.components??(e.component&&{"":e.component});if(!r){const l=new Ft;return l.path=t,l.redirect=e.redirect,[l]}const s=new P;s.path=t,s.name=e.name,s.meta=e.meta;let i=[];for(let l in r){const o=r[l];l.length===0&&(l=br);const u=new Ls(l,o,e.props);i.push(u)}let n=!1,a=[];if(e.children)for(let l of e.children){const o=this[at](l);for(let u of o){let f=new Ft;f.name=u.name,u.path&&u.path.length>0?t!=="/"?f.path=`${t}${u.path}`:f.path=u.path:(n=!0,f.path=t);let c=new Sr;c.models=[...i],f.layers=[c,...u.layers],f.matchedRoutes=[s,...u.matchedRoutes??[]],a.push(f)}}if(!n){const l=new Sr;l.models=i;const o=new Ft;o.name=e.name,o.path=t,o.matchedRoutes=[s],o.layers=[l],a.splice(0,0,o)}return a}[ut](e){const t=e.route;try{for(let r of this[N]){const s=t.path?t.template??t.path:null,i=t.name?t.template??t.name:null;if(s&&r.path){let n=r.match;n||(n=r.match=vi(r.path));const a=n(s);if(!a)continue;if(r.redirect){const l=new P;q(!0,l,t),l.path=r.redirect;const o={route:l,find:void 0};return this[ut](o)?(e.route=o.route,e.find=o.find,t.template&&e.find&&(e.find={...e.find},e.find.path=t.path),!0):!1}if(t.params=t.params??{},q(!0,t.params,a.params),t.query){const l=t.query;if(typeof l=="string"){const o={},u=l.split("&");for(let f of u){const c=f.split("=");if(c.length!==2)continue;const h=decodeURIComponent(c[0].trim());o[h]=decodeURIComponent(c[1].trim())}q(!0,t.params,o)}else typeof l=="object"&&q(!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)return 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}[M](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&&q(!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??"default",t.opsType=t.opsType??this.options.defaultOperationType??C.Push,t.traceless&&!t.historyUpdatePolicy&&(t.historyUpdatePolicy="traceless")}return t}push(...e){const t=this[M](e);return t?(t.opsType=C.Push,t.historyUpdatePolicy=t.historyUpdatePolicy??"push",this.to(t)):(this[$]("resolve route fail",t),this)}put(...e){const t=this[M](e);return t?(t.opsType=C.Put,t.historyUpdatePolicy=t.historyUpdatePolicy??"traceless",this.to(t)):(this[$]("resolve route fail",t),this)}replace(...e){const t=this[M](e);return t?(t.opsType=C.Replace,t.historyUpdatePolicy=t.historyUpdatePolicy??"replace",this.to(t)):(this[$]("resolve route fail",t),this)}append(...e){const t=this[M](e);return t?(t.opsType=C.Append,t.historyUpdatePolicy=t.historyUpdatePolicy??"push",this.to(t)):(this[$]("resolve route fail",t),this)}remove(e,t){return new Promise(r=>{this[Pe].post(s=>{try{if(this[g].length===0){s.resolve(),r(!1);return}let i=-1,n=null,a=[];if(e){if(n=e.root??null,e.all)for(let o=this[g].length-1;o>0;o--){const u=this[g][o];if(u.opsType===C.Append){const f=u.root??"default";if(n&&n!==f)continue;a.splice(0,0,u),i=o-1}}else if(e.until)for(let o=this[g].length-1;o>0;o--){let u=this[g][o];if(u.opsType===C.Append&&u.root===n){if(e.until.charAt(0)==="/"&&e.until===u.path){i=o;break}else if(e.until===u.name){i=o;break}a.splice(0,0,u)}}else if(e.to)for(let o=this[g].length-1;o>0;o--){const u=this[g][o];if(u.opsType===C.Append){const f=u.root??"default";if(n&&n!==f)continue;if(a.splice(0,0,u),e.to.charAt(0)==="/"&&e.to===u.path){i=o-1;break}else if(e.to===u.name){i=o-1;break}}}}else for(let o=this[g].length-1;o>0;o--){let u=this[g][o];if(u.opsType===C.Append){a.push(u),i=o-1;break}}if(i===-1||a.length===0){let o="can not find route";console.warn(o),s.resolve(o),r(!1);return}let l=null;if(i!==-1&&(l=this[g][i]),this[Be](a)){if(t===!1)return s.resolve(),r(!0),!0;const o=()=>(s.resolve(),r(!0),!0),u=this[g].length;if(l&&P.isSame(l,this[g][u-1])){this[E]?.goBack(l,o);return}o()}}catch(i){this[$](i),s.resolve(),r(!1)}})})}open(...e){let t=this[M](e);return t?(t.opsType=C.Open,t.historyUpdatePolicy=t.historyUpdatePolicy??"push",this.to(t)):(this[$]("resolve route fail",t),this)}close(e){return this[Pe].post(t=>{try{let r=this[M](e);if(!r){t.reject("resolve route fail");return}let s=[];for(let i=0;i<this[g].length;i++){let n=this[g][i];if(n.root===r.root){if(!r.path&&!r.name){s.push(n);continue}if(r.path&&r.path===n.path){s.push(n);break}else if(r.name&&r.name===n.name){s.push(n);break}}}if(s.length===0){t.resolve();return}this[Be](s),t.resolve()}catch(r){this[$](r),t.resolve()}}),this}to(...e){let t=this[M](e);if(!t)return this[$]("resolve route fail",t),this;let r=this[Oe].acquire(t);return r==null?(this[$]("route forbid",t),this):(this[Pe].post(s=>{try{let i=this[Gt](t);this[Xt](i),this[Zt](i),this[Qt](i),i.wait((n,a)=>{const l=n.session.to;if(n.session.updateResult&&n.session.updateResult.status==="success")try{const o=new zr(P.clone(l,!0),this[ht]());l.historyUpdatePolicy==="replace"?this[E]?.replace(o):l.historyUpdatePolicy==="traceless"?this[E]?.setRouteMark(o):this[E]?.push(o)}catch(o){console.error(o.message,o)}if(ze.clear(n.session),this[Oe].release(r),typeof t.success=="function")try{Reflect.apply(t.success,{},[])}catch(o){console.error(o.message,o)}this[ye]===!1&&this[mt](!0),i=null,s.resolve()},(n,a)=>{this[Oe].release(r),a!==null&&this[$](a,t),this[ye]===!1&&this[mt](!1),ze.clear(n.session),i=null,s.resolve()})}catch(i){this[Oe].release(r),this[$](i,t),s.resolve()}}),this)}back(e=1){this[E]?.go(-e,!1)}[os](e){return(t,r)=>{if(typeof t=="boolean")e.session.redirect=!1,t?e.resolve():e.reject(r??null);else if(t){const s=this[M](t);if(s){const i=e.session.to;s.success=i.success,s.error=i.error,e.session.to=s,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()}}[Gt](e){const t=new ze(e,this[g].length>0?this[g][this[g].length-1]:void 0),r={route:e,find:null};if(this[ut](r),r.find){t.routeModel=r.find,e.matched=r.find.matchedRoutes??[];const s={};if(Array.isArray(r.find?.matchedRoutes))for(let i=0;i<r.find.matchedRoutes.length;i++){const n=r.find.matchedRoutes[i];n.meta&&typeof n.meta=="object"&&Object.assign(s,n.meta)}e.meta&&typeof e.meta=="object"&&Object.assign(s,e.meta),e.meta=s}return new je(t)}[Xt](e){for(let t of this[Me])e.post(r=>{const s=this[os](r);Reflect.apply(t,{},[r.session.to,r.session.from,s,r.session])})}[Qt](e){e.post(t=>{for(let r of this[ke])try{Reflect.apply(r,{},[t.session.to,t.session.from,t.session])}catch(s){console.error(s.message,s)}t.resolve()})}[ls](e,t){for(let r of this[Ie])try{Reflect.apply(r,{},[e,t])}catch(s){console.error(s.message,s)}typeof e.destroy=="function"&&Reflect.apply(e.destroy,e,[])}[Zt](e){e.post(t=>{const r=t.session.to;let s=t.session.routeModel;if(s==null){let n={route:r,find:null};if(this[ut](n))s=n.find,t.session.routeModel=s;else if(this[dt])s=this[dt];else{t.reject(`not find route model, path:${r.path??r.name}`);return}}const i=ze.from(t.session);this[rs](r,s,i).then(n=>{this[G],t.session.updateResult=n??{status:"success",message:""},t.resolve()},n=>{t.reject(n)})})}[Be](e){if(e.length==0)return!0;let t=this[G],r=[];for(let s of e){let i=this[Ht](t,s);i!=null&&r.push({...i,route:s})}if(r.length==0)return this[$]("can not find view index"),!1;for(let s of r.reverse())this[ce](t,{x:s.x,y:s.y},[s.route.index??0],!0);return!0}[Ht](e,t){const r=t.root??"default";let s;for(let i=0;i<e.layers.length;i++){const n=e.layers[i];for(let a=n.views.length-1;a>=0;a--){const l=n.views[a];if(l[W]&&l[rt]===r)return s={x:a,y:i},s}}return null}[Ri](e){return e.layers.length>0&&e.layers[0].views.length>0?e.layers[0].views[0]:null}[ce](e,t,r=null,s=!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],n=!1,a=[],l=!1,o=[...i.slots.value];for(let f=o.length-1;f>=0;f--){let c=o[f];(!r||r.indexOf(c.index)!=-1)&&(c.route&&i[W]&&(this[Te](c.route),c.active===!0&&c.route.opsType==C.Append&&(l=!0)),a.push(new D(i,c.index,t.y)),o.splice(f,1))}if(o.length==0)s?i.slots.value=o:e.layers[t.y].views.splice(t.x,1);else{if(l){let f=o[o.length-1];f.active=!0,f.route&&(f.route.active=f.active)}i.slots.value=o}e.layers[t.y].views.length==0&&(n=!0);let u=t.y+1;for(;u<e.layers.length;u++){let f=e.layers[u].views,c=[];for(let h=f.length-1;(n||a.length>0)&&h>=0;h--){let y=f[h];if(y[ae]&&(n||D.include(a,y[ae]))){let d=y.slots.value;for(let p=d.length-1;p>=0;p--){let R=d[p];R.route&&y[W]&&this[Te](R.route),c.push(new D(y,R.index,u)),d.splice(p,1)}e.layers[u].views.splice(h,1)}}a=c,e.layers[u].views.length==0&&(n=!0)}}restore(e){if(!e||this[N].length==0){let t=this[G];if(t.layers.length>0){let r=t.layers[0].views;r.length>0&&(r[0].slots.value=[])}return this[g]=[],this[he](null),Promise.resolve()}else return new Promise((t,r)=>{let s=null,i=!1;for(let n=0;n<e.length;n++){const a=e[n];this[Pe].post(l=>{const o=this[Gt](a);this[Xt](o),this[Zt](o),this[Qt](o),o.wait((u,f)=>{s=u.session.to,i=u.session.redirect,l.resolve()},(u,f)=>{s=null,f!==null&&this[$](f),l.resolve()})})}this[Pe].post(n=>{if(s&&i===!0){const a=new zr(P.clone(s,!0),this[ht]());this[E]?.replace(a)}n.resolve(),t()})})}[rs](e,t,r){const s=e.updateType??Bt.Part;return this[ss](t).then(()=>{const i=this[is](t,e,r,s);if(i.status==="error")throw Error(i.message);return i})}[ss](e){let t=[];for(let r=0;r<e.layers.length;r++){let s=e.layers[r];for(let i=0;i<s.models.length;i++){let n=s.models[i];n.isResolved||t.push(n.resolve())}}return t.length>0?Promise.all(t):Promise.resolve()}[is](e,t,r,s){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 n=this[G],a=Si(n),l=t.root??"default",o;!a&&s==Bt.Part&&(o=this[Ht](n,t));let u,f=0;if(o==null||o==null)if(a||s===Bt.All)n.layers.length==0&&(n.layers[0]=new Tt),n.layers[0].views.length==0?(u=new Ke(t.root??"default",!0,null),n.layers[0].views=[u]):u=n.layers[0].views[0],o={x:0,y:0};else{let c=t.slot;if(!c)return{status:"error",message:"can not rebuild view(because not route slot)"};let h=c.level;if(h>n.layers.length)return{status:"error",message:"can not insert view(override level)"};let y;if(c.rootName){let d=n.layers[h-1];for(let p of d.views){if(p[W]&&p.name===c.rootName){y=new D(p,c.rootIndex??0,h-1);break}if(p[J]&&p[J].view.name===c.rootName&&p[J].index===c.rootIndex){y=p[J];break}}}if(!y)return{status:"error",message:"can not insert view(not find root node ref)"};u=new Ke(l,!0,y),n.layers[h].views.push(u),o={x:n.layers[h].views.length-1,y:h}}else u=n.layers[o.y].views[o.x];if(f=o.y,u[W]=!0,t.opsType===C.Append){t.index=t.index??_e.get(),t.active=!0;let c=u.slots.value;if(c.length>0){let R=c[c.length-1];R.active=!1,R.route&&(R.route.active=R.active)}let h=new re(t,i,t.index,!0);u.slots.value=[...c,h];let y=f+1,d=1,p=new D(u,t.index,f);this[ne](n,y,e,d,p)}else if(t.opsType===C.Open){let c=u.slots.value;const h=t.active??!0;let y=!1;for(let d of c){if(d.route!==null&&P.isSamePathForRoute(d.route,t)){if(d.active===h)return t.index=d.index,t.active=h,d.route=t,{status:"noChange",message:""};d.active=h,y=!0,t.index=d.index,t.active=h,d.route=t}else h&&(d.active=!1);d.route&&(d.route.active=d.active)}if(!y){t.index=t.index??_e.get(),t.active=h;let d=new re(t,i,t.index,h);c.push(d);let p=f+1,R=1,w=new D(u,t.index,f);this[ne](n,p,e,R,w)}u.slots.value=[...c]}else{let c=u.slots.value;if(c.length==0){t.index=t.index??_e.get(),t.active=!0,u.slots.value=[new re(t,i,t.index)];let h=f+1,y=1,d=new D(u,t.index,f);this[ne](n,h,e,y,d)}else{let h=c[0];if(h.model!==i){this[ce](n,o,null,!0),t.index=t.index??_e.get(),t.active=!0,u.slots.value=[new re(t,i,t.index)];let y=f+1,d=1,p=new D(u,t.index,f);this[ne](n,y,e,d,p)}else{h.route!==null&&this[Te](h.route);let y=!1;const d=t.active??!0;h.active!==d&&(h.active=d,y=!0),t.active=d,t.index=h.index,h.route=t;let p=[];for(let I=1;I<c.length;I++)p.push(c[I].index);p.length>0?this[ce](n,o,p,!0):y&&(u.slots.value=[...c]);let R=[new D(u,t.index,f)],w=f+1,b=1,T=new D(u,t.index,f);for(;R.length>0&&w<n.layers.length&&b<e.layers.length;w++,b++){let I=[];for(let B=0;B<n.layers[w].views.length;B++){let L=n.layers[w].views[B];L[ae]&&D.include(R,L[ae])&&I.unshift(B)}let De=[];for(let B of I){let L=n.layers[w].views[B],de=e.layers[b].models,te;for(let O=0;O<de.length;O++)if(L.name===de[O].name){te=de[O];break}if(!te)this[ce](n,{x:B,y:w},null,!1);else{let O=L.slots.value;if(O.length==0){let ee=0;L.slots.value=[new re(null,te,ee)];let X=w+1,Q=b+1;this[ne](n,X,e,Q,T)}else{let ee=O[0];if(ee.model!==te){this[ce](n,{x:B,y:w},null,!0),L.slots.value=[new re(null,te,0)];let X=w+1,Q=b+1;this[ne](n,X,e,Q,T)}else{L[W]&&ee.route!==null&&this[Te](ee.route);let X=[];for(let Q=1;Q<O.length;Q++)X.push(O[Q].index);X.length>0&&this[ce](n,{x:B,y:w},X,!0),De.push(new D(L,ee.index,w))}}L[W]=!1}}R=De}this[ne](n,w,e,b,T)}}}if(u&&u[J]){let c=u[J];c&&(t.slot=new $s(l,f,c?.view.name,c?.index??0))}return r.to=void 0,r.routeModel=void 0,this[ns](t,r),{status:"success",message:""}}[ne](e,t,r,s,i){let n=s,a=t;for(;a<e.layers.length&&n<r.layers.length;a++,n++){let l=e.layers[a].views;for(let o of r.layers[n].models){let u=new Ke(o.name,!1,i),f=new re(null,o);u.slots.value=[f],l.push(u)}}for(;n<r.layers.length;n++){let l=new Tt;l.views=[];for(let o of r.layers[n].models){let u=new Ke(o.name,!1,i),f=new re(null,o);u.slots.value=[f],l.views.push(u)}e.layers.push(l)}}[wr](e,t,r,s,i,n){if(t<0||t>this[G].layers.length)return null;if(t<this[G].layers.length){let u=this[G].layers[t],f=null;for(let c of u.views){let h=!1;if(r!==null?(h=c.name===e&&c[J]?.view===r,h&&s!==-1&&(h=c[J]?.index===s)):h=c.name===e,!!h){i!==null&&(c[ae]={view:i,index:n,level:t-1}),f=c;break}}if(f!==null)return f}let a=null,l=null;i!==null&&(i[W]?a={view:i,index:n,level:t-1}:a=i[J],l={view:i,index:n,level:t-1});let o=new Ke(e,!0,a);if(o[ae]=l,t==this[G].layers.length){let u=new Tt;u.views=[o],this[G].layers.push(u)}else this[G].layers[t].views.push(o);return o}},Pi="FoxRouterView",Ei="FoxRouterLink",U=(function(e){return e[e.Loading=0]="Loading",e[e.Loaded=1]="Loaded",e[e.Defining=2]="Defining",e[e.Defined=3]="Defined",e})({});function _i(e){return e==U.Loaded||e===U.Defined}var as=(function(e){return e[e.normal=0]="normal",e[e.factory=1]="factory",e})({}),Fi=class{register=new Map;regExpRegisters=[];constructor(){}get(e){let t=this.register.get(e)??null;return t||(t=this.regExpRegisters.find(r=>r.pattern?.test(e))?.module??null),t}has(e){return!!this.get(e)}set(e,t){if(typeof e=="string")this.register.set(e,t);else if(e instanceof RegExp){const r=this.regExpRegisters.find(s=>(s.pattern?.source??"")===(e?.source??""));r?r.module=t:this.regExpRegisters.push({pattern:e,module:t})}}remove(e){if(typeof e=="string"){const t=this.register.get(e);return this.register.delete(e),t??null}else if(e instanceof RegExp){const t=this.regExpRegisters.findIndex(r=>(r.pattern?.source??"")===(e?.source??""));if(t!==-1){const r=this.regExpRegisters[t].module??null;return this.regExpRegisters.splice(t,1),r}}return null}clear(){this.register.clear(),this.regExpRegisters=[]}},Yt=["require","exports","module"];async function Ci(e){return await new Function("url","return import(url)")(e)}var us=class{moduleManager=new Fi;_alias={};set alias(e){this._alias=e}get alias(){return this._alias}_resourceParser;set resourceParser(e){this._resourceParser=e}get resourceParser(){return this._resourceParser}_timeout;set timeout(e){this._timeout=e}get timeout(){return this._timeout}_query;set query(e){this._query=e}get query(){return this._query}get head(){return Ne().head}_cssMountPoint=null;set cssMountPoint(e){this._cssMountPoint=e}get cssMountPoint(){return this._cssMountPoint}_jsMountPoint=null;set jsMountPoint(e){this._jsMountPoint=e}get jsMountPoint(){return this._jsMountPoint}setModule(e,t){const r={id:typeof e=="string"?e:e?.source,src:"",status:U.Loaded};typeof t=="function"?(r.exports=t,r.type=as.factory):r.exports=t,this.moduleManager.set(e,r)}removeModule(e){this.moduleManager.remove(e)}getModuleExports(e){const t=this.moduleManager.get(e);return t&&_i(t.status)?t.type===as.factory&&typeof t.exports=="function"?t.exports():t.exports:null}exposeRequire(e="__foxRequire",t,r){const s=t??K();return s&&typeof s=="object"?(s[e]=i=>{const n=this.getModuleExports(i);return r&&!n&&console.error(`[Fox] module:${i}, not found!`),n},!0):!1}resloveResource(e){if(typeof e=="string"){if(Yt.includes(e))return e;if(e=this.alias?.[e]??e,typeof this.resourceParser=="function"){const r=this.resloveResource(e);if(!r)return r}const t=this.getResourcePathSuffix(e);if(t==="mjs")return{path:e,type:"js",format:"es"};if(t==="js")return{path:e,type:"js",format:"umd"};if(t==="css")return{path:e,type:"css"}}return e}ensure(...e){return new Promise((t,r)=>{if(e.length<=0){r("args is empty");return}const s=[];let i=e.length-1,n=null;typeof e[i]=="function"&&(n=e[i],i--);for(let o=0;o<=i;o++)if(Array.isArray(e[o])){const u=e[o];for(let f=0;f<u.length;f++){const c=this.resloveResource(u[f]);s.push(c)}}else if(typeof e[o]=="string"){const u=this.resloveResource(e[o]);s.push(u)}const a=new Ai(s.length,(o,u)=>{if(a.isOK())try{typeof n=="function"&&Reflect.apply(n,{},u),t(u)}catch(f){console.error(f),r(f)}else try{console.error(o),typeof n=="function"&&Reflect.apply(n,{},[]),r(o)}catch(f){console.error(f),r(f)}}),l=new je;for(let o=0;o<s.length;o++){const u=new Ki(o,s[o],a);this.mount(l,u)}return this})}remove(...e){return new Promise((t,r)=>{if(e.length<=0){r("args is empty");return}const s=[];let i=e.length-1,n=null;typeof e[i]=="function"&&(n=e[i],i--);for(let a=0;a<=i;a++)if(Array.isArray(e[a])){const l=e[a];for(let o=0;o<l.length;o++){const u=this.resloveResource(l[o]);s.push(u)}}else if(typeof e[a]=="string"){const l=this.resloveResource(e[a]);s.push(l)}for(let a=0;a<s.length;a++)try{this.unmount(s[a])}catch(l){console.error(l)}typeof n=="function"&&Reflect.apply(n,{},[!0]),t(!0)})}mount(e,t){if(!t.resource){e.post(s=>{t.progress.work(!1,t.index,null),s.resolve()});return}if(typeof t.resource=="string"){if(Yt.includes(t.resource)){e.post(i=>{t.progress.work(!0,t.index,t.resource),i.resolve()});return}const s=this.getModuleExports(t.resource);if(s){e.post(i=>{t.progress.work(!0,t.index,s),i.resolve()});return}}const r=t.resource;if(r.type==="js")if(r.format==="es")this.mountCJS(e,t);else{const s=this.jsMountPoint??this.head;this.mountJS(e,t,s)}else{const s=this.cssMountPoint??this.head;this.mountCSS(e,t,s)}}mountCSS(e,t,r){e.post(s=>{const i=t.resource,n=this.getModuleExports(i.path);if(n){t.progress.work(!0,t.index,n),s.resolve();return}const a=Ne(),l=a.createElement("link"),o="onload"in l;o&&(l.onload=()=>{l.onload=null,l.onerror=null,t.progress.work(!0,t.index,i.path),s.resolve()},l.onerror=()=>{try{r.removeChild(l)}catch(c){console.error(c)}l.onload=null,l.onerror=null,t.progress.work(!1,t.index,null),s.reject()});const u=this.constructResourceUri(i.path),f=a.getElementById(i.path);f&&f.parentNode&&f.parentNode.removeChild(f),l.rel="stylesheet",l.type="text/css",l.id=i.path,l.href=u,r.appendChild(l),o||(t.progress.work(!0,t.index,i.path),s.resolve())})}mountJS(e,t,r){e.post(s=>{const i=t.resource,n=this.getModuleExports(i.path);if(n){t.progress.work(!0,t.index,n),s.resolve();return}const a={id:i.path,src:i.path,status:U.Loading};this.moduleManager.set(i.path,a);const l=Ne().createElement("script");if("onload"in l)l.onload=()=>{l.onload=null,l.onerror=null,a.status===U.Loading&&(a.status=U.Loaded,t.progress.work(!0,t.index,i.path)),s.resolve()},l.onerror=()=>{try{r.removeChild(l)}catch(h){console.error(h)}l.onload=null,l.onerror=null,this.moduleManager.remove(i.path),t.progress.work(!1,t.index,null),s.resolve()};else{const h=l;h.onreadystatechange=()=>{/loaded|complete/.test(h.readyState)&&(h.onreadystatechange=null,a.status==U.Loading&&(a.status=U.Loaded,t.progress.work(!0,t.index,i.path)),s.resolve())}}const o=this.constructResourceUri(i.path);l.defer=!0,l.src=o;const u=K(),f=this.createRequireLoad();u.__require=u.__require??u.require,u.require=f;const c=this.createDefine(a,f,t);u.__define=u.__define??u.define,u.define=c,typeof t.progress.finalCallback!="function"&&(t.progress.finalCallback=function(){u.require=u.__require,u.__require=void 0,u.define=u.__define,u.__define=void 0}),r.appendChild(l)})}mountCJS(e,t){e.post(async r=>{const s=t.resource,i=this.getModuleExports(s.path);if(i){t.progress.work(!0,t.index,i),r.resolve();return}try{let n=await Ci(s.path);if(Je(n)&&(n=n.default??n),ve(n)){t.progress.work(!1,t.index,n),r.resolve();return}const a={id:s.path,src:s.path,status:U.Loaded,exports:n};this.moduleManager.set(s.path,a),t.progress.work(!0,t.index,n),r.resolve()}catch(n){console.error(n),t.progress.work(!1,t.index,null),r.resolve()}})}unmount(e){let t="",r="";typeof e=="string"?(this.moduleManager.remove(e),r=this.getResourcePathSuffix(e),t=e):(this.moduleManager.remove(e.path),r=e.type==="css"?"css":e.format??"",t=e.path);const s=Ne();if(r==="umd"){let i=s.getElementById(t);i||(i=s.querySelector(`script[src="${t}"]`)),i&&i.remove()}else if(r==="css"){let i=s.getElementById(t);if(!i){const n=this.constructResourceUri(t);i=s.querySelector(`link[href="${n}"]`)}i&&i.remove()}}trimEmptyElement(e){const t=[];for(let r=0;r<e.length;r++){let s=e[r];s!=null&&(s=s.trim(),s.length!==0&&t.push(s))}return t}createDefine(e,t,r){const s=this,i=function(...n){e.status=U.Defining;let a,l,o,u=n.length;if(u===1?(o=n[0],a=void 0):u===2?(o=n[1],Array.isArray(n[0])?(l=s.trimEmptyElement(n[0]),a=void 0):l=void 0):(a=n[0],l=s.trimEmptyElement(n[1]),o=n[2]),a&&(e.id=a,typeof s._alias=="object"&&(s._alias[a]=e.src)),l&&l.length>0)s.ensure(l,(...f)=>{try{const c=f.map(h=>h==="exports"?((!e.exports||typeof e.exports!="object")&&(e.exports={}),e.exports):h==="module"?e:h==="require"?t:h);if(typeof o=="function"){const h=Reflect.apply(o,e,c);h&&typeof h=="object"&&(e.exports=h)}else e.exports=o;e.status=U.Defined,r.progress.work(!0,r.index,e.exports)}catch(c){console.error(c),r.progress.work(!1,r.index,[])}});else{if(typeof o=="function"){const f=Reflect.apply(o,e,[]);f&&typeof f=="object"&&(e.exports=e.exports??{},Object.assign(e.exports,f))}else e.exports=o;e.status=U.Defined,r.progress.work(!0,r.index,e.exports)}};return i.amd=!0,i}createRequireLoad(){return e=>(e=this._alias?.[e]??e,this.getModuleExports(e))}constructResourceUri(e){try{if(Yt.includes(e)||!this.query)return e;const t=this.createSearch(this.query);return e.indexOf("?")==-1?e+=`?${t}`:t.length>0&&(e+=`&${t}`),e}catch(t){throw console.error(`[Fox]resolve path[${e}] fail`,t),t}}createSearch(e){let t="";if(e&&typeof e=="object"){for(let r in e){let s=`${e[r]}`;t+=`${encodeURIComponent(r)}=${encodeURIComponent(s)}&`}t.length>0&&(t=t.substring(0,t.length-1))}return t}getResourcePathSuffix(e){let t=e.lastIndexOf("?");t==-1&&(t=e.length);let r=e.lastIndexOf(".",t);return r==-1?"":e.substring(r+1,t)}},Ai=class{finalCallback;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[t]=r),this.size===0||this.status===!1)try{Reflect.apply(this.callback,this,[this.status,this.values])}catch(s){console.error(s.message,s)}finally{typeof this.finalCallback=="function"&&(Reflect.apply(this.finalCallback,null,[]),this.finalCallback=null)}}isOK(){return this.status}},Ki=class{index;resource;progress;constructor(e,t,r){this.index=e,this.resource=t,this.progress=r}},er=Symbol("fk"),tr=Symbol("fbk"),rr=Symbol("fepk");function qi(e={}){const t=new xi(e),r=new Et,s=new It,i=new us,n={get router(){return t},get bus(){return r},get Bus(){return Et},get EventProxy(){return It},get eventproxy(){return s},get EventChain(){return je},get Require(){return us},get require(){return i},get isESModule(){return Je},install(a){a.provide(Xe,t),a.provide(er,n),a.provide(tr,r),a.provide(rr,s),a.component(Pi,st),a.component(Ei,Wr),Reflect.defineProperty(a.config.globalProperties,"$fox",{get(){return n}}),Reflect.defineProperty(a.config.globalProperties,"$router",{get(){return t}}),Reflect.defineProperty(a.config.globalProperties,"$bus",{get(){return r}}),Reflect.defineProperty(a.config.globalProperties,"$bus",{get(){return r}}),Reflect.defineProperty(a.config.globalProperties,"$eventProxy",{get(){return s}}),a.config.globalProperties.$fox_on=function(l,o,u=!1){s.on(l,o,u)},a.config.globalProperties.$fox_off=function(l,o){s.off(l,o)},a.config.globalProperties.$fox_once=function(l,o){s.once(l,o)},a.config.globalProperties.$fox_all=function(...l){let o=s;Reflect.apply(o.all,o,l)},a.config.globalProperties.$fox_trigger=function(l,...o){let u=s;Reflect.apply(u.trigger,u,[l,...o])},a.config.globalProperties.$fox_emit=function(l,...o){let u=s;Reflect.apply(u.trigger,u,[l,...o])},a.mixin({computed:{$route(){return jt(this)}}}),t.init()}};return n}function sr(e){return e?e.$router:(0,v.inject)(Xe)}function ji(e){return e||(e=(0,v.getCurrentInstance)()?.proxy??void 0),e?jt(e):null}function $i(e){return e?e.$fox:(0,v.inject)(er)}function Li(e){return e?e.$bus:(0,v.inject)(tr)}function Ti(e){return e?e.$eventProxy:(0,v.inject)(rr)}function Mi(e){const t=sr(),r=(s,i,n)=>{try{Reflect.apply(e,{},[s,i])}catch(a){console.error(a)}n()};t.beforeEach(r),(0,v.onUnmounted)(()=>{t.removeBeforeEach(r)})}function ki(e){const t=sr(),r=(s,i,n)=>{try{Reflect.apply(e,{},[s,i])}catch(a){console.error(a)}n()};t.afterEach(r),(0,v.onUnmounted)(()=>{t.removeAfterEach(r)})}m.Bus=Et,m.EventChain=je,m.EventProxy=It,m.FoxBeforeEnter=xr,m.FoxBeforeLeave=Er,m.FoxEnter=Pr,m.FoxLeave=_r,m.FoxLeaveEnd=Ge,m.OperationType=C,m.Route=P,m.RouterLink=Wr,m.RouterView=st,m.createFox=qi,m.createMemoryHistory=ts,m.createWebHashHistory=es,m.createWebHistory=bi,m.deleteContextValue=ks,m.extend=q,m.foxBusKey=tr,m.foxEventProxyKey=rr,m.foxKey=er,m.injectContextValue=qt,m.isArray=gt,m.isDate=ys,m.isESModule=Je,m.isEqual=St,m.isFunction=S,m.isMap=cs,m.isNil=ve,m.isObject=lr,m.isPlainObject=ar,m.isPromise=vs,m.isSet=hs,m.isString=ds,m.isSymbol=ms,m.onAfterRouteUpdate=ki,m.onBeforeRouteUpdate=Mi,m.onFoxActivated=Hs,m.onFoxInactivated=Ns,m.provideContextValue=Ms,m.rawState=qs,m.reactiveState=Cs,m.sessionKey=ie,m.shallowReactiveState=As,m.toBoolean=wt,m.toNumber=ws,m.toTypeString=We,m.typeOf=Rt,m.useBus=Li,m.useEventProxy=Ti,m.useFox=$i,m.useRoute=ji,m.useRouter=sr});
|
|
1
|
+
(function(p,d){typeof exports=="object"&&typeof module<"u"?d(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],d):(p=typeof globalThis<"u"?globalThis:p||self,d(p.Fox={},p.Vue))})(this,function(p,d){Object.defineProperty(p,Symbol.toStringTag,{value:"Module"});var me=typeof window<"u",j=function(){return window},We=function(){return window.document};function Je(e,t,r,s=!1){e.addEventListener?e.addEventListener(t,r,s):e.attachEvent?e.attachEvent(`on${t}`,r):e[`on${t}`]=r}function gt(e,t,r){e.removeEventListener?e.removeEventListener(t,r):e.detachEvent?e.detachEvent(`on${t}`,r):e[`on${t}`]=null}var ze=(e,t,r)=>{t=t??{bubbles:!1,cancelable:!1,detail:void 0};const s=document.createEvent("Events");let i=!0,n=!0;for(let o in t)o==="bubbles"?i=!!t[o]:o==="cancelable"?n=!!t[o]:s[o]=t[o];s.initEvent(e,i,n),(r??document).dispatchEvent(s)},bt=Array.isArray,ds=e=>Ge(e)==="[object Map]",ms=e=>Ge(e)==="[object Set]",ps=e=>e instanceof Date,S=e=>typeof e=="function",vs=e=>typeof e=="string",gs=e=>typeof e=="symbol",ar=e=>e!==null&&typeof e=="object",bs=e=>ar(e)&&S(e.then)&&S(e.catch),pe=e=>e==null,ws=Object.prototype.toString,Ge=e=>ws.call(e),ur=e=>Ge(e)==="[object Object]",Rs=typeof Symbol=="function"&&typeof Symbol.toStringTag=="symbol";function Xe(e){return e.__esModule||Rs&&e[Symbol.toStringTag]==="Module"}var Ss=typeof Promise<"u"&&Promise.toString().indexOf("[native code]")!==-1;function q(...e){let t=e[0]!==void 0&&e[0]!==null?e[0]:{},r=1,s=e.length,i=!1;for(typeof t=="boolean"&&(i=t,t=e[r]??{},r++),typeof t!="object"&&(t={});r<s;r++)if(e[r]!==null&&e[r]!==void 0){let n=e[r];for(let o in n){let u=t[o],l=n[o];if(u!==l)if(i===!0&&l&&typeof l=="object"){let a;Array.isArray(l)?a=u&&Array.isArray(u)?u:[]:a=u&&typeof u=="object"?u:{},t[o]=q(i,a,l)}else l!==void 0&&(t[o]=l)}}return t}function fr(e,t,r=!1){if(typeof t!="object")return{};typeof e!="object"&&(e={});for(let s of Reflect.ownKeys(t)){let i=e[s],n=t[s];if(i!==n)if(typeof n=="object"){if(!Array.isArray(n)&&!ur(n))continue;i=fr(i,n,r),e[s]=i}else{if(typeof n=="function")continue;e[s]=n}}return e}var Ce=class or{static seed=new Date().getTime();static get(){let t=++or.seed;return t>=Number.MAX_VALUE&&(or.seed=0),t}},wt=Ss?Promise.resolve():null;function Fe(e,...t){wt!==null?t&&t.length>0?wt.then(()=>{e(t)}):wt.then(e):t&&t.length>0?setTimeout(()=>{e(t)}):setTimeout(e)}function Rt(e){return e==null?!1:typeof e=="boolean"?e:typeof e=="string"?e.toLocaleLowerCase()==="true":!!e}function xs(e){return typeof e=="number"?e:Number(e)}var Es={"[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 St(e){let t=Object.prototype.toString.call(e);return e==null?String(e):Es[t]||"object"}function xt(e,t){if(e==t)return!0;if(e===void 0||t===void 0)return!1;let r=St(e);if(r!==St(t))return!1;if(r==="object"){let s=Object.keys(e),i=Object.keys(t);if(s.length!==i.length)return!1;for(let n=0;n<s.length;n++){let o=s[n],u=e[o],l=t[o];if(!xt(u,l))return!1}return!0}else if(r==="array"){if(e.length!==t.length)return!1;for(let s=0;s<e.length;s++){let i=e[s],n=t[s];if(!xt(i,n))return!1}return!0}return!1}var cr=e=>{const t={};for(let r of Reflect.ownKeys(e)){let s=e[r];s&&!Array.isArray(s)&&typeof s=="object"&&(s=cr(s)),typeof r=="symbol"?t[String(r)]=s:t[r]=s}return t},Ps=/^Symbol\((.*)\)$/,hr=e=>{const t={};for(let r of Reflect.ownKeys(e)){let s=e[r];s&&!Array.isArray(s)&&typeof s=="object"&&(s=hr(s));const i=Ps.exec(r);if(i&&i[1]){const n=Symbol.for(i[1]);t[n]=s}else t[r]=s}return t};function yr(e,t){let r=null;return function(...s){r&&clearTimeout(r),r=setTimeout(()=>{r=null,Reflect.apply(e,null,[...s])},t)}}var dr=Symbol("idKey"),oe=Symbol("valueKey"),x=Symbol("childrenKey"),V=Symbol("growKey"),mr=class{[V]=!0;[dr];[oe]=(0,d.ref)();[x]=new Map;constructor(e){this[dr]=e}},Cs=class{get(e,t){if(t=="value")return e[oe].value;if(t==="grow")return e[V];let r=e[x].get(t);if(r)return _e(r);if(e[V])return r=Pt(t),r[V]=e[V],e[x].set(t,r),_e(r)}set(e,t,r){return t=="value"?(e[oe].value=r,!0):t==="grow"?(e[V]=Rt(r),!0):r==null?(e[x].delete(t),!0):(console.error(`[Fox]illegal property:${t}`),!1)}deleteProperty(e,t){return t==="value"||t=="grow"?(console.error(`[Fox]can not delete property:${String(t)}`),!1):(e[x].delete(t),!0)}},Et="__proxy__";function Pt(e){const t=new mr(e);return Reflect.set(t,Et,new Proxy(t,new Cs)),t}function _e(e){return Reflect.get(e,Et)}var Fs=class{name="";persistPolicy="memory";storage;initFlag=!1;state={};constructor(e={},t){if(e.persistPolicy&&e.persistPolicy!=="memory"&&pe(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||this.persistPolicy==="memory")return null;let e=null;if(this.persistPolicy==="custom")e=this.storage;else if(me){const t=j();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}`,s=t.getItem(r);if(s){const i=JSON.parse(s);Object.assign(this.state,i),Reflect.ownKeys(this.state).forEach(n=>{if(typeof n!="string")return;const o=this.state[n],u=n.split(/\//g);u.push(o),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("/"),s=e[t-1];this.state[r]=s,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("/"),s={};Reflect.ownKeys(this.state).forEach(i=>{typeof i=="string"&&(i===r||i.startsWith(r)||(s[i]=this.state[i]))}),this.state=s,this.saveState()}catch(t){console.error(t)}}clear(){if(this.initFlag)try{this.state={},this.removeState()}catch(e){console.error(e)}}},pr=class extends mr{_persistHandler;constructor(e={},t){super("__root__"),this._persistHandler=new Fs(e,t),this._persistHandler.init(this)}put(...e){let t=e.length;if(t<2)return console.error("[Fox]参数至少包括一个(key, value)"),!1;let r=this;for(let s=0;s<t-1;s++){let i=e[s],n;r[x].has(i)?n=r[x].get(i):(n=Pt(i),r[x].set(i,n)),r=n}return r[oe].value=e[t-1],this._persistHandler.put(e),!0}get(...e){let t=e.length;if(t===0)return;let r=this;for(let s=0;s<t;s++){let i=e[s];if(r[x].has(i))r=r[x].get(i);else return}return r[oe].value}remove(...e){let t=e.length;if(t==0)return!1;let r=this;for(let i=0;i<t-1;i++){const n=e[i];if(r[x].has(n))r=r[x].get(n);else return!1}const s=e[t-1];return r[x].has(s)?(r[x].delete(s),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 n=e[i];if(r[x].has(n))r=r[x].get(n);else return!1}const s=e[t-1];return r[x].has(s)}clear(){this[x].clear(),this._persistHandler.clear()}},_s=["put","get","contains","remove","clear","_persistHandler"];function vr(e){return _s.includes(e)}var As=class{get(e,t){if(t=="value")return e[oe].value;if(t==="grow")return e[V];if(t===x)return e[x];if(typeof t=="string"&&vr(t))return e[t];const r=String(t);let s=e[x].get(r);if(s)return _e(s);if(e[V])return s=Pt(r),s[V]=e[V],e[x].set(r,s),_e(s)}set(e,t,r){return t=="value"?(e[oe].value=r,!0):t==="grow"?(e[V]=Rt(r),!0):vr(t)?!1:r==null?(e[x].delete(t),!0):(console.error(`[Fox]illegal property:${t}`),!1)}deleteProperty(e,t){return t==="value"||t=="grow"?(console.error(`[Fox]can not delete property:${String(t)}`),!1):(e[x].delete(t),!0)}};function js(e,t){const r=new pr(e,t),s=new As,i=new Proxy(r,s);return Reflect.set(r,Et,i),r}var Ct=new Proxy(pr,{construct(e,t){const r=t[0]??{},s=t[1];return _e(js(r,s))}}),Ft=e=>!e||typeof e!="object"?!0:Reflect.ownKeys(e).length===0,gr=class{name="";persistPolicy="memory";storage;constructor(e={}){if(e.persistPolicy&&e.persistPolicy!=="memory"&&pe(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||this.persistPolicy==="memory")return null;let e=null;if(this.persistPolicy==="custom")e=this.storage;else if(me){const t=j();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||Ft(e))return;const r=`_state_${this.name}`,s=JSON.stringify(e??{});t.setItem(r,s)}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}`,s=t.getItem(r);if(s){const i=JSON.parse(s);Object.assign(e,i)}}};function br(e,t,r){const s=new gr(r);s.restore(t);const i=u=>{const l=(0,d.toRaw)(u),a={};for(let f in l){const c=l[f];pe(c)||(a[f]=c)}Ft(a)?s.removeState():s.saveState(a)};let n=null;r&&r.debounce===!1?n=i:n=yr(i,r&&r.debounceDelay?r.debounceDelay:250);const o=e?(0,d.shallowReactive)(t):(0,d.reactive)(t);return(0,d.effectScope)(!0).run(()=>{(0,d.watch)(o,u=>{const l=(0,d.toRaw)(u);n(l)})}),o}function qs(e,t){return br(!1,e,t)}function $s(e,t){return br(!0,e,t)}function Ks(e,t){const r=new gr(t);r.restore(e);const s=n=>{const o=(0,d.toRaw)(n),u={};for(let l in o){const a=o[l];pe(a)||(u[l]=a)}Ft(u)?r.removeState():r.saveState(u)};let i=null;return t&&t.debounce===!1?i=s:i=yr(s,t&&t.debounceDelay?t.debounceDelay:250),new Proxy(e,{get(n,o){return n[o]},set(n,o,u){return n[o]=u,i(n),!0}})}function Ls(e,t){return Ks(e,t)}var le=(function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.Group=2]="Group",e})({}),F=(function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.ParamRegExp=2]="ParamRegExp",e[e.ParamRegExpEnd=3]="ParamRegExpEnd",e[e.EscapeNext=4]="EscapeNext",e})(F||{}),Ts={type:le.Static,value:""},Ms=/[a-zA-Z0-9_]/;function ks(e){if(!e)return[[]];if(e==="/")return[[Ts]];if(!e.startsWith("/"))throw new Error(`Invalid path "${e}"`);function t(y){throw new Error(`ERR (${r})/"${a}": ${y}`)}let r=F.Static,s=r;const i=[];let n;function o(){n&&i.push(n),n=[]}let u=0,l,a="",f="";function c(){a&&(r===F.Static?n.push({type:le.Static,value:a}):r===F.Param||r===F.ParamRegExp||r===F.ParamRegExpEnd?(n.length>1&&(l==="*"||l==="+")&&t(`A repeatable param (${a}) must be alone in its segment. eg: '/:ids+.`),n.push({type:le.Param,value:a,regexp:f,repeatable:l==="*"||l==="+",optional:l==="*"||l==="?"})):t("Invalid state to consume buffer"),a="")}function h(){a+=l}for(;u<e.length;){if(l=e[u++],l==="\\"&&r!==F.ParamRegExp){s=r,r=F.EscapeNext;continue}switch(r){case F.Static:l==="/"?(a&&c(),o()):l===":"?(c(),r=F.Param):h();break;case F.EscapeNext:h(),r=s;break;case F.Param:l==="("?r=F.ParamRegExp:Ms.test(l)?h():(c(),r=F.Static,l!=="*"&&l!=="?"&&l!=="+"&&u--);break;case F.ParamRegExp:l===")"?f[f.length-1]=="\\"?f=f.slice(0,-1)+l:r=F.ParamRegExpEnd:f+=l;break;case F.ParamRegExpEnd:c(),r=F.Static,l!=="*"&&l!=="?"&&l!=="+"&&u--,f="";break;default:t("Unknown state");break}}return r===F.ParamRegExp&&t(`Unfinished custom RegExp for param "${a}"`),c(),o(),i}var wr="[^/]+?",Is={sensitive:!1,strict:!1,start:!0,end:!0},W=(function(e){return e[e._multiplier=10]="_multiplier",e[e.Root=9*e._multiplier]="Root",e[e.Segment=4*e._multiplier]="Segment",e[e.SubSegment=3*e._multiplier]="SubSegment",e[e.Static=4*e._multiplier]="Static",e[e.Dynamic=2*e._multiplier]="Dynamic",e[e.BonusCustomRegExp=1*e._multiplier]="BonusCustomRegExp",e[e.BonusWildcard=-4*e._multiplier-e.BonusCustomRegExp]="BonusWildcard",e[e.BonusRepeatable=-2*e._multiplier]="BonusRepeatable",e[e.BonusOptional=-.8*e._multiplier]="BonusOptional",e[e.BonusStrict=.07*e._multiplier]="BonusStrict",e[e.BonusCaseSensitive=.025*e._multiplier]="BonusCaseSensitive",e})(W||{}),Bs=/[.+*?^${}()[\]/\\]/g;function Os(e,t){const r=q(!0,{},Is,t),s=[];let i=r.start?"^":"";const n=[];for(const a of e){const f=a.length?[]:[W.Root];r.strict&&!a.length&&(i+="/");for(let c=0;c<a.length;c++){const h=a[c];let y=W.Segment+(r.sensitive?W.BonusCaseSensitive:0);if(h.type===le.Static)c||(i+="/"),i+=h.value.replace(Bs,"\\$&"),y+=W.Static;else if(h.type===le.Param){const{value:m,repeatable:v,optional:R,regexp:w}=h;n.push({name:m,repeatable:v,optional:R});const g=w||wr;if(g!==wr){y+=W.BonusCustomRegExp;try{new RegExp(`(${g})`)}catch(I){throw new Error(`Invalid custom RegExp for param "${m}" (${g}): `+I.message)}}let T=v?`((?:${g})(?:/(?:${g}))*)`:`(${g})`;c||(T=R&&a.length<2?`(?:/${T})`:"/"+T),R&&(T+="?"),i+=T,y+=W.Dynamic,R&&(y+=W.BonusOptional),v&&(y+=W.BonusRepeatable),g===".*"&&(y+=W.BonusWildcard)}f.push(y)}s.push(f)}if(r.strict&&r.end){const a=s.length-1;s[a][s[a].length-1]+=W.BonusStrict}r.strict||(i+="/?"),r.end?i+="$":r.strict&&!i.endsWith("/")&&(i+="(?:/|$)");const o=new RegExp(i,r.sensitive?"":"i");function u(a){const f=a.match(o),c={};if(!f)return null;for(let h=1;h<f.length;h++){const y=f[h]||"",m=n[h-1];c[m.name]=y&&m.repeatable?y.split("/"):y}return c}function l(a){let f="",c=!1;for(const h of e){(!c||!f.endsWith("/"))&&(f+="/"),c=!1;for(const y of h)if(y.type===le.Static)f+=y.value;else if(y.type===le.Param){const{value:m,repeatable:v,optional:R}=y,w=m in a?a[m]:"";if(bt(w)&&!v)throw new Error(`Provided param "${m}" is an array but it is not repeatable (* or + modifiers)`);const g=bt(w)?w.join("/"):w;if(!g)if(R)h.length<2&&(f.endsWith("/")?f=f.slice(0,-1):c=!0);else throw new Error(`Missing required param "${m}"`);f+=g}}return f||"/"}return{re:o,score:s,keys:n,parse:u,stringify:l}}function Ds(e,t){const r=Os(ks(e),t);return function(s){const i=r.parse(s);return i?{path:s,params:i}:null}}var Rr="default",Sr=Symbol("sync"),M=Symbol("normalizeRoute");function xr(e){let t=!1;return function(...r){if(!t)return t=!0,Reflect.apply(e,{},r)}}function Hs(e){let t=e.src;return new Promise((r,s)=>{const i=xr(u=>{Xe(u)&&(u=u.default),e.component=u,console.debug("success load async module"),r()}),n=xr(u=>{`${u}`,console.debug("reject load async module"),s(u)});let o;try{o=t(i,n)}catch(u){n(u)}if(o)if(typeof o.then=="function")o.then(i,n);else{const u=o.component;u&&typeof u.then=="function"&&u.then(i,n)}})}var Ns=class{name;level;rootName;rootIndex=0;constructor(e,t,r,s){this.name=e,this.level=t,this.rootName=r,this.rootIndex=s}},Qe=class ys{to;routeModel;from;data={};constructor(t,r){this.to=t,this.from=r}static from(t){const r=new ys(t.to,t.from),s=t.data??{};return q(!0,r.data,s),r}static clear(t){for(let r in t)t[r]=void 0}},E=class lr{path;get fullPath(){const t=this.path??`${this.name}`;return`${this.root??"default"}!${t}`}alias;name;root;params;query;traceless;template;matched;meta;success;error;destroy;opsType;updateType;historyUpdatePolicy;viewTagAttrs;index;active;slot;static clone(t,r){let s=new lr;return fr(s,t,r),s}static isSame(t,r){return!t||!r?!1:t===r?!0:t.root!==r.root||t.index!==r.index?!1:t.path&&r.path&&t.path===r.path?!0:!!(t.name&&r.name&&t.name===r.name)}static isSamePathForRoute(t,r){return!t||!r?!1:t===r||t.path&&r.path&&t.path===r.path?!0:!!(t.name&&r.name&&t.name===r.name)}static from(t){let r=new lr;if(t==null)return r;let s=r;for(let n in t)s[n]=t[n];const i=Object.getOwnPropertySymbols(t);if(Array.isArray(i)&&i.length>0)for(let n of i)s[n]=t[n];return r}},Us=class{id;name;props;src;component;constructor(e,t,r){this.id=Ce.get(),this.name=e,this.src=t,typeof t!="function"&&(this.component=t),this.props=r}get isResolved(){return this.component!==void 0}resolve(){return Hs(this)}},Er=class{models=[]},_t=class{path;match;redirect;name;meta;matchedRoutes;layers=[]},_=(function(e){return e[e.Push=0]="Push",e[e.Replace=1]="Replace",e[e.Put=2]="Put",e[e.Append=3]="Append",e[e.Open=4]="Open",e})({}),At=(function(e){return e[e.Part=0]="Part",e[e.All=1]="All",e})({}),J=Symbol("rootKey"),z=Symbol("rootNodeKey"),ae=Symbol("parentNodeKey"),Ze=Symbol("nameKey"),re=class{model;route;active=!0;index=0;constructor(e,t,r=0,s=!0){this.route=e,this.model=t,this.index=r,this.active=s}},Ae=class{_slots;get slots(){return this._slots==null&&(this._slots=(0,d.shallowRef)([])),this._slots}get empty(){return this._slots==null||this._slots.value.length==0}[Ze];[J];[z]=null;[ae]=null;get name(){return this[Ze]}constructor(e,t,r){this[Ze]=e,this[J]=t,r&&(this[z]=r)}},D=class{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 s=e[r];if(s.view===t.view&&(t.index==-1||s.index===t.index)&&s.level===t.level)return!0}return!1}},jt=class{views=[]},Vs=class{layers=[]},Ws=class{time;route},Js=class{forbidTime=300;submitRecorder=new Ws;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)}},C=(function(e){return e.Busy="Busy",e.Free="Free",e.Reject="Reject",e.Exception="Exception",e.Finished="Finished",e})(C||{}),H=Symbol("chainKey"),k=Symbol("cursorKey"),qt=Symbol("$persistentModeKey"),A=Symbol("statusKey"),Z=Symbol("argsKey"),Ye=Symbol("exArgsKey"),ve=Symbol("successFnsKey"),je=Symbol("errorFnsKey"),ue=Symbol("sessionKey"),Y=Symbol("_go"),qe=class{[H]=[];[k]=0;[qt]=!1;[A]=C.Free;[Z]=[];[Ye]=[];[ve]=[];[je]=[];[ue];get session(){return this[ue]}constructor(e,t=!1){this[ue]=e,this[qt]=t}[Y](e,...t){let r=this[A];if(this[A]=C.Busy,this[k]+=e,this[k]<0&&(this[k]=0),this[Z]=t,r===C.Exception||r===C.Reject){let n=[{session:this[ue]},...this[Ye]];for(;this[je].length>0;)try{let o=this[je].shift();typeof o=="function"&&Fe(()=>{Reflect.apply(o,{},n)})}catch(o){console.error(o.message,o)}return this[A]=r,this[H]=[],this[k]=0,this}else if(r===C.Finished||this[k]>=this[H].length){let n=[{session:this[ue]},...this[Z]];for(;this[ve].length>0;){let o=this[ve].shift();typeof o=="function"&&Fe(()=>{Reflect.apply(o,{},n)})}return this[A]=C.Free,this}if(this[k]>=this[H].length)return this[A]=C.Free,this;let s=this[H][this[k]];this[qt]||(this[H].splice(0,this[k]+1),this[k]=-1);let i=this[k]+1;try{let n=!1,o={go:(u,...l)=>{n||(n=!0,Reflect.apply(this[Y],this,[u,...l]))},resolve:(...u)=>{n||(n=!0,Reflect.apply(this[Y],this,[1,...u]))},reject:(...u)=>{n||(n=!0,Reflect.apply(this.reject,this,[...u]))},insert:u=>{n||(this[H].splice(i,0,u),i++)},session:this[ue]};Fe(()=>{Reflect.apply(s,{},[o,...this[Z]])})}catch(n){this.throw(n)}return this}go(e,...t){return Reflect.apply(this[Y],this,[e,...t])}finish(...e){return this[A]=C.Finished,this[Z]=e,Reflect.apply(this[Y],this,[0])}reject(...e){return this[A]=C.Reject,this[Ye]=e,Reflect.apply(this[Y],this,[0])}throw(...e){return this[A]=C.Exception,this[Ye]=e,Reflect.apply(this[Y],this,[0])}reset(...e){this[A]=C.Busy,this[Z]=e,this[H]=[],this[k]=0;let t=[{session:this[ue]},...this[Z]];for(;this[ve].length>0;){let r=this[ve].shift();Fe(()=>{Reflect.apply(r,this,t)})}return this[A]=C.Free,this}post(e){return this[A]===C.Reject||this[A]===C.Exception?this:(Array.isArray(e)?this[H]=[...this[H],...e]:this[H].push(e),this[A]===C.Busy?this:(Reflect.apply(this[Y],this,[0,...this[Z]]),this))}wait(e,t){return e&&typeof e=="function"&&this[ve].push(e),t&&typeof t=="function"&&this[je].push(t),this[A]===C.Busy?this:(Reflect.apply(this[Y],this,[0,...this[Z]]),this)}exception(e){return e&&typeof e=="function"&&this[je].push(e),this[A]===C.Busy?this:Reflect.apply(this[Y],this,[0,...this[Z]])}isFinish(){return this[A]==C.Reject||this[A]==C.Free&&this[k]>=this[H].length}},ge=Symbol("_notifyChange"),Pr=class{currentRoute;routes;constructor(e,t){this.currentRoute=e,this.routes=t}},fe=Symbol("historyChangeConsumerKey"),Cr=Symbol("_navigateFirstRoute"),et=Symbol("_getRouteMark"),$t=Symbol("_getUrlSearch"),Kt=Symbol("_generateLocation"),tt=Symbol("_setRouteMarkRecorder"),$e=Symbol("beforeRestoreFiltersKey"),Fr=Symbol("_beforeRestore"),_r="Symbol(_fox_restore_point)";function Ke(e,...t){return typeof e=="function"?Reflect.apply(e,null,[...t]):e}function Ar(e){if(!Array.isArray(e))return!1;if(e.length===0)return!0;const t=e[0];return!!(Reflect.has(t,"path")&&Reflect.has(t,"root"))}var jr=class{base;storage;mode;query;firstNavigate=!0;historyMonitor;traceless=!1;changeHandler;historyChange;[fe]=!1;[$e]=new Array;backTimeout=320;constructor(e="hash",t="",r="",s=!0,i=!0,n=!1,o,u){this.mode=e,this.base=t,this.query=r,this.firstNavigate=s,this.historyMonitor=i,this.traceless=n,this.storage=o??j().sessionStorage,this.backTimeout=u??320}init(e=!0){const t=j();return typeof this.historyChange!="function"&&(this.historyChange=()=>{if(typeof this[fe]=="function"){const r=this[fe]();if(this[fe]=!1,r)return}else if(this[fe]===!0){this[fe]=!1;return}if(Ke(this.historyMonitor)){const r=t.history.state;this[ge](r);try{let s=[];if(typeof r=="string"?s=JSON.parse(r):s=r,Array.isArray(s)&&s.length>0){const i=this[et]()??"/";this[tt](i,s)}}catch{}}}),Je(t,"popstate",this.historyChange),this.firstNavigate&&e&&this[Cr](),Promise.resolve()}destroy(){this.historyChange&>(j(),"popstate",this.historyChange)}[Fr](e,t,r,s){for(let i of this[$e])try{const n=Reflect.apply(i,{},[e,t,r,s]);if(n===!1)return n}catch(n){console.error(n.message,n)}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}[Cr](){const e=this[et]()??"/",t=this.storage.getItem(_r);if(t)try{const n=JSON.parse(t);if(n.mark===e&&Array.isArray(n.routes)&&n.routes.length>0){const o=n.routes.filter((u,l)=>(u.params=u.params?hr(u.params):{},this[Fr](u,l,e,n.routes)));if(o.length>0){const u=this[$t](),l=o.length-1;o[l].query=u||o[l].query,this[ge](o);return}}}catch{}const r=e.indexOf("!");let s;r!=-1?s=e.substring(r+1):s=e;const i=new E;i.path=s,i.query=this[$t](),this[ge]([i])}[tt](e,t){try{t.forEach(s=>{s.params=s.params?cr(s.params):{}});const r=JSON.stringify({mark:e,routes:t});this.storage.setItem(_r,r)}catch(r){console.error(r.message,r)}}setRestorePoint(e){const t=this[et]()??"/";this[tt](t,e)}[ge](e){typeof this.changeHandler=="function"&&this.changeHandler(e)}[et](){const e=j();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}[$t](){let e=j().location.search;return e.length>0&&e.indexOf("?")===0&&(e=e.substring(1)),e}listen(e){this.changeHandler=e}go(e,t=!1){const r=j();this[fe]=t,r.history.go(e)}goBack(e,t){const r=j(),s=r.history.state;if(Ar(s)&&s.length>0){let i=!1;for(let a=s.length-1;a>=0;a--){const f=E.from(s[a]);if(!(f.historyUpdatePolicy==="traceless"||Ke(this.traceless,f))&&E.isSame(f,e)){i=!0;break}}if(!i){t();return}const n=this.backTimeout;let o=null;const u=()=>{r.history.go(-1),o=setTimeout(u,n)},l=()=>{clearTimeout(o);const a=j().history.state;if(Ar(a)&&a.length>0){let f=a.length;const c=a[f-1],h=E.from(c);if(E.isSame(h,e))return t(),!0;if(f>0){let y=!1;for(let m=f-1;m>=0;m--){const v=E.from(a[m]);if(!(v.traceless===!0||Ke(this.traceless,v))&&E.isSame(v,e)){y=!0;break}}return y?(setTimeout(()=>{o=setTimeout(u,n),this.go(-1,l)},0),!0):(t(),!0)}}return t(),!0};o=setTimeout(u,n),this.go(-1,l)}else t()}setRouteMark(e){const t=e.currentRoute.fullPath;this[tt](t,e.routes)}push(e){const t=this[Kt](e.currentRoute);e.currentRoute.historyUpdatePolicy!=="traceless"&&!Ke(this.traceless,e.currentRoute)&&j().history.pushState(e.routes,"",t),this.setRouteMark(e)}replace(e){const t=this[Kt](e.currentRoute);(e.currentRoute.historyUpdatePolicy!=="traceless"||!Ke(this.traceless,e.currentRoute))&&j().history.replaceState(e.routes,"",t),this.setRouteMark(e)}[Kt](e){const t=j();let r="";if(e.query){let o="";if(typeof e.query=="object")for(let u of Reflect.ownKeys(e.query)){let l=encodeURIComponent(e.query[u]),a=`${encodeURIComponent(String(u))}=${l}`;o.length>0&&(o+="&"),o+=a}else o=e.query;this.query?(r=o.length>0?`${this.query}&${o}`:this.query,r.length>0&&r.charAt(0)!=="?"&&(r=`?${r}`)):o.length>0&&(r=`?${o}`)}const s=t.location;let i=e.alias??e.fullPath;i.startsWith("default")&&(i=i.substring(Rr.length+1));let n;return r?this.mode=="path"?i.indexOf("/")===0?n=`${this.base}${i}${r}`:n=`${this.base}/${i}${r}`:n=`${s.pathname}${r}#${i}`:this.mode=="path"?i.indexOf("/")===0?n=`${this.base}${i}`:n=`${this.base}/${i}`:n=`${s.pathname}#${i}`,`${s.origin}${n}`}};function zs(e=!0,t=null,r="",s=!0,i=!1,n){return t!==null&&(t=j().location.pathname),t&&t.endsWith("/")&&(t=t.substring(0,t.length-1)),new jr("path",t??"",r,e,s,i,n)}function qr(e=!0,t="",r=!0,s=!1,i){return new jr("hash","",t,e,r,s,i)}var Gs=class{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}[ge](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 s=!1;if(typeof t=="function"?s=t():s=t,!s){const i=this.queue[r];this[ge](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 s=this.cursor;s>=0;s--){const i=this.queue[s];if(E.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 $r(e="",t=50){return new Gs(e,t)}function Oi(e){}var rt=Symbol("_constructRouteModel"),st=Symbol("_findRouteModel"),Lt=Symbol("_findRootView"),Xs=Symbol("_getFirstView"),ce=Symbol("_removeView"),Kr=Symbol("_buildPage"),Lr=Symbol("_resolveComponent"),Tr=Symbol("_update"),se=Symbol("_merge"),Tt=Symbol("_handleHistoryChange"),he=Symbol("_handleRouteUpdated"),it=Symbol("routeUpdatedCallback"),Mt=Symbol("currentRoute"),b=Symbol("currentRoutes"),nt=Symbol("routeSessionCacheKey"),Mr=Symbol("_addRouteRecorder"),Le=Symbol("_removeRouteRecorder"),ot=Symbol("_cloneRouteRecorder"),K=Symbol("_handleError"),lt=Symbol("errorCallback"),N=Symbol("registerKey"),at=Symbol("notFoundKey"),kt=Symbol("notFoundPathKey"),G=Symbol("forestKey"),P=Symbol("historyKey"),Te=Symbol("beforeFiltersKey"),Me=Symbol("afterFiltersKey"),ke=Symbol("destroyFiltersKey"),It=Symbol("propsFilterKey"),be=Symbol("mainDispatcherKey"),Bt=Symbol("initKey"),ye=Symbol("readyKey"),Ot=Symbol("readyHandlersKey"),ut=Symbol("_markReady"),kr=Symbol("_createNextFn"),Dt=Symbol("_start"),Ht=Symbol("_before"),Nt=Symbol("_after"),Ir=Symbol("_destroy"),Ut=Symbol("_load"),Ie=Symbol("_unload"),Be=Symbol("routerGuardKey");function Qs(e){return e.layers.length==0||e.layers[0].views.length==0}var Br=class{[N]=new Array;[at];[kt]="*";[ye]=!1;[Ot]=[];[G]=new Vs;[P];[b]=new Array;[Mt]=(0,d.shallowRef)(null);[nt]=new WeakMap;[lt]=null;[it]=null;[Te]=new Array;[Me]=new Array;[ke]=new Array;[It]=null;[be]=new qe;[Be]=new Js;[Bt]=!1;get currentRoute(){return(0,d.readonly)(this[Mt])}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]=me?qr():$r(),this[P]?.listen(async r=>{let s=!0;try{if(typeof r=="string"){const i=this[M](r);i&&await this[Tt]([i])}else await this[Tt](r)}catch(i){console.error(i.message,i),s=!1}this[ye]===!1&&this[ut](s)})}[K](e="error",t){if(t&&typeof t.error=="function")try{t.error(e)}catch{}if(typeof this[lt]=="function")try{this[lt](e,t)}catch{}console.error(e)}init(){this[Bt]!==!0&&(this[P]?.init(!this[ye]),this[Bt]=!0)}isReady(){return this[ye]?Promise.resolve():new Promise((e,t)=>{this[Ot].push([e,t])})}[ut](e){this[ye]=!0,this[Ot].forEach(([t,r])=>{try{e?t():r()}catch(s){console.error(s.message,s)}})}[Tt](e){try{if(!e){let n=[...this[b]].reverse();return this[Ie](n),me&&j().location.reload(),Promise.resolve()}let t=null,r=[],s=[],i=0;for(;i<e.length&&i<this[b].length&&E.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&&(s=this[b].slice(i).reverse()),s.length===0&&r.length===0){if(t!==null)return this.restore([t])}else if(s.length>0){if(this[Ie](s)){if(r.length>0)return this.restore(r);if(t!==null)return this.restore([t])}}else return this.restore(r)}catch(t){this[K](t)}return Promise.resolve()}[he](e=null){if(this[Mt].value=e,typeof this[it]=="function")try{this[it](e)}catch{}}[Mr](e,t){if(e.opsType===_.Open){let r=!1;const s=this[b].length-1;for(let i=s;i>=0;i--){const n=this[b][i];if(e.root==n.root){if(e.path===n.path){this[b].splice(i,1,e),r=!0;continue}e.active&&(n.active=!1)}}r||this[b].push(e)}else this[b].push(e);this[nt].set(e,t),this[he](e)}[ot](){let e=[];for(let t of this[b]){let r=E.clone(t,!0);e.push(r)}return e}[Le](e){if(!this[b]){this[he](null);return}let t=-1;for(let r=0;r<this[b].length;r++)if(E.isSame(this[b][r],e)){t=r;break}if(t!=-1){const r=this[b][t];this[b].splice(t,1);const s=this[nt].get(r);if(this[nt].delete(r),this[Ir](r,s),r.opsType===_.Append){const i=this[b].length-1;this[he](this[b][i]??null)}else this[he](null)}else this[he](null)}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[It]=e}get propsFilter(){return this[It]}setRestorePoint(){const e=this[ot]();this[P]?.setRestorePoint(e)}onRouteUpdated(e){this[it]=e}onError(e){this[lt]=e}beforeEach(e){this[Te].push(e)}removeBeforeEach(e){const t=this[Te].indexOf(e);return t!==-1?(this[Te].splice(t,1),!0):!1}afterEach(e){this[Me].push(e)}removeAfterEach(e){const t=this[Me].indexOf(e);return t!==-1?(this[Me].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 r=this[rt](e);if(t==-1)this[N]=[...this[N],...r];else for(let s=r.length-1;s>=0;s--)this[N].splice(t,0,r[s])}removeRoute(e){const t=this[M](e);if(t===null)return console.warn("[Fox]route格式错误",e),!1;for(let r=0;r<this[N].length;r++){const s=this[N][r];if(t?.path&&s.path===t.path)return this[N].splice(r,1),!0;if(t?.name&&s.name===t.name)return this[N].splice(r,1),!0}return!1}hasRoute(e){const t=this[M](e);return t===null?(console.warn("[Fox]route格式错误",e),!1):this[N].findIndex(r=>{if(t?.path&&r.path===t.path||t?.name&&r.name===t.name)return!0})!==-1}setNotFoundPath(e){this[kt]=e}setNotFoundRoute(e){const t=this[rt](e);this[at]=t[0]}getRoutes(){return[...this[N]]}[rt](e){let t=e.path??"";t.length>0&&t.charAt(0)!=="/"&&(t=`/${t}`);let r=e.components??(e.component&&{"":e.component});if(!r){const u=new _t;return u.path=t,u.redirect=e.redirect,[u]}const s=new E;s.path=t,s.name=e.name,s.meta=e.meta;let i=[];for(let u in r){const l=r[u];u.length===0&&(u=Rr);const a=new Us(u,l,e.props);i.push(a)}let n=!1,o=[];if(e.children)for(let u of e.children){const l=this[rt](u);for(let a of l){let f=new _t;f.name=a.name,a.path&&a.path.length>0?t!=="/"?f.path=`${t}${a.path}`:f.path=a.path:(n=!0,f.path=t);let c=new Er;c.models=[...i],f.layers=[c,...a.layers],f.matchedRoutes=[s,...a.matchedRoutes??[]],o.push(f)}}if(!n){const u=new Er;u.models=i;const l=new _t;l.name=e.name,l.path=t,l.matchedRoutes=[s],l.layers=[u],o.splice(0,0,l)}return o}[st](e){const t=e.route;try{for(let r of this[N]){const s=t.path?t.template??t.path:null,i=t.name?t.template??t.name:null;if(s&&r.path){let n=r.match;n||(n=r.match=Ds(r.path));const o=n(s);if(!o)continue;if(r.redirect){const u=new E;q(!0,u,t),u.path=r.redirect;const l={route:u,find:void 0};return this[st](l)?(e.route=l.route,e.find=l.find,t.template&&e.find&&(e.find={...e.find},e.find.path=t.path),!0):!1}if(t.params=t.params??{},q(!0,t.params,o.params),t.query){const u=t.query;if(typeof u=="string"){const l={},a=u.split("&");for(let f of a){const c=f.split("=");if(c.length!==2)continue;const h=decodeURIComponent(c[0].trim());l[h]=decodeURIComponent(c[1].trim())}q(!0,t.params,l)}else typeof u=="object"&&q(!0,t.params,u)}return e.find=r,t.template&&e.find&&(e.find={...e.find},e.find.path=t.path),!0}else if(i===r.name)return 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}[M](e){let t=null;if(Array.isArray(e))if(t=new E,typeof e[0]=="object")t=E.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&&q(!1,t,e[r]);else typeof e=="object"?t=E.from(e):typeof e=="string"&&(t=new E,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??"default",t.opsType=t.opsType??this.options.defaultOperationType??_.Push,t.traceless&&!t.historyUpdatePolicy&&(t.historyUpdatePolicy="traceless")}return t}push(...e){const t=this[M](e);return t?(t.opsType=_.Push,t.historyUpdatePolicy=t.historyUpdatePolicy??"push",this.to(t)):(this[K]("resolve route fail",t),this)}put(...e){const t=this[M](e);return t?(t.opsType=_.Put,t.historyUpdatePolicy=t.historyUpdatePolicy??"traceless",this.to(t)):(this[K]("resolve route fail",t),this)}replace(...e){const t=this[M](e);return t?(t.opsType=_.Replace,t.historyUpdatePolicy=t.historyUpdatePolicy??"replace",this.to(t)):(this[K]("resolve route fail",t),this)}append(...e){const t=this[M](e);return t?(t.opsType=_.Append,t.historyUpdatePolicy=t.historyUpdatePolicy??"push",this.to(t)):(this[K]("resolve route fail",t),this)}remove(e,t){return new Promise(r=>{this[be].post(s=>{try{if(this[b].length===0){s.resolve(),r(!1);return}let i=-1,n=null,o=[];if(e){if(n=e.root??"default",e.all)for(let l=this[b].length-1;l>0;l--){const a=this[b][l];if(a.opsType===_.Append){const f=a.root??"default";if(n&&n!==f)continue;o.splice(0,0,a),i=l-1}}else if(e.until)for(let l=this[b].length-1;l>0;l--){let a=this[b][l];if(a.opsType===_.Append&&a.root===n){if(e.until.charAt(0)==="/"&&e.until===a.path){i=l;break}else if(e.until===a.name){i=l;break}o.splice(0,0,a)}}else if(e.to)for(let l=this[b].length-1;l>0;l--){const a=this[b][l];if(a.opsType===_.Append){const f=a.root??"default";if(n&&n!==f)continue;if(o.splice(0,0,a),e.to.charAt(0)==="/"&&e.to===a.path){i=l-1;break}else if(e.to===a.name){i=l-1;break}}}}else for(let l=this[b].length-1;l>0;l--){let a=this[b][l];if(a.opsType===_.Append){o.push(a),i=l-1;break}}if(i===-1||o.length===0){const l="[Fox]can not find route";console.warn(l),s.resolve(l),r(!1);return}let u=null;if(i!==-1&&(u=this[b][i]),this[Ie](o)){if(t===!1)return s.resolve(),r(!0),!0;const l=()=>(s.resolve(),r(!0),!0),a=this[b].length;if(u&&E.isSame(u,this[b][a-1])){this[P]?.goBack(u,l);return}l()}}catch(i){this[K](i),s.resolve(),r(!1)}})})}open(...e){const t=this[M](e);return t?(t.opsType=_.Open,t.historyUpdatePolicy=t.historyUpdatePolicy??"push",this.to(t)):(this[K]("resolve route fail",t),this)}close(e){return this[be].post(t=>{try{let r=this[M](e);if(!r){t.reject("resolve route fail");return}let s=[];for(let i=0;i<this[b].length;i++){let n=this[b][i];if(n.root===r.root){if(!r.path&&!r.name){s.push(n);continue}if(r.path&&r.path===n.path){s.push(n);break}else if(r.name&&r.name===n.name){s.push(n);break}}}if(s.length===0){t.resolve();return}this[Ie](s),t.resolve()}catch(r){this[K](r),t.resolve()}}),this}to(...e){const t=this[M](e);if(!t)return this[K]("resolve route fail",t),this;const r=this[Be].acquire(t);return r==null?(this[K]("route forbid",t),this):(this[be].post(s=>{try{let i=this[Dt](t);this[Ht](i),this[Ut](i),this[Nt](i),i.wait((n,o)=>{const u=n.session.to;if(n.session.updateResult&&n.session.updateResult.status==="success")try{const l=new Pr(E.clone(u,!0),this[ot]());u.historyUpdatePolicy==="replace"?this[P]?.replace(l):u.historyUpdatePolicy==="traceless"?this[P]?.setRouteMark(l):this[P]?.push(l)}catch(l){console.error(l.message,l)}if(Qe.clear(n.session),this[Be].release(r),typeof t.success=="function")try{Reflect.apply(t.success,{},[])}catch(l){console.error(l.message,l)}this[ye]===!1&&this[ut](!0),i=null,s.resolve()},(n,o)=>{this[Be].release(r),o!==null&&this[K](o,t),this[ye]===!1&&this[ut](!1),Qe.clear(n.session),i=null,s.resolve()})}catch(i){this[Be].release(r),this[K](i,t),s.resolve()}}),this)}back(e=1){this[P]?.go(-e,!1)}[kr](e){return(t,r)=>{if(typeof t=="boolean")e.session.redirect=!1,t?e.resolve():e.reject(r??null);else if(t){const s=this[M](t);if(s){const i=e.session.to;s.success=i.success,s.error=i.error,e.session.to=s,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()}}[Dt](e){const t=new Qe(e,this[b].length>0?this[b][this[b].length-1]:void 0),r={route:e,find:null};if(this[st](r),r.find){t.routeModel=r.find,e.matched=r.find.matchedRoutes??[];const s={};if(Array.isArray(r.find?.matchedRoutes))for(let i=0;i<r.find.matchedRoutes.length;i++){const n=r.find.matchedRoutes[i];n.meta&&typeof n.meta=="object"&&Object.assign(s,n.meta)}e.meta&&typeof e.meta=="object"&&Object.assign(s,e.meta),e.meta=s}return new qe(t)}[Ht](e){for(let t of this[Te])e.post(r=>{const s=this[kr](r);Reflect.apply(t,{},[r.session.to,r.session.from,s,r.session])})}[Nt](e){e.post(t=>{for(let r of this[Me])try{Reflect.apply(r,{},[t.session.to,t.session.from,t.session])}catch(s){console.error(s.message,s)}t.resolve()})}[Ir](e,t){for(let r of this[ke])try{Reflect.apply(r,{},[e,t])}catch(s){console.error(s.message,s)}typeof e.destroy=="function"&&Reflect.apply(e.destroy,e,[])}[Ut](e){e.post(t=>{const r=t.session.to;let s=t.session.routeModel;if(s==null){let n={route:r,find:null};if(this[st](n))s=n.find,t.session.routeModel=s;else if(this[at])s=this[at];else{t.reject(`not find route model, path:${r.path??r.name}`);return}}const i=Qe.from(t.session);this[Kr](r,s,i).then(n=>{this[G],t.session.updateResult=n??{status:"success",message:""},t.resolve()},n=>{t.reject(n)})})}[Ie](e){if(e.length==0)return!0;let t=this[G],r=[];for(let s of e){let i=this[Lt](t,s);i!=null&&r.push({...i,route:s})}if(r.length==0)return this[K]("can not find view index"),!1;for(let s of r.reverse())this[ce](t,{x:s.x,y:s.y},[s.route.index??0],!0);return!0}[Lt](e,t){const r=t.root??"default";let s;for(let i=0;i<e.layers.length;i++){const n=e.layers[i];for(let o=n.views.length-1;o>=0;o--){const u=n.views[o];if(u[J]&&u[Ze]===r)return s={x:o,y:i},s}}return null}[Xs](e){return e.layers.length>0&&e.layers[0].views.length>0?e.layers[0].views[0]:null}[ce](e,t,r=null,s=!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],n=!1,o=[],u=!1,l=[...i.slots.value];for(let f=l.length-1;f>=0;f--){let c=l[f];(!r||r.indexOf(c.index)!=-1)&&(c.route&&i[J]&&(this[Le](c.route),c.active===!0&&c.route.opsType==_.Append&&(u=!0)),o.push(new D(i,c.index,t.y)),l.splice(f,1))}if(l.length==0)s?i.slots.value=l:e.layers[t.y].views.splice(t.x,1);else{if(u){let f=l[l.length-1];f.active=!0,f.route&&(f.route.active=f.active)}i.slots.value=l}e.layers[t.y].views.length==0&&(n=!0);let a=t.y+1;for(;a<e.layers.length;a++){let f=e.layers[a].views,c=[];for(let h=f.length-1;(n||o.length>0)&&h>=0;h--){let y=f[h];if(y[ae]&&(n||D.include(o,y[ae]))){let m=y.slots.value;for(let v=m.length-1;v>=0;v--){let R=m[v];R.route&&y[J]&&this[Le](R.route),c.push(new D(y,R.index,a)),m.splice(v,1)}e.layers[a].views.splice(h,1)}}o=c,e.layers[a].views.length==0&&(n=!0)}}restore(e){if(!e||this[N].length==0){let t=this[G];if(t.layers.length>0){let r=t.layers[0].views;r.length>0&&(r[0].slots.value=[])}return this[b]=[],this[he](null),Promise.resolve()}else return new Promise((t,r)=>{let s=null,i=!1;for(let n=0;n<e.length;n++){const o=e[n];this[be].post(u=>{const l=this[Dt](o);this[Ht](l),this[Ut](l),this[Nt](l),l.wait((a,f)=>{s=a.session.to,i=a.session.redirect,u.resolve()},(a,f)=>{s=null,f!==null&&this[K](f),u.resolve()})})}this[be].post(n=>{if(s&&i===!0){const o=new Pr(E.clone(s,!0),this[ot]());this[P]?.replace(o)}n.resolve(),t()})})}async[Kr](e,t,r){const s=e.updateType??At.Part;await this[Lr](t);const i=this[Tr](t,e,r,s);if(i.status==="error")throw Error(i.message);return i}[Lr](e){let t=[];for(let r=0;r<e.layers.length;r++){let s=e.layers[r];for(let i=0;i<s.models.length;i++){let n=s.models[i];n.isResolved||t.push(n.resolve())}}return t.length>0?Promise.all(t):Promise.resolve()}[Tr](e,t,r,s){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 n=this[G],o=Qs(n),u=t.root??"default",l;!o&&s==At.Part&&(l=this[Lt](n,t));let a,f=0;if(l==null||l==null)if(o||s===At.All)n.layers.length==0&&(n.layers[0]=new jt),n.layers[0].views.length==0?(a=new Ae(t.root??"default",!0,null),n.layers[0].views=[a]):a=n.layers[0].views[0],l={x:0,y:0};else{let c=t.slot;if(!c)return{status:"error",message:"can not rebuild view(because not route slot)"};let h=c.level;if(h>n.layers.length)return{status:"error",message:"can not insert view(override level)"};let y;if(c.rootName){let m=n.layers[h-1];for(let v of m.views){if(v[J]&&v.name===c.rootName){y=new D(v,c.rootIndex??0,h-1);break}if(v[z]&&v[z].view.name===c.rootName&&v[z].index===c.rootIndex){y=v[z];break}}}if(!y)return{status:"error",message:"can not insert view(not find root node ref)"};a=new Ae(u,!0,y),n.layers[h].views.push(a),l={x:n.layers[h].views.length-1,y:h}}else a=n.layers[l.y].views[l.x];if(f=l.y,a[J]=!0,t.opsType===_.Append){t.index=t.index??Ce.get(),t.active=!0;let c=a.slots.value;if(c.length>0){let R=c[c.length-1];R.active=!1,R.route&&(R.route.active=R.active)}let h=new re(t,i,t.index,!0);a.slots.value=[...c,h];let y=f+1,m=1,v=new D(a,t.index,f);this[se](n,y,e,m,v)}else if(t.opsType===_.Open){let c=a.slots.value;const h=t.active??!0;let y=!1;for(let m of c){if(m.route!==null&&E.isSamePathForRoute(m.route,t)){if(m.active===h)return t.index=m.index,t.active=h,m.route=t,{status:"noChange",message:""};m.active=h,y=!0,t.index=m.index,t.active=h,m.route=t}else h&&(m.active=!1);m.route&&(m.route.active=m.active)}if(!y){t.index=t.index??Ce.get(),t.active=h;let m=new re(t,i,t.index,h);c.push(m);let v=f+1,R=1,w=new D(a,t.index,f);this[se](n,v,e,R,w)}a.slots.value=[...c]}else{let c=a.slots.value;if(c.length==0){t.index=t.index??Ce.get(),t.active=!0,a.slots.value=[new re(t,i,t.index)];let h=f+1,y=1,m=new D(a,t.index,f);this[se](n,h,e,y,m)}else{let h=c[0];if(h.model!==i){this[ce](n,l,null,!0),t.index=t.index??Ce.get(),t.active=!0,a.slots.value=[new re(t,i,t.index)];let y=f+1,m=1,v=new D(a,t.index,f);this[se](n,y,e,m,v)}else{h.route!==null&&this[Le](h.route);let y=!1;const m=t.active??!0;h.active!==m&&(h.active=m,y=!0),t.active=m,t.index=h.index,h.route=t;let v=[];for(let I=1;I<c.length;I++)v.push(c[I].index);v.length>0?this[ce](n,l,v,!0):y&&(a.slots.value=[...c]);let R=[new D(a,t.index,f)],w=f+1,g=1,T=new D(a,t.index,f);for(;R.length>0&&w<n.layers.length&&g<e.layers.length;w++,g++){let I=[];for(let B=0;B<n.layers[w].views.length;B++){let L=n.layers[w].views[B];L[ae]&&D.include(R,L[ae])&&I.unshift(B)}let Ue=[];for(let B of I){let L=n.layers[w].views[B],de=e.layers[g].models,te;for(let O=0;O<de.length;O++)if(L.name===de[O].name){te=de[O];break}if(!te)this[ce](n,{x:B,y:w},null,!1);else{let O=L.slots.value;if(O.length==0){let ee=0;L.slots.value=[new re(null,te,ee)];let X=w+1,Q=g+1;this[se](n,X,e,Q,T)}else{let ee=O[0];if(ee.model!==te){this[ce](n,{x:B,y:w},null,!0),L.slots.value=[new re(null,te,0)];let X=w+1,Q=g+1;this[se](n,X,e,Q,T)}else{L[J]&&ee.route!==null&&this[Le](ee.route);let X=[];for(let Q=1;Q<O.length;Q++)X.push(O[Q].index);X.length>0&&this[ce](n,{x:B,y:w},X,!0),Ue.push(new D(L,ee.index,w))}}L[J]=!1}}R=Ue}this[se](n,w,e,g,T)}}}if(a&&a[z]){let c=a[z];c&&(t.slot=new Ns(u,f,c?.view.name,c?.index??0))}return r.to=void 0,r.routeModel=void 0,this[Mr](t,r),{status:"success",message:""}}[se](e,t,r,s,i){let n=s,o=t;for(;o<e.layers.length&&n<r.layers.length;o++,n++){let u=e.layers[o].views;for(let l of r.layers[n].models){let a=new Ae(l.name,!1,i),f=new re(null,l);a.slots.value=[f],u.push(a)}}for(;n<r.layers.length;n++){let u=new jt;u.views=[];for(let l of r.layers[n].models){let a=new Ae(l.name,!1,i),f=new re(null,l);a.slots.value=[f],u.views.push(a)}e.layers.push(u)}}[Sr](e,t,r,s,i,n){if(t<0||t>this[G].layers.length)return null;if(t<this[G].layers.length){let a=this[G].layers[t],f=null;for(let c of a.views){let h=!1;if(r!==null?(h=c.name===e&&c[z]?.view===r,h&&s!==-1&&(h=c[z]?.index===s)):h=c.name===e,!!h){i!==null&&(c[ae]={view:i,index:n,level:t-1}),f=c;break}}if(f!==null)return f}let o=null,u=null;i!==null&&(i[J]?o={view:i,index:n,level:t-1}:o=i[z],u={view:i,index:n,level:t-1});let l=new Ae(e,!0,o);if(l[ae]=u,t==this[G].layers.length){let a=new jt;a.views=[l],this[G].layers.push(a)}else this[G].layers[t].views.push(l);return l}},Oe=Symbol("rk"),Vt=Symbol("vd"),Or=Symbol("rv"),Wt=Symbol("rvi"),Dr=Symbol("pv"),Jt=Symbol("pvi"),De=Symbol("registerKey"),Hr=Symbol("lc"),Zs=class{[De]=new Map;constructor(){}set(e,t){this[De].set(e,t)}get(e){return this[De].get(e)}has(e){return this[De].has(e)}delete(e){return this[De].delete(e)}},ie=new WeakMap,He=[];function ft(e,t=!1){let r=e?ie.get(e)??null:null;return t&&!r&&(r=new Zs,e&&ie.set(e,r),(0,d.onScopeDispose)(()=>{e&&ie.delete(e)}),(0,d.provide)(Hr,r)),r}function Ne(e){let t=e?ie.get(e)??null:null;return!t&&(0,d.hasInjectionContext)()&&(t=(0,d.inject)(Hr,null)),!t&&He.length>0&&(t=He[He.length-1]),t}async function Nr(e,t){He.push(e);try{return await t()}finally{He.pop()}}function Ys(e){const t=(0,d.getCurrentScope)();if(!t)return!1;const r=Ne();if(!r)return!1;if(ie.set(t,r),Array.isArray(e))for(let s=0;s<e.length;s++)ie.set(e[s],r);return(0,d.onScopeDispose)(()=>{if(ie.delete(t),Array.isArray(e))for(let s=0;s<e.length;s++)ie.delete(e[s])}),!0}function zt(e,t){return Ne(e)?.get(t)??null}function ei(e,t,r){Ne(e)?.set(t,r)}function ti(e,t,r){Ne(e)?.delete(t)}var ct=Symbol("hooksKey");function ri(e){let t=e.get(ct);t||(t=[],e.set(ct,t))}function Ur(e,t){const r=e.get(ct);r!=null&&Nr(e,async()=>{for(let s=r.length-1;s>=0;s--){let i=r[s];if(i.type===t)try{await Reflect.apply(i.hook,null,[])}catch(n){console.error(n.message,n)}}})}var ht=(function(e){return e.INACTIVATED="ia",e.ACTIVATED="a",e})({}),si=class{type;hook;constructor(e,t){this.hook=t,this.type=e}};function ii(e,t,r){const s=new si(t,r);return e.push(s),!0}function ni(e,t,r){let s=-1;for(let i=0;i<e.length;i++){const n=e[i];if(n.type===t&&n.hook===r){s=i;break}}return s!=-1?(e.splice(s,1),!0):!1}function Vr(e){return t=>{const r=zt(null,ct);if(r==null){console.warn("[Fox]hooks context not found");return}(0,d.onScopeDispose)(()=>{ni(r,e,t)}),ii(r,e,t)}}var oi=function(e){(0,d.onActivated)(e),Vr(ht.ACTIVATED)(e)},li=function(e){(0,d.onDeactivated)(e),Vr(ht.INACTIVATED)(e)},Wr=Symbol("routeKey");function Jr(e,t){e.set(Wr,t)}function Gt(e){const t=zt(e??null,Wr);return typeof t=="function"?t():t}var zr="FoxBeforeEnter",Gr="FoxEnter",Xr="FoxLeave",Qr="FoxLeave",yt="FoxLeaveEnd";function Zr(e,t=!1){let r=null;return t?r=e.showFromClass??e.enterFromClass:r=e.enterFromClass,r||(r=e.transitionName,r?t?`${r}-show-from`:`${r}-enter-from`:null)}function Yr(e,t=!1){let r=null;return t?r=e.showActiveClass??e.enterActiveClass:r=e.enterActiveClass,r||(r=e.transitionName,r?t?`${r}-show-active`:`${r}-enter-active`:null)}function ai(e,t=!1){let r=null;return t?r=e.showToClass??e.enterToClass:r=e.enterToClass,r||(r=e.transitionName,r?t?`${r}-show-to`:`${r}-enter-to`:null)}function es(e,t=!1){let r=null;return t?r=e.hideFromClass??e.leaveFromClass:r=e.leaveFromClass,r||(r=e.transitionName,r?t?`${r}-hide-from`:`${r}-leave-from`:null)}function ts(e,t=!1){let r=null;return t?r=e.hideActiveClass??e.leaveActiveClass:r=e.leaveActiveClass,r||(r=e.transitionName,r?t?`${r}-hide-active`:`${r}-leave-active`:null)}function ui(e,t=!1){let r=null;return t?r=e.hideToClass??e.leaveToClass:r=e.leaveToClass,r||(r=e.transitionName,r?t?`${r}-hide-to`:`${r}-leave-to`:null)}function fi(e,t=!1){let r=null;return t?r=e.beforeShow??e.beforeEnter:r=e.beforeEnter,r}function ci(e,t=!1){let r=null;return t?r=e.show??e.enter:r=e.enter,r}function hi(e,t=!1){let r=null;return t?r=e.afterShow??e.afterEnter:r=e.afterEnter,r}function yi(e,t=!1){let r=null;return t?r=e.showCancelled??e.enterCancelled:r=e.enterCancelled,r}function di(e,t=!1){let r=null;return t?r=e.beforeHide??e.beforeLeave:r=e.beforeLeave,r}function mi(e,t=!1){let r=null;return t?r=e.hide??e.leave:r=e.leave,r}function pi(e,t=!1){let r=null;return t?r=e.afterHide??e.afterLeave:r=e.afterLeave,r}function vi(e,t=!1){let r=null;return t?r=e.hideCancelled??e.leaveCancelled:r=e.leaveCancelled,r}function Xt(e){let t,r=e.transitionDuration;return typeof r=="object"?t={enter:r.enter??-1,leave:r.leave??-1,show:r.show??-1,hide:r.hide??-1}:(typeof r=="string"&&(r=r.length==0?-1:Number(r)),t={enter:r,leave:r,show:r,hide:r}),t}function we(e,t){e.classList.contains(t)||e.classList.add(t)}function Re(e,t){e.classList.remove(t)}var gi=me&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout;function dt(e){gi(e)}function $(e,t){S(e)&&Reflect.apply(e,null,t)}function rs(e,t,r=-1,s,i,n){let o=[];const u=()=>{for(let l of o)gt(e,l.type,l.listener);o=[]};if(S(i)){if(s!==void 0&&s>=0){setTimeout(()=>{Reflect.apply(i,null,[e,t,r])},s);return}const l=["animationend","transitionend",yt],a=f=>{(f.target||f.srcElement)===f.currentTarget&&(u(),Reflect.apply(i,null,[e,t,r]))};l.forEach(f=>{Je(e,f,a),o.push({type:f,listener:a})})}if(S(n)){const l="animationcancel",a=f=>{(f.target||f.srcElement)===f.currentTarget&&(u(),Reflect.apply(n,null,[e,t,r]))};Je(e,l,a),o.push({type:l,listener:a})}}function mt(e){return!me||e===null?!1:e.opsType===_.Append||e.opsType===_.Open}function ss(e,t,r={},s,i=-1){if(e||mt(s)){const n=Zr(r,e);n&&we(t,n);const o=Yr(r,e);o&&we(t,o),$(fi(r,e),[t,e,s,i])}}function is(e,t,r={},s,i,n,o){if(!mt(i)&&!e){S(o)&&o(o,[t]);return}const u=Zr(r,e),l=Yr(r,e),a=ai(r,e),f=ci(r,e),c=hi(r,e),h=yi(r,e);if(!u&&!l&&!a&&!f){S(o)&&o(o,[t]);return}dt(()=>{rs(t,i,n,s,()=>{l&&Re(t,l),a&&Re(t,a),S(c)&&$(c,[t,e,i,n]),S(o)&&o(o,[t])},()=>{S(h)&&$(h,[t,e,i,n])}),u&&Re(t,u),a&&we(t,a),S(f)&&$(f,[t,e,i,n])})}function ns(e,t,r={},s,i=-1){if(e||mt(s)){const n=es(r,e);n&&we(t,n);const o=ts(r,e);o&&we(t,o),$(di(r,e),[t,e,s,i])}}function os(e,t,r={},s,i,n,o,u){if(!mt(n)&&!e){S(u)&&$(u,[t]),!e&&S(i)&&i();return}const l=es(r,e),a=ts(r,e),f=ui(r,e),c=mi(r,e),h=pi(r,e),y=vi(r,e);if(!l&&!a&&!f&&!c){S(u)&&$(u,[t]),!e&&S(i)&&i();return}dt(()=>{rs(t,n,o,s,()=>{try{a&&Re(t,a),f&&Re(t,f),S(h)&&$(h,[t,e,n,o]),S(u)&&$(u,[t])}finally{!e&&S(i)&&i()}},()=>{try{S(y)&&$(y,[t,e,n,o]),S(u)&&$(u,[t])}finally{!e&&S(i)&&i()}}),l&&Re(t,l),f&&we(t,f),S(c)&&$(c,[t,e,n,o])})}function Qt(e,t={},r,s=-1){const i=t.mode??"default",n=Xt(t);return{mode:i,persisted:!1,beforeEnter:o=>{ss(!1,o,t,r,s)},enter:o=>{is(!1,o,t,n.enter,r,s)},leave:(o,u)=>{ns(!1,o,t,r,s),os(!1,o,t,n.leave,u,r,s,()=>{e.transition=null})},clone:o=>Qt(e,t,r,s)}}function ls(e){return e.el}function bi(e,t={},r,s,i,n){if(i===!0){const o=ls(e);if(o==null)return;const u=Xt(t);ss(!0,o,t,r,s),is(!0,o,t,u.show,r,s,l=>{S(n)&&$(n,[l])})}else S(n)&&$(n,[])}function wi(e,t={},r,s,i,n){if(i===!0){const o=ls(e);if(o==null)return;const u=Xt(t);ns(!0,o,t,r,s),os(!0,o,t,u.hide,null,r,s,l=>{S(n)&&$(n,[l])})}else S(n)&&$(n,[])}function Ri(e){dt(()=>{for(let t=0;t<e.length;t++)Reflect.apply(e[t],null,[])})}function as(e,t={},r,s=-1){return{mode:t.mode??"default",persisted:!1,beforeEnter:i=>{ze(zr,{},i)},enter:i=>{ze(Gr,{},i)},leave:(i,n)=>{ze(Xr,{},i),dt(()=>{const o=u=>{(u.target||u.srcElement)===u.currentTarget&&(gt(i,yt,o),n&&Reflect.apply(n,null,[]),e.transition=null)};Je(i,yt,o),ze(Qr,{},i)})},clone:i=>as(e,t,r,s)}}function ne(e,t,r){return typeof e=="function"?Reflect.apply(e,{},[t,r]):e}function Zt(e,t){if(!e)return null;const r=e(t);return r.length===1?r[0]:r}function Se(e,t){return typeof t=="function"?t(e):e}var Si=class{node;state;constructor(e,t){this.node=e,this.state=t}},pt=(0,d.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},transitionDuration:{type:[String,Number,Object],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(e,t){const r=(0,d.getCurrentScope)(),s=e.multi===!0,i=(0,d.inject)(Oe,null),n=(0,d.inject)(Vt,0),o=(0,d.inject)(Or,null),u=(0,d.inject)(Wt,-1);let l=null,a=e.modelSlot??null;if(a){if((0,d.provide)(Vt,n+1),(0,d.provide)(Wt,a.index),(0,d.provide)(Jt,a.index),!a.route){console.warn("[Fox]child view render error, route not exist");return}const c=ft(a,!0);c&&(ri(c),Jr(c,()=>a?.route??null))}else{if(i==null){console.error("[Fox]router is not been injected");return}const c=e.name,h=(0,d.inject)(Dr,null),y=(0,d.inject)(Jt,0);if(l=i[Sr](c,n,o,u,h,y),l===null)return;(0,d.provide)(Dr,l);const m=l[J]===!0;if(m&&(0,d.provide)(Or,l),!s&&((0,d.provide)(Wt,-1),(0,d.provide)(Vt,n+1),(0,d.provide)(Jt,-1),m&&r)){const v=ft(r,!0);v&&Jr(v,()=>{const R=l?.slots.value??[];return R.length>0?R[0].route:null})}}const f={value:new Map};return(0,d.onScopeDispose)(()=>{if(f.value&&f.value.clear(),a){const c=a;c.route=null,c.model=null,c.instance=null,a=null}}),()=>{if(s){const c=new Map,h=[],y=l?.slots.value,m=[];for(let w=0;w<y.length;w++){const g=y[w],T=`${e.name}_${g.index}`,I=ne(e.transition,g.route,w)??!0,Ue={modelSlot:g};let B;t.slots.default?B=(0,d.h)(pt,Ue,{default:t.slots.default}):B=(0,d.h)(pt,Ue);const L={},de=ne(e.viewClass,g.route,w);typeof de=="string"&&de.length>0&&(L[de]=!0);const te=ne(e.viewActiveClass,g.route,w),O=ne(e.viewInactiveClass,g.route,w),ee=f.value.get(T);if(typeof te=="string"&&te.length>0&&(L[te]=g.active),typeof O=="string"&&O.length>0&&(L[O]=!g.active),ee&&g.active!==ee.state){const hs=ee.node;g.active?m.unshift(()=>{const nr=()=>{const Ve=ft(g);Ve!=null&&Ur(Ve,ht.ACTIVATED)};bi(hs,e,g.route,w,I,nr)}):m.push(()=>{const nr=()=>{const Ve=ft(g);Ve!=null&&Ur(Ve,ht.INACTIVATED)};wi(hs,e,g.route,w,I,nr)})}const X={class:L,key:T},Q=ne(e.viewTagProps,g.route,w);Q!==null&&typeof Q=="object"&&q(!0,X,Se(Q,i?.propsFilter)),g.route?.viewTagAttrs&&typeof g.route?.viewTagAttrs=="object"&&q(!0,X,Se(g.route.viewTagAttrs,i?.propsFilter));const Pe=(0,d.h)(ne(e.viewTag,g.route,w),X,{default:()=>[B]});c.set(T,new Si(Pe,g.active)),f.value.delete(T),I===!0?Pe.transition=Qt(Pe,e,g.route,w):I==="custom"&&(Pe.transition=as(Pe,e,g.route,w)),h.push(Pe)}f.value=c,Ri(m);const v=ne(e.tag,null,-1),R={};return Object.assign(R,t.attrs),(0,d.h)(v,R,{default:()=>h})}else if(a!=null){const c=a.model,h={};c.props&&(typeof c.props=="object"?q(!1,h,Se(c.props,i?.propsFilter)):c.props===!0&&typeof a.route?.params=="object"&&q(!1,h,Se(a.route.params,i?.propsFilter)));const y=(0,d.h)(c.component,h);return Zt(t.slots.default,{Component:y,route:a.route})??y}else{const c=l?.slots.value??[];if(c.length>0){const h=c[0],y=h.route,m=h.model,v={};m.props&&(typeof m.props=="object"?q(!1,v,Se(m.props,i?.propsFilter)):m.props===!0&&typeof y?.params=="object"&&q(!1,v,Se(y.params,i?.propsFilter)));const R=(0,d.h)(m.component,v);return(ne(e.transition,y,-1)??!0)&&(R.transition=Qt(R,e,y,-1)),Zt(t.slots.default,{Component:R,route:y})??R}else return Zt(t.slots.fallback,{})}}}});function xi(e){if(!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)&&!e.defaultPrevented&&!(e.button!=null&&e.button!==0)){if(e.currentTarget&&e.currentTarget.getAttribute){const t=e.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(t))return}return e.preventDefault&&e.preventDefault(),!0}}function Ei(e,t){return e==null||t==null?!1:!!(e.path&&t.path&&t.path.startsWith(e.path)||e.name&&e.name==t.name)}function xe(e,t){return typeof e=="function"?Reflect.apply(e,{},[t]):e}var us=(0,d.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(e,t){const r=(0,d.inject)(Oe,null);return()=>{let s=xe(e.to,null),i=xe(e.tag,s);if(i==null){console.warn("[Fox]can not resolve link tag");return}let n=null,o=null;r!==null&&(n=r[M](s),e.root&&(n.root=e.root),o=r.currentRoute.value);let u={},l=xe(e.activeClass,n);if(typeof l=="string"&&l.length>0&&(u[l]=Ei(n,o)),xe(e.exact,n)===!0){let c=xe(e.exactActiveClass,n);typeof c=="string"&&c.length>0&&(u[c]=E.isSamePathForRoute(n,o))}let a={class:u};(i==="a"||i==="A")&&(a.href=n?.path??n?.name??"#"),q(!0,a,t.attrs);const f=xe(e.event,n);if(typeof f=="string"){const c=h=>{if(r==null){console.warn("[Fox]router is not been injected");return}if(n==null){console.warn("[Fox]route is not been resolved");return}xi(h)&&r.to(n)};a[f]=c}return(0,d.h)(i,a,t.slots)}}}),vt=(function(e){return e[e.limitless=0]="limitless",e[e.once=1]="once",e})(vt||{}),Ee=Symbol("registerKey"),Pi=class{policy;callback;constructor(e,t){this.callback=e,this.policy=t}},Yt=class{[Ee]=new Map;constructor(){}on(e,t,r=!1){let s=this[Ee].get(e);s||(s=new Array,this[Ee].set(e,s));let i=new Pi(t,r===!0?vt.once:vt.limitless);return s.push(i),this}off(e,t){if(!t)return this[Ee].delete(e),this;let r=this[Ee].get(e);if(r){for(let s=0;s<r.length;s++)if(r[s].callback===t){r.splice(s,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("[Fox]callback can not be empty"),this;let s=t-1,i=new Array(s),n=[].splice.call(e,0,s);for(let o=0;o<n.length;o++)this.once(n[o],u=>{i[o]=u,s-=1,s==0&&Reflect.apply(r,{},i)});return this}emit(e,...t){let r=this[Ee].get(e);if(!r)return this;for(let s=0;s<r.length;){let i=r[s];if(i.policy==vt.once?r.splice(s,1):s++,typeof i.callback=="function")try{Fe(()=>{Reflect.apply(i.callback,{},t)})}catch(n){console.error(n.message,n)}}return this}trigger(e,...t){return Reflect.apply(this.emit,this,[e,...t])}},Ci="FoxRouterView",Fi="FoxRouterLink",U=(function(e){return e[e.Loading=0]="Loading",e[e.Loaded=1]="Loaded",e[e.Defining=2]="Defining",e[e.Defined=3]="Defined",e})({});function _i(e){return e==U.Loaded||e===U.Defined}var fs=(function(e){return e[e.normal=0]="normal",e[e.factory=1]="factory",e})({}),Ai=class{register=new Map;regExpRegisters=[];constructor(){}get(e){let t=this.register.get(e)??null;return t||(t=this.regExpRegisters.find(r=>r.pattern?.test(e))?.module??null),t}has(e){return!!this.get(e)}set(e,t){if(typeof e=="string")this.register.set(e,t);else if(e instanceof RegExp){const r=this.regExpRegisters.find(s=>(s.pattern?.source??"")===(e?.source??""));r?r.module=t:this.regExpRegisters.push({pattern:e,module:t})}}remove(e){if(typeof e=="string"){const t=this.register.get(e);return this.register.delete(e),t??null}else if(e instanceof RegExp){const t=this.regExpRegisters.findIndex(r=>(r.pattern?.source??"")===(e?.source??""));if(t!==-1){const r=this.regExpRegisters[t].module??null;return this.regExpRegisters.splice(t,1),r}}return null}clear(){this.register.clear(),this.regExpRegisters=[]}},er=["require","exports","module"];async function ji(e){return await new Function("url","return import(url)")(e)}var cs=class{moduleManager=new Ai;_alias={};set alias(e){this._alias=e}get alias(){return this._alias}_resourceParser;set resourceParser(e){this._resourceParser=e}get resourceParser(){return this._resourceParser}_timeout;set timeout(e){this._timeout=e}get timeout(){return this._timeout}_query;set query(e){this._query=e}get query(){return this._query}get head(){return We().head}_cssMountPoint=null;set cssMountPoint(e){this._cssMountPoint=e}get cssMountPoint(){return this._cssMountPoint}_jsMountPoint=null;set jsMountPoint(e){this._jsMountPoint=e}get jsMountPoint(){return this._jsMountPoint}setModule(e,t){const r={id:typeof e=="string"?e:e?.source,src:"",status:U.Loaded};typeof t=="function"?(r.exports=t,r.type=fs.factory):r.exports=t,this.moduleManager.set(e,r)}removeModule(e){this.moduleManager.remove(e)}getModuleExports(e){const t=this.moduleManager.get(e);return t&&_i(t.status)?t.type===fs.factory&&typeof t.exports=="function"?t.exports():t.exports:null}exposeRequire(e="__foxRequire",t,r){const s=t??j();return s&&typeof s=="object"?(s[e]=i=>{const n=this.getModuleExports(i);return r&&!n&&console.error(`[Fox] module:${i}, not found!`),n},!0):!1}resloveResource(e){if(typeof e=="string"){if(er.includes(e))return e;if(e=this.alias?.[e]??e,typeof this.resourceParser=="function"){const r=this.resloveResource(e);if(!r)return r}const t=this.getResourcePathSuffix(e);if(t==="mjs")return{path:e,type:"js",format:"es"};if(t==="js")return{path:e,type:"js",format:"umd"};if(t==="css")return{path:e,type:"css"}}return e}ensure(...e){return new Promise((t,r)=>{if(e.length<=0){r("args is empty");return}const s=[];let i=e.length-1,n=null;typeof e[i]=="function"&&(n=e[i],i--);for(let l=0;l<=i;l++)if(Array.isArray(e[l])){const a=e[l];for(let f=0;f<a.length;f++){const c=this.resloveResource(a[f]);s.push(c)}}else if(typeof e[l]=="string"){const a=this.resloveResource(e[l]);s.push(a)}const o=new qi(s.length,(l,a)=>{if(o.isOK())try{typeof n=="function"&&Reflect.apply(n,{},a),t(a)}catch(f){console.error(f),r(f)}else try{console.error(l),typeof n=="function"&&Reflect.apply(n,{},[]),r(l)}catch(f){console.error(f),r(f)}}),u=new qe;for(let l=0;l<s.length;l++){const a=new $i(l,s[l],o);this.mount(u,a)}return this})}remove(...e){return new Promise((t,r)=>{if(e.length<=0){r("args is empty");return}const s=[];let i=e.length-1,n=null;typeof e[i]=="function"&&(n=e[i],i--);for(let o=0;o<=i;o++)if(Array.isArray(e[o])){const u=e[o];for(let l=0;l<u.length;l++){const a=this.resloveResource(u[l]);s.push(a)}}else if(typeof e[o]=="string"){const u=this.resloveResource(e[o]);s.push(u)}for(let o=0;o<s.length;o++)try{this.unmount(s[o])}catch(u){console.error(u)}typeof n=="function"&&Reflect.apply(n,{},[!0]),t(!0)})}mount(e,t){if(!t.resource){e.post(s=>{t.progress.work(!1,t.index,null),s.resolve()});return}if(typeof t.resource=="string"){if(er.includes(t.resource)){e.post(i=>{t.progress.work(!0,t.index,t.resource),i.resolve()});return}const s=this.getModuleExports(t.resource);if(s){e.post(i=>{t.progress.work(!0,t.index,s),i.resolve()});return}}const r=t.resource;if(r.type==="js")if(r.format==="es")this.mountCJS(e,t);else{const s=this.jsMountPoint??this.head;this.mountJS(e,t,s)}else{const s=this.cssMountPoint??this.head;this.mountCSS(e,t,s)}}mountCSS(e,t,r){e.post(s=>{const i=t.resource,n=this.getModuleExports(i.path);if(n){t.progress.work(!0,t.index,n),s.resolve();return}const o=We(),u=o.createElement("link"),l="onload"in u;l&&(u.onload=()=>{u.onload=null,u.onerror=null,t.progress.work(!0,t.index,i.path),s.resolve()},u.onerror=()=>{try{r.removeChild(u)}catch(c){console.error(c)}u.onload=null,u.onerror=null,t.progress.work(!1,t.index,null),s.reject()});const a=this.constructResourceUri(i.path),f=o.getElementById(i.path);f&&f.parentNode&&f.parentNode.removeChild(f),u.rel="stylesheet",u.type="text/css",u.id=i.path,u.href=a,r.appendChild(u),l||(t.progress.work(!0,t.index,i.path),s.resolve())})}mountJS(e,t,r){e.post(s=>{const i=t.resource,n=this.getModuleExports(i.path);if(n){t.progress.work(!0,t.index,n),s.resolve();return}const o={id:i.path,src:i.path,status:U.Loading};this.moduleManager.set(i.path,o);const u=We().createElement("script");if("onload"in u)u.onload=()=>{u.onload=null,u.onerror=null,o.status===U.Loading&&(o.status=U.Loaded,t.progress.work(!0,t.index,i.path)),s.resolve()},u.onerror=()=>{try{r.removeChild(u)}catch(h){console.error(h)}u.onload=null,u.onerror=null,this.moduleManager.remove(i.path),t.progress.work(!1,t.index,null),s.resolve()};else{const h=u;h.onreadystatechange=()=>{/loaded|complete/.test(h.readyState)&&(h.onreadystatechange=null,o.status==U.Loading&&(o.status=U.Loaded,t.progress.work(!0,t.index,i.path)),s.resolve())}}const l=this.constructResourceUri(i.path);u.defer=!0,u.src=l;const a=j(),f=this.createRequireLoad();a.__require=a.__require??a.require,a.require=f;const c=this.createDefine(o,f,t);a.__define=a.__define??a.define,a.define=c,typeof t.progress.finalCallback!="function"&&(t.progress.finalCallback=function(){a.require=a.__require,a.__require=void 0,a.define=a.__define,a.__define=void 0}),r.appendChild(u)})}mountCJS(e,t){e.post(async r=>{const s=t.resource,i=this.getModuleExports(s.path);if(i){t.progress.work(!0,t.index,i),r.resolve();return}try{let n=await ji(s.path);if(Xe(n)&&(n=n.default??n),pe(n)){t.progress.work(!1,t.index,n),r.resolve();return}const o={id:s.path,src:s.path,status:U.Loaded,exports:n};this.moduleManager.set(s.path,o),t.progress.work(!0,t.index,n),r.resolve()}catch(n){console.error(n),t.progress.work(!1,t.index,null),r.resolve()}})}unmount(e){let t="",r="";typeof e=="string"?(this.moduleManager.remove(e),r=this.getResourcePathSuffix(e),t=e):(this.moduleManager.remove(e.path),r=e.type==="css"?"css":e.format??"",t=e.path);const s=We();if(r==="umd"){let i=s.getElementById(t);i||(i=s.querySelector(`script[src="${t}"]`)),i&&i.remove()}else if(r==="css"){let i=s.getElementById(t);if(!i){const n=this.constructResourceUri(t);i=s.querySelector(`link[href="${n}"]`)}i&&i.remove()}}trimEmptyElement(e){const t=[];for(let r=0;r<e.length;r++){let s=e[r];s!=null&&(s=s.trim(),s.length!==0&&t.push(s))}return t}createDefine(e,t,r){const s=this,i=function(...n){e.status=U.Defining;let o,u,l,a=n.length;if(a===1?(l=n[0],o=void 0):a===2?(l=n[1],Array.isArray(n[0])?(u=s.trimEmptyElement(n[0]),o=void 0):u=void 0):(o=n[0],u=s.trimEmptyElement(n[1]),l=n[2]),o&&(e.id=o,typeof s._alias=="object"&&(s._alias[o]=e.src)),u&&u.length>0)s.ensure(u,(...f)=>{try{const c=f.map(h=>h==="exports"?((!e.exports||typeof e.exports!="object")&&(e.exports={}),e.exports):h==="module"?e:h==="require"?t:h);if(typeof l=="function"){const h=Reflect.apply(l,e,c);h&&typeof h=="object"&&(e.exports=h)}else e.exports=l;e.status=U.Defined,r.progress.work(!0,r.index,e.exports)}catch(c){console.error(c),r.progress.work(!1,r.index,[])}});else{if(typeof l=="function"){const f=Reflect.apply(l,e,[]);f&&typeof f=="object"&&(e.exports=e.exports??{},Object.assign(e.exports,f))}else e.exports=l;e.status=U.Defined,r.progress.work(!0,r.index,e.exports)}};return i.amd=!0,i}createRequireLoad(){return e=>(e=this._alias?.[e]??e,this.getModuleExports(e))}constructResourceUri(e){try{if(er.includes(e)||!this.query)return e;const t=this.createSearch(this.query);return e.indexOf("?")==-1?e+=`?${t}`:t.length>0&&(e+=`&${t}`),e}catch(t){throw console.error(`[Fox]resolve path[${e}] fail`,t),t}}createSearch(e){let t="";if(e&&typeof e=="object"){for(let r in e){let s=`${e[r]}`;t+=`${encodeURIComponent(r)}=${encodeURIComponent(s)}&`}t.length>0&&(t=t.substring(0,t.length-1))}return t}getResourcePathSuffix(e){let t=e.lastIndexOf("?");t==-1&&(t=e.length);let r=e.lastIndexOf(".",t);return r==-1?"":e.substring(r+1,t)}},qi=class{finalCallback;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[t]=r),this.size===0||this.status===!1)try{Reflect.apply(this.callback,this,[this.status,this.values])}catch(s){console.error(s.message,s)}finally{typeof this.finalCallback=="function"&&(Reflect.apply(this.finalCallback,null,[]),this.finalCallback=null)}}isOK(){return this.status}},$i=class{index;resource;progress;constructor(e,t,r){this.index=e,this.resource=t,this.progress=r}},tr=Symbol("fk"),rr=Symbol("fbk"),sr=Symbol("fepk");function Ki(e={}){const t=new Br(e),r=new Ct,s=new Yt,i=new cs,n={get router(){return t},get bus(){return r},get Bus(){return Ct},get EventProxy(){return Yt},get eventproxy(){return s},get EventChain(){return qe},get Require(){return cs},get require(){return i},get isESModule(){return Xe},install(o,u={}){o.provide(Oe,t),o.provide(tr,n),o.provide(rr,r),o.provide(sr,s),u.install!==!1&&(o.component(Ci,pt),o.component(Fi,us)),u.optionsApi!==!1&&(Reflect.defineProperty(o.config.globalProperties,"$fox",{get(){return n}}),Reflect.defineProperty(o.config.globalProperties,"$router",{get(){return t}}),Reflect.defineProperty(o.config.globalProperties,"$bus",{get(){return r}}),Reflect.defineProperty(o.config.globalProperties,"$bus",{get(){return r}}),Reflect.defineProperty(o.config.globalProperties,"$eventProxy",{get(){return s}}),o.config.globalProperties.$fox_on=function(l,a,f=!1){s.on(l,a,f)},o.config.globalProperties.$fox_off=function(l,a){s.off(l,a)},o.config.globalProperties.$fox_once=function(l,a){s.once(l,a)},o.config.globalProperties.$fox_all=function(...l){let a=s;Reflect.apply(a.all,a,l)},o.config.globalProperties.$fox_trigger=function(l,...a){let f=s;Reflect.apply(f.trigger,f,[l,...a])},o.config.globalProperties.$fox_emit=function(l,...a){let f=s;Reflect.apply(f.trigger,f,[l,...a])},o.mixin({setup(){return{$route:Gt()}}})),t.init()}};return n}function ir(e){return(0,d.hasInjectionContext)()?(0,d.inject)(Oe,null):e?e.$?.appContext?.provides?.[Oe]??null:null}function Li(e){let t=Gt(e);if(!t&&e&&!(0,d.hasInjectionContext)()){let r=e;for(r=r.$parent;r&&(t=Gt(r),!t);)r=r.$parent}return t}function Ti(e){return(0,d.hasInjectionContext)()?(0,d.inject)(tr,null):e?e.$?.appContext?.provides?.[tr]??null:null}function Mi(e){return(0,d.hasInjectionContext)()?(0,d.inject)(rr,null):e?e.$?.appContext?.provides?.[rr]??null:null}function ki(e){return(0,d.hasInjectionContext)()?(0,d.inject)(sr,null):e?e.$?.appContext?.provides?.[sr]??null:null}function Ii(e){const t=ir();if(!t){console.error("[Fox]router is not exist.");return}const r=(s,i,n)=>{try{Reflect.apply(e,{},[s,i])}catch(o){console.error(o)}n()};t?.beforeEach(r),(0,d.onScopeDispose)(()=>{t?.removeBeforeEach(r)})}function Bi(e){const t=ir();if(!t){console.error("[Fox]router is not exist.");return}const r=(s,i,n)=>{try{Reflect.apply(e,{},[s,i])}catch(o){console.error(o)}n()};t?.afterEach(r),(0,d.onScopeDispose)(()=>{t?.removeAfterEach(r)})}p.Bus=Ct,p.EventChain=qe,p.EventProxy=Yt,p.FoxBeforeEnter=zr,p.FoxBeforeLeave=Xr,p.FoxEnter=Gr,p.FoxLeave=Qr,p.FoxLeaveEnd=yt,p.OperationType=_,p.Route=E,p.Router=Br,p.RouterLink=us,p.RouterView=pt,p.bindLifecycleContextToCurrentScope=Ys,p.createFox=Ki,p.createMemoryHistory=$r,p.createWebHashHistory=qr,p.createWebHistory=zs,p.deleteContextValue=ti,p.extend=q,p.injectContextValue=zt,p.injectLifecycleContext=Ne,p.isArray=bt,p.isDate=ps,p.isESModule=Xe,p.isEqual=xt,p.isFunction=S,p.isMap=ds,p.isNil=pe,p.isObject=ar,p.isPlainObject=ur,p.isPromise=bs,p.isSet=ms,p.isString=vs,p.isSymbol=gs,p.onAfterRouteUpdate=Bi,p.onBeforeRouteUpdate=Ii,p.onFoxActivated=oi,p.onFoxInactivated=li,p.provideContextValue=ei,p.rawState=Ls,p.reactiveState=qs,p.shallowReactiveState=$s,p.toBoolean=Rt,p.toNumber=xs,p.toTypeString=Ge,p.typeOf=St,p.useBus=Mi,p.useEventProxy=ki,p.useFox=Ti,p.useRoute=Li,p.useRouter=ir,p.withLifecycleContext=Nr});
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fox-js/fox",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "3.1.1-
|
|
4
|
+
"version": "3.1.1-26",
|
|
5
5
|
"description": "Fox Router and commons Utils",
|
|
6
6
|
"author": "jiangcheng",
|
|
7
7
|
"keywords": [
|
|
@@ -28,7 +28,8 @@
|
|
|
28
28
|
],
|
|
29
29
|
"publishConfig": {},
|
|
30
30
|
"scripts": {
|
|
31
|
-
"publish:next": "npm version prerelease && npm publish --tag next"
|
|
31
|
+
"publish:next": "npm version prerelease && npm publish --tag next",
|
|
32
|
+
"publish:vapor": "npm version prerelease && npm publish --tag vapor"
|
|
32
33
|
},
|
|
33
34
|
"dependencies": {},
|
|
34
35
|
"repository": ""
|