@stricahq/typhonjs
Version:
Pure JS Cardano Wallet library
1 lines • 242 kB
JavaScript
var typhonjs;(()=>{var e={5723:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(8764);t.default=class{constructor(){this.buf=r.Buffer.alloc(0)}get length(){return this.buf.length}read(e){if(0===e)return r.Buffer.alloc(0);if(e<0)throw new Error("invalid length");const t=this.buf.slice(0,e);if(this.buf=this.buf.slice(e),t.length<e)throw new Error("Not enough buffer");return t}push(e){e.length&&(this.buf=r.Buffer.concat([this.buf,e]))}}},7640:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=class extends Array{constructor(){super(...arguments),this.byteSpan=[0,0]}setByteSpan(e){this.byteSpan=e}getByteSpan(){return this.byteSpan}}},1022:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});class n extends Map{constructor(){super(...arguments),this.byteSpan=[0,0]}setByteSpan(e){this.byteSpan=e}getByteSpan(){return this.byteSpan}}t.default=n},5257:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=class{constructor(e,t){this.byteSpan=[0,0],this.value=e,this.tag=t}setByteSpan(e){this.byteSpan=e}getByteSpan(){return this.byteSpan}}},6217:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const s=n(8764),u=o(n(2830)),c=a(n(4431)),f=n(3726),l=a(n(5723)),h=a(n(1604)),p=a(n(5257)),d=a(n(7640)),g=a(n(1022)),y=e=>255===e;class _ extends u.Transform{constructor(){super({writableObjectMode:!1,readableObjectMode:!0}),this.needed=null,this.fresh=!0,this._parser=this.parse(),this.offset=0,this.usedBytes=[],this.bl=new l.default,this.restart()}static decode(e){const t=new _,n=new l.default;n.push(e);const r=t.parse();let i=r.next();for(;!i.done;){const e=n.read(i.value);if(null==e||e.length!==i.value)throw new Error("Insufficient data");i=r.next(e)}if(n.length>0)throw new Error("Remaining Bytes");return{bytes:e,value:i.value}}readUInt64(e,t,n){const r=(0,f.getBigNum)(e,t);return c.default.isBigNumber(r)?(0,f.addSpanBytesToObject)(r,[n,this.offset]):r}updateTracker(e){this.usedBytes.push(e),this.offset+=e.length}*readIndefiniteStringLength(e,t){let n,r=yield 1;const i=r.readUInt8(0);if(255===i)n=-1;else{const o=31&i,a=this.readLength(o,t);let s=a.next();for(;!s.done;)r=yield s.value,this.updateTracker(r),s=a.next(r);if(n=s.value,n<0||i>>5!==e)throw new Error("Invalid indefinite length encoding")}return n}*readLength(e,t){if(e<24)return e;if(24===e){return(yield 1).readUInt8(0)}if(25===e){return(yield 2).readUInt16BE(0)}if(26===e){return(yield 4).readUInt32BE(0)}if(27===e){const e=(yield 4).readUInt32BE(0),n=(yield 4).readUInt32BE(0);return this.readUInt64(e,n,t)}if(31===e)return-1;throw new Error("Invalid length encoding")}_transform(e,t,n){for(this.bl.push(e);this.bl.length>=this.needed;){let e,t=null;e=null===this.needed?void 0:this.bl.read(this.needed);try{t=this._parser.next(e)}catch(e){return n(e)}this.needed&&(this.fresh=!1),t.done?(this.push({bytes:this.usedBytes,value:t.value}),this.restart()):this.needed=t.value||1/0}return n()}*parse(e){let t,n=this.offset;e?(t=e,n-=e.length):(t=yield 1,this.updateTracker(t));const r=t.readUInt8(0),i=r>>5,o=31&r;let a;if(7===i){if(25===o){t=yield 2,this.updateTracker(t);return(e=>{const t=32768&e;let n=31744&e;const r=1023&e;if(31744===n)n=261120;else if(0!==n)n+=114688;else if(0!==r)return(t?-1:1)*r*f.POW_2_24;const i=s.Buffer.alloc(4);return i.writeUInt32BE(t<<16|n<<13|r<<13),i.readFloatBE(0)})(t.readUInt16BE(0))}if(26===o)return t=yield 4,this.updateTracker(t),t.readFloatBE(0);if(27===o)return t=yield 8,this.updateTracker(t),t.readDoubleBE(0)}const u=this.readLength(o,n);let l=u.next();for(;!l.done;)t=yield l.value,this.updateTracker(t),l=u.next(t);if(a=l.value,a<0&&(i<2||i>6))throw new Error("Invalid length");switch(i){case 0:return a;case 1:if(a===Number.MAX_SAFE_INTEGER){const e=new c.default(-1).minus(new c.default(Number.MAX_SAFE_INTEGER.toString(16),16));return(0,f.addSpanBytesToObject)(e,[n,this.offset])}if(c.default.isBigNumber(a)){const e=new c.default(-1).minus(a);return(0,f.addSpanBytesToObject)(e,[n,this.offset])}return-1-a;case 2:if(a<0){const e=[];{const e=this.readIndefiniteStringLength(i,n);let r=e.next();for(;!r.done;)t=yield r.value,this.updateTracker(t),r=e.next(t);a=r.value}for(;a>=0;){t=yield a,this.updateTracker(t),e.push(t);{const e=this.readIndefiniteStringLength(i,n);let r=e.next();for(;!r.done;)t=yield r.value,this.updateTracker(t),r=e.next(t);a=r.value}}const r=s.Buffer.concat(e);return(0,f.addSpanBytesToObject)(r,[n,this.offset])}return t=yield a,this.updateTracker(t),(0,f.addSpanBytesToObject)(t,[n,this.offset]);case 3:{const e=[];if(a<0){{const e=this.readIndefiniteStringLength(i,n);let r=e.next();for(;!r.done;)t=yield r.value,this.updateTracker(t),r=e.next(t);a=r.value}for(;a>=0;){t=yield a,this.updateTracker(t),e.push(t);{const e=this.readIndefiniteStringLength(i,n);let r=e.next();for(;!r.done;)t=yield r.value,this.updateTracker(t),r=e.next(t);a=r.value}}return(0,f.utf8Decoder)(s.Buffer.concat(e))}t=yield a,this.updateTracker(t);return(0,f.utf8Decoder)(t)}case 4:{if(a<0){const e=new d.default;t=yield 1,this.updateTracker(t);let r=t.readUInt8(0);for(;!y(r);)e.push(yield*this.parse(t)),t=yield 1,this.updateTracker(t),r=t.readUInt8(0);return e.setByteSpan([n,this.offset]),e}const e=new d.default;for(let t=0;t<a;t+=1)e.push(yield*this.parse());return e.setByteSpan([n,this.offset]),e}case 5:{if(a<0){const e=new g.default;t=yield 1,this.updateTracker(t);let r=t.readUInt8(0);for(;!y(r);){const n=yield*this.parse(t),i=yield*this.parse();e.set(n,i),t=yield 1,this.updateTracker(t),r=t.readUInt8(0)}return e.setByteSpan([n,this.offset]),e}const e=new g.default;for(let t=0;t<a;t+=1){const t=yield*this.parse(),n=yield*this.parse();e.set(t,n)}return e.setByteSpan([n,this.offset]),e}case 6:{const e=new p.default(yield*this.parse(),a);return e.setByteSpan([n,this.offset]),e}case 7:switch(a){case 20:return!1;case 21:return!0;case 22:return null;case 23:return;default:return new h.default(a)}default:throw new Error("Invalid CBOR encoding")}}restart(){this.needed=null,this._parser=this.parse(),this.fresh=!0,this.offset=0,this.usedBytes=[]}_flush(e){e(this.fresh?null:new Error("unexpected end of input"))}}t.default=_},1604:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=class{constructor(e){this.value=e}}},7747:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(8764),o=r(n(4431)),a=n(7730),s=n(2339),u=n(3726),c=i.Buffer.from("f97e00","hex"),f=i.Buffer.from("ff","hex");t.default=(e,t={collapseBigNumber:!0})=>{const n=[];function r(e){const t=i.Buffer.allocUnsafe(1);t.writeUInt8(e,0),n.push(t)}function l(e){n.push(e)}function h(e){const t=i.Buffer.allocUnsafe(4);t.writeUInt32BE(e,0),n.push(t)}function p(e,t){t<24?r(e<<5|t):t<256?(r(e<<5|24),r(t)):t<65536?(r(e<<5|25),function(e){const t=i.Buffer.allocUnsafe(2);t.writeUInt16BE(e,0),n.push(t)}(t)):t<4294967296?(r(e<<5|26),h(t)):(r(e<<5|27),function(e){const t=e%u.POW_2_32,r=(e-t)/u.POW_2_32,o=i.Buffer.allocUnsafe(8);o.writeUInt32BE(r,0),o.writeUInt32BE(t,4),n.push(o)}(t))}function d(e){return Object.is(e,-0)?l(i.Buffer.from("f98000","hex")):e>=0&&e<=u.POW_2_53?p(0,e):-u.POW_2_53<=e&&e<0?p(1,-(e+1)):void 0}function g(e){let n=e,o=0,a=2;if(n.isNegative()&&(n=n.negated().minus(1),o=1,a=3),t.collapseBigNumber&&n.lte(u.MAX_BIG_NUM_INT64)){if(n.lte(u.MAX_BIG_NUM_INT32))return p(o,n.toNumber());r(o<<5|27),h(n.dividedToIntegerBy(u.SHIFT32).toNumber()),h(n.mod(u.SHIFT32).toNumber())}else{let e=n.toString(16);e.length%2&&(e=`0${e}`),p(6,a);const t=i.Buffer.from(e,"hex");p(2,t.length),l(t)}}return function e(t){if(!1===t)return r(244);if(!0===t)return r(245);if(null===t)return r(246);if(void 0===t)return r(247);switch(typeof t){case"number":return Math.round(t)===t?d(t):(r(251),function(e){const t=i.Buffer.allocUnsafe(8);t.writeDoubleBE(e),n.push(t)}(t));case"string":{const e=i.Buffer.from(t,"utf8");return p(3,e.length),l(e)}default:if(Array.isArray(t)){t instanceof s.IndefiniteArray?r(159):p(4,t.length);for(const n of t)e(n);t instanceof s.IndefiniteArray&&l(f)}else if(t instanceof i.Buffer)p(2,t.length),l(t);else if(t instanceof ArrayBuffer){const e=i.Buffer.from(t);p(2,e.length),l(e)}else if(t instanceof Uint8ClampedArray){const e=i.Buffer.from(t);p(2,e.length),l(e)}else if(t instanceof Uint8Array){const e=i.Buffer.from(t);p(2,e.length),l(e)}else if(o.default.isBigNumber(t))!function(e){if(e.isNaN())l(c);else if(e.isInteger())g(e);else{p(6,4),p(4,2);const t=e.decimalPlaces(),n=e.shiftedBy(t);d(-t),n.abs().isLessThan(u.MAX_BIG_NUM_INT)?d(n.toNumber()):g(n)}}(t);else if(t instanceof a.CborTag)p(6,t.tag),e(t.value);else{let n;n=t instanceof Map?[...t.entries()]:[...Object.entries(t)],t instanceof s.IndefiniteMap?r(191):p(5,n.length);for(const[t,r]of n)e(t),e(r);t instanceof s.IndefiniteMap&&l(f)}}}(e),i.Buffer.concat(n)}},2339:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.CborTag=t.IndefiniteArray=t.IndefiniteMap=void 0;class i extends Map{}t.IndefiniteMap=i;t.IndefiniteArray=class extends Array{};var o=n(5257);Object.defineProperty(t,"CborTag",{enumerable:!0,get:function(){return r(o).default}})},7730:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Decoder=t.Encoder=void 0;const a=o(n(7747));t.Encoder={encode:a.default};var s=n(6217);Object.defineProperty(t,"Decoder",{enumerable:!0,get:function(){return o(s).default}}),i(n(2339),t)},3726:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.utf8Decoder=t.addSpanBytesToObject=t.getBigNum=t.MAX_BIG_NUM_INT64=t.MAX_BIG_NUM_INT32=t.MAX_BIG_NUM_INT=t.POW_2_53=t.POW_2_32=t.POW_2_24=t.SHIFT32=void 0;const i=r(n(4431));t.SHIFT32=4294967296,t.POW_2_24=5.960464477539063e-8,t.POW_2_32=4294967296,t.POW_2_53=9007199254740992,t.MAX_BIG_NUM_INT=new i.default("0x20000000000000"),t.MAX_BIG_NUM_INT32=new i.default("0xffffffff"),t.MAX_BIG_NUM_INT64=new i.default("0xffffffffffffffff");t.getBigNum=(e,n)=>e>2097151?new i.default(e).times(t.SHIFT32).plus(n):e*t.SHIFT32+n;t.addSpanBytesToObject=(e,t)=>{const n=e;return n.byteSpan=t,n.getByteSpan=function(){return this.byteSpan},n};const o=new TextDecoder("utf8",{fatal:!0,ignoreBOM:!0});t.utf8Decoder=e=>o.decode(e)},8162:e=>{"use strict";e.exports=function(e){if(e.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),n=0;n<t.length;n++)t[n]=255;for(var r=0;r<e.length;r++){var i=e.charAt(r),o=i.charCodeAt(0);if(255!==t[o])throw new TypeError(i+" is ambiguous");t[o]=r}var a=e.length,s=e.charAt(0),u=Math.log(a)/Math.log(256),c=Math.log(256)/Math.log(a);function f(e){if("string"!=typeof e)throw new TypeError("Expected String");if(0===e.length)return new Uint8Array;for(var n=0,r=0,i=0;e[n]===s;)r++,n++;for(var o=(e.length-n)*u+1>>>0,c=new Uint8Array(o);e[n];){var f=t[e.charCodeAt(n)];if(255===f)return;for(var l=0,h=o-1;(0!==f||l<i)&&-1!==h;h--,l++)f+=a*c[h]>>>0,c[h]=f%256>>>0,f=f/256>>>0;if(0!==f)throw new Error("Non-zero carry");i=l,n++}for(var p=o-i;p!==o&&0===c[p];)p++;for(var d=new Uint8Array(r+(o-p)),g=r;p!==o;)d[g++]=c[p++];return d}return{encode:function(t){if(t instanceof Uint8Array||(ArrayBuffer.isView(t)?t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength):Array.isArray(t)&&(t=Uint8Array.from(t))),!(t instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(0===t.length)return"";for(var n=0,r=0,i=0,o=t.length;i!==o&&0===t[i];)i++,n++;for(var u=(o-i)*c+1>>>0,f=new Uint8Array(u);i!==o;){for(var l=t[i],h=0,p=u-1;(0!==l||h<r)&&-1!==p;p--,h++)l+=256*f[p]>>>0,f[p]=l%a>>>0,l=l/a>>>0;if(0!==l)throw new Error("Non-zero carry");r=h,i++}for(var d=u-r;d!==u&&0===f[d];)d++;for(var g=s.repeat(n);d<u;++d)g+=e.charAt(f[d]);return g},decodeUnsafe:f,decode:function(e){var t=f(e);if(t)return t;throw new Error("Non-base"+a+" character")}}}},9742:(e,t)=>{"use strict";t.byteLength=function(e){var t=u(e),n=t[0],r=t[1];return 3*(n+r)/4-r},t.toByteArray=function(e){var t,n,o=u(e),a=o[0],s=o[1],c=new i(function(e,t,n){return 3*(t+n)/4-n}(0,a,s)),f=0,l=s>0?a-4:a;for(n=0;n<l;n+=4)t=r[e.charCodeAt(n)]<<18|r[e.charCodeAt(n+1)]<<12|r[e.charCodeAt(n+2)]<<6|r[e.charCodeAt(n+3)],c[f++]=t>>16&255,c[f++]=t>>8&255,c[f++]=255&t;2===s&&(t=r[e.charCodeAt(n)]<<2|r[e.charCodeAt(n+1)]>>4,c[f++]=255&t);1===s&&(t=r[e.charCodeAt(n)]<<10|r[e.charCodeAt(n+1)]<<4|r[e.charCodeAt(n+2)]>>2,c[f++]=t>>8&255,c[f++]=255&t);return c},t.fromByteArray=function(e){for(var t,r=e.length,i=r%3,o=[],a=16383,s=0,u=r-i;s<u;s+=a)o.push(c(e,s,s+a>u?u:s+a));1===i?(t=e[r-1],o.push(n[t>>2]+n[t<<4&63]+"==")):2===i&&(t=(e[r-2]<<8)+e[r-1],o.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"="));return o.join("")};for(var n=[],r=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,s=o.length;a<s;++a)n[a]=o[a],r[o.charCodeAt(a)]=a;function u(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function c(e,t,r){for(var i,o,a=[],s=t;s<r;s+=3)i=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(255&e[s+2]),a.push(n[(o=i)>>18&63]+n[o>>12&63]+n[o>>6&63]+n[63&o]);return a.join("")}r["-".charCodeAt(0)]=62,r["_".charCodeAt(0)]=63},7715:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bech32m=t.bech32=void 0;const n="qpzry9x8gf2tvdw0s3jn54khce6mua7l",r={};for(let e=0;e<n.length;e++){const t=n.charAt(e);r[t]=e}function i(e){const t=e>>25;return(33554431&e)<<5^996825010&-(t>>0&1)^642813549&-(t>>1&1)^513874426&-(t>>2&1)^1027748829&-(t>>3&1)^705979059&-(t>>4&1)}function o(e){let t=1;for(let n=0;n<e.length;++n){const r=e.charCodeAt(n);if(r<33||r>126)return"Invalid prefix ("+e+")";t=i(t)^r>>5}t=i(t);for(let n=0;n<e.length;++n){const r=e.charCodeAt(n);t=i(t)^31&r}return t}function a(e,t,n,r){let i=0,o=0;const a=(1<<n)-1,s=[];for(let r=0;r<e.length;++r)for(i=i<<t|e[r],o+=t;o>=n;)o-=n,s.push(i>>o&a);if(r)o>0&&s.push(i<<n-o&a);else{if(o>=t)return"Excess padding";if(i<<n-o&a)return"Non-zero padding"}return s}function s(e){return a(e,8,5,!0)}function u(e){const t=a(e,5,8,!1);if(Array.isArray(t))return t}function c(e){const t=a(e,5,8,!1);if(Array.isArray(t))return t;throw new Error(t)}function f(e){let t;function a(e,n){if(n=n||90,e.length<8)return e+" too short";if(e.length>n)return"Exceeds length limit";const a=e.toLowerCase(),s=e.toUpperCase();if(e!==a&&e!==s)return"Mixed-case string "+e;const u=(e=a).lastIndexOf("1");if(-1===u)return"No separator character for "+e;if(0===u)return"Missing prefix for "+e;const c=e.slice(0,u),f=e.slice(u+1);if(f.length<6)return"Data too short";let l=o(c);if("string"==typeof l)return l;const h=[];for(let e=0;e<f.length;++e){const t=f.charAt(e),n=r[t];if(void 0===n)return"Unknown character "+t;l=i(l)^n,e+6>=f.length||h.push(n)}return l!==t?"Invalid checksum for "+e:{prefix:c,words:h}}return t="bech32"===e?1:734539939,{decodeUnsafe:function(e,t){const n=a(e,t);if("object"==typeof n)return n},decode:function(e,t){const n=a(e,t);if("object"==typeof n)return n;throw new Error(n)},encode:function(e,r,a){if(a=a||90,e.length+7+r.length>a)throw new TypeError("Exceeds length limit");let s=o(e=e.toLowerCase());if("string"==typeof s)throw new Error(s);let u=e+"1";for(let e=0;e<r.length;++e){const t=r[e];if(t>>5!=0)throw new Error("Non 5-bit word");s=i(s)^t,u+=n.charAt(t)}for(let e=0;e<6;++e)s=i(s);s^=t;for(let e=0;e<6;++e){u+=n.charAt(s>>5*(5-e)&31)}return u},toWords:s,fromWordsUnsafe:u,fromWords:c}}t.bech32=f("bech32"),t.bech32m=f("bech32m")},4431:function(e,t,n){var r;!function(i){"use strict";var o,a=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,s=Math.ceil,u=Math.floor,c="[BigNumber Error] ",f=c+"Number primitive has more than 15 significant digits: ",l=1e14,h=14,p=9007199254740991,d=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],g=1e7,y=1e9;function _(e){var t=0|e;return e>0||e===t?t:t-1}function v(e){for(var t,n,r=1,i=e.length,o=e[0]+"";r<i;){for(t=e[r++]+"",n=h-t.length;n--;t="0"+t);o+=t}for(i=o.length;48===o.charCodeAt(--i););return o.slice(0,i+1||1)}function b(e,t){var n,r,i=e.c,o=t.c,a=e.s,s=t.s,u=e.e,c=t.e;if(!a||!s)return null;if(n=i&&!i[0],r=o&&!o[0],n||r)return n?r?0:-s:a;if(a!=s)return a;if(n=a<0,r=u==c,!i||!o)return r?0:!i^n?1:-1;if(!r)return u>c^n?1:-1;for(s=(u=i.length)<(c=o.length)?u:c,a=0;a<s;a++)if(i[a]!=o[a])return i[a]>o[a]^n?1:-1;return u==c?0:u>c^n?1:-1}function m(e,t,n,r){if(e<t||e>n||e!==u(e))throw Error(c+(r||"Argument")+("number"==typeof e?e<t||e>n?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function w(e){var t=e.c.length-1;return _(e.e/h)==t&&e.c[t]%2!=0}function T(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function E(e,t,n){var r,i;if(t<0){for(i=n+".";++t;i+=n);e=i+e}else if(++t>(r=e.length)){for(i=n,t-=r;--t;i+=n);e+=i}else t<r&&(e=e.slice(0,t)+"."+e.slice(t));return e}o=function e(t){var n,r,i,o,S,A,R,I,O,C,x=G.prototype={constructor:G,toString:null,valueOf:null},P=new G(1),D=20,B=4,N=-7,k=21,M=-1e7,U=1e7,L=!1,j=1,V=0,H={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},F="0123456789abcdefghijklmnopqrstuvwxyz",W=!0;function G(e,t){var n,o,s,c,l,d,g,y,_=this;if(!(_ instanceof G))return new G(e,t);if(null==t){if(e&&!0===e._isBigNumber)return _.s=e.s,void(!e.c||e.e>U?_.c=_.e=null:e.e<M?_.c=[_.e=0]:(_.e=e.e,_.c=e.c.slice()));if((d="number"==typeof e)&&0*e==0){if(_.s=1/e<0?(e=-e,-1):1,e===~~e){for(c=0,l=e;l>=10;l/=10,c++);return void(c>U?_.c=_.e=null:(_.e=c,_.c=[e]))}y=String(e)}else{if(!a.test(y=String(e)))return i(_,y,d);_.s=45==y.charCodeAt(0)?(y=y.slice(1),-1):1}(c=y.indexOf("."))>-1&&(y=y.replace(".","")),(l=y.search(/e/i))>0?(c<0&&(c=l),c+=+y.slice(l+1),y=y.substring(0,l)):c<0&&(c=y.length)}else{if(m(t,2,F.length,"Base"),10==t&&W)return $(_=new G(e),D+_.e+1,B);if(y=String(e),d="number"==typeof e){if(0*e!=0)return i(_,y,d,t);if(_.s=1/e<0?(y=y.slice(1),-1):1,G.DEBUG&&y.replace(/^0\.0*|\./,"").length>15)throw Error(f+e)}else _.s=45===y.charCodeAt(0)?(y=y.slice(1),-1):1;for(n=F.slice(0,t),c=l=0,g=y.length;l<g;l++)if(n.indexOf(o=y.charAt(l))<0){if("."==o){if(l>c){c=g;continue}}else if(!s&&(y==y.toUpperCase()&&(y=y.toLowerCase())||y==y.toLowerCase()&&(y=y.toUpperCase()))){s=!0,l=-1,c=0;continue}return i(_,String(e),d,t)}d=!1,(c=(y=r(y,t,10,_.s)).indexOf("."))>-1?y=y.replace(".",""):c=y.length}for(l=0;48===y.charCodeAt(l);l++);for(g=y.length;48===y.charCodeAt(--g););if(y=y.slice(l,++g)){if(g-=l,d&&G.DEBUG&&g>15&&(e>p||e!==u(e)))throw Error(f+_.s*e);if((c=c-l-1)>U)_.c=_.e=null;else if(c<M)_.c=[_.e=0];else{if(_.e=c,_.c=[],l=(c+1)%h,c<0&&(l+=h),l<g){for(l&&_.c.push(+y.slice(0,l)),g-=h;l<g;)_.c.push(+y.slice(l,l+=h));l=h-(y=y.slice(l)).length}else l-=g;for(;l--;y+="0");_.c.push(+y)}}else _.c=[_.e=0]}function K(e,t,n,r){var i,o,a,s,u;if(null==n?n=B:m(n,0,8),!e.c)return e.toString();if(i=e.c[0],a=e.e,null==t)u=v(e.c),u=1==r||2==r&&(a<=N||a>=k)?T(u,a):E(u,a,"0");else if(o=(e=$(new G(e),t,n)).e,s=(u=v(e.c)).length,1==r||2==r&&(t<=o||o<=N)){for(;s<t;u+="0",s++);u=T(u,o)}else if(t-=a,u=E(u,o,"0"),o+1>s){if(--t>0)for(u+=".";t--;u+="0");}else if((t+=o-s)>0)for(o+1==s&&(u+=".");t--;u+="0");return e.s<0&&i?"-"+u:u}function z(e,t){for(var n,r=1,i=new G(e[0]);r<e.length;r++){if(!(n=new G(e[r])).s){i=n;break}t.call(i,n)&&(i=n)}return i}function q(e,t,n){for(var r=1,i=t.length;!t[--i];t.pop());for(i=t[0];i>=10;i/=10,r++);return(n=r+n*h-1)>U?e.c=e.e=null:n<M?e.c=[e.e=0]:(e.e=n,e.c=t),e}function $(e,t,n,r){var i,o,a,c,f,p,g,y=e.c,_=d;if(y){e:{for(i=1,c=y[0];c>=10;c/=10,i++);if((o=t-i)<0)o+=h,a=t,g=(f=y[p=0])/_[i-a-1]%10|0;else if((p=s((o+1)/h))>=y.length){if(!r)break e;for(;y.length<=p;y.push(0));f=g=0,i=1,a=(o%=h)-h+1}else{for(f=c=y[p],i=1;c>=10;c/=10,i++);g=(a=(o%=h)-h+i)<0?0:f/_[i-a-1]%10|0}if(r=r||t<0||null!=y[p+1]||(a<0?f:f%_[i-a-1]),r=n<4?(g||r)&&(0==n||n==(e.s<0?3:2)):g>5||5==g&&(4==n||r||6==n&&(o>0?a>0?f/_[i-a]:0:y[p-1])%10&1||n==(e.s<0?8:7)),t<1||!y[0])return y.length=0,r?(t-=e.e+1,y[0]=_[(h-t%h)%h],e.e=-t||0):y[0]=e.e=0,e;if(0==o?(y.length=p,c=1,p--):(y.length=p+1,c=_[h-o],y[p]=a>0?u(f/_[i-a]%_[a])*c:0),r)for(;;){if(0==p){for(o=1,a=y[0];a>=10;a/=10,o++);for(a=y[0]+=c,c=1;a>=10;a/=10,c++);o!=c&&(e.e++,y[0]==l&&(y[0]=1));break}if(y[p]+=c,y[p]!=l)break;y[p--]=0,c=1}for(o=y.length;0===y[--o];y.pop());}e.e>U?e.c=e.e=null:e.e<M&&(e.c=[e.e=0])}return e}function Y(e){var t,n=e.e;return null===n?e.toString():(t=v(e.c),t=n<=N||n>=k?T(t,n):E(t,n,"0"),e.s<0?"-"+t:t)}return G.clone=e,G.ROUND_UP=0,G.ROUND_DOWN=1,G.ROUND_CEIL=2,G.ROUND_FLOOR=3,G.ROUND_HALF_UP=4,G.ROUND_HALF_DOWN=5,G.ROUND_HALF_EVEN=6,G.ROUND_HALF_CEIL=7,G.ROUND_HALF_FLOOR=8,G.EUCLID=9,G.config=G.set=function(e){var t,n;if(null!=e){if("object"!=typeof e)throw Error(c+"Object expected: "+e);if(e.hasOwnProperty(t="DECIMAL_PLACES")&&(m(n=e[t],0,y,t),D=n),e.hasOwnProperty(t="ROUNDING_MODE")&&(m(n=e[t],0,8,t),B=n),e.hasOwnProperty(t="EXPONENTIAL_AT")&&((n=e[t])&&n.pop?(m(n[0],-y,0,t),m(n[1],0,y,t),N=n[0],k=n[1]):(m(n,-y,y,t),N=-(k=n<0?-n:n))),e.hasOwnProperty(t="RANGE"))if((n=e[t])&&n.pop)m(n[0],-y,-1,t),m(n[1],1,y,t),M=n[0],U=n[1];else{if(m(n,-y,y,t),!n)throw Error(c+t+" cannot be zero: "+n);M=-(U=n<0?-n:n)}if(e.hasOwnProperty(t="CRYPTO")){if((n=e[t])!==!!n)throw Error(c+t+" not true or false: "+n);if(n){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw L=!n,Error(c+"crypto unavailable");L=n}else L=n}if(e.hasOwnProperty(t="MODULO_MODE")&&(m(n=e[t],0,9,t),j=n),e.hasOwnProperty(t="POW_PRECISION")&&(m(n=e[t],0,y,t),V=n),e.hasOwnProperty(t="FORMAT")){if("object"!=typeof(n=e[t]))throw Error(c+t+" not an object: "+n);H=n}if(e.hasOwnProperty(t="ALPHABET")){if("string"!=typeof(n=e[t])||/^.?$|[+\-.\s]|(.).*\1/.test(n))throw Error(c+t+" invalid: "+n);W="0123456789"==n.slice(0,10),F=n}}return{DECIMAL_PLACES:D,ROUNDING_MODE:B,EXPONENTIAL_AT:[N,k],RANGE:[M,U],CRYPTO:L,MODULO_MODE:j,POW_PRECISION:V,FORMAT:H,ALPHABET:F}},G.isBigNumber=function(e){if(!e||!0!==e._isBigNumber)return!1;if(!G.DEBUG)return!0;var t,n,r=e.c,i=e.e,o=e.s;e:if("[object Array]"=={}.toString.call(r)){if((1===o||-1===o)&&i>=-y&&i<=y&&i===u(i)){if(0===r[0]){if(0===i&&1===r.length)return!0;break e}if((t=(i+1)%h)<1&&(t+=h),String(r[0]).length==t){for(t=0;t<r.length;t++)if((n=r[t])<0||n>=l||n!==u(n))break e;if(0!==n)return!0}}}else if(null===r&&null===i&&(null===o||1===o||-1===o))return!0;throw Error(c+"Invalid BigNumber: "+e)},G.maximum=G.max=function(){return z(arguments,x.lt)},G.minimum=G.min=function(){return z(arguments,x.gt)},G.random=(o=9007199254740992,S=Math.random()*o&2097151?function(){return u(Math.random()*o)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(e){var t,n,r,i,o,a=0,f=[],l=new G(P);if(null==e?e=D:m(e,0,y),i=s(e/h),L)if(crypto.getRandomValues){for(t=crypto.getRandomValues(new Uint32Array(i*=2));a<i;)(o=131072*t[a]+(t[a+1]>>>11))>=9e15?(n=crypto.getRandomValues(new Uint32Array(2)),t[a]=n[0],t[a+1]=n[1]):(f.push(o%1e14),a+=2);a=i/2}else{if(!crypto.randomBytes)throw L=!1,Error(c+"crypto unavailable");for(t=crypto.randomBytes(i*=7);a<i;)(o=281474976710656*(31&t[a])+1099511627776*t[a+1]+4294967296*t[a+2]+16777216*t[a+3]+(t[a+4]<<16)+(t[a+5]<<8)+t[a+6])>=9e15?crypto.randomBytes(7).copy(t,a):(f.push(o%1e14),a+=7);a=i/7}if(!L)for(;a<i;)(o=S())<9e15&&(f[a++]=o%1e14);for(i=f[--a],e%=h,i&&e&&(o=d[h-e],f[a]=u(i/o)*o);0===f[a];f.pop(),a--);if(a<0)f=[r=0];else{for(r=-1;0===f[0];f.splice(0,1),r-=h);for(a=1,o=f[0];o>=10;o/=10,a++);a<h&&(r-=h-a)}return l.e=r,l.c=f,l}),G.sum=function(){for(var e=1,t=arguments,n=new G(t[0]);e<t.length;)n=n.plus(t[e++]);return n},r=function(){var e="0123456789";function t(e,t,n,r){for(var i,o,a=[0],s=0,u=e.length;s<u;){for(o=a.length;o--;a[o]*=t);for(a[0]+=r.indexOf(e.charAt(s++)),i=0;i<a.length;i++)a[i]>n-1&&(null==a[i+1]&&(a[i+1]=0),a[i+1]+=a[i]/n|0,a[i]%=n)}return a.reverse()}return function(r,i,o,a,s){var u,c,f,l,h,p,d,g,y=r.indexOf("."),_=D,b=B;for(y>=0&&(l=V,V=0,r=r.replace(".",""),p=(g=new G(i)).pow(r.length-y),V=l,g.c=t(E(v(p.c),p.e,"0"),10,o,e),g.e=g.c.length),f=l=(d=t(r,i,o,s?(u=F,e):(u=e,F))).length;0==d[--l];d.pop());if(!d[0])return u.charAt(0);if(y<0?--f:(p.c=d,p.e=f,p.s=a,d=(p=n(p,g,_,b,o)).c,h=p.r,f=p.e),y=d[c=f+_+1],l=o/2,h=h||c<0||null!=d[c+1],h=b<4?(null!=y||h)&&(0==b||b==(p.s<0?3:2)):y>l||y==l&&(4==b||h||6==b&&1&d[c-1]||b==(p.s<0?8:7)),c<1||!d[0])r=h?E(u.charAt(1),-_,u.charAt(0)):u.charAt(0);else{if(d.length=c,h)for(--o;++d[--c]>o;)d[c]=0,c||(++f,d=[1].concat(d));for(l=d.length;!d[--l];);for(y=0,r="";y<=l;r+=u.charAt(d[y++]));r=E(r,f,u.charAt(0))}return r}}(),n=function(){function e(e,t,n){var r,i,o,a,s=0,u=e.length,c=t%g,f=t/g|0;for(e=e.slice();u--;)s=((i=c*(o=e[u]%g)+(r=f*o+(a=e[u]/g|0)*c)%g*g+s)/n|0)+(r/g|0)+f*a,e[u]=i%n;return s&&(e=[s].concat(e)),e}function t(e,t,n,r){var i,o;if(n!=r)o=n>r?1:-1;else for(i=o=0;i<n;i++)if(e[i]!=t[i]){o=e[i]>t[i]?1:-1;break}return o}function n(e,t,n,r){for(var i=0;n--;)e[n]-=i,i=e[n]<t[n]?1:0,e[n]=i*r+e[n]-t[n];for(;!e[0]&&e.length>1;e.splice(0,1));}return function(r,i,o,a,s){var c,f,p,d,g,y,v,b,m,w,T,E,S,A,R,I,O,C=r.s==i.s?1:-1,x=r.c,P=i.c;if(!(x&&x[0]&&P&&P[0]))return new G(r.s&&i.s&&(x?!P||x[0]!=P[0]:P)?x&&0==x[0]||!P?0*C:C/0:NaN);for(m=(b=new G(C)).c=[],C=o+(f=r.e-i.e)+1,s||(s=l,f=_(r.e/h)-_(i.e/h),C=C/h|0),p=0;P[p]==(x[p]||0);p++);if(P[p]>(x[p]||0)&&f--,C<0)m.push(1),d=!0;else{for(A=x.length,I=P.length,p=0,C+=2,(g=u(s/(P[0]+1)))>1&&(P=e(P,g,s),x=e(x,g,s),I=P.length,A=x.length),S=I,T=(w=x.slice(0,I)).length;T<I;w[T++]=0);O=P.slice(),O=[0].concat(O),R=P[0],P[1]>=s/2&&R++;do{if(g=0,(c=t(P,w,I,T))<0){if(E=w[0],I!=T&&(E=E*s+(w[1]||0)),(g=u(E/R))>1)for(g>=s&&(g=s-1),v=(y=e(P,g,s)).length,T=w.length;1==t(y,w,v,T);)g--,n(y,I<v?O:P,v,s),v=y.length,c=1;else 0==g&&(c=g=1),v=(y=P.slice()).length;if(v<T&&(y=[0].concat(y)),n(w,y,T,s),T=w.length,-1==c)for(;t(P,w,I,T)<1;)g++,n(w,I<T?O:P,T,s),T=w.length}else 0===c&&(g++,w=[0]);m[p++]=g,w[0]?w[T++]=x[S]||0:(w=[x[S]],T=1)}while((S++<A||null!=w[0])&&C--);d=null!=w[0],m[0]||m.splice(0,1)}if(s==l){for(p=1,C=m[0];C>=10;C/=10,p++);$(b,o+(b.e=p+f*h-1)+1,a,d)}else b.e=f,b.r=+d;return b}}(),A=/^(-?)0([xbo])(?=\w[\w.]*$)/i,R=/^([^.]+)\.$/,I=/^\.([^.]+)$/,O=/^-?(Infinity|NaN)$/,C=/^\s*\+(?=[\w.])|^\s+|\s+$/g,i=function(e,t,n,r){var i,o=n?t:t.replace(C,"");if(O.test(o))e.s=isNaN(o)?null:o<0?-1:1;else{if(!n&&(o=o.replace(A,(function(e,t,n){return i="x"==(n=n.toLowerCase())?16:"b"==n?2:8,r&&r!=i?e:t})),r&&(i=r,o=o.replace(R,"$1").replace(I,"0.$1")),t!=o))return new G(o,i);if(G.DEBUG)throw Error(c+"Not a"+(r?" base "+r:"")+" number: "+t);e.s=null}e.c=e.e=null},x.absoluteValue=x.abs=function(){var e=new G(this);return e.s<0&&(e.s=1),e},x.comparedTo=function(e,t){return b(this,new G(e,t))},x.decimalPlaces=x.dp=function(e,t){var n,r,i,o=this;if(null!=e)return m(e,0,y),null==t?t=B:m(t,0,8),$(new G(o),e+o.e+1,t);if(!(n=o.c))return null;if(r=((i=n.length-1)-_(this.e/h))*h,i=n[i])for(;i%10==0;i/=10,r--);return r<0&&(r=0),r},x.dividedBy=x.div=function(e,t){return n(this,new G(e,t),D,B)},x.dividedToIntegerBy=x.idiv=function(e,t){return n(this,new G(e,t),0,1)},x.exponentiatedBy=x.pow=function(e,t){var n,r,i,o,a,f,l,p,d=this;if((e=new G(e)).c&&!e.isInteger())throw Error(c+"Exponent not an integer: "+Y(e));if(null!=t&&(t=new G(t)),a=e.e>14,!d.c||!d.c[0]||1==d.c[0]&&!d.e&&1==d.c.length||!e.c||!e.c[0])return p=new G(Math.pow(+Y(d),a?2-w(e):+Y(e))),t?p.mod(t):p;if(f=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new G(NaN);(r=!f&&d.isInteger()&&t.isInteger())&&(d=d.mod(t))}else{if(e.e>9&&(d.e>0||d.e<-1||(0==d.e?d.c[0]>1||a&&d.c[1]>=24e7:d.c[0]<8e13||a&&d.c[0]<=9999975e7)))return o=d.s<0&&w(e)?-0:0,d.e>-1&&(o=1/o),new G(f?1/o:o);V&&(o=s(V/h+2))}for(a?(n=new G(.5),f&&(e.s=1),l=w(e)):l=(i=Math.abs(+Y(e)))%2,p=new G(P);;){if(l){if(!(p=p.times(d)).c)break;o?p.c.length>o&&(p.c.length=o):r&&(p=p.mod(t))}if(i){if(0===(i=u(i/2)))break;l=i%2}else if($(e=e.times(n),e.e+1,1),e.e>14)l=w(e);else{if(0===(i=+Y(e)))break;l=i%2}d=d.times(d),o?d.c&&d.c.length>o&&(d.c.length=o):r&&(d=d.mod(t))}return r?p:(f&&(p=P.div(p)),t?p.mod(t):o?$(p,V,B,undefined):p)},x.integerValue=function(e){var t=new G(this);return null==e?e=B:m(e,0,8),$(t,t.e+1,e)},x.isEqualTo=x.eq=function(e,t){return 0===b(this,new G(e,t))},x.isFinite=function(){return!!this.c},x.isGreaterThan=x.gt=function(e,t){return b(this,new G(e,t))>0},x.isGreaterThanOrEqualTo=x.gte=function(e,t){return 1===(t=b(this,new G(e,t)))||0===t},x.isInteger=function(){return!!this.c&&_(this.e/h)>this.c.length-2},x.isLessThan=x.lt=function(e,t){return b(this,new G(e,t))<0},x.isLessThanOrEqualTo=x.lte=function(e,t){return-1===(t=b(this,new G(e,t)))||0===t},x.isNaN=function(){return!this.s},x.isNegative=function(){return this.s<0},x.isPositive=function(){return this.s>0},x.isZero=function(){return!!this.c&&0==this.c[0]},x.minus=function(e,t){var n,r,i,o,a=this,s=a.s;if(t=(e=new G(e,t)).s,!s||!t)return new G(NaN);if(s!=t)return e.s=-t,a.plus(e);var u=a.e/h,c=e.e/h,f=a.c,p=e.c;if(!u||!c){if(!f||!p)return f?(e.s=-t,e):new G(p?a:NaN);if(!f[0]||!p[0])return p[0]?(e.s=-t,e):new G(f[0]?a:3==B?-0:0)}if(u=_(u),c=_(c),f=f.slice(),s=u-c){for((o=s<0)?(s=-s,i=f):(c=u,i=p),i.reverse(),t=s;t--;i.push(0));i.reverse()}else for(r=(o=(s=f.length)<(t=p.length))?s:t,s=t=0;t<r;t++)if(f[t]!=p[t]){o=f[t]<p[t];break}if(o&&(i=f,f=p,p=i,e.s=-e.s),(t=(r=p.length)-(n=f.length))>0)for(;t--;f[n++]=0);for(t=l-1;r>s;){if(f[--r]<p[r]){for(n=r;n&&!f[--n];f[n]=t);--f[n],f[r]+=l}f[r]-=p[r]}for(;0==f[0];f.splice(0,1),--c);return f[0]?q(e,f,c):(e.s=3==B?-1:1,e.c=[e.e=0],e)},x.modulo=x.mod=function(e,t){var r,i,o=this;return e=new G(e,t),!o.c||!e.s||e.c&&!e.c[0]?new G(NaN):!e.c||o.c&&!o.c[0]?new G(o):(9==j?(i=e.s,e.s=1,r=n(o,e,0,3),e.s=i,r.s*=i):r=n(o,e,0,j),(e=o.minus(r.times(e))).c[0]||1!=j||(e.s=o.s),e)},x.multipliedBy=x.times=function(e,t){var n,r,i,o,a,s,u,c,f,p,d,y,v,b,m,w=this,T=w.c,E=(e=new G(e,t)).c;if(!(T&&E&&T[0]&&E[0]))return!w.s||!e.s||T&&!T[0]&&!E||E&&!E[0]&&!T?e.c=e.e=e.s=null:(e.s*=w.s,T&&E?(e.c=[0],e.e=0):e.c=e.e=null),e;for(r=_(w.e/h)+_(e.e/h),e.s*=w.s,(u=T.length)<(p=E.length)&&(v=T,T=E,E=v,i=u,u=p,p=i),i=u+p,v=[];i--;v.push(0));for(b=l,m=g,i=p;--i>=0;){for(n=0,d=E[i]%m,y=E[i]/m|0,o=i+(a=u);o>i;)n=((c=d*(c=T[--a]%m)+(s=y*c+(f=T[a]/m|0)*d)%m*m+v[o]+n)/b|0)+(s/m|0)+y*f,v[o--]=c%b;v[o]=n}return n?++r:v.splice(0,1),q(e,v,r)},x.negated=function(){var e=new G(this);return e.s=-e.s||null,e},x.plus=function(e,t){var n,r=this,i=r.s;if(t=(e=new G(e,t)).s,!i||!t)return new G(NaN);if(i!=t)return e.s=-t,r.minus(e);var o=r.e/h,a=e.e/h,s=r.c,u=e.c;if(!o||!a){if(!s||!u)return new G(i/0);if(!s[0]||!u[0])return u[0]?e:new G(s[0]?r:0*i)}if(o=_(o),a=_(a),s=s.slice(),i=o-a){for(i>0?(a=o,n=u):(i=-i,n=s),n.reverse();i--;n.push(0));n.reverse()}for((i=s.length)-(t=u.length)<0&&(n=u,u=s,s=n,t=i),i=0;t;)i=(s[--t]=s[t]+u[t]+i)/l|0,s[t]=l===s[t]?0:s[t]%l;return i&&(s=[i].concat(s),++a),q(e,s,a)},x.precision=x.sd=function(e,t){var n,r,i,o=this;if(null!=e&&e!==!!e)return m(e,1,y),null==t?t=B:m(t,0,8),$(new G(o),e,t);if(!(n=o.c))return null;if(r=(i=n.length-1)*h+1,i=n[i]){for(;i%10==0;i/=10,r--);for(i=n[0];i>=10;i/=10,r++);}return e&&o.e+1>r&&(r=o.e+1),r},x.shiftedBy=function(e){return m(e,-9007199254740991,p),this.times("1e"+e)},x.squareRoot=x.sqrt=function(){var e,t,r,i,o,a=this,s=a.c,u=a.s,c=a.e,f=D+4,l=new G("0.5");if(1!==u||!s||!s[0])return new G(!u||u<0&&(!s||s[0])?NaN:s?a:1/0);if(0==(u=Math.sqrt(+Y(a)))||u==1/0?(((t=v(s)).length+c)%2==0&&(t+="0"),u=Math.sqrt(+t),c=_((c+1)/2)-(c<0||c%2),r=new G(t=u==1/0?"5e"+c:(t=u.toExponential()).slice(0,t.indexOf("e")+1)+c)):r=new G(u+""),r.c[0])for((u=(c=r.e)+f)<3&&(u=0);;)if(o=r,r=l.times(o.plus(n(a,o,f,1))),v(o.c).slice(0,u)===(t=v(r.c)).slice(0,u)){if(r.e<c&&--u,"9999"!=(t=t.slice(u-3,u+1))&&(i||"4999"!=t)){+t&&(+t.slice(1)||"5"!=t.charAt(0))||($(r,r.e+D+2,1),e=!r.times(r).eq(a));break}if(!i&&($(o,o.e+D+2,0),o.times(o).eq(a))){r=o;break}f+=4,u+=4,i=1}return $(r,r.e+D+1,B,e)},x.toExponential=function(e,t){return null!=e&&(m(e,0,y),e++),K(this,e,t,1)},x.toFixed=function(e,t){return null!=e&&(m(e,0,y),e=e+this.e+1),K(this,e,t)},x.toFormat=function(e,t,n){var r,i=this;if(null==n)null!=e&&t&&"object"==typeof t?(n=t,t=null):e&&"object"==typeof e?(n=e,e=t=null):n=H;else if("object"!=typeof n)throw Error(c+"Argument not an object: "+n);if(r=i.toFixed(e,t),i.c){var o,a=r.split("."),s=+n.groupSize,u=+n.secondaryGroupSize,f=n.groupSeparator||"",l=a[0],h=a[1],p=i.s<0,d=p?l.slice(1):l,g=d.length;if(u&&(o=s,s=u,u=o,g-=o),s>0&&g>0){for(o=g%s||s,l=d.substr(0,o);o<g;o+=s)l+=f+d.substr(o,s);u>0&&(l+=f+d.slice(o)),p&&(l="-"+l)}r=h?l+(n.decimalSeparator||"")+((u=+n.fractionGroupSize)?h.replace(new RegExp("\\d{"+u+"}\\B","g"),"$&"+(n.fractionGroupSeparator||"")):h):l}return(n.prefix||"")+r+(n.suffix||"")},x.toFraction=function(e){var t,r,i,o,a,s,u,f,l,p,g,y,_=this,b=_.c;if(null!=e&&(!(u=new G(e)).isInteger()&&(u.c||1!==u.s)||u.lt(P)))throw Error(c+"Argument "+(u.isInteger()?"out of range: ":"not an integer: ")+Y(u));if(!b)return new G(_);for(t=new G(P),l=r=new G(P),i=f=new G(P),y=v(b),a=t.e=y.length-_.e-1,t.c[0]=d[(s=a%h)<0?h+s:s],e=!e||u.comparedTo(t)>0?a>0?t:l:u,s=U,U=1/0,u=new G(y),f.c[0]=0;p=n(u,t,0,1),1!=(o=r.plus(p.times(i))).comparedTo(e);)r=i,i=o,l=f.plus(p.times(o=l)),f=o,t=u.minus(p.times(o=t)),u=o;return o=n(e.minus(r),i,0,1),f=f.plus(o.times(l)),r=r.plus(o.times(i)),f.s=l.s=_.s,g=n(l,i,a*=2,B).minus(_).abs().comparedTo(n(f,r,a,B).minus(_).abs())<1?[l,i]:[f,r],U=s,g},x.toNumber=function(){return+Y(this)},x.toPrecision=function(e,t){return null!=e&&m(e,1,y),K(this,e,t,2)},x.toString=function(e){var t,n=this,i=n.s,o=n.e;return null===o?i?(t="Infinity",i<0&&(t="-"+t)):t="NaN":(null==e?t=o<=N||o>=k?T(v(n.c),o):E(v(n.c),o,"0"):10===e&&W?t=E(v((n=$(new G(n),D+o+1,B)).c),n.e,"0"):(m(e,2,F.length,"Base"),t=r(E(v(n.c),o,"0"),10,e,i,!0)),i<0&&n.c[0]&&(t="-"+t)),t},x.valueOf=x.toJSON=function(){return Y(this)},x._isBigNumber=!0,null!=t&&G.set(t),G}(),o.default=o.BigNumber=o,void 0===(r=function(){return o}.call(t,n,t,e))||(e.exports=r)}()},8442:(e,t,n)=>{const r=n(9488);function i(e,t,n){const r=e[t]+e[n];let i=e[t+1]+e[n+1];r>=4294967296&&i++,e[t]=r,e[t+1]=i}function o(e,t,n,r){let i=e[t]+n;n<0&&(i+=4294967296);let o=e[t+1]+r;i>=4294967296&&o++,e[t]=i,e[t+1]=o}function a(e,t){return e[t]^e[t+1]<<8^e[t+2]<<16^e[t+3]<<24}function s(e,t,n,r,a,s){const u=l[a],c=l[a+1],h=l[s],p=l[s+1];i(f,e,t),o(f,e,u,c);let d=f[r]^f[e],g=f[r+1]^f[e+1];f[r]=g,f[r+1]=d,i(f,n,r),d=f[t]^f[n],g=f[t+1]^f[n+1],f[t]=d>>>24^g<<8,f[t+1]=g>>>24^d<<8,i(f,e,t),o(f,e,h,p),d=f[r]^f[e],g=f[r+1]^f[e+1],f[r]=d>>>16^g<<16,f[r+1]=g>>>16^d<<16,i(f,n,r),d=f[t]^f[n],g=f[t+1]^f[n+1],f[t]=g>>>31^d<<1,f[t+1]=d>>>31^g<<1}const u=new Uint32Array([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),c=new Uint8Array([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3].map((function(e){return 2*e}))),f=new Uint32Array(32),l=new Uint32Array(32);function h(e,t){let n=0;for(n=0;n<16;n++)f[n]=e.h[n],f[n+16]=u[n];for(f[24]=f[24]^e.t,f[25]=f[25]^e.t/4294967296,t&&(f[28]=~f[28],f[29]=~f[29]),n=0;n<32;n++)l[n]=a(e.b,4*n);for(n=0;n<12;n++)s(0,8,16,24,c[16*n+0],c[16*n+1]),s(2,10,18,26,c[16*n+2],c[16*n+3]),s(4,12,20,28,c[16*n+4],c[16*n+5]),s(6,14,22,30,c[16*n+6],c[16*n+7]),s(0,10,20,30,c[16*n+8],c[16*n+9]),s(2,12,22,24,c[16*n+10],c[16*n+11]),s(4,14,16,26,c[16*n+12],c[16*n+13]),s(6,8,18,28,c[16*n+14],c[16*n+15]);for(n=0;n<16;n++)e.h[n]=e.h[n]^f[n]^f[n+16]}const p=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);function d(e,t,n,r){if(0===e||e>64)throw new Error("Illegal output length, expected 0 < length <= 64");if(t&&t.length>64)throw new Error("Illegal key, expected Uint8Array with 0 < length <= 64");if(n&&16!==n.length)throw new Error("Illegal salt, expected Uint8Array with length is 16");if(r&&16!==r.length)throw new Error("Illegal personal, expected Uint8Array with length is 16");const i={b:new Uint8Array(128),h:new Uint32Array(16),t:0,c:0,outlen:e};p.fill(0),p[0]=e,t&&(p[1]=t.length),p[2]=1,p[3]=1,n&&p.set(n,32),r&&p.set(r,48);for(let e=0;e<16;e++)i.h[e]=u[e]^a(p,4*e);return t&&(g(i,t),i.c=128),i}function g(e,t){for(let n=0;n<t.length;n++)128===e.c&&(e.t+=e.c,h(e,!1),e.c=0),e.b[e.c++]=t[n]}function y(e){for(e.t+=e.c;e.c<128;)e.b[e.c++]=0;h(e,!0);const t=new Uint8Array(e.outlen);for(let n=0;n<e.outlen;n++)t[n]=e.h[n>>2]>>8*(3&n);return t}function _(e,t,n,i,o){n=n||64,e=r.normalizeInput(e),i&&(i=r.normalizeInput(i)),o&&(o=r.normalizeInput(o));const a=d(n,t,i,o);return g(a,e),y(a)}e.exports={blake2b:_,blake2bHex:function(e,t,n,i,o){const a=_(e,t,n,i,o);return r.toHex(a)},blake2bInit:d,blake2bUpdate:g,blake2bFinal:y}},5297:(e,t,n)=>{const r=n(9488);function i(e,t){return e[t]^e[t+1]<<8^e[t+2]<<16^e[t+3]<<24}function o(e,t,n,r,i,o){c[e]=c[e]+c[t]+i,c[r]=a(c[r]^c[e],16),c[n]=c[n]+c[r],c[t]=a(c[t]^c[n],12),c[e]=c[e]+c[t]+o,c[r]=a(c[r]^c[e],8),c[n]=c[n]+c[r],c[t]=a(c[t]^c[n],7)}function a(e,t){return e>>>t^e<<32-t}const s=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),u=new Uint8Array([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0]),c=new Uint32Array(16),f=new Uint32Array(16);function l(e,t){let n=0;for(n=0;n<8;n++)c[n]=e.h[n],c[n+8]=s[n];for(c[12]^=e.t,c[13]^=e.t/4294967296,t&&(c[14]=~c[14]),n=0;n<16;n++)f[n]=i(e.b,4*n);for(n=0;n<10;n++)o(0,4,8,12,f[u[16*n+0]],f[u[16*n+1]]),o(1,5,9,13,f[u[16*n+2]],f[u[16*n+3]]),o(2,6,10,14,f[u[16*n+4]],f[u[16*n+5]]),o(3,7,11,15,f[u[16*n+6]],f[u[16*n+7]]),o(0,5,10,15,f[u[16*n+8]],f[u[16*n+9]]),o(1,6,11,12,f[u[16*n+10]],f[u[16*n+11]]),o(2,7,8,13,f[u[16*n+12]],f[u[16*n+13]]),o(3,4,9,14,f[u[16*n+14]],f[u[16*n+15]]);for(n=0;n<8;n++)e.h[n]^=c[n]^c[n+8]}function h(e,t){if(!(e>0&&e<=32))throw new Error("Incorrect output length, should be in [1, 32]");const n=t?t.length:0;if(t&&!(n>0&&n<=32))throw new Error("Incorrect key length, should be in [1, 32]");const r={h:new Uint32Array(s),b:new Uint8Array(64),c:0,t:0,outlen:e};return r.h[0]^=16842752^n<<8^e,n>0&&(p(r,t),r.c=64),r}function p(e,t){for(let n=0;n<t.length;n++)64===e.c&&(e.t+=e.c,l(e,!1),e.c=0),e.b[e.c++]=t[n]}function d(e){for(e.t+=e.c;e.c<64;)e.b[e.c++]=0;l(e,!0);const t=new Uint8Array(e.outlen);for(let n=0;n<e.outlen;n++)t[n]=e.h[n>>2]>>8*(3&n)&255;return t}function g(e,t,n){n=n||32,e=r.normalizeInput(e);const i=h(n,t);return p(i,e),d(i)}e.exports={blake2s:g,blake2sHex:function(e,t,n){const i=g(e,t,n);return r.toHex(i)},blake2sInit:h,blake2sUpdate:p,blake2sFinal:d}},1191:(e,t,n)=>{const r=n(8442),i=n(5297);e.exports={blake2b:r.blake2b,blake2bHex:r.blake2bHex,blake2bInit:r.blake2bInit,blake2bUpdate:r.blake2bUpdate,blake2bFinal:r.blake2bFinal,blake2s:i.blake2s,blake2sHex:i.blake2sHex,blake2sInit:i.blake2sInit,blake2sUpdate:i.blake2sUpdate,blake2sFinal:i.blake2sFinal}},9488:e=>{function t(e){return(4294967296+e).toString(16).substring(1)}e.exports={normalizeInput:function(e){let t;if(e instanceof Uint8Array)t=e;else{if("string"!=typeof e)throw new Error("Input must be an string, Buffer or Uint8Array");t=(new TextEncoder).encode(e)}return t},toHex:function(e){return Array.prototype.map.call(e,(function(e){return(e<16?"0":"")+e.toString(16)})).join("")},debugPrint:function(e,n,r){let i="\n"+e+" = ";for(let o=0;o<n.length;o+=2){if(32===r)i+=t(n[o]).toUpperCase(),i+=" ",i+=t(n[o+1]).toUpperCase();else{if(64!==r)throw new Error("Invalid size "+r);i+=t(n[o+1]).toUpperCase(),i+=t(n[o]).toUpperCase()}o%6==4?i+="\n"+new Array(e.length+4).join(" "):o<n.length-2&&(i+=" ")}console.log(i)},testSpeed:function(e,t,n){let r=(new Date).getTime();const i=new Uint8Array(t);for(let e=0;e<t;e++)i[e]=e%256;const o=(new Date).getTime();console.log("Generated random input in "+(o-r)+"ms"),r=o;for(let o=0;o<n;o++){const n=e(i),o=(new Date).getTime(),a=o-r;r=o,console.log("Hashed in "+a+"ms: "+n.substring(0,20)+"..."),console.log(Math.round(t/(1<<20)/(a/1e3)*100)/100+" MB PER SECOND")}}}},7191:(e,t,n)=>{const r=n(8162);e.exports=r("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")},8764:(e,t,n)=>{"use strict";const r=n(9742),i=n(645),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=u,t.SlowBuffer=function(e){+e!=e&&(e=0);return u.alloc(+e)},t.INSPECT_MAX_BYTES=50;const a=2147483647;function s(e){if(e>a)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,u.prototype),t}function u(e,t,n){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return l(e)}return c(e,t,n)}function c(e,t,n){if("string"==typeof e)return function(e,t){"string"==typeof t&&""!==t||(t="utf8");if(!u.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const n=0|g(e,t);let r=s(n);const i=r.write(e,t);i!==n&&(r=r.slice(0,i));return r}(e,t);if(ArrayBuffer.isView(e))return function(e){if(Y(e,Uint8Array)){const t=new Uint8Array(e);return p(t.buffer,t.byteOffset,t.byteLength)}return h(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(Y(e,ArrayBuffer)||e&&Y(e.buffer,ArrayBuffer))return p(e,t,n);if("undefined"!=typeof SharedArrayBuffer&&(Y(e,SharedArrayBuffer)||e&&Y(e.buffer,SharedArrayBuffer)))return p(e,t,n);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const r=e.valueOf&&e.valueOf();if(null!=r&&r!==e)return u.from(r,t,n);const i=function(e){if(u.isBuffer(e)){const t=0|d(e.length),n=s(t);return 0===n.length||e.copy(n,0,0,t),n}if(void 0!==e.length)return"number"!=typeof e.length||X(e.length)?s(0):h(e);if("Buffer"===e.type&&Array.isArray(e.data))return h(e.data)}(e);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return u.from(e[Symbol.toPrimitive]("string"),t,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function f(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function l(e){return f(e),s(e<0?0:0|d(e))}function h(e){const t=e.length<0?0:0|d(e.length),n=s(t);for(let r=0;r<t;r+=1)n[r]=255&e[r];return n}function p(e,t,n){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(n||0))throw new RangeError('"length" is outside of buffer bounds');let r;return r=void 0===t&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,t):new Uint8Array(e,t,n),Object.setPrototypeOf(r,u.prototype),r}function d(e){if(e>=a)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a.toString(16)+" bytes");return 0|e}function g(e,t){if(u.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||Y(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const n=e.length,r=arguments.length>2&&!0===arguments[2];if(!r&&0===n)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return z(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return q(e).length;default:if(i)return r?-1:z(e).length;t=(""+t).toLowerCase(),i=!0}}function y(e,t,n){let r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return x(this,t,n);case"utf8":case"utf-8":return R(this,t,n);case"ascii":return O(this,t,n);case"latin1":case"binary":return C(this,t,n);case"base64":return A(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function _(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function v(e,t,n,r,i){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),X(n=+n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof t&&(t=u.from(t,r)),u.isBuffer(t))return 0===t.length?-1:b(e,t,n,r,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):b(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function b(e,t,n,r,i){let o,a=1,s=e.length,u=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;a=2,s/=2,u/=2,n/=2}function c(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){let r=-1;for(o=n;o<s;o++)if(c(e,o)===c(t,-1===r?0:o-r)){if(-1===r&&(r=o),o-r+1===u)return r*a}else-1!==r&&(o-=o-r),r=-1}else for(n+u>s&&(n=s-u),o=n;o>=0;o--){let n=!0;for(let r=0;r<u;r++)if(c(e,o+r)!==c(t,r)){n=!1;break}if(n)return o}return-1}function m(e,t,n,r){n=Number(n)||0;const i=e.length-n;r?(r=Number(r))>i&&(r=i):r=i;const o=t.length;let a;for(r>o/2&&(r=o/2),a=0;a<r;++a){const r=parseInt(t.substr(2*a,2),16);if(X(r))return a;e[n+a]=r}return a}function w(e,t,n,r){return $(z(t,e.length-n),e,n,r)}function T(e,t,n,r){return $(function(e){const t=[];for(let n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}(t),e,n,r)}function E(e,t,n,r){return $(q(t),e,n,r)}function S(e,t,n,r){return $(function(e,t){let n,r,i;const o=[];for(let a=0;a<e.length&&!((t-=2)<0);++a)n=e.charCodeAt(a),r=n>>8,i=n%256,o.push(i),o.push(r);return o}(t,e.length-n),e,n,r)}function A(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function R(e,t,n){n=Math.min(e.length,n);const r=[];let i=t;for(;i<n;){const t=e[i];let o=null,a=t>239?4:t>223?3:t>191?2:1;if(i+a<=n){let n,r,s,u;switch(a){case 1:t<128&&(o=t);break;case 2:n=e[i+1],128==(192&n)&&(u=(31&t)<<6|63&n,u>127&&(o=u));break;case 3:n=e[i+1],r=e[i+2],128==(192&n)&&128==(192&r)&&(u=(15&t)<<12|(63&n)<<6|63&r,u>2047&&(u<55296||u>57343)&&(o=u));break;case 4:n=e[i+1],r=e[i+2],s=e[i+3],128==(192&n)&&128==(192&r)&&128==(192&s)&&(u=(15&t)<<18|(63&n)<<12|(63&r)<<6|63&s,u>65535&&u<1114112&&(o=u))}}null===o?(o=65533,a=1):o>65535&&(o-=65536,r.push(o>>>10&1023|55296),o=56320|1023&o),r.push(o),i+=a}return function(e){const t=e.length;if(t<=I)return String.fromCharCode.apply(String,e);let n="",r=0;for(;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=I));return n}(r)}t.kMaxLength=a,u.TYPED_ARRAY_SUPPORT=function(){try{const e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),u.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(u.prototype,"parent",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.buffer}}),Object.defineProperty(u.prototype,"offset",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.byteOffset}}),u.poolSize=8192,u.from=function(e,t,n){return c(e,t,n)},Object.setPrototypeOf(u.prototype,Uint8Array.prototype),Object.setPrototypeOf(u,Uint8Array),u.alloc=function(e,t,n){return function(e,t,n){return f(e),e<=0?s(e):void 0!==t?"string"==typeof n?s(e).fill(t,n):s(e).fill(t):s(e)}(e,t,n)},u.allocUnsafe=function(e){return l(e)},u.allocUnsafeSlow=function(e){return l(e)},u.isBuffer=function(e){return null!=e&&!0===