rx-util

rxliuli 在浏览器上使用的 js 工具集

Ekde 2019/05/12. Vidu La ĝisdata versio.

This script should not be not be installed directly. It is a library for other scripts to include with the meta directive // @require https://update.greasyfork.org/scripts/382120/697522/rx-util.js

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t=t||self).rx={})}(this,function(t){"use strict";function i(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"unknown",n=document.createElement("a");n.download=e,n.style.display="none",n.href=URL.createObjectURL(t),document.body.appendChild(n),n.click(),document.body.removeChild(n)}function e(t,e){return t(e={exports:{}},e.exports),e.exports}var u=e(function(t){var e=function(i){var c,t=Object.prototype,f=t.hasOwnProperty,e="function"==typeof Symbol?Symbol:{},o=e.iterator||"@@iterator",n=e.asyncIterator||"@@asyncIterator",r=e.toStringTag||"@@toStringTag";function a(t,e,n,r){var i,a,u,c,o=e&&e.prototype instanceof g?e:g,f=Object.create(o.prototype),l=new P(r||[]);return f._invoke=(i=t,a=n,u=l,c=h,function(t,e){if(c===p)throw new Error("Generator is already running");if(c===y){if("throw"===t)throw e;return R()}for(u.method=t,u.arg=e;;){var n=u.delegate;if(n){var r=E(n,u);if(r){if(r===d)continue;return r}}if("next"===u.method)u.sent=u._sent=u.arg;else if("throw"===u.method){if(c===h)throw c=y,u.arg;u.dispatchException(u.arg)}else"return"===u.method&&u.abrupt("return",u.arg);c=p;var o=s(i,a,u);if("normal"===o.type){if(c=u.done?y:v,o.arg===d)continue;return{value:o.arg,done:u.done}}"throw"===o.type&&(c=y,u.method="throw",u.arg=o.arg)}}),f}function s(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}i.wrap=a;var h="suspendedStart",v="suspendedYield",p="executing",y="completed",d={};function g(){}function u(){}function l(){}var m={};m[o]=function(){return this};var w=Object.getPrototypeOf,b=w&&w(w(T([])));b&&b!==t&&f.call(b,o)&&(m=b);var x=l.prototype=g.prototype=Object.create(m);function S(t){["next","throw","return"].forEach(function(e){t[e]=function(t){return this._invoke(e,t)}})}function k(c){var e;this._invoke=function(n,r){function t(){return new Promise(function(t,e){!function e(t,n,r,o){var i=s(c[t],c,n);if("throw"!==i.type){var a=i.arg,u=a.value;return u&&"object"==typeof u&&f.call(u,"__await")?Promise.resolve(u.__await).then(function(t){e("next",t,r,o)},function(t){e("throw",t,r,o)}):Promise.resolve(u).then(function(t){a.value=t,r(a)},function(t){return e("throw",t,r,o)})}o(i.arg)}(n,r,t,e)})}return e=e?e.then(t,t):t()}}function E(t,e){var n=t.iterator[e.method];if(n===c){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=c,E(t,e),"throw"===e.method))return d;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return d}var r=s(n,t.iterator,e.arg);if("throw"===r.type)return e.method="throw",e.arg=r.arg,e.delegate=null,d;var o=r.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=c),e.delegate=null,d):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,d)}function O(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function T(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,r=function t(){for(;++n<e.length;)if(f.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=c,t.done=!0,t};return r.next=r}}return{next:R}}function R(){return{value:c,done:!0}}return u.prototype=x.constructor=l,l.constructor=u,l[r]=u.displayName="GeneratorFunction",i.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===u||"GeneratorFunction"===(e.displayName||e.name))},i.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,l):(t.__proto__=l,r in t||(t[r]="GeneratorFunction")),t.prototype=Object.create(x),t},i.awrap=function(t){return{__await:t}},S(k.prototype),k.prototype[n]=function(){return this},i.AsyncIterator=k,i.async=function(t,e,n,r){var o=new k(a(t,e,n,r));return i.isGeneratorFunction(e)?o:o.next().then(function(t){return t.done?t.value:o.next()})},S(x),x[r]="Generator",x[o]=function(){return this},x.toString=function(){return"[object Generator]"},i.keys=function(n){var r=[];for(var t in n)r.push(t);return r.reverse(),function t(){for(;r.length;){var e=r.pop();if(e in n)return t.value=e,t.done=!1,t}return t.done=!0,t}},i.values=T,P.prototype={constructor:P,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=c,this.done=!1,this.delegate=null,this.method="next",this.arg=c,this.tryEntries.forEach(A),!t)for(var e in this)"t"===e.charAt(0)&&f.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=c)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(n){if(this.done)throw n;var r=this;function t(t,e){return i.type="throw",i.arg=n,r.next=t,e&&(r.method="next",r.arg=c),!!e}for(var e=this.tryEntries.length-1;0<=e;--e){var o=this.tryEntries[e],i=o.completion;if("root"===o.tryLoc)return t("end");if(o.tryLoc<=this.prev){var a=f.call(o,"catchLoc"),u=f.call(o,"finallyLoc");if(a&&u){if(this.prev<o.catchLoc)return t(o.catchLoc,!0);if(this.prev<o.finallyLoc)return t(o.finallyLoc)}else if(a){if(this.prev<o.catchLoc)return t(o.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return t(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;0<=n;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&f.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var o=r;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),d},finish:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),A(n),d}},catch:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;A(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:T(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=c),d}},i}(t.exports);try{regeneratorRuntime=e}catch(t){Function("r","regeneratorRuntime = r")(e)}});function c(t,e,n,r,o,i,a){try{var u=t[i](a),c=u.value}catch(t){return void n(t)}u.done?e(c):Promise.resolve(c).then(r,o)}var a=function(u){return function(){var t=this,a=arguments;return new Promise(function(e,n){var r=u.apply(t,a);function o(t){c(r,e,n,o,i,"next",t)}function i(t){c(r,e,n,o,i,"throw",t)}o(void 0)})}};function n(){return(n=a(u.mark(function t(e){var n,r=arguments;return u.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:n=1<r.length&&void 0!==r[1]?r[1]:"unknown.txt",i(new Blob([e],{type:"text/plain"}),n);case 3:case"end":return t.stop()}},t)}))).apply(this,arguments)}function r(){return(r=a(u.mark(function t(e){var n,r,o=arguments;return u.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return n=1<o.length&&void 0!==o[1]?o[1]:e.substr(e.lastIndexOf("/")),t.prev=1,t.next=4,fetch(e);case 4:return r=t.sent,t.next=7,r.blob();case 7:i(t.sent,n),t.next=14;break;case 11:return t.prev=11,t.t0=t.catch(1),t.abrupt("return",console.log("下载出错了 ",t.t0));case 14:case"end":return t.stop()}},t,null,[[1,11]])}))).apply(this,arguments)}var o=function(t){if(Array.isArray(t))return t};var f=function(t,e){var n=[],r=!0,o=!1,i=void 0;try{for(var a,u=t[Symbol.iterator]();!(r=(a=u.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}return n};var l=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")};var s=function(t,e){return o(t)||f(t,e)||l()};function h(){return(h=a(u.mark(function t(e,n){var r,o,i,a=arguments;return u.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return r=2<a.length&&void 0!==a[2]?a[2]:{},t.next=3,fetch(e,r);case 3:return o=t.sent,t.next=6,o.blob();case 6:i=t.sent,n.src=window.URL.createObjectURL(i);case 8:case"end":return t.stop()}},t)}))).apply(this,arguments)}var m=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},v=function t(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},n=e.href,r=void 0===n?"":n,o=e.website,i=void 0===o?"":o,a=e.protocol,u=void 0===a?"":a,c=e.domain,f=void 0===c?"":c,l=e.accessPath,s=void 0===l?"":l,h=e.params,v=void 0===h?{}:h,p=e.url,y=void 0===p?"":p,d=e.port,g=void 0===d?0:d;m(this,t),this.href=r,this.website=i,this.protocol=u,this.domain=f,this.accessPath=s,this.params=v,this.url=y,this.port=g},p={http:80,https:443,ssh:22,ftp:21};function y(r){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},e=t.type,o=void 0===e?y.DataURL:e,n=t.encoding,i=void 0===n?"UTF-8":n;return new Promise(function(e,n){r||n(new Error("file not exists"));var t=new FileReader;t.onload=function(t){e(t.target.result)},t.onerror=function(t){n(t)},t[o](r,i)})}function d(t,e){var n={"y+":t.getFullYear(),"M+":t.getMonth()+1,"d+":t.getDate(),"h+":t.getHours(),"m+":t.getMinutes(),"s+":t.getSeconds(),"q+":Math.floor((t.getMonth()+3)/3),"S+":t.getMilliseconds()};for(var r in n)if(new RegExp("("+r+")").test(e))if("y+"===r)e=e.replace(RegExp.$1,(""+n[r]).substr(4-RegExp.$1.length));else if("S+"===r){var o=RegExp.$1.length;o=1===o?3:o,e=e.replace(RegExp.$1,("00"+n[r]).substr((""+n[r]).length-1,o))}else e=e.replace(RegExp.$1,1===RegExp.$1.length?n[r]:("00"+n[r]).substr((""+n[r]).length));return e}y.DataURL="readAsDataURL",y.Text="readAsText",y.BinaryString="readAsBinaryString",y.ArrayBuffer="readAsArrayBuffer";var g="yyyy-MM-ddThh:mm:ss.SSS",w=function(t,e){return encodeURIComponent(t)+"="+encodeURIComponent(e)};function b(t,e){var n=null,r=new Promise(function(t,e){n=function(){e(new Error("abort promise"))}}),o=Promise.race([t,r]);return setTimeout(function(){n()},e),o}var x=function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}};var S=function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)};var k=function(){throw new TypeError("Invalid attempt to spread non-iterable instance")};var E=function(t){return x(t)||S(t)||k()};function O(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var A=function(t,e,n){return e&&O(t.prototype,e),n&&O(t,n),t},P=function(n){return new Promise(function(t){if("number"==typeof n)setTimeout(t,n);else if("function"==typeof n)var e=setInterval(function(){n()&&(clearInterval(e),t())},100);else t()})},T=function(){function i(t){var e=t.timeout,n=void 0===e?1e4:e,r=t.limit,o=void 0===r?10:r;m(this,i),this.timeout=n,this.limit=o,this.execCount=0,this.waitArr=[]}return A(i,[{key:"fetch",value:function(n){function t(t,e){return n.apply(this,arguments)}return t.toString=function(){return n.toString()},t}(function(){var n=a(u.mark(function t(e,n){var r,o=this,i=arguments;return u.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return r=function(){var t=a(u.mark(function t(){var e;return u.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return o.execCount++,e=o.waitArr.shift(),t.prev=2,t.next=5,b(fetch.apply(void 0,E(e)),o.timeout);case 5:return t.abrupt("return",t.sent);case 6:return t.prev=6,o.execCount--,t.finish(6);case 9:case"end":return t.stop()}},t,null,[[2,,6,9]])}));return function(){return t.apply(this,arguments)}}(),this.waitArr.push(i),t.next=4,P(function(){return o.execCount<o.limit});case 4:return t.abrupt("return",r());case 5:case"end":return t.stop()}},t,this)}));return function(t,e){return n.apply(this,arguments)}}())}]),i}();function R(t){for(var e=[];;){var n=t.next();if(n.done)break;e.push(n.value)}return e}function j(){return(j=a(u.mark(function t(e,n){var r,o;return u.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:r=[],o=0;case 2:if(o<e.length)return t.t0=r.push,t.t1=r,t.t2=E,t.next=8,n(e[o]);t.next=14;break;case 8:t.t3=t.sent,t.t4=(0,t.t2)(t.t3),t.t0.apply.call(t.t0,t.t1,t.t4);case 11:o++,t.next=2;break;case 14:return t.abrupt("return",r);case 15:case"end":return t.stop()}},t)}))).apply(this,arguments)}function M(t,i){return t.reduce(function(t,e){for(var n=arguments.length,r=new Array(2<n?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];return t.concat(i.apply(void 0,[e].concat(r)))},[])}function L(t,a){var u=2<arguments.length&&void 0!==arguments[2]?arguments[2]:function(t,e){return t.push(e),t},c=3<arguments.length&&void 0!==arguments[3]?arguments[3]:function(){return[]};return t.reduce(function(t,e){for(var n=arguments.length,r=new Array(2<n?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];var i=a.apply(void 0,[e].concat(r));return t.has(i)||t.set(i,c()),t.set(i,u.apply(void 0,[t.get(i),e].concat(r))),t},new Map)}function D(t,i){var a=2<arguments.length&&void 0!==arguments[2]?arguments[2]:function(t){return t};return t.reduce(function(t,e){for(var n=arguments.length,r=new Array(2<n?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];return t.set(i.apply(void 0,[e].concat(r)),a.apply(void 0,[e].concat(r)))},new Map)}function I(t,e){return e<=0?"":t+I(t,e-1)}var F,C=function t(e,n,r,o){m(this,t),this.name=e,this.format=n,this.value=r,this.index=o},_={year:"y{4}|y{2}",month:"M{1,2}",day:"d{1,2}",hour:"h{1,2}",minute:"m{1,2}",second:"s{1,2}",millieSecond:"S{1,3}"};function N(o,t){var e={year:(new Date).getFullYear().toString(),month:"01",day:"01",hour:"00",minute:"00",second:"00",millieSecond:"000"},i=[];for(var n in _){var r=new RegExp(_[n]);if(r.test(t)){var a=r.exec(t)[0],u=I("`",a.length),c=t.indexOf(a);t=t.replace(a,u),i.push(new C(n,I("\\d",a.length),null,c))}else i.push(new C(n,null,e[n],-1))}if(t=t.replace(new RegExp("`","g"),"\\d"),!new RegExp("^".concat(t,"$")).test(o))return null;i.filter(function(t){return t.format}).sort(function(t,e){return t.index-e.index}).map(function(t){var e=new RegExp(t.format).exec(o);return null!==e&&0<e.length&&(o=o.replace(e[0],""),t.value=e[0]),t}).forEach(function(t,e){var n=t.format,r=new RegExp(n).exec(o);null!==r&&0<r.length&&(o=o.replace(r[0],""),i[e].value=r[0])});var f=D(i,function(t){return t.name},function(t){return t.value});2===f.get("year").length&&f.set("year",e.year.substr(0,2).concat(f.get("year")));var l="".concat(f.get("year"),"-").concat(f.get("month"),"-").concat(f.get("day"),"T").concat(f.get("hour"),":").concat(f.get("minute"),":").concat(f.get("second"),".").concat(f.get("millieSecond"));return new Date(l)}function U(t){return t.selectionStart}function B(t,e){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:e;t.focus(),t.setSelectionRange(e,n)}function Y(t){return t&&"string"==typeof t?t.toLowerCase():t}document.addEventListener("focus",function(t){F=t.target},!0),document.addEventListener("blur",function(){F=null},!0);function z(t){return t}var $=function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null;try{for(var n=arguments.length,r=new Array(2<n?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];return t.apply(void 0,r)}catch(t){return e}};function G(t){var r;return new Proxy(t,{construct:function(t,e,n){return r||(r=Reflect.construct(t,e,n))}})}var J=e(function(n){function r(t,e){return n.exports=r=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},r(t,e)}n.exports=r}),W=e(function(r){function o(t,e,n){return!function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(t){return!1}}()?r.exports=o=function(t,e,n){var r=[null];r.push.apply(r,e);var o=new(Function.bind.apply(t,r));return n&&J(o,n.prototype),o}:r.exports=o=Reflect.construct,o.apply(null,arguments)}r.exports=o}),q=function(){function t(){m(this,t)}return A(t,null,[{key:"getFactory",value:function(){var i=new Map;return new(function(){function t(){m(this,t)}return A(t,[{key:"register",value:function(t,e){return i.set(t,G(e)),e}},{key:"getInstance",value:function(t){var e=i.get(t);if(!e)return null;for(var n=arguments.length,r=new Array(1<n?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return W(e,r)}}]),t}())}}]),t}(),Z=function(t){var e=performance.now(),n=t();return n instanceof Promise?n.then(function(){return performance.now()-e}):performance.now()-e};function H(t){return null==t}var V=new RegExp("^(-?\\d+)(.\\d+)?$"),K=new RegExp("^-?\\d+$"),Q=new RegExp("^\\w+((-\\w+)|(\\.\\w+))*\\@[A-Za-z0-9]+((\\.|-)[A-Za-z0-9]+)*\\.[A-Za-z]+$"),X=new(function(){function t(){m(this,t)}return A(t,[{key:"isEmpty",value:function(t){return H(t)||""===t}},{key:"isBlank",value:function(t){return X.isEmpty(t)||""===t.trim()}},{key:"isFloat",value:function(t){return V.test(t)}},{key:"isInteger",value:function(t){return K.test(t)}},{key:"isEmail",value:function(t){return!X.isBlank(t)&&Q.test(t)}}]),t}());function tt(t){return t&&"string"==typeof t?t.toUpperCase():t}function et(t){return t&&0!==t.trim().length?t:null}function nt(t){return H(t)?[]:[].concat(E(Object.getOwnPropertyNames(t)),E(Object.getOwnPropertySymbols(t)))}function rt(n){for(var t=arguments.length,e=new Array(1<t?t-1:0),r=1;r<t;r++)e[r-1]=arguments[r];var o=new Set(e);return nt(n).reduce(function(t,e){return o.has(e)||(t[e]=n[e]),t},{})}var ot=new(function(){function t(){m(this,t)}return A(t,[{key:"dayStart",value:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:new Date;return new Date("".concat(d(t,"yyyy-MM-dd"),"T00:00:00.000"))}},{key:"dayEnd",value:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:new Date;return new Date("".concat(d(t,"yyyy-MM-dd"),"T23:59:59.999"))}},{key:"yearStart",value:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:new Date;return new Date("".concat(t.getFullYear(),"-01-01T00:00:00.000"))}},{key:"yearEnd",value:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:new Date;return new Date("".concat(t.getFullYear(),"-12-31T23:59:59.999"))}}]),t}());function it(t,e,n){return e<=t&&t<n}var at=new(function(){function t(){m(this,t)}return A(t,[{key:"dayStart",value:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:new Date;return new Date("".concat(d(t,"yyyy-MM-dd"),"T00:00:00.000"))}},{key:"dayEnd",value:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:new Date;return new Date("".concat(d(t,"yyyy-MM-dd"),"T23:59:59.999"))}},{key:"yearStart",value:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:new Date;return new Date("".concat(t.getFullYear(),"-01-01T00:00:00.000"))}},{key:"yearEnd",value:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:new Date;return new Date("".concat(t.getFullYear(),"-12-31T23:59:59.999"))}}]),t}()),ut=function(){function e(t){m(this,e),this.date=t}return A(e,[{key:"year",value:function(){return this.date.getFullYear()}},{key:"month",value:function(){return this.date.getMonth()}},{key:"monthOfYear",value:function(){return this.date.getMonth()+1}},{key:"dayOfYear",value:function(){return Math.ceil((this.date.getTime()-at.yearStart(this.date).getTime())/864e5)}},{key:"dayOfMonth",value:function(){return this.date.getDate()}},{key:"dayOfWeek",value:function(){return this.date.getDay()}},{key:"weekOfYear",value:function(){return Math.ceil(this.dayOfYear()/7)}},{key:"weekOfMonth",value:function(){return Math.ceil(this.dayOfMonth()/7)}},{key:"quarter",value:function(){var t=this.month();return it(t,0,3)?1:it(t,3,6)?2:it(t,6,9)?3:4}},{key:"hour",value:function(){return this.date.getHours()}},{key:"minute",value:function(){return this.date.getMinutes()}},{key:"second",value:function(){return this.date.getSeconds()}},{key:"milliSecond",value:function(){return this.date.getMilliseconds()}}]),e}();var ct=function(){function n(t,e){m(this,n),this.start=t,this.end=e}return A(n,[{key:"milliSecond",value:function(){return this.end.getTime()-this.start.getTime()}},{key:"second",value:function(){return Math.floor(this.milliSecond()/1e3)}},{key:"minute",value:function(){return Math.floor(this.second()/60)}},{key:"hour",value:function(){return Math.floor(this.minute()/60)}},{key:"day",value:function(){return Math.floor(this.hour()/24)}},{key:"month",value:function(){var t=this.year(),e=this.end.getMonth()-this.start.getMonth();return 12*t+e}},{key:"year",value:function(){return this.end.getFullYear()-this.start.getFullYear()}}]),n}();var ft=function(t){var o,i=!0;return new Proxy(t,{apply:function(t,e,n){if(!1===i)return o;i=!1;var r=Reflect.apply(t,e,n);return r instanceof Promise?r.then(function(t){return o=t}):o=r}})},lt=function(t){var a=1<arguments.length&&void 0!==arguments[1]?arguments[1]:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return JSON.stringify(e)},u=new Map;return new Proxy(t,{apply:function(t,e,n){var r=a.apply(void 0,E(n)),o=u.get(r);if(void 0!==o)return o;var i=Reflect.apply(t,e,n);return i instanceof Promise?i.then(function(t){return u.set(r,t),t}):(u.set(r,i),i)}})};var st=function t(e,n,r){m(this,t),this.left=e,this.right=n,this.common=r};var ht=u.mark(vt);function vt(){var e;return u.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:e=0;case 1:return t.next=3,e;case 3:e++,t.next=1;break;case 6:case"end":return t.stop()}},ht)}var pt=ft(vt);var yt=e(function(e){function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function r(t){return"function"==typeof Symbol&&"symbol"===n(Symbol.iterator)?e.exports=r=function(t){return n(t)}:e.exports=r=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":n(t)},r(t)}e.exports=r});var dt=function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t};var gt=function(t,e){return!e||"object"!==yt(e)&&"function"!=typeof e?dt(t):e},mt=e(function(e){function n(t){return e.exports=n=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},n(t)}e.exports=n});var wt=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&J(t,e)},bt=function(){function t(){m(this,t)}return A(t,[{key:"from",value:function(t){throw new Error("子类必须重写 from 函数")}},{key:"to",value:function(t){throw new Error("子类必须重写 to 函数")}}]),t}(),xt=function(t){function e(){return m(this,e),gt(this,mt(e).apply(this,arguments))}return wt(e,bt),A(e,[{key:"from",value:function(t){for(var e=[],n=t.length,r=0,o=0;o<n;o++){var i=t.charAt(o);"A"<=i&&i<="Z"&&(0!==o&&e.push(t.substring(r,o)),r=o)}return r!==t.length&&e.push(t.substring(r,t.length)),e}}]),e}(),St=function(t){function e(){return m(this,e),gt(this,mt(e).apply(this,arguments))}return wt(e,xt),A(e,[{key:"to",value:function(t){return t.reduce(function(t,e,n){var r=Y(e);return t+((0===n?Y:tt)(r.substring(0,1))+r.substring(1))},"")}}]),e}(),kt=function(t){function e(){return m(this,e),gt(this,mt(e).apply(this,arguments))}return wt(e,xt),A(e,[{key:"to",value:function(t){return t.reduce(function(t,e){var n=Y(e);return t+(tt(n.substring(0,1))+n.substring(1))},"")}}]),e}(),Et=function(t){function e(){return m(this,e),gt(this,mt(e).apply(this,arguments))}return wt(e,bt),A(e,[{key:"from",value:function(t){return t.split("_")}}]),e}(),Ot=function(t){function e(){return m(this,e),gt(this,mt(e).apply(this,arguments))}return wt(e,Et),A(e,[{key:"to",value:function(t){return t.map(Y).join("_")}}]),e}(),At=function(t){function e(){return m(this,e),gt(this,mt(e).apply(this,arguments))}return wt(e,Et),A(e,[{key:"to",value:function(t){return t.map(tt).join("_")}}]),e}(),Pt={Camel:Symbol(1),Pascal:Symbol(2),Snake:Symbol(3),ScreamingSnake:Symbol(4)},Tt=function(){function t(){m(this,t)}return A(t,null,[{key:"getInstance",value:function(t){switch(t){case Pt.Camel:return new St;case Pt.Pascal:return new kt;case Pt.Snake:return new Ot;case Pt.ScreamingSnake:return new At;default:throw new Error("No corresponding converter found")}}}]),t}(),Rt=function(){function n(t,e){m(this,n),this.fromConverter=Tt.getInstance(t),this.toConverter=Tt.getInstance(e)}return A(n,[{key:"convert",value:function(t){return X.isEmpty(t)?t:this.toConverter.to(this.fromConverter.from(t))}}]),n}(),jt=lt(function(t,e){return new Rt(t,e)},function(t,e){return t.toString()+e.toString()}),Mt=function(){function r(){m(this,r)}return A(r,null,[{key:"getConverter",value:function(t,e){return jt(t,e)}},{key:"convert",value:function(t,e,n){return r.getConverter(t,e).convert(n)}}]),r}();var Lt=function u(c){for(var t=arguments.length,f=new Array(1<t?t-1:0),e=1;e<t;e++)f[e-1]=arguments[e];var n=f.filter(function(t){return t!==u._});if(n.length>=c.length)return c.apply(void 0,E(n));function r(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];var r=new Set,o=0,i=f.map(function(t){return t!==u._||void 0===e[o]||e[o]===u._?t:(r.add(o),e[o++])}),a=e.filter(function(t,e){return!r.has(e)});return u.apply(void 0,[c].concat(E(i),E(a)))}return r.toString=function(){return"name: ".concat(c.name,", args: [").concat(f.map(function(t){return t.toString()}).join(", "),"]")},r._curry=!0,r};function Dt(t){return X.isEmpty(t)}Lt._=Symbol("_");var It=function(){function e(t){m(this,e),this.fmt=t}return A(e,[{key:"format",value:function(t){return H(t)?"":d(t,this.fmt)}},{key:"parse",value:function(t){return Dt(t)?null:N(t,this.fmt)}},{key:"strFormat",value:function(t,e){return Dt(t)?"":d(e?N(t,e):new Date(t),this.fmt)}}]),e}();It.dateFormatter=new It("yyyy-MM-dd"),It.timeFormatter=new It("hh:mm:ss"),It.dateTimeFormatter=new It("yyyy-MM-dd hh:mm:ss");var Ft=Symbol("TimoutInfinite").toString(),Ct=function t(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},n=e.timeout,r=e.timeStart,o=e.serialize,i=e.deserialize;m(this,t),this.timeStart=r,this.timeout=n,this.serialize=o,this.deserialize=i};function _t(e){return nt(e).map(function(t){return[t,e[t]]})}function Nt(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return M(e,function(t){return H(t)?[]:_t(t)}).reduce(function(t,e){var n=s(e,2),r=n[0],o=n[1];return H(o)||(t[r]=o),t},{})}var Ut=function(){function e(t){m(this,e),this.cacheOption=Nt(new Ct({timeout:Ft,serialize:JSON.stringify,deserialize:JSON.parse}),t)}return A(e,[{key:"add",value:function(t,e,n){}},{key:"del",value:function(t){}},{key:"set",value:function(t,e,n){}},{key:"get",value:function(t,e){}},{key:"touch",value:function(t,e){}}]),e}(),Bt=function t(e){var n=e.key,r=e.val,o=e.cacheOption;m(this,t),this.key=n,this.val=r,this.cacheOption=o},Yt=function(t){function n(t){var e;return m(this,n),(e=gt(this,mt(n).call(this,t))).localStorage=window.localStorage,e}return wt(n,Ut),A(n,[{key:"add",value:function(t,e,n){null===this.get(t,Nt({timeStart:Date.now()},n))&&this.set(t,e,n)}},{key:"del",value:function(t){this.localStorage.removeItem(t)}},{key:"set",value:function(t,e){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:new Ct,r=Nt(this.cacheOption,{timeStart:Date.now()},n);this.localStorage.setItem(t,JSON.stringify(new Bt({key:t,val:r.serialize(e),cacheOption:r})))}},{key:"get",value:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:new Ct,n=this.localStorage.getItem(e),r=$(JSON.parse,null,n);if(null===r)return null;var o=Nt(this.cacheOption,r.cacheOption,t),i=o.timeStart,a=o.timeout,u=o.deserialize;if(a!==Ft&&Date.now()-i>a)return this.del(e),null;try{return u(r.val)}catch(t){return this.del(e),null}}},{key:"touch",value:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:new Ct,n=this.localStorage.getItem(e),r=$(JSON.parse,null,n);if(null===r)return null;var o=Nt(this.cacheOption,r.cacheOption,t),i=o.timeStart,a=o.timeout,u=o.deserialize;if(a!==Ft&&Date.now()-i>a)return this.del(e),null;try{var c=u(r.val);return this.set(e,c,Nt(o,{timeStart:Date.now()})),c}catch(t){return this.del(e),null}}}]),n}(),zt=new Yt,$t=new(function(){function t(){m(this,t)}return A(t,[{key:"onceOfSameParam",value:function(u){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},e=t.identity,n=void 0===e?u.toString():e,r=t.timeout,c=void 0===r?Ft:r,f=function(t){return"onceOfSameParam-".concat(n,"-").concat(JSON.stringify(t))},o=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];var r=f(e),o=new Ct({timeout:c}),i=zt.get(r);if(null!==i)return i;var a=u.call.apply(u,[this].concat(e));return a instanceof Promise?a.then(function(t){return zt.set(r,t,o),t}):(zt.set(r,a,o),a)};return o.origin=u,o.clear=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];var r=f(e);zt.del(r)},o}}]),t}()),Gt=function(){},Jt={cyclingDebugger:function(){setInterval(function(){},100)},checkDebug:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:function(){return window.location.reload()};setInterval(function(){var t=Z(function(){for(var t=0;t<1e3;t++)console.log(t),console.clear()});500<t&&(console.log(t),e())},1e3)},disableConsoleOutput:function(){window.console&&Object.keys(console).forEach(function(t){return console[t]=Gt})}};var Wt=new(function(){function t(){m(this,t)}return A(t,[{key:"isEmpty",value:function(t){return H(t)||!(t instanceof Array)||0===t.length}}]),t}()),qt=function(){function r(){m(this,r)}return A(r,[{key:"join",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return e.reduce(r._join)}}],[{key:"_join",value:function(t,e){return t.endsWith(r.Separator)?(t+e).replace(r.Separator+r.Separator,r.Separator):e.startsWith(r.Separator)?t+e:t+r.Separator+e}}]),r}();qt.Separator="/";var Zt=new qt,Ht=new(function(){function n(){var t=(0<arguments.length&&void 0!==arguments[0]?arguments[0]:{}).enable,e=void 0===t||t;m(this,n),this.enable=e}return A(n,[{key:"log",value:function(t){}},{key:"enable",set:function(e){var n=this;this._enable=e,Object.keys(console).forEach(function(t){return n[t]=e?console[t]:Gt})}}]),n}());function Vt(n){return nt(n).reduce(function(t,e){return t.set(e,n[e])},new Map)}var Kt=function(r){return r instanceof Map||(r=Vt(r)),function(t){return new Proxy(t,{get:function(t,e){return r.has(e)?Reflect.get(t,r.get(e)):Reflect.get(t,e)},set:function(t,e,n){return r.has(e)?Reflect.set(t,r.get(e),n):Reflect.set(t,e,n),!0}})}};var Qt=function(t,e){if(null==t)return{};var n,r,o={},i=Object.keys(t);for(r=0;r<i.length;r++)n=i[r],0<=e.indexOf(n)||(o[n]=t[n]);return o};var Xt=function(t,e){if(null==t)return{};var n,r,o=Qt(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r<i.length;r++)n=i[r],0<=e.indexOf(n)||Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o};function te(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},n=e.before,f=void 0===n?z:n,r=e.after,l=void 0===r?z:r,o=e.paramFn,s=void 0===o?function(t){return[]}:o;return function t(e){for(var n=arguments.length,r=new Array(1<n?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];var i=f.apply(void 0,[e].concat(r)),a=i.child;if(Wt.isEmpty(a))return i;for(var u=a.length,c=0;c<u;c++)a[c]=t.apply(void 0,[a[c]].concat(E(s.apply(void 0,[i].concat(r)))));return l.apply(void 0,[i].concat(r))}(t)}var ee=function(){function t(){m(this,t)}return A(t,null,[{key:"bridge",value:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},e=t.id,n=void 0===e?"id":e,r=t.parentId,o=void 0===r?"parentId":r,i=t.child,a=void 0===i?"child":i,u=t.path,c=void 0===u?"path":u,f=Xt(t,["id","parentId","child","path"]);this.id=n,this.parentId=o,this.child=a,this.path=c,Object.assign(this,f)}}]),t}(),ne=new(function(){function t(){m(this,t)}return A(t,[{key:"bridge",value:function(t){return Kt(Object.assign(new ee,t))}},{key:"bridgeTree",value:function(t,e){return te(t,{before:this.bridge(e)})}},{key:"bridgeList",value:function(t,e){return t.map(this.bridge(e))}}]),t}());t.DateFormatter=It,t.FetchLimiting=T,t.INodeBridge=ee,t.LocalStorageCache=Yt,t.StateMachine=q,t.StringStyleUtil=Mt,t.antiDebug=Jt,t.appends=function(t,e){for(var n in e)t.append(n,e[n]);return t},t.arrayDiffBy=function(t,e){var o=2<arguments.length&&void 0!==arguments[2]?arguments[2]:z,i=new Set(t.map(o)),a=new Set(e.map(o)),n=t.filter(function(t){for(var e=arguments.length,n=new Array(1<e?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return!a.has(o.apply(void 0,[t].concat(n)))}),r=e.filter(function(t){for(var e=arguments.length,n=new Array(1<e?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return!i.has(o.apply(void 0,[t].concat(n)))}),u=new Set(n.map(o)),c=t.filter(function(t){for(var e=arguments.length,n=new Array(1<e?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return!u.has(o.apply(void 0,[t].concat(n)))});return new st(n,r,c)},t.arrayToMap=D,t.arrayValidator=Wt,t.asIterator=R,t.asyncFlatMap=function(t,e){return j.apply(this,arguments)},t.autoIncrement=function(){return pt().next().value},t.blankToNull=et,t.blankToNullField=function(n){var r={};return nt(n).forEach(function(t){var e=n[t];r[t]="string"==typeof e?et(e):e}),r},t.bridge=Kt,t.cacheUtil=$t,t.compose=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return e.reduceRight(function(t,e){return function o(i,a){return function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];var r=Lt.apply(void 0,[i].concat(e));return r instanceof Function&&!0===r._curry?o(r,a):Lt(a,r)}}(e,t)})},t.copyText=function(t){var e=document.createElement("input");document.body.appendChild(e),e.setAttribute("value",t),e.select();var n=document.execCommand("copy");return document.body.removeChild(e),n},t.createElByString=function(t){var e=document.createElement("div");return e.innerHTML=t,e.querySelector("*")},t.curry=Lt,t.dateBetween=function(t,e){return new ct(t,e)},t.dateConstants=ot,t.dateEnhance=function(t){return new ut(t)},t.dateFormat=d,t.dateParse=N,t.debounce=function(o,t){var i,a=2<arguments.length&&void 0!==arguments[2]?arguments[2]:void 0;return new Proxy(t,{apply:function(e,n,r){return new Promise(function(t){i&&clearTimeout(i),i=setTimeout(function(){return t(a=Reflect.apply(e,n,r))},o),setTimeout(function(){return t(a)},o)})}})},t.deepFreeze=function e(t){return H(t)?null:(t instanceof Array?t.forEach(function(t){"object"===yt(t)&&e(t)}):t instanceof Object&&(n=t,nt(n).map(function(t){return n[t]})).forEach(function(t){"object"===yt(t)&&e(t)}),Object.freeze(t));var n},t.deepProxy=function(t){var r={get:function(t,e){Reflect.set(t,e,Reflect.has(t,e)?Reflect.get(t,e):{});var n=Reflect.get(t,e);return"object"===yt(n)?new Proxy(n,r):n}};return new Proxy(t,r)},t.deletes=function(e,t){return t.forEach(function(t){return e.delete(t)}),e},t.deny=function(o){return function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];var r=o.apply(this,e);return r instanceof Promise?r.then(function(t){return!t}):!r}},t.download=i,t.downloadString=function(t){return n.apply(this,arguments)},t.downloadUrl=function(t){return r.apply(this,arguments)},t.emptyAllField=function(t){return nt(t).reduce(function(t,e){return t[e]=null,t},{})},t.emptyFunc=Gt,t.excludeFields=rt,t.excludeFieldsDeep=function n(r){for(var t=arguments.length,o=new Array(1<t?t-1:0),e=1;e<t;e++)o[e-1]=arguments[e];var i=r instanceof Array?r:rt.apply(void 0,[r].concat(o));return nt(r).forEach(function(t){var e=i[t];e instanceof Object&&(r[t]=n.apply(void 0,[e].concat(o)))}),i},t.fetchTimeout=b,t.fill=I,t.filterItems=function(t,e){var o=2<arguments.length&&void 0!==arguments[2]?arguments[2]:z,i=new Set(e.map(o));return t.filter(function(t){for(var e=arguments.length,n=new Array(1<e?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return!i.has(o.apply(void 0,[t].concat(n)))})},t.flatMap=M,t.formDataToArray=function(t){return R(t.entries())},t.format=function(t,n){return n?Object.keys(n).reduce(function(t,e){return t.replace(new RegExp("{".concat(e,"}"),"g"),n[e])},t):t},t.getCookies=function(){return document.cookie.split(";").map(function(t){return t.split("=")}).map(function(t){return[t[0].trim(),t[1].trim()]}).reduce(function(t,e){var n=s(e,2),r=n[0],o=n[1];return t.set(r,o)},new Map)},t.getCusorPostion=U,t.getObjectEntries=_t,t.getObjectKeys=nt,t.getYearWeek=function(t){var e=t.getTime()-new Date(t.getFullYear(),0,1).getTime();return Math.floor(e/864e5/7)},t.groupBy=L,t.insertText=function(t,e){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:U(t),r=t.value;t.value=r.substr(0,n)+e+r.substr(n),B(t,n+e.length)},t.isBlank=function(t){return X.isBlank(t)},t.isEditable=function(t){return t&&(t.isContentEditable||["input","date","datetime","select","textarea"].includes(Y(t.tagName)))},t.isEmpty=Dt,t.isFloat=function(t){return X.isFloat(t)},t.isNullOrUndefined=H,t.isNumber=function(t){return X.isInteger(t)},t.isRange=it,t.lastFocus=function(){return F},t.listToTree=function(n){var t=(1<arguments.length&&void 0!==arguments[1]?arguments[1]:{}).isRoot,r=void 0===t?function(t){return!t.parentId}:t,e=n.reduce(function(t,e){return n.forEach(function(t){e.parentId===t.id&&(t.child=t.child||[]).push(e)}),r(e)&&t.push(e),t},[]),o=e.length;return 0===o?{}:1===o?e[0]:e},t.loadResource=function(t,e){return h.apply(this,arguments)},t.loadScript=function(r){return new Promise(function(t,e){var n=document.createElement("script");n.src=r,n.addEventListener("load",t),n.addEventListener("error",e),document.body.appendChild(n)})},t.logger=Ht,t.mapToObject=function(t){var e={},n=!0,r=!1,o=void 0;try{for(var i,a=t[Symbol.iterator]();!(n=(i=a.next()).done);n=!0){var u=s(i.value,2),c=u[0],f=u[1];e[c]=f}}catch(t){r=!0,o=t}finally{try{n||null==a.return||a.return()}finally{if(r)throw o}}return e},t.nodeBridgeUtil=ne,t.objToFormData=function(t){var e=new FormData;if(t)for(var n in t)if(t.hasOwnProperty(n)){var r=t[n];e.append(n,r)}return e},t.objectToMap=Vt,t.once=ft,t.onceOfSameParam=lt,t.parseUrl=function(t){if(!t)throw new Error("url 不能为空");var e=new RegExp("^((\\w+)://([\\w\\.]*)(:(\\d+))?)(.*)").exec(t),n=new v({url:t,website:e[1],protocol:e[2],domain:e[3],port:e[5],href:e[6]}),r=t.substr(n.website.length),o=r.indexOf("?");return-1===o?n.accessPath=r:(n.accessPath=r.substr(0,o),n.accessPath.endsWith("/")&&(n.accessPath=n.accessPath.substring(0,n.accessPath.length-1)),n.port=n.port||p[n.protocol]||"",n.params=r.substr(o+1).split("&").map(function(t){return t.split("=")}).filter(function(t){return""!==t[0]}).reduce(function(t,e){var n=decodeURIComponent(e[0]),r=decodeURIComponent(1===e.length?"":e[1]),o=t[n];return void 0!==o?(Array.isArray(o)||(t[n]=[o]),t[n].push(r)):t[n]=r,t},{})),n},t.pathUtil=Zt,t.randomInt=function(){var t,e;if(0===arguments.length)throw new Error("非法参数,必须指定最大值");return 1===arguments.length?(t=0,e=arguments.length<=0?void 0:arguments[0]):1<arguments.length&&(t=arguments.length<=0?void 0:arguments[0],e=arguments.length<=1?void 0:arguments[1]),t+Math.floor(Math.random()*(e-t))},t.range=function(t,e){for(var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:1,r=[],o=t;o<e;o+=n)r.push(o);return r},t.readLocal=y,t.removeEl=function(t){return t.parentElement.removeChild(t)},t.removeText=function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:t.selectionStart,n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:t.selectionEnd,r=U(t),o=t.value;t.value=o.substr(0,e)+o.substr(n,o.length),B(t,r)},t.returnItself=z,t.returnReasonableItself=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];var r=e.length;if(0!==r)return 1===r?e[0]:e},t.safeExec=$,t.setCusorPostion=B,t.sets=function(t,e){for(var n in e)t.set(n,e[n]);return t},t.singleModel=G,t.sortBy=function t(e){var o=1<arguments.length&&void 0!==arguments[1]?arguments[1]:z;if(e.length<=1)return e;var n=Math.floor(e.length/2),r=e.slice(),i=r.splice(n,1)[0],a=o(i,n,e),u=L(r,function(t){for(var e=arguments.length,n=new Array(1<e?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return o.apply(void 0,[t].concat(n))<a});return[].concat(E(t(u.get(!0)||[],o)),[i],E(t(u.get(!1)||[],o)))},t.spliceParams=function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};if(!(t instanceof Object))throw new Error("The parameter type must be Object: ".concat(t));return Array.from(Object.entries(t)).reduce(function(t,e){var n=s(e,2),r=n[0],o=n[1];return null==o?t:(o instanceof Date?t+=w(r,d(o,g)):o instanceof Array?t+=o.map(function(t){return w(r,t instanceof Date?d(t,g):t)}).join("&"):t+=w(r,o),t+"&")},"")},t.strToArrayBuffer=function(t){for(var e=new ArrayBuffer(t.length),n=new Uint8Array(e),r=0;r!==t.length;++r)n[r]=255&t.charCodeAt(r);return e},t.strToDate=function(t,e){return N(t,e)},t.stringStyleType=Pt,t.stringValidator=X,t.throttle=function(i,t){var a,u=0;return new Proxy(t,{apply:function(n,r,o){return new Promise(function(t){var e=Date.now();if(i<e-u)return a=Reflect.apply(n,r,o),u=e,void t(a);t(a)})}})},t.timing=Z,t.toLowerCase=Y,t.toObject=function(t,a){var u=2<arguments.length&&void 0!==arguments[2]?arguments[2]:function(t){return t};return t.reduce(function(t,e){for(var n=arguments.length,r=new Array(2<n?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];var i=a.apply(void 0,[e].concat(r));return Reflect.has(t,i)||(t[i]=u.apply(void 0,[e].concat(r))),t},{})},t.toString=function(t){return H(t)?"":t instanceof Date?t.toISOString():t.toString()},t.toUpperCase=tt,t.treeMapping=te,t.treeToList=function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},n=e.bridge,r=void 0===n?z:n,o=e.calcPath,i=void 0!==o&&o,a=[];return te(t,{before:function(t,e){var n=r(t);return i&&(n.path=(e?e+",":"")+n.id),a.push(n),n},paramFn:function(t){return i?[t.path]:[]}}),a},t.uniqueBy=function(t){var i=1<arguments.length&&void 0!==arguments[1]?arguments[1]:function(t){return JSON.stringify(t)},a=new Set;return t.filter(function(t){for(var e=arguments.length,n=new Array(1<e?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];var o=i.apply(void 0,[t].concat(n));return!a.has(o)&&(a.add(o),!0)})},t.wait=P,t.waitResource=function(r){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},e=t.interval,o=void 0===e?100:e,n=t.max,i=void 0===n?10:n,a=0;return new Promise(function(t,e){var n=setInterval(function(){r()&&(clearInterval(n),t()),i<=++a&&(clearInterval(n),e(new Error("等待超时")))},o)})},t.watch=function(e,n){var t=2<arguments.length&&void 0!==arguments[2]?arguments[2]:100,r=$(e),o=setInterval(function(){var t=$(e);r!==t&&(n(t,r),r=t)},t);return function(){return clearInterval(o)}},t.watchEventListener=function(){var o=document.addEventListener,i=EventTarget.prototype.addEventListener,a=document.removeEventListener,u=EventTarget.prototype.removeEventListener,c=[],f=function t(e,n,r,o){m(this,t),this.el=e,this.type=n,this.listener=r,this.useCapture=o};function t(t,e){var n=2<arguments.length&&void 0!==arguments[2]&&arguments[2],r=this===document?o:i;c.push(new f(this,t,e,n)),r.apply(this,arguments)}function e(t){var n=arguments,r=this,o=r===document?a:u,e=c.map(function(t,e){return t.el===r||t.type===n[0]?e:-1}).filter(function(t){return-1!==t});e.forEach(function(t){var e=c[t];o.apply(e.el,[e.type,e.listener,e.useCapture])}),e.sort(function(t,e){return e-t}).forEach(function(t){return c.splice(t,1)})}document.addEventListener=EventTarget.prototype.addEventListener=t,document.removeEventListenerByType=EventTarget.prototype.removeEventListenerByType=e},t.watchObject=function(t,o){var i={get:function(e,n,r){try{return new Proxy(e[n],i)}catch(t){return Reflect.get(e,n,r)}},set:function(t,e,n,r){return o(t,e,n),Reflect.set(t,e,n,r)}};return new Proxy(t,i)},Object.defineProperty(t,"__esModule",{value:!0})});
//# sourceMappingURL=rx-util.min.js.map