@devlander/utils
Version:
Comprehensive JavaScript and TypeScript utilities for seamless development. Includes object manipulation, data validation, and more.
1 lines • 53.6 kB
JavaScript
function t(t){for(var r={},n=0;n<t.length;n++)r[n.toString()]=t[n];return r}var r,n=function(t,r){if(!Array.isArray(t)||"number"!=typeof r||r<=0)return[];for(var n=[],e=0;e<t.length;e+=r)n.push(t.slice(e,e+r));return n};function e(t,r){(null==r||r>t.length)&&(r=t.length);for(var n=0,e=Array(r);n<r;n++)e[n]=t[n];return e}function o(t,r){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=l(t))||r&&t&&"number"==typeof t.length){n&&(t=n);var e=0,o=function(){};return{s:o,n:function(){return e>=t.length?{done:!0}:{done:!1,value:t[e++]}},e:function(t){throw t},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 i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function i(t,r,n){return(r=function(t){var r=function(t,r){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var e=n.call(t,r||"default");if("object"!=typeof e)return e;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}(t,"string");return"symbol"==typeof r?r:r+""}(r))in t?Object.defineProperty(t,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[r]=n,t}function a(t,r){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(t);r&&(e=e.filter((function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable}))),n.push.apply(n,e)}return n}function u(t){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?a(Object(n),!0).forEach((function(r){i(t,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))}))}return t}function f(t,r){return function(t){if(Array.isArray(t))return t}(t)||function(t,r){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var e,o,i,a,u=[],f=!0,c=!1;try{if(i=(n=n.call(t)).next,0===r){if(Object(n)!==n)return;f=!1}else for(;!(f=(e=i.call(n)).done)&&(u.push(e.value),u.length!==r);f=!0);}catch(t){c=!0,o=t}finally{try{if(!f&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return u}}(t,r)||l(t,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(t){return function(t){if(Array.isArray(t))return e(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||l(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(t){return s="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},s(t)}function l(t,r){if(t){if("string"==typeof t)return e(t,r);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?e(t,r):void 0}}!function(t){t.STRING="string",t.OBJECT="object",t.ARRAY="array",t.NUMBER="number",t.MATRIX="matrix"}(r||(r={}));var h=function(t,n){if(!n)if("string"==typeof t)n=r.STRING;else if(Array.isArray(t))n=t.length>0&&t.every(Array.isArray)?r.MATRIX:r.ARRAY;else if("number"==typeof t)n=r.NUMBER;else{if("object"!==s(t)||null===t)throw new Error("Unsupported input type: ".concat(s(t)));n=r.OBJECT}return function(){switch(n){case r.STRING:case"STRING":case"string":if("string"==typeof t)return t.split("").filter((function(t,r,n){return n.indexOf(t)===r})).join("");break;case r.ARRAY:case"ARRAY":case"array":if(Array.isArray(t))return t.filter((function(t,r,n){return n.indexOf(t)===r}));break;case r.OBJECT:case"OBJECT":case"object":if("object"===s(t)&&!Array.isArray(t)){var e=new Set,o=Object.entries(t).filter((function(t){var r=f(t,2)[1];return!e.has(r)&&(e.add(r),!0)}));return Object.fromEntries(o)}break;case r.NUMBER:case"NUMBER":case"number":if("number"==typeof t){var i=t.toString().split("").filter((function(t,r,n){return n.indexOf(t)===r})).join("");return parseInt(i,10)}break;case r.MATRIX:case"MATRIX":case"matrix":if(Array.isArray(t)&&t.every(Array.isArray))return t.map((function(t){return Array.from(new Set(t))}))}throw new Error("Unsupported type or input format for: ".concat(n))}()},p=["and","to",".","the",",","of","in","for","&","a","an","with","on","at","from","as","by","or","but","into","is","are","was","were","be","being","been","have","has","had","having","do","does","did","doing","will","would","should","can","could","may","might","must","ought","shall","should","there","their","they","them","these","those","this","that","then","than","thus","so","such","if","else","not","no","yes","i","you","he","she","it","we","me","him","her","us","my","your","his","its","our","mine","yours","hers","ours","theirs","who","whom","which","what","when","where","why","how","up","about","into","with","over","before","after","between","among","through","during","above","below","out","off","down","under","again","further","once","here","all","any","both","each","few","more","most","other","some","such","both","each"];function g(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],e=arguments.length>3&&void 0!==arguments[3]?arguments[3]:["name"],i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"_id",a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:p,u=[];if(!t.trim()||!r.length)return u;var f=t.toLowerCase().split(" ").filter((function(t){return t&&!a.includes(t)}));if(0===f.length)return u;var c,s=new Set(Array.isArray(n)?n.map(String):[String(n)]),l=o(r);try{var h=function(){var t=c.value,r=String(t[i]);if(s.has(r))return 1;e.some((function(r){var n=t[r];if(!n||"string"!=typeof n)return!1;var e=n.toLowerCase().split(" ").filter((function(t){return!a.includes(t)}));return f.every((function(t){return e.includes(t)}))}))&&u.push(t)};for(l.s();!(c=l.n()).done;)h()}catch(t){l.e(t)}finally{l.f()}return u}var y=function(t){return Array.isArray(t)?t.reduce((function(t,r){return Array.isArray(r)?t.concat(r):t.concat([r])}),[]):[]};function d(t,r){var n=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).allOwnKeys,e=void 0!==n&&n;if(null!=t)if("object"!==s(t)&&(t=[t]),Array.isArray(t))for(var o=0,i=t.length;o<i;o++)r.call(null,t[o],o,t);else for(var a=e?Object.getOwnPropertyNames(t):Object.keys(t),u=a.length,f=0;f<u;f++){var c=a[f];r.call(null,t[c],c,t)}}var v=function(t,r){if(!t||"function"!=typeof t[Symbol.iterator])throw new TypeError("Object is not iterable");for(var n,e=t[Symbol.iterator]();!(n=e.next()).done;){var o=f(n.value,2),i=o[0],a=o[1];r.call(t,i,a)}},w=function(t,r){var n;return 0===t.length?r:null!==(n=t[Math.floor(Math.random()*t.length)])&&void 0!==n?n:r},m=function(t,r){return r<0?[]:Array.apply(0,Array(r)).map((function(r,n){return n+t}))},b=function(t,r){return t.map((function(t){return t[r]})).filter((function(t,r,n){return n.indexOf(t)===r})).map((function(r,n){return t[n]}))},A=function(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),e=1;e<r;e++)n[e-1]=arguments[e];return n[t]},E=function(t){if(!Array.isArray(t)||t.length<=1)return c(t);for(var r=c(t),n=r.length-1;n>0;n--){var e=Math.floor(Math.random()*(n+1)),o=[r[e],r[n]];r[n]=o[0],r[e]=o[1]}return r},R="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},O=[],S=[],P="undefined"!=typeof Uint8Array?Uint8Array:Array,T=!1;function j(){T=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0;r<64;++r)O[r]=t[r],S[t.charCodeAt(r)]=r;S["-".charCodeAt(0)]=62,S["_".charCodeAt(0)]=63}function B(t,r,n){for(var e,o,i=[],a=r;a<n;a+=3)e=(t[a]<<16)+(t[a+1]<<8)+t[a+2],i.push(O[(o=e)>>18&63]+O[o>>12&63]+O[o>>6&63]+O[63&o]);return i.join("")}function I(t){var r;T||j();for(var n=t.length,e=n%3,o="",i=[],a=16383,u=0,f=n-e;u<f;u+=a)i.push(B(t,u,u+a>f?f:u+a));return 1===e?(r=t[n-1],o+=O[r>>2],o+=O[r<<4&63],o+="=="):2===e&&(r=(t[n-2]<<8)+t[n-1],o+=O[r>>10],o+=O[r>>4&63],o+=O[r<<2&63],o+="="),i.push(o),i.join("")}function _(t,r,n,e,o){var i,a,u=8*o-e-1,f=(1<<u)-1,c=f>>1,s=-7,l=n?o-1:0,h=n?-1:1,p=t[r+l];for(l+=h,i=p&(1<<-s)-1,p>>=-s,s+=u;s>0;i=256*i+t[r+l],l+=h,s-=8);for(a=i&(1<<-s)-1,i>>=-s,s+=e;s>0;a=256*a+t[r+l],l+=h,s-=8);if(0===i)i=1-c;else{if(i===f)return a?NaN:1/0*(p?-1:1);a+=Math.pow(2,e),i-=c}return(p?-1:1)*a*Math.pow(2,i-e)}function U(t,r,n,e,o,i){var a,u,f,c=8*i-o-1,s=(1<<c)-1,l=s>>1,h=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,p=e?0:i-1,g=e?1:-1,y=r<0||0===r&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(u=isNaN(r)?1:0,a=s):(a=Math.floor(Math.log(r)/Math.LN2),r*(f=Math.pow(2,-a))<1&&(a--,f*=2),(r+=a+l>=1?h/f:h*Math.pow(2,1-l))*f>=2&&(a++,f/=2),a+l>=s?(u=0,a=s):a+l>=1?(u=(r*f-1)*Math.pow(2,o),a+=l):(u=r*Math.pow(2,l-1)*Math.pow(2,o),a=0));o>=8;t[n+p]=255&u,p+=g,u/=256,o-=8);for(a=a<<o|u,c+=o;c>0;t[n+p]=255&a,p+=g,a/=256,c-=8);t[n+p-g]|=128*y}var N={}.toString,x=Array.isArray||function(t){return"[object Array]"==N.call(t)};function M(){return L.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function C(t,r){if(M()<r)throw new RangeError("Invalid typed array length");return L.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(r)).__proto__=L.prototype:(null===t&&(t=new L(r)),t.length=r),t}function L(t,r,n){if(!(L.TYPED_ARRAY_SUPPORT||this instanceof L))return new L(t,r,n);if("number"==typeof t){if("string"==typeof r)throw new Error("If encoding is specified then the first argument must be a string");return k(this,t)}return Y(this,t,r,n)}function Y(t,r,n,e){if("number"==typeof r)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&r instanceof ArrayBuffer?function(t,r,n,e){if(n<0||r.byteLength<n)throw new RangeError("'offset' is out of bounds");if(r.byteLength<n+(e||0))throw new RangeError("'length' is out of bounds");r=void 0===n&&void 0===e?new Uint8Array(r):void 0===e?new Uint8Array(r,n):new Uint8Array(r,n,e);L.TYPED_ARRAY_SUPPORT?(t=r).__proto__=L.prototype:t=z(t,r);return t}(t,r,n,e):"string"==typeof r?function(t,r,n){"string"==typeof n&&""!==n||(n="utf8");if(!L.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var e=0|W(r,n);t=C(t,e);var o=t.write(r,n);o!==e&&(t=t.slice(0,o));return t}(t,r,n):function(t,r){if($(r)){var n=0|F(r.length);return 0===(t=C(t,n)).length||r.copy(t,0,0,n),t}if(r){if("undefined"!=typeof ArrayBuffer&&r.buffer instanceof ArrayBuffer||"length"in r)return"number"!=typeof r.length||(e=r.length)!=e?C(t,0):z(t,r);if("Buffer"===r.type&&x(r.data))return z(t,r.data)}var e;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,r)}function D(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function k(t,r){if(D(r),t=C(t,r<0?0:0|F(r)),!L.TYPED_ARRAY_SUPPORT)for(var n=0;n<r;++n)t[n]=0;return t}function z(t,r){var n=r.length<0?0:0|F(r.length);t=C(t,n);for(var e=0;e<n;e+=1)t[e]=255&r[e];return t}function F(t){if(t>=M())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+M().toString(16)+" bytes");return 0|t}function $(t){return!(null==t||!t._isBuffer)}function W(t,r){if($(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var n=t.length;if(0===n)return 0;for(var e=!1;;)switch(r){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return vt(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return wt(t).length;default:if(e)return vt(t).length;r=(""+r).toLowerCase(),e=!0}}function J(t,r,n){var e=!1;if((void 0===r||r<0)&&(r=0),r>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(r>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return at(this,r,n);case"utf8":case"utf-8":return nt(this,r,n);case"ascii":return ot(this,r,n);case"latin1":case"binary":return it(this,r,n);case"base64":return rt(this,r,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ut(this,r,n);default:if(e)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),e=!0}}function Z(t,r,n){var e=t[r];t[r]=t[n],t[n]=e}function K(t,r,n,e,o){if(0===t.length)return-1;if("string"==typeof n?(e=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=o?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(o)return-1;n=t.length-1}else if(n<0){if(!o)return-1;n=0}if("string"==typeof r&&(r=L.from(r,e)),$(r))return 0===r.length?-1:H(t,r,n,e,o);if("number"==typeof r)return r&=255,L.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(t,r,n):Uint8Array.prototype.lastIndexOf.call(t,r,n):H(t,[r],n,e,o);throw new TypeError("val must be string, number or Buffer")}function H(t,r,n,e,o){var i,a=1,u=t.length,f=r.length;if(void 0!==e&&("ucs2"===(e=String(e).toLowerCase())||"ucs-2"===e||"utf16le"===e||"utf-16le"===e)){if(t.length<2||r.length<2)return-1;a=2,u/=2,f/=2,n/=2}function c(t,r){return 1===a?t[r]:t.readUInt16BE(r*a)}if(o){var s=-1;for(i=n;i<u;i++)if(c(t,i)===c(r,-1===s?0:i-s)){if(-1===s&&(s=i),i-s+1===f)return s*a}else-1!==s&&(i-=i-s),s=-1}else for(n+f>u&&(n=u-f),i=n;i>=0;i--){for(var l=!0,h=0;h<f;h++)if(c(t,i+h)!==c(r,h)){l=!1;break}if(l)return i}return-1}function G(t,r,n,e){n=Number(n)||0;var o=t.length-n;e?(e=Number(e))>o&&(e=o):e=o;var i=r.length;if(i%2!=0)throw new TypeError("Invalid hex string");e>i/2&&(e=i/2);for(var a=0;a<e;++a){var u=parseInt(r.substr(2*a,2),16);if(isNaN(u))return a;t[n+a]=u}return a}function V(t,r,n,e){return mt(vt(r,t.length-n),t,n,e)}function X(t,r,n,e){return mt(function(t){for(var r=[],n=0;n<t.length;++n)r.push(255&t.charCodeAt(n));return r}(r),t,n,e)}function q(t,r,n,e){return X(t,r,n,e)}function Q(t,r,n,e){return mt(wt(r),t,n,e)}function tt(t,r,n,e){return mt(function(t,r){for(var n,e,o,i=[],a=0;a<t.length&&!((r-=2)<0);++a)e=(n=t.charCodeAt(a))>>8,o=n%256,i.push(o),i.push(e);return i}(r,t.length-n),t,n,e)}function rt(t,r,n){return 0===r&&n===t.length?I(t):I(t.slice(r,n))}function nt(t,r,n){n=Math.min(t.length,n);for(var e=[],o=r;o<n;){var i,a,u,f,c=t[o],s=null,l=c>239?4:c>223?3:c>191?2:1;if(o+l<=n)switch(l){case 1:c<128&&(s=c);break;case 2:128==(192&(i=t[o+1]))&&(f=(31&c)<<6|63&i)>127&&(s=f);break;case 3:i=t[o+1],a=t[o+2],128==(192&i)&&128==(192&a)&&(f=(15&c)<<12|(63&i)<<6|63&a)>2047&&(f<55296||f>57343)&&(s=f);break;case 4:i=t[o+1],a=t[o+2],u=t[o+3],128==(192&i)&&128==(192&a)&&128==(192&u)&&(f=(15&c)<<18|(63&i)<<12|(63&a)<<6|63&u)>65535&&f<1114112&&(s=f)}null===s?(s=65533,l=1):s>65535&&(s-=65536,e.push(s>>>10&1023|55296),s=56320|1023&s),e.push(s),o+=l}return function(t){var r=t.length;if(r<=et)return String.fromCharCode.apply(String,t);var n="",e=0;for(;e<r;)n+=String.fromCharCode.apply(String,t.slice(e,e+=et));return n}(e)}L.TYPED_ARRAY_SUPPORT=void 0===R.TYPED_ARRAY_SUPPORT||R.TYPED_ARRAY_SUPPORT,L.poolSize=8192,L._augment=function(t){return t.__proto__=L.prototype,t},L.from=function(t,r,n){return Y(null,t,r,n)},L.TYPED_ARRAY_SUPPORT&&(L.prototype.__proto__=Uint8Array.prototype,L.__proto__=Uint8Array),L.alloc=function(t,r,n){return function(t,r,n,e){return D(r),r<=0?C(t,r):void 0!==n?"string"==typeof e?C(t,r).fill(n,e):C(t,r).fill(n):C(t,r)}(null,t,r,n)},L.allocUnsafe=function(t){return k(null,t)},L.allocUnsafeSlow=function(t){return k(null,t)},L.isBuffer=function(t){return null!=t&&(!!t._isBuffer||bt(t)||function(t){return"function"==typeof t.readFloatLE&&"function"==typeof t.slice&&bt(t.slice(0,0))}(t))},L.compare=function(t,r){if(!$(t)||!$(r))throw new TypeError("Arguments must be Buffers");if(t===r)return 0;for(var n=t.length,e=r.length,o=0,i=Math.min(n,e);o<i;++o)if(t[o]!==r[o]){n=t[o],e=r[o];break}return n<e?-1:e<n?1:0},L.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},L.concat=function(t,r){if(!x(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return L.alloc(0);var n;if(void 0===r)for(r=0,n=0;n<t.length;++n)r+=t[n].length;var e=L.allocUnsafe(r),o=0;for(n=0;n<t.length;++n){var i=t[n];if(!$(i))throw new TypeError('"list" argument must be an Array of Buffers');i.copy(e,o),o+=i.length}return e},L.byteLength=W,L.prototype._isBuffer=!0,L.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var r=0;r<t;r+=2)Z(this,r,r+1);return this},L.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var r=0;r<t;r+=4)Z(this,r,r+3),Z(this,r+1,r+2);return this},L.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var r=0;r<t;r+=8)Z(this,r,r+7),Z(this,r+1,r+6),Z(this,r+2,r+5),Z(this,r+3,r+4);return this},L.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?nt(this,0,t):J.apply(this,arguments)},L.prototype.equals=function(t){if(!$(t))throw new TypeError("Argument must be a Buffer");return this===t||0===L.compare(this,t)},L.prototype.inspect=function(){var t="";return this.length>0&&(t=this.toString("hex",0,50).match(/.{2}/g).join(" "),this.length>50&&(t+=" ... ")),"<Buffer "+t+">"},L.prototype.compare=function(t,r,n,e,o){if(!$(t))throw new TypeError("Argument must be a Buffer");if(void 0===r&&(r=0),void 0===n&&(n=t?t.length:0),void 0===e&&(e=0),void 0===o&&(o=this.length),r<0||n>t.length||e<0||o>this.length)throw new RangeError("out of range index");if(e>=o&&r>=n)return 0;if(e>=o)return-1;if(r>=n)return 1;if(this===t)return 0;for(var i=(o>>>=0)-(e>>>=0),a=(n>>>=0)-(r>>>=0),u=Math.min(i,a),f=this.slice(e,o),c=t.slice(r,n),s=0;s<u;++s)if(f[s]!==c[s]){i=f[s],a=c[s];break}return i<a?-1:a<i?1:0},L.prototype.includes=function(t,r,n){return-1!==this.indexOf(t,r,n)},L.prototype.indexOf=function(t,r,n){return K(this,t,r,n,!0)},L.prototype.lastIndexOf=function(t,r,n){return K(this,t,r,n,!1)},L.prototype.write=function(t,r,n,e){if(void 0===r)e="utf8",n=this.length,r=0;else if(void 0===n&&"string"==typeof r)e=r,n=this.length,r=0;else{if(!isFinite(r))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");r|=0,isFinite(n)?(n|=0,void 0===e&&(e="utf8")):(e=n,n=void 0)}var o=this.length-r;if((void 0===n||n>o)&&(n=o),t.length>0&&(n<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");e||(e="utf8");for(var i=!1;;)switch(e){case"hex":return G(this,t,r,n);case"utf8":case"utf-8":return V(this,t,r,n);case"ascii":return X(this,t,r,n);case"latin1":case"binary":return q(this,t,r,n);case"base64":return Q(this,t,r,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return tt(this,t,r,n);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(""+e).toLowerCase(),i=!0}},L.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var et=4096;function ot(t,r,n){var e="";n=Math.min(t.length,n);for(var o=r;o<n;++o)e+=String.fromCharCode(127&t[o]);return e}function it(t,r,n){var e="";n=Math.min(t.length,n);for(var o=r;o<n;++o)e+=String.fromCharCode(t[o]);return e}function at(t,r,n){var e=t.length;(!r||r<0)&&(r=0),(!n||n<0||n>e)&&(n=e);for(var o="",i=r;i<n;++i)o+=dt(t[i]);return o}function ut(t,r,n){for(var e=t.slice(r,n),o="",i=0;i<e.length;i+=2)o+=String.fromCharCode(e[i]+256*e[i+1]);return o}function ft(t,r,n){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+r>n)throw new RangeError("Trying to access beyond buffer length")}function ct(t,r,n,e,o,i){if(!$(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>o||r<i)throw new RangeError('"value" argument is out of bounds');if(n+e>t.length)throw new RangeError("Index out of range")}function st(t,r,n,e){r<0&&(r=65535+r+1);for(var o=0,i=Math.min(t.length-n,2);o<i;++o)t[n+o]=(r&255<<8*(e?o:1-o))>>>8*(e?o:1-o)}function lt(t,r,n,e){r<0&&(r=4294967295+r+1);for(var o=0,i=Math.min(t.length-n,4);o<i;++o)t[n+o]=r>>>8*(e?o:3-o)&255}function ht(t,r,n,e,o,i){if(n+e>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function pt(t,r,n,e,o){return o||ht(t,0,n,4),U(t,r,n,e,23,4),n+4}function gt(t,r,n,e,o){return o||ht(t,0,n,8),U(t,r,n,e,52,8),n+8}L.prototype.slice=function(t,r){var n,e=this.length;if((t=~~t)<0?(t+=e)<0&&(t=0):t>e&&(t=e),(r=void 0===r?e:~~r)<0?(r+=e)<0&&(r=0):r>e&&(r=e),r<t&&(r=t),L.TYPED_ARRAY_SUPPORT)(n=this.subarray(t,r)).__proto__=L.prototype;else{var o=r-t;n=new L(o,void 0);for(var i=0;i<o;++i)n[i]=this[i+t]}return n},L.prototype.readUIntLE=function(t,r,n){t|=0,r|=0,n||ft(t,r,this.length);for(var e=this[t],o=1,i=0;++i<r&&(o*=256);)e+=this[t+i]*o;return e},L.prototype.readUIntBE=function(t,r,n){t|=0,r|=0,n||ft(t,r,this.length);for(var e=this[t+--r],o=1;r>0&&(o*=256);)e+=this[t+--r]*o;return e},L.prototype.readUInt8=function(t,r){return r||ft(t,1,this.length),this[t]},L.prototype.readUInt16LE=function(t,r){return r||ft(t,2,this.length),this[t]|this[t+1]<<8},L.prototype.readUInt16BE=function(t,r){return r||ft(t,2,this.length),this[t]<<8|this[t+1]},L.prototype.readUInt32LE=function(t,r){return r||ft(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},L.prototype.readUInt32BE=function(t,r){return r||ft(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},L.prototype.readIntLE=function(t,r,n){t|=0,r|=0,n||ft(t,r,this.length);for(var e=this[t],o=1,i=0;++i<r&&(o*=256);)e+=this[t+i]*o;return e>=(o*=128)&&(e-=Math.pow(2,8*r)),e},L.prototype.readIntBE=function(t,r,n){t|=0,r|=0,n||ft(t,r,this.length);for(var e=r,o=1,i=this[t+--e];e>0&&(o*=256);)i+=this[t+--e]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*r)),i},L.prototype.readInt8=function(t,r){return r||ft(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},L.prototype.readInt16LE=function(t,r){r||ft(t,2,this.length);var n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},L.prototype.readInt16BE=function(t,r){r||ft(t,2,this.length);var n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},L.prototype.readInt32LE=function(t,r){return r||ft(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},L.prototype.readInt32BE=function(t,r){return r||ft(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},L.prototype.readFloatLE=function(t,r){return r||ft(t,4,this.length),_(this,t,!0,23,4)},L.prototype.readFloatBE=function(t,r){return r||ft(t,4,this.length),_(this,t,!1,23,4)},L.prototype.readDoubleLE=function(t,r){return r||ft(t,8,this.length),_(this,t,!0,52,8)},L.prototype.readDoubleBE=function(t,r){return r||ft(t,8,this.length),_(this,t,!1,52,8)},L.prototype.writeUIntLE=function(t,r,n,e){(t=+t,r|=0,n|=0,e)||ct(this,t,r,n,Math.pow(2,8*n)-1,0);var o=1,i=0;for(this[r]=255&t;++i<n&&(o*=256);)this[r+i]=t/o&255;return r+n},L.prototype.writeUIntBE=function(t,r,n,e){(t=+t,r|=0,n|=0,e)||ct(this,t,r,n,Math.pow(2,8*n)-1,0);var o=n-1,i=1;for(this[r+o]=255&t;--o>=0&&(i*=256);)this[r+o]=t/i&255;return r+n},L.prototype.writeUInt8=function(t,r,n){return t=+t,r|=0,n||ct(this,t,r,1,255,0),L.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[r]=255&t,r+1},L.prototype.writeUInt16LE=function(t,r,n){return t=+t,r|=0,n||ct(this,t,r,2,65535,0),L.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8):st(this,t,r,!0),r+2},L.prototype.writeUInt16BE=function(t,r,n){return t=+t,r|=0,n||ct(this,t,r,2,65535,0),L.TYPED_ARRAY_SUPPORT?(this[r]=t>>>8,this[r+1]=255&t):st(this,t,r,!1),r+2},L.prototype.writeUInt32LE=function(t,r,n){return t=+t,r|=0,n||ct(this,t,r,4,4294967295,0),L.TYPED_ARRAY_SUPPORT?(this[r+3]=t>>>24,this[r+2]=t>>>16,this[r+1]=t>>>8,this[r]=255&t):lt(this,t,r,!0),r+4},L.prototype.writeUInt32BE=function(t,r,n){return t=+t,r|=0,n||ct(this,t,r,4,4294967295,0),L.TYPED_ARRAY_SUPPORT?(this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=255&t):lt(this,t,r,!1),r+4},L.prototype.writeIntLE=function(t,r,n,e){if(t=+t,r|=0,!e){var o=Math.pow(2,8*n-1);ct(this,t,r,n,o-1,-o)}var i=0,a=1,u=0;for(this[r]=255&t;++i<n&&(a*=256);)t<0&&0===u&&0!==this[r+i-1]&&(u=1),this[r+i]=(t/a>>0)-u&255;return r+n},L.prototype.writeIntBE=function(t,r,n,e){if(t=+t,r|=0,!e){var o=Math.pow(2,8*n-1);ct(this,t,r,n,o-1,-o)}var i=n-1,a=1,u=0;for(this[r+i]=255&t;--i>=0&&(a*=256);)t<0&&0===u&&0!==this[r+i+1]&&(u=1),this[r+i]=(t/a>>0)-u&255;return r+n},L.prototype.writeInt8=function(t,r,n){return t=+t,r|=0,n||ct(this,t,r,1,127,-128),L.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[r]=255&t,r+1},L.prototype.writeInt16LE=function(t,r,n){return t=+t,r|=0,n||ct(this,t,r,2,32767,-32768),L.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8):st(this,t,r,!0),r+2},L.prototype.writeInt16BE=function(t,r,n){return t=+t,r|=0,n||ct(this,t,r,2,32767,-32768),L.TYPED_ARRAY_SUPPORT?(this[r]=t>>>8,this[r+1]=255&t):st(this,t,r,!1),r+2},L.prototype.writeInt32LE=function(t,r,n){return t=+t,r|=0,n||ct(this,t,r,4,2147483647,-2147483648),L.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8,this[r+2]=t>>>16,this[r+3]=t>>>24):lt(this,t,r,!0),r+4},L.prototype.writeInt32BE=function(t,r,n){return t=+t,r|=0,n||ct(this,t,r,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),L.TYPED_ARRAY_SUPPORT?(this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=255&t):lt(this,t,r,!1),r+4},L.prototype.writeFloatLE=function(t,r,n){return pt(this,t,r,!0,n)},L.prototype.writeFloatBE=function(t,r,n){return pt(this,t,r,!1,n)},L.prototype.writeDoubleLE=function(t,r,n){return gt(this,t,r,!0,n)},L.prototype.writeDoubleBE=function(t,r,n){return gt(this,t,r,!1,n)},L.prototype.copy=function(t,r,n,e){if(n||(n=0),e||0===e||(e=this.length),r>=t.length&&(r=t.length),r||(r=0),e>0&&e<n&&(e=n),e===n)return 0;if(0===t.length||0===this.length)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(e<0)throw new RangeError("sourceEnd out of bounds");e>this.length&&(e=this.length),t.length-r<e-n&&(e=t.length-r+n);var o,i=e-n;if(this===t&&n<r&&r<e)for(o=i-1;o>=0;--o)t[o+r]=this[o+n];else if(i<1e3||!L.TYPED_ARRAY_SUPPORT)for(o=0;o<i;++o)t[o+r]=this[o+n];else Uint8Array.prototype.set.call(t,this.subarray(n,n+i),r);return i},L.prototype.fill=function(t,r,n,e){if("string"==typeof t){if("string"==typeof r?(e=r,r=0,n=this.length):"string"==typeof n&&(e=n,n=this.length),1===t.length){var o=t.charCodeAt(0);o<256&&(t=o)}if(void 0!==e&&"string"!=typeof e)throw new TypeError("encoding must be a string");if("string"==typeof e&&!L.isEncoding(e))throw new TypeError("Unknown encoding: "+e)}else"number"==typeof t&&(t&=255);if(r<0||this.length<r||this.length<n)throw new RangeError("Out of range index");if(n<=r)return this;var i;if(r>>>=0,n=void 0===n?this.length:n>>>0,t||(t=0),"number"==typeof t)for(i=r;i<n;++i)this[i]=t;else{var a=$(t)?t:vt(new L(t,e).toString()),u=a.length;for(i=0;i<n-r;++i)this[i+r]=a[i%u]}return this};var yt=/[^+\/0-9A-Za-z-_]/g;function dt(t){return t<16?"0"+t.toString(16):t.toString(16)}function vt(t,r){var n;r=r||1/0;for(var e=t.length,o=null,i=[],a=0;a<e;++a){if((n=t.charCodeAt(a))>55295&&n<57344){if(!o){if(n>56319){(r-=3)>-1&&i.push(239,191,189);continue}if(a+1===e){(r-=3)>-1&&i.push(239,191,189);continue}o=n;continue}if(n<56320){(r-=3)>-1&&i.push(239,191,189),o=n;continue}n=65536+(o-55296<<10|n-56320)}else o&&(r-=3)>-1&&i.push(239,191,189);if(o=null,n<128){if((r-=1)<0)break;i.push(n)}else if(n<2048){if((r-=2)<0)break;i.push(n>>6|192,63&n|128)}else if(n<65536){if((r-=3)<0)break;i.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((r-=4)<0)break;i.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return i}function wt(t){return function(t){var r,n,e,o,i,a;T||j();var u=t.length;if(u%4>0)throw new Error("Invalid string. Length must be a multiple of 4");i="="===t[u-2]?2:"="===t[u-1]?1:0,a=new P(3*u/4-i),e=i>0?u-4:u;var f=0;for(r=0,n=0;r<e;r+=4,n+=3)o=S[t.charCodeAt(r)]<<18|S[t.charCodeAt(r+1)]<<12|S[t.charCodeAt(r+2)]<<6|S[t.charCodeAt(r+3)],a[f++]=o>>16&255,a[f++]=o>>8&255,a[f++]=255&o;return 2===i?(o=S[t.charCodeAt(r)]<<2|S[t.charCodeAt(r+1)]>>4,a[f++]=255&o):1===i&&(o=S[t.charCodeAt(r)]<<10|S[t.charCodeAt(r+1)]<<4|S[t.charCodeAt(r+2)]>>2,a[f++]=o>>8&255,a[f++]=255&o),a}(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(yt,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function mt(t,r,n,e){for(var o=0;o<e&&!(o+n>=r.length||o>=t.length);++o)r[o+n]=t[o];return o}function bt(t){return!!t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}function At(t){return new Promise((function(r,n){if("undefined"==typeof Blob||!(t instanceof Blob))return n(new Error("The provided value is not a valid Blob."));var e=new FileReader;e.readAsArrayBuffer(t),e.onloadend=function(){var n=e.result,o="data:".concat(t.type,";base64,").concat(L.from(n).toString("base64"));r(o)},e.onerror=function(){n(new Error("Error occurred while reading the Blob."))}}))}function Et(t){return new Promise((function(r,n){if("undefined"==typeof Blob||!(t instanceof Blob))return n(new Error("The provided value is not a valid Blob."));if("undefined"==typeof FileReader)return n(new Error("FileReader is not available in this environment."));var e=new FileReader;e.readAsDataURL(t),e.onloadend=function(){r(e.result)},e.onerror=function(){n(new Error("Error occurred while reading the Blob."))}}))}function Rt(t){if("undefined"!=typeof Buffer)return Buffer.from(t,"base64").toString("utf8");if("undefined"!=typeof atob)try{return decodeURIComponent(Array.prototype.map.call(atob(t),(function(t){return"%"+("00"+t.charCodeAt(0).toString(16)).slice(-2)})).join(""))}catch(r){return atob(t)}throw new Error("No base64 decoder available in this environment.")}function Ot(t){if("undefined"!=typeof Buffer)return Buffer.from(t,"utf8").toString("base64");if("undefined"!=typeof btoa)try{return btoa(encodeURIComponent(t).replace(/%([0-9A-F]{2})/g,(function(t,r){return String.fromCharCode(parseInt(r,16))})))}catch(r){return btoa(t)}throw new Error("No base64 encoder available in this environment.")}function St(t){if("string"!=typeof t)return!1;if(0===t.length)return!1;if(!/^[A-Za-z0-9+/]*={0,2}$/.test(t))return!1;var r=t.length%4;if(1===r)return!1;if(0===r||2===r||3===r)return!0;var n=t.slice(-r);return!!/^=*$/.test(n)}var Pt=Object.prototype.toString;function Tt(t){return"undefined"!=typeof Blob&&t instanceof Blob&&"[object Blob]"===Pt.call(t)}var jt=function(t){if(!/^[01]+$/.test(t))throw new Error("Invalid binary input");return(t.length%4==0?t:"0".repeat(4-t.length%4)+t).match(/.{1,4}/g).map((function(t){return parseInt(t,2).toString(16)})).join("")},Bt=function(t,r){var n={},e=function(t){t.forEach((function(t){n[t]=!0}))};return Array.isArray(t)?e(t):"string"==typeof t&&void 0!==r&&e(String(t).split(r)),Object.keys(n).forEach((function(t){t||delete n[t]})),n};function It(t){var r={},n=Bt(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]);return null==t||t.split("\n").forEach((function(t){var e=t.indexOf(":"),o=t.substring(0,e).trim().toLowerCase(),i=t.substring(e+1).trim();!o||r[o]&&n[o]||(r[o]="set-cookie"===o?r[o]?[].concat(c(r[o]),[i]):[i]:r[o]?"".concat(r[o],", ").concat(i):i)})),r}var _t,Ut=function(t,r){for(var n,e=[];null!==(n=t.exec(r));)e.push(n);return e};function Nt(t){var r,n=[],e=o(Ut(/\w+|\[(\w*)]/g,t));try{for(e.s();!(r=e.n()).done;){var i=f(r.value,2),a=i[0],u=i[1]||a;n.push(u)}}catch(t){e.e(t)}finally{e.f()}return n}!function(t){t.NONE="",t.K="K",t.M="M",t.B="B",t.T="T",t.P="P",t.E="E"}(_t||(_t={}));var xt,Mt,Ct,Lt=function(t,r){var n=[_t.NONE,_t.K,_t.M,_t.B,_t.T,_t.P,_t.E];if(void 0===t)return"";var e="string"==typeof t?parseFloat(t):t;if(isNaN(e))return"Invalid input";var o=Math.log10(Math.abs(e))/3|0;if(0===o)return e.toString();var i=n[o],a=e/Math.pow(10,3*o);if(null!=r&&r.rounding)switch(r.rounding){case"up":a=Math.ceil(10*a)/10;break;case"down":a=Math.floor(10*a)/10}return"lower"===(null==r?void 0:r.case)?i=i.toLowerCase():"upper"===(null==r?void 0:r.case)&&(i=i.toUpperCase()),a.toFixed(1)+i};!function(t){t.Only="Only",t.Exclusive="Exclusive to",t.Solely="Solely in"}(xt||(xt={})),function(t){t.IncludedIn="Included in",t.FoundWithin="Found in",t.PresentIn="Present in"}(Mt||(Mt={})),function(t){t.And="and",t.AsWellAs="as well as",t.AlongWith="along with"}(Ct||(Ct={}));var Yt,Dt,kt=function(t){var r=t.items,n=t.labelKey,e=t.singleItemPrefix,o=void 0===e?xt.Only:e,i=t.multipleItemsPrefix,a=void 0===i?Mt.FoundWithin:i,u=t.conjunctionWord,f=void 0===u?Ct.And:u;if(!r||0===r.length)return"";var c=xt[o]||o,s=Mt[a]||a,l=Ct[f]||f;if(1===r.length)return"".concat(c," ").concat(r[0][n],":");var h=r.map((function(t,e){var o=e===r.length-1,i=t[n];return o?"".concat(l," ").concat(i):i})).join(", ");return"".concat(s," ").concat(h,":")};!function(t){t.None=" ",t.Range="Range",t.Amount="Amount"}(Yt||(Yt={})),function(t){t.Empty=" ",t.UpTo="up to",t.About="about",t.Around="around",t.Approximately="approximately"}(Dt||(Dt={}));var zt=function(t){var r=t.details,n=void 0===r?"":r,e=t.formatAsRangeOrAmount,o=void 0===e?Yt.None:e,i=t.percentagePrefix,a=void 0===i?Dt.Empty:i,u=t.percentageSuffix,f=void 0===u?"":u,c=t.percent,s=void 0===c?0:c,l=t.minPercent,h=void 0===l?0:l,p=t.maxPercent,g=void 0===p?0:p,y=function(t,r,n){return""!==t.trim()||""!==r.trim()||n===Yt.Range||n===Yt.Amount}(a,f,o),d=o===Yt.Amount?"".concat(s,"%"):o===Yt.Range?"".concat(h," - ").concat(g).concat(f.includes("%")?"":"%"):"",v="";return o===Yt.Range?v="".concat(y?"(":"").concat(a.trim()?"".concat(a," "):"").concat(d).concat(f.trim()?f:"").concat(y?")":""," ").concat(n.trim()):o===Yt.Amount?v="(".concat(a.trim()?"".concat(a," "):"").concat(s,"%").concat(f.trim()?" ".concat(f):"",") ").concat(n.trim()):o===Yt.None&&(v=n.trim()),v},Ft=function(t){try{var r=t.trim().split(" ");if(0===r.length||""===r[0])return"";if(r&&r.length>1&&r[0]){var n=r[0];return n.charAt(0).toUpperCase()+n.slice(1).toLowerCase()}return""}catch(t){throw new Error(String(t))}},$t=function(t){return null==t||"object"===s(t)&&0===Object.keys(t).length||"string"==typeof t&&0===t.trim().length},Wt=function(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"message";if(!$t(r)&&Object.prototype.hasOwnProperty.call(r,n)){var e=r[n];if(e&&Array.isArray(e))return e.find((function(r){return r.includes(String(t))}))||null}return null};function Jt(t,r){return r.hasOwnProperty(t)?r[t]:null}var Zt,Kt=function(t,r){var n=function(t){if(!$t(r)&&Jt(t,r)){var n=Jt(t,r);if("string"==typeof n)return n}else if(!$t(r)){var e=Wt(t,r);if(e)return e}};if("string"==typeof t)return n(t)||void 0;if(Array.isArray(t)){var e,i=o(t);try{for(i.s();!(e=i.n()).done;){var a=n(e.value);if(a)return a}}catch(t){i.e(t)}finally{i.f()}}else;};!function(t){t.HTTPS="https://",t.HTTP="http://",t.NONE=""}(Zt||(Zt={}));var Ht=function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object.values(Zt),n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{includeWww:!0,validateDomains:!0},e=new Set;return t.forEach((function(t){var o=function(t){return t.replace(/^(https?:\/\/)?(www\.)?/,"").toLowerCase()}(t);!n.validateDomains||function(t){return!(!t||""===t.trim())&&(t.startsWith("localhost")?/^localhost(:\d+)?$/.test(t):/^([a-zA-Z0-9]([a-zA-Z0-9-]*[a-zA-Z0-9])?\.)*[a-zA-Z0-9]([a-zA-Z0-9-]*[a-zA-Z0-9])?\.[a-zA-Z]{2,}$/.test(t))}(o)?(r.forEach((function(t){if(!Object.values(Zt).includes(t))throw new Error("Invalid prefix: ".concat(t));e.add("".concat(t).concat(o)),n.includeWww&&!o.startsWith("localhost")&&e.add("".concat(t,"www.").concat(o))})),e.add(o),n.includeWww&&!o.startsWith("localhost")&&e.add("www.".concat(o))):console.warn("Skipping invalid domain: ".concat(t))})),Array.from(e)},Gt=["visa","mastercard","amex","discover","jcb","dinersclub"];function Vt(){var t=Gt[Math.floor(Math.random()*Gt.length)],r=Math.floor(9e15*Math.random())+1e15,n="amex"===t?4:3,e=Math.floor(Math.random()*Math.pow(10,n)).toString().padStart(n,"0"),o=(new Date).getFullYear(),i=Math.floor(12*Math.random())+1,a=o+Math.floor(10*Math.random())+1;return{brand:t,number:r.toString(),cvv:e,expirationDate:"".concat(i.toString().padStart(2,"0"),"/").concat(a)}}var Xt=function(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"name",e=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0;return r.some((function(r){if(1!==t.length)throw new Error("Letter must be a single character.");var i=r[n]||null;if(!i)return!1;var a=function(t){return!o||[o,o.toLowerCase()].every((function(r){return t.includes(r)}))}(i),u=function(r){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return void 0===n&&(n=0),[r,r.toLowerCase()].some((function(r){return r.charAt(n)===t}))}(i,e);return!(!a||!u)}))},qt=function(t){try{var r="string"==typeof t?t:JSON.stringify(t);return JSON.parse(r)}catch(t){return!1}},Qt=function(t){var r=qt(t);if(!r)throw new Error("Invalid JSON string.");if("boolean"!=typeof r)return function t(r){for(var n in r){if("string"==typeof r[n]&&r[n].includes("\n"))return!0;if("object"===s(r[n])&&null!==r[n]&&t(r[n]))return!0}return!1}(r);throw new Error("Invalid input: input must be a JSON string or an object.")};function tr(t,r,n){return function(e){var o=e.option,i=e.description,a="[".concat(r," v").concat(t,"] Transitional option '").concat(o,"' ").concat(i);return n?n.replace("{baseMessage}",a):a}}var rr={blue:"[34m",green:"[32m",red:"[31m",yellow:"[33m",magenta:"[35m",bgBlue:"[44m",bgGreen:"[42m",bgRed:"[41m",reset:"[0m"},nr=function(t,r,n){var e=rr[t]||rr.reset;void 0!==n?console.log("".concat(e,"%s").concat(rr.reset),r,n):console.log("".concat(e,"%s").concat(rr.reset),r)},er=function(t){nr(arguments.length>1&&void 0!==arguments[1]?arguments[1]:"bgBlue",t)},or=function(t,r){nr(r?"green":"red",t)},ir=function(t,r){var n="string"==typeof r?r:JSON.stringify(r,null,2);er("Error in ".concat(t,": ").concat(n),"red")},ar=function(t,r,n){var e=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"bgBlue",o="object"===s(r)?JSON.stringify(r,null,2):String(r),i="Function: ".concat(t," ").concat(n?"- ".concat(n):""," | Variables: ").concat(o);nr(e,i)},ur=function(){console.log("\n==============================================\n")},fr=function(t,r){ur();var n=r?" (".concat(r,")"):"";nr("blue","==== START: ".concat(t).concat(n," ====")),ur()},cr=function(t,r){ur();var n=r?" (".concat(r,")"):"";nr("blue","==== END: ".concat(t).concat(n," ====")),ur()},sr=function(t,r){var n,e=o(Object.getOwnPropertyNames(t));try{for(e.s();!(n=e.n()).done;){var i=n.value,a=Object.getOwnPropertyDescriptor(t,i);if(a){var u=r(a,i);!1!==u&&Object.defineProperty(t,i,u||a)}}}catch(t){e.e(t)}finally{e.f()}},lr=function(t,r,n){"ms"!==r&&"s"!==r&&(r="ms"),"boolean"==typeof n&&void 0!==n||(n=!1);var e=Date.now(),o="ms"===r?t:1e3*t,i=n&&"true"===n.toString()?console.log:function(){};return new Promise((function(t){setTimeout((function(){if(n&&"true"===n.toString()){var o=Date.now()-e,a="ms"===r?"ms":"s";i("Waited for ".concat("ms"===r?o:o/1e3).concat(a,"."))}t()}),o)}))},hr=function(t){return function(){for(var r=arguments.length,n=new Array(r),e=0;e<r;e++)n[e]=arguments[e];var o=n.slice(0,t.length-1),i=n.slice(t.length-1),a=[].concat(c(o),[i]);t.apply(void 0,c(a))}},pr=function(t){return t.replace(/([a-z-]+)\s+([^;:]+)(;|$)/gi,(function(t,r,n,e){return"".concat(r,": ").concat(n).concat(";"===e?";":"")})).replace(/([^;])\s*$/gm,"$1;")},gr=["align-items","align-self","align-content","aspect-ratio","backface-visibility","border-bottom-width","border-end-width","border-left-width","border-right-width","border-start-width","border-top-width","border-width","bottom","color","display","elevation","flex","flex-basis","flex-direction","flex-grow","flex-shrink","flex-wrap","font-family","font-size","font-style","font-weight","height","justify-content","left","letter-spacing","line-height","margin","margin-bottom","margin-end","margin-horizontal","margin-left","margin-right","margin-start","margin-top","margin-vertical","max-height","max-width","min-height","min-width","opacity","overflow","padding","padding-bottom","padding-end","padding-horizontal","padding-left","padding-right","padding-start","padding-top","padding-vertical","position","right","text-align","text-decoration","text-decoration-color","text-decoration-line","text-decoration-style","text-shadow-color","text-shadow-offset","text-shadow-radius","text-transform","top","width","z-index"];function yr(t,r){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if("number"!=typeof t||"number"!=typeof r||0===r)throw new Error("Both inputs must be numbers and 'whole' cannot be zero.");var e=t/r*100;return n?Math.trunc(e):e}var dr,vr=function(t,r,n){if("number"!=typeof t||isNaN(t))return r;if("number"!=typeof r||"number"!=typeof n||isNaN(r)||isNaN(n))return t;if(r>n){var e=[n,r];r=e[0],n=e[1]}return Math.min(Math.max(t,r),n)},wr=function(t){return"number"!=typeof t||isNaN(t)?"0":t.toLocaleString("en-US")};!function(t){t["4:3"]="4:3",t["16:9"]="16:9",t["1:1"]="1:1",t["3:2"]="3:2",t["8:5"]="8:5"}(dr||(dr={}));var mr=function(t){var r,n=t.width,e=t.orientation,o=void 0===e?"landscape":e,i=t.aspectRatio||dr["16:9"],a=(null===(r=dr[i])||void 0===r?void 0:r.split(":").map(Number))||[16,9];switch(i){case"4:3":a=[4,3];break;case"16:9":default:a=[16,9];break;case"1:1":a=[1,1];break;case"3:2":a=[3,2];break;case"8:5":a=[8,5]}var u,c=f(a,2),s=c[0],l=c[1];return u="landscape"===o?n/(s/l):n*(l/s),{width:n,height:Math.round(u)}};function br(t){if(!Array.isArray(t)||0===t.length)throw new Error("Input must be a non-empty array of numbers.");if(!t.every((function(t){return"number"==typeof t&&!isNaN(t)})))throw new Error("All elements in the array must be valid numbers.");return t.reduce((function(t,r){return t+r}),0)/t.length}var Ar=function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if("number"!=typeof t||isNaN(t))return 0;("number"!=typeof r||r<0)&&(r=0);var n=Math.pow(10,r);return Math.round(t*n)/n};function Er(t,r){"number"==typeof r&&(r=r.toString());for(var n=r.toLowerCase(),e=Object.keys(t),o=e.length;o-- >0;){var i=e[o];if(n===i.toString().toLowerCase())return i}return null}var Rr=function(t){return"[object Object]"===Object.prototype.toString.call(t)};function Or(t,r,n,e){var o=u({},n),i=Er(n,r)||r;Rr(n[i])&&Rr(t)?n[i]=e(o,r,t):Rr(t)?n[i]=e({},r,t):Array.isArray(t)?n[i]=t.slice():n[i]=t}function Sr(t,r){return function(){for(var n=arguments.length,e=new Array(n),o=0;o<n;o++)e[o]=arguments[o];return t.apply(r,e)}}var Pr,Tr=function t(r){if(null===r||"object"!==s(r))return r;if(r instanceof Date)return new Date(r.getTime());if(r instanceof RegExp)return new RegExp(r.source,r.flags);if(Array.isArray(r))return r.map((function(r){return t(r)}));if("object"===s(r)){var n={};for(var e in r)r.hasOwnProperty(e)&&(n[e]=t(r[e]));return n}return r},jr=(Pr=Object.create(null),function(t){var r=toString.call(t);return Pr[r]||(Pr[r]=r.slice(8,-1).toLowerCase())}),Br=function(t){return t=t.toLowerCase(),function(r){return jr(r)===t}};function Ir(t){return Br("function")(t)}var _r=function(t,r,n){return d(r,(function(r,e){n&&Ir(r)?t[e]=Sr(r,n):t[e]=r}),{allOwnKeys:(arguments.length>3&&void 0!==arguments[3]?arguments[3]:{}).allOwnKeys}),t};function Ur(t){return{keys:Object.keys(t),values:Object.values(t)}}var Nr=function(t){sr(t,(function(r,n){return(!Ir(t)||!["arguments","caller","callee"].includes(n))&&(Ir(t[n])?(r.enumerable=!1,"writable"in r?r.writable=!1:r.set||(r.set=function(){throw new Error("Cannot rewrite read-only method '".concat(n,"'"))}),r):void 0)}))};function xr(){for(var t={},r=function(r,n){Or(r,n,t,xr)},n=arguments.length,e=new Array(n),o=0;o<n;o++)e[o]=arguments[o];for(var i=0,a=e;i<a.length;i++){var u=a[i];u&&d(u,r)}return t}var Mr=function t(r,n){var e=u({},r);return Object.keys(n).forEach((function(r){var o=n[r],i=e[r];Array.isArray(o)&&Array.isArray(i)?e[r]=[].concat(c(i),c(o)):"object"!==s(o)||null===o||Array.isArray(o)||"object"!==s(i)||Array.isArray(i)?e[r]=o:e[r]=t(i,o)})),e},Cr=function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0,e=arguments.length>3?arguments[3]:void 0;if(!t)return r;var i=t,a=new Set;do{if(n&&!n(i))break;var u,f=o(Object.getOwnPropertyNames(i));try{for(f.s();!(u=f.n()).done;){var c=u.value;if(!Object.prototype.hasOwnProperty.call(Object.prototype,c)&&!(a.has(c)||c in r||e&&!e(c,i,r))){var s=i[c];void 0!==s&&(r[c]=s,a.add(c))}}}catch(t){f.e(t)}finally{f.f()}i=Object.getPrototypeOf(i)}while(i&&i!==Object.prototype);return r},Lr=function(t){return t.startsWith("?")&&(t=t.substring(1)),t.split("&").reduce((function(t,r){var n=f(r.split("=").map(decodeURIComponent),2),e=n[0],o=n[1];if(!e)return t;if(e in t){var i=t[e];Array.isArray(i)?i.push(o):t[e]=[i,o]}else t[e]=o;return t}),{})},Yr=function(t){if(!t||0===Object.keys(t).length)return"";var r=function t(r){return Object.keys(r).reduce((function(n,e){var o=r[e];return"object"!==s(o)||null===o||Array.isArray(o)?null!=o&&(n[e]=String(o)):Object.assign(n,t(o)),n}),{})}(t),n=Object.keys(r).map((function(t){return"".concat(encodeURIComponent(t),"=").concat(encodeURIComponent(r[t]))})).join("&");return n?"?".concat(n):""},Dr=function(t){return"string"!=typeof t||0===t.length?t:t.charAt(0).toUpperCase()+t.slice(1)};function kr(t){return t.replace(/^-+/,"").replace(/-+$/,"").toLowerCase().replace(/-([a-z])/g,(function(t,r){return r.toUpperCase()}))}var zr=function(t,r,n){(void 0===n||n>t.length)&&(n=t.length),n-=r.length;var e=t.indexOf(r,n);return-1!==e&&e===n},Fr=function(t){return"string"!=typeof t?"":t.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").replace(/[^a-zA-Z0-9-]/g,"").toLowerCase().replace(/^-+|-+$/g,"")},$r=function(t,r,n){return 1===t?r:n},Wr=function(t){return t.replace(/\n/g,"")},Jr=function(t){var r=qt(t);if(!r||"object"!==s(r)||null===r)throw new Error("Invalid JSON input.");var n=Qt(r)?function t(r){var n=Array.isArray(r)?[]:{};return Object.keys(r).forEach((function(e){var o=r[e];"string"==typeof o?Array.isArray(n)||(n[e]=Wr(o)):"object"===s(o)&&null!==o?Array.isArray(n)||(n[e]=t(o)):Array.isArray(n)||(n[e]=o)})),n}(r):r;return n},Zr=function(t){return t.replace(/\s+/g,"")},Kr=function(t){var r=qt(t);if(!1===r||"object"!==s(r)||null===r)throw new Error("Invalid JSON input.");return function t(r){var n=Array.isArray(r)?[]:{};return Object.keys(r).forEach((function(e){var o=r[e];"string"==typeof o?Array.isArray(n)||(n[e]=Zr(o)):"object"===s(o)&&null!==o?Array.isArray(n)||(n[e]=t(o)):Array.isArray(n)||(n[e]=o)})),n}(r)},Hr=function(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return t.charAt(n)===r?t.slice(0,n)+t.slice(n+1):t},Gr=function(t){return"string"!=typeof t?"":t.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")},Vr=function(t){return t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(t,r,n){return r.toUpperCase()+n}))},Xr=function(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"…";if("string"!=typeof t||"number"!=typeof r||r<0)return t;if(t.length<=r)return t;var e=r-n.length;return e<=0?n:t.slice(0,e)+n};function qr(t){var r=t.split(":");if(3!==r.length)throw new Error('Invalid timestamp format. Expected format: "HH:MM:SS"');var n=parseInt(r[0],10),e=parseInt(r[1],10),o=parseInt(r[2],10);if(isNaN(n)||isNaN(e)||isNaN(o))throw new Error('Invalid timestamp format. Expected format: "HH:MM:SS"');if(n<0||e<0||o<0)throw new Error("Invalid timestamp. Negative values are not allowed.");return 3600*n+60*e+o}var Qr,tn=function(t,r){var n=null;return function(){for(var e=arguments.length,o=new Array(e),i=0;i<e;i++)o[i]=arguments[i];n&&clearTimeout(n),n=setTimeout((function(){t.apply(void 0,o)}),r)}},rn=function(t,r){var n=0,e=null;return function(){for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];var u=Date.now();u-n>=r?(n=u,t.apply(void 0,i)):(e&&clearTimeout(e),e=setTimeout((function(){n=Date.now(),t.apply(void 0,i)}),r-(u-n)))}},nn=(Qr=Object.prototype.hasOwnProperty,function(t,r){return Qr.call(t,r)}),en=function(t){return!0===t||!1===t},on=Br("undefined"),an=function(t){return t=t.toLowerCase(),function(r){return jr(r)===t}};function un(t){return null!==t&&!on(t)&&null!==t.constructor&&!on(t.constructor)&&Ir(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}function fn(t){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&cn(t.buffer)}var cn=an("ArrayBuffer"),sn="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,ln=function(t){return!on(t)&&t!==sn},hn=an("Date");function pn(t,r){if(t===r)return!0;if("object"!==s(t)||null===t||"object"!==s(r)||null===r)return!1;var n=Object.keys(t),e=Object.keys(r);if(n.length!==e.length)return!1;for(var o=0,i=n;o<i.length;o++){var a=i[o];if(!e.includes(