@swtc/serializer
Version:
swtc serializer
1 lines • 138 kB
JavaScript
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("inherits"),r=require("@swtc/wallet"),e=require("@swtc/common");function i(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var n=i(t),o=Object.prototype.hasOwnProperty,s=Object.prototype.toString,h=Object.defineProperty,u=Object.getOwnPropertyDescriptor,a=function(t){return"function"==typeof Array.isArray?Array.isArray(t):"[object Array]"===s.call(t)},f=function(t){if(!t||"[object Object]"!==s.call(t))return!1;var r,e=o.call(t,"constructor"),i=t.constructor&&t.constructor.prototype&&o.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!e&&!i)return!1;for(r in t);return void 0===r||o.call(t,r)},l=function(t,r){h&&"__proto__"===r.name?h(t,r.name,{enumerable:!0,configurable:!0,value:r.newValue,writable:!0}):t[r.name]=r.newValue},c=function(t,r){if("__proto__"===r){if(!o.call(t,r))return;if(u)return u(t,r).value}return t[r]},p=function t(){var r,e,i,n,o,s,h=arguments[0],u=1,p=arguments.length,m=!1;for("boolean"==typeof h&&(m=h,h=arguments[1]||{},u=2),(null==h||"object"!=typeof h&&"function"!=typeof h)&&(h={});u<p;++u)if(null!=(r=arguments[u]))for(e in r)i=c(h,e),h!==(n=c(r,e))&&(m&&n&&(f(n)||(o=a(n)))?(o?(o=!1,s=i&&a(i)?i:[]):s=i&&f(i)?i:{},l(h,{name:e,newValue:t(m,s,n)})):void 0!==n&&l(h,{name:e,newValue:n}));return h},m="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function d(t,r,e){return t(e={path:r,exports:{},require:function(t,r){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==r&&e.path)}},e.exports),e.exports}var g=y;function y(t,r){if(!t)throw new Error(r||"Assertion failed")}function v(t,r){return 55296==(64512&t.charCodeAt(r))&&(!(r<0||r+1>=t.length)&&56320==(64512&t.charCodeAt(r+1)))}function w(t){return(t>>>24|t>>>8&65280|t<<8&16711680|(255&t)<<24)>>>0}function M(t){return 1===t.length?"0"+t:t}function b(t){return 7===t.length?"0"+t:6===t.length?"00"+t:5===t.length?"000"+t:4===t.length?"0000"+t:3===t.length?"00000"+t:2===t.length?"000000"+t:1===t.length?"0000000"+t:t}y.equal=function(t,r,e){if(t!=r)throw new Error(e||"Assertion failed: "+t+" != "+r)};var _={inherits:n.default,toArray:function(t,r){if(Array.isArray(t))return t.slice();if(!t)return[];var e=[];if("string"==typeof t)if(r){if("hex"===r)for((t=t.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(t="0"+t),n=0;n<t.length;n+=2)e.push(parseInt(t[n]+t[n+1],16))}else for(var i=0,n=0;n<t.length;n++){var o=t.charCodeAt(n);o<128?e[i++]=o:o<2048?(e[i++]=o>>6|192,e[i++]=63&o|128):v(t,n)?(o=65536+((1023&o)<<10)+(1023&t.charCodeAt(++n)),e[i++]=o>>18|240,e[i++]=o>>12&63|128,e[i++]=o>>6&63|128,e[i++]=63&o|128):(e[i++]=o>>12|224,e[i++]=o>>6&63|128,e[i++]=63&o|128)}else for(n=0;n<t.length;n++)e[n]=0|t[n];return e},toHex:function(t){for(var r="",e=0;e<t.length;e++)r+=M(t[e].toString(16));return r},htonl:w,toHex32:function(t,r){for(var e="",i=0;i<t.length;i++){var n=t[i];"little"===r&&(n=w(n)),e+=b(n.toString(16))}return e},zero2:M,zero8:b,join32:function(t,r,e,i){var n=e-r;g(n%4==0);for(var o=new Array(n/4),s=0,h=r;s<o.length;s++,h+=4){var u;u="big"===i?t[h]<<24|t[h+1]<<16|t[h+2]<<8|t[h+3]:t[h+3]<<24|t[h+2]<<16|t[h+1]<<8|t[h],o[s]=u>>>0}return o},split32:function(t,r){for(var e=new Array(4*t.length),i=0,n=0;i<t.length;i++,n+=4){var o=t[i];"big"===r?(e[n]=o>>>24,e[n+1]=o>>>16&255,e[n+2]=o>>>8&255,e[n+3]=255&o):(e[n+3]=o>>>24,e[n+2]=o>>>16&255,e[n+1]=o>>>8&255,e[n]=255&o)}return e},rotr32:function(t,r){return t>>>r|t<<32-r},rotl32:function(t,r){return t<<r|t>>>32-r},sum32:function(t,r){return t+r>>>0},sum32_3:function(t,r,e){return t+r+e>>>0},sum32_4:function(t,r,e,i){return t+r+e+i>>>0},sum32_5:function(t,r,e,i,n){return t+r+e+i+n>>>0},sum64:function(t,r,e,i){var n=t[r],o=i+t[r+1]>>>0,s=(o<i?1:0)+e+n;t[r]=s>>>0,t[r+1]=o},sum64_hi:function(t,r,e,i){return(r+i>>>0<r?1:0)+t+e>>>0},sum64_lo:function(t,r,e,i){return r+i>>>0},sum64_4_hi:function(t,r,e,i,n,o,s,h){var u=0,a=r;return u+=(a=a+i>>>0)<r?1:0,u+=(a=a+o>>>0)<o?1:0,t+e+n+s+(u+=(a=a+h>>>0)<h?1:0)>>>0},sum64_4_lo:function(t,r,e,i,n,o,s,h){return r+i+o+h>>>0},sum64_5_hi:function(t,r,e,i,n,o,s,h,u,a){var f=0,l=r;return f+=(l=l+i>>>0)<r?1:0,f+=(l=l+o>>>0)<o?1:0,f+=(l=l+h>>>0)<h?1:0,t+e+n+s+u+(f+=(l=l+a>>>0)<a?1:0)>>>0},sum64_5_lo:function(t,r,e,i,n,o,s,h,u,a){return r+i+o+h+a>>>0},rotr64_hi:function(t,r,e){return(r<<32-e|t>>>e)>>>0},rotr64_lo:function(t,r,e){return(t<<32-e|r>>>e)>>>0},shr64_hi:function(t,r,e){return t>>>e},shr64_lo:function(t,r,e){return(t<<32-e|r>>>e)>>>0}};function T(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}var S=T;T.prototype.update=function(t,r){if(t=_.toArray(t,r),this.pending?this.pending=this.pending.concat(t):this.pending=t,this.pendingTotal+=t.length,this.pending.length>=this._delta8){var e=(t=this.pending).length%this._delta8;this.pending=t.slice(t.length-e,t.length),0===this.pending.length&&(this.pending=null),t=_.join32(t,0,t.length-e,this.endian);for(var i=0;i<t.length;i+=this._delta32)this._update(t,i,i+this._delta32)}return this},T.prototype.digest=function(t){return this.update(this._pad()),g(null===this.pending),this._digest(t)},T.prototype._pad=function(){var t=this.pendingTotal,r=this._delta8,e=r-(t+this.padLength)%r,i=new Array(e+this.padLength);i[0]=128;for(var n=1;n<e;n++)i[n]=0;if(t<<=3,"big"===this.endian){for(var o=8;o<this.padLength;o++)i[n++]=0;i[n++]=0,i[n++]=0,i[n++]=0,i[n++]=0,i[n++]=t>>>24&255,i[n++]=t>>>16&255,i[n++]=t>>>8&255,i[n++]=255&t}else for(i[n++]=255&t,i[n++]=t>>>8&255,i[n++]=t>>>16&255,i[n++]=t>>>24&255,i[n++]=0,i[n++]=0,i[n++]=0,i[n++]=0,o=8;o<this.padLength;o++)i[n++]=0;return i};var A={BlockHash:S},E=_.rotr32;function B(t,r,e){return t&r^~t&e}function N(t,r,e){return t&r^t&e^r&e}function O(t,r,e){return t^r^e}var I={ft_1:function(t,r,e,i){return 0===t?B(r,e,i):1===t||3===t?O(r,e,i):2===t?N(r,e,i):void 0},ch32:B,maj32:N,p32:O,s0_256:function(t){return E(t,2)^E(t,13)^E(t,22)},s1_256:function(t){return E(t,6)^E(t,11)^E(t,25)},g0_256:function(t){return E(t,7)^E(t,18)^t>>>3},g1_256:function(t){return E(t,17)^E(t,19)^t>>>10}},k=_.rotl32,x=_.sum32,L=_.sum32_5,D=I.ft_1,R=A.BlockHash,C=[1518500249,1859775393,2400959708,3395469782];function z(){if(!(this instanceof z))return new z;R.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}_.inherits(z,R);var P=z;z.blockSize=512,z.outSize=160,z.hmacStrength=80,z.padLength=64,z.prototype._update=function(t,r){for(var e=this.W,i=0;i<16;i++)e[i]=t[r+i];for(;i<e.length;i++)e[i]=k(e[i-3]^e[i-8]^e[i-14]^e[i-16],1);var n=this.h[0],o=this.h[1],s=this.h[2],h=this.h[3],u=this.h[4];for(i=0;i<e.length;i++){var a=~~(i/20),f=L(k(n,5),D(a,o,s,h),u,e[i],C[a]);u=h,h=s,s=k(o,30),o=n,n=f}this.h[0]=x(this.h[0],n),this.h[1]=x(this.h[1],o),this.h[2]=x(this.h[2],s),this.h[3]=x(this.h[3],h),this.h[4]=x(this.h[4],u)},z.prototype._digest=function(t){return"hex"===t?_.toHex32(this.h,"big"):_.split32(this.h,"big")};var U=_.sum32,j=_.sum32_4,q=_.sum32_5,F=I.ch32,V=I.maj32,H=I.s0_256,Z=I.s1_256,K=I.g0_256,G=I.g1_256,Y=A.BlockHash,$=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function W(){if(!(this instanceof W))return new W;Y.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=$,this.W=new Array(64)}_.inherits(W,Y);var J=W;function X(){if(!(this instanceof X))return new X;J.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}W.blockSize=512,W.outSize=256,W.hmacStrength=192,W.padLength=64,W.prototype._update=function(t,r){for(var e=this.W,i=0;i<16;i++)e[i]=t[r+i];for(;i<e.length;i++)e[i]=j(G(e[i-2]),e[i-7],K(e[i-15]),e[i-16]);var n=this.h[0],o=this.h[1],s=this.h[2],h=this.h[3],u=this.h[4],a=this.h[5],f=this.h[6],l=this.h[7];for(g(this.k.length===e.length),i=0;i<e.length;i++){var c=q(l,Z(u),F(u,a,f),this.k[i],e[i]),p=U(H(n),V(n,o,s));l=f,f=a,a=u,u=U(h,c),h=s,s=o,o=n,n=U(c,p)}this.h[0]=U(this.h[0],n),this.h[1]=U(this.h[1],o),this.h[2]=U(this.h[2],s),this.h[3]=U(this.h[3],h),this.h[4]=U(this.h[4],u),this.h[5]=U(this.h[5],a),this.h[6]=U(this.h[6],f),this.h[7]=U(this.h[7],l)},W.prototype._digest=function(t){return"hex"===t?_.toHex32(this.h,"big"):_.split32(this.h,"big")},_.inherits(X,J);var Q=X;X.blockSize=512,X.outSize=224,X.hmacStrength=192,X.padLength=64,X.prototype._digest=function(t){return"hex"===t?_.toHex32(this.h.slice(0,7),"big"):_.split32(this.h.slice(0,7),"big")};var tt=_.rotr64_hi,rt=_.rotr64_lo,et=_.shr64_hi,it=_.shr64_lo,nt=_.sum64,ot=_.sum64_hi,st=_.sum64_lo,ht=_.sum64_4_hi,ut=_.sum64_4_lo,at=_.sum64_5_hi,ft=_.sum64_5_lo,lt=A.BlockHash,ct=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function pt(){if(!(this instanceof pt))return new pt;lt.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=ct,this.W=new Array(160)}_.inherits(pt,lt);var mt=pt;function dt(t,r,e,i,n){var o=t&e^~t&n;return o<0&&(o+=4294967296),o}function gt(t,r,e,i,n,o){var s=r&i^~r&o;return s<0&&(s+=4294967296),s}function yt(t,r,e,i,n){var o=t&e^t&n^e&n;return o<0&&(o+=4294967296),o}function vt(t,r,e,i,n,o){var s=r&i^r&o^i&o;return s<0&&(s+=4294967296),s}function wt(t,r){var e=tt(t,r,28)^tt(r,t,2)^tt(r,t,7);return e<0&&(e+=4294967296),e}function Mt(t,r){var e=rt(t,r,28)^rt(r,t,2)^rt(r,t,7);return e<0&&(e+=4294967296),e}function bt(t,r){var e=tt(t,r,14)^tt(t,r,18)^tt(r,t,9);return e<0&&(e+=4294967296),e}function _t(t,r){var e=rt(t,r,14)^rt(t,r,18)^rt(r,t,9);return e<0&&(e+=4294967296),e}function Tt(t,r){var e=tt(t,r,1)^tt(t,r,8)^et(t,r,7);return e<0&&(e+=4294967296),e}function St(t,r){var e=rt(t,r,1)^rt(t,r,8)^it(t,r,7);return e<0&&(e+=4294967296),e}function At(t,r){var e=tt(t,r,19)^tt(r,t,29)^et(t,r,6);return e<0&&(e+=4294967296),e}function Et(t,r){var e=rt(t,r,19)^rt(r,t,29)^it(t,r,6);return e<0&&(e+=4294967296),e}function Bt(){if(!(this instanceof Bt))return new Bt;mt.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}pt.blockSize=1024,pt.outSize=512,pt.hmacStrength=192,pt.padLength=128,pt.prototype._prepareBlock=function(t,r){for(var e=this.W,i=0;i<32;i++)e[i]=t[r+i];for(;i<e.length;i+=2){var n=At(e[i-4],e[i-3]),o=Et(e[i-4],e[i-3]),s=e[i-14],h=e[i-13],u=Tt(e[i-30],e[i-29]),a=St(e[i-30],e[i-29]),f=e[i-32],l=e[i-31];e[i]=ht(n,o,s,h,u,a,f,l),e[i+1]=ut(n,o,s,h,u,a,f,l)}},pt.prototype._update=function(t,r){this._prepareBlock(t,r);var e=this.W,i=this.h[0],n=this.h[1],o=this.h[2],s=this.h[3],h=this.h[4],u=this.h[5],a=this.h[6],f=this.h[7],l=this.h[8],c=this.h[9],p=this.h[10],m=this.h[11],d=this.h[12],y=this.h[13],v=this.h[14],w=this.h[15];g(this.k.length===e.length);for(var M=0;M<e.length;M+=2){var b=v,_=w,T=bt(l,c),S=_t(l,c),A=dt(l,c,p,m,d),E=gt(l,c,p,m,d,y),B=this.k[M],N=this.k[M+1],O=e[M],I=e[M+1],k=at(b,_,T,S,A,E,B,N,O,I),x=ft(b,_,T,S,A,E,B,N,O,I);b=wt(i,n),_=Mt(i,n),T=yt(i,n,o,s,h),S=vt(i,n,o,s,h,u);var L=ot(b,_,T,S),D=st(b,_,T,S);v=d,w=y,d=p,y=m,p=l,m=c,l=ot(a,f,k,x),c=st(f,f,k,x),a=h,f=u,h=o,u=s,o=i,s=n,i=ot(k,x,L,D),n=st(k,x,L,D)}nt(this.h,0,i,n),nt(this.h,2,o,s),nt(this.h,4,h,u),nt(this.h,6,a,f),nt(this.h,8,l,c),nt(this.h,10,p,m),nt(this.h,12,d,y),nt(this.h,14,v,w)},pt.prototype._digest=function(t){return"hex"===t?_.toHex32(this.h,"big"):_.split32(this.h,"big")},_.inherits(Bt,mt);var Nt=Bt;Bt.blockSize=1024,Bt.outSize=384,Bt.hmacStrength=192,Bt.padLength=128,Bt.prototype._digest=function(t){return"hex"===t?_.toHex32(this.h.slice(0,12),"big"):_.split32(this.h.slice(0,12),"big")};var Ot={sha1:P,sha224:Q,sha256:J,sha384:Nt,sha512:mt},It=_.rotl32,kt=_.sum32,xt=_.sum32_3,Lt=_.sum32_4,Dt=A.BlockHash;function Rt(){if(!(this instanceof Rt))return new Rt;Dt.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}_.inherits(Rt,Dt);var Ct=Rt;function zt(t,r,e,i){return t<=15?r^e^i:t<=31?r&e|~r&i:t<=47?(r|~e)^i:t<=63?r&i|e&~i:r^(e|~i)}function Pt(t){return t<=15?0:t<=31?1518500249:t<=47?1859775393:t<=63?2400959708:2840853838}function Ut(t){return t<=15?1352829926:t<=31?1548603684:t<=47?1836072691:t<=63?2053994217:0}Rt.blockSize=512,Rt.outSize=160,Rt.hmacStrength=192,Rt.padLength=64,Rt.prototype._update=function(t,r){for(var e=this.h[0],i=this.h[1],n=this.h[2],o=this.h[3],s=this.h[4],h=e,u=i,a=n,f=o,l=s,c=0;c<80;c++){var p=kt(It(Lt(e,zt(c,i,n,o),t[jt[c]+r],Pt(c)),Ft[c]),s);e=s,s=o,o=It(n,10),n=i,i=p,p=kt(It(Lt(h,zt(79-c,u,a,f),t[qt[c]+r],Ut(c)),Vt[c]),l),h=l,l=f,f=It(a,10),a=u,u=p}p=xt(this.h[1],n,f),this.h[1]=xt(this.h[2],o,l),this.h[2]=xt(this.h[3],s,h),this.h[3]=xt(this.h[4],e,u),this.h[4]=xt(this.h[0],i,a),this.h[0]=p},Rt.prototype._digest=function(t){return"hex"===t?_.toHex32(this.h,"little"):_.split32(this.h,"little")};var jt=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],qt=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],Ft=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],Vt=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],Ht={ripemd160:Ct};function Zt(t,r,e){if(!(this instanceof Zt))return new Zt(t,r,e);this.Hash=t,this.blockSize=t.blockSize/8,this.outSize=t.outSize/8,this.inner=null,this.outer=null,this._init(_.toArray(r,e))}var Kt=Zt;Zt.prototype._init=function(t){t.length>this.blockSize&&(t=(new this.Hash).update(t).digest()),g(t.length<=this.blockSize);for(var r=t.length;r<this.blockSize;r++)t.push(0);for(r=0;r<t.length;r++)t[r]^=54;for(this.inner=(new this.Hash).update(t),r=0;r<t.length;r++)t[r]^=106;this.outer=(new this.Hash).update(t)},Zt.prototype.update=function(t,r){return this.inner.update(t,r),this},Zt.prototype.digest=function(t){return this.outer.update(this.inner.digest()),this.outer.digest(t)};var Gt=d((function(t,r){var e=r;e.utils=_,e.common=A,e.sha=Ot,e.ripemd=Ht,e.hmac=Kt,e.sha1=e.sha.sha1,e.sha256=e.sha.sha256,e.sha224=e.sha.sha224,e.sha384=e.sha.sha384,e.sha512=e.sha.sha512,e.ripemd160=e.ripemd.ripemd160})),Yt=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,$t=Math.ceil,Wt=Math.floor,Jt="[BigNumber Error] ",Xt=Jt+"Number primitive has more than 15 significant digits: ",Qt=1e14,tr=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],rr=1e9;function er(t){var r=0|t;return t>0||t===r?r:r-1}function ir(t){for(var r,e,i=1,n=t.length,o=t[0]+"";i<n;){for(e=14-(r=t[i++]+"").length;e--;r="0"+r);o+=r}for(n=o.length;48===o.charCodeAt(--n););return o.slice(0,n+1||1)}function nr(t,r){var e,i,n=t.c,o=r.c,s=t.s,h=r.s,u=t.e,a=r.e;if(!s||!h)return null;if(e=n&&!n[0],i=o&&!o[0],e||i)return e?i?0:-h:s;if(s!=h)return s;if(e=s<0,i=u==a,!n||!o)return i?0:!n^e?1:-1;if(!i)return u>a^e?1:-1;for(h=(u=n.length)<(a=o.length)?u:a,s=0;s<h;s++)if(n[s]!=o[s])return n[s]>o[s]^e?1:-1;return u==a?0:u>a^e?1:-1}function or(t,r,e,i){if(t<r||t>e||t!==Wt(t))throw Error(Jt+(i||"Argument")+("number"==typeof t?t<r||t>e?" out of range: ":" not an integer: ":" not a primitive number: ")+String(t))}function sr(t){var r=t.c.length-1;return er(t.e/14)==r&&t.c[r]%2!=0}function hr(t,r){return(t.length>1?t.charAt(0)+"."+t.slice(1):t)+(r<0?"e":"e+")+r}function ur(t,r,e){var i,n;if(r<0){for(n=e+".";++r;n+=e);t=n+t}else if(++r>(i=t.length)){for(n=e,r-=i;--r;n+=e);t+=n}else r<i&&(t=t.slice(0,r)+"."+t.slice(r));return t}for(var ar=function t(r){var e,i,n,o,s,h,u,a,f,l=A.prototype={constructor:A,toString:null,valueOf:null},c=new A(1),p=20,m=4,d=-7,g=21,y=-1e7,v=1e7,w=!1,M=1,b=0,_={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},T="0123456789abcdefghijklmnopqrstuvwxyz",S=!0;function A(t,r){var e,o,s,h,u,a,f,l,c=this;if(!(c instanceof A))return new A(t,r);if(null==r){if(t&&!0===t._isBigNumber)return c.s=t.s,void(!t.c||t.e>v?c.c=c.e=null:t.e<y?c.c=[c.e=0]:(c.e=t.e,c.c=t.c.slice()));if((a="number"==typeof t)&&0*t==0){if(c.s=1/t<0?(t=-t,-1):1,t===~~t){for(h=0,u=t;u>=10;u/=10,h++);return void(h>v?c.c=c.e=null:(c.e=h,c.c=[t]))}l=String(t)}else{if(!Yt.test(l=String(t)))return n(c,l,a);c.s=45==l.charCodeAt(0)?(l=l.slice(1),-1):1}(h=l.indexOf("."))>-1&&(l=l.replace(".","")),(u=l.search(/e/i))>0?(h<0&&(h=u),h+=+l.slice(u+1),l=l.substring(0,u)):h<0&&(h=l.length)}else{if(or(r,2,T.length,"Base"),10==r&&S)return O(c=new A(t),p+c.e+1,m);if(l=String(t),a="number"==typeof t){if(0*t!=0)return n(c,l,a,r);if(c.s=1/t<0?(l=l.slice(1),-1):1,A.DEBUG&&l.replace(/^0\.0*|\./,"").length>15)throw Error(Xt+t)}else c.s=45===l.charCodeAt(0)?(l=l.slice(1),-1):1;for(e=T.slice(0,r),h=u=0,f=l.length;u<f;u++)if(e.indexOf(o=l.charAt(u))<0){if("."==o){if(u>h){h=f;continue}}else if(!s&&(l==l.toUpperCase()&&(l=l.toLowerCase())||l==l.toLowerCase()&&(l=l.toUpperCase()))){s=!0,u=-1,h=0;continue}return n(c,String(t),a,r)}a=!1,(h=(l=i(l,r,10,c.s)).indexOf("."))>-1?l=l.replace(".",""):h=l.length}for(u=0;48===l.charCodeAt(u);u++);for(f=l.length;48===l.charCodeAt(--f););if(l=l.slice(u,++f)){if(f-=u,a&&A.DEBUG&&f>15&&(t>9007199254740991||t!==Wt(t)))throw Error(Xt+c.s*t);if((h=h-u-1)>v)c.c=c.e=null;else if(h<y)c.c=[c.e=0];else{if(c.e=h,c.c=[],u=(h+1)%14,h<0&&(u+=14),u<f){for(u&&c.c.push(+l.slice(0,u)),f-=14;u<f;)c.c.push(+l.slice(u,u+=14));u=14-(l=l.slice(u)).length}else u-=f;for(;u--;l+="0");c.c.push(+l)}}else c.c=[c.e=0]}function E(t,r,e,i){var n,o,s,h,u;if(null==e?e=m:or(e,0,8),!t.c)return t.toString();if(n=t.c[0],s=t.e,null==r)u=ir(t.c),u=1==i||2==i&&(s<=d||s>=g)?hr(u,s):ur(u,s,"0");else if(o=(t=O(new A(t),r,e)).e,h=(u=ir(t.c)).length,1==i||2==i&&(r<=o||o<=d)){for(;h<r;u+="0",h++);u=hr(u,o)}else if(r-=s,u=ur(u,o,"0"),o+1>h){if(--r>0)for(u+=".";r--;u+="0");}else if((r+=o-h)>0)for(o+1==h&&(u+=".");r--;u+="0");return t.s<0&&n?"-"+u:u}function B(t,r){for(var e,i=1,n=new A(t[0]);i<t.length;i++){if(!(e=new A(t[i])).s){n=e;break}r.call(n,e)&&(n=e)}return n}function N(t,r,e){for(var i=1,n=r.length;!r[--n];r.pop());for(n=r[0];n>=10;n/=10,i++);return(e=i+14*e-1)>v?t.c=t.e=null:e<y?t.c=[t.e=0]:(t.e=e,t.c=r),t}function O(t,r,e,i){var n,o,s,h,u,a,f,l=t.c,c=tr;if(l){t:{for(n=1,h=l[0];h>=10;h/=10,n++);if((o=r-n)<0)o+=14,s=r,f=(u=l[a=0])/c[n-s-1]%10|0;else if((a=$t((o+1)/14))>=l.length){if(!i)break t;for(;l.length<=a;l.push(0));u=f=0,n=1,s=(o%=14)-14+1}else{for(u=h=l[a],n=1;h>=10;h/=10,n++);f=(s=(o%=14)-14+n)<0?0:u/c[n-s-1]%10|0}if(i=i||r<0||null!=l[a+1]||(s<0?u:u%c[n-s-1]),i=e<4?(f||i)&&(0==e||e==(t.s<0?3:2)):f>5||5==f&&(4==e||i||6==e&&(o>0?s>0?u/c[n-s]:0:l[a-1])%10&1||e==(t.s<0?8:7)),r<1||!l[0])return l.length=0,i?(r-=t.e+1,l[0]=c[(14-r%14)%14],t.e=-r||0):l[0]=t.e=0,t;if(0==o?(l.length=a,h=1,a--):(l.length=a+1,h=c[14-o],l[a]=s>0?Wt(u/c[n-s]%c[s])*h:0),i)for(;;){if(0==a){for(o=1,s=l[0];s>=10;s/=10,o++);for(s=l[0]+=h,h=1;s>=10;s/=10,h++);o!=h&&(t.e++,l[0]==Qt&&(l[0]=1));break}if(l[a]+=h,l[a]!=Qt)break;l[a--]=0,h=1}for(o=l.length;0===l[--o];l.pop());}t.e>v?t.c=t.e=null:t.e<y&&(t.c=[t.e=0])}return t}function I(t){var r,e=t.e;return null===e?t.toString():(r=ir(t.c),r=e<=d||e>=g?hr(r,e):ur(r,e,"0"),t.s<0?"-"+r:r)}return A.clone=t,A.ROUND_UP=0,A.ROUND_DOWN=1,A.ROUND_CEIL=2,A.ROUND_FLOOR=3,A.ROUND_HALF_UP=4,A.ROUND_HALF_DOWN=5,A.ROUND_HALF_EVEN=6,A.ROUND_HALF_CEIL=7,A.ROUND_HALF_FLOOR=8,A.EUCLID=9,A.config=A.set=function(t){var r,e;if(null!=t){if("object"!=typeof t)throw Error(Jt+"Object expected: "+t);if(t.hasOwnProperty(r="DECIMAL_PLACES")&&(or(e=t[r],0,rr,r),p=e),t.hasOwnProperty(r="ROUNDING_MODE")&&(or(e=t[r],0,8,r),m=e),t.hasOwnProperty(r="EXPONENTIAL_AT")&&((e=t[r])&&e.pop?(or(e[0],-rr,0,r),or(e[1],0,rr,r),d=e[0],g=e[1]):(or(e,-rr,rr,r),d=-(g=e<0?-e:e))),t.hasOwnProperty(r="RANGE"))if((e=t[r])&&e.pop)or(e[0],-rr,-1,r),or(e[1],1,rr,r),y=e[0],v=e[1];else{if(or(e,-rr,rr,r),!e)throw Error(Jt+r+" cannot be zero: "+e);y=-(v=e<0?-e:e)}if(t.hasOwnProperty(r="CRYPTO")){if((e=t[r])!==!!e)throw Error(Jt+r+" not true or false: "+e);if(e){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw w=!e,Error(Jt+"crypto unavailable");w=e}else w=e}if(t.hasOwnProperty(r="MODULO_MODE")&&(or(e=t[r],0,9,r),M=e),t.hasOwnProperty(r="POW_PRECISION")&&(or(e=t[r],0,rr,r),b=e),t.hasOwnProperty(r="FORMAT")){if("object"!=typeof(e=t[r]))throw Error(Jt+r+" not an object: "+e);_=e}if(t.hasOwnProperty(r="ALPHABET")){if("string"!=typeof(e=t[r])||/^.?$|[+\-.\s]|(.).*\1/.test(e))throw Error(Jt+r+" invalid: "+e);S="0123456789"==e.slice(0,10),T=e}}return{DECIMAL_PLACES:p,ROUNDING_MODE:m,EXPONENTIAL_AT:[d,g],RANGE:[y,v],CRYPTO:w,MODULO_MODE:M,POW_PRECISION:b,FORMAT:_,ALPHABET:T}},A.isBigNumber=function(t){if(!t||!0!==t._isBigNumber)return!1;if(!A.DEBUG)return!0;var r,e,i=t.c,n=t.e,o=t.s;t:if("[object Array]"=={}.toString.call(i)){if((1===o||-1===o)&&n>=-rr&&n<=rr&&n===Wt(n)){if(0===i[0]){if(0===n&&1===i.length)return!0;break t}if((r=(n+1)%14)<1&&(r+=14),String(i[0]).length==r){for(r=0;r<i.length;r++)if((e=i[r])<0||e>=Qt||e!==Wt(e))break t;if(0!==e)return!0}}}else if(null===i&&null===n&&(null===o||1===o||-1===o))return!0;throw Error(Jt+"Invalid BigNumber: "+t)},A.maximum=A.max=function(){return B(arguments,l.lt)},A.minimum=A.min=function(){return B(arguments,l.gt)},A.random=(o=9007199254740992*Math.random()&2097151?function(){return Wt(9007199254740992*Math.random())}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(t){var r,e,i,n,s,h=0,u=[],a=new A(c);if(null==t?t=p:or(t,0,rr),n=$t(t/14),w)if(crypto.getRandomValues){for(r=crypto.getRandomValues(new Uint32Array(n*=2));h<n;)(s=131072*r[h]+(r[h+1]>>>11))>=9e15?(e=crypto.getRandomValues(new Uint32Array(2)),r[h]=e[0],r[h+1]=e[1]):(u.push(s%1e14),h+=2);h=n/2}else{if(!crypto.randomBytes)throw w=!1,Error(Jt+"crypto unavailable");for(r=crypto.randomBytes(n*=7);h<n;)(s=281474976710656*(31&r[h])+1099511627776*r[h+1]+4294967296*r[h+2]+16777216*r[h+3]+(r[h+4]<<16)+(r[h+5]<<8)+r[h+6])>=9e15?crypto.randomBytes(7).copy(r,h):(u.push(s%1e14),h+=7);h=n/7}if(!w)for(;h<n;)(s=o())<9e15&&(u[h++]=s%1e14);for(t%=14,(n=u[--h])&&t&&(s=tr[14-t],u[h]=Wt(n/s)*s);0===u[h];u.pop(),h--);if(h<0)u=[i=0];else{for(i=-1;0===u[0];u.splice(0,1),i-=14);for(h=1,s=u[0];s>=10;s/=10,h++);h<14&&(i-=14-h)}return a.e=i,a.c=u,a}),A.sum=function(){for(var t=1,r=arguments,e=new A(r[0]);t<r.length;)e=e.plus(r[t++]);return e},i=function(){function t(t,r,e,i){for(var n,o,s=[0],h=0,u=t.length;h<u;){for(o=s.length;o--;s[o]*=r);for(s[0]+=i.indexOf(t.charAt(h++)),n=0;n<s.length;n++)s[n]>e-1&&(null==s[n+1]&&(s[n+1]=0),s[n+1]+=s[n]/e|0,s[n]%=e)}return s.reverse()}return function(r,i,n,o,s){var h,u,a,f,l,c,d,g,y=r.indexOf("."),v=p,w=m;for(y>=0&&(f=b,b=0,r=r.replace(".",""),c=(g=new A(i)).pow(r.length-y),b=f,g.c=t(ur(ir(c.c),c.e,"0"),10,n,"0123456789"),g.e=g.c.length),a=f=(d=t(r,i,n,s?(h=T,"0123456789"):(h="0123456789",T))).length;0==d[--f];d.pop());if(!d[0])return h.charAt(0);if(y<0?--a:(c.c=d,c.e=a,c.s=o,d=(c=e(c,g,v,w,n)).c,l=c.r,a=c.e),y=d[u=a+v+1],f=n/2,l=l||u<0||null!=d[u+1],l=w<4?(null!=y||l)&&(0==w||w==(c.s<0?3:2)):y>f||y==f&&(4==w||l||6==w&&1&d[u-1]||w==(c.s<0?8:7)),u<1||!d[0])r=l?ur(h.charAt(1),-v,h.charAt(0)):h.charAt(0);else{if(d.length=u,l)for(--n;++d[--u]>n;)d[u]=0,u||(++a,d=[1].concat(d));for(f=d.length;!d[--f];);for(y=0,r="";y<=f;r+=h.charAt(d[y++]));r=ur(r,a,h.charAt(0))}return r}}(),e=function(){function t(t,r,e){var i,n,o,s,h=0,u=t.length,a=r%1e7,f=r/1e7|0;for(t=t.slice();u--;)h=((n=a*(o=t[u]%1e7)+(i=f*o+(s=t[u]/1e7|0)*a)%1e7*1e7+h)/e|0)+(i/1e7|0)+f*s,t[u]=n%e;return h&&(t=[h].concat(t)),t}function r(t,r,e,i){var n,o;if(e!=i)o=e>i?1:-1;else for(n=o=0;n<e;n++)if(t[n]!=r[n]){o=t[n]>r[n]?1:-1;break}return o}function e(t,r,e,i){for(var n=0;e--;)t[e]-=n,n=t[e]<r[e]?1:0,t[e]=n*i+t[e]-r[e];for(;!t[0]&&t.length>1;t.splice(0,1));}return function(i,n,o,s,h){var u,a,f,l,c,p,m,d,g,y,v,w,M,b,_,T,S,E=i.s==n.s?1:-1,B=i.c,N=n.c;if(!(B&&B[0]&&N&&N[0]))return new A(i.s&&n.s&&(B?!N||B[0]!=N[0]:N)?B&&0==B[0]||!N?0*E:E/0:NaN);for(g=(d=new A(E)).c=[],E=o+(a=i.e-n.e)+1,h||(h=Qt,a=er(i.e/14)-er(n.e/14),E=E/14|0),f=0;N[f]==(B[f]||0);f++);if(N[f]>(B[f]||0)&&a--,E<0)g.push(1),l=!0;else{for(b=B.length,T=N.length,f=0,E+=2,(c=Wt(h/(N[0]+1)))>1&&(N=t(N,c,h),B=t(B,c,h),T=N.length,b=B.length),M=T,v=(y=B.slice(0,T)).length;v<T;y[v++]=0);S=N.slice(),S=[0].concat(S),_=N[0],N[1]>=h/2&&_++;do{if(c=0,(u=r(N,y,T,v))<0){if(w=y[0],T!=v&&(w=w*h+(y[1]||0)),(c=Wt(w/_))>1)for(c>=h&&(c=h-1),m=(p=t(N,c,h)).length,v=y.length;1==r(p,y,m,v);)c--,e(p,T<m?S:N,m,h),m=p.length,u=1;else 0==c&&(u=c=1),m=(p=N.slice()).length;if(m<v&&(p=[0].concat(p)),e(y,p,v,h),v=y.length,-1==u)for(;r(N,y,T,v)<1;)c++,e(y,T<v?S:N,v,h),v=y.length}else 0===u&&(c++,y=[0]);g[f++]=c,y[0]?y[v++]=B[M]||0:(y=[B[M]],v=1)}while((M++<b||null!=y[0])&&E--);l=null!=y[0],g[0]||g.splice(0,1)}if(h==Qt){for(f=1,E=g[0];E>=10;E/=10,f++);O(d,o+(d.e=f+14*a-1)+1,s,l)}else d.e=a,d.r=+l;return d}}(),s=/^(-?)0([xbo])(?=\w[\w.]*$)/i,h=/^([^.]+)\.$/,u=/^\.([^.]+)$/,a=/^-?(Infinity|NaN)$/,f=/^\s*\+(?=[\w.])|^\s+|\s+$/g,n=function(t,r,e,i){var n,o=e?r:r.replace(f,"");if(a.test(o))t.s=isNaN(o)?null:o<0?-1:1;else{if(!e&&(o=o.replace(s,(function(t,r,e){return n="x"==(e=e.toLowerCase())?16:"b"==e?2:8,i&&i!=n?t:r})),i&&(n=i,o=o.replace(h,"$1").replace(u,"0.$1")),r!=o))return new A(o,n);if(A.DEBUG)throw Error(Jt+"Not a"+(i?" base "+i:"")+" number: "+r);t.s=null}t.c=t.e=null},l.absoluteValue=l.abs=function(){var t=new A(this);return t.s<0&&(t.s=1),t},l.comparedTo=function(t,r){return nr(this,new A(t,r))},l.decimalPlaces=l.dp=function(t,r){var e,i,n,o=this;if(null!=t)return or(t,0,rr),null==r?r=m:or(r,0,8),O(new A(o),t+o.e+1,r);if(!(e=o.c))return null;if(i=14*((n=e.length-1)-er(this.e/14)),n=e[n])for(;n%10==0;n/=10,i--);return i<0&&(i=0),i},l.dividedBy=l.div=function(t,r){return e(this,new A(t,r),p,m)},l.dividedToIntegerBy=l.idiv=function(t,r){return e(this,new A(t,r),0,1)},l.exponentiatedBy=l.pow=function(t,r){var e,i,n,o,s,h,u,a,f=this;if((t=new A(t)).c&&!t.isInteger())throw Error(Jt+"Exponent not an integer: "+I(t));if(null!=r&&(r=new A(r)),s=t.e>14,!f.c||!f.c[0]||1==f.c[0]&&!f.e&&1==f.c.length||!t.c||!t.c[0])return a=new A(Math.pow(+I(f),s?2-sr(t):+I(t))),r?a.mod(r):a;if(h=t.s<0,r){if(r.c?!r.c[0]:!r.s)return new A(NaN);(i=!h&&f.isInteger()&&r.isInteger())&&(f=f.mod(r))}else{if(t.e>9&&(f.e>0||f.e<-1||(0==f.e?f.c[0]>1||s&&f.c[1]>=24e7:f.c[0]<8e13||s&&f.c[0]<=9999975e7)))return o=f.s<0&&sr(t)?-0:0,f.e>-1&&(o=1/o),new A(h?1/o:o);b&&(o=$t(b/14+2))}for(s?(e=new A(.5),h&&(t.s=1),u=sr(t)):u=(n=Math.abs(+I(t)))%2,a=new A(c);;){if(u){if(!(a=a.times(f)).c)break;o?a.c.length>o&&(a.c.length=o):i&&(a=a.mod(r))}if(n){if(0===(n=Wt(n/2)))break;u=n%2}else if(O(t=t.times(e),t.e+1,1),t.e>14)u=sr(t);else{if(0===(n=+I(t)))break;u=n%2}f=f.times(f),o?f.c&&f.c.length>o&&(f.c.length=o):i&&(f=f.mod(r))}return i?a:(h&&(a=c.div(a)),r?a.mod(r):o?O(a,b,m,void 0):a)},l.integerValue=function(t){var r=new A(this);return null==t?t=m:or(t,0,8),O(r,r.e+1,t)},l.isEqualTo=l.eq=function(t,r){return 0===nr(this,new A(t,r))},l.isFinite=function(){return!!this.c},l.isGreaterThan=l.gt=function(t,r){return nr(this,new A(t,r))>0},l.isGreaterThanOrEqualTo=l.gte=function(t,r){return 1===(r=nr(this,new A(t,r)))||0===r},l.isInteger=function(){return!!this.c&&er(this.e/14)>this.c.length-2},l.isLessThan=l.lt=function(t,r){return nr(this,new A(t,r))<0},l.isLessThanOrEqualTo=l.lte=function(t,r){return-1===(r=nr(this,new A(t,r)))||0===r},l.isNaN=function(){return!this.s},l.isNegative=function(){return this.s<0},l.isPositive=function(){return this.s>0},l.isZero=function(){return!!this.c&&0==this.c[0]},l.minus=function(t,r){var e,i,n,o,s=this,h=s.s;if(r=(t=new A(t,r)).s,!h||!r)return new A(NaN);if(h!=r)return t.s=-r,s.plus(t);var u=s.e/14,a=t.e/14,f=s.c,l=t.c;if(!u||!a){if(!f||!l)return f?(t.s=-r,t):new A(l?s:NaN);if(!f[0]||!l[0])return l[0]?(t.s=-r,t):new A(f[0]?s:3==m?-0:0)}if(u=er(u),a=er(a),f=f.slice(),h=u-a){for((o=h<0)?(h=-h,n=f):(a=u,n=l),n.reverse(),r=h;r--;n.push(0));n.reverse()}else for(i=(o=(h=f.length)<(r=l.length))?h:r,h=r=0;r<i;r++)if(f[r]!=l[r]){o=f[r]<l[r];break}if(o&&(n=f,f=l,l=n,t.s=-t.s),(r=(i=l.length)-(e=f.length))>0)for(;r--;f[e++]=0);for(r=Qt-1;i>h;){if(f[--i]<l[i]){for(e=i;e&&!f[--e];f[e]=r);--f[e],f[i]+=Qt}f[i]-=l[i]}for(;0==f[0];f.splice(0,1),--a);return f[0]?N(t,f,a):(t.s=3==m?-1:1,t.c=[t.e=0],t)},l.modulo=l.mod=function(t,r){var i,n,o=this;return t=new A(t,r),!o.c||!t.s||t.c&&!t.c[0]?new A(NaN):!t.c||o.c&&!o.c[0]?new A(o):(9==M?(n=t.s,t.s=1,i=e(o,t,0,3),t.s=n,i.s*=n):i=e(o,t,0,M),(t=o.minus(i.times(t))).c[0]||1!=M||(t.s=o.s),t)},l.multipliedBy=l.times=function(t,r){var e,i,n,o,s,h,u,a,f,l,c,p,m,d,g=this,y=g.c,v=(t=new A(t,r)).c;if(!(y&&v&&y[0]&&v[0]))return!g.s||!t.s||y&&!y[0]&&!v||v&&!v[0]&&!y?t.c=t.e=t.s=null:(t.s*=g.s,y&&v?(t.c=[0],t.e=0):t.c=t.e=null),t;for(i=er(g.e/14)+er(t.e/14),t.s*=g.s,(u=y.length)<(l=v.length)&&(m=y,y=v,v=m,n=u,u=l,l=n),n=u+l,m=[];n--;m.push(0));for(d=Qt,1e7,n=l;--n>=0;){for(e=0,c=v[n]%1e7,p=v[n]/1e7|0,o=n+(s=u);o>n;)e=((a=c*(a=y[--s]%1e7)+(h=p*a+(f=y[s]/1e7|0)*c)%1e7*1e7+m[o]+e)/d|0)+(h/1e7|0)+p*f,m[o--]=a%d;m[o]=e}return e?++i:m.splice(0,1),N(t,m,i)},l.negated=function(){var t=new A(this);return t.s=-t.s||null,t},l.plus=function(t,r){var e,i=this,n=i.s;if(r=(t=new A(t,r)).s,!n||!r)return new A(NaN);if(n!=r)return t.s=-r,i.minus(t);var o=i.e/14,s=t.e/14,h=i.c,u=t.c;if(!o||!s){if(!h||!u)return new A(n/0);if(!h[0]||!u[0])return u[0]?t:new A(h[0]?i:0*n)}if(o=er(o),s=er(s),h=h.slice(),n=o-s){for(n>0?(s=o,e=u):(n=-n,e=h),e.reverse();n--;e.push(0));e.reverse()}for((n=h.length)-(r=u.length)<0&&(e=u,u=h,h=e,r=n),n=0;r;)n=(h[--r]=h[r]+u[r]+n)/Qt|0,h[r]=Qt===h[r]?0:h[r]%Qt;return n&&(h=[n].concat(h),++s),N(t,h,s)},l.precision=l.sd=function(t,r){var e,i,n,o=this;if(null!=t&&t!==!!t)return or(t,1,rr),null==r?r=m:or(r,0,8),O(new A(o),t,r);if(!(e=o.c))return null;if(i=14*(n=e.length-1)+1,n=e[n]){for(;n%10==0;n/=10,i--);for(n=e[0];n>=10;n/=10,i++);}return t&&o.e+1>i&&(i=o.e+1),i},l.shiftedBy=function(t){return or(t,-9007199254740991,9007199254740991),this.times("1e"+t)},l.squareRoot=l.sqrt=function(){var t,r,i,n,o,s=this,h=s.c,u=s.s,a=s.e,f=p+4,l=new A("0.5");if(1!==u||!h||!h[0])return new A(!u||u<0&&(!h||h[0])?NaN:h?s:1/0);if(0==(u=Math.sqrt(+I(s)))||u==1/0?(((r=ir(h)).length+a)%2==0&&(r+="0"),u=Math.sqrt(+r),a=er((a+1)/2)-(a<0||a%2),i=new A(r=u==1/0?"5e"+a:(r=u.toExponential()).slice(0,r.indexOf("e")+1)+a)):i=new A(u+""),i.c[0])for((u=(a=i.e)+f)<3&&(u=0);;)if(o=i,i=l.times(o.plus(e(s,o,f,1))),ir(o.c).slice(0,u)===(r=ir(i.c)).slice(0,u)){if(i.e<a&&--u,"9999"!=(r=r.slice(u-3,u+1))&&(n||"4999"!=r)){+r&&(+r.slice(1)||"5"!=r.charAt(0))||(O(i,i.e+p+2,1),t=!i.times(i).eq(s));break}if(!n&&(O(o,o.e+p+2,0),o.times(o).eq(s))){i=o;break}f+=4,u+=4,n=1}return O(i,i.e+p+1,m,t)},l.toExponential=function(t,r){return null!=t&&(or(t,0,rr),t++),E(this,t,r,1)},l.toFixed=function(t,r){return null!=t&&(or(t,0,rr),t=t+this.e+1),E(this,t,r)},l.toFormat=function(t,r,e){var i,n=this;if(null==e)null!=t&&r&&"object"==typeof r?(e=r,r=null):t&&"object"==typeof t?(e=t,t=r=null):e=_;else if("object"!=typeof e)throw Error(Jt+"Argument not an object: "+e);if(i=n.toFixed(t,r),n.c){var o,s=i.split("."),h=+e.groupSize,u=+e.secondaryGroupSize,a=e.groupSeparator||"",f=s[0],l=s[1],c=n.s<0,p=c?f.slice(1):f,m=p.length;if(u&&(o=h,h=u,u=o,m-=o),h>0&&m>0){for(o=m%h||h,f=p.substr(0,o);o<m;o+=h)f+=a+p.substr(o,h);u>0&&(f+=a+p.slice(o)),c&&(f="-"+f)}i=l?f+(e.decimalSeparator||"")+((u=+e.fractionGroupSize)?l.replace(new RegExp("\\d{"+u+"}\\B","g"),"$&"+(e.fractionGroupSeparator||"")):l):f}return(e.prefix||"")+i+(e.suffix||"")},l.toFraction=function(t){var r,i,n,o,s,h,u,a,f,l,p,d,g=this,y=g.c;if(null!=t&&(!(u=new A(t)).isInteger()&&(u.c||1!==u.s)||u.lt(c)))throw Error(Jt+"Argument "+(u.isInteger()?"out of range: ":"not an integer: ")+I(u));if(!y)return new A(g);for(r=new A(c),f=i=new A(c),n=a=new A(c),d=ir(y),s=r.e=d.length-g.e-1,r.c[0]=tr[(h=s%14)<0?14+h:h],t=!t||u.comparedTo(r)>0?s>0?r:f:u,h=v,v=1/0,u=new A(d),a.c[0]=0;l=e(u,r,0,1),1!=(o=i.plus(l.times(n))).comparedTo(t);)i=n,n=o,f=a.plus(l.times(o=f)),a=o,r=u.minus(l.times(o=r)),u=o;return o=e(t.minus(i),n,0,1),a=a.plus(o.times(f)),i=i.plus(o.times(n)),a.s=f.s=g.s,p=e(f,n,s*=2,m).minus(g).abs().comparedTo(e(a,i,s,m).minus(g).abs())<1?[f,n]:[a,i],v=h,p},l.toNumber=function(){return+I(this)},l.toPrecision=function(t,r){return null!=t&&or(t,1,rr),E(this,t,r,2)},l.toString=function(t){var r,e=this,n=e.s,o=e.e;return null===o?n?(r="Infinity",n<0&&(r="-"+r)):r="NaN":(null==t?r=o<=d||o>=g?hr(ir(e.c),o):ur(ir(e.c),o,"0"):10===t&&S?r=ur(ir((e=O(new A(e),p+o+1,m)).c),e.e,"0"):(or(t,2,T.length,"Base"),r=i(ur(ir(e.c),o,"0"),10,t,n,!0)),n<0&&e.c[0]&&(r="-"+r)),r},l.valueOf=l.toJSON=function(){return I(this)},l._isBigNumber=!0,l[Symbol.toStringTag]="BigNumber",l[Symbol.for("nodejs.util.inspect.custom")]=l.valueOf,null!=r&&A.set(r),A}(),fr=function(t){var r=wr(t),e=r[0],i=r[1];return 3*(e+i)/4-i},lr=function(t){var r,e,i=wr(t),n=i[0],o=i[1],s=new dr(function(t,r,e){return 3*(r+e)/4-e}(0,n,o)),h=0,u=o>0?n-4:n;for(e=0;e<u;e+=4)r=mr[t.charCodeAt(e)]<<18|mr[t.charCodeAt(e+1)]<<12|mr[t.charCodeAt(e+2)]<<6|mr[t.charCodeAt(e+3)],s[h++]=r>>16&255,s[h++]=r>>8&255,s[h++]=255&r;2===o&&(r=mr[t.charCodeAt(e)]<<2|mr[t.charCodeAt(e+1)]>>4,s[h++]=255&r);1===o&&(r=mr[t.charCodeAt(e)]<<10|mr[t.charCodeAt(e+1)]<<4|mr[t.charCodeAt(e+2)]>>2,s[h++]=r>>8&255,s[h++]=255&r);return s},cr=function(t){for(var r,e=t.length,i=e%3,n=[],o=0,s=e-i;o<s;o+=16383)n.push(Mr(t,o,o+16383>s?s:o+16383));1===i?(r=t[e-1],n.push(pr[r>>2]+pr[r<<4&63]+"==")):2===i&&(r=(t[e-2]<<8)+t[e-1],n.push(pr[r>>10]+pr[r>>4&63]+pr[r<<2&63]+"="));return n.join("")},pr=[],mr=[],dr="undefined"!=typeof Uint8Array?Uint8Array:Array,gr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",yr=0,vr=gr.length;yr<vr;++yr)pr[yr]=gr[yr],mr[gr.charCodeAt(yr)]=yr;function wr(t){var r=t.length;if(r%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var e=t.indexOf("=");return-1===e&&(e=r),[e,e===r?0:4-e%4]}function Mr(t,r,e){for(var i,n,o=[],s=r;s<e;s+=3)i=(t[s]<<16&16711680)+(t[s+1]<<8&65280)+(255&t[s+2]),o.push(pr[(n=i)>>18&63]+pr[n>>12&63]+pr[n>>6&63]+pr[63&n]);return o.join("")}mr["-".charCodeAt(0)]=62,mr["_".charCodeAt(0)]=63;var br={byteLength:fr,toByteArray:lr,fromByteArray:cr},_r=function(t,r,e,i,n){var o,s,h=8*n-i-1,u=(1<<h)-1,a=u>>1,f=-7,l=e?n-1:0,c=e?-1:1,p=t[r+l];for(l+=c,o=p&(1<<-f)-1,p>>=-f,f+=h;f>0;o=256*o+t[r+l],l+=c,f-=8);for(s=o&(1<<-f)-1,o>>=-f,f+=i;f>0;s=256*s+t[r+l],l+=c,f-=8);if(0===o)o=1-a;else{if(o===u)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,i),o-=a}return(p?-1:1)*s*Math.pow(2,o-i)},Tr=function(t,r,e,i,n,o){var s,h,u,a=8*o-n-1,f=(1<<a)-1,l=f>>1,c=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,p=i?0:o-1,m=i?1:-1,d=r<0||0===r&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(h=isNaN(r)?1:0,s=f):(s=Math.floor(Math.log(r)/Math.LN2),r*(u=Math.pow(2,-s))<1&&(s--,u*=2),(r+=s+l>=1?c/u:c*Math.pow(2,1-l))*u>=2&&(s++,u/=2),s+l>=f?(h=0,s=f):s+l>=1?(h=(r*u-1)*Math.pow(2,n),s+=l):(h=r*Math.pow(2,l-1)*Math.pow(2,n),s=0));n>=8;t[e+p]=255&h,p+=m,h/=256,n-=8);for(s=s<<n|h,a+=n;a>0;t[e+p]=255&s,p+=m,s/=256,a-=8);t[e+p-m]|=128*d},Sr=d((function(t,r){var e="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;r.Buffer=n,r.SlowBuffer=function(t){+t!=t&&(t=0);return n.alloc(+t)},r.INSPECT_MAX_BYTES=50;function i(t){if(t>2147483647)throw new RangeError('The value "'+t+'" is invalid for option "size"');var r=new Uint8Array(t);return Object.setPrototypeOf(r,n.prototype),r}function n(t,r,e){if("number"==typeof t){if("string"==typeof r)throw new TypeError('The "string" argument must be of type string. Received type number');return h(t)}return o(t,r,e)}function o(t,r,e){if("string"==typeof t)return function(t,r){"string"==typeof r&&""!==r||(r="utf8");if(!n.isEncoding(r))throw new TypeError("Unknown encoding: "+r);var e=0|l(t,r),o=i(e),s=o.write(t,r);s!==e&&(o=o.slice(0,s));return o}(t,r);if(ArrayBuffer.isView(t))return function(t){if(C(t,Uint8Array)){var r=new Uint8Array(t);return a(r.buffer,r.byteOffset,r.byteLength)}return u(t)}(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(C(t,ArrayBuffer)||t&&C(t.buffer,ArrayBuffer))return a(t,r,e);if("undefined"!=typeof SharedArrayBuffer&&(C(t,SharedArrayBuffer)||t&&C(t.buffer,SharedArrayBuffer)))return a(t,r,e);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');var o=t.valueOf&&t.valueOf();if(null!=o&&o!==t)return n.from(o,r,e);var s=function(t){if(n.isBuffer(t)){var r=0|f(t.length),e=i(r);return 0===e.length||t.copy(e,0,0,r),e}if(void 0!==t.length)return"number"!=typeof t.length||z(t.length)?i(0):u(t);if("Buffer"===t.type&&Array.isArray(t.data))return u(t.data)}(t);if(s)return s;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return n.from(t[Symbol.toPrimitive]("string"),r,e);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function s(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function h(t){return s(t),i(t<0?0:0|f(t))}function u(t){for(var r=t.length<0?0:0|f(t.length),e=i(r),n=0;n<r;n+=1)e[n]=255&t[n];return e}function a(t,r,e){if(r<0||t.byteLength<r)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<r+(e||0))throw new RangeError('"length" is outside of buffer bounds');var i;return i=void 0===r&&void 0===e?new Uint8Array(t):void 0===e?new Uint8Array(t,r):new Uint8Array(t,r,e),Object.setPrototypeOf(i,n.prototype),i}function f(t){if(t>=2147483647)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+2147483647..toString(16)+" bytes");return 0|t}function l(t,r){if(n.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||C(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);var e=t.length,i=arguments.length>2&&!0===arguments[2];if(!i&&0===e)return 0;for(var o=!1;;)switch(r){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":return L(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*e;case"hex":return e>>>1;case"base64":return D(t).length;default:if(o)return i?-1:L(t).length;r=(""+r).toLowerCase(),o=!0}}function c(t,r,e){var i=!1;if((void 0===r||r<0)&&(r=0),r>this.length)return"";if((void 0===e||e>this.length)&&(e=this.length),e<=0)return"";if((e>>>=0)<=(r>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return A(this,r,e);case"utf8":case"utf-8":return _(this,r,e);case"ascii":return T(this,r,e);case"latin1":case"binary":return S(this,r,e);case"base64":return b(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,r,e);default:if(i)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),i=!0}}function p(t,r,e){var i=t[r];t[r]=t[e],t[e]=i}function m(t,r,e,i,o){if(0===t.length)return-1;if("string"==typeof e?(i=e,e=0):e>2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),z(e=+e)&&(e=o?0:t.length-1),e<0&&(e=t.length+e),e>=t.length){if(o)return-1;e=t.length-1}else if(e<0){if(!o)return-1;e=0}if("string"==typeof r&&(r=n.from(r,i)),n.isBuffer(r))return 0===r.length?-1:d(t,r,e,i,o);if("number"==typeof r)return r&=255,"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(t,r,e):Uint8Array.prototype.lastIndexOf.call(t,r,e):d(t,[r],e,i,o);throw new TypeError("val must be string, number or Buffer")}function d(t,r,e,i,n){var o,s=1,h=t.length,u=r.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(t.length<2||r.length<2)return-1;s=2,h/=2,u/=2,e/=2}function a(t,r){return 1===s?t[r]:t.readUInt16BE(r*s)}if(n){var f=-1;for(o=e;o<h;o++)if(a(t,o)===a(r,-1===f?0:o-f)){if(-1===f&&(f=o),o-f+1===u)return f*s}else-1!==f&&(o-=o-f),f=-1}else for(e+u>h&&(e=h-u),o=e;o>=0;o--){for(var l=!0,c=0;c<u;c++)if(a(t,o+c)!==a(r,c)){l=!1;break}if(l)return o}return-1}function g(t,r,e,i){e=Number(e)||0;var n=t.length-e;i?(i=Number(i))>n&&(i=n):i=n;var o=r.length;i>o/2&&(i=o/2);for(var s=0;s<i;++s){var h=parseInt(r.substr(2*s,2),16);if(z(h))return s;t[e+s]=h}return s}function y(t,r,e,i){return R(L(r,t.length-e),t,e,i)}function v(t,r,e,i){return R(function(t){for(var r=[],e=0;e<t.length;++e)r.push(255&t.charCodeAt(e));return r}(r),t,e,i)}function w(t,r,e,i){return R(D(r),t,e,i)}function M(t,r,e,i){return R(function(t,r){for(var e,i,n,o=[],s=0;s<t.length&&!((r-=2)<0);++s)e=t.charCodeAt(s),i=e>>8,n=e%256,o.push(n),o.push(i);return o}(r,t.length-e),t,e,i)}function b(t,r,e){return 0===r&&e===t.length?br.fromByteArray(t):br.fromByteArray(t.slice(r,e))}function _(t,r,e){e=Math.min(t.length,e);for(var i=[],n=r;n<e;){var o,s,h,u,a=t[n],f=null,l=a>239?4:a>223?3:a>191?2:1;if(n+l<=e)switch(l){case 1:a<128&&(f=a);break;case 2:128==(192&(o=t[n+1]))&&(u=(31&a)<<6|63&o)>127&&(f=u);break;case 3:o=t[n+1],s=t[n+2],128==(192&o)&&128==(192&s)&&(u=(15&a)<<12|(63&o)<<6|63&s)>2047&&(u<55296||u>57343)&&(f=u);break;case 4:o=t[n+1],s=t[n+2],h=t[n+3],128==(192&o)&&128==(192&s)&&128==(192&h)&&(u=(15&a)<<18|(63&o)<<12|(63&s)<<6|63&h)>65535&&u<1114112&&(f=u)}null===f?(f=65533,l=1):f>65535&&(f-=65536,i.push(f>>>10&1023|55296),f=56320|1023&f),i.push(f),n+=l}return function(t){var r=t.length;if(r<=4096)return String.fromCharCode.apply(String,t);var e="",i=0;for(;i<r;)e+=String.fromCharCode.apply(String,t.slice(i,i+=4096));return e}(i)}r.kMaxLength=2147483647,n.TYPED_ARRAY_SUPPORT=function(){try{var t=new Uint8Array(1),r={foo:function(){return 42}};return Object.setPrototypeOf(r,Uint8Array.prototype),Object.setPrototypeOf(t,r),42===t.foo()}catch(t){return!1}}(),n.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(n.prototype,"parent",{enumerable:!0,get:function(){if(n.isBuffer(this))return this.buffer}}),Object.defineProperty(n.prototype,"offset",{enumerable:!0,get:function(){if(n.isBuffer(this))return this.byteOffset}}),n.poolSize=8192,n.from=function(t,r,e){return o(t,r,e)},Object.setPrototypeOf(n.prototype,Uint8Array.prototype),Object.setPrototypeOf(n,Uint8Array),n.alloc=function(t,r,e){return function(t,r,e){return s(t),t<=0?i(t):void 0!==r?"string"==typeof e?i(t).fill(r,e):i(t).fill(r):i(t)}(t,r,e)},n.allocUnsafe=function(t){return h(t)},n.allocUnsafeSlow=function(t){return h(t)},n.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==n.prototype},n.compare=function(t,r){if(C(t,Uint8Array)&&(t=n.from(t,t.offset,t.byteLength)),C(r,Uint8Array)&&(r=n.from(r,r.offset,r.byteLength)),!n.isBuffer(t)||!n.isBuffer(r))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===r)return 0;for(var e=t.length,i=r.length,o=0,s=Math.min(e,i);o<s;++o)if(t[o]!==r[o]){e=t[o],i=r[o];break}return e<i?-1:i<e?1:0},n.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},n.concat=function(t,r){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return n.alloc(0);var e;if(void 0===r)for(r=0,e=0;e<t.length;++e)r+=t[e].length;var i=n.allocUnsafe(r),o=0;for(e=0;e<t.length;++e){var s=t[e];if(C(s,Uint8Array))o+s.length>i.length?n.from(s).copy(i,o):Uint8Array.prototype.set.call(i,s,o);else{if(!n.isBuffer(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(i,o)}o+=s.length}return i},n.byteLength=l,n.prototype._isBuffer=!0,n.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var r=0;r<t;r+=2)p(this,r,r+1);return this},n.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var r=0;r<t;r+=4)p(this,r,r+3),p(this,r+1,r+2);return this},n.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var r=0;r<t;r+=8)p(this,r,r+7),p(this,r+1,r+6),p(this,r+2,r+5),p(this,r+3,r+4);return this},n.prototype.toString=function(){var t=this.length;return 0===t?"":0===arguments.length?_(this,0,t):c.apply(this,arguments)},n.prototype.toLocaleString=n.prototype.toString,n.prototype.equals=function(t){if(!n.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===n.compare(this,t)},n.prototype.inspect=function(){var t="",e=r.INSPECT_MAX_BYTES;return t=this.toString("hex",0,e).replace(/(.{2})/g,"$1 ").trim(),this.length>e&&(t+=" ... "),"<Buffer "+t+">"},e&&(n.prototype[e]=n.prototype.inspect),n.prototype.compare=function(t,r,e,i,o){if(C(t,Uint8Array)&&(t=n.from(t,t.offset,t.byteLength)),!n.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===r&&(r=0),void 0===e&&(e=t?t.length:0),void 0===i&&(i=0),void 0===o&&(o=this.length),r<0||e>t.length||i<0||o>this.length)throw new RangeError("out of range index");if(i>=o&&r>=e)return 0;if(i>=o)return-1;if(r>=e)return 1;if(this===t)return 0;for(var s=(o>>>=0)-(i>>>=0),h=(e>>>=0)-(r>>>=0),u=Math.min(s,h),a=this.slice(i,o),f=t.slice(r,e),l=0;l<u;++l)if(a[l]!==f[l]){s=a[l],h=f[l];break}return s<h?-1:h<s?1:0},n.prototype.includes=function(t,r,e){return-1!==this.indexOf(t,r,e)},n.prototype.indexOf=function(t,r,e){return m(this,t,r,e,!0)},n.prototype.lastIndexOf=function(t,r,e){return m(this,t,r,e,!1)},n.prototype.write=function(t,r,e,i){if(void 0===r)i="utf8",e=this.length,r=0;else if(void 0===e&&"string"==typeof r)i=r,e=this.length,r=0;else{if(!isFinite(r))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");r>>>=0,isFinite(e)?(e>>>=0,void 0===i&&(i="utf8")):(i=e,e=void 0)}var n=this.length-r;if((void 0===e||e>n)&&(e=n),t.length>0&&(e<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var o=!1;;)switch(i){case"hex":return g(this,t,r,e);case"utf8":case"utf-8":return y(this,t,r,e);case"ascii":case"latin1":case"binary":return v(this,t,r,e);case"base64":return w(this,t,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M(this,t,r,e);default:if(o)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),o=!0}},n.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};funct