utils-lib-js 2.0.24 → 2.2.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.
@@ -1,5 +1,5 @@
1
- import { IRandomNum, IUrlSplit, IUrlJoin, IGetType, IGetTypeByList } from "./types";
2
1
  import { types } from "./static";
2
+ import { IGetType, IGetTypeByList, IRandomNum, IUrlJoin, IUrlSplit } from "./types";
3
3
  export declare const randomNum: IRandomNum;
4
4
  export declare const urlSplit: IUrlSplit;
5
5
  export declare const urlJoin: IUrlJoin;
@@ -61,7 +61,7 @@ declare const _default: {
61
61
  setValue: import("./types").ISetValue;
62
62
  mixIn: import("./types").IMixIn;
63
63
  enumInversion: import("./types").IEnumInversion;
64
- isNotObject: (source: any, type: any) => boolean;
64
+ isNotObject: (source: any, type: string) => boolean;
65
65
  cloneDeep: import("./types").ICloneDeep;
66
66
  createObjectVariable: import("./types").ICreateObjectVariable;
67
67
  createObject: import("./types").ICreateObject;
@@ -71,7 +71,7 @@ declare const _default: {
71
71
  stringToJson: import("./types").IStringToJson;
72
72
  jsonToString: import("./types").IJsonToString;
73
73
  isWindow: (win: any) => boolean;
74
- emptyObject: (init?: import("./types").IObject<unknown>) => any;
75
- isEmptyObject: (object?: import("./types").IObject<unknown>) => boolean;
74
+ emptyObject: (init?: import("./types").IObject<unknown, import("./types").IKey>) => any;
75
+ isEmptyObject: (object?: import("./types").IObject<unknown, import("./types").IKey>) => boolean;
76
76
  };
77
77
  export default _default;
@@ -1,4 +1,4 @@
1
- var UtilsLib=function(e,t,n,r){"use strict";var o=function(){return o=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},o.apply(this,arguments)};function i(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}e.types=void 0,function(e){e["[object Array]"]="array",e["[object Object]"]="object",e["[object Function]"]="function",e["[object Set]"]="set",e["[object Map]"]="map",e["[object WeakMap]"]="weakMap",e["[object WeakSet]"]="weakSet",e["[object Date]"]="date",e["[object RegExp]"]="regExp",e["[object Math]"]="math"}(e.types||(e.types={}));var u={types:e.types},a=function(e,t,n){return void 0===n&&(n=!1),Math.floor(Math.random()*(t-e+(n?1:0))+e)},c=function(e){var t={};return e.includes("?")?(e.split("?")[1].split("&").forEach((function(e){var n=e.split("=")[0];t[n]=e.split("=")[1]})),t):t},s=function(e,t){void 0===t&&(t={});var n=Object.keys(t);if(0===n.length)return e;var r=n.map((function(e){return"".concat(e,"=").concat(t[e])}));return"".concat(e).concat(e.includes("?")?"&":"?").concat(r.join("&"))},l=function(t){var n=typeof t;if(null===t)return"null";if("object"===n){var r=Object.prototype.toString.call(t);return e.types[r]}return n},f=function(e,t){void 0===t&&(t=[]);var n=l(e);return t.indexOf(n)>0},p=function(e,t){return void 0===t&&(t="-"),e.replace(/[A-Z]/g,(function(e){return"".concat(t).concat(e.toLowerCase())}))},h={randomNum:a,urlSplit:c,urlJoin:s,getType:l,getTypeByList:f,toKebabCase:p},d=function(e,t,n){void 0===n&&(n="");for(var r=0,o=t.split(".");r<o.length;r++){if(void 0===(e=e[o[r]]))return n}return e},v=function(e,t,n){void 0===n&&(n={});for(var r=t.split("."),o=r[r.length-1],i=e,u=0,a=r;u<a.length;u++){var c=a[u];if("object"!=typeof i&&void 0!==i)return e;!i&&(i={}),!i[c]&&(i[c]={}),o===c&&(i[o]=n),i=i[c]}return e},y=function(e,t,n){var r;for(var o in void 0===t&&(t={}),void 0===n&&(n=!1),t)for(var i in t[o]){var u=null!==(r=e.prototype)&&void 0!==r?r:e;(void 0===e[i]||n)&&(u[i]=t[o][i])}return e},g=function(e){for(var t in e){var n=e[t];"string"!=typeof n||e[n]||(e[n]=t)}return e},b=function(e,t){return"object"!=typeof e||"null"===t},m=function(e){var t=l(e);if(b(e,t))return e;var n=w(t,e);return"map"===t?e.forEach((function(e,t){n.set(t,m(e))})):"set"===t?e.forEach((function(e){n.add(m(e))})):Reflect.ownKeys(e).forEach((function(t){var r=e[t];n[t]=m(r)})),n},w=function(e,t){switch(void 0===t&&(t={}),e){case"array":return[];case"function":return t;case"set":return new Set;case"map":return new Map;case"date":return new Date(t);case"regExp":return new RegExp(t);case"math":return Math;default:return{}}},j=function(e){function t(){}return t.prototype=e,new t},E=function(e,t){return void 0===t&&(t=function(){}),t.prototype=j(e.prototype),t.prototype.super=e,t.prototype.constructor=t,t},O=function(e,t){void 0===t&&(t=!1);for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return e._instance&&!t||(e._instance=new(e.bind.apply(e,i([void 0],n,!1)))),e._instance},T=function(e){return function(t){for(var n in e)Reflect.has(t.prototype,n)||(t.prototype[n]=e[n])}},S=function(e){if("string"!==l(e))return null;try{return JSON.parse(e)}catch(e){return null}},P=function(e){if(!f(e,["array","object","set","map"]))return"";try{return JSON.stringify(e)}catch(e){return""}},x=function(e){return e&&e===e.window},q=function(e){void 0===e&&(e={});var t=Object.create(null);return Reflect.ownKeys(e).forEach((function(n){return t[n]=e[n]})),t},k=function(e){void 0===e&&(e={});var t=q(e);return Reflect.ownKeys(t).length<=0},A={getValue:d,setValue:v,mixIn:y,enumInversion:g,isNotObject:b,cloneDeep:m,createObjectVariable:w,createObject:j,inherit:E,getInstance:O,classDecorator:T,stringToJson:S,jsonToString:P,isWindow:x,emptyObject:q,isEmptyObject:k},H=function(e){return e.sort((function(){return Math.random()-.5}))},L=function(e){return Array.from(new Set(e))},M=function(e,t){return void 0===t&&(t=[]),e.forEach((function(e){return"array"===l(e)?M(e,t):t.push(e)})),t},C=function(e,t){return void 0===t&&(t=0),{item:e[t],current:(t+1)%e.length}},D={arrayRandom:H,arrayUniq:L,arrayDemote:M,arrayLoop:C},B=void 0,I=function(e,t){var n=null;return function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];n||(n=setTimeout((function(){e.call.apply(e,i([B],r,!1)),n=null}),t))}},R=function(e,t){var n=null;return function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];n&&(clearTimeout(n),n=null),n=setTimeout((function(){e.call.apply(e,i([B],r,!1))}),t)}},_=function(e){var t,n;return void 0===e&&(e=0),{promise:new Promise((function(r,o){t=r,n=o,e>0&&setTimeout((function(){return n("timeout")}),e)})),resolve:t,reject:n}},F=function(e){return e.then((function(e){return[null,e]})).catch((function(e){return[e]}))},N={throttle:I,debounce:R,defer:_,catchAwait:F},W=function(e){var t,n,r=e.ele,o=e.style,i=e.attr,u=e.parent,a=r instanceof HTMLElement?r:document.createElement(null!=r?r:"div");return o&&(null===(t=Object.keys(o))||void 0===t||t.forEach((function(e){return a.style[e]=o[e]}))),i&&(null===(n=Object.keys(i))||void 0===n||n.forEach((function(e){return a[e]=i[e]}))),u&&u.appendChild(a),a},J={createElement:W},V=function(e,t,n){e.addEventListener?e.addEventListener(t,n,!1):e["on"+t]=n},G=function(e){(e=e||window.event).stopPropagation?e.stopPropagation():e.cancelBubble=!1},U=function(e){(e=e||window.event).preventDefault?e.preventDefault():e.returnValue=!1},z=function(e,t,n){e.removeEventListener?e.removeEventListener(t,n,!1):e["on"+t]=null},Q=function(e,t){var n=new Event(t);e.dispatchEvent(n)},K={addHandler:V,stopBubble:G,stopDefault:U,removeHandler:z,dispatchEvent:Q},$=function(e,t){try{localStorage.setItem(e,JSON.stringify(t))}catch(e){console.error(e)}},Y=function(e){try{var t=localStorage.getItem(e);return null==t?null:JSON.parse(t)}catch(e){return console.error(e),null}},Z=function(e){try{e&&localStorage.removeItem(e),!e&&localStorage.clear()}catch(e){console.error(e)}},X={setStorage:$,getStorage:Y,clearStorage:Z},ee=function(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!0),t&&(process.stdout.clearLine(0),process.stdout.cursorTo(0)),process.stdout.write(e),n&&process.stdout.write("\n")},te=function(e){return ee(e,!0,!1)},ne=["\\","|","/","—","—"],re=function(e){var t;void 0===e&&(e={});var n=e.loopList,r=void 0===n?ne:n,o=e.isStop,i=void 0!==o&&o,u=e.timer,a=void 0===u?100:u,c=e.index,s=void 0===c?0:c,l=null!==(t=null==r?void 0:r.length)&&void 0!==t?t:0;if(!l)return e;if(i)return te("\n");s>=l-1&&(s=0);var f=r[s++];return te(f),setTimeout((function(){e.index=s,re(e)}),a),e},oe={logOneLine:ee,logLoop:re},ie=function(){function e(e){this.fn=e,this.id=null,this.duration=1/0,this.isActive=!1}return e.prototype.start=function(e){if(!this.isActive)return this.duration=null!=e?e:1/0,this.isActive=!0,this.animate()},e.prototype.stop=function(e){void 0===e&&(e=this.id),this.isActive=!1,cancelAnimationFrame(e)},e.prototype.animate=function(e){if(void 0===e&&(e=0),this.isActive&&this.duration-- >0)return this.fn(e),this.id=requestAnimationFrame(this.animate.bind(this)),this.id},e}();function ue(e,t,n){var r=1-n,o=n*n;return[2*r*n*e+o,2*r*n*t+o]}function ae(e,t,n,r,o){var i=3*e,u=3*t,a=3*(n-e)-i,c=3*(r-t)-u,s=1-u-c;return[(1-i-a)*Math.pow(o,3)+a*Math.pow(o,2)+i*o,s*Math.pow(o,3)+c*Math.pow(o,2)+u*o]}function ce(e){return 0===e||1===e?1:e*ce(e-1)}function se(e,t){return ce(e)/(ce(t)*ce(e-t))}function le(e,t){for(var n=e.length-1,r=[0,0],o=0;o<=n;o++){var i=se(n,o)*Math.pow(1-t,n-o)*Math.pow(t,o);r[0]+=i*e[o][0],r[1]+=i*e[o][1]}return r}var fe,pe={AnimateFrame:ie,quadraticBezier:ue,cubicBezier:ae,factorial:ce,combination:se,NBezier:le},he=function(){function e(e){void 0===e&&(e={}),this.options=e,this.events=Object.create(null)}return e.prototype.on=function(e,t){return this.checkHandler(e,t),this.getHandler(e,[]).push(t),this},e.prototype.emit=function(e,t){return this.has(e)&&this.runHandler(e,t),this},e.prototype.un=function(e,t){return this.unHandler(e,t),this},e.prototype.once=function(e,t){var n=this;this.checkHandler(e,t);var r=function(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];return n.un(e,r),t.apply(void 0,o)};return this.on(e,r),this},e.prototype.clear=function(){return this.events=Object.create(null),this},e.prototype.has=function(e){return!!this.getHandler(e)},e.prototype.getHandler=function(e,t){var n;return"object"==typeof t&&(this.events[e]=null!==(n=this.events[e])&&void 0!==n?n:t),this.events[e]},e.prototype.handlerLength=function(e){var t,n;return null!==(n=null===(t=this.getHandler(e))||void 0===t?void 0:t.length)&&void 0!==n?n:0},e.prototype.watch=function(e,t){var n=this;this.checkHandler(e,t);return this.on(e,(function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];n.emit(n.prefixStr(e),t.apply(void 0,r))})),this},e.prototype.invoke=function(e,t){var n=this;return new Promise((function(r){n.once(n.prefixStr(e),r),n.emit(e,t)}))},e.prototype.runHandler=function(e,t){for(var n=0,r=this.getHandler(e);n<r.length;n++){var o=r[n];o&&o(t)}},e.prototype.unHandler=function(e,t){var n=this.getHandler(e);!t&&(this.events[e]=[]),t&&this.checkHandler(e,t);for(var r=0;r<n.length;r++)n&&n[r]===t&&(n[r]=null)},e.prototype.prefixStr=function(e){return"@".concat(e)},e.prototype.checkHandler=function(e,t){var n=this.options,r=n.blackList,o=void 0===r?[]:r,i=n.maxLen,u=void 0===i?1/0:i,a=this.handlerLength(e);if(0===(null==e?void 0:e.length))throw new Error("type.length can not be 0");if(!t||!e)throw new ReferenceError("type or handler is not defined");if("function"!=typeof t||"string"!=typeof e)throw new TypeError("".concat(t," is not a function or ").concat(e," is not a string"));if(o.includes(e))throw new Error("".concat(e," is not allow"));if(u<=a)throw new Error("the number of ".concat(e," must be less than ").concat(u))},e.Instance=function(e){return e._instance||Object.defineProperty(e,"_instance",{value:new e}),e._instance},e}(),de=he.Instance(he),ve=function(){return ve=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},ve.apply(this,arguments)};function ye(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}!function(e){e["[object Array]"]="array",e["[object Object]"]="object",e["[object Function]"]="function",e["[object Set]"]="set",e["[object Map]"]="map",e["[object WeakMap]"]="weakMap",e["[object WeakSet]"]="weakSet",e["[object Date]"]="date",e["[object RegExp]"]="regExp",e["[object Math]"]="math"}(fe||(fe={}));var ge={types:fe},be=function(e){var t=typeof e;if(null===e)return"null";if("object"===t){var n=Object.prototype.toString.call(e);return fe[n]}return t},me=function(e,t){void 0===t&&(t=[]);var n=be(e);return t.indexOf(n)>0},we={randomNum:function(e,t,n){return void 0===n&&(n=!1),Math.floor(Math.random()*(t-e+(n?1:0))+e)},urlSplit:function(e){var t={};return e.includes("?")?(e.split("?")[1].split("&").forEach((function(e){var n=e.split("=")[0];t[n]=e.split("=")[1]})),t):t},urlJoin:function(e,t){void 0===t&&(t={});var n=Object.keys(t);if(0===n.length)return e;var r=n.map((function(e){return"".concat(e,"=").concat(t[e])}));return"".concat(e).concat(e.includes("?")?"&":"?").concat(r.join("&"))},getType:be,getTypeByList:me},je=function(e,t){return"object"!=typeof e||"null"===t},Ee=function(e){var t=be(e);if(je(e,t))return e;var n=Oe(t,e);return"map"===t?e.forEach((function(e,t){n.set(t,Ee(e))})):"set"===t?e.forEach((function(e){n.add(Ee(e))})):Reflect.ownKeys(e).forEach((function(t){var r=e[t];n[t]=Ee(r)})),n},Oe=function(e,t){switch(void 0===t&&(t={}),e){case"array":return[];case"function":return t;case"set":return new Set;case"map":return new Map;case"date":return new Date(t);case"regExp":return new RegExp(t);case"math":return Math;default:return{}}},Te=function(e){function t(){}return t.prototype=e,new t},Se={getValue:function(e,t,n){void 0===n&&(n="");for(var r=0,o=t.split(".");r<o.length;r++){if(void 0===(e=e[o[r]]))return n}return e},setValue:function(e,t,n){void 0===n&&(n={});for(var r=t.split("."),o=r[r.length-1],i=e,u=0,a=r;u<a.length;u++){var c=a[u];if("object"!=typeof i&&void 0!==i)return e;!i&&(i={}),!i[c]&&(i[c]={}),o===c&&(i[o]=n),i=i[c]}return e},mixIn:function(e,t,n){var r;for(var o in void 0===t&&(t={}),void 0===n&&(n=!1),t)for(var i in t[o]){var u=null!==(r=e.prototype)&&void 0!==r?r:e;(void 0===e[i]||n)&&(u[i]=t[o][i])}return e},enumInversion:function(e){for(var t in e){var n=e[t];"string"!=typeof n||e[n]||(e[n]=t)}return e},isNotObject:je,cloneDeep:Ee,createObjectVariable:Oe,createObject:Te,inherit:function(e,t){return void 0===t&&(t=function(){}),t.prototype=Te(e.prototype),t.prototype.super=e,t.prototype.constructor=t,t},getInstance:function(e,t){void 0===t&&(t=!1);for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return e._instance&&!t||(e._instance=new(e.bind.apply(e,ye([void 0],n,!1)))),e._instance},classDecorator:function(e){return function(t){for(var n in e)Reflect.has(t.prototype,n)||(t.prototype[n]=e[n])}},stringToJson:function(e){if("string"!==be(e))return null;try{return JSON.parse(e)}catch(e){return null}},jsonToString:function(e){if(!me(e,["array","object","set","map"]))return"";try{return JSON.stringify(e)}catch(e){return""}},isWindow:function(e){return e&&e===e.window},emptyObject:function(e){void 0===e&&(e={});var t=Object.create(null);return Reflect.ownKeys(e).forEach((function(n){return t[n]=e[n]})),t}},Pe=function(e,t){return void 0===t&&(t=[]),e.forEach((function(e){return"array"===be(e)?Pe(e,t):t.push(e)})),t},xe={arrayRandom:function(e){return e.sort((function(){return Math.random()-.5}))},arrayUniq:function(e){return Array.from(new Set(e))},arrayDemote:Pe},qe=void 0,ke=function(e){var t,n;return void 0===e&&(e=0),{promise:new Promise((function(r,o){t=r,n=o,e>0&&setTimeout((function(){return n("timeout")}),e)})),resolve:t,reject:n}},Ae={throttle:function(e,t){var n=null;return function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];n||(n=setTimeout((function(){e.call.apply(e,ye([qe],r,!1)),n=null}),t))}},debounce:function(e,t){var n=null;return function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];n&&(clearTimeout(n),n=null),n=setTimeout((function(){e.call.apply(e,ye([qe],r,!1))}),t)}},defer:ke,catchAwait:function(e){return e.then((function(e){return[null,e]})).catch((function(e){return[e]}))}},He={createElement:function(e){var t,n,r=e.ele,o=e.style,i=e.attr,u=e.parent,a=r instanceof HTMLElement?r:document.createElement(null!=r?r:"div");return o&&(null===(t=Object.keys(o))||void 0===t||t.forEach((function(e){return a.style[e]=o[e]}))),i&&(null===(n=Object.keys(i))||void 0===n||n.forEach((function(e){return a[e]=i[e]}))),u&&u.appendChild(a),a}},Le={addHandler:function(e,t,n){e.addEventListener?e.addEventListener(t,n,!1):e["on"+t]=n},stopBubble:function(e){(e=e||window.event).stopPropagation?e.stopPropagation():e.cancelBubble=!1},stopDefault:function(e){(e=e||window.event).preventDefault?e.preventDefault():e.returnValue=!1},removeHandler:function(e,t,n){e.removeEventListener?e.removeEventListener(t,n,!1):e["on"+t]=null},dispatchEvent:function(e,t){var n=new Event(t);e.dispatchEvent(n)}},Me={setStorage:function(e,t){try{localStorage.setItem(e,JSON.stringify(t))}catch(e){console.error(e)}},getStorage:function(e){try{var t=localStorage.getItem(e);return null==t?null:JSON.parse(t)}catch(e){return console.error(e),null}},clearStorage:function(e){try{e&&localStorage.removeItem(e),!e&&localStorage.clear()}catch(e){console.error(e)}}},Ce=function(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!0),t&&(process.stdout.clearLine(0),process.stdout.cursorTo(0)),process.stdout.write(e),n&&process.stdout.write("\n")},De=function(e){return Ce(e,!0,!1)},Be=["\\","|","/","—","—"],Ie=function(e){var t;void 0===e&&(e={});var n=e.loopList,r=void 0===n?Be:n,o=e.isStop,i=void 0!==o&&o,u=e.timer,a=void 0===u?100:u,c=e.index,s=void 0===c?0:c,l=null!==(t=null==r?void 0:r.length)&&void 0!==t?t:0;if(!l)return e;if(i)return De("\n");s>=l-1&&(s=0);var f=r[s++];return De(f),setTimeout((function(){e.index=s,Ie(e)}),a),e},Re={logOneLine:Ce,logLoop:Ie},_e=function(){function e(e){this.fn=e,this.id=null,this.duration=1/0,this.isActive=!1}return e.prototype.start=function(e){if(!this.isActive)return this.duration=null!=e?e:1/0,this.isActive=!0,this.animate()},e.prototype.stop=function(e){void 0===e&&(e=this.id),this.isActive=!1,cancelAnimationFrame(e)},e.prototype.animate=function(e){if(void 0===e&&(e=0),this.isActive&&this.duration-- >0)return this.fn(e),this.id=requestAnimationFrame(this.animate.bind(this)),this.id},e}();function Fe(e){return 0===e||1===e?1:e*Fe(e-1)}function Ne(e,t){return Fe(e)/(Fe(t)*Fe(e-t))}var We={AnimateFrame:_e,quadraticBezier:function(e,t,n){var r=1-n,o=n*n;return[2*r*n*e+o,2*r*n*t+o]},cubicBezier:function(e,t,n,r,o){var i=3*e,u=3*t,a=3*(n-e)-i,c=3*(r-t)-u,s=1-u-c;return[(1-i-a)*Math.pow(o,3)+a*Math.pow(o,2)+i*o,s*Math.pow(o,3)+c*Math.pow(o,2)+u*o]},factorial:Fe,combination:Ne,NBezier:function(e,t){for(var n=e.length-1,r=[0,0],o=0;o<=n;o++){var i=Ne(n,o)*Math.pow(1-t,n-o)*Math.pow(t,o);r[0]+=i*e[o][0],r[1]+=i*e[o][1]}return r}},Je=function(){function e(e){void 0===e&&(e={}),this.options=e,this.events={}}return e.prototype.on=function(e,t){return this.checkHandler(e,t),this.getHandler(e,[]).push(t),this},e.prototype.emit=function(e,t){return this.has(e)&&this.runHandler(e,t),this},e.prototype.un=function(e,t){return this.unHandler(e,t),this},e.prototype.once=function(e,t){var n=this;this.checkHandler(e,t);var r=function(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];return n.un(e,r),t.apply(void 0,o)};return this.on(e,r),this},e.prototype.clear=function(){return this.events={},this},e.prototype.has=function(e){return!!this.getHandler(e)},e.prototype.getHandler=function(e,t){var n;return"object"==typeof t&&(this.events[e]=null!==(n=this.events[e])&&void 0!==n?n:t),this.events[e]},e.prototype.handlerLength=function(e){var t,n;return null!==(n=null===(t=this.getHandler(e))||void 0===t?void 0:t.length)&&void 0!==n?n:0},e.prototype.watch=function(e,t){var n=this;this.checkHandler(e,t);return this.on(e,(function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];n.emit(n.prefixStr(e),t.apply(void 0,r))})),this},e.prototype.invoke=function(e,t){var n=this;return new Promise((function(r){n.once(n.prefixStr(e),r),n.emit(e,t)}))},e.prototype.runHandler=function(e,t){for(var n=0,r=this.getHandler(e);n<r.length;n++){var o=r[n];o&&o(t)}},e.prototype.unHandler=function(e,t){var n=this.getHandler(e);!t&&(this.events[e]=[]),t&&this.checkHandler(e,t);for(var r=0;r<n.length;r++)n&&n[r]===t&&(n[r]=null)},e.prototype.prefixStr=function(e){return"@".concat(e)},e.prototype.checkHandler=function(e,t){var n=this.options,r=n.blackList,o=void 0===r?[]:r,i=n.maxLen,u=void 0===i?1/0:i,a=this.handlerLength(e);if(0===(null==e?void 0:e.length))throw new Error("type.length can not be 0");if(!t||!e)throw new ReferenceError("type or handler is not defined");if("function"!=typeof t||"string"!=typeof e)throw new TypeError("".concat(t," is not a function or ").concat(e," is not a string"));if(o.includes(e))throw new Error("".concat(e," is not allow"));if(u<=a)throw new Error("the number of ".concat(e," must be less than ").concat(u))},e.Instance=function(e){return e._instance||Object.defineProperty(e,"_instance",{value:new e}),e._instance},e}();Je.Instance(Je);var Ve,Ge=function(e){return e.prototype.messageCenter||(e.prototype.messageCenter=new Je),e},Ue=function(){return Ue=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Ue.apply(this,arguments)},ze=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},Qe=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function u(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(u,a)}c((r=r.apply(e,t||[])).next())}))},Ke=function(e,t){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(a){return function(c){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,a[0]&&(u=0)),u;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return u.label++,{value:a[1],done:!1};case 5:u.label++,r=a[1],a=[0];continue;case 7:a=u.ops.pop(),u.trys.pop();continue;default:if(!(o=u.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){u=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){u.label=a[1];break}if(6===a[0]&&u.label<o[1]){u.label=o[1],o=a;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(a);break}o[2]&&u.ops.pop(),u.trys.pop();continue}a=t.call(e,u)}catch(e){a=[6,e],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}},$e=function(){function e(e){var t=this;this.fix="@~&$",this.init=function(){t.messageCenter.on("push:handler",t.run),t.messageCenter.on("run:success:handler",t.run),t.messageCenter.on("run:success:handler",t.finish),t.messageCenter.on("run:error:handler",t.run),t.messageCenter.on("run:error:handler",t.finish)},this.defineProps=function(e,n){Object.defineProperty(t,n,{value:e})},this.push=function(e){var n;t.checkHandler(e);var r=(n=t.defer()).resolve,o=n.reject,i=n.promise,u=t.fixStr(e.name);return t.queues=t.queues.concat(e.children.map((function(e){return{defer:e,name:u}}))),t.queueTemp[u]=Ue(Ue({},e),{result:[]}),t.messageCenter.emit("push:handler",o),t.messageCenter.on(u,r),i},this.unshift=function(e){return t.queues.splice(0,e)},this.run=function(e){var n=e.reject;return Qe(t,void 0,void 0,(function(){var e,t,r,o,i;return Ke(this,(function(u){switch(u.label){case 0:if("pending"===this.stateProxy())return[2,void 0];if(0===this.queues.length)return[2,this.stateProxy("idle")];this.stateProxy("pending"),e=this.unshift(null!==(i=null===(o=this.props)||void 0===o?void 0:o.maxLen)&&void 0!==i?i:10),u.label=1;case 1:return u.trys.push([1,3,,4]),[4,Promise.all(e.map((function(e,t){return e.defer().catch((function(e){return e}))})))];case 2:return t=u.sent(),[2,this.handlerSuccess({res:t,queues:e})];case 3:return r=u.sent(),[2,this.handlerError({reject:n,error:r,queues:e})];case 4:return[2]}}))}))},this.clear=function(){t.queues=[],t.queueTemp={},t.props=null,t.stateProxy("idle"),t.messageCenter.clear()},this.finish=function(e){var n=e.res,r=void 0===n?[]:n,o=e.queues,i=e.error,u=void 0===i?"err":i,a=t.queueTemp;o.forEach((function(e,n){var o,i,c,s=a[e.name];null==s||s.result.push(null!==(o=r[n])&&void 0!==o?o:u),(null===(i=null==s?void 0:s.result)||void 0===i?void 0:i.length)===(null===(c=null==s?void 0:s.children)||void 0===c?void 0:c.length)&&(t.messageCenter.emit(e.name,null==s?void 0:s.result),a[e.name]=null)}))},this.handlerSuccess=function(e){return t.stateProxy("fulfilled"),t.messageCenter.emit("run:success:handler",e)},this.handlerError=function(e){var n=e.reject,r=e.error;return t.stateProxy("rejected"),n&&"function"==typeof n&&n(r),t.messageCenter.emit("run:error:handler",e)},this.stateProxy=function(e){return e&&(t.state=e),t.state},this.defer=function(){var e,t;return{promise:new Promise((function(n,r){e=n,t=r})),resolve:e,reject:t}},this.clear(),e&&this.defineProps(e,"props"),this.init()}return e.prototype.checkHandler=function(e){var t,n;if(!e)throw new ReferenceError("queue is not defined");if(!(e.children instanceof Array)||"object"!=typeof e)throw new TypeError("queue should be an object and queue.children should be an array");if(0===(null===(t=e.children)||void 0===t?void 0:t.length))throw new Error("queue.children.length can not be 0");if(null===(n=e.children)||void 0===n?void 0:n.find((function(e){return function(e){return!e||"function"!=typeof e}(e)})))throw new Error("queueList should have defer")},e.prototype.fixStr=function(e){return"".concat(this.fix).concat(e)},e=function(e,t,n,r){var o,i=arguments.length,u=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)u=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(u=(i<3?o(u):i>3?o(t,n,u):o(t,n))||u);return i>3&&u&&Object.defineProperty(t,n,u),u}([Ge,ze("design:paramtypes",[Object])],e),e}(),Ye=function(){return Ye=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Ye.apply(this,arguments)};function Ze(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}!function(e){e["[object Array]"]="array",e["[object Object]"]="object",e["[object Function]"]="function",e["[object Set]"]="set",e["[object Map]"]="map",e["[object WeakMap]"]="weakMap",e["[object WeakSet]"]="weakSet",e["[object Date]"]="date",e["[object RegExp]"]="regExp",e["[object Math]"]="math"}(Ve||(Ve={}));var Xe={types:Ve},et=function(e,t){void 0===t&&(t={});var n=Object.keys(t);if(0===n.length)return e;var r=n.map((function(e){return"".concat(e,"=").concat(t[e])}));return"".concat(e).concat(e.includes("?")?"&":"?").concat(r.join("&"))},tt=function(e){var t=typeof e;if(null===e)return"null";if("object"===t){var n=Object.prototype.toString.call(e);return Ve[n]}return t},nt=function(e,t){void 0===t&&(t=[]);var n=tt(e);return t.indexOf(n)>0},rt={randomNum:function(e,t,n){return void 0===n&&(n=!1),Math.floor(Math.random()*(t-e+(n?1:0))+e)},urlSplit:function(e){var t={};return e.includes("?")?(e.split("?")[1].split("&").forEach((function(e){var n=e.split("=")[0];t[n]=e.split("=")[1]})),t):t},urlJoin:et,getType:tt,getTypeByList:nt},ot=function(e,t){return"object"!=typeof e||"null"===t},it=function(e){var t=tt(e);if(ot(e,t))return e;var n=ut(t,e);return"map"===t?e.forEach((function(e,t){n.set(t,it(e))})):"set"===t?e.forEach((function(e){n.add(it(e))})):Reflect.ownKeys(e).forEach((function(t){var r=e[t];n[t]=it(r)})),n},ut=function(e,t){switch(void 0===t&&(t={}),e){case"array":return[];case"function":return t;case"set":return new Set;case"map":return new Map;case"date":return new Date(t);case"regExp":return new RegExp(t);case"math":return Math;default:return{}}},at=function(e){function t(){}return t.prototype=e,new t},ct=function(e){if("string"!==tt(e))return null;try{return JSON.parse(e)}catch(e){return null}},st=function(e){if(!nt(e,["array","object","set","map"]))return"";try{return JSON.stringify(e)}catch(e){return""}},lt={getValue:function(e,t,n){void 0===n&&(n="");for(var r=0,o=t.split(".");r<o.length;r++){if(void 0===(e=e[o[r]]))return n}return e},setValue:function(e,t,n){void 0===n&&(n={});for(var r=t.split("."),o=r[r.length-1],i=e,u=0,a=r;u<a.length;u++){var c=a[u];if("object"!=typeof i&&void 0!==i)return e;!i&&(i={}),!i[c]&&(i[c]={}),o===c&&(i[o]=n),i=i[c]}return e},mixIn:function(e,t,n){var r;for(var o in void 0===t&&(t={}),void 0===n&&(n=!1),t)for(var i in t[o]){var u=null!==(r=e.prototype)&&void 0!==r?r:e;(void 0===e[i]||n)&&(u[i]=t[o][i])}return e},enumInversion:function(e){for(var t in e){var n=e[t];"string"!=typeof n||e[n]||(e[n]=t)}return e},isNotObject:ot,cloneDeep:it,createObjectVariable:ut,createObject:at,inherit:function(e,t){return void 0===t&&(t=function(){}),t.prototype=at(e.prototype),t.prototype.super=e,t.prototype.constructor=t,t},getInstance:function(e,t){void 0===t&&(t=!1);for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return e._instance&&!t||(e._instance=new(e.bind.apply(e,Ze([void 0],n,!1)))),e._instance},classDecorator:function(e){return function(t){for(var n in e)Reflect.has(t.prototype,n)||(t.prototype[n]=e[n])}},stringToJson:ct,jsonToString:st,isWindow:function(e){return e&&e===e.window}},ft=function(e,t){return void 0===t&&(t=[]),e.forEach((function(e){return"array"===tt(e)?ft(e,t):t.push(e)})),t},pt={arrayRandom:function(e){return e.sort((function(){return Math.random()-.5}))},arrayUniq:function(e){return Array.from(new Set(e))},arrayDemote:ft},ht=void 0,dt=function(e){var t,n;return void 0===e&&(e=0),e>0&&setTimeout(n,e),{promise:new Promise((function(e,r){t=e,n=r})),resolve:t,reject:n}},vt={throttle:function(e,t){var n=null;return function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];n||(n=setTimeout((function(){e.call.apply(e,Ze([ht],r,!1)),n=null}),t))}},debounce:function(e,t){var n=null;return function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];n&&(clearTimeout(n),n=null),n=setTimeout((function(){e.call.apply(e,Ze([ht],r,!1))}),t)}},defer:dt,catchAwait:function(e){return e.then((function(e){return[null,e]})).catch((function(e){return[e]}))}},yt={createElement:function(e){var t,n,r=e.ele,o=e.style,i=e.attr,u=e.parent,a=r instanceof HTMLElement?r:document.createElement(null!=r?r:"div");return o&&(null===(t=Object.keys(o))||void 0===t||t.forEach((function(e){return a.style[e]=o[e]}))),i&&(null===(n=Object.keys(i))||void 0===n||n.forEach((function(e){return a[e]=i[e]}))),u&&u.appendChild(a),a}},gt={addHandler:function(e,t,n){e.addEventListener?e.addEventListener(t,n,!1):e["on"+t]=n},stopBubble:function(e){(e=e||window.event).stopPropagation?e.stopPropagation():e.cancelBubble=!1},stopDefault:function(e){(e=e||window.event).preventDefault?e.preventDefault():e.returnValue=!1},removeHandler:function(e,t,n){e.removeEventListener?e.removeEventListener(t,n,!1):e["on"+t]=null},dispatchEvent:function(e,t){var n=new Event(t);e.dispatchEvent(n)}},bt={setStorage:function(e,t){try{localStorage.setItem(e,JSON.stringify(t))}catch(e){console.error(e)}},getStorage:function(e){try{var t=localStorage.getItem(e);return null==t?null:JSON.parse(t)}catch(e){return console.error(e),null}},clearStorage:function(e){try{e&&localStorage.removeItem(e),!e&&localStorage.clear()}catch(e){console.error(e)}}},mt=function(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!0),t&&(process.stdout.clearLine(0),process.stdout.cursorTo(0)),process.stdout.write(e),n&&process.stdout.write("\n")},wt=function(e){return mt(e,!0,!1)},jt=["\\","|","/","—","—"],Et=function(e){var t;void 0===e&&(e={});var n=e.loopList,r=void 0===n?jt:n,o=e.isStop,i=void 0!==o&&o,u=e.timer,a=void 0===u?100:u,c=e.index,s=void 0===c?0:c,l=null!==(t=null==r?void 0:r.length)&&void 0!==t?t:0;if(!l)return e;if(i)return wt("\n");s>=l-1&&(s=0);var f=r[s++];return wt(f),setTimeout((function(){e.index=s,Et(e)}),a),e},Ot={logOneLine:mt,logLoop:Et},Tt=function(){function e(e){this.fn=e,this.id=null,this.duration=1/0,this.isActive=!1}return e.prototype.start=function(e){this.isActive||(this.duration=null!=e?e:1/0,this.isActive=!0,this.animate())},e.prototype.stop=function(){this.isActive=!1,cancelAnimationFrame(this.id)},e.prototype.animate=function(e){void 0===e&&(e=0),this.isActive&&this.duration-- >0&&(this.fn(e),this.id=requestAnimationFrame(this.animate.bind(this)))},e}();function St(e){return 0===e||1===e?1:e*St(e-1)}function Pt(e,t){return St(e)/(St(t)*St(e-t))}var xt={AnimateFrame:Tt,quadraticBezier:function(e,t,n){var r=1-n,o=n*n;return[2*r*n*e+o,2*r*n*t+o]},cubicBezier:function(e,t,n,r,o){var i=3*e,u=3*t,a=3*(n-e)-i,c=3*(r-t)-u,s=1-u-c;return[(1-i-a)*Math.pow(o,3)+a*Math.pow(o,2)+i*o,s*Math.pow(o,3)+c*Math.pow(o,2)+u*o]},factorial:St,combination:Pt,NBezier:function(e,t){for(var n=e.length-1,r=[0,0],o=0;o<=n;o++){var i=Pt(n,o)*Math.pow(1-t,n-o)*Math.pow(t,o);r[0]+=i*e[o][0],r[1]+=i*e[o][1]}return r}},qt=function(){function e(e){void 0===e&&(e={}),this.options=e,this.events={}}return e.prototype.on=function(e,t){return this.checkHandler(e,t),this.getHandler(e,[]).push(t),this},e.prototype.emit=function(e,t){return this.has(e)&&this.runHandler(e,t),this},e.prototype.un=function(e,t){return this.unHandler(e,t),this},e.prototype.once=function(e,t){var n=this;this.checkHandler(e,t);var r=function(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];return n.un(e,r),t.apply(void 0,o)};return this.on(e,r),this},e.prototype.clear=function(){return this.events={},this},e.prototype.has=function(e){return!!this.getHandler(e)},e.prototype.getHandler=function(e,t){var n;return"object"==typeof t&&(this.events[e]=null!==(n=this.events[e])&&void 0!==n?n:t),this.events[e]},e.prototype.handlerLength=function(e){var t,n;return null!==(n=null===(t=this.getHandler(e))||void 0===t?void 0:t.length)&&void 0!==n?n:0},e.prototype.watch=function(e,t){var n=this;this.checkHandler(e,t);return this.on(e,(function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];n.emit(n.prefixStr(e),t.apply(void 0,r))})),this},e.prototype.invoke=function(e,t){var n=this;return new Promise((function(r){n.once(n.prefixStr(e),r),n.emit(e,t)}))},e.prototype.runHandler=function(e,t){for(var n=0,r=this.getHandler(e);n<r.length;n++){var o=r[n];o&&o(t)}},e.prototype.unHandler=function(e,t){var n=this.getHandler(e);!t&&(this.events[e]=[]),t&&this.checkHandler(e,t);for(var r=0;r<n.length;r++)n&&n[r]===t&&(n[r]=null)},e.prototype.prefixStr=function(e){return"@".concat(e)},e.prototype.checkHandler=function(e,t){var n=this.options,r=n.blackList,o=void 0===r?[]:r,i=n.maxLen,u=void 0===i?1/0:i,a=this.handlerLength(e);if(0===(null==e?void 0:e.length))throw new Error("type.length can not be 0");if(!t||!e)throw new ReferenceError("type or handler is not defined");if("function"!=typeof t||"string"!=typeof e)throw new TypeError("".concat(t," is not a function or ").concat(e," is not a string"));if(o.includes(e))throw new Error("".concat(e," is not allow"));if(u<=a)throw new Error("the number of ".concat(e," must be less than ").concat(u))},e.Instance=function(e){return e._instance||Object.defineProperty(e,"_instance",{value:new e}),e._instance},e}();qt.Instance(qt);var kt=function(e){return e.prototype.messageCenter||(e.prototype.messageCenter=new qt),e},At=function(){return At=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},At.apply(this,arguments)},Ht=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},Lt=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function u(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(u,a)}c((r=r.apply(e,t||[])).next())}))},Mt=function(e,t){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(a){return function(c){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,a[0]&&(u=0)),u;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return u.label++,{value:a[1],done:!1};case 5:u.label++,r=a[1],a=[0];continue;case 7:a=u.ops.pop(),u.trys.pop();continue;default:if(!(o=u.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){u=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){u.label=a[1];break}if(6===a[0]&&u.label<o[1]){u.label=o[1],o=a;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(a);break}o[2]&&u.ops.pop(),u.trys.pop();continue}a=t.call(e,u)}catch(e){a=[6,e],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}},Ct=function(){function e(e){var t=this;this.fix="@~&$",this.init=function(){t.messageCenter.on("push:handler",t.run),t.messageCenter.on("run:success:handler",t.run),t.messageCenter.on("run:success:handler",t.finish),t.messageCenter.on("run:error:handler",t.run),t.messageCenter.on("run:error:handler",t.finish)},this.defineProps=function(e,n){Object.defineProperty(t,n,{value:e})},this.push=function(e){var n;t.checkHandler(e);var r=(n=t.defer()).resolve,o=n.reject,i=n.promise,u=t.fixStr(e.name);return t.queues=t.queues.concat(e.children.map((function(e){return{defer:e,name:u}}))),t.queueTemp[u]=At(At({},e),{result:[]}),t.messageCenter.emit("push:handler",o),t.messageCenter.on(u,r),i},this.unshift=function(e){return t.queues.splice(0,e)},this.run=function(e){var n=e.reject;return Lt(t,void 0,void 0,(function(){var e,t,r,o,i;return Mt(this,(function(u){switch(u.label){case 0:if("pending"===this.stateProxy())return[2,void 0];if(0===this.queues.length)return[2,this.stateProxy("idle")];this.stateProxy("pending"),e=this.unshift(null!==(i=null===(o=this.props)||void 0===o?void 0:o.maxLen)&&void 0!==i?i:10),u.label=1;case 1:return u.trys.push([1,3,,4]),[4,Promise.all(e.map((function(e,t){return e.defer().catch((function(e){return e}))})))];case 2:return t=u.sent(),[2,this.handlerSuccess({res:t,queues:e})];case 3:return r=u.sent(),[2,this.handlerError({reject:n,error:r,queues:e})];case 4:return[2]}}))}))},this.clear=function(){t.queues=[],t.queueTemp={},t.props=null,t.stateProxy("idle"),t.messageCenter.clear()},this.finish=function(e){var n=e.res,r=void 0===n?[]:n,o=e.queues,i=e.error,u=void 0===i?"err":i,a=t.queueTemp;o.forEach((function(e,n){var o,i,c,s=a[e.name];null==s||s.result.push(null!==(o=r[n])&&void 0!==o?o:u),(null===(i=null==s?void 0:s.result)||void 0===i?void 0:i.length)===(null===(c=null==s?void 0:s.children)||void 0===c?void 0:c.length)&&(t.messageCenter.emit(e.name,null==s?void 0:s.result),a[e.name]=null)}))},this.handlerSuccess=function(e){return t.stateProxy("fulfilled"),t.messageCenter.emit("run:success:handler",e)},this.handlerError=function(e){var n=e.reject,r=e.error;return t.stateProxy("rejected"),n&&"function"==typeof n&&n(r),t.messageCenter.emit("run:error:handler",e)},this.stateProxy=function(e){return e&&(t.state=e),t.state},this.defer=function(){var e,t;return{promise:new Promise((function(n,r){e=n,t=r})),resolve:e,reject:t}},this.clear(),e&&this.defineProps(e,"props"),this.init()}return e.prototype.checkHandler=function(e){var t,n;if(!e)throw new ReferenceError("queue is not defined");if(!(e.children instanceof Array)||"object"!=typeof e)throw new TypeError("queue should be an object and queue.children should be an array");if(0===(null===(t=e.children)||void 0===t?void 0:t.length))throw new Error("queue.children.length can not be 0");if(null===(n=e.children)||void 0===n?void 0:n.find((function(e){return function(e){return!e||"function"!=typeof e}(e)})))throw new Error("queueList should have defer")},e.prototype.fixStr=function(e){return"".concat(this.fix).concat(e)},e=function(e,t,n,r){var o,i=arguments.length,u=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)u=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(u=(i<3?o(u):i>3?o(t,n,u):o(t,n))||u);return i>3&&u&&Object.defineProperty(t,n,u),u}([kt,Ht("design:paramtypes",[Object])],e),e}();Ye(Ye(Ye(Ye(Ye(Ye(Ye(Ye(Ye(Ye(Ye({},lt),rt),pt),vt),yt),Xe),gt),bt),Ot),xt),{eventMessageCenter:qt,taskQueueLib:Ct});
1
+ var UtilsLib=function(e,t,n,r){"use strict";var o=function(){return o=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},o.apply(this,arguments)};function i(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}e.types=void 0,function(e){e["[object Array]"]="array",e["[object Object]"]="object",e["[object Function]"]="function",e["[object Set]"]="set",e["[object Map]"]="map",e["[object WeakMap]"]="weakMap",e["[object WeakSet]"]="weakSet",e["[object Date]"]="date",e["[object RegExp]"]="regExp",e["[object Math]"]="math"}(e.types||(e.types={}));var u={types:e.types},a=function(e,t,n){return void 0===n&&(n=!1),Math.floor(Math.random()*(t-e+(n?1:0))+e)},c=function(e){var t={};return e.includes("?")?(e.split("?")[1].split("&").forEach((function(e){var n=e.split("=")[0];t[n]=e.split("=")[1]})),t):t},s=function(e,t){void 0===t&&(t={});var n=Object.keys(t);if(0===n.length)return e;var r=n.map((function(e){return"".concat(e,"=").concat(t[e])}));return"".concat(e).concat(e.includes("?")?"&":"?").concat(r.join("&"))},l=function(t){var n=typeof t;if(null===t)return"null";if("object"===n){var r=Object.prototype.toString.call(t);return e.types[r]}return n},f=function(e,t){void 0===t&&(t=[]);var n=l(e);return t.includes(n)},p=function(e,t){return void 0===t&&(t="-"),e.replace(/[A-Z]/g,(function(e){return"".concat(t).concat(e.toLowerCase())}))},h={randomNum:a,urlSplit:c,urlJoin:s,getType:l,getTypeByList:f,toKebabCase:p},d=function(e,t,n){void 0===n&&(n="");for(var r=0,o=t.split(".");r<o.length;r++){if(void 0===(e=e[o[r]]))return n}return e},v=function(e,t,n){void 0===n&&(n={});for(var r=t.split("."),o=r[r.length-1],i=e,u=0,a=r;u<a.length;u++){var c=a[u];if("object"!=typeof i&&void 0!==i)return e;!i&&(i={}),!i[c]&&(i[c]={}),o===c&&(i[o]=n),i=i[c]}return e},y=function(e,t,n){var r;for(var o in void 0===t&&(t={}),void 0===n&&(n=!1),t)for(var i in t[o]){var u=null!==(r=null==e?void 0:e.prototype)&&void 0!==r?r:e;(void 0===(null==e?void 0:e[i])||n)&&(u[i]=t[o][i])}return e},g=function(e){for(var t in e){var n=e[t];"string"!=typeof n||e[n]||(e[n]=t)}return e},b=function(e,t){return"object"!=typeof e||"null"===t},m=function(e){var t=l(e);if(b(e,t))return e;var n=w(t,e);return"map"===t?e.forEach((function(e,t){n.set(t,m(e))})):"set"===t?e.forEach((function(e){n.add(m(e))})):Reflect.ownKeys(e).forEach((function(t){var r=e[t];n[t]=m(r)})),n},w=function(e,t){switch(void 0===t&&(t={}),e){case"array":return[];case"function":return t;case"set":return new Set;case"map":return new Map;case"date":return new Date(t);case"regExp":return new RegExp(t);case"math":return Math;default:return{}}},j=function(e){function t(){}return t.prototype=e,new t},E=function(e,t){return void 0===t&&(t=function(){}),t.prototype=j(e.prototype),t.prototype.super=e,t.prototype.constructor=t,t},O=function(e,t){void 0===t&&(t=!1);for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return e._instance&&!t||(e._instance=new(e.bind.apply(e,i([void 0],n,!1)))),e._instance},T=function(e){return function(t){for(var n in e)Reflect.has(t.prototype,n)||(t.prototype[n]=e[n])}},S=function(e){if("string"!==l(e))return null;try{return JSON.parse(e)}catch(e){return null}},P=function(e){if(!f(e,["array","object","set","map"]))return"";try{return JSON.stringify(e)}catch(e){return""}},x=function(e){return e&&e===e.window},q=function(e){void 0===e&&(e={});var t=Object.create(null);return Reflect.ownKeys(e).forEach((function(n){return t[n]=e[n]})),t},k=function(e){void 0===e&&(e={});var t=q(e);return Reflect.ownKeys(t).length<=0},A={getValue:d,setValue:v,mixIn:y,enumInversion:g,isNotObject:b,cloneDeep:m,createObjectVariable:w,createObject:j,inherit:E,getInstance:O,classDecorator:T,stringToJson:S,jsonToString:P,isWindow:x,emptyObject:q,isEmptyObject:k},H=function(e){return e.sort((function(){return Math.random()-.5}))},L=function(e){return Array.from(new Set(e))},M=function(e,t){return void 0===t&&(t=[]),e.forEach((function(e){return"array"===l(e)?M(e,t):t.push(e)})),t},C=function(e,t){return void 0===t&&(t=0),{item:e[t],current:(t+1)%e.length}},D={arrayRandom:H,arrayUniq:L,arrayDemote:M,arrayLoop:C},B=void 0,I=function(e,t){var n=null;return function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];n||(n=setTimeout((function(){e.call.apply(e,i([B],r,!1)),n=null}),t))}},R=function(e,t){var n=null;return function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];n&&(clearTimeout(n),n=null),n=setTimeout((function(){e.call.apply(e,i([B],r,!1))}),t)}},_=function(e){var t,n;return void 0===e&&(e=0),{promise:new Promise((function(r,o){t=r,n=o,e>0&&setTimeout((function(){return n("timeout")}),e)})),resolve:t,reject:n}},F=function(e){return e.then((function(e){return[null,e]})).catch((function(e){return[e]}))},N={throttle:I,debounce:R,defer:_,catchAwait:F},W=function(e){var t,n,r=e.ele,o=e.style,i=e.attr,u=e.parent,a=r instanceof HTMLElement?r:document.createElement(null!=r?r:"div");return o&&(null===(t=Object.keys(o))||void 0===t||t.forEach((function(e){return a.style[e]=o[e]}))),i&&(null===(n=Object.keys(i))||void 0===n||n.forEach((function(e){return a[e]=i[e]}))),u&&u.appendChild(a),a},J={createElement:W},V=function(e,t,n){e.addEventListener?e.addEventListener(t,n,!1):e["on"+t]=n},G=function(e){(e=e||window.event).stopPropagation?e.stopPropagation():e.cancelBubble=!1},U=function(e){(e=e||window.event).preventDefault?e.preventDefault():e.returnValue=!1},z=function(e,t,n){if(e.removeEventListener)e.removeEventListener(t,n,!1);else{var r="on"+t;"function"==typeof e[r]&&(e[r]=function(){})}},Q=function(e,t){var n=new Event(t);e.dispatchEvent(n)},K={addHandler:V,stopBubble:G,stopDefault:U,removeHandler:z,dispatchEvent:Q},$=function(e,t){try{localStorage.setItem(e,JSON.stringify(t))}catch(e){console.error(e)}},Y=function(e){try{var t=localStorage.getItem(e);return null==t?null:JSON.parse(t)}catch(e){return console.error(e),null}},Z=function(e){try{e&&localStorage.removeItem(e),!e&&localStorage.clear()}catch(e){console.error(e)}},X={setStorage:$,getStorage:Y,clearStorage:Z},ee=function(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!0),t&&(process.stdout.clearLine(0),process.stdout.cursorTo(0)),process.stdout.write(e),n&&process.stdout.write("\n")},te=function(e){return ee(e,!0,!1)},ne=["\\","|","/","—","—"],re=function(e){var t;void 0===e&&(e={});var n=e.loopList,r=void 0===n?ne:n,o=e.isStop,i=void 0!==o&&o,u=e.timer,a=void 0===u?100:u,c=e.index,s=void 0===c?0:c,l=null!==(t=null==r?void 0:r.length)&&void 0!==t?t:0;if(!l)return e;if(i)return te("\n");s>=l-1&&(s=0);var f=r[s++];return te(f),setTimeout((function(){e.index=s,re(e)}),a),e},oe={logOneLine:ee,logLoop:re},ie=function(){function e(e){this.fn=e,this.id=null,this.duration=1/0,this.isActive=!1}return e.prototype.start=function(e){if(!this.isActive)return this.duration=null!=e?e:1/0,this.isActive=!0,this.animate()},e.prototype.stop=function(e){void 0===e&&(e=this.id),this.isActive=!1,cancelAnimationFrame(e)},e.prototype.animate=function(e){if(void 0===e&&(e=0),this.isActive&&this.duration-- >0)return this.fn(e),this.id=requestAnimationFrame(this.animate.bind(this)),this.id},e}();function ue(e,t,n){var r=1-n,o=n*n;return[2*r*n*e+o,2*r*n*t+o]}function ae(e,t,n,r,o){var i=3*e,u=3*t,a=3*(n-e)-i,c=3*(r-t)-u,s=1-u-c;return[(1-i-a)*Math.pow(o,3)+a*Math.pow(o,2)+i*o,s*Math.pow(o,3)+c*Math.pow(o,2)+u*o]}function ce(e){return 0===e||1===e?1:e*ce(e-1)}function se(e,t){return ce(e)/(ce(t)*ce(e-t))}function le(e,t){for(var n=e.length-1,r=[0,0],o=0;o<=n;o++){var i=se(n,o)*Math.pow(1-t,n-o)*Math.pow(t,o);r[0]+=i*e[o][0],r[1]+=i*e[o][1]}return r}var fe,pe={AnimateFrame:ie,quadraticBezier:ue,cubicBezier:ae,factorial:ce,combination:se,NBezier:le},he=function(){function e(e){void 0===e&&(e={}),this.options=e,this.events=Object.create(null)}return e.prototype.on=function(e,t){return this.checkHandler(e,t),this.getHandler(e,[]).push(t),this},e.prototype.emit=function(e,t){return this.has(e)&&this.runHandler(e,t),this},e.prototype.un=function(e,t){return this.unHandler(e,t),this},e.prototype.once=function(e,t){var n=this;this.checkHandler(e,t);var r=function(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];return n.un(e,r),t.apply(void 0,o)};return this.on(e,r),this},e.prototype.clear=function(){return this.events=Object.create(null),this},e.prototype.has=function(e){return!!this.getHandler(e)},e.prototype.getHandler=function(e,t){var n;return"object"==typeof t&&(this.events[e]=null!==(n=this.events[e])&&void 0!==n?n:t),this.events[e]},e.prototype.handlerLength=function(e){var t,n;return null!==(n=null===(t=this.getHandler(e))||void 0===t?void 0:t.length)&&void 0!==n?n:0},e.prototype.watch=function(e,t){var n=this;this.checkHandler(e,t);return this.on(e,(function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];n.emit(n.prefixStr(e),t.apply(void 0,r))})),this},e.prototype.invoke=function(e,t){var n=this;return new Promise((function(r){n.once(n.prefixStr(e),r),n.emit(e,t)}))},e.prototype.runHandler=function(e,t){for(var n=0,r=this.getHandler(e);n<r.length;n++){var o=r[n];o&&o(t)}},e.prototype.unHandler=function(e,t){var n=this.getHandler(e);!t&&(this.events[e]=[]),t&&this.checkHandler(e,t);for(var r=0;r<n.length;r++)n&&n[r]===t&&(n[r]=null)},e.prototype.prefixStr=function(e){return"@".concat(e)},e.prototype.checkHandler=function(e,t){var n=this.options,r=n.blackList,o=void 0===r?[]:r,i=n.maxLen,u=void 0===i?1/0:i,a=this.handlerLength(e);if(0===(null==e?void 0:e.length))throw new Error("type.length can not be 0");if(!t||!e)throw new ReferenceError("type or handler is not defined");if("function"!=typeof t||"string"!=typeof e)throw new TypeError("".concat(t," is not a function or ").concat(e," is not a string"));if(o.includes(e))throw new Error("".concat(e," is not allow"));if(u<=a)throw new Error("the number of ".concat(e," must be less than ").concat(u))},e.Instance=function(e){return e._instance||Object.defineProperty(e,"_instance",{value:new e}),e._instance},e}(),de=he.Instance(he),ve=function(){return ve=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},ve.apply(this,arguments)};function ye(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}!function(e){e["[object Array]"]="array",e["[object Object]"]="object",e["[object Function]"]="function",e["[object Set]"]="set",e["[object Map]"]="map",e["[object WeakMap]"]="weakMap",e["[object WeakSet]"]="weakSet",e["[object Date]"]="date",e["[object RegExp]"]="regExp",e["[object Math]"]="math"}(fe||(fe={}));var ge={types:fe},be=function(e){var t=typeof e;if(null===e)return"null";if("object"===t){var n=Object.prototype.toString.call(e);return fe[n]}return t},me=function(e,t){void 0===t&&(t=[]);var n=be(e);return t.indexOf(n)>0},we={randomNum:function(e,t,n){return void 0===n&&(n=!1),Math.floor(Math.random()*(t-e+(n?1:0))+e)},urlSplit:function(e){var t={};return e.includes("?")?(e.split("?")[1].split("&").forEach((function(e){var n=e.split("=")[0];t[n]=e.split("=")[1]})),t):t},urlJoin:function(e,t){void 0===t&&(t={});var n=Object.keys(t);if(0===n.length)return e;var r=n.map((function(e){return"".concat(e,"=").concat(t[e])}));return"".concat(e).concat(e.includes("?")?"&":"?").concat(r.join("&"))},getType:be,getTypeByList:me},je=function(e,t){return"object"!=typeof e||"null"===t},Ee=function(e){var t=be(e);if(je(e,t))return e;var n=Oe(t,e);return"map"===t?e.forEach((function(e,t){n.set(t,Ee(e))})):"set"===t?e.forEach((function(e){n.add(Ee(e))})):Reflect.ownKeys(e).forEach((function(t){var r=e[t];n[t]=Ee(r)})),n},Oe=function(e,t){switch(void 0===t&&(t={}),e){case"array":return[];case"function":return t;case"set":return new Set;case"map":return new Map;case"date":return new Date(t);case"regExp":return new RegExp(t);case"math":return Math;default:return{}}},Te=function(e){function t(){}return t.prototype=e,new t},Se={getValue:function(e,t,n){void 0===n&&(n="");for(var r=0,o=t.split(".");r<o.length;r++){if(void 0===(e=e[o[r]]))return n}return e},setValue:function(e,t,n){void 0===n&&(n={});for(var r=t.split("."),o=r[r.length-1],i=e,u=0,a=r;u<a.length;u++){var c=a[u];if("object"!=typeof i&&void 0!==i)return e;!i&&(i={}),!i[c]&&(i[c]={}),o===c&&(i[o]=n),i=i[c]}return e},mixIn:function(e,t,n){var r;for(var o in void 0===t&&(t={}),void 0===n&&(n=!1),t)for(var i in t[o]){var u=null!==(r=e.prototype)&&void 0!==r?r:e;(void 0===e[i]||n)&&(u[i]=t[o][i])}return e},enumInversion:function(e){for(var t in e){var n=e[t];"string"!=typeof n||e[n]||(e[n]=t)}return e},isNotObject:je,cloneDeep:Ee,createObjectVariable:Oe,createObject:Te,inherit:function(e,t){return void 0===t&&(t=function(){}),t.prototype=Te(e.prototype),t.prototype.super=e,t.prototype.constructor=t,t},getInstance:function(e,t){void 0===t&&(t=!1);for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return e._instance&&!t||(e._instance=new(e.bind.apply(e,ye([void 0],n,!1)))),e._instance},classDecorator:function(e){return function(t){for(var n in e)Reflect.has(t.prototype,n)||(t.prototype[n]=e[n])}},stringToJson:function(e){if("string"!==be(e))return null;try{return JSON.parse(e)}catch(e){return null}},jsonToString:function(e){if(!me(e,["array","object","set","map"]))return"";try{return JSON.stringify(e)}catch(e){return""}},isWindow:function(e){return e&&e===e.window},emptyObject:function(e){void 0===e&&(e={});var t=Object.create(null);return Reflect.ownKeys(e).forEach((function(n){return t[n]=e[n]})),t}},Pe=function(e,t){return void 0===t&&(t=[]),e.forEach((function(e){return"array"===be(e)?Pe(e,t):t.push(e)})),t},xe={arrayRandom:function(e){return e.sort((function(){return Math.random()-.5}))},arrayUniq:function(e){return Array.from(new Set(e))},arrayDemote:Pe},qe=void 0,ke=function(e){var t,n;return void 0===e&&(e=0),{promise:new Promise((function(r,o){t=r,n=o,e>0&&setTimeout((function(){return n("timeout")}),e)})),resolve:t,reject:n}},Ae={throttle:function(e,t){var n=null;return function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];n||(n=setTimeout((function(){e.call.apply(e,ye([qe],r,!1)),n=null}),t))}},debounce:function(e,t){var n=null;return function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];n&&(clearTimeout(n),n=null),n=setTimeout((function(){e.call.apply(e,ye([qe],r,!1))}),t)}},defer:ke,catchAwait:function(e){return e.then((function(e){return[null,e]})).catch((function(e){return[e]}))}},He={createElement:function(e){var t,n,r=e.ele,o=e.style,i=e.attr,u=e.parent,a=r instanceof HTMLElement?r:document.createElement(null!=r?r:"div");return o&&(null===(t=Object.keys(o))||void 0===t||t.forEach((function(e){return a.style[e]=o[e]}))),i&&(null===(n=Object.keys(i))||void 0===n||n.forEach((function(e){return a[e]=i[e]}))),u&&u.appendChild(a),a}},Le={addHandler:function(e,t,n){e.addEventListener?e.addEventListener(t,n,!1):e["on"+t]=n},stopBubble:function(e){(e=e||window.event).stopPropagation?e.stopPropagation():e.cancelBubble=!1},stopDefault:function(e){(e=e||window.event).preventDefault?e.preventDefault():e.returnValue=!1},removeHandler:function(e,t,n){e.removeEventListener?e.removeEventListener(t,n,!1):e["on"+t]=null},dispatchEvent:function(e,t){var n=new Event(t);e.dispatchEvent(n)}},Me={setStorage:function(e,t){try{localStorage.setItem(e,JSON.stringify(t))}catch(e){console.error(e)}},getStorage:function(e){try{var t=localStorage.getItem(e);return null==t?null:JSON.parse(t)}catch(e){return console.error(e),null}},clearStorage:function(e){try{e&&localStorage.removeItem(e),!e&&localStorage.clear()}catch(e){console.error(e)}}},Ce=function(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!0),t&&(process.stdout.clearLine(0),process.stdout.cursorTo(0)),process.stdout.write(e),n&&process.stdout.write("\n")},De=function(e){return Ce(e,!0,!1)},Be=["\\","|","/","—","—"],Ie=function(e){var t;void 0===e&&(e={});var n=e.loopList,r=void 0===n?Be:n,o=e.isStop,i=void 0!==o&&o,u=e.timer,a=void 0===u?100:u,c=e.index,s=void 0===c?0:c,l=null!==(t=null==r?void 0:r.length)&&void 0!==t?t:0;if(!l)return e;if(i)return De("\n");s>=l-1&&(s=0);var f=r[s++];return De(f),setTimeout((function(){e.index=s,Ie(e)}),a),e},Re={logOneLine:Ce,logLoop:Ie},_e=function(){function e(e){this.fn=e,this.id=null,this.duration=1/0,this.isActive=!1}return e.prototype.start=function(e){if(!this.isActive)return this.duration=null!=e?e:1/0,this.isActive=!0,this.animate()},e.prototype.stop=function(e){void 0===e&&(e=this.id),this.isActive=!1,cancelAnimationFrame(e)},e.prototype.animate=function(e){if(void 0===e&&(e=0),this.isActive&&this.duration-- >0)return this.fn(e),this.id=requestAnimationFrame(this.animate.bind(this)),this.id},e}();function Fe(e){return 0===e||1===e?1:e*Fe(e-1)}function Ne(e,t){return Fe(e)/(Fe(t)*Fe(e-t))}var We={AnimateFrame:_e,quadraticBezier:function(e,t,n){var r=1-n,o=n*n;return[2*r*n*e+o,2*r*n*t+o]},cubicBezier:function(e,t,n,r,o){var i=3*e,u=3*t,a=3*(n-e)-i,c=3*(r-t)-u,s=1-u-c;return[(1-i-a)*Math.pow(o,3)+a*Math.pow(o,2)+i*o,s*Math.pow(o,3)+c*Math.pow(o,2)+u*o]},factorial:Fe,combination:Ne,NBezier:function(e,t){for(var n=e.length-1,r=[0,0],o=0;o<=n;o++){var i=Ne(n,o)*Math.pow(1-t,n-o)*Math.pow(t,o);r[0]+=i*e[o][0],r[1]+=i*e[o][1]}return r}},Je=function(){function e(e){void 0===e&&(e={}),this.options=e,this.events={}}return e.prototype.on=function(e,t){return this.checkHandler(e,t),this.getHandler(e,[]).push(t),this},e.prototype.emit=function(e,t){return this.has(e)&&this.runHandler(e,t),this},e.prototype.un=function(e,t){return this.unHandler(e,t),this},e.prototype.once=function(e,t){var n=this;this.checkHandler(e,t);var r=function(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];return n.un(e,r),t.apply(void 0,o)};return this.on(e,r),this},e.prototype.clear=function(){return this.events={},this},e.prototype.has=function(e){return!!this.getHandler(e)},e.prototype.getHandler=function(e,t){var n;return"object"==typeof t&&(this.events[e]=null!==(n=this.events[e])&&void 0!==n?n:t),this.events[e]},e.prototype.handlerLength=function(e){var t,n;return null!==(n=null===(t=this.getHandler(e))||void 0===t?void 0:t.length)&&void 0!==n?n:0},e.prototype.watch=function(e,t){var n=this;this.checkHandler(e,t);return this.on(e,(function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];n.emit(n.prefixStr(e),t.apply(void 0,r))})),this},e.prototype.invoke=function(e,t){var n=this;return new Promise((function(r){n.once(n.prefixStr(e),r),n.emit(e,t)}))},e.prototype.runHandler=function(e,t){for(var n=0,r=this.getHandler(e);n<r.length;n++){var o=r[n];o&&o(t)}},e.prototype.unHandler=function(e,t){var n=this.getHandler(e);!t&&(this.events[e]=[]),t&&this.checkHandler(e,t);for(var r=0;r<n.length;r++)n&&n[r]===t&&(n[r]=null)},e.prototype.prefixStr=function(e){return"@".concat(e)},e.prototype.checkHandler=function(e,t){var n=this.options,r=n.blackList,o=void 0===r?[]:r,i=n.maxLen,u=void 0===i?1/0:i,a=this.handlerLength(e);if(0===(null==e?void 0:e.length))throw new Error("type.length can not be 0");if(!t||!e)throw new ReferenceError("type or handler is not defined");if("function"!=typeof t||"string"!=typeof e)throw new TypeError("".concat(t," is not a function or ").concat(e," is not a string"));if(o.includes(e))throw new Error("".concat(e," is not allow"));if(u<=a)throw new Error("the number of ".concat(e," must be less than ").concat(u))},e.Instance=function(e){return e._instance||Object.defineProperty(e,"_instance",{value:new e}),e._instance},e}();Je.Instance(Je);var Ve,Ge=function(e){return e.prototype.messageCenter||(e.prototype.messageCenter=new Je),e},Ue=function(){return Ue=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Ue.apply(this,arguments)},ze=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},Qe=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function u(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(u,a)}c((r=r.apply(e,t||[])).next())}))},Ke=function(e,t){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(a){return function(c){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,a[0]&&(u=0)),u;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return u.label++,{value:a[1],done:!1};case 5:u.label++,r=a[1],a=[0];continue;case 7:a=u.ops.pop(),u.trys.pop();continue;default:if(!(o=u.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){u=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){u.label=a[1];break}if(6===a[0]&&u.label<o[1]){u.label=o[1],o=a;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(a);break}o[2]&&u.ops.pop(),u.trys.pop();continue}a=t.call(e,u)}catch(e){a=[6,e],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}},$e=function(){function e(e){var t=this;this.fix="@~&$",this.init=function(){t.messageCenter.on("push:handler",t.run),t.messageCenter.on("run:success:handler",t.run),t.messageCenter.on("run:success:handler",t.finish),t.messageCenter.on("run:error:handler",t.run),t.messageCenter.on("run:error:handler",t.finish)},this.defineProps=function(e,n){Object.defineProperty(t,n,{value:e})},this.push=function(e){var n;t.checkHandler(e);var r=(n=t.defer()).resolve,o=n.reject,i=n.promise,u=t.fixStr(e.name);return t.queues=t.queues.concat(e.children.map((function(e){return{defer:e,name:u}}))),t.queueTemp[u]=Ue(Ue({},e),{result:[]}),t.messageCenter.emit("push:handler",o),t.messageCenter.on(u,r),i},this.unshift=function(e){return t.queues.splice(0,e)},this.run=function(e){var n=e.reject;return Qe(t,void 0,void 0,(function(){var e,t,r,o,i;return Ke(this,(function(u){switch(u.label){case 0:if("pending"===this.stateProxy())return[2,void 0];if(0===this.queues.length)return[2,this.stateProxy("idle")];this.stateProxy("pending"),e=this.unshift(null!==(i=null===(o=this.props)||void 0===o?void 0:o.maxLen)&&void 0!==i?i:10),u.label=1;case 1:return u.trys.push([1,3,,4]),[4,Promise.all(e.map((function(e,t){return e.defer().catch((function(e){return e}))})))];case 2:return t=u.sent(),[2,this.handlerSuccess({res:t,queues:e})];case 3:return r=u.sent(),[2,this.handlerError({reject:n,error:r,queues:e})];case 4:return[2]}}))}))},this.clear=function(){t.queues=[],t.queueTemp={},t.props=null,t.stateProxy("idle"),t.messageCenter.clear()},this.finish=function(e){var n=e.res,r=void 0===n?[]:n,o=e.queues,i=e.error,u=void 0===i?"err":i,a=t.queueTemp;o.forEach((function(e,n){var o,i,c,s=a[e.name];null==s||s.result.push(null!==(o=r[n])&&void 0!==o?o:u),(null===(i=null==s?void 0:s.result)||void 0===i?void 0:i.length)===(null===(c=null==s?void 0:s.children)||void 0===c?void 0:c.length)&&(t.messageCenter.emit(e.name,null==s?void 0:s.result),a[e.name]=null)}))},this.handlerSuccess=function(e){return t.stateProxy("fulfilled"),t.messageCenter.emit("run:success:handler",e)},this.handlerError=function(e){var n=e.reject,r=e.error;return t.stateProxy("rejected"),n&&"function"==typeof n&&n(r),t.messageCenter.emit("run:error:handler",e)},this.stateProxy=function(e){return e&&(t.state=e),t.state},this.defer=function(){var e,t;return{promise:new Promise((function(n,r){e=n,t=r})),resolve:e,reject:t}},this.clear(),e&&this.defineProps(e,"props"),this.init()}return e.prototype.checkHandler=function(e){var t,n;if(!e)throw new ReferenceError("queue is not defined");if(!(e.children instanceof Array)||"object"!=typeof e)throw new TypeError("queue should be an object and queue.children should be an array");if(0===(null===(t=e.children)||void 0===t?void 0:t.length))throw new Error("queue.children.length can not be 0");if(null===(n=e.children)||void 0===n?void 0:n.find((function(e){return function(e){return!e||"function"!=typeof e}(e)})))throw new Error("queueList should have defer")},e.prototype.fixStr=function(e){return"".concat(this.fix).concat(e)},e=function(e,t,n,r){var o,i=arguments.length,u=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)u=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(u=(i<3?o(u):i>3?o(t,n,u):o(t,n))||u);return i>3&&u&&Object.defineProperty(t,n,u),u}([Ge,ze("design:paramtypes",[Object])],e),e}(),Ye=function(){return Ye=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Ye.apply(this,arguments)};function Ze(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}!function(e){e["[object Array]"]="array",e["[object Object]"]="object",e["[object Function]"]="function",e["[object Set]"]="set",e["[object Map]"]="map",e["[object WeakMap]"]="weakMap",e["[object WeakSet]"]="weakSet",e["[object Date]"]="date",e["[object RegExp]"]="regExp",e["[object Math]"]="math"}(Ve||(Ve={}));var Xe={types:Ve},et=function(e,t){void 0===t&&(t={});var n=Object.keys(t);if(0===n.length)return e;var r=n.map((function(e){return"".concat(e,"=").concat(t[e])}));return"".concat(e).concat(e.includes("?")?"&":"?").concat(r.join("&"))},tt=function(e){var t=typeof e;if(null===e)return"null";if("object"===t){var n=Object.prototype.toString.call(e);return Ve[n]}return t},nt=function(e,t){void 0===t&&(t=[]);var n=tt(e);return t.indexOf(n)>0},rt={randomNum:function(e,t,n){return void 0===n&&(n=!1),Math.floor(Math.random()*(t-e+(n?1:0))+e)},urlSplit:function(e){var t={};return e.includes("?")?(e.split("?")[1].split("&").forEach((function(e){var n=e.split("=")[0];t[n]=e.split("=")[1]})),t):t},urlJoin:et,getType:tt,getTypeByList:nt},ot=function(e,t){return"object"!=typeof e||"null"===t},it=function(e){var t=tt(e);if(ot(e,t))return e;var n=ut(t,e);return"map"===t?e.forEach((function(e,t){n.set(t,it(e))})):"set"===t?e.forEach((function(e){n.add(it(e))})):Reflect.ownKeys(e).forEach((function(t){var r=e[t];n[t]=it(r)})),n},ut=function(e,t){switch(void 0===t&&(t={}),e){case"array":return[];case"function":return t;case"set":return new Set;case"map":return new Map;case"date":return new Date(t);case"regExp":return new RegExp(t);case"math":return Math;default:return{}}},at=function(e){function t(){}return t.prototype=e,new t},ct=function(e){if("string"!==tt(e))return null;try{return JSON.parse(e)}catch(e){return null}},st=function(e){if(!nt(e,["array","object","set","map"]))return"";try{return JSON.stringify(e)}catch(e){return""}},lt={getValue:function(e,t,n){void 0===n&&(n="");for(var r=0,o=t.split(".");r<o.length;r++){if(void 0===(e=e[o[r]]))return n}return e},setValue:function(e,t,n){void 0===n&&(n={});for(var r=t.split("."),o=r[r.length-1],i=e,u=0,a=r;u<a.length;u++){var c=a[u];if("object"!=typeof i&&void 0!==i)return e;!i&&(i={}),!i[c]&&(i[c]={}),o===c&&(i[o]=n),i=i[c]}return e},mixIn:function(e,t,n){var r;for(var o in void 0===t&&(t={}),void 0===n&&(n=!1),t)for(var i in t[o]){var u=null!==(r=e.prototype)&&void 0!==r?r:e;(void 0===e[i]||n)&&(u[i]=t[o][i])}return e},enumInversion:function(e){for(var t in e){var n=e[t];"string"!=typeof n||e[n]||(e[n]=t)}return e},isNotObject:ot,cloneDeep:it,createObjectVariable:ut,createObject:at,inherit:function(e,t){return void 0===t&&(t=function(){}),t.prototype=at(e.prototype),t.prototype.super=e,t.prototype.constructor=t,t},getInstance:function(e,t){void 0===t&&(t=!1);for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return e._instance&&!t||(e._instance=new(e.bind.apply(e,Ze([void 0],n,!1)))),e._instance},classDecorator:function(e){return function(t){for(var n in e)Reflect.has(t.prototype,n)||(t.prototype[n]=e[n])}},stringToJson:ct,jsonToString:st,isWindow:function(e){return e&&e===e.window}},ft=function(e,t){return void 0===t&&(t=[]),e.forEach((function(e){return"array"===tt(e)?ft(e,t):t.push(e)})),t},pt={arrayRandom:function(e){return e.sort((function(){return Math.random()-.5}))},arrayUniq:function(e){return Array.from(new Set(e))},arrayDemote:ft},ht=void 0,dt=function(e){var t,n;return void 0===e&&(e=0),e>0&&setTimeout(n,e),{promise:new Promise((function(e,r){t=e,n=r})),resolve:t,reject:n}},vt={throttle:function(e,t){var n=null;return function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];n||(n=setTimeout((function(){e.call.apply(e,Ze([ht],r,!1)),n=null}),t))}},debounce:function(e,t){var n=null;return function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];n&&(clearTimeout(n),n=null),n=setTimeout((function(){e.call.apply(e,Ze([ht],r,!1))}),t)}},defer:dt,catchAwait:function(e){return e.then((function(e){return[null,e]})).catch((function(e){return[e]}))}},yt={createElement:function(e){var t,n,r=e.ele,o=e.style,i=e.attr,u=e.parent,a=r instanceof HTMLElement?r:document.createElement(null!=r?r:"div");return o&&(null===(t=Object.keys(o))||void 0===t||t.forEach((function(e){return a.style[e]=o[e]}))),i&&(null===(n=Object.keys(i))||void 0===n||n.forEach((function(e){return a[e]=i[e]}))),u&&u.appendChild(a),a}},gt={addHandler:function(e,t,n){e.addEventListener?e.addEventListener(t,n,!1):e["on"+t]=n},stopBubble:function(e){(e=e||window.event).stopPropagation?e.stopPropagation():e.cancelBubble=!1},stopDefault:function(e){(e=e||window.event).preventDefault?e.preventDefault():e.returnValue=!1},removeHandler:function(e,t,n){e.removeEventListener?e.removeEventListener(t,n,!1):e["on"+t]=null},dispatchEvent:function(e,t){var n=new Event(t);e.dispatchEvent(n)}},bt={setStorage:function(e,t){try{localStorage.setItem(e,JSON.stringify(t))}catch(e){console.error(e)}},getStorage:function(e){try{var t=localStorage.getItem(e);return null==t?null:JSON.parse(t)}catch(e){return console.error(e),null}},clearStorage:function(e){try{e&&localStorage.removeItem(e),!e&&localStorage.clear()}catch(e){console.error(e)}}},mt=function(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!0),t&&(process.stdout.clearLine(0),process.stdout.cursorTo(0)),process.stdout.write(e),n&&process.stdout.write("\n")},wt=function(e){return mt(e,!0,!1)},jt=["\\","|","/","—","—"],Et=function(e){var t;void 0===e&&(e={});var n=e.loopList,r=void 0===n?jt:n,o=e.isStop,i=void 0!==o&&o,u=e.timer,a=void 0===u?100:u,c=e.index,s=void 0===c?0:c,l=null!==(t=null==r?void 0:r.length)&&void 0!==t?t:0;if(!l)return e;if(i)return wt("\n");s>=l-1&&(s=0);var f=r[s++];return wt(f),setTimeout((function(){e.index=s,Et(e)}),a),e},Ot={logOneLine:mt,logLoop:Et},Tt=function(){function e(e){this.fn=e,this.id=null,this.duration=1/0,this.isActive=!1}return e.prototype.start=function(e){this.isActive||(this.duration=null!=e?e:1/0,this.isActive=!0,this.animate())},e.prototype.stop=function(){this.isActive=!1,cancelAnimationFrame(this.id)},e.prototype.animate=function(e){void 0===e&&(e=0),this.isActive&&this.duration-- >0&&(this.fn(e),this.id=requestAnimationFrame(this.animate.bind(this)))},e}();function St(e){return 0===e||1===e?1:e*St(e-1)}function Pt(e,t){return St(e)/(St(t)*St(e-t))}var xt={AnimateFrame:Tt,quadraticBezier:function(e,t,n){var r=1-n,o=n*n;return[2*r*n*e+o,2*r*n*t+o]},cubicBezier:function(e,t,n,r,o){var i=3*e,u=3*t,a=3*(n-e)-i,c=3*(r-t)-u,s=1-u-c;return[(1-i-a)*Math.pow(o,3)+a*Math.pow(o,2)+i*o,s*Math.pow(o,3)+c*Math.pow(o,2)+u*o]},factorial:St,combination:Pt,NBezier:function(e,t){for(var n=e.length-1,r=[0,0],o=0;o<=n;o++){var i=Pt(n,o)*Math.pow(1-t,n-o)*Math.pow(t,o);r[0]+=i*e[o][0],r[1]+=i*e[o][1]}return r}},qt=function(){function e(e){void 0===e&&(e={}),this.options=e,this.events={}}return e.prototype.on=function(e,t){return this.checkHandler(e,t),this.getHandler(e,[]).push(t),this},e.prototype.emit=function(e,t){return this.has(e)&&this.runHandler(e,t),this},e.prototype.un=function(e,t){return this.unHandler(e,t),this},e.prototype.once=function(e,t){var n=this;this.checkHandler(e,t);var r=function(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];return n.un(e,r),t.apply(void 0,o)};return this.on(e,r),this},e.prototype.clear=function(){return this.events={},this},e.prototype.has=function(e){return!!this.getHandler(e)},e.prototype.getHandler=function(e,t){var n;return"object"==typeof t&&(this.events[e]=null!==(n=this.events[e])&&void 0!==n?n:t),this.events[e]},e.prototype.handlerLength=function(e){var t,n;return null!==(n=null===(t=this.getHandler(e))||void 0===t?void 0:t.length)&&void 0!==n?n:0},e.prototype.watch=function(e,t){var n=this;this.checkHandler(e,t);return this.on(e,(function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];n.emit(n.prefixStr(e),t.apply(void 0,r))})),this},e.prototype.invoke=function(e,t){var n=this;return new Promise((function(r){n.once(n.prefixStr(e),r),n.emit(e,t)}))},e.prototype.runHandler=function(e,t){for(var n=0,r=this.getHandler(e);n<r.length;n++){var o=r[n];o&&o(t)}},e.prototype.unHandler=function(e,t){var n=this.getHandler(e);!t&&(this.events[e]=[]),t&&this.checkHandler(e,t);for(var r=0;r<n.length;r++)n&&n[r]===t&&(n[r]=null)},e.prototype.prefixStr=function(e){return"@".concat(e)},e.prototype.checkHandler=function(e,t){var n=this.options,r=n.blackList,o=void 0===r?[]:r,i=n.maxLen,u=void 0===i?1/0:i,a=this.handlerLength(e);if(0===(null==e?void 0:e.length))throw new Error("type.length can not be 0");if(!t||!e)throw new ReferenceError("type or handler is not defined");if("function"!=typeof t||"string"!=typeof e)throw new TypeError("".concat(t," is not a function or ").concat(e," is not a string"));if(o.includes(e))throw new Error("".concat(e," is not allow"));if(u<=a)throw new Error("the number of ".concat(e," must be less than ").concat(u))},e.Instance=function(e){return e._instance||Object.defineProperty(e,"_instance",{value:new e}),e._instance},e}();qt.Instance(qt);var kt=function(e){return e.prototype.messageCenter||(e.prototype.messageCenter=new qt),e},At=function(){return At=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},At.apply(this,arguments)},Ht=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},Lt=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function u(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(u,a)}c((r=r.apply(e,t||[])).next())}))},Mt=function(e,t){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(a){return function(c){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,a[0]&&(u=0)),u;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return u.label++,{value:a[1],done:!1};case 5:u.label++,r=a[1],a=[0];continue;case 7:a=u.ops.pop(),u.trys.pop();continue;default:if(!(o=u.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){u=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){u.label=a[1];break}if(6===a[0]&&u.label<o[1]){u.label=o[1],o=a;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(a);break}o[2]&&u.ops.pop(),u.trys.pop();continue}a=t.call(e,u)}catch(e){a=[6,e],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}},Ct=function(){function e(e){var t=this;this.fix="@~&$",this.init=function(){t.messageCenter.on("push:handler",t.run),t.messageCenter.on("run:success:handler",t.run),t.messageCenter.on("run:success:handler",t.finish),t.messageCenter.on("run:error:handler",t.run),t.messageCenter.on("run:error:handler",t.finish)},this.defineProps=function(e,n){Object.defineProperty(t,n,{value:e})},this.push=function(e){var n;t.checkHandler(e);var r=(n=t.defer()).resolve,o=n.reject,i=n.promise,u=t.fixStr(e.name);return t.queues=t.queues.concat(e.children.map((function(e){return{defer:e,name:u}}))),t.queueTemp[u]=At(At({},e),{result:[]}),t.messageCenter.emit("push:handler",o),t.messageCenter.on(u,r),i},this.unshift=function(e){return t.queues.splice(0,e)},this.run=function(e){var n=e.reject;return Lt(t,void 0,void 0,(function(){var e,t,r,o,i;return Mt(this,(function(u){switch(u.label){case 0:if("pending"===this.stateProxy())return[2,void 0];if(0===this.queues.length)return[2,this.stateProxy("idle")];this.stateProxy("pending"),e=this.unshift(null!==(i=null===(o=this.props)||void 0===o?void 0:o.maxLen)&&void 0!==i?i:10),u.label=1;case 1:return u.trys.push([1,3,,4]),[4,Promise.all(e.map((function(e,t){return e.defer().catch((function(e){return e}))})))];case 2:return t=u.sent(),[2,this.handlerSuccess({res:t,queues:e})];case 3:return r=u.sent(),[2,this.handlerError({reject:n,error:r,queues:e})];case 4:return[2]}}))}))},this.clear=function(){t.queues=[],t.queueTemp={},t.props=null,t.stateProxy("idle"),t.messageCenter.clear()},this.finish=function(e){var n=e.res,r=void 0===n?[]:n,o=e.queues,i=e.error,u=void 0===i?"err":i,a=t.queueTemp;o.forEach((function(e,n){var o,i,c,s=a[e.name];null==s||s.result.push(null!==(o=r[n])&&void 0!==o?o:u),(null===(i=null==s?void 0:s.result)||void 0===i?void 0:i.length)===(null===(c=null==s?void 0:s.children)||void 0===c?void 0:c.length)&&(t.messageCenter.emit(e.name,null==s?void 0:s.result),a[e.name]=null)}))},this.handlerSuccess=function(e){return t.stateProxy("fulfilled"),t.messageCenter.emit("run:success:handler",e)},this.handlerError=function(e){var n=e.reject,r=e.error;return t.stateProxy("rejected"),n&&"function"==typeof n&&n(r),t.messageCenter.emit("run:error:handler",e)},this.stateProxy=function(e){return e&&(t.state=e),t.state},this.defer=function(){var e,t;return{promise:new Promise((function(n,r){e=n,t=r})),resolve:e,reject:t}},this.clear(),e&&this.defineProps(e,"props"),this.init()}return e.prototype.checkHandler=function(e){var t,n;if(!e)throw new ReferenceError("queue is not defined");if(!(e.children instanceof Array)||"object"!=typeof e)throw new TypeError("queue should be an object and queue.children should be an array");if(0===(null===(t=e.children)||void 0===t?void 0:t.length))throw new Error("queue.children.length can not be 0");if(null===(n=e.children)||void 0===n?void 0:n.find((function(e){return function(e){return!e||"function"!=typeof e}(e)})))throw new Error("queueList should have defer")},e.prototype.fixStr=function(e){return"".concat(this.fix).concat(e)},e=function(e,t,n,r){var o,i=arguments.length,u=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)u=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(u=(i<3?o(u):i>3?o(t,n,u):o(t,n))||u);return i>3&&u&&Object.defineProperty(t,n,u),u}([kt,Ht("design:paramtypes",[Object])],e),e}();Ye(Ye(Ye(Ye(Ye(Ye(Ye(Ye(Ye(Ye(Ye({},lt),rt),pt),vt),yt),Xe),gt),bt),Ot),xt),{eventMessageCenter:qt,taskQueueLib:Ct});
2
2
  /**
3
3
  * @author Toru Nagashima <https://github.com/mysticatea>
4
4
  * @copyright 2015 Toru Nagashima. All rights reserved.
@@ -3,7 +3,7 @@ export declare const getValue: IGetValue;
3
3
  export declare const setValue: ISetValue;
4
4
  export declare const mixIn: IMixIn;
5
5
  export declare const enumInversion: IEnumInversion;
6
- export declare const isNotObject: (source: any, type: any) => boolean;
6
+ export declare const isNotObject: (source: any, type: string) => boolean;
7
7
  export declare const cloneDeep: ICloneDeep;
8
8
  export declare const createObjectVariable: ICreateObjectVariable;
9
9
  export declare const createObject: ICreateObject;
@@ -20,7 +20,7 @@ declare const _default: {
20
20
  setValue: ISetValue;
21
21
  mixIn: IMixIn;
22
22
  enumInversion: IEnumInversion;
23
- isNotObject: (source: any, type: any) => boolean;
23
+ isNotObject: (source: any, type: string) => boolean;
24
24
  cloneDeep: ICloneDeep;
25
25
  createObjectVariable: ICreateObjectVariable;
26
26
  createObject: ICreateObject;
@@ -30,7 +30,7 @@ declare const _default: {
30
30
  stringToJson: IStringToJson;
31
31
  jsonToString: IJsonToString;
32
32
  isWindow: (win: any) => boolean;
33
- emptyObject: (init?: IObject<unknown>) => any;
34
- isEmptyObject: (object?: IObject<unknown>) => boolean;
33
+ emptyObject: (init?: IObject<unknown, import("./types").IKey>) => any;
34
+ isEmptyObject: (object?: IObject<unknown, import("./types").IKey>) => boolean;
35
35
  };
36
36
  export default _default;
@@ -1,11 +1,9 @@
1
1
  export type IKey = string | symbol | number;
2
- export interface IObject<T> {
3
- [key: IKey]: T | IObject<any>;
4
- }
2
+ export type IObject<V = any, K extends string | number | symbol = IKey> = Record<K, V>;
5
3
  export interface IPromise extends IObject<any> {
6
- promise: Promise<void>;
7
- resolve: (res: any) => unknown;
8
- reject: (err: any) => unknown;
4
+ promise?: Promise<void>;
5
+ resolve?: (res?: any) => unknown;
6
+ reject?: (err?: any) => unknown;
9
7
  }
10
8
  export type IInstance<T> = {
11
9
  _instance: Function;
@@ -13,12 +11,12 @@ export type IInstance<T> = {
13
11
  export type IDemoteArray<T> = Array<IDemoteArray<T> | T>;
14
12
  export type IRandomNum = (min: number, max: number, bool?: boolean) => number;
15
13
  export type IUrlSplit = (url: string) => IObject<any>;
16
- export type IUrlJoin = (url: string, query: object) => string;
14
+ export type IUrlJoin = (url: string, query: IObject) => string;
17
15
  export type IGetType<T> = (data: any) => typeof data | T[keyof T] | "null";
18
16
  export type IGetTypeByList = (data: any, whiteList: string[]) => boolean;
19
17
  export type IGetValue = <T, U = IObject<T> | IObject<T>[IKey]>(object: U, key: string, defaultValue?: any) => U;
20
18
  export type ISetValue = <T>(object: IObject<T>, key: string, value?: any) => IObject<T>;
21
- export type IMixIn = <U extends IObject<any>>(target?: U, source?: IObject<any>, overwrite?: boolean) => U;
19
+ export type IMixIn = <U extends IObject<any>>(target?: U, source?: IObject<any>, overwrite?: boolean) => U | void;
22
20
  export type IEnumInversion = (target: IObject<string>) => IObject<string>;
23
21
  export type ICloneDeep = (target?: any) => any;
24
22
  export type ICreateObjectVariable = (type: string, source?: any) => any;
@@ -67,7 +65,7 @@ export type IAnimateFrame = {
67
65
  isActive: boolean;
68
66
  fn(timer: number): void;
69
67
  start(duration: number): void;
70
- stop(id?: number): void;
68
+ stop(id?: number | null): void;
71
69
  animate(timer: number): void;
72
70
  };
73
71
  export {};
@@ -1,5 +1,5 @@
1
- import { IRandomNum, IUrlSplit, IUrlJoin, IGetType, IGetTypeByList } from "./types";
2
1
  import { types } from "./static";
2
+ import { IGetType, IGetTypeByList, IRandomNum, IUrlJoin, IUrlSplit } from "./types";
3
3
  export declare const randomNum: IRandomNum;
4
4
  export declare const urlSplit: IUrlSplit;
5
5
  export declare const urlJoin: IUrlJoin;
@@ -61,7 +61,7 @@ declare const _default: {
61
61
  setValue: import("./types").ISetValue;
62
62
  mixIn: import("./types").IMixIn;
63
63
  enumInversion: import("./types").IEnumInversion;
64
- isNotObject: (source: any, type: any) => boolean;
64
+ isNotObject: (source: any, type: string) => boolean;
65
65
  cloneDeep: import("./types").ICloneDeep;
66
66
  createObjectVariable: import("./types").ICreateObjectVariable;
67
67
  createObject: import("./types").ICreateObject;
@@ -71,7 +71,7 @@ declare const _default: {
71
71
  stringToJson: import("./types").IStringToJson;
72
72
  jsonToString: import("./types").IJsonToString;
73
73
  isWindow: (win: any) => boolean;
74
- emptyObject: (init?: import("./types").IObject<unknown>) => any;
75
- isEmptyObject: (object?: import("./types").IObject<unknown>) => boolean;
74
+ emptyObject: (init?: import("./types").IObject<unknown, import("./types").IKey>) => any;
75
+ isEmptyObject: (object?: import("./types").IObject<unknown, import("./types").IKey>) => boolean;
76
76
  };
77
77
  export default _default;
package/dist/cjs/index.js CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("http"),t=require("https"),n=require("url"),r=function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)};function o(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}exports.types=void 0,function(e){e["[object Array]"]="array",e["[object Object]"]="object",e["[object Function]"]="function",e["[object Set]"]="set",e["[object Map]"]="map",e["[object WeakMap]"]="weakMap",e["[object WeakSet]"]="weakSet",e["[object Date]"]="date",e["[object RegExp]"]="regExp",e["[object Math]"]="math"}(exports.types||(exports.types={}));var i={types:exports.types},u=function(e,t,n){return void 0===n&&(n=!1),Math.floor(Math.random()*(t-e+(n?1:0))+e)},a=function(e){var t={};return e.includes("?")?(e.split("?")[1].split("&").forEach((function(e){var n=e.split("=")[0];t[n]=e.split("=")[1]})),t):t},c=function(e,t){void 0===t&&(t={});var n=Object.keys(t);if(0===n.length)return e;var r=n.map((function(e){return"".concat(e,"=").concat(t[e])}));return"".concat(e).concat(e.includes("?")?"&":"?").concat(r.join("&"))},s=function(e){var t=typeof e;if(null===e)return"null";if("object"===t){var n=Object.prototype.toString.call(e);return exports.types[n]}return t},l=function(e,t){void 0===t&&(t=[]);var n=s(e);return t.indexOf(n)>0},f=function(e,t){return void 0===t&&(t="-"),e.replace(/[A-Z]/g,(function(e){return"".concat(t).concat(e.toLowerCase())}))},p={randomNum:u,urlSplit:a,urlJoin:c,getType:s,getTypeByList:l,toKebabCase:f},h=function(e,t,n){void 0===n&&(n="");for(var r=0,o=t.split(".");r<o.length;r++){if(void 0===(e=e[o[r]]))return n}return e},d=function(e,t,n){void 0===n&&(n={});for(var r=t.split("."),o=r[r.length-1],i=e,u=0,a=r;u<a.length;u++){var c=a[u];if("object"!=typeof i&&void 0!==i)return e;!i&&(i={}),!i[c]&&(i[c]={}),o===c&&(i[o]=n),i=i[c]}return e},v=function(e,t,n){var r;for(var o in void 0===t&&(t={}),void 0===n&&(n=!1),t)for(var i in t[o]){var u=null!==(r=e.prototype)&&void 0!==r?r:e;(void 0===e[i]||n)&&(u[i]=t[o][i])}return e},y=function(e){for(var t in e){var n=e[t];"string"!=typeof n||e[n]||(e[n]=t)}return e},g=function(e,t){return"object"!=typeof e||"null"===t},b=function(e){var t=s(e);if(g(e,t))return e;var n=m(t,e);return"map"===t?e.forEach((function(e,t){n.set(t,b(e))})):"set"===t?e.forEach((function(e){n.add(b(e))})):Reflect.ownKeys(e).forEach((function(t){var r=e[t];n[t]=b(r)})),n},m=function(e,t){switch(void 0===t&&(t={}),e){case"array":return[];case"function":return t;case"set":return new Set;case"map":return new Map;case"date":return new Date(t);case"regExp":return new RegExp(t);case"math":return Math;default:return{}}},w=function(e){function t(){}return t.prototype=e,new t},j=function(e,t){return void 0===t&&(t=function(){}),t.prototype=w(e.prototype),t.prototype.super=e,t.prototype.constructor=t,t},E=function(e,t){void 0===t&&(t=!1);for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return e._instance&&!t||(e._instance=new(e.bind.apply(e,o([void 0],n,!1)))),e._instance},O=function(e){return function(t){for(var n in e)Reflect.has(t.prototype,n)||(t.prototype[n]=e[n])}},T=function(e){if("string"!==s(e))return null;try{return JSON.parse(e)}catch(e){return null}},S=function(e){if(!l(e,["array","object","set","map"]))return"";try{return JSON.stringify(e)}catch(e){return""}},P=function(e){return e&&e===e.window},x=function(e){void 0===e&&(e={});var t=Object.create(null);return Reflect.ownKeys(e).forEach((function(n){return t[n]=e[n]})),t},q=function(e){void 0===e&&(e={});var t=x(e);return Reflect.ownKeys(t).length<=0},k={getValue:h,setValue:d,mixIn:v,enumInversion:y,isNotObject:g,cloneDeep:b,createObjectVariable:m,createObject:w,inherit:j,getInstance:E,classDecorator:O,stringToJson:T,jsonToString:S,isWindow:P,emptyObject:x,isEmptyObject:q},A=function(e){return e.sort((function(){return Math.random()-.5}))},H=function(e){return Array.from(new Set(e))},L=function(e,t){return void 0===t&&(t=[]),e.forEach((function(e){return"array"===s(e)?L(e,t):t.push(e)})),t},M=function(e,t){return void 0===t&&(t=0),{item:e[t],current:(t+1)%e.length}},C={arrayRandom:A,arrayUniq:H,arrayDemote:L,arrayLoop:M},D=void 0,B=function(e,t){var n=null;return function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];n||(n=setTimeout((function(){e.call.apply(e,o([D],r,!1)),n=null}),t))}},I=function(e,t){var n=null;return function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];n&&(clearTimeout(n),n=null),n=setTimeout((function(){e.call.apply(e,o([D],r,!1))}),t)}},R=function(e){var t,n;return void 0===e&&(e=0),{promise:new Promise((function(r,o){t=r,n=o,e>0&&setTimeout((function(){return n("timeout")}),e)})),resolve:t,reject:n}},_=function(e){return e.then((function(e){return[null,e]})).catch((function(e){return[e]}))},F={throttle:B,debounce:I,defer:R,catchAwait:_},N=function(e){var t,n,r=e.ele,o=e.style,i=e.attr,u=e.parent,a=r instanceof HTMLElement?r:document.createElement(null!=r?r:"div");return o&&(null===(t=Object.keys(o))||void 0===t||t.forEach((function(e){return a.style[e]=o[e]}))),i&&(null===(n=Object.keys(i))||void 0===n||n.forEach((function(e){return a[e]=i[e]}))),u&&u.appendChild(a),a},W={createElement:N},J=function(e,t,n){e.addEventListener?e.addEventListener(t,n,!1):e["on"+t]=n},V=function(e){(e=e||window.event).stopPropagation?e.stopPropagation():e.cancelBubble=!1},G=function(e){(e=e||window.event).preventDefault?e.preventDefault():e.returnValue=!1},U=function(e,t,n){e.removeEventListener?e.removeEventListener(t,n,!1):e["on"+t]=null},z=function(e,t){var n=new Event(t);e.dispatchEvent(n)},Q={addHandler:J,stopBubble:V,stopDefault:G,removeHandler:U,dispatchEvent:z},K=function(e,t){try{localStorage.setItem(e,JSON.stringify(t))}catch(e){console.error(e)}},$=function(e){try{var t=localStorage.getItem(e);return null==t?null:JSON.parse(t)}catch(e){return console.error(e),null}},Y=function(e){try{e&&localStorage.removeItem(e),!e&&localStorage.clear()}catch(e){console.error(e)}},Z={setStorage:K,getStorage:$,clearStorage:Y},X=function(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!0),t&&(process.stdout.clearLine(0),process.stdout.cursorTo(0)),process.stdout.write(e),n&&process.stdout.write("\n")},ee=function(e){return X(e,!0,!1)},te=["\\","|","/","—","—"],ne=function(e){var t;void 0===e&&(e={});var n=e.loopList,r=void 0===n?te:n,o=e.isStop,i=void 0!==o&&o,u=e.timer,a=void 0===u?100:u,c=e.index,s=void 0===c?0:c,l=null!==(t=null==r?void 0:r.length)&&void 0!==t?t:0;if(!l)return e;if(i)return ee("\n");s>=l-1&&(s=0);var f=r[s++];return ee(f),setTimeout((function(){e.index=s,ne(e)}),a),e},re={logOneLine:X,logLoop:ne},oe=function(){function e(e){this.fn=e,this.id=null,this.duration=1/0,this.isActive=!1}return e.prototype.start=function(e){if(!this.isActive)return this.duration=null!=e?e:1/0,this.isActive=!0,this.animate()},e.prototype.stop=function(e){void 0===e&&(e=this.id),this.isActive=!1,cancelAnimationFrame(e)},e.prototype.animate=function(e){if(void 0===e&&(e=0),this.isActive&&this.duration-- >0)return this.fn(e),this.id=requestAnimationFrame(this.animate.bind(this)),this.id},e}();function ie(e,t,n){var r=1-n,o=n*n;return[2*r*n*e+o,2*r*n*t+o]}function ue(e,t,n,r,o){var i=3*e,u=3*t,a=3*(n-e)-i,c=3*(r-t)-u,s=1-u-c;return[(1-i-a)*Math.pow(o,3)+a*Math.pow(o,2)+i*o,s*Math.pow(o,3)+c*Math.pow(o,2)+u*o]}function ae(e){return 0===e||1===e?1:e*ae(e-1)}function ce(e,t){return ae(e)/(ae(t)*ae(e-t))}function se(e,t){for(var n=e.length-1,r=[0,0],o=0;o<=n;o++){var i=ce(n,o)*Math.pow(1-t,n-o)*Math.pow(t,o);r[0]+=i*e[o][0],r[1]+=i*e[o][1]}return r}var le,fe={AnimateFrame:oe,quadraticBezier:ie,cubicBezier:ue,factorial:ae,combination:ce,NBezier:se},pe=function(){function e(e){void 0===e&&(e={}),this.options=e,this.events=Object.create(null)}return e.prototype.on=function(e,t){return this.checkHandler(e,t),this.getHandler(e,[]).push(t),this},e.prototype.emit=function(e,t){return this.has(e)&&this.runHandler(e,t),this},e.prototype.un=function(e,t){return this.unHandler(e,t),this},e.prototype.once=function(e,t){var n=this;this.checkHandler(e,t);var r=function(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];return n.un(e,r),t.apply(void 0,o)};return this.on(e,r),this},e.prototype.clear=function(){return this.events=Object.create(null),this},e.prototype.has=function(e){return!!this.getHandler(e)},e.prototype.getHandler=function(e,t){var n;return"object"==typeof t&&(this.events[e]=null!==(n=this.events[e])&&void 0!==n?n:t),this.events[e]},e.prototype.handlerLength=function(e){var t,n;return null!==(n=null===(t=this.getHandler(e))||void 0===t?void 0:t.length)&&void 0!==n?n:0},e.prototype.watch=function(e,t){var n=this;this.checkHandler(e,t);return this.on(e,(function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];n.emit(n.prefixStr(e),t.apply(void 0,r))})),this},e.prototype.invoke=function(e,t){var n=this;return new Promise((function(r){n.once(n.prefixStr(e),r),n.emit(e,t)}))},e.prototype.runHandler=function(e,t){for(var n=0,r=this.getHandler(e);n<r.length;n++){var o=r[n];o&&o(t)}},e.prototype.unHandler=function(e,t){var n=this.getHandler(e);!t&&(this.events[e]=[]),t&&this.checkHandler(e,t);for(var r=0;r<n.length;r++)n&&n[r]===t&&(n[r]=null)},e.prototype.prefixStr=function(e){return"@".concat(e)},e.prototype.checkHandler=function(e,t){var n=this.options,r=n.blackList,o=void 0===r?[]:r,i=n.maxLen,u=void 0===i?1/0:i,a=this.handlerLength(e);if(0===(null==e?void 0:e.length))throw new Error("type.length can not be 0");if(!t||!e)throw new ReferenceError("type or handler is not defined");if("function"!=typeof t||"string"!=typeof e)throw new TypeError("".concat(t," is not a function or ").concat(e," is not a string"));if(o.includes(e))throw new Error("".concat(e," is not allow"));if(u<=a)throw new Error("the number of ".concat(e," must be less than ").concat(u))},e.Instance=function(e){return e._instance||Object.defineProperty(e,"_instance",{value:new e}),e._instance},e}(),he=pe.Instance(pe),de=function(){return de=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},de.apply(this,arguments)};function ve(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}!function(e){e["[object Array]"]="array",e["[object Object]"]="object",e["[object Function]"]="function",e["[object Set]"]="set",e["[object Map]"]="map",e["[object WeakMap]"]="weakMap",e["[object WeakSet]"]="weakSet",e["[object Date]"]="date",e["[object RegExp]"]="regExp",e["[object Math]"]="math"}(le||(le={}));var ye={types:le},ge=function(e){var t=typeof e;if(null===e)return"null";if("object"===t){var n=Object.prototype.toString.call(e);return le[n]}return t},be=function(e,t){void 0===t&&(t=[]);var n=ge(e);return t.indexOf(n)>0},me={randomNum:function(e,t,n){return void 0===n&&(n=!1),Math.floor(Math.random()*(t-e+(n?1:0))+e)},urlSplit:function(e){var t={};return e.includes("?")?(e.split("?")[1].split("&").forEach((function(e){var n=e.split("=")[0];t[n]=e.split("=")[1]})),t):t},urlJoin:function(e,t){void 0===t&&(t={});var n=Object.keys(t);if(0===n.length)return e;var r=n.map((function(e){return"".concat(e,"=").concat(t[e])}));return"".concat(e).concat(e.includes("?")?"&":"?").concat(r.join("&"))},getType:ge,getTypeByList:be},we=function(e,t){return"object"!=typeof e||"null"===t},je=function(e){var t=ge(e);if(we(e,t))return e;var n=Ee(t,e);return"map"===t?e.forEach((function(e,t){n.set(t,je(e))})):"set"===t?e.forEach((function(e){n.add(je(e))})):Reflect.ownKeys(e).forEach((function(t){var r=e[t];n[t]=je(r)})),n},Ee=function(e,t){switch(void 0===t&&(t={}),e){case"array":return[];case"function":return t;case"set":return new Set;case"map":return new Map;case"date":return new Date(t);case"regExp":return new RegExp(t);case"math":return Math;default:return{}}},Oe=function(e){function t(){}return t.prototype=e,new t},Te={getValue:function(e,t,n){void 0===n&&(n="");for(var r=0,o=t.split(".");r<o.length;r++){if(void 0===(e=e[o[r]]))return n}return e},setValue:function(e,t,n){void 0===n&&(n={});for(var r=t.split("."),o=r[r.length-1],i=e,u=0,a=r;u<a.length;u++){var c=a[u];if("object"!=typeof i&&void 0!==i)return e;!i&&(i={}),!i[c]&&(i[c]={}),o===c&&(i[o]=n),i=i[c]}return e},mixIn:function(e,t,n){var r;for(var o in void 0===t&&(t={}),void 0===n&&(n=!1),t)for(var i in t[o]){var u=null!==(r=e.prototype)&&void 0!==r?r:e;(void 0===e[i]||n)&&(u[i]=t[o][i])}return e},enumInversion:function(e){for(var t in e){var n=e[t];"string"!=typeof n||e[n]||(e[n]=t)}return e},isNotObject:we,cloneDeep:je,createObjectVariable:Ee,createObject:Oe,inherit:function(e,t){return void 0===t&&(t=function(){}),t.prototype=Oe(e.prototype),t.prototype.super=e,t.prototype.constructor=t,t},getInstance:function(e,t){void 0===t&&(t=!1);for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return e._instance&&!t||(e._instance=new(e.bind.apply(e,ve([void 0],n,!1)))),e._instance},classDecorator:function(e){return function(t){for(var n in e)Reflect.has(t.prototype,n)||(t.prototype[n]=e[n])}},stringToJson:function(e){if("string"!==ge(e))return null;try{return JSON.parse(e)}catch(e){return null}},jsonToString:function(e){if(!be(e,["array","object","set","map"]))return"";try{return JSON.stringify(e)}catch(e){return""}},isWindow:function(e){return e&&e===e.window},emptyObject:function(e){void 0===e&&(e={});var t=Object.create(null);return Reflect.ownKeys(e).forEach((function(n){return t[n]=e[n]})),t}},Se=function(e,t){return void 0===t&&(t=[]),e.forEach((function(e){return"array"===ge(e)?Se(e,t):t.push(e)})),t},Pe={arrayRandom:function(e){return e.sort((function(){return Math.random()-.5}))},arrayUniq:function(e){return Array.from(new Set(e))},arrayDemote:Se},xe=void 0,qe=function(e){var t,n;return void 0===e&&(e=0),{promise:new Promise((function(r,o){t=r,n=o,e>0&&setTimeout((function(){return n("timeout")}),e)})),resolve:t,reject:n}},ke={throttle:function(e,t){var n=null;return function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];n||(n=setTimeout((function(){e.call.apply(e,ve([xe],r,!1)),n=null}),t))}},debounce:function(e,t){var n=null;return function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];n&&(clearTimeout(n),n=null),n=setTimeout((function(){e.call.apply(e,ve([xe],r,!1))}),t)}},defer:qe,catchAwait:function(e){return e.then((function(e){return[null,e]})).catch((function(e){return[e]}))}},Ae={createElement:function(e){var t,n,r=e.ele,o=e.style,i=e.attr,u=e.parent,a=r instanceof HTMLElement?r:document.createElement(null!=r?r:"div");return o&&(null===(t=Object.keys(o))||void 0===t||t.forEach((function(e){return a.style[e]=o[e]}))),i&&(null===(n=Object.keys(i))||void 0===n||n.forEach((function(e){return a[e]=i[e]}))),u&&u.appendChild(a),a}},He={addHandler:function(e,t,n){e.addEventListener?e.addEventListener(t,n,!1):e["on"+t]=n},stopBubble:function(e){(e=e||window.event).stopPropagation?e.stopPropagation():e.cancelBubble=!1},stopDefault:function(e){(e=e||window.event).preventDefault?e.preventDefault():e.returnValue=!1},removeHandler:function(e,t,n){e.removeEventListener?e.removeEventListener(t,n,!1):e["on"+t]=null},dispatchEvent:function(e,t){var n=new Event(t);e.dispatchEvent(n)}},Le={setStorage:function(e,t){try{localStorage.setItem(e,JSON.stringify(t))}catch(e){console.error(e)}},getStorage:function(e){try{var t=localStorage.getItem(e);return null==t?null:JSON.parse(t)}catch(e){return console.error(e),null}},clearStorage:function(e){try{e&&localStorage.removeItem(e),!e&&localStorage.clear()}catch(e){console.error(e)}}},Me=function(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!0),t&&(process.stdout.clearLine(0),process.stdout.cursorTo(0)),process.stdout.write(e),n&&process.stdout.write("\n")},Ce=function(e){return Me(e,!0,!1)},De=["\\","|","/","—","—"],Be=function(e){var t;void 0===e&&(e={});var n=e.loopList,r=void 0===n?De:n,o=e.isStop,i=void 0!==o&&o,u=e.timer,a=void 0===u?100:u,c=e.index,s=void 0===c?0:c,l=null!==(t=null==r?void 0:r.length)&&void 0!==t?t:0;if(!l)return e;if(i)return Ce("\n");s>=l-1&&(s=0);var f=r[s++];return Ce(f),setTimeout((function(){e.index=s,Be(e)}),a),e},Ie={logOneLine:Me,logLoop:Be},Re=function(){function e(e){this.fn=e,this.id=null,this.duration=1/0,this.isActive=!1}return e.prototype.start=function(e){if(!this.isActive)return this.duration=null!=e?e:1/0,this.isActive=!0,this.animate()},e.prototype.stop=function(e){void 0===e&&(e=this.id),this.isActive=!1,cancelAnimationFrame(e)},e.prototype.animate=function(e){if(void 0===e&&(e=0),this.isActive&&this.duration-- >0)return this.fn(e),this.id=requestAnimationFrame(this.animate.bind(this)),this.id},e}();function _e(e){return 0===e||1===e?1:e*_e(e-1)}function Fe(e,t){return _e(e)/(_e(t)*_e(e-t))}var Ne={AnimateFrame:Re,quadraticBezier:function(e,t,n){var r=1-n,o=n*n;return[2*r*n*e+o,2*r*n*t+o]},cubicBezier:function(e,t,n,r,o){var i=3*e,u=3*t,a=3*(n-e)-i,c=3*(r-t)-u,s=1-u-c;return[(1-i-a)*Math.pow(o,3)+a*Math.pow(o,2)+i*o,s*Math.pow(o,3)+c*Math.pow(o,2)+u*o]},factorial:_e,combination:Fe,NBezier:function(e,t){for(var n=e.length-1,r=[0,0],o=0;o<=n;o++){var i=Fe(n,o)*Math.pow(1-t,n-o)*Math.pow(t,o);r[0]+=i*e[o][0],r[1]+=i*e[o][1]}return r}},We=function(){function e(e){void 0===e&&(e={}),this.options=e,this.events={}}return e.prototype.on=function(e,t){return this.checkHandler(e,t),this.getHandler(e,[]).push(t),this},e.prototype.emit=function(e,t){return this.has(e)&&this.runHandler(e,t),this},e.prototype.un=function(e,t){return this.unHandler(e,t),this},e.prototype.once=function(e,t){var n=this;this.checkHandler(e,t);var r=function(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];return n.un(e,r),t.apply(void 0,o)};return this.on(e,r),this},e.prototype.clear=function(){return this.events={},this},e.prototype.has=function(e){return!!this.getHandler(e)},e.prototype.getHandler=function(e,t){var n;return"object"==typeof t&&(this.events[e]=null!==(n=this.events[e])&&void 0!==n?n:t),this.events[e]},e.prototype.handlerLength=function(e){var t,n;return null!==(n=null===(t=this.getHandler(e))||void 0===t?void 0:t.length)&&void 0!==n?n:0},e.prototype.watch=function(e,t){var n=this;this.checkHandler(e,t);return this.on(e,(function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];n.emit(n.prefixStr(e),t.apply(void 0,r))})),this},e.prototype.invoke=function(e,t){var n=this;return new Promise((function(r){n.once(n.prefixStr(e),r),n.emit(e,t)}))},e.prototype.runHandler=function(e,t){for(var n=0,r=this.getHandler(e);n<r.length;n++){var o=r[n];o&&o(t)}},e.prototype.unHandler=function(e,t){var n=this.getHandler(e);!t&&(this.events[e]=[]),t&&this.checkHandler(e,t);for(var r=0;r<n.length;r++)n&&n[r]===t&&(n[r]=null)},e.prototype.prefixStr=function(e){return"@".concat(e)},e.prototype.checkHandler=function(e,t){var n=this.options,r=n.blackList,o=void 0===r?[]:r,i=n.maxLen,u=void 0===i?1/0:i,a=this.handlerLength(e);if(0===(null==e?void 0:e.length))throw new Error("type.length can not be 0");if(!t||!e)throw new ReferenceError("type or handler is not defined");if("function"!=typeof t||"string"!=typeof e)throw new TypeError("".concat(t," is not a function or ").concat(e," is not a string"));if(o.includes(e))throw new Error("".concat(e," is not allow"));if(u<=a)throw new Error("the number of ".concat(e," must be less than ").concat(u))},e.Instance=function(e){return e._instance||Object.defineProperty(e,"_instance",{value:new e}),e._instance},e}();We.Instance(We);var Je,Ve=function(e){return e.prototype.messageCenter||(e.prototype.messageCenter=new We),e},Ge=function(){return Ge=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Ge.apply(this,arguments)},Ue=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},ze=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function u(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(u,a)}c((r=r.apply(e,t||[])).next())}))},Qe=function(e,t){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(a){return function(c){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,a[0]&&(u=0)),u;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return u.label++,{value:a[1],done:!1};case 5:u.label++,r=a[1],a=[0];continue;case 7:a=u.ops.pop(),u.trys.pop();continue;default:if(!(o=u.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){u=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){u.label=a[1];break}if(6===a[0]&&u.label<o[1]){u.label=o[1],o=a;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(a);break}o[2]&&u.ops.pop(),u.trys.pop();continue}a=t.call(e,u)}catch(e){a=[6,e],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}},Ke=function(){function e(e){var t=this;this.fix="@~&$",this.init=function(){t.messageCenter.on("push:handler",t.run),t.messageCenter.on("run:success:handler",t.run),t.messageCenter.on("run:success:handler",t.finish),t.messageCenter.on("run:error:handler",t.run),t.messageCenter.on("run:error:handler",t.finish)},this.defineProps=function(e,n){Object.defineProperty(t,n,{value:e})},this.push=function(e){var n;t.checkHandler(e);var r=(n=t.defer()).resolve,o=n.reject,i=n.promise,u=t.fixStr(e.name);return t.queues=t.queues.concat(e.children.map((function(e){return{defer:e,name:u}}))),t.queueTemp[u]=Ge(Ge({},e),{result:[]}),t.messageCenter.emit("push:handler",o),t.messageCenter.on(u,r),i},this.unshift=function(e){return t.queues.splice(0,e)},this.run=function(e){var n=e.reject;return ze(t,void 0,void 0,(function(){var e,t,r,o,i;return Qe(this,(function(u){switch(u.label){case 0:if("pending"===this.stateProxy())return[2,void 0];if(0===this.queues.length)return[2,this.stateProxy("idle")];this.stateProxy("pending"),e=this.unshift(null!==(i=null===(o=this.props)||void 0===o?void 0:o.maxLen)&&void 0!==i?i:10),u.label=1;case 1:return u.trys.push([1,3,,4]),[4,Promise.all(e.map((function(e,t){return e.defer().catch((function(e){return e}))})))];case 2:return t=u.sent(),[2,this.handlerSuccess({res:t,queues:e})];case 3:return r=u.sent(),[2,this.handlerError({reject:n,error:r,queues:e})];case 4:return[2]}}))}))},this.clear=function(){t.queues=[],t.queueTemp={},t.props=null,t.stateProxy("idle"),t.messageCenter.clear()},this.finish=function(e){var n=e.res,r=void 0===n?[]:n,o=e.queues,i=e.error,u=void 0===i?"err":i,a=t.queueTemp;o.forEach((function(e,n){var o,i,c,s=a[e.name];null==s||s.result.push(null!==(o=r[n])&&void 0!==o?o:u),(null===(i=null==s?void 0:s.result)||void 0===i?void 0:i.length)===(null===(c=null==s?void 0:s.children)||void 0===c?void 0:c.length)&&(t.messageCenter.emit(e.name,null==s?void 0:s.result),a[e.name]=null)}))},this.handlerSuccess=function(e){return t.stateProxy("fulfilled"),t.messageCenter.emit("run:success:handler",e)},this.handlerError=function(e){var n=e.reject,r=e.error;return t.stateProxy("rejected"),n&&"function"==typeof n&&n(r),t.messageCenter.emit("run:error:handler",e)},this.stateProxy=function(e){return e&&(t.state=e),t.state},this.defer=function(){var e,t;return{promise:new Promise((function(n,r){e=n,t=r})),resolve:e,reject:t}},this.clear(),e&&this.defineProps(e,"props"),this.init()}return e.prototype.checkHandler=function(e){var t,n;if(!e)throw new ReferenceError("queue is not defined");if(!(e.children instanceof Array)||"object"!=typeof e)throw new TypeError("queue should be an object and queue.children should be an array");if(0===(null===(t=e.children)||void 0===t?void 0:t.length))throw new Error("queue.children.length can not be 0");if(null===(n=e.children)||void 0===n?void 0:n.find((function(e){return function(e){return!e||"function"!=typeof e}(e)})))throw new Error("queueList should have defer")},e.prototype.fixStr=function(e){return"".concat(this.fix).concat(e)},e=function(e,t,n,r){var o,i=arguments.length,u=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)u=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(u=(i<3?o(u):i>3?o(t,n,u):o(t,n))||u);return i>3&&u&&Object.defineProperty(t,n,u),u}([Ve,Ue("design:paramtypes",[Object])],e),e}(),$e=function(){return $e=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},$e.apply(this,arguments)};function Ye(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}!function(e){e["[object Array]"]="array",e["[object Object]"]="object",e["[object Function]"]="function",e["[object Set]"]="set",e["[object Map]"]="map",e["[object WeakMap]"]="weakMap",e["[object WeakSet]"]="weakSet",e["[object Date]"]="date",e["[object RegExp]"]="regExp",e["[object Math]"]="math"}(Je||(Je={}));var Ze={types:Je},Xe=function(e,t){void 0===t&&(t={});var n=Object.keys(t);if(0===n.length)return e;var r=n.map((function(e){return"".concat(e,"=").concat(t[e])}));return"".concat(e).concat(e.includes("?")?"&":"?").concat(r.join("&"))},et=function(e){var t=typeof e;if(null===e)return"null";if("object"===t){var n=Object.prototype.toString.call(e);return Je[n]}return t},tt=function(e,t){void 0===t&&(t=[]);var n=et(e);return t.indexOf(n)>0},nt={randomNum:function(e,t,n){return void 0===n&&(n=!1),Math.floor(Math.random()*(t-e+(n?1:0))+e)},urlSplit:function(e){var t={};return e.includes("?")?(e.split("?")[1].split("&").forEach((function(e){var n=e.split("=")[0];t[n]=e.split("=")[1]})),t):t},urlJoin:Xe,getType:et,getTypeByList:tt},rt=function(e,t){return"object"!=typeof e||"null"===t},ot=function(e){var t=et(e);if(rt(e,t))return e;var n=it(t,e);return"map"===t?e.forEach((function(e,t){n.set(t,ot(e))})):"set"===t?e.forEach((function(e){n.add(ot(e))})):Reflect.ownKeys(e).forEach((function(t){var r=e[t];n[t]=ot(r)})),n},it=function(e,t){switch(void 0===t&&(t={}),e){case"array":return[];case"function":return t;case"set":return new Set;case"map":return new Map;case"date":return new Date(t);case"regExp":return new RegExp(t);case"math":return Math;default:return{}}},ut=function(e){function t(){}return t.prototype=e,new t},at=function(e){if("string"!==et(e))return null;try{return JSON.parse(e)}catch(e){return null}},ct=function(e){if(!tt(e,["array","object","set","map"]))return"";try{return JSON.stringify(e)}catch(e){return""}},st={getValue:function(e,t,n){void 0===n&&(n="");for(var r=0,o=t.split(".");r<o.length;r++){if(void 0===(e=e[o[r]]))return n}return e},setValue:function(e,t,n){void 0===n&&(n={});for(var r=t.split("."),o=r[r.length-1],i=e,u=0,a=r;u<a.length;u++){var c=a[u];if("object"!=typeof i&&void 0!==i)return e;!i&&(i={}),!i[c]&&(i[c]={}),o===c&&(i[o]=n),i=i[c]}return e},mixIn:function(e,t,n){var r;for(var o in void 0===t&&(t={}),void 0===n&&(n=!1),t)for(var i in t[o]){var u=null!==(r=e.prototype)&&void 0!==r?r:e;(void 0===e[i]||n)&&(u[i]=t[o][i])}return e},enumInversion:function(e){for(var t in e){var n=e[t];"string"!=typeof n||e[n]||(e[n]=t)}return e},isNotObject:rt,cloneDeep:ot,createObjectVariable:it,createObject:ut,inherit:function(e,t){return void 0===t&&(t=function(){}),t.prototype=ut(e.prototype),t.prototype.super=e,t.prototype.constructor=t,t},getInstance:function(e,t){void 0===t&&(t=!1);for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return e._instance&&!t||(e._instance=new(e.bind.apply(e,Ye([void 0],n,!1)))),e._instance},classDecorator:function(e){return function(t){for(var n in e)Reflect.has(t.prototype,n)||(t.prototype[n]=e[n])}},stringToJson:at,jsonToString:ct,isWindow:function(e){return e&&e===e.window}},lt=function(e,t){return void 0===t&&(t=[]),e.forEach((function(e){return"array"===et(e)?lt(e,t):t.push(e)})),t},ft={arrayRandom:function(e){return e.sort((function(){return Math.random()-.5}))},arrayUniq:function(e){return Array.from(new Set(e))},arrayDemote:lt},pt=void 0,ht=function(e){var t,n;return void 0===e&&(e=0),e>0&&setTimeout(n,e),{promise:new Promise((function(e,r){t=e,n=r})),resolve:t,reject:n}},dt={throttle:function(e,t){var n=null;return function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];n||(n=setTimeout((function(){e.call.apply(e,Ye([pt],r,!1)),n=null}),t))}},debounce:function(e,t){var n=null;return function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];n&&(clearTimeout(n),n=null),n=setTimeout((function(){e.call.apply(e,Ye([pt],r,!1))}),t)}},defer:ht,catchAwait:function(e){return e.then((function(e){return[null,e]})).catch((function(e){return[e]}))}},vt={createElement:function(e){var t,n,r=e.ele,o=e.style,i=e.attr,u=e.parent,a=r instanceof HTMLElement?r:document.createElement(null!=r?r:"div");return o&&(null===(t=Object.keys(o))||void 0===t||t.forEach((function(e){return a.style[e]=o[e]}))),i&&(null===(n=Object.keys(i))||void 0===n||n.forEach((function(e){return a[e]=i[e]}))),u&&u.appendChild(a),a}},yt={addHandler:function(e,t,n){e.addEventListener?e.addEventListener(t,n,!1):e["on"+t]=n},stopBubble:function(e){(e=e||window.event).stopPropagation?e.stopPropagation():e.cancelBubble=!1},stopDefault:function(e){(e=e||window.event).preventDefault?e.preventDefault():e.returnValue=!1},removeHandler:function(e,t,n){e.removeEventListener?e.removeEventListener(t,n,!1):e["on"+t]=null},dispatchEvent:function(e,t){var n=new Event(t);e.dispatchEvent(n)}},gt={setStorage:function(e,t){try{localStorage.setItem(e,JSON.stringify(t))}catch(e){console.error(e)}},getStorage:function(e){try{var t=localStorage.getItem(e);return null==t?null:JSON.parse(t)}catch(e){return console.error(e),null}},clearStorage:function(e){try{e&&localStorage.removeItem(e),!e&&localStorage.clear()}catch(e){console.error(e)}}},bt=function(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!0),t&&(process.stdout.clearLine(0),process.stdout.cursorTo(0)),process.stdout.write(e),n&&process.stdout.write("\n")},mt=function(e){return bt(e,!0,!1)},wt=["\\","|","/","—","—"],jt=function(e){var t;void 0===e&&(e={});var n=e.loopList,r=void 0===n?wt:n,o=e.isStop,i=void 0!==o&&o,u=e.timer,a=void 0===u?100:u,c=e.index,s=void 0===c?0:c,l=null!==(t=null==r?void 0:r.length)&&void 0!==t?t:0;if(!l)return e;if(i)return mt("\n");s>=l-1&&(s=0);var f=r[s++];return mt(f),setTimeout((function(){e.index=s,jt(e)}),a),e},Et={logOneLine:bt,logLoop:jt},Ot=function(){function e(e){this.fn=e,this.id=null,this.duration=1/0,this.isActive=!1}return e.prototype.start=function(e){this.isActive||(this.duration=null!=e?e:1/0,this.isActive=!0,this.animate())},e.prototype.stop=function(){this.isActive=!1,cancelAnimationFrame(this.id)},e.prototype.animate=function(e){void 0===e&&(e=0),this.isActive&&this.duration-- >0&&(this.fn(e),this.id=requestAnimationFrame(this.animate.bind(this)))},e}();function Tt(e){return 0===e||1===e?1:e*Tt(e-1)}function St(e,t){return Tt(e)/(Tt(t)*Tt(e-t))}var Pt={AnimateFrame:Ot,quadraticBezier:function(e,t,n){var r=1-n,o=n*n;return[2*r*n*e+o,2*r*n*t+o]},cubicBezier:function(e,t,n,r,o){var i=3*e,u=3*t,a=3*(n-e)-i,c=3*(r-t)-u,s=1-u-c;return[(1-i-a)*Math.pow(o,3)+a*Math.pow(o,2)+i*o,s*Math.pow(o,3)+c*Math.pow(o,2)+u*o]},factorial:Tt,combination:St,NBezier:function(e,t){for(var n=e.length-1,r=[0,0],o=0;o<=n;o++){var i=St(n,o)*Math.pow(1-t,n-o)*Math.pow(t,o);r[0]+=i*e[o][0],r[1]+=i*e[o][1]}return r}},xt=function(){function e(e){void 0===e&&(e={}),this.options=e,this.events={}}return e.prototype.on=function(e,t){return this.checkHandler(e,t),this.getHandler(e,[]).push(t),this},e.prototype.emit=function(e,t){return this.has(e)&&this.runHandler(e,t),this},e.prototype.un=function(e,t){return this.unHandler(e,t),this},e.prototype.once=function(e,t){var n=this;this.checkHandler(e,t);var r=function(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];return n.un(e,r),t.apply(void 0,o)};return this.on(e,r),this},e.prototype.clear=function(){return this.events={},this},e.prototype.has=function(e){return!!this.getHandler(e)},e.prototype.getHandler=function(e,t){var n;return"object"==typeof t&&(this.events[e]=null!==(n=this.events[e])&&void 0!==n?n:t),this.events[e]},e.prototype.handlerLength=function(e){var t,n;return null!==(n=null===(t=this.getHandler(e))||void 0===t?void 0:t.length)&&void 0!==n?n:0},e.prototype.watch=function(e,t){var n=this;this.checkHandler(e,t);return this.on(e,(function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];n.emit(n.prefixStr(e),t.apply(void 0,r))})),this},e.prototype.invoke=function(e,t){var n=this;return new Promise((function(r){n.once(n.prefixStr(e),r),n.emit(e,t)}))},e.prototype.runHandler=function(e,t){for(var n=0,r=this.getHandler(e);n<r.length;n++){var o=r[n];o&&o(t)}},e.prototype.unHandler=function(e,t){var n=this.getHandler(e);!t&&(this.events[e]=[]),t&&this.checkHandler(e,t);for(var r=0;r<n.length;r++)n&&n[r]===t&&(n[r]=null)},e.prototype.prefixStr=function(e){return"@".concat(e)},e.prototype.checkHandler=function(e,t){var n=this.options,r=n.blackList,o=void 0===r?[]:r,i=n.maxLen,u=void 0===i?1/0:i,a=this.handlerLength(e);if(0===(null==e?void 0:e.length))throw new Error("type.length can not be 0");if(!t||!e)throw new ReferenceError("type or handler is not defined");if("function"!=typeof t||"string"!=typeof e)throw new TypeError("".concat(t," is not a function or ").concat(e," is not a string"));if(o.includes(e))throw new Error("".concat(e," is not allow"));if(u<=a)throw new Error("the number of ".concat(e," must be less than ").concat(u))},e.Instance=function(e){return e._instance||Object.defineProperty(e,"_instance",{value:new e}),e._instance},e}();xt.Instance(xt);var qt=function(e){return e.prototype.messageCenter||(e.prototype.messageCenter=new xt),e},kt=function(){return kt=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},kt.apply(this,arguments)},At=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},Ht=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function u(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(u,a)}c((r=r.apply(e,t||[])).next())}))},Lt=function(e,t){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(a){return function(c){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,a[0]&&(u=0)),u;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return u.label++,{value:a[1],done:!1};case 5:u.label++,r=a[1],a=[0];continue;case 7:a=u.ops.pop(),u.trys.pop();continue;default:if(!(o=u.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){u=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){u.label=a[1];break}if(6===a[0]&&u.label<o[1]){u.label=o[1],o=a;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(a);break}o[2]&&u.ops.pop(),u.trys.pop();continue}a=t.call(e,u)}catch(e){a=[6,e],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}},Mt=function(){function e(e){var t=this;this.fix="@~&$",this.init=function(){t.messageCenter.on("push:handler",t.run),t.messageCenter.on("run:success:handler",t.run),t.messageCenter.on("run:success:handler",t.finish),t.messageCenter.on("run:error:handler",t.run),t.messageCenter.on("run:error:handler",t.finish)},this.defineProps=function(e,n){Object.defineProperty(t,n,{value:e})},this.push=function(e){var n;t.checkHandler(e);var r=(n=t.defer()).resolve,o=n.reject,i=n.promise,u=t.fixStr(e.name);return t.queues=t.queues.concat(e.children.map((function(e){return{defer:e,name:u}}))),t.queueTemp[u]=kt(kt({},e),{result:[]}),t.messageCenter.emit("push:handler",o),t.messageCenter.on(u,r),i},this.unshift=function(e){return t.queues.splice(0,e)},this.run=function(e){var n=e.reject;return Ht(t,void 0,void 0,(function(){var e,t,r,o,i;return Lt(this,(function(u){switch(u.label){case 0:if("pending"===this.stateProxy())return[2,void 0];if(0===this.queues.length)return[2,this.stateProxy("idle")];this.stateProxy("pending"),e=this.unshift(null!==(i=null===(o=this.props)||void 0===o?void 0:o.maxLen)&&void 0!==i?i:10),u.label=1;case 1:return u.trys.push([1,3,,4]),[4,Promise.all(e.map((function(e,t){return e.defer().catch((function(e){return e}))})))];case 2:return t=u.sent(),[2,this.handlerSuccess({res:t,queues:e})];case 3:return r=u.sent(),[2,this.handlerError({reject:n,error:r,queues:e})];case 4:return[2]}}))}))},this.clear=function(){t.queues=[],t.queueTemp={},t.props=null,t.stateProxy("idle"),t.messageCenter.clear()},this.finish=function(e){var n=e.res,r=void 0===n?[]:n,o=e.queues,i=e.error,u=void 0===i?"err":i,a=t.queueTemp;o.forEach((function(e,n){var o,i,c,s=a[e.name];null==s||s.result.push(null!==(o=r[n])&&void 0!==o?o:u),(null===(i=null==s?void 0:s.result)||void 0===i?void 0:i.length)===(null===(c=null==s?void 0:s.children)||void 0===c?void 0:c.length)&&(t.messageCenter.emit(e.name,null==s?void 0:s.result),a[e.name]=null)}))},this.handlerSuccess=function(e){return t.stateProxy("fulfilled"),t.messageCenter.emit("run:success:handler",e)},this.handlerError=function(e){var n=e.reject,r=e.error;return t.stateProxy("rejected"),n&&"function"==typeof n&&n(r),t.messageCenter.emit("run:error:handler",e)},this.stateProxy=function(e){return e&&(t.state=e),t.state},this.defer=function(){var e,t;return{promise:new Promise((function(n,r){e=n,t=r})),resolve:e,reject:t}},this.clear(),e&&this.defineProps(e,"props"),this.init()}return e.prototype.checkHandler=function(e){var t,n;if(!e)throw new ReferenceError("queue is not defined");if(!(e.children instanceof Array)||"object"!=typeof e)throw new TypeError("queue should be an object and queue.children should be an array");if(0===(null===(t=e.children)||void 0===t?void 0:t.length))throw new Error("queue.children.length can not be 0");if(null===(n=e.children)||void 0===n?void 0:n.find((function(e){return function(e){return!e||"function"!=typeof e}(e)})))throw new Error("queueList should have defer")},e.prototype.fixStr=function(e){return"".concat(this.fix).concat(e)},e=function(e,t,n,r){var o,i=arguments.length,u=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)u=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(u=(i<3?o(u):i>3?o(t,n,u):o(t,n))||u);return i>3&&u&&Object.defineProperty(t,n,u),u}([qt,At("design:paramtypes",[Object])],e),e}();$e($e($e($e($e($e($e($e($e($e($e({},st),nt),ft),dt),vt),Ze),yt),gt),Et),Pt),{eventMessageCenter:xt,taskQueueLib:Mt});
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("http"),t=require("https"),n=require("url"),r=function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)};function o(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}exports.types=void 0,function(e){e["[object Array]"]="array",e["[object Object]"]="object",e["[object Function]"]="function",e["[object Set]"]="set",e["[object Map]"]="map",e["[object WeakMap]"]="weakMap",e["[object WeakSet]"]="weakSet",e["[object Date]"]="date",e["[object RegExp]"]="regExp",e["[object Math]"]="math"}(exports.types||(exports.types={}));var i={types:exports.types},u=function(e,t,n){return void 0===n&&(n=!1),Math.floor(Math.random()*(t-e+(n?1:0))+e)},a=function(e){var t={};return e.includes("?")?(e.split("?")[1].split("&").forEach((function(e){var n=e.split("=")[0];t[n]=e.split("=")[1]})),t):t},c=function(e,t){void 0===t&&(t={});var n=Object.keys(t);if(0===n.length)return e;var r=n.map((function(e){return"".concat(e,"=").concat(t[e])}));return"".concat(e).concat(e.includes("?")?"&":"?").concat(r.join("&"))},s=function(e){var t=typeof e;if(null===e)return"null";if("object"===t){var n=Object.prototype.toString.call(e);return exports.types[n]}return t},l=function(e,t){void 0===t&&(t=[]);var n=s(e);return t.includes(n)},f=function(e,t){return void 0===t&&(t="-"),e.replace(/[A-Z]/g,(function(e){return"".concat(t).concat(e.toLowerCase())}))},p={randomNum:u,urlSplit:a,urlJoin:c,getType:s,getTypeByList:l,toKebabCase:f},h=function(e,t,n){void 0===n&&(n="");for(var r=0,o=t.split(".");r<o.length;r++){if(void 0===(e=e[o[r]]))return n}return e},d=function(e,t,n){void 0===n&&(n={});for(var r=t.split("."),o=r[r.length-1],i=e,u=0,a=r;u<a.length;u++){var c=a[u];if("object"!=typeof i&&void 0!==i)return e;!i&&(i={}),!i[c]&&(i[c]={}),o===c&&(i[o]=n),i=i[c]}return e},v=function(e,t,n){var r;for(var o in void 0===t&&(t={}),void 0===n&&(n=!1),t)for(var i in t[o]){var u=null!==(r=null==e?void 0:e.prototype)&&void 0!==r?r:e;(void 0===(null==e?void 0:e[i])||n)&&(u[i]=t[o][i])}return e},y=function(e){for(var t in e){var n=e[t];"string"!=typeof n||e[n]||(e[n]=t)}return e},g=function(e,t){return"object"!=typeof e||"null"===t},b=function(e){var t=s(e);if(g(e,t))return e;var n=m(t,e);return"map"===t?e.forEach((function(e,t){n.set(t,b(e))})):"set"===t?e.forEach((function(e){n.add(b(e))})):Reflect.ownKeys(e).forEach((function(t){var r=e[t];n[t]=b(r)})),n},m=function(e,t){switch(void 0===t&&(t={}),e){case"array":return[];case"function":return t;case"set":return new Set;case"map":return new Map;case"date":return new Date(t);case"regExp":return new RegExp(t);case"math":return Math;default:return{}}},w=function(e){function t(){}return t.prototype=e,new t},j=function(e,t){return void 0===t&&(t=function(){}),t.prototype=w(e.prototype),t.prototype.super=e,t.prototype.constructor=t,t},E=function(e,t){void 0===t&&(t=!1);for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return e._instance&&!t||(e._instance=new(e.bind.apply(e,o([void 0],n,!1)))),e._instance},O=function(e){return function(t){for(var n in e)Reflect.has(t.prototype,n)||(t.prototype[n]=e[n])}},T=function(e){if("string"!==s(e))return null;try{return JSON.parse(e)}catch(e){return null}},S=function(e){if(!l(e,["array","object","set","map"]))return"";try{return JSON.stringify(e)}catch(e){return""}},P=function(e){return e&&e===e.window},x=function(e){void 0===e&&(e={});var t=Object.create(null);return Reflect.ownKeys(e).forEach((function(n){return t[n]=e[n]})),t},q=function(e){void 0===e&&(e={});var t=x(e);return Reflect.ownKeys(t).length<=0},k={getValue:h,setValue:d,mixIn:v,enumInversion:y,isNotObject:g,cloneDeep:b,createObjectVariable:m,createObject:w,inherit:j,getInstance:E,classDecorator:O,stringToJson:T,jsonToString:S,isWindow:P,emptyObject:x,isEmptyObject:q},A=function(e){return e.sort((function(){return Math.random()-.5}))},H=function(e){return Array.from(new Set(e))},L=function(e,t){return void 0===t&&(t=[]),e.forEach((function(e){return"array"===s(e)?L(e,t):t.push(e)})),t},M=function(e,t){return void 0===t&&(t=0),{item:e[t],current:(t+1)%e.length}},C={arrayRandom:A,arrayUniq:H,arrayDemote:L,arrayLoop:M},D=void 0,B=function(e,t){var n=null;return function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];n||(n=setTimeout((function(){e.call.apply(e,o([D],r,!1)),n=null}),t))}},I=function(e,t){var n=null;return function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];n&&(clearTimeout(n),n=null),n=setTimeout((function(){e.call.apply(e,o([D],r,!1))}),t)}},R=function(e){var t,n;return void 0===e&&(e=0),{promise:new Promise((function(r,o){t=r,n=o,e>0&&setTimeout((function(){return n("timeout")}),e)})),resolve:t,reject:n}},_=function(e){return e.then((function(e){return[null,e]})).catch((function(e){return[e]}))},F={throttle:B,debounce:I,defer:R,catchAwait:_},N=function(e){var t,n,r=e.ele,o=e.style,i=e.attr,u=e.parent,a=r instanceof HTMLElement?r:document.createElement(null!=r?r:"div");return o&&(null===(t=Object.keys(o))||void 0===t||t.forEach((function(e){return a.style[e]=o[e]}))),i&&(null===(n=Object.keys(i))||void 0===n||n.forEach((function(e){return a[e]=i[e]}))),u&&u.appendChild(a),a},W={createElement:N},J=function(e,t,n){e.addEventListener?e.addEventListener(t,n,!1):e["on"+t]=n},V=function(e){(e=e||window.event).stopPropagation?e.stopPropagation():e.cancelBubble=!1},G=function(e){(e=e||window.event).preventDefault?e.preventDefault():e.returnValue=!1},U=function(e,t,n){if(e.removeEventListener)e.removeEventListener(t,n,!1);else{var r="on"+t;"function"==typeof e[r]&&(e[r]=function(){})}},z=function(e,t){var n=new Event(t);e.dispatchEvent(n)},Q={addHandler:J,stopBubble:V,stopDefault:G,removeHandler:U,dispatchEvent:z},K=function(e,t){try{localStorage.setItem(e,JSON.stringify(t))}catch(e){console.error(e)}},$=function(e){try{var t=localStorage.getItem(e);return null==t?null:JSON.parse(t)}catch(e){return console.error(e),null}},Y=function(e){try{e&&localStorage.removeItem(e),!e&&localStorage.clear()}catch(e){console.error(e)}},Z={setStorage:K,getStorage:$,clearStorage:Y},X=function(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!0),t&&(process.stdout.clearLine(0),process.stdout.cursorTo(0)),process.stdout.write(e),n&&process.stdout.write("\n")},ee=function(e){return X(e,!0,!1)},te=["\\","|","/","—","—"],ne=function(e){var t;void 0===e&&(e={});var n=e.loopList,r=void 0===n?te:n,o=e.isStop,i=void 0!==o&&o,u=e.timer,a=void 0===u?100:u,c=e.index,s=void 0===c?0:c,l=null!==(t=null==r?void 0:r.length)&&void 0!==t?t:0;if(!l)return e;if(i)return ee("\n");s>=l-1&&(s=0);var f=r[s++];return ee(f),setTimeout((function(){e.index=s,ne(e)}),a),e},re={logOneLine:X,logLoop:ne},oe=function(){function e(e){this.fn=e,this.id=null,this.duration=1/0,this.isActive=!1}return e.prototype.start=function(e){if(!this.isActive)return this.duration=null!=e?e:1/0,this.isActive=!0,this.animate()},e.prototype.stop=function(e){void 0===e&&(e=this.id),this.isActive=!1,cancelAnimationFrame(e)},e.prototype.animate=function(e){if(void 0===e&&(e=0),this.isActive&&this.duration-- >0)return this.fn(e),this.id=requestAnimationFrame(this.animate.bind(this)),this.id},e}();function ie(e,t,n){var r=1-n,o=n*n;return[2*r*n*e+o,2*r*n*t+o]}function ue(e,t,n,r,o){var i=3*e,u=3*t,a=3*(n-e)-i,c=3*(r-t)-u,s=1-u-c;return[(1-i-a)*Math.pow(o,3)+a*Math.pow(o,2)+i*o,s*Math.pow(o,3)+c*Math.pow(o,2)+u*o]}function ae(e){return 0===e||1===e?1:e*ae(e-1)}function ce(e,t){return ae(e)/(ae(t)*ae(e-t))}function se(e,t){for(var n=e.length-1,r=[0,0],o=0;o<=n;o++){var i=ce(n,o)*Math.pow(1-t,n-o)*Math.pow(t,o);r[0]+=i*e[o][0],r[1]+=i*e[o][1]}return r}var le,fe={AnimateFrame:oe,quadraticBezier:ie,cubicBezier:ue,factorial:ae,combination:ce,NBezier:se},pe=function(){function e(e){void 0===e&&(e={}),this.options=e,this.events=Object.create(null)}return e.prototype.on=function(e,t){return this.checkHandler(e,t),this.getHandler(e,[]).push(t),this},e.prototype.emit=function(e,t){return this.has(e)&&this.runHandler(e,t),this},e.prototype.un=function(e,t){return this.unHandler(e,t),this},e.prototype.once=function(e,t){var n=this;this.checkHandler(e,t);var r=function(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];return n.un(e,r),t.apply(void 0,o)};return this.on(e,r),this},e.prototype.clear=function(){return this.events=Object.create(null),this},e.prototype.has=function(e){return!!this.getHandler(e)},e.prototype.getHandler=function(e,t){var n;return"object"==typeof t&&(this.events[e]=null!==(n=this.events[e])&&void 0!==n?n:t),this.events[e]},e.prototype.handlerLength=function(e){var t,n;return null!==(n=null===(t=this.getHandler(e))||void 0===t?void 0:t.length)&&void 0!==n?n:0},e.prototype.watch=function(e,t){var n=this;this.checkHandler(e,t);return this.on(e,(function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];n.emit(n.prefixStr(e),t.apply(void 0,r))})),this},e.prototype.invoke=function(e,t){var n=this;return new Promise((function(r){n.once(n.prefixStr(e),r),n.emit(e,t)}))},e.prototype.runHandler=function(e,t){for(var n=0,r=this.getHandler(e);n<r.length;n++){var o=r[n];o&&o(t)}},e.prototype.unHandler=function(e,t){var n=this.getHandler(e);!t&&(this.events[e]=[]),t&&this.checkHandler(e,t);for(var r=0;r<n.length;r++)n&&n[r]===t&&(n[r]=null)},e.prototype.prefixStr=function(e){return"@".concat(e)},e.prototype.checkHandler=function(e,t){var n=this.options,r=n.blackList,o=void 0===r?[]:r,i=n.maxLen,u=void 0===i?1/0:i,a=this.handlerLength(e);if(0===(null==e?void 0:e.length))throw new Error("type.length can not be 0");if(!t||!e)throw new ReferenceError("type or handler is not defined");if("function"!=typeof t||"string"!=typeof e)throw new TypeError("".concat(t," is not a function or ").concat(e," is not a string"));if(o.includes(e))throw new Error("".concat(e," is not allow"));if(u<=a)throw new Error("the number of ".concat(e," must be less than ").concat(u))},e.Instance=function(e){return e._instance||Object.defineProperty(e,"_instance",{value:new e}),e._instance},e}(),he=pe.Instance(pe),de=function(){return de=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},de.apply(this,arguments)};function ve(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}!function(e){e["[object Array]"]="array",e["[object Object]"]="object",e["[object Function]"]="function",e["[object Set]"]="set",e["[object Map]"]="map",e["[object WeakMap]"]="weakMap",e["[object WeakSet]"]="weakSet",e["[object Date]"]="date",e["[object RegExp]"]="regExp",e["[object Math]"]="math"}(le||(le={}));var ye={types:le},ge=function(e){var t=typeof e;if(null===e)return"null";if("object"===t){var n=Object.prototype.toString.call(e);return le[n]}return t},be=function(e,t){void 0===t&&(t=[]);var n=ge(e);return t.indexOf(n)>0},me={randomNum:function(e,t,n){return void 0===n&&(n=!1),Math.floor(Math.random()*(t-e+(n?1:0))+e)},urlSplit:function(e){var t={};return e.includes("?")?(e.split("?")[1].split("&").forEach((function(e){var n=e.split("=")[0];t[n]=e.split("=")[1]})),t):t},urlJoin:function(e,t){void 0===t&&(t={});var n=Object.keys(t);if(0===n.length)return e;var r=n.map((function(e){return"".concat(e,"=").concat(t[e])}));return"".concat(e).concat(e.includes("?")?"&":"?").concat(r.join("&"))},getType:ge,getTypeByList:be},we=function(e,t){return"object"!=typeof e||"null"===t},je=function(e){var t=ge(e);if(we(e,t))return e;var n=Ee(t,e);return"map"===t?e.forEach((function(e,t){n.set(t,je(e))})):"set"===t?e.forEach((function(e){n.add(je(e))})):Reflect.ownKeys(e).forEach((function(t){var r=e[t];n[t]=je(r)})),n},Ee=function(e,t){switch(void 0===t&&(t={}),e){case"array":return[];case"function":return t;case"set":return new Set;case"map":return new Map;case"date":return new Date(t);case"regExp":return new RegExp(t);case"math":return Math;default:return{}}},Oe=function(e){function t(){}return t.prototype=e,new t},Te={getValue:function(e,t,n){void 0===n&&(n="");for(var r=0,o=t.split(".");r<o.length;r++){if(void 0===(e=e[o[r]]))return n}return e},setValue:function(e,t,n){void 0===n&&(n={});for(var r=t.split("."),o=r[r.length-1],i=e,u=0,a=r;u<a.length;u++){var c=a[u];if("object"!=typeof i&&void 0!==i)return e;!i&&(i={}),!i[c]&&(i[c]={}),o===c&&(i[o]=n),i=i[c]}return e},mixIn:function(e,t,n){var r;for(var o in void 0===t&&(t={}),void 0===n&&(n=!1),t)for(var i in t[o]){var u=null!==(r=e.prototype)&&void 0!==r?r:e;(void 0===e[i]||n)&&(u[i]=t[o][i])}return e},enumInversion:function(e){for(var t in e){var n=e[t];"string"!=typeof n||e[n]||(e[n]=t)}return e},isNotObject:we,cloneDeep:je,createObjectVariable:Ee,createObject:Oe,inherit:function(e,t){return void 0===t&&(t=function(){}),t.prototype=Oe(e.prototype),t.prototype.super=e,t.prototype.constructor=t,t},getInstance:function(e,t){void 0===t&&(t=!1);for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return e._instance&&!t||(e._instance=new(e.bind.apply(e,ve([void 0],n,!1)))),e._instance},classDecorator:function(e){return function(t){for(var n in e)Reflect.has(t.prototype,n)||(t.prototype[n]=e[n])}},stringToJson:function(e){if("string"!==ge(e))return null;try{return JSON.parse(e)}catch(e){return null}},jsonToString:function(e){if(!be(e,["array","object","set","map"]))return"";try{return JSON.stringify(e)}catch(e){return""}},isWindow:function(e){return e&&e===e.window},emptyObject:function(e){void 0===e&&(e={});var t=Object.create(null);return Reflect.ownKeys(e).forEach((function(n){return t[n]=e[n]})),t}},Se=function(e,t){return void 0===t&&(t=[]),e.forEach((function(e){return"array"===ge(e)?Se(e,t):t.push(e)})),t},Pe={arrayRandom:function(e){return e.sort((function(){return Math.random()-.5}))},arrayUniq:function(e){return Array.from(new Set(e))},arrayDemote:Se},xe=void 0,qe=function(e){var t,n;return void 0===e&&(e=0),{promise:new Promise((function(r,o){t=r,n=o,e>0&&setTimeout((function(){return n("timeout")}),e)})),resolve:t,reject:n}},ke={throttle:function(e,t){var n=null;return function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];n||(n=setTimeout((function(){e.call.apply(e,ve([xe],r,!1)),n=null}),t))}},debounce:function(e,t){var n=null;return function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];n&&(clearTimeout(n),n=null),n=setTimeout((function(){e.call.apply(e,ve([xe],r,!1))}),t)}},defer:qe,catchAwait:function(e){return e.then((function(e){return[null,e]})).catch((function(e){return[e]}))}},Ae={createElement:function(e){var t,n,r=e.ele,o=e.style,i=e.attr,u=e.parent,a=r instanceof HTMLElement?r:document.createElement(null!=r?r:"div");return o&&(null===(t=Object.keys(o))||void 0===t||t.forEach((function(e){return a.style[e]=o[e]}))),i&&(null===(n=Object.keys(i))||void 0===n||n.forEach((function(e){return a[e]=i[e]}))),u&&u.appendChild(a),a}},He={addHandler:function(e,t,n){e.addEventListener?e.addEventListener(t,n,!1):e["on"+t]=n},stopBubble:function(e){(e=e||window.event).stopPropagation?e.stopPropagation():e.cancelBubble=!1},stopDefault:function(e){(e=e||window.event).preventDefault?e.preventDefault():e.returnValue=!1},removeHandler:function(e,t,n){e.removeEventListener?e.removeEventListener(t,n,!1):e["on"+t]=null},dispatchEvent:function(e,t){var n=new Event(t);e.dispatchEvent(n)}},Le={setStorage:function(e,t){try{localStorage.setItem(e,JSON.stringify(t))}catch(e){console.error(e)}},getStorage:function(e){try{var t=localStorage.getItem(e);return null==t?null:JSON.parse(t)}catch(e){return console.error(e),null}},clearStorage:function(e){try{e&&localStorage.removeItem(e),!e&&localStorage.clear()}catch(e){console.error(e)}}},Me=function(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!0),t&&(process.stdout.clearLine(0),process.stdout.cursorTo(0)),process.stdout.write(e),n&&process.stdout.write("\n")},Ce=function(e){return Me(e,!0,!1)},De=["\\","|","/","—","—"],Be=function(e){var t;void 0===e&&(e={});var n=e.loopList,r=void 0===n?De:n,o=e.isStop,i=void 0!==o&&o,u=e.timer,a=void 0===u?100:u,c=e.index,s=void 0===c?0:c,l=null!==(t=null==r?void 0:r.length)&&void 0!==t?t:0;if(!l)return e;if(i)return Ce("\n");s>=l-1&&(s=0);var f=r[s++];return Ce(f),setTimeout((function(){e.index=s,Be(e)}),a),e},Ie={logOneLine:Me,logLoop:Be},Re=function(){function e(e){this.fn=e,this.id=null,this.duration=1/0,this.isActive=!1}return e.prototype.start=function(e){if(!this.isActive)return this.duration=null!=e?e:1/0,this.isActive=!0,this.animate()},e.prototype.stop=function(e){void 0===e&&(e=this.id),this.isActive=!1,cancelAnimationFrame(e)},e.prototype.animate=function(e){if(void 0===e&&(e=0),this.isActive&&this.duration-- >0)return this.fn(e),this.id=requestAnimationFrame(this.animate.bind(this)),this.id},e}();function _e(e){return 0===e||1===e?1:e*_e(e-1)}function Fe(e,t){return _e(e)/(_e(t)*_e(e-t))}var Ne={AnimateFrame:Re,quadraticBezier:function(e,t,n){var r=1-n,o=n*n;return[2*r*n*e+o,2*r*n*t+o]},cubicBezier:function(e,t,n,r,o){var i=3*e,u=3*t,a=3*(n-e)-i,c=3*(r-t)-u,s=1-u-c;return[(1-i-a)*Math.pow(o,3)+a*Math.pow(o,2)+i*o,s*Math.pow(o,3)+c*Math.pow(o,2)+u*o]},factorial:_e,combination:Fe,NBezier:function(e,t){for(var n=e.length-1,r=[0,0],o=0;o<=n;o++){var i=Fe(n,o)*Math.pow(1-t,n-o)*Math.pow(t,o);r[0]+=i*e[o][0],r[1]+=i*e[o][1]}return r}},We=function(){function e(e){void 0===e&&(e={}),this.options=e,this.events={}}return e.prototype.on=function(e,t){return this.checkHandler(e,t),this.getHandler(e,[]).push(t),this},e.prototype.emit=function(e,t){return this.has(e)&&this.runHandler(e,t),this},e.prototype.un=function(e,t){return this.unHandler(e,t),this},e.prototype.once=function(e,t){var n=this;this.checkHandler(e,t);var r=function(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];return n.un(e,r),t.apply(void 0,o)};return this.on(e,r),this},e.prototype.clear=function(){return this.events={},this},e.prototype.has=function(e){return!!this.getHandler(e)},e.prototype.getHandler=function(e,t){var n;return"object"==typeof t&&(this.events[e]=null!==(n=this.events[e])&&void 0!==n?n:t),this.events[e]},e.prototype.handlerLength=function(e){var t,n;return null!==(n=null===(t=this.getHandler(e))||void 0===t?void 0:t.length)&&void 0!==n?n:0},e.prototype.watch=function(e,t){var n=this;this.checkHandler(e,t);return this.on(e,(function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];n.emit(n.prefixStr(e),t.apply(void 0,r))})),this},e.prototype.invoke=function(e,t){var n=this;return new Promise((function(r){n.once(n.prefixStr(e),r),n.emit(e,t)}))},e.prototype.runHandler=function(e,t){for(var n=0,r=this.getHandler(e);n<r.length;n++){var o=r[n];o&&o(t)}},e.prototype.unHandler=function(e,t){var n=this.getHandler(e);!t&&(this.events[e]=[]),t&&this.checkHandler(e,t);for(var r=0;r<n.length;r++)n&&n[r]===t&&(n[r]=null)},e.prototype.prefixStr=function(e){return"@".concat(e)},e.prototype.checkHandler=function(e,t){var n=this.options,r=n.blackList,o=void 0===r?[]:r,i=n.maxLen,u=void 0===i?1/0:i,a=this.handlerLength(e);if(0===(null==e?void 0:e.length))throw new Error("type.length can not be 0");if(!t||!e)throw new ReferenceError("type or handler is not defined");if("function"!=typeof t||"string"!=typeof e)throw new TypeError("".concat(t," is not a function or ").concat(e," is not a string"));if(o.includes(e))throw new Error("".concat(e," is not allow"));if(u<=a)throw new Error("the number of ".concat(e," must be less than ").concat(u))},e.Instance=function(e){return e._instance||Object.defineProperty(e,"_instance",{value:new e}),e._instance},e}();We.Instance(We);var Je,Ve=function(e){return e.prototype.messageCenter||(e.prototype.messageCenter=new We),e},Ge=function(){return Ge=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Ge.apply(this,arguments)},Ue=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},ze=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function u(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(u,a)}c((r=r.apply(e,t||[])).next())}))},Qe=function(e,t){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(a){return function(c){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,a[0]&&(u=0)),u;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return u.label++,{value:a[1],done:!1};case 5:u.label++,r=a[1],a=[0];continue;case 7:a=u.ops.pop(),u.trys.pop();continue;default:if(!(o=u.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){u=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){u.label=a[1];break}if(6===a[0]&&u.label<o[1]){u.label=o[1],o=a;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(a);break}o[2]&&u.ops.pop(),u.trys.pop();continue}a=t.call(e,u)}catch(e){a=[6,e],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}},Ke=function(){function e(e){var t=this;this.fix="@~&$",this.init=function(){t.messageCenter.on("push:handler",t.run),t.messageCenter.on("run:success:handler",t.run),t.messageCenter.on("run:success:handler",t.finish),t.messageCenter.on("run:error:handler",t.run),t.messageCenter.on("run:error:handler",t.finish)},this.defineProps=function(e,n){Object.defineProperty(t,n,{value:e})},this.push=function(e){var n;t.checkHandler(e);var r=(n=t.defer()).resolve,o=n.reject,i=n.promise,u=t.fixStr(e.name);return t.queues=t.queues.concat(e.children.map((function(e){return{defer:e,name:u}}))),t.queueTemp[u]=Ge(Ge({},e),{result:[]}),t.messageCenter.emit("push:handler",o),t.messageCenter.on(u,r),i},this.unshift=function(e){return t.queues.splice(0,e)},this.run=function(e){var n=e.reject;return ze(t,void 0,void 0,(function(){var e,t,r,o,i;return Qe(this,(function(u){switch(u.label){case 0:if("pending"===this.stateProxy())return[2,void 0];if(0===this.queues.length)return[2,this.stateProxy("idle")];this.stateProxy("pending"),e=this.unshift(null!==(i=null===(o=this.props)||void 0===o?void 0:o.maxLen)&&void 0!==i?i:10),u.label=1;case 1:return u.trys.push([1,3,,4]),[4,Promise.all(e.map((function(e,t){return e.defer().catch((function(e){return e}))})))];case 2:return t=u.sent(),[2,this.handlerSuccess({res:t,queues:e})];case 3:return r=u.sent(),[2,this.handlerError({reject:n,error:r,queues:e})];case 4:return[2]}}))}))},this.clear=function(){t.queues=[],t.queueTemp={},t.props=null,t.stateProxy("idle"),t.messageCenter.clear()},this.finish=function(e){var n=e.res,r=void 0===n?[]:n,o=e.queues,i=e.error,u=void 0===i?"err":i,a=t.queueTemp;o.forEach((function(e,n){var o,i,c,s=a[e.name];null==s||s.result.push(null!==(o=r[n])&&void 0!==o?o:u),(null===(i=null==s?void 0:s.result)||void 0===i?void 0:i.length)===(null===(c=null==s?void 0:s.children)||void 0===c?void 0:c.length)&&(t.messageCenter.emit(e.name,null==s?void 0:s.result),a[e.name]=null)}))},this.handlerSuccess=function(e){return t.stateProxy("fulfilled"),t.messageCenter.emit("run:success:handler",e)},this.handlerError=function(e){var n=e.reject,r=e.error;return t.stateProxy("rejected"),n&&"function"==typeof n&&n(r),t.messageCenter.emit("run:error:handler",e)},this.stateProxy=function(e){return e&&(t.state=e),t.state},this.defer=function(){var e,t;return{promise:new Promise((function(n,r){e=n,t=r})),resolve:e,reject:t}},this.clear(),e&&this.defineProps(e,"props"),this.init()}return e.prototype.checkHandler=function(e){var t,n;if(!e)throw new ReferenceError("queue is not defined");if(!(e.children instanceof Array)||"object"!=typeof e)throw new TypeError("queue should be an object and queue.children should be an array");if(0===(null===(t=e.children)||void 0===t?void 0:t.length))throw new Error("queue.children.length can not be 0");if(null===(n=e.children)||void 0===n?void 0:n.find((function(e){return function(e){return!e||"function"!=typeof e}(e)})))throw new Error("queueList should have defer")},e.prototype.fixStr=function(e){return"".concat(this.fix).concat(e)},e=function(e,t,n,r){var o,i=arguments.length,u=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)u=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(u=(i<3?o(u):i>3?o(t,n,u):o(t,n))||u);return i>3&&u&&Object.defineProperty(t,n,u),u}([Ve,Ue("design:paramtypes",[Object])],e),e}(),$e=function(){return $e=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},$e.apply(this,arguments)};function Ye(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}!function(e){e["[object Array]"]="array",e["[object Object]"]="object",e["[object Function]"]="function",e["[object Set]"]="set",e["[object Map]"]="map",e["[object WeakMap]"]="weakMap",e["[object WeakSet]"]="weakSet",e["[object Date]"]="date",e["[object RegExp]"]="regExp",e["[object Math]"]="math"}(Je||(Je={}));var Ze={types:Je},Xe=function(e,t){void 0===t&&(t={});var n=Object.keys(t);if(0===n.length)return e;var r=n.map((function(e){return"".concat(e,"=").concat(t[e])}));return"".concat(e).concat(e.includes("?")?"&":"?").concat(r.join("&"))},et=function(e){var t=typeof e;if(null===e)return"null";if("object"===t){var n=Object.prototype.toString.call(e);return Je[n]}return t},tt=function(e,t){void 0===t&&(t=[]);var n=et(e);return t.indexOf(n)>0},nt={randomNum:function(e,t,n){return void 0===n&&(n=!1),Math.floor(Math.random()*(t-e+(n?1:0))+e)},urlSplit:function(e){var t={};return e.includes("?")?(e.split("?")[1].split("&").forEach((function(e){var n=e.split("=")[0];t[n]=e.split("=")[1]})),t):t},urlJoin:Xe,getType:et,getTypeByList:tt},rt=function(e,t){return"object"!=typeof e||"null"===t},ot=function(e){var t=et(e);if(rt(e,t))return e;var n=it(t,e);return"map"===t?e.forEach((function(e,t){n.set(t,ot(e))})):"set"===t?e.forEach((function(e){n.add(ot(e))})):Reflect.ownKeys(e).forEach((function(t){var r=e[t];n[t]=ot(r)})),n},it=function(e,t){switch(void 0===t&&(t={}),e){case"array":return[];case"function":return t;case"set":return new Set;case"map":return new Map;case"date":return new Date(t);case"regExp":return new RegExp(t);case"math":return Math;default:return{}}},ut=function(e){function t(){}return t.prototype=e,new t},at=function(e){if("string"!==et(e))return null;try{return JSON.parse(e)}catch(e){return null}},ct=function(e){if(!tt(e,["array","object","set","map"]))return"";try{return JSON.stringify(e)}catch(e){return""}},st={getValue:function(e,t,n){void 0===n&&(n="");for(var r=0,o=t.split(".");r<o.length;r++){if(void 0===(e=e[o[r]]))return n}return e},setValue:function(e,t,n){void 0===n&&(n={});for(var r=t.split("."),o=r[r.length-1],i=e,u=0,a=r;u<a.length;u++){var c=a[u];if("object"!=typeof i&&void 0!==i)return e;!i&&(i={}),!i[c]&&(i[c]={}),o===c&&(i[o]=n),i=i[c]}return e},mixIn:function(e,t,n){var r;for(var o in void 0===t&&(t={}),void 0===n&&(n=!1),t)for(var i in t[o]){var u=null!==(r=e.prototype)&&void 0!==r?r:e;(void 0===e[i]||n)&&(u[i]=t[o][i])}return e},enumInversion:function(e){for(var t in e){var n=e[t];"string"!=typeof n||e[n]||(e[n]=t)}return e},isNotObject:rt,cloneDeep:ot,createObjectVariable:it,createObject:ut,inherit:function(e,t){return void 0===t&&(t=function(){}),t.prototype=ut(e.prototype),t.prototype.super=e,t.prototype.constructor=t,t},getInstance:function(e,t){void 0===t&&(t=!1);for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return e._instance&&!t||(e._instance=new(e.bind.apply(e,Ye([void 0],n,!1)))),e._instance},classDecorator:function(e){return function(t){for(var n in e)Reflect.has(t.prototype,n)||(t.prototype[n]=e[n])}},stringToJson:at,jsonToString:ct,isWindow:function(e){return e&&e===e.window}},lt=function(e,t){return void 0===t&&(t=[]),e.forEach((function(e){return"array"===et(e)?lt(e,t):t.push(e)})),t},ft={arrayRandom:function(e){return e.sort((function(){return Math.random()-.5}))},arrayUniq:function(e){return Array.from(new Set(e))},arrayDemote:lt},pt=void 0,ht=function(e){var t,n;return void 0===e&&(e=0),e>0&&setTimeout(n,e),{promise:new Promise((function(e,r){t=e,n=r})),resolve:t,reject:n}},dt={throttle:function(e,t){var n=null;return function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];n||(n=setTimeout((function(){e.call.apply(e,Ye([pt],r,!1)),n=null}),t))}},debounce:function(e,t){var n=null;return function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];n&&(clearTimeout(n),n=null),n=setTimeout((function(){e.call.apply(e,Ye([pt],r,!1))}),t)}},defer:ht,catchAwait:function(e){return e.then((function(e){return[null,e]})).catch((function(e){return[e]}))}},vt={createElement:function(e){var t,n,r=e.ele,o=e.style,i=e.attr,u=e.parent,a=r instanceof HTMLElement?r:document.createElement(null!=r?r:"div");return o&&(null===(t=Object.keys(o))||void 0===t||t.forEach((function(e){return a.style[e]=o[e]}))),i&&(null===(n=Object.keys(i))||void 0===n||n.forEach((function(e){return a[e]=i[e]}))),u&&u.appendChild(a),a}},yt={addHandler:function(e,t,n){e.addEventListener?e.addEventListener(t,n,!1):e["on"+t]=n},stopBubble:function(e){(e=e||window.event).stopPropagation?e.stopPropagation():e.cancelBubble=!1},stopDefault:function(e){(e=e||window.event).preventDefault?e.preventDefault():e.returnValue=!1},removeHandler:function(e,t,n){e.removeEventListener?e.removeEventListener(t,n,!1):e["on"+t]=null},dispatchEvent:function(e,t){var n=new Event(t);e.dispatchEvent(n)}},gt={setStorage:function(e,t){try{localStorage.setItem(e,JSON.stringify(t))}catch(e){console.error(e)}},getStorage:function(e){try{var t=localStorage.getItem(e);return null==t?null:JSON.parse(t)}catch(e){return console.error(e),null}},clearStorage:function(e){try{e&&localStorage.removeItem(e),!e&&localStorage.clear()}catch(e){console.error(e)}}},bt=function(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!0),t&&(process.stdout.clearLine(0),process.stdout.cursorTo(0)),process.stdout.write(e),n&&process.stdout.write("\n")},mt=function(e){return bt(e,!0,!1)},wt=["\\","|","/","—","—"],jt=function(e){var t;void 0===e&&(e={});var n=e.loopList,r=void 0===n?wt:n,o=e.isStop,i=void 0!==o&&o,u=e.timer,a=void 0===u?100:u,c=e.index,s=void 0===c?0:c,l=null!==(t=null==r?void 0:r.length)&&void 0!==t?t:0;if(!l)return e;if(i)return mt("\n");s>=l-1&&(s=0);var f=r[s++];return mt(f),setTimeout((function(){e.index=s,jt(e)}),a),e},Et={logOneLine:bt,logLoop:jt},Ot=function(){function e(e){this.fn=e,this.id=null,this.duration=1/0,this.isActive=!1}return e.prototype.start=function(e){this.isActive||(this.duration=null!=e?e:1/0,this.isActive=!0,this.animate())},e.prototype.stop=function(){this.isActive=!1,cancelAnimationFrame(this.id)},e.prototype.animate=function(e){void 0===e&&(e=0),this.isActive&&this.duration-- >0&&(this.fn(e),this.id=requestAnimationFrame(this.animate.bind(this)))},e}();function Tt(e){return 0===e||1===e?1:e*Tt(e-1)}function St(e,t){return Tt(e)/(Tt(t)*Tt(e-t))}var Pt={AnimateFrame:Ot,quadraticBezier:function(e,t,n){var r=1-n,o=n*n;return[2*r*n*e+o,2*r*n*t+o]},cubicBezier:function(e,t,n,r,o){var i=3*e,u=3*t,a=3*(n-e)-i,c=3*(r-t)-u,s=1-u-c;return[(1-i-a)*Math.pow(o,3)+a*Math.pow(o,2)+i*o,s*Math.pow(o,3)+c*Math.pow(o,2)+u*o]},factorial:Tt,combination:St,NBezier:function(e,t){for(var n=e.length-1,r=[0,0],o=0;o<=n;o++){var i=St(n,o)*Math.pow(1-t,n-o)*Math.pow(t,o);r[0]+=i*e[o][0],r[1]+=i*e[o][1]}return r}},xt=function(){function e(e){void 0===e&&(e={}),this.options=e,this.events={}}return e.prototype.on=function(e,t){return this.checkHandler(e,t),this.getHandler(e,[]).push(t),this},e.prototype.emit=function(e,t){return this.has(e)&&this.runHandler(e,t),this},e.prototype.un=function(e,t){return this.unHandler(e,t),this},e.prototype.once=function(e,t){var n=this;this.checkHandler(e,t);var r=function(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];return n.un(e,r),t.apply(void 0,o)};return this.on(e,r),this},e.prototype.clear=function(){return this.events={},this},e.prototype.has=function(e){return!!this.getHandler(e)},e.prototype.getHandler=function(e,t){var n;return"object"==typeof t&&(this.events[e]=null!==(n=this.events[e])&&void 0!==n?n:t),this.events[e]},e.prototype.handlerLength=function(e){var t,n;return null!==(n=null===(t=this.getHandler(e))||void 0===t?void 0:t.length)&&void 0!==n?n:0},e.prototype.watch=function(e,t){var n=this;this.checkHandler(e,t);return this.on(e,(function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];n.emit(n.prefixStr(e),t.apply(void 0,r))})),this},e.prototype.invoke=function(e,t){var n=this;return new Promise((function(r){n.once(n.prefixStr(e),r),n.emit(e,t)}))},e.prototype.runHandler=function(e,t){for(var n=0,r=this.getHandler(e);n<r.length;n++){var o=r[n];o&&o(t)}},e.prototype.unHandler=function(e,t){var n=this.getHandler(e);!t&&(this.events[e]=[]),t&&this.checkHandler(e,t);for(var r=0;r<n.length;r++)n&&n[r]===t&&(n[r]=null)},e.prototype.prefixStr=function(e){return"@".concat(e)},e.prototype.checkHandler=function(e,t){var n=this.options,r=n.blackList,o=void 0===r?[]:r,i=n.maxLen,u=void 0===i?1/0:i,a=this.handlerLength(e);if(0===(null==e?void 0:e.length))throw new Error("type.length can not be 0");if(!t||!e)throw new ReferenceError("type or handler is not defined");if("function"!=typeof t||"string"!=typeof e)throw new TypeError("".concat(t," is not a function or ").concat(e," is not a string"));if(o.includes(e))throw new Error("".concat(e," is not allow"));if(u<=a)throw new Error("the number of ".concat(e," must be less than ").concat(u))},e.Instance=function(e){return e._instance||Object.defineProperty(e,"_instance",{value:new e}),e._instance},e}();xt.Instance(xt);var qt=function(e){return e.prototype.messageCenter||(e.prototype.messageCenter=new xt),e},kt=function(){return kt=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},kt.apply(this,arguments)},At=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},Ht=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function u(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(u,a)}c((r=r.apply(e,t||[])).next())}))},Lt=function(e,t){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(a){return function(c){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,a[0]&&(u=0)),u;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return u.label++,{value:a[1],done:!1};case 5:u.label++,r=a[1],a=[0];continue;case 7:a=u.ops.pop(),u.trys.pop();continue;default:if(!(o=u.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){u=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){u.label=a[1];break}if(6===a[0]&&u.label<o[1]){u.label=o[1],o=a;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(a);break}o[2]&&u.ops.pop(),u.trys.pop();continue}a=t.call(e,u)}catch(e){a=[6,e],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}},Mt=function(){function e(e){var t=this;this.fix="@~&$",this.init=function(){t.messageCenter.on("push:handler",t.run),t.messageCenter.on("run:success:handler",t.run),t.messageCenter.on("run:success:handler",t.finish),t.messageCenter.on("run:error:handler",t.run),t.messageCenter.on("run:error:handler",t.finish)},this.defineProps=function(e,n){Object.defineProperty(t,n,{value:e})},this.push=function(e){var n;t.checkHandler(e);var r=(n=t.defer()).resolve,o=n.reject,i=n.promise,u=t.fixStr(e.name);return t.queues=t.queues.concat(e.children.map((function(e){return{defer:e,name:u}}))),t.queueTemp[u]=kt(kt({},e),{result:[]}),t.messageCenter.emit("push:handler",o),t.messageCenter.on(u,r),i},this.unshift=function(e){return t.queues.splice(0,e)},this.run=function(e){var n=e.reject;return Ht(t,void 0,void 0,(function(){var e,t,r,o,i;return Lt(this,(function(u){switch(u.label){case 0:if("pending"===this.stateProxy())return[2,void 0];if(0===this.queues.length)return[2,this.stateProxy("idle")];this.stateProxy("pending"),e=this.unshift(null!==(i=null===(o=this.props)||void 0===o?void 0:o.maxLen)&&void 0!==i?i:10),u.label=1;case 1:return u.trys.push([1,3,,4]),[4,Promise.all(e.map((function(e,t){return e.defer().catch((function(e){return e}))})))];case 2:return t=u.sent(),[2,this.handlerSuccess({res:t,queues:e})];case 3:return r=u.sent(),[2,this.handlerError({reject:n,error:r,queues:e})];case 4:return[2]}}))}))},this.clear=function(){t.queues=[],t.queueTemp={},t.props=null,t.stateProxy("idle"),t.messageCenter.clear()},this.finish=function(e){var n=e.res,r=void 0===n?[]:n,o=e.queues,i=e.error,u=void 0===i?"err":i,a=t.queueTemp;o.forEach((function(e,n){var o,i,c,s=a[e.name];null==s||s.result.push(null!==(o=r[n])&&void 0!==o?o:u),(null===(i=null==s?void 0:s.result)||void 0===i?void 0:i.length)===(null===(c=null==s?void 0:s.children)||void 0===c?void 0:c.length)&&(t.messageCenter.emit(e.name,null==s?void 0:s.result),a[e.name]=null)}))},this.handlerSuccess=function(e){return t.stateProxy("fulfilled"),t.messageCenter.emit("run:success:handler",e)},this.handlerError=function(e){var n=e.reject,r=e.error;return t.stateProxy("rejected"),n&&"function"==typeof n&&n(r),t.messageCenter.emit("run:error:handler",e)},this.stateProxy=function(e){return e&&(t.state=e),t.state},this.defer=function(){var e,t;return{promise:new Promise((function(n,r){e=n,t=r})),resolve:e,reject:t}},this.clear(),e&&this.defineProps(e,"props"),this.init()}return e.prototype.checkHandler=function(e){var t,n;if(!e)throw new ReferenceError("queue is not defined");if(!(e.children instanceof Array)||"object"!=typeof e)throw new TypeError("queue should be an object and queue.children should be an array");if(0===(null===(t=e.children)||void 0===t?void 0:t.length))throw new Error("queue.children.length can not be 0");if(null===(n=e.children)||void 0===n?void 0:n.find((function(e){return function(e){return!e||"function"!=typeof e}(e)})))throw new Error("queueList should have defer")},e.prototype.fixStr=function(e){return"".concat(this.fix).concat(e)},e=function(e,t,n,r){var o,i=arguments.length,u=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)u=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(u=(i<3?o(u):i>3?o(t,n,u):o(t,n))||u);return i>3&&u&&Object.defineProperty(t,n,u),u}([qt,At("design:paramtypes",[Object])],e),e}();$e($e($e($e($e($e($e($e($e($e($e({},st),nt),ft),dt),vt),Ze),yt),gt),Et),Pt),{eventMessageCenter:xt,taskQueueLib:Mt});
2
2
  /**
3
3
  * @author Toru Nagashima <https://github.com/mysticatea>
4
4
  * @copyright 2015 Toru Nagashima. All rights reserved.
@@ -3,7 +3,7 @@ export declare const getValue: IGetValue;
3
3
  export declare const setValue: ISetValue;
4
4
  export declare const mixIn: IMixIn;
5
5
  export declare const enumInversion: IEnumInversion;
6
- export declare const isNotObject: (source: any, type: any) => boolean;
6
+ export declare const isNotObject: (source: any, type: string) => boolean;
7
7
  export declare const cloneDeep: ICloneDeep;
8
8
  export declare const createObjectVariable: ICreateObjectVariable;
9
9
  export declare const createObject: ICreateObject;
@@ -20,7 +20,7 @@ declare const _default: {
20
20
  setValue: ISetValue;
21
21
  mixIn: IMixIn;
22
22
  enumInversion: IEnumInversion;
23
- isNotObject: (source: any, type: any) => boolean;
23
+ isNotObject: (source: any, type: string) => boolean;
24
24
  cloneDeep: ICloneDeep;
25
25
  createObjectVariable: ICreateObjectVariable;
26
26
  createObject: ICreateObject;
@@ -30,7 +30,7 @@ declare const _default: {
30
30
  stringToJson: IStringToJson;
31
31
  jsonToString: IJsonToString;
32
32
  isWindow: (win: any) => boolean;
33
- emptyObject: (init?: IObject<unknown>) => any;
34
- isEmptyObject: (object?: IObject<unknown>) => boolean;
33
+ emptyObject: (init?: IObject<unknown, import("./types").IKey>) => any;
34
+ isEmptyObject: (object?: IObject<unknown, import("./types").IKey>) => boolean;
35
35
  };
36
36
  export default _default;