Comparing version 3.2.0 to 3.2.1
38
extes.js
@@ -540,20 +540,16 @@ (()=>{ | ||
}); | ||
Object.defineProperty(Date.prototype, 'getUnixTime', { | ||
Object.defineProperty(Date, 'zoneShift', { | ||
writable, configurable, enumerable, | ||
value: function() { | ||
return Math.floor(this.getTime()/1000); | ||
const date = new Date(); | ||
return date.getTimezoneOffset() * 60000; | ||
} | ||
}); | ||
Object.defineProperty(Date.prototype, 'unix', { | ||
configurable, enumerable, | ||
get: function() { | ||
Object.defineProperty(Date.prototype, 'getUnixTime', { | ||
writable, configurable, enumerable, | ||
value: function() { | ||
return Math.floor(this.getTime()/1000); | ||
} | ||
}); | ||
Object.defineProperty(Date.prototype, 'time', { | ||
configurable, enumerable, | ||
get: function() { | ||
return this.getTime(); | ||
} | ||
}); | ||
Object.defineProperty(Date.prototype, 'toLocaleISOString', { | ||
@@ -586,2 +582,22 @@ writable, configurable, enumerable, | ||
}); | ||
// getter | ||
Object.defineProperty(Date.prototype, 'unix', { | ||
configurable, enumerable, | ||
get: function() { | ||
return Math.floor(this.getTime()/1000); | ||
} | ||
}); | ||
Object.defineProperty(Date.prototype, 'time', { | ||
configurable, enumerable, | ||
get: function() { | ||
return this.getTime(); | ||
} | ||
}); | ||
Object.defineProperty(Date.prototype, 'zoneShift', { | ||
configurable, enumerable, | ||
get: function() { | ||
return this.getTimezoneOffset() * 60000; | ||
} | ||
}); | ||
})(); | ||
@@ -588,0 +604,0 @@ (()=>{ |
@@ -1,1 +0,1 @@ | ||
(()=>{"use strict";const e=!0,t=!0,r=!1,n="undefined"!=typeof Buffer;function i(e,t=2,r="0"){let n=t-(e=`${e}`).length;for(;n-- >0;)e=r+e;return e}function a(e){return n&&Buffer.isBuffer(e)?new Uint8Array(e):ArrayBuffer.isView(e)?new Uint8Array(e.buffer):e instanceof ArrayBuffer?new Uint8Array(e):null}(()=>{const n=/^(0x)?([0-9a-fA-F]+)$/,i=/^(0b|0B)?([01]+)$/,o="0123456789abcdef",l={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,b:11,c:12,d:13,e:14,f:15};Object.defineProperty(ArrayBuffer.prototype,"bytes",{configurable:t,enumerable:r,get:function(){return new Uint8Array(this)}}),Object.defineProperty(ArrayBuffer.prototype,"toString",{configurable:t,writable:e,enumerable:r,value:function(e=16,t=!0){const r=new Uint8Array(this);let n="";switch(e){case 16:for(let e=0;e<r.length;e++){const t=r[e];n+=o[(240&t)>>>4]+o[15&t]}break;case 2:for(let e=0;e<r.length;e++){const t=r[e];for(let e=7;e>=0;e--)n+=t>>>e&1?"1":"0"}break;default:throw new RangeError("Unsupported numeric representation!")}return t?n:n.replace(/^0+/,"")}}),Object.defineProperty(ArrayBuffer.prototype,"compare",{configurable:t,writable:e,enumerable:r,value:function(e){if(!(e instanceof ArrayBuffer))throw new TypeError("An ArrayBuffer can only be compared with another ArrayBuffer");const t=new Uint8Array(this),r=new Uint8Array(e),n=Math.max(t.length,r.length);for(let e=0;e<n;e++){const n=t[e]||0,i=r[e]||0;if(n>i)return 1;if(n<i)return-1}return 0}}),Object.defineProperty(ArrayBuffer,"extract",{configurable:t,writable:e,enumerable:r,value:function(e){if("undefined"!=typeof Buffer&&e instanceof Buffer){let t=Buffer.alloc(e.length);return e.copy(t,0),t.buffer}if(ArrayBuffer.isView(e))return e.buffer;if(e instanceof ArrayBuffer)return e;throw new TypeError("Cannot convert given input data into array buffer")}}),Object.defineProperty(ArrayBuffer,"from",{configurable:t,writable:e,enumerable:r,value:function(e,t=null){if("undefined"!=typeof Buffer&&e instanceof Buffer){let t=Buffer.alloc(e.length);return e.copy(t,0),t.buffer}if(ArrayBuffer.isView(e))return e.buffer.slice(0);if(e instanceof ArrayBuffer)return e.slice(0);if(Array.isArray(e)){return new Uint8Array(e).buffer}if("number"==typeof e){let r=null;switch(t){case"int8":r=new Int8Array([e]);break;case"uint8":r=new Uint8Array([e]);break;case"int16":r=new Int16Array([e]);break;case"uint16":r=new Uint16Array([e]);break;case"int32":r=new Int32Array([e]);break;case"int64":{const t=e<0;t&&(e=-e);let n=Math.floor(e/4294967295),i=4294967295&e;t&&(i=1+(~i>>>0),n=~n+Math.floor(i/4294967295)),r=new Uint32Array([i,n]);break}case"uint64":{const t=Math.floor(e/4294967295);r=new Uint32Array([4294967295&e,t]);break}case"float32":r=new Float32Array([e]);break;case"float64":r=new Float64Array([e]);break;case"uint32":default:r=new Uint32Array([e])}return r.buffer}if("string"==typeof e){if("hex"===t){const t=e.match(n);if(!t)throw new RangeError("Input argument is not a valid hex string!");let[,,r]=t;r=r.length%2==0?r.toLowerCase():"0"+r.toLowerCase();const i=new Uint8Array(r.length/2|0);for(let e=0;e<i.length;e++){const t=2*e;i[e]=l[r[t]]<<4|15&l[r[t+1]]}return i.buffer}if("bits"===t){const t=e.match(i);if(!t)throw new RangeError("Input argument is not a valid bit string!");let[,,r]=t;r.length%8!=0&&(r="0".repeat(r.length%8)+r);const n=new Uint8Array(r.length/8|0);for(let e=0;e<n.length;e++){const t=8*e;let i="1"===r[t]?1:0;for(let e=1;e<8;e++)i=i<<1|("1"===r[t+e]?1:0);n[e]=i}return n.buffer}return function(e){if("string"!=typeof e)throw new TypeError("Given input argument must be a js string!");let t=[],r=0;for(;r<e.length;){let n=e.codePointAt(r);0==(4294967168&n)?t.push(n):0==(4294965248&n)?t.push(192|31&n>>6,128|63&n):0==(4294901760&n)?t.push(224|15&n>>12,128|63&n>>6,128|63&n):0==(4292870144&n)&&t.push(240|7&n>>18,128|63&n>>12,128|63&n>>6,128|63&n),r+=n>65535?2:1}return new Uint8Array(t)}(e).buffer}throw new TypeError("Cannot convert given input data into array buffer!")}}),Object.defineProperty(ArrayBuffer,"compare",{configurable:t,writable:e,enumerable:r,value:function(e,t){if(!(e instanceof ArrayBuffer&&t instanceof ArrayBuffer))throw new TypeError("ArrayBuffer.compare only accepts two array buffers!");return e.compare(t)}}),Object.defineProperty(ArrayBuffer,"concat",{configurable:t,writable:e,enumerable:r,value:function(...e){Array.isArray(e[0])&&(e=e[0]);let t=0;for(let r=0;r<e.length;r++){let n=e[r]=a(e[r]);if(!(n instanceof Uint8Array))throw new TypeError("ArrayBuffer.combine accept only ArrayBuffer, TypeArray and DataView.");t+=n.length}const r=new Uint8Array(t);t=0;for(const n of e)r.set(n,t),t+=n.length;return r.buffer}})})(),Object.defineProperty(Array.prototype,"unique",{writable:e,configurable:t,enumerable:r,value:function(){const e=new Set;for(const t of this)e.add(t);return Array.from(e)}}),Object.defineProperty(Array.prototype,"exclude",{writable:e,configurable:t,enumerable:r,value:function(e){Array.isArray(e)||(e=[e]);const t=[];for(const r of this){let n=!1;for(const t of e)if(r===t){n=n||!0;break}n||t.push(r)}return t}}),Object.defineProperty(Array,"concat",{writable:e,configurable:t,enumerable:r,value:function(...e){const t=[];for(const r of e)if(Array.isArray(r))for(const e of r)t.push(e);else t.push(r);return t}}),Object.defineProperty(Array,"intersect",{writable:e,configurable:t,enumerable:r,value:function(...e){let t=e[0]||[];if(!Array.isArray(t))throw new TypeError("Array.intersect only accepts list array arguments!");for(let r=1;r<e.length;r++){const n=e[r];if(!Array.isArray(n))throw new TypeError("Array.intersect only accepts list array arguments!");const i=new Set;for(const e of t)n.indexOf(e)>=0&&i.add(e);t=Array.from(i)}return t}}),"undefined"!=typeof Blob&&Object.defineProperty(Blob.prototype,"arrayBuffer",{configurable:t,writable:e,enumerable:r,value:function(){return new Promise(((e,t)=>{const r=new FileReader;r.onerror=t,r.onload=()=>e(r.result),r.readAsArrayBuffer(this)}))}}),Object.defineProperty(Date,"from",{writable:e,configurable:t,enumerable:r,value:function(...e){if(0===e.length)throw new Error("Date.from expects at least one arguments!");try{return new Date(...e)}catch(e){return null}}}),Object.defineProperty(Date,"present",{configurable:t,enumerable:r,get:()=>new Date}),Object.defineProperty(Date,"unix",{writable:e,configurable:t,enumerable:r,value:function(){return Math.floor(Date.now()/1e3)}}),Object.defineProperty(Date.prototype,"getUnixTime",{writable:e,configurable:t,enumerable:r,value:function(){return Math.floor(this.getTime()/1e3)}}),Object.defineProperty(Date.prototype,"unix",{configurable:t,enumerable:r,get:function(){return Math.floor(this.getTime()/1e3)}}),Object.defineProperty(Date.prototype,"time",{configurable:t,enumerable:r,get:function(){return this.getTime()}}),Object.defineProperty(Date.prototype,"toLocaleISOString",{writable:e,configurable:t,enumerable:r,value:function(e=!0){let t,r=this.getTimezoneOffset();if(0===r)t="Z";else{const e=r>0?"-":"+";r=Math.abs(r);const n=r%60;t=e+i(Math.floor(r/60))+i(n)}const n=e?"."+i(this.getMilliseconds()%1e3,3):"";return this.getFullYear()+"-"+i(this.getMonth()+1)+"-"+i(this.getDate())+"T"+i(this.getHours())+":"+i(this.getMinutes())+":"+i(this.getSeconds())+n+t}}),"undefined"!=typeof Document&&Object.defineProperties(Document.prototype,{parseHTML:{configurable:t,writable:e,enumerable:r,value:function(e){const t=this.implementation.createHTMLDocument().body;if(t.innerHTML=e,0===t.children.length)return null;if(1===t.children.length){const e=t.children[0];return e.remove(),e}const r=Array.prototype.slice.call(t.children,0);for(const e of r)e.remove();return r}}}),(()=>{if("undefined"!=typeof Element){const n=Element.prototype.setAttribute,i=Element.prototype.removeAttribute,a=Element.prototype.setAttributeNS,o=Element.prototype.removeAttributeNS;Object.defineProperties(Element.prototype,{addClass:{configurable:t,enumerable:r,writable:e,value:function(...e){const t=[];for(const r of e)null!=r&&""!==r&&t.push(r);return this.classList.add(...t),this}},removeClass:{configurable:t,enumerable:r,writable:e,value:function(...e){const t=[];for(const r of e)null!=r&&""!==r&&t.push(r);return this.classList.remove(...t),this}},setAttribute:{configurable:t,enumerable:r,writable:e,value:function(e,t){return arguments.length<2&&(t=""),n.call(this,e,t),this}},removeAttribute:{configurable:t,enumerable:r,writable:e,value:function(...e){return i.apply(this,e),this}},setAttributeNS:{configurable:t,enumerable:r,writable:e,value:function(...e){return a.apply(this,e),this}},removeAttributeNS:{configurable:t,enumerable:r,writable:e,value:function(...e){return o.apply(this,e),this}}})}})(),"undefined"!=typeof Error&&(Object.defineProperty(Error.prototype,"stack_trace",{get:function(){return this.stack?this.stack.split(/\r\n|\n/g).map((e=>e.trim())):null},enumerable:r,configurable:t}),Object.defineProperty(Error,"trap",{writable:e,configurable:t,enumerable:r,value:function(e,t){const r=Array.prototype.slice.call(arguments,0);let n;try{n=e()}catch(e){return r.length<2?e:t}return n instanceof Promise?n.catch((e=>r.length<2?e:t)):n}}),Object.defineProperty(Error,"trapper",{writable:e,configurable:t,enumerable:r,value:function(e,t){return function(...r){let n;try{n=e(...r)}catch(e){return void t(e)}return n instanceof Promise?n.catch((e=>t(e))):n}}})),"undefined"!=typeof EventTarget&&(Object.defineProperty(EventTarget.prototype,"on",{configurable:t,writable:e,enumerable:r,value:function(e,t){const r=[],n=e.split(",");for(let e of n)e=e.trim(),r.indexOf(e)>=0||(r.push(e),this.addEventListener(e,t));return this}}),Object.defineProperty(EventTarget.prototype,"off",{configurable:t,writable:e,enumerable:r,value:function(e,t){const r=e.split(",");for(let e of r)e=e.trim(),this.removeEventListener(e,t);return this}}),Object.defineProperty(EventTarget.prototype,"emit",{configurable:t,writable:e,enumerable:r,value:function(e,t={}){const{bubbles:r,cancelable:n,composed:i,...a}=t;if("string"==typeof e&&(e=new Event(e,{bubbles:!!r,cancelable:!!n,composed:!!i})),!(e instanceof Event))throw new TypeError("Argument 1 accepts only string or Event instance!");Object.assign(e,a),this.dispatchEvent(e)}})),(()=>{if("undefined"!=typeof Error){class n extends Error{constructor(e,...t){super(e,...t),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor);const r=Date.now();Object.defineProperties(this,{name:{configurable:!1,writable:!1,enumerable:!1,value:this.constructor.name},time:{configurable:!1,writable:!1,enumerable:!1,value:Math.floor(r/1e3)},time_milli:{configurable:!1,writable:!1,enumerable:!1,value:r}})}}class i extends n{constructor(e,t=null,...r){if(Object(e)!==e)throw new TypeError("IndexedError constructor accepts only objects!");const{code:n,key:i,message:a=null,msg:o=null}=e;if("number"!=typeof n||"string"!=typeof i)throw new TypeError("IndexedError error info object must contains a numeric `code` field and a string `key` field");null!==a?r.unshift(""+a):null!==o?r.unshift(""+o):r.unshift(""),super(...r),Object.defineProperties(this,{code:{configurable:!1,writable:!1,enumerable:!1,value:n},key:{configurable:!1,writable:!1,enumerable:!1,value:i},detail:{configurable:!1,writable:!1,enumerable:!1,value:t}})}toJSON(){const e={code:this.code,key:this.key,msg:this.message,detail:void 0,time:this.time,time_milli:this.time_milli};return null!==this.detail&&void 0!==this.detail&&(Array.isArray(this.detail)?e.detail=this.detail.slice(0):Object(this.detail)===this.detail?e.detail=Object.assign({},this.detail):e.detail=this.detail),e}}Object.defineProperties(Error,{EError:{configurable:t,writable:e,enumerable:r,value:n},IndexedError:{configurable:t,writable:e,enumerable:r,value:i}})}})(),(()=>{const n=new WeakMap,i={},a={};function o(e,t){const r=Array.prototype.slice.call(arguments,0);return r[0]=e?i:a,l.call(...r)}function l(r){const i=n.get(this),a={async:i.async,funcs:i.funcs.slice(0)};if(arguments.length>0){let e;Array.isArray(r)||(r=[r]);for(let t=0;t<r.length;t++)a.funcs.push("function"==typeof(e=r[t])?e:()=>e)}const o={};n.set(o,a);const c=u.bind(o);return c.chain=l.bind(o),Object.defineProperty(c,"data",{configurable:t,enumerable:!0,writable:e,value:o}),c}function u(...e){const{async:t,funcs:r}=n.get(this);let i;if(this.current_call={},t)return Promise.resolve().then((async()=>{for(const t of r)if(i=await t.call(this,...e,i),!1===i)break;return i}));for(const t of r)if(i=t.call(this,...e,i),!1===i)break;return i}n.set(i,{async:!0,funcs:[]}),n.set(a,{async:!1,funcs:[]}),Object.defineProperty(Function,"sequential",{configurable:t,writable:e,enumerable:r,value:o.bind(null,!1)}),Object.defineProperty(Function.sequential,"async",{configurable:!1,writable:!1,enumerable:!0,value:o.bind(null,!0)})})(),"undefined"!=typeof HTMLElement&&Object.defineProperties(HTMLElement.prototype,{setData:{configurable:t,writable:e,enumerable:r,value:function(e,t){if(Object(e)===e)for(const t in e)this.dataset[t]=e[t];else this.dataset[e]=t;return this}},getData:{configurable:t,writable:e,enumerable:r,value:function(e){return this.dataset[e]}},removeData:{configurable:t,writable:e,enumerable:r,value:function(...e){for(const t of e)delete this.dataset[t];return this}},setContentHtml:{configurable:t,writable:e,enumerable:r,value:function(e){return this.innerHTML=e,this}}}),"undefined"!=typeof HTMLInputElement&&Object.defineProperty(HTMLInputElement.prototype,"setValue",{configurable:t,writable:e,enumerable:r,value:function(e){return this.value=e,this}}),"undefined"!=typeof Node&&(Object.defineProperty(Node.prototype,"prependChild",{configurable:t,writable:e,enumerable:r,value:function(e){return this.insertBefore(e,this.children[0]||null),this instanceof DocumentFragment?new DocumentFragment:e}}),Object.defineProperty(Node.prototype,"insertNeighborBefore",{configurable:t,writable:e,enumerable:r,value:function(e){if(!this.parentNode)throw new RangeError("Reference element is currently in detached mode! No way to add neighbors!");return this.parentNode.insertBefore(e,this),this instanceof DocumentFragment?new DocumentFragment:e}}),Object.defineProperty(Node.prototype,"insertNeighborAfter",{configurable:t,writable:e,enumerable:r,value:function(e){if(!this.parentNode)throw new RangeError("Reference element is currently in detached mode! No way to add neighbors!");return this.parentNode.insertBefore(e,this.nextSibling),this instanceof DocumentFragment?new DocumentFragment:e}}),Object.defineProperty(Node.prototype,"setContentText",{configurable:t,writable:e,enumerable:r,value:function(e){return this.textContent=e,this}})),(()=>{const n=Object.defineProperty,i=Object.defineProperties;function a(e,t=!1){const r=typeof e;switch(r){case"number":case"string":case"function":case"boolean":case"undefined":case"symbol":return r}return null===e?"null":e instanceof String?"string":e instanceof Number?"number":e instanceof Boolean?"boolean":Array.isArray(e)?"array":t?e instanceof ArrayBuffer?"array-buffer":e instanceof DataView?"data-view":e instanceof Uint8Array?"uint8-array":e instanceof Uint8ClampedArray?"uint8-clamped-array":e instanceof Int8Array?"int8-array":e instanceof Uint16Array?"uint16-array":e instanceof Int16Array?"int16-array":e instanceof Uint32Array?"uint32-array":e instanceof Int32Array?"int32-array":e instanceof Float32Array?"float32-array":e instanceof Float64Array?"float64-array":e instanceof Map?"map":e instanceof WeakMap?"weak-map":e instanceof Set?"set":e instanceof WeakSet?"weak-set":e instanceof RegExp?"regexp":e instanceof Promise?"promise":"object":"object"}n(Object,"defineProperty",{writable:e,configurable:t,enumerable:r,value:function(e,t,r){return n(e,t,r),e}}),n(Object,"defineProperties",{writable:e,configurable:t,enumerable:r,value:function(e,t){return i(e,t),e}}),Object.defineProperty(Object,"merge",{writable:e,configurable:t,enumerable:r,value:function e(t,r){if(Object(t)!==t)throw new Error("Given target is not an object");if(Object(r)!==r)throw new Error("Given source is not an object");for(const n in r){if(r.hasOwnProperty&&!r.hasOwnProperty(n)||void 0===r[n])continue;const i=t[n],o=r[n],l=a(i),u=a(o);"object"===l&&"object"===u?e(i,o):t instanceof Map?t.set(n,o):t[n]=o}return t}}),Object.defineProperty(Object,"typeOf",{writable:e,configurable:t,enumerable:r,value:a}),Object.defineProperty(Object.prototype,"_decorate",{writable:e,configurable:t,enumerable:r,value:function(e,...t){return"function"==typeof e&&e.call(this,...t),this}})})(),(()=>{const i=Promise.prototype.then,a=Promise.prototype.catch,o=Promise.prototype.finally;function l(e,t){for(const r of Object.keys(t))e[r]=t[r];return e}Object.defineProperties(Promise.prototype,{then:{writable:e,configurable:t,enumerable:r,value:function(...e){return l(i.call(this,...e),this)}},catch:{writable:e,configurable:t,enumerable:r,value:function(...e){return l(a.call(this,...e),this)}},finally:{writable:e,configurable:t,enumerable:r,value:function(...e){return l(o.call(this,...e),this)}},guard:{writable:e,configurable:t,enumerable:r,value:function(){return l(a.call(this,(e=>(setTimeout((()=>{if(n)throw e;{const t=new Event("unhandledRejection");t.error=e,window.dispatchEvent(t)}}),0),e))),this)}}}),Object.defineProperties(Promise,{wait:{writable:e,configurable:t,enumerable:r,value:function(e=[]){Array.isArray(e)||(e=[e]);if(0===e.length)return Promise.resolve([]);return new Promise(((t,r)=>{let n=[],i=0,a=!0;for(let o=0;o<e.length;o++){let l={resolved:!0,seq:o,result:null};n.push(l),Promise.resolve(e[o]).then((e=>{a=(l.resolved=!0)&&a,l.result=e}),(e=>{a=(l.resolved=!1)&&a,l.result=e})).then((()=>{i++,e.length===i&&(a?t:r)(n)}))}}))}},create:{writable:e,configurable:t,enumerable:r,value:function(){let e=null,t=null;const r=new Promise(((r,n)=>{e=r,t=n}));return r.resolve=e,r.reject=t,r.promise=r,r}}})})(),(()=>{const n=/(\w)(\w*)(\W*)/g,i=(e,t,r,n,i,a)=>`${t.toUpperCase()}${r.toLowerCase()}${n}`;function o(e,...t){return this instanceof o?(this.strings=e,void(this.fields=t)):new o(e,...t)}o.prototype={[Symbol.iterator](){const e=this.strings.slice(0).reverse(),t=this.fields.slice(0).reverse();let r=0;return{next:()=>{if(0===e.length)return{done:!0};let n;return n=r%2==0?e.pop():t.pop(),r+=1,{value:n}}}},toString(){let e="";for(const t of this)e+=""+t;return e}},Object.defineProperties(String.prototype,{charCount:{configurable:t,enumerable:r,get:function(){let e=0,t=0;for(;e<this.length;){t++,e+=this.codePointAt(e)>65535?2:1}return t}},upperCase:{configurable:t,enumerable:r,get:function(){return this.toUpperCase()}},localeUpperCase:{configurable:t,enumerable:r,get:function(){return this.toLocaleUpperCase()}},lowerCase:{configurable:t,enumerable:r,get:function(){return this.toLowerCase()}},localeLowerCase:{configurable:t,enumerable:r,get:function(){return this.toLocaleLowerCase()}},toCamelCase:{configurable:t,enumerable:r,value:function(){return this.replace(n,i)}},camelCase:{configurable:t,enumerable:r,get:function(){return this.replace(n,i)}},pull:{configurable:t,enumerable:r,writable:e,value:function(e="",t=!0){if("string"!=typeof e)throw new TypeError("Given token must be a string");const r=this.length;if(0===r)return["",""];if(""===e)return t?[this[0],this.substring(1)]:[this.substring(0,r-1),this[r-1]];if(t){const t=this.indexOf(e,e.length);return t<0?[this.substring(0),""]:[this.substring(0,t),this.substring(t)]}{const t=this.lastIndexOf(e);return t<0?["",this.substring(0)]:[this.substring(0,t),this.substring(t)]}}},pop:{configurable:t,enumerable:r,writable:e,value:function(e=""){return this.pull(e,!0)}},shift:{configurable:t,enumerable:r,writable:e,value:function(e=""){return this.pull(e,!1)}}}),Object.defineProperties(String,{encodeRegExpString:{writable:e,configurable:t,enumerable:r,value:function(e=""){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}},template:{writable:e,configurable:t,enumerable:r,value:o},from:{writable:e,configurable:t,enumerable:r,value:e=>{if("string"==typeof e)return e;const t=a(e);return null!==t?function(e){if(e instanceof ArrayBuffer&&(e=new Uint8Array(e)),!(e instanceof Uint8Array))throw new TypeError("Given input must be an Uint8Array contains UTF8 encoded value!");let t=e,r=[],n=0;for(;n<t.length;){let e=255&t[n];0==(128&e)?(r.push(e),n+=1):192==(224&e)?(e=(31&t[n])<<6|63&t[n+1],r.push(e),n+=2):224==(240&e)?(e=(15&t[n])<<12|(63&t[n+1])<<6|63&t[n+2],r.push(e),n+=3):240==(248&e)?(e=(7&t[n])<<18|(63&t[n+1])<<12|(63&t[n+2])<<6|63&t[n+3],r.push(e),n+=4):n+=1}let i="";for(;r.length>0;){const e=r.splice(0,100);i+=String.fromCodePoint(...e)}return i}(t):""+e}}})})(),(()=>{function n(){let e=null,t=!1,r=null;const n=(n,a=0,...o)=>{e={cb:n,delay:a,args:o},t||(r&&(clearTimeout(r),r=null),i())};return n.clear=()=>{e=null,r&&(clearTimeout(r),r=null)},n;function i(){if(!e)return;let{cb:n,delay:a,args:o}=e;r=setTimeout((()=>{t=!0,Promise.resolve(n(...o)).then((()=>{t=!1,r=null,i()}),(n=>{throw t=!1,r=null,e=null,n}))}),a),e=null}}Object.defineProperty(setTimeout,"create",{writable:e,configurable:t,enumerable:r,value:n}),Object.defineProperty(setTimeout,"idle",{writable:e,configurable:t,enumerable:r,value:function(e=0){return new Promise((t=>{setTimeout(t,e)}))}}),Object.defineProperty(setInterval,"create",{writable:e,configurable:t,enumerable:r,value:function(){const e=n(),t=(t,r=0,...n)=>{const i=async()=>{e(i,r);try{await t(...n)}catch(t){throw e.clear(),t}};e(i,r,...n)};return t.clear=()=>{e.clear()},t}})})(),(()=>{const n=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],i=[DataView,...n],a=new WeakMap;for(const n of i)a.set(n,{from:n.from,toString:n.toString}),Object.defineProperty(n,"from",{value:function(e){const t=a.get(n).from;return e instanceof ArrayBuffer?new n(e):t.call(n,e)},configurable:t,enumerable:r,writable:e}),Object.defineProperty(n.prototype,"toString",{value:function(...e){const t=a.get(n).toString;return 0===e.length?t.call(this,...e):this.buffer.toString(...e)},configurable:t,enumerable:r,writable:e})})()})(); | ||
(()=>{"use strict";const e=!0,t=!0,r=!1,n="undefined"!=typeof Buffer;function i(e,t=2,r="0"){let n=t-(e=`${e}`).length;for(;n-- >0;)e=r+e;return e}function a(e){return n&&Buffer.isBuffer(e)?new Uint8Array(e):ArrayBuffer.isView(e)?new Uint8Array(e.buffer):e instanceof ArrayBuffer?new Uint8Array(e):null}(()=>{const n=/^(0x)?([0-9a-fA-F]+)$/,i=/^(0b|0B)?([01]+)$/,o="0123456789abcdef",l={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,b:11,c:12,d:13,e:14,f:15};Object.defineProperty(ArrayBuffer.prototype,"bytes",{configurable:t,enumerable:r,get:function(){return new Uint8Array(this)}}),Object.defineProperty(ArrayBuffer.prototype,"toString",{configurable:t,writable:e,enumerable:r,value:function(e=16,t=!0){const r=new Uint8Array(this);let n="";switch(e){case 16:for(let e=0;e<r.length;e++){const t=r[e];n+=o[(240&t)>>>4]+o[15&t]}break;case 2:for(let e=0;e<r.length;e++){const t=r[e];for(let e=7;e>=0;e--)n+=t>>>e&1?"1":"0"}break;default:throw new RangeError("Unsupported numeric representation!")}return t?n:n.replace(/^0+/,"")}}),Object.defineProperty(ArrayBuffer.prototype,"compare",{configurable:t,writable:e,enumerable:r,value:function(e){if(!(e instanceof ArrayBuffer))throw new TypeError("An ArrayBuffer can only be compared with another ArrayBuffer");const t=new Uint8Array(this),r=new Uint8Array(e),n=Math.max(t.length,r.length);for(let e=0;e<n;e++){const n=t[e]||0,i=r[e]||0;if(n>i)return 1;if(n<i)return-1}return 0}}),Object.defineProperty(ArrayBuffer,"extract",{configurable:t,writable:e,enumerable:r,value:function(e){if("undefined"!=typeof Buffer&&e instanceof Buffer){let t=Buffer.alloc(e.length);return e.copy(t,0),t.buffer}if(ArrayBuffer.isView(e))return e.buffer;if(e instanceof ArrayBuffer)return e;throw new TypeError("Cannot convert given input data into array buffer")}}),Object.defineProperty(ArrayBuffer,"from",{configurable:t,writable:e,enumerable:r,value:function(e,t=null){if("undefined"!=typeof Buffer&&e instanceof Buffer){let t=Buffer.alloc(e.length);return e.copy(t,0),t.buffer}if(ArrayBuffer.isView(e))return e.buffer.slice(0);if(e instanceof ArrayBuffer)return e.slice(0);if(Array.isArray(e)){return new Uint8Array(e).buffer}if("number"==typeof e){let r=null;switch(t){case"int8":r=new Int8Array([e]);break;case"uint8":r=new Uint8Array([e]);break;case"int16":r=new Int16Array([e]);break;case"uint16":r=new Uint16Array([e]);break;case"int32":r=new Int32Array([e]);break;case"int64":{const t=e<0;t&&(e=-e);let n=Math.floor(e/4294967295),i=4294967295&e;t&&(i=1+(~i>>>0),n=~n+Math.floor(i/4294967295)),r=new Uint32Array([i,n]);break}case"uint64":{const t=Math.floor(e/4294967295);r=new Uint32Array([4294967295&e,t]);break}case"float32":r=new Float32Array([e]);break;case"float64":r=new Float64Array([e]);break;case"uint32":default:r=new Uint32Array([e])}return r.buffer}if("string"==typeof e){if("hex"===t){const t=e.match(n);if(!t)throw new RangeError("Input argument is not a valid hex string!");let[,,r]=t;r=r.length%2==0?r.toLowerCase():"0"+r.toLowerCase();const i=new Uint8Array(r.length/2|0);for(let e=0;e<i.length;e++){const t=2*e;i[e]=l[r[t]]<<4|15&l[r[t+1]]}return i.buffer}if("bits"===t){const t=e.match(i);if(!t)throw new RangeError("Input argument is not a valid bit string!");let[,,r]=t;r.length%8!=0&&(r="0".repeat(r.length%8)+r);const n=new Uint8Array(r.length/8|0);for(let e=0;e<n.length;e++){const t=8*e;let i="1"===r[t]?1:0;for(let e=1;e<8;e++)i=i<<1|("1"===r[t+e]?1:0);n[e]=i}return n.buffer}return function(e){if("string"!=typeof e)throw new TypeError("Given input argument must be a js string!");let t=[],r=0;for(;r<e.length;){let n=e.codePointAt(r);0==(4294967168&n)?t.push(n):0==(4294965248&n)?t.push(192|31&n>>6,128|63&n):0==(4294901760&n)?t.push(224|15&n>>12,128|63&n>>6,128|63&n):0==(4292870144&n)&&t.push(240|7&n>>18,128|63&n>>12,128|63&n>>6,128|63&n),r+=n>65535?2:1}return new Uint8Array(t)}(e).buffer}throw new TypeError("Cannot convert given input data into array buffer!")}}),Object.defineProperty(ArrayBuffer,"compare",{configurable:t,writable:e,enumerable:r,value:function(e,t){if(!(e instanceof ArrayBuffer&&t instanceof ArrayBuffer))throw new TypeError("ArrayBuffer.compare only accepts two array buffers!");return e.compare(t)}}),Object.defineProperty(ArrayBuffer,"concat",{configurable:t,writable:e,enumerable:r,value:function(...e){Array.isArray(e[0])&&(e=e[0]);let t=0;for(let r=0;r<e.length;r++){let n=e[r]=a(e[r]);if(!(n instanceof Uint8Array))throw new TypeError("ArrayBuffer.combine accept only ArrayBuffer, TypeArray and DataView.");t+=n.length}const r=new Uint8Array(t);t=0;for(const n of e)r.set(n,t),t+=n.length;return r.buffer}})})(),Object.defineProperty(Array.prototype,"unique",{writable:e,configurable:t,enumerable:r,value:function(){const e=new Set;for(const t of this)e.add(t);return Array.from(e)}}),Object.defineProperty(Array.prototype,"exclude",{writable:e,configurable:t,enumerable:r,value:function(e){Array.isArray(e)||(e=[e]);const t=[];for(const r of this){let n=!1;for(const t of e)if(r===t){n=n||!0;break}n||t.push(r)}return t}}),Object.defineProperty(Array,"concat",{writable:e,configurable:t,enumerable:r,value:function(...e){const t=[];for(const r of e)if(Array.isArray(r))for(const e of r)t.push(e);else t.push(r);return t}}),Object.defineProperty(Array,"intersect",{writable:e,configurable:t,enumerable:r,value:function(...e){let t=e[0]||[];if(!Array.isArray(t))throw new TypeError("Array.intersect only accepts list array arguments!");for(let r=1;r<e.length;r++){const n=e[r];if(!Array.isArray(n))throw new TypeError("Array.intersect only accepts list array arguments!");const i=new Set;for(const e of t)n.indexOf(e)>=0&&i.add(e);t=Array.from(i)}return t}}),"undefined"!=typeof Blob&&Object.defineProperty(Blob.prototype,"arrayBuffer",{configurable:t,writable:e,enumerable:r,value:function(){return new Promise(((e,t)=>{const r=new FileReader;r.onerror=t,r.onload=()=>e(r.result),r.readAsArrayBuffer(this)}))}}),Object.defineProperty(Date,"from",{writable:e,configurable:t,enumerable:r,value:function(...e){if(0===e.length)throw new Error("Date.from expects at least one arguments!");try{return new Date(...e)}catch(e){return null}}}),Object.defineProperty(Date,"present",{configurable:t,enumerable:r,get:()=>new Date}),Object.defineProperty(Date,"unix",{writable:e,configurable:t,enumerable:r,value:function(){return Math.floor(Date.now()/1e3)}}),Object.defineProperty(Date,"zoneShift",{writable:e,configurable:t,enumerable:r,value:function(){return 6e4*(new Date).getTimezoneOffset()}}),Object.defineProperty(Date.prototype,"getUnixTime",{writable:e,configurable:t,enumerable:r,value:function(){return Math.floor(this.getTime()/1e3)}}),Object.defineProperty(Date.prototype,"toLocaleISOString",{writable:e,configurable:t,enumerable:r,value:function(e=!0){let t,r=this.getTimezoneOffset();if(0===r)t="Z";else{const e=r>0?"-":"+";r=Math.abs(r);const n=r%60;t=e+i(Math.floor(r/60))+i(n)}const n=e?"."+i(this.getMilliseconds()%1e3,3):"";return this.getFullYear()+"-"+i(this.getMonth()+1)+"-"+i(this.getDate())+"T"+i(this.getHours())+":"+i(this.getMinutes())+":"+i(this.getSeconds())+n+t}}),Object.defineProperty(Date.prototype,"unix",{configurable:t,enumerable:r,get:function(){return Math.floor(this.getTime()/1e3)}}),Object.defineProperty(Date.prototype,"time",{configurable:t,enumerable:r,get:function(){return this.getTime()}}),Object.defineProperty(Date.prototype,"zoneShift",{configurable:t,enumerable:r,get:function(){return 6e4*this.getTimezoneOffset()}}),"undefined"!=typeof Document&&Object.defineProperties(Document.prototype,{parseHTML:{configurable:t,writable:e,enumerable:r,value:function(e){const t=this.implementation.createHTMLDocument().body;if(t.innerHTML=e,0===t.children.length)return null;if(1===t.children.length){const e=t.children[0];return e.remove(),e}const r=Array.prototype.slice.call(t.children,0);for(const e of r)e.remove();return r}}}),(()=>{if("undefined"!=typeof Element){const n=Element.prototype.setAttribute,i=Element.prototype.removeAttribute,a=Element.prototype.setAttributeNS,o=Element.prototype.removeAttributeNS;Object.defineProperties(Element.prototype,{addClass:{configurable:t,enumerable:r,writable:e,value:function(...e){const t=[];for(const r of e)null!=r&&""!==r&&t.push(r);return this.classList.add(...t),this}},removeClass:{configurable:t,enumerable:r,writable:e,value:function(...e){const t=[];for(const r of e)null!=r&&""!==r&&t.push(r);return this.classList.remove(...t),this}},setAttribute:{configurable:t,enumerable:r,writable:e,value:function(e,t){return arguments.length<2&&(t=""),n.call(this,e,t),this}},removeAttribute:{configurable:t,enumerable:r,writable:e,value:function(...e){return i.apply(this,e),this}},setAttributeNS:{configurable:t,enumerable:r,writable:e,value:function(...e){return a.apply(this,e),this}},removeAttributeNS:{configurable:t,enumerable:r,writable:e,value:function(...e){return o.apply(this,e),this}}})}})(),"undefined"!=typeof Error&&(Object.defineProperty(Error.prototype,"stack_trace",{get:function(){return this.stack?this.stack.split(/\r\n|\n/g).map((e=>e.trim())):null},enumerable:r,configurable:t}),Object.defineProperty(Error,"trap",{writable:e,configurable:t,enumerable:r,value:function(e,t){const r=Array.prototype.slice.call(arguments,0);let n;try{n=e()}catch(e){return r.length<2?e:t}return n instanceof Promise?n.catch((e=>r.length<2?e:t)):n}}),Object.defineProperty(Error,"trapper",{writable:e,configurable:t,enumerable:r,value:function(e,t){return function(...r){let n;try{n=e(...r)}catch(e){return void t(e)}return n instanceof Promise?n.catch((e=>t(e))):n}}})),"undefined"!=typeof EventTarget&&(Object.defineProperty(EventTarget.prototype,"on",{configurable:t,writable:e,enumerable:r,value:function(e,t){const r=[],n=e.split(",");for(let e of n)e=e.trim(),r.indexOf(e)>=0||(r.push(e),this.addEventListener(e,t));return this}}),Object.defineProperty(EventTarget.prototype,"off",{configurable:t,writable:e,enumerable:r,value:function(e,t){const r=e.split(",");for(let e of r)e=e.trim(),this.removeEventListener(e,t);return this}}),Object.defineProperty(EventTarget.prototype,"emit",{configurable:t,writable:e,enumerable:r,value:function(e,t={}){const{bubbles:r,cancelable:n,composed:i,...a}=t;if("string"==typeof e&&(e=new Event(e,{bubbles:!!r,cancelable:!!n,composed:!!i})),!(e instanceof Event))throw new TypeError("Argument 1 accepts only string or Event instance!");Object.assign(e,a),this.dispatchEvent(e)}})),(()=>{if("undefined"!=typeof Error){class n extends Error{constructor(e,...t){super(e,...t),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor);const r=Date.now();Object.defineProperties(this,{name:{configurable:!1,writable:!1,enumerable:!1,value:this.constructor.name},time:{configurable:!1,writable:!1,enumerable:!1,value:Math.floor(r/1e3)},time_milli:{configurable:!1,writable:!1,enumerable:!1,value:r}})}}class i extends n{constructor(e,t=null,...r){if(Object(e)!==e)throw new TypeError("IndexedError constructor accepts only objects!");const{code:n,key:i,message:a=null,msg:o=null}=e;if("number"!=typeof n||"string"!=typeof i)throw new TypeError("IndexedError error info object must contains a numeric `code` field and a string `key` field");null!==a?r.unshift(""+a):null!==o?r.unshift(""+o):r.unshift(""),super(...r),Object.defineProperties(this,{code:{configurable:!1,writable:!1,enumerable:!1,value:n},key:{configurable:!1,writable:!1,enumerable:!1,value:i},detail:{configurable:!1,writable:!1,enumerable:!1,value:t}})}toJSON(){const e={code:this.code,key:this.key,msg:this.message,detail:void 0,time:this.time,time_milli:this.time_milli};return null!==this.detail&&void 0!==this.detail&&(Array.isArray(this.detail)?e.detail=this.detail.slice(0):Object(this.detail)===this.detail?e.detail=Object.assign({},this.detail):e.detail=this.detail),e}}Object.defineProperties(Error,{EError:{configurable:t,writable:e,enumerable:r,value:n},IndexedError:{configurable:t,writable:e,enumerable:r,value:i}})}})(),(()=>{const n=new WeakMap,i={},a={};function o(e,t){const r=Array.prototype.slice.call(arguments,0);return r[0]=e?i:a,l.call(...r)}function l(r){const i=n.get(this),a={async:i.async,funcs:i.funcs.slice(0)};if(arguments.length>0){let e;Array.isArray(r)||(r=[r]);for(let t=0;t<r.length;t++)a.funcs.push("function"==typeof(e=r[t])?e:()=>e)}const o={};n.set(o,a);const c=u.bind(o);return c.chain=l.bind(o),Object.defineProperty(c,"data",{configurable:t,enumerable:!0,writable:e,value:o}),c}function u(...e){const{async:t,funcs:r}=n.get(this);let i;if(this.current_call={},t)return Promise.resolve().then((async()=>{for(const t of r)if(i=await t.call(this,...e,i),!1===i)break;return i}));for(const t of r)if(i=t.call(this,...e,i),!1===i)break;return i}n.set(i,{async:!0,funcs:[]}),n.set(a,{async:!1,funcs:[]}),Object.defineProperty(Function,"sequential",{configurable:t,writable:e,enumerable:r,value:o.bind(null,!1)}),Object.defineProperty(Function.sequential,"async",{configurable:!1,writable:!1,enumerable:!0,value:o.bind(null,!0)})})(),"undefined"!=typeof HTMLElement&&Object.defineProperties(HTMLElement.prototype,{setData:{configurable:t,writable:e,enumerable:r,value:function(e,t){if(Object(e)===e)for(const t in e)this.dataset[t]=e[t];else this.dataset[e]=t;return this}},getData:{configurable:t,writable:e,enumerable:r,value:function(e){return this.dataset[e]}},removeData:{configurable:t,writable:e,enumerable:r,value:function(...e){for(const t of e)delete this.dataset[t];return this}},setContentHtml:{configurable:t,writable:e,enumerable:r,value:function(e){return this.innerHTML=e,this}}}),"undefined"!=typeof HTMLInputElement&&Object.defineProperty(HTMLInputElement.prototype,"setValue",{configurable:t,writable:e,enumerable:r,value:function(e){return this.value=e,this}}),"undefined"!=typeof Node&&(Object.defineProperty(Node.prototype,"prependChild",{configurable:t,writable:e,enumerable:r,value:function(e){return this.insertBefore(e,this.children[0]||null),this instanceof DocumentFragment?new DocumentFragment:e}}),Object.defineProperty(Node.prototype,"insertNeighborBefore",{configurable:t,writable:e,enumerable:r,value:function(e){if(!this.parentNode)throw new RangeError("Reference element is currently in detached mode! No way to add neighbors!");return this.parentNode.insertBefore(e,this),this instanceof DocumentFragment?new DocumentFragment:e}}),Object.defineProperty(Node.prototype,"insertNeighborAfter",{configurable:t,writable:e,enumerable:r,value:function(e){if(!this.parentNode)throw new RangeError("Reference element is currently in detached mode! No way to add neighbors!");return this.parentNode.insertBefore(e,this.nextSibling),this instanceof DocumentFragment?new DocumentFragment:e}}),Object.defineProperty(Node.prototype,"setContentText",{configurable:t,writable:e,enumerable:r,value:function(e){return this.textContent=e,this}})),(()=>{const n=Object.defineProperty,i=Object.defineProperties;function a(e,t=!1){const r=typeof e;switch(r){case"number":case"string":case"function":case"boolean":case"undefined":case"symbol":return r}return null===e?"null":e instanceof String?"string":e instanceof Number?"number":e instanceof Boolean?"boolean":Array.isArray(e)?"array":t?e instanceof ArrayBuffer?"array-buffer":e instanceof DataView?"data-view":e instanceof Uint8Array?"uint8-array":e instanceof Uint8ClampedArray?"uint8-clamped-array":e instanceof Int8Array?"int8-array":e instanceof Uint16Array?"uint16-array":e instanceof Int16Array?"int16-array":e instanceof Uint32Array?"uint32-array":e instanceof Int32Array?"int32-array":e instanceof Float32Array?"float32-array":e instanceof Float64Array?"float64-array":e instanceof Map?"map":e instanceof WeakMap?"weak-map":e instanceof Set?"set":e instanceof WeakSet?"weak-set":e instanceof RegExp?"regexp":e instanceof Promise?"promise":"object":"object"}n(Object,"defineProperty",{writable:e,configurable:t,enumerable:r,value:function(e,t,r){return n(e,t,r),e}}),n(Object,"defineProperties",{writable:e,configurable:t,enumerable:r,value:function(e,t){return i(e,t),e}}),Object.defineProperty(Object,"merge",{writable:e,configurable:t,enumerable:r,value:function e(t,r){if(Object(t)!==t)throw new Error("Given target is not an object");if(Object(r)!==r)throw new Error("Given source is not an object");for(const n in r){if(r.hasOwnProperty&&!r.hasOwnProperty(n)||void 0===r[n])continue;const i=t[n],o=r[n],l=a(i),u=a(o);"object"===l&&"object"===u?e(i,o):t instanceof Map?t.set(n,o):t[n]=o}return t}}),Object.defineProperty(Object,"typeOf",{writable:e,configurable:t,enumerable:r,value:a}),Object.defineProperty(Object.prototype,"_decorate",{writable:e,configurable:t,enumerable:r,value:function(e,...t){return"function"==typeof e&&e.call(this,...t),this}})})(),(()=>{const i=Promise.prototype.then,a=Promise.prototype.catch,o=Promise.prototype.finally;function l(e,t){for(const r of Object.keys(t))e[r]=t[r];return e}Object.defineProperties(Promise.prototype,{then:{writable:e,configurable:t,enumerable:r,value:function(...e){return l(i.call(this,...e),this)}},catch:{writable:e,configurable:t,enumerable:r,value:function(...e){return l(a.call(this,...e),this)}},finally:{writable:e,configurable:t,enumerable:r,value:function(...e){return l(o.call(this,...e),this)}},guard:{writable:e,configurable:t,enumerable:r,value:function(){return l(a.call(this,(e=>(setTimeout((()=>{if(n)throw e;{const t=new Event("unhandledRejection");t.error=e,window.dispatchEvent(t)}}),0),e))),this)}}}),Object.defineProperties(Promise,{wait:{writable:e,configurable:t,enumerable:r,value:function(e=[]){Array.isArray(e)||(e=[e]);if(0===e.length)return Promise.resolve([]);return new Promise(((t,r)=>{let n=[],i=0,a=!0;for(let o=0;o<e.length;o++){let l={resolved:!0,seq:o,result:null};n.push(l),Promise.resolve(e[o]).then((e=>{a=(l.resolved=!0)&&a,l.result=e}),(e=>{a=(l.resolved=!1)&&a,l.result=e})).then((()=>{i++,e.length===i&&(a?t:r)(n)}))}}))}},create:{writable:e,configurable:t,enumerable:r,value:function(){let e=null,t=null;const r=new Promise(((r,n)=>{e=r,t=n}));return r.resolve=e,r.reject=t,r.promise=r,r}}})})(),(()=>{const n=/(\w)(\w*)(\W*)/g,i=(e,t,r,n,i,a)=>`${t.toUpperCase()}${r.toLowerCase()}${n}`;function o(e,...t){return this instanceof o?(this.strings=e,void(this.fields=t)):new o(e,...t)}o.prototype={[Symbol.iterator](){const e=this.strings.slice(0).reverse(),t=this.fields.slice(0).reverse();let r=0;return{next:()=>{if(0===e.length)return{done:!0};let n;return n=r%2==0?e.pop():t.pop(),r+=1,{value:n}}}},toString(){let e="";for(const t of this)e+=""+t;return e}},Object.defineProperties(String.prototype,{charCount:{configurable:t,enumerable:r,get:function(){let e=0,t=0;for(;e<this.length;){t++,e+=this.codePointAt(e)>65535?2:1}return t}},upperCase:{configurable:t,enumerable:r,get:function(){return this.toUpperCase()}},localeUpperCase:{configurable:t,enumerable:r,get:function(){return this.toLocaleUpperCase()}},lowerCase:{configurable:t,enumerable:r,get:function(){return this.toLowerCase()}},localeLowerCase:{configurable:t,enumerable:r,get:function(){return this.toLocaleLowerCase()}},toCamelCase:{configurable:t,enumerable:r,value:function(){return this.replace(n,i)}},camelCase:{configurable:t,enumerable:r,get:function(){return this.replace(n,i)}},pull:{configurable:t,enumerable:r,writable:e,value:function(e="",t=!0){if("string"!=typeof e)throw new TypeError("Given token must be a string");const r=this.length;if(0===r)return["",""];if(""===e)return t?[this[0],this.substring(1)]:[this.substring(0,r-1),this[r-1]];if(t){const t=this.indexOf(e,e.length);return t<0?[this.substring(0),""]:[this.substring(0,t),this.substring(t)]}{const t=this.lastIndexOf(e);return t<0?["",this.substring(0)]:[this.substring(0,t),this.substring(t)]}}},pop:{configurable:t,enumerable:r,writable:e,value:function(e=""){return this.pull(e,!0)}},shift:{configurable:t,enumerable:r,writable:e,value:function(e=""){return this.pull(e,!1)}}}),Object.defineProperties(String,{encodeRegExpString:{writable:e,configurable:t,enumerable:r,value:function(e=""){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}},template:{writable:e,configurable:t,enumerable:r,value:o},from:{writable:e,configurable:t,enumerable:r,value:e=>{if("string"==typeof e)return e;const t=a(e);return null!==t?function(e){if(e instanceof ArrayBuffer&&(e=new Uint8Array(e)),!(e instanceof Uint8Array))throw new TypeError("Given input must be an Uint8Array contains UTF8 encoded value!");let t=e,r=[],n=0;for(;n<t.length;){let e=255&t[n];0==(128&e)?(r.push(e),n+=1):192==(224&e)?(e=(31&t[n])<<6|63&t[n+1],r.push(e),n+=2):224==(240&e)?(e=(15&t[n])<<12|(63&t[n+1])<<6|63&t[n+2],r.push(e),n+=3):240==(248&e)?(e=(7&t[n])<<18|(63&t[n+1])<<12|(63&t[n+2])<<6|63&t[n+3],r.push(e),n+=4):n+=1}let i="";for(;r.length>0;){const e=r.splice(0,100);i+=String.fromCodePoint(...e)}return i}(t):""+e}}})})(),(()=>{function n(){let e=null,t=!1,r=null;const n=(n,a=0,...o)=>{e={cb:n,delay:a,args:o},t||(r&&(clearTimeout(r),r=null),i())};return n.clear=()=>{e=null,r&&(clearTimeout(r),r=null)},n;function i(){if(!e)return;let{cb:n,delay:a,args:o}=e;r=setTimeout((()=>{t=!0,Promise.resolve(n(...o)).then((()=>{t=!1,r=null,i()}),(n=>{throw t=!1,r=null,e=null,n}))}),a),e=null}}Object.defineProperty(setTimeout,"create",{writable:e,configurable:t,enumerable:r,value:n}),Object.defineProperty(setTimeout,"idle",{writable:e,configurable:t,enumerable:r,value:function(e=0){return new Promise((t=>{setTimeout(t,e)}))}}),Object.defineProperty(setInterval,"create",{writable:e,configurable:t,enumerable:r,value:function(){const e=n(),t=(t,r=0,...n)=>{const i=async()=>{e(i,r);try{await t(...n)}catch(t){throw e.clear(),t}};e(i,r,...n)};return t.clear=()=>{e.clear()},t}})})(),(()=>{const n=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],i=[DataView,...n],a=new WeakMap;for(const n of i)a.set(n,{from:n.from,toString:n.toString}),Object.defineProperty(n,"from",{value:function(e){const t=a.get(n).from;return e instanceof ArrayBuffer?new n(e):t.call(n,e)},configurable:t,enumerable:r,writable:e}),Object.defineProperty(n.prototype,"toString",{value:function(...e){const t=a.get(n).toString;return 0===e.length?t.call(this,...e):this.buffer.toString(...e)},configurable:t,enumerable:r,writable:e})})()})(); |
{ | ||
"name": "extes", | ||
"version": "3.2.0", | ||
"version": "3.2.1", | ||
"description": "A tiny library that extends native js with some handy tools", | ||
@@ -5,0 +5,0 @@ "main": "extes.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
65038
1551