UNPKG

@stricahq/typhonjs

Version:

Pure JS Cardano Wallet library

1 lines 244 kB
var typhonjs;(()=>{var e={4963:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(8287);t.default=class{constructor(){this.buf=n.Buffer.alloc(0)}get length(){return this.buf.length}read(e){if(0===e)return n.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=n.Buffer.concat([this.buf,e]))}}},9264:(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}}},7203:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});class r extends Map{constructor(){super(...arguments),this.byteSpan=[0,0]}setByteSpan(e){this.byteSpan=e}getByteSpan(){return this.byteSpan}}t.default=r},1973:(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}}},7565:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),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 r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);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=r(8287),u=o(r(8310)),c=a(r(1594)),f=r(1156),l=a(r(4963)),h=a(r(1154)),p=a(r(1973)),d=a(r(9264)),g=a(r(7203)),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 _,r=new l.default;r.push(e);const n=t.parse();let i=n.next();for(;!i.done;){const e=r.read(i.value);if(null==e||e.length!==i.value)throw new Error("Insufficient data");i=n.next(e)}if(r.length>0)throw new Error("Remaining Bytes");return{bytes:e,value:i.value}}readUInt64(e,t,r){const n=(0,f.getBigNum)(e,t);return c.default.isBigNumber(n)?(0,f.addSpanBytesToObject)(n,[r,this.offset]):n}updateTracker(e){this.usedBytes.push(e),this.offset+=e.length}*readIndefiniteStringLength(e,t){let r,n=yield 1;const i=n.readUInt8(0);if(255===i)r=-1;else{const o=31&i,a=this.readLength(o,t);let s=a.next();for(;!s.done;)n=yield s.value,this.updateTracker(n),s=a.next(n);if(r=s.value,r<0||i>>5!==e)throw new Error("Invalid indefinite length encoding")}return r}*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),r=(yield 4).readUInt32BE(0);return this.readUInt64(e,r,t)}if(31===e)return-1;throw new Error("Invalid length encoding")}_transform(e,t,r){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 r(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 r()}*parse(e){let t,r=this.offset;e?(t=e,r-=e.length):(t=yield 1,this.updateTracker(t));const n=t.readUInt8(0),i=n>>5,o=31&n;let a;if(7===i){if(25===o){t=yield 2,this.updateTracker(t);return(e=>{const t=32768&e;let r=31744&e;const n=1023&e;if(31744===r)r=261120;else if(0!==r)r+=114688;else if(0!==n)return(t?-1:1)*n*f.POW_2_24;const i=s.Buffer.alloc(4);return i.writeUInt32BE(t<<16|r<<13|n<<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,r);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,[r,this.offset])}if(c.default.isBigNumber(a)){const e=new c.default(-1).minus(a);return(0,f.addSpanBytesToObject)(e,[r,this.offset])}return-1-a;case 2:if(a<0){const e=[];{const e=this.readIndefiniteStringLength(i,r);let n=e.next();for(;!n.done;)t=yield n.value,this.updateTracker(t),n=e.next(t);a=n.value}for(;a>=0;){t=yield a,this.updateTracker(t),e.push(t);{const e=this.readIndefiniteStringLength(i,r);let n=e.next();for(;!n.done;)t=yield n.value,this.updateTracker(t),n=e.next(t);a=n.value}}const n=s.Buffer.concat(e);return(0,f.addSpanBytesToObject)(n,[r,this.offset])}return t=yield a,this.updateTracker(t),(0,f.addSpanBytesToObject)(t,[r,this.offset]);case 3:{const e=[];if(a<0){{const e=this.readIndefiniteStringLength(i,r);let n=e.next();for(;!n.done;)t=yield n.value,this.updateTracker(t),n=e.next(t);a=n.value}for(;a>=0;){t=yield a,this.updateTracker(t),e.push(t);{const e=this.readIndefiniteStringLength(i,r);let n=e.next();for(;!n.done;)t=yield n.value,this.updateTracker(t),n=e.next(t);a=n.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 n=t.readUInt8(0);for(;!y(n);)e.push(yield*this.parse(t)),t=yield 1,this.updateTracker(t),n=t.readUInt8(0);return e.setByteSpan([r,this.offset]),e}const e=new d.default;for(let t=0;t<a;t+=1)e.push(yield*this.parse());return e.setByteSpan([r,this.offset]),e}case 5:{if(a<0){const e=new g.default;t=yield 1,this.updateTracker(t);let n=t.readUInt8(0);for(;!y(n);){const r=yield*this.parse(t),i=yield*this.parse();e.set(r,i),t=yield 1,this.updateTracker(t),n=t.readUInt8(0)}return e.setByteSpan([r,this.offset]),e}const e=new g.default;for(let t=0;t<a;t+=1){const t=yield*this.parse(),r=yield*this.parse();e.set(t,r)}return e.setByteSpan([r,this.offset]),e}case 6:{const e=new p.default(yield*this.parse(),a);return e.setByteSpan([r,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=_},1154:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=class{constructor(e){this.value=e}}},4199:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=r(8287),o=n(r(1594)),a=r(5705),s=r(9044),u=r(1156),c=i.Buffer.from("f97e00","hex"),f=i.Buffer.from("ff","hex");t.default=(e,t={collapseBigNumber:!0})=>{const r=[];function n(e){const t=i.Buffer.allocUnsafe(1);t.writeUInt8(e,0),r.push(t)}function l(e){r.push(e)}function h(e){const t=i.Buffer.allocUnsafe(4);t.writeUInt32BE(e,0),r.push(t)}function p(e,t){t<24?n(e<<5|t):t<256?(n(e<<5|24),n(t)):t<65536?(n(e<<5|25),function(e){const t=i.Buffer.allocUnsafe(2);t.writeUInt16BE(e,0),r.push(t)}(t)):t<4294967296?(n(e<<5|26),h(t)):(n(e<<5|27),function(e){const t=e%u.POW_2_32,n=(e-t)/u.POW_2_32,o=i.Buffer.allocUnsafe(8);o.writeUInt32BE(n,0),o.writeUInt32BE(t,4),r.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 r=e,o=0,a=2;if(r.isNegative()&&(r=r.negated().minus(1),o=1,a=3),t.collapseBigNumber&&r.lte(u.MAX_BIG_NUM_INT64)){if(r.lte(u.MAX_BIG_NUM_INT32))return p(o,r.toNumber());n(o<<5|27),h(r.dividedToIntegerBy(u.SHIFT32).toNumber()),h(r.mod(u.SHIFT32).toNumber())}else{let e=r.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 n(244);if(!0===t)return n(245);if(null===t)return n(246);if(void 0===t)return n(247);switch(typeof t){case"number":return Math.round(t)===t?d(t):(n(251),function(e){const t=i.Buffer.allocUnsafe(8);t.writeDoubleBE(e),r.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?n(159):p(4,t.length);for(const r of t)e(r);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(),r=e.shiftedBy(t);d(-t),r.abs().isLessThan(u.MAX_BIG_NUM_INT)?d(r.toNumber()):g(r)}}(t);else if(t instanceof a.CborTag)p(6,t.tag),e(t.value);else{let r;r=t instanceof Map?[...t.entries()]:[...Object.entries(t)],t instanceof s.IndefiniteMap?n(191):p(5,r.length);for(const[t,n]of r)e(t),e(n);t instanceof s.IndefiniteMap&&l(f)}}}(e),i.Buffer.concat(r)}},9044:function(e,t,r){"use strict";var n=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=r(1973);Object.defineProperty(t,"CborTag",{enumerable:!0,get:function(){return n(o).default}})},5705:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)},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(r(4199));t.Encoder={encode:a.default};var s=r(7565);Object.defineProperty(t,"Decoder",{enumerable:!0,get:function(){return o(s).default}}),i(r(9044),t)},1156:function(e,t,r){"use strict";var n=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=n(r(1594));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,r)=>e>2097151?new i.default(e).times(t.SHIFT32).plus(r):e*t.SHIFT32+r;t.addSpanBytesToObject=(e,t)=>{const r=e;return r.byteSpan=t,r.getByteSpan=function(){return this.byteSpan},r};const o=new TextDecoder("utf8",{fatal:!0,ignoreBOM:!0});t.utf8Decoder=e=>o.decode(e)},5364:e=>{"use strict";e.exports=function(e){if(e.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),r=0;r<t.length;r++)t[r]=255;for(var n=0;n<e.length;n++){var i=e.charAt(n),o=i.charCodeAt(0);if(255!==t[o])throw new TypeError(i+" is ambiguous");t[o]=n}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 r=0,n=0,i=0;e[r]===s;)n++,r++;for(var o=(e.length-r)*u+1>>>0,c=new Uint8Array(o);e[r];){var f=t[e.charCodeAt(r)];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,r++}for(var p=o-i;p!==o&&0===c[p];)p++;for(var d=new Uint8Array(n+(o-p)),g=n;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 r=0,n=0,i=0,o=t.length;i!==o&&0===t[i];)i++,r++;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<n)&&-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");n=h,i++}for(var d=u-n;d!==u&&0===f[d];)d++;for(var g=s.repeat(r);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")}}}},7526:(e,t)=>{"use strict";t.byteLength=function(e){var t=s(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,o=s(e),a=o[0],u=o[1],c=new i(function(e,t,r){return 3*(t+r)/4-r}(0,a,u)),f=0,l=u>0?a-4:a;for(r=0;r<l;r+=4)t=n[e.charCodeAt(r)]<<18|n[e.charCodeAt(r+1)]<<12|n[e.charCodeAt(r+2)]<<6|n[e.charCodeAt(r+3)],c[f++]=t>>16&255,c[f++]=t>>8&255,c[f++]=255&t;2===u&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,c[f++]=255&t);1===u&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,c[f++]=t>>8&255,c[f++]=255&t);return c},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,o=[],a=16383,s=0,c=n-i;s<c;s+=a)o.push(u(e,s,s+a>c?c:s+a));1===i?(t=e[n-1],o.push(r[t>>2]+r[t<<4&63]+"==")):2===i&&(t=(e[n-2]<<8)+e[n-1],o.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"="));return o.join("")};for(var r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0;a<64;++a)r[a]=o[a],n[o.charCodeAt(a)]=a;function s(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function u(e,t,n){for(var i,o,a=[],s=t;s<n;s+=3)i=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(255&e[s+2]),a.push(r[(o=i)>>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return a.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},2343:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bech32m=t.bech32=void 0;const r="qpzry9x8gf2tvdw0s3jn54khce6mua7l",n={};for(let e=0;e<32;e++){const t=r.charAt(e);n[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 r=0;r<e.length;++r){const n=e.charCodeAt(r);if(n<33||n>126)return"Invalid prefix ("+e+")";t=i(t)^n>>5}t=i(t);for(let r=0;r<e.length;++r){const n=e.charCodeAt(r);t=i(t)^31&n}return t}function a(e,t,r,n){let i=0,o=0;const a=(1<<r)-1,s=[];for(let n=0;n<e.length;++n)for(i=i<<t|e[n],o+=t;o>=r;)o-=r,s.push(i>>o&a);if(n)o>0&&s.push(i<<r-o&a);else{if(o>=t)return"Excess padding";if(i<<r-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,r){if(r=r||90,e.length<8)return e+" too short";if(e.length>r)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),r=n[t];if(void 0===r)return"Unknown character "+t;l=i(l)^r,e+6>=f.length||h.push(r)}return l!==t?"Invalid checksum for "+e:{prefix:c,words:h}}return t="bech32"===e?1:734539939,{decodeUnsafe:function(e,t){const r=a(e,t);if("object"==typeof r)return r},decode:function(e,t){const r=a(e,t);if("object"==typeof r)return r;throw new Error(r)},encode:function(e,n,a){if(a=a||90,e.length+7+n.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<n.length;++e){const t=n[e];if(t>>5!=0)throw new Error("Non 5-bit word");s=i(s)^t,u+=r.charAt(t)}for(let e=0;e<6;++e)s=i(s);s^=t;for(let e=0;e<6;++e){u+=r.charAt(s>>5*(5-e)&31)}return u},toWords:s,fromWordsUnsafe:u,fromWords:c}}t.bech32=f("bech32"),t.bech32m=f("bech32m")},1594:function(e,t,r){var n;!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,r,n=1,i=e.length,o=e[0]+"";n<i;){for(t=e[n++]+"",r=h-t.length;r--;t="0"+t);o+=t}for(i=o.length;48===o.charCodeAt(--i););return o.slice(0,i+1||1)}function m(e,t){var r,n,i=e.c,o=t.c,a=e.s,s=t.s,u=e.e,c=t.e;if(!a||!s)return null;if(r=i&&!i[0],n=o&&!o[0],r||n)return r?n?0:-s:a;if(a!=s)return a;if(r=a<0,n=u==c,!i||!o)return n?0:!i^r?1:-1;if(!n)return u>c^r?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]^r?1:-1;return u==c?0:u>c^r?1:-1}function b(e,t,r,n){if(e<t||e>r||e!==u(e))throw Error(c+(n||"Argument")+("number"==typeof e?e<t||e>r?" 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,r){var n,i;if(t<0){for(i=r+".";++t;i+=r);e=i+e}else if(++t>(n=e.length)){for(i=r,t-=n;--t;i+=r);e+=i}else t<n&&(e=e.slice(0,t)+"."+e.slice(t));return e}o=function e(t){var r,n,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 r,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(b(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(r=F.slice(0,t),c=l=0,g=y.length;l<g;l++)if(r.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=n(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,r,n){var i,o,a,s,u;if(null==r?r=B:b(r,0,8),!e.c)return e.toString();if(i=e.c[0],a=e.e,null==t)u=v(e.c),u=1==n||2==n&&(a<=N||a>=k)?T(u,a):E(u,a,"0");else if(o=(e=$(new G(e),t,r)).e,s=(u=v(e.c)).length,1==n||2==n&&(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 r,n,i=1,o=new G(e[0]);i<e.length;i++)(!(n=new G(e[i])).s||(r=m(o,n))===t||0===r&&o.s===t)&&(o=n);return o}function q(e,t,r){for(var n=1,i=t.length;!t[--i];t.pop());for(i=t[0];i>=10;i/=10,n++);return(r=n+r*h-1)>U?e.c=e.e=null:r<M?e.c=[e.e=0]:(e.e=r,e.c=t),e}function $(e,t,r,n){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,f=y[p=0],g=u(f/_[i-a-1]%10);else if((p=s((o+1)/h))>=y.length){if(!n)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:u(f/_[i-a-1]%10)}if(n=n||t<0||null!=y[p+1]||(a<0?f:f%_[i-a-1]),n=r<4?(g||n)&&(0==r||r==(e.s<0?3:2)):g>5||5==g&&(4==r||n||6==r&&(o>0?a>0?f/_[i-a]:0:y[p-1])%10&1||r==(e.s<0?8:7)),t<1||!y[0])return y.length=0,n?(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),n)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,r=e.e;return null===r?e.toString():(t=v(e.c),t=r<=N||r>=k?T(t,r):E(t,r,"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,r;if(null!=e){if("object"!=typeof e)throw Error(c+"Object expected: "+e);if(e.hasOwnProperty(t="DECIMAL_PLACES")&&(b(r=e[t],0,y,t),D=r),e.hasOwnProperty(t="ROUNDING_MODE")&&(b(r=e[t],0,8,t),B=r),e.hasOwnProperty(t="EXPONENTIAL_AT")&&((r=e[t])&&r.pop?(b(r[0],-y,0,t),b(r[1],0,y,t),N=r[0],k=r[1]):(b(r,-y,y,t),N=-(k=r<0?-r:r))),e.hasOwnProperty(t="RANGE"))if((r=e[t])&&r.pop)b(r[0],-y,-1,t),b(r[1],1,y,t),M=r[0],U=r[1];else{if(b(r,-y,y,t),!r)throw Error(c+t+" cannot be zero: "+r);M=-(U=r<0?-r:r)}if(e.hasOwnProperty(t="CRYPTO")){if((r=e[t])!==!!r)throw Error(c+t+" not true or false: "+r);if(r){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw L=!r,Error(c+"crypto unavailable");L=r}else L=r}if(e.hasOwnProperty(t="MODULO_MODE")&&(b(r=e[t],0,9,t),j=r),e.hasOwnProperty(t="POW_PRECISION")&&(b(r=e[t],0,y,t),V=r),e.hasOwnProperty(t="FORMAT")){if("object"!=typeof(r=e[t]))throw Error(c+t+" not an object: "+r);H=r}if(e.hasOwnProperty(t="ALPHABET")){if("string"!=typeof(r=e[t])||/^.?$|[+\-.\s]|(.).*\1/.test(r))throw Error(c+t+" invalid: "+r);W="0123456789"==r.slice(0,10),F=r}}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,r,n=e.c,i=e.e,o=e.s;e:if("[object Array]"=={}.toString.call(n)){if((1===o||-1===o)&&i>=-y&&i<=y&&i===u(i)){if(0===n[0]){if(0===i&&1===n.length)return!0;break e}if((t=(i+1)%h)<1&&(t+=h),String(n[0]).length==t){for(t=0;t<n.length;t++)if((r=n[t])<0||r>=l||r!==u(r))break e;if(0!==r)return!0}}}else if(null===n&&null===i&&(null===o||1===o||-1===o))return!0;throw Error(c+"Invalid BigNumber: "+e)},G.maximum=G.max=function(){return z(arguments,-1)},G.minimum=G.min=function(){return z(arguments,1)},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,r,n,i,o,a=0,f=[],l=new G(P);if(null==e?e=D:b(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?(r=crypto.getRandomValues(new Uint32Array(2)),t[a]=r[0],t[a+1]=r[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=[n=0];else{for(n=-1;0===f[0];f.splice(0,1),n-=h);for(a=1,o=f[0];o>=10;o/=10,a++);a<h&&(n-=h-a)}return l.e=n,l.c=f,l}),G.sum=function(){for(var e=1,t=arguments,r=new G(t[0]);e<t.length;)r=r.plus(t[e++]);return r},n=function(){var e="0123456789";function t(e,t,r,n){for(var i,o,a=[0],s=0,u=e.length;s<u;){for(o=a.length;o--;a[o]*=t);for(a[0]+=n.indexOf(e.charAt(s++)),i=0;i<a.length;i++)a[i]>r-1&&(null==a[i+1]&&(a[i+1]=0),a[i+1]+=a[i]/r|0,a[i]%=r)}return a.reverse()}return function(n,i,o,a,s){var u,c,f,l,h,p,d,g,y=n.indexOf("."),_=D,m=B;for(y>=0&&(l=V,V=0,n=n.replace(".",""),p=(g=new G(i)).pow(n.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(n,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=r(p,g,_,m,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=m<4?(null!=y||h)&&(0==m||m==(p.s<0?3:2)):y>l||y==l&&(4==m||h||6==m&&1&d[c-1]||m==(p.s<0?8:7)),c<1||!d[0])n=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,n="";y<=l;n+=u.charAt(d[y++]));n=E(n,f,u.charAt(0))}return n}}(),r=function(){function e(e,t,r){var n,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)+(n=f*o+(a=e[u]/g|0)*c)%g*g+s)/r|0)+(n/g|0)+f*a,e[u]=i%r;return s&&(e=[s].concat(e)),e}function t(e,t,r,n){var i,o;if(r!=n)o=r>n?1:-1;else for(i=o=0;i<r;i++)if(e[i]!=t[i]){o=e[i]>t[i]?1:-1;break}return o}function r(e,t,r,n){for(var i=0;r--;)e[r]-=i,i=e[r]<t[r]?1:0,e[r]=i*n+e[r]-t[r];for(;!e[0]&&e.length>1;e.splice(0,1));}return function(n,i,o,a,s){var c,f,p,d,g,y,v,m,b,w,T,E,S,A,R,I,O,C=n.s==i.s?1:-1,x=n.c,P=i.c;if(!(x&&x[0]&&P&&P[0]))return new G(n.s&&i.s&&(x?!P||x[0]!=P[0]:P)?x&&0==x[0]||!P?0*C:C/0:NaN);for(b=(m=new G(C)).c=[],C=o+(f=n.e-i.e)+1,s||(s=l,f=_(n.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)b.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--,r(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)),r(w,y,T,s),T=w.length,-1==c)for(;t(P,w,I,T)<1;)g++,r(w,I<T?O:P,T,s),T=w.length}else 0===c&&(g++,w=[0]);b[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],b[0]||b.splice(0,1)}if(s==l){for(p=1,C=b[0];C>=10;C/=10,p++);$(m,o+(m.e=p+f*h-1)+1,a,d)}else m.e=f,m.r=+d;return m}}(),A=/^(-?)0([xbo])(?=\w[\w.]*$)/i,R=/^([^.]+)\.$/,I=/^\.([^.]+)$/,O=/^-?(Infinity|NaN)$/,C=/^\s*\+(?=[\w.])|^\s+|\s+$/g,i=function(e,t,r,n){var i,o=r?t:t.replace(C,"");if(O.test(o))e.s=isNaN(o)?null:o<0?-1:1;else{if(!r&&(o=o.replace(A,(function(e,t,r){return i="x"==(r=r.toLowerCase())?16:"b"==r?2:8,n&&n!=i?e:t})),n&&(i=n,o=o.replace(R,"$1").replace(I,"0.$1")),t!=o))return new G(o,i);if(G.DEBUG)throw Error(c+"Not a"+(n?" base "+n:"")+" 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 m(this,new G(e,t))},x.decimalPlaces=x.dp=function(e,t){var r,n,i,o=this;if(null!=e)return b(e,0,y),null==t?t=B:b(t,0,8),$(new G(o),e+o.e+1,t);if(!(r=o.c))return null;if(n=((i=r.length-1)-_(this.e/h))*h,i=r[i])for(;i%10==0;i/=10,n--);return n<0&&(n=0),n},x.dividedBy=x.div=function(e,t){return r(this,new G(e,t),D,B)},x.dividedToIntegerBy=x.idiv=function(e,t){return r(this,new G(e,t),0,1)},x.exponentiatedBy=x.pow=function(e,t){var r,n,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?e.s*(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);(n=!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?(r=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):n&&(p=p.mod(t))}if(i){if(0===(i=u(i/2)))break;l=i%2}else if($(e=e.times(r),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):n&&(d=d.mod(t))}return n?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:b(e,0,8),$(t,t.e+1,e)},x.isEqualTo=x.eq=function(e,t){return 0===m(this,new G(e,t))},x.isFinite=function(){return!!this.c},x.isGreaterThan=x.gt=function(e,t){return m(this,new G(e,t))>0},x.isGreaterThanOrEqualTo=x.gte=function(e,t){return 1===(t=m(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 m(this,new G(e,t))<0},x.isLessThanOrEqualTo=x.lte=function(e,t){return-1===(t=m(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 r,n,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(n=(o=(s=f.length)<(t=p.length))?s:t,s=t=0;t<n;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=(n=p.length)-(r=f.length))>0)for(;t--;f[r++]=0);for(t=l-1;n>s;){if(f[--n]<p[n]){for(r=n;r&&!f[--r];f[r]=t);--f[r],f[n]+=l}f[n]-=p[n]}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 n,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,n=r(o,e,0,3),e.s=i,n.s*=i):n=r(o,e,0,j),(e=o.minus(n.times(e))).c[0]||1!=j||(e.s=o.s),e)},x.multipliedBy=x.times=function(e,t){var r,n,i,o,a,s,u,c,f,p,d,y,v,m,b,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(n=_(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(m=l,b=g,i=p;--i>=0;){for(r=0,d=E[i]%b,y=E[i]/b|0,o=i+(a=u);o>i;)r=((c=d*(c=T[--a]%b)+(s=y*c+(f=T[a]/b|0)*d)%b*b+v[o]+r)/m|0)+(s/b|0)+y*f,v[o--]=c%m;v[o]=r}return r?++n:v.splice(0,1),q(e,v,n)},x.negated=function(){var e=new G(this);return e.s=-e.s||null,e},x.plus=function(e,t){var r,n=this,i=n.s;if(t=(e=new G(e,t)).s,!i||!t)return new G(NaN);if(i!=t)return e.s=-t,n.minus(e);var o=n.e/h,a=e.e/h,s=n.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]?n:0*i)}if(o=_(o),a=_(a),s=s.slice(),i=o-a){for(i>0?(a=o,r=u):(i=-i,r=s),r.reverse();i--;r.push(0));r.reverse()}for((i=s.length)-(t=u.length)<0&&(r=u,u=s,s=r,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 r,n,i,o=this;if(null!=e&&e!==!!e)return b(e,1,y),null==t?t=B:b(t,0,8),$(new G(o),e,t);if(!(r=o.c))return null;if(n=(i=r.length-1)*h+1,i=r[i]){for(;i%10==0;i/=10,n--);for(i=r[0];i>=10;i/=10,n++);}return e&&o.e+1>n&&(n=o.e+1),n},x.shiftedBy=function(e){return b(e,-9007199254740991,p),this.times("1e"+e)},x.squareRoot=x.sqrt=function(){var e,t,n,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),n=new G(t=u==1/0?"5e"+c:(t=u.toExponential()).slice(0,t.indexOf("e")+1)+c)):n=new G(u+""),n.c[0])for((u=(c=n.e)+f)<3&&(u=0);;)if(o=n,n=l.times(o.plus(r(a,o,f,1))),v(o.c).slice(0,u)===(t=v(n.c)).slice(0,u)){if(n.e<c&&--u,"9999"!=(t=t.slice(u-3,u+1))&&(i||"4999"!=t)){+t&&(+t.slice(1)||"5"!=t.charAt(0))||($(n,n.e+D+2,1),e=!n.times(n).eq(a));break}if(!i&&($(o,o.e+D+2,0),o.times(o).eq(a))){n=o;break}f+=4,u+=4,i=1}return $(n,n.e+D+1,B,e)},x.toExponential=function(e,t){return null!=e&&(b(e,0,y),e++),K(this,e,t,1)},x.toFixed=function(e,t){return null!=e&&(b(e,0,y),e=e+this.e+1),K(this,e,t)},x.toFormat=function(e,t,r){var n,i=this;if(null==r)null!=e&&t&&"object"==typeof t?(r=t,t=null):e&&"object"==typeof e?(r=e,e=t=null):r=H;else if("object"!=typeof r)throw Error(c+"Argument not an object: "+r);if(n=i.toFixed(e,t),i.c){var o,a=n.split("."),s=+r.groupSize,u=+r.secondaryGroupSize,f=r.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)}n=h?l+(r.decimalSeparator||"")+((u=+r.fractionGroupSize)?h.replace(new RegExp("\\d{"+u+"}\\B","g"),"$&"+(r.fractionGroupSeparator||"")):h):l}return(r.prefix||"")+n+(r.suffix||"")},x.toFraction=function(e){var t,n,i,o,a,s,u,f,l,p,g,y,_=this,m=_.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(!m)return new G(_);for(t=new G(P),l=n=new G(P),i=f=new G(P),y=v(m),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=r(u,t,0,1),1!=(o=n.plus(p.times(i))).comparedTo(e);)n=i,i=o,l=f.plus(p.times(o=l)),f=o,t=u.minus(p.times(o=t)),u=o;return o=r(e.minus(n),i,0,1),f=f.plus(o.times(l)),n=n.plus(o.times(i)),f.s=l.s=_.s,g=r(l,i,a*=2,B).minus(_).abs().comparedTo(r(f,n,a,B).minus(_).abs())<1?[l,i]:[f,n],U=s,g},x.toNumber=function(){return+Y(this)},x.toPrecision=function(e,t){return null!=e&&b(e,1,y),K(this,e,t,2)},x.toString=function(e){var t,r=this,i=r.s,o=r.e;return null===o?i?(t="Infinity",i<0&&(t="-"+t)):t="NaN":(null==e?t=o<=N||o>=k?T(v(r.c),o):E(v(r.c),o,"0"):10===e&&W?t=E(v((r=$(new G(r),D+o+1,B)).c),r.e,"0"):(b(e,2,F.length,"Base"),t=n(E(v(r.c),o,"0"),10,e,i,!0)),i<0&&r.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===(n=function(){return o}.call(t,r,t,e))||(e.exports=n)}()},4156:(e,t,r)=>{const n=r(829);function i(e,t,r){const n=e[t]+e[r];let i=e[t+1]+e[r+1];n>=4294967296&&i++,e[t]=n,e[t+1]=i}function o(e,t,r,n){let i=e[t]+r;r<0&&(i+=4294967296);let o=e[t+1]+n;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,r,n,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[n]^f[e],g=f[n+1]^f[e+1];f[n]=g,f[n+1]=d,i(f,r,n),d=f[t]^f[r],g=f[t+1]^f[r+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[n]^f[e],g=f[n+1]^f[e+1],f[n]=d>>>16^g<<16,f[n+1]=g>>>16^d<<16,i(f,r,n),d=f[t]^f[r],g=f[t+1]^f[r+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 r=0;for(r=0;r<16;r++)f[r]=e.h[r],f[r+16]=u[r];for(f[24]=f[24]^e.t,f[25]=f[25]^e.t/4294967296,t&&(f[28]=~f[28],f[29]=~f[29]),r=0;r<32;r++)l[r]=a(e.b,4*r);for(r=0;r<12;r++)s(0,8,16,24,c[16*r+0],c[16*r+1]),s(2,10,18,26,c[16*r+2],c[16*r+3]),s(4,12,20,28,c[16*r+4],c[16*r+5]),s(6,14,22,30,c[16*r+6],c[16*r+7]),s(0,10,20,30,c[16*r+8],c[16*r+9]),s(2,12,22,24,c[16*r+10],c[16*r+11]),s(4,14,16,26,c[16*r+12],c[16*r+13]),s(6,8,18,28,c[16*r+14],c[16*r+15]);for(r=0;r<16;r++)e.h[r]=e.h[r]^f[r]^f[r+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,r,n){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(r&&16!==r.length)throw new Error("Illegal salt, expected Uint8Array with length is 16");if(n&&16!==n.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,r&&p.set(r,32),n&&p.set(n,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 r=0;r<t.length;r++)128===e.c&&(e.t+=e.c,h(e,!1),e.c=0),e.b[e.c++]=t[r]}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 r=0;r<e.outlen;r++)t[r]=e.h[r>>2]>>8*(3&r);return t}function _(e,t,r,i,o){r=r||64,e=n.normalizeInput(e),i&&(i=n.normalizeInput(i)),o&&(o=n.normalizeInput(o));const a=d(r,t,i,o);return g(a,e),y(a)}e.exports={blake2b:_,blake2bHex:function(e,t,r,i,o){const a=_(e,t,r,i,o);return n.toHex(a)},blake2bInit:d,blake2bUpdate:g,blake2bFinal:y}},1843:(e,t,r)=>{const n=r(829);function i(e,t){return e[t]^e[t+1]<<8^e[t+2]<<16^e[t+3]<<24}function o(e,t,r,n,i,o){c[e]=c[e]+c[t]+i,c[n]=a(c[n]^c[e],16),c[r]=c[r]+c[n],c[t]=a(c[t]^c[r],12),c[e]=c[e]+c[t]+o,c[n]=a(c[n]^c[e],8),c[r]=c[r]+c[n],c[t]=a(c[t]^c[r],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 r=0;for(r=0;r<8;r++)c[r]=e.h[r],c[r+8]=s[r];for(c[12]^=e.t,c[13]^=e.t/4294967296,t&&(c[14]=~c[14]),r=0;r<16;r++)f[r]=i(e.b,4*r);for(r=0;r<10;r++)o(0,4,8,12,f[u[16*r+0]],f[u[16*r+1]]),o(1,5,9,13,f[u[16*r+2]],f[u[16*r+3]]),o(2,6,10,14,f[u[16*r+4]],f[u[16*r+5]]),o(3,7,11,15,f[u[16*r+6]],f[u[16*r+7]]),o(0,5,10,15,f[u[16*r+8]],f[u[16*r+9]]),o(1,6,11,12,f[u[16*r+10]],f[u[16*r+11]]),o(2,7,8,13,f[u[16*r+12]],f[u[16*r+13]]),o(3,4,9,14,f[u[16*r+14]],f[u[16*r+15]]);for(r=0;r<8;r++)e.h[r]^=c[r]^c[r+8]}function h(e,t){if(!(e>0&&e<=32))throw new Error("Incorrect output length, should be in [1, 32]");const r=t?t.length:0;if(t&&!(r>0&&r<=32))throw new Error("Incorrect key length, should be in [1, 32]");const n={h:new Uint32Array(s),b:new Uint8Array(64),c:0,t:0,outlen:e};return n.h[0]^=16842752^r<<8^e,r>0&&(p(n,t),n.c=64),n}function p(e,t){for(let r=0;r<t.length;r++)64===e.c&&(e.t+=e.c,l(e,!1),e.c=0),e.b[e.c++]=t[r]}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 r=0;r<e.outlen;r++)t[r]=e.h[r>>2]>>8*(3&r)&255;return t}function g(e,t,r){r=r||32,e=n.normalizeInput(e);const i=h(r,t);return p(i,e),d(i)}e.exports={blake2s:g,blake2sHex:function(e,t,r){const i=g(e,t,r);return n.toHex(i)},blake2sInit:h,blake2sUpdate:p,blake2sFinal:d}},2493:(e,t,r)=>{const n=r(4156),i=r(1843);e.exports={blake2b:n.blake2b,blake2bHex:n.blake2bHex,blake2bInit:n.blake2bInit,blake2bUpdate:n.blake2bUpdate,blake2bFinal:n.blake2bFinal,blake2s:i.blake2s,blake2sHex:i.blake2sHex,blake2sInit:i.blake2sInit,blake2sUpdate:i.blake2sUpdate,blake2sFinal:i.blake2sFinal}},829: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,r,n){let i="\n"+e+" = ";for(let o=0;o<r.length;o+=2){if(32===n)i+=t(r[o]).toUpperCase(),i+=" ",i+=t(r[o+1]).toUpperCase();else{if(64!==n)throw new Error("Invalid size "+n);i+=t(r[o+1]).toUpperCase(),i+=t(r[o]).toUpperCase()}o%6==4?i+="\n"+new Array(e.length+4).join(" "):o<r.length-2&&(i+=" ")}console.log(i)},testSpeed:function(e,t,r){let n=(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-n)+"ms"),n=o;for(let o=0;o<r;o++){const r=e(i),o=(new Date).getTime(),a=o-n;n=o,console.log("Hashed in "+a+"ms: "+r.substring(0,20)+"..."),console.log(Math.round(t/(1<<20)/(a/1e3)*100)/100+" MB PER SECOND")}}}},6763:(e,t,r)=>{const n=r(5364);e.exports=n("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")},8287:(e,t,r)=>{"use strict";const n=r(7526),i=r(251),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,r){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,r)}function c(e,t,r){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 r=0|g(e,t);let n=s(r);const i=n.write(e,t);i!==r&&(n=n.slice(0,i));return n}(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,r);if("undefined"!=typeof SharedArrayBuffer&&(Y(e,SharedArrayBuffer)||e&&Y(e.buffer,SharedArrayBuffer)))return p(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return u.from(n,t,r);const i=function(e){if(u.isBuffer(e)){const t=0|d(e.length),r=s(t);return 0===r.length||e.copy(r,0,0,t),r}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,r);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),r=s(t);for(let n=0;n<t;n+=1)r[n]=255&e[n];return r}function p(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),Object.setPrototypeOf(n,u.prototype),n}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 r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return z(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return q(e).length;default:if(i)return n?-1:z(e).length;t=(""+t).toLowerCase(),i=!0}}function y(e,t,r){let n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return x(this,t,r);case"utf8":case"utf-8":return R(this,t,r);case"ascii":return O(this,t,r);case"latin1":case"binary":return C(this,t,r);case"base64":return A(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function _(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function v(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),X(r=+r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=u.from(t,n)),u.isBuffer(t))return 0===t.length?-1:m(e,t,r,n,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):m(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function m(e,t,r,n,i){let o,a=1,s=e.length,u=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;a=2,s/=2,u/=2,r/=2}function c(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){let n=-1;for(o=r;o<s;o++)if(c(e,o)===c(t,-1===n?0:o-n)){if(-1===n&&(n=o),o-n+1===u)return n*a}else-1!==n&&(o-=o-n),n=-1}else for(r+u>s&&(r=s-u),o=r;o>=0;o--){let r=!0;for(let n=0;n<u;n++)if(c(e,o+n)!==c(t,n)){r=!1;break}if(r)return o}return-1}function b(e,t,r,n){r=Number(r)||0;const i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;const o=t.length;let a;for(n>o/2&&(n=o/2),a=0;a<n;++a){const n=parseInt(t.substr(2*a,2),16);if(X(n))return a;e[r+a]=n}return a}function w(e,t,r,n){return $(z(t,e.length-r),e,r,n)}function T(e,t,r,n){return $(function(e){const t=[];for(let r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function E(e,t,r,n){return $(q(t),e,r,n)}function S(e,t,r,n){return $(function(e,t){let r,n,i;const o=[];for(let a=0;a<e.length&&!((t-=2)<0);++a)r=e.charCodeAt(a),n=r>>8,i=r%256,o.push(i),o.push(n);return o}(t,e.length-r),e,r,n)}function A(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function R(e,t,r){r=Math.min(e.length,r);const n=[];let i=t;for(;i<r;){const t=e[i];let o=null,a=t>239?4:t>223?3:t>191?2:1;if(i+a<=r){let r,n,s,u;switch(a){case 1:t<128&&(o=t);break;case 2:r=e[i+1],128==(192&r)&&(u=(31&t)<<6|63&r,u>127&&(o=u));break;case 3:r=e[i+1],n=e[i+2],128==(192&r)&&128==(192&n)&&(u=(15&t)<<12|(63&r)<<6|63&n,u>2047&&(u<55296||u>57343)&&(o=u));break;case 4:r=e[i+1],n=e[i+2],s=e[i+3],128==(192&r)&&128==(192&n)&&128==(192&s)&&(u=(15&t)<<18|(63&r)<<12|(63&n)<<6|63&s,u>65535&&u<1114112&&(o=u))}}null===o?(o=65533,a=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),i+=a}return function(e){const t=e.length;if(t<=I)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=I));return r}(n)}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,r){return c(e,t,r)},Object.setPrototypeOf(u.prototype,Uint8Array.prototype),Object.setPrototypeOf(u,Uint8Array),u.alloc=function(e,t,r){return function(e,t,r){return f(e),e<=0?s(e):void 0!==t?"string"==typeof r?s(e).fill(t,r):s(e).fill(t):s(e)}(e,t,r)},u.allocUnsafe=function(e){return l(e)},u.allocUnsafeSlow=function(e){return l(e)},u.isBuffer=function(e){return null!=e&&!0===e._isBu