UNPKG

@ly-js/automatic

Version:

automatic of vue

17 lines (16 loc) 44 kB
/*! * @ly-js/automatic v0.1.4 * (c) 2021-2023 liyu */(function(m,C){typeof exports=="object"&&typeof module!="undefined"?C(exports):typeof define=="function"&&define.amd?define(["exports"],C):(m=typeof globalThis!="undefined"?globalThis:m||self,C(m.lyAutomatic={}))})(this,function(m){"use strict";const C=(...e)=>{console.warn(...e)};var zn=typeof global=="object"&&global&&global.Object===Object&&global,Je=zn,Hn=typeof self=="object"&&self&&self.Object===Object&&self,Kn=Je||Hn||Function("return this")(),w=Kn,Yn=w.Symbol,L=Yn,Ze=Object.prototype,Vn=Ze.hasOwnProperty,qn=Ze.toString,U=L?L.toStringTag:void 0;function Xn(e){var t=Vn.call(e,U),n=e[U];try{e[U]=void 0;var r=!0}catch{}var i=qn.call(e);return r&&(t?e[U]=n:delete e[U]),i}var Jn=Object.prototype,Zn=Jn.toString;function Qn(e){return Zn.call(e)}var kn="[object Null]",er="[object Undefined]",Qe=L?L.toStringTag:void 0;function j(e){return e==null?e===void 0?er:kn:Qe&&Qe in Object(e)?Xn(e):Qn(e)}function T(e){return e!=null&&typeof e=="object"}var tr=Array.isArray,z=tr;function R(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}function ke(e){return e}var nr="[object AsyncFunction]",rr="[object Function]",ir="[object GeneratorFunction]",or="[object Proxy]";function ge(e){if(!R(e))return!1;var t=j(e);return t==rr||t==ir||t==nr||t==or}var ar=w["__core-js_shared__"],ve=ar,et=function(){var e=/[^.]+$/.exec(ve&&ve.keys&&ve.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function sr(e){return!!et&&et in e}var cr=Function.prototype,ur=cr.toString;function P(e){if(e!=null){try{return ur.call(e)}catch{}try{return e+""}catch{}}return""}var fr=/[\\^$.*+?()[\]{}|]/g,lr=/^\[object .+?Constructor\]$/,hr=Function.prototype,dr=Object.prototype,pr=hr.toString,gr=dr.hasOwnProperty,vr=RegExp("^"+pr.call(gr).replace(fr,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function _r(e){if(!R(e)||sr(e))return!1;var t=ge(e)?vr:lr;return t.test(P(e))}function br(e,t){return e==null?void 0:e[t]}function S(e,t){var n=br(e,t);return _r(n)?n:void 0}var yr=S(w,"WeakMap"),_e=yr,tt=Object.create,mr=function(){function e(){}return function(t){if(!R(t))return{};if(tt)return tt(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}(),$r=mr;function wr(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function nt(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}var Or=800,Ar=16,Tr=Date.now;function Rr(e){var t=0,n=0;return function(){var r=Tr(),i=Ar-(r-n);if(n=r,i>0){if(++t>=Or)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function jr(e){return function(){return e}}var Pr=function(){try{var e=S(Object,"defineProperty");return e({},"",{}),e}catch{}}(),k=Pr,Sr=k?function(e,t){return k(e,"toString",{configurable:!0,enumerable:!1,value:jr(t),writable:!0})}:ke,Mr=Sr,Er=Rr(Mr),xr=Er;function Ir(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}var Cr=9007199254740991,Lr=/^(?:0|[1-9]\d*)$/;function rt(e,t){var n=typeof e;return t=t??Cr,!!t&&(n=="number"||n!="symbol"&&Lr.test(e))&&e>-1&&e%1==0&&e<t}function be(e,t,n){t=="__proto__"&&k?k(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function ee(e,t){return e===t||e!==e&&t!==t}var Fr=Object.prototype,Nr=Fr.hasOwnProperty;function it(e,t,n){var r=e[t];(!(Nr.call(e,t)&&ee(r,n))||n===void 0&&!(t in e))&&be(e,t,n)}function H(e,t,n,r){var i=!n;n||(n={});for(var o=-1,a=t.length;++o<a;){var s=t[o],c=r?r(n[s],e[s],s,n,e):void 0;c===void 0&&(c=e[s]),i?be(n,s,c):it(n,s,c)}return n}var ot=Math.max;function Gr(e,t,n){return t=ot(t===void 0?e.length-1:t,0),function(){for(var r=arguments,i=-1,o=ot(r.length-t,0),a=Array(o);++i<o;)a[i]=r[t+i];i=-1;for(var s=Array(t+1);++i<t;)s[i]=r[i];return s[t]=n(a),wr(e,this,s)}}function Dr(e,t){return xr(Gr(e,t,ke),e+"")}var Wr=9007199254740991;function at(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Wr}function te(e){return e!=null&&at(e.length)&&!ge(e)}function Br(e,t,n){if(!R(n))return!1;var r=typeof t;return(r=="number"?te(n)&&rt(t,n.length):r=="string"&&t in n)?ee(n[t],e):!1}function Ur(e){return Dr(function(t,n){var r=-1,i=n.length,o=i>1?n[i-1]:void 0,a=i>2?n[2]:void 0;for(o=e.length>3&&typeof o=="function"?(i--,o):void 0,a&&Br(n[0],n[1],a)&&(o=i<3?void 0:o,i=1),t=Object(t);++r<i;){var s=n[r];s&&e(t,s,r,o)}return t})}var zr=Object.prototype;function ye(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||zr;return e===n}function Hr(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var Kr="[object Arguments]";function st(e){return T(e)&&j(e)==Kr}var ct=Object.prototype,Yr=ct.hasOwnProperty,Vr=ct.propertyIsEnumerable,qr=st(function(){return arguments}())?st:function(e){return T(e)&&Yr.call(e,"callee")&&!Vr.call(e,"callee")},me=qr;function Xr(){return!1}var ut=typeof m=="object"&&m&&!m.nodeType&&m,ft=ut&&typeof module=="object"&&module&&!module.nodeType&&module,Jr=ft&&ft.exports===ut,lt=Jr?w.Buffer:void 0,Zr=lt?lt.isBuffer:void 0,Qr=Zr||Xr,$e=Qr,kr="[object Arguments]",ei="[object Array]",ti="[object Boolean]",ni="[object Date]",ri="[object Error]",ii="[object Function]",oi="[object Map]",ai="[object Number]",si="[object Object]",ci="[object RegExp]",ui="[object Set]",fi="[object String]",li="[object WeakMap]",hi="[object ArrayBuffer]",di="[object DataView]",pi="[object Float32Array]",gi="[object Float64Array]",vi="[object Int8Array]",_i="[object Int16Array]",bi="[object Int32Array]",yi="[object Uint8Array]",mi="[object Uint8ClampedArray]",$i="[object Uint16Array]",wi="[object Uint32Array]",v={};v[pi]=v[gi]=v[vi]=v[_i]=v[bi]=v[yi]=v[mi]=v[$i]=v[wi]=!0,v[kr]=v[ei]=v[hi]=v[ti]=v[di]=v[ni]=v[ri]=v[ii]=v[oi]=v[ai]=v[si]=v[ci]=v[ui]=v[fi]=v[li]=!1;function Oi(e){return T(e)&&at(e.length)&&!!v[j(e)]}function we(e){return function(t){return e(t)}}var ht=typeof m=="object"&&m&&!m.nodeType&&m,K=ht&&typeof module=="object"&&module&&!module.nodeType&&module,Ai=K&&K.exports===ht,Oe=Ai&&Je.process,Ti=function(){try{var e=K&&K.require&&K.require("util").types;return e||Oe&&Oe.binding&&Oe.binding("util")}catch{}}(),F=Ti,dt=F&&F.isTypedArray,Ri=dt?we(dt):Oi,pt=Ri,ji=Object.prototype,Pi=ji.hasOwnProperty;function gt(e,t){var n=z(e),r=!n&&me(e),i=!n&&!r&&$e(e),o=!n&&!r&&!i&&pt(e),a=n||r||i||o,s=a?Hr(e.length,String):[],c=s.length;for(var f in e)(t||Pi.call(e,f))&&!(a&&(f=="length"||i&&(f=="offset"||f=="parent")||o&&(f=="buffer"||f=="byteLength"||f=="byteOffset")||rt(f,c)))&&s.push(f);return s}function vt(e,t){return function(n){return e(t(n))}}var Si=vt(Object.keys,Object),Mi=Si,Ei=Object.prototype,xi=Ei.hasOwnProperty;function Ii(e){if(!ye(e))return Mi(e);var t=[];for(var n in Object(e))xi.call(e,n)&&n!="constructor"&&t.push(n);return t}function Ae(e){return te(e)?gt(e):Ii(e)}function Ci(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var Li=Object.prototype,Fi=Li.hasOwnProperty;function Ni(e){if(!R(e))return Ci(e);var t=ye(e),n=[];for(var r in e)r=="constructor"&&(t||!Fi.call(e,r))||n.push(r);return n}function Y(e){return te(e)?gt(e,!0):Ni(e)}var Gi=S(Object,"create"),V=Gi;function Di(){this.__data__=V?V(null):{},this.size=0}function Wi(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var Bi="__lodash_hash_undefined__",Ui=Object.prototype,zi=Ui.hasOwnProperty;function Hi(e){var t=this.__data__;if(V){var n=t[e];return n===Bi?void 0:n}return zi.call(t,e)?t[e]:void 0}var Ki=Object.prototype,Yi=Ki.hasOwnProperty;function Vi(e){var t=this.__data__;return V?t[e]!==void 0:Yi.call(t,e)}var qi="__lodash_hash_undefined__";function Xi(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=V&&t===void 0?qi:t,this}function M(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}M.prototype.clear=Di,M.prototype.delete=Wi,M.prototype.get=Hi,M.prototype.has=Vi,M.prototype.set=Xi;function Ji(){this.__data__=[],this.size=0}function ne(e,t){for(var n=e.length;n--;)if(ee(e[n][0],t))return n;return-1}var Zi=Array.prototype,Qi=Zi.splice;function ki(e){var t=this.__data__,n=ne(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():Qi.call(t,n,1),--this.size,!0}function eo(e){var t=this.__data__,n=ne(t,e);return n<0?void 0:t[n][1]}function to(e){return ne(this.__data__,e)>-1}function no(e,t){var n=this.__data__,r=ne(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function O(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}O.prototype.clear=Ji,O.prototype.delete=ki,O.prototype.get=eo,O.prototype.has=to,O.prototype.set=no;var ro=S(w,"Map"),q=ro;function io(){this.size=0,this.__data__={hash:new M,map:new(q||O),string:new M}}function oo(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function re(e,t){var n=e.__data__;return oo(t)?n[typeof t=="string"?"string":"hash"]:n.map}function ao(e){var t=re(this,e).delete(e);return this.size-=t?1:0,t}function so(e){return re(this,e).get(e)}function co(e){return re(this,e).has(e)}function uo(e,t){var n=re(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function N(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}N.prototype.clear=io,N.prototype.delete=ao,N.prototype.get=so,N.prototype.has=co,N.prototype.set=uo;function _t(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}var fo=vt(Object.getPrototypeOf,Object),Te=fo,lo="[object Object]",ho=Function.prototype,po=Object.prototype,bt=ho.toString,go=po.hasOwnProperty,vo=bt.call(Object);function _o(e){if(!T(e)||j(e)!=lo)return!1;var t=Te(e);if(t===null)return!0;var n=go.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&bt.call(n)==vo}function bo(){this.__data__=new O,this.size=0}function yo(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function mo(e){return this.__data__.get(e)}function $o(e){return this.__data__.has(e)}var wo=200;function Oo(e,t){var n=this.__data__;if(n instanceof O){var r=n.__data__;if(!q||r.length<wo-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new N(r)}return n.set(e,t),this.size=n.size,this}function E(e){var t=this.__data__=new O(e);this.size=t.size}E.prototype.clear=bo,E.prototype.delete=yo,E.prototype.get=mo,E.prototype.has=$o,E.prototype.set=Oo;function Ao(e,t){return e&&H(t,Ae(t),e)}function To(e,t){return e&&H(t,Y(t),e)}var yt=typeof m=="object"&&m&&!m.nodeType&&m,mt=yt&&typeof module=="object"&&module&&!module.nodeType&&module,Ro=mt&&mt.exports===yt,$t=Ro?w.Buffer:void 0,wt=$t?$t.allocUnsafe:void 0;function Ot(e,t){if(t)return e.slice();var n=e.length,r=wt?wt(n):new e.constructor(n);return e.copy(r),r}function jo(e,t){for(var n=-1,r=e==null?0:e.length,i=0,o=[];++n<r;){var a=e[n];t(a,n,e)&&(o[i++]=a)}return o}function At(){return[]}var Po=Object.prototype,So=Po.propertyIsEnumerable,Tt=Object.getOwnPropertySymbols,Mo=Tt?function(e){return e==null?[]:(e=Object(e),jo(Tt(e),function(t){return So.call(e,t)}))}:At,Re=Mo;function Eo(e,t){return H(e,Re(e),t)}var xo=Object.getOwnPropertySymbols,Io=xo?function(e){for(var t=[];e;)_t(t,Re(e)),e=Te(e);return t}:At,Rt=Io;function Co(e,t){return H(e,Rt(e),t)}function jt(e,t,n){var r=t(e);return z(e)?r:_t(r,n(e))}function Lo(e){return jt(e,Ae,Re)}function Fo(e){return jt(e,Y,Rt)}var No=S(w,"DataView"),je=No,Go=S(w,"Promise"),Pe=Go,Do=S(w,"Set"),Se=Do,Pt="[object Map]",Wo="[object Object]",St="[object Promise]",Mt="[object Set]",Et="[object WeakMap]",xt="[object DataView]",Bo=P(je),Uo=P(q),zo=P(Pe),Ho=P(Se),Ko=P(_e),x=j;(je&&x(new je(new ArrayBuffer(1)))!=xt||q&&x(new q)!=Pt||Pe&&x(Pe.resolve())!=St||Se&&x(new Se)!=Mt||_e&&x(new _e)!=Et)&&(x=function(e){var t=j(e),n=t==Wo?e.constructor:void 0,r=n?P(n):"";if(r)switch(r){case Bo:return xt;case Uo:return Pt;case zo:return St;case Ho:return Mt;case Ko:return Et}return t});var Me=x,Yo=Object.prototype,Vo=Yo.hasOwnProperty;function qo(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&Vo.call(e,"index")&&(n.index=e.index,n.input=e.input),n}var Xo=w.Uint8Array,It=Xo;function Ee(e){var t=new e.constructor(e.byteLength);return new It(t).set(new It(e)),t}function Jo(e,t){var n=t?Ee(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}var Zo=/\w*$/;function Qo(e){var t=new e.constructor(e.source,Zo.exec(e));return t.lastIndex=e.lastIndex,t}var Ct=L?L.prototype:void 0,Lt=Ct?Ct.valueOf:void 0;function ko(e){return Lt?Object(Lt.call(e)):{}}function Ft(e,t){var n=t?Ee(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var ea="[object Boolean]",ta="[object Date]",na="[object Map]",ra="[object Number]",ia="[object RegExp]",oa="[object Set]",aa="[object String]",sa="[object Symbol]",ca="[object ArrayBuffer]",ua="[object DataView]",fa="[object Float32Array]",la="[object Float64Array]",ha="[object Int8Array]",da="[object Int16Array]",pa="[object Int32Array]",ga="[object Uint8Array]",va="[object Uint8ClampedArray]",_a="[object Uint16Array]",ba="[object Uint32Array]";function ya(e,t,n){var r=e.constructor;switch(t){case ca:return Ee(e);case ea:case ta:return new r(+e);case ua:return Jo(e,n);case fa:case la:case ha:case da:case pa:case ga:case va:case _a:case ba:return Ft(e,n);case na:return new r;case ra:case aa:return new r(e);case ia:return Qo(e);case oa:return new r;case sa:return ko(e)}}function Nt(e){return typeof e.constructor=="function"&&!ye(e)?$r(Te(e)):{}}var ma="[object Map]";function $a(e){return T(e)&&Me(e)==ma}var Gt=F&&F.isMap,wa=Gt?we(Gt):$a,Oa=wa,Aa="[object Set]";function Ta(e){return T(e)&&Me(e)==Aa}var Dt=F&&F.isSet,Ra=Dt?we(Dt):Ta,ja=Ra,Pa=1,Sa=2,Ma=4,Wt="[object Arguments]",Ea="[object Array]",xa="[object Boolean]",Ia="[object Date]",Ca="[object Error]",Bt="[object Function]",La="[object GeneratorFunction]",Fa="[object Map]",Na="[object Number]",Ut="[object Object]",Ga="[object RegExp]",Da="[object Set]",Wa="[object String]",Ba="[object Symbol]",Ua="[object WeakMap]",za="[object ArrayBuffer]",Ha="[object DataView]",Ka="[object Float32Array]",Ya="[object Float64Array]",Va="[object Int8Array]",qa="[object Int16Array]",Xa="[object Int32Array]",Ja="[object Uint8Array]",Za="[object Uint8ClampedArray]",Qa="[object Uint16Array]",ka="[object Uint32Array]",g={};g[Wt]=g[Ea]=g[za]=g[Ha]=g[xa]=g[Ia]=g[Ka]=g[Ya]=g[Va]=g[qa]=g[Xa]=g[Fa]=g[Na]=g[Ut]=g[Ga]=g[Da]=g[Wa]=g[Ba]=g[Ja]=g[Za]=g[Qa]=g[ka]=!0,g[Ca]=g[Bt]=g[Ua]=!1;function ie(e,t,n,r,i,o){var a,s=t&Pa,c=t&Sa,f=t&Ma;if(n&&(a=i?n(e,r,i,o):n(e)),a!==void 0)return a;if(!R(e))return e;var u=z(e);if(u){if(a=qo(e),!s)return nt(e,a)}else{var d=Me(e),h=d==Bt||d==La;if($e(e))return Ot(e,s);if(d==Ut||d==Wt||h&&!i){if(a=c||h?{}:Nt(e),!s)return c?Co(e,To(a,e)):Eo(e,Ao(a,e))}else{if(!g[d])return i?e:{};a=ya(e,d,s)}}o||(o=new E);var l=o.get(e);if(l)return l;o.set(e,a),ja(e)?e.forEach(function(_){a.add(ie(_,t,n,_,e,o))}):Oa(e)&&e.forEach(function(_,y){a.set(y,ie(_,t,n,y,e,o))});var p=f?c?Fo:Lo:c?Y:Ae,$=u?void 0:p(e);return Ir($||e,function(_,y){$&&(y=_,_=e[y]),it(a,y,ie(_,t,n,y,e,o))}),a}var es=1,ts=4;function ns(e){return ie(e,es|ts)}function rs(e){return function(t,n,r){for(var i=-1,o=Object(t),a=r(t),s=a.length;s--;){var c=a[e?s:++i];if(n(o[c],c,o)===!1)break}return t}}var is=rs(),os=is;function xe(e,t,n){(n!==void 0&&!ee(e[t],n)||n===void 0&&!(t in e))&&be(e,t,n)}function as(e){return T(e)&&te(e)}function Ie(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}function ss(e){return H(e,Y(e))}function cs(e,t,n,r,i,o,a){var s=Ie(e,n),c=Ie(t,n),f=a.get(c);if(f){xe(e,n,f);return}var u=o?o(s,c,n+"",e,t,a):void 0,d=u===void 0;if(d){var h=z(c),l=!h&&$e(c),p=!h&&!l&&pt(c);u=c,h||l||p?z(s)?u=s:as(s)?u=nt(s):l?(d=!1,u=Ot(c,!0)):p?(d=!1,u=Ft(c,!0)):u=[]:_o(c)||me(c)?(u=s,me(s)?u=ss(s):(!R(s)||ge(s))&&(u=Nt(c))):d=!1}d&&(a.set(c,u),i(u,c,r,o,a),a.delete(c)),xe(e,n,u)}function zt(e,t,n,r,i){e!==t&&os(t,function(o,a){if(i||(i=new E),R(o))cs(e,t,a,n,zt,r,i);else{var s=r?r(Ie(e,a),o,a+"",e,t,i):void 0;s===void 0&&(s=o),xe(e,a,s)}},Y)}var us="[object Boolean]";function fs(e){return e===!0||e===!1||T(e)&&j(e)==us}var ls=Ur(function(e,t,n){zt(e,t,n)}),A=ls;/*! * @ly-js/utils v0.0.6 * (c) 2021-2022 liyu */const Ce=e=>{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))},hs=/-(\w)/g,ds=Ce(e=>e.replace(hs,(t,n)=>n?n.toUpperCase():"")),ps=/\B([A-Z])/g,Ht=Ce(e=>e.replace(ps,"-$1").toLowerCase()),gs=Ce(e=>e.charAt(0).toUpperCase()+e.slice(1));var vs=typeof global=="object"&&global&&global.Object===Object&&global,_s=vs,bs=typeof self=="object"&&self&&self.Object===Object&&self,ys=_s||bs||Function("return this")(),I=ys,ms=I.Symbol,oe=ms,Kt=Object.prototype,$s=Kt.hasOwnProperty,ws=Kt.toString,X=oe?oe.toStringTag:void 0;function Os(e){var t=$s.call(e,X),n=e[X];try{e[X]=void 0;var r=!0}catch{}var i=ws.call(e);return r&&(t?e[X]=n:delete e[X]),i}var As=Object.prototype,Ts=As.toString;function Rs(e){return Ts.call(e)}var js="[object Null]",Ps="[object Undefined]",Yt=oe?oe.toStringTag:void 0;function Vt(e){return e==null?e===void 0?Ps:js:Yt&&Yt in Object(e)?Os(e):Rs(e)}function qt(e){return e!=null&&typeof e=="object"}var Ss="[object Symbol]";function Ms(e){return typeof e=="symbol"||qt(e)&&Vt(e)==Ss}var Es=Array.isArray,xs=Es,Is=/\s/;function Cs(e){for(var t=e.length;t--&&Is.test(e.charAt(t)););return t}var Ls=/^\s+/;function Fs(e){return e&&e.slice(0,Cs(e)+1).replace(Ls,"")}function G(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var Xt=0/0,Ns=/^[-+]0x[0-9a-f]+$/i,Gs=/^0b[01]+$/i,Ds=/^0o[0-7]+$/i,Ws=parseInt;function Bs(e){if(typeof e=="number")return e;if(Ms(e))return Xt;if(G(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=G(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=Fs(e);var n=Gs.test(e);return n||Ds.test(e)?Ws(e.slice(2),n?2:8):Ns.test(e)?Xt:+e}var Jt=1/0,Us=17976931348623157e292;function zs(e){if(!e)return e===0?e:0;if(e=Bs(e),e===Jt||e===-Jt){var t=e<0?-1:1;return t*Us}return e===e?e:0}function Zt(e){var t=zs(e),n=t%1;return t===t?n?t-n:t:0}function Qt(e){return e}var Hs="[object AsyncFunction]",Ks="[object Function]",Ys="[object GeneratorFunction]",Vs="[object Proxy]";function qs(e){if(!G(e))return!1;var t=Vt(e);return t==Ks||t==Ys||t==Hs||t==Vs}var Xs=I["__core-js_shared__"],Le=Xs,kt=function(){var e=/[^.]+$/.exec(Le&&Le.keys&&Le.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function Js(e){return!!kt&&kt in e}var Zs=Function.prototype,Qs=Zs.toString;function ks(e){if(e!=null){try{return Qs.call(e)}catch{}try{return e+""}catch{}}return""}var ec=/[\\^$.*+?()[\]{}|]/g,tc=/^\[object .+?Constructor\]$/,nc=Function.prototype,rc=Object.prototype,ic=nc.toString,oc=rc.hasOwnProperty,ac=RegExp("^"+ic.call(oc).replace(ec,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function sc(e){if(!G(e)||Js(e))return!1;var t=qs(e)?ac:tc;return t.test(ks(e))}function cc(e,t){return e==null?void 0:e[t]}function en(e,t){var n=cc(e,t);return sc(n)?n:void 0}var uc=en(I,"WeakMap"),tn=uc,fc=tn&&new tn,ae=fc,lc=ae?function(e,t){return ae.set(e,t),e}:Qt,nn=lc,rn=Object.create,hc=function(){function e(){}return function(t){if(!G(t))return{};if(rn)return rn(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}(),Fe=hc;function J(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var n=Fe(e.prototype),r=e.apply(n,t);return G(r)?r:n}}var dc=1;function pc(e,t,n){var r=t&dc,i=J(e);function o(){var a=this&&this!==I&&this instanceof o?i:e;return a.apply(r?n:this,arguments)}return o}function on(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}var gc=Math.max;function an(e,t,n,r){for(var i=-1,o=e.length,a=n.length,s=-1,c=t.length,f=gc(o-a,0),u=Array(c+f),d=!r;++s<c;)u[s]=t[s];for(;++i<a;)(d||i<o)&&(u[n[i]]=e[i]);for(;f--;)u[s++]=e[i++];return u}var vc=Math.max;function sn(e,t,n,r){for(var i=-1,o=e.length,a=-1,s=n.length,c=-1,f=t.length,u=vc(o-s,0),d=Array(u+f),h=!r;++i<u;)d[i]=e[i];for(var l=i;++c<f;)d[l+c]=t[c];for(;++a<s;)(h||i<o)&&(d[l+n[a]]=e[i++]);return d}function _c(e,t){for(var n=e.length,r=0;n--;)e[n]===t&&++r;return r}function Ne(){}var bc=4294967295;function D(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=bc,this.__views__=[]}D.prototype=Fe(Ne.prototype),D.prototype.constructor=D;function yc(){}var mc=ae?function(e){return ae.get(e)}:yc,cn=mc,$c={},un=$c,wc=Object.prototype,Oc=wc.hasOwnProperty;function Ac(e){for(var t=e.name+"",n=un[t],r=Oc.call(un,t)?n.length:0;r--;){var i=n[r],o=i.func;if(o==null||o==e)return i.name}return t}function W(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=void 0}W.prototype=Fe(Ne.prototype),W.prototype.constructor=W;function fn(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}function Tc(e){if(e instanceof D)return e.clone();var t=new W(e.__wrapped__,e.__chain__);return t.__actions__=fn(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var Rc=Object.prototype,jc=Rc.hasOwnProperty;function se(e){if(qt(e)&&!xs(e)&&!(e instanceof D)){if(e instanceof W)return e;if(jc.call(e,"__wrapped__"))return Tc(e)}return new W(e)}se.prototype=Ne.prototype,se.prototype.constructor=se;function Pc(e){var t=Ac(e),n=se[t];if(typeof n!="function"||!(t in D.prototype))return!1;if(e===n)return!0;var r=cn(n);return!!r&&e===r[0]}var Sc=800,Mc=16,Ec=Date.now;function ln(e){var t=0,n=0;return function(){var r=Ec(),i=Mc-(r-n);if(n=r,i>0){if(++t>=Sc)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var xc=ln(nn),hn=xc,Ic=/\{\n\/\* \[wrapped with (.+)\] \*/,Cc=/,? & /;function Lc(e){var t=e.match(Ic);return t?t[1].split(Cc):[]}var Fc=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/;function Nc(e,t){var n=t.length;if(!n)return e;var r=n-1;return t[r]=(n>1?"& ":"")+t[r],t=t.join(n>2?", ":" "),e.replace(Fc,`{ /* [wrapped with `+t+`] */ `)}function Gc(e){return function(){return e}}var Dc=function(){try{var e=en(Object,"defineProperty");return e({},"",{}),e}catch{}}(),dn=Dc,Wc=dn?function(e,t){return dn(e,"toString",{configurable:!0,enumerable:!1,value:Gc(t),writable:!0})}:Qt,Bc=Wc,Uc=ln(Bc),zc=Uc;function Hc(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}function Kc(e,t,n,r){for(var i=e.length,o=n+(r?1:-1);r?o--:++o<i;)if(t(e[o],o,e))return o;return-1}function Yc(e){return e!==e}function Vc(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}function qc(e,t,n){return t===t?Vc(e,t,n):Kc(e,Yc,n)}function Xc(e,t){var n=e==null?0:e.length;return!!n&&qc(e,t,0)>-1}var Jc=1,Zc=2,Qc=8,kc=16,eu=32,tu=64,nu=128,ru=256,iu=512,ou=[["ary",nu],["bind",Jc],["bindKey",Zc],["curry",Qc],["curryRight",kc],["flip",iu],["partial",eu],["partialRight",tu],["rearg",ru]];function au(e,t){return Hc(ou,function(n){var r="_."+n[0];t&n[1]&&!Xc(e,r)&&e.push(r)}),e.sort()}function pn(e,t,n){var r=t+"";return zc(e,Nc(r,au(Lc(r),n)))}var su=1,cu=2,uu=4,fu=8,gn=32,vn=64;function _n(e,t,n,r,i,o,a,s,c,f){var u=t&fu,d=u?a:void 0,h=u?void 0:a,l=u?o:void 0,p=u?void 0:o;t|=u?gn:vn,t&=~(u?vn:gn),t&uu||(t&=~(su|cu));var $=[e,t,i,l,d,p,h,s,c,f],_=n.apply(void 0,$);return Pc(e)&&hn(_,$),_.placeholder=r,pn(_,e,t)}function bn(e){var t=e;return t.placeholder}var lu=9007199254740991,hu=/^(?:0|[1-9]\d*)$/;function du(e,t){var n=typeof e;return t=t??lu,!!t&&(n=="number"||n!="symbol"&&hu.test(e))&&e>-1&&e%1==0&&e<t}var pu=Math.min;function gu(e,t){for(var n=e.length,r=pu(t.length,n),i=fn(e);r--;){var o=t[r];e[r]=du(o,n)?i[o]:void 0}return e}var yn="__lodash_placeholder__";function ce(e,t){for(var n=-1,r=e.length,i=0,o=[];++n<r;){var a=e[n];(a===t||a===yn)&&(e[n]=yn,o[i++]=n)}return o}var vu=1,_u=2,bu=8,yu=16,mu=128,$u=512;function Ge(e,t,n,r,i,o,a,s,c,f){var u=t&mu,d=t&vu,h=t&_u,l=t&(bu|yu),p=t&$u,$=h?void 0:J(e);function _(){for(var y=arguments.length,b=Array(y),Q=y;Q--;)b[Q]=arguments[Q];if(l)var Bn=bn(_),cf=_c(b,Bn);if(r&&(b=an(b,r,i,l)),o&&(b=sn(b,o,a,l)),y-=cf,l&&y<f){var uf=ce(b,Bn);return _n(e,t,Ge,_.placeholder,n,b,uf,s,c,f-y)}var Un=d?n:this,Xe=h?Un[e]:e;return y=b.length,s?b=gu(b,s):p&&y>1&&b.reverse(),u&&c<y&&(b.length=c),this&&this!==I&&this instanceof _&&(Xe=$||J(Xe)),Xe.apply(Un,b)}return _}function wu(e,t,n){var r=J(e);function i(){for(var o=arguments.length,a=Array(o),s=o,c=bn(i);s--;)a[s]=arguments[s];var f=o<3&&a[0]!==c&&a[o-1]!==c?[]:ce(a,c);if(o-=f.length,o<n)return _n(e,t,Ge,i.placeholder,void 0,a,f,void 0,void 0,n-o);var u=this&&this!==I&&this instanceof i?r:e;return on(u,this,a)}return i}var Ou=1;function Au(e,t,n,r){var i=t&Ou,o=J(e);function a(){for(var s=-1,c=arguments.length,f=-1,u=r.length,d=Array(u+c),h=this&&this!==I&&this instanceof a?o:e;++f<u;)d[f]=r[f];for(;c--;)d[f++]=arguments[++s];return on(h,i?n:this,d)}return a}var mn="__lodash_placeholder__",De=1,Tu=2,Ru=4,$n=8,Z=128,wn=256,ju=Math.min;function Pu(e,t){var n=e[1],r=t[1],i=n|r,o=i<(De|Tu|Z),a=r==Z&&n==$n||r==Z&&n==wn&&e[7].length<=t[8]||r==(Z|wn)&&t[7].length<=t[8]&&n==$n;if(!(o||a))return e;r&De&&(e[2]=t[2],i|=n&De?0:Ru);var s=t[3];if(s){var c=e[3];e[3]=c?an(c,s,t[4]):s,e[4]=c?ce(e[3],mn):t[4]}return s=t[5],s&&(c=e[5],e[5]=c?sn(c,s,t[6]):s,e[6]=c?ce(e[5],mn):t[6]),s=t[7],s&&(e[7]=s),r&Z&&(e[8]=e[8]==null?t[8]:ju(e[8],t[8])),e[9]==null&&(e[9]=t[9]),e[0]=t[0],e[1]=i,e}var Su="Expected a function",On=1,Mu=2,We=8,Be=16,Ue=32,An=64,Tn=Math.max;function Eu(e,t,n,r,i,o,a,s){var c=t&Mu;if(!c&&typeof e!="function")throw new TypeError(Su);var f=r?r.length:0;if(f||(t&=~(Ue|An),r=i=void 0),a=a===void 0?a:Tn(Zt(a),0),s=s===void 0?s:Zt(s),f-=i?i.length:0,t&An){var u=r,d=i;r=i=void 0}var h=c?void 0:cn(e),l=[e,t,n,r,i,u,d,o,a,s];if(h&&Pu(l,h),e=l[0],t=l[1],n=l[2],r=l[3],i=l[4],s=l[9]=l[9]===void 0?c?0:e.length:Tn(l[9]-f,0),!s&&t&(We|Be)&&(t&=~(We|Be)),!t||t==On)var p=pc(e,t,n);else t==We||t==Be?p=wu(e,t,s):(t==Ue||t==(On|Ue))&&!i.length?p=Au(e,t,n,r):p=Ge.apply(void 0,l);var $=h?nn:hn;return pn($(p,l),e,t)}var xu=8;function ze(e,t,n){t=n?void 0:t;var r=Eu(e,xu,void 0,void 0,void 0,void 0,void 0,t);return r.placeholder=ze.placeholder,r}ze.placeholder={},ze((e,t,n)=>n.replace(e,t))(/(\d{3})(\d{4})(\d{4})/);var Rn=function(){if(typeof Map!="undefined")return Map;function e(t,n){var r=-1;return t.some(function(i,o){return i[0]===n?(r=o,!0):!1}),r}return function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(n){var r=e(this.__entries__,n),i=this.__entries__[r];return i&&i[1]},t.prototype.set=function(n,r){var i=e(this.__entries__,n);~i?this.__entries__[i][1]=r:this.__entries__.push([n,r])},t.prototype.delete=function(n){var r=this.__entries__,i=e(r,n);~i&&r.splice(i,1)},t.prototype.has=function(n){return!!~e(this.__entries__,n)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(n,r){r===void 0&&(r=null);for(var i=0,o=this.__entries__;i<o.length;i++){var a=o[i];n.call(r,a[1],a[0])}},t}()}(),He=typeof window!="undefined"&&typeof document!="undefined"&&window.document===document,ue=function(){return typeof global!="undefined"&&global.Math===Math?global:typeof self!="undefined"&&self.Math===Math?self:typeof window!="undefined"&&window.Math===Math?window:Function("return this")()}(),Iu=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(ue):function(e){return setTimeout(function(){return e(Date.now())},1e3/60)}}(),Cu=2;function Lu(e,t){var n=!1,r=!1,i=0;function o(){n&&(n=!1,e()),r&&s()}function a(){Iu(o)}function s(){var c=Date.now();if(n){if(c-i<Cu)return;r=!0}else n=!0,r=!1,setTimeout(a,t);i=c}return s}var Fu=20,Nu=["top","right","bottom","left","width","height","size","weight"],Gu=typeof MutationObserver!="undefined",Du=function(){function e(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=Lu(this.refresh.bind(this),Fu)}return e.prototype.addObserver=function(t){~this.observers_.indexOf(t)||this.observers_.push(t),this.connected_||this.connect_()},e.prototype.removeObserver=function(t){var n=this.observers_,r=n.indexOf(t);~r&&n.splice(r,1),!n.length&&this.connected_&&this.disconnect_()},e.prototype.refresh=function(){var t=this.updateObservers_();t&&this.refresh()},e.prototype.updateObservers_=function(){var t=this.observers_.filter(function(n){return n.gatherActive(),n.hasActive()});return t.forEach(function(n){return n.broadcastActive()}),t.length>0},e.prototype.connect_=function(){!He||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),Gu?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){!He||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(t){var n=t.propertyName,r=n===void 0?"":n,i=Nu.some(function(o){return!!~r.indexOf(o)});i&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),jn=function(e,t){for(var n=0,r=Object.keys(t);n<r.length;n++){var i=r[n];Object.defineProperty(e,i,{value:t[i],enumerable:!1,writable:!1,configurable:!0})}return e},B=function(e){var t=e&&e.ownerDocument&&e.ownerDocument.defaultView;return t||ue},Pn=le(0,0,0,0);function fe(e){return parseFloat(e)||0}function Sn(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return t.reduce(function(r,i){var o=e["border-"+i+"-width"];return r+fe(o)},0)}function Wu(e){for(var t=["top","right","bottom","left"],n={},r=0,i=t;r<i.length;r++){var o=i[r],a=e["padding-"+o];n[o]=fe(a)}return n}function Bu(e){var t=e.getBBox();return le(0,0,t.width,t.height)}function Uu(e){var t=e.clientWidth,n=e.clientHeight;if(!t&&!n)return Pn;var r=B(e).getComputedStyle(e),i=Wu(r),o=i.left+i.right,a=i.top+i.bottom,s=fe(r.width),c=fe(r.height);if(r.boxSizing==="border-box"&&(Math.round(s+o)!==t&&(s-=Sn(r,"left","right")+o),Math.round(c+a)!==n&&(c-=Sn(r,"top","bottom")+a)),!Hu(e)){var f=Math.round(s+o)-t,u=Math.round(c+a)-n;Math.abs(f)!==1&&(s-=f),Math.abs(u)!==1&&(c-=u)}return le(i.left,i.top,s,c)}var zu=function(){return typeof SVGGraphicsElement!="undefined"?function(e){return e instanceof B(e).SVGGraphicsElement}:function(e){return e instanceof B(e).SVGElement&&typeof e.getBBox=="function"}}();function Hu(e){return e===B(e).document.documentElement}function Ku(e){return He?zu(e)?Bu(e):Uu(e):Pn}function Yu(e){var t=e.x,n=e.y,r=e.width,i=e.height,o=typeof DOMRectReadOnly!="undefined"?DOMRectReadOnly:Object,a=Object.create(o.prototype);return jn(a,{x:t,y:n,width:r,height:i,top:n,right:t+r,bottom:i+n,left:t}),a}function le(e,t,n,r){return{x:e,y:t,width:n,height:r}}var Vu=function(){function e(t){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=le(0,0,0,0),this.target=t}return e.prototype.isActive=function(){var t=Ku(this.target);return this.contentRect_=t,t.width!==this.broadcastWidth||t.height!==this.broadcastHeight},e.prototype.broadcastRect=function(){var t=this.contentRect_;return this.broadcastWidth=t.width,this.broadcastHeight=t.height,t},e}(),qu=function(){function e(t,n){var r=Yu(n);jn(this,{target:t,contentRect:r})}return e}(),Xu=function(){function e(t,n,r){if(this.activeObservations_=[],this.observations_=new Rn,typeof t!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=t,this.controller_=n,this.callbackCtx_=r}return e.prototype.observe=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element=="undefined"||!(Element instanceof Object))){if(!(t instanceof B(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)||(n.set(t,new Vu(t)),this.controller_.addObserver(this),this.controller_.refresh())}},e.prototype.unobserve=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element=="undefined"||!(Element instanceof Object))){if(!(t instanceof B(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;!n.has(t)||(n.delete(t),n.size||this.controller_.removeObserver(this))}},e.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},e.prototype.gatherActive=function(){var t=this;this.clearActive(),this.observations_.forEach(function(n){n.isActive()&&t.activeObservations_.push(n)})},e.prototype.broadcastActive=function(){if(!!this.hasActive()){var t=this.callbackCtx_,n=this.activeObservations_.map(function(r){return new qu(r.target,r.broadcastRect())});this.callback_.call(t,n,t),this.clearActive()}},e.prototype.clearActive=function(){this.activeObservations_.splice(0)},e.prototype.hasActive=function(){return this.activeObservations_.length>0},e}(),Mn=typeof WeakMap!="undefined"?new WeakMap:new Rn,En=function(){function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=Du.getInstance(),r=new Xu(t,n,this);Mn.set(this,r)}return e}();["observe","unobserve","disconnect"].forEach(function(e){En.prototype[e]=function(){var t;return(t=Mn.get(this))[e].apply(t,arguments)}}),function(){return typeof ue.ResizeObserver!="undefined"?ue.ResizeObserver:En}();var Ju=Object.defineProperty,xn=Object.getOwnPropertySymbols,Zu=Object.prototype.hasOwnProperty,Qu=Object.prototype.propertyIsEnumerable,In=(e,t,n)=>t in e?Ju(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ku=(e,t)=>{for(var n in t||(t={}))Zu.call(t,n)&&In(e,n,t[n]);if(xn)for(var n of xn(t))Qu.call(t,n)&&In(e,n,t[n]);return e};const he=[".vue",".tsx"],Ke=/\.(vue|tsx)$/,Ye=(e,t=".vue")=>new RegExp(`${t}$`).test(e)?e:`${e}${t}`,Cn=(e,t)=>Object.keys(e).filter(n=>t(n)),Ve=(e,t)=>{const n=Array.isArray(e)?e:[e],r=[];return n.forEach(i=>{const o=new RegExp(i);r.push(...Cn(t,a=>o.test(a)))}),r},Ln=(e,t)=>{const n=ku({},e);return t.forEach(r=>{Reflect.deleteProperty(n,r)}),n},qe=(e,t)=>{if(!e||!t)return!1;if(e===t)return!0;let n=!1;for(let r=0;r<he.length&&(n=Ye(e,he[r])===Ye(t,he[r]),!n);r++);return n};var ef=Object.defineProperty,de=Object.getOwnPropertySymbols,Fn=Object.prototype.hasOwnProperty,Nn=Object.prototype.propertyIsEnumerable,Gn=(e,t,n)=>t in e?ef(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,tf=(e,t)=>{for(var n in t||(t={}))Fn.call(t,n)&&Gn(e,n,t[n]);if(de)for(var n of de(t))Nn.call(t,n)&&Gn(e,n,t[n]);return e},pe=(e,t)=>{var n={};for(var r in e)Fn.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&de)for(var r of de(e))t.indexOf(r)<0&&Nn.call(e,r)&&(n[r]=e[r]);return n},Dn=(e,t,n)=>new Promise((r,i)=>{var o=c=>{try{s(n.next(c))}catch(f){i(f)}},a=c=>{try{s(n.throw(c))}catch(f){i(f)}},s=c=>c.done?r(c.value):Promise.resolve(c.value).then(o,a);s((n=n.apply(e,t)).next())});let Wn=0;const nf=e=>{if(!e)return"";let t="meta: {";return Object.keys(e).forEach(n=>{t+=`${n}: ${fs(e[n])?e[n]?"true":"false":`'${e[n]}'`},`}),t=t.replace(/,$/,""),t+="},",t},rf=e=>e?`redirect: '${e}',`:"",of={page:{indexFileName:"index",detailFileName:"detail",detailParamKey:"id"}};class af{constructor(t,n,r){this.config=t,this.rootModules=n,this.options=r,this.pageModules={},this.pageModulesConfig=[],this.pageSettingModules={},this.pageSetting={},this.validModules={},this.baseModules={},this.excludeModules={},this.nestedRoutesList=[],this.initializeRoutes=[],this.menuRouteMap=new Map,this.menuList=[],this.menuTree=[],this.addedRoutesName=[],this.existRouteNames=new Map}get router(){const t=this.options.router;if(!t)throw new Error("[auto-router] not find router instance");return t}static webpackToViteModules(t,n){const r={};return t.keys().forEach(i=>{let o=t(i);o=o.default||o;const a=n(o);r[a]=()=>Promise.resolve(o),Object.defineProperty(r[a],"name",{value:a})}),r}init(){return Dn(this,null,function*(){this.options=A({},of,this.options),this.validModules=this.initGlobExclude(this.rootModules),Object.keys(this.validModules).filter(i=>Ke.test(i)).forEach(i=>{this.pageModules[i]=this.rootModules[i]});const t=Object.keys(this.validModules).filter(i=>/\.json$/.test(i));(this.config.pages||[]).forEach(i=>{const{component:o}=i,a=o.replace(this.options.baseMenuPath,this.options.basePath);if(he.find(c=>!!this.validModules[`${a}${c}`])){const c=`${a}.json`;this.pageSetting[c]=i}}),yield Promise.all(t.map(i=>Dn(this,null,function*(){try{this.pageSettingModules[i]=this.validModules[i];const a=(yield this.pageSettingModules[i]()).default;delete a.$schema,this.pageSetting[i]=a}catch{throw new Error(`[auto-router] ${i} pares faild`)}}))),this.initBaseRouteInfo();const r=this.initNestedModules(this.pageModules);Object.keys(r).forEach(i=>{this.baseModules[i]=r[i]})})}initGlobExclude(t){const{exclude:n=[]}=this.config,r=Ve(n,t);return this.excludeModuleToOtherModules(t,r,this.excludeModules)}initBaseRouteInfo(){const t=this.pageModules,n=[];Object.keys(t).forEach(r=>{const i=this.getRouteBaseInfo(r);n.push({_path:r,component:t[r],name:i.name,path:i.path,meta:i.meta})}),this.pageModulesConfig=n}initNestedModules(t){let n=tf({},t);const{nestedRoutes:r=[]}=this.config;return r.forEach(i=>{const o=i,{component:a,include:s=[],exclude:c=[]}=o,f=pe(o,["component","include","exclude"]),u=new RegExp(Ye(a,".vue")),d=Cn(t,h=>u.test(h));if(d.length>0){const h=d[0];n=this.excludeModuleToOtherModules(n,d,this.excludeModules),n=this.excludeModuleToOtherModules(n,Ve(c,n),this.baseModules);let l;s?l=Ve(s,n):l=Object.keys(t),this.nestedRoutesList.push({component:h,routeKeys:l,config:f}),l&&l.length>0&&(n=Ln(n,l))}else C(`[auto-router]: ${i.path} not match path`)}),n}initRouter(){this.existRouteNames.clear();let t=[];return t=t.concat(this.initBaseRouter()),t=t.concat(this.initNestedRoutes()),this.initializeRoutes=t,t}getRoutesByMenu(t){const n=this.menuRouteMap.get(t);if(n)return n;this.existRouteNames.clear(),this.menuTree=ns(t);const r=[],i=a=>{a.forEach(s=>{r.push(s),s.children&&s.children.length>0&&i(s.children)})};i(this.menuTree),this.menuList=r;let o=[];return o=o.concat(this.initMenuRoutes()),[o,this.menuTree]}initBaseRouter(t=!1){const n=[];return Object.keys(this.baseModules).forEach(r=>{const i=this.getRouteConfig(r);let o=A({},i);t&&(o=this.mergeRoute(o,r)),o&&n.push(o)}),n}initNestedRoutes(t=!1){let n=[];const r=o=>{const{component:a,routeKeys:s,config:c={}}=o,f=[],u=c,d=pe(u,["component","children"]),h=A({name:`no-name-${++Wn}`,component:this.rootModules[a],children:[]},d||{});return s.forEach(l=>{const p=this.getRouteConfig(l),$=A({},p);h.children.push($)}),f.push(h),f},i=o=>{const{component:a,routeKeys:s,config:c={}}=o,f=[],u=c,d=pe(u,["component","children"]),h=A({name:`no-name-${++Wn}`,component:this.rootModules[a],children:[]},d||{});let l;return s.forEach(p=>{const $=this.getRouteConfig(p);let _=A({},$);if(t&&(_=this.mergeRoute(_,p)),_){const y=this.findMenuIndexPath({name:_.name});if(y){const b=this.menuTree[y[0]];b.name||(b.name=h.name),l=n.find(Q=>Q.name===b.name),l||(l=A({},h,{name:b.name,path:`/${Ht(b.name)}`,redirect:"noRedirect",children:[],meta:b.meta},d),b.path=h.path,n.push(l))}l.children.push(_)}}),f};return this.nestedRoutesList.forEach(o=>{t?n=n.concat(i(o)):n=n.concat(r(o))}),n}initMenuRoutes(){const t=this.menuTree,n=this.pageModulesConfig,r=o=>o.filter(a=>{var s;return!((s=a.path)==null?void 0:s.startsWith("http"))}).map(a=>{const s=a,{component:c,children:f,layoutComponent:u}=s,d=pe(s,["component","children","layoutComponent"]),h=n.find($=>$.name===d.name||qe($._path.replace(this.options.basePath,""),c==null?void 0:c.replace(this.options.baseMenuPath,"")));if(!h){console.error(`[auto-router] ${c} is not find module`);return}let l;f&&f.length>0&&(l=r(f));const p=A({},h,d);if(Reflect.deleteProperty(p,"_path"),p.children=l,u){const $=n.find(y=>qe(y._path.replace(this.options.basePath,""),u==null?void 0:u.replace(this.options.baseMenuPath,"")));return $?{path:`/Layout${p.name.toString()}`,name:`Layout${p.name.toString()}`,component:$.component,redirect:p.path,children:[p]}:(console.error(`[auto-router] ${c}'s layoutComponent is not find module`),p)}return p}).filter(a=>a!==void 0);return r(t)}mergeRoute(t,n){const{name:r}=t,i=this.menuList.find(o=>{var a;return o.name===r||qe(n.replace(this.options.basePath,""),(a=o.component)==null?void 0:a.replace(this.options.baseMenuPath,""))});if(i){const o=i.name||t.name,a=i.path||t.path,s=i.redirect||t.redirect;t.name=i.name=o,t.path=i.path=a,t.redirect=i.redirect=s;const c=Object.assign({},t.meta||{},i.meta);return t.meta=i.meta=c,t}C(`[auto-router] merge fail is: ${t.name} modulePath = ${n}`)}excludeModuleToOtherModules(t,n,r){return n.forEach(i=>r[i]=this.rootModules[i]),Ln(t,n)}removeAddedRoutes(){const t=this.addedRoutesName.slice();this.addedRoutesName=[],t.forEach(n=>this.router.removeRoute(n))}changeRouter(t,n=this.options.lastComponent){const r=i=>{this.router.addRoute(i),this.addedRoutesName.push(i.name)};this.removeAddedRoutes(),t.forEach(i=>{r(i)}),n&&n.forEach(i=>{r(i)})}changeInitializeRoutes(){this.changeRouter(this.initializeRoutes)}getRouteBaseInfo(t,n=this.options.basePath){const r=this.options.page,i=(u,d="")=>{u=[...u];let h=u[u.length-1];if(h===r.indexFileName)u.splice(u.length-1,1),h=u[u.length-1];else if(h===r.detailFileName)u.splice(u.length-1,1),h=u[u.length-1]+"-detail";else if(h.startsWith(":")){const p=h.replace(":","");h=u[u.length-2]+"-"+p,u.splice(u.length-1,1)}h=gs(ds(h))+d;let l=this.existRouteNames.get(h);return l===void 0?(this.existRouteNames.set(h,0),h):(u=u.slice(0,u.length-1),u.length===0?(this.existRouteNames.set(h,l++),`${h}${l}`):i(u,h))},o=this.getPageSetting(t),s=t.replace(n,"").replace(Ke,"").replace(/_([\w-]+)/,":$1").split("/");let c=!1;s[s.length-1].startsWith(":")&&(c=!0);const f=i(s);return s[s.length-1]===r.indexFileName?s.splice(s.length-1):s[s.length-1]===r.detailFileName&&(c=!0,s[s.length-1]=`:${r.detailParamKey}`),A({},{name:f,path:`/${s.map(u=>Ht(u)).join("/")}`,meta:{hidden:c}},o)}getRouteConfig(t){return this.pageModulesConfig.find(n=>n._path===t)}getPageSetting(t){try{t=t.replace(Ke,".json");const n=this.pageSetting[t];if(n)return n}catch(n){console.error(n)}}findMenuIndexPath(t){const n=(r,i,o=[])=>{for(let a=0;a<i.length;a++){const s=o.concat();if(s.push(a),r.name===i[a].name||r.modulePath&&r.modulePath===i[a].component)return s;if(i[a].children){const c=n(r,i[a].children||[],s);if(c)return c}}};return n(t,this.menuTree)}generateRoutes(t,n=!0){if(!t)return"[]";let r="";return n?r+="export default [":r+="[",t.forEach(i=>{r+=`{ name: '${i.name}', path: '${i.path}', ${rf(i.redirect)} component: () => import('${i.component.name}'), ${nf(i.meta)} children: ${this.generateRoutes(i.children,!1)} },`}),r=r.replace(/,$/,""),r+="]",r}}const sf="0.1.4";m.AutoRouter=af,m.version=sf,Object.defineProperty(m,"__esModule",{value:!0})});