From 0562647769fe998008cfd87c14090bd424ed9a3c Mon Sep 17 00:00:00 2001 From: litt1e-p Date: Tue, 29 Aug 2023 21:54:27 +0800 Subject: [PATCH] fix: sort localString --- dist/jstd.esm.js | 2 +- dist/jstd.min.js | 2 +- dist/jstd.umd.js | 2 +- dist/types/index.d.ts | 8 +- dist/types/lib/array/index.d.ts | 60 ++++----- dist/types/lib/buffer/base64.d.ts | 24 ++-- dist/types/lib/buffer/index.d.ts | 32 ++--- dist/types/lib/common/index.d.ts | 24 ++-- dist/types/lib/date/index.d.ts | 62 ++++----- dist/types/lib/enum/index.d.ts | 170 ++++++++++++------------- dist/types/lib/eventloop/index.d.ts | 10 +- dist/types/lib/function/copy.d.ts | 94 +++++++------- dist/types/lib/function/debounce.d.ts | 14 +- dist/types/lib/function/interface.d.ts | 46 +++---- dist/types/lib/function/sort.d.ts | 18 +-- dist/types/lib/function/throttle.d.ts | 18 +-- dist/types/lib/jstd.d.ts | 38 +++--- dist/types/lib/macro/index.d.ts | 14 +- dist/types/lib/map/index.d.ts | 12 +- dist/types/lib/math/decimal.d.ts | 36 +++--- dist/types/lib/math/index.d.ts | 98 +++++++------- dist/types/lib/object/index.d.ts | 64 +++++----- dist/types/lib/promise/index.d.ts | 88 ++++++------- dist/types/lib/regexp/index.d.ts | 44 +++---- dist/types/lib/set/index.d.ts | 12 +- dist/types/lib/string/index.d.ts | 22 ++-- dist/types/lib/typing/index.d.ts | 26 ++-- package.json | 2 +- packages/function/sort.ts | 4 +- test/sort.spec.ts | 13 +- 30 files changed, 532 insertions(+), 527 deletions(-) diff --git a/dist/jstd.esm.js b/dist/jstd.esm.js index 1f73b79..ed3656a 100644 --- a/dist/jstd.esm.js +++ b/dist/jstd.esm.js @@ -1 +1 @@ -function _typeof(e){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof(e)}function _classCallCheck(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,r){for(var t=0;te.length)&&(r=e.length);for(var t=0,n=new Array(r);t=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,u=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return i=e.done,e},e:function(e){u=!0,a=e},f:function(){try{i||null==t.return||t.return()}finally{if(u)throw a}}}}var stringable=function(e){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return typeis(e)===Types.string&&(!r||e.length>0)},strLen=function(e){var r=0;if(!stringable(e))return r;for(var t=0,n=e.length;t2&&void 0!==arguments[2])||arguments[2];if(isNil(e))return!1;if(!re(kRegStartStrictNumberic,e)||re(kRegEndStrictNumberic,e))return!1;var n=+e;return!isNaN(n)&&(t?typeis(r)===Types.bool?re(r?kRegSignNumberic:kRegUnSignNumberic,n):re(kRegNumberic,n):typeis(n)===Types.number)},objectable=function(e){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(typeis(e)!==Types.object)return!1;var t=Object.getPrototypeOf(e);if(!t)return!r||Object.keys(e).length>0;if(t.constructor===Object)return!r||Object.keys(e).length>0;var n=Object.prototype.hasOwnProperty.call(t,"constructor")&&t.constructor;return"function"==typeof n&&Object.prototype.hasOwnProperty.toString.call(n)===Object.prototype.hasOwnProperty.toString.call(Object)&&(!r||Object.keys(e).length>0)},optional=function optional(path,obj){var separator=arguments.length>2&&void 0!==arguments[2]?arguments[2]:".",rs=void 0,properties;if(!stringable(path)||!stringable(separator))return rs;var p=path,o;if(properties=-1===p.indexOf(separator)?Array.of(p):p.split(separator),isNil(obj)){try{o=isNumberic(properties[0])?eval("this[".concat(properties[0],"]")):eval("this."+properties[0])}catch(e){o=Object.prototype.constructor()}if(properties.shift(),typeis(o)===Types.object);else if(typeis(o)!==Types.array)return rs}else o=obj;return rs=properties.reduce((function(e,r){return objectable(e)?e[r]:arrayable(e)?isNumberic(r)?e[+r]:e[r]:e?e[r]:void 0}),o),rs},extractable=function extractable(){for(var rs=Object.prototype.constructor(),_len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++)args[_key]=arguments[_key];if(!arrayable(args)||args.length<2)return rs;var t=Array.prototype.slice.call(args,-1)[0];if(typeis(t)===Types.string)try{t=eval("this."+t)}catch(e){t=void 0}if(!objectable(t))return rs;var o=Array.prototype.slice.apply(args,[0,-1]),_iterator=_createForOfIteratorHelper(o),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var i=_step.value;typeis(i)===Types.string?rs[i]=optional(i,t)||String.prototype.constructor():typeis(i)===Types.array?2===i.length?rs[i[0]]=(typeis(i[1])===Types.string?optional(i[1],t):i[1])||String.prototype.constructor():3===i.length&&(rs[i[0]]=objectable(i[2])||arrayable(i[2])?optional(i[1],i[2]):String.prototype.constructor()):typeis(i)===Types.object&&(rs=Object.assign(rs,i))}}catch(e){_iterator.e(e)}finally{_iterator.f()}return rs},assign=function e(r,t,n){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:".";typeis(t)!==Types.object&&typeis(t)!==Types.array&&typeis(t)!==Types.unknown||(stringable(r)||arrayable(r))&&(stringable(r)&&(r=r.split(o)),r.length>1?e(r,t[r.shift()],n):t[r[0]]=n)},objReverse=function(e){if(!objectable(e))return e;var r=e,t=Object.keys(r).reduce((function(e,t){var n=String(r[t]),o=[];return arrayable(e[n],!1)&&(o=e[n]),Object.assign(e,_defineProperty({},n,o.concat(t)))}),{});for(var n in t)t.hasOwnProperty(n)&&(t[n]=Array.isArray(t[n])&&1===t[n].length?t[n][0]:t[n]);return t},TypesDesc,Types;!function(e){e["[object Number]"]="number",e["[object String]"]="string",e["[object Boolean]"]="bool",e["[object Undefined]"]="undefined",e["[object Null]"]="null",e["[object Array]"]="array",e["[object Uint8Array]"]="uint8Array",e["[object Object]"]="object",e["[object Function]"]="function",e["[object AsyncFunction]"]="asyncFunction",e["[object BigInt]"]="bigInt",e["[object Date]"]="date",e["[object WeakMap]"]="weakMap",e["[object Map]"]="map",e["[object WeakSet]"]="weakSet",e["[object ArrayBuffer]"]="arrayBuffer",e["[object Set]"]="set",e["[object Symbol]"]="symbol",e["[object DataView]"]="dataView",e["[object Float32Array]"]="float32Array",e["[object Float64Array]"]="float64Array",e["[object Int8Array]"]="int8Array",e["[object Int16Array]"]="int16Array",e["[object Int32Array]"]="int32Array",e["[object Uint8ClampedArray]"]="uint8ClampedArray",e["[object Uint16Array]"]="uint16Array",e["[object Uint32Array]"]="uint32Array",e["[object BigInt64Array]"]="bigInt64Array",e["[object BigUint64Array]"]="bigUint64Array",e["[object RegExp]"]="regExp"}(TypesDesc||(TypesDesc={})),function(e){e.number="number",e.string="string",e.bool="bool",e[void 0]="undefined",e.null="null",e.bigInt="bigInt",e.object="object",e.function="function",e.asyncFunction="asyncFunction",e.symbol="symbol",e.arrayBuffer="arrayBuffer",e.regExp="regExp",e.date="date",e.dataView="dataView",e.weakMap="weakMap",e.map="map",e.weakSet="weakSet",e.set="set",e.array="array",e.uint8Array="uint8Array",e.float32Array="float32Array",e.float64Array="float64Array",e.int8Array="int8Array",e.int16Array="int16Array",e.int32Array="int32Array",e.uint8ClampedArray="uint8ClampedArray",e.uint16Array="uint16Array",e.uint32Array="uint32Array",e.bigInt64Array="bigInt64Array",e.bigUint64Array="bigUint64Array",e.unknown=""}(Types||(Types={}));var inEnum=function(e,r){return!(!objectable(e)||e!==Object(e))&&(Object.prototype.hasOwnProperty.call(e,r)||Object.values(e).indexOf(r)>-1)},typeis=function(e){var r=Object.prototype.toString.call(e);if("[object Object]"===r){var t=Object.getPrototypeOf(e);if(t&&t.constructor!==Object)return Types.unknown}var n=Types.unknown;return Object.keys(TypesDesc).includes(r)&&(n=Types[TypesDesc[r]]),n},re=function(e,r){return e.test(r.toString())},arrayable=function(e){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return(typeis(e)===Types.array||typeis(e)===Types.uint8Array)&&(!r||e.length>0)},arrayUnique=function(e){var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!arrayable(e))return e;if(r){var t=e.map((function(e){return JSON.stringify(e)}));return Array.from(new Set(t)).map((function(e){return JSON.parse(e)}))}return Array.from(new Set(e))},arrValsCount=function(e){var r={};return arrayable(e)?e.reduce((function(e,r){var t=r+"";return e[t]?e[t]++:e[t]=1,e}),r):r},arrValCount=function(e,r){if(!arrayable(e)||!e.includes(r))return 0;var t=arrValsCount(e),n=r+"";return t.hasOwnProperty(n)?t[n]:0},flat=function e(r){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1/0,n=Array.prototype.constructor();if(!arrayable(r,!1))return r;var o=isNaN(t)?1:Number(t);if(!o)return Array.prototype.slice.call(r);for(var a=0,i=r.length>>>0;a>8-a%1*8)){if((o=r.charCodeAt(a+=3/4))>255)throw new InvalidCharacterError("'btoa' failed: The string to be encoded contains characters outside of the Latin1 range.");n=n<<8|o}return t},_atob="undefined"!=typeof window&&window.atob?window.atob:function(e){var r=String(e).replace(/[=]+$/,"");if(r.length%4==1)throw new InvalidCharacterError("'atob' failed: The string to be decoded is not correctly encoded.");for(var t,n="",o=0,a=0,i=0;t=r.charAt(i++);~t&&(a=o%4?64*a+t:t,o++%4)?n+=String.fromCharCode(255&a>>(-2*o&6)):0)t=chars.indexOf(t);return n};var url2Blob=function(e){if("undefined"==typeof window)throw new Error("url2Blob only works in browser environment");if(!stringable(e))throw new TypeError(e+" can not be null");var r=e.split(",");if(!arrayable(r))throw new ReferenceError("invalid data url");var t=r[0].match(/:(.*?);/);if(!arrayable(t)||t.length<2)throw new ReferenceError("invalid data format");for(var n=t,o=_atob(r[1]),a=o.length,i=new Uint8Array(a);a--;)i[a]=o.charCodeAt(a);return new Blob([i],{type:n[1]})},str2Buffer=function(e){if(stringable(e))return e=_btoa(unescape(encodeURIComponent(e))),new Uint8Array(Array.prototype.map.call(e,(function(e){return e.charCodeAt(0)})))},buffer2Str=function(e){if(arrayable(e)||objectable(e)||stringable(e)){typeis(e)===Types.string&&(e=JSON.parse.call(null,e));var r=Object.values(e);if(arrayable(r))return decodeURIComponent(escape(_atob(String.fromCharCode.apply(null,Array.prototype.map.call(new Uint8Array(r),(function(e){return e}))))))}},formatNumber=function(e){return(e=e.toString())[1]?e:"0"+e},dateable=function(e){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return typeis(e)===Types.date&&(!r||"Invalid Date"!==e.toString())},formatDate=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"yyyy-MM-dd hh:mm:ss",t=String.prototype.constructor();if(typeis(e)!==Types.date&&!stringable(e))return t;if(typeis(e)===Types.string&&(e=new Date(e)),"Invalid Date"===e.toString())return t;for(var n=e,o={Y:n.getFullYear(),M:n.getMonth()+1,D:n.getDate(),h:n.getHours(),m:n.getMinutes(),s:n.getSeconds()},a=0,i=Object.keys(o).length>>>0;a0&&void 0!==arguments[0]?arguments[0]:0,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,i=arguments.length>6?arguments[6]:void 0;if([e,r,t,n,o,a].every((function(e){return typeis(e)===Types.number&&e>=0}))){var u=new Date(Date.UTC(e,r-1,t,n,o,a)),l=new Date(u.toLocaleString("en-US",{timeZone:"UTC"})),y=u;if(stringable(i))y=new Date(u.toLocaleString("en-US",{timeZone:i}));else if("Invalid Date"===(y=new Date("".concat(r,"/").concat(t,"/").concat(e," ").concat(n,":").concat(o,":").concat(a))).toString())return;var c=l.getTime()-y.getTime();return u.setTime(u.getTime()+c),u}},quarterable=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"Q",n=Array(2).fill(String.prototype.constructor()),o=new RegExp("^\\d{4}".concat(t,"\\d$"),"g");if(stringable(e)&&o.test(e)){var a=e.split(t),i=_slicedToArray(a,2),u=i[0],l=i[1];if(isNumberic(u)&&isNumberic(l)){var y=+l+ +r,c=4*+u+y;return y%4==0?(n[0]=0===y?u-1:+u+y/4-1,n[1]=4):(n[1]=c%4,n[0]=(c-n[1])/4),n.join(t)}}},mappable=function(e){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return typeis(e)===Types.map&&(!r||e.size>0)},DecimalMathCalcType;!function(e){e.round="round",e.ceil="ceil",e.floor="floor",e.trunc="trunc"}(DecimalMathCalcType||(DecimalMathCalcType={}));var Decimal=function(){function e(){_classCallCheck(this,e),_defineProperty(this,"powers",void 0),void 0===Math.trunc&&(Math.trunc=function(e){return e<0?Math.ceil(e):Math.floor(e)}),this.powers=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13,1e14,1e15,1e16,1e17,1e18,1e19,1e20,1e21,1e22]}return _createClass(e,[{key:"intpow10",value:function(e){return e<0||e>22?Math.pow(10,e):this.powers[e]}},{key:"isRound",value:function(e,r){var t=this.intpow10(r);return Math.round(e*t)/t===e}},{key:"decimalAdjust",value:function(e,r,t){if("round"!==e&&this.isRound(r,t||0))return r;var n=this.intpow10(t||0),o=r*n*(1+Number.EPSILON);return Math[e](o)/n}},{key:"round",value:function(e,r){return this.decimalAdjust(DecimalMathCalcType.round,e,r)}},{key:"ceil",value:function(e,r){return this.decimalAdjust(DecimalMathCalcType.ceil,e,r)}},{key:"floor",value:function(e,r){return this.decimalAdjust(DecimalMathCalcType.floor,e,r)}},{key:"trunc",value:function(e,r){return this.decimalAdjust(DecimalMathCalcType.trunc,e,r)}},{key:"toFixed",value:function(e,r){return this.decimalAdjust(DecimalMathCalcType.round,e,r).toFixed(r)}}]),e}(),rangeRandom=function(e,r){return!isNumberic(e)||!isNumberic(r)||e>r?Math.random():Math.random()*(r-e)+e},numberic=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;if(isNumberic(e,void 0,!1)){var t=+e,n=Math.sign(t);return r=isNumberic(r,!0)?r:2,(new Decimal).round(Math.abs(t),r)*n}},guid=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:8,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"abcdefghijklmnopqrstuvwxyz0123456789",t=r.split("");return t.length||(t="abcdefghijklmnopqrstuvwxyz0123456789".split("")),_toConsumableArray(Array(e)).map((function(e){return t[Math.random()*t.length|0]})).join("")},hash=function(){return(16777215*Math.random()<<7).toString(16)},numberFormat=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,t=arguments.length>2?arguments[2]:void 0,n=numberic(e,r);if(void 0!==n)return(t=isNumberic(t,!0)?t:r)>0?n.toFixed(t):e},moneyFormat=function(e){var r,t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,o=arguments.length>2?arguments[2]:void 0,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";return isNumberic(e)?(o=isNumberic(o,!0)?o:n,null!==(r=null===(t=numberic(e,n))||void 0===t?void 0:t.toLocaleString(void 0,{minimumFractionDigits:o,maximumFractionDigits:o}))&&void 0!==r?r:a):a},signFormat=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return isNumberic(e)?"".concat(e>0?"+":e<0?"-":"").concat(Math.abs(e)):r},sleep=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:16;return new Promise((function(r){return setTimeout(r,e)}))},settable=function(e){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return typeis(e)===Types.set&&(!r||e.size>0)},PromiseStatus;!function(e){e.pending="pending",e.fulfilled="fulfilled",e.rejected="rejected"}(PromiseStatus||(PromiseStatus={}));var PromisePolyfill=function(){function e(r){var t=this;_classCallCheck(this,e),_defineProperty(this,"status",void 0),_defineProperty(this,"value",void 0),_defineProperty(this,"reason",void 0),_defineProperty(this,"onResolvedClosures",void 0),_defineProperty(this,"onRejectedClosures",void 0),this.status=PromiseStatus.pending,this.value=void 0,this.reason=void 0,this.onResolvedClosures=[],this.onRejectedClosures=[];var n=function(e){t.status===PromiseStatus.pending&&(t.status=PromiseStatus.rejected,t.reason=e,t.onRejectedClosures.forEach((function(e){return e()})))};try{r((function(e){t.status===PromiseStatus.pending&&(t.status=PromiseStatus.fulfilled,t.value=e,t.onResolvedClosures.forEach((function(e){return e()})))}),n)}catch(e){n(e)}}return _createClass(e,[{key:"then",value:function(r,t){var n=this;r="function"==typeof r?r:function(e){return e},t="function"==typeof t?t:function(e){throw e};var o=new e((function(e,a){n.status===PromiseStatus.fulfilled&µ((function(){try{var t,i=null===(t=r)||void 0===t?void 0:t(n.value);resolvePromise(o,i,e,a)}catch(e){a(e)}})),n.status===PromiseStatus.rejected&µ((function(){try{var r,i=null===(r=t)||void 0===r?void 0:r(n.reason);resolvePromise(o,i,e,a)}catch(e){a(e)}})),n.status===PromiseStatus.pending&&(n.onResolvedClosures.push((function(){micro((function(){try{var t,i=null===(t=r)||void 0===t?void 0:t(n.value);resolvePromise(o,i,e,a)}catch(e){a(e)}}))})),n.onRejectedClosures.push((function(){micro((function(){try{var r,i=null===(r=t)||void 0===r?void 0:r(n.reason);resolvePromise(o,i,e,a)}catch(e){a(e)}}))})))}));return o}},{key:"catch",value:function(e){return this.then(void 0,e)}}]),e}();function micro(e){return"undefined"!=typeof window?window.queueMicrotask(e):process.nextTick(e)}function resolvePromise(e,r,t,n){if(r===e)return n(new TypeError("Chaining cycle detected for promise"));var o=!1;if(null===r||"object"!==_typeof(r)&&"function"!=typeof r)t(r);else try{var a=r.then;"function"==typeof a?a.call(r,(function(r){o||(o=!0,resolvePromise(e,r,t,n))}),(function(e){o||(o=!0,n(e))})):t(r)}catch(e){if(o)return;o=!0,n(e)}}_defineProperty(PromisePolyfill,"resolve",void 0),_defineProperty(PromisePolyfill,"reject",void 0),_defineProperty(PromisePolyfill,"race",void 0),_defineProperty(PromisePolyfill,"all",void 0),_defineProperty(PromisePolyfill,"deferred",void 0),PromisePolyfill.resolve=function(e){return new PromisePolyfill((function(r,t){return r(e)}))},PromisePolyfill.reject=function(e){return new PromisePolyfill((function(r,t){return t(e)}))},PromisePolyfill.race=function(e){return new PromisePolyfill((function(r,t){for(var n=0;n2&&void 0!==arguments[2]&&arguments[2];if(typeis(e)!==Types.function&&typeis(e)!==Types.asyncFunction)throw new TypeError("Expected a function");if(!isNumberic(r,!0))throw new TypeError("Expected a numberic time");var a=function(){for(var a=arguments.length,i=new Array(a),u=0;uu?(a&&(clearTimeout(a),a=null),l=c,e.apply(y,n)):a||!1===(null==t?void 0:t.trailing)||(a=setTimeout((function(){l=!1===(null==t?void 0:t.leading)?0:(new Date).getTime(),a=null,e.apply(y,n)}),s)),i};return y.cancel=function(){a&&clearTimeout(a),l=0,a=null},y},_TypedCopyMap,TypedArrayMap={"[object Float32Array]":Float32Array,"[object Float64Array]":Float64Array,"[object Int8Array]":Int8Array,"[object Int16Array]":Int16Array,"[object Int32Array]":Int32Array,"[object Uint8Array]":Uint8Array,"[object Uint16Array]":Uint16Array,"[object Uint32Array]":Uint32Array,"[object Uint8ClampedArray]":Uint8ClampedArray},TypedCopyMap=(_TypedCopyMap={},_defineProperty(_TypedCopyMap,Types.date,copyDate),_defineProperty(_TypedCopyMap,Types.arrayBuffer,copyArrayBuffer),_defineProperty(_TypedCopyMap,Types.dataView,copyDataView),_defineProperty(_TypedCopyMap,Types.float32Array,copyTypedArray),_defineProperty(_TypedCopyMap,Types.float64Array,copyTypedArray),_defineProperty(_TypedCopyMap,Types.int8Array,copyTypedArray),_defineProperty(_TypedCopyMap,Types.int16Array,copyTypedArray),_defineProperty(_TypedCopyMap,Types.int32Array,copyTypedArray),_defineProperty(_TypedCopyMap,Types.uint8Array,copyTypedArray),_defineProperty(_TypedCopyMap,Types.uint8ClampedArray,copyTypedArray),_defineProperty(_TypedCopyMap,Types.uint16Array,copyTypedArray),_defineProperty(_TypedCopyMap,Types.uint32Array,copyTypedArray),_defineProperty(_TypedCopyMap,Types.bigInt64Array,copyTypedArray),_defineProperty(_TypedCopyMap,Types.bigUint64Array,copyTypedArray),_defineProperty(_TypedCopyMap,Types.regExp,copyRegExp),_TypedCopyMap),copy=function(e){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],t=function e(r){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new Map,o=r;if(isNull(o))return o;if(TypedCopyMap[typeis(o)])return TypedCopyMap[typeis(o)](r);if(n.get(o))return n.get(o);if(arrayable(r,!1)){var a=Array.prototype.constructor();return n.set(o,a),r.map((function(e){return a.push(e)})),t?a.map((function(r){return e(r,t,n)})):a}if(objectable(r,!1)){var i=Object.prototype.constructor();for(var u in n.set(o,i),r)Object.prototype.hasOwnProperty.call(r,u)&&(i[u]=r[u]);if(!t)return i;for(var l in i)Object.prototype.hasOwnProperty.call(i,l)&&(i[l]=e(i[l],t,n));return i}return r};return t.call(null,e,r)};function copyArrayBuffer(e){var r=new ArrayBuffer(e.byteLength);return new Uint8Array(r).set(new Uint8Array(e)),r}function copyDataView(e){var r=copyArrayBuffer(e.buffer);return new DataView(r,e.byteOffset,e.byteLength)}function copyDate(e){return new Date(e.getTime())}function copyRegExp(e){var r=new RegExp(e.source,e.flags);return r.lastIndex=e.lastIndex,r}function copyTypedArray(e){try{TypedArrayMap["[object BigInt64Array]"]=BigInt64Array,TypedArrayMap["[object BigUint64Array]"]=BigUint64Array}catch(e){}var r=copyArrayBuffer(e.buffer);return new(TypedArrayMap[Object.prototype.toString.call(e)])(r,e.byteOffset,e.length)}var sort=function(e,r){var t=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"zh-Hans-CN",o=null!=e?e:"",a=null!=r?r:"",i=/[a-zA-Z0-9]/;return isNumberic(e)&&isNumberic(r)?Number(e)>Number(r)?1:Number(e)a?1:oe.length)&&(r=e.length);for(var t=0,n=new Array(r);t=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,u=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return i=e.done,e},e:function(e){u=!0,a=e},f:function(){try{i||null==t.return||t.return()}finally{if(u)throw a}}}}var stringable=function(e){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return typeis(e)===Types.string&&(!r||e.length>0)},strLen=function(e){var r=0;if(!stringable(e))return r;for(var t=0,n=e.length;t2&&void 0!==arguments[2])||arguments[2];if(isNil(e))return!1;if(!re(kRegStartStrictNumberic,e)||re(kRegEndStrictNumberic,e))return!1;var n=+e;return!isNaN(n)&&(t?typeis(r)===Types.bool?re(r?kRegSignNumberic:kRegUnSignNumberic,n):re(kRegNumberic,n):typeis(n)===Types.number)},objectable=function(e){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(typeis(e)!==Types.object)return!1;var t=Object.getPrototypeOf(e);if(!t)return!r||Object.keys(e).length>0;if(t.constructor===Object)return!r||Object.keys(e).length>0;var n=Object.prototype.hasOwnProperty.call(t,"constructor")&&t.constructor;return"function"==typeof n&&Object.prototype.hasOwnProperty.toString.call(n)===Object.prototype.hasOwnProperty.toString.call(Object)&&(!r||Object.keys(e).length>0)},optional=function optional(path,obj){var separator=arguments.length>2&&void 0!==arguments[2]?arguments[2]:".",rs=void 0,properties;if(!stringable(path)||!stringable(separator))return rs;var p=path,o;if(properties=-1===p.indexOf(separator)?Array.of(p):p.split(separator),isNil(obj)){try{o=isNumberic(properties[0])?eval("this[".concat(properties[0],"]")):eval("this."+properties[0])}catch(e){o=Object.prototype.constructor()}if(properties.shift(),typeis(o)===Types.object);else if(typeis(o)!==Types.array)return rs}else o=obj;return rs=properties.reduce((function(e,r){return objectable(e)?e[r]:arrayable(e)?isNumberic(r)?e[+r]:e[r]:e?e[r]:void 0}),o),rs},extractable=function extractable(){for(var rs=Object.prototype.constructor(),_len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++)args[_key]=arguments[_key];if(!arrayable(args)||args.length<2)return rs;var t=Array.prototype.slice.call(args,-1)[0];if(typeis(t)===Types.string)try{t=eval("this."+t)}catch(e){t=void 0}if(!objectable(t))return rs;var o=Array.prototype.slice.apply(args,[0,-1]),_iterator=_createForOfIteratorHelper(o),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var i=_step.value;typeis(i)===Types.string?rs[i]=optional(i,t)||String.prototype.constructor():typeis(i)===Types.array?2===i.length?rs[i[0]]=(typeis(i[1])===Types.string?optional(i[1],t):i[1])||String.prototype.constructor():3===i.length&&(rs[i[0]]=objectable(i[2])||arrayable(i[2])?optional(i[1],i[2]):String.prototype.constructor()):typeis(i)===Types.object&&(rs=Object.assign(rs,i))}}catch(e){_iterator.e(e)}finally{_iterator.f()}return rs},assign=function e(r,t,n){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:".";typeis(t)!==Types.object&&typeis(t)!==Types.array&&typeis(t)!==Types.unknown||(stringable(r)||arrayable(r))&&(stringable(r)&&(r=r.split(o)),r.length>1?e(r,t[r.shift()],n):t[r[0]]=n)},objReverse=function(e){if(!objectable(e))return e;var r=e,t=Object.keys(r).reduce((function(e,t){var n=String(r[t]),o=[];return arrayable(e[n],!1)&&(o=e[n]),Object.assign(e,_defineProperty({},n,o.concat(t)))}),{});for(var n in t)t.hasOwnProperty(n)&&(t[n]=Array.isArray(t[n])&&1===t[n].length?t[n][0]:t[n]);return t},TypesDesc,Types;!function(e){e["[object Number]"]="number",e["[object String]"]="string",e["[object Boolean]"]="bool",e["[object Undefined]"]="undefined",e["[object Null]"]="null",e["[object Array]"]="array",e["[object Uint8Array]"]="uint8Array",e["[object Object]"]="object",e["[object Function]"]="function",e["[object AsyncFunction]"]="asyncFunction",e["[object BigInt]"]="bigInt",e["[object Date]"]="date",e["[object WeakMap]"]="weakMap",e["[object Map]"]="map",e["[object WeakSet]"]="weakSet",e["[object ArrayBuffer]"]="arrayBuffer",e["[object Set]"]="set",e["[object Symbol]"]="symbol",e["[object DataView]"]="dataView",e["[object Float32Array]"]="float32Array",e["[object Float64Array]"]="float64Array",e["[object Int8Array]"]="int8Array",e["[object Int16Array]"]="int16Array",e["[object Int32Array]"]="int32Array",e["[object Uint8ClampedArray]"]="uint8ClampedArray",e["[object Uint16Array]"]="uint16Array",e["[object Uint32Array]"]="uint32Array",e["[object BigInt64Array]"]="bigInt64Array",e["[object BigUint64Array]"]="bigUint64Array",e["[object RegExp]"]="regExp"}(TypesDesc||(TypesDesc={})),function(e){e.number="number",e.string="string",e.bool="bool",e[void 0]="undefined",e.null="null",e.bigInt="bigInt",e.object="object",e.function="function",e.asyncFunction="asyncFunction",e.symbol="symbol",e.arrayBuffer="arrayBuffer",e.regExp="regExp",e.date="date",e.dataView="dataView",e.weakMap="weakMap",e.map="map",e.weakSet="weakSet",e.set="set",e.array="array",e.uint8Array="uint8Array",e.float32Array="float32Array",e.float64Array="float64Array",e.int8Array="int8Array",e.int16Array="int16Array",e.int32Array="int32Array",e.uint8ClampedArray="uint8ClampedArray",e.uint16Array="uint16Array",e.uint32Array="uint32Array",e.bigInt64Array="bigInt64Array",e.bigUint64Array="bigUint64Array",e.unknown=""}(Types||(Types={}));var inEnum=function(e,r){return!(!objectable(e)||e!==Object(e))&&(Object.prototype.hasOwnProperty.call(e,r)||Object.values(e).indexOf(r)>-1)},typeis=function(e){var r=Object.prototype.toString.call(e);if("[object Object]"===r){var t=Object.getPrototypeOf(e);if(t&&t.constructor!==Object)return Types.unknown}var n=Types.unknown;return Object.keys(TypesDesc).includes(r)&&(n=Types[TypesDesc[r]]),n},re=function(e,r){return e.test(r.toString())},arrayable=function(e){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return(typeis(e)===Types.array||typeis(e)===Types.uint8Array)&&(!r||e.length>0)},arrayUnique=function(e){var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!arrayable(e))return e;if(r){var t=e.map((function(e){return JSON.stringify(e)}));return Array.from(new Set(t)).map((function(e){return JSON.parse(e)}))}return Array.from(new Set(e))},arrValsCount=function(e){var r={};return arrayable(e)?e.reduce((function(e,r){var t=r+"";return e[t]?e[t]++:e[t]=1,e}),r):r},arrValCount=function(e,r){if(!arrayable(e)||!e.includes(r))return 0;var t=arrValsCount(e),n=r+"";return t.hasOwnProperty(n)?t[n]:0},flat=function e(r){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1/0,n=Array.prototype.constructor();if(!arrayable(r,!1))return r;var o=isNaN(t)?1:Number(t);if(!o)return Array.prototype.slice.call(r);for(var a=0,i=r.length>>>0;a>8-a%1*8)){if((o=r.charCodeAt(a+=3/4))>255)throw new InvalidCharacterError("'btoa' failed: The string to be encoded contains characters outside of the Latin1 range.");n=n<<8|o}return t},_atob="undefined"!=typeof window&&window.atob?window.atob:function(e){var r=String(e).replace(/[=]+$/,"");if(r.length%4==1)throw new InvalidCharacterError("'atob' failed: The string to be decoded is not correctly encoded.");for(var t,n="",o=0,a=0,i=0;t=r.charAt(i++);~t&&(a=o%4?64*a+t:t,o++%4)?n+=String.fromCharCode(255&a>>(-2*o&6)):0)t=chars.indexOf(t);return n};var url2Blob=function(e){if("undefined"==typeof window)throw new Error("url2Blob only works in browser environment");if(!stringable(e))throw new TypeError(e+" can not be null");var r=e.split(",");if(!arrayable(r))throw new ReferenceError("invalid data url");var t=r[0].match(/:(.*?);/);if(!arrayable(t)||t.length<2)throw new ReferenceError("invalid data format");for(var n=t,o=_atob(r[1]),a=o.length,i=new Uint8Array(a);a--;)i[a]=o.charCodeAt(a);return new Blob([i],{type:n[1]})},str2Buffer=function(e){if(stringable(e))return e=_btoa(unescape(encodeURIComponent(e))),new Uint8Array(Array.prototype.map.call(e,(function(e){return e.charCodeAt(0)})))},buffer2Str=function(e){if(arrayable(e)||objectable(e)||stringable(e)){typeis(e)===Types.string&&(e=JSON.parse.call(null,e));var r=Object.values(e);if(arrayable(r))return decodeURIComponent(escape(_atob(String.fromCharCode.apply(null,Array.prototype.map.call(new Uint8Array(r),(function(e){return e}))))))}},formatNumber=function(e){return(e=e.toString())[1]?e:"0"+e},dateable=function(e){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return typeis(e)===Types.date&&(!r||"Invalid Date"!==e.toString())},formatDate=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"yyyy-MM-dd hh:mm:ss",t=String.prototype.constructor();if(typeis(e)!==Types.date&&!stringable(e))return t;if(typeis(e)===Types.string&&(e=new Date(e)),"Invalid Date"===e.toString())return t;for(var n=e,o={Y:n.getFullYear(),M:n.getMonth()+1,D:n.getDate(),h:n.getHours(),m:n.getMinutes(),s:n.getSeconds()},a=0,i=Object.keys(o).length>>>0;a0&&void 0!==arguments[0]?arguments[0]:0,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,i=arguments.length>6?arguments[6]:void 0;if([e,r,t,n,o,a].every((function(e){return typeis(e)===Types.number&&e>=0}))){var u=new Date(Date.UTC(e,r-1,t,n,o,a)),l=new Date(u.toLocaleString("en-US",{timeZone:"UTC"})),y=u;if(stringable(i))y=new Date(u.toLocaleString("en-US",{timeZone:i}));else if("Invalid Date"===(y=new Date("".concat(r,"/").concat(t,"/").concat(e," ").concat(n,":").concat(o,":").concat(a))).toString())return;var c=l.getTime()-y.getTime();return u.setTime(u.getTime()+c),u}},quarterable=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"Q",n=Array(2).fill(String.prototype.constructor()),o=new RegExp("^\\d{4}".concat(t,"\\d$"),"g");if(stringable(e)&&o.test(e)){var a=e.split(t),i=_slicedToArray(a,2),u=i[0],l=i[1];if(isNumberic(u)&&isNumberic(l)){var y=+l+ +r,c=4*+u+y;return y%4==0?(n[0]=0===y?u-1:+u+y/4-1,n[1]=4):(n[1]=c%4,n[0]=(c-n[1])/4),n.join(t)}}},mappable=function(e){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return typeis(e)===Types.map&&(!r||e.size>0)},DecimalMathCalcType;!function(e){e.round="round",e.ceil="ceil",e.floor="floor",e.trunc="trunc"}(DecimalMathCalcType||(DecimalMathCalcType={}));var Decimal=function(){function e(){_classCallCheck(this,e),_defineProperty(this,"powers",void 0),void 0===Math.trunc&&(Math.trunc=function(e){return e<0?Math.ceil(e):Math.floor(e)}),this.powers=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13,1e14,1e15,1e16,1e17,1e18,1e19,1e20,1e21,1e22]}return _createClass(e,[{key:"intpow10",value:function(e){return e<0||e>22?Math.pow(10,e):this.powers[e]}},{key:"isRound",value:function(e,r){var t=this.intpow10(r);return Math.round(e*t)/t===e}},{key:"decimalAdjust",value:function(e,r,t){if("round"!==e&&this.isRound(r,t||0))return r;var n=this.intpow10(t||0),o=r*n*(1+Number.EPSILON);return Math[e](o)/n}},{key:"round",value:function(e,r){return this.decimalAdjust(DecimalMathCalcType.round,e,r)}},{key:"ceil",value:function(e,r){return this.decimalAdjust(DecimalMathCalcType.ceil,e,r)}},{key:"floor",value:function(e,r){return this.decimalAdjust(DecimalMathCalcType.floor,e,r)}},{key:"trunc",value:function(e,r){return this.decimalAdjust(DecimalMathCalcType.trunc,e,r)}},{key:"toFixed",value:function(e,r){return this.decimalAdjust(DecimalMathCalcType.round,e,r).toFixed(r)}}]),e}(),rangeRandom=function(e,r){return!isNumberic(e)||!isNumberic(r)||e>r?Math.random():Math.random()*(r-e)+e},numberic=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;if(isNumberic(e,void 0,!1)){var t=+e,n=Math.sign(t);return r=isNumberic(r,!0)?r:2,(new Decimal).round(Math.abs(t),r)*n}},guid=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:8,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"abcdefghijklmnopqrstuvwxyz0123456789",t=r.split("");return t.length||(t="abcdefghijklmnopqrstuvwxyz0123456789".split("")),_toConsumableArray(Array(e)).map((function(e){return t[Math.random()*t.length|0]})).join("")},hash=function(){return(16777215*Math.random()<<7).toString(16)},numberFormat=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,t=arguments.length>2?arguments[2]:void 0,n=numberic(e,r);if(void 0!==n)return(t=isNumberic(t,!0)?t:r)>0?n.toFixed(t):e},moneyFormat=function(e){var r,t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,o=arguments.length>2?arguments[2]:void 0,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";return isNumberic(e)?(o=isNumberic(o,!0)?o:n,null!==(r=null===(t=numberic(e,n))||void 0===t?void 0:t.toLocaleString(void 0,{minimumFractionDigits:o,maximumFractionDigits:o}))&&void 0!==r?r:a):a},signFormat=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return isNumberic(e)?"".concat(e>0?"+":e<0?"-":"").concat(Math.abs(e)):r},sleep=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:16;return new Promise((function(r){return setTimeout(r,e)}))},settable=function(e){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return typeis(e)===Types.set&&(!r||e.size>0)},PromiseStatus;!function(e){e.pending="pending",e.fulfilled="fulfilled",e.rejected="rejected"}(PromiseStatus||(PromiseStatus={}));var PromisePolyfill=function(){function e(r){var t=this;_classCallCheck(this,e),_defineProperty(this,"status",void 0),_defineProperty(this,"value",void 0),_defineProperty(this,"reason",void 0),_defineProperty(this,"onResolvedClosures",void 0),_defineProperty(this,"onRejectedClosures",void 0),this.status=PromiseStatus.pending,this.value=void 0,this.reason=void 0,this.onResolvedClosures=[],this.onRejectedClosures=[];var n=function(e){t.status===PromiseStatus.pending&&(t.status=PromiseStatus.rejected,t.reason=e,t.onRejectedClosures.forEach((function(e){return e()})))};try{r((function(e){t.status===PromiseStatus.pending&&(t.status=PromiseStatus.fulfilled,t.value=e,t.onResolvedClosures.forEach((function(e){return e()})))}),n)}catch(e){n(e)}}return _createClass(e,[{key:"then",value:function(r,t){var n=this;r="function"==typeof r?r:function(e){return e},t="function"==typeof t?t:function(e){throw e};var o=new e((function(e,a){n.status===PromiseStatus.fulfilled&µ((function(){try{var t,i=null===(t=r)||void 0===t?void 0:t(n.value);resolvePromise(o,i,e,a)}catch(e){a(e)}})),n.status===PromiseStatus.rejected&µ((function(){try{var r,i=null===(r=t)||void 0===r?void 0:r(n.reason);resolvePromise(o,i,e,a)}catch(e){a(e)}})),n.status===PromiseStatus.pending&&(n.onResolvedClosures.push((function(){micro((function(){try{var t,i=null===(t=r)||void 0===t?void 0:t(n.value);resolvePromise(o,i,e,a)}catch(e){a(e)}}))})),n.onRejectedClosures.push((function(){micro((function(){try{var r,i=null===(r=t)||void 0===r?void 0:r(n.reason);resolvePromise(o,i,e,a)}catch(e){a(e)}}))})))}));return o}},{key:"catch",value:function(e){return this.then(void 0,e)}}]),e}();function micro(e){return"undefined"!=typeof window?window.queueMicrotask(e):process.nextTick(e)}function resolvePromise(e,r,t,n){if(r===e)return n(new TypeError("Chaining cycle detected for promise"));var o=!1;if(null===r||"object"!==_typeof(r)&&"function"!=typeof r)t(r);else try{var a=r.then;"function"==typeof a?a.call(r,(function(r){o||(o=!0,resolvePromise(e,r,t,n))}),(function(e){o||(o=!0,n(e))})):t(r)}catch(e){if(o)return;o=!0,n(e)}}_defineProperty(PromisePolyfill,"resolve",void 0),_defineProperty(PromisePolyfill,"reject",void 0),_defineProperty(PromisePolyfill,"race",void 0),_defineProperty(PromisePolyfill,"all",void 0),_defineProperty(PromisePolyfill,"deferred",void 0),PromisePolyfill.resolve=function(e){return new PromisePolyfill((function(r,t){return r(e)}))},PromisePolyfill.reject=function(e){return new PromisePolyfill((function(r,t){return t(e)}))},PromisePolyfill.race=function(e){return new PromisePolyfill((function(r,t){for(var n=0;n2&&void 0!==arguments[2]&&arguments[2];if(typeis(e)!==Types.function&&typeis(e)!==Types.asyncFunction)throw new TypeError("Expected a function");if(!isNumberic(r,!0))throw new TypeError("Expected a numberic time");var a=function(){for(var a=arguments.length,i=new Array(a),u=0;uu?(a&&(clearTimeout(a),a=null),l=c,e.apply(y,n)):a||!1===(null==t?void 0:t.trailing)||(a=setTimeout((function(){l=!1===(null==t?void 0:t.leading)?0:(new Date).getTime(),a=null,e.apply(y,n)}),s)),i};return y.cancel=function(){a&&clearTimeout(a),l=0,a=null},y},_TypedCopyMap,TypedArrayMap={"[object Float32Array]":Float32Array,"[object Float64Array]":Float64Array,"[object Int8Array]":Int8Array,"[object Int16Array]":Int16Array,"[object Int32Array]":Int32Array,"[object Uint8Array]":Uint8Array,"[object Uint16Array]":Uint16Array,"[object Uint32Array]":Uint32Array,"[object Uint8ClampedArray]":Uint8ClampedArray},TypedCopyMap=(_TypedCopyMap={},_defineProperty(_TypedCopyMap,Types.date,copyDate),_defineProperty(_TypedCopyMap,Types.arrayBuffer,copyArrayBuffer),_defineProperty(_TypedCopyMap,Types.dataView,copyDataView),_defineProperty(_TypedCopyMap,Types.float32Array,copyTypedArray),_defineProperty(_TypedCopyMap,Types.float64Array,copyTypedArray),_defineProperty(_TypedCopyMap,Types.int8Array,copyTypedArray),_defineProperty(_TypedCopyMap,Types.int16Array,copyTypedArray),_defineProperty(_TypedCopyMap,Types.int32Array,copyTypedArray),_defineProperty(_TypedCopyMap,Types.uint8Array,copyTypedArray),_defineProperty(_TypedCopyMap,Types.uint8ClampedArray,copyTypedArray),_defineProperty(_TypedCopyMap,Types.uint16Array,copyTypedArray),_defineProperty(_TypedCopyMap,Types.uint32Array,copyTypedArray),_defineProperty(_TypedCopyMap,Types.bigInt64Array,copyTypedArray),_defineProperty(_TypedCopyMap,Types.bigUint64Array,copyTypedArray),_defineProperty(_TypedCopyMap,Types.regExp,copyRegExp),_TypedCopyMap),copy=function(e){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],t=function e(r){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new Map,o=r;if(isNull(o))return o;if(TypedCopyMap[typeis(o)])return TypedCopyMap[typeis(o)](r);if(n.get(o))return n.get(o);if(arrayable(r,!1)){var a=Array.prototype.constructor();return n.set(o,a),r.map((function(e){return a.push(e)})),t?a.map((function(r){return e(r,t,n)})):a}if(objectable(r,!1)){var i=Object.prototype.constructor();for(var u in n.set(o,i),r)Object.prototype.hasOwnProperty.call(r,u)&&(i[u]=r[u]);if(!t)return i;for(var l in i)Object.prototype.hasOwnProperty.call(i,l)&&(i[l]=e(i[l],t,n));return i}return r};return t.call(null,e,r)};function copyArrayBuffer(e){var r=new ArrayBuffer(e.byteLength);return new Uint8Array(r).set(new Uint8Array(e)),r}function copyDataView(e){var r=copyArrayBuffer(e.buffer);return new DataView(r,e.byteOffset,e.byteLength)}function copyDate(e){return new Date(e.getTime())}function copyRegExp(e){var r=new RegExp(e.source,e.flags);return r.lastIndex=e.lastIndex,r}function copyTypedArray(e){try{TypedArrayMap["[object BigInt64Array]"]=BigInt64Array,TypedArrayMap["[object BigUint64Array]"]=BigUint64Array}catch(e){}var r=copyArrayBuffer(e.buffer);return new(TypedArrayMap[Object.prototype.toString.call(e)])(r,e.byteOffset,e.length)}var sort=function(e,r){var t=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"zh-Hans-CN",o=null!=e?e:"",a=null!=r?r:"",i=/^[a-zA-Z0-9]$/;return isNumberic(e)&&isNumberic(r)?Number(e)>Number(r)?1:Number(e)a?1:oe.length)&&(r=e.length);for(var t=0,o=new Array(r);t=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,s=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return i=e.done,e},e:function(e){s=!0,a=e},f:function(){try{i||null==t.return||t.return()}finally{if(s)throw a}}}}var stringable=function(e){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return typeis(e)===exports.Types.string&&(!r||e.length>0)},strLen=function(e){var r=0;if(!stringable(e))return r;for(var t=0,o=e.length;t2&&void 0!==arguments[2])||arguments[2];if(isNil(e))return!1;if(!re(kRegStartStrictNumberic,e)||re(kRegEndStrictNumberic,e))return!1;var o=+e;return!isNaN(o)&&(t?typeis(r)===exports.Types.bool?re(r?kRegSignNumberic:kRegUnSignNumberic,o):re(kRegNumberic,o):typeis(o)===exports.Types.number)},objectable=function(e){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(typeis(e)!==exports.Types.object)return!1;var t=Object.getPrototypeOf(e);if(!t)return!r||Object.keys(e).length>0;if(t.constructor===Object)return!r||Object.keys(e).length>0;var o=Object.prototype.hasOwnProperty.call(t,"constructor")&&t.constructor;return"function"==typeof o&&Object.prototype.hasOwnProperty.toString.call(o)===Object.prototype.hasOwnProperty.toString.call(Object)&&(!r||Object.keys(e).length>0)},optional=function optional(path,obj){var separator=arguments.length>2&&void 0!==arguments[2]?arguments[2]:".",rs=void 0,properties;if(!stringable(path)||!stringable(separator))return rs;var p=path,o;if(properties=-1===p.indexOf(separator)?Array.of(p):p.split(separator),isNil(obj)){try{o=isNumberic(properties[0])?eval("this[".concat(properties[0],"]")):eval("this."+properties[0])}catch(e){o=Object.prototype.constructor()}if(properties.shift(),typeis(o)===exports.Types.object);else if(typeis(o)!==exports.Types.array)return rs}else o=obj;return rs=properties.reduce((function(e,r){return objectable(e)?e[r]:arrayable(e)?isNumberic(r)?e[+r]:e[r]:e?e[r]:void 0}),o),rs},extractable=function extractable(){for(var rs=Object.prototype.constructor(),_len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++)args[_key]=arguments[_key];if(!arrayable(args)||args.length<2)return rs;var t=Array.prototype.slice.call(args,-1)[0];if(typeis(t)===exports.Types.string)try{t=eval("this."+t)}catch(e){t=void 0}if(!objectable(t))return rs;var o=Array.prototype.slice.apply(args,[0,-1]),_iterator=_createForOfIteratorHelper(o),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var i=_step.value;typeis(i)===exports.Types.string?rs[i]=optional(i,t)||String.prototype.constructor():typeis(i)===exports.Types.array?2===i.length?rs[i[0]]=(typeis(i[1])===exports.Types.string?optional(i[1],t):i[1])||String.prototype.constructor():3===i.length&&(rs[i[0]]=objectable(i[2])||arrayable(i[2])?optional(i[1],i[2]):String.prototype.constructor()):typeis(i)===exports.Types.object&&(rs=Object.assign(rs,i))}}catch(e){_iterator.e(e)}finally{_iterator.f()}return rs},assign=function e(r,t,o){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:".";typeis(t)!==exports.Types.object&&typeis(t)!==exports.Types.array&&typeis(t)!==exports.Types.unknown||(stringable(r)||arrayable(r))&&(stringable(r)&&(r=r.split(n)),r.length>1?e(r,t[r.shift()],o):t[r[0]]=o)},objReverse=function(e){if(!objectable(e))return e;var r=e,t=Object.keys(r).reduce((function(e,t){var o=String(r[t]),n=[];return arrayable(e[o],!1)&&(n=e[o]),Object.assign(e,_defineProperty({},o,n.concat(t)))}),{});for(var o in t)t.hasOwnProperty(o)&&(t[o]=Array.isArray(t[o])&&1===t[o].length?t[o][0]:t[o]);return t},TypesDesc,Types;exports.TypesDesc=void 0,TypesDesc=exports.TypesDesc||(exports.TypesDesc={}),TypesDesc["[object Number]"]="number",TypesDesc["[object String]"]="string",TypesDesc["[object Boolean]"]="bool",TypesDesc["[object Undefined]"]="undefined",TypesDesc["[object Null]"]="null",TypesDesc["[object Array]"]="array",TypesDesc["[object Uint8Array]"]="uint8Array",TypesDesc["[object Object]"]="object",TypesDesc["[object Function]"]="function",TypesDesc["[object AsyncFunction]"]="asyncFunction",TypesDesc["[object BigInt]"]="bigInt",TypesDesc["[object Date]"]="date",TypesDesc["[object WeakMap]"]="weakMap",TypesDesc["[object Map]"]="map",TypesDesc["[object WeakSet]"]="weakSet",TypesDesc["[object ArrayBuffer]"]="arrayBuffer",TypesDesc["[object Set]"]="set",TypesDesc["[object Symbol]"]="symbol",TypesDesc["[object DataView]"]="dataView",TypesDesc["[object Float32Array]"]="float32Array",TypesDesc["[object Float64Array]"]="float64Array",TypesDesc["[object Int8Array]"]="int8Array",TypesDesc["[object Int16Array]"]="int16Array",TypesDesc["[object Int32Array]"]="int32Array",TypesDesc["[object Uint8ClampedArray]"]="uint8ClampedArray",TypesDesc["[object Uint16Array]"]="uint16Array",TypesDesc["[object Uint32Array]"]="uint32Array",TypesDesc["[object BigInt64Array]"]="bigInt64Array",TypesDesc["[object BigUint64Array]"]="bigUint64Array",TypesDesc["[object RegExp]"]="regExp",exports.Types=void 0,Types=exports.Types||(exports.Types={}),Types.number="number",Types.string="string",Types.bool="bool",Types[void 0]="undefined",Types.null="null",Types.bigInt="bigInt",Types.object="object",Types.function="function",Types.asyncFunction="asyncFunction",Types.symbol="symbol",Types.arrayBuffer="arrayBuffer",Types.regExp="regExp",Types.date="date",Types.dataView="dataView",Types.weakMap="weakMap",Types.map="map",Types.weakSet="weakSet",Types.set="set",Types.array="array",Types.uint8Array="uint8Array",Types.float32Array="float32Array",Types.float64Array="float64Array",Types.int8Array="int8Array",Types.int16Array="int16Array",Types.int32Array="int32Array",Types.uint8ClampedArray="uint8ClampedArray",Types.uint16Array="uint16Array",Types.uint32Array="uint32Array",Types.bigInt64Array="bigInt64Array",Types.bigUint64Array="bigUint64Array",Types.unknown="";var inEnum=function(e,r){return!(!objectable(e)||e!==Object(e))&&(Object.prototype.hasOwnProperty.call(e,r)||Object.values(e).indexOf(r)>-1)},typeis=function(e){var r=Object.prototype.toString.call(e);if("[object Object]"===r){var t=Object.getPrototypeOf(e);if(t&&t.constructor!==Object)return exports.Types.unknown}var o=exports.Types.unknown;return Object.keys(exports.TypesDesc).includes(r)&&(o=exports.Types[exports.TypesDesc[r]]),o},re=function(e,r){return e.test(r.toString())},arrayable=function(e){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return(typeis(e)===exports.Types.array||typeis(e)===exports.Types.uint8Array)&&(!r||e.length>0)},arrayUnique=function(e){var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!arrayable(e))return e;if(r){var t=e.map((function(e){return JSON.stringify(e)}));return Array.from(new Set(t)).map((function(e){return JSON.parse(e)}))}return Array.from(new Set(e))},arrValsCount=function(e){var r={};return arrayable(e)?e.reduce((function(e,r){var t=r+"";return e[t]?e[t]++:e[t]=1,e}),r):r},arrValCount=function(e,r){if(!arrayable(e)||!e.includes(r))return 0;var t=arrValsCount(e),o=r+"";return t.hasOwnProperty(o)?t[o]:0},flat=function e(r){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1/0,o=Array.prototype.constructor();if(!arrayable(r,!1))return r;var n=isNaN(t)?1:Number(t);if(!n)return Array.prototype.slice.call(r);for(var a=0,i=r.length>>>0;a>8-a%1*8)){if((n=r.charCodeAt(a+=3/4))>255)throw new InvalidCharacterError("'btoa' failed: The string to be encoded contains characters outside of the Latin1 range.");o=o<<8|n}return t},exports._atob=void 0,"undefined"!=typeof window&&window.atob?exports._atob=window.atob:exports._atob=function(e){var r=String(e).replace(/[=]+$/,"");if(r.length%4==1)throw new InvalidCharacterError("'atob' failed: The string to be decoded is not correctly encoded.");for(var t,o="",n=0,a=0,i=0;t=r.charAt(i++);~t&&(a=n%4?64*a+t:t,n++%4)?o+=String.fromCharCode(255&a>>(-2*n&6)):0)t=chars.indexOf(t);return o};var url2Blob=function(e){if("undefined"==typeof window)throw new Error("url2Blob only works in browser environment");if(!stringable(e))throw new TypeError(e+" can not be null");var r=e.split(",");if(!arrayable(r))throw new ReferenceError("invalid data url");var t=r[0].match(/:(.*?);/);if(!arrayable(t)||t.length<2)throw new ReferenceError("invalid data format");for(var o=t,n=exports._atob(r[1]),a=n.length,i=new Uint8Array(a);a--;)i[a]=n.charCodeAt(a);return new Blob([i],{type:o[1]})},str2Buffer=function(e){if(stringable(e))return e=exports._btoa(unescape(encodeURIComponent(e))),new Uint8Array(Array.prototype.map.call(e,(function(e){return e.charCodeAt(0)})))},buffer2Str=function(e){if(arrayable(e)||objectable(e)||stringable(e)){typeis(e)===exports.Types.string&&(e=JSON.parse.call(null,e));var r=Object.values(e);if(arrayable(r))return decodeURIComponent(escape(exports._atob(String.fromCharCode.apply(null,Array.prototype.map.call(new Uint8Array(r),(function(e){return e}))))))}},formatNumber=function(e){return(e=e.toString())[1]?e:"0"+e},dateable=function(e){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return typeis(e)===exports.Types.date&&(!r||"Invalid Date"!==e.toString())},formatDate=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"yyyy-MM-dd hh:mm:ss",t=String.prototype.constructor();if(typeis(e)!==exports.Types.date&&!stringable(e))return t;if(typeis(e)===exports.Types.string&&(e=new Date(e)),"Invalid Date"===e.toString())return t;for(var o=e,n={Y:o.getFullYear(),M:o.getMonth()+1,D:o.getDate(),h:o.getHours(),m:o.getMinutes(),s:o.getSeconds()},a=0,i=Object.keys(n).length>>>0;a0&&void 0!==arguments[0]?arguments[0]:0,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,i=arguments.length>6?arguments[6]:void 0;if([e,r,t,o,n,a].every((function(e){return typeis(e)===exports.Types.number&&e>=0}))){var s=new Date(Date.UTC(e,r-1,t,o,n,a)),p=new Date(s.toLocaleString("en-US",{timeZone:"UTC"})),y=s;if(stringable(i))y=new Date(s.toLocaleString("en-US",{timeZone:i}));else if("Invalid Date"===(y=new Date("".concat(r,"/").concat(t,"/").concat(e," ").concat(o,":").concat(n,":").concat(a))).toString())return;var l=p.getTime()-y.getTime();return s.setTime(s.getTime()+l),s}},quarterable=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"Q",o=Array(2).fill(String.prototype.constructor()),n=new RegExp("^\\d{4}".concat(t,"\\d$"),"g");if(stringable(e)&&n.test(e)){var a=e.split(t),i=_slicedToArray(a,2),s=i[0],p=i[1];if(isNumberic(s)&&isNumberic(p)){var y=+p+ +r,l=4*+s+y;return y%4==0?(o[0]=0===y?s-1:+s+y/4-1,o[1]=4):(o[1]=l%4,o[0]=(l-o[1])/4),o.join(t)}}},mappable=function(e){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return typeis(e)===exports.Types.map&&(!r||e.size>0)},DecimalMathCalcType;!function(e){e.round="round",e.ceil="ceil",e.floor="floor",e.trunc="trunc"}(DecimalMathCalcType||(DecimalMathCalcType={}));var Decimal=function(){function e(){_classCallCheck(this,e),_defineProperty(this,"powers",void 0),void 0===Math.trunc&&(Math.trunc=function(e){return e<0?Math.ceil(e):Math.floor(e)}),this.powers=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13,1e14,1e15,1e16,1e17,1e18,1e19,1e20,1e21,1e22]}return _createClass(e,[{key:"intpow10",value:function(e){return e<0||e>22?Math.pow(10,e):this.powers[e]}},{key:"isRound",value:function(e,r){var t=this.intpow10(r);return Math.round(e*t)/t===e}},{key:"decimalAdjust",value:function(e,r,t){if("round"!==e&&this.isRound(r,t||0))return r;var o=this.intpow10(t||0),n=r*o*(1+Number.EPSILON);return Math[e](n)/o}},{key:"round",value:function(e,r){return this.decimalAdjust(DecimalMathCalcType.round,e,r)}},{key:"ceil",value:function(e,r){return this.decimalAdjust(DecimalMathCalcType.ceil,e,r)}},{key:"floor",value:function(e,r){return this.decimalAdjust(DecimalMathCalcType.floor,e,r)}},{key:"trunc",value:function(e,r){return this.decimalAdjust(DecimalMathCalcType.trunc,e,r)}},{key:"toFixed",value:function(e,r){return this.decimalAdjust(DecimalMathCalcType.round,e,r).toFixed(r)}}]),e}(),rangeRandom=function(e,r){return!isNumberic(e)||!isNumberic(r)||e>r?Math.random():Math.random()*(r-e)+e},numberic=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;if(isNumberic(e,void 0,!1)){var t=+e,o=Math.sign(t);return r=isNumberic(r,!0)?r:2,(new Decimal).round(Math.abs(t),r)*o}},guid=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:8,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"abcdefghijklmnopqrstuvwxyz0123456789",t=r.split("");return t.length||(t="abcdefghijklmnopqrstuvwxyz0123456789".split("")),_toConsumableArray(Array(e)).map((function(e){return t[Math.random()*t.length|0]})).join("")},hash=function(){return(16777215*Math.random()<<7).toString(16)},numberFormat=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,t=arguments.length>2?arguments[2]:void 0,o=numberic(e,r);if(void 0!==o)return(t=isNumberic(t,!0)?t:r)>0?o.toFixed(t):e},moneyFormat=function(e){var r,t,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,n=arguments.length>2?arguments[2]:void 0,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";return isNumberic(e)?(n=isNumberic(n,!0)?n:o,null!==(r=null===(t=numberic(e,o))||void 0===t?void 0:t.toLocaleString(void 0,{minimumFractionDigits:n,maximumFractionDigits:n}))&&void 0!==r?r:a):a},signFormat=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return isNumberic(e)?"".concat(e>0?"+":e<0?"-":"").concat(Math.abs(e)):r},sleep=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:16;return new Promise((function(r){return setTimeout(r,e)}))},settable=function(e){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return typeis(e)===exports.Types.set&&(!r||e.size>0)},PromiseStatus;!function(e){e.pending="pending",e.fulfilled="fulfilled",e.rejected="rejected"}(PromiseStatus||(PromiseStatus={}));var PromisePolyfill=function(){function e(r){var t=this;_classCallCheck(this,e),_defineProperty(this,"status",void 0),_defineProperty(this,"value",void 0),_defineProperty(this,"reason",void 0),_defineProperty(this,"onResolvedClosures",void 0),_defineProperty(this,"onRejectedClosures",void 0),this.status=PromiseStatus.pending,this.value=void 0,this.reason=void 0,this.onResolvedClosures=[],this.onRejectedClosures=[];var o=function(e){t.status===PromiseStatus.pending&&(t.status=PromiseStatus.rejected,t.reason=e,t.onRejectedClosures.forEach((function(e){return e()})))};try{r((function(e){t.status===PromiseStatus.pending&&(t.status=PromiseStatus.fulfilled,t.value=e,t.onResolvedClosures.forEach((function(e){return e()})))}),o)}catch(e){o(e)}}return _createClass(e,[{key:"then",value:function(r,t){var o=this;r="function"==typeof r?r:function(e){return e},t="function"==typeof t?t:function(e){throw e};var n=new e((function(e,a){o.status===PromiseStatus.fulfilled&µ((function(){try{var t,i=null===(t=r)||void 0===t?void 0:t(o.value);resolvePromise(n,i,e,a)}catch(e){a(e)}})),o.status===PromiseStatus.rejected&µ((function(){try{var r,i=null===(r=t)||void 0===r?void 0:r(o.reason);resolvePromise(n,i,e,a)}catch(e){a(e)}})),o.status===PromiseStatus.pending&&(o.onResolvedClosures.push((function(){micro((function(){try{var t,i=null===(t=r)||void 0===t?void 0:t(o.value);resolvePromise(n,i,e,a)}catch(e){a(e)}}))})),o.onRejectedClosures.push((function(){micro((function(){try{var r,i=null===(r=t)||void 0===r?void 0:r(o.reason);resolvePromise(n,i,e,a)}catch(e){a(e)}}))})))}));return n}},{key:"catch",value:function(e){return this.then(void 0,e)}}]),e}();function micro(e){return"undefined"!=typeof window?window.queueMicrotask(e):process.nextTick(e)}function resolvePromise(e,r,t,o){if(r===e)return o(new TypeError("Chaining cycle detected for promise"));var n=!1;if(null===r||"object"!==_typeof(r)&&"function"!=typeof r)t(r);else try{var a=r.then;"function"==typeof a?a.call(r,(function(r){n||(n=!0,resolvePromise(e,r,t,o))}),(function(e){n||(n=!0,o(e))})):t(r)}catch(e){if(n)return;n=!0,o(e)}}_defineProperty(PromisePolyfill,"resolve",void 0),_defineProperty(PromisePolyfill,"reject",void 0),_defineProperty(PromisePolyfill,"race",void 0),_defineProperty(PromisePolyfill,"all",void 0),_defineProperty(PromisePolyfill,"deferred",void 0),PromisePolyfill.resolve=function(e){return new PromisePolyfill((function(r,t){return r(e)}))},PromisePolyfill.reject=function(e){return new PromisePolyfill((function(r,t){return t(e)}))},PromisePolyfill.race=function(e){return new PromisePolyfill((function(r,t){for(var o=0;o2&&void 0!==arguments[2]&&arguments[2];if(typeis(e)!==exports.Types.function&&typeis(e)!==exports.Types.asyncFunction)throw new TypeError("Expected a function");if(!isNumberic(r,!0))throw new TypeError("Expected a numberic time");var a=function(){for(var a=arguments.length,i=new Array(a),s=0;ss?(a&&(clearTimeout(a),a=null),p=l,e.apply(y,o)):a||!1===(null==t?void 0:t.trailing)||(a=setTimeout((function(){p=!1===(null==t?void 0:t.leading)?0:(new Date).getTime(),a=null,e.apply(y,o)}),u)),i};return y.cancel=function(){a&&clearTimeout(a),p=0,a=null},y},_TypedCopyMap,TypedArrayMap={"[object Float32Array]":Float32Array,"[object Float64Array]":Float64Array,"[object Int8Array]":Int8Array,"[object Int16Array]":Int16Array,"[object Int32Array]":Int32Array,"[object Uint8Array]":Uint8Array,"[object Uint16Array]":Uint16Array,"[object Uint32Array]":Uint32Array,"[object Uint8ClampedArray]":Uint8ClampedArray},TypedCopyMap=(_TypedCopyMap={},_defineProperty(_TypedCopyMap,exports.Types.date,copyDate),_defineProperty(_TypedCopyMap,exports.Types.arrayBuffer,copyArrayBuffer),_defineProperty(_TypedCopyMap,exports.Types.dataView,copyDataView),_defineProperty(_TypedCopyMap,exports.Types.float32Array,copyTypedArray),_defineProperty(_TypedCopyMap,exports.Types.float64Array,copyTypedArray),_defineProperty(_TypedCopyMap,exports.Types.int8Array,copyTypedArray),_defineProperty(_TypedCopyMap,exports.Types.int16Array,copyTypedArray),_defineProperty(_TypedCopyMap,exports.Types.int32Array,copyTypedArray),_defineProperty(_TypedCopyMap,exports.Types.uint8Array,copyTypedArray),_defineProperty(_TypedCopyMap,exports.Types.uint8ClampedArray,copyTypedArray),_defineProperty(_TypedCopyMap,exports.Types.uint16Array,copyTypedArray),_defineProperty(_TypedCopyMap,exports.Types.uint32Array,copyTypedArray),_defineProperty(_TypedCopyMap,exports.Types.bigInt64Array,copyTypedArray),_defineProperty(_TypedCopyMap,exports.Types.bigUint64Array,copyTypedArray),_defineProperty(_TypedCopyMap,exports.Types.regExp,copyRegExp),_TypedCopyMap),copy=function(e){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],t=function e(r){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new Map,n=r;if(isNull(n))return n;if(TypedCopyMap[typeis(n)])return TypedCopyMap[typeis(n)](r);if(o.get(n))return o.get(n);if(arrayable(r,!1)){var a=Array.prototype.constructor();return o.set(n,a),r.map((function(e){return a.push(e)})),t?a.map((function(r){return e(r,t,o)})):a}if(objectable(r,!1)){var i=Object.prototype.constructor();for(var s in o.set(n,i),r)Object.prototype.hasOwnProperty.call(r,s)&&(i[s]=r[s]);if(!t)return i;for(var p in i)Object.prototype.hasOwnProperty.call(i,p)&&(i[p]=e(i[p],t,o));return i}return r};return t.call(null,e,r)};function copyArrayBuffer(e){var r=new ArrayBuffer(e.byteLength);return new Uint8Array(r).set(new Uint8Array(e)),r}function copyDataView(e){var r=copyArrayBuffer(e.buffer);return new DataView(r,e.byteOffset,e.byteLength)}function copyDate(e){return new Date(e.getTime())}function copyRegExp(e){var r=new RegExp(e.source,e.flags);return r.lastIndex=e.lastIndex,r}function copyTypedArray(e){try{TypedArrayMap["[object BigInt64Array]"]=BigInt64Array,TypedArrayMap["[object BigUint64Array]"]=BigUint64Array}catch(e){}var r=copyArrayBuffer(e.buffer);return new(TypedArrayMap[Object.prototype.toString.call(e)])(r,e.byteOffset,e.length)}var sort=function(e,r){var t=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"zh-Hans-CN",n=null!=e?e:"",a=null!=r?r:"",i=/[a-zA-Z0-9]/;return isNumberic(e)&&isNumberic(r)?Number(e)>Number(r)?1:Number(e)a?1:ne.length)&&(r=e.length);for(var t=0,o=new Array(r);t=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,s=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return i=e.done,e},e:function(e){s=!0,a=e},f:function(){try{i||null==t.return||t.return()}finally{if(s)throw a}}}}var stringable=function(e){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return typeis(e)===exports.Types.string&&(!r||e.length>0)},strLen=function(e){var r=0;if(!stringable(e))return r;for(var t=0,o=e.length;t2&&void 0!==arguments[2])||arguments[2];if(isNil(e))return!1;if(!re(kRegStartStrictNumberic,e)||re(kRegEndStrictNumberic,e))return!1;var o=+e;return!isNaN(o)&&(t?typeis(r)===exports.Types.bool?re(r?kRegSignNumberic:kRegUnSignNumberic,o):re(kRegNumberic,o):typeis(o)===exports.Types.number)},objectable=function(e){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(typeis(e)!==exports.Types.object)return!1;var t=Object.getPrototypeOf(e);if(!t)return!r||Object.keys(e).length>0;if(t.constructor===Object)return!r||Object.keys(e).length>0;var o=Object.prototype.hasOwnProperty.call(t,"constructor")&&t.constructor;return"function"==typeof o&&Object.prototype.hasOwnProperty.toString.call(o)===Object.prototype.hasOwnProperty.toString.call(Object)&&(!r||Object.keys(e).length>0)},optional=function optional(path,obj){var separator=arguments.length>2&&void 0!==arguments[2]?arguments[2]:".",rs=void 0,properties;if(!stringable(path)||!stringable(separator))return rs;var p=path,o;if(properties=-1===p.indexOf(separator)?Array.of(p):p.split(separator),isNil(obj)){try{o=isNumberic(properties[0])?eval("this[".concat(properties[0],"]")):eval("this."+properties[0])}catch(e){o=Object.prototype.constructor()}if(properties.shift(),typeis(o)===exports.Types.object);else if(typeis(o)!==exports.Types.array)return rs}else o=obj;return rs=properties.reduce((function(e,r){return objectable(e)?e[r]:arrayable(e)?isNumberic(r)?e[+r]:e[r]:e?e[r]:void 0}),o),rs},extractable=function extractable(){for(var rs=Object.prototype.constructor(),_len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++)args[_key]=arguments[_key];if(!arrayable(args)||args.length<2)return rs;var t=Array.prototype.slice.call(args,-1)[0];if(typeis(t)===exports.Types.string)try{t=eval("this."+t)}catch(e){t=void 0}if(!objectable(t))return rs;var o=Array.prototype.slice.apply(args,[0,-1]),_iterator=_createForOfIteratorHelper(o),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var i=_step.value;typeis(i)===exports.Types.string?rs[i]=optional(i,t)||String.prototype.constructor():typeis(i)===exports.Types.array?2===i.length?rs[i[0]]=(typeis(i[1])===exports.Types.string?optional(i[1],t):i[1])||String.prototype.constructor():3===i.length&&(rs[i[0]]=objectable(i[2])||arrayable(i[2])?optional(i[1],i[2]):String.prototype.constructor()):typeis(i)===exports.Types.object&&(rs=Object.assign(rs,i))}}catch(e){_iterator.e(e)}finally{_iterator.f()}return rs},assign=function e(r,t,o){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:".";typeis(t)!==exports.Types.object&&typeis(t)!==exports.Types.array&&typeis(t)!==exports.Types.unknown||(stringable(r)||arrayable(r))&&(stringable(r)&&(r=r.split(n)),r.length>1?e(r,t[r.shift()],o):t[r[0]]=o)},objReverse=function(e){if(!objectable(e))return e;var r=e,t=Object.keys(r).reduce((function(e,t){var o=String(r[t]),n=[];return arrayable(e[o],!1)&&(n=e[o]),Object.assign(e,_defineProperty({},o,n.concat(t)))}),{});for(var o in t)t.hasOwnProperty(o)&&(t[o]=Array.isArray(t[o])&&1===t[o].length?t[o][0]:t[o]);return t},TypesDesc,Types;exports.TypesDesc=void 0,TypesDesc=exports.TypesDesc||(exports.TypesDesc={}),TypesDesc["[object Number]"]="number",TypesDesc["[object String]"]="string",TypesDesc["[object Boolean]"]="bool",TypesDesc["[object Undefined]"]="undefined",TypesDesc["[object Null]"]="null",TypesDesc["[object Array]"]="array",TypesDesc["[object Uint8Array]"]="uint8Array",TypesDesc["[object Object]"]="object",TypesDesc["[object Function]"]="function",TypesDesc["[object AsyncFunction]"]="asyncFunction",TypesDesc["[object BigInt]"]="bigInt",TypesDesc["[object Date]"]="date",TypesDesc["[object WeakMap]"]="weakMap",TypesDesc["[object Map]"]="map",TypesDesc["[object WeakSet]"]="weakSet",TypesDesc["[object ArrayBuffer]"]="arrayBuffer",TypesDesc["[object Set]"]="set",TypesDesc["[object Symbol]"]="symbol",TypesDesc["[object DataView]"]="dataView",TypesDesc["[object Float32Array]"]="float32Array",TypesDesc["[object Float64Array]"]="float64Array",TypesDesc["[object Int8Array]"]="int8Array",TypesDesc["[object Int16Array]"]="int16Array",TypesDesc["[object Int32Array]"]="int32Array",TypesDesc["[object Uint8ClampedArray]"]="uint8ClampedArray",TypesDesc["[object Uint16Array]"]="uint16Array",TypesDesc["[object Uint32Array]"]="uint32Array",TypesDesc["[object BigInt64Array]"]="bigInt64Array",TypesDesc["[object BigUint64Array]"]="bigUint64Array",TypesDesc["[object RegExp]"]="regExp",exports.Types=void 0,Types=exports.Types||(exports.Types={}),Types.number="number",Types.string="string",Types.bool="bool",Types[void 0]="undefined",Types.null="null",Types.bigInt="bigInt",Types.object="object",Types.function="function",Types.asyncFunction="asyncFunction",Types.symbol="symbol",Types.arrayBuffer="arrayBuffer",Types.regExp="regExp",Types.date="date",Types.dataView="dataView",Types.weakMap="weakMap",Types.map="map",Types.weakSet="weakSet",Types.set="set",Types.array="array",Types.uint8Array="uint8Array",Types.float32Array="float32Array",Types.float64Array="float64Array",Types.int8Array="int8Array",Types.int16Array="int16Array",Types.int32Array="int32Array",Types.uint8ClampedArray="uint8ClampedArray",Types.uint16Array="uint16Array",Types.uint32Array="uint32Array",Types.bigInt64Array="bigInt64Array",Types.bigUint64Array="bigUint64Array",Types.unknown="";var inEnum=function(e,r){return!(!objectable(e)||e!==Object(e))&&(Object.prototype.hasOwnProperty.call(e,r)||Object.values(e).indexOf(r)>-1)},typeis=function(e){var r=Object.prototype.toString.call(e);if("[object Object]"===r){var t=Object.getPrototypeOf(e);if(t&&t.constructor!==Object)return exports.Types.unknown}var o=exports.Types.unknown;return Object.keys(exports.TypesDesc).includes(r)&&(o=exports.Types[exports.TypesDesc[r]]),o},re=function(e,r){return e.test(r.toString())},arrayable=function(e){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return(typeis(e)===exports.Types.array||typeis(e)===exports.Types.uint8Array)&&(!r||e.length>0)},arrayUnique=function(e){var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!arrayable(e))return e;if(r){var t=e.map((function(e){return JSON.stringify(e)}));return Array.from(new Set(t)).map((function(e){return JSON.parse(e)}))}return Array.from(new Set(e))},arrValsCount=function(e){var r={};return arrayable(e)?e.reduce((function(e,r){var t=r+"";return e[t]?e[t]++:e[t]=1,e}),r):r},arrValCount=function(e,r){if(!arrayable(e)||!e.includes(r))return 0;var t=arrValsCount(e),o=r+"";return t.hasOwnProperty(o)?t[o]:0},flat=function e(r){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1/0,o=Array.prototype.constructor();if(!arrayable(r,!1))return r;var n=isNaN(t)?1:Number(t);if(!n)return Array.prototype.slice.call(r);for(var a=0,i=r.length>>>0;a>8-a%1*8)){if((n=r.charCodeAt(a+=3/4))>255)throw new InvalidCharacterError("'btoa' failed: The string to be encoded contains characters outside of the Latin1 range.");o=o<<8|n}return t},exports._atob=void 0,"undefined"!=typeof window&&window.atob?exports._atob=window.atob:exports._atob=function(e){var r=String(e).replace(/[=]+$/,"");if(r.length%4==1)throw new InvalidCharacterError("'atob' failed: The string to be decoded is not correctly encoded.");for(var t,o="",n=0,a=0,i=0;t=r.charAt(i++);~t&&(a=n%4?64*a+t:t,n++%4)?o+=String.fromCharCode(255&a>>(-2*n&6)):0)t=chars.indexOf(t);return o};var url2Blob=function(e){if("undefined"==typeof window)throw new Error("url2Blob only works in browser environment");if(!stringable(e))throw new TypeError(e+" can not be null");var r=e.split(",");if(!arrayable(r))throw new ReferenceError("invalid data url");var t=r[0].match(/:(.*?);/);if(!arrayable(t)||t.length<2)throw new ReferenceError("invalid data format");for(var o=t,n=exports._atob(r[1]),a=n.length,i=new Uint8Array(a);a--;)i[a]=n.charCodeAt(a);return new Blob([i],{type:o[1]})},str2Buffer=function(e){if(stringable(e))return e=exports._btoa(unescape(encodeURIComponent(e))),new Uint8Array(Array.prototype.map.call(e,(function(e){return e.charCodeAt(0)})))},buffer2Str=function(e){if(arrayable(e)||objectable(e)||stringable(e)){typeis(e)===exports.Types.string&&(e=JSON.parse.call(null,e));var r=Object.values(e);if(arrayable(r))return decodeURIComponent(escape(exports._atob(String.fromCharCode.apply(null,Array.prototype.map.call(new Uint8Array(r),(function(e){return e}))))))}},formatNumber=function(e){return(e=e.toString())[1]?e:"0"+e},dateable=function(e){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return typeis(e)===exports.Types.date&&(!r||"Invalid Date"!==e.toString())},formatDate=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"yyyy-MM-dd hh:mm:ss",t=String.prototype.constructor();if(typeis(e)!==exports.Types.date&&!stringable(e))return t;if(typeis(e)===exports.Types.string&&(e=new Date(e)),"Invalid Date"===e.toString())return t;for(var o=e,n={Y:o.getFullYear(),M:o.getMonth()+1,D:o.getDate(),h:o.getHours(),m:o.getMinutes(),s:o.getSeconds()},a=0,i=Object.keys(n).length>>>0;a0&&void 0!==arguments[0]?arguments[0]:0,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,i=arguments.length>6?arguments[6]:void 0;if([e,r,t,o,n,a].every((function(e){return typeis(e)===exports.Types.number&&e>=0}))){var s=new Date(Date.UTC(e,r-1,t,o,n,a)),p=new Date(s.toLocaleString("en-US",{timeZone:"UTC"})),y=s;if(stringable(i))y=new Date(s.toLocaleString("en-US",{timeZone:i}));else if("Invalid Date"===(y=new Date("".concat(r,"/").concat(t,"/").concat(e," ").concat(o,":").concat(n,":").concat(a))).toString())return;var l=p.getTime()-y.getTime();return s.setTime(s.getTime()+l),s}},quarterable=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"Q",o=Array(2).fill(String.prototype.constructor()),n=new RegExp("^\\d{4}".concat(t,"\\d$"),"g");if(stringable(e)&&n.test(e)){var a=e.split(t),i=_slicedToArray(a,2),s=i[0],p=i[1];if(isNumberic(s)&&isNumberic(p)){var y=+p+ +r,l=4*+s+y;return y%4==0?(o[0]=0===y?s-1:+s+y/4-1,o[1]=4):(o[1]=l%4,o[0]=(l-o[1])/4),o.join(t)}}},mappable=function(e){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return typeis(e)===exports.Types.map&&(!r||e.size>0)},DecimalMathCalcType;!function(e){e.round="round",e.ceil="ceil",e.floor="floor",e.trunc="trunc"}(DecimalMathCalcType||(DecimalMathCalcType={}));var Decimal=function(){function e(){_classCallCheck(this,e),_defineProperty(this,"powers",void 0),void 0===Math.trunc&&(Math.trunc=function(e){return e<0?Math.ceil(e):Math.floor(e)}),this.powers=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13,1e14,1e15,1e16,1e17,1e18,1e19,1e20,1e21,1e22]}return _createClass(e,[{key:"intpow10",value:function(e){return e<0||e>22?Math.pow(10,e):this.powers[e]}},{key:"isRound",value:function(e,r){var t=this.intpow10(r);return Math.round(e*t)/t===e}},{key:"decimalAdjust",value:function(e,r,t){if("round"!==e&&this.isRound(r,t||0))return r;var o=this.intpow10(t||0),n=r*o*(1+Number.EPSILON);return Math[e](n)/o}},{key:"round",value:function(e,r){return this.decimalAdjust(DecimalMathCalcType.round,e,r)}},{key:"ceil",value:function(e,r){return this.decimalAdjust(DecimalMathCalcType.ceil,e,r)}},{key:"floor",value:function(e,r){return this.decimalAdjust(DecimalMathCalcType.floor,e,r)}},{key:"trunc",value:function(e,r){return this.decimalAdjust(DecimalMathCalcType.trunc,e,r)}},{key:"toFixed",value:function(e,r){return this.decimalAdjust(DecimalMathCalcType.round,e,r).toFixed(r)}}]),e}(),rangeRandom=function(e,r){return!isNumberic(e)||!isNumberic(r)||e>r?Math.random():Math.random()*(r-e)+e},numberic=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;if(isNumberic(e,void 0,!1)){var t=+e,o=Math.sign(t);return r=isNumberic(r,!0)?r:2,(new Decimal).round(Math.abs(t),r)*o}},guid=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:8,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"abcdefghijklmnopqrstuvwxyz0123456789",t=r.split("");return t.length||(t="abcdefghijklmnopqrstuvwxyz0123456789".split("")),_toConsumableArray(Array(e)).map((function(e){return t[Math.random()*t.length|0]})).join("")},hash=function(){return(16777215*Math.random()<<7).toString(16)},numberFormat=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,t=arguments.length>2?arguments[2]:void 0,o=numberic(e,r);if(void 0!==o)return(t=isNumberic(t,!0)?t:r)>0?o.toFixed(t):e},moneyFormat=function(e){var r,t,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,n=arguments.length>2?arguments[2]:void 0,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";return isNumberic(e)?(n=isNumberic(n,!0)?n:o,null!==(r=null===(t=numberic(e,o))||void 0===t?void 0:t.toLocaleString(void 0,{minimumFractionDigits:n,maximumFractionDigits:n}))&&void 0!==r?r:a):a},signFormat=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return isNumberic(e)?"".concat(e>0?"+":e<0?"-":"").concat(Math.abs(e)):r},sleep=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:16;return new Promise((function(r){return setTimeout(r,e)}))},settable=function(e){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return typeis(e)===exports.Types.set&&(!r||e.size>0)},PromiseStatus;!function(e){e.pending="pending",e.fulfilled="fulfilled",e.rejected="rejected"}(PromiseStatus||(PromiseStatus={}));var PromisePolyfill=function(){function e(r){var t=this;_classCallCheck(this,e),_defineProperty(this,"status",void 0),_defineProperty(this,"value",void 0),_defineProperty(this,"reason",void 0),_defineProperty(this,"onResolvedClosures",void 0),_defineProperty(this,"onRejectedClosures",void 0),this.status=PromiseStatus.pending,this.value=void 0,this.reason=void 0,this.onResolvedClosures=[],this.onRejectedClosures=[];var o=function(e){t.status===PromiseStatus.pending&&(t.status=PromiseStatus.rejected,t.reason=e,t.onRejectedClosures.forEach((function(e){return e()})))};try{r((function(e){t.status===PromiseStatus.pending&&(t.status=PromiseStatus.fulfilled,t.value=e,t.onResolvedClosures.forEach((function(e){return e()})))}),o)}catch(e){o(e)}}return _createClass(e,[{key:"then",value:function(r,t){var o=this;r="function"==typeof r?r:function(e){return e},t="function"==typeof t?t:function(e){throw e};var n=new e((function(e,a){o.status===PromiseStatus.fulfilled&µ((function(){try{var t,i=null===(t=r)||void 0===t?void 0:t(o.value);resolvePromise(n,i,e,a)}catch(e){a(e)}})),o.status===PromiseStatus.rejected&µ((function(){try{var r,i=null===(r=t)||void 0===r?void 0:r(o.reason);resolvePromise(n,i,e,a)}catch(e){a(e)}})),o.status===PromiseStatus.pending&&(o.onResolvedClosures.push((function(){micro((function(){try{var t,i=null===(t=r)||void 0===t?void 0:t(o.value);resolvePromise(n,i,e,a)}catch(e){a(e)}}))})),o.onRejectedClosures.push((function(){micro((function(){try{var r,i=null===(r=t)||void 0===r?void 0:r(o.reason);resolvePromise(n,i,e,a)}catch(e){a(e)}}))})))}));return n}},{key:"catch",value:function(e){return this.then(void 0,e)}}]),e}();function micro(e){return"undefined"!=typeof window?window.queueMicrotask(e):process.nextTick(e)}function resolvePromise(e,r,t,o){if(r===e)return o(new TypeError("Chaining cycle detected for promise"));var n=!1;if(null===r||"object"!==_typeof(r)&&"function"!=typeof r)t(r);else try{var a=r.then;"function"==typeof a?a.call(r,(function(r){n||(n=!0,resolvePromise(e,r,t,o))}),(function(e){n||(n=!0,o(e))})):t(r)}catch(e){if(n)return;n=!0,o(e)}}_defineProperty(PromisePolyfill,"resolve",void 0),_defineProperty(PromisePolyfill,"reject",void 0),_defineProperty(PromisePolyfill,"race",void 0),_defineProperty(PromisePolyfill,"all",void 0),_defineProperty(PromisePolyfill,"deferred",void 0),PromisePolyfill.resolve=function(e){return new PromisePolyfill((function(r,t){return r(e)}))},PromisePolyfill.reject=function(e){return new PromisePolyfill((function(r,t){return t(e)}))},PromisePolyfill.race=function(e){return new PromisePolyfill((function(r,t){for(var o=0;o2&&void 0!==arguments[2]&&arguments[2];if(typeis(e)!==exports.Types.function&&typeis(e)!==exports.Types.asyncFunction)throw new TypeError("Expected a function");if(!isNumberic(r,!0))throw new TypeError("Expected a numberic time");var a=function(){for(var a=arguments.length,i=new Array(a),s=0;ss?(a&&(clearTimeout(a),a=null),p=l,e.apply(y,o)):a||!1===(null==t?void 0:t.trailing)||(a=setTimeout((function(){p=!1===(null==t?void 0:t.leading)?0:(new Date).getTime(),a=null,e.apply(y,o)}),u)),i};return y.cancel=function(){a&&clearTimeout(a),p=0,a=null},y},_TypedCopyMap,TypedArrayMap={"[object Float32Array]":Float32Array,"[object Float64Array]":Float64Array,"[object Int8Array]":Int8Array,"[object Int16Array]":Int16Array,"[object Int32Array]":Int32Array,"[object Uint8Array]":Uint8Array,"[object Uint16Array]":Uint16Array,"[object Uint32Array]":Uint32Array,"[object Uint8ClampedArray]":Uint8ClampedArray},TypedCopyMap=(_TypedCopyMap={},_defineProperty(_TypedCopyMap,exports.Types.date,copyDate),_defineProperty(_TypedCopyMap,exports.Types.arrayBuffer,copyArrayBuffer),_defineProperty(_TypedCopyMap,exports.Types.dataView,copyDataView),_defineProperty(_TypedCopyMap,exports.Types.float32Array,copyTypedArray),_defineProperty(_TypedCopyMap,exports.Types.float64Array,copyTypedArray),_defineProperty(_TypedCopyMap,exports.Types.int8Array,copyTypedArray),_defineProperty(_TypedCopyMap,exports.Types.int16Array,copyTypedArray),_defineProperty(_TypedCopyMap,exports.Types.int32Array,copyTypedArray),_defineProperty(_TypedCopyMap,exports.Types.uint8Array,copyTypedArray),_defineProperty(_TypedCopyMap,exports.Types.uint8ClampedArray,copyTypedArray),_defineProperty(_TypedCopyMap,exports.Types.uint16Array,copyTypedArray),_defineProperty(_TypedCopyMap,exports.Types.uint32Array,copyTypedArray),_defineProperty(_TypedCopyMap,exports.Types.bigInt64Array,copyTypedArray),_defineProperty(_TypedCopyMap,exports.Types.bigUint64Array,copyTypedArray),_defineProperty(_TypedCopyMap,exports.Types.regExp,copyRegExp),_TypedCopyMap),copy=function(e){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],t=function e(r){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new Map,n=r;if(isNull(n))return n;if(TypedCopyMap[typeis(n)])return TypedCopyMap[typeis(n)](r);if(o.get(n))return o.get(n);if(arrayable(r,!1)){var a=Array.prototype.constructor();return o.set(n,a),r.map((function(e){return a.push(e)})),t?a.map((function(r){return e(r,t,o)})):a}if(objectable(r,!1)){var i=Object.prototype.constructor();for(var s in o.set(n,i),r)Object.prototype.hasOwnProperty.call(r,s)&&(i[s]=r[s]);if(!t)return i;for(var p in i)Object.prototype.hasOwnProperty.call(i,p)&&(i[p]=e(i[p],t,o));return i}return r};return t.call(null,e,r)};function copyArrayBuffer(e){var r=new ArrayBuffer(e.byteLength);return new Uint8Array(r).set(new Uint8Array(e)),r}function copyDataView(e){var r=copyArrayBuffer(e.buffer);return new DataView(r,e.byteOffset,e.byteLength)}function copyDate(e){return new Date(e.getTime())}function copyRegExp(e){var r=new RegExp(e.source,e.flags);return r.lastIndex=e.lastIndex,r}function copyTypedArray(e){try{TypedArrayMap["[object BigInt64Array]"]=BigInt64Array,TypedArrayMap["[object BigUint64Array]"]=BigUint64Array}catch(e){}var r=copyArrayBuffer(e.buffer);return new(TypedArrayMap[Object.prototype.toString.call(e)])(r,e.byteOffset,e.length)}var sort=function(e,r){var t=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"zh-Hans-CN",n=null!=e?e:"",a=null!=r?r:"",i=/^[a-zA-Z0-9]$/;return isNumberic(e)&&isNumberic(r)?Number(e)>Number(r)?1:Number(e)a?1:ne.length)&&(r=e.length);for(var t=0,o=new Array(r);t=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,s=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return i=e.done,e},e:function(e){s=!0,a=e},f:function(){try{i||null==t.return||t.return()}finally{if(s)throw a}}}}var stringable=function(e){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return typeis(e)===exports.Types.string&&(!r||e.length>0)},strLen=function(e){var r=0;if(!stringable(e))return r;for(var t=0,o=e.length;t2&&void 0!==arguments[2])||arguments[2];if(isNil(e))return!1;if(!re(kRegStartStrictNumberic,e)||re(kRegEndStrictNumberic,e))return!1;var o=+e;return!isNaN(o)&&(t?typeis(r)===exports.Types.bool?re(r?kRegSignNumberic:kRegUnSignNumberic,o):re(kRegNumberic,o):typeis(o)===exports.Types.number)},objectable=function(e){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(typeis(e)!==exports.Types.object)return!1;var t=Object.getPrototypeOf(e);if(!t)return!r||Object.keys(e).length>0;if(t.constructor===Object)return!r||Object.keys(e).length>0;var o=Object.prototype.hasOwnProperty.call(t,"constructor")&&t.constructor;return"function"==typeof o&&Object.prototype.hasOwnProperty.toString.call(o)===Object.prototype.hasOwnProperty.toString.call(Object)&&(!r||Object.keys(e).length>0)},optional=function optional(path,obj){var separator=arguments.length>2&&void 0!==arguments[2]?arguments[2]:".",rs=void 0,properties;if(!stringable(path)||!stringable(separator))return rs;var p=path,o;if(properties=-1===p.indexOf(separator)?Array.of(p):p.split(separator),isNil(obj)){try{o=isNumberic(properties[0])?eval("this[".concat(properties[0],"]")):eval("this."+properties[0])}catch(e){o=Object.prototype.constructor()}if(properties.shift(),typeis(o)===exports.Types.object);else if(typeis(o)!==exports.Types.array)return rs}else o=obj;return rs=properties.reduce((function(e,r){return objectable(e)?e[r]:arrayable(e)?isNumberic(r)?e[+r]:e[r]:e?e[r]:void 0}),o),rs},extractable=function extractable(){for(var rs=Object.prototype.constructor(),_len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++)args[_key]=arguments[_key];if(!arrayable(args)||args.length<2)return rs;var t=Array.prototype.slice.call(args,-1)[0];if(typeis(t)===exports.Types.string)try{t=eval("this."+t)}catch(e){t=void 0}if(!objectable(t))return rs;var o=Array.prototype.slice.apply(args,[0,-1]),_iterator=_createForOfIteratorHelper(o),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var i=_step.value;typeis(i)===exports.Types.string?rs[i]=optional(i,t)||String.prototype.constructor():typeis(i)===exports.Types.array?2===i.length?rs[i[0]]=(typeis(i[1])===exports.Types.string?optional(i[1],t):i[1])||String.prototype.constructor():3===i.length&&(rs[i[0]]=objectable(i[2])||arrayable(i[2])?optional(i[1],i[2]):String.prototype.constructor()):typeis(i)===exports.Types.object&&(rs=Object.assign(rs,i))}}catch(e){_iterator.e(e)}finally{_iterator.f()}return rs},assign=function e(r,t,o){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:".";typeis(t)!==exports.Types.object&&typeis(t)!==exports.Types.array&&typeis(t)!==exports.Types.unknown||(stringable(r)||arrayable(r))&&(stringable(r)&&(r=r.split(n)),r.length>1?e(r,t[r.shift()],o):t[r[0]]=o)},objReverse=function(e){if(!objectable(e))return e;var r=e,t=Object.keys(r).reduce((function(e,t){var o=String(r[t]),n=[];return arrayable(e[o],!1)&&(n=e[o]),Object.assign(e,_defineProperty({},o,n.concat(t)))}),{});for(var o in t)t.hasOwnProperty(o)&&(t[o]=Array.isArray(t[o])&&1===t[o].length?t[o][0]:t[o]);return t},TypesDesc,Types;exports.TypesDesc=void 0,TypesDesc=exports.TypesDesc||(exports.TypesDesc={}),TypesDesc["[object Number]"]="number",TypesDesc["[object String]"]="string",TypesDesc["[object Boolean]"]="bool",TypesDesc["[object Undefined]"]="undefined",TypesDesc["[object Null]"]="null",TypesDesc["[object Array]"]="array",TypesDesc["[object Uint8Array]"]="uint8Array",TypesDesc["[object Object]"]="object",TypesDesc["[object Function]"]="function",TypesDesc["[object AsyncFunction]"]="asyncFunction",TypesDesc["[object BigInt]"]="bigInt",TypesDesc["[object Date]"]="date",TypesDesc["[object WeakMap]"]="weakMap",TypesDesc["[object Map]"]="map",TypesDesc["[object WeakSet]"]="weakSet",TypesDesc["[object ArrayBuffer]"]="arrayBuffer",TypesDesc["[object Set]"]="set",TypesDesc["[object Symbol]"]="symbol",TypesDesc["[object DataView]"]="dataView",TypesDesc["[object Float32Array]"]="float32Array",TypesDesc["[object Float64Array]"]="float64Array",TypesDesc["[object Int8Array]"]="int8Array",TypesDesc["[object Int16Array]"]="int16Array",TypesDesc["[object Int32Array]"]="int32Array",TypesDesc["[object Uint8ClampedArray]"]="uint8ClampedArray",TypesDesc["[object Uint16Array]"]="uint16Array",TypesDesc["[object Uint32Array]"]="uint32Array",TypesDesc["[object BigInt64Array]"]="bigInt64Array",TypesDesc["[object BigUint64Array]"]="bigUint64Array",TypesDesc["[object RegExp]"]="regExp",exports.Types=void 0,Types=exports.Types||(exports.Types={}),Types.number="number",Types.string="string",Types.bool="bool",Types[void 0]="undefined",Types.null="null",Types.bigInt="bigInt",Types.object="object",Types.function="function",Types.asyncFunction="asyncFunction",Types.symbol="symbol",Types.arrayBuffer="arrayBuffer",Types.regExp="regExp",Types.date="date",Types.dataView="dataView",Types.weakMap="weakMap",Types.map="map",Types.weakSet="weakSet",Types.set="set",Types.array="array",Types.uint8Array="uint8Array",Types.float32Array="float32Array",Types.float64Array="float64Array",Types.int8Array="int8Array",Types.int16Array="int16Array",Types.int32Array="int32Array",Types.uint8ClampedArray="uint8ClampedArray",Types.uint16Array="uint16Array",Types.uint32Array="uint32Array",Types.bigInt64Array="bigInt64Array",Types.bigUint64Array="bigUint64Array",Types.unknown="";var inEnum=function(e,r){return!(!objectable(e)||e!==Object(e))&&(Object.prototype.hasOwnProperty.call(e,r)||Object.values(e).indexOf(r)>-1)},typeis=function(e){var r=Object.prototype.toString.call(e);if("[object Object]"===r){var t=Object.getPrototypeOf(e);if(t&&t.constructor!==Object)return exports.Types.unknown}var o=exports.Types.unknown;return Object.keys(exports.TypesDesc).includes(r)&&(o=exports.Types[exports.TypesDesc[r]]),o},re=function(e,r){return e.test(r.toString())},arrayable=function(e){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return(typeis(e)===exports.Types.array||typeis(e)===exports.Types.uint8Array)&&(!r||e.length>0)},arrayUnique=function(e){var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!arrayable(e))return e;if(r){var t=e.map((function(e){return JSON.stringify(e)}));return Array.from(new Set(t)).map((function(e){return JSON.parse(e)}))}return Array.from(new Set(e))},arrValsCount=function(e){var r={};return arrayable(e)?e.reduce((function(e,r){var t=r+"";return e[t]?e[t]++:e[t]=1,e}),r):r},arrValCount=function(e,r){if(!arrayable(e)||!e.includes(r))return 0;var t=arrValsCount(e),o=r+"";return t.hasOwnProperty(o)?t[o]:0},flat=function e(r){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1/0,o=Array.prototype.constructor();if(!arrayable(r,!1))return r;var n=isNaN(t)?1:Number(t);if(!n)return Array.prototype.slice.call(r);for(var a=0,i=r.length>>>0;a>8-a%1*8)){if((n=r.charCodeAt(a+=3/4))>255)throw new InvalidCharacterError("'btoa' failed: The string to be encoded contains characters outside of the Latin1 range.");o=o<<8|n}return t},exports._atob=void 0,"undefined"!=typeof window&&window.atob?exports._atob=window.atob:exports._atob=function(e){var r=String(e).replace(/[=]+$/,"");if(r.length%4==1)throw new InvalidCharacterError("'atob' failed: The string to be decoded is not correctly encoded.");for(var t,o="",n=0,a=0,i=0;t=r.charAt(i++);~t&&(a=n%4?64*a+t:t,n++%4)?o+=String.fromCharCode(255&a>>(-2*n&6)):0)t=chars.indexOf(t);return o};var url2Blob=function(e){if("undefined"==typeof window)throw new Error("url2Blob only works in browser environment");if(!stringable(e))throw new TypeError(e+" can not be null");var r=e.split(",");if(!arrayable(r))throw new ReferenceError("invalid data url");var t=r[0].match(/:(.*?);/);if(!arrayable(t)||t.length<2)throw new ReferenceError("invalid data format");for(var o=t,n=exports._atob(r[1]),a=n.length,i=new Uint8Array(a);a--;)i[a]=n.charCodeAt(a);return new Blob([i],{type:o[1]})},str2Buffer=function(e){if(stringable(e))return e=exports._btoa(unescape(encodeURIComponent(e))),new Uint8Array(Array.prototype.map.call(e,(function(e){return e.charCodeAt(0)})))},buffer2Str=function(e){if(arrayable(e)||objectable(e)||stringable(e)){typeis(e)===exports.Types.string&&(e=JSON.parse.call(null,e));var r=Object.values(e);if(arrayable(r))return decodeURIComponent(escape(exports._atob(String.fromCharCode.apply(null,Array.prototype.map.call(new Uint8Array(r),(function(e){return e}))))))}},formatNumber=function(e){return(e=e.toString())[1]?e:"0"+e},dateable=function(e){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return typeis(e)===exports.Types.date&&(!r||"Invalid Date"!==e.toString())},formatDate=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"yyyy-MM-dd hh:mm:ss",t=String.prototype.constructor();if(typeis(e)!==exports.Types.date&&!stringable(e))return t;if(typeis(e)===exports.Types.string&&(e=new Date(e)),"Invalid Date"===e.toString())return t;for(var o=e,n={Y:o.getFullYear(),M:o.getMonth()+1,D:o.getDate(),h:o.getHours(),m:o.getMinutes(),s:o.getSeconds()},a=0,i=Object.keys(n).length>>>0;a0&&void 0!==arguments[0]?arguments[0]:0,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,i=arguments.length>6?arguments[6]:void 0;if([e,r,t,o,n,a].every((function(e){return typeis(e)===exports.Types.number&&e>=0}))){var s=new Date(Date.UTC(e,r-1,t,o,n,a)),p=new Date(s.toLocaleString("en-US",{timeZone:"UTC"})),y=s;if(stringable(i))y=new Date(s.toLocaleString("en-US",{timeZone:i}));else if("Invalid Date"===(y=new Date("".concat(r,"/").concat(t,"/").concat(e," ").concat(o,":").concat(n,":").concat(a))).toString())return;var l=p.getTime()-y.getTime();return s.setTime(s.getTime()+l),s}},quarterable=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"Q",o=Array(2).fill(String.prototype.constructor()),n=new RegExp("^\\d{4}".concat(t,"\\d$"),"g");if(stringable(e)&&n.test(e)){var a=e.split(t),i=_slicedToArray(a,2),s=i[0],p=i[1];if(isNumberic(s)&&isNumberic(p)){var y=+p+ +r,l=4*+s+y;return y%4==0?(o[0]=0===y?s-1:+s+y/4-1,o[1]=4):(o[1]=l%4,o[0]=(l-o[1])/4),o.join(t)}}},mappable=function(e){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return typeis(e)===exports.Types.map&&(!r||e.size>0)},DecimalMathCalcType;!function(e){e.round="round",e.ceil="ceil",e.floor="floor",e.trunc="trunc"}(DecimalMathCalcType||(DecimalMathCalcType={}));var Decimal=function(){function e(){_classCallCheck(this,e),_defineProperty(this,"powers",void 0),void 0===Math.trunc&&(Math.trunc=function(e){return e<0?Math.ceil(e):Math.floor(e)}),this.powers=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13,1e14,1e15,1e16,1e17,1e18,1e19,1e20,1e21,1e22]}return _createClass(e,[{key:"intpow10",value:function(e){return e<0||e>22?Math.pow(10,e):this.powers[e]}},{key:"isRound",value:function(e,r){var t=this.intpow10(r);return Math.round(e*t)/t===e}},{key:"decimalAdjust",value:function(e,r,t){if("round"!==e&&this.isRound(r,t||0))return r;var o=this.intpow10(t||0),n=r*o*(1+Number.EPSILON);return Math[e](n)/o}},{key:"round",value:function(e,r){return this.decimalAdjust(DecimalMathCalcType.round,e,r)}},{key:"ceil",value:function(e,r){return this.decimalAdjust(DecimalMathCalcType.ceil,e,r)}},{key:"floor",value:function(e,r){return this.decimalAdjust(DecimalMathCalcType.floor,e,r)}},{key:"trunc",value:function(e,r){return this.decimalAdjust(DecimalMathCalcType.trunc,e,r)}},{key:"toFixed",value:function(e,r){return this.decimalAdjust(DecimalMathCalcType.round,e,r).toFixed(r)}}]),e}(),rangeRandom=function(e,r){return!isNumberic(e)||!isNumberic(r)||e>r?Math.random():Math.random()*(r-e)+e},numberic=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;if(isNumberic(e,void 0,!1)){var t=+e,o=Math.sign(t);return r=isNumberic(r,!0)?r:2,(new Decimal).round(Math.abs(t),r)*o}},guid=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:8,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"abcdefghijklmnopqrstuvwxyz0123456789",t=r.split("");return t.length||(t="abcdefghijklmnopqrstuvwxyz0123456789".split("")),_toConsumableArray(Array(e)).map((function(e){return t[Math.random()*t.length|0]})).join("")},hash=function(){return(16777215*Math.random()<<7).toString(16)},numberFormat=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,t=arguments.length>2?arguments[2]:void 0,o=numberic(e,r);if(void 0!==o)return(t=isNumberic(t,!0)?t:r)>0?o.toFixed(t):e},moneyFormat=function(e){var r,t,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,n=arguments.length>2?arguments[2]:void 0,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";return isNumberic(e)?(n=isNumberic(n,!0)?n:o,null!==(r=null===(t=numberic(e,o))||void 0===t?void 0:t.toLocaleString(void 0,{minimumFractionDigits:n,maximumFractionDigits:n}))&&void 0!==r?r:a):a},signFormat=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return isNumberic(e)?"".concat(e>0?"+":e<0?"-":"").concat(Math.abs(e)):r},sleep=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:16;return new Promise((function(r){return setTimeout(r,e)}))},settable=function(e){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return typeis(e)===exports.Types.set&&(!r||e.size>0)},PromiseStatus;!function(e){e.pending="pending",e.fulfilled="fulfilled",e.rejected="rejected"}(PromiseStatus||(PromiseStatus={}));var PromisePolyfill=function(){function e(r){var t=this;_classCallCheck(this,e),_defineProperty(this,"status",void 0),_defineProperty(this,"value",void 0),_defineProperty(this,"reason",void 0),_defineProperty(this,"onResolvedClosures",void 0),_defineProperty(this,"onRejectedClosures",void 0),this.status=PromiseStatus.pending,this.value=void 0,this.reason=void 0,this.onResolvedClosures=[],this.onRejectedClosures=[];var o=function(e){t.status===PromiseStatus.pending&&(t.status=PromiseStatus.rejected,t.reason=e,t.onRejectedClosures.forEach((function(e){return e()})))};try{r((function(e){t.status===PromiseStatus.pending&&(t.status=PromiseStatus.fulfilled,t.value=e,t.onResolvedClosures.forEach((function(e){return e()})))}),o)}catch(e){o(e)}}return _createClass(e,[{key:"then",value:function(r,t){var o=this;r="function"==typeof r?r:function(e){return e},t="function"==typeof t?t:function(e){throw e};var n=new e((function(e,a){o.status===PromiseStatus.fulfilled&µ((function(){try{var t,i=null===(t=r)||void 0===t?void 0:t(o.value);resolvePromise(n,i,e,a)}catch(e){a(e)}})),o.status===PromiseStatus.rejected&µ((function(){try{var r,i=null===(r=t)||void 0===r?void 0:r(o.reason);resolvePromise(n,i,e,a)}catch(e){a(e)}})),o.status===PromiseStatus.pending&&(o.onResolvedClosures.push((function(){micro((function(){try{var t,i=null===(t=r)||void 0===t?void 0:t(o.value);resolvePromise(n,i,e,a)}catch(e){a(e)}}))})),o.onRejectedClosures.push((function(){micro((function(){try{var r,i=null===(r=t)||void 0===r?void 0:r(o.reason);resolvePromise(n,i,e,a)}catch(e){a(e)}}))})))}));return n}},{key:"catch",value:function(e){return this.then(void 0,e)}}]),e}();function micro(e){return"undefined"!=typeof window?window.queueMicrotask(e):process.nextTick(e)}function resolvePromise(e,r,t,o){if(r===e)return o(new TypeError("Chaining cycle detected for promise"));var n=!1;if(null===r||"object"!==_typeof(r)&&"function"!=typeof r)t(r);else try{var a=r.then;"function"==typeof a?a.call(r,(function(r){n||(n=!0,resolvePromise(e,r,t,o))}),(function(e){n||(n=!0,o(e))})):t(r)}catch(e){if(n)return;n=!0,o(e)}}_defineProperty(PromisePolyfill,"resolve",void 0),_defineProperty(PromisePolyfill,"reject",void 0),_defineProperty(PromisePolyfill,"race",void 0),_defineProperty(PromisePolyfill,"all",void 0),_defineProperty(PromisePolyfill,"deferred",void 0),PromisePolyfill.resolve=function(e){return new PromisePolyfill((function(r,t){return r(e)}))},PromisePolyfill.reject=function(e){return new PromisePolyfill((function(r,t){return t(e)}))},PromisePolyfill.race=function(e){return new PromisePolyfill((function(r,t){for(var o=0;o2&&void 0!==arguments[2]&&arguments[2];if(typeis(e)!==exports.Types.function&&typeis(e)!==exports.Types.asyncFunction)throw new TypeError("Expected a function");if(!isNumberic(r,!0))throw new TypeError("Expected a numberic time");var a=function(){for(var a=arguments.length,i=new Array(a),s=0;ss?(a&&(clearTimeout(a),a=null),p=l,e.apply(y,o)):a||!1===(null==t?void 0:t.trailing)||(a=setTimeout((function(){p=!1===(null==t?void 0:t.leading)?0:(new Date).getTime(),a=null,e.apply(y,o)}),u)),i};return y.cancel=function(){a&&clearTimeout(a),p=0,a=null},y},_TypedCopyMap,TypedArrayMap={"[object Float32Array]":Float32Array,"[object Float64Array]":Float64Array,"[object Int8Array]":Int8Array,"[object Int16Array]":Int16Array,"[object Int32Array]":Int32Array,"[object Uint8Array]":Uint8Array,"[object Uint16Array]":Uint16Array,"[object Uint32Array]":Uint32Array,"[object Uint8ClampedArray]":Uint8ClampedArray},TypedCopyMap=(_TypedCopyMap={},_defineProperty(_TypedCopyMap,exports.Types.date,copyDate),_defineProperty(_TypedCopyMap,exports.Types.arrayBuffer,copyArrayBuffer),_defineProperty(_TypedCopyMap,exports.Types.dataView,copyDataView),_defineProperty(_TypedCopyMap,exports.Types.float32Array,copyTypedArray),_defineProperty(_TypedCopyMap,exports.Types.float64Array,copyTypedArray),_defineProperty(_TypedCopyMap,exports.Types.int8Array,copyTypedArray),_defineProperty(_TypedCopyMap,exports.Types.int16Array,copyTypedArray),_defineProperty(_TypedCopyMap,exports.Types.int32Array,copyTypedArray),_defineProperty(_TypedCopyMap,exports.Types.uint8Array,copyTypedArray),_defineProperty(_TypedCopyMap,exports.Types.uint8ClampedArray,copyTypedArray),_defineProperty(_TypedCopyMap,exports.Types.uint16Array,copyTypedArray),_defineProperty(_TypedCopyMap,exports.Types.uint32Array,copyTypedArray),_defineProperty(_TypedCopyMap,exports.Types.bigInt64Array,copyTypedArray),_defineProperty(_TypedCopyMap,exports.Types.bigUint64Array,copyTypedArray),_defineProperty(_TypedCopyMap,exports.Types.regExp,copyRegExp),_TypedCopyMap),copy=function(e){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],t=function e(r){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new Map,n=r;if(isNull(n))return n;if(TypedCopyMap[typeis(n)])return TypedCopyMap[typeis(n)](r);if(o.get(n))return o.get(n);if(arrayable(r,!1)){var a=Array.prototype.constructor();return o.set(n,a),r.map((function(e){return a.push(e)})),t?a.map((function(r){return e(r,t,o)})):a}if(objectable(r,!1)){var i=Object.prototype.constructor();for(var s in o.set(n,i),r)Object.prototype.hasOwnProperty.call(r,s)&&(i[s]=r[s]);if(!t)return i;for(var p in i)Object.prototype.hasOwnProperty.call(i,p)&&(i[p]=e(i[p],t,o));return i}return r};return t.call(null,e,r)};function copyArrayBuffer(e){var r=new ArrayBuffer(e.byteLength);return new Uint8Array(r).set(new Uint8Array(e)),r}function copyDataView(e){var r=copyArrayBuffer(e.buffer);return new DataView(r,e.byteOffset,e.byteLength)}function copyDate(e){return new Date(e.getTime())}function copyRegExp(e){var r=new RegExp(e.source,e.flags);return r.lastIndex=e.lastIndex,r}function copyTypedArray(e){try{TypedArrayMap["[object BigInt64Array]"]=BigInt64Array,TypedArrayMap["[object BigUint64Array]"]=BigUint64Array}catch(e){}var r=copyArrayBuffer(e.buffer);return new(TypedArrayMap[Object.prototype.toString.call(e)])(r,e.byteOffset,e.length)}var sort=function(e,r){var t=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"zh-Hans-CN",n=null!=e?e:"",a=null!=r?r:"",i=/[a-zA-Z0-9]/;return isNumberic(e)&&isNumberic(r)?Number(e)>Number(r)?1:Number(e)a?1:ne.length)&&(r=e.length);for(var t=0,o=new Array(r);t=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,s=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return i=e.done,e},e:function(e){s=!0,a=e},f:function(){try{i||null==t.return||t.return()}finally{if(s)throw a}}}}var stringable=function(e){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return typeis(e)===exports.Types.string&&(!r||e.length>0)},strLen=function(e){var r=0;if(!stringable(e))return r;for(var t=0,o=e.length;t2&&void 0!==arguments[2])||arguments[2];if(isNil(e))return!1;if(!re(kRegStartStrictNumberic,e)||re(kRegEndStrictNumberic,e))return!1;var o=+e;return!isNaN(o)&&(t?typeis(r)===exports.Types.bool?re(r?kRegSignNumberic:kRegUnSignNumberic,o):re(kRegNumberic,o):typeis(o)===exports.Types.number)},objectable=function(e){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(typeis(e)!==exports.Types.object)return!1;var t=Object.getPrototypeOf(e);if(!t)return!r||Object.keys(e).length>0;if(t.constructor===Object)return!r||Object.keys(e).length>0;var o=Object.prototype.hasOwnProperty.call(t,"constructor")&&t.constructor;return"function"==typeof o&&Object.prototype.hasOwnProperty.toString.call(o)===Object.prototype.hasOwnProperty.toString.call(Object)&&(!r||Object.keys(e).length>0)},optional=function optional(path,obj){var separator=arguments.length>2&&void 0!==arguments[2]?arguments[2]:".",rs=void 0,properties;if(!stringable(path)||!stringable(separator))return rs;var p=path,o;if(properties=-1===p.indexOf(separator)?Array.of(p):p.split(separator),isNil(obj)){try{o=isNumberic(properties[0])?eval("this[".concat(properties[0],"]")):eval("this."+properties[0])}catch(e){o=Object.prototype.constructor()}if(properties.shift(),typeis(o)===exports.Types.object);else if(typeis(o)!==exports.Types.array)return rs}else o=obj;return rs=properties.reduce((function(e,r){return objectable(e)?e[r]:arrayable(e)?isNumberic(r)?e[+r]:e[r]:e?e[r]:void 0}),o),rs},extractable=function extractable(){for(var rs=Object.prototype.constructor(),_len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++)args[_key]=arguments[_key];if(!arrayable(args)||args.length<2)return rs;var t=Array.prototype.slice.call(args,-1)[0];if(typeis(t)===exports.Types.string)try{t=eval("this."+t)}catch(e){t=void 0}if(!objectable(t))return rs;var o=Array.prototype.slice.apply(args,[0,-1]),_iterator=_createForOfIteratorHelper(o),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var i=_step.value;typeis(i)===exports.Types.string?rs[i]=optional(i,t)||String.prototype.constructor():typeis(i)===exports.Types.array?2===i.length?rs[i[0]]=(typeis(i[1])===exports.Types.string?optional(i[1],t):i[1])||String.prototype.constructor():3===i.length&&(rs[i[0]]=objectable(i[2])||arrayable(i[2])?optional(i[1],i[2]):String.prototype.constructor()):typeis(i)===exports.Types.object&&(rs=Object.assign(rs,i))}}catch(e){_iterator.e(e)}finally{_iterator.f()}return rs},assign=function e(r,t,o){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:".";typeis(t)!==exports.Types.object&&typeis(t)!==exports.Types.array&&typeis(t)!==exports.Types.unknown||(stringable(r)||arrayable(r))&&(stringable(r)&&(r=r.split(n)),r.length>1?e(r,t[r.shift()],o):t[r[0]]=o)},objReverse=function(e){if(!objectable(e))return e;var r=e,t=Object.keys(r).reduce((function(e,t){var o=String(r[t]),n=[];return arrayable(e[o],!1)&&(n=e[o]),Object.assign(e,_defineProperty({},o,n.concat(t)))}),{});for(var o in t)t.hasOwnProperty(o)&&(t[o]=Array.isArray(t[o])&&1===t[o].length?t[o][0]:t[o]);return t},TypesDesc,Types;exports.TypesDesc=void 0,TypesDesc=exports.TypesDesc||(exports.TypesDesc={}),TypesDesc["[object Number]"]="number",TypesDesc["[object String]"]="string",TypesDesc["[object Boolean]"]="bool",TypesDesc["[object Undefined]"]="undefined",TypesDesc["[object Null]"]="null",TypesDesc["[object Array]"]="array",TypesDesc["[object Uint8Array]"]="uint8Array",TypesDesc["[object Object]"]="object",TypesDesc["[object Function]"]="function",TypesDesc["[object AsyncFunction]"]="asyncFunction",TypesDesc["[object BigInt]"]="bigInt",TypesDesc["[object Date]"]="date",TypesDesc["[object WeakMap]"]="weakMap",TypesDesc["[object Map]"]="map",TypesDesc["[object WeakSet]"]="weakSet",TypesDesc["[object ArrayBuffer]"]="arrayBuffer",TypesDesc["[object Set]"]="set",TypesDesc["[object Symbol]"]="symbol",TypesDesc["[object DataView]"]="dataView",TypesDesc["[object Float32Array]"]="float32Array",TypesDesc["[object Float64Array]"]="float64Array",TypesDesc["[object Int8Array]"]="int8Array",TypesDesc["[object Int16Array]"]="int16Array",TypesDesc["[object Int32Array]"]="int32Array",TypesDesc["[object Uint8ClampedArray]"]="uint8ClampedArray",TypesDesc["[object Uint16Array]"]="uint16Array",TypesDesc["[object Uint32Array]"]="uint32Array",TypesDesc["[object BigInt64Array]"]="bigInt64Array",TypesDesc["[object BigUint64Array]"]="bigUint64Array",TypesDesc["[object RegExp]"]="regExp",exports.Types=void 0,Types=exports.Types||(exports.Types={}),Types.number="number",Types.string="string",Types.bool="bool",Types[void 0]="undefined",Types.null="null",Types.bigInt="bigInt",Types.object="object",Types.function="function",Types.asyncFunction="asyncFunction",Types.symbol="symbol",Types.arrayBuffer="arrayBuffer",Types.regExp="regExp",Types.date="date",Types.dataView="dataView",Types.weakMap="weakMap",Types.map="map",Types.weakSet="weakSet",Types.set="set",Types.array="array",Types.uint8Array="uint8Array",Types.float32Array="float32Array",Types.float64Array="float64Array",Types.int8Array="int8Array",Types.int16Array="int16Array",Types.int32Array="int32Array",Types.uint8ClampedArray="uint8ClampedArray",Types.uint16Array="uint16Array",Types.uint32Array="uint32Array",Types.bigInt64Array="bigInt64Array",Types.bigUint64Array="bigUint64Array",Types.unknown="";var inEnum=function(e,r){return!(!objectable(e)||e!==Object(e))&&(Object.prototype.hasOwnProperty.call(e,r)||Object.values(e).indexOf(r)>-1)},typeis=function(e){var r=Object.prototype.toString.call(e);if("[object Object]"===r){var t=Object.getPrototypeOf(e);if(t&&t.constructor!==Object)return exports.Types.unknown}var o=exports.Types.unknown;return Object.keys(exports.TypesDesc).includes(r)&&(o=exports.Types[exports.TypesDesc[r]]),o},re=function(e,r){return e.test(r.toString())},arrayable=function(e){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return(typeis(e)===exports.Types.array||typeis(e)===exports.Types.uint8Array)&&(!r||e.length>0)},arrayUnique=function(e){var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!arrayable(e))return e;if(r){var t=e.map((function(e){return JSON.stringify(e)}));return Array.from(new Set(t)).map((function(e){return JSON.parse(e)}))}return Array.from(new Set(e))},arrValsCount=function(e){var r={};return arrayable(e)?e.reduce((function(e,r){var t=r+"";return e[t]?e[t]++:e[t]=1,e}),r):r},arrValCount=function(e,r){if(!arrayable(e)||!e.includes(r))return 0;var t=arrValsCount(e),o=r+"";return t.hasOwnProperty(o)?t[o]:0},flat=function e(r){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1/0,o=Array.prototype.constructor();if(!arrayable(r,!1))return r;var n=isNaN(t)?1:Number(t);if(!n)return Array.prototype.slice.call(r);for(var a=0,i=r.length>>>0;a>8-a%1*8)){if((n=r.charCodeAt(a+=3/4))>255)throw new InvalidCharacterError("'btoa' failed: The string to be encoded contains characters outside of the Latin1 range.");o=o<<8|n}return t},exports._atob=void 0,"undefined"!=typeof window&&window.atob?exports._atob=window.atob:exports._atob=function(e){var r=String(e).replace(/[=]+$/,"");if(r.length%4==1)throw new InvalidCharacterError("'atob' failed: The string to be decoded is not correctly encoded.");for(var t,o="",n=0,a=0,i=0;t=r.charAt(i++);~t&&(a=n%4?64*a+t:t,n++%4)?o+=String.fromCharCode(255&a>>(-2*n&6)):0)t=chars.indexOf(t);return o};var url2Blob=function(e){if("undefined"==typeof window)throw new Error("url2Blob only works in browser environment");if(!stringable(e))throw new TypeError(e+" can not be null");var r=e.split(",");if(!arrayable(r))throw new ReferenceError("invalid data url");var t=r[0].match(/:(.*?);/);if(!arrayable(t)||t.length<2)throw new ReferenceError("invalid data format");for(var o=t,n=exports._atob(r[1]),a=n.length,i=new Uint8Array(a);a--;)i[a]=n.charCodeAt(a);return new Blob([i],{type:o[1]})},str2Buffer=function(e){if(stringable(e))return e=exports._btoa(unescape(encodeURIComponent(e))),new Uint8Array(Array.prototype.map.call(e,(function(e){return e.charCodeAt(0)})))},buffer2Str=function(e){if(arrayable(e)||objectable(e)||stringable(e)){typeis(e)===exports.Types.string&&(e=JSON.parse.call(null,e));var r=Object.values(e);if(arrayable(r))return decodeURIComponent(escape(exports._atob(String.fromCharCode.apply(null,Array.prototype.map.call(new Uint8Array(r),(function(e){return e}))))))}},formatNumber=function(e){return(e=e.toString())[1]?e:"0"+e},dateable=function(e){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return typeis(e)===exports.Types.date&&(!r||"Invalid Date"!==e.toString())},formatDate=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"yyyy-MM-dd hh:mm:ss",t=String.prototype.constructor();if(typeis(e)!==exports.Types.date&&!stringable(e))return t;if(typeis(e)===exports.Types.string&&(e=new Date(e)),"Invalid Date"===e.toString())return t;for(var o=e,n={Y:o.getFullYear(),M:o.getMonth()+1,D:o.getDate(),h:o.getHours(),m:o.getMinutes(),s:o.getSeconds()},a=0,i=Object.keys(n).length>>>0;a0&&void 0!==arguments[0]?arguments[0]:0,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,i=arguments.length>6?arguments[6]:void 0;if([e,r,t,o,n,a].every((function(e){return typeis(e)===exports.Types.number&&e>=0}))){var s=new Date(Date.UTC(e,r-1,t,o,n,a)),p=new Date(s.toLocaleString("en-US",{timeZone:"UTC"})),y=s;if(stringable(i))y=new Date(s.toLocaleString("en-US",{timeZone:i}));else if("Invalid Date"===(y=new Date("".concat(r,"/").concat(t,"/").concat(e," ").concat(o,":").concat(n,":").concat(a))).toString())return;var l=p.getTime()-y.getTime();return s.setTime(s.getTime()+l),s}},quarterable=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"Q",o=Array(2).fill(String.prototype.constructor()),n=new RegExp("^\\d{4}".concat(t,"\\d$"),"g");if(stringable(e)&&n.test(e)){var a=e.split(t),i=_slicedToArray(a,2),s=i[0],p=i[1];if(isNumberic(s)&&isNumberic(p)){var y=+p+ +r,l=4*+s+y;return y%4==0?(o[0]=0===y?s-1:+s+y/4-1,o[1]=4):(o[1]=l%4,o[0]=(l-o[1])/4),o.join(t)}}},mappable=function(e){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return typeis(e)===exports.Types.map&&(!r||e.size>0)},DecimalMathCalcType;!function(e){e.round="round",e.ceil="ceil",e.floor="floor",e.trunc="trunc"}(DecimalMathCalcType||(DecimalMathCalcType={}));var Decimal=function(){function e(){_classCallCheck(this,e),_defineProperty(this,"powers",void 0),void 0===Math.trunc&&(Math.trunc=function(e){return e<0?Math.ceil(e):Math.floor(e)}),this.powers=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13,1e14,1e15,1e16,1e17,1e18,1e19,1e20,1e21,1e22]}return _createClass(e,[{key:"intpow10",value:function(e){return e<0||e>22?Math.pow(10,e):this.powers[e]}},{key:"isRound",value:function(e,r){var t=this.intpow10(r);return Math.round(e*t)/t===e}},{key:"decimalAdjust",value:function(e,r,t){if("round"!==e&&this.isRound(r,t||0))return r;var o=this.intpow10(t||0),n=r*o*(1+Number.EPSILON);return Math[e](n)/o}},{key:"round",value:function(e,r){return this.decimalAdjust(DecimalMathCalcType.round,e,r)}},{key:"ceil",value:function(e,r){return this.decimalAdjust(DecimalMathCalcType.ceil,e,r)}},{key:"floor",value:function(e,r){return this.decimalAdjust(DecimalMathCalcType.floor,e,r)}},{key:"trunc",value:function(e,r){return this.decimalAdjust(DecimalMathCalcType.trunc,e,r)}},{key:"toFixed",value:function(e,r){return this.decimalAdjust(DecimalMathCalcType.round,e,r).toFixed(r)}}]),e}(),rangeRandom=function(e,r){return!isNumberic(e)||!isNumberic(r)||e>r?Math.random():Math.random()*(r-e)+e},numberic=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;if(isNumberic(e,void 0,!1)){var t=+e,o=Math.sign(t);return r=isNumberic(r,!0)?r:2,(new Decimal).round(Math.abs(t),r)*o}},guid=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:8,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"abcdefghijklmnopqrstuvwxyz0123456789",t=r.split("");return t.length||(t="abcdefghijklmnopqrstuvwxyz0123456789".split("")),_toConsumableArray(Array(e)).map((function(e){return t[Math.random()*t.length|0]})).join("")},hash=function(){return(16777215*Math.random()<<7).toString(16)},numberFormat=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,t=arguments.length>2?arguments[2]:void 0,o=numberic(e,r);if(void 0!==o)return(t=isNumberic(t,!0)?t:r)>0?o.toFixed(t):e},moneyFormat=function(e){var r,t,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,n=arguments.length>2?arguments[2]:void 0,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";return isNumberic(e)?(n=isNumberic(n,!0)?n:o,null!==(r=null===(t=numberic(e,o))||void 0===t?void 0:t.toLocaleString(void 0,{minimumFractionDigits:n,maximumFractionDigits:n}))&&void 0!==r?r:a):a},signFormat=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return isNumberic(e)?"".concat(e>0?"+":e<0?"-":"").concat(Math.abs(e)):r},sleep=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:16;return new Promise((function(r){return setTimeout(r,e)}))},settable=function(e){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return typeis(e)===exports.Types.set&&(!r||e.size>0)},PromiseStatus;!function(e){e.pending="pending",e.fulfilled="fulfilled",e.rejected="rejected"}(PromiseStatus||(PromiseStatus={}));var PromisePolyfill=function(){function e(r){var t=this;_classCallCheck(this,e),_defineProperty(this,"status",void 0),_defineProperty(this,"value",void 0),_defineProperty(this,"reason",void 0),_defineProperty(this,"onResolvedClosures",void 0),_defineProperty(this,"onRejectedClosures",void 0),this.status=PromiseStatus.pending,this.value=void 0,this.reason=void 0,this.onResolvedClosures=[],this.onRejectedClosures=[];var o=function(e){t.status===PromiseStatus.pending&&(t.status=PromiseStatus.rejected,t.reason=e,t.onRejectedClosures.forEach((function(e){return e()})))};try{r((function(e){t.status===PromiseStatus.pending&&(t.status=PromiseStatus.fulfilled,t.value=e,t.onResolvedClosures.forEach((function(e){return e()})))}),o)}catch(e){o(e)}}return _createClass(e,[{key:"then",value:function(r,t){var o=this;r="function"==typeof r?r:function(e){return e},t="function"==typeof t?t:function(e){throw e};var n=new e((function(e,a){o.status===PromiseStatus.fulfilled&µ((function(){try{var t,i=null===(t=r)||void 0===t?void 0:t(o.value);resolvePromise(n,i,e,a)}catch(e){a(e)}})),o.status===PromiseStatus.rejected&µ((function(){try{var r,i=null===(r=t)||void 0===r?void 0:r(o.reason);resolvePromise(n,i,e,a)}catch(e){a(e)}})),o.status===PromiseStatus.pending&&(o.onResolvedClosures.push((function(){micro((function(){try{var t,i=null===(t=r)||void 0===t?void 0:t(o.value);resolvePromise(n,i,e,a)}catch(e){a(e)}}))})),o.onRejectedClosures.push((function(){micro((function(){try{var r,i=null===(r=t)||void 0===r?void 0:r(o.reason);resolvePromise(n,i,e,a)}catch(e){a(e)}}))})))}));return n}},{key:"catch",value:function(e){return this.then(void 0,e)}}]),e}();function micro(e){return"undefined"!=typeof window?window.queueMicrotask(e):process.nextTick(e)}function resolvePromise(e,r,t,o){if(r===e)return o(new TypeError("Chaining cycle detected for promise"));var n=!1;if(null===r||"object"!==_typeof(r)&&"function"!=typeof r)t(r);else try{var a=r.then;"function"==typeof a?a.call(r,(function(r){n||(n=!0,resolvePromise(e,r,t,o))}),(function(e){n||(n=!0,o(e))})):t(r)}catch(e){if(n)return;n=!0,o(e)}}_defineProperty(PromisePolyfill,"resolve",void 0),_defineProperty(PromisePolyfill,"reject",void 0),_defineProperty(PromisePolyfill,"race",void 0),_defineProperty(PromisePolyfill,"all",void 0),_defineProperty(PromisePolyfill,"deferred",void 0),PromisePolyfill.resolve=function(e){return new PromisePolyfill((function(r,t){return r(e)}))},PromisePolyfill.reject=function(e){return new PromisePolyfill((function(r,t){return t(e)}))},PromisePolyfill.race=function(e){return new PromisePolyfill((function(r,t){for(var o=0;o2&&void 0!==arguments[2]&&arguments[2];if(typeis(e)!==exports.Types.function&&typeis(e)!==exports.Types.asyncFunction)throw new TypeError("Expected a function");if(!isNumberic(r,!0))throw new TypeError("Expected a numberic time");var a=function(){for(var a=arguments.length,i=new Array(a),s=0;ss?(a&&(clearTimeout(a),a=null),p=l,e.apply(y,o)):a||!1===(null==t?void 0:t.trailing)||(a=setTimeout((function(){p=!1===(null==t?void 0:t.leading)?0:(new Date).getTime(),a=null,e.apply(y,o)}),u)),i};return y.cancel=function(){a&&clearTimeout(a),p=0,a=null},y},_TypedCopyMap,TypedArrayMap={"[object Float32Array]":Float32Array,"[object Float64Array]":Float64Array,"[object Int8Array]":Int8Array,"[object Int16Array]":Int16Array,"[object Int32Array]":Int32Array,"[object Uint8Array]":Uint8Array,"[object Uint16Array]":Uint16Array,"[object Uint32Array]":Uint32Array,"[object Uint8ClampedArray]":Uint8ClampedArray},TypedCopyMap=(_TypedCopyMap={},_defineProperty(_TypedCopyMap,exports.Types.date,copyDate),_defineProperty(_TypedCopyMap,exports.Types.arrayBuffer,copyArrayBuffer),_defineProperty(_TypedCopyMap,exports.Types.dataView,copyDataView),_defineProperty(_TypedCopyMap,exports.Types.float32Array,copyTypedArray),_defineProperty(_TypedCopyMap,exports.Types.float64Array,copyTypedArray),_defineProperty(_TypedCopyMap,exports.Types.int8Array,copyTypedArray),_defineProperty(_TypedCopyMap,exports.Types.int16Array,copyTypedArray),_defineProperty(_TypedCopyMap,exports.Types.int32Array,copyTypedArray),_defineProperty(_TypedCopyMap,exports.Types.uint8Array,copyTypedArray),_defineProperty(_TypedCopyMap,exports.Types.uint8ClampedArray,copyTypedArray),_defineProperty(_TypedCopyMap,exports.Types.uint16Array,copyTypedArray),_defineProperty(_TypedCopyMap,exports.Types.uint32Array,copyTypedArray),_defineProperty(_TypedCopyMap,exports.Types.bigInt64Array,copyTypedArray),_defineProperty(_TypedCopyMap,exports.Types.bigUint64Array,copyTypedArray),_defineProperty(_TypedCopyMap,exports.Types.regExp,copyRegExp),_TypedCopyMap),copy=function(e){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],t=function e(r){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new Map,n=r;if(isNull(n))return n;if(TypedCopyMap[typeis(n)])return TypedCopyMap[typeis(n)](r);if(o.get(n))return o.get(n);if(arrayable(r,!1)){var a=Array.prototype.constructor();return o.set(n,a),r.map((function(e){return a.push(e)})),t?a.map((function(r){return e(r,t,o)})):a}if(objectable(r,!1)){var i=Object.prototype.constructor();for(var s in o.set(n,i),r)Object.prototype.hasOwnProperty.call(r,s)&&(i[s]=r[s]);if(!t)return i;for(var p in i)Object.prototype.hasOwnProperty.call(i,p)&&(i[p]=e(i[p],t,o));return i}return r};return t.call(null,e,r)};function copyArrayBuffer(e){var r=new ArrayBuffer(e.byteLength);return new Uint8Array(r).set(new Uint8Array(e)),r}function copyDataView(e){var r=copyArrayBuffer(e.buffer);return new DataView(r,e.byteOffset,e.byteLength)}function copyDate(e){return new Date(e.getTime())}function copyRegExp(e){var r=new RegExp(e.source,e.flags);return r.lastIndex=e.lastIndex,r}function copyTypedArray(e){try{TypedArrayMap["[object BigInt64Array]"]=BigInt64Array,TypedArrayMap["[object BigUint64Array]"]=BigUint64Array}catch(e){}var r=copyArrayBuffer(e.buffer);return new(TypedArrayMap[Object.prototype.toString.call(e)])(r,e.byteOffset,e.length)}var sort=function(e,r){var t=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"zh-Hans-CN",n=null!=e?e:"",a=null!=r?r:"",i=/^[a-zA-Z0-9]$/;return isNumberic(e)&&isNumberic(r)?Number(e)>Number(r)?1:Number(e)a?1:n boolean; -/** - * Retrieve unique elemens from an array - * @param array var to determine - * @param nested whether element in array is a nested object, default is false - */ -export declare const arrayUnique: (array: any, nested?: boolean) => T[]; -/** - * Retrieve elements exists count from an array - * @param array var to determine - */ -export declare const arrValsCount: (array: any) => NumberDict; -/** - * Count the number of occurrences of an element in the array - * @param array var to determine - * @param key clue for the count of var - */ -export declare const arrValCount: (array: any, key: T) => number; -/** - * Flatten an array recursively up to the specified depth. - * @param array - * @param depth depth of recurrence default is Infinity - */ -export declare const flat: (array: any, depth?: number) => OptionalPropertyArray; +import { NumberDict, OptionalPropertyArray } from '../typing/index'; +/** + * To determine a var is an array or not empty array + * @param array - var to determine + * @param length - length equals true ? not empty array : array, default is true + */ +export declare const arrayable: (array: any, length?: boolean) => boolean; +/** + * Retrieve unique elemens from an array + * @param array var to determine + * @param nested whether element in array is a nested object, default is false + */ +export declare const arrayUnique: (array: any, nested?: boolean) => T[]; +/** + * Retrieve elements exists count from an array + * @param array var to determine + */ +export declare const arrValsCount: (array: any) => NumberDict; +/** + * Count the number of occurrences of an element in the array + * @param array var to determine + * @param key clue for the count of var + */ +export declare const arrValCount: (array: any, key: T) => number; +/** + * Flatten an array recursively up to the specified depth. + * @param array + * @param depth depth of recurrence default is Infinity + */ +export declare const flat: (array: any, depth?: number) => OptionalPropertyArray; diff --git a/dist/types/lib/buffer/base64.d.ts b/dist/types/lib/buffer/base64.d.ts index ef2c0c5..11be500 100644 --- a/dist/types/lib/buffer/base64.d.ts +++ b/dist/types/lib/buffer/base64.d.ts @@ -1,12 +1,12 @@ -interface InvalidCharacterErrorInterface extends Error { - name: string; - message: string; -} -export declare class InvalidCharacterError implements InvalidCharacterErrorInterface { - name: string; - message: string; - constructor(message: string); -} -declare let _btoa: (data: string) => string; -declare let _atob: (data: string) => string; -export { _btoa, _atob }; +interface InvalidCharacterErrorInterface extends Error { + name: string; + message: string; +} +export declare class InvalidCharacterError implements InvalidCharacterErrorInterface { + name: string; + message: string; + constructor(message: string); +} +declare let _btoa: (data: string) => string; +declare let _atob: (data: string) => string; +export { _btoa, _atob }; diff --git a/dist/types/lib/buffer/index.d.ts b/dist/types/lib/buffer/index.d.ts index ab8b732..6d8bd9a 100644 --- a/dist/types/lib/buffer/index.d.ts +++ b/dist/types/lib/buffer/index.d.ts @@ -1,16 +1,16 @@ -import { Dict } from '../typing/index'; -/** - * Convert a string url to blob - * @param url - */ -export declare const url2Blob: (url: string) => Blob | never; -/** - * convert a string to buffer - * @param str argv string - */ -export declare const str2Buffer: (str: string) => Uint8Array | undefined; -/** - * convert a buffer to a string - * @param buff argv buffer - */ -export declare const buffer2Str: (buff: Uint8Array | Dict | string) => string | undefined; +import { Dict } from '../typing/index'; +/** + * Convert a string url to blob + * @param url + */ +export declare const url2Blob: (url: string) => Blob | never; +/** + * convert a string to buffer + * @param str argv string + */ +export declare const str2Buffer: (str: string) => Uint8Array | undefined; +/** + * convert a buffer to a string + * @param buff argv buffer + */ +export declare const buffer2Str: (buff: Uint8Array | Dict | string) => string | undefined; diff --git a/dist/types/lib/common/index.d.ts b/dist/types/lib/common/index.d.ts index fce25a0..65a185c 100644 --- a/dist/types/lib/common/index.d.ts +++ b/dist/types/lib/common/index.d.ts @@ -1,12 +1,12 @@ -import { Types as T } from '../enum/index'; -/** - * Determine the type of a value - * @param v argv - */ -export declare const typeis: (v: any) => T[keyof T]; -/** - * Regexp test function - * @param regxp argv of regexp pattern - * @param val argv to test - */ -export declare const re: (regxp: RegExp, val: any) => boolean; +import { Types as T } from '../enum/index'; +/** + * Determine the type of a value + * @param v argv + */ +export declare const typeis: (v: any) => T[keyof T]; +/** + * Regexp test function + * @param regxp argv of regexp pattern + * @param val argv to test + */ +export declare const re: (regxp: RegExp, val: any) => boolean; diff --git a/dist/types/lib/date/index.d.ts b/dist/types/lib/date/index.d.ts index 554b009..a8ab186 100644 --- a/dist/types/lib/date/index.d.ts +++ b/dist/types/lib/date/index.d.ts @@ -1,31 +1,31 @@ -/** - * To determine a var is Date type - * @param date var to determine - * @param validDate validDate equals true ? not invalid Date : Date, default is true - */ -export declare const dateable: (date?: any, validDate?: boolean) => boolean; -/** - * Date format - * @param date argv of type Date/String - * @param format [Y, yyyy, M, MM, d, dd, h, hh, m, mm, s, ss] and [-/\s] separator supports, default is 'yyyy-MM-dd hh:mm:ss' - */ -export declare const formatDate: (date?: Date | string, format?: string) => string; -/** - * Retrieve a date with specify timezone - * @param year argv year, default is 0 - * @param month argv month, default is 0 - * @param day argv day, default is 0 - * @param hour argv hour, default is 0 - * @param minute argv minute, default is 0 - * @param second argv second, default is 0 - * @param timezone argv timezone like 'America/New_York' - */ -export declare const timezoneDate: (year?: number, month?: number, day?: number, hour?: number, minute?: number, second?: number, timezone?: string) => Date | undefined; -/** - * Retrieve a quarter string with another quarter and delta quarters which are used to calculate - * @param quarter given quarter, eg. '2021Q3' - * @param delta calculation quarter number, negative means backward, positive means forward. eg. 3, -1, 10, -7 - * @param separator separator for year and quarter, default is 'Q' - * @returns string | undefined - */ -export declare const quarterable: (quarter: any, delta?: number, separator?: string) => string | undefined; +/** + * To determine a var is Date type + * @param date var to determine + * @param validDate validDate equals true ? not invalid Date : Date, default is true + */ +export declare const dateable: (date?: any, validDate?: boolean) => boolean; +/** + * Date format + * @param date argv of type Date/String + * @param format [Y, yyyy, M, MM, d, dd, h, hh, m, mm, s, ss] and [-/\s] separator supports, default is 'yyyy-MM-dd hh:mm:ss' + */ +export declare const formatDate: (date?: Date | string, format?: string) => string; +/** + * Retrieve a date with specify timezone + * @param year argv year, default is 0 + * @param month argv month, default is 0 + * @param day argv day, default is 0 + * @param hour argv hour, default is 0 + * @param minute argv minute, default is 0 + * @param second argv second, default is 0 + * @param timezone argv timezone like 'America/New_York' + */ +export declare const timezoneDate: (year?: number, month?: number, day?: number, hour?: number, minute?: number, second?: number, timezone?: string) => Date | undefined; +/** + * Retrieve a quarter string with another quarter and delta quarters which are used to calculate + * @param quarter given quarter, eg. '2021Q3' + * @param delta calculation quarter number, negative means backward, positive means forward. eg. 3, -1, 10, -7 + * @param separator separator for year and quarter, default is 'Q' + * @returns string | undefined + */ +export declare const quarterable: (quarter: any, delta?: number, separator?: string) => string | undefined; diff --git a/dist/types/lib/enum/index.d.ts b/dist/types/lib/enum/index.d.ts index 3aa2e52..e1fd391 100644 --- a/dist/types/lib/enum/index.d.ts +++ b/dist/types/lib/enum/index.d.ts @@ -1,85 +1,85 @@ -import { Dict } from '../typing/index'; -/** - * enum of type's descriptions - */ -export declare enum TypesDesc { - '[object Number]' = "number", - '[object String]' = "string", - '[object Boolean]' = "bool", - '[object Undefined]' = "undefined", - '[object Null]' = "null", - '[object Array]' = "array", - '[object Uint8Array]' = "uint8Array", - '[object Object]' = "object", - '[object Function]' = "function", - '[object AsyncFunction]' = "asyncFunction", - '[object BigInt]' = "bigInt", - '[object Date]' = "date", - '[object WeakMap]' = "weakMap", - '[object Map]' = "map", - '[object WeakSet]' = "weakSet", - '[object ArrayBuffer]' = "arrayBuffer", - '[object Set]' = "set", - '[object Symbol]' = "symbol", - '[object DataView]' = "dataView", - '[object Float32Array]' = "float32Array", - '[object Float64Array]' = "float64Array", - '[object Int8Array]' = "int8Array", - '[object Int16Array]' = "int16Array", - '[object Int32Array]' = "int32Array", - '[object Uint8ClampedArray]' = "uint8ClampedArray", - '[object Uint16Array]' = "uint16Array", - '[object Uint32Array]' = "uint32Array", - '[object BigInt64Array]' = "bigInt64Array", - '[object BigUint64Array]' = "bigUint64Array", - '[object RegExp]' = "regExp" -} -/** - * enum of Types - */ -export declare enum Types { - /** basic */ - number = "number", - string = "string", - bool = "bool", - undefined = "undefined", - null = "null", - bigInt = "bigInt", - /** complex */ - object = "object", - function = "function", - asyncFunction = "asyncFunction", - symbol = "symbol", - arrayBuffer = "arrayBuffer", - /** functional */ - regExp = "regExp", - date = "date", - dataView = "dataView", - /** map */ - weakMap = "weakMap", - map = "map", - /** set */ - weakSet = "weakSet", - set = "set", - /** array */ - array = "array", - uint8Array = "uint8Array", - float32Array = "float32Array", - float64Array = "float64Array", - int8Array = "int8Array", - int16Array = "int16Array", - int32Array = "int32Array", - uint8ClampedArray = "uint8ClampedArray", - uint16Array = "uint16Array", - uint32Array = "uint32Array", - bigInt64Array = "bigInt64Array", - bigUint64Array = "bigUint64Array", - /** unknown */ - unknown = "" -} -/** - * To determine whether a key in an Enum - * @param enums argv Enum - * @param i argv key - */ -export declare const inEnum: (enums?: Dict, i?: string | T) => boolean; +import { Dict } from '../typing/index'; +/** + * enum of type's descriptions + */ +export declare enum TypesDesc { + '[object Number]' = "number", + '[object String]' = "string", + '[object Boolean]' = "bool", + '[object Undefined]' = "undefined", + '[object Null]' = "null", + '[object Array]' = "array", + '[object Uint8Array]' = "uint8Array", + '[object Object]' = "object", + '[object Function]' = "function", + '[object AsyncFunction]' = "asyncFunction", + '[object BigInt]' = "bigInt", + '[object Date]' = "date", + '[object WeakMap]' = "weakMap", + '[object Map]' = "map", + '[object WeakSet]' = "weakSet", + '[object ArrayBuffer]' = "arrayBuffer", + '[object Set]' = "set", + '[object Symbol]' = "symbol", + '[object DataView]' = "dataView", + '[object Float32Array]' = "float32Array", + '[object Float64Array]' = "float64Array", + '[object Int8Array]' = "int8Array", + '[object Int16Array]' = "int16Array", + '[object Int32Array]' = "int32Array", + '[object Uint8ClampedArray]' = "uint8ClampedArray", + '[object Uint16Array]' = "uint16Array", + '[object Uint32Array]' = "uint32Array", + '[object BigInt64Array]' = "bigInt64Array", + '[object BigUint64Array]' = "bigUint64Array", + '[object RegExp]' = "regExp" +} +/** + * enum of Types + */ +export declare enum Types { + /** basic */ + number = "number", + string = "string", + bool = "bool", + undefined = "undefined", + null = "null", + bigInt = "bigInt", + /** complex */ + object = "object", + function = "function", + asyncFunction = "asyncFunction", + symbol = "symbol", + arrayBuffer = "arrayBuffer", + /** functional */ + regExp = "regExp", + date = "date", + dataView = "dataView", + /** map */ + weakMap = "weakMap", + map = "map", + /** set */ + weakSet = "weakSet", + set = "set", + /** array */ + array = "array", + uint8Array = "uint8Array", + float32Array = "float32Array", + float64Array = "float64Array", + int8Array = "int8Array", + int16Array = "int16Array", + int32Array = "int32Array", + uint8ClampedArray = "uint8ClampedArray", + uint16Array = "uint16Array", + uint32Array = "uint32Array", + bigInt64Array = "bigInt64Array", + bigUint64Array = "bigUint64Array", + /** unknown */ + unknown = "" +} +/** + * To determine whether a key in an Enum + * @param enums argv Enum + * @param i argv key + */ +export declare const inEnum: (enums?: Dict, i?: string | T) => boolean; diff --git a/dist/types/lib/eventloop/index.d.ts b/dist/types/lib/eventloop/index.d.ts index 8f96831..2166cb1 100644 --- a/dist/types/lib/eventloop/index.d.ts +++ b/dist/types/lib/eventloop/index.d.ts @@ -1,5 +1,5 @@ -/** - * sleep in eventloop for milliseconds - * @param ms argv(millisecond) to sleep, default is 16 - */ -export declare const sleep: (ms?: number) => Promise; +/** + * sleep in eventloop for milliseconds + * @param ms argv(millisecond) to sleep, default is 16 + */ +export declare const sleep: (ms?: number) => Promise; diff --git a/dist/types/lib/function/copy.d.ts b/dist/types/lib/function/copy.d.ts index cd9034f..d318c15 100644 --- a/dist/types/lib/function/copy.d.ts +++ b/dist/types/lib/function/copy.d.ts @@ -1,47 +1,47 @@ -/** - * type of builtIn Array - */ -declare type TypeArrayBuiltIn = Float32Array | Float64Array | Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | BigInt64Array | BigUint64Array; -/** - * Create a copy of a variable deeply or not - * @param obj param to copy or deep copy - * @param deep deep or not, default value is true - * @returns a copied or deep copied variable - */ -export declare const copy: (obj: any, deep?: boolean) => any; -/** - * Creates a copy of `arrayBuffer`. - * - * @param {ArrayBuffer} arrayBuffer The array buffer to copy. - * @returns {ArrayBuffer} Returns the copied array buffer. - */ -export declare function copyArrayBuffer(arrayBuffer: ArrayBuffer): ArrayBuffer; -/** - * Creates a copy of `dataView`. - * - * @param {Object} dataView The data view to copy. - * @returns {Object} Returns the copied data view. - */ -export declare function copyDataView(dataView: DataView): DataView; -/** - * Creates a copy of `date`. - * - * @param {Date} typedDate The date to copy. - * @returns {Object} Returns the copied date. - */ -export declare function copyDate(targetDate: Date): Date; -/** - * Creates a copy of `regexp`. - * - * @param {Object} targetRegexp The regexp to copy. - * @returns {Object} Returns the copied regexp. - */ -export declare function copyRegExp(targetRegexp: RegExp): RegExp; -/** - * Creates a copy of `typedArray`. - * - * @param {Object} typedArray The typed array to copy. - * @returns {Object} Returns the copied typed array. - */ -export declare function copyTypedArray(typedArray: TypeArrayBuiltIn): TypeArrayBuiltIn; -export {}; +/** + * type of builtIn Array + */ +declare type TypeArrayBuiltIn = Float32Array | Float64Array | Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | BigInt64Array | BigUint64Array; +/** + * Create a copy of a variable deeply or not + * @param obj param to copy or deep copy + * @param deep deep or not, default value is true + * @returns a copied or deep copied variable + */ +export declare const copy: (obj: any, deep?: boolean) => any; +/** + * Creates a copy of `arrayBuffer`. + * + * @param {ArrayBuffer} arrayBuffer The array buffer to copy. + * @returns {ArrayBuffer} Returns the copied array buffer. + */ +export declare function copyArrayBuffer(arrayBuffer: ArrayBuffer): ArrayBuffer; +/** + * Creates a copy of `dataView`. + * + * @param {Object} dataView The data view to copy. + * @returns {Object} Returns the copied data view. + */ +export declare function copyDataView(dataView: DataView): DataView; +/** + * Creates a copy of `date`. + * + * @param {Date} typedDate The date to copy. + * @returns {Object} Returns the copied date. + */ +export declare function copyDate(targetDate: Date): Date; +/** + * Creates a copy of `regexp`. + * + * @param {Object} targetRegexp The regexp to copy. + * @returns {Object} Returns the copied regexp. + */ +export declare function copyRegExp(targetRegexp: RegExp): RegExp; +/** + * Creates a copy of `typedArray`. + * + * @param {Object} typedArray The typed array to copy. + * @returns {Object} Returns the copied typed array. + */ +export declare function copyTypedArray(typedArray: TypeArrayBuiltIn): TypeArrayBuiltIn; +export {}; diff --git a/dist/types/lib/function/debounce.d.ts b/dist/types/lib/function/debounce.d.ts index 2e0d14d..4037d8c 100644 --- a/dist/types/lib/function/debounce.d.ts +++ b/dist/types/lib/function/debounce.d.ts @@ -1,7 +1,7 @@ -import { Func } from './interface'; -/** - * Debounce frequency for function execution - * @param fn argv for debounce target function - * @param time argv for debounce time(millisecond) - */ -export declare const debounce: (fn: F, time: number | string, immediate?: boolean) => Func | never; +import { Func } from './interface'; +/** + * Debounce frequency for function execution + * @param fn argv for debounce target function + * @param time argv for debounce time(millisecond) + */ +export declare const debounce: (fn: F, time: number | string, immediate?: boolean) => Func | never; diff --git a/dist/types/lib/function/interface.d.ts b/dist/types/lib/function/interface.d.ts index c65fb06..770e8e3 100644 --- a/dist/types/lib/function/interface.d.ts +++ b/dist/types/lib/function/interface.d.ts @@ -1,23 +1,23 @@ -/** - * type declaration for function - */ -export declare type Func = (...args: Array) => any; -/** - * interface for debounce & throttle - */ -export interface FrequencyFn { - (this: ThisParameterType, ...args: Parameters): ReturnType; - /** - * cancel execution - */ - cancel(): void; -} -/** - * Options of throttle, - * leading: boolean means execute in the beginning, - * trailing: boolean means execute in the end - */ -export interface ThrottleOptions { - leading?: boolean; - trailing?: boolean; -} +/** + * type declaration for function + */ +export declare type Func = (...args: Array) => any; +/** + * interface for debounce & throttle + */ +export interface FrequencyFn { + (this: ThisParameterType, ...args: Parameters): ReturnType; + /** + * cancel execution + */ + cancel(): void; +} +/** + * Options of throttle, + * leading: boolean means execute in the beginning, + * trailing: boolean means execute in the end + */ +export interface ThrottleOptions { + leading?: boolean; + trailing?: boolean; +} diff --git a/dist/types/lib/function/sort.d.ts b/dist/types/lib/function/sort.d.ts index 479e2fe..5880399 100644 --- a/dist/types/lib/function/sort.d.ts +++ b/dist/types/lib/function/sort.d.ts @@ -1,9 +1,9 @@ -/** - * Sort function for sorting array of numberic or not numberic values - * @param a argv - * @param b argv - * @param ignoreCase ignore case or not, default is true - * @param locale locale for sort which default is 'zh-Hans-CN' - * @returns number - */ -export declare const sort: (a: any, b: any, ignoreCase?: boolean, locale?: string) => any; +/** + * Sort function for sorting array of numberic or not numberic values + * @param a argv + * @param b argv + * @param ignoreCase ignore case or not, default is true + * @param locale locale for sort which default is 'zh-Hans-CN' + * @returns number + */ +export declare const sort: (a: any, b: any, ignoreCase?: boolean, locale?: string) => any; diff --git a/dist/types/lib/function/throttle.d.ts b/dist/types/lib/function/throttle.d.ts index 6e3400c..0f19a86 100644 --- a/dist/types/lib/function/throttle.d.ts +++ b/dist/types/lib/function/throttle.d.ts @@ -1,9 +1,9 @@ -import { Func, ThrottleOptions } from './interface'; -/** - * Throttle frequency for function execution - * @param fn argv for debounce target function - * @param time argv for debounce time(millisecond) - * @param options \{ leading: true, trailing: true \} enable or disable trigger fn execution in the beginning or in the end - * @returns an new function or throw an error - */ -export declare const throttle: (fn: F, time: number | string, options?: ThrottleOptions) => Func | never; +import { Func, ThrottleOptions } from './interface'; +/** + * Throttle frequency for function execution + * @param fn argv for debounce target function + * @param time argv for debounce time(millisecond) + * @param options \{ leading: true, trailing: true \} enable or disable trigger fn execution in the beginning or in the end + * @returns an new function or throw an error + */ +export declare const throttle: (fn: F, time: number | string, options?: ThrottleOptions) => Func | never; diff --git a/dist/types/lib/jstd.d.ts b/dist/types/lib/jstd.d.ts index bc5d96e..9f78c26 100644 --- a/dist/types/lib/jstd.d.ts +++ b/dist/types/lib/jstd.d.ts @@ -1,19 +1,19 @@ -import { arrayable, arrayUnique, arrValsCount, arrValCount, flat } from './array/index'; -import { _btoa, _atob } from './buffer/base64'; -import { url2Blob, str2Buffer, buffer2Str } from './buffer/index'; -import { typeis, re } from './common/index'; -import { formatDate, timezoneDate, quarterable, dateable } from './date/index'; -import { Types, TypesDesc, inEnum } from './enum/index'; -import { mappable } from './map/index'; -import { rangeRandom, numberic, guid, hash, numberFormat, moneyFormat, signFormat } from './math/index'; -import { objectable, optional, extractable, assign, objReverse } from './object/index'; -import { isNil, isNull, isUndefined, isNumberic } from './regexp/index'; -import { sleep } from './eventloop/index'; -import { settable } from './set/index'; -import { stringable, strLen } from './string/index'; -import { PromisePolyfill } from './promise/index'; -import { debounce } from './function/debounce'; -import { throttle } from './function/throttle'; -import { copy, copyArrayBuffer, copyDataView, copyDate, copyRegExp, copyTypedArray } from './function/copy'; -import { sort } from './function/sort'; -export { arrayable, arrayUnique, arrValsCount, arrValCount, flat, _btoa, _atob, url2Blob, str2Buffer, buffer2Str, typeis, re, formatDate, timezoneDate, quarterable, dateable, Types, TypesDesc, inEnum, mappable, rangeRandom, numberic, guid, hash, numberFormat, moneyFormat, signFormat, objectable, optional, extractable, assign, objReverse, isNil, isNull, isUndefined, isNumberic, sleep, settable, stringable, strLen, PromisePolyfill, debounce, throttle, copy, copyArrayBuffer, copyDataView, copyDate, copyRegExp, copyTypedArray, sort }; +import { arrayable, arrayUnique, arrValsCount, arrValCount, flat } from './array/index'; +import { _btoa, _atob } from './buffer/base64'; +import { url2Blob, str2Buffer, buffer2Str } from './buffer/index'; +import { typeis, re } from './common/index'; +import { formatDate, timezoneDate, quarterable, dateable } from './date/index'; +import { Types, TypesDesc, inEnum } from './enum/index'; +import { mappable } from './map/index'; +import { rangeRandom, numberic, guid, hash, numberFormat, moneyFormat, signFormat } from './math/index'; +import { objectable, optional, extractable, assign, objReverse } from './object/index'; +import { isNil, isNull, isUndefined, isNumberic } from './regexp/index'; +import { sleep } from './eventloop/index'; +import { settable } from './set/index'; +import { stringable, strLen } from './string/index'; +import { PromisePolyfill } from './promise/index'; +import { debounce } from './function/debounce'; +import { throttle } from './function/throttle'; +import { copy, copyArrayBuffer, copyDataView, copyDate, copyRegExp, copyTypedArray } from './function/copy'; +import { sort } from './function/sort'; +export { arrayable, arrayUnique, arrValsCount, arrValCount, flat, _btoa, _atob, url2Blob, str2Buffer, buffer2Str, typeis, re, formatDate, timezoneDate, quarterable, dateable, Types, TypesDesc, inEnum, mappable, rangeRandom, numberic, guid, hash, numberFormat, moneyFormat, signFormat, objectable, optional, extractable, assign, objReverse, isNil, isNull, isUndefined, isNumberic, sleep, settable, stringable, strLen, PromisePolyfill, debounce, throttle, copy, copyArrayBuffer, copyDataView, copyDate, copyRegExp, copyTypedArray, sort }; diff --git a/dist/types/lib/macro/index.d.ts b/dist/types/lib/macro/index.d.ts index 79ce675..14dfd1e 100644 --- a/dist/types/lib/macro/index.d.ts +++ b/dist/types/lib/macro/index.d.ts @@ -1,7 +1,7 @@ -export declare const kRegSignNumberic: RegExp; -export declare const kRegUnSignNumberic: RegExp; -export declare const kRegNumberic: RegExp; -export declare const kRegStartNumberic: RegExp; -export declare const kRegStartStrictNumberic: RegExp; -export declare const kRegEndStrictNumberic: RegExp; -export declare const kEmptySpacer: RegExp; +export declare const kRegSignNumberic: RegExp; +export declare const kRegUnSignNumberic: RegExp; +export declare const kRegNumberic: RegExp; +export declare const kRegStartNumberic: RegExp; +export declare const kRegStartStrictNumberic: RegExp; +export declare const kRegEndStrictNumberic: RegExp; +export declare const kEmptySpacer: RegExp; diff --git a/dist/types/lib/map/index.d.ts b/dist/types/lib/map/index.d.ts index 59736e6..f508ef2 100644 --- a/dist/types/lib/map/index.d.ts +++ b/dist/types/lib/map/index.d.ts @@ -1,6 +1,6 @@ -/** - * To determine a var is an map or not empty map - * @param map var to determine - * @param length length equals true ? not empty map : map, default is true - */ -export declare const mappable: (map?: any, length?: boolean) => boolean; +/** + * To determine a var is an map or not empty map + * @param map var to determine + * @param length length equals true ? not empty map : map, default is true + */ +export declare const mappable: (map?: any, length?: boolean) => boolean; diff --git a/dist/types/lib/math/decimal.d.ts b/dist/types/lib/math/decimal.d.ts index e7bc2ab..2b385d6 100644 --- a/dist/types/lib/math/decimal.d.ts +++ b/dist/types/lib/math/decimal.d.ts @@ -1,18 +1,18 @@ -export declare enum DecimalMathCalcType { - round = "round", - ceil = "ceil", - floor = "floor", - trunc = "trunc" -} -export default class Decimal { - powers: Array; - constructor(); - private intpow10; - private isRound; - private decimalAdjust; - round(num: number, decimalPlaces: number): number; - ceil(num: number, decimalPlaces: number): number; - floor(num: number, decimalPlaces: number): number; - trunc(num: number, decimalPlaces: number): number; - toFixed(num: number, decimalPlaces: number): string; -} +export declare enum DecimalMathCalcType { + round = "round", + ceil = "ceil", + floor = "floor", + trunc = "trunc" +} +export default class Decimal { + powers: Array; + constructor(); + private intpow10; + private isRound; + private decimalAdjust; + round(num: number, decimalPlaces: number): number; + ceil(num: number, decimalPlaces: number): number; + floor(num: number, decimalPlaces: number): number; + trunc(num: number, decimalPlaces: number): number; + toFixed(num: number, decimalPlaces: number): string; +} diff --git a/dist/types/lib/math/index.d.ts b/dist/types/lib/math/index.d.ts index d296546..dff89be 100644 --- a/dist/types/lib/math/index.d.ts +++ b/dist/types/lib/math/index.d.ts @@ -1,49 +1,49 @@ -/** - * Retrieve a random number with range limit, default is Math.random() - * @param min argv for minimum of range - * @param max argv for maximum of range - */ -export declare const rangeRandom: (min?: any, max?: any) => number; -/** - * Formatting or rounding a value with digits limitation and rounding places limitation - * @param val argv - * @param places rounding places limitation which default is 2 - * @returns number | undefined - */ -export declare const numberic: (val?: any, places?: number) => number | undefined; -/** - * Generate a guid string randomly - * @param length length of guid, default: 8 - * @param salt salt of guid, default: 'abcdefghijklmnopqrstuvwxyz0123456789' - * @returns random string with length and salt limitation - */ -export declare const guid: (length?: number, salt?: string) => string; -/** - * Generate a hash string randomly - * @returns random hash string - */ -export declare const hash: () => string; -/** - * Formatting or rounding a value with digits limitation and rounding places limitation - * @param val argv - * @param digits digits limitation which default is 2 - * @param places rounding places limitation which default is equal to digits - * @returns string | undefined - */ -export declare const numberFormat: (val?: any, digits?: number, places?: number) => string | undefined; -/** - * Formatting a numberic like value into a string such as '1,000,000' - * @param val argv - * @param digits digits limitation which default is 2 - * @param places rounding places limitation which default is equal to digits - * @param defaultVal string which default is '' - * @returns string - */ -export declare const moneyFormat: (val?: any, digits?: number, places?: number, defaultVal?: string) => string; -/** - * Formatting with a positive/negative sign for a numberic value to a string such as '+1' or '-1', '0' - * @param val argv - * @param defaultVal string which default is '' - * @returns string - */ -export declare const signFormat: (val?: any, defaultVal?: string) => string; +/** + * Retrieve a random number with range limit, default is Math.random() + * @param min argv for minimum of range + * @param max argv for maximum of range + */ +export declare const rangeRandom: (min?: any, max?: any) => number; +/** + * Formatting or rounding a value with digits limitation and rounding places limitation + * @param val argv + * @param places rounding places limitation which default is 2 + * @returns number | undefined + */ +export declare const numberic: (val?: any, places?: number) => number | undefined; +/** + * Generate a guid string randomly + * @param length length of guid, default: 8 + * @param salt salt of guid, default: 'abcdefghijklmnopqrstuvwxyz0123456789' + * @returns random string with length and salt limitation + */ +export declare const guid: (length?: number, salt?: string) => string; +/** + * Generate a hash string randomly + * @returns random hash string + */ +export declare const hash: () => string; +/** + * Formatting or rounding a value with digits limitation and rounding places limitation + * @param val argv + * @param digits digits limitation which default is 2 + * @param places rounding places limitation which default is equal to digits + * @returns string | undefined + */ +export declare const numberFormat: (val?: any, digits?: number, places?: number) => string | undefined; +/** + * Formatting a numberic like value into a string such as '1,000,000' + * @param val argv + * @param digits digits limitation which default is 2 + * @param places rounding places limitation which default is equal to digits + * @param defaultVal string which default is '' + * @returns string + */ +export declare const moneyFormat: (val?: any, digits?: number, places?: number, defaultVal?: string) => string; +/** + * Formatting with a positive/negative sign for a numberic value to a string such as '+1' or '-1', '0' + * @param val argv + * @param defaultVal string which default is '' + * @returns string + */ +export declare const signFormat: (val?: any, defaultVal?: string) => string; diff --git a/dist/types/lib/object/index.d.ts b/dist/types/lib/object/index.d.ts index 6a75cc5..15abbda 100644 --- a/dist/types/lib/object/index.d.ts +++ b/dist/types/lib/object/index.d.ts @@ -1,32 +1,32 @@ -import { Dict, OptionalDict, OptionalPropertyObj, OptionalPropertyItem, ExtractableArgs } from '../typing/index'; -/** - * To determine a var is an Object type which is type of `{}` - * @param obj args var - * @param length length equals true ? not empty Object : Object, default is true - */ -export declare const objectable: (obj: any, length?: boolean) => boolean; -/** - * Retrieve value from optional chain in an Object - * @param path The path where the string concatenated by the separator is used to find the value - * @param obj target object - * @param separator separator of path string, default is '.' - */ -export declare const optional: (path: any, obj?: any, separator?: string) => T; -/** - * Extract some key-values from an object with some properties or custom key-value objects - * @param args args of properties for extraction - */ -export declare const extractable: (...args: Array) => Dict; -/** - * Assign a value to an object with key path - * @param path key path, support string and Array - * @param obj target object - * @param val value to assign - * @param separator separator for key path, default is '.' - */ -export declare const assign: (path: any, obj: OptionalPropertyObj, val?: any, separator?: string) => void; -/** - * Reverse an object's key and value - * @param obj argv object - */ -export declare const objReverse: (obj?: OptionalDict | null) => OptionalDict | null; +import { Dict, OptionalDict, OptionalPropertyObj, OptionalPropertyItem, ExtractableArgs } from '../typing/index'; +/** + * To determine a var is an Object type which is type of `{}` + * @param obj args var + * @param length length equals true ? not empty Object : Object, default is true + */ +export declare const objectable: (obj: any, length?: boolean) => boolean; +/** + * Retrieve value from optional chain in an Object + * @param path The path where the string concatenated by the separator is used to find the value + * @param obj target object + * @param separator separator of path string, default is '.' + */ +export declare const optional: (path: any, obj?: any, separator?: string) => T; +/** + * Extract some key-values from an object with some properties or custom key-value objects + * @param args args of properties for extraction + */ +export declare const extractable: (...args: Array) => Dict; +/** + * Assign a value to an object with key path + * @param path key path, support string and Array + * @param obj target object + * @param val value to assign + * @param separator separator for key path, default is '.' + */ +export declare const assign: (path: any, obj: OptionalPropertyObj, val?: any, separator?: string) => void; +/** + * Reverse an object's key and value + * @param obj argv object + */ +export declare const objReverse: (obj?: OptionalDict | null) => OptionalDict | null; diff --git a/dist/types/lib/promise/index.d.ts b/dist/types/lib/promise/index.d.ts index 20f39ac..a2c4b4d 100644 --- a/dist/types/lib/promise/index.d.ts +++ b/dist/types/lib/promise/index.d.ts @@ -1,44 +1,44 @@ -import { EmptyFunc } from '../typing/index'; -interface ResolveFn extends EmptyFunc { - (value: any): any; -} -interface RejectFn extends EmptyFunc { - (reason: any): any; -} -declare type ExecutorArgs = ResolveFn | RejectFn; -declare type RejectReason = Error | undefined; -declare enum PromiseStatus { - pending = "pending", - fulfilled = "fulfilled", - rejected = "rejected" -} -interface Executor { - (resolve: ExecutorArgs, reject: ExecutorArgs): any; -} -/** - * polyfill for Promise - */ -export declare class PromisePolyfill { - status: PromiseStatus; - value: any; - reason: RejectReason; - onResolvedClosures: Array; - onRejectedClosures: Array; - static resolve: (val: any) => PromisePolyfill; - static reject: (err: RejectReason) => PromisePolyfill; - static race: (promises: Array) => PromisePolyfill; - static all: (promises: Array) => PromisePolyfill; - static deferred: () => Deferred; - constructor(executor: Executor); - then(onFulfilled?: ResolveFn, onRejected?: RejectFn): PromisePolyfill; - catch(fn: RejectFn): PromisePolyfill; -} -/** - * promises-aplus-tests adapter - */ -interface Deferred { - promise?: PromisePolyfill; - resolve?: ResolveFn; - reject?: RejectFn; -} -export {}; +import { EmptyFunc } from '../typing/index'; +interface ResolveFn extends EmptyFunc { + (value: any): any; +} +interface RejectFn extends EmptyFunc { + (reason: any): any; +} +declare type ExecutorArgs = ResolveFn | RejectFn; +declare type RejectReason = Error | undefined; +declare enum PromiseStatus { + pending = "pending", + fulfilled = "fulfilled", + rejected = "rejected" +} +interface Executor { + (resolve: ExecutorArgs, reject: ExecutorArgs): any; +} +/** + * polyfill for Promise + */ +export declare class PromisePolyfill { + status: PromiseStatus; + value: any; + reason: RejectReason; + onResolvedClosures: Array; + onRejectedClosures: Array; + static resolve: (val: any) => PromisePolyfill; + static reject: (err: RejectReason) => PromisePolyfill; + static race: (promises: Array) => PromisePolyfill; + static all: (promises: Array) => PromisePolyfill; + static deferred: () => Deferred; + constructor(executor: Executor); + then(onFulfilled?: ResolveFn, onRejected?: RejectFn): PromisePolyfill; + catch(fn: RejectFn): PromisePolyfill; +} +/** + * promises-aplus-tests adapter + */ +interface Deferred { + promise?: PromisePolyfill; + resolve?: ResolveFn; + reject?: RejectFn; +} +export {}; diff --git a/dist/types/lib/regexp/index.d.ts b/dist/types/lib/regexp/index.d.ts index 3cf979e..4b5f629 100644 --- a/dist/types/lib/regexp/index.d.ts +++ b/dist/types/lib/regexp/index.d.ts @@ -1,22 +1,22 @@ -/** - * Determine whether a value is null/undefined/empty string - * @param val argv - */ -export declare const isNil: (val?: any) => boolean; -/** - * Determine whether a value is equal to null - * @param val argv - */ -export declare const isNull: (val?: any) => boolean; -/** - * Determine whether a value is equal to undefined - * @param val argv - */ -export declare const isUndefined: (val?: any) => boolean; -/** - * Determine whether a value is numberic which support pure number-like and pure instance of Number - * @param val argv to determine - * @param signed true: positive val only, false: negative val only. default is ignore positive/negative - * @param arabic if arabic number limitation, default is true - */ -export declare const isNumberic: (val: any, signed?: boolean, arabic?: boolean) => boolean | number; +/** + * Determine whether a value is null/undefined/empty string + * @param val argv + */ +export declare const isNil: (val?: any) => boolean; +/** + * Determine whether a value is equal to null + * @param val argv + */ +export declare const isNull: (val?: any) => boolean; +/** + * Determine whether a value is equal to undefined + * @param val argv + */ +export declare const isUndefined: (val?: any) => boolean; +/** + * Determine whether a value is numberic which support pure number-like and pure instance of Number + * @param val argv to determine + * @param signed true: positive val only, false: negative val only. default is ignore positive/negative + * @param arabic if arabic number limitation, default is true + */ +export declare const isNumberic: (val: any, signed?: boolean, arabic?: boolean) => boolean | number; diff --git a/dist/types/lib/set/index.d.ts b/dist/types/lib/set/index.d.ts index 7b91cce..acb0432 100644 --- a/dist/types/lib/set/index.d.ts +++ b/dist/types/lib/set/index.d.ts @@ -1,6 +1,6 @@ -/** - * To determine a var is an set or not empty set - * @param set var to determine - * @param length length equals true ? not empty set : set, default is true - */ -export declare const settable: (set?: any, length?: boolean) => boolean; +/** + * To determine a var is an set or not empty set + * @param set var to determine + * @param length length equals true ? not empty set : set, default is true + */ +export declare const settable: (set?: any, length?: boolean) => boolean; diff --git a/dist/types/lib/string/index.d.ts b/dist/types/lib/string/index.d.ts index aeca8fb..2a5920c 100644 --- a/dist/types/lib/string/index.d.ts +++ b/dist/types/lib/string/index.d.ts @@ -1,11 +1,11 @@ -/** - * To determine a var is string or not empty string - * @param str var to determine - * @param length length equals true ? not empty string : string, default is true - */ -export declare const stringable: (str: any, length?: boolean) => boolean; -/** - * To count the number of characters in a string - * @param str var string - */ -export declare const strLen: (str: any) => number; +/** + * To determine a var is string or not empty string + * @param str var to determine + * @param length length equals true ? not empty string : string, default is true + */ +export declare const stringable: (str: any, length?: boolean) => boolean; +/** + * To count the number of characters in a string + * @param str var string + */ +export declare const strLen: (str: any) => number; diff --git a/dist/types/lib/typing/index.d.ts b/dist/types/lib/typing/index.d.ts index 1b948ec..5535fa2 100644 --- a/dist/types/lib/typing/index.d.ts +++ b/dist/types/lib/typing/index.d.ts @@ -1,13 +1,13 @@ -export declare type Dict = { - [key: string]: T; -}; -export declare type StringDict = Dict; -export declare type NumberDict = Dict; -export declare type Obj = Dict | Array; -export declare type OptionalDict = Dict | undefined; -export declare type OptionalPropertyItem = T | undefined; -export declare type OptionalPropertyDict = Dict | OptionalPropertyItem; -export declare type OptionalPropertyArray = Array | OptionalPropertyItem; -export declare type OptionalPropertyObj = OptionalPropertyDict | OptionalPropertyArray; -export declare type ExtractableArgs = string | [string, string] | [string, any] | [string, any, any] | Dict | undefined; -export declare type EmptyFunc = () => void; +export declare type Dict = { + [key: string]: T; +}; +export declare type StringDict = Dict; +export declare type NumberDict = Dict; +export declare type Obj = Dict | Array; +export declare type OptionalDict = Dict | undefined; +export declare type OptionalPropertyItem = T | undefined; +export declare type OptionalPropertyDict = Dict | OptionalPropertyItem; +export declare type OptionalPropertyArray = Array | OptionalPropertyItem; +export declare type OptionalPropertyObj = OptionalPropertyDict | OptionalPropertyArray; +export declare type ExtractableArgs = string | [string, string] | [string, any] | [string, any, any] | Dict | undefined; +export declare type EmptyFunc = () => void; diff --git a/package.json b/package.json index 40e085d..a1c20ac 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "jstd", - "version": "0.3.2", + "version": "0.3.3", "description": "js utilities lib", "config": { "libName": "jstd" diff --git a/packages/function/sort.ts b/packages/function/sort.ts index 9b70ea4..649ad91 100644 --- a/packages/function/sort.ts +++ b/packages/function/sort.ts @@ -11,7 +11,7 @@ import { isNumberic } from '../regexp/index' export const sort = function (a: any, b: any, ignoreCase = false, locale = 'zh-Hans-CN') { let ta = a ?? '' let tb = b ?? '' - const noZh = /[a-zA-Z0-9]/ + const noZh = /^[a-zA-Z0-9]$/ if (isNumberic(a) && isNumberic(b)) { return Number(a) > Number(b) ? 1 : Number(a) < Number(b) ? -1 : 0 } else if (noZh.test(ta) || noZh.test(tb)) { @@ -21,5 +21,7 @@ export const sort = function (a: any, b: any, ignoreCase = false, locale = 'zh-H } return ta > tb ? 1 : ta < tb ? -1 : 0 } + ta = String(ta) + tb = String(tb) return ta === tb ? 0 : ta.localeCompare(tb, locale) } diff --git a/test/sort.spec.ts b/test/sort.spec.ts index 928e2c5..9dc6787 100644 --- a/test/sort.spec.ts +++ b/test/sort.spec.ts @@ -1,4 +1,4 @@ -import { sort } from '../'; +import { sort } from '../' describe('Sort', () => { test('function - sort - sort mixed value', () => { @@ -29,10 +29,13 @@ describe('Sort', () => { expect(sort('F123.4', '--')).toEqual(1); expect(sort('--', 'F123.4')).toEqual(-1); expect(sort('ab1', 'aa1')).toEqual(1); - expect(sort('日', '也')).toEqual(-1); - expect(sort('日', '1')).toEqual(1); expect(sort('a', '1')).toEqual(1); - expect(sort('日', '1')).toEqual(1); }); - + test('function - sort - sort localString', () => { + expect(sort('日', '也')).toEqual(-1); + expect(sort('日', '1')).toEqual(1); + expect(sort('五矿证券FOF29号单一资产', '广西交投一号单一计划')).toEqual(1); + expect(sort('广西交投一号单一计划', '五矿证券FOF29号单一资产')).toEqual(-1); + expect(sort('日1', 'a1')).toEqual(-1); + }) }); \ No newline at end of file