@fox-js/fox 3.0.2 → 3.1.0

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.
@@ -0,0 +1,3 @@
1
+ (function(g,b){typeof exports=="object"&&typeof module<"u"?b(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],b):(g=typeof globalThis<"u"?globalThis:g||self,b(g.Fox={},g.Vue))})(this,function(g,b){"use strict";/*!
2
+ * fox v3.1.0 Sun Mar 10 2024 23:48:35 GMT+0800 (中国标准时间)
3
+ */const me=typeof window<"u",$=function(){return window},De=function(){return window.document};function Gr(s){let e=s,t=e.lastIndexOf("/");return t>0&&t<e.length-1?e=e.substring(0,t+1):t===0&&e.indexOf(".")!==-1?e="/":t===-1&&(e.indexOf(".")==-1?e=`/${e}/`:e="/"),e.indexOf("/")!==0&&(e=`/${e}`),e}function ut(){if(!me)return"/";let s=$().location,e=`${s.protocol}//${s.host}`;return e+=Gr(s.pathname),e}function ft(s,e,t){s.addEventListener?s.addEventListener(e,t,!1):s.attachEvent?s.attachEvent(`on${e}`,t):s[`on${e}`]=t}function ct(s,e,t){s.removeEventListener?s.removeEventListener(e,t):s.detachEvent?s.detachEvent(`on${e}`,t):s[`on${e}`]=null}const Qr=Array.isArray,Xr=s=>Ue(s)==="[object Map]",Yr=s=>Ue(s)==="[object Set]",Zr=s=>s instanceof Date,S=s=>typeof s=="function",es=s=>typeof s=="string",ts=s=>typeof s=="symbol",er=s=>s!==null&&typeof s=="object",rs=s=>er(s)&&S(s.then)&&S(s.catch),tr=s=>s==null,ss=Object.prototype.toString,Ue=s=>ss.call(s),rr=s=>Ue(s)==="[object Object]",ns=typeof Symbol=="function"&&typeof Symbol.toStringTag=="symbol";function ht(s){return s.__esModule||ns&&s[Symbol.toStringTag]==="Module"}const is=typeof Promise<"u"&&Promise.toString().indexOf("[native code]")!==-1;function K(...s){let e=s[0]!==void 0&&s[0]!==null?s[0]:{},t=1,r=s.length,n=!1;for(typeof e=="boolean"&&(n=e,e=s[t]??{},t++),typeof e!="object"&&(e={});t<r;t++)if(s[t]!==null&&s[t]!==void 0){let i=s[t];for(let o in i){let a=e[o],l=i[o];if(a!==l)if(n===!0&&l&&typeof l=="object"){let u;Array.isArray(l)?u=a&&Array.isArray(a)?a:[]:u=a&&typeof a=="object"?a:{},e[o]=K(n,u,l)}else l!==void 0&&(e[o]=l)}}return e}function Ve(s,e,t=!1){if(!t)K(!0,s,e);else{if(typeof e!="object")return{};typeof s!="object"&&(s={});for(let r of Reflect.ownKeys(e)){let n=s[r],i=e[r];if(n!==i)if(typeof i=="object"){if(!Array.isArray(i)&&!rr(i))continue;n=Ve(n,i,t),s[r]=n}else{if(typeof i=="function")continue;s[r]=i}}}return s}class ne{static seed=new Date().getTime();static get(){let e=++ne.seed;return e>=Number.MAX_VALUE&&(ne.seed=0),e}}const yt=is?Promise.resolve():null;function Ae(s,...e){yt!==null?e&&e.length>0?yt.then(()=>{s(e)}):yt.then(s):e&&e.length>0?setTimeout(()=>{s(e)}):setTimeout(s)}function dt(s){return s==null?!1:typeof s=="boolean"?s:typeof s=="string"?s.toLocaleLowerCase()==="true":!!s}function os(s){return typeof s=="number"?s:Number(s)}const ls={"[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 mt(s){let t=Object.prototype.toString.call(s);return s==null?String(s):ls[t]||"object"}function pt(s,e){if(s==e)return!0;if(s===void 0||e===void 0)return!1;let t=mt(s),r=mt(e);if(t!==r)return!1;if(t==="object"){let n=Object.keys(s),i=Object.keys(e);if(n.length!==i.length)return!1;for(let o=0;o<n.length;o++){let a=n[o],l=s[a],u=e[a];if(!pt(l,u))return!1}return!0}else if(t==="array"){if(s.length!==e.length)return!1;for(let n=0;n<s.length;n++){let i=s[n],o=e[n];if(!pt(i,o))return!1}return!0}return!1}const sr=s=>{const e={};for(let t of Reflect.ownKeys(s)){let r=s[t];r&&!Array.isArray(r)&&typeof r=="object"&&(r=sr(r)),typeof t=="symbol"?e[String(t)]=r:e[t]=r}return e},as=/^Symbol\((.*)\)$/,nr=s=>{const e={};for(let t of Reflect.ownKeys(s)){let r=s[t];r&&!Array.isArray(r)&&typeof r=="object"&&(r=nr(r));const n=as.exec(t);if(n&&n[1]){const i=Symbol.for(n[1]);e[i]=r}else e[t]=r}return e},ir=Symbol("idKey"),ue=Symbol("valueKey"),P=Symbol("childrenKey"),z=Symbol("growKey");class or{[z]=!0;[ir];[ue]=b.ref();[P]=new Map;constructor(e){this[ir]=e}}class us{get(e,t){if(t=="value")return e[ue].value;if(t==="grow")return e[z];let r=e[P].get(t);if(r)return Ee(r);if(e[z])return r=vt(t),r[z]=e[z],e[P].set(t,r),Ee(r)}set(e,t,r){return t=="value"?(e[ue].value=r,!0):t==="grow"?(e[z]=dt(r),!0):r==null?(e[P].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[P].delete(t),!0)}}const gt="__proxy__";function vt(s){const e=new or(s);return Reflect.set(e,gt,new Proxy(e,new us)),e}function Ee(s){return Reflect.get(s,gt)}class fs{name="";persistPolicy="momery";storage;initFlag=!1;state={};constructor(e={}){if(e.persistPolicy&&e.persistPolicy!=="momery"&&tr(e.name))throw new Error("name can not be empty, where persistPolicy is not momery.");this.name=e.name??"",this.persistPolicy=e.persistPolicy??"momery",this.storage=e.storage}init(e){this.restore(e),this.initFlag=!0}getStorage(){if(!this.persistPolicy)return null;let e=null;if(this.persistPolicy==="custom")e=this.storage;else if(me){const t=$();e=this.persistPolicy==="session"?t.sessionStorage:t.localStorage}return e}saveState(){if(!this.persistPolicy||this.persistPolicy==="momery")return;let e=this.getStorage();if(e===null||!this.state)return;const t=`_bus_${this.name}`,r=JSON.stringify(this.state??{});e.setItem(t,r)}removeState(){if(!this.persistPolicy||this.persistPolicy==="momery")return;let e=this.getStorage();if(e===null||!this.state)return;const t=`_bus_${this.name}`;e.removeItem(t)}restore(e){if(!this.persistPolicy||this.persistPolicy==="momery")return;let t=this.getStorage();if(t===null)return;const r=`_bus_${this.name}`,n=t.getItem(r);n&&(this.state=JSON.parse(n),Reflect.ownKeys(this.state).forEach(o=>{if(typeof o!="string")return;const a=this.state[o],l=o.split(/\//g);l.push(a),Reflect.apply(e.put,e,l)}))}put(e){if(this.initFlag&&this.persistPolicy!=="momery")try{const t=e.length,r=e.slice(0,t-1).join("/"),n=e[t-1];this.state[r]=n,this.saveState()}catch(t){console.error(t)}}remove(e){if(this.initFlag&&this.persistPolicy!=="momery")try{const t=e.length,r=e.slice(0,t-1).join("/"),n={};Reflect.ownKeys(this.state).forEach(o=>{typeof o=="string"&&(o===r||o.startsWith(r)||(n[o]=this.state[o]))}),this.state=n,this.saveState()}catch(t){console.error(t)}}clear(){if(this.initFlag)try{this.state={},this.removeState()}catch(e){console.error(e)}}}class lr extends or{_persistHandler;constructor(e={}){super("__root__"),this._persistHandler=new fs(e),this._persistHandler.init(this)}put(...e){let t=e.length;if(t<2)return console.error("参数至少包括一个(key, value)"),!1;let r=this;for(let n=0;n<t-1;n++){let i=e[n],o;r[P].has(i)?o=r[P].get(i):(o=vt(i),r[P].set(i,o)),r=o}return r[ue].value=e[t-1],this._persistHandler.put(e),!0}get(...e){let t=e.length;if(t===0)return;let r=this;for(let n=0;n<t;n++){let i=e[n];if(r[P].has(i))r=r[P].get(i);else return}return r[ue].value}remove(...e){let t=e.length;if(t==0)return!1;let r=this;for(let i=0;i<t-1;i++){const o=e[i];if(r[P].has(o))r=r[P].get(o);else return!1}const n=e[t-1];return r[P].has(n)?(r[P].delete(n),this._persistHandler.remove(e),!0):!1}contains(...e){const t=e.length;if(t==0)return!1;let r=this;for(let i=0;i<t-1;i++){let o=e[i];if(r[P].has(o))r=r[P].get(o);else return!1}const n=e[t-1];return r[P].has(n)}clear(){this[P].clear(),this._persistHandler.clear()}}const cs=["put","get","contains","remove","clear","_persistHandler"];function ar(s){return cs.includes(s)}class hs{get(e,t){if(t=="value")return e[ue].value;if(t==="grow")return e[z];if(t===P)return e[P];if(typeof t=="string"&&ar(t))return e[t];let r=String(t),n=e[P].get(r);if(n)return Ee(n);if(e[z])return n=vt(r),n[z]=e[z],e[P].set(r,n),Ee(n)}set(e,t,r){return t=="value"?(e[ue].value=r,!0):t==="grow"?(e[z]=dt(r),!0):ar(t)?!1:r==null?(e[P].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[P].delete(t),!0)}}function ys(s){const e=new lr(s),t=new hs,r=new Proxy(e,t);return Reflect.set(e,gt,r),e}const wt=new Proxy(lr,{construct(s,e){const t=ys(e[0]??{});return Ee(t)}}),Y="default",ur=Symbol("sync"),N=Symbol("resolveRoute");function fr(s){let e=!1;return function(...t){if(!e)return e=!0,Reflect.apply(s,{},t)}}function ds(s){let e=s.src;return new Promise((t,r)=>{const n=fr(a=>{ht(a)&&(a=a.default),s.component=a,console.debug("success load async module"),t()}),i=fr(a=>{console.debug("reject load async module"),r(a)});let o;try{o=e(n,i)}catch(a){i(a)}if(o)if(typeof o.then=="function")o.then(n,i);else{const a=o.component;a&&typeof a.then=="function"&&a.then(n,i)}})}class ms{name;level;rootName;rootIndex=0;constructor(e,t,r,n){this.name=e,this.level=t,this.rootName=r,this.rootIndex=n}}class Be{to;routeModel;from;data={};constructor(e,t){this.to=e,this.from=t}static from(e){let t=new Be(e.to,e.from),r=e.data??{};return K(!0,t.data,r),t}}class C{path;get fullPath(){const e=this.path??`/${this.name}`;return`${this.root??Y}!${e}`}alias;name;root;params;query;traceless;template;matched;meta;success;error;destroy;opsType;updateType;historyUpdatePolicy;viewTagAttrs;index;active;slot;session;static clone(e,t){let r=new C;return Ve(r,e,t),r}static isSame(e,t){return e===t?!0:!(e==null||t==null||e.path&&e.path!==t.path||e.name&&e.name!==t.name||e.root!==t.root||e.index!==t.index)}static isSameForRouteModel(e,t){return e===t?!0:!(e==null||t==null||e.path&&e.path!=t.path||e.name&&e.name!=t.name)}static from(e){let t=new C;if(e==null)return t;let r=t;for(let i in e){let o=e[i];r[i]=o}const n=Object.getOwnPropertySymbols(e);if(Array.isArray(n)&&n.length>0)for(let i of n)r[i]=e[i];return t}}class ps{id;name;props;meta;src;component;constructor(e,t,r,n){this.id=ne.get(),this.name=e,this.src=t,typeof t!="function"&&(this.component=t),this.props=r,this.meta=n}get isResolved(){return this.component!==void 0}resolve(){return ds(this)}}class cr{models=[]}class bt{path;match;redirect;name;layers=[]}var j=(s=>(s[s.Push=0]="Push",s[s.Replace=1]="Replace",s[s.Put=2]="Put",s[s.Append=3]="Append",s[s.Open=4]="Open",s))(j||{});const V=Symbol("chainKey"),H=Symbol("cursorKey"),Rt=Symbol("$persistentModeKey"),T=Symbol("statusKey"),Z=Symbol("argsKey"),ke=Symbol("exArgsKey"),pe=Symbol("successFnsKey"),Fe=Symbol("errorFnsKey"),ie=Symbol("sessionKey"),ee=Symbol("_go");class _e{[V]=[];[H]=0;[Rt]=!1;[T]="Free";[Z]=[];[ke]=[];[pe]=[];[Fe]=[];[ie];get session(){return this[ie]}constructor(e,t=!1){this[ie]=e,this[Rt]=t}[ee](e,...t){let r=this[T];if(this[T]="Busy",this[H]+=e,this[H]<0&&(this[H]=0),this[Z]=t,r==="Exception"||r==="Reject"){let a=[{session:this[ie]},...this[ke]];for(;this[Fe].length>0;)try{let l=this[Fe].shift();typeof l=="function"&&Ae(()=>{Reflect.apply(l,{},a)})}catch(l){console.error(l.message,l)}return this[T]=r,this[V]=[],this[H]=0,this}else if(r==="Finished"||this[H]>=this[V].length){let a=[{session:this[ie]},...this[Z]];for(;this[pe].length>0;){let l=this[pe].shift();typeof l=="function"&&Ae(()=>{Reflect.apply(l,{},a)})}return this[T]="Free",this}if(this[H]>=this[V].length)return this[T]="Free",this;let n=this[V][this[H]];this[Rt]||(this[V].splice(0,this[H]+1),this[H]=-1);let i=this[H]+1;try{let o=!1,a={go:(l,...u)=>{o||(o=!0,Reflect.apply(this[ee],this,[l,...u]))},resolve:(...l)=>{o||(o=!0,Reflect.apply(this[ee],this,[1,...l]))},reject:(...l)=>{o||(o=!0,Reflect.apply(this.reject,this,[...l]))},insert:l=>{o||(this[V].splice(i,0,l),i++)},session:this[ie]};Ae(()=>{Reflect.apply(n,{},[a,...this[Z]])})}catch(o){this.throw(o)}return this}go(e,...t){return Reflect.apply(this[ee],this,[e,...t])}finish(...e){return this[T]="Finished",this[Z]=e,Reflect.apply(this[ee],this,[0])}reject(...e){return this[T]="Reject",this[ke]=e,Reflect.apply(this[ee],this,[0])}throw(...e){return this[T]="Exception",this[ke]=e,Reflect.apply(this[ee],this,[0])}reset(...e){this[T]="Busy",this[Z]=e,this[V]=[],this[H]=0;let r=[{session:this[ie]},...this[Z]];for(;this[pe].length>0;){let n=this[pe].shift();Ae(()=>{Reflect.apply(n,this,r)})}return this[T]="Free",this}post(e){return this[T]==="Reject"||this[T]==="Exception"?this:(Array.isArray(e)?this[V]=[...this[V],...e]:this[V].push(e),this[T]==="Busy"?this:(Reflect.apply(this[ee],this,[0,...this[Z]]),this))}wait(e,t){return e&&typeof e=="function"&&this[pe].push(e),t&&typeof t=="function"&&this[Fe].push(t),this[T]==="Busy"?this:(Reflect.apply(this[ee],this,[0,...this[Z]]),this)}exception(e){return e&&typeof e=="function"&&this[Fe].push(e),this[T]==="Busy"?this:Reflect.apply(this[ee],this,[0,...this[Z]])}isFinish(){return this[T]=="Reject"||this[T]=="Free"&&this[H]>=this[V].length}}const ge=Symbol("registerKey");class gs{policy;callback;constructor(e,t){this.callback=e,this.policy=t}}class xt{[ge]=new Map;constructor(){}on(e,t,r=!1){let n=this[ge].get(e);n||(n=new Array,this[ge].set(e,n));let i=r===!0?1:0,o=new gs(t,i);return n.push(o),this}off(e,t){if(!t)return this[ge].delete(e),this;let r=this[ge].get(e);if(r){for(let n=0;n<r.length;n++)if(r[n].callback===t){r.splice(n,1);break}}return this}bind(e,t,r=!1){return this.on(e,t,r)}unbind(e,t){return this.off(e,t)}once(e,t){return this.on(e,t,!0)}all(...e){let t=e.length;if(t<1)return this;let r=e[t-1];if(typeof r!="function")return console.error("callback can not benn empty"),this;let n=t-1,i=new Array(n),o=[].splice.call(e,0,n);for(let a=0;a<o.length;a++)this.once(o[a],l=>{i[a]=l,n-=1,n==0&&Reflect.apply(r,{},i)});return this}emit(e,...t){let r=this[ge].get(e);if(!r)return this;for(let n=0;n<r.length;){let i=r[n];if(i.policy==1?r.splice(n,1):n++,typeof i.callback=="function")try{Ae(()=>{Reflect.apply(i.callback,{},t)})}catch(o){console.error(o.message,o)}}return this}trigger(e,...t){return Reflect.apply(this.emit,this,[e,...t])}}const Ke=Symbol("registerKey");class vs{[Ke]=new Map;constructor(){}set(e,t){this[Ke].set(e,t)}get(e){return this[Ke].get(e)}has(e){return this[Ke].has(e)}delete(e){return this[Ke].delete(e)}}const fe=Symbol("lc");function We(s,e=!1){let t=s;if(Reflect.has(t,fe))return t[fe];if(e){const r=new vs;return t[fe]=r,r}return null}function hr(s,e=!1){let t=null,r=s;for(;r&&!(Reflect.has(r,fe)&&(t=r[fe],t));)r=r.$parent;if(!t&&e){const n=s;n&&n.$parent&&(t=We(n.$parent,e))}return t}function St(s,e){let t=s;for(;t;){if(Reflect.has(t,fe)){const r=t[fe];if(r.has(e))return r.get(e)}t=t.$parent}return null}function ws(s,e,t){hr(s,!0)?.set(e,t)}function bs(s,e){hr(s,!0)?.delete(e)}function yr(s){if(Array.isArray(s.children)&&s.children.length>0){let e=s.children[0];if(e!=null&&e.component!=null&&e.component.proxy!=null)return We(e.component.proxy,!1)}return null}const ze=Symbol("hooksKey");function Rs(s){let e=s.get(ze);e||(e=[],s.set(ze,e))}function dr(s,e){let t=s.get(ze);if(t!=null)for(let r=t.length-1;r>=0;r--){let n=t[r];if(n.type===e)try{Reflect.apply(n.hook,n.target,[])}catch(i){console.error(i.message,i)}}}var Pt=(s=>(s.DEACTIVATED="da",s.ACTIVATED="a",s))(Pt||{});class xs{type;hook;target;constructor(e,t,r){this.target=r,this.hook=t,this.type=e}}function Ss(s,e,t,r){let n=new xs(e,t,r);return s.push(n),!0}function Ps(s,e,t,r){let n=-1;for(let i=0;i<s.length;i++){let o=s[i];if(o.type===e&&o.hook===t&&o.target===r){n=i;break}}return n!=-1?(s.splice(n,1),!0):!1}function mr(s){return(e,t)=>{let r;if(t)r=t;else{const i=b.getCurrentInstance();if(i==null||i.proxy==null){console.error("can not get current instance or proxy");return}r=i.proxy}const n=St(r,ze);if(n==null){console.warn("hooks context not found");return}b.onUnmounted(()=>{Ps(n,s,e,r)}),Ss(n,s,e,r)}}const Cs=mr("a"),As=mr("da"),pr=Symbol("routeKey");function gr(s,e){s.set(pr,e)}function Ct(s){let e=St(s,pr);return typeof e=="function"?e():e??null}const Je=Symbol("rk"),At=Symbol("vd"),vr=Symbol("rv"),Et=Symbol("rvi"),wr=Symbol("pv"),Ft=Symbol("pvi");function Es(s){for(var e=[],t=0;t<s.length;){var r=s[t];if(r==="*"||r==="+"||r==="?"){e.push({type:"MODIFIER",index:t,value:s[t++]});continue}if(r==="\\"){e.push({type:"ESCAPED_CHAR",index:t++,value:s[t++]});continue}if(r==="{"){e.push({type:"OPEN",index:t,value:s[t++]});continue}if(r==="}"){e.push({type:"CLOSE",index:t,value:s[t++]});continue}if(r===":"){for(var n="",i=t+1;i<s.length;){var o=s.charCodeAt(i);if(o>=48&&o<=57||o>=65&&o<=90||o>=97&&o<=122||o===95){n+=s[i++];continue}break}if(!n)throw new TypeError("Missing parameter name at ".concat(t));e.push({type:"NAME",index:t,value:n}),t=i;continue}if(r==="("){var a=1,l="",i=t+1;if(s[i]==="?")throw new TypeError('Pattern cannot start with "?" at '.concat(i));for(;i<s.length;){if(s[i]==="\\"){l+=s[i++]+s[i++];continue}if(s[i]===")"){if(a--,a===0){i++;break}}else if(s[i]==="("&&(a++,s[i+1]!=="?"))throw new TypeError("Capturing groups are not allowed at ".concat(i));l+=s[i++]}if(a)throw new TypeError("Unbalanced pattern at ".concat(t));if(!l)throw new TypeError("Missing pattern at ".concat(t));e.push({type:"PATTERN",index:t,value:l}),t=i;continue}e.push({type:"CHAR",index:t,value:s[t++]})}return e.push({type:"END",index:t,value:""}),e}function br(s,e){e===void 0&&(e={});for(var t=Es(s),r=e.prefixes,n=r===void 0?"./":r,i="[^".concat(ve(e.delimiter||"/#?"),"]+?"),o=[],a=0,l=0,u="",f=function(_){if(l<t.length&&t[l].type===_)return t[l++].value},c=function(_){var E=f(_);if(E!==void 0)return E;var F=t[l],Q=F.type,D=F.index;throw new TypeError("Unexpected ".concat(Q," at ").concat(D,", expected ").concat(_))},h=function(){for(var _="",E;E=f("CHAR")||f("ESCAPED_CHAR");)_+=E;return _};l<t.length;){var y=f("CHAR"),d=f("NAME"),p=f("PATTERN");if(d||p){var m=y||"";n.indexOf(m)===-1&&(u+=m,m=""),u&&(o.push(u),u=""),o.push({name:d||a++,prefix:m,suffix:"",pattern:p||i,modifier:f("MODIFIER")||""});continue}var v=y||f("ESCAPED_CHAR");if(v){u+=v;continue}u&&(o.push(u),u="");var w=f("OPEN");if(w){var m=h(),q=f("NAME")||"",x=f("PATTERN")||"",O=h();c("CLOSE"),o.push({name:q||(x?a++:""),pattern:q&&!x?i:x,prefix:m,suffix:O,modifier:f("MODIFIER")||""});continue}c("END")}return o}function Fs(s,e){return _s(br(s,e),e)}function _s(s,e){e===void 0&&(e={});var t=_t(e),r=e.encode,n=r===void 0?function(l){return l}:r,i=e.validate,o=i===void 0?!0:i,a=s.map(function(l){if(typeof l=="object")return new RegExp("^(?:".concat(l.pattern,")$"),t)});return function(l){for(var u="",f=0;f<s.length;f++){var c=s[f];if(typeof c=="string"){u+=c;continue}var h=l?l[c.name]:void 0,y=c.modifier==="?"||c.modifier==="*",d=c.modifier==="*"||c.modifier==="+";if(Array.isArray(h)){if(!d)throw new TypeError('Expected "'.concat(c.name,'" to not repeat, but got an array'));if(h.length===0){if(y)continue;throw new TypeError('Expected "'.concat(c.name,'" to not be empty'))}for(var p=0;p<h.length;p++){var m=n(h[p],c);if(o&&!a[f].test(m))throw new TypeError('Expected all "'.concat(c.name,'" to match "').concat(c.pattern,'", but got "').concat(m,'"'));u+=c.prefix+m+c.suffix}continue}if(typeof h=="string"||typeof h=="number"){var m=n(String(h),c);if(o&&!a[f].test(m))throw new TypeError('Expected "'.concat(c.name,'" to match "').concat(c.pattern,'", but got "').concat(m,'"'));u+=c.prefix+m+c.suffix;continue}if(!y){var v=d?"an array":"a string";throw new TypeError('Expected "'.concat(c.name,'" to be ').concat(v))}}return u}}function Ks(s,e){var t=[],r=Rr(s,t,e);return Ts(r,t,e)}function Ts(s,e,t){t===void 0&&(t={});var r=t.decode,n=r===void 0?function(i){return i}:r;return function(i){var o=s.exec(i);if(!o)return!1;for(var a=o[0],l=o.index,u=Object.create(null),f=function(h){if(o[h]===void 0)return"continue";var y=e[h-1];y.modifier==="*"||y.modifier==="+"?u[y.name]=o[h].split(y.prefix+y.suffix).map(function(d){return n(d,y)}):u[y.name]=n(o[h],y)},c=1;c<o.length;c++)f(c);return{path:a,index:l,params:u}}}function ve(s){return s.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1")}function _t(s){return s&&s.sensitive?"":"i"}function $s(s,e){if(!e)return s;for(var t=/\((?:\?<(.*?)>)?(?!\?)/g,r=0,n=t.exec(s.source);n;)e.push({name:n[1]||r++,prefix:"",suffix:"",modifier:"",pattern:""}),n=t.exec(s.source);return s}function js(s,e,t){var r=s.map(function(n){return Rr(n,e,t).source});return new RegExp("(?:".concat(r.join("|"),")"),_t(t))}function qs(s,e,t){return Os(br(s,t),e,t)}function Os(s,e,t){t===void 0&&(t={});for(var r=t.strict,n=r===void 0?!1:r,i=t.start,o=i===void 0?!0:i,a=t.end,l=a===void 0?!0:a,u=t.encode,f=u===void 0?function(D){return D}:u,c=t.delimiter,h=c===void 0?"/#?":c,y=t.endsWith,d=y===void 0?"":y,p="[".concat(ve(d),"]|$"),m="[".concat(ve(h),"]"),v=o?"^":"",w=0,q=s;w<q.length;w++){var x=q[w];if(typeof x=="string")v+=ve(f(x));else{var O=ve(f(x.prefix)),_=ve(f(x.suffix));if(x.pattern)if(e&&e.push(x),O||_)if(x.modifier==="+"||x.modifier==="*"){var E=x.modifier==="*"?"?":"";v+="(?:".concat(O,"((?:").concat(x.pattern,")(?:").concat(_).concat(O,"(?:").concat(x.pattern,"))*)").concat(_,")").concat(E)}else v+="(?:".concat(O,"(").concat(x.pattern,")").concat(_,")").concat(x.modifier);else x.modifier==="+"||x.modifier==="*"?v+="((?:".concat(x.pattern,")").concat(x.modifier,")"):v+="(".concat(x.pattern,")").concat(x.modifier);else v+="(?:".concat(O).concat(_,")").concat(x.modifier)}}if(l)n||(v+="".concat(m,"?")),v+=t.endsWith?"(?=".concat(p,")"):"$";else{var F=s[s.length-1],Q=typeof F=="string"?m.indexOf(F[F.length-1])>-1:F===void 0;n||(v+="(?:".concat(m,"(?=").concat(p,"))?")),Q||(v+="(?=".concat(m,"|").concat(p,")"))}return new RegExp(v,_t(t))}function Rr(s,e,t){return s instanceof RegExp?$s(s,e):Array.isArray(s)?js(s,e,t):qs(s,e,t)}var Ge=(s=>(s[s.Part=0]="Part",s[s.All=1]="All",s))(Ge||{});const J=Symbol("rootKey"),G=Symbol("rootNodeKey"),ce=Symbol("parentNodeKey"),Qe=Symbol("nameKey");class oe{instance=null;model;route;active=!0;index=0;constructor(e,t,r=0,n=!0){this.route=e,this.model=t,this.index=r,this.active=n}}class Te{_slots;get slots(){return this._slots==null&&(this._slots=b.shallowRef([])),this._slots}get empty(){return this._slots==null||this._slots.value.length==0}[Qe];[J];[G]=null;[ce]=null;get name(){return this[Qe]}constructor(e,t,r){this[Qe]=e,this[J]=t,r&&(this[G]=r)}}class B{view;index;level;constructor(e,t,r){this.view=e,this.index=t,this.level=r}static include(e,t){for(let r=0;r<e.length;r++){let n=e[r];if(n.view===t.view&&(t.index==-1||n.index===t.index)&&n.level===t.level)return!0}return!1}}class Kt{views=[]}class Ls{layers=[]}class Ms{time;route}class Is{forbidTime=300;submitRecorder=new Ms;isSameRoute(e,t){return e==null||t==null?!1:e.name===t.name&&e.path===t.path&&e.root===t.root}acquire(e){let t=new Date().getTime();if(this.isSameRoute(e,this.submitRecorder.route)&&this.submitRecorder.time&&t-this.submitRecorder.time<=this.forbidTime){this.submitRecorder.time=t;return}return this.submitRecorder.route=e,this.submitRecorder.time=t,t}release(e){this.submitRecorder.time===e&&(this.submitRecorder.route=void 0)}}const we=Symbol("_notifyChange");class xr{currentRoute;routes;constructor(e,t){this.currentRoute=e,this.routes=t}}const he=Symbol("historyChangeConsumerKey"),Sr=Symbol("_navigateFirstRoute"),Xe=Symbol("_getRouteMark"),Tt=Symbol("_getUrlSearch"),$t=Symbol("_generateLocation"),Ye=Symbol("_setRouteMarkRecorder"),$e=Symbol("beforeRestoreFiltersKey"),Pr=Symbol("_beforeRestore"),Cr="Symbol(_fox_restore_point)";function je(s,...e){return typeof s=="function"?Reflect.apply(s,null,[...e]):s}function Ar(s){if(!Array.isArray(s))return!1;if(s.length===0)return!0;const e=s[0];return!!(Reflect.has(e,"path")&&Reflect.has(e,"root"))}class Er{base;storage;mode;query;firstNavigate=!0;historyMonitor;traceless=!1;changeHandler;historyChange;[he]=!1;[$e]=new Array;backTimeout=320;constructor(e="hash",t="",r="",n=!0,i=!0,o=!1,a,l){this.mode=e,this.base=t,this.query=r,this.firstNavigate=n,this.historyMonitor=i,this.traceless=o,this.storage=a??$().sessionStorage,this.backTimeout=l??320}init(e=!0){const t=$();return typeof this.historyChange!="function"&&(this.historyChange=()=>{if(typeof this[he]=="function"){const r=this[he]();if(this[he]=!1,r)return}else if(this[he]===!0){this[he]=!1;return}if(je(this.historyMonitor)){const r=t.history.state;this[we](r);try{let n=[];if(typeof r=="string"?n=JSON.parse(r):n=r,Array.isArray(n)&&n.length>0){const i=this[Xe]()??"/";this[Ye](i,n)}}catch{}}}),ft(t,"popstate",this.historyChange),this.firstNavigate&&e&&this[Sr](),Promise.resolve()}destroy(){if(this.historyChange){const e=$();ct(e,"popstate",this.historyChange)}}[Pr](e,t,r,n){for(let i of this[$e])try{const o=Reflect.apply(i,{},[e,t,r,n]);if(o===!1)return o}catch(o){console.error(o.message,o)}return!0}beforeRestoreEach(e){this[$e].push(e)}removeBeforeRestoreEach(e){const t=this[$e].indexOf(e);return t!==-1?(this[$e].splice(t,1),!0):!1}[Sr](){const e=this[Xe]()??"/",t=this.storage.getItem(Cr);if(t)try{const o=JSON.parse(t);if(o.mark===e&&Array.isArray(o.routes)&&o.routes.length>0){const a=o.routes.filter((l,u)=>(l.params=l.params?nr(l.params):{},this[Pr](l,u,e,o.routes)));if(a.length>0){const l=this[Tt](),u=a.length-1;a[u].query=l||a[u].query,this[we](a);return}}}catch{}const r=e.indexOf("!");let n;r!=-1?n=e.substring(r+1):n=e;const i=new C;i.path=n,i.query=this[Tt](),this[we]([i])}[Ye](e,t){try{t.forEach(i=>{i.params=i.params?sr(i.params):{}});const n=JSON.stringify({mark:e,routes:t});this.storage.setItem(Cr,n)}catch(r){console.error(r.message,r)}}setRestorePoint(e){const t=this[Xe]()??"/";this[Ye](t,e)}[we](e){typeof this.changeHandler=="function"&&this.changeHandler(e)}[Xe](){const e=$();if(this.mode==="path"){let t=e.location.pathname;return this.base&&t.indexOf(this.base)===0&&(t=t.substring(this.base.length)),t}else{const t=e.location.hash,r=t.indexOf("#");if(r!=-1)return t.substring(r+1)}return null}[Tt](){let t=$().location.search;return t.length>0&&t.indexOf("?")===0&&(t=t.substring(1)),t}listen(e){this.changeHandler=e}go(e,t=!1){const r=$();this[he]=t,r.history.go(e)}goBack(e,t){const r=$(),n=r.history.state;if(Ar(n)&&n.length>0){let i=!1;for(let f=n.length-1;f>=0;f--){const c=C.from(n[f]);if(!(c.historyUpdatePolicy==="traceless"||je(this.traceless,c))&&C.isSame(c,e)){i=!0;break}}if(!i){t();return}const o=this.backTimeout;let a=null;const l=()=>{r.history.go(-1),a=setTimeout(l,o)},u=()=>{clearTimeout(a);const c=$().history.state;if(Ar(c)&&c.length>0){let h=c.length;const y=c[h-1],d=C.from(y);if(C.isSame(d,e))return t(),!0;if(h>0){let p=!1;for(let m=h-1;m>=0;m--){const v=C.from(c[m]);if(!(v.traceless===!0||je(this.traceless,v))&&C.isSame(v,e)){p=!0;break}}return p?(setTimeout(()=>{a=setTimeout(l,o),this.go(-1,u)},0),!0):(t(),!0)}}return t(),!0};a=setTimeout(l,o),this.go(-1,u)}else t()}setRouteMark(e){const t=e.currentRoute.fullPath;this[Ye](t,e.routes)}push(e){const t=this[$t](e.currentRoute);e.currentRoute.historyUpdatePolicy!=="traceless"&&!je(this.traceless,e.currentRoute)&&$().history.pushState(e.routes,"",t),this.setRouteMark(e)}replace(e){const t=this[$t](e.currentRoute);(e.currentRoute.historyUpdatePolicy!=="traceless"||!je(this.traceless,e.currentRoute))&&$().history.replaceState(e.routes,"",t),this.setRouteMark(e)}[$t](e){const t=$();let r="";if(e.query){let a="";if(typeof e.query=="object")for(let l of Reflect.ownKeys(e.query)){let u=encodeURIComponent(e.query[l]),f=`${encodeURIComponent(String(l))}=${u}`;a.length>0&&(a+="&"),a+=f}else a=e.query;this.query?(r=a.length>0?`${this.query}&${a}`:this.query,r.length>0&&r.charAt(0)!=="?"&&(r=`?${r}`)):a.length>0&&(r=`?${a}`)}const n=t.location;let i=e.alias??e.fullPath;i.startsWith(Y)&&(i=i.substring(Y.length+1));let o;return r?this.mode=="path"?i.indexOf("/")===0?o=`${this.base}${i}${r}`:o=`${this.base}/${i}${r}`:o=`${n.pathname}${r}#${i}`:this.mode=="path"?i.indexOf("/")===0?o=`${this.base}${i}`:o=`${this.base}/${i}`:o=`${n.pathname}#${i}`,`${n.origin}${o}`}}function Ns(s=!0,e=null,t="",r=!0,n=!1,i){return e!==null&&(e=$().location.pathname),e&&e.endsWith("/")&&(e=e.substring(0,e.length-1)),new Er("path",e??"",t,s,r,n,i)}function Fr(s=!0,e="",t=!0,r=!1,n){return new Er("hash","",e,s,t,r,n)}class Hs{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}[we](e){typeof this.changeHandler=="function"&&this.changeHandler(e)}go(e,t=!1){if(this.queue.length==0||this.cursor<=0)return;let r=this.cursor+e;if(r<0?r=0:r>this.queue.length-1&&(r=this.queue.length-1),r!=this.cursor){this.cursor=r;let n=!1;if(typeof t=="function"?n=t():n=t,!n){const i=this.queue[r];this[we](i.routes)}}}goBack(e,t){if(this.queue.length==0||this.cursor<=0)return;let r=0;if(e===null)r=this.cursor+1;else for(let n=this.cursor;n>=0;n--){const i=this.queue[n];if(C.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(s="",e=50){return new Hs(s,e)}function xn(s){}const Ze=Symbol("_constructRouteModel"),et=Symbol("_findRouteModel"),jt=Symbol("_findRootView"),Kr=Symbol("_getFirstView"),ye=Symbol("_removeView"),Tr=Symbol("_buildPage"),$r=Symbol("_resolveComponent"),jr=Symbol("_update"),le=Symbol("_merge"),qt=Symbol("_handleHistoryChange"),tt=Symbol("_handleRouteUpdated"),rt=Symbol("routeUpdatedCallback"),R=Symbol("currentRoutes"),be=Symbol("current"),qr=Symbol("_addRouteRecorder"),qe=Symbol("_removeRouteRecorder"),st=Symbol("_cloneRouteRecorder"),L=Symbol("_handleError"),nt=Symbol("errorCallback"),k=Symbol("registerKey"),it=Symbol("notFoundKey"),Ot=Symbol("notFoundPathKey"),W=Symbol("forestKey"),A=Symbol("historyKey"),Oe=Symbol("beforeFiltersKey"),Le=Symbol("afterFiltersKey"),Me=Symbol("destroyFiltersKey"),Lt=Symbol("propsFilterKey"),Re=Symbol("mainDispatcherKey"),Mt=Symbol("initKey"),de=Symbol("readyKey"),It=Symbol("readyHandlersKey"),ot=Symbol("_markReady"),Or=Symbol("_createNextFn"),Nt=Symbol("_start"),Ht=Symbol("_before"),Dt=Symbol("_after"),Lr=Symbol("_destroy"),Ut=Symbol("_load"),Ie=Symbol("_unload"),Ne=Symbol("routerGuardKey");function Ds(s){return s.layers.length==0||s.layers[0].views.length==0}function Us(s){let e=[];return s.layers.forEach(t=>{t.models==null||t.models==null||t.models.forEach(r=>{if(!(r==null||r==null))if(typeof r.meta=="object"){let n=K(!0,{},r.meta);e.push(n)}else r.meta&&e.push(r.meta)})}),e}class Vs{[k]=new Array;[it];[Ot]="*";[de]=!1;[It]=[];[W]=new Ls;[A];[R]=new Array;[nt]=null;[rt]=null;[Oe]=new Array;[Le]=new Array;[Me]=new Array;[Lt]=null;[Re]=new _e;[Ne]=new Is;[Mt]=!1;[be]=b.ref(null);get current(){return this[be].value}options;constructor(e){this.options=e??{},this.options.notFoundPath&&this.setNotFoundPath(this.options.notFoundPath);let t=this.options.routes||[];this.addRoutes(t),this.options.notFound&&this.setNotFoundRoute(this.options.notFound),e.history?this[A]=e.history:this[A]=me?Fr():_r(),this[A]?.listen(async r=>{let n=!0;try{if(typeof r=="string"){const i=this[N](r);i&&await this[qt]([i])}else await this[qt](r)}catch(i){console.error(i.message,i),n=!1}this[de]===!1&&this[ot](n)})}[L](e="error",t){if(t&&typeof t.error=="function")try{t.error(e)}catch{}if(typeof this[nt]=="function")try{this[nt](e,t)}catch{}console.error(e)}init(){this[Mt]!==!0&&(this[A]?.init(!this[de]),this[Mt]=!0)}isReady(){return this[de]?Promise.resolve():new Promise((e,t)=>{this[It].push([e,t])})}[ot](e){this[de]=!0,this[It].forEach(([t,r])=>{try{e?t():r()}catch(n){console.error(n.message,n)}})}[qt](e){try{if(!e){let o=[...this[R]].reverse();return this[Ie](o),me&&$().location.reload(),Promise.resolve()}let t=null,r=[],n=[],i=0;for(;i<e.length&&i<this[R].length&&C.isSame(e[i],this[R][i]);i++)e[i].active===!0&&e[i].active!==this[R][i].active&&(t=e[i]);if(i<e.length&&(r=e.slice(i)),i<this[R].length&&(n=this[R].slice(i).reverse()),n.length===0&&r.length===0){if(t!==null)return this.restore([t])}else if(n.length>0){if(this[Ie](n)){if(r.length>0)return this.restore(r);if(t!==null)return this.restore([t])}}else return this.restore(r)}catch(t){this[L](t)}return Promise.resolve()}[tt](e){if(e)this[be].value=e;else{let t=this[R].length;t>0?this[be].value=this[R][t-1]:this[be].value=null}if(typeof this[rt]=="function")try{this[rt](this[be].value)}catch{}}[qr](e){if(e.opsType===j.Open){let t=!1;const r=this[R].length-1;for(let n=r;n>=0;n--){const i=this[R][n];if(e.root==i.root){if(e.path===i.path){this[R].splice(n,1,e),t=!0;continue}e.active&&(i.active=!1)}}t||this[R].push(e)}else this[R].push(e)}[st](){let e=[];for(let t of this[R]){let r=C.clone(t,!0);e.push(r)}return e}[qe](e){if(!this[R])return;let t=-1;for(let r=0;r<this[R].length;r++)if(C.isSame(this[R][r],e)){t=r;break}if(t!=-1){let r=this[R][t];this[R].splice(t,1),this[Lr](r,r.session)}}set historyMonitor(e){this[A]&&(this[A].historyMonitor=e)}get historyMonitor(){return this[A]?this[A].historyMonitor:!1}set traceless(e){this[A]&&(this[A].traceless=e)}get traceless(){return this[A]?this[A].traceless:!1}set propsFilter(e){this[Lt]=e}get propsFilter(){return this[Lt]}setRestorePoint(){const e=this[st]();this[A]?.setRestorePoint(e)}onRouteUpdated(e){this[rt]=e}onError(e){this[nt]=e}beforeEach(e){this[Oe].push(e)}removeBeforeEach(e){const t=this[Oe].indexOf(e);return t!==-1?(this[Oe].splice(t,1),!0):!1}afterEach(e){this[Le].push(e)}removeAfterEach(e){const t=this[Le].indexOf(e);return t!==-1?(this[Le].splice(t,1),!0):!1}destroyEach(e){this[Me].push(e)}removeDestroyEach(e){const t=this[Me].indexOf(e);return t!==-1?(this[Me].splice(t,1),!0):!1}beforeRestoreEach(e){this[A]?.beforeRestoreEach(e)}removeBeforeRestoreEach(e){return this[A]?.removeBeforeRestoreEach(e)??!1}addRoutes(e){for(let t of e)this.addRoute(t)}addRoute(e,t=-1){if(e.path===this[Ot]){this.setNotFoundRoute(e);return}const r=this[Ze](e);if(t==-1)this[k]=[...this[k],...r];else for(let n=r.length-1;n>=0;n--)this[k].splice(t,0,r[n])}removeRoute(e){const t=this[N](e);if(t===null)return console.warn("route格式错误",e),!1;for(let r=0;r<this[k].length;r++){const n=this[k][r];if(t?.path&&n.path===t.path)return this[k].splice(r,1),!0;if(t?.name&&n.name===t.name)return this[k].splice(r,1),!0}return!1}hasRoute(e){const t=this[N](e);return t===null?(console.warn("route格式错误",e),!1):this[k].findIndex(n=>{if(t?.path&&n.path===t.path||t?.name&&n.name===t.name)return!0})!==-1}setNotFoundPath(e){this[Ot]=e}setNotFoundRoute(e){const t=this[Ze](e);this[it]=t[0]}getRoutes(){return[...this[k]]}[Ze](e){let t=e.path??"";t.length>0&&t.charAt(0)!=="/"&&(t=`/${t}`);let r=e.components??(e.component&&{"":e.component});if(r==null){const a=new bt;return a.path=t,a.redirect=e.redirect,[a]}let n=[];for(let a in r){let l=r[a];a.length===0&&(a=Y);let u=new ps(a,l,e.props,e.meta);n.push(u)}let i=!1,o=[];if(e.children)for(let a of e.children){let l=this[Ze](a);for(let u of l){let f=new bt;f.name=u.name,u.path&&u.path.length>0?t!=="/"?f.path=`${t}${u.path}`:f.path=u.path:(i=!0,f.path=t);let c=new cr;c.models=[...n],f.layers=[c,...u.layers],o.push(f)}}if(!i){const a=new cr;a.models=n;const l=new bt;l.name=e.name,l.path=t,l.layers=[a],o.splice(0,0,l)}return o}[et](e){const t=e.route;try{for(let r of this[k]){const n=t.template??t.path,i=t.template??t.name;if(n&&r.path){let o=r.match;o||(o=r.match=Ks(r.path));const a=o(n);if(!a)continue;if(r.redirect){const l=new C;K(!0,l,t),l.path=r.redirect;const u={route:l,find:void 0};return this[et](u)?(e.route=u.route,e.find=u.find,t.template&&e.find&&(e.find={...e.find},e.find.path=t.path),!0):!1}if(t.params=t.params??{},K(!0,t.params,a.params),t.query){const l=t.query;if(typeof l=="string"){const u={},f=l.split("&");for(let c of f){const h=c.split("=");if(h.length!==2)continue;const y=decodeURIComponent(h[0].trim()),d=decodeURIComponent(h[1].trim());u[y]=d}K(!0,t.params,u)}else typeof l=="object"&&K(!0,t.params,l)}return e.find=r,t.template&&e.find&&(e.find={...e.find},e.find.path=t.path),!0}else if(i===r.name){t.params=t.params??{};const o=Fs(r.path);return t.path=o(t.params),e.find=r,t.template&&e.find&&(e.find={...e.find},e.find.name=t.name),!0}}}catch(r){console.error(r.message,r),typeof t.error=="function"&&t.error(r.message)}return!1}[N](e){let t=null;if(Array.isArray(e))if(t=new C,typeof e[0]=="object")t=C.from(e[0]);else for(let r=0;r<e.length;r++)r===0?e[r].charAt(0)==="/"?t.path=e[r]:t.name=e[r]:r===1?t.params=e[r]:r===2?t.root=e[r]:r===3&&K(!1,t,e[r]);else typeof e=="object"?t=C.from(e):typeof e=="string"&&(t=new C,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??Y,t.opsType=t.opsType??this.options.defaultOperationType??j.Push,t.traceless&&!t.historyUpdatePolicy&&(t.historyUpdatePolicy="traceless")}return t}push(...e){const t=this[N](e);return t?(t.opsType=j.Push,t.historyUpdatePolicy=t.historyUpdatePolicy??"push",this.to(t)):(this[L]("resolve route fail",t),this)}put(...e){const t=this[N](e);return t?(t.opsType=j.Put,t.historyUpdatePolicy=t.historyUpdatePolicy??"traceless",this.to(t)):(this[L]("resolve route fail",t),this)}replace(...e){const t=this[N](e);return t?(t.opsType=j.Replace,t.historyUpdatePolicy=t.historyUpdatePolicy??"replace",this.to(t)):(this[L]("resolve route fail",t),this)}append(...e){const t=this[N](e);return t?(t.opsType=j.Append,t.historyUpdatePolicy=t.historyUpdatePolicy??"push",this.to(t)):(this[L]("resolve route fail",t),this)}remove(e,t){return new Promise(r=>{this[Re].post(n=>{try{if(this[R].length===0){n.resolve(),r(!1);return}let i=-1,o,a=[];if(e){if(e.root?o=e.root:o=this[R][0].root??Y,e.all)for(let u=this[R].length-1;u>0;u--){let f=this[R][u];f.opsType===j.Append&&f.root===o&&(a.splice(0,0,f),i=u-1)}else if(e.until)for(let u=this[R].length-1;u>0;u--){let f=this[R][u];if(f.opsType===j.Append&&f.root===o){if(e.until.charAt(0)==="/"&&e.until===f.path){i=u;break}else if(e.until===f.name){i=u;break}a.splice(0,0,f)}}}else{o=Y;let u=this[Kr](this[W]);u&&(o=u.name);for(let f=this[R].length-1;f>0;f--){let c=this[R][f];if(c.opsType===j.Append&&c.root===o){a.push(c),i=f-1;break}}}if(a.length===0){let u="can not find route";console.warn(u),n.resolve(u),r(!1);return}let l=null;if(i!==-1&&(l=this[R][i]),this[Ie](a)){if(t===!1)return n.resolve(),r(!0),!0;const u=()=>(n.resolve(),r(!0),!0),f=this[R].length;if(l&&C.isSame(l,this[R][f-1])){this[A]?.goBack(l,u);return}u()}}catch(i){this[L](i),n.resolve(),r(!1)}})})}open(...e){let t=this[N](e);return t?(t.opsType=j.Open,t.historyUpdatePolicy=t.historyUpdatePolicy??"push",this.to(t)):(this[L]("resolve route fail",t),this)}close(e){return this[Re].post(t=>{try{let r=this[N](e);if(!r){t.reject("resolve route fail");return}let n=[];for(let i=0;i<this[R].length;i++){let o=this[R][i];if(o.root===r.root){if(!r.path&&!r.name){n.push(o);continue}if(r.path&&r.path===o.path){n.push(o);break}else if(r.name&&r.name===o.name){n.push(o);break}}}if(n.length===0){t.resolve();return}this[Ie](n)&&this[tt](),t.resolve()}catch(r){this[L](r),t.resolve()}}),this}to(...e){let t=this[N](e);if(!t)return this[L]("resolve route fail",t),this;let r=this[Ne].acquire(t);return r==null?(this[L]("route forbid",t),this):(this[Re].post(n=>{try{let i=this[Nt](t);this[Ht](i),this[Ut](i),this[Dt](i),i.wait((o,a)=>{const l=o.session.to;if(o.session.updateResult&&o.session.updateResult.status==="success")try{let u=C.clone(l,!0);const f=new xr(u,this[st]());l.historyUpdatePolicy==="replace"?this[A]?.replace(f):l.historyUpdatePolicy==="traceless"?this[A]?.setRouteMark(f):this[A]?.push(f)}catch(u){console.error(u.message,u)}if(this[Ne].release(r),this[tt](l),typeof t.success=="function")try{Reflect.apply(t.success,{},[])}catch(u){console.error(u.message,u)}this[de]===!1&&this[ot](!0),n.resolve()},(o,a)=>{this[Ne].release(r),a!==null&&this[L](a,t),this[de]===!1&&this[ot](!1),n.resolve()})}catch(i){this[Ne].release(r),this[L](i,t),n.resolve()}}),this)}back(e=1){this[A]?.go(-e,!1)}[Or](e){return(t,r)=>{if(typeof t=="boolean")e.session.redirect=!1,t?e.resolve():e.reject(r??null);else if(t){const n=this[N](t);if(n){const i=e.session.to;n.success=i.success,n.error=i.error,e.session.to=n,e.session.redirect=!0,e.session.routeModel=null,e.resolve()}else e.session.redirect=!1,e.reject("route resolve fail")}else e.session.redirect=!1,e.resolve()}}[Nt](e){let t=this[R].length>0?this[R][0]:void 0,r=new Be(e,t),n={route:e,find:null};return this[et](n),n.find&&(r.routeModel=n.find,e.matched=Us(n.find),Array.isArray(e.matched)&&e.matched.length>0&&(e.meta=n.find.layers[0].models[0].meta)),new _e(r)}[Ht](e){for(let t of this[Oe])e.post(r=>{const n=this[Or](r);Reflect.apply(t,{},[r.session.to,r.session.from,n,r.session])})}[Dt](e){e.post(t=>{for(let r of this[Le])try{Reflect.apply(r,{},[t.session.to,t.session.from,t.session])}catch(n){console.error(n.message,n)}t.resolve()})}[Lr](e,t){for(let r of this[Me])try{Reflect.apply(r,{},[e,t])}catch(n){console.error(n.message,n)}typeof e.destroy=="function"&&Reflect.apply(e.destroy,e,[])}[Ut](e){e.post(t=>{let r=t.session.to,n=t.session.routeModel;if(n==null){let o={route:r,find:null};if(this[et](o))n=o.find,t.session.routeModel=n;else if(this[it])n=this[it];else{t.reject(`not find route model, path:${r.path??r.name}`);return}}let i=Be.from(t.session);this[Tr](r,n,i).then(o=>{this[W],t.session.updateResult=o??{status:"success",message:""},t.resolve()},o=>{t.reject(o)})})}[Ie](e){if(e.length==0)return!0;let t=this[W],r=[];for(let n of e){let i=this[jt](t,n);i!=null&&r.push({...i,route:n})}if(r.length==0){let n="can not find view index";return this[L](n),!1}for(let n of r.reverse())this[ye](t,{x:n.x,y:n.y},[n.route.index??0],!0);return!0}[jt](e,t){const r=t.root??Y;let n;for(let i=0;i<e.layers.length;i++){const o=e.layers[i];for(let a=o.views.length-1;a>=0;a--){const l=o.views[a];if(l[J]&&l[Qe]===r)return n={x:a,y:i},n}}return null}[Kr](e){return e.layers.length>0&&e.layers[0].views.length>0?e.layers[0].views[0]:null}[ye](e,t,r=null,n=!0){if(t.y>=e.layers.length||t.x>=e.layers[t.y].views.length)return;let i=e.layers[t.y].views[t.x],o=!1,a=[],l=!1,u=[...i.slots.value];for(let c=u.length-1;c>=0;c--){let h=u[c];(!r||r.indexOf(h.index)!=-1)&&(h.route&&i[J]&&(this[qe](h.route),h.active===!0&&h.route.opsType==j.Append&&(l=!0)),a.push(new B(i,h.index,t.y)),u.splice(c,1))}if(u.length==0)n?i.slots.value=u:e.layers[t.y].views.splice(t.x,1);else{if(l){let c=u.length-1,h=u[c];h.active=!0,h.route&&(h.route.active=h.active)}i.slots.value=u}e.layers[t.y].views.length==0&&(o=!0);let f=t.y+1;for(;f<e.layers.length;f++){let c=e.layers[f].views,h=[];for(let y=c.length-1;(o||a.length>0)&&y>=0;y--){let d=c[y];if(d[ce]&&(o||B.include(a,d[ce]))){let p=d.slots.value;for(let m=p.length-1;m>=0;m--){let v=p[m];v.route&&d[J]&&this[qe](v.route),h.push(new B(d,v.index,f)),p.splice(m,1)}e.layers[f].views.splice(y,1)}}a=h,e.layers[f].views.length==0&&(o=!0)}}restore(e){if(!e||this[k].length==0){let t=this[W];if(t.layers.length>0){let r=t.layers[0].views;r.length>0&&(r[0].slots.value=[])}return this[R]=[],this[tt](),Promise.resolve()}else return new Promise((r,n)=>{let i=null,o=!1;for(let a=0;a<e.length;a++){const l=e[a];this[Re].post(u=>{const f=this[Nt](l);this[Ht](f),this[Ut](f),this[Dt](f),f.wait((c,h)=>{i=c.session.to,o=c.session.redirect,u.resolve()},(c,h)=>{i=null,h!==null&&this[L](h),u.resolve()})})}this[Re].post(a=>{if(i&&o===!0){const l=C.clone(i,!0),u=new xr(l,this[st]());this[A]?.replace(u)}a.resolve(),r()})})}[Tr](e,t,r){const n=e.updateType??Ge.Part;return this[$r](t).then(()=>{const o=this[jr](t,e,r,n);if(o.status==="error")throw Error(o.message);return o})}[$r](e){let t=[];for(let r=0;r<e.layers.length;r++){let n=e.layers[r];for(let i=0;i<n.models.length;i++){let o=n.models[i];o.isResolved||t.push(o.resolve())}}return t.length>0?Promise.all(t):Promise.resolve()}[jr](e,t,r,n){if(e.layers[0].models.length!==1)return{status:"error",message:"illegal route structure(multi root node)"};const i=e.layers[0].models[0];let o=this[W],a=Ds(o),l=t.root??Y,u;!a&&n==Ge.Part&&(u=this[jt](o,t));let f,c=0;if(u==null||u==null)if(a||n===Ge.All){if(o.layers.length==0&&(o.layers[0]=new Kt),o.layers[0].views.length==0){let h=t.root??Y;f=new Te(h,!0,null),o.layers[0].views=[f]}else f=o.layers[0].views[0];u={x:0,y:0}}else{let h=t.slot;if(!h)return{status:"error",message:"can not rebuild view(because not route slot)"};let y=h.level;if(y>o.layers.length)return{status:"error",message:"can not insert view(override level)"};let d;if(h.rootName){let p=o.layers[y-1];for(let m of p.views){if(m[J]&&m.name===h.rootName){d=new B(m,h.rootIndex??0,y-1);break}if(m[G]&&m[G].view.name===h.rootName&&m[G].index===h.rootIndex){d=m[G];break}}}if(!d)return{status:"error",message:"can not insert view(not find root node ref)"};f=new Te(l,!0,d),o.layers[y].views.push(f),u={x:o.layers[y].views.length-1,y}}else f=o.layers[u.y].views[u.x];if(c=u.y,f[J]=!0,t.opsType===j.Append){t.index=t.index??ne.get(),t.active=!0;let h=f.slots.value;if(h.length>0){let v=h[h.length-1];v.active=!1,v.route&&(v.route.active=v.active)}let y=new oe(t,i,t.index,!0);f.slots.value=[...h,y];let d=c+1,p=1,m=new B(f,t.index,c);this[le](o,d,e,p,m)}else if(t.opsType===j.Open){let h=f.slots.value;const y=t.active??!0;let d=!1;for(let p of h){if(p.route!==null&&C.isSameForRouteModel(p.route,t)){if(p.active===y)return t.index=p.index,t.active=y,p.route=t,{status:"no-change",message:""};p.active=y,d=!0,t.index=p.index,t.active=y,p.route=t}else y&&(p.active=!1);p.route&&(p.route.active=p.active)}if(!d){t.index=t.index??ne.get(),t.active=y;let p=new oe(t,i,t.index,y);h.push(p);let m=c+1,v=1,w=new B(f,t.index,c);this[le](o,m,e,v,w)}f.slots.value=[...h]}else{let h=f.slots.value;if(h.length==0){t.index=t.index??ne.get(),t.active=!0,f.slots.value=[new oe(t,i,t.index)];let y=c+1,d=1,p=new B(f,t.index,c);this[le](o,y,e,d,p)}else{let y=h[0];if(y.model!==i){this[ye](o,u,null,!0),t.index=t.index??ne.get(),t.active=!0,f.slots.value=[new oe(t,i,t.index)];let d=c+1,p=1,m=new B(f,t.index,c);this[le](o,d,e,p,m)}else{y.route!==null&&this[qe](y.route);let d=!1;const p=t.active??!0;y.active!==p&&(y.active=p,d=!0),t.active=p,t.index=y.index,y.route=t;let m=[];for(let O=1;O<h.length;O++)m.push(h[O].index);m.length>0?this[ye](o,u,m,!0):d&&(f.slots.value=[...h]);let v=[new B(f,t.index,c)],w=c+1,q=1,x=new B(f,t.index,c);for(;v.length>0&&w<o.layers.length&&q<e.layers.length;w++,q++){let O=[];for(let E=0;E<o.layers[w].views.length;E++){let F=o.layers[w].views[E];F[ce]&&B.include(v,F[ce])&&O.unshift(E)}let _=[];for(let E of O){let F=o.layers[w].views[E],Q=e.layers[q].models,D;for(let U=0;U<Q.length;U++)if(F.name===Q[U].name){D=Q[U];break}if(!D)this[ye](o,{x:E,y:w},null,!1);else{let U=F.slots.value;if(U.length==0){let te=0;F.slots.value=[new oe(null,D,te)];let X=w+1,se=q+1;this[le](o,X,e,se,x)}else{let te=U[0];if(te.model!==D){this[ye](o,{x:E,y:w},null,!0),F.slots.value=[new oe(null,D,0)];let X=w+1,se=q+1;this[le](o,X,e,se,x)}else{F[J]&&te.route!==null&&this[qe](te.route);let X=[];for(let se=1;se<U.length;se++)X.push(U[se].index);X.length>0&&this[ye](o,{x:E,y:w},X,!0),_.push(new B(F,te.index,w))}}F[J]=!1}}v=_}this[le](o,w,e,q,x)}}}if(f&&f[G]){let h=f[G];h&&(t.slot=new ms(l,c,h?.view.name,h?.index??0))}return r.to=void 0,r.routeModel=void 0,t.session=r,this[qr](t),{status:"success",message:""}}[le](e,t,r,n,i){let o=n,a=t;for(;a<e.layers.length&&o<r.layers.length;a++,o++){let l=e.layers[a].views;for(let u of r.layers[o].models){let f=new Te(u.name,!1,i),c=new oe(null,u);f.slots.value=[c],l.push(f)}}for(;o<r.layers.length;o++){let l=new Kt;l.views=[];for(let u of r.layers[o].models){let f=new Te(u.name,!1,i),c=new oe(null,u);f.slots.value=[c],l.views.push(f)}e.layers.push(l)}}[ur](e,t,r,n,i,o){if(t<0||t>this[W].layers.length)return null;if(t<this[W].layers.length){let f=this[W].layers[t],c=null;for(let h of f.views){let y=!1;if(r!==null?(y=h.name===e&&h[G]?.view===r,y&&n!==-1&&(y=h[G]?.index===n)):y=h.name===e,!!y){i!==null&&(h[ce]={view:i,index:o,level:t-1}),c=h;break}}if(c!==null)return c}let a=null,l=null;i!==null&&(i[J]?a={view:i,index:o,level:t-1}:a=i[G],l={view:i,index:o,level:t-1});let u=new Te(e,!0,a);if(u[ce]=l,t==this[W].layers.length){let f=new Kt;f.views=[u],this[W].layers.push(f)}else this[W].layers[t].views.push(u);return u}}const Bs="fox-router-view",ks="fox-router-link";function Mr(s,e=!1){let t=null;return e?t=s.showFromClass??s.enterFromClass:t=s.enterFromClass,t||(t=s.transitionName,t?e?`${t}-show-from`:`${t}-enter-from`:null)}function Ir(s,e=!1){let t=null;return e?t=s.showActiveClass??s.enterActiveClass:t=s.enterActiveClass,t||(t=s.transitionName,t?e?`${t}-show-active`:`${t}-enter-active`:null)}function Ws(s,e=!1){let t=null;return e?t=s.showToClass??s.enterToClass:t=s.enterToClass,t||(t=s.transitionName,t?e?`${t}-show-to`:`${t}-enter-to`:null)}function Nr(s,e=!1){let t=null;return e?t=s.hideFromClass??s.leaveFromClass:t=s.leaveFromClass,t||(t=s.transitionName,t?e?`${t}-hide-from`:`${t}-leave-from`:null)}function Hr(s,e=!1){let t=null;return e?t=s.hideActiveClass??s.leaveActiveClass:t=s.leaveActiveClass,t||(t=s.transitionName,t?e?`${t}-hide-active`:`${t}-leave-active`:null)}function zs(s,e=!1){let t=null;return e?t=s.hideToClass??s.leaveToClass:t=s.leaveToClass,t||(t=s.transitionName,t?e?`${t}-hide-to`:`${t}-leave-to`:null)}function Js(s,e=!1){let t=null;return e?t=s.beforeShow??s.beforeEnter:t=s.beforeEnter,t}function Gs(s,e=!1){let t=null;return e?t=s.show??s.enter:t=s.enter,t}function Qs(s,e=!1){let t=null;return e?t=s.afterShow??s.afterEnter:t=s.afterEnter,t}function Xs(s,e=!1){let t=null;return e?t=s.showCancelled??s.enterCancelled:t=s.enterCancelled,t}function Ys(s,e=!1){let t=null;return e?t=s.beforeHide??s.beforeLeave:t=s.beforeLeave,t}function Zs(s,e=!1){let t=null;return e?t=s.hide??s.leave:t=s.leave,t}function en(s,e=!1){let t=null;return e?t=s.afterHide??s.afterLeave:t=s.afterLeave,t}function tn(s,e=!1){let t=null;return e?t=s.hideCancelled??s.leaveCancelled:t=s.leaveCancelled,t}function Vt(s){let e,t=s.duration;return typeof t=="object"?e={enter:t.enter??-1,leave:t.leave??-1,show:t.show??-1,hide:t.hide??-1}:(typeof t=="string"&&(t=t.length==0?-1:Number(t)),e={enter:t,leave:t,show:t,hide:t}),e}function xe(s,e){s.classList.contains(e)||s.classList.add(e)}function Se(s,e){s.classList.remove(e)}const rn=me&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout;function Bt(s){rn(s)}function M(s,e,t){S(e)&&(s==null&&(s={}),Reflect.apply(e,s,t))}function Dr(s,e,t,r=-1,n,i,o,a){if(S(i)){if(n!==void 0&&n>=0){setTimeout(()=>{Reflect.apply(i,s,[e,t,r]),S(a)&&Reflect.apply(a,s,[])},n);return}const l=["animationend","transitionend"],u=f=>{l.forEach(c=>{ct(e,c,u)}),Reflect.apply(i,s,[e,t,r]),a&&Reflect.apply(a,s,[])};l.forEach(f=>{ft(e,f,u)})}if(S(o)){const l="animationcancel",u=f=>{Reflect.apply(o,s,[e,t,r]),ct(e,l,u)};ft(e,l,u)}}function lt(s){return!me||s===null?!1:s.opsType===j.Append||s.opsType===j.Open}function Ur(s,e,t,r={},n,i=-1){if(e||lt(n)){const o=Mr(r,e);o&&xe(t,o);const a=Ir(r,e);a&&xe(t,a);const l=Js(r,e);M(s,l,[t,e,n,i])}}function Vr(s,e,t,r={},n,i,o,a){if(!lt(i)&&!e){S(a)&&a(s,a,[t]);return}const l=Mr(r,e),u=Ir(r,e),f=Ws(r,e),c=Gs(r,e),h=Qs(r,e),y=Xs(r,e);if(!l&&!u&&!f&&!c){S(a)&&a(s,a,[t]);return}Bt(()=>{Dr(s,t,i,o,n,()=>{u&&Se(t,u),f&&Se(t,f),S(h)&&M(s,h,[t,e,i,o]),S(a)&&a(s,a,[t])},()=>{S(y)&&M(s,y,[t,e,i,o])}),l&&Se(t,l),f&&xe(t,f),S(c)&&M(s,c,[t,e,i,o])})}function Br(s,e,t,r={},n,i=-1){if(e||lt(n)){const o=Nr(r,e);o&&xe(t,o);const a=Hr(r,e);a&&xe(t,a);const l=Ys(r,e);M(s,l,[t,e,n,i])}}function kr(s,e,t,r={},n,i,o,a,l){if(!lt(o)&&!e){!e&&S(i)&&i();return}const u=Nr(r,e),f=Hr(r,e),c=zs(r,e),h=Zs(r,e),y=en(r,e),d=tn(r,e);if(!u&&!f&&!c&&!h){!e&&S(i)&&i();return}S(h)&&M(s,h,[t,e,o,a]),Bt(()=>{Dr(s,t,o,a,n,()=>{f&&Se(t,f),c&&Se(t,c),S(y)&&M(s,y,[t,e,o,a]),S(l)&&M(s,l,[t]),!e&&S(i)&&i()},()=>{S(d)&&M(s,d,[t,e,o,a]),S(l)&&M(s,l,[t]),!e&&S(i)&&i()}),u&&Se(t,u),c&&xe(t,c)})}function kt(s,e={},t,r=-1){const n=e.mode??"default",i=Vt(e);return{mode:n,persisted:!1,beforeEnter:a=>{Ur(s,!1,a,e,t,r)},enter:a=>{Vr(s,!1,a,e,i.enter,t,r)},leave:(a,l)=>{Br(s,!1,a,e,t,r),kr(s,!1,a,e,i.leave,l,t,r)},clone:a=>kt(s,e,t,r)}}function Wr(s){return s.el}function sn(s,e,t={},r,n,i,o){if(i){const a=Wr(e);if(a==null)return;const l=Vt(t);Ur(s,!0,a,t,r,n),Vr(s,!0,a,t,l.show,r,n,u=>{S(o)&&M(s,o,[u])})}else S(o)&&M(s,o,[])}function nn(s,e,t={},r,n,i,o){if(i){const a=Wr(e);if(a==null)return;const l=Vt(t);Br(s,!0,a,t,r,n),kr(s,!0,a,t,l.hide,null,r,n,u=>{S(o)&&M(s,o,[u])})}else S(o)&&M(s,o,[])}function on(s,e={}){Bt(()=>{for(let t=0;t<s.length;t++)Reflect.apply(s[t],e,[])})}function ae(s,e,t){return typeof s=="function"?Reflect.apply(s,{},[e,t]):s}function Wt(s,e){if(!s)return null;const t=s(e);return t.length===1?t[0]:t}function Pe(s,e){return typeof e=="function"?e(s):s}class ln{node;state;constructor(e,t){this.node=e,this.state=t}}const zt=b.defineComponent({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,required:!1,default:"default"},modelSlot:{type:[Object],required:!1},multi:{type:Boolean,required:!1,default:!1},tag:{type:[String,Object,Function],required:!1,default:"div"},viewTag:{type:[String,Object,Function],required:!1,default:"div"},viewTagProps:{type:[Object,Function],required:!1,default(){return{}}},viewClass:{type:[String,Function],required:!1},viewActiveClass:{type:[String,Function],required:!1},viewInactiveClass:{type:[String,Function],required:!1},transition:{type:[Boolean,String,Function],required:!1,default:!1},transitionName:{type:String,required:!1},enterFromClass:{type:String,required:!1},enterActiveClass:{type:String,required:!1},enterToClass:{type:String,required:!1},leaveFromClass:{type:String,required:!1},leaveActiveClass:{type:String,required:!1},leaveToClass:{type:String,required:!1},showFromClass:{type:String,required:!1},showActiveClass:{type:String,required:!1},showToClass:{type:String,required:!1},hideFromClass:{type:String,required:!1},hideActiveClass:{type:String,required:!1},hideToClass:{type:String,required:!1},beforeEnter:{type:Function,required:!1},enter:{type:Function,required:!1},afterEnter:{type:Function,required:!1},enterCancelled:{type:Function,required:!1},beforeLeave:{type:Function,required:!1},leave:{type:Function,required:!1},afterLeave:{type:Function,required:!1},leaveCancelled:{type:Function,required:!1},beforeShow:{type:Function,required:!1},show:{type:Function,required:!1},afterShow:{type:Function,required:!1},showCancelled:{type:Function,required:!1},beforeHide:{type:Function,required:!1},hide:{type:Function,required:!1},afterHide:{type:Function,required:!1},hideCancelled:{type:Function,required:!1}},setup(s,e){const t=b.getCurrentInstance();if(t===null||t.proxy===null){console.error("instance or instance.proxy not exist");return}const r=s.multi===!0,n=b.inject(Je,null),i=b.inject(At,0),o=b.inject(vr,null),a=b.inject(Et,-1);let l=null;const u=s.modelSlot;if(u){if(b.provide(At,i+1),b.provide(Et,u.index),b.provide(Ft,u.index),!u.route){console.warn("child view render error, route not exist");return}const h=We(t.proxy,!0);Rs(h),gr(h,()=>u.route??null)}else{if(n==null){console.error("router is not been injected");return}const c=s.name,h=b.inject(wr,null),y=b.inject(Ft,0);if(l=n[ur](c,i,o,a,h,y),l===null)return;b.provide(wr,l);const d=l[J]===!0;if(d&&b.provide(vr,l),!r&&(b.provide(Et,-1),b.provide(At,i+1),b.provide(Ft,-1),d)){const p=We(t.proxy,!0);gr(p,()=>{const m=l.slots.value;return m.length>0?m[0].route:null})}}const f={value:new Map};return b.onUnmounted(()=>{f.value&&f.value.clear()}),()=>{if(r){const c=new Map,h=[],y=l?.slots.value,d=[];for(let v=0;v<y.length;v++){const w=y[v],q=`${s.name}_${w.index}`,x=ae(s.transition,w.route,v)??!0,O={modelSlot:w};let _;e.slots.default?_=b.h(zt,O,{default:e.slots.default}):_=b.h(zt,O);const E={},F=ae(s.viewClass,w.route,v);typeof F=="string"&&F.length>0&&(E[F]=!0);const Q=ae(s.viewActiveClass,w.route,v),D=ae(s.viewInactiveClass,w.route,v),U=f.value.get(q);if(typeof Q=="string"&&Q.length>0&&(E[Q]=w.active),typeof D=="string"&&D.length>0&&(E[D]=!w.active),U&&w.active!==U.state){const re=U.node;w.active?d.unshift(()=>{const Zt=()=>{let He=yr(re);He!=null&&dr(He,Pt.ACTIVATED)};sn(t,re,s,w.route,v,x,Zt)}):d.push(()=>{const Zt=()=>{const He=yr(re);He!=null&&dr(He,Pt.DEACTIVATED)};nn(t,re,s,w.route,v,x,Zt)})}const te={class:E,key:q},X=ae(s.viewTagProps,w.route,v);if(X!==null&&typeof X=="object"){const re=Pe(X,n?.propsFilter);K(!0,te,re)}if(w.route?.viewTagAttrs&&typeof w.route?.viewTagAttrs=="object"){const re=Pe(w.route.viewTagAttrs,n?.propsFilter);K(!0,te,re)}const se=ae(s.viewTag,w.route,v),Yt=b.h(se,te,{default:()=>[_]});if(c.set(q,new ln(Yt,w.active)),f.value.delete(q),x){const re=kt(t,s,w.route,v);Yt.transition=re}h.push(Yt)}f.value=c,on(d,t);const p=ae(s.tag,null,-1),m={};return Object.assign(m,e.attrs),b.h(p,m,{default:()=>h})}else if(u!=null){const c=u.model,h={};if(c.props){if(typeof c.props=="object"){const d=Pe(c.props,n?.propsFilter);K(!1,h,d)}else if(c.props===!0&&typeof u.route?.params=="object"){const d=Pe(u.route.params,n?.propsFilter);K(!1,h,d)}}const y=b.h(c.component,h);return Wt(e.slots.default,{Component:y,route:u.route})??y}else{const c=l.slots.value;if(c.length>0){const h=c[0],y=h.route??(t.proxy&&Ct(t.proxy))??null,d=h.model,p={};if(d.props){if(typeof d.props=="object"){const w=Pe(d.props,n?.propsFilter);K(!1,p,w)}else if(d.props===!0&&typeof y?.params=="object"){const w=Pe(y.params,n?.propsFilter);K(!1,p,w)}}const m=b.h(d.component,p);if(ae(s.transition,y,-1)??!0){const w=kt(t,s,y,-1);m.transition=w}return Wt(e.slots.default,{Component:m,route:y})??m}else return Wt(e.slots.fallback,{})}}}});function an(s){if(!(s.metaKey||s.altKey||s.ctrlKey||s.shiftKey)&&!s.defaultPrevented&&!(s.button!=null&&s.button!==0)){if(s.currentTarget&&s.currentTarget.getAttribute){const e=s.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(e))return}return s.preventDefault&&s.preventDefault(),!0}}function un(s,e){return s==null||e==null?!1:!!(s===e||s.path&&s.path===e.path||s.name&&s.name===e.name)}function fn(s,e){return s==null||e==null?!1:!!(s.path&&e.path&&e.path.startsWith(s.path)||s.name&&s.name==e.name)}function Ce(s,e){return typeof s=="function"?Reflect.apply(s,{},[e]):s}let cn=b.defineComponent({name:"RouterLink",inheritAttrs:!1,props:{tag:{type:[String,Object,Function],required:!1,default:"a"},to:{type:[String,Object,Function],required:!0},root:{type:String},activeClass:{type:[String,Function],required:!1,default:"fox-router-link-active"},exact:{type:[String,Boolean,Function],required:!1},exactActiveClass:{type:[String,Function],required:!1,default:"fox-router-link-exact-active"},event:{type:[String,Function],required:!1,default:"onClick"}},setup(s,e){const t=b.inject(Je,null);return()=>{let r=Ce(s.to,null),n=Ce(s.tag,r);if(n==null){console.warn("can not resolve link tag");return}let i=null,o=null;t!==null&&(i=t[N](r),s.root&&(i.root=s.root),o=t.current);let a={},l=Ce(s.activeClass,i);if(typeof l=="string"&&l.length>0&&(a[l]=fn(i,o)),Ce(s.exact,i)===!0){let h=Ce(s.exactActiveClass,i);typeof h=="string"&&h.length>0&&(a[h]=un(i,o))}let f={class:a};(n==="a"||n==="A")&&(f.href=i?.path??i?.name??"#"),K(!0,f,e.attrs);let c=Ce(s.event,i);if(typeof c=="string"){const h=y=>{if(t==null){console.warn("router is not been injected");return}if(i==null){console.warn("route is not been resolved");return}an(y)&&t.to(i)};f[c]=h}return b.h(n,f,e.slots)}}});var I=(s=>(s[s.Loading=0]="Loading",s[s.Loaded=1]="Loaded",s[s.Defining=2]="Defining",s[s.Defined=3]="Defined",s))(I||{}),at=(s=>(s[s.normal=0]="normal",s[s.factory=1]="factory",s))(at||{});class hn{register=new Map;constructor(){}get(e){return this.register.get(e)??null}set(e,t){this.register.set(e,t)}remove(e){let t=this.register.get(e);return this.register.delete(e),t??null}has(e){return this.register.has(e)}clear(){this.register.clear()}}class zr{moduleManager=new hn;options={paths:{},alias:{},nature:[],timeout:3e3};set paths(e){this.options.paths=e}get paths(){return this.options.paths}set alias(e){this.options.alias=e}get alias(){return this.options.alias}set naturePaths(e){this.options.nature=e}get naturePaths(){return this.options.nature}set timeout(e){this.options.timeout=e}get timeout(){return this.options.timeout}_query;set query(e){this._query=e}get query(){return this._query}get head(){return De().head}constructor(){}setModule(e,t){const r={id:e,src:"",status:I.Defined};typeof t=="function"?(r.exports=t,r.type=at.factory):r.exports=t,this.moduleManager.set(e,r)}removeModule(e){this.moduleManager.remove(e)}ensure(...e){const t=[];let r=e.length-1;const n={};typeof e[r]=="object"&&(Object.assign(n,e[r]),r--);let i=null;typeof e[r]=="function"&&(i=e[r],r--);for(let l=0;l<=r;l++)if(Array.isArray(e[l])){let u=e[l];for(let f=0;f<u.length;f++)u[f]&&t.push(this.resolvePath(u[f]))}else if(typeof e[l]=="string"){let u=e[l].split(",");for(let f=0;f<u.length;f++)u[f]&&t.push(this.resolvePath(u[f]))}const o=new yn(t.length,(l,u)=>{if(o.isOK())try{typeof i=="function"&&Reflect.apply(i,{},u)}catch(f){console.error(f.message,f)}else try{console.error(l),typeof i=="function"&&Reflect.apply(i,{},[])}catch(f){console.error(f.message,f)}}),a=new _e;for(let l=0;l<t.length;l++){const u=new dn(l,t[l],n,o);this.mount(a,u)}return this}remove(...e){let t=[],r=e.length-1,n={};typeof e[r]=="object"&&(Object.assign(n,e[r]),r--);let i=null;typeof e[r]=="function"&&(i=e[r],r--);for(let o=0;o<=r;o++)if(Array.isArray(e[o])){let a=e[o];for(let l=0;l<a.length;l++)a[l]&&t.push(this.resolvePath(a[l]))}else{let a=e[o].split(",");for(let l=0;l<a.length;l++)a[l]&&t.push(this.resolvePath(a[l]))}return t.forEach(o=>{this.unmount(o,n)}),typeof i=="function"&&Reflect.apply(i,{},[]),this}mount(e,t){if(t.src==="exports"){e.post(n=>{t.progress.work(!0,t.index,"exports"),n.resolve()});return}else if(t.src==="module"){e.post(n=>{t.progress.work(!0,t.index,"module"),n.resolve()});return}if(this.isNaturePath(t.src)){let n=t.params.jsPoint;n||(n=this.head),this.mountJS(e,t,n);return}else if(this.isNaturePath(t.src)){let n=t.params.cssPoint;n||(n=this.head),this.mountCSS(e,t,n);return}let r=this.getFileNamePostfix(t.src);if(r==="js"||r.length===0){let n=t.params.jsPoint;n||(n=this.head),this.mountJS(e,t,n);return}else if(r==="css"){let n=t.params.cssPoint;n||(n=this.head),this.mountCSS(e,t,n);return}}mountCSS(e,t,r){e.post(n=>{const i=t.src,o=this.moduleManager.get(i);if(o&&(o.status==I.Defined||o.status==I.Loaded)&&o.exports){o.type===at.factory&&typeof o.exports=="function"?t.progress.work(!0,t.index,o.exports()):t.progress.work(!0,t.index,o.exports),n.resolve();return}const a=De(),l=a.createElement("link");if(Reflect.has(l,"onload"))l.onload=()=>{l.onload=null,l.onerror=null,t.progress.work(!0,t.index,t.src),n.resolve()},l.onerror=()=>{try{r.removeChild(l)}catch(c){console.error(c.message,c)}l.onload=null,l.onerror=null,t.progress.work(!1,t.index,null),n.reject()};else{const c={timeout:this.options.timeout??3e3,time:0,success:()=>{t.progress.work(!0,t.index,t.src),n.resolve()},error:()=>{try{r.removeChild(l)}catch(h){console.error(h.message,h)}t.progress.work(!1,t.index,null),n.resolve()}};setTimeout(()=>{Jr(l,c)},1)}let f=a.getElementById(i);f&&f.parentNode&&f.parentNode.removeChild(f),l.rel="stylesheet",l.type="text/css",l.id=i,l.href=i,r.appendChild(l)})}mountJS(e,t,r){e.post(n=>{const i=t.src;let o=this.moduleManager.get(i);if(o&&(o.status==I.Defined||o.status==I.Loaded)){if(o.exports){o.type===at.factory&&typeof o.exports=="function"?t.progress.work(!0,t.index,o.exports()):t.progress.work(!0,t.index,o.exports),n.resolve();return}if(document.querySelector(`script[src='${i}`)){t.progress.work(!0,t.index,o.exports),n.resolve();return}}o={id:i,src:i,status:I.Loading},this.moduleManager.set(i,o);const l=De().createElement("script");if("onload"in l)l.onload=()=>{l.onload=null,l.onerror=null,o.status===I.Loading&&(o.status=I.Loaded,t.progress.work(!0,t.index,i)),n.resolve()},l.onerror=()=>{try{r.removeChild(l)}catch(c){console.error(c.message,c)}l.onload=null,l.onerror=null,this.moduleManager.remove(i),t.progress.work(!1,t.index,null),n.resolve()};else{const c=l;c.onreadystatechange=()=>{/loaded|complete/.test(c.readyState)&&(c.onreadystatechange=null,o.status==I.Loading&&(o.status=I.Loaded,t.progress.work(!0,t.index,i)),n.resolve())}}l.defer=!0,l.src=i;const f=$();f.define=this.createDefine(o,t),r.appendChild(l)})}unmount(e,t={}){const r=De(),n=this.getFileNamePostfix(e);if(n==="js"||n.length===0){const i=r.querySelector(`script[src="${e}"]`);i&&i.parentNode&&i.parentNode.removeChild(i),this.moduleManager.remove(e);return}else if(n==="css"){const i=r.querySelector(`style[href="${e}"]`);i&&i.parentNode&&i.parentNode.removeChild(i);return}}trimEmptyElement(e){let t=[];for(let r=0;r<e.length;r++){if(e[r]===void 0||e[r]===null)continue;const n=e[r].trim();n.length!==0&&t.push(n)}return t}createDefine(e,t){const r=this,n=function(...i){e.status=I.Defining;let o,a,l,u=i.length;u===1?(l=i[0],o=void 0):u===2?(l=i[1],Array.isArray(i[0])?(a=r.trimEmptyElement(i[0]),o=void 0):a=void 0):(o=i[0],a=r.trimEmptyElement(i[1]),l=i[2]),o&&(e.id=o,r.options.alias[o]=e.src),a&&a.length>0?r.ensure(a,(...f)=>{const c=f.map(h=>h==="exports"?((!e.exports||typeof e.exports!="object")&&(e.exports={}),e.exports):h==="module"?e:h);if(typeof l=="function"){const h=Reflect.apply(l,e,c);h&&typeof h=="object"&&(e.exports=h)}else e.exports=l;e.status=I.Defined,t.progress.work(!0,t.index,e.exports)}):(typeof l=="function"?e.exports=Reflect.apply(l,e,[]):e.exports=l,e.status=I.Defined,t.progress.work(!0,t.index,e.exports))};return n.amd=!0,n}resolvePath(e){try{if(e==="exports"||e==="module"||this.isNaturePath(e))return e;e=this.parserPath(e,!0);let t=this.getFileNamePostfix(e);t=t.toLowerCase();let r=this.createSearch(this.query);return e.indexOf("?")==-1?(t!=="js"&&t!=="css"&&(e+=".js"),r.length>0&&(e+=`?${r}`)):r.length>0&&(e+=`&${r}`),e}catch(t){throw console.error(`resolve path[${e}] fail`,t),t}}createSearch(e){let t="";if(e){for(let r in e){let n=`${e[r]}`;t+=`${encodeURIComponent(r)}=${encodeURIComponent(n)}&`}t.length>0&&(t=t.substring(0,t.length-1))}return t}getFileNamePostfix(e){let t=e.lastIndexOf("?");t==-1&&(t=e.length);let r=e.lastIndexOf(".",t);return r==-1?"":e.substring(r+1,t)}isNaturePath(e){if(!this.options.nature)return!1;if(typeof this.options.nature=="function")return this.options.nature(e);const t=this.options.nature;if(t&&Array.isArray(t))for(let r=0;r<t.length;r++){const n=t[r];if(e.indexOf(n)===0)return!0}return!1}parserPath(e,t){if(e.indexOf("http://")==0||e.indexOf("https://")==0||e.indexOf("file:///")==0)return e;if(e.indexOf("/")==0)return`${ut()}${e.slice(1)}`;if(e.indexOf("./")==0)return`${ut()}${e.slice(2)}`;if(e.indexOf("//")==0)return`${$().location.protocol}${e}`;if(t){let n=this.options.alias[e];if(!n){let i=e.indexOf("/");if(i==-1)n=e;else{let o=e.slice(0,i),a=this.options.paths[o];a?n=a+e.slice(i):n=e}}return this.parserPath(n,!1)}return`${ut()}${e}`}}function Jr(s,e){let t=s.sheet,r=!1;if(e.isOldWebKit)t&&(r=!0);else if(t)try{t.cssRules&&(r=!0)}catch(n){n.name==="NS_ERROR_DOM_SECURITY_ERR"&&(r=!0)}setTimeout(()=>{e.time+=20,r?e.success():e.timeout>e.timeout?e.error():Jr(s,e)},20)}class yn{callback;values;status;size;lastIndex;constructor(e,t){this.size=e,this.callback=t,this.status=!0,this.values=[],this.lastIndex=-1}work(e,t,r){if(this.status=e,this.status===!0&&(this.lastIndex!==t&&this.size--,this.lastIndex=t,this.values.push(r)),this.size===0||this.status===!1)try{Reflect.apply(this.callback,this,[this.status,this.values])}catch(n){console.error(n.message,n)}}isOK(){return this.status}}class dn{index;src;params;progress;constructor(e,t,r,n){this.index=e,this.src=t,this.params=r,this.progress=n}}const Jt=Symbol("fk"),Gt=Symbol("fbk"),Qt=Symbol("fepk");function mn(s={}){const e=new Vs(s),t=new wt,r=new xt,n=new zr,i={get router(){return e},get bus(){return t},get Bus(){return wt},get EventProxy(){return xt},get eventproxy(){return r},get EventChain(){return _e},get Require(){return zr},get require(){return n},get extend(){return K},get clone(){return Ve},get isESModule(){return ht},install(o){o.provide(Je,e),o.provide(Jt,i),o.provide(Gt,t),o.provide(Qt,r),o.component(Bs,zt),o.component(ks,cn),Reflect.defineProperty(o.config.globalProperties,"$fox",{get(){return i}}),Reflect.defineProperty(o.config.globalProperties,"$router",{get(){return e}}),Reflect.defineProperty(o.config.globalProperties,"$bus",{get(){return t}}),Reflect.defineProperty(o.config.globalProperties,"$bus",{get(){return t}}),Reflect.defineProperty(o.config.globalProperties,"$eventProxy",{get(){return r}}),o.config.globalProperties.$fox_on=function(a,l,u=!1){r.on(a,l,u)},o.config.globalProperties.$fox_off=function(a,l){r.off(a,l)},o.config.globalProperties.$fox_once=function(a,l){r.once(a,l)},o.config.globalProperties.$fox_all=function(...a){let l=r;Reflect.apply(l.all,l,a)},o.config.globalProperties.$fox_trigger=function(a,...l){let u=r;Reflect.apply(u.trigger,u,[a,...l])},o.config.globalProperties.$fox_emit=function(a,...l){let u=r;Reflect.apply(u.trigger,u,[a,...l])},o.mixin({computed:{$route(){return Ct(this)}}}),e.init()}};return i}function Xt(s){return s?s.$router:b.inject(Je)}function pn(s){return s||(s=b.getCurrentInstance()?.proxy??void 0),s?Ct(s):null}function gn(s){return s?s.$fox:b.inject(Jt)}function vn(s){return s?s.$bus:b.inject(Gt)}function wn(s){return s?s.$eventProxy:b.inject(Qt)}function bn(s){const e=Xt(),t=(r,n,i)=>{try{Reflect.apply(s,{},[r,n])}catch(o){console.error(o)}i()};e.beforeEach(t),b.onUnmounted(()=>{e.removeBeforeEach(t)})}function Rn(s){const e=Xt(),t=(r,n,i)=>{try{Reflect.apply(s,{},[r,n])}catch(o){console.error(o)}i()};e.afterEach(t),b.onUnmounted(()=>{e.removeAfterEach(t)})}g.Bus=wt,g.EventChain=_e,g.EventProxy=xt,g.OperationType=j,g.Route=C,g.clone=Ve,g.createFox=mn,g.createMemoryHistory=_r,g.createWebHashHistory=Fr,g.createWebHistory=Ns,g.deleteContextValue=bs,g.extend=K,g.foxBusKey=Gt,g.foxEventProxyKey=Qt,g.foxKey=Jt,g.injectContextValue=St,g.isArray=Qr,g.isDate=Zr,g.isESModule=ht,g.isEqual=pt,g.isFunction=S,g.isMap=Xr,g.isNil=tr,g.isObject=er,g.isPlainObject=rr,g.isPromise=rs,g.isSet=Yr,g.isString=es,g.isSymbol=ts,g.onAfterRouteUpdate=Rn,g.onBeforeRouteUpdate=bn,g.onFoxActivated=Cs,g.onFoxInactivated=As,g.provideContextValue=ws,g.sessionKey=ie,g.toBoolean=dt,g.toNumber=os,g.toTypeString=Ue,g.typeOf=mt,g.useBus=vn,g.useEventProxy=wn,g.useFox=gn,g.useRoute=pn,g.useRouter=Xt,Object.defineProperty(g,Symbol.toStringTag,{value:"Module"})});
package/libs/style.css ADDED
@@ -0,0 +1 @@
1
+ @charset "UTF-8";.fox-views.fox-views-window{display:block}.fox-views.fox-views-window .fox-view{position:fixed;top:0;left:0;width:100%;-webkit-box-sizing:border-box;box-sizing:border-box;z-index:100}.fox-views.fox-card-views{position:relative;width:100%;height:100%;-webkit-box-sizing:border-box;box-sizing:border-box}.fox-views.fox-card-views .fox-card-view{width:100%}.fox-views.fox-card-views .fox-card-view-active{z-index:1}.fox-views.fox-card-views .fox-card-view-inactive{display:none;z-index:0}.fox-views .fox-view-trans-enter-to{-webkit-animation:fox-view-in-slide-right .33s;animation:fox-view-in-slide-right .33s;z-index:120}.fox-views .fox-view-trans-leave-to{-webkit-animation:fox-view-out-slide-right .32s;animation:fox-view-out-slide-right .32s;z-index:120}.fox-views .fox-view-trans-show-to{-webkit-animation:fox-view-show-slide-right .3s;animation:fox-view-show-slide-right .3s;z-index:110}.fox-views .fox-view-trans-hide-to{-webkit-animation:fox-view-hide-slide-left .32s;animation:fox-view-hide-slide-left .32s;z-index:110}@-webkit-keyframes fox-view-in-slide-right{0%{-webkit-transform:translateX(103%);transform:translate(103%)}to{-webkit-transform:translateX(0%);transform:translate(0)}}@keyframes fox-view-in-slide-right{0%{-webkit-transform:translateX(103%);transform:translate(103%)}to{-webkit-transform:translateX(0%);transform:translate(0)}}@-webkit-keyframes fox-view-out-slide-right{0%{-webkit-transform:translateX(0%);transform:translate(0)}to{-webkit-transform:translateX(103%);transform:translate(103%)}}@keyframes fox-view-out-slide-right{0%{-webkit-transform:translateX(0%);transform:translate(0)}to{-webkit-transform:translateX(103%);transform:translate(103%)}}@-webkit-keyframes fox-view-hide-slide-left{0%{-webkit-transform:translateX(0%);transform:translate(0)}to{-webkit-transform:translateX(-30%);transform:translate(-30%)}}@keyframes fox-view-hide-slide-left{0%{-webkit-transform:translateX(0%);transform:translate(0)}to{-webkit-transform:translateX(-30%);transform:translate(-30%)}}@-webkit-keyframes fox-view-show-slide-right{0%{-webkit-transform:translateX(-30%);transform:translate(-30%)}to{-webkit-transform:translateX(0%);transform:translate(0)}}@keyframes fox-view-show-slide-right{0%{-webkit-transform:translateX(-30%);transform:translate(-30%)}to{-webkit-transform:translateX(0%);transform:translate(0)}}
package/package.json CHANGED
@@ -1,18 +1,36 @@
1
1
  {
2
2
  "name": "@fox-js/fox",
3
- "version": "3.0.2",
3
+ "type": "module",
4
+ "version": "3.1.0",
4
5
  "description": "Fox Router and commons Utils",
5
- "main": "main.js",
6
- "style": "libs/index.css",
7
- "typings": "",
6
+ "author": "jiangcheng",
7
+ "keywords": [
8
+ "fox",
9
+ "router",
10
+ "vue3",
11
+ "typescript"
12
+ ],
13
+ "main": "./libs/index.umd.js",
14
+ "module": "./libs/index.esm.js",
15
+ "types": "./libs/index.esm.d.ts",
16
+ "style": "./dist/style.css",
17
+ "exports": {
18
+ ".": {
19
+ "import": "./libs/index.esm.js",
20
+ "require": "./libs/index.umd.js"
21
+ },
22
+ "./style.css": "./libs/style.css",
23
+ "./*": "./*"
24
+ },
25
+ "files": [
26
+ "libs"
27
+ ],
8
28
  "publishConfig": {
9
29
  "access": "public"
10
30
  },
11
31
  "scripts": {
12
- "publish:beta": "npm version prerelease & npm publish --tag beta",
13
- "publish:next": "npm version prerelease & npm publish --tag next",
14
- "publish:latest": "npm version patch & npm publish"
32
+ "publish:next": "npm version prerelease && npm publish --tag next"
15
33
  },
16
34
  "dependencies": {},
17
35
  "repository": ""
18
- }
36
+ }
package/libs/index.css DELETED
@@ -1,144 +0,0 @@
1
- @charset "UTF-8";
2
- /* eslint-disable */
3
- /*views window*/
4
- .fox-views {
5
- /*卡片容器class*/
6
- }
7
- .fox-views.fox-views-window {
8
- display: block;
9
- /*view class*/
10
- }
11
- .fox-views.fox-views-window .fox-view {
12
- position: fixed;
13
- top: 0px;
14
- left: 0px;
15
- width: 100%;
16
- -webkit-box-sizing: border-box;
17
- box-sizing: border-box;
18
- z-index: 100;
19
- }
20
- .fox-views.fox-card-views {
21
- position: relative;
22
- width: 100%;
23
- height: 100%;
24
- box-sizing: border-box;
25
- /*卡片页class*/
26
- /*卡片页激活class*/
27
- /*卡片页失活class*/
28
- }
29
- .fox-views.fox-card-views .fox-card-view {
30
- width: 100%;
31
- height: 100%;
32
- }
33
- .fox-views.fox-card-views .fox-card-view-active {
34
- z-index: 1;
35
- }
36
- .fox-views.fox-card-views .fox-card-view-deactive {
37
- display: none;
38
- z-index: 0;
39
- }
40
- .fox-views .fox-view-trans-enter-to {
41
- animation: fox-view-in-slide-right 330ms;
42
- -webkit-animation: fox-view-in-slide-right 330ms;
43
- z-index: 120;
44
- }
45
- .fox-views .fox-view-trans-leave-to {
46
- animation: fox-view-out-slide-right 320ms;
47
- -webkit-animation: fox-view-out-slide-right 320ms;
48
- z-index: 120;
49
- }
50
- .fox-views .fox-view-trans-show-to {
51
- animation: fox-view-show-slide-right 300ms;
52
- -webkit-animation: fox-view-show-slide-right 300ms;
53
- z-index: 110;
54
- }
55
- .fox-views .fox-view-trans-hide-to {
56
- animation: fox-view-hide-slide-left 320ms;
57
- -webkit-animation: fox-view-hide-slide-left 320ms;
58
- z-index: 110;
59
- }
60
-
61
- /* 进场动画 */
62
- @-webkit-keyframes fox-view-in-slide-right {
63
- 0% {
64
- -webkit-transform: translateX(103%);
65
- transform: translateX(103%);
66
- }
67
- 100% {
68
- -webkit-transform: translateX(0%);
69
- transform: translateX(0%);
70
- }
71
- }
72
- @keyframes fox-view-in-slide-right {
73
- 0% {
74
- -webkit-transform: translateX(103%);
75
- transform: translateX(103%);
76
- }
77
- 100% {
78
- -webkit-transform: translateX(0%);
79
- transform: translateX(0%);
80
- }
81
- }
82
- /* 出场动画 */
83
- @-webkit-keyframes fox-view-out-slide-right {
84
- 0% {
85
- -webkit-transform: translateX(0%);
86
- transform: translateX(0%);
87
- }
88
- 100% {
89
- -webkit-transform: translateX(103%);
90
- transform: translateX(103%);
91
- }
92
- }
93
- @keyframes fox-view-out-slide-right {
94
- 0% {
95
- -webkit-transform: translateX(0%);
96
- transform: translateX(0%);
97
- }
98
- 100% {
99
- -webkit-transform: translateX(103%);
100
- transform: translateX(103%);
101
- }
102
- }
103
- /* 隐藏动画 */
104
- @-webkit-keyframes fox-view-hide-slide-left {
105
- 0% {
106
- -webkit-transform: translateX(0%);
107
- transform: translateX(0%);
108
- }
109
- 100% {
110
- -webkit-transform: translateX(-30%);
111
- transform: translateX(-30%);
112
- }
113
- }
114
- @keyframes fox-view-hide-slide-left {
115
- 0% {
116
- -webkit-transform: translateX(0%);
117
- transform: translateX(0%);
118
- }
119
- 100% {
120
- -webkit-transform: translateX(-30%);
121
- transform: translateX(-30%);
122
- }
123
- }
124
- /* 显示动画 */
125
- @-webkit-keyframes fox-view-show-slide-right {
126
- 0% {
127
- -webkit-transform: translateX(-30%);
128
- transform: translateX(-30%);
129
- }
130
- 100% {
131
- -webkit-transform: translateX(0%);
132
- transform: translateX(0%);
133
- }
134
- }
135
- @keyframes fox-view-show-slide-right {
136
- 0% {
137
- -webkit-transform: translateX(-30%);
138
- transform: translateX(-30%);
139
- }
140
- 100% {
141
- -webkit-transform: translateX(0%);
142
- transform: translateX(0%);
143
- }
144
- }
package/libs/index.js DELETED
@@ -1 +0,0 @@
1
- import{ref as e,effectScope as t,watch as r,shallowRef as n,getCurrentInstance as i,onUnmounted as l,shallowReactive as o,defineComponent as s,inject as a,provide as u,h}from"vue";const c=Array.isArray,f=e=>"[object Map]"===x(e),p=e=>"[object Set]"===x(e),d=e=>e instanceof Date,y=e=>"function"==typeof e,m=e=>"string"==typeof e,g=e=>"symbol"==typeof e,v=e=>null!==e&&"object"==typeof e,b=e=>v(e)&&y(e.then)&&y(e.catch),w=Object.prototype.toString,x=e=>w.call(e),S=e=>"[object Object]"===x(e),R="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;function A(e){return e.__esModule||R&&"Module"===e[Symbol.toStringTag]}const j="undefined"!=typeof Promise&&-1!==Promise.toString().indexOf("[native code]");function E(...e){var t;let r=void 0!==e[0]&&null!==e[0]?e[0]:{},n=1,i=e.length,l=!1;for("boolean"==typeof r&&(l=r,r=null!=(t=e[n])?t:{},n++),"object"!=typeof r&&(r={});n<i;n++)if(null!==e[n]&&void 0!==e[n]){let t=e[n];for(let e in t){let n=r[e],i=t[e];if(n!==i)if(!0===l&&i&&"object"==typeof i){let t;t=Array.isArray(i)?n&&Array.isArray(n)?n:[]:n&&"object"==typeof n?n:{},r[e]=E(l,t,i)}else void 0!==i&&(r[e]=i)}}return r}function O(e,t,r=!1){if(r){if("object"!=typeof t)return{};"object"!=typeof e&&(e={});for(let n in t){let i=e[n],l=t[n];if(i!==l)if("object"==typeof l){if(!Array.isArray(l)&&!S(l))continue;i=O(i,l,r),e[n]=i}else{if("function"==typeof l)continue;e[n]=l}}const n=Object.getOwnPropertySymbols(t);for(let i of n){let n=e[i],l=t[i];if(n!==l)if("object"==typeof l){if(!Array.isArray(l)&&!S(l))continue;n=O(n,l,r),e[i]=n}else{if("function"==typeof l)continue;e[i]=l}}}else E(!0,e,t);return e}const P=class{static get(){let e=++P.seed;return e>=Number.MAX_VALUE&&(P.seed=0),e}};let C=P;C.seed=(new Date).getTime();const T=j?Promise.resolve():null;function $(e,...t){null!==T?t&&t.length>0?T.then((()=>{e(t)})):T.then(e):t&&t.length>0?setTimeout((()=>{e(t)})):setTimeout(e)}function q(e){return null!=e&&("boolean"==typeof e?e:"string"==typeof e?"true"===e.toLocaleLowerCase():Boolean(e))}function F(e){return"number"==typeof e?e:Number(e)}const k={"[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 _(e){let t=Object.prototype.toString.call(e);return null==e?String(e):k[t]||"object"}function M(e){return e&&"object"==typeof e&&"setInterval"in e}function N(e){let t=!!e&&"length"in e&&e.length,r=_(e);return"function"!==r&&!M(e)&&("array"===r||0===t||"number"==typeof t&&t>0&&t-1 in e)}function K(e,t){let r=+t.length,n=0,i=e.length;for(;n<r;n++)e[i++]=t[n];return e.length=i,e}function I(e,t=[]){let r=t;return null!=e&&(N(Object(e))?K(r,"string"==typeof e?[e]:e):r.push(e)),r}function D(e,t,r){if(N(e))Reflect.apply([].forEach,e,[t]);else for(let n in e)if(r&&e.hasOwnProperty(n)){if(!1===Reflect.apply(t,e,[e[n]]))break}else if(!1===Reflect.apply(t,e,[e[n]]))break;return e}function L(e,t){if(e==t)return!0;if(void 0===e||void 0===t)return!1;let r=_(e);if(r!==_(t))return!1;if("object"===r){let r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(let n=0;n<r.length;n++){let i=r[n];if(!L(e[i],t[i]))return!1}return!0}if("array"===r){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++){if(!L(e[r],t[r]))return!1}return!0}return!1}var H,B,U;const V=Symbol("idKey"),W=Symbol("valueKey"),J=Symbol("childrenKey"),z=Symbol("growKey");class G{constructor(t){this[H]=!0,this[B]=e(),this[U]=new Map,this[V]=t}}H=z,B=W,U=J;class X{get(e,t){if("value"==t)return e[W].value;if("grow"===t)return e[z];let r=e[J].get(t);return r?Q(r):e[z]?(r=Y(t),r[z]=e[z],e[J].set(t,r),Q(r)):void 0}set(e,t,r){return"value"==t?(e[W].value=r,!0):"grow"===t?(e[z]=q(r),!0):null==r?(e[J].delete(t),!0):(console.error(`illegal property:${t}`),!1)}deleteProperty(e,t){return"value"===t||"grow"==t?(console.error(`can not delete property:${String(t)}`),!1):(e[J].delete(t),!0)}}function Y(e){let t=new G(e);return Reflect.set(t,"__proxy__",new Proxy(t,new X)),t}function Q(e){return Reflect.get(e,"__proxy__")}class Z extends G{constructor(){super("__root__")}put(...e){let t=e.length;if(t<2)return console.error("参数至少包括一个(key, value)"),!1;let r=this;for(let n=0;n<t-1;n++){let t,i=e[n];r[J].has(i)?t=r[J].get(i):(t=Y(i),r[J].set(i,t)),r=t}return r[W].value=e[t-1],!0}get(...e){let t=e.length;if(0===t)return;let r=this;for(let n=0;n<t;n++){let t=e[n];if(!r[J].has(t))return;r=r[J].get(t)}return r[W].value}remove(...e){let t=e.length;if(0==t)return!1;let r=this;for(let n=0;n<t-1;n++){let t=e[n];if(!r[J].has(t))return!1;r=r[J].get(t)}let n=e[t-1];return!!r[J].has(n)&&(r[J].delete(n),!0)}contains(...e){let t=e.length;if(0==t)return!1;let r=this;for(let n=0;n<t-1;n++){let t=e[n];if(!r[J].has(t))return!1;r=r[J].get(t)}let n=e[t-1];return r[J].has(n)}clear(){this[J].clear()}}const ee=["put","get","contains","remove","clear"];function te(e){return ee.includes(e)}class re{get(e,t){if("value"==t)return e[W].value;if("grow"===t)return e[z];if(t===J)return e[J];if("string"==typeof t&&te(t))return e[t];let r=String(t),n=e[J].get(r);return n?Q(n):e[z]?(n=Y(r),n[z]=e[z],e[J].set(r,n),Q(n)):void 0}set(e,t,r){return"value"==t?(e[W].value=r,!0):"grow"===t?(e[z]=q(r),!0):!te(t)&&(null==r?(e[J].delete(t),!0):(console.error(`illegal property:${t}`),!1))}deleteProperty(e,t){return"value"===t||"grow"==t?(console.error(`can not delete property:${String(t)}`),!1):(e[J].delete(t),!0)}}let ne=new Proxy(Z,{construct:(e,...t)=>Q(function(){let e=new Z,t=new re,r=new Proxy(e,t),n={put:(...t)=>Reflect.apply(e.put,e,t),get:(...t)=>Reflect.apply(e.get,e,t),remove:(...t)=>Reflect.apply(e.remove,e,t),contains:(...t)=>Reflect.apply(e.contains,e,t),clear:()=>Reflect.apply(e.clear,e,[])};return Object.assign(n,r),Reflect.set(e,"__proxy__",r),e}())});function ie(e,t){void 0===t&&(t={});for(var r=function(e){for(var t=[],r=0;r<e.length;){var n=e[r];if("*"!==n&&"+"!==n&&"?"!==n)if("\\"!==n)if("{"!==n)if("}"!==n)if(":"!==n)if("("!==n)t.push({type:"CHAR",index:r,value:e[r++]});else{var i=1,l="";if("?"===e[s=r+1])throw new TypeError('Pattern cannot start with "?" at '+s);for(;s<e.length;)if("\\"!==e[s]){if(")"===e[s]){if(0==--i){s++;break}}else if("("===e[s]&&(i++,"?"!==e[s+1]))throw new TypeError("Capturing groups are not allowed at "+s);l+=e[s++]}else l+=e[s++]+e[s++];if(i)throw new TypeError("Unbalanced pattern at "+r);if(!l)throw new TypeError("Missing pattern at "+r);t.push({type:"PATTERN",index:r,value:l}),r=s}else{for(var o="",s=r+1;s<e.length;){var a=e.charCodeAt(s);if(!(a>=48&&a<=57||a>=65&&a<=90||a>=97&&a<=122||95===a))break;o+=e[s++]}if(!o)throw new TypeError("Missing parameter name at "+r);t.push({type:"NAME",index:r,value:o}),r=s}else t.push({type:"CLOSE",index:r,value:e[r++]});else t.push({type:"OPEN",index:r,value:e[r++]});else t.push({type:"ESCAPED_CHAR",index:r++,value:e[r++]});else t.push({type:"MODIFIER",index:r,value:e[r++]})}return t.push({type:"END",index:r,value:""}),t}(e),n=t.prefixes,i=void 0===n?"./":n,l="[^"+se(t.delimiter||"/#?")+"]+?",o=[],s=0,a=0,u="",h=function(e){if(a<r.length&&r[a].type===e)return r[a++].value},c=function(e){var t=h(e);if(void 0!==t)return t;var n=r[a],i=n.type,l=n.index;throw new TypeError("Unexpected "+i+" at "+l+", expected "+e)},f=function(){for(var e,t="";e=h("CHAR")||h("ESCAPED_CHAR");)t+=e;return t};a<r.length;){var p=h("CHAR"),d=h("NAME"),y=h("PATTERN");if(d||y){var m=p||"";-1===i.indexOf(m)&&(u+=m,m=""),u&&(o.push(u),u=""),o.push({name:d||s++,prefix:m,suffix:"",pattern:y||l,modifier:h("MODIFIER")||""})}else{var g=p||h("ESCAPED_CHAR");if(g)u+=g;else if(u&&(o.push(u),u=""),h("OPEN")){m=f();var v=h("NAME")||"",b=h("PATTERN")||"",w=f();c("CLOSE"),o.push({name:v||(b?s++:""),pattern:v&&!b?l:b,prefix:m,suffix:w,modifier:h("MODIFIER")||""})}else c("END")}}return o}function le(e,t){return function(e,t){void 0===t&&(t={});var r=ae(t),n=t.encode,i=void 0===n?function(e){return e}:n,l=t.validate,o=void 0===l||l,s=e.map((function(e){if("object"==typeof e)return new RegExp("^(?:"+e.pattern+")$",r)}));return function(t){for(var r="",n=0;n<e.length;n++){var l=e[n];if("string"!=typeof l){var a=t?t[l.name]:void 0,u="?"===l.modifier||"*"===l.modifier,h="*"===l.modifier||"+"===l.modifier;if(Array.isArray(a)){if(!h)throw new TypeError('Expected "'+l.name+'" to not repeat, but got an array');if(0===a.length){if(u)continue;throw new TypeError('Expected "'+l.name+'" to not be empty')}for(var c=0;c<a.length;c++){var f=i(a[c],l);if(o&&!s[n].test(f))throw new TypeError('Expected all "'+l.name+'" to match "'+l.pattern+'", but got "'+f+'"');r+=l.prefix+f+l.suffix}}else if("string"!=typeof a&&"number"!=typeof a){if(!u){var p=h?"an array":"a string";throw new TypeError('Expected "'+l.name+'" to be '+p)}}else{f=i(String(a),l);if(o&&!s[n].test(f))throw new TypeError('Expected "'+l.name+'" to match "'+l.pattern+'", but got "'+f+'"');r+=l.prefix+f+l.suffix}}else r+=l}return r}}(ie(e,t),t)}function oe(e,t){var r=[];return function(e,t,r){void 0===r&&(r={});var n=r.decode,i=void 0===n?function(e){return e}:n;return function(r){var n=e.exec(r);if(!n)return!1;for(var l=n[0],o=n.index,s=Object.create(null),a=function(e){if(void 0===n[e])return"continue";var r=t[e-1];"*"===r.modifier||"+"===r.modifier?s[r.name]=n[e].split(r.prefix+r.suffix).map((function(e){return i(e,r)})):s[r.name]=i(n[e],r)},u=1;u<n.length;u++)a(u);return{path:l,index:o,params:s}}}(he(e,r,t),r,t)}function se(e){return e.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1")}function ae(e){return e&&e.sensitive?"":"i"}function ue(e,t,r){return function(e,t,r){void 0===r&&(r={});for(var n=r.strict,i=void 0!==n&&n,l=r.start,o=void 0===l||l,s=r.end,a=void 0===s||s,u=r.encode,h=void 0===u?function(e){return e}:u,c="["+se(r.endsWith||"")+"]|$",f="["+se(r.delimiter||"/#?")+"]",p=o?"^":"",d=0,y=e;d<y.length;d++){var m=y[d];if("string"==typeof m)p+=se(h(m));else{var g=se(h(m.prefix)),v=se(h(m.suffix));if(m.pattern)if(t&&t.push(m),g||v)if("+"===m.modifier||"*"===m.modifier){var b="*"===m.modifier?"?":"";p+="(?:"+g+"((?:"+m.pattern+")(?:"+v+g+"(?:"+m.pattern+"))*)"+v+")"+b}else p+="(?:"+g+"("+m.pattern+")"+v+")"+m.modifier;else p+="("+m.pattern+")"+m.modifier;else p+="(?:"+g+v+")"+m.modifier}}if(a)i||(p+=f+"?"),p+=r.endsWith?"(?="+c+")":"$";else{var w=e[e.length-1],x="string"==typeof w?f.indexOf(w[w.length-1])>-1:void 0===w;i||(p+="(?:"+f+"(?="+c+"))?"),x||(p+="(?="+f+"|"+c+")")}return new RegExp(p,ae(r))}(ie(e,r),t,r)}function he(e,t,r){return e instanceof RegExp?function(e,t){if(!t)return e;for(var r=/\((?:\?<(.*?)>)?(?!\?)/g,n=0,i=r.exec(e.source);i;)t.push({name:i[1]||n++,prefix:"",suffix:"",modifier:"",pattern:""}),i=r.exec(e.source);return e}(e,t):Array.isArray(e)?function(e,t,r){var n=e.map((function(e){return he(e,t,r).source}));return new RegExp("(?:"+n.join("|")+")",ae(r))}(e,t,r):ue(e,t,r)}const ce=Symbol("sync"),fe=Symbol("resolveRoute");function pe(e){let t=!1;return function(...r){if(!t)return t=!0,Reflect.apply(e,{},r)}}class de{constructor(e,t,r,n){this.rootIndex=0,this.name=e,this.level=t,this.rootName=r,this.rootIndex=n}}class ye{constructor(e,t){this.data={},this.to=e,this.from=t}static from(e){var t;let r=new ye(e.to,e.from),n=null!=(t=e.data)?t:{};return E(!0,r.data,n),r}}class me{get fullPath(){var e,t;let r=null!=(e=this.path)?e:`/${this.name}`;return`${null!=(t=this.root)?t:"default"}!${r}`}static clone(e,t){let r=new me;return O(r,e,t),r}static isSame(e,t){return e===t||null!=e&&null!=t&&((!e.path||e.path===t.path)&&((!e.name||e.name===t.name)&&(e.root===t.root&&e.index===t.index)))}static isSameForRouteModel(e,t){return e===t||null!=e&&null!=t&&((!e.path||e.path==t.path)&&(!e.name||e.name==t.name))}static from(e){let t=new me;if(null==e)return t;let r=t;for(let t in e){let n=e[t];r[t]=n}const n=Object.getOwnPropertySymbols(e);if(Array.isArray(n)&&n.length>0)for(let t of n)r[t]=e[t];return t}}class ge{constructor(e,t,r,n){this.id=C.get(),this.name=e,this.src=t,"function"!=typeof t&&(this.component=t),this.props=r,this.meta=n}get isResolved(){return void 0!==this.component}resolve(){return function(e){let t=e.src;return new Promise(((r,n)=>{const i=pe((t=>{A(t)&&(t=t.default),e.component=t,console.debug("success load async module"),r()})),l=pe((e=>{console.debug("reject load async module"),n(e)}));let o;try{o=t(i,l)}catch(e){l(e)}if(o)if("function"==typeof o.then)o.then(i,l);else{const e=o.component;e&&"function"==typeof e.then&&e.then(i,l)}}))}(this)}}class ve{constructor(){this.models=[]}}class be{constructor(){this.layers=[]}}var we,xe,Se,Re,Ae,je;(xe=we||(we={}))[xe.Push=0]="Push",xe[xe.Replace=1]="Replace",xe[xe.Put=2]="Put",xe[xe.Append=3]="Append",xe[xe.Open=4]="Open",(Re=Se||(Se={}))[Re.Part=0]="Part",Re[Re.All=1]="All";const Ee=Symbol("rootKey"),Oe=Symbol("rootNodeKey"),Pe=Symbol("parentNodeKey"),Ce=Symbol("nameKey");class Te{constructor(e,t,r=0,n=!0){this.instance=null,this.active=!0,this.index=0,this.route=e,this.model=t,this.index=r,this.active=n}}class $e{constructor(e,t,r){this.scope=null,this[Ae]=null,this[je]=null,this[Ce]=e,this[Ee]=t,r&&(this[Oe]=r)}set compensation(e){null!==this.scope&&this.scope.stop(),this.scope=t(),this.scope.run((()=>{r(this.slots,(()=>{let t=!1;try{t=e()}catch(e){console.error(e)}t&&null!==this.scope&&(this.scope.stop(),this.scope=null)}))}))}get slots(){return null==this._slots&&(this._slots=n([])),this._slots}get empty(){return null==this._slots||0==this._slots.value.length}get name(){return this[Ce]}}Ae=Oe,je=Pe;class qe{constructor(e,t,r){this.view=e,this.index=t,this.level=r}static include(e,t){for(let r=0;r<e.length;r++){let n=e[r];if(n.view===t.view&&(-1==t.index||n.index===t.index)&&n.level===t.level)return!0}return!1}}class Fe{constructor(){this.views=[]}}class ke{constructor(){this.layers=[]}}class _e{}class Me{constructor(){this.forbidTime=300,this.submitRecorder=new _e}isSameRoute(e,t){return null!=e&&null!=t&&(e.name===t.name&&e.path===t.path&&e.root===t.root)}acquire(e){let t=(new Date).getTime();if(!(this.isSameRoute(e,this.submitRecorder.route)&&this.submitRecorder.time&&t-this.submitRecorder.time<=this.forbidTime))return this.submitRecorder.route=e,this.submitRecorder.time=t,t;this.submitRecorder.time=t}release(e){this.submitRecorder.time===e&&(this.submitRecorder.route=void 0)}}const Ne=void 0!==typeof window,Ke=window,Ie=window.document;function De(e,t,r){e.addEventListener?e.addEventListener(t,r,!1):e.attachEvent?e.attachEvent(`on${t}`,r):e[`on${t}`]=r}function Le(e,t,r){e.removeEventListener?e.removeEventListener(t,r):e.detachEvent?e.detachEvent(`on${t}`,r):e[`on${t}`]=null}let He=function(){let e=Ke.location,t=`${e.protocol}//${e.host}`;return t+=function(e){let t=e,r=t.lastIndexOf("/");return r>0&&r<t.length-1?t=t.substring(0,r+1):0===r&&-1!==t.indexOf(".")?t="/":-1===r&&(t=-1==t.indexOf(".")?`/${t}/`:"/"),0!==t.indexOf("/")&&(t=`/${t}`),t}(e.pathname),t}();var Be=Object.defineProperty,Ue=Object.getOwnPropertySymbols,Ve=Object.prototype.hasOwnProperty,We=Object.prototype.propertyIsEnumerable,Je=(e,t,r)=>t in e?Be(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;const ze={method:"POST",headers:{"Content-Type":"application/json; charset=UTF-8"},mode:"cors",credentials:"same-origin",cache:"default",redirect:"follow",keepalive:!0},Ge=new Map;async function Xe(e){var t;let{id:r,method:n="POST",url:i,headers:l={},data:o,processData:s=!0,timeout:a=-1}=e;if(r&&Ge.has(r))throw new Error("resubmit");n=n.toUpperCase();let{contentType:u="application/json; charset=UTF-8"}=l,h=E(!0,((e,t)=>{for(var r in t||(t={}))Ve.call(t,r)&&Je(e,r,t[r]);if(Ue)for(var r of Ue(t))We.call(t,r)&&Je(e,r,t[r]);return e})({},ze),{method:n,headers:l});if("GET"===n?i=function(e,t,r="text"){if(null==t)return e;let n="";if(0===(r=r.trim().toLowerCase()).indexOf("application/x-www-form-urlencoded")||0===r.indexOf("application/json"))if("object"==typeof t)for(let e in t){let r=t[e];if(Array.isArray(r))for(let t=0;t<r.length;t++){let i=`${encodeURIComponent(e)}=${encodeURIComponent(r[t])}`;n.length>0&&(n+="&"),n+=i}else{let t=`${encodeURIComponent(e)}=${encodeURIComponent(r)}`;n.length>0&&(n+="&"),n+=t}}else n=t;else n=t;return n.length>0&&(e=-1===e.indexOf("?")?`${e}?${n}`:`${e}&${n}`),e}(i,o,u):(s&&(o=function(e,t="text"){let r="";if(0===(t=t.trim().toLowerCase()).indexOf("application/x-www-form-urlencoded"))if("object"==typeof e)for(let t in e){let n=e[t];if(Array.isArray(n))for(let e=0;e<n.length;e++){let i=`${encodeURIComponent(t)}=${encodeURIComponent(n[e])}`;r.length>0&&(r+="&"),r+=i}else{let e=`${encodeURIComponent(t)}=${encodeURIComponent(n)}`;r.length>0&&(r+="&"),r+=e}}else r=e;else r=0===t.indexOf("text")?"object"==typeof e?JSON.stringify(e):e:0===t.indexOf("application/json")&&"object"==typeof e?JSON.stringify(e):e;return r}(o,u)),h.body=o),r||a>0){r||(r=`fetch_${C.get()}`);const e=new AbortController;h.signal=e.signal;let t={timer:null,controller:e};if(a>0){const e=setTimeout((()=>{t.timer&&t.controller.abort()}),a);t.timer=e}Ge.set(r,t)}try{let e,n=await fetch(i,h),l={};n.headers.forEach(((e,t)=>{l[e]=t}));let o=null!=(t=l["content-type"])?t:"";return e=-1!==o.indexOf("application/json")?await n.json():-1!=o.indexOf("text")?await n.text():await n.blob(),{ok:n.ok,status:n.status,statusText:n.statusText,headers:l,data:e,response:n}}catch(e){throw e}finally{if(r){let e=Ge.get(r);e&&(e.timer&&(clearTimeout(e.timer),e.timer=null),Ge.delete(r))}}}function Ye(e){let t=Ge.get(e);return!!t&&(t.timer&&(clearTimeout(t.timer),t.timer=null),t.controller.abort(),Ge.delete(e),!0)}class Qe{constructor(){this.cache=new Map}async get(e,t=-1){if(this.cache.has(e)){return this.cache.get(e)}let r=await Xe({url:e,method:"GET",timeout:t,heaaders:{"content-type":"text/plain"}});if(r.ok)return this.cache.set(e,r.data),r.data;throw Error(r.statusText)}remove(e){this.cache.delete(e)}}var Ze,et,tt,rt,nt,it,lt,ot,st,at,ut,ht;(et=Ze||(Ze={}))[et.Loading=0]="Loading",et[et.Loaded=1]="Loaded",et[et.Defining=2]="Defining",et[et.Defined=3]="Defined";class ct{}class ft{constructor(){this.register=new Map}get(e){return this.register.get(e)}put(e,t){this.register.set(e,t)}remove(e){let t=this.register.get(e);return this.register.delete(e),t}contains(e){return this.register.has(e)}clear(){this.register.clear()}}(ht=ut||(ut={})).Busy="Busy",ht.Free="Free",ht.Reject="Reject",ht.Exception="Exception",ht.Finished="Finished";const pt=Symbol("chainKey"),dt=Symbol("cursorKey"),yt=Symbol("$persistentModeKey"),mt=Symbol("statusKey"),gt=Symbol("argsKey"),vt=Symbol("exArgsKey"),bt=Symbol("successFnsKey"),wt=Symbol("errorFnsKey"),xt=Symbol("sessionKey"),St=Symbol("_go");class Rt{constructor(e,t=!1){this[tt]=[],this[rt]=0,this[nt]=!1,this[it]=ut.Free,this[lt]=[],this[ot]=[],this[st]=[],this[at]=[],this[xt]=e,this[yt]=t}get session(){return this[xt]}[(tt=pt,rt=dt,nt=yt,it=mt,lt=gt,ot=vt,st=bt,at=wt,St)](e,...t){let r=this[mt];if(this[mt]=ut.Busy,this[dt]+=e,this[dt]<0&&(this[dt]=0),this[gt]=t,r===ut.Exception||r===ut.Reject){let e=[{session:this[xt]},...this[vt]];for(;this[wt].length>0;)try{let t=this[wt].shift();"function"==typeof t&&$((()=>{Reflect.apply(t,{},e)}))}catch(e){console.error(e.message,e)}return this[mt]=r,this[pt]=[],this[dt]=0,this}if(r===ut.Finished||this[dt]>=this[pt].length){let e=[{session:this[xt]},...this[gt]];for(;this[bt].length>0;){let t=this[bt].shift();"function"==typeof t&&$((()=>{Reflect.apply(t,{},e)}))}return this[mt]=ut.Free,this}if(this[dt]>=this[pt].length)return this[mt]=ut.Free,this;let n=this[pt][this[dt]];this[yt]||(this[pt].splice(0,this[dt]+1),this[dt]=-1);let i=this[dt]+1;try{let e=!1,t={go:(t,...r)=>{e||(e=!0,Reflect.apply(this[St],this,[t,...r]))},resolve:(...t)=>{e||(e=!0,Reflect.apply(this[St],this,[1,...t]))},reject:(...t)=>{e||(e=!0,Reflect.apply(this.reject,this,[...t]))},insert:t=>{e||(this[pt].splice(i,0,t),i++)},session:this[xt]};$((()=>{Reflect.apply(n,{},[t,...this[gt]])}))}catch(e){this.throw(e)}return this}go(e,...t){return Reflect.apply(this[St],this,[e,...t])}finish(...e){return this[mt]=ut.Finished,this[gt]=e,Reflect.apply(this[St],this,[0])}reject(...e){return this[mt]=ut.Reject,this[vt]=e,Reflect.apply(this[St],this,[0])}throw(...e){return this[mt]=ut.Exception,this[vt]=e,Reflect.apply(this[St],this,[0])}reset(...e){this[mt]=ut.Busy,this[gt]=e,this[pt]=[],this[dt]=0;let t=[{session:this[xt]},...this[gt]];for(;this[bt].length>0;){let e=this[bt].shift();$((()=>{Reflect.apply(e,this,t)}))}return this[mt]=ut.Free,this}post(e){return this[mt]===ut.Reject||this[mt]===ut.Exception?this:(Array.isArray(e)?this[pt]=[...this[pt],...e]:this[pt].push(e),this[mt]===ut.Busy||Reflect.apply(this[St],this,[0,...this[gt]]),this)}wait(e,t){return e&&"function"==typeof e&&this[bt].push(e),t&&"function"==typeof t&&this[wt].push(t),this[mt]===ut.Busy||Reflect.apply(this[St],this,[0,...this[gt]]),this}exception(e){return e&&"function"==typeof e&&this[wt].push(e),this[mt]===ut.Busy?this:Reflect.apply(this[St],this,[0,...this[gt]])}isFinish(){return this[mt]==ut.Reject||this[mt]==ut.Free&&this[dt]>=this[pt].length}}class At{constructor(e={}){this.moduleManager=new ft,this.resource=new Qe,this.head=Ie.head||Ie.getElementsByTagName("head")[0]||Ie.documentElement,this.isOldWebKit=+navigator.userAgent.replace(/.*(?:AppleWebKit|AndroidWebKit)\/(\d+).*/,"$1")<536,this.options=e,this.options.paths||(this.options.paths={}),this.options.alias||(this.options.alias={})}set query(e){this._query=e}get query(){return this._query}ensure(...e){let t=[],r=e.length-1,n={};"object"==typeof e[r]&&(Object.assign(n,e[r]),r--);let i=null;"function"==typeof e[r]&&(i=e[r],r--);for(let n=0;n<=r;n++)if(Array.isArray(e[n])){let r=e[n];for(let e=0;e<r.length;e++)void 0!==r[e]&&t.push(this.resolvePath(r[e]))}else{let r=e[n].split(",");for(let e=0;e<r.length;e++)void 0!==r[e]&&t.push(this.resolvePath(r[e]))}let l=new Et(t.length,((e,t)=>{if(l.isOK())try{"function"==typeof i&&Reflect.apply(i,{},t)}catch(e){console.error(e.message,e)}else try{console.error(e),"function"==typeof i&&Reflect.apply(i,{},[])}catch(e){console.error(e.message,e)}})),o=new Rt;for(let e=0;e<t.length;e++){let r=new Ot(e,t[e],n,l);this.mount(o,r)}return this}remove(...e){let t=[],r=e.length-1,n={};"object"==typeof e[r]&&(Object.assign(n,e[r]),r--);let i=null;"function"==typeof e[r]&&(i=e[r],r--);for(let n=0;n<=r;n++)if(Array.isArray(e[n])){let r=e[n];for(let e=0;e<r.length;e++)void 0!==r[e]&&t.push(this.resolvePath(r[e]))}else{let r=e[n].split(",");for(let e=0;e<r.length;e++)void 0!==r[e]&&t.push(this.resolvePath(r[e]))}return t.forEach((e=>{this.unmount(e,n)})),"function"==typeof i&&Reflect.apply(i,{},[]),this}mount(e,t){if(this.isNaturePath(t.src,"js")){let r=t.params.jsPoint;return r||(r=this.head),void this.mountJS(e,t,r)}if(this.isNaturePath(t.src,"css")){let r=t.params.cssPoint;return r||(r=this.head),void this.mountCSS(e,t,r)}if(this.isNaturePath(t.src,"html")){let r=t.params.htmlPoint;return r||(r=Ie.body),void this.mountHTML(e,t,r)}let r=this.getFileNamePostfix(t.src);if("js"===r||0===r.length){let r=t.params.jsPoint;return r||(r=this.head),void this.mountJS(e,t,r)}if("css"===r){let r=t.params.cssPoint;return r||(r=this.head),void this.mountCSS(e,t,r)}{let r=t.params.htmlPoint;return r||(r=Ie.body),void this.mountHTML(e,t,r)}}mountHTML(e,t,r){e.post((e=>{var n,i;let l=null!=(i=null!=(n=t.params.timeout)?n:this.options.timeout)?i:3e4,o=t.src;this.resource.get(o,l).then((n=>{r.innerHTML=n,t.progress.work(!0,t.index,n),e.resolve()}),(r=>{console.error(r),t.progress.work(!1,t.index,null),e.reject()}))}))}mountCSS(e,t,r){e.post((e=>{let n=t.src,i=Ie.createElement("link"),l="onload"in i;if(this.isOldWebKit||!l){let n={timeout:this.options.time||3e3,time:0,isOldWebKit:this.isOldWebKit,success:()=>{t.progress.work(!0,t.index,t.src),e.resolve()},error:()=>{try{r.removeChild(i)}catch(e){console.error(e.message,e)}t.progress.work(!1,t.index,null),e.resolve()}};setTimeout((()=>{jt(i,n)}),1)}else i.onload=()=>{i.onload=i.onerror=null,t.progress.work(!0,t.index,t.src),e.resolve()},i.onerror=()=>{try{r.removeChild(i)}catch(e){console.error(e.message,e)}i.onload=i.onerror=null,t.progress.work(!1,t.index,null),e.reject()};let o=Ie.getElementById(n);o&&o.parentNode&&o.parentNode.removeChild(o),i.rel="stylesheet",i.type="text/css",i.id=n,i.href=n,r.appendChild(i)}))}mountJS(e,t,r){e.post((e=>{let n=t.src,i=this.moduleManager.get(n);if(i&&(i.status==Ze.Defined||i.status==Ze.Loaded)){if(i.exports)return t.progress.work(!0,t.index,i.exports),void e.resolve();if(document.querySelector(`script[src='${n}`))return t.progress.work(!0,t.index,i.exports),void e.resolve()}i=new ct,i.id=n,i.src=n,i.status=Ze.Loading,this.moduleManager.put(n,i);let l=Ie.createElement("script");if("onload"in l)l.onload=()=>{l.onload=l.onerror=null,i.status==Ze.Loading&&(i.status=Ze.Loaded,t.progress.work(!0,t.index,n)),e.resolve()},l.onerror=()=>{try{r.removeChild(l)}catch(e){console.error(e.message,e)}l.onload=l.onerror=null,t.progress.work(!1,t.index,null),e.reject()};else{let r=l;r.onreadystatechange=()=>{/loaded|complete/.test(r.readyState)&&(r.onreadystatechange=null,i.status==Ze.Loading&&(i.status=Ze.Loaded,t.progress.work(!0,t.index,n)),e.resolve())}}l.defer=!0,l.src=n,Ke.define=this.createDefine(i,t),r.appendChild(l)}))}unmount(e,t={}){let r=this.getFileNamePostfix(e);if("js"===r||0===r.length){let t=Ie.querySelector(`script[src="${e}"]`);return t&&t.parentNode&&t.parentNode.removeChild(t),void this.moduleManager.remove(e)}if("css"!==r){this.resource.remove(e);let r=t.htmlPoint;return r||(r=Ie.body),void(r.innerHTML="")}{let t=Ie.querySelector(`style[href="${e}"]`);t&&t.parentNode&&t.parentNode.removeChild(t)}}trimEmptyElement(e){let t=[];for(let r=0;r<e.length;r++){let n=e[r].trim();0!==n.length&&t.push(n)}return t}createDefine(e,t){let r=this,n=function(...n){let i,l,o;e.status=Ze.Defining;let s=n.length;1===s?(o=n[0],i=void 0):2===s?(o=n[1],Array.isArray(n[0])?(l=r.trimEmptyElement(n[0]),i=void 0):l=void 0):(i=n[0],l=r.trimEmptyElement(n[1]),o=n[2]),i&&(e.id=i,r.options.alias[i]=e.src),l&&l.length>0?r.ensure(l,((...r)=>{e.exports="function"==typeof o?Reflect.apply(o,e,r):o,e.status=Ze.Defined,t.progress.work(!0,t.index,e.exports)})):(e.exports="function"==typeof o?Reflect.apply(o,e,[]):o,e.status=Ze.Defined,t.progress.work(!0,t.index,e.exports))};return n.amd=!0,n}resolvePath(e){try{if(this.isNaturePath(e,"all"))return e;e=this.parserPath(e,!0);let t=this.getFileNamePostfix(e);t=t.toLowerCase();let r=this.createSearch(this.query);return-1==e.indexOf("?")?("js"!==t&&"css"!==t&&"html"!==t&&(e+=".js"),r.length>0&&(e+=`?${r}`)):r.length>0&&(e+=`&${r}`),e}catch(t){throw console.error(`resolve path[${e}] fail`,t),t}}createSearch(e){let t="";if(e){for(let r in e){let n=`${e[r]}`;t+=`${encodeURIComponent(r)}=${encodeURIComponent(n)}&`}t.length>0&&(t=t.substring(0,t.length-1))}return t}getFileNamePostfix(e){let t=e.lastIndexOf("?");-1==t&&(t=e.length);let r=e.lastIndexOf(".",t);return-1==r?"":e.substring(r+1,t)}isNaturePath(e,t){if(null==this.options.nature)return!1;if("all"===t||"js"===t){let t=this.options.nature.js;if(void 0!==t)for(let r=0;r<t.length;r++){let n=t[r];if(0===e.indexOf(n))return!0}}if("all"===t||"css"===t){let t=this.options.nature.css;if(void 0!==t)for(let r=0;r<t.length;r++){let n=t[r];if(0===e.indexOf(n))return!0}}if("all"===t||"html"===t){let t=this.options.nature.html;if(void 0!==t)for(let r=0;r<t.length;r++){let n=t[r];if(0===e.indexOf(n))return!0}}return!1}parserPath(e,t){if(0==e.indexOf("http://"))return e;if(0==e.indexOf("https://"))return e;if(0==e.indexOf("file:///"))return e;if(0==e.indexOf("/")){return He+e.slice(1)}if(0==e.indexOf("./")){return He+e.slice(2)}if(t){let t=this.options.alias[e];if(!t){let r=e.indexOf("/");if(-1==r)t=e;else{let n=e.slice(0,r),i=this.options.paths[n];t=i?i+e.slice(r):e}}return this.parserPath(t,!1)}return He+e}}function jt(e,t){let r=e.sheet,n=!1;if(t.isOldWebKit)r&&(n=!0);else if(r)try{r.cssRules&&(n=!0)}catch(e){"NS_ERROR_DOM_SECURITY_ERR"===e.name&&(n=!0)}setTimeout((()=>{t.time+=20,n?t.success():t.time>t.timeout?t.error():jt(e,t)}),20)}class Et{constructor(e,t){this.size=e,this.callback=t,this.status=!0,this.values=[],this.lastIndex=-1}work(e,t,r){if(this.status=e,!0===this.status&&(this.lastIndex!==t&&this.size--,this.lastIndex=t,this.values.push(r)),0===this.size||!1===this.status)try{Reflect.apply(this.callback,this,[this.status,this.values])}catch(e){console.error(e.message,e)}}isOK(){return this.status}}class Ot{constructor(e,t,r,n){this.index=e,this.src=t,this.params=r,this.progress=n}}const Pt=Symbol("_notifyChange"),Ct=Symbol("_generateLocation"),Tt=Symbol("_setHashRecorder");class $t{constructor(e,t){this.currentRoute=e,this.routes=t}}class qt{constructor(e="",t=!0,r=!1,n="/"){this.traceless=!1,this.query=e,this.hashMonitor=t,this.traceless=r,this.defaultPath=n}init(){if(!this.hashMonitor)return;if(this.historyChange)return;this.historyChange=()=>{if(!this.hashMonitor)return;let e=Ke.history.state;this[Pt](e)},De(Ke,"popstate",this.historyChange);let e=this.getHash()||this.defaultPath,t=Ke.sessionStorage.getItem(e);if(t){let e=JSON.parse(t);this[Pt](e)}else{let t,r=e.indexOf("!");t=-1!=r?e.substring(r+1):e;let n=new me;n.path=t,n.query=this.getSearch(),this[Pt]([n])}}destroy(){this.historyChange&&Le(Ke,"popstate",this.historyChange)}[Tt](e,t){if(this.hashMonitor)try{this.lastHash&&Ke.sessionStorage.removeItem(this.lastHash);let r=JSON.stringify(t);Ke.sessionStorage.setItem(e,r),this.lastHash=e}catch(e){console.error(e.message)}}listen(e){this.changeHandle=e}[Pt](e){"function"==typeof this.changeHandle&&this.changeHandle(e)}go(e){Ke.history.go(e)}push(e){let t=this[Ct](e.currentRoute);this.traceless||Ke.history.pushState(e.routes,"",t),this[Tt](e.currentRoute.fullPath,e.routes)}replace(e){let t=this[Ct](e.currentRoute);this.traceless||Ke.history.replaceState(e.routes,"",t),this[Tt](e.currentRoute.fullPath,e.routes)}[Ct](e){let t;if(e.query){let r="";if("object"==typeof e.query)for(let t in e.query){let n=encodeURIComponent(e.query[t]),i=`${encodeURIComponent(t)}=${n}`;r.length>0&&(r+="&"),r+=i}else r=e.query;this.query?(t=`${this.query}&${r}`,"?"!==t.charAt(0)&&(t=`?${t}`)):t=`?${r}`}const r=Ke.location;let n;return n=t?`${r.origin}${r.pathname}${t}#${e.fullPath}`:`${r.origin}${r.pathname}#${e.fullPath}`,n}getHash(){let e=Ke.location.hash,t=e.indexOf("#");if(-1!=t){return e.substring(t+1)}return null}getSearch(){return Ke.location.search}}var Ft,kt,_t,Mt,Nt,Kt,It,Dt,Lt,Ht,Bt,Ut,Vt,Wt,Jt,zt=Object.defineProperty,Gt=Object.defineProperties,Xt=Object.getOwnPropertyDescriptors,Yt=Object.getOwnPropertySymbols,Qt=Object.prototype.hasOwnProperty,Zt=Object.prototype.propertyIsEnumerable,er=(e,t,r)=>t in e?zt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,tr=(e,t)=>{for(var r in t||(t={}))Qt.call(t,r)&&er(e,r,t[r]);if(Yt)for(var r of Yt(t))Zt.call(t,r)&&er(e,r,t[r]);return e};const rr=Symbol("_constructRouteModel"),nr=Symbol("_findRouteModel"),ir=Symbol("_findRootView"),lr=Symbol("_getFirstView"),or=Symbol("_removeView"),sr=Symbol("_buildPage"),ar=Symbol("_resolveComponent"),ur=Symbol("_update"),hr=Symbol("_merge"),cr=Symbol("ignoreHistoryChangeOnceKey"),fr=Symbol("_handleHistoryChange"),pr=Symbol("_handleRouteUpdated"),dr=Symbol("routeUpdatedCallback"),yr=Symbol("currentRoutes"),mr=Symbol("current"),gr=Symbol("_addRouteRecorder"),vr=Symbol("_removeRouteRecorder"),br=Symbol("_cloneRouteRecorder"),wr=Symbol("_hanldeError"),xr=Symbol("errorCallback"),Sr=Symbol("registerKey"),Rr=Symbol("notFoundKey"),Ar=Symbol("forestKey"),jr=Symbol("historyKey"),Er=Symbol("beforeFiltersKey"),Or=Symbol("afterFiltersKey"),Pr=Symbol("destroyFiltersKey"),Cr=Symbol("mainDispatcherKey"),Tr=Symbol("initKey"),$r=Symbol("requireKey"),qr=Symbol("_createNextFn"),Fr=Symbol("_start"),kr=Symbol("_before"),_r=Symbol("_after"),Mr=Symbol("_destroy"),Nr=Symbol("_load"),Kr=Symbol("_unload"),Ir=Symbol("_loadDependency"),Dr=Symbol("resolvedModulesKey"),Lr=Symbol("resolveDependencyKey"),Hr=Symbol("routerGuardKey");class Br{constructor(t){var r;this[Ft]=new Array,this[kt]=new ke,this[_t]=new Array,this[Mt]=null,this[Nt]=null,this[Kt]=new Array,this[It]=new Array,this[Dt]=new Array,this[Lt]=new Rt,this[Ht]=new Map,this[Bt]=new Me,this[Ut]=!1,this[Vt]=e(null),this[Wt]=new At,this[Jt]=!1,this.options=null!=t?t:{};let n=this.options.routes||[];this.addRoutes(n),this.options.notFound&&this.setNotFoundRoute(this.options.notFound),this[jr]=new qt(this.options.query,this.options.hashMonitor,this.options.traceless,this.options.defaultPath),null==(r=this[jr])||r.listen((e=>{if("string"==typeof e){let t=this[fe](e);t&&this[fr]([t])}else this[fr](e)}))}get require(){return this[$r]}get current(){return this[mr].value}[(Ft=Sr,kt=Ar,_t=yr,Mt=xr,Nt=dr,Kt=Er,It=Or,Dt=Pr,Lt=Cr,Ht=Dr,Bt=Hr,Ut=Tr,Vt=mr,Wt=$r,wr)](e="error",t){if(t&&"function"==typeof t.error)try{t.error(e)}catch(e){}if("function"==typeof this[xr])try{this[xr](e,t)}catch(e){}console.error(e)}init(){var e;!0!==this[Tr]&&(null==(e=this[jr])||e.init(),this[Tr]=!0)}[(Jt=cr,fr)](e){if(this[cr])this[cr]=!1;else try{if(!e){let e=[...this[yr]].reverse();return this[Kr](e),void Ke.location.reload()}let t=null,r=[],n=[],i=0;for(;i<e.length&&i<this[yr].length&&me.isSame(e[i],this[yr][i]);i++)e[i].opsType===we.Open&&!0===e[i].active&&e[i].active!==this[yr][i].active&&(t=e[i]);if(i<e.length&&(r=e.slice(i)),i<this[yr].length&&(n=this[yr].slice(i).reverse()),0==n.length&&0==r.length)return void(null!==t&&this.restore([t]));if(n.length>0){if(this[Kr](n)){if(r.length>0)return void this.restore(r);null!==t&&this.restore([t])}}else this.restore(r)}catch(e){this[wr](e)}}[pr](e){if(e)this[mr].value=e;else{let e=this[yr].length;this[mr].value=e>0?this[yr][e-1]:null}if("function"==typeof this[dr])try{this[dr](this[mr].value)}catch(e){}}[gr](e,t=-1){t<0||t>=this[yr].length?this[yr].push(e):this[yr].splice(t,0,e)}[br](){let e=[];for(let t of this[yr]){let r=me.clone(t,!0);e.push(r)}return e}[vr](e){if(null==this[yr])return;let t=-1;for(let r=0;r<this[yr].length;r++)if(me.isSame(this[yr][r],e)){t=r;break}if(-1!=t){let e=this[yr][t];this[yr].splice(t,1),this[Mr](e,e.session)}}set hashMonitor(e){this[jr]&&(this[jr].hashMonitor=e)}get hashMonitor(){return!!this[jr]&&this[jr].hashMonitor}set traceless(e){this[jr]&&(this[jr].traceless=e)}get traceless(){return!!this[jr]&&this[jr].traceless}onRouteUpdated(e){this[dr]=e}onError(e){this[xr]=e}beforeEach(e){this[Er].push(e)}removeBeforeEach(e){let t=this[Er].indexOf(e);return-1!==t&&(this[Er].splice(t,1),!0)}afterEach(e){this[Or].push(e)}removeAfterEach(e){let t=this[Or].indexOf(e);return-1!==t&&(this[Or].splice(t,1),!0)}destroyEach(e){this[Pr].push(e)}removeDestroyEach(e){let t=this[Pr].indexOf(e);return-1!==t&&(this[Pr].splice(t,1),!0)}setResolveDependency(e){this[Lr]=e}addRoutes(e){for(let t of e)this.addRoute(t)}addRoute(e,t=-1){let r=this[rr](e);if(-1==t)this[Sr]=[...this[Sr],...r];else for(let e=r.length-1;e>=0;e--)this[Sr].splice(t,0,r[e])}removeRoute(e){let t=this[fe](e);if(null===t)return console.warn("route格式错误",e),!1;for(let e=0;e<this[Sr].length;e++){let r=this[Sr][e];if((null==t?void 0:t.path)&&r.path===t.path)return this[Sr].splice(e,1),!0;if((null==t?void 0:t.name)&&r.name===t.name)return this[Sr].splice(e,1),!0}return!1}hasRoute(e){let t=this[fe](e);return null===t?(console.warn("route格式错误",e),!1):-1!==this[Sr].findIndex((e=>!(!(null==t?void 0:t.path)||e.path!==t.path)||(!(!(null==t?void 0:t.name)||e.name!==t.name)||void 0)))}setNotFoundRoute(e){let t=this[rr](e);this[Rr]=t[0]}getRoutes(){return[...this[Sr]]}[rr](e){var t,r;let n=null!=(t=e.path)?t:"";n.length>0&&"/"!==n.charAt(0)&&(n=`/${n}`);let i=null!=(r=e.components)?r:e.component&&{"":e.component};if(null==i){let t=new be;return t.path=n,t.redirect=e.redirect,[t]}let l=[];for(let t in i){let r=i[t];0===t.length&&(t="default");let n=new ge(t,r,e.props,e.meta);l.push(n)}let o=!1,s=[];if(e.children)for(let t of e.children){let e=this[rr](t);for(let t of e){let e=new be;e.name=t.name,t.path&&t.path.length>0?e.path="/"!==n?`${n}${t.path}`:t.path:(o=!0,e.path=n);let r=new ve;r.models=[...l],e.layers=[r,...t.layers],s.push(e)}}if(!o){let t=new ve;t.models=l;let r=new be;r.name=e.name,r.path=n,r.layers=[t],s.splice(0,0,r)}return s}[nr](e){var t,r;let n=e.route;try{for(let i of this[Sr]){if(n.path&&i.path){let r=i.match;r||(r=i.match=oe(i.path));let l=r(n.path);if(!l)continue;if(i.redirect){let t=new me;E(!0,t,n),t.path=i.redirect;let r={route:t,find:void 0};return!!this[nr](r)&&(e.route=r.route,e.find=r.find,!0)}if(n.params=null!=(t=n.params)?t:{},E(!0,n.params,l.params),n.query){let e=n.query;if("string"==typeof e){let t={},r=e.split("&");for(let e of r){let r=e.split("=");if(2!==r.length)continue;let n=decodeURIComponent(r[0].trim()),i=decodeURIComponent(r[1].trim());t[n]=i}E(!0,n.params,t)}else"object"==typeof e&&E(!0,n.params,e)}return e.find=i,!0}if(n.name===i.name){n.params=null!=(r=n.params)?r:{};let t=le(i.path);return n.path=t(n.params),e.find=i,!0}}}catch(e){console.error(e.message,e),"function"==typeof n.error&&n.error(e.message)}return!1}[fe](e){var t,r,n;let i=null;if(Array.isArray(e))if(i=new me,"object"==typeof e[0])i=me.from(e[0]);else for(let t=0;t<e.length;t++)0===t?"/"===e[t].charAt(0)?i.path=e[t]:i.name=e[t]:1===t?i.params=e[t]:2===t?i.root=e[t]:3===t&&E(!1,i,e[t]);else"object"==typeof e?i=me.from(e):"string"==typeof e&&(i=new me,"/"==e.charAt(0)?i.path=e:i.name=e);if(i){if(i.path){let e=i.path.indexOf("?");-1!==e&&e<i.path.length-1&&(i.query=i.path.substring(e+1),i.path=i.path.substring(0,e))}i.root=null!=(t=i.root)?t:"default",i.opsType=null!=(n=null!=(r=i.opsType)?r:this.options.defaultOperationType)?n:we.Push}return i}push(...e){let t=this[fe](e);return t?(t.opsType=t.opsType||we.Push,this.to(t)):(this[wr]("resolve route fail",t),this)}put(...e){let t=this[fe](e);return t?(t.opsType=we.Put,this.to(t)):(this[wr]("resolve route fail",t),this)}replace(...e){let t=this[fe](e);return t?(t.opsType=we.Replace,this.to(t)):(this[wr]("resolve route fail",t),this)}append(...e){let t=this[fe](e);return t?(t.opsType=we.Append,this.to(t)):(this[wr]("resolve route fail",t),this)}remove(e){return new Promise((t=>{this[Cr].post((r=>{var n;try{if(0===this[yr].length)return r.resolve(),void t(!1);let i,l=-1,o=[];if(e){if(e.root)i=e.root;else{i=null!=(n=this[yr][0].root)?n:"default"}if(e.all)for(let e=this[yr].length-1;e>0;e--){let t=this[yr][e];t.opsType===we.Append&&t.root===i&&(o.splice(0,0,t),l=e-1)}else if(e.until)for(let t=this[yr].length-1;t>0;t--){let r=this[yr][t];if(r.opsType===we.Append&&r.root===i){if("/"===e.until.charAt(0)&&e.until===r.path){l=t;break}if(e.until===r.name){l=t;break}o.splice(0,0,r)}}}else{i="default";let e=this[lr](this[Ar]);e&&(i=e.name);for(let e=this[yr].length-1;e>0;e--){let t=this[yr][e];if(t.opsType===we.Append&&t.root===i){o.push(t),l=e-1;break}}}if(0===o.length){let e="can not find route";return console.warn(e),r.resolve(e),void t(!1)}let s=0;if(this[yr].forEach((e=>{e.opsType!==we.Put&&s++})),this[Kr](o)){let e=0;this[yr].forEach((t=>{t.opsType!==we.Put&&e++}));let n=s-e;this[cr]=!0,this.back(n),r.resolve(),t(!0)}}catch(e){this[wr](e),r.resolve(),t(!1)}}))}))}open(...e){let t=this[fe](e);return t?(t.opsType=we.Open,this.to(t)):(this[wr]("resolve route fail",t),this)}close(e){return this[Cr].post((t=>{var r;try{let n=this[fe](e);if(!n)return void t.reject("resolve route fail");let i=[];for(let e=0;e<this[yr].length;e++){let t=this[yr][e];if(t.root===n.root){if(n.path&&n.path===t.path){i.push(t);break}if(n.name&&n.name===t.name){i.push(t);break}}}if(0===i.length)return void t.resolve();if(this[Kr](i)){let e=me.clone(n,!0);const t=new $t(e,this[br]());null==(r=this[jr])||r.replace(t),this[pr]()}t.resolve()}catch(e){this[wr](e),t.resolve()}})),this}to(...e){let t=this[fe](e);if(!t)return this[wr]("resolve route fail",t),this;let r=this[Hr].acquire(t);return null==r?(this[wr]("route forbid",t),this):(this[Cr].post((e=>{var n;try{let i=this[Fr](t);this[kr](i),!(null==(n=i.session)?void 0:n.routeModel)&&this[Lr]&&this[Ir](i),this[Nr](i),this[_r](i),i.wait(((n,i)=>{var l,o;let s=n.session.to;try{let e=me.clone(s,!0);const t=new $t(e,this[br]());s.opsType===we.Replace?null==(l=this[jr])||l.replace(t):null==(o=this[jr])||o.push(t)}catch(e){console.error(e.message,e)}if(this[Hr].release(r),this[pr](s),"function"==typeof t.success)try{Reflect.apply(t.success,{},[])}catch(e){console.error(e.message,e)}e.resolve()}),((n,i)=>{this[Hr].release(r),this[wr](i,t),e.resolve()}))}catch(n){this[Hr].release(r),this[wr](n,t),e.resolve()}})),this)}back(e=1){var t;null==(t=this[jr])||t.go(-e)}[qr](e){return(t,r)=>{if("boolean"==typeof t)t?e.resolve():e.reject(r);else if(t){let r=this[fe](t);if(r){let t=e.session.to;r.success=t.success,r.error=t.error,e.session.to=r,e.session.routeModel=null,e.resolve()}else e.reject("route resolve fail")}else e.resolve()}}[Fr](e){let t=this[yr].length>0?this[yr][0]:void 0,r=new ye(e,t),n={route:e,find:null};return this[nr](n),n.find&&(r.routeModel=n.find,e.matched=function(e){let t=[];return e.layers.forEach((e=>{null!=e.models&&null!=e.models&&e.models.forEach((e=>{if(null!=e&&null!=e)if("object"==typeof e.meta){let r=E(!0,{},e.meta);t.push(r)}else e.meta&&t.push(e.meta)}))})),t}(n.find),Array.isArray(e.matched)&&e.matched.length>0&&(e.meta=n.find.layers[0].models[0].meta)),new Rt(r)}[kr](e){for(let t of this[Er])e.post((e=>{let r=this[qr](e);Reflect.apply(t,{},[e.session.to,e.session.from,r,e.session])}))}[_r](e){e.post((e=>{for(let t of this[Or])try{Reflect.apply(t,{},[e.session.to,e.session.from,e.session])}catch(e){console.error(e.message,e)}e.resolve()}))}[Mr](e,t){for(let r of this[Pr])try{Reflect.apply(r,{},[e,t])}catch(e){console.error(e.message,e)}"function"==typeof e.destroy&&Reflect.apply(e.destroy,e,[])}[Ir](e){let t=e.session,r=Reflect.apply(this[Lr],this,[null==t?void 0:t.to]);if(null==r)return;Array.isArray(r)||(r=[r]);let n=[];for(let e of r)this[Dr].has(e)||n.push(e);0!==n.length&&e.post((e=>{this[$r].ensure(n,((...t)=>{if(t){for(let e of t){if(!e)continue;let t;t=A(e)?e.default:e,Array.isArray(t)&&this.addRoutes(t)}for(let e of n)this[Dr].set(e,!0);e.resolve()}else e.reject()}))}))}[Nr](e){e.post((e=>{var t;let r=e.session.to,n=e.session.routeModel;if(null==n){let i={route:r,find:null};if(this[nr](i))n=i.find,e.session.routeModel=n;else{if(!this[Rr])return void e.reject(`not find route model, path:${null!=(t=r.path)?t:r.name}`);n=this[Rr]}}let i=ye.from(e.session);this[sr](r,n,i).then((t=>{this[Ar],e.resolve()}),(t=>{e.reject(t)}))}))}[Kr](e){var t;if(0==e.length)return!0;let r=this[Ar],n=[];for(let t of e){let e=this[ir](r,t);null!=e&&n.push((i=tr({},e),Gt(i,Xt({route:t}))))}var i;if(0==n.length){let e="can not find view index";return this[wr](e),!1}for(let e of n.reverse())this[or](r,{x:e.x,y:e.y},[null!=(t=e.route.index)?t:0],!0);return!0}[ir](e,t){var r;let n,i=null!=(r=t.root)?r:"default";for(let t=0;t<e.layers.length;t++){let r=e.layers[t];for(let e=r.views.length-1;e>=0;e--){let l=r.views[e];if(l[Ee]&&l[Ce]===i)return n={x:e,y:t},n}}return null}[lr](e){if(e.layers.length>0&&e.layers[0].views.length>0){return e.layers[0].views[0]}return null}[or](e,t,r=null,n=!0){if(t.y>=e.layers.length)return;if(t.x>=e.layers[t.y].views.length)return;let i=e.layers[t.y].views[t.x],l=!1,o=[],s=!1,a=i.slots.value;for(let e=a.length-1;e>=0;e--){let n=a[e];null!=r&&-1==r.indexOf(n.index)||(n.route&&i[Ee]&&(this[vr](n.route),!0===n.active&&n.route.opsType==we.Append&&(s=!0)),o.push(new qe(i,n.index,t.y)),a.splice(e,1))}if(0==a.length)n?i.slots.value=[...a]:e.layers[t.y].views.splice(t.x,1);else{if(s){let e=a[a.length-1];e.active=!0,e.route&&(e.route.active=e.active)}i.slots.value=[...a]}0==e.layers[t.y].views.length&&(l=!0);let u=t.y+1;for(;u<e.layers.length;u++){let t=e.layers[u].views,r=[];for(let n=t.length-1;(l||o.length>0)&&n>=0;n--){let i=t[n];if(i[Pe]&&(l||qe.include(o,i[Pe]))){let t=i.slots.value;for(let e=t.length-1;e>=0;e--){let n=t[e];n.route&&i[Ee]&&this[vr](n.route),r.push(new qe(i,n.index,u)),t.splice(e,1)}e.layers[u].views.splice(n,1)}}o=r,0==e.layers[u].views.length&&(l=!0)}}restore(e){if(e&&0!=this[Sr].length){return new Promise(((t,r)=>{for(let t=0;t<e.length;t++){let r=e[t];this[Cr].post((e=>{var t;let n=this[Fr](r);this[kr](n),!(null==(t=n.session)?void 0:t.routeModel)&&this[Lr]&&this[Ir](n),this[Nr](n),this[_r](n),n.wait(((t,r)=>{e.resolve()}),((t,r)=>{this[wr](r),e.resolve()}))}))}this[Cr].post((e=>{e.resolve(),t()}))}))}{let e=this[Ar];if(e.layers.length>0){let t=e.layers[0].views;t.length>0&&(t[0].slots.value=[])}return this[yr]=[],this[pr](),Promise.resolve()}}[sr](e,t,r){var n;let i=null!=(n=e.updateType)?n:Se.Part;return this[ar](t).then((()=>{this[ur](t,e,r,i)}))}[ar](e){let t=[];for(let r=0;r<e.layers.length;r++){let n=e.layers[r];for(let e=0;e<n.models.length;e++){let r=n.models[e];r.isResolved||t.push(r.resolve())}}return t.length>0?Promise.all(t):Promise.resolve()}[ur](e,t,r,n){var i,l,o,s;if(1!==e.layers[0].models.length)return Promise.reject("illegal route structure(multil root node)");const a=e.layers[0].models[0];let u,h,c=this[Ar],f=function(e){return 0==e.layers.length||0==e.layers[0].views.length}(c),p=null!=(i=t.root)?i:"default";f||n!=Se.Part||(u=this[ir](c,t));let d=0;if(null==u||null==u)if(f||n===Se.All){if(0==c.layers[0].views.length){let e=null!=(l=t.root)?l:"default";h=new $e(e,!0,null),c.layers[0].views=[h]}else h=c.layers[0].views[0];u={x:0,y:0}}else{let e=t.slot;if(!e)return Promise.reject("can not rebuild view(because not route slot)");let r,n=e.level;if(n>c.layers.length)return Promise.reject("can not insert view(override level)");if(e.rootName){let t=c.layers[n-1];for(let i of t.views){if(i[Ee]&&i.name===e.rootName){r=new qe(i,null!=(o=e.rootIndex)?o:0,n-1);break}if(i[Oe]&&i[Oe].view.name===e.rootName&&i[Oe].index===e.rootIndex){r=i[Oe];break}}}if(!r)return Promise.reject("can not insert view(not find root node ref)");h=new $e(p,!0,r),c.layers[n].views.push(h),u={x:c.layers[n].views.length-1,y:n}}else h=c.layers[u.y].views[u.x];if(d=u.y,h[Ee]=!0,t.opsType===we.Append){t.index=C.get();let r=h.slots.value;if(r.length>0){let e=r[r.length-1];e.active=!1,e.route&&(e.route.active=e.active)}let n=new Te(t,a,t.index,!0);h.slots.value=[...r,n];let i=d+1,l=1,o=new qe(h,t.index,d);this[hr](c,i,e,l,o)}else if(t.opsType===we.Open){let r=h.slots.value,n=!1;for(let e of r){if(null!==e.route&&me.isSameForRouteModel(e.route,t)){if(1==e.active)return t.index=e.index,t.active=e.active,e.route=t,Promise.resolve();e.active=!0,n=!0,t.index=e.index,t.active=e.active,e.route=t,this[vr](e.route)}else e.active=!1;e.route&&(e.route.active=e.active)}if(!n){t.index=C.get(),t.active=!0;let n=new Te(t,a,t.index,!0);r.push(n);let i=d+1,l=1,o=new qe(h,t.index,d);this[hr](c,i,e,l,o)}h.slots.value=[...r]}else{let r=h.slots.value;if(0==r.length){t.index=C.get(),h.slots.value=[new Te(t,a,t.index)];let r=d+1,n=1,i=new qe(h,t.index,d);this[hr](c,r,e,n,i)}else{let n=r[0];if(n.model!==a){this[or](c,u,null,!0),t.index=C.get(),h.slots.value=[new Te(t,a,t.index)];let r=d+1,n=1,i=new qe(h,t.index,d);this[hr](c,r,e,n,i)}else{null!==n.route&&this[vr](n.route);let i=[];for(let e=1;e<r.length;e++)i.push(r[e].index);i.length>0&&this[or](c,u,i,!0),t.index=n.index,n.route=t;let l=[new qe(h,t.index,d)],o=d+1,s=1,a=new qe(h,t.index,d);for(;l.length>0&&o<c.layers.length&&s<e.layers.length;o++,s++){let t=[];for(let e=0;e<c.layers[o].views.length;e++){let r=c.layers[o].views[e];r[Pe]&&qe.include(l,r[Pe])&&t.unshift(e)}let r=[];for(let n of t){let t,i=c.layers[o].views[n],l=e.layers[s].models;for(let e=0;e<l.length;e++)if(i.name===l[e].name){t=l[e];break}if(t){let l=i.slots.value;if(0==l.length){let r=0;i.slots.value=[new Te(null,t,r)];let n=o+1,l=s+1;this[hr](c,n,e,l,a)}else{let u=l[0];if(u.model!==t){this[or](c,{x:n,y:o},null,!0),i.slots.value=[new Te(null,t,0)];let r=o+1,l=s+1;this[hr](c,r,e,l,a)}else{i[Ee]&&null!==u.route&&this[vr](u.route);let e=[];for(let t=1;t<l.length;t++)e.push(l[t].index);e.length>0&&this[or](c,{x:n,y:o},e,!0),r.push(new qe(i,u.index,o))}}i[Ee]=!1}else this[or](c,{x:n,y:o},null,!1)}l=r}this[hr](c,o,e,s,a)}}}if(h&&h[Oe]){let e=h[Oe];e&&(t.slot=new de(p,d,null==e?void 0:e.view.name,null!=(s=null==e?void 0:e.index)?s:0))}r.to=void 0,r.routeModel=void 0,t.session=r,this[gr](t)}[hr](e,t,r,n,i){let l=n,o=t;for(;o<e.layers.length&&l<r.layers.length;o++,l++){let t=e.layers[o].views;for(let e of r.layers[l].models){let r=new $e(e.name,!1,i),n=new Te(null,e);r.slots.value=[n],t.push(r)}}for(;l<r.layers.length;l++){let t=new Fe;t.views=[];for(let e of r.layers[l].models){let r=new $e(e.name,!1,i),n=new Te(null,e);r.slots.value=[n],t.views.push(r)}e.layers.push(t)}}[ce](e,t,r,n,i,l){var o,s;if(t<0||t>this[Ar].layers.length)return null;if(t<this[Ar].layers.length){let a=this[Ar].layers[t],u=null;for(let h of a.views){let a=!1;if(null!==r?(a=h.name===e&&(null==(o=h[Oe])?void 0:o.view)===r,a&&-1!==n&&(a=(null==(s=h[Oe])?void 0:s.index)===n)):a=h.name===e,a){null!==i&&(h[Pe]={view:i,index:l,level:t-1}),u=h;break}}if(null!==u)return u}let a=null,u=null;null!==i&&(a=i[Ee]?{view:i,index:l,level:t-1}:i[Oe],u={view:i,index:l,level:t-1});let h=new $e(e,!0,a);if(h[Pe]=u,t==this[Ar].layers.length){let e=new Fe;e.views=[h],this[Ar].layers.push(e)}else this[Ar].layers[t].views.push(h);return h}}var Ur,Vr,Wr;(Wr=Vr||(Vr={}))[Wr.limitless=0]="limitless",Wr[Wr.once=1]="once";const Jr=Symbol("registerKey");class zr{constructor(e,t){this.callback=e,this.policy=t}}class Gr{constructor(){this[Ur]=new Map}on(e,t,r=!1){let n=this[Jr].get(e);n||(n=new Array,this[Jr].set(e,n));let i=new zr(t,!0===r?1:0);return n.push(i),this}off(e,t){if(!t)return this[Jr].delete(e),this;let r=this[Jr].get(e);if(r)for(let e=0;e<r.length;e++){if(r[e].callback===t){r.splice(e,1);break}}return this}bind(e,t,r=!1){return this.on(e,t,r)}unbind(e,t){return this.off(e,t)}once(e,t){return this.on(e,t,!0)}all(...e){let t=e.length;if(t<1)return this;let r=e[t-1];if("function"!=typeof r)return console.error("callback can not benn empty"),this;let n=t-1,i=new Array(n),l=[].splice.call(e,0,n);for(let e=0;e<l.length;e++)this.once(l[e],(t=>{i[e]=t,n-=1,0==n&&Reflect.apply(r,{},i)}));return this}emit(e,...t){let r=this[Jr].get(e);if(!r)return this;for(let e=0;e<r.length;){let n=r[e];if(1==n.policy?r.splice(e,1):e++,"function"==typeof n.callback)try{$((()=>{Reflect.apply(n.callback,{},t)}))}catch(e){console.error(e.message,e)}}return this}trigger(e,...t){return Reflect.apply(this.emit,this,[e,...t])}}var Xr;Ur=Jr;const Yr=Symbol("registerKey");class Qr{constructor(){this[Xr]=new Map}set(e,t){this[Yr].set(e,t)}get(e){return this[Yr].get(e)}has(e){return this[Yr].has(e)}delete(e){return this[Yr].delete(e)}}Xr=Yr;const Zr=Symbol("lc");function en(e,t=!1){let r=e,n=r[Zr];if(!n){if(!t)return null;n=new Qr,r[Zr]=n}return n}function tn(e,t){let r=e;for(;null!==r;){let e=r[Zr];if(e&&e.has(t))return e.get(t);r=r.$parent}return null}function rn(e){if(Array.isArray(e.children)&&e.children.length>0){let t=e.children[0];if(null!=t&&null!=t.component&&null!=t.component.proxy)return en(t.component.proxy,!1)}return null}const nn=Symbol("hooksKey");function ln(e,t){let r=e.get(nn);if(null!=r)for(let e=r.length-1;e>=0;e--){let n=r[e];if(n.type===t)try{Reflect.apply(n.hook,n.target,[])}catch(e){console.error(e.message,e)}}}var on,sn;(sn=on||(on={})).DEACTIVATED="da",sn.ACTIVATED="a";class an{constructor(e,t,r){this.target=r,this.hook=t,this.type=e}}function un(e){return(t,r)=>{let n;if(r)n=r;else{let e=i();if(null==e||null==e.proxy)return void console.error("can not get currrent instance or proxy");n=e.proxy}let o=tn(n,nn);null!=o?(l((()=>{!function(e,t,r,n){let i=-1;for(let l=0;l<e.length;l++){let o=e[l];if(o.type===t&&o.hook===r&&o.target===n){i=l;break}}-1!=i&&e.splice(i,1)}(o,e,t,n)})),function(e,t,r,n){let i=new an(t,r,n);e.push(i)}(o,e,t,n)):console.warn("can not get hooks context")}}let hn=un(on.ACTIVATED),cn=un(on.DEACTIVATED);const fn=Symbol("routeKey");function pn(e,t){let r=e.get(fn);if(r){let e={path:"",name:"",params:{},index:-1,session:{}};Object.assign(e,t),Object.assign(r,e)}else r=function(){let e=new me;return e.path="",e.name="",e.params={},e.index=-1,o(e)}(),Object.assign(r,t),e.set(fn,r)}function dn(e){let t=tn(e,fn);return null!=t?t:null}const yn=Symbol("rk"),mn=Symbol("vd"),gn=Symbol("rv"),vn=Symbol("rvi"),bn=Symbol("pv"),wn=Symbol("pvi");function xn(e,t=!1){var r;let n=null;return n=t&&null!=(r=e.showFromClass)?r:e.enterFromClass,n||(n=e.transitionName,n?t?`${n}-show-from`:`${n}-enter-from`:null)}function Sn(e,t=!1){var r;let n=null;return n=t&&null!=(r=e.showActiveClass)?r:e.enterActiveClass,n||(n=e.transitionName,n?t?`${n}-show-active`:`${n}-enter-active`:null)}function Rn(e){var t,r,n,i;let l,o=e.duration;return"object"==typeof o?l={enter:null!=(t=o.enter)?t:-1,leave:null!=(r=o.leave)?r:-1,show:null!=(n=o.show)?n:-1,hide:null!=(i=o.hide)?i:-1}:("string"==typeof o&&(o=0==o.length?-1:Number(o)),l={enter:o,leave:o,show:o,hide:o}),l}function An(e,t){e.classList.contains(t)||e.classList.add(t)}function jn(e,t){e.classList.remove(t)}const En=Ne&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout;function On(e){En(e)}function Pn(e,t,...r){y(t)&&(null==e&&(e={}),Reflect.apply(t,e,r))}function Cn(e,t,r,n=-1,i,l,o,s){if(y(l)){if(void 0!==i&&i>=0)return void setTimeout((()=>{Reflect.apply(l,e,[t,r,n]),y(s)&&Reflect.apply(s,e,[])}),i);let o=["animationend","transitionend"],a=i=>{o.forEach((e=>{Le(t,e,a)})),Reflect.apply(l,e,[t,r,n]),s&&Reflect.apply(s,e,[])};o.forEach((e=>{De(t,e,a)}))}if(y(o)){let i="animationcancel",l=s=>{Reflect.apply(o,e,[t,r,n]),Le(t,i,l)};De(t,i,l)}}function Tn(e){return null!==e&&(e.opsType===we.Append||e.opsType===we.Open)}function $n(e,t,r,n,i={},l,o=-1){if(t&&(r||Tn(l))){let e=xn(i,r);e&&An(n,e);let t=Sn(i,r);t&&An(n,t)}else{Pn(e,function(e,t=!1){var r;let n=null;return n=t&&null!=(r=e.onBeforeShow)?r:e.onBeforeEnter,n}(i,r),[n,l,o])}}function qn(e,t,r,n,i={},l,o,s,a){if(Tn(o)||r)if(t){let t=xn(i,r),u=Sn(i,r),h=function(e,t=!1){var r;let n=null;return n=t&&null!=(r=e.showToClass)?r:e.enterToClass,n||(n=e.transitionName,n?t?`${n}-show-to`:`${n}-enter-to`:null)}(i,r);On(h?()=>{Cn(e,n,o,s,l,(()=>{u&&jn(n,u),h&&jn(n,h),y(a)&&a(e,a,[n])})),t&&jn(n,t),h&&An(n,h)}:()=>{t&&jn(n,t),u&&jn(n,u),y(a)&&a(e,a,[n])})}else{let t=function(e,t=!1){var r;let n=null;return n=t&&null!=(r=e.onShow)?r:e.onEnter,n}(i,r),l=function(e,t=!1){var r;let n=null;return n=t&&null!=(r=e.onAfterShow)?r:e.onAfterEnter,n}(i,r),u=function(e,t=!1){var r;let n=null;return n=t&&null!=(r=e.onShowCancelled)?r:e.onEnterCancelled,n}(i,r),h=t=>{!t&&y(l)?Pn(e,l,[n,o,s]):y(u)&&Pn(e,u,[n,o,s]),y(a)&&a(e,a,[n])};y(t)?Pn(e,t,[n,h,o,s]):h()}else y(a)&&a(e,a,[n])}function Fn(e,t,r,n,i={},l,o,s,a,u){if(Tn(s)||r)if(t){let t=function(e,t=!1){var r;let n=null;return n=t&&null!=(r=e.hideFromClass)?r:e.leaveFromClass,n||(n=e.transitionName,n?t?`${n}-hide-from`:`${n}-leave-from`:null)}(i,r),h=function(e,t=!1){var r;let n=null;return n=t&&null!=(r=e.hideActiveClass)?r:e.leaveActiveClass,n||(n=e.transitionName,n?t?`${n}-hide-active`:`${n}-leave-active`:null)}(i,r),c=function(e,t=!1){var r;let n=null;return n=t&&null!=(r=e.hideToClass)?r:e.leaveToClass,n||(n=e.transitionName,n?t?`${n}-hide-to`:`${n}-leave-to`:null)}(i,r);t&&An(n,t),h&&An(n,h),On(c?()=>{Cn(e,n,s,a,l,(()=>{h&&jn(n,h),c&&jn(n,c),y(u)&&Pn(e,u,[n]),!r&&y(o)&&o()})),t&&jn(n,t),c&&An(n,c)}:()=>{t&&jn(n,t),h&&jn(n,h),y(u)&&Pn(e,u,[n]),!r&&y(o)&&o()})}else{let t=function(e,t=!1){var r;let n=null;return n=t&&null!=(r=e.onHide)?r:e.onLeave,n}(i,r),l=function(e,t=!1){var r;let n=null;return n=t&&null!=(r=e.onAfterHide)?r:e.onAfterLeave,n}(i,r),h=function(e,t=!1){var r;let n=null;return n=t&&null!=(r=e.onHideCancelled)?r:e.onLeaveCancelled,n}(i,r),c=t=>{!t&&y(l)?(Pn(e,l,[n,s,a]),y(u)&&Pn(e,u,[n]),!r&&y(o)&&o()):y(h)&&(Pn(e,h,[n,s,a]),y(u)&&Pn(e,u,[n]))};y(t)?Pn(e,t,[n,c,s,a]):c()}else!r&&y(o)&&o()}function kn(e,t={},r,n=-1){var i;let l=q(t.css),o=null!=(i=t.mode)?i:"default",s=Rn(t);return{mode:o,persisted:!1,beforeEnter:i=>{$n(e,l,!1,i,t,r,n)},enter:i=>{qn(e,l,!1,i,t,s.enter,r,n)},leave:(i,o)=>{Fn(e,l,!1,i,t,s.leave,o,r,n)},clone:i=>kn(e,t,r,n)}}function _n(e){return e.el}function Mn(e,t,r={},n,i,l,o){if(l){let l=_n(t);if(null==l)return;let s=q(r.css),a=Rn(r);$n(e,s,!0,l,r,n,i),qn(e,s,!0,l,r,a.show,n,i,(t=>{y(o)&&Pn(e,o,[t])}))}else y(o)&&Pn(e,o,[])}function Nn(e,t,r={},n,i,l,o){if(l){let l=_n(t);if(null==l)return;let s=q(r.css),a=Rn(r);Fn(e,s,!0,l,r,a.hide,null,n,i,(t=>{y(o)&&Pn(e,o,[t])}))}else y(o)&&Pn(e,o,[])}function Kn(e,t,r){return"function"==typeof e?Reflect.apply(e,{},[t,r]):e}class In{constructor(e,t){this.node=e,this.state=t}}let Dn=s({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,required:!1,default:"default"},modelSlot:{type:[Object],required:!1},multi:{type:Boolean,required:!1,default:!1},tag:{type:[String,Object,Function],required:!1,default:"div"},viewTag:{type:[String,Object,Function],required:!1,default:"div"},viewTagProps:{type:[Object,Function],required:!1,default:()=>({})},viewClass:{type:[String,Function],required:!1},viewActiveClass:{type:[String,Function],required:!1},viewDeactiveClass:{type:[String,Function],required:!1},css:{type:[Boolean,String],required:!1,default:!0},transition:{type:[Boolean,String],required:!1,default:!1},transitionName:{type:String,required:!1},enterFromClass:{type:String,required:!1},enterActiveClass:{type:String,required:!1},enterToClass:{type:String,required:!1},leaveFromClass:{type:String,required:!1},leaveActiveClass:{type:String,required:!1},leaveToClass:{type:String,required:!1},showFromClass:{type:String,required:!1},showActiveClass:{type:String,required:!1},showToClass:{type:String,required:!1},hideFromClass:{type:String,required:!1},hideActiveClass:{type:String,required:!1},hideToClass:{type:String,required:!1},onBeforeEnter:{type:Function,required:!1},onEnter:{type:Function,required:!1},onAfterEnter:{type:Function,required:!1},onEnterCancelled:{type:Function,required:!1},onBeforeLeave:{type:Function,required:!1},onLeave:{type:Function,required:!1},onAfterLeave:{type:Function,required:!1},onLeaveCancelled:{type:Function,required:!1},onBeforeShow:{type:Function,required:!1},onShow:{type:Function,required:!1},onAfterShow:{type:Function,required:!1},onShowCancelled:{type:Function,required:!1},onBeforeHide:{type:Function,required:!1},onHide:{type:Function,required:!1},onAfterHide:{type:Function,required:!1},onHideCancelled:{type:Function,required:!1}},setup(e,t){var r,n;let o=i();if(null===o||null===o.proxy)return void console.error("instance or instance.proxy not exist");const s=!0===e.multi,c=a(yn,null),f=a(mn,0),p=a(gn,null),d=a(vn,-1);let y=!1,m=null;const g=e.modelSlot;if(g){u(mn,f+1),u(vn,g.index),u(wn,g.index);let e=g.route;if(!e)return void console.warn("child view render error, route not exist");let t=en(o.proxy,!0);!function(e){let t=e.get(nn);t||(t=[],e.set(nn,t))}(t),pn(t,e)}else{if(null==c)return void console.error("router is not been injected");let t=e.name,i=a(bn,null),l=a(wn,0);if(m=c[ce](t,f,p,d,i,l),null===m)return;u(bn,m);if(!0===m[Ee]&&u(gn,m),s)y=q(null==(n=e.transition)||n);else{y=q(null!=(r=e.transition)&&r),u(vn,-1),u(mn,f+1),u(wn,-1);let t=m.slots.value;if(t.length>0){let e=t[0].route;if(e){pn(en(o.proxy,!0),e)}}else{let e=en(o.proxy,!0);m.compensation=()=>{let t=m.slots.value;if(t.length>0){let r=t[0].route;return r&&pn(e,r),!0}return!1}}}}let v=new Map;return l((()=>{v&&v.clear()})),()=>{var r,n,i,l,a,u;if(s){let i=new Map,l=[],s=null==m?void 0:m.slots.value,a=[];for(let t=0;t<s.length;t++){let u=s[t],c=`${e.name}-${u.index}`,f=h(Dn,{modelSlot:u}),p={},d=Kn(e.viewClass,u.route,t);"string"==typeof d&&d.length>0&&(p[d]=!0);let m=Kn(e.viewActiveClass,u.route,t),g=Kn(e.viewDeactiveClass,u.route,t),b=v.get(c);if("string"==typeof m&&m.length>0&&(p[m]=u.active),"string"==typeof g&&g.length>0&&(p[g]=!u.active),b&&u.active!==b.state){let r=b.node;u.active?a.unshift((()=>{Mn(o,r,e,u.route,t,y,(()=>{let e=rn(r);null!=e&&ln(e,on.ACTIVATED)}))})):a.push((()=>{Nn(o,r,e,u.route,t,y,(()=>{let e=rn(r);null!=e&&ln(e,on.DEACTIVATED)}))}))}let w={class:p,key:c},x=Kn(e.viewTagProps,u.route,t);null!==x&&"object"==typeof x&&E(!0,w,x),(null==(r=u.route)?void 0:r.viewTagAttrs)&&"object"==typeof(null==(n=u.route)?void 0:n.viewTagAttrs)&&E(!0,w,u.route.viewTagAttrs);let S=Kn(e.viewTag,u.route,t),R=h(S,w,{default:()=>[f]});if(i.set(c,new In(R,u.active)),y){let r=kn(o,e,u.route,t);R.transition=r}l.push(R)}v=i,function(e,t={}){On((()=>{for(let r=0;r<e.length;r++)Reflect.apply(e[r],t,[])}))}(a,o);let u=Kn(e.tag,null,-1),c={};return Object.assign(c,t.attrs),h(u,c,{default:()=>l})}if(null!=g){let e=g.model,t={};return e.props&&("object"==typeof e.props?E(!1,t,e.props):!0===e.props&&"object"==typeof(null==(i=g.route)?void 0:i.params)&&E(!1,t,null==(l=g.route)?void 0:l.params)),h(e.component,t)}{let t=m.slots.value;if(t.length>0){let r=t[0],n=r.model,i={};n.props&&("object"==typeof n.props?E(!1,i,n.props):!0===n.props&&"object"==typeof(null==(a=r.route)?void 0:a.params)&&E(!1,i,null==(u=r.route)?void 0:u.params));let l=h(n.component,i);if(y){let t=kn(o,e,r.route,-1);l.transition=t}return l}}}}});function Ln(e,t){return"function"==typeof e?Reflect.apply(e,{},[t]):e}let Hn=s({name:"RouterLink",inheritAttrs:!1,props:{tag:{type:[String,Object,Function],required:!1,default:"a"},to:{type:[String,Object,Function],required:!0},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=a(yn,null);return()=>{let n=Ln(e.to,null),i=Ln(e.tag,n);if(null==i)return void console.warn("can not resolve link tag");let l=null,o=null;null!==r&&(l=r[fe](n),o=r.current);let s={},a=Ln(e.activeClass,l);if("string"==typeof a&&a.length>0&&(s[a]=function(e,t){return!!(null!=e&&null!=t&&(e.path&&t.path&&t.path.startsWith(e.path)||e.name&&e.name==t.name))}(l,o)),!0===Ln(e.exact,l)){let t=Ln(e.exactActiveClass,l);"string"==typeof t&&t.length>0&&(s[t]=function(e,t){return!!(null!=e&&null!=t&&(e===t||e.path&&e.path===t.path||e.name&&e.name===t.name))}(l,o))}let u={class:s};E(!0,u,t.attrs);let c=Ln(e.event,l);if("string"==typeof c){const e=e=>{null!=r?null!=l?function(e){if(!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey||e.defaultPrevented||null!=e.button&&0!==e.button)){if(e.currentTarget&&e.currentTarget.getAttribute){const t=e.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(t))return}return e.preventDefault&&e.preventDefault(),!0}}(e)&&r.to(l):console.warn("route is not been resolved"):console.warn("router is not been injectd")};u[c]=e}return h(i,u,t.slots)}}}),Bn={get each(){return D},get type(){return _},get isFunction(){return y},get isArray(){return c},get isArrayLike(){return N},get makeArray(){return I},get merge(){return K},get isWindow(){return M},get isPlainObject(){return S},get isEqual(){return L}};var Un=Object.defineProperty,Vn=Object.defineProperties,Wn=Object.getOwnPropertyDescriptors,Jn=Object.getOwnPropertySymbols,zn=Object.prototype.hasOwnProperty,Gn=Object.prototype.propertyIsEnumerable,Xn=(e,t,r)=>t in e?Un(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;const Yn=Symbol("fk"),Qn=Symbol("fbk"),Zn=Symbol("fepk");function ei(e={}){const t=new Br(e),r=new ne,n=new Gr,i=(l=((e,t)=>{for(var r in t||(t={}))zn.call(t,r)&&Xn(e,r,t[r]);if(Jn)for(var r of Jn(t))Gn.call(t,r)&&Xn(e,r,t[r]);return e})({},Bn),Vn(l,Wn({get router(){return t},get bus(){return r},get Bus(){return ne},get eventproxy(){return n},get EventProxy(){return Gr},get EventChain(){return Rt},get require(){return t.require},get request(){return Xe},get extend(){return E},get clone(){return O},install(e){e.provide(yn,t),e.provide(Yn,i),e.provide(Qn,r),e.provide(Zn,n),e.component("fox-router-view",Dn),e.component("fox-router-link",Hn),Reflect.defineProperty(e.config.globalProperties,"$fox",{get:()=>i}),Reflect.defineProperty(e.config.globalProperties,"$router",{get:()=>t}),Reflect.defineProperty(e.config.globalProperties,"$bus",{get:()=>r}),e.config.globalProperties.$fox_on=function(e,t,r=!1){n.on(e,t,r)},e.config.globalProperties.$fox_off=function(e,t){n.off(e,t)},e.config.globalProperties.$fox_once=function(e,t){n.once(e,t)},e.config.globalProperties.$fox_all=function(...e){let t=n;Reflect.apply(t.all,t,e)},e.config.globalProperties.$fox_trigger=function(e,...t){let r=n;Reflect.apply(r.trigger,r,[e,...t])},e.config.globalProperties.$fox_emit=function(e,...t){let r=n;Reflect.apply(r.trigger,r,[e,...t])},e.mixin({computed:{$route(){return dn(this)}},created(){t.init()}})}})));var l;return i}function ti(){return a(yn)}function ri(){let e=i();return null===e||null===e.proxy?null:dn(e.proxy)}function ni(){return a(Yn,null)}function ii(){return a(Qn,null)}function li(){return a(Zn,null)}function oi(e){const t=ti(),r=(t,r,n)=>{try{Reflect.apply(e,{},[t,r])}catch(e){console.error(e)}n()};t.beforeEach(r),l((()=>{t.removeBeforeEach(r)}))}function si(e){const t=ti(),r=(t,r,n)=>{try{Reflect.apply(e,{},[t,r])}catch(e){console.error(e)}n()};t.afterEach(r),l((()=>{t.removeAfterEach(r)}))}export{ne as Bus,Rt as EventChain,Gr as EventProxy,me as Route,Br as Router,Ye as cancel,O as clone,ei as createFox,E as extend,c as isArray,d as isDate,A as isESModule,L as isEqual,y as isFunction,f as isMap,v as isObject,S as isPlainObject,b as isPromise,p as isSet,m as isString,g as isSymbol,si as onAfterRouteUpdate,oi as onBeforeRouteUpdate,hn as onFoxActivated,cn as onFoxDeactivated,Xe as request,q as toBoolean,F as toNumber,x as toTypeString,ii as useBus,li as useEventProxy,ni as useFox,ri as useRoute,ti as useRouter};
package/main.js DELETED
@@ -1,8 +0,0 @@
1
- /*
2
- * @version: 1.0
3
- * @Author: 江成
4
- * @Date: 2021-09-18 09:36:45
5
- */
6
-
7
- import './libs/index.css'
8
- export * from './libs/index.js'